/
githubmirror
/
drawio
Обзор
Документация
Войти
/
githubmirror
/
drawio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/webapp/js/app.min.js
16 034 строки
9 MB
David Benson
31.1.8 release
07 авг 2026, 02:43
07 авг 2026, 02:43
a1f615b
Код
Авторство
О чём код?
//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.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/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 … [Строка слишком длинная. Вы можете скачать файл] //# sourceMappingURL=purify.min.js.map /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ var CryptoJS=CryptoJS||function(u,p){var d={},l=d.lib={},s=function(){},t=l.Base={extend:function(a){s.prototype=this;var c=new s;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}, r=l.WordArray=t.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=p?c:4*a.length},toString:function(a){return(a||v).stringify(this)},concat:function(a){var c=this.words,e=a.words,j=this.sigBytes;a=a.sigBytes;this.clamp();if(j%4)for(var k=0;k<a;k++)c[j+k>>>2]|=(e[k>>>2]>>>24-8*(k%4)&255)<<24-8*((j+k)%4);else if(65535<e.length)for(k=0;k<a;k+=4)c[j+k>>>2]=e[k>>>2];else c.push.apply(c,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<< 32-8*(c%4);a.length=u.ceil(c/4)},clone:function(){var a=t.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],e=0;e<a;e+=4)c.push(4294967296*u.random()|0);return new r.init(c,a)}}),w=d.enc={},v=w.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++){var k=c[j>>>2]>>>24-8*(j%4)&255;e.push((k>>>4).toString(16));e.push((k&15).toString(16))}return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j+=2)e[j>>>3]|=parseInt(a.substr(j, 2),16)<<24-4*(j%8);return new r.init(e,c/2)}},b=w.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j<a;j++)e.push(String.fromCharCode(c[j>>>2]>>>24-8*(j%4)&255));return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j<c;j++)e[j>>>2]|=(a.charCodeAt(j)&255)<<24-8*(j%4);return new r.init(e,c)}},x=w.Utf8={stringify:function(a){try{return decodeURIComponent(escape(b.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return b.parse(unescape(encodeURIComponent(a)))}}, q=l.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=x.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,e=c.words,j=c.sigBytes,k=this.blockSize,b=j/(4*k),b=a?u.ceil(b):u.max((b|0)-this._minBufferSize,0);a=b*k;j=u.min(4*a,j);if(a){for(var q=0;q<a;q+=k)this._doProcessBlock(e,q);q=e.splice(0,a);c.sigBytes-=j}return new r.init(q,j)},clone:function(){var a=t.clone.call(this); a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:t.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,e){return(new a.init(e)).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return(new n.HMAC.init(a, e)).finalize(b)}}});var n=d.algo={};return d}(Math); (function(){var u=CryptoJS,p=u.lib.WordArray;u.enc.Base64={stringify:function(d){var l=d.words,p=d.sigBytes,t=this._map;d.clamp();d=[];for(var r=0;r<p;r+=3)for(var w=(l[r>>>2]>>>24-8*(r%4)&255)<<16|(l[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|l[r+2>>>2]>>>24-8*((r+2)%4)&255,v=0;4>v&&r+0.75*v<p;v++)d.push(t.charAt(w>>>6*(3-v)&63));if(l=t.charAt(64))for(;d.length%4;)d.push(l);return d.join("")},parse:function(d){var l=d.length,s=this._map,t=s.charAt(64);t&&(t=d.indexOf(t),-1!=t&&(l=t));for(var t=[],r=0,w=0;w< l;w++)if(w%4){var v=s.indexOf(d.charAt(w-1))<<2*(w%4),b=s.indexOf(d.charAt(w))>>>6-2*(w%4);t[r>>>2]|=(v|b)<<24-8*(r%4);r++}return p.create(t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); (function(u){function p(b,n,a,c,e,j,k){b=b+(n&a|~n&c)+e+k;return(b<<j|b>>>32-j)+n}function d(b,n,a,c,e,j,k){b=b+(n&c|a&~c)+e+k;return(b<<j|b>>>32-j)+n}function l(b,n,a,c,e,j,k){b=b+(n^a^c)+e+k;return(b<<j|b>>>32-j)+n}function s(b,n,a,c,e,j,k){b=b+(a^(n|~c))+e+k;return(b<<j|b>>>32-j)+n}for(var t=CryptoJS,r=t.lib,w=r.WordArray,v=r.Hasher,r=t.algo,b=[],x=0;64>x;x++)b[x]=4294967296*u.abs(u.sin(x+1))|0;r=r.MD5=v.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878])}, _doProcessBlock:function(q,n){for(var a=0;16>a;a++){var c=n+a,e=q[c];q[c]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var a=this._hash.words,c=q[n+0],e=q[n+1],j=q[n+2],k=q[n+3],z=q[n+4],r=q[n+5],t=q[n+6],w=q[n+7],v=q[n+8],A=q[n+9],B=q[n+10],C=q[n+11],u=q[n+12],D=q[n+13],E=q[n+14],x=q[n+15],f=a[0],m=a[1],g=a[2],h=a[3],f=p(f,m,g,h,c,7,b[0]),h=p(h,f,m,g,e,12,b[1]),g=p(g,h,f,m,j,17,b[2]),m=p(m,g,h,f,k,22,b[3]),f=p(f,m,g,h,z,7,b[4]),h=p(h,f,m,g,r,12,b[5]),g=p(g,h,f,m,t,17,b[6]),m=p(m,g,h,f,w,22,b[7]), f=p(f,m,g,h,v,7,b[8]),h=p(h,f,m,g,A,12,b[9]),g=p(g,h,f,m,B,17,b[10]),m=p(m,g,h,f,C,22,b[11]),f=p(f,m,g,h,u,7,b[12]),h=p(h,f,m,g,D,12,b[13]),g=p(g,h,f,m,E,17,b[14]),m=p(m,g,h,f,x,22,b[15]),f=d(f,m,g,h,e,5,b[16]),h=d(h,f,m,g,t,9,b[17]),g=d(g,h,f,m,C,14,b[18]),m=d(m,g,h,f,c,20,b[19]),f=d(f,m,g,h,r,5,b[20]),h=d(h,f,m,g,B,9,b[21]),g=d(g,h,f,m,x,14,b[22]),m=d(m,g,h,f,z,20,b[23]),f=d(f,m,g,h,A,5,b[24]),h=d(h,f,m,g,E,9,b[25]),g=d(g,h,f,m,k,14,b[26]),m=d(m,g,h,f,v,20,b[27]),f=d(f,m,g,h,D,5,b[28]),h=d(h,f, m,g,j,9,b[29]),g=d(g,h,f,m,w,14,b[30]),m=d(m,g,h,f,u,20,b[31]),f=l(f,m,g,h,r,4,b[32]),h=l(h,f,m,g,v,11,b[33]),g=l(g,h,f,m,C,16,b[34]),m=l(m,g,h,f,E,23,b[35]),f=l(f,m,g,h,e,4,b[36]),h=l(h,f,m,g,z,11,b[37]),g=l(g,h,f,m,w,16,b[38]),m=l(m,g,h,f,B,23,b[39]),f=l(f,m,g,h,D,4,b[40]),h=l(h,f,m,g,c,11,b[41]),g=l(g,h,f,m,k,16,b[42]),m=l(m,g,h,f,t,23,b[43]),f=l(f,m,g,h,A,4,b[44]),h=l(h,f,m,g,u,11,b[45]),g=l(g,h,f,m,x,16,b[46]),m=l(m,g,h,f,j,23,b[47]),f=s(f,m,g,h,c,6,b[48]),h=s(h,f,m,g,w,10,b[49]),g=s(g,h,f,m, E,15,b[50]),m=s(m,g,h,f,r,21,b[51]),f=s(f,m,g,h,u,6,b[52]),h=s(h,f,m,g,k,10,b[53]),g=s(g,h,f,m,B,15,b[54]),m=s(m,g,h,f,e,21,b[55]),f=s(f,m,g,h,v,6,b[56]),h=s(h,f,m,g,x,10,b[57]),g=s(g,h,f,m,t,15,b[58]),m=s(m,g,h,f,D,21,b[59]),f=s(f,m,g,h,z,6,b[60]),h=s(h,f,m,g,C,10,b[61]),g=s(g,h,f,m,j,15,b[62]),m=s(m,g,h,f,A,21,b[63]);a[0]=a[0]+f|0;a[1]=a[1]+m|0;a[2]=a[2]+g|0;a[3]=a[3]+h|0},_doFinalize:function(){var b=this._data,n=b.words,a=8*this._nDataBytes,c=8*b.sigBytes;n[c>>>5]|=128<<24-c%32;var e=u.floor(a/ 4294967296);n[(c+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;n[(c+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(n.length+1);this._process();b=this._hash;n=b.words;for(a=0;4>a;a++)c=n[a],n[a]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return b},clone:function(){var b=v.clone.call(this);b._hash=this._hash.clone();return b}});t.MD5=v._createHelper(r);t.HmacMD5=v._createHmacHelper(r)})(Math); (function(){var u=CryptoJS,p=u.lib,d=p.Base,l=p.WordArray,p=u.algo,s=p.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:p.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,r){for(var p=this.cfg,s=p.hasher.create(),b=l.create(),u=b.words,q=p.keySize,p=p.iterations;u.length<q;){n&&s.update(n);var n=s.update(d).finalize(r);s.reset();for(var a=1;a<p;a++)n=s.finalize(n),s.reset();b.concat(n)}b.sigBytes=4*q;return b}});u.EvpKDF=function(d,l,p){return s.create(p).compute(d, l)}})(); CryptoJS.lib.Cipher||function(u){var p=CryptoJS,d=p.lib,l=d.Base,s=d.WordArray,t=d.BufferedBlockAlgorithm,r=p.enc.Base64,w=p.algo.EvpKDF,v=d.Cipher=t.extend({cfg:l.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,b){this.cfg=this.cfg.extend(b);this._xformMode=e;this._key=a;this.reset()},reset:function(){t.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()}, finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(b,k,d){return("string"==typeof k?c:a).encrypt(e,b,k,d)},decrypt:function(b,k,d){return("string"==typeof k?c:a).decrypt(e,b,k,d)}}}});d.StreamCipher=v.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var b=p.mode={},x=function(e,a,b){var c=this._iv;c?this._iv=u:c=this._prevBlock;for(var d=0;d<b;d++)e[a+d]^= c[d]},q=(d.BlockCipherMode=l.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e;this._iv=a}})).extend();q.Encryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize;x.call(this,e,a,c);b.encryptBlock(e,a);this._prevBlock=e.slice(a,a+c)}});q.Decryptor=q.extend({processBlock:function(e,a){var b=this._cipher,c=b.blockSize,d=e.slice(a,a+c);b.decryptBlock(e,a);x.call(this, e,a,c);this._prevBlock=d}});b=b.CBC=q;q=(p.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,l=[],n=0;n<c;n+=4)l.push(d);c=s.create(l,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};d.BlockCipher=v.extend({cfg:v.cfg.extend({mode:b,padding:q}),reset:function(){v.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a, this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=d.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),b=(p.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?s.create([1398893684, 1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=s.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},a=d.SerializableCipher=l.extend({cfg:l.extend({format:b}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var l=a.createEncryptor(c,d);b=l.finalize(b);l=l.cfg;return n.create({ciphertext:b,key:c,iv:l.iv,algorithm:a,mode:l.mode,padding:l.padding,blockSize:a.blockSize,formatter:d.format})}, decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),p=(p.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=s.random(8));a=w.create({keySize:b+c}).compute(a,d);c=s.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},c=d.PasswordBasedCipher=a.extend({cfg:a.cfg.extend({kdf:p}),encrypt:function(b,c,d,l){l=this.cfg.extend(l);d=l.kdf.execute(d, b.keySize,b.ivSize);l.iv=d.iv;b=a.encrypt.call(this,b,c,d.key,l);b.mixIn(d);return b},decrypt:function(b,c,d,l){l=this.cfg.extend(l);c=this._parse(c,l.format);d=l.kdf.execute(d,b.keySize,b.ivSize,c.salt);l.iv=d.iv;return a.decrypt.call(this,b,c,d.key,l)}})}(); (function(){for(var u=CryptoJS,p=u.lib.BlockCipher,d=u.algo,l=[],s=[],t=[],r=[],w=[],v=[],b=[],x=[],q=[],n=[],a=[],c=0;256>c;c++)a[c]=128>c?c<<1:c<<1^283;for(var e=0,j=0,c=0;256>c;c++){var k=j^j<<1^j<<2^j<<3^j<<4,k=k>>>8^k&255^99;l[e]=k;s[k]=e;var z=a[e],F=a[z],G=a[F],y=257*a[k]^16843008*k;t[e]=y<<24|y>>>8;r[e]=y<<16|y>>>16;w[e]=y<<8|y>>>24;v[e]=y;y=16843009*G^65537*F^257*z^16843008*e;b[k]=y<<24|y>>>8;x[k]=y<<16|y>>>16;q[k]=y<<8|y>>>24;n[k]=y;e?(e=z^a[a[a[G^z]]],j^=a[a[j]]):e=j=1}var H=[0,1,2,4,8, 16,32,64,128,27,54],d=d.AES=p.extend({_doReset:function(){for(var a=this._key,c=a.words,d=a.sigBytes/4,a=4*((this._nRounds=d+6)+1),e=this._keySchedule=[],j=0;j<a;j++)if(j<d)e[j]=c[j];else{var k=e[j-1];j%d?6<d&&4==j%d&&(k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255]):(k=k<<8|k>>>24,k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255],k^=H[j/d|0]<<24);e[j]=e[j-d]^k}c=this._invKeySchedule=[];for(d=0;d<a;d++)j=a-d,k=d%4?e[j]:e[j-4],c[d]=4>d||4>=j?k:b[l[k>>>24]]^x[l[k>>>16&255]]^q[l[k>>> 8&255]]^n[l[k&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,t,r,w,v,l)},decryptBlock:function(a,c){var d=a[c+1];a[c+1]=a[c+3];a[c+3]=d;this._doCryptBlock(a,c,this._invKeySchedule,b,x,q,n,s);d=a[c+1];a[c+1]=a[c+3];a[c+3]=d},_doCryptBlock:function(a,b,c,d,e,j,l,f){for(var m=this._nRounds,g=a[b]^c[0],h=a[b+1]^c[1],k=a[b+2]^c[2],n=a[b+3]^c[3],p=4,r=1;r<m;r++)var q=d[g>>>24]^e[h>>>16&255]^j[k>>>8&255]^l[n&255]^c[p++],s=d[h>>>24]^e[k>>>16&255]^j[n>>>8&255]^l[g&255]^c[p++],t= d[k>>>24]^e[n>>>16&255]^j[g>>>8&255]^l[h&255]^c[p++],n=d[n>>>24]^e[g>>>16&255]^j[h>>>8&255]^l[k&255]^c[p++],g=q,h=s,k=t;q=(f[g>>>24]<<24|f[h>>>16&255]<<16|f[k>>>8&255]<<8|f[n&255])^c[p++];s=(f[h>>>24]<<24|f[k>>>16&255]<<16|f[n>>>8&255]<<8|f[g&255])^c[p++];t=(f[k>>>24]<<24|f[n>>>16&255]<<16|f[g>>>8&255]<<8|f[h&255])^c[p++];n=(f[n>>>24]<<24|f[g>>>16&255]<<16|f[h>>>8&255]<<8|f[k&255])^c[p++];a[b]=q;a[b+1]=s;a[b+2]=t;a[b+3]=n},keySize:8});u.AES=p._createHelper(d)})(); /*! pako 2.2.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= … [Строка слишком длинная. Вы можете скачать файл] 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+ … [Строка слишком длинная. Вы можете скачать файл] (()=>{"use strict";var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();const{PI:n}=Math,e=n+1e-4,r=[1,1];function u(t,n,e,r=t=>t){return t*r(.5-n*(.5-e))}const{min:i}=Math;function o(t,n,e){let r=i(1,n/e);return i(1,t+(i(1,1-r)-t)*(.275*r))}function c(t,n){return[t[0]+n[0],t[1]+n[1]]}function s(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function l(t,n){return[t[0]-n[0],t[1]-n[1]]}function h(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function f(t,n){return[t[0]*n,t[1]*n]}function p(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function a(t){return[t[1],-t[0]]}function g(t,n){let e=n[0];return t[0]=n[1],t[1]=-e,t}function d(t,n){return t[0]*n[0]+t[1]*n[1]}function v(t,n){return t[0]===n[0]&&t[1]===n[1]}function M(t,n){let e=t[0]-n[0],r=t[1]-n[1];return e*e+r*r}function m(t){return function(t,n){return[t[0]/n,t[1]/n]}(t,function(t){return Math.hypot(t[0],t[1])}(t))}function y(t,n){return Math.hypot(t[1]-n[1],t[0]-n[0])}function P(t,n,e){let r=Math.sin(e),u=Math.cos(e),i=t[0]-n[0],o=t[1]-n[1],c=i*r+o*u;return[i*u-o*r+n[0],c+n[1]]}function w(t,n,e,r){let u=Math.sin(r),i=Math.cos(r),o=n[0]-e[0],c=n[1]-e[1],s=o*i-c*u,l=o*u+c*i;return t[0]=s+e[0],t[1]=l+e[1],t}function F(t,n,e){return c(t,f(l(n,t),e))}function b(t,n,e,r){let u=e[0]-n[0],i=e[1]-n[1];return t[0]=n[0]+u*r,t[1]=n[1]+i*r,t}function L(t,n,e){return c(t,f(n,e))}const j=[0,0],x=[0,0],S=[0,0];function k(t,n){let r=L(t,m(a(l(t,c(t,[1,1])))),-n),u=[],i=1/13;for(let n=i;n<=1;n+=i)u.push(P(r,t,2*e*n));return u}function z(t,n,r){let u=[],i=1/r;for(let r=i;r<=1;r+=i)u.push(P(n,t,e*r));return u}function A(t,n,e){let r=l(n,e),u=f(r,.5),i=f(r,.51);return[l(t,u),l(t,i),c(t,i),c(t,u)]}function T(t,n,r,u){let i=[],o=L(t,n,r),c=1/u;for(let n=c;n<1;n+=c)i.push(P(o,t,3*e*n));return i}function I(t,n,e){return[c(t,f(n,e)),c(t,f(n,.99*e)),l(t,f(n,.99*e)),l(t,f(n,e))]}function Q(t,n,e){return!1===t||void 0===t?0:!0===t?Math.max(n,e):t}function Z(t,n={}){let{size:r=16,smoothing:i=.5,thinning:f=.5,simulatePressure:v=!0,easing:m=t=>t,start:y={},end:P={},last:F=!1}=n,{cap:L=!0,easing:Z=t=>t*(2-t)}=y,{cap:q=!0,easing:B=t=>--t*t*t+1}=P;if(0===t.length||r<=0)return[];let C,D=t[t.length-1].runningLength,E=Q(y.taper,r,D),G=Q(P.taper,r,D),H=(r*i)**2,J=[],K=[],N=function(t,n,e){return t.slice(0,10).reduce(((t,r)=>{let u=r.pressure;return n&&(u=o(t,r.distance,e)),(t+u)/2}),t[0].pressure)}(t,v,r),O=u(r,f,t[t.length-1].pressure,m),R=t[0].vector,U=t[0].point,V=U,W=U,X=V,Y=!1;for(let n=0;n<t.length;n++){let{pressure:i}=t[n],{point:a,vector:y,distance:P,runningLength:F}=t[n],L=n===t.length-1;if(!L&&D-F<3)continue;f?(v&&(i=o(N,P,r)),O=u(r,f,i,m)):O=r/2,void 0===C&&(C=O);let k=F<E?Z(F/E):1,z=D-F<G?B((D-F)/G):1;O=Math.max(.01,O*Math.min(k,z));let A=(L?t[n]:t[n+1]).vector,T=L?1:d(y,A),I=null!==T&&T<0;if(d(y,R)<0&&!Y||I){g(j,R),p(j,j,O);for(let t=0;t<=1;t+=.07692307692307693)h(x,a,j),w(x,x,a,e*t),W=[x[0],x[1]],J.push(W),s(S,a,j),w(S,S,a,e*-t),X=[S[0],S[1]],K.push(X);U=W,V=X,I&&(Y=!0)}else Y=!1,L?(g(j,y),p(j,j,O),J.push(l(a,j)),K.push(c(a,j))):(b(j,A,y,T),g(j,j),p(j,j,O),h(x,a,j),W=[x[0],x[1]],(n<=1||M(U,W)>H)&&(J.push(W),U=W),s(S,a,j),X=[S[0],S[1]],(n<=1||M(V,X)>H)&&(K.push(X),V=X),N=i,R=y)}let $=[t[0].point[0],t[0].point[1]],_=t.length>1?[t[t.length-1].point[0],t[t.length-1].point[1]]:c(t[0].point,[1,1]),tt=[],nt=[];if(1===t.length){if(!E&&!G||F)return k($,C||O)}else{E||G&&1===t.length||(L?tt.push(...z($,K[0],13)):tt.push(...A($,J[0],K[0])));let n=a(function(t){return[-t[0],-t[1]]}(t[t.length-1].vector));G||E&&1===t.length?nt.push(_):q?nt.push(...T(_,n,O,29)):nt.push(...I(_,n,O))}return J.concat(nt,K.reverse(),tt)}const q=[0,0];function B(t){return null!=t&&t>=0}function C(t,n={}){return Z(function(t,n={}){let{streamline:e=.5,size:u=16,last:i=!1}=n;if(0===t.length)return[];let o=.15+.85*(1-e),s=Array.isArray(t[0])?t:t.map((({x:t,y:n,pressure:e=.5})=>[t,n,e]));if(2===s.length){let t=s[1];s=s.slice(0,-1);for(let n=1;n<5;n++)s.push(F(s[0],t,n/4))}1===s.length&&(s=[...s,[...c(s[0],r),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:B(s[0][2])?s[0][2]:.25,vector:[...r],distance:0,runningLength:0}],f=!1,p=0,a=l[0],g=s.length-1;for(let t=1;t<s.length;t++){let n=i&&t===g?[s[t][0],s[t][1]]:F(a.point,s[t],o);if(v(a.point,n))continue;let e=y(n,a.point);if(p+=e,t<g&&!f){if(p<u)continue;f=!0}h(q,a.point,n),a={point:n,pressure:B(s[t][2])?s[t][2]:.5,vector:m(q),distance:e,runningLength:p},l.push(a)}return l[0].vector=l[1]?.vector||[0,0],l}(t,n),n)}t.g.PerfectFreehand={},PerfectFreehand.getStroke=function(t,n){return C(t,n)},PerfectFreehand.getSvgPathFromStroke=function(t,n){let e=C(t,n);const r=e.reduce(((t,[n,e],r,u)=>{const[i,o]=u[(r+1)%u.length];return t.push(n,e,(n+i)/2,(e+o)/2),t}),["M",...e[0],"Q"]);return r.push("Z"),r.join(" ")}})(); var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d=0;for(null!=b&&b||(a=Base64._utf8_encode(a));d<a.length;){var e=a.charCodeAt(d++);b=a.charCodeAt(d++);var f=a.charCodeAt(d++);var g=e>>2;e=(e&3)<<4|b>>4;var k=(b&15)<<2|f>>6;var l=f&63;isNaN(b)?k=l=64:isNaN(f)&&(l=64);c=c+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(k)+this._keyStr.charAt(l)}return c},decode:function(a,b){b=null!=b?b:!1;var c="",d=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g, "");d<a.length;){var e=this._keyStr.indexOf(a.charAt(d++));var f=this._keyStr.indexOf(a.charAt(d++));var g=this._keyStr.indexOf(a.charAt(d++));var k=this._keyStr.indexOf(a.charAt(d++));e=e<<2|f>>4;f=(f&15)<<4|g>>2;var l=(g&3)<<6|k;c+=String.fromCharCode(e);64!=g&&(c+=String.fromCharCode(f));64!=k&&(c+=String.fromCharCode(l))}b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(55296<=d&&56319>=d){var e= a.charCodeAt(c+1);56320<=e&&57343>=e&&(d=((d&1023)<<10)+(e&1023)+65536,c++)}128>d?b+=String.fromCharCode(d):(2048>d?b+=String.fromCharCode(d>>6|192):(65536>d?b+=String.fromCharCode(d>>12|224):(b+=String.fromCharCode(d>>18|240),b+=String.fromCharCode(d>>12&63|128)),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0;for(c1=c2=0;c<a.length;){var d=a.charCodeAt(c);if(128>d)b+=String.fromCharCode(d),c++;else if(191<d&&224>d)c2=a.charCodeAt(c+ 1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2;else if(240>d)c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3;else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);var e=a.charCodeAt(c+3);b+=String.fromCodePoint((d&7)<<18|(c2&63)<<12|(c3&63)<<6|e&63);c+=4}}return b}};window.urlParams=window.urlParams||{};if(null==window.mxIsElectron||"1"==urlParams.embed)window.mxIsElectron=!1;window.isLocalStorage=window.isLocalStorage||!1;window.mxLoadSettings=window.mxLoadSettings||"1"!=urlParams.configure;window.isSvgBrowser=!0;window.isMermaidEnabled="function"===typeof structuredClone; window.DRAWIO_BASE_URL=window.DRAWIO_BASE_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.location.protocol+"//"+window.location.hostname:"https://app.diagrams.net");window.DRAWIO_SERVER_URL=window.DRAWIO_SERVER_URL||window.location.origin+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/";window.DRAWIO_LIGHTBOX_URL=window.DRAWIO_LIGHTBOX_URL||"https://viewer.diagrams.net"; window.EXPORT_URL=window.EXPORT_URL||"https://convert.diagrams.net/node/export";window.DRAW_MATH_URL=window.DRAW_MATH_URL||"math4/es5";window.VSS_CONVERT_URL=window.VSS_CONVERT_URL||"https://convert.diagrams.net/VsdConverter/api/converter";window.REALTIME_URL=window.REALTIME_URL||window.DRAWIO_SERVER_URL+"cache";window.DRAWIO_GITLAB_URL=window.DRAWIO_GITLAB_URL||"https://gitlab.com";window.DRAWIO_GITLAB_ID=window.DRAWIO_GITLAB_ID||"2b14debc5feeb18ba65358d863ec870e4cc9294b28c3c941cb3014eb4af9a9b4"; window.DRAWIO_GITHUB_URL=window.DRAWIO_GITHUB_URL||"https://github.com";window.DRAWIO_GITHUB_API_URL=window.DRAWIO_GITHUB_API_URL||"https://api.github.com";window.DRAWIO_GITHUB_ID=window.DRAWIO_GITHUB_ID||"Iv1.98d62f0431e40543";window.DRAWIO_DROPBOX_ID=window.DRAWIO_DROPBOX_ID||"jg02tc0onwmhlgm";window.SAVE_URL=window.SAVE_URL||window.DRAWIO_SERVER_URL+"save";window.OPEN_URL=window.OPEN_URL||window.DRAWIO_SERVER_URL+"import";window.PROXY_URL=window.PROXY_URL||window.DRAWIO_SERVER_URL+"proxy"; window.DRAWIO_VIEWER_URL=window.DRAWIO_VIEWER_URL||null;window.NOTIFICATIONS_URL=window.NOTIFICATIONS_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.DRAWIO_SERVER_URL+"notifications":null);window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt"; window.DRAWIO_ATLASSIAN_PROMPT_LENGTH=null!=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH?window.DRAWIO_ATLASSIAN_PROMPT_LENGTH:1E5;window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"iconSearch2":window.DRAWIO_SERVER_URL+"iconSearch2"); window.ICON_SERVICE_PATH=window.ICON_SERVICE_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"api/icons":window.DRAWIO_SERVER_URL+"api/icons");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.NEW_DIAGRAM_CATS_PATH=window.NEW_DIAGRAM_CATS_PATH||"newDiagramCats";window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";window.ALLOW_CUSTOM_PLUGINS=window.ALLOW_CUSTOM_PLUGINS||!1;window.RESOURCES_PATH=window.RESOURCES_PATH||"resources"; window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1; window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null);if(!a&&window.mxIsElectron&&(a=urlParams.appLang,null!=a)){var c=a.indexOf("-");0<=c&&(a=a.substring(0,c));a=a.toLowerCase()}}catch(d){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",eu:"Euskara",fil:"Filipino",fr:"Français",gl:"Galego",it:"Italiano",hu:"Magyar",kl:"Kalaallisut",lt:"Lietuvių",lv:"Latviešu",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά", ru:"Русский",sr:"Српски",uk:"Українська",he:"עברית",ar:"العربية",fa:"فارسی",th:"ไทย",ta:"தமிழ்",ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph",window.mxImageBasePath="mxgraph/images"); if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang);if(null==window.mxLanguage&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"viewer.diagrams.net"==window.location.hostname||"embed.diagrams.net"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)&&(lang=navigator.language,null!=lang)){var dash=lang.indexOf("-");0<dash&&(lang= lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0"); "1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}(); (function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0, 8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c, b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0"; "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"],FORBID_ATTR:["data-icon","data-icon-content"],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:"31.1.8",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),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||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion), IS_LINUX:/\bLinux\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_SVG},link:function(a,b,c,d){c=c||document;var e=c.createElement("link");e.setAttribute("rel",a);e.setAttribute("href",b);e.setAttribute("charset","UTF-8");e.setAttribute("type", "text/css");d&&e.setAttribute("id",d);c.getElementsByTagName("head")[0].appendChild(e)},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1); "undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath="."; "undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath="images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:navigator.language;mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en"; mxLoadStylesheets&&mxClient.link("stylesheet","mxgraph/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages); var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var a=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,b=document.createElement("table");b.setAttribute("width","100%");b.setAttribute("height","100%");var c=document.createElement("tbody"),d=document.createElement("tr"),e=document.createElement("td");e.style.verticalAlign="top";mxLog.textarea=document.createElement("textarea");mxLog.textarea.setAttribute("wrap","off"); mxLog.textarea.setAttribute("readOnly","true");mxLog.textarea.style.height="100%";mxLog.textarea.style.resize="none";mxLog.textarea.value=mxLog.buffer;mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%";e.appendChild(mxLog.textarea);d.appendChild(e);c.appendChild(d);d=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");d.appendChild(mxLog.td);c.appendChild(d);b.appendChild(c); mxLog.addButton("Info",function(g){mxLog.info()});mxLog.addButton("DOM",function(g){g=mxUtils.getInnerHtml(document.body);mxLog.debug(g)});mxLog.addButton("Trace",function(g){mxLog.TRACE=!mxLog.TRACE;mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")});mxLog.addButton("Show",function(g){try{mxUtils.popup(mxLog.textarea.value)}catch(k){mxUtils.alert(k)}});mxLog.addButton("Clear",function(g){mxLog.textarea.value=""});d=c=0;"number"===typeof window.innerWidth?(c=window.innerHeight, d=window.innerWidth):(c=document.documentElement.clientHeight||document.body.clientHeight,d=document.body.clientWidth);mxLog.window=new mxWindow(a,b,Math.max(0,d-320),Math.max(0,c-210),300,160);mxLog.window.setMaximizable(!0);mxLog.window.setScrollable(!1);mxLog.window.setResizable(!0);mxLog.window.setClosable(!0);mxLog.window.destroyOnClose=!1;mxLog.window.title.style.paddingRight="80px";mxLog.window.title.setAttribute("title",a);if(mxClient.IS_NS&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!= document.compatMode||11==document.documentMode){var f=mxLog.window.getElement();a=function(g,k){mxLog.textarea.style.height=Math.max(0,f.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a);mxLog.window.addListener(mxEvent.MAXIMIZE,a);mxLog.window.addListener(mxEvent.NORMALIZE,a);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(a,b){var c=document.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click", b);mxLog.td.appendChild(c)},isVisible:function(){return null!=mxLog.window?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(a){null==mxLog.window&&mxLog.init();null!=mxLog.window&&mxLog.window.setVisible(a)},enter:function(a){if(mxLog.TRACE)return mxLog.writeln("Entering "+a),(new Date).getTime()},leave:function(a,b){mxLog.TRACE&&(b=0!=b?" ("+((new Date).getTime()-b)+" ms)":"",mxLog.writeln("Leaving "+a+b))},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this, arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=a},writeln:function(){for(var a="",b=0;b<arguments.length;b++)a+= arguments[b],b<arguments.length-1&&(a+=" ");mxLog.write(a+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(a){if(null!=a){if(null==a[mxObjectIdentity.FIELD_NAME])if("object"===typeof a){var b=mxUtils.getFunctionName(a.constructor);a[mxObjectIdentity.FIELD_NAME]=b+"#"+mxObjectIdentity.counter++}else"function"===typeof a&&(a[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return a[mxObjectIdentity.FIELD_NAME]}return null},clear:function(a){"object"!==typeof a&& "function"!==typeof a||delete a[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(a){a=mxObjectIdentity.get(a);return this.map[a]};mxDictionary.prototype.put=function(a,b){a=mxObjectIdentity.get(a);var c=this.map[a];this.map[a]=b;return c};mxDictionary.prototype.remove=function(a){a=mxObjectIdentity.get(a);var b=this.map[a];delete this.map[a];return b}; mxDictionary.prototype.getCount=function(){var a=0,b;for(b in this.map)a++;return a};mxDictionary.prototype.getKeys=function(){var a=[],b;for(b in this.map)a.push(b);return a};mxDictionary.prototype.getValues=function(){var a=[],b;for(b in this.map)a.push(this.map[b]);return a};mxDictionary.prototype.visit=function(a){for(var b in this.map)a(b,this.map[b])}; var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(a){return null!=mxClient.languages?0<=mxUtils.indexOf(mxClient.languages,a):!0},getDefaultBundle:function(a,b){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(b)?a+mxResources.extension:null},getSpecialBundle:function(a,b){if(null==mxClient.languages||!this.isLanguageSupported(b)){var c=b.indexOf("-");0<c&&(b=b.substring(0,c))}return mxResources.loadSpecialBundle&& mxResources.isLanguageSupported(b)&&b!=mxClient.defaultLanguage?a+"_"+b+mxResources.extension:null},add:function(a,b,c){b=null!=b?b:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE;if(b!=mxConstants.NONE){var d=mxResources.getDefaultBundle(a,b),e=mxResources.getSpecialBundle(a,b),f=function(){if(null!=e)if(c)mxUtils.get(e,function(l){mxResources.parse(l.getText());c()},function(){c()});else try{var k=mxUtils.load(e);k.isReady()&&mxResources.parse(k.getText())}catch(l){}else null!= c&&c()};if(null!=d)if(c)mxUtils.get(d,function(k){mxResources.parse(k.getText());f()},function(){f()});else try{var g=mxUtils.load(d);g.isReady()&&mxResources.parse(g.getText());f()}catch(k){}else f()}},parse:function(a){if(null!=a){a=a.split("\n");for(var b=0;b<a.length;b++)if("#"!=a[b].charAt(0)){var c=a[b].indexOf("=");if(0<c){var d=a[b].substring(0,c),e=a[b].length;13==a[b].charCodeAt(e-1)&&e--;c=a[b].substring(c+1,e);this.resourcesEncoded?(c=c.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[d]= unescape(c)):mxResources.resources[d]=c}}}},containsKey:function(a){return null!=mxResources.resources[a]},get:function(a,b,c){a=mxResources.resources[a];null==a&&(a=c);null!=a&&null!=b&&(a=mxResources.replacePlaceholders(a,b));return a},replacePlaceholders:function(a,b){for(var c=[],d=null,e=0;e<a.length;e++){var f=a.charAt(e);"{"==f?d="":null!=d&&"}"==f?(d=parseInt(d)-1,0<=d&&d<b.length&&c.push(b[d]),d=null):null!=d?d+=f:c.push(f)}return c.join("")},loadResources:function(a){mxResources.add(mxClient.basePath+ "/resources/editor",null,function(){mxResources.add(mxClient.basePath+"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint; mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2}; mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}}; mxRectangle.prototype.intersectsPoint=function(a,b){return a>=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height};mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a}; mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};mxRectangle.fromPoint=function(a){return new mxRectangle(a.x,a.y,0,0)};mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)}; var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;k<b.length;k++){var l=b[k];if(l instanceof mxGeometryChange||l instanceof mxTerminalChange||l instanceof mxValueChange||l instanceof mxChildChange||l instanceof mxStyleChange){var m=a.getView().getState(l.cell||l.child,!1);if(null!=m)if(g=!0,l.constructor!=mxGeometryChange||a.model.isEdge(l.cell))mxUtils.setOpacity(m.shape.node,100*d/10);else{var n=a.getView().scale,p=(l.geometry.x-l.previous.x)*n,q=(l.geometry.y- l.previous.y)*n,r=(l.geometry.width-l.previous.width)*n;n*=l.geometry.height-l.previous.height;0==d?(m.x-=p,m.y-=q,m.width-=r,m.height-=n):(m.x+=p/10,m.y+=q/10,m.width+=r/10,m.height+=n/10);a.cellRenderer.redraw(m);mxEffects.cascadeOpacity(a,l.cell,100*d/10)}}}10>d&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;e<d;e++){var f=a.model.getChildAt(b,e),g=a.getView().getState(f);null!=g&&(mxUtils.setOpacity(g.shape.node,c), mxEffects.cascadeOpacity(a,f,c))}b=a.model.getEdges(b);if(null!=b)for(e=0;e<b.length;e++)d=a.getView().getState(b[e]),null!=d&&mxUtils.setOpacity(d.shape.node,c)},fadeOut:function(a,b,c,d,e,f){d=d||40;e=e||30;var g=b||100;mxUtils.setOpacity(a,g);if(f||null==f){var k=function(){g=Math.max(g-d,0);mxUtils.setOpacity(a,g);0<g?window.setTimeout(k,e):(a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a))};window.setTimeout(k,e)}else a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a)}}, mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",lightDarkColorSupported:function(){var a=document.createElement("div");a.style.color="light-dark(white, black)";a=a.style.color;null!=a&&"generic-light-dark("===a.substring(0,19)&&(a=a.replace("generic-light-dark","light-dark"));return"light-dark(white, black)"===a}(),preferDarkColor:!1,lightDarkColorRegex:/light-dark\(\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*,\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*\)/, varColorRegex:/^var\([^)]+\)/,hexColorRegex:/(^#[a-zA-Z0-9]*$)/,rgbaColorRegex:/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i,canvasContext:function(){var a=null;try{a=document.createElement("canvas").getContext("2d")}catch(b){}return a}(),validInvalidColor:"rgba(0, 0, 0, 0)",normalizedValidInvalidColor:"rgba(0,0,0,0)",removeCursors:function(a){null!=a.style&&(a.style.cursor="");a=a.childNodes;if(null!=a)for(var b=a.length,c=0;c<b;c+=1)mxUtils.removeCursors(a[c])},getCurrentStyle:function(a){return null!= a?window.getComputedStyle(a,""):null},getCssFontFamily:function(a){if("string"===typeof a){a=a.split(",");for(var b=0;b<a.length;b++)a[b]=mxUtils.trim(a[b]),'"'==a[b].charAt(0)&&'"'==a[b].charAt(a[b].length-1)&&(a[b]=a[b].substring(1,a[b].length-1));a=a.join(", ")}return a},parseCssFontFamily:function(a,b){if("string"===typeof a){a=a.split(",");for(var c=0;c<a.length;c++){a[c]=mxUtils.trim(a[c]);var d=2<a[c].length&&('"'==a[c].charAt(a[c].length-1)&&'"'==a[c].charAt(0)||"'"==a[c].charAt(a[c].length- 1)&&"'"==a[c].charAt(0));d&&(a[c]=a[c].substring(1,a[c].length-1));d=d||!/^-?[A-Za-z_\u00A0-\uFFFF][\w\u00A0-\uFFFF-]*$/.test(a[c]);b&&(a[c]=mxUtils.htmlEntities(a[c]));d&&(a[c]="'"+a[c].replace(/'/g,"\\'")+"'")}a=a.join(", ")}return a},parseCssNumber:function(a){"thin"==a?a="2":"medium"==a?a="4":"thick"==a&&(a="6");a=parseFloat(a);isNaN(a)&&(a=0);return a},parseCssSpacing:function(a){var b=null;if(null!=a&&""!==a){var c=String(a).split(/\s+/);a=[];for(var d=0;d<c.length&&4>a.length;d++)if(0<c[d].length){var e= parseFloat(c[d]);a.push(isFinite(e)?Math.max(0,e):0)}0<a.length&&(c=a[0],d=1<a.length?a[1]:c,e=2<a.length?a[2]:c,a=3<a.length?a[3]:d,0<c||0<d||0<e||0<a)&&(b={top:c,right:d,bottom:e,left:a})}return b},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT&&(a="Moz");return function(b,c,d){b[c]=d;null!=a&&0<c.length&&(c=a+c.substring(0,1).toUpperCase()+c.substring(1),b[c]=d)}}(),hasScrollbars:function(a){a=mxUtils.getCurrentStyle(a);return null!= a&&("scroll"==a.overflow||"auto"==a.overflow)},bind:function(a,b){return function(){return b.apply(a,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(c){mxLog.warn(c.message+" while evaluating "+a)}else try{b=eval(a)}catch(c){mxLog.warn(c.message+" while evaluating "+a)}return b},findNode:function(a,b,c){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=a.getAttribute(b);if(null!= d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substring(0,a)))));return b},indexOf:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1},lastIndexOf:function(a,b){if(null!=a&&null!=b)for(var c=a.length-1;0<= c;c--)if(a[c]==b)return c;return-1},forEach:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)b(a[c]);return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},addItems:function(a,b){for(var c=0;c<b.length;c++)null!=b[c]&&(b[c].constructor==Array?mxUtils.addItems(a,b[c]):0>mxUtils.indexOf(a,b[c])&&a.push(b[c]));return a},isNode:function(a,b,c,d){return null== a||a.constructor!==Element||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.getAttribute(c)==d},isAncestorNode:function(a,b){for(;null!=b;){if(b==a)return!0;b=b.parentNode}return!1},visitNodes:function(a,b){if(a.nodeType==mxConstants.NODETYPE_ELEMENT)for(b(a),a=a.firstChild;null!=a;)mxUtils.visitNodes(a,b),a=a.nextSibling},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;var c=[];for(a=a.firstChild;null!=a;)a.nodeType==b&&c.push(a),a=a.nextSibling;return c},removeChildNodes:function(a){for(;null!= a.lastChild;)a.removeChild(a.lastChild)},importNode:function(a,b,c){return a.importNode(b,c)},importNodeImplementation:function(a,b,c){switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length)for(var e=0;e<b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));if(c&&b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d; case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));return a},parseXml:function(a){var b=new DOMParser,c=b.parseFromString(a,"text/xml"),d=null!=c?c.getElementsByTagName("parsererror"):null;null!=d&&0<d.length&&(c=b.parseFromString(mxUtils.repairXml(a),"text/xml"));return c},htmlEntityCodes:{nbsp:160,iexcl:161, cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212, Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402, circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982, ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709, nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},repairXml:function(a){a=mxUtils.zapGremlins(a); a=a.split(/(<!\[CDATA\[[\s\S]*?\]\]>)/);for(var b=0;b<a.length;b+=2)a[b]=a[b].replace(/&(?:#([0-9]+);|#[xX]([0-9a-fA-F]+);|([a-zA-Z][a-zA-Z0-9]*);)?/g,function(c,d,e,f){if(null!=d||null!=e)return d=null!=d?parseInt(d,10):parseInt(e,16),(32<=d||9==d||10==d||13==d)&&(55296>d||57343<d)&&65534!=d&&65535!=d&&1114111>=d?c:"";if(null!=f){if("amp"==f||"lt"==f||"gt"==f||"quot"==f||"apos"==f)return c;d=mxUtils.htmlEntityCodes[f];return null!=d?"&#"+d+";":"&"+f+";"}return"&"});return a.join("")},getSvgDefs:function(a){var b= a.ownerDocument,c=a.getElementsByTagName("defs");0==c.length||c[0].parentNode!=a?(b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"defs"):b.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)):b=c[0];return b},clearSelection:function(){return document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}: function(){}}(),removeWhitespace:function(a,b){for(a=b?a.previousSibling:a.nextSibling;null!=a&&a.nodeType==mxConstants.NODETYPE_TEXT;){var c=b?a.previousSibling:a.nextSibling,d=mxUtils.getTextContent(a);0==mxUtils.trim(d).length&&a.parentNode.removeChild(a);a=c}},htmlEntities:function(a,b,c,d){a=String(null!=a?a:"");a=a.replace(/&/g,"&");a=a.replace(/</g,"<");a=a.replace(/>/g,">");if(null==c||c)a=a.replace(/"/g,"""),a=a.replace(/'/g,"'");if(null==b||b)a=a.replace(/\n/g,"
"); if(null==d||d)a=a.replace(/\t/g,"	");return a},decodeHtml:function(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value},safeDecodeURIComponent:function(a){try{return decodeURIComponent(a)}catch(b){return a}},getXml:function(a,b){a=mxUtils.zapGremlins((new XMLSerializer).serializeToString(a));return a.replace(/\n/g,b||"
")},getPrettyXml:function(a,b,c,d,e){var f=[];if(null!=a)if(b=null!=b?b:" ",c=null!=c?c:"",d=null!=d?d:"\n",null!=a.namespaceURI&&a.namespaceURI!=e&&(e= a.namespaceURI,null==a.getAttribute("xmlns")&&a.setAttribute("xmlns",a.namespaceURI)),a.nodeType==mxConstants.NODETYPE_DOCUMENT)f.push(mxUtils.getPrettyXml(a.documentElement,b,c,d,e));else if(a.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var g=a.firstChild;if(null!=g)for(;null!=g;)f.push(mxUtils.getPrettyXml(g,b,c,d,e)),g=g.nextSibling}else if(a.nodeType==mxConstants.NODETYPE_COMMENT)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&f.push(c+"\x3c!--"+a+"--\x3e"+d);else if(a.nodeType== mxConstants.NODETYPE_TEXT)a=mxUtils.zapGremlins(mxUtils.trim(mxUtils.getTextContent(a))),0<a.length&&f.push(c+mxUtils.htmlEntities(a,!1,!1)+d);else if(a.nodeType==mxConstants.NODETYPE_CDATA)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&f.push(c+"<![CDATA["+a+"]]\x3e"+d);else{f.push(c+"<"+a.nodeName);g=a.attributes;if(null!=g)for(var k=0;k<g.length;k++){var l=mxUtils.htmlEntities(mxUtils.zapGremlins(g[k].value)).replace(/\r/g,"
");f.push(" "+g[k].nodeName+'="'+l+'"')}g=a.firstChild; if(null!=g){for(f.push(">"+d);null!=g;)f.push(mxUtils.getPrettyXml(g,b,c+b,d,e)),g=g.nextSibling;f.push(c+"</"+a.nodeName+">"+d)}else f.push(" />"+d)}return f.join("")},extractTextWithWhitespace:function(a){function b(e){if(1!=e.length||"BR"!=e[0].nodeName&&"\n"!=e[0].innerHTML)for(var f=0;f<e.length;f++){var g=e[f];"BR"==g.nodeName||"\n"==g.innerHTML||(1==e.length||0==f)&&"DIV"==g.nodeName&&"<br>"==g.innerHTML.toLowerCase()?d.push("\n"):(3===g.nodeType||4===g.nodeType?0<g.nodeValue.length&&d.push(g.nodeValue): 8!==g.nodeType&&0<g.childNodes.length&&b(g.childNodes),f<e.length-1&&0<=mxUtils.indexOf(c,e[f+1].nodeName)&&d.push("\n"))}}var c="BLOCKQUOTE DIV H1 H2 H3 H4 H5 H6 OL P PRE TABLE UL".split(" "),d=[];b(a);return d.join("")},replaceTrailingNewlines:function(a,b){for(var c="";0<a.length&&"\n"==a.charAt(a.length-1);)a=a.substring(0,a.length-1),c+=b;return a+c},getNodeValue:function(a){a=a.firstChild;for(var b=[];null!=a;)a.nodeType!=mxConstants.NODETYPE_TEXT&&a.nodeType!=mxConstants.NODETYPE_CDATA||null== a.nodeValue||b.push(mxUtils.trim(a.nodeValue)),a=a.nextSibling;return 0<b.length?b.join(""):""},getTextContent:function(a){return null!=a?a[void 0===a.textContent?"text":"textContent"]:""},setTextContent:function(a,b){void 0!==a.innerText?a.innerText=b:a[void 0===a.textContent?"text":"textContent"]=b},getInnerHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},getOuterHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},write:function(a,b){b=a.ownerDocument.createTextNode(b); null!=a&&a.appendChild(b);return b},writeln:function(a,b){b=a.ownerDocument.createTextNode(b);null!=a&&(a.appendChild(b),a.appendChild(document.createElement("br")));return b},br:function(a,b){b=b||1;for(var c=null,d=0;d<b;d++)null!=a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c,d){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.className=d);return c},para:function(a,b){var c= document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,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){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)},parsePadding:function(a){a=null!=a?String(a):"";try{a=decodeURIComponent(a)}catch(b){}a=a.trim().split(/\s+/).map(function(b){b=parseFloat(b);return isNaN(b)?0:b});return 1===a.length?{n:a[0],e:a[0],s:a[0],w:a[0]}:2===a.length?{n:a[0],e:a[1],s:a[0],w:a[1]}:3===a.length?{n:a[0],e:a[1], s:a[2],w:a[1]}:{n:a[0],e:a[1],s:a[2],w:a[3]}},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?.3<a.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(n){return Math.round(b/100*(255-n)+n*(1-b/100))}function e(n){return Math.round(Math.max(0,Math.min(255,n)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0,l=1;if("transparent"==a.toLowerCase())return a;l=mxUtils.parseColor(a);if(null==l)return a;f=l.r;g=l.g;k=l.b;l=l.a;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var m=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*m-.2126*c;a[1]=.7152-.7152*m-.7152*c;a[2]=.0722-.0722*m+.9278*c;a[3]=.2126- .2126*m+.143*c;a[4]=.7152+(1-.7152)*m+.14*c;a[5]=.0722-.0722*m-.283*c;a[6]=.2126-.2126*m-.7874*c;a[7]=.7152-.7152*m+.7152*c;a[8]=.0722+.9278*m+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);m=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|m<<8|f).toString(16).slice(1)+(1>l?("0"+Math.round(255*l).toString(16)).slice(-2):"")},addAlphaToColor:function(a,b,c){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a.a=c?b:a.a*b,a="rgba("+a.r+","+a.g+","+a.b+","+a.a+")");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(Math.max(0,(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 v=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*v);r=-m*(c*y-p*v);for(var A=[],z=0;z<g;++z){f+=e;v=Math.cos(f);y=Math.sin(f);t=n*v-d*y+k;u=c*v+p*y+l;var x=-m*(n*y+d*v);v=-m*(c*y-p*v);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-x+a);A[y+3]=Number(u-v+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+x;r=u+v}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),f=(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e;f&&55296<=e&&57343>=e&&(56319>=e?(e=d+1<a.length?a.charCodeAt(d+1):0,f=56320<=e&&57343>=e):(e=0<d?a.charCodeAt(d-1):0,f=55296<=e&&56319>=e));f||(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)},hashCode:function(a){for(var b=5381,c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return(b>>>0).toString(36)},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-1E-6<=g&&1.000001>=g&&-1E-6<=e&&1.000001>=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){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()}}},parseColorList:function(a){var b=[],c=a.match(/var\([^)]+\)|light-dark\([^)]+\)|(?:rgba?|hsla?|hwb|lab|lch|color)\([^)]+\)|#[0-9a-f]{3,8}|[a-z-]+/gi);if(c)return c;""!==a.trim()&&b.push(a.trim());return b},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).toFixed(3));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)+(1>b.a?("0"+Math.round(255*b.a).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, mxUtils.isRgbColor(b)&&(b=mxUtils.rgba2hex(b))):1<a.length&&"#"==a.charAt(0)&&(mxUtils.canvasContext.fillStyle=a.substring(1),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);null!=a&&"string"!==typeof a&&(a=""+a);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");if(d)a=b+"="+c+(0>e?";":a.substring(e)); else{for(;0<=e&&";"==a.charAt(e+1);)e++;a=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||"string"!==typeof 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)},_measureDiv:null,_measureCache:null,getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;e=null!=e?e:0;if(null==mxUtils._measureDiv){var f=document.createElement("div");f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";document.body.appendChild(f);mxUtils._measureDiv=f;mxUtils._measureCache= {}}f=mxUtils._measureDiv;var g=mxUtils._measureCache,k=Math.round(b)+"px";b=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;var l=(e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",m=(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",n="";(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(n="underline");(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&(n=0<n.length? n+" line-through":"line-through");e=null!=d?"normal":"nowrap";d=null!=d?d+"px":"";g.fontFamily!==c&&(f.style.fontFamily=c,g.fontFamily=c);g.fontSizePx!==k&&(f.style.fontSize=k,g.fontSizePx=k);g.lineHeight!==b&&(f.style.lineHeight=b,g.lineHeight=b);g.fontWeight!==l&&(f.style.fontWeight=l,g.fontWeight=l);g.fontStyleCss!==m&&(f.style.fontStyle=m,g.fontStyleCss=m);g.txtDecor!==n&&(f.style.textDecoration=n,g.txtDecor=n);g.whiteSpace!==e&&(f.style.whiteSpace=e,g.whiteSpace=e);g.widthPx!==d&&(f.style.width= d,g.widthPx=d);g.text!==a&&(f.innerHTML=a,g.text=a);return new mxRectangle(0,0,f.offsetWidth,f.offsetHeight)},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();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));b.writeln("<html><head>");d=document.getElementsByTagName("base");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[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"),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},isVerticalTextDirection:function(a){return null!=a&&"string"===typeof a&&"vertical-"==a.substring(0,9)},canConvertHtmlToSvg:function(a,b){var c=document.createElement("div"); c.innerHTML=null!=a?a:"";return mxUtils.convertHtmlToSvg(c,null,null,b)},convertHtmlToSvg:function(a,b,c,d){d={dir:null!=d?d.dir:null,fontScale:null!=d?d.fontScale:null,fontSize:null!=d&&null!=d.fontSize?d.fontSize:mxConstants.DEFAULT_FONTSIZE,createElement:null!=d&&null!=d.createElement?d.createElement:function(f){return document.createElementNS(mxConstants.NS_SVG,f)}};if(mxUtils.isVerticalTextDirection(d.dir))return!1;b=null!=b?b:d.createElement("text");c=null!=c?c:new mxPoint(0,0);var e=!0;null!= a&&(e=mxUtils.containsBlockChild(a)?mxUtils.convertHtmlBlocksToSvg(a,b,c,d):mxUtils.containsBrElement(a)?mxUtils.convertHtmlWithBreaksToSvg(a,b,c,d.fontScale,d):mxUtils.convertHtmlInlineToSvg(a,b,c,d.fontScale,null,d));return e},getBlockElementStyle:function(a){switch(a){case "H1":return{sizeFactor:2,weight:"bold",family:null,marginTop:.67,marginBottom:.67,indent:0};case "H2":return{sizeFactor:1.5,weight:"bold",family:null,marginTop:.83,marginBottom:.83,indent:0};case "H3":return{sizeFactor:1.17, weight:"bold",family:null,marginTop:1,marginBottom:1,indent:0};case "H4":return{sizeFactor:1,weight:"bold",family:null,marginTop:1.33,marginBottom:1.33,indent:0};case "H5":return{sizeFactor:.83,weight:"bold",family:null,marginTop:1.67,marginBottom:1.67,indent:0};case "H6":return{sizeFactor:.67,weight:"bold",family:null,marginTop:2.33,marginBottom:2.33,indent:0};case "P":return{sizeFactor:1,weight:null,family:null,marginTop:1,marginBottom:1,indent:0};case "PRE":return{sizeFactor:1,weight:null,family:"monospace", marginTop:1,marginBottom:1,indent:0};case "BLOCKQUOTE":return{sizeFactor:1,weight:null,family:null,marginTop:1,marginBottom:1,indent:40};case "DIV":return{sizeFactor:1,weight:null,family:null,marginTop:0,marginBottom:0,indent:0};default:return null}},getMaxInlineFontSize:function(a,b){for(var c=b,d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.style){var f=e.style.fontSize;null!=f&&""!=f&&("px"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c, f))):"pt"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,4*f/3))):"em"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f*b))):"%"==f.slice(-1)&&(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f/100*b))));e=mxUtils.getMaxInlineFontSize(e,b);c=Math.max(c,e)}}return c},containsBlockChild:function(a){for(var b=0;b<a.childNodes.length;b++)if(null!=mxUtils.getBlockElementStyle(a.childNodes[b].nodeName))return!0;return!1},convertHtmlBlocksToSvg:function(a,b,c,d){function e(p){return p.nodeType!=mxConstants.NODETYPE_ELEMENT|| null==mxUtils.getBlockElementStyle(p.nodeName)}function f(p,q){for(var r=0;r<p.childNodes.length&&n;r++){var t=p.childNodes[r];if(e(t)){for(t=[];r<p.childNodes.length&&e(p.childNodes[r]);)t.push(p.childNodes[r]),r++;r--;var u=t;t=null!=q&&""!=q?mxUtils.getLightDarkColor(q):null;for(var v=document.createElement("span"),y=0;y<u.length;y++)v.appendChild(u[y].cloneNode(!0));u=!1;for(y=0;y<v.childNodes.length;y++){var A=v.childNodes[y];if(A.nodeType==mxConstants.NODETYPE_ELEMENT||A.nodeType==mxConstants.NODETYPE_TEXT&& 0<mxUtils.trim(A.nodeValue).length){u=!0;break}}if(u){if(mxUtils.containsBrElement(v))for(v=mxUtils.splitAtBr(v),y=0;y<v.length&&n;y++){var z=v[y],x=document.createElement("span");for(u=0;u<z.length;u++)x.appendChild(z[u]);u=mxUtils.getMaxInlineFontSize(x,g);k+=u;var C=d.createElement("text");C.setAttribute("y",mxUtils.format(k));C.setAttribute("data-line-font-size",u);null!=t&&(C.setAttribute("fill",t.light),C.style.fill=t.cssText);A=new mxPoint(0,0);0<z.length&&(n=mxUtils.convertHtmlInlineToSvg(x, C,A,1,g,d));b.appendChild(C);z=u*(mxConstants.LINE_HEIGHT-1);z+=mxUtils.getSupSubLineExpansion(u,A.supDyPx,A.subDyPx);k+=z}else u=mxUtils.getMaxInlineFontSize(v,g),k+=u,C=d.createElement("text"),C.setAttribute("y",mxUtils.format(k)),C.setAttribute("data-line-font-size",u),null!=t&&(C.setAttribute("fill",t.light),C.style.fill=t.cssText),A=new mxPoint(0,0),n=mxUtils.convertHtmlInlineToSvg(v,C,A,1,g,d),b.appendChild(C),z=u*(mxConstants.LINE_HEIGHT-1),z+=mxUtils.getSupSubLineExpansion(u,A.supDyPx,A.subDyPx, A.supFontSize,A.subFontSize),k+=z;l=0;m=!1}}else if(v=mxUtils.getBlockElementStyle(t.nodeName),null==v)n=!1;else if(null!=t.style&&""!=t.style.backgroundColor)n=!1;else if(u=null!=t.style&&""!=t.style.color?t.style.color:q,"DIV"==t.nodeName&&mxUtils.containsBlockChild(t))f(t,u);else{A=t;t=v;v=g*v.sizeFactor;z=t.marginTop;y=t.marginBottom;u=null!=u&&""!=u?mxUtils.getLightDarkColor(u):null;null!=A.style&&(""!=A.style.marginTop&&(x=parseFloat(A.style.marginTop),isNaN(x)||(0<=A.style.marginTop.indexOf("px")? z=x/v:0<=A.style.marginTop.indexOf("em")&&(z=x))),""!=A.style.marginBottom&&(x=parseFloat(A.style.marginBottom),isNaN(x)||(0<=A.style.marginBottom.indexOf("px")?y=x/v:0<=A.style.marginBottom.indexOf("em")&&(y=x))));z*=v;k=m?k+z:k+Math.max(l,z);if(mxUtils.containsBrElement(A))for(A=mxUtils.splitAtBr(A),z=0;z<A.length&&n;z++){var D=A[z],B=document.createElement("span");for(x=0;x<D.length;x++)B.appendChild(D[x]);x=mxUtils.getMaxInlineFontSize(B,v);k+=x;var E=d.createElement("text");E.setAttribute("y", mxUtils.format(k));E.setAttribute("data-line-font-size",x);1!=t.sizeFactor&&E.setAttribute("font-size",v+"px");null!=t.weight&&E.setAttribute("font-weight",t.weight);null!=t.family&&E.setAttribute("font-family",t.family);0<t.indent&&E.setAttribute("dx",t.indent);null!=u&&(E.setAttribute("fill",u.light),E.style.fill=u.cssText);C=new mxPoint(0,0);0<D.length&&(n=mxUtils.convertHtmlInlineToSvg(B,E,C,1,v,d));b.appendChild(E);D=x*(mxConstants.LINE_HEIGHT-1);D+=mxUtils.getSupSubLineExpansion(x,C.supDyPx, C.subDyPx);k+=D}else x=mxUtils.getMaxInlineFontSize(A,v),k+=x,E=d.createElement("text"),E.setAttribute("y",mxUtils.format(k)),E.setAttribute("data-line-font-size",x),1!=t.sizeFactor&&E.setAttribute("font-size",v+"px"),null!=t.weight&&E.setAttribute("font-weight",t.weight),null!=t.family&&E.setAttribute("font-family",t.family),0<t.indent&&E.setAttribute("dx",t.indent),null!=u&&(E.setAttribute("fill",u.light),E.style.fill=u.cssText),C=new mxPoint(0,0),n=mxUtils.convertHtmlInlineToSvg(A,E,C,1,v,d),b.appendChild(E), D=x*(mxConstants.LINE_HEIGHT-1),D+=mxUtils.getSupSubLineExpansion(x,C.supDyPx,C.subDyPx,C.supFontSize,C.subFontSize),k+=D;l=y*v;m=!1}}}var g=d.fontSize,k=0,l=0,m=!0,n=!0;f(a,null);k+=l;c.textHeight=k;return n},convertHtmlInlineToSvg:function(a,b,c,d,e,f){var g=!0;if(null!=a){d=null!=d?d:1;var k=f.fontSize;e=null!=e?e:k;for(var l=0,m=0;m<a.childNodes.length&&g;m++){var n=a.childNodes[m];if(n.nodeType==mxConstants.NODETYPE_TEXT||n.nodeType==mxConstants.NODETYPE_ELEMENT){var p=f.createElement("tspan"), q=0;if(n.nodeType==mxConstants.NODETYPE_TEXT)mxUtils.write(p,n.nodeValue);else if(""!=n.style.backgroundColor||"SUP"!=n.nodeName&&"SUB"!=n.nodeName&&"B"!=n.nodeName&&"I"!=n.nodeName&&"SPAN"!=n.nodeName&&"FONT"!=n.nodeName&&"STRIKE"!=n.nodeName&&"U"!=n.nodeName)g=!1;else{""!=n.style.cssText&&(p.style.cssText=n.style.cssText);null!=n.getAttribute("face")&&(p.style.fontFamily=mxUtils.parseCssFontFamily(n.getAttribute("face")));g=""!=n.style.color?n.style.color:n.getAttribute("color");null!=g&&""!=g&& (g=mxUtils.getLightDarkColor(g),p.setAttribute("fill",g.light),p.style.fill=g.cssText,p.style.color="");g=p.style.fontSize||"";var r=d,t=e;if("SUP"==n.nodeName||"SUB"==n.nodeName)if(""==g&&(p.style.fontSize="smaller",r=1.2*d,t=e/1.2),"SUP"==n.nodeName&&0==c.y?c.y=-.2:"SUB"==n.nodeName&&(c.y=Math.max(c.y,.15)),q=("SUP"==n.nodeName?-.35:.15)*e,"SUP"==n.nodeName){if(null==c.supDyPx||q<c.supDyPx)c.supDyPx=q,c.supFontSize=t}else{if(null==c.subDyPx||q>c.subDyPx)c.subDyPx=q,c.subFontSize=t}else"I"==n.nodeName? p.setAttribute("font-style","italic"):"B"==n.nodeName?p.setAttribute("font-weight","bold"):"STRIKE"==n.nodeName?p.setAttribute("text-decoration","line-through"):"U"==n.nodeName&&p.setAttribute("text-decoration","underline");""!=g&&"smaller"!=g&&("px"==g.slice(-2)?t=parseFloat(g):"em"==g.slice(-2)?t=parseFloat(g)*e:"%"==g.slice(-1)&&(t=parseFloat(g)/100*e));"px"==g.slice(-2)&&(p.style.fontSize=parseFloat(g)*r/k+"em");g=mxUtils.convertHtmlInlineToSvg(n,p,c,r,t,f)}n=q;0==l&&0==n||p.setAttribute("dy", Math.round(100*(n-l))/100);l=n;b.appendChild(p)}}}return g},getSupSubLineExpansion:function(a,b,c,d,e){var f=0;null!=b&&0>b&&(f=Math.max(0,(d||a/1.2)-a-b-a*(mxConstants.LINE_HEIGHT-1)/2));null!=c&&0<c&&(f=Math.max(f,c+(e||a/1.2)*(mxConstants.LINE_HEIGHT-1)-a*(mxConstants.LINE_HEIGHT-1)));return f},containsBrElement:function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("BR"==c.nodeName||c.nodeType==mxConstants.NODETYPE_ELEMENT&&mxUtils.containsBrElement(c))return!0}return!1}, splitAtBr:function(a){for(var b=[[]],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if("BR"==d.nodeName)b.push([]);else if(d.nodeType==mxConstants.NODETYPE_TEXT)b[b.length-1].push(d.cloneNode(!0));else if(d.nodeType==mxConstants.NODETYPE_ELEMENT)if(mxUtils.containsBrElement(d))for(var e=mxUtils.splitAtBr(d),f=0;f<e.length;f++){if(0<f&&b.push([]),0<e[f].length){for(var g=d.cloneNode(!1),k=0;k<e[f].length;k++)g.appendChild(e[f][k]);b[b.length-1].push(g)}}else b[b.length-1].push(d.cloneNode(!0))}return b}, convertHtmlWithBreaksToSvg:function(a,b,c,d,e){var f=!0,g=e.fontSize;a=mxUtils.splitAtBr(a);for(var k=0,l=0;l<a.length&&f;l++){for(var m=a[l],n=document.createElement("span"),p=0;p<m.length;p++)n.appendChild(m[p]);p=mxUtils.getMaxInlineFontSize(n,g);k+=p;var q=e.createElement("text");q.setAttribute("y",mxUtils.format(k));q.setAttribute("data-line-font-size",p);var r=new mxPoint(0,0);0<m.length&&(f=mxUtils.convertHtmlInlineToSvg(n,q,r,d||1,null,e));b.appendChild(q);m=p*(mxConstants.LINE_HEIGHT-1); m+=mxUtils.getSupSubLineExpansion(p,r.supDyPx,r.subDyPx);k+=m}c.textHeight=k;return f},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: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_HACHURE_GAP:"hachureGap",STYLE_HACHURE_ANGLE:"hachureAngle", STYLE_FILL_WEIGHT:"fillWeight",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_FIXED_HEADER:"fixedHeader",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_FOOTER_SIZE:"footerSize",STYLE_FOOTER_COLOR:"footerColor",STYLE_CENTER_RADIUS:"centerRadius",STYLE_CENTER_COLOR:"centerColor", 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_BEZIER:"bezier",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_GROUP_PADDING:"groupPadding",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,FONT_UNDERLINE_DOTTED:16,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}; mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var a=this.getState();return null!=a?a.cell:null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};mxMouseEvent.prototype.consume=function(a){(null!=a?a:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault();this.consumed=!0}; function mxEventSource(a){this.setEventSource(a)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=!0;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};mxEventSource.prototype.setEventsEnabled=function(a){this.eventsEnabled=a};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(a){this.eventSource=a}; mxEventSource.prototype.addListener=function(a,b){null==this.eventListeners&&(this.eventListeners=[]);this.eventListeners.push(a);this.eventListeners.push(b)};mxEventSource.prototype.removeListener=function(a){if(null!=this.eventListeners)for(var b=0;b<this.eventListeners.length;)this.eventListeners[b+1]==a?this.eventListeners.splice(b,2):b+=2}; mxEventSource.prototype.fireEvent=function(a,b){if(null!=this.eventListeners&&this.isEventsEnabled()){null==a&&(a=new mxEventObject);null==b&&(b=this.getEventSource());null==b&&(b=this);for(var c=0;c<this.eventListeners.length;c+=2){var d=this.eventListeners[c];null!=d&&d!=a.getName()||this.eventListeners[c+1].apply(this,[b,a])}}}; var mxEvent={addListener:function(){if(window.addEventListener){var a=!1;try{document.addEventListener("test",function(){},Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){a=!0}}))}catch(b){}return function(b,c,d){b.addEventListener(c,d,a?{passive:!1}:!1);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}return function(b,c,d){b.attachEvent("on"+c,d);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}(),removeListener:function(){var a= function(b,c,d){if(null!=b.mxListenerList){c=b.mxListenerList.length;for(var e=0;e<c;e++)if(b.mxListenerList[e].f==d){b.mxListenerList.splice(e,1);break}0==b.mxListenerList.length&&(b.mxListenerList=null)}};return window.removeEventListener?function(b,c,d){b.removeEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.detachEvent("on"+c,d);a(b,c,d)}}(),removeAllListeners:function(a){var b=a.mxListenerList;if(null!=b)for(;0<b.length;){var c=b[0];mxEvent.removeListener(a,c.name,c.f)}},addGestureListeners:function(a, b,c,d){null!=b&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.addListener(a,"touchstart",b),null!=c&&mxEvent.addListener(a,"touchmove",c),null!=d&&mxEvent.addListener(a,"touchend",d))},removeGestureListeners:function(a,b,c,d){null!=b&&mxEvent.removeListener(a,mxClient.IS_POINTER? "pointerdown":"mousedown",b);null!=c&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.removeListener(a,"touchstart",b),null!=c&&mxEvent.removeListener(a,"touchmove",c),null!=d&&mxEvent.removeListener(a,"touchend",d))},redirectMouseEvents:function(a,b,c,d,e,f,g){var k=function(l){return"function"==typeof c?c(l):c};mxEvent.addGestureListeners(a, function(l){null!=d?d(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,k(l)))},function(l){null!=e?e(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,k(l)))},function(l){null!=f?f(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,k(l)))});mxEvent.addListener(a,"dblclick",function(l){if(null!=g)g(l);else if(!mxEvent.isConsumed(l)){var m=k(l);b.dblClick(l,null!=m?m.cell:null)}})},release:function(a){try{if(null!= a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;for(a=0;a<c;a+=1)mxEvent.release(b[a])}}}catch(d){}},addMouseWheelListener:function(a,b){if(null!=a){b=null!=b?b:window;if(mxClient.IS_SF&&!mxClient.IS_TOUCH){var c=1;mxEvent.addListener(b,"gesturestart",function(g){mxEvent.consume(g);c=1});mxEvent.addListener(b,"gesturechange",function(g){mxEvent.consume(g);var k=c-g.scale;.2<Math.abs(k)&&(a(g,0>k,!0),c=g.scale)});mxEvent.addListener(b,"gestureend",function(g){mxEvent.consume(g)})}else{var d= [],e=0,f=0;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)||null==g.pointerId||d.push(g)}),mxUtils.bind(this,function(g){if(!mxEvent.isMouseEvent(g)&&2==d.length){for(var k=0;k<d.length;k++)if(g.pointerId==d[k].pointerId){d[k]=g;break}g=Math.abs(d[0].clientX-d[1].clientX);k=Math.abs(d[0].clientY-d[1].clientY);var l=Math.abs(g-e),m=Math.abs(k-f);if(l>mxEvent.PINCH_THRESHOLD||m>mxEvent.PINCH_THRESHOLD)a(d[0],l>m?g>e:k>f,!0,d[0].clientX+(d[1].clientX-d[0].clientX)/ 2,d[0].clientY+(d[1].clientY-d[0].clientY)/2),e=g,f=k}}),mxUtils.bind(this,function(g){d=[];f=e=0}))}mxEvent.addListener(b,"wheel",function(g){null==g&&(g=window.event);g.ctrlKey&&g.preventDefault();(.5<Math.abs(g.deltaX)||.5<Math.abs(g.deltaY))&&a(g,0==g.deltaY?0<-g.deltaX:0<-g.deltaY)})}},disableContextMenu:function(a){mxEvent.addListener(a,"contextmenu",function(b){b.preventDefault&&b.preventDefault();return!1})},getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!= a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.type&&0==a.type.indexOf("touch")},isPenEvent:function(a){return null!=a.pointerType?"pen"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_PEN:null!=a.type&&0==a.type.indexOf("pen")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return!mxClient.IS_ANDROID&& mxClient.IS_LINUX&&mxClient.IS_GC&&1>=navigator.maxTouchPoints?!0:null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.type&&0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)|| mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){"touchstart"!=a.type&&"touchmove"!=a.type||null==a.touches||null==a.touches[0]?"touchend"==a.type&&null!=a.changedTouches&&null!=a.changedTouches[0]&& (a=a.changedTouches[0]):a=a.touches[0];return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},preventDefault:function(a){mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(b){b.preventDefault()}))}, LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CONNECT_HANDLE:-3,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",DOCK:"dock",UNDOCK:"undock",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh", SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",CONSUME_MOUSE_EVENT:"consumeMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit", END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled", ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped", ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",UPDATE:"update",RESET:"reset",PINCH_THRESHOLD:10};function mxXmlRequest(a,b,c,d,e,f){this.url=a;this.params=b;this.method=c||"POST";this.async=null!=d?d:!0;this.username=e;this.password=f}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null; mxXmlRequest.prototype.binary=!1;mxXmlRequest.prototype.withCredentials=!1;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=!1;mxXmlRequest.prototype.acceptResponse=!0;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(a){this.binary=a};mxXmlRequest.prototype.getText=function(){return this.request.responseText}; mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState};mxXmlRequest.prototype.getDocumentElement=function(){var a=this.getXml();return null!=a?a.documentElement:null};mxXmlRequest.prototype.getXml=function(){var a=this.request.responseXML;if(9<=document.documentMode||null==a||null==a.documentElement)a=mxUtils.parseXml(this.request.responseText);return a};mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null}; mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var a=new XMLHttpRequest;this.isBinary()&&a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined");return a};if("undefined"!=typeof ActiveXObject)return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}(); mxXmlRequest.prototype.send=function(a,b,c,d){this.request=this.create();null!=this.request&&(null!=a&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&this.acceptResponse&&(this.acceptResponse=!1,a(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),null!=b&&(this.request.onerror= mxUtils.bind(this,function(e){this.acceptResponse&&(this.acceptResponse=!1,b(this,e))})),(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&null!=c&&null!=d&&(this.request.timeout=c,this.request.ontimeout=d),this.request.send(this.params))};mxXmlRequest.prototype.setRequestHeaders=function(a,b){null!=b&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}; mxXmlRequest.prototype.simulate=function(a,b){a=a||document;var c=null;a==document&&(c=window.onbeforeunload,window.onbeforeunload=null);var d=a.createElement("form");d.setAttribute("method",this.method);d.setAttribute("action",this.url);null!=b&&d.setAttribute("target",b);d.style.display="none";d.style.visibility="hidden";b=0<this.params.indexOf("&")?this.params.split("&"):this.params.split();for(var e=0;e<b.length;e++){var f=b[e].indexOf("=");if(0<f){var g=b[e].substring(0,f);f=b[e].substring(f+ 1);this.decodeSimulateValues&&(f=decodeURIComponent(f));var k=a.createElement("textarea");k.setAttribute("wrap","off");k.setAttribute("name",g);mxUtils.write(k,f);d.appendChild(k)}}a.body.appendChild(d);d.submit();null!=d.parentNode&&d.parentNode.removeChild(d);null!=c&&(window.onbeforeunload=c)}; var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(a){mxClipboard.cells=a},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(a,b){b=mxClipboard.copy(a,b);mxClipboard.insertCount=0;mxClipboard.removeCells(a,b,!1);return b},removeCells:function(a,b,c){a.removeCells(b,c)},copy:function(a,b){b=b||a.getSelectionCells();b=a.getExportableCells(a.model.getTopmostCells(b));mxClipboard.insertCount=1;mxClipboard.setCells(a.cloneCells(b)); return b},paste:function(a){var b=null;if(!mxClipboard.isEmpty()){b=a.getImportableCells(mxClipboard.getCells());var c=mxClipboard.insertCount*mxClipboard.STEPSIZE,d=a.getDefaultParent();b=a.importCells(b,c,c,d);mxClipboard.insertCount++;a.setSelectionCells(b)}return b}}; function mxWindow(a,b,c,d,e,f,g,k,l,m){null!=b&&(g=null!=g?g:!0,this.content=b,this.init(c,d,e,f,m),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(g),this.setTitle(a),(null==k||k)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif"; mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.dockState=null;mxWindow.prototype.visible=!1;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=!0; mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null; mxWindow.prototype.init=function(a,b,c,d,e){e=null!=e?e:"mxWindow";this.div=document.createElement("div");this.div.className=e;this.div.style.left=a+"px";this.div.style.top=b+"px";this.table=document.createElement("table");this.table.className=e;mxClient.IS_POINTER&&(this.div.style.touchAction="none");null!=c&&(this.div.style.width=c+"px",this.table.style.width=c+"px");null!=d&&(this.div.style.height=d+"px",this.table.style.height=d+"px");a=document.createElement("tbody");b=document.createElement("tr"); this.title=document.createElement("td");this.title.className=e+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.title.appendChild(this.buttons);b.appendChild(this.title);a.appendChild(b);b=document.createElement("tr");this.td=document.createElement("td");this.td.className=e+"Pane";7==document.documentMode&&(this.td.style.height="100%");this.contentWrapper=document.createElement("div"); this.contentWrapper.className=e+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);"DIV"!=this.content.nodeName.toUpperCase()&&(this.contentWrapper.style.height="100%");this.td.appendChild(this.contentWrapper);b.appendChild(this.td);a.appendChild(b);this.table.appendChild(a);this.div.appendChild(this.table);e=mxUtils.bind(this,function(f){this.activate()});mxEvent.addGestureListeners(this.title,e);mxEvent.addGestureListeners(this.table,e);this.hide()}; mxWindow.prototype.setTitle=function(a){for(var b=this.title.firstChild;null!=b;){var c=b.nextSibling;b!=this.buttons&&b.parentNode.removeChild(b);b=c}mxUtils.write(this.title,a||"");this.title.appendChild(this.buttons)};mxWindow.prototype.setScrollable=function(a){if(null==navigator.userAgent||0>navigator.userAgent.indexOf("Presto/2.5"))this.contentWrapper.style.overflow=a?"auto":"hidden"}; mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var a=mxUtils.getCurrentStyle(this.getElement());a=null!=a?a.zIndex:3;if(mxWindow.activeWindow){var b=mxWindow.activeWindow.getElement();null!=b&&null!=b.style&&(b.style.zIndex=a)}b=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(a)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",b))}};mxWindow.prototype.getElement=function(){return this.div}; mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){return null!=this.resize?"none"!=this.resize.style.display:!1}; mxWindow.prototype.setResizable=function(a){if(a)if(null==this.resize){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="0px";this.resize.style.right="0px";this.resize.style.zIndex="2";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nwse-resize";var b=null,c=null,d=null,e=null;a=mxUtils.bind(this,function(k){this.activate();b=mxEvent.getClientX(k);c=mxEvent.getClientY(k);d=this.div.offsetWidth;e=this.div.offsetHeight; mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",k));mxEvent.consume(k)});var f=mxUtils.bind(this,function(k){if(null!=b&&null!=c){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setSize(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",k));mxEvent.consume(k)}}),g=mxUtils.bind(this,function(k){null!=b&&null!=c&&(c=b=null,mxEvent.removeGestureListeners(document,null,f,g),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END, "event",k)),mxEvent.consume(k))});mxEvent.addGestureListeners(this.resize,a,f,g);this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")}; mxWindow.prototype.setSize=function(a,b){a=Math.max(this.minimumSize.width,a);b=Math.max(this.minimumSize.height,b);this.div.style.width=a+"px";this.div.style.height=b+"px";this.table.style.width=a+"px";this.table.style.height=b+"px";this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"};mxWindow.prototype.setMinimizable=function(a){this.minimizeImg.style.display=a?"":"none"}; mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)}; mxWindow.prototype.toggleMinimized=function(a){this.activate();if(this.minimized)this.minimized=!1,this.minimizeImg.setAttribute("src",this.minimizeImage),this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize")),this.contentWrapper.style.display="",this.maximize.style.display=this.maxDisplay,this.div.style.height=this.height,this.table.style.height=this.height,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event", a));else{this.minimized=!0;this.minimizeImg.setAttribute("src",this.normalizeImage);this.minimizeImg.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="none";this.maxDisplay=this.maximize.style.display;this.maximize.style.display="none";this.height=this.table.style.height;var b=this.getMinimumSize();0<b.height&&(this.div.style.height=b.height+"px",this.table.style.height=b.height+"px");0<b.width&&(this.div.style.width=b.width+"px",this.table.style.width= b.width+"px");null!=this.resize&&(this.resize.style.visibility="hidden");this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",a))}}; mxWindow.prototype.installMinimizeHandler=function(){this.minimizeImg=document.createElement("img");this.minimizeImg.setAttribute("src",this.minimizeImage);this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize"));this.minimizeImg.style.cursor="pointer";this.minimizeImg.style.marginLeft="2px";this.minimizeImg.style.display="none";this.buttons.appendChild(this.minimizeImg);this.minimized=!1;this.height=this.maxDisplay=null;var a=mxUtils.bind(this,function(b){this.toggleMinimized(b); mxEvent.consume(b)});mxEvent.addGestureListeners(this.minimizeImg,a)};mxWindow.prototype.setMaximizable=function(a){this.maximize.style.display=a?"":"none"}; mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var a=!1,b=null,c=null,d=null,e=null,f=null,g=mxUtils.bind(this,function(k){this.activate(); if("none"!=this.maximize.style.display){if(a){a=!1;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.contentWrapper.style.display="";this.minimizeImg.style.display=f;this.div.style.left=b+"px";this.div.style.top=c+"px";this.div.style.height=d;this.div.style.width=e;l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight- this.contentHeightCorrection+"px";this.table.style.height=d;this.table.style.width=e;null!=this.resize&&(this.resize.style.visibility="");this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",k))}else{a=!0;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="";f=this.minimizeImg.style.display;this.minimizeImg.style.display="none";b=parseInt(this.div.style.left);c=parseInt(this.div.style.top); d=this.table.style.height;e=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=l-2+"px";this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=l-2+"px";null!=this.resize&&(this.resize.style.visibility="hidden");var l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height= this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px";this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",k))}mxEvent.consume(k)}});mxEvent.addGestureListeners(this.maximize,g);mxEvent.addListener(this.title,"dblclick",g)}; mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(a){var b=mxEvent.getClientX(a),c=mxEvent.getClientY(a),d=this.getX(),e=this.getY(),f=mxUtils.bind(this,function(k){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setLocation(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",k));mxEvent.consume(k)}),g=mxUtils.bind(this,function(k){mxEvent.removeGestureListeners(document,null,f, g);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",k));mxEvent.consume(k)});mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",a));mxEvent.consume(a)}));mxClient.IS_POINTER&&(this.title.style.touchAction="none")};mxWindow.prototype.setLocation=function(a,b){null!=this.div&&(this.div.style.left=a+"px",this.div.style.top=b+"px")};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)}; mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title",mxResources.get("close",null,"Close"));this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(a){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",a));this.destroyOnClose? this.destroy():this.setVisible(!1);mxEvent.consume(a)}))};mxWindow.prototype.setImage=function(a){this.image=document.createElement("img");this.image.setAttribute("src",a);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(a){this.closeImg.style.display=a?"":"none"}; mxWindow.prototype.isVisible=function(){return null!=this.div?"none"!=this.div.style.display:!1};mxWindow.prototype.setVisible=function(a){null!=this.div&&(this.isVisible()!=a?a?this.show():this.hide():this.fireEvent(new mxEventObject(a?mxEvent.SHOW:mxEvent.HIDE)))}; mxWindow.prototype.show=function(){this.div.style.display="";this.activate();"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))}; mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null);this.contentWrapper=this.content=this.title=null};function mxForm(a){this.table=document.createElement("table");this.table.className=a;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=!1;mxForm.prototype.getTable=function(){return this.table}; mxForm.prototype.addButtons=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");c.appendChild(d);d=document.createElement("td");var e=document.createElement("button");mxUtils.write(e,mxResources.get("ok")||"OK");d.appendChild(e);mxEvent.addListener(e,"click",function(){a()});e=document.createElement("button");mxUtils.write(e,mxResources.get("cancel")||"Cancel");d.appendChild(e);mxEvent.addListener(e,"click",function(){b()});c.appendChild(d);this.body.appendChild(c)}; mxForm.prototype.addText=function(a,b,c){var d=document.createElement("input");d.setAttribute("type",c||"text");d.value=b;return this.addField(a,d)};mxForm.prototype.addCheckbox=function(a,b){var c=document.createElement("input");c.setAttribute("type","checkbox");this.addField(a,c);b&&(c.checked=!0);return c};mxForm.prototype.addTextarea=function(a,b,c){var d=document.createElement("textarea");mxClient.IS_NS&&c--;d.setAttribute("rows",c||2);d.value=b;return this.addField(a,d)}; mxForm.prototype.addCombo=function(a,b,c){var d=document.createElement("select");null!=c&&d.setAttribute("size",c);b&&d.setAttribute("multiple","true");return this.addField(a,d)};mxForm.prototype.addOption=function(a,b,c,d){var e=document.createElement("option");mxUtils.writeln(e,b);e.setAttribute("value",c);d&&e.setAttribute("selected",d);a.appendChild(e)}; mxForm.prototype.addField=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");mxUtils.write(d,a);c.appendChild(d);d=document.createElement("td");d.appendChild(b);c.appendChild(d);this.body.appendChild(c);return b};function mxImage(a,b,c,d,e){this.src=a;this.width=null!=b?b:this.width;this.height=null!=c?c:this.height;this.x=null!=d?d:this.x;this.y=null!=e?e:this.y}mxImage.prototype.src=null;mxImage.prototype.width=0;mxImage.prototype.height=0;mxImage.prototype.x=0; mxImage.prototype.y=0;function mxDivResizer(a,b){"div"==a.nodeName.toLowerCase()&&(null==b&&(b=window),this.div=a,a=mxUtils.getCurrentStyle(a),null!=a&&(this.resizeWidth="auto"==a.width,this.resizeHeight="auto"==a.height),mxEvent.addListener(b,"resize",mxUtils.bind(this,function(c){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize())}mxDivResizer.prototype.resizeWidth=!0;mxDivResizer.prototype.resizeHeight=!0;mxDivResizer.prototype.handlingResize=!1; mxDivResizer.prototype.resize=function(){var a=this.getDocumentWidth(),b=this.getDocumentHeight(),c=parseInt(this.div.style.left),d=parseInt(this.div.style.right),e=parseInt(this.div.style.top),f=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(c)&&!isNaN(d)&&0<=c&&0<=d&&0<a-d-c&&(this.div.style.width=a-d-c+"px");this.resizeHeight&&!isNaN(e)&&!isNaN(f)&&0<=e&&0<=f&&0<b-e-f&&(this.div.style.height=b-e-f+"px")};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth}; mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};function mxDragSource(a,b){this.element=a;this.dropHandler=b;mxEvent.addGestureListeners(a,mxUtils.bind(this,function(c){this.mouseDown(c);mxEvent.consume(c)}));mxEvent.addListener(a,"dragstart",function(c){mxEvent.consume(c)});this.eventConsumer=function(c,d){c=d.getProperty("eventName");d=d.getProperty("event");c!=mxEvent.MOUSE_DOWN&&d.consume()}}mxDragSource.prototype.element=null; mxDragSource.prototype.dropHandler=null;mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=!0;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=!0; mxDragSource.prototype.guidesEnabled=!0;mxDragSource.prototype.gridEnabled=!0;mxDragSource.prototype.highlightDropTargets=!0;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=!0;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(a){this.enabled=a};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled}; mxDragSource.prototype.setGuidesEnabled=function(a){this.guidesEnabled=a};mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxDragSource.prototype.getGraphForEvent=function(a){return null};mxDragSource.prototype.getDropTarget=function(a,b,c,d){return a.getCellAt(b,c)};mxDragSource.prototype.createDragElement=function(a){return this.element.cloneNode(!0)};mxDragSource.prototype.createPreviewElement=function(a){return null}; mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler};mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null);this.removeDragElement();this.removeListeners();this.stopDrag()}; mxDragSource.prototype.mouseDown=function(a){this.enabled&&!mxEvent.isConsumed(a)&&null==this.mouseMoveHandler&&(this.startDrag(a),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(a)&&(this.eventSource=mxEvent.getSource(a),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))}; mxDragSource.prototype.startDrag=function(a){this.dragElement=this.createDragElement(a);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()}; mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)};mxDragSource.prototype.getElementForEvent=function(a){return mxEvent.isTouchEvent(a)||mxEvent.isPenEvent(a)?document.elementFromPoint(mxEvent.getClientX(a),mxEvent.getClientY(a)):mxEvent.getSource(a)}; mxDragSource.prototype.graphContainsEvent=function(a,b){var c=mxEvent.getClientX(b),d=mxEvent.getClientY(b),e=mxUtils.getOffset(a.container),f=mxUtils.getScrollOrigin();b=this.getElementForEvent(b);if(this.checkEventSource)for(;null!=b&&b!=a.container;)b=b.parentNode;return null!=b&&c>=e.x-f.x&&d>=e.y-f.y&&c<=e.x-f.x+a.container.offsetWidth&&d<=e.y-f.y+a.container.offsetHeight}; mxDragSource.prototype.mouseMove=function(a){var b=this.getGraphForEvent(a);null==b||this.graphContainsEvent(b,a)||(b=null);b!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,a),this.currentGraph=b,null!=this.currentGraph&&this.dragEnter(this.currentGraph,a));null!=this.currentGraph&&this.dragOver(this.currentGraph,a);if(null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&mxUtils.setOpacity(this.dragElement, 0);else{b=mxEvent.getClientX(a);var c=mxEvent.getClientY(a);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement);mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);null!=this.dragOffset&&(b+=this.dragOffset.x,c+=this.dragOffset.y);var d=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=b+d.x+"px";this.dragElement.style.top=c+d.y+"px"}mxEvent.consume(a)}; mxDragSource.prototype.mouseUp=function(a){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var b=this.currentGraph.view.scale,c=this.currentGraph.view.translate;this.drop(this.currentGraph,a,this.currentDropTarget,this.currentPoint.x/b-c.x,this.currentPoint.y/b-c.y)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(a)}; mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null);mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseUpHandler=this.mouseMoveHandler=null}; mxDragSource.prototype.dragEnter=function(a,b){a.isMouseDown=!0;a.isMouseTrigger=mxEvent.isMouseEvent(b);this.previewElement=this.createPreviewElement(a);null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none");this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(a,a.graphHandler.getGuideStates()));this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(a,mxConstants.DROP_TARGET_COLOR));a.addListener(mxEvent.FIRE_MOUSE_EVENT, this.eventConsumer)};mxDragSource.prototype.dragExit=function(a,b){this.currentPoint=this.currentDropTarget=null;a.isMouseDown=!1;a.removeListener(this.eventConsumer);null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null);null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null);null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)}; mxDragSource.prototype.dragOver=function(a,b){var c=mxUtils.getOffset(a.container),d=mxUtils.getScrollOrigin(a.container),e=mxEvent.getClientX(b)-c.x+d.x-a.panDx;c=mxEvent.getClientY(b)-c.y+d.y-a.panDy;a.autoScroll&&(null==this.autoscroll||this.autoscroll)&&a.scrollPointToVisible(e,c,a.autoExtend);null!=this.currentHighlight&&a.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(a,e,c,b),d=a.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(d));if(null!=this.previewElement){null== this.previewElement.parentNode&&(a.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");d=this.isGridEnabled()&&a.isGridEnabledEvent(b);var f=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(b))a=parseInt(this.previewElement.style.width),f=parseInt(this.previewElement.style.height),a=new mxRectangle(0,0,a,f),c=new mxPoint(e,c),c=this.currentGuide.move(a,c,d,!0),f=!1,e=c.x,c=c.y;else if(d){d=a.view.scale;b= a.view.translate;var g=a.gridSize/2;e=(a.snap(e/d-b.x-g)+b.x)*d;c=(a.snap(c/d-b.y-g)+b.y)*d}null!=this.currentGuide&&f&&this.currentGuide.hide();null!=this.previewOffset&&(e+=this.previewOffset.x,c+=this.previewOffset.y);this.previewElement.style.left=Math.round(e)+"px";this.previewElement.style.top=Math.round(c)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(e,c)}; mxDragSource.prototype.drop=function(a,b,c,d,e){this.dropHandler.apply(this,arguments);"hidden"!=a.container.style.visibility&&a.container.focus()};function mxToolbar(a){this.container=a}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=!0;mxToolbar.prototype.noReset=!1;mxToolbar.prototype.updateDefaultMode=!0; mxToolbar.prototype.addItem=function(a,b,c,d,e,f){var g=document.createElement(null!=b?"img":"button"),k=e||(null!=f?"mxToolbarMode":"mxToolbarItem");g.className=k;g.setAttribute("src",b);null!=a&&(null!=b?g.setAttribute("title",a):mxUtils.write(g,a));this.container.appendChild(g);null!=c&&(mxEvent.addListener(g,"click",c),mxClient.IS_TOUCH&&mxEvent.addListener(g,"touchend",c));a=mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",b):g.style.backgroundColor=""});mxEvent.addGestureListeners(g, mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",d):g.style.backgroundColor="gray";if(null!=f){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var m=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu();m!=g&&(this.currentImg=g,this.menu.factoryMethod=f,m=new mxPoint(g.offsetLeft,g.offsetTop+g.offsetHeight),this.menu.popup(m.x,m.y,null,l),this.menu.isMenuShowing()&&(g.className=k+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this); g.className=k;this.currentImg=null}))}}),null,a);mxEvent.addListener(g,"mouseout",a);return g};mxToolbar.prototype.addCombo=function(a){var b=document.createElement("div");b.style.display="inline";b.className="mxToolbarComboContainer";var c=document.createElement("select");c.className=a||"mxToolbarCombo";b.appendChild(c);this.container.appendChild(b);return c}; mxToolbar.prototype.addActionCombo=function(a,b){var c=document.createElement("select");c.className=b||"mxToolbarCombo";this.addOption(c,a,null);mxEvent.addListener(c,"change",function(d){var e=c.options[c.selectedIndex];c.selectedIndex=0;null!=e.funct&&e.funct(d)});this.container.appendChild(c);return c};mxToolbar.prototype.addOption=function(a,b,c){var d=document.createElement("option");mxUtils.writeln(d,b);"function"==typeof c?d.funct=c:d.setAttribute("value",c);a.appendChild(d);return d}; mxToolbar.prototype.addSwitchMode=function(a,b,c,d,e){var f=document.createElement("img");f.initialClassName=e||"mxToolbarMode";f.className=f.initialClassName;f.setAttribute("src",b);f.altIcon=d;null!=a&&f.setAttribute("title",a);mxEvent.addListener(f,"click",mxUtils.bind(this,function(g){g=this.selectedMode.altIcon;null!=g?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",g)):this.selectedMode.className=this.selectedMode.initialClassName;this.updateDefaultMode&& (this.defaultMode=f);this.selectedMode=f;g=f.altIcon;null!=g?(f.altIcon=f.getAttribute("src"),f.setAttribute("src",g)):f.className=f.initialClassName+"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT));c()}));this.container.appendChild(f);null==this.defaultMode&&(this.defaultMode=f,this.selectMode(f),c());return f}; mxToolbar.prototype.addMode=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement(null!=b?"img":"button");g.initialClassName=e||"mxToolbarMode";g.className=g.initialClassName;g.setAttribute("src",b);g.altIcon=d;null!=a&&g.setAttribute("title",a);this.enabled&&f&&(mxEvent.addListener(g,"click",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!1})),mxEvent.addListener(g,"dblclick",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!0})),null==this.defaultMode&& (this.defaultMode=g,this.defaultFunction=c,this.selectMode(g,c)));this.container.appendChild(g);return g}; mxToolbar.prototype.selectMode=function(a,b){if(this.selectedMode!=a){if(null!=this.selectedMode){var c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=a;c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName+ "Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",b))}};mxToolbar.prototype.resetMode=function(a){!a&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)};mxToolbar.prototype.addSeparator=function(a){return this.addItem(null,a,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)}; mxToolbar.prototype.addLine=function(){var a=document.createElement("hr");a.style.marginRight="6px";a.setAttribute("size","1");this.container.appendChild(a)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null;null!=this.menu&&this.menu.destroy()};function mxUndoableEdit(a,b){this.source=a;this.changes=[];this.significant=null!=b?b:!0}mxUndoableEdit.prototype.source=null; mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){}; mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var b=this.changes[a];null!=b.execute?b.execute():null!=b.undo&&b.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",b))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()}; mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,b=0;b<a;b++){var c=this.changes[b];null!=c.execute?c.execute():null!=c.redo&&c.redo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!1;this.redone=!0;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};function mxUndoManager(a){this.size=null!=a?a:100;this.clear()}mxUndoManager.prototype=new mxEventSource; mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd}; mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var a=this.history[--this.indexOfNextAdd];a.undo();if(a.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length}; mxUndoManager.prototype.redo=function(){for(var a=this.history.length;this.indexOfNextAdd<a;){var b=this.history[this.indexOfNextAdd++];b.redo();if(b.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",b));break}}};mxUndoManager.prototype.undoableEditHappened=function(a){this.trim();0<this.size&&this.size==this.history.length&&this.history.shift();this.history.push(a);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",a))}; mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),b=0;b<a.length;b++)a[b].die()};var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=!0;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null; mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var a=this.baseUrl.lastIndexOf("/");0<a&&(this.baseUrl=this.baseUrl.substring(0,a+1))};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(a){this.enabled=a};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(a){this.baseUrl=a}; mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(a){this.baseDomain=a};mxUrlConverter.prototype.isRelativeUrl=function(a){return"string"===typeof a&&"data:image"!=a.substring(0,10)&&!/^(\/\/|[a-zA-Z][a-zA-Z\d+\-.]*:)/.test(a)};mxUrlConverter.prototype.convert=function(a){this.isEnabled()&&this.isRelativeUrl(a)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),a="/"==a.charAt(0)?this.getBaseDomain()+a:this.getBaseUrl()+a);return a}; function mxPanningManager(a){this.thread=null;this.active=!1;this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0;this.scrollbars=!1;this.scrollTop=this.scrollLeft=0;this.mouseListener={mouseDown:function(c,d){},mouseMove:function(c,d){},mouseUp:mxUtils.bind(this,function(c,d){this.active&&this.stop()})};a.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()});mxEvent.addListener(document,"mouseup",this.mouseUpListener);var b=mxUtils.bind(this, function(){this.scrollbars=mxUtils.hasScrollbars(a.container);this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;return window.setInterval(mxUtils.bind(this,function(){this.tdx-=this.dx;this.tdy-=this.dy;this.scrollbars?(a.panGraph(-a.container.scrollLeft-Math.ceil(this.dx),-a.container.scrollTop-Math.ceil(this.dy)),a.panDx=this.scrollLeft-a.container.scrollLeft,a.panDy=this.scrollTop-a.container.scrollTop,a.fireEvent(new mxEventObject(mxEvent.PAN))):a.panGraph(this.getDx(), this.getDy())}),this.delay)});this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=a.view.translate.x;this.t0y=a.view.translate.y;this.active=!0};this.panTo=function(c,d,e,f){this.active||this.start();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;var g=a.container;this.dx=c+(null!=e?e:0)-g.scrollLeft-g.clientWidth;this.dx=0>this.dx&&Math.abs(this.dx)< this.border?this.border+this.dx:this.handleMouseOut?Math.max(this.dx,0):0;0==this.dx&&(this.dx=c-g.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0);this.dy=d+(null!=f?f:0)-g.scrollTop-g.clientHeight;this.dy=0>this.dy&&Math.abs(this.dy)<this.border?this.border+this.dy:this.handleMouseOut?Math.max(this.dy,0):0;0==this.dy&&(this.dy=d-g.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy): 0);0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=b())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)};this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)a.panDx=0,a.panDy=0,a.fireEvent(new mxEventObject(mxEvent.PAN));else{var c=a.panDx,d=a.panDy;if(0!=c||0!=d)a.panGraph(0,0),a.view.setTranslate(this.t0x+c/a.view.scale, this.t0y+d/a.view.scale)}};this.destroy=function(){a.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=!0;mxPanningManager.prototype.border=0;function mxPopupMenu(a){this.factoryMethod=a;null!=a&&this.init()}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4="; mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=!1;mxPopupMenu.prototype.enabled=!0;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=!1;mxPopupMenu.prototype.smartSeparators=!1;mxPopupMenu.prototype.labels=!0; mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled}; mxPopupMenu.prototype.setEnabled=function(a){this.enabled=a};mxPopupMenu.prototype.isPopupTrigger=function(a){return a.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(a.getEvent())}; mxPopupMenu.prototype.addItem=function(a,b,c,d,e,f,g,k){d=d||this;this.itemCount++;d.willAddSeparator&&(d.containsItems&&this.addSeparator(d,!0),d.willAddSeparator=!1);d.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var m=document.createElement("td");m.className="mxPopupMenuIcon";null!=b?(e=document.createElement("img"),e.src=b,m.appendChild(e)):null!=e&&(b=document.createElement("div"),b.className=e,m.appendChild(b));l.appendChild(m);this.labels&&(m=document.createElement("td"), m.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),mxUtils.write(m,a),m.align="left",l.appendChild(m),a=document.createElement("td"),a.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),a.style.paddingRight="6px",a.style.textAlign="right",l.appendChild(a),null==d.div&&this.createSubmenu(d));d.tbody.appendChild(l);if(0!=g&&0!=f){var n=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,function(p){this.eventReceiver=l;d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&& this.hideSubmenu(d),null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));null!=document.selection&&8==document.documentMode&&(n=document.selection.createRange());mxEvent.consume(p)}),mxUtils.bind(this,function(p){d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),this.autoExpand&&null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));k||(l.className="mxPopupMenuItemHover")}),mxUtils.bind(this,function(p){if(this.eventReceiver==l){d.activeRow!=l&& this.hideMenu();if(null!=n){try{n.select()}catch(q){}n=null}null!=c&&c(p)}this.eventReceiver=null;mxEvent.consume(p)}));k||mxEvent.addListener(l,"mouseout",mxUtils.bind(this,function(p){l.className="mxPopupMenuItem"}))}return l};mxPopupMenu.prototype.addCheckmark=function(a,b){a=this.addImage(a.firstChild.nextSibling,b);a.style.marginTop="-2px";a.style.left="6px"}; mxPopupMenu.prototype.addImage=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.display="inline-block";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="center center";c.style.backgroundImage="url("+b+")";c.style.backgroundSize="22px";c.style.height="22px";c.style.width="22px";a.appendChild(c);return c}; mxPopupMenu.prototype.createSubmenu=function(a){a.table=document.createElement("table");a.table.className="mxPopupMenu";a.tbody=document.createElement("tbody");a.table.appendChild(a.tbody);a.div=document.createElement("div");a.div.className="mxPopupMenu";a.div.style.position="absolute";a.div.style.display="inline";a.div.style.zIndex=this.zIndex;a.div.appendChild(a.table);a=this.addImage(a.firstChild.nextSibling.nextSibling,this.submenuImage);a.style.marginLeft="-18px";a.style.marginTop="-11px"}; mxPopupMenu.prototype.showSubmenu=function(a,b){if(null!=b.div){b.div.style.left=a.div.offsetLeft+b.offsetLeft+b.offsetWidth-1+"px";b.div.style.top=a.div.offsetTop+b.offsetTop+"px";document.body.appendChild(b.div);var c=parseInt(b.div.offsetLeft),d=parseInt(b.div.offsetWidth),e=mxUtils.getDocumentScrollOrigin(document),f=document.documentElement;c+d>e.x+(document.body.clientWidth||f.clientWidth)&&(b.div.style.left=Math.max(0,a.div.offsetLeft-d+16)+"px");b.div.style.overflowY="auto";b.div.style.overflowX= "hidden";b.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px";mxUtils.fit(b.div)}}; mxPopupMenu.prototype.addSeparator=function(a,b){a=a||this;if(this.smartSeparators&&!b)a.willAddSeparator=!0;else if(null!=a.tbody){a.willAddSeparator=!1;b=document.createElement("tr");var c=document.createElement("td");c.className="mxPopupMenuIcon";c.style.padding="0 0 0 0px";b.appendChild(c);c=document.createElement("td");c.style.padding="0 0 0 0px";c.setAttribute("colSpan","2");var d=document.createElement("hr");d.setAttribute("size","1");c.appendChild(d);b.appendChild(c);a.tbody.appendChild(b)}}; mxPopupMenu.prototype.popup=function(a,b,c,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.div.style.left=a+"px";for(this.div.style.top=b+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,c,d);0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}}; mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none");document.body.appendChild(this.div);window.setTimeout(mxUtils.bind(this,function(){null!=this.div&&mxUtils.fit(this.div)}),0)}; mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))};mxPopupMenu.prototype.hideSubmenu=function(a){null!=a.activeRow&&(this.hideSubmenu(a.activeRow),null!=a.activeRow.div.parentNode&&a.activeRow.div.parentNode.removeChild(a.activeRow.div),a.activeRow=null)}; mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)};function mxAutoSaveManager(a){this.changeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.graphModelChanged(c.getProperty("edit").changes)});this.setGraph(a)}mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null; mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=!0;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};mxAutoSaveManager.prototype.setEnabled=function(a){this.enabled=a}; mxAutoSaveManager.prototype.setGraph=function(a){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler);this.graph=a;null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)};mxAutoSaveManager.prototype.save=function(){};mxAutoSaveManager.prototype.graphModelChanged=function(a){a=((new Date).getTime()-this.lastSnapshot)/1E3;a>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&a>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++}; mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};function mxAnimation(a){this.delay=null!=a?a:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return null!=this.thread}; mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))}; function mxMorphing(a,b,c,d){mxAnimation.call(this,d);this.graph=a;this.steps=null!=b?b:6;this.ease=null!=c?c:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;mxMorphing.prototype.cells=null; mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var a=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var b=0;b<this.cells.length;b++)this.animateCell(this.cells[b],a,!1);else this.animateCell(this.graph.getModel().getRoot(),a,!0);this.show(a);(a.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()};mxMorphing.prototype.show=function(a){a.show()}; mxMorphing.prototype.animateCell=function(a,b,c){var d=this.graph.getView().getState(a),e=null;if(null!=d&&(e=this.getDelta(d),this.graph.getModel().isVertex(a)&&(0!=e.x||0!=e.y))){var f=this.graph.view.getTranslate(),g=this.graph.view.getScale();e.x+=f.x*g;e.y+=f.y*g;b.moveState(d,-e.x/this.ease,-e.y/this.ease)}if(c&&!this.stopRecursion(d,e))for(d=this.graph.getModel().getChildCount(a),e=0;e<d;e++)this.animateCell(this.graph.getModel().getChildAt(a,e),b,c)}; mxMorphing.prototype.stopRecursion=function(a,b){return null!=b&&(0!=b.x||0!=b.y)};mxMorphing.prototype.getDelta=function(a){var b=this.getOriginForCell(a.cell),c=this.graph.getView().getTranslate(),d=this.graph.getView().getScale();return new mxPoint((b.x-(a.x/d-c.x))*d,(b.y-(a.y/d-c.y))*d)}; mxMorphing.prototype.getOriginForCell=function(a){var b=null;if(null!=a){var c=this.graph.getModel().getParent(a);a=this.graph.getCellGeometry(a);b=this.getOriginForCell(c);null!=a&&(a.relative?(c=this.graph.getCellGeometry(c),null!=c&&(b.x+=a.x*c.width,b.y+=a.y*c.height)):(b.x+=a.x,b.y+=a.y))}null==b&&(b=this.graph.view.getTranslate(),b=new mxPoint(-b.x,-b.y));return b};function mxImageBundle(a){this.images=[];this.alt=null!=a?a:!1}mxImageBundle.prototype.images=null; mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(a,b,c){this.images[a]={value:b,fallback:c}};mxImageBundle.prototype.getImage=function(a){var b=null;null!=a&&(a=this.images[a],null!=a&&(b=this.alt?a.fallback:a.value));return b};function mxImageExport(){}mxImageExport.prototype.includeOverlays=!1; mxImageExport.prototype.drawState=function(a,b){null!=a&&(this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))}; mxImageExport.prototype.visitStatesRecursive=function(a,b,c){if(null!=a){c(a,b);for(var d=a.view.graph,e=d.model.getChildCount(a.cell),f=0;f<e;f++){var g=d.view.getState(d.model.getChildAt(a.cell,f));this.visitStatesRecursive(g,b,c)}}};mxImageExport.prototype.getTitleForCellState=function(a,b){return null};mxImageExport.prototype.getLinkForCellState=function(a,b){return null};mxImageExport.prototype.getLinkTargetForCellState=function(a,b){return null}; mxImageExport.prototype.drawCellState=function(a,b){var c=this.getLinkForCellState(a,b);null!=c&&b.setLink(c,this.getLinkTargetForCellState(a,b));var d=this.getTitleForCellState(a,b);null!=d&&b.setTitle(d);this.drawShape(a,b);this.drawText(a,b);null!=d&&b.setTitle(null);null!=c&&b.setLink(null)};mxImageExport.prototype.drawShape=function(a,b){a.shape instanceof mxShape&&this.doDrawShape(a.shape,b)};mxImageExport.prototype.drawText=function(a,b){this.doDrawShape(a.text,b)}; mxImageExport.prototype.doDrawShape=function(a,b){if(null!=a&&a.checkBounds()){var c=b.root,d=a.node;b.root=a.createSvg();c.appendChild(b.root);a.node=b.root;b.save();var e=this.getSvgShapeOffset(a,b);0!=e?a.node.setAttribute("transform","translate("+e+","+e+")"):a.node.removeAttribute("transform");a.beforePaint(b);a.paint(b);a.afterPaint(b);b.restore();a.node=d;b.root=c}}; mxImageExport.prototype.getSvgShapeOffset=function(a,b){if(a.getSvgScreenOffset!=mxShape.prototype.getSvgScreenOffset)return a.getSvgScreenOffset();var c=null!=a.stencil&&"inherit"!=a.stencil.strokewidth?Number(a.stencil.strokewidth):a.strokewidth;b=a.scale*(null!=b.state?b.state.scale:1);return null!=a.stroke&&1==mxUtils.mod(Math.round(c*b),2)?.5:0};mxImageExport.prototype.drawOverlays=function(a,b){null!=a.overlays&&a.overlays.visit(function(c,d){d instanceof mxShape&&d.paint(b)})}; function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=!0;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C"; mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=!1;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]}; mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,labelPadding:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1, shadowStyle:null,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(a){return Math.round(parseFloat(a))}; mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var a=this.state,b=2;b<arguments.length;b+=2)this.lastX=arguments[b-1],this.lastY=arguments[b],this.path.push(this.format((this.lastX+a.dx)*a.scale)),this.path.push(this.format((this.lastY+a.dy)*a.scale))};mxAbstractCanvas2D.prototype.rotatePoint=function(a,b,c,d,e){c*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(a,b),Math.cos(c),Math.sin(c),new mxPoint(d,e))}; mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())};mxAbstractCanvas2D.prototype.setTitle=function(a){};mxAbstractCanvas2D.prototype.setLink=function(a,b){};mxAbstractCanvas2D.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a};mxAbstractCanvas2D.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b}; mxAbstractCanvas2D.prototype.rotate=function(a,b,c,d,e){};mxAbstractCanvas2D.prototype.setAlpha=function(a){this.state.alpha=a};mxAbstractCanvas2D.prototype.setFillAlpha=function(a){this.state.fillAlpha=a};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(a){this.state.strokeAlpha=a};mxAbstractCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null}; mxAbstractCanvas2D.prototype.setFillStyle=function(a,b,c,d){a==mxConstants.NONE&&(a=null);this.state.fillStyle=a;this.state.hachureGap=b;this.state.fillWeight=c;this.state.hachureAngle=d};mxAbstractCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){c=this.state;c.fillColor=a;c.gradientFillAlpha=null!=k?k:1;c.gradientColor=b;c.gradientAlpha=null!=l?l:1;c.gradientDirection=g};mxAbstractCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);this.state.strokeColor=a}; mxAbstractCanvas2D.prototype.setStrokeWidth=function(a){this.state.strokeWidth=a};mxAbstractCanvas2D.prototype.setDashed=function(a,b){this.state.dashed=a;this.state.fixDash=b};mxAbstractCanvas2D.prototype.setDashPattern=function(a){this.state.dashPattern=a};mxAbstractCanvas2D.prototype.setLineCap=function(a){this.state.lineCap=a};mxAbstractCanvas2D.prototype.setLineJoin=function(a){this.state.lineJoin=a};mxAbstractCanvas2D.prototype.setMiterLimit=function(a){this.state.miterLimit=a}; mxAbstractCanvas2D.prototype.setFontColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontColor=a};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAbstractCanvas2D.prototype.setLabelPadding=function(a){this.state.labelPadding=mxUtils.parseCssSpacing(a)};mxAbstractCanvas2D.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a}; mxAbstractCanvas2D.prototype.setFontSize=function(a){this.state.fontSize=parseFloat(a)};mxAbstractCanvas2D.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAbstractCanvas2D.prototype.setFontStyle=function(a){null==a&&(a=0);this.state.fontStyle=a};mxAbstractCanvas2D.prototype.setShadow=function(a,b){this.state.shadow=a;this.state.shadowStyle=b};mxAbstractCanvas2D.prototype.setShadowColor=function(a){a==mxConstants.NONE&&(a=null);this.state.shadowColor=a}; mxAbstractCanvas2D.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a};mxAbstractCanvas2D.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b};mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(a,b){this.addOp(this.moveOp,a,b)};mxAbstractCanvas2D.prototype.lineTo=function(a,b){this.addOp(this.lineOp,a,b)}; mxAbstractCanvas2D.prototype.quadTo=function(a,b,c,d){this.addOp(this.quadOp,a,b,c,d)};mxAbstractCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){this.addOp(this.curveOp,a,b,c,d,e,f)};mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxAbstractCanvas2D.prototype.close=function(a,b,c,d,e,f){this.addOp(this.closeOp)}; mxAbstractCanvas2D.prototype.end=function(){};function mxXmlCanvas2D(a){mxAbstractCanvas2D.call(this);this.root=a;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=!0;mxXmlCanvas2D.prototype.compressed=!0; mxXmlCanvas2D.prototype.writeDefaults=function(){var a=this.createElement("fontfamily");a.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(a);a=this.createElement("fontsize");a.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(a);a=this.createElement("shadowcolor");a.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(a);a=this.createElement("shadowalpha");a.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(a);a= this.createElement("shadowoffset");a.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);a.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(a)};mxXmlCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(a){return this.root.ownerDocument.createElement(a)};mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments);this.root.appendChild(this.createElement("save"))}; mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments);this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(a){var b=this.createElement("scale");b.setAttribute("scale",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.translate=function(a,b){var c=this.createElement("translate");c.setAttribute("dx",this.format(a));c.setAttribute("dy",this.format(b));this.root.appendChild(c)}; mxXmlCanvas2D.prototype.rotate=function(a,b,c,d,e){var f=this.createElement("rotate");if(0!=a||b||c)f.setAttribute("theta",this.format(a)),f.setAttribute("flipH",b?"1":"0"),f.setAttribute("flipV",c?"1":"0"),f.setAttribute("cx",this.format(d)),f.setAttribute("cy",this.format(e)),this.root.appendChild(f)}; mxXmlCanvas2D.prototype.setAlpha=function(a){if(this.compressed){if(this.state.alpha==a)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var b=this.createElement("alpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};mxXmlCanvas2D.prototype.setFillAlpha=function(a){if(this.compressed){if(this.state.fillAlpha==a)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var b=this.createElement("fillalpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setStrokeAlpha=function(a){if(this.compressed){if(this.state.strokeAlpha==a)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var b=this.createElement("strokealpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fillColor==a)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var b=this.createElement("fillcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){if(null!=a&&null!=b){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var m=this.createElement("gradient");m.setAttribute("c1",a);m.setAttribute("c2",b);m.setAttribute("x",this.format(c));m.setAttribute("y",this.format(d));m.setAttribute("w",this.format(e));m.setAttribute("h",this.format(f));null!=g&&m.setAttribute("direction",g);null!=k&&m.setAttribute("alpha1",k);null!=l&&m.setAttribute("alpha2",l);this.root.appendChild(m)}}; mxXmlCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.strokeColor==a)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var b=this.createElement("strokecolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setStrokeWidth=function(a){if(this.compressed){if(this.state.strokeWidth==a)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var b=this.createElement("strokewidth");b.setAttribute("width",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setDashed=function(a,b){if(this.compressed){if(this.state.dashed==a)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var c=this.createElement("dashed");c.setAttribute("dashed",a?"1":"0");null!=b&&c.setAttribute("fixDash",b?"1":"0");this.root.appendChild(c)}; mxXmlCanvas2D.prototype.setDashPattern=function(a){if(this.compressed){if(this.state.dashPattern==a)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var b=this.createElement("dashpattern");b.setAttribute("pattern",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setLineCap=function(a){if(this.compressed){if(this.state.lineCap==a)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var b=this.createElement("linecap");b.setAttribute("cap",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setLineJoin=function(a){if(this.compressed){if(this.state.lineJoin==a)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var b=this.createElement("linejoin");b.setAttribute("join",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setMiterLimit=function(a){if(this.compressed){if(this.state.miterLimit==a)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var b=this.createElement("miterlimit");b.setAttribute("limit",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setFontColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontColor==a)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var b=this.createElement("fontcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontBackgroundColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBackgroundColor==a)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var b=this.createElement("fontbackgroundcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontBorderColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBorderColor==a)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var b=this.createElement("fontbordercolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontSize=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==a)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var b=this.createElement("fontsize");b.setAttribute("size",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontFamily=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==a)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var b=this.createElement("fontfamily");b.setAttribute("family",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontStyle=function(a){if(this.textEnabled){null==a&&(a=0);if(this.compressed){if(this.state.fontStyle==a)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var b=this.createElement("fontstyle");b.setAttribute("style",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setShadow=function(a){if(this.compressed){if(this.state.shadow==a)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var b=this.createElement("shadow");b.setAttribute("enabled",a?"1":"0");this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowColor=function(a){if(this.compressed){a==mxConstants.NONE&&(a=null);if(this.state.shadowColor==a)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var b=this.createElement("shadowcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowAlpha=function(a){if(this.compressed){if(this.state.shadowAlpha==a)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var b=this.createElement("shadowalpha");b.setAttribute("alpha",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowOffset=function(a,b){if(this.compressed){if(this.state.shadowDx==a&&this.state.shadowDy==b)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var c=this.createElement("shadowoffset");c.setAttribute("dx",a);c.setAttribute("dy",b);this.root.appendChild(c)}; mxXmlCanvas2D.prototype.rect=function(a,b,c,d){var e=this.createElement("rect");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)}; mxXmlCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){var g=this.createElement("roundrect");g.setAttribute("x",this.format(a));g.setAttribute("y",this.format(b));g.setAttribute("w",this.format(c));g.setAttribute("h",this.format(d));g.setAttribute("dx",this.format(e));g.setAttribute("dy",this.format(f));this.root.appendChild(g)}; mxXmlCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.createElement("ellipse");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)}; mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k){e=this.converter.convert(e);var l=this.createElement("image");l.setAttribute("x",this.format(a));l.setAttribute("y",this.format(b));l.setAttribute("w",this.format(c));l.setAttribute("h",this.format(d));l.setAttribute("src",e);l.setAttribute("aspect",f?"1":"0");l.setAttribute("flipH",g?"1":"0");l.setAttribute("flipV",k?"1":"0");this.root.appendChild(l)}; mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b}; mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d}; mxXmlCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){var g=this.createElement("curve");g.setAttribute("x1",this.format(a));g.setAttribute("y1",this.format(b));g.setAttribute("x2",this.format(c));g.setAttribute("y2",this.format(d));g.setAttribute("x3",this.format(e));g.setAttribute("y3",this.format(f));this.root.appendChild(g);this.lastX=e;this.lastY=f};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))}; mxXmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){mxUtils.isNode(e)&&(e=mxUtils.getOuterHtml(e));var r=this.createElement("text");r.setAttribute("x",this.format(a));r.setAttribute("y",this.format(b));r.setAttribute("w",this.format(c));r.setAttribute("h",this.format(d));r.setAttribute("str",e);null!=f&&r.setAttribute("align",f);null!=g&&r.setAttribute("valign",g);r.setAttribute("wrap",k?"1":"0");null==l&&(l="");r.setAttribute("format",l);null!=m&&r.setAttribute("overflow", m);null!=n&&r.setAttribute("clip",n?"1":"0");null!=p&&r.setAttribute("rotation",p);null!=q&&r.setAttribute("dir",q);this.root.appendChild(r)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))}; function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.idPrefix="";this.gradients=[];this.fillPatterns=[];this.defs=this.viewTranslate=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild): b.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D); (function(){mxSvgCanvas2D.prototype.useDomParser="function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();mxSvgCanvas2D.prototype.node=null; mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all"; mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&"function"===typeof a.setAttribute&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))}; mxSvgCanvas2D.prototype.getBaseUrl=function(){var a=window.location.href,b=a.indexOf("#");0<b&&(a=a.substring(0,b));return a};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[];this.fillPatterns=[]}; mxSvgCanvas2D.prototype.createStyle=function(a){a=this.createElement("style");a.setAttribute("type","text/css");mxUtils.write(a,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return a}; mxSvgCanvas2D.prototype.createElement=function(a,b){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(b||mxConstants.NS_SVG,a);a=this.root.ownerDocument.createElement(a);null!=b&&a.setAttribute("xmlns",b);return a};mxSvgCanvas2D.prototype.getAlternateText=function(a,b,c,d,e,f,g,k,l,m,n,p,q){return null!=f?this.foAltText:null}; mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.state;a=a.split(/\r\n|\r|\n/);d=(d||"fill"==e||"width"==e)&&0<b;var k=b+this.foreignObjectPadding,l=null;if(d||f&&0<b)l=document.createElement("canvas").getContext("2d"),l.font=((g.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic ":"")+((g.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold ":"")+g.fontSize+"px "+mxUtils.parseCssFontFamily(g.fontFamily);if(d&&null!=l){b=[];for(var m=0;m<a.length;m++){for(var n= a[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length- 1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a}; mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM? (d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&& k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle= "dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null}; mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")}; mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g): k.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")}; mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement(e==mxConstants.DIRECTION_RADIAL?"radialGradient":"linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%"); e=this.createElement("stop");e.setAttribute("offset","0%");e.setAttribute("stop-color",a.light);e.style.stopColor=a.cssText;e.setAttribute("stop-opacity",c);e.style.stopOpacity=c;f.appendChild(e);e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("stop-color",b.light);e.style.stopColor=b.cssText;e.setAttribute("stop-opacity",d);e.style.stopOpacity=d;f.appendChild(e);return f}; mxSvgCanvas2D.prototype.createFillPatternId=function(a,b,c,d,e,f,g){a=["mx-pattern",a,Math.round(100*b),c.light,c.dark,Math.round(100*d)];null==e&&null==f&&null==g||a.push(null!=e?Math.round(100*e):"a",null!=f?Math.round(100*f):"a",null!=g?Math.round(100*g):"a");return a.join("-").toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")}; mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d,e,f,g){c=this.getLightDarkColor(c);e=parseFloat(e);e=!isFinite(e)||0>=e?null:Math.max(1,e);var k=parseFloat(f);k=!isFinite(k)||0>=k?null:k;g=parseFloat(g);g=isFinite(g)?g:null;if(null!=e||null!=k||null!=g)e=null!=e?e:Math.max(1,4*b),k=null!=k?k:b/2,g=null!=g?g:-41;var l=this.createFillPatternId(a,b,c,d,e,k,g);f=this.fillPatterns[l];if(null==f){var m=this.root.ownerSVGElement,n=0,p=l+"-"+n;if(null!=m)for(f=m.ownerDocument.getElementById(p);null!= f&&f.ownerSVGElement!=m;)p=l+"-"+n++,f=m.ownerDocument.getElementById(p);else p="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d,e,k);break;case "dots":f=this.createDotsPattern(b,c,d,e,k);break;case "cross-hatch":f=this.createCrossHatchPattern(b,c,d,e,k);break;case "dashed":f=this.createDashedPattern(b,c,d,e,k);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d,e,k);break;default:return null}f.setAttribute("id",p);null!=this.defs?this.defs.appendChild(f): m.appendChild(f)}this.fillPatterns[l]=f}c=this.viewTranslate;b=null!=c?this.format(c.x*d):0;c=null!=c?this.format(c.y*d):0;f.setAttribute("patternTransform","translate("+b+","+c+")"+("dots"!==a?" rotate("+(null!=g?90+g:45)+")":"")+" scale("+d+")");return f.getAttribute("id")}; mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1","0");f.setAttribute("x2",e);f.setAttribute("y2",d);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width", a);c.appendChild(f);return c}; mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1",d/4);f.setAttribute("x2",e);f.setAttribute("y2",3*d/4);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width", a);c.appendChild(f);return c}; mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("path");var f=d/4,g=3*d/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+d+" L "+g+" "+d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a); e.setAttribute("fill","none");c.appendChild(e);return c}; mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c,d,e){a=null!=e?e:.5*a;d=this.format(null!=d?d:1.5*(10+a));c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",d);e.setAttribute("height",d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width", a);e.setAttribute("fill","none");c.appendChild(e);return c}; mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c,d,e){a=this.format(null!=d?d:10+a);e=null!=e?Math.min(e/2,a/2):a/4;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",e);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d); return c};mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a}; mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&& c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")|| "none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))}; mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+ ")"}else c="url(#"+c+")";d=c}else String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText);var e=Math.max(this.minStrokeWidth,Math.max(.01,this.format(a.strokeWidth)));a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,e,c,a.scale,a.hachureGap,a.fillWeight,a.hachureAngle);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument== document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill","url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))}; mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state,b=this.getLightDarkColor(String(a.strokeColor).toLowerCase());this.node.setAttribute("stroke",b.light);this.node.style.stroke=b.cssText;(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);b=this.getCurrentStrokeWidth();1!=b&&this.node.setAttribute("stroke-width",b);"path"==this.node.nodeName&&this.updateStrokeAttributes();a.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((a.fixDash? 1:a.strokeWidth)*a.scale))};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null==a.miterLimit||this.styleEnabled&&10==a.miterLimit||this.node.setAttribute("stroke-miterlimit",a.miterLimit)}; mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Math.round(Number(c[d])*a*100)/100}return b.join(" ")}; mxSvgCanvas2D.prototype.createTolerance=function(a){a=a.cloneNode(!0);var b=parseFloat(a.getAttribute("stroke-width")||1)+this.strokeTolerance;a.setAttribute("pointer-events","stroke");a.setAttribute("visibility","hidden");a.removeAttribute("stroke-dasharray");a.setAttribute("stroke-width",b);a.setAttribute("fill","none");a.setAttribute("stroke",mxClient.IS_OT?"none":"white");return a}; mxSvgCanvas2D.prototype.createShadow=function(a){a=a.cloneNode(!0);var b=this.state;"none"==a.getAttribute("fill")||mxClient.IS_FF&&"transparent"==a.getAttribute("fill")||a.setAttribute("fill",b.shadowColor);"none"!=a.getAttribute("stroke")&&a.setAttribute("stroke",b.shadowColor);a.setAttribute("transform","translate("+this.format(b.shadowDx*b.scale)+","+this.format(b.shadowDy*b.scale)+")"+(b.transform||""));a.setAttribute("opacity",b.shadowAlpha);return a}; mxSvgCanvas2D.prototype.setTitle=function(a){this.title=a};mxSvgCanvas2D.prototype.setLink=function(a,b){if(null==a)this.root=this.originalRoot;else{this.originalRoot=this.root;var c=this.createElement("a");null==c.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?c.setAttribute("xlink:href",a):c.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);null!=b&&c.setAttribute("target",b);this.root.appendChild(c);this.root=c}}; mxSvgCanvas2D.prototype.rotate=function(a,b,c,d,e){if(0!=a||b||c){var f=this.state;d+=f.dx;e+=f.dy;d*=f.scale;e*=f.scale;f.transform=f.transform||"";if(b&&c)a+=180;else if(b!=c){var g=b?d:0,k=b?-1:1,l=c?e:0,m=c?-1:1;f.transform+="translate("+this.format(g)+","+this.format(l)+")scale("+this.format(k)+","+this.format(m)+")translate("+this.format(-g)+","+this.format(-l)+")"}if(b?!c:c)a*=-1;0!=a&&(f.transform+="rotate("+this.format(a)+","+this.format(d)+","+this.format(e)+")");f.rotation+=a;f.rotationCx= d;f.rotationCy=e}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(a,b,c,d){var e=this.state,f=this.createElement("rect");f.setAttribute("x",this.format((a+e.dx)*e.scale));f.setAttribute("y",this.format((b+e.dy)*e.scale));f.setAttribute("width",this.format(c*e.scale));f.setAttribute("height",this.format(d*e.scale));this.node=f}; mxSvgCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.rect(a,b,c,d);0<e&&this.node.setAttribute("rx",this.format(e*this.state.scale));0<f&&this.node.setAttribute("ry",this.format(f*this.state.scale))};mxSvgCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.state,f=this.createElement("ellipse");f.setAttribute("cx",this.format((a+c/2+e.dx)*e.scale));f.setAttribute("cy",this.format((b+d/2+e.dy)*e.scale));f.setAttribute("rx",c/2*e.scale);f.setAttribute("ry",d/2*e.scale);this.node=f}; mxSvgCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k,l,m){e=this.converter.convert(e);null!=e&&/^\s*(javascript|vbscript|livescript)\s*:/i.test(String(e).replace(/[\x00-\x1F\x7F]/g,""))&&(e="");f=null!=f?f:!0;g=null!=g?g:!1;k=null!=k?k:!1;var n=this.state;a+=n.dx;b+=n.dy;var p=null;if(null!=m){var q=null!=this.createImageSymbol?this.createImageSymbol(e,f):null;if(null!=q||"data:"!=e.substring(0,5))q=null!=q?"#"+q:e,p=this.createElement("use"),""!=m&&p.setAttribute("style",m),p.setAttribute("href", q),null!=p.setAttributeNS&&p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",q)}null==p&&this.dedupImages&&null!=this.defs?(e="#"+this.getImageDef(e,c*n.scale,d*n.scale,f),p=this.createElement("use"),p.setAttribute("href",e),null!=p.setAttributeNS&&p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e)):null==p&&(p=this.createElement("image"),null==p.setAttributeNS?p.setAttribute("xlink:href",e):p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e),f||p.setAttribute("preserveAspectRatio","none")); p.setAttribute("x",this.format(a*n.scale)+this.imageOffset);p.setAttribute("y",this.format(b*n.scale)+this.imageOffset);p.setAttribute("width",this.format(c*n.scale));p.setAttribute("height",this.format(d*n.scale));(1>n.alpha||1>n.fillAlpha)&&p.setAttribute("opacity",n.alpha*n.fillAlpha);e=this.state.transform||"";if(g||k){m=f=1;var r=q=0;g&&(f=-1,q=-c-2*a);k&&(m=-1,r=-d-2*b);e+="scale("+f+","+m+")translate("+q*n.scale+","+r*n.scale+")"}0<e.length&&p.setAttribute("transform",e);this.pointerEvents|| p.setAttribute("pointer-events","none");null!=l&&this.processClipPath(p,l,new mxRectangle(a,b,c,d));this.root.appendChild(p)}; mxSvgCanvas2D.prototype.getImageDef=function(a,b,c,d){null==this.imageDefs&&(this.imageDefs={},this.imageDefIds={});var e=a+"|"+d+"|"+(d&&0!=c?(b/c).toFixed(4):""),f=this.imageDefs[e];if(null==f){for(f="mx-image-"+mxUtils.hashCode(e);null!=this.imageDefIds[f];)f+="-1";var g=this.createElement("symbol");g.setAttribute("id",f);g.setAttribute("viewBox","0 0 "+this.format(b)+" "+this.format(c));var k=this.createElement("image");k.setAttribute("width",this.format(b));k.setAttribute("height",this.format(c)); null==k.setAttributeNS?k.setAttribute("xlink:href",a):k.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);d||(g.setAttribute("preserveAspectRatio","none"),k.setAttribute("preserveAspectRatio","none"));g.appendChild(k);this.defs.appendChild(g);this.imageDefs[e]=f;this.imageDefIds[f]=e}return f}; mxSvgCanvas2D.prototype.processClipPath=function(a,b,c){try{var d=this.createElement("clipPath");d.setAttribute("id",this.createClipPathId(b));d.setAttribute("clipPathUnits","objectBoundingBox");var e=this.appendClipPath(d,b,c);if(null!=e){var f=this.state;a.setAttribute("x",c.x*f.scale-c.width*f.scale*e.x/e.width+this.imageOffset);a.setAttribute("y",c.y*f.scale-c.height*f.scale*e.y/e.height+this.imageOffset);a.setAttribute("width",c.width*f.scale/e.width);a.setAttribute("height",c.height*f.scale/ e.height)}this.setClip(a,d)}catch(g){}}; mxSvgCanvas2D.prototype.convertHtml=function(a){if(this.useDomParser){var b=(new DOMParser).parseFromString(a,"text/html");null!=b&&(a=(new XMLSerializer).serializeToString(b.body),"<body"==a.substring(0,5)&&(a=a.substring(a.indexOf(">",5)+1)),"</body>"==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){b=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var c=b.createElement("body"); b.documentElement.appendChild(c);var d=document.createElement("div");d.innerHTML=a;for(a=d.firstChild;null!=a;)d=a.nextSibling,c.appendChild(b.adoptNode(a)),a=d;return c.innerHTML}b=document.createElement("textarea");b.innerHTML=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">");a=b.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g, "&").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return a}; mxSvgCanvas2D.prototype.createDiv=function(a){mxUtils.isNode(a)||(a="<div><div>"+this.convertHtml(a)+"</div></div>");if(document.createElementNS){var b=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(a)){var c=document.createElement("div"),d=c.cloneNode(!1);this.root.ownerDocument!=document?c.appendChild(a.cloneNode(!0)):c.appendChild(a);d.appendChild(c);b.appendChild(d)}else b.innerHTML=a;return b}mxUtils.isNode(a)&&(a="<div><div>"+mxUtils.getXml(a)+"</div></div>"); return mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div>").documentElement}; mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n,p){if(null!=p&&null!=p.firstChild)if(null!=p.firstChild.firstChild&&"foreignObject"==p.firstChild.firstChild.nodeName)this.updateTextNodes(a,b,c,d,e,f,g,k,l,m,n,p.firstChild);else if("g"==p.nodeName){p=p.firstChild;var q=p.getAttribute("data-blockTextHeight");if(null!=q){var r=p.getAttribute("data-htmlContentWidth");r=null!=r?parseFloat(r):null;this.plainText(a,b,c,d,"",e,f,g,k,l,m,n,null,p,parseFloat(q),null==r||isNaN(r)?null:r)}else this.plainText(a, b,c,d,"",e,f,g,k,l,m,n,null,p)}}; mxSvgCanvas2D.prototype.addForeignObject=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t){var u=this.addTitle(this.createElement("g")),v=this.createElement("foreignObject");this.setCssText(v,"overflow: visible; text-align: left;");v.setAttribute("pointer-events","none");r.ownerDocument!=document&&(r=mxUtils.importNodeImplementation(v.ownerDocument,r,!0));v.appendChild(r);u.appendChild(v);this.updateTextNodes(a,b,c,d,f,g,k,m,n,p,q,u);this.root.ownerDocument!=document&&(a=this.createAlternateContent(v,a,b,c, d,e,f,g,k,l,m,n,p),null!=a&&(v.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),b=this.createElement("switch"),b.appendChild(v),b.appendChild(a),u.appendChild(b)));t.appendChild(u)}; mxSvgCanvas2D.prototype.updateTextNodes=function(a,b,c,d,e,f,g,k,l,m,n,p){var q=this.state.scale,r="",t="";null!=n&&"vertical-"==n.substring(0,9)?(r="-rl"==n.substring(n.length-3),t=e==mxConstants.ALIGN_LEFT?r?"flex-end":"flex-start":e==mxConstants.ALIGN_RIGHT?r?"flex-start":"flex-end":"center",r=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center"):(t=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center",r=e==mxConstants.ALIGN_LEFT? "flex-start":e==mxConstants.ALIGN_RIGHT?"flex-end":"center");var u=null!=this.state.fontBackgroundColor?this.getLightDarkColor(this.state.fontBackgroundColor):null,v=null!=this.state.fontBorderColor?this.getLightDarkColor(this.state.fontBorderColor):null;mxSvgCanvas2D.createCss(c+this.foreignObjectPadding,d,e,f,g,k,l,n,null!=u?u.cssText:null,null!=v?v.cssText:null,null!=u||null!=v?this.state.labelPadding:null,"display: flex; align-items: unsafe "+t+"; justify-content: unsafe "+r+"; "+(null!=n&&"vertical-"== n.substring(0,9)?"writing-mode: "+n+";":""),this.getTextCss(),q,mxUtils.bind(this,function(y,A,z,x,C){a+=this.state.dx;b+=this.state.dy;var D=p.firstChild;"title"==D.nodeName&&(D=D.nextSibling);x+="color: "+this.getLightDarkColor(this.state.fontColor).light+"; ";x+=null!=u?"background-color: "+u.light+"; ":"";x+=null!=v?"border-color: "+v.light+"; ":"";var B=D.firstChild,E=B.firstChild,K=(this.rotateHtml?this.state.rotation:0)+(null!=m?m:0),G=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+ ")":"")+(1!=q?"scale("+q+")":"");this.setCssText(E.firstChild,C);this.setCssText(E,x);D.setAttribute("width",Math.ceil(1/Math.min(1,q)*100)+"%");D.setAttribute("height",Math.ceil(1/Math.min(1,q)*100)+"%");A=Math.round(b+A);0>A?(D.setAttribute("y",A),z+="padding-top: 0; "):(D.removeAttribute("y"),z+="padding-top: "+A+"px; ");this.setCssText(B,z+"margin-left: "+Math.round(a+y)+"px;");G+=0!=K?"rotate("+K+" "+a+" "+b+")":"";""!=G?p.setAttribute("transform",G):p.removeAttribute("transform");1!=this.state.alpha? p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))}; mxSvgCanvas2D.createCss=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t){k=null!=k&&"vertical-"==k.substring(0,9);r="box-sizing: border-box; font-size: 0; ";r=k?r+("text-align: "+(d==mxConstants.ALIGN_TOP?"left":d==mxConstants.ALIGN_BOTTOM?"right":"center")+"; "):r+("text-align: "+(c==mxConstants.ALIGN_LEFT?"left":c==mxConstants.ALIGN_RIGHT?"right":"center")+"; ");var u=mxUtils.getAlignmentAsPoint(c,d);c="overflow: hidden; ";var v="width: 1px; ",y="height: 1px; ",A=u.x*a;u=u.y*b;g?(v="width: "+Math.round(a)+ "px; ",r+="max-height: "+Math.round(b)+"px; ",u=0):"fill"==f?(v="width: "+Math.round(a)+"px; ",y="height: "+Math.round(b)+"px; ",q+="width: 100%; height: 100%; ",r+="width: "+Math.round(a-2)+"px; "+y):"width"==f?(v="width: "+Math.round(a-2)+"px; ",q+="width: 100%; ",r+=v,u=0,0<b&&(r+="max-height: "+Math.round(b)+"px; ")):"block"==f?(v="width: "+Math.round(a-2)+"px; ",q+="width: 100%; ",c="",u=0,r+=v,"middle"==d&&(r+="max-height: "+Math.round(b)+"px; ")):(c="",k?A=0:u=0);d="";null!=l&&(d+="background-color: "+ l+"; ");null!=m&&(d+="border-width: 1px; border-style: solid; border-color: inherit; border: 1px solid "+m+"; ");""!=d&&null!=n&&(d+="padding: "+n.top+"px "+n.right+"px "+n.bottom+"px "+n.left+"px; ",""==c||g)&&(d+="margin: "+-n.top+"px "+-n.right+"px "+-n.bottom+"px "+-n.left+"px; ");""==c||g?q+=d:r+=d;e&&(k&&0<b||!k&&0<a)?(q+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",k?y="height: "+Math.round(b)+"px; ":v="width: "+Math.round(a)+"px; ",""!=c&&"fill"!=f&&(k?A=0:u=0)):(q+="white-space: nowrap; ", ""==c&&"block"!=f&&(A=0));t(A,u,p+v+y,r+c,q,c)}; mxSvgCanvas2D.prototype.getTextCss=function(){var a=this.state,b=mxConstants.ABSOLUTE_LINE_HEIGHT?a.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;b="display: inline-block; font-size: "+mxUtils.htmlEntities(a.fontSize)+"px; font-family: "+mxUtils.parseCssFontFamily(a.fontFamily,!0)+"; color: "+this.getLightDarkColor(mxUtils.htmlEntities(a.fontColor)).cssText+"; line-height: "+mxUtils.htmlEntities(b)+"; pointer-events: "+(this.pointerEvents?mxUtils.htmlEntities(this.pointerEventsValue): "none")+"; ";(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="font-weight: bold; ");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="font-style: italic; ");var c=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&((a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&c.push("dotted"), b+="text-decoration: "+c.join(" ")+"; ");return b};mxSvgCanvas2D.prototype.convertHtmlToSvg=function(a,b,c,d,e){return mxUtils.convertHtmlToSvg(a,b,c,{dir:e,fontScale:d,fontSize:this.state.fontSize,createElement:mxUtils.bind(this,this.createElement)})}; mxSvgCanvas2D.prototype.wrapSvgTextElement=function(a,b){function c(H,F){for(var J=0;J<H.childNodes.length;J++){var I=H.childNodes[J];if(I.nodeType==mxConstants.NODETYPE_TEXT)0<I.nodeValue.length&&n.push({text:I.nodeValue,attrs:d(F.attrs),css:d(F.css),absoluteDy:p});else if(I.nodeType==mxConstants.NODETYPE_ELEMENT){for(var M={attrs:d(F.attrs),css:d(F.css)},O=["font-weight","font-style","fill","text-decoration"],N=0;N<O.length;N++){var P=I.getAttribute(O[N]);null!=P&&(M.attrs[O[N]]=P)}if(null!=I.style){if(""!= I.style.cssText)for(O=I.style.cssText.split(";"),N=0;N<O.length;N++)if(P=O[N].split(":"),2==P.length){var R=P[0].trim();P=P[1].trim();0<R.length&&0<P.length&&(M.css[R]=P)}I.style.fill&&(M.css.fill=I.style.fill)}P=I.getAttribute("dy");null!=P&&(p+=parseFloat(P));c(I,M)}}}function d(H){var F={},J;for(J in H)H.hasOwnProperty(J)&&(F[J]=H[J]);return F}function e(H){var F=k;H=n[H].css["font-size"];null!=H&&("smaller"==H?F=k/1.2:0<=H.indexOf("em")?F=parseFloat(H)*k:0<=H.indexOf("px")&&(F=parseFloat(H))); return F}function f(H){var F=n[H.segIdx],J=F.attrs["font-weight"]||"",I=F.attrs["font-style"]||"",M=l,O=k;F.css["font-weight"]&&(J=F.css["font-weight"]);F.css["font-style"]&&(I=F.css["font-style"]);F.css["font-family"]&&(M=F.css["font-family"]);F.css["font-size"]&&(F=F.css["font-size"],"smaller"==F?O=k/1.2:0<=F.indexOf("em")?O=parseFloat(F)*k:0<=F.indexOf("px")&&(O=parseFloat(F)));J||(m&mxConstants.FONT_BOLD)!=mxConstants.FONT_BOLD||(J="bold");I||(m&mxConstants.FONT_ITALIC)!=mxConstants.FONT_ITALIC|| (I="italic");u.font=I+" "+J+" "+O+"px "+M;return u.measureText(H.text).width}var g=this.state,k=g.fontSize,l=g.fontFamily,m=g.fontStyle,n=[],p=0;c(a,{attrs:{},css:{}});if(0==n.length)return null;for(var q=[],r=0;r<n.length;r++){a=n[r].text.split(/(\s+)/);for(var t=0;t<a.length;t++)0<a[t].length&&q.push({text:a[t],segIdx:r,isSpace:/^\s+$/.test(a[t])})}var u=document.createElement("canvas").getContext("2d"),v=this.textFlow;g=null;a=[[]];var y=0;if(null!=v){var A=k*mxConstants.LINE_HEIGHT;a=function(H){var F= {lines:[[]],extras:[],height:0},J=H,I=v.available(J,J+A);F.extras.push({x:I.x,width:I.width,shift:0});for(var M=0,O=0;O<q.length;O++){var N=q[O];null==N.width&&(N.width=f(N));if(N.isSpace)0<M&&(F.lines[F.lines.length-1].push(N),M+=N.width);else{var P=0<O&&q[O-1].isSpace;M+N.width>I.width&&0<M&&P&&(I=F.lines[F.lines.length-1],0<I.length&&I[I.length-1].isSpace&&I.pop(),J+=A,F.lines.push([]),I=v.available(J,J+A),F.extras.push({x:I.x,width:I.width,shift:0}),M=0);for(P=0;0==M&&N.width>I.width&&J-H<v.boxHeight&& 400>P++;){J+=A;var R=F.extras[F.extras.length-1];R.shift+=A;I=v.available(J,J+A);R.x=I.x;R.width=I.width}F.lines[F.lines.length-1].push(N);M+=N.width}}F.height=J+A-H;return F};g=a(0);for(b=r=0;3>b;b++){var z=0;if(v.valign==mxConstants.ALIGN_MIDDLE)z=(v.boxHeight-g.height)/2;else if(v.valign==mxConstants.ALIGN_BOTTOM)z=v.boxHeight-g.height;else break;if(1>Math.abs(z-r))break;r=z;g=a(r)}a=g.lines;g=g.extras}else for(r=0;r<q.length;r++){z=q[r];var x=f(z);z.width=x;if(z.isSpace)0<y&&(a[a.length-1].push(z), y+=x);else{var C=0<r&&q[r-1].isSpace;y+x>b&&0<y&&C&&(y=a[a.length-1],0<y.length&&y[y.length-1].isSpace&&y.pop(),a.push([]),y=0);a[a.length-1].push(z);y+=x}}for(r=b=0;r<a.length;r++){z=a[r];for(x=z.length;0<x&&z[x-1].isSpace;)x--;for(C=y=0;C<x;C++)y+=z[C].width;y>b&&(b=y)}if(null==v&&1>=a.length)return{elements:null,totalHeight:0,maxLineWidth:b};z=[];for(r=x=0;r<a.length;r++)if(y=a[r],0!=y.length){C=k;for(t=0;t<y.length;t++)y[t].isSpace||(C=Math.max(C,e(y[t].segIdx)));null!=g&&null!=g[r]&&(x+=g[r].shift); x+=C;var D=this.createElement("text");D.setAttribute("y",this.format(x));if(null!=g&&null!=g[r]){var B=g[r];D.setAttribute("x",this.format(v.align==mxConstants.ALIGN_LEFT?B.x:v.align==mxConstants.ALIGN_RIGHT?B.x+B.width-v.boxWidth:B.x+B.width/2-v.boxWidth/2))}for(var E=t=0;t<y.length;){B=y[t].segIdx;for(var K="";t<y.length&&y[t].segIdx==B;)K+=y[t].text,t++;t==y.length&&(K=K.replace(/\s+$/,""));if(0<K.length){B=n[B];var G=this.createElement("tspan"),L;for(L in B.attrs)B.attrs.hasOwnProperty(L)&&G.setAttribute(L, B.attrs[L]);var Q="";for(L in B.css)B.css.hasOwnProperty(L)&&"color"!=L&&"fill"!=L&&(Q+=L+": "+B.css[L]+"; ");0<Q.length&&(G.style.cssText=Q);B.css.fill&&(G.style.fill=B.css.fill);B=B.absoluteDy;B!=E&&(G.setAttribute("dy",Math.round(100*(B-E))/100),E=B);G.textContent=K;D.appendChild(G)}}z.push(D);D=C*(mxConstants.LINE_HEIGHT-1);K=E=0;Q=G=null;for(t=0;t<y.length;t++)y[t].isSpace||(B=n[y[t].segIdx],B=B.absoluteDy,B<E&&(E=B,G=e(y[t].segIdx)),B>K&&(K=B,Q=e(y[t].segIdx)));0>E&&(D+=mxUtils.getSupSubLineExpansion(C, E,null,G,null));0<K&&(D+=mxUtils.getSupSubLineExpansion(C,null,K,null,Q));x+=D}return{elements:z,totalHeight:x,maxLineWidth:b}}; mxSvgCanvas2D.prototype.wrapSvgBlockElements=function(a,b,c){for(var d=this.state.fontSize,e=[],f=0;f<a.childNodes.length;f++)"text"==a.childNodes[f].nodeName&&e.push(a.childNodes[f]);var g=0,k=0;for(f=0;f<e.length;f++){var l=e[f],m=parseFloat(l.getAttribute("font-size"))||d,n=this.wrapSvgTextElement(l,b);null!=n&&n.maxLineWidth>k&&(k=n.maxLineWidth);if(null!=n&&null!=n.elements){var p=parseFloat(l.getAttribute("y"))||0;p+=g;var q=parseFloat(n.elements[0].getAttribute("y"))||0;m=parseFloat(l.getAttribute("data-line-font-size"))|| m;p-=m-q;for(var r=0;r<n.elements.length;r++){var t=n.elements[r],u=parseFloat(t.getAttribute("y"))||0;t.setAttribute("y",this.format(p+(u-q)));l.getAttribute("font-size")&&t.setAttribute("font-size",l.getAttribute("font-size"));l.getAttribute("font-weight")&&t.setAttribute("font-weight",l.getAttribute("font-weight"));l.getAttribute("font-family")&&t.setAttribute("font-family",l.getAttribute("font-family"));l.getAttribute("fill")&&(t.setAttribute("fill",l.getAttribute("fill")),t.style.fill=l.style.fill); a.insertBefore(t,l)}a.removeChild(l);g+=n.totalHeight-m*mxConstants.LINE_HEIGHT}else 0!=g&&(p=parseFloat(l.getAttribute("y"))||0,l.setAttribute("y",this.format(p+g)))}0!=g&&(c.textHeight+=g);c.maxLineWidth=k}; mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e)if(p=null!=p?p:0,this.foEnabled&&"html"==l){var r=this.createDiv(e);if(null!=r){var t=this.createElement("text"),u=new mxPoint(0,0);if(this.allowConvertHtmlToSvg&&this.convertHtmlToSvg(r.firstChild.firstChild,t,u,null,q))if(null!=u.textHeight){for(e=this.createElement("g");t.firstChild;)e.appendChild(t.firstChild);k&&0<c&&this.wrapSvgBlockElements(e,c+this.foreignObjectPadding,u);t=null;k?t=null!=u.maxLineWidth? u.maxLineWidth:null:!n||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(t=this.measureHtmlContentWidth(r.firstChild.firstChild));this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,e,null,u.textHeight,t)}else if(k&&0<c&&(r=this.wrapSvgTextElement(t,c+this.foreignObjectPadding),null!=r&&null!=r.elements)){e=this.createElement("g");for(u=0;u<r.elements.length;u++)e.appendChild(r.elements[u]);this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,e,null,r.totalHeight, r.maxLineWidth)}else 0>u.y&&g==mxConstants.ALIGN_TOP?t.style.transform="translateY("+-u.y+"em)":0<u.y&&g==mxConstants.ALIGN_BOTTOM?t.style.transform="translateY("+-u.y+"em)":0<u.y&&g==mxConstants.ALIGN_TOP&&(t.style.transform="translateY("+u.y+"em)"),this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,t);else null!=q&&"vertical-"!=q.substring(0,9)&&r.setAttribute("dir",q),this.addForeignObject(a,b,c,d,e,f,g,k,l,m,n,p,q,r,this.root)}}else this.plainText(a+this.state.dx,b+this.state.dy, c,d,e,f,g,k,m,n,p,q)};mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;e=this.createElement("clipPath");e.setAttribute("id",g);g=this.createElement("rect");g.setAttribute("x",a);g.setAttribute("y",b);g.setAttribute("width",c);g.setAttribute("height",d);e.appendChild(g);return e}; mxSvgCanvas2D.prototype.createClipPathId=function(a){a="mx-clippath-"+a.replace(/[^a-zA-Z0-9]+/g,"-");for(var b="-"==a.charAt(a.length-1)?"":"-",c=0,d=a+b+c;null!=document.getElementById(d);)d=a+b+ ++c;return d}; mxSvgCanvas2D.prototype.appendClipPath=function(a,b,c){var d=b.match(/\(([^)]+)\)/),e=null;"polygon"==b.substring(0,7)?e=this.appendPolygonClip(d[1],a,c):"circle"==b.substring(0,6)?e=this.appendCircleClip(d[1],a,c):"ellipse"==b.substring(0,7)?e=this.appendEllipseClip(d[1],a,c):"inset"==b.substring(0,5)&&(e=this.appendInsetClip(d[1],a,c));return e}; mxSvgCanvas2D.prototype.appendPolygonClip=function(a,b,c){c=this.createElement("polygon");a=a.split(/[ ,]+/);for(var d=null,e=null,f=null,g=null,k=[],l=0;l<a.length;l++){var m=this.parseClipValue(a,l);if(0==l%2){if(null==d||d>m)d=m;if(null==f||f<m)f=m}else{if(null==e||e>m)e=m;if(null==g||g<m)g=m}k.push(m)}c.setAttribute("points",k.join(","));b.appendChild(c);return new mxRectangle(d,e,f-d,g-e)}; mxSvgCanvas2D.prototype.appendCircleClip=function(a,b,c){c=this.createElement("circle");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,2);d=this.parseClipValue(d,3);c.setAttribute("r",a);c.setAttribute("cx",e);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(e-a,d-a,2*a,2*a)}; mxSvgCanvas2D.prototype.appendEllipseClip=function(a,b,c){c=this.createElement("ellipse");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,3);d=this.parseClipValue(d,4);c.setAttribute("rx",a);c.setAttribute("ry",e);c.setAttribute("cx",f);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(f-a,d-e,2*a,2*e)}; mxSvgCanvas2D.prototype.appendInsetClip=function(a,b,c){c=this.createElement("rect");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,2),g=this.parseClipValue(d,3);e=1-e-g;f=1-a-f;c.setAttribute("x",g);c.setAttribute("y",a);c.setAttribute("width",e);c.setAttribute("height",f);4<d.length&&"round"==d[4]&&(d=this.parseClipValue(d,5),c.setAttribute("rx",d),c.setAttribute("ry",d));b.appendChild(c);return new mxRectangle(g,a,e,f)}; mxSvgCanvas2D.prototype.parseClipValue=function(a,b){b=a[Math.min(b,a.length-1)];a=1;"center"==b?a=.5:"top"==b||"left"==b?a=0:(b=parseFloat(b),isNaN(b)||(a=Math.max(0,Math.min(1,b/100))));return a}; mxSvgCanvas2D.prototype.setClip=function(a,b){if(null!=a.getAttribute("clip-path")){var c=a.getAttribute("clip-path").replace(/url\(.*#/,"").replace(/\)$/,"");c=document.getElementById(c);null!=c&&null!=c.parentNode&&c.parentNode.removeChild(c)}null!=this.defs?this.defs.appendChild(b):this.root.appendChild(b);mxClient.IS_CHROMEAPP||this.root.ownerDocument!=document?a.setAttribute("clip-path","url(#"+b.getAttribute("id")+")"):(c=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),a.setAttribute("clip-path", "url("+c+"#"+b.getAttribute("id")+")"))}; mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t,u){n=null!=n?n:0;k=this.state;var v=k.fontSize,y=k.transform||"";r=null!=r?r:this.addTitle(this.createElement("g"));this.updateFont(r);this.pointerEvents||null!=this.originalRoot?r.removeAttribute("pointer-events"):r.setAttribute("pointer-events","none");0!=n&&(y+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=p&&"vertical-"!=p.substring(0,9)&&r.setAttribute("direction",p);p=f==mxConstants.ALIGN_RIGHT? "end":f==mxConstants.ALIGN_CENTER?"middle":"start";r.setAttribute("text-anchor",p);0<y.length&&r.setAttribute("transform",y);1>k.alpha&&r.setAttribute("opacity",k.alpha);y=e.split("\n");var A=Math.round(v*mxConstants.LINE_HEIGHT),z=null!=t?t:v+(y.length-1)*A;n=null!=t?b:b+v-1;if(g==mxConstants.ALIGN_MIDDLE)if("fill"==l)n-=d/2;else{var x=(this.matchHtmlAlignment&&m&&0<d?Math.min(z,d):z)/2;n-=x}else g==mxConstants.ALIGN_BOTTOM&&("fill"==l?n-=d:(x=this.matchHtmlAlignment&&m&&0<d?Math.min(z,d):z,n-=x+ 1));if(null!=q)if(null!=t){e=this.format(a*k.scale)+this.textOffset;y=this.format(n*k.scale)+this.textOffset;q.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")");r.setAttribute("data-blockTextHeight",t);null!=u&&r.setAttribute("data-htmlContentWidth",u);e=q.childNodes;for(t=0;t<e.length;t++)"text"==e[t].nodeName&&(y=parseFloat(e[t].getAttribute("dx"))||0,e[t].setAttribute("x","start"==p?y:"end"==p?-y:0),e[t].removeAttribute("dx"));r.appendChild(q);this.root.appendChild(r);r.setAttribute("font-size", v+"px");!m||"middle"!=p&&"end"!=p||this.adjustBlockTextOverflow(q,a,n,c,k.scale,u,f)}else u=this.createElement("g"),e=this.format(a*k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,u.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")"),u.appendChild(q),r.appendChild(u),this.root.appendChild(r),r.setAttribute("font-size",v+"px");else if(null!=r.parentNode)null!=t?(q=r.firstChild,null!=q&&"title"==q.nodeName&&(q=q.nextSibling),null!=q&&"g"==q.nodeName&&(e=this.format(a* k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,q.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")"),!m||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(u=parseFloat(r.getAttribute("data-htmlContentWidth")),this.adjustBlockTextOverflow(q,a,n,c,k.scale,isNaN(u)?null:u,f)))):(q=r.firstChild,null!=q&&"title"==q.nodeName&&(q=q.nextSibling),e=this.format(a*k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,q.setAttribute("transform","translate("+ e+","+y+") scale("+k.scale+")")),r.setAttribute("font-size",v+"px");else{this.styleEnabled&&v==mxConstants.DEFAULT_FONTSIZE||r.setAttribute("font-size",v*k.scale+"px");for(t=0;t<y.length;t++)0<y[t].length&&0<mxUtils.trim(y[t]).length&&(v=this.createElement("text"),v.setAttribute("x",this.format(a*k.scale)+this.textOffset),v.setAttribute("y",this.format(n*k.scale)+this.textOffset),mxUtils.write(v,y[t]),r.appendChild(v)),n+=A;this.root.appendChild(r);this.addTextBackground(r,e,a,b,c,"fill"==l?d:z,f, g,l)}m&&0<c&&0<d&&(n=b,f==mxConstants.ALIGN_CENTER?a-=c/2:f==mxConstants.ALIGN_RIGHT&&(a-=c),"fill"!=l&&(g==mxConstants.ALIGN_MIDDLE?n-=d/2:g==mxConstants.ALIGN_BOTTOM&&(n-=d)),this.setClip(r,this.createClip(a*k.scale-2,n*k.scale-2,c*k.scale+4,d*k.scale+4)))}; mxSvgCanvas2D.prototype.measureHtmlContentWidth=function(a){try{var b=this.state,c=document.createElement("div");c.style.cssText="position:absolute;visibility:hidden;display:inline-block;white-space:nowrap;font-size:"+b.fontSize+"px;font-family:"+mxUtils.parseCssFontFamily(b.fontFamily,!0)+";line-height:"+b.fontSize*mxConstants.LINE_HEIGHT+"px;";(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle= "italic");for(b=0;b<a.childNodes.length;b++)c.appendChild(a.childNodes[b].cloneNode(!0));document.body.appendChild(c);var d=c.offsetWidth;document.body.removeChild(c);return d}catch(e){return null}};mxSvgCanvas2D.prototype.adjustBlockTextOverflow=function(a,b,c,d,e,f,g){try{if(null==f&&(f=a.getBBox().width),f>d){var k=this.format((b+(g==mxConstants.ALIGN_CENTER?(f-d)/2:f-d))*e)+this.textOffset,l=this.format(c*e)+this.textOffset;a.setAttribute("transform","translate("+k+","+l+") scale("+e+")")}}catch(m){}}; mxSvgCanvas2D.prototype.updateFont=function(a){var b=this.state,c=this.getLightDarkColor(b.fontColor);a.setAttribute("fill",c.light);a.style.fill=c.cssText;this.styleEnabled&&b.fontFamily==mxConstants.DEFAULT_FONTFAMILY||a.setAttribute("font-family",mxUtils.parseCssFontFamily(b.fontFamily));(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&a.setAttribute("font-weight","bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&a.setAttribute("font-style","italic");c=[];(b.fontStyle& mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(b.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&(a.setAttribute("text-decoration",c.join(" ")),(b.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(a.style.textDecorationStyle="dotted"))}; mxSvgCanvas2D.prototype.addTextBackground=function(a,b,c,d,e,f,g,k,l){var m=this.state;if(null!=document.body&&(null!=m.fontBackgroundColor||null!=m.fontBorderColor)){var n=null;if("fill"==l||"width"==l)g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,d*m.scale,(e-2)*m.scale,(f+2)*m.scale);else if(null!=a.getBBox&&this.root.ownerDocument==document)try{n=a.getBBox(),n=new mxRectangle(n.x, n.y+1,n.width,n.height)}catch(p){}if(null==n||0==n.width||0==n.height)n=mxUtils.getSizeForString(mxUtils.htmlEntities(b,!1).replace(/\n/g,"<br/>"),m.fontSize,m.fontFamily,null,m.fontStyle),e=n.width,f=n.height,g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,(d+2)*m.scale,e*m.scale,(f+1)*m.scale);null!=n&&null!=m.labelPadding&&"fill"!=l&&"width"!=l&&(n.x-=m.labelPadding.left* m.scale,n.y-=m.labelPadding.top*m.scale,n.width+=(m.labelPadding.left+m.labelPadding.right)*m.scale,n.height+=(m.labelPadding.top+m.labelPadding.bottom)*m.scale);null!=n&&(c=this.createElement("rect"),d=null!=m.fontBackgroundColor&&m.fontBackgroundColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBackgroundColor):null,e=null!=m.fontBorderColor&&m.fontBorderColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBorderColor):null,c.setAttribute("fill",null!=d?d.light:"none"),c.setAttribute("stroke", null!=e?e.light:"none"),c.setAttribute("x",Math.floor(n.x-1)),c.setAttribute("y",Math.floor(n.y-1)),c.setAttribute("width",Math.ceil(n.width+2)),c.setAttribute("height",Math.ceil(n.height)),null!=d&&(c.style.fill=d.cssText),e&&(c.style.stroke=e.cssText),m=null!=m.fontBorderColor?Math.max(1,this.format(m.scale)):0,c.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&c.setAttribute("transform","translate(0.5, 0.5)"),a.insertBefore(c,a.firstChild))}}; mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.positionEnabled=!0;mxGuide.prototype.distanceEnabled=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null; mxGuide.prototype.distanceGuidesX=null;mxGuide.prototype.distanceGuidesY=null;mxGuide.prototype.rounded=!1;mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(a){return a&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance}; mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a};mxGuide.prototype.createDistanceGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxGuide.prototype.isStateIgnored=function(a){return!1}; mxGuide.prototype.move=function(a,b,c,d){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){d=function(B,E,K){var G=!1;K&&Math.abs(B-D)<v?(b.y=B-a.getCenterY(),v=Math.abs(B-D),G=!0):K||(Math.abs(B-x)<v?(b.y=B-a.y,v=Math.abs(B-x),G=!0):Math.abs(B-C)<v&&(b.y=B-a.y-a.height,v=Math.abs(B-C),G=!0));G&&(r=E,t=B,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))); q=q||G};var e=function(B,E,K){var G=!1;K&&Math.abs(B-z)<u?(b.x=B-a.getCenterX(),u=Math.abs(B-z),G=!0):K||(Math.abs(B-y)<u?(b.x=B-a.x,u=Math.abs(B-y),G=!0):Math.abs(B-A)<u&&(b.x=B-a.x-a.width,u=Math.abs(B-A),G=!0));G&&(n=E,p=B,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));m=m||G},f=this.graph.getView().scale,g=Math.max(2,this.getGuideTolerance(c)*f),k=this.distanceEnabled? this.moveDistance(a,b,Math.max(2,g/2)):null;f=null!=k?k.x:null;k=null!=k?k.y:null;null!=f&&(b.x=f);null!=k&&(b.y=k);var l=a.clone();l.x+=b.x;l.y+=b.y;var m=!1,n=null,p=null,q=!1,r=null,t=null,u=g,v=g,y=l.x,A=l.x+l.width,z=l.getCenterX(),x=l.y,C=l.y+l.height,D=l.getCenterY();if(this.positionEnabled)for(g=0;g<this.states.length;g++)l=this.states[g],null==l||this.isStateIgnored(l)||(this.horizontal&&(e.call(this,l.getCenterX(),l,!0),e.call(this,l.x,l,!1),e.call(this,l.x+l.width,l,!1),null==l.cell&&e.call(this, l.getCenterX(),l,!1)),this.vertical&&(d.call(this,l.getCenterY(),l,!0),d.call(this,l.y,l,!1),d.call(this,l.y+l.height,l,!1),null==l.cell&&d.call(this,l.getCenterY(),l,!1)));null!=f&&b.x!=f&&(b.x=f,m=!1);null!=k&&b.y!=k&&(b.y=k,q=!1);this.graph.snapDelta(b,a,!c,m||null!=f,q||null!=k);b=this.getDelta(a,n,b.x,r,b.y);m||null==this.guideX?null!=this.guideX&&(c=Math.max(a.y+a.height+b.y-this.graph.panDy,n.y+n.height),this.guideX.points=[new mxPoint(p,Math.min(a.y+b.y-this.graph.panDy,n.y)),new mxPoint(p, c)],this.guideX.stroke=this.getGuideColor(n,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden";q||null==this.guideY?null!=this.guideY&&(c=Math.max(a.x+a.width+b.x-this.graph.panDx,r.x+r.width),this.guideY.points=[new mxPoint(Math.min(a.x+b.x-this.graph.panDx,r.x),t),new mxPoint(c,t)],this.guideY.stroke=this.getGuideColor(r,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden"}return b}; mxGuide.prototype.moveDistance=function(a,b,c){b=new mxRectangle(a.x+b.x,a.y+b.y,a.width,a.height);for(var d=[],e=[],f=0;f<this.states.length;f++){var g=this.states[f];null==g||null==g.cell||this.isStateIgnored(g)||((b.x>=g.x&&b.x<=g.x+g.width||g.x>=b.x&&g.x<=b.x+b.width)&&(b.y>g.y+g.height+4||b.y+b.height+4<g.y)?e.push(g):(b.y>=g.y&&b.y<=g.y+g.height||g.y>=b.y&&g.y<=b.y+b.height)&&(b.x>g.x+g.width+4||b.x+b.width+4<g.x)&&d.push(g))}d=this.horizontal&&1<d.length?this.snapDistance(d,b,!0,c):null;c= this.vertical&&1<e.length?this.snapDistance(e,b,!1,c):null;null==d&&this.hideDistanceGuides(!0,!1);null==c&&this.hideDistanceGuides(!1,!0);return null!=d||null!=c?{x:null!=d?d-a.x:null,y:null!=c?c-a.y:null}:null}; mxGuide.prototype.snapDistance=function(a,b,c,d){function e(u){return c?u.x:u.y}function f(u){return c?u.width:u.height}a.push(b);a.sort(function(u,v){return e(u)-e(v)});var g=a[a.length-1]==b,k=!1,l=0,m=0,n=0,p=0;if(a[0]!=b&&!g)for(var q=1;q<a.length-1;q++)if(a[q]==b){n=m=p=(e(a[q+1])-e(a[q-1])-f(a[q-1])-f(b))/2;break}for(q=0;q<a.length-1;q++){g=a[q];var r=a[q+1],t=g==b||r==b;r=e(r)-e(g)-f(g);k=k||g==b;if(0==m&&0==l)m=r,l=1;else if(Math.abs(m-r)<=(t||1==q&&k?d:0))l+=1;else if(1<l&&k){a=a.slice(0, q+1);break}else if(3<=a.length-q&&!k)l=0,n=m=0!=p?p:0,a.splice(0,0==q?1:q),q=-1;else break;0!=n||t||(m=n=r)}(g=3==a.length&&a[1]==b)&&(n=0);if(1<l&&l==a.length-1&&(0<n||g)){g=a[a[0]==b?1:0];l=c?g.y+g.height:g.x+g.width;d=5*this.graph.getView().scale;k=[];m=0;if(0<n)for(q=0;q<a.length-1;q++)g=a[q],r=a[q+1],g==b?(m=this.roundToPixel(e(r)-f(b)-n),k.push(m+f(b)+d),k.push(e(r)-d)):r==b?(k.push(e(g)+f(g)+d),m=this.roundToPixel(e(g)+f(g)+n),k.push(m-d)):(k.push(e(g)+f(g)+d),k.push(e(r)-d));else g=a[0],a= a[2],m=this.roundToPixel(e(g)+f(g)+(e(a)-e(g)-f(g)-f(b))/2),k.push(e(g)+f(g)+d),k.push(m-d),k.push(m+f(b)+d),k.push(e(a)-d);this.redrawDistanceGuides(c,l,k,d);return m}return null}; mxGuide.prototype.redrawDistanceGuides=function(a,b,c,d){var e=a?this.distanceGuidesX:this.distanceGuidesY;e=null!=e?e:[];for(var f=0;f<c.length;f+=2){var g=e[f/2],k=a?new mxPoint(c[f],b):new mxPoint(b,c[f]),l=a?new mxPoint(c[f+1],b):new mxPoint(b,c[f+1]),m=a?0:d,n=a?d:0;null==g&&(g=this.createDistanceGuideShape(a),g.dialect=mxConstants.DIALECT_SVG,g.pointerEvents=!1,g.init(this.graph.getView().getOverlayPane()),e[f/2]=g);g.points=[new mxPoint(k.x-m,k.y-n),new mxPoint(k.x+m,k.y+n),k,l,new mxPoint(l.x- m,l.y-n),new mxPoint(l.x+m,l.y+n)];g.node.style.visibility="visible";g.redraw()}for(f=c.length/2;f<e.length;f++)e[f].destroy();e.splice(c.length/2,e.length-c.length/2);a?this.distanceGuidesX=e:this.distanceGuidesY=e}; mxGuide.prototype.hideDistanceGuides=function(a,b){if(a&&null!=this.distanceGuidesX)for(a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].node.style.visibility="hidden";if(b&&null!=this.distanceGuidesY)for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].node.style.visibility="hidden"};mxGuide.prototype.roundToPixel=function(a){var b=this.graph.getView().scale;return Math.round(a/b)*b}; mxGuide.prototype.getDelta=function(a,b,c,d,e){var f=this.graph.view.scale;if(this.rounded||null!=b&&null==b.cell)c=Math.round((a.x+c)/f)*f-a.x;if(this.rounded||null!=d&&null==d.cell)e=Math.round((a.y+e)/f)*f-a.y;return new mxPoint(c,e)};mxGuide.prototype.getGuideColor=function(a,b){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(!1)}; mxGuide.prototype.setVisible=function(a){a=a?"visible":"hidden";null!=this.guideX&&(this.guideX.node.style.visibility=a);null!=this.guideY&&(this.guideY.node.style.visibility=a);if(null!=this.distanceGuidesX)for(var b=0;b<this.distanceGuidesX.length;b++)this.distanceGuidesX[b].node.style.visibility=a;if(null!=this.distanceGuidesY)for(b=0;b<this.distanceGuidesY.length;b++)this.distanceGuidesY[b].node.style.visibility=a}; mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null);null!=this.guideY&&(this.guideY.destroy(),this.guideY=null);if(null!=this.distanceGuidesX){for(var a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].destroy();this.distanceGuidesX=null}if(null!=this.distanceGuidesY){for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].destroy();this.distanceGuidesY=null}};function mxShape(a){this.stencil=a;this.initStyles()} mxShape.forceFilledPointerEvents=!0;mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=!0;mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=!0;mxShape.prototype.svgPointerEvents="all"; mxShape.prototype.shapePointerEvents=!1;mxShape.prototype.stencilPointerEvents=!1;mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSvgBoundingBox=!1;mxShape.prototype.init=function(a){null==this.node&&(this.node=this.create(a),null!=a&&a.appendChild(this.node))};mxShape.prototype.initStyles=function(a){this.strokewidth=1;this.rotation=0;this.strokeOpacity=this.fillOpacity=this.opacity=100;this.flipV=this.flipH=!1};mxShape.prototype.isHtmlAllowed=function(){return!1}; mxShape.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.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}; mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_X,dy:mxConstants.SHADOW_OFFSET_Y,blur:mxConstants.SHADOW_BLUR,color:mxConstants.SHADOWCOLOR,opacity:100*mxConstants.SHADOW_OPACITY};null!=this.style&&(a.dx=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_X,a.dx),a.dy=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_Y,a.dy),a.blur=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_BLUR,a.blur),a.color=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOWCOLOR, a.color),a.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OPACITY,a.opacity));return a};mxShape.prototype.createDropShadow=function(a,b){var c=mxUtils.getLightDarkColor(a.color,a.opacity/100);return"drop-shadow("+Math.round(a.dx*b*100)/100+"px "+Math.round(a.dy*b*100)/100+"px "+Math.round(a.blur*b*100)/100+"px "+c.cssText+")"};mxShape.prototype.updateSvgFilters=function(a){this.node.style.filter=this.isShadowEnabled()?this.createDropShadow(this.getShadowStyle(),a):""}; mxShape.prototype.isShadowEnabled=function(){return this.isShadow};mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.beforePaint(a),this.paint(a),this.afterPaint(a),this.destroyCanvas(a))}; mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement&&(a=this.createSvgCanvas());null!=a&&this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){},a.image=function(){},a.text=function(){});return a}; mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.svgStrokeTolerance;a.pointerEventsValue=this.svgPointerEvents;a.viewTranslate=this.viewTranslate;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");a.minStrokeWidth=this.minSvgStrokeWidth;this.antiAlias||(a.format=function(c){return Math.round(parseFloat(c))});return a}; mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)}; mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity="+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')");if(null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var c=this.fill,d=this.gradient,e="0",f={east:0,south:1, west:2,north:3},g=null!=this.direction?f[this.direction]:0;null!=this.gradientDirection&&(g=mxUtils.mod(g+f[this.gradientDirection]-1,4));1==g?(e="1",f=c,c=d,d=f):2==g?(f=c,c=d,d=f):3==g&&(e="1");b+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+c+"', endColorStr='"+d+"', gradientType='"+e+"')"}a.style.filter=b}; mxShape.prototype.updateHtmlColors=function(a){var b=this.stroke;null!=b&&b!=mxConstants.NONE?(a.style.borderColor=mxUtils.getLightDarkColor(b).cssText,this.isDashed?a.style.borderStyle="dashed":0<this.strokewidth&&(a.style.borderStyle="solid"),a.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):a.style.borderWidth="0px";b=this.outline?null:this.fill;null!=b&&b!=mxConstants.NONE?(a.style.backgroundColor=mxUtils.getLightDarkColor(b).cssText,a.style.backgroundImage="none"): this.pointerEvents?a.style.backgroundColor="transparent":this.setTransparentBackgroundImage(a)}; mxShape.prototype.updateHtmlBounds=function(a){var b=Math.ceil(this.strokewidth*this.scale);a.style.borderWidth=Math.max(1,b)+"px";a.style.overflow="hidden";a.style.left=Math.round(this.bounds.x-b/2)+"px";a.style.top=Math.round(this.bounds.y-b/2)+"px";"CSS1Compat"==document.compatMode&&(b=-b);a.style.width=Math.round(Math.max(0,this.bounds.width+b))+"px";a.style.height=Math.round(Math.max(0,this.bounds.height+b))+"px"}; mxShape.prototype.destroyCanvas=function(a){if(a instanceof mxSvgCanvas2D){for(var b in a.gradients){var c=a.gradients[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1)}for(b in a.fillPatterns)c=a.fillPatterns[b],null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldGradients=a.gradients;this.oldFillPatterns=a.fillPatterns}};mxShape.prototype.beforePaint=function(a){};mxShape.prototype.afterPaint=function(a){}; mxShape.prototype.paint=function(a){var b=a.pointerEvents,c=!1;if(null!=a&&this.outline){var d=a.stroke;a.stroke=function(){c=!0;d.apply(this,arguments)};a.fillAndStroke=a.stroke}var e=this.scale,f=this.bounds.x/e,g=this.bounds.y/e,k=this.bounds.width/e,l=this.bounds.height/e;if(this.isPaintBoundsInverted()){var m=(k-l)/2;f+=m;g-=m;m=k;k=l;l=m}this.updateTransform(a,f,g,k,l);this.configureCanvas(a,f,g,k,l);this.updateSvgFilters(null!=a?a.state.scale:e);m=null;if(null==this.stencil&&null==this.points&& this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var n=this.createBoundingBox();this.dialect==mxConstants.DIALECT_SVG?(m=this.createTransparentSvgRectangle(n.x,n.y,n.width,n.height),this.node.appendChild(m)):(e=a.createRect("rect",n.x/e,n.y/e,n.width/e,n.height/e),e.appendChild(a.createTransparentFill()),e.stroked="false",a.root.appendChild(e))}null!=this.stencil?this.stencil.drawShape(a,this,f,g,k,l,null!=this.state?this.state.view.graph:null):(a.setStrokeWidth(this.strokewidth), e=this.getWaypoints(),null!=e?1<e.length&&this.paintEdgeShape(a,e):(e=a.state.dx,n=a.state.dy,this.paintVertexShape(a,f,g,k,l),a.state.dx=e,a.state.dy=n));null!=m&&null!=a.state&&null!=a.state.transform&&m.setAttribute("transform",a.state.transform);null!=a&&this.outline&&!c&&(a.rect(f,g,k,l),a.stroke());a.pointerEvents=b}; mxShape.prototype.getWaypoints=function(){var a=this.points,b=null;if(null!=a&&(b=[],0<a.length)){var c=this.scale,d=Math.max(c,1),e=a[0];b.push(new mxPoint(e.x/c,e.y/c));for(var f=1;f<a.length;f++){var g=a[f];(Math.abs(e.x-g.x)>=d||Math.abs(e.y-g.y)>=d)&&b.push(new mxPoint(g.x/c,g.y/c));e=g}}return b}; mxShape.prototype.configureCanvas=function(a,b,c,d,e){var f=null;null!=this.style&&(f=this.style.dashPattern);a.setAlpha(this.opacity/100);a.setFillAlpha(this.fillOpacity/100);a.setStrokeAlpha(this.strokeOpacity/100);null!=this.isShadow&&a.setShadow(this.isShadow,this.shadowStyle);null!=this.isDashed&&a.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);null!=f&&a.setDashPattern(f);null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&& this.gradient!=mxConstants.NONE?(b=this.getGradientBounds(a,b,c,d,e),a.setGradient(this.fill,this.gradient,b.x,b.y,b.width,b.height,this.gradientDirection)):(a.setFillColor(this.fill),a.setFillStyle(this.fillStyle,this.hachureGap,this.fillWeight,this.hachureAngle));null!=this.style&&(null!=this.style.linecap&&a.setLineCap(this.style.linecap),null!=this.style.linejoin&&a.setLineJoin(this.style.linejoin),null!=this.style.miterlimit&&a.setMiterLimit(this.style.miterlimit));a.setStrokeColor(this.stroke); this.configurePointerEvents(a)};mxShape.prototype.configurePointerEvents=function(a){null==this.style||mxShape.forceFilledPointerEvents&&null!=this.fill&&this.fill!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(a.pointerEvents=!1)};mxShape.prototype.getGradientBounds=function(a,b,c,d,e){return new mxRectangle(b,c,d,e)}; mxShape.prototype.updateTransform=function(a,b,c,d,e){a.scale(this.scale);a.rotate(this.getShapeRotation(),this.flipH,this.flipV,b+d/2,c+e/2)};mxShape.prototype.paintVertexShape=function(a,b,c,d,e){this.paintBackground(a,b,c,d,e);this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),this.paintForeground(a,b,c,d,e))};mxShape.prototype.paintBackground=function(a,b,c,d,e){};mxShape.prototype.paintForeground=function(a,b,c,d,e){}; mxShape.prototype.paintEdgeShape=function(a,b){};mxShape.prototype.getArcSize=function(a,b){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))a=Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;a=Math.min(a*c,b*c)}return a}; mxShape.prototype.paintGlassEffect=function(a,b,c,d,e,f){var g=Math.ceil(this.strokewidth/2);a.setGradient("#ffffff","#ffffff",b,c,d,.6*e,"south",.9,.1);a.begin();f+=2*g;this.isRounded?(a.moveTo(b-g+f,c-g),a.quadTo(b-g,c-g,b-g,c-g+f),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g+f),a.quadTo(b+d+g,c-g,b+d+g-f,c-g)):(a.moveTo(b-g,c-g),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g));a.close();a.fill()}; mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=null!=g?g:!0;var k=b[b.length-1];if(e&&c){b=b.slice();var l=b[0];l=new mxPoint(k.x+(l.x-k.x)/2,k.y+(l.y-k.y)/2);b.splice(0,0,l)}var m=b[0];l=1;for(g?a.moveTo(m.x,m.y):a.lineTo(m.x,m.y);l<(e?b.length:b.length-1);){g=b[mxUtils.mod(l,b.length)];var n=m.x-g.x;m=m.y-g.y;if(c&&(0!=n||0!=m)&&(null==f||0>mxUtils.indexOf(f,l-1))){var p=Math.sqrt(n*n+m*m);a.lineTo(g.x+n*Math.min(d,p/2)/p,g.y+m*Math.min(d,p/2)/p);for(m=b[mxUtils.mod(l+ 1,b.length)];l<b.length-2&&0==Math.round(m.x-g.x)&&0==Math.round(m.y-g.y);)m=b[mxUtils.mod(l+2,b.length)],l++;n=m.x-g.x;m=m.y-g.y;p=Math.max(1,Math.sqrt(n*n+m*m));n=g.x+n*Math.min(d,p/2)/p;m=g.y+m*Math.min(d,p/2)/p;a.quadTo(g.x,g.y,n,m);g=new mxPoint(n,m)}else a.lineTo(g.x,g.y);m=g;l++}e?a.close():a.lineTo(k.x,k.y)}}; mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass}; mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY, this.fillOpacity);this.fillStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_STYLE,null);this.hachureGap=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_GAP,null);this.hachureAngle=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_ANGLE,null);this.fillWeight=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_WEIGHT,null);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR, this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW, this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction== mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null); this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return!1}; mxShape.prototype.getSvgBoundingBox=function(){var a=null;if(null!=this.node&&null!=this.node.ownerSVGElement)try{var b=this.node.getBBox();0<b.width&&0<b.height&&(a=new mxRectangle(b.x,b.y,b.width,b.height),null!=this.stroke&&a.grow(this.strokewidth*this.scale/2))}catch(c){}return a};mxShape.prototype.getShapeBoundingBox=function(){var a=null;if(null!=this.bounds&&(a=this.createBoundingBox(),null!=a)){this.augmentBoundingBox(a);var b=this.getShapeRotation();0!=b&&(a=mxUtils.getBoundingBox(a,b))}return a}; mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a}; mxShape.prototype.augmentBoundingBox=function(a){if(this.isShadow){var b=this.getShadowStyle();0>b.dx&&(a.x+=b.dx,a.width-=b.dx);0>b.dy&&(a.y+=b.dy,a.height-=b.dy);a.grow(Math.max(b.blur,0)*this.scale*2);a.width+=Math.ceil(Math.max(b.dx,0)*this.scale);a.height+=Math.ceil(Math.max(b.dy,0)*this.scale)}null!=this.stroke&&a.grow(this.strokewidth*this.scale/2)}; mxShape.prototype.updateBoundingBox=function(){var a=this.useSvgBoundingBox?this.getSvgBoundingBox():null;null==a&&(a=this.getShapeBoundingBox());this.boundingBox=a};mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0}; mxShape.prototype.getTextRotation=function(){var a=this.getRotation();1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(a+=mxText.prototype.verticalTextRotation);return a};mxShape.prototype.getShapeRotation=function(){var a=this.getRotation();null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?a+=270:this.direction==mxConstants.DIRECTION_WEST?a+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(a+=90));return a}; mxShape.prototype.createTransparentSvgRectangle=function(a,b,c,d){var e=document.createElementNS(mxConstants.NS_SVG,"rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);e.setAttribute("fill","none");e.setAttribute("stroke","none");e.setAttribute("pointer-events","all");return e};mxShape.prototype.setTransparentBackgroundImage=function(a){a.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"}; mxShape.prototype.intersectsRectangle=function(a,b){return null!=a&&(b||null!=this.node&&"none"!=this.node.style.display&&"hidden"!=this.node.style.visibility)&&mxUtils.intersects(this.bounds,a,!0)};mxShape.prototype.releaseSvgGradients=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}}; mxShape.prototype.releaseSvgFillPatterns=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}}; mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldFillPatterns=this.oldGradients=null};function mxStencil(a){this.desc=a;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=!1;mxStencil.allowEval=!1; mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null; mxStencil.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){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)||(d=this.getColorValue(b,c,d,e),"default"==d&&(d=this.getDefaultColorValue(c,e)));return d}; mxStencil.prototype.getStyleWithNone=function(a,b,c){if(null!=a&&null!=a.state&&this.cachedCellStyle!=a.state.cell.style||null==this.cachedUnresolvedStyle)this.cachedCellStyle=a.state.cell.style,this.cachedUnresolvedStyle=c.getCellStyle(a.state.cell,!1);return null!=this.cachedUnresolvedStyle?this.cachedUnresolvedStyle[b]:null}; mxStencil.prototype.getColorValue=function(a,b,c,d){b=b.getAttribute("default");var e=mxUtils.getValue(a.style,c);null==e&&null!=d?(a=this.getStyleWithNone(a,c,d),e=null==b||null!=a?a:b):"default"==e&&null!=b&&b!=mxConstants.NONE&&(e=b);return e};mxStencil.prototype.getDefaultColorValue=function(a,b){var c="#ffffff";null!=b&&(c="fillcolor"==a.nodeName?b.shapeBackgroundColor:b.shapeForegroundColor);return c}; 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=[],v=c.firstChild;null!=v;){if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var y=v.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(v.getAttribute("x"))* n,m+Number(v.getAttribute("y"))*p)),t++;else{q=!0;break}}v=v.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(v=c.firstChild;null!=v;)v.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,v,d,e,f,g),v=v.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"))* p,Number(c.getAttribute("x-axis-rotation")),Number(c.getAttribute("large-arc-flag")),Number(c.getAttribute("sweep-flag")),l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("rect"==k)a.rect(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p);else if("roundrect"==k)b=Number(c.getAttribute("arcsize")),0==b&&(b=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),d=Number(c.getAttribute("w"))*n,f=Number(c.getAttribute("h"))* p,b=Number(b)/100,b=Math.min(d*b,f*b),a.roundrect(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,d,f,b,b);else if("ellipse"==k)a.ellipse(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p);else if("image"==k)b.outline||(b=this.evaluateAttribute(c,"src",b),a.image(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p,b,!1,"1"==c.getAttribute("flipH"), "1"==c.getAttribute("flipV")));else if("text"==k)b.outline||(g=this.evaluateTextAttribute(c,"str",b),d="1"==c.getAttribute("vertical")?-90:0,"0"==c.getAttribute("align-shape")&&(f=b.rotation,q=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPH,0),b=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPV,0),d=q&&b?d-f:q||b?d+f:d-f),d-=c.getAttribute("rotation"),a.text(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,0,0,g,c.getAttribute("align")||"left",c.getAttribute("valign")||"top", !1,"",null,!1,d));else if("include-shape"==k)q=mxStencilRegistry.getStencil(c.getAttribute("name")),null!=q&&(l+=Number(c.getAttribute("x"))*n,m+=Number(c.getAttribute("y"))*p,d=Number(c.getAttribute("w"))*n,f=Number(c.getAttribute("h"))*p,q.drawShape(a,b,l,m,d,f,g));else if("fillstroke"==k)a.fillAndStroke();else if("fill"==k)a.fill();else if("stroke"==k)a.stroke();else if("strokewidth"==k)n="1"==c.getAttribute("fixed")?1:q,a.setStrokeWidth(Number(c.getAttribute("width"))*n);else if("dashed"==k)a.setDashed("1"== c.getAttribute("dashed"));else if("dashpattern"==k){if(c=c.getAttribute("pattern"),null!=c){c=c.split(" ");p=[];for(n=0;n<c.length;n++)0<c[n].length&&p.push(Number(c[n])*q);c=p.join(" ");a.setDashPattern(c)}}else"strokecolor"==k?a.setStrokeColor(this.parseColor(a,b,c,c.getAttribute("color"),g)):"linecap"==k?a.setLineCap(c.getAttribute("cap")):"linejoin"==k?a.setLineJoin(c.getAttribute("join")):"miterlimit"==k?a.setMiterLimit(Number(c.getAttribute("limit"))):"fillcolor"==k?a.setFillColor(this.parseColor(a, b,c,c.getAttribute("color"),g)):"alpha"==k?a.setAlpha(c.getAttribute("alpha")):"fillalpha"==k?a.setAlpha(c.getAttribute("alpha")):"strokealpha"==k?a.setAlpha(c.getAttribute("alpha")):"fontcolor"==k?a.setFontColor(this.parseColor(a,b,c,c.getAttribute("color"),g)):"fontstyle"==k?a.setFontStyle(c.getAttribute("style")):"fontfamily"==k?a.setFontFamily(c.getAttribute("family")):"fontsize"==k&&a.setFontSize(Number(c.getAttribute("size"))*q);!e||"fillstroke"!=k&&"fill"!=k&&"stroke"!=k||a.setShadow(!1)}}; var mxStencilRegistry={stencils:Object.create(null),addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:Object.create(null),addMarker:function(a,b){mxMarker.markers[a]=b},createMarker:function(a,b,c,d,e,f,g,k,l,m){var n=mxMarker.markers[c];return null!=n?n(a,b,c,d,e,f,g,k,l,m):null}}; (function(){function a(d){d=null!=d?d:2;return function(e,f,g,k,l,m,n,p,q,r){f=l*q*1.118;p=m*q*1.118;l*=n+q;m*=n+q;var t=k.clone();t.x-=f;t.y-=p;n=g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN?1:.75;k.x+=-l*n-f;k.y+=-m*n-p;return function(){e.begin();e.moveTo(t.x,t.y);e.lineTo(t.x-l-m/d,t.y-m+l/d);g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(t.x-3*l/4,t.y-3*m/4);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.close();r?e.fillAndStroke():e.stroke()}}}function b(d){d= null!=d?d:2;return function(e,f,g,k,l,m,n,p,q,r){f=l*q*1.118;g=m*q*1.118;l*=n+q;m*=n+q;var t=k.clone();t.x-=f;t.y-=g;k.x+=2*-f;k.y+=2*-g;return function(){e.begin();e.moveTo(t.x-l-m/d,t.y-m+l/d);e.lineTo(t.x,t.y);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.stroke()}}}function c(d,e,f,g,k,l,m,n,p,q){n=f==mxConstants.ARROW_DIAMOND?.7071:.9862;e=k*p*n;n*=l*p;k*=m+p;l*=m+p;var r=g.clone();r.x-=e;r.y-=n;g.x+=-k-e;g.y+=-l-n;var t=f==mxConstants.ARROW_DIAMOND?2:3.4;return function(){d.begin();d.moveTo(r.x,r.y);d.lineTo(r.x- k/2-l/t,r.y+k/t-l/2);d.lineTo(r.x-k,r.y-l);d.lineTo(r.x-k/2+l/t,r.y-l/2-k/t);d.close();q?d.fillAndStroke():d.stroke()}}mxMarker.addMarker("classic",a(2));mxMarker.addMarker("classicThin",a(3));mxMarker.addMarker("block",a(2));mxMarker.addMarker("blockThin",a(3));mxMarker.addMarker("open",b(2));mxMarker.addMarker("openThin",b(3));mxMarker.addMarker("oval",function(d,e,f,g,k,l,m,n,p,q){var r=m/2,t=g.clone();g.x-=k*r;g.y-=l*r;return function(){d.ellipse(t.x-r,t.y-r,m,m);q?d.fillAndStroke():d.stroke()}}); mxMarker.addMarker("baseDash",function(d,e,f,g,k,l,m,n,p,q){var r=k*(m+p+1),t=l*(m+p+1);return function(){d.begin();d.moveTo(g.x-t/2,g.y+r/2);d.lineTo(g.x+t/2,g.y-r/2);d.stroke()}});mxMarker.addMarker("doubleBlock",function(d,e,f,g,k,l,m,n,p,q){e=k*p*1.118;n=l*p*1.118;k*=m+p;l*=m+p;var r=g.clone();r.x-=e;r.y-=n;f=f!=mxConstants.ARROW_CLASSIC&&f!=mxConstants.ARROW_CLASSIC_THIN?1:.75;g.x+=-k*f*2-e;g.y+=-l*f*2-n;return function(){d.begin();d.moveTo(r.x,r.y);d.lineTo(r.x-k-l/2,r.y-l+k/2);d.lineTo(r.x+ l/2-k,r.y-l-k/2);d.close();d.moveTo(r.x-k,r.y-l);d.lineTo(r.x-2*k-.5*l,r.y+.5*k-2*l);d.lineTo(r.x-2*k+.5*l,r.y-.5*k-2*l);d.close();q?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("diamond",c);mxMarker.addMarker("diamondThin",c);mxMarker.addMarker("manyOptional",function(d,e,f,g,k,l,m,n,p,q){var r=k*(m+p+1),t=l*(m+p+1),u=m/2,v=g.x,y=g.y;g.x-=2*r-k*p/2;g.y-=2*t-l*p/2;return function(){d.begin();d.ellipse(v-1.5*r-u,y-1.5*t-u,2*u,2*u);q?d.fillAndStroke():d.stroke();d.begin();d.moveTo(v,y);d.lineTo(v- r,y-t);d.moveTo(v+t/2,y-r/2);d.lineTo(v-r,y-t);d.lineTo(v-t/2,y+r/2);d.stroke()}})})();function mxActor(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e);a.fillAndStroke()}; mxActor.prototype.redrawPath=function(a,b,c,d,e){b=d/3;a.moveTo(0,e);a.curveTo(0,3*e/5,0,2*e/5,d/2,2*e/5);a.curveTo(d/2-b,2*e/5,d/2-b,0,d/2,0);a.curveTo(d/2+b,0,d/2+b,2*e/5,d/2,2*e/5);a.curveTo(d,2*e/5,d,3*e/5,d,e);a.close()};function mxCloud(a,b,c,d){mxActor.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCloud,mxActor); mxCloud.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(.25*d,.25*e);a.curveTo(.05*d,.25*e,0,.5*e,.16*d,.55*e);a.curveTo(0,.66*e,.18*d,.9*e,.31*d,.8*e);a.curveTo(.4*d,e,.7*d,e,.8*d,.8*e);a.curveTo(d,.8*e,d,.6*e,.875*d,.5*e);a.curveTo(d,.3*e,.8*d,.1*e,.625*d,.2*e);a.curveTo(.5*d,.05*e,.3*d,.05*e,.25*d,.25*e);a.close()};function mxRectangleShape(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRectangleShape,mxShape); mxRectangleShape.prototype.isHtmlAllowed=function(){var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));return!this.isRounded&&!this.glass&&0==this.rotation&&(a||null!=this.fill&&this.fill!=mxConstants.NONE)}; mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){if(this.isRounded){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))var f=Math.min(d/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f);a.roundrect(b,c,d,e,f,f)}else a.rect(b,c,d,e);a.fillAndStroke()}; mxRectangleShape.prototype.isRoundable=function(){return!0};mxRectangleShape.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))};mxRectangleShape.prototype.getLabelBounds=function(a){var b=this.getFooterSize()*this.scale;0<b&&(a=new mxRectangle(a.x,a.y,a.width,a.height-Math.min(a.height,b)));return a}; mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){var f=Math.min(e,this.getFooterSize());0<f&&!this.outline&&this.paintFooter(a,b,c,d,e,f);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(a,b,c,d,e,this.getArcSize(d+this.strokewidth,e+this.strokewidth))}; mxRectangleShape.prototype.paintFooter=function(a,b,c,d,e,f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_COLOR,this.stroke),k=this.isRounded?this.getArcSize(d,e):0,l=Math.min(d/2,k);null!=g&&g!=mxConstants.NONE&&(a.setFillColor(g),a.setStrokeColor(g));a.setShadow(!1);a.begin();if(f>=k)a.moveTo(b,c+e-f),a.lineTo(b,c+e-k),a.quadTo(b,c+e,b+l,c+e),a.lineTo(b+d-l,c+e),a.quadTo(b+d,c+e,b+d,c+e-k),a.lineTo(b+d,c+e-f);else{var m=1-Math.sqrt(f/k);k=l*m*m;m*=l;a.moveTo(b+k,c+e-f);a.quadTo(b+ m,c+e,b+l,c+e);a.lineTo(b+d-l,c+e);a.quadTo(b+d-m,c+e,b+d-k,c+e-f)}a.close();null!=g&&g!=mxConstants.NONE?a.fillAndStroke():a.stroke()};function mxEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke();null!=this.paintCenter&&this.paintCenter(a,b,c,d,e)}; mxEllipse.prototype.paintCenter=function(a,b,c,d,e){if(null!=this.style&&!this.outline){var f=Math.min(Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_RADIUS,0)),d/2,e/2);if(0<f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_COLOR,this.stroke);null!=g&&g!=mxConstants.NONE&&(a.setShadow(!1),a.setFillColor(g),a.ellipse(b+d/2-f,c+e/2-f,2*f,2*f),1==mxUtils.getValue(this.style,"centerStroke",0)&&null!=this.stroke&&this.stroke!=mxConstants.NONE?(a.setStrokeColor(this.stroke), a.fillAndStroke()):a.fill())}}};function mxDoubleEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.paintBackground=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()}; mxDoubleEllipse.prototype.paintForeground=function(a,b,c,d,e){if(!this.outline){var f=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(d/5,e/5)));b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&a.ellipse(b,c,d,e);a.stroke()}}; mxDoubleEllipse.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(a.width/5/this.scale,a.height/5/this.scale)))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)};function mxRhombus(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return!0}; mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,[new mxPoint(b+f,c),new mxPoint(b+d,c+g),new mxPoint(b+f,c+e),new mxPoint(b,c+g)],this.isRounded,k,!0);a.fillAndStroke()};function mxPolyline(a,b,c){mxShape.call(this);this.points=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0}; mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){var c=a.pointerEventsValue;a.pointerEventsValue="stroke";null!=this.style&&1==this.style[mxConstants.STYLE_BEZIER]?this.paintBezierLine(a,b):null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]?this.paintCurvedLine(a,b):this.paintLine(a,b,this.isRounded);a.pointerEventsValue=c}; mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()}; mxPolyline.prototype.paintBezierLine=function(a,b){var c=b.length;if(!(2>c)){a.begin();a.moveTo(b[0].x,b[0].y);if(2==c)a.lineTo(b[1].x,b[1].y);else if(0==(c-1)%3)for(var d=1;d+2<c;d+=3)a.curveTo(b[d].x,b[d].y,b[d+1].x,b[d+1].y,b[d+2].x,b[d+2].y);else{for(d=1;d<c-2;d++){var e=b[d],f=b[d+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}a.quadTo(b[c-2].x,b[c-2].y,b[c-1].x,b[c-1].y)}a.stroke()}}; function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);a.grow((Math.max(this.arrowWidth,this.endSize)/2+this.strokewidth)*this.scale)}; mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=b[0];b=b[b.length-1];var f=b.x-e.x,g=b.y-e.y,k=Math.sqrt(f*f+g*g),l=k-2*c-mxConstants.ARROW_SIZE;f/=k;g/=k;k=d*g/3;d=-d*f/3;var m=e.x-k/2+c*f;e=e.y-d/2+c*g;var n=m+k,p=e+d,q=n+l*f;l=p+l*g;var r=q+k,t=l+d,u=r-3*k,v=t-3*d;a.begin();a.moveTo(m,e);a.lineTo(n,p);a.lineTo(q,l);a.lineTo(r,t);a.lineTo(b.x-c*f,b.y-c*g);a.lineTo(u,v);a.lineTo(u+k,v+d);a.close();a.fillAndStroke()}; function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;mxArrowConnector.prototype.isRoundable=function(){return!0}; mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))}; mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)}; mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.isCurved()&&2<b.length;c&&(b=this.getCurvePoints(b));var d=this.strokewidth;this.outline&&(d=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));var e=this.getStartArrowWidth()+d,f=this.getEndArrowWidth()+d,g=this.outline?this.getEdgeWidth()+d:this.getEdgeWidth(),k=this.isOpenEnded(),l=this.isMarkerStart(),m=this.isMarkerEnd(),n=k?0:this.arrowSpacing+d/2,p=this.startSize+d;d=this.endSize+d;var q= !c&&this.isArrowRounded();c&&!k&&(l&&(b=this.trimCurveForMarker(b,n+p,!0)),m&&(b=this.trimCurveForMarker(b,n+d,!1)));c=b[b.length-1];var r=b[1].x-b[0].x,t=b[1].y-b[0].y,u=Math.sqrt(r*r+t*t);if(0!=u){var v=r/u,y=v,A=t/u,z=A;u=g*A;var x=-g*v,C=[];q?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();r=v;t=A;if(l&&!k)this.paintMarker(a,b[0].x,b[0].y,v,A,p,e,g,n,!0);else{var D=b[0].x+u/2+n*v,B=b[0].y+x/2+n*A,E=b[0].x-u/2+n*v,K=b[0].y-x/2+n*A;k?(a.moveTo(D,B),C.push(function(){a.lineTo(E, K)})):(a.moveTo(E,K),a.lineTo(D,B))}var G=B=D=0;for(u=0;u<b.length-2;u++)if(x=mxUtils.relativeCcw(b[u].x,b[u].y,b[u+1].x,b[u+1].y,b[u+2].x,b[u+2].y),D=b[u+2].x-b[u+1].x,B=b[u+2].y-b[u+1].y,G=Math.sqrt(D*D+B*B),0!=G){y=D/G;z=B/G;G=Math.max(Math.sqrt((v*y+A*z+1)/2),.04);D=v+y;B=A+z;var L=Math.sqrt(D*D+B*B);if(0!=L){D/=L;B/=L;L=Math.max(G,Math.min(this.strokewidth/200+.04,.35));G=0!=x&&q?Math.max(.1,L):Math.max(G,.06);var Q=b[u+1].x+B*g/2/G,H=b[u+1].y-D*g/2/G;B=b[u+1].x-B*g/2/G;D=b[u+1].y+D*g/2/G;0!= x&&q?-1==x?(x=B+z*g,G=D-y*g,a.lineTo(B+A*g,D-v*g),a.quadTo(Q,H,x,G),function(I,M){C.push(function(){a.lineTo(I,M)})}(B,D)):(a.lineTo(Q,H),function(I,M){var O=Q-A*g,N=H+v*g,P=Q-z*g,R=H+y*g;C.push(function(){a.quadTo(I,M,O,N)});C.push(function(){a.lineTo(P,R)})}(B,D)):(a.lineTo(Q,H),function(I,M){C.push(function(){a.lineTo(I,M)})}(B,D));v=y;A=z}}u=g*z;x=-g*y;if(m&&!k)this.paintMarker(a,c.x,c.y,-v,-A,d,f,g,n,!1);else{a.lineTo(c.x-n*y+u/2,c.y-n*z+x/2);var F=c.x-n*y-u/2,J=c.y-n*z-x/2;k?(a.moveTo(F,J), C.splice(0,0,function(){a.moveTo(F,J)})):a.lineTo(F,J)}for(u=C.length-1;0<=u;u--)C[u]();k?(a.end(),a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);q&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),l&&!k&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,r,t,p,e,g,n,!0),a.stroke(),a.end()),m&&!k&&(a.begin(),this.paintMarker(a,c.x,c.y,-v,-A,d,f,g,n,!0),a.stroke(),a.end()))}}; mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,k,l,m){g=k/g;var n=k*e/2;k=-k*d/2;var p=(l+f)*d;f=(l+f)*e;m?a.moveTo(b-n+p,c-k+f):a.lineTo(b-n+p,c-k+f);a.lineTo(b-n/g+p,c-k/g+f);a.lineTo(b+l*d,c+l*e);a.lineTo(b+n/g+p,c+k/g+f);a.lineTo(b+n+p,c+k+f)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.isCurved=function(){return null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]}; mxArrowConnector.prototype.getCurvePoints=function(a){for(var b=[a[0]],c=a.length,d=a[0],e=1;e<c-1;e++){var f=a[e],g=e<c-2?new mxPoint((a[e].x+a[e+1].x)/2,(a[e].y+a[e+1].y)/2):a[e+1],k=f.x-d.x,l=f.y-d.y,m=g.x-f.x,n=g.y-f.y;k=Math.max(4,Math.min(Math.ceil((Math.sqrt(k*k+l*l)+Math.sqrt(m*m+n*n))*this.scale/8),64));for(l=1;l<=k;l++)m=l/k,n=1-m,b.push(new mxPoint(n*n*d.x+2*n*m*f.x+m*m*g.x,n*n*d.y+2*n*m*f.y+m*m*g.y));d=g}return b}; mxArrowConnector.prototype.trimCurveForMarker=function(a,b,c){function d(l,m){var n=m.x-l.x;m=m.y-l.y;var p=l.x-f.x,q=l.y-f.y,r=n*n+m*m,t=2*(p*n+q*m);p=t*t-4*r*(p*p+q*q-b*b);if(0==r||0>p)return l;r=Math.max(0,Math.min(1,(-t-Math.sqrt(p))/(2*r)));return new mxPoint(l.x+r*n,l.y+r*m)}var e=a.length,f=c?a[0]:a[e-1];if(c)for(c=1;c<e-1;c++){var g=a[c].x-f.x,k=a[c].y-f.y;if(g*g+k*k>=b*b)return[f,d(a[c],a[c-1])].concat(a.slice(c))}else for(c=e-2;0<c;c--)if(g=a[c].x-f.x,k=a[c].y-f.y,g*g+k*k>=b*b)return e= a.slice(0,c+1),e.push(d(a[c],a[c+1])),e.push(f),e;return a};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1}; mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE}; function mxText(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t,u,v,y,A,z,x){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:mxConstants.ALIGN_CENTER;this.valign=null!=d?d:mxConstants.ALIGN_MIDDLE;this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=k?k:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(l||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(n||0); this.spacingBottom=this.spacing+parseInt(p||0);this.spacingLeft=this.spacing+parseInt(q||0);this.horizontal=null!=r?r:!0;this.background=t;this.border=u;this.wrap=null!=v?v:!1;this.clipped=null!=y?y:!1;this.overflow=null!=A?A:"visible";this.labelPadding=null!=z?z:0;this.textDirection=x;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0; mxText.prototype.replaceLinefeeds=!0;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isHtmlAllowed=function(){return!0};mxText.prototype.getSvgScreenOffset=function(){return 0}; mxText.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)};mxText.prototype.configurePointerEvents=function(a){}; mxText.prototype.getActualTextDirection=function(){var a=this.textDirection;a==mxConstants.TEXT_DIRECTION_AUTO&&(a=this.getAutoDirection());a!=mxConstants.TEXT_DIRECTION_LTR&&a!=mxConstants.TEXT_DIRECTION_RTL&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_LR&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(a=null);return a}; mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c,g=this.bounds.height/c;this.updateTransform(a,d,e,f,g);this.configureCanvas(a,d,e,f,g);this.updateSvgFilters(null!=a?a.state.scale:c);c=this.getActualTextDirection();if(b)a.updateText(d,e,f,g,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),c,this.node);else{var k=(b=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"html":"",l=this.value; b||"html"!=k||(l=mxUtils.htmlEntities(l,!1));"html"!=k||mxUtils.isNode(this.value)||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==k?l.replace(/\n/g,"<br/>"):l;a.text(d,e,f,g,l,this.align,this.valign,this.wrap,k,this.overflow,this.clipped,this.getTextRotation(),c)}}; mxText.prototype.redraw=function(){if(this.wrap&&this.convertToSvg&&null!=this.style&&"wrap"==this.style.svgWhiteSpace&&null!=this.bounds){var a=this.bounds.width;null!=this.lastWrapWidth&&this.lastWrapWidth!=a&&(this.lastValue=null);this.lastWrapWidth=a}this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"DIV"==this.node.nodeName?mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node), this.updateHtmlTransform()):(a=this.createCanvas(),null!=a&&null!=a.updateText?(a.pointerEvents=this.pointerEvents,this.paint(a,!0),this.destroyCanvas(a)):mxShape.prototype.redraw.apply(this,arguments)):(mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null)}; mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=this.spacing=2;this.horizontal=!0;delete this.background;delete this.border;this.labelPadding=0;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION; delete this.margin}; mxText.prototype.apply=function(a){var b=this.spacing;mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN, this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-b))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-b))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM, this.spacingBottom-b))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-b))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.labelPadding=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_PADDING, this.labelPadding),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin());this.flipH=this.flipV=null};mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0<a.length&&"z"<a[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR}; mxText.prototype.getContentNode=function(){var a=this.node;null!=a&&(a=null==a.ownerSVGElement?this.node.firstChild.firstChild:a.firstChild.firstChild.firstChild.firstChild.firstChild);return a}; mxText.prototype.updateBoundingBox=function(){var a=this.node;this.boundingBox=this.bounds.clone();var b=this.getTextRotation(),c=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,d=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==a||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&c==mxConstants.ALIGN_CENTER&&d==mxConstants.ALIGN_MIDDLE)){d= c=null;if(null!=a.ownerSVGElement)if(null!=a.firstChild&&null!=a.firstChild.firstChild&&"foreignObject"==a.firstChild.firstChild.nodeName&&null!=a.firstChild.firstChild.firstChild&&null!=a.firstChild.firstChild.firstChild.firstChild)a=a.firstChild.firstChild.firstChild.firstChild,d=a.offsetHeight*this.scale,c="width"==this.overflow?this.boundingBox.width:a.offsetWidth*this.scale;else try{var e=a.getBBox();"string"==typeof this.value&&0==mxUtils.trim(this.value)?this.boundingBox=null:this.boundingBox= 0==e.width&&0==e.height?null:new mxRectangle(e.x,e.y,e.width,e.height);return}catch(f){}else{if(null==this.offsetWidth||null==this.offsetHeight)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild),this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight;c=this.offsetWidth*this.scale;d=this.offsetHeight*this.scale}null!=c&&null!=d&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,c,d))}null!=this.boundingBox&&(0!=b?(b=mxUtils.getBoundingBox(new mxRectangle(this.margin.x* this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),b,new mxPoint(0,0)),this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=b.x,this.boundingBox.y+=b.y,this.boundingBox.width=b.width,this.boundingBox.height=b.height):(this.boundingBox.x+=this.margin.x*this.boundingBox.width, this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null))};mxText.prototype.getShapeRotation=function(){return 0};mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)}; mxText.prototype.configureCanvas=function(a,b,c,d,e){mxShape.prototype.configureCanvas.apply(this,arguments);a.setFontColor(this.color);a.setFontBackgroundColor(this.background);a.setFontBorderColor(this.border);a.setLabelPadding(this.labelPadding);a.setFontFamily(this.family);a.setFontSize(this.size);a.setFontStyle(this.fontStyle);a.allowConvertHtmlToSvg=this.convertToSvg}; mxText.prototype.isShadowEnabled=function(){return null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_SHADOW,!1):!1};mxText.prototype.getHtmlValue=function(){var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a}; mxText.prototype.getTextCss=function(){var a=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a="display: inline-block; font-size: "+this.size+"px; font-family: "+mxUtils.parseCssFontFamily(this.family)+"; color: "+this.color+"; line-height: "+a+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight: bold; ");(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&& (a+="font-style: italic; ");var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&((this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted"),a+="text-decoration: "+b.join(" ")+"; ");return a}; mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var a=this.node.style;a.whiteSpace="normal";a.overflow="";a.width="";a.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node);this.offsetHeight=this.offsetWidth=null;this.updateHtmlTransform()}}; mxText.prototype.redrawHtmlShapeWithCss3=function(){var a=Math.max(0,Math.round(this.bounds.width/this.scale)),b=Math.max(0,Math.round(this.bounds.height/this.scale)),c="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",d=this.getTextCss(),e=this.getActualTextDirection();mxSvgCanvas2D.createCss(a+2,b,this.align,this.valign,this.wrap,this.overflow,this.clipped,e,null!=this.background?mxUtils.htmlEntities(this.background):null,null!= this.border?mxUtils.htmlEntities(this.border):null,mxUtils.parseCssSpacing(this.labelPadding),c,d,this.scale,mxUtils.bind(this,function(f,g,k,l,m,n){f=this.getTextRotation();f=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=f?"rotate("+f+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=f&&(f="transform-origin: 0 0; transform: "+f+"; ");"block"==this.overflow&&this.valign==mxConstants.ALIGN_MIDDLE&&(f+="max-height: "+(b+1)+"px;");""== n?(k+=l,l="display:inline-block; min-width: 100%; "+f):(l+=f,mxClient.IS_SF&&(l+="-webkit-clip-path: content-box;"));"block"==this.overflow&&(l+="width: 100%; ");100>this.opacity&&(m+="opacity: "+this.opacity/100+"; ");this.node.setAttribute("style",k);k=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+k+"</div></div>");this.node.firstChild.firstChild.setAttribute("style",m);this.node.firstChild.setAttribute("style", l)}))}; mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),b=this.node.style,c=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(b,"transformOrigin",100*-c+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(b,"transform","translate("+100*c+"%,"+100*d+"%) scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(b,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(b,"transform","scale("+this.scale+") translate("+100*c+"%,"+100*d+"%)"));b.left=Math.round(this.bounds.x-Math.ceil(c* ("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";b.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";b.opacity=100>this.opacity?this.opacity/100:""}; mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var b=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=mxUtils.htmlEntities(b,!1));b=mxUtils.replaceTrailingNewlines(b,"<div> </div>");b=this.replaceLinefeeds?b.replace(/\n/g,"<br/>"):b;a.innerHTML='<div style="display:inline-block;_display:inline;">'+b+"</div>"}}; mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerText="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a;var b=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,c=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow|| "width"==this.overflow)null!=b&&(this.node.style.backgroundColor=b),null!=c&&(this.node.style.border="1px solid "+c);else{var d="";null!=b&&(d+="background-color:"+mxUtils.htmlEntities(b)+";");null!=c&&(d+="border:1px solid "+mxUtils.htmlEntities(c)+";");a='<div style="zoom:1;'+d+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+a+"</div>"}this.node.innerHTML= a;a=this.node.getElementsByTagName("div");0<a.length&&(b=this.textDirection,b==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=this.getAutoDirection()),b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?a[a.length-1].setAttribute("dir",b):a[a.length-1].removeAttribute("dir"))}}; mxText.prototype.updateFont=function(a){a=a.style;a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a.fontSize=this.size+"px";a.fontFamily=mxUtils.parseCssFontFamily(this.family);a.verticalAlign="top";a.color=this.color;a.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"";a.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)== mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&(this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted");a.textDecoration=b.join(" ");a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"}; mxText.prototype.updateSize=function(a){var b=Math.max(0,Math.round(this.bounds.width/this.scale)),c=Math.max(0,Math.round(this.bounds.height/this.scale)),d=a.style;this.clipped?(d.overflow="hidden",d.maxHeight=c+"px",d.maxWidth=b+"px"):"fill"==this.overflow?(d.width=b+1+"px",d.height=c+1+"px",d.overflow="hidden"):"width"==this.overflow?(d.width=b+1+"px",d.maxHeight=c+1+"px",d.overflow="hidden"):"block"==this.overflow&&(d.width=b+1+"px");if(this.wrap&&0<b){if(d.wordWrap=mxConstants.WORD_WRAP,d.whiteSpace= "normal",d.width=b+"px","fill"!=this.overflow&&"width"!=this.overflow){c=a;null!=c.firstChild&&"DIV"==c.firstChild.nodeName&&(c=c.firstChild,"break-word"==a.style.wordWrap&&(c.style.width="100%"));var e=c.offsetWidth;if(0==e){var f=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);e=c.offsetWidth;a.style.visibility="";f.appendChild(a)}e+=3;this.clipped&&(e=Math.min(e,b));d.width=e+"px"}}else d.whiteSpace="nowrap"}; mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)}; mxText.prototype.getSpacing=function(a,b){return new mxPoint(null!=b&&-.5==b.x||null==b&&this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:null!=b&&-1==b.x||null==b&&this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-(a?0:this.baseSpacingRight):this.spacingLeft+(a?0:this.baseSpacingLeft),this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-(a?0:this.baseSpacingBottom):this.spacingTop+(a? 0:this.baseSpacingTop))};function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return!0};mxTriangle.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,.5*e),new mxPoint(0,e)],this.isRounded,b,!0)};function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor); mxHexagon.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(.25*d,0),new mxPoint(.75*d,0),new mxPoint(d,.5*e),new mxPoint(.75*d,e),new mxPoint(.25*d,e),new mxPoint(0,.5*e)],this.isRounded,b,!0)};function mxLine(a,b,c,d){mxShape.call(this);this.bounds=a;this.stroke=b;this.strokewidth=null!=c?c:1;this.vertical=null!=d?d:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=!1; mxLine.prototype.paintVertexShape=function(a,b,c,d,e){a.begin();if(this.vertical){var f=b+d/2;a.moveTo(f,c);a.lineTo(f,c+e)}else f=c+e/2,a.moveTo(b,f),a.lineTo(b+d,f);a.stroke()};function mxImageShape(a,b,c,d,e){mxShape.call(this);this.bounds=a;this.image=b;this.fill=c;this.stroke=d;this.strokewidth=null!=e?e:1}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=!0;mxImageShape.prototype.getSvgScreenOffset=function(){return 0}; mxImageShape.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);this.gradient=this.stroke=this.fill=null;null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.imageBackground=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),this.imageBorder=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV|| 1==mxUtils.getValue(this.style,"imageFlipV",0),this.clipPath=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null))};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxImageShape.prototype.isRoundable=function(){return!0};mxImageShape.prototype.getImageDataUri=function(a){return this.image};mxImageShape.prototype.getImageCssVars=function(a){return null}; mxImageShape.prototype.configurePointerEvents=function(a){}; mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){if(null!=this.image){var f=this.isRounded?this.getArcSize(d,e):0;null!=this.imageBackground&&(a.setFillColor(this.imageBackground),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.fillAndStroke());var g=this.clipPath;if(0<f){var k=" round "+100*f/Math.min(d,e)+"%";null!=g&&"inset"==g.substring(0,5)&&0>g.indexOf("round")?g=g.replace(")",k+")"):null==g&&(g="inset(0% 0% 0% 0%"+k+")")}a.image(b,c,d,e,this.getImageDataUri(a), this.preserveImageAspect,!1,!1,g,this.getImageCssVars(a));null!=this.imageBorder&&(a.setShadow(!1),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)}; mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerText="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor= a;this.node.style.borderColor=b;a=document.createElement("img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"== a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)};function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape); mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),c=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1,c))}; mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER? a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))}; mxLabel.prototype.getIndicatorBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),k=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;a=e==mxConstants.ALIGN_RIGHT?a+(c-g-l):e==mxConstants.ALIGN_CENTER?a+(c-g)/ 2:a+l;b=f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):f==mxConstants.ALIGN_TOP?b+l:b+(d-k)/2;return new mxRectangle(a,b,g,k)}; mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var a=document.createElement("img");a.style.position="relative";a.setAttribute("border","0");var b=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);b.x-=this.bounds.x;b.y-=this.bounds.y;a.style.left=Math.round(b.x)+"px";a.style.top=Math.round(b.y)+"px";a.style.width= Math.round(b.width)+"px";a.style.height=Math.round(b.height)+"px";a.src=this.image;this.node.appendChild(a)}};function mxCylinder(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40; mxCylinder.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e,!1);a.fillAndStroke();this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),a.begin(),this.redrawPath(a,b,c,d,e,!0),a.stroke())};mxCylinder.prototype.getCylinderSize=function(a,b,c,d){return Math.min(this.maxHeight,Math.round(d/5))}; mxCylinder.prototype.redrawPath=function(a,b,c,d,e,f){b=this.getCylinderSize(b,c,d,e);if(f&&null!=this.fill||!f&&null==this.fill)a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin());f||(a.moveTo(0,b),a.curveTo(0,-b/3,d,-b/3,d,b),a.lineTo(d,e-b),a.curveTo(d,e+b/3,0,e+b/3,0,e-b),a.close())};function mxConnector(a,b,c){mxPolyline.call(this,a,b,c)}mxUtils.extend(mxConnector,mxPolyline); mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED];mxShape.prototype.updateBoundingBox.apply(this,arguments)}; mxConnector.prototype.paintEdgeShape=function(a,b){var c=this.createMarker(a,b,!0),d=this.createMarker(a,b,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);a.setShadow(!1);a.setDashed(!1);null!=c&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_STARTFILLCOLOR,this.stroke)),c());null!=d&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_ENDFILLCOLOR,this.stroke)),d())}; mxConnector.prototype.createMarker=function(a,b,c){var d=null,e=b.length,f=mxUtils.getValue(this.style,c?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),g=c?b[1]:b[e-2];b=c?b[0]:b[e-1];if(null!=f&&null!=g&&null!=b){d=b.x-g.x;e=b.y-g.y;var k=Math.sqrt(d*d+e*e);g=d/k;d=e/k;e=mxUtils.getNumber(this.style,c?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);d=mxMarker.createMarker(a,this,f,b,g,d,e,c,this.strokewidth,0!=this.style[c?mxConstants.STYLE_STARTFILL: mxConstants.STYLE_ENDFILL])}return d}; mxConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1);mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=Math.max(b,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+ 1);a.grow(b*this.scale)};function mxSwimlane(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.fixedHeaderDefault=!0;mxSwimlane.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.laneFill=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE))};mxSwimlane.prototype.isRoundable=function(){return!0}; mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};mxSwimlane.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))}; mxSwimlane.prototype.getLabelBounds=function(a){var b=this.getTitleSize(),c=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0==b&&!c)return mxShape.prototype.getLabelBounds.apply(this,arguments);var d=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);c=new mxRectangle(a.x,a.y,a.width,a.height);var f=this.isHorizontal(),g=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH; f=f==!g;d=!f&&d!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);e=f&&e!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(g){b=Math.min(c.width,b*this.scale);if(d||e)c.x+=c.width-b;c.width=b}else{b=Math.min(c.height,b*this.scale);if(d||e)c.y+=c.height-b;c.height=b}return c}; mxSwimlane.prototype.getGradientBounds=function(a,b,c,d,e){a=this.getTitleSize();return this.isHorizontal()?new mxRectangle(b,c,d,Math.min(a,e)):new mxRectangle(b,c,Math.min(a,d),e)}; mxSwimlane.prototype.getSwimlaneArcSize=function(a,b,c){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))return Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return c*a*3};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)}; mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){if(!this.outline){var f=this.getTitleSize(),g=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0!=f||g){g=0;f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(g=this.getSwimlaneArcSize(d,e,f),g=Math.min((this.isHorizontal()?e:d)-f,Math.min(f,g)),this.paintRoundedSwimlane(a,b,c,d,e,f,g)):this.paintSwimlane(a,b,c,d,e,f);this.paintFooter(a,b,c,d,e,f,g);var k=mxUtils.getValue(this.style, mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(a,b,c,d,e,f,k);null!=this.image&&(e=this.getImageBounds(b,c,d,e),k=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(e.x-b,e.y-c,e.width,e.height,this.image,!1,!1,!1,k));this.glass&&(a.setShadow(!1),this.paintGlassEffect(a,0,0,d,f,g))}}}; mxSwimlane.prototype.configurePointerEvents=function(a){var b=!0,c=!0,d=!0;null!=this.style&&(b="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),d=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));(b||c||d)&&mxShape.prototype.configurePointerEvents.apply(this,arguments)}; mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f){var g=this.laneFill,k=!0,l=!0,m=!0,n=!0;null!=this.style&&(k="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),m?a.fillAndStroke(): a.fill(),f<e&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),m?a.fillAndStroke():a.fill(),f<d&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e), n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill()));l&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)}; mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g){var k=this.laneFill,l=!0,m=!0,n=!0,p=!0;null!=this.style&&(l="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),p=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/ 2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),n?a.fillAndStroke():a.fill(),f<e&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f, e),n?a.fillAndStroke():a.fill(),f<d&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill()));m&&this.paintDivider(a,b,c,d,e,f,k==mxConstants.NONE)}; mxSwimlane.prototype.paintFooter=function(a,b,c,d,e,f,g){b=this.getFooterSize();c=this.isHorizontal();b=Math.min(b,(c?e:d)-f);if(!(0>=b)){f=this.fill;null!=f&&f!=mxConstants.NONE&&a.setFillColor(f);a.setShadow(!1);a.begin();if(c)if(c=Math.min(d/2,g),b>=g)a.moveTo(0,e-b),a.lineTo(0,e-g),a.quadTo(0,e,c,e),a.lineTo(d-c,e),a.quadTo(d,e,d,e-g),a.lineTo(d,e-b);else{g=1-Math.sqrt(b/g);var k=c*g*g;g*=c;a.moveTo(k,e-b);a.quadTo(g,e,c,e);a.lineTo(d-c,e);a.quadTo(d-g,e,d-k,e-b)}else c=Math.min(e/2,g),b>=g?(a.moveTo(d- b,0),a.lineTo(d-g,0),a.quadTo(d,0,d,c),a.lineTo(d,e-c),a.quadTo(d,e,d-g,e),a.lineTo(d-b,e)):(g=1-Math.sqrt(b/g),k=c*g*g,g*=c,a.moveTo(d-b,k),a.quadTo(d,g,d,c),a.lineTo(d,e-c),a.quadTo(d,e-g,d-b,e-k));a.close();null!=f&&f!=mxConstants.NONE?a.fillAndStroke():a.stroke()}};mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){0!=f&&(g||a.setShadow(!1),a.begin(),this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e)),a.stroke())}; mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a} mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]}; mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d))&&(d=this.graph.model.getEdgeCount(a),0<d))for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),k=this.graph.model.getTerminal(g,!0)==a;if(!b||k)k=this.graph.view.getVisibleTerminal(g,!k),this.traverse(k,b,c,g,e)}}; mxGraphLayout.prototype.isAncestor=function(a,b,c){if(!c)return this.graph.model.getParent(b)==a;if(b==a)return!1;for(;null!=b&&b!=a;)b=this.graph.model.getParent(b);return b==a};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.getModel().isVisible(a)}; mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.getModel().isVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])}; mxGraphLayout.prototype.getParentOffset=function(a){var b=new mxPoint;if(null!=a&&a!=this.parent){var c=this.graph.getModel();if(c.isAncestor(this.parent,a))for(var d=c.getGeometry(a);a!=this.parent;)b.x+=d.x,b.y+=d.y,a=c.getParent(a),d=c.getGeometry(a)}return b}; mxGraphLayout.prototype.setEdgePoints=function(a,b){if(null!=a){var c=this.graph.model,d=c.getGeometry(a);null==d?(d=new mxGeometry,d.setRelative(!0)):d=d.clone();if(null!=this.parent&&null!=b){var e=c.getParent(a);e=this.getParentOffset(e);for(var f=0;f<b.length;f++)b[f].x-=e.x,b[f].y-=e.y}d.points=b;c.setGeometry(a,d)}}; mxGraphLayout.prototype.setVertexLocation=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a),f=null;if(null!=e){f=new mxRectangle(b,c,e.width,e.height);if(this.useBoundingBox){var g=this.graph.getView().getState(a);if(null!=g&&null!=g.text&&null!=g.text.boundingBox){var k=this.graph.getView().scale,l=g.text.boundingBox;g.text.boundingBox.x<g.x&&(b+=(g.x-l.x)/k,f.width=l.width);g.text.boundingBox.y<g.y&&(c+=(g.y-l.y)/k,f.height=l.height)}}null!=this.parent&&(g=d.getParent(a),null!=g&&g!= this.parent&&(g=this.getParentOffset(g),b-=g.x,c-=g.y));if(e.x!=b||e.y!=c)e=e.clone(),e.x=b,e.y=c,d.setGeometry(a,e)}return f}; mxGraphLayout.prototype.getVertexBounds=function(a){var b=this.graph.getModel().getGeometry(a);if(this.useBoundingBox){var c=this.graph.getView().getState(a);if(null!=c&&null!=c.text&&null!=c.text.boundingBox){var d=this.graph.getView().scale,e=c.text.boundingBox,f=Math.max(c.x-e.x,0)/d,g=Math.max(c.y-e.y,0)/d;b=new mxRectangle(b.x-f,b.y-g,b.width+f+Math.max(e.x+e.width-(c.x+c.width),0)/d,b.height+g+Math.max(e.y+e.height-(c.y+c.height),0)/d)}}null!=this.parent&&(a=this.graph.getModel().getParent(a), b=b.clone(),null!=a&&a!=this.parent&&(a=this.getParentOffset(a),b.x+=a.x,b.y+=a.y));return new mxRectangle(b.x,b.y,b.width,b.height)};mxGraphLayout.prototype.arrangeGroups=function(a,b,c,d,e,f){return this.graph.updateGroupBounds(a,b,!0,c,d,e,f)};function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null; WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?-1:b.weightedValue<a.weightedValue?1:b.nudge?-1:1:0};function mxStackLayout(a,b,c,d,e,f){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=null!=c?c:0;this.x0=null!=d?d:0;this.y0=null!=e?e:0;this.border=null!=f?f:0}mxStackLayout.prototype=new mxGraphLayout;mxStackLayout.prototype.constructor=mxStackLayout; mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=!1;mxStackLayout.prototype.fill=!1;mxStackLayout.prototype.resizeParent=!1;mxStackLayout.prototype.resizeParentMax=!1; mxStackLayout.prototype.resizeLast=!1;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=!0;mxStackLayout.prototype.allowGaps=!1;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal}; mxStackLayout.prototype.moveCell=function(a,b,c){var d=this.graph.getModel(),e=d.getParent(a),f=this.isHorizontal();if(null!=a&&null!=e){var g=0,k=d.getChildCount(e);c=f?b:c;b=this.graph.getView().getState(e);null!=b&&(c-=f?b.x:b.y);c/=this.graph.view.scale;for(b=0;b<k;b++){var l=d.getChildAt(e,b);if(l!=a&&(l=d.getGeometry(l),null!=l)){l=f?l.x+l.width/2:l.y+l.height/2;if(g<=c&&l>c)break;g=l}}f=e.getIndex(a);f=Math.max(0,b-(b>f?1:0));d.add(e,a,f)}}; mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot)&&(c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return c}; mxStackLayout.prototype.getLayoutCells=function(a){for(var b=this.graph.getModel(),c=b.getChildCount(a),d=[],e=0;e<c;e++){var f=b.getChildAt(a,e);!this.isVertexIgnored(f)&&this.isVertexMovable(f)&&d.push(f)}this.allowGaps&&d.sort(mxUtils.bind(this,function(g,k){g=this.graph.getCellGeometry(g);k=this.graph.getCellGeometry(k);return this.horizontal?g.x==k.x?0:g.x>k.x>0?1:-1:g.y==k.y?0:g.y>k.y>0?1:-1}));return d}; mxStackLayout.prototype.snap=function(a){if(null!=this.gridSize&&0<this.gridSize&&(a=Math.max(a,this.gridSize),1<a/this.gridSize)){var b=a%this.gridSize;a+=b>this.gridSize/2?this.gridSize-b:-b}return a}; mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);e-=2*this.border;var f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop,k=this.graph.getActualStartSize(a,!0);null!=b&&(k.x=Math.min(k.x,b.width),k.y=Math.min(k.y,b.height),k.width=Math.min(k.width,b.width),k.height=Math.min(k.height,b.height)); var l=this.graph.getActualFooterSize(a,!0);e=c?e-(k.y+k.height+l.y+l.height):e-(k.x+k.width+l.x+l.width);f+=k.x+l.x;g+=k.y+l.y;d.beginUpdate();try{for(var m=0,n=null,p=0,q=null,r=this.getLayoutCells(a),t=0;t<r.length;t++){var u=r[t],v=d.getGeometry(u);if(null!=v){v=v.clone();null!=this.wrap&&null!=n&&(c&&n.x+n.width+v.width+2*this.spacing>this.wrap||!c&&n.y+n.height+v.height+2*this.spacing>this.wrap)&&(n=null,c?g+=m+this.spacing:f+=m+this.spacing,m=0);m=Math.max(m,c?v.height:v.width);var y=0;if(!this.borderCollapse){var A= this.graph.getCellStyle(u);y=mxUtils.getNumber(A,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=n){var z=p+this.spacing+Math.floor(y/2);c?v.x=this.snap((this.allowGaps?Math.max(z,v.x):z)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(z,v.y):z)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(c?v.x=this.allowGaps&&v.x>f?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,f):f:v.y=this.allowGaps&&v.y>g?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,g):g);c? v.y=g:v.x=f;this.fill&&null!=e&&(c?v.height=e:v.width=e);c?v.width=this.snap(v.width):v.height=this.snap(v.height);this.setChildGeometry(u,v);q=u;n=v;p=c?n.x+n.width+Math.floor(y/2):n.y+n.height+Math.floor(y/2)}}this.resizeParent&&null!=b&&null!=n&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,b,n):this.resizeLast&&null!=b&&null!=n&&null!=q&&(c?n.width=b.width-n.x-this.spacing-this.marginRight-this.marginLeft-k.width-l.width:n.height=b.height-n.y-this.spacing-this.marginBottom-k.height- l.height,this.setChildGeometry(q,n))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);null!=c&&b.x==c.x&&b.y==c.y&&b.width==c.width&&b.height==c.height||this.graph.getModel().setGeometry(a,b)}; mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=this.graph.getActualStartSize(a,!0),g=this.graph.getActualFooterSize(a,!0),k=b.clone();d?(c=c.x+c.width+this.marginRight+this.border+f.width+g.width,k.width=this.resizeParentMax?Math.max(k.width,c):c):(c=c.y+c.height+this.marginBottom+this.border+f.height+g.height,k.height=this.resizeParentMax?Math.max(k.height,c):c);b.x==k.x&&b.y==k.y&&b.width==k.width&&b.height==k.height||e.setGeometry(a, k)};function mxPartitionLayout(a,b,c,d){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=c||0;this.border=d||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=!0;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal}; mxPartitionLayout.prototype.moveCell=function(a,b,c){c=this.graph.getModel();var d=c.getParent(a);if(null!=a&&null!=d){var e,f=0,g=c.getChildCount(d);for(e=0;e<g;e++){var k=c.getChildAt(d,e);k=this.getVertexBounds(k);if(null!=k){k=k.x+k.width/2;if(f<b&&k>b)break;f=k}}b=d.getIndex(a);b=Math.max(0,e-(e>b?1:0));c.add(d,a,b)}}; mxPartitionLayout.prototype.execute=function(a){var b=this.isHorizontal(),c=this.graph.getModel(),d=c.getGeometry(a);null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot)&&(d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g);!this.isVertexIgnored(k)&&this.isVertexMovable(k)&&e.push(k)}f=e.length;if(0<f){var l=this.border,m=this.border,n=b? d.height:d.width;n-=2*this.border;a=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;n-=b?a.height:a.width;l+=a.width;m+=a.height;a=this.border+(f-1)*this.spacing;d=b?(d.width-l-a)/f:(d.height-m-a)/f;if(0<d){c.beginUpdate();try{for(g=0;g<f;g++){k=e[g];var p=c.getGeometry(k);null!=p&&(p=p.clone(),p.x=l,p.y=m,b?(this.resizeVertices&&(p.width=d,p.height=n),l+=d+this.spacing):(this.resizeVertices&&(p.height=d,p.width=n),m+=d+this.spacing),c.setGeometry(k,p))}}finally{c.endUpdate()}}}}}; function mxCompactTreeLayout(a,b,c){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.invert=null!=c?c:!1}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=!0;mxCompactTreeLayout.prototype.maintainParentLocation=!1;mxCompactTreeLayout.prototype.groupPadding=10; mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=!1;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=!0; mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=!0;mxCompactTreeLayout.prototype.sortEdges=!1;mxCompactTreeLayout.prototype.alignRanks=!1;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null; mxCompactTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal}; mxCompactTreeLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.getModel();if(null==b)if(0<this.graph.getEdges(a,c.getParent(a),this.invert,!this.invert,!1).length)this.root=a;else{if(b=this.graph.findTreeRoots(a,!0,this.invert),0<b.length)for(var d=0;d<b.length;d++)if(!this.isVertexIgnored(b[d])&&0<this.graph.getEdges(b[d],null,this.invert,!this.invert,!1).length){this.root=b[d];break}}else this.root=b;if(null!=this.root){this.parentsChanged=this.resizeParent?{}:null;this.parentY= this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var e=this.graph.getCellGeometry(a);null!=e&&(this.parentX=e.x,this.parentY=e.y)}c.beginUpdate();try{if(this.visited={},this.node=this.dfs(this.root,a),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var f=this.graph.gridSize;b=f;if(!this.moveTree){var g=this.getVertexBounds(this.root);null!=g&&(f=g.x,b=g.y)}g=null; g=this.isHorizontal()?this.horizontalLayout(this.node,f,b):this.verticalLayout(this.node,null,f,b);if(null!=g){var k=d=0;0>g.x&&(d=Math.abs(f-g.x));0>g.y&&(k=Math.abs(b-g.y));0==d&&0==k||this.moveNode(this.node,d,k);this.resizeParent&&this.adjustParents();this.edgeRouting&&this.localEdgeProcessing(this.node)}null!=this.parentX&&null!=this.parentY&&(e=this.graph.getCellGeometry(a),null!=e&&(e=e.clone(),e.x=this.parentX,e.y=this.parentY,c.setGeometry(a,e)))}}finally{c.endUpdate()}}}; mxCompactTreeLayout.prototype.moveNode=function(a,b,c){a.x+=b;a.y+=c;this.apply(a);for(a=a.child;null!=a;)this.moveNode(a,b,c),a=a.next}; mxCompactTreeLayout.prototype.sortOutgoingEdges=function(a,b){var c=new mxDictionary;b.sort(function(d,e){var f=d.getTerminal(d.getTerminal(!1)==a);d=c.get(f);null==d&&(d=mxCellPath.create(f).split(mxCellPath.PATH_SEPARATOR),c.put(f,d));e=e.getTerminal(e.getTerminal(!1)==a);f=c.get(e);null==f&&(f=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,f));return mxCellPath.compare(d,f)})}; mxCompactTreeLayout.prototype.findRankHeights=function(a,b){if(null==this.maxRankHeight[b]||this.maxRankHeight[b]<a.height)this.maxRankHeight[b]=a.height;for(a=a.child;null!=a;)this.findRankHeights(a,b+1),a=a.next};mxCompactTreeLayout.prototype.setCellHeights=function(a,b){null!=this.maxRankHeight[b]&&this.maxRankHeight[b]>a.height&&(a.height=this.maxRankHeight[b]);for(a=a.child;null!=a;)this.setCellHeights(a,b+1),a=a.next}; mxCompactTreeLayout.prototype.dfs=function(a,b){var c=mxCellPath.create(a),d=null;if(null!=a&&null==this.visited[c]&&!this.isVertexIgnored(a)){this.visited[c]=a;d=this.createNode(a);c=this.graph.getModel();var e=null,f=this.graph.getEdges(a,b,this.invert,!this.invert,!1,!0),g=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(a,f);for(a=0;a<f.length;a++){var k=f[a];if(!this.isEdgeIgnored(k)){this.resetEdges&&this.setEdgePoints(k,null);this.edgeRouting&&(this.setEdgeStyleEnabled(k,!1),this.setEdgePoints(k, null));var l=g.getState(k);k=null!=l?l.getVisibleTerminal(this.invert):g.getVisibleTerminal(k,this.invert);l=this.dfs(k,b);null!=l&&null!=c.getGeometry(k)&&(null==e?d.child=l:e.next=l,e=l)}}}return d};mxCompactTreeLayout.prototype.layout=function(a){if(null!=a){for(var b=a.child;null!=b;)this.layout(b),b=b.next;null!=a.child?this.attachParent(a,this.join(a)):this.layoutLeaf(a)}}; mxCompactTreeLayout.prototype.horizontalLayout=function(a,b,c,d){a.x+=b+a.offsetX;a.y+=c+a.offsetY;d=this.apply(a,d);b=a.child;if(null!=b){d=this.horizontalLayout(b,a.x,a.y,d);c=a.y+b.offsetY;for(var e=b.next;null!=e;)d=this.horizontalLayout(e,a.x+b.offsetX,c,d),c+=e.offsetY,e=e.next}return d}; mxCompactTreeLayout.prototype.verticalLayout=function(a,b,c,d,e){a.x+=c+a.offsetY;a.y+=d+a.offsetX;e=this.apply(a,e);b=a.child;if(null!=b)for(e=this.verticalLayout(b,a,a.x,a.y,e),c=a.x+b.offsetY,d=b.next;null!=d;)e=this.verticalLayout(d,a,c,a.y+b.offsetX,e),c+=d.offsetY,d=d.next;return e}; mxCompactTreeLayout.prototype.attachParent=function(a,b){var c=this.nodeDistance+this.levelDistance,d=(b-a.width)/2-this.nodeDistance;b=d+a.width+2*this.nodeDistance-b;a.child.offsetX=c+a.height;a.child.offsetY=b;a.contour.upperHead=this.createLine(a.height,0,this.createLine(c,b,a.contour.upperHead));a.contour.lowerHead=this.createLine(a.height,0,this.createLine(c,d,a.contour.lowerHead))}; mxCompactTreeLayout.prototype.layoutLeaf=function(a){var b=2*this.nodeDistance;a.contour.upperTail=this.createLine(a.height+b,0);a.contour.upperHead=a.contour.upperTail;a.contour.lowerTail=this.createLine(0,-a.width-b);a.contour.lowerHead=this.createLine(a.height+b,0,a.contour.lowerTail)}; mxCompactTreeLayout.prototype.join=function(a){var b=2*this.nodeDistance,c=a.child;a.contour=c.contour;var d=c.width+b,e=d;for(c=c.next;null!=c;){var f=this.merge(a.contour,c.contour);c.offsetY=f+d;c.offsetX=0;d=c.width+b;e+=f+d;c=c.next}return e}; mxCompactTreeLayout.prototype.merge=function(a,b){for(var c=0,d=0,e=0,f=a.lowerHead,g=b.upperHead;null!=g&&null!=f;){var k=this.offset(c,d,g.dx,g.dy,f.dx,f.dy);d+=k;e+=k;c+g.dx<=f.dx?(c+=g.dx,d+=g.dy,g=g.next):(c-=f.dx,d-=f.dy,f=f.next)}null!=g?(c=this.bridge(a.upperTail,0,0,g,c,d),a.upperTail=null!=c.next?b.upperTail:c,a.lowerTail=b.lowerTail):(c=this.bridge(b.lowerTail,c,d,f,0,0),null==c.next&&(a.lowerTail=c));a.lowerHead=b.lowerHead;return e}; mxCompactTreeLayout.prototype.offset=function(a,b,c,d,e,f){if(e<=a||0>=a+c)return 0;a=0<e*d-c*f?0>a?a*d/c-b:0<a?a*f/e-b:-b:e<a+c?f-(b+(e-a)*d/c):e>a+c?(c+a)*f/e-(b+d):f-(b+d);return 0<a?a:0};mxCompactTreeLayout.prototype.bridge=function(a,b,c,d,e,f){b=e+d.dx-b;0==d.dx?e=d.dy:(e=b*d.dy,e/=d.dx);b=this.createLine(b,e,d.next);a.next=this.createLine(0,f+d.dy-e-c,b);return b}; mxCompactTreeLayout.prototype.createNode=function(a){var b={};b.cell=a;b.x=0;b.y=0;b.width=0;b.height=0;a=this.getVertexBounds(a);null!=a&&(this.isHorizontal()?(b.width=a.height,b.height=a.width):(b.width=a.width,b.height=a.height));b.offsetX=0;b.offsetY=0;b.contour={};return b}; mxCompactTreeLayout.prototype.apply=function(a,b){var c=this.graph.getModel(),d=a.cell,e=c.getGeometry(d);null!=d&&null!=e&&(this.isVertexMovable(d)&&(e=this.setVertexLocation(d,a.x,a.y),this.resizeParent&&(a=c.getParent(d),c=mxCellPath.create(a),null==this.parentsChanged[c]&&(this.parentsChanged[c]=a))),b=null==b?new mxRectangle(e.x,e.y,e.width,e.height):new mxRectangle(Math.min(b.x,e.x),Math.min(b.y,e.y),Math.max(b.x+b.width,e.x+e.width),Math.max(b.y+b.height,e.y+e.height)));return b}; mxCompactTreeLayout.prototype.createLine=function(a,b,c){var d={};d.dx=a;d.dy=b;d.next=c;return d};mxCompactTreeLayout.prototype.adjustParents=function(){var a=[],b;for(b in this.parentsChanged)a.push(this.parentsChanged[b]);this.arrangeGroups(mxUtils.sortCells(a,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)}; mxCompactTreeLayout.prototype.localEdgeProcessing=function(a){this.processNodeOutgoing(a);for(a=a.child;null!=a;)this.localEdgeProcessing(a),a=a.next}; mxCompactTreeLayout.prototype.processNodeOutgoing=function(a){for(var b=a.child,c=a.cell,d=0,e=[];null!=b;){d++;var f=b.x;this.horizontal&&(f=b.y);e.push(new WeightedCellSorter(b,f));b=b.next}e.sort(WeightedCellSorter.prototype.compare);f=a.width;var g=(d+1)*this.prefHozEdgeSep;f>g+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);f=this.minEdgeJetty-this.prefVertEdgeOff;g=this.getVertexBounds(c);for(var k=0;k<e.length;k++){var l=e[k].cell.cell, m=this.getVertexBounds(l);l=this.graph.getEdgesBetween(c,l,!1);for(var n=[],p,q,r=0;r<l.length;r++)this.horizontal?(p=g.x+g.width,q=g.y+b,n.push(new mxPoint(p,q)),p=g.x+g.width+f,n.push(new mxPoint(p,q)),q=m.y+m.height/2):(p=g.x+b,q=g.y+g.height,n.push(new mxPoint(p,q)),q=g.y+g.height+f,n.push(new mxPoint(p,q)),p=m.x+m.width/2),n.push(new mxPoint(p,q)),this.setEdgePoints(l[r],n);k<d/2?f+=this.prefVertEdgeOff:k>d/2&&(f-=this.prefVertEdgeOff);b+=a}}; function mxRadialTreeLayout(a){mxCompactTreeLayout.call(this,a,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=.5;mxRadialTreeLayout.prototype.rootx=0;mxRadialTreeLayout.prototype.rooty=0;mxRadialTreeLayout.prototype.levelDistance=120;mxRadialTreeLayout.prototype.nodeDistance=10;mxRadialTreeLayout.prototype.autoRadius=!1;mxRadialTreeLayout.prototype.sortEdges=!1;mxRadialTreeLayout.prototype.rowMinX=[];mxRadialTreeLayout.prototype.rowMaxX=[]; mxRadialTreeLayout.prototype.rowMinCenX=[];mxRadialTreeLayout.prototype.rowMaxCenX=[];mxRadialTreeLayout.prototype.rowRadi=[];mxRadialTreeLayout.prototype.row=[];mxRadialTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length}; mxRadialTreeLayout.prototype.execute=function(a,b){this.parent=a;this.edgeRouting=this.useBoundingBox=!1;mxCompactTreeLayout.prototype.execute.apply(this,arguments);var c=null,d=this.getVertexBounds(this.root);this.centerX=d.x+d.width/2;this.centerY=d.y+d.height/2;for(var e in this.visited){var f=this.getVertexBounds(this.visited[e]);c=null!=c?c:f.clone();c.add(f)}this.calcRowDims([this.node],0);var g=0,k=0;for(c=0;c<this.row.length;c++)e=(this.rowMaxX[c]-this.centerX-this.nodeDistance)/this.rowRadi[c], g=Math.max(g,(this.centerX-this.rowMinX[c]-this.nodeDistance)/this.rowRadi[c]),k=Math.max(k,e);for(c=0;c<this.row.length;c++){var l=this.centerX-this.nodeDistance-g*this.rowRadi[c],m=this.centerX+this.nodeDistance+k*this.rowRadi[c]-l;for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),d.theta=(f.x+f.width/2-l)/m*Math.PI*2}for(c=this.row.length-2;0<=c;c--)for(f=this.row[c],e=0;e<f.length;e++){d=f[e];g=d.child;for(l=k=0;null!=g;)l+=g.theta,k++,g=g.next;0<k&&(g=l/k,g> d.theta&&e<f.length-1?d.theta=Math.min(g,f[e+1].theta-Math.PI/10):g<d.theta&&0<e&&(d.theta=Math.max(g,f[e-1].theta+Math.PI/10)))}for(c=0;c<this.row.length;c++)for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),this.setVertexLocation(d.cell,this.centerX-f.width/2+this.rowRadi[c]*Math.cos(d.theta),this.centerY-f.height/2+this.rowRadi[c]*Math.sin(d.theta))}; mxRadialTreeLayout.prototype.calcRowDims=function(a,b){if(null!=a&&0!=a.length){this.rowMinX[b]=this.centerX;this.rowMaxX[b]=this.centerX;this.rowMinCenX[b]=this.centerX;this.rowMaxCenX[b]=this.centerX;this.row[b]=[];for(var c=!1,d=0;d<a.length;d++)for(var e=null!=a[d]?a[d].child:null;null!=e;){var f=this.getVertexBounds(e.cell);this.rowMinX[b]=Math.min(f.x,this.rowMinX[b]);this.rowMaxX[b]=Math.max(f.x+f.width,this.rowMaxX[b]);this.rowMinCenX[b]=Math.min(f.x+f.width/2,this.rowMinCenX[b]);this.rowMaxCenX[b]= Math.max(f.x+f.width/2,this.rowMaxCenX[b]);this.rowRadi[b]=f.y-this.getVertexBounds(this.root).y;null!=e.child&&(c=!0);this.row[b].push(e);e=e.next}c&&this.calcRowDims(this.row[b],b+1)}};function mxFastOrganicLayout(a){mxGraphLayout.call(this,a)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=!0;mxFastOrganicLayout.prototype.resetEdges=!0;mxFastOrganicLayout.prototype.disableEdgeStyle=!0; mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=!0; mxFastOrganicLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length}; mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant= .001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var k=mxObjectIdentity.get(g);this.indices[k]=d;var l=this.getVertexBounds(g),m=l.width,n=l.height,p=l.x,q=l.y;this.cellLocation[d][0]=p+m/2;this.cellLocation[d][1]=q+n/2;this.radius[d]=Math.min(m,n);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]); var r=this.graph.getConnections(this.vertexArray[d],a);c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(m=0;m<c.length;m++){this.resetEdges&&this.graph.resetEdge(r[m]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[m],!1);k=mxObjectIdentity.get(c[m]);var t=this.indices[k];this.neighbours[d][m]=null!=t?t:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return; this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(l=this.getVertexBounds(g),null!=l&&(this.cellLocation[d][0]-=l.width/2,this.cellLocation[d][1]-=l.height/2,p=this.graph.snap(Math.round(this.cellLocation[d][0])),q=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,p,q),c=null==c?p:Math.min(c,p),a=null==a?q:Math.min(a,q)));d=-(c||0)+1;g=-(a|| 0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature);b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}}; mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f);f/=this.forceConstant;d=d/g*f;e=e/g*f;this.dispX[a]-= d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}}; mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/ g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1; mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0; mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),k=0;k<g;k++){var l=b.getChildAt(a,k);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{f.push(l);var m=this.getVertexBounds(l);d=null==d?m.y:Math.min(d,m.y);e=null==e?m.x:Math.min(e,m.x);c=Math.max(c,Math.max(m.width,m.height))}}var n=this.getRadius(f.length, c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,n,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.cos(g*f-Math.PI/2)),Math.round(d+b+b*Math.sin(g*f-Math.PI/2)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)} mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=!1;mxParallelEdgeLayout.prototype.execute=function(a,b){a=this.findParallels(a,b);this.graph.model.beginUpdate();try{for(var c in a){var d=a[c];1<d.length&&this.layout(d)}}finally{this.graph.model.endUpdate()}}; mxParallelEdgeLayout.prototype.findParallels=function(a,b){var c=[],d=mxUtils.bind(this,function(g){if(!this.isEdgeIgnored(g)){var k=this.getEdgeId(g);null!=k&&(null==c[k]&&(c[k]=[]),c[k].push(g))}});if(null!=b)for(var e=0;e<b.length;e++)d(b[e]);else{b=this.graph.getModel();var f=b.getChildCount(a);for(e=0;e<f;e++)d(b.getChildAt(a,e))}return c}; mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);b=b.getVisibleTerminal(a,!1);var d="";if(null!=c&&null!=b){c=mxObjectIdentity.get(c);b=mxObjectIdentity.get(b);if(this.checkOverlap&&(a=this.graph.view.getState(a),null!=a&&null!=a.absolutePoints)){d=[];for(var e=0;e<a.absolutePoints.length;e++){var f=a.absolutePoints[e];null!=f&&d.push(f.x,f.y)}d=d.join(",")}return(c>b?b+"-"+c:c+"-"+b)+d}return null}; mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.view.getState(b);if(null!=c&&null!=c.absolutePoints){var d=c.absolutePoints[0];c=c.absolutePoints[c.absolutePoints.length-1];if(null!=d&&null!=c){var e=this.graph.getView(),f=this.graph.getModel(),g=f.getGeometry(e.getVisibleTerminal(b,!0));b=f.getGeometry(e.getVisibleTerminal(b,!1));if(g==b)for(c=g.x+g.width+this.spacing,d=g.y+g.height/2,g=0;g<a.length;g++)this.route(a[g],c,d),c+=this.spacing;else if(null!=g&&null!=b&&(g=this.graph.view.scale, b=this.graph.view.translate,d.x=d.x/g-b.x,d.y=d.y/g-b.y,c.x=c.x/g-b.x,c.y=c.y/g-b.y,g=c.x-d.x,e=c.y-d.y,b=Math.sqrt(g*g+e*e),0<b))for(c=d.x+g/2,d=d.y+e/2,e=e*this.spacing/b,b=g*this.spacing/b,c+=e*(a.length-1)/2,d-=b*(a.length-1)/2,g=0;g<a.length;g++)this.route(a[g],c,d),c-=e,d+=b}}};mxParallelEdgeLayout.prototype.route=function(a,b,c){this.graph.isCellMovable(a)&&this.setEdgePoints(a,[new mxPoint(Math.round(b),Math.round(c))])}; function mxCompositeLayout(a,b,c){mxGraphLayout.call(this,a);this.layouts=b;this.master=c}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;mxCompositeLayout.prototype.moveCell=function(a,b,c){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)}; mxCompositeLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0;c<this.layouts.length;c++)this.layouts[c].execute.apply(this.layouts[c],arguments)}finally{b.endUpdate()}};function mxEdgeLabelLayout(a,b){mxGraphLayout.call(this,a)}mxEdgeLabelLayout.prototype=new mxGraphLayout;mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout; mxEdgeLabelLayout.prototype.execute=function(a){for(var b=this.graph.view,c=this.graph.getModel(),d=[],e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g),l=b.getState(k);null!=l&&(this.isVertexIgnored(k)?this.isEdgeIgnored(k)||d.push(l):e.push(l))}this.placeLabels(e,d)}; mxEdgeLabelLayout.prototype.placeLabels=function(a,b){var c=this.graph.getModel();c.beginUpdate();try{for(var d=0;d<b.length;d++){var e=b[d];if(null!=e&&null!=e.text&&null!=e.text.boundingBox)for(var f=0;f<a.length;f++){var g=a[f];null!=g&&this.avoid(e,g)}}}finally{c.endUpdate()}}; mxEdgeLabelLayout.prototype.avoid=function(a,b){var c=this.graph.getModel(),d=a.text.boundingBox;if(mxUtils.intersects(d,b)){var e=-d.y-d.height+b.y,f=-d.y+b.y+b.height;e=Math.abs(e)<Math.abs(f)?e:f;f=-d.x-d.width+b.x;b=-d.x+b.x+b.width;b=Math.abs(f)<Math.abs(b)?f:b;Math.abs(b)<Math.abs(e)?e=0:b=0;d=c.getGeometry(a.cell);null!=d&&(d=d.clone(),null!=d.offset?(d.offset.x+=b,d.offset.y+=e):d.offset=new mxPoint(b,e),c.setGeometry(a.cell,d))}}; function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null; mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(a){return null}; mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(a,b){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(a,b){this.isVertex()?this.x[0]=b:this.isEdge()&&(this.x[a-this.minRank-1]=b)};mxGraphAbstractHierarchyCell.prototype.getX=function(a){return this.isVertex()?this.x[0]:this.isEdge()?this.x[a-this.minRank-1]:0};mxGraphAbstractHierarchyCell.prototype.setY=function(a,b){this.isVertex()?this.y[0]=b:this.isEdge()&&(this.y[a-this.minRank-1]=b)}; function mxGraphHierarchyNode(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=a;this.id=mxObjectIdentity.get(a);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null; mxGraphHierarchyNode.prototype.hashCode=!1;mxGraphHierarchyNode.prototype.getRankValue=function(a){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsTarget.length;b++){var c=this.connectsAsTarget[b];-1==c.maxRank||c.maxRank==a+1?this.nextLayerConnectedCells[0].push(c.source):this.nextLayerConnectedCells[0].push(c)}}return this.nextLayerConnectedCells[0]}; mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsSource.length;b++){var c=this.connectsAsSource[b];-1==c.minRank||c.minRank==a-1?this.previousLayerConnectedCells[0].push(c.target):this.previousLayerConnectedCells[0].push(c)}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return!0}; mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(a){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(a,b){this.temp[0]=b};mxGraphHierarchyNode.prototype.isAncestor=function(a){if(null!=a&&null!=this.hashCode&&null!=a.hashCode&&this.hashCode.length<a.hashCode.length){if(this.hashCode==a.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var b=0;b<this.hashCode.length;b++)if(this.hashCode[b]!=a.hashCode[b])return!1;return!0}return!1}; mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};function mxGraphHierarchyEdge(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=a;this.ids=[];for(var b=0;b<a.length;b++)this.ids.push(mxObjectIdentity.get(a[b]))}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null; mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=!1;mxGraphHierarchyEdge.prototype.invert=function(a){a=this.source;this.source=this.target;this.target=a;this.isReversed=!this.isReversed}; mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.nextLayerConnectedCells[b]=[],b==this.temp.length-1?this.nextLayerConnectedCells[b].push(this.source):this.nextLayerConnectedCells[b].push(this)}return this.nextLayerConnectedCells[a-this.minRank-1]}; mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.previousLayerConnectedCells[b]=[],0==b?this.previousLayerConnectedCells[b].push(this.target):this.previousLayerConnectedCells[b].push(this)}return this.previousLayerConnectedCells[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return!0}; mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(a){return this.temp[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(a,b){this.temp[a-this.minRank-1]=b};mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null}; function mxGraphHierarchyModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]== l&&(l=a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null; mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1; mxGraphHierarchyModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=0;e<b.length;e++){c[e]=new mxGraphHierarchyNode(b[e]);this.vertexMapper.put(b[e],c[e]);var f=a.getEdges(b[e]);c[e].connectsAsSource=[];for(var g=0;g<f.length;g++){var k=a.getVisibleTerminal(f[g],!1);if(k!=b[e]&&a.graph.model.isVertex(k)&&!a.isVertexIgnored(k)){var l=a.getEdgesBetween(b[e],k,!1);k=a.getEdgesBetween(b[e],k,!0);if(null!=l&&0<l.length&&null==this.edgeMapper.get(l[0])&&2*k.length>=l.length){k= new mxGraphHierarchyEdge(l);for(var m=0;m<l.length;m++){var n=l[m];this.edgeMapper.put(n,k);d.resetEdge(n);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(n,!1),a.setOrthogonalEdge(n,!0))}k.source=c[e];0>mxUtils.indexOf(c[e].connectsAsSource,k)&&c[e].connectsAsSource.push(k)}}}c[e].temp[0]=0}}; mxGraphHierarchyModel.prototype.initialRank=function(){var a=[];if(null!=this.roots)for(var b=0;b<this.roots.length;b++){var c=this.vertexMapper.get(this.roots[b]);null!=c&&a.push(c)}var d=this.vertexMapper.getValues();for(b=0;b<d.length;b++)d[b].temp[0]=-1;for(var e=a.slice();0<a.length;){c=a[0];var f=c.connectsAsTarget,g=c.connectsAsSource,k=!0,l=this.SOURCESCANSTARTRANK;for(b=0;b<f.length;b++){var m=f[b];if(5270620==m.temp[0])m=m.source,l=Math.min(l,m.temp[0]-1);else{k=!1;break}}if(k){c.temp[0]= l;this.maxRank=Math.min(this.maxRank,l);if(null!=g)for(b=0;b<g.length;b++)m=g[b],m.temp[0]=5270620,m=m.target,-1==m.temp[0]&&(a.push(m),m.temp[0]=-2);a.shift()}else if(b=a.shift(),a.push(c),b==c&&1==a.length)break}for(b=0;b<d.length;b++)d[b].temp[0]-=this.maxRank;for(b=0;b<e.length;b++)for(c=e[b],a=0,f=c.connectsAsSource,d=0;d<f.length;d++)m=f[d],m=m.target,c.temp[0]=Math.max(a,m.temp[0]+1),a=c.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank}; mxGraphHierarchyModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp= [],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxGraphHierarchyModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}}; mxGraphHierarchyModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}}; mxGraphHierarchyModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g])for(e[g]=b,d(a,b,c,k,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.extendedDfs(b,g.target,g,d,e,b.hashCode,c,k+1);else d(a,b,c,k,1)}; function mxSwimlaneModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]==l&&(l= a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0; mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1E8;mxSwimlaneModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null; mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f<b.length;f++){c[f]=new mxGraphHierarchyNode(b[f]);this.vertexMapper.put(b[f],c[f]);c[f].swimlaneIndex=-1;for(var g=0;g<e.length;g++)if(d.model.getParent(b[f])==e[g]){c[f].swimlaneIndex=g;break}g=a.getEdges(b[f]);c[f].connectsAsSource=[];for(var k=0;k<g.length;k++){var l=a.getVisibleTerminal(g[k],!1);if(l!=b[f]&&a.graph.model.isVertex(l)&&!a.isVertexIgnored(l)){var m=a.getEdgesBetween(b[f],l,!1); l=a.getEdgesBetween(b[f],l,!0);if(null!=m&&0<m.length&&null==this.edgeMapper.get(m[0])&&2*l.length>=m.length){l=new mxGraphHierarchyEdge(m);for(var n=0;n<m.length;n++){var p=m[n];this.edgeMapper.put(p,l);d.resetEdge(p);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(p,!1),a.setOrthogonalEdge(p,!0))}l.source=c[f];0>mxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;c<this.roots.length;c++){var d=this.vertexMapper.get(this.roots[c]);this.maxChainDfs(null,d,null,b,0);null!=d&&a.push(d)}d=[];b=[];for(c=this.ranksPerGroup.length-1;0<=c;c--)d[c]=c==this.ranksPerGroup.length-1?0:b[c+1]+1,b[c]=d[c]+this.ranksPerGroup[c];this.maxRank=b[0];d=this.vertexMapper.getValues();for(c=0;c<d.length;c++)d[c].temp[0]=-1;for(a.slice();0<a.length;){d=a[0];var e=d.connectsAsTarget, f=d.connectsAsSource,g=!0,k=b[0];for(c=0;c<e.length;c++){var l=e[c];if(5270620==l.temp[0])l=l.source,k=Math.min(k,l.temp[0]-1);else{g=!1;break}}if(g){k>b[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;c<f.length;c++)l=f[c],l.temp[0]=5270620,l=l.target,-1==l.temp[0]&&(a.push(l),l.temp[0]=-2);a.shift()}else if(c=a.shift(),a.push(d),c==d&&1==a.length)break}}; mxSwimlaneModel.prototype.maxChainDfs=function(a,b,c,d,e){if(null!=b&&(a=mxCellPath.create(b.cell),null==d[a])){d[a]=b;a=b.swimlaneIndex;if(null==this.ranksPerGroup[a]||this.ranksPerGroup[a]<e)this.ranksPerGroup[a]=e;a=b.connectsAsSource.slice();for(c=0;c<a.length;c++){var f=a[c],g=f.target;b.swimlaneIndex<g.swimlaneIndex?this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),0):b.swimlaneIndex==g.swimlaneIndex&&this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),e+1)}}}; mxSwimlaneModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp= [],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxSwimlaneModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}}; mxSwimlaneModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}}; mxSwimlaneModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g]){e[g]=b;d(a,b,c,k,0);a=b.connectsAsSource.slice();c=b.connectsAsTarget.slice();for(g=0;g<a.length;g++){f=a[g];var l=f.target;b.swimlaneIndex<=l.swimlaneIndex&&this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}for(g=0;g<c.length;g++)f=c[g],l=f.source,b.swimlaneIndex<l.swimlaneIndex&& this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}else d(a,b,c,k,1)};function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(a){};function mxMedianHybridCrossingReduction(a){this.layout=a}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24; mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2; mxMedianHybridCrossingReduction.prototype.execute=function(a){a=this.layout.getModel();this.nestedBestRanks=[];for(var b=0;b<a.ranks.length;b++)this.nestedBestRanks[b]=a.ranks[b].slice();var c=0,d=this.calculateCrossings(a);for(b=0;b<this.maxIterations&&c<this.maxNoImprovementIterations;b++){this.weightedMedian(b,a);this.transpose(b,a);var e=this.calculateCrossings(a);if(e<d)for(d=e,e=c=0;e<this.nestedBestRanks.length;e++)for(var f=a.ranks[e],g=0;g<f.length;g++){var k=f[g];this.nestedBestRanks[e][k.getGeneralPurposeVariable(e)]= k}else for(c++,e=0;e<this.nestedBestRanks.length;e++)for(f=a.ranks[e],g=0;g<f.length;g++)k=f[g],k.setGeneralPurposeVariable(e,g);if(0==d)break}c=[];d=[];for(b=0;b<a.maxRank+1;b++)d[b]=[],c[b]=d[b];for(b=0;b<this.nestedBestRanks.length;b++)for(e=0;e<this.nestedBestRanks[b].length;e++)d[b].push(this.nestedBestRanks[b][e]);a.ranks=c};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(a){for(var b=a.ranks.length,c=0,d=1;d<b;d++)c+=this.calculateRankCrossing(d,a);return c}; mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(a,b){var c=0,d=b.ranks[a],e=b.ranks[a-1],f=[];for(b=0;b<d.length;b++){var g=d[b],k=g.getGeneralPurposeVariable(a);g=g.getPreviousLayerConnectedCells(a);for(var l=[],m=0;m<g.length;m++){var n=g[m].getGeneralPurposeVariable(a-1);l.push(n)}l.sort(function(p,q){return p-q});f[k]=l}a=[];for(b=0;b<f.length;b++)a=a.concat(f[b]);for(d=1;d<e.length;)d<<=1;f=2*d-1;--d;e=[];for(b=0;b<f;++b)e[b]=0;for(b=0;b<a.length;b++)for(f=a[b]+d,++e[f];0< f;)f%2&&(c+=e[f+1]),f=f-1>>1,++e[f];return c}; mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;){var e=1==a%2&&1==d%2;c=!1;for(var f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],k=[],l=0;l<g.length;l++){var m=g[l],n=m.getGeneralPurposeVariable(f);0>n&&(n=l);k[n]=m}var p=null,q=null,r=null,t=null,u=null;for(l=0;l<g.length-1;l++){if(0==l){var v=k[l];m=v.getNextLayerConnectedCells(f);n=v.getPreviousLayerConnectedCells(f);for(var y=[],A=[],z=0;z<m.length;z++)y[z]=m[z].getGeneralPurposeVariable(f+1);for(z= 0;z<n.length;z++)A[z]=n[z].getGeneralPurposeVariable(f-1)}else m=p,n=q,y=r,A=t,v=u;u=k[l+1];p=u.getNextLayerConnectedCells(f);q=u.getPreviousLayerConnectedCells(f);r=[];t=[];for(z=0;z<p.length;z++)r[z]=p[z].getGeneralPurposeVariable(f+1);for(z=0;z<q.length;z++)t[z]=q[z].getGeneralPurposeVariable(f-1);var x=0,C=0;for(z=0;z<y.length;z++)for(var D=0;D<r.length;D++)y[z]>r[D]&&x++,y[z]<r[D]&&C++;for(z=0;z<A.length;z++)for(D=0;D<t.length;D++)A[z]>t[D]&&x++,A[z]<t[D]&&C++;if(C<x||C==x&&e)p=v.getGeneralPurposeVariable(f), v.setGeneralPurposeVariable(f,u.getGeneralPurposeVariable(f)),u.setGeneralPurposeVariable(f,p),p=m,q=n,r=y,t=A,u=v,e||(c=!0)}}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){if(a=0==a%2)for(var c=b.maxRank-1;0<=c;c--)this.medianRank(c,a);else for(c=1;c<b.maxRank;c++)this.medianRank(c,a)}; mxMedianHybridCrossingReduction.prototype.medianRank=function(a,b){for(var c=this.nestedBestRanks[a].length,d=[],e=[],f=0;f<c;f++){var g=this.nestedBestRanks[a][f],k=new MedianCellSorter;k.cell=g;var l=b?g.getNextLayerConnectedCells(a):g.getPreviousLayerConnectedCells(a),m=b?a+1:a-1;null!=l&&0!=l.length?(k.medianValue=this.medianValue(l,m),d.push(k)):e[g.getGeneralPurposeVariable(a)]=!0}d.sort(MedianCellSorter.prototype.compare);for(f=0;f<c;f++)null==e[f]&&(g=d.shift().cell,g.setGeneralPurposeVariable(a, f))};mxMedianHybridCrossingReduction.prototype.medianValue=function(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];c[d++]=f.getGeneralPurposeVariable(b)}c.sort(function(g,k){return g-k});if(1==d%2)return c[Math.floor(d/2)];if(2==d)return(c[0]+c[1])/2;a=d/2;b=c[a-1]-c[0];d=c[d-1]-c[a];return(c[a-1]*d+c[a]*b)/(b+d)};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=!1; MedianCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.medianValue>a.medianValue?-1:b.medianValue<a.medianValue?1:0:0};function mxMinimumCycleRemover(a){this.layout=a}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null; mxMinimumCycleRemover.prototype.execute=function(a){a=this.layout.getModel();for(var b={},c=a.vertexMapper.getValues(),d={},e=0;e<c.length;e++)d[c[e].id]=c[e];c=null;if(null!=a.roots){var f=a.roots;c=[];for(e=0;e<f.length;e++)c[e]=a.vertexMapper.get(f[e])}a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget),k.connectsAsSource.push(l));b[k.id]=k;delete d[k.id]},c,!0,null);e=mxUtils.clone(b,null, !0);a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),k.connectsAsSource.push(l),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget));b[k.id]=k;delete d[k.id]},d,!0,e)};function mxCoordinateAssignment(a,b,c,d,e,f){this.layout=a;this.intraCellSpacing=b;this.interRankCellSpacing=c;this.orientation=d;this.initialX=e;this.parallelEdgeSpacing=f}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage; mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12; mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null; mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=!0;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10; mxCoordinateAssignment.prototype.printStatus=function(){var a=this.layout.getModel();mxLog.show();mxLog.writeln("======Coord assignment debug=======");for(var b=0;b<a.ranks.length;b++){mxLog.write("Rank ",b," : ");for(var c=a.ranks[b],d=0;d<c.length;d++)mxLog.write(c[d].getGeneralPurposeVariable(b)," ");mxLog.writeln()}mxLog.writeln("====================================")}; mxCoordinateAssignment.prototype.execute=function(a){this.jettyPositions={};a=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),a);this.fineTuning&&this.minNode(a);var b=1E8;if(this.fineTuning)for(var c=0;c<this.maxIterations;c++){0!=c&&(this.medianPos(c,a),this.minNode(a));if(this.currentXDelta<b){for(var d=0;d<a.ranks.length;d++)for(var e=a.ranks[d],f=0;f<e.length;f++){var g=e[f];g.setX(d,g.getGeneralPurposeVariable(d))}b=this.currentXDelta}else for(d=0;d<a.ranks.length;d++)for(e= a.ranks[d],f=0;f<e.length;f++)g=e[f],g.setGeneralPurposeVariable(d,g.getX(d));this.minPath(this.layout.getGraph(),a);this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),a)}; mxCoordinateAssignment.prototype.minNode=function(a){for(var b=[],c=new mxDictionary,d=[],e=0;e<=a.maxRank;e++){d[e]=a.ranks[e];for(var f=0;f<d[e].length;f++){var g=d[e][f],k=new WeightedCellSorter(g,e);k.rankIndex=f;k.visited=!0;b.push(k);c.put(g,k)}}a=10*b.length;for(f=0;0<b.length&&f<=a;){g=b.shift();e=g.cell;var l=g.weightedValue,m=parseInt(g.rankIndex);k=e.getNextLayerConnectedCells(l);var n=e.getPreviousLayerConnectedCells(l),p=k.length,q=n.length,r=this.medianXValue(k,l+1),t=this.medianXValue(n, l-1),u=p+q,v=e.getGeneralPurposeVariable(l),y=v;0<u&&(y=(r*p+t*q)/u);p=!1;y<v-1?0==m?(e.setGeneralPurposeVariable(l,y),p=!0):(m=d[l][m-1],v=m.getGeneralPurposeVariable(l),v=v+m.width/2+this.intraCellSpacing+e.width/2,v<y?(e.setGeneralPurposeVariable(l,y),p=!0):v<e.getGeneralPurposeVariable(l)-1&&(e.setGeneralPurposeVariable(l,v),p=!0)):y>v+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,y),p=!0):(m=d[l][m+1],v=m.getGeneralPurposeVariable(l),v=v-m.width/2-this.intraCellSpacing-e.width/2,v>y?(e.setGeneralPurposeVariable(l, y),p=!0):v>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,v),p=!0)));if(p){for(e=0;e<k.length;e++)l=k[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l));for(e=0;e<n.length;e++)l=n[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(a=b.maxRank;0<a;a--)this.rankMedianPosition(a-1,b,a);else for(a=0;a<b.maxRank-1;a++)this.rankMedianPosition(a+1,b,a)}; mxCoordinateAssignment.prototype.rankMedianPosition=function(a,b,c){b=b.ranks[a];for(var d=[],e={},f=0;f<b.length;f++){var g=b[f];d[f]=new WeightedCellSorter;d[f].cell=g;d[f].rankIndex=f;e[g.id]=d[f];var k=c<a?g.getPreviousLayerConnectedCells(a):g.getNextLayerConnectedCells(a);d[f].weightedValue=this.calculatedWeightedValue(g,k)}d.sort(WeightedCellSorter.prototype.compare);for(f=0;f<d.length;f++){g=d[f].cell;var l=0;k=c<a?g.getPreviousLayerConnectedCells(a).slice():g.getNextLayerConnectedCells(a).slice(); null!=k&&(l=k.length,l=0<l?this.medianXValue(k,c):g.getGeneralPurposeVariable(a));var m=0;k=-1E8;for(var n=d[f].rankIndex-1;0<=n;){var p=e[b[n].id];if(null!=p){var q=p.cell;p.visited?(k=q.getGeneralPurposeVariable(a)+q.width/2+this.intraCellSpacing+m+g.width/2,n=-1):(m+=q.width+this.intraCellSpacing,n--)}}m=0;q=1E8;for(n=d[f].rankIndex+1;n<d.length;)if(p=e[b[n].id],null!=p){var r=p.cell;p.visited?(q=r.getGeneralPurposeVariable(a)-r.width/2-this.intraCellSpacing-m-g.width/2,n=d.length):(m+=r.width+ this.intraCellSpacing,n++)}l>=k&&l<=q?g.setGeneralPurposeVariable(a,l):l<k?(g.setGeneralPurposeVariable(a,k),this.currentXDelta+=k-l):l>q&&(g.setGeneralPurposeVariable(a,q),this.currentXDelta+=l-q);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=b[d];a.isVertex()&&e.isVertex()?c++:c=a.isEdge()&&e.isEdge()?c+8:c+2}return c}; mxCoordinateAssignment.prototype.medianXValue=function(a,b){if(0==a.length)return 0;for(var c=[],d=0;d<a.length;d++)c[d]=a[d].getGeneralPurposeVariable(b);c.sort(function(e,f){return e-f});if(1==a.length%2)return c[Math.floor(a.length/2)];a=a.length/2;return(c[a-1]+c[a])/2}; mxCoordinateAssignment.prototype.initialCoords=function(a,b){this.calculateWidestRank(a,b);for(var c=this.widestRank;0<=c;c--)c<b.maxRank&&this.rankCoordinates(c,a,b);for(c=this.widestRank+1;c<=b.maxRank;c++)0<c&&this.rankCoordinates(c,a,b)}; mxCoordinateAssignment.prototype.rankCoordinates=function(a,b,c){b=c.ranks[a];c=this.initialX+(this.widestRankValue-this.rankWidths[a])/2;for(var d=!1,e=0;e<b.length;e++){var f=b[e];if(f.isVertex()){var g=this.layout.getVertexBounds(f.cell);null!=g?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(f.width=g.width,f.height=g.height):(f.width=g.height,f.height=g.width):d=!0}else f.isEdge()&&(g=1,null!=f.edges?g=f.edges.length:mxLog.warn("edge.edges is null"), f.width=(g-1)*this.parallelEdgeSpacing);c+=f.width/2;f.setX(a,c);f.setGeneralPurposeVariable(a,c);c+=f.width/2;c+=this.intraCellSpacing}1==d&&mxLog.warn("At least one cell has no bounds")}; mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){a=-this.interRankCellSpacing;var c=0;this.rankWidths=[];this.rankY=[];for(var d=b.maxRank;0<=d;d--){for(var e=0,f=b.ranks[d],g=this.initialX,k=!1,l=0;l<f.length;l++){var m=f[l];if(m.isVertex()){var n=this.layout.getVertexBounds(m.cell);null!=n?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(m.width=n.width,m.height=n.height):(m.width=n.height,m.height=n.width):k=!0;e=Math.max(e,m.height)}else m.isEdge()&& (n=1,null!=m.edges?n=m.edges.length:mxLog.warn("edge.edges is null"),m.width=(n-1)*this.parallelEdgeSpacing);g+=m.width/2;m.setX(d,g);m.setGeneralPurposeVariable(d,g);g+=m.width/2;g+=this.intraCellSpacing;g>this.widestRankValue&&(this.widestRankValue=g,this.widestRank=d);this.rankWidths[d]=g}1==k&&mxLog.warn("At least one cell has no bounds");this.rankY[d]=a;g=e/2+c/2+this.interRankCellSpacing;c=e;a=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?a+g:a- g;for(l=0;l<f.length;l++)f[l].setY(d,a)}}; mxCoordinateAssignment.prototype.minPath=function(a,b){a=b.edgeMapper.getValues();for(var c=0;c<a.length;c++){var d=a[c];if(!(1>d.maxRank-d.minRank-1)){for(var e=d.getGeneralPurposeVariable(d.minRank+1),f=!0,g=0,k=d.minRank+2;k<d.maxRank;k++){var l=d.getGeneralPurposeVariable(k);e!=l?(f=!1,e=l):g++}if(!f){f=e=0;l=[];var m=[],n=d.getGeneralPurposeVariable(d.minRank+1);for(k=d.minRank+1;k<d.maxRank-1;k++){var p=d.getX(k+1);n==p?(l[k-d.minRank-1]=n,e++):this.repositionValid(b,d,k+1,n)?(l[k-d.minRank- 1]=n,e++):n=l[k-d.minRank-1]=p}n=d.getX(k);for(k=d.maxRank-1;k>d.minRank+1;k--)p=d.getX(k-1),n==p?(m[k-d.minRank-2]=n,f++):this.repositionValid(b,d,k-1,n)?(m[k-d.minRank-2]=n,f++):(m[k-d.minRank-2]=d.getX(k-1),n=p);if(f>g||e>g)if(f>=e)for(k=d.maxRank-2;k>d.minRank;k--)d.setX(k,m[k-d.minRank-1]);else if(e>f)for(k=d.minRank+2;k<d.maxRank;k++)d.setX(k,l[k-d.minRank-2])}}}}; mxCoordinateAssignment.prototype.repositionValid=function(a,b,c,d){a=a.ranks[c];for(var e=-1,f=0;f<a.length;f++)if(b==a[f]){e=f;break}if(0>e)return!1;f=b.getGeneralPurposeVariable(c);if(d<f){if(0==e)return!0;a=a[e-1];c=a.getGeneralPurposeVariable(c);c=c+a.width/2+this.intraCellSpacing+b.width/2;if(!(c<=d))return!1}else if(d>f){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0}; mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(a=0;a<b.ranks.length;a++)this.rankTopY[a]=Number.MAX_VALUE,this.rankBottomY[a]=-Number.MAX_VALUE;var c=b.vertexMapper.getValues();for(a=0;a<c.length;a++)this.setVertexLocation(c[a]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(b);b=b.edgeMapper.getValues(); for(a=0;a<b.length;a++)this.setEdgePosition(b[a])}; mxCoordinateAssignment.prototype.localEdgeProcessing=function(a){for(var b=0;b<a.ranks.length;b++)for(var c=a.ranks[b],d=0;d<c.length;d++){var e=c[d];if(e.isVertex())for(var f=e.getPreviousLayerConnectedCells(b),g=b-1,k=0;2>k;k++){if(-1<g&&g<a.ranks.length&&null!=f&&0<f.length){for(var l=[],m=0;m<f.length;m++){var n=new WeightedCellSorter(f[m],f[m].getX(g));l.push(n)}l.sort(WeightedCellSorter.prototype.compare);n=e.x[0]-e.width/2;var p=n+e.width,q=f=0;g=[];for(m=0;m<l.length;m++){var r=l[m].cell; if(r.isVertex())for(var t=0==k?e.connectsAsSource:e.connectsAsTarget,u=0;u<t.length;u++){if(t[u].source==r||t[u].target==r)f+=t[u].edges.length,q++,g.push(t[u])}else f+=r.edges.length,q++,g.push(r)}e.width>(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=0;m<g.length;m++)for(q=g[m].edges.length,r=this.jettyPositions[g[m].ids[0]],null==r&&(r=[],this.jettyPositions[g[m].ids[0]]=r),m<f/2?p+= this.prefVertEdgeOff:m>f/2&&(p-=this.prefVertEdgeOff),t=0;t<q;t++)r[4*t+2*k]=n,n+=l,r[4*t+2*k+1]=p}f=e.getNextLayerConnectedCells(b);g=b+1}}}; mxCoordinateAssignment.prototype.setEdgePosition=function(a){var b=0;if(101207!=a.temp[0]){var c=a.maxRank,d=a.minRank;c==d&&(c=a.source.maxRank,d=a.target.minRank);for(var e=0,f=this.jettyPositions[a.ids[0]],g=a.isReversed?a.target.cell:a.source.cell,k=this.layout.graph,l=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,m=0;m<a.edges.length;m++){var n=a.edges[m],p=this.layout.getVisibleTerminal(n,!0),q=[],r=a.isReversed;p!=g&&(r=!r);if(null!=f){var t=r? 2:0,u=r?l?this.rankBottomY[d]:this.rankTopY[d]:l?this.rankTopY[c]:this.rankBottomY[c],v=f[4*e+1+t];r!=l&&(v=-v);u+=v;t=f[4*e+t];var y=k.model.getTerminal(n,!0);this.layout.isPort(y)&&k.model.getParent(y)==p&&(t=k.view.getState(y),t=null!=t?t.x:p.geometry.x+a.source.width*y.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(t,u)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(t,u+v))):(q.push(new mxPoint(u, t)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(u+v,t)))}t=a.x.length-1;u=v=-1;p=a.maxRank-1;for(r&&(t=0,v=a.x.length,u=1,p=a.minRank+1);a.maxRank!=a.minRank&&t!=v;t+=u){y=a.x[t]+b;var A=(this.rankTopY[p]+this.rankBottomY[p+1])/2,z=(this.rankTopY[p-1]+this.rankBottomY[p])/2;if(r){var x=A;A=z;z=x}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(y,A)),q.push(new mxPoint(y,z))):(q.push(new mxPoint(A,y)),q.push(new mxPoint(z, y)));this.limitX=Math.max(this.limitX,y);p+=u}null!=f&&(t=r?2:0,u=r?l?this.rankTopY[c]:this.rankBottomY[c]:l?this.rankBottomY[d]:this.rankTopY[d],v=f[4*e+3-t],r!=l&&(v=-v),u-=v,t=f[4*e+2-t],r=k.model.getTerminal(n,!1),p=this.layout.getVisibleTerminal(n,!1),this.layout.isPort(r)&&k.model.getParent(r)==p&&(t=k.view.getState(r),t=null!=t?t.x:p.geometry.x+a.target.width*r.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&& q.push(new mxPoint(t,u-v)),q.push(new mxPoint(t,u))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(u-v,t)),q.push(new mxPoint(u,t))));a.isReversed&&this.processReversedEdge(a,n);this.layout.setEdgePoints(n,q);this.layout.resetEdgeLabels&&null!=n.geometry&&(geometry=n.geometry.clone(),geometry.relative=!0,geometry.x=0,geometry.y=0,k.model.setGeometry(n,geometry));b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}}; mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)}; mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function mxSwimlaneOrdering(a){this.layout=a}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null; mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots){var d=a.roots;c=[];for(var e=0;e<d.length;e++)c[e]=a.vertexMapper.get(d[e])}a.visit(function(f,g,k,l,m){l=null!=f&&f.swimlaneIndex==g.swimlaneIndex&&g.isAncestor(f);m=null!=f&&null!=k&&f.swimlaneIndex<g.swimlaneIndex&&k.source==g;l?(k.invert(),mxUtils.remove(k,f.connectsAsSource),g.connectsAsSource.push(k),f.connectsAsTarget.push(k),mxUtils.remove(k,g.connectsAsTarget)): m&&(k.invert(),mxUtils.remove(k,f.connectsAsTarget),g.connectsAsTarget.push(k),f.connectsAsSource.push(k),mxUtils.remove(k,g.connectsAsSource));f=mxCellPath.create(g.cell);delete b[f]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout; mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=!1;mxHierarchicalLayout.prototype.maintainParentLocation=!1;mxHierarchicalLayout.prototype.moveParent=!1;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60; mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=!0;mxHierarchicalLayout.prototype.tightenToSource=!0;mxHierarchicalLayout.prototype.disableEdgeStyle=!0;mxHierarchicalLayout.prototype.resetEdgeLabels=!0;mxHierarchicalLayout.prototype.traverseAncestors=!0;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null; mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model}; mxHierarchicalLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;null==b||b instanceof Array||(b=[b]);if(null!=b||null!=a){this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}if(null!=b){for(var e=[],f=0;f<b.length;f++)(null!=a?c.isAncestor(a, b[f]):1)&&c.isVertex(b[f])&&e.push(b[f]);this.roots=e}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d)))}finally{c.endUpdate()}}}; mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){a=this.graph.model;var d=null,e=-1E5,f;for(f in b){var g=b[f];if(a.isVertex(g)&&this.graph.isCellVisible(g)){for(var k=this.getEdges(g),l=0,m=0,n=0;n<k.length;n++)this.getVisibleTerminal(k[n],!0)==g?l++:m++;0==m&&0<l&&c.push(g);k=l-m;k>e&&(e=k,d=g)}}0==c.length&&null!=d&&c.push(d)}return c}; mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null== this.parent||this.isAncestor(this.parent,d,this.traverseAncestors))||d==a&&(null==this.parent||this.isAncestor(this.parent,e,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c}; mxHierarchicalLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e}; mxHierarchicalLayout.prototype.run=function(a){var b=[],c=[];if(null==this.roots&&null!=a){var d={};this.filterDescendants(a,d);this.roots=[];var e=!0,f;for(f in d)if(null!=d[f]){e=!1;break}for(;!e;){var g=this.findRoots(a,d);for(e=0;e<g.length;e++){var k={};b.push(k);this.traverse(g[e],!0,null,c,k,b,d)}for(e=0;e<g.length;e++)this.roots.push(g[e]);e=!0;for(f in d)if(null!=d[f]){e=!1;break}}}else for(e=0;e<this.roots.length;e++)k={},b.push(k),this.traverse(this.roots[e],!0,null,c,k,b,null);for(e=c= 0;e<b.length;e++){k=b[e];d=[];for(f in k)d.push(k[f]);this.model=new mxGraphHierarchyModel(this,d,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);c=this.placementStage(c,a)}}; mxHierarchicalLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxHierarchicalLayout.prototype.isPort=function(a){return null!=a&&null!=a.geometry?a.geometry.relative:!1}; mxHierarchicalLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e}; mxHierarchicalLayout.prototype.traverse=function(a,b,c,d,e,f,g){if(null!=a&&null!=d){var k=mxObjectIdentity.get(a);if(null==d[k]&&(null==g||null!=g[k])){null==e[k]&&(e[k]=a);null==d[k]&&(d[k]=a);null!==g&&delete g[k];var l=this.getEdges(a);k=[];for(c=0;c<l.length;c++)k[c]=this.getVisibleTerminal(l[c],!0)==a;for(c=0;c<l.length;c++)if(!b||k[c]){a=this.getVisibleTerminal(l[c],!k[c]);for(var m=1,n=0;n<l.length;n++)if(n!=c){var p=k[n];this.getVisibleTerminal(l[n],!p)==a&&(p?m++:m--)}0<=m&&(e=this.traverse(a, b,l[c],d,e,f,g))}}else if(null==e[k])for(c=0;c<f.length;c++)if(b=f[c],null!=b[k]){for(l in b)e[l]=b[l];f.splice(c,1);break}}return e};mxHierarchicalLayout.prototype.cycleStage=function(a){(new mxMinimumCycleRemover(this)).execute(a)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)}; mxHierarchicalLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxSwimlaneLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}mxSwimlaneLayout.prototype=new mxGraphLayout; mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=!1;mxSwimlaneLayout.prototype.maintainParentLocation=!1;mxSwimlaneLayout.prototype.moveParent=!1;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;mxSwimlaneLayout.prototype.interRankCellSpacing=100; mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=!0;mxSwimlaneLayout.prototype.tightenToSource=!0;mxSwimlaneLayout.prototype.disableEdgeStyle=!0;mxSwimlaneLayout.prototype.traverseAncestors=!0;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null; mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model}; mxSwimlaneLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(!(null==b||1>b.length)){null==a&&(a=c.getParent(b[0]));this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}this.swimlanes=b;for(var e=[],f=0;f<b.length;f++){var g=this.graph.getChildCells(b[f]); if(null==g||0==g.length)g=this.graph.insertVertex(b[f],null,null,0,0,this.dummyVertexWidth,0),e.push(g)}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d))),this.graph.removeCells(e)}finally{c.endUpdate()}}}; mxSwimlaneLayout.prototype.updateGroupBounds=function(){var a=[],b=this.model;for(f in b.edgeMapper)for(var c=b.edgeMapper[f],d=0;d<c.edges.length;d++)a.push(c.edges[d]);a=this.graph.getBoundingBoxFromGeometry(a,!0);b=[];for(d=0;d<this.swimlanes.length;d++){var e=this.swimlanes[d],f=this.graph.getCellGeometry(e);if(null!=f){var g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;e=this.graph.getBoundingBoxFromGeometry(g);b[d]=e;c=e.y+f.y-c.height-this.parentBorder; f=e.y+f.y+e.height;null==a?a=new mxRectangle(0,c,0,f-c):(a.y=Math.min(a.y,c),a.height=Math.max(a.y+a.height,f)-a.y)}}for(d=0;d<this.swimlanes.length;d++)if(e=this.swimlanes[d],f=this.graph.getCellGeometry(e),null!=f){g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;var k=f.clone(),l=c.width+(0==d?this.parentBorder:this.interRankCellSpacing/2),m=b[d].x-l,n=a.y-this.parentBorder;k.x+=m;k.y=n;k.width=b[d].width+l+this.interRankCellSpacing/2;k.height= a.height+c.height+2*this.parentBorder;this.graph.model.setGeometry(e,k);this.graph.moveCells(g,-m,f.y-n)}}; mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(null!=k&&d.isVertex(k)&&this.graph.isCellVisible(k)&&d.isAncestor(a,k)){for(var l=this.getEdges(k),m=0,n=0,p=0;p<l.length;p++){var q=this.getVisibleTerminal(l[p],!0);q==k?(q=this.getVisibleTerminal(l[p],!1),d.isAncestor(a,q)&&m++):d.isAncestor(a,q)&&n++}0==n&&0<m&&c.push(k);l=m-n;l>f&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxSwimlaneLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null== this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))||d==a&&(null==this.parent||this.graph.isValidAncestor(e,this.parent,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c}; mxSwimlaneLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e}; mxSwimlaneLayout.prototype.run=function(a){var b=[],c={};if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=a){for(var d={},e=0;e<this.swimlanes.length;e++)this.filterDescendants(this.swimlanes[e],d);this.roots=[];e=!0;for(var f in d)if(null!=d[f]){e=!1;break}for(var g=0;!e&&g<this.swimlanes.length;){var k=this.findRoots(this.swimlanes[g],d);if(0==k.length)g++;else{for(e=0;e<k.length;e++){var l={};b.push(l);this.traverse(k[e],!0,null,c,l,b,d,g)}for(e=0;e<k.length;e++)this.roots.push(k[e]);e= !0;for(f in d)if(null!=d[f]){e=!1;break}}}}else for(e=0;e<this.roots.length;e++)l={},b.push(l),this.traverse(this.roots[e],!0,null,c,l,b,null);b=[];for(f in c)b.push(c[f]);this.model=new mxSwimlaneModel(this,b,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);this.placementStage(0,a)}; mxSwimlaneLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&c.getParent(a)!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxSwimlaneLayout.prototype.isPort=function(a){return a.geometry.relative?!0:!1}; mxSwimlaneLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e}; mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=d){var l=mxObjectIdentity.get(a);if(null==d[l]&&(null==g||null!=g[l])){null==e[l]&&(e[l]=a);null==d[l]&&(d[l]=a);null!==g&&delete g[l];var m=this.getEdges(a);l=this.graph.model;for(c=0;c<m.length;c++){var n=this.getVisibleTerminal(m[c],!0),p=n==a;p&&(n=this.getVisibleTerminal(m[c],!1));for(var q=0;q<this.swimlanes.length&&!l.isAncestor(this.swimlanes[q],n);)q++;q>=this.swimlanes.length||!(q>k||(!b||p)&&q==k)||(e=this.traverse(n, b,m[c],d,e,f,g,q))}}else if(null==e[l])for(c=0;c<f.length;c++)if(a=f[c],null!=a[l]){for(m in a)e[m]=a[m];f.splice(c,1);break}}return e};mxSwimlaneLayout.prototype.cycleStage=function(a){(new mxSwimlaneOrdering(this)).execute(a)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)}; mxSwimlaneLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxGraphModel(a){this.currentEdit=this.createUndoableEdit();null!=a?this.setRoot(a):this.clear()}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null; mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=!0;mxGraphModel.prototype.ignoreRelativeEdgeParent=!0;mxGraphModel.prototype.createIds=!0;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=!1;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds}; mxGraphModel.prototype.setCreateIds=function(a){this.createIds=a};mxGraphModel.prototype.createRoot=function(){var a=new mxCell;a.insert(new mxCell);return a};mxGraphModel.prototype.getCells=function(){var a=[];if(null!=this.cells)for(var b in this.cells)a.push(this.cells[b]);return a};mxGraphModel.prototype.getCellCount=function(){var a=0;if(null!=this.cells)for(var b in this.cells)a++;return a};mxGraphModel.prototype.getCell=function(a){return null!=this.cells?this.cells[a]:null}; mxGraphModel.prototype.filterCells=function(a,b){var c=null;if(null!=a){c=[];for(var d=0;d<a.length;d++)b(a[d])&&c.push(a[d])}return c};mxGraphModel.prototype.getDescendants=function(a){return this.filterDescendants(null,a)};mxGraphModel.prototype.filterDescendants=function(a,b){var c=[];b=b||this.getRoot();(null==a||a(b))&&c.push(b);for(var d=this.getChildCount(b),e=0;e<d;e++){var f=this.getChildAt(b,e);c=c.concat(this.filterDescendants(a,f))}return c}; mxGraphModel.prototype.getRoot=function(a){var b=a||this.root;if(null!=a)for(;null!=a;)b=a,a=this.getParent(a);return b};mxGraphModel.prototype.setRoot=function(a){this.execute(new mxRootChange(this,a));return a};mxGraphModel.prototype.rootChanged=function(a){var b=this.root;this.root=a;this.nextId=0;this.cells=null;this.cellAdded(a);return b};mxGraphModel.prototype.isRoot=function(a){return null!=a&&this.root==a};mxGraphModel.prototype.isLayer=function(a){return this.isRoot(this.getParent(a))}; mxGraphModel.prototype.isAncestor=function(a,b){for(;null!=b&&b!=a;)b=this.getParent(b);return b==a};mxGraphModel.prototype.contains=function(a){return this.isAncestor(this.root,a)};mxGraphModel.prototype.getParent=function(a){return null!=a?a.getParent():null};mxGraphModel.prototype.add=function(a,b,c){if(b!=a&&null!=a&&null!=b){null==c&&(c=this.getChildCount(a));var d=a!=this.getParent(b);this.execute(new mxChildChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParents(b)}return b}; mxGraphModel.prototype.cellAdded=function(a){if(null!=a){null==a.getId()&&this.createIds&&a.setId(this.createId(a));if(null!=a.getId()){var b=this.getCell(a.getId());if(b!=a){for(;null!=b;)a.setId(this.createId(a)),b=this.getCell(a.getId());null==this.cells&&(this.cells=Object.create(null));this.cells[a.getId()]=a}}mxUtils.isNumeric(a.getId())&&(this.nextId=Math.max(this.nextId,a.getId()));b=this.getChildCount(a);for(var c=0;c<b;c++)this.cellAdded(this.getChildAt(a,c))}}; mxGraphModel.prototype.createId=function(a){a=this.nextId;this.nextId++;return this.prefix+a+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(a,b){b=b||this.getRoot(a);for(var c=this.getChildCount(a),d=0;d<c;d++){var e=this.getChildAt(a,d);this.updateEdgeParents(e,b)}e=this.getEdgeCount(a);c=[];for(d=0;d<e;d++)c.push(this.getEdgeAt(a,d));for(d=0;d<c.length;d++)a=c[d],this.isAncestor(b,a)&&this.updateEdgeParent(a,b)}; mxGraphModel.prototype.updateEdgeParent=function(a,b){for(var c=this.getTerminal(a,!0),d=this.getTerminal(a,!1);null!=c&&!this.isEdge(c)&&null!=c.geometry&&c.geometry.relative;)c=this.getParent(c);for(;null!=d&&this.ignoreRelativeEdgeParent&&!this.isEdge(d)&&null!=d.geometry&&d.geometry.relative;)d=this.getParent(d);if(this.isAncestor(b,c)&&this.isAncestor(b,d)&&(b=c==d?this.getParent(c):this.getNearestCommonAncestor(c,d),null!=b&&(this.getParent(b)!=this.root||this.isAncestor(b,a))&&this.getParent(a)!= b)){c=this.getGeometry(a);if(null!=c){var e=this.getOrigin(this.getParent(a)),f=this.getOrigin(b);d=f.x-e.x;e=f.y-e.y;c=c.clone();c.translate(-d,-e);this.setGeometry(a,c)}this.add(b,a,this.getChildCount(b))}};mxGraphModel.prototype.getOrigin=function(a){if(null!=a){var b=this.getOrigin(this.getParent(a));this.isEdge(a)||(a=this.getGeometry(a),null!=a&&(b.x+=a.x,b.y+=a.y))}else b=new mxPoint;return b}; mxGraphModel.prototype.getNearestCommonAncestor=function(a,b){if(null!=a&&null!=b){var c=mxCellPath.create(b);if(null!=c&&0<c.length){var d=mxCellPath.create(a);for(c.length<d.length&&(a=b,b=d,d=c,c=b);null!=a;){b=this.getParent(a);if(0==c.indexOf(d+mxCellPath.PATH_SEPARATOR)&&null!=b)return a;d=mxCellPath.getParentPath(d);a=b}}}return null};mxGraphModel.prototype.remove=function(a){a==this.root?this.setRoot(null):null!=this.getParent(a)&&this.execute(new mxChildChange(this,null,a));return a}; mxGraphModel.prototype.cellRemoved=function(a){if(null!=a&&null!=this.cells){for(var b=this.getChildCount(a)-1;0<=b;b--)this.cellRemoved(this.getChildAt(a,b));null!=this.cells&&null!=a.getId()&&delete this.cells[a.getId()]}};mxGraphModel.prototype.parentForCellChanged=function(a,b,c){var d=this.getParent(a);null!=b?b==d&&d.getIndex(a)==c||b.insert(a,c):null!=d&&(c=d.getIndex(a),d.remove(c));b=this.contains(b);c=this.contains(d);b&&!c?this.cellAdded(a):c&&!b&&this.cellRemoved(a);return d}; mxGraphModel.prototype.getChildCount=function(a){return null!=a?a.getChildCount():0};mxGraphModel.prototype.getChildAt=function(a,b){return null!=a?a.getChildAt(b):null};mxGraphModel.prototype.getChildren=function(a){return null!=a?a.children:null};mxGraphModel.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraphModel.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)}; mxGraphModel.prototype.getChildCells=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;for(var d=this.getChildCount(a),e=[],f=0;f<d;f++){var g=this.getChildAt(a,f);(!c&&!b||c&&this.isEdge(g)||b&&this.isVertex(g))&&e.push(g)}return e};mxGraphModel.prototype.getTerminal=function(a,b){return null!=a?a.getTerminal(b):null}; mxGraphModel.prototype.setTerminal=function(a,b,c){var d=b!=this.getTerminal(a,c);this.execute(new mxTerminalChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParent(a,this.getRoot());return b};mxGraphModel.prototype.setTerminals=function(a,b,c){this.beginUpdate();try{this.setTerminal(a,b,!0),this.setTerminal(a,c,!1)}finally{this.endUpdate()}}; mxGraphModel.prototype.terminalForCellChanged=function(a,b,c){var d=this.getTerminal(a,c);null!=b?b.insertEdge(a,c):null!=d&&d.removeEdge(a,c);return d};mxGraphModel.prototype.getEdgeCount=function(a){return null!=a?a.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(a,b){return null!=a?a.getEdgeAt(b):null};mxGraphModel.prototype.getDirectedEdgeCount=function(a,b,c){for(var d=0,e=this.getEdgeCount(a),f=0;f<e;f++){var g=this.getEdgeAt(a,f);g!=c&&this.getTerminal(g,b)==a&&d++}return d}; mxGraphModel.prototype.getConnections=function(a){return this.getEdges(a,!0,!0,!1)};mxGraphModel.prototype.getIncomingEdges=function(a){return this.getEdges(a,!0,!1,!1)};mxGraphModel.prototype.getOutgoingEdges=function(a){return this.getEdges(a,!1,!0,!1)}; mxGraphModel.prototype.getEdges=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:!0;d=null!=d?d:!0;for(var e=this.getEdgeCount(a),f=[],g=0;g<e;g++){var k=this.getEdgeAt(a,g),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1);(d&&l==m||l!=m&&(b&&m==a||c&&l==a))&&f.push(k)}return f}; mxGraphModel.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;var d=this.getEdgeCount(a),e=this.getEdgeCount(b),f=a,g=d;e<d&&(g=e,f=b);d=[];for(e=0;e<g;e++){var k=this.getEdgeAt(f,e),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1),n=m==a&&l==b;(l==a&&m==b||!c&&n)&&d.push(k)}return d}; mxGraphModel.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[];if(null!=a)for(var f=0;f<a.length;f++){var g=this.getTerminal(a[f],!0),k=this.getTerminal(a[f],!1);g==b&&null!=k&&k!=b&&d?e.push(k):k==b&&null!=g&&g!=b&&c&&e.push(g)}return e}; mxGraphModel.prototype.getTopmostCells=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<a.length;d++){for(var e=a[d],f=!0,g=this.getParent(e);null!=g;){if(b.get(g)){f=!1;break}g=this.getParent(g)}f&&c.push(e)}return c};mxGraphModel.prototype.isVertex=function(a){return null!=a?a.isVertex():!1};mxGraphModel.prototype.isEdge=function(a){return null!=a?a.isEdge():!1};mxGraphModel.prototype.isConnectable=function(a){return null!=a?a.isConnectable():!1}; mxGraphModel.prototype.getValue=function(a){return null!=a?a.getValue():null};mxGraphModel.prototype.setValue=function(a,b){this.execute(new mxValueChange(this,a,b));return b};mxGraphModel.prototype.valueForCellChanged=function(a,b){return a.valueChanged(b)};mxGraphModel.prototype.getGeometry=function(a){return null!=a?a.getGeometry():null};mxGraphModel.prototype.setGeometry=function(a,b){b!=this.getGeometry(a)&&this.execute(new mxGeometryChange(this,a,b));return b}; mxGraphModel.prototype.geometryForCellChanged=function(a,b){var c=this.getGeometry(a);a.setGeometry(b);return c};mxGraphModel.prototype.getStyle=function(a){return null!=a?a.getStyle():null};mxGraphModel.prototype.setStyle=function(a,b){b!=this.getStyle(a)&&this.execute(new mxStyleChange(this,a,b));return b};mxGraphModel.prototype.styleForCellChanged=function(a,b){var c=this.getStyle(a);a.setStyle(b);return c};mxGraphModel.prototype.isCollapsed=function(a){return null!=a?a.isCollapsed():!1}; mxGraphModel.prototype.setCollapsed=function(a,b){b!=this.isCollapsed(a)&&this.execute(new mxCollapseChange(this,a,b));return b};mxGraphModel.prototype.collapsedStateForCellChanged=function(a,b){var c=this.isCollapsed(a);a.setCollapsed(b);return c};mxGraphModel.prototype.isVisible=function(a){return null!=a?a.isVisible():!1};mxGraphModel.prototype.setVisible=function(a,b){b!=this.isVisible(a)&&this.execute(new mxVisibleChange(this,a,b));return b}; mxGraphModel.prototype.visibleStateForCellChanged=function(a,b){var c=this.isVisible(a);a.setVisible(b);return c};mxGraphModel.prototype.execute=function(a){a.execute();this.beginUpdate();this.currentEdit.add(a);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",a));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",a));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))}; mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT));if(!this.endingUpdate){this.endingUpdate=0==this.updateLevel;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var a=this.currentEdit;this.currentEdit=this.createUndoableEdit();a.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO, "edit",a))}}finally{this.endingUpdate=!1}}};mxGraphModel.prototype.createUndoableEdit=function(a){var b=new mxUndoableEdit(this,null!=a?a:!0);b.notify=function(){b.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",b,"changes",b.changes));b.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",b,"changes",b.changes))};return b}; mxGraphModel.prototype.mergeChildren=function(a,b,c){c=null!=c?c:!0;this.beginUpdate();try{var d={};this.mergeChildrenImpl(a,b,c,d);for(var e in d){var f=d[e],g=this.getTerminal(f,!0);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!0));g=this.getTerminal(f,!1);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!1))}}finally{this.endUpdate()}}; mxGraphModel.prototype.mergeChildrenImpl=function(a,b,c,d){this.beginUpdate();try{for(var e=a.getChildCount(),f=0;f<e;f++){var g=a.getChildAt(f);if("function"==typeof g.getId){var k=g.getId(),l=null==k||this.isEdge(g)&&c?null:this.getCell(k);if(null==l){var m=g.clone();m.setId(k);m.setTerminal(g.getTerminal(!0),!0);m.setTerminal(g.getTerminal(!1),!1);l=b.insert(m);this.cellAdded(l)}d[mxCellPath.create(g)]=l;this.mergeChildrenImpl(g,l,c,d)}}}finally{this.endUpdate()}}; mxGraphModel.prototype.getParents=function(a){var b=[];if(null!=a)for(var c=new mxDictionary,d=0;d<a.length;d++){var e=this.getParent(a[d]);null==e||c.get(e)||(c.put(e,!0),b.push(e))}return b};mxGraphModel.prototype.cloneCell=function(a,b,c){return null!=a?this.cloneCells([a],b,null,c)[0]:null}; mxGraphModel.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:{};d=null!=d?d:!1;for(var e=[],f=0;f<a.length;f++)null!=a[f]?e.push(this.cloneCellImpl(a[f],c,b,d)):e.push(null);for(f=0;f<e.length;f++)null!=e[f]&&this.restoreClone(e[f],a[f],c);return e}; mxGraphModel.prototype.cloneCellImpl=function(a,b,c,d){var e=mxObjectIdentity.get(a),f=b[e];if(null==f&&(f=this.cellCloned(a),b[e]=f,d&&(f.id=a.id),c))for(c=this.getChildCount(a),e=0;e<c;e++){var g=this.cloneCellImpl(this.getChildAt(a,e),b,!0,d);f.insert(g)}return f};mxGraphModel.prototype.cellCloned=function(a){return a.clone()}; mxGraphModel.prototype.restoreClone=function(a,b,c){var d=this.getTerminal(b,!0);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!0));d=this.getTerminal(b,!1);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!1));d=this.getChildCount(a);for(var e=0;e<d;e++)this.restoreClone(this.getChildAt(a,e),this.getChildAt(b,e),c)};function mxRootChange(a,b){this.model=a;this.previous=this.root=b}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)}; function mxChildChange(a,b,c,d){this.model=a;this.previous=this.parent=b;this.child=c;this.previousIndex=this.index=d} mxChildChange.prototype.execute=function(){if(null!=this.child){var a=this.model.getParent(this.child),b=null!=a?a.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1);a=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);null!=this.previous&&this.connect(this.child,!0);this.parent=this.previous;this.previous=a;this.index=this.previousIndex;this.previousIndex=b}}; mxChildChange.prototype.connect=function(a,b){b=null!=b?b:!0;var c=a.getTerminal(!0),d=a.getTerminal(!1);null!=c&&(b?this.model.terminalForCellChanged(a,c,!0):this.model.terminalForCellChanged(a,null,!0));null!=d&&(b?this.model.terminalForCellChanged(a,d,!1):this.model.terminalForCellChanged(a,null,!1));a.setTerminal(c,!0);a.setTerminal(d,!1);c=this.model.getChildCount(a);for(d=0;d<c;d++)this.connect(this.model.getChildAt(a,d),b)}; function mxTerminalChange(a,b,c,d){this.model=a;this.cell=b;this.previous=this.terminal=c;this.source=d}mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))};function mxValueChange(a,b,c){this.model=a;this.cell=b;this.previous=this.value=c} mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))};function mxStyleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.style=c}mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))};function mxGeometryChange(a,b,c){this.model=a;this.cell=b;this.previous=this.geometry=c} mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))};function mxCollapseChange(a,b,c){this.model=a;this.cell=b;this.previous=this.collapsed=c}mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))}; function mxVisibleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.visible=c}mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))};function mxCellAttributeChange(a,b,c){this.cell=a;this.attribute=b;this.previous=this.value=c} mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var a=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous);this.previous=a}};function mxCell(a,b,c){this.value=a;this.setGeometry(b);this.setStyle(c);if(null!=this.onInit)this.onInit()}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=!1; mxCell.prototype.edge=!1;mxCell.prototype.connectable=!0;mxCell.prototype.visible=!0;mxCell.prototype.collapsed=!1;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient="id value parent source target children edges".split(" ");mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(a){this.id=a};mxCell.prototype.getValue=function(){return this.value}; mxCell.prototype.setValue=function(a){this.value=a};mxCell.prototype.valueChanged=function(a){var b=this.getValue();this.setValue(a);return b};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(a){this.geometry=a};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(a){this.style=a};mxCell.prototype.isVertex=function(){return 0!=this.vertex};mxCell.prototype.setVertex=function(a){this.vertex=a}; mxCell.prototype.isEdge=function(){return 0!=this.edge};mxCell.prototype.setEdge=function(a){this.edge=a};mxCell.prototype.isConnectable=function(){return 0!=this.connectable};mxCell.prototype.setConnectable=function(a){this.connectable=a};mxCell.prototype.isVisible=function(){return 0!=this.visible};mxCell.prototype.setVisible=function(a){this.visible=a};mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed};mxCell.prototype.setCollapsed=function(a){this.collapsed=a}; mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(a){this.parent=a};mxCell.prototype.getTerminal=function(a){return a?this.source:this.target};mxCell.prototype.setTerminal=function(a,b){b?this.source=a:this.target=a;return a};mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length};mxCell.prototype.getIndex=function(a){return mxUtils.indexOf(this.children,a)}; mxCell.prototype.getChildAt=function(a){return null==this.children?null:this.children[a]};mxCell.prototype.insert=function(a,b){null!=a&&(null==b&&(b=this.getChildCount(),a.getParent()==this&&b--),a.removeFromParent(),a.setParent(this),null==this.children?(this.children=[],this.children.push(a)):this.children.splice(b,0,a));return a};mxCell.prototype.remove=function(a){var b=null;null!=this.children&&0<=a&&(b=this.getChildAt(a),null!=b&&(this.children.splice(a,1),b.setParent(null)));return b}; mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var a=this.parent.getIndex(this);this.parent.remove(a)}};mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(a){return mxUtils.indexOf(this.edges,a)};mxCell.prototype.getEdgeAt=function(a){return null==this.edges?null:this.edges[a]}; mxCell.prototype.insertEdge=function(a,b){null!=a&&(a.removeFromTerminal(b),a.setTerminal(this,b),null==this.edges||a.getTerminal(!b)!=this||0>mxUtils.indexOf(this.edges,a))&&(null==this.edges&&(this.edges=[]),this.edges.push(a));return a};mxCell.prototype.removeEdge=function(a,b){if(null!=a){if(a.getTerminal(!b)!=this&&null!=this.edges){var c=this.getEdgeIndex(a);0<=c&&this.edges.splice(c,1)}a.setTerminal(null,b)}return a}; mxCell.prototype.removeFromTerminal=function(a){var b=this.getTerminal(a);null!=b&&b.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var b=this.getValue();return null!=b&&b.nodeType==mxConstants.NODETYPE_ELEMENT&&b.hasAttribute?b.hasAttribute(a):null!=b.getAttribute(a)};mxCell.prototype.getAttribute=function(a,b){var c=this.getValue();a=null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT?c.getAttribute(a):null;return null!=a?a:b}; mxCell.prototype.setAttribute=function(a,b){var c=this.getValue();null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT&&c.setAttribute(a,b)};mxCell.prototype.clone=function(){var a=mxUtils.clone(this,this.mxTransient);a.setValue(this.cloneValue());return a};mxCell.prototype.cloneValue=function(a){a=null!=a?a:this.getValue();null!=a&&("function"==typeof a.clone?a=a.clone():isNaN(a.nodeType)||(a=a.cloneNode(!0)));return a};function mxGeometry(a,b,c,d){mxRectangle.call(this,a,b,c,d)} mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=!1; mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var a=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=a}};mxGeometry.prototype.getTerminalPoint=function(a){return a?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(a,b){b?this.sourcePoint=a:this.targetPoint=a;return a}; mxGeometry.prototype.rotate=function(a,b){var c=mxUtils.toRadians(a);a=Math.cos(c);c=Math.sin(c);if(!this.relative){var d=new mxPoint(this.getCenterX(),this.getCenterY());d=mxUtils.getRotatedPoint(d,a,c,b);this.x=Math.round(d.x-this.width/2);this.y=Math.round(d.y-this.height/2)}null!=this.sourcePoint&&(d=mxUtils.getRotatedPoint(this.sourcePoint,a,c,b),this.sourcePoint.x=Math.round(d.x),this.sourcePoint.y=Math.round(d.y));null!=this.targetPoint&&(d=mxUtils.getRotatedPoint(this.targetPoint,a,c,b),this.targetPoint.x= Math.round(d.x),this.targetPoint.y=Math.round(d.y));if(null!=this.points)for(var e=0;e<this.points.length;e++)null!=this.points[e]&&(d=mxUtils.getRotatedPoint(this.points[e],a,c,b),this.points[e].x=Math.round(d.x),this.points[e].y=Math.round(d.y))}; mxGeometry.prototype.translate=function(a,b,c){a=parseFloat(a);b=parseFloat(b);this.relative||c||(this.x=parseFloat(this.x)+a,this.y=parseFloat(this.y)+b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+a,this.targetPoint.y=parseFloat(this.targetPoint.y)+b);if(this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(c=0;c<this.points.length;c++)null!= this.points[c]&&(this.points[c].x=parseFloat(this.points[c].x)+a,this.points[c].y=parseFloat(this.points[c].y)+b)}; mxGeometry.prototype.scale=function(a,b,c){a=parseFloat(a);b=parseFloat(b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*a,this.targetPoint.y=parseFloat(this.targetPoint.y)*b);if(null!=this.points)for(var d=0;d<this.points.length;d++)null!=this.points[d]&&(this.points[d].x=parseFloat(this.points[d].x)*a,this.points[d].y=parseFloat(this.points[d].y)* b);this.relative||(this.x=parseFloat(this.x)*a,this.y=parseFloat(this.y)*b,c&&(b=a=Math.min(a,b)),this.width=parseFloat(this.width)*a,this.height=parseFloat(this.height)*b)}; mxGeometry.prototype.equals=function(a){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==a.relative&&(null==this.sourcePoint&&null==a.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(a.sourcePoint))&&(null==this.targetPoint&&null==a.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(a.targetPoint))&&(null==this.points&&null==a.points||null!=this.points&&mxUtils.equalPoints(this.points,a.points))&&(null==this.alternateBounds&&null==a.alternateBounds|| null!=this.alternateBounds&&this.alternateBounds.equals(a.alternateBounds))&&(null==this.offset&&null==a.offset||null!=this.offset&&null!=a.offset&&("function"===typeof this.offset.equals?this.offset.equals(a.offset):this.offset.x==a.offset.x&&this.offset.y==a.offset.y))}; var mxCellPath={PATH_SEPARATOR:".",create:function(a){var b="";if(null!=a)for(var c=a.getParent();null!=c;)b=c.getIndex(a)+mxCellPath.PATH_SEPARATOR+b,a=c,c=a.getParent();a=b.length;1<a&&(b=b.substring(0,a-1));return b},getParentPath:function(a){if(null!=a){var b=a.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=b)return a.substring(0,b);if(0<a.length)return""}return null},resolve:function(a,b){if(null!=b){b=b.split(mxCellPath.PATH_SEPARATOR);for(var c=0;c<b.length;c++)a=a.getChildAt(parseInt(b[c]))}return a}, compare:function(a,b){for(var c=Math.min(a.length,b.length),d=0,e=0;e<c;e++)if(a[e]!=b[e]){0==a[e].length||0==b[e].length?d=a[e]==b[e]?0:a[e]>b[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-k+m||f>k-m?(g.x=a.x,g.y=e-a.width*Math.tan(f)/ 2):f<-m?(g.y=a.y,g.x=b-a.height*Math.tan(l)/2):f<m?(g.x=a.x+a.width,g.y=e+a.width*Math.tan(f)/2):(g.y=a.y+a.height,g.x=b+a.height*Math.tan(l)/2);d&&(c.x>=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.x<a.x?g.x=a.x:c.x>a.x+a.width&&(g.x=a.x+a.width),c.y<a.y?g.y=a.y:c.y>a.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),p=parseInt(c-m);if(0==n&&0!=p)return new mxPoint(l, m+k*p/Math.abs(p));if(0==n&&0==p)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=p/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);l=(-a-k)/(2*f);k=e*g+m;m=e*l+m;Math.sqrt(Math.pow(g-b,2)+Math.pow(k-c,2))<Math.sqrt(Math.pow(l-b,2)+Math.pow(m-c,2))?(b=g,c=k):(b=l,c= m);return new mxPoint(b,c)},RhombusPerimeter:function(a,b,c,d){b=a.x;var e=a.y,f=a.width;a=a.height;var g=b+f/2,k=e+a/2,l=c.x;c=c.y;if(g==l)return k>c?new mxPoint(g,e):new mxPoint(g,e+a);if(k==c)return g>l?new mxPoint(b,k):new mxPoint(b+f,k);var m=g,n=k;d&&(l>=b&&l<=b+f?m=l:c>=e&&c<=e+a&&(n=c));return l<g?c<k?mxUtils.intersection(l,c,m,n,g,e,b,k):mxUtils.intersection(l,c,m,n,g,e+a,b,k):c<k?mxUtils.intersection(l,c,m,n,g,e,b+f,k):mxUtils.intersection(l,c,m,n,g,e+a,b+f,k)},TrianglePerimeter:function(a, b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,k=a.width,l=a.height;a=f+k/2;var m=g+l/2,n=new mxPoint(f,g),p=new mxPoint(f+k,m),q=new mxPoint(f,g+l);b==mxConstants.DIRECTION_NORTH?(n=q,p=new mxPoint(a,g),q=new mxPoint(f+k,g+l)):b==mxConstants.DIRECTION_SOUTH?(p=new mxPoint(a,g+l),q=new mxPoint(f+k,g)):b==mxConstants.DIRECTION_WEST&&(n=new mxPoint(f+k,g),p=new mxPoint(f,m),q=new mxPoint(f+k,g+l));var r=c.x- a,t=c.y-m;r=e?Math.atan2(r,t):Math.atan2(t,r);t=e?Math.atan2(k,l):Math.atan2(l,k);(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?r>-t&&r<t:r<-Math.PI+t||r>Math.PI-t)?c=d&&(e&&c.x>=n.x&&c.x<=q.x||!e&&c.y>=n.y&&c.y<=q.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+l*Math.tan(r)/2,g+l):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-l*Math.tan(r)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+l/2+k*Math.tan(r)/2):new mxPoint(f,g+ l/2-k*Math.tan(r)/2):(d&&(d=new mxPoint(a,m),c.y>=g&&c.y<=g+l?(d.x=e?a:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=e?b==mxConstants.DIRECTION_NORTH?g+l:g:m),a=d.x,m=d.y),c=e&&c.x<=f+k/2||!e&&c.y<=g+l/2?mxUtils.intersection(c.x,c.y,a,m,n.x,n.y,p.x,p.y):mxUtils.intersection(c.x,c.y,a,m,p.x,p.y,q.x,q.y));null==c&&(c=new mxPoint(a,m));return c},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,p=-Math.atan2(n- a,m-l),q=Math.PI,r=Math.PI/2;new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var t=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;var u=new mxPoint;if(m<e&&n<f||m<e&&n>f+k||m>e+g&&n<f||m>e+g&&n>f+k)d=!1;if(d){if(t){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(m<e){if(n==f+k/4)return new mxPoint(e,f+k/4);if(n==f+3*k/4)return new mxPoint(e,f+3* k/4)}else if(m>e+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(n<a)return new mxPoint(e,f+k/4);if(n>a)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(n<a)return new mxPoint(e+g,f+k/4);if(n>a)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);m<l?n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):n<f+k/4?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f- Math.floor(.25*k))):n>f+3*k/4&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+k)):n<f+k/4?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):n>f+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/2)}else if(n< f){if(m==e+g/4)return new mxPoint(e+g/4,f);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f)}else if(n>f+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(m<l)return new mxPoint(e+g/4,f);if(m>l)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(m<l)return new mxPoint(e+g/4,f+k);if(n>a)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);n<a?m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)): m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)))}d=l;p=a;m>=e&&m<= e+g?(d=m,p=n<a?f+k:f):n>=f&&n<=f+k&&(p=n,d=m<l?e+g:e);c=mxUtils.intersection(d,p,c.x,c.y,b.x,b.y,u.x,u.y)}else{if(t){m=Math.atan2(k/4,g/2);if(p==m)return new mxPoint(e+g,f+Math.floor(.25*k));if(p==r)return new mxPoint(e+Math.floor(.5*g),f);if(p==q-m)return new mxPoint(e,f+Math.floor(.25*k));if(p==-m)return new mxPoint(e+g,f+Math.floor(.75*k));if(p==-r)return new mxPoint(e+Math.floor(.5*g),f+k);if(p==-q+m)return new mxPoint(e,f+Math.floor(.75*k));p<m&&p>-m?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+ k)):p>m&&p<r?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):p>r&&p<q-m?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f-Math.floor(.25*k))):p>q-m&&p<=q||p<-q+m&&p>=-q?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):p<-m&&p>-r?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))):p<-r&&p>-q+m&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k)))}else{m= Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(.75*g),f);if(p==q-m)return new mxPoint(e+Math.floor(.25*g),f);if(p==q||p==-q)return new mxPoint(e,f+Math.floor(.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(.5*k));if(p==-m)return new mxPoint(e+Math.floor(.75*g),f+k);if(p==-q+m)return new mxPoint(e+Math.floor(.25*g),f+k);0<p&&p<m?(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):p>m&&p<q-m?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)):p>q-m&& p<q?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):0>p&&p>-m?(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-q+m?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):p<-q+m&&p>-q&&(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)))}c=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,u.x,u.y)}return null==c?new mxPoint(l,a):c}}; function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.addPageCss=!1;mxPrintPreview.prototype.pixelsPerInch=100; mxPrintPreview.prototype.pageMargin=27;mxPrintPreview.prototype.overflowClipMargin="1px";mxPrintPreview.prototype.gridSize=null;mxPrintPreview.prototype.gridSteps=null;mxPrintPreview.prototype.gridColor=null;mxPrintPreview.prototype.gridStrokeWidth=.5;mxPrintPreview.prototype.defaultCss="@media screen {\n body {\n background: gray;\n zoom: 0.7;\n }\n body > div {\n margin-bottom: 20px;\n box-sizing: border-box;\n }\n a, a * {\n pointer-events: none;\n }\n}\n@media print {\n body {\n margin: 0px;\n }\n * {\n -webkit-print-color-adjust: exact;\n }\n}"; mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null; mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd}; mxPrintPreview.prototype.getDoctype=function(){var a="";8==document.documentMode?a='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(a='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e');return a};mxPrintPreview.prototype.appendGraph=function(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.x0=c;this.y0=d;this.open(null,null,e,f,g,k,l)}; mxPrintPreview.prototype.getPageClassCss=function(a,b){var c=this.pageMargin,d=this.pixelsPerInch,e=(b.width/d).toFixed(2)+"in "+(b.height/d).toFixed(2)+"in";b="@page "+a+" {\n margin: 0;\n size: "+mxUtils.htmlEntities(e)+";\n}\n."+a+" {\n page: "+a+";\n"+(mxClient.IS_SF?" padding: "+mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n":"")+" width: "+mxUtils.htmlEntities((b.width/d).toFixed(2))+"in;\n height: "+mxUtils.htmlEntities((b.height/d).toFixed(2))+"in;\n}\n";mxClient.IS_SF||(b+="."+a+" > svg {\n margin: "+ mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n}\n");return b}; mxPrintPreview.prototype.open=function(a,b,c,d,e,f,g){c=null;try{var k=this.graph.cellRenderer.initializeOverlay,l=null!=f;f=mxRectangle.fromRectangle(null!=f?f:this.pageFormat);var m=f.width+1,n=f.height+1;this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(H,F){F.init(H.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(H,F,J,I){F.dialect=H.view.graph.dialect;F.init(H.view.getDrawPane())});this.wnd=null!=b?b:this.wnd;b=!1;null==this.wnd&& (b=!0,this.wnd=window.open());var p=this.wnd.document;if(b){var q=this.getDoctype();null!=q&&0<q.length&&p.writeln(q);"CSS1Compat"===document.compatMode&&p.writeln("<!DOCTYPE html>");p.writeln("<html>");p.writeln("<head>");this.writeHead(p,a);p.writeln("</head>");p.writeln("<body>")}var r=mxRectangle.fromRectangle(null!=g?this.graph.getBoundingBox(g):this.graph.getGraphBounds()),t=this.graph.getView().getScale(),u=t/this.scale,v=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=v.x*this.scale, this.y0-=v.y*this.scale,r.width+=r.x,r.height+=r.y,r.x=0,this.border=r.y=0);var y=m-2*this.border,A=n-2*this.border;n+=this.marginTop+this.marginBottom;r.width/=u;r.height/=u;var z=Math.max(1,Math.ceil((r.width+this.x0)/y)),x=Math.max(1,Math.ceil((r.height+this.y0)/A));this.pageCount=z*x;var C=null;l&&(null==this.pendingCss&&(this.pageFormatClass={},this.pendingCss=""),C=mxUtils.htmlEntities("gePageFormat-"+String(f.width).replace(/\./g,"_")+"-"+String(f.height).replace(/\./g,"_")),null==this.pageFormatClass[C]&& (this.pageFormatClass[C]=!0,this.pendingCss+=this.getPageClassCss(C,f)));var D=mxUtils.bind(this,function(H){null!=this.borderColor&&(H.style.borderColor=this.borderColor,H.style.borderStyle="solid",H.style.borderWidth="1px");H.style.background=this.backgroundColor;null!=C?H.classList.add(C):(H.style.width=f.width+"px",H.style.height=f.height+"px");p.body.appendChild(H)}),B=this.getCoverPages(m,n);if(null!=B)for(var E=0;E<B.length;E++)D(B[E],!0);var K=this.getAppendices(m,n);for(E=0;E<x;E++){var G= E*A/this.scale-this.y0/this.scale+(r.y-v.y*t)/t-E;for(a=0;a<z;a++){if(null==this.wnd)return null;var L=a*y/this.scale-this.x0/this.scale+(r.x-v.x*t)/t-a;g=E*z+a+1;c=p.createElement("div");c.style.display="flex";c.style.alignItems="center";c.style.justifyContent="center";var Q=new mxRectangle(L,G,y,A);this.addGraphFragment(-L,-G,this.scale,g,c,Q);null!=e&&0==E&&0==a&&c.setAttribute("id",e);D(c,!0)}}if(null!=K)for(E=0;E<K.length;E++)D(K[E],E<K.length-1);b&&!d&&this.closeDocument();this.wnd.focus()}catch(H){null!= c&&null!=c.parentNode&&c.parentNode.removeChild(c),null!=window.console&&console.error(H)}finally{this.graph.cellRenderer.initializeOverlay=k}return this.wnd};mxPrintPreview.prototype.addPendingCss=function(a){if(null!=this.pendingCss){var b=a.createElement("style");b.setAttribute("type","text/css");b.appendChild(a.createTextNode(this.pendingCss));a.getElementsByTagName("head")[0].appendChild(b);this.pendingCss=null}}; mxPrintPreview.prototype.closeDocument=function(){try{if(null!=this.wnd&&null!=this.wnd.document){var a=this.wnd.document;this.writePostfix(a);a.writeln("</body>");a.writeln("</html>");a.close();this.addPendingCss(a);mxEvent.release(a.body)}}catch(b){}}; mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln("<title>"+mxUtils.htmlEntities(this.title)+"</title>");var c=mxClient.basePath;"/src"==c.substring(c.length-4)&&(c=c.substring(0,c.length-4));mxClient.link("stylesheet",c+"/css/common.css",a);a.writeln('<style type="text/css">');a.writeln(this.defaultCss);c=this.pageFormat;this.addPageCss&&null!=c&&(c=(c.width/this.pixelsPerInch).toFixed(2)+"in "+(c.height/this.pixelsPerInch).toFixed(2)+"in",a.writeln("@page {"),a.writeln(" margin: "+ mxUtils.htmlEntities((this.pageMargin/this.pixelsPerInch).toFixed(2))+"in;"),a.writeln(" size: "+mxUtils.htmlEntities(c)+";"),a.writeln("}"));null!=b&&a.writeln(mxUtils.htmlEntities(b,!1,!1,!1));a.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(a){};mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF}; mxPrintPreview.prototype.isCellVisible=function(a){return!0};mxPrintPreview.prototype.drawBackgroundImage=function(a){a.redraw()}; mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane(),p=c;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(g.createSvg(),this.useCssTransforms()){var q=g.getDrawPane().parentNode;q.setAttribute("transformOrigin","0 0");q.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}}else g.createHtml();q=g.isEventsEnabled(); g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.selectionCellsHandler.updateHandler;this.graph.selectionCellsHandler.updateHandler=function(){};var v=this.graph.cellRenderer.redraw,y=g.states,A=g.scale,z=null;if(this.printBackgroundImage){var x=this.getBackgroundImage();null!=x&&(z=new mxRectangle(Math.round(a*A+x.x),Math.round(b*A+x.y),x.width-1,x.height-1),z=new mxImageShape(z,x.src),z.dialect=this.graph.dialect)}if(this.clipping){var C= new mxRectangle((f.x+t.x+1.5)*A,(f.y+t.y+1.5)*A,(f.width-1.5)*A/p,(f.height-1.5)*A/p),D=this;this.graph.cellRenderer.redraw=function(E,K,G){if(null!=E){var L=y.get(E.cell);if(null!=L&&(L=g.getBoundingBox(L,!1),null!=L&&0<L.width&&0<L.height&&!mxUtils.intersects(C,L))||!D.isCellVisible(E.cell))return}v.apply(this,arguments)};null!=z&&(a=new mxRectangle(z.bounds.x*A+(t.x-a)*A,z.bounds.y*A+(t.y-b)*A,z.bounds.width*A,z.bounds.height*A),mxUtils.intersects(C,a)||(z=null))}null!=z&&(z.init(g.backgroundPane), this.drawBackgroundImage(z));a=null;try{var B=[this.getRoot()];a=new mxTemporaryCellStates(g,c,B,null,mxUtils.bind(this,function(E){return this.getLinkForCellState(E)}))}finally{for(c=e.firstChild;null!=c;)e=c.nextSibling,"svg"==c.nodeName.toLowerCase()?(c.style.top="",c.style.left="",c.style.width="",c.style.height="",c.style.display="",c.style.maxWidth="100%",c.style.maxHeight="100%",c.style.overflow=mxClient.IS_SF?"hidden":"clip",c.style.overflowClipMargin=this.overflowClipMargin,c.setAttribute("viewBox", "0 0 "+(mxClient.IS_SF?f.width+1+" "+(f.height+1):f.width-1+" "+(f.height-1))),this.addGrid(c,f),mxClient.IS_SF&&(f.width>f.height?c.style.height="100%":c.style.width="100%")):this.isTextLabel(c)||c.parentNode.removeChild(c),c=e;g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(r);this.graph.container=d;this.graph.cellRenderer.redraw=v;this.graph.selectionCellsHandler.updateHandler=u;g.canvas=k;g.backgroundPane=l;g.drawPane=m;g.overlayPane=n;g.translate=t;a.destroy();g.setEventsEnabled(q)}}; mxPrintPreview.prototype.addGrid=function(a,b){0<this.gridSize&&0<this.gridSteps&&null!=this.gridColor&&(b=this.createSvgGrid(a,b),a=mxUtils.getSvgDefs(a),null!=a.nextSibling?a.parentNode.insertBefore(b,a.nextSibling):a.parentNode.appendChild(b))}; mxPrintPreview.prototype.createSvgGrid=function(a,b){var c=this.gridSize;a=a.ownerDocument;var d=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"g"):a.createElement("g"),e=mxUtils.mod(Math.ceil(b.x/c),this.gridSteps),f=mxUtils.mod(c-mxUtils.mod(b.x,c),c),g=mxUtils.mod(Math.ceil(b.y/c),this.gridSteps),k=mxUtils.mod(c-mxUtils.mod(b.y,c),c);f*=this.scale;k*=this.scale;c*=this.scale;for(var l=Math.ceil(b.height/c),m=0;m<l;m++){var n=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG, "line"):a.createElement("line");n.setAttribute("x1",0);n.setAttribute("y1",m*c+k);n.setAttribute("x2",b.width);n.setAttribute("y2",m*c+k);n.setAttribute("stroke",this.gridColor);n.setAttribute("opacity",0==mxUtils.mod(m+g,this.gridSteps)?"1":"0.2");n.setAttribute("stroke-width","0.5");d.appendChild(n)}g=Math.ceil(b.width/c);for(m=0;m<g;m++)n=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"line"):a.createElement("line"),n.setAttribute("x1",m*c+f),n.setAttribute("y1",0),n.setAttribute("x2", m*c+f),n.setAttribute("y2",b.height),n.setAttribute("stroke",this.gridColor),n.setAttribute("opacity",0==mxUtils.mod(m+e,this.gridSteps)?"1":"0.2"),n.setAttribute("stroke-width","0.5"),d.appendChild(n);return d};mxPrintPreview.prototype.isTextLabel=function(a){return"default"==tmp.style.cursor||"div"==a.nodeName.toLowerCase()};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};mxPrintPreview.prototype.getBackgroundImage=function(){return this.graph.backgroundImage}; mxPrintPreview.prototype.getCoverPages=function(){return null};mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())} mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a}; mxStylesheet.prototype.createDefaultEdgeStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;a[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#446299";return a};mxStylesheet.prototype.putDefaultVertexStyle=function(a){this.putCellStyle("defaultVertex",a)}; mxStylesheet.prototype.putDefaultEdgeStyle=function(a){this.putCellStyle("defaultEdge",a)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge};mxStylesheet.prototype.putCellStyle=function(a,b){"__proto__"!=a&&"constructor"!=a&&"prototype"!=a&&(this.styles[a]=b)}; mxStylesheet.prototype.getCellStyle=function(a,b,c){c=null!=c?c:!0;if(null!=a&&0<a.length){var d=a.split(";");b=null!=b&&";"!=a.charAt(0)?mxUtils.clone(b):{};for(a=0;a<d.length;a++){var e=d[a],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f);e=e.substring(f+1);e==mxConstants.NONE&&c?delete b[g]:mxUtils.isNumeric(e)?b[g]=parseFloat(e):b[g]=e}else if(e=Object.prototype.hasOwnProperty.call(this.styles,e)?this.styles[e]:null,null!=e)for(g in e)b[g]=e[g]}}return b}; function mxCellState(a,b,c){this.view=a;this.cell=b;this.style=null!=c?c:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=!1;mxCellState.prototype.invalid=!0;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null; mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null; mxCellState.prototype.getPerimeterBounds=function(a,b){a=a||0;b=null!=b?b:new mxRectangle(this.x,this.y,this.width,this.height);if(null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var c=this.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?this.shape.stencil.h0:this.shape.stencil.w0;d=d?this.shape.stencil.w0:this.shape.stencil.h0;var e=Math.min(b.width/c,b.height/d);b.x+=(b.width-c*e)/2;b.y+=(b.height-d*e)/2;b.width= c*e;b.height=d*e}0!=a&&b.grow(a);return b};mxCellState.prototype.setAbsoluteTerminalPoint=function(a,b){b?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[0]=a):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(a)):1==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[this.absolutePoints.length-1]=a}; mxCellState.prototype.setCursor=function(a){null!=this.shape&&this.shape.setCursor(a);null!=this.text&&this.text.setCursor(a)};mxCellState.prototype.isFloatingTerminalPoint=function(a){var b=this.getVisibleTerminalState(a);if(null==b)return!1;a=this.view.graph.getConnectionConstraint(this,b,a);return null==a||null==a.point};mxCellState.prototype.getVisibleTerminal=function(a){a=this.getVisibleTerminalState(a);return null!=a?a.cell:null}; mxCellState.prototype.getVisibleTerminalState=function(a){return a?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(a,b){b?this.visibleSourceState=a:this.visibleTargetState=a};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds}; mxCellState.prototype.updateCachedBounds=function(){var a=this.view.translate,b=this.view.scale;this.cellBounds=new mxRectangle(this.x/b-a.x,this.y/b-a.y,this.width/b,this.height/b);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()}; mxCellState.prototype.setState=function(a){this.view=a.view;this.cell=a.cell;this.style=a.style;this.absolutePoints=a.absolutePoints;this.origin=a.origin;this.absoluteOffset=a.absoluteOffset;this.boundingBox=a.boundingBox;this.terminalDistance=a.terminalDistance;this.segments=a.segments;this.length=a.length;this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;this.unscaledWidth=a.unscaledWidth;this.unscaledHeight=a.unscaledHeight}; mxCellState.prototype.clone=function(){var a=new mxCellState(this.view,this.cell,null!=this.style?mxUtils.clone(this.style):null);if(null!=this.absolutePoints){a.absolutePoints=[];for(var b=0;b<this.absolutePoints.length;b++)a.absolutePoints[b]=null!=this.absolutePoints[b]?this.absolutePoints[b].clone():null}null!=this.origin&&(a.origin=this.origin.clone());null!=this.absoluteOffset&&(a.absoluteOffset=this.absoluteOffset.clone());null!=this.boundingBox&&(a.boundingBox=this.boundingBox.clone());a.terminalDistance= this.terminalDistance;a.segments=this.segments;a.length=this.length;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;a.unscaledWidth=this.unscaledWidth;a.unscaledHeight=this.unscaledHeight;return a};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};function mxGraphSelectionModel(a){this.graph=a;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel; mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=!1;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(a){this.singleSelection=a}; mxGraphSelectionModel.prototype.isSelected=function(a){return null!=a?0<=mxUtils.indexOf(this.cells,a):!1};mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(a){null!=a&&this.setCells([a])}; mxGraphSelectionModel.prototype.setCells=function(a){if(null!=a){this.singleSelection&&(a=[this.getFirstSelectableCell(a)]);for(var b=[],c=0;c<a.length;c++)this.graph.isCellSelectable(a[c])&&b.push(a[c]);this.changeSelection(b,this.cells)}};mxGraphSelectionModel.prototype.getFirstSelectableCell=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(this.graph.isCellSelectable(a[b]))return a[b];return null};mxGraphSelectionModel.prototype.addCell=function(a){null!=a&&this.addCells([a])}; mxGraphSelectionModel.prototype.addCells=function(a){if(null!=a){var b=null;this.singleSelection&&(b=this.cells,a=[this.getFirstSelectableCell(a)]);for(var c=[],d=0;d<a.length;d++)!this.isSelected(a[d])&&this.graph.isCellSelectable(a[d])&&c.push(a[d]);this.changeSelection(c,b)}};mxGraphSelectionModel.prototype.removeCell=function(a){null!=a&&this.removeCells([a])}; mxGraphSelectionModel.prototype.removeCells=function(a){if(null!=a){for(var b=[],c=0;c<a.length;c++)this.isSelected(a[c])&&b.push(a[c]);this.changeSelection(null,b)}};mxGraphSelectionModel.prototype.changeSelection=function(a,b){if(null!=a&&0<a.length&&null!=a[0]||null!=b&&0<b.length&&null!=b[0])a=new mxSelectionChange(this,a,b),a.execute(),b=new mxUndoableEdit(this,!1),b.add(a),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))}; mxGraphSelectionModel.prototype.cellAdded=function(a){null==a||this.isSelected(a)||this.cells.push(a)};mxGraphSelectionModel.prototype.cellRemoved=function(a){null!=a&&(a=mxUtils.indexOf(this.cells,a),0<=a&&this.cells.splice(a,1))};function mxSelectionChange(a,b,c){this.selectionModel=a;this.added=null!=b?b.slice():null;this.removed=null!=c?c.slice():null} mxSelectionChange.prototype.execute=function(){var a=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(null!=this.removed)for(var b=0;b<this.removed.length;b++)this.selectionModel.cellRemoved(this.removed[b]);if(null!=this.added)for(b=0;b<this.added.length;b++)this.selectionModel.cellAdded(this.added[b]);b=this.added;this.added=this.removed;this.removed=b;window.status=mxResources.get(this.selectionModel.doneResource)|| this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",a);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))}; function mxCellEditor(a){this.graph=a;this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()});null!=this.graph.container&&mxEvent.addListener(this.graph.container,"scroll",this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,function(b){null!=this.editingCell&&(b=this.graph.getView().getState(this.editingCell),null==b?this.stopEditing(!0): this.updateTextAreaStyle(b))});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=!1;mxCellEditor.prototype.autoSize=!0;mxCellEditor.prototype.selectText=!0;mxCellEditor.prototype.rotateText=!0;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=!0; mxCellEditor.prototype.textNode=null;mxCellEditor.prototype.zIndex=1;mxCellEditor.prototype.minResize=new mxRectangle(0,20);mxCellEditor.prototype.blurEnabled=!1;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=!0;mxClient.IS_GC&&(this.textarea.style.minHeight="1em");this.installListeners(this.textarea)}; mxCellEditor.prototype.applyValue=function(a,b){this.graph.labelChanged(a.cell,b,this.trigger)};mxCellEditor.prototype.setAlign=function(a){var b=this.graph.getView().getState(this.editingCell);null!=this.textarea&&null!=b&&(b=mxUtils.getValue(b.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),null==b||"vertical-"!=b.substring(0,9))&&(this.textarea.style.textAlign=a);this.align=a;this.resize()}; mxCellEditor.prototype.getInitialValue=function(a,b){a=mxUtils.htmlEntities(this.graph.getEditingValue(a.cell,b),!1);a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return a.replace(/\n/g,"<br>")};mxCellEditor.prototype.getCurrentValue=function(a){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(a){return this.escapeCancelsEditing||mxEvent.isShiftDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)}; mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(e){this.graph.stopEditing(!1);mxEvent.consume(e)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(e){this.blurEnabled&&this.focusLost(e)}));var b=this.graph.container.scrollTop,c=this.graph.container.scrollLeft;mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){b=this.graph.container.scrollTop;c=this.graph.container.scrollLeft;mxEvent.isConsumed(e)||(this.isStopEditingEvent(e)? (this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(e)),mxEvent.consume(e)))}));var d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,a.innerText="")});mxEvent.addListener(a,"keypress",d);mxEvent.addListener(a,"paste",d);mxEvent.addListener(a,"compositionstart",mxUtils.bind(this,function(e){null!=this.editingCell&& this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,a.innerText="")}));d=mxUtils.bind(this,function(e){null!=this.editingCell&&(this.graph.container.scrollTop=b,this.graph.container.scrollLeft=c,a.scrollIntoView({block:"nearest",inline:"nearest"}),0!=this.textarea.innerHTML.length&&"<br>"!=this.textarea.innerHTML||this.textarea.innerHTML==this.getEmptyLabelText()?this.clearOnChange=!1:(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length))}); mxEvent.addListener(a,"input",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a,"paste",d);d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(e)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;null!=document.body&&this.resize()}),0))});mxEvent.addListener(a,"input",d);mxEvent.addListener(window,"resize",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a, "paste",d)};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea}; mxCellEditor.prototype.resize=function(){var a=this.graph.getView().getState(this.editingCell);if(null==a)this.stopEditing(!0);else if(null!=this.textarea){var b=mxUtils.getAlignmentAsPoint(null!=this.align?this.align:this.textShape.align,this.textShape.valign);this.bounds=this.graph.cellRenderer.getLabelBounds(a,this.textShape,b,!this.rotateText);var c=this.rotateText?this.textShape.getTextRotation():0,d=this.graph.getView().scale;this.bounds.x+=-.5==b.x?0:0==b.x?-d:d;this.bounds.y+=-.5==b.y?0:0== b.y?-d:d;this.textarea.style.left=Math.max(0,Math.round(this.bounds.x))+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y))+"px";if(this.autoSize&&"fill"!=a.style[mxConstants.STYLE_OVERFLOW]){var e="1"==mxUtils.getValue(a.style,"convertToSvg","0")&&"wrap"==a.style.svgWhiteSpace;if(this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&(e||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("text").length))if(e=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION, mxConstants.DEFAULT_TEXT_DIRECTION),e=null!=e&&"vertical-"==e.substring(0,9),this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]?this.bounds.width-=2*d:a.view.graph.isHtmlLabel(a.cell)&&(this.bounds.width+=mxSvgCanvas2D.prototype.foreignObjectPadding*d),this.textarea.innerHTML!=this.getEmptyLabelText())if("block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]){if(-.5== b.y||"width"==a.style[mxConstants.STYLE_OVERFLOW])this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px";this.textarea.style.width=Math.round(this.bounds.width/d)+"px"}else e?this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px":this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width=""}else this.textarea.style.width=Math.round(this.bounds.width/ d)+"px",this.textarea.style.height=Math.round(this.bounds.height/d)+"px",this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/d)+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width= ""));mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=c?"rotate("+c+"deg) ":"")+"scale("+d+","+d+") translate("+100*b.x+"%,"+100*b.y+"%)")}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(a){return null};mxCellEditor.prototype.getBorderColor=function(a){return null}; mxCellEditor.prototype.updateTextAreaStyle=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,f=[],g=this.graph.getCellStyle(this.graph.model.getParent(a.cell), !0);"inherit"==b&&(b=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE):mxConstants.DEFAULT_FONTSIZE);"inherit"==c&&(c=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY):mxConstants.DEFAULT_FONTFAMILY);(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline");(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&& f.push("line-through");0<f.length&&(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&f.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.textDecoration=f.join(" ");this.textarea.style.fontWeight=d?"bold":"normal";this.textarea.style.fontStyle=e?"italic":"";this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.zIndex= this.zIndex;this.textarea.style.fontFamily=mxUtils.parseCssFontFamily(c);this.textarea.style.writingMode="";b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTCOLOR);if(null==b||b==mxConstants.NONE)b=this.graph.shapeForegroundColor;this.textarea.style.color=mxUtils.getLightDarkColor(b).cssText;b=this.getBackgroundColor(a);this.textarea.style.backgroundColor=null!=b?mxUtils.getLightDarkColor(b).cssText:"transparent";b=this.getBorderColor(a);this.textarea.style.border=null!=b?"1px solid "+mxUtils.getLightDarkColor(b).cssText: "1px solid transparent";b=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT);this.textarea.removeAttribute("dir");b!=mxConstants.TEXT_DIRECTION_AUTO||null==a||null==a.text||a.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(a.text.value)||(b=a.text.getAutoDirection());if(b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL)this.textarea.setAttribute("dir", b);else if(b==mxConstants.TEXT_DIRECTION_VERTICAL_LR||b==mxConstants.TEXT_DIRECTION_VERTICAL_RL)a=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),c=a==mxConstants.ALIGN_TOP?"left":a==mxConstants.ALIGN_BOTTOM?"right":"center",this.textarea.style.writingMode=b;this.textarea.style.textAlign=c};mxCellEditor.prototype.setEditingValue=function(a,b){this.textarea.innerHTML=b}; mxCellEditor.prototype.startEditing=function(a,b,c){this.stopEditing(!0);this.align=null;null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var d=this.graph.getView().getState(a);null!=d&&(this.updateTextAreaStyle(d),this.setEditingValue(d,this.getInitialValue(d,b)||""),this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange= !0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.textShape=d.text,this.editingCell=a,this.trigger=b,null==this.textShape&&(this.textShape=this.graph.cellRenderer.createTextShape(d,"",this.graph.dialect)),a=mxUtils.bind(this,function(){if(null!=this.editingCell)if(null!=this.textShape&&null!=this.textShape.node&&this.isHideLabel(d)&&(this.textNode=this.textShape.node,this.textNode.style.visibility="hidden"),this.resize(),this.graph.container.appendChild(this.textarea), mxClient.IS_IOS&&(this.graph.container.scrollTop=Math.max(this.graph.container.scrollTop,d.y+d.height-this.graph.container.clientHeight/3)),this.textarea.scrollIntoView({block:"nearest",inline:"nearest"}),this.textarea.focus(),null!=c){this.textarea.innerHTML=c;var e=document.createRange();e.selectNodeContents(this.textarea);e.collapse(!1);var f=window.getSelection();f.removeAllRanges();f.addRange(e)}else this.isSelectText()&&0<this.textarea.innerHTML.length&&(this.textarea.innerHTML!=this.getEmptyLabelText()|| !this.clearOnChange)&&document.execCommand("selectAll",!1,null)}),mxClient.IS_IOS||this.editByTyping?(this.editByTyping=!1,a()):window.setTimeout(a,0))};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var a=null;window.getSelection?a=window.getSelection():document.selection&&(a=document.selection);null!=a&&(a.empty?a.empty():a.removeAllRanges&&a.removeAllRanges())}; mxCellEditor.prototype.stopEditing=function(a){if(null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);a=a?null:this.graph.view.getState(this.editingCell);var b=this.initialValue;this.bounds=this.trigger=this.textShape=this.editingCell=this.initialValue=null;this.textarea.blur();this.clearSelection();null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea);this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&& (this.textarea.innerText="",this.clearOnChange=!1);if(null!=a&&(this.textarea.innerHTML!=b||null!=this.align)){this.prepareTextarea();b=this.getCurrentValue(a);this.graph.getModel().beginUpdate();try{null!=b&&this.applyValue(a,b),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[a.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.align=this.textarea=null}}; mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)};mxCellEditor.prototype.isHideLabel=function(a){return!0};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,"left"==this.textarea.style.textAlign?120:40)};mxCellEditor.prototype.getEmptyLabelText=function(a){return this.emptyLabelText}; mxCellEditor.prototype.getEditingCell=function(){return this.editingCell}; mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);this.zoomHandler&&(null!=this.graph.container&&mxEvent.removeListener(this.graph.container,"scroll",this.zoomHandler),this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)}; function mxCellRenderer(){}mxCellRenderer.defaultShapes=Object.create(null);mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=!0;mxCellRenderer.prototype.legacySpacing=!0;mxCellRenderer.prototype.antiAlias=!0;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=!1; mxCellRenderer.registerShape=function(a,b){mxCellRenderer.defaultShapes[a]=b};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor); mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse); mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(a){a.shape.dialect=a.view.graph.dialect;this.configureShape(a);a.shape.init(a.view.getDrawPane())}; mxCellRenderer.prototype.createShape=function(a){var b=null;null!=a.style&&(b=a.style[mxConstants.STYLE_SHAPE],b=null==mxCellRenderer.defaultShapes[b]?mxStencilRegistry.getStencil(b):null,b=null!=b?new mxShape(b):new (this.getShapeConstructor(a)));return b};mxCellRenderer.prototype.createIndicatorShape=function(a){a.shape.indicatorShape=this.getShape(a.view.graph.getIndicatorShape(a))};mxCellRenderer.prototype.getShape=function(a){return null!=a?mxCellRenderer.defaultShapes[a]:null}; mxCellRenderer.prototype.getShapeConstructor=function(a){var b=this.getShape(a.style[mxConstants.STYLE_SHAPE]);null==b&&(b=a.view.graph.getModel().isEdge(a.cell)?this.defaultEdgeShape:this.defaultVertexShape);return b}; mxCellRenderer.prototype.configureShape=function(a){a.shape.apply(a);a.shape.image=a.view.graph.getImage(a);a.shape.indicatorColor=a.view.graph.getIndicatorColor(a);a.shape.indicatorStrokeColor=a.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];a.shape.indicatorGradientColor=a.view.graph.getIndicatorGradientColor(a);a.shape.indicatorDirection=a.style[mxConstants.STYLE_INDICATOR_DIRECTION];a.shape.indicatorImage=a.view.graph.getIndicatorImage(a);this.postConfigureShape(a)}; mxCellRenderer.prototype.postConfigureShape=function(a){null!=a.shape&&(this.resolveColor(a,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(a,"fill",mxConstants.STYLE_FILLCOLOR))}; mxCellRenderer.prototype.checkPlaceholderStyles=function(a){if(null!=a.style){if("inherit"==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTFAMILY])return!0;for(var b=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],c=a.view.graph,d=0;d<b.length;d++)if(0<=c.isSpecialColor(a.style[b[d]]))return!0}return!1}; mxCellRenderer.prototype.inheritFontStyle=function(a,b,c){if(null!=a.text&&"inherit"==a.text[b]){var d=a.view.graph;d=d.getView().getState(d.model.getParent(a.cell));null!=d&&(a.text[b]=d.style[c])}}; mxCellRenderer.prototype.resolveColor=function(a,b,c){var d=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(null!=d){var e=a.view.graph,f=d[b],g=null;"inherit"==f||f==mxConstants.STYLE_FILLCOLOR||f==mxConstants.STYLE_STROKECOLOR?(g=e.model.getParent(a.cell),"inherit"!=f&&(c=f)):"swimlane"==f?(d[b]=c==mxConstants.STYLE_STROKECOLOR||c==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",g=null!=e.model.getTerminal(a.cell,!1)?e.model.getTerminal(a.cell,!1):a.cell,g=e.getSwimlane(g),c=e.swimlaneIndicatorColorAttribute): "indicated"==f&&null!=a.shape?d[b]=a.shape.indicatorColor:c!=mxConstants.STYLE_FILLCOLOR&&f==mxConstants.STYLE_FILLCOLOR&&null!=a.shape?d[b]=a.style[mxConstants.STYLE_FILLCOLOR]:c!=mxConstants.STYLE_STROKECOLOR&&f==mxConstants.STYLE_STROKECOLOR&&null!=a.shape&&(d[b]=a.style[mxConstants.STYLE_STROKECOLOR]);null!=g&&(a=e.getView().getState(g),d[b]=null,null!=a&&(e=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape,d[b]=null!=e&&"indicatorColor"!=b&&f!=mxConstants.STYLE_STROKECOLOR&&f!=mxConstants.STYLE_FILLCOLOR? e[b]:a.style[c]))}};mxCellRenderer.prototype.getLabelValue=function(a){return a.view.graph.getLabel(a.cell)}; mxCellRenderer.prototype.createTextShape=function(a,b,c){var d=a.view.graph;b=new this.defaultTextShape(b,new mxRectangle,a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,d.getVerticalAlign(a),a.style[mxConstants.STYLE_FONTCOLOR],a.style[mxConstants.STYLE_FONTFAMILY],a.style[mxConstants.STYLE_FONTSIZE],a.style[mxConstants.STYLE_FONTSTYLE],a.style[mxConstants.STYLE_SPACING],a.style[mxConstants.STYLE_SPACING_TOP],a.style[mxConstants.STYLE_SPACING_RIGHT],a.style[mxConstants.STYLE_SPACING_BOTTOM], a.style[mxConstants.STYLE_SPACING_LEFT],a.style[mxConstants.STYLE_HORIZONTAL],a.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],a.style[mxConstants.STYLE_LABEL_BORDERCOLOR],d.isWrapping(a.cell)&&d.isHtmlLabel(a.cell),d.isLabelClipped(a.cell),a.style[mxConstants.STYLE_OVERFLOW],a.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION));b.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100);b.convertToSvg="1"== mxUtils.getValue(a.style,"convertToSvg","0");b.dialect=c;b.style=a.style;b.state=a;return b}; mxCellRenderer.prototype.createLabel=function(a,b){var c=a.view.graph;if(0<a.style[mxConstants.STYLE_FONTSIZE]||null==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTSIZE]){var d=c.isHtmlLabel(a.cell)||null!=b&&mxUtils.isNode(b);a.text=this.createTextShape(a,b,d?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect);this.initializeLabel(a,a.text);this.configureShape(a);var e=!1,f=function(g){var k=a;if(mxClient.IS_TOUCH||e)k=mxEvent.getClientX(g),g=mxEvent.getClientY(g), g=mxUtils.convertPoint(c.container,k,g),k=c.view.getState(c.getCellAt(g.x,g.y));return k};mxEvent.addGestureListeners(a.text.node,mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a)),e=c.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(g).nodeName)}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&c.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,f(g)))}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(g,f(g))),e=!1)}));c.nativeDblClickEnabled&&mxEvent.addListener(a.text.node,"dblclick",mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.dblClick(g,a.cell),mxEvent.consume(g))}))}};mxCellRenderer.prototype.initializeLabel=function(a,b){mxClient.IS_SVG&&mxClient.NO_FO&&b.dialect!=mxConstants.DIALECT_SVG?b.init(a.view.graph.container):b.init(a.view.getDrawPane())}; mxCellRenderer.prototype.createCellOverlays=function(a){var b=a.view.graph.getCellOverlays(a.cell),c=null;if(null!=b){c=new mxDictionary;for(var d=0;d<b.length;d++){var e=null!=a.overlays?a.overlays.remove(b[d]):null;null==e?(e=new mxImageShape(new mxRectangle,b[d].image.src),e.dialect=a.view.graph.dialect,e.preserveImageAspect=!1,e.overlay=b[d],this.initializeOverlay(a,e),this.installCellOverlayListeners(a,b[d],e),null!=b[d].cursor&&(e.node.style.cursor=b[d].cursor),c.put(b[d],e)):c.put(b[d],e)}}null!= a.overlays&&a.overlays.visit(function(f,g){g.destroy()});a.overlays=c};mxCellRenderer.prototype.initializeOverlay=function(a,b){b.init(a.view.getOverlayPane())}; mxCellRenderer.prototype.installCellOverlayListeners=function(a,b,c){var d=a.view.graph;mxEvent.addListener(c.node,"click",function(e){d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());b.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",a.cell))});mxEvent.addGestureListeners(c.node,function(e){mxEvent.consume(e)},function(e){d.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,a))});mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchend",function(e){b.fireEvent(new mxEventObject(mxEvent.CLICK, "event",e,"cell",a.cell))})};mxCellRenderer.prototype.createControl=function(a){var b=a.view.graph,c=b.getFoldingImage(a);if(b.foldingEnabled&&null!=c){if(null==a.control){var d=new mxRectangle(0,0,c.width,c.height);a.control=new mxImageShape(d,c.src);a.control.preserveImageAspect=!1;a.control.dialect=b.dialect;this.initControl(a,a.control,!0,this.createControlClickHandler(a))}}else null!=a.control&&(a.control.destroy(),a.control=null)}; mxCellRenderer.prototype.createControlClickHandler=function(a){var b=a.view.graph;return mxUtils.bind(this,function(c){if(this.forceControlClickHandler||b.isEnabled()){var d=!b.isCellCollapsed(a.cell);b.foldCells(d,!1,[a.cell],null,c);mxEvent.consume(c)}})}; mxCellRenderer.prototype.initControl=function(a,b,c,d){var e=a.view.graph;e.isHtmlLabel(a.cell)&&mxClient.NO_FO&&e.dialect==mxConstants.DIALECT_SVG?(b.dialect=mxConstants.DIALECT_PREFERHTML,b.init(e.container),b.node.style.zIndex=1):b.init(a.view.getOverlayPane());b=b.innerNode||b.node;null==d||mxClient.IS_IOS||(e.isEnabled()&&(b.style.cursor="pointer"),mxEvent.addListener(b,"click",d));if(c){var f=null;mxEvent.addGestureListeners(b,function(g){f=new mxPoint(mxEvent.getClientX(g),mxEvent.getClientY(g)); e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a));mxEvent.consume(g)},function(g){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,a))},function(g){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,a));mxEvent.consume(g)});null!=d&&mxClient.IS_IOS&&b.addEventListener("touchend",function(g){if(null!=f){var k=e.tolerance;Math.abs(f.x-mxEvent.getClientX(g))<k&&Math.abs(f.y-mxEvent.getClientY(g))<k&&(d.call(d,g),mxEvent.consume(g))}},!0)}return b}; mxCellRenderer.prototype.isShapeEvent=function(a,b){return!0};mxCellRenderer.prototype.isLabelEvent=function(a,b){return!0}; mxCellRenderer.prototype.installListeners=function(a){var b=a.view.graph,c=function(d){var e=a;if(b.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(d).nodeName||mxClient.IS_TOUCH)e=mxEvent.getClientX(d),d=mxEvent.getClientY(d),d=mxUtils.convertPoint(b.container,e,d),e=b.view.getState(b.getCellAt(d.x,d.y));return e};mxEvent.addGestureListeners(a.shape.node,mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d,a))}),mxUtils.bind(this, function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,c(d)))}),mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d,c(d)))}));b.nativeDblClickEnabled&&mxEvent.addListener(a.shape.node,"dblclick",mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&(b.dblClick(d,a.cell),mxEvent.consume(d))}))}; mxCellRenderer.prototype.redrawLabel=function(a,b){var c=a.view.graph,d=this.getLabelValue(a),e=c.isWrapping(a.cell),f=c.isLabelClipped(a.cell),g=a.view.graph.isHtmlLabel(a.cell)||null!=d&&mxUtils.isNode(d)?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect,k=a.style[mxConstants.STYLE_OVERFLOW]||"visible",l="1"==mxUtils.getValue(a.style,"convertToSvg","0");null==a.text||a.text.wrap==e&&a.text.clipped==f&&a.text.overflow==k&&a.text.dialect==g&&a.text.convertToSvg==l||(a.text.destroy(),a.text=null); null==a.text&&null!=d&&(mxUtils.isNode(d)||0<d.length)?this.createLabel(a,d):null==a.text||null!=d&&0!=d.length||(a.text.destroy(),a.text=null);null!=a.text&&(b&&(null!=a.text.lastValue&&this.isTextShapeInvalid(a,a.text)&&(a.text.lastValue=null),a.text.resetStyles(),a.text.apply(a),this.configureShape(a),a.text.valign=c.getVerticalAlign(a)),c=this.getLabelBounds(a),l=this.getTextScale(a),this.resolveColor(a,"color",mxConstants.STYLE_FONTCOLOR),this.inheritFontStyle(a,"size",mxConstants.STYLE_FONTSIZE), this.inheritFontStyle(a,"family",mxConstants.STYLE_FONTFAMILY),b||a.text.value!=d||a.text.isWrapping!=e||a.text.overflow!=k||a.text.isClipping!=f||a.text.scale!=l||a.text.dialect!=g||null==a.text.bounds||!a.text.bounds.equals(c))&&(a.text.dialect=g,a.text.value=d,a.text.bounds=c,a.text.scale=l,a.text.wrap=e,a.text.clipped=f,a.text.overflow=k,b=a.text.node.style.visibility,this.redrawLabelShape(a.text),a.text.node.style.visibility=b)}; mxCellRenderer.prototype.isTextShapeInvalid=function(a,b){function c(d,e,f){return"spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(b[d])-parseFloat(b.spacing)!=(a.style[e]||f):b[d]!=(null!=a.style[e]?a.style[e]:f)}return c("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||c("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||c("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||c("color",mxConstants.STYLE_FONTCOLOR, "black")||c("align",mxConstants.STYLE_ALIGN,"")||c("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||c("spacing",mxConstants.STYLE_SPACING,2)||c("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||c("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||c("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||c("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||c("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||c("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||c("border",mxConstants.STYLE_LABEL_BORDERCOLOR)|| c("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||c("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(a){a.redraw()};mxCellRenderer.prototype.getTextScale=function(a){return a.view.scale}; mxCellRenderer.prototype.getLabelBounds=function(a,b,c,d){b=null!=b?b:a.text;var e=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y),f=a.view.graph.getModel().isEdge(a.cell),g=a.view.scale;if(f){var k=b.getSpacing(null,c);e.x+=k.x*g;e.y+=k.y*g;k=a.view.graph.getCellGeometry(a.cell);null!=k&&(e.width=Math.max(0,k.width*g),e.height=Math.max(0,k.height*g))}else b.isPaintBoundsInverted()&&!d&&(k=e.x,e.x=e.y,e.y=k),e.x+=a.x,e.y+=a.y,e.width=Math.max(1,a.width),e.height=Math.max(1,a.height);b.isPaintBoundsInverted()&& !d&&(k=(a.width-a.height)/2,e.x+=k,e.y-=k,k=e.width,e.width=e.height,e.height=k);if(null!=a.shape){k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var l=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);k==mxConstants.ALIGN_CENTER&&l==mxConstants.ALIGN_MIDDLE&&(e=a.shape.getLabelBounds(e))}k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);null!=k&&(e.width=parseFloat(k)*g);f||this.rotateLabelBounds(a,e,b, c,d);return e}; mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:c.margin;b.y-=f.y*b.height;b.x-=f.x*b.width;if(!this.legacySpacing||"fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&"width"!=a.style[mxConstants.STYLE_OVERFLOW]&&("block"!=a.style[mxConstants.STYLE_OVERFLOW]||"1"==a.style[mxConstants.STYLE_BLOCK_SPACING])){d=a.view.scale;f=c.getSpacing("1"==a.style[mxConstants.STYLE_BLOCK_SPACING],f);b.x+=f.x*d;b.y+=f.y*d;f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER); var g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(f==mxConstants.ALIGN_CENTER&&null==k?c.spacingLeft*d+c.spacingRight*d:0));b.height=Math.max(0,b.height-(g==mxConstants.ALIGN_MIDDLE?c.spacingTop*d+c.spacingBottom*d:0))}e=e?0:c.getTextRotation();0!=e&&null!=a&&a.view.graph.model.isVertex(a.cell)&&(c=a.getCenterX(),a=a.getCenterY(),b.x!=c||b.y!=a)&&(e*=Math.PI/ 180,a=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,a)),b.x=a.x,b.y=a.y)}; mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(g,k){g=k.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var l=g.getCenterX(),m=g.getCenterY();m=mxUtils.getRotatedPoint(new mxPoint(l,m),e,f,new mxPoint(a.getCenterX(),a.getCenterY()));l=m.x;m=m.y;g.x=Math.round(l- g.width/2);g.y=Math.round(m-g.height/2)}if(b||null==k.bounds||k.scale!=a.view.scale||!k.bounds.equals(g))k.bounds=g,k.scale=a.view.scale,k.viewTranslate=a.view.translate,k.redraw()})}}; mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}}; mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+Math.max(b/2,9)*d,f=a.y+Math.max(c/2,9)*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e, f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null}; mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShapesForState(a),e=0;e<d.length;e++)if(null!=d[e]&&null!=d[e].node){var f=d[e].node.parentNode!=a.view.getDrawPane()&&d[e].node.parentNode!=a.view.getOverlayPane(),g=f?c:b;if(null!=g&&null!=g.parentNode&&g.nextSibling!=d[e].node)null==g.nextSibling?g.parentNode.appendChild(d[e].node):g.parentNode.insertBefore(d[e].node,g.nextSibling);else if(null==g)if(d[e].node.parentNode==a.view.graph.container){for(g=a.view.canvas;null!= g&&g.parentNode!=a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]}; mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);null==a.shape||null!=c&&!c||(this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b))}; mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE]&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a), this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):b||null==a.shape||mxUtils.equalEntries(a.shape.style,a.style)&&!this.checkPlaceholderStyles(a)||(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);null!=a.shape&&a.shape.indicatorShape!=this.getShape(a.view.graph.getIndicatorShape(a))&&(null!=a.shape.indicator&&(a.shape.indicator.destroy(),a.shape.indicator=null),this.createIndicatorShape(a), null!=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,a.shape.viewTranslate=a.view.translate,(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);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), m=Math.max(b.x+b.width,c.x+c.width);k=Math.min(b.y,c.y);var n=Math.max(b.y+b.height,c.y+c.height);f=a.view.transformControlPoint(a,f);g=f.y<k||f.y>n;k=f.x<l||f.x>m}else l=Math.max(b.x,c.x),m=Math.min(b.x+b.width,c.x+c.width),(g=l==m)||(k=Math.max(b.y,c.y),n=Math.min(b.y+b.height,c.y+c.height),k=k==n);k||!g&&a.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(a,b,c,d,e):mxEdgeStyle.TopToBottom(a,b,c,d,e)},SideToSide:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length? d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),k=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(k+(a-k)/2),k=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(k=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a, k)),mxUtils.contains(c,a,f)||mxUtils.contains(b,a,f)||e.push(new mxPoint(a,f)),1==e.length&&(null!=d?mxUtils.contains(c,a,d.y)||mxUtils.contains(b,a,d.y)||e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),e.push(new mxPoint(a,f+(Math.min(b.y+b.height,c.y+c.height)-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState, c.x=g.x,c.y=g.y);null!=b&&null!=c&&(k=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),null!=d&&d.x>=b.x&&d.x<=b.x+b.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?mxUtils.contains(c,d.x,k)||mxUtils.contains(b,d.x,k)|| e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),e.push(new mxPoint(f+(Math.min(b.x+b.width,c.x+c.width)-f)/2,k)))))},SegmentConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale),g=mxEdgeStyle.scaleCellState(b,a.view.scale),k=mxEdgeStyle.scaleCellState(c,a.view.scale),l=[],m=0<e.length?e[0]:null,n=!0,p=f[0];null==p&&null!=g?p=new mxPoint(a.view.getRoutingCenterX(g),a.view.getRoutingCenterY(g)):null!=p&&(p=p.clone());var q=f.length-1;if(null!=d&&0<d.length){for(var r= [],t=0;t<d.length;t++){var u=a.view.transformControlPoint(a,d[t],!0);null!=u&&r.push(u)}if(0==r.length)return;null!=p&&null!=r[0]&&(1>Math.abs(r[0].x-p.x)&&(r[0].x=p.x),1>Math.abs(r[0].y-p.y)&&(r[0].y=p.y));u=f[q];null!=u&&null!=r[r.length-1]&&(1>Math.abs(r[r.length-1].x-u.x)&&(r[r.length-1].x=u.x),1>Math.abs(r[r.length-1].y-u.y)&&(r[r.length-1].y=u.y));d=r[0];var v=g,y=f[0],A=d;null!=y&&(v=null);for(t=0;2>t;t++){var z=null!=y&&y.x==A.x,x=null!=y&&y.y==A.y,C=null!=v&&A.y>=v.y&&A.y<=v.y+v.height,D= null!=v&&A.x>=v.x&&A.x<=v.x+v.width;v=x||null==y&&C;A=z||null==y&&D;if(0!=t||!(v&&A||z&&x)){if(null!=y&&!x&&!z&&(C||D)){n=C?!1:!0;break}if(A||v){n=v;1==t&&(n=0==r.length%2?v:A);break}}v=k;y=f[q];null!=y&&(v=null);A=r[r.length-1];z&&x&&(r=r.slice(1))}n&&(null!=f[0]&&f[0].y!=d.y||null==f[0]&&null!=g&&(d.y<g.y||d.y>g.y+g.height))?l.push(new mxPoint(p.x,d.y)):!n&&(null!=f[0]&&f[0].x!=d.x||null==f[0]&&null!=g&&(d.x<g.x||d.x>g.x+g.width))&&l.push(new mxPoint(d.x,p.y));n?p.y=d.y:p.x=d.x;for(t=0;t<r.length;t++)n= !n,d=r[t],n?p.y=d.y:p.x=d.x,l.push(p.clone())}else d=p,n=!0;p=f[q];null==p&&null!=k&&(p=new mxPoint(a.view.getRoutingCenterX(k),a.view.getRoutingCenterY(k)));null!=p&&null!=d&&(n&&(null!=f[q]&&f[q].y!=d.y||null==f[q]&&null!=k&&(d.y<k.y||d.y>k.y+k.height))?l.push(new mxPoint(p.x,d.y)):!n&&(null!=f[q]&&f[q].x!=d.x||null==f[q]&&null!=k&&(d.x<k.x||d.x>k.x+k.width))&&l.push(new mxPoint(d.x,p.y)));if(null==b||b!=c||"1"!=mxUtils.getValue(a.style,"innerLoopWaypoints","0")){if(null==f[0]&&null!=g)for(;0<l.length&& null!=l[0]&&mxUtils.contains(g,l[0].x,l[0].y);)l.splice(0,1);if(null==f[q]&&null!=k)for(;0<l.length&&null!=l[l.length-1]&&mxUtils.contains(k,l[l.length-1].x,l[l.length-1].y);)l.splice(l.length-1,1)}for(t=0;t<l.length;t++)if(b=l[t],b.x=Math.round(b.x*a.view.scale*10)/10,b.y=Math.round(b.y*a.view.scale*10)/10,null==m||1<=Math.abs(m.x-b.x)||Math.abs(m.y-b.y)>=Math.max(1,a.view.scale))e.push(b),m=b;null!=u&&null!=e[e.length-1]&&1>=Math.abs(u.x-e[e.length-1].x)&&1>=Math.abs(u.y-e[e.length-1].y)&&(e.splice(e.length- 1,1),null!=e[e.length-1]&&(1>Math.abs(e[e.length-1].x-u.x)&&(e[e.length-1].x=u.x),1>Math.abs(e[e.length-1].y-u.y)&&(e[e.length-1].y=u.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561], [514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0, 0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(a,b){var c=mxUtils.getValue(a.style,b?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==c&&(mxUtils.getValue(a.style,b?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW, mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,b?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),c=Math.max(2,Math.ceil((a+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):c=2*mxEdgeStyle.orthBuffer);return c},scalePointArray:function(a,b){var c=[];if(null!=a)for(var d=0;d<a.length;d++)if(null!=a[d]){var e=new mxPoint(Math.round(a[d].x/b*10)/10,Math.round(a[d].y/b*10)/10);c[d]=e}else c[d]=null;else c=null;return c},scaleCellState:function(a, b){if(null!=a){var c=a.clone();c.setRect(Math.round(a.x/b*10)/10,Math.round(a.y/b*10)/10,Math.round(a.width/b*10)/10,Math.round(a.height/b*10)/10)}else c=null;return c},OrthConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale),g=mxEdgeStyle.scaleCellState(b,a.view.scale),k=mxEdgeStyle.scaleCellState(c,a.view.scale),l=f[0],m=f[f.length-1];f=null!=g?g.x:l.x;var n=null!=g?g.y:l.y,p=null!=g?g.width:1,q=null!=g?g.height:1,r=null!=k?k.x:m.x,t=null!=k?k.y:m.y,u=null!= k?k.width:1,v=null!=k?k.height:1,y=mxEdgeStyle.getJettySize(a,!0),A=mxEdgeStyle.getJettySize(a,!1);null!=g&&k==g&&(y=A=Math.max(y,A));var z=A+y,x=!1;if(null!=l&&null!=m){x=m.x-l.x;var C=m.y-l.y;x=x*x+C*C<z*z}if(x||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else if(c=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],null!=g&&(c[0]=mxUtils.getPortConstraints(g,a,!0,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(g.style,mxConstants.STYLE_ROTATION, 0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(f,n,p,q),b),f=b.x,n=b.y,p=b.width,q=b.height)),null!=k&&(c[1]=mxUtils.getPortConstraints(k,a,!1,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(r,t,u,v),b),r=b.x,t=b.y,u=b.width,v=b.height)),0!=p&&0!=q&&0!=u&&0!=v){b=[0,0];f=[[f,n,p,q],[r,t,u,v]];A=[y,A];for(x=0;2>x;x++)mxEdgeStyle.limits[x][1]=f[x][0]-A[x],mxEdgeStyle.limits[x][2]=f[x][1]-A[x],mxEdgeStyle.limits[x][4]= f[x][0]+f[x][2]+A[x],mxEdgeStyle.limits[x][8]=f[x][1]+f[x][3]+A[x];A=f[0][1]+f[0][3]/2;n=f[1][1]+f[1][3]/2;x=f[0][0]+f[0][2]/2-(f[1][0]+f[1][2]/2);C=A-n;A=0;0>x?A=0>C?2:1:0>=C&&(A=3,0==x&&(A=2));n=null;null!=g&&(n=l);l=[[.5,.5],[.5,.5]];g||(l[0]=[0,0]);k||(l[1]=[0,0]);for(x=0;2>x;x++)null!=n&&(l[x][0]=(n.x-f[x][0])/f[x][2],1>=Math.abs(n.x-f[x][0])?b[x]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(n.x-f[x][0]-f[x][2])&&(b[x]=mxConstants.DIRECTION_MASK_EAST),l[x][1]=(n.y-f[x][1])/f[x][3],1>=Math.abs(n.y- f[x][1])?b[x]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(n.y-f[x][1]-f[x][3])&&(b[x]=mxConstants.DIRECTION_MASK_SOUTH)),n=null,null!=k&&(n=m);x=f[0][1]-(f[1][1]+f[1][3]);m=f[0][0]-(f[1][0]+f[1][2]);n=f[1][1]-(f[0][1]+f[0][3]);p=f[1][0]-(f[0][0]+f[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(x-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(n-z,0);mxEdgeStyle.vertexSeperations[3]=Math.max(p-z,0);z=[];g=[];k=[];g[0]=m>=p?mxConstants.DIRECTION_MASK_WEST: mxConstants.DIRECTION_MASK_EAST;k[0]=x>=n?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;g[1]=mxUtils.reversePortConstraints(g[0]);k[1]=mxUtils.reversePortConstraints(k[0]);m=m>=p?m:p;n=x>=n?x:n;p=[[0,0],[0,0]];q=!1;for(x=0;2>x;x++)0==b[x]&&(0==(g[x]&c[x])&&(g[x]=mxUtils.reversePortConstraints(g[x])),0==(k[x]&c[x])&&(k[x]=mxUtils.reversePortConstraints(k[x])),p[x][0]=k[x],p[x][1]=g[x]);0<n&&0<m&&(0<(g[0]&c[0])&&0<(k[1]&c[1])?(p[0][0]=g[0],p[0][1]=k[0],p[1][0]=k[1],p[1][1]=g[1], q=!0):0<(k[0]&c[0])&&0<(g[1]&c[1])&&(p[0][0]=k[0],p[0][1]=g[0],p[1][0]=g[1],p[1][1]=k[1],q=!0));0<n&&!q&&(p[0][0]=k[0],p[0][1]=g[0],p[1][0]=k[1],p[1][1]=g[1],q=!0);0<m&&!q&&(p[0][0]=g[0],p[0][1]=k[0],p[1][0]=g[1],p[1][1]=k[1]);for(x=0;2>x;x++)0==b[x]&&(0==(p[x][0]&c[x])&&(p[x][0]=p[x][1]),z[x]=p[x][0]&c[x],z[x]|=(p[x][1]&c[x])<<8,z[x]|=(p[1-x][x]&c[x])<<16,z[x]|=(p[1-x][1-x]&c[x])<<24,0==(z[x]&15)&&(z[x]<<=8),0==(z[x]&3840)&&(z[x]=z[x]&15|z[x]>>8),0==(z[x]&983040)&&(z[x]=z[x]&65535|(z[x]&251658240)>> 8),b[x]=z[x]&15,c[x]==mxConstants.DIRECTION_MASK_WEST||c[x]==mxConstants.DIRECTION_MASK_NORTH||c[x]==mxConstants.DIRECTION_MASK_EAST||c[x]==mxConstants.DIRECTION_MASK_SOUTH)&&(b[x]=c[x]);c=b[0]==mxConstants.DIRECTION_MASK_EAST?3:b[0];z=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=A;z-=A;1>c&&(c+=4);1>z&&(z+=4);c=mxEdgeStyle.routePatterns[c-1][z-1];mxEdgeStyle.wayPoints1[0][0]=f[0][0];mxEdgeStyle.wayPoints1[0][1]=f[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-= y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*f[0][2];mxEdgeStyle.wayPoints1[0][1]+=f[0][3]+y;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=f[0][2]+y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*f[0][2],mxEdgeStyle.wayPoints1[0][1]-=y}y=0;g=z=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))? 0:1;for(x=0;x<c.length;x++)k=c[x]&15,q=k==mxConstants.DIRECTION_MASK_EAST?3:k,q+=A,4<q&&(q-=4),m=mxEdgeStyle.dirVectors[q-1],k=0<q%2?0:1,k!=z&&(y++,mxEdgeStyle.wayPoints1[y][0]=mxEdgeStyle.wayPoints1[y-1][0],mxEdgeStyle.wayPoints1[y][1]=mxEdgeStyle.wayPoints1[y-1][1]),r=0<(c[x]&mxEdgeStyle.TARGET_MASK),t=0<(c[x]&mxEdgeStyle.SOURCE_MASK),n=(c[x]&mxEdgeStyle.SIDE_MASK)>>5,n<<=A,15<n&&(n>>=4),p=0<(c[x]&mxEdgeStyle.CENTER_MASK),(t||r)&&9>n?(q=t?0:1,n=p&&0==k?f[q][0]+l[q][0]*f[q][2]:p?f[q][1]+l[q][1]* f[q][3]:mxEdgeStyle.limits[q][n],0==k?(n=(n-mxEdgeStyle.wayPoints1[y][0])*m[0],0<n&&(mxEdgeStyle.wayPoints1[y][0]+=m[0]*n)):(n=(n-mxEdgeStyle.wayPoints1[y][1])*m[1],0<n&&(mxEdgeStyle.wayPoints1[y][1]+=m[1]*n))):p&&(mxEdgeStyle.wayPoints1[y][0]+=m[0]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2),mxEdgeStyle.wayPoints1[y][1]+=m[1]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2)),0<y&&mxEdgeStyle.wayPoints1[y][k]==mxEdgeStyle.wayPoints1[y-1][k]?y--:z=k;for(x=0;x<=y&&(x!=y||((0<(b[1]&(mxConstants.DIRECTION_MASK_EAST| mxConstants.DIRECTION_MASK_WEST))?0:1)==g?0:1)==(y+1)%2);x++)e.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[x][0]*a.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[x][1]*a.view.scale*10)/10));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];0!=c&& 0!=d||null==inlineRoutePatterns[e-1][a-1]||(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:Object.create(null),putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation); mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter); mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);function mxGraphView(a){this.graph=a;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource; mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"";mxGraphView.prototype.allowEval=!1;mxGraphView.prototype.captureDocumentGesture=!0;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null; mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a}; mxGraphView.prototype.getBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.getState(a[d]);null!=e&&(null==b?b=mxRectangle.fromRectangle(e):b.add(e))}return b};mxGraphView.prototype.setCurrentRoot=function(a){if(this.currentRoot!=a){var b=new mxCurrentRootChange(this,a);b.execute();var c=new mxUndoableEdit(this,!0);c.add(b);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c));this.graph.sizeDidChange()}return a}; mxGraphView.prototype.scaleAndTranslate=function(a,b,c){var d=this.scale,e=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=a||this.translate.x!=b||this.translate.y!=c)this.scale=a,this.translate.x=b,this.translate.y=c,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",a,"previousScale",d,"translate",this.translate,"previousTranslate",e))};mxGraphView.prototype.getScale=function(){return this.scale}; mxGraphView.prototype.setScale=function(a){var b=this.scale;this.scale!=a&&(this.scale=a,this.isEventsEnabled()&&this.viewStateChanged());this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",a,"previousScale",b))};mxGraphView.prototype.getTranslate=function(){return this.translate}; mxGraphView.prototype.setTranslate=function(a,b){var c=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=a||this.translate.y!=b)this.translate.x=a,this.translate.y=b,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",c))};mxGraphView.prototype.viewStateChanged=function(){this.revalidate();this.graph.sizeDidChange()}; mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear();this.revalidate()};mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!1;c=null!=c?c:!0;this.removeState(a);if(c&&(b||a!=this.currentRoot)){c=d.getChildCount(a);for(var e=0;e<c;e++)this.clear(d.getChildAt(a,e),b)}else this.invalidate(a)}; mxGraphView.prototype.invalidate=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();if(null!=a){b=null!=b?b:!0;c=null!=c?c:!0;var e=this.getState(a);null!=e&&(e.invalid=!0);if(!a.invalidating){a.invalidating=!0;if(b){var f=d.getChildCount(a);for(e=0;e<f;e++){var g=d.getChildAt(a,e);this.invalidate(g,b,c)}}if(c)for(f=d.getEdgeCount(a),e=0;e<f;e++)this.invalidate(d.getEdgeAt(a,e),b,c);delete a.invalidating}}}; mxGraphView.prototype.validate=function(a){var b=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();a=null!=a?a:null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot();a=this.validateCellState(this.validateCell(a));a=this.getBoundingBox(a,!0,!0);this.setGraphBounds(null!=a?a:this.getEmptyBounds());this.validateBackground();this.resetValidationState();window.status=mxResources.get(this.doneResource)|| this.doneResource;mxLog.leave("mxGraphView.validate",b)};mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};mxGraphView.prototype.updateBoundingBox=function(a){null!=a.shape&&a.shape.updateBoundingBox();null!=a.text&&a.text.updateBoundingBox()}; mxGraphView.prototype.getBoundingBox=function(a,b,c){b=null!=b?b:!0;c=null!=c?c:!1;var d=null;if(null!=a){var e=function(l){null==l||null==l.boundingBox||isNaN(l.boundingBox.x)||isNaN(l.boundingBox.y)||isNaN(l.boundingBox.width)||isNaN(l.boundingBox.height)||(null==d?d=l.boundingBox.clone():d.add(l.boundingBox))};c&&this.updateBoundingBox(a);e(a.shape);e(a.text);if(b){e=this.graph.getModel();for(var f=e.getChildCount(a.cell),g=0;g<f;g++){var k=this.getBoundingBox(this.getState(e.getChildAt(a.cell, g)),b,c);null!=k&&(null==d?d=k:d.add(k))}}}return d};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()}; mxGraphView.prototype.validateBackgroundImage=function(){var a=this.graph.getBackgroundImage();if(null!=a){if(null==this.backgroundImage||this.backgroundImage.image!=a.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var b=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(b,a.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,a)}else null!=this.backgroundImage&& (this.backgroundImage.destroy(),this.backgroundImage=null)}; mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var a=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(a),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node, "dblclick",mxUtils.bind(this,function(b){this.graph.dblClick(b)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide();this.graph.isMouseDown&&!mxEvent.isConsumed(b)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(b))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=a,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.graph.pageFormat,b=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,a.width*b,a.height*b)}; mxGraphView.prototype.redrawBackgroundImage=function(a,b){b=new mxRectangle(this.scale*(this.translate.x+b.x),this.scale*(this.translate.y+b.y),this.scale*b.width,this.scale*b.height);a.scale==this.scale&&b.equals(a.bounds)||(a.scale=this.scale,a.bounds=b,null==a.node||"g"!=a.node.nodeName||"image"!=a.node.firstChild.nodeName&&"svg"!=a.node.firstChild.nodeName?a.redraw():(a.node.firstChild.setAttribute("x",b.x),a.node.firstChild.setAttribute("y",b.y),a.node.firstChild.setAttribute("width",b.width), a.node.firstChild.setAttribute("height",b.height)))};mxGraphView.prototype.validateCell=function(a,b){if(null!=a)if(b=(null!=b?b:!0)&&this.graph.isCellVisible(a),null==this.getState(a,b)||b)for(var c=this.graph.getModel(),d=c.getChildCount(a),e=0;e<d;e++)this.validateCell(c.getChildAt(a,e),b&&(!this.isCellCollapsed(a)||a==this.currentRoot));else this.removeState(a);return a}; mxGraphView.prototype.validateCellState=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(c=this.getState(a),null!=c)){var d=this.graph.getModel();if(c.invalid){c.invalid=!1;if(null==c.style||c.invalidStyle)c.style=this.graph.getCellStyle(c.cell),c.invalidStyle=!1;a!=this.currentRoot&&this.validateCellState(d.getParent(a),!1);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!0),!1),!0);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!1),!1), !1);this.updateCellState(c);a==this.currentRoot||c.invalid||(this.graph.cellRenderer.redraw(c,!1,this.isRendering()),c.updateCachedBounds())}if(b&&!c.invalid){null!=c.shape&&this.stateValidated(c);b=d.getChildCount(a);for(var e=0;e<b;e++)this.validateCellState(d.getChildAt(a,e))}}return c}; mxGraphView.prototype.updateCellState=function(a){a.absoluteOffset.x=0;a.absoluteOffset.y=0;a.origin.x=0;a.origin.y=0;a.length=0;if(a.cell!=this.currentRoot){var b=this.graph.getModel(),c=this.getState(b.getParent(a.cell));null!=c&&c.cell!=this.currentRoot&&(a.origin.x+=c.origin.x,a.origin.y+=c.origin.y);var d=this.graph.getChildOffsetForCell(a.cell);null!=d&&(a.origin.x+=d.x,a.origin.y+=d.y);var e=this.graph.getCellGeometry(a.cell);null!=e&&(b.isEdge(a.cell)||(d=null!=e.offset?e.offset:this.EMPTY_POINT, e.relative&&null!=c?b.isEdge(c.cell)?(d=this.getPoint(c,e),null!=d&&(a.origin.x+=d.x/this.scale-c.origin.x-this.translate.x,a.origin.y+=d.y/this.scale-c.origin.y-this.translate.y)):(a.origin.x+=e.x*c.unscaledWidth+d.x,a.origin.y+=e.y*c.unscaledHeight+d.y):(a.absoluteOffset.x=this.scale*d.x,a.absoluteOffset.y=this.scale*d.y,a.origin.x+=e.x,a.origin.y+=e.y)),a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*e.width,a.unscaledWidth=e.width,a.height= this.scale*e.height,a.unscaledHeight=e.height,b.isVertex(a.cell)&&this.updateVertexState(a,e),b.isEdge(a.cell)&&this.updateEdgeState(a,e))}a.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(a){return this.graph.isCellCollapsed(a)}; mxGraphView.prototype.updateVertexState=function(a,b){var c=this.graph.getModel(),d=this.getState(c.getParent(a.cell));if(b.relative&&null!=d&&!c.isEdge(d.cell)&&(c=mxUtils.toRadians(d.style[mxConstants.STYLE_ROTATION]||"0"),0!=c)){b=Math.cos(c);c=Math.sin(c);var e=new mxPoint(a.getCenterX(),a.getCenterY());d=new mxPoint(d.getCenterX(),d.getCenterY());d=mxUtils.getRotatedPoint(e,b,c,d);a.x=d.x-a.width/2;a.y=d.y-a.height/2}this.updateVertexLabelOffset(a)}; mxGraphView.prototype.updateEdgeState=function(a,b){var c=a.getVisibleTerminalState(!0),d=a.getVisibleTerminalState(!1),e="function"===typeof b.getTerminalPoint;null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&(!e||null==b.getTerminalPoint(!0))||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&(!e||null==b.getTerminalPoint(!1))?this.clear(a.cell,!0):(this.updateFixedTerminalPoints(a,c,d),this.updatePoints(a,b.points,c,d),this.updateFloatingTerminalPoints(a,c,d),b=a.absolutePoints, a.cell!=this.currentRoot&&(null==b||2>b.length||null==b[0]||null==b[b.length-1])?this.clear(a.cell,!0):(this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)))}; mxGraphView.prototype.updateVertexLabelOffset=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(b==mxConstants.ALIGN_LEFT)b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),b=null!=b?b*this.scale:a.width,a.absoluteOffset.x-=b;else if(b==mxConstants.ALIGN_RIGHT)a.absoluteOffset.x+=a.width;else if(b==mxConstants.ALIGN_CENTER&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),null!=b)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),d=0;c==mxConstants.ALIGN_CENTER?d=.5:c==mxConstants.ALIGN_RIGHT&&(d=1);0!=d&&(a.absoluteOffset.x-=(b*this.scale-a.width)*d)}b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b==mxConstants.ALIGN_TOP?a.absoluteOffset.y-=a.height:b==mxConstants.ALIGN_BOTTOM&&(a.absoluteOffset.y+=a.height)};mxGraphView.prototype.resetValidationState=function(){this.lastForegroundHtmlNode=this.lastForegroundNode=this.lastHtmlNode=this.lastNode=null}; mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEdge(a.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(a.cell)&&this.graph.keepEdgesInBackground;a=this.graph.cellRenderer.insertStateAfter(a,b?this.lastForegroundNode||this.lastNode:this.lastNode,b?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode);b?(this.lastForegroundHtmlNode=a[1],this.lastForegroundNode=a[0]):(this.lastHtmlNode=a[1],this.lastNode=a[0])}; mxGraphView.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.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?a.shape.stencil.h0:a.shape.stencil.w0;d=d?a.shape.stencil.w0:a.shape.stencil.h0;var e=Math.min(a.width/c,a.height/d);a.setRect(a.x+(a.width-c*e)/2,a.y+(a.height-d*e)/2,c*e,d*e)}return b}; 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=c!=d?this.updateBoundsFromStencil(d):null;try{f(a,c,d,b,e)}finally{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;if(null!=d){var 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)}; mxGraphView.prototype.getFloatingTerminalPoint=function(a,b,c,d){b=this.getTerminalPort(a,b,d);var e=this.getNextPoint(a,c,d),f=this.graph.isOrthogonal(a);c=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0"));var g=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=c){var k=Math.cos(-c),l=Math.sin(-c);e=mxUtils.getRotatedPoint(e,k,l,g)}k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| 0);a=this.getPerimeterPoint(b,e,0==c&&f,k);0!=c&&(k=Math.cos(c),l=Math.sin(c),a=mxUtils.getRotatedPoint(a,k,l,g));return a};mxGraphView.prototype.getTerminalPort=function(a,b,c){a=mxUtils.getValue(a.style,c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT);null!=a&&(a=this.getState(this.graph.getModel().getCell(a)),null!=a&&(b=a));return b}; mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a){var f=this.getPerimeterFunction(a);if(null!=f&&null!=b&&(d=this.getPerimeterBounds(a,d),0<d.width||0<d.height)){e=new mxPoint(b.x,b.y);var g=b=!1;this.graph.model.isVertex(a.cell)&&(b=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPH,0),g=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPV,0),null!=a.shape&&null!=a.shape.stencil&&(b=1==mxUtils.getValue(a.style,"stencilFlipH",0)||b,g=1==mxUtils.getValue(a.style,"stencilFlipV", 0)||g),b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y));e=f(d,a,e,c);null!=e&&(b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y))}null==e&&(e=this.getPoint(a))}return e};mxGraphView.prototype.getRoutingCenterX=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return a.getCenterX()+b*a.width}; mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)}; mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d}; mxGraphView.prototype.getVisibleTerminal=function(a,b){var c=this.graph.getModel();for(b=a=c.getTerminal(a,b);null!=a&&a!=this.currentRoot;){if(!this.graph.isCellVisible(b)||this.isCellCollapsed(a))b=a;a=c.getParent(a)}null==b||c.contains(b)&&c.getParent(b)!=c.getRoot()&&b!=this.currentRoot||(b=null);return b}; mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;d=0;var g=[];f=c;if(null!=f){c=f.x;for(var k=f.y,l=c,m=k,n=1;n<b.length;n++){var p=b[n];null!=p&&(e=f.x-p.x,f=f.y-p.y,e=Math.sqrt(e*e+f*f),g.push(e),d+=e,f=p,c=Math.min(f.x,c),k=Math.min(f.y,k),l=Math.max(f.x,l),m=Math.max(f.y,m))}a.length=d;a.segments=g;a.x=c;a.y=k;a.width=Math.max(1,l-c);a.height= Math.max(1,m-k)}}; mxGraphView.prototype.getPoint=function(a,b){var c=a.getCenterX(),d=a.getCenterY();if(null==a.segments||null!=b&&!b.relative)null!=b&&(b=b.offset,null!=b&&(c+=b.x,d+=b.y));else{for(var e=a.absolutePoints.length,f=Math.round(((null!=b?b.x/2:0)+.5)*a.length),g=a.segments[0],k=0,l=1;f>=Math.round(k+g)&&l<e-1;)k+=g,g=a.segments[l++];e=0==g?0:(f-k)/g;f=a.absolutePoints[l-1];a=a.absolutePoints[l];null!=f&&null!=a&&(l=c=d=0,null!=b&&(d=b.y,b=b.offset,null!=b&&(c=b.x,l=b.y)),b=a.x-f.x,a=a.y-f.y,c=f.x+b*e+ ((0==g?0:a/g)*d+c)*this.scale,d=f.y+a*e-((0==g?0:b/g)*d-l)*this.scale)}return new mxPoint(c,d)}; mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1<e){d=a.length;for(var f=a.segments,g=a.absolutePoints[0],k=a.absolutePoints[1],l=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),m=0,n=0,p=0,q=2;q<e;q++)g=k,k=a.absolutePoints[q],g=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),p+=f[q-2],g<=l&&(l=g,n=q-1,m=p);e=f[n];g=a.absolutePoints[n];k=a.absolutePoints[n+1];l=k.x;f=k.y;a=g.x-l;n=g.y-f;f=(a-(b-l))* a+(n-(c-f))*n;a=Math.sqrt(0>=f?0:f*f/(a*a+n*n));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(0<d?(d/2-m-a)/d*-2:0,e/this.scale)}}return new mxPoint}; mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0<b.length&&null!=a.segments){var c=this.graph.getCellGeometry(a.cell);if(c.relative){var d=this.getPoint(a,c);null!=d&&(a.absoluteOffset=d)}else{d=b[0];var e=b[b.length-1];if(null!=d&&null!=e){b=e.x-d.x;var f=e.y-d.y,g=e=0;c=c.offset;null!=c&&(e=c.x,g=c.y);c=d.y+f/2+g*this.scale;a.absoluteOffset.x=d.x+b/2+e*this.scale;a.absoluteOffset.y=c}}}}; mxGraphView.prototype.getState=function(a,b){b=b||!1;var c=null;null!=a&&(c=this.states.get(a),b&&(null==c||this.updateStyle)&&this.graph.isCellVisible(a)&&(null==c?(c=this.createState(a),this.states.put(a,c)):c.style=this.graph.getCellStyle(a)));return c};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(a){this.rendering=a};mxGraphView.prototype.isAllowEval=function(){return this.allowEval}; mxGraphView.prototype.setAllowEval=function(a){this.allowEval=a};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(a){this.states=a};mxGraphView.prototype.getCellStates=function(a){if(null==a)return this.states;for(var b=[],c=0;c<a.length;c++){var d=this.getState(a[c]);null!=d&&b.push(d)}return b}; mxGraphView.prototype.removeState=function(a){var b=null;null!=a&&(b=this.states.remove(a),null!=b&&(this.graph.cellRenderer.destroy(b),b.invalid=!0,b.destroy()));return b};mxGraphView.prototype.createState=function(a){return new mxCellState(this,a,this.graph.getCellStyle(a))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane}; mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(a){a=mxEvent.getSource(a);return a==this.graph.container||this.backgroundPane.contains(a)||a==this.canvas.parentNode||a==this.canvas||a==this.drawPane||a==this.overlayPane||a==this.decoratorPane}; mxGraphView.prototype.isScrollEvent=function(a){var b=mxUtils.getOffset(this.graph.container);a=new mxPoint(a.clientX-b.x,a.clientY-b.y);b=this.graph.container.offsetWidth;var c=this.graph.container.clientWidth;if(b>c&&a.x>c+2&&a.x<=b)return!0;b=this.graph.container.offsetHeight;c=this.graph.container.clientHeight;return b>c&&a.y>c+2&&a.y<=b?!0:!1};mxGraphView.prototype.init=function(){this.installListeners();this.graph.dialect==mxConstants.DIALECT_SVG?this.createSvg():this.createHtml()}; mxGraphView.prototype.installListeners=function(){var a=this.graph,b=a.container;null!=b&&(mxClient.IS_TOUCH&&(mxEvent.addListener(b,"gesturestart",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gesturechange",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gestureend",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)}))),mxEvent.addGestureListeners(b,mxUtils.bind(this,function(c){!this.isContainerEvent(c)|| (mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(c)||a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})),mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.dblClick(c)})),a.addMouseListener({mouseDown:function(c, d){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();if(this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(c)){var d=a.fireMouseEvent,e=mxEvent.MOUSE_MOVE,f=null;if(mxClient.IS_TOUCH){f=mxEvent.getClientX(c);var g= mxEvent.getClientY(c);f=mxUtils.convertPoint(b,f,g);f=a.view.getState(a.getCellAt(f.x,f.y))}d.call(a,e,new mxMouseEvent(c,f))}}),this.endHandler=mxUtils.bind(this,function(c){this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler))}; mxGraphView.prototype.createHtml=function(){var a=this.graph.container;null!=a&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane), a.appendChild(this.canvas),this.updateContainerStyle(a))};mxGraphView.prototype.updateHtmlCanvasSize=function(a,b){if(null!=this.graph.container){var c=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<a?a+"px":"100%";this.canvas.style.height=c<b?b+"px":"100%"}}; mxGraphView.prototype.createHtmlPane=function(a,b){var c=document.createElement("DIV");null!=a&&null!=b?(c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width=a,c.style.height=b):c.style.position="relative";return c}; mxGraphView.prototype.createSvg=function(){var a=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG, "g");this.canvas.appendChild(this.decoratorPane);var b=document.createElementNS(mxConstants.NS_SVG,"svg");b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";b.style.display="block";b.appendChild(this.canvas);null!=a&&(a.appendChild(b),this.updateContainerStyle(a))};mxGraphView.prototype.updateContainerStyle=function(a){var b=mxUtils.getCurrentStyle(a);null!=b&&"static"==b.position&&(a.style.position="relative");mxClient.IS_POINTER&&(a.style.touchAction="none")}; mxGraphView.prototype.destroy=function(){var a=null!=this.canvas?this.canvas.ownerSVGElement:null;null==a&&(a=this.canvas);null!=a&&null!=a.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),a.parentNode.removeChild(a),this.decoratorPane=this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)}; function mxCurrentRootChange(a,b){this.view=a;this.previous=this.root=b;this.isUp=null==b;if(!this.isUp){a=this.view.currentRoot;for(var c=this.view.graph.getModel();null!=a;){if(a==b){this.isUp=!0;break}a=c.getParent(a)}}} mxCurrentRootChange.prototype.execute=function(){var a=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=a;a=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=a&&(this.view.translate=new mxPoint(-a.x,-a.y));this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp}; function mxGraph(a,b,c,d,e){this.mouseListeners=null;this.renderHint=c;this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:c==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:c==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML;this.model=null!=b?b:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(null!=d?d:this.createStylesheet()); this.view=this.createGraphView();this.view.rendering=null!=e?e:this.view.rendering;this.graphModelChangeListener=mxUtils.bind(this,function(f,g){this.graphModelChanged(g.getProperty("edit").changes)});this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();null!=a&&this.init(a);this.view.rendering&&this.view.revalidate()}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph"); mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=!1;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10; mxGraph.prototype.gridEnabled=!0;mxGraph.prototype.portsEnabled=!0;mxGraph.prototype.nativeDblClickEnabled=!0;mxGraph.prototype.doubleTapEnabled=!0;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=!0;mxGraph.prototype.tapAndHoldDelay=350;mxGraph.prototype.tapAndHoldInProgress=!1;mxGraph.prototype.tapAndHoldValid=!1; mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=!1;mxGraph.prototype.pageBreaksVisible=!1;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=!0;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.maxPageBreaks=1E4; mxGraph.prototype.preferPageSize=!1;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=!0;mxGraph.prototype.escapeEnabled=!0;mxGraph.prototype.invokesStopCellEditing=!0;mxGraph.prototype.enterStopsCellEditing=!1;mxGraph.prototype.useScrollbarsForPanning=!0;mxGraph.prototype.exportEnabled=!0;mxGraph.prototype.importEnabled=!0;mxGraph.prototype.cellsLocked=!1;mxGraph.prototype.cellsCloneable=!0; mxGraph.prototype.foldingEnabled=!0;mxGraph.prototype.cellsEditable=!0;mxGraph.prototype.cellsDeletable=!0;mxGraph.prototype.cellsMovable=!0;mxGraph.prototype.edgeLabelsMovable=!0;mxGraph.prototype.vertexLabelsMovable=!1;mxGraph.prototype.dropEnabled=!1;mxGraph.prototype.splitEnabled=!0;mxGraph.prototype.cellsResizable=!0;mxGraph.prototype.cellsBendable=!0;mxGraph.prototype.cellsSelectable=!0;mxGraph.prototype.cellsDisconnectable=!0;mxGraph.prototype.autoSizeCells=!1; mxGraph.prototype.autoSizeCellsOnAdd=!1;mxGraph.prototype.autoScroll=!0;mxGraph.prototype.ignoreScrollbars=!1;mxGraph.prototype.translateToScrollPosition=!1;mxGraph.prototype.timerAutoScroll=!1;mxGraph.prototype.allowAutoPanning=!1;mxGraph.prototype.autoExtend=!0;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=!1;mxGraph.prototype.border=0; mxGraph.prototype.keepEdgesInForeground=!1;mxGraph.prototype.keepEdgesInBackground=!1;mxGraph.prototype.allowNegativeCoordinates=!0;mxGraph.prototype.constrainChildren=!0;mxGraph.prototype.constrainRelativeChildren=!1;mxGraph.prototype.extendParents=!0;mxGraph.prototype.extendParentsOnAdd=!0;mxGraph.prototype.extendParentsOnMove=!1;mxGraph.prototype.contractParents=!1;mxGraph.prototype.contractParentsOnRemove=!0;mxGraph.prototype.contractParentsOnMove=!1;mxGraph.prototype.recursiveResize=!1; mxGraph.prototype.collapseToPreferredSize=!0;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=!1;mxGraph.prototype.centerZoom=!0;mxGraph.prototype.resetViewOnRootChange=!0;mxGraph.prototype.resetEdgesOnResize=!1;mxGraph.prototype.resetEdgesOnMove=!1;mxGraph.prototype.resetEdgesOnConnect=!0;mxGraph.prototype.allowLoops=!1;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=!0;mxGraph.prototype.connectableEdges=!1; mxGraph.prototype.allowDanglingEdges=!0;mxGraph.prototype.cloneInvalidEdges=!1;mxGraph.prototype.disconnectOnMove=!0;mxGraph.prototype.labelsVisible=!0;mxGraph.prototype.htmlLabels=!1;mxGraph.prototype.swimlaneSelectionEnabled=!0;mxGraph.prototype.swimlaneNesting=!0;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0; mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":""; mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"";mxGraph.prototype.init=function(a){this.container=a;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(a,"mouseleave",mxUtils.bind(this,function(b){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=b.relatedTarget&&this.tooltipHandler.hide()}))}; mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(!1);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(!1);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=!1;this.popupMenuHandler=this.createPopupMenuHandler()}; mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)}; mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view}; mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a}; mxGraph.prototype.getSelectionCellsForChanges=function(a,b){for(var c=new mxDictionary,d=[],e=mxUtils.bind(this,function(k){if(null!=k&&!c.get(k)&&this.model.contains(k)&&!this.model.isLayer(k))if(this.model.isEdge(k)||this.model.isVertex(k))c.put(k,!0),d.push(k);else for(var l=this.model.getChildCount(k),m=0;m<l;m++)e(this.model.getChildAt(k,m))}),f=0;f<a.length;f++){var g=a[f];g.constructor==mxRootChange||null!=b&&b(g)||e(this.getCellForChange(g))}return d}; mxGraph.prototype.getCellForChange=function(a){var b=null;a instanceof mxChildChange?b=a.child:null!=a.cell&&a.cell instanceof mxCell&&(b=a.cell);return b};mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()}; mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)if(this.model.contains(a[c])&&this.isCellVisible(a[c]))for(var d=this.model.getParent(a[c]);null!=d&&d!=this.view.currentRoot;){if(this.isCellCollapsed(d)||!this.isCellVisible(d)){b.push(a[c]);break}d=this.model.getParent(d)}else b.push(a[c]);this.removeSelectionCells(b)}; mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child), this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&(null==a.previous.equals||!a.previous.equals(a.geometry)))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell, !0,!0),a=this.view.getState(a.cell),null!=a&&(a.invalidStyle=!0)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell);null==this.getDefaultParent()||this.model.contains(this.getDefaultParent())||this.setDefaultParent(null)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)}; mxGraph.prototype.addCellOverlay=function(a,b){null==a.overlays&&(a.overlays=[]);a.overlays.push(b);var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",a,"overlay",b));return b};mxGraph.prototype.getCellOverlays=function(a){return a.overlays}; mxGraph.prototype.removeCellOverlay=function(a,b){if(null==b)this.removeCellOverlays(a);else{var c=mxUtils.indexOf(a.overlays,b);0<=c?(a.overlays.splice(c,1),0==a.overlays.length&&(a.overlays=null),c=this.view.getState(a),null!=c&&this.cellRenderer.redraw(c),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b))):b=null}return b}; mxGraph.prototype.removeCellOverlays=function(a){var b=a.overlays;if(null!=b){a.overlays=null;var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);for(c=0;c<b.length;c++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b[c]))}return b};mxGraph.prototype.clearCellOverlays=function(a){a=null!=a?a:this.model.getRoot();this.removeCellOverlays(a);for(var b=this.model.getChildCount(a),c=0;c<b;c++){var d=this.model.getChildAt(a,c);this.clearCellOverlays(d)}}; mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return c=null!=c?c:this.warningImage,b=new mxCellOverlay(c,"<font color=red>"+b+"</font>"),d&&b.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,f){this.isEnabled()&&this.setSelectionCell(a)})),this.addCellOverlay(a,b);this.removeCellOverlays(a);return null};mxGraph.prototype.startEditing=function(a,b){this.startEditingAtCell(null,a,b)}; mxGraph.prototype.startEditingAtCell=function(a,b,c){null!=b&&mxEvent.isMultiTouchEvent(b)||(null==a&&(a=this.getSelectionCell(),null==a||this.isCellEditable(a)||(a=null)),null!=a&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",a,"event",b)),this.cellEditor.startEditing(a,b,c),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",a,"event",b))))};mxGraph.prototype.getEditingValue=function(a,b){return this.convertValueToString(a)}; mxGraph.prototype.stopEditing=function(a){this.cellEditor.stopEditing(a);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",a))};mxGraph.prototype.labelChanged=function(a,b,c){this.model.beginUpdate();try{var d=a.value;this.cellLabelChanged(a,b,this.isAutoSizeCell(a));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",a,"value",b,"old",d,"event",c))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellLabelChanged=function(a,b,c){this.model.beginUpdate();try{this.model.setValue(a,b),c&&this.cellSizeUpdated(a,!1)}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(a){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",a))}; mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed()){if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(g){var k=this.isCellSelected(g.cell);e=e||k;return!e||k||g.cell!=c&&this.model.isAncestor(g.cell,c)}));null!=a&&(c=a)}}else if(this.isSwimlaneSelectionEnabled()&& (c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY()),!(null==c||this.isToggleEvent(b)&&mxEvent.isAltDown(b)))){d=c;for(a=[];null!=d;){d=this.model.getParent(d);var f=this.view.getState(d);this.isSwimlane(d)&&null!=f&&a.push(d)}if(0<a.length)for(a=a.reverse(),a.splice(0,0,c),a.push(c),d=0;d<a.length-1;d++)this.isCellSelected(a[d])&&(c=a[this.isToggleEvent(b)?d:d+1])}null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()}}; mxGraph.prototype.isSiblingSelected=function(a){for(var b=this.model,c=b.getParent(a),d=b.getChildCount(c),e=0;e<d;e++){var f=b.getChildAt(c,e);if(a!=f&&this.isCellSelected(f))return!0}return!1};mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))}; mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled()&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=b, this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))}; mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy));else{var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth- a;if(f<d){if(a=e.scrollLeft,e.scrollLeft+=d-f,c&&a==e.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){a=this.view.getDrawPane().ownerSVGElement;var g=this.container.scrollWidth+d-f}else g=Math.max(e.clientWidth,e.scrollWidth)+d-f,a=this.view.getCanvas();a.style.width=g+"px";e.scrollLeft+=d-f}}else f=a-e.scrollLeft,f<d&&(e.scrollLeft-=d-f);f=e.scrollTop+e.clientHeight-b;f<d?(a=e.scrollTop,e.scrollTop+=d-f,a==e.scrollTop&&c&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement, b=this.container.scrollHeight+d-f,a.style.height=b+"px"):(b=Math.max(e.clientHeight,e.scrollHeight)+d-f,a=this.view.getCanvas(),a.style.height=b+"px"),e.scrollTop+=d-f)):(f=b-e.scrollTop,f<d&&(e.scrollTop-=d-f))}}};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)}; mxGraph.prototype.getBorderSizes=function(){var a=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(a.paddingLeft)+("none"!=a.borderLeftStyle?mxUtils.parseCssNumber(a.borderLeftWidth):0),mxUtils.parseCssNumber(a.paddingTop)+("none"!=a.borderTopStyle?mxUtils.parseCssNumber(a.borderTopWidth):0),mxUtils.parseCssNumber(a.paddingRight)+("none"!=a.borderRightStyle?mxUtils.parseCssNumber(a.borderRightWidth):0),mxUtils.parseCssNumber(a.paddingBottom)+("none"!=a.borderBottomStyle? mxUtils.parseCssNumber(a.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(a,b,c){a=this.view.translate;var d=this.pageFormat,e=this.pageScale;d=new mxRectangle(0,0,Math.ceil(d.width*e),Math.ceil(d.height*e));return new mxRectangle(0,0,(this.pageBreaksVisible?Math.ceil(b/d.width):1)*d.width+2+a.x,(this.pageBreaksVisible?Math.ceil(c/d.height):1)*d.height+2+a.y)}; mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a?a:this.getBorder();b=null!=b?b:!1;c=null!=c?c:0;d=null!=d?d:!0;e=null!=e?e:!1;f=null!=f?f:!1;var k=this.getBorderSizes(),l=this.container.offsetWidth-k.x-k.width-1,m=null!=g?g:this.container.offsetHeight-k.y-k.height-1;g=this.getGraphBounds();if(0<g.width&&0<g.height){b&&null!=g.x&&null!=g.y&&(g=g.clone(),g.width+=g.x,g.height+=g.y,g.x=0,g.y=0);k=this.view.scale;var n=g.width/k,p=g.height/k;null!=this.backgroundImage&& null!=this.backgroundImage.width&&null!=this.backgroundImage.height&&(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var q=(b?a:2*a)+c+1;l-=q;m-=q;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft= a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale}; mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x)+a.width+2*b;b=Math.max(0,a.y)+a.height+2*b;null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,b));null!=d&&(c=d.width*this.view.scale,b= d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1, b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"}; mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e);d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height; var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(d.height/f.height)+1):0,k=a?Math.min(this.maxPageBreaks,Math.ceil(d.width/f.width)+1):0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(n){if(null!=n){for(var p=n==this.horizontalPageBreaks?g:k,q=0;q<=p;q++){var r=n==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x), Math.round(f.y+q*f.height)),new mxPoint(Math.round(f.x+l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.round(f.y)),new mxPoint(Math.round(f.x+q*f.width),Math.round(f.y+m))];null!=n[q]&&null!=n[q].node?(n[q].points=r,n[q].redraw()):(null!=n[q]&&n[q].destroy(),r=new mxPolyline(r,this.pageBreakColor),r.dialect=this.dialect,r.pointerEvents=!1,r.isDashed=this.pageBreakDashed,r.init(this.view.backgroundPane),r.redraw(),n[q]=r)}for(q=p;q<n.length;q++)n[q].destroy();n.splice(p, n.length-p)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};mxGraph.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());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/ 2:a==mxConstants.ALIGN_RIGHT?f.x=c-e.x-f.width:a==mxConstants.ALIGN_TOP?f.y=c-e.y:a==mxConstants.ALIGN_MIDDLE?f.y=c-e.y-f.height/2:a==mxConstants.ALIGN_BOTTOM?f.y=c-e.y-f.height:f.x=c-e.x,this.resizeCell(b[d],f));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",a,"cells",b))}finally{this.model.endUpdate()}}}return b}; mxGraph.prototype.flipEdge=function(a){if(null!=a&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var b=this.model.getStyle(a);null==b||0==b.length?this.model.setStyle(a,this.alternateEdgeStyle):this.model.setStyle(a,null);this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",a))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.addImageBundle=function(a){this.imageBundles.push(a)}; mxGraph.prototype.removeImageBundle=function(a){for(var b=[],c=0;c<this.imageBundles.length;c++)this.imageBundles[c]!=a&&b.push(this.imageBundles[c]);this.imageBundles=b};mxGraph.prototype.getImageFromBundles=function(a){if(null!=a)for(var b=0;b<this.imageBundles.length;b++){var c=this.imageBundles[b].getImage(a);if(null!=c)return c}return null}; mxGraph.prototype.orderCells=function(a,b,c){null==b&&(b=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0));this.model.beginUpdate();try{this.cellsOrdered(b,a,c),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",a,"cells",b,"increment",c))}finally{this.model.endUpdate()}return b}; mxGraph.prototype.cellsOrdered=function(a,b,c){if(null!=a){this.model.beginUpdate();try{for(var d=0;d<a.length;d++){var e=this.model.getParent(a[d]);b?c?this.model.add(e,a[d],Math.max(0,e.getIndex(a[d])-1)):this.model.add(e,a[d],d):c?this.model.add(e,a[d],Math.min(this.model.getChildCount(e)-1,e.getIndex(a[d])+1)):this.model.add(e,a[d],this.model.getChildCount(e)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",b,"cells",a,"increment",c))}finally{this.model.endUpdate()}}}; mxGraph.prototype.groupCells=function(a,b,c){null==c&&(c=mxUtils.sortCells(this.getSelectionCells(),!0));c=this.getCellsForGroup(c);null==a&&(a=this.createGroupCell(c));var d=this.getBoundsForGroup(a,c,b);if(1<c.length&&null!=d){var e=this.model.getParent(a);null==e&&(e=this.model.getParent(c[0]));this.model.beginUpdate();try{null==this.getCellGeometry(a)&&this.model.setGeometry(a,new mxGeometry);this.cellsResized([a],[d],!1);var f=this.model.getChildCount(e);this.cellsAdded([a],e,f,null,null,!1, !1,!1);f=this.model.getChildCount(a);this.cellsAdded(c,a,f,null,null,!1,!1,!1);this.cellsMoved(c,-d.x,-d.y,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",a,"border",b,"cells",c))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.getCellsForGroup=function(a){var b=[];if(null!=a&&0<a.length){var c=this.model.getParent(a[0]);b.push(a[0]);for(var d=1;d<a.length;d++)this.model.getParent(a[d])==c&&b.push(a[d])}return b}; mxGraph.prototype.getBoundsForGroup=function(a,b,c){b=this.getBoundingBoxFromGeometry(b,!0);null!=b&&(this.isSwimlane(a)&&(a=this.getStartSize(a),b.x-=a.width,b.y-=a.height,b.width+=a.width,b.height+=a.height),null!=c&&(b.x-=c,b.y-=c,b.width+=2*c,b.height+=2*c));return b};mxGraph.prototype.createGroupCell=function(a){a=new mxCell("");a.setVertex(!0);a.setConnectable(!1);return a}; mxGraph.prototype.ungroupCells=function(a){var b=[];null==a&&(a=this.getCellsForUngroup());if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++){var d=this.model.getChildren(a[c]);if(null!=d&&0<d.length){d=d.slice();var e=this.model.getParent(a[c]),f=this.model.getChildCount(e);this.cellsAdded(d,e,f,null,null,!0);b=b.concat(d);for(var g=0;g<d.length;g++)if(this.model.isVertex(d[g])){var k=this.view.getState(d[g]),l=this.getCellGeometry(d[g]);null!=k&&null!=l&&l.relative&& (l=l.clone(),l.x=k.origin.x,l.y=k.origin.y,l.relative=!1,this.model.setGeometry(d[g],l))}}}this.removeCellsAfterUngroup(a);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",a))}finally{this.model.endUpdate()}}return b};mxGraph.prototype.getCellsForUngroup=function(){for(var a=this.getEditableCells(this.getSelectionCells()),b=[],c=0;c<a.length;c++)this.model.isVertex(a[c])&&0<this.model.getChildCount(a[c])&&b.push(a[c]);return b};mxGraph.prototype.removeCellsAfterUngroup=function(a){this.cellsRemoved(this.addAllEdges(a))}; mxGraph.prototype.removeCellsFromParent=function(a){null==a&&(a=this.getSelectionCells());this.model.beginUpdate();try{var b=this.getDefaultParent(),c=this.model.getChildCount(b);this.cellsAdded(a,b,c,null,null,!0);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",a))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.updateGroupBounds=function(a,b,c,d,e,f,g){null==a&&(a=this.getSelectionCells());b=null!=b?b:0;c=null!=c?c:!1;d=null!=d?d:0;e=null!=e?e:0;f=null!=f?f:0;g=null!=g?g:0;this.model.beginUpdate();try{for(var k=a.length-1;0<=k;k--){var l=this.getCellGeometry(a[k]);if(null!=l){var m=this.getChildCells(a[k]);if(null!=m&&0<m.length){var n=this.getBoundingBoxFromGeometry(m,!0);if(null!=n&&0<n.width&&0<n.height){var p=this.isSwimlane(a[k])?this.getActualStartSize(a[k],!0):new mxRectangle,q= this.getActualFooterSize(a[k],!0);l=l.clone();c&&(l.x=Math.round(l.x+n.x-b-p.x-g-q.x),l.y=Math.round(l.y+n.y-b-p.y-d-q.y));l.width=Math.round(n.width+2*b+p.x+g+e+p.width+q.x+q.width);l.height=Math.round(n.height+2*b+p.y+d+f+p.height+q.y+q.height);this.model.setGeometry(a[k],l);this.moveCells(m,b+p.x-n.x+g+q.x,b+p.y-n.y+d+q.y)}}}}}finally{this.model.endUpdate()}return a}; mxGraph.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=0;c<a.length;c++)if(this.model.isVertex(a[c])||this.model.isEdge(a[c])){var d=this.view.getBoundingBox(this.view.getState(a[c]),!0);null!=d&&(null==b?b=mxRectangle.fromRectangle(d):b.add(d))}return b};mxGraph.prototype.cloneCell=function(a,b,c,d){return this.cloneCells([a],b,c,d)[0]}; mxGraph.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;var e=null;if(null!=a){var f=new mxDictionary;e=[];for(var g=0;g<a.length;g++)f.put(a[g],!0),e.push(a[g]);if(0<e.length){var k=this.view.scale,l=this.view.translate;e=this.model.cloneCells(a,!0,c);for(g=0;g<a.length;g++)if(!b&&this.model.isEdge(e[g])&&null!=this.getEdgeValidationError(e[g],this.model.getTerminal(e[g],!0),this.model.getTerminal(e[g],!1)))e[g]=null;else{var m=this.model.getGeometry(e[g]);if(null!=m){var n=this.view.getState(a[g]), p=this.view.getState(this.model.getParent(a[g]));if(null!=n&&null!=p)if(c=p.origin.x,p=p.origin.y,this.model.isEdge(e[g])){if(n=n.absolutePoints,null!=n){var q=this.model.getTerminal(a[g],!0);if(null!=q){for(;null!=q&&!f.get(q);)q=this.model.getParent(q);null==q&&null!=n[0]&&m.setTerminalPoint(new mxPoint(Math.round(n[0].x/k-l.x-c),Math.round(n[0].y/k-l.y-p)),!0)}d||(q=m.getTerminalPoint(!0),null!=q&&(q.x+=c,q.y+=p));q=this.model.getTerminal(a[g],!1);if(null!=q){for(;null!=q&&!f.get(q);)q=this.model.getParent(q); var r=n.length-1;null==q&&null!=n[r]&&m.setTerminalPoint(new mxPoint(Math.round(n[r].x/k-l.x-c),Math.round(n[r].y/k-l.y-p)),!1)}d||(q=m.getTerminalPoint(!1),null!=q&&(q.x+=c,q.y+=p));m=m.points;if(!d&&null!=m)for(n=0;n<m.length;n++)null!=m[n]&&(m[n].x+=c,m[n].y+=p)}}else d||m.translate(c,p)}}}else e=[]}return e};mxGraph.prototype.insertVertex=function(a,b,c,d,e,f,g,k,l){b=this.createVertex(a,b,c,d,e,f,g,k,l);return this.addCell(b,a)}; mxGraph.prototype.createVertex=function(a,b,c,d,e,f,g,k,l){a=new mxGeometry(d,e,f,g);a.relative=null!=l?l:!1;c=new mxCell(c,a,k);c.setId(b);c.setVertex(!0);c.setConnectable(!0);return c};mxGraph.prototype.insertEdge=function(a,b,c,d,e,f){b=this.createEdge(a,b,c,d,e,f);return this.addEdge(b,a,d,e)};mxGraph.prototype.createEdge=function(a,b,c,d,e,f){a=new mxCell(c,new mxGeometry,f);a.setId(b);a.setEdge(!0);a.geometry.relative=!0;return a}; mxGraph.prototype.addEdge=function(a,b,c,d,e){return this.addCell(a,b,e,c,d)};mxGraph.prototype.addCell=function(a,b,c,d,e){return this.addCells([a],b,c,d,e)[0]};mxGraph.prototype.addCells=function(a,b,c,d,e,f){null==b&&(b=this.getDefaultParent());null==c&&(c=this.model.getChildCount(b));this.model.beginUpdate();try{this.cellsAdded(a,b,c,d,e,null!=f?f:!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",a,"parent",b,"index",c,"source",d,"target",e))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{var l=f?this.view.getState(b):null,m=null!=l?l.origin:null,n=new mxPoint(0,0);for(l=0;l<a.length;l++)if(null==a[l])c--;else{var p=this.model.getParent(a[l]);if(null!=m&&a[l]!=b&&b!=p){var q=this.view.getState(p),r=null!=q?q.origin:n,t=this.model.getGeometry(a[l]);if(null!=t){var u=r.x-m.x,v=r.y-m.y;t=t.clone();t.translate(u,v);t.relative||!this.model.isVertex(a[l])||this.isAllowNegativeCoordinates()|| (t.x=Math.max(0,t.x),t.y=Math.max(0,t.y));this.model.setGeometry(a[l],t)}}b==p&&c+l>this.model.getChildCount(b)&&c--;var y=this.model.updateEdgeParent;this.model.updateEdgeParent=function(A,z){0>mxUtils.indexOf(a,A)&&y.apply(this,arguments)};this.model.add(b,a[l],c+l);this.model.updateEdgeParent=y;this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l], d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source",d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1){b=this.model.getChildCount(a);for(var c=0;c<b;c++)this.autoSizeCell(this.model.getChildAt(a,c))}this.getModel().isVertex(a)&&this.isAutoSizeCell(a)&&this.updateCellSize(a)}; mxGraph.prototype.removeCells=function(a,b){b=null!=b?b:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));if(b)a=this.getDeletableCells(this.addAllEdges(a));else{a=a.slice();for(var c=this.getDeletableCells(this.getAllEdges(a)),d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<c.length;e++)null!=this.view.getState(c[e])||d.get(c[e])||(d.put(c[e],!0),a.push(c[e]))}this.model.beginUpdate();try{this.cellsRemoved(a),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells", a,"includeEdges",b))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsRemoved=function(a){if(null!=a&&0<a.length){var b=this.view.scale,c=this.view.translate;this.model.beginUpdate();try{for(var d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);var f=null;if(this.isContractParentsOnRemove()){f=[];var g=new mxDictionary;for(e=0;e<a.length;e++){var k=this.model.getParent(a[e]);null==k||d.get(k)||g.get(k)||!this.isContractParent(a[e])||(g.put(k,!0),f.push(k))}}for(e=0;e<a.length;e++){var l=this.getAllEdges([a[e]]),m=mxUtils.bind(this,function(n, p){var q=this.model.getGeometry(n);if(null!=q){for(var r=this.model.getTerminal(n,p),t=!1,u=r;null!=u;){if(a[e]==u){t=!0;break}u=this.model.getParent(u)}t&&(q=q.clone(),null!=q.setTerminalPoint&&(t=this.view.getState(n),null!=t&&null!=t.absolutePoints?(r=t.absolutePoints,u=p?0:r.length-1,q.setTerminalPoint(new mxPoint(r[u].x/b-c.x-t.origin.x,r[u].y/b-c.y-t.origin.y),p)):(r=this.view.getState(r),null!=r&&q.setTerminalPoint(new mxPoint(r.getCenterX()/b-c.x,r.getCenterY()/b-c.y),p))),this.model.setGeometry(n, q),this.model.setTerminal(n,null,p))}});for(g=0;g<l.length;g++)d.get(l[g])||(d.put(l[g],!0),m(l[g],!0),m(l[g],!1));this.model.remove(a[e])}if(null!=f)for(e=0;e<f.length;e++)0<this.model.getChildCount(f[e])&&this.contractParent(this.model.getChildAt(f[e],0));this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",a))}finally{this.model.endUpdate()}}}; mxGraph.prototype.splitEdge=function(a,b,c,d,e,f,g,k){d=d||0;e=e||0;k=null!=k?k:this.model.getParent(a);f=this.model.getTerminal(a,!0);this.model.beginUpdate();try{if(null==c){c=this.cloneCell(a);var l=this.view.getState(a),m=this.getCellGeometry(c);if(null!=m&&null!=m.points&&null!=l){var n=this.view.translate,p=this.view.scale,q=mxUtils.findNearestSegment(l,(d+n.x)*p,(e+n.y)*p);m.points=m.points.slice(0,q);m=this.getCellGeometry(a);null!=m&&null!=m.points&&(m=m.clone(),m.points=m.points.slice(q), this.model.setGeometry(a,m))}}this.cellsMoved(b,d,e,!1,!1);this.cellsAdded([c],k,this.model.getChildCount(k),f,b[0],!1);this.cellsAdded(b,k,this.model.getChildCount(k),null,null,!0);this.cellConnected(a,b[0],!0);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",a,"cells",b,"newEdge",c,"dx",d,"dy",e))}finally{this.model.endUpdate()}return c}; mxGraph.prototype.toggleCells=function(a,b,c){null==b&&(b=this.getSelectionCells());c&&(b=this.addAllEdges(b));this.model.beginUpdate();try{this.cellsToggled(b,a),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",a,"cells",b,"includeEdges",c))}finally{this.model.endUpdate()}return b};mxGraph.prototype.cellsToggled=function(a,b){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}}}; mxGraph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing(!1);this.model.beginUpdate();try{this.cellsFolded(c,a,b,d),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",a,"recurse",b,"cells",c))}finally{this.model.endUpdate()}return c}; mxGraph.prototype.cellsFolded=function(a,b,c,d){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)if((!d||this.isCellFoldable(a[e],b))&&b!=this.isCellCollapsed(a[e])){this.model.setCollapsed(a[e],b);this.swapBounds(a[e],b);this.isExtendParent(a[e])&&this.extendParent(a[e]);this.isContractParent(a[e])&&this.contractParent(a[e]);if(c){var f=this.model.getChildren(a[e]);this.cellsFolded(f,b,c)}this.constrainChild(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED, "cells",a,"collapse",b,"recurse",c))}finally{this.model.endUpdate()}}};mxGraph.prototype.swapBounds=function(a,b){if(null!=a){var c=this.model.getGeometry(a);null!=c&&(c=c.clone(),this.updateAlternateBounds(a,c,b),c.swap(),this.model.setGeometry(a,c))}}; mxGraph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b){c=this.getCurrentCellStyle(a);if(null==b.alternateBounds){var d=b;if(this.collapseToPreferredSize){var e="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled?"1":"0");a=this.getPreferredSizeForCell(a,null,e);null!=a&&(d=a,a=mxUtils.getValue(c,mxConstants.STYLE_STARTSIZE),0<a&&(d.height=Math.max(d.height,a)))}b.alternateBounds=new mxRectangle(0,0,d.width,d.height)}null!=b.alternateBounds&&(b.alternateBounds.x= b.x,b.alternateBounds.y=b.y,e=mxUtils.toRadians(c[mxConstants.STYLE_ROTATION]||0),0!=e&&(c=b.alternateBounds.getCenterX()-b.getCenterX(),d=b.alternateBounds.getCenterY()-b.getCenterY(),a=Math.cos(e),e=Math.sin(e),b.alternateBounds.x+=a*c-e*d-c,b.alternateBounds.y+=e*c+a*d-d))}};mxGraph.prototype.addAllEdges=function(a){var b=a.slice();return mxUtils.removeDuplicates(b.concat(this.getAllEdges(a)))}; mxGraph.prototype.getAllEdges=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++){for(var d=this.model.getEdgeCount(a[c]),e=0;e<d;e++)b.push(this.model.getEdgeAt(a[c],e));d=this.model.getChildren(a[c]);b=b.concat(this.getAllEdges(d))}return b};mxGraph.prototype.updateCellSize=function(a,b){b=null!=b?b:!1;this.model.beginUpdate();try{this.cellSizeUpdated(a,b),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",a,"ignoreChildren",b))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellSizeUpdated=function(a,b){if(null!=a){this.model.beginUpdate();try{var c=this.getCellStyle(a),d=this.model.getGeometry(a);if(null!=d){var e=null,f=mxUtils.getValue(c,mxConstants.STYLE_FIXED_WIDTH,!1);f&&(e=d.width-2*parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING,2))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_LEFT,0))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_RIGHT,0)));var g="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled? "1":"0"),k=this.getPreferredSizeForCell(a,e,g);if(null!=k){var l=this.isCellCollapsed(a);d=d.clone();if(this.isSwimlane(a)){var m=this.model.getStyle(a);null==m&&(m="");mxUtils.getValue(c,mxConstants.STYLE_HORIZONTAL,!0)?(m=mxUtils.setStyle(m,mxConstants.STYLE_STARTSIZE,k.height+8),l&&(d.height=k.height+8),f||(d.width=k.width)):(m=mxUtils.setStyle(m,mxConstants.STYLE_STARTSIZE,k.width+8),l&&!f&&(d.width=k.width+8),d.height=k.height);this.model.setStyle(a,m)}else{var n=this.view.createState(a),p=n.style[mxConstants.STYLE_ALIGN]|| mxConstants.ALIGN_CENTER,q=this.getVerticalAlign(n);"fixed"==n.style[mxConstants.STYLE_ASPECT]&&(k.height=Math.round(d.height*k.width*100/d.width)/100);q==mxConstants.ALIGN_BOTTOM?d.y+=d.height-k.height:q==mxConstants.ALIGN_MIDDLE&&(d.y+=Math.round((d.height-k.height)/2));d.height=k.height;f||(p==mxConstants.ALIGN_RIGHT?d.x+=d.width-k.width:p==mxConstants.ALIGN_CENTER&&(d.x+=Math.round((d.width-k.width)/2)),d.width=k.width)}if(!b&&!l){var r=this.view.getBounds(this.model.getChildren(a));if(null!= r){var t=this.view.translate,u=this.view.scale,v=(r.x+r.width)/u-d.x-t.x;d.height=Math.max(d.height,(r.y+r.height)/u-d.y-t.y);f||(d.width=Math.max(d.width,v))}}this.cellsResized([a],[d],!1)}}}finally{this.model.endUpdate()}}}; mxGraph.prototype.getPreferredSizeForCell=function(a,b,c){c=null!=c?c:this.gridEnabled;var d=null;if(null!=a){var e=this.view.createState(a),f=e.style;if(!this.model.isEdge(a)){var g=f[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;a=d=0;null==this.getImage(e)&&null==f[mxConstants.STYLE_IMAGE]||f[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(f[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))), f[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));d+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_LEFT,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_RIGHT,2));a+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_TOP,2));a+=parseFloat(mxUtils.getValue(f, mxConstants.STYLE_SPACING_BOTTOM,2));var k=this.getFoldingImage(e);null!=k&&(d+=k.width+8);k=this.cellRenderer.getLabelValue(e);null!=k&&0<k.length?(this.isHtmlLabel(e.cell)?null!=b&&(b+=mxSvgCanvas2D.prototype.foreignObjectPadding):k=mxUtils.htmlEntities(k,!1),k=k.replace(/\n/g,"<br>"),e=mxUtils.getSizeForString(k,g,f[mxConstants.STYLE_FONTFAMILY],b,f[mxConstants.STYLE_FONTSTYLE]),b=e.width+d,e=e.height+a,mxUtils.getValue(f,mxConstants.STYLE_HORIZONTAL,!0)||(f=e,e=b,b=f),c&&(b=this.snap(b+this.gridSize/ 2),e=this.snap(e+this.gridSize/2)),d=new mxRectangle(0,0,b,e)):(c=4*this.gridSize,d=new mxRectangle(0,0,c,c))}}return d};mxGraph.prototype.resizeCell=function(a,b,c){return this.resizeCells([a],[b],c)[0]};mxGraph.prototype.resizeCells=function(a,b,c){c=null!=c?c:this.isRecursiveResize();this.model.beginUpdate();try{var d=this.cellsResized(a,b,c);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsResized=function(a,b,c){c=null!=c?c:!1;var d=[];if(null!=a&&null!=b&&a.length==b.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)d.push(this.cellResized(a[e],b[e],!1,c)),this.isExtendParent(a[e])&&this.extendParent(a[e]),this.isContractParent(a[e])&&this.contractParent(a[e]),this.constrainChild(a[e]);this.resetEdgesOnResize&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}}return d}; mxGraph.prototype.cellResized=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e&&(e.x!=b.x||e.y!=b.y||e.width!=b.width||e.height!=b.height)){var f=e.clone();!c&&f.relative?(c=f.offset,null!=c&&(c.x+=b.x-f.x,c.y+=b.y-f.y)):(f.x=b.x,f.y=b.y);f.width=b.width;f.height=b.height;f.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(f.x=Math.max(0,f.x),f.y=Math.max(0,f.y));this.model.beginUpdate();try{d&&this.resizeChildCells(a,f),this.model.setGeometry(a,f),this.isCellCollapsed(a)|| this.constrainChildCells(a)}finally{this.model.endUpdate()}}return e};mxGraph.prototype.resizeChildCells=function(a,b){var c=this.model.getGeometry(a),d=0!=c.width?b.width/c.width:1;b=0!=c.height?b.height/c.height:1;c=this.model.getChildCount(a);for(var e=0;e<c;e++)this.scaleCell(this.model.getChildAt(a,e),d,b,!0)};mxGraph.prototype.constrainChildCells=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.constrainChild(this.model.getChildAt(a,c))}; mxGraph.prototype.scaleCell=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e){var f=this.getCurrentCellStyle(a);e=e.clone();var g=e.x,k=e.y,l=e.width,m=e.height;e.scale(b,c,"fixed"==f[mxConstants.STYLE_ASPECT]);"1"==f[mxConstants.STYLE_RESIZE_WIDTH]?e.width=l*b:"0"==f[mxConstants.STYLE_RESIZE_WIDTH]&&(e.width=l);"1"==f[mxConstants.STYLE_RESIZE_HEIGHT]?e.height=m*c:"0"==f[mxConstants.STYLE_RESIZE_HEIGHT]&&(e.height=m);this.isCellMovable(a)||(e.x=g,e.y=k);this.isCellResizable(a)||(e.width= l,e.height=m);this.model.isVertex(a)?this.cellResized(a,e,!0,d):this.model.setGeometry(a,e)}}; mxGraph.prototype.extendParent=function(a){if(null!=a){var b=this.model.getParent(a),c=this.getCellGeometry(b);if(null!=b&&null!=c&&!this.isCellCollapsed(b)&&(a=this.getCellGeometry(a),null!=a&&!a.relative)){var d=this.getCurrentCellStyle(b);d=mxUtils.parsePadding(mxUtils.getValue(d,mxConstants.STYLE_GROUP_PADDING,0));if(c.width<a.x+a.width+d.e||c.height<a.y+a.height+d.s)c=c.clone(),c.width=Math.max(c.width,a.x+a.width+d.e),c.height=Math.max(c.height,a.y+a.height+d.s),this.cellsResized([b],[c],!1)}}}; mxGraph.prototype.contractParent=function(a){if(null!=a){a=this.model.getParent(a);var b=this.getCellGeometry(a);if(null!=a&&null!=b&&!this.isCellCollapsed(a)){var c=this.getCurrentCellStyle(a);c=mxUtils.parsePadding(mxUtils.getValue(c,mxConstants.STYLE_GROUP_PADDING,0));for(var d=0,e=0,f=this.model.getChildCount(a),g=0;g<f;g++){var k=this.model.getChildAt(a,g),l=this.getCellGeometry(k);null!=l&&!l.relative&&this.model.isVertex(k)&&(d=Math.max(d,l.x+l.width),e=Math.max(e,l.y+l.height))}d+=c.e;e+= c.s;0<d&&0<e&&(b.width>d||b.height>e)&&(b=b.clone(),b.width=Math.min(b.width,d),b.height=Math.min(b.height,e),this.model.setGeometry(a,b),this.isContractParent(a)&&this.contractParent(a))}}};mxGraph.prototype.importCells=function(a,b,c,d,e,f){return this.moveCells(a,b,c,!0,d,e,f)}; mxGraph.prototype.moveCells=function(a,b,c,d,e,f,g){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:!1;if(null!=a&&(0!=b||0!=c||d||null!=e)){var k=a=this.model.getTopmostCells(a);this.model.beginUpdate();try{for(var l=new mxDictionary,m=0;m<a.length;m++)l.put(a[m],!0);var n=mxUtils.bind(this,function(v){for(;null!=v;){if(l.get(v))return!0;v=this.model.getParent(v)}return!1}),p=[];for(m=0;m<a.length;m++){var q=this.getCellGeometry(a[m]),r=this.model.getParent(a[m]);null!=q&&q.relative&&this.model.isEdge(r)&& (n(this.model.getTerminal(r,!0))||n(this.model.getTerminal(r,!1)))||p.push(a[m])}a=p;d&&(a=this.cloneCells(a,this.isCloneInvalidEdges(),g),null==e&&(e=this.getDefaultParent()));var t=this.isAllowNegativeCoordinates();null!=e&&this.setAllowNegativeCoordinates(!0);this.cellsMoved(a,b,c,!d&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==e,this.isExtendParentsOnMove()&&null==e);this.setAllowNegativeCoordinates(t);if(null!=e){var u=this.model.getChildCount(e);this.cellsAdded(a,e,u,null,null, !0);if(d)for(m=0;m<a.length;m++)q=this.getCellGeometry(a[m]),r=this.model.getParent(k[m]),null!=q&&q.relative&&this.model.isEdge(r)&&this.model.contains(r)&&this.model.add(r,a[m])}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",a,"dx",b,"dy",c,"clone",d,"target",e,"event",f))}finally{this.model.endUpdate()}}return a}; mxGraph.prototype.cellsMoved=function(a,b,c,d,e,f){if(null!=a&&(0!=b||0!=c)){f=null!=f?f:!1;this.model.beginUpdate();try{d&&this.disconnectGraph(a);for(var g=0;g<a.length;g++)this.translateCell(a[g],b,c),f&&this.isExtendParent(a[g])?this.extendParent(a[g]):e&&this.constrainChild(a[g]),this.isContractParentsOnMove()&&this.isContractParent(a[g])&&this.contractParent(a[g]);this.resetEdgesOnMove&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",a,"dx",b,"dy",c,"disconnect", d))}finally{this.model.endUpdate()}}}; mxGraph.prototype.translateCell=function(a,b,c){var d=this.model.getGeometry(a);if(null!=d&&"function"===typeof d.translate){b=parseFloat(b);c=parseFloat(c);d=d.clone();d.translate(b,c,this.model.isEdge(a));d.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(d.x=Math.max(0,parseFloat(d.x)),d.y=Math.max(0,parseFloat(d.y)));if(d.relative&&!this.model.isEdge(a)){var e=this.model.getParent(a),f=0;this.model.isVertex(e)&&(e=this.getCurrentCellStyle(e),f=mxUtils.getValue(e,mxConstants.STYLE_ROTATION, 0));0!=f&&(f=mxUtils.toRadians(-f),e=Math.cos(f),f=Math.sin(f),c=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,new mxPoint(0,0)),b=c.x,c=c.y);null==d.offset?d.offset=new mxPoint(Math.round(b),Math.round(c)):(d.offset.x=Math.round(parseFloat(d.offset.x+b)),d.offset.y=Math.round(parseFloat(d.offset.y+c)))}this.model.setGeometry(a,d)}}; mxGraph.prototype.getCellContainmentArea=function(a){if(null!=a&&!this.model.isEdge(a)){var b=this.model.getParent(a);if(null!=b&&b!=this.getDefaultParent()){var c=this.model.getGeometry(b);if(null!=c){var d=a=0,e=c.width;c=c.height;if(this.isSwimlane(b)){var f=this.getStartSize(b),g=this.getCurrentCellStyle(b);b=mxUtils.getValue(g,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var k=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0);g=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0);if(b== mxConstants.DIRECTION_SOUTH||b==mxConstants.DIRECTION_NORTH){var l=f.width;f.width=f.height;f.height=l}if(b==mxConstants.DIRECTION_EAST&&!g||b==mxConstants.DIRECTION_NORTH&&!k||b==mxConstants.DIRECTION_WEST&&g||b==mxConstants.DIRECTION_SOUTH&&k)a=f.width,d=f.height;e-=f.width;c-=f.height}return new mxRectangle(a,d,e,c)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds}; mxGraph.prototype.constrainChild=function(a,b){if(null!=a&&(b=this.getCellGeometry(a),null!=b&&(this.isConstrainRelativeChildren()||!b.relative))){var c=this.model.getParent(a);this.getCellGeometry(c);var d=this.getMaximumGraphBounds();null!=d&&(c=this.getBoundingBoxFromGeometry([c],!1),null!=c&&(d=mxRectangle.fromRectangle(d),d.x-=c.x,d.y-=c.y));if(this.isConstrainChild(a)&&(c=this.getCellContainmentArea(a),null!=c)){var e=this.getOverlap(a);0<e&&(c=mxRectangle.fromRectangle(c),c.x-=c.width*e,c.y-= c.height*e,c.width+=2*c.width*e,c.height+=2*c.height*e);null==d?d=c:(d=mxRectangle.fromRectangle(d),d.intersect(c))}if(null!=d){c=[a];if(!this.isCellCollapsed(a)){e=this.model.getDescendants(a);for(var f=0;f<e.length;f++)this.isCellVisible(e[f])&&c.push(e[f])}c=this.getBoundingBoxFromGeometry(c,!1);if(null!=c){b=b.clone();e=0;b.width>d.width&&(e=b.width-d.width,b.width-=e);c.x+c.width>d.x+d.width&&(e-=c.x+c.width-d.x-d.width-e);f=0;b.height>d.height&&(f=b.height-d.height,b.height-=f);c.y+c.height> d.y+d.height&&(f-=c.y+c.height-d.y-d.height-f);c.x<d.x&&(e-=c.x-d.x);c.y<d.y&&(f-=c.y-d.y);if(0!=e||0!=f)b.relative?(null==b.offset&&(b.offset=new mxPoint),b.offset.x+=e,b.offset.y+=f):(b.x+=e,b.y+=f);this.model.setGeometry(a,b)}}}}; mxGraph.prototype.resetEdges=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);this.model.beginUpdate();try{for(c=0;c<a.length;c++){var d=this.model.getEdges(a[c]);if(null!=d)for(var e=0;e<d.length;e++){var f=this.view.getState(d[e]),g=null!=f?f.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[e],!0),k=null!=f?f.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[e],!1);b.get(g)&&b.get(k)||this.resetEdge(d[e])}this.resetEdges(this.model.getChildren(a[c]))}}finally{this.model.endUpdate()}}}; mxGraph.prototype.resetEdge=function(a){var b=this.model.getGeometry(a);null!=b&&null!=b.points&&0<b.points.length&&(b=b.clone(),b.points=[],this.model.setGeometry(a,b));return a}; mxGraph.prototype.getOutlineConstraint=function(a,b,c){if(null!=b.shape){c=this.view.getPerimeterBounds(b);var d=b.style[mxConstants.STYLE_DIRECTION];if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){c.x+=c.width/2-c.height/2;c.y+=c.height/2-c.width/2;var e=c.width;c.width=c.height;c.height=e}var f=mxUtils.toRadians(b.shape.getShapeRotation());if(0!=f){e=Math.cos(-f);f=Math.sin(-f);var g=new mxPoint(c.getCenterX(),c.getCenterY());a=mxUtils.getRotatedPoint(a,e,f,g)}g=f=1;var k=0,l= 0;if(this.getModel().isVertex(b.cell)){var m=b.style[mxConstants.STYLE_FLIPH],n=b.style[mxConstants.STYLE_FLIPV];null!=b.shape&&null!=b.shape.stencil&&(m=1==mxUtils.getValue(b.style,"stencilFlipH",0)||m,n=1==mxUtils.getValue(b.style,"stencilFlipV",0)||n);if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH)e=m,m=n,n=e;m&&(f=-1,k=-c.width);n&&(g=-1,l=-c.height)}a=new mxPoint((a.x-c.x)*f-k+c.x,(a.y-c.y)*g-l+c.y);return new mxConnectionConstraint(new mxPoint(0==c.width?0:Math.round(1E3* (a.x-c.x)/c.width)/1E3,0==c.height?0:Math.round(1E3*(a.y-c.y)/c.height)/1E3),!1)}return null};mxGraph.prototype.getAllConnectionConstraints=function(a,b){return null!=a&&null!=a.shape&&null!=a.shape.stencil?a.shape.stencil.constraints:null}; mxGraph.prototype.getConnectionConstraint=function(a,b,c){b=null;var d=a.style[c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=d){var e=a.style[c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=e&&(b=new mxPoint(parseFloat(d),parseFloat(e)))}d=!1;var f=e=0;null!=b&&(d=mxUtils.getValue(a.style,c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),e=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),f=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DY: mxConstants.STYLE_ENTRY_DY]),e=isFinite(e)?e:0,f=isFinite(f)?f:0);return new mxConnectionConstraint(b,d,null,e,f)}; mxGraph.prototype.setConnectionConstraint=function(a,b,c,d){if(null!=d){this.model.beginUpdate();try{null==d||null==d.point?(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER: mxConstants.STYLE_ENTRY_PERIMETER,null,[a])):null!=d.point&&(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d.point.x,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,d.point.y,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,d.dx,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,d.dy,[a]),d.perimeter?this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER, null,[a]):this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[a]))}finally{this.model.endUpdate()}}}; mxGraph.prototype.getConnectionPoint=function(a,b,c){c=null!=c?c:!0;var d=null;if(null!=a&&null!=b.point){var e=this.view.getPerimeterBounds(a),f=a.style[mxConstants.STYLE_DIRECTION],g=new mxPoint(e.getCenterX(),e.getCenterY());d=this.view.scale;f!=mxConstants.DIRECTION_NORTH&&f!=mxConstants.DIRECTION_SOUTH||e.rotate90();d=new mxPoint(e.x+b.point.x*e.width+b.dx*d,e.y+b.point.y*e.height+b.dy*d);if(this.getModel().isVertex(a.cell)){var k=1==a.style[mxConstants.STYLE_FLIPH],l=1==a.style[mxConstants.STYLE_FLIPV]; null!=a.shape&&null!=a.shape.stencil&&(k=1==mxUtils.getValue(a.style,"stencilFlipH",0)||k,l=1==mxUtils.getValue(a.style,"stencilFlipV",0)||l);if(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){var m=k;k=l;l=m}k&&(d.x=2*e.getCenterX()-d.x);l&&(d.y=2*e.getCenterY()-d.y)}e=0;null!=f&&1==mxUtils.getValue(a.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(f==mxConstants.DIRECTION_NORTH?e+=270:f==mxConstants.DIRECTION_WEST?e+=180:f==mxConstants.DIRECTION_SOUTH&&(e+=90));0!=e&&(k=f=0, 90==e?k=1:180==e?f=-1:270==e&&(k=-1),d=mxUtils.getRotatedPoint(d,f,k,g));b.perimeter&&(d=this.view.getPerimeterPoint(a,d,!1));a=a.style[mxConstants.STYLE_ROTATION]||0;0!=a&&null!=d&&(a=mxUtils.toRadians(a),f=Math.cos(a),k=Math.sin(a),d=mxUtils.getRotatedPoint(d,f,k,g))}c&&null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y));return d}; mxGraph.prototype.connectCell=function(a,b,c,d){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.cellConnected(a,b,c,d);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",a,"terminal",b,"source",c,"previous",e))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellConnected=function(a,b,c,d){if(null!=a){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.setConnectionConstraint(a,b,c,d);this.isPortsEnabled()&&(d=null,this.isPort(b)&&(d=b.getId(),b=this.getTerminalForPort(b,c)),this.setCellStyles(c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,d,[a]));this.model.setTerminal(a,b,c);this.resetEdgesOnConnect&&this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",a,"terminal",b,"source", c,"previous",e))}finally{this.model.endUpdate()}}}; mxGraph.prototype.disconnectGraph=function(a){if(null!=a){this.model.beginUpdate();try{for(var b=this.view.scale,c=this.view.translate,d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++)if(this.model.isEdge(a[e])){var f=this.model.getGeometry(a[e]);if(null!=f){var g=this.view.getState(a[e]),k=this.view.getState(this.model.getParent(a[e]));if(null!=g&&null!=k){f=f.clone();var l=-k.origin.x,m=-k.origin.y,n=g.absolutePoints,p=this.model.getTerminal(a[e],!0);if(null!=p&&this.isCellDisconnectable(a[e], p,!0)){for(;null!=p&&!d.get(p);)p=this.model.getParent(p);null==p&&null!=f.setTerminalPoint&&(f.setTerminalPoint(new mxPoint(n[0].x/b-c.x+l,n[0].y/b-c.y+m),!0),this.model.setTerminal(a[e],null,!0))}var q=this.model.getTerminal(a[e],!1);if(null!=q&&this.isCellDisconnectable(a[e],q,!1)){for(;null!=q&&!d.get(q);)q=this.model.getParent(q);if(null==q&&null!=f.setTerminalPoint){var r=n.length-1;f.setTerminalPoint(new mxPoint(n[r].x/b-c.x+l,n[r].y/b-c.y+m),!1);this.model.setTerminal(a[e],null,!1)}}this.model.setGeometry(a[e], f)}}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(a){return null};mxGraph.prototype.isPort=function(a){return!1};mxGraph.prototype.getTerminalForPort=function(a,b){return this.model.getParent(a)};mxGraph.prototype.getChildOffsetForCell=function(a){return null}; mxGraph.prototype.enterGroup=function(a){a=a||this.getSelectionCell();null!=a&&this.isValidRoot(a)&&(this.view.setCurrentRoot(a),this.clearSelection(),a=mxRectangle.fromRectangle(this.getGraphBounds()),a.x-=this.view.translate.x,a.y-=this.view.translate.y,this.scrollRectToVisible(a))}; mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurrentRoot();if(null!=b){for(var c=this.model.getParent(b);c!=a&&!this.isValidRoot(c)&&this.model.getParent(c)!=a;)c=this.model.getParent(c);c==a||this.model.getParent(c)==a?this.view.setCurrentRoot(null):this.view.setCurrentRoot(c);null!=this.view.getState(b)&&(this.setSelectionCell(b),this.scrollCellToVisible(b))}}; mxGraph.prototype.home=function(){var a=this.getCurrentRoot();null!=a&&(this.view.setCurrentRoot(null),null!=this.view.getState(a)&&this.setSelectionCell(a))};mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()}; mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d}; mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b,c,d){b=null!=b?b:!1;var e=null;if(null!=a)for(var f=0;f<a.length;f++)if(b||this.model.isVertex(a[f])){var g=this.getCellGeometry(a[f]);if(null!=g){var k=this.model.getParent(a[f]),l=null;if(this.model.isEdge(a[f])){var m=function(p){null!=p&&(null==l?l=new mxRectangle(p.x,p.y,0,0):l.add(new mxRectangle(p.x,p.y,0,0)))};null==this.model.getTerminal(a[f],!0)&&m(g.getTerminalPoint(!0));null==this.model.getTerminal(a[f],!1)&&m(g.getTerminalPoint(!1)); g=g.points;if(null!=g)for(var n=0;n<g.length;n++)m(g[n]);null!=l&&this.model.isVertex(k)&&0<=mxUtils.indexOf(null!=c?c:a,k)&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l.x+=m.x,l.y+=m.y))}else g.relative?this.model.isVertex(k)&&k!=this.view.currentRoot&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l=new mxRectangle(g.x*m.width,g.y*m.height,g.width,g.height),0<=mxUtils.indexOf(null!=c?c:a,k)&&(l.x+=m.x,l.y+=m.y))):(l=mxRectangle.fromRectangle(g),this.model.isVertex(k)&& 0<=mxUtils.indexOf(null!=c?c:a,k)&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l.x+=m.x,l.y+=m.y))),null!=l&&null!=g.offset&&(l.x+=g.offset.x,l.y+=g.offset.y),k=this.getCurrentCellStyle(a[f]),null!=l&&(k=mxUtils.getValue(k,mxConstants.STYLE_ROTATION,0),0!=k&&(l=mxUtils.getBoundingBox(l,k)));null!=l&&(d&&(k=this.getCurrentCellStyle(a[f],!0),null!=k&&(k=mxUtils.getNumber(k,mxConstants.STYLE_STROKEWIDTH,1),l.grow(k/2))),null==e?e=mxRectangle.fromRectangle(l):e.add(l))}}return e}; mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a}; mxGraph.prototype.snapDelta=function(a,b,c,d,e){var f=this.view.translate,g=this.view.scale;!c&&this.gridEnabled?(c=this.gridSize*g*.5,d||(d=b.x-(this.snap(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:this.snap(a.x/g)*g-d),e||(b=b.y-(this.snap(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:this.snap(a.y/g)*g-b)):(c=.5*g,d||(d=b.x-(Math.round(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:Math.round(a.x/g)*g-d),e||(b=b.y-(Math.round(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:Math.round(a.y/g)*g-b));return a}; mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==a&&0==b){if(c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1); this.shiftPreview1=null;this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position="absolute";this.shiftPreview1.style.overflow="visible"; this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var f=this.shiftPreview1;for(d=this.container.firstChild;null!=d;)e=d.nextSibling,d!=c.parentNode?f.appendChild(d):f=this.shiftPreview2,d=e;null!=this.shiftPreview1.firstChild&&(null!=c.parentNode&&c.parentNode.parentNode==this.container?this.container.insertBefore(this.shiftPreview1,c.parentNode):this.container.appendChild(this.shiftPreview1));null!=this.shiftPreview2.firstChild&& this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=a+"px";this.shiftPreview1.style.top=b+"px";this.shiftPreview2.style.left=a+"px";this.shiftPreview2.style.top=b+"px"}else c.style.left=a+"px",c.style.top=b+"px";this.panDx=a;this.panDy=b;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)}; mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))};mxGraph.prototype.zoomTo=function(a,b,c){this.zoom(a/this.view.scale,b,null,c)}; mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:.5;d=null!=d?d:.5;var e=mxUtils.hasScrollbars(this.container),f=2*this.getBorder(),g=this.container.clientWidth-f;f=this.container.clientHeight-f;var k=this.getGraphBounds(),l=this.view.translate,m=this.view.scale,n=a?g-k.width:0,p=b?f-k.height:0;e?(k.x-=l.x,k.y-=l.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>g&&(n=0),b>f&&(p=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft= (a-g)/2,this.container.scrollTop=(b-f)/2):this.view.setTranslate(a?Math.floor(l.x-k.x/m+n*c/m):l.x,b?Math.floor(l.y-k.y/m+p*d/m):l.y)}; mxGraph.prototype.zoom=function(a,b,c,d){b=null!=b?b:this.centerZoom;var e=Math.round(this.view.scale*a*100)/100;null!=c&&(e=Math.round(e*c)/c);c=this.view.getState(this.getSelectionCell());a=e/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=c)a=new mxRectangle(c.x*a,c.y*a,c.width*a,c.height*a),this.view.scale=e,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(e));else{var f=mxUtils.hasScrollbars(this.container);if(b&&!f)d=this.container.offsetWidth,f=this.container.offsetHeight, 1<a?(a=(a-1)/(2*e),d*=-a,f*=-a):(a=(1/a-1)/(2*this.view.scale),d*=a,f*=a),this.view.scaleAndTranslate(e,this.view.translate.x+d,this.view.translate.y+f);else{c=this.view.translate.x;var g=this.view.translate.y,k=this.container.scrollLeft,l=this.container.scrollTop;this.view.setScale(e);f&&!d&&(f=d=0,b&&(d=this.container.offsetWidth*(a-1)/2,f=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-c)*this.view.scale+Math.round(k*a+d),this.container.scrollTop=(this.view.translate.y- g)*this.view.scale+Math.round(l*a+f))}}}; mxGraph.prototype.zoomToRect=function(a){var b=this.container.clientWidth/a.width/(this.container.clientHeight/a.height);a.x=Math.max(0,a.x);a.y=Math.max(0,a.y);var c=Math.min(this.container.scrollWidth,a.x+a.width),d=Math.min(this.container.scrollHeight,a.y+a.height);a.width=c-a.x;a.height=d-a.y;1>b?(b=a.height/b,c=(b-a.height)/2,a.height=b,a.y-=Math.min(a.y,c),d=Math.min(this.container.scrollHeight,a.y+a.height),a.height=d-a.y):(b*=a.width,c=(b-a.width)/2,a.width=b,a.x-=Math.min(a.x,c),c=Math.min(this.container.scrollWidth, a.x+a.width),a.width=c-a.x);b=this.container.clientWidth/a.width;c=this.view.scale*b;mxUtils.hasScrollbars(this.container)?(this.view.setScale(c),this.container.scrollLeft=Math.round(a.x*b),this.container.scrollTop=Math.round(a.y*b)):this.view.scaleAndTranslate(c,this.view.translate.x-a.x/this.view.scale,this.view.translate.y-a.y/this.view.scale)}; mxGraph.prototype.scrollCellToVisible=function(a,b){var c=-this.view.translate.x,d=-this.view.translate.y;a=this.view.getState(a);null!=a&&(c=new mxRectangle(c+a.x,d+a.y,a.width,a.height),b&&null!=this.container&&(b=this.container.clientWidth,d=this.container.clientHeight,c.x=c.getCenterX()-b/2,c.width=b,c.y=c.getCenterY()-d/2,c.height=d),b=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(c)&&(c=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x= b.x,this.view.translate.y=b.y,this.view.setTranslate(c.x,c.y)))}; mxGraph.prototype.scrollRectToVisible=function(a){var b=!1;if(null!=a){var c=this.container.offsetWidth,d=this.container.offsetHeight,e=Math.min(c,a.width),f=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){c=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=c.scrollLeft-a.x;d=Math.max(g-c.scrollLeft,0);0<g?c.scrollLeft-=g+2:(g=a.x+e-c.scrollLeft-c.clientWidth,0<g&&(c.scrollLeft+=g+2));e=c.scrollTop-a.y;g=Math.max(0,e-c.scrollTop);0<e?c.scrollTop-=e+2:(e=a.y+ f-c.scrollTop-c.clientHeight,0<e&&(c.scrollTop+=e+2));this.useScrollbarsForPanning||0==d&&0==g||this.view.setTranslate(d,g)}else{g=-this.view.translate.x;var k=-this.view.translate.y,l=this.view.scale;a.x+e>g+c&&(this.view.translate.x-=(a.x+e-c-g)/l,b=!0);a.y+f>k+d&&(this.view.translate.y-=(a.y+f-d-k)/l,b=!0);a.x<g&&(this.view.translate.x+=(g-a.x)/l,b=!0);a.y<k&&(this.view.translate.y+=(k-a.y)/l,b=!0);b&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return b}; mxGraph.prototype.getCellGeometry=function(a){return this.model.getGeometry(a)};mxGraph.prototype.isCellVisible=function(a){return this.model.isVisible(a)};mxGraph.prototype.isCellCollapsed=function(a){return this.model.isCollapsed(a)};mxGraph.prototype.isCellConnectable=function(a){return this.model.isConnectable(a)}; mxGraph.prototype.isOrthogonal=function(a){var b=a.style[mxConstants.STYLE_ORTHOGONAL];if(null!=b)return b;a=this.view.getEdgeStyle(a);return a==mxEdgeStyle.SegmentConnector||a==mxEdgeStyle.ElbowConnector||a==mxEdgeStyle.SideToSide||a==mxEdgeStyle.TopToBottom||a==mxEdgeStyle.EntityRelation||a==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(a){var b=a.getVisibleTerminalState(!0);a=a.getVisibleTerminalState(!1);return null!=b&&b==a};mxGraph.prototype.isCloneEvent=function(a){return mxEvent.isControlDown(a)}; mxGraph.prototype.isTransparentClickEvent=function(a){return!1};mxGraph.prototype.isToggleEvent=function(a){return mxClient.IS_MAC?mxEvent.isMetaDown(a):mxEvent.isControlDown(a)};mxGraph.prototype.isGridEnabledEvent=function(a){return null!=a&&!mxEvent.isAltDown(a)};mxGraph.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a)&&!mxEvent.isAltDown(a)};mxGraph.prototype.isIgnoreTerminalEvent=function(a){return!1};mxGraph.prototype.validationAlert=function(a){mxUtils.alert(a)}; mxGraph.prototype.isEdgeValid=function(a,b,c){return null==this.getEdgeValidationError(a,b,c)}; mxGraph.prototype.getEdgeValidationError=function(a,b,c){if(null!=a&&!this.isAllowDanglingEdges()&&(null==b||null==c))return"";if(null!=a&&null==this.model.getTerminal(a,!0)&&null==this.model.getTerminal(a,!1))return null;if(!this.allowLoops&&b==c&&null!=b||!this.isValidConnection(b,c))return"";if(null!=b&&null!=c){var d="";if(!this.multigraph){var e=this.model.getEdgesBetween(b,c,!0);if(1<e.length||1==e.length&&e[0]!=a)d+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+ "\n"}e=this.model.getDirectedEdgeCount(b,!0,a);var f=this.model.getDirectedEdgeCount(c,!1,a);if(null!=this.multiplicities)for(var g=0;g<this.multiplicities.length;g++){var k=this.multiplicities[g].check(this,a,b,c,e,f);null!=k&&(d+=k)}k=this.validateEdge(a,b,c);null!=k&&(d+=k);return 0<d.length?d:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(a,b,c){return null}; mxGraph.prototype.validateGraph=function(a,b){a=null!=a?a:this.model.getRoot();b=null!=b?b:{};for(var c=!0,d=this.model.getChildCount(a),e=0;e<d;e++){var f=this.model.getChildAt(a,e),g=b;this.isValidRoot(f)&&(g={});g=this.validateGraph(f,g);null!=g?this.setCellWarning(f,g.replace(/\n/g,"<br>")):this.setCellWarning(f,null);c=c&&null==g}d="";this.isCellCollapsed(a)&&!c&&(d+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n");d=this.model.isEdge(a)?d+ (this.getEdgeValidationError(a,this.model.getTerminal(a,!0),this.model.getTerminal(a,!1))||""):d+(this.getCellValidationError(a)||"");b=this.validateCell(a,b);null!=b&&(d+=b);null==this.model.getParent(a)&&this.view.validate();return 0<d.length||!c?d:null}; mxGraph.prototype.getCellValidationError=function(a){var b=this.model.getDirectedEdgeCount(a,!0),c=this.model.getDirectedEdgeCount(a,!1);a=this.model.getValue(a);var d="";if(null!=this.multiplicities)for(var e=0;e<this.multiplicities.length;e++){var f=this.multiplicities[e];f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(b>f.max||b<f.min)?d+=f.countError+"\n":!f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(c>f.max||c<f.min)&&(d+=f.countError+"\n")}return 0<d.length?d:null}; mxGraph.prototype.validateCell=function(a,b){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(a){this.backgroundImage=a};mxGraph.prototype.getFoldingImage=function(a){if(null!=a&&this.foldingEnabled&&!this.getModel().isEdge(a.cell)){var b=this.isCellCollapsed(a.cell);if(this.isCellFoldable(a.cell,!b))return b?this.collapsedImage:this.expandedImage}return null}; mxGraph.prototype.convertValueToString=function(a){a=this.model.getValue(a);if(null!=a){if(mxUtils.isNode(a))return a.nodeName;if("function"==typeof a.toString)return a.toString()}return""};mxGraph.prototype.getLabel=function(a){var b="";if(this.labelsVisible&&null!=a){var c=this.getCurrentCellStyle(a);mxUtils.getValue(c,mxConstants.STYLE_NOLABEL,!1)||(b=this.convertValueToString(a))}return b};mxGraph.prototype.isHtmlLabel=function(a){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels}; mxGraph.prototype.setHtmlLabels=function(a){this.htmlLabels=a};mxGraph.prototype.isWrapping=function(a){var b=this.getCurrentCellStyle(a);a=this.view.getState(a);var c=b[mxConstants.STYLE_TEXT_DIRECTION];a="1"==mxUtils.getValue(b,"convertToSvg","0")&&!mxUtils.isVerticalTextDirection(c)&&(null==a||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("foreignObject").length);return"wrap"==b[a?"svgWhiteSpace":mxConstants.STYLE_WHITE_SPACE]}; mxGraph.prototype.isLabelClipped=function(a){return"hidden"==this.getCurrentCellStyle(a)[mxConstants.STYLE_OVERFLOW]}; mxGraph.prototype.getTooltip=function(a,b,c,d){var e=null;null!=a&&(null==a.control||b!=a.control.node&&b.parentNode!=a.control.node||(e=this.collapseExpandResource,e=mxUtils.htmlEntities(mxResources.get(e)||e).replace(/\\n/g,"<br>")),null==e&&null!=a.overlays&&a.overlays.visit(function(f,g){null!=e||b!=g.node&&b.parentNode!=g.node||(e=mxUtils.htmlEntities(g.overlay.toString()).replace(/\\n/g,"<br>"))}),null==e&&(c=this.selectionCellsHandler.getHandler(a.cell),null!=c&&"function"==typeof c.getTooltipForNode&& (e=c.getTooltipForNode(b))),null==e&&(e=this.getTooltipForCell(a.cell)));return e};mxGraph.prototype.getTooltipForCell=function(a){return null!=a&&null!=a.getTooltip?a.getTooltip():this.convertValueToString(a)};mxGraph.prototype.getLinkForCell=function(a){return null};mxGraph.prototype.getLinkTargetForCell=function(a){return null};mxGraph.prototype.getCursorForMouseEvent=function(a){return this.getCursorForCell(a.getCell())};mxGraph.prototype.getCursorForCell=function(a){return null}; mxGraph.prototype.getStartSize=function(a,b){var c=new mxRectangle;a=this.getCurrentCellStyle(a,b);b=parseInt(mxUtils.getValue(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?c.height=b:c.width=b;return c}; mxGraph.prototype.getSwimlaneDirection=function(a){var b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,0),d=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,0);a=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?0:3;b==mxConstants.DIRECTION_NORTH?a--:b==mxConstants.DIRECTION_WEST?a+=2:b==mxConstants.DIRECTION_SOUTH&&(a+=1);b=mxUtils.mod(a,2);c&&1==b&&(a+=2);d&&0==b&&(a+=2);return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST, mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(a,4)]};mxGraph.prototype.getActualStartSize=function(a,b){var c=new mxRectangle;this.isSwimlane(a,b)&&(b=this.getCurrentCellStyle(a,b),a=parseInt(mxUtils.getValue(b,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),b=this.getSwimlaneDirection(b),b==mxConstants.DIRECTION_NORTH?c.y=a:b==mxConstants.DIRECTION_WEST?c.x=a:b==mxConstants.DIRECTION_SOUTH?c.height=a:c.width=a);return c}; mxGraph.prototype.getActualFooterSize=function(a,b){var c=new mxRectangle,d=this.getCurrentCellStyle(a,b),e=Math.max(0,parseInt(mxUtils.getValue(d,mxConstants.STYLE_FOOTER_SIZE,0)));0<e&&(this.isSwimlane(a,b)?(a=this.getSwimlaneDirection(d),a==mxConstants.DIRECTION_NORTH?c.height=e:a==mxConstants.DIRECTION_WEST?c.width=e:a==mxConstants.DIRECTION_SOUTH?c.y=e:c.x=e):c.height=e);return c};mxGraph.prototype.getImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_IMAGE]:null}; mxGraph.prototype.isTransparentState=function(a){var b=!1;if(null!=a){b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);b=b==mxConstants.NONE&&c==mxConstants.NONE&&null==this.getImage(a)}return b};mxGraph.prototype.getVerticalAlign=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null}; mxGraph.prototype.getIndicatorColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};mxGraph.prototype.getIndicatorShape=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_SHAPE]:null}; mxGraph.prototype.getIndicatorImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(a){this.border=a};mxGraph.prototype.isSwimlane=function(a,b){return null==a||this.model.getParent(a)==this.model.getRoot()||this.model.isEdge(a)?!1:this.getCurrentCellStyle(a,b)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer}; mxGraph.prototype.setResizeContainer=function(a){this.resizeContainer=a};mxGraph.prototype.isEnabled=function(){return this.enabled};mxGraph.prototype.setEnabled=function(a){this.enabled=a;this.fireEvent(new mxEventObject("enabledChanged","enabled",a))};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(a){this.escapeEnabled=a};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing}; mxGraph.prototype.setInvokesStopCellEditing=function(a){this.invokesStopCellEditing=a};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};mxGraph.prototype.setEnterStopsCellEditing=function(a){this.enterStopsCellEditing=a};mxGraph.prototype.isCellLocked=function(a){var b=this.model.getGeometry(a);return this.isCellsLocked()||null!=b&&this.model.isVertex(a)&&b.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked}; mxGraph.prototype.setCellsLocked=function(a){this.cellsLocked=a};mxGraph.prototype.getCloneableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellCloneable(b)}))};mxGraph.prototype.isCellCloneable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsCloneable()&&0!=a[mxConstants.STYLE_CLONEABLE]};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(a){this.cellsCloneable=a}; mxGraph.prototype.getExportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canExportCell(b)}))};mxGraph.prototype.canExportCell=function(a){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canImportCell(b)}))};mxGraph.prototype.canImportCell=function(a){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(a){return this.isCellsSelectable()}; mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(a){this.cellsSelectable=a};mxGraph.prototype.getDeletableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellDeletable(b)}))};mxGraph.prototype.isCellDeletable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsDeletable()&&0!=a[mxConstants.STYLE_DELETABLE]};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable}; mxGraph.prototype.setCellsDeletable=function(a){this.cellsDeletable=a};mxGraph.prototype.isLabelMovable=function(a){return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&this.vertexLabelsMovable)};mxGraph.prototype.getRotatableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellRotatable(b)}))};mxGraph.prototype.isCellRotatable=function(a){return 0!=this.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATABLE]}; mxGraph.prototype.getMovableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellMovable(b)}))};mxGraph.prototype.isCellMovable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsMovable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_MOVABLE]};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(a){this.cellsMovable=a};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled}; mxGraph.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(a){this.portsEnabled=a};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(a){this.gridSize=a};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(a){this.tolerance=a};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable}; mxGraph.prototype.setVertexLabelsMovable=function(a){this.vertexLabelsMovable=a};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(a){this.edgeLabelsMovable=a};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(a){this.swimlaneNesting=a};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled}; mxGraph.prototype.setSwimlaneSelectionEnabled=function(a){this.swimlaneSelectionEnabled=a};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(a){this.multigraph=a};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(a){this.allowDanglingEdges=a};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges}; mxGraph.prototype.setConnectableEdges=function(a){this.connectableEdges=a};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(a){this.cloneInvalidEdges=a};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(a){this.allowLoops=a};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove}; mxGraph.prototype.setDisconnectOnMove=function(a){this.disconnectOnMove=a};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(a){this.dropEnabled=a};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(a){this.splitEnabled=a};mxGraph.prototype.getResizableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellResizable(b)}))}; mxGraph.prototype.isCellResizable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsResizable()&&!this.isCellLocked(a)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(a){this.cellsResizable=a};mxGraph.prototype.isTerminalPointMovable=function(a,b){return!0}; mxGraph.prototype.isCellBendable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsBendable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_BENDABLE]};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(a){this.cellsBendable=a};mxGraph.prototype.getEditableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellEditable(b)}))}; mxGraph.prototype.isCellEditable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsEditable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_EDITABLE]};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(a){this.cellsEditable=a};mxGraph.prototype.isCellDisconnectable=function(a,b,c){return this.isCellsDisconnectable()&&!this.isCellLocked(a)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable}; mxGraph.prototype.setCellsDisconnectable=function(a){this.cellsDisconnectable=a};mxGraph.prototype.isValidSource=function(a){return null==a&&this.allowDanglingEdges||null!=a&&(!this.model.isEdge(a)||this.connectableEdges)&&this.isCellConnectable(a)};mxGraph.prototype.isValidTarget=function(a){return this.isValidSource(a)};mxGraph.prototype.isValidConnection=function(a,b){return this.isValidSource(a)&&this.isValidTarget(b)};mxGraph.prototype.setConnectable=function(a){this.connectionHandler.setEnabled(a)}; mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(a){this.tooltipHandler.setEnabled(a)};mxGraph.prototype.setPanning=function(a){this.panningHandler.panningEnabled=a};mxGraph.prototype.isEditing=function(a){if(null!=this.cellEditor){var b=this.cellEditor.getEditingCell();return null==a?null!=b:a==b}return!1};mxGraph.prototype.isAutoSizeCell=function(a){a=this.getCurrentCellStyle(a);return this.isAutoSizeCells()||1==a[mxConstants.STYLE_AUTOSIZE]}; mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(a){this.autoSizeCells=a};mxGraph.prototype.isExtendParent=function(a){return!this.getModel().isEdge(a)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(a){this.extendParents=a};mxGraph.prototype.isExtendParentsOnAdd=function(a){return this.extendParentsOnAdd}; mxGraph.prototype.setExtendParentsOnAdd=function(a){this.extendParentsOnAdd=a};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(a){this.extendParentsOnMove=a};mxGraph.prototype.isContractParent=function(a){return!this.getModel().isEdge(a)&&this.isContractParents()};mxGraph.prototype.isContractParents=function(){return this.contractParents};mxGraph.prototype.setContractParents=function(a){this.contractParents=a}; mxGraph.prototype.isContractParentsOnRemove=function(){return this.contractParentsOnRemove};mxGraph.prototype.setContractParentsOnRemove=function(a){this.contractParentsOnRemove=a};mxGraph.prototype.isContractParentsOnMove=function(){return this.contractParentsOnMove};mxGraph.prototype.setContractParentsOnMove=function(a){this.contractParentsOnMove=a};mxGraph.prototype.isRecursiveResize=function(a){return this.recursiveResize}; mxGraph.prototype.setRecursiveResize=function(a){this.recursiveResize=a};mxGraph.prototype.isConstrainChild=function(a){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(a))};mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(a){this.constrainChildren=a};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren}; mxGraph.prototype.setConstrainRelativeChildren=function(a){this.constrainRelativeChildren=a};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};mxGraph.prototype.setAllowNegativeCoordinates=function(a){this.allowNegativeCoordinates=a};mxGraph.prototype.getOverlap=function(a){return this.isAllowOverlapParent(a)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(a){return!1}; mxGraph.prototype.getFoldableCells=function(a,b){return this.model.filterCells(a,mxUtils.bind(this,function(c){return this.isCellFoldable(c,b)}))};mxGraph.prototype.isCellFoldable=function(a,b){b=this.getCurrentCellStyle(a);return 0<this.model.getChildCount(a)&&0!=b[mxConstants.STYLE_FOLDABLE]}; mxGraph.prototype.isValidDropTarget=function(a,b,c){return null!=a&&!this.isCellLocked(a)&&(this.isSplitEnabled()&&this.isSplitTarget(a,b,c)||!this.model.isEdge(a)&&(this.isSwimlane(a)||0<this.model.getChildCount(a)&&!this.isCellCollapsed(a)))}; mxGraph.prototype.isSplitTarget=function(a,b,c){return this.model.isEdge(a)&&null!=b&&1==b.length&&this.isCellConnectable(b[0])&&null==this.getEdgeValidationError(a,this.model.getTerminal(a,!0),b[0])?(c=this.model.getTerminal(a,!0),a=this.model.getTerminal(a,!1),!this.model.isAncestor(b[0],c)&&!this.model.isAncestor(b[0],a)):!1}; mxGraph.prototype.getDropTarget=function(a,b,c,d){if(!this.isSwimlaneNesting())for(var e=0;e<a.length;e++)if(this.isSwimlane(a[e]))return null;e=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b));e.x-=this.panDx;e.y-=this.panDy;e=this.getSwimlaneAt(e.x,e.y);if(null==c)c=e;else if(null!=e){for(var f=this.model.getParent(e);null!=f&&this.isSwimlane(f)&&f!=c;)f=this.model.getParent(f);f==c&&(c=e)}for(;null!=c&&!this.isValidDropTarget(c,a,b)&&!this.model.isLayer(c);)c=this.model.getParent(c); if(null==d||!d)for(var g=c;null!=g&&0>mxUtils.indexOf(a,g);)g=this.model.getParent(g);return this.model.isLayer(c)||null!=g?null:c};mxGraph.prototype.getDefaultParent=function(){var a=this.getCurrentRoot();null==a&&(a=this.defaultParent,null==a&&(a=this.model.getRoot(),a=this.model.getChildAt(a,0)));return a};mxGraph.prototype.setDefaultParent=function(a){this.defaultParent=a};mxGraph.prototype.getSwimlane=function(a){for(;null!=a&&!this.isSwimlane(a);)a=this.model.getParent(a);return a}; mxGraph.prototype.getSwimlaneAt=function(a,b,c){null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.model.getRoot()));if(null!=c)for(var d=this.model.getChildCount(c),e=0;e<d;e++){var f=this.model.getChildAt(c,e);if(null!=f){var g=this.getSwimlaneAt(a,b,f);if(null!=g)return g;if(this.isCellVisible(f)&&this.isSwimlane(f)&&(g=this.view.getState(f),this.intersects(g,a,b)))return f}}return null}; mxGraph.prototype.getCellAt=function(a,b,c,d,e,f){d=null!=d?d:!0;e=null!=e?e:!0;null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.getModel().getRoot()));if(null!=c)for(var g=this.model.getChildCount(c)-1;0<=g;g--){var k=this.model.getChildAt(c,g),l=this.getCellAt(a,b,k,d,e,f);if(null!=l)return l;if(this.isCellVisible(k)&&(e&&this.model.isEdge(k)||d&&this.model.isVertex(k))&&(l=this.view.getState(k),null!=l&&(null==f||!f(l,a,b))&&this.intersects(l,a,b)))return k}return null}; mxGraph.prototype.intersects=function(a,b,c){if(null!=a){var d=a.absolutePoints;if(null!=d){a=this.tolerance*this.tolerance;for(var e=d[0],f=1;f<d.length;f++){var g=d[f];if(null!=g){if(null!=e&&mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,b,c)<=a)return!0;e=g}}}else if(e=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0),0!=e&&(d=Math.cos(-e),e=Math.sin(-e),f=new mxPoint(a.getCenterX(),a.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(b,c),d,e,f),b=e.x,c=e.y),mxUtils.contains(a, b,c))return!0}return!1};mxGraph.prototype.hitsSwimlaneContent=function(a,b,c){var d=this.getView().getState(a);a=this.getStartSize(a);if(null!=d){var e=this.getView().getScale();b-=d.x;c-=d.y;if(0<a.width&&0<b&&b>a.width*e||0<a.height&&0<c&&c>a.height*e)return!0}return!1};mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)}; mxGraph.prototype.getChildCells=function(a,b,c){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=b?b:!1,null!=c?c:!1);b=[];for(c=0;c<a.length;c++)this.isCellVisible(a[c])&&b.push(a[c]);return b};mxGraph.prototype.getConnections=function(a,b){return this.getEdges(a,b,!0,!0,!1)};mxGraph.prototype.getIncomingEdges=function(a,b){return this.getEdges(a,b,!0,!1,!1)};mxGraph.prototype.getOutgoingEdges=function(a,b){return this.getEdges(a,b,!1,!0,!1)}; mxGraph.prototype.getEdges=function(a,b,c,d,e,f){c=null!=c?c:!0;d=null!=d?d:!0;e=null!=e?e:!0;f=null!=f?f:!1;for(var g=[],k=this.isCellCollapsed(a),l=this.model.getChildCount(a),m=0;m<l;m++){var n=this.model.getChildAt(a,m);if(k||!this.isCellVisible(n))g=g.concat(this.model.getEdges(n,c,d))}g=g.concat(this.model.getEdges(a,c,d));k=[];for(m=0;m<g.length;m++)n=this.view.getState(g[m]),l=null!=n?n.getVisibleTerminal(!0):this.view.getVisibleTerminal(g[m],!0),n=null!=n?n.getVisibleTerminal(!1):this.view.getVisibleTerminal(g[m], !1),(e&&l==n||l!=n&&(c&&n==a&&(null==b||this.isValidAncestor(l,b,f))||d&&l==a&&(null==b||this.isValidAncestor(n,b,f))))&&k.push(g[m]);return k};mxGraph.prototype.isValidAncestor=function(a,b,c){return c?this.model.isAncestor(b,a):this.model.getParent(a)==b}; mxGraph.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[],f=new mxDictionary;if(null!=a)for(var g=0;g<a.length;g++){var k=this.view.getState(a[g]),l=null!=k?k.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[g],!0);k=null!=k?k.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[g],!1);l==b&&null!=k&&k!=b&&d?f.get(k)||(f.put(k,!0),e.push(k)):k==b&&null!=l&&l!=b&&c&&!f.get(l)&&(f.put(l,!0),e.push(l))}return e}; mxGraph.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.view.getState(d[f]),k=null!=g?g.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[f],!0);g=null!=g?g.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[f],!1);(k==a&&g==b||!c&&k==b&&g==a)&&e.push(d[f])}return e}; mxGraph.prototype.getPointForEvent=function(a,b){a=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));var c=this.view.scale,d=this.view.translate;b=0!=b?this.gridSize/2:0;a.x=this.snap(a.x/c-d.x-b);a.y=this.snap(a.y/c-d.y-b);return a}; mxGraph.prototype.getCells=function(a,b,c,d,e,f,g,k,l){f=null!=f?f:[];if(0<c||0<d||null!=g){var m=this.getModel(),n=a+c,p=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=m.getRoot()));if(null!=e)for(var q=m.getChildCount(e),r=0;r<q;r++){var t=m.getChildAt(e,r),u=this.view.getState(t);if(null!=u&&this.isCellVisible(t)&&(null==k||!k(u))){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(v=null!=g&&m.isVertex(t)&&mxUtils.intersects(g,u)||null!=g&& m.isEdge(t)&&mxUtils.intersects(g,u)||null==g&&(m.isEdge(t)||m.isVertex(t))&&u.x>=a&&u.y+u.height<=p&&u.y>=b&&u.x+u.width<=n)&&f.push(t);v&&!l||this.getCells(a,b,c,d,t,f,g,k,l)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k<g;k++){var l=this.model.getChildAt(c,k),m=this.view.getState(l);this.isCellVisible(l)&&null!=m&&(!d||m.x>=a)&&(!e||m.y>=b)&&f.push(l)}return f}; mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;l<f;l++){var m=e.getChildAt(a,l);if(this.model.isVertex(m)&&this.isCellVisible(m)){for(var n=this.getConnections(m,b?a:null),p=0,q=0,r=0;r<n.length;r++)this.view.getVisibleTerminal(n[r],!0)==m?p++:q++;(c&&0==p&&0<q||!c&&0==q&&0<p)&&d.push(m);n=c?q-p:p-q;n>k&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; mxGraph.prototype.traverse=function(a,b,c,d,e,f){if(null!=c&&null!=a&&(b=null!=b?b:!0,f=null!=f?f:!1,e=e||new mxDictionary,null==d||!e.get(d))&&(e.put(d,!0),d=c(a,d),null==d||d)&&(d=this.model.getEdgeCount(a),0<d))for(var g=0;g<d;g++){var k=this.model.getEdgeAt(a,g),l=this.model.getTerminal(k,!0)==a;b&&!f!=l||(l=this.model.getTerminal(k,!l),this.traverse(l,b,c,k,e,f))}};mxGraph.prototype.isCellSelected=function(a){return this.getSelectionModel().isSelected(a)}; mxGraph.prototype.isAncestorSelected=function(a){for(a=this.model.getParent(a);null!=a&&a!=this.getCurrentRoot();){if(this.isCellSelected(a))return!0;a=this.model.getParent(a)}return!1};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]}; mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(a){this.getSelectionModel().setCell(a)};mxGraph.prototype.setSelectionCells=function(a){this.getSelectionModel().setCells(a)};mxGraph.prototype.addSelectionCell=function(a){this.getSelectionModel().addCell(a)};mxGraph.prototype.addSelectionCells=function(a){this.getSelectionModel().addCells(a)};mxGraph.prototype.removeSelectionCell=function(a){this.getSelectionModel().removeCell(a)}; mxGraph.prototype.removeSelectionCells=function(a){this.getSelectionModel().removeCells(a)};mxGraph.prototype.selectRegion=function(a,b){a=this.getCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(a,b);return a};mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)};mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)}; mxGraph.prototype.selectCell=function(a,b,c){var d=this.selectionModel,e=0<d.cells.length?d.cells[0]:null;1<d.cells.length&&d.clear();d=null!=e?this.model.getParent(e):this.getDefaultParent();var f=this.model.getChildCount(d);null==e&&0<f?(a=this.model.getChildAt(d,0),this.setSelectionCell(a)):null!=e&&!b||null==this.view.getState(d)||null==this.model.getGeometry(d)?null!=e&&c?0<this.model.getChildCount(e)&&(a=this.model.getChildAt(e,0),this.setSelectionCell(a)):0<f&&(b=d.getIndex(e),a?(b++,a=this.model.getChildAt(d, b%f)):(b--,a=this.model.getChildAt(d,0>b?f-1:b)),this.setSelectionCell(a)):this.getCurrentRoot()!=d&&this.setSelectionCell(d)};mxGraph.prototype.selectAll=function(a,b){a=a||this.getDefaultParent();b=b?this.model.filterDescendants(mxUtils.bind(this,function(c){return c!=a&&null!=this.view.getState(c)}),a):this.model.getChildren(a);null!=b&&this.setSelectionCells(b)};mxGraph.prototype.selectVertices=function(a,b){this.selectCells(!0,!1,a,b)}; mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)};mxGraph.prototype.selectCells=function(a,b,c,d){c=c||this.getDefaultParent();var e=mxUtils.bind(this,function(f){return null!=this.view.getState(f)&&((d||0==this.model.getChildCount(f))&&this.model.isVertex(f)&&a&&!this.model.isEdge(this.model.getParent(f))||this.model.isEdge(f)&&b)});c=this.model.filterDescendants(e,c);null!=c&&this.setSelectionCells(c)}; mxGraph.prototype.selectCellForEvent=function(a,b){var c=this.isCellSelected(a);this.isToggleEvent(b)?c?this.removeSelectionCell(a):this.addSelectionCell(a):c&&1==this.getSelectionCount()||this.setSelectionCell(a)};mxGraph.prototype.selectCellsForEvent=function(a,b){this.isToggleEvent(b)?this.addSelectionCells(a):this.setSelectionCells(a)}; mxGraph.prototype.createHandler=function(a){var b=null;if(null!=a)if(this.model.isEdge(a.cell)){b=a.getVisibleTerminalState(!0);var c=a.getVisibleTerminalState(!1),d=this.getCellGeometry(a.cell);b=this.view.getEdgeStyle(a,null!=d?d.points:null,b,c);b=this.createEdgeHandler(a,b)}else b=this.createVertexHandler(a);return b};mxGraph.prototype.createVertexHandler=function(a){return new mxVertexHandler(a)}; mxGraph.prototype.createEdgeHandler=function(a,b){return b==mxEdgeStyle.Loop||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):b==mxEdgeStyle.SegmentConnector||b==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)}; mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var b=0;b<this.mouseListeners.length;b++)if(this.mouseListeners[b]==a){this.mouseListeners.splice(b,1);break}}; mxGraph.prototype.updateMouseEvent=function(a,b){if(null==a.graphX||null==a.graphY){var c=mxUtils.convertPoint(this.container,a.getX(),a.getY());a.graphX=c.x-this.panDx;a.graphY=c.y-this.panDy;null==a.getCell()&&this.isMouseDown&&b==mxEvent.MOUSE_MOVE&&(a.state=this.view.getState(this.getCellAt(c.x,c.y,null,null,null,function(d){return null==d.shape||d.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(d.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=d.shape.fill&& d.shape.fill!=mxConstants.NONE})))}return a};mxGraph.prototype.getStateForTouchEvent=function(a){var b=mxEvent.getClientX(a);a=mxEvent.getClientY(a);b=mxUtils.convertPoint(this.container,b,a);return this.view.getState(this.getCellAt(b.x,b.y))}; mxGraph.prototype.isEventIgnored=function(a,b,c){var d=mxEvent.isMouseEvent(b.getEvent()),e=!1;b.getEvent()==this.lastEvent?e=!0:this.lastEvent=b.getEvent();if(null!=this.eventSource&&a!=mxEvent.MOUSE_MOVE)mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.eventSource=this.mouseUpRedirect=this.mouseMoveRedirect=null;else if(!mxClient.IS_GC&&null!=this.eventSource&&b.getSource()!=this.eventSource)e=!0;else if(mxClient.IS_TOUCH&&a==mxEvent.MOUSE_DOWN&& !d&&!mxEvent.isPenEvent(b.getEvent())){this.eventSource=b.getSource();var f=null;!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC||(f=b.getEvent().pointerId);this.mouseMoveRedirect=mxUtils.bind(this,function(g){null!=f&&g.pointerId!=f||this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,this.getStateForTouchEvent(g)))});this.mouseUpRedirect=mxUtils.bind(this,function(g){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,this.getStateForTouchEvent(g)));f=null});mxEvent.addGestureListeners(this.eventSource, null,this.mouseMoveRedirect,this.mouseUpRedirect)}this.isSyntheticEventIgnored(a,b,c)&&(e=!0);if(!mxEvent.isPopupTrigger(this.lastEvent)&&a!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail)return!0;a==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:a!=mxEvent.MOUSE_DOWN||this.isMouseDown?!e&&((!mxClient.IS_FF||a!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=d||a==mxEvent.MOUSE_DOWN&&this.isMouseDown||a==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(e=!0):(this.isMouseDown=!0,this.isMouseTrigger= d);e||a!=mxEvent.MOUSE_DOWN||(this.lastMouseX=b.getX(),this.lastMouseY=b.getY());return e};mxGraph.prototype.isSyntheticEventIgnored=function(a,b,c){c=!1;b=mxEvent.isMouseEvent(b.getEvent());this.ignoreMouseEvents&&b&&a!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=a!=mxEvent.MOUSE_UP,c=!0):mxClient.IS_FF&&!b&&a==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0);return c}; mxGraph.prototype.isEventSourceIgnored=function(a,b){var c=b.getSource(),d=null!=c.nodeName?c.nodeName.toLowerCase():"";b=!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent());return a==mxEvent.MOUSE_DOWN&&b&&("select"==d||"option"==d||"input"==d&&"checkbox"!=c.type&&"radio"!=c.type&&"button"!=c.type&&"submit"!=c.type&&"file"!=c.type)};mxGraph.prototype.getEventState=function(a){return a}; mxGraph.prototype.isPointerEventIgnored=function(a,b){var c=!1;if(mxClient.IS_ANDROID||!mxClient.IS_LINUX||!mxClient.IS_GC){var d=b.getEvent().pointerId;a==mxEvent.MOUSE_DOWN?null!=this.currentPointerId&&this.currentPointerId!=d?c=!0:null==this.currentPointerId&&(this.currentPointerId=b.getEvent().pointerId):a==mxEvent.MOUSE_MOVE?null!=this.currentPointerId&&this.currentPointerId!=d&&(c=!0):a==mxEvent.MOUSE_UP&&(this.currentPointerId=null)}return c}; mxGraph.prototype.fireMouseEvent=function(a,b,c){if(this.isEventSourceIgnored(a,b))null!=this.tooltipHandler&&this.tooltipHandler.hide();else if(this.isPointerEventIgnored(a,b))this.tapAndHoldValid=!1;else{null==c&&(c=this);b=this.updateMouseEvent(b,a);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(b.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))){var d=(new Date).getTime();if(a==mxEvent.MOUSE_DOWN)if(null!=this.lastTouchEvent&& this.lastTouchEvent!=b.getEvent()&&d-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance&&2>this.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?b.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,this.dblClick(b.getEvent(),d),d=!0):(this.fireDoubleClick=!0,this.lastTouchTime=0),d){mxEvent.consume(b.getEvent()); return}}else{if(null==this.lastTouchEvent||this.lastTouchEvent!=b.getEvent())this.lastTouchCell=b.getCell(),this.lastTouchX=b.getX(),this.lastTouchY=b.getY(),this.lastTouchTime=d,this.lastTouchEvent=b.getEvent(),this.doubleClickCounter=0}else if((this.isMouseDown||a==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;d=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=!1;(null!=d||(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&& Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance?this.dblClick(b.getEvent(),d):mxEvent.consume(b.getEvent());return}}if(!this.isEventIgnored(a,b,c)){b.state=this.getEventState(b.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",a,"event",b));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||b.getEvent().target!=this.container){if(a==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(b.getEvent))this.scrollPointToVisible(b.getGraphX(), b.getGraphY(),this.autoExtend);else if(a==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){d=this.view.scale;var e=this.view.translate;this.view.setTranslate(e.x-this.container.scrollLeft/d,e.y-this.container.scrollTop/d);this.container.scrollLeft=0;this.container.scrollTop=0}if(null!=this.mouseListeners)for(d=[c,b],b.getEvent().preventDefault||(b.getEvent().returnValue=!0),e=0;e<this.mouseListeners.length;e++){var f= this.mouseListeners[e];a==mxEvent.MOUSE_DOWN?f.mouseDown.apply(f,d):a==mxEvent.MOUSE_MOVE?f.mouseMove.apply(f,d):a==mxEvent.MOUSE_UP&&f.mouseUp.apply(f,d)}a==mxEvent.MOUSE_UP&&this.click(b)}(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&a==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,this.initialTouchX=b.getGraphX(),this.initialTouchY=b.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread= window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(b);this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):a==mxEvent.MOUSE_UP?this.tapAndHoldValid=this.tapAndHoldInProgress=!1:this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-b.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-b.getGraphY())<this.tolerance);a==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(b.getEvent())&& this.stopEditing(!this.isInvokesStopCellEditing());this.consumeMouseEvent(a,b,c)}}};mxGraph.prototype.consumeMouseEvent=function(a,b,c){this.fireEvent(new mxEventObject(mxEvent.CONSUME_MOUSE_EVENT,"eventName",a,"event",b));a==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(b.getEvent())&&b.consume(!1)};mxGraph.prototype.fireGestureEvent=function(a,b){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",a,"cell",b))}; mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(), null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)};function mxCellOverlay(a,b,c,d,e,f){this.image=a;this.tooltip=b;this.align=null!=c?c:this.align;this.verticalAlign=null!=d?d:this.verticalAlign;this.offset=null!=e?e:new mxPoint;this.cursor=null!=f?f:"help"}mxCellOverlay.prototype=new mxEventSource;mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null; mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5; mxCellOverlay.prototype.getBounds=function(a){var b=a.view.graph.getModel().isEdge(a.cell),c=a.view.scale,d=this.image.width,e=this.image.height;if(b)if(b=a.absolutePoints,1==b.length%2)b=b[Math.floor(b.length/2)];else{var f=b.length/2;a=b[f-1];b=b[f];b=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2)}else b=new mxPoint,b.x=this.align==mxConstants.ALIGN_LEFT?a.x:this.align==mxConstants.ALIGN_CENTER?a.x+a.width/2:a.x+a.width,b.y=this.verticalAlign==mxConstants.ALIGN_TOP?a.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE? a.y+a.height/2:a.y+a.height;return new mxRectangle(Math.round(b.x-(d*this.defaultOverlap-this.offset.x)*c),Math.round(b.y-(e*this.defaultOverlap-this.offset.y)*c),d*c,e*c)};mxCellOverlay.prototype.toString=function(){return this.tooltip};function mxOutline(a,b){this.source=a;null!=b&&this.init(b)}mxOutline.prototype.source=null;mxOutline.prototype.container=null;mxOutline.prototype.enabled=!0;mxOutline.prototype.suspended=!1;mxOutline.prototype.border=14;mxOutline.prototype.opacity=.7; mxOutline.prototype.init=function(a){this.container=a;this.updateHandler=mxUtils.bind(this,function(b,c){this.update(!0)});this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.source.addListener(mxEvent.REFRESH,this.updateHandler);a=this.source.getView();a.addListener(mxEvent.UP,this.updateHandler);a.addListener(mxEvent.DOWN,this.updateHandler);a.addListener(mxEvent.SCALE,this.updateHandler);a.addListener(mxEvent.TRANSLATE,this.updateHandler);a.addListener(mxEvent.SCALE_AND_TRANSLATE, this.updateHandler);this.scrollHandler=mxUtils.bind(this,function(b,c){this.update(!1)});mxEvent.addListener(this.source.container,"scroll",this.scrollHandler);this.source.addListener(mxEvent.PAN,this.scrollHandler);this.update(!0)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(a){this.enabled=a};mxOutline.prototype.isSuspended=function(){return this.suspended};mxOutline.prototype.setSuspended=function(a){this.suspended=a;this.update(!0)}; mxOutline.prototype.isScrolling=function(){return this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)}; mxOutline.prototype.createSvg=function(){var a=document.createElementNS(mxConstants.NS_SVG,"svg");a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";a.style.display="block";a.style.padding=this.border+"px";a.style.boxSizing="border-box";a.style.overflow="visible";a.style.cursor="default";a.setAttribute("shape-rendering","optimizeSpeed");a.setAttribute("image-rendering","optimizeSpeed");return a}; mxOutline.prototype.addGestureListeners=function(a){var b=null,c=0,d=0,e=1,f=mxUtils.bind(this,function(l){if(this.isEnabled()){b=new mxPoint(mxEvent.getClientX(l),mxEvent.getClientY(l));var m=a.clientWidth-2*this.border,n=a.clientHeight-2*this.border,p=this.getViewBox();e=Math.max(p.width/m,p.height/n);if(mxEvent.getSource(l)!=this.viewport)if(this.isScrolling()){m-=p.width/e;n-=p.height/e;var q=this.svg.getBoundingClientRect();this.source.container.scrollLeft=p.x-m*e/2+(b.x-this.border-q.left)* e;this.source.container.scrollTop=p.y-n*e/2+(b.y-this.border-q.top)*e}else p=this.source.view.translate,n=this.viewport.getBoundingClientRect(),m=(mxEvent.getClientX(l)-n.left)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-n.top)*e/this.source.view.scale,this.source.getView().setTranslate(p.x-m,p.y-n),this.source.panGraph(0,0);mxEvent.addGestureListeners(document,null,g,k);c=this.source.container.scrollLeft;d=this.source.container.scrollTop;mxEvent.consume(l)}}),g=mxUtils.bind(this,function(l){this.isEnabled()&& null!=b&&(this.isScrolling()?(this.source.container.scrollLeft=c+(mxEvent.getClientX(l)-b.x)*e,this.source.container.scrollTop=d+(mxEvent.getClientY(l)-b.y)*e):this.source.panGraph((b.x-mxEvent.getClientX(l))*e,(b.y-mxEvent.getClientY(l))*e),mxEvent.consume(l))}),k=mxUtils.bind(this,function(l){if(this.isEnabled()&&null!=b){if(!this.isScrolling()){var m=(mxEvent.getClientX(l)-b.x)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-b.y)*e/this.source.view.scale,p=this.source.view.translate;this.source.getView().setTranslate(p.x- m,p.y-n);this.source.panGraph(0,0)}mxEvent.removeGestureListeners(document,null,g,k);mxEvent.consume(l);b=null}});mxEvent.addGestureListeners(a,f,g,k)};mxOutline.prototype.getViewBox=function(){return this.source.getGraphBounds()}; mxOutline.prototype.updateSvg=function(){null==this.svg&&(this.svg=this.createSvg(),this.addGestureListeners(this.svg),this.container.appendChild(this.svg));var a=this.getViewBox();this.svg.setAttribute("viewBox",Math.round(a.x)+" "+Math.round(a.y)+" "+Math.round(a.width)+" "+Math.round(a.height));a=mxUtils.getLightDarkColor(null==this.source.background||this.source.background==mxConstants.NONE?this.source.defaultPageBackgroundColor:this.source.background).cssText;this.svg.style.backgroundColor=a; this.updateDrawPane()};mxOutline.prototype.updateDrawPane=function(){null!=this.drawPane&&this.drawPane.parentNode.removeChild(this.drawPane);this.drawPane=this.source.view.getDrawPane().cloneNode(!0);this.drawPane.style.opacity=this.opacity;this.processSvg(this.drawPane);null!=this.viewport?this.svg.insertBefore(this.drawPane,this.viewport):this.svg.appendChild(this.drawPane)}; mxOutline.prototype.processSvg=function(a){var b=this.source.view.scale;Array.prototype.slice.call(a.getElementsByTagName("*")).forEach(mxUtils.bind(this,function(c){if("text"!=c.nodeName&&"foreignObject"!=c.nodeName&&"hidden"!=c.getAttribute("visibility")&&c instanceof SVGElement){var d=parseInt(c.getAttribute("stroke-width")||1);isNaN(d)||c.setAttribute("stroke-width",Math.max(1,d/(5*b)));c.setAttribute("vector-effect","non-scaling-stroke");c.style.cursor=""}else c.parentNode.removeChild(c)}))}; mxOutline.prototype.updateViewport=function(){if(null!=this.svg){null==this.viewport&&(this.viewport=this.createViewport(),this.svg.appendChild(this.viewport));var a=this.source.container;a=new mxRectangle(a.scrollLeft,a.scrollTop,a.clientWidth,a.clientHeight);this.isScrolling()||(a.x=-this.source.panDx,a.y=-this.source.panDy);this.viewport.setAttribute("x",a.x);this.viewport.setAttribute("y",a.y);this.viewport.setAttribute("width",a.width);this.viewport.setAttribute("height",a.height)}}; mxOutline.prototype.createViewport=function(){var a=this.svg.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect");a.setAttribute("stroke-width","3");a.setAttribute("stroke",HoverIcons.prototype.arrowFill);a.setAttribute("fill",HoverIcons.prototype.arrowFill);a.setAttribute("vector-effect","non-scaling-stroke");a.setAttribute("fill-opacity",.2);a.style.cursor="move";return a}; mxOutline.prototype.update=function(a){null!=this.source&&null!=this.source.container&&(null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),this.fullUpdate=this.fullUpdate||a,this.thread=window.setTimeout(mxUtils.bind(this,function(){this.isSuspended()||(this.fullUpdate&&this.updateSvg(),this.updateViewport());this.thread=this.fullUpdate=null}),this.isScrolling()?10:0))}; mxOutline.prototype.destroy=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);null!=this.svg&&(this.svg.parentNode.removeChild(this.svg),this.svg=null);null!=this.source&&(this.source.removeListener(this.scrollHandler),this.source.removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),this.source.getModel().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.scrollHandler),this.source=null)}; function mxMultiplicity(a,b,c,d,e,f,g,k,l,m){this.source=a;this.type=b;this.attr=c;this.value=d;this.min=null!=e?e:0;this.max=null!=f?f:"n";this.validNeighbors=g;this.countError=mxResources.get(k)||k;this.typeError=mxResources.get(l)||l;this.validNeighborsAllowed=null!=m?m:!0}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null; mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=!0;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null; mxMultiplicity.prototype.check=function(a,b,c,d,e,f){var g="";if(this.source&&this.checkTerminal(a,c,b)||!this.source&&this.checkTerminal(a,d,b))null!=this.countError&&(this.source&&(0==this.max||e>=this.max)||!this.source&&(0==this.max||f>=this.max))&&(g+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(a,b,c,d)||(g+=this.typeError+"\n"));return 0<g.length?g:null}; mxMultiplicity.prototype.checkNeighbors=function(a,b,c,d){b=a.model.getValue(c);d=a.model.getValue(d);c=!this.validNeighborsAllowed;for(var e=this.validNeighbors,f=0;f<e.length;f++)if(this.source&&this.checkType(a,d,e[f])){c=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(a,b,e[f])){c=this.validNeighborsAllowed;break}return c};mxMultiplicity.prototype.checkTerminal=function(a,b,c){b=a.model.getValue(b);return this.checkType(a,b,this.type,this.attr,this.value)}; mxMultiplicity.prototype.checkType=function(a,b,c,d,e){return null!=b?isNaN(b.nodeType)?b==c:mxUtils.isNode(b,c,d,e):!1}; function mxLayoutManager(a){this.undoHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.beforeUndo(c.getProperty("edit"))});this.moveHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsMoved(c.getProperty("cells"),c.getProperty("event"))});this.resizeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsResized(c.getProperty("cells"),c.getProperty("bounds"),c.getProperty("previous"))});this.setGraph(a)}mxLayoutManager.prototype=new mxEventSource; mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=!0;mxLayoutManager.prototype.enabled=!0;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(a){this.enabled=a};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling}; mxLayoutManager.prototype.setBubbling=function(a){this.bubbling=a};mxLayoutManager.prototype.getGraph=function(){return this.graph}; mxLayoutManager.prototype.setGraph=function(a){if(null!=this.graph){var b=this.graph.getModel();b.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=a;null!=this.graph&&(b=this.graph.getModel(),b.addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler),this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler))}; mxLayoutManager.prototype.hasLayout=function(a){return null!=this.getLayout(a,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(a,b){return null};mxLayoutManager.prototype.beforeUndo=function(a){this.executeLayoutForCells(this.getCellsForChanges(a.changes))}; mxLayoutManager.prototype.cellsMoved=function(a,b){if(null!=a&&null!=b){b=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var c=this.getGraph().getModel(),d=0;d<a.length;d++){var e=this.getLayout(c.getParent(a[d]),mxEvent.MOVE_CELLS);null!=e&&e.moveCell(a[d],b.x,b.y)}}}; mxLayoutManager.prototype.cellsResized=function(a,b,c){if(null!=a&&null!=b&&null!=c)for(var d=this.getGraph().getModel(),e=0;e<a.length;e++){var f=this.getLayout(d.getParent(a[e]),mxEvent.RESIZE_CELLS);null!=f&&f.resizeCell(a[e],b[e],c[e])}};mxLayoutManager.prototype.getCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)return[];b=b.concat(this.getCellsForChange(d))}return b}; mxLayoutManager.prototype.getCellsForChange=function(a){return a instanceof mxChildChange?this.addCellsWithLayout(a.child,this.addCellsWithLayout(a.previous)):a instanceof mxValueChange||a instanceof mxTerminalChange||a instanceof mxGeometryChange||a instanceof mxVisibleChange||a instanceof mxStyleChange?this.addCellsWithLayout(a.cell):[]};mxLayoutManager.prototype.addCellsWithLayout=function(a,b){return this.addDescendantsWithLayout(a,this.addAncestorsWithLayout(a,b))}; mxLayoutManager.prototype.addAncestorsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&(this.hasLayout(a)&&b.push(a),this.isBubbling())){var c=this.getGraph().getModel();this.addAncestorsWithLayout(c.getParent(a),b)}return b};mxLayoutManager.prototype.addDescendantsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&this.hasLayout(a))for(var c=this.getGraph().getModel(),d=0;d<c.getChildCount(a);d++){var e=c.getChildAt(a,d);this.hasLayout(e)&&(b.push(e),this.addDescendantsWithLayout(e,b))}return b}; mxLayoutManager.prototype.executeLayoutForCells=function(a){var b=this.getGraph().getModel();b.beginUpdate();try{var c=mxUtils.sortCells(a,!1);this.layoutCells(c,!0);this.layoutCells(c.reverse(),!1)}finally{b.endUpdate()}}; mxLayoutManager.prototype.layoutCells=function(a,b){if(0<a.length){var c=this.getGraph().getModel();c.beginUpdate();try{for(var d=null,e=0;e<a.length;e++)a[e]!=c.getRoot()&&a[e]!=d&&(this.executeLayout(a[e],b),d=a[e]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",a))}finally{c.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(a,b){b=this.getLayout(a,b?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=b&&b.execute(a)};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)}; function mxSwimlaneManager(a,b,c,d){this.horizontal=null!=b?b:!0;this.addEnabled=null!=c?c:!0;this.resizeEnabled=null!=d?d:!0;this.addHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(f.getProperty("cells"))});this.resizeHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(f.getProperty("cells"))});this.setGraph(a)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager; mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=!0;mxSwimlaneManager.prototype.horizontal=!0;mxSwimlaneManager.prototype.addEnabled=!0;mxSwimlaneManager.prototype.resizeEnabled=!0;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(a){this.enabled=a};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal}; mxSwimlaneManager.prototype.setHorizontal=function(a){this.horizontal=a};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(a){this.addEnabled=a};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(a){this.resizeEnabled=a};mxSwimlaneManager.prototype.getGraph=function(){return this.graph}; mxSwimlaneManager.prototype.setGraph=function(a){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler));this.graph=a;null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(a){return!this.getGraph().isSwimlane(a)}; mxSwimlaneManager.prototype.isCellHorizontal=function(a){return this.graph.isSwimlane(a)?(a=this.graph.getCellStyle(a),1==mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,1)):!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)this.isSwimlaneIgnored(a[c])||this.swimlaneAdded(a[c])}finally{b.endUpdate()}}}; mxSwimlaneManager.prototype.swimlaneAdded=function(a){for(var b=this.getGraph().getModel(),c=b.getParent(a),d=b.getChildCount(c),e=null,f=0;f<d;f++){var g=b.getChildAt(c,f);if(g!=a&&!this.isSwimlaneIgnored(g)&&(e=b.getGeometry(g),null!=e))break}null!=e&&(b=null!=c?this.isCellHorizontal(c):this.horizontal,this.resizeSwimlane(a,e.width,e.height,b))}; mxSwimlaneManager.prototype.cellsResized=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)if(!this.isSwimlaneIgnored(a[c])){var d=b.getGeometry(a[c]);if(null!=d){for(var e=new mxRectangle(0,0,d.width,d.height),f=a[c],g=f;null!=g;){f=g;g=b.getParent(g);var k=this.graph.isSwimlane(g)?this.graph.getStartSize(g):new mxRectangle;e.width+=k.width;e.height+=k.height}var l=null!=g?this.isCellHorizontal(g):this.horizontal;this.resizeSwimlane(f,e.width, e.height,l)}}}finally{b.endUpdate()}}}; mxSwimlaneManager.prototype.resizeSwimlane=function(a,b,c,d){var e=this.getGraph().getModel();e.beginUpdate();try{var f=this.isCellHorizontal(a);if(!this.isSwimlaneIgnored(a)){var g=e.getGeometry(a);null!=g&&(d&&g.height!=c||!d&&g.width!=b)&&(g=g.clone(),d?g.height=c:g.width=b,e.setGeometry(a,g))}var k=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;b-=k.width;c-=k.height;var l=e.getChildCount(a);for(d=0;d<l;d++){var m=e.getChildAt(a,d);this.resizeSwimlane(m,b,c,f)}}finally{e.endUpdate()}}; mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)}; function mxTemporaryCellStates(a,b,c,d,e,f){b=null!=b?b:1;this.view=a;this.oldValidateCellState=a.validateCellState;this.oldBounds=a.getGraphBounds();this.oldStates=a.getStates();this.oldScale=a.getScale();this.oldDoRedrawShape=a.graph.cellRenderer.doRedrawShape;var g=this;null!=e&&(a.graph.cellRenderer.doRedrawShape=function(m){var n=m.shape.paint;m.shape.paint=function(p){var q=e(m);null!=q&&p.setLink(q,null!=f?f(m):null);n.apply(this,arguments);null!=q&&p.setLink(null)};g.oldDoRedrawShape.apply(a.graph.cellRenderer, arguments);m.shape.paint=n});a.validateCellState=function(m,n){return null==m||null==d||d(m)?g.oldValidateCellState.apply(a,arguments):null};a.setStates(new mxDictionary);a.setScale(b);if(null!=c){a.resetValidationState();b=null;for(var k=0;k<c.length;k++){var l=a.getBoundingBox(a.validateCellState(a.validateCell(c[k])));null==b?b=l:b.add(l)}a.setGraphBounds(b||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null; mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};function mxCellStatePreview(a){this.deltas=new mxDictionary;this.graph=a}mxCellStatePreview.prototype.graph=null; mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count};mxCellStatePreview.prototype.moveState=function(a,b,c,d,e){d=null!=d?d:!0;e=null!=e?e:!0;var f=this.deltas.get(a.cell);null==f?(f={point:new mxPoint(b,c),state:a},this.deltas.put(a.cell,f),this.count++):d?(f.point.x+=b,f.point.y+=c):(f.point.x=b,f.point.y=c);e&&this.addEdges(a);return f.point}; mxCellStatePreview.prototype.show=function(a){this.deltas.visit(mxUtils.bind(this,function(b,c){this.translateState(c.state,c.point.x,c.point.y)}));this.deltas.visit(mxUtils.bind(this,function(b,c){this.revalidateState(c.state,c.point.x,c.point.y,a)}))}; mxCellStatePreview.prototype.translateState=function(a,b,c){if(null!=a){var d=this.graph.getModel();if(d.isVertex(a.cell)){a.view.updateCellState(a);var e=d.getGeometry(a.cell);0==b&&0==c||null==e||e.relative&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c)}e=d.getChildCount(a.cell);for(var f=0;f<e;f++)this.translateState(a.view.getState(d.getChildAt(a.cell,f)),b,c)}}; mxCellStatePreview.prototype.revalidateState=function(a,b,c,d){if(null!=a){var e=this.graph.getModel();e.isEdge(a.cell)&&a.view.updateCellState(a);var f=this.graph.getCellGeometry(a.cell),g=a.view.getState(e.getParent(a.cell));0==b&&0==c||null==f||!f.relative||!e.isVertex(a.cell)||null!=g&&!e.isVertex(g.cell)&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c);this.graph.cellRenderer.redraw(a);null!=d&&d(a);f=e.getChildCount(a.cell);for(g=0;g<f;g++)this.revalidateState(this.graph.view.getState(e.getChildAt(a.cell, g)),b,c,d)}};mxCellStatePreview.prototype.addEdges=function(a){for(var b=this.graph.getModel(),c=b.getEdgeCount(a.cell),d=0;d<c;d++){var e=a.view.getState(b.getEdgeAt(a.cell,d));null!=e&&this.moveState(e,0,0)}};function mxConnectionConstraint(a,b,c,d,e){this.point=a;this.perimeter=null!=b?b:!0;this.name=c;this.dx=d?d:0;this.dy=e?e:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null; mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null; function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.suspended||(this.updatePreview(),this.updateHint())});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(b,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(b,c){this.refreshThread&&window.clearTimeout(this.refreshThread);this.refreshThread=window.setTimeout(mxUtils.bind(this, function(){this.refreshThread=null;if(null!=this.first&&!this.suspended){var d=this.currentDx,e=this.currentDy;this.currentDy=this.currentDx=0;this.updatePreview();this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);null!=this.pBounds||this.livePreviewUsed?(this.currentDx=d,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),this.updatePreview())): this.reset()}}),0)});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,function(b){null==this.graph.container||"hidden"==this.graph.container.style.visibility||null==this.first||this.suspended||(b=this.graph.isCloneEvent(b)&&this.graph.isCellsCloneable()&&this.isCloneEnabled(),b!=this.cloning&&(this.cloning=b,this.checkPreview(),this.updatePreview()))});mxEvent.addListener(document,"keydown", this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.handlesVisible=!0;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null; mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1; mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled}; mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a}; mxGraphHandler.prototype.isPropagateSelectionCell=function(a,b,c){var d=this.graph.model.getParent(a);return b?(b=this.graph.model.isEdge(a)?null:this.graph.getCellGeometry(a),!this.graph.isSiblingSelected(a)&&(null!=b&&b.relative||!this.graph.isSwimlane(d))):(!this.graph.isToggleEvent(c.getEvent())||!this.graph.isSiblingSelected(a)&&!this.graph.isCellSelected(a)&&!this.graph.isSwimlane(d)||this.graph.isCellSelected(d))&&(this.graph.isToggleEvent(c.getEvent())||!this.graph.isCellSelected(d))}; mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=a.getState();if(!(this.graph.isToggleEvent(a.getEvent())&&mxEvent.isAltDown(a.getEvent())||null==b||this.graph.isCellSelected(b.cell)))for(var c=this.graph.model,d=this.graph.view.getState(c.getParent(b.cell));null!=d&&!this.graph.isCellSelected(d.cell)&&(c.isVertex(d.cell)||c.isEdge(d.cell))&&this.isPropagateSelectionCell(b.cell,!0,a)&&d.cell!=this.graph.getCurrentRoot();)b=d,d=this.graph.view.getState(this.graph.getModel().getParent(b.cell)); return null!=b?b.cell:null};mxGraphHandler.prototype.isDelayedSelection=function(a,b){if(!this.graph.isToggleEvent(b.getEvent())||!mxEvent.isAltDown(b.getEvent()))for(;null!=a;){if(this.graph.selectionCellsHandler.isHandled(a))return this.graph.cellEditor.getEditingCell()!=a;a=this.graph.model.getParent(a)}return this.graph.isToggleEvent(b.getEvent())}; mxGraphHandler.prototype.selectDelayed=function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);this.selectCellForEvent(b,a)}}; mxGraphHandler.prototype.selectCellForEvent=function(a,b){var c=this.graph.view.getState(a);if(null!=c){if(!(b.isSource(c.control)||this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent()))){c=this.graph.getModel();for(var d=c.getParent(a);null!=this.graph.view.getState(d)&&(c.isVertex(d)||c.isEdge(d)&&!this.graph.isToggleEvent(b.getEvent()))&&this.isPropagateSelectionCell(a,!1,b)&&d!=this.graph.getCurrentRoot();)a=d,d=c.getParent(a)}this.graph.selectCellForEvent(a,b.getEvent())}return a}; mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()}; mxGraphHandler.prototype.mouseDown=function(a,b){this.mouseDownX=b.getX();this.mouseDownY=b.getY();a=b.getEvent();if(!mxEvent.isMouseEvent(a)||mxEvent.isLeftMouseButton(a)){var c=mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)&&!this.graph.isSelectionEmpty();if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null!=b.getState()||c)&&!mxEvent.isMultiTouchEvent(a)){var d=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(d,b);this.cell=null;null==d&&c&&(d=this.graph.getSelectionCell()); c=this.graph.getSelectionCount();this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(d,a);mxEvent.isTouchEvent(b.getEvent())&&this.graph.isCellSelected(d)&&0<c&&(this.delayedSelection=this.blockDelayedSelection=!0);this.isMoveEnabled()&&(this.delayedSelection?this.cell=d:this.start(d,b.getX(),b.getY()),this.cellWasClicked=!0,this.graph.isCellLocked(d)||this.consumeMouseEvent(mxEvent.MOUSE_DOWN,b))}}}; mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(d){return null!=this.graph.view.getState(d)&&b.isVertex(d)&&null!=b.getGeometry(d)&&!b.getGeometry(d).relative});a=this.graph.view.getCellStates(b.filterDescendants(c,a));for(c=0;c<a.length;c++)a[c]=this.getGuideState(a[c]);return a}; mxGraphHandler.prototype.getGuideState=function(a){if(null!=a&&this.graph.getModel().isVertex(a.cell)&&90==mxUtils.mod(mxUtils.getNumber(a.style,mxConstants.STYLE_ROTATION,0),360)%180){var b=new mxCellState(a.view,a.cell,a.style);b.x=a.getCenterX()-a.height/2;b.y=a.getCenterY()-a.width/2;b.width=a.height;b.height=a.width;return b}return a}; mxGraphHandler.prototype.getCells=function(a,b){if(null==b&&!this.delayedSelection&&this.graph.isCellMovable(a))return[this.graph.getCompositeParent(a)];b=null!=b?b:this.graph.getSelectionCells();a=new mxDictionary;for(var c=[],d=0;d<b.length;d++){var e=this.graph.getCompositeParent(b[d]);null==a.get(e)&&(a.put(e,!0),c.push(e))}b=[];for(d=0;d<c.length;d++){for(e=this.graph.model.getParent(c[d]);null==a.get(e)&&null!=e;)e=this.graph.model.getParent(e);null==e&&b.push(c[d])}return this.graph.getMovableCells(b)}; mxGraphHandler.prototype.getPreviewBounds=function(a){a=this.getBoundingBox(a);null!=a&&(a.width=Math.max(0,a.width-1),a.height=Math.max(0,a.height-1),a.width<this.minimumSize?(a.x-=(this.minimumSize-a.width)/2,a.width=this.minimumSize):(a.x=Math.round(a.x),a.width=Math.ceil(a.width)),a.height<this.minimumSize?(a.y-=(this.minimumSize-a.height)/2,a.height=this.minimumSize):(a.y=Math.round(a.y),a.height=Math.ceil(a.height)));return a}; mxGraphHandler.prototype.getStateBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=mxRectangle.fromRectangle(e);c.isVertex(a[d])&&90==mxUtils.mod(mxUtils.getNumber(e.style,mxConstants.STYLE_ROTATION,0),360)%180&&(f=new mxRectangle(e.getCenterX()-e.height/2,e.getCenterY()-e.width/2,e.height,e.width));null==b?b=f:b.add(f)}}return b}; mxGraphHandler.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=e;c.isVertex(a[d])&&null!=e.shape&&null!=e.shape.boundingBox&&(f=e.shape.boundingBox);null==b?b=mxRectangle.fromRectangle(f):b.add(f)}}return b}; mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a,null,this.previewColor);a.isDashed=!0;this.htmlPreview?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()),a.pointerEvents=!1,mxClient.IS_IOS&&(a.getSvgScreenOffset=function(){return 0}));return a}; mxGraphHandler.prototype.start=function(a,b,c,d){var e=this.graph.model,f=e.getGeometry(a);if(null==this.first&&this.graph.isCellMovable(a)&&(!e.isEdge(a)||1<this.graph.getSelectionCount()||null!=f&&null!=f.points&&0<f.points.length||null==e.getTerminal(a,!0)||null==e.getTerminal(a,!1)||this.graph.allowDanglingEdges)){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=null!=d?d:this.getCells(this.cell);this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells); this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var g=this.graph.model.getParent(a),k=2>this.graph.model.getChildCount(g),l=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b<a.length;b++)null==this.graph.view.getState(a[b])||l.get(a[b])||l.put(a[b],!0);this.guide.isStateIgnored= mxUtils.bind(this,function(m){var n=this.graph.model.getParent(m.cell);return null!=m.cell&&(!this.cloning&&this.isCellMoving(m.cell)||m.cell!=(this.target||g)&&!k&&!l.get(m.cell)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&n!=(this.target||g))})}}}; mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;c=this.graph.model.getChildCount(a);for(var e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent())&&!this.isConstrainedEvent(a):!0}; mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){}; mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a,b){for(b=0;b<this.cells.length;b++)if(this.graph.model.getParent(this.cells[b])!=a)return!0;return!1}; mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1,this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0)):this.maxLivePreview>=this.cellCount&&this.allowLivePreview?this.cloning?this.livePreviewUsed=!0:this.livePreviewActive||(this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))}; mxGraphHandler.prototype.mouseMove=function(a,b){a=this.graph;var c=a.tolerance;if(null==this.first&&this.delayedSelection&&null!=this.cell&&null!=this.mouseDownX&&null!=this.mouseDownY&&(Math.abs(this.mouseDownX-b.getX())>c||Math.abs(this.mouseDownY-b.getY())>c)){this.delayedSelection=!1;this.cellWasClicked=!0;this.graph.isCellSelected(this.cell)||mxEvent.isAltDown(b.getEvent())||(this.graph.isToggleEvent(b.getEvent())?a.addSelectionCell(this.cell):this.graph.isAncestorSelected(this.cell)||a.setSelectionCell(this.cell)); var d=a.getSelectionCells();this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent())&&!a.isSelectionEmpty()||(d=d.concat(this.cell));this.start(this.cell,this.mouseDownX,this.mouseDownY,this.getCells(null,d))}d=null!=this.first?this.getDelta(b):null;if(b.isConsumed()||!a.isMouseDown||null==this.cell||null==d||null==this.bounds||this.suspended)!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||a.isMouseDown||(d= a.getCursorForMouseEvent(b),null==d&&a.isEnabled()&&a.isCellMovable(b.getCell())&&(d=a.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=d&&null!=b.sourceState&&b.sourceState.setCursor(d));else if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{if(null!=this.shape||this.livePreviewActive||this.cloning||Math.abs(d.x)>c||Math.abs(d.y)>c){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR, 3));c=a.isCloneEvent(b.getEvent())&&a.isCellsCloneable()&&this.isCloneEnabled();var e=a.isGridEnabledEvent(b.getEvent()),f=b.getCell();f=null!=f&&0>mxUtils.indexOf(this.cells,f)?f:a.getCellAt(b.getGraphX(),b.getGraphY(),null,null,null,mxUtils.bind(this,function(n,p,q){return 0<=mxUtils.indexOf(this.cells,n.cell)}));var g=!0,k=null;this.cloning=c;a.isDropEnabled()&&this.highlightEnabled&&(k=a.getDropTarget(this.cells,b.getEvent(),f,c));var l=a.getView().getState(k),m=!1;null!=l&&(c||this.isValidDropTarget(k, b))?(this.target!=k&&(this.target=k,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0):(this.target=null,this.connectOnDrop&&null!=f&&1==this.cells.length&&a.getModel().isVertex(f)&&a.isCellConnectable(f)&&(l=a.getView().getState(f),null!=l&&(f=null==a.getEdgeValidationError(null,this.cell,f)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(f),m=!0)));null!=l&&m?this.highlight.highlight(l):this.highlight.hide();null!=this.guide&&this.useGuidesForEvent(b)? (d=this.guide.move(this.bounds,d,e,c),g=!1):d=a.snapDelta(d,this.bounds,!e,!1,!1);null!=this.guide&&g&&this.guide.hide();this.isConstrainedEvent(b)&&(Math.abs(d.x)>Math.abs(d.y)?d.y=0:d.x=0);this.checkPreview();if(this.currentDx!=d.x||this.currentDy!=d.y)this.currentDx=d.x,this.currentDy=d.y,this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,b);mxEvent.consume(b.getEvent())}}; mxGraphHandler.prototype.isConstrainedEvent=function(a){return(null==this.target||this.graph.isCloneEvent(a.getEvent()))&&this.graph.isConstrainedEvent(a.getEvent())};mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()}; mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())}; mxGraphHandler.prototype.updateLivePreview=function(a,b){if(!this.suspended){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(n,p){n=this.graph.view.getState(p.cell);n!=p&&(p.destroy(),null!=n?this.allCells.put(p.cell,n):this.allCells.remove(p.cell),p=n);if(null!=p&&(n=p.clone(),c.push([p,n]),null!=p.shape&&(null==p.shape.originalPointerEvents&&(p.shape.originalPointerEvents=p.shape.pointerEvents),p.shape.pointerEvents=!1,null!=p.text&&(null==p.text.originalPointerEvents&& (p.text.originalPointerEvents=p.text.pointerEvents),p.text.pointerEvents=!1)),this.graph.model.isVertex(p.cell))){if(!this.cloning||this.graph.isCellCloneable(p.cell))p.x+=a,p.y+=b;this.cloning?null!=p.text&&(p.text.updateBoundingBox(),null!=p.text.boundingBox&&(p.text.boundingBox.x+=a,p.text.boundingBox.y+=b),null!=p.text.unrotatedBoundingBox&&(p.text.unrotatedBoundingBox.x+=a,p.text.unrotatedBoundingBox.y+=b)):(p.view.graph.cellRenderer.redraw(p,!0),p.view.invalidate(p.cell),p.invalid=!1,null!= p.control&&null!=p.control.node&&(p.control.node.style.visibility="hidden"))}}));if(0==c.length)this.reset();else{for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)&&(!this.cloning||this.graph.isCellCloneable(f.cell))){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));l=f.visibleSourceState;var m=f.visibleTargetState; g=c[e][1].absolutePoints;null!=g&&(null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!0,this.graph.getConnectionConstraint(f,l,!0)):(l=null==l?f.view.getFixedTerminalPoint(f,null,!0,null):null,l=null!=l?l:g[0],f.setAbsoluteTerminalPoint(new mxPoint(l.x+a,l.y+b),!0),l=null),null!=m&&this.isCellMoving(m.cell)?f.view.updateFixedTerminalPoint(f,m,!1,this.graph.getConnectionConstraint(f,m,!1)):(m=null==m?f.view.getFixedTerminalPoint(f,null,!1,null):null,m=null!=m?m:g[g.length-1],f.setAbsoluteTerminalPoint(new mxPoint(m.x+ a,m.y+b),!1),m=null));f.view.updatePoints(f,k,l,m);f.view.updateFloatingTerminalPoints(f,l,m);f.view.updateEdgeLabelOffset(f);f.invalid=!1;this.cloning||f.view.graph.cellRenderer.redraw(f,!0)}}this.graph.view.validate();this.redrawHandles(c);this.resetPreviewStates(c)}}};mxGraphHandler.prototype.redrawHandles=function(a){for(var b=0;b<a.length;b++){var c=this.graph.selectionCellsHandler.getHandler(a[b][0].cell);null!=c&&c.redraw(!0)}}; mxGraphHandler.prototype.resetPreviewStates=function(a){for(var b=0;b<a.length;b++)a[b][0].setState(a[b][1])};mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)}; mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))}; mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,function(a,b){null!=b.shape&&null!=b.shape.originalPointerEvents&&(b.shape.pointerEvents=b.shape.originalPointerEvents,b.shape.originalPointerEvents=null,b.shape.bounds=null,null!=b.text&&(b.text.pointerEvents=b.text.originalPointerEvents,b.text.originalPointerEvents=null));null!=b.control&&null!=b.control.node&&"hidden"==b.control.node.style.visibility&&(b.control.node.style.visibility= "");this.cloning||null!=b.text&&b.text.updateBoundingBox();b.view.invalidate(b.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(a,b,c){if(c||this.handlesVisible!=b)for(this.handlesVisible=b,c=0;c<a.length;c++){var d=this.graph.selectionCellsHandler.getHandler(a[c]);null!=d&&(d.setHandlesVisible(b),b&&d.redraw())}};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)}; mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null!=this.cell&&null!=this.first&&null!=this.currentDx&&null!=this.currentDy&&(null!=this.shape||this.livePreviewUsed||this.cloning)){a=this.graph;var c=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=c&&a.getModel().isVertex(c)&&a.isCellConnectable(c)&&a.isEdgeValid(null,this.cell,c))a.connectionHandler.connect(this.cell,c,b.getEvent());else{var d=a.getView().scale;c=this.roundLength(this.currentDx/ d);d=this.roundLength(this.currentDy/d);var e=this.target;a.isSplitEnabled()&&a.isSplitTarget(e,this.cells,b.getEvent())?a.splitEdge(e,this.cells,null,c,d,b.getGraphX(),b.getGraphY()):this.moveCells(this.cells,c,d,this.cloning,this.target,b.getEvent())}}else this.isSelectEnabled()&&this.delayedSelection&&!this.blockDelayedSelection&&null!=this.cell&&this.selectDelayed(b);this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,b);this.reset()}; mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0));this.destroyShapes();this.removeHint();this.delayedSelection=this.blockDelayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=this.suspended=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.pBounds=this.allCells= null};mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);d=Math.sin(-d);var e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1}; mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);!this.graph.isCellSelected(this.cell)&&this.graph.isCellSelected(g)&&(g=this.graph.getModel().getParent(g));null==e&&null!=f&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&& this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])}; mxGraphHandler.prototype.shouldRemoveParent=function(a){a=this.graph.view.getState(a);return null!=a&&(this.graph.model.isEdge(a.cell)||this.graph.model.isVertex(a.cell))&&this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)&&this.graph.isTransparentState(a)}; mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)}; mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.graph.removeListener(this.refreshHandler),this.refreshHandler=null);mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes(); this.removeHint()}; function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");b==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(c)&&(this.start(c),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",c)),c.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){this.isPinchEnabled()&&(b= c.getProperty("event"),mxEvent.isConsumed(b)||"gesturestart"!=b.type?"gestureend"==b.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(b))}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addGestureListeners(document, null,null,this.mouseUpListener),mxEvent.addListener(document,"mouseleave",this.mouseUpListener))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1; mxPanningHandler.prototype.panningEnabled=!0;mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled}; mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(b)||mxEvent.isControlDown(b)&&mxEvent.isShiftDown(b)||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)}; mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,b){this.mouseDownEvent=b;!b.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(b)&&(this.start(b),this.consumePanningTrigger(b))}; mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()}; mxPanningHandler.prototype.mouseMove=function(a,b){this.dx=b.getX()-this.startX;this.dy=b.getY()-this.startY;this.active?(this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",b))):this.panningTrigger&&(a=this.active,this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!a&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START, "event",b)));(this.active||this.panningTrigger)&&b.consume()};mxPanningHandler.prototype.mouseUp=function(a,b){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){a=this.graph.getView().scale;var c=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(c.x+this.dx/a,c.y+this.dy/a)}b.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",b))}this.reset()}; mxPanningHandler.prototype.zoomGraph=function(a){var b=Math.round(this.initialScale*a.scale*100)/100;null!=this.minScale&&(b=Math.max(this.minScale,b));null!=this.maxScale&&(b=Math.min(this.maxScale,b));this.graph.view.scale!=b&&(this.graph.zoomTo(b),mxEvent.consume(a))};mxPanningHandler.prototype.reset=function(){this.panningTrigger=this.graph.isMouseDown=!1;this.mouseDownEvent=null;this.active=!1;this.dy=this.dx=null}; mxPanningHandler.prototype.panGraph=function(a,b){this.graph.getView().setTranslate(a,b)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeGestureListeners(document,null,null,this.mouseUpListener);mxEvent.removeListener(document,"mouseleave",this.mouseUpListener)}; function mxPopupMenuHandler(a,b){null!=a&&(this.graph=a,this.factoryMethod=b,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(c,d){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=!0; mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.graph.tooltipHandler.hide()}))}; mxPopupMenuHandler.prototype.getTriggerPoint=function(){var a=this.graph.view.scale,b=this.graph.view.translate;return new mxPoint(this.triggerX/a-b.x,this.triggerY/a-b.y)};mxPopupMenuHandler.prototype.isSelectOnPopup=function(a){return this.selectOnPopup}; mxPopupMenuHandler.prototype.mouseDown=function(a,b){this.isEnabled()&&!mxEvent.isMultiTouchEvent(b.getEvent())&&(this.hideMenu(),this.triggerX=b.getGraphX(),this.triggerY=b.getGraphY(),this.screenX=mxEvent.getMainEvent(b.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(b.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(b),this.inTolerance=!0)}; mxPopupMenuHandler.prototype.mouseMove=function(a,b){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(b.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(b.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)}; mxPopupMenuHandler.prototype.mouseUp=function(a,b,c){a=null==c;c=null!=c?c:mxUtils.bind(this,function(e){var f=mxUtils.getScrollOrigin();this.popup(b.getX()+f.x+1,b.getY()+f.y+1,e,b.getEvent())});if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var d=this.getCellForPopupEvent(b);this.graph.isEnabled()&&this.isSelectOnPopup(b)&&null!=d&&!this.graph.isCellSelected(d)?this.graph.setSelectionCell(d):this.clearSelectionOnBackground&&null==d&&this.graph.clearSelection(); this.graph.tooltipHandler.hide();c(d);a&&b.consume()}this.inTolerance=this.popupTrigger=!1};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){return a.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)}; function mxCellMarker(a,b,c,d){mxEventSource.call(this);null!=a&&(this.graph=a,this.validColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=c?c:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=d?d:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(a))}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=!0;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=!1; mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(a){this.enabled=a};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(a){this.hotspot=a};mxCellMarker.prototype.getHotspot=function(){return this.hotspot}; mxCellMarker.prototype.setHotspotEnabled=function(a){this.hotspotEnabled=a};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return null!=this.validState};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.process=function(a){var b=null;this.isEnabled()&&(b=this.getState(a),this.setCurrentState(b,a));return b};mxCellMarker.prototype.setCurrentState=function(a,b,c){var d=null!=a?this.isValidState(a):!1;c=null!=c?c:this.getMarkerColor(b.getEvent(),a,d);this.validState=d?a:null;if(a!=this.markedState||c!=this.currentColor)this.currentColor=c,null!=a&&null!=this.currentColor?(this.markedState=a,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.markCell=function(a,b){a=this.graph.getView().getState(a);null!=a&&(this.currentColor=null!=b?b:this.validColor,this.markedState=a,this.mark())};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(a){return!0}; mxCellMarker.prototype.getMarkerColor=function(a,b,c){return c?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(a){var b=this.graph.getView(),c=this.getCell(a);b=this.getStateToMark(b.getState(c));return null!=b&&this.intersects(b,a)?b:null};mxCellMarker.prototype.getCell=function(a){return a.getCell()};mxCellMarker.prototype.getStateToMark=function(a){return a}; mxCellMarker.prototype.intersects=function(a,b){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,b.getGraphX(),b.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.highlight.destroy()}; function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.redrawHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!1)});this.refreshHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!0)});this.graph.addListener(mxEvent.EDITING_STOPPED,this.redrawHandler);this.graph.addListener(mxEvent.EDITING_STARTED,this.redrawHandler);this.graph.getSelectionModel().addListener(mxEvent.CHANGE, this.redrawHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource); mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)}; mxSelectionCellsHandler.prototype.isHandled=function(a){return null!=this.getHandler(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()}; mxSelectionCellsHandler.prototype.refresh=function(a){var b=this.handlers;this.handlers=new mxDictionary;var c=mxUtils.sortCells(this.getHandledSelectionCells(),!1);if(!a&&0<this.graph.graphHandler.maxCells&&0<this.graph.getSelectionCount()){var d=b.getCount();0<d&&(a=d<=this.graph.graphHandler.maxCells!=this.graph.getSelectionCount()<=this.graph.graphHandler.maxCells)}for(d=0;d<c.length;d++){var e=this.graph.view.getState(c[d]);if(null!=e){var f=b.remove(c[d]);null!=f&&(f.state!=e?(f.destroy(),f= null):this.isHandlerActive(f)||(a&&f.refresh(),f.redraw()));null!=f&&this.handlers.put(c[d],f)}}b.visit(mxUtils.bind(this,function(g,k){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",k.state));k.destroy()}));for(d=0;d<c.length;d++)e=this.graph.view.getState(c[d]),null!=e&&(f=this.handlers.get(c[d]),null==f?(f=this.graph.createHandler(e),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",e)),this.handlers.put(c[d],f)):f.updateParentHighlight())}; mxSelectionCellsHandler.prototype.isHandlerActive=function(a){return null!=a.index};mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);if(null!=b){var c=b.index,d=b.startX,e=b.startY;b.destroy();b=this.graph.createHandler(a);null!=b&&(this.handlers.put(a.cell,b),null!=c&&null!=d&&null!=e&&b.start(d,e,c))}}; mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseDown.apply(e,c)})}};mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseMove.apply(e,c)})}}; mxSelectionCellsHandler.prototype.mouseUp=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseUp.apply(e,c)})}}; mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.redrawHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.graph.removeListener(this.redrawHandler),this.refreshHandler=this.redrawHandler=null)}; function mxConnectionHandler(a,b){mxEventSource.call(this);null!=a&&(this.graph=a,this.factoryMethod=b,this.init(),this.escapeHandler=mxUtils.bind(this,function(c,d){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=!0;mxConnectionHandler.prototype.moveIconFront=!1;mxConnectionHandler.prototype.moveIconBack=!1; mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=!1;mxConnectionHandler.prototype.enabled=!0;mxConnectionHandler.prototype.select=!0;mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=!1;mxConnectionHandler.prototype.ignoreMouseDown=!1;mxConnectionHandler.prototype.first=null; mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=!1;mxConnectionHandler.prototype.outlineConnect=!1;mxConnectionHandler.prototype.livePreview=!1;mxConnectionHandler.prototype.cursor=null; mxConnectionHandler.prototype.insertBeforeSource=!1;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(a){this.enabled=a};mxConnectionHandler.prototype.isInsertBefore=function(a,b,c,d,e){return this.insertBeforeSource&&b!=c&&this.graph.model.getParent(a)==this.graph.model.getParent(b)};mxConnectionHandler.prototype.isCreateTarget=function(a){return this.createTarget}; mxConnectionHandler.prototype.setCreateTarget=function(a){this.createTarget=a};mxConnectionHandler.prototype.createShape=function(){var a=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);a.dialect=mxConstants.DIALECT_SVG;a.scale=this.graph.view.scale;a.svgStrokeTolerance=0;a.pointerEvents=!1;a.isDashed=!0;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,null);return a}; mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,function(a){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell));null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()});this.graph.getModel().addListener(mxEvent.CHANGE, this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,function(a){this.reset()});this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)}; mxConnectionHandler.prototype.isConnectableCell=function(a){return!0}; mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);a.hotspotEnabled=!0;a.getCell=mxUtils.bind(this,function(b){var c=mxCellMarker.prototype.getCell.apply(a,arguments);this.error=null;null==c&&null!=this.currentPoint&&(c=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y));if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}if(this.graph.isSwimlane(c)&& null!=this.currentPoint&&this.graph.hitsSwimlaneContent(c,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(c))c=null;null!=c?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,c),null!=this.error&&0==this.error.length&&(c=null,this.isCreateTarget(b.getEvent())&&(this.error=null))):this.isValidSource(c,b)||(c=null):!this.isConnecting()||this.isCreateTarget(b.getEvent())||this.graph.allowDanglingEdges||(this.error="");return c});a.isValidState= mxUtils.bind(this,function(b){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)});a.getMarkerColor=mxUtils.bind(this,function(b,c,d){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null});a.intersects=mxUtils.bind(this,function(b,c){return null!=this.connectImage||this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a}; mxConnectionHandler.prototype.start=function(a,b,c,d){this.previous=a;this.first=new mxPoint(b,c);this.edgeState=null!=d?d:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=a;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape};mxConnectionHandler.prototype.isValidSource=function(a,b){return this.graph.isValidSource(a)}; mxConnectionHandler.prototype.isValidTarget=function(a){return!0};mxConnectionHandler.prototype.validateConnection=function(a,b){return this.isValidTarget(b)?this.graph.getEdgeValidationError(null,a,b):""};mxConnectionHandler.prototype.getConnectImage=function(a){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(a){return null!=a.text&&a.text.node.parentNode==this.graph.container?!0:this.moveIconFront}; mxConnectionHandler.prototype.createIcons=function(a){var b=this.getConnectImage(a);if(null!=b&&null!=a){this.iconState=a;var c=[],d=new mxRectangle(0,0,b.width,b.height),e=new mxImageShape(d,b.src,null,null,0);e.preserveImageAspect=!1;this.isMoveIconToFrontForState(a)?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=e.node.previousSibling&&e.node.parentNode.insertBefore(e.node, e.node.parentNode.firstChild));e.node.style.cursor=mxConstants.CURSOR_CONNECT;var f=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:a});b=mxUtils.bind(this,function(g){mxEvent.isConsumed(g)||(this.icon=e,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,f())))});mxEvent.redirectMouseEvents(e.node,this.graph,f,b);c.push(e);this.redrawIcons(c,this.iconState);return c}return null}; mxConnectionHandler.prototype.redrawIcons=function(a,b){null!=a&&null!=a[0]&&null!=b&&(b=this.getIconPosition(a[0],b),a[0].bounds.x=b.x,a[0].bounds.y=b.y,a[0].redraw())}; mxConnectionHandler.prototype.getIconPosition=function(a,b){var c=this.graph.getView().scale,d=b.getCenterX(),e=b.getCenterY();if(this.graph.isSwimlane(b.cell)){var f=this.graph.getStartSize(b.cell);d=0!=f.width?b.x+f.width*c/2:d;e=0!=f.height?b.y+f.height*c/2:e;f=mxUtils.toRadians(mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION)||0);0!=f&&(c=Math.cos(f),f=Math.sin(f),b=new mxPoint(b.getCenterX(),b.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(d,e),c,f,b),d=e.x,e=e.y)}return new mxPoint(d- a.bounds.width/2,e-a.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var a=0;a<this.icons.length;a++)this.icons[a].destroy();this.iconState=this.selectedIcon=this.icon=this.icons=null}};mxConnectionHandler.prototype.isStartEvent=function(a){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)}; mxConnectionHandler.prototype.mouseDown=function(a,b){this.mouseDownCounter++;this.isEnabled()&&this.graph.isEnabled()&&!b.isConsumed()&&!this.isConnecting()&&this.isStartEvent(b)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(b.getGraphX(), b.getGraphY()),this.edgeState=this.createEdgeState(b),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState&&(a=this.graph.getPointForEvent(b.getEvent()),this.edgeState.cell.geometry.setTerminalPoint(a,!0)),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),b.consume());this.selectedIcon=this.icon;this.icon=null}; mxConnectionHandler.prototype.isImmediateConnectSource=function(a){return!this.graph.isCellMovable(a.cell)};mxConnectionHandler.prototype.createEdgeState=function(a){return null}; mxConnectionHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop|| 0));return this.outlineConnect&&(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))}; mxConnectionHandler.prototype.updateCurrentState=function(a,b){this.constraintHandler.update(a,null==this.first,!1,null==this.first||a.isSource(this.marker.highlight.shape)?null:b);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent", this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(a.getEvent())?(this.marker.reset(),this.currentState= null):(this.marker.process(a),this.currentState=this.marker.getValidState());null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var c=this.isOutlineConnectEvent(a);null!=this.currentState&&c&&(a.isSource(this.marker.highlight.shape)&&(b=new mxPoint(a.getGraphX(),a.getGraphY())),c=this.graph.getOutlineConstraint(b,this.currentState,a),this.constraintHandler.setFocus(a,this.currentState,!1),this.constraintHandler.currentConstraint= c,this.constraintHandler.currentPoint=b);this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(b=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(a.getCell())&& this.marker.getValidState()!=a.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0}; mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y}; mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}}; mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);a=this.graph.getView();var c=a.scale,d=a.translate;a=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(a=new mxPoint((this.graph.snap(a.x/c-d.x)+d.x)*c,(this.graph.snap(a.y/c-d.y)+d.y)*c)); this.snapToPreview(b,a);this.currentPoint=a;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,a);if(null!=this.first){var e=null;c=a;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(e=this.constraintHandler.currentConstraint, c=this.constraintHandler.currentPoint.clone()):null!=this.previous&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&(d=new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),null!=this.sourceConstraint&&(d=this.first),Math.abs(d.x-a.x)<Math.abs(d.y-a.y)?a.x=d.x:a.y=d.y);d=this.first;if(null!=this.selectedIcon){var f=this.selectedIcon.bounds.width,g=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(f=this.getIconPosition(this.selectedIcon, this.currentState),this.selectedIcon.bounds.x=f.x,this.selectedIcon.bounds.y=f.y):(f=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,f,g),this.selectedIcon.bounds=f);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(c,e),c=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],d=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(f=this.getTargetPerimeterPoint(this.currentState, b),null!=f&&(c=f)),null==this.sourceConstraint&&null!=this.previous&&(f=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:c,b),null!=f&&(d=f)));if(null==this.currentState&&this.movePreviewAway){f=d;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(e=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=e&&(f=e));e=c.x-f.x;f=c.y-f.y;g=Math.sqrt(e*e+f*f);if(0==g)return;this.originalPoint=c.clone();c.x-=4*e/ g;c.y-=4*f/g}else this.originalPoint=null;null==this.shape&&(e=Math.abs(b.getGraphX()-this.first.x),f=Math.abs(b.getGraphY()-this.first.y),e>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,a));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(a=[d],null!=this.waypoints&&(a=a.concat(this.waypoints)),a.push(c),this.shape.points=a),this.drawPreview()); null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!= this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){a=!1;c=b.getSource();for(d=0;d<this.icons.length&&!a;d++)a=c==this.icons[d].node||c.parentNode==this.icons[d].node;a||this.updateIcons(this.currentState,this.icons,b)}}}; mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]); this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));a=null;if(null!=this.waypoints)for(a=[],b=0;b<this.waypoints.length;b++){var c=this.waypoints[b].clone(); this.convertWaypoint(c);a[b]=c}this.graph.view.updatePoints(this.edgeState,a,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)}; mxConnectionHandler.prototype.getTargetPerimeterPoint=function(a,b){b=null;var c=a.view,d=c.getPerimeterFunction(a);if(null!=d){var e=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());a=d(c.getPerimeterBounds(a),this.edgeState,e,!1);null!=a&&(b=a)}else b=new mxPoint(a.getCenterX(),a.getCenterY());return b}; mxConnectionHandler.prototype.getSourcePerimeterPoint=function(a,b,c){c=null;var d=a.view,e=d.getPerimeterFunction(a),f=new mxPoint(a.getCenterX(),a.getCenterY());if(null!=e){var g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),k=Math.PI/180*-g;0!=g&&(b=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(k),Math.sin(k),f));a=e(d.getPerimeterBounds(a),a,b,!1);null!=a&&(0!=g&&(a=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),Math.cos(-k),Math.sin(-k),f)),c=a)}else c=f;return c}; mxConnectionHandler.prototype.updateIcons=function(a,b,c){};mxConnectionHandler.prototype.isStopEvent=function(a){return null!=a.getState()}; mxConnectionHandler.prototype.addWaypointForEvent=function(a){var b=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY()),c=Math.abs(b.x-this.first.x);b=Math.abs(b.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(c>this.graph.tolerance||b>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),c=this.graph.view.scale,b=new mxPoint(this.graph.snap(a.getGraphX()/c)*c,this.graph.snap(a.getGraphY()/c)*c),this.waypoints.push(b)}; mxConnectionHandler.prototype.checkConstraints=function(a,b){return null==a||null==b||null==a.point||null==b.point||!a.point.equals(b.point)||a.dx!=b.dx||a.dy!=b.dy||a.perimeter!=b.perimeter}; mxConnectionHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(b)){this.addWaypointForEvent(b);b.consume();return}a=this.sourceConstraint;var c=this.constraintHandler.currentConstraint,d=null!=this.previous?this.previous.cell:null,e=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(e=this.constraintHandler.currentFocus.cell);null==e&&null!=this.currentState&&(e=this.currentState.cell); null!=this.error||null!=d&&null!=e&&d==e&&!this.checkConstraints(a,c)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,b.getEvent()),null!=this.error&&0<this.error.length&&this.graph.validationAlert(this.error)):this.connect(d,e,b.getEvent(),b.getCell());this.destroyIcons();b.consume()}null!=this.first&&this.reset()}; mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor="");this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.sourceConstraint=this.error=this.previous=this.edgeState=this.currentPoint=this.originalPoint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))}; mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error);null!=this.edgeState&&(this.edgeState.shape=this.shape,this.graph.cellRenderer.postConfigureShape(this.edgeState),this.edgeState.shape=null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(a){this.shape.strokewidth=this.getEdgeWidth(a);this.shape.stroke=this.getEdgeColor(a)};mxConnectionHandler.prototype.getEdgeColor=function(a){return a?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR}; mxConnectionHandler.prototype.getEdgeWidth=function(a){return a?3:1}; mxConnectionHandler.prototype.connect=function(a,b,c,d){if(null!=b||this.isCreateTarget(c)||this.graph.allowDanglingEdges){var e=this.graph.getModel(),f=!1,g=null;e.beginUpdate();try{if(null!=a&&null==b&&!this.graph.isIgnoreTerminalEvent(c)&&this.isCreateTarget(c)&&(b=this.createTargetVertex(c,a),null!=b)){d=this.graph.getDropTarget([b],c,d);f=!0;if(null!=d&&this.graph.getModel().isEdge(d))d=this.graph.getDefaultParent();else{var k=this.graph.getView().getState(d);if(null!=k){var l=e.getGeometry(b); l.x-=k.origin.x;l.y-=k.origin.y}}this.graph.addCell(b,d)}var m=this.graph.getDefaultParent(),n=this.graph.getReferenceTerminal(a),p=this.graph.getReferenceTerminal(b),q=m;null!=n&&null!=p?q=e.getNearestCommonAncestor(n,p):null!=n&&(q=e.getParent(n));null==q||e.isEdge(q)||q==e.getRoot()||(m=q);p=n=null;null!=this.edgeState&&(n=this.edgeState.cell.value,p=this.edgeState.cell.style);g=this.insertEdge(m,null,n,a,b,p);if(null!=g){this.graph.setConnectionConstraint(g,a,!0,this.sourceConstraint);this.graph.setConnectionConstraint(g, b,!1,this.constraintHandler.currentConstraint);null!=this.edgeState&&e.setGeometry(g,this.edgeState.cell.geometry);if(this.isInsertBefore(g,a,b,c,d)&&(null==this.constraintHandler.currentConstraint||this.constraintHandler.currentConstraint.perimeter)){for(l=a;null!=l.parent&&null!=l.geometry&&l.geometry.relative&&l.parent!=g.parent;)l=this.graph.model.getParent(l);null!=l&&null!=l.parent&&l.parent==g.parent&&e.add(m,g,l.parent.getIndex(l))}var r=e.getGeometry(g);null==r&&(r=new mxGeometry,r.relative= !0,e.setGeometry(g,r));if(null!=this.waypoints&&0<this.waypoints.length){var t=this.graph.view.scale,u=this.graph.view.translate;r.points=[];for(a=0;a<this.waypoints.length;a++){var v=this.waypoints[a];r.points.push(new mxPoint(v.x/t-u.x,v.y/t-u.y))}}if(null==b){var y=this.graph.view.translate;t=this.graph.view.scale;v=null!=this.originalPoint?new mxPoint(this.originalPoint.x/t-y.x,this.originalPoint.y/t-y.y):new mxPoint(this.currentPoint.x/t-y.x,this.currentPoint.y/t-y.y);v.x-=this.graph.panDx/this.graph.view.scale; v.y-=this.graph.panDy/this.graph.view.scale;k=this.graph.getView().getState(e.getParent(g));null!=k&&(v.x-=k.origin.x,v.y-=k.origin.y);r.setTerminalPoint(v,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",g,"terminal",b,"event",c,"target",d,"terminalInserted",f))}}catch(A){mxLog.show(),mxLog.debug(A.message)}finally{e.endUpdate()}this.select&&this.selectCells(g,f?b:null)}};mxConnectionHandler.prototype.selectCells=function(a,b){this.graph.setSelectionCell(a)}; mxConnectionHandler.prototype.insertEdge=function(a,b,c,d,e,f){if(null==this.factoryMethod)return this.graph.insertEdge(a,b,c,d,e,f);b=this.createEdge(c,d,e,f);return this.graph.addEdge(b,a,d,e)}; mxConnectionHandler.prototype.createTargetVertex=function(a,b){for(a=this.graph.getCellGeometry(b);null!=a&&a.relative;)b=this.graph.getModel().getParent(b),a=this.graph.getCellGeometry(b);var c=this.graph.cloneCell(b);a=this.graph.getModel().getGeometry(c);if(null!=a){var d=this.graph.view.translate,e=this.graph.view.scale,f=new mxPoint(this.currentPoint.x/e-d.x,this.currentPoint.y/e-d.y);a.x=Math.round(f.x-a.width/2-this.graph.panDx/e);a.y=Math.round(f.y-a.height/2-this.graph.panDy/e);f=this.getAlignmentTolerance(); if(0<f){var g=this.graph.view.getState(b);null!=g&&(b=g.x/e-d.x,d=g.y/e-d.y,Math.abs(b-a.x)<=f&&(a.x=Math.round(b)),Math.abs(d-a.y)<=f&&(a.y=Math.round(d)))}}return c};mxConnectionHandler.prototype.getAlignmentTolerance=function(a){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance}; mxConnectionHandler.prototype.createEdge=function(a,b,c,d){var e=null;null!=this.factoryMethod&&(e=this.factoryMethod(b,c,d));null==e&&(e=new mxCell(a||""),e.setEdge(!0),e.setStyle(d),a=new mxGeometry,a.relative=!0,e.setGeometry(a));return e}; mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null);null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler), this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)}; function mxConstraintHandler(a){this.graph=a;this.resetHandler=mxUtils.bind(this,function(b,c){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()});this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT, this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=!0;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(a){this.enabled=a}; mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null);this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null};mxConstraintHandler.prototype.getTolerance=function(a){return this.graph.getTolerance()}; mxConstraintHandler.prototype.getImageForConstraint=function(a,b,c){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(a,b){return!1};mxConstraintHandler.prototype.isStateIgnored=function(a,b){return!1};mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusPoints=this.focusIcons=null}}; mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)};mxConstraintHandler.prototype.isKeepFocusEvent=function(a){return mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())}; mxConstraintHandler.prototype.getCellForEvent=function(a,b){var c=a.getCell();null!=c||null==b||a.getGraphX()==b.x&&a.getGraphY()==b.y||(c=this.graph.getCellAt(b.x,b.y));null==c||this.graph.isCellConnectable(c)||(a=this.graph.getModel().getParent(c),this.graph.getModel().isVertex(a)&&this.graph.isCellConnectable(a)&&(c=a));return this.graph.isCellLocked(c)?null:c}; mxConstraintHandler.prototype.update=function(a,b,c,d){if(this.isEnabled()&&!this.isEventIgnored(a)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var e=this.getTolerance(a),f=null!=d?d.x:a.getGraphX(),g=null!=d?d.y:a.getGraphY();f=new mxRectangle(f-e,g-e,2*e,2*e);e=new mxRectangle(a.getGraphX()-e,a.getGraphY()-e,2*e,2*e);var k=this.graph.view.getState(this.getCellForEvent(a, d));this.isKeepFocusEvent(a)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==k&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,e)||k==this.currentFocus||(this.currentFocus=this.currentFocusArea=null,this.setFocus(a,k,b));a=this.currentPoint=this.currentConstraint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==k||this.currentFocus==k)){g=e.getCenterX();for(var l=e.getCenterY(),m=0;m<this.focusIcons.length;m++){var n=g-this.focusIcons[m].bounds.getCenterX(), p=l-this.focusIcons[m].bounds.getCenterY();n=n*n+p*p;if((this.intersects(this.focusIcons[m],e,b,c)||null!=d&&this.intersects(this.focusIcons[m],f,b,c))&&(null==a||n<a)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];a=n;n=this.focusIcons[m].bounds.clone();n.grow(mxConstants.HIGHLIGHT_SIZE+1);--n.width;--n.height;if(null==this.focusHighlight){p=this.createHighlightShape();p.dialect=mxConstants.DIALECT_SVG;p.pointerEvents=!1;p.init(this.graph.getView().getOverlayPane()); this.focusHighlight=p;var q=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:k});mxEvent.redirectMouseEvents(p.node,this.graph,q)}this.focusHighlight.bounds=n;this.focusHighlight.redraw()}}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentPoint=this.currentFocus=this.currentConstraint=null}; mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var a=this.graph.view.getState(this.currentFocus.cell);if(null!=a){this.currentFocus=a;this.currentFocusArea=new mxRectangle(a.x,a.y,a.width,a.height);for(var b=0;b<this.constraints.length;b++)if(null!=this.focusIcons[b]){var c=this.graph.getConnectionPoint(a,this.constraints[b]),d=this.getImageForConstraint(a,this.constraints[b],c);d=new mxRectangle(Math.round(c.x-d.width/2), Math.round(c.y-d.height/2),d.width,d.height);this.focusIcons[b].bounds=d;this.focusIcons[b].redraw();this.currentFocusArea.add(this.focusIcons[b].bounds);this.focusPoints[b]=c}}}}; mxConstraintHandler.prototype.setFocus=function(a,b,c){this.constraints=null!=b&&!this.isStateIgnored(b,c)&&this.graph.isCellConnectable(b.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(b,c)||[]:[]:null;if(null!=this.constraints){this.currentFocus=b;this.currentFocusArea=new mxRectangle(b.x,b.y,b.width,b.height);if(null!=this.focusIcons){for(c=0;c<this.focusIcons.length;c++)this.focusIcons[c].destroy();this.focusPoints=this.focusIcons=null}this.focusPoints=[];this.focusIcons=[];for(c= 0;c<this.constraints.length;c++){var d=this.graph.getConnectionPoint(b,this.constraints[c]),e=this.getImageForConstraint(b,this.constraints[c],d),f=e.src;e=new mxRectangle(Math.round(d.x-e.width/2),Math.round(d.y-e.height/2),e.width,e.height);f=new mxImageShape(e,f);f.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;f.preserveImageAspect=!1;f.init(this.graph.getView().getDecoratorPane());null!=f.node.previousSibling&&f.node.parentNode.insertBefore(f.node, f.node.parentNode.firstChild);e=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:b});f.redraw();mxEvent.redirectMouseEvents(f.node,this.graph,e);this.currentFocusArea.add(f.bounds);this.focusIcons.push(f);this.focusPoints.push(d)}this.currentFocusArea.grow(this.getTolerance(a))}else this.destroyIcons(),this.destroyFocusHighlight()}; mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConstraintHandler.prototype.intersects=function(a,b,c,d){return mxUtils.intersects(a.bounds,b)}; mxConstraintHandler.prototype.destroy=function(){this.reset();null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null);null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)}; function mxRubberband(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");if(b==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(c)){b=mxUtils.getOffset(this.graph.container);var d=mxUtils.getScrollOrigin(this.graph.container);d.x-=b.x;d.y-=b.y;this.start(c.getX()+d.x,c.getY()+d.y);c.consume(!1)}}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler= mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler))}mxUtils.extend(mxRubberband,mxEventSource);mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=!0;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0; mxRubberband.prototype.fadeOut=!1;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(a){this.enabled=a};mxRubberband.prototype.isForceRubberbandEvent=function(a){return mxEvent.isAltDown(a.getEvent())&&!mxEvent.isShiftDown(a.getEvent())}; mxRubberband.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null==b.getState()||this.graph.isCellLocked(b.getCell()))&&!mxEvent.isMultiTouchEvent(b.getEvent())){a=mxUtils.getOffset(this.graph.container);var c=mxUtils.getScrollOrigin(this.graph.container);c.x-=a.x;c.y-=a.y;this.start(b.getX()+c.x,b.getY()+c.y);b.consume(!1)}}; mxRubberband.prototype.start=function(a,b){function c(e){e=new mxMouseEvent(e);var f=mxUtils.convertPoint(d,e.getX(),e.getY());e.graphX=f.x;e.graphY=f.y;return e}this.first=new mxPoint(a,b);var d=this.graph.container;this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,c(e))});this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,c(e))});mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)}; mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container);a=mxUtils.getOffset(this.graph.container);c.x-=a.x;c.y-=a.y;a=b.getX()+c.x;c=b.getY()+c.y;var d=this.first.x-a,e=this.first.y-c,f=this.graph.tolerance;if(null!=this.div||Math.abs(d)>f||Math.abs(e)>f)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,c),b.consume()}}; mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);var a=this.sharedDiv;mxClient.IS_SVG&&this.fadeOut&&(this.sharedDiv=null);return a};mxRubberband.prototype.isActive=function(a,b){return null!=this.div&&"none"!=this.div.style.display}; mxRubberband.prototype.mouseUp=function(a,b){a=this.isActive();this.reset();a&&(this.execute(b.getEvent()),b.consume())};mxRubberband.prototype.execute=function(a){var b=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(b,a)}; mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&this.fadeOut){var a=this.div;mxUtils.setPrefixedStyle(a.style,"transition","all 0.2s linear");a.style.pointerEvents="none";a.style.opacity=0;window.setTimeout(function(){a.parentNode.removeChild(a)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null; this.fireEvent(new mxEventObject(mxEvent.RESET))};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint();this.fireEvent(new mxEventObject(mxEvent.UPDATE,"x",this.x,"y",this.y,"width",this.width,"height",this.height))}; mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,b=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,b);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,b)-this.y;this.div.style.left=this.x+0+"px";this.div.style.top=this.y+0+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}}; mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,b,c,d){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;this.shape=null!=d?d:null;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null; mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,b,c){};mxHandle.prototype.execute=function(a){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])}; mxHandle.prototype.processEvent=function(a){var b=this.graph.view.scale,c=this.graph.view.translate;c=new mxPoint(a.getGraphX()/b-c.x,a.getGraphY()/b-c.y);null!=this.shape&&null!=this.shape.bounds&&(c.x-=this.shape.bounds.width/b/4,c.y-=this.shape.bounds.height/b/4);b=-mxUtils.toRadians(this.getRotation());var d=-mxUtils.toRadians(this.getTotalRotation())-b;c=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(c,b),this.ignoreGrid||!this.graph.isGridEnabledEvent(a.getEvent())),d));this.setPosition(this.state.getPaintBounds(), c,a);this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.graph.cellRenderer.configureShape(this.state);this.graph.cellRenderer.redraw(this.state,!0)};mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0};mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0}; mxHandle.prototype.init=function(){var a=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(a));this.initShape(a)};mxHandle.prototype.createShape=function(a){a=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(a,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxHandle.prototype.initShape=function(a){a&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor}; mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var a=this.getPosition(this.state.getPaintBounds());if(null!=a){var b=mxUtils.toRadians(this.getTotalRotation());a=this.rotatePoint(this.flipPoint(a),b);b=this.graph.view.scale;var c=this.graph.view.translate;this.shape.bounds.x=Math.floor((a.x+c.x)*b-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((a.y+c.y)*b-this.shape.bounds.height/2);this.shape.redraw()}}}; mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(a,b){var c=this.state.getCellBounds();c=new mxPoint(c.getCenterX(),c.getCenterY());return mxUtils.getRotatedPoint(a,Math.cos(b),Math.sin(b),c)}; mxHandle.prototype.flipPoint=function(a){if(null!=this.state.shape){var b=this.state.getCellBounds();this.state.shape.flipH&&(a.x=2*b.x+b.width-a.x);this.state.shape.flipV&&(a.y=2*b.y+b.height-a.y)}return a};mxHandle.prototype.snapPoint=function(a,b){b||(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));return a};mxHandle.prototype.setVisible=function(a){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=a?"":"none")}; mxHandle.prototype.reset=function(){this.setVisible(!0);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)}; function mxVertexHandler(a){null!=a&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate());this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=!1; mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=!0;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=!0;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=!1;mxVertexHandler.prototype.parentHighlightEnabled=!1;mxVertexHandler.prototype.rotationRaster=!0;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=!1;mxVertexHandler.prototype.movePreviewToFront=!1; mxVertexHandler.prototype.manageSizers=!1;mxVertexHandler.prototype.constrainGroupByChildren=!1;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0; mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=mxConstants.DIALECT_SVG;this.selectionBorder.svgStrokeTolerance=0;this.selectionBorder.pointerEvents=!1;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]|| "0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX);this.refresh();this.redraw();this.constrainGroupByChildren&&this.updateMinBounds()}; mxVertexHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)}; mxVertexHandler.prototype.refresh=function(){null!=this.selectionBorder&&(this.selectionBorder.strokewidth=this.getSelectionStrokeWidth(),this.selectionBorder.isDashed=this.isSelectionDashed(),this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw());null!=this.sizers&&this.destroySizers();this.isHandlesVisible()&&(this.sizers=this.createSizers());null!=this.customHandles&&this.destroyCustomHandles();this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles())}; mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)};mxVertexHandler.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]};mxVertexHandler.prototype.isCenteredEvent=function(a,b){return!1};mxVertexHandler.prototype.createCustomHandles=function(){return null}; mxVertexHandler.prototype.updateMinBounds=function(){var a=this.graph.getChildCells(this.state.cell);if(0<a.length&&(this.minBounds=this.graph.view.getBounds(a),null!=this.minBounds)){a=this.state.view.scale;var b=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=a;this.minBounds.y/=a;this.minBounds.width/=a;this.minBounds.height/=a;this.x0=this.state.x/a-b.x;this.y0=this.state.y/a-b.y}}; mxVertexHandler.prototype.getSelectionBounds=function(a){return new mxRectangle(Math.round(a.x),Math.round(a.y),Math.round(a.width),Math.round(a.height))};mxVertexHandler.prototype.createParentHighlightShape=function(a){return this.createSelectionShape(a)};mxVertexHandler.prototype.createSelectionShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a}; mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.VERTEX_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED}; mxVertexHandler.prototype.createSizer=function(a,b,c,d){c=c||mxConstants.HANDLE_SIZE;c=new mxRectangle(0,0,c,c);d=this.createSizerShape(c,b,d,this.handleImage);d.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(--d.bounds.height,--d.bounds.width,d.dialect=mxConstants.DIALECT_STRICTHTML,d.init(this.graph.container)):(d.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,d.init(this.graph.getView().getOverlayPane())); mxEvent.redirectMouseEvents(d.node,this.graph,this.state);this.graph.isEnabled()&&d.setCursor(a);this.isSizerVisible(b)||(d.visible=!1);return d};mxVertexHandler.prototype.isSizerVisible=function(a){return!0}; mxVertexHandler.prototype.createSizerShape=function(a,b,c,d){return null!=d?(a=new mxRectangle(a.x,a.y,d.width,d.height),a=new mxImageShape(a,d.src),a.preserveImageAspect=!1,a):b==mxEvent.ROTATION_HANDLE?new mxEllipse(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxVertexHandler.prototype.moveSizerTo=function(a,b,c){null!=a&&(a.bounds.x=Math.floor(b-a.bounds.width/2),a.bounds.y=Math.floor(c-a.bounds.height/2),null!=a.node&&"none"!=a.node.style.display&&a.redraw())}; mxVertexHandler.prototype.getHandleForEvent=function(a){var b=mxEvent.isMouseEvent(a.getEvent())?1:this.tolerance,c=this.allowHandleBoundsCheck&&0<b?new mxRectangle(a.getGraphX()-b,a.getGraphY()-b,2*b,2*b):null;b=mxUtils.bind(this,function(e){var f=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;f=null!=f?new mxRectangle(a.getGraphX()-Math.floor(f/2),a.getGraphY()-Math.floor(f/2),f,f):c;return null!=e&&(a.isSource(e)||e.intersectsRectangle(f))}); if(b(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(b(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var d=0;d<this.sizers.length;d++)if(b(this.sizers[d]))return d;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=this.customHandles.length-1;0<=d;d--)if(null!=this.customHandles[d]&&b(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;return null};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!0}; mxVertexHandler.prototype.mouseDown=function(a,b){b.isConsumed()||!this.graph.isEnabled()||mxEvent.isAltDown(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())||mxEvent.isMouseEvent(b.getEvent())&&!mxEvent.isLeftMouseButton(b.getEvent())||(a=this.getHandleForEvent(b),null!=a&&(this.start(b.getGraphX(),b.getGraphY(),a),b.consume()))};mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke}; mxVertexHandler.prototype.start=function(a,b,c){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetY=this.childOffsetX=0,this.index=c,this.startX=a,this.startY=b,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{a=this.state.view.graph.model;b=a.getParent(this.state.cell);this.state.view.currentRoot!=b&&(a.isVertex(b)||a.isEdge(b))&& (this.parentState=this.state.view.graph.view.getState(b));this.selectionBorder.node.style.display=c==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder())this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())): (this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container));c==mxEvent.ROTATION_HANDLE&&(b=this.getRotationHandlePosition(),a=b.x-this.state.getCenterX(),b=b.y-this.state.getCenterY(),this.startAngle=0!=a?180*Math.atan(b/a)/Math.PI+90:0,this.startDist=Math.sqrt(a*a+b*b));if(this.livePreviewActive)for(this.hideSizers(),c==mxEvent.ROTATION_HANDLE?null!=this.rotationShape&&(this.rotationShape.node.style.display=""):c==mxEvent.LABEL_HANDLE?null!=this.labelShape&&(this.labelShape.node.style.display= ""):null!=this.sizers&&null!=this.sizers[c]?this.sizers[c].node.style.display="":c<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-c]&&this.customHandles[mxEvent.CUSTOM_HANDLE-c].setVisible(!0),c=this.graph.getEdges(this.state.cell),this.edgeHandlers=[],a=0;a<c.length;a++)b=this.graph.selectionCellsHandler.getHandler(c[a]),null!=b&&this.edgeHandlers.push(b)}}; mxVertexHandler.prototype.createGhostPreview=function(){var a=this.graph.cellRenderer.createShape(this.state);a.init(this.graph.view.getOverlayPane());a.scale=this.state.view.scale;a.bounds=this.bounds;a.outline=!0;return a}; mxVertexHandler.prototype.setHandlesVisible=function(a){this.handlesVisible=a;if(null!=this.sizers)for(var b=0;b<this.sizers.length;b++)this.sizers[b].node.style.display=a?"":"none";if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)null!=this.customHandles[b]&&this.customHandles[b].setVisible(a)};mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)}; mxVertexHandler.prototype.checkTolerance=function(a){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(a.getEvent())||Math.abs(a.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(a.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)};mxVertexHandler.prototype.updateHint=function(a){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(a){return Math.round(10*a)/10}; mxVertexHandler.prototype.roundLength=function(a){return Math.round(100*a)/100}; mxVertexHandler.prototype.mouseMove=function(a,b){b.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(b)||b.consume(!1):(this.checkTolerance(b),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-this.index]&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state), this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(b):(this.index==mxEvent.ROTATION_HANDLE? this.rotateVertex(b):this.resizeVertex(b),this.updateHint(b))),b.consume())};mxVertexHandler.prototype.isGhostPreview=function(){return 0<this.state.view.graph.model.getChildCount(this.state.cell)}; mxVertexHandler.prototype.moveLabel=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.graph.view.translate,d=this.graph.view.scale;this.graph.isGridEnabledEvent(a.getEvent())&&(b.x=(this.graph.snap(b.x/d-c.x)+c.x)*d,b.y=(this.graph.snap(b.y/d-c.y)+c.y)*d);this.moveSizerTo(this.sizers[null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1],b.x,b.y)}; mxVertexHandler.prototype.rotateVertex=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.state.x+this.state.width/2-b.x,d=this.state.y+this.state.height/2-b.y;this.currentAlpha=0!=c?180*Math.atan(d/c)/Math.PI+90:0>d?180:0;0<c&&(this.currentAlpha-=180);this.currentAlpha-=this.startAngle;this.rotationRaster&&this.graph.isGridEnabledEvent(a.getEvent())?(c=b.x-this.state.getCenterX(),d=b.y-this.state.getCenterY(),a=Math.sqrt(c*c+d*d),raster=2>a-this.startDist?15:25>a-this.startDist?5: 1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster):this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();this.livePreviewActive&&this.redrawHandles()}; mxVertexHandler.prototype.resizeVertex=function(a){var b=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=new mxPoint(a.getGraphX(),a.getGraphY()),e=this.graph.view.translate,f=this.graph.view.scale,g=Math.cos(-c),k=Math.sin(-c),l=d.x-this.startX,m=d.y-this.startY;d=k*l+g*m;l=g*l-k*m;m=d;g=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(g,l/f,m/f,this.index,this.graph.isGridEnabledEvent(a.getEvent()), 1,new mxPoint(0,0),this.isConstrainedEvent(a),this.isCenteredEvent(this.state,a));g.relative||(k=this.graph.getMaximumGraphBounds(),null!=k&&null!=this.parentState&&(k=mxRectangle.fromRectangle(k),k.x-=(this.parentState.x-e.x*f)/f,k.y-=(this.parentState.y-e.y*f)/f),this.graph.isConstrainChild(this.state.cell)&&(d=this.graph.getCellContainmentArea(this.state.cell),null!=d&&(l=this.graph.getOverlap(this.state.cell),0<l&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*l,d.y-=d.height*l,d.width+=2*d.width* l,d.height+=2*d.height*l),null==k?k=d:(k=mxRectangle.fromRectangle(k),k.intersect(d)))),null!=k&&(this.unscaledBounds.x<k.x&&(this.unscaledBounds.width-=k.x-this.unscaledBounds.x,this.unscaledBounds.x=k.x),this.unscaledBounds.y<k.y&&(this.unscaledBounds.height-=k.y-this.unscaledBounds.y,this.unscaledBounds.y=k.y),this.unscaledBounds.x+this.unscaledBounds.width>k.x+k.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-k.x-k.width),this.unscaledBounds.y+this.unscaledBounds.height> k.y+k.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-k.y-k.height)));d=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:e.x*f)+this.unscaledBounds.x*f,(null!=this.parentState?this.parentState.y:e.y*f)+this.unscaledBounds.y*f,this.unscaledBounds.width*f,this.unscaledBounds.height*f);g.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y);g=Math.cos(c); k=Math.sin(c);c=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());l=c.x-b.x;m=c.y-b.y;b=g*l-k*m-l;c=k*l+g*m-m;l=this.bounds.x-this.state.x;m=this.bounds.y-this.state.y;e=g*l-k*m;g=k*l+g*m;this.bounds.x+=b;this.bounds.y+=c;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+b/f);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+c/f);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height); this.graph.isCellCollapsed(this.state.cell)||0==b&&0==c?this.childOffsetY=this.childOffsetX=0:(this.childOffsetX=this.state.x-this.bounds.x+e,this.childOffsetY=this.state.y-this.bounds.y+g);d.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(a),null!=this.preview?this.drawPreview():this.updateParentHighlight())}; mxVertexHandler.prototype.updateLivePreview=function(a){a=this.graph.view.scale;var b=this.graph.view.translate,c=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/a-b.x,this.state.y/a-b.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;b=this.state.absoluteOffset;new mxPoint(b.x,b.y);this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;b=this.graph.getCellGeometry(this.state.cell);if(null!=b){var d= b.offset||this.EMPTY_POINT;null==d||b.relative||(this.state.absoluteOffset.x=this.state.view.scale*d.x,this.state.absoluteOffset.y=this.state.view.scale*d.y);this.state.view.updateVertexLabelOffset(this.state)}b=this.state.cell.geometry.width;d=this.state.cell.geometry.height;this.state.cell.geometry.width=this.roundLength(this.bounds.width/a);this.state.cell.geometry.height=this.roundLength(this.bounds.height/a);this.state.view.graph.cellRenderer.redraw(this.state,!0);this.state.cell.geometry.width= b;this.state.cell.geometry.height=d;this.state.view.invalidate(this.state.cell);this.state.invalid=!1;this.state.view.validate();this.redrawHandles();this.movePreviewToFront&&this.moveToFront();null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden");this.state.setState(c)}; mxVertexHandler.prototype.moveToFront=function(){if(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node)}; mxVertexHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.state){var c=new mxPoint(b.getGraphX(),b.getGraphY());a=this.index;this.index=null;null==this.ghostPreview&&this.state.view.invalidate(this.state.cell,!1,!1);this.graph.getModel().beginUpdate();try{if(a<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]){var d=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-a].active=!1;this.customHandles[mxEvent.CUSTOM_HANDLE- a].execute(b);null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]&&(this.state.style=d,this.customHandles[mxEvent.CUSTOM_HANDLE-a].positionChanged())}}else if(a==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var e=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=e&&this.rotateCell(this.state.cell,e)}else this.rotateClick();else{var f=this.graph.isGridEnabledEvent(b.getEvent()),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"), k=Math.cos(-g),l=Math.sin(-g),m=c.x-this.startX,n=c.y-this.startY;d=l*m+k*n;m=k*m-l*n;n=d;var p=this.graph.view.scale,q=this.isRecursiveResize(this.state,b);this.resizeCell(this.state.cell,this.roundLength(m/p),this.roundLength(n/p),a,f,this.isConstrainedEvent(b),q)}}finally{this.graph.getModel().endUpdate()}this.state.invalid&&this.state.view.validate();b.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return this.graph.isRecursiveResize(this.state)}; mxVertexHandler.prototype.rotateClick=function(){}; mxVertexHandler.prototype.rotateCell=function(a,b,c){if(0!=b){var d=this.graph.getModel();if(d.isVertex(a)||d.isEdge(a)){if(!d.isEdge(a)){var e=(this.graph.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATION]||0)+b;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,e,[a])}e=this.graph.getCellGeometry(a);if(null!=e){var f=this.graph.getCellGeometry(c);null==f||d.isEdge(c)||(e=e.clone(),e.rotate(b,new mxPoint(f.width/2,f.height/2)),d.setGeometry(a,e));if(d.isVertex(a)&&!e.relative||d.isEdge(a))for(c= d.getChildCount(a),e=0;e<c;e++)this.rotateCell(d.getChildAt(a,e),b,a)}}}}; mxVertexHandler.prototype.reset=function(){null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display="");this.index=this.inTolerance=this.currentAlpha=null;null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);if(this.livePreviewActive&&null!=this.sizers){for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&& (this.sizers[a].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&(this.customHandles[a].active?(this.customHandles[a].active=!1,this.customHandles[a].reset()):this.customHandles[a].setVisible(!0));null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state), this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview());this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=!0;this.livePreviewActive=this.unscaledBounds=null}; mxVertexHandler.prototype.resizeCell=function(a,b,c,d,e,f,g){b=this.graph.model.getGeometry(a);null!=b&&(d==mxEvent.LABEL_HANDLE?(c=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),g=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0),d=Math.cos(c),e=Math.sin(c),c=this.graph.view.scale,d=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/c),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/c)),d,e),g|| (d.y=-d.y),b=b.clone(),null==b.offset?b.offset=d:(b.offset.x+=d.x,b.offset.y+=d.y),this.graph.model.setGeometry(a,b)):null!=this.unscaledBounds&&(c=this.graph.view.scale,0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(a,Math.round(this.childOffsetX/c),Math.round(this.childOffsetY/c)),this.graph.resizeCell(a,this.unscaledBounds,g)))}; mxVertexHandler.prototype.moveChildren=function(a,b,c){for(var d=this.graph.getModel(),e=d.getChildCount(a),f=0;f<e;f++){var g=d.getChildAt(a,f),k=this.graph.getCellGeometry(g);null!=k&&(k=k.clone(),k.translate(b,c),d.setGeometry(g,k))}}; mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,k,l){e=null!=e?e&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var m=a.width,n=a.height,p=a.x-g.x*f,q=p+m;a=a.y-g.y*f;var r=a+n,t=p+m/2,u=a+n/2,v=e&&null!=this.state?mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360):0;v=0!=v&&!isNaN(v); 4<d?(r+=c,r=e?v?a+this.graph.snap((r-a)/f)*f:this.graph.snap(r/f)*f:Math.round(r/f)*f):3>d&&(a+=c,a=e?v?r-this.graph.snap((r-a)/f)*f:this.graph.snap(a/f)*f:Math.round(a/f)*f);if(0==d||3==d||5==d)p+=b,p=e?v?q-this.graph.snap((q-p)/f)*f:this.graph.snap(p/f)*f:Math.round(p/f)*f;else if(2==d||4==d||7==d)q+=b,q=e?v?p+this.graph.snap((q-p)/f)*f:this.graph.snap(q/f)*f:Math.round(q/f)*f;e=q-p;c=r-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k: c=e/k,0==d&&(p=q-e,a=r-c)));if(l){e+=e-m;c+=c-n;if(v){if(0==d||3==d||5==d||2==d||4==d||7==d)e=this.graph.snap(e/f)*f;if(3>d||4<d)c=this.graph.snap(c/f)*f}p+=t-(p+e/2);a+=u-(a+c/2)}0>e&&(p+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(p+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y)));return d}; mxVertexHandler.prototype.redraw=function(a){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();a||this.redrawHandles()}; mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*b||this.bounds.height<2*this.sizers[0].bounds.height+2*b)&&(b/=2,a.x=this.sizers[0].bounds.width+b,a.y=this.sizers[0].bounds.height+b);return a};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds}; mxVertexHandler.prototype.redrawHandles=function(){var a=this.getSizerBounds(),b=this.tolerance;this.verticalOffset=this.horizontalOffset=0;if(null!=this.customHandles)for(var c=0;c<this.customHandles.length;c++)if(null!=this.customHandles[c]){var d=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw();this.customHandles[c].shape.node.style.display=d;this.customHandles[c].shape.node.style.visibility=this.handlesVisible&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[c])&& !this.graph.isEditing()?"":"hidden"}if(null!=a&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&8<=this.sizers.length){c=this.getHandlePadding();this.horizontalOffset=c.x;this.verticalOffset=c.y;if(0!=this.horizontalOffset||0!=this.verticalOffset)a=new mxRectangle(a.x,a.y,a.width,a.height),a.x-=this.horizontalOffset/2,a.width+=this.horizontalOffset,a.y-=this.verticalOffset/2,a.height+=this.verticalOffset;8<=this.sizers.length&&(a.width<2*this.sizers[0].bounds.width+ 2*b||a.height<2*this.sizers[0].bounds.height+2*b?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var e=a.x+a.width,f=a.y+a.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],e,f);else if(b=a.x+a.width/2, c=a.y+a.height/2,8<=this.sizers.length){var g="nw-resize n-resize ne-resize e-resize se-resize s-resize sw-resize w-resize".split(" "),k=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");d=Math.cos(k);var l=Math.sin(k),m=Math.round(4*k/Math.PI);k=new mxPoint(a.getCenterX(),a.getCenterY());var n=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),d,l,k);this.moveSizerTo(this.sizers[0],n.x,n.y);this.sizers[0].setCursor(g[mxUtils.mod(0+m,g.length)]);n.x=b;n.y=a.y;n=mxUtils.getRotatedPoint(n, d,l,k);this.moveSizerTo(this.sizers[1],n.x,n.y);this.sizers[1].setCursor(g[mxUtils.mod(1+m,g.length)]);n.x=e;n.y=a.y;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[2],n.x,n.y);this.sizers[2].setCursor(g[mxUtils.mod(2+m,g.length)]);n.x=a.x;n.y=c;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[3],n.x,n.y);this.sizers[3].setCursor(g[mxUtils.mod(7+m,g.length)]);n.x=e;n.y=c;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[4],n.x,n.y);this.sizers[4].setCursor(g[mxUtils.mod(3+ m,g.length)]);n.x=a.x;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[5],n.x,n.y);this.sizers[5].setCursor(g[mxUtils.mod(6+m,g.length)]);n.x=b;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[6],n.x,n.y);this.sizers[6].setCursor(g[mxUtils.mod(5+m,g.length)]);n.x=e;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[7],n.x,n.y);this.sizers[7].setCursor(g[mxUtils.mod(4+m,g.length)]);a=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL, !0);n.x=b+this.state.absoluteOffset.x;n.y=c+(a?1:-1)*this.state.absoluteOffset.y;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[8],n.x,n.y)}else 2<=this.state.width&&2<=this.state.height&&null!=this.state.absoluteOffset?this.moveSizerTo(this.sizers[0],b+this.state.absoluteOffset.x,c+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}if(null!=this.sizers)for(c=0;c<this.sizers.length;c++)this.sizers[c].node.style.visibility=this.isHandlesVisible()? "":"hidden";null!=this.rotationShape&&(k=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(k),l=Math.sin(k),k=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,l,k),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,n.x,n.y),this.rotationShape.node.style.visibility=!this.state.view.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&& this.isRotationHandleVisible()?"":"hidden"));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw()};mxVertexHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()}; mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))}; mxVertexHandler.prototype.destroyParentHighlight=function(){null!=this.parentHighlight.state&&(delete this.parentHighlight.state.parentHighlight,delete this.parentHighlight.state);this.parentHighlight.destroy();this.parentHighlight=null}; mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var a=this.isParentHighlightVisible(),b=this.graph.model.getParent(this.state.cell),c=this.graph.view.getState(b);null!=this.parentHighlight?this.graph.model.isVertex(b)&&a?(a=this.parentHighlight.bounds,null==c||a.x==c.x&&a.y==c.y&&a.width==c.width&&a.height==c.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(c),this.parentHighlight.redraw())):this.destroyParentHighlight():this.parentHighlightEnabled&& a&&this.graph.model.isVertex(b)&&null!=c&&null==c.parentHighlight&&(this.parentHighlight=this.createParentHighlightShape(c),this.parentHighlight.dialect=mxConstants.DIALECT_SVG,this.parentHighlight.svgStrokeTolerance=0,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(c.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),c.parentHighlight=this.parentHighlight,this.parentHighlight.state=c)}}; mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()}; mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds}; mxVertexHandler.prototype.createSizers=function(){var a=this.graph.isCellResizable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell),b=[];if(a||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var c=0;a&&(this.singleSizer||(b.push(this.createSizer("nw-resize",c++)),b.push(this.createSizer("n-resize",c++)),b.push(this.createSizer("ne-resize",c++)),b.push(this.createSizer("w-resize",c++)),b.push(this.createSizer("e-resize",c++)),b.push(this.createSizer("sw-resize", c++)),b.push(this.createSizer("s-resize",c++))),b.push(this.createSizer("se-resize",c++)));a=this.graph.model.getGeometry(this.state.cell);null==a||a.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!a&&2>this.state.width&&2>this.state.height&& (this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape));null==this.rotationShape&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),b.push(this.rotationShape));return b}; mxVertexHandler.prototype.destroyCustomHandles=function(){if(null!=this.customHandles){for(var a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&this.customHandles[a].destroy();this.customHandles=null}};mxVertexHandler.prototype.destroySizers=function(){if(null!=this.sizers){for(var a=0;a<this.sizers.length;a++)this.sizers[a].destroy();this.rotationShape=this.sizers=null}};mxVertexHandler.prototype.isDestroyed=function(){return null==this.selectionBorder}; mxVertexHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.labelShape=null;this.removeHint();this.destroySizers();this.destroyCustomHandles()}; function mxEdgeHandler(a){null!=a&&null!=a.shape&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){b=null!=this.index;this.reset();b&&this.graph.cellRenderer.redraw(this.state,!1,a.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null; mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=!0;mxEdgeHandler.prototype.addEnabled=!1;mxEdgeHandler.prototype.removeEnabled=!1;mxEdgeHandler.prototype.dblClickRemoveEnabled=!1;mxEdgeHandler.prototype.mergeRemoveEnabled=!1;mxEdgeHandler.prototype.straightRemoveEnabled=!1;mxEdgeHandler.prototype.virtualBendsEnabled=!1;mxEdgeHandler.prototype.virtualBendOpacity=40; mxEdgeHandler.prototype.parentHighlightEnabled=!1;mxEdgeHandler.prototype.preferHtml=!1;mxEdgeHandler.prototype.allowHandleBoundsCheck=!0;mxEdgeHandler.prototype.snapToTerminals=!1;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=!1;mxEdgeHandler.prototype.manageLabelHandle=!1; mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.svgStrokeTolerance=0;this.shape.pointerEvents=!1;mxEvent.redirectMouseEvents(this.shape.node,this.graph, this.state);this.graph.isCellMovable(this.state.cell)&&this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var a=this.state.getVisibleTerminalState(!0);null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container);this.preferHtml||(a=this.state.getVisibleTerminalState(!1),null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container))}this.updateParentHighlight(); this.refresh();this.redraw()};mxEdgeHandler.prototype.createLabelShape=function(){var a=this.createLabelHandleShape();this.initBend(a);return a};mxEdgeHandler.prototype.getConstraintHandler=function(){null==this.constraintHandler&&(this.constraintHandler=this.createConstraintHandler());return this.constraintHandler};mxEdgeHandler.prototype.createConstraintHandler=function(){return new mxConstraintHandler(this.graph)};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible; mxEdgeHandler.prototype.destroyParentHighlight=mxVertexHandler.prototype.destroyParentHighlight;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null}; mxEdgeHandler.prototype.isVirtualBendsEnabled=function(a){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)};mxEdgeHandler.prototype.isCellEnabled=function(a){return!0};mxEdgeHandler.prototype.isAddPointEvent=function(a){return mxEvent.isShiftDown(a)}; mxEdgeHandler.prototype.isRemovePointEvent=function(a){return mxEvent.isShiftDown(a)};mxEdgeHandler.prototype.getSelectionPoints=function(a){return a.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a}; mxEdgeHandler.prototype.createSelectionShape=function(a){a=new this.state.shape.constructor;a.outline=!0;a.apply(this.state);a.isDashed=this.isSelectionDashed();a.stroke=this.getSelectionColor();a.isShadow=!1;return a};mxEdgeHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.EDGE_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH}; mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(a){return!0};mxEdgeHandler.prototype.getCellAt=function(a,b){return this.outlineConnect?null:this.graph.getCellAt(a,b)}; mxEdgeHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph),b=this;a.getCell=function(c){var d=mxCellMarker.prototype.getCell.apply(this,arguments);d!=b.state.cell&&null!=d||null==b.currentPoint||(d=b.graph.getCellAt(b.currentPoint.x,b.currentPoint.y));if(null!=d&&!this.graph.isCellConnectable(d)){var e=this.graph.getModel().getParent(d);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(d=e)}e=b.graph.getModel();if(this.graph.isSwimlane(d)&&null!=b.currentPoint&& this.graph.hitsSwimlaneContent(d,b.currentPoint.x,b.currentPoint.y)||!b.isConnectableCell(d)||d==b.state.cell||null!=d&&!b.graph.connectableEdges&&e.isEdge(d)||e.isAncestor(b.state.cell,d))d=null;this.graph.isCellConnectable(d)||(d=null);return d};a.isValidState=function(c){var d=b.graph.getModel();d=b.graph.view.getTerminalPort(c,b.graph.view.getState(d.getTerminal(b.state.cell,!b.isSource)),!b.isSource);d=null!=d?d.cell:null;b.error=b.validateConnection(b.isSource?c.cell:d,b.isSource?d:c.cell); return null==b.error};return a};mxEdgeHandler.prototype.validateConnection=function(a,b){return this.graph.getEdgeValidationError(this.state.cell,a,b)}; mxEdgeHandler.prototype.createBends=function(){var a=this.state.cell,b=[];if(null!=this.abspoints)for(var c=0;c<this.abspoints.length;c++)if(this.isHandleVisible(c)){var d=c==this.abspoints.length-1,e=0==c||d;(e||this.graph.isCellBendable(a))&&mxUtils.bind(this,function(f){var g=this.createHandleShape(f,null,f==this.abspoints.length-1);this.initBend(g,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,f)})));this.isHandleEnabled(c)&&g.setCursor(e? mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE);b.push(g);e||(this.points.push(new mxPoint(0,0)),g.node.style.visibility="hidden")})(c)}return b};mxEdgeHandler.prototype.createVirtualBends=function(){var a=[];if(null!=this.abspoints&&0<this.abspoints.length&&this.graph.isCellBendable(this.state.cell))for(var b=1;b<this.abspoints.length;b++)mxUtils.bind(this,function(c){this.initBend(c);c.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);a.push(c)})(this.createHandleShape());return a}; mxEdgeHandler.prototype.isHandleEnabled=function(a){return!0};mxEdgeHandler.prototype.isHandleVisible=function(a){return this.edgeStyle!=mxEdgeStyle.EntityRelation||0==a||a==this.abspoints.length-1}; mxEdgeHandler.prototype.createHandleShape=function(a){if(null!=this.handleImage)return a=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src),a.preserveImageAspect=!1,a;a=mxConstants.HANDLE_SIZE;this.preferHtml&&--a;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var a=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);a.preserveImageAspect=!1;return a}a=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxEdgeHandler.prototype.initBend=function(a,b){this.preferHtml?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(a.node,this.graph,this.state,null,null,null,b);mxClient.IS_TOUCH&&a.node.setAttribute("pointer-events","none")}; mxEdgeHandler.prototype.getHandleForEvent=function(a){var b=null;if(null!=this.state){var c=function(g){if(null!=g&&(a.isSource(g)||g.intersectsRectangle(e))){var k=a.getGraphX()-g.bounds.getCenterX();g=a.getGraphY()-g.bounds.getCenterY();k=k*k+g*g;if(null==f||k<=f)return f=k,!0}return!1},d=mxEvent.isMouseEvent(a.getEvent())?0:2*this.tolerance,e=this.allowHandleBoundsCheck?new mxRectangle(a.getGraphX()-d,a.getGraphY()-d,d,d):null,f=null;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d= this.customHandles.length-1;0<=d;d--)if(c(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;null!=this.state.text&&(a.isSource(this.state.text)||c(this.labelShape))&&(b=mxEvent.LABEL_HANDLE);if(null!=this.bends)for(d=0;d<this.bends.length;d++)c(this.bends[d])&&(b=d);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(a))for(d=0;d<this.virtualBends.length;d++)c(this.virtualBends[d])&&(b=mxEvent.VIRTUAL_HANDLE-d)}return b};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!0}; mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!0}; mxEdgeHandler.prototype.mouseDown=function(a,b){if((!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent()))&&this.graph.isCellEditable(this.state.cell)){a=this.getHandleForEvent(b);if(null!=this.bends&&null!=this.bends[a]){var c=this.bends[a].bounds;this.snapPoint=new mxPoint(c.getCenterX(),c.getCenterY())}if(this.addEnabled&&null==a&&this.isAddPointEvent(b.getEvent()))this.addPoint(this.state,b.getEvent()),b.consume();else if(null!=a&&!b.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&& this.isRemovePointEvent(b.getEvent()))this.removePoint(this.state,a);else if(a!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(b.getCell()))a<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-a].node,100),this.mouseDownX=b.getX(),this.mouseDownY=b.getY(),this.handle=a;mxEvent.isShiftDown(b.getEvent())||b.consume()}}}; mxEdgeHandler.prototype.start=function(a,b,c){this.startX=a;this.startY=b;this.isSource=null==this.bends?!1:0==c;this.isTarget=null==this.bends?!1:c==this.bends.length-1;this.isLabel=c==mxEvent.LABEL_HANDLE;if(this.isSource||this.isTarget){if(a=this.state.cell,b=this.graph.model.getTerminal(a,this.isSource),null==b&&this.graph.isTerminalPointMovable(a,this.isSource)||null!=b&&this.graph.isCellDisconnectable(a,b,this.isSource))this.index=c}else this.index=c;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index> mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(c=0;c<this.customHandles.length;c++)c!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[c].setVisible(!1)};mxEdgeHandler.prototype.clonePreviewState=function(a,b){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return 2};mxEdgeHandler.prototype.updateHint=function(a,b){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(a){return Math.round(100*a)/100}; mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(a){return this.snapToTerminals&&!mxEvent.isAltDown(a.getEvent())}; mxEdgeHandler.prototype.getPointForEvent=function(a){var b=this.graph.getView(),c=b.scale,d=new mxPoint(this.roundLength(a.getGraphX()/c)*c,this.roundLength(a.getGraphY()/c)*c),e=this.getSnapToTerminalTolerance(),f=!1,g=!1;if(0<e&&this.isSnapToTerminalsEvent(a)){var k=function(n){null!=n&&l.call(this,new mxPoint(b.getRoutingCenterX(n),b.getRoutingCenterY(n)))},l=function(n){if(null!=n){var p=n.x;Math.abs(d.x-p)<e&&(d.x=p,f=!0);n=n.y;Math.abs(d.y-n)<e&&(d.y=n,g=!0)}};k.call(this,this.state.getVisibleTerminalState(!0)); k.call(this,this.state.getVisibleTerminalState(!1));k=this.state.absolutePoints;if(null!=k)for(var m=0;m<k.length;m++)(0<m||!this.state.isFloatingTerminalPoint(!0))&&(m<k.length-1||!this.state.isFloatingTerminalPoint(!1))&&l.call(this,this.state.absolutePoints[m])}this.graph.isGridEnabledEvent(a.getEvent())&&(a=b.translate,f||(d.x=(this.graph.snap(d.x/c-a.x)+a.x)*c),g||(d.y=(this.graph.snap(d.y/c-a.y)+a.y)*c));return d}; mxEdgeHandler.prototype.getPreviewTerminalState=function(a){var b=this.getConstraintHandler();b.update(a,this.isSource,!0,a.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(null!=b.currentFocus&&null!=b.currentConstraint)return null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==b.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(b.currentFocus.cell, "transparent"),a=this.graph.getModel(),a=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(a.getTerminal(this.state.cell,!this.isSource)),!this.isSource),a=null!=a?a.cell:null,this.error=this.validateConnection(this.isSource?b.currentFocus.cell:a,this.isSource?a:b.currentFocus.cell),a=null,null==this.error&&(a=b.currentFocus),(null!=this.error||null!=a&&!this.isCellEnabled(a.cell))&&b.reset(),a;if(this.graph.isIgnoreTerminalEvent(a.getEvent()))return this.marker.reset(),null;this.marker.process(a); a=this.marker.getValidState();null==a||this.isCellEnabled(a.cell)||(b.reset(),this.marker.reset());return this.marker.getValidState()}; mxEdgeHandler.prototype.getPreviewPoints=function(a,b){var c=this.graph.getCellGeometry(this.state.cell);c=null!=c.points?c.points.slice():null;var d=new mxPoint(a.x,a.y),e=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(c=null);else if(this.convertPoint(d,!1),null==c)c=[d];else{this.index<=mxEvent.VIRTUAL_HANDLE&&c.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,d);if(!this.isSource&&!this.isTarget){for(var f=0;f<this.bends.length;f++)if(f!=this.index){var g=this.bends[f];null!= g&&mxUtils.contains(g.bounds,a.x,a.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?c.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):c.splice(this.index-1,1),e=c)}if(null==e&&this.straightRemoveEnabled&&(null==b||!mxEvent.isAltDown(b.getEvent()))){b=this.graph.tolerance*this.graph.tolerance;f=this.state.absolutePoints.slice();f[this.index]=a;var k=this.state.getVisibleTerminalState(!0);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!0),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[0]=new mxPoint(k.view.getRoutingCenterX(k), k.view.getRoutingCenterY(k)));k=this.state.getVisibleTerminalState(!1);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!1),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[f.length-1]=new mxPoint(k.view.getRoutingCenterX(k),k.view.getRoutingCenterY(k)));g=this.index;0<g&&g<f.length-1&&mxUtils.ptSegDistSq(f[g-1].x,f[g-1].y,f[g+1].x,f[g+1].y,a.x,a.y)<b&&(c.splice(g-1,1),e=c)}}null==e&&this.index>mxEvent.VIRTUAL_HANDLE&&(c[this.index-1]=d)}return null!=e?e:c}; mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||0));return this.outlineConnect&& (mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))}; mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d,e){var f=this.isSource?c:this.state.getVisibleTerminalState(!0),g=this.isTarget?c:this.state.getVisibleTerminalState(!1),k=this.graph.getConnectionConstraint(a,f,!0),l=this.graph.getConnectionConstraint(a,g,!1),m=this.getConstraintHandler(),n=m.currentConstraint;null==n&&e&&(null!=c?(d.isSource(this.marker.highlight.shape)&&(b=new mxPoint(d.getGraphX(),d.getGraphY())),n=this.graph.getOutlineConstraint(b,c,d),m.setFocus(d,c,this.isSource), m.currentConstraint=n,m.currentPoint=b):n=new mxConnectionConstraint);if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var p=this.graph.view.scale;null!=m.currentConstraint&&null!=m.currentFocus?(this.marker.highlight.shape.stroke=e?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke= this.graph.isCellConnectable(d.getCell())&&this.marker.getValidState()!=d.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?k=n:this.isTarget&&(l=n);if(this.isSource||this.isTarget)null!=n&&null!=n.point?(a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=n.point.x,a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=n.point.y): (delete a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);a.setVisibleTerminalState(f,!0);a.setVisibleTerminalState(g,!1);this.isSource&&null==f||a.view.updateFixedTerminalPoint(a,f,!0,k);this.isTarget&&null==g||a.view.updateFixedTerminalPoint(a,g,!1,l);(this.isSource||this.isTarget)&&null==c&&(a.setAbsoluteTerminalPoint(b,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges? null:""));a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)}; mxEdgeHandler.prototype.mouseMove=function(a,b){if(null!=this.index&&null!=this.marker){var c=this.getConstraintHandler();this.currentPoint=this.getPointForEvent(b);this.error=null;null!=this.snapPoint&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&null==c.currentFocus&&c.currentFocus!=this.state&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y); if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,b);a=this.isSource||this.isTarget?this.getPreviewTerminalState(b): null;if(null!=c.currentConstraint&&null!=c.currentFocus&&null!=c.currentPoint)this.currentPoint=c.currentPoint.clone();else if(this.outlineConnect){var d=this.isSource||this.isTarget?this.isOutlineConnectEvent(b):!1;d?a=this.marker.highlight.state:null!=a&&a!=b.getState()&&this.graph.isCellConnectable(b.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),a=null)}null==a||this.isCellEnabled(a.cell)||(a=null,this.marker.reset()); c=this.clonePreviewState(this.currentPoint,null!=a?a.cell:null);this.updatePreviewState(c,this.currentPoint,a,b,d);this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor);this.abspoints=c.absolutePoints;this.active=!0;this.updateHint(b,this.currentPoint,c)}this.drawPreview();mxEvent.consume(b.getEvent());b.consume()}else mxEvent.isShiftDown(b.getEvent())||null==this.handle||null==this.mouseDownX||null==this.mouseDownY||(d=this.graph.tolerance,(Math.abs(this.mouseDownX- b.getX())>d||Math.abs(this.mouseDownY-b.getY())>d)&&this.start(this.mouseDownX,this.mouseDownY,this.handle))}; mxEdgeHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");a=this.state.cell;var c=this.index;this.index=null;if(b.getX()!=this.startX||b.getY()!=this.startY){var d=!this.graph.isIgnoreTerminalEvent(b.getEvent())&&this.cloneEnabled&&this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(c<=mxEvent.CUSTOM_HANDLE&& c>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){var e=this.graph.getModel();e.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-c].execute(b),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{e.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget)if(c=null,null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&& (c=this.constraintHandler.currentFocus.cell),null==c&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(c=this.marker.validState.cell),null!=c){e=this.graph.getModel();var f=e.getParent(a);e.beginUpdate();try{if(d){var g=e.getGeometry(a),k=this.graph.cloneCell(a);e.add(f,k,e.getChildCount(f));null!=g&&(g=g.clone(),e.setGeometry(k,g));var l=e.getTerminal(a,!this.isSource); this.graph.connectCell(k,l,!this.isSource);a=k}a=this.connect(a,c,this.isSource,d,b)}finally{e.endUpdate()}}else this.graph.isAllowDanglingEdges()&&(g=this.abspoints[this.isSource?0:this.abspoints.length-1],g.x=this.roundLength(g.x/this.graph.view.scale-this.graph.view.translate.x),g.y=this.roundLength(g.y/this.graph.view.scale-this.graph.view.translate.y),k=this.graph.getView().getState(this.graph.getModel().getParent(a)),null!=k&&(g.x-=k.origin.x,g.y-=k.origin.y),g.x-=this.graph.panDx/this.graph.view.scale, g.y-=this.graph.panDy/this.graph.view.scale,a=this.changeTerminalPoint(a,g,this.isSource,d));else this.active?a=this.changePoints(a,this.points,d):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(b.getEvent())&&this.graph.selectCellForEvent(this.state.cell,b.getEvent());null!=this.marker&&(this.reset(),a!=this.state.cell&&this.graph.setSelectionCell(a));b.consume()}else null==this.handle||null==this.bends||mxEvent.isAltDown(b.getEvent())|| 0!=this.handle&&this.handle!=this.bends.length-1||(c=this.state.getVisibleTerminal(0==this.handle),null!=c&&(this.graph.selectCellForEvent(c,b.getEvent()),b.consume()));this.mouseDownY=this.mouseDownX=this.handle=null}; mxEdgeHandler.prototype.reset=function(){this.active&&this.refresh();this.snapPoint=this.mouseDownY=this.mouseDownX=this.startY=this.startX=this.handle=this.points=this.label=this.index=this.error=null;this.active=this.isTarget=this.isSource=this.isLabel=!1;if(this.livePreview&&null!=this.sizers)for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&&(this.sizers[a].node.style.display="");null!=this.marker&&this.marker.reset();null!=this.constraintHandler&&this.constraintHandler.reset();if(null!= this.customHandles){var b=this.customHandles;for(a=0;a<b.length;a++)null!=b[a]&&b[a].reset()}this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(a){null!=this.shape&&(this.shape.stroke=a)}; mxEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate();b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x);a.y=this.roundLength(a.y/c-d.y);b=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));null!=b&&(a.x-=b.origin.x,a.y-=b.origin.y);return a}; mxEdgeHandler.prototype.moveLabel=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a.cell);if(null!=e){var f=this.graph.getView().scale;e=e.clone();if(e.relative){var g=this.graph.getView().getRelativePoint(a,b,c);e.x=Math.round(1E4*g.x)/1E4;e.y=Math.round(g.y);e.offset=new mxPoint(0,0);g=this.graph.view.getPoint(a,e);e.offset=new mxPoint(Math.round((b-g.x)/f),Math.round((c-g.y)/f))}else{var k=a.absolutePoints;g=k[0];k=k[k.length-1];null!=g&&null!=k&&(e.offset=new mxPoint(Math.round((b- (g.x+(k.x-g.x)/2))/f),Math.round((c-(g.y+(k.y-g.y)/2))/f)),e.x=0,e.y=0)}d.setGeometry(a.cell,e)}};mxEdgeHandler.prototype.connect=function(a,b,c,d,e){d=this.graph.getModel();d.beginUpdate();try{var f=null!=this.constraintHandler?this.constraintHandler.currentConstraint:null;null==f&&(f=new mxConnectionConstraint);this.graph.connectCell(a,b,c,f)}finally{d.endUpdate()}return a}; mxEdgeHandler.prototype.changeTerminalPoint=function(a,b,c,d){var e=this.graph.getModel();e.beginUpdate();try{if(d){var f=e.getParent(a),g=e.getTerminal(a,!c);a=this.graph.cloneCell(a);e.add(f,a,e.getChildCount(f));e.setTerminal(a,g,!c)}var k=e.getGeometry(a);null!=k&&(k=k.clone(),k.setTerminalPoint(b,c),e.setGeometry(a,k),this.graph.connectCell(a,null,c,new mxConnectionConstraint))}finally{e.endUpdate()}return a}; mxEdgeHandler.prototype.changePoints=function(a,b,c){var d=this.graph.getModel();d.beginUpdate();try{if(c){var e=d.getParent(a),f=d.getTerminal(a,!0),g=d.getTerminal(a,!1);a=this.graph.cloneCell(a);d.add(e,a,d.getChildCount(e));d.setTerminal(a,f,!0);d.setTerminal(a,g,!1)}var k=d.getGeometry(a);null!=k&&(k=k.clone(),k.points=b,d.setGeometry(a,k))}finally{d.endUpdate()}return a}; mxEdgeHandler.prototype.addPoint=function(a,b){var c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),d=this.graph.isGridEnabledEvent(b);this.convertPoint(c,d);this.addPointAt(a,c.x,c.y);mxEvent.consume(b)}; mxEdgeHandler.prototype.addPointAt=function(a,b,c){var d=this.graph.getCellGeometry(a.cell);b=new mxPoint(b,c);if(null!=d){d=d.clone();var e=this.graph.view.translate;c=this.graph.view.scale;e=new mxPoint(e.x*c,e.y*c);var f=this.graph.model.getParent(this.state.cell);this.graph.model.isVertex(f)&&(e=this.graph.view.getState(f),e=new mxPoint(e.x,e.y));c=mxUtils.findNearestSegment(a,b.x*c+e.x,b.y*c+e.y);null==d.points?d.points=[b]:d.points.splice(c,0,b);this.graph.getModel().setGeometry(a.cell,d);this.refresh(); this.redraw()}};mxEdgeHandler.prototype.removePoint=function(a,b){if(0<b&&b<this.abspoints.length-1){var c=this.graph.getCellGeometry(this.state.cell);null!=c&&null!=c.points&&(c=c.clone(),c.points.splice(b-1,1),this.graph.getModel().setGeometry(a.cell,c),this.refresh(),this.redraw())}}; mxEdgeHandler.prototype.getHandleFillColor=function(a){a=0==a;var b=this.state.cell,c=this.graph.getModel().getTerminal(b,a),d=mxConstants.HANDLE_FILLCOLOR;null!=c&&!this.graph.isCellDisconnectable(b,c,a)||null==c&&!this.graph.isTerminalPointMovable(b,a)?d=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=c&&this.graph.isCellDisconnectable(b,c,a)&&(d=mxConstants.CONNECT_HANDLE_FILLCOLOR);return d}; mxEdgeHandler.prototype.redraw=function(a){if(null!=this.state&&null!=this.state.absolutePoints){this.abspoints=this.state.absolutePoints.slice();var b=this.graph.getModel().getGeometry(this.state.cell);if(null!=b&&(b=b.points,null!=this.bends&&0<this.bends.length&&null!=b)){null==this.points&&(this.points=[]);for(var c=1;c<this.bends.length-1;c++)null!=this.bends[c]&&null!=this.abspoints[c]&&(this.points[c-1]=b[c-1])}this.drawPreview();a||this.redrawHandles()}}; mxEdgeHandler.prototype.isTerminalHandleVisible=function(a){return!0}; mxEdgeHandler.prototype.redrawHandles=function(){var a=this.state.cell;if(null!=this.labelShape){var b=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-b.width/2),Math.round(this.label.y-b.height/2),b.width,b.height);b=this.graph.getLabel(a);this.labelShape.visible=null!=b&&0<b.length&&this.graph.isCellEditable(this.state.cell)&&this.graph.isLabelMovable(a)&&this.isHandlesVisible()}if(null!= this.abspoints&&null!=this.bends&&0<this.bends.length){var c=this.abspoints.length-1;a=this.abspoints[0];var d=a.x,e=a.y;b=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);this.bends[0].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!0)?"":"hidden";c=this.abspoints[c]; d=c.x;e=c.y;var f=this.bends.length-1;b=this.bends[f].bounds;this.bends[f].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[f].fill=this.getHandleFillColor(f);this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.bends[f].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!1)?"":"hidden";this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(c= this.abspoints[0],a=0;a<this.virtualBends.length;a++)null!=this.virtualBends[a]&&null!=this.abspoints[a+1]&&(d=this.abspoints[a+1],b=this.virtualBends[a],b.bounds=new mxRectangle(Math.floor(c.x+(d.x-c.x)/2-b.bounds.width/2),Math.floor(c.y+(d.y-c.y)/2-b.bounds.height/2),b.bounds.width,b.bounds.height),b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),c=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds),b.node.style.visibility=this.isHandlesVisible()?"":"hidden");null!=this.labelShape&& this.labelShape.redraw();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)b=this.customHandles[a].shape.node.style.display,this.customHandles[a].redraw(),this.customHandles[a].shape.node.style.display=b,this.customHandles[a].shape.node.style.visibility=!this.graph.isEditing()&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[a])?"":"hidden"};mxEdgeHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()}; mxEdgeHandler.prototype.setHandlesVisible=function(a){if(null!=this.bends)for(var b=0;b<this.bends.length;b++)null!=this.bends[b]&&(this.bends[b].node.style.display=a?"":"none");if(null!=this.virtualBends)for(b=0;b<this.virtualBends.length;b++)null!=this.virtualBends[b]&&(this.virtualBends[b].node.style.display=a?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=a?"":"none");if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)}; mxEdgeHandler.prototype.setInnerBendsOpacity=function(a,b,c){var d=this.graph.getCellGeometry(this.state.cell);if(null!=d&&(null==d.points||0==d.points.length))for(;b<c;b++)null!=a[b]&&mxUtils.setOpacity(a[b].node,this.virtualBendOpacity)}; mxEdgeHandler.prototype.redrawInnerBends=function(a,b){for(a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){b=this.abspoints[a].x;var c=this.abspoints[a].y,d=this.bends[a].bounds;this.bends[a].bounds=new mxRectangle(Math.round(b-d.width/2),Math.round(c-d.height/2),d.width,d.height);this.manageLabelHandle?this.checkLabelHandle(this.bends[a].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[a].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+ 3,h=mxConstants.HANDLE_SIZE+3,this.bends[a].bounds=new mxRectangle(Math.round(b-w/2),Math.round(c-h/2),w,h));this.bends[a].redraw();this.bends[a].node.style.visibility=this.isHandlesVisible()?"":"hidden"}else this.bends[a].destroy(),this.bends[a]=null};mxEdgeHandler.prototype.checkLabelHandle=function(a){if(null!=this.labelShape){var b=this.labelShape.bounds;mxUtils.intersects(a,b)&&(a.getCenterY()<b.getCenterY()?b.y=a.y+a.height:b.y=a.y-b.height)}}; mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var a=this.labelShape.bounds,b=new mxRectangle(Math.round(this.label.x-a.width/2),Math.round(this.label.y-a.height/2),a.width,a.height);this.labelShape.bounds.equals(b)||(this.labelShape.bounds=b,this.labelShape.redraw())}null==this.shape||mxUtils.equalPoints(this.shape.points,this.abspoints)||(this.shape.apply(this.state),this.shape.points=this.abspoints.slice(),this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(), this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw());this.updateParentHighlight()}catch(c){}};mxEdgeHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)}; mxEdgeHandler.prototype.refresh=function(){if(null!=this.state){var a=this.state.getVisibleTerminalState(!0),b=this.state.getVisibleTerminalState(!1),c=this.graph.getCellGeometry(this.state.cell);this.edgeStyle=null!=c?this.graph.view.getEdgeStyle(this.state,c.points,a,b):null;this.abspoints=this.getSelectionPoints(this.state);this.points=[];null!=this.shape&&(this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.isShadow=!1,this.shape.redraw());null!= this.bends&&(this.destroyBends(this.bends),this.bends=null);this.isHandlesVisible()&&(this.bends=this.createBends());null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=null);this.isHandlesVisible()&&this.edgeStyle!=mxEdgeStyle.EntityRelation&&(this.virtualBends=this.createVirtualBends());null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=null);this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles());null!=this.labelShape&& (this.labelShape.destroy(),this.labelShape=null);this.isHandlesVisible()&&(this.labelShape=this.createLabelShape(),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))}};mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape};mxEdgeHandler.prototype.destroyBends=function(a){if(null!=a)for(var b=0;b<a.length;b++)null!=a[b]&&a[b].destroy()}; mxEdgeHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.destroyBends(this.virtualBends); this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};function mxElbowEdgeHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=!0;mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":""; mxElbowEdgeHandler.prototype.createBends=function(){var a=[],b=this.createHandleShape(0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);a.push(this.createVirtualBend(mxUtils.bind(this,function(c){!mxEvent.isConsumed(c)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,c),mxEvent.consume(c))})));this.points.push(new mxPoint(0,0));b=this.createHandleShape(2,null,!0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);return a}; mxElbowEdgeHandler.prototype.createVirtualBends=function(){return null};mxElbowEdgeHandler.prototype.createVirtualBend=function(a){var b=this.createHandleShape();this.initBend(b,a);b.setCursor(this.getCursorForBend());this.graph.isCellBendable(this.state.cell)||(b.node.style.display="none");return b}; mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"}; mxElbowEdgeHandler.prototype.getTooltipForNode=function(a){var b=null;null==this.bends||null==this.bends[1]||a!=this.bends[1].node&&a.parentNode!=this.bends[1].node||(b=this.doubleClickOrientationResource,b=mxResources.get(b)||b);return b}; mxElbowEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate(),e=this.state.origin;b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x-e.x);a.y=this.roundLength(a.y/c-d.y-e.y);return a}; mxElbowEdgeHandler.prototype.redrawInnerBends=function(a,b){var c=this.graph.getModel().getGeometry(this.state.cell),d=this.state.absolutePoints,e=null;1<d.length?(a=d[1],b=d[d.length-2]):null!=c.points&&0<c.points.length&&(e=d[0]);e=null==e?new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2):new mxPoint(this.graph.getView().scale*(e.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(e.y+this.graph.getView().translate.y+this.state.origin.y));b=this.bends[1].bounds;a=b.width; b=b.height;a=new mxRectangle(Math.round(e.x-a/2),Math.round(e.y-b/2),a,b);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(a=mxConstants.HANDLE_SIZE+3,b=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(e.x-a/2),Math.floor(e.y-b/2),a,b));this.bends[1].bounds=a;this.bends[1].redraw();this.setInnerBendsOpacity(this.bends,1,2);this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)}; function mxEdgeSegmentHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler); mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var a=this.state.absolutePoints;if(null!=a){var b=Math.max(1,this.graph.view.scale);if(2==a.length||3==a.length&&(Math.abs(a[0].x-a[1].x)<b&&Math.abs(a[1].x-a[2].x)<b||Math.abs(a[0].y-a[1].y)<b&&Math.abs(a[1].y-a[2].y)<b)){b=a[0].x+(a[a.length-1].x-a[0].x)/2;var c=a[0].y+(a[a.length-1].y-a[0].y)/2;a=[a[0],new mxPoint(b,c),new mxPoint(b,c),a[a.length-1]]}}return a}; mxEdgeSegmentHandler.prototype.getPreviewPoints=function(a){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var b=this.getCurrentPoints(),c=this.convertPoint(b[0].clone(),!1);a=this.convertPoint(a.clone(),!1);for(var d=[],e=1;e<b.length;e++){var f=this.convertPoint(b[e].clone(),!1);e==this.index&&(1>Math.abs(c.x-f.x)&&(c.x=a.x,f.x=a.x),1>Math.abs(c.y-f.y)&&(c.y=a.y,f.y=a.y));e<b.length-1&&d.push(f);c=f}if(1==d.length){b=this.state.getVisibleTerminalState(!0); c=this.state.getVisibleTerminalState(!1);f=this.state.view.getScale();var g=this.state.view.getTranslate();e=d[0].x*f+g.x;f=d[0].y*f+g.y;if(null!=b&&mxUtils.contains(b,e,f)||null!=c&&mxUtils.contains(c,e,f))d=[a,a]}return d}; mxEdgeSegmentHandler.prototype.updatePreviewState=function(a,b,c,d){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){b=this.convertPoint(b.clone(),!1);for(var e=a.absolutePoints,f=e[0],g=e[1],k=[],l=2;l<e.length;l++){var m=e[l];0==Math.round(f.x-g.x)&&0==Math.round(g.x-m.x)||0==Math.round(f.y-g.y)&&0==Math.round(g.y-m.y)||k.push(this.convertPoint(g.clone(),!1));f=g;g=m}f=this.state.getVisibleTerminalState(!0);g=this.state.getVisibleTerminalState(!1); l=this.state.absolutePoints;if(0==k.length&&(0==Math.round(e[0].x-e[e.length-1].x)||0==Math.round(e[0].y-e[e.length-1].y)))k=[b,b];else if(5==e.length&&2==k.length&&null!=f&&null!=g&&null!=l&&0==Math.round(l[0].x-l[l.length-1].x)){k=this.graph.getView();l=k.getScale();m=k.getTranslate();e=k.getRoutingCenterY(f)/l-m.y;var n=this.graph.getConnectionConstraint(a,f,!0);null!=n&&(n=this.graph.getConnectionPoint(f,n),null!=n&&(this.convertPoint(n,!1),e=n.y));k=k.getRoutingCenterY(g)/l-m.y;if(l=this.graph.getConnectionConstraint(a, g,!1))n=this.graph.getConnectionPoint(g,l),null!=n&&(this.convertPoint(n,!1),k=n.y);k=[new mxPoint(b.x,e),new mxPoint(b.x,k)]}this.points=k;a.view.updateFixedTerminalPoints(a,f,g);a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)}}; mxEdgeSegmentHandler.prototype.connect=function(a,b,c,d,e){var f=this.graph.getModel(),g=f.getGeometry(a),k=null;if(null!=g&&null!=g.points&&0<g.points.length){var l=this.abspoints,m=l[0],n=l[1];k=[];for(var p=2;p<l.length;p++){var q=l[p];0==Math.round(m.x-n.x)&&0==Math.round(n.x-q.x)||0==Math.round(m.y-n.y)&&0==Math.round(n.y-q.y)||k.push(this.convertPoint(n.clone(),!1));m=n;n=q}}f.beginUpdate();try{null!=k&&(g=f.getGeometry(a),null!=g&&(g=g.clone(),g.points=k,f.setGeometry(a,g))),a=mxEdgeHandler.prototype.connect.apply(this, arguments)}finally{f.endUpdate()}return a};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(a){return null};mxEdgeSegmentHandler.prototype.start=function(a,b,c){mxEdgeHandler.prototype.start.apply(this,arguments);null==this.bends||null==this.bends[c]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[c].node,100)}; mxEdgeSegmentHandler.prototype.createBends=function(){var a=[],b=this.getCurrentPoints();if(null!=b){var c=this.createHandleShape(0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c);if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var d=0;d<b.length-1;d++){c=this.createVirtualBend();a.push(c);var e=0==Math.round(b[d].x-b[d+1].x);0==Math.round(b[d].y-b[d+1].y)&&d<b.length-2&&(e=0==Math.round(b[d].x-b[d+2].x));c.setCursor(e?"col-resize": "row-resize");this.points.push(new mxPoint(0,0))}}c=this.createHandleShape(b.length,null,!0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c)}return a};mxEdgeSegmentHandler.prototype.createVirtualBends=function(){return null}; mxEdgeSegmentHandler.prototype.redrawInnerBends=function(a,b){if(this.graph.isCellBendable(this.state.cell)){var c=this.getCurrentPoints();if(null!=c&&1<c.length){var d=!1;if(4==c.length&&0==Math.round(c[1].x-c[2].x)&&0==Math.round(c[1].y-c[2].y))if(d=!0,0==Math.round(c[0].y-c[c.length-1].y)){var e=c[0].x+(c[c.length-1].x-c[0].x)/2;c[1]=new mxPoint(e,c[1].y);c[2]=new mxPoint(e,c[2].y)}else e=c[0].y+(c[c.length-1].y-c[0].y)/2,c[1]=new mxPoint(c[1].x,e),c[2]=new mxPoint(c[2].x,e);for(e=0;e<c.length- 1;e++)null!=this.bends[e+1]&&(a=c[e],b=c[e+1],a=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2),b=this.bends[e+1].bounds,this.bends[e+1].bounds=new mxRectangle(Math.floor(a.x-b.width/2),Math.floor(a.y-b.height/2),b.width,b.height),this.bends[e+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[e+1].bounds));d?(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity)):this.setInnerBendsOpacity(this.bends,1,c.length)}}}; function mxKeyHandler(a,b){null!=a&&(this.graph=a,this.target=b||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(c){this.keyDown(c)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler))}mxKeyHandler.prototype.graph=null;mxKeyHandler.prototype.target=null;mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null; mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.enabled=!0;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};mxKeyHandler.prototype.setEnabled=function(a){this.enabled=a};mxKeyHandler.prototype.bindKey=function(a,b){this.normalKeys[a]=b};mxKeyHandler.prototype.bindShiftKey=function(a,b){this.shiftKeys[a]=b};mxKeyHandler.prototype.bindControlKey=function(a,b){this.controlKeys[a]=b}; mxKeyHandler.prototype.bindControlShiftKey=function(a,b){this.controlShiftKeys[a]=b};mxKeyHandler.prototype.isControlDown=function(a){return mxEvent.isControlDown(a)};mxKeyHandler.prototype.getFunction=function(a){return null==a||mxEvent.isAltDown(a)?null:this.isControlDown(a)?mxEvent.isShiftDown(a)?this.controlShiftKeys[a.keyCode]:this.controlKeys[a.keyCode]:mxEvent.isShiftDown(a)?this.shiftKeys[a.keyCode]:this.normalKeys[a.keyCode]}; mxKeyHandler.prototype.isGraphEvent=function(a){var b=mxEvent.getSource(a);return b==this.target||b.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(a)?!0:mxUtils.isAncestorNode(this.graph.container,b)};mxKeyHandler.prototype.keyDown=function(a){if(this.isEnabledForEvent(a))if(27==a.keyCode)this.escape(a);else if(!this.isEventIgnored(a)){var b=this.getFunction(a);null!=b&&(b(a),mxEvent.consume(a))}}; mxKeyHandler.prototype.isEnabledForEvent=function(a){return this.graph.isEnabled()&&!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(a){return this.graph.isEditing()};mxKeyHandler.prototype.escape=function(a){this.graph.isEscapeEnabled()&&this.graph.escape(a)}; mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null);this.target=null};function mxTooltipHandler(a,b){null!=a&&(this.graph=a,this.delay=b||500,this.graph.addMouseListener(this))}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=!0; mxTooltipHandler.prototype.hideOnHover=!1;mxTooltipHandler.prototype.destroyed=!1;mxTooltipHandler.prototype.enabled=!1;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(a){this.enabled=a};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(a){this.hideOnHover=a}; mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){"A"!=mxEvent.getSource(a).nodeName&&this.hideTooltip()})))};mxTooltipHandler.prototype.getStateForEvent=function(a){return a.getState()};mxTooltipHandler.prototype.mouseDown=function(a,b){this.reset(b,!1);this.hideTooltip()}; mxTooltipHandler.prototype.mouseMove=function(a,b){if(b.getX()!=this.lastX||b.getY()!=this.lastY)this.reset(b,!0),a=this.getStateForEvent(b),(this.isHideOnHover()||a!=this.state||b.getSource()!=this.node&&(!this.stateSource||null!=a&&this.stateSource==(b.isSource(a.shape)||!b.isSource(a.text))))&&this.hideTooltip();this.lastX=b.getX();this.lastY=b.getY()};mxTooltipHandler.prototype.mouseUp=function(a,b){this.reset(b,!0);this.hideTooltip()}; mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)}; mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||a.isSource(c.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var k= this.graph.getTooltip(c,d,e,f);this.show(k,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerText="")}; mxTooltipHandler.prototype.show=function(a,b,c){if(!this.destroyed&&null!=a&&0<a.length){null==this.div&&this.init();var d=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=b+d.x+"px";this.div.style.top=c+mxConstants.TOOLTIP_VERTICAL_OFFSET+d.y+"px";mxUtils.isNode(a)?(this.div.style.whiteSpace="",this.div.innerText="",this.div.appendChild(a)):(this.div.style.whiteSpace="pre-line",this.div.innerHTML=a);this.div.style.visibility="";mxUtils.fit(this.div)}}; mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)};function mxCellTracker(a,b,c){mxCellMarker.call(this,a,b);this.graph.addMouseListener(this);null!=c&&(this.getCell=c)}mxUtils.extend(mxCellTracker,mxCellMarker);mxCellTracker.prototype.mouseDown=function(a,b){}; mxCellTracker.prototype.mouseMove=function(a,b){this.isEnabled()&&this.process(b)};mxCellTracker.prototype.mouseUp=function(a,b){};mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))}; function mxCellHighlight(a,b,c,d){null!=a&&(this.graph=a,this.highlightColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=c?c:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=d?d:!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var e=this.graph.view.getState(this.state.cell);null==e?this.hide():(this.state=e,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE, this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null; mxCellHighlight.prototype.spacing=0;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(a){this.highlightColor=a;null!=this.shape&&(this.shape.stroke=a)};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)}; mxCellHighlight.prototype.createShape=function(){var a=this.graph.cellRenderer.createShape(this.state);a.svgStrokeTolerance=this.graph.tolerance;a.points=this.state.absolutePoints;a.apply(this.state);a.stroke=this.highlightColor;a.opacity=this.opacity;a.isDashed=this.dashed;a.isShadow=!1;a.dialect=mxConstants.DIALECT_SVG;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,this.state);this.graph.dialect!=mxConstants.DIALECT_SVG?a.pointerEvents=!1:a.svgPointerEvents= "stroke";return a};mxCellHighlight.prototype.getStrokeWidth=function(a){return this.strokeWidth}; mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]|| "0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),this.shape.redraw())};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(a){this.state!=a&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=a,null!=this.state&&this.drawHighlight())}; mxCellHighlight.prototype.isHighlightAt=function(a,b){var c=!1;if(null!=this.shape&&null!=document.elementFromPoint)for(a=document.elementFromPoint(a,b);null!=a;){if(a==this.shape.node){c=!0;break}a=a.parentNode}return c};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);null!=this.shape&&(this.shape.destroy(),this.shape=null)}; var mxCodecRegistry={codecs:Object.create(null),aliases:Object.create(null),register:function(a){if(null!=a){var b=a.getName();mxCodecRegistry.codecs[b]=a;var c=mxUtils.getFunctionName(a.template.constructor);c!=b&&mxCodecRegistry.addAlias(c,b)}return a},addAlias:function(a,b){mxCodecRegistry.aliases[a]=b},getCodec:function(a){var b=null;if(null!=a){b=mxUtils.getFunctionName(a);var c=mxCodecRegistry.aliases[b];null!=c&&(b=c);b=mxCodecRegistry.codecs[b];if(null==b)try{b=new mxObjectCodec(new a),mxCodecRegistry.register(b)}catch(d){}}return b}}; function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.duplicates=Object.create(null);this.objects=Object.create(null)}mxCodec.allowlist=null;mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.duplicates=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.putObject=function(a,b){return null!=this.duplicates[a]?(null!=window.console&&console.error(this.duplicates[a]),b):this.objects[a]=b}; mxCodec.prototype.getObject=function(a){var b=null;null!=a&&(b=this.objects[a],null==b&&(b=this.lookup(a),null==b&&(a=this.getElementById(a),null!=a&&(b=this.decode(a)))));return b};mxCodec.prototype.lookup=function(a){return null};mxCodec.prototype.getElementById=function(a){this.updateElements();return this.elements[a]};mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=Object.create(null),null!=this.document.documentElement&&this.addElement(this.document.documentElement))}; mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var b=a.getAttribute("id");null!=b&&(null==this.elements[b]?this.elements[b]=a:this.elements[b]!=a&&(this.duplicates[b]="Duplicate ID '"+b+"'",null!=window.console&&console.error("mxCodec.addElement: "+this.duplicates[b])))}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling};mxCodec.prototype.isObjectIgnored=function(a){return null==a}; mxCodec.prototype.getId=function(a){var b=null;null==a||this.isObjectIgnored(a)||(b=this.reference(a),null==b&&a instanceof mxCell&&(b=a.getId(),null==b&&(b=mxCellPath.create(a),0==b.length&&(b="root"))));return b};mxCodec.prototype.reference=function(a){return null}; mxCodec.prototype.encode=function(a){var b=null;if(null!=a&&null!=a.constructor&&!this.isObjectIgnored(a)){var c=mxCodecRegistry.getCodec(a.constructor);null!=c?b=c.encode(this,a):mxUtils.isNode(a)?b=mxUtils.importNode(this.document,a,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return b}; mxCodec.prototype.decode=function(a,b){this.updateElements();var c=null;null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT&&(c=this.getConstructor(a.nodeName),c=mxCodecRegistry.getCodec(c),null!=c?c=c.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as")));return c};mxCodec.prototype.isConstructorAllowed=function(a){return null==mxCodec.allowlist||0<=mxUtils.indexOf(mxCodec.allowlist,a)};mxCodec.prototype.getConstructor=function(a){var b=null;try{this.isConstructorAllowed(a)&&(b=window[a])}catch(c){}return b}; mxCodec.prototype.encodeCell=function(a,b,c){if(!this.isObjectIgnored(a)){var d=this.encode(a);null!=d&&b.appendChild(d);if(null==c||c)for(c=a.getChildCount(),d=0;d<c;d++)this.encodeCell(a.getChildAt(d),b)}};mxCodec.prototype.isCellCodec=function(a){return null!=a&&"function"==typeof a.isCellCodec?a.isCellCodec():!1}; mxCodec.prototype.decodeCell=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=mxCodecRegistry.getCodec(a.nodeName);if(!this.isCellCodec(c))for(var d=a.firstChild;null!=d&&!this.isCellCodec(c);)c=mxCodecRegistry.getCodec(d.nodeName),d=d.nextSibling;this.isCellCodec(c)||(c=mxCodecRegistry.getCodec(mxCell));c=c.decode(this,a);b&&this.insertIntoGraph(c)}return c}; mxCodec.prototype.insertIntoGraph=function(a){var b=a.parent,c=a.getTerminal(!0),d=a.getTerminal(!1);a.setTerminal(null,!1);a.setTerminal(null,!0);a.parent=null;if(null!=b){if(b==a)throw Error(b.id+": Self Reference");b.insert(a)}null!=c&&c.insertEdge(a,!0);null!=d&&d.insertEdge(a,!1)};mxCodec.prototype.setAttribute=function(a,b,c){null!=b&&null!=c&&a.setAttribute(b,c)}; function mxObjectCodec(a,b,c,d){this.template=a;this.exclude=null!=b?b:[];this.idrefs=null!=c?c:[];this.mapping=null!=d?d:{};this.reverse={};for(var e in this.mapping)this.reverse[this.mapping[e]]=e}mxObjectCodec.allowEval=!1;mxObjectCodec.isPollutionKey=function(a){return"__proto__"==a||"constructor"==a||"prototype"==a};mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null; mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(a){if(null!=a){var b=this.reverse[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.getAttributeName=function(a){if(null!=a){var b=this.mapping[a];null!=b&&(a=b)}return a}; mxObjectCodec.prototype.isExcluded=function(a,b,c,d){return b==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,b)};mxObjectCodec.prototype.isReference=function(a,b,c,d){return 0<=mxUtils.indexOf(this.idrefs,b)};mxObjectCodec.prototype.encode=function(a,b){var c=a.document.createElement(this.getName());b=this.beforeEncode(a,b,c);this.encodeObject(a,b,c);return this.afterEncode(a,b,c)}; mxObjectCodec.prototype.encodeObject=function(a,b,c){a.setAttribute(c,"id",a.getId(b));var d=[],e;for(e in b){var f=e,g=b[f];null==g||this.isExcluded(b,f,g,!0)||(mxUtils.isInteger(f)?this.encodeValue(a,b,null,g,c):d.push({name:f,value:g}))}d.sort(function(k,l){return k.name<l.name?-1:k.name>l.name?1:0});for(e=0;e<d.length;e++)this.encodeValue(a,b,d[e].name,d[e].value,c)}; mxObjectCodec.prototype.encodeValue=function(a,b,c,d,e){if(null!=d){if(this.isReference(b,c,d,!0)){var f=a.getId(d);if(null==f){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+c+"="+d);return}d=f}f=this.template[c];if(null==c||a.encodeDefaults||f!=d)c=this.getAttributeName(c),this.writeAttribute(a,b,c,d,e)}};mxObjectCodec.prototype.writeAttribute=function(a,b,c,d,e){"object"!=typeof d?this.writePrimitiveAttribute(a,b,c,d,e):this.writeComplexAttribute(a,b,c,d,e)}; mxObjectCodec.prototype.writePrimitiveAttribute=function(a,b,c,d,e){d=this.convertAttributeToXml(a,b,c,d,e);null==c?(b=a.document.createElement("add"),"function"==typeof d?b.appendChild(a.document.createTextNode(d)):a.setAttribute(b,"value",d),e.appendChild(b)):"function"!=typeof d&&a.setAttribute(e,c,d)}; mxObjectCodec.prototype.writeComplexAttribute=function(a,b,c,d,e){a=a.encode(d);null!=a?(null!=c&&a.setAttribute("as",c),e.appendChild(a)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+c+": "+d)};mxObjectCodec.prototype.convertAttributeToXml=function(a,b,c,d){this.isBooleanAttribute(a,b,c,d)&&(d=1==d?"1":"0");return d};mxObjectCodec.prototype.isBooleanAttribute=function(a,b,c,d){return"undefined"==typeof d.length&&(1==d||0==d)}; mxObjectCodec.prototype.convertAttributeFromXml=function(a,b,c){var d=b.value;this.isNumericAttribute(a,b,c)&&(d=parseFloat(d),isNaN(d)||!isFinite(d))&&(d=0);return d};mxObjectCodec.prototype.isNumericAttribute=function(a,b,c){return c.constructor==mxGeometry&&("x"==b.name||"y"==b.name||"width"==b.name||"height"==b.name)||c.constructor==mxPoint&&("x"==b.name||"y"==b.name)||mxUtils.isNumeric(b.value)};mxObjectCodec.prototype.beforeEncode=function(a,b,c){return b}; mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.prototype.decode=function(a,b,c){var d=b.getAttribute("id"),e=a.objects[d];null==e&&(e=c||this.cloneTemplate(),null!=d&&a.putObject(d,e));b=this.beforeDecode(a,b,e);this.decodeNode(a,b,e);return this.afterDecode(a,b,e)};mxObjectCodec.prototype.decodeNode=function(a,b,c){null!=b&&(this.decodeAttributes(a,b,c),this.decodeChildren(a,b,c))}; mxObjectCodec.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){null!=window.console&&console.error(f.message+" "+b.nodeName+(null!=d?" as "+d:""))}}}; mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){if(mxObjectCodec.isPollutionKey(b))return null;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&&!mxObjectCodec.isPollutionKey(b))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= d;d=mxUtils.importNode(b.document,c.value,!0);d.appendChild(e);b=e.getAttribute("id");d.setAttribute("id",b);e.removeAttribute("id")}return d};a.beforeDecode=function(b,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!=c&&(d.setId(c),d.value.removeAttribute("id"))):d.setId(c.getAttribute("id")); if(null!=e)for(c=0;c<this.idrefs.length;c++){f=this.idrefs[c];var g=e.getAttribute(f);if(null!=g){e.removeAttribute(f);var k=b.objects[g]||b.lookup(g);if(null==k){var l=b.getElementById(g);null!=l?k=(mxCodecRegistry.codecs[l.nodeName]||this).decode(b,l):null!=window.console&&console.error("mxCellCodec.beforeDecode: "+this.idrefs[c]+" "+g+" not found for cell "+d.getId())}d[f]=k}}return e};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphModel);a.enableStyleCompression=!1;a.encodeObject=function(b,c,d){var e=b.document.createElement("root");b.encodeCell(c.getRoot(),e);d.appendChild(e);this.enableStyleCompression&&(b=this.encodeResources(b,e,b.document.createElement("defs")),0<b.childNodes.length&&e.parentNode.insertBefore(b,e))};a.encodeResources=function(b,c,d){c=c.getElementsByTagName("mxCell");for(var e={},f=0;f<c.length;f++)this.compressCellStyle(b,d,e,c[f]); return d};a.compressCellStyle=function(b,c,d,e){var f=e.getAttribute("style");if(null!=f&&(-1!==f.indexOf("=data:")||-1!==f.indexOf("=stencil("))){var g=f.split(";");for(f=0;f<g.length;f++){var k=g[f].split("=");1<k.length&&("image"===k[0]&&k[1].startsWith("data:image/")||"shape"===k[0]&&k[1].startsWith("stencil("))&&mxUtils.bind(this,function(l,m){this.addResource(b,c,k[1],d,function(n){e.setAttribute("style",g.slice(0,m).join(";")+(0<m?";":"")+l+"=def("+n+");"+g.slice(m+1).join(";"))})})(k[0],f)}}}; a.addResource=function(b,c,d,e,f){var g=e[d];null!=g?(null==g.id&&(g.id=c.getElementsByTagName("*").length,c.appendChild(g.elt),g.fn(g.id),delete g.elt,delete g.fn),f(g.id)):(b=b.document.createElement("def"),e[d]={elt:b,fn:f,id:null},b.setAttribute("data",d))};a.decodeChild=function(b,c,d){"defs"==c.nodeName?this.decodeResources(b,c,d):"root"==c.nodeName?this.decodeRoot(b,c,d):mxObjectCodec.prototype.decodeChild.apply(this,arguments)};a.decodeResources=function(b,c,d){d=c.parentNode.getElementsByTagName("mxCell"); c=c.getElementsByTagName("def");for(var e=0;e<d.length;e++)this.decompressCellStyle(b,c,d[e])};a.decompressCellStyle=function(b,c,d){b=d.getAttribute("style");if(null!=b&&-1!==b.indexOf("=def(")){b=b.split(";");for(var e=[],f=0;f<b.length;f++){var g=b[f].split("=");if(1<g.length&&g[1].startsWith("def(")&&("image"===g[0]||"shape"===g[0])){var k=g[1].substring(g[1].indexOf("(")+1,g[1].length-1);null!=c[k]?e.push(g[0]+"="+c[k].getAttribute("data")):null!=window.console&&console.error("mxModelCodec.decodeChild: Invalid reference "+ k+" in cell "+d.getAttribute("id"))}else e.push(b[f])}d.setAttribute("style",e.join(";"))}};a.decodeRoot=function(b,c,d){var e=null;for(c=c.firstChild;null!=c;){var f=b.decodeCell(c);null!=f&&null==f.getParent()&&(e=f);c=c.nextSibling}null!=e&&d.setRoot(e)};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxRootChange,["model","previous","root"]);a.afterEncode=function(b,c,d){b.encodeCell(c.root,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.root=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;)d=e.nextSibling,b.decodeCell(e),e.parentNode.removeChild(e),e=d}return c};a.afterDecode=function(b,c, d){d.previous=d.root;return d};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);a.isReference=function(b,c,d,e){return"child"!=c||e&&!b.model.contains(b.previous)?0<=mxUtils.indexOf(this.idrefs,c):!0};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&null!=d&&("previous"==c||"parent"==c)&&!b.model.contains(d)};a.afterEncode=function(b,c,d){this.isReference(c,"child",c.child,!0)?d.setAttribute("child", b.getId(c.child)):b.encodeCell(c.child,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.child=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;){d=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_ELEMENT){var f=e.getAttribute("id");null==b.lookup(f)&&b.decodeCell(e)}e.parentNode.removeChild(e);e=d}}else e=c.getAttribute("child"),d.child=b.getObject(e);return c}; a.afterDecode=function(b,c,d){null!=d.child&&(null!=d.child.parent&&null!=d.previous&&d.child.parent!=d.previous&&(d.previous=d.child.parent),d.child.parent=d.previous,d.previous=d.parent,d.previousIndex=d.index);return d};return a}());mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);a.afterDecode=function(b,c,d){d.previous=d.terminal;return d};return a}()); var mxGenericChangeCodec=function(a,b){a=new mxObjectCodec(a,["model","previous"],["cell"]);a.afterDecode=function(c,d,e){mxUtils.isNode(e.cell)&&(e.cell=c.decodeCell(e.cell,!1));e.previous=e[b];return e};return a};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")); mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphView);a.encode=function(b,c){return this.encodeCell(b,c,c.graph.getModel().getRoot())};a.encodeCell=function(b,c,d){var e=c.graph.getModel(),f=c.getState(d),g=e.getParent(d);if(null==g||null!=f){var k=e.getChildCount(d),l=c.graph.getCellGeometry(d),m=null;g==e.getRoot()?m="layer":null==g?m="graph":e.isEdge(d)?m="edge":0<k&&null!=l?m="group":e.isVertex(d)&&(m="vertex");if(null!=m){var n=b.document.createElement(m);null!=c.graph.getLabel(d)&& (n.setAttribute("label",c.graph.getLabel(d)),c.graph.isHtmlLabel(d)&&n.setAttribute("html",!0));if(null==g){var p=c.getGraphBounds();null!=p&&(n.setAttribute("x",Math.round(p.x)),n.setAttribute("y",Math.round(p.y)),n.setAttribute("width",Math.round(p.width)),n.setAttribute("height",Math.round(p.height)));n.setAttribute("scale",c.scale)}else if(null!=f&&null!=l){for(p in f.style)g=f.style[p],"function"==typeof g&&"object"==typeof g&&(g=mxStyleRegistry.getName(g)),null!=g&&"function"!=typeof g&&"object"!= typeof g&&n.setAttribute(p,g);g=f.absolutePoints;if(null!=g&&0<g.length){l=Math.round(g[0].x)+","+Math.round(g[0].y);for(p=1;p<g.length;p++)l+=" "+Math.round(g[p].x)+","+Math.round(g[p].y);n.setAttribute("points",l)}else n.setAttribute("x",Math.round(f.x)),n.setAttribute("y",Math.round(f.y)),n.setAttribute("width",Math.round(f.width)),n.setAttribute("height",Math.round(f.height));p=f.absoluteOffset;null!=p&&(0!=p.x&&n.setAttribute("dx",Math.round(p.x)),0!=p.y&&n.setAttribute("dy",Math.round(p.y)))}for(p= 0;p<k;p++)f=this.encodeCell(b,c,e.getChildAt(d,p)),null!=f&&n.appendChild(f)}}return n};return a}()); var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxStylesheet);a.encode=function(b,c){var d=b.document.createElement(this.getName()),e;for(e in c.styles){var f=c.styles[e],g=b.document.createElement("add");if(null!=e){g.setAttribute("as",e);for(var k in f){var l=this.getStringValue(k,f[k]);if(null!=l){var m=b.document.createElement("add");m.setAttribute("value",l);m.setAttribute("as",k);g.appendChild(m)}}0<g.childNodes.length&&d.appendChild(g)}}return d};a.getStringValue= function(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.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)}; Editor=function(a,b,d,e,g){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=e||this.createGraph(b,d);this.editable=null!=g?g:!a;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(c,h){this.status=c;this.statusFunction=h;this.fireEvent(new mxEventObject("statusChanged"))}; this.getStatus=function(){return this.status};this.graphChangeListener=function(c,h){c=null!=h?h.getProperty("edit"):null;null!=c&&c.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 a=window;null!=a.opener&&"undefined"!==typeof a.opener.Editor&&!isNaN(a.opener.Editor.pageCounter)&&a.opener!=a;)a=a.opener;null!=a&&(a.Editor.pageCounter++,Editor.pageCounter=a.Editor.pageCounter)}catch(b){}})();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="; Editor.zoomInImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWm0tNDAtNjB2LTgwaC04MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+"; Editor.zoomOutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWk0yODAtNTQwdi04MGgyMDB2ODBIMjgwWiIvPjwvc3ZnPg=="; Editor.fullscreenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtMjAwaDgwdjEyMGgxMjB2ODBIMTIwWm01MjAgMHYtODBoMTIwdi0xMjBoODB2MjAwSDY0MFpNMTIwLTY0MHYtMjAwaDIwMHY4MEgyMDB2MTIwaC04MFptNjQwIDB2LTEyMEg2NDB2LTgwaDIwMHYyMDBoLTgwWiIvPjwvc3ZnPg==";Editor.fullscreenExitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTEyMHYtMTIwSDEyMHYtODBoMjAwdjIwMGgtODBabTQwMCAwdi0yMDBoMjAwdjgwSDcyMHYxMjBoLTgwWk0xMjAtNjQwdi04MGgxMjB2LTEyMGg4MHYyMDBIMTIwWm01MjAgMHYtMjAwaDgwdjEyMGgxMjB2ODBINjQwWiIvPjwvc3ZnPg=="; Editor.zoomFitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTMyMHEtNjYgMC0xMTMtNDd0LTQ3LTExM3EwLTY2IDQ3LTExM3QxMTMtNDdxNjYgMCAxMTMgNDd0NDcgMTEzcTAgNjYtNDcgMTEzdC0xMTMgNDdabTAtODBxMzMgMCA1Ni41LTIzLjVUNTYwLTQ4MHEwLTMzLTIzLjUtNTYuNVQ0ODAtNTYwcS0zMyAwLTU2LjUgMjMuNVQ0MDAtNDgwcTAgMzMgMjMuNSA1Ni41VDQ4MC00MDBabTAtODBaTTIwMC0xMjBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDB2LTE2MGg4MHYxNjBoMTYwdjgwSDIwMFptNDAwIDB2LTgwaDE2MHYtMTYwaDgwdjE2MHEwIDMzLTIzLjUgNTYuNVQ3NjAtMTIwSDYwMFpNMTIwLTYwMHYtMTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTYwdjgwSDIwMHYxNjBoLTgwWm02NDAgMHYtMTYwSDYwMHYtODBoMTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2MTYwaC04MFoiLz48L3N2Zz4="; Editor.layersImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTExOCAxMjAtMzk4bDY2LTUwIDI5NCAyMjggMjk0LTIyOCA2NiA1MC0zNjAgMjgwWm0wLTIwMkwxMjAtNjAwbDM2MC0yODAgMzYwIDI4MC0zNjAgMjgwWm0wLTI4MFptMCAxNzggMjMwLTE3OC0yMzAtMTc4LTIzMCAxNzggMjMwIDE3OFoiLz48L3N2Zz4=";Editor.editImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMGg1N2wzOTEtMzkxLTU3LTU3LTM5MSAzOTF2NTdabS04MCA4MHYtMTcwbDUyOC01MjdxMTItMTEgMjYuNS0xN3QzMC41LTZxMTYgMCAzMSA2dDI2IDE4bDU1IDU2cTEyIDExIDE3LjUgMjZ0NS41IDMwcTAgMTYtNS41IDMwLjVUODE3LTY0N0wyOTAtMTIwSDEyMFptNjQwLTU4NC01Ni01NiA1NiA1NlptLTE0MSA4NS0yOC0yOSA1NyA1Ny0yOS0yOFoiLz48L3N2Zz4="; Editor.duplicateImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI0MHEtMzMgMC01Ni41LTIzLjVUMjgwLTMyMHYtNDgwcTAtMzMgMjMuNS01Ni41VDM2MC04ODBoMzYwcTMzIDAgNTYuNSAyMy41VDgwMC04MDB2NDgwcTAgMzMtMjMuNSA1Ni41VDcyMC0yNDBIMzYwWm0wLTgwaDM2MHYtNDgwSDM2MHY0ODBaTTIwMC04MHEtMzMgMC01Ni41LTIzLjVUMTIwLTE2MHYtNTYwaDgwdjU2MGg0NDB2ODBIMjAwWm0xNjAtMjQwdi00ODAgNDgwWiIvPjwvc3ZnPg=="; Editor.crossImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMiAxOSA2LjQxeiIvPjwvc3ZnPg==";Editor.trashImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHEtMzMgMC01Ni41LTIzLjVUMjAwLTIwMHYtNTIwaC00MHYtODBoMjAwdi00MGgyNDB2NDBoMjAwdjgwaC00MHY1MjBxMCAzMy0yMy41IDU2LjVUNjgwLTEyMEgyODBabTQwMC02MDBIMjgwdjUyMGg0MDB2LTUyMFpNMzYwLTI4MGg4MHYtMzYwaC04MHYzNjBabTE2MCAwaDgwdi0zNjBoLTgwdjM2MFpNMjgwLTcyMHY1MjAtNTIwWiIvPjwvc3ZnPg=="; Editor.hiddenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNS0uNTkgMS4yMi0xLjQyIDIuMjctMi40MSAzLjEybDEuNDEgMS40MWMxLjM5LTEuMjMgMi40OS0yLjc3IDMuMTgtNC41M0MyMS4yNyA3LjExIDE3IDQgMTIgNGMtMS4yNyAwLTIuNDkuMi0zLjY0LjU3bDEuNjUgMS42NUMxMC42NiA2LjA5IDExLjMyIDYgMTIgNnptLTEuMDcgMS4xNEwxMyA5LjIxYy41Ny4yNSAxLjAzLjcxIDEuMjggMS4yOGwyLjA3IDIuMDdjLjA4LS4zNC4xNC0uNy4xNC0xLjA3QzE2LjUgOS4wMSAxNC40OCA3IDEyIDdjLS4zNyAwLS43Mi4wNS0xLjA3LjE0ek0yLjAxIDMuODdsMi42OCAyLjY4QzMuMDYgNy44MyAxLjc3IDkuNTMgMSAxMS41IDIuNzMgMTUuODkgNyAxOSAxMiAxOWMxLjUyIDAgMi45OC0uMjkgNC4zMi0uODJsMy40MiAzLjQyIDEuNDEtMS40MUwzLjQyIDIuNDUgMi4wMSAzLjg3em03LjUgNy41bDIuNjEgMi42MWMtLjA0LjAxLS4wOC4wMi0uMTIuMDItMS4zOCAwLTIuNS0xLjEyLTIuNS0yLjUgMC0uMDUuMDEtLjA4LjAxLS4xM3ptLTMuNC0zLjRsMS43NSAxLjc1Yy0uMjMuNTUtLjM2IDEuMTUtLjM2IDEuNzggMCAyLjQ4IDIuMDIgNC41IDQuNSA0LjUuNjMgMCAxLjIzLS4xMyAxLjc3LS4zNmwuOTguOThjLS44OC4yNC0xLjguMzgtMi43NS4zOC0zLjc5IDAtNy4xNy0yLjEzLTguODItNS41LjctMS40MyAxLjcyLTIuNjEgMi45My0zLjUzeiIvPjwvc3ZnPg=="; Editor.visibleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNUMxOS4xNyAxNC44NyAxNS43OSAxNyAxMiAxN3MtNy4xNy0yLjEzLTguODItNS41QzQuODMgOC4xMyA4LjIxIDYgMTIgNm0wLTJDNyA0IDIuNzMgNy4xMSAxIDExLjUgMi43MyAxNS44OSA3IDE5IDEyIDE5czkuMjctMy4xMSAxMS03LjVDMjEuMjcgNy4xMSAxNyA0IDEyIDR6bTAgNWMxLjM4IDAgMi41IDEuMTIgMi41IDIuNVMxMy4zOCAxNCAxMiAxNHMtMi41LTEuMTItMi41LTIuNVMxMC42MiA5IDEyIDltMC0yYy0yLjQ4IDAtNC41IDIuMDItNC41IDQuNVM5LjUyIDE2IDEyIDE2czQuNS0yLjAyIDQuNS00LjVTMTQuNDggNyAxMiA3eiIvPjwvc3ZnPg=="; Editor.lockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PGcgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBvcGFjaXR5PSIuODciLz48L2c+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2djJINmMtMS4xIDAtMiAuOS0yIDJ2MTBjMCAxLjEuOSAyIDIgMmgxMmMxLjEgMCAyLS45IDItMlYxMGMwLTEuMS0uOS0yLTItMnpNOSA2YzAtMS42NiAxLjM0LTMgMy0zczMgMS4zNCAzIDN2Mkg5VjZ6bTkgMTRINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+"; Editor.unlockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2aDJjMC0xLjY2IDEuMzQtMyAzLTNzMyAxLjM0IDMgM3YySDZjLTEuMSAwLTIgLjktMiAydjEwYzAgMS4xLjkgMiAyIDJoMTJjMS4xIDAgMi0uOSAyLTJWMTBjMC0xLjEtLjktMi0yLTJ6bTAgMTJINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+"; Editor.printImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjQwLTY0MHYtMTIwSDMyMHYxMjBoLTgwdi0yMDBoNDgwdjIwMGgtODBabS00ODAgODBoNjQwLTY0MFptNTYwIDEwMHExNyAwIDI4LjUtMTEuNVQ3NjAtNTAwcTAtMTctMTEuNS0yOC41VDcyMC01NDBxLTE3IDAtMjguNSAxMS41VDY4MC01MDBxMCAxNyAxMS41IDI4LjVUNzIwLTQ2MFptLTgwIDI2MHYtMTYwSDMyMHYxNjBoMzIwWm04MCA4MEgyNDB2LTE2MEg4MHYtMjQwcTAtNTEgMzUtODUuNXQ4NS0zNC41aDU2MHE1MSAwIDg1LjUgMzQuNVQ4ODAtNTIwdjI0MEg3MjB2MTYwWm04MC0yNDB2LTE2MHEwLTE3LTExLjUtMjguNVQ3NjAtNTYwSDIwMHEtMTcgMC0yOC41IDExLjVUMTYwLTUyMHYxNjBoODB2LTgwaDQ4MHY4MGg4MFoiLz48L3N2Zz4="; Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE3LjY1IDYuMzVDMTYuMiA0LjkgMTQuMjEgNCAxMiA0Yy00LjQyIDAtNy45OSAzLjU4LTcuOTkgOHMzLjU3IDggNy45OSA4YzMuNzMgMCA2Ljg0LTIuNTUgNy43My02aC0yLjA4Yy0uODIgMi4zMy0zLjA0IDQtNS42NSA0LTMuMzEgMC02LTIuNjktNi02czIuNjktNiA2LTZjMS42NiAwIDMuMTQuNjkgNC4yMiAxLjc4TDEzIDExaDdWNGwtMi4zNSAyLjM1eiIvPjwvc3ZnPg=="; Editor.backImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTcuNTEgMy44N0wxNS43MyAyLjEgNS44NCAxMmw5LjkgOS45IDEuNzctMS43N0w5LjM4IDEybDguMTMtOC4xM3oiLz48L3N2Zz4=";Editor.closeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTIgMkM2LjQ3IDIgMiA2LjQ3IDIgMTJzNC40NyAxMCAxMCAxMCAxMC00LjQ3IDEwLTEwUzE3LjUzIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTMuNTktMTNMMTIgMTAuNTkgOC40MSA3IDcgOC40MSAxMC41OSAxMiA3IDE1LjU5IDguNDEgMTcgMTIgMTMuNDEgMTUuNTkgMTcgMTcgMTUuNTkgMTMuNDEgMTIgMTcgOC40MXoiLz48L3N2Zz4="; Editor.closeBlackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjZweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjZweCI+PGVsbGlwc2UgY3g9IjEyIiBjeT0iMTIiIHJ4PSI5IiByeT0iOSIgc3Ryb2tlPSJub25lIiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjU5IDhMMTIgMTAuNTkgOS40MSA4IDggOS40MSAxMC41OSAxMiA4IDE0LjU5IDkuNDEgMTYgMTIgMTMuNDEgMTQuNTkgMTYgMTYgMTQuNTkgMTMuNDEgMTIgMTYgOS40MSAxNC41OSA4ek0xMiAyQzYuNDcgMiAyIDYuNDcgMiAxMnM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTBTMTcuNTMgMiAxMiAyem0wIDE4Yy00LjQxIDAtOC0zLjU5LTgtOHMzLjU5LTggOC04IDggMy41OSA4IDgtMy41OSA4LTggOHoiLz48L3N2Zz4="; Editor.minusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEwIDI1LjV2LTNoMjh2M1oiLz48L3N2Zz4=";Editor.plusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==";Editor.addBoxImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMTYwaDE2MHYtODBINTIwdi0xNjBoLTgwdjE2MEgyODB2ODBoMTYwdjE2MFpNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTAtNTYwdjU2MC01NjBaIi8+PC9zdmc+"; Editor.shapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjAwLTM2MFpNMzIwLTI0MnExMCAxIDE5LjUgMS41dDIwLjUuNXExMSAwIDIwLjUtLjVUNDAwLTI0MnY4Mmg0MDB2LTQwMGgtODJxMS0xMCAxLjUtMTkuNXQuNS0yMC41cTAtMTEtLjUtMjAuNVQ3MTgtNjQwaDgycTMzIDAgNTYuNSAyMy41VDg4MC01NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDgwMC04MEg0MDBxLTMzIDAtNTYuNS0yMy41VDMyMC0xNjB2LTgyWm00MC03OHEtMTE3IDAtMTk4LjUtODEuNVQ4MC02MDBxMC0xMTcgODEuNS0xOTguNVQzNjAtODgwcTExNyAwIDE5OC41IDgxLjVUNjQwLTYwMHEwIDExNy04MS41IDE5OC41VDM2MC0zMjBabTAtODBxODMgMCAxNDEuNS01OC41VDU2MC02MDBxMC04My01OC41LTE0MS41VDM2MC04MDBxLTgzIDAtMTQxLjUgNTguNVQxNjAtNjAwcTAgODMgNTguNSAxNDEuNVQzNjAtNDAwWm0wLTIwMFoiLz48L3N2Zz4="; Editor.formatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMzUyLTUyMiA4Ni04Ny01Ni01Ny00NCA0NC01Ni01NiA0My00NC00NS00NS04NyA4NyAxNTkgMTU4Wm0zMjggMzI5IDg3LTg3LTQ1LTQ1LTQ0IDQzLTU2LTU2IDQzLTQ0LTU3LTU2LTg2IDg2IDE1OCAxNTlabTI0LTU2NyA1NyA1Ny01Ny01N1pNMjkwLTEyMEgxMjB2LTE3MGwxNzUtMTc1TDgwLTY4MGwyMDAtMjAwIDIxNiAyMTYgMTUxLTE1MnExMi0xMiAyNy0xOHQzMS02cTE2IDAgMzEgNnQyNyAxOGw1MyA1NHExMiAxMiAxOCAyN3Q2IDMxcTAgMTYtNiAzMC41VDgxNi02NDdMNjY1LTQ5NWwyMTUgMjE1TDY4MC04MCA0NjUtMjk1IDI5MC0xMjBabS05MC04MGg1NmwzOTItMzkxLTU3LTU3LTM5MSAzOTJ2NTZabTQyMC00MTktMjktMjkgNTcgNTctMjgtMjhaIi8+PC9zdmc+"; Editor.freehandImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+PHBhdGggZD0iTTQuNSw4YzEuMDQsMCwyLjM0LTEuNSw0LjI1LTEuNWMxLjUyLDAsMi43NSwxLjIzLDIuNzUsMi43NWMwLDIuMDQtMS45OSwzLjE1LTMuOTEsNC4yMkM1LjQyLDE0LjY3LDQsMTUuNTcsNCwxNyBjMCwxLjEsMC45LDIsMiwydjJjLTIuMjEsMC00LTEuNzktNC00YzAtMi43MSwyLjU2LTQuMTQsNC42Mi01LjI4YzEuNDItMC43OSwyLjg4LTEuNiwyLjg4LTIuNDdjMC0wLjQxLTAuMzQtMC43NS0wLjc1LTAuNzUgQzcuNSw4LjUsNi4yNSwxMCw0LjUsMTBDMy4xMiwxMCwyLDguODgsMiw3LjVDMiw1LjQ1LDQuMTcsMi44Myw1LDJsMS40MSwxLjQxQzUuNDEsNC40Miw0LDYuNDMsNCw3LjVDNCw3Ljc4LDQuMjIsOCw0LjUsOHogTTgsMjEgbDMuNzUsMGw4LjA2LTguMDZsLTMuNzUtMy43NUw4LDE3LjI1TDgsMjF6IE0xMCwxOC4wOGw2LjA2LTYuMDZsMC45MiwwLjkyTDEwLjkyLDE5TDEwLDE5TDEwLDE4LjA4eiBNMjAuMzcsNi4yOSBjLTAuMzktMC4zOS0xLjAyLTAuMzktMS40MSwwbC0xLjgzLDEuODNsMy43NSwzLjc1bDEuODMtMS44M2MwLjM5LTAuMzksMC4zOS0xLjAyLDAtMS40MUwyMC4zNyw2LjI5eiIvPjwvc3ZnPg=="; Editor.undoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTIwMHYtODBoMjg0cTYzIDAgMTA5LjUtNDBUNzIwLTQyMHEwLTYwLTQ2LjUtMTAwVDU2NC01NjBIMzEybDEwNCAxMDQtNTYgNTYtMjAwLTIwMCAyMDAtMjAwIDU2IDU2LTEwNCAxMDRoMjUycTk3IDAgMTY2LjUgNjNUODAwLTQyMHEwIDk0LTY5LjUgMTU3VDU2NC0yMDBIMjgwWiIvPjwvc3ZnPg==";Editor.redoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzk2LTIwMHEtOTcgMC0xNjYuNS02M1QxNjAtNDIwcTAtOTQgNjkuNS0xNTdUMzk2LTY0MGgyNTJMNTQ0LTc0NGw1Ni01NiAyMDAgMjAwLTIwMCAyMDAtNTYtNTYgMTA0LTEwNEgzOTZxLTYzIDAtMTA5LjUgNDBUMjQwLTQyMHEwIDYwIDQ2LjUgMTAwVDM5Ni0yODBoMjg0djgwSDM5NloiLz48L3N2Zz4="; Editor.outlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTE1IDIxLTYtMi4xLTQuNjUgMS44cS0uNS4yLS45MjUtLjExM1EzIDIwLjI3NSAzIDE5Ljc1di0xNHEwLS4zMjUuMTg4LS41NzUuMTg3LS4yNS41MTItLjM3NUw5IDNsNiAyLjEgNC42NS0xLjhxLjUtLjIuOTI1LjExMi40MjUuMzEzLjQyNS44Mzh2MTRxMCAuMzI1LS4xODguNTc1LS4xODcuMjUtLjUxMi4zNzVabS0xLTIuNDVWNi44NWwtNC0xLjR2MTEuN1ptMiAwIDMtMVY1LjdsLTMgMS4xNVpNNSAxOC4zbDMtMS4xNVY1LjQ1bC0zIDFaTTE2IDYuODV2MTEuN1ptLTgtMS40djExLjdaIi8+PC9zdmc+"; Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDEydjdINXYtN0gzdjdjMCAxLjEuOSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMnYtN2gtMnptLTYgLjY3bDIuNTktMi41OEwxNyAxMS41bC01IDUtNS01IDEuNDEtMS40MUwxMSAxMi42N1YzaDJ2OS42N3oiLz48L3N2Zz4=";Editor.compareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTE1Ljg1IDQwLTIuMS0yLjEgNi4wNS02LjA1SDR2LTNoMTUuOGwtNi4wNS02LjA1IDIuMS0yLjEgOS42NSA5LjY1Wm0xNi4zLTEyLjctOS42NS05LjY1TDMyLjE1IDhsMi4xIDIuMS02LjA1IDYuMDVINDR2M0gyOC4ybDYuMDUgNi4wNVoiLz48L3N2Zz4="; Editor.expandMoreImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTEyIDE1LjM3NS02LTYgMS40LTEuNCA0LjYgNC42IDQuNi00LjYgMS40IDEuNFoiLz48L3N2Zz4=";Editor.expandLessImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTcuNCAxNS4zNzUtMS40LTEuNCA2LTYgNiA2LTEuNCAxLjQtNC42LTQuNloiLz48L3N2Zz4=";Editor.gearImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTkuMjUgMjItLjQtMy4ycS0uMzI1LS4xMjUtLjYxMi0uMy0uMjg4LS4xNzUtLjU2My0uMzc1TDQuNyAxOS4zNzVsLTIuNzUtNC43NSAyLjU3NS0xLjk1UTQuNSAxMi41IDQuNSAxMi4zMzd2LS42NzVxMC0uMTYyLjAyNS0uMzM3TDEuOTUgOS4zNzVsMi43NS00Ljc1IDIuOTc1IDEuMjVxLjI3NS0uMi41NzUtLjM3NS4zLS4xNzUuNi0uM2wuNC0zLjJoNS41bC40IDMuMnEuMzI1LjEyNS42MTMuMy4yODcuMTc1LjU2Mi4zNzVsMi45NzUtMS4yNSAyLjc1IDQuNzUtMi41NzUgMS45NXEuMDI1LjE3NS4wMjUuMzM3di42NzVxMCAuMTYzLS4wNS4zMzhsMi41NzUgMS45NS0yLjc1IDQuNzUtMi45NS0xLjI1cS0uMjc1LjItLjU3NS4zNzUtLjMuMTc1LS42LjNsLS40IDMuMlptMi44LTYuNXExLjQ1IDAgMi40NzUtMS4wMjVRMTUuNTUgMTMuNDUgMTUuNTUgMTJxMC0xLjQ1LTEuMDI1LTIuNDc1UTEzLjUgOC41IDEyLjA1IDguNXEtMS40NzUgMC0yLjQ4OCAxLjAyNVE4LjU1IDEwLjU1IDguNTUgMTJxMCAxLjQ1IDEuMDEyIDIuNDc1UTEwLjU3NSAxNS41IDEyLjA1IDE1LjVabTAtMnEtLjYyNSAwLTEuMDYyLS40MzgtLjQzOC0uNDM3LS40MzgtMS4wNjJ0LjQzOC0xLjA2MnEuNDM3LS40MzggMS4wNjItLjQzOHQxLjA2My40MzhxLjQzNy40MzcuNDM3IDEuMDYydC0uNDM3IDEuMDYycS0uNDM4LjQzOC0xLjA2My40MzhaTTEyIDEyWm0tMSA4aDEuOTc1bC4zNS0yLjY1cS43NzUtLjIgMS40MzgtLjU4OC42NjItLjM4NyAxLjIxMi0uOTM3bDIuNDc1IDEuMDI1Ljk3NS0xLjctMi4xNS0xLjYyNXEuMTI1LS4zNS4xNzUtLjczOC4wNS0uMzg3LjA1LS43ODd0LS4wNS0uNzg4cS0uMDUtLjM4Ny0uMTc1LS43MzdsMi4xNS0xLjYyNS0uOTc1LTEuNy0yLjQ3NSAxLjA1cS0uNTUtLjU3NS0xLjIxMi0uOTYzLS42NjMtLjM4Ny0xLjQzOC0uNTg3TDEzIDRoLTEuOTc1bC0uMzUgMi42NXEtLjc3NS4yLTEuNDM3LjU4Ny0uNjYzLjM4OC0xLjIxMy45MzhMNS41NSA3LjE1bC0uOTc1IDEuNyAyLjE1IDEuNnEtLjEyNS4zNzUtLjE3NS43NS0uMDUuMzc1LS4wNS44IDAgLjQuMDUuNzc1dC4xNzUuNzVsLTIuMTUgMS42MjUuOTc1IDEuNyAyLjQ3NS0xLjA1cS41NS41NzUgMS4yMTMuOTYyLjY2Mi4zODggMS40MzcuNTg4WiIvPjwvc3ZnPg=="; Editor.extensionImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0iTTguOCAyMUg1cS0uODI1IDAtMS40MTMtLjU4N1EzIDE5LjgyNSAzIDE5di0zLjhxMS4yIDAgMi4xLS43NjIuOS0uNzYzLjktMS45MzggMC0xLjE3NS0uOS0xLjkzOFE0LjIgOS44IDMgOS44VjZxMC0uODI1LjU4Ny0xLjQxMlE0LjE3NSA0IDUgNGg0cTAtMS4wNS43MjUtMS43NzVRMTAuNDUgMS41IDExLjUgMS41cTEuMDUgMCAxLjc3NS43MjVRMTQgMi45NSAxNCA0aDRxLjgyNSAwIDEuNDEzLjU4OFEyMCA1LjE3NSAyMCA2djRxMS4wNSAwIDEuNzc1LjcyNS43MjUuNzI1LjcyNSAxLjc3NSAwIDEuMDUtLjcyNSAxLjc3NVEyMS4wNSAxNSAyMCAxNXY0cTAgLjgyNS0uNTg3IDEuNDEzUTE4LjgyNSAyMSAxOCAyMWgtMy44cTAtMS4yNS0uNzg3LTIuMTI1UTEyLjYyNSAxOCAxMS41IDE4dC0xLjkxMi44NzVROC44IDE5Ljc1IDguOCAyMVpNNSAxOWgyLjEyNXEuNi0xLjY1IDEuOTI1LTIuMzI1UTEwLjM3NSAxNiAxMS41IDE2cTEuMTI1IDAgMi40NS42NzUgMS4zMjUuNjc1IDEuOTI1IDIuMzI1SDE4di02aDJxLjIgMCAuMzUtLjE1LjE1LS4xNS4xNS0uMzUgMC0uMi0uMTUtLjM1UTIwLjIgMTIgMjAgMTJoLTJWNmgtNlY0cTAtLjItLjE1LS4zNS0uMTUtLjE1LS4zNS0uMTUtLjIgMC0uMzUuMTVRMTEgMy44IDExIDR2Mkg1djIuMnExLjM1LjUgMi4xNzUgMS42NzVROCAxMS4wNSA4IDEyLjVxMCAxLjQyNS0uODI1IDIuNlQ1IDE2LjhabTcuNzUtNy43NVoiLz48L3N2Zz4="; Editor.colorDropperImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTYgNDJ2LTguNGwxOC44NS0xOC44NS0zLjYtMy42TDIzLjMgOS4xbDQuNiA0LjZMMzUgNi42cS41NS0uNTUgMS4xNzUtLjU1dDEuMTc1LjU1bDQuMDUgNC4wNXEuNTUuNTUuNTUgMS4xNzVUNDEuNCAxM2wtNy4xIDcuMSA0LjYgNC42LTIuMDUgMi4wNS0zLjYtMy42TDE0LjQgNDJabTMtM2g0LjM1TDMxLjEgMjEuMjVsLTQuMzUtNC4zNUw5IDM0LjY1Wm0yMy4xNS0yMSA2LjItNi4yLTIuMTUtMi4xNS02LjIgNi4yWm0wIDBMMzAgMTUuODUgMzIuMTUgMThaIi8+PC9zdmc+"; Editor.magnifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik03ODQtMTIwIDUzMi0zNzJxLTMwIDI0LTY5IDM4dC04MyAxNHEtMTA5IDAtMTg0LjUtNzUuNVQxMjAtNTgwcTAtMTA5IDc1LjUtMTg0LjVUMzgwLTg0MHExMDkgMCAxODQuNSA3NS41VDY0MC01ODBxMCA0NC0xNCA4M3QtMzggNjlsMjUyIDI1Mi01NiA1NlpNMzgwLTQwMHE3NSAwIDEyNy41LTUyLjVUNTYwLTU4MHEwLTc1LTUyLjUtMTI3LjVUMzgwLTc2MHEtNzUgMC0xMjcuNSA1Mi41VDIwMC01ODBxMCA3NSA1Mi41IDEyNy41VDM4MC00MDBaIi8+PC9zdmc+"; Editor.sendImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik0xMjAtMTYwdi02NDBsNzYwIDMyMC03NjAgMzIwWm04MC0xMjAgNDc0LTIwMC00NzQtMjAwdjE0MGwyNDAgNjAtMjQwIDYwdjE0MFptMCAwdi00MDAgNDAwWiIvPjwvc3ZnPg==";Editor.micImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTQwMHEtNTAgMC04NS0zNXQtMzUtODV2LTI0MHEwLTUwIDM1LTg1dDg1LTM1cTUwIDAgODUgMzV0MzUgODV2MjQwcTAgNTAtMzUgODV0LTg1IDM1Wm0tNDAgMzIwdi0xMjNxLTEwNC0xNC0xNzItOTN0LTY4LTE4NGg4MHEwIDgzIDU4LjUgMTQxLjVUNDgwLTI4MHE4MyAwIDE0MS41LTU4LjVUNjgwLTQ4MGg4MHEwIDEwNS02OCAxODR0LTE3MiA5M3YxMjNoLTgwWiIvPjwvc3ZnPg=="; Editor.sparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjkyLDI2Mi45MSwyMTYuNCwxNDkuNzdhOSw5LDAsMCwwLTE2LjgsMEwxNTYuMDgsMjYyLjkxYTksOSwwLDAsMS01LjE3LDUuMTdMMzcuNzcsMzExLjZhOSw5LDAsMCwwLDAsMTYuOGwxMTMuMTQsNDMuNTJhOSw5LDAsMCwxLDUuMTcsNS4xN0wxOTkuNiw0OTAuMjNhOSw5LDAsMCwwLDE2LjgsMGw0My41Mi0xMTMuMTRhOSw5LDAsMCwxLDUuMTctNS4xN0wzNzguMjMsMzI4LjRhOSw5LDAsMCwwLDAtMTYuOEwyNjUuMDksMjY4LjA4QTksOSwwLDAsMSwyNTkuOTIsMjYyLjkxWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iNDAiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTogIzE4MWExYjsiLz4KPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjMwIi8+Cjxwb2x5Z29uIHBvaW50cz0iNDI2LjY3IDExNy4zMyA0MDAgNDggMzczLjMzIDExNy4zMyAzMDQgMTQ0IDM3My4zMyAxNzAuNjcgNDAwIDI0MCA0MjYuNjcgMTcwLjY3IDQ5NiAxNDQgNDI2LjY3IDExNy4zMyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMzAiLz4KPC9zdmc+"; Editor.thinSparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0yNTkuOTIsMjYyLjkxLDIxNi40LDE0OS43N2E5LDksMCwwLDAtMTYuOCwwTDE1Ni4wOCwyNjIuOTFhOSw5LDAsMCwxLTUuMTcsNS4xN0wzNy43NywzMTEuNmE5LDksMCwwLDAsMCwxNi44bDExMy4xNCw0My41MmE5LDksMCwwLDEsNS4xNyw1LjE3TDE5OS42LDQ5MC4yM2E5LDksMCwwLDAsMTYuOCwwbDQzLjUyLTExMy4xNGE5LDksMCwwLDEsNS4xNy01LjE3TDM3OC4yMywzMjguNGE5LDksMCwwLDAsMC0xNi44TDI2NS4wOSwyNjguMDhBOSw5LDAsMCwxLDI1OS45MiwyNjIuOTFaIiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyNCIgZGF0YS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U9IiIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOiAjMTgxYTFiOyIvPgogICAgPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+CiAgICA8cG9seWdvbiBwb2ludHM9IjQyNi42NyAxMTcuMzMgNDAwIDQ4IDM3My4zMyAxMTcuMzMgMzA0IDE0NCAzNzMuMzMgMTcwLjY3IDQwMCAyNDAgNDI2LjY3IDE3MC42NyA0OTYgMTQ0IDQyNi42NyAxMTcuMzMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+Cjwvc3ZnPg=="; Editor.layoutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNjAwLTE2MHYtODBINDQwdi0yMDBoLTgwdjgwSDgwdi0yNDBoMjgwdjgwaDgwdi0yMDBoMTYwdi04MGgyODB2MjQwSDYwMHYtODBoLTgwdjMyMGg4MHYtODBoMjgwdjI0MEg2MDBabTgwLTgwaDEyMHYtODBINjgwdjgwWk0xNjAtNDQwaDEyMHYtODBIMTYwdjgwWm01MjAtMjAwaDEyMHYtODBINjgwdjgwWm0wIDQwMHYtODAgODBaTTI4MC00NDB2LTgwIDgwWm00MDAtMjAwdi04MCA4MFoiLz48L3N2Zz4="; Editor.arrowRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4=";Editor.arrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTM2MCAyODAtNTYwaDQwMEw0ODAtMzYwWiIvPjwvc3ZnPg=="; Editor.arrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjgwLTQwMCAyMDAtMjAwIDIwMCAyMDBIMjgwWiIvPjwvc3ZnPg==";Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTE2MHEtMTM0IDAtMjI3LTkzdC05My0yMjdxMC0xMzQgOTMtMjI3dDIyNy05M3E2OSAwIDEzMiAyOC41VDcyMC02OTB2LTExMGg4MHYyODBINTIwdi04MGgxNjhxLTMyLTU2LTg3LjUtODhUNDgwLTcyMHEtMTAwIDAtMTcwIDcwdC03MCAxNzBxMCAxMDAgNzAgMTcwdDE3MCA3MHE3NyAwIDEzOS00NHQ4Ny0xMTZoODRxLTI4IDEwNi0xMTQgMTczdC0xOTYgNjdaIi8+PC9zdmc+"; Editor.checkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzgyLTI0MCAxNTQtNDY4bDU3LTU3IDE3MSAxNzEgMzY3LTM2NyA1NyA1Ny00MjQgNDI0WiIvPjwvc3ZnPg==";Editor.dockRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0xMjAtODB2LTU2MEgyMDB2NTYwaDEyMFptODAgMGgzNjB2LTU2MEg0MDB2NTYwWm0tODAgMEgyMDBoMTIwWiIvPjwvc3ZnPg=="; Editor.toFrontImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI4MHEtMzMgMC01Ni41LTIzLjVUMjgwLTM2MHYtNDAwcTAtMzMgMjMuNS01Ni41VDM2MC04NDBoNDAwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODBIMzYwWm0wLTgwaDQwMHYtNDAwSDM2MHY0MDBaTTIwMC0yMDB2ODBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDBoODBabS04MC04MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0xNjAgNDgwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+"; Editor.toBackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNDgwaDgwdjQ4MGg0ODB2ODBIMjAwWm0xNjAtMjQwdjgwcS0zMyAwLTU2LjUtMjMuNVQyODAtMzYwaDgwWm0tODAtODB2LTgwaDgwdjgwaC04MFptMC0xNjB2LTgwaDgwdjgwaC04MFptODAtMTYwaC04MHEwLTMzIDIzLjUtNTYuNVQzNjAtODQwdjgwWm04MCA0ODB2LTgwaDgwdjgwaC04MFptMC00ODB2LTgwaDgwdjgwaC04MFptMTYwIDB2LTgwaDgwdjgwaC04MFptMCA0ODB2LTgwaDgwdjgwaC04MFptMTYwLTQ4MHYtODBxMzMgMCA1Ni41IDIzLjVUODQwLTc2MGgtODBabTAgNDAwaDgwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODB2LTgwWm0wLTgwdi04MGg4MHY4MGgtODBabTAtMTYwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+"; Editor.fillColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjQ3LTkwNCA1Ny01NiAzNDMgMzQzcTIzIDIzIDIzIDU3dC0yMyA1N0w0NTctMzEzcS0yMyAyMy01NyAyM3QtNTctMjNMMTUzLTUwM3EtMjMtMjMtMjMtNTd0MjMtNTdsMTkwLTE5MS05Ni05NlptMTUzIDE1M0wyMDktNTYwaDM4Mkw0MDAtNzUxWm0zNjAgNDcxcS0zMyAwLTU2LjUtMjMuNVQ2ODAtMzYwcTAtMjEgMTIuNS00NXQyNy41LTQ1cTktMTIgMTktMjV0MjEtMjVxMTEgMTIgMjEgMjV0MTkgMjVxMTUgMjEgMjcuNSA0NXQxMi41IDQ1cTAgMzMtMjMuNSA1Ni41VDc2MC0yODBaTTgwIDB2LTE2MGg4MDBWMEg4MFoiLz48L3N2Zz4="; Editor.strokeColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNjAtMzIwaDU2bDMxMi0zMTEtMjktMjktMjgtMjgtMzExIDMxMnY1NlptLTgwIDgwdi0xNzBsNDQ4LTQ0N3ExMS0xMSAyNS41LTE3dDMwLjUtNnExNiAwIDMxIDZ0MjcgMThsNTUgNTZxMTIgMTEgMTcuNSAyNnQ1LjUgMzFxMCAxNS01LjUgMjkuNVQ3NzctNjg3TDMzMC0yNDBIMTYwWm01NjAtNTA0LTU2LTU2IDU2IDU2Wk02MDgtNjMxbC0yOS0yOS0yOC0yOCA1NyA1N1oiLz48L3N2Zz4="; Editor.fontColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNDAtMjgwIDIxMC01NjBoMTAwbDIxMCA1NjBoLTk2bC01MC0xNDRIMzY4bC01MiAxNDRoLTk2Wm0xNzYtMjI0aDE2OGwtODItMjMyaC00bC04MiAyMzJaIi8+PC9zdmc+";Editor.backgroundColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm01MDQtNDgwTDQ4MC01ODQgMzIwLTQyNGwxMDMgMTA0IDE2MS0xNjBabS00Ny0xNjAgMTAzIDEwMyAxNjAtMTU5LTEwNC0xMDQtMTU5IDE2MFptLTg0LTI5IDIxNiAyMTYtMTg5IDE5MHEtMjQgMjQtNTYuNSAyNFQzNjctMjYzbC0yNyAyM0gxNDBsMTI2LTEyNXEtMjQtMjQtMjUtNTcuNXQyMy01Ny41bDE4OS0xODlabTAgMCAxODctMTg3cTI0LTI0IDU2LjUtMjR0NTYuNSAyNGwxMDQgMTAzcTI0IDI0IDI0IDU2LjVUODU3LTY0MEw2NjktNDUzIDQ1My02NjlaIi8+PC9zdmc+"; Editor.shadowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTgwcS0zMyAwLTU2LjUtMjMuNVQ4MC0xNjB2LTQ4MHEwLTMzIDIzLjUtNTYuNVQxNjAtNzIwaDgwdi04MHEwLTMzIDIzLjUtNTYuNVQzMjAtODgwaDQ4MHEzMyAwIDU2LjUgMjMuNVQ4ODAtODAwdjQ4MHEwIDMzLTIzLjUgNTYuNVQ4MDAtMjQwaC04MHY4MHEwIDMzLTIzLjUgNTYuNVQ2NDAtODBIMTYwWm0xNjAtMjQwaDQ4MHYtNDgwSDMyMHY0ODBaIi8+PC9zdmc+"; Editor.boldImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjcyLTIwMHYtNTYwaDIyMXE2NSAwIDEyMCA0MHQ1NSAxMTFxMCA1MS0yMyA3OC41VDYwMi00OTFxMjUgMTEgNTUuNSA0MXQzMC41IDkwcTAgODktNjUgMTI0LjVUNTAxLTIwMEgyNzJabTEyMS0xMTJoMTA0cTQ4IDAgNTguNS0yNC41VDU2Ni0zNzJxMC0xMS0xMC41LTM1LjVUNDk0LTQzMkgzOTN2MTIwWm0wLTIyOGg5M3EzMyAwIDQ4LTE3dDE1LTM4cTAtMjQtMTctMzl0LTQ0LTE1aC05NXYxMDlaIi8+PC9zdmc+"; Editor.italicImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtMTAwaDE2MGwxMjAtMzYwSDMyMHYtMTAwaDQwMHYxMDBINTgwTDQ2MC0zMDBoMTQwdjEwMEgyMDBaIi8+PC9zdmc+";Editor.underlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHYtODBoNTYwdjgwSDIwMFptMjgwLTE2MHEtMTAxIDAtMTU3LTYzdC01Ni0xNjd2LTMzMGgxMDN2MzM2cTAgNTYgMjggOTF0ODIgMzVxNTQgMCA4Mi0zNXQyOC05MXYtMzM2aDEwM3YzMzBxMCAxMDQtNTYgMTY3dC0xNTcgNjNaIi8+PC9zdmc+"; Editor.strikethroughImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDg2LTE2MHEtNzYgMC0xMzUtNDV0LTg1LTEyM2w4OC0zOHExNCA0OCA0OC41IDc5dDg1LjUgMzFxNDIgMCA3Ni0yMHQzNC02NHEwLTE4LTctMzN0LTE5LTI3aDExMnE1IDE0IDcuNSAyOC41VDY5NC0zNDBxMCA4Ni02MS41IDEzM1Q0ODYtMTYwWk04MC00ODB2LTgwaDgwMHY4MEg4MFptNDAyLTMyNnE2NiAwIDExNS41IDMyLjVUNjc0LTY3NGwtODggMzlxLTktMjktMzMuNS01MlQ0ODQtNzEwcS00MSAwLTY4IDE4LjVUMzg2LTY0MGgtOTZxMi02OSA1NC41LTExNy41VDQ4Mi04MDZaIi8+PC9zdmc+"; Editor.verticalTextImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MGgtODB2LTUyOGwtNDIgNDItNTYtNTYgMTM4LTEzOCAxNDAgMTM4LTU4IDU2LTQyLTQydjUyOFpNNTYwLTI3NiAxMjAtNDQwdi04MGw0NDAtMTY0djc2bC0xMTIgMzh2MTc4bDExMiA0MHY3NlpNMzg0LTQxNHYtMTMybC0xODIgNjR2NGwxODIgNjRaIi8+PC9zdmc+";Editor.alignLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDQ4MHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNDgwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+"; Editor.alignCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4=";Editor.alignRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4="; Editor.alignJustifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+";Editor.alignTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHYtODBoNjQwdjgwSDE2MFptMjgwIDY0MHYtNDA4TDMzNi00MjRsLTU2LTU2IDIwMC0yMDAgMjAwIDIwMC01NiA1Ni0xMDQtMTA0djQwOGgtODBaIi8+PC9zdmc+"; Editor.alignMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0xNjhsLTY0IDY0LTU2LTU2IDE2MC0xNjAgMTYwIDE2MC01NiA1Ni02NC02NHYxNjhoLTgwWk0xNjAtNDQwdi04MGg2NDB2ODBIMTYwWm0zMjAtMTIwTDMyMC03MjBsNTYtNTYgNjQgNjR2LTE2OGg4MHYxNjhsNjQtNjQgNTYgNTYtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.alignBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTEyMHYtODBoNjQwdjgwSDE2MFptMzIwLTE2MEwyODAtNDgwbDU2LTU2IDEwNCAxMDR2LTQwOGg4MHY0MDhsMTA0LTEwNCA1NiA1Ni0yMDAgMjAwWiIvPjwvc3ZnPg=="; Editor.alignHorizontalLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwMGg4MHY4MDBIODBabTE2MC0yMDB2LTEyMGg0MDB2MTIwSDI0MFptMC0yODB2LTEyMGg2NDB2MTIwSDI0MFoiLz48L3N2Zz4=";Editor.alignHorizontalCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0yMDBIMjQwdi0xMjBoMjAwdi0xNjBIMTIwdi0xMjBoMzIwdi0yMDBoODB2MjAwaDMyMHYxMjBINTIwdjE2MGgyMDB2MTIwSDUyMHYyMDBoLTgwWiIvPjwvc3ZnPg=="; Editor.alignHorizontalRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTgwdi04MDBoODB2ODAwaC04MFpNMzIwLTI4MHYtMTIwaDQwMHYxMjBIMzIwWk04MC01NjB2LTEyMGg2NDB2MTIwSDgwWiIvPjwvc3ZnPg==";Editor.alignVerticalTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTgwdi02NDBoMTIwdjY0MEgyODBabTI4MC0yNDB2LTQwMGgxMjB2NDAwSDU2MFpNODAtODAwdi04MGg4MDB2ODBIODBaIi8+PC9zdmc+"; Editor.alignVerticalMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHYtMzIwSDgwdi04MGgyMDB2LTMyMGgxMjB2MzIwaDE2MHYtMjAwaDEyMHYyMDBoMjAwdjgwSDY4MHYyMDBINTYwdi0yMDBINDAwdjMyMEgyODBaIi8+PC9zdmc+";Editor.alignVerticalBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwaDgwMHY4MEg4MFptMjAwLTE2MHYtNjQwaDEyMHY2NDBIMjgwWm0yODAgMHYtNDAwaDEyMHY0MDBINTYwWiIvPjwvc3ZnPg=="; Editor.subscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTI4MGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTMyMHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtMjQwaC04MHY0MGgxMjB2NDBINzYwWm0tNTI1LTgwIDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS01MzFsMTg2IDI5MUg2MThMNDgyLTQ1N2gtNEwzNDItMjQwSDIzNVoiLz48L3N2Zz4="; Editor.superscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTYwMHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTcyMGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTc2MHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtNjgwaC04MHY0MGgxMjB2NDBINzYwWk0yMzUtMTYwbDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS00NTFsMTg2IDI5MUg2MThMNDgyLTM3N2gtNEwzNDItMTYwSDIzNVoiLz48L3N2Zz4="; Editor.orderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTgwdi02MGgxMDB2LTMwaC02MHYtNjBoNjB2LTMwSDEyMHYtNjBoMTIwcTE3IDAgMjguNSAxMS41VDI4MC0yODB2NDBxMCAxNy0xMS41IDI4LjVUMjQwLTIwMHExNyAwIDI4LjUgMTEuNVQyODAtMTYwdjQwcTAgMTctMTEuNSAyOC41VDI0MC04MEgxMjBabTAtMjgwdi0xMTBxMC0xNyAxMS41LTI4LjVUMTYwLTUxMGg2MHYtMzBIMTIwdi02MGgxMjBxMTcgMCAyOC41IDExLjVUMjgwLTU2MHY3MHEwIDE3LTExLjUgMjguNVQyNDAtNDUwaC02MHYzMGgxMDB2NjBIMTIwWm02MC0yODB2LTE4MGgtNjB2LTYwaDEyMHYyNDBoLTYwWm0xODAgNDQwdi04MGg0ODB2ODBIMzYwWm0wLTI0MHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBaIi8+PC9zdmc+"; Editor.unorderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTIwMHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBabTAtMjQwdi04MGg0ODB2ODBIMzYwWk0yMDAtMTYwcS0zMyAwLTU2LjUtMjMuNVQxMjAtMjQwcTAtMzMgMjMuNS01Ni41VDIwMC0zMjBxMzMgMCA1Ni41IDIzLjVUMjgwLTI0MHEwIDMzLTIzLjUgNTYuNVQyMDAtMTYwWm0wLTI0MHEtMzMgMC01Ni41LTIzLjVUMTIwLTQ4MHEwLTMzIDIzLjUtNTYuNVQyMDAtNTYwcTMzIDAgNTYuNSAyMy41VDI4MC00ODBxMCAzMy0yMy41IDU2LjVUMjAwLTQwMFptMC0yNDBxLTMzIDAtNTYuNS0yMy41VDEyMC03MjBxMC0zMyAyMy41LTU2LjVUMjAwLTgwMHEzMyAwIDU2LjUgMjMuNVQyODAtNzIwcTAgMzMtMjMuNSA1Ni41VDIwMC02NDBaIi8+PC9zdmc+"; Editor.indentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0wIDQ0MHYtMzIwbDE2MCAxNjAtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.outdentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0xNjAgNDQwTDEyMC00ODBsMTYwLTE2MHYzMjBaIi8+PC9zdmc+"; Editor.removeFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtNTI4LTU0Ni05My05My0xMjEtMTIxaDQ4NnYxMjBINTY4bC00MCA5NFpNNzkyLTU2IDQ2MC0zODhsLTgwIDE4OEgyNDlsMTE5LTI4MEw1Ni03OTJsNTYtNTYgNzM2IDczNi01NiA1NloiLz48L3N2Zz4=";Editor.textFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtODBoNTYwdjgwSDIwMFptNzYtMTYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4="; Editor.codeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTI0MCA4MC00ODBsMjQwLTI0MCA1NyA1Ny0xODQgMTg0IDE4MyAxODMtNTYgNTZabTMyMCAwLTU3LTU3IDE4NC0xODQtMTgzLTE4MyA1Ni01NiAyNDAgMjQwLTI0MCAyNDBaIi8+PC9zdmc+";Editor.linkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MEgyODBxLTgzIDAtMTQxLjUtNTguNVQ4MC00ODBxMC04MyA1OC41LTE0MS41VDI4MC02ODBoMTYwdjgwSDI4MHEtNTAgMC04NSAzNXQtMzUgODVxMCA1MCAzNSA4NXQ4NSAzNWgxNjB2ODBaTTMyMC00NDB2LTgwaDMyMHY4MEgzMjBabTIwMCAxNjB2LTgwaDE2MHE1MCAwIDg1LTM1dDM1LTg1cTAtNTAtMzUtODV0LTg1LTM1SDUyMHYtODBoMTYwcTgzIDAgMTQxLjUgNTguNVQ4ODAtNDgwcTAgODMtNTguNSAxNDEuNVQ2ODAtMjgwSDUyMFoiLz48L3N2Zz4="; Editor.lightDarkLinkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwSDI4MHEtODMgMC0xNDEuNS01OC41VDgwLTQ4MHEwLTgzIDU4LjUtMTQxLjVUMjgwLTY4MGgxNjB2ODBIMjgwcS01MCAwLTg1IDM1dC0zNSA4NXEwIDUwIDM1IDg1dDg1IDM1aDE2MHY4MFpNMzIwLTQ0MHYtODBoMzIwdjgwSDMyMFptMjAwIDE2MHYtODBoMTYwcTUwIDAgODUtMzV0MzUtODVxMC01MC0zNS04NXQtODUtMzVINTIwdi04MGgxNjBxODMgMCAxNDEuNSA1OC41VDg4MC00ODBxMCA4My01OC41IDE0MS41VDY4MC0yODBINTIwWiIvPjwvc3ZnPg=="; Editor.tooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMjQwaC04MHYyNDBabTY4LjUtMzMxLjVRNTIwLTYyMyA1MjAtNjQwdC0xMS41LTI4LjVRNDk3LTY4MCA0ODAtNjgwdC0yOC41IDExLjVRNDQwLTY1NyA0NDAtNjQwdDExLjUgMjguNVE0NjMtNjAwIDQ4MC02MDB0MjguNS0xMS41Wk00ODAtODBxLTgzIDAtMTU2LTMxLjVUMTk3LTE5N3EtNTQtNTQtODUuNS0xMjdUODAtNDgwcTAtODMgMzEuNS0xNTZUMTk3LTc2M3E1NC01NCAxMjctODUuNVQ0ODAtODgwcTgzIDAgMTU2IDMxLjVUNzYzLTc2M3E1NCA1NCA4NS41IDEyN1Q4ODAtNDgwcTAgODMtMzEuNSAxNTZUNzYzLTE5N3EtNTQgNTQtMTI3IDg1LjVUNDgwLTgwWm0wLTgwcTEzNCAwIDIyNy05M3Q5My0yMjdxMC0xMzQtOTMtMjI3dC0yMjctOTNxLTEzNCAwLTIyNyA5M3QtOTMgMjI3cTAgMTM0IDkzIDIyN3QyMjcgOTNabTAtMzIwWiIvPjwvc3ZnPg=="; Editor.lightDarkTooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwaDgwdi0yNDBoLTgwdjI0MFptNjguNS0zMzEuNVE1MjAtNjIzIDUyMC02NDB0LTExLjUtMjguNVE0OTctNjgwIDQ4MC02ODB0LTI4LjUgMTEuNVE0NDAtNjU3IDQ0MC02NDB0MTEuNSAyOC41UTQ2My02MDAgNDgwLTYwMHQyOC41LTExLjVaTTQ4MC04MHEtODMgMC0xNTYtMzEuNVQxOTctMTk3cS01NC01NC04NS41LTEyN1Q4MC00ODBxMC04MyAzMS41LTE1NlQxOTctNzYzcTU0LTU0IDEyNy04NS41VDQ4MC04ODBxODMgMCAxNTYgMzEuNVQ3NjMtNzYzcTU0IDU0IDg1LjUgMTI3VDg4MC00ODBxMCA4My0zMS41IDE1NlQ3NjMtMTk3cS01NCA1NC0xMjcgODUuNVQ0ODAtODBabTAtODBxMTM0IDAgMjI3LTkzdDkzLTIyN3EwLTEzNC05My0yMjd0LTIyNy05M3EtMTM0IDAtMjI3IDkzdC05MyAyMjdxMCAxMzQgOTMgMjI3dDIyNyA5M1ptMC0zMjBaIi8+PC9zdmc+"; Editor.lightDarkNoteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik0yNDAtMTIwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMjAwdi01NjBxMC0zMyAyMy41LTU2LjVUMjQwLTg0MGg0ODBxMzMgMCA1Ni41IDIzLjVUODAwLTc2MHYzNjBMNTIwLTEyMEgyNDBabTAtODBoMjA3di0yMzNoMjUzdi0zMjdIMjQwdjU2MFptODAtMzYwdi04MGgzMjB2ODBIMzIwWm0wIDE2MHYtODBoMTIwdjgwSDMyMFoiLz48L3N2Zz4="; Editor.imageImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTQwLTgwaDQ4MEw1NzAtNDgwIDQ1MC0zMjBsLTkwLTEyMC0xMjAgMTYwWm0tNDAgODB2LTU2MCA1NjBaIi8+PC9zdmc+"; Editor.horizontalRuleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTQ0MHYtODBoNjQwdjgwSDE2MFoiLz48L3N2Zz4=";Editor.tableImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0yNDAtMjQwSDIwMHYxNjBoMjQwdi0xNjBabTgwIDB2MTYwaDI0MHYtMTYwSDUyMFptLTgwLTgwdi0xNjBIMjAwdjE2MGgyNDBabTgwIDBoMjQwdi0xNjBINTIwdjE2MFpNMjAwLTY4MGg1NjB2LTgwSDIwMHY4MFoiLz48L3N2Zz4="; Editor.spacingImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTgwIDgwLTI0MGwxNjAtMTYwIDU3IDU2LTY0IDY0aDQ5NGwtNjMtNjQgNTYtNTYgMTYwIDE2MEw3MjAtODBsLTU3LTU2IDY0LTY0SDIzM2w2MyA2NC01NiA1NlptMzYtMzYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4=";Editor.addColumnLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTIwMHYtNTYwSDU2MHY1NjBoMjQwWm0tNjQwIDgwdi0xNjBoODB2ODBoMjQwdi01NjBIMjQwdjgwaC04MHYtMTYwaDcyMHY3MjBIMTYwWm0zMjAtMzYwWm04MCAwaC04MCA4MFptMCAwWk0xNjAtMzYwdi04MEg4MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+"; Editor.addColumnRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHY1NjBoMjQwdi01NjBIMTYwWk04MC0xMjB2LTcyMGg3MjB2MTYwaC04MHYtODBINDgwdjU2MGgyNDB2LTgwaDgwdjE2MEg4MFptNDAwLTM2MFptLTgwIDBoODAtODBabTAgMFptMzIwIDEyMHYtODBoLTgwdi04MGg4MHYtODBoODB2ODBoODB2ODBoLTgwdjgwaC04MFoiLz48L3N2Zz4=";Editor.removeColumnImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIiB0cmFuc2Zvcm09InJvdGF0ZSg5MCkgc2NhbGUoMSwtMSkiPjxwYXRoIGQ9Ik01NjAtMjgwSDEyMHYtNDAwaDcyMHYxMjBoLTgwdi00MEgyMDB2MjQwaDM2MHY4MFptLTM2MC04MHYtMjQwIDI0MFptNDQwIDEwNCA4NC04NC04NC04NCA1Ni01NiA4NCA4NCA4NC04NCA1NiA1Ni04MyA4NCA4MyA4NC01NiA1Ni04NC04My04NCA4My01Ni01NloiLz48L3N2Zz4="; Editor.addRowAboveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTE2MGg1NjB2LTI0MEgyMDB2MjQwWm02NDAgODBIMTIwdi03MjBoMTYwdjgwaC04MHYyNDBoNTYwdi0yNDBoLTgwdi04MGgxNjB2NzIwWk00ODAtNDgwWm0wIDgwdi04MCA4MFptMCAwWm0tNDAtMjQwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg==";Editor.addRowBelowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTU2MGg1NjB2LTI0MEgyMDB2MjQwWm0tODAgNDAwdi03MjBoNzIwdjcyMEg2ODB2LTgwaDgwdi0yNDBIMjAwdjI0MGg4MHY4MEgxMjBabTM2MC0zMjBabTAtODB2ODAtODBabTAgMFpNNDQwLTgwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg=="; Editor.removeRowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTYwLTI4MEgxMjB2LTQwMGg3MjB2MTIwaC04MHYtNDBIMjAwdjI0MGgzNjB2ODBabS0zNjAtODB2LTI0MCAyNDBabTQ0MCAxMDQgODQtODQtODQtODQgNTYtNTYgODQgODQgODQtODQgNTYgNTYtODMgODQgODMgODQtNTYgNTYtODQtODMtODQgODMtNTYtNTZaIi8+PC9zdmc+";Editor.autosizeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAtNDB2LTI0MGg4MHYtNDAwSDQwdi0yNDBoMjQwdjgwaDQwMHYtODBoMjQwdjI0MGgtODB2NDAwaDgwdjI0MEg2ODB2LTgwSDI4MHY4MEg0MFptMjQwLTE2MGg0MDB2LTgwaDgwdi00MDBoLTgwdi04MEgyODB2ODBoLTgwdjQwMGg4MHY4MFptMzItMTIwIDEzNi0zNjBoNjRsMTM2IDM2MGgtNjJsLTMyLTkySDQwOGwtMzIgOTJoLTY0Wm0xMTQtMTQ0aDEwOGwtNTItMTUwaC00bC01MiAxNTBaTTEyMC03NjBoODB2LTgwaC04MHY4MFptNjQwIDBoODB2LTgwaC04MHY4MFptMCA2NDBoODB2LTgwaC04MHY4MFptLTY0MCAwaDgwdi04MGgtODB2ODBabTgwLTY0MFptNTYwIDBabTAgNTYwWm0tNTYwIDBaIi8+PC9zdmc+"; Editor.checkmarkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjJweCIgaGVpZ2h0PSIxOHB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQgMCkiIGQ9Ik03LjE4MSwxNS4wMDdhMSwxLDAsMCwxLS43OTMtMC4zOTFMMy4yMjIsMTAuNUExLDEsMCwxLDEsNC44MDgsOS4yNzRMNy4xMzIsMTIuM2w2LjA0NC04Ljg2QTEsMSwwLDEsMSwxNC44Myw0LjU2OWwtNi44MjMsMTBhMSwxLDAsMCwxLS44LjQzN0g3LjE4MVoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4="; Editor.swapImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTQ0MHYtMjg3TDIxNy02MjRsLTU3LTU2IDIwMC0yMDAgMjAwIDIwMC01NyA1Ni0xMDMtMTAzdjI4N2gtODBaTTYwMC04MCA0MDAtMjgwbDU3LTU2IDEwMyAxMDN2LTI4N2g4MHYyODdsMTAzLTEwMyA1NyA1Nkw2MDAtODBaIi8+PC9zdmc+";Editor.copyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTIwMEgzMjBxLTMzIDAtNTYuNS0yMy41VDI0MC0yODB2LTU2MHEwLTMzIDIzLjUtNTYuNVQzMjAtOTIwaDI4MGwyNDAgMjQwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3NjAtMjAwWk01NjAtNjQwdi0yMDBIMzIwdjU2MGg0NDB2LTM2MEg1NjBaTTE2MC00MHEtMzMgMC01Ni41LTIzLjVUODAtMTIwdi01NjBoODB2NTYwaDQ0MHY4MEgxNjBabTE2MC04MDB2MjAwLTIwMCA1NjAtNTYwWiIvPjwvc3ZnPg=="; Editor.pasteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTY4cTEzLTM2IDQzLjUtNTh0NjguNS0yMnEzOCAwIDY4LjUgMjJ0NDMuNSA1OGgxNjhxMzMgMCA1Ni41IDIzLjVUODQwLTc2MHY1NjBxMCAzMy0yMy41IDU2LjVUNzYwLTEyMEgyMDBabTAtODBoNTYwdi01NjBoLTgwdjEyMEgyODB2LTEyMGgtODB2NTYwWm0yODAtNTYwcTE3IDAgMjguNS0xMS41VDUyMC04MDBxMC0xNy0xMS41LTI4LjVUNDgwLTg0MHEtMTcgMC0yOC41IDExLjVUNDQwLTgwMHEwIDE3IDExLjUgMjguNVQ0ODAtNzYwWiIvPjwvc3ZnPg=="; Editor.doubleArrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjk2LTIyNC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWm0wLTI0MC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWiIvPjwvc3ZnPg==";Editor.doubleArrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTIwMCAyNDAtNDQwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWm0wLTI0MEwyNDAtNjgwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWiIvPjwvc3ZnPg=="; Editor.opacityImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDgwLTEyMHEtMTMzIDAtMjI2LjUtOTJUMTYwLTQzNnEwLTY1IDI1LTEyMS41VDI1NC02NThsMjI2LTIyMiAyMjYgMjIycTQ0IDQ0IDY5IDEwMC41VDgwMC00MzZxMCAxMzItOTMuNSAyMjRUNDgwLTEyMFpNMjQyLTQwMGg0NzRxMTItNzItMTMuNS0xMjNUNjUwLTYwMEw0ODAtNzY4IDMxMC02MDBxLTI3IDI2LTUzIDc3dC0xNSAxMjNaIi8+PC9zdmc+";Editor.shareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNMjQwLTgwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMTYwdi00MDBxMC0zMyAyMy41LTU2LjVUMjQwLTY0MGgxMjB2ODBIMjQwdjQwMGg0ODB2LTQwMEg2MDB2LTgwaDEyMHEzMyAwIDU2LjUgMjMuNVQ4MDAtNTYwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3MjAtODBIMjQwWm0yMDAtMjQwdi00NDdsLTY0IDY0LTU2LTU3IDE2MC0xNjAgMTYwIDE2MC01NiA1Ny02NC02NHY0NDdoLTgwWiIvPjwvc3ZnPg=="; Editor.roughFillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hachure",dispName:"Hachure",res:"hachure"},{val:"solid",dispName:"Solid",res:"solid"},{val:"zigzag",dispName:"ZigZag",res:"zigzag"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"ZigZag Line",res:"zigzagLine"}]; Editor.fillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hatch",dispName:"Hatch",res:"hatch"},{val:"solid",dispName:"Solid",res:"solid"},{val:"dots",dispName:"Dots",res:"dots"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"ZigZag Line",res:"zigzagLine"}];Editor.themes=[];Editor.ctrlKey=mxClient.IS_MAC?"⌘":"Ctrl";Editor.altKey=mxClient.IS_MAC?"⌥":"Alt";Editor.shiftKey=mxClient.IS_MAC?"⇧":"Shift"; Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.suppressNewWindows=null!=window.urlParams&&"1"==urlParams.suppressNewWindows;Editor.popupsAllowed=(null!=window.urlParams?"1"!=urlParams.noDevice:!0)&&!Editor.suppressNewWindows;Editor.simpleLabels=!1;Editor.optimizeHtmlLabels=!1;Editor.enableNativeClipboard=window==window.top&&null!=navigator.clipboard&&null!=navigator.clipboard.read;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme; Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.pageBackgroundColor="#ffffff";Editor.darkPageBackgroundColor=null;Editor.getDefaultPageBackgroundColor=function(){return"light-dark("+Editor.pageBackgroundColor+", "+(null!=Editor.darkPageBackgroundColor?Editor.darkPageBackgroundColor:Editor.darkColor)+")"};Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.removeImageMetadata=!0;Editor.showConnectHandle=!1; Editor.enableInlineToolbar=!0;Editor.defaultTransparentGroups=!1;Editor.enableAutoRotateLabels=!0;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(a){return null!=a&&"data:image/png;"==a.substring(0,15)};Editor.isJpgDataUrl=function(a){return null!=a&&("data:image/jpg;"==a.substring(0,15)||"data:image/jpeg;"==a.substring(0,16))}; Editor.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};Editor.isJpgData=function(a){return 2<a.length&&255==a.charCodeAt(0)&&216==a.charCodeAt(1)}; Editor.stripImageMetadata=function(a,b){if(null!=a&&b&&(Editor.isJpgDataUrl(a)||Editor.isPngDataUrl(a))){b=a.indexOf(",")+1;var d=a.substring(b),e=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0),g=new ArrayBuffer(e.length),c=new Uint8Array(g);for(d=0;d<e.length;d++)c[d]=e.charCodeAt(d);c=null;try{Editor.isJpgData(e)?c=Editor.stripJpgMetadata(g):Editor.isPngData(e)&&(c=Editor.stripPngMetadata(g))}catch(h){}if(null!=c){e="";for(d=0;d<c.length;d++)e+=String.fromCharCode(c[d]);a=a.substring(0, b)+btoa(e)}}return a}; Editor.stripJpgMetadata=function(a){var b=new DataView(a),d=[];d.push(new Uint8Array(a,0,2));for(var e=2;e<a.byteLength-1;){var g=b.getUint16(e);if(65498===g){d.push(new Uint8Array(a,e));break}if(65488<=g&&65497>=g)d.push(new Uint8Array(a,e,2)),e+=2;else{var c=b.getUint16(e+2),h=65506===g;65505===g||h||d.push(new Uint8Array(a,e,2+c));e+=2+c}}a=d.reduce(function(k,p){return k+p.length},0);a=new Uint8Array(a);b=0;d=$jscomp.makeIterator(d);for(e=d.next();!e.done;e=d.next())e=e.value,a.set(e,b),b+=e.length; return a}; Editor.stripPngMetadata=function(a){var b=new DataView(a),d=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),e=[];e.push(new Uint8Array(a,0,8));for(var g=8;g<a.byteLength;){var c=b.getUint32(g),h=String.fromCharCode(b.getUint8(g+4),b.getUint8(g+5),b.getUint8(g+6),b.getUint8(g+7));c=8+c+4;d.has(h)||e.push(new Uint8Array(a,g,c));g+=c;if("IEND"===h)break}a=e.reduce(function(k,p){return k+p.length},0);a=new Uint8Array(a);b=0;e=$jscomp.makeIterator(e);for(d=e.next();!d.done;d=e.next())d=d.value,a.set(d, b),b+=d.length;return a};Editor.convertHtmlToText=function(a){if(null!=a){var b=document.createElement("div");b.innerHTML=Graph.sanitizeHtml(a);return mxUtils.extractTextWithWhitespace(b.childNodes)}return null}; Editor.extractGraphModelFromText=function(a){function b(c){var h=c.indexOf("```");0<=h&&(c=c.substring(c,0,h+6));return c}function d(c){var h=c.lastIndexOf("```");0<=h&&(c=c.substring(h+3));return c}var e=a.indexOf("<mxGraphModel "),g=a.indexOf("</mxGraphModel>");0>e&&(e=a.indexOf("<mxGraphModel>"));return 0<=e&&g>e?[mxUtils.trim(b(a.substring(0,e))),a.substring(e,g+15),mxUtils.trim(d(a.substring(g+15)))]:[a,"",""]}; Editor.repairTruncatedXml=function(a){var b=a.indexOf("<mxfile");0>b&&(b=a.indexOf("<mxGraphModel"));0>b&&(b=0);for(var d=[],e=b,g=!1,c=b;c<a.length;){var h=a.indexOf("<",c);if(0>h){g=0<d.length;break}if("\x3c!--"==a.substring(h,h+4)){c=a.indexOf("--\x3e",h+4);if(0>c){g=!0;break}c+=3}else if("<![CDATA["==a.substring(h,h+9)){c=a.indexOf("]]\x3e",h+9);if(0>c){g=!0;break}c+=3}else{var k=null;c=-1;for(var p=h+1;p<a.length;p++){var l=a.charAt(p);if(null!=k)l==k&&(k=null);else if('"'==l||"'"==l)k=l;else if(">"== l){c=p;break}}if(0>c){g=!0;break}e=a.charAt(h+1);if("/"==e){if(e=/^<\/\s*([^\s>]+)/.exec(a.substring(h,c)),null!=e)for(h=d.length-1;0<=h;h--)if(d[h]==e[1]){d.splice(h);break}}else"?"!=e&&"!"!=e&&"/"!=a.charAt(c-1)&&(e=/^<\s*([^\s\/>]+)/.exec(a.substring(h,c)),null!=e&&d.push(e[1]));c+=1}e=c}if(!g&&0==d.length||e<=b)return null;a=a.substring(0,e);for(b=d.length-1;0<=b;b--)a+="</"+d[b]+">";return a}; Editor.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),e=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(e,mxUtils.bind(this,function(g,c,h){g=e.substring(g+8,g+8+h);if("zTXt"==c){h=g.indexOf(String.fromCharCode(0));var k=g.substring(0,h);if("mxGraphModel"==k||"mxfile"==k){g=Graph.stringToArrayBuffer(g.substring(h+2));h=null;try{h=pako.inflate(g,{to:"string"})}catch(p){h=pako.inflateRaw(g,{to:"string"})}h=null!=h?h.replace(/\+/g," "): null;null!=h&&0<h.length&&(b=h)}}else"tEXt"==c&&(g=g.split(String.fromCharCode(0)),1<g.length&&("mxGraphModel"==g[0]||"mxfile"==g[0])&&(b=g[1]));if(null!=b||"IDAT"==c)return!0}))}catch(g){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b}; Editor.getLabelForStylename=function(a){var b=a.match(/^([A-Za-z]*)(\d*)$/);null!=b&&1<b.length&&(a=mxUtils.trim(b[1].replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(d){return d.toUpperCase()}).replace(/Color[s]?/g,"")),a=mxUtils.trim(a+(0<b[2].length?" ("+b[2]+")":"")));return a}; Editor.soundex=function(a){if(null==a||0==a.length)return"";var b=[],d=1;b[0]=a[0].toUpperCase();for(var e=1,g=a.length;e<g;e++){var c=a[e].toUpperCase().charCodeAt(0)-65;if(0<=c&&25>=c&&"0"!="01230120022455012603010202"[c]&&("01230120022455012603010202"[c]!=b[d-1]&&(b[d]="01230120022455012603010202"[c],d++),3<d))break}if(3>=d)for(;3>=d;)b[d]="0",d++;return b.join("")}; Editor.selectFilename=function(a){var b=a.value.lastIndexOf(".");if(0<b){var d=a.value.substring(b+1);"drawio"!=d&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],d)&&(d=a.value.lastIndexOf(".drawio.",b),0<d&&(b=d))}b=0<b?b:a.value.length;Editor.selectSubstring(a,0,b)}; Editor.selectSubstring=function(a,b,d){a.focus();"undefined"!=typeof a.selectionStart?(a.selectionStart=b,a.selectionEnd=d):document.selection&&document.selection.createRange&&(a.select(),a=document.selection.createRange(),a.collapse(!0),a.moveEnd("character",d),a.moveStart("character",b),a.select())}; Editor.toUnit=function(a,b){return b==mxConstants.INCHES?Math.round(1E3*a/mxConstants.PIXELS_PER_INCH)/1E3:b==mxConstants.MILLIMETERS?Math.round(1E3*a/mxConstants.PIXELS_PER_MM)/1E3:b==mxConstants.METERS?Math.round(1E5*a/(1E3*mxConstants.PIXELS_PER_MM))/1E5:Math.round(10*a)/10}; Editor.fromUnit=function(a,b){b==mxConstants.INCHES?a*=mxConstants.PIXELS_PER_INCH:b==mxConstants.MILLIMETERS?a*=mxConstants.PIXELS_PER_MM:b==mxConstants.METERS&&(a=a*mxConstants.PIXELS_PER_MM*1E3);return Math.round(10*a)/10};Editor.getCursorMoveStep=function(a){return a==mxConstants.MILLIMETERS?.1*mxConstants.PIXELS_PER_MM:a==mxConstants.INCHES?.01*mxConstants.PIXELS_PER_INCH:a==mxConstants.METERS?.1*mxConstants.PIXELS_PER_MM:1};mxUtils.extend(Editor,mxEventSource); Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0; Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.origin+window.location.pathname;Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(a){this.autosave=a;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(a){return this.editBlankUrl+a}; Editor.prototype.editAsNew=function(a,b,d,e){b=null!=b?"?title="+encodeURIComponent(b):"";d?b+=(0<b.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(b+=(0<b.length?"&":"?")+"ui="+urlParams.ui);null!=e&&(b+=(0<b.length?"&":"?")+"page-id="+e);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(b)+"#R"+encodeURIComponent(a));else{var g=null,c=mxUtils.bind(this,function(k){"ready"==k.data&&k.source==g&&(mxEvent.removeListener(window,"message",c), g.postMessage(a,"*"))});d=b.substring(1).split("&");e={client:1};for(b=0;b<d.length;b++){var h=d[b].split("=");e[h[0]]=h[1]||""}mxEvent.addListener(window,"message",c);g=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(e)),null,!0)}}; Editor.prototype.createGraph=function(a,b){a=new Graph(null,b,null,null,a);a.transparentBackground=!1;var d=a.isCssTransformsSupported,e=this;a.isCssTransformsSupported=function(){return d.apply(this,arguments)&&(!e.chromeless||!mxClient.IS_SF)};this.chromeless||(a.isBlankLink=function(g){return!this.isExternalProtocol(g)});return a}; Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(null==window.urlParams||"0"!=urlParams.tooltips);this.graph.setConnectable(this.graph.defaultConnectable);this.graph.connectionArrowsEnabled=this.graph.defaultConnectionArrowsEnabled;this.graph.foldingEnabled=this.graph.defaultFoldingEnabled;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible= this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)}; Editor.prototype.readGraphState=function(a){this.savedGraphState={};if(Editor.preserveViewState){var b=a.getAttribute("dx"),d=a.getAttribute("dy");null!=b&&(this.savedGraphState.dx=b);null!=d&&(this.savedGraphState.dy=d)}b=a.getAttribute("grid");if(null==b||""==b)b=this.graph.defaultGridEnabled?"1":"0";null!=urlParams.grid&&(this.savedGraphState.grid=b);this.graph.gridEnabled=(null!=urlParams.grid?"0"!=urlParams.grid:"0"!=b)&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(a.getAttribute("gridSize"))|| mxGraph.prototype.gridSize;this.graph.graphHandler.guidesEnabled="0"!=a.getAttribute("guides");this.graph.setTooltips("0"!=a.getAttribute("tooltips")&&(null==window.urlParams||"0"!=urlParams.tooltips));b=a.getAttribute("connect");null!=b&&null!=Editor.config&&null!=Editor.config.defaultConnectable&&(this.savedGraphState.connect=b);this.graph.setConnectable(null==b||null!=Editor.config&&null!=Editor.config.defaultConnectable?this.graph.defaultConnectable:"0"!=b);b=a.getAttribute("arrows");null!=b&& null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled&&(this.savedGraphState.arrows=b);this.graph.connectionArrowsEnabled=null==b||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?this.graph.defaultConnectionArrowsEnabled:"0"!=b;b=a.getAttribute("fold");null!=b&&null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled&&(this.savedGraphState.fold=b);this.graph.foldingEnabled=null==b||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?this.graph.defaultFoldingEnabled: "0"!=b;this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);b=parseFloat(a.getAttribute("pageScale"));!isNaN(b)&&0<b?this.graph.pageScale=b:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:null!=urlParams.pv?(b=a.getAttribute("page"),this.savedGraphState.page=b,this.graph.pageVisible="0"!=urlParams.pv): (b=a.getAttribute("page"),this.graph.pageVisible=null!=b?"0"!=b:this.graph.defaultPageVisible);this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;b=parseFloat(a.getAttribute("pageWidth"));d=parseFloat(a.getAttribute("pageHeight"));isNaN(b)||isNaN(d)||(this.graph.pageFormat=new mxRectangle(0,0,b,d));a=a.getAttribute("background");this.graph.background=null!=a&&0<a.length?a:null}; Editor.prototype.setGraphXml=function(a){if(null!=a){var b=new mxCodec(a.ownerDocument);if("mxGraphModel"==a.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(a),this.updateGraphComponents(),b.decode(a,this.graph.getModel())}finally{this.graph.model.endUpdate()}}else if("root"==a.nodeName){this.resetGraph();var d=b.document.createElement("mxGraphModel");d.appendChild(a);b.decode(d,this.graph.getModel());this.updateGraphComponents()}else throw{message:mxResources.get("cannotOpenFile"), node:a,toString:function(){return this.message}};}else this.resetGraph(),this.graph.model.clear();this.fireEvent(new mxEventObject("resetGraphView"))}; Editor.prototype.getGraphXml=function(a){if(null!=a?a:1){var b=new mxCodec(mxUtils.createXmlDocument());a=b.encode(this.graph.getModel());b.document.appendChild(a)}else a=this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));b=this.savedGraphState||{};if(null!=b.dx||null!=b.dy)null!=b.dx&&a.setAttribute("dx",b.dx),null!=b.dy&&a.setAttribute("dy",b.dy);else if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)a.setAttribute("dx",Math.round(100* this.graph.view.translate.x)/100),a.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);a.setAttribute("grid",null!=b.grid?b.grid:this.graph.isGridEnabled()?"1":"0");a.setAttribute("gridSize",this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",null!=b.connect?b.connect:this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",null!= b.arrows?b.arrows:this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",null!=b.fold?b.fold:this.graph.foldingEnabled?"1":"0");a.setAttribute("page",null!=b.page?b.page:this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width);a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a}; Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};Editor.prototype.setFilename=function(a){this.filename=a}; Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(e,g){b.undoableEditHappened(g.getProperty("edit"))};var d=mxUtils.bind(this,function(e,g){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,d);a.getView().addListener(mxEvent.UNDO,d);d=function(e,g){e=g.getProperty("edit").changes;e=a.getSelectionCellsForChanges(e);g=!1;if(0<e.length){for(var c=[],h=0;h<e.length;h++)null!=a.view.getState(e[h])&&(c.push(e[h]), g||(a.scrollCellToVisible(e[h]),g=!0));a.setSelectionCells(c)}};b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()}; OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)}; function Dialog(a,b,d,e,g,c,h,k,p,l,u){this.editorUi=a;null==this.bg&&(this.bg=a.createDiv("geBackground"));g&&null!=document.body&&document.body.appendChild(this.bg);g=a.createDiv(p?"geTransDialog":"geDialog");g.style.width=d+48+"px";null!=e&&(g.style.height=e+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==a.embedViewport||(g.style.left=a.embedViewport.x+a.embedViewport.width/2+"px",g.style.top=a.embedViewport.y+a.embedViewport.height/2+"px");g.appendChild(b);null!=document.body&& document.body.appendChild(g);null==e&&(g.style.height=b.scrollHeight+48+"px");if(c&&(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.top="0px",b.style.right="0px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),g.appendChild(b),!u)){var x=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(v){x=!0}),null,mxUtils.bind(this, function(v){x&&(a.hideDialog(!0),x=!1)}))}this.onDialogClose=h;this.container=g;null!=l&&this.addResizeHandler(l);a.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(a,b){return new mxPoint(a,b)}; Dialog.prototype.addResizeHandler=function(a){var b=document.createElement("img");b.setAttribute("src",mxWindow.prototype.resizeImage);b.style.cursor="nwse-resize";b.style.position="absolute";b.style.bottom="0px";b.style.right="0px";b.style.zIndex="2";var d=this,e=function(g,c){var h=null,k=null,p=null,l=null,u=function(v){if(null!=h){var z=mxEvent.getClientX(v)-h,C=mxEvent.getClientY(v)-k,F=p,G=l;0<=c.indexOf("r")&&(F+=2*z);0<=c.indexOf("l")&&(F-=2*z);0<=c.indexOf("b")&&(G+=2*C);0<=c.indexOf("t")&& (G-=2*C);d.container.style.width=Math.max(a.width,F)+"px";d.container.style.height=Math.max(a.height,G)+"px";mxEvent.consume(v)}},x=function(v){if(null!=h&&(k=h=null,mxEvent.removeGestureListeners(document,null,u,x),mxEvent.consume(v),"function"===typeof d.onResize))d.onResize(parseInt(d.container.style.width),parseInt(d.container.style.height))};mxEvent.addGestureListeners(g,function(v){h=mxEvent.getClientX(v);k=mxEvent.getClientY(v);p=parseInt(d.container.style.width);l=parseInt(d.container.style.height); mxEvent.addGestureListeners(document,null,u,x);mxEvent.consume(v)},u,x)};e(b,"br");this.container.appendChild(b);installDialogEdgeResizeHandles(this.container,e)}; function installDialogEdgeResizeHandles(a,b){var d=[];[{styles:"top:0;left:0;width:8px;height:8px;",cursor:"nw-resize",edges:"tl"},{styles:"top:0;left:8px;right:8px;height:4px;",cursor:"n-resize",edges:"t"},{styles:"top:0;right:0;width:8px;height:8px;",cursor:"ne-resize",edges:"tr"},{styles:"top:8px;right:0;bottom:14px;width:4px;",cursor:"e-resize",edges:"r"},{styles:"bottom:0;left:0;width:8px;height:8px;",cursor:"sw-resize",edges:"bl"},{styles:"bottom:0;left:8px;right:14px;height:4px;",cursor:"s-resize", edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(e){var g=document.createElement("div");g.style.cssText="position:absolute;z-index:2;"+e.styles+"cursor:"+e.cursor;b(g,e.edges);a.appendChild(g);d.push(g)});return d} (function(){var a=mxWindow.prototype.setResizable;mxWindow.prototype.setResizable=function(b){a.apply(this,arguments);b?null==this._edgeResizeHandles?this._edgeResizeHandles=installMxWindowEdgeResizeHandles(this):this._edgeResizeHandles.forEach(function(d){d.style.display=""}):null!=this._edgeResizeHandles&&this._edgeResizeHandles.forEach(function(d){d.style.display="none"})}})(); function installMxWindowEdgeResizeHandles(a){var b=a.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(a.div,function(d,e){var g=null,c=null,h,k,p,l,u=function(v){if(null!=g){var z=mxEvent.getClientX(v)-g,C=mxEvent.getClientY(v)-c,F=h,G=k,H=p,J=l;0<=e.indexOf("t")&&(G=k+C,J=l-C);0<=e.indexOf("b")&&(J=l+C);0<=e.indexOf("l")&&(F=h+z,H=p-z);0<=e.indexOf("r")&&(H=p+z);H<b.width&&(0<=e.indexOf("l")&&(F=h+p-b.width),H=b.width);J<b.height&&(0<=e.indexOf("t")&&(G=k+l-b.height), J=b.height);F===h&&G===k||a.setLocation(F,G);a.setSize(H,J);a.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",v));mxEvent.consume(v)}},x=function(v){null!=g&&(c=g=null,mxEvent.removeGestureListeners(document,null,u,x),a.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",v)),mxEvent.consume(v))};mxEvent.addGestureListeners(d,function(v){a.activate();null!=a.dockState&&(a.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",v)),a.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",v)));g= mxEvent.getClientX(v);c=mxEvent.getClientY(v);h=a.getX();k=a.getY();p=parseInt(a.div.style.width)||a.div.offsetWidth;l=parseInt(a.div.style.height)||a.div.offsetHeight;mxEvent.addGestureListeners(document,null,u,x);a.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",v));mxEvent.consume(v)},u,x)})} Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))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(a,b,d,e,g,c,h,k,p,l,u){p=null!=p?p:!0;var x=document.createElement("div");x.style.textAlign="center";x.style.flexDirection="column";x.style.maxHeight="100%";x.style.display="flex";if(null!=b){var v=document.createElement("div");v.style.padding="0px";v.style.margin="0px";v.style.fontSize="14px";v.style.fontWeight="600";v.style.paddingBottom="12px";v.style.marginBottom="10px";v.style.borderBottom="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))";v.style.whiteSpace= "nowrap";v.style.textOverflow="ellipsis";v.style.overflow="hidden";v.style.flexShrink="0";mxUtils.write(v,b);v.setAttribute("title",b);x.appendChild(v)}b=document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.style.flexGrow="1";b.style.overflowY="auto";"string"===typeof d&&(d=d.replace(/\n/g,"<br/>"));b.innerHTML=Graph.sanitizeHtml(d);x.appendChild(b);d=document.createElement("div");d.style.marginTop="12px";d.style.textAlign="center";null!=c&&(b=mxUtils.button(mxResources.get("tryAgain"), function(){a.hideDialog();c()}),b.className="geBtn",d.appendChild(b),d.style.textAlign="center");null!=l&&(l=mxUtils.button(l,function(){null!=u&&u()}),l.className="geBtn",d.appendChild(l));var z=mxUtils.button(e,function(){p&&a.hideDialog();null!=g&&g()});z.className="geBtn";d.appendChild(z);null!=h&&(e=mxUtils.button(h,function(){p&&a.hideDialog();null!=k&&k()}),e.className="geBtn gePrimaryBtn",d.appendChild(e));this.init=function(){z.focus()};x.appendChild(d);this.container=x},PrintDialog=function(a, b,d,e){this.create(a,b,d,e)}; PrintDialog.prototype.create=function(a){function b(z){var C=h.checked||l.checked,F=parseInt(x.value)/100;isNaN(F)&&(F=1,x.value="100%");mxClient.IS_SF&&(F*=.75);var G=d.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/d.pageScale;if(C){var J=h.checked?1:parseInt(u.value);isNaN(J)||(H=mxUtils.getScaleForPageCount(J,d,G))}var O=J=0;G=mxRectangle.fromRectangle(G);G.width*=F;G.height*=F;H*=F;!C&&d.pageVisible?(F=d.getPageLayout(),J-=F.x*G.width,O-=F.y*G.height):C=!0;C=PrintDialog.createPrintPreview(d, H,G,0,J,O,C);C.open();z&&PrintDialog.printPreview(C)}var d=a.editor.graph,e=document.createElement("table");e.style.width="100%";e.style.height="100%";var g=document.createElement("tbody");var c=document.createElement("tr");var h=document.createElement("input");h.setAttribute("type","checkbox");var k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(h);var p=document.createElement("span");mxUtils.write(p," "+mxResources.get("fitPage"));k.appendChild(p); mxEvent.addListener(p,"click",function(z){h.checked=!h.checked;l.checked=!h.checked;mxEvent.consume(z)});mxEvent.addListener(h,"change",function(){l.checked=!h.checked});c.appendChild(k);g.appendChild(c);c=c.cloneNode(!1);var l=document.createElement("input");l.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(l);p=document.createElement("span");mxUtils.write(p," "+mxResources.get("posterPrint")+":");k.appendChild(p);mxEvent.addListener(p,"click", function(z){l.checked=!l.checked;h.checked=!l.checked;mxEvent.consume(z)});c.appendChild(k);var u=document.createElement("input");u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.setAttribute("size","4");u.setAttribute("disabled","disabled");u.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(u);mxUtils.write(k," "+mxResources.get("pages")+" (max)");c.appendChild(k);g.appendChild(c);mxEvent.addListener(l,"change",function(){l.checked? u.removeAttribute("disabled"):u.setAttribute("disabled","disabled");h.checked=!l.checked});c=c.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");c.appendChild(k);k=document.createElement("td");var x=document.createElement("input");x.setAttribute("value","100 %");x.setAttribute("size","5");x.style.width="50px";k.appendChild(x);c.appendChild(k);g.appendChild(c);c=document.createElement("tr");k=document.createElement("td");k.colSpan=2;k.style.paddingTop="30px"; k.setAttribute("align","right");p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&k.appendChild(p);if(PrintDialog.previewEnabled){var v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});v.className="geBtn";k.appendChild(v)}v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});v.className="geBtn gePrimaryBtn";k.appendChild(v);a.editor.cancelFirst||k.appendChild(p); c.appendChild(k);g.appendChild(c);e.appendChild(g);c=document.createElement("div");c.style.paddingBottom="20px";c.appendChild(e);this.container=c};PrintDialog.printPreview=function(a){try{null!=a.wnd&&window.setTimeout(function(){a.wnd.focus();a.wnd.print();a.wnd.close()},500)}catch(b){}}; PrintDialog.createPrintPreview=function(a,b,d,e,g,c,h){b=new mxPrintPreview(a,b,d,e,g,c);b.title=mxResources.get("preview");b.addPageCss=!mxClient.IS_SF;b.printBackgroundImage=!0;b.autoOrigin=h;h=a.background;if(null==h||""==h||h==mxConstants.NONE)h="#ffffff";b.backgroundColor=h;var k=b.isTextLabel;b.isTextLabel=function(l){return"geHint"==!l.className&&k.apply(this,arguments)};var p=b.getLinkForCellState;b.getLinkForCellState=function(l){return a.getAbsoluteUrl(p.apply(this,arguments))};return b}; PrintDialog.previewEnabled=!0; var PageSetupDialog=function(a){var b=a.editor.graph,d=document.createElement("div"),e=function(J){J.style.minWidth="140px";return J},g=function(J){J.style.marginLeft="8px";return J},c=document.createElement("h3");mxUtils.write(c,mxResources.get("pageSetup"));d.appendChild(c);c=document.createElement("div");c.className="geDialogSection";var h=document.createElement("div");h.className="geDialogFormRow geDialogFormRowTop";var k=document.createElement("span");k.className="geDialogFormLabel";mxUtils.write(k, mxResources.get("paperSize")+":");h.appendChild(e(k));k=document.createElement("div");k.style.flex="1";k.style.minWidth="0";var p=PageSetupDialog.addPageFormatPanel(k,"pagesetupdialog",b.pageFormat);h.appendChild(g(k));c.appendChild(h);d.appendChild(c);c=document.createElement("div");c.className="geDialogSection";h=document.createElement("div");h.className="geDialogFormRow";k=document.createElement("span");k.className="geDialogFormLabel";mxUtils.write(k,mxResources.get("gridSize")+":");h.appendChild(e(k)); var l=document.createElement("input");l.setAttribute("type","number");l.setAttribute("min","0");l.setAttribute("step","any");l.style.width="60px";l.style.flex="0 0 auto";l.value=b.getGridSize();h.appendChild(g(l));mxEvent.addListener(l,"change",function(){var J=parseFloat(l.value);l.value=Math.max(1,isNaN(J)?b.getGridSize():J)});c.appendChild(h);d.appendChild(c);c=document.createElement("div");c.className="geDialogSection";h=document.createElement("div");h.className="geDialogFormRow";k=document.createElement("span"); k.className="geDialogFormLabel";mxUtils.write(k,mxResources.get("background")+":");h.appendChild(e(k));var u=b.backgroundImage,x=b.background;k=document.createElement("button");k.className="geBtn";k.style.margin="0px";mxUtils.write(k,mxResources.get("change")+"...");mxEvent.addListener(k,"click",function(J){a.showBackgroundImageDialog(function(O,M,V){M||(null!=O&&null!=O.src&&Graph.isPageLink(O.src)&&(O={originalSrc:O.src}),u=O);x=V},u,x,!0);mxEvent.consume(J)});h.appendChild(g(k));c.appendChild(h); d.appendChild(c);c=a.addAdvancedSection(d);h=document.createElement("div");h.className="geDialogFormRow";k=document.createElement("span");k.className="geDialogFormLabel";mxUtils.write(k,mxResources.get("adaptiveColors")+":");h.appendChild(e(k));var v=document.createElement("select");g(v);k=function(J,O){var M=document.createElement("option");M.setAttribute("value",J);mxUtils.write(M,O);v.appendChild(M)};k("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+ ")");k("auto",mxResources.get("automatic"));k("simple",mxResources.get("simple"));k("none",mxResources.get("none"));v.value=null==b.adaptiveColors?"default":b.adaptiveColors;h.appendChild(v);null==a.menus||null==a.menus.createHelpLink||a.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(k=a.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),k.style.marginLeft="8px",h.appendChild(k));c.content.appendChild(h);if(null!=a.currentPage){var z=a.currentPage.getViewBox(); var C=!1;h=document.createElement("div");h.className="geDialogSection";k=document.createElement("div");k.className="geDialogFormRow";var F=document.createElement("span");F.className="geDialogFormLabel";mxUtils.write(F,mxResources.get("initialView")+":");k.appendChild(e(F));e=document.createElement("div");e.style.flex="1";e.style.minWidth="0";e.style.display="flex";e.style.alignItems="center";var G=document.createElement("span");G.style.flex="1 1 auto";G.style.minWidth="0";G.style.overflow="hidden"; G.style.textOverflow="ellipsis";G.style.whiteSpace="nowrap";G.style.lineHeight="normal";var H=function(){if(null!=z){var J=z.x+", "+z.y;null!=z.scale&&(J+=" · "+Math.round(100*z.scale)+"%")}else J=mxResources.get("default");G.textContent=J};H();e.appendChild(G);k.appendChild(g(e));h.appendChild(k);e=document.createElement("div");e.className="geDialogFormRow";e.style.justifyContent="flex-end";e.style.flexWrap="wrap";e.style.gap="8px";k=mxUtils.button(mxResources.get("useCurrent"),function(){z=b.getCurrentViewBox(); C=!0;H()});k.className="geBtn";k.style.margin="0px";k.style.flexShrink="0";e.appendChild(k);k=mxUtils.button(mxResources.get("reset"),function(){z=null;C=!0;H()});k.className="geBtn";k.style.margin="0px";k.style.flexShrink="0";e.appendChild(k);h.appendChild(e);c.wrapper.appendChild(h)}"undefined"!==typeof AnimationDialog&&(e=document.createElement("div"),e.className="geDialogSection",h=document.createElement("div"),h.className="geDialogFormRow geDialogFormRowTop",k=document.createElement("span"), k.className="geDialogFormLabel",k.style.minWidth="0",mxUtils.write(k,mxResources.get("animation")+":"),h.appendChild(k),k=document.createElement("div"),k.style.flex="1",k.style.minWidth="0",k.style.display="flex",k.style.alignItems="center",k.style.gap="8px",F=document.createElement("span"),F.className="geDialogHint",F.style.flex="1 1 auto",F.style.minWidth="0",mxUtils.write(F,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),k.appendChild(F), F=mxUtils.button(mxResources.get("edit"),function(){a.hideDialog();var J=a.menus;null!=J&&null!=J.animationWindow?(J.animationWindow.window.setVisible(!0),J.animationWindow.window.activate()):null!=a.actions.get("animation")&&a.actions.get("animation").funct()}),F.className="geBtn",F.style.minWidth="90px",k.appendChild(F),h.appendChild(g(k)),e.appendChild(h),c.wrapper.appendChild(e));g=d.querySelectorAll(".geBtn");for(e=0;e<g.length;e++)c=mxUtils.trim(g[e].textContent),null==g[e].getAttribute("title")&& ""!=c&&g[e].setAttribute("title",c);this.container=(new CustomDialog(a,d,function(){var J=parseFloat(l.value);isNaN(J)||b.gridSize===J||b.setGridSize(J);J=new ChangePageSetup(a,x,u,p.get());J.ignoreColor=b.background==x;J.ignoreImage=(null!=b.backgroundImage?b.backgroundImage.src:null)===(null!=u?u.src:null);var O=v.value,M=O!=(null==b.adaptiveColors?"default":b.adaptiveColors);M&&(J.adaptiveColors=O);b.pageFormat.width==J.previousFormat.width&&b.pageFormat.height==J.previousFormat.height&&J.ignoreColor&& J.ignoreImage&&!M||b.model.execute(J);C&&null!=a.currentPage&&b.model.execute(new ChangePageView(a,a.currentPage,z))},null,mxResources.get("apply"))).container}; PageSetupDialog.addPageFormatPanel=function(a,b,d,e){b="format-"+b;var g=document.createElement("input");g.setAttribute("name",b);g.setAttribute("type","radio");g.setAttribute("value","portrait");var c=document.createElement("input");c.setAttribute("name",b);c.setAttribute("type","radio");c.setAttribute("value","landscape");var h=document.createElement("select");h.style.position="relative";h.style.marginBottom="4px";h.style.borderRadius="4px";h.style.borderWidth="1px";h.style.borderStyle="solid"; h.style.boxSizing="border-box";h.style.padding="2px";h.style.width="210px";var k=document.createElement("div");k.style.alignItems="center";k.style.whiteSpace="nowrap";k.style.marginLeft="4px";k.style.width="210px";k.style.height="24px";g.style.margin="0 6px 0 0";k.appendChild(g);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));k.appendChild(b);c.style.margin="0 6px 0 10px";k.appendChild(c);var p=document.createElement("span");p.style.width="100px"; mxUtils.write(p,mxResources.get("landscape"));k.appendChild(p);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.fontSize="12px";l.style.width="210px";l.style.height="24px";var u=document.createElement("input");u.setAttribute("size","6");u.setAttribute("title",mxResources.get("width"));u.style.textAlign="right";l.appendChild(u);mxUtils.write(l," x ");var x=document.createElement("input");x.setAttribute("size","6");x.setAttribute("title",mxResources.get("height"));x.style.textAlign= "right";l.appendChild(x);var v=document.createElement("select");v.style.marginLeft="4px";v.style.boxSizing="border-box";for(var z=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS},{label:mxResources.get("meters"),unit:mxConstants.METERS}],C=0;C<z.length;C++){var F=document.createElement("option");F.setAttribute("value",z[C].unit);mxUtils.write(F,z[C].label);v.appendChild(F)}v.value= Editor.pageSizeUnit;l.appendChild(v);k.style.display="none";l.style.display="none";var G={},H=PageSetupDialog.getFormats();for(C=0;C<H.length;C++)z=H[C],G[z.key]=z,F=document.createElement("option"),F.setAttribute("value",z.key),mxUtils.write(F,z.title),h.appendChild(F);var J=function(){h.value="custom";for(var M=0;M<H.length;M++){var V=H[M];null!=V.format&&("a4"==V.key?826==d.width?(d=mxRectangle.fromRectangle(d),d.width=827):826==d.height&&(d=mxRectangle.fromRectangle(d),d.height=827):"a5"==V.key&& (584==d.width?(d=mxRectangle.fromRectangle(d),d.width=583):584==d.height&&(d=mxRectangle.fromRectangle(d),d.height=583)),d.width==V.format.width&&d.height==V.format.height?(h.value=V.key,g.setAttribute("checked","checked"),g.defaultChecked=!0,g.checked=!0,c.removeAttribute("checked"),c.defaultChecked=!1,c.checked=!1,detected=!0):d.width==V.format.height&&d.height==V.format.width&&(h.value=V.key,g.removeAttribute("checked"),g.defaultChecked=!1,g.checked=!1,c.setAttribute("checked","checked"),c.defaultChecked= !0,detected=c.checked=!0))}"custom"==h.value?(u.value=Editor.toUnit(d.width,v.value),x.value=Editor.toUnit(d.height,v.value),g.setAttribute("checked","checked"),h.value="custom",k.style.display="none",l.style.display=""):(k.style.display="flex",l.style.display="none")};J();a.appendChild(h);mxUtils.br(a);a.appendChild(k);a.appendChild(l);var O=function(M,V){M=G[h.value];null!=M.format?(u.value=Editor.toUnit(c.checked?M.format.height:M.format.width,v.value),x.value=Editor.toUnit(c.checked?M.format.width: M.format.height,v.value),l.style.display="none",k.style.display="flex"):(k.style.display="none",l.style.display="");var Q=parseFloat(u.value);if(isNaN(Q)||0>=Q)u.value=Editor.toUnit(d.width,v.value);Q=parseFloat(x.value);if(isNaN(Q)||0>=Q)x.value=Editor.toUnit(d.height,v.value);M=null!=M.format?new mxRectangle(0,0,c.checked?M.format.height:M.format.width,c.checked?M.format.width:M.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(u.value),v.value),Editor.fromUnit(parseFloat(x.value),v.value)); V||M.width==d.width&&M.height==d.height||(d=M,null!=e&&e(d))};mxEvent.addListener(b,"click",function(M){g.checked=!0;O(M);mxEvent.consume(M)});mxEvent.addListener(p,"click",function(M){c.checked=!0;O(M);mxEvent.consume(M)});mxEvent.addListener(u,"blur",O);mxEvent.addListener(u,"click",O);mxEvent.addListener(x,"blur",O);mxEvent.addListener(x,"click",O);mxEvent.addListener(c,"change",O);mxEvent.addListener(g,"change",O);mxEvent.addListener(h,"change",function(M){O(M,"custom"==h.value);mxEvent.consume(M)}); mxEvent.addListener(v,"change",function(M){u.value=Editor.toUnit(Editor.fromUnit(u.value,Editor.pageSizeUnit),v.value);x.value=Editor.toUnit(Editor.fromUnit(x.value,Editor.pageSizeUnit),v.value);Editor.pageSizeUnit=v.value;O(M,!0);mxEvent.consume(M)});O(null,!0);return{set:function(M){d=M;J(null,null,!0)},get:function(){return d},widthInput:u,heightInput:x}}; 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(a,b,d,e,g,c,h,k,p,l,u){p=null!=p?p:!0;var x=document.createElement("div"),v=document.createElement("div");v.style.width="100%";v.style.display="grid";v.style.gap="5px 8px";v.style.gridAutoColumns="auto 1fr";v.style.boxSizing="border-box";v.style.padding="3px";var z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.justifyContent="flex-end";z.style.minWidth="0";var C=document.createElement("div");C.style.display="inline-block"; C.style.textOverflow="ellipsis";C.style.whiteSpace="nowrap";C.style.overflow="hidden";C.style.fontSize="10pt";C.style.padding="2px 0";C.setAttribute("title",g||mxResources.get("filename"));mxUtils.write(C,(g||mxResources.get("filename"))+":");z.appendChild(C);v.appendChild(z);var F=document.createElement("input");F.setAttribute("value",b||"");F.style.flexGrow="1";var G=mxUtils.button(d,function(){if(null==c||c(F.value))p&&a.hideDialog(),e(F.value)});G.className="geBtn gePrimaryBtn";this.init=function(){if(null!= g||null==h)if(null!=u?Editor.selectFilename(F):(F.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=v.parentNode;if(null!=H){var J=null;mxEvent.addListener(H,"dragleave",function(O){null!=J&&(J.style.backgroundColor="",J=null);O.stopPropagation();O.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(O){null==J&&(J=F,J.style.backgroundColor="#ebf2f9");O.stopPropagation();O.preventDefault()})); mxEvent.addListener(H,"drop",mxUtils.bind(this,function(O){null!=J&&(J.style.backgroundColor="",J=null);0<=mxUtils.indexOf(O.dataTransfer.types,"text/uri-list")&&(F.value=decodeURIComponent(O.dataTransfer.getData("text/uri-list")),G.click());O.stopPropagation();O.preventDefault()}))}}};z=document.createElement("div");z.style.display="inline-flex";z.style.alignItems="center";z.style.gap="4px";z.style.whiteSpace="nowrap";z.appendChild(F);v.appendChild(z);null==g&&null!=h||null==u||null==a.editor.diagramFileTypes|| (z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.textOverflow="ellipsis",z.style.justifyContent="flex-end",z.style.fontSize="10pt",mxUtils.write(z,mxResources.get("type")+":"),v.appendChild(z),z=document.createElement("div"),z.style.display="inline-flex",z.style.alignItems="center",z.style.whiteSpace="nowrap",v.appendChild(z),b=FilenameDialog.createFileTypes(a,F,a.editor.diagramFileTypes),b.style.width="100%",z.appendChild(b));null!=h&&v.appendChild(h); row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=u?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");z=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=l&&l()});z.className="geBtn";null==k||a.isOffline()||row.appendChild(a.createHelpIcon(k));a.editor.cancelFirst&&row.appendChild(z);mxEvent.addListener(F,"keypress", function(H){13==H.keyCode&&G.click()});row.appendChild(G);a.editor.cancelFirst||row.appendChild(z);v.appendChild(row);x.appendChild(v);this.container=x};FilenameDialog.filenameHelpLink=null; FilenameDialog.createFileTypes=function(a,b,d){var e=document.createElement("select");for(a=0;a<d.length;a++){var g=document.createElement("option");g.setAttribute("value",a);mxUtils.write(g,mxResources.get(d[a].description)+" (."+d[a].extension+")");e.appendChild(g)}mxEvent.addListener(e,"change",function(c){c=d[e.value].extension;var h=b.value.lastIndexOf(".drawio.");h=0<h?h:b.value.lastIndexOf(".");"drawio"!=c&&(c="drawio."+c);b.value=0<h?b.value.substring(0,h+1)+c:b.value+"."+c;"createEvent"in document?(c=document.createEvent("HTMLEvents"),c.initEvent("change",!1,!0),b.dispatchEvent(c)):b.fireEvent("onchange")});a=function(c){c=b.value.toLowerCase();for(var h=0,k=0;k<d.length;k++){var p=d[k].extension,l=null;"drawio"!=p&&(l=p,p=".drawio."+p);if(c.substring(c.length-p.length-1)=="."+p||null!=l&&c.substring(c.length-l.length-1)=="."+l){h=k;break}}e.value=h};mxEvent.addListener(b,"change",a);mxEvent.addListener(b,"keyup",a);a();if(null!=Editor.defaultFileType&&"0"==e.value)for(a=0;a<d.length;a++)if(d[a].extension== Editor.defaultFileType){e.value=a;a=d[a].extension;g=b.value.lastIndexOf(".drawio.");g=0<g?g:b.value.lastIndexOf(".");"drawio"!=a&&(a="drawio."+a);b.value=0<g?b.value.substring(0,g+1)+a:b.value+"."+a;break}return e}; var WrapperWindow=function(a,b,d,e,g,c,h,k){k=null!=k?k:document.createElement("div");this.window=new mxWindow(b,k,d,e,g,c,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);a.installResizeHandler(this,!0);h(k)}; (function(){mxGraphView.prototype.validateBackgroundPage=function(){var h=this.graph;if(null!=h.container&&!h.transparentBackground){if(h.pageVisible){var k=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var p=h.container.firstChild;null!=p&&p.nodeType!=mxConstants.NODETYPE_ELEMENT;)p=p.nextSibling;null!=p&&(this.backgroundPageShape=this.createBackgroundPageShape(k),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML, this.backgroundPageShape.init(h.container),p.style.position="absolute",h.container.insertBefore(this.backgroundPageShape.node,p),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(l){h.dblClick(l)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(l){h.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l))}),mxUtils.bind(this,function(l){null!= h.tooltipHandler&&h.tooltipHandler.isHideOnHover()&&h.tooltipHandler.hide();h.isMouseDown&&!mxEvent.isConsumed(l)&&h.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l))}),mxUtils.bind(this,function(l){h.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=k,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}}; mxGraphView.prototype.validateBackgroundStyles=function(h,k,p){var l=this.graph;h=null!=h?h:1;var u=mxUtils.getLightDarkColor(null==l.background||l.background==mxConstants.NONE?l.defaultPageBackgroundColor:l.background).cssText,x=mxUtils.getLightDarkColor(l.defaultPageBorderColor).cssText,v=null!=u&&this.gridColor!=u.toLowerCase()?this.gridColor:"#ffffff",z="none",C="";"simple"==l.getAdaptiveColors()&&l.background!=mxConstants.NONE&&null!=l.background&&(u=l.background);if(l.isGridEnabled()||l.gridVisible){C= 10;mxClient.IS_SVG?(z=unescape(encodeURIComponent(this.createSvgGrid(v,h))),z=window.btoa?btoa(z):Base64.encode(z,!0),z="url(data:image/svg+xml;base64,"+z+")",C=l.gridSize*this.scale*this.gridSteps*h):z="url("+this.gridImage+")";var F=v=0;k=null!=k?k-this.translate.x*this.scale:0;p=null!=p?p-this.translate.y*this.scale:0;var G=l.gridSize*this.scale*this.gridSteps,H=k%G;G=p%G;null!=l.view.backgroundPageShape&&(F=this.getBackgroundPageBounds(),v=1+F.x,F=1+F.y);C=-Math.round(C-mxUtils.mod(this.translate.x* this.scale-v+k,C)+H*h)+"px "+-Math.round(C-mxUtils.mod(this.translate.y*this.scale-F+p,C)+G*h)+"px"}h=l.view.canvas;null!=h.ownerSVGElement&&(h=h.ownerSVGElement);v=!Editor.isDarkMode()&&l.enableDiagramBackground;null!=l.view.backgroundPageShape?(l.view.backgroundPageShape.node.style.backgroundPosition=C,l.view.backgroundPageShape.node.style.backgroundImage=z,l.view.backgroundPageShape.node.style.backgroundColor=u,l.view.backgroundPageShape.node.style.borderColor=x,l.view.backgroundPageShape.node.style.colorScheme= "none"==l.getAdaptiveColors()?"light":"",h.style.backgroundImage="none",h.style.backgroundColor="",l.container.style.backgroundColor=v?l.diagramBackgroundColor:""):(h.style.backgroundPosition=C,h.style.backgroundImage=z,"1"==urlParams.transparent?l.container.style.background="transparent":!v||null!=l.background&&l.background!=mxConstants.NONE?h.style.backgroundColor=u:(h.style.backgroundColor=l.diagramBackgroundColor,l.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(h, k){for(var p=this.graph.gridSize*this.scale*(null!=k?k:1);p<this.minGridSize;)p*=2;k=this.gridSteps*p;for(var l=[],u=1;u<this.gridSteps;u++){var x=u*p;l.push("M 0 "+x+" L "+k+" "+x+" M "+x+" 0 L "+x+" "+k)}p="M "+k+" 0 L 0 0 0 "+k+" M "+k+" 0 L "+k+" "+k+" L 0 "+k;h=mxUtils.getLightDarkColor(h);u="color-scheme: light dark;";mxClient.IS_SF&&(u="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+u+'" width="'+k+'" height="'+k+'" xmlns="'+ mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+k+'" height="'+k+'" patternUnits="userSpaceOnUse"><path d="'+l.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" opacity="0.2" stroke-width="1"/><path d="'+p+'" fill="none" style="stroke:'+mxUtils.htmlEntities(h.cssText)+';" stroke="'+h.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph= function(h,k){a.apply(this,arguments);if(null!=this.shiftPreview1){var p=this.view.canvas;null!=p.ownerSVGElement&&(p=p.ownerSVGElement);var l=this.gridSize*this.view.scale*this.view.gridSteps;l=-Math.round(l-mxUtils.mod(this.view.translate.x*this.view.scale+h,l))+"px "+-Math.round(l-mxUtils.mod(this.view.translate.y*this.view.scale+k,l))+"px";p.style.backgroundPosition=l}};mxGraph.prototype.updatePageBreaks=function(h,k,p){var l=this.view.scale,u=this.view.translate,x=this.pageFormat,v=l*this.pageScale, z=this.view.getBackgroundPageBounds();k=z.width;p=z.height;var C=new mxRectangle(l*u.x,l*u.y,x.width*v,x.height*v);u=null!=this.view.canvas&&null!=this.view.canvas.getCTM?this.view.canvas.getCTM():null;l=null!=u?u.a:1;v=null!=u?u.e:0;var F=null!=u?u.f:0;u=(h=h&&Math.min(C.width,C.height)*l>this.minPageBreakDist)?Math.ceil(p/C.height)-1:0;x=h?Math.ceil(k/C.width)-1:0;var G=z.x+k,H=z.y+p,J=0,O=u-1,M=0,V=x-1;this.pageBreakCoverage=null;h&&null!=this.container&&(k=this.container.clientWidth,p=this.container.clientHeight, v=(this.container.scrollLeft-k-v)/l-z.x,F=(this.container.scrollTop-p-F)/l-z.y,M=Math.max(0,Math.floor(v/C.width)-1),V=Math.min(x-1,Math.ceil((v+3*k/l)/C.width)),J=Math.max(0,Math.floor(F/C.height)-1),O=Math.min(u-1,Math.ceil((F+3*p/l)/C.height)),0<J||O<u-1||0<M||V<x-1)&&(this.pageBreakCoverage=new mxRectangle(this.container.scrollLeft-k/2,this.container.scrollTop-p/2,2*k,2*p));null==this.horizontalPageBreaks&&0<u&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<x&&(this.verticalPageBreaks= []);k=mxUtils.bind(this,function(Q){if(null!=Q){var ma=Q==this.horizontalPageBreaks,ia=ma?J:M,na=ma?O:V;na=h&&isFinite(ia)&&isFinite(na)?Math.max(0,Math.min(this.maxPageBreaks,na-ia+1)):0;for(var Z=0;Z<na;Z++){var da=ia+Z+1;da=ma?[new mxPoint(Math.round(z.x),Math.round(z.y+da*C.height)),new mxPoint(Math.round(G),Math.round(z.y+da*C.height))]:[new mxPoint(Math.round(z.x+da*C.width),Math.round(z.y)),new mxPoint(Math.round(z.x+da*C.width),Math.round(H))];null!=Q[Z]&&null!=Q[Z].node?(Q[Z].points=da,Q[Z].redraw()): (null!=Q[Z]&&Q[Z].destroy(),da=new mxPolyline(da,this.pageBreakColor),da.dialect=this.dialect,da.isDashed=this.pageBreakDashed,da.pointerEvents=!1,da.init(this.view.backgroundPane),da.redraw(),Q[Z]=da)}for(Z=na;Z<Q.length;Z++)null!=Q[Z]&&Q[Z].destroy();Q.splice(na,Q.length-na)}});k(this.horizontalPageBreaks);k(this.verticalPageBreaks)};var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(h,k,p){for(var l=0;l<k.length;l++){if(this.graph.isTableCell(k[l])|| this.graph.isTableRow(k[l]))return!1;if(this.graph.getModel().isVertex(k[l])){var u=this.graph.getCellGeometry(k[l]);if(null!=u&&u.relative)return!1}}return b.apply(this,arguments)};var d=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var h=d.apply(this,arguments);h.intersects=mxUtils.bind(this,function(k,p){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(h,arguments)});return h};mxGraphView.prototype.createBackgroundPageShape= function(h){return new mxRectangleShape(h,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var h=this.getGraphBounds(),k=0<h.width?h.x/this.scale-this.translate.x:0,p=0<h.height?h.y/this.scale-this.translate.y:0,l=this.graph.pageFormat,u=this.graph.pageScale,x=l.width*u;l=l.height*u;u=Math.floor(Math.min(0,k)/x);var v=Math.floor(Math.min(0,p)/l);return new mxRectangle(this.scale*(this.translate.x+u*x),this.scale*(this.translate.y+v*l),this.scale* (Math.ceil(Math.max(1,k+h.width/this.scale)/x)-u)*x,this.scale*(Math.ceil(Math.max(1,p+h.height/this.scale)/l)-v)*l)};var e=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(h,k){e.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=h+"px",this.view.backgroundPageShape.node.style.marginTop=k+"px")};var g=mxPopupMenu.prototype.addItem; mxPopupMenu.prototype.addItem=function(h,k,p,l,u,x){var v=g.apply(this,arguments);null==x||x||mxEvent.addListener(v,"mousedown",function(z){mxEvent.consume(z)});return v};var c=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(h,k,p){var l=this.graph.model.getParent(h);if(k){var u=this.graph.model.isEdge(h)?null:this.graph.getCellGeometry(h);u=!this.graph.model.isEdge(l)&&!this.graph.isSiblingSelected(h)&&(null!=u&&u.relative||!this.graph.isContainer(l)|| this.graph.isPart(h))}else if(u=c.apply(this,arguments),this.graph.isTableCell(h)||this.graph.isTableRow(h))u=l,this.graph.isTable(u)||(u=this.graph.model.getParent(u)),u=!this.graph.selectionCellsHandler.isHandled(u)||this.graph.isCellSelected(u)&&this.graph.isToggleEvent(p.getEvent())||this.graph.isCellSelected(h)&&!this.graph.isToggleEvent(p.getEvent())||this.graph.isTableCell(h)&&this.graph.isCellSelected(l);return u};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(h){h=h.getCell(); for(var k=this.graph.getModel(),p=k.getParent(h),l=this.graph.view.getState(p),u=this.graph.isCellSelected(h);null!=l&&(k.isVertex(p)||k.isEdge(p));){var x=this.graph.isCellSelected(p);u=u||x;if(x||!u&&(this.graph.isTableCell(h)||this.graph.isTableRow(h)))h=p;p=k.getParent(p)}return h}})();EditorUi=function(a,b,d){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var e=this,g=this.editor.graph;g.lightbox=d;var c=g.getGraphBounds;g.getGraphBounds=function(){var N=c.apply(this,arguments),R=this.backgroundImage;if(null!=R&&null!=R.width&&null!=R.height){var ea=this.view.translate,ba=this.view.scale;N=mxRectangle.fromRectangle(N);N.add(new mxRectangle((ea.x+R.x)*ba,(ea.y+R.y)*ba,R.width*ba,R.height*ba))}return N};g.useCssTransforms&& (this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(N,R){this.clearSelectionState()});g.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);g.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);g.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);g.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);g.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){g.isEnabled= function(){return!1};g.panningHandler.isForcePanningEvent=function(N){for(var R=N.getSource();null!=R&&R!=g.container;){if("foreignObject"===R.nodeName||"text"===R.nodeName)return!1;R=R.parentNode}return!mxEvent.isPopupTrigger(N.getEvent())};var h=g.panningHandler.start;g.panningHandler.start=function(){h.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!g.standalone){var k=!1,p=!1;this.setDefaultStyle=function(N){try{var R=g.getModel(), ea=R.isVertex(N)&&R.isEdge(R.getParent(N));R.isEdge(N)||ea?(p=!1,R.isEdge(N)&&(g.pasteEdgeStyle=!1)):(k=!1,g.pasteStylesToText=!1);var ba=g.getCellStyle(N,!1),la=[],sa=[],T;for(T in ba)la.push(ba[T]),sa.push(T);R.isEdge(N)?g.currentEdgeStyle={}:ea||(g.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",sa,"values",la,"cells",[N],"force",!0,"edgeLabel",ea));if(R.isEdge(N)||ea)p=!0,R.isEdge(N)&&(g.pasteEdgeStyle=!0);else{k=!0;var ua=R.getStyle(N);g.pasteStylesToText="string"=== typeof ua&&0<=mxUtils.indexOf(ua.split(";"),"text")}}catch(va){this.handleError(va)}};this.clearDefaultStyle=function(){g.currentEdgeStyle=mxUtils.clone(g.defaultEdgeStyle);g.currentVertexStyle=mxUtils.clone(g.defaultVertexStyle);g.pasteEdgeStyle=!1;k=p=g.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};g.addListener("cellsInserted",function(N,R){g.pasteCellStyles(g.includeDescendants(R.getProperty("cells")))});g.addListener("textInserted",function(N, R){g.pasteCellStyles(R.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var l=mxUtils.bind(this,function(N){null==N&&(N=window.event);return g.isEditing()||null!=N&&this.isSelectionAllowed(N)});document.addEventListener("selectstart",function(N){var R=mxEvent.getSource(N);R!=document.body&&R!=document.documentElement||N.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=l,this.menubarContainer.onmousedown= l,this.toolbarContainer.onselectstart=l,this.toolbarContainer.onmousedown=l,this.diagramContainer.onselectstart=l,this.diagramContainer.onmousedown=l,this.sidebarContainer.onselectstart=l,this.sidebarContainer.onmousedown=l,this.formatContainer.onselectstart=l,this.formatContainer.onmousedown=l,null!=this.tabContainer&&(this.tabContainer.onselectstart=l),mxClient.IS_IOS&&(b=function(){var N=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var R=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); try{N=[parseInt(R[1],10),parseInt(R[2],10),parseInt(R[3]||0,10)]}catch(ea){}}return N}(),null!=b&&16<=b[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","none"),null!=this.tabContainer&&mxUtils.setPrefixedStyle(this.tabContainer.style,"userSelect","none")))); !this.editor.chromeless||this.editor.editable?this.diagramContainer.oncontextmenu=function(N){if(null!=N){var R=mxEvent.getSource(N);if("A"==R.nodeName)for(;null!=R;){if("geHint"==R.className)return!0;R=R.parentNode}}return l(N)}:g.panningHandler.usePopupTrigger=!1;g.init(this.diagramContainer);mxClient.IS_SVG&&null!=g.view.getDrawPane()&&(b=g.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.position="absolute"));this.hoverIcons=this.createHoverIcons();this.inlineToolbar=Editor.enableInlineToolbar? this.createInlineToolbar():null;this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(N,R){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(N,R){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=g.graphHandler){var u=g.graphHandler.start;g.graphHandler.start=function(N){null!=e.hoverIcons&&e.hoverIcons.reset();null!=e.inlineToolbar&& null!=N&&e.inlineToolbar.hide();u.apply(this,arguments)};var x=g.graphHandler.mouseUp;g.graphHandler.mouseUp=function(){x.apply(this,arguments);null!=e.inlineToolbar&&e.inlineToolbar.updateSelection()}}var v=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=e.inlineToolbar&&e.inlineToolbar.hide();v.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){z.apply(this,arguments);null!=e.inlineToolbar&&e.inlineToolbar.updateSelection()}; var C=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start=function(){null!=e.inlineToolbar&&e.inlineToolbar.hide();C.apply(this,arguments)};var F=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(){F.apply(this,arguments);null!=e.inlineToolbar&&e.inlineToolbar.updateSelection()};mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(N){var R=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(N)-R.x-this.diagramContainer.clientWidth|| 0<mxEvent.getClientY(N)-R.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var G=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(N,R){return e.isSpaceDown()||G.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(N){if(Editor.passiveScroll){var R=mxEvent.getSource(N);if(null==g.container||R!=g.container&&!g.container.contains(R)&&!g.isEditing())return}16== N.which?this.shiftDown=!0:32!=N.which||g.isEditing()?mxEvent.isConsumed(N)||27!=N.keyCode||(null!=this.sidebar&&null!=this.sidebar.tooltip&&"none"!=this.sidebar.tooltip.style.display&&null!=this.sidebar.tooltipCloseImage&&"none"!=this.sidebar.tooltipCloseImage.style.display?(this.sidebar.hideTooltip(),mxEvent.consume(N)):this.hideDialog(null,!0)):(R=mxEvent.getSource(N),"INPUT"==R.nodeName||"TEXTAREA"==R.nodeName||"SELECT"==R.nodeName||R.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(), null!=g.container&&(g.container.style.cursor="move"),mxEvent.consume(N)))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(N){null!=g.container&&(g.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var H=g.panningHandler.isForcePanningEvent;g.panningHandler.isForcePanningEvent=function(N){return null!=g.freehand&&g.freehand.isActive()?!1:H.apply(this,arguments)||e.isSpaceDown()|| mxEvent.isMouseEvent(N.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(N.getEvent()))&&(!mxEvent.isControlDown(N.getEvent())&&mxEvent.isRightMouseButton(N.getEvent())||mxEvent.isMiddleMouseButton(N.getEvent()))};var J=g.cellEditor.isStopEditingEvent;g.cellEditor.isStopEditingEvent=function(N){return J.apply(this,arguments)||13==N.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(N)||mxClient.IS_MAC&&mxEvent.isMetaDown(N)||mxClient.IS_SF&&mxEvent.isShiftDown(N))};var O=g.isZoomWheelEvent; g.isZoomWheelEvent=function(){return e.isSpaceDown()||O.apply(this,arguments)};var M=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var N=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,R=this.toolbar.container.firstChild;null!=R;){var ea=R.getAttribute("data-min-width");null!=ea&&parseInt(ea)>N?R.style.display="none":R.style.display="";R=R.nextSibling}}),V=!1,Q=null,ma=null,ia=null,na=mxUtils.bind(this,function(){if(null!=this.toolbar&&V!=g.cellEditor.isContentEditing()){for(var N= this.toolbar.container.firstChild,R=[];null!=N;){var ea=N.nextSibling;N.parentNode.removeChild(N);R.push(N);N=ea}N=this.toolbar.fontMenu;ea=this.toolbar.sizeMenu;if(null==ia)this.toolbar.createTextToolbar();else{for(var ba=0;ba<ia.length;ba++)this.toolbar.container.appendChild(ia[ba]);this.toolbar.fontMenu=Q;this.toolbar.sizeMenu=ma}V=g.cellEditor.isContentEditing();Q=N;ma=ea;ia=R;M()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged(); this.updateStatusAgain();na()}));this.addListener("currentThemeChanged",M);mxEvent.addListener(window,"resize",M);M();g.isTouchPopupMenuEnabled=function(){return null==e.dialog};var Z=g.cellEditor.startEditing;g.cellEditor.startEditing=function(){Z.apply(this,arguments);na();if(g.cellEditor.isContentEditing()){var N=!1,R=function(){N||(N=!0,window.setTimeout(function(){var ea=g.getSelectedEditingElement();null!=ea&&(ea=mxUtils.getCurrentStyle(ea),null!=ea&&null!=e.toolbar&&(e.toolbar.setFontName(mxUtils.getCssFontFamily(ea.fontFamily)), e.toolbar.setFontSize(parseInt(ea.fontSize))));N=!1},0))};mxEvent.addListener(g.cellEditor.textarea,"input",R);mxEvent.addListener(g.cellEditor.textarea,"touchend",R);mxEvent.addListener(g.cellEditor.textarea,"mouseup",R);mxEvent.addListener(g.cellEditor.textarea,"keyup",R);R()}};var da=g.cellEditor.stopEditing;g.cellEditor.stopEditing=function(N,R){try{da.apply(this,arguments),na()}catch(ea){e.handleError(ea)}};g.container.setAttribute("tabindex","0");g.container.style.cursor="default";if(window.self=== window.top&&null!=g.container.parentNode)try{g.container.focus()}catch(N){}var pa=g.fireMouseEvent;g.fireMouseEvent=function(N,R,ea){try{N==mxEvent.MOUSE_DOWN&&this.container.focus(),pa.apply(this,arguments)}catch(ba){e.handleError(ba)}};var ka=g.foldCells;g.foldCells=function(N,R,ea,ba,la){try{ka.apply(this,arguments)}catch(sa){e.handleError(sa)}};g.popupMenuHandler.autoExpand=!0;null!=this.menus&&(g.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(N,R,ea){this.menus.createPopupMenu(N,R, ea)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(N){g.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};g.connectionHandler.addListener(mxEvent.CONNECT,function(N,R){var ea=[R.getProperty("cell")];R.getProperty("terminalInserted")&&(ea.push(R.getProperty("terminal")),window.setTimeout(function(){null!=e.hoverIcons&&e.hoverIcons.update(g.view.getState(ea[ea.length-1]))},0));g.pasteCellStyles(ea)});var S=null, U=null;a=mxUtils.bind(this,function(){if(null!=this.toolbar){var N=this.getSelectionState();if(g.isEnabled()&&0<N.edges.length){if(null!=this.toolbar.edgeStyleMenu){var R=this.getImageForEdgeStyle(N.style);1==N.edges.length&&"arrow"==N.style[mxConstants.STYLE_SHAPE]&&(R=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+R+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(N.style)+")")}else null!= this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+S+")"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+U+")")}});g.selectionModel.addListener(mxEvent.CHANGE,a);g.getModel().addListener(mxEvent.CHANGE,a);this.addListener("styleChanged",mxUtils.bind(this,function(N,R){N=R.getProperty("force");(this.updateDefaultStyle||N)&&g.copyCellStyles(R.getProperty("cells"),R.getProperty("keys"),R.getProperty("values"),g.currentVertexStyle, g.currentEdgeStyle,k,p,R.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(g.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(g.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),R=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(S=this.getImageForEdgeStyle(g.currentEdgeStyle),0==R.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+S+")")),null!=this.toolbar.edgeShapeMenu&&(U=this.getImageForEdgeShape(g.currentEdgeStyle), 0==R.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+U+")")))}));null!=this.toolbar&&(a=mxUtils.bind(this,function(){var N=g.currentVertexStyle.fontFamily||"Helvetica",R=String(g.currentVertexStyle.fontSize||"12"),ea=g.getView().getState(g.getSelectionCell());null!=ea&&(N=ea.style[mxConstants.STYLE_FONTFAMILY]||N,R=ea.style[mxConstants.STYLE_FONTSIZE]||R,10<N.length&&(N=N.substring(0,8)+"..."));this.toolbar.setFontName(N);this.toolbar.setFontSize(R)}),g.getSelectionModel().addListener(mxEvent.CHANGE, a),g.getModel().addListener(mxEvent.CHANGE,a));g.addListener(mxEvent.CELLS_ADDED,function(N,R){N=R.getProperty("cells");R=R.getProperty("parent");null!=R&&g.getModel().isLayer(R)&&!g.isCellVisible(R)&&null!=N&&0<N.length&&g.getModel().setVisible(R,!0)});Graph.selectParentLayer&&g.selectionModel.addListener(mxEvent.CHANGE,function(){if(g.isEnabled()&&!g.isSelectionEmpty()){var N=g.getLayerForCells(g.getSelectionCells());null!=N&&g.setDefaultParent(N)}});this.gestureHandler=mxUtils.bind(this,function(N){this.isHideCurrentMenuEvent(N)&& this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var Y=null;this.resizeHandler=mxUtils.bind(this,function(){null!=Y&&window.clearTimeout(Y);Y=window.setTimeout(mxUtils.bind(this,function(){Y=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(){g.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){g.view.validateBackground()}));g.addListener("gridSizeChanged",mxUtils.bind(this, function(){g.isGridEnabled()&&g.view.validateBackground()}));this.editor.resetGraph()}this.init();g.standalone||this.open()};EditorUi.compactUi=!0; EditorUi.parsePng=function(a,b,d){function e(k,p){var l=c;c+=p;return k.substring(l,c)}function g(k){k=e(k,4);return k.charCodeAt(3)+(k.charCodeAt(2)<<8)+(k.charCodeAt(1)<<16)+(k.charCodeAt(0)<<24)}var c=0;if(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(e(a,4),"IHDR"!=e(a,4))null!=d&&d();else{e(a,17);do{d=g(a);var h=e(a,4);if(null!=b&&b(c-8,h,d))break;value=e(a,d);e(a,4);if("IEND"==h)break}while(d)}};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"]?232:242);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 a=this.editor.graph;if(!a.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();var b=null;mxEvent.addListener(a.container,"scroll",mxUtils.bind(this,function(){a.tooltipHandler.hide();null!=a.connectionHandler&&null!=a.connectionHandler.constraintHandler&&a.connectionHandler.constraintHandler.reset();if(null!=a.pageBreakCoverage&&null==b){var g=a.pageBreakCoverage,c=a.container;if(c.scrollLeft<g.x||c.scrollTop<g.y||c.scrollLeft+c.clientWidth> g.x+g.width||c.scrollTop+c.clientHeight>g.y+g.height)b=window.requestAnimationFrame(function(){b=null;a.updatePageBreaks(a.pageBreaksVisible,0,0)})}}));a.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){a.tooltipHandler.hide();var g=a.getRubberband();null!=g&&g.cancel()}));mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(g){this.onKeyDown(g);this.onKeyPress(g)}));this.installTypingShim();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 d=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){d.apply(this,arguments);e.updateActionStates()};a.showLinkDialog=mxUtils.bind(e,e.showLinkDialog);a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.editor.chromeless&&!this.editor.editable||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(),d=this.initSelectionState(),e=!0,g=0;g<b.length;g++){var c=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(c,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(d,b[g],b,e),e=!1)}this.updateSelectionStateForTableCells(d);if(Editor.enableCustomProperties){d.customProperties=Object.create(null);a=d.vertices;b=d.edges;for(g=0;g<a.length;g++)this.findCommonProperties(a[g],d.customProperties, 0==g,d);for(g=0;g<b.length;g++)this.findCommonProperties(b[g],d.customProperties,0==a.length&&0==g,d)}return d}; EditorUi.prototype.findCommonProperties=function(a,b,d,e){e=mxUtils.bind(this,function(x){if(null!=x)if(d)for(var v=0;v<x.length;v++)b[x[v].name]=x[v];else for(var z in b)if(null!=z){var C=!1;for(v=0;v<x.length;v++)if(x[v].name==z&&x[v].type==b[z].type){C=!0;break}C||delete b[z]}});var g=this.editor.graph,c=g.view.getState(a);if(null!=c&&null!=c.shape){if(!c.shape.commonCustomPropAdded){c.shape.commonCustomPropAdded=!0;c.shape.customProperties=c.shape.customProperties||[];if(null!=c.shape&&null!= c.shape.stencil&&null!=c.shape.stencil.desc){var h=c.shape.stencil,k=[],p=mxUtils.bind(this,function(x){x=h.desc.getElementsByTagName(x);for(var v=[],z=0;z<x.length;z++){var C=x[z].getAttribute("color");if(!mxUtils.isValidColor(C)&&!k[C]&&"fill"!=C&&"stroke"!=C&&"font"!=C){k[C]=!0;var F=x[z].getAttribute("name");F=null!=F?F:Editor.getLabelForStylename(C);var G=x[z].getAttribute("default"),H=h.getDefaultColorValue(x[z],g),J=G;G==mxConstants.NONE&&(G="default");v.push({name:C,type:"color",primary:"false"!= x[z].getAttribute("primary"),defVal:G,defaultColor:H,undefinedColor:J,dispName:F})}}return v});Array.prototype.push.apply(c.shape.customProperties,p("fillcolor"));Array.prototype.push.apply(c.shape.customProperties,p("strokecolor"));Array.prototype.push.apply(c.shape.customProperties,p("fontcolor"));p=h.desc.getElementsByTagName("labelBounds");for(var l=0;l<p.length;l++){var u=p[l].getAttribute("if");null==u||k[u]||(k[u]=!0,c.shape.customProperties.push({name:u,dispName:"boundedLbl"==u?"Bounded Label": Editor.getLabelForStylename(u),type:"bool",defVal:!1}))}}c.cell.vertex?Array.prototype.push.apply(c.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(c.shape.customProperties,Editor.commonEdgeProperties)}e(c.shape.customProperties)}a=a.getAttribute("customProperties");if(null!=a)try{e(JSON.parse(a))}catch(x){}}; 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,transparentBounds:!1,unlocked:this.editor.graph.isEnabled(),connections:!1,connectedEdges:!1}}; EditorUi.prototype.updateSelectionStateForTableCells=function(a){if(1<a.cells.length&&a.cell){var b=mxUtils.sortCells(a.cells),d=this.editor.graph.model,e=d.getParent(b[0]),g=d.getParent(e);if(null!=e&&null!=g){for(var c=e.getIndex(b[0]),h=g.getIndex(e),k=null,p=1,l=1,u=0,x=h<g.getChildCount()-1?d.getChildAt(d.getChildAt(g,h+1),c):null;u<b.length-1;){var v=b[++u];null==x||x!=v||null!=k&&p!=k||(k=p,p=0,l++,e=d.getParent(x),x=h+l<g.getChildCount()?d.getChildAt(d.getChildAt(g,h+l),c):null);var z=this.editor.graph.view.getState(v); if(v==d.getChildAt(e,c+p)&&null!=z&&1==mxUtils.getValue(z.style,"colspan",1)&&1==mxUtils.getValue(z.style,"rowspan",1))p++;else break}u==l*p-1&&(a.mergeCell=b[0],a.colspan=p,a.rowspan=l)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor&&null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)}; EditorUi.prototype.createTimeout=function(a,b,d){var e=!0,g=null,c=mxUtils.bind(this,function(k){g.clear()&&(e=!1,k=null!=k?k:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(a,b,d)})},null!=d?d(k):this.handleError(k))}),h=window.setTimeout(c,null!=a?a:this.timeout);g={clear:function(){window.clearTimeout(h);return e},isAlive:function(){return e}};null!=b&&this.tryAndHandle(mxUtils.bind(this,function(){b(g)}),c);return g}; EditorUi.prototype.tryAndHandle=function(a,b){try{a()}catch(d){null!=b?b(d):this.handleError(d)}}; EditorUi.prototype.removeUserDefinedDarkColors=function(a,b,d){var e=this.editor.graph;a=null!=a?a:e.getSelectionCells();var g=Graph.colorStyles;b||(g=g.filter(function(v){return v!=mxConstants.STYLE_FONTCOLOR&&v!=mxConstants.STYLE_LABEL_BORDERCOLOR&&v!=mxConstants.STYLE_LABEL_BACKGROUNDCOLOR}));var c=document.createElement("div");e.model.beginUpdate();try{for(var h=0;h<a.length;h++)if(e.model.isEdge(a[h])||e.model.isVertex(a[h])){var k=e.getCellStyle(a[h],!1);if(null!=k)for(var p=0;p<g.length;p++)try{var l= k[g[p]];if(mxUtils.isLightDarkColor(l)){var u=mxUtils.getLightDarkColor(l);e.setCellStyles(g[p],u.light,[a[h]])}}catch(v){}b&&e.isHtmlLabel(a[h])&&"0"!=mxUtils.getValue(k,"html","0")&&(c.innerHTML=Graph.sanitizeHtml(e.getLabel(a[h])),Graph.addLightDarkColors(c,null,null,function(v,z,C){return mxUtils.isLightDarkColor(C)?(C=mxUtils.getLightDarkColor(C),v.style.setProperty(z,C.light),!0):!1})&&e.cellLabelChanged(a[h],c.innerHTML))}if(d&&mxUtils.isLightDarkColor(e.background)){u=mxUtils.getLightDarkColor(e.background); var x=new ChangePageSetup(this,u.light);x.ignoreImage=!0;e.model.execute(x)}}finally{e.model.endUpdate()}return a}; EditorUi.prototype.updateSelectionStateForCell=function(a,b,d,e){d=this.editor.graph;a.cells.push(b);if(d.getModel().isVertex(b)){a.connections=0<d.model.getEdgeCount(b);a.unlocked=a.unlocked&&!d.isCellLocked(b);a.resizable=a.resizable&&d.isCellResizable(b);a.rotatable=a.rotatable&&d.isCellRotatable(b);a.movable=a.movable&&d.isCellMovable(b)&&!d.isTableRow(b)&&!d.isTableCell(b);a.swimlane=a.swimlane||d.isSwimlane(b);a.transparentBounds=a.transparentBounds||d.isTransparentBounds(b);a.table=a.table|| d.isTable(b);a.cell=a.cell||d.isTableCell(b);a.row=a.row||d.isTableRow(b);a.vertices.push(b);var g=d.getCellGeometry(b);if(null!=g&&(0<g.width?null==a.width?a.width=g.width:a.width!=g.width&&(a.width=""):a.containsLabel=!0,0<g.height?null==a.height?a.height=g.height:a.height!=g.height&&(a.height=""):a.containsLabel=!0,!g.relative||null!=g.offset)){var c=g.relative?g.offset.x:g.x;g=g.relative?g.offset.y:g.y;null==a.x?a.x=c:a.x!=c&&(a.x="");null==a.y?a.y=g:a.y!=g&&(a.y="")}}else d.getModel().isEdge(b)&& (a.edges.push(b),a.connections=!0,a.resizable=!1,a.rotatable=!1,a.movable=!1,a.connectedEdges=a.connectedEdges||null!=d.model.getTerminal(b,!0)||null!=d.model.getTerminal(b,!1));c=d.view.getState(b);null!=c&&(a.html=a.html&&d.isHtmlLabel(b),a.autoSize=a.autoSize||d.isAutoSizeState(c),a.glass=a.glass&&d.isGlassState(c),a.rounded=a.rounded&&d.isRoundedState(c),a.lineJumps=a.lineJumps&&d.isLineJumpState(c),a.image=a.image||d.isImageState(c),a.shadow=a.shadow&&d.isShadowState(c),a.fill=a.fill&&d.isFillState(c), a.gradient=a.fill&&d.isGradientState(c),a.stroke=a.stroke&&d.isStrokeState(c),b=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null),a.containsImage=a.containsImage||"image"==b,d.mergeStyle(c.style,a.style,e))}; EditorUi.prototype.installShapePicker=function(){var a=this.editor.graph,b=this;a.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(l,u){"mouseDown"==u.getProperty("eventName")&&b.hideShapePicker()}));var d=mxUtils.bind(this,function(){b.hideShapePicker(!0)});a.addListener("wheel",d);a.addListener(mxEvent.ESCAPE,d);a.view.addListener(mxEvent.SCALE,d);a.view.addListener(mxEvent.SCALE_AND_TRANSLATE,d);a.getSelectionModel().addListener(mxEvent.CHANGE,d);var e=a.popupMenuHandler.isMenuShowing; a.popupMenuHandler.isMenuShowing=function(){return e.apply(this,arguments)||null!=b.shapePicker||null!=b.currentMenu};var g=a.dblClick;a.dblClick=function(l,u){if(this.isEnabled()){var x=null==u||null==b.sidebar||mxEvent.isShiftDown(l)||a.isCellLocked(u)||null!=a.getLockedGroupAncestor(a.model.getParent(u))?null:b.getDoubleClickTerminalForEvent(l,u);if(null!=u||null==b.sidebar||mxEvent.isShiftDown(l)||a.isCellLocked(a.getDefaultParent()))null!=x?(mxEvent.consume(l),window.setTimeout(mxUtils.bind(this, function(){b.showShapePickerForEdgeTerminal(u,x.source,x.point)}),30)):g.apply(this,arguments);else{var v=mxUtils.convertPoint(this.container,mxEvent.getClientX(l),mxEvent.getClientY(l));mxEvent.consume(l);window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(v.x,v.y)}),30)}}};a.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(l,u){var x=u.getProperty("cell"),v=u.getProperty("point");if(null!=x&&null!=v&&!a.isCellLocked(x)&&null==a.getLockedGroupAncestor(a.model.getParent(x))){var z= u.getProperty("source");window.setTimeout(mxUtils.bind(this,function(){b.showShapePickerForEdgeTerminal(x,z,v)}),30)}}));if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",mxUtils.bind(this,function(){null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null,b.hideShapePicker(!0))}));var c=this.hoverIcons.drag;this.hoverIcons.drag=function(){b.hideShapePicker();c.apply(this,arguments)};var h=this.hoverIcons.execute;this.hoverIcons.execute=function(l,u,x){var v= x.getEvent();this.graph.isCloneEvent(v)||mxEvent.isShiftDown(v)?h.apply(this,arguments):this.graph.connectVertex(l.cell,u,this.graph.defaultEdgeLength,v,null,null,mxUtils.bind(this,function(z,C,F){var G=a.getCompositeParent(l.cell);z=a.getCellGeometry(G);for(x.consume();null!=G&&a.model.isVertex(G)&&null!=z&&z.relative;)cell=G,G=a.model.getParent(cell),z=a.getCellGeometry(G);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=b.showShapePicker(x.getGraphX(),x.getGraphY(),G,mxUtils.bind(this, function(H){F(H);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(H))}),u)}),30)}),mxUtils.bind(this,function(z){this.graph.selectCellsForConnectVertex(z,v,this)}))};var k=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(l,u){null!=k&&window.clearTimeout(k);k=window.setTimeout(mxUtils.bind(this,function(){var x=u.getProperty("arrow"),v=u.getProperty("direction"),z=u.getProperty("event");x=x.getBoundingClientRect();var C=mxUtils.getOffset(a.container),F=a.container.scrollLeft+ x.x-C.x;C=a.container.scrollTop+x.y-C.y;var G=a.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),H=b.showShapePicker(F,C,G,mxUtils.bind(this,function(J){null!=J&&a.connectVertex(G,v,a.defaultEdgeLength,z,!0,!1,null,function(O){a.selectCellsForConnectVertex(O);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(J))},J)}),v,!0);null!=H&&(this.centerShapePicker(H,x,F,C,v),this.hoverIcons.shapePickerHoverDiv=H,mxUtils.setOpacity(H,30),mxEvent.addListener(H, "mouseenter",function(){mxUtils.setOpacity(H,100)}),mxEvent.addListener(H,"mouseleave",function(){b.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(l,u){null!=k&&window.clearTimeout(k)}))}var p=!1;a.addMouseListener({mouseDown:mxUtils.bind(this,function(l,u){p=!1}),mouseMove:mxUtils.bind(this,function(l,u){null!=a.connectHandleClickState&&null!=a.connectionHandler&&null!=a.connectionHandler.shape&&(p=!0)}),mouseUp:mxUtils.bind(this, function(l,u){l=a.connectHandleClickState;a.connectHandleClickState=null;if(null!=l&&!p){var x=u.getEvent();if(!a.isCloneEvent(x)&&!mxEvent.isShiftDown(x)){for(var v=mxConstants.DIRECTION_EAST,z=a.getCompositeParent(l.cell),C=a.getCellGeometry(z);null!=z&&a.model.isVertex(z)&&null!=C&&C.relative;)z=a.model.getParent(z),C=a.getCellGeometry(z);a.connectVertex(l.cell,v,a.defaultEdgeLength,x,null,!0,mxUtils.bind(this,function(F,G,H){u.consume();window.setTimeout(mxUtils.bind(this,function(){b.showShapePicker(u.getGraphX(), u.getGraphY(),z,mxUtils.bind(this,function(J){H(J);null!=b.hoverIcons&&b.hoverIcons.update(a.view.getState(J))}),v)}),30)}),mxUtils.bind(this,function(F){a.selectCellsForConnectVertex(F,x)}))}}p=!1})})}; EditorUi.prototype.getDoubleClickTerminalForEvent=function(a,b){var d=this.editor.graph;if(null!=a&&null!=b&&d.model.isEdge(b)){var e=d.view.getState(b);if(null!=e&&null!=e.absolutePoints&&2<=e.absolutePoints.length){a=mxUtils.convertPoint(d.container,mxEvent.getClientX(a),mxEvent.getClientY(a));for(var g=d.tolerance+mxConstants.HANDLE_SIZE,c=0;2>c;c++){var h=0==c;if(null==d.model.getTerminal(b,h)){var k=e.absolutePoints[h?0:e.absolutePoints.length-1];if(null!=k&&Math.abs(k.x-a.x)<=g&&Math.abs(k.y- a.y)<=g)return{point:k.clone(),source:h}}}}}return null}; EditorUi.prototype.showShapePickerForEdgeTerminal=function(a,b,d){var e=this,g=this.editor.graph;this.showShapePicker(d.x,d.y,null,mxUtils.bind(this,function(c){if(null!=c){var h=c.geometry;null!=h&&(h.x=g.snap(Math.round(d.x/g.view.scale)-g.view.translate.x-h.width/2),h.y=g.snap(Math.round(d.y/g.view.scale)-g.view.translate.y-h.height/2));g.model.beginUpdate();try{g.addCell(c);g.model.isVertex(c)&&g.isAutoSizeCell(c)&&g.updateCellSize(c);g.model.setTerminal(a,c,b);var k=g.getCellGeometry(a);null!= k&&null!=k.getTerminalPoint(b)&&(k=k.clone(),k.setTerminalPoint(null,b),g.model.setGeometry(a,k))}finally{g.model.endUpdate()}g.setSelectionCell(c);g.scrollCellToVisible(c);g.startEditing(c);null!=e.hoverIcons&&e.hoverIcons.update(g.view.getState(c))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:a,source:b})}; EditorUi.prototype.centerShapePicker=function(a,b,d,e,g){if(g==mxConstants.DIRECTION_EAST||g==mxConstants.DIRECTION_WEST)a.style.width="40px";var c=a.getBoundingClientRect();g==mxConstants.DIRECTION_NORTH?(d-=c.width/2-10,e-=c.height+6):g==mxConstants.DIRECTION_SOUTH?(d-=c.width/2-10,e+=b.height+6):g==mxConstants.DIRECTION_WEST?(d-=c.width+6,e-=c.height/2-10):g==mxConstants.DIRECTION_EAST&&(d+=b.width+6,e-=c.height/2-10);a.style.left=d+"px";a.style.top=e+"px"}; EditorUi.prototype.showShapePicker=function(a,b,d,e,g,c,h,k,p,l,u){var x=null;this.editor.graph.freehand.isDrawing()||(k=k||null==d,l=null!=l?l:this.getCellsForShapePicker(d,c,k),x=this.createShapePicker(a,b,d,e,g,mxUtils.bind(this,function(){this.hideShapePicker()}),l,c,h,k,p,u),null!=x&&(null==this.hoverIcons||c||this.hoverIcons.reset(),a=this.editor.graph,a.popupMenuHandler.hideMenu(),a.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=e,this.shapePicker= x));return x}; EditorUi.prototype.createShapePicker=function(a,b,d,e,g,c,h,k,p,l,u,x){u=null!=u?u:!0;var v=this.editor.graph,z=null;p=null!=p?p:function(G){G=G[0];var H=0,J=0,O=G.geometry;null!=O&&(v.model.isEdge(G)&&(G=O.getTerminalPoint(!1),O=new mxRectangle(0,0,G.x,G.y)),H=O.width/2,J=O.height/2);return new mxPoint(v.snap(Math.round(a/v.view.scale)-v.view.translate.x-H),v.snap(Math.round(b/v.view.scale)-v.view.translate.y-J))};if(null!=h&&0<h.length){var C=this;v=this.editor.graph;z=document.createElement("div");g= v.view.getState(d);var F=null==d||null!=g&&v.isTransparentState(g)?null:v.copyStyle(d);z.className="geShapePicker";z.setAttribute("title",mxResources.get("sidebarTooltip"));z.style.left=Math.round(a)+"px";z.style.top=Math.round(b)+"px";mxClient.IS_POINTER&&(z.style.touchAction="none");k||mxUtils.setPrefixedStyle(z.style,"transform","translate(-22px,-22px)");v.container.appendChild(z);g=mxUtils.bind(this,function(G){var H=document.createElement("a");z.appendChild(H);var J=G.shapePickerKeepStyle;delete G.shapePickerKeepStyle; J||(null!=F&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(F,[G]):this.sidebar.graph.pasteCellStyles([G],v.currentVertexStyle,v.currentEdgeStyle,null,null,v.pasteStylesToText));J=G.geometry;v.model.isEdge(G)&&(J=J.getTerminalPoint(!1),J=new mxRectangle(0,0,J.x,J.y));null!=J&&(J=this.sidebar.createVertexTemplateFromCells([G],J.width,J.height,"",!0,!1,null,!0,mxUtils.bind(this,function(O){if(!mxEvent.isAltDown(O)||1!=v.getSelectionCount()){if(!mxEvent.isShiftDown(O)||null==d&&v.isSelectionEmpty()){var M= v.cloneCell(G);if(null!=e)e(M);else{var V=p([M]);v.model.isEdge(M)?M.geometry.translate(V.x,V.y):(M.geometry.x=V.x,M.geometry.y=V.y);v.model.beginUpdate();try{v.addCell(M),v.model.isVertex(M)&&v.isAutoSizeCell(M)&&v.updateCellSize(M)}finally{v.model.endUpdate()}v.setSelectionCell(M);v.scrollCellToVisible(M);u&&v.startEditing(M);null!=C.hoverIcons&&C.hoverIcons.update(v.view.getState(M))}}else M=v.getEditableCells(null!=d?[d]:v.getSelectionCells()),v.updateShapes(G,M);null!=c&&c(O);mxEvent.consume(O)}}), 25,25,null,null,d,x),J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",H.appendChild(J))});for(l=0;l<(k?Math.min(h.length,4):h.length);l++)g(h[l]);h=z.offsetTop+z.clientHeight-(v.container.scrollTop+v.container.offsetHeight);0<h&&(z.style.top=Math.max(v.container.scrollTop+22,b-h)+"px");h=z.offsetLeft+z.clientWidth-(v.container.scrollLeft+v.container.offsetWidth);0<h&&(z.style.left=Math.max(v.container.scrollLeft+22,a-h)+"px")}return z}; EditorUi.prototype.defaultShapePickerEntries=null; EditorUi.prototype.getCellsForShapePicker=function(a,b,d){var e=this.editor.graph,g=mxUtils.bind(this,function(x,v,z,C){return e.createVertex(null,null,C||"",0,0,v||120,z||60,x,!1)});b=mxUtils.bind(this,function(x,v,z){x=new mxCell(z||"",new mxGeometry(0,0,e.defaultEdgeLength+20,0),x);x.geometry.setTerminalPoint(new mxPoint(0,0),!0);x.geometry.setTerminalPoint(new mxPoint(x.geometry.width,null!=v?v:0),!1);x.geometry.points=null!=v?[new mxPoint(x.geometry.width/2,v)]:[];x.geometry.relative=!0;x.edge= !0;return x});if(null!=a)try{a=e.cloneCell(a),e.model.isVertex(a)&&null!=a.geometry&&(a.geometry.x=0,a.geometry.y=0)}catch(x){a=null}if(null!=this.defaultShapePickerEntries){for(var c=[],h=[],k=function(x){if(null!=x&&"object"===typeof x){var v=mxUtils.createXmlDocument().createElement("UserObject"),z;for(z in x)x.hasOwnProperty(z)&&v.setAttribute(z,x[z]);null==v.getAttribute("label")&&v.setAttribute("label","");return v}return x},p=0;p<this.defaultShapePickerEntries.length;p++){var l=this.defaultShapePickerEntries[p]; if(null!=l&&null!=l.style){var u=k(l.value);l.edge?h.push(b(l.style,l.y,u)):(u=g(l.style,l.width,l.height,u),l.keepStyle&&(u.shapePickerKeepStyle=!0),c.push(u))}}null!=a&&(c[0]=a);a=c;d&&(a=a.concat(h));return a}null==a&&(a=g(e.appendFontSize(Editor.defaultTextStyle,e.vertexFontSize),60,30,"Text"));a=[a,g("whiteSpace=wrap;html=1;"),g("ellipse;whiteSpace=wrap;html=1;shapeInside=1;",80,80),g("rhombus;whiteSpace=wrap;html=1;shapeInside=1;",80,80),g("rounded=1;whiteSpace=wrap;html=1;"),g("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;"), g("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,60),g("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,80),g("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,80),g("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),g("triangle;whiteSpace=wrap;html=1;shapeInside=1;",60,80),g("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),g("shape=tape;whiteSpace=wrap;html=1;", 120,100),g("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),g("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),g("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];d&&(a=a.concat([b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),b("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"), b("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return a};EditorUi.prototype.isShapePickerVisible=function(a){return null!=this.shapePicker}; EditorUi.prototype.hideShapePicker=function(a){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,null!=this.hoverIcons&&null!=this.hoverIcons.shapePickerHoverDiv&&(this.hoverIcons.shapePickerHoverDiv=null),a||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(a){var b=this.editor.graph;if(9==a.which&&b.isEnabled()&&!mxEvent.isControlDown(a)){if(b.isEditing())if(mxEvent.isAltDown(a))b.stopEditing(!1);else try{var d=b.cellEditor.isContentEditing()&&b.cellEditor.isTextSelected();if(window.getSelection&&b.cellEditor.isContentEditing()&&!d){var e=window.getSelection(),g=0<e.rangeCount?e.getRangeAt(0).commonAncestorContainer:null;d=null!=g&&("LI"==g.nodeName||null!=g.parentNode&&"LI"==g.parentNode.nodeName)}d?document.execCommand(mxEvent.isShiftDown(a)? "outdent":"indent",!1,null):mxEvent.isShiftDown(a)?b.stopEditing(!1):b.cellEditor.insertTab(b.cellEditor.isContentEditing()?null:4)}catch(c){}else mxEvent.isAltDown(a)?b.selectParentCell():b.selectCell(!mxEvent.isShiftDown(a));mxEvent.consume(a)}}; EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;null!=this.typingShim&&mxEvent.getSource(a)===this.typingShim||!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(null==a.key||1!==a.key.length)&&229!==a.keyCode||null!=this.keyHandler&&null!=this.keyHandler.getFunction(a)||(b.escape(),b.cellEditor.editByTyping=!0,b.startEditing())}; EditorUi.prototype.installTypingShim=function(){var a=this.editor.graph,b=document.createElement("textarea");b.setAttribute("autocomplete","off");b.setAttribute("autocorrect","off");b.setAttribute("autocapitalize","off");b.setAttribute("spellcheck","false");(mxClient.IS_ANDROID||mxClient.IS_IOS||"ontouchstart"in document.documentElement&&1<navigator.maxTouchPoints)&&b.setAttribute("inputmode","none");b.tabIndex=-1;b.className="mxTypingShim";b.style.cssText="position:absolute;overflow:hidden;resize:none;outline:none;border:none;padding:0;margin:0;z-index:1;width:4px;height:1em;opacity:0;pointer-events:none;"; this.typingShim=b;var d=!1,e=mxUtils.bind(this,function(){if(!d&&0<b.value.length){var c=b.value;b.value="";this.hideTypingShim();a.escape();a.cellEditor.editByTyping=!0;a.startEditing(null,c)}});mxEvent.addListener(b,"compositionstart",function(){d=!0});mxEvent.addListener(b,"compositionend",function(){d=!1;e()});mxEvent.addListener(b,"input",function(){e()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(c){229!==c.keyCode&&(mxEvent.isControlDown(c)||mxEvent.isMetaDown(c)||(null==c.key|| 1!==c.key.length||mxEvent.isAltDown(c)?c.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(c)&&c.preventDefault()))}));a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateTypingShim();window.setTimeout(mxUtils.bind(this,function(){this.updateTypingShim()}),0)}));a.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(){this.hideTypingShim()}));a.addListener(mxEvent.EDITING_STOPPED,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this, function(){this.updateTypingShim()}),0)}));if(null==a.container.tabIndex||0>a.container.tabIndex)a.container.tabIndex=-1;mxEvent.addListener(a.container,"focus",mxUtils.bind(this,function(){this.updateTypingShim()}));var g=a.cellEditor.focusContainer;a.cellEditor.focusContainer=mxUtils.bind(this,function(){a.isSelectionEmpty()||a.isEditing()?g.apply(a.cellEditor):this.updateTypingShim()})}; EditorUi.prototype.updateTypingShim=function(){var a=this.editor.graph;a.isEditing()||a.isSelectionEmpty()||!a.isEnabled()||a.isCellLocked(a.getSelectionCell())?this.hideTypingShim():this.showTypingShim()}; EditorUi.prototype.showTypingShim=function(){var a=this.editor.graph,b=this.typingShim;if(null!=b&&!a.isEditing()){var d=a.getSelectionCell();d=a.getView().getState(d);if(null!=d){var e=document.activeElement;if(null==e||e===document.body||e===a.container||a.container.contains(e))if(b.style.left=Math.round(d.x)+"px",b.style.top=Math.round(d.y)+"px",b.parentNode!==a.container&&a.container.appendChild(b),b.value="",null!=this.clipboardElt&&null!=this.clipboardElt.parentNode){b=a.container.scrollLeft; d=a.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var g=document.createRange();g.selectNodeContents(this.clipboardElt);var c=window.getSelection();null!=c&&(c.removeAllRanges(),c.addRange(g))}catch(h){}a.container.scrollLeft=b;a.container.scrollTop=d}else null!=e&&"true"===e.contentEditable||b.focus({preventScroll:!0})}}};EditorUi.prototype.hideTypingShim=function(){var a=this.typingShim;null!=a&&null!=a.parentNode&&a.parentNode.removeChild(a)}; EditorUi.prototype.isImmediateEditingEvent=function(a){return!0};EditorUi.prototype.updateCssForMarker=function(a,b,d,e,g){d=this.getImageForMarker(e,g,d);a.innerHTML="";null==d?a.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(e=document.createElement("img"),e.setAttribute("src",d),"end"==b&&mxUtils.setPrefixedStyle(e.style,"transform","scaleX(-1)"),a.appendChild(e))}; EditorUi.prototype.getImageForMarker=function(a,b,d){return"flexArrow"==d?null!=a&&a!=mxConstants.NONE?Format.blockMarkerImage.src:null:a==mxConstants.ARROW_CLASSIC?"1"!=b?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:a==mxConstants.ARROW_CLASSIC_THIN?"1"!=b?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:a==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:a==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:a==mxConstants.ARROW_BLOCK? "1"!=b?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:a==mxConstants.ARROW_BLOCK_THIN?"1"!=b?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:a==mxConstants.ARROW_OVAL?"1"!=b?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:a==mxConstants.ARROW_DIAMOND?"1"!=b?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:a==mxConstants.ARROW_DIAMOND_THIN?"1"!=b?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"== a?"1"!=b?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==a?Format.boxMarkerImage.src:"halfCircle"==a?Format.halfCircleMarkerImage.src:"openAsync"==a?Format.openAsyncFilledMarkerImage.src:"async"==a?"1"!=b?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==a?Format.dashMarkerImage.src:"baseDash"==a?Format.baseDashMarkerImage.src:"cross"==a?Format.crossMarkerImage.src:"circle"==a?Format.circleMarkerImage.src:"circlePlus"==a?Format.circlePlusMarkerImage.src: "ERone"==a?Format.EROneMarkerImage.src:"ERmandOne"==a?Format.ERmandOneMarkerImage.src:"ERmany"==a?Format.ERmanyMarkerImage.src:"ERoneToMany"==a?Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==a?Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==a?Format.ERzeroToManyMarkerImage.src:null}; EditorUi.prototype.getImageForEdgeShape=function(a){var b=Format.connectionImage.src;"link"==a.shape?b=Format.linkEdgeImage.src:"flexArrow"==a.shape?b=Format.arrowImage.src:"arrow"==a.shape?b=Format.simpleArrowImage.src:"filledEdge"==a.shape?b=Format.filledEdgeImage.src:"pipe"==a.shape?b=Format.pipeEdgeImage.src:"wire"==a.shape&&(b=Format.wireEdgeImage.src);return b}; EditorUi.prototype.getImageForEdgeStyle=function(a){if("1"==mxUtils.getValue(a,"libavoidRouting",null))return Format.libavoidImage.src;var b=Format.orthogonalImage.src,d=mxUtils.getValue(a,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(a,mxConstants.STYLE_NOEDGESTYLE,null)&&(d=null);"orthogonalEdgeStyle"==d&&"1"==mxUtils.getValue(a,mxConstants.STYLE_CURVED,null)?b=Format.curvedImage.src:"straight"==d||"none"==d||null==d?b=Format.straightImage.src:"entityRelationEdgeStyle"==d?b=Format.entityImage.src: "elbowEdgeStyle"==d?b="vertical"==mxUtils.getValue(a,mxConstants.STYLE_ELBOW,null)?Format.verticalElbowImage.src:Format.horizontalElbowImage.src:"isometricEdgeStyle"==d&&(b="vertical"==mxUtils.getValue(a,mxConstants.STYLE_ELBOW,null)?Format.verticalIsometricImage.src:Format.horizontalIsometricImage.src);return b};EditorUi.prototype.createMenus=function(){return null}; EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),d=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));d.setEnabled(b.isEnabled())}; EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(c){c.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};mxClipboard.copy=function(c){var h=null;if(c.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{h=h||c.getSelectionCells();h=c.getExportableCells(c.model.getTopmostCells(h));for(var k={},p=c.createCellLookup(h),l=c.cloneCells(h,null,k),u=new mxGraphModel,x=u.getChildAt(u.getRoot(), 0),v=0;v<l.length;v++){u.add(x,l[v]);var z=c.view.getState(h[v]);if(null!=z){var C=c.getCellGeometry(l[v]);null!=C&&C.relative&&!u.isEdge(h[v])&&null==p[mxObjectIdentity.get(u.getParent(h[v]))]&&(C.offset=null,C.relative=!1,C.x=z.x/z.view.scale-z.view.translate.x,C.y=z.y/z.view.scale-z.view.translate.y)}}c.updateCustomLinks(c.createCellMapping(k,p),l);mxClipboard.insertCount=1;mxClipboard.setCells(l)}a.updatePasteActionStates();return h};var d=mxClipboard.paste;mxClipboard.paste=function(c){var h= null;c.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):h=d.apply(this,arguments);a.updatePasteActionStates();return h};var e=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){e.apply(this,arguments);a.updatePasteActionStates()};var g=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(c,h){g.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()}; EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var ba=this.graph.getPageLayout(),la=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+ba.x*la.width),this.scale*(this.translate.y+ba.y*la.height),this.scale*ba.width* la.width,this.scale*ba.height*la.height)};a.getPreferredPageSize=function(ba,la,sa){ba=this.getPageLayout();la=this.getPageSize();return new mxRectangle(0,0,ba.width*la.width,ba.height*la.height)};var b=null,d=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(ba,la,sa,T){if(null!=a.container&&!a.isViewer()){sa=null!=sa?sa:0;T=null!=T?T:0;var ua=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),va=mxUtils.hasScrollbars(a.container),Ka=a.view.translate, Sa=a.view.scale,Ua=mxRectangle.fromRectangle(ua);Ua.x=Ua.x/Sa-Ka.x;Ua.y=Ua.y/Sa-Ka.y;Ua.width/=Sa;Ua.height/=Sa;Ka=a.container.scrollTop;var ta=a.container.scrollLeft,Fa=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Fa+=3;var Ma=a.container.offsetWidth-Fa;Fa=a.container.offsetHeight-Fa;ba=ba?Math.max(.3,Math.min(la||1,Ma/Ua.width)):Sa;la=(Ma-ba*Ua.width)/2/ba;var ab=0==this.lightboxVerticalDivider?0:(Fa-ba*Ua.height)/this.lightboxVerticalDivider/ba;va&&(la=Math.max(la, 0),ab=Math.max(ab,0));if(va||ua.width<Ma||ua.height<Fa)a.view.scaleAndTranslate(ba,Math.floor(la-Ua.x),Math.floor(ab-Ua.y)),a.container.scrollTop=Ka*ba/Sa,a.container.scrollLeft=ta*ba/Sa;else if(0!=sa||0!=T)ua=a.view.translate,a.view.setTranslate(Math.floor(ua.x+sa/Sa),Math.floor(ua.y+T/Sa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var e=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",e);this.destroyFunctions.push(function(){mxEvent.removeListener(window, "resize",e)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(ba){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(ba){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var g=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=a.isViewer()?"0":"50%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var c= mxUtils.bind(this,function(){var ba=mxUtils.getCurrentStyle(a.container);a.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=ba?parseInt(ba["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",c);c();var h=0;c=mxUtils.bind(this,function(ba,la,sa){h++;var T=document.createElement("span");T.style.paddingLeft="8px";T.style.paddingRight="8px";T.style.cursor="pointer";mxEvent.addListener(T, "click",ba);null!=sa&&T.setAttribute("title",sa);ba=document.createElement("img");ba.setAttribute("border","0");ba.setAttribute("src",la);ba.style.width="36px";ba.style.filter="invert(100%)";T.appendChild(ba);this.chromelessToolbar.appendChild(T);return T});if(null!=g.backBtn){var k=Graph.sanitizeLink(g.backBtn.url);null!=k&&c(mxUtils.bind(this,function(ba){window.location.href=k;mxEvent.consume(ba)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var p=c(mxUtils.bind(this,function(ba){this.actions.get("previousPage").funct(); mxEvent.consume(ba)}),Editor.chevronLeftImage,mxResources.get("previousPage")),l=document.createElement("div");l.style.fontFamily=Editor.defaultHtmlFont;l.style.display="inline-block";l.style.verticalAlign="top";l.style.fontWeight="bold";l.style.marginTop="8px";l.style.fontSize="14px";l.style.cursor="default";l.style.color="#ffffff";this.chromelessToolbar.appendChild(l);var u=c(mxUtils.bind(this,function(ba){this.actions.get("nextPage").funct();mxEvent.consume(ba)}),Editor.chevronRightImage,mxResources.get("nextPage")), x=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){l.innerText="";var ba=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(l,ba+1+" / "+this.pages.length);l.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());p.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(ba-1,this.pages.length)].getName());u.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(ba+1,this.pages.length)].getName())}}); p.style.paddingLeft="0px";p.style.paddingRight="4px";u.style.paddingLeft="4px";u.style.paddingRight="0px";var v=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(u.style.display="",p.style.display="",l.style.display="inline-block"):(u.style.display="none",p.style.display="none",l.style.display="none");x()});if(null!=this.menus){var z=this.menus.get("pages");null!=z&&mxEvent.addListener(l,"click",mxUtils.bind(this,function(ba){var la=new mxPopupMenu(z.funct); la.smartSeparators=!0;la.showDisabled=!0;la.autoExpand=!0;la.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(la,arguments);la.destroy()});var sa=mxUtils.getOffset(l);la.popup(sa.x,sa.y+l.offsetHeight,null,ba);mxEvent.addListener(la.div,"mouseleave",mxUtils.bind(this,function(){la.hideMenu()}))}))}this.editor.addListener("resetGraphView",v);this.editor.addListener("pageSelected",x)}c(mxUtils.bind(this,function(ba){this.actions.get("zoomOut").funct();mxEvent.consume(ba)}), Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");c(mxUtils.bind(this,function(ba){this.actions.get("zoomIn").funct();mxEvent.consume(ba)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");c(mxUtils.bind(this,function(ba){this.actions.get("smartFit").funct();mxEvent.consume(ba)}),Editor.zoomFitImage,mxResources.get("fit"));var C=null,F=null,G=mxUtils.bind(this,function(ba){null!=C&&(window.clearTimeout(C),C=null);null!=F&&(window.clearTimeout(F),F=null);C=window.setTimeout(mxUtils.bind(this, function(){mxUtils.setOpacity(this.chromelessToolbar,0);C=null;F=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";F=null}),600)}),ba||200)}),H=mxUtils.bind(this,function(ba){null!=C&&(window.clearTimeout(C),C=null);null!=F&&(window.clearTimeout(F),F=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,ba||30)});if("1"==urlParams.layers){this.layersDialog=null;var J=c(mxUtils.bind(this,function(ba){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog), this.layersDialog=null;else{this.layersDialog=a.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 la=J.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=la.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,80);la=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=la.zIndex;document.body.appendChild(this.layersDialog); this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(ba)}),Editor.layersImage,mxResources.get("layers")),O=a.getModel();O.addListener(mxEvent.CHANGE,function(){J.style.display=1<O.getChildCount(O.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(c);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||c(mxUtils.bind(this,function(ba){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"== this.editor.editButtonLink){var la=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),null,null,la)}else a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(ba)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(v=0;v<this.lightboxToolbarActions.length;v++){var M=this.lightboxToolbarActions[v];M.elem=c(M.fn,M.icon,M.tooltip)}if(null!=g.refreshBtn){var V=null==g.refreshBtn.url?null:Graph.sanitizeLink(g.refreshBtn.url); c(mxUtils.bind(this,function(ba){null!=V?window.location.href=V:window.location.reload();mxEvent.consume(ba)}),Editor.refreshImage,mxResources.get("refresh"))}null!=g.fullscreenBtn&&window.self!==window.top&&c(mxUtils.bind(this,function(ba){g.fullscreenBtn.url?a.openLink(g.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(ba)}),Editor.fullscreenImage,mxResources.get("openInNewWindow"));!g.noCloseBtn&&(g.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!= document.body))&&c(mxUtils.bind(this,function(ba){"1"==urlParams.close||g.closeBtn?window.close():(this.destroy(),mxEvent.consume(ba))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";a.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(ba){mxEvent.isTouchEvent(ba)|| (mxEvent.isShiftDown(ba)||H(30),G())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(ba){mxEvent.consume(ba)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(ba){a.tooltipHandler.resetTimer();a.tooltipHandler.hideTooltip();mxEvent.isShiftDown(ba)?G():H(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(ba){mxEvent.isShiftDown(ba)?G():H(100);mxEvent.consume(ba)}));mxEvent.addListener(this.chromelessToolbar, "mouseleave",mxUtils.bind(this,function(ba){mxEvent.isTouchEvent(ba)||H(30)}));var Q=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ba,la){this.startX=la.getGraphX();this.startY=la.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(ba,la){},mouseUp:function(ba,la){mxEvent.isTouchEvent(la.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<Q&&Math.abs(this.scrollTop-a.container.scrollTop)< Q&&Math.abs(this.startX-la.getGraphX())<Q&&Math.abs(this.startY-la.getGraphY())<Q&&(0<parseFloat(d.chromelessToolbar.style.opacity||0)?G():H(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ma=a.view.validate,ia=new mxPoint,na=!1,Z=null;a.view.validate=function(){if(null!=a.container&&mxUtils.hasScrollbars(a.container)){if(null!=d.currentPage&&Z!=d.currentPage){Z=d.currentPage;na=!0;var ba=a.getBoundingBoxFromGeometry(a.model.getCells(),!0,null, !0);null==ba&&(ba=new mxRectangle(a.view.translate.x*a.view.scale,a.view.translate.y*a.view.scale));ba=a.getPageLayout(ba,ia,1);var la=a.getDefaultTranslate(ba);this.x0=ba.x;this.y0=ba.y;if(la.x!=this.translate.x||la.y!=this.translate.y)this.invalidate(),this.translate.x=la.x,this.translate.y=la.y}la=a.getPagePadding();var sa=a.getPageSize();ba=la.x-(this.x0||0)*sa.width;la=la.y-(this.y0||0)*sa.height;if(this.translate.x!=ba||this.translate.y!=la)this.invalidate(),this.translate.x=ba,this.translate.y= la}ma.apply(this,arguments)};if(!a.isViewer()){var da=a.sizeDidChange;a.sizeDidChange=function(){var ba=na;na=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var la=this.getPageLayout(),sa=this.getDefaultTranslate(la),T=this.view.translate.x,ua=this.view.translate.y;if(sa.x!=T||sa.y!=ua){this.view.x0=la.x;this.view.y0=la.y;this.autoTranslate=!0;this.view.setTranslate(sa.x,sa.y);this.autoTranslate=!1;ba||(this.container.scrollLeft+= Math.round((sa.x-T)*this.view.scale),this.container.scrollTop+=Math.round((sa.y-ua)*this.view.scale));return}}da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var pa=a.view.getBackgroundPane(),ka=a.view.getDrawPane();a.cumulativeZoomFactor=1;var S=null,U=null,Y=null,N=null,R=null,ea=function(ba){null!=S&&window.clearTimeout(S);0<=ba&&window.setTimeout(function(){if(!a.isMouseDown||N)S=window.setTimeout(mxUtils.bind(this,function(){if(a.isFastZoomEnabled()){null!= a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,"transform",null));ka.style.transformOrigin="";pa.style.transformOrigin="";mxClient.IS_SF?(ka.style.transform="scale(1)",pa.style.transform="scale(1)",window.setTimeout(function(){ka.style.transform="";pa.style.transform=""},0)):(ka.style.transform="",pa.style.transform="");a.view.getDecoratorPane().style.opacity= "";a.view.getOverlayPane().style.opacity="";for(var la=a.container.querySelectorAll(".geHint"),sa=0;sa<la.length;sa++)la[sa].style.opacity=""}la=new mxPoint(a.container.scrollLeft,a.container.scrollTop);var T=mxUtils.getOffset(a.container),ua=a.view.scale;sa=a.view.translate.x;var va=a.view.translate.y,Ka=0,Sa=0;null!=U&&(Ka=a.container.offsetWidth/2-U.x+T.x,Sa=a.container.offsetHeight/2-U.y+T.y);var Ua=null==b&&mxUtils.hasScrollbars(a.container);a.zoom(a.cumulativeZoomFactor,Ua?!1:null,a.isFastZoomEnabled()? 20:null,Ua);var ta=a.view.scale;ta!=ua&&(Ua?(ua=ta/ua,Ka=null!=U?U.x-T.x:a.container.clientWidth/2,T=null!=U?U.y-T.y:a.container.clientHeight/2,null!=Y&&(Ka-=la.x-Y.x,T-=la.y-Y.y),a.container.scrollLeft=Math.round(la.x*ua+Ka*(ua-1)+(a.view.translate.x-sa)*ta),a.container.scrollTop=Math.round(la.y*ua+T*(ua-1)+(a.view.translate.y-va)*ta)):(null!=Y&&(Ka+=la.x-Y.x,Sa+=la.y-Y.y),null!=b&&d.chromelessResize(!1,null,Ka*(a.cumulativeZoomFactor-1),Sa*(a.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)|| 0==Ka&&0==Sa||(a.container.scrollLeft-=Ka*(a.cumulativeZoomFactor-1),a.container.scrollTop-=Sa*(a.cumulativeZoomFactor-1))));null!=R&&ka.setAttribute("filter",R);a.fireEvent(new mxEventObject("zoomPreviewComplete"));a.cumulativeZoomFactor=1;R=N=U=Y=S=null}),null!=ba?ba:a.isFastZoomEnabled()?d.wheelZoomDelay:d.lazyZoomDelay)},0)};a.lazyZoom=function(ba,la,sa,T,ua){T=null!=T?T:this.zoomFactor;(la=la||!a.scrollbars)&&(U=new mxPoint(a.container.offsetLeft+a.container.clientWidth/2,a.container.offsetTop+ a.container.clientHeight/2));ua?1!=T&&(ba?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=T,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=T,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor* 100)/100/this.view.scale)):this.cumulativeZoomFactor=this.getZoomStep(this.view.scale*this.cumulativeZoomFactor,ba)/this.view.scale;this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(a.isFastZoomEnabled()){null==R&&""!=ka.getAttribute("filter")&&(R=ka.getAttribute("filter"),ka.removeAttribute("filter"));Y=new mxPoint(a.container.scrollLeft,a.container.scrollTop);ba=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/ 100*20)/(20*this.view.scale);T=la||null==U?a.container.scrollLeft+a.container.clientWidth/2:U.x+a.container.scrollLeft-a.container.offsetLeft;ua=la||null==U?a.container.scrollTop+a.container.clientHeight/2:U.y+a.container.scrollTop-a.container.offsetTop;ka.style.transformOrigin=T+"px "+ua+"px";ka.style.transform="scale("+ba+")";pa.style.transformOrigin=T+"px "+ua+"px";pa.style.transform="scale("+ba+")";null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node?(T=a.view.backgroundPageShape.node, mxUtils.setPrefixedStyle(T.style,"transform-origin",(la||null==U?a.container.clientWidth/2+a.container.scrollLeft-T.offsetLeft+"px":U.x+a.container.scrollLeft-T.offsetLeft-a.container.offsetLeft+"px")+" "+(la||null==U?a.container.clientHeight/2+a.container.scrollTop-T.offsetTop+"px":U.y+a.container.scrollTop-T.offsetTop-a.container.offsetTop+"px")),mxUtils.setPrefixedStyle(T.style,"transform","scale("+ba+")")):a.view.validateBackgroundStyles(ba,T,ua);a.view.getDecoratorPane().style.opacity="0";a.view.getOverlayPane().style.opacity= "0";la=a.container.querySelectorAll(".geHint");for(T=0;T<la.length;T++)la[T].style.opacity="0";a.fireEvent(new mxEventObject("zoomPreview","factor",ba))}ea(a.isFastZoomEnabled()?sa:0)};mxEvent.addGestureListeners(a.container,function(ba){null!=S&&window.clearTimeout(S)},null,function(ba){1!=a.cumulativeZoomFactor&&ea(0)});mxEvent.addListener(a.container,"scroll",function(ba){null==S||a.isMouseDown||1==a.cumulativeZoomFactor||ea(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(ba,la,sa, T,ua){a.fireEvent(new mxEventObject("wheel"));if(null==a.freehand||!a.freehand.isDrawing())if(Editor.passiveScroll&&!sa&&a.isScrollWheelEvent(ba))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=ba.deltaX?ba.deltaX:0,deltaY:null!=ba.deltaY?ba.deltaY:la?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!a.scrollbars&&!sa&&a.isScrollWheelEvent(ba))T=a.view.getTranslate(),ua=40/a.view.scale,mxEvent.isShiftDown(ba)? a.view.setTranslate(T.x+(la?-ua:ua),T.y):a.view.setTranslate(T.x,T.y+(la?ua:-ua));else if(sa||a.isZoomWheelEvent(ba))for(var va=mxEvent.getSource(ba);null!=va;){if(va==a.container){a.tooltipHandler.hideTooltip();T=null!=T&&null!=ua?new mxPoint(T,ua):new mxPoint(mxEvent.getClientX(ba),mxEvent.getClientY(ba));ua=null!=U?new mxPoint(U.x,U.y):null;va=a.cumulativeZoomFactor;U=T;N=sa;sa=a.zoomFactor;var Ka=!1,Sa=null;ba.ctrlKey&&null!=ba.deltaY&&40>Math.abs(ba.deltaY)&&Math.round(ba.deltaY)!=ba.deltaY? (sa=1+Math.abs(ba.deltaY)/20*(sa-1),Ka=!0):null!=ba.movementY&&"pointermove"==ba.type&&(sa=1+Math.max(1,Math.abs(ba.movementY))/20*(sa-1),Ka=!0,Sa=-1);a.lazyZoom(la,null,Sa,sa,Ka);null!=ua&&1!=va&&a.isFastZoomEnabled()&&a.scrollbars&&(la=a.cumulativeZoomFactor,sa=la/va,Ka=1-la,.001<Math.abs(Ka)&&(U=new mxPoint((T.x*(1-sa)+sa*ua.x*(1-va))/Ka,(T.y*(1-sa)+sa*ua.y*(1-va))/Ka),T=U.x+a.container.scrollLeft-a.container.offsetLeft,ua=U.y+a.container.scrollTop-a.container.offsetTop,ka.style.transformOrigin= T+"px "+ua+"px",pa.style.transformOrigin=T+"px "+ua+"px",null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node?(la=a.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(la.style,"transform-origin",U.x+a.container.scrollLeft-la.offsetLeft-a.container.offsetLeft+"px "+(U.y+a.container.scrollTop-la.offsetTop-a.container.offsetTop)+"px")):a.view.validateBackgroundStyles(Math.round(Math.round(a.view.scale*la*100)/100*20)/(20*a.view.scale),T,ua)));mxEvent.consume(ba);return!1}va=va.parentNode}}), a.container);a.panningHandler.zoomGraph=function(ba){a.cumulativeZoomFactor=ba.scale;a.lazyZoom(1<ba.scale,!0,null,1,!0);mxEvent.consume(ba)}};EditorUi.prototype.addChromelessToolbarItems=function(a){"1"!=urlParams.noPrint&&a(mxUtils.bind(this,function(b){this.actions.get("print").funct();mxEvent.consume(b)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(a){return Graph.createOffscreenGraph(a)}; EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)}; EditorUi.prototype.toggleFormatPanel=function(a){a=null!=a?a:0==this.formatWidth;if(null!=this.format){var b=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+b+"s ease-in-out");window.setTimeout(mxUtils.bind(this,function(){this.formatWidth=a?240:0;this.hsplitPosition=Math.min(this.container.clientWidth-this.hsplit.clientWidth-this.formatWidth,this.hsplitPosition);this.refresh();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.formatContainer.style, "transition",null);this.refresh(!0);this.fireEvent(new mxEventObject("formatWidthChanged"))}),1E3*b)},0))}};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,d=60;null!=b&&(d=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(d,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}}; EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};EditorUi.prototype.isSelectionAllowed=function(a){return"SELECT"==mxEvent.getSource(a).nodeName||"INPUT"==mxEvent.getSource(a).nodeName};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})}; EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")}; EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var d=mxUtils.parseXml(a);this.editor.setGraphXml(d.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange(); this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(a,b){this.showDialog((new PrintDialog(this,a,b)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(a,b,d,e){this.editor.graph.popupMenuHandler.hideMenu();var g=new mxPopupMenu(a);g.smartSeparators=!0;g.showDisabled=!0;g.autoExpand=!0;g.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(g,arguments);g.destroy()});g.popup(b,d,null,e);this.setCurrentMenu(g)}; EditorUi.prototype.isHideCurrentMenuEvent=function(a){a=mxEvent.getSource(a);if(null!=this.currentMenu){if(a==this.currentMenu.div)return!1;for(var b=this.currentMenu.activeRow;null!=b;){if(a==b.div)return!1;b=b.activeRow}return!0}return!1};EditorUi.prototype.setCurrentMenu=function(a,b){this.currentMenuElt=b;this.currentMenu=a;this.hideShapePicker()};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null}; EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var a=this.editor.getOrCreateFilename();null!=this.editor.appName&&(a+=" - "+this.editor.appName);document.title=a};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.createInlineToolbar=function(){return null}; EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(a){}};EditorUi.prototype.undo=function(){try{var a=this.editor.graph;if(a.isEditing()){var b=a.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);b==a.cellEditor.textarea.innerHTML&&(a.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(d){}}; EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml()}};EditorUi.prototype.updateDiagramData=function(a,b){this.replaceDiagramData(xUtils.getXml(b))};EditorUi.prototype.replaceDiagramData=function(a){this.editor.graph.model.beginUpdate();try{this.editor.setGraphXml(mxUtils.parseXml(a).documentElement)}finally{this.editor.graph.model.endUpdate()}}; EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0,d;for(d in urlParams)a=0==b?a+"?":a+"&",a+=d+"="+urlParams[d],b++;return a}; EditorUi.prototype.setScrollbars=function(a){var b=this.editor.graph,d=b.container.style.overflow;b.scrollbars=a;this.editor.updateGraphComponents();d!=b.container.style.overflow&&(b.container.scrollTop=0,b.container.scrollLeft=0,b.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))}; EditorUi.prototype.initialFitDiagram=function(a){var b=null!=urlParams.border?parseInt(urlParams.border):10;b=new mxRectangle(b,b,b,b);this.fitDiagramOrPages(null!=a?a:1,b,!0)};EditorUi.prototype.fitDiagramOrPages=function(a,b,d){var e=this.editor.graph;e.pageVisible&&e.isSelectionEmpty()&&!d?e.fitPages(a):this.fitDiagramToWindow(a,b,d)}; EditorUi.prototype.fitDiagramToWindow=function(a,b,d){var e=this.editor.graph,g=e.isSelectionEmpty()?mxRectangle.fromRectangle(e.getGraphBounds()):e.getBoundingBox(e.getSelectionCells());if(null!=g){var c=e.view.translate,h=e.view.scale;g.x=g.x/h-c.x;g.y=g.y/h-c.y;g.width/=h;g.height/=h;null!=e.backgroundImage&&g.add(new mxRectangle(0,0,e.backgroundImage.width,e.backgroundImage.height));0==g.width||0==g.height?(e.zoomTo(1),this.resetScrollbars()):(b=null!=b?b:Editor.fitWindowBorders,null!=b&&(g.x-= b.x,g.y-=b.y,g.width+=b.width+b.x,g.height+=b.height+b.y),e.fitWindow(g,null,a,d,d))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars}; EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph,b=a.container;if(!this.editor.extendCanvas)b.scrollTop=0,b.scrollLeft=0,mxUtils.hasScrollbars(b)||a.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(b))if(a.pageVisible){var d=a.getPagePadding();b.scrollTop=Math.floor(d.y);b.scrollLeft=Math.floor(Math.min(d.x,(b.scrollWidth-b.clientWidth)/2));d=a.getGraphBounds();0<d.width&&0<d.height&&(d.x>b.scrollLeft+.9*b.clientWidth&&(b.scrollLeft=Math.min(d.x+ d.width-b.clientWidth,d.x-10)),d.y>b.scrollTop+.9*b.clientHeight&&(b.scrollTop=Math.min(d.y+d.height-b.clientHeight,d.y-10)))}else if(d=a.getGraphBounds(),0==d.width&&0==d.height)b.scrollLeft=(b.scrollWidth-b.clientWidth)/2,b.scrollTop=(b.scrollHeight-b.clientHeight)/2;else{var e=Math.max(d.height,a.scrollTileSize.height*a.view.scale);b.scrollLeft=Math.floor(Math.max(0,d.x-Math.max(0,(b.clientWidth-Math.max(d.width,a.scrollTileSize.width*a.view.scale))/2)));b.scrollTop=Math.floor(Math.max(0,d.y-Math.max(20, (b.clientHeight-e)/4)))}else{d=mxRectangle.fromRectangle(a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds());e=a.view.translate;var g=a.view.scale;d.x=d.x/g-e.x;d.y=d.y/g-e.y;d.width/=g;d.height/=g;e=a.pageVisible?0:Math.max(0,(b.clientHeight-d.height)/4);"1"==urlParams.embedInline?a.view.setTranslate(Math.floor(-d.x+2),Math.floor(e-d.y+1)):a.view.setTranslate(Math.floor(Math.max(0,(b.clientWidth-d.width)/2)-d.x+2),Math.floor(e-d.y+1))}}; EditorUi.prototype.setPageVisible=function(a){var b=this.editor.graph,d=mxUtils.hasScrollbars(b.container),e=0,g=0;d&&(e=b.view.translate.x*b.view.scale-b.container.scrollLeft,g=b.view.translate.y*b.view.scale-b.container.scrollTop);b.pageVisible=a;b.pageBreaksVisible=a;b.preferPageSize=a;b.view.validateBackground();if(d){var c=b.getSelectionCells();b.clearSelection();b.setSelectionCells(c)}b.sizeDidChange();d&&(b.container.scrollLeft=b.view.translate.x*b.view.scale-e,b.container.scrollTop=b.view.translate.y* b.view.scale-g);b.defaultPageVisible=a;this.fireEvent(new mxEventObject("pageViewChanged"))}; EditorUi.prototype.installResizeHandler=function(a,b,d){b&&(a.window.setSize=function(g,c){if(!this.minimized){var h=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,k=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,p=this.getX(),l=this.getY(),u=p+g>h?Math.max(0,h-g):p,x=l+c>k?Math.max(0,k-c):l;u==p&&x==l||mxWindow.prototype.setLocation.call(this,u,x);g=Math.min(g,h);c=Math.min(c,k)}mxWindow.prototype.setSize.apply(this,arguments)}); a.window.setLocation=function(g,c){if(null!=this.div){var h=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,k=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,p=parseInt(this.div.style.width),l=parseInt(this.div.style.height);g=Math.max(0,Math.min(g,Math.max(0,h-p)));c=Math.max(0,Math.min(c,Math.max(0,k-l)));this.getX()==g&&this.getY()==c||mxWindow.prototype.setLocation.apply(this,arguments);b&&!this.minimized&&(h=Math.min(p, h),k=Math.min(l,k),h==p&&k==l||this.setSize(h,k))}};var e=mxUtils.bind(this,function(){var g=a.window.getX(),c=a.window.getY();a.window.setLocation(g,c)});mxEvent.addListener(window,"resize",e);a.destroy=function(){mxEvent.removeListener(window,"resize",e);a.window.destroy();null!=d&&d()}};function ChangeGridColor(a,b){this.ui=a;this.color=b}ChangeGridColor.prototype.execute=function(){var a=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=a}; function ChangePageSetup(a,b,d,e,g){this.ui=a;this.previousColor=this.color=b;this.previousImage=this.image=d;this.previousFormat=this.format=e;this.previousPageScale=this.pageScale=g;this.ignoreImage=this.ignoreColor=!1} ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var b=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=b}if(!this.ignoreImage){this.image=this.previousImage;b=a.backgroundImage;var d=this.previousImage;null!=d&&Graph.isPageLink(d.src)&&(d=this.ui.createImageForPageLink(d.src,this.ui.currentPage));this.ui.setBackgroundImage(d);this.previousImage=b}null!=this.previousFormat&&(this.format=this.previousFormat, b=a.pageFormat,this.previousFormat.width!=b.width||this.previousFormat.height!=b.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(a=this.ui.editor.graph.pageScale,this.previousPageScale!=a&&(this.ui.setPageScale(this.previousPageScale),this.previousPageScale=a))}; EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))}; EditorUi.prototype.setPageFormat=function(a,b){b=null!=b?b:"1"==urlParams.sketch;this.editor.graph.pageFormat=a;b||(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(a){this.editor.graph.pageScale=a;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(a,b){b=null!=b?b:Editor.isDarkMode();var d=this.editor.graph;b?d.view.defaultDarkGridColor=a:d.view.defaultGridColor=a;d.view.gridColor="light-dark("+d.view.defaultGridColor+", "+d.view.defaultDarkGridColor+")";d.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))}; EditorUi.prototype.addUndoListener=function(){var a=this.editor.undoManager,b=mxUtils.bind(this,function(){this.updateActionStates()});a.addListener(mxEvent.ADD,b);a.addListener(mxEvent.UNDO,b);a.addListener(mxEvent.REDO,b);a.addListener(mxEvent.CLEAR,b);var d=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){d.apply(this,arguments);b()};var e=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(g,c){e.apply(this,arguments); b()};b()}; EditorUi.prototype.updateActionStates=function(){for(var a=this.editor.graph,b=this.getSelectionState(),d=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()),e=!this.editor.chromeless||this.editor.editable,g="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(" "),c=0;c<g.length;c++)this.actions.get(g[c]).setEnabled(0< b.cells.length);this.actions.get("grid").setEnabled(e);this.actions.get("undo").setEnabled(this.canUndo()&&e);this.actions.get("redo").setEnabled(this.canRedo()&&e);this.actions.get("swap").setEnabled(2==b.cells.length&&2==b.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<b.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<b.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!a.isSelectionEmpty()); this.actions.get("bringForward").setEnabled(1==b.cells.length);this.actions.get("sendBackward").setEnabled(1==b.cells.length);c="alignCellsLeft alignCellsCenter alignCellsRight alignCellsTop alignCellsMiddle alignCellsBottom distributeHorizontal distributeVertical".split(" ");for(e=0;e<c.length;e++)this.actions.get(c[e]).setEnabled(b.unlocked&&1<b.vertices.length);this.actions.get("rotation").setEnabled(1==b.vertices.length);this.actions.get("wordWrap").setEnabled(1==b.vertices.length);this.actions.get("autosize").setEnabled(0< b.vertices.length);this.actions.get("copySize").setEnabled(1==b.vertices.length);this.actions.get("clearWaypoints").setEnabled(b.connections);this.actions.get("clearAnchors").setEnabled(b.connections);this.actions.get("curved").setEnabled(0<b.edges.length);this.actions.get("turn").setEnabled(0<b.cells.length);this.actions.get("group").setEnabled(1<b.cells.length||1==b.vertices.length&&0==a.model.getChildCount(b.cells[0])&&!a.isContainer(b.vertices[0]));this.actions.get("ungroup").setEnabled(!b.row&& !b.cell&&!b.table&&0<b.vertices.length&&(a.isContainer(b.vertices[0])||0<a.getModel().getChildCount(b.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==b.cells.length&&a.getModel().isVertex(a.getModel().getParent(b.cells[0])));this.actions.get("collapsible").setEnabled(1==b.vertices.length&&(0<a.model.getChildCount(b.vertices[0])||a.isContainer(b.vertices[0])));this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("home").setEnabled(null!=a.view.currentRoot); this.actions.get("enterGroup").setEnabled(1==b.cells.length&&a.isValidRoot(b.cells[0]));this.actions.get("copyData").setEnabled(1==b.cells.length);this.actions.get("copyAsText").setEnabled(1==b.cells.length);this.actions.get("editLink").setEnabled(1==b.cells.length);this.actions.get("editStyle").setEnabled(0<b.cells.length);this.actions.get("editTooltip").setEnabled(1==b.cells.length);this.actions.get("editNote").setEnabled(1==b.cells.length);this.actions.get("openLink").setEnabled(1==b.cells.length&& null!=a.getLinkForCell(b.cells[0]));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("selectVertices").setEnabled(d);this.actions.get("selectEdges").setEnabled(d);this.actions.get("selectAll").setEnabled(d);this.actions.get("selectNone").setEnabled(d);e=!1;for(c=0;c<b.vertices.length;c++)if(a.isCellFoldable(b.vertices[c])){e=!0;break}this.actions.get("expand").setEnabled(e);this.actions.get("collapse").setEnabled(e);this.menus.get("navigation").setEnabled(0<b.cells.length||null!= a.view.currentRoot);this.menus.get("layout").setEnabled(d);this.menus.get("insert").setEnabled(d);this.menus.get("direction").setEnabled(b.unlocked&&1==b.vertices.length);this.menus.get("distribute").setEnabled(b.unlocked&&1<b.vertices.length);this.menus.get("align").setEnabled(b.unlocked&&0<b.cells.length);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset}; EditorUi.prototype.refresh=function(a){var b=this.sidebarContainer.style.width,d=this.formatContainer.style.width;this.sidebarContainer.style.width=this.hsplitPosition+"px";this.formatContainer.style.width=null!=this.format&&0<this.formatWidth?"":"0";(a||b!=this.sidebarContainer.style.width||d!=this.formatContainer.style.width)&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.hsplit=this.createDiv("geHsplit");this.editor.chromeless||(this.tabContainer=this.createTabContainer())}; EditorUi.prototype.createSidebarContainer=function(){var a=document.createElement("div");a.className="geSidebarContainer";return a}; EditorUi.prototype.createUi=function(){this.statusContainer=this.createStatusContainer();this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer)); this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar")); null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh();this.fireEvent(new mxEventObject("sidebarWidthChanged"))})))}; EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geStatus";mxEvent.addListener(a,"click",mxUtils.bind(this,function(b){var d=mxEvent.getSource(b);if(d!=a)for(;d.parentNode!=a;)d=d.parentNode;if("A"!=d.nodeName){var e=d.getAttribute("data-action");if("statusFunction"==e&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=e)d=this.actions.get(e),null!=d&&d.funct();else{e=d.getAttribute("data-title");var g=d.getAttribute("data-message"); null!=e&&null!=g?this.showError(e,g):(d=d.getAttribute("data-link"),null!=d&&this.editor.graph.openLink(d))}mxEvent.consume(b)}}));return a}; EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=Graph.sanitizeHtml(a);0==this.statusContainer.getElementsByTagName("div").length&&null!=a&&0<a.length&&(this.statusContainer.innerText="",a=this.createStatusDiv(a),this.statusContainer.appendChild(a));a=this.statusContainer.querySelectorAll('[data-effect="fade"]');if(null!=a)for(var b=0;b<a.length;b++)(function(d){mxUtils.setOpacity(d,0);mxUtils.setPrefixedStyle(d.style,"transform","scaleX(0)");mxUtils.setPrefixedStyle(d.style, "transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(d,100);mxUtils.setPrefixedStyle(d.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(d.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(d.style,"transform","scaleX(0)");mxUtils.setOpacity(d,0);window.setTimeout(mxUtils.bind(this,function(){null!=d.parentNode&&d.parentNode.removeChild(d)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(a[b])}; EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(a){null!=a&&a();this.lastStatusUpdate=a};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(a){var b=document.createElement("div");b.className="geStatusDiv";b.setAttribute("title",a);b.innerText=a;return b}; EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)};EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.getCollapsedSections=function(){return{}};EditorUi.prototype.createDiv=function(a){var b=document.createElement("div");b.className=a;return b}; EditorUi.prototype.addSplitHandler=function(a,b,d,e){function g(x){if(null!=h){var v=new mxPoint(mxEvent.getClientX(x),mxEvent.getClientY(x));e(Math.max(0,k+(b?v.x-h.x:h.y-v.y)-d));mxEvent.consume(x);k!=u()&&(p=!0,l=null)}}function c(x){g(x);h=k=null}var h=null,k=null,p=!0,l=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var u=mxUtils.bind(this,function(){var x=parseInt(b?a.offsetLeft:a.offsetTop);b||(x+=d);return x});mxEvent.addGestureListeners(a,function(x){h=new mxPoint(mxEvent.getClientX(x), mxEvent.getClientY(x));k=u();p=!1;mxEvent.consume(x)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(x){if(!p&&this.hsplitClickEnabled){var v=null!=l?l-d:0;l=u();e(v);mxEvent.consume(x)}}));mxEvent.addGestureListeners(document,null,g,c);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,g,c)})}; EditorUi.prototype.prompt=function(a,b,d,e){a=new FilenameDialog(this,b,mxResources.get("apply"),function(g){d(e?g:parseFloat(g))},a);this.showDialog(a.container,300,80,!0,!0);a.init()}; EditorUi.prototype.handleError=function(a,b,d,e,g){a=null!=a&&null!=a.error?a.error:a;if(null!=a||null!=b){g=mxUtils.htmlEntities(mxResources.get("unknownError"));var c=mxResources.get("ok");b=null!=b?b:mxResources.get("error");null!=a&&null!=a.message&&(g=mxUtils.htmlEntities(a.message));this.showError(b,g,c,d,null,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()}; EditorUi.prototype.showError=function(a,b,d,e,g,c,h,k,p,l,u,x,v){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,g,c,h,x,k,p);this.showDialog(a.container,l||340,u,!0,!1,v);null==u&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");a.init()}; EditorUi.prototype.showDialog=function(a,b,d,e,g,c,h,k,p,l,u){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,d,e,g,c,h,k,p,l);this.dialogs.push(this.dialog);null!=u&&null!=p&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(a=mxSettings.getWindowState(u),null!=a&&null!=a.w&&null!=a.h&&(this.dialog.container.style.width=Math.max(p.width,a.w)+"px",this.dialog.container.style.height= Math.max(p.height,a.h)+"px"),this.dialog.onResize=function(x,v){mxSettings.setWindowState(u,{w:x,h:v});mxSettings.save()})}; EditorUi.prototype.hideDialog=function(a,b,d){var e=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var g=this.dialogs.length-1;0<=g;g--)if(!this.dialogs[g].closing){e=this.dialogs[g];break}null==e||null!=d&&d!=this.dialog.container.firstChild||(e.closing=!0,0==e.close(a,b)?delete e.closing:(delete e.closing,a=mxUtils.lastIndexOf(this.dialogs,e),0<=a&&this.dialogs.splice(a,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog", "dialog",e)),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 a=this.editor.graph;if(a.isEnabled())try{for(var b=a.getSelectionCells(),d=new mxDictionary,e=[],g=0;g<b.length;g++){var c=a.isTableCell(b[g])?a.model.getParent(b[g]):b[g];null==c||d.get(c)||(d.put(c,!0),e.push(c))}a.setSelectionCells(a.duplicateCells(e,!1))}catch(h){this.handleError(h)}}; EditorUi.prototype.pickColor=function(a,b,d,e,g,c,h,k){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(a,b,d,e,g,c,null,k);else{var p=this.editor.graph,l=p.cellEditor.saveSelection(),u=this;if(null==this.colorWindow){var x=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=x&&null!=x.x?x.x:document.body.offsetWidth-280,null!=x&&null!=x.y?x.y:100,null!=x&&null!=x.w?x.w:260);null!= this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=x&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(a,function(v){p.cellEditor.restoreSelection(l);null!=u.colorWindow&&(u.colorWindow.applying=!0);b(v);null!=u.colorWindow&&(u.colorWindow.applying=!1)},c||mxResources.get("fillColor"),d,e,g,h,k)}}; EditorUi.prototype.pickColorModal=function(a,b,d,e,g,c,h,k){var p=this.editor.graph,l=p.cellEditor.saveSelection(),u=new ColorDialog(this,a,function(v){p.cellEditor.restoreSelection(l);null!=b&&b(v)},function(){p.cellEditor.restoreSelection(l);null!=h&&h()},d,e,g,null,k);null!=c&&(a=document.createElement("div"),a.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(a,c),u.container.insertBefore(a, u.container.firstChild));this.showDialog(u.container,250,null,!0,!1);var x=this.dialog.container;u.resizeFn=function(){x.style.height=u.container.scrollHeight+48+"px"};u.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";a=atob(a);for(var d=a.length,e=Math.ceil(d/1024),g=Array(e),c=0;c<e;++c){for(var h=1024*c,k=Math.min(h+1024,d),p=Array(k-h),l=0;h<k;++l,++h)p[l]=a[h].charCodeAt(0);g[c]=new Uint8Array(p)}return new Blob(g,{type:b})}; EditorUi.prototype.extractGraphModelFromHtml=function(a){var b=null;try{var d=a.indexOf("<mxGraphModel ");if(0<=d){var e=a.lastIndexOf("</mxGraphModel>");e>d&&(b=a.substring(d,e+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(g){}return b}; EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=null,d=null;null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a&&(d=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,0<=mxUtils.indexOf(a.types,"text/plain")&&(null==d||0==d.length)&&(d=a.getData("text/plain")),null!=d&&(d=Graph.zapGremlins(mxUtils.trim(d)),a=this.extractGraphModelFromHtml(d),null!=a&&(d=a))));null!=d&&this.isCompatibleString(d)&&(b=d);return b}; EditorUi.prototype.isCompatibleString=function(a){return!1};EditorUi.prototype.saveFile=function(a){a||null==this.editor.filename?(a=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(b){this.save(b)}),null,mxUtils.bind(this,function(b){if(null!=b&&0<b.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(a.container,340,96,!0,!0),a.init()):this.save(this.editor.getOrCreateFilename())}; EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,b);this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}))}else if(b.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL, "filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(b))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(d){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}}; EditorUi.prototype.executeLayouts=function(a,b){for(var d=!1,e=0;e<a.length;e++)if("function"===typeof a[e].prepare){d=!0;break}if(d){var g=this,c=this.editor.graph.getDefaultParent(),h=0,k=function(){if(h>=a.length)null!=b&&b();else{var p=a[h++];"function"===typeof p.prepare?p.prepare(c,function(l,u){null!=l?g.handleError(l):g.executeLayout(u,!0,k)}):g.executeLayout(function(){p.execute(c)},!0,k)}};k()}else this.executeLayout(mxUtils.bind(this,function(){var p=new mxCompositeLayout(this.editor.graph, a),l=this.editor.graph.getSelectionCells();p.execute(this.editor.graph.getDefaultParent(),0==l.length?null:l)}),!0,b)};EditorUi.prototype.executeLayout=function(a,b,d){var e=this.editor.graph;e.getModel().beginUpdate();try{a()}catch(g){throw g;}finally{this.allowAnimation&&b&&e.isEnabled()?(a=new mxMorphing(e),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){e.getModel().endUpdate();null!=d&&d()})),a.startAnimation()):(e.getModel().endUpdate(),null!=d&&d())}}; EditorUi.prototype.showImageDialog=function(a,b,d,e){e=this.editor.graph.cellEditor;var g=e.saveSelection(),c=mxUtils.prompt(a,b);e.restoreSelection(g);if(null!=c&&0<c.length){var h=new Image;h.onload=function(){d(c,h.width,h.height)};h.onerror=function(){d(null);mxUtils.alert(mxResources.get("fileNotFound"))};h.src=c}else d(null)};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d);this.showDialog(a.container,420,null,!0,!0);a.init()}; EditorUi.prototype.showDataDialog=function(a){a instanceof Array&&(a=1<a.length?a:a[0]);null!=a&&"undefined"!==typeof window.EditDataDialog&&(a=new EditDataDialog(this,a),this.showDialog(a.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,340),null,"editData"),a.init())}; EditorUi.prototype.showBackgroundImageDialog=function(a,b){a=null!=a?a:mxUtils.bind(this,function(e){e=new ChangePageSetup(this,null,e);e.ignoreColor=!0;this.editor.graph.model.execute(e)});var d=mxUtils.prompt(mxResources.get("backgroundImage"),null!=b?b.src:"");null!=d&&0<d.length?(b=new Image,b.onload=function(){a(new mxImage(d,b.width,b.height),!1)},b.onerror=function(){a(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},b.src=d):a(null)}; EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,d){mxUtils.confirm(a)?null!=b&&b():null!=d&&d()};EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){b.update(!1)});return b}; EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",78:"editNote",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.altActions={}; EditorUi.prototype.createKeyHandler=function(a){function b(){null!=k&&(window.clearTimeout(k),k=null);var z=g.graphHandler;if(null!=z&&null!=z.first){var C=g.getView().scale,F=z.roundLength(z.currentDx/C);C=z.roundLength(z.currentDy/C);z.moveCells(z.cells,F,C);z.reset()}}function d(z,C,F){if(!g.isSelectionEmpty()&&g.isEnabled()){C=null!=C?C:Editor.getCursorMoveStep(g.view.unit);var G=g.getCompositeParents(g.getSelectionCells()),H=0<G.length?G[0]:null;if(null!=H){if(F){g.getModel().beginUpdate();try{for(H= 0;H<G.length;H++)if(g.getModel().isVertex(G[H])&&g.isCellResizable(G[H])){var J=g.getCellGeometry(G[H]);null!=J&&(J=J.clone(),37==z?J.width=Math.max(0,J.width-C):38==z?J.height=Math.max(0,J.height-C):39==z?J.width+=C:40==z&&(J.height+=C),g.getModel().setGeometry(G[H],J))}}finally{g.getModel().endUpdate()}}else{F=g.model.getParent(H);J=g.getView().scale;var O=null;1==g.getSelectionCount()&&g.model.isVertex(H)&&null!=g.layoutManager&&!g.isCellLocked(H)&&(O=g.layoutManager.getLayout(F));null!=O&&O.constructor== mxStackLayout?(C=F.getIndex(H),37==z||38==z?g.model.add(F,H,Math.max(0,C-1)):(39==z||40==z)&&g.model.add(F,H,Math.min(g.model.getChildCount(F),C+1))):(F=g.graphHandler,null!=F&&(null==F.first&&F.start(H,0,0,g.getMovableCells(G)),null!=F.first&&(O=H=0,37==z?H=-C:38==z?O=-C:39==z?H=C:40==z&&(O=C),F.currentDx+=H*J,F.currentDy+=O*J,F.checkPreview(),F.updatePreview()),null!=k&&window.clearTimeout(k),k=window.setTimeout(b,400)))}H=g.graphHandler;z=g.container;C=null;null!=H&&null!=H.first?null!=H.bounds&& (C=mxRectangle.fromRectangle(H.bounds),C.x+=H.currentDx,C.y+=H.currentDy):C=g.view.getBounds(G);null!=C&&null!=z&&(C.x<z.scrollLeft||C.y<z.scrollTop||C.x+C.width>z.scrollLeft+z.clientWidth||C.y+C.height>z.scrollTop+z.clientHeight)&&(H=g.view.translate,G=new mxPoint(H.x,H.y),g.scrollRectToVisible(new mxRectangle(C.getCenterX()-H.x-z.clientWidth/2,C.getCenterY()-H.y-z.clientHeight/2,z.clientWidth,z.clientHeight))&&(z=new mxPoint(H.x,H.y),g.view.translate.x=G.x,g.view.translate.y=G.y,g.view.setTranslate(z.x, z.y)))}}}var e=this,g=this.editor.graph,c=new mxKeyHandler(g),h=c.isEventIgnored;c.isEventIgnored=function(z){return 188==z.keyCode&&this.isControlDown(z)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(z)&&9==z.keyCode)&&(!this.isControlDown(z)||mxEvent.isShiftDown(z)||90!=z.keyCode&&89!=z.keyCode&&188!=z.keyCode&&190!=z.keyCode&&85!=z.keyCode&&83!=z.keyCode)&&(66!=z.keyCode&&73!=z.keyCode||!this.isControlDown(z)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&& (109!=z.keyCode&&107!=z.keyCode||!this.isControlDown(z)&&!mxEvent.isShiftDown(z)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&h.apply(this,arguments)};c.isEnabledForEvent=function(z){return!mxEvent.isConsumed(z)&&this.isGraphEvent(z)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};c.isControlDown=function(z){return mxEvent.isControlDown(z)||mxClient.IS_MAC&&z.metaKey};var k=null,p=g.fireMouseEvent;g.fireMouseEvent=function(z,C,F){z==mxEvent.MOUSE_DOWN&& b();p.apply(this,arguments)};var l={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},u=c.getFunction;mxKeyHandler.prototype.getFunction=function(z){if(g.isEnabled()){var C=null;mxEvent.isShiftDown(z)&&this.isControlDown(z)&&mxEvent.isAltDown(z)?C=e.actions.get(e.ctrlAltShiftActions[z.keyCode]):mxEvent.isShiftDown(z)&&mxEvent.isAltDown(z)?C=e.actions.get(e.altShiftActions[z.keyCode]):this.isControlDown(z)&&mxEvent.isAltDown(z)? C=e.actions.get(e.ctrlAltActions[z.keyCode]):mxEvent.isAltDown(z)&&(C=e.actions.get(e.altActions[z.keyCode]));if(null!=C)return C.funct;if("/"==z.key&&!this.isControlDown(z)&&!mxEvent.isAltDown(z))return function(){var F=document.getElementById("geOmniSearch");null!=F&&30<F.clientWidth&&F.focus()};if(null!=l[z.keyCode]&&!g.isSelectionEmpty())if(!this.isControlDown(z)&&mxEvent.isShiftDown(z)&&mxEvent.isAltDown(z)){if(g.model.isVertex(g.getSelectionCell()))return function(){var F=g.connectVertex(g.getSelectionCell(), l[z.keyCode],g.defaultEdgeLength,z,!0);null!=F&&0<F.length&&(1==F.length&&g.model.isEdge(F[0])?g.setSelectionCell(g.model.getTerminal(F[0],!1)):g.setSelectionCell(F[F.length-1]),g.scrollCellToVisible(g.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(g.view.getState(g.getSelectionCell())))}}else return this.isControlDown(z)?function(){d(z.keyCode,mxEvent.isShiftDown(z)?g.gridSize:null,!0)}:function(){d(z.keyCode,mxEvent.isShiftDown(z)?g.gridSize:null)}}return u.apply(this,arguments)};c.bindAction= mxUtils.bind(this,function(z,C,F,G){var H=this.actions.get(F);null!=H&&(F=function(){H.isEnabled()&&H.funct.apply(this,arguments)},C?G?c.bindControlShiftKey(z,F):c.bindControlKey(z,F):G?c.bindShiftKey(z,F):c.bindKey(z,F))});var x=this,v=c.escape;c.escape=function(z){v.apply(this,arguments)};c.enter=function(){};c.bindControlShiftKey(36,function(){g.exitGroup()});c.bindControlShiftKey(35,function(){g.enterGroup()});c.bindShiftKey(36,function(){g.home()});c.bindKey(35,function(){g.refresh()});c.bindAction(80, !0,"print");c.bindAction(107,!0,"zoomIn");c.bindAction(109,!0,"zoomOut");c.bindAction(61,!0,"zoomIn");c.bindAction(187,!0,"zoomIn");c.bindAction(222,!0,"zoomIn");c.bindAction(173,!0,"zoomOut");c.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)c.bindAction(79,!0,"outline",!0),c.bindControlKey(36,function(){g.isEnabled()&&g.foldCells(!0)}),c.bindControlKey(35,function(){g.isEnabled()&&g.foldCells(!1)}),c.bindControlKey(13,function(){x.ctrlEnter()}),c.bindAction(8,!1,"delete"), c.bindAction(8,!0,"deleteAll"),c.bindAction(8,!1,"deleteLabels",!0),c.bindAction(46,!1,"delete"),c.bindAction(46,!0,"deleteAll"),c.bindAction(46,!1,"deleteLabels",!0),c.bindAction(36,!1,"resetView"),c.bindAction(72,!0,"fitWindow",!0),c.bindAction(74,!0,"fitPage"),c.bindAction(74,!0,"fitTwoPages",!0),c.bindAction(48,!0,"customZoom"),c.bindAction(82,!0,"turn"),c.bindAction(82,!0,"clearDefaultStyle",!0),c.bindAction(83,!0,"save"),c.bindAction(83,!0,"saveAs",!0),c.bindAction(65,!0,"selectAll"),c.bindAction(65, !0,"selectNone",!0),"1"!=urlParams.dev&&c.bindAction(73,!0,"selectVertices",!0),c.bindAction(69,!0,"selectEdges",!0),c.bindAction(69,!0,"editStyle"),c.bindAction(66,!0,"bold"),c.bindAction(66,!0,"toBack",!0),c.bindAction(70,!0,"toFront",!0),c.bindAction(68,!0,"duplicate"),c.bindAction(68,!0,"setAsDefaultStyle",!0),c.bindAction(90,!0,"undo"),c.bindAction(90,!0,"redo",!0),c.bindAction(89,!0,"redo"),c.bindAction(89,!0,"autosize",!0),c.bindAction(88,!0,"cut"),c.bindAction(67,!0,"copy"),c.bindAction(86, !0,"paste"),c.bindAction(71,!0,"group"),c.bindAction(77,!0,"editData"),c.bindAction(71,!0,"grid",!0),c.bindAction(73,!0,"italic"),c.bindAction(76,!0,"lockUnlock"),c.bindAction(76,!0,"layers",!0),c.bindAction(80,!0,"format",!0),c.bindAction(85,!0,"underline"),c.bindAction(85,!0,"ungroup",!0),c.bindAction(109,!0,"decreaseFontSize",!0),c.bindAction(107,!0,"increaseFontSize",!0),c.bindAction(219,!0,"decreaseFontSize",!0),c.bindAction(221,!0,"increaseFontSize",!0),c.bindAction(190,!0,"superscript"),c.bindAction(188, !0,"subscript"),c.bindAction(13,!1,"keyPressEnter"),c.bindKey(113,function(){g.isEnabled()&&g.startEditingAtCell()});return c};EditorUi.prototype.createMenuElement=function(a,b,d){var e=document.createElement("a");this.addMenuHandler(e,b,d);mxUtils.write(e,a);e.className="geItem";return e}; EditorUi.prototype.addMenuHandler=function(a,b,d,e){if(null!=b){var g=null,c=!0,h=mxUtils.bind(this,function(k){null!=d&&d(k);if(!mxEvent.isConsumed(k)&&c&&(null==a.enabled||a.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var p=new mxPopupMenu(b);p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);this.resetCurrentMenu();g=null;p.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu(); var l=mxUtils.getOffset(a);p.popup(l.x,l.y+a.offsetHeight,null,k);this.setCurrentMenu(p,a);g=p}e||mxEvent.consume(k)});mxEvent.addListener(a,"mousemove",mxUtils.bind(this,function(k){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=a&&null!=this.currentMenuElt){var p=this.currentMenuElt;this.hideCurrentMenu();p.parentNode==a.parentNode&&"INPUT"!=a.nodeName&&h(k)}}));mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(k){!this.menus.autoPopup&& null!=this.currentMenu&&this.currentMenuElt!=a&&mxEvent.isMouseEvent(k)&&this.hideCurrentMenu();c=null==this.currentMenu;"INPUT"!=mxEvent.getSource(k).nodeName?k.preventDefault():k.stopPropagation()}));mxEvent.addListener(a,"click",mxUtils.bind(this,function(k){h(k);c=!0}));e&&(mxEvent.addListener(a,"focus",mxUtils.bind(this,function(k){h(k);c=!0})),mxEvent.addListener(a,"blur",mxUtils.bind(this,function(k){this.currentMenu==g&&this.hideCurrentMenu()})),mxEvent.addListener(a,"keyup",mxUtils.bind(this, function(k){38!=k.keyCode&&40!=k.keyCode&&(this.hideCurrentMenu(),13!=k.keyCode&&27!=k.keyCode&&(h(k),c=!0))})))}}; EditorUi.prototype.addShapePicker=function(a,b){var d=this.editor.graph;mxEvent.addListener(a,"click",mxUtils.bind(this,function(e){if(this.isShapePickerVisible())this.hideShapePicker();else{var g=mxUtils.getOffset(a);Editor.inlineFullscreen||null==this.embedViewport?b?(g.x-=this.diagramContainer.offsetLeft+30,g.y=a.offsetHeight-2):(g.x+=16+a.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,g.y+=20):(g.x=0,g.y=a.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24, g.x)),this.diagramContainer.scrollTop+g.y,null,null,null,null,mxUtils.bind(this,function(c){return d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(c,!0))}),b,!1)}mxEvent.consume(e)}))}; EditorUi.prototype.createZoomInput=function(a){var b=document.createElement("input");b.className="geButton geZoomInput";b.style.backgroundImage="url("+Editor.thinExpandImage+")";b.setAttribute("type","text");b.setAttribute("value","100%");var d=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){b.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));(a||mxClient.IS_TOUCH)&&b.setAttribute("readonly","true");var e=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this, function(g){e=!1;mxClient.IS_TOUCH||mxEvent.getSource(g)!=b||document.activeElement==b||(b.focus(),mxClient.IS_GC||mxClient.IS_FF?b.select():document.execCommand("selectAll",!1,null),e=!0)}),mxUtils.bind(this,function(g){mxEvent.getSource(g)==b&&e&&mxEvent.consume(g)}),mxUtils.bind(this,function(g){e&&(mxEvent.consume(g),e=!1)}));this.addMenuHandler(b,d.funct);mxUtils.bind(this,function(g){mxEvent.addListener(g,"click",mxUtils.bind(this,function(h){mxEvent.isAltDown(h)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(), mxEvent.consume(h)):mxEvent.isShiftDown(h)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(h))}));var c=mxUtils.bind(this,function(h,k,p){b.value=Math.round(100*this.editor.graph.view.scale*(null!=p?p:1))+"%";document.activeElement==b&&this.editor.graph.container.focus()});mxEvent.addListener(b,"keydown",mxUtils.bind(this,function(h){if(27==h.keyCode||13==h.keyCode||9==h.keyCode)27==h.keyCode||isNaN(parseInt(b.value))?c():this.editor.graph.zoomTo(parseInt(b.value)/100), this.hideCurrentMenu(),mxEvent.consume(h)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,c);this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",c);mxEvent.addListener(b,"blur",c);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(h,k){c(h,k,k.getProperty("factor"))}))})(b);return b}; EditorUi.prototype.createHelpIcon=function(a,b){b=document.createElement("img");b.setAttribute("src",Editor.helpImage);b.setAttribute("title",mxResources.get("help")+" ("+a+")");b.className="geHelpIcon";mxEvent.addGestureListeners(b,mxUtils.bind(this,function(d){this.hideCurrentMenu();this.openLink(a);mxEvent.consume(d)}));return b}; EditorUi.prototype.destroy=function(){var a=this.editor.graph;null!=a&&null!=this.selectionStateListener&&(a.getSelectionModel().removeListener(this.selectionStateListener),a.getModel().removeListener(this.selectionStateListener),a.getView().removeListener(this.selectionStateListener),a.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.inlineToolbar&&(this.inlineToolbar.destroy(),this.inlineToolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar= 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.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(a= 0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}var b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};function Sidebar(a,b){this.editorUi=a;this.container=b;this.container.setAttribute("title",mxResources.get("sidebarTooltip"));this.palettes={};this.taglist=Object.create(null);this.lastCreated=0;this.showTooltips=!0;this.graph=a.createTemporaryGraph(this.editorUi.editor.graph.getStylesheet());this.graph.cellRenderer.minSvgStrokeWidth=this.minThumbStrokeWidth;this.graph.cellRenderer.antiAlias=this.thumbAntiAlias;this.graph.container.style.visibility="hidden";this.graph.shapeBackgroundColor="transparent"; this.graph.foldingEnabled=!1;this.initialDefaultVertexStyle=mxUtils.clone(a.editor.graph.defaultVertexStyle);this.initialDefaultEdgeStyle=mxUtils.clone(a.editor.graph.defaultEdgeStyle);this.ignoredStyles="html whiteSpace aspect points verticalLabelPosition labelPosition outlineConnect".split(" ").concat(Graph.cellStyles);this.wrapper=document.createElement("div");this.container.appendChild(this.wrapper);a=this.createMoreShapes();this.container.appendChild(a);document.body.appendChild(this.graph.container); this.pointerUpHandler=mxUtils.bind(this,function(){if(null==this.tooltipCloseImage||"none"==this.tooltipCloseImage.style.display)this.showTooltips=!0,this.hideTooltip()});this.pointerDownHandler=mxUtils.bind(this,function(d){null==this.tooltipCloseImage||"none"==this.tooltipCloseImage.style.display?(this.showTooltips=!1,this.hideTooltip()):null==this.tooltip||"none"==this.tooltip.style.display||mxUtils.isAncestorNode(this.tooltip,mxEvent.getSource(d))||this.hideTooltip()});this.pointerMoveHandler= mxUtils.bind(this,function(d){if(300<Date.now()-this.lastCreated&&(null==this.tooltipCloseImage||"none"==this.tooltipCloseImage.style.display)){for(d=mxEvent.getSource(d);null!=d;){if(d==this.currentElt)return;d=d.parentNode}this.hideTooltip()}});this.pointerOutHandler=mxUtils.bind(this,function(d){null==d.toElement&&null==d.relatedTarget&&this.hideTooltip()});window.addEventListener?(document.addEventListener(mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler,!0),document.addEventListener(mxClient.IS_POINTER? "pointerdown":"mousedown",this.pointerDownHandler,!0),document.addEventListener(mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler,!0),document.addEventListener(mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler,!0)):(mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove": "mousemove",this.pointerMoveHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler));mxEvent.addListener(b,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0;this.hideTooltip()}));this.escapeListener=mxUtils.bind(this,function(d,e){null!=this.activeDragSource&&this.activeDragSource.isActive()&&this.activeDragSource.reset()});this.editorUi.editor.graph.addListener(mxEvent.ESCAPE,this.escapeListener);this.refreshListener=mxUtils.bind(this,function(d, e){this.refresh()});this.editorUi.addListener("sidebarTitlesChanged",this.refreshListener);this.editorUi.addListener("languageChanged",this.refreshListener);this.init()} Sidebar.prototype.init=function(){var a=STENCIL_PATH;this.addSearchPalette(!0);this.addGeneralPalette(!0);this.addMiscPalette(!1);this.addAdvancedPalette(!1);this.addBasicPalette(a);this.setCurrentSearchEntryLibrary("arrows");this.addStencilPalette("arrows",mxResources.get("arrows"),a+"/arrows.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2");this.setCurrentSearchEntryLibrary();this.addUmlPalette(!1);this.addBpmnPalette(a,!1);this.setCurrentSearchEntryLibrary("flowchart"); this.addStencilPalette("flowchart","Flowchart",a+"/flowchart.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2");this.setCurrentSearchEntryLibrary();this.setCurrentSearchEntryLibrary("clipart");this.addImagePalette("clipart",mxResources.get("clipart"),a+"/clipart/","_128x128.png","Earth_globe Empty_Folder Full_Folder Gear Lock Software Virus Email Database Router_Icon iPad iMac Laptop MacBook Monitor_Tower Printer Server_Tower Workstation Firewall_02 Wireless_Router_N Credit_Card Piggy_Bank Graph Safe Shopping_Cart Suit1 Suit2 Suit3 Pilot1 Worker1 Soldier1 Doctor1 Tech1 Security1 Telesales1".split(" "), null,{Wireless_Router_N:"wireless router switch wap wifi access point wlan",Router_Icon:"router switch"});this.setCurrentSearchEntryLibrary()};Sidebar.prototype.enableTooltips=!0;Sidebar.prototype.tooltipBorder=16;Sidebar.prototype.tooltipDelay=300;Sidebar.prototype.dropTargetDelay=200;Sidebar.prototype.gearImage=STENCIL_PATH+"/clipart/Gear_128x128.png";Sidebar.prototype.thumbWidth=38;Sidebar.prototype.thumbHeight=38;Sidebar.prototype.minThumbStrokeWidth=1;Sidebar.prototype.thumbAntiAlias=!1; Sidebar.prototype.thumbBorder=2;Sidebar.prototype.livePreview=!0;Sidebar.prototype.searchClosedLibraries=!0;Sidebar.prototype.closedLibraryOpacity=null;Sidebar.prototype.librarySearchWeights=null;Sidebar.prototype.isImageSearchSupported=function(){return!1};"large"!=urlParams["sidebar-entries"]&&(Sidebar.prototype.thumbBorder=1,Sidebar.prototype.thumbWidth=32,Sidebar.prototype.thumbHeight=30,Sidebar.prototype.minThumbStrokeWidth=1.3,Sidebar.prototype.thumbAntiAlias=!0); Sidebar.prototype.virtualThumbs="undefined"!=typeof IntersectionObserver;Sidebar.prototype.virtualPalettes="undefined"!=typeof IntersectionObserver;Sidebar.prototype.deferredPaletteHeight=60;Sidebar.prototype.sidebarTitleSize=8;Sidebar.prototype.sidebarTitles=!1;Sidebar.prototype.tooltipTitles=!0;Sidebar.prototype.maxTooltipWidth=400;Sidebar.prototype.maxTooltipHeight=400;Sidebar.prototype.maxTooltipZoom=2;Sidebar.prototype.addStencilsToIndex=!0;Sidebar.prototype.defaultImageWidth=80; Sidebar.prototype.defaultImageHeight=80;Sidebar.prototype.tooltipMouseDown=null;Sidebar.prototype.expandLibraries=!0; Sidebar.prototype.refresh=function(){this.graph.stylesheet.styles=mxUtils.clone(this.editorUi.editor.graph.getStylesheet().styles);var a=this.wrapper.scrollTop;this.disconnectObservers();this.wrapper.innerText="";var b=this.palettes;this.palettes={};var d=this.addPalette;this.addPalette=function(e,g,c,h){c=this.wasPaletteExpanded(b,e,c);return d.apply(this,arguments)};this.init(b);this.addPalette=d;window.setTimeout(mxUtils.bind(this,function(){this.wrapper.scrollTop=a}),0)}; Sidebar.prototype.wasPaletteExpanded=function(a,b,d){a=null!=a&&null!=b?a[b]:null;null!=a&&2==a.length&&null!=a[1].firstChild&&(d="none"!=a[1].firstChild.style.display);return d};Sidebar.prototype.getEntryContainer=function(){return this.wrapper};Sidebar.prototype.appendChild=function(a){this.wrapper.appendChild(a)}; Sidebar.prototype.getTooltipOffset=function(a,b){if(mxUtils.isAncestorNode(this.container,a))return b=b.height+2*this.tooltipBorder,new mxPoint(this.container.offsetWidth+2+this.editorUi.container.offsetLeft,Math.min(Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)-b-20,Math.max(0,this.editorUi.container.offsetTop+this.container.offsetTop+a.offsetTop-this.wrapper.scrollTop-b/2+16)));a=a.getBoundingClientRect();return new mxPoint(a.x+a.width+this.tooltipBorder,a.y+a.height/ 2-b.height/2-6)}; Sidebar.prototype.createMoreShapes=function(){var a=this.editorUi.createDiv("geSidebarFooter"),b=document.createElement("button");b.className="geBtn gePrimaryBtn";this.editorUi.dependsOnLanguage(mxUtils.bind(this,function(){b.innerHTML="<span>+</span>";mxUtils.write(b,mxResources.get("moreShapes"));b.setAttribute("title",mxResources.get("moreShapes"))}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){this.editorUi.actions.get("shapes").funct();mxEvent.consume(d)}));mxEvent.preventDefault(b);a.appendChild(b); return a}; Sidebar.prototype.createTooltip=function(a,b,d,e,g,c,h,k,p,l,u){u=null!=u?u:!0;this.tooltipMouseDown=p;p=this.editorUi.editor.graph;if(null==this.tooltip){this.tooltip=document.createElement("div");this.tooltip.className="geSidebarTooltip";this.tooltip.style.userSelect="none";this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1;document.body.appendChild(this.tooltip);mxEvent.addMouseWheelListener(mxUtils.bind(this,function(z,C,F,G,H){if("none"!=this.tooltipZoomControls.style.display){F=this.graph2.zoomFactor; null!=z.deltaY&&40>Math.abs(z.deltaY)&&Math.round(z.deltaY)!=z.deltaY&&(F=1+Math.abs(z.deltaY)/20*(F-1));var J=this.tooltipContent.getBoundingClientRect();this.setTooltipZoom(this.tooltipZoom*(C?F:1/F),(null!=G?G:mxEvent.getClientX(z))-J.left,(null!=H?H:mxEvent.getClientY(z))-J.top);mxEvent.consume(z)}else this.hideTooltip()}),this.tooltip);this.tooltipContent=document.createElement("div");this.tooltipContent.style.width="100%";this.tooltipContent.style.height="100%";this.tooltip.appendChild(this.tooltipContent); this.graph2=new Graph(this.tooltipContent,null,null,this.editorUi.editor.graph.getStylesheet());this.graph2.shapeBackgroundColor=this.graph.shapeBackgroundColor;this.graph2.resetViewOnRootChange=!1;this.graph2.foldingEnabled=!1;this.graph2.gridEnabled=!1;this.graph2.autoScroll=!1;this.graph2.setTooltips(!1);this.graph2.setConnectable(!1);this.graph2.setPanning(!1);this.graph2.setEnabled(!1);if(this.graph2.dialect==mxConstants.DIALECT_SVG){var x=this.graph2.view.getDrawPane().ownerSVGElement;null!= x&&(x.style.overflow="visible")}else this.graph2.view.canvas.style.overflow="visible";this.graph2.openLink=mxUtils.bind(this,function(){this.hideTooltip()});mxEvent.addGestureListeners(this.tooltip,mxUtils.bind(this,function(z){mxUtils.isAncestorNode(this.tooltipZoomControls,mxEvent.getSource(z))||(null!=this.tooltipMouseDown&&this.tooltipMouseDown(z),window.setTimeout(mxUtils.bind(this,function(){null!=this.tooltipCloseImage&&"none"!=this.tooltipCloseImage.style.display||this.hideTooltip()}),0))}), null,mxUtils.bind(this,function(z){this.isTooltipZoomed()||mxUtils.isAncestorNode(this.tooltipZoomControls,mxEvent.getSource(z))||this.hideTooltip()}));mxEvent.addGestureListeners(this.tooltipContent,mxUtils.bind(this,function(z){if(this.isTooltipZoomed()&&0!=z.isPrimary&&(!mxEvent.isMouseEvent(z)||mxEvent.isLeftMouseButton(z))){var C=this.tooltipContent,F=C.getBoundingClientRect(),G=mxEvent.getClientX(z),H=mxEvent.getClientY(z);if(G-F.left<C.clientWidth&&H-F.top<C.clientHeight){var J=C.scrollLeft, O=C.scrollTop;C.style.cursor="grabbing";var M=function(Q){C.scrollLeft=J-mxEvent.getClientX(Q)+G;C.scrollTop=O-mxEvent.getClientY(Q)+H;mxEvent.consume(Q)},V=mxUtils.bind(this,function(Q){mxEvent.removeGestureListeners(document,null,M,V);C.style.cursor=this.isTooltipZoomed()?"grab":""});mxEvent.addGestureListeners(document,null,M,V);mxEvent.consume(z,!0,!1)}}}));x=document.createElement("img");x.setAttribute("src",Editor.crossImage);x.setAttribute("title",mxResources.get("close"));x.className="geButton"; this.tooltip.appendChild(x);this.tooltipCloseImage=x;mxEvent.addListener(x,"click",mxUtils.bind(this,function(z){this.hideTooltip();mxEvent.consume(z)}));var v=document.createElement("div");v.style.position="absolute";v.style.right="26px";v.style.top="2px";v.style.whiteSpace="nowrap";this.tooltip.appendChild(v);this.tooltipZoomControls=v;x=mxUtils.bind(this,function(z,C,F){var G=document.createElement("img");G.setAttribute("src",z);G.setAttribute("title",C);G.className="geButton";G.style.position= "static";v.appendChild(G);mxEvent.addListener(G,"click",mxUtils.bind(this,function(H){F();mxEvent.consume(H)}))});x(Editor.zoomInImage,mxResources.get("zoomIn"),mxUtils.bind(this,function(){this.setTooltipZoom(this.tooltipZoom*this.graph2.zoomFactor)}));x(Editor.zoomOutImage,mxResources.get("zoomOut"),mxUtils.bind(this,function(){this.setTooltipZoom(this.tooltipZoom/this.graph2.zoomFactor)}));x(Editor.zoomFitImage,mxResources.get("fit"),mxUtils.bind(this,function(){this.setTooltipZoom(this.tooltipFitScale)}))}this.tooltipCloseImage.style.display= l?"":"none";this.graph2.model.clear();this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder);this.graph2.view.scale=!k&&(d>this.maxTooltipWidth||e>this.maxTooltipHeight)?Math.round(100*Math.min(this.maxTooltipWidth/d,this.maxTooltipHeight/e))/100:1;this.tooltip.style.display="block";this.graph2.labelsVisible=null==c||c;c=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;null!=b&&(b=this.graph2.cloneCells(b),this.graph2.pasteCellStyles(p.includeDescendants(b),u?p.currentVertexStyle: p.defaultVertexStyle,u?p.currentEdgeStyle:p.defaultEdgeStyle,null,p.pasteEdgeStyle,u?p.pasteStylesToText:!1),this.graph2.addCells(b));mxClient.NO_FO=c;u=this.graph2.getGraphBounds();this.tooltipFitScale=null;k&&0<d&&0<e&&(u.width>d||u.height>e)?(d=Math.round(100*Math.min(d/u.width,e/u.height))/100,mxClient.NO_FO?(this.graph2.view.setScale(Math.round(100*Math.min(this.maxTooltipWidth/u.width,this.maxTooltipHeight/u.height))/100),u=this.graph2.getGraphBounds()):(this.tooltipFitScale=d,this.tooltipDocWidth= u.width+2*this.tooltipBorder+4,this.tooltipDocHeight=u.height+2*this.tooltipBorder,this.graph2.view.getDrawPane().ownerSVGElement.style.transform="scale("+d+")",this.graph2.view.getDrawPane().ownerSVGElement.style.transformOrigin="0 0",u.width*=d,u.height*=d)):mxClient.NO_FO||(this.graph2.view.getDrawPane().ownerSVGElement.style.transform="");this.tooltipZoom=this.tooltipFitScale;this.tooltipZoomControls.style.display=l&&null!=this.tooltipFitScale?"":"none";this.tooltipContent.style.overflow="visible"; this.tooltipContent.style.cursor="";mxClient.NO_FO||(x=this.graph2.view.getDrawPane().ownerSVGElement,x.style.width="100%",x.style.height="100%");l=u.width+2*this.tooltipBorder+4;e=u.height+2*this.tooltipBorder;this.tooltip.style.overflow="visible";this.tooltip.style.width=l+"px";this.tooltipContent.style.height=e+"px";d=l;this.tooltipTitles&&null!=g&&0<g.length?(null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTopStyle="solid",this.tooltipTitle.style.borderTopWidth= "1px",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",this.tooltipTitle.style.position="absolute",this.tooltipTitle.style.paddingTop="6px",this.tooltipTitle.style.bottom="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerText="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g),this.tooltipTitle.setAttribute("title",g),d=Math.min(this.maxTooltipWidth,Math.max(l,this.tooltipTitle.scrollWidth+ 4)),g=this.tooltipTitle.offsetHeight+10,e+=g,this.tooltipTitle.style.marginTop=2-g+"px"):null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");d>l&&(this.tooltip.style.width=d+"px");this.tooltip.style.height=e+"px";g=-Math.round(u.x-this.tooltipBorder)+(d>l?(d-l)/2:0);d>l&&null!=this.tooltipFitScale&&(this.tooltipDocWidth+=(d-l)/2);l=-Math.round(u.y-this.tooltipBorder);h=null!=h?h:this.getTooltipOffset(a,u);a=h.x;h=h.y;this.tooltipDx=g;this.tooltipDy= l;0!=g||0!=l?this.graph2.view.canvas.setAttribute("transform","translate("+g+","+l+")"):this.graph2.view.canvas.removeAttribute("transform");this.tooltip.style.position="absolute";this.tooltip.style.left=Math.max(0,a)+"px";this.tooltip.style.top=Math.max(0,h)+"px";mxUtils.fit(this.tooltip,this.tooltipBorder);this.lastCreated=Date.now()};Sidebar.prototype.isTooltipZoomed=function(){return null!=this.tooltipFitScale&&this.tooltipZoom>this.tooltipFitScale}; Sidebar.prototype.setTooltipZoom=function(a,b,d){if(null!=this.tooltipFitScale){a=Math.max(this.tooltipFitScale,Math.min(this.maxTooltipZoom,a));var e=this.graph2.view.getDrawPane().ownerSVGElement,g=this.tooltipContent;b=null!=b?b:g.clientWidth/2;d=null!=d?d:g.clientHeight/2;var c=(g.scrollLeft+b)/this.tooltipZoom,h=(g.scrollTop+d)/this.tooltipZoom;this.tooltipZoom=a;this.isTooltipZoomed()?(this.graph2.view.canvas.setAttribute("transform","scale("+a+") translate("+this.tooltipDx+","+this.tooltipDy+ ")"),e.style.transform="",e.style.width=Math.ceil(this.tooltipDocWidth*a)+"px",e.style.height=Math.ceil(this.tooltipDocHeight*a)+"px",g.style.overflow="auto",g.scrollLeft=Math.round(c*a-b),g.scrollTop=Math.round(h*a-d)):(0!=this.tooltipDx||0!=this.tooltipDy?this.graph2.view.canvas.setAttribute("transform","translate("+this.tooltipDx+","+this.tooltipDy+")"):this.graph2.view.canvas.removeAttribute("transform"),e.style.transform="scale("+this.tooltipFitScale+")",e.style.transformOrigin="0 0",e.style.width= "100%",e.style.height="100%",g.style.overflow="visible");g.style.cursor=this.isTooltipZoomed()?"grab":""}};Sidebar.prototype.showTooltip=function(a,b,d,e,g,c,h){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=a){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var k=mxUtils.bind(this,function(){this.createTooltip(a,b,d,e,g,c,h)});null!=this.tooltip&&"none"!=this.tooltip.style.display?k():this.thread=window.setTimeout(k,this.tooltipDelay);this.currentElt=a}}; Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);null!=this.tooltip&&(this.tooltip.style.display="none",this.currentElt=null);this.tooltipMouseDown=null};Sidebar.prototype.addDataEntry=function(a,b,d,e,g){null==a&&(a="");null!=e&&(a+=" "+e);return this.addEntry(a,mxUtils.bind(this,function(){return this.createVertexTemplateFromData(g,b,d,e)}))}; Sidebar.prototype.addEntries=function(a,b){for(var d=0;d<a.length;d++)mxUtils.bind(this,function(e){var g=e.data,c=null!=e.title?e.title:"";null!=e.tags&&(c+=" "+e.tags);null!=b&&(c+=" "+b);null!=g&&0<c.length?this.addEntry(c,mxUtils.bind(this,function(){g=this.editorUi.convertDataUri(g);var h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==e.aspect&&(h+="aspect=fixed;");return this.createVertexTemplate(h+"image="+g,e.w,e.h,"",e.title||"",!1,!1,!0)})):null!=e.xml&& 0<c.length&&this.addEntry(c,mxUtils.bind(this,function(){var h=this.editorUi.stringToCells("<"==e.xml.charAt(0)?e.xml:Graph.decompress(e.xml));return this.createVertexTemplateFromCells(h,e.w,e.h,e.title||"",!0,!1,!0)}))})(a[d])};Sidebar.prototype.setCurrentSearchEntryLibrary=function(a,b){this.currentSearchEntryLibrary=null!=a?{id:a,lib:b}:null}; Sidebar.prototype.getKeyStyle=function(a){var b=[];if("string"===typeof a){a=a.split(";");for(var d=0;d<a.length;d++){var e=a[d].split("=");1<e.length&&0>mxUtils.indexOf(this.ignoredStyles,e[0])&&b.push(e[0]+"="+e[1])}}return b.join(";")};Sidebar.prototype.addLibForStyle=function(a,b){""!=a&&(null==this.styleToLibs&&(this.styleToLibs={}),null==this.styleToLibs[a]&&(this.styleToLibs[a]=[]),this.styleToLibs[a].push(b))}; Sidebar.prototype.getLibsForStyle=function(a){return null!=this.styleToLibs?this.styleToLibs[a]:null}; Sidebar.prototype.addEntry=function(a,b){if(null!=this.currentSearchEntryLibrary){var d=this,e=this.createVertexTemplateFromCells;this.createVertexTemplateFromCells=function(k,p,l,u,x){if(null!=k)for(p=0;p<k.length;p++)d.addLibForStyle(d.getKeyStyle(k[p].style),this.currentSearchEntryLibrary)};try{b()}finally{this.createVertexTemplateFromCells=e}}if(null!=this.taglist&&"string"===typeof a&&0<a.length){null!=this.currentSearchEntryLibrary&&(b.parentLibraries=[this.currentSearchEntryLibrary]);a=a.toLowerCase().replace(/[\/,\(\)]/g, " ").split(" ");e=[];for(var g={},c=0;c<a.length;c++){null==g[a[c]]&&(g[a[c]]=!0,e.push(a[c]));var h=Editor.soundex(a[c].replace(/\.*\d*$/,""));h!=a[c]&&null==g[h]&&(g[h]=!0,e.push(h))}for(c=0;c<e.length;c++)this.addEntryForTag(e[c],b)}return b};Sidebar.prototype.addEntryForTag=function(a,b){if(null!=a&&1<a.length){var d=this.taglist[a];"object"!==typeof d&&(d={entries:[]},this.taglist[a]=d);d.entries.push(b)}}; Sidebar.prototype.isEntryIgnored=function(a,b){b=!b;if(null!=a.parentLibraries&&b)for(var d=0;d<a.parentLibraries.length;d++)if(this.isEntryVisible(a.parentLibraries[d].id)){b=!1;break}return b};Sidebar.prototype.getEntrySearchWeight=function(a){var b=0;if(null!=this.librarySearchWeights&&null!=a.parentLibraries)for(var d=0;d<a.parentLibraries.length;d++){var e=this.librarySearchWeights[a.parentLibraries[d].id];e="number"===typeof e?e:0;b=0==d?e:Math.max(b,e)}return b}; Sidebar.prototype.splitCompoundToken=function(a){return a.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([a-zA-Z])(\d)/g,"$1 $2").replace(/(\d)([a-zA-Z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(function(b){return 2<=b.length})};Sidebar.prototype.isTagMatchBoundary=function(a,b){if(0==b)return!0;var d=a.charCodeAt(b-1);a=a.charCodeAt(b);return(b=48<=d&&57>=d)||97<=d&&122>=d?b!=(48<=a&&57>=a):!0}; Sidebar.prototype.matchPartialEntries=function(a,b,d,e){if(2<=a.length)for(var g in this.taglist){var c=g.charCodeAt(0);if(!(65<=c&&90>=c||g===a)){var h=g.indexOf(a);if(0<=h&&(c=this.taglist[g],"object"===typeof c&&null!=c.entries)){for(var k=!1;0<=h&&!k;)h=(k=this.isTagMatchBoundary(g,h))?h:g.indexOf(a,h+1);if(k||4<=a.length)for(k=k?d:e,c=c.entries,h=0;h<c.length;h++)null==b.get(c[h])&&(b.put(c[h],!0),k.push(c[h]))}}}}; Sidebar.prototype.matchTermEntries=function(a,b){var d=[],e=[],g=[],c=[],h=this.taglist[a];null!=h&&(d=h.entries.slice());if(null!=b&&(h=b[a],null!=h&&h!==a&&(h=this.taglist[h],null!=h)))for(b=0;b<h.entries.length;b++)0>mxUtils.indexOf(d,h.entries[b])&&d.push(h.entries[b]);h=new mxDictionary;for(b=0;b<d.length;b++)h.put(d[b],!0);this.matchPartialEntries(a,h,e,g);h=Editor.soundex(a.replace(/\.*\d*$/,""));0<h.length&&h!==a&&(h=this.taglist[h],null!=h&&(c=h.entries.slice()));return{exact:d,prefix:e, substring:g,phonetic:c}}; Sidebar.prototype.getResourceReverseMap=function(){var a=mxClient.language||"en";if(null==this.resourceReverseMap||this.resourceReverseLang!==a)if(this.resourceReverseMap=Object.create(null),this.resourceReverseLang=a,"en"!==a&&null!=mxResources.resources)for(var b in mxResources.resources)a=mxResources.resources[b],null!=a&&"string"===typeof a&&a!==b&&(a=a.replace(/[\u200e\u200f\u202a-\u202e]/g,"").toLowerCase(),0<a.length&&a!==b&&null==this.resourceReverseMap[a]&&(this.resourceReverseMap[a]=b)); return this.resourceReverseMap}; Sidebar.prototype.searchEntries=function(a,b,d,e,g,c,h){if(null!=this.taglist&&null!=a){"mxgraph."==a.substring(0,8)&&0>a.indexOf(" ")&&8<a.lastIndexOf(".")&&(a=a.substring(8).replace(/\./g," "));var k=a.toLowerCase().split(" "),p=[],l=Object.create(null);for(g=0;g<k.length;g++){var u=this.splitCompoundToken(k[g]);0==u.length&&2<=k[g].length&&(u=[k[g]]);for(h=0;h<u.length;h++)l[u[h]]||(l[u[h]]=!0,p.push(u[h]))}h=this.getResourceReverseMap();1<p.length&&(g=h[a.toLowerCase().replace(/\s+/g," ").trim()], null==g||l[g]||null==this.taglist[g]||(l[g]=!0,p.push(g)));a=[];for(g=0;g<p.length;g++)a.push(this.matchTermEntries(p[g],h));var x=new mxDictionary;k=null;var v=0;u=!1;for(g=0;g<a.length;g++){var z=a[g].exact.concat(a[g].prefix,a[g].substring,a[g].phonetic),C=new mxDictionary;if(0<z.length)for(k=[],h=0;h<z.length;h++)l=z[h],0==v==(null==x.get(l))&&null==C.get(l)&&(C.put(l,l),k.push(l));else k=[];x=C;v++;if(0==k.length&&g<a.length-1){u=!0;break}}x=[1,.8,.6,.5];var F=new mxDictionary;v=new mxDictionary; z=null;if(!u&&null!=k&&0<k.length)for(z=new mxDictionary,g=0;g<k.length;g++)z.put(k[g],!0);for(g=0;g<a.length;g++)for(k=new mxDictionary,u=[a[g].exact,a[g].prefix,a[g].substring,a[g].phonetic],C=0;C<u.length;C++)for(h=0;h<u[C].length;h++)if(l=u[C][h],(null==z||null!=z.get(l))&&null==k.get(l)){var G=F.get(l);k.put(l,!0);F.put(l,(G||0)+x[C]);v.put(l,l)}var H=[];v.visit(mxUtils.bind(this,function(J,O){H.push({entry:O,score:F.get(O)||0,weight:this.getEntrySearchWeight(O)})}));H.sort(function(J,O){return O.score- J.score||O.weight-J.weight});h=[];for(g=0;g<H.length;g++)this.isEntryIgnored(H[g].entry,c)||h.push(H[g].entry);c=h.length;g=(d+1)*b<c;e(h.slice(d*b,(d+1)*b),c,g,p)}else e([],null,null,p)};Sidebar.prototype.filterTags=function(a){if(null!=a){a=a.split(" ");for(var b=[],d={},e=0;e<a.length;e++)null==d[a[e]]&&(d[a[e]]="1",b.push(a[e]));return b.join(" ")}return null};Sidebar.prototype.cloneCell=function(a,b){a=a.clone();null!=b&&(a.value=b);return a}; Sidebar.prototype.showPopupMenuForEntry=function(a,b,d){}; Sidebar.prototype.addSearchPalette=function(a){function b(N,R){G=R;N=N.firstChild.nextSibling.nextSibling;R=document.createElement("span");R.style.color="gray";R.innerHTML="Enter";N.appendChild(R)}function d(N,R){H=R;null!=O&&null!=O.parentNode&&O.parentNode.removeChild(O);N=N.firstChild.nextSibling.nextSibling;O=document.createElement("span");O.style.color="gray";O.innerHTML=mxClient.IS_MAC?"Cmd+Enter":"Ctrl+Enter";N.appendChild(O)}function e(){u.setAttribute("src",Editor.magnifyImage);u.setAttribute("title", mxResources.get("search"));V.style.display="none";ma=l.value="";ka()}var g=this.editorUi,c=g.editor.graph,h=document.createElement("div");h.style.visibility="hidden";this.appendChild(h);var k=document.createElement("div");k.className="geSidebar geSearchSidebar";a||(k.style.display="none");var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.textOverflow="clip";p.style.cursor="default";var l=document.createElement("input");l.setAttribute("id","geOmniSearch");a=mxResources.get("typeSlashToSearch"); l.setAttribute("placeholder",a);l.setAttribute("title",a);l.setAttribute("type","text");p.appendChild(l);var u=document.createElement("img");u.setAttribute("src",Editor.magnifyImage);u.setAttribute("title",mxResources.get("search"));u.className="geAdaptiveAsset";p.appendChild(u);k.appendChild(p);var x=!1;mxEvent.addGestureListeners(l,mxUtils.bind(this,function(N){x=!1;mxClient.IS_TOUCH||mxEvent.getSource(N)!=l||document.activeElement==l||(l.focus(),mxClient.IS_GC||mxClient.IS_FF?l.select():document.execCommand("selectAll", !1,null),x=!0)}),mxUtils.bind(this,function(N){mxEvent.getSource(N)==l&&x&&mxEvent.consume(N)}),mxUtils.bind(this,function(N){x&&(mxEvent.consume(N),x=!1)}));var v=[],z=mxUtils.bind(this,function(N,R){g.hideCurrentMenu();mxUtils.remove(N,v);v.unshift(N);5<v.length&&v.pop();N.funct.apply(this,R);l.value=null}),C="about deleteAll showBoundingBox createSidebarEntry downloadDesktop toggleGoogleFonts".split(" "),F=mxUtils.bind(this,function(N){var R=null,ea;for(ea in g.actions.actions){var ba=0>C.indexOf(ea)&& "test"!=ea.substring(0,4)?g.actions.get(ea):null;if(null!=ba&&ba.isEnabled()&&ba.visible){if(ea.toLowerCase()==N)return ba;for(var la=N.toLowerCase().split(" "),sa=0,T=0;T<la.length;T++)0==la[T].length?sa++:(0<=ea.toLowerCase().indexOf(la[T])||0<=ba.getTitle().toLowerCase().indexOf(la[T]))&&sa++;sa==la.length&&(0>v.indexOf(R)||null!=R&&!R.isEnabled())&&(R=ba)}}return R}),G=null,H=null,J=null,O=null,M=!1;mxEvent.addListener(l,"keyup",function(N){M&&16==N.keyCode&&(M=!1,mxEvent.consume(N))});g.addMenuHandler(l, mxUtils.bind(this,function(N,R){function ea(Sa){if(null!=Sa&&Sa.visible){var Ua=N.addItem(Sa.getTitle(),null,function(){z(Sa,arguments)},R,null,Sa.isEnabled());Sa.toggleAction&&Sa.isSelected()&&N.addCheckmark(Ua,Editor.checkmarkImage);null!=G||!Sa.isEnabled()||0!=l.value.length&&ua!=Sa||b(Ua,function(){z(Sa,arguments);c.container.focus()});null!=H||!Sa.isEnabled()||ua!=Sa&&0!=l.value.length||d(Ua,function(){z(Sa,arguments);c.container.focus()})}}J=null;var ba=N.addItem;N.addItem=function(Sa,Ua,ta, Fa,Ma,ab,Za,Xa){var Va=ba.apply(N,arguments);Va._action=ta;Va._enabled=0!=ab;return Va};var la=l.value.toLowerCase();H=G=null;var sa=N.addItem(mxResources.get("searchShapes"),null,mxUtils.bind(this,function(){Y(null,!1)}),R);b(sa,function(){Y(null,!1)});sa=N.addItem(mxResources.get("searchShapesInOpenLibraries"),null,mxUtils.bind(this,function(){Y(!1,!1)}),R).firstChild.nextSibling.nextSibling;var T=document.createElement("span");T.style.color="gray";T.innerHTML="Shift+Enter";sa.appendChild(T);this.isImageSearchSupported()&& N.addItem(mxResources.get("searchImages"),null,mxUtils.bind(this,function(){Y(null,!0)}),R);N.addItem(mxResources.get("findInDiagram"),null,mxUtils.bind(this,function(){g.hideCurrentMenu();g.showSearchWindow(!0,l.value);l.value=""}),R);Editor.enableAi&&!g.isOffline()&&g.isOwnGDriveDomain()&&g.isExternalDataComms()&&"draw.io"==g.getServiceName()&&EditorUi.isMermaidSupported()&&N.addItem(mxResources.get("generate"),null,mxUtils.bind(this,function(){g.openGenerateDialog(l.value);l.value=""}),R);!g.isOffline()&& g.isOwnGDriveDomain()&&g.isExternalDataComms()&&N.addItem(mxResources.get("help"),null,mxUtils.bind(this,function(){g.searchHelp(l.value);l.value=""}),R);N.addSeparator();var ua=0<l.value.length?F(la):null;ea(ua);for(sa=0;sa<v.length;sa++)v[sa]!=ua&&ea(v[sa]);if(0<la.length&&null!=g.pages){N.addSeparator();T=[];for(sa=0;sa<g.pages.length;sa++){var va=g.pages[sa];null!=va.getName()&&(" "==la.charAt(la.length-1)?va.getName().toLowerCase()==la.substring(0,la.length-1):0<=va.getName().toLowerCase().indexOf(la))&& T.push(va)}if(1<T.length){var Ka=g.currentPage;T.sort(function(Sa,Ua){return Sa==Ka?1:Ua==Ka?-1:0})}for(sa=0;sa<Math.min(4,T.length);sa++)(function(Sa,Ua){var ta=function(){g.selectPage(Sa);c.container.focus();l.value=""},Fa=N.addItem(Sa.getName()+" ("+mxResources.get("page")+")",null,ta,R);Ua&&(null==G&&b(Fa,ta),d(Fa,ta))})(T[sa],0==sa)}if(0<la.length&&null!=g.sidebar&&null!=g.sidebar.entries)for(N.addSeparator(),sa=0;sa<g.sidebar.entries.length;sa++)for(T=g.sidebar.entries[sa].entries,va=0;va<T.length;va++)(function(Sa){var Ua= g.sidebar.getConfigurationById(Sa.id),ta=Sa.title.toLowerCase().split(" ");null!=Ua&&0<=mxUtils.indexOf(ta,la)&&(ta=function(){var Fa=g.sidebar.showPalettes(Ua.prefix||"",Ua.libs||[Ua.id],!0);l.value="";null!=Fa&&1<Fa.length&&(null==Fa[1].firstChild||null!=Fa[1].firstChild.firstChild&&"none"!=Fa[1].firstChild.style.display||Fa[0].click(),Fa[0].scrollIntoView({behavior:"smooth"}))},Sa=N.addItem(Sa.title+" ("+mxResources.get("openLibrary")+")",null,ta,R),null==G&&b(Sa,ta),null==H&&d(Sa,ta));return!0})(T[va])}), null,!0);var V=document.createElement("div");V.style.display="none";V.style.paddingTop="8px";V.style.alignItems="center";V.style.justifyContent="center";var Q=mxUtils.button(mxResources.get("moreResults"),function(){Y()});Q.setAttribute("title",mxResources.get("moreResults"));Q.className="geBtn gePrimaryBtn";Q.style.borderRadius="16px";Q.style.padding="8px 12px";V.appendChild(Q);k.appendChild(V);var ma="",ia=!1,na=!1,Z=0,da={},pa=12,ka=mxUtils.bind(this,function(){ia=!1;this.currentSearch=null;for(var N= k.firstChild;null!=N;){var R=N.nextSibling;N!=p&&N!=V&&N.parentNode.removeChild(N);N=R}});mxEvent.addListener(u,"click",function(){u.getAttribute("src")!=Editor.magnifyImage&&e();l.focus()});var S=null,U=null;var Y=mxUtils.bind(this,function(N,R){null==N&&(N=this.searchClosedLibraries);null==R&&(R=null!=U?U:!1);g.hideCurrentMenu();pa=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10)));this.hideTooltip();if(""!=l.value){if(null!=V.parentNode){if(ma!=l.value||S!=N||U!=R)ka(),ma= l.value,S=N,U=R,da={},na=!1,Z=0;if(!ia&&!na){Q.setAttribute("disabled","true");V.style.display="flex";Q.style.cursor="wait";Q.innerHTML="";mxUtils.write(Q,mxResources.get("loading")+"...");ia=!0;var ea={};this.currentSearch=ea;try{this.searchEntries(ma,pa,Z,mxUtils.bind(this,function(ba,la,sa,T){if(this.currentSearch==ea){ba=null!=ba?ba:[];ia=!1;Z++;this.insertSearchHint(k,ma,pa,Z,ba,la,sa,T);this.insertSearchResultsHeader(k,ma,Z);0==ba.length&&1==Z&&(ma="");null!=V.parentNode&&V.parentNode.removeChild(V); la=this.virtualThumbs;this.virtualThumbs=!1;for(T=0;T<ba.length;T++)mxUtils.bind(this,function(ua){try{var va=ua();null!=this.closedLibraryOpacity&&N&&this.isEntryIgnored(ua,!1)&&(va.style.opacity=this.closedLibraryOpacity);null==da[va.innerHTML]?(da[va.innerHTML]=null!=ua.parentLibraries?ua.parentLibraries.slice():[],k.appendChild(va)):null!=ua.parentLibraries&&(da[va.innerHTML]=da[va.innerHTML].concat(ua.parentLibraries));mxEvent.addGestureListeners(va,null,null,mxUtils.bind(this,function(Ka){var Sa= da[va.innerHTML];mxEvent.isPopupTrigger(Ka)&&this.showPopupMenuForEntry(va,Sa,Ka)}));mxEvent.disableContextMenu(va)}catch(Ka){"1"==urlParams.test&&(null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(Ka.stack)):console.error(Ka))}})(ba[T]);this.virtualThumbs=la;sa?(Q.removeAttribute("disabled"),Q.innerHTML="",mxUtils.write(Q,mxResources.get("moreResults"))):(Q.innerHTML=mxResources.get("reset"),V.style.display="none",na=!0);Q.style.cursor="";k.appendChild(V)}}),mxUtils.bind(this, function(){Q.style.cursor=""}),N,R)}catch(ba){g.handleError(ba)}}}}else ka(),ma=l.value="",da={},V.style.display="none",na=!1,l.focus()});this.searchShapes=function(N){l.value=N;Y(null,!1)};mxEvent.addListener(l,"keydown",mxUtils.bind(this,function(N){if(13==N.keyCode&&N.shiftKey)M=!0,Y(!1,!1),mxEvent.consume(N);else if(13==N.keyCode&&(N.metaKey||N.ctrlKey)&&null!=H)H(N,N),mxEvent.consume(N);else if(13==N.keyCode&&null!=G)G(N,N),mxEvent.consume(N);else if(38==N.keyCode||40==N.keyCode){var R=g.currentMenu; if(null!=R&&null!=R.tbody){var ea=[];R=R.tbody.childNodes;for(var ba=0;ba<R.length;ba++)"TR"==R[ba].nodeName&&null!=R[ba]._action&&R[ba]._enabled&&ea.push(R[ba]);0<ea.length&&(R=ea.indexOf(J),R=40==N.keyCode?(R+1)%ea.length:0>=R?ea.length-1:R-1,null!=J&&(J.className="mxPopupMenuItem"),J=ea[R],J.className="mxPopupMenuItemHover",J.scrollIntoView({block:"nearest"}),G=J._action)}mxEvent.consume(N)}else 9==N.keyCode?(c.container.focus(),mxEvent.consume(N)):27==N.keyCode&&(e(),mxEvent.consume(N))}));a= mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){""==l.value?(u.setAttribute("src",Editor.magnifyImage),u.setAttribute("title",mxResources.get("search"))):(u.setAttribute("src",Editor.crossImage),u.setAttribute("title",mxResources.get("reset")));""==l.value?(na=!0,e()):l.value!=ma?(V.style.display="none",na=!1):ia||(V.style.display=na?"none":"flex")}),0)});mxEvent.addListener(l,"keyup",a);mxEvent.addListener(l,"paste",a);mxEvent.addListener(l,"cut",a);mxEvent.addListener(l, "mousedown",function(N){N.stopPropagation&&N.stopPropagation();N.cancelBubble=!0});mxEvent.addListener(l,"selectstart",function(N){N.stopPropagation&&N.stopPropagation();N.cancelBubble=!0});a=document.createElement("div");a.appendChild(k);this.appendChild(a);this.palettes.search=[h,a]}; Sidebar.prototype.insertSearchHint=function(a,b,d,e,g,c,h,k){0==g.length&&1==e&&(d=document.createElement("div"),d.className="geSidebarText",b=mxResources.get("noResultsFor",[b]),d.setAttribute("title",b),mxUtils.write(d,b),a.appendChild(d))};Sidebar.prototype.insertSearchResultsHeader=function(a,b,d){}; Sidebar.prototype.addGeneralPalette=function(a){this.setCurrentSearchEntryLibrary("general","general");var b=this.editorUi.editor.graph,d=this,e=parseInt(this.initialDefaultVertexStyle.fontSize);e=isNaN(e)?"":"fontSize="+Math.min(16,e)+";";var g=b.appendFontSize("edgeLabel;resizable=0;html=1;",b.edgeFontSize),c=new mxCell("List Item",new mxGeometry(0,0,80,30),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;"+ e);c.vertex=!0;b=[this.createVertexTemplateEntry("rounded=0;whiteSpace=wrap;html=1;",120,60,"","Rectangle",null,null,"rect rectangle box"),this.createVertexTemplateEntry("rounded=1;whiteSpace=wrap;html=1;",120,60,"","Rounded Rectangle",null,null,"rounded rect rectangle box"),this.createVertexTemplateEntry(b.appendFontSize(Editor.defaultTextStyle,b.vertexFontSize),60,30,"Text","Text",null,null,"text textbox textarea label"),this.createVertexTemplateEntry("text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;", 180,120,'<h1 style="margin-top: 0px;">Heading</h1><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',"Textbox",null,null,"text textbox textarea"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;shapeInside=1;",120,80,"","Ellipse",null,null,"oval ellipse state"),this.createVertexTemplateEntry("whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Square",null,null,"square"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;shapeInside=1;aspect=fixed;", 80,80,"","Circle",null,null,"circle"),this.createVertexTemplateEntry("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;",120,60,"","Process",null,null,"process task"),this.createVertexTemplateEntry("rhombus;whiteSpace=wrap;html=1;shapeInside=1;",80,80,"","Diamond",null,null,"diamond rhombus if condition decision conditional question test"),this.createVertexTemplateEntry("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,60,"","Parallelogram"), this.createVertexTemplateEntry("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,80,"","Hexagon",null,null,"hexagon preparation"),this.createVertexTemplateEntry("triangle;whiteSpace=wrap;html=1;shapeInside=1;",60,80,"","Triangle",null,null,"triangle logic inverter buffer"),this.createVertexTemplateEntry("shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;",60,80,"","Cylinder",null,null,"cylinder data database"),this.createVertexTemplateEntry("ellipse;shape=cloud;whiteSpace=wrap;html=1;", 120,80,"","Cloud",null,null,"cloud network"),this.createVertexTemplateEntry("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80,"","Document"),this.createVertexTemplateEntry("shape=internalStorage;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Internal Storage"),this.createVertexTemplateEntry("shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;",120,80,"","Cube"),this.createVertexTemplateEntry("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;", 120,80,"","Step"),this.createVertexTemplateEntry("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,60,"","Trapezoid"),this.createVertexTemplateEntry("shape=tape;whiteSpace=wrap;html=1;",120,100,"","Tape"),this.createVertexTemplateEntry("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;",80,100,"","Note"),this.createVertexTemplateEntry("shape=card;whiteSpace=wrap;html=1;",80,100,"","Card"),this.createVertexTemplateEntry("shape=callout;whiteSpace=wrap;html=1;perimeter=calloutPerimeter;", 120,80,"","Callout",null,null,"bubble chat thought speech message"),this.createVertexTemplateEntry("shape=wedgeCallout;whiteSpace=wrap;html=1;",120,80,"","Wedge Callout",null,null,"bubble chat thought speech message callout annotation pointer wedge"),this.createVertexTemplateEntry("shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;",30,60,"Actor","Actor",!1,null,"user person human stickman"),this.createVertexTemplateEntry("shape=xor;whiteSpace=wrap;html=1;shapeInside=1;", 60,80,"","Or",null,null,"logic or"),this.createVertexTemplateEntry("shape=or;whiteSpace=wrap;html=1;shapeInside=1;",60,80,"","And",null,null,"logic and"),this.createVertexTemplateEntry("shape=dataStorage;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",100,80,"","Data Storage"),this.createVertexTemplateEntry("swimlane;startSize=0;",200,200,"","Container",null,null,"container swimlane lane pool group"),this.createVertexTemplateEntry("swimlane;whiteSpace=wrap;html=1;",200,200,"Vertical Container", "Container",null,null,"container swimlane lane pool group"),this.createVertexTemplateEntry("swimlane;horizontal=0;whiteSpace=wrap;html=1;",200,200,"Horizontal Container","Horizontal Container",null,null,"container swimlane lane pool group"),this.addEntry("list group erd table",function(){var h=new mxCell("List",new mxGeometry(0,0,140,120),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;"); h.vertex=!0;h.insert(d.cloneCell(c,"Item 1"));h.insert(d.cloneCell(c,"Item 2"));h.insert(d.cloneCell(c,"Item 3"));return d.createVertexTemplateFromCells([h],h.geometry.width,h.geometry.height,"List")}),this.addEntry("list item entry value group erd table",function(){return d.createVertexTemplateFromCells([d.cloneCell(c,"List Item")],c.geometry.width,c.geometry.height,"List Item")}),this.addEntry("curve",mxUtils.bind(this,function(){var h=new mxCell("",new mxGeometry(0,0,50,50),"curved=1;endArrow=classic;html=1;"); h.geometry.setTerminalPoint(new mxPoint(0,50),!0);h.geometry.setTerminalPoint(new mxPoint(50,0),!1);h.geometry.points=[new mxPoint(50,50),new mxPoint(0,0)];h.geometry.relative=!0;h.edge=!0;return this.createEdgeTemplateFromCells([h],h.geometry.width,h.geometry.height,"Curve")})),this.createEdgeTemplateEntry("shape=flexArrow;endArrow=classic;startArrow=classic;html=1;",100,100,"","Bidirectional Arrow",null,"line lines connector connectors connection connections arrow arrows bidirectional"),this.createEdgeTemplateEntry("shape=flexArrow;endArrow=classic;html=1;", 50,50,"","Arrow",null,"line lines connector connectors connection connections arrow arrows directional directed"),this.createEdgeTemplateEntry("endArrow=none;dashed=1;html=1;",50,50,"","Dashed Line",null,"line lines connector connectors connection connections arrow arrows dashed undirected no"),this.createEdgeTemplateEntry("endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;",50,50,"","Dotted Line",null,"line lines connector connectors connection connections arrow arrows dotted undirected no"), this.createEdgeTemplateEntry("endArrow=none;html=1;",50,50,"","Line",null,"line lines connector connectors connection connections arrow arrows simple undirected plain blank no"),this.createEdgeTemplateEntry("endArrow=classic;startArrow=classic;html=1;",50,50,"","Bidirectional Connector",null,"line lines connector connectors connection connections arrow arrows bidirectional"),this.createEdgeTemplateEntry("endArrow=classic;html=1;",50,50,"","Directional Connector",null,"line lines connector connectors connection connections arrow arrows directional directed"), this.createEdgeTemplateEntry("shape=link;html=1;",100,0,"","Link",null,"line lines connector connectors connection connections arrow arrows link"),this.addEntry("line lines connector connectors connection connections arrow arrows edge title",mxUtils.bind(this,function(){var h=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");h.geometry.setTerminalPoint(new mxPoint(0,0),!0);h.geometry.setTerminalPoint(new mxPoint(100,0),!1);h.geometry.relative=!0;h.edge=!0;var k=new mxCell("Label", new mxGeometry(0,0,0,0),g+";align=center;verticalAlign=middle;");k.geometry.relative=!0;k.setConnectable(!1);k.vertex=!0;h.insert(k);return this.createEdgeTemplateFromCells([h],100,0,"Connector with Label")})),this.addEntry("line lines connector connectors connection connections arrow arrows edge title multiplicity",mxUtils.bind(this,function(){var h=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");h.geometry.setTerminalPoint(new mxPoint(0,0),!0);h.geometry.setTerminalPoint(new mxPoint(160, 0),!1);h.geometry.relative=!0;h.edge=!0;var k=new mxCell("Label",new mxGeometry(0,0,0,0),g+";align=center;verticalAlign=middle;");k.geometry.relative=!0;k.setConnectable(!1);k.vertex=!0;h.insert(k);k=new mxCell("Source",new mxGeometry(-1,0,0,0),g+";align=left;verticalAlign=bottom;");k.geometry.relative=!0;k.setConnectable(!1);k.vertex=!0;h.insert(k);k=new mxCell("Target",new mxGeometry(1,0,0,0),g+";align=right;verticalAlign=bottom;");k.geometry.relative=!0;k.setConnectable(!1);k.vertex=!0;h.insert(k); return this.createEdgeTemplateFromCells([h],160,0,"Connector with Labels")})),this.addEntry("line lines connector connectors connection connections arrow arrows edge shape symbol message mail email",mxUtils.bind(this,function(){var h=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");h.geometry.setTerminalPoint(new mxPoint(0,0),!0);h.geometry.setTerminalPoint(new mxPoint(100,0),!1);h.geometry.relative=!0;h.edge=!0;var k=new mxCell("",new mxGeometry(0,0,20,14),"shape=message;html=1;outlineConnect=0;"); k.geometry.relative=!0;k.vertex=!0;k.geometry.offset=new mxPoint(-10,-7);h.insert(k);return this.createEdgeTemplateFromCells([h],100,0,"Connector with Symbol")}))];this.addPaletteFunctions("general",mxResources.get("general"),null!=a?a:!0,b);this.setCurrentSearchEntryLibrary()}; Sidebar.prototype.addMiscPalette=function(a){var b=this;this.setCurrentSearchEntryLibrary("general","misc");var d=this.editorUi.editor.graph;d=[this.createVertexTemplateEntry(mxUtils.setStyle(mxUtils.setStyle(d.appendFontSize(Editor.defaultTextStyle,d.vertexFontSize),"autosize","1"),"resizable","0"),60,30,"Text","Autosize Text",null,null,"autosize text"),this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;fontSize=25;fontStyle=1;verticalAlign=middle;align=center;autosizeText=1;", 160,40,"Autosize Title","Autosize Title",null,null,"text heading title"),this.addEntry("link url hyperlink text label",mxUtils.bind(this,function(){var e=new mxCell("Link",new mxGeometry(0,0,60,40),"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;align=center;verticalAlign=middle;fontColor=#0000EE;fontStyle=4;");e.vertex=!0;this.graph.setLinkForCell(e,"https://www.draw.io");return this.createVertexTemplateFromCells([e],e.geometry.width,e.geometry.height,"Link")})),this.createVertexTemplateEntry("shape=curvedText;noLabel=1;align=center;verticalAlign=middle;strokeColor=none;fillColor=none;", 70,50,"Curved Text","Curved Text",null,null,"text curved arc path"),this.addEntry("variable placeholder metadata hello world text label",mxUtils.bind(this,function(){var e=new mxCell("%name% Text",new mxGeometry(0,0,80,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;");e.vertex=!0;this.graph.setAttributeForCell(e,"placeholders","1");this.graph.setAttributeForCell(e,"name","Variable");return this.createVertexTemplateFromCells([e],e.geometry.width, e.geometry.height,"Variable")})),this.addEntry("timestamp date time text label",mxUtils.bind(this,function(){var e=new mxCell("%date{ddd mmm dd yyyy HH:MM:ss}%",new mxGeometry(0,0,160,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;");e.vertex=!0;this.graph.setAttributeForCell(e,"placeholders","1");return this.createVertexTemplateFromCells([e],e.geometry.width,e.geometry.height,"Timestamp")})),this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;", 100,80,"<ul><li>Value 1</li><li>Value 2</li><li>Value 3</li></ul>","Unordered List"),this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;",100,80,"<ol><li>Value 1</li><li>Value 2</li><li>Value 3</li></ol>","Ordered List"),this.addDataEntry("vertical list",60,60,"Vertical List","7VjbbqMwEP0aXldcQrp9hfSyUvel3R9wwwRba2xkJiX063eMnaRNgxR2V1EUIYHkGWYGzznjI0SQ5NXmwbCa/9QFyCC5C5LcaI1uVW1ykDKIQ1EEySKI45DuIL4feBr1T8OaGVB4SkLsEt6YXIPzOEeDnfSOhrPaLpG9WlfWIDP4It6tLyR7qRUyocCQHfW2lKxuRB/tIriQxRPr9Bq3dbZWtqJsXyyy2SshZa6lttWUVu6FRv+GA6ffNxiEzWDvvcs3/gC6AjQdhbSiQO4i5g6ekIMoOX72scbZ5S5zDyQtPJbHcU1G4vqsW2qKayPeLZzSI3eIddOKSjIFj8CKA1emi26X9REwoTgYYbFGXfsICSv0y1eNqCtvGI9CeJTHwuj6FzMlbEOOkFVrobAHLs3oIijz8FsapNRxTna0t+my4QZzrWjHNEK2LLAGW2gOR2N+KuXxX1Eepf9O+ewL5T8QKvJEg9TTxlEw+QxLZKrsTxfHSvqD1HKB8FKzpQ1tSSLcYVM2ek/KENmagFpJO1YLLooC1HG+xs1Ezy6YuzdwJEcHNBH0GZOipJctXL2soQaEKp9c9fRUHpP/zqMvtgd7dDUmqXfFkM7aWhXNl+HY7fOkeUknibgoieg+k34GxZgPKcbwJEyKMUhrevWKcTMpxiUqRhKeTTG+DylGMinGeMW4uXrFuJ0E4gIEYna+T4ooHFKI2aQQ4xXi9toUgsz9zyUX/vHf0x8="), this.createVertexTemplateEntry("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;autosizeText=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;fontSize=20;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",150,150,"The size of the font in this note will change so that it fits within the note shape",mxResources.get("note")),this.addDataEntry("table",180,120,"Table 1","7VnbcpswEP0aXjtcYsd9NUnTh/Yl6Q8o1trSVEiMWAeTr+8KhGlSe2xwJpMSZvCMdtmVteccwY4IkjTb3VmWi5+GgwqS2yBJrTHYjLJdCkoFcSh5kNwEcRzSL4i/Hbkb1XfDnFnQeE5C3CQ8MbWFxtM4CqyUdxSC5W6I7NG5lgUyiw/y2flCsldGI5MaLNlRbSvF8kLW0U2EkIr/YJXZYjtPay3XlO0ni+Zk+/WARdgdral2+YLuwGSAtqKQUnIUPmLR1B0KkBvRpnkwQlY0js0+t4OIBh6lw4glPRG7NyWVJYyVzw4o5TF5jWJRykwxDd+B8VeupeHVPsua35AaZRzaUguw0qGIJvcRCtboh48G0WTesB6G8CBD3Jr8F7MbaEPWUqn2b7TRjvfcSI01cLMlXQRlGn6ZBTOqOCU76my6XLjF1GhaMYnDTQuswBKKwaTHw0i/egPOr87nnFaMkql7WCHTm3rDCMyU3xulkAgPOVu50JJ2fbN/tIvu2DjGsiGE1srp6UZIzkEfJqqfGGpawd4+QcNuNJSf5CQ/8570+Mk6LHvPxhSVphnSHtpqXvzD+X6dZ8lgNslgsAx2L0kbkSrmkyouVcX+xTwiWVxPfcKH6hOql6S/R9uwmJ4Mp+m6Hn3b8HWSwWAZjLdtiMJJFpfKYox9QxRNjcNHbBwW79g4RD2O5T7vsyE6fQz43z8Mepw2TkL4RM3DdCJ5uS5G0D2Q2X0rasL//pT0Bw=="), this.addDataEntry("table",180,120,"Table 2","7ZlLc9owEMc/ja8dP3jlimnSQ3pJOr0reMGayFqPvNSQT9+VLUMCOEDbyaTYM2ZGWq9e/99K7MheFGfrOyPy9DsmoLzoqxfFBpHqUraOQSkv9GXiRTMvDH3+eeFty9ugeuvnwoCmcxqEdYNfQq2gttSGgjbKGYpU5LZI4smapillPM1ZwMUylQSPuZjb9yUvgm0FCUOP8sWafK7PUZOQGoxrM0elRF7IqrPaI5UquRcbXFEzTFOz3qtM33P7wnkbLF9XF9y9Gy0YVcMbfIYYFdoBE1iIlbIduXWCIVi3alWZnFB3gBmQ2bBLKRNKncek1tNPQS7TppkT2RdFbVhu2+6k54JT/ziJ6EISD1haGGjki1VYOT325S9KmSmh4RuIZM80xWTjTIS5KylYkCs+IRFmjexuuf5RhInB/IcwS2hcFlKpBoJGbeMmR6mpEmg45Ycli/0vQ2/IK4u5Huzq/Fh3QzFq5snRY7sFUVAJBZ2ELnUKRp4NPfwz6IN/wHxwwPxnVQz9oBU+T52kUA8wJ6GX5+xI3oHaeu9wHaFzWQQga7pQNgJnqUwS0HtQwr+FEp2EMrqQietsp9vFvQlFYLQg3jgrnRQHoLfzPIv9sJV9+8bvNPv1W1JXFAqj1lCI+lB4JxS2/7tXFAvjPg34VGnA5i30j8gKJq3HwaDjx8H46rOCm1b2w559t7KCwG+NhVEfCx1LC4Kgzws+Y14w+cC8IDi8rGsOhHHHD4Tg9M3df38CHF4QNvQnPf2u5QbtN4c3fTBceXLA1d0Hotr99fej3w=="), this.addDataEntry("table title",180,150,"Table with Title 1","7VnbbtswDP0avw6WXSfda5yue9he2v6AGjGRMFkyZKZO+vWjbOWyJVluQ9G6BmxApChaOudIIOQozYvFveOl/GkF6Ci9i9LcWYttq1jkoHWUxEpE6ThKkpjeKPl2oJc1vXHJHRg8ZUDSDnjheg6t54k/a2i9FS518FaSl76JTW86qpA7fFSv3pfG5JhYg1wZcORgja01LyvVhI+bCKm0+MGXdo6rRCuL0jn7C3KrrR8vYMrn2vunlDV8hQ3IDrMFh7A4uOLGFZZ7D7YAdEsKqZVAGSJuW1RiCWomV8Oy4ORV65itx24ApEbAcD+e6Q6e/4bywda0LGmdevUA6oDVNryNXatCcwPfgYu/XCMrlutR2ygqI8EpjyLaMkRomGJoPltEWwTDBRjivcwJZ8sn7mawCpkqrVefMdZ4QZRWGWyAy0b0EJR5/CWLMlpxTjbb2PT4cIe5NTRjEo1PC7zCGqqLSU/2k74MtARqj2ng5j9I4OZ0CdACUHH9ABPkZtZsLImFDluolgrhseQTH1rTEdFuM+OjN+QcIt0SYFPt5TWWSggw+3k7TxsNy+DuXqAlm11KV3p0jw7OpCck22B5djauaWmGI22puRHVDufreZ4kg6yXwcUyWPxJWodUMehVca0qWNI9WQz7suE9lg3DNywbbvuT4Thdw86XDV97GVwsg+6WDSzuZXGtLLpYNzDWFw7vsXBg7A0rB7Z7idcfDru3gsevBT/8aXDG7WMvhE9UPfRXktfrogPlA5mbP0tt+PaPp98="), this.addDataEntry("table title",180,120,"Table with Title 2","7VhNb6MwEP01XFd8NNnmGtLtHrKXptq7Gw9grbGRmZSkv34HbEJ3CdtklaYoqgSSZxgP+L1nPwkvivPtvWFF9kNzkF5050Wx0RrtKN/GIKUX+oJ70cILQ59uL/w28DRonvoFM6DwmAmhnfDM5AZs5pE9SbDZEnfSZcuMFfUQm6fRvERmcCVe6lzkU2KtFTKhwFAiaGIpWVGKpnzRVGRC8iXb6Q22jdponogt8AddlW620dWSmpVuakLNV+5j/ObtRv+CWEtdv45DwjYS2zr7UcGUYrc4MAjbQYCalEPnHnQOaHZUUgmOmau4tSD6GYg0a6c5ZH1W2kS6n9vhTQMH+WH4ox78/0aeIKJlZdqIlxpvucejY6OJK5FLpuA7MP5Xaq75zqVQF24kIUE3fNKIOneBccv1DxLKjS4emUmhLUmElC0pSqtaJ4UWChuAJnO6CLLY/zLxJrSymOKgi+mqyw3GWhG/pKW6LbASKyixR7pQGRjx36SHh0nfOVoctW9pIDqDBG56EggGNUArQMHkA6yRqbTZiBnm0m2aKhMIq4Kt69KKjhS7LVVd3bF2gKTThKAJ2kTWQlxkgnNQLc1g7p7Bsh2cm6/ozU16cyI/rlmH5cndmKQlK4a0pzaKlz3S9995lA4mPR38bIahP3I9MClS0sDC1s5LeqFQ6dLOnA4I5hLi2P5J5evNfF6xHNXuvGqZfhrHGI1jekHj+NqTwLAGRnFQvPs5ML16k7gdNImRc//xJjEgjms2idmnSYzRJGYXNInA72kgGvdJ8e4HwezqXSIIBm1i5OR/vE0MqOOKbILC7v+iLX/9+/E3"), this.addDataEntry("crossfunctional cross-functional cross functional flowchart swimlane table",400,400,"Cross-Functional Flowchart","7ZnfbpswFMafhstN/EnS7nIhS3fRSlO2F3DhNFhzfJB90iR9+tlgkirgFUXtqjIkItmHY2O+84v1yQRJutnfKFYWd5iDCJJvQZIqRKpbm30KQgRxyPMgWQRxHJpfEC89d6PqblgyBZL6DIjrAY9MbKGOmIdr/Wm5lRlxlMwmLwXusoIpqpM1HYRL1gUrbZPYvQ3Ns4KL/JYdcEtNtOnNNZkZfvInmz8JbTIKwUrNq6ELG1GQbZXmj7ACXSfaKOxLJnPXeUDZTBLNTN+tHxTB3qtBFXIC3ABugNTBpOx4TkWdMQlrncIC+LqgsyDTdWB9HHuS1DScqt0KJy2Fv2aEyoSiv8u5wp15vwIVfzLvbApRC6B3fCOYhO/A8rPQHPODCxGWriXggZo8UvgbUhTm8cmCywIUt5W5RyLcNDVw72/bucLyF1NroOfqu/VWfS5EM59EaREokUuq9JrOzWUUTMPP02Bq3i81/ejUN5dNV5SiNEtjvCoXME070O9MTNxNzKEBox7xEkBR/AoATVoA/SiYhm6AHAm9OTkvqA+RDKWEzP3NfaV/x3ol3fXae+t1LE3vernZV1YGuRZwyXxMECjJyJRgK3PdwuC49F5kTL1kxCMZ/ciIZsNEY+ZFIxnR6IdGfD1MNK68hqRj1xgNyYcwJF3b2Ns5kusWQa+/p7T3Dh8sL+wp/7ZMV/+jD/ky8nAZD0N1H1E4EnEZEUM1HVHkdR0dhnR0HR/CdXTB+nauI2qfVY6bSiOw54Rz2L4jap+tjkT0I2KwzqN9Wjoi0Q+JgVgP0z19PqvTn39d+wM="), this.addDataEntry("table",280,160,"Table","7Zpdc6IwFIZ/DfcksSqX1X7sxe6NdvY+ylEyjYQJsWp//QZIrDXSIkUdcZ3pTDiSNHmfHF5yRo8MF+tnSZPojwiBe+TRI0MphCpai/UQOPewz0KPPHgY+/rPw08l36L8Wz+hEmJVpQMuOrxRvoQicp+moNIinKoNN+FpxHj4m27EMhtX0QkHezWQMF3KlL3BCFL2nnXwdTRVUrzCUHAh8yFI0J/M9AzJYMY434nf94ZBB2c9IhqKlQ5mN5mJgVSwLl1cHjIrewaxACU3+pYVC1VkFtgvBPAjYPPIduuaIE2LwHzb90Mr3TByHZaOOBrp+Sdg1RllKxlEQrJ3ESvKt6pQqcY7Kq3YgtMYfgEN90IDEW5MSInEtDjMlGlOhFJiYS6kWV3WDqVIXqicgw1MBec0SdmE2397GBmsExrbacz0tMdmcS5PFkcgmXJpzvJPVYC4HkBCfs6v42z9F6b0arGP3N0v4himOdcvBayo0XbHU87msY5NtSAg90RH5nqn41P+yfaVWvBjEoV8q3NAjpPZDDbKZInnuW5Hjka5XnNMld7oyzhMHXbbeVbCeVeKE98MzvVn8Xd5dBqlW2G0Zul2S+m6j+GW00X9nov3ypO35+D9b64nM9fNZ6Lfei3+udf2Hb5/8+apvfYj6iTvKmIKxgmdZuOt9At4jUTt1XPVLwStkZh7ozWbmEEpuNO66mXAHemf9TlWGK1ZjsgvBXlaA70oyMpWeUUZidAteyWq7pWP90/4gTTjld27il6Jfu6VyK3J2FTtnClVm8hM9H1t5mDyfKFgjVTcG63hVCSlpO5aQOpIN6wPrsJoDYNzaz8WXLc94Cq73zWlnFvmuSH3u9BJMehWdL8GqrLIrfTY1OydKTX3FT/Ji2uxkVtdkUVuVcei7N8CyvZWY1F5PSe4IbJtrMQit+JzQwZ7oeMlsnW2c5wvcXkpyFaJruPtN6jnoFf0tovdWs8W1bkK56dE1d4Tpn1qHiLnPlCvllwLjpj68uPnVsXtu7/G+gc="), this.addDataEntry("table",180,140,"Table","7ZhNc5swEIZ/DXc+HH9cTdv00F7sTu8yWoOmi8QIOUB+fSUjJXEwMbZzgcl4PKNdIVn7PlovkhfFef0oSZH9FhTQi757USyFUG0rr2NA9EKfUS/65oWhr79e+KOnNzj2+gWRwNWQAWE74IngAVpP6yhVg9aRZAzpL9KIg5lRkR2Cs9YSkoMs2RNsoGTPZoCvvWVGqKissWeIsUAhtc0FB9OvpPgHzumFUeybj+6xqwGpoO6N6Oiy4TyCyEHJRj9SMaoy+8SyjdrPgKWZGzazTlK2jvRl7KtAumE1Oq9XdFkvHX0BTqmN0WGdCcmeBVcEnUKKSLV9o1jFciQcfgKh71xrQRvrUqKwLYS9ss2dUErk1pA2XNOmUhR/iEzBORKBSIqS7dD97Hl8UBeEu2Xs9bK3NrgenIOghbdBmy3uZzbrMPt7bIZ+0N3sgnNIjug+1Oh0C1shzmhDkKVcm4kWArR/XWVMwbYgiZmp0nlvtofKzcYIhmoZXdRyfqWUdrKNCZ2nCNfPRlDHx4nS+/XAadnh87LOQcgeepGd+X8aMbL6VOAJEZz3EoymSDAIp4dw8VXa7iltzSmji5Vufn+lW/Ym3WycSbe4rdJ9IOUNSfZuts9NslUvsodJIbuy0o2IYOD3IpxPEeHgUjcmht2TwFetu77WraKBte4TTnVB9+rCpV33xWUUaRdcvtgY+ytl0L0/cdCW04I23ZNd0H+fspokwwmc7bT5eqfcPv72yvk/"), this.addDataEntry("table",180,140,"Table","7ZhLc5swEMc/DXcejh9X3CY9tBe707uM1qCpkBixDpBPX2GkvLBi7LgHmBw8s1okof3/tF4kL1rn9YMiRfZLUuBe9N2L1kpK7Ky8XgPnXugz6kXfvDD09c8L7x1Pg+NTvyAKBA4ZEHYDHgk/QOfpHCU23DiSjHH6kzTy0M6IZMfBtmIFyUGV7BE2ULKndoCvvWVGqKxMY884X0sulW4LKXSf2LwTFELtXPfRZRb9ADIHVI3uUjGKmemx7GLzM2BpZofNjJOUnSN9HvsigzaMEqdVic6romMswOqxaaONM6nYkxRIuNUBicLtK10qlnMi4AcQ+s4VS9oYF8rCWBz2aMydRJS5aSgTbmtTJYvfRKVgHYnknBQl23H72tOQoC6IsMvY62VvTXAOaCUq+Resk4kMFMOhMMPrYM4Wn2c567H8czRDP+hvdSkEJEekH2rn0uKEbISzVOhmorUA7Y+rjCFsC5K0k1U68dudg3m7Z4KhckZn5ZxfqKaZbNNGL1IOl89GuI5PENRb+SBo2UP0vM5B1O6c1E78QY2bWv1W4wlBnDshRhOFGITTo7j4qn3/o/Y1b9mdLYXzz5fCpTMfZ6PNx8V1pfADNa/Iv3ez3Tb/Vk5qd1OjdmEpHBHEwHdSnE+U4uBaOCaM/TPDVzG8XTFcRQOL4Q3OhUH/6sNmZP+LZywZGZy/NRn752jQv5yx3JaT4zbds2HgvpdZTRXjBE6HuvlyOd11f313/Q8="), this.createVertexTemplateEntry("text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;overflow=fill;",180,180,'<table border="1" width="100%" height="100%" cellpadding="4" style="width:100%;height:100%;border-collapse:collapse;"><tr><th align="center"><b>Title</b></th></tr><tr><td align="center">Section 1.1\nSection 1.2\nSection 1.3</td></tr><tr><td align="center">Section 2.1\nSection 2.2\nSection 2.3</td></tr></table>',"HTML Table 4"),this.createVertexTemplateEntry("rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=4;hachureGap=8;hachureAngle=45;fillColor=#1ba1e2;sketch=1;", 120,60,"","Rectangle Sketch",!0,null,"rectangle rect box text sketch comic retro"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=2;hachureGap=8;fillColor=#990000;fillStyle=dots;sketch=1;",120,60,"","Ellipse Sketch",!0,null,"ellipse oval sketch comic retro"),this.createVertexTemplateEntry("rhombus;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=-1;hachureGap=8;fillStyle=cross-hatch;fillColor=#006600;sketch=1;",120,60,"","Diamond Sketch",!0,null,"diamond sketch comic retro"), this.createVertexTemplateEntry("html=1;whiteSpace=wrap;shape=isoCube2;backgroundOutline=1;isoAngle=15;",90,100,"","Isometric Cube",!0,null,"cube box iso isometric"),this.createVertexTemplateEntry("html=1;whiteSpace=wrap;aspect=fixed;shape=isoRectangle;",150,90,"","Isometric Square",!0,null,"rectangle rect box iso isometric"),this.createEdgeTemplateEntry("edgeStyle=isometricEdgeStyle;endArrow=none;html=1;",50,100,"","Isometric Edge 1"),this.createEdgeTemplateEntry("edgeStyle=isometricEdgeStyle;endArrow=none;html=1;elbow=vertical;", 50,100,"","Isometric Edge 2"),this.createVertexTemplateEntry("shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;",20,120,"","Left Curly Bracket"),this.createVertexTemplateEntry("shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;flipH=1;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;",20,120,"","Right Curly Bracket"),this.createVertexTemplateEntry("line;strokeWidth=2;html=1;",160, 10,"","Horizontal Line"),this.createVertexTemplateEntry("line;strokeWidth=2;direction=south;html=1;",10,160,"","Vertical Line"),this.createVertexTemplateEntry("line;strokeWidth=4;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",160,10,"","Horizontal Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("line;strokeWidth=4;direction=south;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",10,160,"","Vertical Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("shape=crossbar;whiteSpace=wrap;html=1;rounded=1;", 120,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 e=new mxCell("Label",new mxGeometry(0,0,160,70),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");e.vertex=!0;var g=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");g.vertex=!0;e.insert(g);return b.createVertexTemplateFromCells([e],e.geometry.width,e.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=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.createVertexTemplateEntry("shape=mxgraph.basic.arc;html=1;startAngle=0.3;endAngle=0.1;endArrow=classic;endFill=1;",50,50, "","Arc",null,null,"arc curve"),this.createVertexTemplateEntry("shape=zigzag;html=1;fillColor=none;",160,20,"","Zigzag",null,null,"zigzag wave sawtooth")];this.addPaletteFunctions("misc",mxResources.get("misc"),null!=a?a:!0,d);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=ext;double=1;rounded=0;whiteSpace=wrap;html=1;",120,80,"","Double Rectangle",null,null,"rect rectangle box double"),this.createVertexTemplateEntry("shape=ext;double=1;rounded=1;whiteSpace=wrap;html=1;", 120,80,"","Double Rounded Rectangle",null,null,"rounded rect rectangle box double"),this.createVertexTemplateEntry("ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;",100,60,"","Double Ellipse",null,null,"oval ellipse start end state double"),this.createVertexTemplateEntry("shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Double Square",null,null,"double square"),this.createVertexTemplateEntry("ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Double Circle", null,null,"double circle"),this.createVertexTemplateEntry("shape=tapeData;whiteSpace=wrap;html=1;perimeter=ellipsePerimeter;",80,80,"","Tape Data"),this.createVertexTemplateEntry("shape=manualInput;boundedLbl=1;whiteSpace=wrap;html=1;",80,80,"","Manual Input"),this.createVertexTemplateEntry("shape=loopLimit;whiteSpace=wrap;html=1;",100,80,"","Loop Limit"),this.createVertexTemplateEntry("shape=offPageConnector;whiteSpace=wrap;html=1;",80,80,"","Off Page Connector"),this.createVertexTemplateEntry("shape=delay;whiteSpace=wrap;html=1;", 80,40,"","Delay"),this.createVertexTemplateEntry("shape=display;whiteSpace=wrap;html=1;",80,40,"","Display"),this.createVertexTemplateEntry("shape=singleArrow;direction=west;whiteSpace=wrap;html=1;",100,60,"","Arrow Left"),this.createVertexTemplateEntry("shape=singleArrow;whiteSpace=wrap;html=1;",100,60,"","Arrow Right"),this.createVertexTemplateEntry("shape=singleArrow;direction=north;whiteSpace=wrap;html=1;",60,100,"","Arrow Up"),this.createVertexTemplateEntry("shape=singleArrow;direction=south;whiteSpace=wrap;html=1;", 60,100,"","Arrow Down"),this.createVertexTemplateEntry("shape=doubleArrow;whiteSpace=wrap;html=1;",100,60,"","Double Arrow"),this.createVertexTemplateEntry("shape=doubleArrow;direction=south;whiteSpace=wrap;html=1;",60,100,"","Double Arrow Vertical",null,null,"double arrow"),this.createVertexTemplateEntry("shape=actor;whiteSpace=wrap;html=1;",40,60,"","User",null,null,"user person human"),this.createVertexTemplateEntry("shape=cross;whiteSpace=wrap;html=1;",80,80,"","Cross"),this.createVertexTemplateEntry("shape=corner;whiteSpace=wrap;html=1;", 80,80,"","Corner"),this.createVertexTemplateEntry("shape=tee;whiteSpace=wrap;html=1;",80,80,"","Tee"),this.createVertexTemplateEntry("shape=datastore;whiteSpace=wrap;html=1;",60,60,"","Data Store",null,null,"data store cylinder database"),this.createVertexTemplateEntry("shape=orEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Or",null,null,"or circle oval ellipse"),this.createVertexTemplateEntry("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;", 80,80,"","Sum",null,null,"sum circle oval ellipse"),this.createVertexTemplateEntry("shape=lineEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Ellipse with horizontal divider",null,null,"circle oval ellipse"),this.createVertexTemplateEntry("shape=lineEllipse;line=vertical;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Ellipse with vertical divider",null,null,"circle oval ellipse"),this.createVertexTemplateEntry("shape=sortShape;perimeter=rhombusPerimeter;whiteSpace=wrap;html=1;", 80,80,"","Sort",null,null,"sort"),this.createVertexTemplateEntry("shape=collate;whiteSpace=wrap;html=1;",80,80,"","Collate",null,null,"collate"),this.createVertexTemplateEntry("shape=switch;whiteSpace=wrap;html=1;",60,60,"","Switch",null,null,"switch router"),this.addEntry("process bar",function(){return a.createVertexTemplateFromData("1ZVNboMwEIVP42UlfkqabCFtNokUiRO4MAWrBiPbKZDTd2xMSJMgVaraKgskzxs/e+YbS5AwqbqNpE25EzlwEj6TMJFC6GFVdQlwTgKP5SRckyDw8CPBy0zWt1mvoRJq/R1DMBg+KD/AoOylyEApFGMqh6zSPXdZ1bKK0xqjOCsZz7e0Fwdzk9I0ex+juBSSHUWtKTa09lF4Y5wngguJcS2sf9qTGq/bKEGxI+zHBi6lHe1Q9U7qlirthExwThvFXm2tRlFaine4uNYWGguZgxF9b5TShmasLlB78IPxfDocZqqgnBU1rjOswljjRrBaK4Mlikm0RqUtmQZzjvG0OFPTpa5GBg41SA3d7Lis5Ga1AVGBlj1uaVmuSzey1WKwlcCKcrR5w5w9qgahOHmn6ePCPYDbjyG8egyphgYV//odlLQBO3YwXTYgGV5nkRppP8U4+g7yFGflMPwOt+A2t9Hg6PSuUdfpGdUTwHOq0dPPoT7OQQ3uHepq+W9Qozmo4b1D9ZeLv6KK4fSjsbkv/6FP", 296,100,"Process Bar")}),this.createVertexTemplateEntry("swimlane;",200,200,"Container","Container",null,null,"container swimlane lane pool group"),this.addEntry("list group erd table",function(){var d=new mxCell("List",new mxGeometry(0,0,140,110),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;html=1;");d.vertex=!0;d.insert(a.cloneCell(b,"Item 1"));d.insert(a.cloneCell(b, "Item 2"));d.insert(a.cloneCell(b,"Item 3"));return a.createVertexTemplateFromCells([d],d.geometry.width,d.geometry.height,"List")}),this.addEntry("list item entry value group erd table",function(){return a.createVertexTemplateFromCells([a.cloneCell(b,"List Item")],b.geometry.width,b.geometry.height,"List Item")})]}; 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.addUmlPalette=function(a){var b=this,d=new mxCell("+ field: type",new mxGeometry(0,0,100,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;");d.vertex=!0;var e=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;strokeColor=inherit;"); e.vertex=!0;this.setCurrentSearchEntryLibrary("uml");var g=[this.createVertexTemplateEntry("html=1;whiteSpace=wrap;",110,50,"Object","Object",null,null,"uml static class object instance"),this.createVertexTemplateEntry("html=1;whiteSpace=wrap;",110,50,"«interface»<br><b>Name</b>","Interface",null,null,"uml static class interface object instance annotated annotation"),this.addEntry("uml static class object instance",function(){var c=new mxCell("Classname",new mxGeometry(0,0,160,90),"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;"); c.vertex=!0;c.insert(d.clone());c.insert(e.clone());c.insert(b.cloneCell(d,"+ method(type): type"));return b.createVertexTemplateFromCells([c],c.geometry.width,c.geometry.height,"Class")}),this.addEntry("uml static class section subsection",function(){var c=new mxCell("Classname",new mxGeometry(0,0,140,110),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;"); c.vertex=!0;c.insert(d.clone());c.insert(d.clone());c.insert(d.clone());return b.createVertexTemplateFromCells([c],c.geometry.width,c.geometry.height,"Class 2")}),this.addEntry("uml static class item member method function variable field attribute label",function(){return b.createVertexTemplateFromCells([b.cloneCell(d,"+ item: attribute")],d.geometry.width,d.geometry.height,"Item 1")}),this.addEntry("uml static class item member method function variable field attribute label",function(){var c=new mxCell("item: attribute", new mxGeometry(0,0,120,d.geometry.height),"label;fontStyle=0;strokeColor=none;fillColor=none;align=left;verticalAlign=top;overflow=hidden;spacingLeft=28;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;imageWidth=16;imageHeight=16;whiteSpace=wrap;html=1;image="+b.gearImage);c.vertex=!0;return b.createVertexTemplateFromCells([c],c.geometry.width,c.geometry.height,"Item 2")}),this.addEntry("uml static class divider hline line separator",function(){return b.createVertexTemplateFromCells([e.clone()], e.geometry.width,e.geometry.height,"Divider")}),this.addEntry("uml static class spacer space gap separator",function(){var c=new mxCell("",new mxGeometry(0,0,20,14),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=4;spacingRight=4;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;");c.vertex=!0;return b.createVertexTemplateFromCells([c.clone()],c.geometry.width,c.geometry.height,"Spacer")}),this.createVertexTemplateEntry("text;align=center;fontStyle=1;verticalAlign=middle;spacingLeft=3;spacingRight=3;strokeColor=none;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;html=1;", 80,26,"Title","Title",null,null,"uml static class title label"),this.addEntry("uml static class component",function(){var c=new mxCell("«Annotation»<br/><b>Component</b>",new mxGeometry(0,0,180,90),"html=1;dropTarget=0;whiteSpace=wrap;");c.vertex=!0;var h=new mxCell("",new mxGeometry(1,0,20,20),"shape=module;jettyWidth=8;jettyHeight=4;");h.vertex=!0;h.geometry.relative=!0;h.geometry.offset=new mxPoint(-27,7);c.insert(h);return b.createVertexTemplateFromCells([c],c.geometry.width,c.geometry.height, "Component")}),this.addEntry("uml static class component",function(){var c=new mxCell('<p style="margin:0px;margin-top:6px;text-align:center;"><b>Component</b></p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:8px;">+ Attribute1: Type<br/>+ Attribute2: Type</p>',new mxGeometry(0,0,180,90),"align=left;overflow=fill;html=1;dropTarget=0;whiteSpace=wrap;");c.vertex=!0;var h=new mxCell("",new mxGeometry(1,0,20,20),"shape=component;jettyWidth=8;jettyHeight=4;");h.vertex=!0;h.geometry.relative= !0;h.geometry.offset=new mxPoint(-24,4);c.insert(h);return b.createVertexTemplateFromCells([c],c.geometry.width,c.geometry.height,"Component with Attributes")}),this.createVertexTemplateEntry("verticalAlign=top;align=left;spacingTop=8;spacingLeft=2;spacingRight=12;shape=cube;size=10;direction=south;fontStyle=4;html=1;whiteSpace=wrap;",180,120,"Block","Block",null,null,"uml static class block"),this.createVertexTemplateEntry("shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;whiteSpace=wrap;html=1;", 100,50,"Module","Module",null,null,"uml static class module component"),this.createVertexTemplateEntry("shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;",70,50,"package","Package",null,null,"uml static class package"),this.createVertexTemplateEntry("verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;",160,90,'<p style="margin:0px;margin-top:4px;text-align:center;text-decoration:underline;"><b>Object:Type</b></p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:8px;">field1 = value1<br/>field2 = value2<br>field3 = value3</p>', "Object",null,null,"uml static class object instance"),this.createVertexTemplateEntry("verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;",180,90,'<div style="box-sizing:border-box;width:100%;background:#e4e4e4;padding:2px;">Tablename</div><table style="width:100%;font-size:1em;" cellpadding="2" cellspacing="0"><tr><td>PK</td><td>uniqueId</td></tr><tr><td>FK1</td><td>foreignKey</td></tr><tr><td></td><td>fieldname</td></tr></table>',"Entity",null,null,"er entity table"),this.addEntry("uml static class object instance", function(){var c=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1" style="border-style:solid;"/><div style="height:2px;"></div>',new mxGeometry(0,0,140,60),"verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;");c.vertex=!0;return b.createVertexTemplateFromCells([c.clone()],c.geometry.width,c.geometry.height,"Class 3")}),this.addEntry("uml static class object instance",function(){var c=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1" style="border-style:solid;"/><div style="height:2px;"></div><hr size="1" style="border-style:solid;"/><div style="height:2px;"></div>', new mxGeometry(0,0,140,60),"verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;");c.vertex=!0;return b.createVertexTemplateFromCells([c.clone()],c.geometry.width,c.geometry.height,"Class 4")}),this.addEntry("uml static class object instance",function(){var c=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:4px;">+ field: Type</p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:4px;">+ method(): Type</p>', new mxGeometry(0,0,160,90),"verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;");c.vertex=!0;return b.createVertexTemplateFromCells([c.clone()],c.geometry.width,c.geometry.height,"Class 5")}),this.addEntry("uml static class object instance",function(){var c=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><i><<Interface>></i><br/><b>Interface</b></p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:4px;">+ field1: Type<br/>+ field2: Type</p><hr size="1" style="border-style:solid;"/><p style="margin:0px;margin-left:4px;">+ method1(Type): Type<br/>+ method2(Type, Type): Type</p>', new mxGeometry(0,0,190,140),"verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;");c.vertex=!0;return b.createVertexTemplateFromCells([c.clone()],c.geometry.width,c.geometry.height,"Interface 2")}),this.createVertexTemplateEntry("shape=providedRequiredInterface;html=1;verticalLabelPosition=bottom;sketch=0;",20,20,"","Provided/Required Interface",null,null,"uml provided required interface lollipop notation"),this.createVertexTemplateEntry("shape=requiredInterface;html=1;verticalLabelPosition=bottom;sketch=0;", 10,20,"","Required Interface",null,null,"uml required interface lollipop notation"),this.addDataEntry("uml lollipop notation provided required interface",20,20,"Required Interface","jVNBbuMwDHyN7o6N9L5x2l66QIEe9qy1GUutIhoUHTt9/VKWNo7bBu0hgDicYeQZSlX1cXok3Zvf2IJT1b2qakLkdDpONTinysK2qtqrsizkp8qHG93N3C16TeD5J4IyCU7aDZCQBAQ+uwwQDr6FyC9UtUNigx167Z4QewE3Ar4C8/nFvkeFHhgFMnx0uQu+/UWEo5RGu0NtqYmzI/5gncuDpcoT7qQKTPgGf2zLJk8Jb8CNyeQDes7sTSl1M9BpvmJkpi+AtoOVKaypg2xK9dmnmZVNegQ8AtNZKAROsz2tR+mQyu7Cu0if0crEspiyv9ukOKdyu9YHHKiBLFlSksPVHRZozu7rHKvvcxSB7UM0fjSW4aXXTeyMsnvrvLSznZdzI94ARSD00ESbDnaKLu8OEluNDqW59+jhEtgHkCDYd/13vkGMrQey8lFxaJ7+vCA7QtZ8xdbO4ThvTvivj07N3m13aruP6ziws17+1/t0xWUBTkAM0813cSPvMa9cZKSnUxiwneE19tUGrOJbspJyec8p2uvn/g8="), this.addEntry("uml lollipop notation provided required interface",function(){return b.createVertexTemplateFromData("zZRNb9swDIZ/je6O3ey+OGsvG1Cgh55Vm7G0KqJB07HTXz/KUux4bbBdNvRgQHz5IYmPTFWUx/GBdGt+YA1OFd9UURIix9VxLME5lWe2VsVe5Xkmn8rvb3g3kzdrNYHnv0koYsJJux6iEoWOzy4JhL2vIcRnqtghscEGvXbfEVsRNyL+BObzk30LGbpnFMnw0SUv+PorEQ5iGu0OpaUq1A76vXUuFRYrVfgiVseEr/BsazapSvcKXJkUHA8JdQOre7OmBtK97963YopKfXgAPALTWUIInGZ7WpfSXTSbOW5OfUQrFfNsTBvFDmfnaG7X+R32VEFKWUDI4uoMizTh+RhV/n9RoWz0DtIKQroakJVbAD21urK+Sc6I4oZzYb35NDT/Nb67P+OTBNt24dcYjGUIPQueQabDGpN2tvGyrqQZQEHoWqhCXw52DPx3B2FWokNx7j16mH+p30SCzr7pl+kEAUV7ATZXf1yUHSFrvorWzuEwPZjukh86NfVuu1PbfXiFPTvrZV/v4xE3M/ETEMN4c3LdAHxJSKSGNCOClP5EA7YxvNY+egErmgs6MZcBHElfz+df", 40,10,"Lollipop Notation")}),this.createVertexTemplateEntry("shape=umlBoundary;whiteSpace=wrap;html=1;",100,80,"Boundary Object","Boundary Object",null,null,"uml boundary object"),this.createVertexTemplateEntry("ellipse;shape=umlEntity;whiteSpace=wrap;html=1;",80,80,"Entity Object","Entity Object",null,null,"uml entity object"),this.createVertexTemplateEntry("ellipse;shape=umlControl;whiteSpace=wrap;html=1;",70,80,"Control Object","Control Object",null,null,"uml control object"),this.createVertexTemplateEntry("shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;", 30,60,"Actor","Actor",!1,null,"uml actor"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;",140,70,"Use Case","Use Case",null,null,"uml use case usecase"),this.addEntry("uml activity state start",function(){var c=new mxCell("",new mxGeometry(0,0,30,30),"ellipse;html=1;shape=startState;fillColor=#000000;strokeColor=#ff0000;");c.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;"); h.geometry.setTerminalPoint(new mxPoint(15,90),!1);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!0);return b.createVertexTemplateFromCells([c,h],30,90,"Start")}),this.addEntry("uml activity state",function(){var c=new mxCell("Activity",new mxGeometry(0,0,120,40),"rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;");c.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;"); h.geometry.setTerminalPoint(new mxPoint(60,100),!1);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!0);return b.createVertexTemplateFromCells([c,h],120,100,"Activity")}),this.addEntry("uml activity composite state",function(){var c=new mxCell("Composite State",new mxGeometry(0,0,160,60),"swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;"); c.vertex=!0;var h=new mxCell("Subtitle",new mxGeometry(0,0,200,26),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;");h.vertex=!0;c.insert(h);h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");h.geometry.setTerminalPoint(new mxPoint(80,120),!1);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h, !0);return b.createVertexTemplateFromCells([c,h],160,120,"Composite State")}),this.addEntry("uml activity condition",function(){var c=new mxCell("Condition",new mxGeometry(0,0,80,40),"rhombus;whiteSpace=wrap;html=1;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;");c.vertex=!0;var h=new mxCell("no",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;align=left;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");h.geometry.setTerminalPoint(new mxPoint(180,20),!1); h.geometry.relative=!0;h.geometry.x=-1;h.edge=!0;c.insertEdge(h,!0);var k=new mxCell("yes",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;align=left;verticalAlign=top;endArrow=open;endSize=8;strokeColor=#ff0000;");k.geometry.setTerminalPoint(new mxPoint(40,100),!1);k.geometry.relative=!0;k.geometry.x=-1;k.edge=!0;c.insertEdge(k,!0);return b.createVertexTemplateFromCells([c,h,k],180,100,"Condition")}),this.addEntry("uml activity fork join",function(){var c=new mxCell("",new mxGeometry(0, 0,200,10),"shape=line;html=1;strokeWidth=6;strokeColor=#ff0000;");c.vertex=!0;var h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");h.geometry.setTerminalPoint(new mxPoint(100,80),!1);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!0);return b.createVertexTemplateFromCells([c,h],200,80,"Fork/Join")}),this.createVertexTemplateEntry("ellipse;html=1;shape=endState;fillColor=#000000;strokeColor=#ff0000;", 30,30,"","End",null,null,"uml activity state end"),this.createVertexTemplateEntry('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};',100,300,":Object","Lifeline",null,null,"uml sequence participant lifeline"),this.createVertexTemplateEntry('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};participant=umlActor;', 20,300,"","Actor Lifeline",null,null,"uml sequence participant lifeline actor"),this.createVertexTemplateEntry('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};participant=umlBoundary;',50,300,"","Boundary Lifeline",null,null,"uml sequence participant lifeline boundary"),this.createVertexTemplateEntry('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};participant=umlEntity;', 40,300,"","Entity Lifeline",null,null,"uml sequence participant lifeline entity"),this.createVertexTemplateEntry('shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};participant=umlControl;',40,300,"","Control Lifeline",null,null,"uml sequence participant lifeline control"),this.createVertexTemplateEntry("shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;", 300,200,"frame","Frame",null,null,"uml sequence frame"),this.createVertexTemplateEntry("shape=umlDestroy;whiteSpace=wrap;html=1;strokeWidth=3;targetShapes=umlLifeline;",30,30,"","Destruction",null,null,"uml sequence destruction destroy"),this.addEntry("uml sequence invoke invocation call activation bar",function(){var c=new mxCell("",new mxGeometry(0,0,10,80),'html=1;points=[[0,0,0,0,5],[0,1,0,0,-5],[1,0,0,0,5],[1,1,0,0,-5]];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};'); c.vertex=!0;var h=new mxCell("dispatch",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;startArrow=oval;endArrow=block;startSize=8;curved=0;rounded=0;entryX=0;entryY=0;entryDx=0;entryDy=5;");h.geometry.setTerminalPoint(new mxPoint(-70,5),!0);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!1);return b.createVertexTemplateFromCells([c,h],10,80,"Found Message")}),this.addEntry("uml sequence invoke call delegation synchronous invocation activation bar",function(){var c=new mxCell("",new mxGeometry(0, 0,10,80),'html=1;points=[[0,0,0,0,5],[0,1,0,0,-5],[1,0,0,0,5],[1,1,0,0,-5]];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};');c.vertex=!0;var h=new mxCell("dispatch",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;entryX=0;entryY=0;entryDx=0;entryDy=5;");h.geometry.setTerminalPoint(new mxPoint(-70,5),!0);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!1);var k=new mxCell("return", new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;curved=0;rounded=0;exitX=0;exitY=1;exitDx=0;exitDy=-5;");k.geometry.setTerminalPoint(new mxPoint(-70,75),!1);k.geometry.relative=!0;k.edge=!0;c.insertEdge(k,!0);return b.createVertexTemplateFromCells([c,h,k],10,80,"Synchronous Invocation")}),this.addEntry("uml sequence self call recursion delegation activation bar",function(){var c=new mxCell("",new mxGeometry(-5,20,10,40),'html=1;points=[[0,0,0,0,5],[0,1,0,0,-5],[1,0,0,0,5],[1,1,0,0,-5]];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};'); c.vertex=!0;var h=new mxCell("self call",new mxGeometry(0,0,0,0),"html=1;align=left;spacingLeft=2;endArrow=block;rounded=0;edgeStyle=orthogonalEdgeStyle;curved=0;rounded=0;");h.geometry.setTerminalPoint(new mxPoint(0,0),!0);h.geometry.points=[new mxPoint(30,30)];h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!1);return b.createVertexTemplateFromCells([c,h],10,60,"Self Call")}),this.addEntry("uml sequence invoke call delegation callback activation bar",function(){var c=new mxCell("",new mxGeometry(0, 0,10,80),'html=1;points=[[0,0,0,0,5],[0,1,0,0,-5],[1,0,0,0,5],[1,1,0,0,-5]];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};');c.vertex=!0;var h=new mxCell("callback",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;entryX=1;entryY=0;entryDx=0;entryDy=5;");h.geometry.setTerminalPoint(new mxPoint(80,5),!0);h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!1);var k=new mxCell("return", new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;curved=0;rounded=0;exitX=1;exitY=1;exitDx=0;exitDy=-5;");k.geometry.setTerminalPoint(new mxPoint(80,75),!1);k.geometry.relative=!0;k.edge=!0;c.insertEdge(k,!0);return b.createVertexTemplateFromCells([c,h,k],10,80,"Callback")}),this.createVertexTemplateEntry('html=1;points=[[0,0,0,0,5],[0,1,0,0,-5],[1,0,0,0,5],[1,1,0,0,-5]];perimeter=orthogonalPerimeter;outlineConnect=0;targetShapes=umlLifeline;portConstraint=eastwest;newEdgeStyle={"curved":0,"rounded":0};', 10,80,"","Activation Bar",null,null,"uml sequence activation bar"),this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;startArrow=oval;startFill=1;endArrow=block;startSize=8;curved=0;rounded=0;",60,0,"dispatch","Found Message 1",null,"uml sequence message call invoke dispatch"),this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;startArrow=circle;startFill=1;endArrow=open;startSize=6;endSize=8;curved=0;rounded=0;",80,0,"dispatch","Found Message 2",null,"uml sequence message call invoke dispatch"), this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;",80,0,"dispatch","Message",null,"uml sequence message call invoke dispatch"),this.addEntry("uml sequence return message",function(){var c=new mxCell("return",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;curved=0;rounded=0;");c.geometry.setTerminalPoint(new mxPoint(80,0),!0);c.geometry.setTerminalPoint(new mxPoint(0,0),!1);c.geometry.relative=!0;c.edge=!0;return b.createEdgeTemplateFromCells([c], 80,0,"Return")}),this.addEntry("uml relation",function(){var c=new mxCell("name",new mxGeometry(0,0,0,0),"endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;");c.geometry.setTerminalPoint(new mxPoint(0,0),!0);c.geometry.setTerminalPoint(new mxPoint(160,0),!1);c.geometry.relative=!0;c.geometry.x=-1;c.edge=!0;var h=new mxCell("1",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");h.geometry.relative=!0;h.setConnectable(!1); h.vertex=!0;c.insert(h);return b.createEdgeTemplateFromCells([c],160,0,"Relation 1")}),this.addEntry("uml association",function(){var c=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;");c.geometry.setTerminalPoint(new mxPoint(0,0),!0);c.geometry.setTerminalPoint(new mxPoint(160,0),!1);c.geometry.relative=!0;c.edge=!0;var h=new mxCell("parent",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");h.geometry.relative=!0; h.setConnectable(!1);h.vertex=!0;c.insert(h);h=new mxCell("child",new mxGeometry(1,0,0,0),"edgeLabel;resizable=0;html=1;align=right;verticalAlign=bottom;");h.geometry.relative=!0;h.setConnectable(!1);h.vertex=!0;c.insert(h);return b.createEdgeTemplateFromCells([c],160,0,"Association 1")}),this.addEntry("uml aggregation",function(){var c=new mxCell("1",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;"); c.geometry.setTerminalPoint(new mxPoint(0,0),!0);c.geometry.setTerminalPoint(new mxPoint(160,0),!1);c.geometry.relative=!0;c.geometry.x=-1;c.geometry.y=3;c.edge=!0;return b.createEdgeTemplateFromCells([c],160,0,"Aggregation 1")}),this.addEntry("uml composition",function(){var c=new mxCell("1",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;");c.geometry.setTerminalPoint(new mxPoint(0, 0),!0);c.geometry.setTerminalPoint(new mxPoint(160,0),!1);c.geometry.relative=!0;c.geometry.x=-1;c.geometry.y=3;c.edge=!0;return b.createEdgeTemplateFromCells([c],160,0,"Composition 1")}),this.addEntry("uml relation",function(){var c=new mxCell("Relation",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;");c.geometry.setTerminalPoint(new mxPoint(0,0),!0);c.geometry.setTerminalPoint(new mxPoint(160,0),!1);c.geometry.relative= !0;c.edge=!0;var h=new mxCell("0..n",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=top;");h.geometry.relative=!0;h.setConnectable(!1);h.vertex=!0;c.insert(h);h=new mxCell("1",new mxGeometry(1,0,0,0),"edgeLabel;resizable=0;html=1;align=right;verticalAlign=top;");h.geometry.relative=!0;h.setConnectable(!1);h.vertex=!0;c.insert(h);return b.createEdgeTemplateFromCells([c],160,0,"Relation 2")}),this.createEdgeTemplateEntry("endArrow=open;endSize=12;dashed=1;html=1;",160, 0,"Use","Dependency",null,"uml dependency use"),this.createEdgeTemplateEntry("endArrow=block;endSize=16;endFill=0;html=1;",160,0,"Extends","Generalization",null,"uml generalization extend"),this.createEdgeTemplateEntry("endArrow=block;startArrow=block;endFill=1;startFill=1;html=1;",160,0,"","Association 2",null,"uml association"),this.createEdgeTemplateEntry("endArrow=open;startArrow=circlePlus;endFill=0;startFill=0;endSize=8;html=1;",160,0,"","Inner Class",null,"uml inner class"),this.createEdgeTemplateEntry("endArrow=open;startArrow=cross;endFill=0;startFill=0;endSize=8;startSize=10;html=1;", 160,0,"","Terminate",null,"uml terminate"),this.createEdgeTemplateEntry("endArrow=block;dashed=1;endFill=0;endSize=12;html=1;",160,0,"","Implementation",null,"uml realization implementation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=0;endSize=24;html=1;",160,0,"","Aggregation 2",null,"uml aggregation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=1;endSize=24;html=1;",160,0,"","Composition 2",null,"uml composition"),this.createEdgeTemplateEntry("endArrow=open;endFill=1;endSize=12;html=1;", 160,0,"","Association 3",null,"uml association")];this.addPaletteFunctions("uml",mxResources.get("uml"),a||!1,g);this.setCurrentSearchEntryLibrary()}; Sidebar.prototype.createTitle=function(a){var b=document.createElement("a");b.setAttribute("title",mxResources.get("reorder"));b.className="geTitle";var d=document.createElement("span");d.setAttribute("title",mxResources.get("collapseExpand",null,"Collapse/Expand"));d.style.cssText="position:absolute;left:0;top:0;width:24px;height:100%;cursor:pointer";b.appendChild(d);d=document.createElement("span");mxUtils.write(d,a);b.appendChild(d);return b}; Sidebar.prototype.createThumb=function(a,b,d,e,g,c,h,k,p,l,u,x){this.graph.labelsVisible=null==c||c;c=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;this.graph.shapeForegroundColor="light-dark(#000000, #ffffff)";this.graph.shapeBackgroundColor=null!=l?l:"light-dark(var(--ge-panel-color), var(--ge-dark-panel-color))";this.graph.view.scaleAndTranslate(null!=x?x:1,0,0);this.graph.addCells(a);a=this.graph.getGraphBounds();null==x&&(l=Math.floor(100*Math.min((b-2*this.thumbBorder)/ a.width,(d-2*this.thumbBorder)/a.height))/100,this.graph.view.scaleAndTranslate(l,(b-a.width*l)/2/l-a.x,(d-a.height*l)/2/l-a.y));this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO||null==this.graph.view.getCanvas().ownerSVGElement?(l=this.graph.container.cloneNode(!1),l.innerHTML=this.graph.container.innerHTML):l=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0);this.graph.getModel().clear();this.graph.view.scaleAndTranslate(1,0,0);mxClient.NO_FO=c;l.style.position="relative";l.style.overflow= null!=x?"visible":"hidden";l.style.left=(null!=u?u:this.thumbBorder-1)+"px";l.style.top=l.style.left;l.style.width=b+"px";l.style.height=d+"px";l.style.visibility="";l.style.minWidth="";l.style.minHeight="";this.disablePointerEvents(l);e.appendChild(l);this.sidebarTitles&&null!=g&&0!=h&&(e.style.height=this.thumbHeight+0+this.sidebarTitleSize+8+"px",b=document.createElement("div"),b.style.color=Editor.isDarkMode()?"#A0A0A0":"#303030",b.style.fontSize=this.sidebarTitleSize+"px",b.style.textAlign="center", b.style.whiteSpace="nowrap",b.style.overflow="hidden",b.style.textOverflow="ellipsis",b.style.paddingTop="4px",mxUtils.write(b,g),e.appendChild(b));return a};Sidebar.prototype.createSection=function(a){return mxUtils.bind(this,function(){var b=document.createElement("div");b.setAttribute("title",a);b.style.textOverflow="ellipsis";b.style.whiteSpace="nowrap";b.style.textAlign="center";b.style.overflow="hidden";b.style.width="100%";b.style.padding="14px 0";mxUtils.write(b,a);return b})}; Sidebar.prototype.createItem=function(a,b,d,e,g,c,h,k,p,l,u,x,v,z,C,F){k=null!=k?k:!0;l=null!=l?l:this.thumbWidth;u=null!=u?u:this.thumbHeight;var G=C;if(null==G){G=document.createElement("a");var H=2*this.thumbBorder;G.style.width=l+H+"px";G.style.height=u+H+"px"}G.setAttribute("title","");mxEvent.addListener(G,"click",function(M){mxEvent.consume(M)});var J=new mxRectangle(0,0,g,c);if(null!=a&&0<a.length){var O=a;a=this.graph.cloneCells(a);this.graph.pasteCellStyles(this.graph.includeDescendants(O), this.initialDefaultVertexStyle,this.initialDefaultEdgeStyle);null!=x?(G.className="geButton",G.style.backgroundImage="url("+x+")",G.style.backgroundRepeat="no-repeat",G.style.backgroundPosition="center",G.style.backgroundSize="24px 24px"):null==C&&(G.className="geItem",this.virtualThumbs?(this.sidebarTitles&&null!=b&&0!=e&&(G.style.height=this.thumbHeight+this.sidebarTitleSize+8+"px"),G.renderThumbFn=mxUtils.bind(this,function(){this.createThumb(O,l,u,G,b,d,e,g,c)}),this.getThumbObserver().observe(G)): this.createThumb(O,l,u,G,b,d,e,g,c));1<a.length||a[0].vertex?(h=this.createDragSource(G,this.createDropHandler(a,!0,h,J,v,z,F),this.createDragPreview(g,c),a,J,v,z),this.addClickHandler(G,h,a,p,v),h.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):null!=a[0]&&a[0].edge&&(h=this.createDragSource(G,this.createDropHandler(a,!1,h,J,v,z,F),this.createDragPreview(g,c),a,J,v),this.addClickHandler(G,h,a,p));!mxClient.IS_IOS&&k&&mxEvent.addGestureListeners(G, null,mxUtils.bind(this,function(M){mxEvent.isMouseEvent(M)&&(M="1"==urlParams.embedInline?new mxPoint(M.clientX+16,M.clientY+16):null,this.showTooltip(G,a,J.width,J.height,b,d,M))}))}else null==C&&(G.style.backgroundImage="url("+Editor.svgBrokenImage.src+")",G.setAttribute("title",b));return G}; Sidebar.prototype.prepareCellsForInsert=function(a){if(null!=a&&0<a.length)for(var b=this.graph.getModel(),d=0;d<a.length;d++)if(this.prepareCellsForInsert(b.getChildren(a[d])),b.isVertex(a[d])){var e=b.getEdges(a[d]),g=this.graph.getCellStyle(a[d]);null!=e&&0!=e.length||null==g||1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0)&&1!=mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0)&&1!=mxUtils.getValue(g,"stencilFlipH",0)&&1!=mxUtils.getValue(g,"stencilFlipV",0)||this.graph.setCellStyles("legacyAnchorPoints", "0",[a[d]])}}; Sidebar.prototype.createDropHandler=function(a,b,d,e,g,c,h){d=null!=d?d:!0;this.prepareCellsForInsert.call(this,a);return mxUtils.bind(this,function(k,p,l,u,x,v){for(v=v?null:mxEvent.isTouchEvent(p)||mxEvent.isPenEvent(p)?document.elementFromPoint(mxEvent.getClientX(p),mxEvent.getClientY(p)):mxEvent.getSource(p);null!=v&&v!=this.container;)v=v.parentNode;if(null==v&&k.isEnabled()){a=k.getImportableCells(a);if(0<a.length){k.stopEditing();v=null==l||mxEvent.isAltDown(p)?!1:k.isValidDropTarget(l,a,p); var z=null;null==l||v||(l=null);null!=h&&(l=null);if(!k.isCellLocked(l||k.getDefaultParent())){k.model.beginUpdate();try{u=Math.round(u);x=Math.round(x);if(b&&k.isSplitTarget(l,a,p)){var C=k.view.scale,F=k.view.translate,G=(u+F.x)*C,H=(x+F.y)*C,J=k.cloneCells(a);k.splitEdge(l,J,null,u-e.width/2,x-e.height/2,G,H);z=J}else if(0<a.length)if(z=k.importCells(a,u,x,l),k.model.isVertex(c)&&1==z.length&&k.model.isVertex(z[0])){var O=k.insertEdge(k.model.getParent(c),null,"",c,z[0],k.createCurrentEdgeStyle()); k.applyNewEdgeStyle(c,[O]);z.push(O);k.connectionHandler.insertBeforeSource&&k.insertEdgeBeforeCell(O,c)}else if(null!=h&&1==z.length&&k.model.isVertex(z[0])&&k.model.contains(h.cell)){k.model.setTerminal(h.cell,z[0],h.source);var M=k.getCellGeometry(h.cell);null!=M&&null!=M.getTerminalPoint(h.source)&&(M=M.clone(),M.setTerminalPoint(null,h.source),k.model.setGeometry(h.cell,M))}if(null!=k.layoutManager){var V=k.layoutManager.getLayout(l);if(null!=V){C=k.view.scale;F=k.view.translate;G=(u+F.x)*C; H=(x+F.y)*C;for(var Q=0;Q<z.length;Q++)V.moveCell(z[Q],G,H)}}!d||null!=p&&mxEvent.isShiftDown(p)||k.fireEvent(new mxEventObject("cellsInserted","cells",z));for(Q=0;Q<z.length;Q++)k.model.isVertex(z[Q])&&k.isAutoSizeCell(z[Q])&&k.updateCellSize(z[Q])}catch(ma){this.editorUi.handleError(ma)}finally{k.model.endUpdate()}null!=z&&0<z.length&&(k.isCellVisibleInViewport(z[0])||k.scrollCellToVisible(z[0]),k.setSelectionCells(z));(g||k.editAfterInsert&&null!=p&&mxEvent.isMouseEvent(p)&&null!=z&&1==z.length)&& window.setTimeout(function(){k.startEditing(z[0])},0)}}mxEvent.consume(p)}})};Sidebar.prototype.createDragPreview=function(a,b){var d=document.createElement("div");d.className="geDragPreview";d.style.width=a+"px";d.style.height=b+"px";return d}; Sidebar.prototype.createEdgePreview=function(a,b,d){var e={handler:null,targetState:null,shape:null,update:function(g,c,h,k){var p=a.view.getState(b);if(null==p)e.hide();else{if(null==e.handler){e.handler={graph:a,previous:p,currentState:null,edgeState:null,sourceConstraint:null,constraintHandler:null,waypoints:null,convertWaypoint:mxConnectionHandler.prototype.convertWaypoint};e.handler.edgeState=mxConnectionHandler.prototype.createEdgeState.call(e.handler,null);var l=a.cloneCell(d);e.targetState= new mxCellState(a.view,l,a.getCellStyle(l));e.handler.currentState=e.targetState}e.handler.previous=p;p=e.targetState;p.x=g;p.y=c;p.width=h;p.height=k;p=p.cell.geometry;if(null!=p){l=a.view.scale;var u=a.view.translate;p.x=g/l-u.x;p.y=c/l-u.y;p.width=h/l;p.height=k/l}null==e.shape&&(e.shape=mxConnectionHandler.prototype.createShape.call({graph:a,livePreview:!0,edgeState:e.handler.edgeState}),e.shape.apply(e.handler.edgeState));mxConnectionHandler.prototype.updateEdgeState.call(e.handler,new mxPoint(g+ h/2,c+k/2),null);g=e.handler.edgeState;e.shape.points=g.absolutePoints;e.shape.scale=a.view.scale;g.shape=e.shape;a.cellRenderer.postConfigureShape(g);g.shape=null;e.shape.node.style.display="";e.shape.redraw()}},hide:function(){null!=e.shape&&(e.shape.node.style.display="none")},destroy:function(){null!=e.shape&&(e.shape.destroy(),e.shape=null);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(e.handler);e.handler=null;e.targetState=null}};return e}; Sidebar.prototype.dropAndConnect=function(a,b,d,e,g,c,h){var k=this.editorUi.editor.graph,p=k.model.isEdge(a)||null!=c?c:h;p=this.getDropAndConnectGeometry(a,b[p],d,b);var l=[];if(null!=p){var u=null;k.model.beginUpdate();try{var x=k.getCellGeometry(a),v=k.getCellGeometry(b[e]),z=k.model.getParent(a),C=!0;if(null!=k.layoutManager){var F=k.layoutManager.getLayout(z);null!=F&&F.constructor==mxStackLayout&&(C=!1)}l=k.model.isEdge(a)?null:k.view.getState(z);var G=F=0;if(null!=l){var H=l.origin;F=H.x; G=H.y}var J=!k.isTableRow(a)&&!k.isTableCell(a)&&(k.model.isEdge(a)||null!=x&&!x.relative&&C),O=k.getCellAt((p.x+F+k.view.translate.x)*k.view.scale,(p.y+G+k.view.translate.y)*k.view.scale,null,null,null,function(na,Z,da){return!k.isContainer(na.cell)});if(null!=O&&O!=z)l=k.view.getState(O),null!=l&&(H=l.origin,z=O,J=!0,k.model.isEdge(a)||(p.x-=H.x-F,p.y-=H.y-G));else if(!C||k.isTableRow(a)||k.isTableCell(a))p.x+=F,p.y+=G;F=v.x;G=v.y;k.model.isEdge(b[e])&&(G=F=0);l=b=k.importCells(b,p.x-(J?F:0),p.y- (J?G:0),J?z:null);if(k.model.isEdge(a))k.model.setTerminal(a,b[e],d==mxConstants.DIRECTION_NORTH),null!=h&&null!=c&&(k.model.remove(b[h]),k.updateShapes(b[h],[a]));else if(k.model.isEdge(b[e])&&null==c){k.model.setTerminal(b[e],a,!0);var M=k.getCellGeometry(b[e]),V=null!=M?M.getTerminalPoint(!0):null;M.points=null;if(null!=V)for(d=0;d<b.length;d++)if(k.model.isEdge(b[d])&&d!=e){var Q=k.getCellGeometry(b[d]),ma=null!=Q?Q.getTerminalPoint(!0):null;null!=ma&&ma.x==V.x&&ma.y==V.y&&k.model.setTerminal(b[d], a,!0)}if(null!=M.getTerminalPoint(!1))M.setTerminalPoint(p.getTerminalPoint(!1),!1);else if(J&&k.model.isVertex(z)){var ia=k.view.getState(z);H=ia.cell!=k.view.currentRoot?ia.origin:new mxPoint(0,0);k.cellsMoved(b,H.x,H.y,null,null,!0)}}else null!=c&&(v=k.getCellGeometry(b[c]),F=p.x-Math.round(v.x),G=p.y-Math.round(v.y),p.x=Math.round(v.x),p.y=Math.round(v.y),k.model.setGeometry(b[e],p),k.cellsMoved(b,F,G,null,null,!0),l=b.slice(),u=1==l.length?l[0]:null,null!=h?k.model.setTerminal(b[h],a,!0):b.push(k.insertEdge(null, null,"",a,b[e],k.createCurrentEdgeStyle())));null!=g&&mxEvent.isShiftDown(g)||k.fireEvent(new mxEventObject("cellsInserted","cells",b))}catch(na){this.editorUi.handleError(na)}finally{k.model.endUpdate()}k.editAfterInsert&&null!=g&&mxEvent.isMouseEvent(g)&&null!=u&&window.setTimeout(function(){k.startEditing(u)},0)}null!=h&&1<l.length&&l.splice(h,1);return l}; Sidebar.prototype.getDropAndConnectGeometry=function(a,b,d,e){var g=this.editorUi.editor.graph,c=g.view,h=1<e.length,k=g.view.getState(a),p=g.getCellGeometry(a);e=g.getCellGeometry(b);null!=k&&null!=p&&null!=e&&(e=e.clone(),g.model.isEdge(a)?(p=k.absolutePoints,b=p[0],g=p[p.length-1],d==mxConstants.DIRECTION_NORTH?(e.x=b.x/c.scale-c.translate.x-e.width/2,e.y=b.y/c.scale-c.translate.y-e.height/2):(e.x=g.x/c.scale-c.translate.x-e.width/2,e.y=g.y/c.scale-c.translate.y-e.height/2)):(p.relative&&(p=p.clone(), p.x=(k.x-c.translate.x)/c.scale,p.y=(k.y-c.translate.y)/c.scale),c=g.defaultEdgeLength,g.model.isEdge(b)&&null!=e.getTerminalPoint(!0)&&null!=e.getTerminalPoint(!1)?(b=e.getTerminalPoint(!0),g=e.getTerminalPoint(!1),c=g.x-b.x,b=g.y-b.y,c=Math.sqrt(c*c+b*b),e.x=p.getCenterX(),e.y=p.getCenterY(),e.width=1,e.height=1,d==mxConstants.DIRECTION_NORTH?(e.height=c,e.y=p.y-c,e.setTerminalPoint(new mxPoint(e.x,e.y),!1)):d==mxConstants.DIRECTION_EAST?(e.width=c,e.x=p.x+p.width,e.setTerminalPoint(new mxPoint(e.x+ e.width,e.y),!1)):d==mxConstants.DIRECTION_SOUTH?(e.height=c,e.y=p.y+p.height,e.setTerminalPoint(new mxPoint(e.x,e.y+e.height),!1)):d==mxConstants.DIRECTION_WEST&&(e.width=c,e.x=p.x-c,e.setTerminalPoint(new mxPoint(e.x,e.y),!1))):(!h&&45<e.width&&45<e.height&&45<p.width&&45<p.height&&(e.width*=p.height/e.height,e.height=p.height),e.x=p.x+p.width/2-e.width/2,e.y=p.y+p.height/2-e.height/2,d==mxConstants.DIRECTION_NORTH?e.y=e.y-p.height/2-e.height/2-c:d==mxConstants.DIRECTION_EAST?e.x=e.x+p.width/2+ e.width/2+c:d==mxConstants.DIRECTION_SOUTH?e.y=e.y+p.height/2+e.height/2+c:d==mxConstants.DIRECTION_WEST&&(e.x=e.x-p.width/2-e.width/2-c),g.model.isEdge(b)&&null!=e.getTerminalPoint(!0)&&null!=b.getTerminal(!1)&&(p=g.getCellGeometry(b.getTerminal(!1)),null!=p&&(d==mxConstants.DIRECTION_NORTH?(e.x-=p.getCenterX(),e.y-=p.getCenterY()+p.height/2):d==mxConstants.DIRECTION_EAST?(e.x-=p.getCenterX()-p.width/2,e.y-=p.getCenterY()):d==mxConstants.DIRECTION_SOUTH?(e.x-=p.getCenterX(),e.y-=p.getCenterY()-p.height/ 2):d==mxConstants.DIRECTION_WEST&&(e.x-=p.getCenterX()+p.width/2,e.y-=p.getCenterY()))))));return e};Sidebar.prototype.isDropStyleEnabled=function(a,b){var d=!0;null!=b&&1==a.length&&0==this.graph.model.getChildCount(a[b])&&(a=this.graph.getCellStyle(a[b]),null!=a&&(d=mxUtils.getValue(a,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(a,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE));return d}; 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.getEdgeLabelStateAt=function(a,b,d){for(var e=a.view.graph,g=null,c=e.model.getChildCount(a.cell)-1;0<=c&&null==g;c--){var h=e.model.getChildAt(a.cell,c);e.model.isVertex(h)&&(h=e.view.getState(h),null!=h&&(mxUtils.contains(h,b,d)||null!=h.text&&null!=h.text.boundingBox&&mxUtils.contains(h.text.boundingBox,b,d))&&(g=h))}null==g&&null!=a.text&&null!=a.text.boundingBox&&mxUtils.contains(a.text.boundingBox,b,d)&&(g=a);return g}; Sidebar.prototype.getThumbObserver=function(){null==this.thumbObserver&&(this.thumbObserver=new IntersectionObserver(mxUtils.bind(this,function(a){for(var b=0;b<a.length;b++){var d=a[b];if(d.isIntersecting){var e=d.target.renderThumbFn;null!=e&&(d.target.renderThumbFn=null,this.thumbObserver.unobserve(d.target),e())}}}),{rootMargin:"200px 0px"}));return this.thumbObserver}; Sidebar.prototype.getPaletteObserver=function(){null==this.paletteObserver&&(this.paletteObserver=new IntersectionObserver(mxUtils.bind(this,function(a){for(var b=0;b<a.length;b++){var d=a[b];if(d.isIntersecting){var e=d.target.initPaletteFn;null!=e&&(this.paletteObserver.unobserve(d.target),e())}}}),{rootMargin:"200px 0px"}));return this.paletteObserver}; Sidebar.prototype.deferPaletteInit=function(a,b,d){""==a.style.minHeight&&(a.style.minHeight=this.deferredPaletteHeight+"px");a.initPaletteFn=mxUtils.bind(this,function(){a.initPaletteFn=null;a.style.minHeight="";var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;d(a,b);mxClient.NO_FO=e});this.getPaletteObserver().observe(a)}; Sidebar.prototype.setDeferredPaletteSize=function(a,b){null!=a&&null!=a.initPaletteFn&&0<b&&(a.style.minHeight=Math.ceil(b/Math.max(1,Math.floor(200/(this.thumbWidth+2*this.thumbBorder+4))))*(this.thumbHeight+2*this.thumbBorder+6)+"px")}; Sidebar.prototype.unobserveElements=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=this.thumbObserver||null!=this.paletteObserver)){a=[a].concat(Array.prototype.slice.call(a.querySelectorAll(".geItem, .geSidebar")));for(var b=0;b<a.length;b++)null!=this.thumbObserver&&null!=a[b].renderThumbFn&&(a[b].renderThumbFn=null,this.thumbObserver.unobserve(a[b])),null!=this.paletteObserver&&null!=a[b].initPaletteFn&&(a[b].initPaletteFn=null,this.paletteObserver.unobserve(a[b]))}}; Sidebar.prototype.disconnectObservers=function(){null!=this.thumbObserver&&(this.thumbObserver.disconnect(),this.thumbObserver=null);null!=this.paletteObserver&&(this.paletteObserver.disconnect(),this.paletteObserver=null)};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,d,e,g,c,h){function k(ta,Fa){var Ma=mxUtils.createImage(ta.src);Ma.style.width=ta.width+"px";Ma.style.height=ta.height+"px";null!=Fa&&Ma.setAttribute("title",Fa);mxUtils.setOpacity(Ma,ta==this.refreshTarget?30:20);Ma.style.position="absolute";Ma.style.cursor="crosshair";return Ma}function p(ta,Fa,Ma,ab){null!=ab.parentNode&&(mxUtils.contains(Ma,ta,Fa)?(mxUtils.setOpacity(ab,100),ea=ab):mxUtils.setOpacity(ab,ab==S?30:20));return Ma}var l=this.editorUi, u=l.editor.graph,x=null,v=null,z=this;c=0;var C=this.livePreview,F=null!=h&&u.model.isVertex(h)&&1==e.length&&u.model.isVertex(e[0])?this.createEdgePreview(u,h,e[0]):null;for(h=0;h<e.length&&C;h++)c+=u.model.getDescendants(e[h]).length,C=c<u.graphHandler.maxLivePreview;for(h=0;h<e.length&&(null==v&&u.model.isVertex(e[h])?v=h:null==x&&u.model.isEdge(e[h])&&null==u.model.getTerminal(e[h],!0)&&(x=h),null==v||null==x);h++);var G=null!=v&&0<u.model.getChildCount(e[v]),H=this.isDropStyleEnabled(e,v),J= mxUtils.makeDraggable(a,u,mxUtils.bind(this,function(ta,Fa,Ma,ab,Za){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=e&&null!=Q&&ea==S)if(ia)ta.setSelectionCell(ta.updateEdgeLabelShape(e[v],Q.cell));else{var Xa=ta.isCellSelected(Q.cell)?ta.getSelectionCells():[Q.cell];ta.updateShapes(ta.model.isEdge(Q.cell)?e[0]:e[v],Xa,!0);ta.setSelectionCells(Xa)}else null!=e&&null!=ea&&null!=M&&ea!=S?(Xa=ta.model.isEdge(M.cell)||null==x?v:x,ta.setSelectionCells(this.dropAndConnect(M.cell, e,R,Xa,Fa,v,x))):b.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(ta.view.getState(ta.getSelectionCell()))}),d,0,0,u.autoscroll,!0,!0);C&&(J.createDragElement=mxUtils.bind(this,function(){return J.createPreviewElement(this.graph)}),J.createPreviewElement=mxUtils.bind(this,function(ta){var Fa=document.createElement("a");Fa.className="geItem";Fa.style.overflow="visible";ta=ta.view.scale;Fa.style.width=ta*Math.max(1,g.width)+"px";Fa.style.height=ta*Math.max(1,g.height)+ "px";mxUtils.setOpacity(Fa,50);var Ma=u.cloneCells(e);this.graph.pasteCellStyles(u.includeDescendants(Ma),u.currentVertexStyle,u.currentEdgeStyle,null,u.pasteEdgeStyle,u.pasteStylesToText);z.createThumb(Ma,ta*Math.max(1,g.width),ta*Math.max(1,g.height),Fa,null,null,null,null,null,u.shapeBackgroundColor,0,ta);return Fa}));var O=J.mouseDown;J.mouseDown=function(ta){mxEvent.isPopupTrigger(ta)||mxEvent.isMultiTouchEvent(ta)||u.isCellLocked(u.getDefaultParent())||(u.stopEditing(),O.apply(this,arguments))}; var M=null,V=null,Q=null,ma=null,ia=!1,na=!1,Z=k(this.triangleUp,mxResources.get("connect")),da=k(this.triangleRight,mxResources.get("connect")),pa=k(this.triangleDown,mxResources.get("connect")),ka=k(this.triangleLeft,mxResources.get("connect")),S=k(this.refreshTarget,mxResources.get("replace")),U=null,Y=k(this.roundDrop),N=k(this.roundDrop),R=mxConstants.DIRECTION_NORTH,ea=null,ba=J.createPreviewElement;J.createPreviewElement=function(ta){var Fa=ba.apply(this,arguments);this.previewElementWidth= Fa.style.width;this.previewElementHeight=Fa.style.height;Fa.style.pointerEvents="none";return Fa};var la=J.dragEnter;J.dragEnter=function(ta,Fa){null!=l.hoverIcons&&l.hoverIcons.setDisplay("none");la.apply(this,arguments)};var sa=J.dragExit;J.dragExit=function(ta,Fa){null!=l.hoverIcons&&l.hoverIcons.setDisplay("");null!=F&&F.destroy();sa.apply(this,arguments)};J.dragOver=function(ta,Fa){mxDragSource.prototype.dragOver.apply(this,arguments);null!=this.currentGuide&&null!=ea&&this.currentGuide.hide(); if(null!=this.previewElement){l.hideShapePicker();var Ma=ta.view;if(null!=Q&&ea==S)this.previewElement.style.display="none";else if(null!=M&&null!=ea){null!=J.currentHighlight&&null!=J.currentHighlight.state&&J.currentHighlight.hide();var ab=ta.model.isEdge(M.cell)||null!=v?v:x,Za=z.getDropAndConnectGeometry(M.cell,e[ab],R,e),Xa=ta.model.isEdge(M.cell)?null:ta.getCellGeometry(M.cell),Va=ta.getCellGeometry(e[ab]),ja=ta.model.getParent(M.cell),ya=Ma.translate.x*Ma.scale,db=Ma.translate.y*Ma.scale;null!= Xa&&!Xa.relative&&ta.model.isVertex(ja)&&ja!=Ma.currentRoot&&(db=Ma.getState(ja),ya=Ma.scale*(Ma.translate.x+db.origin.x),db=Ma.scale*(Ma.translate.y+db.origin.y));Xa=Va.x;Va=Va.y;ta.model.isEdge(e[ab])&&(Va=Xa=0);this.previewElement.style.left=(Za.x-Xa)*Ma.scale+ya+"px";this.previewElement.style.top=(Za.y-Va)*Ma.scale+db+"px";1==e.length&&(this.previewElement.style.width=Za.width*Ma.scale+"px",this.previewElement.style.height=Za.height*Ma.scale+"px",null!=this.previewElement.firstChild&&(this.previewElement.firstChild.style.display= "none",this.previewElement.className="geDragPreview",mxUtils.setOpacity(this.previewElement,100)));this.previewElement.style.display=""}else null!=J.currentHighlight&&null!=J.currentHighlight.state&&ta.model.isEdge(J.currentHighlight.state.cell)?(this.previewElement.style.left=Math.round(parseInt(this.previewElement.style.left)-g.width*Ma.scale/2)+"px",this.previewElement.style.top=Math.round(parseInt(this.previewElement.style.top)-g.height*Ma.scale/2)+"px"):(this.previewElement.style.width=this.previewElementWidth, this.previewElement.style.height=this.previewElementHeight,this.previewElement.style.display="",null!=this.previewElement.firstChild&&(this.previewElement.firstChild.style.display="",mxUtils.setOpacity(this.previewElement,50),this.previewElement.className=""));null!=F&&(null!=ea||null!=Q||"none"==this.previewElement.style.display||"hidden"==this.previewElement.style.visibility||null!=J.currentHighlight&&null!=J.currentHighlight.state&&ta.model.isEdge(J.currentHighlight.state.cell)?F.hide():F.update(parseFloat(this.previewElement.style.left), parseFloat(this.previewElement.style.top),parseFloat(this.previewElement.style.width),parseFloat(this.previewElement.style.height)))}};var T=(new Date).getTime(),ua=0,va=null,Ka=this.editorUi.editor.graph.getCellStyle(e[0]);J.getDropTarget=mxUtils.bind(this,function(ta,Fa,Ma,ab){var Za=mxEvent.isAltDown(ab)||null==e?null:ta.getCellAt(Fa,Ma,null,null,null,function(db,mb,kb){return ta.isContainer(db.cell)&&"0"!=mxUtils.getValue(db.style,"dropTarget","1")});if(null!=Za&&!this.graph.isCellConnectable(Za)&& !this.graph.model.isEdge(Za)){var Xa=this.graph.getModel().getParent(Za);this.graph.getModel().isVertex(Xa)&&this.graph.isCellConnectable(Xa)&&(Za=Xa)}ta.isCellLocked(Za)&&(Za=null);var Va=ta.view.getState(Za);Xa=ea=null;va!=Va?(T=(new Date).getTime(),ua=0,va=Va,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=Va&&(this.updateThread=window.setTimeout(function(){null==ea&&(va=Va,J.getDropTarget(ta,Fa,Ma,ab))},this.dropTargetDelay+10))):ua=(new Date).getTime()-T;var ja=null==Va|| !ta.model.isEdge(Va.cell)||null==v||G||ta.model.isEdge(e[0])?null:this.getEdgeLabelStateAt(Va,Fa,Ma);if(H&&3500>ua&&null!=Va&&!mxEvent.isShiftDown(ab)&&((mxUtils.getValue(Va.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(Ka,mxConstants.STYLE_SHAPE)||G)&&(mxUtils.getValue(Va.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(Va.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(Va.style,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.NONE)!= mxConstants.NONE)||"image"==mxUtils.getValue(Ka,mxConstants.STYLE_SHAPE)||1500<ua||ta.model.isEdge(Va.cell))&&ua>this.dropTargetDelay&&!this.isDropStyleTargetIgnored(Va)&&(null!=ja||ta.model.isVertex(Va.cell)&&null!=v||ta.model.isEdge(Va.cell)&&ta.model.isEdge(e[0]))){if(ta.isCellEditable(null!=ja?ja.cell:Va.cell)){Q=null!=ja?ja:Va;ia=null!=ja;var ya=null;ya=null!=ja&&null!=ja.text&&null!=ja.text.boundingBox?new mxPoint(ja.text.boundingBox.getCenterX(),ja.text.boundingBox.getCenterY()):ta.model.isEdge(Q.cell)? ta.view.getPoint(Q):new mxPoint(Q.getCenterX(),Q.getCenterY());ya=new mxRectangle(ya.x-this.refreshTarget.width/2,ya.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height);S.style.left=Math.floor(ya.x)+"px";S.style.top=Math.floor(ya.y)+"px";null==U&&(ta.container.appendChild(S),U=S.parentNode);ma=ya;p(Fa,Ma,ya,S)}}else null==Q||!(mxUtils.contains(Q,Fa,Ma)||null!=ma&&mxUtils.contains(ma,Fa,Ma))||1500<ua&&!mxEvent.isShiftDown(ab)?(ma=Q=null,ia=!1,null!=U&&(S.parentNode.removeChild(S), U=null)):null!=Q&&null!=U&&null!=ma&&p(Fa,Ma,ma,S);na&&null!=M&&!mxEvent.isAltDown(ab)&&null==ea&&(Xa=mxRectangle.fromRectangle(M),ta.model.isEdge(M.cell)?(ya=M.absolutePoints,null!=Y.parentNode&&(ja=ya[0],Xa.add(p(Fa,Ma,new mxRectangle(ja.x-this.roundDrop.width/2,ja.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height),Y))),null!=N.parentNode&&(ya=ya[ya.length-1],Xa.add(p(Fa,Ma,new mxRectangle(ya.x-this.roundDrop.width/2,ya.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height), N)))):(ja=mxRectangle.fromRectangle(M),null!=M.shape&&null!=M.shape.boundingBox&&(ja=mxRectangle.fromRectangle(M.shape.boundingBox)),ja.grow(this.graph.tolerance),ja.grow(HoverIcons.prototype.arrowSpacing),ya=this.graph.selectionCellsHandler.getHandler(M.cell),null!=ya&&(ja.x-=ya.horizontalOffset/2,ja.y-=ya.verticalOffset/2,ja.width+=ya.horizontalOffset,ja.height+=ya.verticalOffset,null!=ya.rotationShape&&null!=ya.rotationShape.node&&"hidden"!=ya.rotationShape.node.style.visibility&&"none"!=ya.rotationShape.node.style.display&& null!=ya.rotationShape.boundingBox&&ja.add(ya.rotationShape.boundingBox)),Xa.add(p(Fa,Ma,new mxRectangle(M.getCenterX()-this.triangleUp.width/2,ja.y-this.triangleUp.height,this.triangleUp.width,this.triangleUp.height),Z)),Xa.add(p(Fa,Ma,new mxRectangle(ja.x+ja.width,M.getCenterY()-this.triangleRight.height/2,this.triangleRight.width,this.triangleRight.height),da)),Xa.add(p(Fa,Ma,new mxRectangle(M.getCenterX()-this.triangleDown.width/2,ja.y+ja.height,this.triangleDown.width,this.triangleDown.height), pa)),Xa.add(p(Fa,Ma,new mxRectangle(ja.x-this.triangleLeft.width,M.getCenterY()-this.triangleLeft.height/2,this.triangleLeft.width,this.triangleLeft.height),ka))),null!=Xa&&Xa.grow(10));R=mxConstants.DIRECTION_NORTH;ea==da?R=mxConstants.DIRECTION_EAST:ea==pa||ea==N?R=mxConstants.DIRECTION_SOUTH:ea==ka&&(R=mxConstants.DIRECTION_WEST);null!=Q&&ea==S&&(Va=Q);ja=(null==v||ta.isCellConnectable(e[v]))&&(ta.model.isEdge(Za)&&null!=v||ta.model.isVertex(Za)&&ta.isCellConnectable(Za));if(null!=M&&5E3<=ua|| M!=Va&&(null==Xa||!mxUtils.contains(Xa,Fa,Ma)||500<ua&&null==ea&&ja))if(na=!1,M=5E3>ua&&ua>this.dropTargetDelay||ta.model.isEdge(Za)?Va:null,null!=M&&ja){Xa=[Y,N,Z,da,pa,ka];for(ja=0;ja<Xa.length;ja++)null!=Xa[ja].parentNode&&Xa[ja].parentNode.removeChild(Xa[ja]);ta.model.isEdge(Za)?(ya=Va.absolutePoints,null!=ya&&(ja=ya[0],ya=ya[ya.length-1],Y.style.left=Math.floor(ja.x-this.roundDrop.width/2)+"px",Y.style.top=Math.floor(ja.y-this.roundDrop.height/2)+"px",N.style.left=Math.floor(ya.x-this.roundDrop.width/ 2)+"px",N.style.top=Math.floor(ya.y-this.roundDrop.height/2)+"px",null==ta.model.getTerminal(Za,!0)&&ta.container.appendChild(Y),null==ta.model.getTerminal(Za,!1)&&ta.container.appendChild(N))):(ja=mxRectangle.fromRectangle(Va),null!=Va.shape&&null!=Va.shape.boundingBox&&(ja=mxRectangle.fromRectangle(Va.shape.boundingBox)),ja.grow(this.graph.tolerance),ja.grow(HoverIcons.prototype.arrowSpacing),ya=this.graph.selectionCellsHandler.getHandler(Va.cell),null!=ya&&(ja.x-=ya.horizontalOffset/2,ja.y-=ya.verticalOffset/ 2,ja.width+=ya.horizontalOffset,ja.height+=ya.verticalOffset,null!=ya.rotationShape&&null!=ya.rotationShape.node&&"hidden"!=ya.rotationShape.node.style.visibility&&"none"!=ya.rotationShape.node.style.display&&null!=ya.rotationShape.boundingBox&&ja.add(ya.rotationShape.boundingBox)),Z.style.left=Math.floor(Va.getCenterX()-this.triangleUp.width/2)+"px",Z.style.top=Math.floor(ja.y-this.triangleUp.height)+"px",da.style.left=Math.floor(ja.x+ja.width)+"px",da.style.top=Math.floor(Va.getCenterY()-this.triangleRight.height/ 2)+"px",pa.style.left=Z.style.left,pa.style.top=Math.floor(ja.y+ja.height)+"px",ka.style.left=Math.floor(ja.x-this.triangleLeft.width)+"px",ka.style.top=da.style.top,"eastwest"!=Va.style.portConstraint&&(ta.container.appendChild(Z),ta.container.appendChild(pa)),ta.container.appendChild(da),ta.container.appendChild(ka));null!=Va&&(V=ta.selectionCellsHandler.getHandler(Va.cell),null!=V&&null!=V.setHandlesVisible&&V.setHandlesVisible(!1));na=!0}else for(Xa=[Y,N,Z,da,pa,ka],ja=0;ja<Xa.length;ja++)null!= Xa[ja].parentNode&&Xa[ja].parentNode.removeChild(Xa[ja]);na||null==V||V.setHandlesVisible(!0);Za=mxEvent.isAltDown(ab)&&!mxEvent.isShiftDown(ab)||null!=Q&&ea==S?null:mxDragSource.prototype.getDropTarget.apply(this,arguments);null==Za||null==ea&&ta.isSplitTarget(Za,e,ab)||(Za=ta.getDropTarget(e,ab,Za,!0));return Za});var Sa=J.startDrag;J.startDrag=function(ta){z.activeDragSource=this;Sa.apply(this,arguments)};var Ua=J.stopDrag;J.stopDrag=function(){Ua.apply(this,arguments);for(var ta=[Y,N,S,Z,da,pa, ka],Fa=0;Fa<ta.length;Fa++)null!=ta[Fa].parentNode&&ta[Fa].parentNode.removeChild(ta[Fa]);null!=M&&null!=V&&V.reset();ma=Q=M=V=z.activeDragSource=null;ia=!1;ea=U=null};return J}; Sidebar.prototype.itemClicked=function(a,b,d,e){var g=this.editorUi.editor.graph;g.container.focus();if(mxEvent.isAltDown(d)&&1==g.getSelectionCount()){e=b=null;for(var c=0;c<a.length&&(null==e&&g.model.isVertex(a[c])?e=c:null==b&&g.model.isEdge(a[c])&&null==g.model.getTerminal(a[c],!0)&&(b=c),null==e||null==b);c++);c=null==b?e:b;g.setSelectionCells(this.dropAndConnect(g.getSelectionCell(),a,mxEvent.isMetaDown(d)||mxEvent.isControlDown(d)?mxEvent.isShiftDown(d)?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH: mxEvent.isShiftDown(d)?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_SOUTH,c,d,e,b));g.scrollCellToVisible(g.getSelectionCell())}else if(mxEvent.isShiftDown(d)&&!g.isSelectionEmpty())d=g.getEditableCells(g.getSelectionCells()),g.updateShapes(a[0],d,!0),g.scrollCellToVisible(d);else{a=mxEvent.isAltDown(d)?g.getFreeInsertPoint():g.getCenterInsertPoint(g.getBoundingBoxFromGeometry(a,!0));b.drop(g,d,null,a.x,a.y,!0);var h=g.getSelectionCells();Editor.insertAnimations&&1==h.length&&g.model.isVertex(h[0])&& (g.clearSelection(),a=g.createPopAnimations(h,!0),g.executeAnimations(a,function(){g.setSelectionCells(h)},20,10))}}; Sidebar.prototype.addClickHandler=function(a,b,d,e){var g=b.getGraphForEvent,c=b.mouseDown,h=b.mouseMove,k=b.mouseUp,p=this.editorUi.editor.graph.tolerance,l=!1,u=null,x=this,v=null;b.getGraphForEvent=function(z){return l?g.apply(this,arguments):null};b.mouseDown=function(z){c.apply(this,arguments);u=new mxPoint(mxEvent.getClientX(z),mxEvent.getClientY(z));v=a.style.opacity;l=!1;""==v&&(v="1");null!=this.dragElement&&(this.dragElement.style.display="none")};b.mouseMove=function(z){(l=null!=u&&(Math.abs(u.x- mxEvent.getClientX(z))>p||Math.abs(u.y-mxEvent.getClientY(z))>p))&&null!=this.dragElement&&"none"==this.dragElement.style.display&&(this.dragElement.style.display="");h.apply(this,arguments)};b.mouseUp=function(z){try{mxEvent.isPopupTrigger(z)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||(null!=e&&e(z),mxEvent.isConsumed(z)||x.itemClicked(d,b,z,a)),k.apply(b,arguments),u=null,x.currentElt=a}catch(C){b.reset(),x.editorUi.handleError(C)}}}; Sidebar.prototype.createVertexTemplateEntry=function(a,b,d,e,g,c,h,k){null!=k&&null!=g&&(k+=" "+g);k=null!=k&&0<k.length?k:null!=g?g.toLowerCase():"";return this.addEntry(k,mxUtils.bind(this,function(){return this.createVertexTemplate(a,b,d,e,g,c,h)}))};Sidebar.prototype.createVertexTemplate=function(a,b,d,e,g,c,h,k,p,l,u,x,v,z){a=[new mxCell(null!=e?e:"",new mxGeometry(0,0,b,d),a)];a[0].vertex=!0;return this.createVertexTemplateFromCells(a,b,d,g,c,h,k,p,l,u,x,v,z)}; Sidebar.prototype.createVertexTemplateFromData=function(a,b,d,e,g,c,h,k){var p=null;try{var l=mxUtils.parseXml(Graph.decompress(a)),u=new mxCodec(l),x=new mxGraphModel;u.decode(l.documentElement,x);p=this.graph.cloneCells(x.root.getChildAt(0).children)}catch(v){e=mxResources.get("error")+": "+v.message}return this.createVertexTemplateFromCells(p,b,d,e,g,c,h,k)}; Sidebar.prototype.createVertexTemplateFromCells=function(a,b,d,e,g,c,h,k,p,l,u,x,v,z,C){return this.createItem(a,e,g,c,b,d,h,k,p,l,u,x,v,z,void 0,C)};Sidebar.prototype.createEdgeTemplateEntry=function(a,b,d,e,g,c,h,k,p){h=null!=h&&0<h.length?h:g.toLowerCase();return this.addEntry(h,mxUtils.bind(this,function(){return this.createEdgeTemplate(a,b,d,e,g,c,k,p)}))}; Sidebar.prototype.createEdgeTemplate=function(a,b,d,e,g,c,h,k){a=new mxCell(null!=e?e:"",new mxGeometry(0,0,b,d),a);a.geometry.setTerminalPoint(new mxPoint(0,d),!0);a.geometry.setTerminalPoint(new mxPoint(b,0),!1);a.geometry.relative=!0;a.edge=!0;return this.createEdgeTemplateFromCells([a],b,d,g,c,h,k)};Sidebar.prototype.createEdgeTemplateFromCells=function(a,b,d,e,g,c,h,k,p,l,u,x){return this.createItem(a,e,g,null!=k?k:!0,b,d,c,h,p,l,u,x)}; Sidebar.prototype.addPaletteFunctions=function(a,b,d,e){a=this.addPalette(a,b,d,mxUtils.bind(this,function(g){for(var c=0;c<e.length;c++){var h=e[c](g);null!=h&&g.appendChild(h)}}));this.setDeferredPaletteSize(a,e.length);return a}; Sidebar.prototype.addPalette=function(a,b,d,e,g){b=this.createTitle(b);this.appendChild(b);var c=document.createElement("div");c.className="geSidebar";mxClient.IS_POINTER&&(c.style.touchAction="none");d&&this.expandLibraries?(this.virtualPalettes&&!g?this.deferPaletteInit(c,b,e):e(c,b),e=null):c.style.display="none";this.addFoldingHandler(b,c,e);d=document.createElement("div");d.appendChild(c);this.appendChild(d);null!=a&&(this.palettes[a]=[b,d]);return c}; Sidebar.prototype.addFoldingHandler=function(a,b,d){var e=!1;a.style.backgroundImage="none"==b.style.display?"url('"+Editor.arrowRightImage+"')":"url('"+Editor.arrowDownImage+"')";mxEvent.addListener(a,"click",mxUtils.bind(this,function(g){if(!this._paletteDragging&&a.contains(mxEvent.getSource(g))){if("none"==b.style.display){if(e)this.setContentVisible(b,!0);else if(e=!0,null!=d&&this.virtualPalettes)this.deferPaletteInit(b,a,d),this.setContentVisible(b,!0);else if(null!=d){a.style.cursor="wait"; for(var c=[],h=0;h<a.children.length;h++)c.push(a.children[h]);a.innerHTML=mxResources.get("loading")+"...";window.setTimeout(mxUtils.bind(this,function(){this.setContentVisible(b,!0);a.style.cursor="";a.innerHTML="";for(var k=0;k<c.length;k++)a.appendChild(c[k]);k=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;d(b,a);mxClient.NO_FO=k}),mxClient.IS_FF?20:0)}else this.setContentVisible(b,!0);a.style.backgroundImage="url('"+Editor.arrowDownImage+"')"}else a.style.backgroundImage= "url('"+Editor.arrowRightImage+"')",this.setContentVisible(b,!1);mxEvent.consume(g)}}));mxEvent.preventDefault(a)}; Sidebar.prototype.setContentVisible=function(a,b){var d=Editor.transitionDelay;mxUtils.setPrefixedStyle(a.style,"transition","all "+d+"s linear");b?(mxUtils.setPrefixedStyle(a.style,"transform","scaleY(0)"),a.style.display="block",window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform","scaleY(1)");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform",null);mxUtils.setPrefixedStyle(a.style,"transition",null)}),1E3*d)}),0)): (mxUtils.setPrefixedStyle(a.style,"transform","scaleY(0)"),window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(a.style,"transform",null);mxUtils.setPrefixedStyle(a.style,"transition",null);a.style.display="none"}),1E3*d))};Sidebar.prototype.removePalette=function(a){var b=this.palettes[a];if(null!=b){this.palettes[a]=null;for(a=0;a<b.length;a++)this.unobserveElements(b[a]),this.container.removeChild(b[a]);return!0}return!1}; Sidebar.prototype.addImagePalette=function(a,b,d,e,g,c,h){for(var k=[],p=0;p<g.length;p++)mxUtils.bind(this,function(l,u,x){if(null==x&&(null==d||"img/lib/clip_art/"!=d.substring(0,17))){x=l.lastIndexOf("/");var v=l.lastIndexOf(".");x=l.substring(0<=x?x+1:0,0<=v?v:l.length).replace(/[-_]/g," ")}k.push(this.createVertexTemplateEntry("image;html=1;image="+d+l+e,this.defaultImageWidth,this.defaultImageHeight,"",u,null!=u,null,this.filterTags(x)))})(g[p],null!=c?c[p]:null,null!=h?h[g[p]]:null);this.addPaletteFunctions(a, b,!1,k)};Sidebar.prototype.getTagsForStencil=function(a,b,d){a=a.split(".");for(var e=1;e<a.length;e++)a[e]=a[e].replace(/_/g," ");a.push(b.replace(/_/g," "));null!=d&&a.push(d);return a.slice(1,a.length)}; Sidebar.prototype.addStencilPalette=function(a,b,d,e,g,c,h,k,p,l){h=null!=h?h:1;if(this.addStencilsToIndex){var u=[];if(null!=p)for(l=0;l<p.length;l++)u.push(p[l]);mxStencilRegistry.loadStencilSet(d,mxUtils.bind(this,function(x,v,z,C,F){if(null==g||0>mxUtils.indexOf(g,v)){z=this.getTagsForStencil(x,v);var G=null!=k?k[v]:null;null!=G&&z.push(G);u.push(this.createVertexTemplateEntry("shape="+x+v.toLowerCase()+e,Math.round(C*h),Math.round(F*h),"",v.replace(/_/g," "),null,null,this.filterTags(z.join(" "))))}}), !0,!0);this.addPaletteFunctions(a,b,!1,u)}else this.addPalette(a,b,!1,mxUtils.bind(this,function(x){null==e&&(e="");null!=c&&c.call(this,x);if(null!=p)for(var v=0;v<p.length;v++)p[v](x);mxStencilRegistry.loadStencilSet(d,mxUtils.bind(this,function(z,C,F,G,H){(null==g||0>mxUtils.indexOf(g,C))&&x.appendChild(this.createVertexTemplate("shape="+z+C.toLowerCase()+e,Math.round(G*h),Math.round(H*h),"",C.replace(/_/g," "),!0))}),!0)}))}; Sidebar.prototype.destroy=function(){null!=this.graph&&(null!=this.graph.container&&null!=this.graph.container.parentNode&&this.graph.container.parentNode.removeChild(this.graph.container),this.graph.destroy(),this.graph=null);null!=this.escapeListener&&(this.editorUi.editor.graph.removeListener(this.escapeListener),this.escapeListener=null);null!=this.refreshListener&&(this.editorUi.removeListener(this.refreshListener),this.refreshListener=null);null!=this.pointerUpHandler&&(mxEvent.removeListener(document, mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerUpHandler=null);null!=this.pointerDownHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerDownHandler=null);null!=this.pointerMoveHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerMoveHandler=null);null!=this.pointerOutHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER? "pointerout":"mouseout",this.pointerOutHandler),this.pointerOutHandler=null)};(function(){var a=mxUtils.getSizeForString;mxUtils.getSizeForString=function(b,d,e,g){return a(Graph.sanitizeHtml(b),d,e,g)}})();Date.prototype.toISOString||function(){function a(b){b=String(b);1===b.length&&(b="0"+b);return b}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(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 a=Object.prototype.toString,b=function(e){return"function"===typeof e||"[object Function]"===a.call(e)},d=Math.pow(2,53)-1;return function(e){var g=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var c=1<arguments.length?arguments[1]:void 0,h;if("undefined"!==typeof c){if(!b(c))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(h= arguments[2])}var k=Number(g.length);k=isNaN(k)?0:0!==k&&isFinite(k)?(0<k?1:-1)*Math.floor(Math.abs(k)):k;k=Math.min(Math.max(k,0),d);for(var p=b(this)?Object(new this(k)):Array(k),l=0,u;l<k;)u=g[l],p[l]=c?"undefined"===typeof h?c(u,l):c.call(h,u,l):u,l+=1;p.length=k;return p}}());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 a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();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="#e6e6e6";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(a){this.unit!=a&&(this.unit=a,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",a)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]"; mxShape.prototype.getConstraints=function(a,b,d){return null}; mxImageShape.prototype.getImageDataUri=function(a){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style){if("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}if(null==a||null==a.createImageSymbol){if(a=Graph.getCssVariables(this.style),null!=a){if(null==this.themedSvg||this.themedImage!=b||this.themedVars!=a)this.themedSvg=Graph.setSvgDataUriCssVars(b, a),this.themedImage=b,this.themedVars=a;b=this.themedSvg}}else if(a=mxUtils.getValue(this.style,"editableCssRules",null),null!=a){if(void 0===this.canonicalSvg||this.canonicalImage!=b||this.canonicalRules!=a)this.canonicalSvg=Graph.canonicalizeSvgCssRules(b,a),this.canonicalImage=b,this.canonicalRules=a;null!=this.canonicalSvg&&(b=this.canonicalSvg.uri)}}return b}; mxImageShape.prototype.getImageCssVars=function(a){var b=String(this.image),d=null;null!=this.style&&("data:"!=b.substring(0,5)?Graph.isSameOrigin(b)&&(d=Graph.getCssVariables(this.style)):null!=a&&null!=a.createImageSymbol&&"data:image/svg+xml;base64,"==b.substring(0,26)&&(a=[],null!=this.canonicalSvg&&this.canonicalRules==mxUtils.getValue(this.style,"editableCssRules",null)&&a.push(this.canonicalSvg.vars),null!=mxUtils.getValue(this.style,"cssVars",null)&&(b=Graph.getCssVariables(this.style),null!= b?a.push(b):0==a.length&&(d="")),0<a.length&&(d=a.join("; "))));return d};(function(){var a=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(b,d,e,g,c){return"default"==g&&null!=c?"fillcolor"==e.nodeName?c.shapeBackgroundColor:c.shapeForegroundColor:a.apply(this,arguments)}})();(function(){var a=mxResources.get;mxResources.get=function(b,d,e){null==e&&(e=b);return a.apply(this,[b,d,e])}})(); (function(){var a=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(b,d,e,g,c,h,k,p){var l=a.apply(this,arguments);if(null!=d){var u=l.getElementsByTagName("img");0<u.length&&(u[0].className="geButton")}return l}})(); Graph=function(a,b,d,e,g,c){mxGraph.call(this,a,b,d,e);this.themes=g||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=c?c:!1;a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(S){S=this.getCurrentCellStyle(S); return null!=S?"1"==S.html||"wrap"==S[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var h=null,k=null,p=null,l=null,u=!1,x=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,U){if("mouseDown"==U.getProperty("eventName")&&this.isEnabled()){S=U.getProperty("event");var Y=S.getState();U=this.view.scale;if(!mxEvent.isAltDown(S.getEvent())&&null!=Y&&(x=this.isCellSelected(Y.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(S.getEvent()))){var N=this.selectionCellsHandler.getHandler(Y.cell); if(null==N||null==N.getHandleForEvent(S)){var R=new mxRectangle(S.getGraphX()-1,S.getGraphY()-1),ea=mxEvent.isTouchEvent(S.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;N=ea+2;R.grow(ea);if(this.isTableCell(Y.cell)&&this.isCellMovable(Y.cell)&&!this.isCellSelected(Y.cell)&&!(mxUtils.contains(Y,S.getGraphX()-N,S.getGraphY()-N)&&mxUtils.contains(Y,S.getGraphX()-N,S.getGraphY()+N)&&mxUtils.contains(Y,S.getGraphX()+N,S.getGraphY()+N)&&mxUtils.contains(Y, S.getGraphX()+N,S.getGraphY()-N))){var ba=this.model.getParent(Y.cell);N=this.model.getParent(ba);if(!this.isCellSelected(N)){ea*=U;var la=2*ea;if(this.model.getChildAt(N,0)!=ba&&mxUtils.intersects(R,new mxRectangle(Y.x,Y.y-ea,Y.width,la))||this.model.getChildAt(ba,0)!=Y.cell&&mxUtils.intersects(R,new mxRectangle(Y.x-ea,Y.y,la,Y.height))||mxUtils.intersects(R,new mxRectangle(Y.x,Y.y+Y.height-ea,Y.width,la))||mxUtils.intersects(R,new mxRectangle(Y.x+Y.width-ea,Y.y,la,Y.height)))ba=this.selectionCellsHandler.isHandled(N), this.selectCellForEvent(N,S.getEvent()),N=this.selectionCellsHandler.getHandler(N),null!=N&&(ea=N.getHandleForEvent(S),null!=ea&&(N.start(S.getGraphX(),S.getGraphY(),ea),N.blockDelayedSelection=!ba,S.consume()))}}for(;!S.isConsumed()&&null!=Y&&(this.isTableCell(Y.cell)||this.isTableRow(Y.cell)||this.isTable(Y.cell));)this.isSwimlane(Y.cell)&&this.isCellMovable(Y.cell)&&(N=this.getActualStartSize(Y.cell),(0<N.x||0<N.width)&&mxUtils.intersects(R,new mxRectangle(Y.x+(N.x-N.width-1)*U+(0==N.x?Y.width: 0),Y.y,1,Y.height))||(0<N.y||0<N.height)&&mxUtils.intersects(R,new mxRectangle(Y.x,Y.y+(N.y-N.height-1)*U+(0==N.y?Y.height:0),Y.width,1)))&&(this.selectCellForEvent(Y.cell,S.getEvent()),N=this.selectionCellsHandler.getHandler(Y.cell),null!=N&&null!=N.customHandles&&(ea=mxEvent.CUSTOM_HANDLE-N.customHandles.length+1,N.start(S.getGraphX(),S.getGraphY(),ea),S.consume())),Y=this.view.getState(this.model.getParent(Y.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(S, U){if("mouseDown"==U.getProperty("eventName")&&this.isEnabled()){S=U.getProperty("event");var Y=S.getState();mxEvent.isAltDown(S.getEvent())||mxEvent.isControlDown(U)||mxEvent.isShiftDown(U)||x||null==Y||!this.model.isEdge(Y.cell)||(h=new mxPoint(S.getGraphX(),S.getGraphY()),u=this.isCellSelected(Y.cell),p=Y,k=S,null!=Y.text&&null!=Y.text.boundingBox&&mxUtils.contains(Y.text.boundingBox,S.getGraphX(),S.getGraphY())?l=mxEvent.LABEL_HANDLE:(U=this.selectionCellsHandler.getHandler(Y.cell),null!=U&&null!= U.bends&&0<U.bends.length&&(l=U.getHandleForEvent(S))))}}));this.addMouseListener({mouseDown:function(S,U){},mouseMove:mxUtils.bind(this,function(S,U){S=this.selectionCellsHandler.handlers.map;for(var Y in S)if(null!=S[Y].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(U.getEvent())){var N=this.tolerance;if(null!=h&&null!=p&&null!=k){if(Y=p,null!=l||Math.abs(h.x-U.getGraphX())>N||Math.abs(h.y-U.getGraphY())>N){var R=null;mxEvent.isShiftDown(U.getEvent())||(R= this.selectionCellsHandler.getHandler(Y.cell));if(null!=R&&null!=R.bends&&0<R.bends.length){R.redrawHandles();var ea=null!=l?l:R.getHandleForEvent(k),ba=this.view.getEdgeStyle(Y),la=ba==mxEdgeStyle.EntityRelation;N=Y.absolutePoints;u||(ea=l);ea!=mxEvent.LABEL_HANDLE&&null!=N&&(ea=l,null==ea&&(S=new mxRectangle(h.x,h.y),S.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(S,N[0].x,N[0].y)?ea=0:mxUtils.contains(S,N[N.length-1].x,N[N.length-1].y)?ea=R.bends.length-1:null!=N&&(null==ba&& null==ea||ba==mxEdgeStyle.SegmentConnector||ba==mxEdgeStyle.OrthConnector)&&(null!=ba&&(2==N.length||3==N.length&&(0==Math.round(N[0].x-N[1].x)&&0==Math.round(N[1].x-N[2].x)||0==Math.round(N[0].y-N[1].y)&&0==Math.round(N[1].y-N[2].y)))?ea=2:(ea=mxUtils.findNearestSegment(Y,h.x,h.y),ea=null==ba?mxEvent.VIRTUAL_HANDLE-ea:ea+1))),null==ea&&(ea=mxEvent.VIRTUAL_HANDLE));S=ea==mxEvent.LABEL_HANDLE||0==ea||ea==R.bends.length-1;if(!la&&(null!=Y.visibleSourceState||null!=Y.visibleTargetState)||S)R.start(U.getGraphX(), U.getGraphX(),ea),U.consume(),this.graphHandler.reset()}null!=R&&(this.selectionCellsHandler.isHandlerActive(R)?this.isCellSelected(Y.cell)||(this.selectionCellsHandler.handlers.put(Y.cell,R),this.selectCellForEvent(Y.cell,U.getEvent())):this.isCellSelected(Y.cell)||R.destroy());u=!1;h=k=p=l=null}}else if(Y=U.getState(),null!=Y&&this.isCellEditable(Y.cell)){S=this.model.getParent(Y.cell);R=null;if(this.model.isEdge(Y.cell)&&!this.isCellSelected(Y.cell)&&!mxEvent.isAltDown(U.getEvent())&&!mxEvent.isShiftDown(U.getEvent())&& !this.isAncestorSelected(Y.cell)&&(this.isSwimlane(S)||this.model.isLayer(S)||this.getCurrentRoot()==S)){if(S=new mxRectangle(U.getGraphX(),U.getGraphY()),S.grow(mxEdgeHandler.prototype.handleImage.width/2),N=Y.absolutePoints,null!=N)null!=Y.text&&null!=Y.text.boundingBox&&mxUtils.contains(Y.text.boundingBox,U.getGraphX(),U.getGraphY())?R="move":mxUtils.contains(S,N[0].x,N[0].y)||mxUtils.contains(S,N[N.length-1].x,N[N.length-1].y)?R="pointer":(ba=this.view.getEdgeStyle(Y),ba==mxEdgeStyle.EntityRelation|| null==Y.visibleSourceState&&null==Y.visibleTargetState||(R="crosshair",ba!=mxEdgeStyle.SegmentConnector&&ba!=mxEdgeStyle.OrthConnector))||(U=mxUtils.findNearestSegment(Y,U.getGraphX(),U.getGraphY()),U<N.length-1&&0<=U&&(R=0==Math.round(N[U].x-N[U+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(U.getEvent())){N=mxShape.prototype.svgStrokeTolerance/2;S=new mxRectangle(U.getGraphX(),U.getGraphY());S.grow(N);if(this.isTableCell(Y.cell)&&this.isCellMovable(Y.cell)&&(U=this.model.getParent(Y.cell), N=this.model.getParent(U),!this.isCellSelected(N)))if(mxUtils.intersects(S,new mxRectangle(Y.x,Y.y-2,Y.width,4))&&this.model.getChildAt(N,0)!=U||mxUtils.intersects(S,new mxRectangle(Y.x,Y.y+Y.height-2,Y.width,4)))R="row-resize";else if(mxUtils.intersects(S,new mxRectangle(Y.x-2,Y.y,4,Y.height))&&this.model.getChildAt(U,0)!=Y.cell||mxUtils.intersects(S,new mxRectangle(Y.x+Y.width-2,Y.y,4,Y.height)))R="col-resize";for(U=Y;null==R&&null!=U&&(this.isTableCell(U.cell)||this.isTableRow(U.cell)||this.isTable(U.cell));)this.isSwimlane(U.cell)&& this.isCellMovable(U.cell)&&(N=this.getActualStartSize(U.cell),ea=this.view.scale,(0<N.x||0<N.width)&&mxUtils.intersects(S,new mxRectangle(U.x+(N.x-N.width-1)*ea+(0==N.x?U.width*ea:0),U.y,1,U.height))?R="col-resize":(0<N.y||0<N.height)&&mxUtils.intersects(S,new mxRectangle(U.x,U.y+(N.y-N.height-1)*ea+(0==N.y?U.height:0),U.width,1))&&(R="row-resize")),U=this.view.getState(this.model.getParent(U.cell))}null!=R&&Y.setCursor(R)}}}),mouseUp:mxUtils.bind(this,function(S,U){l=h=k=p=null})})}this.cellRenderer.minSvgStrokeWidth= .1;var v=document.createElement("div");this.cellRenderer.getLabelValue=function(S){var U=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);S.view.graph.isHtmlLabel(S.cell)&&("0"==mxUtils.getValue(S.style,"html","0")?U=mxUtils.htmlEntities(U,!1):(S.lastLabelValue!=U&&(S.lastLabelValue=U,S.lastSanitizedLabelValue=Graph.sanitizeHtml(U),v.innerHTML=S.lastSanitizedLabelValue,Graph.addLightDarkColors(v,null,"simple"==S.view.graph.getAdaptiveColors())&&(S.lastSanitizedLabelValue=v.innerHTML)), U=S.lastSanitizedLabelValue));return U};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(S, U){return!1};this.alternateEdgeStyle="vertical";null==e&&this.loadStylesheet();var z=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var S=z.apply(this,arguments);if(this.graph.pageVisible){var U=this.graph.pageFormat,Y=this.graph.pageScale,N=U.width*Y;U=U.height*Y;Y=this.graph.view.translate;var R=this.graph.view.scale;if(Math.min(N,U)*R>this.graph.minPageBreakDist){var ea=this.graph.getPageLayout(),ba=this.graph.container,la=0,sa=ea.width,T=1,ua=ea.height;if(null!=ba){T= (ba.scrollLeft-ba.clientWidth)/R-Y.x;var va=(ba.scrollTop-ba.clientHeight)/R-Y.y;la=Math.max(0,Math.floor(T/N)-ea.x);sa=Math.min(sa,Math.ceil((T+3*ba.clientWidth/R)/N)-ea.x);T=Math.max(1,Math.floor(va/U)-ea.y);ua=Math.min(ua,Math.ceil((va+3*ba.clientHeight/R)/U)-ea.y)}for(ba=[];la<sa;la++)ba.push(new mxRectangle(((ea.x+la)*N+Y.x)*R,(ea.y*U+Y.y)*R,N*R,U*R));for(sa=T;sa<ua;sa++)ba.push(new mxRectangle((ea.x*N+Y.x)*R,((ea.y+sa)*U+Y.y)*R,N*R,U*R));S=ba.concat(S)}}return S};mxDragSource.prototype.dragElementZIndex= mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(S,U){return null==S.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(S){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var C=this.graphHandler.getCells;this.graphHandler.getCells=function(S){for(var U=C.apply(this,arguments),Y=new mxDictionary,N=[],R=0;R<U.length;R++){var ea= this.graph.isTableCell(S)&&this.graph.isTableCell(U[R])&&this.graph.isCellSelected(U[R])?this.graph.model.getParent(U[R]):this.graph.isTableRow(S)&&this.graph.isTableRow(U[R])&&this.graph.isCellSelected(U[R])?U[R]:this.graph.getCompositeParent(U[R]);null==ea||Y.get(ea)||(Y.put(ea,!0),N.push(ea))}return N};var F=this.graphHandler.start;this.graphHandler.start=function(S,U,Y,N){var R=!1;this.graph.isTableCell(S)&&(this.graph.isCellSelected(S)?R=!0:S=this.graph.model.getParent(S));R||this.graph.isTableRow(S)&& this.graph.isCellSelected(S)||(S=this.graph.getCompositeParent(S));F.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(S,U){U=this.graph.getCompositeParent(U);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(S,U,Y,N,R,ea){var ba=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=N&&this.graph.applyNewEdgeStyle(N,[ba]);return ba};var G=new mxRubberband(this);this.getRubberband=function(){return G}; var H=(new Date).getTime(),J=0,O=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var S=this.currentState;O.apply(this,arguments);S!=this.currentState?(H=(new Date).getTime(),J=0):J=(new Date).getTime()-H};var M=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(S){if(mxEvent.isShiftDown(S.getEvent())&&mxEvent.isAltDown(S.getEvent()))return!1;var U=null!=this.currentState?mxUtils.getValue(this.currentState.style,"outlineConnect", "1"):"1";return"3"==U?!1:null!=this.currentState&&S.getState()==this.currentState&&("2"==U||2E3<J)||(null==this.currentState||"0"!=U)&&M.apply(this,arguments)};var V=this.isToggleEvent;this.isToggleEvent=function(S){return V.apply(this,arguments)||mxEvent.isShiftDown(S)};var Q=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(Q=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=Q)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(S){return mxEvent.isMouseEvent(S.getEvent())};var ma=this.click;this.click=function(S){var U=null==S.state&&null!=S.sourceState&&this.isCellLocked(this.getLayerForCell(S.sourceState.cell));if(this.isEnabled()&&!U||S.isConsumed())return ma.apply(this,arguments);var Y=U?S.sourceState.cell:S.getCell();if(null!=Y){var N=this.getClickableLinkForCell(Y);null!= N?this.isCustomLink(N)?this.customLinkClicked(N,Y):this.openLink(N):U&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(S){return S.sourceState};var ia=this.tooltipHandler.show;this.tooltipHandler.show=function(){ia.apply(this,arguments);if(null!=this.div)for(var S=this.div.getElementsByTagName("a"),U=0;U<S.length;U++)null!=S[U].getAttribute("href")&&null==S[U].getAttribute("target")&&S[U].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(S){return S.sourceState}; this.getCursorForMouseEvent=function(S){var U=null==S.state&&null!=S.sourceState&&this.isCellLocked(S.sourceState.cell);return this.getCursorForCell(U?S.sourceState.cell:S.getCell())};var na=this.getCursorForCell;this.getCursorForCell=function(S){if(!this.isEnabled()||this.isCellLocked(S)){if(null!=this.getClickableLinkForCell(S))return"pointer";if(this.isCellLocked(S))return"default"}return na.apply(this,arguments)};this.selectRegion=function(S,U){var Y=Graph.intersectionSelect||mxEvent.isAltDown(U)? S:null;S=this.getCells(S.x,S.y,S.width,S.height,null,null,Y,null,!0);if(null!=S&&0<S.length){Y=new mxDictionary;for(var N=[],R=0;R<S.length;R++){var ea=this.getLockedGroupAncestor(this.model.getParent(S[R]));ea=null!=ea?ea:S[R];Y.get(ea)||(Y.put(ea,!0),N.push(ea))}S=N}if(this.isToggleEvent(U))for(R=0;R<S.length;R++)this.selectCellForEvent(S[R],U);else this.selectCellsForEvent(S,U);return S};var Z=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(S, U,Y){return this.graph.isCellSelected(S)||this.graph.isTransparentBounds(S)?!1:Z.apply(this,arguments)};var da=this.updateMouseEvent;this.updateMouseEvent=function(S){S=da.apply(this,arguments);null!=S.state&&this.isCellLocked(this.getLayerForCell(S.getCell()))&&(null==this.getLinkForCell(S.getCell())?S.state=this.view.getState(this.getCellAt(S.getGraphX(),S.getGraphY(),null,null,null,mxUtils.bind(this,function(U,Y,N){return S.state==U||this.isCellLocked(this.getLayerForCell(U.cell))&&null==this.getLinkForCell(U.cell)}))): S.state=null);return S};var pa=this.isCellSelectable;this.isCellSelectable=function(S){return null!=S&&null!=this.getLockedGroupAncestor(this.model.getParent(S))?!1:pa.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(S))};this.isCellLocked=function(S){for(;null!=S;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(S),"locked","0"))return!0;S=this.model.getParent(S)}return!1};var ka=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,U){"mouseDown"==U.getProperty("eventName")&& (S=U.getProperty("event").getState(),ka=null==S||this.isSelectionEmpty()||this.isCellSelected(S.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(S,U){if(!mxEvent.isMultiTouchEvent(U)){S=U.getProperty("event");var Y=U.getProperty("cell");null==Y?(S=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S)),G.start(S.x,S.y)):null!=ka?this.addSelectionCells(ka):1<this.getSelectionCount()&&this.isCellSelected(Y)&&this.removeSelectionCell(Y); ka=null;U.consume()}}));this.connectionHandler.selectCells=function(S,U){this.graph.setSelectionCell(U||S)};this.connectionHandler.constraintHandler.isStateIgnored=function(S,U){var Y=S.view.graph;return U&&(Y.isCellSelected(S.cell)||Y.isTableRow(S.cell)&&Y.selectionCellsHandler.isHandled(Y.model.getParent(S.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var S=this.connectionHandler.constraintHandler;null!=S.currentFocus&&S.isStateIgnored(S.currentFocus,!0)&& (S.currentFocus=null,S.constraints=null,S.destroyIcons());S.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch()}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.translateDiagram="1"==urlParams["translate-diagram"]; Graph.browserTranslate=mxClient.IS_GC&&"0"!=urlParams["browser-translate"];Graph.isBrowserTranslated=function(){try{var a=document;try{window.parent!=window&&null!=window.parent.document&&(a=window.parent.document)}catch(d){}var b=a.documentElement.className;return null!=b&&/\btranslated/.test(b)}catch(d){return!1}};Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1; Graph.selectParentLayer=!1;Graph.intersectionSelect=!1;Graph.minTableColumnWidth=20;Graph.minTableRowHeight=20;Graph.foreignObjectWarningText="Text is not SVG - cannot display";Graph.foreignObjectWarningLink="https://www.drawio.com/doc/faq/svg-export-text-problems";Graph.xmlDeclaration='<?xml version="1.0" encoding="UTF-8"?>';Graph.svgDoctype='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';Graph.svgFileComment="\x3c!-- Do not edit this file with editors other than draw.io --\x3e"; Graph.colorStyles=[mxConstants.STYLE_FONTCOLOR,mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_IMAGE_BORDER,mxConstants.STYLE_IMAGE_BACKGROUND,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR];Graph.textStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity labelBorderColor labelBackgroundColor autosize resizable horizontal textDirection autosizeText".split(" "); Graph.pasteTextStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing labelBorderColor labelBackgroundColor horizontal textDirection".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin libavoidRouting".split(" "); Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]]; Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles), Graph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout elkLayered elkTree elkRadial elkOrganic elkStress elkDisco elkBox".split(" ");Graph.elkLayoutAlgorithms={elkLayered:"layered",elkTree:"mrtree",elkRadial:"radial",elkOrganic:"force",elkStress:"stress",elkDisco:"disco",elkBox:"box"}; Graph.elkLayoutNameForAlgorithm=function(a){for(var b in Graph.elkLayoutAlgorithms)if(Graph.elkLayoutAlgorithms[b]===a)return b;return null};Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors="0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors}; Graph.createOffscreenGraph=function(a){var b=new Graph(document.createElement("div"));b.stylesheet.styles=mxUtils.clone(a.styles);b.resetViewOnRootChange=!1;b.setConnectable(!1);b.gridEnabled=!1;b.autoScroll=!1;b.setTooltips(!1);b.setEnabled(!1);b.container.style.visibility="hidden";b.container.style.position="absolute";b.container.style.overflow="hidden";b.container.style.height="1px";b.container.style.width="1px";return b}; Graph.createSvgImage=function(a,b,d,e,g){d=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" '+(null!=e&&null!=g?'viewBox="0 0 '+e+" "+g+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+d+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0)),a,b)}; Graph.getSvgFromDataUri=function(a){return null!=a&&"data:image/svg"==a.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(a.substring(a.indexOf(",")+1)))):null};Graph.svgBackgroundVar="--ge-adaptive-bg"; Graph.createSvgNode=function(a,b,d,e,g){var c=mxUtils.createXmlDocument(),h=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"svg"):c.createElement("svg");null!=g&&h.setAttribute("style","background: "+g.light+"; background-color: "+g.cssText+";");null==c.createElementNS?(h.setAttribute("xmlns",mxConstants.NS_SVG),h.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);h.setAttribute("version","1.1");h.setAttribute("width", d+"px");h.setAttribute("height",e+"px");h.setAttribute("viewBox",a+" "+b+" "+d+" "+e);c.appendChild(h);return h}; Graph.addAdaptiveColors=function(a,b){if(mxUtils.lightDarkColorSupported&&(b=mxUtils.getLightDarkColor(b),!(0>b.cssText.indexOf("var(")))){for(var d="var("+Graph.svgBackgroundVar+", "+b.light+")",e=a.getElementsByTagName("*"),g=[a],c=!1,h=0;h<e.length;h++)g.push(e[h]);for(h=0;h<g.length;h++)e=g[h].getAttribute("style"),null!=e&&0<=e.indexOf(b.cssText)&&(g[h].setAttribute("style",e.split(b.cssText).join(d)),c=!0);if(c){d=a.ownerDocument;g=a.getAttribute("id");if(null==g||""==g)g="ge-svg-"+Editor.guid(), a.setAttribute("id",g);c=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");c.setAttribute("type","text/css");c.appendChild(d.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+g+" { "+Graph.svgBackgroundVar+": "+b.cssText+"; } }"));a.insertBefore(c,a.firstChild)}}}; Graph.htmlToPng=function(a,b,d,e,g,c){g=null!=g?g:"";c=null!=c?c:Editor.htmlRasterScale;var h=document.createElement("canvas");h.width=b*c;h.height=d*c;var k=document.createElement("img");k.onload=mxUtils.bind(this,function(){try{var l=h.getContext("2d");l.scale(c,c);l.drawImage(k,0,0);e(h.toDataURL())}catch(u){e(null)}});var p=mxUtils.createXmlDocument();p=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");a=(new mxSvgCanvas2D(p)).convertHtml(a);k.onerror= function(l){e(null)};k.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+b+'" height="'+d+'">'+(""!=g?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+g+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div></foreignObject></svg>")}; Graph.addLightDarkColors=function(a,b,d,e){function g(v,z,C){return null!=e?e(v,z,C):mxUtils.isValidColor(C)?(null==h&&null!=b&&(h={}),null!=h&&(h[z]=v.style.getPropertyValue(z)),C=mxUtils.getLightDarkColor(C,null,null,d),v.style.setProperty(z,C.cssText),!0):!1}for(var c=a.getElementsByTagName("*"),h=null,k=!1,p=0;p<c.length;p++)if(c[p]!=a&&null!=c[p].style){h=null;for(var l=0;l<c[p].style.length;l++){var u=c[p].style.item(l),x=c[p].style.getPropertyValue(u);k=g(c[p],u,x)||k}"FONT"==c[p].nodeName&& ""==c[p].style.getPropertyValue("color")&&(x=c[p].getAttribute("color"),k=g(c[p],"color",x)||k);null!=b&&null!=h&&c[p].setAttribute(b,JSON.stringify(h))}return k};Graph.removeLightDarkColors=function(a,b){a=a.getElementsByTagName("*");for(var d=!1,e=0;e<a.length;e++)try{var g=a[e].getAttribute(b);if(null!=g){a[e].removeAttribute(b);var c=JSON.parse(g),h;for(h in c){var k=c[h];""==k?(a[e].style[h]=null,""==a[e].getAttribute("style")&&a[e].removeAttribute("style")):a[e].style[h]=k;d=!0}}}catch(p){}return d}; Graph.getGivenColor=function(a,b){var d=null;if(a.nodeType==mxConstants.NODETYPE_ELEMENT){try{var e=a.getAttribute(Graph.backupStyleAttribute);if(null!=e){var g=JSON.parse(e);null!=g&&null!=g[b]&&("color"==b&&"FONT"==a.nodeName&&""==g[b]&&null!=a.getAttribute("color")?d=a.getAttribute("color"):""!=g[b]&&(d=g[b]))}}catch(c){}null==d&&""!=a.style[b]&&(d=a.style[b])}return d}; Graph.setTextColor=function(a,b,d){for(var e=d?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,g=d?"color":"background-color",c=a.getElementsByTagName("*"),h=[],k=0;k<c.length;k++)h.push({node:c[k],value:c[k].style[g]});k=document.queryCommandState("styleWithCSS");d&&!k&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(d?"forecolor":"backcolor",!1,e);d&&!k&&document.execCommand("styleWithCSS",!1,!1);a=a.getElementsByTagName("*");for(k=0;k<a.length;k++){if(k<h.length&&h[k].node== a[k]&&h[k].value!=a[k].style[g]&&""==a[k].style[g])try{if(c=a[k].getAttribute(Graph.backupStyleAttribute),null!=c){var p=JSON.parse(c);p[g]="";a[k].setAttribute(Graph.backupStyleAttribute,JSON.stringify(p))}}catch(l){}if(d&&a[k].getAttribute("color")==e||a[k].style[g]==e){d&&a[k].getAttribute("color")==e&&a[k].removeAttribute("color");a[k].style[g]=b!=mxConstants.NONE?mxUtils.getLightDarkColor(b).cssText:null;try{c=a[k].getAttribute(Graph.backupStyleAttribute),p=null!=c?JSON.parse(c):{},p[g]=b!=mxConstants.NONE? b:"",a[k].setAttribute(Graph.backupStyleAttribute,JSON.stringify(p))}catch(l){}if(d&&mxClient.IS_FF){b=a[k];d=b.firstChild;if(null!=d&&"A"==d.nodeName&&null==d.nextSibling&&null!=d.firstChild){b.parentNode.insertBefore(d,b);for(e=d.firstChild;null!=e;)g=e.nextSibling,b.appendChild(e),e=g;d.appendChild(b)}break}}}};Graph.zapGremlins=function(a){return mxUtils.zapGremlins(a)};Graph.stringToBytes=function(a){for(var b=Array(a.length),d=0;d<a.length;d++)b[d]=a.charCodeAt(d);return b}; Graph.bytesToString=function(a){for(var b=Array(a.length),d=0;d<a.length;d++)b[d]=String.fromCharCode(a[d]);return b.join("")};Graph.base64EncodeUnicode=function(a){return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(b,d){return String.fromCharCode(parseInt(d,16))}))};Graph.base64DecodeUnicode=function(a){return decodeURIComponent(Array.prototype.map.call(atob(a),function(b){return"%"+("00"+b.charCodeAt(0).toString(16)).slice(-2)}).join(""))}; Graph.compressNode=function(a,b){a=mxUtils.getXml(a);return Graph.compress(b?a:Graph.zapGremlins(a))};Graph.arrayBufferToString=function(a){var b="";a=new Uint8Array(a);for(var d=a.byteLength,e=0;e<d;e++)b+=String.fromCharCode(a[e]);return b};Graph.stringToArrayBuffer=function(a){return Uint8Array.from(a,function(b){return b.charCodeAt(0)})}; Graph.arrayBufferIndexOfString=function(a,b,d){var e=b.charCodeAt(0),g=1,c=-1;for(d=d||0;d<a.byteLength;d++)if(a[d]==e){c=d;break}for(d=c+1;-1<c&&d<a.byteLength&&d<c+b.length-1;d++){if(a[d]!=b.charCodeAt(g))return Graph.arrayBufferIndexOfString(a,b,c+1);g++}return g==b.length-1?c:-1};Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=b?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a));return btoa(Graph.arrayBufferToString(new Uint8Array(a)))}; Graph.decompress=function(a,b,d){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=Graph.stringToArrayBuffer(atob(a));b=decodeURIComponent(b?pako.inflate(a,{to:"string"}):pako.inflateRaw(a,{to:"string"}));return d?b:Graph.zapGremlins(b)}; Graph.fadeNodes=function(a,b,d,e,g){g=null!=g?g:1E3;Graph.setTransitionForNodes(a,null);Graph.setOpacityForNodes(a,b);window.setTimeout(function(){Graph.setTransitionForNodes(a,"all "+g+"ms ease-in-out");Graph.setOpacityForNodes(a,d);window.setTimeout(function(){Graph.setTransitionForNodes(a,null);null!=e&&e()},g)},0)}; Graph.exploreFromCell=function(a,b,d){pageSize=null!=d&&null!=d.pageSize?d.pageSize:8;minSize=null!=d&&null!=d.minSize?d.minSize:180;(function(e,g){function c(x){x.view.states.visit(function(v,z){null!=z.shape&&x.model.isEdge(x.model.getParent(z.cell))?z.shape.node.parentNode.appendChild(z.shape.node):null!=z.text&&x.model.isEdge(z.cell)&&z.text.node.parentNode.appendChild(z.text.node)})}function h(x,v){if(x.getModel().isVertex(v)){var z=x.container.offsetWidth/2,C=x.container.offsetHeight/2;x.rootCell= v.referenceCell||v;x.getModel().beginUpdate();try{pageSize=null!=d&&null!=d.pageSize?d.pageSize:8+Math.max(0,Math.floor(Math.min(x.container.offsetWidth-800/120,x.container.offsetHeight-600)/30));for(var F=v.referenceCell||v,G=e.model.getCell(F.sourceCellId),H=e.getEdges(G,null,!0,!0,!1,!0),J=[],O=0;O<H.length;O++)null!=H[O].getTerminal(!0)&&null!=H[O].getTerminal(!1)&&e.isCellVisible(H[O])&&!e.isEdgeIgnored(H[O])&&e.isCellVisible(H[O].getTerminal(!0))&&e.isCellVisible(H[O].getTerminal(!1))&&e.isCellVisible(e.getLayerForCell(H[O]))&& J.push(H[O]);J=H=J;if(null!=v.startIndex||0<pageSize&&H.length>pageSize){var M=v.startIndex||0;J=H.slice(Math.max(0,M),Math.min(H.length,M+pageSize))}J=e.getOpposites(J,G).concat(J);var V=x.cloneCells(J);for(O=0;O<J.length;O++)if(V[O].sourceCellId=J[O].id,x.model.isEdge(V[O]))for(V[O].geometry.x=0,V[O].geometry.y=0,V[O].geometry.points=null,V[O].setStyle(V[O].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),V[O].setTerminal(F, null==V[O].getTerminal(!0)),G=0;G<V[O].getChildCount();G++){var Q=V[O].getChildAt(G);null!=Q.geometry&&Q.geometry.relative&&(Q.setStyle(Q.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),Q.geometry.offset=new mxPoint(0,0),Q.geometry.y=0,Q.geometry.x=.5>Q.geometry.x?-.8:.5<Q.geometry.x?.8:0)}if(0<v.startIndex){var ma=x.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((v.startIndex||0)/pageSize)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;"); ma.referenceCell=F;ma.startIndex=Math.max(0,(v.startIndex||0)-pageSize);V.splice(0,0,ma)}if(H.length>(v.startIndex||0)+pageSize){var ia=x.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((v.startIndex||0)/pageSize)+2)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ia.referenceCell=F;ia.startIndex=(v.startIndex||0)+pageSize;V.splice(0,0,ia)}for(var na in x.getModel().cells){var Z=x.getModel().getCell(na);Z!=x.rootCell&& !x.getModel().isAncestor(x.rootCell,Z)&&x.getModel().isVertex(Z)&&x.removeCells([Z])}x.addCells(V);var da=x.getModel().getGeometry(x.rootCell);null!=da&&(da=da.clone(),da.x=z-da.width/2,da.y=C-da.height/3,x.getModel().setGeometry(x.rootCell,da));v=[];for(na in x.getModel().cells)Z=x.getModel().getCell(na),Z!=x.rootCell&&x.getModel().isVertex(Z)&&x.getModel().getParent(Z)==x.getDefaultParent()&&(v.push(Z),da=x.getModel().getGeometry(Z),null!=da&&(da.x=z-da.width/2,da.y=C-da.height/2));var pa=v.length, ka=2*Math.PI/pa,S=Math.max(minSize,Math.min(x.container.offsetWidth/2-40,x.container.offsetHeight/2-80));for(z=0;z<pa;z++)da=x.getModel().getGeometry(v[z]),null!=da&&(da=da.clone(),da.x+=S*Math.sin(z*ka),da.y+=S*Math.cos(z*ka),x.getModel().setGeometry(v[z],da))}finally{x.getModel().endUpdate()}}}var k=document.createElement("div");k.style.position="absolute";k.style.display="block";k.style.overflow="auto";k.style.width="100%";k.style.height="100%";k.style.left="0px";k.style.top="0px";k.style.zIndex= 2;k.style.background=e.background==mxConstants.NONE||null==e.background?Editor.getDefaultPageBackgroundColor():e.background;var p=document.createElement("img");p.setAttribute("src",Editor.closeBlackImage);p.style.position="absolute";p.style.cursor="pointer";p.style.right="10px";p.style.top="10px";k.appendChild(p);var l=document.createElement("div");l.style.position="absolute";l.style.cursor="pointer";l.style.right="38px";l.style.top="14px";l.style.textAlign="right";l.style.verticalAlign="top";mxUtils.write(l, mxResources.get("close"));k.appendChild(l);document.body.appendChild(k);var u=function(x){27==x.keyCode&&p.click()};mxEvent.addListener(document,"keydown",u);(function(x){var v=new Graph(x);v.keepEdgesInBackground=!0;v.isCellResizable=function(){return!1};v.isCellRotatable=function(){return!1};v.getCursorForCell=function(J){return this.model.isVertex(J)?"pointer":null};v.getFoldingImage=function(){return null};var z=function(){mxEvent.removeListener(document,"keydown",u);x.parentNode.removeChild(x); e.scrollCellToVisible(g)};mxEvent.addListener(p,"click",z);mxEvent.addListener(l,"click",z);v.setEnabled(!1);var C=v.click;v.click=function(J){var O=J.getCell(),M=null!=O?null!=O.referenceCell?O.referenceCell:O:null;null!=O&&0<v.getEdges(M).length?h(v,O):C.apply(this,arguments)};z=v.container.offsetWidth/2;var F=v.container.offsetHeight/3;v.model.beginUpdate();var G=v.importCells([g])[0];G.sourceCellId=g.id;G.geometry.x=z-G.geometry.width/2;G.geometry.y=F-G.geometry.height/2;v.model.endUpdate();var H= !1;v.getModel().addListener(mxEvent.CHANGE,function(J,O){H||(J=O.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,v.labelsVisible=!1,H=!0,mxEffects.animateChanges(v,J,function(){var M=new mxParallelEdgeLayout(v);M.spacing=60;var V=M.layout;M.layout=function(Q){M.spacing=Math.min(60,Math.max(30,60-5*Q.length));V.apply(this,arguments)};M.execute(v.getDefaultParent());mxText.prototype.enableBoundingBox=!0;v.labelsVisible=!0;v.tooltipHandler.hide();v.refresh();c(v);H=!1}))});h(v,G)})(k)})(a, b)};Graph.removeKeys=function(a,b){for(var d in a)b(d)&&delete a[d]};Graph.setTransitionForNodes=function(a,b){for(var d=0;d<a.length;d++)mxUtils.setPrefixedStyle(a[d].style,"transition",b)};Graph.setOpacityForNodes=function(a,b){for(var d=0;d<a.length;d++)a[d].style.opacity=b}; Graph.removePasteFormatting=function(a,b){for(;null!=a;){null!=a.firstChild&&Graph.removePasteFormatting(a.firstChild,!0);var d=a.nextSibling;if(a.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=a.style){"#000000"==a.style.color&&(a.style.color="");if("SPAN"==a.nodeName&&"Apple-tab-span"==a.className){var e=Graph.createTabNode(4);a.parentNode.replaceChild(e,a);a=e}if("P"==a.nodeName&&"p1"==a.className){for(;null!=a.firstChild;)a.parentNode.insertBefore(a.firstChild,a);null!=d&&"P"==d.nodeName&&"p1"== d.className&&a.parentNode.insertBefore(a.ownerDocument.createElement("br"),a);a.parentNode.removeChild(a)}!b&&null!=a.innerHTML&&0<=a.innerHTML.indexOf("\t")&&(e=Graph.createTabNode(4),a.innerHTML=a.innerHTML.replace(/\t/g,e.outerHTML))}a=d}};Graph.createTabNode=function(a){var b="\t";if(null!=a)for(b="";0<a;)b+=" ",a--;a=document.createElement("span");a.style.whiteSpace="pre";a.appendChild(document.createTextNode(b));return a};Graph.sanitizeHtml=function(a,b){return Graph.domPurify(a,!1)}; Graph.installNoteBoxStyle=function(){if(!Graph.installNoteBoxStyle.done){Graph.installNoteBoxStyle.done=!0;var a=document.createElement("style");a.setAttribute("type","text/css");a.appendChild(document.createTextNode('.geNoteBox{position:fixed;z-index:10001;min-width:120px;max-width:360px;max-height:50vh;overflow:auto;box-sizing:border-box;padding:10px 14px;background:#ffffff;color:#1d1d1f;border:1px solid #d2d2d7;border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,0.2);font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;user-select:text;cursor:auto;white-space:pre-line}.geDarkMode .geNoteBox{background:#2a2a2a;color:#e5e5e7;border-color:#505050}.geNoteBox h1,.geNoteBox h2,.geNoteBox h3,.geNoteBox h4,.geNoteBox h5,.geNoteBox h6{margin:6px 0 4px 0;line-height:1.3}.geNoteBox h1{font-size:17px}.geNoteBox h2{font-size:15px}.geNoteBox h3,.geNoteBox h4,.geNoteBox h5,.geNoteBox h6{font-size:13px}.geNoteBox ul,.geNoteBox ol{margin:4px 0;padding-left:22px}.geNoteBox blockquote{margin:4px 0;padding:2px 10px;border-left:3px solid #d2d2d7;opacity:0.85}.geNoteBox pre{margin:4px 0;padding:6px 8px;border-radius:6px;background:rgba(127,127,127,0.15);overflow:auto}.geNoteBox code{font-family:monospace;font-size:12px}.geNoteBox hr{border:none;border-top:1px solid #d2d2d7;margin:6px 0}.geNoteBox a{color:#0071e3}.geDarkMode .geNoteBox a{color:#0a84ff}.geNoteBox .geNoteEditBtn{float:right;position:sticky;top:0;width:22px;height:22px;margin:-4px -9px 4px 10px;border-radius:5px;cursor:pointer;user-select:none;opacity:0.6}.geNoteBox .geNoteEditBtn:hover{opacity:1;background:rgba(127,127,127,0.15)}.geNoteBox .geNoteEditBtn img{display:block;width:16px;height:16px;margin:3px}.geDarkMode .geNoteBox .geNoteEditBtn img{filter:invert(1)}')); document.getElementsByTagName("head")[0].appendChild(a)}};Graph.stylesCompatible=function(a,b){var d=function(e){if(null==e)return"";e=e.split(";");for(var g=[],c=0;c<e.length;c++){var h=e[c].trim();if(0<h.length){var k=h.indexOf(":");if(0<k){var p=h.substring(0,k).trim().toLowerCase();h=h.substring(k+1).trim().toLowerCase();"initial"!=h&&"inherit"!=h&&"unset"!=h&&g.push(p+":"+h)}}}g.sort();return g.join(";")};return d(a)==d(b)}; Graph.optimizeHtml=function(a){if(null==a||0==a.length)return a;var b=document.createElement("div");b.innerHTML=a;Graph.optimizeNode(b);return b.innerHTML}; Graph.optimizeNode=function(a){if(null!=a){for(var b=a.firstChild;null!=b;){var d=b.nextSibling;1==b.nodeType&&Graph.optimizeNode(b);b=d}for(b=a.firstChild;null!=b;){d=b.nextSibling;if(!(1!=b.nodeType||"FONT"!=b.nodeName||b.hasAttribute("color")||b.hasAttribute("face")||b.hasAttribute("size")||b.hasAttribute("style"))){for(;null!=b.firstChild;)a.insertBefore(b.firstChild,b);a.removeChild(b)}b=d}for(b=a.firstChild;null!=b;)if(d=b.nextSibling,1==b.nodeType&&null!=d&&1==d.nodeType&&"SPAN"==b.nodeName&& "SPAN"==d.nodeName&&Graph.stylesCompatible(b.getAttribute("style"),d.getAttribute("style"))){for(;null!=d.firstChild;)b.appendChild(d.firstChild);d.parentNode.removeChild(d);b.normalize()}else b=d;for(b=a.firstChild;null!=b;){d=b.nextSibling;if(1==b.nodeType&&"SPAN"==b.nodeName){var e=b.getAttribute("style");if((null==e||0==e.trim().length)&&1>=b.attributes.length){for(;null!=b.firstChild;)a.insertBefore(b.firstChild,b);a.removeChild(b)}else if("SPAN"==a.nodeName&&Graph.stylesCompatible(e,a.getAttribute("style"))&& 1==b.attributes.length){for(;null!=b.firstChild;)a.insertBefore(b.firstChild,b);a.removeChild(b)}}b=d}a.normalize()}};Graph.sanitizeLink=function(a){if(null==a)return null;var b=document.createElement("a");b.setAttribute("href",a);Graph.sanitizeNode(b);return b.getAttribute("href")};Graph.sanitizeNode=function(a){return Graph.domPurify(a,!0)}; Graph.isStyleAllowed=function(a){a=a.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(g,c){return String.fromCharCode(parseInt(c,16))}).replace(/\\(.)/g,"$1");for(var b=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,d;null!==(d=b.exec(a));){var e=d[2].trim();d=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e);e=e.toLowerCase().startsWith("data:");if(!d&&!e)return!1}return/@import/i.test(a)?!1:!0}; DOMPurify.addHook("afterSanitizeAttributes",function(a){if("use"==a.nodeName&&(null!=a.getAttribute("xlink:href")&&!a.getAttribute("xlink:href").startsWith("#")||null!=a.getAttribute("href")&&!a.getAttribute("href").startsWith("#")))a.remove();else if("style"==a.nodeName.toLowerCase()){var b=Graph.zapGremlins(a.textContent);b==a.textContent&&Graph.isStyleAllowed(b)||a.remove()}}); DOMPurify.addHook("uponSanitizeAttribute",function(a,b){b.attrValue=Graph.zapGremlins(b.attrValue);"style"!=b.attrName||Graph.isStyleAllowed(b.attrValue)||(b.keepAttr=!1)});Graph.domPurify=function(a,b){window.DOM_PURIFY_CONFIG.IN_PLACE=b;return DOMPurify.sanitize(a,window.DOM_PURIFY_CONFIG)}; Graph.clipSvgDataUri=function(a){if(null!=a&&"data:image/svg+xml;base64,"==a.substring(0,26))try{var b=document.createElement("div");b.style.position="absolute";b.style.visibility="hidden";var d=decodeURIComponent(escape(atob(a.substring(26)))),e=d.indexOf("<svg");if(0<=e){b.innerHTML=Graph.sanitizeHtml(d.substring(e));var g=b.getElementsByTagName("svg");if(0<g.length){document.body.appendChild(b);try{e=d=1;var c=g[0].getAttribute("width"),h=g[0].getAttribute("height");c=null!=c&&"%"!=c.charAt(c.length- 1)?parseFloat(c):NaN;h=null!=h&&"%"!=h.charAt(h.length-1)?parseFloat(h):NaN;var k=g[0].getAttribute("viewBox");if(null!=k&&!isNaN(c)&&!isNaN(h)){var p=k.split(" ");4<=k.length&&(d=parseFloat(p[2])/c,e=parseFloat(p[3])/h)}var l=g[0].getBBox();if(0<l.width&&0<l.height){for(var u=0,x=g[0].querySelectorAll("[stroke-width]"),v=0;v<x.length;v++)u=Math.max(u,parseFloat(x[v].getAttribute("stroke-width")));var z=g[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(v=0;v<z.length;v++)try{var C= window.getComputedStyle(z[v]);C.stroke&&"none"!==C.stroke&&(u=Math.max(u,parseFloat(C.strokeWidth)||0))}catch(H){}var F=new mxRectangle(l.x,l.y,l.width,l.height);F.grow(u/2);if(null!=k&&(p=k.split(" "),4<=p.length)){var G=new mxRectangle(parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));F.add(G)}!isNaN(c)&&!isNaN(h)&&0>F.x&&0>F.y&&F.width>c&&F.height>h?b.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+c+" "+h):(b.getElementsByTagName("svg")[0].setAttribute("viewBox", F.x+" "+F.y+" "+F.width+" "+F.height),b.getElementsByTagName("svg")[0].setAttribute("width",F.width/d),b.getElementsByTagName("svg")[0].setAttribute("height",F.height/e))}}catch(H){}finally{document.body.removeChild(b)}a=Editor.createSvgDataUri(mxUtils.getXml(g[0]))}}}catch(H){}return a}; Graph.getCssVariables=function(a){var b=mxUtils.getValue(a,"cssVars",null),d=null;if(null!=b&&""!=b){b=String(b).split(",");for(var e=[],g=0;g<b.length;g++){var c=mxUtils.trim(b[g]);"--"==c.substring(0,2)&&(c=c.substring(2));var h=""!=c?mxUtils.getValue(a,"--"+c,null):null;null!=h&&""!=h&&e.push("--"+c+": "+h)}0<e.length&&(d=e.join("; "))}return d}; Graph.setSvgDataUriCssVars=function(a,b){b=Graph.zapGremlins(b);if(null!=a&&"data:image/svg+xml;base64,"==a.substring(0,26)&&Graph.isStyleAllowed(b))try{var d=decodeURIComponent(escape(atob(a.substring(26)))),e=d.indexOf("<svg");if(0<=e){var g=document.createElement("div");g.innerHTML=Graph.sanitizeHtml(d.substring(e));var c=g.getElementsByTagName("svg");if(0<c.length){var h=c[0].getAttribute("style");0<=b.indexOf("light-dark(")&&(null==h||0>h.indexOf("color-scheme"))&&(b+="; color-scheme: light dark"); c[0].setAttribute("style",(null!=h&&""!=h?h+"; ":"")+b);a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(c[0]))))}}}catch(k){}return a};Graph.isSameOrigin=function(a){try{var b=document.createElement("a");b.setAttribute("href",a);return b.origin==window.location.origin}catch(d){return!1}}; Graph.prefixSvgIds=function(a,b,d){var e="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),g=function(x){return x.replace(/url\(\s*(['"]?)#/g,"url($1#"+b)},c=function(x){return x.replace(/([^{}]*)(\{[^{}]*\})/g,function(v,z,C){z=z.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+b+"$2");if(null!=d){v=z.split(",");for(z=0;z<v.length;z++){var F=mxUtils.trim(v[z]);"svg"==F?v[z]=d:"svg "==F.substring(0,4)||"svg>"==F.substring(0,4)||"svg+"==F.substring(0,4)||"svg~"==F.substring(0, 4)?v[z]=d+F.substring(3):v[z]=""!=F?d+" "+F:F}z=v.join(", ")}return z+g(C)})};a=a.getElementsByTagName("*");for(var h=0;h<a.length;h++){var k=a[h],p=k.getAttribute("id");null!=p&&""!=p&&k.setAttribute("id",b+p);p=k.getAttribute("class");if(null!=p&&""!=p){var l=p.split(/\s+/);for(p=0;p<l.length;p++)""!=l[p]&&(l[p]=b+l[p]);k.setAttribute("class",l.join(" "))}if("style"==k.nodeName.toLowerCase())mxUtils.setTextContent(k,c(mxUtils.getTextContent(k)));else{for(p=0;p<e.length;p++)l=k.getAttribute(e[p]), null!=l&&0<=l.indexOf("url(")&&k.setAttribute(e[p],g(l));var u=["href","xlink:href"];for(p=0;p<u.length;p++)l=k.getAttribute(u[p]),null!=l&&"#"==l.charAt(0)&&k.setAttribute(u[p],"#"+b+l.substring(1))}}};Graph.getCssRules=function(a){var b=document.implementation.createHTMLDocument(""),d=document.createElement("style");mxUtils.setTextContent(d,a);b.body.appendChild(d);return d.sheet.cssRules}; Graph.canonicalizeSvgCssRules=function(a,b){var d=null;if(null!=a&&"data:image/svg+xml;base64,"==a.substring(0,26))try{var e=decodeURIComponent(escape(atob(a.substring(26)))),g=e.indexOf("<svg");if(0<=g){var c=document.createElement("div");c.innerHTML=Graph.sanitizeHtml(e.substring(g));var h=c.getElementsByTagName("svg");if(0<h.length){var k=h[0],p=new RegExp(b),l=k.getElementsByTagName("style");a=["fill","stroke","stop-color"];b=[];for(e=0;e<l.length;e++){var u=Graph.getCssRules(mxUtils.getTextContent(l[e])); g="";for(c=0;c<u.length;c++){var x=u[c];if(null!=x.selectorText&&p.test(x.selectorText))for(h=0;h<a.length;h++){var v=mxUtils.trim(x.style.getPropertyValue(a[h]));""!=v&&"url("!=v.substring(0,4)&&"var("!=v.substring(0,4)&&(x.style.setProperty(a[h],"var(--mx-r"+b.length+")"),b.push("--mx-r"+b.length+": "+v))}g+=x.cssText+"\n"}mxUtils.setTextContent(l[e],g)}0<b.length&&(null!=k.style&&""==k.style.getPropertyValue("color-scheme")&&(k.style.colorScheme="light dark"),d={uri:"data:image/svg+xml;base64,"+ btoa(unescape(encodeURIComponent(mxUtils.getXml(k)))),vars:b.join("; ")})}}}catch(z){}return d}; Graph.inlineSingleUseImages=function(a){for(var b=a.getElementsByTagName("use"),d={},e=[],g=0;g<b.length;g++){var c=b[g].getAttribute("href");null==c&&(c=b[g].getAttribute("xlink:href"));null!=c&&"#mx-image-"==c.substring(0,10)&&(d[c]=(d[c]||0)+1,e.push(b[g]))}for(g=0;g<e.length;g++)if(b=e[g],c=b.getAttribute("href"),null==c&&(c=b.getAttribute("xlink:href")),1==d[c]){c=a.querySelector('[id="'+c.substring(1)+'"]');var h=null!=c&&"symbol"==c.nodeName?c.getElementsByTagName("image")[0]:null;if(null!= h){h=h.cloneNode(!0);for(var k=b.attributes,p=0;p<k.length;p++){var l=k[p].name;"href"!=l&&"xlink:href"!=l&&h.setAttribute(l,k[p].value)}b.parentNode.replaceChild(h,b);c.parentNode.removeChild(c)}}}; Graph.replaceFontElements=function(a){var b="x-small small medium large x-large xx-large xxx-large".split(" "),d=a.getElementsByTagName("font");a=[];for(var e=0;e<d.length;e++)a.push(d[e]);for(e=0;e<a.length;e++){d=a[e];for(var g=null!=d.ownerDocument.createElementNS?d.ownerDocument.createElementNS(d.namespaceURI,"span"):d.ownerDocument.createElement("span"),c=d.attributes,h=0;h<c.length;h++){var k=c[h].name;"color"!=k&&"face"!=k&&"size"!=k&&g.setAttribute(k,c[h].value)}c=d.getAttribute("color"); null!=c&&""==g.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(c)&&(c="#"+c),g.style.color=c);null!=d.getAttribute("face")&&""==g.style.fontFamily&&(g.style.fontFamily=d.getAttribute("face"));c=d.getAttribute("size");if(null!=c&&""==g.style.fontSize&&(h=parseInt(c),!isNaN(h))){if("+"==c.charAt(0)||"-"==c.charAt(0))h=3+h;g.style.fontSize=b[Math.max(0,Math.min(6,h-1))]}for(;null!=d.firstChild;)g.appendChild(d.firstChild);d.parentNode.replaceChild(g,d)}}; Graph.createSvgImageSymbol=function(a,b,d,e){null==b.keys&&(b.keys={},b.ids={});var g=d+"|"+e,c=b.keys[g];if(void 0===c){c=null;try{if(null!=a&&null!=d&&"data:image/svg+xml;base64,"==d.substring(0,26)){var h=decodeURIComponent(escape(atob(d.substring(26)))),k=h.indexOf("<svg");if(0<=k){var p=document.createElement("div");p.innerHTML=Graph.sanitizeHtml(h.substring(k));var l=p.getElementsByTagName("svg");if(0<l.length){var u=l[0],x=u.getAttribute("viewBox");if(null==x||""==x){var v=parseFloat(u.getAttribute("width")), z=parseFloat(u.getAttribute("height"));x=!isNaN(v)&&!isNaN(z)&&0<v&&0<z?"0 0 "+v+" "+z:null}if(null!=x){for(var C="mx-symbol-"+mxUtils.hashCode(g);null!=b.ids[C];)C+="-1";Graph.prefixSvgIds(u,C+"-","#"+C);var F=a.ownerDocument,G=null!=F.createElementNS?F.createElementNS(mxConstants.NS_SVG,"symbol"):F.createElement("symbol");G.setAttribute("id",C);G.setAttribute("viewBox",x);e||G.setAttribute("preserveAspectRatio","none");d="width height viewbox preserveaspectratio id x y version".split(" ");for(e= 0;e<u.attributes.length;e++){var H=u.attributes[e],J=H.name.toLowerCase();if("xmlns"!=J.substring(0,5)&&0>mxUtils.indexOf(d,J)){var O=H.value;if("class"==J){var M=O.split(/\s+/);for(h=0;h<M.length;h++)""!=M[h]&&(M[h]=C+"-"+M[h]);O=M.join(" ")}else 0<=O.indexOf("url(")&&(O=O.replace(/url\(\s*(['"]?)#/g,"url($1#"+C+"-"));G.setAttribute(H.name,O)}}var V=u.childNodes;for(e=0;e<V.length;e++)G.appendChild(null!=F.importNode?F.importNode(V[e],!0):V[e].cloneNode(!0));a.appendChild(G);b.ids[C]=g;c=C}}}}}catch(Q){}b.keys[g]= c}return c};Graph.createRemoveIcon=function(a,b){var d=document.createElement("img");d.setAttribute("src",Dialog.prototype.clearImage);d.setAttribute("title",a);d.setAttribute("width","13");d.setAttribute("height","10");d.style.marginLeft="4px";d.style.marginBottom="-1px";d.style.cursor="pointer";mxEvent.addListener(d,"click",b);return d};Graph.isPageLink=function(a){return null!=a&&"data:page/id,"==a.substring(0,13)}; Graph.rewritePageLinks=function(a,b){function d(g,c){var h=g.getAttribute(c);if(null!=h){Graph.isPageLink(h)&&(h="#"+h.substring(h.indexOf(":")+1));var k=c;b&&"xlink:href"==c&&(g.removeAttribute(c),k="href");g.setAttribute(k,h)}}a=a.getElementsByTagName("a");if(null!=a)for(var e=0;e<a.length;e++)d(a[e],"href"),d(a[e],"xlink:href")};Graph.isLink=function(a){return null!=a&&a.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.shapeInsideMargin=2;Graph.prototype.getShapeInsidePadding=function(a){a=parseFloat(mxUtils.getValue(a,"shapeInsidePadding",this.shapeInsideMargin));return isFinite(a)&&0<=a?a:this.shapeInsideMargin};Graph.mirrorShapeInsideOutline=function(a){function b(d){if(null==d)return null;for(var e=[],g=0;g<d.length;g++)e.push([1-d[g][0],d[g][1]]);return e}return{left:b(a.right),right:b(a.left)}}; Graph.shapeInsideOutlines={rhombus:function(a,b,d){return{left:[[0,0],[.5,0],[0,.5],[.5,1],[0,1]],right:[[1,0],[.5,0],[1,.5],[.5,1],[1,1]]}},ellipse:function(a,b,d){a=[[0,0],[.5,0]];b=[[1,0],[.5,0]];for(d=1;20>d;d++){var e=d/20;e=e*e*(3-2*e);var g=.5*(1-Math.sqrt(1-Math.pow(2*e-1,2)));a.push([g,e]);b.push([1-g,e])}a.push([.5,1],[0,1]);b.push([.5,1],[1,1]);return{left:a,right:b}},triangle:function(a,b,d){b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d="1"==mxUtils.getValue(a, mxConstants.STYLE_FLIPH,"0");a="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,"0");if(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH){var e=d;d=a;a=e}b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST?d&&(b=b==mxConstants.DIRECTION_EAST?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_EAST):a&&(b=b==mxConstants.DIRECTION_NORTH?mxConstants.DIRECTION_SOUTH:mxConstants.DIRECTION_NORTH);return b==mxConstants.DIRECTION_NORTH?{left:[[0,0],[.5,0],[0,1]],right:[[1,0],[.5,0],[1, 1]]}:b==mxConstants.DIRECTION_SOUTH?{left:[[0,1],[.5,1],[0,0]],right:[[1,1],[.5,1],[1,0]]}:b==mxConstants.DIRECTION_WEST?{left:[[.5,0],[0,0],[0,1],[.5,1],[.5,.75],[0,.5],[.5,.25]],right:[[1,0],[.5,0],[.5,.25],[.999,.001],[.999,.999],[.5,.75],[.5,1],[1,1]]}:{left:[[0,0],[.5,0],[.5,.25],[.001,.001],[.001,.999],[.5,.75],[.5,1],[0,1]],right:[[.5,0],[1,0],[1,1],[.5,1],[.5,.75],[1,.5],[.5,.25]]}},hexagon:function(a,b,d){var e=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);e= e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH;var g="0"!=mxUtils.getValue(a,"fixedSize","0"),c=e?d:b;a=g?Math.max(0,Math.min(.5*c,parseFloat(mxUtils.getValue(a,"size",20)))):c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.25))));if(a>c/2)return null;if(e)return b=a/d,{left:[[0,0],[.5,0],[0,b],[0,1-b],[.5,1],[0,1]],right:[[1,0],[.5,0],[1,b],[1,1-b],[.5,1],[1,1]]};b=a/b;return{left:[[0,0],[b,0],[0,.5],[b,1],[0,1]],right:[[1,0],[1-b,0],[1,.5],[1-b,1],[1,1]]}},parallelogram:function(a, b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.2))));if(d>b/2)return null;b=d/b;return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0")!=("1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,"0"))?{left:[[0,0],[0,1],[b,1]],right:[[1,0],[1-b,0],[1,1]]}:{left:[[0, 0],[b,0],[0,1]],right:[[1,0],[1,1],[1-b,1]]}},trapezoid:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;b=("0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(.5*b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(a,"size",.2)))))/b;return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,"0")?{left:[[0,1],[b,1],[0,0]],right:[[1,1],[1-b,1],[1,0]]}:{left:[[0,0], [b,0],[0,1]],right:[[1,0],[1-b,0],[1,1]]}},dataStorage:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.1))));if(d>b/2)return null;b=d/b;d=[[0,0],[b,0]];for(var e=[[1,0]],g=1;12>g;g++){var c=g/12;d.push([b*(1-2*c)*(1-2*c),c]);e.push([1-4*b*c*(1- c),c])}d.push([b,1],[0,1]);e.push([1,1]);b={left:d,right:e};return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0")?Graph.mirrorShapeInsideOutline(b):b},or:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;b=[[0,0]];for(d=1;24>d;d++){var e=d/24;e=e*e*(3-2*e);var g=Math.sqrt(2*(.5>=e?e:1-e));b.push([2*g-g*g,e])}b.push([0,1],[1,1],[1,0]);b={left:null,right:b};return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH, "0")?Graph.mirrorShapeInsideOutline(b):b},xor:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;b=[[0,0]];d=[[0,0]];for(var e=1;24>e;e++){var g=e/24;g=g*g*(3-2*g);var c=Math.sqrt(2*(.5>=g?g:1-g));b.push([g*(1-g),g]);d.push([2*c-c*c,g])}b.push([0,1]);d.push([0,1],[1,1],[1,0]);b={left:b,right:d};return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0")?Graph.mirrorShapeInsideOutline(b):b},step:function(a,b,d){if(mxUtils.getValue(a, mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.2))));if(d>b/2)return null;b=d/b;return"1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0")?{left:[[0,0],[b,0],[0,.5],[b,1],[0,1]],right:[[1,0],[1-b,.5],[1,1]]}:{left:[[0,0],[b,.5],[0,1]],right:[[1,0],[1-b,0],[1,.5],[1-b,1],[1,1]]}}}; Object.setPrototypeOf(Graph.shapeInsideOutlines,null); Graph.shapeInsideBands={rhombus:function(a,b,d){return function(e){e=.5*Math.abs(2*e-1);return[e,1-e]}},ellipse:function(a,b,d){return function(e){e=.5*(1-Math.sqrt(Math.max(0,1-Math.pow(2*e-1,2))));return[e,1-e]}},triangle:function(a,b,d){b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0");a="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,"0");if(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH){var e=d; d=a;a=e}b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST?d&&(b=b==mxConstants.DIRECTION_EAST?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_EAST):a&&(b=b==mxConstants.DIRECTION_NORTH?mxConstants.DIRECTION_SOUTH:mxConstants.DIRECTION_NORTH);return b==mxConstants.DIRECTION_NORTH?function(g){return[.5*(1-g),1-.5*(1-g)]}:b==mxConstants.DIRECTION_SOUTH?function(g){return[.5*g,1-.5*g]}:b==mxConstants.DIRECTION_WEST?function(g){return[Math.abs(2*g-1),1]}:function(g){return[0,1-Math.abs(2*g- 1)]}},hexagon:function(a,b,d){var e=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);e=e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH;var g="0"!=mxUtils.getValue(a,"fixedSize","0"),c=e?d:b;a=g?Math.max(0,Math.min(.5*c,parseFloat(mxUtils.getValue(a,"size",20)))):c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.25))));if(a>c/2)return null;if(e){var h=a/d;return function(p){p=.5*Math.max(0,0<h?Math.max(1-p/h,1-(1-p)/h):0);return[p,1-p]}}var k=a/ b;return function(p){p=k*Math.abs(2*p-1);return[p,1-p]}},parallelogram:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.2))));if(d>b/2)return null;var e=d/b,g="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0")!=("1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV, "0"));return function(c){return g?[e*c,1-e*(1-c)]:[e*(1-c),1-e*c]}},trapezoid:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var e=("0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(.5*b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(a,"size",.2)))))/b,g="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,"0");return function(c){c=g?e*c:e*(1-c);return[c,1- c]}},dataStorage:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.1))));if(d>b/2)return null;var e=d/b,g="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0");return function(c){var h=e*(1-2*c)*(1-2*c);c=1-4*e*c*(1-c);return g?[1-c,1-h]:[h,c]}},or:function(a, b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var e="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0");return function(g){g=Math.sqrt(2*Math.min(g,1-g));g=2*g-g*g;return e?[1-g,1]:[0,g]}},xor:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var e="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0");return function(g){var c=Math.sqrt(2* Math.min(g,1-g));g*=1-g;c=2*c-c*c;return e?[1-c,1-g]:[g,c]}},step:function(a,b,d){if(mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d="0"!=mxUtils.getValue(a,"fixedSize","0")?Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(a,"size",20)))):b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(a,"size",.2))));if(d>b/2)return null;var e=d/b,g="1"==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,"0");return function(c){var h=e*(1-Math.abs(2* c-1));c=1-e*Math.abs(2*c-1);return g?[1-c,1-h]:[h,c]}}};Object.setPrototypeOf(Graph.shapeInsideBands,null);Graph.prototype.getShapeInsideBands=function(a,b,d){var e=null;if(null!=a&&0<b&&0<d){var g=mxUtils.getValue(a,"shapeInsideShape",null);if(null==g||""==g)g=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null);g=Graph.shapeInsideBands[g];"function"===typeof g&&(e=g(a,b,d))}return e}; Graph.prototype.createShapeInsideTextFlow=function(a,b,d){var e=this.getShapeInsideBands(a,b,d),g=null;if(null!=e){g=this.getShapeInsideBox(a,b,d);var c=this.getShapeInsidePadding(a),h=g.x,k=g.y;g={boxWidth:g.width,boxHeight:g.height,valign:mxUtils.getValue(a,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),align:mxUtils.getValue(a,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),available:function(p,l){function u(z){z+=k;return 0>z||z>d?[0,1]:e(Math.max(0,Math.min(1,z/d)))}var x=u(p); p=u((p+l)/2);l=u(l);var v=Math.max(x[0],p[0],l[0])*b-h+c;return{x:Math.max(0,v),width:Math.max(0,Math.min(x[1],p[1],l[1])*b-h-c-Math.max(0,v))}}}}return g};Graph.prototype.getShapeInsideOutline=function(a,b,d){var e=null;if(null!=a&&0<b&&0<d){var g=mxUtils.getValue(a,"shapeInsideShape",null);if(null==g||""==g)g=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null);g=Graph.shapeInsideOutlines[g];"function"===typeof g&&(e=g(a,b,d))}return e}; Graph.prototype.isShapeInsideEnabled=function(a){return null!=a&&"1"==mxUtils.getValue(a,"shapeInside","0")&&"wrap"==mxUtils.getValue(a,mxConstants.STYLE_WHITE_SPACE,null)&&"0"!=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,"1")&&"visible"==mxUtils.getValue(a,mxConstants.STYLE_OVERFLOW,"visible")&&null==mxUtils.getValue(a,mxConstants.STYLE_LABEL_WIDTH,null)&&mxUtils.getValue(a,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER)==mxConstants.ALIGN_CENTER&&mxUtils.getValue(a,mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_MIDDLE)==mxConstants.ALIGN_MIDDLE};Graph.prototype.getShapeInsideFloats=function(a,b,d){return this.isShapeInsideEnabled(a)?this.getShapeInsideOutline(a,b,d):null}; Graph.prototype.getShapeInsideBox=function(a,b,d){var e=parseFloat(mxUtils.getValue(a,mxConstants.STYLE_SPACING,2)),g=e+parseFloat(mxUtils.getValue(a,mxConstants.STYLE_SPACING_TOP,0)),c=e+parseFloat(mxUtils.getValue(a,mxConstants.STYLE_SPACING_BOTTOM,0)),h=e+parseFloat(mxUtils.getValue(a,mxConstants.STYLE_SPACING_LEFT,0));e+=parseFloat(mxUtils.getValue(a,mxConstants.STYLE_SPACING_RIGHT,0));var k=mxSvgCanvas2D.prototype.foreignObjectPadding;mxUtils.getValue(a,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)== mxConstants.ALIGN_TOP&&(g+=mxText.prototype.baseSpacingTop);return new mxRectangle(h-k/2,g,Math.max(1,Math.round(b-h-e+k)),Math.max(1,Math.round(d-g-c)))}; Graph.prototype.createShapeInsideMarkup=function(a,b,d,e,g,c,h){function k(F,G,H){for(var J=[],O=0;O<F.length;O++){var M=F[O],V=F[(O+1)%F.length],Q=H?M[1]<=G:M[1]>=G,ma=H?V[1]<=G:V[1]>=G;Q&&J.push(M);Q!=ma&&V[1]!=M[1]&&J.push([M[0]+(V[0]-M[0])*(G-M[1])/(V[1]-M[1]),G])}return J}function p(F,G,H){for(var J=[],O=0;O<F.length;O++)J.push([F[O][0]*e-b.x-G,z+F[O][1]*g-b.y]);J=k(k(J,0,!1),C,!0);F=[];for(O=0;O<J.length;O++)F.push(Math.round(100*Math.max(.05,Math.min(99.95,J[O][0]/H*100)))/100+"% "+Math.round(100* Math.max(.05,Math.min(99.95,J[O][1]/C*100)))/100+"%");return 2<F.length?"polygon("+F.join(", ")+")":null}function l(F,G,H){return'<div data-shape-inside="1" contenteditable="false" style="float:'+F+";width:"+G+"px;height:"+C+"px;shape-outside:"+H+";shape-margin:"+v+'px;pointer-events:none;"></div>'}var u=Math.floor(b.width/2),x=b.width-u,v=null!=c?c:this.shapeInsideMargin;c="";var z=null!=d&&0>d?Math.round(-d):0,C=Math.round(null!=h?Math.max(0,Math.min(h,b.height)):b.height)+z;h=null!=a.left?p(a.left, 0,u):null;a=null!=a.right?p(a.right,u,x):null;null!=h&&(c+=l("left",u,h));null!=a&&(c+=l("right",x,a));null!=d&&0<d&&(c+='<div data-shape-inside="1" contenteditable="false" style="height:'+Math.round(d)+'px;pointer-events:none;"></div>');return c};Graph.prototype.getShapeInsideGrow=function(a,b){return null!=a&&0>a?b==mxConstants.ALIGN_BOTTOM?-a:-2*a:0}; Graph.prototype.createShapeInsideValue=function(a,b,d,e,g,c,h,k,p){k=Math.round(b.height+this.getShapeInsideGrow(d,k));return'<div style="float:left;width:'+Math.round(b.width)+"px;height:"+k+'px;">'+this.createShapeInsideMarkup(a,b,d,e,g,h,p)+c+"</div>"}; Graph.prototype.measureShapeInsideFlow=function(a,b,d,e,g,c,h,k,p){var l=null;if(null!=document.body){var u=Graph.shapeInsideMeasureDiv;null==u&&(u=document.createElement("div"),u.style.position="absolute",u.style.visibility="hidden",u.style.left="-9999px",u.style.top="0px",u.style.boxSizing="border-box",document.body.appendChild(u),Graph.shapeInsideMeasureDiv=u);k=null!=k?k:parseFloat(mxUtils.getValue(b,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE));var x=parseInt(mxUtils.getValue(b,mxConstants.STYLE_FONTSTYLE, 0));u.style.width=e.width+"px";u.style.fontFamily=mxUtils.getValue(b,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);u.style.fontSize=Math.round(k)+"px";u.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?k*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;u.style.fontWeight=(x&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"normal";u.style.fontStyle=(x&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";u.style.textAlign= mxUtils.getValue(b,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);u.style.whiteSpace="normal";u.style.wordWrap=mxConstants.WORD_WRAP;u.innerHTML=this.createShapeInsideMarkup(d,e,g,c,h,this.getShapeInsidePadding(b),p)+a;a=u.getBoundingClientRect();h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null);e=d=b=null;for(g=[];h.nextNode();)for(c=document.createRange(),c.selectNodeContents(h.currentNode),k=c.getClientRects(),c=0;c<k.length;c++)0<k[c].width&&0<k[c].height&&(b=null==b?k[c].top:Math.min(b, k[c].top),d=null==d?k[c].bottom:Math.max(d,k[c].bottom),e=null==e?k[c].right:Math.max(e,k[c].right),g.push([k[c].top-a.top,k[c].bottom-a.top]));if(null!=b){g.sort(function(v,z){return v[0]-z[0]});l=[];for(c=0;c<g.length;c++)h=0<l.length?l[l.length-1]:null,null!=h&&g[c][0]<h[1]-2?h[1]=Math.max(h[1],g[c][1]):l.push(g[c]);l={top:b-a.top,bottom:d-a.top,right:e-a.left,lines:l}}u.innerHTML=""}return l}; Graph.prototype.computeShapeInsideSpacer=function(a,b,d,e,g,c){var h=mxUtils.getValue(b,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),k=parseFloat(mxUtils.getValue(b,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,p=h!=mxConstants.ALIGN_BOTTOM,l=this,u=null,x=0;if(h!=mxConstants.ALIGN_TOP){var v=function(Q,ma,ia){var na=null;if(null!=Q)for(var Z=0;Z<Q.length;Z++){var da=Q[Z],pa=Q[(Z+1)%Q.length];da[1]!=pa[1]&&ma>=Math.min(da[1],pa[1])&&ma<=Math.max(da[1], pa[1])&&(da=da[0]+(pa[0]-da[0])*(ma-da[1])/(pa[1]-da[1]),na=null==na?da:ia?Math.max(na,da):Math.min(na,da))}return na};x=v(d.left,.999,!0);v=v(d.right,.999,!1);var z=24<=((null==v?1:v)-(null==x?0:x))*g;x=function(Q){for(var ma=null,ia=[],na=null,Z=null,da=function(R){var ea=l.measureShapeInsideFlow(a,b,d,e,R,g,c);if(null==ea)return null;var ba=Math.min(0,R),la=ea.top+ba;ba=ea.bottom+ba;null==u&&(u=ba-la);var sa=u>e.height,T=ba<=e.height+.5&&(Q||-.5<=la),ua=null;Q?sa?ua=Math.abs(e.height-ba):0<=R&& (ua=T?e.height-ba:z?1.5*(ba-e.height):null):ua=T?Math.abs(la-(e.height-ba)):Math.abs(la+ba-e.height);var va=!Q||sa;null!=ua&&(null==ma||va&&T&&!ma.fits||(!va||T==ma.fits)&&ua<ma.score)&&(ma={spacer:R,score:ua,fits:T});R={spacer:R,top:la,btm:ba,overflow:sa,lines:ea.lines.length};ia.push(R);return R},pa=function(){return null!=ma&&ma.fits&&1>=ma.score},ka=0,S=0;S<(Q?8:5);S++){var U=da(ka);if(null==U)return null;if(pa())break;var Y=Q?ka+e.height-U.btm:ka+(e.height-U.top-U.btm)/2;if(Q){if(U.btm<=e.height+ .5)na=null==na?ka:Math.max(na,ka);else if(null==na||ka>na)Z=null==Z?ka:Math.min(Z,ka);null!=na&&null!=Z&&1<Z-na&&(Y=(na+Z)/2);U.overflow||(Y=Math.max(0,Y))}if(Math.round(Y)==Math.round(ka))break;ka=Y}if(!Q&&!pa())for(na=function(R,ea){return R.lines==ea.lines&&1>=Math.abs(ea.btm-ea.top-(R.btm-R.top))},Z=ia.slice().sort(function(R,ea){return R.spacer-ea.spacer}),ka=8,S=0;S<Z.length-1&&0<ka&&!pa();S++)for(U=Z[S],Y=Z[S+1];0<ka&&!pa()&&!na(U,Y)&&1<Y.spacer-U.spacer;){var N=Math.round((U.spacer+Y.spacer)/ 2);if(N<=U.spacer||N>=Y.spacer)break;N=da(N);ka--;if(null==N)break;else na(U,N)?U=N:Y=N}return ma};v=x(h==mxConstants.ALIGN_BOTTOM);h==mxConstants.ALIGN_BOTTOM&&null!=u&&u>e.height&&(null==v||!v.fits||v.score>2*k)&&(v=x(!1),p=!0);x=Math.round(null!=v?v.spacer:0)}v=function(Q){var ma=null,ia=l.measureShapeInsideFlow(a,b,d,e,Q,g,c);if(null!=ia&&0<ia.lines.length){Q=Math.max(0,-Q);for(var na=Math.round(e.height)+Q,Z=ia.lines.length;0<Z&&ia.lines[Z-1][0]>=na-1;)Z--;Z<ia.lines.length&&(na=0<Z?ia.lines[Z][0]- ia.lines[Z-1][1]:0,ia.lines[ia.lines.length-1][1]-ia.lines[Z][0]<=2*k+2&&(0==Z||2<na)&&(ma=0<Z?ia.lines[Z-1][1]-Q:0))}return ma};var C=v(x);if(null!=C&&h!=mxConstants.ALIGN_TOP){h=function(Q,ma){ma=Math.min(0,ma);return p?Math.abs(e.height-(Q.top+ma)-(Q.bottom+ma)):Math.abs(e.height-(Q.bottom+ma))};for(var F=this.measureShapeInsideFlow(a,b,d,e,x,g,c,null,C),G=0;3>G&&null!=F;G++){var H=Math.min(0,x);H=Math.round(p?(e.height-(F.top+H)-(F.bottom+H))/2:e.height-(F.bottom+H));for(var J=!1,O=0;2>O&&0!= H;O++){var M=v(x+H);M=null!=M?M:C+H;var V=this.measureShapeInsideFlow(a,b,d,e,x+H,g,c,null,M);if(null!=V&&h(V,x+H)<h(F,x)&&(p||V.bottom+Math.min(0,x+H)<=e.height+.5)){x+=H;C=M;F=V;J=!0;break}H=Math.round(H/2)}if(!J)break}}return{spacer:Math.round(x),clip:null!=C?Math.round(C):null}}; Graph.prototype.computeShapeInsideFontSize=function(a,b,d,e,g){var c=this.getShapeInsideBox(b,e,g);if(null==this.measureShapeInsideFlow(a,b,d,c,0,e,g,1))return null;for(var h=1,k=84;h<k;){var p=Math.ceil((h+k)/2),l=this.measureShapeInsideFlow(a,b,d,c,0,e,g,p);null!=l&&l.bottom<=c.height+.5&&l.right<=c.width+.5?h=p:k=p-1}return Math.max(6,h)}; Graph.prototype.getShapeInsideSpacer=function(a,b,d,e,g,c){var h=[e.width,e.height,this.getShapeInsidePadding(a.style),(d.left||[]).join(";"),(d.right||[]).join(";"),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0),b].join("|");a.shapeInsideSpacerKey!= h&&(a.shapeInsideSpacerKey=h,a.shapeInsideSpacerValue=this.computeShapeInsideSpacer(b,a.style,d,e,g,c));return a.shapeInsideSpacerValue};var graphMxTextPaint=mxText.prototype.paint; mxText.prototype.paint=function(a,b){var d=this.state,e=null!=d&&null!=d.view&&d.view.graph instanceof Graph?d.view.graph:null,g=null,c=null;if(!b&&null!=e&&"function"===typeof e.getShapeInsideFloats&&"string"===typeof this.value&&""!=this.value&&null!=d.cell&&e.model.isVertex(d.cell)){var h=d.view.scale,k=d.width/h;h=d.height/h;var p=e.getShapeInsideFloats(d.style,k,h);if(null!=p)if("1"==mxUtils.getValue(d.style,"convertToSvg","0"))a.textFlow=e.createShapeInsideTextFlow(d.style,k,h),c=a;else{var l= e.getShapeInsideBox(d.style,k,h);g=this.value;var u=mxUtils.replaceTrailingNewlines(g,"<div><br></div>"),x=e.getShapeInsideSpacer(d,u,p,l,k,h);this.value=e.createShapeInsideValue(p,l,x.spacer,k,h,u,e.getShapeInsidePadding(d.style),mxUtils.getValue(d.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),x.clip)}}try{graphMxTextPaint.apply(this,arguments)}finally{null!=g&&(this.value=g),null!=c&&(c.textFlow=null)}};var graphMxTextRedraw=mxText.prototype.redraw; mxText.prototype.redraw=function(){var a=this.state,b=null!=a&&null!=a.view&&a.view.graph instanceof Graph?a.view.graph:null;if(null!=b&&"function"===typeof b.getShapeInsideFloats&&"string"===typeof this.value&&""!=this.value&&null!=a.cell&&b.model.isVertex(a.cell)){var d=a.view.scale,e=a.width/d;d=a.height/d;var g=b.getShapeInsideFloats(a.style,e,d);a=Math.round(e)+":"+Math.round(d)+":"+b.getShapeInsidePadding(a.style)+":"+(null!=g?(g.left||[]).join(";")+"|"+(g.right||[]).join(";"):"");this.shapeInsideKey!= a&&(this.shapeInsideKey=a,this.lastValue=null)}graphMxTextRedraw.apply(this,arguments)};Graph.edgeSupportsCurved=function(a){a=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null);return null==a||"connector"==a||"filledEdge"==a||"wire"==a||"pipe"==a||"link"==a||"flexArrow"==a}; Graph.getCurvePoints=function(a,b){var d=a.length;if(3>d||0<=a.indexOf(null))return a;var e=[a[0]],g=function(x,v,z){for(var C=1;16>=C;C++){var F=C/16,G=1-F;e.push(new mxPoint(G*G*x.x+2*G*F*v.x+F*F*z.x,G*G*x.y+2*G*F*v.y+F*F*z.y))}};if(b&&0==(d-1)%3)for(b=1;b+2<d;b+=3){g=a[b-1];for(var c=a[b],h=a[b+1],k=a[b+2],p=1;16>=p;p++){var l=p/16,u=1-l;e.push(new mxPoint(u*u*u*g.x+3*u*u*l*c.x+3*u*l*l*h.x+l*l*l*k.x,u*u*u*g.y+3*u*u*l*c.y+3*u*l*l*h.y+l*l*l*k.y))}}else{c=a[0];for(b=1;b<d-2;b++)h=new mxPoint((a[b].x+ a[b+1].x)/2,(a[b].y+a[b+1].y)/2),g(c,a[b],h),c=h;g(c,a[d-2],a[d-1])}return e}; Graph.getEdgeLabelAngle=function(a,b,d){var e=null!=a?a.absolutePoints:null;if(null==e||2>e.length)return null;a=a.style;null==a||1!=a[mxConstants.STYLE_CURVED]&&1!=a[mxConstants.STYLE_BEZIER]||(e=Graph.getCurvePoints(e,1==a[mxConstants.STYLE_BEZIER]));for(var g=a=null,c=1;c<e.length;c++){var h=e[c-1],k=e[c];if(null!=h&&null!=k){var p=k.x-h.x;k=k.y-h.y;var l=p*p+k*k,u=0==l?0:Math.max(0,Math.min(1,((b-h.x)*p+(d-h.y)*k)/l));l=b-(h.x+u*p);h=d-(h.y+u*k);h=l*l+h*h;if(null==g||h<g)g=h,a=180*Math.atan2(k, p)/Math.PI}}return a};Graph.getLabelAutoRotation=function(a){if(null==a||"1"!=mxUtils.getValue(a.style,"labelAutoRotate","0"))return null;var b=a.view.graph.model,d=null;if(b.isEdge(a.cell)){d=a;var e=a.absoluteOffset.x;var g=a.absoluteOffset.y}else b.isEdge(b.getParent(a.cell))&&(d=a.view.getState(b.getParent(a.cell)),e=a.getCenterX(),g=a.getCenterY());a=null!=d?Graph.getEdgeLabelAngle(d,e,g):null;null!=a&&(a=mxUtils.mod(a,360),90<a&&270>a&&(a-=180));return a};var mxTextGetTextRotation=mxText.prototype.getTextRotation; mxText.prototype.getTextRotation=function(){var a=null!=this.state?Graph.getLabelAutoRotation(this.state):null;return null!=a?a:mxTextGetTextRotation.apply(this,arguments)};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.defaultExportLinkTarget=null;Graph.prototype.linkRelation="nofollow noopener noreferrer"; Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectable=!0;Graph.prototype.defaultFoldingEnabled=!0;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":Editor.getDefaultPageBackgroundColor(); 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","note"];Graph.prototype.showNoteIcons=!0;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(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(d,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var g=d.view.graph.tolerance,c=!0,h=null,k=mxUtils.bind(this,function(u){c=!0;h=new mxPoint(mxEvent.getClientX(u),mxEvent.getClientY(u))}),p=mxUtils.bind(this,function(u){c=c&&null!=h&&Math.abs(h.x-mxEvent.getClientX(u))<g&&Math.abs(h.y-mxEvent.getClientY(u))<g}),l=mxUtils.bind(this,function(u){if(c)for(var x=mxEvent.getSource(u);null!= x&&x!=e.node;){if("a"==x.nodeName.toLowerCase()){d.view.graph.labelLinkClicked(d,x,u);break}x=x.parentNode}});mxEvent.addGestureListeners(e.node,k,p,l);mxEvent.addListener(e.node,"click",function(u){mxEvent.consume(u)})};if(null!=this.tooltipHandler){var b=this.tooltipHandler.init;this.tooltipHandler.init=function(){b.apply(this,arguments);null!=this.div&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth+ "px"),mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(d){var e=mxEvent.getSource(d);"A"==e.nodeName&&(e=e.getAttribute("href"),null!=e&&this.graph.isCustomLink(e)&&(mxEvent.isTouchEvent(d)||!mxEvent.isPopupTrigger(d))&&this.graph.customLinkClicked(e)&&mxEvent.consume(d))})))}}this.initTransparentBoundsStyleSync();this.initLayoutManager()}; Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(a,b){a=b.getProperty("edit");if(null!=a&&null!=a.changes){b=this.getStylesheet();for(var d=a.changes.length,e=0;e<d;e++){var g=a.changes[e];if(g instanceof mxStyleChange&&this.model.isVertex(g.cell)){var c=b.getCellStyle(g.previous),h=b.getCellStyle(g.style);h=null!=h&&1==h.transparentBounds;if((null!=c&&1==c.transparentBounds)!=h&&(c=this.getCellGeometry(g.cell),null!=c))if(h){if(0!= c.x||0!=c.y)for(var k=this.model.getChildCount(g.cell),p=0;p<k;p++)this.translateCell(this.model.getChildAt(g.cell,p),c.x,c.y);if(0!=c.x||0!=c.y||0!=c.width||0!=c.height)c=c.clone(),c.x=0,c.y=0,c.width=0,c.height=0,this.model.setGeometry(g.cell,c)}else if(h=this.getTransparentBounds(g.cell),null!=h&&(c=c.clone(),c.x+=h.x,c.y+=h.y,c.width=h.width,c.height=h.height,this.model.setGeometry(g.cell,c),0!=h.x||0!=h.y))for(k=this.model.getChildCount(g.cell),p=0;p<k;p++)this.translateCell(this.model.getChildAt(g.cell, p),-h.x,-h.y)}}}}))}; Graph.prototype.waitForBrowserTranslate=function(){var a=this;if(Graph.isBrowserTranslated())this.initBrowserTranslate(),this.btActive=!0,this.activateBrowserTranslate();else{var b=function(){if(null!=a.btClassObservers&&Graph.isBrowserTranslated()){for(var c=0;c<a.btClassObservers.length;c++)a.btClassObservers[c].disconnect();a.btClassObservers=null;a.initBrowserTranslate();a.btActive=!0;a.activateBrowserTranslate()}};this.btClassObservers=[];var d={attributes:!0,attributeFilter:["class"]},e=new MutationObserver(b); e.observe(document.documentElement,d);this.btClassObservers.push(e);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var g=new MutationObserver(b);g.observe(window.parent.document.documentElement,d);this.btClassObservers.push(g)}}catch(c){}}}; Graph.prototype.initBrowserTranslate=function(){var a=this;this.btMirrorMap=new Map;this.btRebuilding=!1;var b=document;try{window.parent!=window&&null!=window.parent.document&&(b=window.parent.document)}catch(e){}var d=b.createElement("div");d.id="bt-mirror";d.setAttribute("aria-hidden","true");d.style.cssText="position:fixed;left:-10000px;top:0;width:1px;overflow:hidden;";b.body.appendChild(d);this.btMirrorContainer=d;this.btObserver=new MutationObserver(function(e){if(!a.btRebuilding){a.btActive|| (a.btActive=!0,a.activateBrowserTranslate());for(var g=0;g<e.length;g++){for(var c=e[g].target;null!=c&&null!=c.parentNode&&c.parentNode!=a.btMirrorContainer;)c=c.parentNode;if(null!=c){var h=a.btMirrorMap.get(c);null!=h&&a.syncTranslationToForeignObject(c,h)}}}});this.btObserver.observe(d,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()}; Graph.prototype.activateBrowserTranslate=function(){this.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()}));var a=mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()});this.addListener(mxEvent.LABEL_CHANGED,a);this.addListener(mxEvent.CELLS_ADDED,a);this.getModel().addListener(mxEvent.CHANGE,function(){setTimeout(a,0)})}; Graph.prototype.addBrowserTranslateMirror=function(a){if(null!=this.btMirrorContainer)if("http://www.w3.org/1999/xhtml"==a.namespaceURI){a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b;null!=(b=a.nextNode());){var d=b.data;if(null!=d&&0<d.trim().length){var e=document.createElement("p");e.style.cssText="margin:0;";e.textContent=d;e.setAttribute("data-bt-original",d);this.btMirrorContainer.appendChild(e);this.btMirrorMap.set(e,b)}}}else d=a.textContent,null!=d&&0<d.length&&(e= document.createElement("p"),e.style.cssText="margin:0;",e.textContent=d,e.setAttribute("data-bt-original",d),this.btMirrorContainer.appendChild(e),this.btMirrorMap.set(e,a))};Graph.prototype.syncTranslationToForeignObject=function(a,b){var d=a.textContent;if(d!=(3==b.nodeType?b.data:b.textContent))if(3==b.nodeType)b.data=d;else if(a=b.querySelectorAll("tspan"),0==a.length)b.textContent=d;else if(1==a.length)a[0].textContent=d;else for(a[0].textContent=d,b=1;b<a.length;b++)a[b].textContent=""}; Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var a={},b=0;if(null!=this.btTranslationCache)for(var d in this.btTranslationCache)a[d]=this.btTranslationCache[d],b++;for(var e=this.btMirrorContainer.children,g=0;g<e.length;g++){var c=e[g].getAttribute("data-bt-original"),h=e[g].textContent;null!=c&&h!=c&&(a[c]=h,b++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";c=this.container.querySelector("svg"); if(null!=c){e=c.querySelectorAll("text");for(g=h=0;g<e.length;g++)null==e[g].closest("foreignObject")&&(this.addBrowserTranslateMirror(e[g]),h++);c=c.querySelectorAll("foreignObject > div");for(g=e=0;g<c.length;g++)this.addBrowserTranslateMirror(c[g]),e++}if(0<b){b={};for(d in a)b[a[d]]=d;d=0;e=this.btMirrorContainer.children;for(g=0;g<e.length;g++)c=e[g].getAttribute("data-bt-original"),null!=c&&null!=b[c]&&(c=b[c],e[g].setAttribute("data-bt-original",c)),c=null!=c?a[c]:null,null!=c&&(e[g].textContent= c,c=this.btMirrorMap.get(e[g]),null!=c&&this.syncTranslationToForeignObject(e[g],c),d++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var a={},b=0,d=this.btMirrorContainer.children,e=0;e<d.length;e++){var g=d[e].getAttribute("data-bt-original"),c=d[e].textContent;null!=g&&c!=g&&(a[g]=c,b++)}return 0<b?a:null}; Graph.prototype.applyBrowserTranslationCache=function(a){if(null!=a&&null!=this.btMirrorContainer){this.btTranslationCache=a;this.btRebuilding=!0;for(var b=this.btMirrorContainer.children,d=0;d<b.length;d++){var e=b[d].getAttribute("data-bt-original");e=null!=e?a[e]:null;null!=e&&(b[d].textContent=e,e=this.btMirrorMap.get(b[d]),null!=e&&this.syncTranslationToForeignObject(b[d],e))}this.btRebuilding=!1}}; Graph.prototype.destroyBrowserTranslate=function(){if(null!=this.btClassObservers){for(var a=0;a<this.btClassObservers.length;a++)this.btClassObservers[a].disconnect();this.btClassObservers=null}null!=this.btObserver&&(this.btObserver.disconnect(),this.btObserver=null);null!=this.btMirrorContainer&&null!=this.btMirrorContainer.parentNode&&(this.btMirrorContainer.parentNode.removeChild(this.btMirrorContainer),this.btMirrorContainer=null);null!=this.btMirrorMap&&(this.btMirrorMap.clear(),this.btMirrorMap= null)};var graphDestroy=Graph.prototype.destroy;Graph.prototype.destroy=function(){this.destroyBrowserTranslate();graphDestroy.apply(this,arguments)}; (function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(h){var k=mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(h.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(h.style,"lineShape",null)&&"mxgraph.basic.arc"!=k&&(this.model.isVertex(h.cell)||"arrow"==k||"pipe"==k||"wire"== k||"filledEdge"==k||"flexArrow"==k||"mermaidSankeyLink"==k||"mxgraph.arrows2.wedgeArrow"==k)};Graph.prototype.isGradientState=function(h){var k=mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(h)&&"wire"!=k&&"pipe"!=k};Graph.prototype.isStrokeState=function(h){return!0};Graph.prototype.getTextColor=function(h,k){var p=k?"color":"background-color",l=null;if(null!=h&&window.getSelection)for(var u=window.getSelection(),x=h.getElementsByTagName("*"),v=0;v<x.length&&null== l;v++)null!=x[v].style&&u.containsNode(x[v],!0)&&(l=Graph.getGivenColor(x[v],p));for(;null==l&&null!=h&&h!=this.cellEditor.textarea.parentNode;)l=h==this.cellEditor.textarea&&k?"default":Graph.getGivenColor(h,p),h=h.parentNode;if("rgba(0, 0, 0, 0)"==l||"transparent"==l)l=mxConstants.NONE;return l};Graph.prototype.isSpecialColor=function(h){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],h)};Graph.prototype.isGlassState=function(h){h= mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null);return"label"==h||"rectangle"==h||"internalStorage"==h||"ext"==h||"umlLifeline"==h||"swimlane"==h||"process"==h||"ellipse"==h||"rhombus"==h};Graph.prototype.isRoundedState=function(h){return null!=h.shape?h.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(h){var k=mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(h.style, mxConstants.STYLE_CURVED,!1)&&("connector"==k||"filledEdge"==k||"wire"==k)};Graph.prototype.isAutoSizeState=function(h){return"1"==mxUtils.getValue(h.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(h){return"1"==mxUtils.getValue(h.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(h){h=this.getCurrentCellStyle(h);return null!=h&&"1"==h.autosizeText};Graph.prototype.isImageState=function(h){return null!=mxUtils.getValue(h.style,mxConstants.STYLE_IMAGE, null)};Graph.prototype.isShadowState=function(h){return!0};Graph.prototype.getVerticesAndEdges=function(h,k){h=null!=h?h:!0;k=null!=k?k:!0;var p=this.model;return p.filterDescendants(function(l){return h&&p.isVertex(l)||k&&p.isEdge(l)},p.getRoot())};Graph.prototype.applyNewEdgeStyle=function(h,k,p){h=this.getCellStyle(h).newEdgeStyle;if(null!=h){this.model.beginUpdate();try{var l=Graph.decodeNewEdgeStyle(h),u;for(u in l)this.setCellStyles(u,l[u],k),"edgeStyle"==u&&"elbowEdgeStyle"==l[u]&&null!=p&& this.setCellStyles("elbow",p==mxConstants.DIRECTION_SOUTH||p==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",k)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(p=0;p<k.length;p++){var x=this.model.getTerminal(k[p],!0);null!=x&&x==this.model.getTerminal(k[p],!1)&&this.applyLoopStyle(k[p],x)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(h,k){var p=this.getCellGeometry(k);k=this.getCellGeometry(h);if(null!=p&&null!=k){var l=this.gridSize,u=p.x+p.width+ 4*l;p=p.y+p.height/2;k=k.clone();k.points=[new mxPoint(u,p-2*l),new mxPoint(u,p+2*l)];this.model.beginUpdate();try{this.model.setGeometry(h,k),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[h]),this.setCellStyles("innerLoopWaypoints","1",[h])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(h){var k=null!=h?h.getVisibleTerminalState(!0):null;if(null==k||0==k.width||0==k.height)return null;var p=h.view;if(null==p.getPerimeterFunction(k))return null;var l= k.getCenterX(),u=k.getCenterY(),x=Math.max(k.width,k.height)+100;h=p.getPerimeterPoint(k,new mxPoint(l+x,u),!1);var v=p.getPerimeterPoint(k,new mxPoint(l-x,u),!1),z=p.getPerimeterPoint(k,new mxPoint(l,u-x),!1);p=p.getPerimeterPoint(k,new mxPoint(l,u+x),!1);z=null!=z&&null!=p&&Math.abs(z.y-p.y)<k.height/4;return null!=h&&null!=v&&Math.abs(h.x-v.x)<k.width/4?"x":z?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(h){return null!=this.getLoopFixedAxis(h)};Graph.prototype.getLoopAroundPoints= function(h,k){var p=null!=h?h.getVisibleTerminalState(!0):null,l=null!=h?this.getCellGeometry(h.cell):null;if(null==p||null==k||null==l)return null;var u=h.view.scale,x=h.view.translate,v=h.origin,z=p.x/u-x.x-v.x,C=p.y/u-x.y-v.y,F=p.width/u,G=p.height/u,H=new mxPoint(k.x/u-x.x-v.x,k.y/u-x.y-v.y);var J=h.absolutePoints;null!=l.points&&2<=l.points.length?(k=l.points[0],J=l.points[l.points.length-1]):null!=J&&4<=J.length?(k=new mxPoint(J[1].x/u-x.x-v.x,J[1].y/u-x.y-v.y),J=new mxPoint(J[J.length-2].x/ u-x.x-v.x,J[J.length-2].y/u-x.y-v.y)):(k=new mxPoint(z+F/2,C+G/2-this.gridSize),J=new mxPoint(z+F/2,C+G/2+this.gridSize));l=Math.abs(k.x-J.x)>=Math.abs(k.y-J.y);k=Math.max(this.gridSize,l?Math.abs(k.x-J.x):Math.abs(k.y-J.y));var O=this.gridSize;J=this.loopHasFixedAnchorLine(h);var M=h.absolutePoints;M=null!=M&&null!=M[0]?new mxPoint(M[0].x/u-x.x-v.x,M[0].y/u-x.y-v.y):null;if(J&&null!=M){if(l)return C=H.y>=M.y?Math.max(M.y+O,H.y):Math.min(M.y-O,H.y),[new mxPoint(H.x-k/2,C),new mxPoint(H.x+k/2,C)]; M=H.x>=M.x?Math.max(M.x+O,H.x):Math.min(M.x-O,H.x);return[new mxPoint(M,H.y-k/2),new mxPoint(M,H.y+k/2)]}var V=z+F/2,Q=C+G/2,ma=function(ia,na,Z){ia=h.view.getPerimeterPoint(p,new mxPoint((ia+x.x+v.x)*u,(na+x.y+v.y)*u),Z);return null!=ia?new mxPoint(ia.x/u-x.x-v.x,ia.y/u-x.y-v.y):null};l=function(ia,na,Z,da){ia=ma(ia,na,!0);Z=ma(Z,da,!0);return null==ia||null==Z||2>Math.abs(ia.x-V)&&2>Math.abs(ia.y-Q)||2>Math.abs(Z.x-V)&&2>Math.abs(Z.y-Q)?!0:Math.abs(ia.x-Z.x)<O/2&&Math.abs(ia.y-Z.y)<O/2};J=ma(H.x, H.y,!1);if(null==J||1>Math.abs(J.x-V)&&1>Math.abs(J.y-Q))J=new mxPoint(V,Q);if(Math.abs(J.y-Q)>=Math.abs(J.x-V)){k=Math.max(this.gridSize,Math.min(k,F));C=J.y>=Q?Math.max(J.y+O,H.y):Math.min(J.y-O,H.y);H=Math.max(z+k/2,Math.min(z+F-k/2,H.x));for(z=0;z<=F/this.gridSize&&l(H-k/2,C,H+k/2,C);z++)H=H<V?Math.min(V,H+this.gridSize):Math.max(V,H-this.gridSize);J=J.y>=Q?this.gridSize:-this.gridSize;for(z=0;z<=(F+G)/this.gridSize&&l(H-k/2,C,H+k/2,C);z++)C+=J;return[new mxPoint(H-k/2,C),new mxPoint(H+k/2,C)]}k= Math.max(this.gridSize,Math.min(k,G));M=J.x>=V?Math.max(J.x+O,H.x):Math.min(J.x-O,H.x);C=Math.max(C+k/2,Math.min(C+G-k/2,H.y));for(z=0;z<=G/this.gridSize&&l(M,C-k/2,M,C+k/2);z++)C=C<Q?Math.min(Q,C+this.gridSize):Math.max(Q,C-this.gridSize);H=J.x>=V?this.gridSize:-this.gridSize;for(z=0;z<=(F+G)/this.gridSize&&l(M,C-k/2,M,C+k/2);z++)M+=H;return[new mxPoint(M,C-k/2),new mxPoint(M,C+k/2)]};Graph.prototype.keepLoopOutsideShape=function(h,k){var p=null!=h?h.getVisibleTerminalState(!0):null;if(null==p|| null==k||0==k.length)return k;var l=h.view.scale,u=h.view.translate,x=h.origin,v=p.x/l-u.x-x.x,z=p.y/l-u.y-x.y,C=p.width/l,F=p.height/l;if(this.loopHasFixedAnchorLine(h))return k;v+=C/2;z+=F/2;F=this.gridSize;C=[];for(var G=0;G<k.length;G++){var H=k[G];if(null==H)C.push(H);else{var J=new mxPoint(H.x,H.y),O=h.view.getPerimeterPoint(p,new mxPoint((H.x+u.x+x.x)*l,(H.y+u.y+x.y)*l),!1);if(null!=O){var M=O.x/l-u.x-x.x;O=O.y/l-u.y-x.y;var V=H.x-v;H=H.y-z;var Q=Math.sqrt(V*V+H*H);Q<Math.sqrt((M-v)*(M-v)+ (O-z)*(O-z))-.5&&(1>Q&&(V=0,Q=H=1),J.x=M+V/Q*F,J.y=O+H/Q*F)}C.push(J)}}return C};Graph.prototype.getCommonStyle=function(h){for(var k={},p=0;p<h.length;p++){var l=this.view.getState(h[p]);null!=l&&this.mergeStyle(l.style,k,0==p)}return k};Graph.prototype.mergeStyle=function(h,k,p){if(null!=h){var l={},u;for(u in h){var x=h[u];null!=x&&(l[u]=!0,null==k[u]&&p?k[u]=x:k[u]!=x&&delete k[u])}for(u in k)l[u]||delete k[u]}};Graph.prototype.getStartEditingCell=function(h,k){k=this.getCellStyle(h);k=parseInt(mxUtils.getValue(k, mxConstants.STYLE_STARTSIZE,0));this.isTable(h)&&(!this.isSwimlane(h)||0==k)&&""==this.getLabel(h)&&0<this.model.getChildCount(h)&&(h=this.model.getChildAt(h,0),k=this.getCellStyle(h),k=parseInt(mxUtils.getValue(k,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(h)&&(!this.isSwimlane(h)||0==k)&&""==this.getLabel(h)&&0<this.model.getChildCount(h))for(k=0;k<this.model.getChildCount(h);k++){var p=this.model.getChildAt(h,k);if(this.isCellEditable(p)){h=p;break}}return h};Graph.prototype.copyStyle= function(h){return this.getCellStyle(h,!1)};Graph.prototype.pasteStyle=function(h,k,p,l){null!=h&&(l||(p=null!=p?p:Graph.cellStyles,Graph.removeKeys(h,function(u){return 0>mxUtils.indexOf(p,u)})),this.updateCellStyles(h,k))};Graph.prototype.copyCellStyles=function(h,k,p,l,u,x,v,z){var C=!1,F=!1;if(0<h.length)for(var G=0;G<h.length&&(C=this.getModel().isVertex(h[G])||C,!(F=this.getModel().isEdge(h[G])||F)||!C);G++);else F=C=!0;C=C&&!x;F=F&&!v;for(G=0;G<k.length;G++)if(h=0<=mxUtils.indexOf(Graph.textStyles, k[G]),"strokeColor"!=k[G]||null!=p[G]&&"none"!=p[G])if(0<=mxUtils.indexOf(Graph.cellStyles,k[G])||"shape"==k[G])if("shape"!=k[G]&&(C||h&&!x)&&!z&&(null==p[G]?delete l[k[G]]:l[k[G]]=p[G]),F||h&&!v)null==p[G]?delete u[k[G]]:u[k[G]]=p[G]};Graph.prototype.includeDescendants=function(h){for(var k=[],p=0;p<h.length;p++)k=k.concat(this.model.getDescendants(h[p]));return k};Graph.prototype.includeDescendantParts=function(h){for(var k=h.slice(),p=mxUtils.bind(this,function(u){for(var x=0;x<this.model.getChildCount(u);x++){var v= this.model.getChildAt(u,x);"1"==mxUtils.getValue(this.getCurrentCellStyle(v),"part","0")&&(k.push(v),p(v))}}),l=0;l<h.length;l++)p(h[l]);return k};Graph.prototype.pasteCellStyles=function(h,k,p,l,u,x){k=null!=k?k:this.currentVertexStyle;p=null!=p?p:this.currentEdgeStyle;u=null!=u?u:this.pasteEdgeStyle;x=null!=x?x:this.pasteStylesToText;this.model.beginUpdate();try{for(var v=0;v<h.length;v++){var z=h[v],C=this.model.getStyle(z),F=!1;null!=z.style&&"string"===typeof z.style&&(pairs=z.style.split(";"), F=F||0<=mxUtils.indexOf(pairs,"text"));var G=this.model.isVertex(z)&&this.model.isEdge(this.model.getParent(z));if(F||G)var H=F&&!G&&x?Graph.cellStyles:Graph.textStyles;else if(H=Graph.cellStyles.slice(),!l)for(var J="string"===typeof C?C.split(";"):[],O=0;O<J.length;O++){var M=J[O],V=M.indexOf("=");if(0<=V){var Q=M.substring(0,V),ma=mxUtils.indexOf(H,Q);0<=ma&&H.splice(ma,1);for(F=0;F<Graph.cellStyleGroups.length;F++){var ia=Graph.cellStyleGroups[F];if(0<=mxUtils.indexOf(ia,Q))for(var na=0;na<ia.length;na++){var Z= mxUtils.indexOf(H,ia[na]);0<=Z&&H.splice(Z,1)}}}}var da=this.model.isEdge(z);F=da||G?p:k;for(O=0;O<H.length;O++){Q=H[O];var pa=F[Q];if("edgeStyle"!=Q||u)if(da||!da&&0>mxUtils.indexOf(Graph.edgeStyles,Q))null!=pa?(C=mxUtils.setStyle(C,Q,pa),"fontFamily"==Q&&null==F.fontSource&&(C=mxUtils.setStyle(C,"fontSource",null)),da&&"rounded"==Q&&"1"==pa&&null==F.curved&&(C=mxUtils.setStyle(C,"curved",null))):l&&(C=mxUtils.setStyle(C,Q,null))}Editor.simpleLabels&&(C=mxUtils.setStyle(mxUtils.setStyle(C,"html", null),"whiteSpace",null));this.model.setStyle(z,C)}}finally{this.model.endUpdate()}return h};Graph.prototype.pasteTextStyles=function(h,k){this.model.beginUpdate();try{for(var p=0;p<h.length;p++){var l=h[p];if(this.model.isVertex(l)||this.model.isEdge(l)){for(var u=this.model.getStyle(l),x=0;x<Graph.pasteTextStyles.length;x++){var v=Graph.pasteTextStyles[x],z=k[v];null!=z&&(u=mxUtils.setStyle(u,v,z),"fontFamily"==v&&null==k.fontSource&&(u=mxUtils.setStyle(u,"fontSource",null)))}Editor.simpleLabels&& (u=mxUtils.setStyle(mxUtils.setStyle(u,"html",null),"whiteSpace",null));this.model.setStyle(l,u)}}}finally{this.model.endUpdate()}return h};Graph.prototype.updateCellStyles=function(h,k){this.model.beginUpdate();try{for(var p=0;p<k.length;p++)if(this.model.isVertex(k[p])||this.model.isEdge(k[p])){var l=this.getCellStyle(k[p],!1),u=l[mxConstants.STYLE_PERIMETER],x=!1;for(z in h){var v=h[z];if(l[z]!=v){if(z==mxConstants.STYLE_SHAPE&&"umlLifeline"==l[z]&&"umlLifeline"!=v){x=!0;var z="participant"}this.setCellStyles(z, v,[k[p]])}}x&&this.setCellStyles(mxConstants.STYLE_PERIMETER,u,[k[p]])}}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(h,k,p,l,u,x){this.useCssTransforms&& (h=h/this.currentScale-this.currentTranslate.x,k=k/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(h,k,p,l,u,x){l=null!=l?l:!0;u=null!=u?u:!0;null==p&&(p=this.getCurrentRoot(),null==p&&(p=this.getModel().getRoot()));if(null!=p)for(var v=this.model.getChildCount(p)-1;0<=v;v--){var z=this.model.getChildAt(p,v),C=this.getScaledCellAt(h,k,z,l,u,x);if(null!=C)return C;if(this.isCellVisible(z)&&(u&&this.model.isEdge(z)|| l&&this.model.isVertex(z))&&(C=this.view.getState(z),null!=C&&(null==x||!x(C,h,k))&&this.intersects(C,h,k)))return z}return null};Graph.prototype.isRecursiveVertexResize=function(h){return!this.isSwimlane(h.cell)&&0<this.model.getChildCount(h.cell)&&!this.isCellCollapsed(h.cell)&&"1"==mxUtils.getValue(h.style,"recursiveResize","1")&&null==mxUtils.getValue(h.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(h){for(var k=this.getCellGeometry(h);null!=k&&k.relative;)h=this.getModel().getParent(h), k=this.getCellGeometry(h);return h};Graph.prototype.isPart=function(h){return"1"==mxUtils.getValue(this.getCurrentCellStyle(h),"part","0")||this.isTableCell(h)||this.isTableRow(h)};Graph.prototype.getCompositeParents=function(h){for(var k=new mxDictionary,p=[],l=0;l<h.length;l++){var u=this.getCompositeParent(h[l]);this.isTableCell(u)&&(u=this.graph.model.getParent(u));this.isTableRow(u)&&(u=this.graph.model.getParent(u));null==u||k.get(u)||(k.put(u,!0),p.push(u))}return p};Graph.prototype.getReferenceTerminal= function(h){if(null!=h){var k=this.getCellGeometry(h);null!=k&&k.relative&&(h=this.model.getParent(h))}null!=h&&this.model.isEdge(h)&&(h=this.model.getParent(h));null!=h&&(h=this.getCompositeParent(h));return h};Graph.prototype.getCompositeParent=function(h){for(;this.isPart(h);){var k=this.model.getParent(h);if(!this.model.isVertex(k))break;h=k}return h};Graph.prototype.orderCells=function(h,k,p){if(null==k){k=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var l=new mxDictionary, u=[],x=0;x<k.length;x++){for(var v=k[x];this.isTableCell(v)||this.isTableRow(v);)v=this.model.getParent(v);l.get(v)||(l.put(v,!0),u.push(v))}k=u}return mxGraph.prototype.orderCells.call(this,h,k,p)};Graph.prototype.filterSelectionCells=function(h){var k=this.getSelectionCells();if(null!=h){for(var p=[],l=0;l<k.length;l++)h(k[l])||p.push(k[l]);k=p}return k};var a=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(h){if(this.useCssTransforms){var k=this.currentScale, p=this.currentTranslate;h=new mxRectangle((h.x+2*p.x)*k-p.x,(h.y+2*p.y)*k-p.y,h.width*k,h.height*k)}a.apply(this,arguments)};Graph.prototype.isCellVisibleInViewport=function(h){h=this.view.getState(h);var k=!1;if(null!=h&&null!=this.container){h=new mxRectangle(h.x,h.y,h.width,h.height);if(this.useCssTransforms){k=this.currentTranslate;var p=this.currentScale;h=new mxRectangle((h.x+k.x)*p,(h.y+k.y)*p,h.width*p,h.height*p)}k=this.container;k=mxUtils.intersects(h,mxUtils.hasScrollbars(k)?new mxRectangle(k.scrollLeft, k.scrollTop,k.clientWidth,k.clientHeight):new mxRectangle(0,0,k.clientWidth,k.clientHeight),!0)}return k};mxCellHighlight.prototype.getStrokeWidth=function(h){h=this.strokeWidth;this.graph.useCssTransforms&&(h/=this.graph.currentScale);return h};mxGraphView.prototype.getGraphBounds=function(){var h=this.graphBounds;if(this.graph.useCssTransforms){var k=this.graph.currentTranslate,p=this.graph.currentScale;h=new mxRectangle((h.x+k.x)*p,(h.y+k.y)*p,h.width*p,h.height*p)}return h};mxGraphView.prototype.viewStateChanged= function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var b=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(h){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);b.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 d=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(h){h=d.apply(this,arguments);for(var k=[],p=0;p<h.length;p++)this.isTableRow(h[p])||this.isTableCell(h[p])||k.push(h[p]);return k};var e=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(h){h=e.apply(this,arguments);for(var k=[],p=0;p<h.length;p++)this.isTable(h[p])||this.isTableRow(h[p])|| this.isTableCell(h[p])||k.push(h[p]);return k};Graph.prototype.updateCssTransform=function(){var h=this.view.getDrawPane();if(null!=h)if(h=h.parentNode,this.useCssTransforms){var k=h.getAttribute("transform");h.setAttribute("transformOrigin","0 0");var p=Math.round(100*this.currentScale)/100,l=Math.round(100*this.currentTranslate.x)/100,u=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=h.style.transition&&(h.style.transition="");h.setAttribute("transform", "scale("+p+","+p+")translate("+l+","+u+")");k!=h.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",h.getAttribute("transform"))}else h.removeAttribute("transformOrigin"),h.removeAttribute("transform")};var g=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var h=this.graph.useCssTransforms,k=this.scale,p=this.translate;h&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate); g.apply(this,arguments);h&&(this.scale=k,this.translate=p)};var c=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(h,k,p){var l=this.useCssTransforms,u=this.view.scale,x=this.view.translate;l&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);c.apply(this,arguments);l&&(this.view.scale=u,this.view.translate=x,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1}; Graph.prototype.labelLinkClicked=function(a,b,d){var e=b.getAttribute("href");e!=Graph.sanitizeLink(e)&&Graph.sanitizeNode(b);if(null!=e&&!this.isCustomLink(e)&&(mxEvent.isLeftMouseButton(d)&&!mxEvent.isPopupTrigger(d)||mxEvent.isTouchEvent(d))){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(e)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(e),a);mxEvent.consume(d)}}; Graph.prototype.openLink=function(a,b,d){var e=window;try{if(a=Graph.sanitizeLink(a),null!=a)if("_self"==b&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=a.charAt(this.baseUrl.length)||"_top"!=b||window!=window.top||navigator.standalone)Editor.suppressNewWindows||(e=window.open(a,null!=b?b:"_blank",d?null:"noopener,noreferrer"),null==e||d||(e.opener=null));else{var g=a.split("#")[1];window.location.hash=="#"+g&&(window.location.hash="");window.location.hash= g}}catch(c){}return e};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(a){return"data:"==a.substring(0,5)};Graph.prototype.customLinkClicked=function(a,b){return!1};Graph.prototype.isExternalProtocol=function(a){return"mailto:"===a.substring(0,7)}; Graph.prototype.isBlankLink=function(a){return!this.isExternalProtocol(a)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(a)&&a.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(a){return null!=a&&!this.absoluteUrlPattern.test(a)&&"data:"!==a.substring(0,5)&&!this.isExternalProtocol(a)}; Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a}; Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(a){return null!=this.graph.getCellStyle(a).childLayout};this.layoutManager.getLayout=function(a,b){var d=this.graph.model.getParent(a);if(!this.graph.isCellCollapsed(a)&&(b!=mxEvent.BEGIN_UPDATE||this.hasLayout(d,b))){b=this.graph.getCellStyle(a);var e=this.graph.isTransparentBounds(a);if("stackLayout"==b.childLayout)return a=new mxStackLayout(this.graph,!0),a.resizeParentMax= !e&&"1"==mxUtils.getValue(b,"resizeParentMax","1"),a.horizontal="1"==mxUtils.getValue(b,"horizontalStack","1"),a.resizeParent=!e&&"1"==mxUtils.getValue(b,"resizeParent","1"),a.resizeLast=!e&&"1"==mxUtils.getValue(b,"resizeLast","0"),a.spacing=b.stackSpacing||a.spacing,a.border=b.stackBorder||a.border,a.marginLeft=b.marginLeft||0,a.marginRight=b.marginRight||0,a.marginTop=b.marginTop||0,a.marginBottom=b.marginBottom||0,a.allowGaps=b.allowGaps||0,a.fill=!e,a.allowGaps&&(a.gridSize=parseFloat(mxUtils.getValue(b, "stackUnitSize",20))),a;if("treeLayout"==b.childLayout)return a=new mxCompactTreeLayout(this.graph),a.horizontal="1"==mxUtils.getValue(b,"horizontalTree","1"),a.resizeParent=!e&&"1"==mxUtils.getValue(b,"resizeParent","1"),a.sortEdges="1"==mxUtils.getValue(b,"sortEdges","0"),a.groupPadding=mxUtils.getValue(b,"parentPadding",20),a.levelDistance=mxUtils.getValue(b,"treeLevelDistance",30),a.maintainParentLocation=!0,a.edgeRouting=!1,a.resetEdges=!1,a;if("flowLayout"==b.childLayout)return a=new mxHierarchicalLayout(this.graph, mxUtils.getValue(b,"flowOrientation",mxConstants.DIRECTION_EAST)),a.resizeParent=!e&&"1"==mxUtils.getValue(b,"resizeParent","1"),a.parentBorder=mxUtils.getValue(b,"parentPadding",20),a.maintainParentLocation=!0,a.intraCellSpacing=mxUtils.getValue(b,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),a.interRankCellSpacing=mxUtils.getValue(b,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),a.interHierarchySpacing=mxUtils.getValue(b,"interHierarchySpacing", mxHierarchicalLayout.prototype.interHierarchySpacing),a.parallelEdgeSpacing=mxUtils.getValue(b,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),a;if("circleLayout"==b.childLayout){a=new mxCircleLayout(this.graph);a.resizeParent=!e&&"1"==mxUtils.getValue(b,"resizeParent","1");var g=parseFloat(mxUtils.getValue(b,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));g=isNaN(g)?mxConstants.DEFAULT_STARTSIZE:g;b="0"==mxUtils.getValue(b,mxConstants.STYLE_HORIZONTAL,"1");a.moveCircle= !0;a.x0=b?g+20:20;a.y0=b?20:g+20;var c=this.graph,h=a.execute;a.execute=function(k){var p=c.getModel(),l=function(){for(var F=null,G=p.getChildCount(k),H=0;H<G;H++){var J=p.getChildAt(k,H);J=p.isVertex(J)?p.getGeometry(J):null;null==J||J.relative||(F=null==F?new mxPoint(J.x,J.y):new mxPoint(Math.min(F.x,J.x),Math.min(F.y,J.y)))}return F},u=e?l():null;h.apply(this,arguments);if(null!=u){var x=l();if(null!=x&&(u.x!=x.x||u.y!=x.y)){var v=p.getChildCount(k);for(l=0;l<v;l++){var z=p.getChildAt(k,l),C= p.isVertex(z)?p.getGeometry(z):null;null==C||C.relative||c.translateCell(z,u.x-x.x,u.y-x.y)}}}u=p.getGeometry(k);if(this.resizeParent&&null!=u){v=x=0;z=p.getChildCount(k);for(l=0;l<z;l++)C=p.getGeometry(p.getChildAt(k,l)),null==C||C.relative||(x=Math.max(x,C.x+C.width),v=Math.max(v,C.y+C.height));0<x&&0<v&&(u.width!=x+20||u.height!=v+20)&&(u=u.clone(),u.width=x+20,u.height=v+20,p.setGeometry(k,u))}};return a}if("organicLayout"==b.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"== b.childLayout)return new TableLayout(this.graph);if(null!=b.childLayout)try{if(g=Graph.decodeChildLayout(b.childLayout),null!=g)return new mxCompositeLayout(this.graph,this.graph.createLayouts(g,{enforceCorners:!1}))}catch(k){null!=window.console&&console.error(k)}}return null};this.layoutManager.executeLayout=function(a,b){this.graph.model.contains(a)&&(b=this.getLayout(a,b?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=b&&(this.graph.isAsyncLayout(b)?this.graph.canExecuteLayoutSync(b)?this.graph.executeLayoutSync(b, a):this.graph.scheduleAsyncLayout(a):b.execute(a)))}};Graph.prototype.getChildLayoutCells=function(a){if(null==this.layoutManager)return[];var b=this.layoutManager;return this.model.filterDescendants(function(d){return b.hasLayout(d)},a)};Graph.prototype.executeAllChildLayouts=function(a){a=this.getChildLayoutCells(a);0<a.length&&this.layoutManager.executeLayoutForCells(a)}; Graph.prototype.canExecuteLayoutSync=function(a){a=a.constructor===mxCompositeLayout&&null!=a.layouts?a.layouts:[a];for(var b=0;b<a.length;b++)if("function"===typeof a[b].prepare&&("function"!==typeof a[b].executeSync||"function"===typeof a[b].canExecuteSync&&!a[b].canExecuteSync()))return!1;return!0}; Graph.prototype.executeLayoutSync=function(a,b){a=a.constructor===mxCompositeLayout&&null!=a.layouts?a.layouts:[a];for(var d=0;d<a.length;d++)try{"function"===typeof a[d].prepare&&"function"===typeof a[d].executeSync?a[d].executeSync(b):a[d].execute(b)}catch(e){null!=window.console&&console.error(e)}}; Graph.prototype.isAsyncLayout=function(a){if(null==a)return!1;if("function"===typeof a.prepare)return!0;if(a.constructor===mxCompositeLayout&&null!=a.layouts)for(var b=0;b<a.layouts.length;b++)if("function"===typeof a.layouts[b].prepare)return!0;return!1}; Graph.prototype.scheduleAsyncLayout=function(a){null==a||this.destroyed||null!=this.asyncLayoutsApplying&&this.asyncLayoutsApplying[a.id]||(null!=this.asyncLayoutsRunning&&null!=this.asyncLayoutsRunning[a.id]?this.asyncLayoutsRunning[a.id]="dirty":(this.pendingAsyncLayouts=this.pendingAsyncLayouts||[],0>mxUtils.indexOf(this.pendingAsyncLayouts,a)&&this.pendingAsyncLayouts.push(a),this.asyncLayoutsScheduled||(this.asyncLayoutsScheduled=!0,window.setTimeout(mxUtils.bind(this,function(){this.asyncLayoutsScheduled= !1;var b=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var d=function(c){for(var h=0;null!=c;)h++,c=c.parent;return h};b.sort(function(c,h){return d(h)-d(c)});var e=0,g=mxUtils.bind(this,function(){e<b.length&&this.runAsyncLayout(b[e++],g)});g()}),0))))}; Graph.prototype.runAsyncLayout=function(a,b){var d=this.getModel();b=null!=b?b:function(){};if(this.destroyed||null==this.layoutManager||!d.contains(a)||this.isCellCollapsed(a))b();else{var e=this.layoutManager.getLayout(a,mxEvent.END_UPDATE);if(null!=e&&this.isAsyncLayout(e)){var g=e.constructor===mxCompositeLayout&&null!=e.layouts?e.layouts:[e];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[a.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var c= this,h=0,k=function(u){c.asyncLayoutsApplying[a.id]=!0;d.beginUpdate();try{u()}finally{d.endUpdate(),delete c.asyncLayoutsApplying[a.id]}},p=function(){var u="dirty"==c.asyncLayoutsRunning[a.id];delete c.asyncLayoutsRunning[a.id];u&&c.scheduleAsyncLayout(a);b()},l=function(){if(h>=g.length||c.destroyed||!d.contains(a))p();else{var u=g[h++];try{"function"===typeof u.prepare?u.prepare(a,function(x,v){if(null==x&&null!=v&&!c.destroyed&&d.contains(a))try{k(v)}catch(z){null!=window.console&&console.error(z)}else null!= x&&null!=window.console&&console.error(x);l()}):(k(function(){u.execute(a)}),l())}catch(x){null!=window.console&&console.error(x),l()}}};l()}else b()}};Graph.encodeChildLayout=function(a){return encodeURIComponent(JSON.stringify(a))};Graph.decodeChildLayout=function(a){return null!=a&&(a=String(a),"%"==a.charAt(0)&&(a=decodeURIComponent(a)),"["==a.charAt(0))?JSON.parse(a):null}; Graph.decodeNewEdgeStyle=function(a){return null!=a?(a=String(a),"%"==a.charAt(0)&&(a=decodeURIComponent(a)),JSON.parse(a)):null}; Graph.prototype.createLayouts=function(a,b){for(var d=[],e=0;e<a.length;e++){var g=a[e].layout,c=a[e].config;if("string"===typeof Graph.elkLayoutAlgorithms[g]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[g]));c=Graph.elkConfigToOptions(c);if(null!=b)for(var h in b)c.options[h]=b[h];d.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[g],c.layoutOptions,c.options))}else if("undefined"!==typeof LibavoidRouting&&g===LibavoidRouting.LAYOUT_NAME)d.push(LibavoidRouting.createLayout(this, c));else if(0<=mxUtils.indexOf(Graph.layoutNames,g)){var k="mxOrgChartLayout"==g&&null!=c?new window[g](this,c.branchOptimizer):new window[g](this);if(null!=c)for(h in c)"function"===typeof k[h]||"__proto__"==h||"constructor"==h||"prototype"==h||"mxOrgChartLayout"==g&&"branchOptimizer"==h||(k[h]=c[h]);d.push(k)}else throw Error(mxResources.get("invalidCallFnNotFound",[g]));}return d}; Graph.elkConfigToOptions=function(a){var b={},d={};if(null!=a)for(var e in a)0===e.indexOf("elk.")?b[e]=a[e]:"edgeStyle"===e?d.edgeStyleMode=a[e]:"corners"===e?d.corners=a[e]:"resizeNodes"===e?(d.applierOptions=d.applierOptions||{},d.applierOptions.resizeParent=!!a[e]):"preserveOrigin"===e||"useViewStateSizing"===e||"respectFixedPosition"===e||"mermaidPolicy"===e||"includeEdgeLabels"===e||"includeVertexLabels"===e||"portSpread"===e||"resizeLayoutRoot"===e||"extractIsolated"===e||"sharedStems"===e|| "nonTreeEdges"===e||"groupPadding"===e?d[e]=a[e]:"rootCellIds"===e&&(d.rootCellIds=a[e]);return{layoutOptions:b,options:d}}; Graph.elkOptionsToConfig=function(a,b){var d={};if(null!=a)for(var e in a)d[e]=a[e];null!=b&&(null!=b.edgeStyleMode&&"auto"!==b.edgeStyleMode&&(d.edgeStyle=b.edgeStyleMode),null!=b.corners&&"keep"!==b.corners&&(d.corners=b.corners),null!=b.applierOptions&&null!=b.applierOptions.resizeParent&&(d.resizeNodes=!0===b.applierOptions.resizeParent),!0===b.preserveOrigin&&(d.preserveOrigin=!0),!1===b.sharedStems&&(d.sharedStems=!1),"elk"===b.nonTreeEdges&&(d.nonTreeEdges="elk"),null!=b.groupPadding&&(d.groupPadding= b.groupPadding),null!=b.rootCellIds&&0<b.rootCellIds.length&&(d.rootCellIds=b.rootCellIds.slice()));return d};Graph.prototype.getDataForCells=function(a,b){for(var d=[],e=0;e<a.length;e++){var g={};g.id=a[e].id;var c=null!=a[e].value?a[e].value.attributes:null;this.isReplacePlaceholders(a[e])&&b&&(g.value=this.getLabel(a[e]));if(null!=c)for(var h=0;h<c.length;h++)g[c[h].nodeName]=c[h].nodeValue;else g.label=this.convertValueToString(a[e]);d.push(g)}return d}; Graph.prototype.getNodesForCells=function(a){for(var b=[],d=0;d<a.length;d++){var e=this.view.getState(a[d]);if(null!=e){for(var g=this.cellRenderer.getShapesForState(e),c=0;c<g.length;c++)null!=g[c]&&null!=g[c].node&&b.push(g[c].node);null!=e.control&&null!=e.control.node&&b.push(e.control.node)}}return b}; Graph.prototype.createWipeAnimations=function(a,b){for(var d=[],e=0;e<a.length;e++){var g=this.view.getState(a[e]);null!=g&&null!=g.shape&&(this.model.isEdge(g.cell)&&null!=g.absolutePoints&&1<g.absolutePoints.length?d.push(this.createEdgeWipeAnimation(g,b)):this.model.isVertex(g.cell)&&null!=g.shape.bounds&&d.push(this.createVertexWipeAnimation(g,b)))}return d}; Graph.prototype.createEdgeWipeAnimation=function(a,b){var d=a.absolutePoints.slice(),e=a.segments,g=a.length,c=d.length;return{execute:mxUtils.bind(this,function(h,k){if(null!=a.shape){var p=[d[0]];k=h/k;b||(k=1-k);for(var l=g*k,u=1;u<c;u++)if(l<=e[u-1]){p.push(new mxPoint(d[u-1].x+(d[u].x-d[u-1].x)*l/e[u-1],d[u-1].y+(d[u].y-d[u-1].y)*l/e[u-1]));break}else l-=e[u-1],p.push(d[u]);a.shape.points=p;a.shape.redraw();0==h&&Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),1);null!=a.text&&null!= a.text.node&&(a.text.node.style.opacity=k)}}),stop:mxUtils.bind(this,function(){null!=a.shape&&(a.shape.points=d,a.shape.redraw(),null!=a.text&&null!=a.text.node&&(a.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),b?1:0))})}}; Graph.prototype.createVertexWipeAnimation=function(a,b){var d=new mxRectangle.fromRectangle(a.shape.bounds);return{execute:mxUtils.bind(this,function(e,g){null!=a.shape&&(g=e/g,b||(g=1-g),a.shape.bounds=new mxRectangle(d.x,d.y,d.width*g,d.height),a.shape.redraw(),0==e&&Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),1),null!=a.text&&null!=a.text.node&&(a.text.node.style.opacity=g))}),stop:mxUtils.bind(this,function(){null!=a.shape&&(a.shape.bounds=d,a.shape.redraw(),null!=a.text&&null!=a.text.node&& (a.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),b?1:0))})}}; Graph.prototype.createVertexPopAnimation=function(a,b){var d=new mxRectangle.fromRectangle(a.shape.bounds),e=d.getCenterX(),g=d.getCenterY();return{execute:mxUtils.bind(this,function(c,h){if(null!=a.shape){h=c/h;b||(h=1-h);var k=1-Math.exp(-5*h)*Math.cos(5*Math.PI*h);a.shape.bounds=new mxRectangle(e-d.width*k/2,g-d.height*k/2,d.width*k,d.height*k);a.shape.redraw();0==c&&Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),1);null!=a.text&&null!=a.text.node&&(a.text.node.style.opacity=Math.min(1, 3*h))}}),stop:mxUtils.bind(this,function(){null!=a.shape&&(a.shape.bounds=d,a.shape.redraw(),null!=a.text&&null!=a.text.node&&(a.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([a.cell]),b?1:0))})}}; Graph.prototype.createPopAnimations=function(a,b){for(var d=[],e=0;e<a.length;e++){var g=this.view.getState(a[e]);null!=g&&null!=g.shape&&(this.model.isEdge(g.cell)&&null!=g.absolutePoints&&1<g.absolutePoints.length?d.push(this.createEdgeWipeAnimation(g,b)):this.model.isVertex(g.cell)&&null!=g.shape.bounds&&d.push(this.createVertexPopAnimation(g,b)))}return d}; Graph.prototype.executeAnimations=function(a,b,d,e){d=null!=d?d:30;e=null!=e?e:30;var g=null,c=0,h=mxUtils.bind(this,function(){if(c==d||this.stoppingCustomActions){window.clearInterval(g);for(var k=0;k<a.length;k++)a[k].stop();null!=b&&b()}else for(k=0;k<a.length;k++)a[k].execute(c,d);c++});g=window.setInterval(h,e);h()}; Graph.prototype.executeAnimationsStepped=function(a,b,d,e){b=null!=b?b:30;var g=0,c=mxUtils.bind(this,function(){if(g<=b){for(var h=0;h<a.length;h++)a[h].execute(g,b);d(g,b,function(){g++;c()})}else{for(h=0;h<a.length;h++)a[h].stop();null!=e&&e()}});c()};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(a,b,d){a=null!=a?a:this.getGraphBounds();b=null!=b?b:this.view.translate;d=null!=d?d:this.view.scale;var e=this.getPageSize();if(0==a.width||0==a.height)return new mxRectangle(0,0,1,1);var g=Math.floor(Math.ceil(a.x/d-b.x)/e.width),c=Math.floor(Math.ceil(a.y/d-b.y)/e.height);return new mxRectangle(g,c,Math.ceil((Math.floor((a.x+a.width)/d)-b.x)/e.width)-g,Math.ceil((Math.floor((a.y+a.height)/d)-b.y)/e.height)-c)}; Graph.prototype.getDefaultTranslate=function(a){var b=this.getPagePadding(),d=this.getPageSize();return new mxPoint(b.x-a.x*d.width,b.y-a.y*d.height)};Graph.prototype.updateMinimumSize=function(){var a=this.getPageLayout(),b=this.getPagePadding(),d=this.getPageSize(),e=Math.ceil(2*b.x+a.width*d.width);a=Math.ceil(2*b.y+a.height*d.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=e||this.minimumGraphSize.height!=a)this.minimumGraphSize=new mxRectangle(0,0,e,a)}; Graph.prototype.sanitizeHtml=function(a,b){return Graph.sanitizeHtml(a,b)};Graph.prototype.updatePlaceholders=function(){var a=!1,b;for(b in this.model.cells){var d=this.model.cells[b];this.isReplacePlaceholders(d)&&(this.view.invalidate(d,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")}; Graph.prototype.isZoomWheelEvent=function(a){return Graph.zoomWheel&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)&&(!mxEvent.isControlDown(a)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(a)||mxEvent.isControlDown(a))};Graph.prototype.isScrollWheelEvent=function(a){return!this.isZoomWheelEvent(a)};Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a)}; Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isAltDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isControlDown(a)&&!mxEvent.isMetaDown(a)};Graph.prototype.isEdgeIgnored=function(a){var b=!1;null!=a&&(a=this.getCurrentCellStyle(a),b="1"==mxUtils.getValue(a,"ignoreEdge","0"));return b}; Graph.prototype.isSplitTarget=function(a,b,d){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(d)&&!mxEvent.isShiftDown(d)&&!this.isCellLocked(this.getLayerForCell(a))&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b}; Graph.prototype.isLabelMovable=function(a){var b=this.getCurrentCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(a){this.defaultParent=a;this.fireEvent(new mxEventObject("defaultParentChanged"))}; Graph.prototype.getClickableLinkForCell=function(a){do{var b=this.getLinkForCell(a);if(null!=b)return b;a=this.model.getParent(a)}while(null!=a);return null};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b}; Graph.prototype.formatDate=function(a,b,d){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 e=this.dateFormatCache,g=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,c=/[^-+\dA-Z]/g,h=function(H,J){H=String(H);for(J=J||2;H.length<J;)H="0"+H;return H};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| /\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(e.masks[b]||b||e.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),d=!0);var k=d?"getUTC":"get",p=a[k+"Date"](),l=a[k+"Day"](),u=a[k+"Month"](),x=a[k+"FullYear"](),v=a[k+"Hours"](),z=a[k+"Minutes"](),C=a[k+"Seconds"]();k=a[k+"Milliseconds"]();var F=d?0:a.getTimezoneOffset(),G={d:p,dd:h(p),ddd:e.i18n.dayNames[l],dddd:e.i18n.dayNames[l+7],m:u+1,mm:h(u+1),mmm:e.i18n.monthNames[u],mmmm:e.i18n.monthNames[u+ 12],yy:String(x).slice(2),yyyy:x,h:v%12||12,hh:h(v%12||12),H:v,HH:h(v),M:z,MM:h(z),s:C,ss:h(C),l:h(k,3),L:h(99<k?Math.round(k/10):k),t:12>v?"a":"p",tt:12>v?"am":"pm",T:12>v?"A":"P",TT:12>v?"AM":"PM",Z:d?"UTC":(String(a).match(g)||[""]).pop().replace(c,""),o:(0<F?"-":"+")+h(100*Math.floor(Math.abs(F)/60)+Math.abs(F)%60,4),S:["th","st","nd","rd"][3<p%10?0:(10!=p%100-p%10)*p%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in G?G[H]:H.slice(1, H.length-1)})};Graph.prototype.getLayerForCell=function(a){for(;null!=a&&!this.model.isLayer(a);)a=this.model.getParent(a);return a};Graph.prototype.getLayerForCells=function(a){var b=null;if(0<a.length){b=this.getLayerForCell(a[0]);for(var d=1;d<a.length;d++)if(!this.model.isAncestor(b,a[d])){b=null;break}}return b}; Graph.prototype.createLayersDialog=function(a,b){var d=document.createElement("div");d.style.position="absolute";for(var e=this.getModel(),g=e.getChildCount(e.root),c=0;c<g;c++)mxUtils.bind(this,function(h){function k(){e.isVisible(h)?(u.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(l,75)):(u.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(l,25))}var p=this.convertValueToString(h)||mxResources.get("background")||"Background",l=document.createElement("div");l.style.overflow= "hidden";l.style.textOverflow="ellipsis";l.style.padding="2px";l.style.whiteSpace="nowrap";l.style.cursor="pointer";l.setAttribute("title",mxResources.get(e.isVisible(h)?"hideIt":"show",[p]));var u=document.createElement("img");u.setAttribute("draggable","false");u.setAttribute("align","absmiddle");u.setAttribute("border","0");u.style.position="relative";u.style.width="16px";u.style.padding="0px 6px 0 4px";b&&(u.style.filter="invert(100%)",u.style.top="-2px");l.appendChild(u);mxUtils.write(l,p);d.appendChild(l); mxEvent.addListener(l,"click",function(){e.setVisible(h,!e.isVisible(h));k();null!=a&&a(h)});k()})(e.getChildAt(e.root,c));return d}; Graph.prototype.replacePlaceholders=function(a,b,d,e){e=[];if(null!=b){for(var g,c=0;g=this.placeholderPattern.exec(b);){var h=g[0];if(2<h.length&&"%label%"!=h&&"%tooltip%"!=h){var k=null;if(g.index>c&&"%"==b.charAt(g.index-1))k=h.substring(1);else{var p=h.substring(1,h.length-1),l={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==p)k=a.id;else if("width"===p.substring(0,5)&&this.model.isVertex(a)){var u=this.getCellGeometry(a);null!=u&&(k=u.width, 5<p.length&&(k=Editor.toUnit(k,l[p.substring(6)])))}else if("height"==p.substring(0,6)&&this.model.isVertex(a))u=this.getCellGeometry(a),null!=u&&(k=u.height,6<p.length&&(k=Editor.toUnit(k,l[p.substring(7)])));else if("length"==p.substring(0,6)){for(u=a;null!=u&&!this.model.isEdge(u);)u=this.model.getParent(u);u=this.view.getState(u);null!=u&&(k=Math.round(u.length/this.view.scale),6<p.length&&(k=Editor.toUnit(k,l[p.substring(7)])))}else if(0>p.indexOf("{"))for(l=a;null==k&&null!=l;)null!=l.value&& "object"==typeof l.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(k=l.getAttribute(p+"_"+Graph.diagramLanguage)),null==k&&(k=l.hasAttribute(p)?null!=l.getAttribute(p)?l.getAttribute(p):"":null)),l=this.model.getParent(l);null==k&&("pagecount"==p.substring(0,9)&&9<p.length||"pagenumber"==p.substring(0,10)&&10<p.length?(l=p.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=l&&(k=this.getGlobalVariable(l[1]),3<l.length&&(u=parseInt(l[3]),k+="+"==l[2]?u:-u))):k=this.getGlobalVariable(p)); null==k&&null!=d&&(k=d[p])}e.push(b.substring(c,g.index)+(null!=k?k:h));c=g.index+h.length}}e.push(b.substring(c))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var b=[],d=0;d<a.length;d++){var e=this.model.getCell(a[d].id);null!=e&&b.push(e)}this.setSelectionCells(b)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(a){return null!=a&&"1"==mxUtils.getValue(this.getCurrentCellStyle(a),"lockedGroup","0")}; Graph.prototype.hasLockedGroupStyle=function(a){return null!=a&&null!=this.getCurrentCellStyle(a).lockedGroup};Graph.prototype.isLockedGroupIconVisible=function(a){if(null==a)return!1;var b=this.getCurrentCellStyle(a).lockedGroupIcon;return"0"==b?!1:"1"==b?!0:this.hasLockedGroupStyle(a)};Graph.prototype.isEditIconVisible=function(a){return null!=a&&"1"==mxUtils.getValue(this.getCurrentCellStyle(a),"editIcon","0")}; Graph.prototype.getLockedGroupAncestor=function(a){for(;null!=a;){if(this.isLockedGroup(a))return a;a=this.model.getParent(a)}return null};Graph.prototype.getLockedGroupStyleAncestor=function(a){for(;null!=a;){if(this.hasLockedGroupStyle(a))return a;a=this.model.getParent(a)}return null}; Graph.prototype.selectCellForEvent=function(a,b){var d=this.getLockedGroupAncestor(this.model.getParent(a));null!=d&&(a=d);null==a||this.isToggleEvent(b)||1!=this.getSelectionCount()||(d=this.getSelectionCell(),null==d||d!=a&&!this.model.isAncestor(a,d)||(d=this.model.getParent(a),null!=d&&this.isTransparentBounds(d)&&(a=d)));mxEvent.isShiftDown(b)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),a)||mxGraph.prototype.selectCellForEvent.apply(this,[a,b])}; Graph.prototype.selectTableRange=function(a,b){var d=!1;if(this.isTableCell(a)&&this.isTableCell(b)){var e=this.model.getParent(a),g=this.model.getParent(e),c=this.model.getParent(b);if(g==this.model.getParent(c)){a=e.getIndex(a);e=g.getIndex(e);var h=c.getIndex(b),k=g.getIndex(c);c=Math.max(e,k);b=Math.min(a,h);a=Math.max(a,h);h=[];for(e=Math.min(e,k);e<=c;e++){k=this.model.getChildAt(g,e);for(var p=b;p<=a;p++)h.push(this.model.getChildAt(k,p))}0<h.length&&(1<h.length||1<this.getSelectionCount()|| !this.isCellSelected(h[0]))&&(this.setSelectionCells(h),d=!0)}}return d}; Graph.prototype.snapCellsToGrid=function(a,b){this.getModel().beginUpdate();try{for(var d=0;d<a.length;d++){var e=a[d],g=this.getCellGeometry(e);if(null!=g){g=g.clone();if(this.getModel().isVertex(e))g.x=Math.round(g.x/b)*b,g.y=Math.round(g.y/b)*b,g.width=Math.round(g.width/b)*b,g.height=Math.round(g.height/b)*b;else if(this.getModel().isEdge(e)&&null!=g.points)for(var c=0;c<g.points.length;c++)g.points[c].x=Math.round(g.points[c].x/b)*b,g.points[c].y=Math.round(g.points[c].y/b)*b;this.getModel().setGeometry(e, g)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(a){this.model.beginUpdate();try{for(var b=this.model.getChildCount(a);0<=b;b--)this.model.remove(this.model.getChildAt(a,b))}finally{this.model.endUpdate()}}; Graph.prototype.updateShapes=function(a,b,d){this.model.beginUpdate();try{var e=this.model.getStyle(a),g=d?this.stylesheet.getCellStyle(e,{},!1):null;null!=g&&null==g[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(a)?g[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(a)&&(g[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var c=0;c<b.length;c++){if(this.model.isVertex(a)&&this.model.isVertex(b[c])|| this.model.isEdge(a)&&this.model.isEdge(b[c]))if(d){var h=this.model.getStyle(b[c]);if("string"===typeof h){var k=h.split(";");0<k.length&&0>k[0].indexOf("=")&&(k=k.slice(1));this.model.setStyle(b[c],k.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[b[c]]);this.setCellStyles("points",null,[b[c]]);this.pasteStyle(g,[b[c]],null,!0)}else g=this.copyStyle(b[c]),this.model.setStyle(b[c],e),this.pasteStyle(g,[b[c]]);"1"==mxUtils.getValue(this.getCellStyle(b[c],!1),"composite","0")&&this.removeChildCells(b[c]); if(this.model.isVertex(a)&&this.model.isVertex(b[c])&&0<this.model.getChildCount(a)&&b[c]!=a){this.removeChildCells(b[c]);var p=this.getCellGeometry(a),l=this.getCellGeometry(b[c]);null!=p&&null!=l&&(l=l.clone(),l.relative||(l.x=Math.round(l.getCenterX()-p.width/2),l.y=Math.round(l.getCenterY()-p.height/2)),l.width=p.width,l.height=p.height,this.model.setGeometry(b[c],l));for(var u=this.cloneCells(this.model.getChildCells(a)),x=0;x<u.length;x++)this.model.add(b[c],u[x])}}}finally{this.model.endUpdate()}}; Graph.prototype.updateEdgeLabelShape=function(a,b,d){d=null!=d?d:3;var e=this.copyStyle(b),g=b;this.model.beginUpdate();try{if(this.model.isEdge(b)){var c=this.model.getValue(b),h=c;null!=c&&"object"==typeof c?(h=this.convertValueToString(b),c=c.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&c.hasAttribute("label_"+Graph.diagramLanguage)?c.setAttribute("label_"+Graph.diagramLanguage,""):c.setAttribute("label","")):c="";var k=this.getCellGeometry(b);g=new mxCell(h,new mxGeometry(0, 0,0,0),"");g.geometry.relative=!0;g.vertex=!0;null!=k&&(g.geometry.x=k.x,g.geometry.y=k.y,null!=k.offset&&(g.geometry.offset=k.offset.clone()));g=this.addCell(g,b);this.model.setValue(b,c)}this.updateShapes(a,[g],!0);this.pasteStyle(e,[g],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[g]);var p=this.getCellGeometry(g),l=this.getPreferredSizeForCell(g,null,!1);if(null!=p&&null!=l){var u=l.width+2*d,x=l.height+ 2*d;p=p.clone();var v=null!=p.offset?p.offset:new mxPoint(0,0);p.offset=new mxPoint(Math.round(v.x+(p.width-u)/2),Math.round(v.y+(p.height-x)/2));p.width=u;p.height=x;this.model.setGeometry(g,p)}}finally{this.model.endUpdate()}return g};Graph.prototype.selectCellsForConnectVertex=function(a,b,d){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),this.scrollCellToVisible(a[1]),null!=d&&(mxEvent.isTouchEvent(b)?d.update(d.getState(this.view.getState(a[1]))):d.reset())):this.setSelectionCells(a)}; Graph.prototype.isCloneConnectSource=function(a){var b=null;null!=this.layoutManager&&(b=this.layoutManager.getLayout(this.model.getParent(a)));return this.isTableRow(a)||this.isTableCell(a)||null!=b&&b.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(a,b){for(var d=b;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=a.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==a.parent&&(b=d.parent.getIndex(d),this.model.add(d.parent,a,b))}; Graph.prototype.connectVertex=function(a,b,d,e,g,c,h,k,p){c=c?c:!1;if(a.geometry.relative&&this.model.isEdge(a.parent))return[];for(;a.geometry.relative&&this.model.isVertex(a.parent);)a=a.parent;var l=this.isCloneConnectSource(a),u=l?a:this.getCompositeParent(a),x=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(u.geometry.x,u.geometry.y);b==mxConstants.DIRECTION_NORTH?(x.x+=u.geometry.width/2,x.y-=d): b==mxConstants.DIRECTION_SOUTH?(x.x+=u.geometry.width/2,x.y+=u.geometry.height+d):(x.x=b==mxConstants.DIRECTION_WEST?x.x-d:x.x+(u.geometry.width+d),x.y+=u.geometry.height/2);var v=this.view.getState(this.model.getParent(a));d=this.view.scale;var z=this.view.translate;u=z.x*d;z=z.y*d;null!=v&&this.model.isVertex(v.cell)&&(u=v.x,z=v.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(x.x+=a.parent.geometry.x,x.y+=a.parent.geometry.y);c=c?null:(new mxRectangle(u+x.x*d,z+x.y*d)).grow(40*d);c=null!= c?this.getCells(0,0,0,0,null,null,c,null,!0):null;v=this.view.getState(a);var C=null,F=null;if(null!=c){c=c.reverse();for(var G=0;G<c.length;G++)if(!this.isCellLocked(c[G])&&!this.model.isEdge(c[G])&&c[G]!=a)if(!this.model.isAncestor(a,c[G])&&this.isContainer(c[G])&&(null==C||c[G]==this.model.getParent(a)))C=c[G];else if(null==F&&this.isCellConnectable(c[G])&&!this.model.isAncestor(c[G],a)&&!this.isSwimlane(c[G])){var H=this.view.getState(c[G]);null==v||null==H||mxUtils.intersects(v,H)||(F=c[G])}}var J= !mxEvent.isShiftDown(e)||mxEvent.isControlDown(e)||g;J&&("1"!=urlParams.sketch||g)&&(b==mxConstants.DIRECTION_NORTH?x.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?x.y+=a.geometry.height/2:x.x=b==mxConstants.DIRECTION_WEST?x.x-a.geometry.width/2:x.x+a.geometry.width/2);var O=[],M=F;F=C;g=mxUtils.bind(this,function(V){if(null==h||null!=V||null==F&&l){this.model.beginUpdate();try{if(null==M&&J){var Q=this.getAbsoluteParent(null!=V?V:a);Q=l?a:this.getCompositeParent(Q);M=null!=V?V:this.duplicateCells([Q], !1)[0];null!=V&&this.addCells([M],this.model.getParent(a),null,null,null,!0);var ma=this.getCellGeometry(M);null!=ma&&(null!=V&&"1"==urlParams.sketch&&(b==mxConstants.DIRECTION_NORTH?x.y-=ma.height/2:b==mxConstants.DIRECTION_SOUTH?x.y+=ma.height/2:x.x=b==mxConstants.DIRECTION_WEST?x.x-ma.width/2:x.x+ma.width/2),ma.x=x.x-ma.width/2,ma.y=x.y-ma.height/2);null!=C?(this.addCells([M],C,null,null,null,!0),F=null):J&&!l&&this.addCells([M],this.getDefaultParent(),null,null,null,!0)}var ia=mxEvent.isControlDown(e)&& mxEvent.isShiftDown(e)&&J||null==F&&l?null:this.insertEdge(this.model.getParent(a),null,"",a,M,this.createCurrentEdgeStyle());null!=ia&&(O.push(ia),this.applyNewEdgeStyle(a,[ia],b),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ia,a));if(null==F&&null!=M&&null!=a.parent&&l&&b==mxConstants.DIRECTION_WEST){var na=a.parent.getIndex(a);this.model.add(a.parent,M,na)}null==F&&null!=M&&O.push(M);null==M&&null!=ia&&ia.geometry.setTerminalPoint(x,!1);null!=ia&&this.fireEvent(new mxEventObject("cellsInserted", "cells",[ia]))}finally{this.model.endUpdate()}}if(null!=k)k(O);else return O});if(null==h&&null==p||null!=M||!J||null==F&&l)return g(M);if(null!=p)return g(p);h(u+x.x*d,z+x.y*d,g)}; Graph.prototype.getIndexableText=function(a){a=null!=a?a:this.model.getDescendants(this.model.root);for(var b=document.createElement("div"),d=[],e,g=0;g<a.length;g++)if(e=a[g],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(b.innerHTML=Graph.sanitizeHtml(this.getLabel(e)),e=mxUtils.extractTextWithWhitespace([b])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&d.push(e);return d.join(" ")}; Graph.prototype.convertValueToString=function(a){var b=this.model.getValue(a);if(null!=b&&"object"==typeof b){var d=null;if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){b=a.getAttribute("placeholder");for(var e=a;null==d&&null!=e;)null!=e.value&&"object"==typeof e.value&&(d=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e)}else d=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(d=b.getAttribute("label_"+Graph.diagramLanguage)), null==d&&(d=b.getAttribute("label")||"");return d||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a,b){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),b||(a=mxUtils.removeJavascriptProtocol(a)),a):null}; Graph.prototype.getLinkTargetForCell=function(a){return null!=a.value&&"object"==typeof a.value?a.value.getAttribute("linkTarget"):null};Graph.prototype.postProcessCellStyle=function(a,b){return this.updateHorizontalStyle(a,this.replaceDefaultColors(a,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))}; Graph.prototype.updateHorizontalStyle=function(a,b){if(null!=a&&null!=b&&null!=this.layoutManager){var d=this.model.getParent(a);this.model.isVertex(d)&&this.isCellCollapsed(a)&&(a=this.layoutManager.getLayout(d),null!=a&&a.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!a.horizontal))}return b}; Graph.prototype.replaceDefaultColors=function(a,b){if(null!=b&&null!=this.shapeBackgroundColor&&null!=this.shapeForegroundColor){a=this.shapeBackgroundColor;var d=this.shapeForegroundColor;this.replaceDefaultColor(b,mxConstants.STYLE_FONTCOLOR,d);this.replaceDefaultColor(b,mxConstants.STYLE_FILLCOLOR,a);this.replaceDefaultColor(b,mxConstants.STYLE_GRADIENTCOLOR,d);this.replaceDefaultColor(b,mxConstants.STYLE_STROKECOLOR,d);this.replaceDefaultColor(b,mxConstants.STYLE_IMAGE_BORDER,d);this.replaceDefaultColor(b, mxConstants.STYLE_IMAGE_BACKGROUND,a);this.replaceDefaultColor(b,mxConstants.STYLE_LABEL_BORDERCOLOR,d);this.replaceDefaultColor(b,mxConstants.STYLE_SWIMLANE_FILLCOLOR,a);this.replaceDefaultColor(b,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,a)}return b};Graph.prototype.replaceDefaultColor=function(a,b,d){null!=a&&null!=d&&"none"!=d&&""!=d&&"default"==a[b]&&(a[b]=this.getDefaultColor(a,b,d))}; Graph.prototype.getDefaultColor=function(a,b,d){b="default"+b.charAt(0).toUpperCase()+b.substring(1);"invert"==a[b]&&(a=mxUtils.getLightDarkColor(d),d="light-dark("+a.dark+", "+a.light+")");return d}; Graph.prototype.setAdaptiveColors=function(a){this.adaptiveColors="default"==a?null:a;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(a=this.view.getDrawPane().ownerSVGElement,null!=a&&(a.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors}; Graph.prototype.updateAlternateBounds=function(a,b,d){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var e=this.layoutManager.getLayout(this.model.getParent(a));null!=e&&e.constructor==mxStackLayout&&(e.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)}; Graph.prototype.moveCellsTo=function(a,b){if(null!=a&&null!=b){for(var d=!0,e=0;e<a.length&&d;e++)d=d&&this.model.isEdge(a[e]);e=null;if(1==a.length&&d){var g=this.getCellGeometry(a[0]);null!=g&&(e=g.getTerminalPoint(!0))}e=null!=e?e:this.getBoundingBoxFromGeometry(a,d);null!=e&&(d=Math.round(this.snap(b.x)),b=Math.round(this.snap(b.y)),this.cellsMoved(a,d-e.x,b-e.y))}};Graph.prototype.isMoveCellsEvent=function(a,b){return mxEvent.isShiftDown(a)||"1"==mxUtils.getValue(b.style,"moveCells","0")}; Graph.prototype.foldCells=function(a,b,d,e,g){b=null!=b?b:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));if(null!=d){this.model.beginUpdate();try{mxGraph.prototype.foldCells.apply(this,arguments);for(var c=0;c<d.length;c++){var h=this.view.getState(d[c]),k=this.getCellGeometry(d[c]);if(null!=h&&null!=k&&("1"!=mxUtils.getValue(h.style,"expandToFront","0")||this.isCellCollapsed(d[c])||this.orderCells(!1,[d[c]]),null!=this.layoutManager)){var p=0,l=0;if(k.alternateBounds)p=k.width- k.alternateBounds.width,l=k.height-k.alternateBounds.height;else{var u=this.useCssTransforms?1:this.view.scale;p=Math.round(k.width-h.width/u);l=Math.round(k.height-h.height/u)}if(0!=l||0!=p){var x=this.model.getParent(d[c]),v=this.layoutManager.getLayout(x);null==v?null!=g&&this.isMoveCellsEvent(g,h)&&this.moveSiblings(h,x,p,l):null!=g&&mxEvent.isAltDown(g)||v.constructor!=mxStackLayout||v.resizeLast||this.resizeParentStacks(x,v,p,l)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(d)}}; Graph.prototype.moveSiblings=function(a,b,d,e){this.model.beginUpdate();try{var g=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<g.length;b++)if(g[b]!=a.cell){var c=this.view.getState(g[b]),h=this.getCellGeometry(g[b]);null!=c&&null!=h&&(h=h.clone(),h.translate(Math.round(d*Math.max(0,Math.min(1,(c.x-a.x)/a.width))),Math.round(e*Math.max(0,Math.min(1,(c.y-a.y)/a.height)))),this.model.setGeometry(g[b],h))}}finally{this.model.endUpdate()}}; Graph.prototype.resizeParentStacks=function(a,b,d,e){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var g=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==g&&!b.resizeLast;){var c=this.getCellGeometry(a),h=this.view.getState(a);null!=h&&null!=c&&(c=c.clone(),b.horizontal?c.width+=d+Math.min(0,h.width/this.view.scale-c.width):c.height+=e+Math.min(0,h.height/this.view.scale-c.height),this.model.setGeometry(a, c));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.getCurrentCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.borderBandSize=8; Graph.prototype.getBorderContainer=function(a,b,d){var e=this.borderBandSize,g=null;if(0<e&&null!=a&&this.model.isVertex(a)){var c=this.getCellGeometry(a);if(null==c||Math.min(c.width,c.height)>3*e)for(a=this.model.getParent(a);null==g&&this.model.isVertex(a);){c=this.view.getState(a);if(null!=c){var h=new mxPoint(b,d),k=mxUtils.getValue(c.style,mxConstants.STYLE_ROTATION,0);0!=k&&(k=mxUtils.toRadians(-k),h=mxUtils.getRotatedPoint(h,Math.cos(k),Math.sin(k),new mxPoint(c.getCenterX(),c.getCenterY()))); if(h.x>=c.x+e&&h.x<=c.x+c.width-e&&h.y>=c.y+e&&h.y<=c.y+c.height-e)break;h.x>=c.x-e&&h.x<=c.x+c.width+e&&h.y>=c.y-e&&h.y<=c.y+c.height+e&&this.isContainer(a)&&!this.isTable(a)&&!this.isTableRow(a)&&!this.isTableCell(a)&&!this.isCellLocked(a)&&this.isCellConnectable(a)&&(g=a)}a=this.model.getParent(a)}}return g};Graph.prototype.isTransparentBounds=function(a){return"1"==this.getCurrentCellStyle(a).transparentBounds}; Graph.prototype.isMoveIconVisible=function(a){var b=this.getCurrentCellStyle(a).moveIcon;return null!=b?"1"==b:this.isTransparentBounds(a)};Graph.prototype.getMoveIconDragCells=function(a){return null}; Graph.prototype.getNestedCornerIconOffset=function(a,b,d,e){for(var g=this.model,c=this.view,h=this.getSelectionCells(),k=new mxDictionary,p=0,l=0;l<h.length;l++){var u=h[l];if(u!=a){for(var x=[u],v=g.getParent(u);null!=v&&v!=a;)x.push(v),v=g.getParent(v);if(v==a)for(v=0;v<x.length;v++){var z=x[v];if(null==k.get(z)&&(k.put(z,!0),(z==u||this.isTransparentBounds(z))&&e(z)&&(z=c.getState(z),null!=z))){z=[[z.x,z.y],[z.x+z.width,z.y],[z.x,z.y+z.height],[z.x+z.width,z.y+z.height]];for(var C=0;C<z.length;C++)if(16> Math.abs(z[C][0]-b)&&16>Math.abs(z[C][1]-d)){p++;break}}}}}return 16*p};Graph.prototype.getNestedTransparentBoundsCount=function(a){if(!this.isTransparentBounds(a))return 0;var b=this.model,d=this,e=0,g=function(c){for(var h=b.getChildCount(c),k=0;k<h;k++){var p=b.getChildAt(c,k);d.isTransparentBounds(p)&&e++;g(p)}};g(a);return e};Graph.prototype.isConnectIconVisible=function(a){a=this.getCurrentCellStyle(a).connectIcon;return null!=a?"1"==a:Editor.showConnectHandle}; Graph.prototype.isSelectParentFirst=function(a){return"1"==this.getCurrentCellStyle(a).selectParentFirst};Graph.prototype.parsePadding=function(a){return mxUtils.parsePadding(a)};Graph.prototype.getTransparentBoundsPadding=function(a){a=this.getCurrentCellStyle(a);return this.parsePadding(mxUtils.getValue(a,mxConstants.STYLE_GROUP_PADDING,0))}; Graph.prototype.invalidateTransparentBoundsAncestors=function(a,b){for(a=b&&null!=a?a:null!=a?this.model.getParent(a):null;null!=a;)this.isTransparentBounds(a)&&this.view.invalidate(a,!1,!0),a=this.model.getParent(a)};var graphProcessChange=Graph.prototype.processChange; Graph.prototype.processChange=function(a){graphProcessChange.apply(this,arguments);a instanceof mxChildChange?(this.invalidateTransparentBoundsAncestors(a.child),this.invalidateTransparentBoundsAncestors(a.previous,!0)):(a instanceof mxGeometryChange||a instanceof mxTerminalChange)&&this.invalidateTransparentBoundsAncestors(a.cell)}; Graph.prototype.getTransparentChildBounds=function(a){for(var b=null,d=this.model.getChildCount(a),e=0;e<d;e++){var g=this.model.getChildAt(a,e),c=null;if(this.model.isVertex(g)){var h=this.getCellGeometry(g);if(null!=h&&!h.relative)if(this.isTransparentBounds(g)){var k=this.getTransparentBounds(g);null!=k&&(c=new mxRectangle(h.x+k.x,h.y+k.y,k.width,k.height))}else c=new mxRectangle(h.x,h.y,h.width,h.height)}else if(this.model.isEdge(g)&&(h=this.getCellGeometry(g),null!=h))for(k=[],null==this.model.getTerminal(g, !0)&&null!=h.getTerminalPoint(!0)&&k.push(h.getTerminalPoint(!0)),null==this.model.getTerminal(g,!1)&&null!=h.getTerminalPoint(!1)&&k.push(h.getTerminalPoint(!1)),null!=h.points&&(k=k.concat(h.points)),h=0;h<k.length;h++)null!=k[h]&&(null==c?c=new mxRectangle(k[h].x,k[h].y,0,0):c.add(new mxRectangle(k[h].x,k[h].y,0,0)));null!=c&&(null==b?b=mxRectangle.fromRectangle(c):b.add(c))}return b}; Graph.prototype.getTransparentBounds=function(a){var b=this.getTransparentChildBounds(a);if(null==b)return null;var d=this.getTransparentBoundsPadding(a),e=this.isSwimlane(a)?this.getActualStartSize(a):new mxRectangle;a=this.getActualFooterSize(a);return new mxRectangle(b.x-d.w-e.x-a.x,b.y-d.n-e.y-a.y,b.width+d.w+d.e+e.x+e.width+a.x+a.width,b.height+d.n+d.s+e.y+e.height+a.y+a.height)}; Graph.prototype.getBoundsForGroup=function(a,b,d){var e=null;if(null!=b)for(var g=0;g<b.length;g++){var c=null;if(this.model.isEdge(b[g]))c=this.getBoundingBoxFromGeometry([b[g]],!0);else if(this.model.isVertex(b[g])){var h=this.getCellGeometry(b[g]);if(null==h||h.relative)continue;if(this.isTransparentBounds(b[g])){var k=this.getTransparentBounds(b[g]);null!=k&&(c=new mxRectangle(h.x+k.x,h.y+k.y,k.width,k.height))}else c=new mxRectangle(h.x,h.y,h.width,h.height)}null!=c&&(null==e?e=c:e.add(c))}null!= e&&(this.isSwimlane(a)&&(a=this.getStartSize(a),e.x-=a.width,e.y-=a.height,e.width+=a.width,e.height+=a.height),null!=d&&(e.x-=d,e.y-=d,e.width+=2*d,e.height+=2*d));return e};Graph.prototype.updateGroupBounds=function(a,b,d,e,g,c,h){if(null!=a){for(var k=[],p=0;p<a.length;p++)this.isTransparentBounds(a[p])||k.push(a[p]);if(k.length<a.length)return mxGraph.prototype.updateGroupBounds.call(this,k,b,d,e,g,c,h),a}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)}; Graph.prototype.getBoundingBoxFromGeometry=function(a,b,d,e){var g=null,c=null;if(null!=a){c=[];for(var h=0;h<a.length;h++){var k=this.model.isVertex(a[h])?this.getCellGeometry(a[h]):null;if(null!=k&&!k.relative&&this.isTransparentBounds(a[h])){var p=this.getTransparentBounds(a[h]);null!=p&&(k=new mxRectangle(k.x+p.x,k.y+p.y,p.width,p.height),null==g?g=k:g.add(k))}else c.push(a[h])}}a=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,c,b,null!=d?d:a,e);null!=a&&(null==g?g=a:g.add(a));return g}; Graph.prototype.isCellConnectable=function(a){var b=this.getCurrentCellStyle(a);return!this.isCellLocked(this.getLayerForCell(a))&&(null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};Graph.prototype.isLabelMovable=function(a){var b=this.getCurrentCellStyle(a);return null!=b.movableLabel?"0"!=b.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)}; Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,b,d){d=d||this.getDefaultParent();this.isCellLocked(d)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,d){var e=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(e)&&(e=null);return e}; Graph.prototype.isCellFoldable=function(a){var b=this.getCurrentCellStyle(a);return this.foldingEnabled&&!this.isTransparentBounds(a)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&("1"==b.treeFolding||!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()}; Graph.prototype.zoom=function(a,b){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.getZoomSteps=function(){if(null==this.zoomSteps||this.zoomStepsFactor!=this.zoomFactor){for(var a=[1],b=20;1<b;)b=Math.max(Math.min(Math.round(b/this.zoomFactor),b-1),1),a.splice(0,0,b/20);for(b=20;3200>b;)b=Math.min(Math.max(Math.round(b*this.zoomFactor),b+1),3200),a.push(b/20);this.zoomSteps=a;this.zoomStepsFactor=this.zoomFactor}return this.zoomSteps}; Graph.prototype.getZoomStep=function(a,b){var d=this.getZoomSteps(),e=b?d[d.length-1]:d[0];if(b)for(b=0;b<d.length;b++){if(d[b]>a+1E-6){e=d[b];break}}else for(b=d.length-1;0<=b;b--)if(d[b]<a-1E-6){e=d[b];break}return e};Graph.prototype.zoomIn=function(){this.zoom(this.getZoomStep(this.view.scale,!0)/this.view.scale)};Graph.prototype.zoomOut=function(){this.zoom(this.getZoomStep(this.view.scale,!1)/this.view.scale)}; Graph.prototype.fitPages=function(a,b){var d=1;null==a&&(d=this.getPageLayout(),a=d.width,d=d.height);var e=this.pageScale,g=this.pageFormat,c=this.container.clientHeight-10;a=(this.container.clientWidth-10)/(a*g.width)/e;this.zoomTo(Math.floor(20*(b?a:Math.min(a,c/(d*g.height)/e)))/20);mxUtils.hasScrollbars(this.container)&&(a=this.getPagePadding(),this.container.scrollLeft=Math.min(a.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),b||(this.container.scrollTop=Math.min(a.y* this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))}; Graph.prototype.fitWindow=function(a,b,d,e,g){b=null!=b?b:10;var c=this.container.clientWidth-b,h=this.container.clientHeight-b,k=Math.floor(20*Math.min(c/a.width,h/a.height))/20;null!=d&&(k=Math.min(k,d));if(!e||k<d)this.zoomTo(k,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(d=this.view.translate,this.container.scrollLeft=(a.x+d.x)*this.view.scale-Math.max((c-a.width*this.view.scale)/2+b/2,0),this.container.scrollTop=(a.y+d.y)*this.view.scale-Math.max((h- a.height*this.view.scale)/2+b/2,0),g&&this.pageVisible&&(a=this.view.getBackgroundPageBounds(),b=this.container.clientWidth,g=this.container.clientHeight,a.width<=b&&(this.container.scrollLeft=a.x+a.width/2-b/2),a.height<=g&&(this.container.scrollTop=a.y+a.height/2-g/2)))}; Graph.prototype.getCurrentViewBox=function(){var a=this.view,b=this.container,d=a.scale;a=a.translate;return{x:Math.round(b.scrollLeft/d-a.x),y:Math.round(b.scrollTop/d-a.y),width:Math.round(b.clientWidth/d),height:Math.round(b.clientHeight/d),scale:Math.round(1E4*d)/1E4}}; Graph.prototype.convertValueToTooltip=function(a,b){var d=null;mxUtils.isNode(a.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(d=a.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==d&&(d=a.value.getAttribute("tooltip")),null!=d&&(null!=d&&this.isReplacePlaceholders(a)&&(d=this.replacePlaceholders(a,d)),d=Graph.sanitizeHtml(d),b&&0<d.length&&0<Editor.tooltipMaxWidth&&(d='<div style="max-width:'+Editor.tooltipMaxWidth+'px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))); return d}; Graph.prototype.getTooltipForCell=function(a){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var b=this.getLockedGroupAncestor(a);null!=b&&(a=b);b="";if(mxUtils.isNode(a.value)&&(b=this.convertValueToTooltip(a),null==b)){var d=this.builtInProperties;a=a.value.attributes;var e=[];b="";this.isEnabled()&&(d.push("linkTarget"),d.push("link"));for(var g=0;g<a.length;g++)(Graph.translateDiagram&&"label"==a[g].nodeName||0>mxUtils.indexOf(d,a[g].nodeName))&&0<a[g].nodeValue.length&&e.push({name:a[g].nodeName, value:a[g].nodeValue});e.sort(function(c,h){return c.name<h.name?-1:c.name>h.name?1:0});for(g=0;g<e.length;g++)"link"==e[g].name&&this.isCustomLink(e[g].value)||(b+=("link"!=e[g].name?"<b>"+mxUtils.htmlEntities(e[g].name)+":</b> ":"")+mxUtils.htmlEntities(e[g].value)+"\n");0<b.length&&(b=b.substring(0,b.length-1),mxClient.IS_SVG&&(b='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+b+"</div>"))}return b}; Graph.prototype.getTooltip=function(a,b,d,e){if(null!=a&&null!=a.overlays){var g=!1;a.overlays.visit(function(c,h){null==h.overlay||!h.overlay.isTooltipOverlay||b!=h.node&&b.parentNode!=h.node||(g=!0)});if(g)return this.convertValueToTooltip(a.cell,!0)}return mxGraph.prototype.getTooltip.apply(this,arguments)}; Graph.prototype.addFlowAnimationToNode=function(a,b,d,e){if(null!=a&&null!=e){var g=a.getAttribute("stroke-dasharray");if(""==g||null==g){var c=String(mxUtils.getValue(b,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");g=1==mxUtils.getValue(b,mxConstants.STYLE_FIX_DASH,!1)||null==b.dashPattern?1:mxUtils.getNumber(b,mxConstants.STYLE_STROKEWIDTH,1);if(0<c.length)for(var h=0;h<c.length;h++)c[h]=Math.round(Number(c[h])*d*g*100)/100;a.setAttribute("stroke-dasharray",c.join(" "))}else c=g.split(" ");if(0< c.length){for(h=g=0;h<c.length;h++){var k=parseFloat(c[h]);isNaN(k)||(g+=parseFloat(c[h]))}0!=c.length%2&&(g*=2);d=Math.round(g/d/16*parseInt(mxUtils.getValue(b,"flowAnimationDuration",500)));c=mxUtils.getValue(b,"flowAnimationTimingFunction","linear");b=mxUtils.getValue(b,"flowAnimationDirection","normal");a.style.animation=e+" "+d+"ms "+mxUtils.htmlEntities(c)+" infinite "+mxUtils.htmlEntities(b);a.style.strokeDashoffset=g}}}; Graph.prototype.addFlowAnimationStyle=function(){var a=document.getElementsByTagName("head")[0];if(null!=a&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var b=document.createElement("style");b.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);a.appendChild(b)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(a){return"@keyframes "+a+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)}; Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};Graph.prototype.compress=function(a,b){return Graph.compress(a,b)};Graph.prototype.decompress=function(a,b){return Graph.decompress(a,b)};Graph.prototype.zapGremlins=function(a){return Graph.zapGremlins(a)};HoverIcons=function(a){mxEventSource.call(this);this.graph=a;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+'"/>'); HoverIcons.prototype.triangleRight=Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.triangleDown=Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'); HoverIcons.prototype.triangleLeft=Graph.createSvgImage(28,18,'<path d="m 1 9 L 12 1 L 12 6 L 26 6 L 26 12 L 12 12 L 12 18 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.roundDrop=Graph.createSvgImage(26,26,'<circle cx="13" cy="13" r="12" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'); HoverIcons.prototype.refreshTarget=new mxImage("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjM2cHgiIGhlaWdodD0iMzZweCI+PGVsbGlwc2UgZmlsbD0iIzI5YjZmMiIgY3g9IjEyIiBjeT0iMTIiIHJ4PSIxMiIgcnk9IjEyIi8+PHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjgpIHRyYW5zbGF0ZSgyLjQsIDIuNCkiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iI2ZmZiIgZD0iTTEyIDZ2M2w0LTQtNC00djNjLTQuNDIgMC04IDMuNTgtOCA4IDAgMS41Ny40NiAzLjAzIDEuMjQgNC4yNkw2LjcgMTQuOGMtLjQ1LS44My0uNy0xLjc5LS43LTIuOCAwLTMuMzEgMi42OS02IDYtNnptNi43NiAxLjc0TDE3LjMgOS4yYy40NC44NC43IDEuNzkuNyAyLjggMCAzLjMxLTIuNjkgNi02IDZ2LTNsLTQgNCA0IDR2LTNjNC40MiAwIDgtMy41OCA4LTggMC0xLjU3LS40Ni0zLjAzLTEuMjQtNC4yNnoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+Cg==",38, 38);HoverIcons.prototype.tolerance=mxClient.IS_TOUCH?6:0; HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"),mxConstants.DIRECTION_NORTH);this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"),mxConstants.DIRECTION_EAST);this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"),mxConstants.DIRECTION_SOUTH);this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"),mxConstants.DIRECTION_WEST);this.elts=[this.arrowUp,this.arrowRight, this.arrowDown,this.arrowLeft];this.resetHandler=mxUtils.bind(this,function(){this.reset()});this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler); this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,this.resetHandler);mxEvent.addListener(this.graph.container,"scroll",this.resetHandler);this.graph.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(d){null!=d.relatedTarget&& mxEvent.getSource(d)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(d){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(d){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(d.getEvent())||this.graph.model.isVertex(d.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(d, e){b=!1;d=e.getEvent();this.isResetEvent(d)?this.reset():this.isActive()||(e=this.getState(e.getState(),e.getGraphX(),e.getGraphY()),null==e&&mxEvent.isTouchEvent(d)||this.update(e));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(d,e){d=e.getEvent();this.isResetEvent(d)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(d)||this.update(this.getState(e.getState(),e.getGraphX(),e.getGraphY()),e.getGraphX(),e.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&& (b=!0)}),mouseUp:mxUtils.bind(this,function(d,e){d=e.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(d),mxEvent.getClientY(d));this.isResetEvent(d)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),e):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(e.getGraphX(),e.getGraphY())), e.getGraphX(),e.getGraphY())):mxEvent.isTouchEvent(d)||null!=this.bbox&&mxUtils.contains(this.bbox,e.getGraphX(),e.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(d)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isPopupTrigger(a)&&!this.graph.isCloneEvent(a)}; HoverIcons.prototype.createArrow=function(a,b,d){var e=null;e=mxUtils.createImage(a.src);e.style.width=a.width+"px";e.style.height=a.height+"px";e.style.padding=this.tolerance+"px";null!=b&&e.setAttribute("title",b);e.style.position="absolute";e.style.cursor=this.cssCursor;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(g){null==this.currentState||this.isResetEvent(g)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(g),mxEvent.getClientY(g)),this.drag(g, this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(g))}));mxEvent.redirectMouseEvents(e,this.graph,this.currentState);mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)&&(null!=this.activeArrow&&this.activeArrow!=e&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(e,100),this.activeArrow=e,this.fireEvent(new mxEventObject("focus", "arrow",e,"direction",d,"event",g)))}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(g){mxEvent.isMouseEvent(g)&&this.fireEvent(new mxEventObject("blur","arrow",e,"direction",d,"event",g));this.graph.isMouseDown||this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)}; HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a};HoverIcons.prototype.visitNodes=function(a){for(var b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})}; HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState}; HoverIcons.prototype.drag=function(a,b,d){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,d),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=b&&b.setHandlesVisible(!1),b=this.graph.connectionHandler.edgeState,null!=a&&mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)&&null!=b&&"orthogonalEdgeStyle"=== mxUtils.getValue(b.style,mxConstants.STYLE_EDGE,null)&&(a=this.getDirection(),b.cell.style=mxUtils.setStyle(b.cell.style,"sourcePortConstraint",a),b.style.sourcePortConstraint=a))};HoverIcons.prototype.getStateAt=function(a,b,d){return this.graph.view.getState(this.graph.getCellAt(b,d))}; HoverIcons.prototype.click=function(a,b,d){var e=d.getEvent(),g=d.getGraphX(),c=d.getGraphY();g=this.getStateAt(a,g,c);null==g||!this.graph.model.isEdge(g.cell)||this.graph.isCloneEvent(e)||g.getVisibleTerminalState(!0)!=a&&g.getVisibleTerminalState(!1)!=a?null!=a&&this.execute(a,b,d):(this.graph.setSelectionCell(g.cell),this.reset());d.consume()}; HoverIcons.prototype.execute=function(a,b,d){d=d.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d,this.graph.isCloneEvent(d),this.graph.isCloneEvent(d)),d,this)};HoverIcons.prototype.reset=function(a){null!=a&&!a||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 a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing); var b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(b=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var d=null;null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox&& (d=b.rotationShape.boundingBox));b=mxUtils.bind(this,function(k,p,l){if(null!=d){var u=new mxRectangle(p,l,k.clientWidth,k.clientHeight);mxUtils.intersects(u,d)&&(k==this.arrowUp?l-=u.y+u.height-d.y:k==this.arrowRight?p+=d.x+d.width-u.x:k==this.arrowDown?l+=d.y+d.height-u.y:k==this.arrowLeft&&(p-=u.x+u.width-d.x))}k.style.left=p+"px";k.style.top=l+"px";mxUtils.setOpacity(k,this.inactiveOpacity)});b(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(a.y- this.triangleUp.height-this.tolerance));b(this.arrowRight,Math.round(a.x+a.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));b(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(a.y+a.height-this.tolerance));b(this.arrowLeft,Math.round(a.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()); var e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),g=this.graph.getCellAt(this.currentState.getCenterX(),a.y-this.triangleUp.height/2);a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==g&&g==a&&(a=g=e=b=null);var c=this.graph.getCellGeometry(this.currentState.cell),h=mxUtils.bind(this,function(k,p){var l=this.graph.model.isVertex(k)&&this.graph.getCellGeometry(k);null==k||this.graph.model.isAncestor(k, this.currentState.cell)||this.graph.isSwimlane(k)||!(null==l||null==c||l.height<3*c.height&&l.width<3*c.width)?p.style.visibility="visible":p.style.visibility="hidden"});h(b,this.arrowRight);h(e,this.arrowLeft);h(g,this.arrowUp);h(a,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 a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a}; HoverIcons.prototype.getState=function(a,b,d){if(null!=a)if(a=a.cell,this.graph.getModel().contains(a)){if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var e=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(a=e)}null==b||null==d||null!=this.currentState&&this.currentState.cell==a||(b=this.graph.getBorderContainer(a,b,d),null!=b&&(a=b));if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a); null!=a&&null==a.style&&(a=null)}else a=null;return a}; HoverIcons.prototype.update=function(a,b,d){if(!this.graph.connectionArrowsEnabled||null!=this.graph.freehand&&this.graph.freehand.isDrawing()||null!=a&&"0"==mxUtils.getValue(a.style,"allowArrows","1"))this.reset();else{null!=a&&null!=a.cell.geometry&&a.cell.geometry.relative&&this.graph.model.isEdge(a.cell.parent)&&(a=null);var e=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,e=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread= window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,d))}),this.updateDelay+10))):null!=this.startTime&&(e=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=a&&e<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,d)?this.reset(!1):(null!=this.currentState||e>this.activationDelay)&&this.currentState!=a&&(e>this.updateDelay&&null!= a||null==this.bbox||null==b||null==d||!mxUtils.contains(this.bbox,b,d))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}}; HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(null!=this.arrowUp&&this.graph.container.appendChild(this.arrowUp),null!=this.arrowDown&&this.graph.container.appendChild(this.arrowDown));null!=this.arrowRight&&this.graph.container.appendChild(this.arrowRight);null!=this.arrowLeft&&this.graph.container.appendChild(this.arrowLeft);this.currentState=a}; Graph.prototype.removeTextStyleForCell=function(a,b){var d=this.getCurrentCellStyle(a),e=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(d,"html","0")){var g=this.convertValueToString(a);"0"!=mxUtils.getValue(d,"nl2Br","1")&&(g=g.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));g=Editor.convertHtmlToText(g);this.cellLabelChanged(a,g);e=!0}b&&(this.setCellStyles("fontSource",null,[a]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[a]),this.setCellStyles(mxConstants.STYLE_FONTSIZE, null,[a]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[a]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[a]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[a]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[a]))}finally{this.getModel().endUpdate()}return e};Graph.prototype.createParent=function(a,b,d,e,g){a=this.cloneCell(a);for(var c=0;c<d;c++){var h=this.cloneCell(b),k=this.getCellGeometry(h);null!=k&&(k.x+=c*e,k.y+=c*g);a.insert(h)}return a}; Graph.prototype.createTable=function(a,b,d,e,g,c,h,k,p){d=null!=d?d:60;e=null!=e?e:40;c=null!=c?c:30;k=null!=k?k:"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;fixedHeader=1;";p=null!=p?p:"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!=g?g:"",0,0,b*d,a*e+(null!=g?c:0),null!=h?h:"shape=table;startSize="+(null!=g?c:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,b*d,e,k),this.createVertex(null,null,"",0,0,d,e,p),b,d,0),a,0,e)}; Graph.prototype.setTableValues=function(a,b,d){for(var e=this.model.getChildCells(a,!0),g=0;g<e.length;g++)if(null!=d&&(e[g].value=d[g]),null!=b)for(var c=this.model.getChildCells(e[g],!0),h=0;h<c.length;h++)null!=b[g][h]&&(c[h].value=b[g][h]);return a}; Graph.prototype.createCrossFunctionalSwimlane=function(a,b,d,e,g,c,h,k,p){d=null!=d?d:120;e=null!=e?e:120;h=null!=h?h:"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;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";k=null!=k?k:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;"; p=null!=p?p:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";g=this.createVertex(null,null,null!=g?g:"",0,0,b*d,a*e,null!=c?c:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==g?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");c=mxUtils.getValue(this.getCellStyle(g),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);g.geometry.width+= c;g.geometry.height+=c;h=this.createVertex(null,null,"",0,c,b*d+c,e,h);g.insert(this.createParent(h,this.createVertex(null,null,"",c,0,d,e,k),b,d,0));return 1<a?(h.geometry.y=e+c,this.createParent(g,this.createParent(h,this.createVertex(null,null,"",c,0,d,e,p),b,d,0),a-1,0,e)):g}; Graph.prototype.visitTableCells=function(a,b){var d=null,e=this.model.getChildCells(a,!0);a=this.getActualStartSize(a,!0);for(var g=0;g<e.length;g++){for(var c=this.getActualStartSize(e[g],!0),h=this.model.getChildCells(e[g],!0),k=this.getCellStyle(e[g],!0),p=null,l=[],u=0;u<h.length;u++){var x=this.getCellGeometry(h[u]);if(null==x)l.push(null);else{var v={cell:h[u],rospan:1,colspan:1,row:g,col:u,geo:x};x=null!=x.alternateBounds?x.alternateBounds:x;v.point=new mxPoint(x.width+(null!=p?p.point.x:a.x+ c.x),x.height+(null!=d&&null!=d[0]?d[0].point.y:a.y+c.y));v.actual=v;null!=d&&null!=d[u]&&1<d[u].rowspan?(v.rowspan=d[u].rowspan-1,v.colspan=d[u].colspan,v.actual=d[u].actual):null!=p&&1<p.colspan?(v.rowspan=p.rowspan,v.colspan=p.colspan-1,v.actual=p.actual):(p=this.getCurrentCellStyle(h[u],!0),null!=p&&(v.rowspan=parseInt(p.rowspan||1),v.colspan=parseInt(p.colspan||1)));p=1==mxUtils.getValue(k,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(k,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!= mxConstants.NONE;b(v,h.length,e.length,a.x+(p?c.x:0),a.y+(p?c.y:0));l.push(v);p=v}}d=l}};Graph.prototype.getTableLines=function(a,b,d){var e=[],g=[];(b||d)&&this.visitTableCells(a,mxUtils.bind(this,function(c,h,k,p,l){b&&c.row<k-1&&(null==e[c.row]&&(e[c.row]=[new mxPoint(p,c.point.y)]),1<c.rowspan&&e[c.row].push(null),e[c.row].push(c.point));d&&c.col<h-1&&(null==g[c.col]&&(g[c.col]=[new mxPoint(c.point.x,l)]),1<c.colspan&&g[c.col].push(null),g[c.col].push(c.point))}));return e.concat(g)}; Graph.prototype.paintTableCellLines=function(a,b,d,e,g,c,h,k){if(null!=h&&h!=mxConstants.NONE){var p=this.model,l=!1,u=!1;if(this.isTableRow(b)){var x=p.getChildCells(p.getParent(b),!0);var v=mxUtils.indexOf(x,b);b=(p="0"!=mxUtils.getValue(this.getCurrentCellStyle(p.getParent(b)),"rowLines","1"))&&0<v;x=p&&v<x.length-1}else if(this.isTableCell(b)){l=p.getParent(b);v=p.getParent(l);x=p.getChildCells(v,!0);u=p.getChildCells(l,!0);v=this.getCurrentCellStyle(v);p="0"!=mxUtils.getValue(v,"rowLines","1"); v="0"!=mxUtils.getValue(v,"columnLines","1");l=mxUtils.indexOf(x,l);var z=mxUtils.indexOf(u,b);b=p&&0<l;x=p&&l<x.length-1;l=v&&0<z;u=v&&z<u.length-1}else return;if(b||x||l||u)a.setStrokeColor(h),a.setStrokeWidth(k),a.setDashed(!1),a.setShadow(!1),b&&(a.begin(),a.moveTo(d,e),a.lineTo(d+g,e),a.stroke()),x&&(a.begin(),a.moveTo(d,e+c),a.lineTo(d+g,e+c),a.stroke()),l&&(a.begin(),a.moveTo(d,e),a.lineTo(d,e+c),a.stroke()),u&&(a.begin(),a.moveTo(d+g,e),a.lineTo(d+g,e+c),a.stroke())}}; Graph.prototype.isTableCell=function(a){return this.model.isVertex(a)&&this.isTableRow(this.model.getParent(a))};Graph.prototype.isTableRow=function(a){return this.model.isVertex(a)&&this.isTable(this.model.getParent(a))};Graph.prototype.isTable=function(a){a=this.getCellStyle(a);return null!=a&&"tableLayout"==a.childLayout};Graph.prototype.isStack=function(a){a=this.getCellStyle(a);return null!=a&&"stackLayout"==a.childLayout}; Graph.prototype.isStackChild=function(a){return this.model.isVertex(a)&&this.isStack(this.model.getParent(a))}; Graph.prototype.setTableRowHeight=function(a,b,d){d=null!=d?d:!0;var e=this.getModel();e.beginUpdate();try{var g=this.getCellGeometry(a);if(null!=g){g=g.clone();g.height+=b;e.setGeometry(a,g);var c=e.getParent(a),h=e.getChildCells(c,!0);if(!d){var k=mxUtils.indexOf(h,a);if(k<h.length-1){var p=h[k+1],l=this.getCellGeometry(p);null!=l&&(l=l.clone(),l.y+=b,l.height-=b,e.setGeometry(p,l))}}var u=this.getCellGeometry(c);null!=u&&(d||(d=a==h[h.length-1]),d&&(u=u.clone(),u.height+=b,e.setGeometry(c,u)))}}finally{e.endUpdate()}}; Graph.prototype.setTableColumnWidth=function(a,b,d){d=null!=d?d:!1;var e=this.getModel(),g=e.getParent(a),c=e.getParent(g),h=e.getChildCells(g,!0);a=mxUtils.indexOf(h,a);var k=a==h.length-1;e.beginUpdate();try{for(var p=e.getChildCells(c,!0),l=0;l<p.length;l++){g=p[l];h=e.getChildCells(g,!0);var u=h[a],x=this.getCellGeometry(u);null!=x&&(x=x.clone(),x.width+=b,null!=x.alternateBounds&&(x.alternateBounds.width+=b),e.setGeometry(u,x));a<h.length-1&&(u=h[a+1],x=this.getCellGeometry(u),null!=x&&(x=x.clone(), x.x+=b,d||(x.width-=b,null!=x.alternateBounds&&(x.alternateBounds.width-=b)),e.setGeometry(u,x)))}if(k||d){var v=this.getCellGeometry(c);null!=v&&(v=v.clone(),v.width+=b,e.setGeometry(c,v))}null!=this.layoutManager&&this.layoutManager.executeLayout(c)}finally{e.endUpdate()}}; Graph.prototype.resizeAllTableRows=function(a,b){var d=this.getModel(),e=d.getChildCells(a,!0);if(0!=e.length){d.beginUpdate();try{for(var g=0;g<e.length;g++){var c=this.getCellGeometry(e[g]);null!=c&&(c=c.clone(),c.y+=b*g,c.height=Math.max(Graph.minTableRowHeight,c.height+b),d.setGeometry(e[g],c))}var h=this.getCellGeometry(a);null!=h&&(h=h.clone(),h.height+=b*e.length,d.setGeometry(a,h));null!=this.layoutManager&&this.layoutManager.executeLayout(a)}finally{d.endUpdate()}}}; Graph.prototype.resizeAllTableColumns=function(a,b){var d=this.getModel(),e=d.getChildCells(a,!0);if(0!=e.length){d.beginUpdate();try{for(var g=0;g<e.length;g++)for(var c=d.getChildCells(e[g],!0),h=0;h<c.length;h++){var k=this.getCellGeometry(c[h]);null!=k&&(k=k.clone(),k.x+=b*h,k.width=Math.max(Graph.minTableColumnWidth,k.width+b),null!=k.alternateBounds&&(k.alternateBounds.width=Math.max(Graph.minTableColumnWidth,k.alternateBounds.width+b)),d.setGeometry(c[h],k))}var p=this.getCellGeometry(a);if(null!= p){var l=d.getChildCells(e[0],!0).length;p=p.clone();p.width+=b*l;d.setGeometry(a,p)}null!=this.layoutManager&&this.layoutManager.executeLayout(a)}finally{d.endUpdate()}}}; Graph.prototype.distributeRows=function(a){var b=this.getModel(),d=b.getChildCells(a,!0);if(!(2>d.length)){b.beginUpdate();try{for(var e=0,g=0;g<d.length;g++){var c=this.getCellGeometry(d[g]);null!=c&&(e+=c.height)}var h=e/d.length;for(g=e=0;g<d.length;g++)c=this.getCellGeometry(d[g]),null!=c&&(c=c.clone(),0==g&&(e=c.y),c.y=e,c.height=h,b.setGeometry(d[g],c),e+=h);null!=this.layoutManager&&this.layoutManager.executeLayout(a)}finally{b.endUpdate()}}}; Graph.prototype.distributeColumns=function(a){var b=this.getModel(),d=b.getChildCells(a,!0);if(0!=d.length){var e=b.getChildCells(d[0],!0);if(!(2>e.length)){b.beginUpdate();try{for(var g=0,c=0;c<e.length;c++){var h=this.getCellGeometry(e[c]);null!=h&&(g+=(null!=h.alternateBounds?h.alternateBounds:h).width)}var k=g/e.length;for(c=0;c<d.length;c++){var p=b.getChildCells(d[c],!0);for(g=e=0;g<p.length;g++)h=this.getCellGeometry(p[g]),null!=h&&(h=h.clone(),0==g&&(e=h.x),h.x=e,h.width=k,null!=h.alternateBounds&& (h.alternateBounds.width=k),b.setGeometry(p[g],h),e+=k)}null!=this.layoutManager&&this.layoutManager.executeLayout(a)}finally{b.endUpdate()}}}};function TableLayout(a){mxGraphLayout.call(this,a)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.isCellVisible(a)}; TableLayout.prototype.getSize=function(a,b){for(var d=0,e=0;e<a.length;e++)if(!this.isVertexIgnored(a[e])){var g=this.graph.getCellGeometry(a[e]);null!=g&&(d+=b?g.width:g.height)}return d}; TableLayout.prototype.getRowLayout=function(a,b){var d=this.graph.model.getChildCells(a,!0),e=this.graph.getActualStartSize(a,!0);a=this.getSize(d,!0);b=Math.max(0,b-e.x-e.width);var g=[];e=e.x;for(var c=0;c<d.length;c++){var h=this.graph.getCellGeometry(d[c]);null!=h&&(e+=0<a?(null!=h.alternateBounds?h.alternateBounds.width:h.width)*b/a:b/d.length,g.push(Math.round(e)))}return g}; TableLayout.prototype.layoutRow=function(a,b,d,e){var g=this.graph.getModel(),c=g.getChildCells(a,!0);a=this.graph.getActualStartSize(a,!0);var h=a.x,k=0;null!=b&&(b=b.slice(),b.splice(0,0,a.x));for(var p=0;p<c.length;p++){var l=this.graph.getCellGeometry(c[p]);null!=l&&(l=l.clone(),l.y=a.y,l.height=Math.max(0,d-a.y-a.height),null!=b?(l.x=b[p],l.width=Math.max(0,b[p+1]-l.x),p==c.length-1&&p<b.length-2&&(l.width=Math.max(0,e-l.x-a.x-a.width))):(l.x=h,h+=l.width,p==c.length-1?l.width=Math.max(0,e-a.x- a.width-k):k+=l.width),l.alternateBounds=new mxRectangle(0,0,l.width,l.height),g.setGeometry(c[p],l))}return k}; TableLayout.prototype.execute=function(a){var b=null!=a?this.graph.getCellGeometry(a):null;if(null!=b){var d=this.graph.getActualStartSize(a,!0),e=this.graph.getCellStyle(a),g="1"==mxUtils.getValue(e,"resizeLastRow","0"),c="1"==mxUtils.getValue(e,"resizeLast","0");e="1"==mxUtils.getValue(e,"fixedRows","0");var h=this.graph.getModel(),k=0;h.beginUpdate();try{for(var p=h.getChildCells(a,!0),l=0;l<p.length;l++)h.setVisible(p[l],!0);if(0<p.length&&!this.graph.isCellCollapsed(a)){var u=0;for(l=0;l<p.length;l++){var x= this.graph.getActualStartSize(p[l],!0);u=Math.max(u,x.x+x.width)}var v=d.x+d.width+u,z=d.y+d.height;v+=0<v?Graph.minTableColumnWidth:0;z+=0<z?Graph.minTableRowHeight:0;if(b.width<v||b.height<z)b=b.clone(),b.width=Math.max(b.width,v),b.height=Math.max(b.height,z),h.setGeometry(a,b)}var C=b.height-d.y-d.height,F=b.width-d.x-d.width,G=this.getSize(p,!1);if(0<C&&0<F&&0<p.length&&0<G){if(g){var H=this.graph.getCellGeometry(p[p.length-1]);null!=H&&(H=H.clone(),H.height=C-G+H.height,h.setGeometry(p[p.length- 1],H))}var J=c?null:this.getRowLayout(p[0],F);x=[];var O=d.y;for(l=0;l<p.length;l++)H=this.graph.getCellGeometry(p[l]),null!=H&&(H=H.clone(),H.x=d.x,H.width=F,H.y=Math.round(O),O=g||e?O+H.height:O+H.height/G*C,H.height=Math.round(O)-H.y,h.setGeometry(p[l],H),k=Math.max(k,this.layoutRow(p[l],J,H.height,F,x)));e&&C<G&&(b=b.clone(),b.height=O+d.height,h.setGeometry(a,b));c&&F<k+Graph.minTableColumnWidth&&(b=b.clone(),b.width=k+d.width+d.x+Graph.minTableColumnWidth,h.setGeometry(a,b));this.graph.visitTableCells(a, mxUtils.bind(this,function(M){h.setVisible(M.cell,M.actual.cell==M.cell);if(M.actual.cell!=M.cell){if(M.actual.row==M.row){var V=null!=M.geo.alternateBounds?M.geo.alternateBounds:M.geo;M.actual.geo.width+=V.width}M.actual.col==M.col&&(V=null!=M.geo.alternateBounds?M.geo.alternateBounds:M.geo,M.actual.geo.height+=V.height)}}))}else for(l=0;l<p.length;l++)h.setVisible(p[l],!1)}finally{h.endUpdate()}}}; (function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(v,z){z=null!=z?z:!0;var C=this.getState(v);null!=C&&z&&this.graph.model.isEdge(C.cell)&&null!=C.style&&1!=C.style[mxConstants.STYLE_CURVED]&&!C.invalid&&this.updateLineJumps(C)&&this.graph.cellRenderer.redraw(C,!1,this.isRendering());if(null!=C&&C.invalid){if(this.graph.showLinkIcons){C= this.graph.getLinkForCell(v);var F=null!=C&&0<C.length,G=!1;if(null!=v.overlays)for(C=0;C<v.overlays.length;C++)if(v.overlays[C].isLinkOverlay){G=!0;break}if(F&&!G)C=this.graph.createLinkOverlay(v),null!=C&&(null==v.overlays&&(v.overlays=[]),v.overlays.push(C));else if(!F&&G){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isLinkOverlay&&v.overlays.splice(C,1);0==v.overlays.length&&(v.overlays=null)}}else if(null!=v.overlays){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isLinkOverlay&&v.overlays.splice(C, 1);0==v.overlays.length&&(v.overlays=null)}if(this.graph.showTooltipIcons){C=this.graph.convertValueToTooltip(v);F=null!=C&&0<C.length;G=!1;if(null!=v.overlays)for(C=0;C<v.overlays.length;C++)if(v.overlays[C].isTooltipOverlay){G=!0;break}if(F&&!G)C=this.graph.createTooltipOverlay(v),null!=C&&(null==v.overlays&&(v.overlays=[]),v.overlays.push(C));else if(!F&&G){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isTooltipOverlay&&v.overlays.splice(C,1);0==v.overlays.length&&(v.overlays=null)}}else if(null!= v.overlays){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isTooltipOverlay&&v.overlays.splice(C,1);0==v.overlays.length&&(v.overlays=null)}if(this.graph.showNoteIcons){C=this.graph.getNoteForCell(v);F=null!=C&&0<C.length;G=!1;if(null!=v.overlays)for(C=0;C<v.overlays.length;C++)if(v.overlays[C].isNoteOverlay){G=!0;break}if(F&&!G)C=this.graph.createNoteOverlay(v),null!=C&&(null==v.overlays&&(v.overlays=[]),v.overlays.push(C));else if(!F&&G){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isNoteOverlay&& v.overlays.splice(C,1);0==v.overlays.length&&(v.overlays=null)}}else if(null!=v.overlays){for(C=v.overlays.length-1;0<=C;C--)v.overlays[C].isNoteOverlay&&v.overlays.splice(C,1);0==v.overlays.length&&(v.overlays=null)}}C=b.apply(this,arguments);null!=C&&z&&this.graph.model.isEdge(C.cell)&&null!=C.style&&1!=C.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(C);return C};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(v){var z=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=z)for(var C=null,F=!1,G=0;G<z.length;G++){var H=z[G];if("hidden"==H.getAttribute("visibility"))F||(C=H.getAttribute("d"));else if("none"==H.getAttribute("stroke"))F||C!=H.getAttribute("d")||(C=null);else if(null==H.getAttribute("data-rough-fill")&&(null==C||C==H.getAttribute("d"))){if(null==v||0==--v)return H;C=H.getAttribute("d"); F=!0}}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 d=mxShape.prototype.paint;mxShape.prototype.paint=function(v){d.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var e=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(v){v=e.apply(this, arguments);null!=this.state&&(v.adaptiveColors=this.state.view.graph.getAdaptiveColors());return v};var g=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(v,z){return g.apply(this,arguments)||null!=v.routedPoints&&null!=z.routedPoints&&!mxUtils.equalPoints(z.routedPoints,v.routedPoints)};var c=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(v){c.apply(this,arguments);if(this.graph.model.isVertex(v.cell)&&null!=this.graph.isTransparentBounds&& this.graph.isTransparentBounds(v.cell)){var z=this.graph.getTransparentBounds(v.cell);null!=z?(v.x=this.scale*(this.translate.x+v.origin.x+z.x),v.y=this.scale*(this.translate.y+v.origin.y+z.y),v.width=this.scale*z.width,v.height=this.scale*z.height,v.unscaledWidth=z.width,v.unscaledHeight=z.height):(v.width=0,v.height=0,v.unscaledWidth=0,v.unscaledHeight=0)}this.graph.model.isEdge(v.cell)&&1!=v.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(v)};var h=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta= function(v){return null!=v&&null!=v.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(v.cell)?new mxPoint(0,0):h.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(v){var z=v.absolutePoints;if(Graph.lineJumpsEnabled){var C=null!=v.routedPoints,F=null;if(null!=z&&null!=this.validEdges&&"none"!==mxUtils.getValue(v.style,"jumpStyle","none")){var G=function(S,U,Y){var N=new mxPoint(U,Y);N.type=S;F.push(N);N=null!=v.routedPoints?v.routedPoints[F.length-1]:null; return null==N||N.type!=S||N.x!=U||N.y!=Y},H=.5*this.scale;C=!1;F=[];for(var J=0;J<z.length-1;J++){for(var O=z[J+1],M=z[J],V=[],Q=z[J+2];J<z.length-2&&mxUtils.ptSegDistSq(M.x,M.y,Q.x,Q.y,O.x,O.y)<1*this.scale*this.scale;)O=Q,J++,Q=z[J+2];C=G(0,M.x,M.y)||C;for(var ma=0;ma<this.validEdges.length;ma++){var ia=this.validEdges[ma],na=ia.absolutePoints;if(null!=na&&mxUtils.intersects(v,ia)&&"1"!=ia.style.noJump){var Z=null;for(ia=0;ia<na.length-1;ia++){var da=na[ia+1],pa=na[ia];for(Q=na[ia+2];ia<na.length- 2&&mxUtils.ptSegDistSq(pa.x,pa.y,Q.x,Q.y,da.x,da.y)<1*this.scale*this.scale;)da=Q,ia++,Q=na[ia+2];var ka=mxUtils.intersection(M.x,M.y,O.x,O.y,pa.x,pa.y,da.x,da.y);if(null!=ka&&(Math.abs(ka.x-M.x)>H||Math.abs(ka.y-M.y)>H)&&(Math.abs(ka.x-O.x)>H||Math.abs(ka.y-O.y)>H)&&(null==Z||mxUtils.ptLineDist(M.x,M.y,O.x,O.y,Z.x,Z.y)>H||mxUtils.ptLineDist(M.x,M.y,O.x,O.y,pa.x,pa.y)>H)&&(null==Q||mxUtils.ptLineDist(M.x,M.y,O.x,O.y,Q.x,Q.y)>H||mxUtils.ptLineDist(M.x,M.y,O.x,O.y,da.x,da.y)>H)){Q=ka.x-M.x;Z=ka.y-M.y; ka={distSq:Q*Q+Z*Z,x:ka.x,y:ka.y};Q=V.length;for(Z=0;Z<V.length;Z++)if(V[Z].distSq>ka.distSq){Q=Z;break}(0==Q||Math.abs(V[Q-1].x-ka.x)>H||Math.abs(V[Q-1].y-ka.y)>H)&&(Q==V.length||Math.abs(V[Q].x-ka.x)>H||Math.abs(V[Q].y-ka.y)>H)&&V.splice(Q,0,ka)}Z=pa}}}for(ia=0;ia<V.length;ia++)C=G(1,V[ia].x,V[ia].y)||C}ka=z[z.length-1];C=G(0,ka.x,ka.y)||C}v.routedPoints=F;return C}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(v,z,C){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)k.apply(this,arguments);else{var F=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,G=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,H=mxUtils.getValue(this.style,"jumpStyle","none"),J=!0,O=null,M=null,V=[],Q=null;v.begin();for(var ma=0;ma<this.state.routedPoints.length;ma++){var ia= this.state.routedPoints[ma],na=new mxPoint(ia.x/this.scale,ia.y/this.scale);0==ma?na=z[0]:ma==this.state.routedPoints.length-1&&(na=z[z.length-1]);var Z=!1;if(null!=O&&1==ia.type){var da=this.state.routedPoints[ma+1];ia=da.x/this.scale-na.x;da=da.y/this.scale-na.y;ia=ia*ia+da*da;null==Q&&(Q=new mxPoint(na.x-O.x,na.y-O.y),M=Math.sqrt(Q.x*Q.x+Q.y*Q.y),0<M?(Q.x=Q.x*G/M,Q.y=Q.y*G/M):Q=null);ia>G*G&&0<M&&(ia=O.x-na.x,da=O.y-na.y,ia=ia*ia+da*da,ia>G*G&&(Z=new mxPoint(na.x-Q.x,na.y-Q.y),ia=new mxPoint(na.x+ Q.x,na.y+Q.y),V.push(Z),this.addPoints(v,V,C,F,!1,null,J),V=0>Math.round(Q.x)||0==Math.round(Q.x)&&0>=Math.round(Q.y)?1:-1,J=!1,"sharp"==H?(v.lineTo(Z.x-Q.y*V,Z.y+Q.x*V),v.lineTo(ia.x-Q.y*V,ia.y+Q.x*V),v.lineTo(ia.x,ia.y)):"line"==H?(v.moveTo(Z.x+Q.y*V,Z.y-Q.x*V),v.lineTo(Z.x-Q.y*V,Z.y+Q.x*V),v.moveTo(ia.x-Q.y*V,ia.y+Q.x*V),v.lineTo(ia.x+Q.y*V,ia.y-Q.x*V),v.moveTo(ia.x,ia.y)):"arc"==H?(V*=1.3,v.curveTo(Z.x-Q.y*V,Z.y+Q.x*V,ia.x-Q.y*V,ia.y+Q.x*V,ia.x,ia.y)):(v.moveTo(ia.x,ia.y),J=!0),V=[ia],Z=!0))}else Q= null;Z||(V.push(na),O=na)}this.addPoints(v,V,C,F,!1,null,J);v.stroke()}};var p=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(v,z,C,F){return null!=z&&"centerPerimeter"==z.style[mxConstants.STYLE_PERIMETER]?new mxPoint(z.getCenterX(),z.getCenterY()):p.apply(this,arguments)};var l=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(v,z,C,F){if(null==z||null==v||"1"!=z.style.snapToPoint&&"1"!= v.style.snapToPoint)l.apply(this,arguments);else{z=this.getTerminalPort(v,z,F);var G=this.getNextPoint(v,C,F),H=this.graph.isOrthogonal(v),J=mxUtils.toRadians(Number(z.style[mxConstants.STYLE_ROTATION]||"0")),O=new mxPoint(z.getCenterX(),z.getCenterY());if(0!=J){var M=Math.cos(-J),V=Math.sin(-J);G=mxUtils.getRotatedPoint(G,M,V,O)}M=parseFloat(v.style[mxConstants.STYLE_PERIMETER_SPACING]||0);M+=parseFloat(v.style[F?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| 0);G=this.getPerimeterPoint(z,G,0==J&&H,M);0!=J&&(M=Math.cos(J),V=Math.sin(J),G=mxUtils.getRotatedPoint(G,M,V,O));v.setAbsoluteTerminalPoint(this.snapToAnchorPoint(v,z,C,F,G),F)}};mxGraphView.prototype.snapToAnchorPoint=function(v,z,C,F,G){if(null!=z&&null!=v){v=this.graph.getAllConnectionConstraints(z);F=C=null;if(null!=v)for(var H=0;H<v.length;H++){var J=this.graph.getConnectionPoint(z,v[H]);if(null!=J){var O=(J.x-G.x)*(J.x-G.x)+(J.y-G.y)*(J.y-G.y);if(null==F||O<F)C=J,F=O}}null!=C&&(G=C)}return G}; var u=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(v,z,C){var F=u.apply(this,arguments);"1"==v.getAttribute("placeholders")&&null!=C.state&&(F=C.state.view.graph.replacePlaceholders(C.state.cell,F));return F};var x=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(v){if(null!=v.style&&"undefined"!==typeof pako){var z=mxUtils.getValue(v.style,mxConstants.STYLE_SHAPE,null);if(null!=z&&"string"===typeof z&&"stencil("==z.substring(0, 8))try{var C=z.substring(8,z.length-1),F=mxUtils.parseXml(Graph.decompress(C));return new mxShape(new mxStencil(F.documentElement))}catch(G){null!=window.console&&console.log("Error in shape: "+G)}}return x.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(a){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[a]}; mxStencilRegistry.setFileLoaded=function(a){mxStencilRegistry.filesLoaded[a]=!0}; mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var d=mxStencilRegistry.getBasenameForStencil(a);if(null!=d){b=mxStencilRegistry.libraries[d];if(null!=b){if(null==mxStencilRegistry.packages[d]){for(var e=0;e<b.length;e++){var g=b[e];if(!mxStencilRegistry.isFileLoaded(g))if(mxStencilRegistry.setFileLoaded(g),".xml"==g.toLowerCase().substring(g.length-4,g.length))mxStencilRegistry.loadStencilSet(g, null);else if(".js"==g.toLowerCase().substring(g.length-3,g.length))try{if(mxStencilRegistry.allowEval){var c=mxUtils.load(g);null!=c&&200<=c.getStatus()&&299>=c.getStatus()&&eval.call(window,c.getText())}}catch(h){null!=window.console&&console.log("error in getStencil:",a,d,b,g,h)}}mxStencilRegistry.packages[d]=1}}else d=d.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+d+".xml",null);b=mxStencilRegistry.stencils[a]}}return b}; mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&"string"===typeof a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0])){b=a[1];for(var d=2;d<a.length-1;d++)b+="/"+a[d]}return b}; mxStencilRegistry.loadStencilSet=function(a,b,d,e){var g=mxStencilRegistry.packages[a];if(null!=d&&d||null==g){var c=!1;if(null==g)try{if(e){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(h){null!=h&&null!=h.documentElement&&(mxStencilRegistry.packages[a]=h,c=!0,mxStencilRegistry.parseStencilSet(h.documentElement,b,c))}));return}g=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=g;c=!0}catch(h){null!=window.console&&console.log("error in loadStencilSet:",a,h)}null!=g&&null!= g.documentElement&&mxStencilRegistry.parseStencilSet(g.documentElement,b,c)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(d){b(200<=d.getStatus()&&299>=d.getStatus()?d.getXml():null)}),mxUtils.bind(this,function(d){b(null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)}; mxStencilRegistry.parseStencilSet=function(a,b,d){if("stencils"==a.nodeName)for(var e=a.firstChild;null!=e;)"shapes"==e.nodeName&&mxStencilRegistry.parseStencilSet(e,b,d),e=e.nextSibling;else{d=null!=d?d:!0;e=a.firstChild;var g="";a=a.getAttribute("name");for(null!=a&&(g=a+".");null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=e.getAttribute("name"),null!=a)){g=g.toLowerCase();var c=a.replace(/ /g,"_");d&&mxStencilRegistry.addStencil(g+c.toLowerCase(),new mxStencil(e));if(null!=b){var h=e.getAttribute("w"), k=e.getAttribute("h");h=null==h?80:parseInt(h,10);k=null==k?80:parseInt(k,10);b(g,c,a,h,k)}}e=e.nextSibling}}}; "undefined"!==typeof mxVertexHandler&&function(){function a(){var q=document.createElement("div");q.className="geHint";q.style.whiteSpace="nowrap";q.style.position="absolute";return q}function b(q,A){switch(A){case mxConstants.POINTS:return q;case mxConstants.MILLIMETERS:return Math.round(1E3*q/mxConstants.PIXELS_PER_MM)/1E3;case mxConstants.METERS:return(q/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(q/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(q){return!mxEvent.isAltDown(q)||mxEvent.isShiftDown(q)};var d=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(q){return d.apply(this,arguments)||this.graph.isTableRow(q)||this.graph.isTableCell(q)}; var e=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(q){return e.apply(this,arguments)||this.graph.isEdgeIgnored(q)};var g=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(q){return this.graph.isCloneEvent(q)!=g.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var q=new mxEllipse(null,this.highlightColor,this.highlightColor,0);q.opacity=mxConstants.HIGHLIGHT_OPACITY;return q}; mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(q){q=this.graph.createCurrentEdgeStyle();q=this.graph.createEdge(null,null,null,null,null,q);q=new mxCellState(this.graph.view,q,this.graph.getCellStyle(q));for(var A in this.graph.currentEdgeStyle)q.style[A]=this.graph.currentEdgeStyle[A];if(null!=this.previous){var B=this.previous.style.newEdgeStyle;if(null!=B)try{var D=Graph.decodeNewEdgeStyle(B); for(A in D)q.style[A]=D[A]}catch(I){}}q.style=this.graph.postProcessCellStyle(q.cell,q.style);return q};var c=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var q=c.apply(this,arguments);q.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return q};mxConnectionHandler.prototype.updatePreview=function(q){};var h=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var q=h.apply(this,arguments), A=q.getCell;q.getCell=mxUtils.bind(this,function(B){var D=A.apply(this,arguments);this.error=null;return D});return q};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var q="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",A="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize libavoidRouting".split(" "), B=0;B<A.length;B++)null!=this.currentEdgeStyle[A[B]]&&(q+=A[B]+"="+this.currentEdgeStyle[A[B]]+";");null!=this.currentEdgeStyle.orthogonalLoop?q+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(q+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?q+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(q+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+ ";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(q+="elbow="+this.currentEdgeStyle.elbow+";");return q=null!=this.currentEdgeStyle.html?q+("html="+this.currentEdgeStyle.html+";"):q+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var q=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!= q&&(new mxCodec(q.ownerDocument)).decode(q,this.getStylesheet())};Graph.prototype.createCellLookup=function(q,A){A=null!=A?A:{};for(var B=0;B<q.length;B++){var D=q[B];A[mxObjectIdentity.get(D)]=D.getId();for(var I=this.model.getChildCount(D),K=0;K<I;K++)this.createCellLookup([this.model.getChildAt(D,K)],A)}return A};Graph.prototype.createCellMapping=function(q,A,B){B=null!=B?B:{};for(var D in q){var I=A[D];null==B[I]&&(B[I]=q[D].getId()||"")}return B};Graph.prototype.importGraphModel=function(q,A, B,D){A=null!=A?A:0;B=null!=B?B:0;var I=new mxCodec(q.ownerDocument),K=new mxGraphModel;I.decode(q,K);q=[];I={};var P={},X=K.getChildren(this.cloneCell(K.root,this.isCloneInvalidEdges(),I));if(null!=X){var aa=this.createCellLookup([K.root]);X=X.slice();this.model.beginUpdate();try{if(1!=X.length||this.isCellLocked(this.getDefaultParent()))for(K=0;K<X.length;K++)ca=this.model.getChildren(this.moveCells([X[K]],A,B,!1,this.model.getRoot())[0]),null!=ca&&(q=q.concat(ca));else{var ca=K.getChildren(X[0]); null!=ca&&(q=this.moveCells(ca,A,B,!1,this.getDefaultParent()),P[K.getChildAt(K.root,0).getId()]=this.getDefaultParent().getId())}if(null!=q&&(this.createCellMapping(I,aa,P),this.updateCustomLinks(P,q),D)){this.isGridEnabled()&&(A=this.snap(A),B=this.snap(B));var ra=this.getBoundingBoxFromGeometry(q,!0);null!=ra&&this.moveCells(q,A-ra.x,B-ra.y)}}finally{this.model.endUpdate()}}return q};Graph.prototype.encodeCells=function(q){for(var A={},B=this.cloneCells(q,null,A),D=new mxDictionary,I=0;I<q.length;I++)D.put(q[I], !0);var K=new mxCodec,P=new mxGraphModel,X=P.getChildAt(P.getRoot(),0);for(I=0;I<B.length;I++){P.add(X,B[I]);var aa=this.view.getState(q[I]);if(null!=aa){var ca=this.getCellGeometry(B[I]);null!=ca&&ca.relative&&!this.model.isEdge(q[I])&&null==D.get(this.model.getParent(q[I]))&&(ca.offset=null,ca.relative=!1,ca.x=aa.x/aa.view.scale-aa.view.translate.x,ca.y=aa.y/aa.view.scale-aa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(A,this.createCellLookup(q)),B);return K.encode(P)};Graph.prototype.isSwimlane= function(q,A){var B=null;null==q||this.model.isEdge(q)||this.model.getParent(q)==this.model.getRoot()||(B=this.getCurrentCellStyle(q,A)[mxConstants.STYLE_SHAPE]);return B==mxConstants.SHAPE_SWIMLANE||"table"==B||"tableRow"==B};var k=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(q){return null!=q&&k.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellEditable(this.model.getParent(q)):!0:!1};var p=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable= function(q){return null!=q&&p.apply(this,arguments)?this.isTableCell(q)||this.isTableRow(q)?this.isCellMovable(this.model.getParent(q)):!0:!1};var l=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(q){var A=this.model.getParent(q);if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.expand)return"0"!=B.expand}return l.apply(this,arguments)&&(null==A||!this.isTable(A))};var u=Graph.prototype.isContractParent;Graph.prototype.isContractParent=function(q){var A=this.model.getParent(q); if(null!=A){var B=this.getCurrentCellStyle(A);if(null!=B.contract)return"0"!=B.contract}return u.apply(this,arguments)&&(null==A||!this.isTable(A))};var x=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(q,A,B,D,I,K,P,X){null==X&&(X=this.model.getParent(q),this.isTable(X)||this.isTableRow(X))&&(X=this.getCellAt(K,P,null,!0,!1));B=null;this.model.beginUpdate();try{var aa=this.getCellGeometry(q);if(null!=aa&&null!=aa.points&&0<aa.points.length&&1==A.length&&this.model.isVertex(A[0])){var ca= this.getCellGeometry(A[0]);if(null!=ca&&!ca.relative){var ra=new mxRectangle(ca.x+D,ca.y+I,ca.width,ca.height),Ca=aa.points;ca=[];for(var za=0;za<Ca.length;za++)ra.intersectsPoint(Ca[za].x,Ca[za].y)||ca.push(Ca[za]);ca.length<Ca.length&&(aa=aa.clone(),aa.points=ca,this.model.setGeometry(q,aa))}}B=x.apply(this,[q,A,B,D,I,K,P,X]);this.model.setValue(B,"");var Ia=this.getChildCells(B,!0);for(za=0;za<Ia.length;za++)aa=this.getCellGeometry(Ia[za]),null!=aa&&aa.relative&&0<aa.x&&this.model.remove(Ia[za]); var La=this.getChildCells(q,!0);for(za=0;za<La.length;za++)aa=this.getCellGeometry(La[za]),null!=aa&&aa.relative&&0>=aa.x&&this.model.remove(La[za]);var Qa=this.model.getTerminal(B,!1);if(null!=Qa){var ha=this.getCurrentCellStyle(Qa);null!=ha&&"1"==ha.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[q]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[q]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[B]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[B]))}}finally{this.model.endUpdate()}return B}; var v=Graph.prototype.selectCell;Graph.prototype.selectCell=function(q,A,B){if(A||B)v.apply(this,arguments);else{var D=this.getSelectionCell(),I=null,K=[],P=mxUtils.bind(this,function(X){if(null!=this.view.getState(X)&&(this.model.isVertex(X)||this.model.isEdge(X)))if(K.push(X),X==D)I=K.length-1;else if(q&&null==D&&0<K.length||null!=I&&q&&K.length>I||!q&&0<I)return;for(var aa=0;aa<this.model.getChildCount(X);aa++)P(this.model.getChildAt(X,aa))});P(this.model.root);0<K.length&&(I=null!=I?mxUtils.mod(I+ (q?1:-1),K.length):0,this.setSelectionCell(K[I]))}};Graph.prototype.swapShapes=function(q,A){if(this.model.isVertex(q)&&this.model.isVertex(A)&&2==this.getMovableCells([q,A]).length){var B=this.getCellGeometry(q),D=this.getCellGeometry(A);if(null!=B&&null!=D){var I=B.clone(),K=D.clone();this.model.beginUpdate();try{I.x=D.getCenterX()-B.width/2,I.y=D.getCenterY()-B.height/2,K.x=B.getCenterX()-D.width/2,K.y=B.getCenterY()-D.height/2,this.model.setGeometry(q,I),this.model.setGeometry(A,K)}finally{this.model.endUpdate()}}}}; var z=Graph.prototype.moveCells;Graph.prototype.moveCells=function(q,A,B,D,I,K,P){P=null!=P?P:{};if(this.isTable(I)){for(var X=[],aa=0;aa<q.length;aa++)this.isTable(q[aa])?X=X.concat(this.model.getChildCells(q[aa],!0).reverse()):X.push(q[aa]);q=X}this.model.beginUpdate();try{X=[];for(aa=0;aa<q.length;aa++)if(null!=I&&this.isTableRow(q[aa])){var ca=this.model.getParent(q[aa]),ra=this.getCellGeometry(q[aa]);this.isTable(ca)&&X.push(ca);if(null!=ca&&null!=ra&&this.isTable(ca)&&this.isTable(I)&&(D||ca!= I)){if(!D){var Ca=this.getCellGeometry(ca);null!=Ca&&(Ca=Ca.clone(),Ca.height-=ra.height,this.model.setGeometry(ca,Ca))}Ca=this.getCellGeometry(I);null!=Ca&&(Ca=Ca.clone(),Ca.height+=ra.height,this.model.setGeometry(I,Ca));var za=this.model.getChildCells(I,!0);if(0<za.length){q[aa]=D?this.cloneCell(q[aa]):q[aa];var Ia=this.model.getChildCells(q[aa],!0),La=this.model.getChildCells(za[0],!0),Qa=La.length-Ia.length;if(0<Qa)for(var ha=0;ha<Qa;ha++){var oa=this.cloneCell(Ia[Ia.length-1]);null!=oa&&(oa.value= "",this.model.add(q[aa],oa))}else if(0>Qa)for(ha=0;ha>Qa;ha--)this.model.remove(Ia[Ia.length+ha-1]);Ia=this.model.getChildCells(q[aa],!0);for(ha=0;ha<La.length;ha++){var qa=this.getCellGeometry(La[ha]),Ba=this.getCellGeometry(Ia[ha]);null!=qa&&null!=Ba&&(Ba=Ba.clone(),Ba.width=qa.width,this.model.setGeometry(Ia[ha],Ba))}}}}var Na=z.apply(this,arguments);for(aa=0;aa<X.length;aa++)!D&&this.model.contains(X[aa])&&0==this.model.getChildCount(X[aa])&&this.model.remove(X[aa]);D&&this.updateCustomLinks(this.createCellMapping(P, this.createCellLookup(q)),Na)}finally{this.model.endUpdate()}return Na};var C=Graph.prototype.removeCells;Graph.prototype.removeCells=function(q,A){var B=[];this.model.beginUpdate();try{for(var D=0;D<q.length;D++)if(this.isTableCell(q[D])){var I=this.model.getParent(q[D]),K=this.model.getParent(I);1==this.model.getChildCount(I)&&1==this.model.getChildCount(K)?0>mxUtils.indexOf(q,K)&&0>mxUtils.indexOf(B,K)&&B.push(K):this.labelChanged(q[D],"")}else{if(this.isTableRow(q[D])&&(K=this.model.getParent(q[D]), 0>mxUtils.indexOf(q,K)&&0>mxUtils.indexOf(B,K))){for(var P=this.model.getChildCells(K,!0),X=0,aa=0;aa<P.length;aa++)0<=mxUtils.indexOf(q,P[aa])&&X++;X==P.length&&B.push(K)}B.push(q[D])}B=C.apply(this,[B,A])}finally{this.model.endUpdate()}return B};Graph.prototype.updateCustomLinks=function(q,A,B){B=null!=B?B:new Graph;for(var D=0;D<A.length;D++)null!=A[D]&&B.updateCustomLinksForCell(q,A[D],B)};Graph.prototype.updateCustomLinksForCell=function(q,A){this.doUpdateCustomLinksForCell(q,A);for(var B=this.model.getChildCount(A), D=0;D<B;D++)this.updateCustomLinksForCell(q,this.model.getChildAt(A,D))};Graph.prototype.doUpdateCustomLinksForCell=function(q,A){};Graph.prototype.getAllConnectionConstraints=function(q,A){if(null!=q){A=mxUtils.getValue(q.style,"points",null);if(null!=A){q=[];try{var B=JSON.parse(A);for(A=0;A<B.length;A++){var D=B[A];q.push(new mxConnectionConstraint(new mxPoint(D[0],D[1]),2<D.length?"0"!=D[2]:!0,null,3<D.length?D[3]:0,4<D.length?D[4]:0))}}catch(K){}return q}if(null!=q.shape&&null!=q.shape.bounds){D= q.shape.direction;A=q.shape.bounds;var I=q.shape.scale;B=A.width/I;A=A.height/I;if(D==mxConstants.DIRECTION_NORTH||D==mxConstants.DIRECTION_SOUTH)D=B,B=A,A=D;A=q.shape.getConstraints(q.style,B,A);if(null!=A)return A;if(null!=q.shape.stencil&&null!=q.shape.stencil.constraints)return q.shape.stencil.constraints;if(null!=q.shape.constraints)return q.shape.constraints}}return null};Graph.prototype.flipEdge=function(q){if(null!=q){var A=this.getCurrentCellStyle(q);A=mxUtils.getValue(A,mxConstants.STYLE_ELBOW, mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,A,[q])}};var F=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(q){null!=q&&this.setCellStyles("innerLoopWaypoints",null,[q]);return F.apply(this,arguments)};var G=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(q,A){if(null!=q){var B=q.getVisibleTerminalState(!0),D=q.getVisibleTerminalState(!1);if(null!= B&&B==D){B=this.createEdgeSegmentHandler(q);var I=B.changePoints,K=B.getPreviewPoints,P=B.updatePreviewState,X=B.clonePreviewState;B.getPreviewPoints=function(ca){if(!this.isSource&&!this.isTarget){var ra=this.getCurrentPoints();return null!=ra&&4==ra.length&&1<this.index&&this.index<ra.length-1&&(ra=this.graph.getLoopAroundPoints(this.state,ca),null!=ra)?this.graph.keepLoopOutsideShape(this.state,ra):this.graph.keepLoopOutsideShape(this.state,K.apply(this,arguments))}return K.apply(this,arguments)}; B.clonePreviewState=function(ca,ra){var Ca=X.apply(this,arguments);this.isSource||this.isTarget||null==Ca||null==Ca.style||(Ca.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Ca.style.innerLoopWaypoints="1");return Ca};B.changePoints=function(ca,ra,Ca){ra=this.graph.keepLoopOutsideShape(this.state,ra);var za=this.graph.getModel();za.beginUpdate();try{ca=I.call(this,ca,ra,Ca),null!=ca&&null!=ra&&2<=ra.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ca]),this.graph.setCellStyles("innerLoopWaypoints", "1",[ca]))}finally{za.endUpdate()}return ca};var aa=B.start;B.start=function(ca,ra,Ca){this.validLoopPoints=null;aa.apply(this,arguments)};B.rerouteLoopPreview=function(ca){var ra=this.state.getVisibleTerminalState(!0),Ca=this.state.getVisibleTerminalState(!1);ca.view.updateFixedTerminalPoints(ca,ra,Ca);ca.view.updatePoints(ca,this.points,ra,Ca);ca.view.updateFloatingTerminalPoints(ca,ra,Ca)};B.getCommittedLoopPoints=function(){var ca=this.graph.getCellGeometry(this.state.cell);if(null!=ca&&null!= ca.points&&2<=ca.points.length)return ca.points.map(function(Qa){return new mxPoint(Qa.x,Qa.y)});ca=this.state.absolutePoints;if(null!=ca&&4<=ca.length){for(var ra=this.state.view.scale,Ca=this.state.view.translate,za=this.state.origin,Ia=[],La=1;La<ca.length-1;La++)null!=ca[La]&&Ia.push(new mxPoint(ca[La].x/ra-Ca.x-za.x,ca[La].y/ra-Ca.y-za.y));if(2<=Ia.length)return Ia}return null};B.isLoopSpike=function(ca){ca=ca.absolutePoints;if(null==ca||2>ca.length||null==ca[0]||null==ca[ca.length-1])return!0; var ra=this.graph.gridSize*this.state.view.scale/2;return Math.abs(ca[0].x-ca[ca.length-1].x)<ra&&Math.abs(ca[0].y-ca[ca.length-1].y)<ra};B.updatePreviewState=function(ca,ra,Ca,za,Ia){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());P.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&&0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var La= this.graph.getLoopAroundPoints(this.state,ra);null!=La&&(this.points=this.graph.keepLoopOutsideShape(this.state,La),this.rerouteLoopPreview(ca))}this.isLoopSpike(ca)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(Qa){return new mxPoint(Qa.x,Qa.y)}),this.rerouteLoopPreview(ca)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(Qa){return new mxPoint(Qa.x,Qa.y)}))}};return B}}return G.apply(this,arguments)};Graph.prototype.isValidRoot= function(q){for(var A=this.model.getChildCount(q),B=0,D=0;D<A;D++){var I=this.model.getChildAt(q,D);this.model.isVertex(I)&&(I=this.getCellGeometry(I),null==I||I.relative||B++)}return 0<B||this.isContainer(q)};Graph.prototype.isValidDropTarget=function(q,A,B){for(var D=this.getCurrentCellStyle(q),I=!0,K=!0,P=0;P<A.length&&K;P++)I=I&&this.isTable(A[P]),K=K&&this.isTableRow(A[P]);return!this.isCellLocked(q)&&null==this.getLockedGroupAncestor(q)&&(this.isTargetShape(q,A,B)||("1"!=mxUtils.getValue(D, "part","0")||this.isContainer(q))&&"0"!=mxUtils.getValue(D,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(q))&&!this.isTableRow(q)&&(!this.isTable(q)||K||I))};Graph.prototype.createGroupCell=function(){var q=mxGraph.prototype.createGroupCell.apply(this,arguments);q.setStyle(Editor.defaultTransparentGroups?"group;transparentBounds=1;":"group");return q};var H=Graph.prototype.translateCell;Graph.prototype.translateCell=function(q,A,B){if(this.isTransparentBounds(q))for(var D= this.model.getChildCount(q),I=0;I<D;I++)this.translateCell(this.model.getChildAt(q,I),A,B);else H.apply(this,arguments)};var J=Graph.prototype.groupCells;Graph.prototype.groupCells=function(q,A,B){null==q&&Editor.defaultTransparentGroups&&(q=this.createGroupCell(B));if(null!=q&&this.isTransparentBounds(q)){null==B&&(B=mxUtils.sortCells(this.getSelectionCells(),!0));B=this.getCellsForGroup(B);if(0<B.length){var D=this.model.getParent(q);null==D&&(D=this.model.getParent(B[0]));this.model.beginUpdate(); try{this.model.setGeometry(q,new mxGeometry(0,0,0,0));var I=this.model.getChildCount(D);this.cellsAdded([q],D,I,null,null,!1,!1,!1);I=this.model.getChildCount(q);this.cellsAdded(B,q,I,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",q,"border",A,"cells",B))}finally{this.model.endUpdate()}}return q}return J.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(q){var A=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(A&&null!=q&&null!=this.layoutManager){var B= this.model.getParent(q);null!=B&&(B=this.layoutManager.getLayout(B),null!=B&&B.constructor==mxStackLayout&&(A=!1))}return A};Graph.prototype.getPreferredSizeForCell=function(q,A,B){B=null!=B?B:this.gridEnabled;var D=this.getShapeInsidePreferredSize(q,A,B);null==D&&(D=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments),null!=D&&(D.width+=10,D.height+=4,B&&(D.width=this.snap(D.width),D.height=this.snap(D.height))));return D};Graph.prototype.getShapeInsidePreferredSize=function(q,A,B){var D= null,I=null!=q?this.getCurrentCellStyle(q):null,K=null!=I?mxUtils.getValue(I,"shapeInsideShape",null):null;K=null==K||""==K?null!=I?mxUtils.getValue(I,mxConstants.STYLE_SHAPE,null):null:K;if(null!=q&&this.model.isVertex(q)&&"function"===typeof Graph.shapeInsideOutlines[K]){I=this.getCellGeometry(q);var P=this.view.getState(q);P=null!=P?P:this.view.createState(q);if(null!=I&&null!=P&&0<I.width&&0<I.height&&this.isShapeInsideEnabled(P.style)){var X=this.cellRenderer.getLabelValue(P);if(null!=X&&""!= X){X=X.replace(/\n/g,"<br>");var aa=I.width,ca=I.height,ra=mxUtils.bind(this,function(za,Ia){var La=this.getShapeInsideOutline(P.style,za,Ia);if(null==La)return!1;var Qa=this.getShapeInsideBox(P.style,za,Ia);za=this.measureShapeInsideFlow(X,P.style,La,Qa,0,za,Ia);return null!=za&&za.bottom<=Qa.height+.5&&za.right<=Qa.width+.5});if(null!=this.measureShapeInsideFlow(X,P.style,this.getShapeInsideOutline(P.style,aa,ca)||{left:null,right:null},this.getShapeInsideBox(P.style,aa,ca),0,aa,ca)){var Ca=null!= A?function(za){return[aa,Math.max(1,ca*za)]}:function(za){return[Math.max(1,aa*za),Math.max(1,ca*za)]};q=function(za){za=Ca(za);return ra(za[0],za[1])};A=D=1;if(q(1)){for(;.0625<D&&q(.5*D);)D*=.5;A=D;D*=.5}else{for(D=0;7>D++&&!q(2*A);)A*=2;D=A;A*=2;if(!q(A))return null}for(I=0;6>I;I++)K=(D+A)/2,q(K)?A=K:D=K;A=Ca(A);q=Math.ceil(A[0]);A=Math.ceil(A[1]);B&&(q=this.snap(q+this.gridSize/2),A=this.snap(A+this.gridSize/2));D=new mxRectangle(0,0,q,A)}}}}return D};Graph.prototype.getAutosizeTextAvailableSpace= function(q,A,B,D){var I=0,K=0;(null!=D&&null!=this.getImage(D)||null!=q[mxConstants.STYLE_IMAGE])&&q[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(q[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(I+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),q[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(K+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));I+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING, 2));I+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_LEFT,2));I+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_RIGHT,2));K+=2*parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING,2));K+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_TOP,2));K+=parseFloat(mxUtils.getValue(q,mxConstants.STYLE_SPACING_BOTTOM,2));null!=D&&(D=this.getFoldingImage(D),null!=D&&(I+=D.width+8));q=mxUtils.getValue(q,mxConstants.STYLE_HORIZONTAL,!0);I=(q?A:B)-I;A=(q?B:A)-K;return 0>=I||0>=A?null: {availW:I,availH:A}};Graph.prototype.computeAutosizeTextFontSize=function(q,A,B,D,I,K){var P=1,X=84,aa=K?A:null,ca=null;if(K){for(var ra=q.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Ca=[],za=0;za<ra.length;za++)0<ra[za].length&&Ca.push(mxUtils.htmlEntities(ra[za],!1));0<Ca.length&&(ca=Ca.join("<br>"))}for(;P<X;)ra=Math.ceil((P+X)/2),Ca=mxUtils.getSizeForString(q,ra,D,aa,I),(Ca=K?Ca.height<=B:Ca.width<=A&&Ca.height<=B)&&K&&null!=ca&&mxUtils.getSizeForString(ca,ra,D,null,I).width> A&&(Ca=!1),Ca?P=ra:X=ra-1;return Math.max(6,P)};Graph.prototype.updateAutosizeTextFontSize=function(q,A){var B=this.view.getState(q);null==B&&(B=this.view.createState(q));A=A||B.style;var D=this.getCellGeometry(q);if(null!=D&&!this.model.isEdge(q)){var I=this.cellRenderer.getLabelValue(B);if(null!=I&&0!=I.length&&(B=this.getAutosizeTextAvailableSpace(A,D.width,D.height,B),null!=B)){this.isHtmlLabel(q)||(I=mxUtils.htmlEntities(I,!1));I=I.replace(/\n/g,"<br>");var K=A[mxConstants.STYLE_FONTFAMILY]|| mxConstants.DEFAULT_FONTFAMILY,P=A[mxConstants.STYLE_FONTSTYLE],X="wrap"==A[mxConstants.STYLE_WHITE_SPACE],aa=null;if(X){var ca=this.getShapeInsideFloats(A,D.width,D.height);null!=ca&&(aa=this.computeShapeInsideFontSize(I,A,ca,D.width,D.height))}null==aa&&(aa=this.computeAutosizeTextFontSize(I,B.availW,B.availH,K,P,X));this.setCellStyles(mxConstants.STYLE_FONTSIZE,aa,[q])}}};Graph.prototype.cellsResized=function(q,A,B){var D=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=q)for(var I= 0;I<q.length;I++)this.model.isVertex(q[I])&&this.isAutosizeTextCell(q[I])&&this.updateAutosizeTextFontSize(q[I]);return D};Graph.prototype.isRotatableGroup=function(q){var A=this.getModel();return A.isVertex(q)&&0<A.getChildCount(q)&&!this.isTable(q)&&!this.isTableRow(q)&&!this.isTableCell(q)&&!this.isSwimlane(q)};Graph.prototype.setCellRotation=function(q,A){var B=parseFloat(A);!isNaN(B)&&this.isRotatableGroup(q)?this.rotateCell(q,B-(parseFloat(this.getCurrentCellStyle(q)[mxConstants.STYLE_ROTATION])|| 0)):this.setCellStyles(mxConstants.STYLE_ROTATION,A,[q])};Graph.prototype.rotateCell=function(q,A,B){if(0!=A){var D=this.getModel();if(D.isVertex(q)||D.isEdge(q)){D.beginUpdate();try{if(!D.isEdge(q)){var I=(this.getCurrentCellStyle(q)[mxConstants.STYLE_ROTATION]||0)+A;this.setCellStyles(mxConstants.STYLE_ROTATION,I,[q])}var K=this.getCellGeometry(q);if(null!=K){var P=this.getCellGeometry(B);null==P||D.isEdge(B)||(K=K.clone(),K.rotate(A,new mxPoint(P.width/2,P.height/2)),D.setGeometry(q,K));if(D.isVertex(q)&& !K.relative||D.isEdge(q)){var X=D.getChildCount(q);for(B=0;B<X;B++)this.rotateCell(D.getChildAt(q,B),A,q)}}}finally{D.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(q){return this.isRotatableGroup(q)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(q)[mxConstants.STYLE_ROTATION])||0,360)};var O=Graph.prototype.resizeChildCells;Graph.prototype.resizeChildCells=function(q,A){if(this.isRotatedGroupResize(q)){var B=parseFloat(this.getCurrentCellStyle(q)[mxConstants.STYLE_ROTATION])|| 0;this.resizeRotatedGroupChildren(q,this.model.getGeometry(q),A,B,B)}else O.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(q,A,B,D,I){var K=this.getModel(),P=0!=A.width?B.width/A.width:1,X=0!=A.height?B.height/A.height:1,aa=mxUtils.toRadians(D),ca=Math.cos(-aa),ra=Math.sin(-aa);aa=mxUtils.toRadians(I);var Ca=Math.cos(aa),za=Math.sin(aa),Ia=A.width/2,La=A.height/2,Qa=B.width/2,ha=B.height/2,oa=function($a,cb){var pb=ca*($a-Ia)-ra*(cb-La);$a=ra*($a-Ia)+ca*(cb-La);pb*=P;$a*= X;return new mxPoint(Qa+Ca*pb-za*$a,ha+za*pb+Ca*$a)};A=function($a){if(null!=$a)for(var cb=0;cb<$a.length;cb++)if(null!=$a[cb]){var pb=oa($a[cb].x,$a[cb].y);$a[cb].x=pb.x;$a[cb].y=pb.y}};B=K.getChildCount(q);for(aa=0;aa<B;aa++){var qa=K.getChildAt(q,aa),Ba=this.getCellGeometry(qa);if(null!=Ba)if(K.isEdge(qa))Ba=Ba.clone(),A([Ba.sourcePoint,Ba.targetPoint]),A(Ba.points),K.setGeometry(qa,Ba);else if(K.isVertex(qa)&&!Ba.relative){var Na=this.getCurrentCellStyle(qa),Ra=parseFloat(Na[mxConstants.STYLE_ROTATION])|| 0,Ga=mxUtils.toRadians(Ra-D),Ya=P*Math.cos(Ga),qb=X*Math.sin(Ga),hb=Math.sqrt(Ya*Ya+qb*qb);Ga=Math.sqrt(P*P*Math.sin(Ga)*Math.sin(Ga)+X*X*Math.cos(Ga)*Math.cos(Ga));"fixed"==Na[mxConstants.STYLE_ASPECT]&&(hb=Ga=Math.min(hb,Ga));var Fb=oa(Ba.getCenterX(),Ba.getCenterY()),Cb=Ba;Ba=Ba.clone();var xb=Ra;this.isCellResizable(qa)&&("0"!=Na[mxConstants.STYLE_RESIZE_WIDTH]&&(Ba.width=Cb.width*hb),"0"!=Na[mxConstants.STYLE_RESIZE_HEIGHT]&&(Ba.height=Cb.height*Ga),xb=Math.round(100*(I+mxUtils.toDegree(Math.atan2(qb, Ya))))/100);this.isCellMovable(qa)&&(Ba.x=Fb.x-Ba.width/2,Ba.y=Fb.y-Ba.height/2);K.setGeometry(qa,Ba);.01<Math.abs(mxUtils.mod(xb,360)-mxUtils.mod(Ra,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(xb,360),[qa]):xb=Ra;this.resizeRotatedGroupChildren(qa,Cb,Ba,Ra,xb)}else this.scaleCell(qa,P,X,!0)}};Graph.prototype.turnShapes=function(q,A){var B=this.getModel(),D=[];B.beginUpdate();try{for(var I=0;I<q.length;I++){var K=q[I];if(B.isEdge(K)){var P=B.getTerminal(K,!0),X=B.getTerminal(K, !1);if(null!=P&&P==X){var aa=this.view.getState(K),ca=B.getGeometry(K);if(null!=aa&&null!=ca&&null!=aa.absolutePoints&&4<=aa.absolutePoints.length&&(null==ca.points||2>ca.points.length)&&null==aa.style[mxConstants.STYLE_EXIT_X]&&null==aa.style[mxConstants.STYLE_ENTRY_X]){for(var ra=this.view.scale,Ca=this.view.translate,za=aa.origin,Ia=aa.absolutePoints,La=[],Qa=1;Qa<Ia.length-1;Qa++)null!=Ia[Qa]&&La.push(new mxPoint(Ia[Qa].x/ra-Ca.x-za.x,Ia[Qa].y/ra-Ca.y-za.y));2<=La.length&&(ca=ca.clone(),ca.points= La,B.setGeometry(K,ca),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[K]),this.setCellStyles("innerLoopWaypoints","1",[K]))}}B.setTerminal(K,X,!0);B.setTerminal(K,P,!1);var ha=B.getGeometry(K);if(null!=ha){ha=ha.clone();null!=ha.points&&ha.points.reverse();var oa=ha.getTerminalPoint(!0),qa=ha.getTerminalPoint(!1);ha.setTerminalPoint(oa,!1);ha.setTerminalPoint(qa,!0);B.setGeometry(K,ha);var Ba=this.view.getState(K),Na=this.view.getState(P),Ra=this.view.getState(X);if(null!=Ba){var Ga= null!=Na?this.getConnectionConstraint(Ba,Na,!0):null,Ya=null!=Ra?this.getConnectionConstraint(Ba,Ra,!1):null;this.setConnectionConstraint(K,P,!0,Ya);this.setConnectionConstraint(K,X,!1,Ga);var qb=mxUtils.getValue(Ba.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Ba.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING),[K]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,qb,[K])}D.push(K)}}else if(B.isVertex(K))if(this.isRotatableGroup(K))this.rotateCell(K, A?-90:90),D.push(K);else if(ha=this.getCellGeometry(K),null!=ha){if(!(this.isTable(K)||this.isTableRow(K)||this.isTableCell(K)||this.isSwimlane(K))){ha=ha.clone();ha.x+=ha.width/2-ha.height/2;ha.y+=ha.height/2-ha.width/2;var hb=ha.width;ha.width=ha.height;ha.height=hb;B.setGeometry(K,ha)}var Fb=this.view.getState(K);if(null!=Fb){var Cb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],xb=mxUtils.getValue(Fb.style,mxConstants.STYLE_DIRECTION, mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Cb[mxUtils.mod(mxUtils.indexOf(Cb,xb)+(A?-1:1),Cb.length)],[K])}D.push(K)}}}finally{B.endUpdate()}return D};Graph.prototype.rotateEdges=function(q,A){var B=this.getModel(),D=[];B.beginUpdate();try{for(var I=0;I<q.length;I++){var K=q[I];if(B.isEdge(K)&&!this.isCellLocked(K)&&null==B.getTerminal(K,!0)&&null==B.getTerminal(K,!1)){var P=B.getGeometry(K);if(null!=P&&null!=P.getTerminalPoint(!0)&&null!=P.getTerminalPoint(!1)){P= P.clone();var X=[P.getTerminalPoint(!0),P.getTerminalPoint(!1)];null!=P.points&&(X=X.concat(P.points));for(var aa=X[0].x,ca=X[0].y,ra=X[0].x,Ca=X[0].y,za=1;za<X.length;za++)aa=Math.min(aa,X[za].x),ca=Math.min(ca,X[za].y),ra=Math.max(ra,X[za].x),Ca=Math.max(Ca,X[za].y);var Ia=(aa+ra)/2,La=(ca+Ca)/2;for(za=0;za<X.length;za++){var Qa=X[za].x-Ia,ha=X[za].y-La;X[za].x=A?Ia+ha:Ia-ha;X[za].y=A?La-Qa:La+Qa}B.setGeometry(K,P);D.push(K)}}}}finally{B.endUpdate()}return D};Graph.prototype.stencilHasPlaceholders= function(q){if(null!=q&&null!=q.fgNode)for(q=q.fgNode.firstChild;null!=q;){if("text"==q.nodeName&&"1"==q.getAttribute("placeholders"))return!0;q=q.nextSibling}return!1};var M=Graph.prototype.processChange;Graph.prototype.processChange=function(q){if(q instanceof mxGeometryChange&&(this.isTableCell(q.cell)||this.isTableRow(q.cell))&&(null==q.previous&&null!=q.geometry||null!=q.previous&&(null==q.previous.equals||!q.previous.equals(q.geometry)))){var A=q.cell;this.isTableCell(A)&&(A=this.model.getParent(A)); this.isTableRow(A)&&(A=this.model.getParent(A));var B=this.view.getState(A);null!=B&&null!=B.shape&&(this.view.invalidate(A),B.shape.bounds=null)}M.apply(this,arguments);q instanceof mxValueChange&&null!=q.cell&&null!=q.cell.value&&"object"==typeof q.cell.value&&this.invalidateDescendantsWithPlaceholders(q.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(q){q=this.model.getDescendants(q);if(0<q.length)for(var A=0;A<q.length;A++){var B=this.view.getState(q[A]);null!=B&&null!=B.shape&& null!=B.shape.stencil&&this.stencilHasPlaceholders(B.shape.stencil)?this.removeStateForCell(q[A]):this.isReplacePlaceholders(q[A])&&this.view.invalidate(q[A],!1,!1)}};Graph.prototype.replaceElement=function(q,A){A=q.ownerDocument.createElement(null!=A?A:"span");for(var B=Array.prototype.slice.call(q.attributes);attr=B.pop();)A.setAttribute(attr.nodeName,attr.nodeValue);A.innerHTML=q.innerHTML;q.parentNode.replaceChild(A,q)};Graph.prototype.processElements=function(q,A){if(null!=q){q=q.getElementsByTagName("*"); for(var B=0;B<q.length;B++)null!=q[B]&&A(q[B])}};Graph.prototype.updateLabelElements=function(q,A,B){q=null!=q?q:this.getSelectionCells();for(var D=document.createElement("div"),I=0;I<q.length;I++){var K=this.getCurrentCellStyle(q[I]);if(null!=K&&"1"==K.html&&(K=this.convertValueToString(q[I]),null!=K&&0<K.length)){D.innerHTML=Graph.sanitizeHtml(K);for(var P=D.getElementsByTagName(null!=B?B:"*"),X=0;X<P.length;X++)A(P[X]);D.innerHTML!=K&&this.cellLabelChanged(q[I],D.innerHTML)}}};Graph.prototype.cellLabelChanged= function(q,A,B){A=Graph.zapGremlins(A);this.model.beginUpdate();try{if(null!=q.value&&"object"==typeof q.value){if(this.isReplacePlaceholders(q)&&null!=q.getAttribute("placeholder"))for(var D=q.getAttribute("placeholder"),I=q;null!=I;){if(I==this.model.getRoot()||null!=I.value&&"object"==typeof I.value&&I.hasAttribute(D)){this.setAttributeForCell(I,D,A);break}I=this.model.getParent(I)}var K=q.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&K.hasAttribute("label_"+Graph.diagramLanguage)? K.setAttribute("label_"+Graph.diagramLanguage,A):K.setAttribute("label",A);A=K}mxGraph.prototype.cellLabelChanged.apply(this,arguments);this.isAutosizeTextCell(q)&&this.updateAutosizeTextFontSize(q)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(q){if(null!=q){for(var A=new mxDictionary,B=0;B<q.length;B++)A.put(q[B],!0);var D=[];for(B=0;B<q.length;B++){var I=this.model.getParent(q[B]);null==I||A.get(I)||(A.put(I,!0),D.push(I))}for(B=0;B<D.length;B++)if(I=this.view.getState(D[B]), null!=I&&(this.model.isEdge(I.cell)||this.model.isVertex(I.cell))&&this.isCellDeletable(I.cell)&&(this.isTransparentState(I)||this.isTransparentBounds(I.cell))){for(var K=!0,P=0;P<this.model.getChildCount(I.cell)&&K;P++)A.get(this.model.getChildAt(I.cell,P))||(K=!1);K&&q.push(I.cell)}A=new mxDictionary;for(B=0;B<q.length;B++)A.put(q[B],!0);for(B=0;B<D.length;B++)for(I=D[B];!A.get(I)&&this.isTransparentBounds(I);){K=null;var X=!1,aa=this.model.getChildCount(I);for(P=0;P<aa;P++){var ca=this.model.getChildAt(I, P);if(!A.get(ca)){if(null!=K){X=!0;break}K=ca}}if(X||null==K||!this.isTransparentBounds(K)||!this.isCellDeletable(K))break;P=this.model.getChildren(K);null!=P&&0<P.length&&this.cellsAdded(P.slice(),I,this.model.getChildCount(I),null,null,!0);A.put(K,!0);q.push(K)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(q){for(var A=[],B=0;B<q.length;B++)this.isCellDeletable(q[B])&&(this.isTransparentState(this.view.getState(q[B]))||this.isTransparentBounds(q[B]))&& A.push(q[B]);q=A;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(q,A){this.setAttributeForCell(q,"link",A)};Graph.prototype.createLinkOverlay=function(q){var A=this.getLinkForCell(q);if(null!=A&&0<A.length){var B=this.getLinkOverlayTooltip(A);B=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),B,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));B.isLinkOverlay=!0;B.cursor="pointer";var D=this;B.addListener(mxEvent.CLICK, mxUtils.bind(this,function(I,K){D.isEnabled()?D.setSelectionCell(K.getProperty("cell")):this.isCustomLink(A)?this.customLinkClicked(A,q):(I=this.getLinkTargetForCell(q),this.openLink(this.getAbsoluteUrl(A),I))}));return B}return null};Graph.prototype.getLinkOverlayTooltip=function(q){return q};Graph.prototype.createTooltipOverlay=function(q){q=this.convertValueToTooltip(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkTooltipImage,16,16),q,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP, new mxPoint(-8,-8));q.isTooltipOverlay=!0;q.cursor="pointer";var A=this;q.addListener(mxEvent.CLICK,function(B,D){B=D.getProperty("cell");A.isEnabled()&&A.isCellEditable(B)?(A.setSelectionCell(B),A.editTooltip(B)):(D=D.getProperty("event"),B=A.convertValueToTooltip(B,!0),null!=B&&0<B.length&&A.tooltipHandler.show(B,D.clientX,D.clientY))});return q}return null};Graph.prototype.createNoteOverlay=function(q){q=this.getNoteForCell(q);if(null!=q&&0<q.length){q=new mxCellOverlay(new mxImage(Editor.lightDarkNoteImage, 16,16),null,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,new mxPoint(-8,8));q.isNoteOverlay=!0;q.cursor="pointer";var A=this;q.addListener(mxEvent.CLICK,function(B,D){A.showNoteBox(D.getProperty("cell"),D.getProperty("event"))});return q}return null};Graph.prototype.showNoteBox=function(q,A){var B=this.convertValueToNote(q);if(null!=B&&0!=B.length){this.hideNoteBox();Graph.installNoteBoxStyle();var D=document.createElement("div");D.className="geNoteBox";D.innerHTML=Graph.sanitizeHtml(B);if(this.isEnabled()&& this.isCellEditable(q)){B=document.createElement("a");B.className="geNoteEditBtn";B.setAttribute("title",mxResources.get("editNote",null,"Edit Note"));var I=document.createElement("img");I.setAttribute("src",Editor.editImage);B.appendChild(I);mxEvent.addListener(B,"click",mxUtils.bind(this,function(X){this.hideNoteBox();this.setSelectionCell(q);this.editNote(q);mxEvent.consume(X)}));D.insertBefore(B,D.firstChild)}var K=this;mxEvent.addListener(D,"click",function(X){for(var aa=mxEvent.getSource(X);null!= aa&&aa!=D;){if("A"==aa.nodeName){aa=aa.getAttribute("href");null!=aa&&K.openLink(aa);mxEvent.consume(X);break}aa=aa.parentNode}});document.body.appendChild(D);B=null!=A?mxEvent.getClientX(A):20;A=null!=A?mxEvent.getClientY(A):20;I=window.innerHeight||document.documentElement.clientHeight;D.style.left=Math.max(8,Math.min(B,(window.innerWidth||document.documentElement.clientWidth)-D.offsetWidth-8))+"px";D.style.top=Math.max(8,Math.min(A+8,I-D.offsetHeight-8))+"px";var P=mxUtils.bind(this,function(X){if("keydown"!= X.type||27==X.keyCode)"mousedown"==X.type&&D.contains(mxEvent.getSource(X))||this.hideNoteBox()});this.noteBox={div:D,closeHandler:P};window.setTimeout(function(){mxEvent.addListener(document,"mousedown",P);mxEvent.addListener(document,"keydown",P)},0)}};Graph.prototype.hideNoteBox=function(){null!=this.noteBox&&(null!=this.noteBox.div.parentNode&&this.noteBox.div.parentNode.removeChild(this.noteBox.div),mxEvent.removeListener(document,"mousedown",this.noteBox.closeHandler),mxEvent.removeListener(document, "keydown",this.noteBox.closeHandler),this.noteBox=null)};Graph.prototype.editNote=function(q){};Graph.prototype.editTooltip=function(q){};Graph.prototype.setTooltipForCell=function(q,A){var B="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(q.value)&&q.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(B="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(q,B,A)};Graph.prototype.getNoteForCell=function(q){return this.getAttributeForCell(q,"note",null)};Graph.prototype.setNoteForCell= function(q,A){this.setAttributeForCell(q,"note",null!=A&&0<A.length?A:null)};Graph.prototype.convertValueToNote=function(q){var A=this.getNoteForCell(q);null!=A&&this.isReplacePlaceholders(q)&&(A=this.replacePlaceholders(q,A));return A};Graph.prototype.getAttributeForCell=function(q,A,B){q=null!=q.value&&"object"===typeof q.value?q.value.getAttribute(A):null;return null!=q?q:B};Graph.prototype.setAttributeForCell=function(q,A,B){if(null!=q.value&&"object"==typeof q.value)var D=q.value.cloneNode(!0); else D=mxUtils.createXmlDocument().createElement("UserObject"),D.setAttribute("label",q.value||"");null!=B?D.setAttribute(A,B):D.removeAttribute(A);this.model.setValue(q,D)};Graph.prototype.isTargetShape=function(q,A,B){q=mxUtils.getValue(this.getCurrentCellStyle(q),mxConstants.STYLE_SHAPE,"");for(B=0;B<A.length;B++){var D=mxUtils.getValue(this.getCurrentCellStyle(A[B]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(D,q))return!0}return!1};var V=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget= function(q,A,B,D){if(mxEvent.isAltDown(A))return null;for(var I=0;I<q.length;I++){var K=this.model.getParent(q[I]);if(this.model.isEdge(K)&&0>mxUtils.indexOf(q,K))return null}K=V.apply(this,arguments);var P=!0;for(I=0;I<q.length&&P;I++)P=P&&this.isTableRow(q[I]);P&&(this.isTableCell(K)&&(K=this.model.getParent(K)),this.isTableRow(K)&&(K=this.model.getParent(K)),this.isTable(K)||(K=null));return K};Graph.prototype.click=function(q){mxGraph.prototype.click.call(this,q);this.firstClickState=q.getState(); this.firstClickSource=q.getSource()};Graph.prototype.dblClick=function(q,A){this.isEnabled()&&(A=this.insertTextForEvent(q,A),mxGraph.prototype.dblClick.call(this,q,A))};Graph.prototype.insertTextForEvent=function(q,A){var B=mxUtils.convertPoint(this.container,mxEvent.getClientX(q),mxEvent.getClientY(q));if(null!=q&&!this.model.isVertex(A)){var D=this.model.isEdge(A)?this.view.getState(A):null,I=mxEvent.getSource(q);this.firstClickState!=D||this.firstClickSource!=I||null!=D&&null!=D.text&&null!=D.text.node&& null!=D.text.boundingBox&&(mxUtils.contains(D.text.boundingBox,B.x,B.y)||mxUtils.isAncestorNode(D.text.node,mxEvent.getSource(q)))||(null!=D||this.isCellLocked(this.getDefaultParent()))&&(null==D||this.isCellLocked(D.cell)||null!=this.getLockedGroupAncestor(this.model.getParent(D.cell)))||!(null!=D||mxClient.IS_SVG&&I==this.view.getCanvas().ownerSVGElement)||(null==D&&(D=this.view.getState(this.getCellAt(B.x,B.y))),A=this.addText(B.x,B.y,D))}return A};Graph.prototype.getInsertPoint=function(q){q= this.getGridSize();var A=this.container.scrollLeft/this.view.scale-this.view.translate.x,B=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var D=this.getPageLayout(),I=this.getPageSize();A=Math.max(A,D.x*I.width);B=Math.max(B,D.y*I.height)}return new mxPoint(this.snap(A+q),this.snap(B+q))};Graph.prototype.getFreeInsertPoint=function(q){var A=this.view,B=this.getGraphBounds(),D=this.getInsertPoint(q);q=this.snap(Math.round(Math.max(D.x,B.x/A.scale-A.translate.x+ (0==B.width?2*this.gridSize:0))));A=this.snap(Math.round(Math.max(D.y,(B.y+B.height)/A.scale-A.translate.y+2*this.gridSize)));return new mxPoint(q,A)};Graph.prototype.getCenterInsertPoint=function(q){q=null!=q?q:new mxRectangle;return mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale- this.view.translate.y-q.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/2/this.view.scale-this.view.translate.x-q.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-q.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(q,A){q=null!=q?q:"";null!=A&&(0<q.length&&";"!=q.charAt(q.length-1)&&(q+=";"),q+="fontSize="+A+";");return q};Graph.prototype.addText=function(q,A,B){var D= new mxCell;D.value="Text";D.geometry=new mxGeometry(0,0,0,0);D.vertex=!0;if(null!=B&&this.model.isEdge(B.cell)){D.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);D.geometry.relative=!0;D.connectable=!1;var I=this.view.getRelativePoint(B,q,A);D.geometry.x=Math.round(1E4*I.x)/1E4;D.geometry.y=Math.round(I.y);D.geometry.offset=new mxPoint(0,0);I=this.view.getPoint(B,D.geometry);var K=this.view.scale;D.geometry.offset=new mxPoint(Math.round((q- I.x)/K),Math.round((A-I.y)/K))}else I=this.view.translate,D.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),D.geometry.width=40,D.geometry.height=20,D.geometry.x=Math.round(q/this.view.scale)-I.x-(null!=B?B.origin.x:0),D.geometry.y=Math.round(A/this.view.scale)-I.y-(null!=B?B.origin.y:0),D.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([D],null!=B?B.cell:null),this.fireEvent(new mxEventObject("textInserted", "cells",[D])),this.autoSizeCell(D)}finally{this.getModel().endUpdate()}return D};Graph.prototype.addClickHandler=function(q,A,B){var D=mxUtils.bind(this,function(){var aa=this.container.getElementsByTagName("a");if(null!=aa)for(var ca=0;ca<aa.length;ca++){var ra=this.getAbsoluteUrl(aa[ca].getAttribute("href"));null!=ra&&(aa[ca].setAttribute("rel",this.linkRelation),aa[ca].setAttribute("href",ra),null!=A&&mxEvent.addGestureListeners(aa[ca],null,null,A))}});this.model.addListener(mxEvent.CHANGE,D); D();var I=this.container.style.cursor,K=this.getTolerance(),P=this,X={currentState:null,currentLink:null,currentTarget:null,highlight:null!=q&&""!=q&&q!=mxConstants.NONE?new mxCellHighlight(P,q,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(aa){var ca=aa.sourceState;if(null==ca||null==P.getLinkForCell(ca.cell))aa=P.getCellAt(aa.getGraphX(),aa.getGraphY(),null,null,null,function(ra,Ca,za){return null==P.getLinkForCell(ra.cell)}),ca=null==ca||P.model.isAncestor(aa,ca.cell)? P.view.getState(aa):null;ca!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ca,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(aa,ca){this.startX=ca.getGraphX();this.startY=ca.getGraphY();this.scrollLeft=P.container.scrollLeft;this.scrollTop=P.container.scrollTop;null==this.currentLink&&"auto"==P.container.style.overflow&&(P.container.style.cursor="move");this.updateCurrentState(ca)},mouseMove:function(aa,ca){if(P.isMouseDown)null!=this.currentLink&& (aa=Math.abs(this.startX-ca.getGraphX()),ca=Math.abs(this.startY-ca.getGraphY()),(aa>K||ca>K)&&this.clear());else{for(aa=ca.getSource();null!=aa&&"a"!=aa.nodeName.toLowerCase();)aa=aa.parentNode;null!=aa?this.clear():(null!=P.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&P.tooltipHandler.reset(ca,!0,this.currentState),(null==this.currentState||ca.getState()!=this.currentState&&null!=ca.sourceState||!P.intersects(this.currentState,ca.getGraphX(),ca.getGraphY()))&&this.updateCurrentState(ca))}}, mouseUp:function(aa,ca){var ra=ca.getSource();for(aa=ca.getEvent();null!=ra&&"a"!=ra.nodeName.toLowerCase();)ra=ra.parentNode;null==ra&&Math.abs(this.scrollLeft-P.container.scrollLeft)<K&&Math.abs(this.scrollTop-P.container.scrollTop)<K&&(null==ca.sourceState||!ca.isSource(ca.sourceState.control))&&((mxEvent.isLeftMouseButton(aa)||mxEvent.isMiddleMouseButton(aa))&&!mxEvent.isPopupTrigger(aa)||mxEvent.isTouchEvent(aa))&&(null!=this.currentLink?(ra=P.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0, 5)&&ra||null==A||A(aa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(aa)||(aa=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(aa)?"_blank":ra?P.linkTarget:"_top",P.openLink(this.currentLink,aa),ca.consume())):null!=B&&!ca.isConsumed()&&Math.abs(this.scrollLeft-P.container.scrollLeft)<K&&Math.abs(this.scrollTop-P.container.scrollTop)<K&&Math.abs(this.startX-ca.getGraphX())<K&&Math.abs(this.startY-ca.getGraphY())<K&&B(ca.getEvent())); this.clear()},activate:function(aa){this.currentLink=P.getAbsoluteUrl(P.getLinkForCell(aa.cell));null!=this.currentLink&&(this.currentTarget=P.getLinkTargetForCell(aa.cell),P.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(aa))},clear:function(){null!=P.container&&(P.container.style.cursor=I);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=P.tooltipHandler&&P.tooltipHandler.hide()}};P.click=function(aa){}; P.addMouseListener(X);mxEvent.addListener(document,"mouseleave",function(aa){X.clear()})};Graph.prototype.duplicateCells=function(q,A){q=null!=q?q:this.getSelectionCells();A=null!=A?A:!0;for(var B=0;B<q.length;B++)this.isTableCell(q[B])&&(q[B]=this.model.getParent(q[B]));q=this.model.getTopmostCells(q);var D=this.getModel(),I=this.gridSize,K=[];D.beginUpdate();try{var P={},X=this.createCellLookup(q),aa=this.cloneCells(q,!1,P,!0);for(B=0;B<q.length;B++){var ca=D.getParent(q[B]);if(null!=ca){var ra= this.moveCells([aa[B]],I,I,!1)[0];K.push(ra);if(A)D.add(ca,aa[B]);else{var Ca=ca.getIndex(q[B]);D.add(ca,aa[B],Ca+1)}if(this.isTable(ca)){var za=this.getCellGeometry(aa[B]),Ia=this.getCellGeometry(ca);null!=za&&null!=Ia&&(Ia=Ia.clone(),Ia.height+=za.height,D.setGeometry(ca,Ia))}}else K.push(aa[B])}this.updateCustomLinks(this.createCellMapping(P,X),aa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",aa))}finally{D.endUpdate()}return K};Graph.prototype.insertImage=function(q,A,B){if(null!= q&&null!=this.cellEditor.textarea){for(var D=this.cellEditor.textarea.getElementsByTagName("img"),I=[],K=0;K<D.length;K++)I.push(D[K]);document.execCommand("insertimage",!1,q);q=this.cellEditor.textarea.getElementsByTagName("img");if(q.length==I.length+1)for(K=q.length-1;0<=K;K--)if(0==K||q[K]!=I[K-1]){q[K].setAttribute("width",A);q[K].setAttribute("height",B);break}}};Graph.prototype.insertLink=function(q){if(null!=this.cellEditor.textarea)if(0==q.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var A= this.cellEditor.textarea.getElementsByTagName("a"),B=[],D=0;D<A.length;D++)B.push(A[D]);document.execCommand("createlink",!1,mxUtils.trim(q));A=this.cellEditor.textarea.getElementsByTagName("a");if(A.length==B.length+1)for(D=A.length-1;0<=D;D--)if(A[D]!=B[D-1]){for(A=A[D].getElementsByTagName("a");0<A.length;){for(B=A[0].parentNode;null!=A[0].firstChild;)B.insertBefore(A[0].firstChild,A[0]);B.removeChild(A[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(q))};var Q=Graph.prototype.getResizableCells; Graph.prototype.getResizableCells=function(q){var A=Q.apply(this,arguments);if(null!=q)for(var B=0;B<q.length;B++)(this.isTransparentBounds(q[B])||this.getCurrentCellStyle(q[B])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(A,q[B])&&A.push(q[B]);return A};Graph.prototype.isCellResizable=function(q){if(this.isTransparentBounds(q))return!1;var A=mxGraph.prototype.isCellResizable.apply(this,arguments),B=this.getCurrentCellStyle(q);return!this.isTableCell(q)&&!this.isTableRow(q)&& (A||"0"!=mxUtils.getValue(B,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==B[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(q,A,B){null==A&&(A=this.getMovableCells(this.getSelectionCells()));var D=!1;if(null!=A)for(var I=0;I<A.length;I++)if(this.isTransparentBounds(A[I])){D=!0;break}if(!D)return mxGraph.prototype.alignCells.apply(this,arguments);var K=this;D=function(ra){if(K.model.isEdge(ra))return null;var Ca=K.getCellGeometry(ra);if(null==Ca||Ca.relative)return null;var za=K.getOriginForCell(ra); return K.isTransparentBounds(ra)?(ra=K.getTransparentBounds(ra),null==ra?null:new mxRectangle(za.x+Ca.x+ra.x,za.y+Ca.y+ra.y,ra.width,ra.height)):new mxRectangle(za.x+Ca.x,za.y+Ca.y,Ca.width,Ca.height)};if(null!=A&&1<A.length){if(null==B)for(I=0;I<A.length;I++){var P=D(A[I]);if(null!=P)if(null==B)if(q==mxConstants.ALIGN_CENTER){B=P.x+P.width/2;break}else if(q==mxConstants.ALIGN_RIGHT)B=P.x+P.width;else if(q==mxConstants.ALIGN_TOP)B=P.y;else if(q==mxConstants.ALIGN_MIDDLE){B=P.y+P.height/2;break}else B= q==mxConstants.ALIGN_BOTTOM?P.y+P.height:P.x;else B=q==mxConstants.ALIGN_RIGHT?Math.max(B,P.x+P.width):q==mxConstants.ALIGN_TOP?Math.min(B,P.y):q==mxConstants.ALIGN_BOTTOM?Math.max(B,P.y+P.height):Math.min(B,P.x)}if(null!=B){A=mxUtils.sortCells(A);this.model.beginUpdate();try{for(I=0;I<A.length;I++)if(P=D(A[I]),null!=P){var X=0,aa=0;q==mxConstants.ALIGN_CENTER?X=B-(P.x+P.width/2):q==mxConstants.ALIGN_RIGHT?X=B-(P.x+P.width):q==mxConstants.ALIGN_TOP?aa=B-P.y:q==mxConstants.ALIGN_MIDDLE?aa=B-(P.y+P.height/ 2):q==mxConstants.ALIGN_BOTTOM?aa=B-(P.y+P.height):X=B-P.x;if(0!=X||0!=aa)if(this.isTransparentBounds(A[I]))this.translateCell(A[I],X,aa);else{var ca=this.getCellGeometry(A[I]).clone();ca.x+=X;ca.y+=aa;this.resizeCell(A[I],ca)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",q,"cells",A))}finally{this.model.endUpdate()}}}return A};Graph.prototype.distributeCells=function(q,A,B){null==A&&(A=this.getSelectionCells());if(null!=A&&1<A.length){for(var D=[],I=null,K=null,P=0,X=0;X<A.length;X++)if(this.getModel().isVertex(A[X])){var aa= this.view.getState(A[X]);if(null!=aa){var ca=q?aa.getCenterX():aa.getCenterY();I=null!=I?Math.max(I,ca):ca;K=null!=K?Math.min(K,ca):ca;B&&(P+=q?aa.unscaledWidth:aa.unscaledHeight);D.push(aa)}}if(2<D.length){D.sort(function(Qa,ha){return q?Qa.x-ha.x:Qa.y-ha.y});B&&(P-=q?D[0].unscaledWidth/2+D[D.length-1].unscaledWidth/2:D[0].unscaledHeight/2+D[D.length-1].unscaledHeight/2);aa=this.view.translate;ca=this.view.scale;K=K/ca-(q?aa.x:aa.y);I=I/ca-(q?aa.x:aa.y);this.getModel().beginUpdate();try{var ra=(I- K-P)/(D.length-1),Ca=K+(B?q?D[0].unscaledWidth/2:D[0].unscaledHeight/2:0);for(X=1;X<D.length-1;X++){var za=this.view.getState(this.model.getParent(D[X].cell)),Ia=this.getCellGeometry(D[X].cell);Ca+=ra;if(null!=Ia&&null!=za)if(this.isTransparentBounds(D[X].cell)){var La=q?B?D[X].x/ca-aa.x:D[X].getCenterX()/ca-aa.x:B?D[X].y/ca-aa.y:D[X].getCenterY()/ca-aa.y;q?this.translateCell(D[X].cell,Ca-La,0):this.translateCell(D[X].cell,0,Ca-La)}else Ia=Ia.clone(),q?Ia.x=Math.round(Ca-(B?0:Ia.width/2))-za.origin.x: Ia.y=Math.round(Ca-(B?0:Ia.height/2))-za.origin.y,this.getModel().setGeometry(D[X].cell,Ia);B&&(Ca+=q?D[X].unscaledWidth:D[X].unscaledHeight)}}finally{this.getModel().endUpdate()}}}return A};Graph.prototype.isCloneEvent=function(q){return mxClient.IS_MAC&&mxEvent.isMetaDown(q)||mxEvent.isControlDown(q)};Graph.prototype.createSvgImageExport=function(q,A,B,D){q=new mxImageExport;var I=this;if(B){var K=q.drawCellState;q.drawCellState=function(X,aa){K.apply(this,arguments);if(null!=aa.root&&null!=X.cell&& null!=X.cell.geometry){var ca=I.view.scale,ra=function(Ia,La,Qa,ha,oa,qa,Ba){null!=Ba&&aa.setLink(Ba,D);aa.image(La,Qa,16,16,Ia,!0);null!=Ba&&aa.setLink(null);Ia=aa.root.lastChild;null!=Ia&&(La=Ia.ownerDocument.createElementNS(mxConstants.NS_SVG,"g"),La.style.cursor="pointer",La.setAttribute("data-icon",oa),null!=qa&&La.setAttribute("data-icon-content",qa),null!=ha&&""!=ha&&(oa=Ia.ownerDocument.createElementNS(mxConstants.NS_SVG,"title"),mxUtils.write(oa,ha.substring(0,1E3)),La.appendChild(oa)),aa.root.replaceChild(La, Ia),La.appendChild(Ia),oa=(ha="a"==Ia.nodeName.toLowerCase())?Ia.lastChild:Ia,null!=oa&&null!=oa.getAttribute&&null!=oa.getAttribute("x")&&(qa=Ia.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect"),qa.setAttribute("x",oa.getAttribute("x")),qa.setAttribute("y",oa.getAttribute("y")),qa.setAttribute("width",oa.getAttribute("width")),qa.setAttribute("height",oa.getAttribute("height")),qa.setAttribute("fill","none"),qa.setAttribute("pointer-events","all"),(ha?Ia:La).appendChild(qa)))},Ca=function(Ia){var La= document.createElement("div");La.innerHTML=Graph.sanitizeHtml(Ia);return null!=La.firstChild?mxUtils.getXml(La):null},za=I.convertValueToTooltip(X.cell);null!=za&&""!=za&&ra(Editor.lightDarkTooltipImage,X.x/ca-16,X.y/ca-16,Editor.convertHtmlToText(za),"tooltip",Ca(za));za=Graph.sanitizeLink(I.getLinkForCell(X.cell));null==za||""==za||I.isCustomLink(za)||ra(Editor.lightDarkLinkImage,(X.x+X.width)/ca,X.y/ca-16,za,"link",null,za);za=null!=I.getNoteForCell?I.getNoteForCell(X.cell):null;null!=za&&""!= za&&(za=I.convertValueToNote(X.cell),Ca=Ca(za),null!=Ca&&ra(Editor.lightDarkNoteImage,X.x/ca-16,(X.y+X.height)/ca,Editor.convertHtmlToText(za),"note",Ca))}}}q.addCellData=function(X,aa,ca){aa.setAttribute("data-cell-id",X.id);if(ca)if(mxUtils.isNode(X.value))for(ca=0;ca<X.value.attributes.length;ca++){var ra=X.value.attributes[ca];aa.setAttribute("data-cell-"+ra.name,ra.value)}else if("object"===typeof X.value)for(ra in X.value)aa.setAttribute("data-cell-"+ra,X.value[ra]);else null!=X.value&&aa.setAttribute("data-cell-value", X.value);if(A&&mxUtils.isNode(X.value))for(ca=0;ca<X.value.attributes.length;ca++)ra=X.value.attributes[ca],aa.setAttribute("data-meta-"+ra.name,ra.value);return aa};var P=q.visitStatesRecursive;q.visitStatesRecursive=function(X,aa,ca){if(null!=X){var ra=aa.root,Ca=aa.root.ownerDocument;aa.root=this.addCellData(X.cell,null!=Ca.createElementNS?Ca.createElementNS(mxConstants.NS_SVG,"g"):Ca.createElement("g"),Editor.addSvgMetadata);ra.appendChild(aa.root);P.apply(this,arguments);aa.root=ra}};q.getLinkForCellState= mxUtils.bind(this,function(X,aa){return this.getLinkForCell(X.cell)});q.getTitleForCellState=mxUtils.bind(this,function(X,aa){return Editor.convertHtmlToText(this.convertValueToTooltip(X.cell))});return q};Graph.prototype.parseBackgroundImage=function(q){var A=null;null!=q&&0<q.length&&(q=JSON.parse(q),A=new mxImage(q.src,q.width,q.height));return A};Graph.prototype.getBackgroundImageObject=function(q){return q};Graph.prototype.getSvg=function(q,A,B,D,I,K,P,X,aa,ca,ra,Ca,za,Ia,La,Qa,ha){var oa=null; if(null!=Ia){oa=new mxDictionary;for(var qa=0;qa<Ia.length;qa++)oa.put(Ia[qa],!0)}I=this.useCssTransforms;var Ba=this.enableFlowAnimation;this.enableFlowAnimation=!1;I&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{A=null!=A?A:1;B=null!=B?B:0;K=null!=K?K:!0;P=null!=P?P:!0;ca=null!=ca?ca:!1;aa=null!=aa?aa:this.defaultExportLinkTarget;var Na="page"==za?this.view.getBackgroundPageBounds():K&&null==oa||D||"diagram"==za?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()), Ra=this.backgroundImage,Ga=this.view.translate,Ya=this.view.scale;"diagram"==za&&null!=Ra&&null!=Ra.width&&null!=Ra.height&&(Na=mxRectangle.fromRectangle(Na),Na.add(new mxRectangle((Ga.x+Ra.x)*Ya,(Ga.y+Ra.y)*Ya,Ra.width*Ya,Ra.height*Ya)));if(null==Na)throw Error(mxResources.get("drawingEmpty"));D=A/Ya;if("page"!=za){X=null!=X?X:this.createSvgImageExport();var qb={state:{scale:D}},hb=null;this.view.states.visit(mxUtils.bind(this,function(xa,Ha){if(null!=Ha.shape&&null!=Ha.shape.boundingBox&&(xa=X.getSvgShapeOffset(Ha.shape, qb),0!=xa)){for(var Ja=K&&null==oa,Oa=Ha.cell;!Ja&&null!=Oa;)Ja=null!=oa?oa.get(Oa):this.isCellSelected(Oa),Oa=this.model.getParent(Oa);Ja&&(xa=xa*Ya/A,hb=null!=hb?hb:mxRectangle.fromRectangle(Na),hb.add(new mxRectangle(Ha.shape.boundingBox.x+xa,Ha.shape.boundingBox.y+xa,Ha.shape.boundingBox.width,Ha.shape.boundingBox.height)))}}));null!=hb&&(Na=hb)}var Fb=Math.max(1,Math.ceil(Na.width*D)+2*B)+(ca&&0==B?5:0),Cb=Math.max(1,Math.ceil(Na.height*D)+2*B)+(ca&&0==B?5:0),xb=mxUtils.getLightDarkColor(q), $a=Graph.createSvgNode(0,0,Fb,Cb,xb),cb=$a.ownerDocument;if(null!=q){var pb=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"rect");pb.setAttribute("fill",xb.light);pb.style.fill=xb.cssText;pb.setAttribute("width","100%");pb.setAttribute("height","100%");pb.setAttribute("x","0");pb.setAttribute("y","0");$a.appendChild(pb)}var Rb=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"g");$a.appendChild(Rb);var yb=this.createSvgCanvas(Rb),f=Math.floor((B/A-Na.x/Ya)*D)/D,m=Math.floor((B/A-Na.y/Ya)*D)/D;yb.translate(f, m);yb.idPrefix="drawio-svg-"+Editor.guid();if(ha){var r=this.gridSize*A,n=this.view.gridSteps*r;q=[];for(qa=1;qa<this.view.gridSteps;qa++)B=qa*r,q.push("M 0 "+B+" L "+n+" "+B+" M "+B+" 0 L "+B+" "+n);var t=mxUtils.getLightDarkColor(this.view.gridColor),w=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"pattern");w.setAttribute("id",yb.idPrefix+"-grid");w.setAttribute("patternUnits","userSpaceOnUse");w.setAttribute("width",n);w.setAttribute("height",n);w.setAttribute("x",mxUtils.mod((Ga.x+f)*A,n));w.setAttribute("y", mxUtils.mod((Ga.y+m)*A,n));if(0<q.length){var y=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"path");y.setAttribute("d",q.join(" "));y.setAttribute("fill","none");y.setAttribute("stroke",t.light);y.style.stroke=t.cssText;y.setAttribute("opacity","0.2");y.setAttribute("stroke-width",A);w.appendChild(y)}var L=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"path");L.setAttribute("d","M "+n+" 0 L 0 0 0 "+n);L.setAttribute("fill","none");L.setAttribute("stroke",t.light);L.style.stroke=t.cssText;L.setAttribute("stroke-width", A);w.appendChild(L);yb.defs.appendChild(w);var E=mxUtils.createElementNs(cb,mxConstants.NS_SVG,"rect");E.setAttribute("width","100%");E.setAttribute("height","100%");E.setAttribute("fill","url(#"+w.getAttribute("id")+")");$a.insertBefore(E,Rb)}var fa=document.createElement("div"),W=yb.getAlternateText;yb.getAlternateText=function(xa,Ha,Ja,Oa,Ta,Sb,ac,bc,cc,dc,ec,fc,gc){if(null!=Sb&&0<this.state.fontSize)try{return mxUtils.isNode(Sb)?Sb=Sb.innerText:(fa.innerHTML=Sb,Sb=mxUtils.extractTextWithWhitespace(fa.childNodes)), Sb}catch(hc){return W.apply(this,arguments)}else return W.apply(this,arguments)};if(null!=Ra&&null!=Ra.width&&null!=Ra.height){qa=Ya/A;var Ea=new mxRectangle((Ra.x+Ga.x)*qa,(Ra.y+Ga.y)*qa,Ra.width*qa,Ra.height*qa);mxUtils.intersects(Na,Ea)&&yb.image(Ra.x+Ga.x,Ra.y+Ga.y,Ra.width,Ra.height,Ra.src,!0)}yb.scale(D);yb.textEnabled=P;X=null!=X?X:this.createSvgImageExport();var Wa=X.getLinkForCellState;X.getLinkForCellState=function(xa,Ha){var Ja=xa.view.graph.getAbsoluteUrl(Wa.apply(this,arguments));return null== Ja||xa.view.graph.isCustomLink(Ja)?null:Ja};X.getLinkTargetForCellState=function(xa,Ha){return xa.view.graph.getLinkTargetForCell(xa.cell)};var Pa=X.drawCellState,wa=null,Aa=mxUtils.bind(this,function(){if(null==wa){wa="ge-flow-animation-"+Editor.guid();var xa=null!=cb.createElementNS?cb.createElementNS(mxConstants.NS_SVG,"style"):cb.createElement("style");xa.innerHTML=this.createFlowAnimationCss(wa);cb.getElementsByTagName("defs")[0].appendChild(xa)}return wa});X.drawCellState=function(xa,Ha){for(var Ja= xa.view.graph,Oa=null!=oa?oa.get(xa.cell):Ja.isCellSelected(xa.cell),Ta=Ja.model.getParent(xa.cell);!(K&&null==oa||Oa)&&null!=Ta;)Oa=null!=oa?oa.get(Ta):Ja.isCellSelected(Ta),Ta=Ja.model.getParent(Ta);if(null!=xa.shape)try{var Sb=xa.shape.isFlowAnimationEnabled,ac=xa.shape.addFlowAnimationToShape;xa.shape.isFlowAnimationEnabled=function(){return Ba&&Ja.model.isEdge(xa.cell)&&"1"==mxUtils.getValue(xa.style,"flowAnimation","0")};xa.shape.addFlowAnimationToShape=function(){Ja.addFlowAnimationToNode(this.getFlowAnimationPath(), xa.style,A,Aa())};if(K&&null==oa||Oa)Ja.view.redrawEnumerationState(xa),Pa.apply(this,arguments),this.doDrawShape(xa.secondLabel,Ha)}finally{xa.shape.isFlowAnimationEnabled=Sb,xa.shape.addFlowAnimationToShape=ac}};var Da=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;X.drawState(this.getView().getState(Da),yb);this.addForeignObjectWarning(yb,$a);Graph.inlineSingleUseImages($a);Graph.replaceFontElements($a);Graph.addAdaptiveColors($a,this.shapeBackgroundColor);Qa?this.disableSvgLinks($a): this.updateSvgLinks($a,aa,!0);return $a}finally{this.enableFlowAnimation=Ba,I&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(q,A){if("0"!=urlParams["svg-warning"]&&0<A.getElementsByTagName("foreignObject").length){var B=q.createElement("switch"),D=q.createElement("g");D.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var I=q.createElement("a");I.setAttribute("transform","translate(0,-5)"); null==I.setAttributeNS||A.ownerDocument!=document&&null==document.documentMode?(I.setAttribute("xlink:href",Graph.foreignObjectWarningLink),I.setAttribute("target","_blank")):(I.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),I.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));q=q.createElement("text");q.setAttribute("text-anchor","middle");q.setAttribute("font-size","10px");q.setAttribute("x","50%");q.setAttribute("y","100%");mxUtils.write(q,Graph.foreignObjectWarningText); B.appendChild(D);I.appendChild(q);B.appendChild(I);A.appendChild(B)}};Graph.prototype.disableSvgLinks=function(q,A){q=q.getElementsByTagName("a");for(var B=0;B<q.length;B++){var D=q[B].getAttribute("href");null==D&&(D=q[B].getAttribute("xlink:href"));null!=D&&(q[B].style.pointerEvents="none",q[B].setAttribute("href",""));A&&A(q[B])}};Graph.prototype.updateSvgLinks=function(q,A,B){q=q.getElementsByTagName("a");for(var D=0;D<q.length;D++)if(null==q[D].getAttribute("target")){var I=q[D].getAttribute("href"); null==I&&(I=q[D].getAttribute("xlink:href"));null!=I&&(null!=A&&/^https?:\/\//.test(I)?q[D].setAttribute("target",A):B&&this.isCustomLink(I)&&q[D].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(q){q=new mxSvgCanvas2D(q);q.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;q.adaptiveColors=this.getAdaptiveColors();q.pointerEvents=!0;q.dedupImages=!0;q.createImageSymbol=function(A,B){this.imageSymbols=null!=this.imageSymbols?this.imageSymbols:{};return Graph.createSvgImageSymbol(this.defs, this.imageSymbols,A,B)};return q};Graph.prototype.getSelectedElement=function(){var q=null;if(window.getSelection){var A=window.getSelection();A.getRangeAt&&A.rangeCount&&(q=A.getRangeAt(0).commonAncestorContainer)}else document.selection&&(q=document.selection.createRange().parentElement());return q};Graph.prototype.getSelectedEditingElement=function(){var q=null;if(null!=this.cellEditor.textarea)for(q=this.getSelectedElement();null!=q&&q.nodeType!=mxConstants.NODETYPE_ELEMENT;)q=q.parentNode;return q}; Graph.prototype.getParentByName=function(q,A,B){for(;null!=q&&q.nodeName!=A;){if(q==B)return null;q=q.parentNode}return q};Graph.prototype.getParentByNames=function(q,A,B){for(;null!=q&&!(0<=mxUtils.indexOf(A,q.nodeName));){if(q==B)return null;q=q.parentNode}return q};Graph.prototype.selectNode=function(q){var A=null;if(window.getSelection){if(A=window.getSelection(),A.getRangeAt&&A.rangeCount){var B=document.createRange();B.selectNode(q);A.removeAllRanges();A.addRange(B)}}else(A=document.selection)&& "Control"!=A.type&&(q=A.createRange(),q.collapse(!0),B=A.createRange(),B.setEndPoint("StartToStart",q),B.select())};Graph.prototype.flipEdgePoints=function(q,A,B){var D=this.getCellGeometry(q);if(null!=D){D=D.clone();if(null!=D.points)for(var I=0;I<D.points.length;I++)A?D.points[I].x=B+(B-D.points[I].x):D.points[I].y=B+(B-D.points[I].y);I=function(K){null!=K&&(A?K.x=B+(B-K.x):K.y=B+(B-K.y))};I(D.getTerminalPoint(!0));I(D.getTerminalPoint(!1));this.model.setGeometry(q,D)}};Graph.prototype.flipChildren= function(q,A,B){this.model.beginUpdate();try{for(var D=this.model.getChildCount(q),I=0;I<D;I++){var K=this.model.getChildAt(q,I);if(this.model.isEdge(K))this.flipEdgePoints(K,A,B);else{var P=this.getCellGeometry(K);null!=P&&(P=P.clone(),A?P.x=B+(B-P.x-P.width):P.y=B+(B-P.y-P.height),this.model.setGeometry(K,P))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(q,A,B){return null!=q&&1==mxUtils.getValue(q.style,"legacyAnchorPoints",1)?this.getLegacyConnectionPoint(q,A, B):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(q,A,B){B=null!=B?B:!0;var D=null;if(null!=q&&null!=A.point){var I=this.view.getPerimeterBounds(q),K=new mxPoint(I.getCenterX(),I.getCenterY()),P=q.style[mxConstants.STYLE_DIRECTION],X=0;null!=P&&1==mxUtils.getValue(q.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(P==mxConstants.DIRECTION_NORTH?X+=270:P==mxConstants.DIRECTION_WEST?X+=180:P==mxConstants.DIRECTION_SOUTH&&(X+=90),P!=mxConstants.DIRECTION_NORTH&& P!=mxConstants.DIRECTION_SOUTH||I.rotate90());D=this.view.scale;D=new mxPoint(I.x+A.point.x*I.width+A.dx*D,I.y+A.point.y*I.height+A.dy*D);var aa=q.style[mxConstants.STYLE_ROTATION]||0;if(A.perimeter)0!=X&&(P=I=0,90==X?P=1:180==X?I=-1:270==X&&(P=-1),D=mxUtils.getRotatedPoint(D,I,P,K)),D=this.view.getPerimeterPoint(q,D,!1);else if(aa+=X,this.getModel().isVertex(q.cell)){X=1==q.style[mxConstants.STYLE_FLIPH];A=1==q.style[mxConstants.STYLE_FLIPV];null!=q.shape&&null!=q.shape.stencil&&(X=1==mxUtils.getValue(q.style, "stencilFlipH",0)||X,A=1==mxUtils.getValue(q.style,"stencilFlipV",0)||A);if(P==mxConstants.DIRECTION_NORTH||P==mxConstants.DIRECTION_SOUTH)q=X,X=A,A=q;X&&(D.x=2*I.getCenterX()-D.x);A&&(D.y=2*I.getCenterY()-D.y)}0!=aa&&null!=D&&(q=mxUtils.toRadians(aa),I=Math.cos(q),P=Math.sin(q),D=mxUtils.getRotatedPoint(D,I,P,K))}B&&null!=D&&(D.x=Math.round(D.x),D.y=Math.round(D.y));return D};Graph.prototype.flipCells=function(q,A){this.model.beginUpdate();try{q=this.model.getTopmostCells(q);for(var B=[],D=0;D<q.length;D++)if(this.model.isEdge(q[D])){var I= this.view.getState(q[D]);null!=I&&this.flipEdgePoints(q[D],A,(A?I.getCenterX():I.getCenterY())/this.view.scale-(A?I.origin.x:I.origin.y)-(A?this.view.translate.x:this.view.translate.y))}else{var K=this.getCellGeometry(q[D]);null!=K&&this.flipChildren(q[D],A,A?K.getCenterX()-K.x:K.getCenterY()-K.y);B.push(q[D])}this.toggleCellStyles(A?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,B);this.setCellStyles("legacyAnchorPoints","0",B)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(q, A){var B=null;if(null!=q&&0<q.length){this.model.beginUpdate();try{for(var D=0;D<q.length;D++){var I=this.model.getParent(q[D]);if(this.isTable(I)){var K=this.getCellGeometry(q[D]),P=this.getCellGeometry(I);null!=K&&null!=P&&(P=P.clone(),P.height-=K.height,this.model.setGeometry(I,P))}}var X=this.selectParentAfterDelete?this.model.getParents(q):null;this.removeCells(q,A)}finally{this.model.endUpdate()}if(null!=X)for(B=[],D=0;D<X.length;D++)this.model.contains(X[D])&&(this.model.isVertex(X[D])||this.model.isEdge(X[D]))&& B.push(X[D])}return B};Graph.prototype.insertTableColumn=function(q,A){var B=this.getModel();B.beginUpdate();try{var D=q,I=0;if(this.isTableCell(q)){var K=B.getParent(q);D=B.getParent(K);I=mxUtils.indexOf(B.getChildCells(K,!0),q)}else this.isTableRow(q)?D=B.getParent(q):q=B.getChildCells(D,!0)[0],A||(I=B.getChildCells(q,!0).length-1);var P=B.getChildCells(D,!0),X=Graph.minTableColumnWidth;for(q=0;q<P.length;q++){var aa=B.getChildCells(P[q],!0)[I],ca=B.cloneCell(aa,!1);null==ca&&(ca=this.createVertex()); var ra=this.getCellGeometry(ca);ca.value=null;ca.style=mxUtils.setStyle(mxUtils.setStyle(ca.style,"rowspan",null),"colspan",null);if(null!=ra){null!=ra.alternateBounds&&(ra.width=ra.alternateBounds.width,ra.height=ra.alternateBounds.height,ra.alternateBounds=null);X=ra.width;var Ca=this.getCellGeometry(P[q]);null!=Ca&&(ra.height=Ca.height)}B.add(P[q],ca,I+(A?0:1))}var za=this.getCellGeometry(D);null!=za&&(za=za.clone(),za.width+=X,B.setGeometry(D,za))}finally{B.endUpdate()}};Graph.prototype.deleteLane= function(q){var A=this.getModel();A.beginUpdate();try{var B=null;B="stackLayout"==this.getCurrentCellStyle(q).childLayout?q:A.getParent(q);var D=A.getChildCells(B,!0);0==D.length?A.remove(B):(B==q&&(q=D[D.length-1]),A.remove(q))}finally{A.endUpdate()}};Graph.prototype.insertLane=function(q,A){var B=this.getModel();B.beginUpdate();try{var D=null;if("stackLayout"==this.getCurrentCellStyle(q).childLayout){D=q;var I=B.getChildCells(D,!0);q=I[A?0:I.length-1]}else D=B.getParent(q);var K=D.getIndex(q);q= B.cloneCell(q,!1);q.value=null;B.add(D,q,K+(A?0:1))}finally{B.endUpdate()}};Graph.prototype.insertTableRow=function(q,A){var B=this.getModel();B.beginUpdate();try{var D=q,I=q;if(this.isTableCell(q))I=B.getParent(q),D=B.getParent(I);else if(this.isTableRow(q))D=B.getParent(q);else{var K=B.getChildCells(D,!0);I=K[A?0:K.length-1]}if(null!=I){var P=B.getChildCells(I,!0),X=D.getIndex(I);I=B.cloneCell(I,!1);I.value=null;var aa=this.getCellGeometry(I);if(null!=aa){for(K=0;K<P.length;K++){q=B.cloneCell(P[K], !1);q.value=null;q.style=mxUtils.setStyle(mxUtils.setStyle(q.style,"rowspan",null),"colspan",null);var ca=this.getCellGeometry(q);null!=ca&&(null!=ca.alternateBounds&&(ca.width=ca.alternateBounds.width,ca.height=ca.alternateBounds.height,ca.alternateBounds=null),ca.height=aa.height);I.insert(q)}B.add(D,I,X+(A?0:1));var ra=this.getCellGeometry(D);null!=ra&&(ra=ra.clone(),ra.height+=aa.height,B.setGeometry(D,ra))}}else if(ra=this.getCellGeometry(D),null!=ra){var Ca=ra.width;I=this.createVertex(null, null,"",0,0,Ca,40,"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;fixedHeader=1;");I.insert(this.createVertex(null,null,"",0,0,Ca,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"));B.add(D,I);ra=ra.clone();ra.height+=40;B.setGeometry(D, ra)}}finally{B.endUpdate()}};Graph.prototype.deleteTableColumn=function(q){var A=this.getModel();A.beginUpdate();try{var B=q,D=q;this.isTableCell(q)&&(D=A.getParent(q));this.isTableRow(D)&&(B=A.getParent(D));var I=A.getChildCells(B,!0);if(0==I.length)A.remove(B);else{this.isTableRow(D)||(D=I[0]);var K=A.getChildCells(D,!0);if(1>=K.length)A.remove(B);else{var P=K.length-1;this.isTableCell(q)&&(P=mxUtils.indexOf(K,q));for(D=q=0;D<I.length;D++){var X=A.getChildCells(I[D],!0)[P];A.remove(X);var aa=this.getCellGeometry(X); null!=aa&&(q=Math.max(q,aa.width))}var ca=this.getCellGeometry(B);null!=ca&&(ca=ca.clone(),ca.width-=q,A.setGeometry(B,ca))}}}finally{A.endUpdate()}};Graph.prototype.deleteTableRow=function(q){var A=this.getModel();A.beginUpdate();try{var B=q,D=q;this.isTableCell(q)&&(q=D=A.getParent(q));this.isTableRow(q)&&(B=A.getParent(D));var I=A.getChildCells(B,!0);if(1>=I.length)A.remove(B);else{this.isTableRow(D)||(D=I[I.length-1]);A.remove(D);q=0;var K=this.getCellGeometry(D);null!=K&&(q=K.height);var P=this.getCellGeometry(B); null!=P&&(P=P.clone(),P.height-=q,A.setGeometry(B,P))}}finally{A.endUpdate()}};Graph.prototype.insertRow=function(q,A){for(var B=q.tBodies[0],D=B.rows[0].cells,I=q=0;I<D.length;I++){var K=D[I].getAttribute("colspan");q+=null!=K?parseInt(K):1}A=B.insertRow(A);for(I=0;I<q;I++)mxUtils.br(A.insertCell(-1));return A.cells[0]};Graph.prototype.deleteRow=function(q,A){q.tBodies[0].deleteRow(A)};Graph.prototype.insertColumn=function(q,A){var B=q.tHead;if(null!=B)for(var D=0;D<B.rows.length;D++){var I=document.createElement("th"); B.rows[D].appendChild(I);mxUtils.br(I)}q=q.tBodies[0];for(B=0;B<q.rows.length;B++)D=q.rows[B].insertCell(A),mxUtils.br(D);return q.rows[0].cells[0<=A?A:q.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(q,A){if(0<=A){q=q.tBodies[0].rows;for(var B=0;B<q.length;B++)q[B].cells.length>A&&q[B].deleteCell(A)}};Graph.prototype.pasteHtmlAtCaret=function(q){if(window.getSelection){var A=window.getSelection();if(A.getRangeAt&&A.rangeCount){A=A.getRangeAt(0);A.deleteContents();var B=document.createElement("div"); B.innerHTML=q;q=document.createDocumentFragment();for(var D;D=B.firstChild;)lastNode=q.appendChild(D);A.insertNode(q)}}else(A=document.selection)&&"Control"!=A.type&&A.createRange().pasteHTML(q)};Graph.prototype.createLinkForHint=function(q,A,B){function D(K,P){K.length>P&&(K=K.substring(0,Math.round(P/2))+"..."+K.substring(K.length-Math.round(P/4)));return K}q=null!=q?q:"javascript:void(0);";if(null==A||0==A.length)A=this.isCustomLink(q)?this.getLinkTitle(q):q;var I=document.createElement("a");I.setAttribute("rel", this.linkRelation);I.setAttribute("href",this.getAbsoluteUrl(q));I.setAttribute("title",D(this.isCustomLink(q)?this.getLinkTitle(q):q,80));null!=this.linkTarget&&I.setAttribute("target",this.linkTarget);mxUtils.write(I,D(A,40));this.isCustomLink(q)&&mxEvent.addListener(I,"click",mxUtils.bind(this,function(K){this.customLinkClicked(q,B);mxEvent.consume(K)}));return I};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first}; this.addListener(mxEvent.START_EDITING,function(K,P){this.popupMenuHandler.hideMenu()});var q=this.updateMouseEvent;this.updateMouseEvent=function(K){K=q.apply(this,arguments);if(mxEvent.isTouchEvent(K.getEvent())&&null==K.getState()){var P=this.getCellAt(K.graphX,K.graphY);null!=P&&this.isSwimlane(P)&&this.hitsSwimlaneContent(P,K.graphX,K.graphY)||(K.state=this.view.getState(P),null!=K.state&&null!=K.state.shape&&(this.container.style.cursor=K.state.shape.node.style.cursor))}null==K.getState()&& this.isEnabled()&&(this.container.style.cursor="default");return K};var A=!1,B=!1,D=!1,I=this.fireMouseEvent;this.fireMouseEvent=function(K,P,X){K==mxEvent.MOUSE_DOWN&&(P=this.updateMouseEvent(P),A=this.isCellSelected(P.getCell()),B=this.isSelectionEmpty(),D=this.popupMenuHandler.isMenuShowing());I.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(K,P){if(null!=this.freehand&&!this.freehand.isDrawing()){var X=mxEvent.isMouseEvent(P.getEvent());this.popupMenuHandler.popupTrigger= !this.isEditing()&&this.isEnabled()&&(null==P.getState()||!P.isSource(P.getState().control))&&(this.popupMenuHandler.popupTrigger||!D&&!X&&(B&&null==P.getCell()&&this.isSelectionEmpty()||A&&this.isCellSelected(P.getCell())));X=!A||X?null:mxUtils.bind(this,function(aa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ca=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(P.getX()+ca.x+1,P.getY()+ca.y+1,aa,P.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler, [K,P,X])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var q=this.graph.view.getState(this.editingCell);return null!=q&&1==q.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var q="";window.getSelection?q=window.getSelection():document.getSelection?q=document.getSelection(): document.selection&&(q=document.selection.createRange().text);return""!=q};mxCellEditor.prototype.insertTab=function(q){var A=this.textarea.ownerDocument.defaultView.getSelection(),B=A.getRangeAt(0);q=Graph.createTabNode(q);B.insertNode(q);B.setStartAfter(q);B.setEndAfter(q);A.removeAllRanges();A.addRange(B)};mxCellEditor.prototype.alignText=function(q,A){var B=this.graph.getView().getState(this.editingCell);if(null!=B){B=mxUtils.getValue(B.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION); var D=null!=B&&"vertical-"==B.substring(0,9),I=null!=A&&mxEvent.isShiftDown(A);if(I||null!=window.getSelection&&null!=window.getSelection().containsNode){var K=!0;this.graph.processElements(this.textarea,function(P){I||D||window.getSelection().containsNode(P,!0)?(P.removeAttribute("align"),P.style.textAlign=null):K=!1});(K||D)&&this.graph.cellEditor.setAlign(q)}D||document.execCommand("justify"+q.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var q= window.getSelection();if(q.getRangeAt&&q.rangeCount){for(var A=[],B=0,D=q.rangeCount;B<D;++B)A.push(q.getRangeAt(B));return A}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(q){try{if(q)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var A=0,B=q.length;A<B;++A)sel.addRange(q[A])}else document.selection&&q.select&&q.select()}catch(D){}};var ma=mxCellRenderer.prototype.initializeLabel; mxCellRenderer.prototype.initializeLabel=function(q){null!=q.text&&(q.text.replaceLinefeeds="0"!=mxUtils.getValue(q.style,"nl2Br","1"));ma.apply(this,arguments)};var ia=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(q,A){this.isKeepFocusEvent(q)||!mxEvent.isAltDown(q.getEvent())?ia.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(q){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing= !1;var na=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.removeShapeInsideNodes=function(){if(null!=this.textarea){for(var q=this.textarea.querySelectorAll("[data-shape-inside]"),A=0;A<q.length;A++)q[A].parentNode.removeChild(q[A]);q=this.textarea.querySelectorAll("[data-shape-inside-wrapper]");for(A=0;A<q.length;A++){for(;null!=q[A].firstChild;)q[A].parentNode.insertBefore(q[A].firstChild,q[A]);q[A].parentNode.removeChild(q[A])}}};mxCellEditor.prototype.updateShapeInsideFloats=function(){var q= this.graph.view.getState(this.editingCell);this.shapeInsideAlign=null;if(!(null==q||null==this.textarea||this.codeViewMode||""==this.textarea.innerHTML||this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText())){var A=q.view.scale,B=q.width/A;A=q.height/A;var D=this.graph.getShapeInsideFloats(q.style,B,A);if(null==D)this.removeShapeInsideNodes();else{for(var I=this.textarea.querySelectorAll("[data-shape-inside]"),K=0;K<I.length;K++)I[K].parentNode.removeChild(I[K]);I=this.textarea.querySelector("[data-shape-inside-wrapper]"); var P=K=null;if(null==I){P=window.getSelection();null!=P&&0<P.rangeCount&&this.textarea.contains(P.anchorNode)&&(K={anchorNode:P.anchorNode,anchorOffset:P.anchorOffset,focusNode:P.focusNode,focusOffset:P.focusOffset,collapsed:P.isCollapsed,host:P.anchorNode==this.textarea||P.focusNode==this.textarea});I=document.createElement("div");for(I.setAttribute("data-shape-inside-wrapper","1");null!=this.textarea.firstChild;)I.appendChild(this.textarea.firstChild);this.textarea.appendChild(I)}var X=this.graph.getShapeInsideBox(q.style, B,A),aa=Graph.sanitizeHtml(I.innerHTML,!0);this.shapeInsideAlign=aa=this.graph.computeShapeInsideSpacer(aa,q.style,D,X,B,A);I.style.cssText="float:left;width:"+Math.round(X.width)+"px;height:"+Math.round(X.height+this.graph.getShapeInsideGrow(aa.spacer,mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)))+"px;";I.insertAdjacentHTML("afterbegin",this.graph.createShapeInsideMarkup(D,X,aa.spacer,B,A,this.graph.getShapeInsidePadding(q.style),aa.clip));if(null!=K){q=document.createRange(); try{if(K.host){for(var ca=I.lastChild;null!=ca&&null!=ca.lastChild;)ca=ca.lastChild;K.collapsed&&null!=ca&&3==ca.nodeType?(q.setStart(ca,ca.length),q.collapse(!0)):(q.selectNodeContents(I),K.collapsed&&q.collapse(!1))}else q.setStart(K.anchorNode,K.anchorOffset),q.setEnd(K.focusNode,K.focusOffset);P.removeAllRanges();P.addRange(q)}catch(ra){}}this.resize()}}};mxCellEditor.prototype.startEditing=function(q,A){q=this.graph.getStartEditingCell(q,A);na.apply(this,arguments);var B=this.graph.view.getState(q); this.textarea.className=null!=B&&1==B.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(q);null!=this.editingCell&&null!=this.textarea&&null!=this.textarea.parentNode&&null!=B&&this.graph.isAutosizeTextState(B)&& this.resize();null!=this.textarea&&null!=B&&null!=this.graph.getShapeInsideFloats(B.style,B.width/B.view.scale,B.height/B.view.scale)&&(this.shapeInsideListener=mxUtils.bind(this,function(){null!=this.textarea&&null==this.textarea.querySelector("[data-shape-inside-wrapper]")?window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&this.updateShapeInsideFloats()}),0):this.updateShapeInsideFloats()}),mxEvent.addListener(this.textarea,"input",this.shapeInsideListener),this.updateShapeInsideFloats())}; mxCellEditor.prototype.toggleViewMode=function(){this.removeShapeInsideNodes();var q=this.graph.view.getState(this.editingCell);if(null!=q){var A=null!=q&&"0"!=mxUtils.getValue(q.style,"nl2Br","1"),B=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);X=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<X.length&&"\n"==X.charAt(X.length-1)&&(X=X.substring(0,X.length-1));X=Graph.sanitizeHtml(A?X.replace(/\n/g,"<br/>"):X,!0);this.textarea.className= "mxCellEditor geContentEditable";aa=mxUtils.getValue(q.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);A=mxUtils.getValue(q.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var D=mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),I=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,K=(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,P= [];(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&P.push("underline");(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&P.push("line-through");0<P.length&&(mxUtils.getValue(q.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&P.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? Math.round(aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(aa)+"px";this.textarea.style.textDecoration=P.join(" ");this.textarea.style.fontWeight=I?"bold":"normal";this.textarea.style.fontStyle=K?"italic":"";this.textarea.style.fontFamily=A;this.textarea.style.textAlign=D;this.textarea.style.padding="0px";this.textarea.innerHTML!=X&&(this.textarea.innerHTML=X,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange= 0<this.textarea.innerHTML.length));Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors());this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerText="");Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var X=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(X=mxUtils.replaceTrailingNewlines(X,"<div><br></div>"));X=Graph.sanitizeHtml(A? X.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):X,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var aa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(aa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(aa)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY; this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding="2px";this.textarea.innerHTML!=X&&(this.textarea.innerHTML=X);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=B;this.resize();this.updateShapeInsideFloats()}};var Z=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(q,A){if(null!=this.textarea)if(q=this.graph.getView().getState(this.editingCell), this.codeViewMode&&null!=q){var B=q.view.scale;this.bounds=mxRectangle.fromRectangle(q);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*B;this.bounds.height=60*B;var D=null!=q.text?q.text.margin:null;null==D&&(D=mxUtils.getAlignmentAsPoint(mxUtils.getValue(q.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(q.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=D.x*this.bounds.width;this.bounds.y+=D.y*this.bounds.height}this.textarea.style.width= Math.round((this.bounds.width-4)/B)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/B)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/B)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*B);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/B)+(this.textarea.offsetWidth- this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*B);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+B+","+B+")")}else if(null!=q&&null!=this.graph.getShapeInsideFloats(q.style,q.width/q.view.scale,q.height/q.view.scale)){B=q.view.scale;D=q.style;var I=this.graph.getCellGeometry(this.editingCell);if(null!=I){var K=this.shapeInsideAlign, P=null!=K&&0>K.spacer?-K.spacer:0;K=null!=K?this.graph.getShapeInsideGrow(K.spacer,mxUtils.getValue(D,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)):0;this.bounds=mxRectangle.fromRectangle(q);this.textarea.style.left=Math.round(q.x)+"px";this.textarea.style.top=Math.round(q.y-P*B)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+B+","+B+")");this.textarea.style.borderWidth="0";B=mxSvgCanvas2D.prototype.foreignObjectPadding; this.textarea.style.width=Math.round(I.width+B)+"px";this.textarea.style.height=Math.round(I.height+K)+"px";this.textarea.style.overflow="visible";this.textarea.style.boxSizing="border-box";this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";var X=parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2));this.textarea.style.paddingLeft=Math.round(X+parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_LEFT,0)))+"px";this.textarea.style.paddingRight=Math.round(X+ parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_RIGHT,0)))+"px";this.textarea.style.paddingTop=Math.round(X+parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_TOP,0))+(mxUtils.getValue(D,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)==mxConstants.ALIGN_TOP?mxText.prototype.baseSpacingTop:0))+"px";this.textarea.style.paddingBottom=Math.round(X+parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_BOTTOM,0)))+"px";this.graph.isAutosizeTextState(q)&&(B=mxUtils.trim(this.textarea.innerText|| ""),0<B.length&&(B=mxUtils.htmlEntities(B,!1).replace(/\n/g,"<br>"),P=this.graph.getShapeInsideFloats(D,I.width,I.height),D=null!=P?this.graph.computeShapeInsideFontSize(B,D,P,I.width,I.height):null,null!=D&&(this.textarea.style.fontSize=D+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?D*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)))}}else null!=q&&this.graph.isAutosizeTextState(q)?(B=q.view.scale,D=q.style,I=this.graph.getCellGeometry(this.editingCell),null!=I&&(this.bounds= mxRectangle.fromRectangle(q),this.textarea.style.left=Math.round(q.x)+"px",this.textarea.style.top=Math.round(q.y)+"px",P=this.rotateText&&null!=this.textShape?this.textShape.getTextRotation():0,mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=P?"rotate("+P+"deg) ":"")+"scale("+B+","+B+")"),this.textarea.style.borderWidth="0",B=mxSvgCanvas2D.prototype.foreignObjectPadding,this.textarea.style.width=Math.round(I.width+ B)+"px",this.textarea.style.height=Math.round(I.height)+"px",this.textarea.style.overflow="hidden",this.textarea.style.boxSizing="border-box","wrap"==D[mxConstants.STYLE_WHITE_SPACE]&&(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal"),X=parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING,2)),B=X+parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_TOP,0)),P=X+parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_BOTTOM,0)),K=X+parseInt(mxUtils.getValue(D, mxConstants.STYLE_SPACING_LEFT,0)),X+=parseInt(mxUtils.getValue(D,mxConstants.STYLE_SPACING_RIGHT,0)),this.textarea.style.paddingLeft=Math.round(K)+"px",this.textarea.style.paddingRight=Math.round(X)+"px",this.textarea.style.paddingTop=Math.round(B)+"px",this.textarea.style.paddingBottom=Math.round(P)+"px",this.textarea.style.display="table-cell",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",B=mxUtils.getValue(D,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE), this.textarea.style.verticalAlign=B==mxConstants.ALIGN_MIDDLE?"middle":B==mxConstants.ALIGN_BOTTOM?"bottom":"top",B=this.textarea.innerText,null!=B&&0<B.length&&(I=this.graph.getAutosizeTextAvailableSpace(D,I.width,I.height,q),null!=I&&(B=mxUtils.htmlEntities(B,!1).replace(/\n/g,"<br>"),D=this.graph.computeAutosizeTextFontSize(B,I.availW,I.availH,D[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,D[mxConstants.STYLE_FONTSTYLE],"wrap"==D[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize= D+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?D*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)))):(this.textarea.style.width="",this.textarea.style.height="",this.textarea.style.overflow="",this.textarea.style.boxSizing="",this.textarea.style.borderWidth="",this.textarea.style.paddingTop="",this.textarea.style.paddingBottom="",this.textarea.style.paddingLeft="",this.textarea.style.paddingRight="",this.textarea.style.display="",this.textarea.style.flexDirection="",this.textarea.style.justifyContent= "",this.textarea.style.verticalAlign="",Z.apply(this,arguments))};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(q,A){if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var B=this.graph.getEditingValue(q.cell,A);"1"==mxUtils.getValue(q.style,"nl2Br","1")&&(B=B.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(B,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue; mxCellEditor.prototype.setEditingValue=function(q,A){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(q.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(q){this.removeShapeInsideNodes();if("0"==mxUtils.getValue(q.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments); Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var A=Graph.sanitizeHtml(this.textarea.innerHTML,!0);Editor.optimizeHtmlLabels&&(A=Graph.optimizeHtml(A));"1"==mxUtils.getValue(q.style,"nl2Br","1")?(A=A.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<A.length&&("<br/>"==A.substring(A.length-5)||"<br>"==A.substring(A.length-4))&&(A=A.substring(0,A.lastIndexOf("<br"))+"<div><br/></div>")):A=A.replace(/\r\n/g,"").replace(/\n/g,"");return A};var da=mxCellEditor.prototype.stopEditing; mxCellEditor.prototype.stopEditing=function(q){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener=null);this.codeViewMode&&this.toggleViewMode();da.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(q){}};var pa=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(q,A){this.graph.getModel().beginUpdate(); try{pa.apply(this,arguments),""==A&&this.graph.isCellDeletable(q.cell)&&0==this.graph.model.getChildCount(q.cell)&&this.graph.isTransparentState(q)&&this.graph.removeCells([q.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getBorderColor=function(q){q=mxUtils.getValue(q.style,mxConstants.STYLE_LABEL_BORDERCOLOR, null);q==mxConstants.NONE&&(q=null);return q};mxCellEditor.prototype.getMinimumSize=function(q){var A=this.graph.getView().scale;return new mxRectangle(0,0,null==q.text?30:q.text.size*A+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(q,A){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(A.getEvent)};var ka=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent= function(q){var A=ka.apply(this,arguments);if(null!=A){var B=this.graph.getLockedGroupAncestor(this.graph.model.getParent(A));null!=B&&(A=B)}return A};var S=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(q,A,B){var D=this.graph.model.getParent(q);if(null!=D){if(this.graph.isSelectParentFirst(D))return!this.graph.isCellSelected(D)&&!this.graph.isSiblingSelected(q);if(this.graph.isTransparentBounds(D))return!1}return S.apply(this,arguments)}; var U=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(q,A){var B=U.apply(this,arguments),D=null!=A?A.x:q.getGraphX(),I=null!=A?A.y:q.getGraphY();if(null!=B&&this.graph.model.isEdge(B)){var K=this.graph.model;B=this.graph.getCellAt(D,I,null,!0,!1,function(X){return K.isEdge(K.getParent(X.cell))});if(null!=B&&!this.graph.isCellConnectable(B)){var P=K.getParent(B);K.isVertex(P)&&this.graph.isCellConnectable(P)&&(B=P)}B=this.graph.isCellLocked(B)?null: B}null==B||null!=this.currentFocus&&this.currentFocus.cell==B||(D=this.graph.getBorderContainer(B,D,I),null!=D&&(B=D));return B};var Y=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var q=Y.apply(this,arguments),A=this.graph,B=new mxDictionary,D=[],I=0;I<q.length;I++)null==B.get(q[I])&&(B.put(q[I],!0),D.push(q[I]));for(I=0;I<q.length;I++)for(var K=A.model.getParent(q[I]);null!=K&&A.isTransparentBounds(K);)null== B.get(K)&&(B.put(K,!0),D.push(K)),K=A.model.getParent(K);return D};mxGraphView.prototype.formatUnitText=function(q){return q?b(q,this.unit):q};mxGraphHandler.prototype.updateHint=function(q){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var A=this.graph.view.translate,B=this.graph.view.scale;q=this.roundLength((this.bounds.x+this.currentDx)/B-A.x);A=this.roundLength((this.bounds.y+this.currentDy)/B-A.y); B=this.graph.view.unit;this.hint.innerHTML=b(q,B)+", "+b(A,B);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var N=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(q, A){N.apply(this,arguments);var B=this.graph.getCellStyle(q);if(null==B.childLayout){var D=this.graph.model.getParent(q),I=null!=D?this.graph.getCellGeometry(D):null;if(null!=I&&(B=this.graph.getCellStyle(D),"stackLayout"==B.childLayout)){var K=parseFloat(mxUtils.getValue(B,"stackBorder",mxStackLayout.prototype.border));B="1"==mxUtils.getValue(B,"horizontalStack","1");var P=this.graph.getActualStartSize(D);I=I.clone();B?I.height=A.height+P.y+P.height+2*K:I.width=A.width+P.x+P.width+2*K;this.graph.model.setGeometry(D, I)}}};var R=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function q(X){B.get(X)||(B.put(X,!0),I.push(X))}for(var A=R.apply(this,arguments),B=new mxDictionary,D=this.graph.model,I=[],K=0;K<A.length;K++){var P=A[K];this.graph.isTableCell(P)?q(D.getParent(D.getParent(P))):this.graph.isTableRow(P)&&q(D.getParent(P));q(P)}return I};var ea=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent= function(q){return ea.apply(this,arguments)&&!mxEvent.isControlDown(q.getEvent())&&!mxEvent.isShiftDown(q.getEvent())};var ba=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=function(){return ba.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var la=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape= function(q){var A=la.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;var B=this.graph.model.getParent(this.state.cell);null!=B&&this.graph.isTransparentBounds(B)&&(A.isDashed=!0);return A};var sa=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:sa.apply(this,arguments)};var T=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&& !this.graph.isCellSelected(this.state.cell)?"#C0C0C0":T.apply(this,arguments)};var ua=mxVertexHandler.prototype.updateParentHighlight;mxVertexHandler.prototype.updateParentHighlight=function(){ua.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var va=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(q){var A= va.apply(this,arguments);A.stroke="#C0C0C0";A.strokewidth=1;return A};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var q=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+q.x/2,this.bounds.y+this.rotationHandleVSpacing-q.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(q,A){return this.graph.isRecursiveVertexResize(q)&&!mxEvent.isAltDown(A.getEvent())};var Ka=mxVertexHandler.prototype.resizeCell; mxVertexHandler.prototype.resizeCell=function(q,A,B,D,I,K,P){P&&this.graph.isRotatedGroupResize(q)&&(this.childOffsetY=this.childOffsetX=0);Ka.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(q,A){return mxEvent.isControlDown(A.getEvent())||mxEvent.isMetaDown(A.getEvent())};var Sa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return Sa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&& !this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style,"labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&this.graph.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.connectHandleVSpacing= -12;mxVertexHandler.prototype.getConnectHandlePosition=function(){var q=this.getHandlePadding(),A=this.graph,B=A.getNestedCornerIconOffset(this.state.cell,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(D){return A.isConnectIconVisible(D)&&A.isEnabled()&&A.isCellConnectable(D)&&!A.isTableCell(D)&&!A.isTableRow(D)&&!A.isTable(D)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+q.x/2+B,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+ q.y/2+B)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Ua=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var q=this.graph.model.getParent(this.state.cell);return null!=q&&this.graph.isTransparentBounds(q)?!1:Ua.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&& !this.graph.isTableRow(this.state.cell)};var ta=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(q){return q.tableHandle||q.lockHandle||q.editIconHandle||q.moveGroupHandle||ta.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var q=0;this.graph.isTransparentBounds(this.state.cell)?q=-this.graph.getNestedTransparentBoundsCount(this.state.cell): this.graph.isTableRow(this.state.cell)?q=1:this.graph.isTableCell(this.state.cell)&&(q=2);return q};var Fa=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return Fa.apply(this,arguments).grow(-this.getSelectionBorderInset())};var Ma=null,ab=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==Ma&&(Ma=mxCellRenderer.defaultShapes.tableLine);var q=ab.apply(this,arguments);if(this.graph.isTable(this.state.cell)&& this.graph.isCellMovable(this.state.cell)){var A=function(oa,qa,Ba){for(var Na=[],Ra=0;Ra<oa.length;Ra++){var Ga=oa[Ra];Na.push(null==Ga?null:new mxPoint((aa+Ga.x+qa)*K,(ca+Ga.y+Ba)*K))}return Na},B=this,D=this.graph,I=D.model,K=D.view.scale,P=this.state,X=this.selectionBorder,aa=this.state.origin.x+D.view.translate.x,ca=this.state.origin.y+D.view.translate.y;null==q&&(q=[]);var ra=D.view.getCellStates(I.getChildCells(this.state.cell,!0));if(0<ra.length){var Ca=I.getChildCells(ra[0].cell,!0),za=D.getTableLines(this.state.cell, !1,!0),Ia=D.getTableLines(this.state.cell,!0,!1);for(I=0;I<ra.length;I++)mxUtils.bind(this,function(oa){var qa=ra[oa],Ba=null;if(D.isCellMovable(qa.cell)){Ba=oa<ra.length-1?ra[oa+1]:null;Ba=null!=Ba?D.getCellGeometry(Ba.cell):null;var Na=null!=Ba&&null!=Ba.alternateBounds?Ba.alternateBounds:Ba;Ba=null!=Ia[oa]?new Ma(Ia[oa],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Ba.isDashed=X.isDashed;Ba.svgStrokeTolerance++;Ba=new mxHandle(qa,"row-resize",null,Ba);Ba.tableHandle=!0; var Ra=0;Ba.shape.node.parentNode.insertBefore(Ba.shape.node,Ba.shape.node.parentNode.firstChild);Ba.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ra?mxConstants.NONE:X.stroke;if(this.shape.constructor==Ma)this.shape.line=A(Ia[oa],0,Ra),this.shape.updateBoundsFromLine();else{var Ga=D.getActualStartSize(P.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Ra*K;this.shape.bounds.x=P.x+(oa==ra.length-1?0:Ga.x*K);this.shape.bounds.width=P.width-(oa==ra.length- 1?0:Ga.width+Ga.x+K)}this.shape.redraw()}};Ba.setPosition=function(Ga,Ya,qb){Ra=Math.max(Graph.minTableRowHeight-Ga.height,Ya.y-Ga.y-Ga.height);null!=Na&&mxEvent.isShiftDown(qb.getEvent())&&(Ra=Math.min(Ra,Na.height-Graph.minTableRowHeight))};Ba.execute=function(Ga){if(0!=Ra){var Ya=mxEvent.isShiftDown(Ga.getEvent());(Ga=mxEvent.isControlDown(Ga.getEvent())||mxEvent.isMetaDown(Ga.getEvent()))&&Ya?D.distributeRows(P.cell):Ga?D.resizeAllTableRows(P.cell,Ra):D.setTableRowHeight(this.state.cell,Ra,!Ya)}else B.blockDelayedSelection|| (Ya=D.getCellAt(Ga.getGraphX(),Ga.getGraphY())||P.cell,D.graphHandler.selectCellForEvent(Ya,Ga));Ra=0};Ba.reset=function(){Ra=0}}q.push(Ba)})(I);for(I=0;I<Ca.length;I++)mxUtils.bind(this,function(oa){var qa=D.view.getState(Ca[oa]),Ba=D.getCellGeometry(Ca[oa]),Na=null!=Ba.alternateBounds?Ba.alternateBounds:Ba;null==qa&&(qa=new mxCellState(D.view,Ca[oa],D.getCellStyle(Ca[oa])),qa.x=P.x+Ba.x*K,qa.y=P.y+Ba.y*K,qa.width=Na.width*K,qa.height=Na.height*K,qa.updateCachedBounds());Ba=oa<Ca.length-1?Ca[oa+ 1]:null;Ba=null!=Ba?D.getCellGeometry(Ba):null;var Ra=null!=Ba&&null!=Ba.alternateBounds?Ba.alternateBounds:Ba;Ba=null!=za[oa]?new Ma(za[oa],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Ba.isDashed=X.isDashed;Ba.svgStrokeTolerance++;qa=new mxHandle(qa,"col-resize",null,Ba);qa.tableHandle=!0;var Ga=0;qa.shape.node.parentNode.insertBefore(qa.shape.node,qa.shape.node.parentNode.firstChild);qa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==Ga?mxConstants.NONE:X.stroke; if(this.shape.constructor==Ma)this.shape.line=A(za[oa],Ga,0),this.shape.updateBoundsFromLine();else{var Ya=D.getActualStartSize(P.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(Na.width+Ga)*K;this.shape.bounds.y=P.y+(oa==Ca.length-1?0:Ya.y*K);this.shape.bounds.height=P.height-(oa==Ca.length-1?0:(Ya.height+Ya.y)*K)}this.shape.redraw()}};qa.setPosition=function(Ya,qb,hb){Ga=Math.max(Graph.minTableColumnWidth-Na.width,qb.x-Ya.x-Na.width);null!=Ra&&mxEvent.isShiftDown(hb.getEvent())&& (Ga=Math.min(Ga,Ra.width-Graph.minTableColumnWidth))};qa.execute=function(Ya){if(0!=Ga){var qb=mxEvent.isShiftDown(Ya.getEvent());(Ya=mxEvent.isControlDown(Ya.getEvent())||mxEvent.isMetaDown(Ya.getEvent()))&&qb?D.distributeColumns(P.cell):Ya?D.resizeAllTableColumns(P.cell,Ga):D.setTableColumnWidth(this.state.cell,Ga,!qb)}else B.blockDelayedSelection||(qb=D.getCellAt(Ya.getGraphX(),Ya.getGraphY())||P.cell,D.graphHandler.selectCellForEvent(qb,Ya));Ga=0};qa.positionChanged=function(){};qa.reset=function(){Ga= 0};q.push(qa)})(I)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null==q&&(q=[]);B=this;D=this.graph;var La=this.state.cell,Qa=16,ha=this.graph.isLockedGroup(La);I=new mxImageShape(new mxRectangle(0,0,Qa,Qa),(ha?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);I.preserveImageAspect=!1;I=new mxHandle(this.state,"pointer",null,I);I.lockHandle=!0;I.setPosition=function(){};I.positionChanged=function(){};I.reset=function(){}; I.redraw=function(){if(null!=this.shape){var oa=B.getHandlePadding(),qa=D.getNestedCornerIconOffset(La,B.bounds.x,B.bounds.y,function(Ra){return D.isLockedGroupIconVisible(Ra)&&D.isCellMovable(Ra)});oa=new mxPoint(B.bounds.x-12-oa.x/2-qa,B.bounds.y-12-oa.y/2-qa);D.isMoveIconVisible(La)&&D.isCellMovable(La)&&(oa.y+=24);qa=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Ba=mxUtils.toRadians(qa);if(0!=Ba){var Na=new mxPoint(B.state.getCenterX(),B.state.getCenterY()); oa=mxUtils.getRotatedPoint(oa,Math.cos(Ba),Math.sin(Ba),Na)}this.shape.bounds.width=Qa;this.shape.bounds.height=Qa;this.shape.bounds.x=oa.x-Qa/2;this.shape.bounds.y=oa.y-Qa/2;this.shape.rotation=qa;this.shape.redraw()}};I.execute=function(oa){D.getModel().beginUpdate();try{D.setCellStyles("lockedGroup",ha?"0":"1",[La])}finally{D.getModel().endUpdate()}if(!ha){oa=D.getSelectionCells();for(var qa=[],Ba=0;Ba<oa.length;Ba++)oa[Ba]!=La&&D.model.isAncestor(La,oa[Ba])||qa.push(oa[Ba]);qa.length!=oa.length&& D.setSelectionCells(0<qa.length?qa:[La])}};q.push(I)}this.graph.isEditIconVisible(this.state.cell)&&(null==q&&(q=[]),B=this,D=this.graph,La=this.state.cell,Qa=16,I=new mxImageShape(new mxRectangle(0,0,Qa,Qa),HoverIcons.prototype.editHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"pointer",null,I),I.editIconHandle=!0,I.setPosition=function(){},I.positionChanged=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var oa=B.getHandlePadding(),qa=D.getNestedCornerIconOffset(La, B.bounds.x,B.bounds.y,function(Ra){return D.isEditIconVisible(Ra)});oa=new mxPoint(B.bounds.x-12-oa.x/2-qa,B.bounds.y-12-oa.y/2-qa);D.isCellMovable(La)&&(D.isLockedGroupIconVisible(La)||D.isMoveIconVisible(La))&&(oa.x+=24);qa=Number(null!=B.currentAlpha?B.currentAlpha:B.state.style[mxConstants.STYLE_ROTATION]||"0");var Ba=mxUtils.toRadians(qa);if(0!=Ba){var Na=new mxPoint(B.state.getCenterX(),B.state.getCenterY());oa=mxUtils.getRotatedPoint(oa,Math.cos(Ba),Math.sin(Ba),Na)}this.shape.bounds.width= Qa;this.shape.bounds.height=Qa;this.shape.bounds.x=oa.x-Qa/2;this.shape.bounds.y=oa.y-Qa/2;this.shape.rotation=qa;this.shape.redraw()}},I.execute=function(oa){D.startEditingAtCell(La)},q.push(I));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==q&&(q=[]),B=this,D=this.graph,La=this.state.cell,Qa=16,I=new mxImageShape(new mxRectangle(0,0,Qa,Qa),HoverIcons.prototype.moveHandle.src),I.preserveImageAspect=!1,I=new mxHandle(this.state,"move",null,I),I.moveGroupHandle= !0,I.setPosition=function(){},I.positionChanged=function(){},I.execute=function(){},I.reset=function(){},I.redraw=function(){if(null!=this.shape){var oa=B.getHandlePadding(),qa=D.getNestedCornerIconOffset(La,B.bounds.x,B.bounds.y,function(Na){return D.isMoveIconVisible(Na)&&D.isCellMovable(Na)}),Ba=B.bounds.x-12-oa.x/2-qa;oa=B.bounds.y-12-oa.y/2-qa;this.shape.bounds.width=Qa;this.shape.bounds.height=Qa;this.shape.bounds.x=Ba-Qa/2;this.shape.bounds.y=oa-Qa/2;this.shape.redraw()}},q.push(I));return null!= q?q.reverse():null};var Za=mxVertexHandler.prototype.setHandlesVisible,Xa=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(q,A,B){Xa.apply(this,arguments);var D=this.graph;if(null!=this.parentState&&D.isTransparentBounds(this.parentState.cell)){var I=D.view.scale,K=D.view.translate,P=this.parentState;this.parentState=P.clone();this.parentState.x=I*(K.x+P.origin.x);this.parentState.y=I*(K.y+P.origin.y)}for(I=D.model.getParent(this.state.cell);null!=I;)D.isTransparentBounds(I)&& (K=D.selectionCellsHandler.getHandler(I),null!=K&&null!=K.selectionBorder&&(K.selectionBorder.node.style.visibility="hidden")),I=D.model.getParent(I);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(D=0;D<this.sizers.length;D++)null!=this.sizers[D]&&D!=this.index&&(this.sizers[D].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden"); this.resizeHandlesHidden=!0}};var Va=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!=this.sizers)for(var q=0;q<this.sizers.length;q++)null!=this.sizers[q]&&(this.sizers[q].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}q=this.graph;for(var A=null!=this.state?q.model.getParent(this.state.cell):null;null!=A;){if(q.isTransparentBounds(A)){var B=q.selectionCellsHandler.getHandler(A); null!=B&&null!=B.selectionBorder&&(B.selectionBorder.node.style.visibility="")}A=q.model.getParent(A)}Va.apply(this,arguments)};mxVertexHandler.prototype.setHandlesVisible=function(q){Za.apply(this,arguments);if(null!=this.moveHandles)for(var A=0;A<this.moveHandles.length;A++)null!=this.moveHandles[A]&&(this.moveHandles[A].node.style.visibility=q?"":"hidden");if(null!=this.cornerHandles)for(A=0;A<this.cornerHandles.length;A++)this.cornerHandles[A].node.style.visibility=q?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&& null!=this.selectionBorder&&(this.selectionBorder.node.style.visibility=q?"":"hidden")};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var q=this.isMoveHandlesVisible();q&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():q||null==this.moveHandles||this.destroyMoveHandles();if(q&&null==this.moveHandles){for(q=0;q<this.moveHandles.length;q++)null!= this.moveHandles[q]&&this.moveHandles[q].parentNode.removeChild(this.moveHandles[q]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var q=this.graph,A=q.model,B=[],D=0;D<A.getChildCount(this.state.cell);D++)mxUtils.bind(this,function(I){if(null!=I&&A.isVertex(I.cell)&&q.isCellMovable(I.cell)){var K=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);K=new mxImageShape(K,this.rowHandleImage.src);K.rowState=I;K.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG? mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;K.init(this.graph.getView().getOverlayPane());K.node.style.cursor="move";mxEvent.addGestureListeners(K.node,mxUtils.bind(this,function(P){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(P)&&this.graph.isCellSelected(I.cell)||this.graph.selectCellForEvent(I.cell,P);mxEvent.isPopupTrigger(P)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(P),mxEvent.getClientY(P),this.graph.getSelectionCells()), this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(P),this.graph.isMouseDown=!0);mxEvent.consume(P)}),null,mxUtils.bind(this,function(P){mxEvent.isPopupTrigger(P)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(P),mxEvent.getClientY(P),I.cell,P),mxEvent.consume(P))}));B.push(K)}else B.push(null)})(this.graph.view.getState(A.getChildAt(this.state.cell,D)));return B};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var q= 0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&this.moveHandles[q].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=function(){if(null!=this.cornerHandles){for(var q=0;q<this.cornerHandles.length;q++)null!=this.cornerHandles[q]&&null!=this.cornerHandles[q].node&&null!=this.cornerHandles[q].node.parentNode&&this.cornerHandles[q].node.parentNode.removeChild(this.cornerHandles[q].node);this.cornerHandles=null}};var ja=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh= function(){ja.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var q=0;4>q;q++){var A=new mxRectangleShape(new mxRectangle(0, 0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);A.dialect=mxConstants.DIALECT_SVG;A.init(this.graph.view.getOverlayPane());this.cornerHandles.push(A)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();q=this.graph.getLinkForCell(this.state.cell);A=this.graph.getLinksForState(this.state);this.updateLinkHint(q,A)};var ya=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var q=new mxPoint(0,0),A=this.tolerance, B=this.state.style.shape;null==mxCellRenderer.defaultShapes[B]&&mxStencilRegistry.getStencil(B);B=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!B&&null!=this.customHandles)for(var D=0;D<this.customHandles.length;D++)if(null!=this.customHandles[D]&&!this.customHandles[D].lockHandle&&!this.customHandles[D].editIconHandle&&!this.customHandles[D].moveGroupHandle&&null!=this.customHandles[D].shape&&null!=this.customHandles[D].shape.bounds){var I=this.customHandles[D].shape.bounds, K=I.getCenterX(),P=I.getCenterY();if(Math.abs(this.state.x-K)<I.width/2||Math.abs(this.state.y-P)<I.height/2||Math.abs(this.state.x+this.state.width-K)<I.width/2||Math.abs(this.state.y+this.state.height-P)<I.height/2){B=!0;break}}B&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(A/=2,this.graph.isTable(this.state.cell)&&(A+=7),q.x=this.sizers[0].bounds.width+A,q.y=this.sizers[0].bounds.height+A):q=ya.apply(this,arguments);return q};mxVertexHandler.prototype.updateHint=function(q){if(this.index!= mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));if(this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"°";else{q=this.state.view.scale;var A=this.state.view.unit;this.hint.innerHTML=b(this.roundLength(this.bounds.width/q),A)+" x "+b(this.roundLength(this.bounds.height/q),A)}q=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==q&& (q=this.bounds);this.hint.style.left=q.x+Math.round((q.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=q.y+q.height+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")}};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};var db=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){db.apply(this,arguments);var q=this.graph.getLinkForCell(this.state.cell), A=this.graph.getLinksForState(this.state);this.updateLinkHint(q,A)};var mb=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(q,A){mb.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var kb=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(q,A){kb.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&& 1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(q,A,B){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var D=this.graph.view.translate,I=this.graph.view.scale,K=this.roundLength(A.x/I-D.x);D=this.roundLength(A.y/I-D.y);var P=this.graph.view.unit;this.hint.innerHTML=b(K,P)+", "+b(D,P);this.hint.style.visibility="visible";null!=B&&(B.view.updateEdgeBounds(B),this.hint.innerHTML+=" ("+(P==mxConstants.POINTS? Math.round(B.length/I):b(B.length/I,P))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(B=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*B.x)+"%, "+Math.round(100*B.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(q.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(q.getGraphY(), A.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage=function(q,A){return A?Graph.createSvgImage(q,q,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>', 9,9):Graph.createSvgImage(q,q,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>',9,9)};Graph.updateFoldingImages=function(q){Graph.prototype.expandedImage=Graph.createFoldingImage(q,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(q, !0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(q){var A=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=A){var B=parseInt(mxUtils.getValue(q.style,"foldingIconSize",0));if(0<B){var D=B+"-"+this.isCellCollapsed(q.cell);A=Graph.foldingImages[D];null==A&&(A=Graph.createFoldingImage(B,this.isCellCollapsed(q.cell)),Graph.foldingImages[D]=A)}}return A};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle= Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>'); HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="7" stroke="#fff" fill="'+ HoverIcons.prototype.arrowFill+'"/><circle cx="11" cy="11" r="3" stroke="#fff" fill="transparent"/>');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>', 24,24);HoverIcons.prototype.connectHandle=Graph.createSvgImage(16,16,'<circle cx="12" cy="12" r="10" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/><path transform="translate(5,5) scale(0.583)" d="M6 18v-3h7.6L4 5.4 5.4 4 15 13.6V6h3v12z" fill="#fff"/>',24,24);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>', 24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle= Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>', 24,24);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="'+HoverIcons.prototype.arrowFill+'"/>');mxVertexHandler.TABLE_HANDLE_COLOR="#fca000";mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle;mxVertexHandler.prototype.rowHandleImage=Graph.createSvgImage(14, 12,'<rect x="2" y="2" width="10" height="3" stroke-width="1" stroke="#ffffff" fill="'+HoverIcons.prototype.arrowFill+'"/><rect x="2" y="7" width="10" height="3" stroke-width="1" stroke="#ffffff" fill="'+HoverIcons.prototype.arrowFill+'"/>');mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxEdgeHandler.prototype.endHandleImage=HoverIcons.prototype.endMainHandle;mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle;mxEdgeHandler.prototype.endTerminalHandleImage= HoverIcons.prototype.endTerminalHandle;mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle;mxEdgeHandler.prototype.endFixedHandleImage=HoverIcons.prototype.endFixedHandle;mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle;mxOutline.prototype.sizerImage=HoverIcons.prototype.mainHandle;null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown= HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxGraphHandler.prototype.maxLivePreview=32;mxGraphHandler.prototype.previewColor="light-dark(#000000, #cccccc)";mxRubberband.prototype.defaultOpacity= 30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;var zb=mxEdgeHandler.prototype.removePoint; mxEdgeHandler.prototype.removePoint=function(q,A){var B=0==A;(B||null!=this.abspoints&&A==this.abspoints.length-1)&&null!=this.abspoints&&null!=this.abspoints[A]&&null==this.graph.getModel().getTerminal(q.cell,B)?this.graph.fireEvent(new mxEventObject("doubleClickEdgeTerminal","cell",q.cell,"source",B,"point",this.abspoints[A].clone())):zb.apply(this,arguments)};var ub=mxEdgeHandler.prototype.changePoints;mxEdgeHandler.prototype.changePoints=function(q,A,B){null!=q&&null!=A&&0<A.length&&"1"==mxUtils.getValue(this.graph.getCellStyle(q), "libavoidRouting",null)&&this.graph.setCellStyles("libavoidRouting",null,[q]);return ub.apply(this,arguments)};var ib=mxEdgeSegmentHandler.prototype.getPreviewPoints;mxEdgeSegmentHandler.prototype.getPreviewPoints=function(q){if((this.isSource||this.isTarget)&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.previewEndpointDrag){var A=null;try{A=LibavoidRouting.previewEndpointDrag(this,q)}catch(B){}if(null!=A)return A}return ib.apply(this,arguments)};var tb=mxEdgeHandler.prototype.reset; mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return tb.apply(this,arguments)};var rb=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(q,A,B){if(null!=this.state&&null!=q&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var D=A;D<B;D++)null!=q[D]&&null!=q[D].node&&mxUtils.setOpacity(q[D].node,this.virtualBendOpacity);else return rb.apply(this, arguments)};var eb=mxConnectionHandler.prototype.updateEdgeState;mxConnectionHandler.prototype.updateEdgeState=function(q,A){if(null!=this.edgeState&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.connectionWaypoints&&"1"==mxUtils.getValue(this.edgeState.style,"libavoidRouting",null))try{this.waypoints=LibavoidRouting.connectionWaypoints(this)}catch(B){this.waypoints=null}eb.apply(this,arguments)};var fb=mxConnectionHandler.prototype.reset;mxConnectionHandler.prototype.reset=function(){"undefined"!== typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&(LibavoidRouting.endPreview(this),this.waypoints=null);return fb.apply(this,arguments)};var jb=mxGraphHandler.prototype.updateLivePreview;mxGraphHandler.prototype.updateLivePreview=function(q,A){jb.apply(this,arguments);if("undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.livePreviewMove)try{LibavoidRouting.livePreviewMove(this,q,A)}catch(B){}};var vb=mxGraphHandler.prototype.reset;mxGraphHandler.prototype.reset=function(){vb.apply(this, arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePreview&&LibavoidRouting.endMovePreview(this)};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(q){return!mxEvent.isShiftDown(q.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12, mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(q){return mxEvent.isMouseEvent(q.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(q){var A=q.getEvent();return null==q.getState()&&!mxEvent.isMouseEvent(A)||mxEvent.isPopupTrigger(A)&&(null==q.getState()||mxEvent.isControlDown(A)||mxEvent.isShiftDown(A))}}else mxPanningHandler.prototype.isPanningTrigger= function(q){var A=q.getEvent();return mxEvent.isLeftMouseButton(A)&&(this.useLeftButtonForPanning&&null==q.getState()||mxEvent.isControlDown(A)&&!mxEvent.isShiftDown(A))||this.usePopupTrigger&&mxEvent.isPopupTrigger(A)};mxRubberband.prototype.isSpaceEvent=function(q){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(q.getEvent())||mxEvent.isMetaDown(q.getEvent()))&&mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent())};mxRubberband.prototype.cancelled= !1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(q,A){if(this.cancelled)this.cancelled=!1,A.consume();else{var B=null!=this.div&&"none"!=this.div.style.display,D=q=null,I=null,K=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(q=this.first.x,D=this.first.y,I=(this.currentX-q)/this.graph.view.scale,K=(this.currentY-D)/this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(I=this.graph.snap(I),K= this.graph.snap(K),this.graph.isGridEnabled()||(Math.abs(I)<this.graph.tolerance&&(I=0),Math.abs(K)<this.graph.tolerance&&(K=0))));this.reset();if(B){if(this.isSpaceEvent(A)){B=[this.graph.getDefaultParent()];var P=this.graph.getCellAt(q,D,B[0],!0,!1,mxUtils.bind(this,function(Ca){return!this.graph.isContainer(Ca.cell)||this.graph.isCellLocked(Ca.cell)||this.graph.isCellCollapsed(Ca.cell)||this.graph.isTable(Ca.cell)||this.graph.isTableRow(Ca.cell)||this.graph.isTableCell(Ca.cell)}));if(null!=P){for(var X= [];P!=B[0];)X.unshift(P),P=this.graph.model.getParent(P);B=B.concat(X)}this.graph.model.beginUpdate();try{for(P=0;P<B.length;P++){var aa=this.graph.getCellsBeyond(q,D,B[P],!0,!0);for(X=0;X<aa.length;X++)if(this.graph.isCellMovable(aa[X])&&0>mxUtils.indexOf(B,aa[X])){var ca=this.graph.view.getState(aa[X]),ra=this.graph.getCellGeometry(aa[X]);null!=ca&&null!=ra&&(ra=ra.clone(),ra.translate(I,K),this.graph.model.setGeometry(aa[X],ra))}0<P&&this.graph.isCellResizable(B[P])&&(ra=this.graph.getCellGeometry(B[P]), null!=ra&&(ra=ra.clone(),ra.width=Math.max(0,ra.width+I),ra.height=Math.max(0,ra.height+K),this.graph.model.setGeometry(B[P],ra)))}}finally{this.graph.model.endUpdate()}}else aa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(aa,A.getEvent());A.consume()}}};mxRubberband.prototype.mouseMove=function(q,A){if(!A.isConsumed()&&null!=this.first){var B=mxUtils.getScrollOrigin(this.graph.container);q=mxUtils.getOffset(this.graph.container);B.x-=q.x;B.y-=q.y;q=A.getX()+B.x;B= A.getY()+B.y;var D=this.first.x-q,I=this.first.y-B,K=this.graph.tolerance;if(null!=this.div||Math.abs(D)>K||Math.abs(I)>K)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(q,B),this.isSpaceEvent(A)?(q=this.x+this.width,B=this.y+this.height,D=this.graph.view.scale,mxEvent.isAltDown(A.getEvent())||(this.width=this.graph.snap(this.width/D)*D,this.height=this.graph.snap(this.height/D)*D,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height< this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=q-this.width),this.y<this.first.y&&(this.y=B-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0), this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv), this.secondDiv=null)),A.consume()}};var nb=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);nb.apply(this,arguments)};var Vb=(new Date).getTime(),Gb=0,Hb=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(q,A,B,D){Hb.apply(this,arguments);B!=this.currentTerminalState?(Vb=(new Date).getTime(),Gb=0):Gb=(new Date).getTime()-Vb;this.currentTerminalState= B};var Lb=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(q){if(mxEvent.isShiftDown(q.getEvent())&&mxEvent.isAltDown(q.getEvent()))return!1;var A=null!=this.currentTerminalState?mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"):"1";return"3"==A?!1:null!=this.currentTerminalState&&q.getState()==this.currentTerminalState&&("2"==A||2E3<Gb)||(null==this.currentTerminalState||"0"!=A)&&Lb.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape= function(q,A,B){A=null!=q&&0==q;var D=this.state.getVisibleTerminalState(A);q=null!=q&&null!=this.state.absolutePoints&&(0==q||q>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==q)?this.graph.getConnectionConstraint(this.state,D,A):null;B=null!=(null!=q?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(A),q):null)?B?this.endFixedHandleImage:this.fixedHandleImage:null!=q&&null!=D?B?this.endTerminalHandleImage:this.terminalHandleImage:B?this.endHandleImage: this.handleImage;if(null!=B)return B=new mxImageShape(new mxRectangle(0,0,B.width,B.height),B.src),B.preserveImageAspect=!1,B;B=mxConstants.HANDLE_SIZE;this.preferHtml&&--B;return new mxRectangleShape(new mxRectangle(0,0,B,B),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Mb=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(q,A,B,D){D=A==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:A==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle: A==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:D;return Mb.apply(this,arguments)};var Wb=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var q=Wb.apply(this,arguments);null==this.connectShape&&this.isConnectHandleVisible()&&(this.connectShape=this.createSizer("copy",mxEvent.CONNECT_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),q.push(this.connectShape));return q};var Tb=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers= function(){Tb.apply(this,arguments);this.connectShape=null};var $b=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(q){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var A=mxEvent.isMouseEvent(q.getEvent())?1:this.tolerance;A=this.allowHandleBoundsCheck&&0<A?new mxRectangle(q.getGraphX()-A,q.getGraphY()-A,2*A,2*A):null;if(q.isSource(this.connectShape)||null!=A&&this.connectShape.intersectsRectangle(A))return mxEvent.CONNECT_HANDLE}return $b.apply(this, arguments)};var Xb=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,A){if(!A.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(A)==mxEvent.CONNECT_HANDLE){var B=A.getGraphX(),D=A.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,B,D);this.graph.isMouseTrigger=mxEvent.isMouseEvent(A.getEvent());this.graph.isMouseDown= !0;B=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=B&&B.setHandlesVisible(!1);A.consume()}else Xb.apply(this,arguments)};var Yb=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(q){if(null!=q&&1==q.length){var A=this.graph.getModel(),B=A.getParent(q[0]),D=this.graph.getCellGeometry(q[0]);if(A.isEdge(B)&&null!=D&&D.relative&&(A=this.graph.view.getState(q[0]),null!=A&&2>A.width&&2>A.height&&null!=A.text&&null!=A.text.boundingBox))return mxRectangle.fromRectangle(A.text.boundingBox)}return Yb.apply(this, arguments)};var Ib=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){var q=Ib.apply(this,arguments),A=this.graph.container;A=null!=A?new mxRectangle(A.scrollLeft-this.graph.panDx-A.clientWidth/2,A.scrollTop-this.graph.panDy-A.clientHeight/2,2*A.clientWidth,2*A.clientHeight):null;for(var B=[],D=0;D<q.length;D++)"1"==mxUtils.getValue(q[D].style,"part","0")||null!=A&&!mxUtils.intersects(A,q[D])||B.push(q[D]);return B};var lb=mxVertexHandler.prototype.getSelectionBounds; mxVertexHandler.prototype.getSelectionBounds=function(q){var A=this.graph.getModel(),B=A.getParent(q.cell),D=this.graph.getCellGeometry(q.cell);return A.isEdge(B)&&null!=D&&D.relative&&2>q.width&&2>q.height&&null!=q.text&&null!=q.text.boundingBox?(A=q.text.unrotatedBoundingBox||q.text.boundingBox,B=A.x,D=A.y,null!=q.text.unrotatedBoundingBox&&(B=q.text.boundingBox.getCenterX()-A.width/2,D=q.text.boundingBox.getCenterY()-A.height/2),new mxRectangle(Math.round(B),Math.round(D),Math.round(A.width),Math.round(A.height))): lb.apply(this,arguments)};var Nb=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(q,A){var B=this.graph.getModel(),D=B.getParent(this.state.cell),I=this.graph.getCellGeometry(this.state.cell),K=this.getHandleForEvent(A);if(null!=K&&K<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles){var P=this.customHandles[mxEvent.CUSTOM_HANDLE-K];if(null!=P&&P.moveGroupHandle){B=this.graph.getMoveIconDragCells(this.state.cell);null!=B&&(this.graph.graphHandler.start(this.state.cell, mxEvent.getClientX(A.getEvent()),mxEvent.getClientY(A.getEvent()),B),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(A.getEvent()),this.graph.isMouseDown=!0,A.consume());return}}(K==mxEvent.ROTATION_HANDLE||K==mxEvent.CONNECT_HANDLE||!B.isEdge(D)||null==I||!I.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&Nb.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var q=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR, mxConstants.NONE),A=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&q==mxConstants.NONE&&A==mxConstants.NONE?(q=this.state.view.graph,q.isRotatableGroup(this.state.cell)?q.rotateCell(this.state.cell,90):(A=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),q.setCellStyles(mxConstants.STYLE_ROTATION,A,[this.state.cell]))):this.state.view.graph.turnShapes([this.state.cell])};var Ab= mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(q){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var A=this.graph.view.scale,B=this.state.style,D=this.roundLength(this.bounds.width/A),I=this.roundLength(this.bounds.height/A),K=this.graph.cellRenderer.getLabelValue(this.state);if(null!=K&&0<K.length){var P=this.graph.getAutosizeTextAvailableSpace(B,D,I,this.state);if(null!=P){this.graph.isHtmlLabel(this.state.cell)||(K=mxUtils.htmlEntities(K, !1));K=K.replace(/\n/g,"<br>");var X=B[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,aa=B[mxConstants.STYLE_FONTSTYLE],ca="wrap"==B[mxConstants.STYLE_WHITE_SPACE];A=null;if(ca){var ra=this.graph.getShapeInsideFloats(B,D,I);null!=ra&&(A=this.graph.computeShapeInsideFontSize(K,B,ra,D,I))}null==A&&(A=this.graph.computeAutosizeTextFontSize(K,P.availW,P.availH,X,aa,ca));D=B[mxConstants.STYLE_FONTSIZE];B[mxConstants.STYLE_FONTSIZE]=A;Ab.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]= D;return}}}Ab.apply(this,arguments)};var Db=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(q,A){Db.apply(this,arguments);this.resizeHandlesHidden&&null!=this.index&&!this.inTolerance&&this.redrawHandles();null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display="none"),null!=this.linkHint&& "none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var bb=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(q,A){bb.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&& 1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.sizeGuidesEnabled=!0;mxVertexHandler.prototype.isSizeGuidesEnabled=function(){return this.sizeGuidesEnabled&&(null==this.graph.graphHandler||this.graph.graphHandler.guidesEnabled)};mxVertexHandler.prototype.isSizeGuidesEnabledForEvent=function(q){return this.isSizeGuidesEnabled()&&!mxEvent.isAltDown(q)};mxVertexHandler.prototype.getSizeGuideTolerance=function(q){return q&& this.graph.gridEnabled?this.graph.gridSize/2:2};mxVertexHandler.prototype.getSizeGuideStates=function(){var q=this.graph,A=q.getModel(),B=q.view,D=B.scale,I=this.state.cell,K=q.container;K=null!=K?new mxRectangle(K.scrollLeft-q.panDx-K.clientWidth/2,K.scrollTop-q.panDy-K.clientHeight/2,2*K.clientWidth,2*K.clientHeight):null;for(var P=B.getCellStates(A.filterDescendants(function(Qa){return Qa!=I&&A.isVertex(Qa)&&!q.isCellSelected(Qa)&&!A.isAncestor(I,Qa)&&null!=A.getGeometry(Qa)&&!A.getGeometry(Qa).relative&& null!=B.getState(Qa)},q.getDefaultParent())),X=this.state.getCenterX(),aa=this.state.getCenterY(),ca=90==mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360)%180,ra=[],Ca=0;Ca<P.length;Ca++){var za=q.graphHandler.getGuideState(P[Ca]);if(0<za.width&&0<za.height&&(null==K||mxUtils.intersects(K,za))){var Ia=za.getCenterX()-X,La=za.getCenterY()-aa;ra.push({state:za,width:(ca?za.height:za.width)/D,height:(ca?za.width:za.height)/D,dist:Ia*Ia+La*La})}}ra.sort(function(Qa,ha){return Qa.dist- ha.dist});return ra};mxVertexHandler.prototype.getSizeGuideMatch=function(q,A,B,D){for(var I=null,K=0;K<this.sizeGuideStates.length;K++){var P=this.sizeGuideStates[K],X=(A?P.width:P.height)*D,aa=Math.abs(X-q);1<=X&&aa<=B&&(null==I||aa<I.diff)&&(I={state:P.state,value:X,diff:aa})}return I};mxVertexHandler.prototype.snapSize=function(q,A,B,D,I,K,P){var X=this.getSizeGuideTolerance(D)*I;D=this.graph.getCellGeometry(this.state.cell);var aa=null!=D&&0<D.width&&0<D.height?D.width/D.height:null;if(!K||null!= aa)if(D=K||1!=B&&6!=B?this.getSizeGuideMatch(q.width,!0,X,I):null,X=K||3!=B&&4!=B?this.getSizeGuideMatch(q.height,!1,X,I):null,K&&(null!=D&&(null==X||D.diff<=X.diff)?X=null:D=null),null!=D||null!=X){var ca=null!=D?D.value:K?X.value*aa:null;aa=null!=X?X.value:K?D.value/aa:null;var ra=q.x,Ca=q.y;null!=ca&&(P?ra=q.x+(q.width-ca)/2:0==B||3==B||5==B?.01<Math.abs(q.x+q.width-A.x-A.width)?ca=null:ra=q.x+q.width-ca:.01<Math.abs(q.x-A.x)&&(ca=null));null!=aa&&(P?Ca=q.y+(q.height-aa)/2:3>B?.01<Math.abs(q.y+ q.height-A.y-A.height)?aa=null:Ca=q.y+q.height-aa:.01<Math.abs(q.y-A.y)&&(aa=null));null!=this.minBounds&&(null!=ca&&ca<this.minBounds.x*I+this.minBounds.width*I+Math.max(0,this.x0*I-ra)&&(ca=null),null!=aa&&aa<this.minBounds.y*I+this.minBounds.height*I+Math.max(0,this.y0*I-Ca)&&(aa=null));if(!K||null!=ca&&null!=aa)null!=ca&&(q.x=ra,q.width=ca,this.sizeGuideWidthState=null!=D?D.state:null),null!=aa&&(q.y=Ca,q.height=aa,this.sizeGuideHeightState=null!=X?X.state:null)}};mxVertexHandler.prototype.getEdgeGuideMatch= function(q,A,B){for(var D=null,I=0;I<this.sizeGuideStates.length;I++)for(var K=this.sizeGuideStates[I].state,P=A?[K.x,K.getCenterX(),K.x+K.width]:[K.y,K.getCenterY(),K.y+K.height],X=0;X<P.length;X++){var aa=Math.abs(P[X]-q);aa<=B&&(null==D||aa<D.diff)&&(D={state:K,value:P[X],diff:aa})}return D};mxVertexHandler.prototype.isEdgeGuideSizeAllowed=function(q,A,B,D){return 1>q?!1:null!=this.minBounds?B?q>=this.minBounds.x*D+this.minBounds.width*D+Math.max(0,this.x0*D-A):q>=this.minBounds.y*D+this.minBounds.height* D+Math.max(0,this.y0*D-A):!0};mxVertexHandler.prototype.snapEdges=function(q,A,B,D,I){var K=this.graph.getCellGeometry(this.state.cell);if(0==mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0")&&null!=K&&!K.relative&&mxGuide.prototype.positionEnabled){K=this.graph.view;var P=null!=this.parentState?this.parentState.x:K.translate.x*K.scale,X=null!=this.parentState?this.parentState.y:K.translate.y*K.scale,aa=Math.max(2,this.getSizeGuideTolerance(D)*K.scale);if(null!=this.sizeGuideWidthState|| 0!=B&&3!=B&&5!=B)null==this.sizeGuideWidthState&&(2==B||4==B||7==B)&&.01>=Math.abs(q.x-A.x)&&(D=this.getEdgeGuideMatch(P+(q.x+q.width)*K.scale,!0,aa),null!=D&&(ca=(D.value-P)/K.scale-q.x,this.isEdgeGuideSizeAllowed(ca,q.x,!0,I)&&(q.width=ca,this.edgeGuideXMatch=D)));else if(.01>=Math.abs(q.x+q.width-A.x-A.width)&&(D=this.getEdgeGuideMatch(P+q.x*K.scale,!0,aa),null!=D)){P=(D.value-P)/K.scale;var ca=q.x+q.width-P;this.isEdgeGuideSizeAllowed(ca,P,!0,I)&&(q.width=ca,q.x=P,this.edgeGuideXMatch=D)}null== this.sizeGuideHeightState&&3>B?.01>=Math.abs(q.y+q.height-A.y-A.height)&&(D=this.getEdgeGuideMatch(X+q.y*K.scale,!1,aa),null!=D&&(A=(D.value-X)/K.scale,B=q.y+q.height-A,this.isEdgeGuideSizeAllowed(B,A,!1,I)&&(q.height=B,q.y=A,this.edgeGuideYMatch=D))):null==this.sizeGuideHeightState&&4<B&&.01>=Math.abs(q.y-A.y)&&(D=this.getEdgeGuideMatch(X+(q.y+q.height)*K.scale,!1,aa),null!=D&&(B=(D.value-X)/K.scale-q.y,this.isEdgeGuideSizeAllowed(B,q.y,!1,I)&&(q.height=B,this.edgeGuideYMatch=D)))}};mxVertexHandler.prototype.createEdgeGuideShape= function(q,A,B){A=[A,B];null==q?(q=new mxPolyline(A,mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH),q.dialect=mxConstants.DIALECT_SVG,q.pointerEvents=!1,q.init(this.graph.getView().getOverlayPane())):q.points=A;q.node.style.visibility="visible";q.redraw();return q};mxVertexHandler.prototype.createSizeGuideShape=function(q,A,B,D){var I=5*this.graph.view.scale,K=A.getCenterX(),P=A.getCenterY(),X=D?new mxPoint(A.x,P):new mxPoint(K,A.y);A=D?new mxPoint(A.x+A.width,P):new mxPoint(K,A.y+A.height); var aa=D?0:I;D=D?I:0;X=[new mxPoint(X.x-aa,X.y-D),new mxPoint(X.x+aa,X.y+D),X,A,new mxPoint(A.x-aa,A.y-D),new mxPoint(A.x+aa,A.y+D)];if(0!=B)for(D=Math.cos(B),B=Math.sin(B),K=new mxPoint(K,P),P=0;P<X.length;P++)X[P]=mxUtils.getRotatedPoint(X[P],D,B,K);null==q?(q=new mxPolyline(X,mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH),q.dialect=mxConstants.DIALECT_SVG,q.pointerEvents=!1,q.init(this.graph.getView().getOverlayPane())):q.points=X;q.node.style.visibility="visible";q.redraw();return q}; mxVertexHandler.prototype.redrawSizeGuides=function(){this.sizeGuideShapes=null!=this.sizeGuideShapes?this.sizeGuideShapes:[];var q=0;if(null!=this.state&&null!=this.bounds){var A=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),B=90==mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360)%180,D=function(P){P=mxUtils.mod(mxUtils.getNumber(P.style,mxConstants.STYLE_ROTATION,0),360);return 90==P%180?0:mxUtils.toRadians(P)},I=mxUtils.bind(this,function(P, X,aa){this.sizeGuideShapes[q]=this.createSizeGuideShape(this.sizeGuideShapes[q],P,X,aa);q++}),K=mxUtils.bind(this,function(P,X){this.sizeGuideShapes[q]=this.createEdgeGuideShape(this.sizeGuideShapes[q],P,X);q++});null!=this.sizeGuideWidthState&&(I(this.bounds,A,!0),I(this.sizeGuideWidthState,D(this.sizeGuideWidthState),!B));null!=this.sizeGuideHeightState&&(I(this.bounds,A,!1),I(this.sizeGuideHeightState,D(this.sizeGuideHeightState),B));null!=this.edgeGuideXMatch&&(A=this.edgeGuideXMatch.state,K(new mxPoint(this.edgeGuideXMatch.value, Math.min(this.bounds.y,A.y)),new mxPoint(this.edgeGuideXMatch.value,Math.max(this.bounds.y+this.bounds.height,A.y+A.height))));null!=this.edgeGuideYMatch&&(A=this.edgeGuideYMatch.state,K(new mxPoint(Math.min(this.bounds.x,A.x),this.edgeGuideYMatch.value),new mxPoint(Math.max(this.bounds.x+this.bounds.width,A.x+A.width),this.edgeGuideYMatch.value)))}for(K=q;K<this.sizeGuideShapes.length;K++)null!=this.sizeGuideShapes[K]&&(this.sizeGuideShapes[K].node.style.visibility="hidden")};mxVertexHandler.prototype.destroySizeGuides= function(){if(null!=this.sizeGuideShapes){for(var q=0;q<this.sizeGuideShapes.length;q++)null!=this.sizeGuideShapes[q]&&this.sizeGuideShapes[q].destroy();this.sizeGuideShapes=null}this.sizeGuidesActive=this.edgeGuideYMatch=this.edgeGuideXMatch=this.sizeGuideHeightState=this.sizeGuideWidthState=this.sizeGuideStates=null};var Bb=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(q,A,B){Bb.apply(this,arguments);this.sizeGuideStates=null!=this.state&&0<=B&&this.isSizeGuidesEnabled()? this.getSizeGuideStates():null};var sb=mxVertexHandler.prototype.resizeVertex;mxVertexHandler.prototype.resizeVertex=function(q){this.sizeGuidesActive=this.isSizeGuidesEnabledForEvent(q.getEvent());sb.apply(this,arguments);this.redrawSizeGuides()};var Ob=mxVertexHandler.prototype.union;mxVertexHandler.prototype.union=function(q,A,B,D,I,K,P,X,aa){var ca=Ob.apply(this,arguments);this.edgeGuideYMatch=this.edgeGuideXMatch=this.sizeGuideHeightState=this.sizeGuideWidthState=null;this.sizeGuidesActive&& !this.singleSizer&&0<=D&&null!=this.sizeGuideStates&&0<this.sizeGuideStates.length&&(this.snapSize(ca,q,D,I,K,X,aa),X||aa||this.snapEdges(ca,q,D,I,K));return ca};var Eb=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){Eb.apply(this,arguments);this.destroySizeGuides()};var gb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){gb.apply(this,arguments);this.destroySizeGuides()};mxVertexHandler.prototype.updateLinkHint=function(q,A){try{if(null==q&& (null==A||0==A.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=q||null!=A&&0<A.length){var B=document.createElement("img");B.className="geAdaptiveAsset";B.setAttribute("src",Editor.editImage);B.setAttribute("title",mxResources.get("editLink"));B.setAttribute("width","14");B.setAttribute("height","14");B.style.paddingLeft="8px";B.style.marginLeft="auto";B.style.marginBottom="-1px";B.style.cursor="pointer";var D=B.cloneNode(!0);D.setAttribute("src", Editor.trashImage);D.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));D.style.paddingLeft="4px";D.style.marginLeft="0";null==this.linkHint&&(this.linkHint=a(),mxUtils.setPrefixedStyle(this.linkHint.style,"transform","translate(-50%,0)"),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()}))); this.linkHint.innerText="";if(null!=q){var I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.appendChild(this.graph.createLinkForHint(q,null,this.state.cell));this.linkHint.appendChild(I);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var K=B.cloneNode(!0);I.appendChild(K);mxEvent.addListener(K,"click",mxUtils.bind(this,function(X){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(X)})); var P=D.cloneNode(!0);I.appendChild(P);mxEvent.addListener(P,"click",mxUtils.bind(this,function(X){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(X)}))}}if(null!=A)for(I=0;I<A.length;I++)mxUtils.bind(this,function(X,aa){var ca=document.createElement("div");ca.style.display="flex";ca.style.alignItems="center";ca.style.marginTop=null!=q||0<aa?"6px":"0px";ca.appendChild(this.graph.createLinkForHint(X.getAttribute("href"),mxUtils.getTextContent(X),this.state.cell));var ra=B.cloneNode(!0); ca.appendChild(ra);var Ca=mxUtils.bind(this,function(za){var Ia=document.createElement("div");Ia.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var La=Ia.getElementsByTagName("a")[aa];if(null!=La){if(null==za||""==za){for(za=La.cloneNode(!0).firstChild;null!=za;)La.parentNode.insertBefore(za.cloneNode(!0),La),za=za.nextSibling;La.parentNode.removeChild(La)}else La.setAttribute("href",za);this.graph.labelChanged(this.state.cell,Ia.innerHTML)}});mxEvent.addListener(ra,"click",mxUtils.bind(this, function(za){this.graph.showLinkDialog(X.getAttribute("href")||"",mxResources.get("ok"),Ca);mxEvent.consume(za)}));ra=D.cloneNode(!0);ca.appendChild(ra);mxEvent.addListener(ra,"click",mxUtils.bind(this,function(za){Ca();mxEvent.consume(za)}));this.linkHint.appendChild(ca)})(A[I],I)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(X){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var wb=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler= function(){var q=wb.apply(this,arguments);q.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return q};var Zb=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Zb.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var ob=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var q= 0;q<this.moveHandles.length;q++)null!=this.moveHandles[q]&&(this.moveHandles[q].bounds.x=Math.round(this.moveHandles[q].rowState.x+this.moveHandles[q].rowState.width-this.moveHandles[q].bounds.width/2),this.moveHandles[q].bounds.y=Math.round(this.moveHandles[q].rowState.y+(this.moveHandles[q].rowState.height-this.moveHandles[q].bounds.height)/2),this.moveHandles[q].redraw());if(null!=this.cornerHandles){q=this.getSelectionBorderInset();var A=this.cornerHandles,B=A[0].bounds.height/2;A[0].bounds.x= this.state.x-A[0].bounds.width/2+q;A[0].bounds.y=this.state.y-B+q;A[0].redraw();A[1].bounds.x=A[0].bounds.x+this.state.width-2*q;A[1].bounds.y=A[0].bounds.y;A[1].redraw();A[2].bounds.x=A[0].bounds.x;A[2].bounds.y=this.state.y+this.state.height-2*q;A[2].redraw();A[3].bounds.x=A[1].bounds.x;A[3].bounds.y=A[2].bounds.y;A[3].redraw();A=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));for(q=0;q<this.cornerHandles.length;q++)this.cornerHandles[q].node.style.display= A?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");ob.apply(this);if(null!=this.customHandles)for(q=0;q<this.customHandles.length;q++)null!=this.customHandles[q]&&(this.customHandles[q].lockHandle||this.customHandles[q].editIconHandle||this.customHandles[q].moveGroupHandle)&& this.customHandles[q].redraw();null!=this.rotationShape&&null!=this.rotationShape.node&&(q=Number(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.rotationShape.rotation!==q&&(A=this.rotationShape.node.style.visibility,this.rotationShape.rotation=q,this.rotationShape.redraw(),this.rotationShape.node.style.visibility=A));null!=this.connectShape&&null!=this.connectShape.node&&(this.connectShape.node.setAttribute("title",mxResources.get("plusTooltip")), q=null==this.moveHandles&&1==this.graph.getSelectionCount()&&(null==this.index||this.index==mxEvent.CONNECT_HANDLE)&&!this.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&&this.isConnectHandleVisible(),this.connectShape.node.style.display=q?"":"none",this.connectShape.node.style.visibility=q?"":"hidden",q&&(A=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),q=Math.cos(A),A=Math.sin(A),B=new mxPoint(this.state.getCenterX(), this.state.getCenterY()),q=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),q,A,B),this.moveSizerTo(this.connectShape,q.x,q.y)));null!=this.state&&null!=this.linkHint&&(q=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),A=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),B=mxUtils.getBoundingBox(A,this.state.style[mxConstants.STYLE_ROTATION]||"0",q),q=null!=B?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"): this.state,A=null!=this.state.text?this.state.text.boundingBox:null,null==B&&(B=this.state),B=B.y+B.height,null!=A&&(B=Math.max(B,A.y+A.height)),this.linkHint.style.left=q.x+q.width/2+"px",this.linkHint.style.top=Math.round(B+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Ub=mxVertexHandler.prototype.drawPreview;mxVertexHandler.prototype.drawPreview=function(){if(null!=this.selectionBorder){var q=Graph.getLabelAutoRotation(this.state); this.selectionBorder.rotation=null!=q?q:Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}Ub.apply(this,arguments)};var Pb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Pb.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 Jb=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Jb.apply(this),null!=this.state&&null!=this.linkHint)){var q=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(q=new mxRectangle(q.x,q.y,q.width,q.height),q.add(this.state.text.bounds)); this.linkHint.style.left=q.x+q.width/2+"px";this.linkHint.style.top=Math.round(q.y+q.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Qb=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Qb.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Kb=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Kb.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)}}();InlineToolbar=function(a){this.editorUi=a;this.graph=a.editor.graph;this.init()};InlineToolbar.prototype.iconSize=24;InlineToolbar.prototype.offset=16;InlineToolbar.prototype.currentState=null;InlineToolbar.lineStyleIcon=Graph.createSvgImage(16,16,'<line x1="2" y1="8" x2="14" y2="8" stroke="black" stroke-width="1.5"/>',16,16);InlineToolbar.lineEndIcon=Graph.createSvgImage(16,16,'<path d="M 2 8 L 10 8 M 10 4 L 14 8 L 10 12 Z" stroke="black" stroke-width="1.5" fill="black"/>',16,16); InlineToolbar.connStyleIcon=Graph.createSvgImage(16,16,'<path d="M 3 13 L 3 6 Q 3 3 6 3 L 13 3" stroke="black" stroke-width="1.5" fill="none"/>',16,16); InlineToolbar.prototype.init=function(){this.toolbar=document.createElement("div");this.toolbar.style.position="absolute";this.toolbar.style.display="none";this.toolbar.style.zIndex=1;this.toolbar.style.borderRadius="12px";this.toolbar.style.backgroundColor="light-dark(white, var(--dark-color))";this.toolbar.style.border="1px solid light-dark(#d0d0d0, #505050)";this.toolbar.style.opacity="0.9";this.toolbar.style.boxShadow="0 4px 16px rgba(0,0,0,0.15)";this.toolbar.style.whiteSpace="nowrap";this.toolbar.style.padding= "4px";var a=this.iconSize-4,b=mxUtils.bind(this,function(e){var g=document.createElement("div");g.style.width=a+"px";g.style.height=a+"px";g.style.backgroundSize="16px";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="center";g.style.cursor="pointer";g.style.display="inline-block";g.style.verticalAlign="top";g.style.borderRadius="6px";g.className="geAdaptiveAsset";g.setAttribute("title",e);return g}),d=function(){var e=document.createElement("div");e.style.display="inline-block";e.style.width= "4px";return e};this.lineStyleBtn=b(mxResources.get("line"));this.lineStyleBtn.style.backgroundImage="url("+InlineToolbar.lineStyleIcon.src+")";this.toolbar.appendChild(this.lineStyleBtn);this.toolbar.appendChild(d());this.lineEndBtn=b(mxResources.get("lineend"));this.lineEndBtn.style.backgroundImage="url("+InlineToolbar.lineEndIcon.src+")";this.toolbar.appendChild(this.lineEndBtn);this.toolbar.appendChild(d());this.connStyleBtn=b(mxResources.get("connection"));this.connStyleBtn.style.backgroundImage= "url("+InlineToolbar.connStyleIcon.src+")";this.toolbar.appendChild(this.connStyleBtn);this.graph.container.appendChild(this.toolbar);mxEvent.addListener(this.toolbar,"mousedown",mxUtils.bind(this,function(e){this.graph.isEnabled()&&mxEvent.consume(e)}));mxEvent.addListener(this.lineStyleBtn,"click",mxUtils.bind(this,function(e){this.graph.isEnabled()&&(this.currentPopoverAnchor==this.lineStyleBtn?this.hidePopover():this.showLineStyleMenu(e),mxEvent.consume(e))}));mxEvent.addListener(this.lineEndBtn, "click",mxUtils.bind(this,function(e){this.graph.isEnabled()&&(this.currentPopoverAnchor==this.lineEndBtn?this.hidePopover():this.showLineEndMenu(e),mxEvent.consume(e))}));mxEvent.addListener(this.connStyleBtn,"click",mxUtils.bind(this,function(e){this.graph.isEnabled()&&(this.currentPopoverAnchor==this.connStyleBtn?this.hidePopover():this.showConnStyleMenu(e),mxEvent.consume(e))}));this.selectionHandler=mxUtils.bind(this,function(){this.updateSelection()});this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}); this.modelHandler=mxUtils.bind(this,function(){this.updateSelection()});this.hideHandler=mxUtils.bind(this,function(){this.hide()});this.graph.selectionModel.addListener(mxEvent.CHANGE,this.selectionHandler);this.graph.model.addListener(mxEvent.CHANGE,this.modelHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN, this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,this.selectionHandler);this.graph.addListener(mxEvent.START_EDITING,this.hideHandler);mxEvent.addListener(this.graph.container,"scroll",this.repaintHandler)}; InlineToolbar.prototype.updateSelection=function(){var a=this.graph.getSelectionCells(),b=null;1==a.length&&this.graph.model.isEdge(a[0])&&this.graph.isEnabled()&&!this.graph.isCellLocked(a[0])&&(b=this.graph.view.getState(a[0]));null!=b?(this.currentState=b,this.show()):(this.currentState=null,this.hide())}; InlineToolbar.prototype.getEdgeMidpoint=function(a){a=a.absolutePoints;if(null==a||2>a.length)return null;for(var b=0,d=[],e=1;e<a.length;e++)if(null!=a[e]&&null!=a[e-1]){var g=a[e].x-a[e-1].x,c=a[e].y-a[e-1].y;g=Math.sqrt(g*g+c*c);d.push(g);b+=g}else d.push(0);b/=2;for(e=g=0;e<d.length;e++){if(g+d[e]>=b){b-=g;d=0<d[e]?b/d[e]:0;b=a[e];e=a[e+1];if(null!=b&&null!=e)return new mxPoint(b.x+(e.x-b.x)*d,b.y+(e.y-b.y)*d);break}g+=d[e]}e=a[0];a=a[a.length-1];return null!=e&&null!=a?new mxPoint((e.x+a.x)/ 2,(e.y+a.y)/2):null};InlineToolbar.prototype.toolbarAnimDuration=150;InlineToolbar.prototype.show=function(){this.updateIcons();null!=this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null);this.toolbar.style.transition="none";this.toolbar.style.opacity="0";this.toolbar.style.display="block";this.repaint();this.toolbar.offsetHeight;this.toolbar.style.transition="opacity "+this.toolbarAnimDuration+"ms ease-out";this.toolbar.style.opacity="0.9"}; InlineToolbar.prototype.hide=function(){this.hidePopover(!0);null!=this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null);"none"!=this.toolbar.style.display&&(this.toolbar.style.transition="opacity "+this.toolbarAnimDuration+"ms ease-in",this.toolbar.style.opacity="0",this.hideTimeout=window.setTimeout(mxUtils.bind(this,function(){this.toolbar.style.display="none";this.hideTimeout=null}),this.toolbarAnimDuration))};InlineToolbar.prototype.supportsCurvedBend=function(a){return Graph.edgeSupportsCurved(a)}; InlineToolbar.prototype.updateIcons=function(){};InlineToolbar.prototype.segmentIntersectsRect=function(a,b,d,e,g,c,h,k){d-=a;e-=b;e=[-d,d,-e,e];a=[a-g,g+h-a,b-c,c+k-b];b=0;g=1;for(c=0;4>c;c++)if(0==e[c]){if(0>a[c])return!1}else if(h=a[c]/e[c],0>e[c]?b=Math.max(b,h):g=Math.min(g,h),b>g)return!1;return!0}; InlineToolbar.prototype.repaint=function(){if(null!=this.currentState&&"none"!=this.toolbar.style.display){var a=this.graph.view.getState(this.currentState.cell);if(null!=a){this.currentState=a;this.updateIcons();var b=this.getEdgeMidpoint(a);if(null!=b){var d=this.iconSize-4,e=3*d+18,g=d+10;d=b.x-e/2;var c=b.y-g-this.offset,h=this.graph.selectionCellsHandler.getHandler(a.cell);if(null!=h){var k=(h.bends||[]).concat(h.virtualBends||[]);h=mxUtils.bind(this,function(v,z){v=new mxRectangle(Math.round(v)- 8,Math.round(z)-8,e+16,g+16);for(z=0;z<k.length;z++)if(null!=k[z]&&null!=k[z].bounds&&"hidden"!==k[z].node.style.visibility&&mxUtils.intersects(v,k[z].bounds))return!0;var C=a.absolutePoints;if(null!=C)for(z=1;z<C.length;z++)if(null!=C[z]&&null!=C[z-1]&&this.segmentIntersectsRect(C[z-1].x,C[z-1].y,C[z].x,C[z].y,v.x,v.y,v.width,v.height))return!0;if(null!=a.text&&null!=a.text.boundingBox&&mxUtils.intersects(v,a.text.boundingBox))return!0;C=this.graph.getModel();var F=C.getChildCount(a.cell);for(z= 0;z<F;z++){var G=this.graph.view.getState(C.getChildAt(a.cell,z));if(null!=G&&(null!=G.shape&&null!=G.shape.boundingBox&&mxUtils.intersects(v,G.shape.boundingBox)||null!=G.text&&null!=G.text.boundingBox&&mxUtils.intersects(v,G.text.boundingBox)))return!0}return!1});if(h(d,c)){var p=b.y+this.offset,l=!1;h(d,p)||(c=p,l=!0);if(!l){p=b.y-g/2;var u=b.x-e-this.offset,x=b.x+this.offset;h(u,p)?h(x,p)||(d=x,c=p,l=!0):(d=u,c=p,l=!0)}if(!l)for(p=b.y-g/2,l=this.offset+8;100>l;l+=8)if(!h(d,b.y-g-l)){c=b.y-g-l; break}else if(!h(d,b.y+l)){c=b.y+l;break}else if(!h(b.x-e-l,p)){d=b.x-e-l;c=p;break}else if(!h(b.x+l,p)){d=b.x+l;c=p;break}}}p=this.graph.container;b=p.scrollLeft+4;h=p.scrollLeft+p.clientWidth-e-4;l=p.scrollTop+4;p=p.scrollTop+p.clientHeight-g-4;h>b&&(d=Math.max(b,Math.min(d,h)));p>l&&(c=Math.max(l,Math.min(c,p)));this.toolbar.style.left=Math.round(d)+"px";this.toolbar.style.top=Math.round(c)+"px"}}}}; InlineToolbar.prototype.clampToContainer=function(a,b,d,e){var g=this.graph.container,c=g.scrollLeft+4;d=g.scrollLeft+g.clientWidth-d-4;var h=g.scrollTop+4;e=g.scrollTop+g.clientHeight-e-4;return new mxPoint(d>c?Math.max(c,Math.min(a,d)):c,e>h?Math.max(h,Math.min(b,e)):h)};InlineToolbar.prototype.getActiveIndexForImage=function(a,b){for(var d=0;d<a.length;d++)if(a[d].img===b)return d;return-1};InlineToolbar.prototype.popoverColumns=4;InlineToolbar.prototype.popoverAnimDuration=220; InlineToolbar.prototype.createPopover=function(a,b){this.hidePopover(!0);var d=this.graph.container,e=document.createElement("div");e.style.position="absolute";e.style.zIndex=2;e.style.cursor="default";var g=Math.round(12*Math.SQRT2/2),c=document.createElement("div");c.style.position="absolute";c.style.width="12px";c.style.height="12px";c.style.backgroundColor="light-dark(#d0d0d0, #505050)";c.style.transform="rotate(45deg)";c.style.top=Math.round(g-6)+"px";c.style.zIndex=1;e.appendChild(c);var h= document.createElement("div");h.style.position="absolute";h.style.width="10px";h.style.height="10px";h.style.backgroundColor="light-dark(white, var(--dark-color))";h.style.transform="rotate(45deg)";h.style.top=Math.round(g-6+1)+"px";h.style.zIndex=3;e.appendChild(h);var k=document.createElement("div");k.style.position="relative";k.style.marginTop=g+"px";k.style.backgroundColor="light-dark(white, var(--dark-color))";k.style.border="1px solid light-dark(#d0d0d0, #505050)";k.style.borderRadius="12px"; k.style.boxShadow="0 4px 16px rgba(0,0,0,0.15)";k.style.padding="8px";k.style.zIndex=2;e.appendChild(k);mxEvent.addListener(e,"mousedown",function(l){mxEvent.consume(l)});e.style.opacity="0";e.style.transform="scale(0)";d.appendChild(e);b=mxUtils.bind(this,function(){var l=this.toolbar.getBoundingClientRect(),u=a.getBoundingClientRect(),x=d.getBoundingClientRect(),v=d.scrollTop,z=e.offsetWidth,C=e.offsetHeight;u=u.left+u.width/2-x.left+d.scrollLeft;var F=l.top-x.top,G=x.top+d.clientHeight-l.bottom; (F=!(G>=C+4)&&(F>=C+4||F>G))?(x=l.top-x.top+v-C-2,l=Math.round(g-6),c.style.top="",c.style.bottom=l+"px",h.style.top="",h.style.bottom=l+1+"px",k.style.marginTop="0",k.style.marginBottom=g+"px"):x=l.bottom-x.top+v+2;v=x;x=this.clampToContainer(u-z/2,x,z,C);l=x.x;x=x.y;x!=v&&(c.style.display="none",h.style.display="none");e.style.left=Math.round(l)+"px";e.style.top=Math.round(x)+"px";z=Math.max(14,Math.min(u-l-6,z-12-14));c.style.left=Math.round(z)+"px";h.style.left=Math.round(z+1)+"px";e.style.transformOrigin= Math.round(z+6)+"px "+(F?C+"px":"0px")});var p=mxUtils.bind(this,function(){e.style.transition="transform "+this.popoverAnimDuration+"ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity "+Math.round(.5*this.popoverAnimDuration)+"ms ease-out";e.offsetHeight;e.style.opacity="1";e.style.transform="scale(1)"});this.currentPopover=e;this.currentPopoverAnchor=a;this.popoverCloseHandler=mxUtils.bind(this,function(l){var u=l.target||l.srcElement,x=this.editorUi.colorWindow;mxEvent.isConsumed(l)||e.contains(u)|| this.toolbar.contains(u)||null!=this.currentSubPanel&&this.currentSubPanel.contains(u)||null!=x&&null!=x.window&&x.window.div.contains(u)||this.hidePopover()});this.popoverScrollHandler=mxUtils.bind(this,function(){this.hidePopover()});this.popoverKeyHandler=mxUtils.bind(this,function(l){27==l.keyCode&&(this.hidePopover(),mxEvent.consume(l))});window.setTimeout(mxUtils.bind(this,function(){document.addEventListener("mousedown",this.popoverCloseHandler,!0);d.addEventListener("scroll",this.popoverScrollHandler); document.addEventListener("keydown",this.popoverKeyHandler)}),0);return{body:k,popover:e,position:b,animateIn:p}}; InlineToolbar.prototype.buildIconGrid=function(a,b,d,e){var g=this.iconSize+8,c=Math.min(this.popoverColumns,b.length),h=document.createElement("div");h.style.display="grid";h.style.gridTemplateColumns="repeat("+c+", "+g+"px)";h.style.gap="2px";for(c=0;c<b.length;c++){if(b[c].separator&&0<c){var k=document.createElement("div");k.style.gridColumn="1 / -1";k.style.height="1px";k.style.backgroundColor="light-dark(#d0d0d0, #505050)";k.style.margin="3px 0";h.appendChild(k)}k=document.createElement("div"); k.style.width=g+"px";k.style.height=g+"px";k.style.display="flex";k.style.alignItems="center";k.style.justifyContent="center";k.style.borderRadius="6px";k.style.cursor="pointer";k.style.position="relative";k.style.boxSizing="border-box";k.setAttribute("title",b[c].title);c==d&&(k.style.backgroundColor="light-dark(#e8f0fe, #3c4043)",k.style.border="2px solid light-dark(#1a73e8, #8ab4f8)");var p=document.createElement("img");p.src=b[c].img;p.style.width="20px";p.style.height="20px";p.className="geAdaptiveAsset"; k.appendChild(p);(function(l,u,x){mxEvent.addListener(u,"mouseenter",function(){x!=d&&(u.style.backgroundColor="light-dark(#f0f0f0, #4a4a4a)")});mxEvent.addListener(u,"mouseleave",function(){x!=d&&(u.style.backgroundColor="")});mxEvent.addListener(u,"click",function(v){e(l);mxEvent.consume(v)})})(b[c],k,c);h.appendChild(k)}a.appendChild(h);return h}; InlineToolbar.prototype.createColorSwatch=function(a,b,d,e){var g=this.graph,c=document.createElement("div");c.style.width="28px";c.style.height="28px";c.style.borderRadius="6px";c.style.border="1px solid light-dark(#d0d0d0, #505050)";c.style.cursor="pointer";c.style.boxSizing="border-box";c.style.flexShrink="0";c.setAttribute("title",a);(function(h){if(null==h||"none"==h)c.style.background="linear-gradient(135deg, white 45%, red 45%, red 55%, white 55%)",c.style.backgroundColor="";else{var k=mxUtils.getLightDarkColor(h); mxUtils.isLightDarkColor(h)&&k.light!=k.dark?c.style.background="linear-gradient(to right bottom, "+k.cssText+" 50%, "+mxUtils.invertLightDarkColor(k).cssText+" 50.3%)":(c.style.background="",c.style.backgroundColor=k.cssText)}})(b);mxEvent.addListener(c,"click",mxUtils.bind(this,function(h){var k=function(){var u=g.getSelectionCell();u=null!=u?g.getCellStyle(u,!1):null;return null!=u?u[d]||mxConstants.NONE:mxConstants.NONE};this.editorUi.pickColor(k(),mxUtils.bind(this,function(u){g.stopEditing(!1); g.setCellStyles(d,u,this.editorUi.getSelectionState().cells);this.hide()}),"default",e,null,a,k);var p=this.editorUi.colorWindow;if(null!=p){var l=mxUtils.bind(this,function(){p.window.removeListener(l);this.hide()});p.window.addListener(mxEvent.HIDE,l)}mxEvent.consume(h)}));return c}; InlineToolbar.prototype.showLineStyleMenu=function(a){this.editorUi.hideCurrentMenu();if(null!=this.currentState){var b=this.graph,d=b.getCurrentCellStyle(this.currentState.cell),e=b.getSelectionCells();a=this.createPopover(this.lineStyleBtn,{persistOnClick:!0});for(var g=a.body,c=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],h=[{label:mxResources.get("solid"),values:[null,null],pattern:null},{label:mxResources.get("dashed")+" (1)",values:["1",null],pattern:"8 4"},{label:mxResources.get("dashed")+ " (2)",values:["1","8 8"],pattern:"8 8"},{label:mxResources.get("dashed")+" (3)",values:["1","12 12"],pattern:"12 12"},{label:mxResources.get("dashed")+" (4)",values:["1","8 4 1 4"],pattern:"8 4 1 4"},{label:mxResources.get("dotted")+" (1)",values:["1","1 1"],pattern:"1 1"},{label:mxResources.get("dotted")+" (2)",values:["1","1 2"],pattern:"1 2"},{label:mxResources.get("dotted")+" (3)",values:["1","1 4"],pattern:"1 4"}],k=mxUtils.getValue(d,mxConstants.STYLE_DASHED,null),p=mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN, null),l=0,u=0;u<h.length;u++){var x=h[u].values[0],v=h[u].values[1];if((null==x?null:String(x))==(null==k?null:String(k))&&(null==v?null:String(v))==(null==p?null:String(p))){l=u;break}}var z=function(O){O=Graph.createSvgImage(80,2,'<line x1="0" y1="1" x2="80" y2="1" stroke="black" stroke-width="2"'+(null!=O?' stroke-dasharray="'+O+'"':"")+"/>",80,2);var M=document.createElement("img");M.src=O.src;M.style.width="80px";M.style.height="2px";M.className="geAdaptiveAsset";return M},C=document.createElement("div"); C.style.display="flex";C.style.alignItems="center";C.style.border="1px solid light-dark(#d0d0d0, #505050)";C.style.borderRadius="6px";C.style.height="28px";C.style.padding="0 6px";C.style.cursor="pointer";C.style.marginBottom="8px";C.style.gap="4px";var F=document.createElement("div");F.style.flex="1";F.style.display="flex";F.style.alignItems="center";F.appendChild(z(h[l].pattern));C.appendChild(F);k=document.createElement("span");k.style.fontSize="8px";k.style.color="light-dark(#666, #999)";k.style.flexShrink= "0";k.innerHTML="▼";C.appendChild(k);mxEvent.addListener(C,"mouseenter",function(){C.style.backgroundColor="light-dark(#f0f0f0, #4a4a4a)"});mxEvent.addListener(C,"mouseleave",function(){C.style.backgroundColor=""});mxEvent.addListener(C,"click",mxUtils.bind(this,function(O){if(null!=this.currentSubPanel&&this.currentSubPanel._ownerDropdown===C)null!=this.currentSubPanel.parentNode&&this.currentSubPanel.parentNode.removeChild(this.currentSubPanel),this.currentSubPanel=null;else{null!=this.currentSubPanel&& null!=this.currentSubPanel.parentNode&&(this.currentSubPanel.parentNode.removeChild(this.currentSubPanel),this.currentSubPanel=null);var M=b.container,V=document.createElement("div");V.style.position="absolute";V.style.zIndex=10;V.style.backgroundColor="light-dark(white, var(--dark-color))";V.style.border="1px solid light-dark(#d0d0d0, #505050)";V.style.borderRadius="12px";V.style.boxShadow="0 4px 16px rgba(0,0,0,0.15)";V.style.padding="4px";for(var Q=0;Q<h.length;Q++){var ma=document.createElement("div"); ma.style.display="flex";ma.style.alignItems="center";ma.style.padding="4px 8px";ma.style.borderRadius="6px";ma.style.cursor="pointer";ma.style.minWidth="96px";ma.setAttribute("title",h[Q].label);Q==l&&(ma.style.backgroundColor="light-dark(#e8f0fe, #3c4043)");ma.appendChild(z(h[Q].pattern));(function(ia,na,Z){mxEvent.addListener(na,"mouseenter",function(){Z!=l&&(na.style.backgroundColor="light-dark(#f0f0f0, #4a4a4a)")});mxEvent.addListener(na,"mouseleave",function(){Z!=l&&(na.style.backgroundColor= "")});mxEvent.addListener(na,"click",mxUtils.bind(this,function(da){b.stopEditing(!1);b.getModel().beginUpdate();try{b.setCellStyles(c[0],ia.values[0],e),b.setCellStyles(c[1],ia.values[1],e)}finally{b.getModel().endUpdate()}l=Z;F.innerHTML="";F.appendChild(z(ia.pattern));null!=V.parentNode&&V.parentNode.removeChild(V);this.currentSubPanel=null;mxEvent.consume(da)}))}).call(this,h[Q],ma,Q);V.appendChild(ma)}mxEvent.addListener(V,"mousedown",function(ia){mxEvent.consume(ia)});M.appendChild(V);this.currentSubPanel= V;V._ownerDropdown=C;Q=C.getBoundingClientRect();ma=M.getBoundingClientRect();M=this.clampToContainer(Q.left-ma.left+M.scrollLeft,Q.bottom-ma.top+M.scrollTop+4,V.offsetWidth,V.offsetHeight);V.style.left=Math.round(M.x)+"px";V.style.top=Math.round(M.y)+"px"}mxEvent.consume(O)}));g.appendChild(C);k=document.createElement("div");k.style.display="flex";k.style.alignItems="center";k.style.gap="8px";u=parseInt(mxUtils.getValue(d,mxConstants.STYLE_STROKEWIDTH,"1"));p=document.createElement("div");p.style.display= "flex";p.style.alignItems="center";p.style.border="1px solid light-dark(#d0d0d0, #505050)";p.style.borderRadius="6px";p.style.height="28px";p.style.overflow="hidden";var G=document.createElement("input");G.type="text";G.value=u+" pt";G.style.width="40px";G.style.border="none";G.style.outline="none";G.style.textAlign="center";G.style.fontSize="11px";G.style.padding="0 2px";G.style.backgroundColor="transparent";G.style.color="inherit";var H=function(O){O=Math.max(0,Math.min(999,parseInt(O)||0));G.value= O+" pt";b.stopEditing(!1);b.setCellStyles(mxConstants.STYLE_STROKEWIDTH,O,e)};mxEvent.addListener(G,"focus",function(){G.value=parseInt(G.value)||0;G.select()});mxEvent.addListener(G,"blur",function(){H(G.value)});mxEvent.addListener(G,"keydown",function(O){if(13==O.keyCode)H(G.value),G.blur();else if(38==O.keyCode){var M=(parseInt(G.value)||0)+1;H(M);O.preventDefault()}else 40==O.keyCode&&(M=(parseInt(G.value)||0)-1,H(M),O.preventDefault())});p.appendChild(G);u=document.createElement("div");u.style.display= "flex";u.style.flexDirection="column";u.style.borderLeft="1px solid light-dark(#d0d0d0, #505050)";x=document.createElement("div");x.innerHTML="▲";x.style.fontSize="7px";x.style.lineHeight="14px";x.style.textAlign="center";x.style.cursor="pointer";x.style.width="16px";x.style.userSelect="none";mxEvent.addListener(x,"click",function(O){var M=(parseInt(G.value)||0)+1;H(M);mxEvent.consume(O)});v=document.createElement("div");v.innerHTML="▼";v.style.fontSize="7px";v.style.lineHeight="14px"; v.style.textAlign="center";v.style.cursor="pointer";v.style.width="16px";v.style.userSelect="none";mxEvent.addListener(v,"click",function(O){var M=(parseInt(G.value)||0)-1;H(M);mxEvent.consume(O)});u.appendChild(x);u.appendChild(v);p.appendChild(u);k.appendChild(p);p=mxUtils.getValue(d,mxConstants.STYLE_STROKECOLOR,"#000000");k.appendChild(this.createColorSwatch(mxResources.get("strokeColor"),p,mxConstants.STYLE_STROKECOLOR,b.shapeForegroundColor));g.appendChild(k);p=this.currentState;if(null!=p&& b.isFillState(p)){u=mxUtils.getValue(d,mxConstants.STYLE_FILLCOLOR,null);var J=document.createElement("div");J.style.display="flex";J.style.alignItems="center";J.style.gap="6px";J.style.marginTop="8px";k=mxUtils.bind(this,function(O,M,V,Q,ma,ia){var na=document.createElement("span");na.style.fontSize="11px";na.style.color="light-dark(#333, #ccc)";ia&&(na.style.marginLeft="8px");mxUtils.write(na,O);J.appendChild(na);J.appendChild(this.createColorSwatch(M,V,Q,ma))});k(mxResources.get("fill"),mxResources.get("fillColor"), u,mxConstants.STYLE_FILLCOLOR,b.shapeBackgroundColor,!1);b.isGradientState(p)&&null!=u&&u!=mxConstants.NONE&&(d=mxUtils.getValue(d,mxConstants.STYLE_GRADIENTCOLOR,null),k(mxResources.get("gradient"),mxResources.get("gradientColor"),d,mxConstants.STYLE_GRADIENTCOLOR,b.shapeForegroundColor,!0));g.appendChild(J)}a.position();a.animateIn()}}; InlineToolbar.prototype.showLineEndMenu=function(a){this.editorUi.hideCurrentMenu();if(null!=this.currentState){a=this.graph;var b=a.getCurrentCellStyle(this.currentState.cell),d=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null),e=a.getSelectionCells();a=this.createPopover(this.lineEndBtn,{persistOnClick:!0});var g=a.body,c=document.createElement("div");c.style.fontWeight="bold";c.style.fontSize="12px";c.style.marginBottom="8px";c.style.color="light-dark(#333, #ccc)";mxUtils.write(c,mxResources.get("lineend")); g.appendChild(c);var h=mxUtils.bind(this,function(){var p=[];p.push({marker:mxConstants.NONE,fill:0,img:Format.noMarkerImage.src,title:mxResources.get("none")});"connector"==d||"filledEdge"==d||"wire"==d||"pipe"==d||"mxgraph.basic.arc"==d||null==d?(p.push({marker:mxConstants.ARROW_CLASSIC,fill:1,img:Format.classicFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_CLASSIC_THIN,fill:1,img:Format.classicThinFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_OPEN,fill:0,img:Format.openFilledMarkerImage.src}), p.push({marker:mxConstants.ARROW_OPEN_THIN,fill:0,img:Format.openThinFilledMarkerImage.src}),p.push({marker:"openAsync",fill:0,img:Format.openAsyncFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_BLOCK,fill:1,img:Format.blockFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_BLOCK_THIN,fill:1,img:Format.blockThinFilledMarkerImage.src}),p.push({marker:"async",fill:1,img:Format.asyncFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_OVAL,fill:1,img:Format.ovalFilledMarkerImage.src}), p.push({marker:mxConstants.ARROW_DIAMOND,fill:1,img:Format.diamondFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_DIAMOND_THIN,fill:1,img:Format.diamondThinFilledMarkerImage.src}),p.push({marker:mxConstants.ARROW_CLASSIC,fill:0,img:Format.classicMarkerImage.src}),p.push({marker:mxConstants.ARROW_CLASSIC_THIN,fill:0,img:Format.classicThinMarkerImage.src}),p.push({marker:mxConstants.ARROW_BLOCK,fill:0,img:Format.blockMarkerImage.src}),p.push({marker:mxConstants.ARROW_BLOCK_THIN,fill:0,img:Format.blockThinMarkerImage.src}), p.push({marker:"async",fill:0,img:Format.asyncMarkerImage.src}),p.push({marker:mxConstants.ARROW_OVAL,fill:0,img:Format.ovalMarkerImage.src}),p.push({marker:mxConstants.ARROW_DIAMOND,fill:0,img:Format.diamondMarkerImage.src}),p.push({marker:mxConstants.ARROW_DIAMOND_THIN,fill:0,img:Format.diamondThinMarkerImage.src}),p.push({marker:"box",fill:0,img:Format.boxMarkerImage.src}),p.push({marker:"halfCircle",fill:0,img:Format.halfCircleMarkerImage.src}),p.push({marker:"dash",fill:0,img:Format.dashMarkerImage.src}), p.push({marker:"cross",fill:0,img:Format.crossMarkerImage.src}),p.push({marker:"circlePlus",fill:0,img:Format.circlePlusMarkerImage.src}),p.push({marker:"circle",fill:1,img:Format.circleMarkerImage.src}),p.push({marker:"baseDash",fill:0,img:Format.baseDashMarkerImage.src}),p.push({marker:"ERone",fill:0,img:Format.EROneMarkerImage.src}),p.push({marker:"ERmandOne",fill:0,img:Format.ERmandOneMarkerImage.src}),p.push({marker:"ERmany",fill:0,img:Format.ERmanyMarkerImage.src}),p.push({marker:"ERoneToMany", fill:0,img:Format.ERoneToManyMarkerImage.src}),p.push({marker:"ERzeroToOne",fill:0,img:Format.ERzeroToOneMarkerImage.src}),p.push({marker:"ERzeroToMany",fill:0,img:Format.ERzeroToManyMarkerImage.src}),p.push({marker:"doubleBlock",fill:0,img:Format.doubleBlockMarkerImage.src}),p.push({marker:"doubleBlock",fill:1,img:Format.doubleBlockFilledMarkerImage.src})):"flexArrow"==d&&p.push({marker:mxConstants.ARROW_BLOCK,fill:0,img:Format.blockMarkerImage.src,title:mxResources.get("block")});return p})();c= mxUtils.bind(this,function(p){var l=p+"Fill",u=mxUtils.getValue(b,"start"==p?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE),x=mxUtils.getValue(b,l,"1"),v=document.createElement("div");v.style.display="flex";v.style.alignItems="center";v.style.border="1px solid light-dark(#d0d0d0, #505050)";v.style.borderRadius="6px";v.style.height="32px";v.style.padding="0 6px";v.style.cursor="pointer";v.style.flex="1";v.style.minWidth="0";v.style.gap="4px";var z=document.createElement("div"); z.style.flex="1";z.style.display="flex";z.style.alignItems="center";z.style.justifyContent="center";z.style.minWidth="0";var C=function(){z.innerHTML="";var F=null;if(u!=mxConstants.NONE&&null!=u){for(var G=0;G<h.length;G++)if(h[G].marker==u&&String(h[G].fill)==String(x)){F=h[G].img;break}if(null==F)for(G=0;G<h.length;G++)if(h[G].marker==u){F=h[G].img;break}}null!=F?(G=document.createElement("img"),G.src=F,G.style.height="16px",G.className="geAdaptiveAsset","end"==p&&(G.style.transform="scaleX(-1)"), z.appendChild(G)):(F=document.createElement("span"),F.style.fontSize="11px",F.style.color="light-dark(#666, #999)",mxUtils.write(F,mxResources.get("none")),z.appendChild(F))};C();v.appendChild(z);l=document.createElement("span");l.style.fontSize="8px";l.style.color="light-dark(#666, #999)";l.style.flexShrink="0";l.innerHTML="▼";v.appendChild(l);mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor="light-dark(#f0f0f0, #4a4a4a)"});mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor= ""});mxEvent.addListener(v,"click",mxUtils.bind(this,function(F){null!=this.currentSubPanel&&this.currentSubPanel._ownerDropdown===v?(null!=this.currentSubPanel.parentNode&&this.currentSubPanel.parentNode.removeChild(this.currentSubPanel),this.currentSubPanel=null):this.showMarkerSubPanel(v,p,h,u,x,e,d,function(G,H){u=G;x=H;C()});mxEvent.consume(F)}));return v});var k=document.createElement("div");k.style.display="flex";k.style.gap="8px";k.appendChild(c("start"));k.appendChild(c("end"));g.appendChild(k); a.position();a.animateIn()}}; InlineToolbar.prototype.showMarkerSubPanel=function(a,b,d,e,g,c,h,k){null!=this.currentSubPanel&&null!=this.currentSubPanel.parentNode&&(this.currentSubPanel.parentNode.removeChild(this.currentSubPanel),this.currentSubPanel=null);var p=this.graph;h=p.container;var l="start"==b?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,u=b+"Fill",x=this.iconSize+8,v=this.popoverColumns,z=document.createElement("div");z.style.position="absolute";z.style.zIndex=10;z.style.backgroundColor="light-dark(white, var(--dark-color))"; z.style.border="1px solid light-dark(#d0d0d0, #505050)";z.style.borderRadius="12px";z.style.boxShadow="0 4px 16px rgba(0,0,0,0.15)";z.style.padding="8px";for(var C=-1,F=0;F<d.length;F++)if(d[F].marker==e&&String(d[F].fill)==String(g)){C=F;break}-1!=C||e!=mxConstants.NONE&&null!=e||(C=0);e=document.createElement("div");e.style.display="grid";e.style.gridTemplateColumns="repeat("+v+", "+x+"px)";e.style.gap="2px";for(F=0;F<d.length;F++)g=document.createElement("div"),g.style.width=x+"px",g.style.height= x+"px",g.style.display="flex",g.style.alignItems="center",g.style.justifyContent="center",g.style.borderRadius="6px",g.style.cursor="pointer",g.style.boxSizing="border-box",null!=d[F].title&&g.setAttribute("title",d[F].title),F==C&&(g.style.backgroundColor="light-dark(#e8f0fe, #3c4043)",g.style.border="2px solid light-dark(#1a73e8, #8ab4f8)"),v=document.createElement("img"),v.src=d[F].img,v.style.width="20px",v.style.height="20px",v.className="geAdaptiveAsset","end"==b&&(v.style.transform="scaleX(-1)"), g.appendChild(v),function(G,H,J){mxEvent.addListener(H,"mouseenter",function(){J!=C&&(H.style.backgroundColor="light-dark(#f0f0f0, #4a4a4a)")});mxEvent.addListener(H,"mouseleave",function(){J!=C&&(H.style.backgroundColor="")});mxEvent.addListener(H,"click",mxUtils.bind(this,function(O){p.stopEditing(!1);p.getModel().beginUpdate();try{p.setCellStyles(l,G.marker,c),p.setCellStyles(u,G.fill,c)}finally{p.getModel().endUpdate()}k(G.marker,String(G.fill));null!=z.parentNode&&z.parentNode.removeChild(z); this.currentSubPanel=null;mxEvent.consume(O)}))}.call(this,d[F],g,F),e.appendChild(g);z.appendChild(e);mxEvent.addListener(z,"mousedown",function(G){mxEvent.consume(G)});h.appendChild(z);this.currentSubPanel=z;z._ownerDropdown=a;a=a.getBoundingClientRect();b=h.getBoundingClientRect();h=this.clampToContainer(a.left-b.left+h.scrollLeft,a.bottom-b.top+h.scrollTop+4,z.offsetWidth,z.offsetHeight);z.style.left=Math.round(h.x)+"px";z.style.top=Math.round(h.y)+"px"}; InlineToolbar.prototype.showConnStyleMenu=function(a){this.editorUi.hideCurrentMenu();if(null!=this.currentState){var b=this.graph;a=b.getCurrentCellStyle(this.currentState.cell);var d=mxUtils.getValue(a,mxConstants.STYLE_SHAPE,null),e=this.createPopover(this.connStyleBtn),g=e.body,c=document.createElement("div");c.style.fontWeight="bold";c.style.fontSize="12px";c.style.marginBottom="8px";c.style.color="light-dark(#333, #ccc)";mxUtils.write(c,mxResources.get("connection"));g.appendChild(c);c=mxUtils.bind(this, function(l){b.stopEditing(!1);b.getModel().beginUpdate();try{for(var u=b.getSelectionCells(),x=[],v=0;v<u.length;v++)if(b.getModel().isEdge(u[v])){if(l.reset){var z=b.getCellGeometry(u[v]);null!=z&&(z=z.clone(),z.points=null,b.getModel().setGeometry(u[v],z))}for(var C=0;C<l.keys.length;C++)b.setCellStyles(l.keys[C],l.values[C],[u[v]]);x.push(u[v])}null!=l.postFn&&l.postFn(b,x)}finally{b.getModel().endUpdate()}this.updateIcons();this.hidePopover()});var h=function(){var l=document.createElement("div"); l.style.height="1px";l.style.backgroundColor="light-dark(#d0d0d0, #505050)";l.style.margin="6px 0";g.appendChild(l)},k=[];"arrow"!=d&&(k.push({img:Format.straightImage.src,title:mxResources.get("straight"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:[null,null,null,null],reset:!0}),k.push({img:Format.orthogonalImage.src,title:mxResources.get("orthogonal"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE, "libavoidRouting"],values:["orthogonalEdgeStyle",null,null,null],reset:!0}),"undefined"!==typeof LibavoidRouting&&k.push({img:Format.libavoidImage.src,title:mxResources.get("libavoidAutoRoute"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["orthogonalEdgeStyle",null,null,"1"],reset:!0,postFn:function(l,u){LibavoidRouting.autoReroute(l,u)}}),k.push({img:Format.verticalElbowImage.src,title:mxResources.get("horizontal"),keys:[mxConstants.STYLE_EDGE, mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["elbowEdgeStyle","vertical",null,null,null],reset:!0}),k.push({img:Format.horizontalElbowImage.src,title:mxResources.get("vertical"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["elbowEdgeStyle",null,null,null,null],reset:!0}),k.push({img:Format.horizontalIsometricImage.src,title:mxResources.get("isometric"), keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["isometricEdgeStyle",null,null,null,null],reset:!0}),k.push({img:Format.verticalIsometricImage.src,title:mxResources.get("isometric"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["isometricEdgeStyle","vertical",null,null,null],reset:!0}),this.supportsCurvedBend(a)&&k.push({img:Format.curvedImage.src, title:mxResources.get("curved"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["orthogonalEdgeStyle","1",null,null],reset:!0}),k.push({img:Format.entityImage.src,title:mxResources.get("entityRelation"),keys:[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],values:["entityRelationEdgeStyle",null,null,null],reset:!0}));0<k.length&&this.buildIconGrid(g,k,this.getActiveIndexForImage(k,this.editorUi.getImageForEdgeStyle(a)), c);d=[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,mxConstants.STYLE_DASHED,"width"];var p=[];p.push({img:Format.connectionImage.src,title:mxResources.get("line"),keys:d,values:[null,null,null,null,null]});p.push({img:Format.linkEdgeImage.src,title:mxResources.get("link"),keys:d,values:["link",null,null,null,null]});p.push({img:Format.arrowImage.src,title:mxResources.get("arrow"),keys:d,values:["flexArrow",null,null,null,null]});p.push({img:Format.simpleArrowImage.src, title:mxResources.get("simpleArrow"),keys:d,values:["arrow",null,null,null,null]});p.push({img:Format.filledEdgeImage.src,title:"Filled Edge",keys:d,values:["filledEdge",null,null,null,null]});p.push({img:Format.pipeEdgeImage.src,title:"Pipe",keys:d,values:["pipe",null,null,null,null]});p.push({img:Format.wireEdgeImage.src,title:"Wire",keys:d,values:["wire",null,null,"1",null]});0<k.length&&h();this.buildIconGrid(g,p,this.getActiveIndexForImage(p,this.editorUi.getImageForEdgeShape(a)),c);d=[mxConstants.STYLE_ROUNDED, mxConstants.STYLE_CURVED];k=[];k.push({img:Format.sharpBendImage.src,title:mxResources.get("sharp"),keys:d,values:["0","0"]});k.push({img:Format.roundedBendImage.src,title:mxResources.get("rounded"),keys:d,values:["1","0"]});this.supportsCurvedBend(a)&&k.push({img:Format.curvedBendImage.src,title:mxResources.get("curved"),keys:d,values:["0","1"]});d=-1;d=mxUtils.getValue(a,mxConstants.STYLE_ROUNDED,"0");d="1"==mxUtils.getValue(a,mxConstants.STYLE_CURVED,"0")?2:"1"==d?1:0;p=b.view.getState(this.currentState.cell); if(this.supportsCurvedBend(a)||null!=p&&b.isRoundedState(p))h(),this.buildIconGrid(g,k,d,c);e.position();e.animateIn()}}; InlineToolbar.prototype.hidePopover=function(a){null!=this.currentSubPanel&&(null!=this.currentSubPanel.parentNode&&this.currentSubPanel.parentNode.removeChild(this.currentSubPanel),this.currentSubPanel=null);null!=this.popoverCloseHandler&&(document.removeEventListener("mousedown",this.popoverCloseHandler,!0),this.popoverCloseHandler=null);null!=this.popoverScrollHandler&&(this.graph.container.removeEventListener("scroll",this.popoverScrollHandler),this.popoverScrollHandler=null);null!=this.popoverKeyHandler&& (document.removeEventListener("keydown",this.popoverKeyHandler),this.popoverKeyHandler=null);if(null!=this.currentPopover){var b=this.currentPopover;this.currentPopoverAnchor=this.currentPopover=null;a||null==b.parentNode?null!=b.parentNode&&b.parentNode.removeChild(b):(a=Math.round(.6*this.popoverAnimDuration),b.style.transition="transform "+a+"ms cubic-bezier(0.5, 0, 0.7, 0.4), opacity "+a+"ms ease-in",b.style.opacity="0",b.style.transform="scale(0.3)",b.style.pointerEvents="none",window.setTimeout(function(){null!= b.parentNode&&b.parentNode.removeChild(b)},a))}}; InlineToolbar.prototype.destroy=function(){this.hidePopover(!0);null!=this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null);this.graph.selectionModel.removeListener(this.selectionHandler);this.graph.model.removeListener(this.modelHandler);this.graph.view.removeListener(this.repaintHandler);this.graph.removeListener(this.selectionHandler);this.graph.removeListener(this.repaintHandler);this.graph.removeListener(this.hideHandler);mxEvent.removeListener(this.graph.container, "scroll",this.repaintHandler);null!=this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar)};EditorUi.prototype.createInlineToolbar=function(){return new InlineToolbar(this)};Format=function(a,b){this.editorUi=a;this.container=b;this.collapsedSections=a.getCollapsedSections()};Format.noMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.classicFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 10 2 L 5 8 L 10 14 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20); Format.classicThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 4 L 3 8 L 8 12 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.openFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 8 0 L 0 8 L 8 16 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.openThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 8 4 L 0 8 L 8 12 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.openAsyncFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 8 4 L 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.blockFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 2 L 8 14 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.blockThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 4 L 8 12 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20); Format.asyncFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 6 8 L 6 4 L 0 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.ovalFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 A 5 5 0 0 1 5 3 A 5 5 0 0 1 11 8 A 5 5 0 0 1 5 13 A 5 5 0 0 1 0 8 Z M 10 8 L 24 8" stroke="black" fill="black"/>',32,20); Format.diamondFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 6 2 L 12 8 L 6 14 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.diamondThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 3 L 16 8 L 8 13 Z M 0 8 L 24 8" stroke="black" fill="black"/>',32,20); Format.classicMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 10 2 L 5 8 L 10 14 Z M 5 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.classicThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 4 L 5 8 L 8 12 Z M 5 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.blockMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.blockThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 4 L 8 12 Z M 8 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.asyncMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 6 8 L 6 4 L 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.ovalMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 A 5 5 0 0 1 5 3 A 5 5 0 0 1 11 8 A 5 5 0 0 1 5 13 A 5 5 0 0 1 0 8 Z M 10 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.diamondMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 6 2 L 12 8 L 6 14 Z M 12 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.diamondThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 3 L 16 8 L 8 13 Z M 16 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.boxMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 3 L 10 3 L 10 13 L 0 13 Z M 10 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.halfCircleMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 3 A 5 5 0 0 1 5 8 A 5 5 0 0 1 0 13 M 5 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.dashMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 2 L 12 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.crossMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 2 L 12 14 M 12 2 L 0 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.circlePlusMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 A 6 6 0 0 1 6 2 A 6 6 0 0 1 12 8 A 6 6 0 0 1 6 14 A 6 6 0 0 1 0 8 Z M 6 2 L 6 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.circleMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 A 6 6 0 0 1 6 2 A 6 6 0 0 1 12 8 A 6 6 0 0 1 6 14 A 6 6 0 0 1 0 8 Z M 12 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.ERmandOneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 6 2 L 6 14 M 9 2 L 9 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.ERmanyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 2 L 12 8 L 0 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.ERoneToManyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 2 L 12 8 L 0 14 M 15 2 L 15 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.ERzeroToOneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 8 8 A 5 5 0 0 1 13 3 A 5 5 0 0 1 18 8 A 5 5 0 0 1 13 13 A 5 5 0 0 1 8 8 Z M 0 8 L 8 8 M 18 8 L 24 8 M 4 3 L 4 13" stroke="black" fill="transparent"/>',32,20); Format.ERzeroToManyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 8 8 A 5 5 0 0 1 13 3 A 5 5 0 0 1 18 8 A 5 5 0 0 1 13 13 A 5 5 0 0 1 8 8 Z M 0 8 L 8 8 M 18 8 L 24 8 M 0 3 L 8 8 L 0 13" stroke="black" fill="transparent"/>',32,20);Format.EROneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 5 2 L 5 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.baseDashMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 2 L 0 14 M 0 8 L 24 8" stroke="black" fill="transparent"/>',32,20);Format.doubleBlockMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 16 2 L 16 14 Z M 16 8 L 24 8" stroke="black" fill="transparent"/>',32,20); Format.doubleBlockFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2.5" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 16 2 L 16 14 Z M 16 8 L 24 8" stroke="black" fill="black"/>',32,20);Format.connectionImage=Graph.createSvgImage(20,22,'<path transform="translate(4,3)" stroke-width="2.5" d="M 0 8 L 26 8 L 26 4 L 32 8 L 26 12 L 26 8 Z" stroke="black" fill="black"/>',42,20); Format.linkEdgeImage=Graph.createSvgImage(20,22,'<path transform="translate(4,3)" stroke-width="2.5" d="M 0 6 L 32 6 M 0 10 L 32 10" stroke="black" fill="black"/>',42,20);Format.pipeEdgeImage=Graph.createSvgImage(20,22,'<path transform="translate(4,0)" stroke-width="10.5" d="M 0 10 L 34 10" stroke="black" fill="black"/><path transform="translate(4,0)" stroke-width="4.5" d="M 0 10 L 34 10" stroke="lightblue" fill="black"/>',42,20); Format.filledEdgeImage=Graph.createSvgImage(20,22,'<path transform="translate(4,0)" stroke-width="8.5" d="M 0 10 L 34 10" stroke="black" fill="black"/><path transform="translate(4,0)" stroke-width="4.5" d="M 0 10 L 34 10" stroke="white" fill="black"/>',42,20); Format.wireEdgeImage=Graph.createSvgImage(20,22,'<path transform="translate(4,0)" stroke-dasharray="8 8" stroke-width="3.5" d="M 0 10 L 34 10" stroke="red" fill="black"/><path transform="translate(4,0)" stroke-dashoffset="8" stroke-dasharray="8 8" stroke-width="3.5" d="M 0 10 L 34 10" stroke="green" fill="black"/>',42,20); Format.arrowImage=Graph.createSvgImage(20,22,'<path transform="translate(4,3)" stroke-width="2.5" d="M 0 6 L 24 6 L 24 2 L 32 8 L 24 14 L 24 10 L 0 10 Z" stroke="black" fill="none"/>',42,20);Format.simpleArrowImage=Graph.createSvgImage(20,22,'<path transform="translate(4,3)" stroke-width="2.5" d="M 0 6 L 4 6 L 4 10 L 0 10 Z M 7 6 L 18 6 L 18 2 L 25 8 L 18 14 L 18 10 L 7 10 Z M 28 6 L 28 6 L 32 6 L 32 10 L 28 10 Z" stroke="black" fill="none"/>',42,20); Format.straightImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 4 26 L 26 4 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36);Format.orthogonalImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 2 26 L 2 14 L 28 14 L 28 4 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36); Format.horizontalElbowImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 13 0 L 17 0 L 17 4 L 13 4 Z M 15 4 L 15 26 M 13 26 L 17 26 L 17 30 L 13 30 Z M 12 15 L 6 15 M 4 15 L 6 13 L 6 17 Z M 18 15 L 24 15 M 26 15 L 24 13 L 24 17 Z" stroke="black" fill="none"/>',36,36); Format.verticalElbowImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 13 L 4 13 L 4 17 L 0 17 Z M 4 15 L 26 15 M 26 13 L 30 13 L 30 17 L 26 17 Z M 15 12 L 15 6 M 15 4 L 17 6 L 13 6 Z M 15 18 L 15 24 M 15 26 L 17 24 L 13 24 Z" stroke="black" fill="none"/>',36,36); Format.horizontalIsometricImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 4 26 L 19 17 L 10 12 L 26 4 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36);Format.verticalIsometricImage=Graph.createSvgImage(16,18,'<path transform="translate(32,4)scale(-1,1)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 4 26 L 19 17 L 10 12 L 26 4 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36); Format.curvedImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 2 26 Q 2 14 14 14 Q 28 14 28 4 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36);Format.entityImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 4 28 L 10 28 L 20 2 L 26 2 M 26 0 L 30 0 L 30 4 L 26 4 Z" stroke="black" fill="none"/>',36,36); Format.libavoidImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 0 26 L 4 26 L 4 30 L 0 30 Z M 2 26 L 8 26 L 8 7 L 28 7 L 28 4 M 26 0 L 30 0 L 30 4 L 26 4 Z M 12 11 L 20 11 L 20 19 L 12 19 Z" stroke="black" fill="none"/>',36,36);Format.sharpBendImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 6 2 L 6 22 L 26 22" stroke="black" fill="none"/>',36,36); Format.roundedBendImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 6 2 L 6 12 Q 6 22 16 22 L 26 22" stroke="black" fill="none"/>',36,36);Format.curvedBendImage=Graph.createSvgImage(16,18,'<path transform="translate(3,4)" stroke-width="2.5" d="M 6 2 Q 6 22 26 22" stroke="black" fill="none"/>',36,36); Format.processMenuIcon=function(a,b){var d=a.getElementsByTagName("img");0<d.length&&(d[0].className="geAdaptiveAsset geStyleMenuItem",null!=b&&mxUtils.setPrefixedStyle(d[0].style,"transform",b));return a};Format.prototype.labelIndex=0;Format.prototype.diagramIndex=0;Format.prototype.currentIndex=0;Format.prototype.rounded=!1;Format.prototype.curved=!1; Format.prototype.init=function(){var a=this.editorUi,b=a.editor,d=b.graph;this.update=mxUtils.bind(this,function(e,g){this.refresh()});d.getSelectionModel().addListener(mxEvent.CHANGE,this.update);d.getModel().addListener(mxEvent.CHANGE,this.update);d.addListener(mxEvent.EDITING_STARTED,this.update);d.addListener(mxEvent.EDITING_STOPPED,this.update);d.getView().addListener("unitChanged",this.update);b.addListener("autosaveChanged",this.update);d.addListener(mxEvent.ROOT,this.update);a.addListener("styleChanged", this.update);a.addListener("lockedChanged",this.update);a.addListener("languageChanged",this.update);a.addListener("formatWidthChanged",this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerText="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]}; Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null);this.pendingRefresh=window.setTimeout(mxUtils.bind(this,function(){this.immediateRefresh()}))}; Format.prototype.immediateRefresh=function(){if(0!=this.container.offsetWidth){var a=this.captureFocus();this.clear();var b=this.editorUi,d=b.editor.graph,e=document.createElement("div");e.className="geFormatContent";var g=document.createElement("div");g.className="geFormatTitle";this.container.appendChild(e);var c=b.getSelectionState(),h=c.containsLabel&&!c.transparentBounds,k=null,p=null,l=mxUtils.bind(this,function(F,G,H,J){var O=mxUtils.bind(this,function(V,Q){k!=F&&(Q||(h?this.labelIndex=H:d.isSelectionEmpty()? this.diagramIndex=H:this.currentIndex=H),null!=k&&k.classList.remove("geActiveFormatTitle"),k=F,k.classList.add("geActiveFormatTitle"),p!=G&&(null!=p&&(p.style.display="none"),p=G,p.style.display=""))});mxEvent.addListener(F,"click",O);var M=h?this.labelIndex:d.isSelectionEmpty()?this.diagramIndex:this.currentIndex;(J&&null==k||H==M)&&O(null,J&&null==k)}),u=0;if(d.isSelectionEmpty()){var x=document.createElement("div");mxUtils.write(x,mxResources.get("diagram"));g.appendChild(x);g.setAttribute("title", mxResources.get("diagram"));e.appendChild(g);c=e.cloneNode(!1);this.panels.push(new DiagramFormatPanel(this,b,c));this.container.appendChild(c);c.style.display="none";var v=g.cloneNode(!1);l(g,c,u++);var z=e.cloneNode(!1);z.style.display="none";x=document.createElement("div");mxUtils.write(x,mxResources.get("style"));v.appendChild(x);v.setAttribute("title",mxResources.get("style"));e.appendChild(v);this.panels.push(new DiagramStylePanel(this,b,z));this.container.appendChild(z);l(v,z,u++,!0)}else if(d.isEditing())x= document.createElement("div"),mxUtils.write(x,mxResources.get("text")),g.appendChild(x),g.setAttribute("title",mxResources.get("text")),e.appendChild(g),z=e.cloneNode(!1),z.style.display="none",this.panels.push(new TextFormatPanel(this,b,z)),this.container.appendChild(z),l(g,z,u++,!0);else{v=g.cloneNode(!1);var C=v.cloneNode(!1);0<c.cells.length&&(x=document.createElement("div"),mxUtils.write(x,mxResources.get("style")),g.appendChild(x),g.setAttribute("title",mxResources.get("style")),e.appendChild(g), z=e.cloneNode(!1),z.style.display="none",this.panels.push(new StyleFormatPanel(this,b,z)),this.container.appendChild(z),l(g,z,u++));x=document.createElement("div");mxUtils.write(x,mxResources.get("text"));v.appendChild(x);v.setAttribute("title",mxResources.get("text"));e.appendChild(v);z=e.cloneNode(!1);z.style.display="none";this.panels.push(new TextFormatPanel(this,b,z));this.container.appendChild(z);x=document.createElement("div");mxUtils.write(x,mxResources.get("arrange"));C.appendChild(x);C.setAttribute("title", mxResources.get("arrange"));e.appendChild(C);g=e.cloneNode(!1);g.style.display="none";this.panels.push(new ArrangePanel(this,b,g));this.container.appendChild(g);0<c.cells.length?l(v,z,u++):v.style.display="none";l(C,g,u++,!0)}e.className="geFormatTitleContainer";this.restoreFocus(a)}}; Format.prototype.captureFocus=function(){var a=document.activeElement;if(null==a||!this.container.contains(a)||"INPUT"!=a.nodeName&&"SELECT"!=a.nodeName&&"TEXTAREA"!=a.nodeName)return null;var b=this.container.querySelectorAll("input, select, textarea");b=Array.prototype.indexOf.call(b,a);if(0>b)return null;b={index:b,nodeName:a.nodeName,type:a.type};try{b.selectionStart=a.selectionStart,b.selectionEnd=a.selectionEnd,b.selectionDirection=a.selectionDirection}catch(d){}return b}; Format.prototype.restoreFocus=function(a){if(null!=a){var b=this.container.querySelectorAll("input, select, textarea")[a.index];if(null!=b&&b.nodeName==a.nodeName&&b.type==a.type&&null!=b.offsetParent&&(b.focus({preventScroll:!0}),null!=a.selectionStart))try{b.setSelectionRange(Math.min(a.selectionStart,b.value.length),Math.min(a.selectionEnd,b.value.length),a.selectionDirection)}catch(d){}}};BaseFormatPanel=function(a,b,d){this.format=a;this.editorUi=b;this.container=d;this.listeners=[]}; BaseFormatPanel.prototype.buttonBackgroundColor="transparent"; BaseFormatPanel.prototype.installInputHandler=function(a,b,d,e,g,c,h,k,p){c=null!=c?c:"";k=null!=k?k:!1;var l=this.editorUi,u=l.editor.graph;e=null!=e?e:1;g=null!=g?g:999;var x=null,v=!1,z=null,C=mxUtils.bind(this,function(F){var G=k?parseFloat(a.value):parseInt(a.value);p&&(G=this.fromUnit(G));if(G!=z){z=G;isNaN(G)||b!=mxConstants.STYLE_ROTATION||(G=mxUtils.mod(Math.round(100*G),36E3)/100);G=Math.min(g,Math.max(e,isNaN(G)?d:G));if(u.cellEditor.isContentEditing()&&h)v||(v=!0,null!=x&&(u.cellEditor.restoreSelection(x), x=null),h(G),a.value=(p?this.inUnit(G):G)+c,v=!1);else if(G!=mxUtils.getValue(l.getSelectionState().style,b,d)){u.isEditing()&&u.stopEditing(!0);u.getModel().beginUpdate();try{var H=l.getSelectionState().cells;if(b==mxConstants.STYLE_ROTATION)for(var J=0;J<H.length;J++)u.setCellRotation(H[J],G);else u.setCellStyles(b,G,H);b==mxConstants.STYLE_FONTSIZE&&u.updateLabelElements(H,function(O){O.removeAttribute("size");O.style.fontSize="";""==O.getAttribute("style")&&O.removeAttribute("style")});for(J= 0;J<H.length;J++)0==u.model.getChildCount(H[J])&&u.autoSizeCell(H[J],!1),b!=mxConstants.STYLE_FONTSIZE&&u.isAutosizeTextCell(H[J])&&u.model.isVertex(H[J])&&u.updateAutosizeTextFontSize(H[J],u.getCurrentCellStyle(H[J],!0));l.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",H))}finally{u.getModel().endUpdate()}}a.value=(p?this.inUnit(G):G)+c}mxEvent.consume(F)});h&&u.cellEditor.isContentEditing()&&mxEvent.addGestureListeners(a,mxUtils.bind(this,function(F){document.activeElement== u.cellEditor.textarea&&(x=u.cellEditor.saveSelection())}));mxEvent.addListener(a,"change",C);mxEvent.addListener(a,"blur",C);return C};BaseFormatPanel.prototype.createPanel=function(){var a=document.createElement("div");a.className="geFormatSection";return a};BaseFormatPanel.prototype.createTitle=function(a){var b=document.createElement("div");b.className="geFormatSectionTitle";b.setAttribute("title",a);mxUtils.write(b,a);return b}; BaseFormatPanel.prototype.createCollapsibleSection=function(a,b){var d=this.format.collapsedSections;b=null!=d[a]?d[a]:b;var e=document.createElement("div");e.className="geFormatSection";var g=document.createElement("div");g.className="geCollapsibleTitle"+(b?"":" geExpanded");g.setAttribute("title",a);mxUtils.write(g,a);e.appendChild(g);var c=document.createElement("div");c.className="geCollapsibleContent"+(b?" geCollapsed":"");e.appendChild(c);var h=this.format.editorUi;mxEvent.addListener(g,"click", function(){g.classList.toggle("geExpanded");c.classList.toggle("geCollapsed");d[a]=!g.classList.contains("geExpanded");h.fireEvent(new mxEventObject("collapsedSectionsChanged"))});return{wrapper:e,contentDiv:c}};BaseFormatPanel.prototype.syncCollapsibleVisibility=function(a,b){var d=function(){a.style.display="none"==b.style.display?"none":""};d();if("undefined"!==typeof MutationObserver){var e=new MutationObserver(d);e.observe(b,{attributes:!0,attributeFilter:["style"]});this.listeners.push({destroy:function(){e.disconnect()}})}}; BaseFormatPanel.prototype.addAction=function(a,b){var d=this.editorUi.actions.get(b);b=null;if(null!=d&&d.isEnabled()){b=mxUtils.button(d.getTitle(),mxUtils.bind(this,function(g){try{d.funct(g,g)}catch(c){this.editorUi.handleError(c)}}));var e=null!=d.shortcut?" ("+d.shortcut+")":"";b.setAttribute("title",d.getTitle()+e);b.style.marginBottom="2px";b.className="geFullWidthElement";a.appendChild(b)}return b}; BaseFormatPanel.prototype.addActions=function(a,b){for(var d=null,e=null,g=0,c=0;c<b.length;c++){var h=this.addAction(a,b[c]);null!=h&&(g++,0==mxUtils.mod(g,2)&&(e.style.marginRight="4px",e.style.width="104px",h.style.width="104px",d.parentNode.removeChild(d)),d=mxUtils.br(a),e=h)}return g}; BaseFormatPanel.prototype.createStepper=function(a,b,d,e,g,c,h){function k(z,C,F){null!=h?(h(z),null!=b&&b(F)):(""==a.value&&(a.value=null!=g?g:C),C=c?parseFloat(a.value):parseInt(a.value),isNaN(C)||(a.value=Math.round(1E6*(C+z))/1E6,null!=b&&b(F)))}d=null!=d?d:1;var p=10*d,l=document.createElement("div");l.className="geBtnStepper";l.style.position="absolute";l.style.left="200px";var u=document.createElement("div");u.style.height="9px";u.style.backgroundImage="url("+Editor.arrowUpImage+")";u.style.width= "10px";l.appendChild(u);var x=u.cloneNode(!1);x.style.backgroundImage="url("+Editor.arrowDownImage+")";l.appendChild(x);mxEvent.addGestureListeners(u,function(z){mxEvent.consume(z)},null,function(z){k(mxEvent.isShiftDown(z)?p:d,"0",z);mxEvent.consume(z)});mxEvent.addGestureListeners(x,function(z){mxEvent.consume(z)},null,function(z){k(-(mxEvent.isShiftDown(z)?p:d),"2",z);mxEvent.consume(z)});if(e){var v=null;mxEvent.addGestureListeners(l,function(z){mxEvent.consume(z)},null,function(z){if(null!=v){try{v.select()}catch(C){}v= null;mxEvent.consume(z)}})}else mxEvent.addListener(l,"click",function(z){mxEvent.consume(z)});return l}; BaseFormatPanel.prototype.createOption=function(a,b,d,e,g){var c=document.createElement("div");c.className="geFormatEntry";var h=document.createElement("input");h.setAttribute("type","checkbox");h.setAttribute("title",a);c.appendChild(h);var k=document.createElement("span");k.className="geStyleLabel";k.setAttribute("title",a);mxUtils.write(k,a);c.appendChild(k);var p=!1,l=b(),u=function(x,v){p||(p=!0,x?(h.setAttribute("checked","checked"),h.defaultChecked=!0,h.checked=!0):(h.removeAttribute("checked"), h.defaultChecked=!1,h.checked=!1),l!=x&&(l=x,b()!=l&&d(l,v)),p=!1)};mxEvent.addListener(c,"click",function(x){if("disabled"!=h.getAttribute("disabled")){var v=mxEvent.getSource(x);if(v==c||v==k)h.checked=!h.checked;u(h.checked,x)}});u(l);null!=e&&(e.install(u),this.listeners.push(e));null!=g&&g(c);return c}; BaseFormatPanel.prototype.createCellOption=function(a,b,d,e,g,c,h,k,p){var l=this.editorUi,u=l.editor.graph;e=null!=e?"null"==e?null:e:1;g=null!=g?"null"==g?null:g:0;var x=null!=p?u.getCommonStyle(p):l.getSelectionState().style;return this.createOption(a,function(){return mxUtils.getValue(x,b,d)!=g},function(v){k&&u.stopEditing();if(null!=h)h.funct();else{u.getModel().beginUpdate();try{var z=null!=p?p:l.getSelectionState().cells;v=v?e:g;u.setCellStyles(b,v,z);null!=c&&c(z,v);l.fireEvent(new mxEventObject("styleChanged", "keys",[b],"values",[v],"cells",z))}finally{u.getModel().endUpdate()}}},{install:function(v){this.listener=function(){v(mxUtils.getValue(x,b,d)!=g)};u.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){u.getModel().removeListener(this.listener)}})}; BaseFormatPanel.prototype.createColorOption=function(a,b,d,e,g,c,h,k,p,l,u,x){function v(){var Z=null!=x&&null!=x.getColor?x.getColor():null;return null!=Z&&"inherit"!=Z?Z:k}function z(Z,da){"default"!=Z||da||(Z=k);"default"!=Z&&p&&(Z=mxUtils.getLightDarkColor(Z),Z=l()?Z.dark:Z.light);return Z}var C=null!=l;l=null!=l?l:Editor.isDarkMode;var F=this.editorUi.editor.graph,G=document.createElement("div");G.className="geFormatEntry";var H=document.createElement("input");H.setAttribute("type","checkbox"); H.setAttribute("title",a);h||G.appendChild(H);var J=document.createElement("span");mxUtils.write(J,a);J.setAttribute("title",a);G.appendChild(J);var O=b(),M=!1,V=null,Q=null,ma=document.createElement("input");ma.setAttribute("type","color");ma.style.position="relative";ma.style.visibility="hidden";ma.style.top="10px";ma.style.width="0px";ma.style.height="0px";ma.style.border="none";mxClient.IS_TOUCH||(V=document.createElement("img"),V.src=Editor.colorDropperImage,V.className="geColorDropper geAdaptiveAsset", mxEvent.addListener(V,"click",function(Z){ma.value=z(O);ma.click();mxEvent.consume(Z)}));var ia=null,na=function(Z,da){if(!M){M=!0;null!=c&&c(Z);da||(null!=ia&&(F.cellEditor.restoreSelection(ia),ia=null),d(Z));O=b();Z="inherit"==O&&null!=x?v():O;da=mxUtils.getLightDarkColor("default"!=Z?Z:k);var pa=document.createElement("div");pa.style.width="21px";pa.style.height="12px";pa.style.margin="2px 18px 2px 3px";pa.style.borderWidth="1px";pa.style.borderStyle="solid";pa.style.backgroundColor=da.cssText; Q.innerText="";Q.appendChild(pa);!p&&mxUtils.isLightDarkColor(Z)&&da.light!=da.dark?pa.style.background="linear-gradient(to right bottom, "+da.cssText+" 50%, "+mxUtils.invertLightDarkColor(da).cssText+" 50.3%)":p&&C&&(pa.style.backgroundColor=l()?da.dark:da.light);null!=V?(pa.style.width="21px",pa.style.margin="2px 18px 2px 3px",pa.appendChild(V)):(pa.style.width="36px",pa.style.margin="3px");null!=O&&O!=mxConstants.NONE&&1<O.length&&"string"===typeof O&&(Z="#"==O.charAt(0)?O.substring(1).toUpperCase(): O,Z=ColorDialog.prototype.colorNames[Z],null!=Z?Q.setAttribute("title",Z):"default"==O?Q.setAttribute("title",mxResources.get("useBlackAndWhite")):Q.setAttribute("title",O));F.isSpecialColor(O)&&"inherit"!=O?H.style.display="none":(H.style.display="",null!=O&&O!=mxConstants.NONE&&"inherit"!=O?(H.setAttribute("checked","checked"),H.defaultChecked=!0,H.checked=!0):(H.removeAttribute("checked"),H.defaultChecked=!1,H.checked=!1));Q.style.display=H.checked||h||"inherit"==O&&null!=x?"":"none";M=!1}};G.appendChild(ma); mxEvent.addListener(ma,"change",function(){var Z=ma.value;if(!p){var da=mxUtils.getLightDarkColor(O);l()?da.dark=Z:da.light=Z;Z="light-dark("+da.light+", "+da.dark+")"}na(Z)});Q=mxUtils.button("",mxUtils.bind(this,function(Z){var da=k;p&&l()&&mxUtils.isLightDarkColor(da)&&(da=mxUtils.getLightDarkColor(k).dark);var pa="inherit"==O&&null!=x?v():z(O,!0);this.editorUi.pickColor(pa,function(ka){na(ka)},"default"==e?"default":null,da,p,u||a,function(){var ka=b();ka="inherit"==ka&&null!=x?v():z(ka,!0);return null!= ka?ka:mxConstants.NONE},null!=x?x.allow:null);mxEvent.consume(Z)}));Q.className="geColorBtn";Q.style.display=H.checked||h||"inherit"==O&&null!=x?"":"none";G.appendChild(Q);J=null!=O&&"string"===typeof O&&"#"==O.charAt(0)?O.substring(1).toUpperCase():O;J=ColorDialog.prototype.colorNames[J];null!=J&&Q.setAttribute("title",J);h||(mxEvent.addListener(G,"click",function(Z){Z=mxEvent.getSource(Z);if(Z==H||"INPUT"!=Z.nodeName)Z!=H&&(H.checked=!H.checked),H.checked||null==O||O==mxConstants.NONE||e==mxConstants.NONE|| (e=z(O)),na(H.checked?e:mxConstants.NONE)}),mxEvent.addGestureListeners(H,mxUtils.bind(this,function(Z){document.activeElement==F.cellEditor.textarea&&(ia=F.cellEditor.saveSelection())})),mxEvent.addGestureListeners(G,mxUtils.bind(this,function(Z){document.activeElement==F.cellEditor.textarea&&(ia=F.cellEditor.saveSelection())})));na(O,!0);null!=g&&g.install(function(){na(O,!0)},this.listeners.push(g));return G}; BaseFormatPanel.prototype.createArrayCellColorOption=function(a,b,d,e,g,c,h){var k=this.editorUi,p=k.editor.graph,l=p.getCellStyle(p.getSelectionCell(),!1);l=null!=l?null!=l[b]?l[b]:h:null;for(var u=null!=l?mxUtils.parseColorList(l):[],x=document.createElement("div"),v=0;v<u.length;v++)mxUtils.bind(this,function(z){x.appendChild(this.createColorOption(a+" ("+(z+1)+")",function(){return u[v]},function(C){p.getModel().beginUpdate();try{var F=k.getSelectionState().cells;u[z]=C;var G=u.join(",");p.setCellStyles(b, G,F);null!=g&&g(C);k.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[G],"cells",F))}finally{p.getModel().endUpdate()}},d||mxConstants.NONE,{install:function(C){this.listener=function(){var F=p.getCellStyle(p.getSelectionCell(),!1);null!=F&&(F=null!=F?null!=F[b]?F[b]:h:null,u=null!=F?mxUtils.parseColorList(F):[],C(u[v],!0))};p.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){p.getModel().removeListener(this.listener)}},e,null,c))})(v);return x}; BaseFormatPanel.prototype.createCellColorOption=function(a,b,d,e,g,c,h,k,p){function l(){var C=x.getCellStyle(x.getSelectionCell(),!1),F=null!=C?C[b]:null;if("inherit"==F){var G=x.getModel().getParent(x.getSelectionCell());G=x.getCellStyle(G,!1);null!=G&&null!=G[b]&&(F=G[b])}return null!=C?null!=F?F:h:null}var u=this.editorUi,x=u.editor.graph,v=l(),z={allow:function(){var C=x.getSelectionCell();C=null!=C?x.getModel().getParent(C):null;return null!=C&&x.getModel().isVertex(C)},getColor:function(){for(var C= x.getModel().getParent(x.getSelectionCell());null!=C&&x.getModel().isVertex(C);){var F=x.getCellStyle(C,!1);F=null!=F?F[b]:null;if(null!=F&&"inherit"!=F)return F;C=x.getModel().getParent(C)}return null}};return null!=v&&k&&1<mxUtils.parseColorList(v).length?this.createArrayCellColorOption(a,b,d,e,g,c,h):this.createColorOption(a,l,function(C){x.getModel().beginUpdate();try{var F=u.getSelectionState().cells;x.setCellStyles(b,C,F);null!=g&&g(C);u.fireEvent(new mxEventObject("styleChanged","keys",[b], "values",[C],"cells",F))}finally{x.getModel().endUpdate()}},d||mxConstants.NONE,{install:function(C){this.listener=function(){var F=x.getCellStyle(x.getSelectionCell(),!1);null!=F&&C(null!=F[b]?F[b]:h,!0)};x.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){x.getModel().removeListener(this.listener)}},e,null,c,null,null,p,z)}; BaseFormatPanel.prototype.addArrow=function(a){var b=document.createElement("div");b.className="geAdaptiveAsset geArrow";b.style.backgroundImage="url("+Editor.thinExpandImage+")";a.className="geStyleBtn";a.appendChild(b);return b}; BaseFormatPanel.prototype.addUnitInput=function(a,b,d,e,g,c,h,k,p){b=document.createElement("input");b.style.position="absolute";b.style.left=216-d-e+"px";b.style.width=e+"px";a.appendChild(b);e=this.createStepper(b,g,c,k,null,p);e.style.left=216-d+"px";a.appendChild(e);return b}; BaseFormatPanel.prototype.addGenericInput=function(a,b,d,e,g,c){var h=this.editorUi.editor.graph,k=function(){c(p.value)},p=this.addUnitInput(a,b,d,e,k),l=mxUtils.bind(this,function(u,x,v){if(v||p!=document.activeElement)p.value=g()+b});mxEvent.addListener(p,"keydown",function(u){13==u.keyCode?(h.container.focus(),mxEvent.consume(u)):27==u.keyCode&&(l(null,null,!0),h.container.focus(),mxEvent.consume(u))});h.getModel().addListener(mxEvent.CHANGE,l);this.listeners.push({destroy:function(){h.getModel().removeListener(l)}}); l();mxEvent.addListener(p,"blur",k);mxEvent.addListener(p,"change",k);return p}; BaseFormatPanel.prototype.createRelativeOption=function(a,b,d,e,g){d=null!=d?d:52;var c=this.editorUi,h=c.editor.graph,k=this.createPanel();k.className="geFormatEntry";mxUtils.write(k,a);k.setAttribute("title",a);k.style.fontWeight="bold";var p=mxUtils.bind(this,function(x){if(null!=e)e(l);else{var v=parseInt(l.value);v=Math.min(100,Math.max(0,isNaN(v)?100:v));var z=h.view.getState(c.getSelectionState().cells[0]);null!=z&&v!=mxUtils.getValue(z.style,b,100)&&(100==v&&(v=null),z=c.getSelectionState().cells, h.setCellStyles(b,v,z),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[b],"values",[v],"cells",z)));l.value=(null!=v?v:"100")+" %"}mxEvent.consume(x)}),l=this.addUnitInput(k,"%",16,d,p,10,0,null!=e);l.setAttribute("title",a);if(null!=b){var u=mxUtils.bind(this,function(x,v,z){if(z||l!=document.activeElement)x=c.getSelectionState(),x=parseInt(mxUtils.getValue(x.style,b,100)),l.value=isNaN(x)?"":x+" %"});mxEvent.addListener(l,"keydown",function(x){13==x.keyCode?(h.container.focus(), mxEvent.consume(x)):27==x.keyCode&&(u(null,null,!0),h.container.focus(),mxEvent.consume(x))});h.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){h.getModel().removeListener(u)}});u()}mxEvent.addListener(l,"blur",p);mxEvent.addListener(l,"change",p);null!=g&&g(l);return k}; BaseFormatPanel.prototype.addLabel=function(a,b,d,e){e=null!=e?e:61;var g=document.createElement("div");mxUtils.write(g,b);g.setAttribute("title",b);g.style.position="absolute";g.style.left=226-d-e+"px";g.style.width=e+"px";g.style.marginTop="10px";g.style.display="flex";g.style.justifyContent="center";a.appendChild(g);return g}; BaseFormatPanel.prototype.addKeyHandler=function(a,b){mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(d){13==d.keyCode?(this.editorUi.editor.graph.container.focus(),mxEvent.consume(d)):27==d.keyCode&&(null!=b&&b(null,null,!0),this.editorUi.editor.graph.container.focus(),mxEvent.consume(d))}))};BaseFormatPanel.prototype.destroy=function(){if(null!=this.listeners){for(var a=0;a<this.listeners.length;a++)this.listeners[a].destroy();this.listeners=null}}; ArrangePanel=function(a,b,d){BaseFormatPanel.call(this,a,b,d);this.init()};mxUtils.extend(ArrangePanel,BaseFormatPanel); ArrangePanel.prototype.init=function(){var a=this.editorUi.getSelectionState();if(0<a.cells.length){this.container.appendChild(this.addLayerOps(this.createPanel()));var b=this.createCollapsibleSection(mxResources.get("size")+" / "+mxResources.get("position"),!1);this.addGeometry(b.contentDiv);0<b.contentDiv.childNodes.length&&this.container.appendChild(b.wrapper);0<a.edges.length&&("link"==a.style.shape||"flexArrow"==a.style.shape)&&(b=this.createCollapsibleSection(mxResources.get("arrow"),!1),this.addArrowGeometry(b.contentDiv), this.container.appendChild(b.wrapper));if(1==a.edges.length){b=a.edges[0];var d=this.editorUi.editor.graph,e="";null==d.model.getTerminal(b,!0)&&(e=mxResources.get("linestart"));null==d.model.getTerminal(b,!1)&&(e+=(0<e.length?" / ":"")+mxResources.get("lineend"));0<e.length&&1==a.cells.length&&(b=this.createCollapsibleSection(e,!1),b.contentDiv.style.paddingBottom="10px",this.addEdgeGeometry(b.contentDiv),this.container.appendChild(b.wrapper))}if(0==a.vertices.length&&0<a.edges.length&&!a.containsLabel){b= this.createCollapsibleSection(mxResources.get("direction"),!1);d=this.createPanel();this.addEdgeTurn(d);if(1==a.edges.length){e=a.edges[0];var g=this.editorUi.editor.graph.model;null!=g.getTerminal(e,!0)&&g.getTerminal(e,!0)==g.getTerminal(e,!1)&&this.addLoopDirection(d)}b.contentDiv.appendChild(d);this.container.appendChild(b.wrapper)}a.containsLabel&&0!=a.edges.length||(b=this.createCollapsibleSection(mxResources.get("rotation"),!0),d=this.addAngle(this.createPanel()),b.contentDiv.appendChild(d), 0<d.childNodes.length&&this.container.appendChild(b.wrapper));a.containsLabel||(b=this.createCollapsibleSection(mxResources.get("flip"),!0),b.contentDiv.appendChild(this.addFlip(this.createPanel())),this.container.appendChild(b.wrapper));this.container.appendChild(this.addAlign(this.createPanel()));1<a.vertices.length&&!a.cell&&!a.row&&this.container.appendChild(this.addDistribute(this.createPanel()));a=this.addTable(this.createPanel());b=this.createCollapsibleSection(mxResources.get("table"),!0); b.contentDiv.appendChild(a);this.container.appendChild(b.wrapper);this.syncCollapsibleVisibility(b.wrapper,a)}this.container.appendChild(this.addGroupOps(this.createPanel()))}; ArrangePanel.prototype.addTable=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState(),g=document.createElement("div");g.style.position="relative";g.style.paddingLeft="0px";g.style.borderWidth="0px";g.style.width="220px";g.className="geToolbarContainer";var c=e.vertices[0];1<d.getSelectionCount()&&(d.isTableCell(c)&&(c=d.model.getParent(c)),d.isTableRow(c)&&(c=d.model.getParent(c)));var h=e.table||e.row||e.cell,k=d.isStack(c)||d.isStackChild(c),p=c;null!=p&&d.isTableCell(p)&&(p= d.model.getParent(p));null!=p&&d.isTableRow(p)&&(p=d.model.getParent(p));p=!k&&null!=p&&0===d.model.getChildCount(p);var l=h;k&&(h="0"==(d.isStack(c)?e.style:d.getCellStyle(d.model.getParent(c))).horizontalStack,l=!h);var u=[];l&&(u=u.concat([b.addButton(Editor.addColumnLeftImage,mxResources.get("insertColumnBefore"),mxUtils.bind(this,function(){try{k?d.insertLane(c,!0):d.insertTableColumn(c,!0)}catch(x){b.handleError(x)}}),g),b.addButton(Editor.addColumnRightImage,mxResources.get("insertColumnAfter"), mxUtils.bind(this,function(){try{k?d.insertLane(c,!1):d.insertTableColumn(c,!1)}catch(x){b.handleError(x)}}),g),b.addButton(Editor.removeColumnImage,mxResources.get("deleteColumn"),mxUtils.bind(this,function(){try{k?d.deleteLane(c):d.deleteTableColumn(c)}catch(x){b.handleError(x)}}),g)]),p&&(u[u.length-3].setAttribute("disabled","disabled"),u[u.length-2].setAttribute("disabled","disabled")));h&&(u=u.concat([b.addButton(Editor.addRowAboveImage,mxResources.get("insertRowBefore"),mxUtils.bind(this,function(){try{k? d.insertLane(c,!0):d.insertTableRow(c,!0)}catch(x){b.handleError(x)}}),g),b.addButton(Editor.addRowBelowImage,mxResources.get("insertRowAfter"),mxUtils.bind(this,function(){try{k?d.insertLane(c,!1):d.insertTableRow(c,!1)}catch(x){b.handleError(x)}}),g),b.addButton(Editor.removeRowImage,mxResources.get("deleteRow"),mxUtils.bind(this,function(){try{k?d.deleteLane(c):d.deleteTableRow(c)}catch(x){b.handleError(x)}}),g)]));if(0<u.length){a.appendChild(g);3<u.length&&(u[2].style.marginRight="10px");p=0; if(null!=e.mergeCell)p+=this.addActions(a,["mergeCells"]);else if(1<e.style.colspan||1<e.style.rowspan)p+=this.addActions(a,["unmergeCells"]);0<p&&(g.style.paddingBottom="2px")}else a.style.display="none";return a};ArrangePanel.prototype.addLayerOps=function(a){this.addActions(a,["toFront","toBack"]);this.addActions(a,["bringForward","sendBackward"]);return a}; ArrangePanel.prototype.addGroupOps=function(a){var b=this.editorUi,d=b.editor.graph;b=b.getSelectionState();var e=this.addActions(a,["group","ungroup"])+this.addActions(a,["removeFromGroup"]);b.cell||b.row||(e+=this.addActions(a,["copySize","pasteSize","swap"]));var g=document.createElement("select");g.style.position="relative";g.className="geFullWidthElement";g.style.marginBottom="2px";for(var c=[{label:mxResources.get("reset")+"...",action:"reset"},{label:mxResources.get("waypoints"),action:"clearWaypoints"}, {label:mxResources.get("connectionPoints"),action:"clearAnchors"}],h=0;h<c.length;h++){var k=this.editorUi.actions.get(c[h].action);if(null==k||k.enabled){var p=document.createElement("option");p.setAttribute("value",c[h].action);p.setAttribute("title",c[h].label+(null!=k&&null!=k.shortcut?" ("+k.shortcut+")":""));mxUtils.write(p,c[h].label);g.appendChild(p)}}1<g.children.length&&(g.value="reset",a.appendChild(g),mxUtils.br(a),e++,mxEvent.addListener(g,"change",mxUtils.bind(this,function(l){l=this.editorUi.actions.get(g.value); g.value="reset";null!=l&&l.funct()})));e+=this.addActions(a,["lockUnlock"]);1==b.vertices.length&&0==b.edges.length&&0<d.getOpposites(d.getEdges(b.vertices[0]),b.vertices[0]).length&&(e+=this.addActions(a,["explore"]));0==e&&(a.style.display="none");return a}; ArrangePanel.prototype.addAlign=function(a){var b=this.editorUi,d=b.getSelectionState(),e=b.editor.graph;a.appendChild(this.createTitle(mxResources.get("align")));1<d.vertices.length&&(d=document.createElement("div"),d.className="geToolbarContainer",b.addButton(Editor.alignHorizontalLeftImage,mxResources.get("left"),function(){e.alignCells(mxConstants.ALIGN_LEFT)},d).style.marginLeft="6px",b.addButton(Editor.alignHorizontalCenterImage,mxResources.get("center"),function(){e.alignCells(mxConstants.ALIGN_CENTER)}, d),b.addButton(Editor.alignHorizontalRightImage,mxResources.get("right"),function(){e.alignCells(mxConstants.ALIGN_RIGHT)},d),b.addButton(Editor.alignVerticalTopImage,mxResources.get("top"),function(){e.alignCells(mxConstants.ALIGN_TOP)},d).style.marginLeft="12px",b.addButton(Editor.alignVerticalMiddleImage,mxResources.get("middle"),function(){e.alignCells(mxConstants.ALIGN_MIDDLE)},d),b.addButton(Editor.alignVerticalBottomImage,mxResources.get("bottom"),function(){e.alignCells(mxConstants.ALIGN_BOTTOM)}, d),a.appendChild(d));this.addActions(a,["snapToGrid"]);return a}; ArrangePanel.prototype.addFlip=function(a){var b=this.editorUi.editor.graph,d=this.editorUi.getSelectionState(),e=mxUtils.button(mxResources.get("horizontal"),function(g){b.flipCells(d.cells,!0)});e.setAttribute("title",mxResources.get("horizontal"));e.style.width="104px";e.style.marginRight="2px";a.appendChild(e);e=mxUtils.button(mxResources.get("vertical"),function(g){b.flipCells(d.cells,!1)});e.setAttribute("title",mxResources.get("vertical"));e.style.width="104px";a.appendChild(e);return a}; ArrangePanel.prototype.addLoopDirection=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState(),g=e.edges[0],c=d.view.getState(g);if(null==c)return a;var h=document.createElement("select");h.className="geFullWidthElement";h.style.boxSizing="border-box";h.style.position="relative";h.setAttribute("title",mxResources.get("direction"));d=d.getLoopFixedAxis(c);d="x"==d?[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_WEST]:"y"==d?[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_SOUTH]: [mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST];for(var k=0;k<d.length;k++){var p=document.createElement("option");p.setAttribute("value",d[k]);mxUtils.write(p,mxResources.get(d[k]));h.appendChild(p)}c=this.getLoopDirection(c);h.value=0<=mxUtils.indexOf(d,c)?c:d[0];mxEvent.addListener(h,"change",mxUtils.bind(this,function(){this.setLoopDirection(g,h.value);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DIRECTION], "values",[h.value],"cells",e.cells))}));null!=a.firstChild&&(mxUtils.br(a),h.style.marginTop="2px");a.appendChild(h);return a}; ArrangePanel.prototype.getLoopDirection=function(a){var b=null!=a?a.getVisibleTerminalState(!0):null,d=null!=a?a.absolutePoints:null;if(null==b||null==d||3>d.length)return null;for(var e=0,g=a=0,c=1;c<d.length-1;c++)null!=d[c]&&(e+=d[c].x,a+=d[c].y,g++);if(0==g)return null;d=e/g-b.getCenterX();b=a/g-b.getCenterY();return Math.abs(d)>=Math.abs(b)?0<=d?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_WEST:0<=b?mxConstants.DIRECTION_SOUTH:mxConstants.DIRECTION_NORTH}; ArrangePanel.prototype.setLoopDirection=function(a,b){var d=this.editorUi.editor.graph,e=d.view.getState(a),g=null!=e?e.getVisibleTerminalState(!0):null;if(null!=g){var c=2*d.gridSize*d.view.scale,h=g.getCenterX(),k=g.getCenterY();b=b==mxConstants.DIRECTION_EAST?new mxPoint(g.x+g.width+c,k):b==mxConstants.DIRECTION_WEST?new mxPoint(g.x-c,k):b==mxConstants.DIRECTION_NORTH?new mxPoint(h,g.y-c):new mxPoint(h,g.y+g.height+c);b=d.getLoopAroundPoints(e,b);if(null!=b){b=d.keepLoopOutsideShape(e,b);d.getModel().beginUpdate(); try{var p=d.getCellGeometry(a);null!=p&&(p=p.clone(),p.points=b,d.getModel().setGeometry(a,p));d.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[a]);d.setCellStyles("innerLoopWaypoints","1",[a])}finally{d.getModel().endUpdate()}}}}; ArrangePanel.prototype.addEdgeTurn=function(a){var b=this.editorUi,d=b.getSelectionState(),e=b.actions.get("turn"),g=mxUtils.button(mxResources.get("reverse"),function(c){e.funct(c)});g.setAttribute("title",mxResources.get("reverse")+(null!=e.shortcut?" ("+e.shortcut+")":""));g.className="geFullWidthElement";null!=a.firstChild&&(mxUtils.br(a),g.style.marginTop="2px");a.appendChild(g);d.connectedEdges||(mxUtils.br(a),d=mxUtils.button(mxResources.get("turn"),function(c){b.actions.get("rotateEdge").funct(c)}), d.setAttribute("title",mxResources.get("turn")),d.className="geFullWidthElement",d.style.marginTop="2px",a.appendChild(d));return a}; ArrangePanel.prototype.addDistribute=function(a){var b=this.editorUi.editor.graph;a.appendChild(this.createTitle(mxResources.get("distribute")));var d=mxUtils.button(mxResources.get("horizontal"),function(c){b.distributeCells(!0,null,e.checked)});d.setAttribute("title",mxResources.get("horizontal"));d.style.width="104px";d.style.marginRight="2px";a.appendChild(d);d=mxUtils.button(mxResources.get("vertical"),function(c){b.distributeCells(!1,null,e.checked)});d.setAttribute("title",mxResources.get("vertical")); d.style.width="104px";a.appendChild(d);mxUtils.br(a);d=document.createElement("div");d.style.margin="6px 0 0 0";d.style.display="flex";d.style.justifyContent="center";d.style.alignItems="center";var e=document.createElement("input");e.setAttribute("type","checkbox");e.setAttribute("id","spacingCheckbox");e.setAttribute("title",mxResources.get("spacing"));e.style.margin="0 6px 0 0";d.appendChild(e);var g=document.createElement("label");g.style.verticalAlign="top";g.setAttribute("for","spacingCheckbox"); g.setAttribute("title",mxResources.get("spacing"));g.style.userSelect="none";mxUtils.write(g,mxResources.get("spacing"));d.appendChild(g);a.appendChild(d);return a}; ArrangePanel.prototype.addAngle=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState(),g=document.createElement("div");g.style.position="absolute";g.style.marginTop="4px";g.style.width="70px";g.style.fontWeight="bold";a.style.minHeight="20px";var c=null,h=null,k=null;!e.rotatable||e.table||e.row||e.cell||(mxUtils.write(g,mxResources.get("angle")),g.setAttribute("title",mxResources.get("angle")),a.appendChild(g),c=this.addUnitInput(a,"°",16,52,function(){h.apply(this,arguments)}), c.setAttribute("title",mxResources.get("angle")),mxUtils.br(a));!e.containsLabel&&0<e.vertices.length&&(g=0<e.edges.length?mxResources.get("turn")+" / "+mxResources.get("reverse"):mxResources.get("turn"),k=mxUtils.button(g,function(l){b.actions.get("turn").funct(l)}),k.setAttribute("title",g+" ("+this.editorUi.actions.get("turn").shortcut+")"),k.className="geFullWidthElement",a.appendChild(k),null!=c&&(k.style.marginTop="10px"));if(null!=c){var p=mxUtils.bind(this,function(l,u,x){if(x||document.activeElement!= c)e=b.getSelectionState(),l=parseFloat(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0)),c.value=isNaN(l)?"":l+"°"});h=this.installInputHandler(c,mxConstants.STYLE_ROTATION,0,0,360,"°",null,!0);this.addKeyHandler(c,p);d.getModel().addListener(mxEvent.CHANGE,p);this.listeners.push({destroy:function(){d.getModel().removeListener(p)}});p()}return a}; BaseFormatPanel.prototype.getUnit=function(a){var b="";switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:b="pt";break;case mxConstants.INCHES:b='"';break;case mxConstants.MILLIMETERS:b="mm";break;case mxConstants.METERS:b="m"}return(a?a:"")+b};BaseFormatPanel.prototype.inUnit=function(a){return this.editorUi.editor.graph.view.formatUnitText(a)}; BaseFormatPanel.prototype.fromUnit=function(a){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return a;case mxConstants.INCHES:return a*mxConstants.PIXELS_PER_INCH;case mxConstants.MILLIMETERS:return a*mxConstants.PIXELS_PER_MM;case mxConstants.METERS:return a*mxConstants.PIXELS_PER_MM*1E3}};BaseFormatPanel.prototype.isFloatUnit=function(){return!0}; BaseFormatPanel.prototype.getUnitStep=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return 1;case mxConstants.INCHES:return.1;case mxConstants.MILLIMETERS:return.5;case mxConstants.METERS:return.001}}; ArrangePanel.prototype.addGeometry=function(a){var b=this,d=this.editorUi,e=d.editor.graph,g=e.getModel(),c=d.getSelectionState(),h=1==c.vertices.length&&0==c.edges.length&&e.isTransparentBounds(c.vertices[0]),k=this.createPanel();k.style.height="60px";var p=document.createElement("div");p.className="geStyleLabel";p.style.position="absolute";p.style.fontWeight="bold";p.style.marginTop="4px";p.style.maxWidth="50px";mxUtils.write(p,mxResources.get("size"));p.setAttribute("title",mxResources.get("size")); k.appendChild(p);var l=this.addUnitInput(k,this.getUnit(),87,52,function(){C.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());l.setAttribute("title",mxResources.get("width"));var u=this.addUnitInput(k,this.getUnit(),16,52,function(){F.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());u.setAttribute("title",mxResources.get("height"));var x=document.createElement("div");x.style.backgroundImage="url("+Editor.autosizeImage+")";x.className="geButton";x.style.margin= "0";x.style.width="21px";x.style.height="21px";x.style.left="52px";mxUtils.setOpacity(x,50);x.setAttribute("title",mxResources.get("autosize"));mxEvent.addListener(x,"click",function(){d.actions.get("autosize").funct()});k.appendChild(x);c.row?(l.style.visibility="hidden",l.nextSibling.style.visibility="hidden"):this.addLabel(k,mxResources.get("width"),87,64).style.marginTop="0px";this.addLabel(k,mxResources.get("height"),16,64).style.marginTop="0px";mxUtils.br(k);var v=document.createElement("div"); v.className="geFormatEntry";v.style.marginTop="14px";p=this.createCellOption(mxResources.get("constrainProportions"),mxConstants.STYLE_ASPECT,null,"fixed","null");p.className="geFullWidthElement";v.appendChild(p);c.cell||c.row?x.style.visibility="hidden":k.appendChild(v);var z=p.getElementsByTagName("input")[0];this.addKeyHandler(l,ia);this.addKeyHandler(u,ia);var C=this.addGeometryHandler(l,function(U,Y,N){Y=Math.max(1,b.fromUnit(Y));if(e.isTableCell(N))return e.setTableColumnWidth(N,Y-U.width,!0), !0;0<U.width&&(z.checked&&(U.height=Math.round(U.height*Y*100/U.width)/100),U.width=Y)});var F=this.addGeometryHandler(u,function(U,Y,N){Y=Math.max(1,b.fromUnit(Y));e.isTableCell(N)&&(N=g.getParent(N));if(e.isTableRow(N))return e.setTableRowHeight(N,Y-U.height),!0;0<U.height&&(z.checked&&(U.width=Math.round(U.width*Y*100/U.height)/100),U.height=Y)});(c.resizable||c.row||c.cell||h)&&a.appendChild(k);var G=this.createPanel();G.style.paddingBottom="30px";G.style.borderTop="none";p=document.createElement("div"); p.style.position="absolute";p.style.width="70px";p.style.marginTop="0px";p.style.fontWeight="bold";mxUtils.write(p,mxResources.get("position"));p.setAttribute("title",mxResources.get("position"));G.appendChild(p);var H=this.addUnitInput(G,this.getUnit(),87,52,function(){na.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),J=this.addUnitInput(G,this.getUnit(),16,52,function(){Z.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(G);if(h){p=[l,u, H,J];for(var O=0;O<p.length;O++)p[O].setAttribute("readonly","readonly"),mxUtils.setOpacity(p[O],60),null!=p[O].nextSibling&&(p[O].nextSibling.style.visibility="hidden");x.style.visibility="hidden";v.style.display="none";k.style.height="42px"}x=!0;var M=null,V=null;if(c.movable){if(0==c.edges.length&&1==c.vertices.length){var Q=e.getCellGeometry(c.vertices[0]);if(null!=Q&&Q.relative){mxUtils.br(G);p=document.createElement("div");p.style.position="absolute";p.style.width="70px";p.style.marginTop="0px"; mxUtils.write(p,mxResources.get("relative"));p.setAttribute("title",mxResources.get("relative"));G.appendChild(p);M=this.addGenericInput(G," %",87,52,function(){return Math.round(1E3*Q.x)/10},function(U){U=parseFloat(U);if(!isNaN(U)){g.beginUpdate();try{Q=Q.clone(),Q.x=parseFloat(U)/100,g.setGeometry(c.vertices[0],Q)}finally{g.endUpdate()}}});M.setAttribute("title",mxResources.get("relative"));if(g.isEdge(g.getParent(c.vertices[0]))){x=!1;var ma=null;V=this.addUnitInput(G,this.getUnit(),16,52,function(){ma.apply(this, arguments)});V.setAttribute("title",mxResources.get("orthogonal"));ma=this.addGeometryHandler(V,function(U,Y){U.y=b.fromUnit(Y)})}else V=this.addGenericInput(G," %",16,52,function(){return Math.round(1E3*Q.y)/10},function(U){U=parseFloat(U);if(!isNaN(U)){g.beginUpdate();try{Q=Q.clone(),Q.y=parseFloat(U)/100,g.setGeometry(c.vertices[0],Q)}finally{g.endUpdate()}}});mxUtils.br(G)}}a.appendChild(G)}this.addLabel(G,mxResources.get(x?"left":"line"),87,64);this.addLabel(G,mxResources.get(x?"top":"orthogonal"), 16,64);H.setAttribute("title",mxResources.get(x?"left":"line"));J.setAttribute("title",mxResources.get(x?"top":"orthogonal"));var ia=mxUtils.bind(this,function(U,Y,N){c=d.getSelectionState();if(h&&(Y=c.vertices[0],U=e.getTransparentBounds(Y),Y=e.getCellGeometry(Y),U=null!=U&&null!=Y?new mxRectangle(Y.x+U.x,Y.y+U.y,U.width,U.height):null,null!=U)){k.style.display="";G.style.display="";l.value=this.inUnit(U.width)+" "+this.getUnit();u.value=this.inUnit(U.height)+" "+this.getUnit();H.value=this.inUnit(U.x)+ " "+this.getUnit();J.value=this.inUnit(U.y)+" "+this.getUnit();return}if(c.containsLabel||c.vertices.length!=e.getSelectionCount()||null==c.width||null==c.height)k.style.display="none";else{k.style.display="";if(N||document.activeElement!=l)l.value=this.inUnit(c.width)+" "+this.getUnit();if(N||document.activeElement!=u)u.value=this.inUnit(c.height)+" "+this.getUnit()}if(c.vertices.length==e.getSelectionCount()&&0<c.vertices.length&&null!=c.x&&null!=c.y){U=e.getCellGeometry(c.vertices[0]);G.style.display= "";if(N||document.activeElement!=H)H.value=this.inUnit(c.x)+" "+this.getUnit();if(N||document.activeElement!=J)J.value=this.inUnit(c.y)+" "+this.getUnit();null!=U&&U.relative&&(null==M||!N&&document.activeElement==M||(M.value=Math.round(1E3*U.x)/10+" %"),null==V||!N&&document.activeElement==V||(g.isEdge(g.getParent(c.vertices[0]))?V.value=this.inUnit(U.y)+" "+this.getUnit():V.value=Math.round(1E3*U.y)/10+" %"))}else G.style.display="none"});this.listeners.push({destroy:function(){g.removeListener(ia)}}); g.addListener(mxEvent.CHANGE,ia);this.addKeyHandler(H,ia);this.addKeyHandler(J,ia);ia();var na=this.addGeometryHandler(H,function(U,Y){Y=b.fromUnit(Y);U.relative?(U.offset=null!=U.offset?U.offset:new mxPoint,U.offset.x=Y):U.x=Y});var Z=this.addGeometryHandler(J,function(U,Y){Y=b.fromUnit(Y);U.relative?(U.offset=null!=U.offset?U.offset:new mxPoint,U.offset.y=Y):U.y=Y});if(c.movable){if(0==c.edges.length&&1==c.vertices.length&&g.isEdge(g.getParent(c.vertices[0]))&&(Q=e.getCellGeometry(c.vertices[0]), null!=Q&&Q.relative)){var da=document.createElement("select");da.setAttribute("title",mxResources.get("move"));da.style.position="absolute";da.style.width="134px";da.style.left="77px";x=document.createElement("option");x.setAttribute("value","none");x.setAttribute("title",mxResources.get("move"));mxUtils.write(x,mxResources.get("move")+"...");da.appendChild(x);x=document.createElement("option");x.setAttribute("value","start");x.setAttribute("title",mxResources.get("linestart"));mxUtils.write(x,mxResources.get("linestart")); da.appendChild(x);x=document.createElement("option");x.setAttribute("value","center");x.setAttribute("title",mxResources.get("center"));mxUtils.write(x,mxResources.get("center"));da.appendChild(x);x=document.createElement("option");x.setAttribute("value","end");x.setAttribute("title",mxResources.get("lineend"));mxUtils.write(x,mxResources.get("lineend"));da.appendChild(x);mxEvent.addListener(da,"change",function(U){if("none"!=da.value){g.beginUpdate();try{Q=Q.clone(),Q.x="start"==da.value?-1:"end"== da.value?1:0,Q.y=0,Q.offset=new mxPoint,g.setGeometry(c.vertices[0],Q)}finally{g.endUpdate()}}da.value="none"});mxUtils.br(G);mxUtils.br(G);G.appendChild(da)}a.appendChild(G)}x=1==c.vertices.length&&0==c.edges.length?c.vertices[0]:null;a=null!=x&&(h||e.isContainer(x)||null!=mxUtils.getValue(c.style,mxConstants.STYLE_GROUP_PADDING,null));x=null!=x&&0<g.getChildCount(x);if(a||x){G.style.paddingBottom="6px";if(a){v=document.createElement("div");v.style.position="relative";v.style.height="24px";v.style.marginTop= "40px";p=document.createElement("span");p.style.position="absolute";p.style.left="0px";p.style.lineHeight="24px";mxUtils.write(p,mxResources.get("groupPadding"));p.setAttribute("title",mxResources.get("groupPadding"));v.appendChild(p);var pa=document.createElement("input");pa.setAttribute("type","text");pa.style.position="absolute";pa.style.left="148px";pa.style.width="52px";pa.setAttribute("title",mxResources.get("groupPadding"));v.appendChild(pa);G.appendChild(v);var ka=function(){var U=mxUtils.getValue(d.getSelectionState().style, mxConstants.STYLE_GROUP_PADDING,0);try{U=decodeURIComponent(String(U))}catch(Y){}return String(U)},S=mxUtils.bind(this,function(U,Y,N){if(N||document.activeElement!=pa)pa.value=ka()});v=mxUtils.bind(this,function(U){var Y=pa.value.trim(),N=""==Y?["0"]:Y.split(/\s+/);Y=4>=N.length;for(var R=[],ea=0;ea<N.length&&Y;ea++){var ba=parseFloat(N[ea]);(Y=!isNaN(ba))&&R.push(Math.min(999,Math.max(0,ba)))}N=R.join(" ");Y&&N!=ka()&&(e.isEditing()&&e.stopEditing(!0),Y=d.getSelectionState().cells,e.setCellStyles(mxConstants.STYLE_GROUP_PADDING, N,Y),d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GROUP_PADDING],"values",[N],"cells",Y)));S(null,null,!0);mxEvent.consume(U)});mxEvent.addListener(pa,"change",v);mxEvent.addListener(pa,"blur",v);g.addListener(mxEvent.CHANGE,S);this.listeners.push({destroy:function(){g.removeListener(S)}});this.addKeyHandler(pa,S);S()}x&&(x=this.createCellOption(mxResources.get("automatic"),"transparentBounds",null,"1","null"),x.className+=" geFullWidthElement",x.style.marginTop=a?"6px": "26px",G.appendChild(x))}}; ArrangePanel.prototype.addGeometryHandler=function(a,b){function d(k){if(!a.readOnly){if(""!=a.value){var p=parseFloat(a.value);if(isNaN(p))a.value=c+" "+h.getUnit();else if(p!=c){g.getModel().beginUpdate();try{for(var l=e.getSelectionState().cells,u=0;u<l.length;u++)if(g.getModel().isVertex(l[u])){var x=g.getCellGeometry(l[u]);if(null!=x&&(x=x.clone(),!b(x,p,l[u]))){var v=g.view.getState(l[u]);null!=v&&g.isRecursiveVertexResize(v)&&g.resizeChildCells(l[u],x);g.getModel().setGeometry(l[u],x);g.constrainChildCells(l[u])}}}finally{g.getModel().endUpdate()}c= p;a.value=p+" "+h.getUnit()}}mxEvent.consume(k)}}var e=this.editorUi,g=e.editor.graph,c=null,h=this;mxEvent.addListener(a,"blur",d);mxEvent.addListener(a,"change",d);mxEvent.addListener(a,"focus",function(){c=a.value});return d}; ArrangePanel.prototype.addEdgeGeometryHandler=function(a,b){function d(h){if(""!=a.value){var k=parseFloat(a.value);if(isNaN(k))a.value=c+" pt";else if(k!=c){g.getModel().beginUpdate();try{for(var p=e.getSelectionState().cells,l=0;l<p.length;l++)if(g.getModel().isEdge(p[l])){var u=g.getCellGeometry(p[l]);null!=u&&(u=u.clone(),b(u,k),g.getModel().setGeometry(p[l],u))}}finally{g.getModel().endUpdate()}c=k;a.value=k+" pt"}}mxEvent.consume(h)}var e=this.editorUi,g=e.editor.graph,c=null;mxEvent.addListener(a, "blur",d);mxEvent.addListener(a,"change",d);mxEvent.addListener(a,"focus",function(){c=parseFloat(a.value)});return d}; ArrangePanel.prototype.addArrowGeometry=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState(),g=this.createPanel();g.style.display="flex";g.style.alignItems="center";var c=document.createElement("div");c.style.position="absolute";c.style.width="70px";c.style.marginTop="0px";c.style.fontWeight="bold";mxUtils.write(c,mxResources.get("width"));c.setAttribute("title",mxResources.get("width"));g.appendChild(c);var h=this.addUnitInput(g,"pt",12,44,function(){k.apply(this,arguments)}); h.setAttribute("title",mxResources.get("width"));mxUtils.br(g);a.appendChild(g);var k=mxUtils.bind(this,function(l){var u=parseInt(h.value);u=Math.min(999,Math.max(1,isNaN(u)?1:u));if(u!=mxUtils.getValue(e.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth)){var x=b.getSelectionState().cells;d.setCellStyles("width",u,x);b.fireEvent(new mxEventObject("styleChanged","keys",["width"],"values",[u],"cells",x))}h.value=u+" pt";mxEvent.consume(l)});mxEvent.addListener(h,"blur",k); mxEvent.addListener(h,"change",k);var p=mxUtils.bind(this,function(l,u,x){e=b.getSelectionState();if(x||document.activeElement!=h)l=mxUtils.getValue(e.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),h.value=l+" pt"});this.addKeyHandler(h,p);d.getModel().addListener(mxEvent.CHANGE,p);this.listeners.push({destroy:function(){d.getModel().removeListener(p)}});p()}; ArrangePanel.prototype.addEdgeGeometry=function(a){var b=this,d=this.editorUi,e=d.editor.graph,g=d.getSelectionState();a.style.paddingBottom="22px";var c=this.createPanel();c.style.paddingBottom="16px";var h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("linestart"));h.setAttribute("title",mxResources.get("linestart"));c.appendChild(h);var k=this.addUnitInput(c,this.getUnit(),87,52,function(){z.apply(this,arguments)}, this.getUnitStep(),null,null,this.isFloatUnit());k.setAttribute("title",mxResources.get("left"));var p=this.addUnitInput(c,this.getUnit(),16,52,function(){C.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());p.setAttribute("title",mxResources.get("top"));a.appendChild(c);var l=this.createPanel();l.style.borderTop="none";l.style.paddingTop="8px";l.style.paddingBottom="16px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px"; mxUtils.write(h,mxResources.get("lineend"));h.setAttribute("title",mxResources.get("lineend"));l.appendChild(h);var u=this.addUnitInput(l,this.getUnit(),87,52,function(){F.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());u.setAttribute("title",mxResources.get("left"));var x=this.addUnitInput(l,this.getUnit(),16,52,function(){G.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());x.setAttribute("title",mxResources.get("top"));a.appendChild(l);this.addLabel(a, mxResources.get("left"),87,62).style.fontSize="10px";this.addLabel(a,mxResources.get("top"),16,62).style.fontSize="10px";var v=mxUtils.bind(this,function(H,J,O){g=d.getSelectionState();H=g.cells[0];1==g.cells.length&&e.model.isEdge(H)?(J=e.model.getGeometry(H),null!=J&&null!=J.sourcePoint&&null==e.model.getTerminal(H,!0)?(k.value=this.inUnit(J.sourcePoint.x)+" "+this.getUnit(),p.value=this.inUnit(J.sourcePoint.y)+" "+this.getUnit()):c.style.display="none",null!=J&&null!=J.targetPoint&&null==e.model.getTerminal(H, !1)?(u.value=this.inUnit(J.targetPoint.x)+" "+this.getUnit(),x.value=this.inUnit(J.targetPoint.y)+" "+this.getUnit()):l.style.display="none"):(c.style.display="none",l.style.display="none")});this.addKeyHandler(k,v);this.addKeyHandler(p,v);this.addKeyHandler(u,v);this.addKeyHandler(x,v);var z=this.addEdgeGeometryHandler(k,function(H,J){null!=H.sourcePoint&&(H.sourcePoint.x=b.fromUnit(J))});var C=this.addEdgeGeometryHandler(p,function(H,J){null!=H.sourcePoint&&(H.sourcePoint.y=b.fromUnit(J))});var F= this.addEdgeGeometryHandler(u,function(H,J){null!=H.targetPoint&&(H.targetPoint.x=b.fromUnit(J))});var G=this.addEdgeGeometryHandler(x,function(H,J){null!=H.targetPoint&&(H.targetPoint.y=b.fromUnit(J))});e.getModel().addListener(mxEvent.CHANGE,v);this.listeners.push({destroy:function(){e.getModel().removeListener(v)}});v()};TextFormatPanel=function(a,b,d){BaseFormatPanel.call(this,a,b,d);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){var b=this.addAction(a,"copyTextStyle"),d=this.addAction(a,"pasteTextStyle");null!=b&&null!=d&&(b.style.marginRight="4px",b.style.width="104px",d.style.width="104px",null!=b.nextSibling&&"BR"==b.nextSibling.nodeName&&b.nextSibling.parentNode.removeChild(b.nextSibling));null==b&&null==d||mxUtils.br(a);0==this.addActions(a,["removeFormat"])&&null==b&&null==d&&(a.style.display="none");return a}; TextFormatPanel.prototype.addFont=function(a){function b(ha){ha=null!=ha?ha.fontSize:null;return null!=ha&&"px"==ha.substring(ha.length-2)?parseFloat(ha):mxConstants.DEFAULT_FONTSIZE}function d(ha,oa){if(null!=ha&&""!=ha.textContent){ha.style.lineHeight="";var qa=mxUtils.getCurrentStyle(ha);parseFloat(qa.fontSize)*oa/100!=parseFloat(qa.lineHeight)?ha.style.lineHeight=oa+"%":""==ha.getAttribute("style")&&ha.removeAttribute("style")}}function e(ha,oa){oa?ha.classList.add("geActiveItem"):ha.classList.remove("geActiveItem")} var g=this.editorUi,c=g.editor.graph,h=g.getSelectionState(),k=this.createTitle(mxResources.get("font"));a.appendChild(k);var p=this.createPanel();p.className="geFormatEntry";if(c.cellEditor.isContentEditing()){var l=p.cloneNode(),u=g.toolbar.addMenu(g.menus.get("formatBlock"),mxResources.get("style"),null,l);this.addArrow(u);u.style.margin="0px";u.style.position="relative";u.classList.add("geFullWidthElement");a.appendChild(l)}var x=p.cloneNode(!1);a.appendChild(x);var v=this.createPanel(),z=g.toolbar.addMenu(g.menus.get("fontFamily"), "Helvetica",null,x);this.addArrow(z);z.setAttribute("title",mxResources.get("fontFamily"));z.style.margin="0px";z.style.position="relative";z.classList.add("geFullWidthElement");"inherit"==h.style[mxConstants.STYLE_FONTFAMILY]&&(x.style.display="none");var C=p.cloneNode(!1),F=g.toolbar.addItems(["bold","italic","underline"],C,!0,[Editor.boldImage,Editor.italicImage,Editor.underlineImage]);F[0].setAttribute("title",mxResources.get("bold")+" ("+g.actions.get("bold").shortcut+")");F[1].setAttribute("title", mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");F[2].setAttribute("title",mxResources.get("underline")+" ("+g.actions.get("underline").shortcut+")");var G=g.toolbar.addItems(["vertical"],C,!0,[Editor.verticalTextImage])[0];a.appendChild(C);var H=p.cloneNode(!1),J=function(ha){return function(){return ha()}},O=g.addButton(Editor.alignLeftImage,mxResources.get("left"),c.cellEditor.isContentEditing()?function(ha){c.cellEditor.alignText(mxConstants.ALIGN_LEFT,ha);g.fireEvent(new mxEventObject("styleChanged", "keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",h.cells))}:J(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),H),M=g.addButton(Editor.alignCenterImage,mxResources.get("center"),c.cellEditor.isContentEditing()?function(ha){c.cellEditor.alignText(mxConstants.ALIGN_CENTER,ha);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",h.cells))}:J(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN], [mxConstants.ALIGN_CENTER])),H),V=g.addButton(Editor.alignRightImage,mxResources.get("right"),c.cellEditor.isContentEditing()?function(ha){c.cellEditor.alignText(mxConstants.ALIGN_RIGHT,ha);g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",h.cells))}:J(g.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),H);c.cellEditor.isContentEditing()&&(na=g.addButton(Editor.strikethroughImage,mxResources.get("strikethrough"), function(){document.execCommand("strikeThrough",!1,null)},C));var Q=g.addButton(Editor.alignTopImage,mxResources.get("top"),J(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),H),ma=g.addButton(Editor.alignMiddleImage,mxResources.get("middle"),J(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),H),ia=g.addButton(Editor.alignBottomImage,mxResources.get("bottom"),J(g.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN], [mxConstants.ALIGN_BOTTOM])),H);a.appendChild(H);var na,Z,da,pa;if(c.cellEditor.isContentEditing()){Q.style.display="none";ma.style.display="none";ia.style.display="none";G.style.display="none";var ka=g.addButton(Editor.alignJustifyImage,mxResources.get("block"),function(){document.execCommand("justifyfull",!1,null)},H);ka.style.marginRight="9px";var S=g.addButton(Editor.subscriptImage,mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)",function(){document.execCommand("subscript",!1,null)},H); S.style.marginLeft="10px";var U=g.addButton(Editor.superscriptImage,mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},H);S.style.marginLeft="10px";var Y=H.cloneNode(!1);Y.style.paddingTop="4px";var N=[g.addButton(Editor.orderedListImage,mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},Y),g.addButton(Editor.unorderedListImage,mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist", !1,null)},Y),g.addButton(Editor.indentImage,mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},Y),g.addButton(Editor.outdentImage,mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},Y),g.addButton(Editor.removeFormatImage,mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},Y),g.addButton(Editor.codeImage,mxResources.get("html"),function(){c.cellEditor.toggleViewMode()},Y)];N[N.length-2].style.marginLeft= "10px";a.appendChild(Y)}else F[2].style.marginRight="12px",V.style.marginRight="12px";var R=p.cloneNode(!1);mxUtils.write(R,mxResources.get("position"));R.setAttribute("title",mxResources.get("position"));var ea=document.createElement("select");ea.setAttribute("title",mxResources.get("position"));ea.style.left="114px";ea.style.width="98px";for(var ba="topLeft top topRight left center right bottomLeft bottom bottomRight".split(" "),la={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]},sa=0;sa<ba.length;sa++){var T=document.createElement("option");T.setAttribute("value",ba[sa]);mxUtils.write(T,mxResources.get(ba[sa])); ea.appendChild(T)}R.appendChild(ea);var ua=R.cloneNode(!1);mxUtils.write(ua,mxResources.get("writingDirection"));ua.setAttribute("title",mxResources.get("writingDirection"));ua.style.marginBottom="2px";var va=ea.cloneNode(!1);va.setAttribute("title",mxResources.get("writingDirection"));var Ka=["automatic","leftToRight","rightToLeft"];h.html&&(Ka.push("vertical-leftToRight"),Ka.push("vertical-rightToLeft"));var Sa={automatic:null,leftToRight:mxConstants.TEXT_DIRECTION_LTR,rightToLeft:mxConstants.TEXT_DIRECTION_RTL, "vertical-leftToRight":mxConstants.TEXT_DIRECTION_VERTICAL_LR,"vertical-rightToLeft":mxConstants.TEXT_DIRECTION_VERTICAL_RL};for(sa=0;sa<Ka.length;sa++){var Ua=document.createElement("option");Ua.setAttribute("value",Ka[sa]);"vertical-"==Ka[sa].substring(0,9)?mxUtils.write(Ua,mxResources.get("vertical")+" ("+mxResources.get(Ka[sa].substring(9))+")"):mxUtils.write(Ua,mxResources.get(Ka[sa]));va.appendChild(Ua)}ua.appendChild(va);c.isEditing()||(a.appendChild(R),mxEvent.addListener(ea,"change",function(ha){c.getModel().beginUpdate(); try{var oa=la[ea.value];null!=oa&&(c.setCellStyles(mxConstants.STYLE_LABEL_POSITION,oa[0],h.cells),c.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION,oa[1],h.cells),c.setCellStyles(mxConstants.STYLE_ALIGN,oa[2],h.cells),c.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,oa[3],h.cells))}finally{c.getModel().endUpdate()}mxEvent.consume(ha)}),a.appendChild(ua),mxEvent.addListener(va,"change",function(ha){c.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION,Sa[va.value],h.cells);mxEvent.consume(ha)})); var ta=document.createElement("input");ta.style.position="absolute";ta.style.left="146px";ta.style.width="52px";ta.setAttribute("title",mxResources.get("fontSize"));C.appendChild(ta);var Fa=this.installInputHandler(ta,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize,1,999," "+Editor.fontSizeUnit,function(ha){if(null!=c.getSelectedEditingElement()){ta.value=ha+" "+Editor.fontSizeUnit;document.execCommand("fontSize",!1,"1");for(var oa=c.cellEditor.textarea.getElementsByTagName("font"),qa= 0;qa<oa.length;qa++)if("1"==oa[qa].getAttribute("size")){oa[qa].removeAttribute("size");oa[qa].style.fontSize="";var Ba=mxUtils.getCurrentStyle(oa[qa]);ha!=b(Ba)?oa[qa].style.fontSize=ha+"px":""==oa[qa].getAttribute("style")&&oa[qa].removeAttribute("style")}}},!0),Ma=this.createStepper(ta,Fa,1,!0,Menus.prototype.defaultFontSize);Ma.style.display=ta.style.display;Ma.style.left="198px";"inherit"==h.style[mxConstants.STYLE_FONTSIZE]&&(ta.style.display="none",Ma.style.display="none");C.appendChild(Ma); var ab=null,Za=c.shapeBackgroundColor,Xa=null,Va=c.shapeForegroundColor,ja=mxUtils.getLightDarkColor(c.shapeBackgroundColor),ya="light-dark("+mxUtils.hex2rgb(ja.light)+", "+mxUtils.hex2rgb(ja.dark)+")",db=c.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("backgroundColor"),function(){return Za==c.shapeBackgroundColor||Za==ya?"default":Za},function(ha){null!=c.cellEditor.textarea&&("default"==ha&&(ha=c.shapeBackgroundColor),Graph.setTextColor(c.cellEditor.textarea,ha,!1),Za=ha, g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],"values",[ha],"cells",h.cells)))},"default",{install:function(ha){ab=ha},destroy:function(){ab=null}},null,null,c.shapeBackgroundColor):this.createCellColorOption(mxResources.get("backgroundColor"),mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"default",null,function(ha){c.updateLabelElements(g.getSelectionState().cells,function(oa){oa.style.backgroundColor=null})},c.shapeBackgroundColor);db.style.fontWeight="bold"; var mb=this.createCellColorOption(mxResources.get("borderColor"),mxConstants.STYLE_LABEL_BORDERCOLOR,"default",null,null,c.shapeForegroundColor);mb.style.fontWeight="bold";var kb=1<=h.vertices.length?c.stylesheet.getDefaultVertexStyle():c.stylesheet.getDefaultEdgeStyle(),zb=c.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("fontColor"),function(){return Va},function(ha){null!=c.cellEditor.textarea&&("default"==ha&&(ha=mxConstants.NONE),Graph.setTextColor(c.cellEditor.textarea, ha,!0),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTCOLOR],"values",[ha],"cells",h.cells)))},"default",{install:function(ha){Xa=ha},destroy:function(){Xa=null}},null,!0,null!=kb[mxConstants.STYLE_FONTCOLOR]&&"default"!=kb[mxConstants.STYLE_FONTCOLOR]?kb[mxConstants.STYLE_FONTCOLOR]:c.shapeForegroundColor):this.createCellColorOption(mxResources.get("fontColor"),mxConstants.STYLE_FONTCOLOR,"default",function(ha){db.style.display=ha==mxConstants.NONE?"none":"";mb.style.display= db.style.display},function(ha){var oa=g.getSelectionState().cells;ha==mxConstants.NONE?c.setCellStyles(mxConstants.STYLE_NOLABEL,"1",oa):c.setCellStyles(mxConstants.STYLE_NOLABEL,null,oa);c.updateLabelElements(oa,function(qa){qa.removeAttribute("color");qa.style.color=null})},c.shapeForegroundColor);"inherit"==h.style[mxConstants.STYLE_FONTCOLOR]&&(zb.style.display="none");zb.style.fontWeight="bold";v.appendChild(zb);"curvedText"==h.style[mxConstants.STYLE_SHAPE]&&(db.style.display="none",mb.style.display= "none");v.appendChild(db);var ub=this.createCellOption(mxResources.get("shadow"),mxConstants.STYLE_TEXT_SHADOW,0);ub.style.width="100%";ub.style.fontWeight="bold";Editor.enableShadowOption||(ub.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(ub,60));c.cellEditor.isContentEditing()||(v.appendChild(mb),v.appendChild(ub));a.appendChild(v);var ib=this.createPanel();ib.style.paddingTop="2px";ib.style.paddingBottom="4px";var tb=c.filterSelectionCells(mxUtils.bind(this, function(ha){var oa=c.view.getState(ha);return null==oa||c.getModel().isEdge(ha)||c.isAutoSizeState(oa)})),rb=c.view.getState(c.getSelectionCell()),eb="1"==mxUtils.getValue(h.style,"html",0),fb=eb&&!mxUtils.isVerticalTextDirection(h.style[mxConstants.STYLE_TEXT_DIRECTION])&&(1<c.getSelectionCount()&&"1"==h.style.convertToSvg||1==c.getSelectionCount()&&null!=rb&&null!=rb.text&&null!=rb.text.node&&0==rb.text.node.getElementsByTagName("foreignObject").length)?"svgWhiteSpace":mxConstants.STYLE_WHITE_SPACE, jb=this.createCellOption(mxResources.get("wordWrap"),fb,null,"wrap","null",null,null,!0,tb);jb.style.fontWeight="bold";0<tb.length&&ib.appendChild(jb);var vb=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,g.actions.get("formattedText"));vb.style.fontWeight="bold";ib.appendChild(vb);var nb=this.createCellOption(mxResources.get("lblToSvg"),"convertToSvg","0",null,null,function(ha,oa){for(var qa=0;qa<ha.length;qa++){var Ba=c.getCurrentCellStyle(ha[qa]);oa?"wrap"==Ba[mxConstants.STYLE_WHITE_SPACE]&& c.setCellStyles("svgWhiteSpace","wrap",[ha[qa]]):"wrap"==Ba.svgWhiteSpace&&c.setCellStyles(mxConstants.STYLE_WHITE_SPACE,"wrap",[ha[qa]])}});nb.style.fontWeight="bold";ib.appendChild(nb);if(Editor.enableAutoRotateLabels&&(1==h.edges.length&&0==h.vertices.length||h.containsLabel&&0==h.edges.length)){var Vb=this.createCellOption(mxResources.get("autoRotateLabel"),"labelAutoRotate","0","1","0");Vb.style.fontWeight="bold";ib.appendChild(Vb)}var Gb=nb.getElementsByTagName("input")[0];if(eb||"wrap"==h.style[mxConstants.STYLE_WHITE_SPACE]){var Hb= !1,Lb=c.getSelectionCells();for(sa=0;sa<Lb.length&&!Hb;sa++){var Mb=c.view.getState(Lb[sa]);if(null!=Mb&&"1"==mxUtils.getValue(Mb.style,"html","0")){var Wb=c.cellRenderer.getLabelValue(Mb);null!=Wb&&0<Wb.length&&!mxUtils.canConvertHtmlToSvg(Wb,{dir:Mb.style[mxConstants.STYLE_TEXT_DIRECTION],fontSize:mxUtils.getValue(Mb.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)})&&(Hb=!0)}}if(Hb)if(Gb.checked){var Tb=document.createElement("span");Tb.style.marginLeft="4px";Tb.style.cursor="default"; mxUtils.write(Tb,"⚠︎");nb.appendChild(Tb);nb.setAttribute("title","Label cannot be converted to SVG and falls back to HTML rendering. Uncheck to remove the style.")}else nb.style.opacity="0.5",Gb.setAttribute("disabled","disabled"),nb.setAttribute("title","Label contains unsupported HTML or vertical text for SVG conversion. Supported: H1-H6, P, PRE, BLOCKQUOTE, DIV, B, I, U, STRIKE, SUP, SUB, SPAN, FONT, BR (without background color).")}else Gb.checked||(nb.style.opacity="0.5",Gb.setAttribute("disabled", "disabled"));var $b=this.createCellOption(mxResources.get("autosizeText"),"autosizeText","0",null,null,mxUtils.bind(this,function(ha,oa){if(oa)for(oa=0;oa<ha.length;oa++)c.model.isVertex(ha[oa])&&c.updateAutosizeTextFontSize(ha[oa])}));$b.style.fontWeight="bold";0<h.vertices.length&&h.resizable&&ib.appendChild($b);var Xb=0<h.vertices.length&&h.vertices.length==h.cells.length;for(sa=0;sa<h.vertices.length&&Xb;sa++){var Yb=c.getCellGeometry(h.vertices[sa]);Xb=null!=Yb&&null!=c.getShapeInsideOutline(c.getCurrentCellStyle(h.vertices[sa]), Yb.width,Yb.height)}if(Xb){var Ib=this.createCellOption(mxResources.get("fitTextToShape"),"shapeInside","0",null,null,mxUtils.bind(this,function(ha,oa){for(oa=0;oa<ha.length;oa++)c.refresh(ha[oa])}));Ib.style.fontWeight="bold";"wrap"!=mxUtils.getValue(h.style,mxConstants.STYLE_WHITE_SPACE,null)&&(Ib.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),Ib.style.opacity="0.5");ib.appendChild(Ib)}if(!g.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)nb.getElementsByTagName("span")[0].style.maxWidth= "172px",nb.appendChild(g.menus.createHelpLink("https://www.drawio.com/docs/manual/text/svg-labels/"));var lb=this.createPanel();lb.style.height="86px";var Nb=this.addUnitInput(lb,this.getUnit(),87,52,function(){ca.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Nb.setAttribute("title",mxResources.get("top"));var Ab=this.addUnitInput(lb,this.getUnit(),16,52,function(){aa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Ab.setAttribute("title",mxResources.get("global")); mxUtils.br(lb);this.addLabel(lb,mxResources.get("top"),87,64);this.addLabel(lb,mxResources.get("global"),16,64);mxUtils.br(lb);mxUtils.br(lb);var Db=this.addUnitInput(lb,this.getUnit(),158,52,function(){za.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Db.setAttribute("title",mxResources.get("left"));var bb=this.addUnitInput(lb,this.getUnit(),87,52,function(){Ca.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());bb.setAttribute("title",mxResources.get("bottom")); var Bb=this.addUnitInput(lb,this.getUnit(),16,52,function(){ra.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Bb.setAttribute("title",mxResources.get("right"));mxUtils.br(lb);this.addLabel(lb,mxResources.get("left"),158,64);this.addLabel(lb,mxResources.get("bottom"),87,64);this.addLabel(lb,mxResources.get("right"),16,64);var sb=this.createPanel();sb.className="geFormatEntry";sb.style.fontWeight="bold";mxUtils.write(sb,mxResources.get("labelWidth"));sb.setAttribute("title", mxResources.get("labelWidth"));var Ob=mxUtils.bind(this,function(ha){var oa=this.isFloatUnit()?parseFloat(Eb.value):parseInt(Eb.value);oa=isNaN(oa)?null:Math.max(1,this.fromUnit(oa));if(oa!=mxUtils.getValue(g.getSelectionState().style,mxConstants.STYLE_LABEL_WIDTH,null)){c.isEditing()&&c.stopEditing(!0);var qa=g.getSelectionState().cells;c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_LABEL_WIDTH,oa,qa),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_WIDTH], "values",[oa],"cells",qa))}finally{c.getModel().endUpdate()}}Eb.value=null==oa?"":this.inUnit(oa)+" "+this.getUnit();mxEvent.consume(ha)}),Eb=this.addUnitInput(sb,this.getUnit(),16,52,function(){Ob.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Eb.setAttribute("title",mxResources.get("labelWidth"));mxEvent.addListener(Eb,"change",Ob);mxEvent.addListener(Eb,"blur",Ob);var gb=this.createPanel();gb.className="geFormatEntry";gb.style.fontWeight="bold";gb.setAttribute("title", mxResources.get("labelPadding"));var wb=document.createElement("span");wb.className="geStyleLabel";wb.style.maxWidth="140px";mxUtils.write(wb,mxResources.get("labelPadding"));gb.appendChild(wb);var Zb=mxUtils.bind(this,function(ha){var oa=ob.value.match(/\d*\.?\d+/g);oa=null!=oa?oa.slice(0,4).map(Number).join(" "):null;null==mxUtils.parseCssSpacing(oa)&&(oa=null);if(oa!=mxUtils.getValue(g.getSelectionState().style,mxConstants.STYLE_LABEL_PADDING,null)){c.isEditing()&&c.stopEditing(!0);var qa=g.getSelectionState().cells; c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_LABEL_PADDING,oa,qa),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_PADDING],"values",[oa],"cells",qa))}finally{c.getModel().endUpdate()}}ob.value=null==oa?"":oa;mxEvent.consume(ha)}),ob=document.createElement("input");ob.style.position="absolute";ob.style.left="148px";ob.style.width="52px";ob.setAttribute("title",mxResources.get("labelPadding"));gb.appendChild(ob);var Ub=this.createStepper(ob,Zb,1,null, null,null,function(ha){var oa=ob.value.match(/\d*\.?\d+/g);oa=null!=oa?oa.slice(0,4).map(Number):[0];for(var qa=0;qa<oa.length;qa++)oa[qa]=Math.max(0,oa[qa]+ha);ob.value=oa.join(" ")});Ub.style.left="200px";gb.appendChild(Ub);mxEvent.addListener(ob,"change",Zb);mxEvent.addListener(ob,"blur",Zb);if(c.cellEditor.isContentEditing()){var Pb=null,Jb=null;a.appendChild(this.createRelativeOption(mxResources.get("lineheight"),null,null,function(ha){var oa=""==ha.value?120:parseInt(ha.value);oa=Math.max(0, isNaN(oa)?120:oa);if(window.getSelection){null!=Pb&&(c.cellEditor.restoreSelection(Pb),Pb=null);var qa=c.getSelectedEditingElement();if(null!=c.cellEditor.textarea&&qa==c.cellEditor.textarea){var Ba=window.getSelection();if(Ba.getRangeAt&&0<Ba.rangeCount){var Na=Ba.getRangeAt(0);qa=document.createElement("div");qa.appendChild(Na.extractContents());c.cellEditor.textarea.innerHTML="";c.cellEditor.textarea.appendChild(qa);Ba.removeAllRanges();Na=new Range;Na.selectNodeContents(qa);Ba.addRange(Na)}}if(null!= c.cellEditor.textarea&&c.cellEditor.textarea.contains(qa))for(qa!=c.cellEditor.textarea&&d(qa,oa),qa=qa.getElementsByTagName("*"),Ba=window.getSelection(),Na=0;Na<qa.length;Na++)Ba.containsNode(qa[Na],!0)&&d(qa[Na],oa)}ha.value=oa+" %"},function(ha){Jb=ha;mxEvent.addGestureListeners(ha,mxUtils.bind(this,function(oa){document.activeElement==c.cellEditor.textarea&&(Pb=c.cellEditor.saveSelection())}));mxEvent.addListener(ha,"touchstart",function(){document.activeElement==c.cellEditor.textarea&&(Pb=c.cellEditor.saveSelection())}); ha.value="120 %"}));var Qb=p.cloneNode(!1);g.toolbar.addItems(["link","image"],Qb,!0,[Editor.linkImage,Editor.imageImage]);N=[g.addButton(Editor.horizontalRuleImage,mxResources.get("insertHorizontalRule"),function(){document.execCommand("inserthorizontalrule",!1)},Qb),g.toolbar.addMenu(new Menu(mxUtils.bind(this,function(ha){g.menus.addInsertTableItem(ha,null,null,!1)})),null,Editor.tableImage,Qb)];var Kb=this.createPanel();Kb.appendChild(this.createTitle(mxResources.get("insert")));Kb.appendChild(Qb); a.appendChild(Kb);var q=p.cloneNode(!1);N=[g.addButton(Editor.addColumnLeftImage,mxResources.get("insertColumnBefore"),mxUtils.bind(this,function(){try{null!=Z&&c.insertColumn(Z,null!=da?da.cellIndex:0)}catch(ha){g.handleError(ha)}}),q),g.addButton(Editor.addColumnRightImage,mxResources.get("insertColumnAfter"),mxUtils.bind(this,function(){try{null!=Z&&c.insertColumn(Z,null!=da?da.cellIndex+1:-1)}catch(ha){g.handleError(ha)}}),q),g.addButton(Editor.removeColumnImage,mxResources.get("deleteColumn"), mxUtils.bind(this,function(){try{null!=Z&&null!=da&&c.deleteColumn(Z,da.cellIndex)}catch(ha){g.handleError(ha)}}),q),g.addButton(Editor.addRowAboveImage,mxResources.get("insertRowBefore"),mxUtils.bind(this,function(){try{null!=Z&&null!=pa&&c.insertRow(Z,pa.sectionRowIndex)}catch(ha){g.handleError(ha)}}),q),g.addButton(Editor.addRowBelowImage,mxResources.get("insertRowAfter"),mxUtils.bind(this,function(){try{null!=Z&&null!=pa&&c.insertRow(Z,pa.sectionRowIndex+1)}catch(ha){g.handleError(ha)}}),q),g.addButton(Editor.removeRowImage, mxResources.get("deleteRow"),mxUtils.bind(this,function(){try{null!=Z&&null!=pa&&c.deleteRow(Z,pa.sectionRowIndex)}catch(ha){g.handleError(ha)}}),q)];N[2].style.marginRight="10px";var A=this.createPanel();A.appendChild(this.createTitle(mxResources.get("table")));A.appendChild(q);var B=p.cloneNode(!1);N=[g.addButton(Editor.strokeColorImage,mxResources.get("borderColor"),mxUtils.bind(this,function(ha){if(null!=Z){var oa=Z.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g, function(qa,Ba,Na,Ra){return"#"+("0"+Number(Ba).toString(16)).substr(-2)+("0"+Number(Na).toString(16)).substr(-2)+("0"+Number(Ra).toString(16)).substr(-2)});g.pickColor(oa,function(qa){var Ba=null==da||null!=ha&&mxEvent.isShiftDown(ha)?Z:da;null!=Ba&&(c.processElements(Ba,function(Na){Na.style.border=null}),null==qa||qa==mxConstants.NONE?(Ba.removeAttribute("border"),Ba.style.border="",Ba.style.borderCollapse=""):(Ba.setAttribute("border","1"),Ba.style.border="1px solid "+qa,Ba.style.borderCollapse= "collapse"))},null,null,null,mxResources.get("borderColor"))}}),B),g.addButton(Editor.fillColorImage,mxResources.get("backgroundColor"),mxUtils.bind(this,function(ha){if(null!=Z){var oa=Z.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(qa,Ba,Na,Ra){return"#"+("0"+Number(Ba).toString(16)).substr(-2)+("0"+Number(Na).toString(16)).substr(-2)+("0"+Number(Ra).toString(16)).substr(-2)});g.pickColor(oa,function(qa){var Ba=null==da||null!=ha&&mxEvent.isShiftDown(ha)? Z:da;null!=Ba&&(c.processElements(Ba,function(Na){Na.style.backgroundColor=null}),Ba.style.backgroundColor=null==qa||qa==mxConstants.NONE?"":qa)},null,null,null,mxResources.get("backgroundColor"))}}),B),g.addButton(Editor.spacingImage,mxResources.get("spacing"),function(){if(null!=Z){var ha=Z.getAttribute("cellPadding")||0;ha=new FilenameDialog(g,ha,mxResources.get("apply"),mxUtils.bind(this,function(oa){null!=oa&&0<oa.length?Z.setAttribute("cellPadding",oa):Z.removeAttribute("cellPadding")}),mxResources.get("spacing")); g.showDialog(ha.container,300,80,!0,!0);ha.init()}},B),g.addButton(Editor.alignLeftImage,mxResources.get("left"),function(){null!=Z&&Z.setAttribute("align","left")},B),g.addButton(Editor.alignCenterImage,mxResources.get("center"),function(){null!=Z&&Z.setAttribute("align","center")},B),g.addButton(Editor.alignRightImage,mxResources.get("right"),function(){null!=Z&&Z.setAttribute("align","right")},B)];N[2].style.marginRight="10px";A.appendChild(B);a.appendChild(A);var D=A}else{var I=this.createCollapsibleSection(mxResources.get("advanced"), !0);I.contentDiv.appendChild(ib);I.contentDiv.appendChild(sb);I.contentDiv.appendChild(gb);a.appendChild(I.wrapper);var K=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY);K.style.borderTopStyle="solid";K.style.borderTopWidth="1px";K.style.padding="6px 0";a.appendChild(K);var P=this.createCollapsibleSection(mxResources.get("spacing"),!0);P.contentDiv.appendChild(lb);a.appendChild(P.wrapper)}for(sa=0;3>sa;sa++)(function(ha){mxEvent.addListener(F[ha],"click",function(){e(F[ha], ""==F[ha].style.backgroundImage)})})(sa);var X=mxUtils.bind(this,function(ha,oa,qa){h=g.getSelectionState();ha=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0);e(F[0],(ha&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD);e(F[1],(ha&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC);e(F[2],(ha&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE);g.toolbar.setMenuText(z,mxUtils.getValue(h.style,mxConstants.STYLE_FONTFAMILY,Menus.prototype.defaultFont));e(G,"0"==mxUtils.getValue(h.style,mxConstants.STYLE_HORIZONTAL, "1"));if(qa||document.activeElement!=ta)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize)),ta.value=isNaN(ha)?"":ha+" "+Editor.fontSizeUnit;ha=mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);e(O,ha==mxConstants.ALIGN_LEFT);e(M,ha==mxConstants.ALIGN_CENTER);e(V,ha==mxConstants.ALIGN_RIGHT);ha=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);e(Q,ha==mxConstants.ALIGN_TOP);e(ma,ha==mxConstants.ALIGN_MIDDLE); e(ia,ha==mxConstants.ALIGN_BOTTOM);ha=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);oa=mxUtils.getValue(h.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);ea.value=ha==mxConstants.ALIGN_LEFT&&oa==mxConstants.ALIGN_TOP?"topLeft":ha==mxConstants.ALIGN_CENTER&&oa==mxConstants.ALIGN_TOP?"top":ha==mxConstants.ALIGN_RIGHT&&oa==mxConstants.ALIGN_TOP?"topRight":ha==mxConstants.ALIGN_LEFT&&oa==mxConstants.ALIGN_BOTTOM?"bottomLeft":ha==mxConstants.ALIGN_CENTER&& oa==mxConstants.ALIGN_BOTTOM?"bottom":ha==mxConstants.ALIGN_RIGHT&&oa==mxConstants.ALIGN_BOTTOM?"bottomRight":ha==mxConstants.ALIGN_LEFT?"left":ha==mxConstants.ALIGN_RIGHT?"right":"center";ha=mxUtils.getValue(h.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);ha==mxConstants.TEXT_DIRECTION_RTL?va.value="rightToLeft":ha==mxConstants.TEXT_DIRECTION_LTR?va.value="leftToRight":ha!=mxConstants.TEXT_DIRECTION_AUTO&&h.html?ha==mxConstants.TEXT_DIRECTION_VERTICAL_LR?va.value="vertical-leftToRight": ha==mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(va.value="vertical-rightToLeft"):va.value="automatic";if(qa||document.activeElement!=Ab)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING,2)),Ab.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=Nb)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_TOP,0)),Nb.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=Bb)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_RIGHT, 0)),Bb.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=bb)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_BOTTOM,0)),bb.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=Db)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_LEFT,0)),Db.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=Eb)ha=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_WIDTH,"")), Eb.value=isNaN(ha)?"":this.inUnit(ha)+" "+this.getUnit();if(qa||document.activeElement!=ob)ob.value=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_PADDING,"");gb.style.display=mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(h.style,mxConstants.STYLE_LABEL_BORDERCOLOR,mxConstants.NONE)!=mxConstants.NONE?"":"none"});var aa=this.installInputHandler(Ab,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(), !0);var ca=this.installInputHandler(Nb,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ra=this.installInputHandler(Bb,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var Ca=this.installInputHandler(bb,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var za=this.installInputHandler(Db,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(ta, X);this.addKeyHandler(Ab,X);this.addKeyHandler(Nb,X);this.addKeyHandler(Bb,X);this.addKeyHandler(bb,X);this.addKeyHandler(Db,X);this.addKeyHandler(Eb,X);this.addKeyHandler(ob,X);c.getModel().addListener(mxEvent.CHANGE,X);this.listeners.push({destroy:function(){c.getModel().removeListener(X)}});X();if(c.cellEditor.isContentEditing()){var Ia=null,La=!1,Qa=mxUtils.bind(this,function(){La||(La=!0,window.setTimeout(mxUtils.bind(this,function(){var ha=c.getSelectedEditingElement();if(null!=ha&&null!=c.cellEditor.textarea){var oa= function($a,cb){if(null!=$a&&null!=cb){if($a==cb)return!0;if($a.length>cb.length+1)return $a.substring($a.length-cb.length-1,$a.length)=="-"+cb}return!1},qa=function($a){if(null!=c.getParentByName(ha,$a,c.cellEditor.textarea))return!0;for(var cb=ha;null!=cb&&1==cb.childNodes.length;)if(cb=cb.childNodes[0],cb.nodeName==$a)return!0;return!1},Ba=function($a){for(;null!=$a&&$a!=c.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle($a).display)return $a;$a=$a.parentNode}return null},Na=mxUtils.getCurrentStyle(ha), Ra=ha==c.cellEditor.textarea||""==ha.style.lineHeight?null:ha.style.lineHeight,Ga=ha==c.cellEditor.textarea||""==ha.style.fontSize?null:b(Na);if(window.getSelection)for(var Ya=ha.getElementsByTagName("*"),qb=window.getSelection(),hb=0;hb<Ya.length&&(!qb.containsNode(Ya[hb],!0)||null==Ya[hb].style||(null==Ga&&""!=Ya[hb].style.fontSize&&(Ga=parseFloat(Ya[hb].style.fontSize)),null==Ra&&""!=Ya[hb].style.lineHeight&&(Ra=Ya[hb].style.lineHeight),null==Ga||null==Ra));hb++);null==Ga&&(Ga=b(Na));if(null== Ra)for(Ya=ha;null!=Ya&&Ya!=c.cellEditor.textarea.parentNode;){if(null!=Ya.style&&""!=Ya.style.lineHeight){Ra=Ya.style.lineHeight;break}Ya=Ya.parentNode}if(null!=Na){e(F[0],"bold"==Na.fontWeight||400<Na.fontWeight||qa("B")||qa("STRONG"));e(F[1],"italic"==Na.fontStyle||qa("I")||qa("EM"));e(F[2],"underline"==Na.textDecorationLine||qa("U"));e(na,"line-through"==Na.textDecorationLine||qa("STRIKE"));e(U,qa("SUP"));e(S,qa("SUB"));var Fb=Ba(ha);if(null!=Fb){qa=function($a,cb){xb.push({name:$a,dispName:cb, type:"string",getValue:function(){return Cb[$a]},valueChanged:function(pb,Rb){var yb=Fb.style,f=pb;parseInt(f)==f&&(f+="px",null!=Rb&&(Rb.value=f));yb[$a]=f;""==pb&&null!=Rb&&(Rb.value=Cb[$a])}})};var Cb=mxUtils.getCurrentStyle(Fb),xb=[];qa("paddingTop","Padding Top");qa("paddingRight","Padding Right");qa("paddingLeft","Padding Left");qa("paddingBottom","Padding Bottom");qa("marginTop","Margin Top");qa("marginRight","Margin Right");qa("marginLeft","Margin Left");qa("marginBottom","Margin Bottom"); qa=this.createPanel();this.addProperties(qa,xb,h,!0);null!=Ia?Ia.parentNode.replaceChild(qa,Ia):a.appendChild(qa);Ia=qa}c.cellEditor.isTableSelected()?(e(ka,oa(Na.textAlign,"justify")),e(O,oa(Na.textAlign,"left")),e(M,oa(Na.textAlign,"center")),e(V,oa(Na.textAlign,"right"))):(qa=c.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),oa(Na.textAlign,"justify")?(e(ka,oa(Na.textAlign,"justify")),e(O,!1),e(M,!1),e(V,!1)):(e(ka,!1),e(O,qa==mxConstants.ALIGN_LEFT), e(M,qa==mxConstants.ALIGN_CENTER),e(V,qa==mxConstants.ALIGN_RIGHT)));Z=c.getParentByName(ha,"TABLE",c.cellEditor.textarea);pa=null==Z?null:c.getParentByName(ha,"TR",Z);da=null==Z?null:c.getParentByNames(ha,["TD","TH"],Z);D.style.display=null!=Z?"":"none";document.activeElement!=ta&&(ta.value=isNaN(Ga)?"":Ga+" "+Editor.fontSizeUnit,"string"===typeof Ra&&0<Ra.indexOf("%")?Jb.value=Ra.replace("%"," %"):(oa=parseFloat(Ra),isNaN(oa)?Jb.value="120 %":Jb.value=Math.round(100*oa)+" %"));null!=Xa&&(Va=c.getTextColor(ha, !0),Xa(Va,!0));null!=ab&&(Za=c.getTextColor(ha,!1),ab(Za,!0));g.toolbar.setMenuText(z,mxUtils.getCssFontFamily(Na.fontFamily))}}La=!1}),0))});mxEvent.addListener(c.cellEditor.textarea,"input",Qa);mxEvent.addListener(c.cellEditor.textarea,"touchend",Qa);mxEvent.addListener(c.cellEditor.textarea,"mouseup",Qa);mxEvent.addListener(c.cellEditor.textarea,"keyup",Qa);this.listeners.push({destroy:function(){}});Qa()}return a};StyleFormatPanel=function(a,b,d){BaseFormatPanel.call(this,a,b,d);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())),null!=a.style.cssVars&&this.container.appendChild(this.addSvgVars(this.createPanel())));if(a.fill){var b=this.createCollapsibleSection(mxResources.get("fill"),!1);b.contentDiv.appendChild(this.addFill(this.createPanel())); this.container.appendChild(b.wrapper)}b=this.createCollapsibleSection(mxResources.get("line"),!1);b.contentDiv.appendChild(this.addStroke(this.createPanel()));this.container.appendChild(b.wrapper);b=this.addLineJumps(this.createPanel());var d=this.createCollapsibleSection(mxResources.get("lineJumps"),!0);d.contentDiv.appendChild(b);this.container.appendChild(d.wrapper);this.syncCollapsibleVisibility(d.wrapper,b);b=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPACITY);b.style.borderTopStyle= "solid";b.style.borderTopWidth="1px";b.style.padding="6px 0";this.container.appendChild(b);b=this.createCollapsibleSection(mxResources.get("effects"),!0);b.contentDiv.appendChild(this.addEffects(this.createPanel()));this.container.appendChild(b.wrapper)}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){return Graph.getCssRules(a)}; StyleFormatPanel.prototype.addSvgStyles=function(a){var b=this.editorUi.getSelectionState();a.style.paddingTop="6px";a.style.paddingBottom="6px";a.style.fontWeight="bold";a.style.display="none";try{var d=b.style.editableCssRules;if(null!=d){var e=new RegExp(d),g=b.style.image.substring(b.style.image.indexOf(",")+1),c=window.atob?decodeURIComponent(escape(atob(g))):Base64.decode(g,!0),h=mxUtils.parseXml(c);if(null!=h){var k="light"==h.documentElement.style.colorScheme||"0"==mxUtils.getValue(b.style, "darkMode",null),p=""==h.documentElement.style.colorScheme,l=h.getElementsByTagName("style");for(b=0;b<l.length;b++){var u=this.getCssRules(mxUtils.getTextContent(l[b]));for(d=0;d<u.length;d++)this.addSvgRule(a,u[d],h,l[b],u,d,e,k,p)}}}}catch(x){}return a};StyleFormatPanel.prototype.getColorSchemeFromCss=function(a){return(a=a.match(/color-scheme\s*:\s*([^;]+)/i))?a[1].trim():null}; StyleFormatPanel.prototype.addSvgRule=function(a,b,d,e,g,c,h,k,p){var l=this.editorUi,u=l.editor.graph;h.test(b.selectorText)&&(h=mxUtils.bind(this,function(x,v,z,C){var F=mxUtils.trim(x.style.getPropertyValue(v));if(""!=F&&"url("!=F.substring(0,4)){var G=F;"transparent"==G?G=mxConstants.NONE:(F=mxUtils.isLightDarkColor(G))&&C?C=!1:F||C||(G="light-dark("+G+", "+G+")");x=this.createColorOption(z+" "+x.selectorText,function(){return G},mxUtils.bind(this,function(H){g[c].style.setProperty(v,H==mxConstants.NONE? "transparent":mxUtils.getLightDarkColor(H).cssText);H="";p&&mxUtils.isLightDarkColor(g[c].style[v])&&(d.documentElement.style.colorScheme="light dark");for(var J=0;J<g.length;J++)H+=g[J].cssText+" ";e.textContent=H;H=mxUtils.getXml(d.documentElement);u.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(unescape(encodeURIComponent(H))):Base64.encode(H,!0)),l.getSelectionState().cells)}),"#ffffff",{install:function(H){},destroy:function(){}},null,null,null,C);a.appendChild(x); a.style.display=""}}),h(b,"fill",mxResources.get("fill"),k),h(b,"stroke",mxResources.get("line"),k),h(b,"stop-color",mxResources.get("gradient"),k))}; StyleFormatPanel.prototype.addSvgVars=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState();a.style.paddingTop="6px";a.style.paddingBottom="6px";a.style.fontWeight="bold";a.style.display="none";var g="0"==mxUtils.getValue(e.style,"darkMode",null);if(!g&&"data:image/svg+xml;"==String(e.style.image).substring(0,19))try{var c=e.style.image.substring(e.style.image.indexOf(",")+1),h=window.atob?decodeURIComponent(escape(atob(c))):Base64.decode(c,!0),k=mxUtils.parseXml(h);null!=k&&(g= "light"==k.documentElement.style.colorScheme)}catch(l){}var p=function(l,u,x){var v=String(mxUtils.getValue(b.getSelectionState().style,mxConstants.STYLE_IMAGE,""));null!=u&&""!=v&&"data:"!=v.substring(0,5)&&"function"===typeof b.editor.convertImageToDataUri?b.editor.convertImageToDataUri(v,function(z){if(null!=z&&z!=v&&"data:image/svg+xml;base64,"==z.substring(0,26)){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+z.substring(26),x),d.setCellStyles("imageUrl", v,x),d.setCellStyles(l,u,x)}finally{d.getModel().endUpdate()}}else b.handleError({message:mxResources.get("errorLoadingFile")})}):d.setCellStyles(l,u,x)};c=mxUtils.bind(this,function(l){var u=this.createColorOption(l,function(){return mxUtils.getValue(b.getSelectionState().style,"--"+l,null)},function(x){p("--"+l,x==mxConstants.NONE?null:mxUtils.getLightDarkColor(x).cssText,b.getSelectionState().cells)},"#ffffff",{install:function(x){},destroy:function(){}},null,null,null,g);a.appendChild(u);a.style.display= ""});e=String(mxUtils.getValue(e.style,"cssVars","")).split(",");for(h=0;h<e.length;h++)k=mxUtils.trim(e[h]),"--"==k.substring(0,2)&&(k=k.substring(2)),""!=k&&c(k);return a}; StyleFormatPanel.prototype.addEditOps=function(a){var b=this.editorUi.getSelectionState();if(1==b.cells.length){var d=document.createElement("select");d.style.position="relative";d.style.marginBottom="2px";d.className="geFullWidthElement";var e="edit copyAsText editLink editShape editImage editData copyData pasteData editConnectionPoints editGeometry editPolygon editTooltip editNote editStyle".split(" "),g=null;if(null!=this.editorUi.sidebar){var c=this.editorUi.sidebar.getKeyStyle(b.cells[0].style); g=this.editorUi.sidebar.getLibsForStyle(c);null!=g||this.editorUi.sidebar.isSearchIndexLoaded()||null==b.style.shape||"mxgraph."!=String(b.style.shape).substring(0,8)||(g=[])}null!=g&&e.push("openLibrary");for(c=0;c<e.length;c++){var h=this.editorUi.actions.get(e[c]);if(null==h||h.enabled){var k=document.createElement("option");k.setAttribute("value",e[c]);var p=mxResources.get(e[c]);mxUtils.write(k,p);null!=h&&null!=h.shortcut&&(p+=" ("+h.shortcut+")");k.setAttribute("title",p);d.appendChild(k)}}1< d.children.length&&(a.appendChild(d),mxEvent.addListener(d,"change",mxUtils.bind(this,function(l){"openLibrary"==d.value?(null!=g&&0==g.length&&(this.editorUi.sidebar.updateSearchIndex(),l=this.editorUi.sidebar.getKeyStyle(b.cells[0].style),g=this.editorUi.sidebar.getLibsForStyle(l)),null!=g&&0<g.length?this.editorUi.sidebar.openLibraries(g):this.editorUi.handleError({message:mxResources.get("objectNotFound")}),d.value="edit"):(l=this.editorUi.actions.get(d.value),d.value="edit",null!=l&&l.funct())})), b.image&&(e=this.editorUi.editor.graph,e=e.view.getState(e.getSelectionCell()),null!=e&&null!=mxUtils.getValue(e.style,mxConstants.STYLE_IMAGE,null)&&(e=mxUtils.button(mxResources.get("crop")+"...",mxUtils.bind(this,function(l){this.editorUi.actions.get("crop").funct()})),e.setAttribute("title",mxResources.get("crop")),d.style.width="104px",e.style.width="104px",e.style.position="relative",e.style.top="-1px",e.style.marginLeft="2px",e.style.marginBottom="1px",a.appendChild(e))))}return a}; StyleFormatPanel.prototype.addFill=function(a){function b(){h.innerHTML="";z=1;for(var G=0;G<Editor.fillStyles.length;G++){var H=document.createElement("option");H.setAttribute("value",Editor.fillStyles[G].val);mxUtils.write(H,mxResources.get(Editor.fillStyles[G].res,null,Editor.fillStyles[G].dispName));h.appendChild(H)}}var d=this.editorUi,e=d.editor.graph,g=d.getSelectionState(),c=document.createElement("select");c.setAttribute("title",mxResources.get("gradient"));c.style.position="absolute";c.style.left= "76px";c.style.width="86px";var h=c.cloneNode(!1);h.setAttribute("title",mxResources.get("fill"));mxEvent.addListener(c,"click",function(G){mxEvent.consume(G)});mxEvent.addListener(h,"click",function(G){mxEvent.consume(G)});var k=this.createCellColorOption(mxResources.get("gradient"),mxConstants.STYLE_GRADIENTCOLOR,"default",function(G){c.style.display=null==G||G==mxConstants.NONE?"none":""},function(G){e.updateCellStyles({gradientColor:G},e.getSelectionCells())},e.getDefaultColor(g.style,mxConstants.STYLE_GRADIENTCOLOR, e.shapeForegroundColor,e.shapeBackgroundColor),null,null,mxResources.get("gradientColor"));k.style.fontWeight="bold";var p="image"==g.style.shape?mxConstants.STYLE_IMAGE_BACKGROUND:mxConstants.STYLE_FILLCOLOR,l=this.createCellColorOption(mxResources.get("fill"),p,"default",null,null,e.getDefaultColor(g.style,p,e.shapeBackgroundColor,e.shapeForegroundColor),null,null,mxResources.get("fillColor"));l.style.fontWeight="bold";var u=mxUtils.getValue(g.style,p,null);k.style.display=null!=u&&u!=mxConstants.NONE&& g.fill&&"image"!=g.style.shape?"":"none";var x=[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL];for(u=0;u<x.length;u++){var v=document.createElement("option");v.setAttribute("value",x[u]);mxUtils.write(v,mxResources.get(x[u]));c.appendChild(v)}k.appendChild(c);var z;b();g.gradient&&l.appendChild(h);var C=mxUtils.bind(this,function(){g=d.getSelectionState();var G=mxUtils.getValue(g.style,mxConstants.STYLE_GRADIENT_DIRECTION, mxConstants.DIRECTION_SOUTH),H=mxUtils.getValue(g.style,"fillStyle","auto");""==G&&(G=mxConstants.DIRECTION_SOUTH);c.value=G;a.style.display=g.fill?"":"none";G=mxUtils.getValue(g.style,p,null);if(g.fill&&null!=G&&G!=mxConstants.NONE&&"filledEdge"!=g.style.shape){if("1"==g.style.sketch){if(2!=z){h.innerHTML="";z=2;for(G=0;G<Editor.roughFillStyles.length;G++){var J=document.createElement("option");J.setAttribute("value",Editor.roughFillStyles[G].val);mxUtils.write(J,mxResources.get(Editor.roughFillStyles[G].res, null,Editor.roughFillStyles[G].dispName));h.appendChild(J)}h.value="auto"}}else 1!=z&&b();h.value=H;h.value||(H="auto",h.value=H);h.style.display="1"==g.style.sketch||"none"==c.style.display?"":"none";k.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=H&&"auto"!=H?"none":""}else h.style.display="none",k.style.display="none"});e.getModel().addListener(mxEvent.CHANGE,C);this.listeners.push({destroy:function(){e.getModel().removeListener(C)}});C();mxEvent.addListener(c,"change", function(G){e.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,c.value,g.cells);d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[c.value],"cells",g.cells));mxEvent.consume(G)});mxEvent.addListener(h,"change",function(G){e.setCellStyles("fillStyle",h.value,g.cells);d.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[h.value],"cells",g.cells));mxEvent.consume(G)});a.appendChild(l);a.appendChild(k);var F={};l=this.getCustomColors(); for(u=0;u<l.length;u++)F[l[u].key]||(F[l[u].key]=!0,a.appendChild(this.createCellColorOption(l[u].title,l[u].key,l[u].defaultValue,null,null,l[u].defaultColorValue,l[u].undefinedColor,!0)));l=mxUtils.bind(this,function(G,H,J){if(null!=G){G=G.split(",");H=null!=H?H.split(","):null;for(var O=0;O<G.length;O++)if(!F[G[O]]){F[G[O]]=!0;var M=null!=H?H[mxUtils.mod(O,H.length)]:null,V=null!=M?M:"default";a.appendChild(this.createCellColorOption(Editor.getLabelForStylename(G[O]),G[O],V,null,null,J,M,!0))}}}); l(g.style.fillColorStyles,g.style.defaultFillColors,e.shapeBackgroundColor);l(g.style.strokeColorStyles,g.style.defaultStrokeColors,e.shapeForegroundColor);return a}; StyleFormatPanel.prototype.getCustomColors=function(){var a=this.editorUi,b=a.editor.graph;a=a.getSelectionState();var d=[];if(null!=a.customProperties)for(var e in a.customProperties){var g=a.customProperties[e];if(null!=g&&g.primary&&("color"==g.type||"color"==g.subType)&&("function"!==typeof g.isVisible||g.isVisible(a,this))){var c="color"==g.subType?g.subDefVal:g.defVal;c=null!=c?c:b.shapeBackgroundColor;d.push({title:g.dispName,defaultValue:c,defaultColorValue:null!=g.defaultColor?g.defaultColor: c,undefinedColor:g.undefinedColor,key:g.name})}}a.swimlane&&(b=this.editorUi.editor.graph,d.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default",defaultColorValue:b.shapeBackgroundColor}));return d}; StyleFormatPanel.prototype.addDashPattern=function(a,b){var d=b.split(" ");if(2<=d.length){for(var e=0,g=0;g<d.length;g++)e+=parseInt(d[g]);b=Graph.createSvgImage(e,1,'<line transform="translate(0,1)" x1="0" y1="0" x2="'+e+'" y2="0" stroke-dasharray="'+b+'" stroke-width="2" stroke="black"/>',e,1);a.style.backgroundImage="url("+b.src+")";a.style.backgroundSize=e+"px 1px";a.style.backgroundRepeat="repeat-x"}else a.style.borderBottomStyle=b}; StyleFormatPanel.prototype.addStroke=function(a){function b(T){var ua=document.createElement("div");mxUtils.write(ua,mxResources.get("custom"));ua.setAttribute("title",mxResources.get("custom"));ua.className="geStyleMenuItem";ua.style.textAlign="center";ua.style.display="block";ua.style.textOverflow="ellipsis";ua.style.overflow="hidden";ua.style.maxWidth=T+"px";ua.style.fontSize="12px";return ua}function d(T){var ua=g.fromUnit(parseFloat(M.value));ua=Math.min(999,Math.max(0,isNaN(ua)?1:ua));ua!=mxUtils.getValue(k.style, mxConstants.STYLE_STROKEWIDTH,1)&&(h.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ua,k.cells),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ua],"cells",k.cells)));M.value=g.inUnit(ua)+" "+g.getUnit();mxEvent.consume(T)}function e(T){var ua=g.fromUnit(parseFloat(V.value));ua=Math.min(999,Math.max(0,isNaN(ua)?1:ua));ua!=mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)&&(h.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ua,k.cells),c.fireEvent(new mxEventObject("styleChanged", "keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ua],"cells",k.cells)));V.value=g.inUnit(ua)+" "+g.getUnit();mxEvent.consume(T)}var g=this,c=this.editorUi,h=c.editor.graph,k=c.getSelectionState(),p=document.createElement("div");p.className="geFormatEntry";k.stroke||(p.style.display="none");var l=document.createElement("select");l.setAttribute("title",mxResources.get("style"));l.style.position="absolute";l.style.left="72px";l.style.width="90px";for(var u=["sharp","rounded","curved"],x=0;x<u.length;x++){var v= document.createElement("option");v.setAttribute("value",u[x]);mxUtils.write(v,mxResources.get(u[x]));l.appendChild(v)}mxEvent.addListener(l,"change",function(T){h.getModel().beginUpdate();try{var ua=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],va=["0","0"];"rounded"==l.value?va=["1","0"]:"curved"==l.value&&(va=["0","1"]);for(var Ka=0;Ka<ua.length;Ka++)h.setCellStyles(ua[Ka],va[Ka],k.cells);c.fireEvent(new mxEventObject("styleChanged","keys",ua,"values",va,"cells",k.cells))}finally{h.getModel().endUpdate()}mxEvent.consume(T)}); mxEvent.addListener(l,"click",function(T){mxEvent.consume(T)});var z="image"==k.style.shape?mxConstants.STYLE_IMAGE_BORDER:mxConstants.STYLE_STROKECOLOR;u="image"==k.style.shape?mxResources.get("border"):mxResources.get("line");x="image"==k.style.shape?mxResources.get("borderColor"):mxResources.get("strokeColor");x=this.createCellColorOption(u,z,"default",null,mxUtils.bind(this,function(T){if(null==T||T==mxConstants.NONE){T=c.getSelectionState().cells;for(var ua=[],va=0;va<T.length;va++)(h.isTableCell(T[va])|| h.isTableRow(T[va]))&&ua.push(T[va]);0<ua.length&&h.setCellStyles(z,"inherit",ua)}}),h.shapeForegroundColor,null,null,x);x.style.fontWeight="bold";x.appendChild(l);var C=p.cloneNode(!1);C.style.position="relative";var F=mxUtils.bind(this,function(T,ua,va,Ka,Sa){T=this.editorUi.menus.styleChange(T,"",Ka,Sa,"");Ka=document.createElement("div");this.addDashPattern(Ka,va);T.firstChild.firstChild.className="geStyleMenuItem";T.firstChild.firstChild.style.width=ua+"px";T.firstChild.firstChild.appendChild(Ka); return T}),G=[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],H=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){F(T,110,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));F(T,110,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");F(T,110,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");F(T,110,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");F(T,110,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title", mxResources.get("dashed")+" (4)");F(T,110,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)");F(T,110,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");F(T,110,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");T.addItem("",null,mxUtils.bind(this,function(){c.prompt(mxResources.get("pattern"),mxUtils.getValue(k.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(ua){c.menus.createStyleChangeFunction(G, ["1",ua])()}),!0)})).firstChild.appendChild(b(110))})),"",null,C),J=C.cloneNode(!1),O=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){var ua=[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,mxConstants.STYLE_DASHED,"width"];Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,[null,null,null,null,null],"",null,null,null,!0,Format.connectionImage.src)).setAttribute("title",mxResources.get("line"));Format.processMenuIcon(this.editorUi.menus.styleChange(T, "",ua,["link",null,null,null,null],"",null,null,null,!0,Format.linkEdgeImage.src)).setAttribute("title",mxResources.get("link"));Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,["flexArrow",null,null,null,null],"",null,null,null,!0,Format.arrowImage.src)).setAttribute("title",mxResources.get("arrow"));Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,["arrow",null,null,null,null],"",null,null,null,!0,Format.simpleArrowImage.src)).setAttribute("title",mxResources.get("simpleArrow")); Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,["filledEdge",null,null,null,null],"",null,null,null,!0,Format.filledEdgeImage.src)).setAttribute("title","Filled Edge");Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,["pipe",null,null,null,null],"",null,null,null,!0,Format.pipeEdgeImage.src)).setAttribute("title","Pipe");Format.processMenuIcon(this.editorUi.menus.styleChange(T,"",ua,["wire",null,null,"1",null],"",null,null,null,!0,Format.wireEdgeImage.src)).setAttribute("title", "Wire")})),"",null,J);O.setAttribute("title",mxResources.get("connection"));v=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){F(T,44,"solid",G,[null,null]).setAttribute("title",mxResources.get("solid"));F(T,44,"dashed",G,["1",null]).setAttribute("title",mxResources.get("dashed")+" (1)");F(T,44,"8 8",G,["1","8 8"]).setAttribute("title",mxResources.get("dashed")+" (2)");F(T,44,"12 12",G,["1","12 12"]).setAttribute("title",mxResources.get("dashed")+" (3)");F(T,44,"8 4 1 4",G,["1","8 4 1 4"]).setAttribute("title", mxResources.get("dashed")+" (4)");F(T,44,"dotted",G,["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)");F(T,44,"1 2",G,["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)");F(T,44,"1 4",G,["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)");T.addItem("",null,mxUtils.bind(this,function(){c.prompt(mxResources.get("pattern"),mxUtils.getValue(k.style,mxConstants.STYLE_DASH_PATTERN,"8 4 1 4"),mxUtils.bind(this,function(ua){c.menus.createStyleChangeFunction(G, ["1",ua])()}),!0)})).firstChild.appendChild(b(44))})),"",null,J);u=C.cloneNode(!1);var M=document.createElement("input");M.style.position="absolute";M.style.width="52px";M.style.left="148px";M.setAttribute("title",mxResources.get("linewidth"));C.appendChild(M);var V=M.cloneNode(!0);V.style.width="56px";V.style.left="144px";J.appendChild(V);var Q=this.createStepper(M,d,this.getUnitStep(),null,null,this.isFloatUnit());Q.style.display=M.style.display;C.appendChild(Q);Q=this.createStepper(V,e,this.getUnitStep(), null,null,this.isFloatUnit());Q.style.display=V.style.display;J.appendChild(Q);mxEvent.addListener(M,"blur",d);mxEvent.addListener(M,"change",d);mxEvent.addListener(V,"blur",e);mxEvent.addListener(V,"change",e);var ma=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){"arrow"!=k.style.shape&&(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],[null,null,null,null],null,null,!0,Format.straightImage.src)).setAttribute("title", mxResources.get("straight")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["orthogonalEdgeStyle",null,null,null],null,null,!0,Format.orthogonalImage.src)).setAttribute("title",mxResources.get("orthogonal")),"undefined"!==typeof LibavoidRouting&&Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE, "libavoidRouting"],["orthogonalEdgeStyle",null,null,"1"],null,null,!0,Format.libavoidImage.src,function(ua,va){LibavoidRouting.autoReroute(ua,va)})).setAttribute("title",mxResources.get("libavoidAutoRoute")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["elbowEdgeStyle","vertical",null,null,null],null,null,!0,Format.verticalElbowImage.src)).setAttribute("title", mxResources.get("horizontal")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["elbowEdgeStyle",null,null,null,null],null,null,!0,Format.horizontalElbowImage.src)).setAttribute("title",mxResources.get("vertical")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE, "libavoidRouting"],["isometricEdgeStyle",null,null,null,null],null,null,!0,Format.horizontalIsometricImage.src)).setAttribute("title",mxResources.get("isometric")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["isometricEdgeStyle","vertical",null,null,null],null,null,!0,Format.verticalIsometricImage.src)).setAttribute("title",mxResources.get("isometric")),Graph.edgeSupportsCurved(k.style)&& Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["orthogonalEdgeStyle","1",null,null],null,null,!0,Format.curvedImage.src)).setAttribute("title",mxResources.get("curved")),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE,"libavoidRouting"],["entityRelationEdgeStyle",null,null,null],null,null, !0,Format.entityImage.src)).setAttribute("title",mxResources.get("entityRelation")))})),"",null,u);ma.setAttribute("title",mxResources.get("waypoints"));var ia=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){if("connector"==k.style.shape||"flexArrow"==k.style.shape||"filledEdge"==k.style.shape||"wire"==k.style.shape||"pipe"==k.style.shape||"mxgraph.basic.arc"==k.style.shape){var ua=mxUtils.getValue(k.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE),va=mxUtils.getValue(k.style,"endFill", "1");ua==mxConstants.NONE||mxUtils.getValue(k.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)==ua&&mxUtils.getValue(k.style,"startSize","1")==mxUtils.getValue(k.style,"endSize","1")&&mxUtils.getValue(k.style,"startFill","1")==va||Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill","startSize"],[ua,va,mxUtils.getValue(k.style,"endSize")],null,null,!1,c.getImageForMarker(ua,va,k.style.shape,k.style.shape))).setAttribute("title",mxResources.get("copy")); Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.NONE,0],null,null,!1,Format.noMarkerImage.src)).setAttribute("title",mxResources.get("none"));"connector"==k.style.shape||"filledEdge"==k.style.shape||"wire"==k.style.shape||"pipe"==k.style.shape||"mxgraph.basic.arc"==k.style.shape?(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,1],null,null,!1, Format.classicFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,1],null,null,!1,Format.classicThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OPEN,0],null,null,!1,Format.openFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW, "startFill"],[mxConstants.ARROW_OPEN_THIN,0],null,null,!1,Format.openThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["openAsync",0],null,null,!1,Format.openAsyncFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,1],null,null,!1,Format.blockFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN,1],null,null,!1,Format.blockThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",1],null,null,!1,Format.asyncFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,1],null,null,!1,Format.ovalFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND,1],null,null,!1,Format.diamondFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,1],null,null,!1,Format.diamondThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,0],null,null,!1,Format.classicMarkerImage.src)), Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,0],null,null,!1,Format.classicThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,0],null,null,!1,Format.blockMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN, 0],null,null,!1,Format.blockThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",0],null,null,!1,Format.asyncMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,0],null,null,!1,Format.ovalMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND, 0],null,null,!1,Format.diamondMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,0],null,null,!1,Format.diamondThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["box",0],null,null,!1,Format.boxMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"], ["halfCircle",0],null,null,!1,Format.halfCircleMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["dash",0],null,null,!1,Format.dashMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["cross",0],null,null,!1,Format.crossMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circlePlus", 0],null,null,!1,Format.circlePlusMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circle",1],null,null,!1,Format.circleMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["baseDash",0],null,null,!1,Format.baseDashMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERone",0], null,null,!1,Format.EROneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmandOne",0],null,null,!1,Format.ERmandOneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmany",0],null,null,!1,Format.ERmanyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERoneToMany",0], null,null,!1,Format.ERoneToManyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToOne",0],null,null,!1,Format.ERzeroToOneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"], ["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW,"startFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src))):Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,null,!1,Format.blockMarkerImage.src)).setAttribute("title",mxResources.get("block"));T.div.style.width="40px";window.setTimeout(mxUtils.bind(this, function(){null!=T.div&&mxUtils.fit(T.div)}),0)}})),"",null,u),na=c.toolbar.addMenu(new Menu(mxUtils.bind(this,function(T){if("connector"==k.style.shape||"flexArrow"==k.style.shape||"filledEdge"==k.style.shape||"wire"==k.style.shape||"pipe"==k.style.shape||"mxgraph.basic.arc"==k.style.shape){var ua=mxUtils.getValue(k.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE),va=mxUtils.getValue(k.style,"startFill","1");ua==mxConstants.NONE||mxUtils.getValue(k.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)== ua&&mxUtils.getValue(k.style,"endSize","1")==mxUtils.getValue(k.style,"startSize","1")&&mxUtils.getValue(k.style,"endFill","1")==va||Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill","endSize"],[ua,va,mxUtils.getValue(k.style,"startSize")],null,null,!1,c.getImageForMarker(ua,va,k.style.shape,k.style.shape)),"scaleX(-1)").setAttribute("title",mxResources.get("copy"));Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW, "endFill"],[mxConstants.NONE,0],null,null,!1,Format.noMarkerImage.src)).setAttribute("title",mxResources.get("none"));"connector"==k.style.shape||"filledEdge"==k.style.shape||"wire"==k.style.shape||"pipe"==k.style.shape||"mxgraph.basic.arc"==k.style.shape?(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,1],null,null,!1,Format.classicFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,1],null,null,!1,Format.classicThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN,0],null,null,!1,Format.openFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN_THIN,0],null,null,!1,Format.openThinFilledMarkerImage.src), "scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["openAsync",0],null,null,!1,Format.openAsyncFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,1],null,null,!1,Format.blockFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK_THIN, 1],null,null,!1,Format.blockThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",1],null,null,!1,Format.asyncFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,1],null,null,!1,Format.ovalFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"", [mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,1],null,null,!1,Format.diamondFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,1],null,null,!1,Format.diamondThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,0],null,null,!1,Format.classicMarkerImage.src), "scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,0],null,null,!1,Format.classicThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,0],null,null,!1,Format.blockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"], [mxConstants.ARROW_BLOCK_THIN,0],null,null,!1,Format.blockThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",0],null,null,!1,Format.asyncMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,0],null,null,!1,Format.ovalMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,0],null,null,!1,Format.diamondMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,0],null,null,!1,Format.diamondThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["box",0],null,null,!1,Format.boxMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],["halfCircle",0],null,null,!1,Format.halfCircleMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["dash",0],null,null,!1,Format.dashMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["cross",0],null,null,!1,Format.crossMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],["circlePlus",0],null,null,!1,Format.circlePlusMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["circle",0],null,null,!1,Format.circleMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["baseDash",0],null,null,!1,Format.baseDashMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],["ERone",0],null,null,!1,Format.EROneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmandOne",0],null,null,!1,Format.ERmandOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmany",0],null,null,!1,Format.ERmanyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],["ERoneToMany",0],null,null,!1,Format.ERoneToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToOne",0],null,null,!1,Format.ERzeroToOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T, "",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src),"scaleX(-1)")):Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(T,"",[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,null,!1,Format.blockMarkerImage.src),"scaleX(-1)").setAttribute("title", mxResources.get("block"));T.div.style.width="40px";window.setTimeout(mxUtils.bind(this,function(){null!=T.div&&mxUtils.fit(T.div)}),0)}})),"",null,u);O.style.width="67px";O.style.marginRight="2px";v.style.width="67px";v.style.marginRight="2px";ma.style.width="67px";ma.style.marginRight="2px";ia.style.width="67px";ia.style.marginRight="2px";na.style.width="67px";na.style.marginRight="2px";this.addArrow(O).appendChild(document.createElement("div"));this.addArrow(ma).appendChild(document.createElement("div")); this.addArrow(ia);this.addArrow(na);H.style.width="142px";H=this.addArrow(H);v=this.addArrow(v);var Z=document.createElement("div");Z.className="gePatternPreview";Z.style.width="100px";Z.style.borderBottomStyle="solid";H.appendChild(Z);var da=document.createElement("div");da.className="gePatternPreview";da.style.width="36px";da.style.borderBottomStyle="solid";v.appendChild(da);a.appendChild(x);a.appendChild(J);a.appendChild(C);x=C.cloneNode(!1);x.style.display="block";x.style.height="60px";x.style.paddingTop= "2px";x.style.paddingBottom="10px";x.style.overflow="visible";v=document.createElement("div");v.style.position="absolute";v.style.maxWidth="78px";v.style.overflow="hidden";v.style.textOverflow="ellipsis";v.style.marginTop="4px";v.style.fontWeight="normal";mxUtils.write(v,mxResources.get("size"));v.setAttribute("title",mxResources.get("size"));x.appendChild(v);var pa=this.addUnitInput(x,this.getUnit(),82,52,function(){R.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());pa.setAttribute("title", mxResources.get("linestart"));var ka=this.addUnitInput(x,this.getUnit(),16,52,function(){ba.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());ka.setAttribute("title",mxResources.get("lineend"));mxUtils.br(x);H=document.createElement("div");H.style.height="12px";x.appendChild(H);v=Q=v.cloneNode(!1);mxUtils.write(v,mxResources.get("spacing"));v.setAttribute("title",mxResources.get("spacing"));x.appendChild(v);var S=this.addUnitInput(x,this.getUnit(),82,52,function(){ea.apply(this, arguments)},this.getUnitStep(),null,null,this.isFloatUnit());S.setAttribute("title",mxResources.get("linestart"));var U=this.addUnitInput(x,this.getUnit(),16,52,function(){la.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());U.setAttribute("title",mxResources.get("lineend"));H=document.createElement("div");H.style.height="20px";x.appendChild(H);this.addLabel(x,mxResources.get("linestart"),82,62).style.fontSize="10px";this.addLabel(x,mxResources.get("lineend"),16,62).style.fontSize= "10px";mxUtils.br(x);p=p.cloneNode(!1);p.className="geFormatEntry";v=document.createElement("div");mxUtils.write(v,mxResources.get("perimeter"));v.setAttribute("title",mxResources.get("perimeter"));p.appendChild(v);var Y=this.addUnitInput(p,this.getUnit(),16,52,function(){sa.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());Y.setAttribute("title",mxResources.get("perimeter"));k.edges.length==k.cells.length?(a.appendChild(u),a.appendChild(x)):k.vertices.length==k.cells.length&& ("mxgraph.basic.arc"==k.style.shape&&(ma.style.visibility="hidden",a.appendChild(u),H.style.display="none",Q.style.display="none",S.style.display="none",S.nextSibling.style.display="none",U.style.display="none",U.nextSibling.style.display="none",a.appendChild(x)),a.appendChild(p));var N=mxUtils.bind(this,function(T,ua,va){function Ka(Sa,Ua,ta,Fa){ta=ta.getElementsByTagName("div")[0];null!=ta&&c.updateCssForMarker(ta,Fa,k.style.shape,Sa,Ua);return ta}k=c.getSelectionState();if(va||document.activeElement!= M)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)),M.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();if(va||document.activeElement!=V)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)),V.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();l.style.visibility=0<k.edges.length&&Graph.edgeSupportsCurved(k.style)?"":"hidden";"1"==mxUtils.getValue(k.style,mxConstants.STYLE_CURVED,null)?l.value="curved":"1"==mxUtils.getValue(k.style,mxConstants.STYLE_ROUNDED, null)&&(l.value="rounded");Z.style.borderBottom="1px solid black";"1"==mxUtils.getValue(k.style,mxConstants.STYLE_DASHED,null)&&(T=mxUtils.getValue(k.style,mxConstants.STYLE_DASH_PATTERN,""),2<=String(T).split(" ").length?(Z.style.borderBottom="1px solid transparent",this.addDashPattern(Z,T)):Z.style.borderBottom="1px dashed black");da.style.backgroundImage=Z.style.backgroundImage;da.style.backgroundPosition=Z.style.backgroundPosition;da.style.backgroundSize=Z.style.backgroundSize;da.style.backgroundRepeat= Z.style.backgroundRepeat;da.style.borderBottom=Z.style.borderBottom;T=ma.getElementsByTagName("div")[1];null!=T&&(T.style.backgroundImage="url("+c.getImageForEdgeStyle(k.style)+")");T=O.getElementsByTagName("div")[1];null!=T&&(T.style.backgroundImage="url("+c.getImageForEdgeShape(k.style)+")");k.edges.length==k.cells.length?(J.style.display="",C.style.display="none"):(J.style.display="none",C.style.display="");Graph.lineJumpsEnabled&&0<k.edges.length&&0==k.vertices.length&&k.lineJumps&&(a.style.borderBottomStyle= "none");Ka(mxUtils.getValue(k.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(k.style,"startFill","1"),ia,"start");Ka(mxUtils.getValue(k.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(k.style,"endFill","1"),na,"end");mxUtils.setOpacity(ma,"arrow"==k.style.shape?30:100);"connector"!=k.style.shape&&"flexArrow"!=k.style.shape&&"filledEdge"!=k.style.shape&&"wire"!=k.style.shape&&"pipe"!=k.style.shape&&"mxgraph.basic.arc"!=k.style.shape&&(mxUtils.setOpacity(ia,30),mxUtils.setOpacity(na, 30));if(va||document.activeElement!=pa)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)),pa.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();if(va||document.activeElement!=S)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0)),S.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();if(va||document.activeElement!=ka)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE)),ka.value= isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();if(va||document.activeElement!=S)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0)),U.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit();if(va||document.activeElement!=Y)T=parseFloat(mxUtils.getValue(k.style,mxConstants.STYLE_PERIMETER_SPACING,0)),Y.value=isNaN(T)?"":this.inUnit(T)+" "+this.getUnit()});var R=this.installInputHandler(pa,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "), null,this.isFloatUnit(),!0);var ea=this.installInputHandler(S,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ba=this.installInputHandler(ka,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var la=this.installInputHandler(U,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var sa=this.installInputHandler(Y,mxConstants.STYLE_PERIMETER_SPACING, 0,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(M,N);this.addKeyHandler(pa,N);this.addKeyHandler(S,N);this.addKeyHandler(ka,N);this.addKeyHandler(U,N);this.addKeyHandler(Y,N);h.getModel().addListener(mxEvent.CHANGE,N);this.listeners.push({destroy:function(){h.getModel().removeListener(N)}});N();return a}; StyleFormatPanel.prototype.addLineJumps=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState();a.style.height="22px";if(Graph.lineJumpsEnabled&&0<e.edges.length&&0==e.vertices.length&&e.lineJumps){a.style.display="flex";a.style.alignItems="center";var g=document.createElement("div");g.style.position="absolute";g.style.maxWidth="72px";g.style.overflow="hidden";g.style.textOverflow="ellipsis";mxUtils.write(g,mxResources.get("lineJumps"));g.setAttribute("title",mxResources.get("lineJumps")); a.appendChild(g);var c=document.createElement("select");c.setAttribute("title",mxResources.get("lineJumps"));c.style.left="72px";c.style.width="72px";g=["none","arc","gap","sharp","line"];for(var h=0;h<g.length;h++){var k=document.createElement("option");k.setAttribute("value",g[h]);mxUtils.write(k,mxResources.get(g[h]));c.appendChild(k)}mxEvent.addListener(c,"change",function(x){d.getModel().beginUpdate();try{d.setCellStyles("jumpStyle",c.value,e.cells),b.fireEvent(new mxEventObject("styleChanged", "keys",["jumpStyle"],"values",[c.value],"cells",e.cells))}finally{d.getModel().endUpdate()}mxEvent.consume(x)});mxEvent.addListener(c,"click",function(x){mxEvent.consume(x)});a.appendChild(c);var p=this.addUnitInput(a,this.getUnit(),16,52,function(){l.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());p.setAttribute("title",mxResources.get("size"));var l=this.installInputHandler(p,"jumpSize",Graph.defaultJumpSize,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var u=mxUtils.bind(this, function(x,v,z){e=b.getSelectionState();c.value=mxUtils.getValue(e.style,"jumpStyle","none");if(z||document.activeElement!=p)x=parseFloat(mxUtils.getValue(e.style,"jumpSize",Graph.defaultJumpSize)),p.value=isNaN(x)?"":this.inUnit(x)+" "+this.getUnit()});this.addKeyHandler(p,u);d.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){d.getModel().removeListener(u)}});u()}else a.style.display="none";return a}; StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,d=b.editor.graph,e=b.getSelectionState(),g=document.createElement("table");g.className="geFullWidthElement";g.style.fontWeight="bold";g.style.tableLayout="fixed";var c=document.createElement("tbody"),h=document.createElement("tr");h.style.padding="0px";var k=document.createElement("td");k.style.padding="0px";k.style.width="50%";k.style.verticalAlign="top";var p=k.cloneNode(!0);p.style.paddingLeft="8px";h.appendChild(k);h.appendChild(p); c.appendChild(h);g.appendChild(c);a.appendChild(g);var l=k,u=mxUtils.bind(this,function(v,z,C,F){v=this.createCellOption(v,z,C,null,null,F);v.style.alignItems="top";l.appendChild(v);l=l==k?p:k;return v}),x=mxUtils.bind(this,function(v,z,C){e=b.getSelectionState();k.innerText="";p.innerText="";l=k;e.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);e.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1);u(mxResources.get("sketch"),"sketch",0,function(G,H){d.updateCellStyles({sketch:H? "1":null,curveFitting:H?Editor.sketchDefaultCurveFitting:null,jiggle:H?Editor.sketchDefaultJiggle:null},G)});e.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);v=u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(v.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(v,60));0<e.edges.length&&0==e.vertices.length&&u(mxResources.get("flowAnimation"),"flowAnimation",0);if(null!=e.customProperties)for(var F in e.customProperties)v= e.customProperties[F],null!=v&&"bool"==v.type&&v.primary&&("function"!==typeof v.isVisible||v.isVisible(e,this))&&u(v.dispName,F,v.defVal?"1":"0")});d.getModel().addListener(mxEvent.CHANGE,x);this.listeners.push({destroy:function(){d.getModel().removeListener(x)}});x();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,d){BaseFormatPanel.call(this,a,b,d);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,d=document.createElement("div");d.className="geFormatEntry";var e=document.createElement("input");e.setAttribute("type","checkbox");e.setAttribute("title",mxResources.get("sketch"));e.checked=Editor.sketchMode;d.appendChild(e);mxUtils.write(d,mxResources.get("sketch"));d.setAttribute("title",mxResources.get("sketch"));mxEvent.addListener(d,"click",function(h){if(b.isEnabled()){var k=!Editor.sketchMode; b.updateCellStyles({sketch:k?"1":null,curveFitting:k?Editor.sketchDefaultCurveFitting:null,jiggle:k?Editor.sketchDefaultJiggle:null},b.getVerticesAndEdges());a.setSketchMode(k);mxEvent.consume(h)}});var g=function(){for(var h=b.getVerticesAndEdges(),k=0<h.length,p=0;p<h.length;p++){var l=b.getCellStyle(h[p]);if(0==mxUtils.getValue(l,mxConstants.STYLE_ROUNDED,0)){k=!1;break}}return k};e=document.createElement("div");e.className="geFormatEntry";var c=document.createElement("input");c.setAttribute("type", "checkbox");c.setAttribute("title",mxResources.get("rounded"));c.checked=g();e.appendChild(c);mxUtils.write(e,mxResources.get("rounded"));e.setAttribute("title",mxResources.get("rounded"));mxEvent.addListener(e,"click",function(h){if(b.isEnabled()){var k=!g();b.updateCellStyles({rounded:k?"1":"0"},b.getVerticesAndEdges());k?(b.currentEdgeStyle.rounded="1",b.currentVertexStyle.rounded="1"):(delete b.currentEdgeStyle.rounded,delete b.currentVertexStyle.rounded);mxEvent.consume(h)}});d=[e,d];if(!b.isEnabled())for(e= 0;e<d.length;e++)"BUTTON"==d[e].nodeName?d[e].setAttribute("disabled","disabled"):(c=d[e].getElementsByTagName("input"),0<c.length&&c[0].setAttribute("disabled","disabled"));return d}; DiagramStylePanel.prototype.addView=function(a){var b=this.editorUi,d=b.editor.graph;if(d.isEnabled()){for(var e=function(){var u=document.createElement("div");u.className="geFormatEntry";var x=document.createElement("div");x.style.display="flex";x.style.alignItems="center";x.style.justifyContent="center";x.style.gap="8px";x.style.width="204px";u.appendChild(x);a.appendChild(u);return x},g=e(),c=this.getGlobalStyleButtons(),h=0;h<c.length;h++){var k=c[h];k.style.flex="0 1 auto";k.style.minWidth="0"; var p=k.lastChild;if(null!=p&&3==p.nodeType){var l=document.createElement("span");l.style.overflow="hidden";l.style.textOverflow="ellipsis";l.style.whiteSpace="nowrap";l.style.minWidth="0";l.appendChild(p);k.appendChild(l)}g.appendChild(k)}e=e();g=this.createOption(mxResources.get("shadow"),function(){return d.shadowVisible},function(u){var x=new ChangePageSetup(b);x.ignoreColor=!0;x.ignoreImage=!0;x.shadowVisible=u;d.model.execute(x)},{install:function(u){this.listener=function(){u(d.shadowVisible)}; d.addListener("shadowVisibleChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});g.style.flex="0 1 auto";g.style.minWidth="0";Editor.enableShadowOption||(g.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(g,60));e.appendChild(g);mxUtils.lightDarkColorSupported&&(g=document.createElement("img"),g.setAttribute("title",mxResources.get("light")+"/"+mxResources.get("dark")),g.setAttribute("src",Editor.contrastImage),g.className="geButton", g.style.width="18px",g.style.height="18px",g.style.flex="0 0 auto",mxEvent.addListener(g,"click",function(){d.isEnabled()&&b.setDarkMode(!Editor.isDarkMode())}),e.appendChild(g));null!=Editor.styles&&this.addGraphStyles(a)}return a}; DiagramStylePanel.prototype.addGraphStyles=function(a){var b=this.editorUi,d=b.editor.graph,e=d.getModel(),g=d.view.gridColor,c=["fillColor","strokeColor","fontColor","gradientColor"];a.style.whiteSpace="normal";var h=mxUtils.bind(this,function(V,Q){var ma=d.getVerticesAndEdges();e.beginUpdate();try{for(var ia=0;ia<ma.length;ia++){var na=d.getCellStyle(ma[ia]);p||null==na.labelBackgroundColor?p&&d.updateCellStyles({labelBackgroundColor:mxConstants.NONE},[ma[ia]]):d.updateCellStyles({labelBackgroundColor:null!= Q?Q.background:null},[ma[ia]]);for(var Z=e.isEdge(ma[ia]),da=e.getStyle(ma[ia]),pa=Z?d.currentEdgeStyle:d.currentVertexStyle,ka=0;ka<V.length;ka++)if(null!=na[V[ka]]&&na[V[ka]]!=mxConstants.NONE||V[ka]!=mxConstants.STYLE_FILLCOLOR&&V[ka]!=mxConstants.STYLE_STROKECOLOR)da=p&&Z&&V[ka]==mxConstants.STYLE_FONTCOLOR?mxUtils.setStyle(da,V[ka],"default"):mxUtils.setStyle(da,V[ka],pa[V[ka]]);e.setStyle(ma[ia],da)}}finally{e.endUpdate()}}),k=mxUtils.bind(this,function(V,Q,ma){if(null!=V)for(var ia=0;ia<Q.length;ia++)if(null!= V[Q[ia]]&&V[Q[ia]]!=mxConstants.NONE||Q[ia]!=mxConstants.STYLE_FILLCOLOR&&Q[ia]!=mxConstants.STYLE_STROKECOLOR)V[Q[ia]]=ma[Q[ia]]}),p=!0,l=mxUtils.bind(this,function(V,Q,ma,ia,na){if(null!=V){null!=ma&&(p||null==Q.labelBackgroundColor?p&&(Q.labelBackgroundColor=mxConstants.NONE):(ia=null!=ia?ia.background:null,na=null!=na?na:d,null==ia&&(ia=na.background),null==ia&&(ia=na.defaultPageBackgroundColor),Q.labelBackgroundColor=ia));for(var Z in V)if(null==ma||null!=Q[Z]&&Q[Z]!=mxConstants.NONE||Z!=mxConstants.STYLE_FILLCOLOR&& Z!=mxConstants.STYLE_STROKECOLOR)p&&e.isEdge(ma)&&Z==mxConstants.STYLE_FONTCOLOR?Q[Z]="default":Q[Z]=V[Z]}}),u=mxUtils.bind(this,function(V,Q,ma,ia,na){var Z=document.createElement("div");Z.style.position="relative";Z.style.pointerEvents="none";Z.style.width="60px";Z.style.height="60px";na.appendChild(Z);var da=new Graph(Z,null,null,d.getStylesheet());da.shapeForegroundColor="light-dark(#000000, #c0c0c0)";da.shapeBackgroundColor="light-dark(var(--ge-panel-color), var(--ge-dark-panel-color))";da.resetViewOnRootChange= !1;da.foldingEnabled=!1;da.gridEnabled=!1;da.autoScroll=!1;da.setTooltips(!1);da.setConnectable(!1);da.setPanning(!1);da.setEnabled(!1);da.getCellStyle=function(ea,ba){ba=null!=ba?ba:!0;var la=mxUtils.clone(d.getCellStyle.apply(this,arguments)),sa=d.stylesheet.getDefaultVertexStyle(),T=Q;e.isEdge(ea)&&(sa=d.stylesheet.getDefaultEdgeStyle(),T=ma);k(la,c,sa);l(V,la,ea,ia,da);l(T,la,ea,ia,da);ba&&(la=d.postProcessCellStyle(ea,la));return la};da.model.beginUpdate();try{var pa=mxResources.get("shape"), ka=mxResources.get("connector"),S=mxUtils.getValue(d.stylesheet.getDefaultVertexStyle(),mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),U=Math.max(mxUtils.getSizeForString(pa,S,mxConstants.DEFAULT_FONTFAMILY).width,mxUtils.getSizeForString(ka,S,mxConstants.DEFAULT_FONTFAMILY).width),Y=56<U?"fontSize="+Math.max(9,Math.floor(56*S/U))+";":"",N=da.insertVertex(da.getDefaultParent(),null,pa,2,2,56,30,"strokeWidth=2;"+Y),R=da.insertEdge(da.getDefaultParent(),null,ka,N,N,"edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=3;strokeWidth=2;"+ Y);R.geometry.points=[new mxPoint(28,46)];R.geometry.offset=new mxPoint(0,8)}finally{da.model.endUpdate()}na=da.view.getDrawPane().ownerSVGElement;null!=na&&(Z=na.cloneNode(!0),Z.style.position="absolute",Z.style.clipPath="rect(0 52% 100% 0)",na.style.clipPath="rect(0 100% 100% 51%)",na.style.colorScheme="light",na.parentNode.appendChild(Z))}),x=document.createElement("div");x.style.whiteSpace="normal";a.appendChild(x);null==this.format.cachedStyleEntries&&(this.format.cachedStyleEntries=[]);var v= mxUtils.bind(this,function(V,Q,ma,ia,na){var Z=this.format.cachedStyleEntries[na];null==Z&&(Z=document.createElement("div"),Z.className="geGraphStylePreview",p||null==ia||null==ia.background||(Z.style.backgroundColor=ia.background),u(V,Q,ma,ia,Z),mxEvent.addGestureListeners(Z,mxUtils.bind(this,function(da){Z.style.opacity=.6}),null,mxUtils.bind(this,function(da){Z.style.opacity="";d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);l(V,d.currentVertexStyle); l(V,d.currentEdgeStyle);l(Q,d.currentVertexStyle);l(ma,d.currentEdgeStyle);e.beginUpdate();try{var pa=c.slice(),ka;for(ka in V)pa.push(ka);h(pa,ia);if(!p){var S=new ChangePageSetup(b,null!=ia?ia.background:null);S.ignoreImage=!0;e.execute(S);e.execute(new ChangeGridColor(b,null!=ia&&null!=ia.gridColor?ia.gridColor:g))}}finally{e.endUpdate()}})),mxClient.IS_TOUCH||(mxEvent.addListener(Z,"mouseenter",mxUtils.bind(this,function(da){var pa=d.getCellStyle;da=d.background;var ka=d.view.gridColor;p||(d.background= null!=ia?ia.background:null,d.view.gridColor=null!=ia&&null!=ia.gridColor?ia.gridColor:g);d.getCellStyle=function(S,U){U=null!=U?U:!0;var Y=mxUtils.clone(pa.apply(this,arguments)),N=d.stylesheet.getDefaultVertexStyle(),R=Q;e.isEdge(S)&&(N=d.stylesheet.getDefaultEdgeStyle(),R=ma);k(Y,c,N);l(V,Y,S,ia);l(R,Y,S,ia);U&&(Y=this.postProcessCellStyle(S,Y));return Y};d.refresh();d.getCellStyle=pa;d.background=da;d.view.gridColor=ka})),mxEvent.addListener(Z,"mouseleave",mxUtils.bind(this,function(da){d.refresh()}))), this.format.cachedStyleEntries[na]=Z);x.appendChild(Z)}),z=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var C=[],F=mxUtils.bind(this,function(){0<C.length&&(C[this.format.currentStylePage].style.background="#84d7ff");for(var V=10*this.format.currentStylePage;V<Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);V++){var Q=Editor.styles[V];v(Q.commonStyle,Q.vertexStyle,Q.edgeStyle,Q.graph,V)}}),G=mxUtils.bind(this, function(V){0<=V&&V<z&&(C[this.format.currentStylePage].style.background="transparent",x.innerText="",this.format.currentStylePage=V,F())});if(1<z){var H=document.createElement("div");H.className="geSwitcher";H.style.width="200px";for(var J=0;J<z;J++){var O=document.createElement("div");O.className="geSwitcherDot";mxUtils.bind(this,function(V,Q){mxEvent.addListener(O,"click",mxUtils.bind(this,function(){G(V)}))})(J,O);H.appendChild(O);C.push(O)}a.appendChild(H);F();if(15>z&&0<C.length){J=document.createElement("div"); J.className="geButton";J.style.backgroundImage="url("+Editor.chevronLeftImage+")";var M=J.cloneNode(!1);M.style.backgroundImage="url("+Editor.chevronRightImage+")";H.insertBefore(J,C[0]);H.appendChild(M);mxEvent.addListener(J,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage-1,z))}));mxEvent.addListener(M,"click",mxUtils.bind(this,function(){G(mxUtils.mod(this.format.currentStylePage+1,z))}))}}else F();return a}; DiagramFormatPanel=function(a,b,d){BaseFormatPanel.call(this,a,b,d);this.init()};mxUtils.extend(DiagramFormatPanel,BaseFormatPanel);DiagramFormatPanel.showPageView=!0;DiagramFormatPanel.prototype.showBackgroundImageOption=!0; DiagramFormatPanel.prototype.init=function(){var a=this.editorUi.editor.graph,b=this.createCollapsibleSection(mxResources.get("view"),!1);b.contentDiv.appendChild(this.addView(this.createPanel()));this.container.appendChild(b.wrapper);a.isEnabled()&&(a=this.createCollapsibleSection(mxResources.get("options"),!1),a.contentDiv.appendChild(this.addOptions(this.createPanel())),this.container.appendChild(a.wrapper),a=this.createCollapsibleSection(mxResources.get("paperSize"),!0),a.contentDiv.appendChild(this.addPaperSize(this.createPanel())), this.container.appendChild(a.wrapper),this.container.appendChild(this.addStyleOps(this.createPanel())))}; DiagramFormatPanel.prototype.addView=function(a){var b=this.editorUi,d=b.editor.graph;this.addGridOption(a);DiagramFormatPanel.showPageView&&a.appendChild(this.createOption(mxResources.get("pageView"),function(){return d.pageVisible},function(h){b.actions.get("pageView").funct()},{install:function(h){this.listener=function(){h(d.pageVisible)};b.addListener("pageViewChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}}));if(d.isEnabled()&&this.showBackgroundImageOption){var e= function(){return null!=d.backgroundImage||null!=d.background&&d.background!=mxConstants.NONE},g=this.createOption(mxResources.get("background"),e,function(h){h?(h=new ChangePageSetup(b,d.defaultPageBackgroundColor),h.ignoreImage=!0,d.model.execute(h)):d.model.execute(new ChangePageSetup(b,null,null))},{install:function(h){this.listener=function(){h(e())};b.addListener("backgroundColorChanged",this.listener);b.addListener("backgroundImageChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}}), c=g.getElementsByTagName("span")[0];null!=c&&(c.style.maxWidth="80px");c=mxUtils.button(mxResources.get("change")+"...",function(h){b.showBackgroundImageDialog(null,b.editor.graph.backgroundImage,b.editor.graph.background,!0);mxEvent.consume(h)});c.style.position="absolute";c.style.height="22px";c.style.left="102px";c.style.width="110px";c.style.maxWidth=c.style.width;g.appendChild(c);a.appendChild(g)}return a}; DiagramFormatPanel.prototype.addOptions=function(a){var b=this.editorUi,d=b.editor.graph;d.isEnabled()&&(a.appendChild(this.createOption(mxResources.get("connectionArrows"),function(){return d.connectionArrowsEnabled},function(e){b.actions.get("connectionArrows").funct()},{install:function(e){this.listener=function(){e(d.connectionArrowsEnabled)};b.addListener("connectionArrowsChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}})),a.appendChild(this.createOption(mxResources.get("connectionPoints"), function(){return d.connectionHandler.isEnabled()},function(e){b.actions.get("connectionPoints").funct()},{install:function(e){this.listener=function(){e(d.connectionHandler.isEnabled())};b.addListener("connectionPointsChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}})),a.appendChild(this.createOption(mxResources.get("guides"),function(){return d.graphHandler.guidesEnabled},function(e){b.actions.get("guides").funct()},{install:function(e){this.listener=function(){e(d.graphHandler.guidesEnabled)}; b.addListener("guidesEnabledChanged",this.listener)},destroy:function(){b.removeListener(this.listener)}})));return a}; DiagramFormatPanel.prototype.addGridOption=function(a){function b(l){var u=parseFloat(c.value);u=d.fromUnit(Math.max(d.inUnit(1),isNaN(u)?d.inUnit(10):u));u!=g.getGridSize()&&(mxGraph.prototype.gridSize=u,g.setGridSize(u));c.value=d.inUnit(u)+" "+d.getUnit();mxEvent.consume(l)}var d=this,e=this.editorUi,g=e.editor.graph,c=document.createElement("input");c.style.position="absolute";c.style.width="50px";c.setAttribute("title",mxResources.get("gridSize"));c.value=this.inUnit(g.getGridSize())+" "+this.getUnit(); var h=this.createStepper(c,b,this.getUnitStep(),null,null,this.isFloatUnit());c.style.display=g.isGridEnabled()?"":"none";h.style.display=c.style.display;mxEvent.addListener(c,"keydown",function(l){13==l.keyCode?(g.container.focus(),mxEvent.consume(l)):27==l.keyCode&&(c.value=d.inUnit(g.getGridSize())+" "+d.getUnit(),g.container.focus(),mxEvent.consume(l))});mxEvent.addListener(c,"blur",b);mxEvent.addListener(c,"change",b);c.style.left="100px";h.style.left="150px";var k=function(){return"none"!=g.getAdaptiveColors()&& Editor.isDarkMode()},p="light-dark("+mxGraphView.prototype.defaultGridColor+","+mxGraphView.prototype.defaultDarkGridColor+")";p=this.createColorOption(mxResources.get("grid"),function(){return g.isGridEnabled()?g.view.gridColor:null},function(l){var u=g.isGridEnabled();l==mxConstants.NONE?g.setGridEnabled(!1):(g.setGridEnabled(!0),e.setGridColor(l,k()));c.style.display=g.isGridEnabled()?"":"none";h.style.display=c.style.display;u!=g.isGridEnabled()&&(g.defaultGridEnabled=g.isGridEnabled(),e.fireEvent(new mxEventObject("gridEnabledChanged")))}, g.view.gridColor,{install:function(l){this.listener=function(){l(g.isGridEnabled()?g.view.gridColor:mxConstants.NONE)};e.addListener("darkModeChanged",this.listener);e.addListener("gridColorChanged",this.listener);e.addListener("gridEnabledChanged",this.listener)},destroy:function(){e.removeListener(this.listener)}},null,null,p,!0,k,mxResources.get("gridColor"));p.appendChild(c);p.appendChild(h);a.appendChild(p)}; DiagramFormatPanel.prototype.addDocumentProperties=function(a){a.appendChild(this.createTitle(mxResources.get("options")));return a}; DiagramFormatPanel.prototype.addPaperSize=function(a){var b=this.editorUi,d=b.editor.graph,e=PageSetupDialog.addPageFormatPanel(a,"formatpanel",d.pageFormat,function(c){if(null==d.pageFormat||d.pageFormat.width!=c.width||d.pageFormat.height!=c.height)c=new ChangePageSetup(b,null,null,c),c.ignoreColor=!0,c.ignoreImage=!0,d.model.execute(c)});this.addKeyHandler(e.widthInput,function(){e.set(d.pageFormat)});this.addKeyHandler(e.heightInput,function(){e.set(d.pageFormat)});var g=function(){e.set(d.pageFormat)}; b.addListener("pageFormatChanged",g);this.listeners.push({destroy:function(){b.removeListener(g)}});d.getModel().addListener(mxEvent.CHANGE,g);this.listeners.push({destroy:function(){d.getModel().removeListener(g)}});return a};DiagramFormatPanel.prototype.addStyleOps=function(a){this.addActions(a,["editData"]);this.addActions(a,["clearDefaultStyle"]);return a}; DiagramFormatPanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments);this.gridEnabledListener&&(this.editorUi.removeListener(this.gridEnabledListener),this.gridEnabledListener=null)};(function(){function a(f,m,r){mxShape.call(this);this.line=f;this.stroke=m;this.strokewidth=null!=r?r:1;this.updateBoundsFromLine()}function b(){mxSwimlane.call(this)}function d(){mxSwimlane.call(this)}function e(){mxCylinder.call(this)}function g(){mxConnector.call(this)}function c(){mxCylinder.call(this)}function h(){mxActor.call(this)}function k(){mxCylinder.call(this)}function p(){mxCylinder.call(this)}function l(){mxCylinder.call(this)}function u(){mxCylinder.call(this)}function x(){mxShape.call(this)} function v(){mxShape.call(this)}function z(f,m,r,n){mxShape.call(this);this.bounds=f;this.fill=m;this.stroke=r;this.strokewidth=null!=n?n:1}function C(){mxActor.call(this)}function F(){mxCylinder.call(this)}function G(){mxCylinder.call(this)}function H(){mxShape.call(this)}function J(){mxActor.call(this)}function O(){mxActor.call(this)}function M(){mxActor.call(this)}function V(){mxActor.call(this)}function Q(){mxActor.call(this)}function ma(){mxActor.call(this)}function ia(){mxActor.call(this)}function na(f, m){this.canvas=f;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=m;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,na.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,na.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,na.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,na.prototype.quadTo);this.originalCurveTo= this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,na.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,na.prototype.arcTo)}function Z(){mxRectangleShape.call(this)}function da(){mxRectangleShape.call(this)}function pa(){mxActor.call(this)}function ka(){mxActor.call(this)}function S(){mxActor.call(this)}function U(){mxActor.call(this)}function Y(){mxRectangleShape.call(this)}function N(){mxRectangleShape.call(this)}function R(){mxCylinder.call(this)} function ea(){mxShape.call(this)}function ba(){mxShape.call(this)}function la(){mxEllipse.call(this)}function sa(){mxShape.call(this)}function T(){mxShape.call(this)}function ua(f,m){function r(){mxShape.call(this)}mxUtils.extend(r,mxShape);r.prototype.iconSize=m;r.prototype.paintBackground=function(n,t,w,y,L){L=Math.min(this.iconSize,y,L);t+=(y-L)/2;f.prototype.hasOwnProperty("paintVertexShape")?f.prototype.paintVertexShape.call(this,n,t,w,L,L):(f.prototype.paintBackground.call(this,n,t,w,L,L),"function"=== typeof f.prototype.paintForeground&&f.prototype.paintForeground.call(this,n,t,w,L,L))};return r}function va(){mxShape.call(this)}function Ka(){mxShape.call(this)}function Sa(){mxShape.call(this)}function Ua(){mxShape.call(this)}function ta(){mxShape.call(this)}function Fa(){mxRectangleShape.call(this)}function Ma(){mxShape.call(this)}function ab(){mxShape.call(this)}function Za(){mxShape.call(this)}function Xa(){mxShape.call(this)}function Va(){mxShape.call(this)}function ja(){mxCylinder.call(this)} function ya(){mxCylinder.call(this)}function db(){mxRectangleShape.call(this)}function mb(){mxDoubleEllipse.call(this)}function kb(){mxDoubleEllipse.call(this)}function zb(){mxArrowConnector.call(this);this.spacing=0}function ub(){mxArrowConnector.call(this);this.spacing=0}function ib(){mxActor.call(this)}function tb(){mxRectangleShape.call(this)}function rb(){mxActor.call(this)}function eb(){mxActor.call(this)}function fb(){mxActor.call(this)}function jb(){mxActor.call(this)}function vb(){mxActor.call(this)} function nb(){mxActor.call(this)}function Vb(){mxActor.call(this)}function Gb(){mxActor.call(this)}function Hb(){mxActor.call(this)}function Lb(){mxActor.call(this)}function Mb(){mxEllipse.call(this)}function Wb(){mxEllipse.call(this)}function Tb(){mxEllipse.call(this)}function $b(){mxRhombus.call(this)}function Xb(){mxEllipse.call(this)}function Yb(){mxEllipse.call(this)}function Ib(){mxEllipse.call(this)}function lb(){mxEllipse.call(this)}function Nb(){mxActor.call(this)}function Ab(){mxActor.call(this)} function Db(){mxActor.call(this)}function bb(f,m,r,n){mxShape.call(this);this.bounds=f;this.fill=m;this.stroke=r;this.strokewidth=null!=n?n:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Bb(){mxConnector.call(this)}function sb(){mxConnector.call(this)}function Ob(){mxActor.call(this)}function Eb(f,m,r,n,t,w,y,L,E,fa){y+=E;var W=n.clone();n.x-=t*(2*y+E);n.y-=w*(2*y+E);t*=y+E;w*=y+E;return function(){f.ellipse(W.x-t-y,W.y-w-y,2*y,2* y);fa?f.fillAndStroke():f.stroke()}}function gb(){mxRectangleShape.call(this)}function wb(){mxActor.call(this)}function Zb(){mxShape.call(this)}function ob(){mxShape.call(this)}function Ub(){mxActor.call(this)}function Pb(){mxActor.call(this)}function Jb(){mxActor.call(this)}function Qb(){mxActor.call(this)}function Kb(){mxConnector.call(this)}var q=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(f){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null== this.stencil.labelBounds){for(var m=this.stencil.desc.getElementsByTagName("labelBounds"),r=[],n=0;n<m.length;n++)r.push({condition:m[n].getAttribute("if"),x:Number(m[n].getAttribute("x")||0),y:Number(m[n].getAttribute("y")||0),w:Number(m[n].getAttribute("w")||this.stencil.w0),h:Number(m[n].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=r}for(n=0;n<this.stencil.labelBounds.length;n++)if(m=this.stencil.labelBounds[n],null==m.condition||"1"==mxUtils.getValue(this.style,m.condition,"0")){n= this.stencil.computeAspect(this.style,f.x,f.y,f.width,f.height);r=n.x-f.x+m.x*n.width;var t=n.y-f.y+m.y*n.height;return new mxRectangle(r,t,f.width-r-m.w*n.width,f.height-t-m.h*n.height)}}return q.apply(this,arguments)};mxUtils.extend(a,mxShape);a.prototype.updateBoundsFromLine=function(){var f=null;if(null!=this.line)for(var m=0;m<this.line.length;m++){var r=this.line[m];null!=r&&(r=new mxRectangle(r.x,r.y,this.strokewidth,this.strokewidth),null==f?f=r:f.add(r))}this.bounds=null!=f?f:new mxRectangle}; a.prototype.paintVertexShape=function(f,m,r,n,t){this.paintTableLine(f,this.line,0,0)};a.prototype.paintTableLine=function(f,m,r,n){if(null!=m){var t=null;f.begin();for(var w=0;w<m.length;w++){var y=m[w];null!=y&&(null==t?f.moveTo(y.x+r,y.y+n):null!=t&&f.lineTo(y.x+r,y.y+n));t=y}f.end();f.stroke()}};a.prototype.intersectsRectangle=function(f){var m=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var r=null,n=0;n<this.line.length&&!m;n++){var t=this.line[n];null!= t&&null!=r&&(m=mxUtils.rectangleIntersectsSegment(f,r,t));r=t}return m};mxCellRenderer.registerShape("tableLine",a);mxUtils.extend(b,mxSwimlane);b.prototype.fixedHeaderDefault=!1;b.prototype.paintVertexShape=function(f,m,r,n,t){var w=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,y=this.isHorizontal(),L=this.getTitleSize(),E=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==L&&this.isRounded&&!this.outline?(E=mxShape.prototype.getArcSize.call(this, n,t),f.begin(),f.roundrect(m,r,n,t,E,E),f.fillAndStroke()):0==L&&!E||this.outline?Ib.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),f.translate(-m,-r));w||this.outline||!(y&&L<t||!y&&L<n)||this.paintForeground(f,m,r,n,t)};b.prototype.paintForeground=function(f,m,r,n,t){if(null!=this.state){var w=this.flipH,y=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var L=w;w=y;y=L}f.rotate(-this.getShapeRotation(), w,y,m+n/2,r+t/2);s=this.scale;m=this.bounds.x/s;r=this.bounds.y/s;n=this.bounds.width/s;t=this.bounds.height/s;this.paintTableForeground(f,m,r,n,t)}};b.prototype.paintTableForeground=function(f,m,r,n,t){n=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(t=0;t<n.length;t++)a.prototype.paintTableLine(f,n[t],m,r)};b.prototype.configurePointerEvents=function(f){0==this.getTitleSize()? f.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",b);mxUtils.extend(d,b);d.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",d);var A=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(f,m,r,n,t){A.apply(this,arguments);if(null!=this.state&&!this.outline){var w=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!= mxConstants.NONE)&&null!=w.paintTableCellLines){var y=this.state.cell;if(null!=w.isTableRow&&w.isTableRow(y)){var L=this.getTitleSize();this.isHorizontal()?w.paintTableCellLines(f,y,0,0,n,Math.min(L,t),this.stroke,this.strokewidth):w.paintTableCellLines(f,y,0,0,Math.min(L,n),t,this.stroke,this.strokewidth)}else w.paintTableCellLines(f,y,0,0,n,t,this.stroke,this.strokewidth)}}};mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.darkOpacity=0;e.prototype.darkOpacity2=0;e.prototype.paintVertexShape= function(f,m,r,n,t){var w=Math.max(0,Math.min(n,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),L=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));f.translate(m,r);f.begin();f.moveTo(0,0);f.lineTo(n-w,0);f.lineTo(n,w);f.lineTo(n,t);f.lineTo(w,t);f.lineTo(0,t-w);f.lineTo(0,0);f.close();f.end();f.fillAndStroke();this.outline||(f.setShadow(!1), 0!=y&&(f.setFillAlpha(Math.abs(y)),f.setFillColor(0>y?"#FFFFFF":"#000000"),f.begin(),f.moveTo(0,0),f.lineTo(n-w,0),f.lineTo(n,w),f.lineTo(w,w),f.close(),f.fill()),0!=L&&(f.setFillAlpha(Math.abs(L)),f.setFillColor(0>L?"#FFFFFF":"#000000"),f.begin(),f.moveTo(0,0),f.lineTo(w,w),f.lineTo(w,t),f.lineTo(0,t-w),f.close(),f.fill()),f.begin(),f.moveTo(w,t),f.lineTo(w,w),f.lineTo(0,0),f.moveTo(w,w),f.lineTo(n,w),f.end(),f.stroke())};e.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style, "boundedLbl",!1)?(f=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(f,f,0,0)):null};mxCellRenderer.registerShape("cube",e);var B=Math.tan(mxUtils.toRadians(30)),D=(.5-B)/2;mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(g,mxConnector);g.prototype.paintEdgeShape=function(f,m){var r=this.createMarker(f,m,!0),n=this.createMarker(f,m,!1);f.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&f.setDashed(this.isDashed, null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);f.setShadow(!1);f.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);f.setStrokeColor(this.stroke);f.setFillColor(this.stroke);f.setDashed(!1);null!=r&&r();null!=n&&n()};mxCellRenderer.registerShape("wire",g);mxUtils.extend(c,mxCylinder);c.prototype.size=6;c.prototype.paintVertexShape=function(f,m,r,n,t){f.setFillColor(this.stroke);var w=Math.max(0,parseFloat(mxUtils.getValue(this.style, "size",this.size))-2)+2*this.strokewidth;f.ellipse(m+.5*(n-w),r+.5*(t-w),w,w);f.fill();f.setFillColor(mxConstants.NONE);f.rect(m,r,n,t);f.fill()};mxCellRenderer.registerShape("waypoint",c);mxUtils.extend(h,mxActor);h.prototype.size=20;h.prototype.redrawPath=function(f,m,r,n,t){m=Math.min(n,t/B);f.translate((n-m)/2,(t-m)/2+m/4);f.moveTo(0,.25*m);f.lineTo(.5*m,m*D);f.lineTo(m,.25*m);f.lineTo(.5*m,(.5-D)*m);f.lineTo(0,.25*m);f.close();f.end()};mxCellRenderer.registerShape("isoRectangle",h);mxUtils.extend(k, mxCylinder);k.prototype.size=20;k.prototype.redrawPath=function(f,m,r,n,t,w){m=Math.min(n,t/(.5+B));w?(f.moveTo(0,.25*m),f.lineTo(.5*m,(.5-D)*m),f.lineTo(m,.25*m),f.moveTo(.5*m,(.5-D)*m),f.lineTo(.5*m,(1-D)*m)):(f.translate((n-m)/2,(t-m)/2),f.moveTo(0,.25*m),f.lineTo(.5*m,m*D),f.lineTo(m,.25*m),f.lineTo(m,.75*m),f.lineTo(.5*m,(1-D)*m),f.lineTo(0,.75*m),f.close());f.end()};mxCellRenderer.registerShape("isoCube",k);mxUtils.extend(p,mxCylinder);p.prototype.redrawPath=function(f,m,r,n,t,w){m=Math.min(t/ 2,Math.round(t/8)+this.strokewidth-1);if(w&&null!=this.fill||!w&&null==this.fill)f.moveTo(0,m),f.curveTo(0,2*m,n,2*m,n,m),w||(f.stroke(),f.begin()),f.translate(0,m/2),f.moveTo(0,m),f.curveTo(0,2*m,n,2*m,n,m),w||(f.stroke(),f.begin()),f.translate(0,m/2),f.moveTo(0,m),f.curveTo(0,2*m,n,2*m,n,m),w||(f.stroke(),f.begin()),f.translate(0,-m);w||(f.moveTo(0,m),f.curveTo(0,-m/3,n,-m/3,n,m),f.lineTo(n,t-m),f.curveTo(n,t+m/3,0,t+m/3,0,t-m),f.close())};p.prototype.getLabelMargins=function(f){return new mxRectangle(0, 2.5*Math.min(f.height/2,Math.round(f.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",p);mxUtils.extend(l,mxCylinder);l.prototype.size=30;l.prototype.darkOpacity=0;l.prototype.paintVertexShape=function(f,m,r,n,t){var w=Math.max(0,Math.min(n,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),y=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));f.translate(m,r);f.begin();f.moveTo(0,0);f.lineTo(n-w,0);f.lineTo(n, w);f.lineTo(n,t);f.lineTo(0,t);f.lineTo(0,0);f.close();f.end();f.fillAndStroke();this.outline||(f.setShadow(!1),0!=y&&(f.setFillAlpha(Math.abs(y)),f.setFillColor(0>y?"#FFFFFF":"#000000"),f.begin(),f.moveTo(n-w,0),f.lineTo(n-w,w),f.lineTo(n,w),f.close(),f.fill()),f.begin(),f.moveTo(n-w,0),f.lineTo(n-w,w),f.lineTo(n,w),f.end(),f.stroke())};mxCellRenderer.registerShape("note",l);mxUtils.extend(u,l);mxCellRenderer.registerShape("note2",u);u.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style, "boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(f.height*this.scale,m*this.scale),0,0)}return null};mxUtils.extend(x,mxShape);x.prototype.isoAngle=15;x.prototype.paintVertexShape=function(f,m,r,n,t){var w=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;w=Math.min(n*Math.tan(w),.5*t);f.translate(m,r);f.begin();f.moveTo(.5*n,0);f.lineTo(n,w);f.lineTo(n,t-w);f.lineTo(.5*n,t);f.lineTo(0,t-w);f.lineTo(0, w);f.close();f.fillAndStroke();f.setShadow(!1);f.begin();f.moveTo(0,w);f.lineTo(.5*n,2*w);f.lineTo(n,w);f.moveTo(.5*n,2*w);f.lineTo(.5*n,t);f.stroke()};mxCellRenderer.registerShape("isoCube2",x);mxUtils.extend(v,mxShape);v.prototype.size=15;v.prototype.paintVertexShape=function(f,m,r,n,t){var w=Math.max(0,Math.min(.5*t,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.translate(m,r);0==w?(f.rect(0,0,n,t),f.fillAndStroke()):(f.begin(),f.moveTo(0,w),f.arcTo(.5*n,w,0,0,1,.5*n,0),f.arcTo(.5* n,w,0,0,1,n,w),f.lineTo(n,t-w),f.arcTo(.5*n,w,0,0,1,.5*n,t),f.arcTo(.5*n,w,0,0,1,0,t-w),f.close(),f.fillAndStroke(),f.setShadow(!1),f.begin(),f.moveTo(n,w),f.arcTo(.5*n,w,0,0,1,.5*n,2*w),f.arcTo(.5*n,w,0,0,1,0,w),f.stroke())};mxCellRenderer.registerShape("cylinder2",v);mxUtils.extend(z,mxCylinder);z.prototype.size=15;z.prototype.paintVertexShape=function(f,m,r,n,t){var w=Math.max(0,Math.min(.5*t,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),y=mxUtils.getValue(this.style,"lid",!0);f.translate(m, r);0==w?(f.rect(0,0,n,t),f.fillAndStroke()):(f.begin(),y?(f.moveTo(0,w),f.arcTo(.5*n,w,0,0,1,.5*n,0),f.arcTo(.5*n,w,0,0,1,n,w)):(f.moveTo(0,0),f.arcTo(.5*n,w,0,0,0,.5*n,w),f.arcTo(.5*n,w,0,0,0,n,0)),f.lineTo(n,t-w),f.arcTo(.5*n,w,0,0,1,.5*n,t),f.arcTo(.5*n,w,0,0,1,0,t-w),f.close(),f.fillAndStroke(),f.setShadow(!1),y&&(f.begin(),f.moveTo(n,w),f.arcTo(.5*n,w,0,0,1,.5*n,2*w),f.arcTo(.5*n,w,0,0,1,0,w),f.stroke()))};mxCellRenderer.registerShape("cylinder3",z);mxUtils.extend(C,mxActor);C.prototype.redrawPath= function(f,m,r,n,t){f.moveTo(0,0);f.quadTo(n/2,.5*t,n,0);f.quadTo(.5*n,t/2,n,t);f.quadTo(n/2,.5*t,0,t);f.quadTo(.5*n,t/2,0,0);f.end()};mxCellRenderer.registerShape("switch",C);mxUtils.extend(F,mxCylinder);F.prototype.tabWidth=60;F.prototype.tabHeight=20;F.prototype.tabPosition="right";F.prototype.arcSize=.1;F.prototype.isRoundable=function(){return!0};F.prototype.paintVertexShape=function(f,m,r,n,t){f.translate(m,r);m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))); r=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var w=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),y=mxUtils.getValue(this.style,"rounded",!1),L=mxUtils.getValue(this.style,"absoluteArcSize",!1),E=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));L||(E*=Math.min(n,t));E=Math.min(E,.5*n,.5*(t-r));m=Math.max(m,E);m=Math.min(n-E,m);y||(E=0);f.begin();"left"==w?(f.moveTo(Math.max(E,0),r),f.lineTo(Math.max(E,0),0),f.lineTo(m,0), f.lineTo(m,r)):(f.moveTo(n-m,r),f.lineTo(n-m,0),f.lineTo(n-Math.max(E,0),0),f.lineTo(n-Math.max(E,0),r));y?(f.moveTo(0,E+r),f.arcTo(E,E,0,0,1,E,r),f.lineTo(n-E,r),f.arcTo(E,E,0,0,1,n,E+r),f.lineTo(n,t-E),f.arcTo(E,E,0,0,1,n-E,t),f.lineTo(E,t),f.arcTo(E,E,0,0,1,0,t-E)):(f.moveTo(0,r),f.lineTo(n,r),f.lineTo(n,t),f.lineTo(0,t));f.close();f.fillAndStroke();f.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(f.begin(),f.moveTo(n-30,r+20),f.lineTo(n-20,r+10),f.lineTo(n-10,r+20), f.close(),f.stroke())};mxCellRenderer.registerShape("folder",F);F.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var r=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var n=mxUtils.getValue(this.style,"rounded",!1),t=mxUtils.getValue(this.style,"absoluteArcSize",!1),w=parseFloat(mxUtils.getValue(this.style, "arcSize",this.arcSize));t||(w*=Math.min(f.width,f.height));w=Math.min(w,.5*f.width,.5*(f.height-m));n||(w=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(w,0,Math.min(f.width,f.width-r),Math.min(f.height,f.height-m)):new mxRectangle(Math.min(f.width,f.width-r),0,w,Math.min(f.height,f.height-m))}return new mxRectangle(0,Math.min(f.height,m),0,0)}return null};mxUtils.extend(G,mxCylinder);G.prototype.arcSize=.1;G.prototype.paintVertexShape=function(f,m,r, n,t){f.translate(m,r);var w=mxUtils.getValue(this.style,"rounded",!1),y=mxUtils.getValue(this.style,"absoluteArcSize",!1);m=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));r=mxUtils.getValue(this.style,"umlStateConnection",null);y||(m*=Math.min(n,t));m=Math.min(m,.5*n,.5*t);w||(m=0);w=0;null!=r&&(w=10);f.begin();f.moveTo(w,m);f.arcTo(m,m,0,0,1,w+m,0);f.lineTo(n-m,0);f.arcTo(m,m,0,0,1,n,m);f.lineTo(n,t-m);f.arcTo(m,m,0,0,1,n-m,t);f.lineTo(w+m,t);f.arcTo(m,m,0,0,1,w,t-m);f.close();f.fillAndStroke(); f.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(f.roundrect(n-40,t-20,10,10,3,3),f.stroke(),f.roundrect(n-20,t-20,10,10,3,3),f.stroke(),f.begin(),f.moveTo(n-30,t-15),f.lineTo(n-20,t-15),f.stroke());"connPointRefEntry"==r?(f.ellipse(0,.5*t-10,20,20),f.fillAndStroke()):"connPointRefExit"==r&&(f.ellipse(0,.5*t-10,20,20),f.fillAndStroke(),f.begin(),f.moveTo(5,.5*t-5),f.lineTo(15,.5*t+5),f.moveTo(15,.5*t-5),f.lineTo(5,.5*t+5),f.stroke())};G.prototype.getLabelMargins= function(f){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",G);mxUtils.extend(H,mxShape);H.prototype.featureColor="#666666";H.prototype.paintVertexShape=function(f,m,r,n,t){var w=mxUtils.getValue(this.style,"smileyType","happy"),y=mxUtils.getValue(this.style,"smileyFeatureColor",H.prototype.featureColor);f.translate(m,r);m=Math.min(n,t)/2;f.ellipse(n/ 2-m,t/2-m,2*m,2*m);f.fillAndStroke();m=Math.min(n,t)/30;n/=2;t/=2;f.setFillColor(y);f.setStrokeColor(y);f.setStrokeWidth(2*m);y=1.5*m;r=5*m;var L=5*m;f.ellipse(n-r-y,t-L-y,2*y,2*y);f.fillAndStroke();f.ellipse(n+r-y,t-L-y,2*y,2*y);f.fillAndStroke();f.setStrokeWidth(1*m);f.setFillColor("#000000");"happy"==w?(w=n,y=t+2*m,f.begin(),f.moveTo(w+7.5*m,y),f.arcTo(7.5*m,7.5*m,0,1,1,w-7.5*m,y),f.lineTo(w-6.818*m,y),f.arcTo(6.818*m,6.818*m,0,1,0,w+6.818*m,y),f.close(),f.fillAndStroke()):"sad"==w?(w=n,y=t+7* m,f.begin(),f.moveTo(w-7.5*m,y),f.arcTo(7.5*m,7.5*m,0,1,1,w+7.5*m,y),f.lineTo(w+6.818*m,y),f.arcTo(6.818*m,6.818*m,0,1,0,w-6.818*m,y),f.close(),f.fillAndStroke()):(f.begin(),f.moveTo(n-5*m,t+7*m),f.lineTo(n+5*m,t+7*m),f.stroke())};mxCellRenderer.registerShape("smileyFace",H);mxUtils.extend(J,mxActor);J.prototype.size=30;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(f,m,r,n,t){m=Math.max(0,Math.min(n,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size))))); r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(m,0),new mxPoint(n,0),new mxPoint(n,t),new mxPoint(0,t),new mxPoint(0,m)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("card",J);mxUtils.extend(O,mxActor);O.prototype.size=.4;O.prototype.redrawPath=function(f,m,r,n,t){m=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,m/2);f.quadTo(n/4,1.4*m,n/2,m/2);f.quadTo(3*n/4,m*(1-1.4), n,m/2);f.lineTo(n,t-m/2);f.quadTo(3*n/4,t-1.4*m,n/2,t-m/2);f.quadTo(n/4,t-m*(1-1.4),0,t-m/2);f.lineTo(0,m/2);f.close();f.end()};O.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",this.size),r=f.width,n=f.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return m*=n,new mxRectangle(f.x,f.y+m,r,n-2*m);m*=r;return new mxRectangle(f.x+m,f.y,r-2*m,n)}return f}; mxCellRenderer.registerShape("tape",O);mxUtils.extend(M,mxActor);M.prototype.size=.3;M.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*f.height):null};M.prototype.redrawPath=function(f,m,r,n,t){m=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(0,0);f.lineTo(n,0);f.lineTo(n,t-m/2);f.quadTo(3*n/4,t-1.4*m,n/2,t-m/2);f.quadTo(n/4,t-m*(1- 1.4),0,t-m/2);f.lineTo(0,m/2);f.close();f.end()};mxCellRenderer.registerShape("document",M);var I=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(f,m,r,n){var t=mxUtils.getValue(this.style,"size");return null!=t?n*Math.max(0,Math.min(1,t)):I.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale, f.height*m),0,0)}return null};z.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(m/=2);return new mxRectangle(0,Math.min(f.height*this.scale,2*m*this.scale),0,Math.max(0,.3*m*this.scale))}return null};F.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style, "labelInHeader",!1)){var r=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;m=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var n=mxUtils.getValue(this.style,"rounded",!1),t=mxUtils.getValue(this.style,"absoluteArcSize",!1),w=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));t||(w*=Math.min(f.width,f.height));w=Math.min(w,.5*f.width,.5*(f.height-m));n||(w=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(w,0,Math.min(f.width,f.width- r),Math.min(f.height,f.height-m)):new mxRectangle(Math.min(f.width,f.width-r),0,w,Math.min(f.height,f.height-m))}return new mxRectangle(0,Math.min(f.height,m),0,0)}return null};G.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};u.prototype.getLabelMargins=function(f){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var m=mxUtils.getValue(this.style,"size", 15);return new mxRectangle(0,Math.min(f.height*this.scale,m*this.scale),0,Math.max(0,m*this.scale))}return null};mxUtils.extend(V,mxActor);V.prototype.size=.2;V.prototype.fixedSize=20;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(f,m,r,n,t){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,t),new mxPoint(m,0),new mxPoint(n,0),new mxPoint(n-m,t)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("parallelogram",V);mxUtils.extend(Q,mxActor);Q.prototype.size=.2;Q.prototype.fixedSize=20;Q.prototype.isRoundable=function(){return!0};Q.prototype.redrawPath=function(f,m,r,n,t){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*n,parseFloat(mxUtils.getValue(this.style,"size", this.fixedSize)))):n*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,t),new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,t)],this.isRounded,r,!0)};mxCellRenderer.registerShape("trapezoid",Q);mxUtils.extend(ma,mxActor);ma.prototype.size=.5;ma.prototype.redrawPath=function(f,m,r,n,t){f.setFillColor(null);m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, "size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(n,0),new mxPoint(m,0),new mxPoint(m,t/2),new mxPoint(0,t/2),new mxPoint(m,t/2),new mxPoint(m,t),new mxPoint(n,t)],this.isRounded,r,!1);f.end()};mxCellRenderer.registerShape("curlyBracket",ma);mxUtils.extend(ia,mxActor);ia.prototype.redrawPath=function(f,m,r,n,t){f.setStrokeWidth(1);f.setFillColor(this.stroke);m=n/5;f.rect(0,0,m,t);f.fillAndStroke();f.rect(2*m,0,m, t);f.fillAndStroke();f.rect(4*m,0,m,t);f.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ia);na.prototype.moveTo=function(f,m){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=m;this.firstX=f;this.firstY=m};na.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)};na.prototype.quadTo=function(f,m,r,n){this.originalQuadTo.apply(this.canvas, arguments);this.lastX=r;this.lastY=n};na.prototype.curveTo=function(f,m,r,n,t,w){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=t;this.lastY=w};na.prototype.arcTo=function(f,m,r,n,t,w,y){this.originalArcTo.apply(this.canvas,arguments);this.lastX=w;this.lastY=y};na.prototype.lineTo=function(f,m){if(null!=this.lastX&&null!=this.lastY){var r=function(W){return"number"===typeof W?W?0>W?-1:1:W===W?0:NaN:NaN},n=Math.abs(f-this.lastX),t=Math.abs(m-this.lastY),w=Math.sqrt(n*n+t*t);if(2>w){this.originalLineTo.apply(this.canvas, arguments);this.lastX=f;this.lastY=m;return}var y=Math.round(w/10),L=this.defaultVariation;5>y&&(y=5,L/=3);var E=r(f-this.lastX)*n/y;r=r(m-this.lastY)*t/y;n/=w;t/=w;for(w=0;w<y;w++){var fa=(Math.random()-.5)*L;this.originalLineTo.call(this.canvas,E*w+this.lastX-fa*t,r*w+this.lastY-fa*n)}this.originalLineTo.call(this.canvas,f,m)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=m};na.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 K=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(f){K.apply(this,arguments);null==f.handJiggle&&(f.handJiggle=this.createHandJiggle(f))};var P=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(f){P.apply(this,arguments);null!=f.handJiggle&&(f.handJiggle.destroy(),delete f.handJiggle)}; mxShape.prototype.createComicCanvas=function(f){return new na(f,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(f){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(f)};var X=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"))&&X.apply(this,arguments)};var aa=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(f,m,r,n,t){if(null==f.handJiggle||f.handJiggle.constructor!=na)aa.apply(this,arguments);else{var w=!0;null!=this.style&&(w="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(w||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)w||null!=this.fill&&this.fill!=mxConstants.NONE|| (f.pointerEvents=!1),f.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?w=Math.min(n/2,Math.min(t/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(w=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,w=Math.min(n*w,t*w)),f.moveTo(m+w,r),f.lineTo(m+n-w,r),f.quadTo(m+n,r,m+n,r+w),f.lineTo(m+n,r+t-w),f.quadTo(m+n,r+t,m+n-w,r+t),f.lineTo(m+w,r+t),f.quadTo(m,r+t,m,r+t-w), f.lineTo(m,r+w),f.quadTo(m,r,m+w,r)):(f.moveTo(m,r),f.lineTo(m+n,r),f.lineTo(m+n,r+t),f.lineTo(m,r+t),f.lineTo(m,r)),f.close(),f.end(),f.fillAndStroke()}};mxUtils.extend(Z,mxRectangleShape);Z.prototype.size=.1;Z.prototype.fixedSize=!1;Z.prototype.isHtmlAllowed=function(){return!1};Z.prototype.getLabelBounds=function(f){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var m= f.width,r=f.height;f=new mxRectangle(f.x,f.y,m,r);var n=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),t=parseFloat(mxUtils.getValue(this.style,"size",this.size));n?t=Math.max(0,Math.min(m,t*this.scale)):(t=m*Math.max(0,Math.min(1,t)),this.isRounded&&(n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,t=Math.max(t,Math.min(m*n,r*n))));f.x+=Math.round(t);f.width-=Math.round(2*t);return f}return f};Z.prototype.paintForeground=function(f,m, r,n,t){var w=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),y=parseFloat(mxUtils.getValue(this.style,"size",this.size));y=w?Math.max(0,Math.min(n,y)):n*Math.max(0,Math.min(1,y));this.isRounded&&(w=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,y=Math.max(y,Math.min(n*w,t*w)));y=Math.round(y);f.begin();f.moveTo(m+y,r);f.lineTo(m+y,r+t);f.moveTo(m+n-y,r);f.lineTo(m+n-y,r+t);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this, arguments)};mxCellRenderer.registerShape("process",Z);mxCellRenderer.registerShape("process2",Z);mxUtils.extend(da,mxRectangleShape);da.prototype.paintBackground=function(f,m,r,n,t){f.setFillColor(mxConstants.NONE);f.rect(m,r,n,t);f.fill()};da.prototype.paintForeground=function(f,m,r,n,t){};mxCellRenderer.registerShape("transparent",da);mxUtils.extend(pa,mxHexagon);pa.prototype.size=30;pa.prototype.position=.5;pa.prototype.position2=.5;pa.prototype.base=20;pa.prototype.getLabelMargins=function(){return new mxRectangle(0, 0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};pa.prototype.isRoundable=function(){return!0};pa.prototype.redrawPath=function(f,m,r,n,t){m=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;r=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var w=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),y=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2", this.position2)))),L=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(f,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,t-r),new mxPoint(Math.min(n,w+L),t-r),new mxPoint(y,t),new mxPoint(Math.max(0,w),t-r),new mxPoint(0,t-r)],this.isRounded,m,!0,[4])};mxCellRenderer.registerShape("callout",pa);mxUtils.extend(ka,mxActor);ka.prototype.tipX=-.25;ka.prototype.tipY=1;ka.prototype.base=20;ka.prototype.maxTipOffset=100;ka.prototype.isRoundable=function(){return!0}; ka.prototype.getTipOffset=function(){var f=this.maxTipOffset,m=parseFloat(mxUtils.getValue(this.style,"tipX",this.tipX)),r=parseFloat(mxUtils.getValue(this.style,"tipY",this.tipY));return new mxPoint(Math.max(-f,Math.min(f,isFinite(m)?m:this.tipX)),Math.max(-f,Math.min(f,isFinite(r)?r:this.tipY)))};ka.prototype.getTailPoints=function(f,m){var r=this.getTipOffset(),n=r.x*f;r=r.y*m;if(Math.abs(n)<=f/2&&Math.abs(r)<=m/2)return null;var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/ 2,w=parseFloat(mxUtils.getValue(this.style,"base",this.base));w=isFinite(w)?Math.max(0,w):this.base;t=this.isRounded?t:0;var y=new mxPoint(f/2+n,m/2+r);if(Math.abs(n)*m>=Math.abs(r)*f&&0!=n)return t=Math.min(t,m/2),w=Math.max(0,Math.min(w,m-2*t))/2,r=m/2+f/2*r/Math.abs(n),r=Math.max(t+w,Math.min(m-t-w,r)),0<n?{points:[new mxPoint(f,r-w),y,new mxPoint(f,r+w)],index:2}:{points:[new mxPoint(0,r+w),y,new mxPoint(0,r-w)],index:4};t=Math.min(t,f/2);w=Math.max(0,Math.min(w,f-2*t))/2;n=f/2+m/2*n/Math.abs(r); n=Math.max(t+w,Math.min(f-t-w,n));return 0<r?{points:[new mxPoint(n+w,m),y,new mxPoint(n-w,m)],index:3}:{points:[new mxPoint(n-w,0),y,new mxPoint(n+w,0)],index:1}};ka.prototype.redrawPath=function(f,m,r,n,t){m=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;r=[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,t),new mxPoint(0,t)];n=this.getTailPoints(n,t);t=null;null!=n&&(r.splice.apply(r,[n.index,0].concat(n.points)),t=[n.index,n.index+1,n.index+2]);this.addPoints(f, r,this.isRounded,m,!0,t)};ka.prototype.getShapeBoundingBox=function(){var f=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=f&&null!=this.bounds){var m=this.createBoundingBox(),r=this.scale,n=m.width/r,t=m.height/r,w=this.getTailPoints(n,t);if(null!=w){var y=w.points[1],L=m.x+m.width/2;m=m.y+m.height/2;r=new mxRectangle(L+(y.x-n/2)*r*(this.flipH?-1:1),m+(y.y-t/2)*r*(this.flipV?-1:1),0,0);this.augmentBoundingBox(r);n=w.points[0].x-y.x;t=w.points[0].y-y.y;var E=w.points[2].x-y.x; w=w.points[2].y-y.y;y=Math.sqrt(n*n+t*t);var fa=Math.sqrt(E*E+w*w);0<y&&0<fa&&(w=Math.sqrt((1-Math.max(-1,Math.min(1,(n*E+t*w)/(y*fa))))/2),r.grow(((0<w?Math.min(10,1/w):10)-1)*this.strokewidth*this.scale/2));w=this.getShapeRotation();0!=w&&(r=mxUtils.getBoundingBox(r,w,new mxPoint(L,m)));f.add(r)}}return f};mxCellRenderer.registerShape("wedgeCallout",ka);mxUtils.extend(S,mxActor);S.prototype.size=.2;S.prototype.fixedSize=20;S.prototype.isRoundable=function(){return!0};S.prototype.redrawPath=function(f, m,r,n,t){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(n-m,0),new mxPoint(n,t/2),new mxPoint(n-m,t),new mxPoint(0,t),new mxPoint(m,t/2)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("step", S);mxUtils.extend(U,mxHexagon);U.prototype.size=.25;U.prototype.fixedSize=20;U.prototype.isRoundable=function(){return!0};U.prototype.redrawPath=function(f,m,r,n,t){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(m, 0),new mxPoint(n-m,0),new mxPoint(n,.5*t),new mxPoint(n-m,t),new mxPoint(m,t),new mxPoint(0,.5*t)],this.isRounded,r,!0)};mxCellRenderer.registerShape("hexagon",U);mxUtils.extend(Y,mxRectangleShape);Y.prototype.isHtmlAllowed=function(){return!1};Y.prototype.paintForeground=function(f,m,r,n,t){var w=Math.min(n/5,t/5)+1;f.begin();f.moveTo(m+n/2,r+w);f.lineTo(m+n/2,r+t-w);f.moveTo(m+w,r+t/2);f.lineTo(m+n-w,r+t/2);f.end();f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus", Y);var ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(f){if(1==this.style["double"]){var m=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+m,f.y+m,f.width-2*m,f.height-2*m)}return f};mxRhombus.prototype.paintVertexShape=function(f,m,r,n,t){ca.apply(this,arguments);var w=m,y=r,L=n,E=t;if(!this.outline&&1==this.style["double"]){var fa=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| 0);m+=fa;r+=fa;n-=2*fa;t-=2*fa;0<n&&0<t&&(f.setShadow(!1),ca.apply(this,[f,m,r,n,t]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(f,w,y,L,E,0)};mxShape.prototype.paintGlassEffect=function(f,m,r,n,t,w){var y=Math.ceil(this.strokewidth/2);f.setGradient("#ffffff","#ffffff",m,r,n,.6*t,"south",.9,.1);f.begin();this.paintGlassEffectPath(f,m,r,n,t,y,w);f.close();f.fill()};mxShape.prototype.paintGlassEffectPath=function(f,m,r,n,t,w,y){y+=2*w;this.isRounded? (f.moveTo(m-w+y,r-w),f.quadTo(m-w,r-w,m-w,r-w+y),f.lineTo(m-w,r+.4*t),f.quadTo(m+.5*n,r+.7*t,m+n+w,r+.4*t),f.lineTo(m+n+w,r-w+y),f.quadTo(m+n+w,r-w,m+n+w-y,r-w)):(f.moveTo(m-w,r-w),f.lineTo(m-w,r+.4*t),f.quadTo(m+.5*n,r+.7*t,m+n+w,r+.4*t),f.lineTo(m+n+w,r-w))};mxEllipse.prototype.paintGlassEffectPath=function(f,m,r,n,t,w,y){y=n/2+w;w=t/2+w;m+=n/2;r+=t/2;f.moveTo(m-y,r);f.curveTo(m-y,r-.5522847498*w,m-.5522847498*y,r-w,m,r-w);f.curveTo(m+.5522847498*y,r-w,m+y,r-.5522847498*w,m+y,r);f.quadTo(m,r+.2* t,m-y,r)};mxRhombus.prototype.paintGlassEffectPath=function(f,m,r,n,t,w,y){w=n/2;y=t/2;var L=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(m,r+y),new mxPoint(m+w,r),new mxPoint(m+n,r+y)],this.isRounded,L,!1);f.quadTo(m+w,r+.7*t,m,r+y)};var ra=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(f,m,r,n,t){ra.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&& this.paintGlassEffect(f,m,r,n,t,0)};mxUtils.extend(N,mxRectangleShape);N.prototype.isHtmlAllowed=function(){return!1};N.prototype.getLabelBounds=function(f){if(1==this.style["double"]){var m=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(f.x+m,f.y+m,f.width-2*m,f.height-2*m)}return f};N.prototype.paintForeground=function(f,m,r,n,t){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var w=Math.max(2,this.strokewidth+ 1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);m+=w;r+=w;n-=2*w;t-=2*w;0<n&&0<t&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}f.setDashed(!1);w=0;do{var y=mxCellRenderer.defaultShapes[this.style["symbol"+w]];if(null!=y){var L=this.style["symbol"+w+"Align"],E=this.style["symbol"+w+"VerticalAlign"],fa=this.style["symbol"+w+"Width"],W=this.style["symbol"+w+"Height"],Ea=this.style["symbol"+w+"Spacing"]||0,Wa=this.style["symbol"+w+"VSpacing"]||Ea,Pa=this.style["symbol"+w+"ArcSpacing"]; null!=Pa&&(Pa*=this.getArcSize(n+this.strokewidth,t+this.strokewidth),Ea+=Pa,Wa+=Pa);Pa=m;var wa=r;Pa=L==mxConstants.ALIGN_CENTER?Pa+(n-fa)/2:L==mxConstants.ALIGN_RIGHT?Pa+(n-fa-Ea):Pa+Ea;wa=E==mxConstants.ALIGN_MIDDLE?wa+(t-W)/2:E==mxConstants.ALIGN_BOTTOM?wa+(t-W-Wa):wa+Wa;f.save();L=new y;L.style=this.style;y.prototype.paintVertexShape.call(L,f,Pa,wa,fa,W);f.restore()}w++}while(null!=y)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",N);mxUtils.extend(R, mxCylinder);R.prototype.redrawPath=function(f,m,r,n,t,w){w?(f.moveTo(0,0),f.lineTo(n/2,t/2),f.lineTo(n,0),f.end()):(f.moveTo(0,0),f.lineTo(n,0),f.lineTo(n,t),f.lineTo(0,t),f.close())};mxCellRenderer.registerShape("message",R);mxUtils.extend(ea,mxShape);ea.prototype.paintBackground=function(f,m,r,n,t){f.translate(m,r);f.ellipse(n/4,0,n/2,t/4);f.fillAndStroke();f.begin();f.moveTo(n/2,t/4);f.lineTo(n/2,2*t/3);f.moveTo(n/2,t/3);f.lineTo(0,t/3);f.moveTo(n/2,t/3);f.lineTo(n,t/3);f.moveTo(n/2,2*t/3);f.lineTo(0, t);f.moveTo(n/2,2*t/3);f.lineTo(n,t);f.end();f.stroke()};mxCellRenderer.registerShape("umlActor",ea);mxUtils.extend(ba,mxShape);ba.prototype.getLabelMargins=function(f){return new mxRectangle(f.width/6,0,0,0)};ba.prototype.paintBackground=function(f,m,r,n,t){f.translate(m,r);f.begin();f.moveTo(0,t/4);f.lineTo(0,3*t/4);f.end();f.stroke();f.begin();f.moveTo(0,t/2);f.lineTo(n/6,t/2);f.end();f.stroke();f.ellipse(n/6,0,5*n/6,t);f.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",ba);mxUtils.extend(la, mxEllipse);la.prototype.paintVertexShape=function(f,m,r,n,t){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.begin();f.moveTo(m+n/8,r+t);f.lineTo(m+7*n/8,r+t);f.end();f.stroke()};mxCellRenderer.registerShape("umlEntity",la);mxUtils.extend(sa,mxShape);sa.prototype.paintVertexShape=function(f,m,r,n,t){f.translate(m,r);f.begin();f.moveTo(n,0);f.lineTo(0,t);f.moveTo(0,0);f.lineTo(n,t);f.end();f.stroke()};mxCellRenderer.registerShape("umlDestroy",sa);mxUtils.extend(T,mxShape);T.prototype.getLabelBounds= function(f){return new mxRectangle(f.x,f.y+f.height/8,f.width,7*f.height/8)};T.prototype.paintBackground=function(f,m,r,n,t){f.translate(m,r);f.begin();f.moveTo(3*n/8,t/8*1.1);f.lineTo(5*n/8,0);f.end();f.stroke();f.ellipse(0,t/8,n,7*t/8);f.fillAndStroke()};T.prototype.paintForeground=function(f,m,r,n,t){f.begin();f.moveTo(3*n/8,t/8*1.1);f.lineTo(5*n/8,t/4);f.end();f.stroke()};mxCellRenderer.registerShape("umlControl",T);mxUtils.extend(va,mxShape);va.prototype.iconSize=44;va.prototype.paintBackground= function(f,m,r,n,t){t=Math.min(this.iconSize,n,t);var w=.9*t,y=.45*t;m=m+n/2-t/2;n=r+t/2;var L=m+.175*w;w=L-w;f.begin();f.moveTo(w,n-y/2);f.lineTo(w,n+y/2);f.end();f.stroke();f.begin();f.moveTo(w,n);f.lineTo(L,n);f.end();f.stroke();f.ellipse(m,r,t,t);f.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",va);mxCellRenderer.registerShape("seqControl",ua(T,44));mxCellRenderer.registerShape("seqEntity",ua(la,44));mxUtils.extend(Ka,mxShape);Ka.prototype.paintBackground=function(f,m,r,n,t){var w= t/2,y=w/(2.5+t/50);f.save();f.translate(m,r);f.begin();f.moveTo(y,0);f.lineTo(n-y,0);f.arcTo(y,w,0,0,1,n-y,t);f.lineTo(y,t);f.arcTo(y,w,0,0,1,y,0);f.close();f.fillAndStroke();f.restore()};Ka.prototype.paintForeground=function(f,m,r,n,t){var w=t/2,y=w/(2.5+t/50);f.save();f.translate(m,r);f.begin();f.moveTo(n-y,0);f.arcTo(y,w,0,0,0,n-y,t);f.stroke();f.restore()};mxCellRenderer.registerShape("seqQueue",Ka);mxUtils.extend(Sa,mxShape);Sa.prototype.paintBackground=function(f,m,r,n,t){f.rect(m+6,r-6,n,t); f.fillAndStroke();f.rect(m,r,n,t);f.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",Sa);mxUtils.extend(Ua,mxShape);Ua.prototype.paintBackground=function(f,m,r,n,t){t=n/3;var w=n/3,y=t/2,L=y/(2.5+t/50);f.translate(m+(n-t)/2,r);f.begin();f.moveTo(0,L);f.arcTo(y,L,0,0,0,t,L);f.arcTo(y,L,0,0,0,0,L);f.lineTo(0,w-L);f.arcTo(y,L,0,0,0,t,w-L);f.lineTo(t,L);f.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",Ua);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground=function(f,m, r,n,t){m+=n/2;r+=15;n=r+15;t=n+20;var w=n+10,y=t+15;f.ellipse(m-15,r-15,30,30);f.fillAndStroke();f.begin();f.moveTo(m,n);f.lineTo(m,t);f.moveTo(m-18,w);f.lineTo(m+18,w);f.moveTo(m,t);f.lineTo(m-16,y);f.moveTo(m,t);f.lineTo(m+16,y);f.stroke()};mxCellRenderer.registerShape("seqActorStick",ta);mxUtils.extend(Fa,mxRectangleShape);Fa.prototype.size=40;Fa.prototype.isHtmlAllowed=function(){return!1};Fa.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror","0")};Fa.prototype.getHeadSize= function(f){return Math.max(0,Math.min(this.isMirrored()?f/2:f,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Fa.prototype.getLabelBounds=function(f){var m=Math.max(0,Math.min(this.isMirrored()?f.height/2:f.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(f.x,f.y,f.width,m)};Fa.prototype.paintBackground=function(f,m,r,n,t){var w=this.getHeadSize(t),y=this.isMirrored(),L=mxUtils.getValue(this.style,"participant");null==L||null==this.state? (mxRectangleShape.prototype.paintBackground.call(this,f,m,r,n,w),y&&mxRectangleShape.prototype.paintBackground.call(this,f,m,r+t-w,n,w)):(L=this.state.view.graph.cellRenderer.getShape(L),null!=L&&L!=Fa&&(L=new L,L.apply(this.state),f.save(),L.paintVertexShape(f,m,r,n,w),f.restore(),y&&(f.save(),L.paintVertexShape(f,m,r+t-w,n,w),f.restore())));t=y?t-w:t;w<t&&(f.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),f.begin(),f.moveTo(m+n/2,r+w),f.lineTo(m+n/2,r+t),f.end(),f.stroke())};Fa.prototype.paintForeground= function(f,m,r,n,t){var w=mxUtils.getValue(this.style,"participant"),y=this.getHeadSize(t),L=this.isMirrored();null==w&&(mxRectangleShape.prototype.paintForeground.call(this,f,m,r,n,Math.min(t,y)),L&&mxRectangleShape.prototype.paintForeground.call(this,f,m,r+t-y,n,y));L&&this.paintMirrorLabel(f,m,r+t-y,n,y)};Fa.prototype.paintMirrorLabel=function(f,m,r,n,t){var w=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue=w;if(null!=w&&""!=w){f.setFontColor(mxUtils.getValue(this.style, mxConstants.STYLE_FONTCOLOR,"black"));f.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));f.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));f.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));f.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)));f.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE, 0)));var y=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),L=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),E=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),fa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+E,W=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+E,Ea=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,0))+E;E=parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_SPACING_RIGHT,0))+E;m=y==mxConstants.ALIGN_LEFT?m+Ea:y==mxConstants.ALIGN_RIGHT?m+n-E:m+n/2;r=L==mxConstants.ALIGN_TOP?r+fa+1:L==mxConstants.ALIGN_BOTTOM?r+t-W-1:r+t/2;t="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);fa="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==fa&&(w=Graph.sanitizeHtml(w));f.text(m,r,t?n-Ea-E:0,0,w,y,L,t,fa,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline",Fa);var Ca=mxCellRenderer.prototype.isShapeInvalid; mxCellRenderer.prototype.isShapeInvalid=function(f,m){return Ca.apply(this,arguments)||void 0!==m.mirrorLabelValue&&m.mirrorLabelValue!=f.view.graph.getLabel(f.cell)};mxUtils.extend(Ma,mxShape);Ma.prototype.width=60;Ma.prototype.height=30;Ma.prototype.corner=10;Ma.prototype.configurePointerEvents=function(f){var m=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=m&&m!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style, mxConstants.STYLE_POINTER_EVENTS,"1")||(f.pointerEvents=!1)};Ma.prototype.getLabelMargins=function(f){return new mxRectangle(0,0,f.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),f.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};Ma.prototype.paintBackground=function(f,m,r,n,t){var w=this.corner,y=Math.min(n,Math.max(w,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),L=Math.min(t,Math.max(1.5*w,parseFloat(mxUtils.getValue(this.style, "height",this.height)))),E=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);E!=mxConstants.NONE&&(f.setFillColor(E),f.rect(m,r,n,t),f.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(f,m,r,n,t),f.setGradient(this.fill,this.gradient,m,r,n,t,this.gradientDirection)):f.setFillColor(this.fill);f.pointerEvents=!0;f.begin();f.moveTo(m,r);f.lineTo(m+y,r);f.lineTo(m+y,r+Math.max(0,L-1.5*w));f.lineTo(m+ Math.max(0,y-w),r+L);f.lineTo(m,r+L);f.close();f.fillAndStroke();this.configurePointerEvents(f);f.begin();f.moveTo(m+y,r);f.lineTo(m+n,r);f.lineTo(m+n,r+t);f.lineTo(m,r+t);f.lineTo(m,r+L);f.stroke()};mxCellRenderer.registerShape("umlFrame",Ma);mxPerimeter.CenterPerimeter=function(f,m,r,n){return new mxPoint(f.getCenterX(),f.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=function(f,m,r,n){n=Fa.prototype.size;var t=f.y+f.height;null!= m&&(n=mxUtils.getValue(m.style,"size",n)*m.view.scale,"1"==mxUtils.getValue(m.style,"lifelineMirror","0")&&(t-=n));m=parseFloat(m.style[mxConstants.STYLE_STROKEWIDTH]||1)*m.view.scale/2-1;r.x<f.getCenterX()&&(m=-1*(m+1));return new mxPoint(f.getCenterX()+m,Math.min(t,Math.max(f.y+n,r.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(f,m,r,n){n=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter", mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(f,m,r,n){n=parseFloat(m.style[mxConstants.STYLE_STROKEWIDTH]||1)*m.view.scale/2-1;null!=m.style.backboneSize&&(n+=parseFloat(m.style.backboneSize)*m.view.scale/2-1);if("south"==m.style[mxConstants.STYLE_DIRECTION]||"north"==m.style[mxConstants.STYLE_DIRECTION])return r.x<f.getCenterX()&&(n=-1*(n+1)),new mxPoint(f.getCenterX()+n,Math.min(f.y+f.height,Math.max(f.y,r.y)));r.y<f.getCenterY()&&(n=-1*(n+1));return new mxPoint(Math.min(f.x+ f.width,Math.max(f.x,r.x)),f.getCenterY()+n)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(f,m,r,n){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(f,new mxRectangle(0,0,0,Math.max(0,Math.min(f.height,parseFloat(mxUtils.getValue(m.style,"size",pa.prototype.size))*m.view.scale))),m.style),m,r,n)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(f, m,r,n){var t="0"!=mxUtils.getValue(m.style,"fixedSize","0"),w=t?V.prototype.fixedSize:V.prototype.size;null!=m&&(w=mxUtils.getValue(m.style,"size",w));t&&(w*=m.view.scale);var y=f.x,L=f.y,E=f.width,fa=f.height;m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_SOUTH?(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L),new mxPoint(y+E,L+t),new mxPoint(y+ E,L+fa),new mxPoint(y,L+fa-t),new mxPoint(y,L)]):(t=t?Math.max(0,Math.min(.5*E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y+t,L),new mxPoint(y+E,L),new mxPoint(y+E-t,L+fa),new mxPoint(y,L+fa),new mxPoint(y+t,L)]);fa=f.getCenterX();f=f.getCenterY();f=new mxPoint(fa,f);n&&(r.x<y||r.x>y+E?f.y=r.y:f.x=r.x);return mxUtils.getPerimeterPoint(L,f,r)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(f,m,r,n){var t="0"!=mxUtils.getValue(m.style, "fixedSize","0"),w=t?Q.prototype.fixedSize:Q.prototype.size;null!=m&&(w=mxUtils.getValue(m.style,"size",w));t&&(w*=m.view.scale);var y=f.x,L=f.y,E=f.width,fa=f.height;m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_EAST?(t=t?Math.max(0,Math.min(.5*E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y+t,L),new mxPoint(y+E-t,L),new mxPoint(y+E,L+fa),new mxPoint(y,L+fa),new mxPoint(y+t,L)]):m==mxConstants.DIRECTION_WEST? (t=t?Math.max(0,Math.min(E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L),new mxPoint(y+E,L),new mxPoint(y+E-t,L+fa),new mxPoint(y+t,L+fa),new mxPoint(y,L)]):m==mxConstants.DIRECTION_NORTH?(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L+t),new mxPoint(y+E,L),new mxPoint(y+E,L+fa),new mxPoint(y,L+fa-t),new mxPoint(y,L+t)]):(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L),new mxPoint(y+E,L+t),new mxPoint(y+E,L+fa-t),new mxPoint(y, L+fa),new mxPoint(y,L)]);fa=f.getCenterX();f=f.getCenterY();f=new mxPoint(fa,f);n&&(r.x<y||r.x>y+E?f.y=r.y:f.x=r.x);return mxUtils.getPerimeterPoint(L,f,r)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(f,m,r,n){var t="0"!=mxUtils.getValue(m.style,"fixedSize","0"),w=t?S.prototype.fixedSize:S.prototype.size;null!=m&&(w=mxUtils.getValue(m.style,"size",w));t&&(w*=m.view.scale);var y=f.x,L=f.y,E=f.width,fa=f.height,W=f.getCenterX();f= f.getCenterY();m=null!=m?mxUtils.getValue(m.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_EAST?(t=t?Math.max(0,Math.min(E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L),new mxPoint(y+E-t,L),new mxPoint(y+E,f),new mxPoint(y+E-t,L+fa),new mxPoint(y,L+fa),new mxPoint(y+t,f),new mxPoint(y,L)]):m==mxConstants.DIRECTION_WEST?(t=t?Math.max(0,Math.min(E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y+t,L),new mxPoint(y+E,L),new mxPoint(y+ E-t,f),new mxPoint(y+E,L+fa),new mxPoint(y+t,L+fa),new mxPoint(y,f),new mxPoint(y+t,L)]):m==mxConstants.DIRECTION_NORTH?(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L+t),new mxPoint(W,L),new mxPoint(y+E,L+t),new mxPoint(y+E,L+fa),new mxPoint(W,L+fa-t),new mxPoint(y,L+fa),new mxPoint(y,L+t)]):(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(y,L),new mxPoint(W,L+t),new mxPoint(y+E,L),new mxPoint(y+E,L+fa-t),new mxPoint(W,L+fa),new mxPoint(y, L+fa-t),new mxPoint(y,L)]);W=new mxPoint(W,f);n&&(r.x<y||r.x>y+E?W.y=r.y:W.x=r.x);return mxUtils.getPerimeterPoint(L,W,r)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(f,m,r,n){var t="0"!=mxUtils.getValue(m.style,"fixedSize","0"),w=t?U.prototype.fixedSize:U.prototype.size;null!=m&&(w=mxUtils.getValue(m.style,"size",w));t&&(w*=m.view.scale);var y=f.x,L=f.y,E=f.width,fa=f.height,W=f.getCenterX();f=f.getCenterY();m=null!=m?mxUtils.getValue(m.style, mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;m==mxConstants.DIRECTION_NORTH||m==mxConstants.DIRECTION_SOUTH?(t=t?Math.max(0,Math.min(fa,w)):fa*Math.max(0,Math.min(1,w)),L=[new mxPoint(W,L),new mxPoint(y+E,L+t),new mxPoint(y+E,L+fa-t),new mxPoint(W,L+fa),new mxPoint(y,L+fa-t),new mxPoint(y,L+t),new mxPoint(W,L)]):(t=t?Math.max(0,Math.min(E,w)):E*Math.max(0,Math.min(1,w)),L=[new mxPoint(y+t,L),new mxPoint(y+E-t,L),new mxPoint(y+E,f),new mxPoint(y+E-t,L+fa),new mxPoint(y+ t,L+fa),new mxPoint(y,f),new mxPoint(y+t,L)]);W=new mxPoint(W,f);n&&(r.x<y||r.x>y+E?W.y=r.y:W.x=r.x);return mxUtils.getPerimeterPoint(L,W,r)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ab,mxShape);ab.prototype.size=10;ab.prototype.paintBackground=function(f,m,r,n,t){var w=parseFloat(mxUtils.getValue(this.style,"size",this.size));f.translate(m,r);f.ellipse((n-w)/2,0,w,w);f.fillAndStroke();f.begin();f.moveTo(n/2,w);f.lineTo(n/2,t);f.end();f.stroke()}; mxCellRenderer.registerShape("lollipop",ab);mxUtils.extend(Za,mxShape);Za.prototype.size=10;Za.prototype.inset=2;Za.prototype.paintBackground=function(f,m,r,n,t){var w=parseFloat(mxUtils.getValue(this.style,"size",this.size)),y=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(m,r);f.begin();f.moveTo(n/2,w+y);f.lineTo(n/2,t);f.end();f.stroke();f.begin();f.moveTo((n-w)/2-y,w/2);f.quadTo((n-w)/2-y,w+y,n/2,w+y);f.quadTo((n+w)/2+y,w+y,(n+w)/2+y,w/2);f.end();f.stroke()}; mxCellRenderer.registerShape("requires",Za);mxUtils.extend(Xa,mxShape);Xa.prototype.paintBackground=function(f,m,r,n,t){f.translate(m,r);f.begin();f.moveTo(0,0);f.quadTo(n,0,n,t/2);f.quadTo(n,t,0,t);f.end();f.stroke()};mxCellRenderer.registerShape("requiredInterface",Xa);mxUtils.extend(Va,mxShape);Va.prototype.inset=2;Va.prototype.paintBackground=function(f,m,r,n,t){var w=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;f.translate(m,r);f.ellipse(0,w,n-2*w,t-2*w);f.fillAndStroke(); f.begin();f.moveTo(n/2,0);f.quadTo(n,0,n,t/2);f.quadTo(n,t,n/2,t);f.end();f.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",Va);mxUtils.extend(ja,mxCylinder);ja.prototype.jettyWidth=20;ja.prototype.jettyHeight=10;ja.prototype.redrawPath=function(f,m,r,n,t,w){var y=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));m=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));r=y/2;y=r+y/2;var L=Math.min(m,t-m),E=Math.min(L+2*m,t-m);w?(f.moveTo(r,L), f.lineTo(y,L),f.lineTo(y,L+m),f.lineTo(r,L+m),f.moveTo(r,E),f.lineTo(y,E),f.lineTo(y,E+m),f.lineTo(r,E+m)):(f.moveTo(r,0),f.lineTo(n,0),f.lineTo(n,t),f.lineTo(r,t),f.lineTo(r,E+m),f.lineTo(0,E+m),f.lineTo(0,E),f.lineTo(r,E),f.lineTo(r,L+m),f.lineTo(0,L+m),f.lineTo(0,L),f.lineTo(r,L),f.close());f.end()};mxCellRenderer.registerShape("module",ja);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=32;ya.prototype.jettyHeight=12;ya.prototype.redrawPath=function(f,m,r,n,t,w){var y=parseFloat(mxUtils.getValue(this.style, "jettyWidth",this.jettyWidth));m=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));r=y/2;y=r+y/2;var L=.3*t-m/2,E=.7*t-m/2;w?(f.moveTo(r,L),f.lineTo(y,L),f.lineTo(y,L+m),f.lineTo(r,L+m),f.moveTo(r,E),f.lineTo(y,E),f.lineTo(y,E+m),f.lineTo(r,E+m)):(f.moveTo(r,0),f.lineTo(n,0),f.lineTo(n,t),f.lineTo(r,t),f.lineTo(r,E+m),f.lineTo(0,E+m),f.lineTo(0,E),f.lineTo(r,E),f.lineTo(r,L+m),f.lineTo(0,L+m),f.lineTo(0,L),f.lineTo(r,L),f.close());f.end()};mxCellRenderer.registerShape("component", ya);mxUtils.extend(db,mxRectangleShape);db.prototype.paintForeground=function(f,m,r,n,t){var w=n/2,y=t/2,L=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;f.begin();this.addPoints(f,[new mxPoint(m+w,r),new mxPoint(m+n,r+y),new mxPoint(m+w,r+t),new mxPoint(m,r+y)],this.isRounded,L,!0);f.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",db);mxUtils.extend(mb,mxDoubleEllipse);mb.prototype.outerStroke= !0;mb.prototype.paintVertexShape=function(f,m,r,n,t){var w=Math.min(4,Math.min(n/5,t/5));0<n&&0<t&&(f.ellipse(m+w,r+w,n-2*w,t-2*w),f.fillAndStroke());f.setShadow(!1);this.outerStroke&&(f.ellipse(m,r,n,t),f.stroke())};mxCellRenderer.registerShape("endState",mb);mxUtils.extend(kb,mb);kb.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",kb);mxUtils.extend(zb,mxArrowConnector);zb.prototype.defaultWidth=4;zb.prototype.isOpenEnded=function(){return!0};zb.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style, "width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};zb.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",zb);mxUtils.extend(ub,mxArrowConnector);ub.prototype.defaultWidth=10;ub.prototype.defaultArrowWidth=20;ub.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};ub.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth", this.defaultArrowWidth)};ub.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",ub);mxUtils.extend(ib,mxActor);ib.prototype.size=30;ib.prototype.isRoundable=function(){return!0};ib.prototype.getLabelMargins=function(f){return mxUtils.getValue(this.style,"boundedLbl",!1)?(f=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,f,0,0)):null};ib.prototype.redrawPath= function(f,m,r,n,t){m=Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,t),new mxPoint(0,m),new mxPoint(n,0),new mxPoint(n,t)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("manualInput",ib);mxUtils.extend(tb,mxRectangleShape);tb.prototype.dx=20;tb.prototype.dy=20;tb.prototype.isHtmlAllowed=function(){return!1};tb.prototype.paintForeground=function(f, m,r,n,t){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var w=0;if(this.isRounded){var y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;w=Math.max(w,Math.min(n*y,t*y))}y=Math.max(w,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));w=Math.max(w,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));f.begin();f.moveTo(m,r+w);f.lineTo(m+n,r+w);f.end();f.stroke();f.begin();f.moveTo(m+y,r);f.lineTo(m+y, r+t);f.end();f.stroke()};mxCellRenderer.registerShape("internalStorage",tb);mxUtils.extend(rb,mxActor);rb.prototype.dx=20;rb.prototype.dy=20;rb.prototype.isRoundable=function(){return!0};rb.prototype.redrawPath=function(f,m,r,n,t){m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));r=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var w=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE, mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,r),new mxPoint(m,r),new mxPoint(m,t),new mxPoint(0,t)],this.isRounded,w,!0);f.end()};mxCellRenderer.registerShape("corner",rb);mxUtils.extend(eb,mxActor);eb.prototype.redrawPath=function(f,m,r,n,t){f.moveTo(0,0);f.lineTo(0,t);f.end();f.moveTo(n,0);f.lineTo(n,t);f.end();f.moveTo(0,t/2);f.lineTo(n,t/2);f.end()};mxCellRenderer.registerShape("crossbar",eb);mxUtils.extend(fb,mxActor);fb.prototype.dx=20;fb.prototype.dy= 20;fb.prototype.isRoundable=function(){return!0};fb.prototype.redrawPath=function(f,m,r,n,t){m=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));r=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var w=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,r),new mxPoint((n+m)/2,r),new mxPoint((n+ m)/2,t),new mxPoint((n-m)/2,t),new mxPoint((n-m)/2,r),new mxPoint(0,r)],this.isRounded,w,!0);f.end()};mxCellRenderer.registerShape("tee",fb);mxUtils.extend(jb,mxActor);jb.prototype.arrowWidth=.3;jb.prototype.arrowSize=.2;jb.prototype.isRoundable=function(){return!0};jb.prototype.redrawPath=function(f,m,r,n,t){var w=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))); r=(t-w)/2;w=r+w;var y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,r),new mxPoint(n-m,r),new mxPoint(n-m,0),new mxPoint(n,t/2),new mxPoint(n-m,t),new mxPoint(n-m,w),new mxPoint(0,w)],this.isRounded,y,!0);f.end()};mxCellRenderer.registerShape("singleArrow",jb);mxUtils.extend(vb,mxActor);vb.prototype.isRoundable=function(){return!0};vb.prototype.redrawPath=function(f,m,r,n,t){var w=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, "arrowWidth",jb.prototype.arrowWidth))));m=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",jb.prototype.arrowSize))));r=(t-w)/2;w=r+w;var y=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,t/2),new mxPoint(m,0),new mxPoint(m,r),new mxPoint(n-m,r),new mxPoint(n-m,0),new mxPoint(n,t/2),new mxPoint(n-m,t),new mxPoint(n-m,w),new mxPoint(m,w),new mxPoint(m,t)],this.isRounded,y,!0);f.end()};mxCellRenderer.registerShape("doubleArrow", vb);mxUtils.extend(nb,mxActor);nb.prototype.size=.1;nb.prototype.fixedSize=20;nb.prototype.redrawPath=function(f,m,r,n,t){m="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));f.moveTo(m,0);f.lineTo(n,0);f.quadTo(n-2*m,t/2,n,t);f.lineTo(m,t);f.quadTo(m-2*m,t/2,m,0);f.close();f.end()};mxCellRenderer.registerShape("dataStorage",nb); mxUtils.extend(Vb,mxActor);Vb.prototype.redrawPath=function(f,m,r,n,t){f.moveTo(0,0);f.quadTo(n,0,n,t/2);f.quadTo(n,t,0,t);f.close();f.end()};mxCellRenderer.registerShape("or",Vb);mxUtils.extend(Gb,mxActor);Gb.prototype.redrawPath=function(f,m,r,n,t){f.moveTo(0,0);f.quadTo(n,0,n,t/2);f.quadTo(n,t,0,t);f.quadTo(n/2,t/2,0,0);f.close();f.end()};mxCellRenderer.registerShape("xor",Gb);mxUtils.extend(Hb,mxActor);Hb.prototype.size=20;Hb.prototype.isRoundable=function(){return!0};Hb.prototype.redrawPath= function(f,m,r,n,t){m=Math.min(n/2,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(m,0),new mxPoint(n-m,0),new mxPoint(n,.8*m),new mxPoint(n,t),new mxPoint(0,t),new mxPoint(0,.8*m)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("loopLimit",Hb);mxUtils.extend(Lb,mxActor);Lb.prototype.size=.375;Lb.prototype.isRoundable=function(){return!0};Lb.prototype.redrawPath= function(f,m,r,n,t){m=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(f,[new mxPoint(0,0),new mxPoint(n,0),new mxPoint(n,t-m),new mxPoint(n/2,t),new mxPoint(0,t-m)],this.isRounded,r,!0);f.end()};mxCellRenderer.registerShape("offPageConnector",Lb);mxUtils.extend(Mb,mxEllipse);Mb.prototype.paintVertexShape=function(f,m,r,n,t){mxEllipse.prototype.paintVertexShape.apply(this, arguments);f.begin();f.moveTo(m+n/2,r+t);f.lineTo(m+n,r+t);f.end();f.stroke()};mxCellRenderer.registerShape("tapeData",Mb);mxUtils.extend(Wb,mxEllipse);Wb.prototype.paintVertexShape=function(f,m,r,n,t){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(m,r+t/2);f.lineTo(m+n,r+t/2);f.end();f.stroke();f.begin();f.moveTo(m+n/2,r);f.lineTo(m+n/2,r+t);f.end();f.stroke()};mxCellRenderer.registerShape("orEllipse",Wb);mxUtils.extend(Tb,mxEllipse);Tb.prototype.paintVertexShape= function(f,m,r,n,t){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(m+.145*n,r+.145*t);f.lineTo(m+.855*n,r+.855*t);f.end();f.stroke();f.begin();f.moveTo(m+.855*n,r+.145*t);f.lineTo(m+.145*n,r+.855*t);f.end();f.stroke()};mxCellRenderer.registerShape("sumEllipse",Tb);mxUtils.extend($b,mxRhombus);$b.prototype.paintVertexShape=function(f,m,r,n,t){mxRhombus.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();f.moveTo(m,r+t/2);f.lineTo(m+ n,r+t/2);f.end();f.stroke()};mxCellRenderer.registerShape("sortShape",$b);mxUtils.extend(Xb,mxEllipse);Xb.prototype.paintVertexShape=function(f,m,r,n,t){f.begin();f.moveTo(m,r);f.lineTo(m+n,r);f.lineTo(m+n/2,r+t/2);f.close();f.fillAndStroke();f.begin();f.moveTo(m,r+t);f.lineTo(m+n,r+t);f.lineTo(m+n/2,r+t/2);f.close();f.fillAndStroke()};mxCellRenderer.registerShape("collate",Xb);mxUtils.extend(Yb,mxEllipse);Yb.prototype.paintVertexShape=function(f,m,r,n,t){var w=f.state.strokeWidth/2,y=10+2*w,L=r+ t-y/2;f.begin();f.moveTo(m,r);f.lineTo(m,r+t);f.moveTo(m+w,L);f.lineTo(m+w+y,L-y/2);f.moveTo(m+w,L);f.lineTo(m+w+y,L+y/2);f.moveTo(m+w,L);f.lineTo(m+n-w,L);f.moveTo(m+n,r);f.lineTo(m+n,r+t);f.moveTo(m+n-w,L);f.lineTo(m+n-y-w,L-y/2);f.moveTo(m+n-w,L);f.lineTo(m+n-y-w,L+y/2);f.end();f.stroke()};mxCellRenderer.registerShape("dimension",Yb);mxUtils.extend(Ib,mxEllipse);Ib.prototype.drawHidden=!0;Ib.prototype.paintVertexShape=function(f,m,r,n,t){this.outline||f.setStrokeColor(null);if(null!=this.style){var w= f.pointerEvents,y=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||y||(f.pointerEvents=!1);var L="1"==mxUtils.getValue(this.style,"top","1"),E="1"==mxUtils.getValue(this.style,"left","1"),fa="1"==mxUtils.getValue(this.style,"right","1"),W="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||y||this.outline||L||fa||W||E?(f.rect(m,r,n,t),f.fill(),f.pointerEvents=w,f.setStrokeColor(this.stroke),f.setLineCap("square"),f.begin(), f.moveTo(m,r),this.outline||L?f.lineTo(m+n,r):f.moveTo(m+n,r),this.outline||fa?f.lineTo(m+n,r+t):f.moveTo(m+n,r+t),this.outline||W?f.lineTo(m,r+t):f.moveTo(m,r+t),(this.outline||E)&&f.lineTo(m,r),f.end(),f.stroke(),f.setLineCap("flat")):f.setStrokeColor(this.stroke)}null==this.state||this.outline||null==this.fill||this.fill==mxConstants.NONE||(w=this.state.view.graph,null!=w.paintTableCellLines&&w.paintTableCellLines(f,this.state.cell,m,r,n,t,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle", Ib);mxUtils.extend(lb,mxEllipse);lb.prototype.paintVertexShape=function(f,m,r,n,t){mxEllipse.prototype.paintVertexShape.apply(this,arguments);f.setShadow(!1);f.begin();"vertical"==mxUtils.getValue(this.style,"line")?(f.moveTo(m+n/2,r),f.lineTo(m+n/2,r+t)):(f.moveTo(m,r+t/2),f.lineTo(m+n,r+t/2));f.end();f.stroke()};mxCellRenderer.registerShape("lineEllipse",lb);mxUtils.extend(Nb,mxActor);Nb.prototype.redrawPath=function(f,m,r,n,t){m=Math.min(n,t/2);f.moveTo(0,0);f.lineTo(n-m,0);f.quadTo(n,0,n,t/2); f.quadTo(n,t,n-m,t);f.lineTo(0,t);f.close();f.end()};mxCellRenderer.registerShape("delay",Nb);mxUtils.extend(Ab,mxActor);Ab.prototype.size=.2;Ab.prototype.redrawPath=function(f,m,r,n,t){m=Math.min(t,n);var w=Math.max(0,Math.min(m,m*parseFloat(mxUtils.getValue(this.style,"size",this.size))));m=(t-w)/2;r=m+w;var y=(n-w)/2;w=y+w;f.moveTo(0,m);f.lineTo(y,m);f.lineTo(y,0);f.lineTo(w,0);f.lineTo(w,m);f.lineTo(n,m);f.lineTo(n,r);f.lineTo(w,r);f.lineTo(w,t);f.lineTo(y,t);f.lineTo(y,r);f.lineTo(0,r);f.close(); f.end()};mxCellRenderer.registerShape("cross",Ab);mxUtils.extend(Db,mxActor);Db.prototype.size=.25;Db.prototype.redrawPath=function(f,m,r,n,t){m=Math.min(n,t/2);r=Math.min(n-m,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*n);f.moveTo(0,t/2);f.lineTo(r,0);f.lineTo(n-m,0);f.quadTo(n,0,n,t/2);f.quadTo(n,t,n-m,t);f.lineTo(r,t);f.close();f.end()};mxCellRenderer.registerShape("display",Db);mxUtils.extend(bb,mxActor);bb.prototype.cst={RECT2:"mxgraph.basic.rect"};bb.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"}]}];bb.prototype.paintVertexShape=function(f,m,r,n,t){f.translate(m,r);this.strictDrawShape(f,0,0,n,t)};bb.prototype.strictDrawShape=function(f,m,r,n,t,w){var y=w&&w.rectStyle?w.rectStyle: mxUtils.getValue(this.style,"rectStyle",this.rectStyle),L=w&&w.absoluteCornerSize?w.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),E=w&&w.size?w.size:Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),fa=w&&w.rectOutline?w.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),W=w&&w.indent?w.indent:Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ea=w&&w.dashed?w.dashed: mxUtils.getValue(this.style,"dashed",!1),Wa=w&&w.dashPattern?w.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),Pa=w&&w.relIndent?w.relIndent:Math.max(0,Math.min(50,W)),wa=w&&w.top?w.top:mxUtils.getValue(this.style,"top",!0),Aa=w&&w.right?w.right:mxUtils.getValue(this.style,"right",!0),Da=w&&w.bottom?w.bottom:mxUtils.getValue(this.style,"bottom",!0),xa=w&&w.left?w.left:mxUtils.getValue(this.style,"left",!0),Ha=w&&w.topLeftStyle?w.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle", "default"),Ja=w&&w.topRightStyle?w.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Oa=w&&w.bottomRightStyle?w.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Ta=w&&w.bottomLeftStyle?w.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Sb=w&&w.fillColor?w.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");w&&w.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var ac=w&&w.strokeWidth?w.strokeWidth:mxUtils.getValue(this.style, "strokeWidth","1"),bc=w&&w.fillColor2?w.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),cc=w&&w.gradientColor2?w.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),dc=w&&w.gradientDirection2?w.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),ec=w&&w.opacity?w.opacity:mxUtils.getValue(this.style,"opacity","100"),fc=Math.max(0,Math.min(50,E));w=bb.prototype;f.setDashed(Ea);Wa&&""!=Wa&&f.setDashPattern(Wa);f.setStrokeWidth(ac);E=Math.min(.5*t, .5*n,E);L||(E=fc*Math.min(n,t)/100);E=Math.min(E,.5*Math.min(n,t));L||(W=Math.min(Pa*Math.min(n,t)/100));W=Math.min(W,.5*Math.min(n,t)-E);(wa||Aa||Da||xa)&&"frame"!=fa&&(f.begin(),wa?w.moveNW(f,m,r,n,t,y,Ha,E,xa):f.moveTo(0,0),wa&&w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),Aa&&w.paintNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),Da&&w.paintSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),xa&&w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa), f.close(),f.fill(),f.setShadow(!1),f.setFillColor(bc),Ea=L=ec,"none"==bc&&(L=0),"none"==cc&&(Ea=0),f.setGradient(bc,cc,0,0,n,t,dc,L,Ea),f.begin(),wa?w.moveNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa):f.moveTo(W,0),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),xa&&Da&&w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),Da&&Aa&&w.paintSEInner(f,m,r,n,t,y,Oa,E,W),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),Aa&&wa&&w.paintNEInner(f,m,r,n,t,y,Ja,E,W),w.paintTopInner(f,m,r,n,t,y,Ha,E,W, xa,wa),wa&&xa&&w.paintNWInner(f,m,r,n,t,y,Ha,E,W),f.fill(),"none"==Sb&&(f.begin(),w.paintFolds(f,m,r,n,t,y,Ha,Ja,Oa,Ta,E,wa,Aa,Da,xa),f.stroke()));wa||Aa||Da||!xa?wa||Aa||!Da||xa?!wa&&!Aa&&Da&&xa?"frame"!=fa?(f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),"double"==fa&&(w.moveNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f, m,r,n,t,y,Oa,E,W,Aa,Da)),f.stroke()):(f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.lineNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),f.close(),f.fillAndStroke()):wa||!Aa||Da||xa?!wa&&Aa&&!Da&&xa?"frame"!=fa?(f.begin(),w.moveSW(f,m,r,n,t,y,Ha,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),"double"== fa&&(w.moveNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa)),f.stroke(),f.begin(),w.moveNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),"double"==fa&&(w.moveSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa)),f.stroke()):(f.begin(),w.moveSW(f,m,r,n,t,y,Ha,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.lineNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),f.close(),f.fillAndStroke(),f.begin(),w.moveNE(f,m,r,n,t,y,Ja, E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.lineSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),f.close(),f.fillAndStroke()):!wa&&Aa&&Da&&!xa?"frame"!=fa?(f.begin(),w.moveNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.paintSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),"double"==fa&&(w.moveSWInner(f,m,r,n,t,y,Ta,E,W,xa),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),w.paintSEInner(f,m,r,n,t,y,Oa,E,W),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa)),f.stroke()): (f.begin(),w.moveNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.paintSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.lineSWInner(f,m,r,n,t,y,Ta,E,W,xa),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),w.paintSEInner(f,m,r,n,t,y,Oa,E,W),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),f.close(),f.fillAndStroke()):!wa&&Aa&&Da&&xa?"frame"!=fa?(f.begin(),w.moveNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.paintSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f, m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),"double"==fa&&(w.moveNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),w.paintSEInner(f,m,r,n,t,y,Oa,E,W),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa)),f.stroke()):(f.begin(),w.moveNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.paintSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f, m,r,n,t,y,Ha,E,wa),w.lineNWInner(f,m,r,n,t,y,Ha,E,W,wa,xa),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),w.paintSEInner(f,m,r,n,t,y,Oa,E,W),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),f.close(),f.fillAndStroke()):!wa||Aa||Da||xa?wa&&!Aa&&!Da&&xa?"frame"!=fa?(f.begin(),w.moveSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),"double"==fa&&(w.moveNEInner(f, m,r,n,t,y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa)),f.stroke()):(f.begin(),w.moveSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.lineNEInner(f,m,r,n,t,y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),f.close(),f.fillAndStroke()):wa&&!Aa&&Da&&!xa?"frame"!= fa?(f.begin(),w.moveNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),"double"==fa&&(w.moveNEInner(f,m,r,n,t,y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa)),f.stroke(),f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),"double"==fa&&(w.moveSWInner(f,m,r,n,t,y,Ta,E,W,xa),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da)),f.stroke()):(f.begin(),w.moveNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.lineNEInner(f,m,r,n,t,y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n, t,y,Ha,E,W,xa,wa),f.close(),f.fillAndStroke(),f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.lineSWInner(f,m,r,n,t,y,Ta,E,W,xa),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),f.close(),f.fillAndStroke()):wa&&!Aa&&Da&&xa?"frame"!=fa?(f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),"double"==fa&&(w.moveNEInner(f,m,r,n,t, y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da)),f.stroke()):(f.begin(),w.moveSE(f,m,r,n,t,y,Oa,E,Aa),w.paintBottom(f,m,r,n,t,y,Ta,E,xa),w.paintSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.lineNEInner(f,m,r,n,t,y,Ja,E,W,Aa),w.paintTopInner(f,m,r,n,t,y,Ha,E, W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa),w.paintSWInner(f,m,r,n,t,y,Ta,E,W,Da),w.paintBottomInner(f,m,r,n,t,y,Oa,E,W,Aa,Da),f.close(),f.fillAndStroke()):wa&&Aa&&!Da&&!xa?"frame"!=fa?(f.begin(),w.moveNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.paintNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),"double"==fa&&(w.moveSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),w.paintNEInner(f,m,r,n,t,y,Ja,E,W),w.paintTopInner(f, m,r,n,t,y,Ha,E,W,xa,wa)),f.stroke()):(f.begin(),w.moveNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.paintNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.lineSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),w.paintNEInner(f,m,r,n,t,y,Ja,E,W),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),f.close(),f.fillAndStroke()):wa&&Aa&&!Da&&xa?"frame"!=fa?(f.begin(),w.moveSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f, m,r,n,t,y,Ja,E,Aa),w.paintNE(f,m,r,n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),"double"==fa&&(w.moveSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),w.paintNEInner(f,m,r,n,t,y,Ja,E,W),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W,Da,xa)),f.stroke()):(f.begin(),w.moveSW(f,m,r,n,t,y,Ta,E,Da),w.paintLeft(f,m,r,n,t,y,Ha,E,wa),w.paintNW(f,m,r,n,t,y,Ha,E,xa),w.paintTop(f,m,r,n,t,y,Ja,E,Aa),w.paintNE(f,m,r, n,t,y,Ja,E,wa),w.paintRight(f,m,r,n,t,y,Oa,E,Da),w.lineSEInner(f,m,r,n,t,y,Oa,E,W,Da),w.paintRightInner(f,m,r,n,t,y,Ja,E,W,wa,Aa),w.paintNEInner(f,m,r,n,t,y,Ja,E,W),w.paintTopInner(f,m,r,n,t,y,Ha,E,W,xa,wa),w.paintNWInner(f,m,r,n,t,y,Ha,E,W),w.paintLeftInner(f,m,r,n,t,y,Ta,E,W