/*
 * GoJS v1.3.8 JavaScript Library for HTML Canvas Diagrams
 * Northwoods Software, http://www.nwoods.com/
 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
 * Copyright (C) 1998-2014 by Northwoods Software Corporation.  All Rights Reserved.
 * THIS SOFTWARE IS LICENSED.  THE LICENSE AGREEMENT IS AT: http://www.gojs.net/1.3.8/doc/license.html.
 */
(function(window) { var aa,ba={};if(void 0===document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.prototype.__defineGetter__&&!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
Object.prototype.__defineGetter__&&!Object.defineProperty&&(Object.defineProperty=function(a,b,c){c.get&&a.__defineGetter__(b,c.get);c.set&&a.__defineSetter__(b,c.set)});Object.prototype.__lookupGetter__&&!Object.getOwnPropertyDescriptor&&(Object.getOwnPropertyDescriptor=function(a,b){return{get:a.__lookupGetter__(b),set:a.__lookupSetter__(b)}});Object.getPrototypeOf||(Object.getPrototypeOf=function(a){return a.__proto__});Object.isFrozen||(Object.isFrozen=function(a){return!0===a.zG});
Object.freeze||(Object.freeze=function(a){a.zG=!0});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return g.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),g=this;c.prototype=this.prototype;b.prototype=new c;return b});
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),g=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+g)},g);a=c+g;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(a){clearTimeout(a)})})();
var f={Gi:!1,Uz:!1,UD:!1,NH:!1,PH:!1,XE:!1,mE:!1,jD:!1,assert:function(a,b){if(!a&&f.jD)throw window&&(t.trace(b),window.alert(b)),Error(b);},Ds:null,enableBoundsInfo:function(a){f.Gi=!0;a&&a.ot()},disableBoundsInfo:function(a){f.Gi=!1;a&&(ca(a),a.ot())},RD:function(a,b){void 0===a&&(a=f.Ds);void 0===b&&(b=a.il("").cb);var c=b.length,d=a.Pa.getContext("2d");d.fillStyle="rgba(255,255,0,.3)";for(var e=0;e<c;e++){var g=b.qa(e),h=g.ya;if(null!==g.za)f.RD(a,g.za);else{var k=g.Xh.copy();k.yA(g.bd);d.save();
d.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy);d.fillRect(h.x,h.y,h.width,h.height);d.restore()}}},SD:function(a,b){a||(a=f.Ds);b||(b=a.il("").cb);var c=a.Pa.getContext("2d"),d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.qa(e),h=g.Ia,k=g.Xh;null!==g.za?f.SD(a,g.za):(c.save(),c.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy),c.fillRect(h.x,h.y,h.width,h.height),c.restore())}},IH:function(a,b){a||(a=f.Ds);b||(b=a.il("").cb);var c=a.Pa.getContext("2d"),d=b.length;c.fillStyle="rgba(0,0,255,.3)";
for(var e=0;e<d;e++){var g=b.qa(e),h=g.Ea,k=g.Xh;null!==g.za?f.IH(a,g.za):(c.save(),c.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy),c.fillRect(h.x||0,h.y||0,h.width,h.height),c.restore())}},qJ:function(){f.SD();f.RD()},rJ:function(a){a||(a=f.Ds);var b=a.vc;a=a.Pa.getContext("2d");a.strokeStyle="rgba(0,255,0,.9)";a.strokeRect(b.x,b.y,b.width,b.height)},TD:function(a,b){b.fillStyle="red";b.fillRect(0,0,8,8);b.lineWidth=8;b.strokeStyle="rgba(255,255,0,.6)";var c=a.nb;b.strokeRect(c.x,c.y,c.width,c.height);
b.fillStyle="rgba(0,255,0,.2)";b.fillRect(a.vc.x,a.vc.y,a.vc.width,a.vc.height)},JH:function(a,b){a.lineWidth=2;a.strokeStyle="rgba(255,0,0,.5)";a.strokeRect(b.Fb.x,b.Fb.y,b.Fb.width,b.Fb.height);void 0!==b.stroke&&(a.strokeStyle=b.stroke);void 0!==b.fe&&(a.lineWidth=b.fe);null!==b.ga&&b.ga.type===ea&&(a.lineWidth=1,a.strokeStyle="rgba(10,200,10,.6)",void 0!==b.stroke&&(a.strokeStyle=b.stroke),void 0!==b.fe&&(a.lineWidth=b.fe))},KH:function(a,b){a.lineWidth=1;a.strokeStyle="rgba(0,0,255,.5)";a.strokeRect(b.Ia.x,
b.Ia.y,b.Ia.width,b.Ia.height);void 0!==b.stroke&&(a.strokeStyle=b.stroke);void 0!==b.fe&&(a.lineWidth=b.fe)},Tz:function(a,b,c){a.setTransform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);c=b.Kb.length;for(var d=0;d<c;d++)for(var e=b.Kb.qa(d),g=e.cb.length,h=0;h<g;h++){var k=e.cb.qa(h);if(void 0!==k.location&&null!==k.location){if(k.location.Q()){var l=k.location.x,m=k.location.y;a.beginPath();a.strokeStyle="limegreen";a.lineWidth=2;a.moveTo(l,m+6);a.lineTo(l,m);a.lineTo(l+6,m);a.moveTo(l,m);a.lineTo(l+10,
m+20);a.stroke()}l=k.position.x;m=k.position.y;a.beginPath();a.strokeStyle="red";a.lineWidth=2;a.moveTo(l,m+6);a.lineTo(l,m);a.lineTo(l+6,m);a.moveTo(l,m);a.lineTo(l+20,m+10);a.stroke()}}a.setTransform(1,0,0,1,0,0)},OH:function(a,b,c){var d=a.length;b.fillStyle="rgba(255,0,0,.1)";for(var e=0;e<d;e++){var g=ga(c,a[e]);b.fillRect(g[0],g[1],g[2],g[3])}},LH:function(a,b,c,d,e){a.fillStyle="rgba(0,255,0,.2)";a.fillRect(b,c,d,e)},MH:function(a,b,c){a.save();var d=b.bd;d.reset();1!==b.Sb&&d.scale(b.Sb);
b=b.rb;0===b.x&&0===b.y||d.translate(-b.x,-b.y);a.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=c.mc.p;d=c.length;for(b=0;b<d;b++){var e=c[b];a.beginPath();a.moveTo(e.x-4,e.y);a.lineTo(e.x+4,e.y);a.moveTo(e.x,e.y-4);a.lineTo(e.x,e.y+4);a.lineWidth=2;a.strokeStyle="rgba(255,0,0,.9)";a.stroke()}a.restore()},pJ:function(a){a||(a=f.Ds);for(a=a.Tm;a.next();)t.trace(a.value.toString())},GJ:function(a,b){var c=b.Hg(a),d=b.cc;d.Ac=b.gn(c);d.W=c;return ha(b,d,a)},DJ:function(a,b){b.Rd(a.W)&&(b.Tf.fillStyle=
"lime",b.Tf.Dl="lime",b.Tf.fillRect(a.Ac.x,a.Ac.y,1*b.scale,1*b.scale))},EJ:function(a){var b=ia(a,!1,null);if(!b.Zo){a=a.Tf;for(var c=0;c<=b.rm;c++)for(var d=0;d<=b.sm;d++){var e=b.bc[c][d];if(e!==ja){var g=c*b.vd+b.Bf,h=d*b.kd+b.Cf;0!==e&&(a.fillStyle="rgba(255, 0, 0, .2)",a.fillRect(g,h,b.vd,b.kd));e>=ka||(e%=10,a.fillStyle="blue",a.fillText(e.toString(),g,h+b.kd))}}}},RH:function(a){if(a instanceof u)for(a=a.Tm;a.next();){var b=a.value;t.trace(b.toString());for(b=b.rl;b.next();)f.RH(b.value)}else if(a instanceof
w){t.trace("References for "+a);a.layer&&t.trace("  "+a.layer.toString()+' LayerName: "'+a.Xd+'"');a.an!==a&&t.trace("  SelectionObject: "+a.an.toString()+' SelectionObjectName: "'+a.vt+'"');a.Ub!==a&&t.trace("  LocationObject: "+a.Ub.toString()+' LocationObjectName: "'+a.Zs+'"');if(a.Bg){for(var c="",b=a.Bg.k;b.next();)c+=b.key+" ";t.trace("  Adornments: "+c)}a.fb&&t.trace("  ContainingGroup: "+a.fb.toString());if(a instanceof y){if(a.yd)for(b=a.yd.k;b.next(););if(0<a.Dd.count){c="";for(b=a.Dd;b.next();)c+=
b.value.toString()+", ";t.trace("  Links: "+c)}a.Tc&&t.trace("  LabeledLink: "+a.Tc.toString());if(a instanceof z){t.trace("  Placeholder: "+a.placeholder);c="";for(b=a.Ic;b.next();)c+=b.value.toString()+", ";t.trace("  Members: "+c);c="";for(b=a.bm.k;b.next();)c+=b.value.toString()+", ";t.trace("  NestedGroups: "+c);t.trace("  Layout: "+a.Tb)}}else if(a instanceof A){t.trace("  Path: "+a.path);t.trace("  From: "+a.da+" "+a.Sc+' "'+a.nf+'"');t.trace("  To: "+a.ja+" "+a.Ed+' "'+a.Qf+'"');c="";for(b=
a.Ui;b.next();)c+=b.value.toString()+", ";t.trace("  LabelNodes: "+c)}}},SH:function(a){if(a instanceof u)for(a=a.Tm;a.next();){var b=a.value;t.trace(b.toString());for(b=b.rl;b.next();)f.SH(b.value)}else a instanceof w&&(b=" ",a.Oz&&(b+="c"),a.Rz&&(b+="d"),a.eA&&(b+="g"),a.xA&&(b+="m"),a.RA&&(b+="h"),a.SA&&(b+="z"),a.TA&&(b+="o"),a.jk&&(b+="s"),a.hB&&(b+="t"),a.WA&&(b+="A"),a.rw&&(b+="B"),a.tw&&(b+="L"),a.bb&&(b+="S"),a.Lh&&(b+="H"),f.YB(a,1,b))},YB:function(a,b,c){for(var d="",e=0;e<b;e++)d+="  ";
d+=a.toString();c&&(d+=c);c=" ";c=a.visible?c+"v":c+"~";a.Ze&&(c+="p");a.Jh&&(c+="m");a.Rs&&(c+="a");d=d+c+(" "+a.ya.toString());a.Ca.Q()&&(d+=" d:"+a.Ca.toString());a.Ia.Q()&&(d+=" n:"+a.Ia.toString());1!==a.scale&&(d+=" s:"+a.scale);0!==a.angle&&(d+=" a:"+a.angle);null!==a.background&&(d+=" b:"+a.background.toString());null!==a.Ci&&(d+=" a:"+a.background.toString());a instanceof B&&(d+=" elts:"+a.za.count,0!==a.mB&&(d+=" top:"+a.mB),0!==a.oA&&(d+=" left:"+a.oA),null!==a.Xs&&(d+=" itemArray#:"+t.yb(a.Xs)),
a.tI&&(d+=" cat:"+a.tI),null!==a.data&&(d+=" data:"+a.data));t.trace(d);if(a instanceof B)for(a=a.elements;a.next();)f.YB(a.value,b+1,"")},sJ:function(a){t.trace("DelayedReferences ("+a.Uf.count+")");for(a=a.Uf.k;a.next();){for(var b="",c=a.value.k;c.next();)b+=la(c.value)+", ";t.trace("  "+a.key+": "+b)}}};ba.Debug=f;
var t={Wh:Object.freeze([]),Zz:{},aE:0,Yz:{},$D:0,VD:"...",gA:{},hA:0,nB:[],Gw:null,Fp:document.createElement("canvas").getContext("2d"),Gp:"",ND:[],gB:"ontouchstart"in window,KF:"ongesturestart"in window,ED:!1,zs:null,As:null,ys:null,Qv:"",dG:!1,gG:!1,fG:!1,eG:!1,FD:null,Mp:!1,bG:!1,cG:!1,l:function(a){f&&f.jD&&alert(a);throw Error(a);},J:function(a,b){if(a.jb){var c="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(c+="  to value: "+b);t.l(c)}},m:function(a,b,c,
d){a instanceof b||(c=t.Hh(c),void 0!==d&&(c+="."+d),t.Vb(a,b,c))},j:function(a,b,c,d){typeof a!==b&&(c=t.Hh(c),void 0!==d&&(c+="."+d),t.Vb(a,b,c))},o:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=t.Hh(b),void 0!==c&&(b+="."+c),t.l(b+" must be a real number type, and not NaN or Infinity: "+a))},tb:function(a,b,c,d){a instanceof oa&&a.Pe===b||(c=t.Hh(c),void 0!==d&&(c+="."+d),t.Vb(a,"a constant of class "+t.Tg(b),c))},Vb:function(a,b,c,d){b=t.Hh(b);c=t.Hh(c);void 0!==d&&(c+="."+d);t.l(c+" value is not an instance of "+
b+": "+a)},ha:function(a,b,c,d){c=t.Hh(c);void 0!==d&&(c+="."+d);t.l(c+" is not in the range "+b+": "+a)},trace:function(a){window&&window.console&&window.console.log(a)},pb:function(a){return"object"===typeof a&&null!==a},qc:null,Sm:function(a,b,c,d){for(b=0;b<a.length;b++){var e=a[b];t.pb(e)&&(e=t.pf(e,c,d));a[b]=e}return d||t.qc(a)?a:window.ko.observableArray(a)},pf:function(a,b,c){if(a)for(var d in a)"__gohashid"!==d&&(a[d]=t.zI(a,d,b,c));return a},zI:function(a,b,c,d){var e=a[b],g;g=t.qc(e)?
e:Array.isArray(e)?t.Sm(e,b,c,d):window.ko.observable(e);if(d){if(d=g.EB){h=c.__gohashid;d[h]&&(d[h].dispose(),delete d[h]);var h=!1,k;for(k in d){h=!0;break}}!h&&g.Xt&&(g.Xt.dispose(),delete g.Xt)}else{g.Xt||(g.Xt=g.subscribe(function(a){g.bo=a},null,"beforeChange"));d=g.EB;d||(g.EB=d={});var h=c.__gohashid;d[h]||(d[h]=g.subscribe(function(d){c.Hw(a,b,g.bo,d)}))}return g},isArray:function(a){return Array.isArray(a)||t.qc&&t.qc(a)||a instanceof NodeList||a instanceof HTMLCollection},oI:function(a){return Array.isArray(a)||
t.qc&&t.qc(a)},xs:function(a,b,c){t.isArray(a)||t.Vb(a,"Array or NodeList or HTMLCollection",b,c)},yb:function(a){t.qc&&t.qc(a)&&(a=a());return a.length},sb:function(a,b){t.qc&&t.qc(a)&&(a=a());Array.isArray(a);return a[b]},hD:function(a,b,c){t.qc&&t.qc(a)&&(a=a());Array.isArray(a)?a[b]=c:t.l("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Gz:function(a,b){t.qc&&t.qc(a)&&(a=a());if(Array.isArray(a))return a.indexOf(b);for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1},
Ei:function(a,b,c){t.qc&&t.qc(a)&&(a=a());Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):t.l("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Fi:function(a,b){t.qc&&t.qc(a)&&(a=a());Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):t.l("Cannot remove an object from an HTMLCollection or NodeList at "+b)},xx:[],O:function(){var a=t.xx.pop();return void 0===a?new C:a},ic:function(a,b){var c=t.xx.pop();if(void 0===c)return new C(a,b);c.x=a;c.y=b;return c},B:function(a){t.xx.push(a)},
AB:[],xl:function(){var a=t.AB.pop();return void 0===a?new pa:a},dk:function(a){t.AB.push(a)},yx:[],wf:function(){var a=t.yx.pop();return void 0===a?new D:a},lk:function(a,b,c,d){var e=t.yx.pop();if(void 0===e)return new D(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Rc:function(a){t.yx.push(a)},BB:[],ah:function(){var a=t.BB.pop();return void 0===a?new qa:a},Se:function(a){t.BB.push(a)},zx:null,u:function(){var a=t.zx;return null!==a?(t.zx=null,a):new ra},v:function(a){a.reset();t.zx=a},zB:[],
Cb:function(){var a=t.zB.pop();return void 0===a?[]:a},Da:function(a){a.length=0;t.zB.push(a)},CB:1,zc:function(a){a.__gohashid=t.CB++},Os:function(a){var b=a.__gohashid;void 0===b&&(b=t.CB++,a.__gohashid=b);return b},oc:function(a){return a.__gohashid},g:function(a,b,c){"name"!==b&&"length"!==b&&(a[b]=c)},ia:function(a,b){b.Gx=a;ba[a]=b},Oa:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Fh:function(a){a.EG=!0},defineProperty:function(a,b,c,d,e){t.j(a,
"function","Util.defineProperty:classfunc");t.j(b,"object","Util.defineProperty:propobj");t.j(c,"function","Util.defineProperty:getter");t.j(d,"function","Util.defineProperty:setter");for(var g in b){var h=b[g];b={get:c,set:d};if(void 0!==e)for(var k in e)b[k]=e[k];Object.defineProperty(a.prototype,g,b);e=Object.getOwnPropertyDescriptor(a.prototype,g);h&&e&&Object.defineProperty(a.prototype,h,e);if(f&&h){var l=h.charAt(0).toUpperCase()+h.slice(1);h==l&&t.l('Defining capitalized property "'+l+'"!?');
Object.defineProperty(a.prototype,l,{get:function(){t.l('Getting the property "'+l+'" is probably not what you intended: it is capitalized but should spelled "'+h+'"')},set:function(){t.l('Setting the property "'+l+'" is probably not what you intended: it is capitalized but should spelled "'+h+'"')}})}break}},A:function(a,b,c,d){t.j(a,"function","Util.defineReadOnlyProperty:classfunc");t.j(b,"object","Util.defineReadOnlyProperty:propobj");t.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=
b[e];b={get:c,set:function(a){t.l('The property "'+g+'" is read-only and cannot be set to '+a)}};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);g&&d&&Object.defineProperty(a.prototype,g,d);if(f&&g){var k=g.charAt(0).toUpperCase()+g.slice(1);Object.defineProperty(a.prototype,k,{get:function(){t.l('Getting the property "'+k+'" is probably not what you intended: it is capitalized but should spelled "'+g+'"')},set:function(){t.l('Setting the read-only property "'+
k+'" is probably not what you intended: it is capitalized but should spelled "'+g+'", and cannot be set anyway')}})}break}},je:function(a,b){for(var c in b)b[c]=!0;a.prototype.EC=b},Hh:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?t.Tg(a):null===a?"*":""},Tg:function(a){if("function"===typeof a){if(a.Gx)return a.Gx;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("(");if(b=b.substring(9,c).trim())return a.Gx=b}else if("object"===typeof a&&a.constructor)return t.Tg(a.constructor);
return typeof a},w:function(a,b,c){t.j(a,"function","Util.defineEnumValue:classfunc");t.j(b,"string","Util.defineEnumValue:name");t.j(c,"number","Util.defineEnumValue:num");c=new oa(a,b,c);Object.freeze(c);a[b]=c;var d=a.Jt;d||(d=new sa("string",oa),a.Jt=d);d.add(b,c);return c},Km:function(a,b){if(!b)return null;t.j(a,"function","Util.findEnumValueForName:classfunc");t.j(b,"string","Util.findEnumValueForName:name");var c=a.Jt;return c?c.Ba(b):null},qH:function(a,b,c,d){var e={},g;for(g in a){for(var h=
!1,k=1;k<arguments.length;k++)if(arguments[k]===g){h=!0;break}h||(e[g]=a[g])}return e},hb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):(c=a[b],t.qc&&t.qc(c)&&(c=c()))}catch(d){f&&t.trace("property get error: "+d.toString())}return c},Ta:function(a,b,c){if(a&&b)try{if("function"===typeof b)b(a,c);else if("function"===typeof a.setAttribute)a.setAttribute(b,c);else if(t.qc){var d=a[b];t.qc(d)?
d(c):a[b]=c}else a[b]=c}catch(e){f&&t.trace("property set error: "+e.toString())}},Nw:function(a,b){t.j(a,"object","Setting properties requires Objects as arguments");t.j(b,"object","Setting properties requires Objects as arguments");var c=f;c||(f=t);var d=a instanceof B,e=a instanceof u,g;for(g in b){g||t.l("Setting properties requires non-empty property names");var h=a,k=g;if(d||e){var l=g.indexOf(".");if(0<l){var m=g.substring(0,l);d?h=a.le(m):(h=a[m])||(h=a.Db[m]);h?k=g.substr(l+1):t.l("Unable to find object named: "+
m+" in "+a.toString()+" when trying to set property: "+g)}}if("_"!==k[0]&&!t.mw(h,k))if(e&&t.mw(a.Db,k))h=a.Db;else if(e&&ta(a,k)){a.Az(k,b[k]);continue}else t.l('Trying to set undefined property "'+k+'" on object: '+h.toString());h[k]=b[g];"_"===k[0]&&(l=h.Il,l||(l=[],h.Il=l),l.push(k))}f=c;return a},mw:function(a,b){for(var c=Object.getPrototypeOf(a);c&&c!==Function;){if(c.hasOwnProperty(b))return!0;var d=c.EC;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},nD:function(a,b){if(!t.pb(b)||
b instanceof Element||b instanceof CanvasRenderingContext2D)return"";var c="",d;for(d in b)if("string"!==typeof d)""===c&&(c=b+"\n"),c+="  "+d+" is not a string property\n";else if("_"!==d.charAt(0)&&!(2>=d.length)){var e=t.hb(b,d);null===e||"function"===typeof e||t.mw(b,d)||(""===c&&(c=b+"\n"),c+='  unknown property "'+d+'" has value: '+e+" at "+a+"\n")}return c},Ov:function(a,b){if(b&&"number"!==typeof b&&"string"!==typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==t.oc(b)){if(!t.jv.contains(b))if(t.jv.add(b),
t.Ku.add(t.nD(a,b)),b instanceof H||b instanceof ua||b instanceof sa)for(var c=b.k;c.next();)t.Ov(a+"["+c.key+"]",c.value);else for(c in b){var d=t.hb(b,c);if(void 0!==d&&null!==d&&t.pb(d)&&d!==b.EC){if(b instanceof va){if(d===b.Yn)continue}else if(b instanceof B){if("data"===c||d===b.Kl)continue;if("itemArray"===c||d===b.tj)continue;if(b instanceof w&&d===b.Bj)continue}else if(!(b instanceof u))if(b instanceof wa){if("archetypeGroupData"===c||d===b.Cx)continue}else if(b instanceof za){if("archetypeLinkData"===
c||d===b.Vt)continue;if("archetypeLabelNodeData"===c||d===b.Ut)continue}else if(b instanceof Aa){if("archetypeNodeData"===c||d===b.cj)continue}else if(b instanceof I){if("nodeDataArray"===c||d===b.Ke)continue;if("linkDataArray"===c||d===b.Lg||d===b.Yl)continue;if(d===b.uc)continue;if(d===b.Uf)continue}else if(b instanceof Ba||b instanceof Da||b instanceof Ea)continue;t.Ov(a+"."+c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)t.Ov(a+"["+c+"]",b[c]);else t.Ku.add(t.nD(a,b))},lH:function(a){void 0===
t.jv?t.jv=new ua:t.jv.clear();t.Ku=new Fa;t.Ov("",a);a=t.Ku.toString();t.Ku=null;return a},TI:function(a){for(var b=[],c=0;256>c;c++)b[c]=c;for(var d=0,e,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,g="",h=0;h<a.length;h++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,g+=String.fromCharCode(a.charCodeAt(h)^b[(b[c]+b[d])%256]);return g},fI:function(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);
a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;c<a.length;c+=2)d[e++]=b[a.substr(c,2)];a=d.join("");return""===a?"0":a},Qa:function(a){return t.TI(t.fI(a))},Cl:null,Gv:"7da71ca0ad381e90",mH:"@COLOR1",nH:"@COLOR2"};
t.Cl=function(){var a=document.createElement("canvas"),b=a.getContext("2d");b[t.Qa("7ca11abfd022028846")]=t.Qa("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22402913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[t.Qa("7ca11abfd7330390")](t.Qa(c[d-1]),10,15*d+0);b[t.Qa("7ca11abfd022028846")]=t.Qa("39f046ebb36e4b");for(d=1;5>d;d++)b[t.Qa("7ca11abfd7330390")](t.Qa(c[d-
1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])t.w=function(a,b){var c=new oa(a,b,2);Object.freeze(c);a[b]=c;var d=a.Jt;d||(d=new sa("string",oa),a.Jt=d);d.add(b,c);return c};return a}();function oa(a,b,c){t.zc(this);this.GB=a;this.Rb=b;this.JG=c}oa.prototype.toString=function(){return t.Tg(this.GB)+"."+this.Rb};t.A(oa,{Pe:"classType"},function(){return this.GB});t.A(oa,{name:"name"},function(){return this.Rb});t.A(oa,{value:"value"},function(){return this.JG});
function Fa(){this.FB=[]}Fa.prototype.toString=function(){return this.FB.join("")};Fa.prototype.add=function(a){a&&this.FB.push(a)};function Ha(){}t.A(Ha,{k:"iterator"},function(){return this});Ha.prototype.reset=Ha.prototype.reset=function(){};Ha.prototype.next=Ha.prototype.hasNext=Ha.prototype.next=function(){return!1};Ha.prototype.first=Ha.prototype.eb=function(){return null};t.A(Ha,{count:"count"},function(){return 0});Ha.prototype.Fg=function(){};Ha.prototype.toString=function(){return"EmptyIterator"};
t.dh=new Ha;function Ia(a){this.key=-1;this.value=a}t.je(Ia,{key:!0,value:!0});t.A(Ia,{k:"iterator"},function(){return this});Ia.prototype.reset=Ia.prototype.reset=function(){this.key=-1};Ia.prototype.next=Ia.prototype.hasNext=Ia.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Ia.prototype.first=Ia.prototype.eb=function(){this.key=0;return this.value};t.A(Ia,{count:"count"},function(){return 1});Ia.prototype.Fg=function(){this.value=null};
Ia.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function La(a){this.zf=a;this.ho=null;this.reset()}t.je(La,{key:!0,value:!0});t.A(La,{k:"iterator"},function(){return this});t.g(La,"predicate",La.prototype.sl);t.defineProperty(La,{sl:"predicate"},function(){return this.ho},function(a){this.ho=a});La.prototype.reset=La.prototype.reset=function(){var a=this.zf;a.qh=null;this.kb=a.Wb;this.te=-1};
La.prototype.next=La.prototype.hasNext=La.prototype.next=function(){var a=this.zf;a.Wb!==this.kb&&t.l("the List has been modified during iteration");var a=a.p,b=a.length,c=++this.te,d=this.ho;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.te=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Fg()}return!1};
La.prototype.first=La.prototype.eb=function(){var a=this.zf;this.kb=a.Wb;this.te=0;var a=a.p,b=a.length,c=this.ho;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.te=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};t.A(La,{count:"count"},function(){var a=this.ho;if(null!==a){for(var b=0,c=this.zf.p,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.zf.p.length});
La.prototype.Fg=function(){this.key=-1;this.value=null;this.kb=-1;this.ho=null;this.zf.qh=this};La.prototype.toString=function(){return"ListIterator@"+this.te+"/"+this.zf.count};function Oa(a){this.zf=a;this.reset()}t.je(Oa,{key:!0,value:!0});t.A(Oa,{k:"iterator"},function(){return this});Oa.prototype.reset=Oa.prototype.reset=function(){var a=this.zf;a.Cy=null;this.kb=a.Wb;this.te=a.p.length};
Oa.prototype.next=Oa.prototype.hasNext=Oa.prototype.next=function(){var a=this.zf;a.Wb!==this.kb&&t.l("the List has been modified during iteration");var b=--this.te;if(0<=b)return this.key=b,this.value=a.p[b],!0;this.Fg();return!1};Oa.prototype.first=Oa.prototype.eb=function(){var a=this.zf;this.kb=a.Wb;var b=a.p;this.te=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};t.A(Oa,{count:"count"},function(){return this.zf.p.length});
Oa.prototype.Fg=function(){this.key=-1;this.value=null;this.kb=-1;this.zf.Cy=this};Oa.prototype.toString=function(){return"ListIteratorBackwards("+this.te+"/"+this.zf.count+")"};
function H(a){t.zc(this);this.jb=!1;this.p=[];this.Wb=0;this.Cy=this.qh=null;void 0===a||null===a?this.ba=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ba=a:t.ha(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ba=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:t.ha(a,"null, a primitive type name, or a class type",
"List constructor: type")}t.ia("List",H);H.prototype.Cg=function(a){null!==this.ba&&("string"===typeof this.ba?typeof a===this.ba&&null!==a||t.Vb(a,this.ba):a instanceof this.ba||t.Vb(a,this.ba))};H.prototype.Nd=function(){var a=this.Wb;a++;999999999<a&&(a=0);this.Wb=a};H.prototype.freeze=H.prototype.freeze=function(){this.jb=!0;return this};H.prototype.thaw=H.prototype.Ua=function(){this.jb=!1;return this};H.prototype.toString=function(){return"List("+t.Hh(this.ba)+")#"+t.oc(this)};
H.prototype.add=H.prototype.add=function(a){null!==a&&(f&&this.Cg(a),t.J(this,a),this.p.push(a),this.Nd())};H.prototype.addAll=H.prototype.Me=function(a){if(null===a)return this;t.J(this);var b=this.p;if(t.isArray(a))for(var c=t.yb(a),d=0;d<c;d++){var e=t.sb(a,d);f&&this.Cg(e);b.push(e)}else for(a=a.k;a.next();)e=a.value,f&&this.Cg(e),b.push(e);this.Nd();return this};H.prototype.clear=H.prototype.clear=function(){t.J(this);this.p.length=0;this.Nd()};
H.prototype.contains=H.prototype.has=H.prototype.contains=function(a){if(null===a)return!1;f&&this.Cg(a);return-1!==this.p.indexOf(a)};H.prototype.indexOf=H.prototype.indexOf=function(a){if(null===a)return-1;f&&this.Cg(a);return this.p.indexOf(a)};H.prototype.elt=H.prototype.get=H.prototype.qa=function(a){f&&t.o(a,H,"elt:i");var b=this.p;(0>a||a>=b.length)&&t.ha(a,"0 <= i < length",H,"elt:i");return b[a]};
H.prototype.setElt=H.prototype.set=H.prototype.xg=function(a,b){f&&(this.Cg(b),t.o(a,H,"setElt:i"));var c=this.p;(0>a||a>=c.length)&&t.ha(a,"0 <= i < length",H,"setElt:i");t.J(this,a);c[a]=b};H.prototype.first=H.prototype.eb=function(){var a=this.p;return 0===a.length?null:a[0]};H.prototype.insertAt=H.prototype.Ad=function(a,b){f&&(this.Cg(b),t.o(a,H,"insertAt:i"));0>a&&t.ha(a,">= 0",H,"insertAt:i");t.J(this,a);var c=this.p;a>=c.length?c.push(b):c.splice(a,0,b);this.Nd();return!0};
H.prototype.remove=H.prototype["delete"]=H.prototype.remove=function(a){if(null===a)return!1;f&&this.Cg(a);t.J(this,a);var b=this.p;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Nd();return!0};H.prototype.removeAt=H.prototype.gd=function(a){f&&t.o(a,H,"removeAt:i");var b=this.p;(0>a||a>=b.length)&&t.ha(a,"0 <= i < length",H,"removeAt:i");t.J(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Nd()};
H.prototype.removeRange=H.prototype.removeRange=function(a,b){f&&(t.o(a,H,"removeRange:from"),t.o(b,H,"removeRange:to"));var c=this.p;(0>a||a>=c.length)&&t.ha(a,"0 <= from < length",H,"elt:from");(0>b||b>=c.length)&&t.ha(b,"0 <= to < length",H,"elt:to");t.J(this,a);var d=c.slice((b||a)+1||c.length);c.length=0>a?c.length+a:a;c.push.apply(c,d);this.Nd()};H.prototype.copy=function(){for(var a=new H(this.ba),b=this.p,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};
H.prototype.toArray=H.prototype.af=function(){for(var a=this.p,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};H.prototype.toSet=function(){for(var a=new ua(this.ba),b=this.p,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};H.prototype.sort=H.prototype.sort=function(a){f&&t.j(a,"function",H,"sort:sortfunc");t.J(this);this.p.sort(a);this.Nd();return this};
H.prototype.sortRange=H.prototype.Hp=function(a,b,c){var d=this.p,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);f&&(t.j(a,"function",H,"sortRange:sortfunc"),t.o(b,H,"sortRange:from"),t.o(c,H,"sortRange:to"));t.J(this);var g=c-b;if(1>=g)return this;(0>b||b>=e-1)&&t.ha(b,"0 <= from < length",H,"sortRange:from");if(2===g)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Nd()),this;if(0===b)if(c>=e)d.sort(a);else for(g=d.slice(0,c),g.sort(a),a=0;a<c;a++)d[a]=g[a];else if(c>=e)for(g=d.slice(b),g.sort(a),
a=b;a<e;a++)d[a]=g[a-b];else for(g=d.slice(b,c),g.sort(a),a=b;a<c;a++)d[a]=g[a-b];this.Nd();return this};H.prototype.reverse=H.prototype.reverse=function(){t.J(this);this.p.reverse();this.Nd();return this};t.A(H,{count:"count"},function(){return this.p.length});t.A(H,{size:"size"},function(){return this.p.length});t.A(H,{length:"length"},function(){return this.p.length});t.A(H,{k:"iterator"},function(){if(0>=this.p.length)return t.dh;var a=this.qh;return null!==a?(a.reset(),a):new La(this)});
t.A(H,{Rm:"iteratorBackwards"},function(){if(0>=this.p.length)return t.dh;var a=this.Cy;return null!==a?(a.reset(),a):new Oa(this)});function Pa(a){this.q=a;this.reset()}t.je(Pa,{key:!0,value:!0});t.A(Pa,{k:"iterator"},function(){return this});Pa.prototype.reset=Pa.prototype.reset=function(){var a=this.q;a.qh=null;this.kb=a.Wb;this.ce=null};
Pa.prototype.next=Pa.prototype.hasNext=Pa.prototype.next=function(){var a=this.q;a.Wb!==this.kb&&t.l("the Set has been modified during iteration");var b=this.ce,b=null===b?a.se:b.Cj;if(null!==b)return this.ce=b,this.value=b.value,this.key=b.key,!0;this.Fg();return!1};Pa.prototype.first=Pa.prototype.eb=function(){var a=this.q;this.kb=a.Wb;a=a.se;if(null!==a){this.ce=a;var b=a.value;this.key=a.key;return this.value=b}return null};t.A(Pa,{count:"count"},function(){return this.q.ld});
Pa.prototype.Fg=function(){this.value=null;this.kb=-1;this.q.qh=this};Pa.prototype.toString=function(){return null!==this.ce?"SetIterator@"+this.ce.value:"SetIterator"};
function ua(a){t.zc(this);this.jb=!1;void 0===a||null===a?this.ba=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ba=a:t.ha(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ba=a===Object?"object":a===String?"string":a===Number?"number":a:t.ha(a,"null, a primitive type name, or a class type","Set constructor: type");this.Xc={};this.ld=0;this.qh=null;this.Wb=0;this.sh=this.se=null}t.ia("Set",ua);
ua.prototype.Cg=function(a){null!==this.ba&&("string"===typeof this.ba?typeof a===this.ba&&null!==a||t.Vb(a,this.ba):a instanceof this.ba||t.Vb(a,this.ba))};ua.prototype.Nd=function(){var a=this.Wb;a++;999999999<a&&(a=0);this.Wb=a};ua.prototype.freeze=ua.prototype.freeze=function(){this.jb=!0;return this};ua.prototype.thaw=ua.prototype.Ua=function(){this.jb=!1;return this};ua.prototype.toString=function(){return"Set("+t.Hh(this.ba)+")#"+t.oc(this)};
ua.prototype.add=ua.prototype.add=function(a){if(null===a)return!1;f&&this.Cg(a);t.J(this,a);var b=a;t.pb(a)&&(b=t.Os(a));return void 0===this.Xc[b]?(this.ld++,a=new Qa(a,a),this.Xc[b]=a,b=this.sh,null===b?this.se=a:(a.io=b,b.Cj=a),this.sh=a,this.Nd(),!0):!1};ua.prototype.addAll=ua.prototype.Me=function(a){if(null===a)return this;t.J(this);if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.add(t.sb(a,c));else for(a=a.k;a.next();)this.add(a.value);return this};
ua.prototype.contains=ua.prototype.has=ua.prototype.contains=function(a){if(null===a)return!1;f&&this.Cg(a);var b=a;return t.pb(a)&&(b=t.oc(a),void 0===b)?!1:void 0!==this.Xc[b]};ua.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.k;a.next();)if(!this.contains(a.value))return!1;return!0};ua.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.k;a.next();)if(this.contains(a.value))return!0;return!1};
ua.prototype.first=ua.prototype.eb=function(){var a=this.se;return null===a?null:a.value};ua.prototype.remove=ua.prototype["delete"]=ua.prototype.remove=function(a){if(null===a)return!1;f&&this.Cg(a);t.J(this,a);var b=a;if(t.pb(a)&&(b=t.oc(a),void 0===b))return!1;a=this.Xc[b];if(void 0===a)return!1;var c=a.Cj,d=a.io;null!==c&&(c.io=d);null!==d&&(d.Cj=c);this.se===a&&(this.se=c);this.sh===a&&(this.sh=d);delete this.Xc[b];this.ld--;this.Nd();return!0};
ua.prototype.removeAll=function(a){if(null===a)return this;t.J(this);if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.remove(t.sb(a,c));else for(a=a.k;a.next();)this.remove(a.value);return this};ua.prototype.retainAll=function(a){if(null===a||0===this.count)return this;t.J(this);var b=new ua(this.ba);b.Me(a);a=new H(this.ba);for(var c=this.k;c.next();)b.contains(c.value)||a.add(c.value);for(b=a.k;b.next();)this.remove(b.value);return this};
ua.prototype.clear=ua.prototype.clear=function(){t.J(this);this.Xc={};this.ld=0;this.sh=this.se=null;this.Nd()};ua.prototype.copy=function(){var a=new ua(this.ba),b=this.Xc,c;for(c in b)a.add(b[c].value);return a};ua.prototype.toArray=ua.prototype.af=function(){var a=Array(this.ld),b=this.Xc,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};ua.prototype.toList=function(){var a=new H(this.ba),b=this.Xc,c;for(c in b)a.add(b[c].value);return a};t.A(ua,{count:"count"},function(){return this.ld});
t.A(ua,{size:"size"},function(){return this.ld});t.A(ua,{k:"iterator"},function(){if(0>=this.ld)return t.dh;var a=this.qh;return null!==a?(a.reset(),a):new Pa(this)});function Ta(a){this.Cc=a;this.reset()}t.je(Ta,{key:!0,value:!0});t.A(Ta,{k:"iterator"},function(){return this});Ta.prototype.reset=Ta.prototype.reset=function(){this.kb=this.Cc.Wb;this.ce=null};
Ta.prototype.next=Ta.prototype.hasNext=Ta.prototype.next=function(){var a=this.Cc;a.Wb!==this.kb&&t.l("the Map has been modified during iteration");var b=this.ce,b=null===b?a.se:b.Cj;if(null!==b)return this.ce=b,this.value=this.key=a=b.key,!0;this.Fg();return!1};Ta.prototype.first=Ta.prototype.eb=function(){var a=this.Cc;this.kb=a.Wb;a=a.se;return null!==a?(this.ce=a,this.value=this.key=a=a.key):null};t.A(Ta,{count:"count"},function(){return this.Cc.ld});
Ta.prototype.Fg=function(){this.value=null;this.kb=-1};Ta.prototype.toString=function(){return null!==this.ce?"MapKeySetIterator@"+this.ce.value:"MapKeySetIterator"};function Ua(a){t.zc(this);this.jb=!0;this.Cc=a}t.Oa(Ua,ua);Ua.prototype.freeze=function(){return this};Ua.prototype.Ua=function(){return this};Ua.prototype.toString=function(){return"MapKeySet("+this.Cc.toString()+")"};Ua.prototype.add=Ua.prototype.set=Ua.prototype.add=function(){t.l("This Set is read-only: "+this.toString());return!1};
Ua.prototype.contains=Ua.prototype.has=Ua.prototype.contains=function(a){return this.Cc.contains(a)};Ua.prototype.remove=Ua.prototype["delete"]=Ua.prototype.remove=function(){t.l("This Set is read-only: "+this.toString());return!1};Ua.prototype.clear=Ua.prototype.clear=function(){t.l("This Set is read-only: "+this.toString())};Ua.prototype.first=Ua.prototype.eb=function(){var a=this.Cc.se;return null!==a?a.key:null};Ua.prototype.copy=function(){return new Ua(this.Cc)};
Ua.prototype.toSet=function(){var a=new ua(this.Cc.rh),b=this.Cc.Xc,c;for(c in b)a.add(b[c].key);return a};Ua.prototype.toArray=Ua.prototype.af=function(){var a=this.Cc.Xc,b=Array(this.Cc.ld),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Ua.prototype.toList=function(){var a=new H(this.ba),b=this.Cc.Xc,c;for(c in b)a.add(b[c].key);return a};t.A(Ua,{count:"count"},function(){return this.Cc.ld});t.A(Ua,{size:"size"},function(){return this.Cc.ld});
t.A(Ua,{k:"iterator"},function(){return 0>=this.Cc.ld?t.dh:new Ta(this.Cc)});function Qa(a,b){this.key=a;this.value=b;this.io=this.Cj=null}t.je(Qa,{key:!0,value:!0});Qa.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function Va(a){this.Cc=a;this.reset()}t.je(Va,{key:!0,value:!0});t.A(Va,{k:"iterator"},function(){return this});Va.prototype.reset=Va.prototype.reset=function(){var a=this.Cc;a.qh=null;this.kb=a.Wb;this.ce=null};
Va.prototype.next=Va.prototype.hasNext=Va.prototype.next=function(){var a=this.Cc;a.Wb!==this.kb&&t.l("the Map has been modified during iteration");var b=this.ce,b=null===b?a.se:b.Cj;if(null!==b)return this.ce=b,this.key=b.key,this.value=b.value,!0;this.Fg();return!1};Va.prototype.first=Va.prototype.eb=function(){var a=this.Cc;this.kb=a.Wb;a=a.se;if(null!==a){this.ce=a;var b=a.key;this.key=b;this.value=a.value;return b}return null};t.A(Va,{count:"count"},function(){return this.Cc.ld});
Va.prototype.Fg=function(){this.value=this.key=null;this.kb=-1;this.Cc.qh=this};Va.prototype.toString=function(){return null!==this.ce?"MapIterator@"+this.ce:"MapIterator"};
function sa(a,b){t.zc(this);this.jb=!1;void 0===a||null===a?this.rh=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.rh=a:t.ha(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.rh=a===Object?"object":a===String?"string":a===Number?"number":a:t.ha(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.Bi=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
b||"function"===b?this.Bi=b:t.ha(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.Bi=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:t.ha(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.Xc={};this.ld=0;this.qh=null;this.Wb=0;this.sh=this.se=null}t.ia("Map",sa);
function Wa(a,b){null!==a.rh&&("string"===typeof a.rh?typeof b===a.rh&&null!==b||t.Vb(b,a.rh):b instanceof a.rh||t.Vb(b,a.rh))}sa.prototype.Nd=function(){var a=this.Wb;a++;999999999<a&&(a=0);this.Wb=a};sa.prototype.freeze=sa.prototype.freeze=function(){this.jb=!0;return this};sa.prototype.thaw=sa.prototype.Ua=function(){this.jb=!1;return this};sa.prototype.toString=function(){return"Map("+t.Hh(this.rh)+","+t.Hh(this.Bi)+")#"+t.oc(this)};
sa.prototype.add=sa.prototype.set=sa.prototype.add=function(a,b){f&&(Wa(this,a),null!==this.Bi&&("string"===typeof this.Bi?typeof b===this.Bi&&null!==b||t.Vb(b,this.Bi):b instanceof this.Bi||t.Vb(b,this.Bi)));t.J(this,a);var c=a;t.pb(a)&&(c=t.Os(a));var d=this.Xc[c];if(void 0===d)return this.ld++,d=new Qa(a,b),this.Xc[c]=d,c=this.sh,null===c?this.se=d:(d.io=c,c.Cj=d),this.sh=d,this.Nd(),!0;d.value=b;return!1};
sa.prototype.addAll=sa.prototype.Me=function(a){if(null===a)return this;f&&t.m(a,sa,sa,"addAll:map");for(a=a.k;a.next();)this.add(a.key,a.value);return this};sa.prototype.contains=sa.prototype.has=sa.prototype.contains=function(a){f&&Wa(this,a);var b=a;return t.pb(a)&&(b=t.oc(a),void 0===b)?!1:void 0!==this.Xc[b]};sa.prototype.getValue=sa.prototype.get=sa.prototype.Ba=function(a){f&&Wa(this,a);var b=a;if(t.pb(a)&&(b=t.oc(a),void 0===b))return null;a=this.Xc[b];return void 0===a?null:a.value};
sa.prototype.remove=sa.prototype["delete"]=sa.prototype.remove=function(a){if(null===a)return!1;f&&Wa(this,a);t.J(this,a);var b=a;if(t.pb(a)&&(b=t.oc(a),void 0===b))return!1;a=this.Xc[b];if(void 0===a)return!1;var c=a.Cj,d=a.io;null!==c&&(c.io=d);null!==d&&(d.Cj=c);this.se===a&&(this.se=c);this.sh===a&&(this.sh=d);delete this.Xc[b];this.ld--;this.Nd();return!0};sa.prototype.clear=sa.prototype.clear=function(){t.J(this);this.Xc={};this.ld=0;this.sh=this.se=null;this.Nd()};
sa.prototype.copy=function(){var a=new sa(this.rh,this.Bi),b=this.Xc,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};sa.prototype.toArray=sa.prototype.af=function(){var a=this.Xc,b=Array(this.ld),c=0,d;for(d in a){var e=a[d];b[c]=new Qa(e.key,e.value);c++}return b};sa.prototype.toKeySet=sa.prototype.Al=function(){return new Ua(this)};t.A(sa,{count:"count"},function(){return this.ld});t.A(sa,{size:"size"},function(){return this.ld});
t.A(sa,{k:"iterator"},function(){if(0>=this.count)return t.dh;var a=this.qh;return null!==a?(a.reset(),a):new Va(this)});function C(a,b){void 0===a?this.M=this.L=0:"number"===typeof a&&"number"===typeof b?(this.L=a,this.M=b):t.l("Invalid arguments to Point constructor")}t.ia("Point",C);t.Fh(C);t.je(C,{x:!0,y:!0});C.prototype.assign=function(a){this.L=a.L;this.M=a.M};C.prototype.q=function(a,b){this.L=a;this.M=b};
C.prototype.setTo=C.prototype.Ep=function(a,b){f&&(t.j(a,"number",C,"setTo:x"),t.j(b,"number",C,"setTo:y"));t.J(this);this.L=a;this.M=b;return this};C.prototype.set=C.prototype.set=function(a){f&&t.m(a,C,C,"set:p");t.J(this);this.L=a.L;this.M=a.M;return this};C.prototype.copy=function(){var a=new C;a.L=this.L;a.M=this.M;return a};C.prototype.Na=function(){this.jb=!0;Object.freeze(this);return this};C.prototype.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};
C.prototype.freeze=function(){this.jb=!0;return this};C.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;return this};C.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new C(c,e)}return new C};C.stringify=function(a){return a instanceof C?a.x.toString()+" "+a.y.toString():a.toString()};
C.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};C.prototype.equals=C.prototype.N=function(a){return a instanceof C?this.L===a.x&&this.M===a.y:!1};C.prototype.equalTo=function(a,b){return this.L===a&&this.M===b};C.prototype.bk=function(a){return J.Ka(this.L,a.x)&&J.Ka(this.M,a.y)};C.prototype.Oi=function(a){return J.I(this.L,a.x)&&J.I(this.M,a.y)};C.prototype.add=C.prototype.add=function(a){f&&t.m(a,C,C,"add:p");t.J(this);this.L+=a.x;this.M+=a.y;return this};
C.prototype.subtract=C.prototype.At=function(a){f&&t.m(a,C,C,"subtract:p");t.J(this);this.L-=a.x;this.M-=a.y;return this};C.prototype.offset=C.prototype.offset=function(a,b){f&&(t.o(a,C,"offset:dx"),t.o(b,C,"offset:dy"));t.J(this);this.L+=a;this.M+=b;return this};
C.prototype.rotate=C.prototype.rotate=function(a){f&&t.o(a,C,"rotate:angle");t.J(this);if(0===a)return this;var b=this.L,c=this.M;if(0===b&&0===c)return this;var d;90===a?(a=0,d=1):180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.L=a*b-d*c;this.M=d*b+a*c;return this};C.prototype.scale=C.prototype.scale=function(a,b){f&&(t.o(a,C,"scale:sx"),t.o(b,C,"scale:sy"));this.L*=a;this.M*=b;return this};
C.prototype.distanceSquaredPoint=C.prototype.$j=function(a){f&&t.m(a,C,C,"distanceSquaredPoint:p");var b=a.x-this.L;a=a.y-this.M;return b*b+a*a};C.prototype.distanceSquared=C.prototype.Es=function(a,b){f&&(t.o(a,C,"distanceSquared:px"),t.o(b,C,"distanceSquared:py"));var c=a-this.L,d=b-this.M;return c*c+d*d};C.prototype.normalize=C.prototype.normalize=function(){t.J(this);var a=this.L,b=this.M,c=Math.sqrt(a*a+b*b);0<c&&(this.L=a/c,this.M=b/c);return this};
C.prototype.directionPoint=C.prototype.Li=function(a){f&&t.m(a,C,C,"directionPoint:p");return Xa(a.x-this.L,a.y-this.M)};C.prototype.direction=C.prototype.direction=function(a,b){f&&(t.o(a,C,"direction:px"),t.o(b,C,"direction:py"));return Xa(a-this.L,b-this.M)};function Xa(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}
C.prototype.projectOntoLineSegment=function(a,b,c,d){f&&(t.o(a,C,"projectOntoLineSegment:px"),t.o(b,C,"projectOntoLineSegment:py"),t.o(c,C,"projectOntoLineSegment:qx"),t.o(d,C,"projectOntoLineSegment:qy"));J.Ym(a,b,c,d,this.L,this.M,this);return this};C.prototype.projectOntoLineSegmentPoint=function(a,b){f&&(t.m(a,C,C,"projectOntoLineSegmentPoint:p"),t.m(b,C,C,"projectOntoLineSegmentPoint:q"));J.Ym(a.x,a.y,b.x,b.y,this.L,this.M,this);return this};
C.prototype.snapToGrid=function(a,b,c,d){f&&(t.o(a,C,"snapToGrid:originx"),t.o(b,C,"snapToGrid:originy"),t.o(c,C,"snapToGrid:cellwidth"),t.o(d,C,"snapToGrid:cellheight"));J.Gs(this.L,this.M,a,b,c,d,this);return this};C.prototype.snapToGridPoint=function(a,b){f&&(t.m(a,C,C,"snapToGridPoint:p"),t.m(b,pa,C,"snapToGridPoint:q"));J.Gs(this.L,this.M,a.x,a.y,b.width,b.height,this);return this};
C.prototype.setRectSpot=C.prototype.wt=function(a,b){f&&(t.m(a,D,C,"setRectSpot:r"),t.m(b,K,C,"setRectSpot:spot"));t.J(this);this.L=a.x+b.x*a.width+b.offsetX;this.M=a.y+b.y*a.height+b.offsetY;return this};
C.prototype.setSpot=C.prototype.xt=function(a,b,c,d,e){f&&(t.o(a,C,"setSpot:x"),t.o(b,C,"setSpot:y"),t.o(c,C,"setSpot:w"),t.o(d,C,"setSpot:h"),(0>c||0>d)&&t.l("Point.setSpot:Width and height cannot be negative"),t.m(e,K,C,"setSpot:spot"));t.J(this);this.L=a+e.x*c+e.offsetX;this.M=b+e.y*d+e.offsetY;return this};C.prototype.transform=function(a){f&&t.m(a,qa,C,"transform:t");a.Va(this);return this};function ab(a,b){f&&t.m(b,qa,C,"transformInverted:t");b.Ri(a);return a}var db;
C.distanceLineSegmentSquared=db=function(a,b,c,d,e,g){f&&(t.o(a,C,"distanceLineSegmentSquared:px"),t.o(b,C,"distanceLineSegmentSquared:py"),t.o(c,C,"distanceLineSegmentSquared:ax"),t.o(d,C,"distanceLineSegmentSquared:ay"),t.o(e,C,"distanceLineSegmentSquared:bx"),t.o(g,C,"distanceLineSegmentSquared:by"));var h=e-c,k=g-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=g-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var eb;
C.distanceSquared=eb=function(a,b,c,d){f&&(t.o(a,C,"distanceSquared:px"),t.o(b,C,"distanceSquared:py"),t.o(c,C,"distanceSquared:qx"),t.o(d,C,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var nb;
C.direction=nb=function(a,b,c,d){f&&(t.o(a,C,"direction:px"),t.o(b,C,"direction:py"),t.o(c,C,"direction:qx"),t.o(d,C,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};t.g(C,"x",C.prototype.x);t.defineProperty(C,{x:"x"},function(){return this.L},function(a){t.J(this,a);f&&t.j(a,"number",C,"x");this.L=a});t.g(C,"y",C.prototype.y);
t.defineProperty(C,{y:"y"},function(){return this.M},function(a){t.J(this,a);f&&t.j(a,"number",C,"y");this.M=a});C.prototype.isReal=C.prototype.Q=function(){return isFinite(this.x)&&isFinite(this.y)};function pa(a,b){void 0===a?this.wa=this.xa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.xa=a,this.wa=b):t.l("Invalid arguments to Size constructor")}t.ia("Size",pa);t.Fh(pa);t.je(pa,{width:!0,height:!0});pa.prototype.assign=function(a){this.xa=a.xa;this.wa=a.wa};
pa.prototype.q=function(a,b){this.xa=a;this.wa=b};pa.prototype.setTo=pa.prototype.Ep=function(a,b){f&&(t.j(a,"number",pa,"setTo:w"),t.j(b,"number",pa,"setTo:h"));0>a&&t.ha(a,">= 0",pa,"setTo:w");0>b&&t.ha(b,">= 0",pa,"setTo:h");t.J(this);this.xa=a;this.wa=b;return this};pa.prototype.set=pa.prototype.set=function(a){f&&t.m(a,pa,pa,"set:s");t.J(this);this.xa=a.xa;this.wa=a.wa;return this};pa.prototype.copy=function(){var a=new pa;a.xa=this.xa;a.wa=this.wa;return a};
pa.prototype.Na=function(){this.jb=!0;Object.freeze(this);return this};pa.prototype.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};pa.prototype.freeze=function(){this.jb=!0;return this};pa.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;return this};
pa.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new pa(c,e)}return new pa};pa.stringify=function(a){return a instanceof pa?a.width.toString()+" "+a.height.toString():a.toString()};pa.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};
pa.prototype.equals=pa.prototype.N=function(a){return a instanceof pa?this.xa===a.width&&this.wa===a.height:!1};pa.prototype.equalTo=function(a,b){return this.xa===a&&this.wa===b};pa.prototype.bk=function(a){return J.Ka(this.xa,a.width)&&J.Ka(this.wa,a.height)};pa.prototype.Oi=function(a){return J.I(this.xa,a.width)&&J.I(this.wa,a.height)};t.g(pa,"width",pa.prototype.width);
t.defineProperty(pa,{width:"width"},function(){return this.xa},function(a){t.J(this,a);f&&t.j(a,"number",pa,"width");0>a&&t.ha(a,">= 0",pa,"width");this.xa=a});t.g(pa,"height",pa.prototype.height);t.defineProperty(pa,{height:"height"},function(){return this.wa},function(a){t.J(this,a);f&&t.j(a,"number",pa,"height");0>a&&t.ha(a,">= 0",pa,"height");this.wa=a});pa.prototype.isReal=pa.prototype.Q=function(){return isFinite(this.width)&&isFinite(this.height)};
function D(a,b,c,d){void 0===a?this.wa=this.xa=this.M=this.L=0:a instanceof C?b instanceof C?(this.L=Math.min(a.L,b.L),this.M=Math.min(a.M,b.M),this.xa=Math.abs(a.L-b.L),this.wa=Math.abs(a.M-b.M)):b instanceof pa?(this.L=a.L,this.M=a.M,this.xa=b.xa,this.wa=b.wa):t.l("Incorrect arguments supplied"):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.L=a,this.M=b,this.xa=c,this.wa=d):t.l("Invalid arguments to Rect constructor")}
t.ia("Rect",D);t.Fh(D);t.je(D,{x:!0,y:!0,width:!0,height:!0});D.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.xa=a.xa;this.wa=a.wa};D.prototype.q=function(a,b,c,d){this.L=a;this.M=b;this.xa=c;this.wa=d};function qb(a,b,c){a.xa=b;a.wa=c}
D.prototype.setTo=D.prototype.Ep=function(a,b,c,d){f&&(t.j(a,"number",D,"setTo:x"),t.j(b,"number",D,"setTo:y"),t.j(c,"number",D,"setTo:w"),t.j(d,"number",D,"setTo:h"));0>c&&t.ha(c,">= 0",D,"setTo:w");0>d&&t.ha(d,">= 0",D,"setTo:h");t.J(this);this.L=a;this.M=b;this.xa=c;this.wa=d;return this};D.prototype.set=D.prototype.set=function(a){f&&t.m(a,D,D,"set:r");t.J(this);this.L=a.L;this.M=a.M;this.xa=a.xa;this.wa=a.wa;return this};
D.prototype.setPoint=D.prototype.uf=function(a){f&&t.m(a,C,D,"setPoint:p");t.J(this);this.L=a.L;this.M=a.M;return this};D.prototype.setSize=function(a){f&&t.m(a,pa,D,"setSize:s");t.J(this);this.xa=a.xa;this.wa=a.wa;return this};D.prototype.copy=function(){var a=new D;a.L=this.L;a.M=this.M;a.xa=this.xa;a.wa=this.wa;return a};D.prototype.Na=function(){this.jb=!0;Object.freeze(this);return this};D.prototype.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};
D.prototype.freeze=function(){this.jb=!0;return this};D.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;return this};D.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new D(c,e,g,h)}return new D};
D.stringify=function(a){return a instanceof D?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};D.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};D.prototype.equals=D.prototype.N=function(a){return a instanceof D?this.L===a.x&&this.M===a.y&&this.xa===a.width&&this.wa===a.height:!1};D.prototype.equalTo=function(a,b,c,d){return this.L===a&&this.M===b&&this.xa===c&&this.wa===d};
D.prototype.bk=function(a){return J.Ka(this.L,a.x)&&J.Ka(this.M,a.y)&&J.Ka(this.xa,a.width)&&J.Ka(this.wa,a.height)};D.prototype.Oi=function(a){return J.I(this.L,a.x)&&J.I(this.M,a.y)&&J.I(this.xa,a.width)&&J.I(this.wa,a.height)};D.prototype.containsPoint=D.prototype.Ha=function(a){f&&t.m(a,C,D,"containsPoint:p");return this.L<=a.x&&this.L+this.xa>=a.x&&this.M<=a.y&&this.M+this.wa>=a.y};
D.prototype.containsRect=D.prototype.Wj=function(a){f&&t.m(a,D,D,"containsRect:r");return this.L<=a.x&&a.x+a.width<=this.L+this.xa&&this.M<=a.y&&a.y+a.height<=this.M+this.wa};
D.prototype.contains=D.prototype.contains=function(a,b,c,d){f?(t.o(a,D,"contains:x"),t.o(b,D,"contains:y"),void 0===c?c=0:t.o(c,D,"contains:w"),void 0===d?d=0:t.o(d,D,"contains:h"),(0>c||0>d)&&t.l("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.L<=a&&a+c<=this.L+this.xa&&this.M<=b&&b+d<=this.M+this.wa};D.prototype.reset=function(){t.J(this);this.wa=this.xa=this.M=this.L=0};
D.prototype.offset=D.prototype.offset=function(a,b){f&&(t.o(a,D,"offset:dx"),t.o(b,D,"offset:dy"));t.J(this);this.L+=a;this.M+=b;return this};D.prototype.inflate=D.prototype.Ug=function(a,b){f&&(t.o(a,D,"inflate:w"),t.o(b,D,"inflate:h"));return rb(this,b,a,b,a)};D.prototype.addMargin=D.prototype.Ev=function(a){f&&t.m(a,sb,D,"addMargin:m");return rb(this,a.top,a.right,a.bottom,a.left)};
D.prototype.subtractMargin=D.prototype.gJ=function(a){f&&t.m(a,sb,D,"subtractMargin:m");return rb(this,-a.top,-a.right,-a.bottom,-a.left)};D.prototype.grow=function(a,b,c,d){f&&(t.o(a,D,"grow:t"),t.o(b,D,"grow:r"),t.o(c,D,"grow:b"),t.o(d,D,"grow:l"));return rb(this,a,b,c,d)};function rb(a,b,c,d,e){t.J(a);var g=a.xa;c+e<=-g?(a.L+=g/2,a.xa=0):(a.L-=e,a.xa+=c+e);c=a.wa;b+d<=-c?(a.M+=c/2,a.wa=0):(a.M-=b,a.wa+=b+d);return a}
D.prototype.intersectRect=function(a){f&&t.m(a,D,D,"intersectRect:r");return wb(this,a.x,a.y,a.width,a.height)};D.prototype.intersect=function(a,b,c,d){f&&(t.o(a,D,"intersect:x"),t.o(b,D,"intersect:y"),t.o(c,D,"intersect:w"),t.o(d,D,"intersect:h"),(0>c||0>d)&&t.l("Rect.intersect:Width and height cannot be negative"));return wb(this,a,b,c,d)};
function wb(a,b,c,d,e){t.J(a);var g=Math.max(a.L,b),h=Math.max(a.M,c);b=Math.min(a.L+a.xa,b+d);c=Math.min(a.M+a.wa,c+e);a.L=g;a.M=h;a.xa=Math.max(0,b-g);a.wa=Math.max(0,c-h);return a}D.prototype.intersectsRect=D.prototype.If=function(a){f&&t.m(a,D,D,"intersectsRect:r");return this.wE(a.x,a.y,a.width,a.height)};
D.prototype.intersects=D.prototype.wE=function(a,b,c,d){f&&(t.o(a,D,"intersects:x"),t.o(b,D,"intersects:y"),t.o(a,D,"intersects:w"),t.o(b,D,"intersects:h"),(0>c||0>d)&&t.l("Rect.intersects:Width and height cannot be negative"));var e=this.xa,g=this.L;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.wa;c=this.M;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
function xb(a,b){var c=a.xa,d=b.width+10+10,e=a.L,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.wa;d=b.height+10+10;e=a.M;g=b.y-10;return e>d+g||g>c+e?!1:!0}D.prototype.unionPoint=D.prototype.aj=function(a){f&&t.m(a,C,D,"unionPoint:p");return yb(this,a.x,a.y,0,0)};D.prototype.unionRect=D.prototype.nk=function(a){f&&t.m(a,D,D,"unionRect:r");return yb(this,a.L,a.M,a.xa,a.wa)};
D.prototype.union=D.prototype.YF=function(a,b,c,d){t.J(this);f?(t.o(a,D,"union:x"),t.o(b,D,"union:y"),void 0===c?c=0:t.o(c,D,"union:w"),void 0===d?d=0:t.o(d,D,"union:h"),(0>c||0>d)&&t.l("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return yb(this,a,b,c,d)};function yb(a,b,c,d,e){var g=Math.min(a.L,b),h=Math.min(a.M,c);b=Math.max(a.L+a.xa,b+d);c=Math.max(a.M+a.wa,c+e);a.L=g;a.M=h;a.xa=b-g;a.wa=c-h;return a}
D.prototype.setSpot=D.prototype.xt=function(a,b,c){f&&(t.o(a,D,"setSpot:x"),t.o(b,D,"setSpot:y"),t.m(c,K,D,"setSpot:spot"));t.J(this);this.L=a-c.offsetX-c.x*this.xa;this.M=b-c.offsetY-c.y*this.wa;return this};var Eb;
D.contains=Eb=function(a,b,c,d,e,g,h,k){f?(t.o(a,D,"contains:rx"),t.o(b,D,"contains:ry"),t.o(c,D,"contains:rw"),t.o(d,D,"contains:rh"),t.o(e,D,"contains:x"),t.o(g,D,"contains:y"),void 0===h?h=0:t.o(h,D,"contains:w"),void 0===k?k=0:t.o(k,D,"contains:h"),(0>c||0>d||0>h||0>k)&&t.l("Rect.contains:Width and height cannot be negative")):(void 0===h&&(h=0),void 0===k&&(k=0));return a<=e&&e+h<=a+c&&b<=g&&g+k<=b+d};
D.intersects=function(a,b,c,d,e,g,h,k){f&&(t.o(a,D,"intersects:rx"),t.o(b,D,"intersects:ry"),t.o(c,D,"intersects:rw"),t.o(d,D,"intersects:rh"),t.o(e,D,"intersects:x"),t.o(g,D,"intersects:y"),t.o(h,D,"intersects:w"),t.o(k,D,"intersects:h"),(0>c||0>d||0>h||0>k)&&t.l("Rect.intersects:Width and height cannot be negative"));c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=g;return b>k||g>a?!1:!0};t.g(D,"x",D.prototype.x);
t.defineProperty(D,{x:"x"},function(){return this.L},function(a){t.J(this,a);f&&t.j(a,"number",D,"x");this.L=a});t.g(D,"y",D.prototype.y);t.defineProperty(D,{y:"y"},function(){return this.M},function(a){t.J(this,a);f&&t.j(a,"number",D,"y");this.M=a});t.g(D,"width",D.prototype.width);t.defineProperty(D,{width:"width"},function(){return this.xa},function(a){t.J(this,a);f&&t.j(a,"number",D,"width");0>a&&t.ha(a,">= 0",D,"width");this.xa=a});t.g(D,"height",D.prototype.height);
t.defineProperty(D,{height:"height"},function(){return this.wa},function(a){t.J(this,a);f&&t.j(a,"number",D,"height");0>a&&t.ha(a,">= 0",D,"height");this.wa=a});t.g(D,"left",D.prototype.left);t.defineProperty(D,{left:"left"},function(){return this.L},function(a){t.J(this,a);f&&t.j(a,"number",D,"left");this.L=a});t.g(D,"top",D.prototype.top);t.defineProperty(D,{top:"top"},function(){return this.M},function(a){t.J(this,a);f&&t.j(a,"number",D,"top");this.M=a});t.g(D,"right",D.prototype.right);
t.defineProperty(D,{right:"right"},function(){return this.L+this.xa},function(a){t.J(this,a);f&&t.o(a,D,"right");this.L+=a-(this.L+this.xa)});t.g(D,"bottom",D.prototype.bottom);t.defineProperty(D,{bottom:"bottom"},function(){return this.M+this.wa},function(a){t.J(this,a);f&&t.o(a,D,"top");this.M+=a-(this.M+this.wa)});t.g(D,"position",D.prototype.position);
t.defineProperty(D,{position:"position"},function(){return new C(this.L,this.M)},function(a){t.J(this,a);f&&t.m(a,C,D,"position");this.L=a.x;this.M=a.y});t.g(D,"size",D.prototype.size);t.defineProperty(D,{size:"size"},function(){return new pa(this.xa,this.wa)},function(a){t.J(this,a);f&&t.m(a,pa,D,"size");this.xa=a.width;this.wa=a.height});t.g(D,"center",D.prototype.Iz);
t.defineProperty(D,{Iz:"center"},function(){return new C(this.L+this.xa/2,this.M+this.wa/2)},function(a){t.J(this,a);f&&t.m(a,C,D,"center");this.L=a.x-this.xa/2;this.M=a.y-this.wa/2});t.g(D,"centerX",D.prototype.Fa);t.defineProperty(D,{Fa:"centerX"},function(){return this.L+this.xa/2},function(a){t.J(this,a);f&&t.o(a,D,"centerX");this.L=a-this.xa/2});t.g(D,"centerY",D.prototype.Sa);
t.defineProperty(D,{Sa:"centerY"},function(){return this.M+this.wa/2},function(a){t.J(this,a);f&&t.o(a,D,"centerY");this.M=a-this.wa/2});D.prototype.isReal=D.prototype.Q=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};D.prototype.isEmpty=function(){return 0===this.width&&0===this.height};
function sb(a,b,c,d){void 0===a?this.$f=this.Sf=this.dg=this.gg=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):t.l("Invalid arguments to Margin constructor")}t.ia("Margin",sb);t.Fh(sb);t.je(sb,{top:!0,right:!0,bottom:!0,left:!0});sb.prototype.assign=function(a){this.gg=a.gg;this.dg=a.dg;this.Sf=a.Sf;this.$f=a.$f};
sb.prototype.setTo=sb.prototype.Ep=function(a,b,c,d){f&&(t.j(a,"number",sb,"setTo:t"),t.j(b,"number",sb,"setTo:r"),t.j(c,"number",sb,"setTo:b"),t.j(d,"number",sb,"setTo:l"));t.J(this);this.gg=a;this.dg=b;this.Sf=c;this.$f=d;return this};sb.prototype.set=sb.prototype.set=function(a){f&&t.m(a,sb,sb,"assign:m");t.J(this);this.gg=a.gg;this.dg=a.dg;this.Sf=a.Sf;this.$f=a.$f;return this};sb.prototype.copy=function(){var a=new sb;a.gg=this.gg;a.dg=this.dg;a.Sf=this.Sf;a.$f=this.$f;return a};
sb.prototype.Na=function(){this.jb=!0;Object.freeze(this);return this};sb.prototype.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};sb.prototype.freeze=function(){this.jb=!0;return this};sb.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;return this};
sb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=void 0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var g=void 0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=void 0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new sb(c,e,g,h)}return new sb};sb.stringify=function(a){return a instanceof sb?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};
sb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};sb.prototype.equals=sb.prototype.N=function(a){return a instanceof sb?this.gg===a.top&&this.dg===a.right&&this.Sf===a.bottom&&this.$f===a.left:!1};sb.prototype.equalTo=function(a,b,c,d){return this.gg===a&&this.dg===b&&this.Sf===c&&this.$f===d};sb.prototype.bk=function(a){return J.Ka(this.gg,a.top)&&J.Ka(this.dg,a.right)&&J.Ka(this.Sf,a.bottom)&&J.Ka(this.$f,a.left)};
sb.prototype.Oi=function(a){return J.I(this.gg,a.top)&&J.I(this.dg,a.right)&&J.I(this.Sf,a.bottom)&&J.I(this.$f,a.left)};t.g(sb,"top",sb.prototype.top);t.defineProperty(sb,{top:"top"},function(){return this.gg},function(a){t.J(this,a);f&&t.o(a,sb,"top");this.gg=a});t.g(sb,"right",sb.prototype.right);t.defineProperty(sb,{right:"right"},function(){return this.dg},function(a){t.J(this,a);f&&t.o(a,sb,"right");this.dg=a});t.g(sb,"bottom",sb.prototype.bottom);
t.defineProperty(sb,{bottom:"bottom"},function(){return this.Sf},function(a){t.J(this,a);f&&t.o(a,sb,"bottom");this.Sf=a});t.g(sb,"left",sb.prototype.left);t.defineProperty(sb,{left:"left"},function(){return this.$f},function(a){t.J(this,a);f&&t.o(a,sb,"left");this.$f=a});sb.prototype.isReal=sb.prototype.Q=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function qa(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}t.Fh(qa);
t.je(qa,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});qa.prototype.set=qa.prototype.set=function(a){f&&t.m(a,qa,qa,"set:t");this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};qa.prototype.copy=function(){var a=new qa;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};qa.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
qa.prototype.equals=qa.prototype.N=function(a){return a instanceof qa?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};qa.prototype.reset=qa.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0};
qa.prototype.multiply=qa.prototype.multiply=function(a){f&&t.m(a,qa,qa,"multiply:matrix");var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,g=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=g;return this};
qa.prototype.multiplyInverted=qa.prototype.yA=function(a){f&&t.m(a,qa,qa,"multiplyInverted:matrix");var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,g=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*g;e=this.m12*e+this.m22*g;g=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=g;this.dy=h;return this};
qa.prototype.invert=qa.prototype.jA=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),g=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=g};
qa.prototype.rotate=qa.prototype.rotate=function(a,b,c){f&&(t.o(a,qa,"rotate:angle"),t.o(b,qa,"rotate:rx"),t.o(c,qa,"rotate:ry"));this.translate(b,c);var d;0===a?(a=1,d=0):90===a?(a=0,d=1):180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,g=this.m11*-d+this.m21*a,h=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=g;this.m22=h;this.translate(-b,-c)};
qa.prototype.translate=qa.prototype.translate=function(a,b){f&&(t.o(a,qa,"translate:x"),t.o(b,qa,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b};qa.prototype.scale=qa.prototype.scale=function(a,b){void 0===b&&(b=a);f&&(t.o(a,qa,"translate:sx"),t.o(b,qa,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b};
qa.prototype.transformPoint=qa.prototype.Va=function(a){f&&t.m(a,C,qa,"transformPoint:p");var b=a.L,c=a.M;a.L=b*this.m11+c*this.m21+this.dx;a.M=b*this.m12+c*this.m22+this.dy;return a};qa.prototype.invertedTransformPoint=qa.prototype.Ri=function(a){f&&t.m(a,C,qa,"invertedTransformPoint:p");var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),g=a.L,h=a.M;a.L=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.M=g*c+h*d+e;return a};
qa.prototype.transformRect=qa.prototype.TF=function(a){f&&t.m(a,D,qa,"transformRect:rect");var b=a.L,c=a.M,d=b+a.xa,e=c+a.wa,g=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*g+c*k+m,q=b*h+c*l+n,r=d*g+c*k+m,c=d*h+c*l+n,s=b*g+e*k+m,b=b*h+e*l+n,g=d*g+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,g),e=Math.max(e,g),h=Math.min(h,d),q=Math.max(q,d);a.L=p;a.M=h;a.xa=
e-p;a.wa=q-h};qa.prototype.isIdentity=qa.prototype.Ts=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};function K(a,b,c,d){void 0===a?this.cg=this.bg=this.M=this.L=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}t.ia("Spot",K);t.Fh(K);t.je(K,{x:!0,y:!0,offsetX:!0,offsetY:!0});K.prototype.assign=function(a){this.L=a.L;this.M=a.M;this.bg=a.bg;this.cg=a.cg};
K.prototype.setTo=K.prototype.Ep=function(a,b,c,d){f&&(Gb(a,"setTo:x"),Gb(b,"setTo:y"),Hb(c,"setTo:offx"),Hb(d,"setTo:offy"));t.J(this);this.L=a;this.M=b;this.bg=c;this.cg=d;return this};K.prototype.set=K.prototype.set=function(a){f&&t.m(a,K,K,"set:s");t.J(this);this.L=a.L;this.M=a.M;this.bg=a.bg;this.cg=a.cg;return this};K.prototype.copy=function(){var a=new K;a.L=this.L;a.M=this.M;a.bg=this.bg;a.cg=this.cg;return a};K.prototype.Na=function(){this.jb=!0;Object.freeze(this);return this};
K.prototype.Z=function(){return Object.isFrozen(this)?this:this.copy().freeze()};K.prototype.freeze=function(){this.jb=!0;return this};K.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;return this};function Jb(a,b){a.L=NaN;a.M=NaN;a.bg=b;return a}function Gb(a,b){(isNaN(a)||1<a||0>a)&&t.ha(a,"0 <= "+b+" <= 1",K,b)}function Hb(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&t.ha(a,"real number, not NaN or Infinity",K,b)}var Ob;
K.parse=Ob=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return t.NONE;if("TopLeft"===a)return t.sx;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return t.Sp;if("TopRight"===a)return t.ux;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return t.Pp;if("Center"===a)return t.ex;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return t.Qp;if("BottomLeft"===a)return t.Yw;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return t.Op;if("BottomRight"===a)return t.$w;if("TopSide"===
a)return t.wx;if("LeftSide"===a)return t.jx;if("RightSide"===a)return t.px;if("BottomSide"===a)return t.bx;if("TopBottomSides"===a)return t.qx;if("LeftRightSides"===a)return t.ix;if("TopLeftSides"===a)return t.tx;if("TopRightSides"===a)return t.vx;if("BottomLeftSides"===a)return t.Zw;if("BottomRightSides"===a)return t.ax;if("NotTopSide"===a)return t.nx;if("NotLeftSide"===a)return t.lx;if("NotRightSide"===a)return t.mx;if("NotBottomSide"===a)return t.kx;if("AllSides"===a)return t.Xw;if("Default"===
a)return t.gx;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new K(c,e,g,h)}return new K};K.stringify=function(a){return a instanceof K?a.rd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
K.prototype.toString=function(){return this.rd()?0===this.bg&&0===this.cg?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.N(t.NONE)?"None":this.N(t.sx)?"TopLeft":this.N(t.Sp)?"Top":this.N(t.ux)?"TopRight":this.N(t.Pp)?"Left":this.N(t.ex)?"Center":this.N(t.Qp)?"Right":this.N(t.Yw)?"BottomLeft":this.N(t.Op)?"Bottom":this.N(t.$w)?"BottomRight":this.N(t.wx)?"TopSide":this.N(t.jx)?"LeftSide":this.N(t.px)?"RightSide":this.N(t.bx)?"BottomSide":this.N(t.qx)?
"TopBottomSides":this.N(t.ix)?"LeftRightSides":this.N(t.tx)?"TopLeftSides":this.N(t.vx)?"TopRightSides":this.N(t.Zw)?"BottomLeftSides":this.N(t.ax)?"BottomRightSides":this.N(t.nx)?"NotTopSide":this.N(t.lx)?"NotLeftSide":this.N(t.mx)?"NotRightSide":this.N(t.kx)?"NotBottomSide":this.N(t.Xw)?"AllSides":this.N(t.gx)?"Default":"None"};
K.prototype.equals=K.prototype.N=function(a){return a instanceof K?(this.L===a.x||isNaN(this.L)&&isNaN(a.x))&&(this.M===a.y||isNaN(this.M)&&isNaN(a.y))&&this.bg===a.offsetX&&this.cg===a.offsetY:!1};K.prototype.opposite=function(){return new K(0.5-(this.L-0.5),0.5-(this.M-0.5),-this.bg,-this.cg)};K.prototype.includesSide=function(a){if(!this.cp()||!a.cp())return!1;a=a.offsetY;return(this.cg&a)===a};t.g(K,"x",K.prototype.x);
t.defineProperty(K,{x:"x"},function(){return this.L},function(a){t.J(this,a);f&&Gb(a,"x");this.L=a});t.g(K,"y",K.prototype.y);t.defineProperty(K,{y:"y"},function(){return this.M},function(a){t.J(this,a);f&&Gb(a,"y");this.M=a});t.g(K,"offsetX",K.prototype.offsetX);t.defineProperty(K,{offsetX:"offsetX"},function(){return this.bg},function(a){t.J(this,a);f&&Hb(a,"offsetX");this.bg=a});t.g(K,"offsetY",K.prototype.offsetY);
t.defineProperty(K,{offsetY:"offsetY"},function(){return this.cg},function(a){t.J(this,a);f&&Hb(a,"offsetY");this.cg=a});K.prototype.isSpot=K.prototype.rd=function(){return!isNaN(this.x)&&!isNaN(this.y)};K.prototype.isNoSpot=K.prototype.qd=function(){return isNaN(this.x)||isNaN(this.y)};K.prototype.isSide=K.prototype.cp=function(){return this.qd()&&1===this.offsetX&&0!==this.offsetY};K.prototype.isDefault=K.prototype.Gc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};
t.Fd=1;t.hd=2;t.ud=4;t.td=8;t.NONE=Jb(new K(0,0,0,0),0).Na();t.gx=Jb(new K(0,0,-1,0),-1).Na();t.sx=(new K(0,0,0,0)).Na();t.Sp=(new K(0.5,0,0,0)).Na();t.ux=(new K(1,0,0,0)).Na();t.Pp=(new K(0,0.5,0,0)).Na();t.ex=(new K(0.5,0.5,0,0)).Na();t.Qp=(new K(1,0.5,0,0)).Na();t.Yw=(new K(0,1,0,0)).Na();t.Op=(new K(0.5,1,0,0)).Na();t.$w=(new K(1,1,0,0)).Na();t.wx=Jb(new K(0,0,1,t.Fd),1).Na();t.jx=Jb(new K(0,0,1,t.hd),1).Na();t.px=Jb(new K(0,0,1,t.ud),1).Na();t.bx=Jb(new K(0,0,1,t.td),1).Na();
t.qx=Jb(new K(0,0,1,t.Fd|t.td),1).Na();t.ix=Jb(new K(0,0,1,t.hd|t.ud),1).Na();t.tx=Jb(new K(0,0,1,t.Fd|t.hd),1).Na();t.vx=Jb(new K(0,0,1,t.Fd|t.ud),1).Na();t.Zw=Jb(new K(0,0,1,t.td|t.hd),1).Na();t.ax=Jb(new K(0,0,1,t.td|t.ud),1).Na();t.nx=Jb(new K(0,0,1,t.hd|t.ud|t.td),1).Na();t.lx=Jb(new K(0,0,1,t.Fd|t.ud|t.td),1).Na();t.mx=Jb(new K(0,0,1,t.Fd|t.hd|t.td),1).Na();t.kx=Jb(new K(0,0,1,t.Fd|t.hd|t.ud),1).Na();t.Xw=Jb(new K(0,0,1,t.Fd|t.hd|t.ud|t.td),1).Na();var Pb;K.None=Pb=t.NONE;var Qb;
K.Default=Qb=t.gx;var Sb;K.TopLeft=Sb=t.sx;var Tb;K.TopCenter=Tb=t.Sp;var Ub;K.TopRight=Ub=t.ux;K.LeftCenter=t.Pp;var Vb;K.Center=Vb=t.ex;K.RightCenter=t.Qp;var Wb;K.BottomLeft=Wb=t.Yw;var Xb;K.BottomCenter=Xb=t.Op;var $b;K.BottomRight=$b=t.$w;var ac;K.MiddleTop=ac=t.Sp;var bc;K.MiddleLeft=bc=t.Pp;var cc;K.MiddleRight=cc=t.Qp;var dc;K.MiddleBottom=dc=t.Op;K.Top=t.Sp;var gc;K.Left=gc=t.Pp;var nc;K.Right=nc=t.Qp;K.Bottom=t.Op;var oc;K.TopSide=oc=t.wx;var pc;K.LeftSide=pc=t.jx;var vc;
K.RightSide=vc=t.px;var wc;K.BottomSide=wc=t.bx;K.TopBottomSides=t.qx;K.LeftRightSides=t.ix;K.TopLeftSides=t.tx;K.TopRightSides=t.vx;K.BottomLeftSides=t.Zw;K.BottomRightSides=t.ax;K.NotTopSide=t.nx;K.NotLeftSide=t.lx;K.NotRightSide=t.mx;K.NotBottomSide=t.kx;var xc;K.AllSides=xc=t.Xw;function zc(){this.Xe=[1,0,0,1,0,0]}zc.prototype.copy=function(){var a=new zc;a.Xe[0]=this.Xe[0];a.Xe[1]=this.Xe[1];a.Xe[2]=this.Xe[2];a.Xe[3]=this.Xe[3];a.Xe[4]=this.Xe[4];a.Xe[5]=this.Xe[5];return a};
function Ac(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.rD=[]}Ac.prototype.addColorStop=function(a,b){this.rD.push({offset:a,color:b})};
function Bc(a){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.xw=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.path=[];this.Ki=new zc;this.stack=[];this.og=[];this.AF=this.hE=this.Rv=0;this.bw=a;this.II="http://www.w3.org/2000/svg";this.Bt=Cc(this,"svg",{width:this.bw.width+"px",height:this.bw.height+
"px",KJ:"0 0 "+this.bw.width+" "+this.bw.height})}aa=Bc.prototype;aa.arc=function(a,b,c,d,e,g){Fc(this,a,b,c,d,e,g)};aa.beginPath=function(){this.path=[]};aa.bezierCurveTo=function(a,b,c,d,e,g){this.path.push(["C",a,b,c,d,e,g])};aa.clearRect=function(){};aa.clip=function(){Gc(this,"clipPath",this.path,new zc)};aa.closePath=function(){this.path.push(["z"])};aa.createLinearGradient=function(a,b,c,d){var e=new Ac("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};aa.createPattern=function(){};
aa.createRadialGradient=function(a,b,c,d,e,g){var h=new Ac("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=g;return h};
aa.drawImage=function(a,b,c,d,e,g,h,k,l){a=[b,c,d,e,g,h,k,l,a];b=this.Ki;e=a[8];c={x:0,y:0,width:e.naturalWidth,height:e.naturalHeight,href:e.src};d="";g=a[6]/a[2];h=a[7]/a[3];if(0!==a[4]||0!==a[5])d+=" translate("+a[4]+", "+a[5]+")";if(1!==g||1!==h)d+=" scale("+g+", "+h+")";if(0!==a[0]||0!==a[1])d+=" translate("+-a[0]+", "+-a[1]+")";if(0!==a[0]||0!==a[1]||a[2]!==e.naturalWidth||a[3]!==e.naturalHeight)e="CLIP"+this.Rv,this.Rv++,g=Cc(this,"clipPath",{id:e}),g.appendChild(Cc(this,"rect",{x:a[0],y:a[1],
width:a[2],height:a[3]})),this.Bt.appendChild(g),c["clip-path"]="url(#"+e+")";Hc(this,"image",c,b,d);this.addElement("image",c)};aa.fill=function(){Gc(this,"fill",this.path,this.Ki)};aa.fillRect=function(a,b,c,d){Ic(this,"fill",[a,b,c,d],this.Ki)};aa.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Hc(this,"fill",b,this.Ki);this.addElement("text",b,a[0])};
aa.lineTo=function(a,b){this.path.push(["L",a,b])};aa.moveTo=function(a,b){this.path.push(["M",a,b])};aa.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};aa.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])};
aa.restore=function(){this.Ki=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.xw=a.xw;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign};
aa.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,xw:this.xw,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.Ki.copy())};
aa.setTransform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||Jc(this,a,b,c,d,e,g)};aa.stroke=function(){Gc(this,"stroke",this.path,this.Ki)};aa.strokeRect=function(a,b,c,d){Ic(this,"stroke",[a,b,c,d],this.Ki)};function Cc(a,b,c,d){a=document.createElementNS(a.II,b);if(c)for(var e in c)a.setAttributeNS("href"===e?"http://www.w3.org/1999/xlink":"",e,c[e]);d&&(a.textContent=d);return a}
aa.addElement=function(a,b,c){a=Cc(this,a,b,c);0<this.og.length?this.og[this.og.length-1].appendChild(a):this.Bt.appendChild(a);return a};
function Hc(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"==b?(/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle instanceof Ac?Kc(a,a.fillStyle):a.fillStyle,c.stroke="none"):"stroke"==b&&(c.fill="none",/^rgba\(/.test(a.strokeStyle)?(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]):c.stroke=a.strokeStyle instanceof Ac?Kc(a,a.strokeStyle):a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.Xe;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
function Kc(a,b){var c="GRAD"+a.hE;a.hE++;var d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=Cc(a,"linearGradient",d);else if("radial"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c},d=Cc(a,"radialGradient",d);else throw Error("invalid gradient");for(var e=b.rD,g=e.length,h=[],k=0;k<g;k++){var l=e[k],m=l.color,l={offset:l.offset,"stop-color":m};/^rgba\(/.test(m)&&(m=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m),
l["stop-color"]="rgb("+m[1]+","+m[2]+","+m[3]+")",l["stop-opacity"]=m[4]);h.push(l)}h.sort(function(a,b){return a.offset>b.offset?1:-1});for(k=0;k<g;k++)d.appendChild(Cc(a,"stop",h[k]));a.Bt.appendChild(d);return"url(#"+c+")"}function Ic(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};Hc(a,b,c,d);a.addElement("rect",c)}
function Gc(a,b,c,d){for(var e=[],g=0;g<c.length;g++){var h=Array.prototype.slice.call(c[g]),k=[h.shift()];if("A"==k[0])k.push(h.shift()+","+h.shift(),h.shift(),h.shift()+","+h.shift(),h.shift()+","+h.shift());else for(;h.length;)k.push(h.shift()+","+h.shift());e.push(k.join(" "))}c={d:e.join(" ")};Hc(a,b,c,d);"clipPath"===b?(b="CLIP"+a.Rv,a.Rv++,d=Cc(a,"clipPath",{id:b}),d.appendChild(Cc(a,"path",c)),a.Bt.appendChild(d),0<a.og.length&&a.og[a.og.length-1].setAttributeNS(null,"clip-path","url(#"+b+
")")):a.addElement("path",c)}function Fc(a,b,c,d,e,g,h){var k=Math.abs(e-g);if(e!=g){var l=b+d*Math.cos(g);g=c+d*Math.sin(g);k>=2*Math.PI?(Fc(a,b,c,d,e,e+Math.PI,h),Fc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,g])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k==!!h?0:1,0!=a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,g]))}}
function Jc(a,b,c,d,e,g,h){var k=new zc;k.Xe=[b,c,d,e,g,h];b={};Hc(a,"g",b,k);k=a.addElement("g",b);a.og.push(k)}
aa.ab=function(){var a="SHADOW"+this.AF;this.AF++;var b=this.addElement("filter",{id:a,width:"250%",height:"250%"},null),c,d,e,g,h;if(0!=this.shadowOffsetX||0!=this.shadowOffsetY)c=Cc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",IJ:this.shadowBlur/2}),d=Cc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor}),e=Cc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"}),g=Cc(this,"feOffset",{"in":"comp",result:"offsetBlur",dx:this.shadowOffsetX,dy:this.shadowOffsetY}),
h=Cc(this,"feMerge",{}),h.appendChild(Cc(this,"feMergeNode",{"in":"offsetBlur"})),h.appendChild(Cc(this,"feMergeNode",{"in":"SourceGraphic"})),b.appendChild(c),b.appendChild(d),b.appendChild(e),b.appendChild(g),b.appendChild(h);0<this.og.length&&this.og[this.og.length-1].setAttributeNS(null,"filter","url(#"+a+")")};
var J={va:4*((Math.sqrt(2)-1)/3),ok:(new C(0,0)).Na(),rG:(new D(0,0,0,0)).Na(),Tp:(new sb(0,0,0,0)).Na(),pG:(new sb(2,2,2,2)).Na(),qG:(new pa(Infinity,Infinity)).Na(),nG:(new C(-Infinity,-Infinity)).Na(),mG:(new C(Infinity,Infinity)).Na(),kn:(new pa(0,0)).Na(),ox:(new pa(1,1)).Na(),Rp:(new pa(6,6)).Na(),hx:(new pa(8,8)).Na(),oG:(new C(NaN,NaN)).Na(),xB:null,sqrt:function(a){if(0>=a)return 0;var b=J.xB;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);J.xB=b}return 1>a?(c=1/a,2E3>=c?1/b[c|
0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},I:function(a,b){var c=a-b;return 0.5>c&&-0.5<c},Ka:function(a,b){var c=a-b;return 5E-8>c&&-5E-8<c},Cd:function(a,b,c,d,e,g,h){0>=e&&(e=1E-6);var k,l,m,n;a<c?(l=a,k=c):(l=c,k=a);b<d?(n=b,m=d):(n=d,m=b);if(a===c)return n<=h&&h<=m&&a-e<=g&&g<=a+e;if(b===d)return l<=g&&g<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=g&&g<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(g=(d-b)/(c-a)*(g-a)+b,g-e<=h&&h<=g+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-
a)/(d-b)*(h-b)+a,h-e<=g&&g<=h+e)return!0}else return!0;return!1},Mv:function(a,b,c,d,e,g,h,k,l,m,n,p){if(J.Cd(a,b,h,k,p,c,d)&&J.Cd(a,b,h,k,p,e,g))return J.Cd(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,v=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+v)/2;var s=(s+e)/2,v=(v+g)/2,x=(d+s)/2,E=(c+v)/2;return J.Mv(a,b,q,r,d,c,x,E,l,m,n,p)||J.Mv(x,E,s,v,e,g,h,k,l,m,n,p)},kH:function(a,b,c,d,e,g,h,k,l){var m=(c+e)/2,n=(d+g)/2;l.x=(((a+c)/2+m)/2+(m+(e+h)/2)/2)/2;l.y=(((b+d)/2+n)/2+(n+(g+k)/2)/2)/2;return l},
jH:function(a,b,c,d,e,g,h,k){var l=(c+e)/2,m=(d+g)/2;return nb(((a+c)/2+l)/2,((b+d)/2+m)/2,(l+(e+h)/2)/2,(m+(g+k)/2)/2)},Do:function(a,b,c,d,e,g,h,k,l,m){if(J.Cd(a,b,h,k,l,c,d)&&J.Cd(a,b,h,k,l,e,g))yb(m,a,b,0,0),yb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,v=(c+r)/2;J.Do(a,b,n,p,d,c,s,v,l,m);J.Do(s,v,q,r,e,g,h,k,l,m)}return m},ze:function(a,b,c,d,e,g,h,k,l,m){if(J.Cd(a,b,h,k,l,c,d)&&J.Cd(a,b,h,k,l,e,g))0===
m.length&&m.push([a,b]),m.push([h,k]);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,v=(c+r)/2;J.ze(a,b,n,p,d,c,s,v,l,m);J.ze(s,v,q,r,e,g,h,k,l,m)}return m},JA:function(a,b,c,d,e,g,h,k,l,m){if(J.Cd(a,b,e,g,m,c,d))return J.Cd(a,b,e,g,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var q=(n+c)/2,r=(p+d)/2;return J.JA(a,b,n,p,q,r,h,k,l,m)||J.JA(q,r,c,d,e,g,h,k,l,m)},HJ:function(a,b,c,d,e,g,h){h.x=((a+c)/2+(c+e)/2)/2;h.y=((b+
d)/2+(d+g)/2)/2;return h},IA:function(a,b,c,d,e,g,h,k){if(J.Cd(a,b,e,g,h,c,d))yb(k,a,b,0,0),yb(k,e,g,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;J.IA(a,b,l,m,n,p,h,k);J.IA(n,p,c,d,e,g,h,k)}return k},wp:function(a,b,c,d,e,g,h,k){if(J.Cd(a,b,e,g,h,c,d))0===k.length&&k.push([a,b]),k.push([e,g]);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;J.wp(a,b,l,m,n,p,h,k);J.wp(n,p,c,d,e,g,h,k)}return k},vs:function(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&
(q=1E-6);if(J.Cd(a,b,h,k,q,c,d)&&J.Cd(a,b,h,k,q,e,g)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(!s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(b<k?(l=b,h=k):(l=k,h=b),s<l||s>h)return!1}else if(a<h?l=a:(l=h,h=a),q<l||q>h)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,v=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var x=(s+c)/2,E=(v+d)/2;c=(c+e)/2;d=(d+g)/2;var F=(x+c)/2,G=(E+d)/2,L=(n-l)*(n-l)+(p-m)*(p-m),N=!1;J.vs(a,b,s,v,x,E,F,G,
l,m,n,p,q,r)&&(a=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),a<L&&(L=a,N=!0));b=r.x;s=r.y;J.vs(F,G,c,d,e,g,h,k,l,m,n,p,q,r)&&(a=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),a<L?N=!0:(r.x=b,r.y=s));return N},ws:function(a,b,c,d,e,g,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(J.Cd(a,b,h,k,q,c,d)&&J.Cd(a,b,h,k,q,e,g)){q=(a-h)*(m-p)-(b-k)*(l-n);if(!q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,v=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(b<k?(l=b,a=k):(l=k,a=b),v<l||v>a)return r}else if(a<
h?(l=a,a=h):l=h,s<l||s>a)return r;0<q?r++:0>q&&r--}else{var s=(a+c)/2,v=(b+d)/2,x=(c+e)/2,E=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+x)/2;c=(v+E)/2;var x=(x+e)/2,E=(E+g)/2,F=(d+x)/2,G=(c+E)/2,r=r+J.ws(a,b,s,v,d,c,F,G,l,m,n,p,q),r=r+J.ws(F,G,x,E,e,g,h,k,l,m,n,p,q)}return r},Ym:function(a,b,c,d,e,g,h){if(J.Ka(a,c)){var k;b<d?(k=b,c=d):(k=d,c=b);d=g;if(d<k)return h.x=a,h.y=k,!1;if(d>c)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(J.Ka(b,d)){a<c?k=a:(k=c,c=a);d=e;if(d<k)return h.x=k,h.y=b,!1;if(d>c)return h.x=
c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-g)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005<k)return h.x=c,h.y=d,!1;h.x=a+k*(c-a);h.y=b+k*(d-b);return!0},Zg:function(a,b,c,d,e,g,h,k,l){if(J.I(a,c)&&J.I(b,d))return l.x=a,l.y=b,!1;if(J.Ka(e,h)){if(J.Ka(a,c))return J.Ym(a,b,c,d,e,g,l),!1;g=(d-b)/(c-a)*(e-a)+b;return J.Ym(a,b,c,d,e,g,l)}k=(k-g)/(h-e);if(J.Ka(a,c)){g=k*(a-e)+g;b<d?(h=b,c=d):(h=d,c=b);if(g<h)return l.x=a,l.y=h,!1;if(g>c)return l.x=a,l.y=c,!1;l.x=a;
l.y=g;return!0}h=(d-b)/(c-a);if(J.Ka(k,h))return J.Ym(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(J.Ka(h,0)){a<c?h=a:(h=c,c=a);if(e<h)return l.x=h,l.y=b,!1;if(e>c)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}g=h*(e-a)+b;return J.Ym(a,b,c,d,e,g,l)},vJ:function(a,b,c,d,e){return J.Zg(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},tJ:function(a,b,c,d,e,g,h,k,l,m){function n(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e<p&&(p=e,l.x=c,l.y=d)}var p=Infinity;n(l.x,l.y);var q,r,s,v;e<h?(q=e,r=h):(q=h,r=e);g<k?(s=e,v=h):(s=h,v=
e);q=(r-q)/2+m;m=(v-s)/2+m;e=(e+h)/2;g=(g+k)/2;if(0===q||0===m)return l;if(0.5>(c>a?c-a:a-c)){q=1-(c-e)*(c-e)/(q*q);if(0>q)return l;q=Math.sqrt(q);d=-m*q+g;n(c,m*q+g);n(c,d)}else{c=(d-b)/(c-a);d=1/(q*q)+c*c/(m*m);k=2*c*(b-c*a)/(m*m)-2*c*g/(m*m)-2*e/(q*q);q=k*k-4*d*(2*c*a*g/(m*m)-2*b*g/(m*m)+g*g/(m*m)+e*e/(q*q)-1+(b-c*a)*(b-c*a)/(m*m));if(0>q)return l;q=Math.sqrt(q);m=(-k+q)/(2*d);n(m,c*m-c*a+b);q=(-k-q)/(2*d);n(q,c*q-c*a+b)}return l},Vo:function(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(J.Zg(a,b,a,
d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);q<m&&(m=q,n=l.x,p=l.y)}J.Zg(c,b,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));J.Zg(a,b,c,b,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));J.Zg(a,d,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m},ow:function(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===g?(e<h?(a=e,g=h):(a=h,g=e),k<=d&&d<=l&&a<=n&&g>=m):
e===h?(d<g?a=d:(a=g,g=d),m<=e&&e<=n&&a<=l&&g>=k):a.Ha(b)||a.Ha(c)||J.nw(k,m,l,m,d,e,g,h)||J.nw(l,m,l,n,d,e,g,h)||J.nw(l,n,k,n,d,e,g,h)||J.nw(k,n,k,m,d,e,g,h)?!0:!1},nw:function(a,b,c,d,e,g,h,k){return 0>=J.Tv(a,b,c,d,e,g)*J.Tv(a,b,c,d,h,k)&&0>=J.Tv(e,g,h,k,a,b)*J.Tv(e,g,h,k,c,d)},Tv:function(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0<g&&(g=(a-c)*c+(b-d)*d,0>g&&(g=0)));return 0>g?-1:0<g?1:0},jt:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},AD:function(a,b,c,d,e,g){var h=
Math.PI;g||(d*=h/180,e*=h/180);g=d<e?1:-1;var k=[],l=h/2,m=d;for(d=Math.min(2*h+1E-5,Math.abs(e-d));1E-5<d;)e=m+g*Math.min(d,l),k.push(J.tH(c,m,e,a,b)),d-=Math.abs(e-m),m=e;return k},tH:function(a,b,c,d,e){var g=(c-b)/2,h=a*Math.cos(g),k=a*Math.sin(g),l=0.5522847498*Math.tan(g),m=h+l*k,h=-k+l*h,k=-h,l=g+b,g=Math.cos(l),l=Math.sin(l);return{x1:d+a*Math.cos(b),y1:e+a*Math.sin(b),x2:d+m*g-h*l,y2:e+m*l+h*g,ae:d+m*g-k*l,be:e+m*l+k*g,Ob:d+a*Math.cos(c),Pb:e+a*Math.sin(c)}},Gs:function(a,b,c,d,e,g,h){c=
Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/g)*g+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+g-b<g/2&&(a=d+g);h.q(k,a);return h},eE:function(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,g=1;do e=c%d,c=g=d,d=e;while(0<e);return g},GH:function(a,b,c,d){var e=0>c,g=0>d,h,k;a<b?(h=1,k=0):(h=0,k=1);var l,m;l=0===h?a:b;m=0===h?c:d;if(0===h?e:g)m=-m;h=k;c=0===h?c:d;if(0===h?e:g)c=-c;return J.HH(l,0===h?a:b,m,c,0,0)},HH:function(a,b,c,d,e,g){if(0<d)if(0<c){g=a*a;e=b*b;a*=c;var h=b*d,k=-e+h,l=-e+Math.sqrt(a*a+h*h);
b=k;for(var m=0;9999999999>m;++m){b=0.5*(k+l);if(b===k||b===l)break;var n=a/(b+g),p=h/(b+e),n=n*n+p*p-1;if(0<n)k=b;else if(0>n)l=b;else break}c=g*c/(b+g)-c;d=e*d/(b+e)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,e=a*c,e<d?(d=e/d,e=a*d,g=b*Math.sqrt(Math.abs(1-d*d)),c=e-c,c=Math.sqrt(c*c+g*g)):c=Math.abs(c-a);return c}};
function M(a){1<arguments.length&&t.l("Geometry constructor can take at most one optional argument, the Geometry type.");t.zc(this);void 0===a?a=Lc:f&&t.tb(a,M,M,"constructor:type");this.ba=a;this.xd=this.md=this.nc=this.ec=0;this.Fk=new H(Mc);this.ou=this.Fk.Wb;this.au=(new D).freeze();this.Xa=!0;this.wi=Sb;this.xi=$b;this.xu=this.yu=NaN;this.de=J.kn;this.kc=Nc}t.ia("Geometry",M);t.Fh(M);
M.prototype.copy=function(){var a=new M;a.ba=this.ba;a.ec=this.ec;a.nc=this.nc;a.md=this.md;a.xd=this.xd;for(var b=this.Fk,c=b.length,d=a.Fk,e=0;e<c;e++){var g=b.p[e].copy();d.add(g)}a.ou=this.ou;a.au.assign(this.au);a.Xa=this.Xa;a.wi=this.wi.Z();a.xi=this.xi.Z();a.yu=this.yu;a.xu=this.xu;a.de=this.de.Z();a.kc=this.kc;return a};var Tc;M.Line=Tc=t.w(M,"Line",0);var Uc;M.Rectangle=Uc=t.w(M,"Rectangle",1);var Vc;M.Ellipse=Vc=t.w(M,"Ellipse",2);var Lc;M.Path=Lc=t.w(M,"Path",3);
M.prototype.Na=function(){this.freeze();Object.freeze(this);return this};M.prototype.freeze=function(){this.jb=!0;var a=this.ub;a.freeze();for(var b=a.length,c=0;c<b;c++)a.p[c].freeze();return this};M.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;var a=this.ub;a.Ua();for(var b=a.length,c=0;c<b;c++)a.p[c].Ua();return this};
M.prototype.equalsApprox=M.prototype.bk=function(a){if(!(a instanceof M))return!1;if(this.type!==a.type)return this.type===Tc&&a.type===Lc?Wc(this,a):a.type===Tc&&this.type===Lc?Wc(a,this):!1;if(this.type===Lc){var b=this.ub;a=a.ub;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b.p[d].bk(a.p[d]))return!1;return!0}return J.I(this.na,a.na)&&J.I(this.oa,a.oa)&&J.I(this.D,a.D)&&J.I(this.F,a.F)};
function Wc(a,b){if(a.type!==Tc||b.type!==Lc)return!1;if(1===b.ub.count){var c=b.ub.qa(0);if(1===c.Ga.count&&J.I(a.na,c.na)&&J.I(a.oa,c.oa)&&(c=c.Ga.qa(0),c.type===Xc&&J.I(a.D,c.D)&&J.I(a.F,c.F)))return!0}return!1}var Yc;M.stringify=Yc=function(a){return a.toString()};
M.prototype.toString=function(a){switch(this.type){case Tc:return void 0===a?"M"+this.na.toString()+" "+this.oa.toString()+"L"+this.D.toString()+" "+this.F.toString():"M"+this.na.toFixed(a)+" "+this.oa.toFixed(a)+"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);case Uc:var b=new D(this.na,this.oa,0,0);b.YF(this.D,this.F,0,0);return void 0===a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+
"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Vc:b=new D(this.na,this.oa,0,0);b.YF(this.D,this.F,0,0);if(void 0===a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+
(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case Lc:for(var b="",c=this.ub,d=c.length,e=0;e<d;e++){var g=c.p[e];0<e&&(b+=" x ");g.ap&&(b+="F ");b+=g.toString(a)}return b;default:return this.type.toString()}};var Zc;
M.fillPath=Zc=function(a){"string"!==typeof a&&t.Vb(a,"string",M,"fillPath:str");a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++)var e=a[d],c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e);return c};var $c;
M.parse=$c=function(a,b){function c(){return n>=x-1?!0:null!==m[n+1].match(/[A-Za-z]/)}function d(){n++;return m[n]}function e(){var a=new C(parseFloat(d()),parseFloat(d()));p===p.toLowerCase()&&(a.x=v.x+a.x,a.y=v.y+a.y);return a}function g(){return v=e()}function h(){return s=e()}function k(){var a=[parseFloat(d()),parseFloat(d()),parseFloat(d()),parseFloat(d()),parseFloat(d())];c()||(a.push(parseFloat(d())),c()||a.push(parseFloat(d())));p===p.toLowerCase()&&(a[2]+=v.x,a[3]+=v.y);return a}function l(){return"c"!==
q.toLowerCase()&&"s"!==q.toLowerCase()?v:new C(2*v.x-s.x,2*v.y-s.y)}void 0===b&&(b=!1);"string"!==typeof a&&t.Vb(a,"string",M,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=
a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var m=a.split(" "),n=-1,p="",q="",r=new C(0,0),s=new C(0,0),v=new C(0,0),x=m.length,E=t.u(),F,G=!1,L=!1,N=!0;!(n>=x-1);)if(q=p,p=d(),""!==p)switch(p.toUpperCase()){case "X":N=!0;L=G=!1;break;case "M":F=g();null===E.Qb||!0===N?(O(E,F.x,F.y,G,!1,!L),N=!1):E.moveTo(F.x,F.y);for(r=v;!c();)F=g(),E.lineTo(F.x,F.y);break;case "L":for(;!c();)F=
g(),E.lineTo(F.x,F.y);break;case "H":for(;!c();)v=F=new C((p===p.toLowerCase()?v.x:0)+parseFloat(d()),v.y),E.lineTo(v.x,v.y);break;case "V":for(;!c();)v=F=new C(v.x,(p===p.toLowerCase()?v.y:0)+parseFloat(d())),E.lineTo(v.x,v.y);break;case "C":for(;!c();){var V=e(),T=h();F=g();P(E,V.x,V.y,T.x,T.y,F.x,F.y)}break;case "S":for(;!c();)V=l(),T=h(),F=g(),P(E,V.x,V.y,T.x,T.y,F.x,F.y);break;case "Q":for(;!c();)T=h(),F=g(),ad(E,T.x,T.y,F.x,F.y);break;case "T":for(;!c();)s=T=l(),F=g(),ad(E,T.x,T.y,F.x,F.y);
break;case "B":for(;!c();)F=k(),E.arcTo(F[0],F[1],F[2],F[3],F[4],F[5],F[6]);break;case "A":for(;!c();){var V=Math.abs(parseFloat(d())),T=Math.abs(parseFloat(d())),W=parseFloat(d()),da=!!parseFloat(d()),R=!!parseFloat(d());F=g();bd(E,V,T,W,da,R,F.x,F.y)}break;case "Z":Q(E);v=r;break;case "F":F=null;for(V=1;m[n+V];)if(null!==m[n+V].match(/[Uu]/))V++;else if(null===m[n+V].match(/[A-Za-z]/))V++;else{F=m[n+V];break}F.match(/[Mm]/)?G=!0:cd(E);break;case "U":F=null;for(V=1;m[n+V];)if(null!==m[n+V].match(/[Ff]/))V++;
else if(null===m[n+V].match(/[A-Za-z]/))V++;else{F=m[n+V];break}F.match(/[Mm]/)?L=!0:E.ab(!1)}r=E.s;t.v(E);if(b)for(E=r.ub.k;E.next();)E.value.ap=!0;return r};function dd(a,b){for(var c=a.length,d=t.O(),e=0;e<c;e++){var g=a[e];d.x=g.x1;d.y=g.y1;b.Va(d);g.x1=d.x;g.y1=d.y;d.x=g.x2;d.y=g.y2;b.Va(d);g.x2=d.x;g.y2=d.y;d.x=g.ae;d.y=g.be;b.Va(d);g.ae=d.x;g.be=d.y;d.x=g.Ob;d.y=g.Pb;b.Va(d);g.Ob=d.x;g.Pb=d.y}t.B(d)}
M.prototype.mA=function(){if(this.Xa)return!0;var a=this.ub;if(this.ou!==a.Wb)return!0;for(var b=a.length,c=0;c<b;c++)if(a.p[c].mA())return!0;return!1};M.prototype.pB=function(){this.Xa=!1;var a=this.ub;this.ou=a.Wb;for(var b=a.length,c=0;c<b;c++)a.p[c].pB()};M.prototype.kf=function(){var a=this.au;a.Ua();a.q(0,0,this.de.width,this.de.height);ed(this,a,!1);yb(a,0,0,0,0);a.freeze()};M.prototype.computeBoundsWithoutOrigin=M.prototype.pH=function(){var a=new D;ed(this,a,!0);return a};
function ed(a,b,c){switch(a.type){case Tc:case Uc:case Vc:c?b.q(a.ec,a.nc,0,0):yb(b,a.ec,a.nc,0,0);yb(b,a.md,a.xd,0,0);break;case Lc:a=a.ub;for(var d=a.length,e=0;e<d;e++){var g=a.p[e];c&&0===e?b.q(g.na,g.oa,0,0):yb(b,g.na,g.oa,0,0);for(var h=g.Ga,k=h.length,l=g.na,m=g.oa,n=0;n<k;n++){var p=h.p[n];switch(p.type){case Xc:case kd:l=p.D;m=p.F;yb(b,l,m,0,0);break;case md:J.Do(l,m,p.vb,p.Lb,p.oe,p.pe,p.D,p.F,0.5,b);l=p.D;m=p.F;break;case nd:J.IA(l,m,p.vb,p.Lb,p.D,p.F,0.5,b);l=p.D;m=p.F;break;case od:case pd:for(var p=
p.type===od?qd(p,g):rd(p,g,l,m),q=p.length,r=null,s=0;s<q;s++)r=p[s],J.Do(r.x1,r.y1,r.x2,r.y2,r.ae,r.be,r.Ob,r.Pb,0.5,b);null!==r&&(l=r.Ob,m=r.Pb);break;default:t.l("Unknown Segment type: "+p.type)}}}break;default:t.l("Unknown Geometry type: "+a.type)}}M.prototype.normalize=M.prototype.normalize=function(){t.J(this);var a=this.pH();this.offset(-a.x,-a.y);return new C(-a.x,-a.y)};
M.prototype.offset=M.prototype.offset=function(a,b){t.J(this);f&&(t.o(a,M,"offset"),t.o(b,M,"offset"));this.transform(1,0,0,1,a,b)};M.prototype.scale=M.prototype.scale=function(a,b){t.J(this);f&&(t.o(a,M,"scale:x"),t.o(b,M,"scale:y"),0>=a&&t.ha(a,"scale must be greater than zero",M,"scale:x"),0>=b&&t.ha(b,"scale must be greater than zero",M,"scale:y"));this.transform(a,0,0,b,0,0)};
M.prototype.rotate=M.prototype.rotate=function(a,b,c){t.J(this);void 0===b&&(b=0);void 0===c&&(c=0);f&&(t.o(a,M,"rotate:angle"),t.o(b,M,"rotate:x"),t.o(c,M,"rotate:y"));var d=t.ah();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);t.Se(d)};
M.prototype.transform=M.prototype.transform=function(a,b,c,d,e,g){var h,k;switch(this.type){case Tc:case Uc:case Vc:h=this.ec;k=this.nc;this.ec=h*a+k*c+e;this.nc=h*b+k*d+g;h=this.md;k=this.xd;this.md=h*a+k*c+e;this.xd=h*b+k*d+g;break;case Lc:for(var l=this.ub,m=l.length,n=0;n<m;n++){var p=l.p[n];h=p.na;k=p.oa;p.na=h*a+k*c+e;p.oa=h*b+k*d+g;for(var p=p.Ga,q=p.length,r=0;r<q;r++){var s=p.p[r];switch(s.type){case Xc:case kd:h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case md:h=s.vb;k=s.Lb;s.vb=h*a+
k*c+e;s.Lb=h*b+k*d+g;h=s.oe;k=s.pe;s.oe=h*a+k*c+e;s.pe=h*b+k*d+g;h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case nd:h=s.vb;k=s.Lb;s.vb=h*a+k*c+e;s.Lb=h*b+k*d+g;h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;break;case od:h=s.Fa;k=s.Sa;s.Fa=h*a+k*c+e;s.Sa=h*b+k*d+g;s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case pd:h=s.D;k=s.F;s.D=h*a+k*c+e;s.F=h*b+k*d+g;s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:t.l("Unknown Segment type: "+s.type)}}}}this.Xa=
!0};M.prototype.ks=function(a,b){var c=this.ec,d=this.nc,e=this.md,g=this.xd,h=Math.min(c,e),k=Math.min(d,g),c=Math.abs(e-c),d=Math.abs(g-d),g=t.O();g.x=h;g.y=k;b.Va(g);e=new Mc(g.x,g.y);g.x=h+c;g.y=k;b.Va(g);e.Ga.add(new S(Xc,g.x,g.y));g.x=h+c;g.y=k+d;b.Va(g);e.Ga.add(new S(Xc,g.x,g.y));g.x=h;g.y=k+d;b.Va(g);e.Ga.add((new S(Xc,g.x,g.y)).close());t.B(g);a.type=Lc;a.ub.add(e);return a};
M.prototype.Ha=function(a,b,c,d){var e=a.x,g=a.y,h=this.Mb.x-20;a=a.y;for(var k=0,l,m,n,p,q,r,s,v=this.ub.p,x=v.length,E=0;E<x;E++){var F=v[E];if(F.ap){if(c&&F.Ha(e,g,b))return!0;var G=F.Ga;l=F.na;m=F.oa;for(var L=l,N=m,V=0;V<=G.length;V++){V!==G.length?(n=G.p[V],p=n.type,r=n.D,s=n.F):(p=Xc,r=L,s=N);switch(p){case kd:q=sd(e,g,h,a,l,m,L,N);if(!0===q)return!0;k+=q;L=r;N=s;break;case Xc:q=sd(e,g,h,a,l,m,r,s);if(!0===q)return!0;k+=q;break;case md:q=J.ws(l,m,n.vb,n.Lb,n.oe,n.pe,r,s,h,a,e,g,0.5);k+=q;break;
case nd:q=J.ws(l,m,(l+2*n.vb)/3,(m+2*n.Lb)/3,(n.vb+2*r)/3,(n.vb+2*r)/3,r,s,h,a,e,g,0.5);k+=q;break;case od:case pd:p=n.type===od?qd(n,F):rd(n,F,l,m);for(var T=p.length,W=null,da=0;da<T;da++){W=p[da];if(0===da){q=sd(e,g,h,a,l,m,W.x1,W.y1);if(!0===q)return!0;k+=q}q=J.ws(W.x1,W.y1,W.x2,W.y2,W.ae,W.be,W.Ob,W.Pb,h,a,e,g,0.5);k+=q}null!==W&&(r=W.Ob,s=W.Pb);break;default:t.l("Unknown Segment type: "+n.type)}l=r;m=s}if(0!==k)return!0;k=0}else if(F.Ha(e,g,d?b:b+2))return!0}return 0!==k};
function sd(a,b,c,d,e,g,h,k){if(J.Cd(e,g,h,k,0.05,a,b))return!0;var l=(a-c)*(g-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-g*h))/l;b=(a*d-b*c)*(g-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(g<k?(a=g,e=k):(a=k,e=g),b<a||b>e)return 0}else if(e<h?(a=e,e=h):a=h,m<a||m>e)return 0;return 0<l?1:-1}function td(a,b,c,d){for(var e=a.ub.length,g=0;g<e;g++)if(a.ub.p[g].Ha(b,c,d))return!0;return!1}
M.prototype.getPointAlongPath=function(a){(0>a||1<a)&&t.ha(a,"0 <= fraction <= 1",M,"getPointAlongPath:fraction");var b=this.ub.eb(),c=t.Cb(),d=[];d.push([b.na,b.oa]);for(var e=b.na,g=b.oa,h=e,k=g,l=b.Ga.p,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.ba){case kd:c.push(d);d=[];d.push([p.D,p.F]);e=p.D;g=p.F;h=e;k=g;break;case Xc:d.push([p.D,p.F]);e=p.D;g=p.F;break;case md:J.ze(e,g,p.Og,p.Pg,p.Tk,p.Uk,p.ve,p.we,0.5,d);e=p.D;g=p.F;break;case nd:J.wp(e,g,p.Og,p.Pg,p.ve,p.we,0.5,d);e=p.D;g=p.F;break;case od:for(var q=
qd(p,b),r=q.length,s=0;s<r;s++){var v=q[s];J.ze(e,g,v.x2,v.y2,v.ae,v.be,v.Ob,v.Pb,0.5,d);e=v.Ob;g=v.Pb}break;case pd:q=rd(p,b,e,g);r=q.length;for(s=0;s<r;s++)v=q[s],J.ze(e,g,v.x2,v.y2,v.ae,v.be,v.Ob,v.Pb,0.5,d),e=v.Ob,g=v.Pb;break;default:t.l("Segment not of valid type")}p.ph&&d.push([h,k])}c.push(d);m=0;e=c.length;b=null;for(g=0;g<e;g++)for(h=c[g],k=h.length,n=0;n<k;n++)d=h[n],0!==n&&(l=Math.sqrt(eb(b[0],b[1],d[0],d[1])),m+=l),b=d;a*=m;for(g=m=0;g<e;g++)for(h=c[g],k=h.length,n=0;n<k;n++){d=h[n];
if(0!==n){l=Math.sqrt(eb(b[0],b[1],d[0],d[1]));if(m+l>a)return n=(a-m)/l,t.Da(c),new C(b[0]+(d[0]-b[0])*n,b[1]+(d[1]-b[1])*n);m+=l}b=d}t.Da(c);return null};t.g(M,"type",M.prototype.type);t.defineProperty(M,{type:"type"},function(){return this.ba},function(a){this.ba!==a&&(f&&t.tb(a,M,M,"type"),t.J(this,a),this.ba=a,this.Xa=!0)});t.g(M,"startX",M.prototype.na);t.defineProperty(M,{na:"startX"},function(){return this.ec},function(a){this.ec!==a&&(f&&t.o(a,M,"startX"),t.J(this,a),this.ec=a,this.Xa=!0)});
t.g(M,"startY",M.prototype.oa);t.defineProperty(M,{oa:"startY"},function(){return this.nc},function(a){this.nc!==a&&(f&&t.o(a,M,"startY"),t.J(this,a),this.nc=a,this.Xa=!0)});t.g(M,"endX",M.prototype.D);t.defineProperty(M,{D:"endX"},function(){return this.md},function(a){this.md!==a&&(f&&t.o(a,M,"endX"),t.J(this,a),this.md=a,this.Xa=!0)});t.g(M,"endY",M.prototype.F);t.defineProperty(M,{F:"endY"},function(){return this.xd},function(a){this.xd!==a&&(f&&t.o(a,M,"endY"),t.J(this,a),this.xd=a,this.Xa=!0)});
t.g(M,"figures",M.prototype.ub);t.defineProperty(M,{ub:"figures"},function(){return this.Fk},function(a){this.Fk!==a&&(f&&t.m(a,H,M,"figures"),t.J(this,a),this.Fk=a,this.Xa=!0)});t.defineProperty(M,{G:"spot1"},function(){return this.wi},function(a){f&&t.m(a,K,M,"spot1");t.J(this,a);this.wi=a.Z()});t.defineProperty(M,{H:"spot2"},function(){return this.xi},function(a){f&&t.m(a,K,M,"spot2");t.J(this,a);this.xi=a.Z()});t.A(M,{Mb:"bounds"},function(){this.mA()&&(this.pB(),this.kf());return this.au});
t.g(M,"minSize",M.prototype.Ye);t.defineProperty(M,{Ye:"minSize"},function(){return this.de},function(a){this.de.N(a)||(f&&t.m(a,pa,M,"minSize"),a=a.Z(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.de=a)});function Mc(a,b,c){t.zc(this);void 0===c&&(c=!0);this.Pl=c;this.Qn=!0;void 0!==a?(f&&t.o(a,Mc,"sx"),this.ec=a):this.ec=0;void 0!==b?(f&&t.o(b,Mc,"sy"),this.nc=b):this.nc=0;this.Rr=new H(S);this.kv=this.Rr.Wb;this.Xa=!0}t.ia("PathFigure",Mc);t.Fh(Mc);
Mc.prototype.copy=function(){var a=new Mc;a.Pl=this.Pl;a.Qn=this.Qn;a.ec=this.ec;a.nc=this.nc;for(var b=this.Rr,c=b.length,d=a.Rr,e=0;e<c;e++){var g=b.p[e].copy();d.add(g)}a.kv=this.kv;a.Xa=this.Xa;return a};Mc.prototype.equalsApprox=Mc.prototype.bk=function(a){if(!(a instanceof Mc&&J.I(this.na,a.na)&&J.I(this.oa,a.oa)))return!1;var b=this.Ga;a=a.Ga;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b.p[d].bk(a.p[d]))return!1;return!0};aa=Mc.prototype;
aa.toString=function(a){for(var b=void 0===a?"M"+this.na.toString()+" "+this.oa.toString():"M"+this.na.toFixed(a)+" "+this.oa.toFixed(a),c=this.Ga,d=c.length,e=0;e<d;e++)b+=" "+c.p[e].toString(a);return b};aa.freeze=function(){this.jb=!0;var a=this.Ga;a.freeze();for(var b=a.length,c=0;c<b;c++)a.p[c].freeze();return this};aa.Ua=function(){this.jb=!1;var a=this.Ga;a.Ua();for(var b=a.length,c=0;c<b;c++)a.p[c].Ua();return this};
aa.mA=function(){if(this.Xa)return!0;var a=this.Ga;if(this.kv!==a.Wb)return!0;for(var b=a.length,c=0;c<b;c++)if(a.p[c].Xa)return!0;return!1};aa.pB=function(){this.Xa=!1;var a=this.Ga;this.kv=a.Wb;for(var b=a.length,c=0;c<b;c++){var d=a.p[c];d.Xa=!1;d.dj=null}};t.g(Mc,"isFilled",Mc.prototype.ap);t.defineProperty(Mc,{ap:"isFilled"},function(){return this.Pl},function(a){f&&t.j(a,"boolean",Mc,"isFilled");t.J(this,a);this.Pl=a});t.g(Mc,"isShadowed",Mc.prototype.Lh);
t.defineProperty(Mc,{Lh:"isShadowed"},function(){return this.Qn},function(a){f&&t.j(a,"boolean",Mc,"isShadowed");t.J(this,a);this.Qn=a});t.g(Mc,"startX",Mc.prototype.na);t.defineProperty(Mc,{na:"startX"},function(){return this.ec},function(a){f&&t.o(a,Mc,"startX");t.J(this,a);this.ec=a;this.Xa=!0});t.g(Mc,"startY",Mc.prototype.oa);t.defineProperty(Mc,{oa:"startY"},function(){return this.nc},function(a){f&&t.o(a,Mc,"startY");t.J(this,a);this.nc=a;this.Xa=!0});t.g(Mc,"segments",Mc.prototype.Ga);
t.defineProperty(Mc,{Ga:"segments"},function(){return this.Rr},function(a){f&&t.m(a,H,Mc,"segments");t.J(this,a);this.Rr=a;this.Xa=!0});
Mc.prototype.Ha=function(a,b,c){for(var d=this.na,e=this.oa,g=d,h=e,k=this.Ga.p,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case kd:g=n.D;h=n.F;d=n.D;e=n.F;break;case Xc:if(J.Cd(d,e,n.D,n.F,c,a,b))return!0;d=n.D;e=n.F;break;case md:if(J.Mv(d,e,n.vb,n.Lb,n.oe,n.pe,n.D,n.F,0.5,a,b,c))return!0;d=n.D;e=n.F;break;case nd:if(J.JA(d,e,n.vb,n.Lb,n.D,n.F,0.5,a,b,c))return!0;d=n.D;e=n.F;break;case od:case pd:for(var p=n.type===od?qd(n,this):rd(n,this,d,e),q=p.length,r=null,s=0;s<q;s++)if(r=p[s],0===s&&
J.Cd(d,e,r.x1,r.y1,c,a,b)||J.Mv(r.x1,r.y1,r.x2,r.y2,r.ae,r.be,r.Ob,r.Pb,0.5,a,b,c))return!0;null!==r&&(d=r.Ob,e=r.Pb);break;default:t.l("Unknown Segment type: "+n.type)}if(n.Ss&&(d!==g||e!==h)&&J.Cd(d,e,g,h,c,a,b))return!0}return!1};
function S(a,b,c,d,e,g,h,k){t.zc(this);void 0===a?a=Xc:f&&t.tb(a,S,S,"constructor:type");this.ba=a;a===od?(void 0!==b?(f&&t.o(b,S,"ex"),this.xe=b):this.xe=0,void 0!==c?(f&&t.o(c,S,"ey"),this.ye=c):this.ye=0,void 0!==d&&(f&&t.o(d,S,"x1"),this.rn=d),void 0!==e&&(f&&t.o(e,S,"y1"),this.sn=e),void 0!==g&&(f&&t.o(g,S,"x2"),this.Fj=Math.max(g||0,0)),void 0!==h&&"number"===typeof h?(f&&t.o(h,S,"y2"),this.Gj=Math.max(h||0,0)):this.Gj=this.Fj):a===pd?(void 0!==b&&f&&t.o(b,S,"ex"),void 0!==c&&f&&t.o(c,S,"ey"),
void 0!==d&&f&&t.o(d,S,"x1"),void 0!==e&&f&&t.o(e,S,"y1"),this.ve=b||0,this.we=c||0,this.Fj=Math.max(d||0,0),this.Gj=Math.max(e||0,0),this.xe=h?1:0,this.ye=k?1:0,a=(g||0)%360,0>a&&(a+=360),this.to=a):(void 0!==b?(f&&t.o(b,S,"ex"),this.ve=b):this.ve=0,void 0!==c?(f&&t.o(c,S,"ey"),this.we=c):this.we=0,void 0!==d&&(f&&t.o(d,S,"x1"),this.Og=d),void 0!==e&&(f&&t.o(e,S,"y1"),this.Pg=e),void 0!==g&&(f&&t.o(g,S,"x2"),this.Tk=g),void 0!==h&&"number"===typeof h&&(f&&t.o(h,S,"y2"),this.Uk=h));this.Xa=!0;this.ph=
!1;this.dj=null}t.ia("PathSegment",S);t.Fh(S);S.prototype.copy=function(){var a=new S;a.ba=this.ba;this.ba===od?(a.xe=this.xe,a.ye=this.ye,a.rn=this.rn,a.sn=this.sn,a.Fj=this.Fj,a.Gj=this.Gj):this.ba===pd?(a.xe=this.xe,a.ye=this.ye,a.ve=this.ve,a.we=this.we,a.Fj=this.Fj,a.Gj=this.Gj,a.to=this.to):(a.ve=this.ve,a.we=this.we,a.Og=this.Og,a.Pg=this.Pg,a.Tk=this.Tk,a.Uk=this.Uk);a.Xa=this.Xa;a.ph=this.ph;return a};
S.prototype.equalsApprox=S.prototype.bk=function(a){if(!(a instanceof S)||this.type!==a.type||this.Ss!==a.Ss)return!1;switch(this.type){case kd:case Xc:return J.I(this.D,a.D)&&J.I(this.F,a.F);case md:return J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.vb,a.vb)&&J.I(this.Lb,a.Lb)&&J.I(this.oe,a.oe)&&J.I(this.pe,a.pe);case nd:return J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.vb,a.vb)&&J.I(this.Lb,a.Lb);case od:return J.I(this.yg,a.yg)&&J.I(this.Sh,a.Sh)&&J.I(this.Fa,a.Fa)&&J.I(this.Sa,a.Sa)&&J.I(this.radiusX,
a.radiusX)&&J.I(this.radiusY,a.radiusY);case pd:return this.pw===a.pw&&this.sw===a.sw&&J.I(this.Ww,a.Ww)&&J.I(this.D,a.D)&&J.I(this.F,a.F)&&J.I(this.radiusX,a.radiusX)&&J.I(this.radiusY,a.radiusY);default:return!1}};
S.prototype.toString=function(a){switch(this.type){case kd:a=void 0===a?"M"+this.D.toString()+" "+this.F.toString():"M"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case Xc:a=void 0===a?"L"+this.D.toString()+" "+this.F.toString():"L"+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case md:a=void 0===a?"C"+this.vb.toString()+" "+this.Lb.toString()+" "+this.oe.toString()+" "+this.pe.toString()+" "+this.D.toString()+" "+this.F.toString():"C"+this.vb.toFixed(a)+" "+this.Lb.toFixed(a)+" "+this.oe.toFixed(a)+
" "+this.pe.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case nd:a=void 0===a?"Q"+this.vb.toString()+" "+this.Lb.toString()+" "+this.D.toString()+" "+this.F.toString():"Q"+this.vb.toFixed(a)+" "+this.Lb.toFixed(a)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;case od:a=void 0===a?"B"+this.yg.toString()+" "+this.Sh.toString()+" "+this.Fa.toString()+" "+this.Sa.toString()+" "+this.radiusX:"B"+this.yg.toFixed(a)+" "+this.Sh.toFixed(a)+" "+this.Fa.toFixed(a)+" "+this.Sa.toFixed(a)+
" "+this.radiusX;break;case pd:a=void 0===a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Ww.toString()+" "+(this.sw?1:0)+" "+(this.pw?1:0)+" "+this.D.toString()+" "+this.F.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Ww.toFixed(a)+" "+(this.sw?1:0)+" "+(this.pw?1:0)+" "+this.D.toFixed(a)+" "+this.F.toFixed(a);break;default:a=this.type.toString()}return a+(this.ph?"z":"")};var kd;S.Move=kd=t.w(S,"Move",0);var Xc;S.Line=Xc=t.w(S,"Line",1);var md;
S.Bezier=md=t.w(S,"Bezier",2);var nd;S.QuadraticBezier=nd=t.w(S,"QuadraticBezier",3);var od;S.Arc=od=t.w(S,"Arc",4);var pd;S.SvgArc=pd=t.w(S,"SvgArc",4);S.prototype.freeze=function(){this.jb=!0;return this};S.prototype.Ua=function(){this.jb=!1;return this};S.prototype.close=S.prototype.close=function(){this.ph=!0;return this};
function qd(a,b){if(null!==a.dj&&!1===b.Xa)return a.dj;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);var e=a.rn,g=a.sn,h=J.AD(0,0,c<d?c:d,a.yg,a.yg+a.Sh);if(c!==d){var k=t.ah();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);for(var c=h.length,d=t.O(),l=0;l<c;l++){var m=h[l];d.x=m.x1;d.y=m.y1;k.Va(d);m.x1=d.x;m.y1=d.y;d.x=m.x2;d.y=m.y2;k.Va(d);m.x2=d.x;m.y2=d.y;d.x=m.ae;d.y=m.be;k.Va(d);m.ae=d.x;m.be=d.y;d.x=m.Ob;d.y=m.Pb;k.Va(d);m.Ob=d.x;m.Pb=d.y}t.B(d);t.Se(k)}k=h.length;for(c=0;c<k;c++)d=h[c],d.x1+=
e,d.y1+=g,d.x2+=e,d.y2+=g,d.ae+=e,d.be+=g,d.Ob+=e,d.Pb+=g;a.dj=h;return a.dj}
function rd(a,b,c,d){function e(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(g(a,b))}function g(a,b){return(a[0]*b[0]+a[1]*b[1])/(Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))*Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2)))}if(null!==a.dj&&!1===b.Xa)return a.dj;b=a.Fj;var h=a.Gj,k=Math.PI/180*a.to,l=a.yg,m=a.ye,n=a.ve,p=a.we,q=Math.cos(k)*(c-n)/2+Math.sin(k)*(d-p)/2,r=-Math.sin(k)*(c-n)/2+Math.cos(k)*(d-p)/2,s=Math.pow(q,2)/Math.pow(b,2)+Math.pow(r,2)/Math.pow(h,2);1<s&&(b*=Math.sqrt(s),h*=Math.sqrt(s));
s=(l===m?-1:1)*Math.sqrt((Math.pow(b,2)*Math.pow(h,2)-Math.pow(b,2)*Math.pow(r,2)-Math.pow(h,2)*Math.pow(q,2))/(Math.pow(b,2)*Math.pow(r,2)+Math.pow(h,2)*Math.pow(q,2)));isNaN(s)&&(s=0);l=s*b*r/h;s=s*-h*q/b;isNaN(l)&&(l=0);isNaN(s)&&(s=0);c=(c+n)/2+Math.cos(k)*l-Math.sin(k)*s;d=(d+p)/2+Math.sin(k)*l+Math.cos(k)*s;k=e([1,0],[(q-l)/b,(r-s)/h]);p=[(q-l)/b,(r-s)/h];r=[(-q-l)/b,(-r-s)/h];q=e(p,r);-1>=g(p,r)&&(q=Math.PI);1<=g(p,r)&&(q=0);0===m&&0<q&&(q-=2*Math.PI);1===m&&0>q&&(q+=2*Math.PI);m=b>h?1:b/h;
r=b>h?h/b:1;b=J.AD(0,0,b>h?b:h,k,k+q,!0);h=t.ah();h.reset();h.translate(c,d);h.rotate(a.to,0,0);h.scale(m,r);dd(b,h);t.Se(h);a.dj=b;return a.dj}t.g(S,"isClosed",S.prototype.Ss);t.defineProperty(S,{Ss:"isClosed"},function(){return this.ph},function(a){this.ph!==a&&(this.ph=a,this.Xa=!0)});t.g(S,"type",S.prototype.type);t.defineProperty(S,{type:"type"},function(){return this.ba},function(a){f&&t.tb(a,S,S,"type");t.J(this,a);this.ba=a;this.Xa=!0});t.g(S,"endX",S.prototype.D);
t.defineProperty(S,{D:"endX"},function(){return this.ve},function(a){f&&t.o(a,S,"endX");t.J(this,a);this.ve=a;this.Xa=!0});t.g(S,"endY",S.prototype.F);t.defineProperty(S,{F:"endY"},function(){return this.we},function(a){f&&t.o(a,S,"endY");t.J(this,a);this.we=a;this.Xa=!0});t.defineProperty(S,{vb:"point1X"},function(){return this.Og},function(a){f&&t.o(a,S,"point1X");t.J(this,a);this.Og=a;this.Xa=!0});
t.defineProperty(S,{Lb:"point1Y"},function(){return this.Pg},function(a){f&&t.o(a,S,"point1Y");t.J(this,a);this.Pg=a;this.Xa=!0});t.defineProperty(S,{oe:"point2X"},function(){return this.Tk},function(a){f&&t.o(a,S,"point2X");t.J(this,a);this.Tk=a;this.Xa=!0});t.defineProperty(S,{pe:"point2Y"},function(){return this.Uk},function(a){f&&t.o(a,S,"point2Y");t.J(this,a);this.Uk=a;this.Xa=!0});
t.defineProperty(S,{Fa:"centerX"},function(){return this.rn},function(a){f&&t.o(a,S,"centerX");t.J(this,a);this.rn=a;this.Xa=!0});t.defineProperty(S,{Sa:"centerY"},function(){return this.sn},function(a){f&&t.o(a,S,"centerY");t.J(this,a);this.sn=a;this.Xa=!0});t.defineProperty(S,{radiusX:"radiusX"},function(){return this.Fj},function(a){f&&t.o(a,S,"radiusX");0>a&&t.ha(a,">= zero",S,"radiusX");t.J(this,a);this.Fj=a;this.Xa=!0});
t.defineProperty(S,{radiusY:"radiusY"},function(){return this.Gj},function(a){f&&t.o(a,S,"radiusY");0>a&&t.ha(a,">= zero",S,"radiusY");t.J(this,a);this.Gj=a;this.Xa=!0});t.defineProperty(S,{yg:"startAngle"},function(){return this.xe},function(a){this.xe!==a&&(t.J(this,a),f&&t.o(a,S,"startAngle"),a%=360,0>a&&(a+=360),this.xe=a,this.Xa=!0)});
t.defineProperty(S,{Sh:"sweepAngle"},function(){return this.ye},function(a){f&&t.o(a,S,"sweepAngle");t.J(this,a);360<a&&(a=360);-360>a&&(a=-360);this.ye=a;this.Xa=!0});t.defineProperty(S,{pw:"isClockwiseArc"},function(){return!!this.ye},function(a){t.J(this,a);this.ye=a?1:0;this.Xa=!0});t.defineProperty(S,{sw:"isLargeArc"},function(){return!!this.xe},function(a){t.J(this,a);this.xe=a?1:0;this.Xa=!0});
t.defineProperty(S,{Ww:"xAxisRotation"},function(){return this.to},function(a){f&&t.o(a,S,"xAxisRotation");a%=360;0>a&&(a+=360);t.J(this,a);this.to=a;this.Xa=!0});function ud(){this.ea=null;this.sz=(new C(0,0)).freeze();this.Yx=(new C(0,0)).freeze();this.Yt=this.Nu=0;this.Bu="";this.yv=this.lu=!1;this.iu=this.$t=0;this.ej=this.su=!1;this.zq=null;this.wv=0;this.eg=this.uv=null}t.ia("InputEvent",ud);
ud.prototype.copy=function(){var a=new ud;a.ea=this.ea;a.sz=this.Ac.copy().freeze();a.Yx=this.W.copy().freeze();a.Nu=this.Nu;a.Yt=this.Yt;a.Bu=this.Bu;a.lu=this.lu;a.yv=this.yv;a.$t=this.$t;a.iu=this.iu;a.su=this.su;a.ej=this.ej;a.zq=this.zq;a.wv=this.wv;a.uv=this.uv;a.eg=this.eg;return a};
ud.prototype.toString=function(){var a="^";this.Uc&&(a+="M:"+this.Uc);this.button&&(a+="B:"+this.button);this.key&&(a+="K:"+this.key);this.Be&&(a+="C:"+this.Be);this.Zj&&(a+="D:"+this.Zj);this.Fe&&(a+="h");this.bubbles&&(a+="b");null!==this.W&&(a+="@"+this.W.toString());return a};t.g(ud,"diagram",ud.prototype.h);t.defineProperty(ud,{h:"diagram"},function(){return this.ea},function(a){this.ea=a});t.g(ud,"viewPoint",ud.prototype.Ac);
t.defineProperty(ud,{Ac:"viewPoint"},function(){return this.sz},function(a){t.m(a,C,ud,"viewPoint");this.sz.assign(a)});t.g(ud,"documentPoint",ud.prototype.W);t.defineProperty(ud,{W:"documentPoint"},function(){return this.Yx},function(a){t.m(a,C,ud,"documentPoint");this.Yx.assign(a)});t.g(ud,"modifiers",ud.prototype.Uc);t.defineProperty(ud,{Uc:"modifiers"},function(){return this.Nu},function(a){this.Nu=a});t.g(ud,"button",ud.prototype.button);
t.defineProperty(ud,{button:"button"},function(){return this.Yt},function(a){this.Yt=a});t.g(ud,"key",ud.prototype.key);t.defineProperty(ud,{key:"key"},function(){return this.Bu},function(a){this.Bu=a});t.g(ud,"down",ud.prototype.ak);t.defineProperty(ud,{ak:"down"},function(){return this.lu},function(a){this.lu=a});t.g(ud,"up",ud.prototype.bj);t.defineProperty(ud,{bj:"up"},function(){return this.yv},function(a){this.yv=a});t.g(ud,"clickCount",ud.prototype.Be);
t.defineProperty(ud,{Be:"clickCount"},function(){return this.$t},function(a){this.$t=a});t.g(ud,"delta",ud.prototype.Zj);t.defineProperty(ud,{Zj:"delta"},function(){return this.iu},function(a){this.iu=a});t.g(ud,"handled",ud.prototype.Fe);t.defineProperty(ud,{Fe:"handled"},function(){return this.su},function(a){this.su=a});t.g(ud,"bubbles",ud.prototype.bubbles);t.defineProperty(ud,{bubbles:"bubbles"},function(){return this.ej},function(a){this.ej=a});t.g(ud,"event",ud.prototype.event);
t.defineProperty(ud,{event:"event"},function(){return this.zq},function(a){this.zq=a});t.A(ud,{vw:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a});t.g(ud,"timestamp",ud.prototype.timestamp);t.defineProperty(ud,{timestamp:"timestamp"},function(){return this.wv},function(a){this.wv=a});t.g(ud,"targetDiagram",ud.prototype.zg);t.defineProperty(ud,{zg:"targetDiagram"},function(){return this.uv},function(a){this.uv=a});t.g(ud,"targetObject",ud.prototype.Yd);
t.defineProperty(ud,{Yd:"targetObject"},function(){return this.eg},function(a){this.eg=a});t.g(ud,"control",ud.prototype.control);t.defineProperty(ud,{control:"control"},function(){return 0!==(this.Uc&1)},function(a){this.Uc=a?this.Uc|1:this.Uc&-2});t.g(ud,"shift",ud.prototype.shift);t.defineProperty(ud,{shift:"shift"},function(){return 0!==(this.Uc&4)},function(a){this.Uc=a?this.Uc|4:this.Uc&-5});t.g(ud,"alt",ud.prototype.alt);
t.defineProperty(ud,{alt:"alt"},function(){return 0!==(this.Uc&2)},function(a){this.Uc=a?this.Uc|2:this.Uc&-3});t.g(ud,"meta",ud.prototype.Wm);t.defineProperty(ud,{Wm:"meta"},function(){return 0!==(this.Uc&8)},function(a){this.Uc=a?this.Uc|8:this.Uc&-9});t.g(ud,"left",ud.prototype.left);t.defineProperty(ud,{left:"left"},function(){return 0===this.button},function(a){this.button=a?0:2});t.g(ud,"middle",ud.prototype.EI);
t.defineProperty(ud,{EI:"middle"},function(){return 1===this.button},function(a){this.button=a?1:0});t.g(ud,"right",ud.prototype.right);t.defineProperty(ud,{right:"right"},function(){return 2===this.button},function(a){this.button=a?2:0});function zd(){this.ea=null;this.Rb="";this.$u=this.qv=null;this.Zt=!1}t.ia("DiagramEvent",zd);zd.prototype.copy=function(){var a=new zd;a.ea=this.ea;a.Rb=this.Rb;a.qv=this.qv;a.$u=this.$u;a.Zt=this.Zt;return a};
zd.prototype.toString=function(){var a="*"+this.name;this.cancel&&(a+="x");null!==this.Sw&&(a+=":"+this.Sw.toString());null!==this.Fw&&(a+="("+this.Fw.toString()+")");return a};t.g(zd,"diagram",zd.prototype.h);t.defineProperty(zd,{h:"diagram"},function(){return this.ea},function(a){this.ea=a});t.g(zd,"name",zd.prototype.name);t.defineProperty(zd,{name:"name"},function(){return this.Rb},function(a){this.Rb=a});t.g(zd,"subject",zd.prototype.Sw);
t.defineProperty(zd,{Sw:"subject"},function(){return this.qv},function(a){this.qv=a});t.g(zd,"parameter",zd.prototype.Fw);t.defineProperty(zd,{Fw:"parameter"},function(){return this.$u},function(a){this.$u=a});t.g(zd,"cancel",zd.prototype.cancel);t.defineProperty(zd,{cancel:"cancel"},function(){return this.Zt},function(a){this.Zt=a});function Ad(){this.clear()}t.ia("ChangedEvent",Ad);var Bd;Ad.Transaction=Bd=t.w(Ad,"Transaction",-1);var Cd;Ad.Property=Cd=t.w(Ad,"Property",0);var Dd;
Ad.Insert=Dd=t.w(Ad,"Insert",1);var Md;Ad.Remove=Md=t.w(Ad,"Remove",2);Ad.prototype.clear=Ad.prototype.clear=function(){this.fq=Cd;this.gm=this.Mu="";this.Qu=this.Ru=this.Xu=this.bo=this.Wu=this.ea=this.Md=null};
Ad.prototype.copy=function(){var a=new Ad;a.Md=this.Md;a.ea=this.ea;a.fq=this.fq;a.Mu=this.Mu;a.gm=this.gm;a.Wu=this.Wu;var b=this.bo;a.bo=t.pb(b)&&"function"===typeof b.Z?b.Z():b;b=this.Xu;a.Xu=t.pb(b)&&"function"===typeof b.Z?b.Z():b;b=this.Ru;a.Ru=t.pb(b)&&"function"===typeof b.Z?b.Z():b;b=this.Qu;a.Qu=t.pb(b)&&"function"===typeof b.Z?b.Z():b;return a};
Ad.prototype.toString=function(){var a="",a=this.od===Bd?a+"* ":this.od===Cd?a+(null!==this.fa?"!m":"!d"):a+((null!==this.fa?"!m":"!d")+this.od);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.rf&&this.rf!==this.propertyName&&(a+=" "+this.rf);a+=": ";this.od===Bd?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=la(this.object)),null!==this.oldValue&&(a+="  old: "+la(this.oldValue)),null!==this.Mf&&(a+=" "+this.Mf),null!==this.newValue&&
(a+="  new: "+la(this.newValue)),null!==this.Kf&&(a+=" "+this.Kf));return a};Ad.prototype.getValue=Ad.prototype.Ba=function(a){return a?this.oldValue:this.newValue};Ad.prototype.getParam=function(a){return a?this.Mf:this.Kf};Ad.prototype.canUndo=Ad.prototype.canUndo=function(){return null!==this.fa||null!==this.h?!0:!1};Ad.prototype.undo=Ad.prototype.undo=function(){this.canUndo()&&(null!==this.fa?this.fa.changeState(this,!0):null!==this.h&&this.h.changeState(this,!0))};
Ad.prototype.canRedo=Ad.prototype.canRedo=function(){return null!==this.fa||null!==this.h?!0:!1};Ad.prototype.redo=Ad.prototype.redo=function(){this.canRedo()&&(null!==this.fa?this.fa.changeState(this,!1):null!==this.h&&this.h.changeState(this,!1))};t.g(Ad,"model",Ad.prototype.fa);t.defineProperty(Ad,{fa:"model"},function(){return this.Md},function(a){this.Md=a});t.g(Ad,"diagram",Ad.prototype.h);t.defineProperty(Ad,{h:"diagram"},function(){return this.ea},function(a){this.ea=a});t.g(Ad,"change",Ad.prototype.od);
t.defineProperty(Ad,{od:"change"},function(){return this.fq},function(a){f&&t.tb(a,Ad,Ad,"change");this.fq=a});t.g(Ad,"modelChange",Ad.prototype.rf);t.defineProperty(Ad,{rf:"modelChange"},function(){return this.Mu},function(a){f&&t.j(a,"string",Ad,"modelChange");this.Mu=a});t.g(Ad,"propertyName",Ad.prototype.propertyName);t.defineProperty(Ad,{propertyName:"propertyName"},function(){return this.gm},function(a){f&&"string"!==typeof a&&t.m(a,Function,Ad,"propertyName");this.gm=a});
t.g(Ad,"isTransactionFinished",Ad.prototype.rI);t.A(Ad,{rI:"isTransactionFinished"},function(){return this.fq===Bd&&("CommittedTransaction"===this.gm||"FinishedUndo"===this.gm||"FinishedRedo"===this.gm)});t.g(Ad,"object",Ad.prototype.object);t.defineProperty(Ad,{object:"object"},function(){return this.Wu},function(a){this.Wu=a});t.g(Ad,"oldValue",Ad.prototype.oldValue);t.defineProperty(Ad,{oldValue:"oldValue"},function(){return this.bo},function(a){this.bo=a});t.g(Ad,"oldParam",Ad.prototype.Mf);
t.defineProperty(Ad,{Mf:"oldParam"},function(){return this.Xu},function(a){this.Xu=a});t.g(Ad,"newValue",Ad.prototype.newValue);t.defineProperty(Ad,{newValue:"newValue"},function(){return this.Ru},function(a){this.Ru=a});t.g(Ad,"newParam",Ad.prototype.Kf);t.defineProperty(Ad,{Kf:"newParam"},function(){return this.Qu},function(a){this.Qu=a});
function I(a){1<arguments.length&&t.l("Model constructor can only take one optional argument, the Array of node data.");t.zc(this);this.Sx=this.Rb="";this.Mk=this.nC=!1;this.Hy={};this.Ke=[];this.uc=new sa(null,Object);this.cm="key";this.du=this.Fu=null;this.tr="category";this.Uf=new sa(null,ua);this.yj=null;this.vi=!1;this.rz=null;this.Aa=new Nd;void 0!==a&&(this.sg=a)}t.ia("Model",I);
I.prototype.clear=I.prototype.clear=function(){this.Vd&&t.Sm(this.Ke,"nodeDataArray",this,!0);this.Ke=[];this.uc.clear();this.Uf.clear();this.Aa.clear()};aa=I.prototype;
aa.Gt=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Hm&&(a+=',\n  "dataFormat": '+this.quote(this.Hm));this.$a&&(a+=',\n  "isReadOnly": '+this.$a);"key"!==this.Yi&&"string"===typeof this.Yi&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.Yi));"category"!==this.ql&&"string"===typeof this.ql&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.ql));return a};
aa.sB=function(){var a="",b=this.tA,c=!1,d;for(d in b)if(!Od(d,b[d])){c=!0;break}c&&(a=',\n  "modelData": '+Pd(this,b));return a+',\n  "nodeDataArray": '+Qd(this,this.sg,!0)};aa.nt=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Hm=a.dataFormat);a.isReadOnly&&(this.$a=a.isReadOnly);a.nodeKeyProperty&&(this.Yi=a.nodeKeyProperty);a.nodeCategoryProperty&&(this.ql=a.nodeCategoryProperty)};
aa.KA=function(a){var b=a.modelData;b&&(Rd(this,b),this.tA=b);if(a=a.nodeDataArray)Rd(this,a),this.sg=a};aa.toString=function(a){void 0===a&&(a=0);if(1<a)return this.jB();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.sg;var c=t.yb(a),d;for(d=0;d<c;d++)var e=t.sb(a,d),b=b+(" "+this.Nb(e)+":"+la(e))}return b};
I.prototype.toJson=I.prototype.jB=function(a){void 0===a&&(a=this.constructor===I?"go.Model":this.constructor===U?"go.GraphLinksModel":this.constructor===Sd?"go.TreeModel":t.Tg(this));return'{ "class": '+this.quote(a)+this.Gt()+this.sB()+"}"};
I.fromJson=function(a,b){void 0===b&&(b=null);b&&t.m(b,I,I,"fromJson:model");var c=null;if("string"===typeof a)if(window&&window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){f&&t.trace("JSON.parse error: "+d.toString())}else t.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:t.l("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var g=c["class"];if("string"===typeof g)try{var h=null;0===g.indexOf("go.")?(g=g.substr(3),h=ba[g]):(h=ba[g])||(h=window[g]);
"function"===typeof h&&(e=new h)}catch(k){}null===e||e instanceof I?b=e:t.l("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new U);b.nt(c);b.KA(c);return b};
function Rd(a,b){if(t.isArray(b))for(var c=t.yb(b),d=0;d<c;d++){var e=t.sb(b,d);t.pb(e)&&t.hD(b,d,Rd(a,e))}else if(t.pb(b)){for(d in b)if(e=b[d],t.pb(e)&&(e=Rd(a,e),b[d]=e,"points"===d&&Array.isArray(e))){for(var g=!0,h=0;h<e.length;h++)if("number"!==typeof e[h]){g=!1;break}if(g){g=new H(C);for(h=0;h<e.length/2;h++){var k=new C(e[2*h],e[2*h+1]);g.add(k)}g.freeze();b[d]=g}}if("object"!==typeof b)c=b;else{d=b;e=b["class"];if("NaN"===e)d=NaN;else if("Date"===e)d=new Date(b.value);else if("go.Point"===
e)d=new C(Td(b.x),Td(b.y));else if("go.Size"===e)d=new pa(Td(b.width),Td(b.height));else if("go.Rect"===e)d=new D(Td(b.x),Td(b.y),Td(b.width),Td(b.height));else if("go.Margin"===e)d=new sb(Td(b.top),Td(b.right),Td(b.bottom),Td(b.left));else if("go.Spot"===e)d="string"===typeof b["enum"]?Ob(b["enum"]):new K(Td(b.x),Td(b.y),Td(b.offsetX),Td(b.offsetY));else if("go.Brush"===e){if(d=new fe,d.type=t.Km(fe,b.type),b.start instanceof K&&(d.start=b.start),b.end instanceof K&&(d.end=b.end),"number"===typeof b.startRadius&&
(d.Ip=Td(b.startRadius)),"number"===typeof b.endRadius&&(d.Lo=Td(b.endRadius)),e=b.colorStops)for(c in e)d.addColorStop(parseFloat(c),e[c])}else"go.Geometry"===e&&(d="string"===typeof b.path?$c(b.path):new M,d.type=t.Km(M,b.type),"number"===typeof b.startX&&(d.na=Td(b.startX)),"number"===typeof b.startY&&(d.oa=Td(b.startY)),"number"===typeof b.endX&&(d.D=Td(b.endX)),"number"===typeof b.endY&&(d.F=Td(b.endY)),b.spot1 instanceof K&&(d.G=b.spot1),b.spot2 instanceof K&&(d.H=b.spot2));c=d}return c}return b}
I.prototype.quote=function(a){for(var b="",c=a.length,d=0;d<c;d++)var e=a[d],b='"'===e||"\\"===e?b+("\\"+e):"\b"===e?b+"\\b":"\f"===e?b+"\\f":"\n"===e?b+"\\n":"\r"===e?b+"\\r":"\t"===e?b+"\\t":b+e;return'"'+b+'"'};
I.prototype.writeJsonValue=I.prototype.Ht=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.Ht(a.valueOf()):t.isArray(a)?Qd(this,a):t.pb(a)?Pd(this,a):"function"===typeof a?"null":a.toString()};
function Qd(a,b,c){var d=t.yb(b),e="[ ";c&&1<d&&(e+="\n");for(var g=0;g<d;g++){var h=t.sb(b,g);void 0!==h&&(0<g&&(e+=",",c&&(e+="\n")),e+=a.Ht(h))}c&&1<d&&(e+="\n");return e+" ]"}function Od(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function ge(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
function Pd(a,b){var c=b;if(c instanceof C)b={"class":"go.Point",x:ge(c.x),y:ge(c.y)};else if(c instanceof pa)b={"class":"go.Size",width:ge(c.width),height:ge(c.height)};else if(c instanceof D)b={"class":"go.Rect",x:ge(c.x),y:ge(c.y),width:ge(c.width),height:ge(c.height)};else if(c instanceof sb)b={"class":"go.Margin",top:ge(c.top),right:ge(c.right),bottom:ge(c.bottom),left:ge(c.left)};else if(c instanceof K)b=c.rd()?{"class":"go.Spot",x:ge(c.x),y:ge(c.y),offsetX:ge(c.offsetX),offsetY:ge(c.offsetY)}:
{"class":"go.Spot","enum":c.toString()};else if(c instanceof fe){b={"class":"go.Brush",type:c.type.name};if(c.type===he)b.color=c.color;else if(c.type===ie||c.type===je)b.start=c.start,b.end=c.end,c.type===je&&(0!==c.Ip&&(b.startRadius=ge(c.Ip)),isNaN(c.Lo)||(b.endRadius=ge(c.Lo)));if(null!==c.Fo){for(var d={},c=c.Fo.k;c.next();)d[c.key.toString()]=c.value;b.colorStops=d}}else if(c instanceof M)b={"class":"go.Geometry",type:c.type.name},0!==c.na&&(b.startX=ge(c.na)),0!==c.oa&&(b.startY=ge(c.oa)),
0!==c.D&&(b.endX=ge(c.D)),0!==c.F&&(b.endY=ge(c.F)),c.G.N(Sb)||(b.spot1=c.G),c.H.N($b)||(b.spot2=c.H),c.type===Lc&&(b.path=Yc(c));else if(c instanceof X||c instanceof u||c instanceof ke||c instanceof I||c instanceof le||c instanceof wa||c instanceof ue||c instanceof Ba||c instanceof Nd||c instanceof ve)return t.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+c.toString()),"{}";var d="{",e=!0,g;for(g in b)if(c=t.hb(b,g),!Od(g,c))if(e?
e=!1:d+=", ",d+='"'+g+'":',"points"===g&&c instanceof H&&c.ba===C){for(var h="[",c=c.k;c.next();){var k=c.value;1<h.length&&(h+=",");h+=a.Ht(k.x);h+=",";h+=a.Ht(k.y)}h+="]";d+=h}else d+=a.Ht(c);return d+"}"}function Td(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}t.g(I,"name",I.prototype.name);t.defineProperty(I,{name:"name"},function(){return this.Rb},function(a){var b=this.Rb;b!==a&&(t.j(a,"string",I,"name"),this.Rb=a,this.i("name",b,a))});
t.g(I,"dataFormat",I.prototype.Hm);t.defineProperty(I,{Hm:"dataFormat"},function(){return this.Sx},function(a){var b=this.Sx;b!==a&&(t.j(a,"string",I,"dataFormat"),this.Sx=a,this.i("dataFormat",b,a))});t.g(I,"knockoutJS",I.prototype.Vd);t.defineProperty(I,{Vd:"knockoutJS"},function(){return this.nC},function(a){this.nC=a;t.qc||(t.qc="object"===typeof window.ko&&"function"===typeof window.ko.isObservable?window.ko.isObservable:null,a&&null===t.qc&&t.trace("No value for ko.isObservable: is KnockoutJS library not loaded?"))});
t.g(I,"isReadOnly",I.prototype.$a);t.defineProperty(I,{$a:"isReadOnly"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(t.j(a,"boolean",I,"isReadOnly"),this.Mk=a,this.i("isReadOnly",b,a))});t.g(I,"modelData",I.prototype.tA);t.defineProperty(I,{tA:"modelData"},function(){return this.Hy},function(a){var b=this.Hy;b!==a&&(t.j(a,"object",I,"modelData"),this.Hy=a,this.i("modelData",b,a))});
I.prototype.addChangedListener=I.prototype.zz=function(a){t.j(a,"function",I,"addChangedListener:listener");null===this.yj&&(this.yj=new H("function"));this.yj.add(a)};I.prototype.removeChangedListener=I.prototype.NA=function(a){t.j(a,"function",I,"removeChangedListener:listener");null!==this.yj&&(this.yj.remove(a),0===this.yj.count&&(this.yj=null))};
I.prototype.Nv=function(a){this.Bb||this.Aa.lE(a);if(null!==this.yj){var b=this.yj,c=b.length;if(1===c)b=b.qa(0),b(a);else if(0!==c)for(var d=b.af(),e=0;e<c;e++)b=d[e],b(a)}};I.prototype.raiseChangedEvent=I.prototype.Vc=function(a,b,c,d,e,g,h){we(this,"",a,b,c,d,e,g,h)};I.prototype.raiseChanged=I.prototype.i=function(a,b,c,d,e){we(this,"",Cd,a,this,b,c,d,e)};I.prototype.raiseDataChanged=I.prototype.Hw=function(a,b,c,d,e,g){we(this,"",Cd,b,a,c,d,e,g)};
function we(a,b,c,d,e,g,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Ad;m.fa=a;m.od=c;m.rf=b;m.propertyName=d;m.object=e;m.oldValue=g;m.Mf=k;m.newValue=h;m.Kf=l;a.Nv(m)}t.g(I,"undoManager",I.prototype.Aa);t.defineProperty(I,{Aa:"undoManager"},function(){return this.rz},function(a){var b=this.rz;b!==a&&(t.m(a,Nd,I,"undoManager"),null!==b&&b.XI(this),this.rz=a,null!==a&&a.PG(this))});t.g(I,"skipsUndoManager",I.prototype.Bb);
t.defineProperty(I,{Bb:"skipsUndoManager"},function(){return this.vi},function(a){t.j(a,"boolean",I,"skipsUndoManager");this.vi=a});
I.prototype.changeState=function(a,b){if(null!==a&&a.fa===this)if(a.od===Cd){var c=a.object,d=a.propertyName,e=a.Ba(b);t.Ta(c,d,e)}else a.od===Dd?"nodeDataArray"===a.rf?(c=a.newValue,t.pb(c)&&(d=this.Nb(c),void 0!==d&&(b?(this.Vd&&t.pf(c,this,!0),t.Fi(this.Ke,a.Kf),this.uc.remove(d)):(this.Vd&&t.pf(c,this,!1),t.Ei(this.Ke,a.Kf,c),this.uc.add(d,c))))):""===a.rf?(c=a.object,!t.isArray(c)&&a.propertyName&&(c=t.hb(a.object,a.propertyName)),t.isArray(c)&&(d=a.newValue,e=a.Kf,b?t.Fi(c,e):t.Ei(c,e,d))):
t.l("unknown ChangedEvent.Insert object: "+a.toString()):a.od===Md?"nodeDataArray"===a.rf?(c=a.oldValue,t.pb(c)&&(d=this.Nb(c),void 0!==d&&(b?(this.Vd&&t.pf(c,this,!1),t.Ei(this.Ke,a.Mf,c),this.uc.add(d,c)):(this.Vd&&t.pf(c,this,!0),t.Fi(this.Ke,a.Mf),this.uc.remove(d))))):""===a.rf?(c=a.object,!t.isArray(c)&&a.propertyName&&(c=t.hb(a.object,a.propertyName)),t.isArray(c)&&(d=a.oldValue,e=a.Mf,b?t.Ei(c,e,d):t.Fi(c,e))):t.l("unknown ChangedEvent.Remove object: "+a.toString()):a.od!==Bd&&t.l("unknown ChangedEvent: "+
a.toString())};I.prototype.startTransaction=I.prototype.rc=function(a){return this.Aa.rc(a)};I.prototype.commitTransaction=I.prototype.De=function(a){return this.Aa.De(a)};I.prototype.rollbackTransaction=I.prototype.rt=function(){return this.Aa.rt()};I.prototype.updateTargetBindings=I.prototype.Jb=function(a,b){void 0===b&&(b="");we(this,"SourceChanged",Bd,b,a,null,null)};t.g(I,"nodeKeyProperty",I.prototype.Yi);
t.defineProperty(I,{Yi:"nodeKeyProperty"},function(){return this.cm},function(a){var b=this.cm;b!==a&&(xe(a,I,"nodeKeyProperty"),0<this.uc.count&&t.l("Cannot set Model.nodeKeyProperty when there is existing node data"),this.cm=a,this.i("nodeKeyProperty",b,a))});function xe(a,b,c){"string"!==typeof a&&"function"!==typeof a&&t.Vb(a,"string or function",b,c)}
I.prototype.getKeyForNodeData=I.prototype.Nb=function(a){if(null!==a){var b=this.cm;if(""!==b&&(b=t.hb(a,b),void 0!==b)){if(ye(b))return b;t.l("Key value for node data "+a+" is not a number or a string: "+b)}}};
I.prototype.setKeyForNodeData=I.prototype.aB=function(a,b){null===b&&(b=void 0);void 0===b||ye(b)||t.Vb(b,"number or string",I,"setKeyForNodeData:key");if(null!==a){var c=this.cm;if(""!==c)if(this.ie(a)){var d=t.hb(a,c);d!==b&&null===this.mf(b)&&(t.Ta(a,c,b),this.uc.remove(d),this.uc.add(b,a),we(this,"nodeKey",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c),this.pt(d,b))}else t.Ta(a,c,b)}};t.g(I,"makeUniqueKeyFunction",I.prototype.CI);
t.defineProperty(I,{CI:"makeUniqueKeyFunction"},function(){return this.Fu},function(a){var b=this.Fu;b!==a&&(null!==a&&t.j(a,"function",I,"makeUniqueKeyFunction"),this.Fu=a,this.i("makeUniqueKeyFunction",b,a))});function ye(a){return"number"===typeof a||"string"===typeof a}I.prototype.containsNodeData=I.prototype.ie=function(a){a=this.Nb(a);return void 0===a?!1:this.uc.contains(a)};
I.prototype.findNodeDataForKey=I.prototype.mf=function(a){null===a&&t.l("Model.findNodeDataForKey:key must not be null");return void 0!==a&&ye(a)?this.uc.Ba(a):null};t.g(I,"nodeDataArray",I.prototype.sg);
t.defineProperty(I,{sg:"nodeDataArray"},function(){return this.Ke},function(a){var b=this.Ke;if(b!==a){t.xs(a,I,"nodeDataArray");this.Vd&&t.qc&&(null!==b&&t.Sm(b,"nodeDataArray",this,!0),a=t.Sm(a,"nodeDataArray",this,!1));this.uc.clear();this.oB();for(var c=t.yb(a),d=0;d<c;d++){var e=t.sb(a,d);if(!t.pb(e)){t.l("Model.nodeDataArray must only contain Objects, not: "+e);return}t.Os(e)}this.Ke=a;for(var g=new H(Object),d=0;d<c;d++){var e=t.sb(a,d),h=this.Nb(e);void 0===h?g.add(e):null!==this.uc.Ba(h)?
g.add(e):this.uc.add(h,e)}for(d=g.k;d.next();)e=d.value,this.ME(e),g=this.Nb(e),this.uc.add(g,e);we(this,"nodeDataArray",Cd,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=t.sb(a,d),this.zp(e),this.yp(e);this.oD();t.oI(a)||(this.$a=!0)}});
I.prototype.makeNodeDataKeyUnique=I.prototype.ME=function(a){if(null!==a){var b=this.cm;if(""!==b){var c=this.Nb(a);if(void 0===c||this.uc.contains(c)){var d=this.Fu;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.uc.contains(c))){t.Ta(a,b,c);return}if("string"===typeof c){for(d=2;this.uc.contains(c+d);)d++;t.Ta(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.uc.count-1;this.uc.contains(d);)d--;t.Ta(a,b,d)}else t.l("Model.getKeyForNodeData returned something other than a string or a number: "+
c)}}}};I.prototype.addNodeData=I.prototype.um=function(a){if(null!==a){this.Vd&&t.pf(a,this,!1);t.Os(a);var b=this.Nb(a);if(void 0===b||this.uc.Ba(b)!==a)this.ME(a),b=this.Nb(a),this.uc.add(b,a),b=t.yb(this.Ke),t.Ei(this.Ke,b,a),we(this,"nodeDataArray",Dd,"nodeDataArray",this,null,a,null,b),this.zp(a),this.yp(a)}};I.prototype.addNodeDataCollection=function(a){if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.um(t.sb(a,c));else for(a=a.k;a.next();)this.um(a.value)};
I.prototype.removeNodeData=I.prototype.Iw=function(a){if(null!==a){var b=this.Nb(a);void 0!==b&&this.uc.contains(b)&&(this.Vd&&t.pf(a,this,!0),this.uc.remove(b),b=t.Gz(this.Ke,a),0>b||(t.Fi(this.Ke,b),we(this,"nodeDataArray",Md,"nodeDataArray",this,a,null,b,null),this.Ft(a)))}};I.prototype.removeNodeDataCollection=function(a){if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.Iw(t.sb(a,c));else for(a=a.k;a.next();)this.Iw(a.value)};aa=I.prototype;
aa.pt=function(a,b){var c=ze(this,a);c instanceof ua&&this.Uf.add(b,c)};aa.oB=function(){};aa.zp=function(){};aa.yp=function(){};aa.Ft=function(){};function Ae(a,b,c){if(void 0!==b){var d=a.Uf.Ba(b);null===d&&(d=new ua,a.Uf.add(b,d));d.add(c)}}function Be(a,b,c){if(void 0!==b){var d=a.Uf.Ba(b);d instanceof ua&&(void 0===c||null===c?a.Uf.remove(b):(d.remove(c),0===d.count&&a.Uf.remove(b)))}}function ze(a,b){if(void 0===b)return null;var c=a.Uf.Ba(b);return c instanceof ua?c:null}
I.prototype.clearUnresolvedReferences=I.prototype.oD=function(a){void 0===a?this.Uf.clear():this.Uf.remove(a)};t.g(I,"copyNodeDataFunction",I.prototype.sH);t.defineProperty(I,{sH:"copyNodeDataFunction"},function(){return this.du},function(a){var b=this.du;b!==a&&(null!==a&&t.j(a,"function",I,"copyNodeDataFunction"),this.du=a,this.i("copyNodeDataFunction",b,a))});
I.prototype.copyNodeData=I.prototype.Xj=function(a){if(null===a)return null;var b=null,b=this.du;if(null!==b)b=b(a,this);else{var b=new a.constructor,c;for(c in a)t.Ta(b,c,t.hb(a,c));this.Vd&&t.pf(b,this,!1)}b&&t.zc(b);return b};
I.prototype.setDataProperty=I.prototype.Ow=function(a,b,c){f&&(t.j(a,"object",I,"setDataProperty:data"),t.j(b,"string",I,"setDataProperty:propname"),""===b&&t.l("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.ie(a))if(b===this.Yi)this.aB(a,c);else{if(b===this.ql){this.Mw(a,c);return}}else!t.Mp&&a instanceof X&&(t.Mp=!0,t.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),t.trace("  Is that really your intent?"));var d=
t.hb(a,b);d!==c&&(t.Ta(a,b,c),this.Hw(a,b,d,c))};I.prototype.addArrayItem=function(a,b){this.kI(a,-1,b)};I.prototype.insertArrayItem=I.prototype.kI=function(a,b,c){f&&(t.xs(a,I,"insertArrayItem:arr"),t.o(b,I,"insertArrayItem:idx"));a===this.Ke&&t.l("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=t.yb(a));t.Ei(a,b,c);we(this,"",Dd,"",a,null,c,null,b)};
I.prototype.removeArrayItem=function(a,b){void 0===b&&(b=-1);f&&(t.xs(a,I,"removeArrayItem:arr"),t.o(b,I,"removeArrayItem:idx"));a===this.Ke&&t.l("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=t.yb(a)-1);var c=t.sb(a,b);t.Fi(a,b);we(this,"",Md,"",a,c,null,b,null)};t.g(I,"nodeCategoryProperty",I.prototype.ql);
t.defineProperty(I,{ql:"nodeCategoryProperty"},function(){return this.tr},function(a){var b=this.tr;b!==a&&(xe(a,I,"nodeCategoryProperty"),this.tr=a,this.i("nodeCategoryProperty",b,a))});I.prototype.getCategoryForNodeData=I.prototype.getCategoryForNodeData=function(a){if(null===a)return"";var b=this.tr;if(""===b)return"";b=t.hb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;t.l("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
I.prototype.setCategoryForNodeData=I.prototype.Mw=function(a,b){t.j(b,"string",I,"setCategoryForNodeData:cat");if(null!==a){var c=this.tr;if(""!==c)if(this.ie(a)){var d=t.hb(a,c);void 0===d&&(d="");d!==b&&(t.Ta(a,c,b),we(this,"nodeCategory",Cd,c,a,d,b))}else t.Ta(a,c,b)}};
function U(a,b){2<arguments.length&&t.l("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");I.call(this);this.Lg=[];this.Yl=new ua(Object);this.cj=this.cu=null;this.uj="from";this.xj="to";this.br=this.ar="";this.Yq="category";this.uh=this.Tu="";this.Su="isGroup";this.Dj="group";this.Nx=!1;void 0!==a&&(this.sg=a);void 0!==b&&(this.Vi=b)}t.ia("GraphLinksModel",U);t.Oa(U,I);
U.prototype.clear=U.prototype.clear=function(){I.prototype.clear.call(this);this.Vd&&t.Sm(this.Lg,"linkDataArray",this,!0);this.Lg=[];this.Yl.clear()};aa=U.prototype;aa.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.jB();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.sg;var c=t.yb(a),d;for(d=0;d<c;d++)var e=t.sb(a,d),b=b+(" "+this.Nb(e)+":"+la(e));b+="\n link data:";a=this.Vi;c=t.yb(a);for(d=0;d<c;d++)e=t.sb(a,d),b+=" "+this.Nm(e)+"--\x3e"+this.Om(e)}return b};
aa.Gt=function(){var a=I.prototype.Gt.call(this),b="";"category"!==this.fp&&"string"===typeof this.fp&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.fp));"from"!==this.gp&&"string"===typeof this.gp&&(b+=',\n "linkFromKeyProperty": '+this.quote(this.gp));"to"!==this.lp&&"string"===typeof this.lp&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.lp));""!==this.hp&&"string"===typeof this.hp&&(b+=',\n  "linkFromPortIdProperty": '+this.quote(this.hp));""!==this.mp&&"string"===typeof this.mp&&(b+=
',\n  "linkToPortIdProperty": '+this.quote(this.mp));""!==this.it&&"string"===typeof this.it&&(b+=',\n "nodeIsLinkLabelProperty": '+this.quote(this.it));""!==this.ip&&"string"===typeof this.ip&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.ip));"isGroup"!==this.up&&"string"===typeof this.up&&(b+=',\n "nodeIsGroupProperty": '+this.quote(this.up));"group"!==this.tp&&"string"===typeof this.tp&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.tp));return a+b};
aa.sB=function(){var a=I.prototype.sB.call(this),b=',\n  "linkDataArray": '+Qd(this,this.Vi,!0);return a+b};
aa.nt=function(a){I.prototype.nt.call(this,a);a.linkFromKeyProperty&&(this.gp=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.lp=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.hp=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.mp=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.fp=a.linkCategoryProperty);a.nodeIsLinkLabelProperty&&(this.it=a.nodeIsLinkLabelProperty);a.linkLabelKeysProperty&&(this.ip=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.up=a.nodeIsGroupProperty);
a.nodeGroupKeyProperty&&(this.tp=a.nodeGroupKeyProperty)};aa.KA=function(a){I.prototype.KA.call(this,a);if(a=a.linkDataArray)Rd(this,a),this.Vi=a};
U.prototype.changeState=function(a,b){if(a.od===Dd){var c=null;"linkDataArray"===a.rf?c=this.Lg:"linkLabelKeys"===a.rf&&(c=this.ll(a.object));if(t.isArray(c)){b?(this.Vd&&t.pb(a.newValue)&&t.pf(a.newValue,this,!0),t.Fi(c,a.Kf)):(this.Vd&&t.pb(a.newValue)&&t.pf(a.newValue,this,!1),t.Ei(c,a.Kf,a.newValue));return}}else if(a.od===Md&&(c=null,"linkDataArray"===a.rf?c=this.Lg:"linkLabelKeys"===a.rf&&(c=this.ll(a.object)),t.isArray(c))){b?(this.Vd&&t.pb(a.oldValue)&&t.pf(a.oldValue,this,!1),t.Ei(c,a.Mf,
a.oldValue)):(this.Vd&&t.pb(a.oldValue)&&t.pf(a.oldValue,this,!0),t.Fi(c,a.Mf));return}I.prototype.changeState.call(this,a,b)};t.g(U,"archetypeNodeData",U.prototype.us);t.defineProperty(U,{us:"archetypeNodeData"},function(){return this.cj},function(a){var b=this.cj;b!==a&&(null!==a&&t.m(a,Object,U,"archetypeNodeData"),this.cj=a,this.i("archetypeNodeData",b,a))});U.prototype.Vm=function(a){if(void 0!==a){var b=this.cj;if(null!==b){var c=this.mf(a);null===c&&(c=this.Xj(b),t.Ta(c,this.cm,a),this.um(c))}return a}};
t.g(U,"linkFromKeyProperty",U.prototype.gp);t.defineProperty(U,{gp:"linkFromKeyProperty"},function(){return this.uj},function(a){var b=this.uj;b!==a&&(xe(a,U,"linkFromKeyProperty"),this.uj=a,this.i("linkFromKeyProperty",b,a))});U.prototype.getFromKeyForLinkData=U.prototype.Nm=function(a){if(null!==a){var b=this.uj;if(""!==b&&(b=t.hb(a,b),void 0!==b)){if(ye(b))return b;t.l("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
U.prototype.setFromKeyForLinkData=U.prototype.YA=function(a,b){null===b&&(b=void 0);void 0===b||ye(b)||t.Vb(b,"number or string",U,"setFromKeyForLinkData:key");if(null!==a){var c=this.uj;if(""!==c)if(b=this.Vm(b),this.Ji(a)){var d=t.hb(a,c);d!==b&&(Be(this,d,a),t.Ta(a,c,b),null===this.mf(b)&&Ae(this,b,a),we(this,"linkFromKey",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};t.g(U,"linkToKeyProperty",U.prototype.lp);
t.defineProperty(U,{lp:"linkToKeyProperty"},function(){return this.xj},function(a){var b=this.xj;b!==a&&(xe(a,U,"linkToKeyProperty"),this.xj=a,this.i("linkToKeyProperty",b,a))});U.prototype.getToKeyForLinkData=U.prototype.Om=function(a){if(null!==a){var b=this.xj;if(""!==b&&(b=t.hb(a,b),void 0!==b)){if(ye(b))return b;t.l("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
U.prototype.setToKeyForLinkData=U.prototype.cB=function(a,b){null===b&&(b=void 0);void 0===b||ye(b)||t.Vb(b,"number or string",U,"setToKeyForLinkData:key");if(null!==a){var c=this.xj;if(""!==c)if(b=this.Vm(b),this.Ji(a)){var d=t.hb(a,c);d!==b&&(Be(this,d,a),t.Ta(a,c,b),null===this.mf(b)&&Ae(this,b,a),we(this,"linkToKey",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};t.g(U,"linkFromPortIdProperty",U.prototype.hp);
t.defineProperty(U,{hp:"linkFromPortIdProperty"},function(){return this.ar},function(a){var b=this.ar;b!==a&&(xe(a,U,"linkFromPortIdProperty"),this.ar=a,this.i("linkFromPortIdProperty",b,a))});U.prototype.getFromPortIdForLinkData=U.prototype.ZH=function(a){if(null===a)return"";var b=this.ar;if(""===b)return"";a=t.hb(a,b);return void 0===a?"":a};
U.prototype.setFromPortIdForLinkData=U.prototype.ZA=function(a,b){t.j(b,"string",U,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.ar;if(""!==c)if(this.Ji(a)){var d=t.hb(a,c);void 0===d&&(d="");d!==b&&(t.Ta(a,c,b),we(this,"linkFromPortId",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};t.g(U,"linkToPortIdProperty",U.prototype.mp);
t.defineProperty(U,{mp:"linkToPortIdProperty"},function(){return this.br},function(a){var b=this.br;b!==a&&(xe(a,U,"linkToPortIdProperty"),this.br=a,this.i("linkToPortIdProperty",b,a))});U.prototype.getToPortIdForLinkData=U.prototype.bI=function(a){if(null===a)return"";var b=this.br;if(""===b)return"";a=t.hb(a,b);return void 0===a?"":a};
U.prototype.setToPortIdForLinkData=U.prototype.dB=function(a,b){t.j(b,"string",U,"setToPortIdForLinkData:portname");if(null!==a){var c=this.br;if(""!==c)if(this.Ji(a)){var d=t.hb(a,c);void 0===d&&(d="");d!==b&&(t.Ta(a,c,b),we(this,"linkToPortId",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};t.g(U,"nodeIsLinkLabelProperty",U.prototype.it);
t.defineProperty(U,{it:"nodeIsLinkLabelProperty"},function(){return this.Tu},function(a){var b=this.Tu;b!==a&&(xe(a,U,"nodeIsLinkLabelProperty"),this.Tu=a,this.i("nodeIsLinkLabelProperty",b,a))});U.prototype.isLinkLabelForNodeData=U.prototype.nI=function(a){if(null===a)return!1;var b=this.Tu;return""===b?!1:t.hb(a,b)?!0:!1};t.g(U,"linkLabelKeysProperty",U.prototype.ip);
t.defineProperty(U,{ip:"linkLabelKeysProperty"},function(){return this.uh},function(a){var b=this.uh;b!==a&&(xe(a,U,"linkLabelKeysProperty"),this.uh=a,this.i("linkLabelKeysProperty",b,a))});U.prototype.getLabelKeysForLinkData=U.prototype.ll=function(a){if(null===a)return t.Wh;var b=this.uh;if(""===b)return t.Wh;a=t.hb(a,b);return void 0===a?t.Wh:a};
U.prototype.setLabelKeysForLinkData=U.prototype.yF=function(a,b){t.xs(b,U,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.uh;if(""!==c)if(this.Ji(a)){var d=t.hb(a,c);void 0===d&&(d=t.Wh);if(d!==b){for(var e=t.yb(d),g=0;g<e;g++){var h=t.sb(d,g);Be(this,h,a)}t.Ta(a,c,b);e=t.yb(b);for(g=0;g<e;g++)h=t.sb(b,g),null===this.mf(h)&&Ae(this,h,a);we(this,"linkLabelKeys",Cd,c,a,d,b);"string"===typeof c&&this.Jb(a,c)}}else t.Ta(a,c,b)}};
U.prototype.addLabelKeyForLinkData=U.prototype.cD=function(a,b){if(null!==b&&void 0!==b&&(ye(b)||t.Vb(b,"number or string",U,"addLabelKeyForLinkData:key"),null!==a)){var c=this.uh;if(""!==c){var d=t.hb(a,c);void 0===d?this.yF(a,[b]):t.isArray(d)?0<=t.Gz(d,b)||(t.Ei(d,Infinity,b),this.Ji(a)&&(null===this.mf(b)&&Ae(this,b,a),we(this,"linkLabelKeys",Dd,c,a,null,b))):t.l(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
U.prototype.removeLabelKeyForLinkData=U.prototype.WI=function(a,b){if(null!==b&&void 0!==b&&(ye(b)||t.Vb(b,"number or string",U,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.uh;if(""!==c){var d=t.hb(a,c);if(t.isArray(d)){var e=t.Gz(d,b);0>e||(t.Fi(d,e),this.Ji(a)&&(Be(this,b,a),we(this,"linkLabelKeys",Md,c,a,b,null)))}else void 0!==d&&t.l(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};t.g(U,"linkDataArray",U.prototype.Vi);
t.defineProperty(U,{Vi:"linkDataArray"},function(){return this.Lg},function(a){var b=this.Lg;if(b!==a){t.xs(a,U,"linkDataArray");this.Vd&&t.qc&&(null!==b&&t.Sm(b,"linkDataArray",this,!0),a=t.Sm(a,"linkDataArray",this,!1));for(var c=t.yb(a),d=0;d<c;d++){var e=t.sb(a,d);if(!t.pb(e)){t.l("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}t.Os(e)}this.Lg=a;for(var g=new ua(Object),d=0;d<c;d++)e=t.sb(a,d),g.add(e);this.Yl=g;we(this,"linkDataArray",Cd,"linkDataArray",this,b,a);for(d=
0;d<c;d++)e=t.sb(a,d),Ce(this,e)}});U.prototype.containsLinkData=U.prototype.Ji=function(a){return null===a?!1:this.Yl.contains(a)};U.prototype.addLinkData=U.prototype.Dv=function(a){if(null!==a){this.Vd&&t.pf(a,this,!1);if(void 0===t.oc(a))t.zc(a);else if(this.Ji(a))return;this.Yl.add(a);var b=t.yb(this.Lg);t.Ei(this.Lg,b,a);we(this,"linkDataArray",Dd,"linkDataArray",this,null,a,null,b);Ce(this,a)}};
U.prototype.addLinkDataCollection=function(a){if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.Dv(t.sb(a,c));else for(a=a.k;a.next();)this.Dv(a.value)};
U.prototype.removeLinkData=U.prototype.OA=function(a){if(null!==a){this.Vd&&t.pf(a,this,!0);this.Yl.remove(a);var b=this.Lg.indexOf(a);if(!(0>b)){t.Fi(this.Lg,b);we(this,"linkDataArray",Md,"linkDataArray",this,a,null,b,null);b=this.Nm(a);Be(this,b,a);b=this.Om(a);Be(this,b,a);var c=this.ll(a);if(t.isArray(c))for(var d=t.yb(c),e=0;e<d;e++)b=t.sb(c,e),Be(this,b,a)}}};U.prototype.removeLinkDataCollection=function(a){if(t.isArray(a))for(var b=t.yb(a),c=0;c<b;c++)this.OA(t.sb(a,c));else for(a=a.k;a.next();)this.OA(a.value)};
function Ce(a,b){var c=a.Nm(b),c=a.Vm(c);null===a.mf(c)&&Ae(a,c,b);c=a.Om(b);c=a.Vm(c);null===a.mf(c)&&Ae(a,c,b);var d=a.ll(b);if(t.isArray(d))for(var e=t.yb(d),g=0;g<e;g++)c=t.sb(d,g),null===a.mf(c)&&Ae(a,c,b)}t.g(U,"copyLinkDataFunction",U.prototype.rH);t.defineProperty(U,{rH:"copyLinkDataFunction"},function(){return this.cu},function(a){var b=this.cu;b!==a&&(null!==a&&t.j(a,"function",U,"copyLinkDataFunction"),this.cu=a,this.i("copyLinkDataFunction",b,a))});
U.prototype.copyLinkData=U.prototype.zD=function(a){if(null===a)return null;var b=null,b=this.cu;if(null!==b)b=b(a,this);else{var b=new a.constructor,c;for(c in a)t.Ta(b,c,t.hb(a,c));this.Vd&&t.pf(b,this,!1)}b&&(t.zc(b),""!==this.uj&&t.Ta(b,this.uj,void 0),""!==this.xj&&t.Ta(b,this.xj,void 0),""!==this.uh&&t.Ta(b,this.uh,[]));return b};t.g(U,"nodeIsGroupProperty",U.prototype.up);
t.defineProperty(U,{up:"nodeIsGroupProperty"},function(){return this.Su},function(a){var b=this.Su;b!==a&&(xe(a,U,"nodeIsGroupProperty"),this.Su=a,this.i("nodeIsGroupProperty",b,a))});U.prototype.isGroupForNodeData=U.prototype.lA=function(a){if(null===a)return!1;var b=this.Su;return""===b?!1:t.hb(a,b)?!0:!1};t.g(U,"nodeGroupKeyProperty",U.prototype.tp);
t.defineProperty(U,{tp:"nodeGroupKeyProperty"},function(){return this.Dj},function(a){var b=this.Dj;b!==a&&(xe(a,U,"nodeGroupKeyProperty"),this.Dj=a,this.i("nodeGroupKeyProperty",b,a))});t.g(U,"copiesGroupKeyOfNodeData",U.prototype.cl);t.defineProperty(U,{cl:"copiesGroupKeyOfNodeData"},function(){return this.Nx},function(a){this.Nx!==a&&(t.j(a,"boolean",U,"copiesGroupKeyOfNodeData"),this.Nx=a)});
U.prototype.getGroupKeyForNodeData=U.prototype.Uo=function(a){if(null!==a){var b=this.Dj;if(""!==b&&(b=t.hb(a,b),void 0!==b)){if(ye(b))return b;t.l("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
U.prototype.setGroupKeyForNodeData=U.prototype.$A=function(a,b){null===b&&(b=void 0);void 0===b||ye(b)||t.Vb(b,"number or string",U,"setGroupKeyForNodeData:key");if(null!==a){var c=this.Dj;if(""!==c)if(this.ie(a)){var d=t.hb(a,c);d!==b&&(Be(this,d,a),t.Ta(a,c,b),null===this.mf(b)&&Ae(this,b,a),we(this,"nodeGroupKey",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};
U.prototype.copyNodeData=U.prototype.Xj=function(a){if(null===a)return null;a=I.prototype.Xj.call(this,a);this.cl||""===this.Dj||t.Ta(a,this.Dj,void 0);return a};
U.prototype.setDataProperty=U.prototype.Ow=function(a,b,c){f&&(t.j(a,"object",U,"setDataProperty:data"),t.j(b,"string",U,"setDataProperty:propname"),""===b&&t.l("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.ie(a))if(b===this.Yi)this.aB(a,c);else{if(b===this.ql){this.Mw(a,c);return}if(b===this.tp){this.$A(a,c);return}b===this.up&&t.l("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.Ji(a)){if(b===
this.gp){this.YA(a,c);return}if(b===this.lp){this.cB(a,c);return}if(b===this.hp){this.ZA(a,c);return}if(b===this.mp){this.dB(a,c);return}if(b===this.fp){this.xF(a,c);return}if(b===this.ip){this.yF(a,c);return}}else!t.Mp&&a instanceof X&&(t.Mp=!0,t.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),t.trace("  Is that really your intent?"));var d=t.hb(a,b);d!==c&&(t.Ta(a,b,c),this.Hw(a,b,d,c))};aa=U.prototype;
aa.pt=function(a,b){I.prototype.pt.call(this,a,b);for(var c=this.uc.k;c.next();)this.QA(c.value,a,b);for(c=this.Yl.k;c.next();){var d=c.value,e=a,g=b;if(this.Nm(d)===e){var h=this.uj;t.Ta(d,h,g);we(this,"linkFromKey",Cd,h,d,e,g);"string"===typeof h&&this.Jb(d,h)}this.Om(d)===e&&(h=this.xj,t.Ta(d,h,g),we(this,"linkToKey",Cd,h,d,e,g),"string"===typeof h&&this.Jb(d,h));var k=this.ll(d);if(t.isArray(k))for(var l=t.yb(k),h=this.uh,m=0;m<l;m++)t.sb(k,m)===e&&(t.hD(k,m,g),we(this,"linkLabelKeys",Dd,h,d,
e,g))}};aa.QA=function(a,b,c){if(this.Uo(a)===b){var d=this.Dj;t.Ta(a,d,c);we(this,"nodeGroupKey",Cd,d,a,b,c);"string"===typeof d&&this.Jb(a,d)}};aa.oB=function(){I.prototype.oB.call(this);for(var a=this.Vi,b=t.yb(a),c=0;c<b;c++){var d=t.sb(a,c);Ce(this,d)}};
aa.zp=function(a){I.prototype.zp.call(this,a);a=this.Nb(a);var b=ze(this,a);if(null!==b){for(var c=new H(Object),b=b.k;b.next();){var d=b.value;if(this.ie(d)){if(this.Uo(d)===a){var e=this.Dj;we(this,"nodeGroupKey",Cd,e,d,a,a);"string"===typeof e&&this.Jb(d,e);c.add(d)}}else{this.Nm(d)===a&&(e=this.uj,we(this,"linkFromKey",Cd,e,d,a,a),"string"===typeof e&&this.Jb(d,e),c.add(d));this.Om(d)===a&&(e=this.xj,we(this,"linkToKey",Cd,e,d,a,a),"string"===typeof e&&this.Jb(d,e),c.add(d));var g=this.ll(d);
if(t.isArray(g))for(var h=t.yb(g),e=this.uh,k=0;k<h;k++)t.sb(g,k)===a&&(we(this,"linkLabelKeys",Dd,e,d,a,a),c.add(d))}}for(c=c.k;c.next();)Be(this,a,c.value)}};aa.yp=function(a){I.prototype.yp.call(this,a);var b=this.Uo(a);null===this.mf(b)&&Ae(this,b,a)};aa.Ft=function(a){I.prototype.Ft.call(this,a);var b=this.Uo(a);Be(this,b,a)};t.g(U,"linkCategoryProperty",U.prototype.fp);
t.defineProperty(U,{fp:"linkCategoryProperty"},function(){return this.Yq},function(a){var b=this.Yq;b!==a&&(xe(a,U,"linkCategoryProperty"),this.Yq=a,this.i("linkCategoryProperty",b,a))});U.prototype.getCategoryForLinkData=U.prototype.getCategoryForLinkData=function(a){if(null===a)return"";var b=this.Yq;if(""===b)return"";b=t.hb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;t.l("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
U.prototype.setCategoryForLinkData=U.prototype.xF=function(a,b){t.j(b,"string",U,"setCategoryForLinkData:cat");if(null!==a){var c=this.Yq;if(""===c)return"";if(this.Ji(a)){var d=t.hb(a,c);void 0===d&&(d="");d!==b&&(t.Ta(a,c,b),we(this,"linkCategory",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};
function Sd(a){1<arguments.length&&t.l("TreeModel constructor can only take one optional argument, the Array of node data.");I.call(this);this.Ej="parent";this.Px=!1;this.xr="parentLinkCategory";void 0!==a&&(this.sg=a)}t.ia("TreeModel",Sd);t.Oa(Sd,I);Sd.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.jB();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.sg;var c=t.yb(a),d;for(d=0;d<c;d++)var e=t.sb(a,d),b=b+(" "+this.Nb(e)+":"+la(e))}return b};
Sd.prototype.Gt=function(){var a=I.prototype.Gt.call(this),b="";"parent"!==this.vp&&"string"===typeof this.vp&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.vp));return a+b};Sd.prototype.nt=function(a){I.prototype.nt.call(this,a);a.nodeParentKeyProperty&&(this.vp=a.nodeParentKeyProperty)};Sd.prototype.Vm=function(a){return a};t.g(Sd,"nodeParentKeyProperty",Sd.prototype.vp);
t.defineProperty(Sd,{vp:"nodeParentKeyProperty"},function(){return this.Ej},function(a){var b=this.Ej;b!==a&&(xe(a,Sd,"nodeParentKeyProperty"),this.Ej=a,this.i("nodeParentKeyProperty",b,a))});t.g(Sd,"copiesParentKeyOfNodeData",Sd.prototype.dl);t.defineProperty(Sd,{dl:"copiesParentKeyOfNodeData"},function(){return this.Px},function(a){this.Px!==a&&(t.j(a,"boolean",Sd,"copiesParentKeyOfNodeData"),this.Px=a)});
Sd.prototype.getParentKeyForNodeData=Sd.prototype.Wo=function(a){if(null!==a){var b=this.Ej;if(""!==b&&(b=t.hb(a,b),void 0!==b)){if(ye(b))return b;t.l("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
Sd.prototype.setParentKeyForNodeData=Sd.prototype.Ph=function(a,b){null===b&&(b=void 0);void 0===b||ye(b)||t.Vb(b,"number or string",Sd,"setParentKeyForNodeData:key");if(null!==a){var c=this.Ej;if(""!==c)if(b=this.Vm(b),this.ie(a)){var d=t.hb(a,c);d!==b&&(Be(this,d,a),t.Ta(a,c,b),null===this.mf(b)&&Ae(this,b,a),we(this,"nodeParentKey",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};t.g(Sd,"parentLinkCategoryProperty",Sd.prototype.SI);
t.defineProperty(Sd,{SI:"parentLinkCategoryProperty"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(xe(a,Sd,"parentLinkCategoryProperty"),this.xr=a,this.i("parentLinkCategoryProperty",b,a))});Sd.prototype.getParentLinkCategoryForNodeData=Sd.prototype.aI=function(a){if(null===a)return"";var b=this.xr;if(""===b)return"";b=t.hb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;t.l("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
Sd.prototype.setParentLinkCategoryForNodeData=Sd.prototype.bJ=function(a,b){t.j(b,"string",Sd,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.xr;if(""===c)return"";if(this.ie(a)){var d=t.hb(a,c);void 0===d&&(d="");d!==b&&(t.Ta(a,c,b),we(this,"parentLinkCategory",Cd,c,a,d,b),"string"===typeof c&&this.Jb(a,c))}else t.Ta(a,c,b)}};Sd.prototype.copyNodeData=Sd.prototype.Xj=function(a){if(null===a)return null;a=I.prototype.Xj.call(this,a);this.dl||""===this.Ej||t.Ta(a,this.Ej,void 0);return a};
Sd.prototype.setDataProperty=Sd.prototype.Ow=function(a,b,c){f&&(t.j(a,"object",Sd,"setDataProperty:data"),t.j(b,"string",Sd,"setDataProperty:propname"),""===b&&t.l("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.ie(a))if(b===this.Yi)this.aB(a,c);else{if(b===this.ql){this.Mw(a,c);return}if(b===this.vp){this.Ph(a,c);return}}else!t.Mp&&a instanceof X&&(t.Mp=!0,t.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),
t.trace("  Is that really your intent?"));var d=t.hb(a,b);d!==c&&(t.Ta(a,b,c),this.Hw(a,b,d,c))};aa=Sd.prototype;aa.pt=function(a,b){I.prototype.pt.call(this,a,b);for(var c=this.uc.k;c.next();)this.QA(c.value,a,b)};aa.QA=function(a,b,c){if(this.Wo(a)===b){var d=this.Ej;t.Ta(a,d,c);we(this,"nodeParentKey",Cd,d,a,b,c);"string"===typeof d&&this.Jb(a,d)}};
aa.zp=function(a){I.prototype.zp.call(this,a);a=this.Nb(a);var b=ze(this,a);if(null!==b){for(var c=new H(Object),b=b.k;b.next();){var d=b.value;if(this.ie(d)&&this.Wo(d)===a){var e=this.Ej;we(this,"nodeParentKey",Cd,e,d,a,a);"string"===typeof e&&this.Jb(d,e);c.add(d)}}for(c=c.k;c.next();)Be(this,a,c.value)}};aa.yp=function(a){I.prototype.yp.call(this,a);var b=this.Wo(a),b=this.Vm(b);null===this.mf(b)&&Ae(this,b,a)};aa.Ft=function(a){I.prototype.Ft.call(this,a);var b=this.Wo(a);Be(this,b,a)};
function De(a,b,c){t.zc(this);void 0===a?a="":t.j(a,"string",De,"constructor:targetprop");void 0===b?b=a:t.j(b,"string",De,"constructor:sourceprop");void 0===c?c=null:null!==c&&t.j(c,"function",De,"constructor:conv");this.OC="";this.eg=null;this.vv=a;this.tv=this.hz=0;this.LC=null;this.nv=b;this.Lx=c;this.Gy=Ee;this.Ex=null}t.ia("Binding",De);var Ee;De.OneWay=Ee=t.w(De,"OneWay",1);var Fe;De.TwoWay=Fe=t.w(De,"TwoWay",2);
De.parseEnum=function(a,b){t.j(a,"function",De,"parseEnum:ctor");t.tb(b,a,De,"parseEnum:defval");return function(c){return t.Km(a,c)||b}};var la;De.toString=la=function(a){var b=a;t.pb(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()};
De.prototype.toString=function(){return"Binding("+this.en+" "+this.Ct+":"+this.eB+")"};De.prototype.freeze=function(){this.jb=!0;return this};De.prototype.Ua=function(){this.jb=!1;return this};t.g(De,"targetId",De.prototype.en);t.defineProperty(De,{en:null},function(){return this.OC},function(a){t.J(this);t.j(a,"string",De,"targetId");this.OC=a});t.g(De,"targetProperty",De.prototype.Ct);
t.defineProperty(De,{Ct:"targetProperty"},function(){return this.vv},function(a){t.J(this);t.j(a,"string",De,"targetProperty");this.vv=a});t.g(De,"sourceName",De.prototype.zt);t.defineProperty(De,{zt:"sourceName"},function(){return this.LC},function(a){t.J(this);t.j(a,"string",De,"sourceName");this.LC=a});t.g(De,"sourceProperty",De.prototype.eB);t.defineProperty(De,{eB:"sourceProperty"},function(){return this.nv},function(a){t.J(this);t.j(a,"string",De,"sourceProperty");this.nv=a});
t.g(De,"converter",De.prototype.wD);t.defineProperty(De,{wD:"converter"},function(){return this.Lx},function(a){t.J(this);null!==a&&t.j(a,"function",De,"converter");this.Lx=a});t.g(De,"backConverter",De.prototype.mD);t.defineProperty(De,{mD:"backConverter"},function(){return this.Ex},function(a){t.J(this);null!==a&&t.j(a,"function",De,"backConverter");this.Ex=a});t.g(De,"mode",De.prototype.mode);
t.defineProperty(De,{mode:"mode"},function(){return this.Gy},function(a){t.J(this);t.tb(a,De,De,"mode");this.Gy=a});De.prototype.makeTwoWay=function(a){void 0===a&&(a=null);null!==a&&t.j(a,"function",De,"makeTwoWay");this.mode=Fe;this.mD=a;return this};De.prototype.ofObject=De.prototype.DA=function(a){void 0===a&&(a="");f&&t.j(a,"string",De,"ofObject:srcname");this.zt=a;return this};
De.prototype.updateTarget=De.prototype.$F=function(a,b,c){var d=this.nv;if(!c||d===c){c=this.vv;var e=this.Lx;if(null!==e||""!==c){f&&"string"===typeof c&&("function"===typeof a.setAttribute||"_"===c[0]||t.mw(a,c)?"name"===c&&a instanceof X&&t.trace("Binding error: cannot modify GraphObject.name on "+a.toString()):t.trace("Binding error: undefined target property: "+c+" on "+a.toString()));var g=b;""!==d&&(g=t.hb(b,d));if(void 0!==g)if(null===e)""!==c&&t.Ta(a,c,g);else try{if(""!==c){var h=e(g,a);
f&&void 0===h&&t.trace('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);t.Ta(a,c,h)}else e(g,a)}catch(k){f&&t.trace("Binding error: "+k.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}};
De.prototype.updateSource=De.prototype.ZF=function(a,b,c,d){if(this.Gy===Fe){var e=this.vv;if(!c||e===c){c=this.nv;var g=this.Ex;if(null!==g||""!==c){var h=a;""!==e&&(h=t.hb(a,e));if(void 0!==h)if(null===g)d&&d.fa?(f&&d.fa.Yi===c&&d.fa.ie(b)&&t.trace("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),d.fa.Ow(b,c,h)):t.Ta(b,c,h);else try{if(""!==c){var k=g(h,b);d&&d.fa?(f&&(d.fa.Yi===c&&d.fa.ie(b)&&t.trace("Binding error: cannot have TwoWay Binding on node data key property: "+
this.toString()),void 0===k&&t.trace('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+g)),d.fa.Ow(b,c,k)):t.Ta(b,c,k)}else g(h,b)}catch(l){f&&t.trace("Binding error: "+l.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+g)}}}}};function ve(){this.vG=(new H(Ad)).freeze();this.Rb="";this.gC=!1}t.ia("Transaction",ve);
ve.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.Eh.count.toString()+(this.$o?"":", incomplete");if(void 0!==a&&0<a)for(var c=this.Eh.count,d=0;d<c;d++){var e=this.Eh.qa(d);null!==e&&(b+="\n  "+e.toString(a-1))}return b};ve.prototype.clear=ve.prototype.clear=function(){var a=this.Eh;a.Ua();for(var b=a.count-1;0<=b;b--){var c=a.qa(b);null!==c&&c.clear()}a.clear();a.freeze()};ve.prototype.canUndo=ve.prototype.canUndo=function(){return this.$o};
ve.prototype.undo=ve.prototype.undo=function(){if(this.canUndo())for(var a=this.Eh.count-1;0<=a;a--){var b=this.Eh.qa(a);null!==b&&b.undo()}};ve.prototype.canRedo=ve.prototype.canRedo=function(){return this.$o};ve.prototype.redo=ve.prototype.redo=function(){if(this.canRedo())for(var a=this.Eh.count,b=0;b<a;b++){var c=this.Eh.qa(b);null!==c&&c.redo()}};t.A(ve,{Eh:"changes"},function(){return this.vG});t.g(ve,"name",ve.prototype.name);
t.defineProperty(ve,{name:"name"},function(){return this.Rb},function(a){this.Rb=a});t.g(ve,"isComplete",ve.prototype.$o);t.defineProperty(ve,{$o:"isComplete"},function(){return this.gC},function(a){this.gC=a});function Nd(){this.Iy=new ua(I);this.hi=!1;this.yG=(new H(ve)).freeze();this.Jk=-1;this.qC=999;this.ii=!1;this.hu=null;this.Wk=0;this.Fx=!1;f&&(this.Fx=!0);this.Ng=(new H("string")).freeze();this.ao=new H("number");this.hy=!0}t.ia("UndoManager",Nd);
Nd.prototype.toString=function(a){for(var b="UndoManager "+this.gk+"<"+this.history.count+"<="+this.rA,b=b+"[",c=this.WE.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.WE.qa(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.qa(d).toString(a-1);return b};
Nd.prototype.clear=Nd.prototype.clear=function(){var a=this.history;a.Ua();for(var b=a.count-1;0<=b;b--){var c=a.qa(b);null!==c&&c.clear()}a.clear();this.Jk=-1;a.freeze();this.ii=!1;this.hu=null;this.Wk=0;this.Ng.Ua();this.Ng.clear();this.Ng.freeze();this.ao.clear()};Nd.prototype.addModel=Nd.prototype.PG=function(a){this.Iy.add(a)};Nd.prototype.removeModel=Nd.prototype.XI=function(a){this.Iy.remove(a)};
Nd.prototype.startTransaction=Nd.prototype.rc=function(a){void 0===a&&(a="");null===a&&(a="");if(this.qb)return!1;!0===this.hy&&(this.hy=!1,this.Wk++,this.Nc("StartingFirstTransaction",a,this.gl),0<this.Wk&&this.Wk--);this.isEnabled&&(this.Ng.Ua(),this.Ng.add(a),this.Ng.freeze(),null===this.gl?this.ao.add(0):this.ao.add(this.gl.Eh.count));this.Wk++;var b=1===this.Bl;b&&this.Nc("StartedTransaction",a,this.gl);return b};Nd.prototype.commitTransaction=Nd.prototype.De=function(a){return Ge(this,!0,a)};
Nd.prototype.rollbackTransaction=Nd.prototype.rt=function(){return Ge(this,!1,"")};
function Ge(a,b,c){if(a.qb)return!1;a.Jz&&1>a.Bl&&t.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Bl;d&&b&&a.isEnabled&&a.Nc("CommittingTransaction",c,a.gl);var e=0;if(0<a.Bl&&(a.Wk--,a.isEnabled)){var g=a.Ng.count;0<g&&(""===c&&(c=a.Ng.qa(0)),a.Ng.Ua(),a.Ng.gd(g-1),a.Ng.freeze());g=a.ao.count;0<g&&(e=a.ao.qa(g-1),a.ao.gd(g-1))}g=a.gl;if(d){if(b){if(a.isEnabled&&null!==g){b=g;b.$o=!0;b.name=c;d=a.history;d.Ua();for(e=d.count-1;e>a.gk;e--)g=d.qa(e),null!==g&&g.clear(),
d.gd(e);e=a.rA;0===e&&(e=1);0<e&&d.count>=e&&(g=d.qa(0),null!==g&&g.clear(),d.gd(0),a.Jk--);d.add(b);a.Jk++;d.freeze();g=b}a.Nc("CommittedTransaction",c,g)}else{a.ii=!0;try{a.isEnabled&&null!==g&&(g.$o=!0,g.undo())}finally{a.Nc("RolledBackTransaction",c,g),a.ii=!1}null!==g&&g.clear()}a.hu=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.Eh;for(b=c.count-1;b>=a;b--)d=c.qa(b),null!==d&&d.undo(),c.Ua(),c.gd(b);c.freeze()}return!1}
Nd.prototype.canUndo=Nd.prototype.canUndo=function(){if(!this.isEnabled||0<this.Bl||this.qb)return!1;var a=this.SF;return null!==a&&a.canUndo()?!0:!1};Nd.prototype.undo=Nd.prototype.undo=function(){if(this.canUndo()){var a=this.SF;try{this.Nc("StartingUndo","Undo",a),this.ii=!0,this.Jk--,a.undo()}catch(b){t.trace("undo error: "+b.toString())}finally{this.ii=!1,this.Nc("FinishedUndo","Undo",a)}}};
Nd.prototype.canRedo=Nd.prototype.canRedo=function(){if(!this.isEnabled||0<this.Bl||this.qb)return!1;var a=this.RF;return null!==a&&a.canRedo()?!0:!1};Nd.prototype.redo=Nd.prototype.redo=function(){if(this.canRedo()){var a=this.RF;try{this.Nc("StartingRedo","Redo",a),this.ii=!0,this.Jk++,a.redo()}catch(b){t.trace("redo error: "+b.toString())}finally{this.ii=!1,this.Nc("FinishedRedo","Redo",a)}}};
Nd.prototype.Nc=function(a,b,c){void 0===c&&(c=null);var d=new Ad;d.od=Bd;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.FI;a.next();)b=a.value,d.fa=b,b.Nv(d)};Nd.prototype.handleChanged=Nd.prototype.lE=function(a){if(this.isEnabled&&!this.qb&&!this.skipsEvent(a)){var b=this.gl;null===b&&(this.hu=b=new ve);var c=a.copy(),b=b.Eh;b.Ua();b.add(c);b.freeze();this.Jz&&0>=this.Bl&&!this.hy&&(a=a.h,null!==a&&!1===a.Xf||t.trace("Change not within a transaction: "+c.toString()))}};
Nd.prototype.skipsEvent=function(a){if(null===a||0>a.od.value)return!0;a=a.object;if(a instanceof X){if(a=a.layer,null!==a&&a.pc)return!0}else if(a instanceof ke&&a.pc)return!0;return!1};t.A(Nd,{FI:"models"},function(){return this.Iy.k});t.g(Nd,"isEnabled",Nd.prototype.isEnabled);t.defineProperty(Nd,{isEnabled:"isEnabled"},function(){return this.hi},function(a){this.hi=a});t.A(Nd,{SF:"transactionToUndo"},function(){return 0<=this.gk&&this.gk<=this.history.count-1?this.history.qa(this.gk):null});
t.A(Nd,{RF:"transactionToRedo"},function(){return this.gk<this.history.count-1?this.history.qa(this.gk+1):null});t.A(Nd,{qb:"isUndoingRedoing"},function(){return this.ii});t.A(Nd,{history:"history"},function(){return this.yG});t.g(Nd,"maxHistoryLength",Nd.prototype.rA);t.defineProperty(Nd,{rA:"maxHistoryLength"},function(){return this.qC},function(a){this.qC=a});t.A(Nd,{gk:"historyIndex"},function(){return this.Jk});t.A(Nd,{gl:"currentTransaction"},function(){return this.hu});
t.A(Nd,{Bl:"transactionLevel"},function(){return this.Wk});t.A(Nd,{mI:"isInTransaction"},function(){return 0<this.Wk});t.defineProperty(Nd,{Jz:"checksTransactionLevel"},function(){return this.Fx},function(a){this.Fx=a});t.A(Nd,{WE:"nestedTransactionNames"},function(){return this.Ng});
function wa(){0<arguments.length&&t.l("CommandHandler constructor cannot take any arguments.");this.ea=null;this.Mx=this.Ox=this.RB=this.JB=!1;this.Qk=this.Cx=null;this.ZC=1.05;this.QB=1;this.Dy=NaN;this.oC=null;this.$C=NaN}t.ia("CommandHandler",wa);wa.prototype.toString=function(){return"CommandHandler"};t.A(wa,{h:"diagram"},function(){return this.ea});wa.prototype.qe=function(a){f&&null!==a&&t.m(a,u,wa,"setDiagram");this.ea=a};
wa.prototype.doKeyDown=function(){var a=this.h;if(null!==a){var b=a.T,c=a.Rl?b.Wm:b.control,d=b.shift,e=b.alt,g=b.key;!c||"C"!==g&&"Insert"!==g?c&&"X"===g||d&&"Del"===g?this.canCutSelection()&&this.cutSelection():"Del"===g?this.canDeleteSelection()&&this.deleteSelection():c&&"V"===g||d&&"Insert"===g?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===g||e&&d&&"Backspace"===g?this.canRedo()&&this.redo():c&&"Z"===g||e&&"Backspace"===g?this.canUndo()&&this.undo():c&&"A"===g?this.canSelectAll()&&
this.selectAll():"Esc"===g?this.canStopCommand()&&this.stopCommand():"Up"===g?a.jf&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===g?a.jf&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===g?a.hf&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===g?a.hf&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===g?d&&a.hf?a.scroll("page","left"):a.jf&&a.scroll("page","up"):"PageDown"===g?d&&a.hf?a.scroll("page","right"):a.jf&&a.scroll("page","down"):"Home"===
g?(b=a.vc,c&&a.jf?a.position=new C(a.position.x,b.y):!c&&a.hf&&(a.position=new C(b.x,a.position.y))):"End"===g?(b=a.vc,d=a.nb,c&&a.jf?a.position=new C(d.x,b.bottom-d.height):!c&&a.hf&&(a.position=new C(b.right-d.width,d.y))):"Subtract"===g?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===g?this.canIncreaseZoom()&&this.increaseZoom():c&&"0"===g?this.canResetZoom()&&this.resetZoom():d&&"Z"===g?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===g?this.canGroupSelection()&&this.groupSelection():c&&
d&&"G"===g?this.canUngroupSelection()&&this.ungroupSelection():b.event&&113===b.event.which?this.canEditTextBlock()&&this.editTextBlock():b.event&&93===b.event.which?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}};wa.prototype.doKeyUp=function(){var a=this.h;null!==a&&(a.T.bubbles=!0)};wa.prototype.stopCommand=function(){var a=this.h;if(null!==a){var b=a.Za;b instanceof He&&a.Ne&&a.Pv();null!==b&&b.doCancel()}};
wa.prototype.canStopCommand=function(){return!0};wa.prototype.selectAll=function(){var a=this.h;if(null!==a){a.pa();try{a.cd="wait";a.Ja("ChangingSelection");for(var b=a.rl;b.next();)b.value.bb=!0;for(b=a.Zi;b.next();)b.value.bb=!0;for(b=a.links;b.next();)b.value.bb=!0}finally{a.Ja("ChangedSelection"),a.cd=""}}};wa.prototype.canSelectAll=function(){var a=this.h;return null!==a&&a.Ne};
wa.prototype.deleteSelection=function(){var a=this.h;if(null!==a&&!a.Ja("SelectionDeleting",a.selection))try{a.cd="wait";a.rc("Delete");a.Ja("ChangingSelection");for(var b=new ua(w),c=a.selection.k;c.next();)Ue(b,c.value,!0,this.MD?Infinity:0,function(a){return a.canDelete()});a.PA(b,!0);a.Ja("SelectionDeleted",b)}finally{a.Ja("ChangedSelection"),a.De("Delete"),a.cd=""}};wa.prototype.canDeleteSelection=function(){var a=this.h;return null===a||a.$a||a.Ue||!a.$k||0===a.selection.count?!1:!0};
function Ue(a,b,c,d,e){if(!(a.contains(b)||(void 0===e&&(e=null),null!==e&&!e(b)||b instanceof Ve)))if(a.add(b),b instanceof y){if(c&&b instanceof z)for(var g=b.Ic;g.next();){var h=g.value;Ue(a,h,c,d,e)}for(h=b.Dd;h.next();)if(g=h.value,!a.contains(g)){var k=g.da,l=g.ja;null!==k&&a.contains(k)&&null!==l&&a.contains(l)?Ue(a,g,c,d,e):null!==k&&null!==l||Ue(a,g,c,d,e)}if(1<d)for(b=b.YD();b.next();)h=b.value,Ue(a,h,c,d-1,e)}else if(b instanceof A)for(h=b.Ui;h.next();)Ue(a,h.value,c,d,e)}
wa.prototype.copyParts=function(a,b,c){var d=new sa(w,w);for(a=a.k;a.next();){var e=a.value;We(this,e,b,d,c)}if(null!==b){c=b.fa;a=!1;null!==b.Db.ke&&(a=b.Db.ke.Ni);for(var g=new ua(A),h=new sa(A,A),k=d.k;k.next();)if(e=k.value,e instanceof A)a||null!==e.da&&null!==e.ja||g.add(e);else if(c instanceof Sd&&e instanceof y&&null!==e.data){var l=e,e=k.key,m=e.ZD();null!==m&&((m=d.Ba(m))?(c.Ph(l.data,c.Nb(m.data)),l=b.Hf(l.data),e=e.Js(),null!==e&&null!==l&&h.add(e,l)):c.Ph(l.data,void 0))}0<g.count&&b.PA(g,
!1);if(0<h.count)for(b=h.k;b.next();)d.add(b.key,b.value)}for(b=d.k;b.next();)b.value.Jb();return d};
function We(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return a=d.Ba(b),a instanceof w?a:null;var g=null,h=b.data;if(null!==h&&null!==c){var k=c.fa;b instanceof A?k instanceof U&&(h=k.zD(h),t.pb(h)&&(k.Dv(h),g=c.Hf(h))):(h=k.Xj(h),t.pb(h)&&(k.um(h),g=c.Pi(h)))}else Xe(b),g=b.copy(),null!==c&&g instanceof w&&c.add(g);if(!(g instanceof w))return null;g.bb=!1;d.add(b,g);if(b instanceof y){for(k=b.Dd;k.next();){h=k.value;if(h.da===b){var l=d.Ba(h);null!==l&&(l.da=g)}h.ja===b&&
(l=d.Ba(h),null!==l&&(l.ja=g))}if(b instanceof z&&g instanceof z)for(b=b.Ic;b.next();)k=We(a,b.value,c,d,e),k instanceof A||null===k||(k.fb=g)}else if(b instanceof A)for(k=b.da,null!==k&&(k=d.Ba(k),null!==k&&(g.da=k)),k=b.ja,null!==k&&(k=d.Ba(k),null!==k&&(g.ja=k)),b=b.Ui;b.next();)k=We(a,b.value,c,d,e),null!==k&&(k.Tc=g);return g}
wa.prototype.copySelection=function(){var a=this.h;if(null!==a){for(var b=new ua(w),a=a.selection.k;a.next();)Ue(b,a.value,!0,this.yD?Infinity:0,function(a){return a.canCopy()});this.copyToClipboard(b)}};wa.prototype.canCopySelection=function(){var a=this.h;return null!==a&&a.Sj&&a.Hv&&0!==a.selection.count?!0:!1};wa.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
wa.prototype.canCutSelection=function(){var a=this.h;return null!==a&&!a.$a&&!a.Ue&&a.Sj&&a.$k&&a.Hv&&0!==a.selection.count?!0:!1};
wa.prototype.copyToClipboard=function(a){var b=this.h;if(null!==b){var c=null;if(null===a)t.ys=null,t.Qv="";else{var c=b.fa,d=!1,e=!1,g=null;try{c instanceof Sd&&(d=c.dl,c.dl=this.Nz),c instanceof U&&(e=c.cl,c.cl=this.Mz),g=b.copyParts(a,null,!0)}finally{c instanceof Sd&&(c.dl=d),c instanceof U&&(c.cl=e),c=new H(w),c.Me(g),t.ys=c,t.Qv=b.fa.Hm}}b.Ja("ClipboardChanged",c)}};
wa.prototype.pasteFromClipboard=function(){var a=new ua(w),b=t.ys;if(null===b)return a;var c=this.h;if(null===c||t.Qv!==c.fa.Hm)return a;var d=c.fa,e=!1,g=!1,h=null;try{d instanceof Sd&&(e=d.dl,d.dl=this.Nz),d instanceof U&&(g=d.cl,d.cl=this.Mz),h=c.copyParts(b,c,!1)}finally{for(d instanceof Sd&&(d.dl=e),d instanceof U&&(d.cl=g),b=h.k;b.next();)c=b.value,d=b.key,c.location.Q()||(d.location.Q()?c.location=d.location:!c.position.Q()&&d.position.Q()&&(c.position=d.position)),a.add(c)}return a};
wa.prototype.pasteSelection=function(a){var b=this.h;if(null!==b)try{b.cd="wait";b.rc("Paste");b.Ja("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&Ye(b);for(var d=c.k;d.next();)d.value.bb=!0;b.Ja("ChangedSelection");if(a instanceof C){var e=b.computePartsBounds(b.selection);if(e){var g=b.Db.ke,h=g.computeEffectiveCollection(b.selection);g.moveParts(h,new C(a.x-e.Fa,a.y-e.Sa),!1)}}b.Ja("ClipboardPasted",c)}finally{b.De("Paste"),b.cd=""}};
wa.prototype.canPasteSelection=function(){var a=this.h;return null===a||a.$a||a.Ue||!a.vm||!a.Hv||null===t.ys||t.Qv!==a.fa.Hm?!1:!0};wa.prototype.undo=function(){var a=this.h;null!==a&&a.Aa.undo()};wa.prototype.canUndo=function(){var a=this.h;return null===a||a.$a||a.Ue?!1:a.Cz&&a.Aa.canUndo()};wa.prototype.redo=function(){var a=this.h;null!==a&&a.Aa.redo()};wa.prototype.canRedo=function(){var a=this.h;return null===a||a.$a||a.Ue?!1:a.Cz&&a.Aa.canRedo()};
wa.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.It);t.o(a,wa,"decreaseZoom:factor");var b=this.h;null!==b&&b.zm===Ze&&(a*=b.scale,a<b.qg||a>b.pg||(b.scale=a))};wa.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.It);t.o(a,wa,"canDecreaseZoom:factor");var b=this.h;if(null===b||b.zm!==Ze)return!1;a*=b.scale;return a<b.qg||a>b.pg?!1:b.ts};
wa.prototype.increaseZoom=function(a){void 0===a&&(a=this.It);t.o(a,wa,"increaseZoom:factor");var b=this.h;null!==b&&b.zm===Ze&&(a*=b.scale,a<b.qg||a>b.pg||(b.scale=a))};wa.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.It);t.o(a,wa,"canIncreaseZoom:factor");var b=this.h;if(null===b||b.zm!==Ze)return!1;a*=b.scale;return a<b.qg||a>b.pg?!1:b.ts};wa.prototype.resetZoom=function(a){void 0===a&&(a=this.GD);t.o(a,wa,"resetZoom:newscale");var b=this.h;null===b||a<b.qg||a>b.pg||(b.scale=a)};
wa.prototype.canResetZoom=function(a){void 0===a&&(a=1);t.o(a,wa,"canResetZoom:newscale");var b=this.h;return null===b||a<b.qg||a>b.pg?!1:b.ts};wa.prototype.zoomToFit=function(){var a=this.h;if(null!==a){var b=a.scale,c=a.position;b!==this.$C||isNaN(this.Dy)?(this.Dy=b,this.oC=c.copy(),a.zoomToFit(),a.Xi(),this.$C=a.scale):(a.scale=this.Dy,a.position=this.oC)}};wa.prototype.canZoomToFit=function(){var a=this.h;return null===a?!1:a.ts};
wa.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;b.rc("Collapse Tree");var c=new H(y);if(a instanceof y&&a.Hc)a.collapseTree(),c.add(a);else for(a=b.selection.k;a.next();){var d=a.value;d instanceof y&&d.Hc&&(d.collapseTree(),c.add(d))}b.Ja("TreeCollapsed",c);b.De("Collapse Tree")};
wa.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a)return!1;if(a instanceof y){if(!a.Hc)return!1;if(0<a.iw().count)return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof y&&b.Hc&&0<b.iw().count)return!0;return!1};
wa.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;b.rc("Expand Tree");var c=new H(y);if(a instanceof y&&!a.Hc)a.expandTree(),c.add(a);else for(a=b.selection.k;a.next();){var d=a.value;d instanceof y&&!d.Hc&&(d.expandTree(),c.add(d))}b.Ja("TreeExpanded",c);b.De("Expand Tree")};
wa.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a)return!1;if(a instanceof y){if(a.Hc)return!1;if(0<a.iw().count)return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof y&&!b.Hc&&0<b.iw().count)return!0;return!1};
wa.prototype.groupSelection=function(){var a=this.h;if(null!==a){var b=a.fa;if(null!==b&&b instanceof U){var c=this.Ez;if(null!==c){var d=null;try{a.cd="wait";a.rc("Group");a.Ja("ChangingSelection");for(var e=new H(w),g=a.selection.k;g.next();){var h=g.value;h.Ud()&&h.canGroup()&&e.add(h)}for(var k=new H(w),l=e.k;l.next();){for(var m=l.value,h=!1,g=e.k;g.next();)if(m.Us(g.value)){h=!0;break}h||k.add(m)}if(0<k.count){g=k.k;g.next();var n=g.value.fb;if(null!==n)for(;null!==n;){g=k.k;g.next();for(e=
!1;g.next();)if(m=g.value,!m.Us(n)){e=!0;break}if(e)n=n.fb;else break}if(c instanceof z)Xe(c),d=c.copy(),d instanceof z&&a.add(d);else if(b.lA(c)){var p=b.Xj(c);t.pb(p)&&(b.um(p),d=a.hw(p))}if(d instanceof z){null!==n&&this.isValidMember(n,d)&&(d.fb=n);for(g=k.k;g.next();)m=g.value,this.isValidMember(d,m)&&(m.fb=d);a.select(d)}}a.Ja("ChangedSelection");a.Ja("SelectionGrouped",d)}finally{a.De("Group"),a.cd=""}}}}};
wa.prototype.canGroupSelection=function(){var a=this.h;if(null===a||a.$a||a.Ue||!a.vm||!a.xo)return!1;var b=a.fa;if(null===b||!(b instanceof U)||null===this.Ez)return!1;for(a=a.selection.k;a.next();)if(b=a.value,b.Ud()&&b.canGroup())return!0;return!1};function $e(a){var b=t.Cb();for(a=a.k;a.next();){var c=a.value;c instanceof A||b.push(c)}a=new ua(w);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],g=!0,h=0;h<c;h++)if(e.Us(b[h])){g=!1;break}g&&a.add(e)}t.Da(b);return a}
wa.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof A)return!1;if(null!==a){if(a===b||a.Us(b))return!1;var c=a.at;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.at;return null!==c?c(a,b):!0};
wa.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b){var c=b.fa;if(null!==c&&c instanceof U)try{b.cd="wait";b.rc("Ungroup");b.Ja("ChangingSelection");var d=new H(z);if(a instanceof z)d.add(a);else for(var e=b.selection.k;e.next();){var g=e.value;g instanceof z&&g.canUngroup()&&d.add(g)}if(0<d.count)for(b.Pv(),e=d.k;e.next();){var h=e.value,k=h.data,l=h.fb,m=null!==l&&null!==l.data?c.Nb(l.data):void 0,n=new H(w);n.Me(h.Ic);for(var p=n.k;p.next();){var q=p.value;
if(!(q instanceof A)){var r=q.data;null!==r?c.$A(r,m):q.fb=l;q.bb=!0}}null!==k?c.Iw(k):b.remove(h)}b.Ja("ChangedSelection");b.Ja("SelectionUngrouped",d,n)}finally{b.De("Ungroup"),b.cd=""}}};
wa.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a||b.Ue||!b.$k||!b.Co)return!1;var c=b.fa;if(null===c||!(c instanceof U))return!1;if(a instanceof z){if(a.canUngroup())return!0}else for(a=b.selection.k;a.next();)if(b=a.value,b instanceof z&&b.canUngroup())return!0;return!1};wa.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=$e(a).k;d.next();){var e=d.value;null!==e.fb&&(!b||this.isValidMember(null,e)?e.fb=null:c=!1)}return c};
wa.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;b.rc("Collapse SubGraph");var c=new H(z);if(a instanceof z&&a.Ve)a.collapseSubGraph(),c.add(a);else for(a=b.selection.k;a.next();){var d=a.value;d instanceof z&&d.Ve&&(d.collapseSubGraph(),c.add(d))}b.Ja("SubGraphCollapsed",c);b.De("Collapse SubGraph")};
wa.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a)return!1;if(a instanceof z)return a.Ve?!0:!1;for(a=b.selection.k;a.next();)if(b=a.value,b instanceof z&&b.Ve)return!0;return!1};
wa.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;b.rc("Expand SubGraph");var c=new H(z);if(a instanceof z&&!a.Ve)a.expandSubGraph(),c.add(a);else for(a=b.selection.k;a.next();){var d=a.value;d instanceof z&&!d.Ve&&(d.expandSubGraph(),c.add(d))}b.Ja("SubGraphExpanded",c);b.De("Expand SubGraph")};
wa.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a)return!1;if(a instanceof z)return a.Ve?!1:!0;for(a=b.selection.k;a.next();)if(b=a.value,b instanceof z&&!b.Ve)return!0;return!1};
wa.prototype.editTextBlock=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b){var c=b.Db.Tw;if(null!==c){if(null===a){a=b.selection.k;for(var d=null;a.next();){var e=a.value;if(e.canEdit()){d=e;break}}if(null===d)return;a=af(d,function(a){return a instanceof va&&a.aw})}null!==a&&a instanceof va&&(c.Ag=a,b.Za=c)}}};
wa.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.$a||b.Ue||!b.Bo||null===b.Db.Tw)return!1;if(a instanceof va){if(a=a.U,null!==a&&a.canEdit())return!0}else for(b=b.selection.k;b.next();)if(a=b.value,a.canEdit()&&(a=af(a,function(a){return a instanceof va&&a.aw}),null!==a))return!0;return!1};
wa.prototype.showContextMenu=function(a){var b=this.h;if(null!==b){var c=b.Db.Vv;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.eb():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new ud,e=null;a instanceof X?e=a.gb(Vb):b.Pn||(e=b.nb,e=new C(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.Ac=b.gn(e),d.W=e,b.cc=d);b.Za=c;bf(c,!1,a)}}};
wa.prototype.canShowContextMenu=function(a){var b=this.h;if(null===b)return!1;var c=b.Db.Vv;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.eb():b);return null===c.findObjectWithContextMenu(a)?!1:!0};t.g(wa,"copiesTree",wa.prototype.yD);t.defineProperty(wa,{yD:"copiesTree"},function(){return this.JB},function(a){this.JB=a});t.g(wa,"deletesTree",wa.prototype.MD);t.defineProperty(wa,{MD:"deletesTree"},function(){return this.RB},function(a){this.RB=a});t.g(wa,"copiesParentKey",wa.prototype.Nz);
t.defineProperty(wa,{Nz:"copiesParentKey"},function(){return this.Ox},function(a){this.Ox!==a&&(t.j(a,"boolean",wa,"copiesParentKey"),this.Ox=a)});t.g(wa,"copiesGroupKey",wa.prototype.Mz);t.defineProperty(wa,{Mz:"copiesGroupKey"},function(){return this.Mx},function(a){this.Mx!==a&&(t.j(a,"boolean",wa,"copiesGroupKey"),this.Mx=a)});t.g(wa,"archetypeGroupData",wa.prototype.Ez);
t.defineProperty(wa,{Ez:"archetypeGroupData"},function(){return this.Cx},function(a){null!==a&&t.m(a,Object,wa,"archetypeGroupData");var b=this.h;null!==b&&(b=b.fa,b instanceof U&&(a instanceof z||b.lA(a)||t.l("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.Cx=a});t.g(wa,"memberValidation",wa.prototype.at);
t.defineProperty(wa,{at:"memberValidation"},function(){return this.Qk},function(a){null!==a&&t.j(a,"function",wa,"memberValidation");this.Qk=a});t.g(wa,"defaultScale",wa.prototype.GD);t.defineProperty(wa,{GD:"defaultScale"},function(){return this.QB},function(a){t.o(a,wa,"defaultScale");0<a||t.l("defaultScale must be larger than zero, not: "+a);this.QB=a});t.g(wa,"zoomFactor",wa.prototype.It);
t.defineProperty(wa,{It:"zoomFactor"},function(){return this.ZC},function(a){t.o(a,wa,"zoomFactor");1<a||t.l("zoomFactor must be larger than 1.0, not: "+a);this.ZC=a});function le(){0<arguments.length&&t.l("Tool constructor cannot take any arguments.");t.zc(this);this.ea=null;this.Rb="";this.hi=!0;this.eC=!1;this.WC=null;this.Bv=-1}t.ia("Tool",le);le.prototype.qe=function(a){f&&null!==a&&t.m(a,u,le,"setDiagram");this.ea=a};le.prototype.toString=function(){return""!==this.name?this.name+" Tool":t.Tg(Object.getPrototypeOf(this))};
le.prototype.updateAdornments=function(){};le.prototype.canStart=function(){return this.isEnabled};le.prototype.doStart=function(){};le.prototype.doActivate=function(){this.ra=!0};le.prototype.doDeactivate=function(){this.ra=!1};le.prototype.doStop=function(){};le.prototype.doCancel=function(){this.stopTool()};le.prototype.stopTool=function(){var a=this.h;null!==a&&a.Za===this&&(a.Za=null,a.cd="")};le.prototype.doMouseDown=function(){!this.ra&&this.canStart()&&this.doActivate()};
le.prototype.doMouseMove=function(){};le.prototype.doMouseUp=function(){this.stopTool()};le.prototype.doMouseWheel=function(){};le.prototype.doKeyDown=function(){var a=this.h;null!==a&&"Esc"===a.T.key&&this.doCancel()};le.prototype.doKeyUp=function(){};le.prototype.startTransaction=le.prototype.rc=function(a){this.bf=null;var b=this.h;return null===b?!1:b.rc(a)};le.prototype.stopTransaction=le.prototype.kk=function(){var a=this.h;return null===a?!1:null===this.bf?a.rt():a.De(this.bf)};
le.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.Ne){var b=a.T,c=a.Hs(b.W,!1);if(null!==c)if(a.Rl?b.Wm:b.control){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.fb;null!==b&&(b.bb=!b.bb);a.Ja("ChangedSelection")}else if(b.shift){if(!c.bb){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.fb;null!==b&&(b.bb=!0);a.Ja("ChangedSelection")}}else{if(!c.bb){for(b=c;null!==b&&!b.canSelect();)b=b.fb;null!==b&&a.select(b)}}else!b.left||(a.Rl?b.Wm:b.control)||
b.shift||a.Pv()}};le.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.pc});var c=this.h;if(null!==c){var d=c.T,e=c.Rd(d.W,a,b);d.Yd=e;cf(e,d,c)}};
function cf(a,b,c){var d=0;b.left?d=1===b.Be?1:2===b.Be?2:1:b.right&&1===b.Be&&(d=3);var e="";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.Ja(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Ja(e)}if(null!==a)for(;null!==a;){e=null;switch(d){case 1:e=a.click;break;case 2:e=a.Jm?a.Jm:a.click;break;case 3:e=a.Bs}if(null!==
e&&(e(b,a),b.Fe))break;a=a.ga}else{e=null;switch(d){case 1:e=c.click;break;case 2:e=c.Jm?c.Jm:c.click;break;case 3:e=c.Bs}null!==e&&e(b)}}
le.prototype.standardMouseOver=function(){var a=this.h;if(null!==a){var b=a.T;if(null!==b.h){var c=a.Rd(b.W,null,null);b.Yd=c;var d=a.Bb;a.Bb=!0;var e=!1;if(c!==a.Ho){var g=a.Ho;a.HA=g;a.Ho=c;for(this.doCurrentObjectChanged(g,c);null!==g;){var h=g.wA;if(null!==h){if(c===g)break;if(null!==c&&c.Ti(g))break;h(b,g,c);e=!0;if(b.Fe)break}g=g.ga}for(g=a.HA;null!==c;){h=c.vA;if(null!==h){if(g===c)break;if(null!==g&&g.Ti(c))break;h(b,c,g);e=!0;if(b.Fe)break}c=c.ga}c=a.Ho}if(null!==c){g=c;for(h="";null!==g;){h=
g.cursor;if(""!==h)break;g=g.ga}a.cd=h;for(g=c;null!==g;){h=g.et;if(null!==h&&(h(b,g),e=!0,b.Fe))break;g=g.ga}}else a.cd="",h=a.et,null!==h&&(h(b),e=!0);e&&a.Nf();a.Bb=d}}};le.prototype.doCurrentObjectChanged=function(){};
le.prototype.standardMouseWheel=function(){var a=this.h;if(null!==a){var b=a.T,c=b.Zj;if(0!==c&&a.vc.Q()){var d=a.lg,e=a.Db.Xm;if((0<c?d.canIncreaseZoom():d.canDecreaseZoom())&&(e===df&&!b.shift||e===ef&&b.control))e=a.Vh,a.Vh=b.Ac,0<c?d.increaseZoom():d.decreaseZoom(),a.Vh=e,b.bubbles=!1;else if(e===df&&b.shift||e===ef&&!b.control){d=a.position.copy();e=0<c?c:-c;if(!b.shift&&a.jf){var g=a.Dp,e=e/40*g;0<c?a.scroll("pixel","up",e):a.scroll("pixel","down",e)}else b.shift&&a.hf&&(g=a.Cp,e=e/40*g,0<c?
a.scroll("pixel","left",e):a.scroll("pixel","right",e));a.position.N(d)||(b.bubbles=!1)}}}};le.prototype.standardWaitAfter=function(a){t.j(a,"number",le,"standardWaitAfter:delay");this.cancelWaitAfter();var b=this;this.Bv=window.setTimeout(function(){b.doWaitAfter()},a)};le.prototype.cancelWaitAfter=function(){-1!==this.Bv&&window.clearTimeout(this.Bv);this.Bv=-1};le.prototype.doWaitAfter=function(){};
le.prototype.findToolHandleAt=function(a,b){var c=this.h;if(null===c)return null;c=c.Rd(a,null,function(a){a=a.U;return null===a?!1:null!==a.Pc});if(null===c)return null;var d=c.U;return null===d||d.Qc!==b?null:c};le.prototype.isBeyondDragSize=function(a,b){var c=this.h;if(null===c)return!1;void 0===a&&(a=c.Ec.Ac);void 0===b&&(b=c.T.Ac);var d=c.Db.PD,c=d.width,d=d.height;t.gB&&(c+=6,d+=6);return Math.abs(b.x-a.x)>c||Math.abs(b.y-a.y)>d};t.A(le,{h:"diagram"},function(){return this.ea});
t.g(le,"name",le.prototype.name);t.defineProperty(le,{name:"name"},function(){return this.Rb},function(a){this.Rb=a});t.g(le,"isEnabled",le.prototype.isEnabled);t.defineProperty(le,{isEnabled:"isEnabled"},function(){return this.hi},function(a){this.hi=a});t.g(le,"isActive",le.prototype.ra);t.defineProperty(le,{ra:"isActive"},function(){return this.eC},function(a){this.eC=a});t.g(le,"transactionResult",le.prototype.bf);
t.defineProperty(le,{bf:"transactionResult"},function(){return this.WC},function(a){this.WC=a});
function ff(){0<arguments.length&&t.l("DraggingTool constructor cannot take any arguments.");le.call(this);this.name="Dragging";this.IB=!0;this.Ql=this.Yp=this.WB=!1;this.uy=!0;this.ky=(new pa(NaN,NaN)).freeze();this.ly=Sb;this.my=(new C(NaN,NaN)).freeze();this.VB=!1;this.TB=this.HB=this.UB=this.LB=this.ui=null;this.vq=this.hC=!1;this.no=new C(NaN,NaN);this.ov=new C;this.rv=!1;this.mv=!0;this.Cn=100;this.Jl=this.bv=null}t.ia("DraggingTool",ff);t.Oa(ff,le);t.g(ff,"copiesEffectiveCollection",ff.prototype.xD);
t.defineProperty(ff,{xD:"copiesEffectiveCollection"},function(){return this.IB},function(a){this.IB=a});t.g(ff,"dragsTree",ff.prototype.QD);t.defineProperty(ff,{QD:"dragsTree"},function(){return this.WB},function(a){this.WB=a});t.g(ff,"isGridSnapEnabled",ff.prototype.bp);t.defineProperty(ff,{bp:"isGridSnapEnabled"},function(){return this.Ql},function(a){this.Ql!==a&&(t.j(a,"boolean",ff,"isGridSnapEnabled"),this.Ql=a)});t.g(ff,"isGridSnapRealtime",ff.prototype.yE);
t.defineProperty(ff,{yE:"isGridSnapRealtime"},function(){return this.uy},function(a){this.uy!==a&&(t.j(a,"boolean",ff,"isGridSnapRealtime"),this.uy=a)});t.g(ff,"gridSnapCellSize",ff.prototype.dA);t.defineProperty(ff,{dA:"gridSnapCellSize"},function(){return this.ky},function(a){this.ky.N(a)||(t.m(a,pa,ff,"gridSnapCellSize"),this.ky=a=a.Z())});t.g(ff,"gridSnapCellSpot",ff.prototype.iE);
t.defineProperty(ff,{iE:"gridSnapCellSpot"},function(){return this.ly},function(a){this.ly.N(a)||(t.m(a,K,ff,"gridSnapCellSpot"),this.ly=a=a.Z())});t.g(ff,"gridSnapOrigin",ff.prototype.jE);t.defineProperty(ff,{jE:"gridSnapOrigin"},function(){return this.my},function(a){this.my.N(a)||(t.m(a,C,ff,"gridSnapOrigin"),this.my=a=a.Z())});t.g(ff,"dragsLink",ff.prototype.Ni);t.defineProperty(ff,{Ni:"dragsLink"},function(){return this.VB},function(a){this.VB=a});t.g(ff,"currentPart",ff.prototype.Io);
t.defineProperty(ff,{Io:"currentPart"},function(){return this.LB},function(a){this.LB=a});t.g(ff,"copiedParts",ff.prototype.pd);t.defineProperty(ff,{pd:"copiedParts"},function(){return this.HB},function(a){this.HB=a});t.g(ff,"draggedParts",ff.prototype.wc);t.defineProperty(ff,{wc:"draggedParts"},function(){return this.UB},function(a){this.UB=a});t.g(ff,"draggedLink",ff.prototype.dd);t.defineProperty(ff,{dd:"draggedLink"},function(){return this.TB},function(a){this.TB=a});
t.g(ff,"isDragOutStarted",ff.prototype.qw);t.defineProperty(ff,{qw:"isDragOutStarted"},function(){return this.hC},function(a){this.hC=a});t.g(ff,"startPoint",ff.prototype.$i);t.defineProperty(ff,{$i:"startPoint"},function(){return this.ov},function(a){this.ov.N(a)||(t.m(a,C,ff,"startPoint"),this.ov=a=a.Z())});t.g(ff,"delay",ff.prototype.Zv);t.defineProperty(ff,{Zv:"delay"},function(){return this.Cn},function(a){this.Cn=a});
ff.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.al&&!a.Sj&&!a.Iv||!a.Ne)return!1;var b=a.T;return!b.left||a.Za!==this&&(!this.isBeyondDragSize()||b.vw&&b.timestamp-a.Ec.timestamp<this.Cn)?!1:null!==this.findDraggablePart()};ff.prototype.findDraggablePart=function(){var a=this.h;if(null===a)return null;a=a.Hs(a.Ec.W,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.fb;return null!==a&&(a.canMove()||a.canCopy())?a:null};
ff.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.Ne){var b=a.Hs(a.Ec.W,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.fb;this.Io=b;this.Io.bb||(a.Ja("ChangingSelection"),b=a.T,(a.Rl?b.Wm:b.control)||b.shift||Ye(a),this.Io.bb=!0,a.Ja("ChangedSelection"))}}};
ff.prototype.doActivate=function(){var a=this.h;if(null!==a){this.standardMouseSelect();var b=this.Io;null!==b&&(b.canMove()||b.canCopy())&&(this.ra=!0,this.no.set(a.position),gf(this,a.selection),this.Jl=this.bv=null,this.wc=this.computeEffectiveCollection(a.selection),a.$y=!0,hf(this,this.wc),this.rc("Drag"),this.$i=a.Ec.W,a.Bd=!0,a.Iv&&(this.qw=!0,this.vq=!1,jf=this,tf=this.h))}};
function gf(a,b){if(a.Ni){var c=a.h;null!==c&&c.Tj&&(c.fa instanceof U&&1===b.count&&b.eb()instanceof A?(a.dd=b.eb(),a.dd.canRelinkFrom()&&a.dd.canRelinkTo()&&a.dd.Ae(),a.ui=c.Db.MA,null===a.ui&&(a.ui=new uf,a.ui.h=c)):(a.dd=null,a.ui=null))}}
ff.prototype.computeEffectiveCollection=function(a){var b=null!==this.h&&this.h.Za===this,c=new sa(w,Object);if(null===a)return c;for(var d=a.k;d.next();){var e=d.value;vf(this,c,e,b)}if(null!==this.dd&&this.Ni)return c;for(d=a.k;d.next();)e=d.value,e instanceof A&&(a=e,b=a.da,null===b||c.contains(b)?(b=a.ja,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function wf(a){return void 0===a?{point:J.ok,Zy:J.ok}:{point:a.copy(),Zy:J.ok}}
function vf(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof y){b.add(c,wf(c.location));if(c instanceof z)for(var e=c.Ic;e.next();){var g=e.value;vf(a,b,g,d)}for(g=c.Dd;g.next();)if(e=g.value,!b.contains(e)){var h=e.da,k=e.ja;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&vf(a,b,e,d)}if(a.QD)for(c=c.YD();c.next();)g=c.value,vf(a,b,g,d)}else if(c instanceof A)for(e=c,b.add(e,wf()),g=e.Ui;g.next();)vf(a,b,g.value,d);else c instanceof Ve||b.add(c,wf(c.location))}
ff.prototype.doDeactivate=function(){this.ra=!1;var a=this.h;null!==a&&xf(a);yf(this);zf(this,this.wc);this.wc=null;this.vq=this.qw=!1;if(0<Af.count){for(var b=Af.length,c=0;c<b;c++){var d=Af.p[c];Bf(d);Cf(d);yf(d);null!==d.h&&xf(d.h)}Af.clear()}Bf(this);this.no.Ep(NaN,NaN);jf=tf=null;Cf(this);a.Bd=!1;a.$y=!1;this.kk()};function yf(a){var b=a.h;if(null!==b){var c=b.Bb;b.Bb=!0;for(var d=b.T,e=a.Jl;null!==e;){var g=e.uA;if(null!==g&&(g(d,e,null),d.Fe))break;e=e.ga}b.Bb=c}a.bv=null;a.Jl=null}
ff.prototype.doCancel=function(){Cf(this);Df(this);var a=this.h;null!==a&&this.no.Q()&&(a.position=this.no);this.stopTool()};function hf(a,b){if(null!==b){a.rv=!0;for(var c=b.k;c.next();){var d=c.key;d instanceof A&&(d.Jp=!0)}}}function zf(a,b){if(null!==b&&a.rv){for(var c=b.k;c.next();){var d=c.key;d instanceof A&&(d.Jp=!1,d.Si?Ef(d)&&d.$b():d.aa())}a.rv=!1}}ff.prototype.doKeyDown=function(){var a=this.h;null!==a&&(a=a.T,null!==a&&this.ra&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};
ff.prototype.doKeyUp=function(){var a=this.h;null!==a&&null!==a.T&&this.ra&&this.doMouseMove()};function Ff(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=a.k;h.next();){var k=h.value;if(k.Ud()){var l=k.location,k=l.x,l=l.y;isNaN(k)||isNaN(l)||(k<c&&(c=k),l<d&&(d=l),k>e&&(e=k),l>g&&(g=l))}}Infinity===c?b.q(0,0,0,0):b.q(c,d,e-c,g-d)}
function Gf(a,b){if(null===a.pd){var c=a.h;if(null!==c&&!c.$a&&!c.Ue&&null!==a.wc){Df(a);c.Bb=!b;a.Yp=!b;a.$i=c.Ec.W;for(var c=a.xD?c.copyParts(a.wc.Al(),c,!0):c.copyParts(c.selection,c,!0),d=c.k;d.next();)d.value.location=d.key.location;d=t.wf();Ff(c,d);t.Rc(d);for(var d=new sa(w,Object),e=a.wc.k;e.next();){var g=e.key;g.Ud()&&g.canCopy()&&(g=c.Ba(g),null!==g&&(a.Yp&&(g.Xd="Tool"),g.Gf(),d.add(g,wf(g.location))))}for(c=c.k;c.next();)e=c.value,e instanceof A&&e.canCopy()&&d.add(e,wf());a.pd=d;gf(a,
d.Al());null!==a.dd&&(c=a.dd,d=c.pj(),c.pl(a.$i.x-(d.x+d.width/2),a.$i.y-(d.y+d.height/2)))}}}function Cf(a){var b=a.h;null!==b&&(null!==a.pd&&(b.PA(a.pd.Al(),!1),a.pd=null),b.Bb=!1,a.Yp=!1,a.$i=b.Ec.W)}function Bf(a){if(null!==a.dd){if(a.Ni&&null!==a.ui){var b=a.ui;b.h.remove(b.Zd);b.h.remove(b.$d)}a.dd=null;a.ui=null}}function Sf(a,b,c){var d=a.h;if(null!==d){var e=a.$i,g=t.O();g.assign(d.T.W);a.moveParts(b,g.At(e),c);t.B(g)}}
ff.prototype.moveParts=function(a,b,c){if(null!==a&&(t.m(a,sa,ff,"moveParts:parts"),0!==a.count)){var d=t.O(),e=t.O();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);var g=this.rv;g||hf(this,a);for(var h=new H,k=new H(Qa),l=a.k;l.next();){var m=l.key;if(m.Ud()){var n=Tf(this,m,a);if(null!==n)h.add({Jc:m,info:l.value,cI:n});else if(!c||m.canMove()){n=l.value.point;d.assign(n);var p=this.computeMove(m,d.add(e),a);m.location=p;l.value.Zy=p.At(n)}}else l.key instanceof A&&k.add(l.ce)}for(c=h.k;c.next();)h=
c.value,n=h.info.point,d.assign(n),h.Jc.location=d.add(h.cI.Zy);n=t.O();c=t.O();for(k=k.k;k.next();)if(p=k.value,h=p.key,h instanceof A)if(h.Jp)if(l=h.da,m=h.ja,null!==this.dd&&this.Ni)p=p.value.point,a.add(h,wf(e)),l=b.x-p.x,m=b.y-p.y,h.pl(l,m);else{if(null!==l){n.assign(l.location);var q=a.Ba(l);null!==q&&n.At(q.point)}null!==m&&(c.assign(m.location),q=a.Ba(m),null!==q&&c.At(q.point));null!==l&&null!==m?n.Oi(c)?(p=p.value.point,l=d,l.assign(n),l.At(p),a.add(h,wf(n)),h.pl(l.x,l.y)):(h.Jp=!1,h.$b()):
(p=p.value.point,a.add(h,wf(null!==l?n:null!==m?c:b)),l=e.x-p.x,m=e.y-p.y,h.pl(l,m))}else if(null===h.da||null===h.ja)p=p.value.point,a.add(h,wf(b)),l=e.x-p.x,m=e.y-p.y,h.pl(l,m);t.B(d);t.B(e);t.B(n);t.B(c);g||zf(this,a)}};function Tf(a,b,c){b=b.fb;if(null!==b){a=Tf(a,b,c);if(null!==a)return a;a=c.Ba(b);if(null!==a)return a}return null}
function Df(a){if(null!==a.wc){for(var b=a.h,c=a.wc.k;c.next();){var d=c.key;d.Ud()&&(d.location=c.value.point)}for(c=a.wc.k;c.next();)if(d=c.key,d instanceof A&&d.Jp){var e=c.value.point;a.wc.add(d,wf());d.pl(-e.x,-e.y)}b.Fc()}}
ff.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new C);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.bp&&(this.yE||null===c||this.h.T.bj)&&(e=t.O(),c=e,c.assign(b),null!==a)){var g=this.h;if(null!==g){var h=g.Xo,k=this.dA,g=k.width,k=k.height,l=this.jE,m=l.x,l=l.y,n=this.iE;if(null!==h){var p=h.Ms;isNaN(g)&&(g=p.width);isNaN(k)&&(k=p.height);h=h.cA;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=t.ic(0,0);h.xt(0,0,g,k,n);J.Gs(b.x,b.y,m+h.x,l+h.y,g,k,c);t.B(h)}}c=null!==a.Sz?
a.Sz(a,b,e):e;k=a.TE;g=k.x;isNaN(g)&&(g=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.NE;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.q(Math.max(g,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&t.B(e);return d};function Uf(a,b){if(null===b)return!0;var c=b.U;return null===c||c instanceof Ve||c.layer.pc||a.wc&&a.wc.contains(c)||a.pd&&a.pd.contains(c)?!0:!1}
function Vf(a,b,c,d){var e=a.h;if(null!==e){a.Ni&&(null!==a.dd&&(a.dd.da=null,a.dd.ja=null),Wf(a,!1));var g=!1;!1===a.mv&&(g=e.Bb,e.Bb=!0);var h=!1,k=Xf(e,b,null,function(b){return!Uf(a,b)}),l=e.T;l.Yd=k;var m=e.Bb;e.Bb=!0;if(k!==a.Jl){var n=a.Jl;a.bv=n;for(a.Jl=k;null!==n;){var p=n.uA;if(null!==p){if(k===n)break;if(null!==k&&k.Ti(n))break;p(l,n,k);h=!0;if(l.Fe)break}n=n.ga}for(n=a.bv;null!==k;){p=k.UE;if(null!==p){if(n===k)break;if(null!==n&&n.Ti(k))break;p(l,k,n);h=!0;if(l.Fe)break}k=k.ga}k=a.Jl}null===
k&&(p=e.VE,null!==p&&(p(l),h=!0));a.doDragOver(b,k);e.Bb=m;h&&e.Xi();!1===a.mv&&(e.Bb=g);(e.hf||e.jf)&&(c||d)&&Yf(e,b)}}function Zf(a,b,c){var d=a.ui;if(null===d)return null;var e=a.h.Lm(b,d.FA,function(a){return d.findValidLinkablePort(a,c)});a=t.O();for(var g=Infinity,h=null,e=e.k;e.next();){var k=e.value;if(null!==k.U){var l=k.gb(Vb,a),l=b.$j(l);l<g&&(h=k,g=l)}}t.B(a);return h}
function Wf(a,b){var c=a.dd;if(null!==c&&!(2>c.ma)){var d=a.h;if(null!==d&&!d.$a&&(d=a.ui,null!==d)){var e=null,g=null;null===c.da&&(e=Zf(a,c.n(0),!1),null!==e&&(g=e.U));var h=null,k=null;null===c.ja&&(h=Zf(a,c.n(c.ma-1),!0),null!==h&&(k=h.U));if((null===g||g instanceof y)&&(null===k||k instanceof y)){var l=d.isValidLink(g,e,k,h);b?(c.wn=c.n(0).copy(),c.An=c.n(c.ma-1).copy(),c.Jp=!1,c.da=g,null!==e&&(c.nf=e.sd),c.ja=k,null!==h&&(c.Qf=h.sd)):l?$f(d,g,e,k,h):$f(d,null,null,null,null)}}}}
ff.prototype.doDragOver=function(){};function ag(a,b){var c=a.h;if(null!==c&&null!==c.fa){a.Ni&&Wf(a,!0);yf(a);var d=Xf(c,b,null,function(b){return!Uf(a,b)}),e=c.T;e.Yd=d;if(null!==d)for(var g=d;null!==g;){var h=g.bt;if(null!==h&&(h(e,g),e.Fe))break;g=g.ga}else h=c.bt,null!==h&&h(e);a.doDropOnto(b,d);for(d=c.selection.k;d.next();)e=d.value,e instanceof y&&bg(c,e.ya)}}ff.prototype.doDropOnto=function(){};
ff.prototype.doMouseMove=function(){if(this.ra){var a=this.h;if(null!==a&&null!==this.Io&&null!==this.wc){var b=!1,c=!1;this.mayCopy()?(b=!0,Gf(this,!1),Sf(this,this.pd,!0)):this.mayMove()?(c=!0,Cf(this),Sf(this,this.wc,!0)):Cf(this);Vf(this,a.T.W,c,b)}}};
ff.prototype.doMouseUp=function(){if(this.ra){this.vq=!0;var a=this.h;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.pd?(Df(this),Cf(this),Gf(this,!0),Sf(this,this.pd,!0),null!==this.pd&&a.tF(this.pd.Al())):(b=!0,Cf(this),this.mayMove()&&(Sf(this,this.wc,!0),this.mv=!1,Vf(this,a.T.W,!0,!1),this.mv=!0));ag(this,a.T.W);if(this.ra){this.pd=null;if(b&&null!==this.wc)for(b=this.wc.k;b.next();){var d=b.key;d instanceof y&&(d=d.fb,null===d||null===d.placeholder||this.wc.contains(d)||d.Kz&&d.aa())}a.Fc();
zf(this,this.wc);this.bf=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};ff.prototype.mayCopy=function(){var a=this.h;if(null===a||a.$a||a.Ue||!a.vm||!a.Sj||(a.Rl?!a.T.Wm:!a.T.control))return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Ud()&&b.canCopy())return!0}return null!==this.dd&&this.Ni&&this.dd.canCopy()?!0:!1};
ff.prototype.mayMove=function(){var a=this.h;if(null===a||a.$a||!a.al)return!1;for(a=a.selection.k;a.next();){var b=a.value;if(b.Ud()&&b.canMove())return!0}return null!==this.dd&&this.Ni&&this.dd.canMove()?!0:!1};var Af=new H(ff),jf=null,tf=null;ff.prototype.mayCopyExternal=function(){var a=this.h;return null===a||!a.Bz||a.$a||a.Ue||!a.vm||null===a.fa?!1:!0};
ff.prototype.doSimulatedDragEnter=function(){if(this.mayCopyExternal()){var a=jf;if(null!==a){Cf(a);Df(a);var b=a.h;null!==b&&a.no.Q()&&(b.position=a.no);null!==b&&xf(b)}Af.contains(this)||Af.add(this)}};ff.prototype.doSimulatedDragLeave=function(){jf.qw=!1;this.doCancel()};ff.prototype.doSimulatedDragOver=function(){if(this.mayCopyExternal()){var a=this.h;if(null!==a){var b=jf;null!==b&&null!==b.wc&&(cg(this,b.wc.Al(),!1),Sf(this,this.pd,!1),Vf(this,a.T.W,!1,!0))}}};
ff.prototype.doSimulatedDrop=function(){var a=jf;if(null!==a&&(a.vq=!0,Cf(this),this.mayCopyExternal())){var b=this.h;null!==b&&(this.rc("Drop"),cg(this,a.wc.Al(),!0),Sf(this,this.pd,!0),null!==this.pd&&b.tF(this.pd.Al()),this.bf="ExternalCopy",ag(this,b.T.W),this.pd=null,b.Ja("ExternalObjectsDropped",b.selection),this.kk(),b.Fc())}};
function cg(a,b,c){if(null===a.pd){var d=a.h;if(null!==d&&!d.$a&&!d.Ue&&null!==d.fa){d.Bb=!c;a.Yp=!c;a.$i=d.T.W;d=d.copyParts(b,d,!0);c=t.wf();Ff(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;t.Rc(c);var h=a.ov;c=new sa(w,Object);var k=t.O();for(b=b.k;b.next();){var l=b.value;if(l.Ud()&&l.canCopy()){var m=l.location,l=d.Ba(l);k.q(h.x-(e-m.x),h.y-(g-m.y));l.location=k;a.Yp&&(l.Xd="Tool");l.Gf();c.add(l,wf(k))}}t.B(k);for(d=d.k;d.next();)e=d.value,e instanceof A&&e.canCopy()&&c.add(e,wf());a.pd=c;gf(a,
c.Al());null!==a.dd&&(c=a.dd,d=c.pj(),c.pl(a.$i.x-(d.x+d.width/2),a.$i.y-(d.y+d.height/2)))}}}
function dg(){0<arguments.length&&t.l("LinkingBaseTool constructor cannot take any arguments.");le.call(this);this.Ty=100;this.Ay=!1;var a=new A,b=new Y;b.Jh=!0;b.stroke="blue";a.add(b);b=new Y;b.fn="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.Xd="Tool";this.nz=a;a=new y;b=new Y;b.sd="";b.Ib="Rectangle";b.fill=null;b.stroke="magenta";b.ib=2;b.Ca=J.ox;a.add(b);a.jk=!1;a.Xd="Tool";this.lz=a;this.mz=b;a=new y;b=new Y;b.sd="";b.Ib="Rectangle";b.fill=null;b.stroke="magenta";b.ib=2;b.Ca=J.ox;a.add(b);
a.jk=!1;a.Xd="Tool";this.oz=a;this.pz=b;this.Sy=this.Ry=this.My=this.Ly=this.Ny=null;this.iC=!0;this.IG=new sa(X,"boolean");this.FC=this.Nk=this.iz=null}t.ia("LinkingBaseTool",dg);t.Oa(dg,le);dg.prototype.doStop=function(){var a=this.h;null!==a&&xf(a);this.wg=this.vg=this.ug=this.tg=this.fc=null;this.Uw.clear();this.vf=null};t.g(dg,"portGravity",dg.prototype.FA);
t.defineProperty(dg,{FA:"portGravity"},function(){return this.Ty},function(a){this.Ty!==a&&(f&&t.j(a,"number",dg,"portGravity"),0<=a&&(this.Ty=a))});t.g(dg,"isUnconnectedLinkValid",dg.prototype.Qm);t.defineProperty(dg,{Qm:"isUnconnectedLinkValid"},function(){return this.Ay},function(a){this.Ay!==a&&(f&&t.j(a,"boolean",dg,"isUnconnectedLinkValid"),this.Ay=a)});t.g(dg,"temporaryLink",dg.prototype.Pf);
t.defineProperty(dg,{Pf:"temporaryLink"},function(){return this.nz},function(a){this.nz!==a&&(f&&t.m(a,A,dg,"temporaryLink"),this.nz=a)});t.g(dg,"temporaryFromNode",dg.prototype.Zd);t.defineProperty(dg,{Zd:"temporaryFromNode"},function(){return this.lz},function(a){this.lz!==a&&(f&&t.m(a,y,dg,"temporaryFromNode"),this.lz=a)});t.g(dg,"temporaryFromPort",dg.prototype.yl);
t.defineProperty(dg,{yl:"temporaryFromPort"},function(){return this.mz},function(a){this.mz!==a&&(f&&t.m(a,X,dg,"temporaryFromPort"),this.mz=a)});t.g(dg,"temporaryToNode",dg.prototype.$d);t.defineProperty(dg,{$d:"temporaryToNode"},function(){return this.oz},function(a){this.oz!==a&&(f&&t.m(a,y,dg,"temporaryToNode"),this.oz=a)});t.g(dg,"temporaryToPort",dg.prototype.zl);
t.defineProperty(dg,{zl:"temporaryToPort"},function(){return this.pz},function(a){this.pz!==a&&(f&&t.m(a,X,dg,"temporaryToPort"),this.pz=a)});t.g(dg,"originalLink",dg.prototype.fc);t.defineProperty(dg,{fc:"originalLink"},function(){return this.Ny},function(a){this.Ny!==a&&(f&&null!==a&&t.m(a,A,dg,"originalLink"),this.Ny=a)});t.g(dg,"originalFromNode",dg.prototype.tg);
t.defineProperty(dg,{tg:"originalFromNode"},function(){return this.Ly},function(a){this.Ly!==a&&(f&&null!==a&&t.m(a,y,dg,"originalFromNode"),this.Ly=a)});t.g(dg,"originalFromPort",dg.prototype.ug);t.defineProperty(dg,{ug:"originalFromPort"},function(){return this.My},function(a){this.My!==a&&(f&&null!==a&&t.m(a,X,dg,"originalFromPort"),this.My=a)});t.g(dg,"originalToNode",dg.prototype.vg);
t.defineProperty(dg,{vg:"originalToNode"},function(){return this.Ry},function(a){this.Ry!==a&&(f&&null!==a&&t.m(a,y,dg,"originalToNode"),this.Ry=a)});t.g(dg,"originalToPort",dg.prototype.wg);t.defineProperty(dg,{wg:"originalToPort"},function(){return this.Sy},function(a){this.Sy!==a&&(f&&null!==a&&t.m(a,X,dg,"originalToPort"),this.Sy=a)});t.defineProperty(dg,{Td:"isForwards"},function(){return this.iC},function(a){this.iC=a});t.A(dg,{Uw:"validPortsCache"},function(){return this.IG});
t.g(dg,"targetPort",dg.prototype.vf);t.defineProperty(dg,{vf:"targetPort"},function(){return this.iz},function(a){this.iz!==a&&(f&&null!==a&&t.m(a,X,dg,"targetPort"),this.iz=a)});dg.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Ca=b.ya.size;e?(d.mb=b.mb,d.mk=b.mk):(d.lb=b.lb,d.ek=b.ek);c.We=Vb;var g=t.O();c.location=b.gb(Vb,g);t.B(g);d.angle=b.jl();null!==this.mt&&this.mt(a,b,c,d,e)}};
dg.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Ca=J.ox,b.lb=Pb,b.mb=Pb);null!==a&&(a.location=this.h.T.W);null!==this.mt&&this.mt(null,null,a,b,c)};dg.prototype.doMouseDown=function(){this.ra&&this.doMouseMove()};
dg.prototype.doMouseMove=function(){if(this.ra){var a=this.h;if(null!==a){this.vf=this.findTargetPort(this.Td);if(null!==this.vf){var b=this.vf.U;if(b instanceof y){this.Td?this.copyPortProperties(b,this.vf,this.$d,this.zl,!0):this.copyPortProperties(b,this.vf,this.Zd,this.yl,!1);return}}this.Td?this.setNoTargetPortProperties(this.$d,this.zl,!0):this.setNoTargetPortProperties(this.Zd,this.yl,!1);(a.hf||a.jf)&&Yf(a,a.T.W)}}};
dg.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.U;if(!(c instanceof y))return null;for(;null!==a;){var d=b?a.kB:a.$z;if(!0===d&&(null!==a.sd||a instanceof y)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.ga}return null};
dg.prototype.findTargetPort=function(a){var b=this.h,c=b.T.W,d=this.FA;0>=d&&(d=0.1);for(var e=this,g=b.Lm(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.k;g.next();){var h=g.value,k=h.U;if(k instanceof y){var l=h.gb(Vb,t.O()),m=c.x-l.x,n=c.y-l.y;t.B(l);l=m*m+n*n;l<d&&(m=this.Uw.Ba(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.tg,this.ug,k,h)||!a&&this.isValidLink(k,h,this.vg,this.wg)?(this.Uw.add(h,!0),b=h,d=l):this.Uw.add(h,!1))}}return null!==b&&(c=b.U,
c instanceof y&&(null===c.layer||c.layer.wm))?b:null};dg.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Qm;if(this.h.Za===this&&(null!==a.layer&&!a.layer.wm||!0!==b.$z))return!1;var c=b.dE;if(Infinity>c){if(null!==this.fc&&a===this.tg&&b===this.ug)return!0;var d=b.sd;null===d&&(d="");if(a.fw(d).count>=c)return!1}return!0};
dg.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Qm;if(this.h.Za===this&&(null!==a.layer&&!a.layer.wm||!0!==b.kB))return!1;var c=b.NF;if(Infinity>c){if(null!==this.fc&&a===this.vg&&b===this.wg)return!0;var d=b.sd;null===d&&(d="");if(a.mg(d).count>=c)return!1}return!0};dg.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.U,d=b.U;return null!==c&&c===d};
dg.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.U;if(!(c instanceof y))return!1;var d=a.sd;null===d&&(d="");var e=b.U;if(!(e instanceof y))return!1;var g=b.sd;null===g&&(g="");for(e=e.mg(g);e.next();)if(g=e.value,g.da===c&&g.nf===d)return!0;return!1};
dg.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.cE&&d.MF||!this.isInSameNode(b,d))&&(b.bE&&d.LF||!this.isLinked(b,d)))||null!==this.fc&&(null!==a&&eg(this,a,this.fc)||null!==c&&eg(this,c,this.fc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!og(this,a,c,this.fc))return!1;if(null!==a){var e=a.np;if(null!==e&&!e(a,b,c,d,this.fc))return!1}if(null!==c&&(e=c.np,null!==e&&!e(a,b,c,d,this.fc)))return!1;
e=this.np;return null!==e?e(a,b,c,d,this.fc):!0};function eg(a,b,c){if(null===b)return!1;var d=b.Tc;if(null===d)return!1;if(d===c)return!0;var e=new ua(y);e.add(b);return pg(a,d,c,e)}function pg(a,b,c,d){if(b===c)return!0;var e=b.da;if(null!==e&&e.Ih&&(d.add(e),pg(a,e.Tc,c,d)))return!0;b=b.ja;return null!==b&&b.Ih&&(d.add(b),pg(a,b.Tc,c,d))?!0:!1}
function og(a,b,c,d){if(null===b||null===c)return a.Qm;var e=a.h.aG;if(e!==qg){if(e===rg){if(null!==d&&!d.xc)return!0;for(e=c.Dd;e.next();){var g=e.value;if(g!==d&&g.xc&&g.ja===c)return!1}return!sg(a,b,c,d,!0)}if(e===tg){if(null!==d&&!d.xc)return!0;for(e=b.Dd;e.next();)if(g=e.value,g!==d&&g.xc&&g.da===b)return!1;return!sg(a,b,c,d,!0)}if(e===ug)return b===c?a=!0:(e=new ua(y),e.add(c),a=vg(a,e,b,c,d)),!a;if(e===wg)return!sg(a,b,c,d,!1);if(e===xg)return b===c?a=!0:(e=new ua(y),e.add(c),a=yg(a,e,b,c,
d)),!a}return!0}function sg(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.Dd;g.next();){var h=g.value;if(h!==d&&(!e||h.xc)&&h.ja===b&&(h=h.da,h!==b&&sg(a,h,c,d,e)))return!0}return!1}function vg(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Dd;g.next();){var h=g.value;if(h!==e&&h.ja===c&&(h=h.da,h!==c&&vg(a,b,h,d,e)))return!0}return!1}
function yg(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var g=c.Dd;g.next();){var h=g.value;if(h!==e){var k=h.da,h=h.ja,k=k===c?h:k;if(k!==c&&yg(a,b,k,d,e))return!0}}return!1}t.g(dg,"linkValidation",dg.prototype.np);t.defineProperty(dg,{np:"linkValidation"},function(){return this.Nk},function(a){null!==a&&t.j(a,"function",dg,"linkValidation");this.Nk=a});t.g(dg,"portTargeted",dg.prototype.mt);
t.defineProperty(dg,{mt:"portTargeted"},function(){return this.FC},function(a){null!==a&&t.j(a,"function",dg,"portTargeted");this.FC=a});function za(){0<arguments.length&&t.l("LinkingTool constructor cannot take any arguments.");dg.call(this);this.name="Linking";this.Vt={};this.Ut=null;this.sa=zg;this.dz=this.cz=null}t.ia("LinkingTool",za);t.Oa(za,dg);var zg;za.Either=zg=t.w(za,"Either",0);var Ag;za.ForwardsOnly=Ag=t.w(za,"ForwardsOnly",0);var Bg;za.BackwardsOnly=Bg=t.w(za,"BackwardsOnly",0);
t.g(za,"archetypeLinkData",za.prototype.fD);t.defineProperty(za,{fD:"archetypeLinkData"},function(){return this.Vt},function(a){this.Vt!==a&&(null!==a&&t.m(a,Object,za,"archetypeLinkData"),a instanceof X&&t.m(a,A,za,"archetypeLinkData"),this.Vt=a)});t.g(za,"archetypeLabelNodeData",za.prototype.Fz);
t.defineProperty(za,{Fz:"archetypeLabelNodeData"},function(){return this.Ut},function(a){this.Ut!==a&&(null!==a&&t.m(a,Object,za,"archetypeLabelNodeData"),a instanceof X&&t.m(a,y,za,"archetypeLabelNodeData"),this.Ut=a)});t.g(za,"direction",za.prototype.direction);t.defineProperty(za,{direction:"direction"},function(){return this.sa},function(a){this.sa!==a&&(f&&t.tb(a,za,za,"direction"),this.sa=a)});t.g(za,"startObject",za.prototype.fB);
t.defineProperty(za,{fB:"startObject"},function(){return this.cz},function(a){this.cz!==a&&(f&&null!==a&&t.m(a,X,za,"startObject"),this.cz=a)});t.A(za,{Qw:"startPort"},function(){return this.dz});za.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.$a||a.Ue||!a.wm)return!1;var b=a.fa;return null!==b&&(b instanceof U||b instanceof Sd)&&a.T.left&&(a.Za===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
za.prototype.findLinkablePort=function(){var a=this.h;if(null===a)return null;var b=this.fB;null===b&&(b=a.Rd(a.Ec.W,null,null));if(null===b||!(b.U instanceof y))return null;var c=this.direction;if(c===zg||c===Ag)if(a=this.findValidLinkablePort(b,!1),null!==a)return this.Td=!0,a;if(c===zg||c===Bg)if(a=this.findValidLinkablePort(b,!0),null!==a)return this.Td=!1,a;return null};
za.prototype.doActivate=function(){var a=this.h;if(null!==a&&(null===this.Qw&&(this.dz=this.findLinkablePort()),null!==this.Qw)){this.rc(this.name);a.Bd=!0;a.cd="pointer";if(this.Td){this.ug=this.Qw;var b=this.ug.U;b instanceof y&&(this.tg=b);this.copyPortProperties(this.tg,this.ug,this.Zd,this.yl,!1)}else this.wg=this.Qw,b=this.wg.U,b instanceof y&&(this.vg=b),this.copyPortProperties(this.vg,this.wg,this.$d,this.zl,!0);a.add(this.Zd);a.add(this.$d);null!==this.Pf&&(null!==this.Zd&&(this.Pf.da=this.Zd),
null!==this.$d&&(this.Pf.ja=this.$d),this.Pf.$b(),a.add(this.Pf));this.ra=!0}};za.prototype.doDeactivate=function(){this.ra=!1;var a=this.h;null!==a&&(a.remove(this.Pf),a.remove(this.Zd),a.remove(this.$d),a.Bd=!1,a.cd="",this.kk())};za.prototype.doStop=function(){dg.prototype.doStop.call(this);this.fB=this.dz=null};
za.prototype.doMouseUp=function(){if(this.ra){var a=this.h;if(null===a)return;var b=this.bf=null,c=null,d=null,e=null,g=this.vf=this.findTargetPort(this.Td),h=null;null!==g?(h=g.U,h instanceof y&&(this.Td?(null!==this.tg&&(b=this.tg,c=this.ug),d=h,e=g):(b=h,c=g,null!==this.vg&&(d=this.vg,e=this.wg)))):this.Td?null!==this.tg&&this.Qm&&(b=this.tg,c=this.ug):null!==this.vg&&this.Qm&&(d=this.vg,e=this.wg);if(null!==b||null!==d)b=this.insertLink(b,c,d,e),null!==b?(null===g&&(this.Td?b.An=a.T.W.copy():
b.wn=a.T.W.copy()),a.Ne&&a.select(b),this.bf=this.name,a.Ja("LinkDrawn",b)):a.fa.oD()}this.stopTool()};
za.prototype.insertLink=function(a,b,c,d){var e=this.h;if(null===e)return null;var g=e.fa;if(null===g)return null;if(g instanceof Sd){var h=a;b=c;e.fd||(h=c,b=a);if(null!==h&&null!==b)return g.Ph(b.data,g.Nb(h.data)),b.Js()}else if(g instanceof U)if(h="",null!==a&&(null===b&&(b=a),h=b.sd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.sd,null===b&&(b="")),d=this.fD,d instanceof A){if(Xe(d),g=d.copy(),g instanceof A)return g.da=a,g.nf=h,g.ja=c,g.Qf=b,e.add(g),a=this.Fz,a instanceof y&&(Xe(a),
a=a.copy(),a instanceof y&&(a.Tc=g,e.add(a))),g}else if(null!==d&&(d=g.zD(d),t.pb(d)))return null!==a&&g.YA(d,g.Nb(a.data)),g.ZA(d,h),null!==c&&g.cB(d,g.Nb(c.data)),g.dB(d,b),g.Dv(d),a=this.Fz,null===a||a instanceof y||(a=g.Xj(a),t.pb(a)&&(g.um(a),a=g.Nb(a),void 0!==a&&g.cD(d,a))),g=e.Hf(d);return null};
function uf(){0<arguments.length&&t.l("RelinkingTool constructor cannot take any arguments.");dg.call(this);this.name="Relinking";var a=new Y;a.Ib="Diamond";a.Ca=J.hx;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.tf=0;this.aC=a;a=new Y;a.Ib="Diamond";a.Ca=J.hx;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.tf=-1;this.SC=a;this.Xb=null;this.CC=new D}t.ia("RelinkingTool",uf);t.Oa(uf,dg);
uf.prototype.updateAdornments=function(a){if(null!==a&&a instanceof A){var b="RelinkFrom",c=null;if(a.bb&&!this.h.$a){var d=a.an;null!==d&&a.canRelinkFrom()&&a.ya.Q()&&a.zb()&&d.ya.Q()&&d.ol()&&(c=a.Mo(b),null===c&&(c=this.makeAdornment(d,!1),c.Qc=b,c.nl=!0),null!==c&&(c.aa(),a.Xk(b,c)))}null===c&&a.tl(b);b="RelinkTo";c=null;a.bb&&!this.h.$a&&(d=a.an,null!==d&&a.canRelinkTo()&&a.ya.Q()&&a.zb()&&d.ya.Q()&&d.ol()&&(c=a.Mo(b),null===c&&(c=this.makeAdornment(d,!0),c.Qc=b,c.nl=!0),null!==c&&(c.aa(),a.Xk(b,
c))));null===c&&a.tl(b)}};uf.prototype.makeAdornment=function(a,b){var c=new Ve;c.type=Cg;var d=b?this.kJ:this.YH;null!==d&&c.add(d.copy());c.Pc=a;return c};t.defineProperty(uf,{YH:"fromHandleArchetype"},function(){return this.aC},function(a){a&&t.m(a,X,uf,"fromHandleArchetype");this.aC=a});t.defineProperty(uf,{kJ:"toHandleArchetype"},function(){return this.SC},function(a){a&&t.m(a,X,uf,"toHandleArchetype");this.SC=a});t.A(uf,{handle:"handle"},function(){return this.Xb});
uf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.$a||a.Ue||!a.Tj)return!1;var b=a.fa;if(null===b||!(b instanceof U||b instanceof Sd)||!a.T.left)return!1;b=this.findToolHandleAt(a.Ec.W,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Ec.W,"RelinkTo"));return null!==b};
uf.prototype.doActivate=function(){var a=this.h;if(null!==a){if(null===this.fc){var b=this.findToolHandleAt(a.Ec.W,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Ec.W,"RelinkTo"));if(null===b)return;var c=b.U;if(!(c instanceof Ve&&c.Dh instanceof A))return;this.Xb=b;this.Td=null===c||"RelinkTo"===c.Qc;this.fc=c.Dh}this.rc(this.name);a.Bd=!0;a.cd="pointer";this.ug=this.fc.Sc;this.tg=this.fc.da;this.wg=this.fc.Ed;this.vg=this.fc.ja;this.CC.set(this.fc.ya);null!==this.fc&&0<this.fc.ma&&(null===this.fc.da&&
(null!==this.yl&&(this.yl.Ca=J.kn),null!==this.Zd&&(this.Zd.location=this.fc.n(0))),null===this.fc.ja&&(null!==this.zl&&(this.zl.Ca=J.kn),null!==this.$d&&(this.$d.location=this.fc.n(this.fc.ma-1))));this.copyPortProperties(this.tg,this.ug,this.Zd,this.yl,!1);this.copyPortProperties(this.vg,this.wg,this.$d,this.zl,!0);a.add(this.Zd);a.add(this.$d);null!==this.Pf&&(null!==this.Zd&&(this.Pf.da=this.Zd),null!==this.$d&&(this.Pf.ja=this.$d),this.copyLinkProperties(this.fc,this.Pf),this.Pf.$b(),a.add(this.Pf));
this.ra=!0}};uf.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.wo=a.wo;b.Wv=a.Wv;var c=a.Ee;if(c===Gg||c===Hg)c=Ig;b.Ee=c;b.Cs=a.Cs;b.st=a.st;b.dn=a.dn;b.lb=a.lb;b.ek=a.ek;b.Ro=a.Ro;b.So=a.So;b.mb=a.mb;b.mk=a.mk;b.Kp=a.Kp;b.Lp=a.Lp}};uf.prototype.doDeactivate=function(){this.ra=!1;var a=this.h;null!==a&&(a.remove(this.Pf),a.remove(this.Zd),a.remove(this.$d),a.Bd=!1,a.cd="",this.kk())};uf.prototype.doStop=function(){dg.prototype.doStop.call(this);this.Xb=null};
uf.prototype.doMouseUp=function(){if(this.ra){var a=this.h;if(null===a)return;this.bf=null;var b=this.tg,c=this.ug,d=this.vg,e=this.wg,g=this.fc;this.vf=this.findTargetPort(this.Td);if(null!==this.vf){var h=this.vf.U;h instanceof y&&(this.Td?(d=h,e=this.vf):(b=h,c=this.vf))}else this.Qm?this.Td?e=d=null:c=b=null:g=null;null!==g&&(this.reconnectLink(g,this.Td?d:b,this.Td?e:c,this.Td),null===this.vf&&(this.Td?g.An=a.T.W.copy():g.wn=a.T.W.copy(),g.$b()),a.Ne&&(g.bb=!0),this.bf=this.name,a.Ja("LinkRelinked",
g,this.Td?this.wg:this.ug));Jg(this.fc,this.CC)}this.stopTool()};uf.prototype.reconnectLink=function(a,b,c,d){if(null===this.h)return!1;c=null!==c&&null!==c.sd?c.sd:"";d?(a.ja=b,a.Qf=c):(a.da=b,a.nf=c);return!0};function $f(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.Zd,a.yl,!1),a.h.add(a.Zd)):a.h.remove(a.Zd);null!==d?(a.copyPortProperties(d,e,a.$d,a.zl,!0),a.h.add(a.$d)):a.h.remove(a.$d)}
function Kg(){0<arguments.length&&t.l("LinkReshapingTool constructor cannot take any arguments.");le.call(this);this.name="LinkReshaping";var a=new Y;a.Ib="Rectangle";a.Ca=J.Rp;a.fill="lightblue";a.stroke="dodgerblue";this.Hk=a;a=new Y;a.Ib="Diamond";a.Ca=J.Rp;a.fill="lightblue";a.stroke="dodgerblue";this.rC=a;this.HC=3;this.Bx=this.Xb=null;this.DC=new C;this.Py=null}t.ia("LinkReshapingTool",Kg);t.Oa(Kg,le);var Lg;Kg.None=Lg=t.w(Kg,"None",0);var Mg;Kg.Horizontal=Mg=t.w(Kg,"Horizontal",1);var Ng;
Kg.Vertical=Ng=t.w(Kg,"Vertical",2);var Og;Kg.All=Og=t.w(Kg,"All",3);function Pg(a,b){t.m(a,X,Kg,"setReshapingBehavior:obj");t.tb(b,Kg,Kg,"setReshapingBehavior:behavior");a.cv=b}
Kg.prototype.updateAdornments=function(a){if(null!==a&&a instanceof A){if(a.bb&&!this.h.$a){var b=a.path;if(null!==b&&a.canReshape()&&a.ya.Q()&&a.zb()&&b.ya.Q()&&b.ol()){var c=a.Mo(this.name);if(null===c||c.BG!==a.ma||c.KG!==a.xp)c=this.makeAdornment(b),c.nl=!0,c.BG=a.ma,c.KG=a.xp;if(null!==c){c.location=a.position;c.aa();a.Xk(this.name,c);return}}}a.tl(this.name)}};
Kg.prototype.makeAdornment=function(a){var b=a.U,c=b.ma,d=b.ac,e=null;if(null!==b.points&&1<c){e=new Ve;e.type=Cg;var c=b.Ks,g=b.ww,h=d?1:0;if(b.xp&&b.Ee!==Qg)for(var k=c+h;k<g-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.tf=k,l.tt=0.5,e.add(l))}for(k=c+1;k<g;k++)if(l=this.makeHandle(a,k),null!==l){l.tf=k;if(k!==c)if(k===c+1&&d){var h=b.n(c),m=b.n(c+1);J.I(h.x,m.x)&&J.I(h.y,m.y)&&(m=b.n(c-1));J.I(h.x,m.x)?(Pg(l,Ng),l.cursor="n-resize"):J.I(h.y,m.y)&&(Pg(l,Mg),l.cursor="w-resize")}else k===
g-1&&d?(h=b.n(g-1),m=b.n(g),J.I(h.x,m.x)&&J.I(h.y,m.y)&&(h=b.n(g+1)),J.I(h.x,m.x)?(Pg(l,Ng),l.cursor="n-resize"):J.I(h.y,m.y)&&(Pg(l,Mg),l.cursor="w-resize")):k!==g&&(Pg(l,Og),l.cursor="move");e.add(l)}e.Qc=this.name;e.Pc=a}return e};Kg.prototype.makeHandle=function(){var a=this.Ns;return null===a?null:a.copy()};t.defineProperty(Kg,{Ns:"handleArchetype"},function(){return this.Hk},function(a){a&&t.m(a,X,Kg,"handleArchetype");this.Hk=a});
Kg.prototype.makeResegmentHandle=function(){var a=this.DI;return null===a?null:a.copy()};t.defineProperty(Kg,{DI:"midHandleArchetype"},function(){return this.rC},function(a){a&&t.m(a,X,Kg,"midHandleArchetype");this.rC=a});t.A(Kg,{handle:"handle"},function(){return this.Xb});t.A(Kg,{ss:"adornedLink"},function(){return this.Bx});Kg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.$a&&a.yo&&a.T.left?null!==this.findToolHandleAt(a.Ec.W,this.name):!1};
Kg.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.Xb=this.findToolHandleAt(a.Ec.W,this.name),null!==this.Xb)){var b=this.Xb.U.Dh;if(b instanceof A){this.Bx=b;a.Bd=!0;this.rc(this.name);if(b.xp&&0.5===this.Xb.tt){var c=b.points.copy(),d=this.Xb.gb(Vb);c.Ad(this.Xb.tf+1,d);b.ac&&c.Ad(this.Xb.tf+1,d);b.points=c;b.Ae();b.updateAdornments();this.Xb=this.findToolHandleAt(a.Ec.W,this.name)}this.DC=b.n(this.Xb.tf);this.Py=b.points.copy();this.ra=!0}}};
Kg.prototype.doDeactivate=function(){this.kk();this.Bx=this.Xb=null;var a=this.h;null!==a&&(a.Bd=!1);this.ra=!1};Kg.prototype.doCancel=function(){var a=this.ss;null!==a&&(a.points=this.Py);this.stopTool()};Kg.prototype.doMouseMove=function(){var a=this.h;this.ra&&null!==a&&(a=this.computeReshape(a.T.W),this.reshape(a))};
Kg.prototype.doMouseUp=function(){var a=this.h;if(this.ra&&null!==a){var b=this.computeReshape(a.T.W);this.reshape(b);b=this.ss;if(null!==b&&b.xp){var c=this.handle.tf,d=b.n(c-1),e=b.n(c),g=b.n(c+1);if(b.ac){if(c>b.Ks+1&&c<b.ww-1){var h=b.n(c-2);if(Math.abs(d.x-e.x)<this.Oh&&Math.abs(d.y-e.y)<this.Oh&&(Rg(this,h,d,e,g,!0)||Rg(this,h,d,e,g,!1))){var k=b.points.copy();Rg(this,h,d,e,g,!0)?(k.xg(c-2,new C(h.x,(g.y+h.y)/2)),k.xg(c+1,new C(g.x,(g.y+h.y)/2))):(k.xg(c-2,new C((g.x+h.x)/2,h.y)),k.xg(c+1,new C((g.x+
h.x)/2,g.y)));k.gd(c);k.gd(c-1);b.points=k;b.Ae();b.updateAdornments()}else h=b.n(c+2),Math.abs(e.x-g.x)<this.Oh&&Math.abs(e.y-g.y)<this.Oh&&(Rg(this,d,e,g,h,!0)||Rg(this,d,e,g,h,!1))&&(k=b.points.copy(),Rg(this,d,e,g,h,!0)?(k.xg(c-1,new C(d.x,(d.y+h.y)/2)),k.xg(c+2,new C(h.x,(d.y+h.y)/2))):(k.xg(c-1,new C((d.x+h.x)/2,d.y)),k.xg(c+2,new C((d.x+h.x)/2,h.y))),k.gd(c+1),k.gd(c),b.points=k,b.Ae(),b.updateAdornments())}}else h=t.O(),J.Ym(d.x,d.y,g.x,g.y,e.x,e.y,h)&&9>h.$j(e)&&(k=b.points.copy(),k.gd(c),
b.points=k,b.Ae(),b.updateAdornments()),t.B(h)}a.Fc();this.bf=this.name;a.Ja("LinkReshaped",this.ss)}this.stopTool()};function Rg(a,b,c,d,e,g){return g?Math.abs(b.y-c.y)<a.Oh&&Math.abs(c.y-d.y)<a.Oh&&Math.abs(d.y-e.y)<a.Oh:Math.abs(b.x-c.x)<a.Oh&&Math.abs(c.x-d.x)<a.Oh&&Math.abs(d.x-e.x)<a.Oh}t.g(Kg,"resegmentingDistance",Kg.prototype.Oh);t.defineProperty(Kg,{Oh:"resegmentingDistance"},function(){return this.HC},function(a){this.HC=a});
Kg.prototype.reshape=function(a){var b=this.ss;b.wl();var c=this.handle.tf,d=this.handle&&this.handle.cv?this.handle.cv:Lg;if(b.ac)if(c===b.Ks+1)c=b.Ks+1,d===Ng?(b.Y(c,b.n(c-1).x,a.y),b.Y(c+1,b.n(c+2).x,a.y)):d===Mg&&(b.Y(c,a.x,b.n(c-1).y),b.Y(c+1,a.x,b.n(c+2).y));else if(c===b.ww-1)c=b.ww-1,d===Ng?(b.Y(c-1,b.n(c-2).x,a.y),b.Y(c,b.n(c+1).x,a.y)):d===Mg&&(b.Y(c-1,a.x,b.n(c-2).y),b.Y(c,a.x,b.n(c+1).y));else{var d=c,e=b.n(d),g=b.n(d-1),h=b.n(d+1);J.I(g.x,e.x)&&J.I(e.y,h.y)?(J.I(g.x,b.n(d-2).x)&&!J.I(g.y,
b.n(d-2).y)?(b.C(d,a.x,g.y),c++,d++):b.Y(d-1,a.x,g.y),J.I(h.y,b.n(d+2).y)&&!J.I(h.x,b.n(d+2).x)?b.C(d+1,h.x,a.y):b.Y(d+1,h.x,a.y)):J.I(g.y,e.y)&&J.I(e.x,h.x)?(J.I(g.y,b.n(d-2).y)&&!J.I(g.x,b.n(d-2).x)?(b.C(d,g.x,a.y),c++,d++):b.Y(d-1,g.x,a.y),J.I(h.x,b.n(d+2).x)&&!J.I(h.y,b.n(d+2).y)?b.C(d+1,a.x,h.y):b.Y(d+1,a.x,h.y)):J.I(g.x,e.x)&&J.I(e.x,h.x)?(J.I(g.x,b.n(d-2).x)&&!J.I(g.y,b.n(d-2).y)?(b.C(d,a.x,g.y),c++,d++):b.Y(d-1,a.x,g.y),J.I(h.x,b.n(d+2).x)&&!J.I(h.y,b.n(d+2).y)?b.C(d+1,a.x,h.y):b.Y(d+1,a.x,
h.y)):J.I(g.y,e.y)&&J.I(e.y,h.y)&&(J.I(g.y,b.n(d-2).y)&&!J.I(g.x,b.n(d-2).x)?(b.C(d,g.x,a.y),c++,d++):b.Y(d-1,g.x,a.y),J.I(h.y,b.n(d+2).y)&&!J.I(h.x,b.n(d+2).x)?b.C(d+1,h.x,a.y):b.Y(d+1,h.x,a.y));b.Y(c,a.x,a.y)}else b.Y(c,a.x,a.y),1===c&&b.computeSpot(!0).qd()&&(e=b.da,g=b.Sc,d=g.gb(Vb,t.O()),e=b.getLinkPointFromPoint(e,g,d,a,!0,t.O()),b.Y(0,e.x,e.y),t.B(d),t.B(e)),c===b.ma-2&&b.computeSpot(!1).qd()&&(c=b.ja,e=b.Ed,d=e.gb(Vb,t.O()),e=b.getLinkPointFromPoint(c,e,d,a,!1,t.O()),b.Y(b.ma-1,e.x,e.y),t.B(d),
t.B(e));b.Ii()};Kg.prototype.computeReshape=function(a){var b=this.ss,c=this.handle.tf;switch(this.handle&&this.handle.cv?this.handle.cv:Lg){case Og:return a;case Ng:return b=b.n(c),new C(b.x,a.y);case Mg:return b=b.n(c),new C(a.x,b.y);default:case Lg:return b.n(c)}};t.g(Kg,"originalPoint",Kg.prototype.NI);t.A(Kg,{NI:"originalPoint"},function(){return this.DC});t.g(Kg,"originalPoints",Kg.prototype.OI);t.A(Kg,{OI:"originalPoints"},function(){return this.Py});
function Sg(){0<arguments.length&&t.l("ResizingTool constructor cannot take any arguments.");le.call(this);this.name="Resizing";this.de=(new pa(1,1)).freeze();this.Aj=(new pa(9999,9999)).freeze();this.fj=(new pa(NaN,NaN)).freeze();this.Ql=!1;this.La=null;var a=new Y;a.Rj=Vb;a.Ib="Rectangle";a.Ca=J.Rp;a.fill="lightblue";a.stroke="dodgerblue";a.ib=1;a.cursor="pointer";this.Hk=a;this.Xb=null;this.co=0;this.CG=new D;this.Yu=new pa;this.Oy=new C;this.gy=new pa(0,0);this.ey=new pa(Infinity,Infinity);this.by=
new pa(1,1)}t.ia("ResizingTool",Sg);t.Oa(Sg,le);Sg.prototype.updateAdornments=function(a){if(!(null===a||a instanceof A)){if(a.bb&&!this.h.$a){var b=a.jF;if(null!==b&&a.canResize()&&a.ya.Q()&&a.zb()&&b.ya.Q()&&b.ol()){var c=a.Mo(this.name);null===c&&(c=this.makeAdornment(b),c.nl=!0);if(null!==c){var d=b.jl();c.angle=d;var e=b.gb(c.We,t.O()),g=b.fk();c.location=e;t.B(e);e=c.placeholder;if(null!==e){var b=b.Ia,h=t.xl();h.q(b.width*g,b.height*g);e.Ca=h;t.dk(h)}Tg(this,c,d);a.Xk(this.name,c);return}}}a.tl(this.name)}};
Sg.prototype.makeAdornment=function(a){var b=null,b=a.U.hF;if(null===b){b=new Ve;b.type=Ug;b.We=Vb;var c=new Vg;c.Jh=!0;b.add(c);b.add(this.makeHandle(a,Sb));b.add(this.makeHandle(a,Ub));b.add(this.makeHandle(a,$b));b.add(this.makeHandle(a,Wb));b.add(this.makeHandle(a,ac));b.add(this.makeHandle(a,cc));b.add(this.makeHandle(a,dc));b.add(this.makeHandle(a,bc))}else if(Xe(b),b=b.copy(),!(b instanceof Ve))return null;b.Qc=this.name;b.Pc=a;return b};
Sg.prototype.makeHandle=function(a,b){var c=this.Ns;if(null===c)return null;c=c.copy();c.alignment=b;return c};
function Tg(a,b,c){if(null!==b)if(!b.alignment.Gc()&&""!==b.cursor)a:{a=b.alignment;a.qd()&&(a=Vb);if(0>=a.x)c=0>=a.y?c+225:1<=a.y?c+135:c+180;else if(1<=a.x)0>=a.y?c+=315:1<=a.y&&(c+=45);else if(0>=a.y)c+=270;else if(1<=a.y)c+=90;else break a;0>c?c+=360:360<=c&&(c-=360);b.cursor=22.5>c?"e-resize":67.5>c?"se-resize":112.5>c?"s-resize":157.5>c?"sw-resize":202.5>c?"w-resize":247.5>c?"nw-resize":292.5>c?"n-resize":337.5>c?"ne-resize":"e-resize"}else if(b instanceof B)for(b=b.elements;b.next();)Tg(a,
b.value,c)}t.defineProperty(Sg,{Ns:"handleArchetype"},function(){return this.Hk},function(a){a&&t.m(a,X,Sg,"handleArchetype");this.Hk=a});t.A(Sg,{handle:"handle"},function(){return this.Xb});t.defineProperty(Sg,{Pc:"adornedObject"},function(){return this.La},function(a){a&&t.m(a,X,Sg,"adornedObject");this.La=a});Sg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.$a&&a.zo&&a.T.left?null!==this.findToolHandleAt(a.Ec.W,this.name)?!0:!1:!1};
Sg.prototype.doActivate=function(){var a=this.h;null!==a&&(this.Xb=this.findToolHandleAt(a.Ec.W,this.name),null!==this.Xb&&(this.La=this.Xb.U.Pc,this.co=this.La.angle,this.CG.set(this.La.Ia),this.Oy.set(this.La.U.location),this.Yu.set(this.La.Ca),this.by=this.computeCellSize(),this.gy=this.computeMinSize(),this.ey=this.computeMaxSize(),a.Bd=!0,this.rc(this.name),this.ra=!0))};Sg.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.kk(),this.La=this.Xb=null,this.ra=a.Bd=!1)};
Sg.prototype.doCancel=function(){this.La.Ca=this.Yu;this.La.U.location=this.Oy;this.stopTool()};Sg.prototype.doMouseMove=function(){var a=this.h;if(this.ra&&null!==a){var b=this.gy,c=this.ey,d=this.by,e=this.La.gE(a.T.W,t.O()),g=Wg;this.La instanceof Y&&(g=this.La.kw,g===Xg&&(g=this.La.Ra.kc));b=this.computeResize(e,this.Xb.alignment,b,c,d,!(g===Yg||g===Zg||a.T.shift));this.resize(b);a.Xi();t.B(e)}};
Sg.prototype.doMouseUp=function(){var a=this.h;if(this.ra&&null!==a){var b=this.gy,c=this.ey,d=this.by,e=this.La.gE(a.T.W,t.O()),g=Wg;this.La instanceof Y&&(g=this.La.kw,g===Xg&&(g=this.La.Ra.kc));b=this.computeResize(e,this.Xb.alignment,b,c,d,!(g===Yg||g===Zg||a.T.shift));this.resize(b);t.B(e);a.Fc();this.bf=this.name;a.Ja("PartResized",this.La,this.Yu)}this.stopTool()};
Sg.prototype.resize=function(a){if(null!==this.h){var b=this.La.U,c=b.position.copy(),d=this.La.Ia.copy(),e=this.La.jl(),g=this.La.fk();360<=e?e-=360:0>e&&(e+=360);var h=Math.PI*e/180,k=Math.cos(h),h=Math.sin(h),l=a.width-d.width,d=a.height-d.height,m=90<e&&270>e?1:0;c.x+=g*((a.x+l*m)*k-(a.y+d*(0<e&&180>e?1:0))*h);c.y+=g*((a.x+l*(180<e&&360>e?1:0))*h+(a.y+d*m)*k);this.La.Ca=a.size;b.Gf();b.move(c)}};
Sg.prototype.computeResize=function(a,b,c,d,e,g){b.qd()&&(b=Vb);var h=this.La.Ia,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=t.O();J.Gs(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):
(a.width=a.height/p,a.x=m-a.width))):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(b=a.height/a.width,p<b?a.height=p*a.width:(a.width=a.height/p,a.x=m-a.width))):(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,g||(a.height=p*a.width,a.y=l+0.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,
n-c.height),a.height=Math.max(n-a.y,c.height),g||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):a.width=a.height/p)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(b=a.height/a.width,p<b?a.height=p*a.width:a.width=a.height/p)):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),g||(a.height=p*a.width,a.y=l+0.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,g||(a.width=
a.height/p,a.x=k+0.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),g||(a.width=a.height/p,a.x=k+0.5*(m-k-a.width)));t.B(q);return a};Sg.prototype.computeMinSize=function(){var a=this.La.Ye.copy(),b=this.Ye;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
Sg.prototype.computeMaxSize=function(){var a=this.La.He.copy(),b=this.He;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
Sg.prototype.computeCellSize=function(){var a=new pa(NaN,NaN),b=this.La.U;if(b){var c=b.iF;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.bl;isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width);isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height);b=this.h;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.Db.ke,null!==c&&c.bp&&(c=c.dA,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&
0<c.height&&(a.height=c.height)),b=b.Xo,null!==b&&b.visible&&this.bp&&(c=b.Ms,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a};t.g(Sg,"minSize",Sg.prototype.Ye);
t.defineProperty(Sg,{Ye:"minSize"},function(){return this.de},function(a){this.de.N(a)||(f&&t.m(a,pa,Sg,"minSize"),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),this.de.assign(a))});t.g(Sg,"maxSize",Sg.prototype.He);t.defineProperty(Sg,{He:"maxSize"},function(){return this.Aj},function(a){this.Aj.N(a)||(f&&t.m(a,pa,Sg,"maxSize"),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),this.Aj.assign(a))});t.g(Sg,"cellSize",Sg.prototype.bl);
t.defineProperty(Sg,{bl:"cellSize"},function(){return this.fj},function(a){this.fj.N(a)||(f&&t.m(a,pa,Sg,"cellSize"),this.fj.assign(a))});t.g(Sg,"isGridSnapEnabled",Sg.prototype.bp);t.defineProperty(Sg,{bp:"isGridSnapEnabled"},function(){return this.Ql},function(a){this.Ql!==a&&(t.j(a,"boolean",Sg,"isGridSnapEnabled"),this.Ql=a)});t.g(Sg,"originalDesiredSize",Sg.prototype.LI);t.A(Sg,{LI:"originalDesiredSize"},function(){return this.Yu});t.g(Sg,"originalLocation",Sg.prototype.MI);
t.A(Sg,{MI:"originalLocation"},function(){return this.Oy});function $g(){0<arguments.length&&t.l("RotatingTool constructor cannot take any arguments.");le.call(this);this.name="Rotating";this.bz=45;this.az=2;this.La=null;var a=new Y;a.Ib="Ellipse";a.Ca=J.hx;a.fill="lightblue";a.stroke="dodgerblue";a.ib=1;a.cursor="pointer";this.Hk=a;this.Xb=null;this.co=0;this.IC=new C}t.ia("RotatingTool",$g);t.Oa($g,le);
$g.prototype.updateAdornments=function(a){if(!(null===a||a instanceof A)){if(a.bb&&!this.h.$a){var b=a.nF;if(null!==b&&a.canRotate()&&a.ya.Q()&&a.zb()&&b.ya.Q()&&b.ol()){var c=a.Mo(this.name);null===c&&(c=this.makeAdornment(b),c.nl=!0);if(null!==c){c.angle=b.jl();var d=null,e=null;b===a||b===a.Ub?(d=a.Ub,e=a.We):(d=b,e=Vb);for(var g=d.Ia,e=t.ic(g.width*e.x+e.offsetX,g.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.Va(e),d=d.ga;var d=e.y,g=Math.max(e.x-b.Ia.width,0),h=t.O();c.location=b.gb(new K(1,
0,50+g,d),h);t.B(h);t.B(e);a.Xk(this.name,c);return}}}a.tl(this.name)}};$g.prototype.makeAdornment=function(a){var b=null,b=a.U.mF;if(null===b){b=new Ve;b.type=ah;b.We=Vb;var c=this.Ns;null!==c&&b.add(c.copy())}else if(Xe(b),b=b.copy(),!(b instanceof Ve))return null;b.Qc=this.name;b.Pc=a;return b};t.defineProperty($g,{Ns:"handleArchetype"},function(){return this.Hk},function(a){a&&t.m(a,X,$g,"handleArchetype");this.Hk=a});t.A($g,{handle:"handle"},function(){return this.Xb});
t.defineProperty($g,{Pc:"adornedObject"},function(){return this.La},function(a){a&&t.m(a,X,$g,"adornedObject");this.La=a});$g.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.$a&&a.Ao&&a.T.left?null!==this.findToolHandleAt(a.Ec.W,this.name)?!0:!1:!1};
$g.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.Xb=this.findToolHandleAt(a.Ec.W,this.name),null!==this.Xb)){this.La=this.Xb.U.Pc;var b=this.La.U,c=b.Ub;this.IC=this.La===b||this.La===c?c.gb(b.We):this.La.gb(Vb);this.co=this.La.angle;a.Bd=!0;this.rc(this.name);this.ra=!0}};$g.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.kk(),this.La=this.Xb=null,this.ra=a.Bd=!1)};$g.prototype.doCancel=function(){this.rotate(this.co);this.stopTool()};
$g.prototype.doMouseMove=function(){var a=this.h;this.ra&&null!==a&&(a=this.computeRotate(a.T.W),this.rotate(a))};$g.prototype.doMouseUp=function(){var a=this.h;if(this.ra&&null!==a){var b=this.computeRotate(a.T.W);this.rotate(b);a.Fc();this.bf=this.name;a.Ja("PartRotated",this.La,this.co)}this.stopTool()};$g.prototype.rotate=function(a){t.o(a,$g,"rotate:newangle");null!==this.La&&(this.La.angle=a)};
$g.prototype.computeRotate=function(a){a=this.IC.Li(a);var b=this.La.ga;b&&(a-=b.jl(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.FF),180),c=Math.min(Math.abs(this.EF),b/2);!this.h.T.shift&&0<b&&0<c&&(a%b<c?a=Math.floor(a/b)*b:a%b>b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};t.g($g,"snapAngleMultiple",$g.prototype.FF);
t.defineProperty($g,{FF:"snapAngleMultiple"},function(){return this.bz},function(a){this.bz!==a&&(f&&t.j(a,"number",$g,"snapAngleMultiple"),this.bz=a)});t.g($g,"snapAngleEpsilon",$g.prototype.EF);t.defineProperty($g,{EF:"snapAngleEpsilon"},function(){return this.az},function(a){this.az!==a&&(f&&t.j(a,"number",$g,"snapAngleEpsilon"),this.az=a)});t.g($g,"originalAngle",$g.prototype.KI);t.A($g,{KI:"originalAngle"},function(){return this.co});
function bh(){0<arguments.length&&t.l("ClickSelectingTool constructor cannot take any arguments.");le.call(this);this.name="ClickSelecting"}t.ia("ClickSelectingTool",bh);t.Oa(bh,le);bh.prototype.canStart=function(){return!this.isEnabled||null===this.h||this.isBeyondDragSize()?!1:!0};bh.prototype.doMouseUp=function(){this.ra&&(this.standardMouseSelect(),this.standardMouseClick());this.stopTool()};
function ch(){0<arguments.length&&t.l("ActionTool constructor cannot take any arguments.");le.call(this);this.name="Action";this.mn=null}t.ia("ActionTool",ch);t.Oa(ch,le);ch.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a)return!1;var b=a.T,c=a.Rd(b.W,function(a){for(;null!==a.ga&&!a.Rs;)a=a.ga;return a},function(a){return a.Rs});return null!==c?(this.mn=c,a.Ho=a.Rd(b.W,null,null),!0):!1};
ch.prototype.doMouseDown=function(){if(this.ra){var a=this.h.T,b=this.mn;null!==b&&(a.Yd=b,null!==b.wz&&b.wz(a,b))}else this.canStart()&&this.doActivate()};ch.prototype.doMouseMove=function(){if(this.ra){var a=this.h.T,b=this.mn;null!==b&&(a.Yd=b,null!==b.xz&&b.xz(a,b))}};ch.prototype.doMouseUp=function(){if(this.ra){var a=this.h,b=a.T,c=this.mn;if(null===c)return;b.Yd=c;null!==c.yz&&c.yz(b,c);this.isBeyondDragSize()||cf(c,b,a)}this.stopTool()};
ch.prototype.doCancel=function(){var a=this.h;if(null!==a){var a=a.T,b=this.mn;if(null===b)return;a.Yd=b;null!==b.vz&&b.vz(a,b)}this.stopTool()};ch.prototype.doStop=function(){this.mn=null};function Aa(){0<arguments.length&&t.l("ClickCreatingTool constructor cannot take any arguments.");le.call(this);this.name="ClickCreating";this.cj=null;this.ty=!0;this.$B=new C(0,0)}t.ia("ClickCreatingTool",Aa);t.Oa(Aa,le);
Aa.prototype.canStart=function(){if(!this.isEnabled||null===this.us)return!1;var a=this.h;if(null===a||a.$a||a.Ue||!a.vm||!a.T.left||this.isBeyondDragSize())return!1;if(this.xE){if(1===a.T.Be&&(this.$B=a.T.Ac.copy()),2!==a.T.Be||this.isBeyondDragSize(this.$B))return!1}else if(1!==a.T.Be)return!1;return a.Za!==this&&null!==a.Hs(a.T.W,!0)?!1:!0};Aa.prototype.doMouseUp=function(){var a=this.h;this.ra&&null!==a&&this.insertPart(a.T.W);this.stopTool()};
Aa.prototype.insertPart=function(a){var b=this.h;if(null===b)return null;var c=this.us;if(null===c)return null;this.rc(this.name);var d=null;c instanceof w?c.Ud()&&(Xe(c),d=c.copy(),d instanceof w&&b.add(d)):null!==c&&(c=b.fa.Xj(c),t.pb(c)&&(b.fa.um(c),d=b.Pi(c)));d instanceof w&&(d.location=a,b.Ne&&b.select(d));b.Fc();this.bf=this.name;b.Ja("PartCreated",d);this.kk();return d instanceof w?d:null};t.g(Aa,"archetypeNodeData",Aa.prototype.us);
t.defineProperty(Aa,{us:"archetypeNodeData"},function(){return this.cj},function(a){this.cj!==a&&(null!==a&&t.m(a,Object,Aa,"archetypeNodeData"),this.cj=a)});t.g(Aa,"isDoubleClick",Aa.prototype.xE);t.defineProperty(Aa,{xE:"isDoubleClick"},function(){return this.ty},function(a){this.ty!==a&&(t.j(a,"boolean",Aa,"isDoubleClick"),this.ty=a)});
function dh(){0<arguments.length&&t.l("ContextMenuTool constructor cannot take any arguments.");le.call(this);this.name="ContextMenu";this.KB=null;this.uC=new C;this.Bn=null;if(!0===t.gB){this.Bn=new Ve;this.Tx=null;var a=this;this.TC=function(){a.stopTool()};if(!1===t.ED){var b=document.createElement("div"),c=document.createElement("div");b.style.cssText="top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";
c.style.cssText="z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);";var d=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".defaultCXul { list-style: none; }",0);d.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",
0);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);c.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);document.body&&(document.body.appendChild(b),document.body.appendChild(c));t.As=b;t.zs=c;t.ED=!0}}}t.ia("ContextMenuTool",dh);t.Oa(dh,le);
dh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||this.isBeyondDragSize()||!a.T.right?!1:(null===this.Bn||a.T.event instanceof MouseEvent)&&null===this.findObjectWithContextMenu()?!1:!0};dh.prototype.doStart=function(){var a=this.h;null!==a&&this.uC.set(a.Ec.W)};dh.prototype.doStop=function(){this.hideDefaultContextMenu();this.hideContextMenu()};
dh.prototype.findObjectWithContextMenu=function(a){var b=this.h;if(null===b)return null;var c=b.T,d=null,d=void 0!==a?a:b.Rd(c.W,null,function(a){return!a.layer.pc});if(null!==d){for(a=d;null!==a;){c=a.contextMenu;if(null!==c)return a;a=a.ga}if(null!==this.Bn&&!(b.T.event instanceof MouseEvent))return d.U}else if(c=b.contextMenu,null!==c)return b;return null};dh.prototype.doActivate=function(){};
dh.prototype.doMouseDown=function(){if(this.ra){var a=this.h;if(null!==a&&null!==this.lf){var b=a.Rd(a.T.W,null,null);null!==b&&b.Ti(this.lf)?(this.standardMouseClick(null,null),this.stopTool()):(this.stopTool(),a.Za.doMouseDown())}}};dh.prototype.doMouseUp=function(){this.ra||this.canStart()&&bf(this,!0)};
function bf(a,b,c){a.ra=!0;b&&a.standardMouseSelect();a.standardMouseClick();void 0===c&&(c=a.findObjectWithContextMenu());null!==c?(b=c.contextMenu,null!==b?a.showContextMenu(b,c instanceof X?c:null):a.showDefaultContextMenu()):a.showDefaultContextMenu()}dh.prototype.doMouseMove=function(){this.ra&&this.standardMouseOver()};
dh.prototype.showContextMenu=function(a,b){t.m(a,Ve,dh,"showContextMenu:contextmenu");null!==b&&t.m(b,X,dh,"showContextMenu:obj");var c=this.h;if(null!==c){a!==this.lf&&this.hideContextMenu();a.Xd="Tool";a.jk=!1;a.scale=1/c.scale;a.Qc=this.name;c.add(a);if(null!==b){var c=null,d=b.Qo();null!==d&&(c=d.data);a.Pc=b;a.data=c}else a.data=c.fa;a.Gf();this.positionContextMenu(a,b);this.lf=a}};
dh.prototype.positionContextMenu=function(a){var b=this.h;if(null!==b){var c=b.T.W.copy(),d=a.Ea,e=b.nb;b.T.vw&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5);c.y<e.y&&(c.y=e.y);a.position=c}};dh.prototype.hideContextMenu=function(){var a=this.h;null!==a&&null!==this.lf&&(this.lf.data=null,this.lf.Pc=null,a.remove(this.lf),this.lf=null,this.standardMouseOver())};
dh.prototype.initializeDefaultButtons=function(){if(null===this.h)return null;var a=new H,b=this.h.lg;a.add({text:"Copy",Ff:function(){b.copySelection()},visible:function(){return b.canCopySelection()}});a.add({text:"Cut",Ff:function(){b.cutSelection()},visible:function(){return b.canCutSelection()}});a.add({text:"Delete",Ff:function(){b.deleteSelection()},visible:function(){return b.canDeleteSelection()}});a.add({text:"Paste",Ff:function(a){b.pasteSelection(a.T.W)},visible:function(){return b.canPasteSelection()}});
a.add({text:"Select All",Ff:function(){b.selectAll()},visible:function(){return b.canSelectAll()}});a.add({text:"Undo",Ff:function(){b.undo()},visible:function(){return b.canUndo()}});a.add({text:"Redo",Ff:function(){b.redo()},visible:function(){return b.canRedo()}});a.add({text:"Zoom Out",Ff:function(){b.decreaseZoom()},visible:function(){return b.canDecreaseZoom()}});a.add({text:"Zoom In",Ff:function(){b.increaseZoom()},visible:function(){return b.canIncreaseZoom()}});a.add({text:"Zoom To Fit",
Ff:function(){b.zoomToFit()},visible:function(){return b.canZoomToFit()}});a.add({text:"Reset Zoom",Ff:function(){b.resetZoom()},visible:function(){return b.canResetZoom()}});a.add({text:"Group Selection",Ff:function(){b.groupSelection()},visible:function(){return b.canGroupSelection()}});a.add({text:"Ungroup Selection",Ff:function(){b.ungroupSelection()},visible:function(){return b.canUngroupSelection()}});a.add({text:"Edit Text",Ff:function(){b.editTextBlock()},visible:function(){return b.canEditTextBlock()}});
return a};
dh.prototype.showDefaultContextMenu=function(){var a=this.h;if(null!==a){null===this.Tx&&(this.Tx=this.initializeDefaultButtons());this.Bn!==this.lf&&this.hideContextMenu();t.As.innerHTML="";t.zs.addEventListener("click",this.TC,!1);var b=this,c=document.createElement("ul");c.className="defaultCXul";t.As.appendChild(c);c.innerHTML="";for(var d=this.Tx.k;d.next();){var e=d.value,g=e.text,h=e.visible;if("function"!==typeof h||h()){h=document.createElement("li");h.className="defaultCXli";var k=document.createElement("a");
k.className="defaultCXa";k.href="#";k.wG=e.Ff;k.addEventListener("click",function(c){this.wG(a);b.stopTool();c.preventDefault();return!1},!1);k.textContent=g;h.appendChild(k);c.appendChild(h)}}t.As.style.display="block";t.zs.style.display="block";this.lf=this.Bn}};dh.prototype.hideDefaultContextMenu=function(){null!==this.lf&&this.lf===this.Bn&&(t.As.style.display="none",t.zs.style.display="none",t.zs.removeEventListener("click",this.TC,!1),this.lf=null)};t.g(dh,"currentContextMenu",dh.prototype.lf);
t.defineProperty(dh,{lf:"currentContextMenu"},function(){return this.KB},function(a){this.KB=a});t.A(dh,{BJ:"mouseDownPoint"},function(){return this.uC});function eh(){0<arguments.length&&t.l("DragSelectingTool constructor cannot take any arguments.");le.call(this);this.name="DragSelecting";this.Cn=175;this.lC=!1;var a=new w;a.Xd="Tool";a.jk=!1;var b=new Y;b.name="SHAPE";b.Ib="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.pn=a}t.ia("DragSelectingTool",eh);t.Oa(eh,le);
eh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.Ne)return!1;var b=a.T;return!b.left||a.Za!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Ec.timestamp<this.Zv||null!==a.Hs(b.W,!0))?!1:!0};eh.prototype.doActivate=function(){var a=this.h;null!==a&&(this.ra=!0,a.Bd=!0,a.Bb=!0,a.add(this.kg),this.doMouseMove())};eh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.remove(this.kg),a.Bb=!1,this.ra=a.Bd=!1)};
eh.prototype.doMouseMove=function(){if(null!==this.h&&this.ra&&null!==this.kg){var a=this.computeBoxBounds(),b=this.kg.le("SHAPE");null===b&&(b=this.kg.gw());b.Ca=a.size;this.kg.position=a.position}};eh.prototype.doMouseUp=function(){if(this.ra){var a=this.h;a.remove(this.kg);try{a.cd="wait",this.selectInRect(this.computeBoxBounds())}finally{a.cd=""}}this.stopTool()};eh.prototype.computeBoxBounds=function(){var a=this.h;return null===a?new D(0,0,0,0):new D(a.Ec.W,a.T.W)};
eh.prototype.selectInRect=function(a){var b=this.h;if(null!==b){var c=b.T;b.Ja("ChangingSelection");a=b.ck(a,null,function(a){return a instanceof w&&a.canSelect()},this.CE);if(b.Rl?c.Wm:c.control)if(c.shift)for(a=a.k;a.next();)c=a.value,c.bb&&(c.bb=!1);else for(a=a.k;a.next();)c=a.value,c.bb=!c.bb;else{if(!c.shift){for(var d=new H(w),e=b.selection.k;e.next();)c=e.value,a.contains(c)||d.add(c);for(d=d.k;d.next();)c=d.value,c.bb=!1}for(a=a.k;a.next();)c=a.value,c.bb||(c.bb=!0)}b.Ja("ChangedSelection")}};
t.g(eh,"delay",eh.prototype.Zv);t.defineProperty(eh,{Zv:"delay"},function(){return this.Cn},function(a){this.Cn=a});t.g(eh,"isPartialInclusion",eh.prototype.CE);t.defineProperty(eh,{CE:"isPartialInclusion"},function(){return this.lC},function(a){this.lC=a});t.g(eh,"box",eh.prototype.kg);t.defineProperty(eh,{kg:"box"},function(){return this.pn},function(a){this.pn=a});
function fh(){0<arguments.length&&t.l("PanningTool constructor cannot take any arguments.");le.call(this);this.name="Panning";this.Qy=new C;this.ej=!1;var a=this;this.NC=function(){document.removeEventListener("scroll",a.NC,!1);a.stopTool()}}t.ia("PanningTool",fh);t.Oa(fh,le);fh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||!a.hf&&!a.jf||!a.T.left||a.Za!==this&&!this.isBeyondDragSize()?!1:!0};
fh.prototype.doActivate=function(){var a=this.h;null!==a&&(this.ej?(a.T.bubbles=!0,document.addEventListener("scroll",this.NC,!1)):(a.cd="move",a.Bd=!0,this.Qy=a.position.copy()),this.ra=!0)};fh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.cd="",this.ra=a.Bd=!1,a.pa())};fh.prototype.doCancel=function(){var a=this.h;null!==a&&(a.position=this.Qy,a.Bd=!1);this.stopTool()};fh.prototype.doMouseMove=function(){this.move()};fh.prototype.doMouseUp=function(){this.move();this.stopTool()};
fh.prototype.move=function(){var a=this.h;if(this.ra&&a)if(this.ej)a.T.bubbles=!0;else{var b=a.position,c=a.Ec.W,d=a.T.W,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.hf||(e=b.x);a.jf||(c=b.y);a.position=new C(e,c)}};t.g(fh,"bubbles",fh.prototype.bubbles);t.defineProperty(fh,{bubbles:"bubbles"},function(){return this.ej},function(a){this.ej=a});t.g(fh,"originalPosition",fh.prototype.QI);t.A(fh,{QI:"originalPosition"},function(){return this.Qy});
function gh(){0<arguments.length&&t.l("TextEditingTool constructor cannot take any arguments.");le.call(this);this.name="TextEditing";this.Ux=this.MB=this.qz=this.QC=null;this.ez=hh;this.Mj=null;this.kb=ih;this.Rk=null}t.ia("TextEditingTool",gh);t.Oa(gh,le);var jh;gh.LostFocus=jh=t.w(gh,"LostFocus",0);var kh;gh.MouseDown=kh=t.w(gh,"MouseDown",1);var lh;gh.Tab=lh=t.w(gh,"Tab",2);var mh;gh.Enter=mh=t.w(gh,"Enter",3);gh.SingleClick=t.w(gh,"SingleClick",0);var hh;
gh.SingleClickSelected=hh=t.w(gh,"SingleClickSelected",1);var ih=t.w(gh,"StateNone",0),yh=t.w(gh,"StateActive",1),zh=t.w(gh,"StateEditing",2),Ah=t.w(gh,"StateEditing2",3),Bh=t.w(gh,"StateValidating",4),Ch=t.w(gh,"StateValidated",5);t.g(gh,"textBlock",gh.prototype.Ag);t.defineProperty(gh,{Ag:"textBlock"},function(){return this.qz},function(a){this.qz=a});t.g(gh,"currentTextEditor",gh.prototype.Sg);t.defineProperty(gh,{Sg:"currentTextEditor"},function(){return this.MB},function(a){this.MB=a});
t.g(gh,"defaultTextEditor",gh.prototype.HD);t.defineProperty(gh,{HD:"defaultTextEditor"},function(){return this.Ux},function(a){this.Ux=a});t.g(gh,"starting",gh.prototype.GF);t.defineProperty(gh,{GF:"starting"},function(){return this.ez},function(a){this.ez!==a&&(f&&t.tb(a,gh,gh,"starting"),this.ez=a)});
gh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.$a||!a.T.left||this.isBeyondDragSize())return!1;a=a.Rd(a.T.W,null,function(a){return a instanceof va});if(!(a instanceof va&&a.aw))return!1;a=a.U;return null===a||this.GF===hh&&!a.bb?!1:!0};gh.prototype.doStart=function(){this.ra||null===this.Ag||this.doActivate()};
gh.prototype.doActivate=function(){if(!this.ra){var a=this.h;if(null!==a){var b=this.Ag;null===b&&(b=a.Rd(a.T.W,function(a){return a instanceof va?a:null}),b=b instanceof va?b:null);if(null!==b&&(this.Ag=b,null!==b.U)){this.ra=!0;this.kb=yh;this.rc(this.name);var c=this.HD,d=!1;null!==b.iB&&(c=b.iB);null===c||c.DB||(d=!0);this.QC=this.Ag.copy();null===c&&(c=document.createElement("textarea"),c.DB=!0,this.Ux=c,c.addEventListener("input",function(){var a=this.textEditingTool.QC;a.text=this.value;Dh(a,
Infinity,Infinity);this.style.width=20+a.Ea.width*this.jJ+"px";this.rows=a.HE},!1),c.addEventListener("keydown",function(a){var b=a.which,c=this.textEditingTool;if(null!==c)if(13===b)c.acceptText(mh);else{if(9===b)return c.acceptText(lh),a.preventDefault(),!1;27===b&&(c.doCancel(),c.h&&c.h.focus())}},!1),c.addEventListener("focus",function(){var a=this.textEditingTool;a.kb===yh?a.kb=zh:a.kb===Ch?a.kb=Ah:a.kb===Ah&&(a.kb=zh);this.select()},!1),c.addEventListener("blur",function(){this.focus();this.select()},
!1));if(c.DB){var e=b.gb(Vb),g=a.position,h=a.scale,k=b.fk()*h,l=b.Ia.width*k;Eh(b);var m=(e.x-g.x)*h,e=(e.y-g.y)*h;c.value=b.text;a.Mi.style.font=b.font;c.style.font="inherit";c.style.fontSize=100*k+"%";c.style.lineHeight="normal";l=20+l;c.style.width=l+"px";c.style.height="";c.rows=b.HE;a.Mi.appendChild(c);c.style.left=(m-l/2|0)+"px";c.style.top=(e-c.clientHeight/2|0)+"px";c.style.textAlign=b.textAlign}else a.Mi.appendChild(c);c.style.position="absolute";c.style.zIndex=100;c.className="start";c.textEditingTool=
this;c.jJ=k;if(d&&void 0!==c.onActivate)c.onActivate();this.Sg=c;c.focus()}}}};gh.prototype.doCancel=function(){null!==this.Rk&&(this.Sg.style.border=this.Rk,this.Rk=null);this.stopTool()};gh.prototype.doMouseUp=function(){!this.ra&&this.canStart()&&this.doActivate()};gh.prototype.doMouseDown=function(){this.ra&&this.acceptText(kh)};
gh.prototype.acceptText=function(a){switch(a){case kh:if(this.kb===Ch||this.kb===Ah)this.Sg.focus();else if(this.kb===yh||this.kb===zh)this.kb=Bh,Fh(this);break;case jh:case mh:case lh:if(mh===a&&!0===this.qz.uw)break;if(this.kb===yh||this.kb===zh)this.kb=Bh,Fh(this)}};
function Fh(a){if(null!==a.Ag&&null!==a.Sg){var b=a.Ag,c=a.Ag.text,d=a.Sg.value,e="",e="function"===typeof d?d():d;if(!a.isValidText(a.Ag,c,e)){a.kb=zh;null!==b.Fs&&b.Fs(a,c,e);null===a.Rk&&(a.Rk=a.Sg.style.border,a.Sg.style.border="3px solid red");a.Sg.focus();return}a.kb=Ch;c!==e&&(a.Ag.text=e);a.bf=a.name;b=a.h;null!==b&&b.Ja("TextEdited",a.Ag,c);a.stopTool();null!==b&&b.focus()}null!==a.Rk&&(a.Sg.style.border=a.Rk,a.Rk=null)}
gh.prototype.doDeactivate=function(){var a=this.h;if(null!==a){this.ra&&this.kk();this.kb=ih;this.Ag=null;if(null!==this.Sg){var b=this.Sg;if(void 0!==b.onDeactivate)b.onDeactivate();null!==b&&a.Mi.removeChild(b)}this.ra=!1}};gh.prototype.isValidText=function(a,b,c){t.m(a,va,gh,"isValidText:textblock");var d=this.Dt;if(null!==d&&!d(a,b,c))return!1;d=a.Dt;return null===d||d(a,b,c)?!0:!1};t.g(gh,"textValidation",gh.prototype.Dt);
t.defineProperty(gh,{Dt:"textValidation"},function(){return this.Mj},function(a){this.Mj!==a&&(this.Mj=a)});function He(){le.call(this);this.name="ToolManager";this.vC=new H(le);this.wC=new H(le);this.xC=new H(le);this.cC=this.dC=1E3;this.SB=(new pa(2,2)).Na();this.gu=this.Rx=null;this.yC=ef}t.ia("ToolManager",He);t.Oa(He,le);var ef;He.WheelScroll=ef=t.w(He,"WheelScroll",0);var df;He.WheelZoom=df=t.w(He,"WheelZoom",1);He.WheelNone=t.w(He,"WheelNone",2);t.g(He,"mouseWheelBehavior",He.prototype.Xm);
t.defineProperty(He,{Xm:"mouseWheelBehavior"},function(){return this.yC},function(a){this.yC=a});He.prototype.initializeStandardTools=function(){this.aD=new ch;this.MA=new uf;this.KE=new Kg;this.lF=new Sg;this.pF=new $g;this.qA=new za;this.ke=new ff;this.OD=new eh;this.aF=new fh;this.Vv=new dh;this.Tw=new gh;this.pD=new Aa;this.qD=new bh};
He.prototype.doMouseDown=function(){var a=this.h;if(null!==a){var b=a.Aa;b.Jz&&0!==b.Bl&&t.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var b=this.sf.length,c=0;c<b;c++){var d=this.sf.qa(c);null===d.h&&d.qe(this.h);if(d.canStart()){a.Za=d;a.Za===d&&(d.ra||d.doActivate(),d.doMouseDown());return}}1===a.T.button&&(this.Xm===ef?this.Xm=df:this.Xm===df&&(this.Xm=ef));this.doActivate();this.standardWaitAfter(this.fA)}};
He.prototype.doMouseMove=function(){var a=this.h;if(null!==a){if(this.ra)for(var b=this.Wg.length,c=0;c<b;c++){var d=this.Wg.qa(c);null===d.h&&d.qe(this.h);if(d.canStart()){a.Za=d;a.Za===d&&(d.ra||d.doActivate(),d.doMouseMove());return}}this.standardMouseOver();this.isBeyondDragSize()&&this.standardWaitAfter(this.ra?this.fA:this.pE)}};He.prototype.doCurrentObjectChanged=function(a,b){var c=this.fl;null===c||null!==b&&(b===c||b.Ti(c))||this.hideToolTip()};
He.prototype.doWaitAfter=function(){this.h&&this.h.Pa&&(this.doMouseHover(),this.ra||this.doToolTip())};He.prototype.doMouseHover=function(){var a=this.h;if(null!==a){var b=a.T;null===b.Yd&&(b.Yd=a.Rd(b.W,null,null));var c=b.Yd;if(null!==c)for(;null!==c;){a=this.ra?c.ct:c.dt;if(null!==a&&(a(b,c),b.Fe))break;c=c.ga}else a=this.ra?a.ct:a.dt,null!==a&&a(b)}};
He.prototype.doToolTip=function(){var a=this.h;if(null!==a){var b=a.T;null===b.Yd&&(b.Yd=a.Rd(b.W,null,null));b=b.Yd;if(null!==b){if(b!==this.fl&&!b.Ti(this.fl)){for(;null!==b;){a=b.Et;if(null!==a){this.showToolTip(a,b);return}b=b.ga}this.hideToolTip()}}else a=a.Et,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
He.prototype.showToolTip=function(a,b){t.m(a,Ve,He,"showToolTip:tooltip");null!==b&&t.m(b,X,He,"showToolTip:obj");var c=this.h;if(null!==c){a!==this.fl&&this.hideToolTip();a.Xd="Tool";a.jk=!1;a.scale=1/c.scale;c.add(a);if(null!==b&&b!==this.gu){var c=null,d=b.Qo();null!==d&&(c=d.data);a.Pc=b;a.data=c}else null===b&&(a.data=c.fa);if(null===b||b!==this.gu)a.Gf(),this.positionToolTip(a,b);this.Rx=a;this.gu=b}};
He.prototype.positionToolTip=function(a){var b=this.h;if(null!==b){var c=b.T.W.copy(),d=a.Ea,e=b.nb;b.T.vw&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y=c.y+20+d.height>e.bottom?c.y-(d.height+5):c.y+20;c.y<e.y&&(c.y=e.y);a.position=c}};He.prototype.hideToolTip=function(){if(null!==this.fl){var a=this.h;null!==a&&(this.fl.data=null,this.fl.Pc=null,a.remove(this.fl),this.gu=this.Rx=null)}};t.A(He,{fl:"currentToolTip"},function(){return this.Rx});
He.prototype.doMouseUp=function(){this.cancelWaitAfter();if(this.ra){var a=this.h;if(null===a)return;for(var b=this.Xg.length,c=0;c<b;c++){var d=this.Xg.qa(c);null===d.h&&d.qe(this.h);if(d.canStart()){a.Za=d;a.Za===d&&(d.ra||d.doActivate(),d.doMouseUp());return}}}this.doDeactivate()};He.prototype.doMouseWheel=function(){this.standardMouseWheel()};He.prototype.doKeyDown=function(){var a=this.h;null!==a&&a.lg.doKeyDown()};He.prototype.doKeyUp=function(){var a=this.h;null!==a&&a.lg.doKeyUp()};
He.prototype.doCancel=function(){null!==jf&&jf.doCancel();le.prototype.doCancel.call(this)};He.prototype.findTool=function(a){t.j(a,"string",He,"findTool:name");for(var b=this.sf.length,c=0;c<b;c++){var d=this.sf.qa(c);if(d.name===a)return d}b=this.Wg.length;for(c=0;c<b;c++)if(d=this.Wg.qa(c),d.name===a)return d;b=this.Xg.length;for(c=0;c<b;c++)if(d=this.Xg.qa(c),d.name===a)return d;return null};
He.prototype.replaceTool=function(a,b){t.j(a,"string",He,"replaceTool:name");null!==b&&(t.m(b,le,He,"replaceTool:newtool"),b.h&&b.h!==this.h&&t.l("Cannot share tools between Diagrams: "+b.toString()),b.qe(this.h));for(var c=this.sf.length,d=0;d<c;d++){var e=this.sf.qa(d);if(e.name===a)return null!==b?this.sf.xg(d,b):this.sf.gd(d),e}c=this.Wg.length;for(d=0;d<c;d++)if(e=this.Wg.qa(d),e.name===a)return null!==b?this.Wg.xg(d,b):this.Wg.gd(d),e;c=this.Xg.length;for(d=0;d<c;d++)if(e=this.Xg.qa(d),e.name===
a)return null!==b?this.Xg.xg(d,b):this.Xg.gd(d),e;return null};function Gh(a,b,c,d){t.j(b,"string",He,"replaceStandardTool:name");t.m(d,H,He,"replaceStandardTool:list");null!==c&&(t.m(c,le,He,"replaceStandardTool:newtool"),c.h&&c.h!==a.h&&t.l("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.qe(a.h));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}t.A(He,{sf:"mouseDownTools"},function(){return this.vC});t.A(He,{Wg:"mouseMoveTools"},function(){return this.wC});
t.A(He,{Xg:"mouseUpTools"},function(){return this.xC});t.g(He,"hoverDelay",He.prototype.pE);t.defineProperty(He,{pE:"hoverDelay"},function(){return this.dC},function(a){this.dC=a});t.g(He,"holdDelay",He.prototype.fA);t.defineProperty(He,{fA:"holdDelay"},function(){return this.cC},function(a){this.cC=a});t.g(He,"dragSize",He.prototype.PD);t.defineProperty(He,{PD:"dragSize"},function(){return this.SB},function(a){this.SB=a});t.g(He,"actionTool",He.prototype.aD);
t.defineProperty(He,{aD:"actionTool"},function(){return this.findTool("Action")},function(a){Gh(this,"Action",a,this.sf)});t.g(He,"relinkingTool",He.prototype.MA);t.defineProperty(He,{MA:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){Gh(this,"Relinking",a,this.sf)});t.g(He,"linkReshapingTool",He.prototype.KE);t.defineProperty(He,{KE:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){Gh(this,"LinkReshaping",a,this.sf)});
t.g(He,"resizingTool",He.prototype.lF);t.defineProperty(He,{lF:"resizingTool"},function(){return this.findTool("Resizing")},function(a){Gh(this,"Resizing",a,this.sf)});t.g(He,"rotatingTool",He.prototype.pF);t.defineProperty(He,{pF:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){Gh(this,"Rotating",a,this.sf)});t.g(He,"linkingTool",He.prototype.qA);t.defineProperty(He,{qA:"linkingTool"},function(){return this.findTool("Linking")},function(a){Gh(this,"Linking",a,this.Wg)});
t.g(He,"draggingTool",He.prototype.ke);t.defineProperty(He,{ke:"draggingTool"},function(){return this.findTool("Dragging")},function(a){Gh(this,"Dragging",a,this.Wg)});t.g(He,"dragSelectingTool",He.prototype.OD);t.defineProperty(He,{OD:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){Gh(this,"DragSelecting",a,this.Wg)});t.g(He,"panningTool",He.prototype.aF);
t.defineProperty(He,{aF:"panningTool"},function(){return this.findTool("Panning")},function(a){Gh(this,"Panning",a,this.Wg)});t.g(He,"contextMenuTool",He.prototype.Vv);t.defineProperty(He,{Vv:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){Gh(this,"ContextMenu",a,this.Xg)});t.g(He,"textEditingTool",He.prototype.Tw);t.defineProperty(He,{Tw:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){Gh(this,"TextEditing",a,this.Xg)});
t.g(He,"clickCreatingTool",He.prototype.pD);t.defineProperty(He,{pD:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){Gh(this,"ClickCreating",a,this.Xg)});t.g(He,"clickSelectingTool",He.prototype.qD);t.defineProperty(He,{qD:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){Gh(this,"ClickSelecting",a,this.Xg)});
function ke(){1<arguments.length&&t.l("Layer constructor cannot take any arguments.");t.zc(this);this.ea=null;this.cb=new H(w);this.Rb="";this.Df=1;this.zy=!1;this.Sk=this.uz=this.yk=this.xk=this.wk=this.vk=this.tk=this.uk=this.sk=this.Ak=this.rk=this.zk=this.qk=this.pk=!0;this.Zu=[]}t.ia("Layer",ke);ke.prototype.qe=function(a){this.ea=a};
ke.prototype.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,g=0,h=0,k=this.cb.k;k.next();){var l=k.value;l instanceof z?e++:l instanceof y?d++:l instanceof A?g++:l instanceof Ve?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<g&&(k+=g+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(c=this.cb.k;c.next();)d=c.value,k+="\n    "+d.toString(a-1),(e=d.data)&&t.oc(e)&&(k+=" #"+t.oc(e)),d instanceof y?k+=" "+la(e):
d instanceof A&&(k+=" "+la(d.da)+" "+la(d.ja));return b+" "+this.cb.count+": "+k};
ke.prototype.findObjectAt=ke.prototype.Rd=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.Sk)return null;f&&!a.Q()&&t.l("findObjectAt: Point must have a real value.");var d=this.cb,e=!1;this.h.nb.Ha(a)&&(e=!0);for(var g=t.O(),h=d.length;h--;){var k=d.qa(h);if((!0!==e||!1!==Hh(k))&&k.zb()&&(g.assign(a),ab(g,k.he),k=k.Rd(g,b,c),null!==k&&(null!==b&&(k=b(k)),k&&(null===c||c(k)))))return t.B(g),k}t.B(g);return null};
ke.prototype.findObjectsAt=ke.prototype.Oo=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof ua||(d=new ua(X));if(!1===this.Sk)return d;f&&!a.Q()&&t.l("findObjectsAt: Point must have a real value.");var e=this.cb,g=!1;this.h.nb.Ha(a)&&(g=!0);for(var h=t.O(),k=e.length;k--;){var l=e.qa(k);!0===g&&!1===Hh(l)||!l.zb()||(h.assign(a),ab(h,l.he),l.Oo(h,b,c,d)&&(null!==b&&(l=b(l)),l&&(null===c||c(l))&&d.add(l)))}t.B(h);return d};
ke.prototype.findObjectsIn=ke.prototype.ck=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof ua||(e=new ua(X));if(!1===this.Sk)return e;f&&!a.Q()&&t.l("findObjectsIn: Rect must have a real value.");var g=this.cb,h=!1;this.h.nb.Wj(a)&&(h=!0);for(var k=g.length,g=g.p;k--;){var l=g[k];(!0!==h||!1!==Hh(l))&&l.zb()&&l.ck(a,b,c,d,e)&&(null!==b&&(l=b(l)),l&&(null===c||c(l))&&e.add(l))}return e};
ke.prototype.Wz=function(a,b,c,d,e,g,h){if(!1===this.Sk)return e;for(var k=this.cb,l=k.length,k=k.p;l--;){var m=k[l];(!0!==h||!1!==Hh(m))&&g(m)&&m.zb()&&m.ck(a,b,c,d,e)&&(null!==b&&(m=b(m)),m&&(null===c||c(m))&&e.add(m))}return e};
ke.prototype.findObjectsNear=ke.prototype.Lm=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof ua)g=e;e=!0}g instanceof H||g instanceof ua||(g=new ua(X));if(!1===this.Sk)return g;f&&!a.Q()&&t.l("findObjectsNear: Point must have a real value.");var h=this.cb,k=!1;this.h.nb.Ha(a)&&(k=!0);for(var l=t.O(),m=t.O(),n=h.length;n--;){var p=h.p[n];!0===k&&!1===Hh(p)||!p.zb()||(l.assign(a),ab(l,p.he),m.q(a.x+b,a.y),ab(m,p.he),
p.Lm(l,m,c,d,e,g)&&(null!==c&&(p=c(p)),p&&(null===d||d(p))&&g.add(p)))}t.B(l);t.B(m);return g};aa=ke.prototype;aa.Of=function(a,b){if(this.visible&&a.Lk){var c=this.cb,d;d=b?b:a.nb;for(var e=c.length,g=0;g<e;g++){var h=c.p[g];h.AG=g;if(!(h instanceof A&&!1===h.Rg||h instanceof Ve&&null!==h.Dh))if(xb(h.ya,d))for(h.Of(!0),Ih(h),h=h.Fv;h.next();){var k=h.value;Dh(k,Infinity,Infinity);k.Dc();k.Of(!0)}else h.Of(!1),null!==h.Fv&&0<h.Fv.count&&Ih(h)}}};
aa.Re=function(a,b,c,d){if(this.visible&&(void 0===d&&(d=!0),d||!this.pc)){1!==this.Df&&(a.globalAlpha=this.Df);c=this.cb;d=this.Zu;d.length=0;for(var e=b.scale,g=c.length,h=0;h<g;h++){var k=c.p[h];if(Hh(k)){if(k instanceof A&&(k.ac&&d.push(k),!1===k.Rg))continue;var l=k.ya;1<l.width*e||1<l.height*e?k.Re(a,b):Jh(k,a)}}a.globalAlpha=1}};
function Kh(a,b,c,d){if(a.visible){b.globalAlpha=a.Df;var e=a.cb;a=a.Zu;a.length=0;for(var g=c.scale,h=e.length,k=d.length,l=0;l<h;l++){var m=e.p[l];if(Hh(m)){if(m instanceof A&&(m.ac&&a.push(m),!1===m.Rg))continue;var n=Lh(m,m.ya),p;a:{p=n;for(var q=d,r=k,s=2/g,v=4/g,x=0;x<r;x++){var E=q[x];if(0!==E[2]&&0!==E[3]&&p.wE(E[0]-s,E[1]-s,E[2]+v,E[3]+v)){p=!0;break a}}p=!1}p&&(1<n.width*g||1<n.height*g?m.Re(b,c):Jh(m,b))}}b.globalAlpha=1}}
aa.i=function(a,b,c,d,e){var g=this.h;null!==g&&g.Vc(Cd,a,this,b,c,d,e)};aa.Pm=function(a,b,c){var d=this.cb;b.Un=this;if(a>=d.count)a=d.count;else if(d.qa(a)===b)return-1;d.Ad(a,b);b.Ps();d=this.h;null!==d&&(c?d.pa():d.Pm(b));b instanceof z&&this.Pw(b);return a};aa.Te=function(a,b,c){var d=this.cb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.qa(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Qs();d.gd(a);d=this.h;null!==d&&(c?d.pa():d.Te(b));b.Un=null;return a};
aa.Pw=function(a){for(;null!==a;){if(a.layer===this){var b=a;if(b.Ic.next()){for(var c=-1,d=-1,e=this.cb.p,g=e.length,h=0;h<g;h++){var k=e[h];if(k===b&&(c=h,0<=d))break;if(0>d&&k.fb===b&&(d=h,0<=c))break}!(0>d)&&d<c&&(e=this.cb,e.gd(c),e.Ad(d,b))}}a=a.fb}};aa.clear=function(){for(var a=this.cb.af(),b=a.length,c=0;c<b;c++)a[c].Of(!1),this.Te(-1,a[c])};t.A(ke,{rl:"parts"},function(){return this.cb.k});t.A(ke,{FJ:"partsBackwards"},function(){return this.cb.Rm});t.A(ke,{h:"diagram"},function(){return this.ea});
t.g(ke,"name",ke.prototype.name);t.defineProperty(ke,{name:"name"},function(){return this.Rb},function(a){t.j(a,"string",ke,"name");var b=this.Rb;if(b!==a){var c=this.h;if(null!==c)for(""===b&&t.l("Cannot rename default Layer to: "+a),c=c.Tm;c.next();)c.value.name===a&&t.l("Layer.name is already present in this diagram: "+a);this.Rb=a;this.i("name",b,a);for(a=this.cb.k;a.next();)a.value.Xd=this.Rb}});t.g(ke,"opacity",ke.prototype.opacity);
t.defineProperty(ke,{opacity:"opacity"},function(){return this.Df},function(a){var b=this.Df;b!==a&&(t.j(a,"number",ke,"opacity"),(0>a||1<a)&&t.ha(a,"0 <= val <= 1",ke,"opacity"),this.Df=a,this.i("opacity",b,a),a=this.h,null!==a&&a.pa())});t.g(ke,"isTemporary",ke.prototype.pc);t.defineProperty(ke,{pc:"isTemporary"},function(){return this.zy},function(a){var b=this.zy;b!==a&&(t.j(a,"boolean",ke,"isTemporary"),this.zy=a,this.i("isTemporary",b,a))});t.g(ke,"visible",ke.prototype.visible);
t.defineProperty(ke,{visible:"visible"},function(){return this.uz},function(a){var b=this.uz;if(b!==a){t.j(a,"boolean",ke,"visible");this.uz=a;this.i("visible",b,a);for(b=this.cb.k;b.next();){var c=b.value;a?(c.K(Mh),c.updateAdornments()):(c.K(Nh),c.Ae())}a=this.h;null!==a&&a.pa()}});t.g(ke,"pickable",ke.prototype.Ze);t.defineProperty(ke,{Ze:"pickable"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(t.j(a,"boolean",ke,"pickable"),this.Sk=a,this.i("pickable",b,a))});
t.g(ke,"allowCopy",ke.prototype.Sj);t.defineProperty(ke,{Sj:"allowCopy"},function(){return this.pk},function(a){var b=this.pk;b!==a&&(t.j(a,"boolean",ke,"allowCopy"),this.pk=a,this.i("allowCopy",b,a))});t.g(ke,"allowDelete",ke.prototype.$k);t.defineProperty(ke,{$k:"allowDelete"},function(){return this.qk},function(a){var b=this.qk;b!==a&&(t.j(a,"boolean",ke,"allowDelete"),this.qk=a,this.i("allowDelete",b,a))});t.g(ke,"allowTextEdit",ke.prototype.Bo);
t.defineProperty(ke,{Bo:"allowTextEdit"},function(){return this.zk},function(a){var b=this.zk;b!==a&&(t.j(a,"boolean",ke,"allowTextEdit"),this.zk=a,this.i("allowTextEdit",b,a))});t.g(ke,"allowGroup",ke.prototype.xo);t.defineProperty(ke,{xo:"allowGroup"},function(){return this.rk},function(a){var b=this.rk;b!==a&&(t.j(a,"boolean",ke,"allowGroup"),this.rk=a,this.i("allowGroup",b,a))});t.g(ke,"allowUngroup",ke.prototype.Co);
t.defineProperty(ke,{Co:"allowUngroup"},function(){return this.Ak},function(a){var b=this.Ak;b!==a&&(t.j(a,"boolean",ke,"allowUngroup"),this.Ak=a,this.i("allowUngroup",b,a))});t.g(ke,"allowLink",ke.prototype.wm);t.defineProperty(ke,{wm:"allowLink"},function(){return this.sk},function(a){var b=this.sk;b!==a&&(t.j(a,"boolean",ke,"allowLink"),this.sk=a,this.i("allowLink",b,a))});t.g(ke,"allowRelink",ke.prototype.Tj);
t.defineProperty(ke,{Tj:"allowRelink"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(t.j(a,"boolean",ke,"allowRelink"),this.uk=a,this.i("allowRelink",b,a))});t.g(ke,"allowMove",ke.prototype.al);t.defineProperty(ke,{al:"allowMove"},function(){return this.tk},function(a){var b=this.tk;b!==a&&(t.j(a,"boolean",ke,"allowMove"),this.tk=a,this.i("allowMove",b,a))});t.g(ke,"allowReshape",ke.prototype.yo);
t.defineProperty(ke,{yo:"allowReshape"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(t.j(a,"boolean",ke,"allowReshape"),this.vk=a,this.i("allowReshape",b,a))});t.g(ke,"allowResize",ke.prototype.zo);t.defineProperty(ke,{zo:"allowResize"},function(){return this.wk},function(a){var b=this.wk;b!==a&&(t.j(a,"boolean",ke,"allowResize"),this.wk=a,this.i("allowResize",b,a))});t.g(ke,"allowRotate",ke.prototype.Ao);
t.defineProperty(ke,{Ao:"allowRotate"},function(){return this.xk},function(a){var b=this.xk;b!==a&&(t.j(a,"boolean",ke,"allowRotate"),this.xk=a,this.i("allowRotate",b,a))});t.g(ke,"allowSelect",ke.prototype.Ne);t.defineProperty(ke,{Ne:"allowSelect"},function(){return this.yk},function(a){var b=this.yk;b!==a&&(t.j(a,"boolean",ke,"allowSelect"),this.yk=a,this.i("allowSelect",b,a))});
function u(a){function b(){document.removeEventListener("DOMContentLoaded",b,!1);Oh(c)}1<arguments.length&&t.l("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");t.zc(this);t.ND=[];this.lc=!0;this.gf=17;var c=this;null!==document.body?Oh(this):document.addEventListener("DOMContentLoaded",b,!1);this.Kb=new H(ke);this.sc=this.tc=0;this.GC=this.Ab=this.Tf=this.Pa=null;this.rb=(new C(NaN,NaN)).freeze();this.Sb=1;this.qy=(new C(NaN,NaN)).freeze();this.sy=NaN;this.Lu=
1E-4;this.Iu=100;this.bd=new qa;this.Cv=(new C(NaN,NaN)).freeze();this.pu=(new D(NaN,NaN,NaN,NaN)).freeze();this.El=Ze;this.Hl=Qb;this.Kk=Ze;this.Mn=Qb;this.wu=this.vu=Sb;this.Yf=new ua(X);this.Je=!0;this.Dn=new sa(A,D);this.En=!0;this.uG=250;this.tG=1E3;this.eh=null;this.Wt=(new sb(16,16,16,16)).freeze();this.ju=this.hg=!1;this.Aq=!0;this.Gg=new ud;this.Zc=new ud;this.cc=new ud;this.gj=null;this.sv=-1;this.gz=!1;this.Xx=new sa("string",H);this.Wx=new sa("string","string");Ph(this);this.Vu=new ua(y);
this.Vk=new ua(z);this.Eu=new ua(A);this.cb=new ua(w);this.Au=!0;this.fC=!1;this.zv=qg;this.vj=10;this.Qx=this.Vx=this.xv=null;this.fu="";this.tq="auto";this.bi=this.yi=this.li=this.Ou=this.mi=this.ni=this.oi=this.ai=this.ei=this.Zh=null;this.gi=!0;this.Jy=!1;this.Hx=null;this.$y=this.vi=!1;this.mC=!0;this.Jd=!1;this.Md=null;var d=this;this.sC=function(a){if(a.fa===d.fa&&d.Wa){d.Wa=!1;try{var b=a.od;""===a.rf&&b===Cd&&Qh(d,a.object,a.propertyName)}finally{d.Wa=!0}}};this.tC=function(a){Rh(d,a)};this.YC=
!0;this.ci=new sa(Object,w);this.Dk=new sa(Object,A);this.Vl=new sa(Object,Array);this.Mk=!1;this.qk=this.pk=this.Lt=this.hi=!0;this.Nt=this.Mt=!1;this.St=this.Qt=this.yk=this.xk=this.wk=this.vk=this.tk=this.uk=this.sk=this.Pt=this.Ak=this.rk=this.zk=!0;this.Pn=this.kC=!1;this.Rt=this.Ot=this.uu=this.tu=!0;this.iv=this.hv=16;this.Wy=this.gv=!1;this.Yy=this.Xy=this.Jj=this.Ij=null;this.Le=(new sb(5)).freeze();this.lv=(new ua(w)).freeze();this.Ju=999999999;this.Lk=this.sj=this.rj=!0;this.Ol=this.Nl=
!1;this.py=this.oy=0;this.Ld=null;this.Tt=!0;this.Xf=!1;this.Od=null;this.dm=1;this.iy=!1;this.MC=0;this.XC=(new D(NaN,NaN,NaN,NaN)).freeze();this.ku=(new D(NaN,NaN,NaN,NaN)).freeze();this.fo=new ua;Sh(this);this.Du=this.ru=this.Uu=this.OB=this.NB=this.PB=this.wj=this.Gk=this.pi=null;Th(this);this.Yc=null;this.qu=!1;this.Ho=this.HA=null;this.Db=new He;this.Db.initializeStandardTools();this.Za=this.Yv=this.Db;this.lg=new wa;this.fa=new U;this.vi=!0;this.Tb=new ue;this.vi=!1;void 0===a&&(a=document.createElement("div"));
this.XB=this.Zx=null;this.tz=!0;this.Vy=!1;this.jj=null;this.Ik=new Uh;Vh(this,a);this.Xl=1;this.Cu=0;this.pC=new C;this.VC=500;this.Xr=null;this.On=!1;window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android")&&(this.On=!0);this.vy=!1;window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0")&&(this.vy=!0);this.jC=!1;window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7")&&(this.jC=!0);this.Rl=0<=navigator.platform.toUpperCase().indexOf("MAC");
this.lc=!1}t.ia("Diagram",u);
function Th(a){a.pi=new sa("string",w);var b=new y,c=new va;c.bind(new De("text","",la));b.add(c);a.PB=b;a.pi.add("",b);b=new y;c=new va;c.stroke="brown";c.bind(new De("text","",la));b.add(c);a.pi.add("Comment",b);b=new y;b.jk=!1;b.Hz=!1;c=new Y;c.Ib="Ellipse";c.fill="black";c.stroke=null;c.Ca=(new pa(3,3)).Na();b.add(c);a.pi.add("LinkLabel",b);a.Gk=new sa("string",z);b=new z;b.vt="GROUPPANEL";b.type=Wh;c=new va;c.font="bold 12pt sans-serif";c.bind(new De("text","",la));b.add(c);c=new B(Xh);c.name=
"GROUPPANEL";var d=new Y;d.Ib="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Vg;d.padding=(new sb(5,5,5,5)).Na();c.add(d);b.add(c);a.NB=b;a.Gk.add("",b);a.wj=new sa("string",A);b=new A;c=new Y;c.Jh=!0;b.add(c);c=new Y;c.fn="Standard";c.fill="black";c.stroke=null;c.ib=0;b.add(c);a.OB=b;a.wj.add("",b);b=new A;c=new Y;c.Jh=!0;c.stroke="brown";b.add(c);a.wj.add("Comment",b);b=new Ve;b.type=Xh;c=new Y;c.fill=null;c.stroke="dodgerblue";c.ib=3;b.add(c);c=new Vg;c.margin=(new sb(1.5,
1.5,1.5,1.5)).Na();b.add(c);a.Uu=b;a.ru=b;b=new Ve;b.type=Cg;c=new Y;c.Jh=!0;c.fill=null;c.stroke="dodgerblue";c.ib=3;b.add(c);a.Du=b}
function Oh(a){var b=document.createElement("p");b.style.width="100%";b.style.height="200px";var c=document.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.appendChild(b);document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);document.body.removeChild(c);a.gf=d-b}
u.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.Mi&&this.Mi.id&&(b=this.Mi.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.Kb.k;c.next();)b+="\n  "+c.value.toString(a-1);return b};u.prototype.checkProperties=function(){return t.lH(this)};u.fromDiv=function(a){var b=a;"string"===typeof a&&(b=document.getElementById(a));return b instanceof HTMLDivElement&&b.ea instanceof u?b.ea:null};t.g(u,"div",u.prototype.Mi);
t.defineProperty(u,{Mi:"div"},function(){return this.Ab},function(a){null!==a&&t.m(a,HTMLDivElement,u,"div");if(this.Ab!==a){var b=this.Ab;if(null!==b){delete b.ea;b.innerHTML="";null!==this.Pa&&(this.Pa.ea=null,this.Pa.removeEventListener("touchstart",this.QF,!1),this.Pa.removeEventListener("touchmove",this.PF,!1),this.Pa.removeEventListener("touchend",this.OF,!1));b=this.xv;if(null!==b){for(var c=b.vC.p,d=c.length,e=0;e<d;e++)c[e].cancelWaitAfter();c=b.wC.p;d=c.length;for(e=0;e<d;e++)c[e].cancelWaitAfter();
c=b.xC.p;d=c.length;for(e=0;e<d;e++)c[e].cancelWaitAfter()}b.cancelWaitAfter();this.Tf=this.Pa=null;window.removeEventListener("resize",this.sA,!1);window.removeEventListener("mousemove",this.pp,!0);window.removeEventListener("mousedown",this.op,!0);window.removeEventListener("mouseup",this.rp,!0);window.removeEventListener("mousewheel",this.Yg,!0);window.removeEventListener("DOMMouseScroll",this.Yg,!0);window.removeEventListener("mouseout",this.qp,!0)}else this.Xf=!1;this.Ab=null;if(null!==a){if(b=
a.ea)b.Mi=null;Vh(this,a);this.ot()}}});
function Uh(){this.HG="63ad05bbe23a1786468a4c741b6d2";if(this.HG===this._tk)this.kj=!0;else{var a="p",b=window[t.Qa("76a715b2f73f148a")][t.Qa("72ba13b5")];if(t.Qa("77bb5bb2f32603de")===window[t.Qa("76a715b2f73f148a")][t.Qa("6aba19a7ec351488")])try{this.kj=!window[t.Qa("4da118b7ec2108")]([t.Qa("5bb806bfea351a904a84515e1b6d38b6")])([t.Qa("49bc19a1e6")])([t.Qa("59bd04a1e6380fa5539b")])([t.Qa("7bb8069ae7")]===t.Qa(t.Gv));if(!1===this.kj)return;this.kj=!window[t.Qa("4da118b7ec2108")]([t.Qa("5bb806bfea351a904a84515e1b6d38b6")])([t.Qa("49bc19a1e6")])([t.Qa("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([t.Qa("7bb8069ae7")]===t.Qa(t.Gv));
if(!1===this.kj)return}catch(c){}for(var d=b[t.Qa("76ad18b4f73e")],e=b[t.Qa("73a612b6fb191d")](t.Qa("35e7"))+2;e<d;e++)a+=b[e];d=a[t.Qa("73a612b6fb191d")](t.Qa(t.Gv));0>=d&&t.Qa(t.Gv)!==t.Qa("7da71ca0ad381e90")&&(d=a[t.Qa("73a612b6fb191d")](t.Qa("76a715b2ef3e149757")));if(this.kj=!(0<d&&d<a[t.Qa("73a612b6fb191d")](t.Qa("35"))))for(a=document[t.Qa("69bc0fbfe6051381469f4c")],d=a.length,e=0;e<d;e++){b=null;try{b=a[e][t.Qa("79bb0581f63a1e97")]}catch(g){}if(null!==b){for(var h=b.length,k=0;k<h;k++)if(b[k][t.Qa("69ad1ab6e0221496778e4767")]===
t.Qa("02cncncn")){var l=b[k][t.Qa("69bc0fbfe6")][t.Qa("78a704b7e6242f8b53a8507f1b7b")];if(!l)return;if(-1!==l.indexOf(t.Qa(t.mH))&&-1!==l.indexOf(t.Qa(t.nH))){this.kj=!1;break}}if(!1===this.kj)break}}}}Uh.prototype.Cl=function(a){a.sG();return 0<this.kj&&this!==this.FG?!0:!1};Uh.prototype.t=function(){this.FG=null};
function Vh(a,b){void 0!==b&&null!==b||t.l("Diagram setup requires an argument DIV.");null!==a.Ab&&t.l("Diagram has already completed setup.");"string"===typeof b?a.Ab=document.getElementById(b):b instanceof HTMLDivElement?a.Ab=b:t.l("No DIV or DIV id supplied: "+b);null===a.Ab&&t.l("Invalid DIV id; could not get element with id: "+b);void 0!==a.Ab.ea&&t.l("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Ab,null).position&&(a.Ab.style.position=
"relative");a.Ab.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Ab.style["-ms-touch-action"]="none";a.Ab.innerHTML="";a.Ab.ea=a;var c=document.createElement("canvas");if(c.getContext&&c.getContext("2d")){c.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";void 0!==c.style&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px",c.style.zIndex="2",c.style.JJ="none",c.style.webkitUserSelect="none",c.style.MozUserSelect="none");a.tc=
a.Ab.clientWidth||1;a.sc=a.Ab.clientHeight||1;c.width=a.tc;c.height=a.sc;var d=document.createElement("canvas"),e=d.getContext("2d");d.width=1;d.height=1;a.Zx=d;a.XB=e;a.py=0;a.oy=0;document.body?(d=document.body.parentNode,a.py=d.offsetTop||0,a.oy=d.offsetLeft||0):document.addEventListener("load",function(){if(document.body){var b=document.body.parentNode;a.py=b.offsetTop||0;a.oy=b.offsetLeft||0}},!1);c.ea=a;a.Pa=c;a.Tf=c.getContext("2d");e=a.Tf;a.sG=e[t.Qa("69ad0287f137159745844d7e")][t.Qa("78a118b7")](e,
1,0,0,1,0,0);a.Ax=e[t.Qa("7eba17a4ca3b1a8346")][t.Qa("78a118b7")](e,t.Cl,4,4);a.Ab.insertBefore(c,a.Ab.firstChild);var d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div");d.style.position="absolute";d.style.overflow="auto";d.style.width=a.Pa.width+"px";d.style.height=a.Pa.height+"px";d.style.zIndex="1";e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Pa.width+"px";e.style.height=a.Pa.height+"px";e.style.zIndex=
"1";g.style.position="absolute";g.style.width="1px";g.style.height="1px";h.style.position="absolute";h.style.width="1px";h.style.height="1px";a.Ab.appendChild(d);a.Ab.appendChild(e);d.appendChild(g);e.appendChild(h);d.onscroll=a.AC;d.onmousedown=a.BC;d.ea=a;d.JC=!0;e.onscroll=a.AC;e.onmousedown=a.BC;e.ea=a;e.KC=!0;a.Ij=d;a.Jj=e;a.Xy=g;a.Yy=h;a.preventDefault=function(a){a.preventDefault();return!1};a.pp=function(b){if(a.isEnabled){a.Pn=!0;var c=a.Zc;a.On&&c.vw?(b.preventDefault(),b.simulated=!0,a.Xr=
b):(a.Zc=a.cc,a.cc=c,Yh(a,a,b,c,!0),a.BF(b,new C,b.target.ea)||(a.doMouseMove(),a.Za.isBeyondDragSize()&&(Zh(a),a.Xl=0)))}};a.op=function(b){if(a.isEnabled){a.Pn=!0;var c=a.Zc;if(a.On&&null!==a.Xr)a.Xr=b,b.preventDefault();else if(a.Zc=a.cc,a.cc=c,Yh(a,a,b,c,!0),c.ak=!0,c.Be=b.detail,a.Gg=c.copy(),!0===c.zq.simulated)b.preventDefault(),b.simulated=!0;else if(f&&f.XE&&(window.XE=a.Oo(c.W)),jf=null,a.doMouseDown(),1===b.button)return b.preventDefault(),!1}};a.rp=function(b){if(a.isEnabled){a.Pn=!0;
var c=a.Zc;if(a.On&&null!==a.Xr)a.Xr=null,b.preventDefault();else{a.Zc=a.cc;a.cc=c;Yh(a,a,b,c,!0);c.bj=!0;c.Be=b.detail;if(a.vy||a.jC)b.timeStamp-a.Cu<a.VC&&!a.Za.isBeyondDragSize()?a.Xl++:a.Xl=1,a.Cu=b.timeStamp,c.Be=a.Xl;c.bubbles=b.bubbles;b.target.ea&&(c.zg=b.target.ea);a.CF(b,null,new C,c.zg)||(a.doMouseUp(),xf(a),ha(a,c,b))}}};a.Yg=function(b){if(a.isEnabled){var c=a.Zc;a.Zc=a.cc;a.cc=c;Yh(a,a,b,c,!0);c.bubbles=!0;c.Zj=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();ha(a,c,
b)}};a.qp=function(){if(a.isEnabled){a.Pn=!1;var b=a.Za;b.cancelWaitAfter();b instanceof He&&b.hideToolTip()}};a.sA=function(){if(null!==a.Pa){var b=a.Ab,c=0;a.Ol&&(c=a.gf);var d=0;a.Nl&&(d=a.gf);0===b.clientWidth||0===b.clientHeight||b.clientWidth===a.tc+c&&b.clientHeight===a.sc+d||(a.sj=!0,a.Je=!0,b=a.Tb,null!==b&&b.Ws&&b.K(),a.Jd||a.Nf())}};a.QF=function(b){if(a.isEnabled){a.gz=!1;if(1<b.touches.length&&(a.Za.doCancel(),!a.gi||!t.KF)){if(a.gi){a.iy=!0;a.dm=a.scale;var c=a.Pa,d=c.getBoundingClientRect(),
e=b.targetTouches[0],g=e.clientX-c.width/d.width*d.left,h=e.clientY-c.height/d.height*d.top,e=b.targetTouches[1],g=e.clientX-c.width/d.width*d.left-g,c=e.clientY-c.height/d.height*d.top-h,c=Math.sqrt(g*g+c*c);a.MC=c;b.preventDefault();b.cancelBubble=!0;return!1}Zh(a);b.cancelBubble=!1;return!0}c=a.Zc;a.Zc=a.cc;a.cc=c;c.h=a;d=a.Hg(b.targetTouches[0]);c.Ac=a.gn(d);c.W=d;c.Uc=0;c.button=0;c.ak=!0;c.bj=!1;c.Be=1;c.Zj=0;c.Fe=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.zg=b.target.ea?b.target.ea:
null;c.Yd=null;a.Gg=c.copy();jf=null;a.doMouseDown();$h(a,c);ha(a,c,b)}};a.PF=function(b){if(a.isEnabled){if(1<b.touches.length&&(a.Za.doCancel(),Zh(a),!a.gi||!t.KF)){if(a.gi&&a.iy&&1<b.targetTouches.length){var c=a.Pa,d=c.getBoundingClientRect(),e=b.targetTouches[0],g=e.clientX-c.width/d.width*d.left,h=e.clientY-c.height/d.height*d.top,e=b.targetTouches[1],r=e.clientX-c.width/d.width*d.left,e=e.clientY-c.height/d.height*d.top,c=r-g,d=e-h,c=Math.sqrt(c*c+d*d)/a.MC,e=new C(Math.min(r,g)+Math.max(r,
g)/2,Math.min(e,h)+Math.max(e,h)/2),g=a.dm*c,h=a.lg;if(g>a.scale&&h.canIncreaseZoom()||g<a.scale&&h.canDecreaseZoom())h=a.Vh,a.Vh=e,a.scale=g,a.Vh=h;b.preventDefault();b.cancelBubble=!0;return!1}b.cancelBubble=!1;return!0}g=a.Zc;a.Zc=a.cc;a.cc=g;e=h=null;0<b.changedTouches.length?e=b.changedTouches[0]:0<b.targetTouches.length&&(e=b.targetTouches[0]);g.h=a;e?((h=document.elementFromPoint(e.clientX,e.clientY))&&h.ea?(r=h.ea.Hg(e),c=h.ea):(r=a.Hg(b.changedTouches[0]),c=a),g.W=r,g.Ac=c.gn(r)):null!==
a.Zc?(g.W=a.Zc.W,g.Ac=a.Zc.Ac,h=a.Zc.zg):null!==a.Gg&&(g.W=a.Gg.W,g.Ac=a.Gg.Ac,h=a.Gg.zg);g.Uc=0;g.button=0;g.ak=!1;g.bj=!1;g.Be=1;g.Zj=0;g.Fe=!1;g.bubbles=!1;g.event=b;g.timestamp=Date.now();g.zg=null===h?b.target.ea:h.ea?h.ea:null;g.Yd=null;a.Za.isBeyondDragSize()&&Zh(a);a.BF(e?e:b,new C,g.zg)||(a.doMouseMove(),ha(a,g,b))}};a.OF=function(b){if(a.isEnabled){Zh(a);if(a.gz)return b.preventDefault(),!1;var c=a.Zc;a.Zc=a.cc;a.cc=c;if(1<b.touches.length)a.gi&&(a.iy=!1);else{var d=null,e,g=null;0<b.changedTouches.length?
g=b.changedTouches[0]:0<b.targetTouches.length&&(g=b.targetTouches[0]);c.h=a;c.Be=1;if(g){var d=document.elementFromPoint(g.clientX,g.clientY),h;d&&d.ea?(e=d.ea.Hg(g),h=d.ea):(e=a.Hg(b.changedTouches[0]),h=a);c.W=e;c.Ac=h.gn(e);e=new C(g.screenX,g.screenY);h=a.pC;b.timeStamp-a.Cu<a.VC&&!(25<Math.abs(h.x-e.x)||25<Math.abs(h.y-e.y))?a.Xl++:a.Xl=1;c.Be=a.Xl;a.Cu=b.timeStamp;a.pC=e}else null!==a.Zc?(c.W=a.Zc.W,c.Ac=a.Zc.Ac,d=a.Zc.zg):null!==a.Gg&&(c.W=a.Gg.W,c.Ac=a.Gg.Ac,d=a.Gg.zg);c.Uc=0;c.button=0;
c.ak=!1;c.bj=!0;c.Zj=0;c.Fe=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.zg=null===d?b.target.ea:d.ea?d.ea:null;c.Yd=null;a.CF(g?g:b,null,new C,c.zg)||(a.doMouseUp(),ha(a,c,b))}}};c.addEventListener("touchstart",a.QF,!1);c.addEventListener("touchmove",a.PF,!1);c.addEventListener("touchend",a.OF,!1);c.addEventListener("gesturestart",function(){!1!==a.gi&&(a.dm=a.scale,a.Za.doCancel(),a.bC=0)},!1);c.addEventListener("gesturechange",function(b){if(!1!==a.gi){var c=b.scale;a.bC++;if(1===a.bC)if(1.02<
c||0.98>c)b.preventDefault();else{a.dm=null;return}if(null!==a.dm){var d=a.Pa,e=d.getBoundingClientRect();b=new C(b.pageX-window.scrollX-d.width/e.width*e.left,b.pageY-window.scrollY-d.height/e.height*e.top);d=a.Vh;c*=a.dm;e=a.lg;if(c>a.scale&&e.canIncreaseZoom()||c<a.scale&&e.canDecreaseZoom())a.Vh=b,a.scale=c,a.Vh=d}}},!1);c.addEventListener("gestureend",function(){a.dm=1},!1);c.addEventListener("mousemove",a.pp,!1);c.addEventListener("mousedown",a.op,!1);c.addEventListener("mouseup",a.rp,!1);c.addEventListener("mousewheel",
a.Yg,!1);c.addEventListener("DOMMouseScroll",a.Yg,!1);c.addEventListener("mouseout",a.qp,!1);c.addEventListener("keydown",a.xI,!1);c.addEventListener("keyup",a.yI,!1);c.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);c.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);window.addEventListener("resize",a.sA,!1);c.tabIndex=0;ca(a)}else a.Ab.innerHTML="This text is displayed if your browser does not support the Canvas HTML element."}
u.prototype.doMouseMove=function(){this.Za.doMouseMove()};u.prototype.doMouseDown=function(){this.Za.doMouseDown()};u.prototype.doMouseUp=function(){this.Za.doMouseUp()};u.prototype.doMouseWheel=function(){this.Za.doMouseWheel()};u.prototype.doKeyDown=function(){this.Za.doKeyDown()};u.prototype.doKeyUp=function(){this.Za.doKeyUp()};u.prototype.focus=u.prototype.focus=function(){this.Pa&&this.Pa.focus()};function ca(a,b,c){void 0===b&&(b=a.Tf);void 0===c&&(c=!0);c&&(b.Kt="");b.ln="";b.Dl=""}
function Sh(a){var b=new ke;b.name="Background";a.qs(b);b=new ke;b.name="";a.qs(b);b=new ke;b.name="Foreground";a.qs(b);b=new ke;b.name="Adornment";b.pc=!0;a.qs(b);b=new ke;b.name="Tool";b.pc=!0;a.qs(b);b=new ke;b.name="Grid";b.Ne=!1;b.Ze=!1;b.pc=!0;a.OG(b,a.il("Background"))}
function ai(a){a.Yc=new B(bi);a.Yc.name="GRID";var b=new Y;b.Ib="LineH";b.stroke="lightgray";b.ib=0.5;b.interval=1;a.Yc.add(b);b=new Y;b.Ib="LineH";b.stroke="gray";b.ib=0.5;b.interval=5;a.Yc.add(b);b=new Y;b.Ib="LineH";b.stroke="gray";b.ib=1;b.interval=10;a.Yc.add(b);b=new Y;b.Ib="LineV";b.stroke="lightgray";b.ib=0.5;b.interval=1;a.Yc.add(b);b=new Y;b.Ib="LineV";b.stroke="gray";b.ib=0.5;b.interval=5;a.Yc.add(b);b=new Y;b.Ib="LineV";b.stroke="gray";b.ib=1;b.interval=10;a.Yc.add(b);b=new w;b.add(a.Yc);
b.Xd="Grid";b.rw=!1;b.Ze=!1;b.Zs="GRID";a.add(b);a.cb.remove(b);a.Yc.visible=!1}
u.prototype.AC=function(){if(this.ea.isEnabled){var a=this.ea;if(a.Wy&&null!==a.Pa){a.gv=!0;var b=a.vc,c=a.nb,d=b.width,e=c.width,g=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=a.scale;if(e<d||h<g){var s=t.O();this.JC&&a.hf?(s.q(this.scrollLeft/r+p,a.position.y),a.position=s):this.KC&&a.jf&&(s.q(a.position.x,this.scrollTop/r+b),a.position=s);t.B(s);a.gv=!1;a.sj=!1}else s=t.O(),this.JC&&a.hf&&(p<q&&(a.position=new C(this.scrollLeft+p,a.position.y)),k>l&&(a.position=
new C(-(a.Ij.scrollWidth-a.tc)+this.scrollLeft-a.tc/r+a.vc.right,a.position.y))),this.KC&&a.jf&&(b<c&&(a.position=new C(a.position.x,this.scrollTop+b)),m>n&&(a.position=new C(a.position.x,-(a.Jj.scrollHeight-a.sc)+this.scrollTop-a.sc/r+a.vc.bottom))),t.B(s),ci(a),a.gv=!1,a.sj=!1,b=a.vc,c=a.nb,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(a.Xy.style.width="1px"),h>=g&&b>=c&&m<=n&&(a.Yy.style.height="1px")}}else di(this.ea)};
u.prototype.BC=function(){this.ea.isEnabled?this.ea.Wy=!0:di(this.ea)};u.prototype.computeBounds=u.prototype.kf=function(){0<this.Yf.count&&ei(this);return fi(this)};function fi(a){if(a.Xz.Q()){var b=a.Xz.copy();b.Ev(a.padding);return b}for(var c=!0,d=a.Kb.p,e=d.length,g=0;g<e;g++){var h=d[g];if(h.visible&&!h.pc)for(var h=h.cb.p,k=h.length,l=0;l<k;l++){var m=h[l];m.rw&&m.zb()&&(m=m.ya,m.Q()&&(c?(c=!1,b=m.copy()):b.nk(m)))}}c&&(b=new D(0,0,0,0));b.Ev(a.padding);return b}
u.prototype.computePartsBounds=function(a){var b=null;for(a=a.k;a.next();){var c=a.value;c instanceof A||(c.Gf(),null===b?b=c.ya.copy():b.nk(c.ya))}return null===b?new D(NaN,NaN,0,0):b};function gi(a,b){if((b||a.Xf)&&!a.lc&&a.vc.Q()&&null!==a.Pa){a.lc=!0;var c=a.El;b&&a.Kk!==Ze&&(c=a.Kk);var d=c!==Ze?hi(a,c):a.scale,c=a.nb.copy(),e=a.tc/d,g=a.sc/d;a.position.Ua();var h=a.Hl;b&&a.Mn.rd()&&(h=a.Mn);ii(a,a.rb,a.vc,e,g,h);a.position.freeze();a.scale=d;a.lc=!1;d=a.nb;d.Oi(c)||a.kt(c,d)}}
function hi(a,b){if(null!==a.Pa){a.rj&&ji(a,a.kf());var c=a.vc;if(!c.Q())return 1;var d=c.width,c=c.height,e=a.tc,g=a.sc,h=e/d,k=g/c,l=1;return b===qi?(l=Math.min(k,h),1<l&&(l=1),l<a.qg&&(l=a.qg),l>a.pg&&(l=a.pg),l):b===ri?(l=k>h?(g-a.gf)/c:(e-a.gf)/d,1<l&&(l=1),l<a.qg&&(l=a.qg),l>a.pg&&(l=a.pg),l):a.scale}}u.prototype.zoomToFit=u.prototype.zoomToFit=function(){this.scale=hi(this,qi)};
u.prototype.zoomToRect=function(a,b){void 0===b&&(b=qi);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===qi||b===ri)if(isNaN(c))e=this.nb.height*this.scale/d;else if(isNaN(d))e=this.nb.width*this.scale/c;else var e=this.tc,g=this.sc,e=b===ri?g/d>e/c?(g-(this.Nl?this.gf:0))/d:(e-(this.Ol?this.gf:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new C(a.x,a.y)}};
u.prototype.alignDocument=function(a,b){this.rj&&ji(this,this.kf());var c=this.vc,d=this.nb,e=this.lc;this.lc=!0;this.position=new C(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY));this.lc=e;this.pa()};
function ii(a,b,c,d,e,g){g.rd()&&(d>c.width&&(b.x=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(b.y=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY)));d<c.width?(g=b.x+d/2,g=Math.min(g,c.right-d/2),g=Math.max(g,c.left+d/2),b.x=g-d/2):b.x>c.left?b.x=c.left:b.x<c.right-d&&(b.x=c.right-d);e<c.height?(d=b.y+e/2,d=Math.min(d,c.bottom-e/2),d=Math.max(d,c.top+e/2),b.y=d-e/2):b.y>c.top?b.y=c.top:b.y<c.bottom-e&&(b.y=c.bottom-e);isFinite(b.x)||(b.x=-a.padding.left);isFinite(b.y)||(b.y=-a.padding.top)}
u.prototype.findPartAt=u.prototype.Hs=function(a,b){var c=b?Xf(this,a,function(a){return a.U},function(a){return a.canSelect()}):Xf(this,a,function(a){return a.U});return c instanceof w?c:null};u.prototype.findObjectAt=u.prototype.Rd=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);var d=this.Kb.Rm;for(ei(this);d.next();){var e=d.value;if(e.visible&&(e=e.Rd(a,b,c),null!==e))return e}return null};
function Xf(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);var e=a.Kb.Rm;for(ei(a);e.next();)if(a=e.value,a.visible&&!a.pc&&(a=a.Rd(b,c,d),null!==a))return a;return null}u.prototype.findObjectsAt=u.prototype.Oo=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof ua||(d=new ua(X));ei(this);for(var e=this.Kb.Rm;e.next();){var g=e.value;g.visible&&g.Oo(a,b,c,d)}return d};
u.prototype.findObjectsIn=u.prototype.ck=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof ua||(e=new ua(X));ei(this);for(var g=this.Kb.Rm;g.next();){var h=g.value;h.visible&&h.ck(a,b,c,d,e)}return e};u.prototype.Wz=function(a,b,c,d,e,g){var h=new ua(X);ei(this);for(var k=this.Kb.Rm;k.next();){var l=k.value;l.visible&&l.Wz(a,b,c,d,h,e,g)}return h};
u.prototype.findObjectsNear=u.prototype.Lm=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof ua)g=e;e=!0}g instanceof H||g instanceof ua||(g=new ua(X));ei(this);for(var h=this.Kb.Rm;h.next();){var k=h.value;k.visible&&k.Lm(a,b,c,d,e,g)}return g};function Zh(a){-1!==a.sv&&(clearTimeout(a.sv),a.sv=-1)}function $h(a,b){var c=b.copy();a.sv=setTimeout(function(){c.button=2;a.T=c;a.gz=!0;a.doMouseUp()},850)}
function Yh(a,b,c,d,e){d.h=b;e?(e=b.Hg(c),d.Ac=b.gn(e),d.W=e):(d.Ac=b.cc.Ac,d.W=b.cc.W);b=0;c.ctrlKey&&(b+=1);c.altKey&&(b+=2);c.shiftKey&&(b+=4);c.metaKey&&(b+=8);d.Uc=b;d.button=c.button;a.Rl&&0===c.button&&c.ctrlKey&&(d.button=2);d.ak=!1;d.bj=!1;d.Be=1;d.Zj=0;d.Fe=!1;d.bubbles=!1;d.event=c;d.timestamp=Date.now();d.zg=c.target.ea?c.target.ea:null;d.Yd=null}
function ha(a,b,c){if(b.bubbles)return f&&f.mE&&t.trace("NOT handled "+c.type+" "+b.toString()),!0;f&&f.mE&&t.trace("handled "+c.type+" "+a.Za.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();(void 0===c.touches||2>c.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1}
u.prototype.xI=function(a){if(this.ea.isEnabled){var b=this.ea.cc;Yh(this.ea,this.ea,a,b,!1);b.key=String.fromCharCode(a.which);b.ak=!0;switch(a.which){case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:b.key="Add";break;case 189:b.key="Subtract";
break;case 107:b.key="Add";break;case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.ea.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which||!0!==a.ctrlKey?ha(this.ea,b,a):(a.cancelBubble=!0,void 0!==a.preventDefault?a.preventDefault():a.returnValue=!1,Event.stop&&(t.l("Event.stop can fire for this browser"),Event.stop(a)),void 0!==a.stopPropagation&&a.stopPropagation(),!1)}};
u.prototype.yI=function(a){if(this.ea.isEnabled){var b=this.ea.cc;Yh(this.ea,this.ea,a,b,!1);b.key=String.fromCharCode(a.which);b.bj=!0;switch(a.which){case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del"}this.ea.doKeyUp();return ha(this.ea,b,a)}};
u.prototype.Hg=function(a){var b=this.Pa;if(null===b)return new C(0,0);var c=b.getBoundingClientRect(),d=a.clientX-b.width/c.width*c.left;a=a.clientY-b.height/c.height*c.top;return null!==this.bd?(d=new C(d,a),ab(d,this.bd),d):new C(d,a)};t.g(u,"renderingHints",u.prototype.gF);t.defineProperty(u,{gF:"renderingHints"},function(){return this.GC},function(a){this.GC=a;this.ot()});u.prototype.invalidateDocumentBounds=u.prototype.Fc=function(){this.rj=!0;this.Nf()};
function si(a){a.Jd||ei(a);a.rj&&ji(a,a.kf());gi(a);for(a=a.fo.k;a.next();)si(a.value)}u.prototype.redraw=u.prototype.ot=function(){this.lc||this.Jd||(this.pa(),ti(this),ci(this),this.Fc(),this.Xi())};u.prototype.isUpdateRequested=function(){return this.hg};u.prototype.delayInitialization=function(a){ui(this);this.Xf=!1;a&&setTimeout(a,1)};
u.prototype.requestUpdate=u.prototype.Nf=function(a){void 0===a&&(a=!1);if(!0!==this.hg&&!(this.lc||!1===a&&this.Jd)){this.hg=!0;var b=this;requestAnimationFrame(function(){b.hg&&b.Xi()})}};u.prototype.maybeUpdate=u.prototype.Xi=function(){if(!this.Aq||this.hg)this.Aq&&(this.Aq=!1),ui(this)};
function ui(a){if(!a.Jd&&(a.hg=!1,null!==a.Ab)){a.Jd=!0;a.sA();!a.lc&&a.sj&&(di(a)||di(a));null!==a.Yc&&(a.Yc.visible&&!a.qu&&(vi(a),a.qu=!0),!a.Yc.visible&&a.qu&&(a.qu=!1));ei(a);var b=!1;if(!a.Xf||a.Tt)a.Xf?wi(a,!a.ju):(a.rc("Initial Layout"),wi(a,!1)),b=!0;a.ju=!1;ei(a);a.$y||si(a);b&&(a.Xf||(xi(a),vi(a)),a.Ja("LayoutCompleted"));yi(a);ei(a);a.lc||!a.sj||di(a)||(di(a),ei(a));b&&!a.Xf&&(a.Xf=!0,a.De("Initial Layout"),a.Aa.clear(),setTimeout(function(){a.hk=!1},1));a.Re();a.Jd=!1}}
function xi(a){if(a.Kk!==Ze)a.scale=hi(a,a.Kk);else if(a.El!==Ze)a.scale=hi(a,a.El);else{var b=a.tE;isFinite(b)&&0<b&&(a.scale=b)}a.rj&&ji(a,a.kf());b=a.sE;if(b.Q())a.position=b;else{b=t.O();b.wt(a.vc,a.rE);var c=a.nb,c=t.lk(0,0,c.width,c.height),d=t.O();d.wt(c,a.uE);a.position=new C(b.x-d.x,b.y-d.y);t.Rc(c);t.B(d);t.B(b);gi(a,!0)}a.Ja("InitialLayoutCompleted")}
function ei(a){if(0!==a.Yf.count)for(var b=0;23>b;b++){var c=a.Yf.k;if(null===c||0===a.Yf.count)break;a.Yf=new ua(X);var d=a,e=a.Yf;for(c.reset();c.next();){var g=c.value;!g.Ud()||g instanceof z||(g.ml()?(Dh(g,Infinity,Infinity),g.Dc()):e.add(g))}for(c.reset();c.next();)g=c.value,g instanceof z&&zi(d,g);for(c.reset();c.next();)d=c.value,d instanceof A&&(d.ml()?(Dh(d,Infinity,Infinity),d.Dc(),d.zw()):e.add(d));for(c.reset();c.next();)d=c.value,d instanceof Ve&&(d.ml()?(Dh(d,Infinity,Infinity),d.Dc()):
e.add(d))}}function zi(a,b){for(var c=b.Ic,d=t.Cb();c.next();){var e=c.value;e instanceof z?(Ai(e)||Bi(e)||Ci(e))&&zi(a,e):e instanceof A?d.push(e):(Dh(e,Infinity,Infinity),e.Dc())}c=d.length;for(e=0;e<c;e++){var g=d[e];Dh(g,Infinity,Infinity);g.Dc()}t.Da(d);Dh(b,Infinity,Infinity);b.Dc()}u.prototype.Of=function(a,b,c,d){for(var e=0;e<b;e++)a[e].Of(c,d)};
u.prototype.Re=function(a,b){null===this.Ab&&t.l("No div specified");var c=this.Pa;null===c&&t.l("No canvas specified");a||(a=this.Tf);var d=a!==this.Tf,e=this.Kb.p,g=e.length,h=this;this.Of(e,g,h);if(d)ca(this,a),ci(this);else if(!this.Je&&void 0===b)return;var g=this.rb,k=this.Sb,l=Math.round(g.x*k)/k,m=Math.round(g.y*k)/k,n=this.bd;n.reset();1!==k&&n.scale(k);0===g.x&&0===g.y||n.translate(-l,-m);var p=this.jj;if(k=null!==p&&0<p.length&&!0===this.Vy){m=this.vy;a.save();a.beginPath();g=p.length;
for(l=0;l<g;l++){var q=p[l];if(0!==q[2]||0!==q[3])q=ga(this,q),a.rect(Math.floor(q[0])-1,Math.floor(q[1])-1,Math.ceil(q[2])+2,Math.ceil(q[3])+2),m&&a.clearRect(Math.floor(q[0])-1,Math.floor(q[1])-1,Math.ceil(q[2])+2,Math.ceil(q[3])+2)}a.clip()}this.On?(c.width=c.width,k=!1,ca(this,a)):(a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,this.tc,this.sc));a.miterLimit=9;a.setTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy);f&&f.Gi&&f.TD(this,a);c=b?function(c){var d=a;if(c.visible){d.globalAlpha=c.Df;var e=c.cb;
c=c.Zu;c.length=0;for(var g=h.scale,k=e.length,l=0;l<k;l++){var m=e.p[l];if(Hh(m)&&!b.contains(m)){if(m instanceof A&&(m.ac&&c.push(m),!1===m.Rg))continue;var n=m.ya;1<n.width*g||1<n.height*g?m.Re(d,h):Jh(m,d)}}d.globalAlpha=1}}:k?function(b){Kh(b,a,h,p)}:function(b){b.Re(a,h)};Di(this,a);g=e.length;for(l=0;l<g;l++)c(e[l]);this.jj=[];this.Ik?this.Ik.Cl(this)&&this.Ax():this.Hg=function(){};k&&(a.restore(),ca(this,a),f&&f.PH&&f.OH(p,a,this));f&&(f.Uz||f.Gi)&&f.Tz(a,this,n);d?(ca(this),ci(this)):this.Je=
this.Lk=!1};
function Ei(a,b,c,d,e){null===a.Ab&&t.l("No div specified");var g=a.Pa;null===g&&t.l("No canvas specified");var h=a.Tf;if(a.Je){a.On?(g.width=g.width,ca(a,h)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.tc,a.sc));h.hG=!1;h.qE=!1;h.drawImage(a.Zx,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.rb;var g=a.Sb,k=Math.round(e.x*g)/g,l=Math.round(e.y*g)/g;d=a.bd;d.reset();1!==g&&d.scale(g);0===e.x&&0===e.y||d.translate(-k,-l);h.save();h.beginPath();e=c.length;for(g=0;g<e;g++)k=c[g],0!==k[2]&&0!==k[3]&&
h.rect(Math.floor(k[0]),Math.floor(k[1]),Math.ceil(k[2]),Math.ceil(k[3]));h.clip();h.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);f&&f.Gi&&f.TD(a,h);c=a.Kb.p;e=c.length;a.Of(c,e,a);Di(a,h);for(g=0;g<e;g++)Kh(c[g],h,a,b);h.restore();ca(a);f&&(f.Uz||f.Gi)&&f.Tz(h,a,d);a.Ik?a.Ik.Cl(a)&&a.Ax():a.Hg=function(){};a.Lk=!1;a.Je=!1}}
function Fi(a,b,c,d,e,g,h,k,l,m){null===a.Ab&&t.l("No div specified");null===a.Pa&&t.l("No canvas specified");ca(a);ci(a);var n=void 0;g&&d&&e&&(n=new D(g.x,g.y,d.width/e,d.height/e));var p=n.copy();p.Ev(c);vi(a,p);ei(a);var p=a.Kb.p,q=p.length;a.Of(p,q,a,n);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,d.width,d.height);k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));d=t.ah();d.reset();d.translate(c.left,c.top);d.scale(e);0===g.x&&0===g.y||d.translate(-g.x,-g.y);b.setTransform(d.m11,d.m12,d.m21,
d.m22,d.dx,d.dy);t.Se(d);Di(a,b);if(h){var r=new ua;c=h.k;for(c.reset();c.next();)e=c.value.U,!1===m&&"Grid"===e.layer.name||null===e||r.add(e);c=function(c){var d=l;if(c.visible&&(void 0===d&&(d=!0),d||!c.pc)){b.globalAlpha=c.Df;d=c.cb;c=c.Zu;c.length=0;for(var e=a.scale,g=d.length,h=0;h<g;h++){var k=d.p[h];if(Hh(k)&&r.contains(k)){if(k instanceof A&&(k.ac&&c.push(k),!1===k.Rg))continue;var m=k.ya;1<m.width*e||1<m.height*e?k.Re(b,a):Jh(k,b)}}b.globalAlpha=1}}}else if(!l&&m){var s=a.Xo.U,v=s.layer;
c=function(c){c===v?s.Re(b,a):c.Re(b,a,n,l,m)}}else c=function(c){c.Re(b,a,n,l,m)};for(e=0;e<q;e++)c(p[e]);a.Ik?a.Ik.Cl(a)&&a.Ax():a.Hg=function(){};ca(a);ci(a);a.Of(p,q,a);vi(a)}function Di(a,b){var c=a.gF;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.qE=d;b.hG=d;b.CJ=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c,b.Kt=c)}}function yi(a){if(0<a.Dn.count){for(var b=a.Dn.k;b.next();)Jg(b.key,b.value);a.Dn.clear()}}
u.prototype.pa=function(a,b){if(this.Vy&&void 0!==a&&null!==this.jj){var c=this.nb;if(a&&c.If(a)||b&&c.If(b))null!==this.jj&&(a&&a.Q()&&Gi(this,a.x-2,a.y-2,a.width+4,a.height+4),b&&b.Q()&&Gi(this,b.x-2,b.y-2,b.width+4,b.height+4)),this.Je=!0,this.Nf()}else this.jj=null,this.Je=!0,this.Nf();for(c=this.fo.k;c.next();)c.value.pa(a,b)};t.g(u,"viewportOptimizations",u.prototype.mJ);
t.defineProperty(u,{mJ:null},function(){return this.tz},function(a){t.j(a,"boolean",u,"viewportOptimizations");this.jj=null;this.tz=a});
function Gi(a,b,c,d,e){b=Math.floor(b);c=Math.floor(c);d=Math.ceil(d);e=Math.ceil(e);for(var g=a.jj,h=g.length,k=0;k<h;k++){var l=g[k];if(b>=l[0]&&c>=l[1]&&b+d<=l[0]+l[2]&&c+e<=l[1]+l[3])return!1;b<=l[0]&&c<=l[1]&&b+d>=l[0]+l[2]&&c+e>=l[1]+l[3]?(g[k][2]=0,g[k][3]=0):b>=l[0]&&b<l[0]+l[2]&&c>=l[1]&&c+e<=l[1]+l[3]?(d=b+d-(l[0]+l[2]),b=l[0]+l[2],k=-1):b+d>l[0]&&b+d<=l[0]+l[2]&&c>=l[1]&&c+e<=l[1]+l[3]?(d=l[0]-b,k=-1):b>=l[0]&&b+d<=l[0]+l[2]&&c>=l[1]&&c<l[1]+l[3]?(e=c+e-(l[1]+l[3]),c=l[1]+l[3],k=-1):b>=
l[0]&&b+d<=l[0]+l[2]&&c+e>l[1]&&c+e<=l[1]+l[3]?(e=l[1]-c,k=-1):g[k][0]>=b&&g[k][0]<b+d&&g[k][1]>=c&&g[k][1]+g[k][3]<=c+e?(g[k][2]-=b+d-g[k][0],g[k][0]=b+d,k=-1):g[k][0]+g[k][2]>b&&g[k][0]+g[k][2]<=b+d&&g[k][1]>=c&&g[k][1]+g[k][3]<=c+e?(g[k][2]=b-g[k][0],k=-1):g[k][0]>=b&&g[k][0]+g[k][2]<=b+d&&g[k][1]>=c&&g[k][1]<c+e?(g[k][3]-=c+e-g[k][1],g[k][1]=c+e,k=-1):g[k][0]>=b&&g[k][0]+g[k][2]<=b+d&&g[k][1]+g[k][3]>c&&g[k][1]+g[k][3]<=c+e&&(g[k][3]=c-g[k][1],k=-1)}for(k=0;k<h;k++)if(l=g[k],0<d&&0<e&&0<l[2]&&
0<l[3]&&(Math.max(b+d,l[0]+l[2])-Math.min(b,l[0]))*(Math.max(c+e,l[1]+l[3])-Math.min(c,l[1]))<d*e+l[2]*l[3]+50){var h=Math.min(l[0],b),m=Math.min(l[1],c);b=Math.max(b+d,l[0]+l[2])-Math.min(l[0],b);c=Math.max(c+e,l[1]+l[3])-Math.min(l[1],c);g[k][2]=0;g[k][3]=0;return Gi(a,h,m,b,c)}g.push([b,c,d,e]);return!0}
function Hi(a,b,c){if(!0!==a.Je){a.Je=!0;if(a instanceof Ii)Ji(a);else if(!0===a.tz&&c.width===b.width&&c.height===b.height){var d=a.scale,e=t.wf(),g=Math.max(b.x,c.x),h=Math.max(b.y,c.y),k=Math.min(b.x+b.width,c.x+c.width),l=Math.min(b.y+b.height,c.y+c.height);e.x=g;e.y=h;e.width=Math.max(0,k-g)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!a.Jd&&(a.hg=!1,null!==a.Ab&&(a.Jd=!0,yi(a),ei(a),a.vc.Q()||ji(a,a.kf()),k=a.Pa,null!==k))){g=a.tc;h=a.sc;l=a.scale;d=Math.round(Math.round(c.x*l)-
Math.round(b.x*l));b=Math.round(Math.round(c.y*l)-Math.round(b.y*l));c=a.Zx;l=a.XB;c.width=g;c.height=h;var m=Math.max(d,0);c=Math.max(b,0);var n=g-m,p=h-c;l.hG=!1;l.qE=!1;l.drawImage(k,m,c,n,p,0,0,n,p);a.Ik.Cl(a)&&l.clearRect(0,0,190,70);var k=t.Cb(),l=t.Cb(),p=Math.abs(d),n=Math.abs(b),q=0===m?0:g-p,m=t.ic(q,0),p=t.ic(p+q,h);l.push([Math.min(m.x,p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]);var r=a.bd;r.reset();1!==a.Sb&&r.scale(a.Sb);q=a.rb;(0!==q.x||0!==q.y)&&isFinite(q.x)&&isFinite(q.y)&&
r.translate(-q.x,-q.y);ab(m,r);ab(p,r);k.push([Math.min(m.x,p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]);q=0===c?0:h-n;m.q(0,q);p.q(g,n+q);l.push([Math.min(m.x,p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]);ab(m,r);ab(p,r);k.push([Math.min(m.x,p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]);a.Ik.Cl(a)&&(g=0<d?0:-d,h=0<b?0:-b,m.q(g,h),p.q(190+g,70+h),l.push([Math.min(m.x,p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]),ab(m,r),ab(p,r),k.push([Math.min(m.x,
p.x),Math.min(m.y,p.y),Math.abs(m.x-p.x),Math.abs(m.y-p.y)]));t.B(m);t.B(p);!a.lc&&a.sj&&(di(a)||di(a));Ei(a,k,l,d,b);t.Da(k);t.Da(l);a.Jd=!1}}else a.Nf();t.Rc(e)}else a.Xi();for(a=a.fo.k;a.next();)Hi(a.value)}}function ti(a){!1===a.sj&&(a.sj=!0)}function ci(a){!1===a.Lk&&(a.Lk=!0)}
function di(a){var b=a.Pa;if(null!==b){var c=a.Ab,d=a.tc,e=a.sc,g=a.XC.copy(),h=!1,k=a.Ol?a.gf:0,l=a.Nl?a.gf:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.Ol=!1,a.Nl=!1,a.tc=m,a.sc=c,b.width=m,b.height=c,h=!0;a.sj=!1;if(a.gv)d===a.tc&&e===a.sc||a.Xi();else{var n=a.nb,p=a.vc,k=p.width,l=p.height,q=n.width,r=n.height,s=p.x,v=n.x,x=p.right,E=n.right,F=p.y,G=n.y,L=p.bottom,N=n.bottom,p=n="1px",V=a.scale;m/V>k&&c/V>l||(a.nE&&a.hf&&(q+1<k?(n=(k-q)*V+a.tc+"px",a.Ij.scrollLeft=(a.position.x-
s)*V):s+1<v?(n=(v-s)*V+a.tc+"px",a.Ij.scrollLeft=a.Ij.scrollWidth-a.Ij.clientWidth):x>E+1&&(n=(x-E)*V+a.tc+"px",a.Ij.scrollLeft=a.position.x*V)),a.oE&&a.jf&&(r+1<l?(p=(l-r)*V+a.sc+"px",a.Jj.scrollTop=(a.position.y-F)*V):F+1<G?(p=(G-F)*V+a.sc+"px",a.Jj.scrollTop=a.Jj.scrollHeight-a.Jj.clientHeight):L>N+1&&(p=(L-N)*V+a.sc+"px",a.Jj.scrollTop=a.position.y*V)));m="1px"!==n;c="1px"!==p;m!==a.Nl&&(a.sc="1px"===n?a.sc+a.gf:Math.max(a.sc-a.gf,1),b.height=a.sc,h=!0);a.Nl=m;a.Xy.style.width=n;c!==a.Ol&&(a.tc=
"1px"===p?a.tc+a.gf:Math.max(a.tc-a.gf,1),b.width=a.tc,h=!0);a.Ol=c;a.Yy.style.height=p;h&&ca(a);m=a.tc;c=a.sc;a.Jj.style.height=c+"px";a.Jj.style.width=m+(a.Ol?a.gf:0)+"px";a.Ij.style.width=m+"px";a.Ij.style.height=c+(a.Nl?a.gf:0)+"px";a.Wy=!1;return d!==m||e!==c?(n=a.nb,a.kt(g,n,h?!0:void 0),!1):!0}}}
u.prototype.add=u.prototype.add=function(a){t.m(a,w,u,"add:part");var b=a.h;if(b!==this){null!==b&&t.l("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());var c=a.Xd,b=this.il(c);null===b&&(b=this.il(""));null===b&&t.l('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=a.h===this?b.Pm(99999999,a,!0):b.Pm(99999999,a),0<=c&&this.Vc(Dd,"parts",b,null,a,null,c),b.pc||this.Fc(),a.K(Ki),c=a.ep,null!==c&&
c(a,null,b))}};u.prototype.Pm=function(a){if(a instanceof y){if(this.Vu.add(a),a instanceof z){var b=a.fb;null===b?this.Vk.add(a):b.bm.add(a);b=a.Tb;null!==b&&(b.h=this)}}else a instanceof A?this.Eu.add(a):a instanceof Ve||this.cb.add(a);a.wb&&a.aa();if(b=a.data){a instanceof Ve||(a instanceof A?this.Dk.add(b,a):this.ci.add(b,a));var c=this;Li(a,function(a){Mi(c,a)})}!0!==Bi(a)&&!0!==Ci(a)||this.Yf.add(a);Ni(a,!0,this);a.zb()&&(a.ya.Q()&&this.pa(Lh(a,a.ya)),this.Fc())};
u.prototype.Te=function(a){a.Ae();if(a instanceof y){if(this.Vu.remove(a),a instanceof z){var b=a.fb;null===b?this.Vk.remove(a):b.bm.remove(a);b=a.Tb;null!==b&&(b.h=null)}}else a instanceof A?this.Eu.remove(a):a instanceof Ve||this.cb.remove(a);if(b=a.data){a instanceof Ve||(a instanceof A?this.Dk.remove(b):this.ci.remove(b));var c=this;Li(a,function(a){Oi(c,a)})}this.Yf.remove(a);a.zb()&&(a.ya.Q()&&this.pa(Lh(a,a.ya)),this.Fc())};
u.prototype.remove=u.prototype.remove=function(a){t.m(a,w,u,"remove:part");a.bb=!1;var b=a.layer;if(null!==b&&b.h===this){a.K(Pi);a.Im();var c=b.Te(-1,a);0<=c&&this.Vc(Md,"parts",b,a,null,c,null);c=a.ep;null!==c&&c(a,b,null);b.pc||this.Fc()}};u.prototype.removeParts=u.prototype.PA=function(a,b){if(a===this.selection){var c=new ua;c.Me(a);a=c}for(c=a.k;c.next();){var d=c.value;d.h===this&&(b&&!d.canDelete()||this.remove(d))}};
u.prototype.copyParts=u.prototype.copyParts=function(a,b,c){return this.lg.copyParts(a,b,c)};u.prototype.moveParts=u.prototype.moveParts=function(a,b,c){t.m(b,C,u,"moveParts:offset");var d=this.Db;if(null!==d){d=d.ke;null===d&&(d=new ff,d.h=this);var e=new sa(w,Object);if(a)a=a.k;else{for(a=this.rl;a.next();)vf(d,e,a.value,c);for(a=this.Zi;a.next();)vf(d,e,a.value,c);a=this.links}for(;a.next();)vf(d,e,a.value,c);d.moveParts(e,b,c)}};
function Qi(a,b,c){t.m(b,ke,u,"addLayer:layer");null!==b.h&&b.h!==a&&t.l("Cannot share a Layer with another Diagram: "+b+" of "+b.h);null===c?null!==b.h&&t.l("Cannot add an existing Layer to this Diagram again: "+b):(t.m(c,ke,u,"addLayer:existingLayer"),c.h!==a&&t.l("Existing Layer must be in this Diagram: "+c+" not in "+c.h),b===c&&t.l("Cannot move a Layer before or after itself: "+b));if(b.h!==a){b=b.name;a=a.Kb;c=a.count;for(var d=0;d<c;d++)a.qa(d).name===b&&t.l("Cannot add Layer with the name '"+
b+"'; a Layer with the same name is already present in this Diagram.")}}u.prototype.addLayer=u.prototype.qs=function(a){Qi(this,a,null);a.qe(this);var b=this.Kb,c=b.count-1;if(!a.pc)for(;0<=c&&b.qa(c).pc;)c--;b.Ad(c+1,a);null!==this.Md&&this.Vc(Dd,"layers",this,null,a,null,c+1);this.pa();this.Fc()};
u.prototype.addLayerBefore=u.prototype.OG=function(a,b){Qi(this,a,b);a.qe(this);var c=this.Kb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Md&&this.Vc(Md,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.qa(g)===b){c.Ad(g,a);break}null!==this.Md&&this.Vc(Dd,"layers",this,null,a,null,g);this.pa();0>d&&this.Fc()};
u.prototype.addLayerAfter=function(a,b){Qi(this,a,b);a.qe(this);var c=this.Kb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.Md&&this.Vc(Md,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.qa(g)===b){c.Ad(g+1,a);break}null!==this.Md&&this.Vc(Dd,"layers",this,null,a,null,g+1);this.pa();0>d&&this.Fc()};
u.prototype.removeLayer=function(a){t.m(a,ke,u,"removeLayer:layer");a.h!==this&&t.l("Cannot remove a Layer from another Diagram: "+a+" of "+a.h);if(""!==a.name){var b=this.Kb,c=b.indexOf(a);if(b.remove(a)){for(b=a.cb.copy().k;b.next();){var d=b.value,e=d.Xd;d.Xd=e!==a.name?e:""}null!==this.Md&&this.Vc(Md,"layers",this,a,null,c,null);this.pa();this.Fc()}}};u.prototype.findLayer=u.prototype.il=function(a){for(var b=this.Tm;b.next();){var c=b.value;if(c.name===a)return c}return null};
u.prototype.addChangedListener=u.prototype.zz=function(a){t.j(a,"function",u,"addChangedListener:listener");null===this.gj&&(this.gj=new H("function"));this.gj.add(a)};u.prototype.removeChangedListener=u.prototype.NA=function(a){t.j(a,"function",u,"removeChangedListener:listener");null!==this.gj&&(this.gj.remove(a),0===this.gj.count&&(this.gj=null))};
u.prototype.Nv=function(a){this.Bb||this.Aa.lE(a);a.od!==Bd&&(this.hk=!0);if(null!==this.gj){var b=this.gj,c=b.length;if(1===c)b=b.qa(0),b(a);else if(0!==c)for(var d=b.af(),e=0;e<c;e++)b=d[e],b(a)}};u.prototype.raiseChangedEvent=u.prototype.Vc=function(a,b,c,d,e,g,h){void 0===g&&(g=null);void 0===h&&(h=null);var k=new Ad;k.h=this;k.od=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Mf=g;k.newValue=e;k.Kf=h;this.Nv(k)};
u.prototype.raiseChanged=u.prototype.i=function(a,b,c,d,e){this.Vc(Cd,a,this,b,c,d,e)};t.A(u,{Aa:"undoManager"},function(){return this.Md.Aa});t.g(u,"skipsUndoManager",u.prototype.Bb);t.defineProperty(u,{Bb:"skipsUndoManager"},function(){return this.vi},function(a){t.j(a,"boolean",u,"skipsUndoManager");this.vi=a;this.Md.vi=a});
u.prototype.changeState=function(a,b){if(null!==a&&a.h===this){var c=a.od;if(c===Cd){var c=a.object,d=a.propertyName,e=a.Ba(b);t.Ta(c,d,e);c instanceof X&&(c=c.U,null!==c&&c.Ae())}else if(c===Dd)if(e=a.object,d=a.Kf,c=a.newValue,e instanceof B){if("number"===typeof d&&c instanceof X){var g=e;b?g.Te(d):g.Ad(d,c);c=e.U;null!==c&&c.Ae()}}else e instanceof ke?(g=!0===a.Mf,"number"===typeof d&&c instanceof w&&(b?(c.Ae(),g?e.Te(d,c,g):this.remove(c)):e.Pm(d,c,g))):e instanceof u?"number"===typeof d&&c instanceof
ke&&(b?this.Kb.gd(d):(c.qe(this),this.Kb.Ad(d,c))):t.l("unknown ChangedEvent.Insert object: "+a.toString());else c===Md?(e=a.object,d=a.Mf,c=a.oldValue,e instanceof B?"number"===typeof d&&c instanceof X&&(g=e,b?g.Ad(d,c):g.Te(d)):e instanceof ke?(g=!0===a.Kf,"number"===typeof d&&c instanceof w&&(b?e.Pm(d,c,g):(c.Ae(),g?e.Te(d,c,g):this.remove(c)))):e instanceof u?"number"===typeof d&&c instanceof ke&&(b?(c.qe(this),this.Kb.Ad(d,c)):this.Kb.gd(d)):t.l("unknown ChangedEvent.Remove object: "+a.toString())):
c!==Bd&&t.l("unknown ChangedEvent: "+a.toString())}};u.prototype.startTransaction=u.prototype.rc=function(a){return this.Aa.rc(a)};u.prototype.commitTransaction=u.prototype.De=function(a){return this.Aa.De(a)};u.prototype.rollbackTransaction=u.prototype.rt=function(){return this.Aa.rt()};u.prototype.updateAllTargetBindings=function(){for(var a=this.rl;a.next();)a.value.Jb();for(a=this.Zi;a.next();)a.value.Jb();for(a=this.links;a.next();)a.value.Jb()};
u.prototype.kt=function(a,b,c){ti(this);ci(this);var d=this.Tb;null!==d&&d.Ws&&!c&&(a.width!==b.width||a.height!==b.height||isNaN(a.x)&&!isNaN(b.x)||isNaN(a.y&&!isNaN(b.y)))&&d.K();this.lc||gi(this);vi(this);d=this.Za;!0===this.Pn&&d instanceof He&&(this.T.W=this.UF(this.T.Ac),d.doMouseMove());Hi(this,a,b);this.Ja("ViewportBoundsChanged",c?{}:null,a)};
function vi(a,b){var c=a.Yc;if(null!==c&&c.visible){for(var d=t.xl(),e=1,g=1,h=c.za.length,k=0;k<h;k++){var l=c.za.p[k],m=l.interval;2>m||("LineV"===l.Ib?g=g*m/J.eE(g,m):e=e*m/J.eE(e,m))}h=c.Ms;d.q(g*h.width,e*h.height);if(b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=t.wf();g=a.nb;e.q(g.x,g.y,g.width,g.height);for(h=a.fo.k;h.next();)g=h.value.nb,yb(e,g.x,g.y,g.width,g.height);k=e.width;l=e.height;g=e.x;h=e.y;if(!e.Q())return}c.width=k+2*d.width;c.height=l+2*d.height;e=t.O();J.Gs(g,h,0,0,d.width,d.height,
e);e.offset(-d.width,-d.height);t.dk(d);c.U.location=e;t.B(e)}}u.prototype.clearSelection=u.prototype.Pv=function(){var a=0<this.selection.count;a&&this.Ja("ChangingSelection");Ye(this);a&&this.Ja("ChangedSelection")};function Ye(a){a=a.selection;if(0<a.count){for(var b=a.af(),c=b.length,d=0;d<c;d++)b[d].bb=!1;a.Ua();a.clear();a.freeze()}}u.prototype.select=u.prototype.select=function(a){null!==a&&a.layer.h===this&&(!a.bb||1<this.selection.count)&&(this.Ja("ChangingSelection"),Ye(this),a.bb=!0,this.Ja("ChangedSelection"))};
u.prototype.selectCollection=u.prototype.tF=function(a){this.Ja("ChangingSelection");Ye(this);for(a=a.k;a.next();)a.value.bb=!0;this.Ja("ChangedSelection")};
u.prototype.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e;"pixel"===a?e=c:"line"===a?e=c*(d?this.Dp:this.Cp):"page"===a?(a=d?this.nb.height:this.nb.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.Dp:this.Cp),0),e*=c)):t.l("scrolling unit must be 'pixel', 'line', or 'page', not: "+a);e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:t.l("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+
b);this.position=c};u.prototype.scrollToRect=function(a){var b=this.nb;b.Wj(a)||(a=a.Iz,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};u.prototype.centerRect=function(a){var b=this.nb;a=a.Iz;a.x-=b.width/2;a.y-=b.height/2;this.position=a};u.prototype.transformDocToView=u.prototype.gn=function(a){var b=this.bd;b.reset();1!==this.Sb&&b.scale(this.Sb);var c=this.rb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.bd)};
function ga(a,b){var c=a.bd,d=b[0],e=b[1],g=d+b[2],h=e+b[3],k=c.m11,l=c.m12,m=c.m21,n=c.m22,p=c.dx,q=c.dy,r=d*k+e*m+p,s=d*l+e*n+q,c=g*k+e*m+p,e=g*l+e*n+q,v=d*k+h*m+p,d=d*l+h*n+q,k=g*k+h*m+p,g=g*l+h*n+q,h=r,l=s,r=Math.min(r,c),h=Math.max(h,c),l=Math.min(l,e),s=Math.max(s,e),r=Math.min(r,v),h=Math.max(h,v),l=Math.min(l,d),s=Math.max(s,d),r=Math.min(r,k),h=Math.max(h,k),l=Math.min(l,g),s=Math.max(s,g);return[r,l,h-r,s-l]}
u.prototype.transformViewToDoc=u.prototype.UF=function(a){var b=this.bd;b.reset();1!==this.Sb&&b.scale(this.Sb);var c=this.rb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return ab(a.copy(),this.bd)};var Ze;u.None=Ze=t.w(u,"None",0);var qi;u.Uniform=qi=t.w(u,"Uniform",1);var ri;u.UniformToFill=ri=t.w(u,"UniformToFill",2);var qg;u.CycleAll=qg=t.w(u,"CycleAll",10);var ug;u.CycleNotDirected=ug=t.w(u,"CycleNotDirected",11);var wg;
u.CycleNotDirectedFast=wg=t.w(u,"CycleNotDirectedFast",12);var xg;u.CycleNotUndirected=xg=t.w(u,"CycleNotUndirected",13);var rg;u.CycleDestinationTree=rg=t.w(u,"CycleDestinationTree",14);var tg;u.CycleSourceTree=tg=t.w(u,"CycleSourceTree",15);t.g(u,"validCycle",u.prototype.aG);t.defineProperty(u,{aG:"validCycle"},function(){return this.zv},function(a){var b=this.zv;b!==a&&(t.tb(a,u,u,"validCycle"),this.zv=a,this.i("validCycle",b,a))});t.g(u,"linkSpacing",u.prototype.kp);
t.defineProperty(u,{kp:"linkSpacing"},function(){return this.vj},function(a){var b=this.vj;b!==a&&(t.o(a,u,"linkSpacing"),0>a&&t.ha(a,">= zero",u,"linkSpacing"),this.vj=a,this.i("linkSpacing",b,a))});t.A(u,{Tm:"layers"},function(){return this.Kb.k});t.g(u,"isModelReadOnly",u.prototype.Ue);t.defineProperty(u,{Ue:"isModelReadOnly"},function(){var a=this.Md;return null===a?!1:a.$a},function(a){var b=this.Md;null!==b&&(b.$a=a)});t.g(u,"isReadOnly",u.prototype.$a);
t.defineProperty(u,{$a:"isReadOnly"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(t.j(a,"boolean",u,"isReadOnly"),this.Mk=a,this.i("isReadOnly",b,a))});t.g(u,"isEnabled",u.prototype.isEnabled);t.defineProperty(u,{isEnabled:"isEnabled"},function(){return this.hi},function(a){var b=this.hi;b!==a&&(t.j(a,"boolean",u,"isEnabled"),this.hi=a,this.i("isEnabled",b,a))});t.g(u,"allowClipboard",u.prototype.Hv);
t.defineProperty(u,{Hv:"allowClipboard"},function(){return this.Lt},function(a){var b=this.Lt;b!==a&&(t.j(a,"boolean",u,"allowClipboard"),this.Lt=a,this.i("allowClipboard",b,a))});t.g(u,"allowCopy",u.prototype.Sj);t.defineProperty(u,{Sj:"allowCopy"},function(){return this.pk},function(a){var b=this.pk;b!==a&&(t.j(a,"boolean",u,"allowCopy"),this.pk=a,this.i("allowCopy",b,a))});t.g(u,"allowDelete",u.prototype.$k);
t.defineProperty(u,{$k:"allowDelete"},function(){return this.qk},function(a){var b=this.qk;b!==a&&(t.j(a,"boolean",u,"allowDelete"),this.qk=a,this.i("allowDelete",b,a))});t.g(u,"allowDragOut",u.prototype.Iv);t.defineProperty(u,{Iv:"allowDragOut"},function(){return this.Mt},function(a){var b=this.Mt;b!==a&&(t.j(a,"boolean",u,"allowDragOut"),this.Mt=a,this.i("allowDragOut",b,a))});t.g(u,"allowDrop",u.prototype.Bz);
t.defineProperty(u,{Bz:"allowDrop"},function(){return this.Nt},function(a){var b=this.Nt;b!==a&&(t.j(a,"boolean",u,"allowDrop"),this.Nt=a,this.i("allowDrop",b,a))});t.g(u,"allowTextEdit",u.prototype.Bo);t.defineProperty(u,{Bo:"allowTextEdit"},function(){return this.zk},function(a){var b=this.zk;b!==a&&(t.j(a,"boolean",u,"allowTextEdit"),this.zk=a,this.i("allowTextEdit",b,a))});t.g(u,"allowGroup",u.prototype.xo);
t.defineProperty(u,{xo:"allowGroup"},function(){return this.rk},function(a){var b=this.rk;b!==a&&(t.j(a,"boolean",u,"allowGroup"),this.rk=a,this.i("allowGroup",b,a))});t.g(u,"allowUngroup",u.prototype.Co);t.defineProperty(u,{Co:"allowUngroup"},function(){return this.Ak},function(a){var b=this.Ak;b!==a&&(t.j(a,"boolean",u,"allowUngroup"),this.Ak=a,this.i("allowUngroup",b,a))});t.g(u,"allowInsert",u.prototype.vm);
t.defineProperty(u,{vm:"allowInsert"},function(){return this.Pt},function(a){var b=this.Pt;b!==a&&(t.j(a,"boolean",u,"allowInsert"),this.Pt=a,this.i("allowInsert",b,a))});t.g(u,"allowLink",u.prototype.wm);t.defineProperty(u,{wm:"allowLink"},function(){return this.sk},function(a){var b=this.sk;b!==a&&(t.j(a,"boolean",u,"allowLink"),this.sk=a,this.i("allowLink",b,a))});t.g(u,"allowRelink",u.prototype.Tj);
t.defineProperty(u,{Tj:"allowRelink"},function(){return this.uk},function(a){var b=this.uk;b!==a&&(t.j(a,"boolean",u,"allowRelink"),this.uk=a,this.i("allowRelink",b,a))});t.g(u,"allowMove",u.prototype.al);t.defineProperty(u,{al:"allowMove"},function(){return this.tk},function(a){var b=this.tk;b!==a&&(t.j(a,"boolean",u,"allowMove"),this.tk=a,this.i("allowMove",b,a))});t.g(u,"allowReshape",u.prototype.yo);
t.defineProperty(u,{yo:"allowReshape"},function(){return this.vk},function(a){var b=this.vk;b!==a&&(t.j(a,"boolean",u,"allowReshape"),this.vk=a,this.i("allowReshape",b,a))});t.g(u,"allowResize",u.prototype.zo);t.defineProperty(u,{zo:"allowResize"},function(){return this.wk},function(a){var b=this.wk;b!==a&&(t.j(a,"boolean",u,"allowResize"),this.wk=a,this.i("allowResize",b,a))});t.g(u,"allowRotate",u.prototype.Ao);
t.defineProperty(u,{Ao:"allowRotate"},function(){return this.xk},function(a){var b=this.xk;b!==a&&(t.j(a,"boolean",u,"allowRotate"),this.xk=a,this.i("allowRotate",b,a))});t.g(u,"allowSelect",u.prototype.Ne);t.defineProperty(u,{Ne:"allowSelect"},function(){return this.yk},function(a){var b=this.yk;b!==a&&(t.j(a,"boolean",u,"allowSelect"),this.yk=a,this.i("allowSelect",b,a))});t.g(u,"allowUndo",u.prototype.Cz);
t.defineProperty(u,{Cz:"allowUndo"},function(){return this.Qt},function(a){var b=this.Qt;b!==a&&(t.j(a,"boolean",u,"allowUndo"),this.Qt=a,this.i("allowUndo",b,a))});t.g(u,"allowZoom",u.prototype.ts);t.defineProperty(u,{ts:"allowZoom"},function(){return this.St},function(a){var b=this.St;b!==a&&(t.j(a,"boolean",u,"allowZoom"),this.St=a,this.i("allowZoom",b,a))});t.g(u,"hasVerticalScrollbar",u.prototype.oE);
t.defineProperty(u,{oE:"hasVerticalScrollbar"},function(){return this.uu},function(a){var b=this.uu;b!==a&&(t.j(a,"boolean",u,"hasVerticalScrollbar"),this.uu=a,ti(this),this.pa(),this.i("hasVerticalScrollbar",b,a),gi(this))});t.g(u,"hasHorizontalScrollbar",u.prototype.nE);t.defineProperty(u,{nE:"hasHorizontalScrollbar"},function(){return this.tu},function(a){var b=this.tu;b!==a&&(t.j(a,"boolean",u,"hasHorizontalScrollbar"),this.tu=a,ti(this),this.pa(),this.i("hasHorizontalScrollbar",b,a),gi(this))});
t.g(u,"allowHorizontalScroll",u.prototype.hf);t.defineProperty(u,{hf:"allowHorizontalScroll"},function(){return this.Ot},function(a){var b=this.Ot;b!==a&&(t.j(a,"boolean",u,"allowHorizontalScroll"),this.Ot=a,this.i("allowHorizontalScroll",b,a),gi(this))});t.g(u,"allowVerticalScroll",u.prototype.jf);t.defineProperty(u,{jf:"allowVerticalScroll"},function(){return this.Rt},function(a){var b=this.Rt;b!==a&&(t.j(a,"boolean",u,"allowVerticalScroll"),this.Rt=a,this.i("allowVerticalScroll",b,a),gi(this))});
t.g(u,"scrollHorizontalLineChange",u.prototype.Cp);t.defineProperty(u,{Cp:"scrollHorizontalLineChange"},function(){return this.hv},function(a){var b=this.hv;b!==a&&(t.j(a,"number",u,"scrollHorizontalLineChange"),0>a&&t.ha(a,">= 0",u,"scrollHorizontalLineChange"),this.hv=a,this.i("scrollHorizontalLineChange",b,a))});t.g(u,"scrollVerticalLineChange",u.prototype.Dp);
t.defineProperty(u,{Dp:"scrollVerticalLineChange"},function(){return this.iv},function(a){var b=this.iv;b!==a&&(t.j(a,"number",u,"scrollVerticalLineChange"),0>a&&t.ha(a,">= 0",u,"scrollVerticalLineChange"),this.iv=a,this.i("scrollVerticalLineChange",b,a))});t.g(u,"lastInput",u.prototype.T);t.defineProperty(u,{T:"lastInput"},function(){return this.cc},function(a){f&&t.m(a,ud,u,"lastInput");this.cc=a});t.g(u,"firstInput",u.prototype.Ec);
t.defineProperty(u,{Ec:"firstInput"},function(){return this.Gg},function(a){f&&t.m(a,ud,u,"firstInput");this.Gg=a});t.g(u,"currentCursor",u.prototype.cd);t.defineProperty(u,{cd:"currentCursor"},function(){return this.fu},function(a){t.j(a,"string",u,"currentCursor");null===this.Pa||this.fu===a||""===a&&this.fu===this.tq||(this.fu=a,""!==a?(this.Pa.style.cursor=a,this.Ab.style.cursor=a):(this.Pa.style.cursor=this.Pz,this.Ab.style.cursor=this.Pz))});t.g(u,"defaultCursor",u.prototype.Pz);
t.defineProperty(u,{Pz:"defaultCursor"},function(){return this.tq},function(a){t.j(a,"string",u,"defaultCursor");var b=this.tq;b!==a&&(this.tq=a,this.i("defaultCursor",b,a))});t.g(u,"hasGestureZoom",u.prototype.eI);t.defineProperty(u,{eI:"hasGestureZoom"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(t.j(a,"boolean",u,"hasGestureZoom"),this.gi=a,this.i("hasGestureZoom",b,a))});t.g(u,"click",u.prototype.click);
t.defineProperty(u,{click:"click"},function(){return this.Zh},function(a){var b=this.Zh;b!==a&&(null!==a&&t.j(a,"function",u,"click"),this.Zh=a,this.i("click",b,a))});t.g(u,"doubleClick",u.prototype.Jm);t.defineProperty(u,{Jm:"doubleClick"},function(){return this.ei},function(a){var b=this.ei;b!==a&&(null!==a&&t.j(a,"function",u,"doubleClick"),this.ei=a,this.i("doubleClick",b,a))});t.g(u,"contextClick",u.prototype.Bs);
t.defineProperty(u,{Bs:"contextClick"},function(){return this.ai},function(a){var b=this.ai;b!==a&&(null!==a&&t.j(a,"function",u,"contextClick"),this.ai=a,this.i("contextClick",b,a))});t.g(u,"mouseOver",u.prototype.et);t.defineProperty(u,{et:"mouseOver"},function(){return this.oi},function(a){var b=this.oi;b!==a&&(null!==a&&t.j(a,"function",u,"mouseOver"),this.oi=a,this.i("mouseOver",b,a))});t.g(u,"mouseHover",u.prototype.dt);
t.defineProperty(u,{dt:"mouseHover"},function(){return this.ni},function(a){var b=this.ni;b!==a&&(null!==a&&t.j(a,"function",u,"mouseHover"),this.ni=a,this.i("mouseHover",b,a))});t.g(u,"mouseHold",u.prototype.ct);t.defineProperty(u,{ct:"mouseHold"},function(){return this.mi},function(a){var b=this.mi;b!==a&&(null!==a&&t.j(a,"function",u,"mouseHold"),this.mi=a,this.i("mouseHold",b,a))});t.g(u,"mouseDragOver",u.prototype.VE);
t.defineProperty(u,{VE:"mouseDragOver"},function(){return this.Ou},function(a){var b=this.Ou;b!==a&&(null!==a&&t.j(a,"function",u,"mouseDragOver"),this.Ou=a,this.i("mouseDragOver",b,a))});t.g(u,"mouseDrop",u.prototype.bt);t.defineProperty(u,{bt:"mouseDrop"},function(){return this.li},function(a){var b=this.li;b!==a&&(null!==a&&t.j(a,"function",u,"mouseDrop"),this.li=a,this.i("mouseDrop",b,a))});t.g(u,"toolTip",u.prototype.Et);
t.defineProperty(u,{Et:"toolTip"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(null!==a&&t.m(a,Ve,u,"toolTip"),this.yi=a,this.i("toolTip",b,a))});t.g(u,"contextMenu",u.prototype.contextMenu);t.defineProperty(u,{contextMenu:"contextMenu"},function(){return this.bi},function(a){var b=this.bi;b!==a&&(null!==a&&t.m(a,Ve,u,"contextMenu"),this.bi=a,this.i("contextMenu",b,a))});t.g(u,"commandHandler",u.prototype.lg);
t.defineProperty(u,{lg:"commandHandler"},function(){return this.Hx},function(a){var b=this.Hx;b!==a&&(t.m(a,wa,u,"commandHandler"),null!==a.h&&t.l("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.qe(null),this.Hx=a,a.qe(this))});t.g(u,"toolManager",u.prototype.Db);
t.defineProperty(u,{Db:"toolManager"},function(){return this.xv},function(a){var b=this.xv;b!==a&&(t.m(a,He,u,"toolManager"),null!==a.h&&t.l("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.qe(null),this.xv=a,a.qe(this))});t.g(u,"defaultTool",u.prototype.Yv);t.defineProperty(u,{Yv:"defaultTool"},function(){return this.Vx},function(a){var b=this.Vx;b!==a&&(t.m(a,le,u,"defaultTool"),this.Vx=a,this.Za===b&&(this.Za=a))});t.g(u,"currentTool",u.prototype.Za);
t.defineProperty(u,{Za:"currentTool"},function(){return this.Qx},function(a){var b=this.Qx;null!==b&&(b.ra&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Yv);null!==a&&(t.m(a,le,u,"currentTool"),this.Qx=a,a.qe(this),a.doStart())});t.A(u,{selection:"selection"},function(){return this.lv});t.g(u,"maxSelectionCount",u.prototype.OE);
t.defineProperty(u,{OE:"maxSelectionCount"},function(){return this.Ju},function(a){var b=this.Ju;if(b!==a)if(t.j(a,"number",u,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Ju=a,this.i("maxSelectionCount",b,a),!this.Aa.qb&&(a=this.selection.count-a,0<a)){this.Ja("ChangingSelection");for(var b=this.selection.af(),c=0;c<a;c++)b[c].bb=!1;this.Ja("ChangedSelection")}}else t.ha(a,">= 0",u,"maxSelectionCount")});t.g(u,"nodeSelectionAdornmentTemplate",u.prototype.YE);
t.defineProperty(u,{YE:"nodeSelectionAdornmentTemplate"},function(){return this.Uu},function(a){var b=this.Uu;b!==a&&(t.m(a,Ve,u,"nodeSelectionAdornmentTemplate"),this.Uu=a,this.i("nodeSelectionAdornmentTemplate",b,a))});t.g(u,"groupSelectionAdornmentTemplate",u.prototype.kE);t.defineProperty(u,{kE:"groupSelectionAdornmentTemplate"},function(){return this.ru},function(a){var b=this.ru;b!==a&&(t.m(a,Ve,u,"groupSelectionAdornmentTemplate"),this.ru=a,this.i("groupSelectionAdornmentTemplate",b,a))});
t.g(u,"linkSelectionAdornmentTemplate",u.prototype.LE);t.defineProperty(u,{LE:"linkSelectionAdornmentTemplate"},function(){return this.Du},function(a){var b=this.Du;b!==a&&(t.m(a,Ve,u,"linkSelectionAdornmentTemplate"),this.Du=a,this.i("linkSelectionAdornmentTemplate",b,a))});t.g(u,"isModified",u.prototype.hk);
t.defineProperty(u,{hk:"isModified"},function(){var a=this.Aa;return null===a?this.wy:null!==a.gl?!0:this.wy&&this.Jk!==a.gk},function(a){if(this.wy!==a){t.j(a,"boolean",u,"isModified");this.wy=a;var b=this.Aa;!a&&b&&(this.Jk=b.gk);a||Ri(this)}});function Ri(a){var b=a.hk;a.YC!==b&&(a.YC=b,a.Ja("Modified"))}t.g(u,"model",u.prototype.fa);
t.defineProperty(u,{fa:"model"},function(){return this.Md},function(a){var b=this.Md;if(b!==a){t.m(a,I,u,"model");null!==b&&b.Aa!==a.Aa&&b.Aa.mI&&t.l("Do not replace a Diagram.model while a transaction is in progress.");this.Pv();this.Xf=!1;this.Aq=!0;this.hg=!1;var c=this.Jd;this.Jd=!0;null!==b&&(b.NA(this.tC),b instanceof U&&Si(this,b.Vi),Si(this,b.sg));this.Md=a;a.zz(this.sC);Ti(this,a.sg);a instanceof U&&Ui(this,a.Vi);a.NA(this.sC);a.zz(this.tC);this.Jd=c;this.lc||this.pa();null!==b&&(a.Aa.isEnabled=
b.Aa.isEnabled)}});t.defineProperty(u,{Wa:null},function(){return this.mC},function(a){this.mC=a});
function Rh(a,b){if(b.fa===a.fa&&a.Wa){a.Wa=!1;try{var c=b.od,d=b.rf;if(""!==d)if(c===Cd){if("linkFromKey"===d){var e=b.object,g=a.Hf(e);if(null!==g){var h=b.newValue,k=a.ng(h);g.da=k}}else if("linkToKey"===d)e=b.object,g=a.Hf(e),null!==g&&(h=b.newValue,k=a.ng(h),g.ja=k);else if("linkFromPortId"===d){if(e=b.object,g=a.Hf(e),null!==g){var l=b.newValue;"string"===typeof l&&(g.nf=l)}}else if("linkToPortId"===d)e=b.object,g=a.Hf(e),null!==g&&(l=b.newValue,"string"===typeof l&&(g.Qf=l));else if("nodeGroupKey"===
d){var e=b.object,m=a.Pi(e);if(null!==m){var n=b.newValue;if(void 0!==n){var p=a.ng(n);m.fb=p instanceof z?p:null}else m.fb=null}}else if("linkLabelKeys"===d){if(e=b.object,g=a.Hf(e),null!==g){var q=b.oldValue,r=b.newValue;if(t.isArray(q))for(var s=t.yb(q),v=0;v<s;v++){var x=t.sb(q,v),k=a.ng(x);null!==k&&(k.Tc=null)}if(t.isArray(r))for(s=t.yb(r),v=0;v<s;v++)x=t.sb(r,v),k=a.ng(x),null!==k&&(k.Tc=g)}}else if("nodeParentKey"===d){var E=b.object,F=a.ng(b.newValue),G=a.hw(E);if(null!==G){var L=G.Js();
null!==L?null===F?a.remove(L):a.fd?L.da=F:L.ja=F:Vi(a,F,G)}}else if("parentLinkCategory"===d){var E=b.object,G=a.hw(E),N=b.newValue;null!==G&&"string"===typeof N&&(L=G.Js(),null!==L&&(L.Qc=N))}else if("nodeCategory"===d){var e=b.object,V=a.Pi(e),N=b.newValue;null!==V&&"string"===typeof N&&(V.Qc=N)}else if("linkCategory"===d){var e=b.object,T=a.Hf(e),N=b.newValue;null!==T&&"string"===typeof N&&(T.Qc=N)}else if("nodeDataArray"===d){a.pa();var W=b.oldValue;Si(a,W);var da=b.newValue;Ti(a,da)}else"linkDataArray"===
d&&(a.pa(),W=b.oldValue,Si(a,W),da=b.newValue,Ui(a,da));a.hk=!0}else if(c===Dd)da=b.newValue,"nodeDataArray"===d&&t.pb(da)?Wi(a,da):"linkDataArray"===d&&t.pb(da)?Xi(a,da):"linkLabelKeys"===d&&ye(da)&&(g=a.Hf(b.object),k=a.ng(da),null!==g&&null!==k&&(k.Tc=g)),a.hk=!0;else if(c===Md)W=b.oldValue,"nodeDataArray"===d&&t.pb(W)?Yi(a,W):"linkDataArray"===d&&t.pb(W)?Yi(a,W):"linkLabelKeys"===d&&ye(W)&&(k=a.ng(W),null!==k&&(k.Tc=null)),a.hk=!0;else{if(c===Bd&&"SourceChanged"===d){var m=a.Pi(b.object),R=b.propertyName;
null!==m&&"string"===typeof R&&(m.Jb(R),a.fa instanceof Sd&&(g=a.Hf(b.object),null!==g&&g.Jb(R)))}}else if(c===Cd){var xa=b.propertyName,e=b.object;if(e===a.fa){if("nodeKeyProperty"===xa||"nodeCategoryProperty"===xa||"linkFromKeyProperty"===xa||"linkToKeyProperty"===xa||"linkFromPortIdProperty"===xa||"linkToPortIdProperty"===xa||"linkLabelKeysProperty"===xa||"nodeIsGroupProperty"===xa||"nodeGroupKeyProperty"===xa||"nodeParentKeyProperty"===xa||"linkCategoryProperty"===xa)a.Aa.qb||a.$m()}else Qh(a,
e,xa);a.hk=!0}else if(c===Dd||c===Md)Zi(a,b),a.hk=!0;else if(c===Bd){var Ja=b.propertyName;"S"!==Ja[0]?("CommittingTransaction"===Ja||"FinishedUndo"!==Ja&&"FinishedRedo"!==Ja||(a.Aa.ii=!0,ei(a),a.Aa.ii=!1),a.ju=!0,a.Xi(),Ri(a),a.Jy||"CommittedTransaction"!==Ja||(a.Jy=!0,setTimeout(function(){a.Za.standardMouseOver();a.Jy=!1},10))):"StartingFirstTransaction"!==Ja||a.Jd||a.Xf||(a.ju=!0,a.Aq&&(a.hg=!0))}}finally{a.Wa=!0}}}
function Qh(a,b,c){var d=a.Pi(b);if(null!==d&&"string"===typeof c)d.Jb(c),a.fa instanceof Sd&&(b=a.Hf(b),null!==b&&b.Jb(c));else if("string"===typeof c){d=null;for(a=a.Vl.k;a.next();){for(var e=a.value,g=0;g<e.length;g++){var h=e[g];null!==h.Zf&&(h=h.Zf.Ba(b),null!==h&&(null===d&&(d=t.Cb()),d.push(h)))}if(null!==d)break}b=d;if(null!==b){for(d=0;d<b.length;d++)b[d].Jb(c);t.Da(b)}}}
function Zi(a,b){var c=b.od===Dd,d=c?b.Kf:b.Mf,e=c?b.newValue:b.oldValue,g=a.Vl.Ba(b.object);if(Array.isArray(g)&&"number"===typeof d)for(var h=0;h<g.length;h++){var k=g[h];k.type!==Ug&&k.type!==Xh||d++;c?$i(k,e,d):(k.Te(d),aj(k,d-1))}}function Mi(a,b){var c=b.tj;if(t.isArray(c)){var d=a.Vl.Ba(c);if(null===d)a.Vl.add(c,[b]);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function Oi(a,b){var c=b.tj;if(t.isArray(c)){var d=a.Vl.Ba(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Vl.remove(c);break}}}
u.prototype.clear=u.prototype.clear=function(){var a=null;null!==this.Yc&&(a=this.Yc.U);this.fa.clear();for(var b=this.Kb.length,c=0;c<b;c++)this.Kb.p[c].clear();this.Yf.clear();this.Dn.clear();this.Vu.clear();this.Vk.clear();this.Eu.clear();this.cb.clear();this.ci.clear();this.Dk.clear();this.Vl.clear();this.lv.Ua();this.lv.clear();this.lv.freeze();this.Ho=this.HA=null;t.ys=null;this.ku=(new D(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.cb.remove(a));this.pa()};
u.prototype.reset=u.prototype.reset=function(){this.lc=!0;this.clear();this.Kb=new H(ke);this.rb=(new C(NaN,NaN)).freeze();this.Sb=1;this.Lu=1E-4;this.Iu=100;this.Cv=(new C(NaN,NaN)).freeze();this.pu=(new D(NaN,NaN,NaN,NaN)).freeze();this.El=Ze;this.Hl=Qb;this.Kk=Ze;this.Mn=Qb;this.wu=this.vu=Sb;this.Wt=(new sb(16,16,16,16)).freeze();this.Au=!0;this.zv=qg;this.tq="auto";this.Md=this.bi=this.yi=this.li=this.Ou=this.mi=this.ni=this.oi=this.ai=this.ei=this.Zh=null;this.Mk=!1;this.qk=this.pk=this.Lt=
this.hi=!0;this.Nt=this.Mt=!1;this.Rt=this.Ot=this.uu=this.tu=this.St=this.Qt=this.yk=this.xk=this.wk=this.vk=this.tk=this.uk=this.sk=this.Pt=this.Ak=this.rk=this.zk=!0;this.iv=this.hv=16;this.Le=(new sb(5)).freeze();this.Ju=999999999;this.Ld=null;Sh(this);Th(this);this.Yc=null;this.fa=new U;this.vi=!0;this.Tb=new ue;this.lc=this.vi=!1;this.pa()};
u.prototype.rebuildParts=u.prototype.$m=function(){for(var a=this.Bw.k;a.next();){var b=a.value;(!b.Ud()||b instanceof z)&&t.l('Invalid node template in Diagram.nodeTemplateMap: template for "'+a.key+'" must be a Node or a simple Part, not a Group or Link: '+b)}for(a=this.lw.k;a.next();)b=a.value,b instanceof z||t.l('Invalid group template in Diagram.groupTemplateMap: template for "'+a.key+'" must be a Group, not a normal Node or Link: '+b);for(a=this.yw.k;a.next();)b=a.value,b instanceof A||t.l('Invalid link template in Diagram.linkTemplateMap: template for "'+
a.key+'" must be a Link, not a normal Node or simple Part: '+b);a=t.Cb();for(b=this.selection.k;b.next();){var c=b.value.data;c&&a.push(c)}b=this.fa;b instanceof U&&Si(this,b.Vi);Si(this,b.sg);Ti(this,b.sg);b instanceof U&&Ui(this,b.Vi);for(b=0;b<a.length;b++)if(c=this.Pi(a[b]))c.bb=!0;t.Da(a)};
function Ti(a,b){if(null!==b){for(var c=a.fa,d=t.yb(b),e=0;e<d;e++){var g=t.sb(b,e);c.ie(g)?Wi(a,g,!1):c instanceof U&&Xi(a,g)}if(c instanceof U||c instanceof Sd){for(e=0;e<d;e++)g=t.sb(b,e),c.ie(g)&&bj(a,g);if(c instanceof U)for(c=a.links;c.next();)cj(c.value)}dj(a,!1)}}
function Wi(a,b,c){if(void 0!==b&&null!==b&&!a.Aa.qb&&!a.ci.contains(b)){void 0===c&&(c=!0);var d=a.getCategoryForNodeData(b),e=a.findTemplateForNodeData(b,d);e instanceof w&&(Xe(e),e=e.copy(),e instanceof w&&(e.gh=d,a.add(e),e.data=b,c&&bj(a,b)))}}u.prototype.getCategoryForNodeData=function(a){var b=this.fa,c=b.getCategoryForNodeData(a),d=!1;b instanceof U&&(d=b.nI(a));d&&""===c&&(c="LinkLabel");return c};
u.prototype.findTemplateForNodeData=function(a,b){var c=!1,d=this.fa;d instanceof U&&(c=d.lA(a));c?(c=this.lw.Ba(b),null===c&&(c=this.lw.Ba(""),null===c&&(t.dG||(t.dG=!0,t.trace('No Group template found for category "'+b+'"'),t.trace("  Using default group template")),c=this.NB))):(c=this.Bw.Ba(b),null===c&&(c=this.Bw.Ba(""),null===c&&(t.gG||(t.gG=!0,t.trace('No Node template found for category "'+b+'"'),t.trace("  Using default node template")),c=this.PB)));return c instanceof w?c:null};
function bj(a,b){var c=a.fa;if(c instanceof U||c instanceof Sd){var d=c.Nb(b);if(void 0!==d){var e=ze(c,d),g=a.Pi(b);if(null!==e&&null!==g){for(e=e.k;e.next();){var h=e.value;if(c instanceof U)if(c.ie(h)){if(g instanceof z&&c.Uo(h)===d){var k=a.Pi(h);null!==k&&(k.fb=g)}}else{if(k=a.Hf(h),null!==k&&g instanceof y&&(c.Nm(h)===d&&(k.da=g),c.Om(h)===d&&(k.ja=g),h=c.ll(h),t.isArray(h)))for(var l=0;l<t.yb(h);l++)if(t.sb(h,l)===d){g.Tc=k;break}}else c instanceof Sd&&c.ie(h)&&g instanceof y&&c.Wo(h)===d&&
(k=a.hw(h),Vi(a,g,k))}Be(c,d)}c instanceof U?(c=c.Uo(b),void 0!==c&&(c=a.ng(c),c instanceof z&&(g.fb=c))):c instanceof Sd&&(c=c.Wo(b),void 0!==c&&g instanceof y&&(c=a.ng(c),Vi(a,c,g)))}}}
function Vi(a,b,c){if(null!==b&&null!==c){var d=a.Db.qA,e=b,g=c;if(a.fd)for(b=g.Dd;b.next();){var h=b.value;if(h.ja===g)return}else for(e=c,g=b,b=e.Dd;b.next();)if(h=b.value,h.da===e)return;null!==d&&sg(d,e,g,null,!0)||(d=a.getCategoryForLinkData(c.data),b=a.findTemplateForLinkData(c.data,d),b instanceof A&&(Xe(b),b=b.copy(),b instanceof A&&(b.gh=d,b.da=e,b.ja=g,a.add(b),b.data=c.data)))}}function Ui(a,b){if(null!==b){for(var c=t.yb(b),d=0;d<c;d++){var e=t.sb(b,d);Xi(a,e)}dj(a,!1)}}
function Xi(a,b){if(void 0!==b&&null!==b&&!a.Aa.qb&&!a.Dk.contains(b)){var c=a.getCategoryForLinkData(b),d=a.findTemplateForLinkData(b,c);if(d instanceof A&&(Xe(d),d=d.copy(),d instanceof A)){d.gh=c;var c=a.fa,e=c.ZH(b);""!==e&&(d.nf=e);e=c.Nm(b);void 0!==e&&(e=a.ng(e),e instanceof y&&(d.da=e));e=c.bI(b);""!==e&&(d.Qf=e);e=c.Om(b);void 0!==e&&(e=a.ng(e),e instanceof y&&(d.ja=e));c=c.ll(b);if(t.isArray(c))for(var e=t.yb(c),g=0;g<e;g++){var h=t.sb(c,g),h=a.ng(h);null!==h&&(h.Tc=d)}a.add(d);d.data=b}}}
u.prototype.getCategoryForLinkData=function(a){var b=this.fa,c="";b instanceof U?c=b.getCategoryForLinkData(a):b instanceof Sd&&(c=b.aI(a));return c};u.prototype.findTemplateForLinkData=function(a,b){var c=this.yw.Ba(b);null===c&&(c=this.yw.Ba(""),null===c&&(t.fG||(t.fG=!0,t.trace('No Link template found for category "'+b+'"'),t.trace("  Using default link template")),c=this.OB));return c instanceof A?c:null};function Si(a,b){for(var c=t.yb(b),d=0;d<c;d++){var e=t.sb(b,d);Yi(a,e)}}
function Yi(a,b){if(void 0!==b&&null!==b){var c=a.Pi(b);if(c instanceof w){c.bb=!1;var d=c.layer;if(null!==d&&d.h===a){var e=a.fa;if(e instanceof U&&c instanceof y){var g=e.Nb(c.data);if(void 0!==g){for(var h=c.Dd;h.next();){var k=h.value.data;Ae(e,g,k)}c.Ih&&(h=c.Tc,null!==h&&(k=h.data,Ae(e,g,k)));if(c instanceof z)for(h=c.Ic;h.next();)k=h.value.data,e.ie(k)&&Ae(e,g,k)}}else if(e instanceof Sd&&c instanceof y){h=a.Hf(c.data);if(null!==h&&(h.bb=!1,k=h.layer,null!==k)){var l=k.Te(-1,h);0<=l&&a.Vc(Md,
"parts",k,h,null,l,null);l=h.ep;null!==l&&l(h,k,null)}h=a.fd;for(k=c.Dd;k.next();)l=k.value,l=(h?l.ja:l.da).data,e.ie(l)&&Ae(e,g,l)}e=d.Te(-1,c);0<=e&&a.Vc(Md,"parts",d,c,null,e,null);e=c.ep;null!==e&&e(c,d,null)}}}}u.prototype.findPartForKey=function(a){if(null===a||void 0===a)return null;a=this.fa.mf(a);if(null===a)return null;a=this.ci.Ba(a);return a instanceof w?a:null};
u.prototype.findNodeForKey=u.prototype.ng=function(a){if(null===a||void 0===a)return null;a=this.fa.mf(a);if(null===a)return null;a=this.ci.Ba(a);return a instanceof y?a:null};u.prototype.findPartForData=u.prototype.Pi=function(a){if(null===a)return null;var b=this.ci.Ba(a);if(b instanceof w)return b;b=this.Dk.Ba(a);return b instanceof w?b:null};u.prototype.findNodeForData=u.prototype.hw=function(a){if(null===a)return null;a=this.ci.Ba(a);return a instanceof y?a:null};
u.prototype.findLinkForData=u.prototype.Hf=function(a){if(null===a)return null;a=this.Dk.Ba(a);return a instanceof A?a:null};t.g(u,"nodeTemplate",u.prototype.HI);t.defineProperty(u,{HI:"nodeTemplate"},function(){return this.pi.Ba("")},function(a){var b=this.pi.Ba("");b!==a&&(t.m(a,w,u,"nodeTemplate"),this.pi.add("",a),this.i("nodeTemplate",b,a),this.Aa.qb||this.$m())});t.g(u,"nodeTemplateMap",u.prototype.Bw);
t.defineProperty(u,{Bw:"nodeTemplateMap"},function(){return this.pi},function(a){var b=this.pi;b!==a&&(t.m(a,sa,u,"nodeTemplateMap"),this.pi=a,this.i("nodeTemplateMap",b,a),this.Aa.qb||this.$m())});t.g(u,"groupTemplate",u.prototype.dI);t.defineProperty(u,{dI:"groupTemplate"},function(){return this.Gk.Ba("")},function(a){var b=this.Gk.Ba("");b!==a&&(t.m(a,z,u,"groupTemplate"),this.Gk.add("",a),this.i("groupTemplate",b,a),this.Aa.qb||this.$m())});t.g(u,"groupTemplateMap",u.prototype.lw);
t.defineProperty(u,{lw:"groupTemplateMap"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(t.m(a,sa,u,"groupTemplateMap"),this.Gk=a,this.i("groupTemplateMap",b,a),this.Aa.qb||this.$m())});t.g(u,"linkTemplate",u.prototype.AI);t.defineProperty(u,{AI:"linkTemplate"},function(){return this.wj.Ba("")},function(a){var b=this.wj.Ba("");b!==a&&(t.m(a,A,u,"linkTemplate"),this.wj.add("",a),this.i("linkTemplate",b,a),this.Aa.qb||this.$m())});t.g(u,"linkTemplateMap",u.prototype.yw);
t.defineProperty(u,{yw:"linkTemplateMap"},function(){return this.wj},function(a){var b=this.wj;b!==a&&(t.m(a,sa,u,"linkTemplateMap"),this.wj=a,this.i("linkTemplateMap",b,a),this.Aa.qb||this.$m())});t.g(u,"isMouseCaptured",u.prototype.Bd);
t.defineProperty(u,{Bd:"isMouseCaptured"},function(){return this.kC},function(a){var b=this.Pa;null!==b&&(a?(this.T.bubbles=!1,b.removeEventListener("mousemove",this.pp,!1),b.removeEventListener("mousedown",this.op,!1),b.removeEventListener("mouseup",this.rp,!1),b.removeEventListener("mousewheel",this.Yg,!1),b.removeEventListener("DOMMouseScroll",this.Yg,!1),b.removeEventListener("mouseout",this.qp,!1),window.addEventListener("mousemove",this.pp,!0),window.addEventListener("mousedown",this.op,!0),
window.addEventListener("mouseup",this.rp,!0),window.addEventListener("mousewheel",this.Yg,!0),window.addEventListener("DOMMouseScroll",this.Yg,!0),window.addEventListener("mouseout",this.qp,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.pp,!0),window.removeEventListener("mousedown",this.op,!0),window.removeEventListener("mouseup",this.rp,!0),window.removeEventListener("mousewheel",this.Yg,!0),window.removeEventListener("DOMMouseScroll",
this.Yg,!0),window.removeEventListener("mouseout",this.qp,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.pp,!1),b.addEventListener("mousedown",this.op,!1),b.addEventListener("mouseup",this.rp,!1),b.addEventListener("mousewheel",this.Yg,!1),b.addEventListener("DOMMouseScroll",this.Yg,!1),b.addEventListener("mouseout",this.qp,!1)),this.kC=a)});t.g(u,"position",u.prototype.position);
t.defineProperty(u,{position:"position"},function(){return this.rb},function(a){var b=this.rb;if(!b.N(a)){t.m(a,C,u,"position");var c=this.nb.copy();c.x=b.x;c.y=b.y;a=a.copy();b.bk(a)||(this.lc||null===this.Pa||(this.lc=!0,b=this.scale,ii(this,a,this.vc,this.tc/b,this.sc/b,this.Hl),this.lc=!1),b=a);this.rb=b.Z();this.lc||this.kt(c,this.nb)}});t.g(u,"initialPosition",u.prototype.sE);
t.defineProperty(u,{sE:"initialPosition"},function(){return this.qy},function(a){this.qy.N(a)||(t.m(a,C,u,"initialPosition"),this.qy=a.Z())});t.g(u,"initialScale",u.prototype.tE);t.defineProperty(u,{tE:"initialScale"},function(){return this.sy},function(a){this.sy!==a&&(t.j(a,"number",u,"initialScale"),this.sy=a)});t.g(u,"grid",u.prototype.Xo);
t.defineProperty(u,{Xo:"grid"},function(){null===this.Yc&&ai(this);return this.Yc},function(a){var b=this.Yc;if(b!==a){null===b&&(ai(this),b=this.Yc);t.m(a,B,u,"grid");a.type!==bi&&t.l("Diagram.grid must be a Panel of type Panel.Grid");var c=b.ga;null!==c&&c.remove(b);this.Yc=a;a.name="GRID";null!==c&&c.add(a);vi(this);this.pa();this.i("grid",b,a)}});
t.A(u,{nb:"viewportBounds"},function(){var a=this.XC;if(null===this.Pa)return a;var b=this.rb,c=this.Sb;a.q(b.x,b.y,Math.max(this.tc,0)/c,Math.max(this.sc,0)/c);return a});t.g(u,"fixedBounds",u.prototype.Xz);t.defineProperty(u,{Xz:"fixedBounds"},function(){return this.pu},function(a){var b=this.pu;b.N(a)||(t.m(a,D,u,"fixedBounds"),this.pu=a=a.Z(),this.Fc(),this.i("fixedBounds",b,a))});t.A(u,{vc:"documentBounds"},function(){return this.ku});
function ji(a,b){var c=a.ku;c.N(b)||(b=b.Z(),a.ku=b,a.rj=!1,a.jj=null,gi(a),a.Ja("DocumentBoundsChanged",null,c.copy()),ti(a))}t.g(u,"scale",u.prototype.scale);
t.defineProperty(u,{scale:"scale"},function(){return this.Sb},function(a){var b=this.Sb;t.o(a,u,"scale");a<this.qg&&(a=this.qg);a>this.pg&&(a=this.pg);if(b!==a){var c=this.Sb=a;if(!this.lc&&!this.Jd&&(this.lc=!0,null!==this.Pa)){a=this.nb.copy();var d=this.tc/c,e=this.sc/c;a.width=this.tc/b;a.height=this.sc/b;var g=this.Vh.copy();if(isNaN(g.x))switch(this.Uv){case pc:g.x=0;break;case vc:g.x=d-1;break;case Vb:g.x=d/2;break;case Qb:case xc:g.x=d/2}if(isNaN(g.y))switch(this.Uv){case oc:g.y=0;break;case wc:g.y=
e-1;break;case Vb:g.y=e/2;break;case Qb:case xc:g.y=e/2}var h=this.position,b=new C(h.x+g.x/b-g.x/c,h.y+g.y/b-g.y/c);ii(this,b,this.vc,d,e,this.Hl);this.position=b;this.lc=!1;this.kt(a,this.nb)}this.pa();ti(this)}});t.g(u,"autoScale",u.prototype.zm);t.defineProperty(u,{zm:"autoScale"},function(){return this.El},function(a){var b=this.El;b!==a&&(t.tb(a,u,u,"autoScale"),this.El=a,this.i("autoScale",b,a),a!==Ze&&gi(this))});t.g(u,"initialAutoScale",u.prototype.iI);
t.defineProperty(u,{iI:"initialAutoScale"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(t.tb(a,u,u,"initialAutoScale"),this.Kk=a,this.i("initialAutoScale",b,a))});t.g(u,"initialViewportSpot",u.prototype.uE);t.defineProperty(u,{uE:"initialViewportSpot"},function(){return this.wu},function(a){var b=this.wu;b!==a&&(t.m(a,K,u,"initialViewportSpot"),a.rd()||t.l("initialViewportSpot must be a real Spot: "+a),this.wu=a,this.i("initialViewportSpot",b,a))});t.g(u,"initialDocumentSpot",u.prototype.rE);
t.defineProperty(u,{rE:"initialDocumentSpot"},function(){return this.vu},function(a){var b=this.vu;b!==a&&(t.m(a,K,u,"initialDocumentSpot"),a.rd()||t.l("initialViewportSpot must be a real Spot: "+a),this.vu=a,this.i("initialDocumentSpot",b,a))});t.g(u,"minScale",u.prototype.qg);t.defineProperty(u,{qg:"minScale"},function(){return this.Lu},function(a){t.o(a,u,"minScale");var b=this.Lu;b!==a&&0<a?(this.Lu=a,this.i("minScale",b,a),a>this.scale&&(this.scale=a)):t.ha(a,"> 0",u,"minScale")});
t.g(u,"maxScale",u.prototype.pg);t.defineProperty(u,{pg:"maxScale"},function(){return this.Iu},function(a){t.o(a,u,"maxScale");var b=this.Iu;b!==a&&0<a?(this.Iu=a,this.i("maxScale",b,a),a<this.scale&&(this.scale=a)):t.ha(a,"> 0",u,"maxScale")});t.g(u,"zoomPoint",u.prototype.Vh);t.defineProperty(u,{Vh:"zoomPoint"},function(){return this.Cv},function(a){this.Cv.N(a)||(t.m(a,C,u,"zoomPoint"),this.Cv=a=a.Z())});t.g(u,"contentAlignment",u.prototype.Uv);
t.defineProperty(u,{Uv:"contentAlignment"},function(){return this.Hl},function(a){var b=this.Hl;b.N(a)||(t.m(a,K,u,"contentAlignment"),this.Hl=a=a.Z(),this.i("contentAlignment",b,a),gi(this))});t.g(u,"initialContentAlignment",u.prototype.jI);t.defineProperty(u,{jI:"initialContentAlignment"},function(){return this.Mn},function(a){var b=this.Mn;b.N(a)||(t.m(a,K,u,"initialContentAlignment"),this.Mn=a=a.Z(),this.i("initialContentAlignment",b,a))});t.g(u,"padding",u.prototype.padding);
t.defineProperty(u,{padding:"padding"},function(){return this.Le},function(a){"number"===typeof a?a=new sb(a):t.m(a,sb,u,"padding");var b=this.Le;b.N(a)||(this.Le=a=a.Z(),this.Fc(),this.i("padding",b,a))});t.A(u,{Zi:"nodes"},function(){return this.Vu.k});t.A(u,{links:"links"},function(){return this.Eu.k});t.A(u,{rl:"parts"},function(){return this.cb.k});u.prototype.findTopLevelGroups=function(){return this.Vk.k};t.g(u,"layout",u.prototype.Tb);
t.defineProperty(u,{Tb:"layout"},function(){return this.Ld},function(a){var b=this.Ld;b!==a&&(t.m(a,ue,u,"layout"),null!==b&&(b.h=null,b.group=null),this.Ld=a,a.h=this,a.group=null,this.Tt=!0,this.i("layout",b,a),this.Nf())});u.prototype.layoutDiagram=function(a){ei(this);a&&dj(this,!0);wi(this,!1)};function dj(a,b){for(var c=a.Vk.k;c.next();)ej(a,c.value,b);null!==a.Tb&&(b?a.Tb.of=!1:a.Tb.K())}
function ej(a,b,c){if(null!==b){for(var d=b.bm.k;d.next();)ej(a,d.value,c);null!==b.Tb&&(c?b.Tb.of=!1:b.Tb.K())}}function wi(a,b){for(var c=a.Vk.k;c.next();)fj(a,c.value,b);c=a.Tb;if(null!==c&&!c.of){if(b&&!c.nA)return;c.doLayout(a);ei(a);c.of=!0}a.Tt=!1}function fj(a,b,c){if(null!==b){for(var d=b.bm.k;d.next();)fj(a,d.value,c);d=b.Tb;null===d||d.of||c&&!d.nA||(b.zC=!b.location.Q(),d.doLayout(b),b.K(gj),d.of=!0,zi(a,b))}}t.g(u,"isTreePathToChildren",u.prototype.fd);
t.defineProperty(u,{fd:"isTreePathToChildren"},function(){return this.Au},function(a){var b=this.Au;if(b!==a&&(t.j(a,"boolean",u,"isTreePathToChildren"),this.Au=a,this.i("isTreePathToChildren",b,a),!this.Aa.qb))for(a=this.Zi;a.next();)hj(a.value)});u.prototype.findTreeRoots=function(){for(var a=new H(y),b=this.Zi.k;b.next();){var c=b.value;c.dp&&null===c.Js()&&a.add(c)}return a.k};t.g(u,"isCollapsingExpanding",u.prototype.Sd);
t.defineProperty(u,{Sd:null},function(){return this.fC},function(a){this.fC=a});
function Ph(a){function b(a){var b=a.toLowerCase(),h=new H("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new sa("string",H),d=new sa("string","string");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified");b("ObjectSingleClicked");b("ObjectDoubleClicked");
b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Xx=c;a.Wx=d}function ta(a,b){var c=a.Wx.Ba(b);return null!==c?c:a.Wx.Ba(b.toLowerCase())}
function ij(a,b){var c=a.Xx.Ba(b);if(null!==c)return c;c=a.Xx.Ba(b.toLowerCase());if(null!==c)return c;t.l("Unknown DiagramEvent name: "+b);return null}u.prototype.addDiagramListener=u.prototype.Az=function(a,b){t.j(a,"string",u,"addDiagramListener:name");t.j(b,"function",u,"addDiagramListener:listener");var c=ij(this,a);null!==c&&c.add(b)};
u.prototype.removeDiagramListener=u.prototype.eF=function(a,b){t.j(a,"string",u,"removeDiagramListener:name");t.j(b,"function",u,"addDiagramListener:listener");var c=ij(this,a);null!==c&&c.remove(b)};u.prototype.raiseDiagramEvent=u.prototype.Ja=function(a,b,c){f&&t.j(a,"string",u,"raiseDiagramEvent:name");var d=ij(this,a),e=new zd;e.h=this;e.name=ta(this,a);void 0!==b&&(e.Sw=b);void 0!==c&&(e.Fw=c);a=d.length;if(1===a)d=d.qa(0),d(e);else if(0!==a)for(b=d.af(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
function bg(a,b){var c=!1;a.nb.Wj(b)&&(c=!0);c=a.Wz(b,function(a){return a.U},function(a){return a instanceof A},!0,function(a){return a instanceof A},c);if(0!==c.count)for(c=c.k;c.next();){var d=c.value;d.Si&&d.$b()}}
function ia(a,b,c){null===a.Od&&(a.Od=new jj);c=null!==c?c.fb:null;if(a.Od.Zo||a.Od.group!==c){if(null===c){b=a.rj?fi(a):a.vc.copy();b.Ug(100,100);a.Od.initialize(b);b=t.wf();for(var d=a.Zi;d.next();){var e=d.value,g=e.layer;null!==g&&g.visible&&!g.pc&&kj(a,e,null,b)}}else for(b=c.ya.copy(),b.Ug(20,20),a.Od.initialize(b),b=t.wf(),d=c.Ic;d.next();)e=d.value,e instanceof y&&kj(a,e,null,b);t.Rc(b);a.Od.group=c;a.Od.Zo=!1}else b&&lj(a.Od);return a.Od}
function kj(a,b,c,d){if(b!==c)if(b.canAvoid()){c=b.getAvoidableRect(d);d=a.Od.Bm;b=a.Od.Am;for(var e=c.x+c.width,g=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<g;k+=b)mj(a.Od,h,k);mj(a.Od,h,g)}for(k=c.y;k<g;k+=b)mj(a.Od,e,k);mj(a.Od,e,g)}else if(b instanceof z)for(b=b.Ic;b.next();)e=b.value,e instanceof y&&kj(a,e,c,d)}function pj(a,b){null===a.Od||a.Od.Zo||null!==b&&!b.canAvoid()||(a.Od.Zo=!0)}
u.prototype.simulatedMouseMove=u.prototype.BF=function(a,b,c){if(null!==jf){c instanceof u||(c=null);var d=tf,e=jf.h;tf=c;if(c!==d){if(null!==d&&d!==e&&null!==d.Db.ke)return d.Db.ke.doSimulatedDragLeave(),!1;null!==c&&null!==c.Db.ke&&c.Db.ke.doSimulatedDragEnter()}if(null===c||!c.Bz||!c.vm||c.$a||c===e)return!1;d=c.Db.ke;null!==d&&(null!==a&&(b=c.Hg(a)),c.cc.W=b,c.cc.ak=!1,c.cc.bj=!1,d.doSimulatedDragOver());return!0}return!1};
u.prototype.simulatedMouseUp=u.prototype.CF=function(a,b,c,d){if(null!==jf){null===d&&(d=b);b=tf;var e=jf.h;if(d!==b){if(null!==b&&b!==e&&null!==b.Db.ke)return b.Db.ke.doSimulatedDragLeave(),!1;null!==d&&null!==d.Db.ke&&d.Db.ke.doSimulatedDragEnter()}tf=d;if(null===d)return jf.doCancel(),!0;if(d!==this)return null!==a&&(c=d.Hg(a)),d.cc.W=c,d.cc.ak=!1,d.cc.bj=!0,a=d.Db.ke,null!==a&&a.doSimulatedDrop(),a=jf,null!==a&&(d=a.mayCopy(),a.bf=d?"Copy":"Move",a.stopTool()),!0}return!1};
t.g(u,"autoScrollRegion",u.prototype.kD);t.defineProperty(u,{kD:"autoScrollRegion"},function(){return this.Wt},function(a){"number"===typeof a?a=new sb(a):t.m(a,sb,u,"autoScrollRegion");var b=this.Wt;b.N(a)||(this.Wt=a=a.Z(),this.Fc(),this.i("autoScrollRegion",b,a))});function Yf(a,b){a.Dx=a.gn(b);Bj(a,a.Dx).Oi(a.position)?xf(a):Cj(a)}
function Cj(a){if(null===a.eh){a.eh={};var b;b=a.Za!==a.Db.ke?a.tG:a.uG;a.eh.isEnabled=!0;var c=setInterval(function(){var b=c;null!==a.eh&&a.eh.isEnabled&&(a.eh=null,clearInterval(b),b=Bj(a,a.Dx),b.Oi(a.position)||(a.position=b,a.T.W=a.UF(a.Dx),a.doMouseMove(),a.rj=!0,ji(a,a.kf()),a.Je=!0,a.Xi(),Cj(a)))},b);a.eh.id=c}}function xf(a){null!==a.eh&&(a.eh.isEnabled&&clearInterval(a.eh.id),a.eh=null)}
function Bj(a,b){var c=a.position,d=a.kD;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.nb,g=a.scale,e=t.lk(0,0,e.width*g,e.height*g),h=t.ic(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.Cp,1),k=k|0;h.x-=k;b.x<e.x+d.left/2&&(h.x-=k);b.x<e.x+d.left/4&&(h.x-=4*k)}else b.x<=e.x+e.width&&b.x>e.x+e.width-d.right&&(k=Math.max(a.Cp,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.y<e.y+d.top?(k=Math.max(a.Dp,1),k|=0,h.y-=k,b.y<e.y+
d.top/2&&(h.y-=k),b.y<e.y+d.top/4&&(h.y-=4*k)):b.y<=e.y+e.height&&b.y>e.y+e.height-d.bottom&&(k=Math.max(a.Dp,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Oi(J.ok)||(c=new C(c.x+h.x/g,c.y+h.y/g));t.Rc(e);t.B(h);return c}u.prototype.makeSVG=function(a){void 0===a&&(a={});a.context="svg";a=Dj(this,a);return null!==a?a.Bt:null};
u.prototype.makeImage=function(a){var b=document.createElement("img");b.src=this.BI(a);return b instanceof HTMLImageElement?b:null};u.prototype.makeImageData=u.prototype.BI=function(a){void 0===a&&(a={});var b=Dj(this,a);return null!==b?b.toDataURL(a.type,a.details):""};
function Dj(a,b){a.Xi();if(null===a.Pa)return null;"object"!==typeof b&&t.l("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var g=b.maxSize||new pa(2E3,2E3);void 0===b.maxSize&&(c=!0);var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.showTemporary;void 0===p&&(p=!n);n=b.showGrid;void 0===n&&(n=p);null!==d&&isNaN(d.width)&&isNaN(d.height)&&
(d=null);l&&"number"===typeof l&&(l=new sb(l));l||(l=new sb(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.En=!1;ca(a);var q=document.createElement("canvas"),r=q.getContext("2d"),s=q;if(!(d||e||k||h))return q.width=a.Pa.width+Math.ceil(l.left+l.right),q.height=a.Pa.height+Math.ceil(l.top+l.bottom),"svg"===b.context&&(r=s=new Bc(q),r instanceof Bc&&(a.En=!0)),Fi(a,r,l,new pa(q.width,q.height),a.Sb,a.rb,k,m,p,n),a.En=!0,s;var v,x=new C(0,
0);v=a.vc.copy();v.gJ(a.padding);null!==h&&h.Q()?(x=h,e||(e=1)):(x.x=v.x,x.y=v.y);if(k){var E,h=!0,k=k.k;for(k.reset();k.next();){var F=k.value;if(F instanceof w){var G=F.layer;G&&!G.visible||G&&G.pc||!F.zb()||(F=F.ya,F.Q()&&(h?(h=!1,E=F.copy()):E.nk(F)))}}h&&(E=new D(0,0,0,0));v.width=E.width;v.height=E.height;x.x=E.x;x.y=E.y}h=E=0;l&&(E=l.left+l.right,h=l.top+l.bottom);F=G=0;d&&(G=d.width,F=d.height,isFinite(G)&&(G=Math.max(0,G-E)),isFinite(F)&&(F=Math.max(0,F-h)));d&&e?("NaN"===e&&(e=1),d.Q()?
(d=G,v=F):isNaN(F)?(d=G,v=v.height*e):(d=v.width*e,v=F)):d?d.Q()?(e=Math.min(G/v.width,F/v.height),d=G,v=F):isNaN(F)?(e=G/v.width,d=G,v=v.height*e):(e=F/v.height,d=v.width*e,v=F):e?"NaN"===e&&g.Q()?(e=Math.min((g.width-E)/v.width,(g.height-h)/v.height),1<e?(e=1,d=v.width,v=v.height):(d=g.width,v=g.height)):(d=v.width*e,v=v.height*e):(e=1,d=v.width,v=v.height);l?(d+=E,v+=h):l=new sb(0);g&&(E=g.width,g=g.height,"svg"!==b.context&&c&&!t.cG&&(d>E||v>g)&&(t.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+
Math.ceil(d)+"x"+Math.ceil(v)+" vs 2000x2000) Consider increasing the max size."),t.cG=!0),isNaN(E)&&(E=2E3),isNaN(g)&&(g=2E3),isFinite(E)&&(d=Math.min(d,E)),isFinite(g)&&(v=Math.min(v,g)));q.width=Math.ceil(d);q.height=Math.ceil(v);"svg"===b.context&&(r=s=new Bc(q),r instanceof Bc&&(a.En=!0));Fi(a,r,l,new pa(Math.ceil(d),Math.ceil(v)),e,x,k,m,p,n);a.En=!0;return s}
u.inherit=function(a,b){t.j(a,"function",u,"inherit");t.j(b,"function",u,"inherit");b.EG&&t.l("Cannot inherit from "+t.Tg(b));t.Oa(a,b)};function Ej(a){1<arguments.length&&t.l("Palette constructor can only take one optional argument, the DIV HTML element or its id.");u.call(this,a);this.Iv=!0;this.al=!1;this.$a=!0;this.Uv=Tb;this.Tb=new Fj}t.ia("Palette",Ej);t.Oa(Ej,u);
function Ii(a){1<arguments.length&&t.l("Overview constructor can only take one optional argument, the DIV HTML element or its id.");u.call(this,a);this.lc=!0;this.qi=null;this.mu=!0;var b=new w,c=new Y;c.stroke="magenta";c.ib=2;c.fill=null;c.name="BOXSHAPE";b.vt="BOXSHAPE";b.Zs="BOXSHAPE";b.add(c);this.pn=b;this.jz=document.createElement("canvas");this.GG=this.jz.getContext("2d");b=new Gj;b.qe(this);this.Db.sf.Ad(0,b);var d=this;this.$E=function(){Hj(d)};this.ZE=function(){null!==d.qi&&(d.Fc(),d.pa())};
this.$a=!0;this.Ne=!1;this.zm=qi;this.Db.Xm=df;this.lc=!1}t.ia("Overview",Ii);t.Oa(Ii,u);
function Ji(a){a.lc||a.Jd||!1!==a.hg||(a.hg=!0,requestAnimationFrame(function(){if(a.hg&&!a.Jd&&(a.hg=!1,null!==a.Ab)){a.Jd=!0;ei(a);a.vc.Q()||ji(a,a.kf());null===a.Ab&&t.l("No div specified");null===a.Pa&&t.l("No canvas specified");if(a.Je&&null!==a.qi){var b=a.Tf,c=a.jz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Pa.width,a.Pa.height);b.drawImage(c,0,0);c=a.bd;c.reset();1!==a.Sb&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.rb.x,-a.rb.y);b.setTransform(c.m11,c.m12,c.m21,
c.m22,c.dx,c.dy);for(var c=a.Kb.length,d=0;d<c;d++)a.Kb.p[d].Re(b,a);a.Lk=!1;a.Je=!1}a.Jd=!1}}))}
Ii.prototype.Re=function(){null===this.Ab&&t.l("No div specified");null===this.Pa&&t.l("No canvas specified");if(this.Je){var a=this.qi;if(null!==a){var b=a.Xo;(b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&vi(a);var c=this.Pa,b=this.Tf,d=this.jz,e=this.GG;d.width=c.width;d.height=c.height;b.Kt="";b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.Pa.width,this.Pa.height);var g=this.bd;g.reset();1!==this.Sb&&g.scale(this.scale);0===this.position.x&&0===this.position.y||g.translate(-this.rb.x,-this.rb.y);
b.setTransform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);for(var h=this.mu,k=this.nb,l=a.Kb.length,m=0;m<l;m++){var n=a.Kb.p[m],p=b,q=k,r=h;void 0===r&&(r=!0);if(r||!n.pc)for(var n=n.cb,r=this.scale,s=n.length,v=0;v<s;v++){var x=n.p[v],E=x.ya;E.If(q)&&(1<E.width*r||1<E.height*r?x.Re(p,this):Jh(x,p))}}e.drawImage(c,0,0);f&&f.Gi&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));a=this.Kb.length;for(m=0;m<a;m++)this.Kb.p[m].Re(b,this);f&&(f.Uz||f.Gi)&&f.Tz(b,this,g);this.Je=this.Lk=!1}}};
t.g(Ii,"observed",Ii.prototype.JI);t.defineProperty(Ii,{JI:"observed"},function(){return this.qi},function(a){var b=this.qi;null!==a&&t.m(a,u,Ii,"observed");b===a||a instanceof Ii||(null!==b&&(this.remove(this.kg),b.eF("ViewportBoundsChanged",this.$E),b.eF("DocumentBoundsChanged",this.ZE),b.fo.remove(this)),this.qi=a,null!==a&&(a.Az("ViewportBoundsChanged",this.$E),a.Az("DocumentBoundsChanged",this.ZE),a.fo.add(this),this.add(this.kg),Hj(this)),this.Fc(),this.i("observed",b,a))});t.g(Ii,"box",Ii.prototype.kg);
t.defineProperty(Ii,{kg:"box"},function(){return this.pn},function(a){var b=this.pn;b!==a&&(this.pn=a,this.i("box",b,a))});t.g(Ii,"drawsTemporaryLayers",Ii.prototype.QH);t.defineProperty(Ii,{QH:"drawsTemporaryLayers"},function(){return this.mu},function(a){this.mu!==a&&(this.mu=a,this.ot())});
function Hj(a){var b=a.kg;if(null!==b){var c=a.qi;if(null!==c){a.Je=!0;var c=c.nb,d=b.an,e=t.xl();e.q(c.width,c.height);d.Ca=e;t.dk(e);a=2/a.scale;d instanceof Y&&(d.ib=a);b.location=new C(c.x-a/2,c.y-a/2)}}}Ii.prototype.kf=function(){var a=this.qi;return null===a?J.rG:a.vc};Ii.prototype.kt=function(a){this.lc||(ci(this),this.pa(),ti(this),this.Fc(),Hj(this),this.Ja("ViewportBoundsChanged",a))};function Gj(){le.call(this);this.name="MoveBox"}t.Oa(Gj,le);
Gj.prototype.doStart=function(){this.ra=this.h.Bd=!0};Gj.prototype.doMouseMove=function(){if(this.ra){var a=this.h;if(null!==a&&null!==a.qi){var b=a.qi,c=b.nb,d=a.T.W;b.position=new C(d.x-c.width/2,d.y-c.height/2);a.Nf()}}};Gj.prototype.doMouseUp=function(){this.ra&&this.doMouseMove();this.stopTool()};Gj.prototype.doStop=function(){this.ra=!1;var a=this.h;a.Bd=!1;Hj(a)};
function fe(a){1<arguments.length&&t.l("Brush constructor can take at most one optional argument, the Brush type.");t.zc(this);this.jb=!1;void 0===a?(this.ba=he,this.tn="black"):"string"===typeof a?(this.ba=he,this.tn=a):(f&&t.tb(a,fe,fe,"constructor:type"),this.ba=a,this.tn="black");var b=this.ba;b===ie?(this.mo=Tb,this.Gn=Xb):this.Gn=b===je?this.mo=Vb:this.mo=Pb;this.pv=0;this.nu=NaN;this.Eg=this.av=this.Dg=null;this.Jx=this.Kx=0}t.ia("Brush",fe);var he;fe.Solid=he=t.w(fe,"Solid",0);var ie;
fe.Linear=ie=t.w(fe,"Linear",1);var je;fe.Radial=je=t.w(fe,"Radial",2);var Ij;fe.Pattern=Ij=t.w(fe,"Pattern",2);fe.prototype.copy=function(){var a=new fe;a.ba=this.ba;a.tn=this.tn;a.mo=this.mo;a.Gn=this.Gn;a.pv=this.pv;a.nu=this.nu;null!==this.Dg&&(a.Dg=this.Dg.copy());a.av=this.av;return a};fe.prototype.Na=function(){this.freeze();Object.freeze(this);return this};fe.prototype.freeze=function(){this.jb=!0;null!==this.Dg&&this.Dg.freeze();return this};
fe.prototype.Ua=function(){Object.isFrozen(this)&&t.l("cannot thaw constant: "+this);this.jb=!1;null!==this.Dg&&this.Dg.Ua();return this};fe.prototype.toString=function(){var a="Brush(";if(this.type===he)a+=this.color;else if(a=this.type===ie?a+"Linear ":this.type===je?a+"Radial ":this.type===Ij?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.Fo)for(var b=this.Fo.k;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
fe.prototype.addColorStop=fe.prototype.addColorStop=function(a,b){t.J(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&t.ha(a,"0 <= loc <= 1",fe,"addColorStop:loc");t.j(b,"string",fe,"addColorStop:color");null===this.Dg&&(this.Dg=new sa("number","string"));this.Dg.add(a,b);this.ba===he&&(this.type=ie);this.Eg=null};t.g(fe,"type",fe.prototype.type);
t.defineProperty(fe,{type:"type"},function(){return this.ba},function(a){t.J(this,a);t.tb(a,fe,fe,"type");this.ba=a;this.start.qd()&&(a===ie?this.start=Tb:a===je&&(this.start=Vb));this.end.qd()&&(a===ie?this.end=Xb:a===je&&(this.end=Vb));this.Eg=null});t.g(fe,"color",fe.prototype.color);t.defineProperty(fe,{color:"color"},function(){return this.tn},function(a){t.J(this,a);t.j(a,"string",fe,"color");this.tn=a;this.Eg=null});t.g(fe,"start",fe.prototype.start);
t.defineProperty(fe,{start:"start"},function(){return this.mo},function(a){t.J(this,a);a instanceof K||t.Vb(a,"Spot",fe,"start");this.mo=a.Z();this.Eg=null});t.g(fe,"end",fe.prototype.end);t.defineProperty(fe,{end:"end"},function(){return this.Gn},function(a){t.J(this,a);a instanceof K||t.Vb(a,"Spot",fe,"end");this.Gn=a.Z();this.Eg=null});t.g(fe,"startRadius",fe.prototype.Ip);
t.defineProperty(fe,{Ip:"startRadius"},function(){return this.pv},function(a){t.J(this,a);t.o(a,fe,"startRadius");0>a&&t.ha(a,">= zero",fe,"startRadius");this.pv=a;this.Eg=null});t.g(fe,"endRadius",fe.prototype.Lo);t.defineProperty(fe,{Lo:"endRadius"},function(){return this.nu},function(a){t.J(this,a);t.o(a,fe,"endRadius");0>a&&t.ha(a,">= zero",fe,"endRadius");this.nu=a;this.Eg=null});t.g(fe,"colorStops",fe.prototype.Fo);
t.defineProperty(fe,{Fo:"colorStops"},function(){return this.Dg},function(a){t.J(this,a);f&&t.m(a,sa,fe,"colorStops");this.Dg=a;this.Eg=null});t.g(fe,"pattern",fe.prototype.pattern);t.defineProperty(fe,{pattern:"pattern"},function(){return this.av},function(a){t.J(this,a);this.av=a;this.Eg=null});
fe.randomColor=function(a,b){void 0===a&&(a=128);f&&(t.o(a,fe,"randomColor:min"),(0>a||255<a)&&t.ha(a,"0 <= min <= 255",fe,"randomColor:min"));void 0===b&&(b=Math.max(a,255));f&&(t.o(b,fe,"randomColor:max"),(b<a||255<b)&&t.ha(b,"min <= max <= 255",fe,"randomColor:max"));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+
d+e+c};
function X(){t.zc(this);this.ka=30723;this.si=null;this.Rb="";this.jc=this.Gb=null;this.rb=(new C(NaN,NaN)).freeze();this.df=(new pa(NaN,NaN)).freeze();this.de=J.kn;this.Aj=J.qG;this.bd=new qa;this.Xh=new qa;this.Ok=new qa;this.Sb=1;this.on=0;this.zh=Xg;this.er=J.Tp;this.Lc=(new D(NaN,NaN,NaN,NaN)).freeze();this.Fb=(new D(NaN,NaN,NaN,NaN)).freeze();this.Mc=(new D(0,0,NaN,NaN)).freeze();this.fs=this.Bq=this.V=this.zr=this.ee=null;this.gs=this.Cq=Infinity;this.$p=this.re=Qb;this.Kr=0;this.Hj=1;this.gq=
0;this.hj=1;this.Nr=-Infinity;this.Mr=0;this.Pr=J.ok;this.Qr=Ig;this.nq="";this.fm=this.$h=this.Il=this.Bc=this.R=null}t.ia("GraphObject",X);t.Fh(X);
X.prototype.cloneProtected=function(a){a.ka=this.ka|6144;a.Rb=this.Rb;a.Gb=this.Gb;a.jc=this.jc;a.rb.assign(this.rb);a.df.assign(this.df);a.de=this.de.Z();a.Aj=this.Aj.Z();a.Ok=this.Ok.copy();a.Sb=this.Sb;a.on=this.on;a.zh=this.zh;a.er=this.er.Z();a.Lc.assign(this.Lc);a.Fb.assign(this.Fb);a.Mc.assign(this.Mc);a.zr=this.zr;a.re=this.re.Z();a.$p=this.$p.Z();a.Kr=this.Kr;a.Hj=this.Hj;a.gq=this.gq;a.hj=this.hj;a.Nr=this.Nr;a.Mr=this.Mr;a.Pr=this.Pr.Z();a.Qr=this.Qr;a.nq=this.nq;if(null!==this.R){var b=
this.R;a.R={Zh:b.Zh,ei:b.ei,ai:b.ai,pr:b.pr,qr:b.qr,oi:b.oi,ni:b.ni,mi:b.mi,nr:b.nr,or:b.or,li:b.li,Vp:b.Vp,Wp:b.Wp,Xp:b.Xp,Up:b.Up,yi:b.yi,bi:b.bi}}null!==this.V&&(b=this.V,a.V={oj:b.oj.Z(),Qj:b.Qj.Z(),mj:b.mj,Oj:b.Oj,lj:b.lj,Nj:b.Nj,nj:b.nj,Pj:b.Pj});a.Bq=this.Bq;a.Cq=this.Cq;a.fs=this.fs;a.gs=this.gs;a.Bc=this.Bc;if(Array.isArray(this.Il))for(a.Il=this.Il.slice(0),b=0;b<this.Il.length;b++){var c=this.Il[b];a[c]=this[c]}null!==this.$h&&(a.$h=this.$h.copy())};
X.prototype.Gh=function(a){a.ee=null;a.fm=null;a.aa()};X.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};X.prototype.toString=function(){return t.Tg(Object.getPrototypeOf(this))+"#"+t.oc(this)};var Wg;X.None=Wg=t.w(X,"None",0);var Xg;X.Default=Xg=t.w(X,"Default",0);var Jj;X.Vertical=Jj=t.w(X,"Vertical",4);var Kj;X.Horizontal=Kj=t.w(X,"Horizontal",5);var Nc;X.Fill=Nc=t.w(X,"Fill",3);var Yg;X.Uniform=Yg=t.w(X,"Uniform",1);var Zg;
X.UniformToFill=Zg=t.w(X,"UniformToFill",2);function Lj(a){a.R={Zh:null,ei:null,ai:null,pr:null,qr:null,oi:null,ni:null,mi:null,nr:null,or:null,li:null,Vp:null,Wp:null,Xp:null,Up:null,yi:null,bi:null}}aa=X.prototype;aa.Ge=function(){this.V={oj:Pb,Qj:Pb,mj:10,Oj:10,lj:Mj,Nj:Mj,nj:0,Pj:0}};
function Nj(a,b,c,d,e,g,h){var k=0.001,l=g.length;a.moveTo(b,c);d-=b;k=e-c;0===d&&(d=0.001);e=k/d;for(var m=Math.sqrt(d*d+k*k),n=0,p=!0,q=0===h?!1:!0;0.1<=m;){if(q){k=g[n++%l];for(k-=h;0>k;)k+=g[n++%l],p=!p;q=!1}else k=g[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}}aa.Vc=function(a,b,c,d,e,g,h){var k=this.U;null!==k&&(k.Zm(a,b,c,d,e,g,h),0!==(this.ka&1024)&&c===this&&a===Cd&&Oj(this,k,b))};
function Oj(a,b,c){var d=a.Qo();if(null!==d)for(var e=a.Bc.k;e.next();){var g=e.value,h=d.data,k=g.zt;null!==k&&(h=d.le(k));if(null!==h&&(g.ZF(a,h,c,null!==k?null:b.h),null!==k&&(h=d,""!==k&&(h=d.le(k)),null!==h))){var k=g.en,l=d;""!==k&&(l=d.le(k));null!==l&&g.$F(l,h,c)}}}aa.i=function(a,b,c){this.Vc(Cd,a,this,b,c)};function Pj(a,b,c,d,e){var g=a.Lc,h=a.Ok;h.reset();Qj(a,h,b,c,d,e);a.Ok=h;g.x=b;g.y=c;g.width=d;g.height=e;h.Ts()||h.TF(g)}
function Rj(a,b,c,d){if(!1===a.Ze)return!1;d.multiply(a.transform);return c?a.If(b,d):a.Em(b,d)}aa.XD=function(a,b,c){if(!1===this.Ze)return!1;var d=this.Ia;b=a.$j(b);var e=!1;c&&(e=db(a.x,a.y,0,0,0,d.height)<b||db(a.x,a.y,0,d.height,d.width,d.height)<b||db(a.x,a.y,d.width,d.height,d.width,0)<b||db(a.x,a.y,d.width,0,0,0)<b);c||(e=db(a.x,a.y,0,0,0,d.height)<b&&db(a.x,a.y,0,d.height,d.width,d.height)<b&&db(a.x,a.y,d.width,d.height,d.width,0)<b&&db(a.x,a.y,d.width,0,0,0)<b);return e};aa.bh=function(){return!0};
X.prototype.containsPoint=X.prototype.Ha=function(a){f&&t.m(a,C,X,"containsPoint:p");var b=t.O();b.assign(a);this.transform.Va(b);var c=this.ya;if(!c.Q())return!1;if(t.gB){var d=this.Ia,e=this.fk()*(null!==this.h?this.h.scale:1),g=1/e;if(10>d.width*e&&10>d.height*e)return a=Eb(c.x-5*g,c.y-5*g,c.width+10*g,c.height+10*g,b.x,b.y),t.B(b),a}if(void 0!==this.Pc||this instanceof Y?Eb(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Ha(b)){if(this.$h&&!this.$h.Ha(b))return!1;if(null!==this.jc&&c.Ha(b)||null!==
this.Gb&&this.Mc.Ha(a))return!0;t.B(b);return this.Vj(a)}t.B(b);return!1};X.prototype.Vj=function(a){var b=this.Ia;return Eb(0,0,b.width,b.height,a.x,a.y)};
X.prototype.containsRect=X.prototype.Wj=function(a){f&&t.m(a,D,X,"containsRect:r");if(0===this.angle)return this.ya.Wj(a);var b=this.Ia,b=t.lk(0,0,b.width,b.height),c=this.transform,d=!1,e=t.ic(a.x,a.y);b.Ha(c.Ri(e))&&(e.q(a.x,a.bottom),b.Ha(c.Ri(e))&&(e.q(a.right,a.bottom),b.Ha(c.Ri(e))&&(e.q(a.right,a.y),b.Ha(c.Ri(e))&&(d=!0))));t.B(e);t.Rc(b);return d};
X.prototype.containedInRect=X.prototype.Em=function(a,b){f&&t.m(a,D,X,"containedInRect:r");if(void 0===b)return a.Wj(this.ya);var c=this.Ia,d=!1,e=t.ic(0,0);a.Ha(b.Va(e))&&(e.q(0,c.height),a.Ha(b.Va(e))&&(e.q(c.width,c.height),a.Ha(b.Va(e))&&(e.q(c.width,0),a.Ha(b.Va(e))&&(d=!0))));return d};
X.prototype.intersectsRect=X.prototype.If=function(a,b){f&&t.m(a,D,X,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.If(this.ya);var c=this.Ia,d=b,e=t.ic(0,0),g=t.ic(0,c.height),h=t.ic(c.width,c.height),k=t.ic(c.width,0),l=!1;if(a.Ha(d.Va(e))||a.Ha(d.Va(g))||a.Ha(d.Va(h))||a.Ha(d.Va(k)))l=!0;else{var c=t.lk(0,0,c.width,c.height),m=t.ic(a.x,a.y);c.Ha(d.Ri(m))?l=!0:(m.q(a.x,a.bottom),c.Ha(d.Ri(m))?l=!0:(m.q(a.right,a.bottom),c.Ha(d.Ri(m))?l=!0:(m.q(a.right,a.y),c.Ha(d.Ri(m))&&
(l=!0))));t.B(m);t.Rc(c);!l&&(J.ow(a,e,g)||J.ow(a,g,h)||J.ow(a,h,k)||J.ow(a,k,e))&&(l=!0)}t.B(e);t.B(g);t.B(h);t.B(k);return l};X.prototype.getDocumentPoint=X.prototype.gb=function(a,b){void 0===b&&(b=new C);a.qd()&&t.l("Spot must be real");var c=this.Ia;b.q(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY);this.he.Va(b);return b};X.prototype.getDocumentAngle=X.prototype.jl=function(){var a=this.he,a=180/Math.PI*Math.atan2(a.m12,a.m11);0>a&&(a+=360);return a};
X.prototype.getDocumentScale=X.prototype.fk=function(){var a=this.Sb;return null!==this.ga?a*this.ga.fk():a};X.prototype.getLocalPoint=X.prototype.gE=function(a,b){void 0===b&&(b=new C);b.assign(a);this.he.Ri(b);return b};X.prototype.getNearestIntersectionPoint=X.prototype.Vo=function(a,b,c){return this.Ls(a.x,a.y,b.x,b.y,c)};aa=X.prototype;
aa.Ls=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.Ci)return g=this.ya,J.Vo(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(!(this instanceof B)||this instanceof B&&null!==this.background)return h=a*k+b*m+p,a=a*l+b*n+q,k=c*k+d*m+p,c=c*l+d*n+q,e.q(0,0),d=this.Ia,c=J.Vo(0,0,d.width,d.height,h,a,k,c,e),e.transform(g),c;if(this instanceof B&&(null===this.Ci||void 0===
this.Ci)){h=a*k+b*m+p;a=a*l+b*n+q;k=c*k+d*m+p;d=c*l+d*n+q;e.q(k,d);l=(k-h)*(k-h)+(d-a)*(d-a);c=!1;n=this.za.p;q=n.length;m=t.O();for(p=0;p<q;p++)b=n[p],b.visible&&b.Ls(h,a,k,d,m)&&(c=!0,b=(h-m.x)*(h-m.x)+(a-m.y)*(a-m.y),b<l&&(l=b,e.set(m)));t.B(m);e.transform(g);return c}t.l("Unknown GraphObject case");return!1};
function Dh(a,b,c,d,e){if(!1!==Ai(a)){var g=a.margin,h=g.top+g.bottom;b=Math.max(b-(g.right+g.left),0);c=Math.max(c-h,0);g=a.angle;if(90===g||270===g)g=b,b=c,c=g,g=d,d=e,e=g;g=a.Ca;h=0;a.ib&&(h=a.ib);b=isFinite(g.width)?g.width+h:b;c=isFinite(g.height)?g.height+h:c;var g=d||0,h=e||0,k=a instanceof B;switch(Sj(a)){case Wg:h=g=0;k&&(c=b=Infinity);break;case Nc:isFinite(b)&&b>d&&(g=b);isFinite(c)&&c>e&&(h=c);break;case Kj:isFinite(b)&&b>d&&(g=b);h=0;k&&(c=Infinity);break;case Jj:isFinite(c)&&c>e&&(h=
c),g=0,k&&(b=Infinity)}var k=a.He,l=a.Ye;g>k.width&&l.width<k.width&&(g=k.width);h>k.height&&l.height<k.height&&(h=k.height);d=Math.max(g/a.scale,l.width);e=Math.max(h/a.scale,l.height);k.width<d&&(d=Math.min(l.width,d));k.height<e&&(e=Math.min(l.height,e));b=Math.min(k.width,b);c=Math.min(k.height,c);b=Math.max(d,b);c=Math.max(e,c);a.Lc.Ua();a.$s(b,c,d,e);a.Lc.freeze();a.Lc.Q()||t.l("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Lc.toString());Tj(a,!1)}}
aa.Dc=function(a,b,c,d,e){Uj(this);var g=t.wf();g.assign(this.Fb);this.Fb.Ua();if(!1===Bi(this)){var h=this.Fb;h.x=a;h.y=b;h.width=c;h.height=d}else this.Uj(a,b,c,d);this.Fb.freeze();this.$h=void 0===e?null:e;c=!1;void 0!==e?c=!0:this.ga&&(e=this.ga.Mc,d=this.Ea,null!==this.Ci&&(d=this.Fb),c=b+d.height,d=a+d.width,c=!(0<=a&&d<=e.width&&0<=b&&c<=e.height),this instanceof va&&(a=this.Mc,this.Hu>a.height||this.Yn.Wi>a.width))&&(c=!0);this.ka=c?this.ka|256:this.ka&-257;this.Fb.Q()||t.l("Non-real actualBounds has been set. Object "+
this+", actualBounds: "+this.Fb.toString());Vj(this,g,this.Fb);t.Rc(g)};aa.Uj=function(){};function Wj(a,b,c,d,e){var g=a.ya;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ca.Q()){g=a.Lc;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=Sj(a);c===d&&g===e&&(b=Wg);switch(b){case Wg:if(c>d||g>e)Tj(a,!0),Dh(a,c>d?d:c,g>e?e:g);break;case Nc:Tj(a,!0);Dh(a,d,e,0,0);break;case Kj:Tj(a,!0);Dh(a,d,g,0,0);break;case Jj:Tj(a,!0),Dh(a,c,e,0,0)}}}
function Vj(a,b,c){Xj(a,!1);var d=a.U;if(null!==d){var e=d.h;if(null!==e)if(Yj(d),a instanceof w){var g=!1,d=b.Q();if(!1===e.rj){var h=e.vc,k=e.padding,l=h.x+k.left,m=h.y+k.top,n=h.width-2*k.right,h=h.height-2*k.bottom;d&&b.x>l&&b.y>m&&b.right<n&&b.bottom<h&&c.x>l&&c.y>m&&c.right<n&&c.bottom<h&&(g=!0)}0!==(a.ca&65536)!==!0&&b.N(c)||Ni(a,g,e);e.Vy&&null!==e.jj?(g=null,d&&(g=t.wf(),Lh(a,b,g)),e.pa(c.Q()?Lh(a,c):null,g),null!==g&&t.Rc(g)):e.pa()}else Zj(a,d),a.pa(),b=a.U,null!==b&&(b.an!==a&&b.jF!==
a&&b.nF!==a||ak(b,!0))}}function Zj(a,b){null!==a.sd&&ak(b,!0);if(a instanceof B)for(var c=a.za,d=c.length,e=0;e<d;e++)Zj(c.p[e],b)}
aa.Re=function(a,b){if(this.visible)if(a instanceof Bc)a:{if(this.visible)if(this instanceof B&&(this.type===bk||this.type===ck))dk(this,a,b);else{var c=this.Fb;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.transform,e=this.ga,g=this.Xh;g.reset();null!==e&&(e.bh()?g.multiply(e.he):null!==e.ga&&g.multiply(e.ga.he));g.multiply(this.bd);var g=0!==(this.ka&256),h=!1;this instanceof va&&ek(this,a);if(g){h=e.bh()?e.Ia:e.ya;if(this.$h)var k=this.$h,l=k.x,m=k.y,n=k.width,k=k.height;else l=
Math.max(c.x,h.x),m=Math.max(c.y,h.y),n=Math.min(c.right,h.right)-l,k=Math.min(c.bottom,h.bottom)-m;if(l>c.width+c.x||c.x>h.width+h.x||m>c.height+c.y||c.y>h.height+h.y)break a;h=!0;Jc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(l,m,n,k);a.clip()}l=!1;if(this instanceof w&&(l=!0,!this.zb()))break a;m=!1;this.U&&(m=this.U.Lh);a.Ki.Xe=[1,0,0,1,0,0];null!==this.jc&&(fk(this,a,this.jc,!0,!0),this.jc instanceof fe&&this.jc.type===je?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),gk(a,this.jc,!0)):a.fillRect(c.x,
c.y,c.width,c.height));l&&this.Lh&&(Jc(a,1,0,0,1,0,0),c=this.om,a.shadowOffsetX=c.x,a.shadowOffsetY=c.y,a.shadowColor=this.nm,a.shadowBlur=this.mm/b.scale,a.ab());this instanceof B?Jc(a,d.m11,d.m12,d.m21,d.m22,d.dx,d.dy):a.Ki.Xe=[d.m11,d.m12,d.m21,d.m22,d.dx,d.dy];if(null!==this.Gb){var k=this.Ia,c=d=0,n=k.width,k=k.height,p=0;this instanceof Y&&(k=this.Ra.Mb,d=k.x,c=k.y,n=k.width,k=k.height,p=this.fe);fk(this,a,this.Gb,!0);this.Gb instanceof fe&&this.Gb.type===je?(a.beginPath(),a.rect(d-p/2,c-p/
2,n+p,k+p),gk(a,this.Gb,!0)):a.fillRect(d-p/2,c-p/2,n+p,k+p)}if(m&&(null!==this.Gb||null!==this.jc||null!==e&&0!==(e.ka&512)||null!==e&&e.type===Xh&&e.gw()!==this)){hk(this,!0);var q=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur];a.shadowOffsetX=0;a.shadowOffsetY=0;a.shadowBlur=0}else hk(this,!1);this.hl(a,b);m&&0!==(this.ka&512)===!0&&(a.shadowOffsetX=q[0],a.shadowOffsetY=q[1],a.shadowBlur=q[2]);l&&m&&(a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);g?(a.restore(),h&&a.og.pop(),ca(b,a)):this instanceof
B&&a.og.pop();l&&m&&a.og.pop()}}}else if(this instanceof B&&(this.type===bk||this.type===ck))dk(this,a,b);else if(d=this.Fb,0!==d.width&&0!==d.height&&!isNaN(d.x)&&!isNaN(d.y)){!f||!f.Gi||this instanceof Ve||f.JH(a,this);q=this.transform;g=this.ga;h=this.Xh;h.reset();null!==g&&(g.bh()?h.multiply(g.he):null!==g.ga&&h.multiply(g.ga.he));h.multiply(this.bd);h=0!==(this.ka&256);this instanceof va&&ek(this,a);if(h){f&&f.UD&&t.trace("clip"+this.toString());c=g.bh()?g.Ia:g.ya;this.$h?(k=this.$h,l=k.x,m=
k.y,n=k.width,k=k.height):(l=Math.max(d.x,c.x),m=Math.max(d.y,c.y),n=Math.min(d.right,c.right)-l,k=Math.min(d.bottom,c.bottom)-m);if(l>d.width+d.x||d.x>c.width+c.x||m>d.height+d.y||d.y>c.height+c.y)return;f&&f.UD&&f.LH(a,l,m,n,k);a.save();a.beginPath();a.rect(l,m,n,k);a.clip()}c=!1;if(this instanceof w){c=!0;if(!this.zb())return;this.Lh&&(l=this.om,a.shadowOffsetX=l.x*b.scale,a.shadowOffsetY=l.y*b.scale,a.shadowColor=this.nm,a.shadowBlur=this.mm)}l=!1;this.U&&(l=this.U.Lh);null!==this.jc&&(fk(this,
a,this.jc,!0,!0),this.jc instanceof fe&&this.jc.type===je?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),gk(a,this.jc,!0)):a.fillRect(d.x,d.y,d.width,d.height));q.Ts()||a.transform(q.m11,q.m12,q.m21,q.m22,q.dx,q.dy);null!==this.Gb&&(k=this.Ia,m=d=0,n=k.width,k=k.height,p=0,this instanceof Y&&(k=this.Ra.Mb,d=k.x,m=k.y,n=k.width,k=k.height,p=this.fe),fk(this,a,this.Gb,!0),this.Gb instanceof fe&&this.Gb.type===je?(a.beginPath(),a.rect(d-p/2,m-p/2,n+p,k+p),gk(a,this.Gb,!0)):a.fillRect(d-p/2,m-p/2,n+
p,k+p));f&&f.Gi&&f.KH(a,this);l&&(null!==this.Gb||null!==this.jc||null!==g&&0!==(g.ka&512)||null!==g&&g.type===Xh&&g.gw()!==this)?(hk(this,!0),e=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur],a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0):hk(this,!1);this.hl(a,b);l&&0!==(this.ka&512)===!0&&(a.shadowOffsetX=e[0],a.shadowOffsetY=e[1],a.shadowBlur=e[2]);c&&l&&(a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);h?(a.restore(),this instanceof B?ca(b,a,!0):ca(b,a,!1)):q.Ts()||(e=1/(q.m11*q.m22-q.m12*
q.m21),a.transform(q.m22*e,-q.m12*e,-q.m21*e,q.m11*e,e*(q.m21*q.dy-q.m22*q.dx),e*(q.m12*q.dx-q.m11*q.dy)))}};
function dk(a,b,c){var d=a.Fb;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.jc&&(fk(a,b,a.jc,!0,!0),a.jc instanceof fe&&a.jc.type===je?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),gk(b,a.jc,!0)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Gb&&(fk(a,b,a.Gb,!0),a.Gb instanceof fe&&a.Gb.type===je?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),gk(b,a.Gb,!0)):b.fillRect(d.x,d.y,d.width,d.height)),a.hl(b,c))}aa.hl=function(){};
function gk(a,b,c){if(c)if(a instanceof CanvasRenderingContext2D&&b instanceof fe&&b.type===je){var d=b.Kx;b=b.Jx;b>d?(a.scale(d/b,1),a.translate((b-d)/2,0),c?a.fill():a.stroke(),a.translate(-(b-d)/2,0),a.scale(1/(d/b),1)):d>b?(a.scale(1,b/d),a.translate(0,(d-b)/2),c?a.fill():a.stroke(),a.translate(0,-(d-b)/2),a.scale(1,1/(b/d))):c?a.fill():a.stroke()}else c?a.fill():a.stroke();else a.stroke()}
function fk(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.Dl!==c&&(b.fillStyle=c,b.Dl=c):b.ln!==c&&(b.strokeStyle=c,b.ln=c);else if(c.type===he)c=c.color,d?b.Dl!==c&&(b.fillStyle=c,b.Dl=c):b.ln!==c&&(b.strokeStyle=c,b.ln=c);else{var k,h=a.Ia,g=h.width,h=h.height;if(e)var l=a.ya,g=l.width,h=l.height;var m=b instanceof CanvasRenderingContext2D;if(m&&(c.Eg&&c.type===Ij||c.Kx===g&&c.Jx===h))k=c.Eg;else{var n,p,q=p=0;e&&(l=a.ya,g=l.width,h=l.height,p=l.x,q=l.y);c.start instanceof C?(a=
c.start.x,e=c.start.y):c.start instanceof K?(a=c.start.x*g,e=c.start.y*h):(a=Vb.x*g,e=Vb.y*h);c.end instanceof C?(l=c.end.x,n=c.end.y):c.end instanceof K?(l=c.end.x*g,n=c.end.y*h):c.type===ie?(l=Xb.x*g,n=Xb.y*h):(l=Vb.x*g,n=Vb.y*h);a+=p;l+=p;e+=q;n+=q;c.type===ie?k=b.createLinearGradient(a,e,l,n):c.type===je?(p=isNaN(c.Lo)?Math.max(g,h)/2:c.Lo,isNaN(c.Ip)?(k=0,p=Math.max(g,h)/2):k=c.Ip,k=b.createRadialGradient(a,e,k,l,n,p)):c.type===Ij?k=b.createPattern(c.pattern,"repeat"):t.Vb(c.type,"Brush type");
if(c.type!==Ij&&(p=c.Fo))for(p=p.k;p.next();)k.addColorStop(p.key,p.value);m&&(c.Eg=k,c.Kx=g,c.Jx=h)}d?b.Dl!==k&&(b.fillStyle=k,b.Dl=k):b.ln!==k&&(b.strokeStyle=k,b.ln=k)}}}X.prototype.isContainedBy=X.prototype.Ti=function(a){if(a instanceof B)a:{if(this!==a&&null!==a)for(var b=this.ga;null!==b;){if(b===a){a=!0;break a}b=b.ga}a=!1}else a=!1;return a};X.prototype.isVisibleObject=X.prototype.ol=function(){if(!this.visible)return!1;var a=this.ga;return null!==a?a.ol():!0};
function ik(a){if(0!==(a.ka&2048)===!0){var b=a.bd;b.reset();if(!a.Fb.Q()||!a.Lc.Q()){jk(a,!1);return}b.translate(a.Fb.x,a.Fb.y);b.translate(-a.Ea.x,-a.Ea.y);var c=a.Ia;Qj(a,b,c.x,c.y,c.width,c.height);jk(a,!1);kk(a,!0)}0!==(a.ka&4096)===!0&&(null===a.ga?(a.Xh.set(a.bd),kk(a,!1)):null!==a.ga.he&&(b=a.Xh,b.reset(),b.multiply(a.ga.Xh),b.multiply(a.bd),kk(a,!1)))}
function Qj(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Vb;a.We&&a.We.rd()&&(h=a.We);var k=t.O();if(a instanceof w&&a.Ub!==a)for(c=a.Ub,d=c.Ia,k.xt(d.x,d.y,d.width,d.height,h),c.Ok.Va(k),k.offset(-c.Ea.x,-c.Ea.y),h=c.ga;null!==h&&h!==a;)h.Ok.Va(k),k.offset(-h.Ea.x,-h.Ea.y),h=h.ga;else k.xt(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);t.B(k)}}
X.prototype.aa=function(a){if(!0!==Ai(this)){Tj(this,!0);Xj(this,!0);var b=this.ga;null!==b?a||b.aa():(a=this.h,null!==a&&(a.Yf.add(this),this instanceof y&&(a.Aa.qb||this.Vg(),null!==this.Tc&&lk(this.Tc)),a.Nf()));if(this instanceof B){var c=null;a=this.za;b=a.length;this.ba===Xh&&(c=mk(this,a,b))&&c.aa(!0);a=a.p;for(c=0;c<b;c++){var d=a[c];!0!==Ai(d)&&(d.Ca.Q()||(d instanceof Vg||d instanceof B||d instanceof va||Sj(d)!==Wg)&&d.aa(!0))}}}};
function nk(a){if(!1===Ai(a)&&(Tj(a,!0),Xj(a,!0),a instanceof B)){a=a.za.p;for(var b=a.length,c=0;c<b;c++)nk(a[c])}}function lk(a){if(!1===Bi(a)){if(null!==a.ga)a.ga.aa();else{var b=a.h;null!==b&&(b.Yf.add(a),a instanceof y&&a.Vg(),b.Nf())}Xj(a,!0)}}function Uj(a){if(0!==(a.ka&2048)===!1&&(jk(a,!0),kk(a,!0),a instanceof B))for(a=a.elements;a.next();)ok(a.value)}function ok(a){kk(a,!0);if(a instanceof B)for(a=a.elements;a.next();)ok(a.value)}
X.prototype.pa=function(){if(this instanceof w){var a=this.h;null!==a&&!Bi(this)&&!Ci(this)&&this.zb()&&this.Fb.Q()&&a.pa(Lh(this,this.Fb))}else null!==this.U&&this.U.pa()};function Sj(a){var b=a.Rh,c=a.ga;if(c&&c.ba===ea)return pk(a,c.ne(a.gc),c.me(a.column));if(c&&c.ba===Xh&&c.gw()===a)return Nc;if(b===Xg){if(c){c.ba===Ug&&null===c.qo&&(b=c.za,mk(c,b,b.length));if(c.qo===a)return Nc;a=c.Qz;return a===Xg?Wg:a}return Wg}return b}
function pk(a,b,c){var d=a.Rh;if(d!==Xg)return d;var e=d=void 0;switch(b.Rh){case Jj:e=!0;break;case Nc:e=!0}switch(c.Rh){case Kj:d=!0;break;case Nc:d=!0}a=a.ga.Qz;d=void 0!==d||a!==Kj&&a!==Nc?!1:!0;e=void 0!==e||a!==Jj&&a!==Nc?!1:!0;return!0===d&&!0===e?Nc:!0===d?Kj:!0===e?Jj:Wg}t.g(X,"segmentOrientation",X.prototype.ut);
t.defineProperty(X,{ut:"segmentOrientation"},function(){return this.Qr},function(a){var b=this.Qr;b!==a&&(f&&t.tb(a,A,X,"segmentOrientation"),this.Qr=a,this.aa(),this.i("segmentOrientation",b,a))});t.g(X,"segmentIndex",X.prototype.tf);t.defineProperty(X,{tf:"segmentIndex"},function(){return this.Nr},function(a){f&&t.j(a,"number",X,"segmentIndex");a=Math.round(a);var b=this.Nr;b!==a&&(this.Nr=a,this.aa(),this.i("segmentIndex",b,a))});t.g(X,"segmentFraction",X.prototype.tt);
t.defineProperty(X,{tt:"segmentFraction"},function(){return this.Mr},function(a){f&&t.j(a,"number",X,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.Mr;b!==a&&(this.Mr=a,this.aa(),this.i("segmentFraction",b,a))});t.g(X,"segmentOffset",X.prototype.VA);t.defineProperty(X,{VA:"segmentOffset"},function(){return this.Pr},function(a){var b=this.Pr;b.N(a)||(f&&t.m(a,C,X,"segmentOffset"),this.Pr=a=a.Z(),this.aa(),this.i("segmentOffset",b,a))});t.g(X,"stretch",X.prototype.Rh);
t.defineProperty(X,{Rh:"stretch"},function(){return this.zh},function(a){var b=this.zh;b!==a&&(f&&t.tb(a,X,X,"stretch"),this.zh=a,this.aa(),this.i("stretch",b,a))});t.g(X,"name",X.prototype.name);t.defineProperty(X,{name:"name"},function(){return this.Rb},function(a){var b=this.Rb;b!==a&&(f&&t.j(a,"string",X,"name"),this.Rb=a,this.U&&(this.U.Bj=null),this.i("name",b,a))});t.g(X,"visible",X.prototype.visible);
t.defineProperty(X,{visible:"visible"},function(){return 0!==(this.ka&1)},function(a){var b=0!==(this.ka&1);b!==a&&(f&&t.j(a,"boolean",X,"visible"),this.ka^=1,this.i("visible",b,a),b=this.ga,null!==b?b.aa():this instanceof w&&(this.aa(),Yj(this),a?(this.K(Mh),this.updateAdornments()):(this.K(Nh),this.Ae())),this.pa(),qk(this))});t.g(X,"pickable",X.prototype.Ze);
t.defineProperty(X,{Ze:"pickable"},function(){return 0!==(this.ka&2)},function(a){var b=0!==(this.ka&2);b!==a&&(f&&t.j(a,"boolean",X,"pickable"),this.ka^=2,this.i("pickable",b,a))});t.g(X,"fromLinkableDuplicates",X.prototype.bE);t.defineProperty(X,{bE:"fromLinkableDuplicates"},function(){return 0!==(this.ka&4)},function(a){var b=0!==(this.ka&4);b!==a&&(f&&t.j(a,"boolean",X,"fromLinkableDuplicates"),this.ka^=4,this.i("fromLinkableDuplicates",b,a))});t.g(X,"fromLinkableSelfNode",X.prototype.cE);
t.defineProperty(X,{cE:"fromLinkableSelfNode"},function(){return 0!==(this.ka&8)},function(a){var b=0!==(this.ka&8);b!==a&&(f&&t.j(a,"boolean",X,"fromLinkableSelfNode"),this.ka^=8,this.i("fromLinkableSelfNode",b,a))});t.g(X,"toLinkableDuplicates",X.prototype.LF);t.defineProperty(X,{LF:"toLinkableDuplicates"},function(){return 0!==(this.ka&16)},function(a){var b=0!==(this.ka&16);b!==a&&(f&&t.j(a,"boolean",X,"toLinkableDuplicates"),this.ka^=16,this.i("toLinkableDuplicates",b,a))});
t.g(X,"toLinkableSelfNode",X.prototype.MF);t.defineProperty(X,{MF:"toLinkableSelfNode"},function(){return 0!==(this.ka&32)},function(a){var b=0!==(this.ka&32);b!==a&&(f&&t.j(a,"boolean",X,"toLinkableSelfNode"),this.ka^=32,this.i("toLinkableSelfNode",b,a))});t.g(X,"isPanelMain",X.prototype.Jh);t.defineProperty(X,{Jh:"isPanelMain"},function(){return 0!==(this.ka&64)},function(a){var b=0!==(this.ka&64);b!==a&&(f&&t.j(a,"boolean",X,"isPanelMain"),this.ka^=64,this.aa(),this.i("isPanelMain",b,a))});
t.g(X,"isActionable",X.prototype.Rs);t.defineProperty(X,{Rs:"isActionable"},function(){return 0!==(this.ka&128)},function(a){var b=0!==(this.ka&128);b!==a&&(f&&t.j(a,"boolean",X,"isActionable"),this.ka^=128,this.i("isActionable",b,a))});t.g(X,"areaBackground",X.prototype.Ci);
t.defineProperty(X,{Ci:"areaBackground"},function(){return this.jc},function(a){var b=this.jc;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.jc=a,this.pa(),this.i("areaBackground",b,a))});t.g(X,"background",X.prototype.background);
t.defineProperty(X,{background:"background"},function(){return this.Gb},function(a){var b=this.Gb;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.Gb=a,this.pa(),this.i("background",b,a))});function hk(a,b){a.ka=b?a.ka|512:a.ka&-513}function rk(a,b){a.ka=b?a.ka|1024:a.ka&-1025}function jk(a,b){a.ka=b?a.ka|2048:a.ka&-2049}function kk(a,b){a.ka=b?a.ka|4096:a.ka&-4097}function Ai(a){return 0!==(a.ka&8192)}function Tj(a,b){a.ka=b?a.ka|8192:a.ka&-8193}
function Bi(a){return 0!==(a.ka&16384)}function Xj(a,b){a.ka=b?a.ka|16384:a.ka&-16385}t.A(X,{U:"part"},function(){if(this instanceof w)return this;if(this.fm)return this.fm;var a;for(a=this.ga;a;){if(a instanceof w)return this.fm=a;a=a.ga}return null});X.prototype.ul=function(a){this.si=a};t.A(X,{ga:"panel"},function(){return this.si});t.A(X,{layer:"layer"},function(){var a=this.U;return null!==a?a.layer:null});t.A(X,{h:"diagram"},function(){var a=this.U;return null!==a?a.h:null},{configurable:!0});
t.g(X,"position",X.prototype.position);t.defineProperty(X,{position:"position"},function(){return this.rb},function(a){var b=this.rb;if(!b.N(a)){f&&t.m(a,C,X,"position");a=a.Z();if(this instanceof w){if(this instanceof A||!a.Q())return;var c=this.ki;this.rb=a;if(!1===Bi(this)){var d=c.copy();c.q(d.x+(a.x-b.x),d.y+(a.y-b.y));sk(this);Uj(this);tk(this);c.N(d)||this.i("location",d,c)}else c.q(NaN,NaN)}else this.rb=a,lk(this),Uj(this);this.i("position",b,a)}});t.A(X,{ya:"actualBounds"},function(){return this.Fb});
t.g(X,"scale",X.prototype.scale);t.defineProperty(X,{scale:"scale"},function(){return this.Sb},function(a){var b=this.Sb;b!==a&&(f&&t.o(a,X,"scale"),0>=a&&t.l("GraphObject.scale must be greater than zero"),this.Sb=a,Uj(this),this.aa(),this.i("scale",b,a))});t.g(X,"angle",X.prototype.angle);t.defineProperty(X,{angle:"angle"},function(){return this.on},function(a){var b=this.on;b!==a&&(f&&t.o(a,X,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.on=a,this.aa(),Uj(this),this.i("angle",b,a)))});
t.g(X,"desiredSize",X.prototype.Ca);t.defineProperty(X,{Ca:"desiredSize"},function(){return this.df},function(a){var b=this.df;b.N(a)||(f&&t.m(a,pa,X,"desiredSize"),this.df=a=a.Z(),this.aa(),this instanceof Y&&this.Jf(),this.i("desiredSize",b,a),a=this.U,null!==a&&0!==(this.ka&1024)&&(Oj(this,a,"width"),Oj(this,a,"height")))});t.g(X,"width",X.prototype.width);
t.defineProperty(X,{width:"width"},function(){return this.df.width},function(a){if(this.df.width!==a){f&&t.j(a,"number",X,"width");var b=this.df;this.df=a=(new pa(a,this.df.height)).freeze();this.aa();this instanceof Y&&this.Jf();this.i("desiredSize",b,a);b=this.U;null!==b&&0!==(this.ka&1024)&&Oj(this,b,"width")}});t.g(X,"height",X.prototype.height);
t.defineProperty(X,{height:"height"},function(){return this.df.height},function(a){if(this.df.height!==a){f&&t.j(a,"number",X,"height");var b=this.df;this.df=a=(new pa(this.df.width,a)).freeze();this.aa();this instanceof Y&&this.Jf();this.i("desiredSize",b,a);b=this.U;null!==b&&0!==(this.ka&1024)&&Oj(this,b,"height")}});t.g(X,"minSize",X.prototype.Ye);
t.defineProperty(X,{Ye:"minSize"},function(){return this.de},function(a){var b=this.de;b.N(a)||(f&&t.m(a,pa,X,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.de=a,this.aa(),this.i("minSize",b,a))});t.g(X,"maxSize",X.prototype.He);
t.defineProperty(X,{He:"maxSize"},function(){return this.Aj},function(a){var b=this.Aj;b.N(a)||(f&&t.m(a,pa,X,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Aj=a,this.aa(),this.i("maxSize",b,a))});t.A(X,{Ea:"measuredBounds"},function(){return this.Lc});t.A(X,{Ia:"naturalBounds"},function(){return this.Mc},{configurable:!0});t.g(X,"margin",X.prototype.margin);
t.defineProperty(X,{margin:"margin"},function(){return this.er},function(a){"number"===typeof a?a=new sb(a):f&&t.m(a,sb,X,"margin");var b=this.er;b.N(a)||(this.er=a=a.Z(),this.aa(),this.i("margin",b,a))});t.A(X,{transform:null},function(){0!==(this.ka&2048)===!0&&ik(this);return this.bd});t.A(X,{he:null},function(){0!==(this.ka&4096)===!0&&ik(this);return this.Xh});t.g(X,"alignment",X.prototype.alignment);
t.defineProperty(X,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.N(a)||(f?t.m(a,K,X,"alignment"):a.qd()&&!a.Gc()&&t.l("alignment must be a real Spot or Spot.Default"),this.re=a=a.Z(),lk(this),this.i("alignment",b,a))});t.g(X,"column",X.prototype.column);t.defineProperty(X,{column:"column"},function(){return this.gq},function(a){f&&t.o(a,X,"column");a=Math.round(a);var b=this.gq;b!==a&&(0>a&&t.ha(a,">= 0",X,"column"),this.gq=a,this.aa(),this.i("column",b,a))});
t.g(X,"columnSpan",X.prototype.tD);t.defineProperty(X,{tD:"columnSpan"},function(){return this.hj},function(a){f&&t.o(a,X,"columnSpan");a=Math.round(a);var b=this.hj;b!==a&&(1>a&&t.ha(a,">= 1",X,"columnSpan"),this.hj=a,this.aa(),this.i("columnSpan",b,a))});t.g(X,"row",X.prototype.gc);t.defineProperty(X,{gc:"row"},function(){return this.Kr},function(a){f&&t.o(a,X,"row");a=Math.round(a);var b=this.Kr;b!==a&&(0>a&&t.ha(a,">= 0",X,"row"),this.Kr=a,this.aa(),this.i("row",b,a))});t.g(X,"rowSpan",X.prototype.rowSpan);
t.defineProperty(X,{rowSpan:"rowSpan"},function(){return this.Hj},function(a){f&&t.o(a,X,"rowSpan");a=Math.round(a);var b=this.Hj;b!==a&&(1>a&&t.ha(a,">= 1",X,"rowSpan"),this.Hj=a,this.aa(),this.i("rowSpan",b,a))});t.g(X,"alignmentFocus",X.prototype.Rj);
t.defineProperty(X,{Rj:"alignmentFocus"},function(){return this.$p},function(a){var b=this.$p;b.N(a)||(f?t.m(a,K,X,"alignmentFocus"):a.qd()&&!a.Gc()&&t.l("alignmentFocus must be a real Spot or Spot.Default"),this.$p=a=a.Z(),this.aa(),this.i("alignmentFocus",b,a))});t.g(X,"portId",X.prototype.sd);
t.defineProperty(X,{sd:"portId"},function(){return this.zr},function(a){var b=this.zr;if(b!==a){f&&null!==a&&t.j(a,"string",X,"portId");var c=this.U;null===c||c instanceof y||(t.l("portID being set on a Link: "+a),c=null);null!==b&&c&&uk(c,this);this.zr=a;if(null!==a&&c){c.qj=!0;null===c.yd&&vk(c);var d=this.sd;null!==d&&c.yd.add(d,this)}this.i("portId",b,a)}});function wk(a){var b={value:null};xk(a,b);return b.value}
function xk(a,b){var c=a.ga;return null===c||!xk(c,b)&&a.visible?(b.value=a,!1):!0}function qk(a){var b=a.U;b instanceof y&&(a=a.h)&&!a.Aa.qb&&b.Vg()}t.g(X,"toSpot",X.prototype.mb);t.defineProperty(X,{mb:"toSpot"},function(){return null!==this.V?this.V.Qj:Pb},function(a){null===this.V&&this.Ge();var b=this.V.Qj;b.N(a)||(f&&t.m(a,K,X,"toSpot"),a=a.Z(),this.V.Qj=a,this.i("toSpot",b,a),qk(this))});t.g(X,"toEndSegmentLength",X.prototype.mk);
t.defineProperty(X,{mk:"toEndSegmentLength"},function(){return null!==this.V?this.V.Oj:10},function(a){null===this.V&&this.Ge();var b=this.V.Oj;b!==a&&(f&&t.j(a,"number",X,"toEndSegmentLength"),0>a&&t.ha(a,">= 0",X,"toEndSegmentLength"),this.V.Oj=a,this.i("toEndSegmentLength",b,a),qk(this))});t.g(X,"toEndSegmentDirection",X.prototype.Kp);
t.defineProperty(X,{Kp:"toEndSegmentDirection"},function(){return null!==this.V?this.V.Nj:Mj},function(a){null===this.V&&this.Ge();var b=this.V.Nj;b!==a&&(f&&t.tb(a,y,X,"toEndSegmentDirection"),this.V.Nj=a,this.i("toEndSegmentDirection",b,a),qk(this))});t.g(X,"toShortLength",X.prototype.Lp);
t.defineProperty(X,{Lp:"toShortLength"},function(){return null!==this.V?this.V.Pj:0},function(a){null===this.V&&this.Ge();var b=this.V.Pj;b!==a&&(f&&t.j(a,"number",X,"toShortLength"),this.V.Pj=a,this.i("toShortLength",b,a),qk(this))});t.g(X,"toLinkable",X.prototype.kB);t.defineProperty(X,{kB:"toLinkable"},function(){return this.fs},function(a){var b=this.fs;b!==a&&(f&&null!==a&&t.j(a,"boolean",X,"toLinkable"),this.fs=a,this.i("toLinkable",b,a))});t.g(X,"toMaxLinks",X.prototype.NF);
t.defineProperty(X,{NF:"toMaxLinks"},function(){return this.gs},function(a){var b=this.gs;b!==a&&(f&&t.o(a,X,"toMaxLinks"),0>a&&t.ha(a,">= 0",X,"toMaxLinks"),this.gs=a,this.i("toMaxLinks",b,a))});t.g(X,"fromSpot",X.prototype.lb);t.defineProperty(X,{lb:"fromSpot"},function(){return null!==this.V?this.V.oj:Pb},function(a){null===this.V&&this.Ge();var b=this.V.oj;b.N(a)||(f&&t.m(a,K,X,"fromSpot"),a=a.Z(),this.V.oj=a,this.i("fromSpot",b,a),qk(this))});t.g(X,"fromEndSegmentLength",X.prototype.ek);
t.defineProperty(X,{ek:"fromEndSegmentLength"},function(){return null!==this.V?this.V.mj:10},function(a){null===this.V&&this.Ge();var b=this.V.mj;b!==a&&(f&&t.j(a,"number",X,"fromEndSegmentLength"),0>a&&t.ha(a,">= 0",X,"fromEndSegmentLength"),this.V.mj=a,this.i("fromEndSegmentLength",b,a),qk(this))});t.g(X,"fromEndSegmentDirection",X.prototype.Ro);
t.defineProperty(X,{Ro:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.lj:Mj},function(a){null===this.V&&this.Ge();var b=this.V.lj;b!==a&&(f&&t.tb(a,y,X,"fromEndSegmentDirection"),this.V.lj=a,this.i("fromEndSegmentDirection",b,a),qk(this))});t.g(X,"fromShortLength",X.prototype.So);
t.defineProperty(X,{So:"fromShortLength"},function(){return null!==this.V?this.V.nj:0},function(a){null===this.V&&this.Ge();var b=this.V.nj;b!==a&&(f&&t.j(a,"number",X,"fromShortLength"),this.V.nj=a,this.i("fromShortLength",b,a),qk(this))});t.g(X,"fromLinkable",X.prototype.$z);t.defineProperty(X,{$z:"fromLinkable"},function(){return this.Bq},function(a){var b=this.Bq;b!==a&&(f&&null!==a&&t.j(a,"boolean",X,"fromLinkable"),this.Bq=a,this.i("fromLinkable",b,a))});t.g(X,"fromMaxLinks",X.prototype.dE);
t.defineProperty(X,{dE:"fromMaxLinks"},function(){return this.Cq},function(a){var b=this.Cq;b!==a&&(f&&t.o(a,X,"fromMaxLinks"),0>a&&t.ha(a,">= 0",X,"fromMaxLinks"),this.Cq=a,this.i("fromMaxLinks",b,a))});t.g(X,"cursor",X.prototype.cursor);t.defineProperty(X,{cursor:"cursor"},function(){return this.nq},function(a){var b=this.nq;b!==a&&(t.j(a,"string",X,"cursor"),this.nq=a,this.i("cursor",b,a))});t.g(X,"click",X.prototype.click);
t.defineProperty(X,{click:"click"},function(){return null!==this.R?this.R.Zh:null},function(a){null===this.R&&Lj(this);var b=this.R.Zh;b!==a&&(null!==a&&t.j(a,"function",X,"click"),this.R.Zh=a,this.i("click",b,a))});t.g(X,"doubleClick",X.prototype.Jm);t.defineProperty(X,{Jm:"doubleClick"},function(){return null!==this.R?this.R.ei:null},function(a){null===this.R&&Lj(this);var b=this.R.ei;b!==a&&(null!==a&&t.j(a,"function",X,"doubleClick"),this.R.ei=a,this.i("doubleClick",b,a))});
t.g(X,"contextClick",X.prototype.Bs);t.defineProperty(X,{Bs:"contextClick"},function(){return null!==this.R?this.R.ai:null},function(a){null===this.R&&Lj(this);var b=this.R.ai;b!==a&&(null!==a&&t.j(a,"function",X,"contextClick"),this.R.ai=a,this.i("contextClick",b,a))});t.g(X,"mouseEnter",X.prototype.vA);
t.defineProperty(X,{vA:"mouseEnter"},function(){return null!==this.R?this.R.pr:null},function(a){null===this.R&&Lj(this);var b=this.R.pr;b!==a&&(null!==a&&t.j(a,"function",X,"mouseEnter"),this.R.pr=a,this.i("mouseEnter",b,a))});t.g(X,"mouseLeave",X.prototype.wA);t.defineProperty(X,{wA:"mouseLeave"},function(){return null!==this.R?this.R.qr:null},function(a){null===this.R&&Lj(this);var b=this.R.qr;b!==a&&(null!==a&&t.j(a,"function",X,"mouseLeave"),this.R.qr=a,this.i("mouseLeave",b,a))});
t.g(X,"mouseOver",X.prototype.et);t.defineProperty(X,{et:"mouseOver"},function(){return null!==this.R?this.R.oi:null},function(a){null===this.R&&Lj(this);var b=this.R.oi;b!==a&&(null!==a&&t.j(a,"function",X,"mouseOver"),this.R.oi=a,this.i("mouseOver",b,a))});t.g(X,"mouseHover",X.prototype.dt);
t.defineProperty(X,{dt:"mouseHover"},function(){return null!==this.R?this.R.ni:null},function(a){null===this.R&&Lj(this);var b=this.R.ni;b!==a&&(null!==a&&t.j(a,"function",X,"mouseHover"),this.R.ni=a,this.i("mouseHover",b,a))});t.g(X,"mouseHold",X.prototype.ct);t.defineProperty(X,{ct:"mouseHold"},function(){return null!==this.R?this.R.mi:null},function(a){null===this.R&&Lj(this);var b=this.R.mi;b!==a&&(null!==a&&t.j(a,"function",X,"mouseHold"),this.R.mi=a,this.i("mouseHold",b,a))});
t.g(X,"mouseDragEnter",X.prototype.UE);t.defineProperty(X,{UE:"mouseDragEnter"},function(){return null!==this.R?this.R.nr:null},function(a){null===this.R&&Lj(this);var b=this.R.nr;b!==a&&(null!==a&&t.j(a,"function",X,"mouseDragEnter"),this.R.nr=a,this.i("mouseDragEnter",b,a))});t.g(X,"mouseDragLeave",X.prototype.uA);
t.defineProperty(X,{uA:"mouseDragLeave"},function(){return null!==this.R?this.R.or:null},function(a){null===this.R&&Lj(this);var b=this.R.or;b!==a&&(null!==a&&t.j(a,"function",X,"mouseDragLeave"),this.R.or=a,this.i("mouseDragLeave",b,a))});t.g(X,"mouseDrop",X.prototype.bt);t.defineProperty(X,{bt:"mouseDrop"},function(){return null!==this.R?this.R.li:null},function(a){null===this.R&&Lj(this);var b=this.R.li;b!==a&&(null!==a&&t.j(a,"function",X,"mouseDrop"),this.R.li=a,this.i("mouseDrop",b,a))});
t.g(X,"actionDown",X.prototype.wz);t.defineProperty(X,{wz:"actionDown"},function(){return null!==this.R?this.R.Vp:null},function(a){null===this.R&&Lj(this);var b=this.R.Vp;b!==a&&(null!==a&&t.j(a,"function",X,"actionDown"),this.R.Vp=a,this.i("actionDown",b,a))});t.g(X,"actionUp",X.prototype.yz);
t.defineProperty(X,{yz:"actionUp"},function(){return null!==this.R?this.R.Xp:null},function(a){null===this.R&&Lj(this);var b=this.R.Xp;b!==a&&(null!==a&&t.j(a,"function",X,"actionUp"),this.R.Xp=a,this.i("actionUp",b,a))});t.g(X,"actionMove",X.prototype.xz);t.defineProperty(X,{xz:"actionMove"},function(){return null!==this.R?this.R.Wp:null},function(a){null===this.R&&Lj(this);var b=this.R.Wp;b!==a&&(null!==a&&t.j(a,"function",X,"actionMove"),this.R.Wp=a,this.i("actionMove",b,a))});
t.g(X,"actionCancel",X.prototype.vz);t.defineProperty(X,{vz:"actionCancel"},function(){return null!==this.R?this.R.Up:null},function(a){null===this.R&&Lj(this);var b=this.R.Up;b!==a&&(null!==a&&t.j(a,"function",X,"actionCancel"),this.R.Up=a,this.i("actionCancel",b,a))});t.g(X,"toolTip",X.prototype.Et);
t.defineProperty(X,{Et:"toolTip"},function(){return null!==this.R?this.R.yi:null},function(a){null===this.R&&Lj(this);var b=this.R.yi;b!==a&&(null!==a&&t.m(a,Ve,X,"toolTip"),this.R.yi=a,this.i("toolTip",b,a))});t.g(X,"contextMenu",X.prototype.contextMenu);t.defineProperty(X,{contextMenu:"contextMenu"},function(){return null!==this.R?this.R.bi:null},function(a){null===this.R&&Lj(this);var b=this.R.bi;b!==a&&(null!==a&&t.m(a,Ve,X,"contextMenu"),this.R.bi=a,this.i("contextMenu",b,a))});
X.prototype.bind=X.prototype.bind=function(a){a.eg=this;var b=this.Qo();null!==b&&yk(b)&&t.l("Cannot add a Binding to a template that has already been copied: "+a);null===this.Bc&&(this.Bc=new H(De));this.Bc.add(a)};X.prototype.findTemplateBinder=X.prototype.Qo=function(){for(var a=this instanceof B?this:this.ga;null!==a;){if(null!==a.Fl&&a instanceof B)return a;a=a.ga}return null};X.fromSvg=function(a){return zk(a)};X.prototype.setProperties=function(a){t.Nw(this,a)};var Ak;
X.make=Ak=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=Bk.Ba(a);"function"===typeof g?(c=Array.prototype.slice.call(arguments),d=g(c)):e=ba[a]}null===d&&(void 0===e&&(d=window.$,void 0!==d&&void 0!==d.noop&&t.l("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),t.l("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==e&&e.constructor||t.l("GraphObject.make requires a class function or class name, not: "+
a),d=new e);g=1;d instanceof u&&1<c.length&&(e=c[1],"string"===typeof e||e instanceof HTMLDivElement)&&(d.Mi=null,Vh(d,e),g++);for(;g<c.length;g++)e=c[g],void 0===e?t.l("Undefined value at argument "+g+" for object being constructed by GraphObject.make: "+d):Ck(d,e);return d};
function Ck(a,b){if("string"===typeof b){var c=a;if(c instanceof va)c.text=b;else if(c instanceof Y)c.Ib=b;else if(c instanceof Dk)c.source=b;else if(c instanceof B){var d=t.Km(B,b);null!==d?c.type=d:t.l("Unknown Panel type as an argument to GraphObject.make: "+b)}else c instanceof fe?(d=t.Km(fe,b),null!==d?c.type=d:t.l("Unknown Brush type as an argument to GraphObject.make: "+b)):c instanceof M?(d=t.Km(M,b),null!==d?c.type=d:t.l("Unknown Geometry type as an argument to GraphObject.make: "+b)):c instanceof
S?(d=t.Km(S,b),null!==d?c.type=d:t.l("Unknown PathSegment type as an argument to GraphObject.make: "+b)):t.l("Unable to use a string as an argument to GraphObject.make: "+b)}else if(b instanceof X)a instanceof B||t.l("A GraphObject can only be added to a Panel, not to: "+a),a.add(b);else if(b instanceof Ek)a instanceof B||t.l("A RowColumnDefinition can only be added to a Panel, not to: "+a),c=b.Kh?a.ne(b.index):a.me(b.index),t.m(b,Ek,Ek,"copyFrom:pd"),b.Kh?c.height=b.height:c.width=b.width,c.Nh=b.Nh,
c.qf=b.qf,c.alignment=b.alignment,c.yt=b.yt,c.Kj=null===b.Kj?null:b.Kj.Z(),c.bn=b.bn,c.cn=b.cn,c.vh=null,b.vh&&(c.vh=b.vh.slice(0)),c.background=b.background,c.Xv=b.Xv,c.Bc=b.Bc;else if(b instanceof oa)c=a,c instanceof A&&b.Pe===A?2===(b.value&2)?c.st=b:b===Qg||b===Hg||b===Gg?c.Ee=b:b===Fk||b===Gk||b===Hk?c.wo=b:b!==Ik&&b!==Ig&&t.l("Unknown Link enum value for a Link property: "+b):c instanceof B&&b.Pe===B?c.type=b:c instanceof va&&b.Pe===va?c.qB=b:c instanceof X&&b.Pe===A?0===b.name.indexOf("Orient")?
c.ut=b:t.l("Unknown Link enum value for GraphObject.segmentOrientation property: "+b):c instanceof X&&b.Pe===X?c.Rh=b:c instanceof u&&b.Pe===u?c.zm=b:c instanceof fe&&b.Pe===fe?c.type=b:c instanceof M&&b.Pe===M?c.type=b:c instanceof S&&b.Pe===S?c.type=b:c instanceof De&&b.Pe===De?c.mode=b:c instanceof Ad&&b.Pe===Ad?c.od=b:c instanceof Z&&b.Pe===Z?0===b.name.indexOf("Alignment")?c.alignment=b:0===b.name.indexOf("Arrangement")?c.Oe=b:0===b.name.indexOf("Compaction")?c.compaction=b:0===b.name.indexOf("Path")?
c.path=b:0===b.name.indexOf("Sorting")?c.sorting=b:0===b.name.indexOf("Style")?c.WF=b:t.l("Unknown enum value: "+b):c instanceof Jk&&b.Pe===Jk?0===b.name.indexOf("Aggressive")?c.eD=b:0===b.name.indexOf("Cycle")?c.BD=b:0===b.name.indexOf("Init")?c.vE=b:0===b.name.indexOf("Layer")?c.FE=b:t.l("Unknown enum value: "+b):c instanceof Fj&&b.Pe===Fj?b===Kk||b===Lk||b===Mk||b===Nk?c.sorting=b:b===Ok||b===Pk?c.Oe=b:b===Qk||b===Rk?c.alignment=b:t.l("Unknown enum value: "+b):c instanceof Sk&&b.Pe===Sk?b===Tk||
b===Uk||b===Vk||b===Wk||b===Xk?c.sorting=b:b===Yk||b===Zk||b===$k||b===al?c.direction=b:b===bl||b===cl||b===dl||b===el?c.Oe=b:b===fl||b===gl?c.ht=b:t.l("Unknown enum value: "+b):t.l("No property to set for this enum value: "+b);else if(b instanceof De)if(a instanceof X||a instanceof Ek){var d=b.Ct,e=d.indexOf(".");0<e&&a instanceof B&&(c=d.substr(e+1),d=a.le(d.substring(0,e)),null!==d&&(a=d,b.Ct=c));a.bind(b)}else t.l("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+
a);else if(b instanceof Mc)a instanceof M?a.ub.add(b):t.l("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof S)a instanceof Mc?a.Ga.add(b):t.l("A PathSegment can only be added to a PathFigure, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)Ck(a,b[c]);else if("object"===typeof b&&null!==b)if(c=a,c instanceof fe){d={};for(e in b){var g=parseFloat(e);isNaN(g)?d[e]=b[e]:c.addColorStop(g,b[e])}t.Nw(c,d)}else c instanceof Ek?(void 0!==b.row?(d=b.row,(void 0===
d||null===d||Infinity===d||isNaN(d)||0>d)&&t.l("Must specify non-negative integer row for RowColumnDefinition "+b),c.Sl=!0,c.te=d):void 0!==b.column?(d=b.column,(void 0===d||null===d||Infinity===d||isNaN(d)||0>d)&&t.l("Must specify non-negative integer column for RowColumnDefinition "+b),c.Sl=!1,c.te=d):t.l("Must specify row or column value in a RowColumnDefinition "+b),d=t.qH(b,"row","column"),t.Nw(c,d)):t.Nw(c,b);else t.l('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+
a)}var Bk;X.Builders=Bk=new sa("string","function");
Bk.add("Button",function(){var a=new fe(ie);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new fe(ie);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");var c=Ak(B,Xh,{Rs:!0},Ak(Y,{name:"ButtonBorder",Ib:"RoundedRectangle",fill:a,stroke:"gray"}));c.vA=function(a,c){var g=c.qa(0),h=c._buttonFillOver;void 0===h&&(h=b);c._buttonFillNormal=g.fill;g.fill=h;h=c._buttonStrokeOver;void 0===h&&(h="blue");c._buttonStrokeNormal=g.stroke;g.stroke=h};c.wA=function(b,c){var g=c.qa(0),h=c._buttonFillNormal;
void 0===h&&(h=a);g.fill=h;h=c._buttonStrokeNormal;void 0===h&&(h="gray");g.stroke=h};return c});
Bk.add("TreeExpanderButton",function(){var a=Ak("Button",Ak(Y,{name:"ButtonIcon",Ib:"MinusLine",Ca:J.Rp},(new De("figure","isTreeExpanded",function(a,c){var d=null,e=c.ga;e&&(d=a?e._treeExpandedFigure:e._treeCollapsedFigure);d||(d=a?"MinusLine":"PlusLine");return d})).DA("")),{visible:!1},(new De("visible","isTreeLeaf",function(a){return!a})).DA(""));a.click=function(a,c){var d=c.U;d instanceof Ve&&(d=d.Dh);if(d instanceof y){var e=d.h;if(null!==e){e=e.lg;if(d.Hc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
a.Fe=!0;d.Hc?e.collapseTree(d):e.expandTree(d)}}};return a});
Bk.add("SubGraphExpanderButton",function(){var a=Ak("Button",Ak(Y,{name:"ButtonIcon",Ib:"MinusLine",Ca:J.Rp},(new De("figure","isSubGraphExpanded",function(a,c){var d=null,e=c.ga;e&&(d=a?e._subGraphExpandedFigure:e._subGraphCollapsedFigure);d||(d=a?"MinusLine":"PlusLine");return d})).DA("")));a.click=function(a,c){var d=c.U;d instanceof Ve&&(d=d.Dh);if(d instanceof z){var e=d.h;if(null!==e){e=e.lg;if(d.Ve){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Fe=!0;d.Ve?e.collapseSubGraph(d):
e.expandSubGraph(d)}}};return a});Bk.add("ContextMenuButton",function(){var a=Ak("Button");a.Rh=Kj;var b=a.le("ButtonBorder");b instanceof Y&&(b.Ib="Rectangle",b.G=new K(0,0,2,2),b.H=new K(1,1,-2,-2));return a});
function B(a){X.call(this);void 0===a?0===arguments.length?this.ba=ah:t.l("invalid argument to Panel constructor: undefined"):(t.tb(a,B,B,"type"),this.ba=a);this.za=new H(X);this.Le=J.Tp;this.Ig=!1;this.ba===bi&&(this.Ig=!0);this.Df=1;this.qq=Qb;this.kc=Xg;this.ba===ea&&hl(this);this.so=Yg;this.Gq=(new pa(10,10)).freeze();this.Hq=J.ok;this.Fl=this.Kl=null;this.By="";this.Jg=this.tj=null;this.Sn="category";this.Zf=null;this.Ai=new D(NaN,NaN,NaN,NaN);this.qo=null;this.qj=!1}t.ia("Panel",B);t.Fh(B);
t.Oa(B,X);function hl(a){a.ij=J.Tp;a.lh=1;a.di=null;a.Ml=null;a.kh=1;a.jh=null;a.Ll=null;a.$c=[];a.Wc=[];a.km=il;a.Gl=il;a.zi=0;a.ji=0}
B.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.ba=this.ba;a.Le=this.Le.Z();a.Ig=this.Ig;a.Df=this.Df;a.qq=this.qq.Z();a.kc=this.kc;if(a.ba===ea){a.ij=this.ij.Z();a.lh=this.lh;a.di=this.di;a.Ml=this.Ml;a.kh=this.kh;a.jh=this.jh;a.Ll=this.Ll;var b=[];if(0<this.$c.length)for(var c=this.$c,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var g=c[e].copy();g.ul(a);b[e]=g}a.$c=b;b=[];if(0<this.Wc.length)for(c=this.Wc,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(g=c[e].copy(),g.ul(a),
b[e]=g);a.Wc=b;a.km=this.km;a.Gl=this.Gl;a.zi=this.zi;a.ji=this.ji}a.so=this.so;a.Gq.assign(this.Gq);a.Hq=this.Hq.Z();a.Kl=this.Kl;a.Fl=this.Fl;a.By=this.By;a.tj=this.tj;a.Jg=this.Jg;a.Sn=this.Sn;a.Ai.assign(this.Ai);a.qj=this.qj;this.fv&&(a.fv=this.fv);this._buttonFillNormal&&(a._buttonFillNormal=this._buttonFillNormal);this._buttonFillOver&&(a._buttonFillOver=this._buttonFillOver);this._buttonStrokeNormal&&(a._buttonStrokeNormal=this._buttonStrokeNormal);this._buttonStrokeOver&&(a._buttonStrokeOver=
this._buttonStrokeOver);this._treeExpandedFigure&&(a._treeExpandedFigure=this._treeExpandedFigure);this._treeCollapsedFigure&&(a._treeCollapsedFigure=this._treeCollapsedFigure);this._subGraphExpandedFigure&&(a._subGraphExpandedFigure=this._subGraphExpandedFigure);this._subGraphCollapsedFigure&&(a._subGraphCollapsedFigure=this._subGraphCollapsedFigure)};B.prototype.Gh=function(a){X.prototype.Gh.call(this,a);a.za=this.za;for(var b=a.za.k;b.next();)b.value.si=a};
B.prototype.copy=function(){var a=X.prototype.copy.call(this);if(a instanceof B){var b=this.za;if(0<b.length)for(var c=b.length,d=0;d<c;d++){var e=b.p[d].copy(),g=a;e.ul(g);e.fm=null;var h=g.za,k=h.count;h.Ad(k,e);h=g.U;if(null!==h){h.Bj=null;null!==e.sd&&h instanceof y&&(h.qj=!0);var l=g.h;null!==l&&l.Aa.qb||h.Vc(Dd,"elements",g,null,e,null,k)}}return a}return null};B.prototype.toString=function(){return"Panel("+this.type+")#"+t.oc(this)};var ah;B.Position=ah=t.w(B,"Position",0);
B.Horizontal=t.w(B,"Horizontal",1);var Wh;B.Vertical=Wh=t.w(B,"Vertical",2);var Ug;B.Spot=Ug=t.w(B,"Spot",3);var Xh;B.Auto=Xh=t.w(B,"Auto",4);var ea;B.Table=ea=t.w(B,"Table",5);B.Viewbox=t.w(B,"Viewbox",6);var bk;B.TableRow=bk=t.w(B,"TableRow",7);var ck;B.TableColumn=ck=t.w(B,"TableColumn",8);var Cg;B.Link=Cg=t.w(B,"Link",9);var bi;B.Grid=bi=t.w(B,"Grid",10);t.g(B,"type",B.prototype.type);
t.defineProperty(B,{type:"type"},function(){return this.ba},function(a){var b=this.ba;b!==a&&(f&&t.tb(a,B,B,"type"),b!==bk&&b!==ck||t.l("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.ba=a,this.ba===bi?this.Ig=!0:this.ba===ea&&hl(this),this.aa(),this.i("type",b,a))});t.A(B,{elements:"elements"},function(){return this.za.k});t.A(B,{Ia:"naturalBounds"},function(){return this.Mc});t.g(B,"padding",B.prototype.padding);
t.defineProperty(B,{padding:"padding"},function(){return this.Le},function(a){"number"===typeof a?(0>a&&t.ha(a,">= 0",B,"padding"),a=new sb(a)):(t.m(a,sb,B,"padding"),0>a.left&&t.ha(a.left,">= 0",B,"padding:val.left"),0>a.right&&t.ha(a.right,">= 0",B,"padding:val.right"),0>a.top&&t.ha(a.top,">= 0",B,"padding:val.top"),0>a.bottom&&t.ha(a.bottom,">= 0",B,"padding:val.bottom"));var b=this.Le;b.N(a)||(this.Le=a=a.Z(),this.aa(),this.i("padding",b,a))});t.g(B,"defaultAlignment",B.prototype.Yj);
t.defineProperty(B,{Yj:"defaultAlignment"},function(){return this.qq},function(a){var b=this.qq;b.N(a)||(f&&t.m(a,K,B,"defaultAlignment"),this.qq=a=a.Z(),this.aa(),this.i("defaultAlignment",b,a))});t.g(B,"defaultStretch",B.prototype.Qz);t.defineProperty(B,{Qz:"defaultStretch"},function(){return this.kc},function(a){var b=this.kc;b!==a&&(t.tb(a,X,B,"defaultStretch"),this.kc=a,this.aa(),this.i("defaultStretch",b,a))});t.g(B,"defaultSeparatorPadding",B.prototype.CH);
t.defineProperty(B,{CH:"defaultSeparatorPadding"},function(){return void 0===this.ij?J.Tp:this.ij},function(a){if(void 0!==this.ij){"number"===typeof a?a=new sb(a):f&&t.m(a,sb,B,"defaultSeparatorPadding");var b=this.ij;b.N(a)||(this.ij=a=a.Z(),this.i("defaultSeparatorPadding",b,a))}});t.g(B,"defaultRowSeparatorStroke",B.prototype.AH);
t.defineProperty(B,{AH:"defaultRowSeparatorStroke"},function(){return void 0===this.di?null:this.di},function(a){var b=this.di;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.di=a,this.i("defaultRowSeparatorStroke",b,a))});t.g(B,"defaultRowSeparatorStrokeWidth",B.prototype.BH);
t.defineProperty(B,{BH:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.lh?1:this.lh},function(a){if(void 0!==this.lh){var b=this.lh;b!==a&&(this.lh=a,this.i("defaultRowSeparatorStrokeWidth",b,a))}});t.g(B,"defaultRowSeparatorDashArray",B.prototype.zH);
t.defineProperty(B,{zH:"defaultRowSeparatorDashArray"},function(){return void 0===this.Ml?null:this.Ml},function(a){if(void 0!==this.Ml){var b=this.Ml;b!==a&&(Array.isArray(a)||t.Vb(a,"Array",B,"defaultRowSeparatorDashArray:val"),this.Ml=a,this.i("defaultRowSeparatorDashArray",b,a))}});t.g(B,"defaultColumnSeparatorStroke",B.prototype.vH);
t.defineProperty(B,{vH:"defaultColumnSeparatorStroke"},function(){return void 0===this.jh?null:this.jh},function(a){if(void 0!==this.jh){var b=this.jh;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.jh=a,this.i("defaultColumnSeparatorStroke",b,a))}});t.g(B,"defaultColumnSeparatorStrokeWidth",B.prototype.wH);
t.defineProperty(B,{wH:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.kh?1:this.kh},function(a){if(void 0!==this.kh){var b=this.kh;b!==a&&(this.kh=a,this.i("defaultColumnSeparatorStrokeWidth",b,a))}});t.g(B,"defaultColumnSeparatorDashArray",B.prototype.uH);
t.defineProperty(B,{uH:"defaultColumnSeparatorDashArray"},function(){return void 0===this.Ll?null:this.Ll},function(a){if(void 0!==this.Ll){var b=this.Ll;b!==a&&(Array.isArray(a)||t.Vb(a,"Array",B,"defaultColumnSeparatorDashArray:val"),this.Ll=a,this.i("defaultColumnSeparatorDashArray",b,a))}});t.g(B,"viewboxStretch",B.prototype.lJ);
t.defineProperty(B,{lJ:"viewboxStretch"},function(){return this.so},function(a){var b=this.so;b!==a&&(t.tb(a,X,B,"viewboxStretch"),this.so=a,this.i("viewboxStretch",b,a))});t.g(B,"gridCellSize",B.prototype.Ms);
t.defineProperty(B,{Ms:"gridCellSize"},function(){return this.Gq},function(a){var b=this.Gq;b.N(a)||(t.m(a,pa,B,"gridCellSize"),a.Q()&&0!==a.width&&0!==a.height||t.l("Invalid Panel.gridCellSize: "+a),this.Gq=a.Z(),null!==this.h&&this===this.h.Xo&&vi(this.h),this.pa(),this.i("gridCellSize",b,a))});t.g(B,"gridOrigin",B.prototype.cA);
t.defineProperty(B,{cA:"gridOrigin"},function(){return this.Hq},function(a){var b=this.Hq;b.N(a)||(t.m(a,C,B,"gridOrigin"),a.Q()||t.l("Invalid Panel.gridOrigin: "+a),this.Hq=a.Z(),this.h&&vi(this.h),this.pa(),this.i("gridOrigin",b,a))});
B.prototype.hl=function(a,b){var c=this.opacity,d=1;1!==c&&(d=a.globalAlpha,a.globalAlpha=d*c);if(this.ba===bi){c=this.fk()*b.scale;0>=c&&(c=1);var e=this.Ms,d=e.width,e=e.height,g=this.Ia,h=g.width,g=g.height,k=Math.ceil(h/d),l=Math.ceil(g/e),m=this.cA;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.za.p,q=this.za.length,r=0;r<q;r++){var s=[];n.push(s);var v=p[r];if(v.visible)for(var v="LineV"===v.Ib,x=r+1;x<q;x++){var E=p[x];E.visible&&"LineV"===E.Ib===v&&(E=E.interval,2<=E&&
s.push(E))}}p=this.za.length;for(q=0;q<p;q++)if(r=this.za.p[q],r.visible){s=n[q];v=r.interval;x=!1;E=r.Rw;if(null!==E){var F=x=!0;void 0!==a.setLineDash?(a.setLineDash(E),a.lineDashOffset=r.ad):void 0!==a.webkitLineDash?(a.webkitLineDash=E,a.webkitLineDashOffset=r.ad):void 0!==a.mozDash?(a.mozDash=E,a.mozDashOffset=r.ad):F=!1}a.lineWidth=r.ib;fk(this,a,r.stroke,!1);a.beginPath();if("LineV"===r.Ib)for(var G=Math.floor(-m.x/d),L=G;L<=G+k;L++){var N=L*d+m.x;if(0<=N&&N<h&&jl(L,v,s)&&(x&&!F?Nj(a,N,0,N,
g,E,r.ad):(a.moveTo(N,0),a.lineTo(N,g)),2>d*v*c))break}else for(L=G=Math.floor(-m.y/e);L<=G+l&&!(N=L*e+m.y,0<=N&&N<=g&&jl(L,v,s)&&(x&&!F?Nj(a,0,N,h,N,E,r.ad):(a.moveTo(0,N),a.lineTo(h,N)),2>e*v*c));L++);a.stroke();x&&(void 0!==a.setLineDash?(a.setLineDash(t.Wh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=t.Wh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0))}a.restore();ca(b,a,!1)}else{this.ba===ea&&(a.lineCap="butt",kl(this,a,!0,this.$c,!0),kl(this,
a,!1,this.Wc,!0),ol(this,a,!0,this.$c),ol(this,a,!1,this.Wc),kl(this,a,!0,this.$c,!1),kl(this,a,!1,this.Wc,!1));F=this.za.length;for(e=0;e<F;e++)this.za.p[e].Re(a,b);f&&f.NH&&this instanceof A&&f.MH(a,b,this);1!==c&&(a.globalAlpha=d)}};
function ol(a,b,c,d){for(var e=d.length,g,h=a.ya,k=c?a.ne(0):a.me(0),l=0;l<e;l++)if(g=d[l],void 0!==g&&g!==k&&0!==g.Yb){var m=g.cn;isNaN(m)&&(m=c?a.lh:a.kh);var n=g.bn;null===n&&(n=c?a.di:a.jh);if(0!==m&&null!==n){fk(a,b,n,!1);var n=!1,p=g.wF;if(null!==p){var q=n=!0;void 0!==b.setLineDash?(b.setLineDash(p),b.lineDashOffset=a.ad):void 0!==b.webkitLineDash?(b.webkitLineDash=p,b.webkitLineDashOffset=a.ad):void 0!==b.mozDash?(b.mozDash=p,b.mozDashOffset=a.ad):q=!1}b.beginPath();var r=g.position+m;c?r>
h.height&&(m-=r-h.height):r>h.width&&(m-=r-h.width);g=g.position+m/2;b.lineWidth=m;r=a.padding;c?(g+=r.top,m=r.left,r=h.width-r.right,n&&!q?Nj(b,m,g,r,g,p,0):(b.moveTo(m,g),b.lineTo(r,g))):(g+=r.left,m=r.top,r=h.height-r.bottom,n&&!q?Nj(b,g,m,g,r,p,0):(b.moveTo(g,m),b.lineTo(g,r)));b.stroke();n&&(void 0!==b.setLineDash?(b.setLineDash(t.Wh),b.lineDashOffset=0):void 0!==b.webkitLineDash?(b.webkitLineDash=t.Wh,b.webkitLineDashOffset=0):void 0!==b.mozDash&&(b.mozDash=null,b.mozDashOffset=0))}}}
function kl(a,b,c,d,e){for(var g=d.length,h,k=a.ya,l=0;l<g;l++)if(h=d[l],void 0!==h&&null!==h.background&&h.Xv!==e&&0!==h.Yb){var m=c?k.height:k.width;if(!(h.position>m)){var n=pl(h),p=h.cn;isNaN(p)&&(p=c?a.lh:a.kh);var q=h.bn;null===q&&(q=c?a.di:a.jh);null===q&&(p=0);n-=p;p=h.position+p;n+=h.Yb;p+n>m&&(n=m-p);0>=n||(m=a.padding,fk(a,b,h.background,!0),c?b.fillRect(m.left,p+m.top,k.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,k.height-(m.top+m.bottom)))}}}
function jl(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;d<b;d++)if(0===a%c[d])return!1;return!0}
B.prototype.$s=function(a,b,c,d){var e=this.Ai;e.width=0;e.height=0;var g=this.Ca,h=this.Ye;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.He;isNaN(g.width)||(a=Math.min(g.width,k.width));isNaN(g.height)||(b=Math.min(g.height,k.height));a=Math.max(c,a);b=Math.max(d,b);var l=this.padding;a=Math.max(a-l.left-l.right,0);b=Math.max(b-l.top-l.bottom,0);var m=this.za,n=m.length;if(0===n){var p=this.Mc;qb(p,isNaN(g.width)?0:a,isNaN(g.height)?0:b);Pj(this,0,0,p.width,
p.height)}else{var q=this.ba.Rb;switch(q){case "Position":var r=a,s=b,v=c,x=d;e.x=0;e.y=0;e.width=0;for(var E=e.height=0;E<n;E++){var F=m.p[E];if(F.visible||F===this.Ub){var G=F.margin,L=G.right+G.left,N=G.top+G.bottom;Dh(F,r,s,v,x);var V=F.Ea,T=Math.max(V.width+L,0),W=Math.max(V.height+N,0),da=F.position.x,R=F.position.y;isFinite(da)||(da=0);isFinite(R)||(R=0);if(F instanceof Y&&F.kA)var xa=F.ib/2,da=da-xa,R=R-xa;yb(e,da,R,T,W)}}break;case "Vertical":for(var Ja=a,Ma=c,Na=t.Cb(),ya=0;ya<n;ya++){var Ra=
m.p[ya];if(Ra.visible||Ra===this.Ub){var Ca=Sj(Ra);if(Ca!==Wg&&Ca!==Jj)Na.push(Ra);else{var ob=Ra.margin,kf=ob.right+ob.left,hc=ob.top+ob.bottom;Dh(Ra,Ja,Infinity,Ma,0);var lf=Ra.Ea,ic=Math.max(lf.width+kf,0),hb=Math.max(lf.height+hc,0);e.width=Math.max(e.width,ic);e.height+=hb}}}var ib=Na.length;if(0!==ib){this.Ca.width?Ja=Math.min(this.Ca.width,this.He.width):0!==e.width&&(Ja=Math.min(e.width,this.He.width));for(ya=0;ya<ib;ya++)if(Ra=Na[ya],Ra.visible||Ra===this.Ub)ob=Ra.margin,kf=ob.right+ob.left,
hc=ob.top+ob.bottom,Dh(Ra,Ja,Infinity,Ma,0),lf=Ra.Ea,ic=Math.max(lf.width+kf,0),hb=Math.max(lf.height+hc,0),e.width=Math.max(e.width,ic),e.height+=hb;t.Da(Na)}break;case "Horizontal":for(var Ga=b,Ka=d,bb=t.Cb(),tb=0;tb<n;tb++){var Ya=m.p[tb];if(Ya.visible||Ya===this.Ub){var Hf=Sj(Ya);if(Hf!==Wg&&Hf!==Kj)bb.push(Ya);else{var fd=Ya.margin,vd=fd.right+fd.left,Ed=fd.top+fd.bottom;Dh(Ya,Infinity,Ga,0,Ka);var Ud=Ya.Ea,wd=Math.max(Ud.width+vd,0),Vd=Math.max(Ud.height+Ed,0);e.width+=wd;e.height=Math.max(e.height,
Vd)}}}var Dg=bb.length;if(0!==Dg){this.Ca.height?Ga=Math.min(this.Ca.height,this.He.height):0!==e.height&&(Ga=Math.min(e.height,this.He.height));for(tb=0;tb<Dg;tb++)if(Ya=bb[tb],Ya.visible||Ya===this.Ub)fd=Ya.margin,vd=fd.right+fd.left,Ed=fd.top+fd.bottom,Dh(Ya,Infinity,Ga,0,Ka),Ud=Ya.Ea,wd=Math.max(Ud.width+vd,0),Vd=Math.max(Ud.height+Ed,0),e.width+=wd,e.height=Math.max(e.height,Vd);t.Da(bb)}break;case "Spot":a:{var Cb=a,mf=b,Ib=c,ec=d,Kb=mk(this,m,n),Sa=Kb.margin,jc,Ie,If=Sa.right+Sa.left,fg=Sa.top+
Sa.bottom;Dh(Kb,Cb,mf,Ib,ec);var Fb=Kb.Ea,gd=Fb.width,qc=Fb.height,hd=Math.max(gd+If,0),Za=Math.max(qc+fg,0);e.x=-Sa.left;e.y=-Sa.top;e.width=hd;e.height=Za;for(var fb=0;fb<n;fb++){var Yb=m.p[fb];if(Yb!==Kb&&(Yb.visible||Yb===this.Ub)){Sa=Yb.margin;jc=Sa.right+Sa.left;Ie=Sa.top+Sa.bottom;Dh(Yb,Cb,mf,0,0);var Fb=Yb.Ea,hd=Math.max(Fb.width+jc,0),Za=Math.max(Fb.height+Ie,0),ub=Yb.alignment;ub.Gc()&&(ub=this.Yj);ub.rd()||(ub=Vb);var kc=Yb.Rj;kc.Gc()&&(kc=Vb);yb(e,ub.x*gd+ub.offsetX-(kc.x*Fb.width-kc.offsetX)-
Sa.left,ub.y*qc+ub.offsetY-(kc.y*Fb.height-kc.offsetY)-Sa.top,hd,Za)}}var nf=Kb.Rh;nf===Xg&&(nf=Sj(Kb));switch(nf){case Wg:break a;case Nc:if(!isFinite(Cb)&&!isFinite(mf))break a;break;case Kj:if(!isFinite(Cb))break a;break;case Jj:if(!isFinite(mf))break a}Fb=Kb.Ea;gd=Fb.width;qc=Fb.height;hd=Math.max(gd+If,0);Za=Math.max(qc+fg,0);Sa=Kb.margin;e.x=-Sa.left;e.y=-Sa.top;e.width=hd;e.height=Za;for(fb=0;fb<n;fb++)Yb=m.p[fb],Yb===Kb||!Yb.visible&&Yb!==this.Ub||(Sa=Yb.margin,jc=Sa.right+Sa.left,Ie=Sa.top+
Sa.bottom,Fb=Yb.Ea,hd=Math.max(Fb.width+jc,0),Za=Math.max(Fb.height+Ie,0),ub=Yb.alignment,ub.Gc()&&(ub=this.Yj),ub.rd()||(ub=Vb),kc=Yb.Rj,kc.Gc()&&(kc=Vb),yb(e,ub.x*gd+ub.offsetX-(kc.x*Fb.width-kc.offsetX)-Sa.left,ub.y*qc+ub.offsetY-(kc.y*Fb.height-kc.offsetY)-Sa.top,hd,Za))}break;case "Auto":var rc=a,zb=b,Wd=c,Je=d,Ab=mk(this,m,n),Fd=Ab.margin,Ke=Fd.right+Fd.left,me=Fd.top+Fd.bottom;Dh(Ab,rc,zb,Wd,Je);var gb=Ab.Ea,of=Math.max(gb.width+Ke,0),Bb=Math.max(gb.height+me,0),$a=ql(Ab),Oc=$a.x*of+$a.offsetX,
Lb=$a.y*Bb+$a.offsetY,$a=rl(Ab),Gd=$a.x*of+$a.offsetX,Xd=$a.y*Bb+$a.offsetY,Yd=rc,ne=zb;isFinite(rc)&&(Yd=Math.abs(Oc-Gd));isFinite(zb)&&(ne=Math.abs(Lb-Xd));var Pc=t.xl();Pc.q(0,0);for(var xd=0;xd<n;xd++){var jb=m.p[xd];if(jb!==Ab&&(jb.visible||jb===this.Ub)){var Fd=jb.margin,Le=Fd.right+Fd.left,Me=Fd.top+Fd.bottom;Dh(jb,Yd,ne,0,0);gb=jb.Ea;of=Math.max(gb.width+Le,0);Bb=Math.max(gb.height+Me,0);Pc.q(Math.max(of,Pc.width),Math.max(Bb,Pc.height))}}if(1===n)e.width=of,e.height=Bb,t.dk(Pc);else{var mb=
ql(Ab),oe=rl(Ab),Db,lc;oe.x!==mb.x&&oe.y!==mb.y&&(Db=Pc.width/Math.abs(oe.x-mb.x),lc=Pc.height/Math.abs(oe.y-mb.y));t.dk(Pc);var yd=0;Ab instanceof Y&&(yd=Ab.ib*Ab.scale,sl(Ab)===Yg&&(Db=Math.max(Db,lc),lc=Math.max(Db,lc)));Db+=Math.abs(mb.offsetX)+Math.abs(oe.offsetX)+yd;lc+=Math.abs(mb.offsetY)+Math.abs(oe.offsetY)+yd;var sc=Ab.Rh;sc===Xg&&(sc=Sj(Ab));switch(sc){case Wg:Je=Wd=0;break;case Nc:isFinite(rc)&&(Db=rc);isFinite(zb)&&(lc=zb);break;case Kj:isFinite(rc)&&(Db=rc);Je=0;break;case Jj:Wd=0,
isFinite(zb)&&(lc=zb)}Ab instanceof Y&&!Ab.Ca.Q()&&(Ab.Qg?Ab.Bk=null:Ab.Ra=null);nk(Ab);Dh(Ab,Db,lc,Wd,Je);e.width=Ab.Ea.width+Ke;e.height=Ab.Ea.height+me}break;case "Table":for(var Mb=a,Ne=b,kb=n,cb=c,Jf=d,Dc=t.Cb(),Hd=t.Cb(),ma=0;ma<kb;ma++){var na=m.p[ma];if(na instanceof B&&(na.type===bk||na.type===ck)&&na.visible){Hd.push(na);for(var gg=na.za,Eg=gg.length,Qc=0;Qc<Eg;Qc++){var nh=gg.p[Qc];na.type===bk?nh.gc=na.gc:na.type===ck&&(nh.column=na.column);Dc.push(nh)}}else Dc.push(na)}for(var kb=Dc.length,
fc=[],ma=0;ma<kb;ma++)na=Dc[ma],Tj(na,!0),Xj(na,!0),fc[na.gc]||(fc[na.gc]=[]),fc[na.gc][na.column]||(fc[na.gc][na.column]=[]),fc[na.gc][na.column].push(na);t.Da(Dc);for(var oh=t.Cb(),Rc=t.Cb(),Zd=t.Cb(),Ec={count:0},id={count:0},yc=Mb,jd=Ne,Kf=this.$c,kb=Kf.length,ma=0;ma<kb;ma++){var fa=Kf[ma];void 0!==fa&&tl(fa,0)}Kf=this.Wc;kb=Kf.length;for(ma=0;ma<kb;ma++)fa=Kf[ma],void 0!==fa&&tl(fa,0);for(var Id=fc.length,hg=0,ma=0;ma<Id;ma++)fc[ma]&&(hg=Math.max(hg,fc[ma].length));for(var nj=Math.min(this.zi,
Id-1),ig=Math.min(this.ji,hg-1),Sc,Id=fc.length,ma=nj;ma<Id;ma++)if(fc[ma]){var hg=fc[ma].length,pb=this.ne(ma);tl(pb,0);for(Qc=ig;Qc<hg;Qc++)if(fc[ma][Qc]){var lb=this.me(Qc);void 0===oh[Qc]&&(tl(lb,0),oh[Qc]=!0);for(var oj=fc[ma][Qc],ph=oj.length,jg=0;jg<ph;jg++)if(na=oj[jg],na.visible||na===this.Ub){var kg=1<na.Hj||1<na.hj;kg&&Rc.push(na);var mc=na.margin,Lf=mc.right+mc.left,Mf=mc.top+mc.bottom,Zb=pk(na,pb,lb),qh=na.Ca,Nf=!isNaN(qh.width),pe=!isNaN(qh.height),ki=Nf&&pe;kg||Zb===Wg||ki||(void 0===
Ec[Qc]&&(Ec[Qc]=-1,Ec.count++),void 0===id[ma]&&(id[ma]=-1,id.count++),Zd.push(na));Dh(na,Infinity,Infinity,0,0);var Oe=na.Ea,Pe=Math.max(Oe.width+Lf,0),Qe=Math.max(Oe.height+Mf,0);1!==na.Hj||!pe&&Zb!==Wg&&Zb!==Kj||(fa=this.ne(ma),Sc=Math.max(Qe-fa.Yb,0),Sc>jd&&(Sc=jd),tl(fa,fa.Yb+Sc),jd=Math.max(jd-Sc,0));1!==na.hj||!Nf&&Zb!==Wg&&Zb!==Jj||(fa=this.me(Qc),Sc=Math.max(Pe-fa.Yb,0),Sc>yc&&(Sc=yc),tl(fa,fa.Yb+Sc),yc=Math.max(yc-Sc,0));kg&&nk(na)}}}t.Da(oh);for(var $d=0,Nb=0,kb=this.Sv,ma=0;ma<kb;ma++)void 0!==
this.Wc[ma]&&($d+=this.me(ma).Eb);kb=this.Kw;for(ma=0;ma<kb;ma++)void 0!==this.$c[ma]&&(Nb+=this.ne(ma).Eb);for(var yc=Math.max(Mb-$d,0),rh=jd=Math.max(Ne-Nb,0),sh=yc,kb=Zd.length,ma=0;ma<kb;ma++){var na=Zd[ma],pb=this.ne(na.gc),lb=this.me(na.column),qe=na.Ea,mc=na.margin,Lf=mc.right+mc.left,Mf=mc.top+mc.bottom;Ec[na.column]=0===lb.Yb?Math.max(qe.width+Lf,Ec[na.column]):null;id[na.gc]=0===pb.Yb?Math.max(qe.height+Mf,id[na.gc]):null}var Fg=0,lg=0;for(ma in id)"count"!==ma&&(Fg+=id[ma]);for(ma in Ec)"count"!==
ma&&(lg+=Ec[ma]);for(var vb=t.xl(),ma=0;ma<kb;ma++)if(na=Zd[ma],na.visible||na===this.Ub){var pb=this.ne(na.gc),lb=this.me(na.column),pf;isFinite(lb.width)?pf=lb.width:(pf=isFinite(yc)&&null!==Ec[na.column]?0===lg?lb.Yb+yc:Ec[na.column]/lg*sh:null!==Ec[na.column]?yc:lb.Yb||yc,pf=Math.max(0,pf-pl(lb)));var Jd;isFinite(pb.height)?Jd=pb.height:(Jd=isFinite(jd)&&null!==id[na.gc]?0===Fg?pb.Yb+jd:id[na.gc]/Fg*rh:null!==id[na.gc]?jd:pb.Yb||jd,Jd=Math.max(0,Jd-pl(pb)));vb.q(Math.max(lb.Nh,Math.min(pf,lb.qf)),
Math.max(pb.Nh,Math.min(Jd,pb.qf)));Zb=pk(na,pb,lb);switch(Zb){case Kj:vb.height=Infinity;break;case Jj:vb.width=Infinity}mc=na.margin;Lf=mc.right+mc.left;Mf=mc.top+mc.bottom;nk(na);Dh(na,vb.width,vb.height,lb.Nh,pb.Nh);Oe=na.Ea;Pe=Math.max(Oe.width+Lf,0);Qe=Math.max(Oe.height+Mf,0);isFinite(yc)&&(Pe=Math.min(Pe,vb.width));isFinite(jd)&&(Qe=Math.min(Qe,vb.height));var qf;qf=pb.Yb;tl(pb,Math.max(pb.Yb,Qe));Sc=pb.Yb-qf;jd=Math.max(jd-Sc,0);qf=lb.Yb;tl(lb,Math.max(lb.Yb,Pe));Sc=lb.Yb-qf;yc=Math.max(yc-
Sc,0)}t.Da(Zd);for(var ae=t.xl(),kb=Rc.length,ma=0;ma<kb;ma++)if(na=Rc[ma],na.visible||na===this.Ub){pb=this.ne(na.gc);lb=this.me(na.column);vb.q(Math.max(lb.Nh,Math.min(Mb,lb.qf)),Math.max(pb.Nh,Math.min(Ne,pb.qf)));Zb=pk(na,pb,lb);switch(Zb){case Nc:0!==lb.Yb&&(vb.width=Math.min(vb.width,lb.Yb));0!==pb.Yb&&(vb.height=Math.min(vb.height,pb.Yb));break;case Kj:0!==lb.Yb&&(vb.width=Math.min(vb.width,lb.Yb));break;case Jj:0!==pb.Yb&&(vb.height=Math.min(vb.height,pb.Yb))}isFinite(lb.width)&&(vb.width=
lb.width);isFinite(pb.height)&&(vb.height=pb.height);ae.q(0,0);for(var tc=1;tc<na.Hj&&!(na.gc+tc>=this.Kw);tc++)fa=this.ne(na.gc+tc),ae.height+=Math.max(fa.Nh,isNaN(fa.Ef)?fa.qf:Math.min(fa.Ef,fa.qf));for(tc=1;tc<na.hj&&!(na.column+tc>=this.Sv);tc++)fa=this.me(na.column+tc),ae.width+=Math.max(fa.Nh,isNaN(fa.Ef)?fa.qf:Math.min(fa.Ef,fa.qf));vb.width+=ae.width;vb.height+=ae.height;mc=na.margin;Lf=mc.right+mc.left;Mf=mc.top+mc.bottom;Dh(na,vb.width,vb.height,cb,Jf);for(var Oe=na.Ea,Pe=Math.max(Oe.width+
Lf,0),Qe=Math.max(Oe.height+Mf,0),Of=0,tc=0;tc<na.Hj;tc++)fa=this.ne(na.gc+tc),Of+=fa.total||0;if(Of<Qe)for(var uc=Qe-Of;0<uc;){var ld=fa.Eb||0;isNaN(fa.height)&&fa.qf>ld&&(tl(fa,Math.min(fa.qf,ld+uc)),fa.Eb!==ld&&(uc-=fa.Eb-ld));if(-1===fa.index-1)break;fa=this.ne(fa.index-1)}for(var mg=0,tc=0;tc<na.hj;tc++)fa=this.me(na.column+tc),mg+=fa.total||0;if(mg<Pe)for(uc=Pe-mg;0<uc;){ld=fa.Eb||0;isNaN(fa.width)&&fa.qf>ld&&(tl(fa,Math.min(fa.qf,ld+uc)),fa.Eb!==ld&&(uc-=fa.Eb-ld));if(-1===fa.index-1)break;
fa=this.me(fa.index-1)}}t.Da(Rc);t.dk(ae);t.dk(vb);for(var be=0,Pf=0,Zb=Sj(this),rf=this.Ca,Re=this.He,ce=Nb=$d=0,de=0,kb=this.Sv,ma=0;ma<kb;ma++)void 0!==this.Wc[ma]&&(fa=this.me(ma),isFinite(fa.width)?(ce+=fa.width,ce+=pl(fa)):ul(fa)===vl?(ce+=fa.Eb,ce+=pl(fa)):0!==fa.Eb&&($d+=fa.Eb,$d+=pl(fa)));var be=isFinite(rf.width)?Math.min(rf.width,Re.width):Zb!==Wg&&isFinite(Mb)?Mb:$d,be=Math.max(be,this.Ye.width),be=Math.max(be-ce,0),Se=Math.max(be/$d,1);isFinite(Se)||(Se=1);for(ma=0;ma<kb;ma++)void 0!==
this.Wc[ma]&&(fa=this.me(ma),isFinite(fa.width)||ul(fa)===vl||tl(fa,fa.Eb*Se),fa.rb=e.width,0!==fa.Eb&&(e.width+=fa.Eb,e.width+=pl(fa)));kb=this.Kw;for(ma=0;ma<kb;ma++)void 0!==this.$c[ma]&&(fa=this.ne(ma),isFinite(fa.height)?(de+=fa.height,de+=pl(fa)):ul(fa)===vl?(de+=fa.Eb,de+=pl(fa)):0!==fa.Eb&&(Nb+=fa.Eb,Nb+=pl(fa)));var Pf=isFinite(rf.height)?Math.min(rf.height,Re.height):Zb!==Wg&&isFinite(Ne)?Ne:Nb,Pf=Math.max(Pf,this.Ye.height),Pf=Math.max(Pf-de,0),th=Math.max(Pf/Nb,1);isFinite(th)||(th=1);
for(ma=0;ma<kb;ma++)void 0!==this.$c[ma]&&(fa=this.ne(ma),isFinite(fa.height)||ul(fa)===vl||tl(fa,fa.Eb*th),fa.rb=e.height,0!==fa.Eb&&(e.height+=fa.Eb,e.height+=pl(fa)));kb=Hd.length;for(ma=0;ma<kb;ma++){var Kd=Hd[ma];Kd.type===bk?(pf=e.width,fa=this.ne(Kd.gc),Jd=fa.Yb):(fa=this.me(Kd.column),pf=fa.Yb,Jd=e.height);Kd.Lc.q(0,0,pf,Jd);Tj(Kd,!1);fc[Kd.gc]||(fc[Kd.gc]=[]);fc[Kd.gc][Kd.column]||(fc[Kd.gc][Kd.column]=[]);fc[Kd.gc][Kd.column].push(Kd)}t.Da(Hd);this.fv=fc;break;case "Viewbox":var qj=a,rj=
b,mo=c,no=d;1<n&&t.l("Viewbox Panel cannot contain more than one GraphObject.");var ee=m.p[0];ee.Sb=1;nk(ee);Dh(ee,Infinity,Infinity,mo,no);var li=ee.Ea,sj=ee.margin,oo=sj.right+sj.left,po=sj.top+sj.bottom;if(isFinite(qj)||isFinite(rj)){var pq=ee.scale,qo=li.width,ro=li.height,so=Math.max(qj-oo,0),to=Math.max(rj-po,0);ee.Sb=this.so===Yg?ee.Sb*Math.min(so/qo,to/ro):ee.Sb*Math.max(so/qo,to/ro);pq!==ee.scale&&(Tj(ee,!0),Dh(ee,Infinity,Infinity,mo,no))}li=ee.Ea;e.width=isFinite(qj)?qj:Math.max(li.width+
oo,0);e.height=isFinite(rj)?rj:Math.max(li.height+po,0);break;case "Link":var tj=this instanceof Ve?this.Dh:this;if(0===n){var uj=this.Mc;qb(uj,0,0);var Ld=this.Ea;Ld.q(0,0,0,0)}else{var vj=this.Fq(),Te=this.pj(),re=this.Ai;re.assign(Te);re.x=0;re.y=0;var uh,mi=this.jy();uh=void 0!==this.ma?this.ma:mi.count;this.ki.q(Te.x,Te.y);this.Yh.clear();null!==vj&&(wl(vj,Te.width,Te.height),Ld=vj.Ea,re.nk(Ld),this.Yh.add(Ld));for(var vh=t.ah(),ng=t.O(),Qf=t.O(),ll=0;ll<n;ll++){var Rb=m.p[ll];if(Rb!==vj)if(Rb.Jh&&
Rb instanceof Y)wl(Rb,Te.width,Te.height),Ld=Rb.Ea,re.nk(Ld),this.Yh.add(Ld);else if(2>uh)Dh(Rb,Infinity,Infinity),Ld=Rb.Ea,re.nk(Ld),this.Yh.add(Ld);else{var Rf=Rb.tf,vo=Rb.tt,ml=Rb.Rj;ml.qd()&&(ml=Vb);var wj=Rb.ut,qq=Rb.VA,ni,oi,xj=0;if(Rf<-uh||Rf>=uh){var wo=tj.SE,yj=tj.RE;wj!==Ig&&(xj=tj.computeAngle(Rb,wj,yj),Rb.angle=xj);ni=wo.x-Te.x;oi=wo.y-Te.y}else{var sf,wh;if(0<=Rf)sf=mi.p[Rf],wh=Rf<uh-1?mi.p[Rf+1]:sf;else{var nl=uh+Rf;sf=mi.p[nl];wh=0<nl?mi.p[nl-1]:sf}yj=0<=Rf?sf.Li(wh):wh.Li(sf);wj!==
Ig&&(xj=tj.computeAngle(Rb,wj,yj),Rb.on=xj);ni=sf.x+(wh.x-sf.x)*vo-Te.x;oi=sf.y+(wh.y-sf.y)*vo-Te.y}Dh(Rb,Infinity,Infinity);var Ld=Rb.Ea,uj=Rb.Ia,pi=0;Rb instanceof Y&&(pi=Rb.ib);var xo=uj.width+pi,yo=uj.height+pi;vh.reset();vh.translate(-Ld.x,-Ld.y);vh.scale(Rb.scale,Rb.scale);vh.rotate(Rb.angle,xo/2,yo/2);var xh=new D(0,0,xo,yo);ng.wt(xh,ml);vh.Va(ng);var rq=-ng.x+pi/2,sq=-ng.y+pi/2;Qf.assign(qq);isNaN(Qf.x)&&(Qf.x=0<=Rf?ng.x+3:-(ng.x+3));isNaN(Qf.y)&&(Qf.y=-(ng.y+3));Qf.rotate(yj);ni+=Qf.x;oi+=
Qf.y;xh.set(Ld);xh.x=ni+rq;xh.y=oi+sq;this.Yh.add(xh);re.nk(xh)}}if(this.ff)for(var zo=this.Ui;zo.next();)Dh(zo.value,Infinity,Infinity);this.Ai=re;var zj=this.ki;zj&&zj.q(zj.x+re.x,zj.y+re.y);qb(e,re.width||0,re.height||0);t.Se(vh);t.B(ng);t.B(Qf)}break;case "Grid":break;case "TableRow":case "TableColumn":t.l(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:t.l("Unknown panel type: "+q)}var se=e.width,te=
e.height,Aj=this.padding,tq=Aj.top+Aj.bottom,se=se+(Aj.left+Aj.right),te=te+tq;isFinite(g.width)&&(se=g.width);isFinite(g.height)&&(te=g.height);se=Math.min(k.width,se);te=Math.min(k.height,te);se=Math.max(h.width,se);te=Math.max(h.height,te);se=Math.max(c,se);te=Math.max(d,te);e.width=se;e.height=te;p=this.Mc;qb(p,se,te);Pj(this,0,0,se,te)}};B.prototype.findMainElement=B.prototype.gw=function(){null===this.qo&&mk(this,this.za,this.za.length);return this.qo};
function mk(a,b,c){for(var d=0;d<c;d++){var e=b.p[d];if(!0===e.Jh)return a.qo=e}b=b.p[0];return a.qo=b}
B.prototype.Uj=function(a,b,c,d){var e=this.Ai,g=this.za,h=g.length,k=t.lk(0,0,0,0);if(0===h){var l=this.ya;l.x=a;l.y=b;l.width=c;l.height=d}else{if(!this.Ca.Q()){var m=Sj(this),n=this.Lc,p=n.width,q=n.height,r=this.margin,s=r.left+r.right,v=r.top+r.bottom;p===c&&q===d&&(m=Wg);switch(m){case Wg:if(p>c||q>d)this.aa(),Dh(this,p>c?c:p,q>d?d:q);break;case Nc:Tj(this,!0);Dh(this,c+s,d+v,0,0);break;case Kj:Tj(this,!0);Dh(this,c+s,q+v,0,0);break;case Jj:Tj(this,!0),Dh(this,p+s,d+v,0,0)}}l=this.ya;l.x=a;
l.y=b;l.width=c;l.height=d;var x=this.ba.Rb;switch(x){case "Position":for(var E=e.x-this.padding.left,F=e.y-this.padding.top,G=0;G<h;G++){var L=g.p[G],N=L.Ea,V=L.margin,T=L.position.x,W=L.position.y;k.x=isNaN(T)?-E:T-E;k.y=isNaN(W)?-F:W-F;if(L instanceof Y&&L.kA){var da=L.ib/2;k.x-=da;k.y-=da}k.x+=V.left;k.y+=V.top;k.width=N.width;k.height=N.height;L.visible&&L.Dc(k.x,k.y,k.width,k.height)}break;case "Vertical":for(var R=this.padding.left,xa=this.padding.top,Ja=0;Ja<h;Ja++){var Ma=R,Na=g.p[Ja],ya=
Na.Ea,Ra=Na.margin,Ca=Ra.left+Ra.right,ob=R+this.padding.right,kf=ya.width,hc=Sj(Na);if(isNaN(Na.Ca.width)&&hc===Nc||hc===Kj)kf=Math.max(e.width-Ca-ob,0);var lf=kf+Ca+ob,ic=Na.alignment;ic.Gc()&&(ic=this.Yj);ic.rd()||(ic=Vb);k.x=Ma+ic.offsetX+Ra.left+(e.width*ic.x-lf*ic.x);k.y=xa+ic.offsetY+Ra.top;k.width=kf;k.height=ya.height;Na.visible&&(Na.Dc(k.x,k.y,k.width,k.height),xa+=ya.height+Ra.bottom+Ra.top)}break;case "Horizontal":for(var hb=this.padding.top,ib=this.padding.left,Ga=0;Ga<h;Ga++){var Ka=
hb,bb=g.p[Ga],tb=bb.Ea,Ya=bb.margin,Hf=Ya.top+Ya.bottom,fd=hb+this.padding.bottom,vd=tb.height,Ed=Sj(bb);if(isNaN(bb.Ca.height)&&Ed===Nc||Ed===Jj)vd=Math.max(e.height-Hf-fd,0);var Ud=vd+Hf+fd,wd=bb.alignment;wd.Gc()&&(wd=this.Yj);wd.rd()||(wd=Vb);k.x=ib+wd.offsetX+Ya.left;k.y=Ka+wd.offsetY+Ya.top+(e.height*wd.y-Ud*wd.y);k.width=tb.width;k.height=vd;bb.visible&&(bb.Dc(k.x,k.y,k.width,k.height),ib+=tb.width+Ya.left+Ya.right)}break;case "Spot":var Vd=mk(this,g,h),Dg=Vd.Ea,Cb=Dg.width,mf=Dg.height,Ib=
this.padding,ec=Ib.left,Kb=Ib.top;k.x=ec-e.x;k.y=Kb-e.y;Vd.Dc(k.x,k.y,Cb,mf);for(var Sa=0;Sa<h;Sa++){var jc=g.p[Sa];if(jc!==Vd){var Ie=jc.Ea,If=Ie.width,fg=Ie.height,Fb=jc.alignment;Fb.Gc()&&(Fb=this.Yj);Fb.rd()||(Fb=Vb);var gd=jc.Rj;gd.Gc()&&(gd=Vb);k.x=Fb.x*Cb+Fb.offsetX-(gd.x*If-gd.offsetX);k.y=Fb.y*mf+Fb.offsetY-(gd.y*fg-gd.offsetY);k.x-=e.x;k.y-=e.y;jc.visible&&jc.Dc(ec+k.x,Kb+k.y,If,fg)}}break;case "Auto":var qc=mk(this,g,h),hd=qc.Ea,Za=t.wf();Za.q(0,0,1,1);var fb=qc.margin,Yb=fb.left,ub=fb.top,
kc=this.padding,nf=kc.left,rc=kc.top;k.x=Yb;k.y=ub;k.width=hd.width;k.height=hd.height;qc.Dc(nf+k.x,rc+k.y,k.width,k.height);var zb=ql(qc),Wd=rl(qc),Je=0+zb.y*hd.height+zb.offsetY,Ab=0+Wd.x*hd.width+Wd.offsetX,Fd=0+Wd.y*hd.height+Wd.offsetY;Za.x=0+zb.x*hd.width+zb.offsetX;Za.y=Je;yb(Za,Ab,Fd,0,0);Za.x+=Yb+nf;Za.y+=ub+rc;for(var Ke=0;Ke<h;Ke++){var me=g.p[Ke];if(me!==qc){var gb=me.Ea,fb=me.margin,of=Math.max(gb.width+fb.right+fb.left,0),Bb=Math.max(gb.height+fb.top+fb.bottom,0),$a=me.alignment;$a.Gc()&&
($a=this.Yj);$a.rd()||($a=Vb);k.x=Za.width*$a.x+$a.offsetX-of*$a.x+fb.left+Za.x;k.y=Za.height*$a.y+$a.offsetY-Bb*$a.y+fb.top+Za.y;k.width=Za.width;k.height=Za.height;me.visible&&(Eb(Za.x,Za.y,Za.width,Za.height,k.x,k.y,gb.width,gb.height)?me.Dc(k.x,k.y,gb.width,gb.height):me.Dc(k.x,k.y,gb.width,gb.height,new D(Za.x,Za.y,Za.width,Za.height)))}}t.Rc(Za);break;case "Table":for(var Oc=this.padding,Lb=Oc.left,Gd=Oc.top,Xd=this.fv,Yd,ne,Pc=Xd.length,xd=0,jb=0;jb<Pc;jb++)Xd[jb]&&(xd=Math.max(xd,Xd[jb].length));
for(var Le=Math.min(this.zi,Pc-1);Le!==Pc&&(void 0===this.$c[Le]||0===this.$c[Le].Eb);)Le++;for(var Le=Math.min(Le,Pc-1),Me=-this.$c[Le].rb,mb=Math.min(this.ji,xd-1);mb!==xd&&(void 0===this.Wc[mb]||0===this.Wc[mb].Eb);)mb++;for(var mb=Math.min(mb,xd-1),oe=-this.Wc[mb].rb,Db=t.xl(),jb=0;jb<Pc;jb++)if(Xd[jb]){var xd=Xd[jb].length,lc=this.ne(jb);ne=lc.rb+Me+Gd+xl(lc);for(var yd=0;yd<xd;yd++)if(Xd[jb][yd]){var sc=this.me(yd);Yd=sc.rb+oe+Lb+xl(sc);for(var Mb=Xd[jb][yd],Ne=Mb.length,kb=0;kb<Ne;kb++){var cb=
Mb[kb],Jf=cb.Ea;if(cb instanceof B&&(cb.type===bk||cb.type===ck)){Uj(cb);cb.Fb.Ua();var Dc=cb.Fb;Dc.x=cb.type===bk?Lb:Yd;Dc.y=cb.type===ck?Gd:ne;Dc.width=Jf.width;Dc.height=Jf.height;cb.Fb.freeze();Xj(cb,!1)}else{Db.q(0,0);for(var Hd=1;Hd<cb.rowSpan&&!(jb+Hd>=this.Kw);Hd++){var ma=this.ne(jb+Hd);Db.height+=ma.total}for(Hd=1;Hd<cb.tD&&!(yd+Hd>=this.Sv);Hd++){var na=this.me(yd+Hd);Db.width+=na.total}var gg=sc.Eb+Db.width,Eg=lc.Eb+Db.height;k.x=Yd;k.y=ne;k.width=gg;k.height=Eg;ne+Eg>e.height&&(Eg=Math.max(e.height-
ne,0));Yd+gg>e.width&&(gg=Math.max(e.width-Yd,0));var Qc=Yd,nh=ne,fc=gg,oh=Eg,Rc=cb.alignment,Zd,Ec,id,yc;if(Rc.Gc()){Rc=this.Yj;Rc.rd()||(Rc=Vb);Zd=Rc.x;Ec=Rc.y;id=Rc.offsetX;yc=Rc.offsetY;var jd=sc.alignment,Kf=lc.alignment;jd.rd()&&(Zd=jd.x,id=jd.offsetX);Kf.rd()&&(Ec=Kf.y,yc=Kf.offsetY)}else Zd=Rc.x,Ec=Rc.y,id=Rc.offsetX,yc=Rc.offsetY;if(isNaN(Zd)||isNaN(Ec))Ec=Zd=0.5,yc=id=0;var fa=Jf.width,Id=Jf.height,hg=cb.He,nj=cb.Ye,fa=Math.min(hg.width,fa),Id=Math.min(hg.height,Id),fa=Math.max(nj.width,
fa),Id=Math.max(nj.height,Id),ig=cb.margin,Sc=ig.left+ig.right,pb=ig.top+ig.bottom,lb=pk(cb,lc,sc);if(isNaN(cb.Ca.width)&&isNaN(sc.width)&&lb===Nc||lb===Kj)fa=Math.max(gg-Sc,0);if(isNaN(cb.Ca.height)&&isNaN(lc.height)&&lb===Nc||lb===Jj)Id=Math.max(Eg-pb,0);var oj=Id+pb;k.x+=k.width*Zd-(fa+Sc)*Zd+id+ig.left;k.y+=k.height*Ec-oj*Ec+yc+ig.top;cb.visible&&(Eb(Qc,nh,fc,oh,k.x,k.y,fa,Id)?cb.Dc(k.x,k.y,fa,Id):cb.Dc(k.x,k.y,fa,Id,new D(Qc,nh,fc,oh)))}}}}t.dk(Db);for(jb=0;jb<h;jb++)cb=g.p[jb],cb instanceof
B&&(cb.type===bk||cb.type===ck)&&(Dc=cb.Fb,cb.Mc.Ua(),cb.Mc.Ep(0,0,Dc.width,Dc.height),cb.Mc.freeze());break;case "Viewbox":var ph=g.p[0],jg=ph.Ea,kg=ph.margin,mc=kg.top+kg.bottom,Lf=Math.max(jg.width+(kg.right+kg.left),0),Mf=Math.max(jg.height+mc,0),Zb=ph.alignment;Zb.Gc()&&(Zb=this.Yj);Zb.rd()||(Zb=Vb);k.x=e.width*Zb.x-Lf*Zb.x+Zb.offsetX;k.y=e.height*Zb.y-Mf*Zb.y+Zb.offsetY;k.width=jg.width;k.height=jg.height;ph.Dc(k.x,k.y,k.width,k.height);break;case "Link":var qh=this.Fq(),Nf=0;if(null!==qh&&
Nf<this.Yh.count){var pe=this.Yh.p[Nf];Nf++;qh.Dc(pe.x-this.Ai.x,pe.y-this.Ai.y,pe.width,pe.height)}for(var ki=0;ki<h;ki++){var Oe=g.p[ki];Oe!==qh&&Nf<this.Yh.count&&(pe=this.Yh.p[Nf],Nf++,Oe.Dc(pe.x-this.Ai.x,pe.y-this.Ai.y,pe.width,pe.height))}var Pe=this.jy(),Qe=Pe.count;if(2<=Qe&&this.ff)for(var $d=this.Ui;$d.next();){var Nb=$d.value,rh=Qe,sh=Pe,qe=Nb.tf,Fg=Nb.tt,lg=Nb.Rj;lg.qd()&&(lg=Vb);var vb=Nb.ut,pf=Nb.VA,Jd=void 0,qf=void 0,ae=0;if(qe<-rh||qe>=rh){var tc=this.SE,Of=this.RE;vb!==Ig&&(ae=
this.computeAngle(Nb,vb,Of),Nb.angle=ae);Jd=tc.x;qf=tc.y}else{var uc=void 0,ld=void 0;if(0<=qe)uc=sh.p[qe],ld=qe<rh-1?sh.p[qe+1]:uc;else var mg=rh+qe,uc=sh.p[mg],ld=0<mg?sh.p[mg-1]:uc;Of=0<=qe?uc.Li(ld):ld.Li(uc);vb!==Ig&&(ae=this.computeAngle(Nb,vb,Of),Nb.angle=ae);Jd=uc.x+(ld.x-uc.x)*Fg;qf=uc.y+(ld.y-uc.y)*Fg}var be=t.ah();be.reset();be.scale(Nb.scale,Nb.scale);be.rotate(Nb.angle,0,0);var Pf=Nb.Ia,rf=t.lk(0,0,Pf.width,Pf.height),Re=t.O();Re.wt(rf,lg);be.Va(Re);var ce=-Re.x,de=-Re.y,Se=pf.copy();
isNaN(Se.x)&&(Se.x=0<=qe?Re.x+3:-(Re.x+3));isNaN(Se.y)&&(Se.y=-(Re.y+3));Se.rotate(Of);Jd+=Se.x;qf+=Se.y;be.TF(rf);var ce=ce+rf.x,de=de+rf.y,th=t.ic(Jd+ce,qf+de);Nb.move(th);t.B(th);t.B(Re);t.Rc(rf);t.Se(be)}this.zw();break;case "Grid":break;case "TableRow":case "TableColumn":t.l(this.toString()+" is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");break;default:t.l("Unknown panel type: "+x)}t.Rc(k)}};
B.prototype.Vj=function(a){var b=this.Ia;if(Eb(0,0,b.width,b.height,a.x,a.y)){for(var c=this.za.length,b=t.ic(0,0);c--;){var d=this.za.p[0];if(d.visible||d===this.Ub)if(ab(b.set(a),d.transform),d.Ha(b))return t.B(b),!0}t.B(b);return null===this.Gb&&null===this.jc?!1:!0}return!1};function yl(a,b,c){c(a,b);if(b instanceof B)for(b=b.elements;b.next();)yl(a,b.value,c)}function Li(a,b){zl(a,a,b)}function zl(a,b,c){c(b);for(b=b.elements;b.next();){var d=b.value;d instanceof B&&zl(a,d,c)}}
function Al(a,b,c){if(c(b))return b;if(b instanceof B)for(b=b.elements;b.next();){var d=Al(a,b.value,c);if(null!==d)return b.Fg(),d}return null}B.prototype.findObject=B.prototype.le=function(a){if(this.name===a)return this;for(var b=this.za.p,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof B)if(!e.AE()){if(e=e.le(a),null!==e)return e}else if(Bl(e)&&(e=e.za.eb(),null!==e&&(e=e.le(a),null!==e)))return e}return null};function af(a,b){return b(a)?a:Cl(a,b)}
function Cl(a,b){for(var c=a.elements;c.next();){var d=c.value;if(b(d))return d;if(d instanceof B&&(d=Cl(d,b),null!==d))return d}return null}
function Dl(a){a=a.za.p;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof B)c=Math.max(c,Dl(e));else if(e instanceof Y){a:{if(!e.Qg)switch(e.Hn){case "None":case "Square":case "Ellipse":case "Circle":case "LineH":case "LineV":case "FramedRectangle":case "RoundedRectangle":case "Line1":case "Line2":case "Border":case "Cube1":case "Cube2":case "Junction":case "Cylinder1":case "Cylinder2":case "Cylinder3":case "Cylinder4":case "PlusLine":case "XLine":case "ThinCross":case "ThickCross":e=0;
break a}e=e.fe/2*e.qm*e.fk()}c=Math.max(c,e)}}return c}aa=B.prototype;aa.bh=function(){return!(this.type===bk||this.type===ck)};
aa.Rd=function(a,b,c){if(!1===this.Ze)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Bi(this))return null;var d=this.Ia,e=1/this.fk(),g=this.bh(),h=g?a:ab(t.ic(a.x,a.y),this.transform);if(Eb(-(5*e),-(5*e),d.width+10*e,d.height+10*e,h.x,h.y)){if(!this.Ig){for(var k=this.za.length,e=t.O();k--;){var l=this.za.p[k];if(l.visible||l===this.Ub){l.bh()?ab(e.set(a),l.transform):e.set(a);var m=null;l instanceof B?m=l.Rd(e,b,c):!0===l.Ze&&l.Ha(e)&&(m=l);if(null!==m&&(null!==b&&(m=b(m)),m&&(null===
c||c(m))))return t.B(e),g||t.B(h),m}}t.B(e)}if(null===this.background&&null===this.Ci)return g||t.B(h),null;a=Eb(0,0,d.width,d.height,h.x,h.y)?this:null;g||t.B(h);return a}g||t.B(h);return null};
aa.Oo=function(a,b,c,d){if(!1===this.Ze)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof ua||(d=new H(X));var e=this.Ia,g=this.bh(),h=g?a:ab(t.ic(a.x,a.y),this.transform);if(Eb(0,0,e.width,e.height,h.x,h.y)){if(!this.Ig){for(var k=this.za.length,e=t.O();k--;){var l=this.za.p[k];if(l.visible||l===this.Ub)l.bh()?ab(e.set(a),l.transform):e.set(a),(l instanceof B?l.Oo(e,b,c,d):l.Ha(e))&&!1!==l.Ze&&(null!==b&&(l=b(l)),l&&(null===c||c(l))&&d.add(l))}t.B(e)}g||t.B(h);return null!==
this.background||null!==this.Ci}g||t.B(h);return!1};
aa.ck=function(a,b,c,d,e,g){if(!1===this.Ze)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=t.ah(),h.reset());h.multiply(this.transform);if(this.Em(a,h))return El(this,b,c,e),void 0===g&&t.Se(h),!0;if(this.If(a,h)){if(!this.Ig)for(var k=this.za.length;k--;){var l=this.za.p[k];if(l.visible||l===this.Ub){var m=l.ya,n=this.Ia;if(!(m.x>n.width||m.y>n.height||0>m.x+m.width||0>m.y+m.height)){m=t.ah();m.set(h);if(l instanceof B?l.ck(a,b,c,d,e,m):Rj(l,a,d,m))null!==b&&(l=b(l)),l&&
(null===c||c(l))&&e.add(l);t.Se(m)}}}void 0===g&&t.Se(h);return d}void 0===g&&t.Se(h);return!1};function El(a,b,c,d){for(var e=a.za.length;e--;){var g=a.za.p[e];if(g.visible){var h=g.ya,k=a.Ia;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof B&&El(g,b,c,d),null!==b&&(g=b(g)),g&&(null===c||c(g))&&d.add(g))}}}
aa.Lm=function(a,b,c,d,e,g){if(!1===this.Ze)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ia,k=this.bh(),l=k?a:ab(t.ic(a.x,a.y),this.transform),m=k?b:ab(t.ic(b.x,b.y),this.transform),n=l.$j(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||db(l.x,l.y,0,0,0,h.height)<n||db(l.x,l.y,0,h.height,h.width,h.height)<n||db(l.x,l.y,h.width,h.height,h.width,0)<n||db(l.x,l.y,h.width,0,0,0)<n,h=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height&&db(l.x,l.y,0,0,0,h.height)<n&&db(l.x,l.y,0,h.height,h.width,h.height)<
n&&db(l.x,l.y,h.width,h.height,h.width,0)<n&&db(l.x,l.y,h.width,0,0,0)<n;k||(t.B(l),t.B(m));if(p){if(!this.Ig){k=t.O();l=t.O();for(m=this.za.length;m--;)if(n=this.za.p[m],n.visible||n===this.Ub){var q=n.ya,r=this.Ia;q.x>r.width||q.y>r.height||0>q.x+q.width||0>q.y+q.height||(n.bh()?(q=n.transform,ab(k.set(a),q),ab(l.set(b),q)):(k.set(a),l.set(b)),n instanceof B?!n.Lm(k,l,c,d,e,g):!n.XD(k,l,e))||(null!==c&&(n=c(n)),n&&(null===d||d(n))&&g.add(n))}t.B(k);t.B(l)}return e?p:h}return!1};
function ql(a){var b=a.G;if(void 0===b||b===Qb)b=null;null===b&&a instanceof Y&&(a=a.Ra,null!==a&&(b=a.G));null===b&&(b=Sb);return b}function rl(a){var b=a.H;if(void 0===b||b===Qb)b=null;null===b&&a instanceof Y&&(a=a.Ra,null!==a&&(b=a.H));null===b&&(b=$b);return b}B.prototype.add=B.prototype.add=function(a){t.m(a,X,B,"add:element");this.Ad(this.za.count,a)};B.prototype.elt=B.prototype.qa=function(a){return this.za.qa(a)};
B.prototype.insertAt=B.prototype.Ad=function(a,b){b instanceof w&&t.l("Cannot add a Part to a Panel: "+b);if(this===b||this.Ti(b))this===b&&t.l("Cannot make a Panel contain itself: "+this.toString()),t.l("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.ga;null!==c&&c!==this&&t.l("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+
this.toString());this.ba!==bi||b instanceof Y||t.l("Can only add Shapes to a Grid Panel, not: "+b);b.ul(this);b.fm=null;if(null!==this.Xs){var d=b.data;null!==d&&"object"===typeof d&&(null===this.Zf&&(this.Zf=new sa(Object,B)),this.Zf.add(d,b))}var e=this.za,d=-1;if(c===this){for(var g=-1,h=e.count,k=0;k<h;k++)if(e.p[k]===b){g=k;break}if(-1!==g){if(g===a||g+1>=e.count&&a>=e.count)return;e.gd(g);d=g}else t.l("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||
a>e.count)a=e.count;e.Ad(a,b);this.aa();b.aa();null!==b.sd&&(this.qj=!0);b instanceof B&&!0===b.qj&&(this.qj=!0);c=this.U;null!==c&&(c.Bj=null,c.zj=NaN,null!==b.sd&&c instanceof y&&(c.qj=!0),e=this.h,null!==e&&e.Aa.qb||(-1!==d&&c.Vc(Md,"elements",this,b,null,d,null),c.Vc(Dd,"elements",this,null,b,null,a)))};B.prototype.remove=B.prototype.remove=function(a){t.m(a,X,B,"remove:element");for(var b=this.za,c=b.count,d=-1,e=0;e<c;e++)if(b.p[e]===a){d=e;break}-1!==d&&this.Te(d)};
B.prototype.removeAt=B.prototype.gd=function(a){f&&t.o(a,B,"removeAt:idx");0<=a&&this.Te(a)};B.prototype.Te=function(a){var b=this.za,c=b.qa(a);c.fm=null;c.ul(null);if(null!==this.Zf){var d=c.data;"object"===typeof d&&this.Zf.remove(d)}b.gd(a);Tj(this,!1);this.aa();b=this.U;null!==b&&(b.Bj=null,b.zj=NaN,d=this.h,null!==d&&d.Aa.qb||b.Vc(Md,"elements",this,c,null,a,null))};t.A(B,{Kw:"rowCount"},function(){return void 0===this.$c?0:this.$c.length});
B.prototype.getRowDefinition=B.prototype.ne=function(a){if(void 0===this.$c)return null;f&&t.o(a,B,"getRowDefinition:idx");0>a&&t.ha(a,">= 0",B,"getRowDefinition:idx");a=Math.round(a);var b=this.$c;if(void 0===b[a]){var c=new Ek;c.ul(this);c.Sl=!0;c.te=a;b[a]=c}return b[a]};B.prototype.removeRowDefinition=function(a){if(void 0!==this.$c){f&&t.o(a,B,"removeRowDefinition:idx");0>a&&t.ha(a,">= 0",B,"removeRowDefinition:idx");a=Math.round(a);var b=this.$c;b[a]&&(b[a]=void 0)}};
t.A(B,{Sv:"columnCount"},function(){return void 0===this.Wc?0:this.Wc.length});B.prototype.getColumnDefinition=B.prototype.me=function(a){if(void 0===this.Wc)return null;f&&t.o(a,B,"getColumnDefinition:idx");0>a&&t.ha(a,">= 0",B,"getColumnDefinition:idx");a=Math.round(a);var b=this.Wc;if(void 0===b[a]){var c=new Ek;c.ul(this);c.Sl=!1;c.te=a;b[a]=c}return b[a]};
B.prototype.removeColumnDefinition=function(a){if(void 0!==this.Wc){f&&t.o(a,B,"removeColumnDefinition:idx");0>a&&t.ha(a,">= 0",B,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Wc;b[a]&&(b[a]=void 0)}};t.g(B,"rowSizing",B.prototype.qF);
t.defineProperty(B,{qF:"rowSizing"},function(){return void 0===this.km?il:this.km},function(a){if(void 0!==this.km){var b=this.km;b!==a&&(a!==il&&a!==vl&&t.l("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.km=a,this.aa(),this.i("rowSizing",b,a))}});t.g(B,"columnSizing",B.prototype.sD);
t.defineProperty(B,{sD:"columnSizing"},function(){return void 0===this.Gl?il:this.Gl},function(a){if(void 0!==this.Gl){var b=this.Gl;b!==a&&(a!==il&&a!==vl&&t.l("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"),this.Gl=a,this.aa(),this.i("columnSizing",b,a))}});t.g(B,"topIndex",B.prototype.mB);
t.defineProperty(B,{mB:"topIndex"},function(){return void 0===this.zi?0:this.zi},function(a){if(void 0!==this.zi){var b=this.zi;b!==a&&((!isFinite(a)||0>a)&&t.l("topIndex must be greater than zero and a real number. Was "+a),this.zi=a,this.aa(),this.i("topIndex",b,a))}});t.g(B,"leftIndex",B.prototype.oA);
t.defineProperty(B,{oA:"leftIndex"},function(){return void 0===this.ji?0:this.ji},function(a){if(void 0!==this.ji){var b=this.ji;b!==a&&((!isFinite(a)||0>a)&&t.l("leftIndex must be greater than zero and a real number. Was "+a),this.ji=a,this.aa(),this.i("leftIndex",b,a))}});B.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.$c,d=c.length,e=this.zi;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};
B.prototype.findColumnForLocalX=function(a){if(0>a)return-1;if(this.type!==ea)return NaN;for(var b=0,c=this.Wc,d=c.length,e=this.ji;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};t.g(B,"data",B.prototype.data);
t.defineProperty(B,{data:"data"},function(){return this.Kl},function(a){var b=this.Kl;if(b!==a){var c=this instanceof w&&!(this instanceof Ve);c&&t.j(a,"object",B,"data");Xe(this);this.Kl=a;var d=this.h;null!==d&&(c?this instanceof A?(null!==b&&d.Dk.remove(b),null!==a&&d.Dk.add(a,this)):(null!==b&&d.ci.remove(b),null!==a&&d.ci.add(a,this)):(c=this.ga,null!==c&&null!==c.Zf&&(null!==b&&c.Zf.remove(b),null!==a&&c.Zf.add(a,this))));this.i("data",b,a);null!==d&&d.Aa.qb||null!==a&&this.Jb()}});
function yk(a){a=a.Fl;return null!==a&&a.jb}
function Xe(a){var b=a.Fl;if(null===b)null!==a.data&&t.l("Template cannot have .data be non-null: "+a),a.Fl=b=new H(De);else if(b.jb)return;var c=new H(X);yl(a,a,function(a,d){var e=d.Bc;if(null!==e){rk(d,!1);for(var g=e.k;g.next();){e=g.value;e.mode===Fe&&rk(d,!0);var h=e.zt;if(null!==h){var q=a;""!==h&&(q=a.le(h));null!==q&&(c.add(q),void 0===q.as&&(q.as=new H(De)),q.as.add(e))}b.add(e)}}if(d instanceof B&&d.type===ea){if(0<d.$c.length)for(g=d.$c,h=g.length,q=0;q<h;q++){var r=g[q];if(void 0!==r&&
null!==r.Bc)for(var s=r.Bc.k;s.next();)e=s.value,e.eg=r,e.hz=2,e.tv=r.index,b.add(e)}if(0<d.Wc.length)for(g=d.Wc,h=g.length,q=0;q<h;q++)if(r=g[q],void 0!==r&&null!==r.Bc)for(s=r.Bc.k;s.next();)e=s.value,e.eg=r,e.hz=1,e.tv=r.index,b.add(e)}});for(var d=c.k;d.next();){var e=d.value;if(void 0!==e.as){rk(e,!0);for(var g=e.as.k;g.next();){var h=g.value;null===e.Bc&&(e.Bc=new H(De));e.Bc.add(h)}}delete e.as}for(d=b.k;d.next();)e=d.value,g=e.eg,null!==g&&(e.eg=null,g===a?e.en="":(g instanceof Ek&&(g=g.ga),
e.en=""!==g.name?g.name:g.name="_"+t.oc(g)));b.freeze();a instanceof w&&a.Ud()&&(Dh(a,Infinity,Infinity),a.Dc())}
B.prototype.updateTargetBindings=B.prototype.Jb=function(a){var b=this.Fl;if(null!==b)for(void 0===a&&(a=""),b=b.k;b.next();){var c=b.value,d=c.eB;if(""===a||d===a)if(d=c.Ct,null!==c.wD||""!==d){var d=this.data,e=c.zt;null!==e&&(d=this.le(e));if(null===d)f&&t.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var e=this,g=c.en;if(""!==g){if(e=this.le(g),null===e)continue}else null!==c.eg&&(e=c.eg);g=c.hz;if(0!==g){if(!(e instanceof B))continue;1===g?e=e.me(c.tv):2===
g&&(e=e.ne(c.tv))}void 0!==e&&c.$F(e,d)}}}};t.g(B,"itemArray",B.prototype.Xs);t.defineProperty(B,{Xs:"itemArray"},function(){return this.tj},function(a){var b=this.tj;if(b!==a){f&&null!==a&&!t.isArray(a)&&t.l("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.h;null!==c&&null!==b&&Oi(c,this);this.tj=a;null!==c&&null!==a&&Mi(c,this);this.i("itemArray",b,a);null!==c&&c.Aa.qb||this.LA()}});function Bl(a){return a.type===Ug||a.type===Xh||a.type===Cg}
B.prototype.rebuildItemElements=B.prototype.LA=function(){var a=0;for(Bl(this)&&(a=1);this.za.length>a;)this.Te(a);a=this.Xs;if(null!==a)for(var b=t.yb(a),c=0;c<b;c++)$i(this,t.sb(a,c),c)};function $i(a,b,c){if(void 0!==b&&null!==b){var d=a.getCategoryForItemData(b,c),e=a.findTemplateForItemData(b,c,d);e instanceof B&&(Xe(e),e=e.copy(),"object"===typeof b&&(null===a.Zf&&(a.Zf=new sa(Object,B)),a.Zf.add(b,e)),a.type!==Ug&&a.type!==Xh||c++,a.Ad(c,e),Fl(e,c),aj(a,c),e.By=d,e.data=b)}}
function aj(a,b){for(var c=a.za,d=b+1;d<c.length;){var e=c.qa(d);e instanceof B&&Fl(e,d);d++}}function Fl(a,b){a.type===bk?a.gc=b:a.type===ck&&(a.column=b)}B.prototype.isItemPanel=B.prototype.AE=function(){return null!==this.tj||null!==this.Jg};t.g(B,"itemTemplate",B.prototype.vI);
t.defineProperty(B,{vI:"itemTemplate"},function(){return null===this.Jg?null:this.Jg.Ba("")},function(a){if(null===this.Jg){if(null===a)return;this.Jg=new sa("string",B)}var b=this.Jg.Ba("");b!==a&&(t.m(a,B,B,"itemTemplate"),a instanceof w&&t.l("itemTemplate must not be a Part: "+a),this.Jg.add("",a),this.i("itemTemplate",b,a),a=this.h,null!==a&&a.Aa.qb||this.LA())});t.g(B,"itemTemplateMap",B.prototype.DE);
t.defineProperty(B,{DE:"itemTemplateMap"},function(){return this.Jg},function(a){var b=this.Jg;if(b!==a){t.m(a,sa,B,"itemTemplateMap");for(var c=a.k;c.next();){var d=c.value;d instanceof w&&t.l("Template in itemTemplateMap must not be a Part: "+d)}this.Jg=a;this.i("itemTemplateMap",b,a);a=this.h;null!==a&&a.Aa.qb||this.LA()}});t.g(B,"itemCategoryProperty",B.prototype.uI);
t.defineProperty(B,{uI:"itemCategoryProperty"},function(){return this.Sn},function(a){var b=this.Sn;b!==a&&("string"!==typeof a&&"function"!==typeof a&&t.Vb(a,"string or function",B,"itemCategoryProperty"),this.Sn=a,this.i("itemCategoryProperty",b,a))});
B.prototype.getCategoryForItemData=function(a){if(null===a)return"";var b=this.Sn;if("function"===typeof b)b=b(a);else if("string"===typeof b&&"object"===typeof a){if(""===b)return"";b=t.hb(a,b)}else return"";if(void 0===b)return"";if("string"===typeof b)return b;t.l("Panel.getCategoryForItemData found a non-string category for "+a+": "+b);return""};
B.prototype.findTemplateForItemData=function(a,b,c){a=this.DE;b=null;null!==a&&(b=a.Ba(c));null===b&&(t.eG||(t.eG=!0,t.trace('No item template Panel found for category "'+c+'" on '+this),t.trace("  Using default item template."),c=new B,a=new va,a.bind(new De("text","",la)),c.add(a),t.FD=c),b=t.FD);return b instanceof B?b:null};t.g(B,"isAtomic",B.prototype.lI);
t.defineProperty(B,{lI:"isAtomic"},function(){return this.Ig},function(a){var b=this.Ig;b!==a&&(t.j(a,"boolean",B,"isAtomic"),this.Ig=a,this.i("isAtomic",b,a))});t.g(B,"opacity",B.prototype.opacity);t.defineProperty(B,{opacity:"opacity"},function(){return this.Df},function(a){var b=this.Df;b!==a&&(t.j(a,"number",B,"opacity"),(0>a||1<a)&&t.ha(a,"0 <= val <= 1",B,"opacity"),this.Df=a,this.i("opacity",b,a),a=this.h,b=this.U,null!==a&&null!==b&&a.pa(Lh(b,b.ya)))});
function Ek(){t.zc(this);this.si=null;this.Sl=!0;this.te=0;this.Ef=NaN;this.$l=0;this.Zl=Infinity;this.re=Qb;this.rb=this.Eb=0;this.Bc=null;this.Yr=Gl;this.zh=Xg;this.Vr=this.Kj=null;this.Wr=NaN;this.Gb=this.vh=null;this.mq=!1}t.ia("RowColumnDefinition",Ek);
Ek.prototype.copy=function(){var a=new Ek;a.Sl=this.Sl;a.te=this.te;a.Ef=this.Ef;a.$l=this.$l;a.Zl=this.Zl;a.re=this.re;a.Eb=this.Eb;a.rb=this.rb;a.zh=this.zh;a.Yr=this.Yr;a.Kj=null===this.Kj?null:this.Kj.Z();a.Vr=this.Vr;a.Wr=this.Wr;a.vh=null;this.vh&&(a.vh=this.vh.slice(0));a.Gb=this.Gb;a.mq=this.mq;a.Bc=this.Bc;return a};Ek.prototype.toString=function(){return"RowColumnDefinition "+(this.Kh?"(Row ":"(Column ")+this.index+") #"+t.oc(this)};var Gl;Ek.Default=Gl=t.w(Ek,"Default",0);var vl;
Ek.None=vl=t.w(Ek,"None",1);var il;Ek.ProportionalExtra=il=t.w(Ek,"ProportionalExtra",2);Ek.prototype.ul=function(a){this.si=a};function tl(a,b){a.Eb=isNaN(a.Ef)?Math.max(Math.min(a.Zl,b),a.$l):Math.max(Math.min(a.Zl,a.Ef),a.$l)}function xl(a){var b=a.si,c=a.bn;null===c&&(c=a.Kh?b.di:b.jh);var d=a.cn;isNaN(d)&&(d=a.Kh?b.lh:b.kh);d=null!==c?d:0;0===a.index&&(d=0);c=a.XA;null===c&&(c=b.ij);return d+(a.Kh?c.top:c.left)}
function pl(a){var b=a.si,c=a.bn;null===c&&(c=a.Kh?b.di:b.jh);var d=a.cn;isNaN(d)&&(d=a.Kh?b.lh:b.kh);d=null!==c?d:0;0===a.index&&(d=0);c=a.XA;null===c&&(c=b.ij);return d+(a.Kh?c.top+c.bottom:c.left+c.right)}
Ek.prototype.Nc=function(a,b,c,d,e){var g=this.si;if(null!==g){g.aa();for(var h=this.Kh,k=g.za,l=k.length,m=0;m<l;m++){var n=k.p[m];(h?n.gc:n.column)===this.index&&n.aa()}g.Vc(Cd,a,this,b,c,d,e);if(null!==this.Bc&&(b=g.Qo(),null!==b&&(b=b.data,null!==b)))for(c=this.Bc.k;c.next();)c.value.ZF(this,b,a,null)}};t.A(Ek,{ga:"panel"},function(){return this.si});t.A(Ek,{Kh:"isRow"},function(){return this.Sl});t.A(Ek,{index:"index"},function(){return this.te});t.g(Ek,"height",Ek.prototype.height);
t.defineProperty(Ek,{height:"height"},function(){return this.Ef},function(a){var b=this.Ef;b!==a&&(f&&t.j(a,"number",Ek,"height"),0>a&&t.ha(a,">= 0",Ek,"height"),this.Ef=a,tl(this,this.Eb),this.Nc("size",b,a))});t.g(Ek,"width",Ek.prototype.width);t.defineProperty(Ek,{width:"width"},function(){return this.Ef},function(a){var b=this.Ef;b!==a&&(f&&t.j(a,"number",Ek,"width"),0>a&&t.ha(a,">= 0",Ek,"width"),this.Ef=a,tl(this,this.Eb),this.Nc("size",b,a))});t.g(Ek,"minimum",Ek.prototype.Nh);
t.defineProperty(Ek,{Nh:"minimum"},function(){return this.$l},function(a){var b=this.$l;b!==a&&(f&&t.j(a,"number",Ek,"minimum"),(0>a||!isFinite(a))&&t.ha(a,">= 0",Ek,"minimum"),this.$l=a,tl(this,this.Eb),this.Nc("minimum",b,a))});t.g(Ek,"maximum",Ek.prototype.qf);t.defineProperty(Ek,{qf:"maximum"},function(){return this.Zl},function(a){var b=this.Zl;b!==a&&(f&&t.j(a,"number",Ek,"maximum"),0>a&&t.ha(a,">= 0",Ek,"maximum"),this.Zl=a,tl(this,this.Eb),this.Nc("maximum",b,a))});t.g(Ek,"alignment",Ek.prototype.alignment);
t.defineProperty(Ek,{alignment:"alignment"},function(){return this.re},function(a){var b=this.re;b.N(a)||(f&&t.m(a,K,Ek,"alignment"),this.re=a.Z(),this.Nc("alignment",b,a))});t.g(Ek,"stretch",Ek.prototype.Rh);t.defineProperty(Ek,{Rh:"stretch"},function(){return this.zh},function(a){var b=this.zh;b!==a&&(f&&t.tb(a,X,Ek,"stretch"),this.zh=a,this.Nc("stretch",b,a))});t.g(Ek,"separatorPadding",Ek.prototype.XA);
t.defineProperty(Ek,{XA:"separatorPadding"},function(){return this.Kj},function(a){"number"===typeof a?a=new sb(a):null!==a&&f&&t.m(a,sb,Ek,"separatorPadding");var b=this.Kj;null!==a&&null!==b&&b.N(a)||(null!==a&&(a=a.Z()),this.Kj=a,this.Nc("separatorPadding",b,a))});t.g(Ek,"separatorStroke",Ek.prototype.bn);
t.defineProperty(Ek,{bn:"separatorStroke"},function(){return this.Vr},function(a){var b=this.Vr;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.Vr=a,this.ga&&this.ga.pa(),this.Nc("separatorStroke",b,a))});t.g(Ek,"separatorStrokeWidth",Ek.prototype.cn);t.defineProperty(Ek,{cn:"separatorStrokeWidth"},function(){return this.Wr},function(a){var b=this.Wr;b!==a&&(this.Wr=a,this.ga&&this.ga.pa(),this.Nc("separatorStrokeWidth",b,a))});
t.g(Ek,"separatorDashArray",Ek.prototype.wF);t.defineProperty(Ek,{wF:"separatorDashArray"},function(){return this.vh},function(a){var b=this.vh;b!==a&&(Array.isArray(a)||t.Vb(a,"Array",Ek,"separatorDashArray:val"),this.vh=a,this.ga&&this.ga.pa(),this.Nc("separatorDashArray",b,a))});t.g(Ek,"background",Ek.prototype.background);
t.defineProperty(Ek,{background:"background"},function(){return this.Gb},function(a){var b=this.Gb;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.Gb=a,this.ga&&this.ga.pa(),this.Nc("background",b,a))});t.g(Ek,"coversSeparators",Ek.prototype.Xv);t.defineProperty(Ek,{Xv:"coversSeparators"},function(){return this.mq},function(a){var b=this.mq;b!==a&&(t.j(a,"boolean",Ek,"coversSeparators"),this.mq=a,this.Nc("coversSeparators",b,a))});t.g(Ek,"sizing",Ek.prototype.yt);
t.defineProperty(Ek,{yt:"sizing"},function(){return this.Yr},function(a){var b=this.Yr;b!==a&&(f&&t.tb(a,Ek,Ek,"sizing"),this.Yr=a,this.Nc("sizing",b,a))});function ul(a){if(a.yt===Gl){var b=a.si;return a.Kh?b.qF:b.sD}return a.yt}t.A(Ek,{Yb:"actual"},function(){return this.Eb});t.A(Ek,{total:"total"},function(){return this.Eb+pl(this)});t.A(Ek,{position:"position"},function(){return this.rb});
Ek.prototype.bind=Ek.prototype.bind=function(a){a.eg=this;var b=this.ga;null!==b&&(b=b.Qo(),null!==b&&yk(b)&&t.l("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a));null===this.Bc&&(this.Bc=new H(De));this.Bc.add(a)};
function Y(){X.call(this);this.Ra=null;this.Hn="None";this.Qg=!1;this.Eq=Xg;this.Bk=null;this.xb=this.Kc="black";this.fe=1;this.oo="butt";this.po="miter";this.qm=10;this.pm=null;this.ad=0;this.xi=this.wi=Qb;this.wr=this.vr=0;this.Jq=!1;this.Oq=!0;this.yr=null;this.Jn=this.ro="None";this.Iq=1}t.ia("Shape",Y);t.Oa(Y,X);
Y.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Ra=this.Ra;a.Hn=this.Hn;a.Qg=this.Qg;a.Eq=this.Eq;a.Bk=this.Bk;a.Kc=this.Kc;a.xb=this.xb;a.fe=this.fe;a.oo=this.oo;a.po=this.po;a.qm=this.qm;a.pm=null;this.pm&&(a.pm=this.pm.slice(0));a.ad=this.ad;a.wi=this.wi.Z();a.xi=this.xi.Z();a.vr=this.vr;a.wr=this.wr;a.Jq=this.Jq;a.Oq=this.Oq;a.yr=this.yr;a.ro=this.ro;a.Jn=this.Jn;a.Iq=this.Iq};
Y.prototype.toString=function(){return"Shape("+("None"!==this.Ib?this.Ib:"None"!==this.fn?this.fn:this.jw)+")#"+t.oc(this)};
function Hl(a,b,c,d){var e=0.001,g=d.Ea,h=g.width,g=g.height,k,l,m,n=c.length;if(!(2>n)){k=c[0][0];l=c[0][1];for(var p,q,r,s,v=0,x=t.Cb(),E=1;E<n;E++)p=c[E],e=p[0],m=p[1],p=e-k,k=m-l,0===p&&(p=0.001),q=k/p,s=Math.atan2(k,p),k=Math.sqrt(p*p+k*k),x.push([p,s,q,k]),v+=k,k=e,l=m;k=c[0][0];l=c[0][1];c=0;e=h;n=h/2;E=0===n?!1:!0;m=0;r=x[m];p=r[0];s=r[1];q=r[2];r=r[3];for(var F=0;0.1<=v;){0===F&&(E?(e=h,c++,e-=n,v-=n,E=!1):(e=h,c++),0===e&&(e=1));if(e>v){t.Da(x);return}e>r?(F=e-r,e=r):F=0;var G=Math.sqrt(e*
e/(1+q*q));0>p&&(G=-G);k+=G;l+=q*G;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(g/2));0===F&&d.hl(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);v-=e;r-=e;if(0!==F){m++;if(m===x.length){t.Da(x);return}r=x[m];p=r[0];s=r[1];q=r[2];r=r[3];e=F}}t.Da(x)}}
Y.prototype.hl=function(a,b){if(null!==this.xb||null!==this.Kc){null!==this.Kc&&fk(this,a,this.Kc,!0);null!==this.xb&&fk(this,a,this.xb,!1);var c=this.fe;if(0===c){var d=this.U;d instanceof Ve&&d.type===Cg&&d.Pc instanceof Y&&(c=d.Pc.ib)}a.lineWidth=c;a.lineJoin=this.po;a.lineCap=this.oo;a.miterLimit=this.qm;var e=!1;this.U&&(e=this.U.Lh);var g=!0;null!==this.xb&&null===this.Kc&&(g=!1);var d=!1,h=this.Rw;if(null!==h){var k=d=!0;void 0!==a.setLineDash?(a.setLineDash(h),a.lineDashOffset=this.ad):void 0!==
a.webkitLineDash?(a.webkitLineDash=h,a.webkitLineDashOffset=this.ad):void 0!==a.mozDash?(a.mozDash=h,a.mozDashOffset=this.ad):k=!1}var l=this.Ra;if(null!==l){if(l.ba===Tc)a.beginPath(),d&&!k?Nj(a,l.ec,l.nc,l.md,l.xd,h,this.ad):(a.moveTo(l.ec,l.nc),a.lineTo(l.md,l.xd)),null!==this.Kc&&gk(a,this.Kc,!0),0!==c&&null!==this.xb&&gk(a,this.xb,!1);else if(l.ba===Uc){var m=l.ec,n=l.nc,p=l.md,l=l.xd,q=Math.min(m,p),r=Math.min(n,l),m=Math.abs(p-m),n=Math.abs(l-n);null!==this.Kc&&(this.Kc instanceof fe&&this.Kc.type===
je?(a.beginPath(),a.rect(q,r,m,n),gk(a,this.Kc,!0)):a.fillRect(q,r,m,n));if(null!==this.xb){if(g&&e){var s=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur];a.shadowOffsetX=0;a.shadowOffsetY=0;a.shadowBlur=0}d&&!k?(k=[[q,r],[q+m,r],[q+m,r+n],[q,r+n],[q,r]],a.beginPath(),Il(a,k,h,this.ad),gk(a,this.xb,!1)):0!==c&&(this.xb instanceof fe&&this.xb.type===je?(a.beginPath(),a.rect(q,r,m,n),gk(a,this.xb,!1)):a.strokeRect(q,r,m,n));g&&e&&(a.shadowOffsetX=s[0],a.shadowOffsetY=s[1],a.shadowBlur=s[2])}}else if(l.ba===
Vc)m=l.ec,n=l.nc,p=l.md,l=l.xd,q=Math.abs(p-m)/2,r=Math.abs(l-n)/2,m=Math.min(m,p)+q,n=Math.min(n,l)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+J.va*q,n-r,m+q,n-J.va*r,m+q,n),a.bezierCurveTo(m+q,n+J.va*r,m+J.va*q,n+r,m,n+r),a.bezierCurveTo(m-J.va*q,n+r,m-q,n+J.va*r,m-q,n),a.bezierCurveTo(m-q,n-J.va*r,m-J.va*q,n-r,m,n-r),a.closePath(),null!==this.Kc&&gk(a,this.Kc,!0),d&&!k&&(k=t.Cb(),J.ze(m,n-r,m+J.va*q,n-r,m+q,n-J.va*r,m+q,n,0.5,k),J.ze(m+q,n,m+q,n+J.va*r,m+J.va*q,n+r,m,n+r,0.5,k),J.ze(m,n+
r,m-J.va*q,n+r,m-q,n+J.va*r,m-q,n,0.5,k),J.ze(m-q,n,m-q,n-J.va*r,m-J.va*q,n-r,m,n-r,0.5,k),a.beginPath(),Il(a,k,h,this.ad),t.Da(k)),0!==c&&null!==this.xb&&(g&&e&&(s=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur],a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),gk(a,this.xb,!1),g&&e&&(a.shadowOffsetX=s[0],a.shadowOffsetY=s[1],a.shadowBlur=s[2]));else if(l.ba===Lc){for(var q=l.Fk,r=q.length,v=0;v<r;v++){var x=q.p[v];a.beginPath();a.moveTo(x.na,x.oa);for(var E=x.Ga.p,F=E.length,G=null,L=0;L<F;L++){var N=
E[L];switch(N.ba){case kd:a.moveTo(N.D,N.F);break;case Xc:a.lineTo(N.D,N.F);break;case md:a.bezierCurveTo(N.Og,N.Pg,N.Tk,N.Uk,N.ve,N.we);break;case nd:a.quadraticCurveTo(N.Og,N.Pg,N.ve,N.we);break;case od:if(N.radiusX===N.radiusY)G=Math.PI/180,a.arc(N.rn,N.sn,N.radiusX,N.yg*G,(N.yg+N.Sh)*G,0>N.Sh);else for(var G=qd(N,x),V=G.length,T=0;T<V;T++){var W=G[T];0===T&&a.lineTo(W.x1,W.y1);a.bezierCurveTo(W.x2,W.y2,W.ae,W.be,W.Ob,W.Pb)}break;case pd:G&&G.type===od?(G=qd(G,x),G=G[G.length-1]||null,null!==G&&
(m=G.Ob,p=G.Pb)):(m=G?G.D:x.na,p=G?G.F:x.oa);G=rd(N,x,m,p);V=G.length;for(T=0;T<V;T++)W=G[T],a.bezierCurveTo(W.x2,W.y2,W.ae,W.be,W.Ob,W.Pb);break;default:t.l("Segment not of valid type")}N.ph&&a.closePath();G=N}e?x.Qn?(!0===x.Pl&&null!==this.Kc?(gk(a,this.Kc,!0),g=!0):g=!1,0!==c&&null!==this.xb&&(g&&(s=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur],a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!k||gk(a,this.xb,!1),g&&(a.shadowOffsetX=s[0],a.shadowOffsetY=s[1],a.shadowBlur=s[2]))):(g&&(s=
[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur],a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),!0===x.Pl&&null!==this.Kc&&gk(a,this.Kc,!0),0!==c&&null!==this.xb&&(d&&!k||gk(a,this.xb,!1)),g&&(a.shadowOffsetX=s[0],a.shadowOffsetY=s[1],a.shadowBlur=s[2])):(!0===x.Pl&&null!==this.Kc&&gk(a,this.Kc,!0),0===c||null===this.xb||d&&!k||gk(a,this.xb,!1))}if(d&&!k)for(c=g,s=l.Fk,g=s.length,k=0;k<g;k++){l=s.p[k];a.beginPath();m=t.Cb();m.push([l.na,l.oa]);p=l.na;q=l.oa;r=p;v=q;x=l.Ga.p;E=x.length;for(F=0;F<
E;F++){L=x[F];switch(L.ba){case kd:Il(a,m,h,this.ad);m.length=0;m.push([L.D,L.F]);p=L.D;q=L.F;r=p;v=q;break;case Xc:m.push([L.D,L.F]);p=L.D;q=L.F;break;case md:J.ze(p,q,L.Og,L.Pg,L.Tk,L.Uk,L.ve,L.we,0.5,m);p=L.D;q=L.F;break;case nd:J.wp(p,q,L.Og,L.Pg,L.ve,L.we,0.5,m);p=L.D;q=L.F;break;case od:N=qd(L,l);G=N.length;for(V=0;V<G;V++)T=N[V],J.ze(p,q,T.x2,T.y2,T.ae,T.be,T.Ob,T.Pb,0.5,m),p=T.Ob,q=T.Pb;break;case pd:N=rd(L,l,p,q);G=N.length;for(V=0;V<G;V++)T=N[V],J.ze(p,q,T.x2,T.y2,T.ae,T.be,T.Ob,T.Pb,0.5,
m),p=T.Ob,q=T.Pb;break;default:t.l("Segment not of valid type")}L.ph&&(m.push([r,v]),Il(a,m,h,this.ad))}Il(a,m,h,this.ad);t.Da(m);null!==this.xb&&(c&&e&&(n=[a.shadowOffsetX,a.shadowOffsetY,a.shadowBlur],a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),gk(a,this.xb,!1),c&&e&&(a.shadowOffsetX=n[0],a.shadowOffsetY=n[1],a.shadowBlur=n[2]))}}d&&(void 0!==a.setLineDash?(a.setLineDash(t.Wh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=t.Wh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&
(a.mozDash=null,a.mozDashOffset=0));if(this.EA){d=this.EA;Dh(d,Infinity,Infinity);h=d.Ea;d.Dc(0,0,h.width,h.height);a.save();h=this.ed.ub.eb();a.beginPath();n=t.Cb();n.push([h.na,h.oa]);c=h.na;e=h.oa;s=c;g=e;k=h.Ga.p;l=k.length;for(m=0;m<l;m++){p=k[m];switch(p.ba){case kd:Hl(a,b,n,d);n.length=0;n.push([p.D,p.F]);c=p.D;e=p.F;s=c;g=e;break;case Xc:n.push([p.D,p.F]);c=p.D;e=p.F;break;case md:J.ze(c,e,p.Og,p.Pg,p.Tk,p.Uk,p.ve,p.we,0.5,n);c=p.D;e=p.F;break;case nd:J.wp(c,e,p.Og,p.Pg,p.ve,p.we,0.5,n);c=
p.D;e=p.F;break;case od:q=qd(p,h);r=q.length;for(v=0;v<r;v++)x=q[v],J.ze(c,e,x.x2,x.y2,x.ae,x.be,x.Ob,x.Pb,0.5,n),c=x.Ob,e=x.Pb;break;case pd:q=rd(p,h,c,e);r=q.length;for(v=0;v<r;v++)x=q[v],J.ze(c,e,x.x2,x.y2,x.ae,x.be,x.Ob,x.Pb,0.5,n),c=x.Ob,e=x.Pb;break;default:t.l("Segment not of valid type")}p.ph&&(n.push([s,g]),Hl(a,b,n,d))}Hl(a,b,n,d);t.Da(n);a.restore()}}}};
function Il(a,b,c,d){var e=0.001,g=c.length,h,k,l,m=b.length;if(!(2>m))if(h=b[0][0],k=b[0][1],2===m)Nj(a,h,k,b[1][0],b[1][1],c,d);else{a.moveTo(h,k);for(var n,p,q,r=0,s=t.Cb(),v=1;v<m;v++)n=b[v],e=n[0],l=n[1],n=e-h,h=l-k,0===n&&(n=0.001),p=h/n,h=Math.sqrt(n*n+h*h),s.push([n,p,h]),r+=h,h=e,k=l;h=b[0][0];k=b[0][1];b=0;m=!0;e=c[b%g];v=0!==d;l=0;q=s[l];n=q[0];p=q[1];q=q[2];for(var x=0;0.1<=r;){0===x&&(e=c[b%g],b++,v&&(d%=e,e-=d,v=!1));e>r&&(e=r);e>q?(x=e-q,e=q):x=0;var E=Math.sqrt(e*e/(1+p*p));0>n&&(E=
-E);h+=E;k+=p*E;m?a.lineTo(h,k):a.moveTo(h,k);r-=e;q-=e;if(0!==x){l++;if(l===s.length){t.Da(s);return}q=s[l];n=q[0];p=q[1];q=q[2];e=x}else m=!m}t.Da(s)}}Y.prototype.getDocumentPoint=Y.prototype.gb=function(a,b){void 0===b&&(b=new C);a.qd()&&t.l("Spot must be real");var c=this.Ia,d=this.ib;b.q(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY);this.he.Va(b);return b};
Y.prototype.Vj=function(a,b){var c=this.Ra;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.Mb,e=this.ib/2;c.type!==Tc||b||(e+=2);var g=t.wf();g.assign(d);g.Ug(e+2,e+2);if(!g.Ha(a))return t.Rc(g),!1;d=e+1E-4;if(c.type===Tc){if(null===this.stroke)return!1;g=(c.D-c.na)*(a.x-c.na)+(c.F-c.oa)*(a.y-c.oa);return 0>(c.na-c.D)*(a.x-c.D)+(c.oa-c.F)*(a.y-c.F)||0>g?!1:J.Cd(c.na,c.oa,c.D,c.F,e,a.x,a.y)}if(c.type===Uc){var h=c.na,k=c.oa,l=c.D,m=c.F,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-
h),k=Math.abs(m-k);g.x=c;g.y=n;g.width=h;g.height=k;if(null===this.fill){g.Ug(-d,-d);if(g.Ha(a))return!1;g.Ug(d,d)}null!==this.stroke&&g.Ug(e,e);e=g.Ha(a);t.Rc(g);return e}if(c.type===Vc){h=c.na;k=c.oa;l=c.D;m=c.F;c=Math.min(h,l);n=Math.min(k,m);h=Math.abs(l-h);k=Math.abs(m-k);g=h/2;k/=2;c=a.x-(c+g);n=a.y-(n+k);if(null===this.fill){g-=d;k-=d;if(0>=g||0>=k||1>=c*c/(g*g)+n*n/(k*k))return!1;g+=d;k+=d}null!==this.stroke&&(g+=e,k+=e);return 0>=g||0>=k?!1:1>=c*c/(g*g)+n*n/(k*k)}if(c.type===Lc)return null===
this.fill?td(c,a.x,a.y,e):c.Ha(a,e,1<this.ib,b);t.l("Unknown Geometry type");return!1};
Y.prototype.$s=function(a,b,c,d){var e=this.Ca,g=this.fe;a=Math.max(a,0);b=Math.max(b,0);var h;if(this.Qg)h=this.Ra.Mb;else{var k=this.Ib,l=J.GA[k];if(void 0===l){var m=J.Qi[k];"string"===typeof m&&(m=J.Qi[m]);"function"===typeof m?(l=m(null,100,100),J.GA[k]=l):t.l("Unsupported Figure:"+k)}h=l.Mb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(Sj(this)){case Wg:d=c=0;break;case Nc:m=Math.max(a-g,0);n=Math.max(b-g,0);break;case Kj:m=Math.max(a-g,0);d=0;break;case Jj:c=0,n=Math.max(b-g,0)}isFinite(e.width)&&
(m=e.width);isFinite(e.height)&&(n=e.height);e=this.He;h=this.Ye;c=Math.max(c,h.width)-g;d=Math.max(d,h.height)-g;m=Math.min(e.width,m);n=Math.min(e.height,n);m=isFinite(m)?Math.max(c,m):Math.max(k,c);n=isFinite(n)?Math.max(d,n):Math.max(l,d);c=sl(this);switch(c){case Wg:break;case Nc:k=m;l=n;break;case Yg:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:t.l(c+" is not a valid geometryStretch.")}if(this.Qg){h=this.ed;d=k;e=l;c=h.copy();h=h.Mb;d/=h.width;e/=h.height;isFinite(d)||(d=1);
isFinite(e)||(e=1);if(1!==d||1!==e)switch(c.type){case Tc:case Uc:case Vc:c.na*=d;c.oa*=e;c.D*=d;c.F*=e;break;case Lc:h=c.ub;for(var p=h.length,q=0;q<p;q++){var r=h.p[q];r.na*=d;r.oa*=e;for(var r=r.Ga,s=r.length,v=0;v<s;v++){var x=r.p[v];switch(x.type){case Xc:case kd:x.D*=d;x.F*=e;break;case md:x.vb*=d;x.Lb*=e;x.oe*=d;x.pe*=e;x.D*=d;x.F*=e;break;case nd:x.vb*=d;x.Lb*=e;x.D*=d;x.F*=e;break;case od:x.Fa*=d;x.Sa*=e;x.radiusX*=d;void 0!==x.radiusY&&(x.radiusY*=e);break;case pd:x.D*=d;x.F*=e;x.radiusX*=
d;x.radiusY*=e;break;default:t.l("Unknown Segment type: "+x.type)}}}}this.Ra=c}else if(null===this.Ra||this.Ra.yu!==a-g||this.Ra.xu!==b-g)this.Ra=J.makeGeometry(this,k,l);h=this.Ra.Mb;Infinity===a||Infinity===b?Pj(this,h.x-g/2,h.y-g/2,0===a&&0===k?0:h.width+g,0===b&&0===l?0:h.height+g):Pj(this,-(g/2),-(g/2),m+g,n+g)};
function wl(a,b,c){if(!1!==Ai(a)){a.Lc.Ua();var d=a.fe;if(0===d){var e=a.U;e instanceof Ve&&e.type===Cg&&e.Pc instanceof Y&&(d=e.Pc.ib)}d*=a.Sb;Pj(a,-(d/2),-(d/2),b+d,c+d);b=a.Lc;c=a.He;d=a.Ye;b.width=Math.min(c.width,b.width);b.height=Math.min(c.height,b.height);b.width=Math.max(d.width,b.width);b.height=Math.max(d.height,b.height);a.Lc.freeze();a.Lc.Q()||t.l("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.Lc.toString());Tj(a,!1)}}
function sl(a){var b=a.kw;return a.Qg?b===Xg?Nc:b:b===Xg?J.GA[a.Ib].kc:b}Y.prototype.Uj=function(a,b,c,d){Wj(this,a,b,c,d)};Y.prototype.getNearestIntersectionPoint=Y.prototype.Vo=function(a,b,c){return this.Ls(a.x,a.y,b.x,b.y,c)};
Y.prototype.Ls=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy),g=a*k+b*m+p,h=a*l+b*n+q,k=c*k+d*m+p,l=c*l+d*n+q,m=this.ib/2,p=this.Ra;null===p&&(Dh(this,Infinity,Infinity),p=this.Ra);q=p.Mb;n=!1;if(p.type===Tc)if(1.5>=this.ib)n=J.Zg(p.ec,p.nc,p.md,p.xd,g,h,k,l,e);else{var r,s;p.ec===p.md?(r=m,s=0):(b=(p.xd-p.nc)/(p.md-p.ec),s=m/Math.sqrt(1+b*b),r=s*b);d=t.Cb();b=new C;J.Zg(p.ec+
r,p.nc+s,p.md+r,p.xd+s,g,h,k,l,b)&&d.push(b);b=new C;J.Zg(p.ec-r,p.nc-s,p.md-r,p.xd-s,g,h,k,l,b)&&d.push(b);b=new C;J.Zg(p.ec+r,p.nc+s,p.ec-r,p.nc-s,g,h,k,l,b)&&d.push(b);b=new C;J.Zg(p.md+r,p.xd+s,p.md-r,p.xd-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return t.Da(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],v=(k.x-g)*(k.x-g)+(k.y-h)*(k.y-h);v<s&&(s=v,e.x=k.x,e.y=k.y)}t.Da(d)}else if(p.type===Uc)b=q.x-m,n=J.Vo(b,q.y-m,q.x+q.width+m,q.y+q.height+m,g,h,k,l,e);else if(p.type===Vc)a:if(b=q.copy().Ug(m,
m),0===b.width)n=J.Zg(b.x,b.y,b.x,b.y+b.height,g,h,k,l,e);else if(0===b.height)n=J.Zg(b.x,b.y,b.x+b.width,b.y,g,h,k,l,e);else{a=b.width/2;var x=b.height/2;d=b.x+a;b=b.y+x;c=9999;g!==k&&(c=(h-l)/(g-k));if(9999>Math.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+x*x-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+x*x-n*n);k=(-(a*a*c*n)+a*x*m)/(x*x+a*a*c*c)+d;a=(-(a*a*c*n)-a*x*m)/(x*x+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*
(h-b));d<h?(e.x=k,e.y=l):(e.x=a,e.y=b)}else{k=x*x;l=g-d;k-=k/(a*a)*l*l;if(0>k){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);d<h?(e.x=g,e.y=l):(e.x=g,e.y=b)}n=!0}else if(p.type===Lc){var E,F,G,q=t.O();r=k-g;s=l-h;s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.ub.count;r++){var L=p.ub.p[r],N=L.Ga;E=L.na;F=L.oa;for(var V=E,T=F,W,da,R=0;R<N.count;R++){W=N.p[R];da=W.type;v=W.D;G=W.F;var xa=!1;switch(da){case kd:V=v;T=G;break;case Xc:xa=Jl(E,F,v,G,g,h,k,l,q);break;case md:xa=
W.vb;da=W.Lb;var Ja=W.oe,Ma=W.pe,xa=J.vs(E,F,xa,da,Ja,Ma,v,G,g,h,k,l,0.5,q);break;case nd:xa=(E+2*W.vb)/3;da=(F+2*W.Lb)/3;Ja=(2*W.vb+v)/3;Ma=(2*W.vb+v)/3;xa=J.vs(E,F,xa,da,Ja,Ma,v,G,g,h,k,l,0.5,q);break;case od:case pd:G=W.type===od?qd(W,L):rd(W,L,E,F);da=G.length;for(Ja=0;Ja<da;Ja++)x=G[Ja],0===Ja&&Jl(E,F,x.x1,x.y1,g,h,k,l,q)&&(v=Kl(g,h,q,s,e),v<s&&(s=v,n=!0)),J.vs(x.x1,x.y1,x.x2,x.y2,x.ae,x.be,x.Ob,x.Pb,g,h,k,l,0.5,q)&&(v=Kl(g,h,q,s,e),v<s&&(s=v,n=!0));v=x.Ob;G=x.Pb;break;default:t.l("Unknown Segment type: "+
W.type)}E=v;F=G;xa&&(v=Kl(g,h,q,s,e),v<s&&(s=v,n=!0));W.Ss&&(v=V,G=T,Jl(E,F,v,G,g,h,k,l,q)&&(v=Kl(g,h,q,s,e),v<s&&(s=v,n=!0)))}}g=c-a;h=d-b;b=Math.sqrt(g*g+h*h);0!==b&&(g/=b,h/=b);e.x-=g*m;e.y-=h*m;t.B(q)}else t.l("Invalid Geometry type");if(!n)return!1;this.transform.Va(e);return!0};function Kl(a,b,c,d,e){a=c.x-a;b=c.y-b;b=a*a+b*b;return b<d?(e.x=c.x,e.y=c.y,b):d}
function Jl(a,b,c,d,e,g,h,k,l){var m=!1,n=(e-h)*(b-d)-(g-k)*(a-c);if(0===n)return!1;l.x=((e*k-g*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-g*h)*(b-d)-(g-k)*(a*d-b*c))/n;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(e=b<d?b:d,a=b<d?d:b,(l.y>e||J.Ka(l.y,e))&&(l.y<a||J.Ka(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||J.Ka(l.x,e))&&(l.x<a||J.Ka(l.x,a))&&(m=!0));return m}
Y.prototype.containedInRect=Y.prototype.Em=function(a,b){if(void 0===b)return a.Wj(this.ya);var c=this.Ra;null===c&&(Dh(this,Infinity,Infinity),c=this.Ra);var c=c.Mb,d=this.ib/2,e=!1,g=t.O();g.q(c.x-d,c.y-d);a.Ha(b.Va(g))&&(g.q(c.x-d,c.bottom+d),a.Ha(b.Va(g))&&(g.q(c.right+d,c.bottom+d),a.Ha(b.Va(g))&&(g.q(c.right+d,c.y-d),a.Ha(b.Va(g))&&(e=!0))));t.B(g);return e};
Y.prototype.intersectsRect=Y.prototype.If=function(a,b){if(this.Em(a,b)||void 0===b&&(b=this.transform,a.Wj(this.ya)))return!0;var c=t.ah();c.set(b);c.jA();var d=a.left,e=a.right,g=a.top,h=a.bottom,k=t.O();k.q(d,g);c.Va(k);if(this.Vj(k,!0))return t.B(k),!0;k.q(e,g);c.Va(k);if(this.Vj(k,!0))return t.B(k),!0;k.q(d,h);c.Va(k);if(this.Vj(k,!0))return t.B(k),!0;k.q(e,h);c.Va(k);if(this.Vj(k,!0))return t.B(k),!0;var l=t.O(),m=t.O();c.set(b);c.yA(this.transform);c.jA();l.x=e;l.y=g;l.transform(c);k.x=d;k.y=
g;k.transform(c);var n=!1;Ll(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),Ll(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),Ll(this,k,l,m)?n=!0:(k.x=d,k.y=g,k.transform(c),Ll(this,k,l,m)&&(n=!0))));t.B(k);t.Se(c);t.B(l);t.B(m);return n};function Ll(a,b,c,d){if(!a.Vo(b,c,d))return!1;a=b.x;b=b.y;var e=c.x,g=c.y;c=d.x;d=d.y;if(a===e){var h;b<g?(h=b,a=g):(h=g,a=b);return d>=h&&d<=a}a<e?(h=a,a=e):h=e;return c>=h&&c<=a}
Y.prototype.XD=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d++){var g=a[d];if(b.Es(g[0],g[1])>e)return!0}return!1}if(c&&null!==this.fill&&this.Vj(a,!0))return!0;var e=a.$j(b);b=e;1.5<this.ib&&(e=this.ib/2+Math.sqrt(e),e*=e);var g=this.Ra;null===g&&(Dh(this,Infinity,Infinity),g=this.Ra);if(!c){var h=g.Mb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(eb(a.x,a.y,k,l)<=e&&eb(a.x,a.y,m,l)<=e&&eb(a.x,a.y,k,h)<=e&&eb(a.x,a.y,m,h)<=e)return!0}k=g.ec;l=g.nc;m=g.md;h=g.xd;if(g.type===Tc){if(c=
db(a.x,a.y,k,l,m,h),g=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=g?e:b))return!0}else{if(g.type===Uc)return b=!1,c&&(b=db(a.x,a.y,k,l,k,h)<=e||db(a.x,a.y,k,l,m,l)<=e||db(a.x,a.y,m,l,m,h)<=e||db(a.x,a.y,k,h,m,h)<=e),b;if(g.type===Vc){b=a.x-(k+m)/2;var g=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=db(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=J.GH(n,p,b,g),a*a<=e)return!0}else return eb(b,g,-n,0)>=e||eb(b,g,0,-p)>=e||eb(b,g,0,p)>=e||eb(b,g,n,0)>=e?!1:
!0}else if(g.type===Lc){h=g.Mb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.x<k&&a.y>h&&a.y<l&&db(a.x,a.y,k,l,k,h)>e&&db(a.x,a.y,k,l,m,l)>e&&db(a.x,a.y,m,h,k,h)>e&&db(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?td(g,a.x,a.y,b):g.Ha(a,b,!0))return!0}else{c=g.ub;for(b=0;b<c.count;b++){k=c.p[b];n=k.na;p=k.oa;if(a.Es(n,p)>e)return!1;l=k.Ga.p;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case kd:case Xc:n=q.D;p=q.F;if(a.Es(n,p)>e)return!1;break;case md:g=t.Cb();
J.ze(n,p,q.vb,q.Lb,q.oe,q.pe,q.D,q.F,0.8,g);n=d(g,a);t.Da(g);if(n)return!1;n=q.D;p=q.F;if(a.Es(n,p)>e)return!1;break;case nd:g=t.Cb();J.wp(n,p,q.vb,q.Lb,q.D,q.F,0.8,g);n=d(g,a);t.Da(g);if(n)return!1;n=q.D;p=q.F;if(a.Es(n,p)>e)return!1;break;case od:case pd:var q=q.type===od?qd(q,k):rd(q,k,n,p),r=q.length,s=null,g=t.Cb();for(b=0;b<r;b++)if(s=q[b],g.length=0,J.ze(s.x1,s.y1,s.x2,s.y2,s.ae,s.be,s.Ob,s.Pb,0.8,g),d(g,a))return t.Da(g),!1;t.Da(g);null!==s&&(n=s.Ob,p=s.Pb);break;default:t.l("Unknown Segment type: "+
q.type)}}}return!0}}}return!1};t.g(Y,"geometry",Y.prototype.ed);t.defineProperty(Y,{ed:"geometry"},function(){return this.Bk?this.Bk:this.Ra},function(a){var b=this.Ra;if(b!==a){null!==a?(f&&t.m(a,M,Y,"geometry"),this.Bk=this.Ra=a.freeze()):this.Bk=this.Ra=null;var c=this.U;c&&(c.zj=NaN);this.Qg=!0;this.aa();this.i("geometry",b,a)}});t.g(Y,"geometryString",Y.prototype.fE);
t.defineProperty(Y,{fE:"geometryString"},function(){return this.ed.toString()},function(a){var b=$c(a);a=b.normalize();this.ed=b;var b=t.O(),c=this.position;c.Q()?b.q(c.x-a.x,c.y-a.y):b.q(-a.x,-a.y);this.position=b;t.B(b)});t.defineProperty(Y,{kA:"isGeometryPositioned"},function(){return this.Jq},function(a){f&&t.j(a,"boolean",Y,"isGeometryPositioned");var b=this.Jq;b!==a&&(this.Jq=a,this.aa(),this.i("isGeometryPositioned",b,a))});Y.prototype.Jf=function(){this.Qg?this.Bk=null:this.Ra=null;this.aa()};
t.g(Y,"fill",Y.prototype.fill);t.defineProperty(Y,{fill:"fill"},function(){return this.Kc},function(a){var b=this.Kc;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.Kc=a,this.pa(),this.i("fill",b,a))});t.g(Y,"stroke",Y.prototype.stroke);t.defineProperty(Y,{stroke:"stroke"},function(){return this.xb},function(a){var b=this.xb;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.xb=a,this.pa(),this.i("stroke",b,a))});
t.g(Y,"strokeWidth",Y.prototype.ib);t.defineProperty(Y,{ib:"strokeWidth"},function(){return this.fe},function(a){var b=this.fe;if(b!==a)if(f&&t.o(a,Y,"strokeWidth"),0<=a){this.fe=a;this.aa();var c=this.U;c&&(c.zj=NaN);this.i("strokeWidth",b,a)}else t.ha(a,"val >= 0",Y,"strokeWidth:val")});t.g(Y,"strokeCap",Y.prototype.HF);
t.defineProperty(Y,{HF:"strokeCap"},function(){return this.oo},function(a){var b=this.oo;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?t.ha(a,'"butt", "round", or "square"',Y,"strokeCap"):(this.oo=a,this.pa(),this.i("strokeCap",b,a)))});t.g(Y,"strokeJoin",Y.prototype.eJ);
t.defineProperty(Y,{eJ:"strokeJoin"},function(){return this.po},function(a){var b=this.po;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?t.ha(a,'"miter", "bevel", or "round"',Y,"strokeJoin"):(this.po=a,this.pa(),this.i("strokeJoin",b,a)))});t.g(Y,"strokeMiterLimit",Y.prototype.fJ);
t.defineProperty(Y,{fJ:"strokeMiterLimit"},function(){return this.qm},function(a){var b=this.qm;if(b!==a)if(f&&t.o(a,Y,"strokeMiterLimit"),0<a){this.qm=a;this.pa();var c=this.U;c&&(c.zj=NaN);this.i("strokeMiterLimit",b,a)}else t.ha(a,"val > 0",Y,"strokeWidth:val")});t.g(Y,"strokeDashArray",Y.prototype.Rw);
t.defineProperty(Y,{Rw:"strokeDashArray"},function(){return this.pm},function(a){var b=this.pm;if(b!==a){null===a||Array.isArray(a)||t.Vb(a,"Array",Y,"strokeDashArray:val");if(null!==a)for(var c=a.length,d=0;d<c;d++){var e=a[d];("number"!==typeof e||isNaN(e)||0>e||!isFinite(e))&&t.l("strokeDashArray:val "+e+" is a negative number or not a real number.")}this.pm=a;this.pa();this.i("strokeDashArray",b,a)}});t.g(Y,"strokeDashOffset",Y.prototype.IF);
t.defineProperty(Y,{IF:"strokeDashOffset"},function(){return this.ad},function(a){var b=this.ad;b!==a&&(f&&t.o(a,Y,"strokeDashOffset"),0<=a&&(this.ad=a,this.pa(),this.i("strokeDashOffset",b,a)))});t.g(Y,"figure",Y.prototype.Ib);
t.defineProperty(Y,{Ib:"figure"},function(){return this.Hn},function(a){var b=this.Hn;if(b!==a){f&&t.j(a,"string",Y,"figure");var c=J.Qi[a];"function"===typeof c?c=a:(c=J.Qi[a.toLowerCase()])||t.l("Unknown Shape.figure: "+a);if(b!==c){if(a=this.U)a.zj=NaN;this.Hn=c;this.Qg=!1;this.Jf();this.i("figure",b,c)}}});t.g(Y,"toArrow",Y.prototype.fn);
t.defineProperty(Y,{fn:"toArrow"},function(){return this.ro},function(a){var b=this.ro;!0===a?a="Standard":!1===a&&(a="None");if(b!==a){f&&t.j(a,"string",Y,"toArrow");var c=J.No(a);c instanceof M?c=a:(c=J.No(a.toLowerCase()))||t.l("Unknown Shape.toArrow: "+a);b!==c&&(this.ro=c,this.Qg=!1,this.Jf(),Ml(this,c),this.i("toArrow",b,c))}});t.g(Y,"fromArrow",Y.prototype.jw);
t.defineProperty(Y,{jw:"fromArrow"},function(){return this.Jn},function(a){var b=this.Jn;!0===a?a="Standard":!1===a&&(a="None");if(b!==a){f&&t.j(a,"string",Y,"fromArrow");var c=J.No(a);c instanceof M?c=a:(c=J.No(a.toLowerCase()))||t.l("Unknown Shape.fromArrow: "+a);b!==c&&(this.Jn=c,this.Qg=!1,this.Jf(),Ml(this,c),this.i("fromArrow",b,c))}});
function Ml(a,b){var c=a.h;if(null===c||!c.Aa.qb){a.ut=Nl;c=cc;switch(b){case "halfarrowtop":c=$b;break;case "halftriangletop":c=$b;break;case "openrighttriangletop":c=$b;break;case "opentriangletop":c=$b}"None"!==a.ro?(a.tf=-1,a.Rj=c):"None"!==a.Jn&&(a.tf=0,a.Rj=new K(1-c.x,c.y))}}t.defineProperty(Y,{G:"spot1"},function(){return this.wi},function(a){t.m(a,K,Y,"spot1");var b=this.wi;b.N(a)||(this.wi=a=a.Z(),this.aa(),this.i("spot1",b,a))});
t.defineProperty(Y,{H:"spot2"},function(){return this.xi},function(a){t.m(a,K,Y,"spot2");var b=this.xi;b.N(a)||(this.xi=a=a.Z(),this.aa(),this.i("spot2",b,a))});t.defineProperty(Y,{yc:"parameter1"},function(){return this.vr},function(a){var b=this.vr;b!==a&&(this.vr=a,this.aa(),this.i("parameter1",b,a))});t.defineProperty(Y,{lt:"parameter2"},function(){return this.wr},function(a){var b=this.wr;b!==a&&(this.wr=a,this.aa(),this.i("parameter2",b,a))});
t.A(Y,{Ia:"naturalBounds"},function(){if(null!==this.Ra)return this.Mc.assign(this.Ra.Mb),this.Mc;var a=this.Ca;return new D(0,0,a.width,a.height)});t.g(Y,"isRectangular",Y.prototype.pI);t.defineProperty(Y,{pI:"isRectangular"},function(){return this.Oq},function(a){var b=this.Oq;b!==a&&(f&&t.j(a,"boolean",Y,"isRectangular"),this.Oq=a,this.aa(),this.i("isRectangular",b,a))});t.g(Y,"pathObject",Y.prototype.EA);
t.defineProperty(Y,{EA:"pathObject"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(f&&t.m(a,X,Y,"pathObject"),this.yr=a,this.pa(),this.i("pathObject",b,a))});t.g(Y,"geometryStretch",Y.prototype.kw);t.defineProperty(Y,{kw:"geometryStretch"},function(){return this.Eq},function(a){var b=this.Eq;b!==a&&(t.tb(a,X,Y,"geometryStretch"),this.Eq=a,this.i("geometryStretch",b,a))});t.g(Y,"interval",Y.prototype.interval);
t.defineProperty(Y,{interval:"interval"},function(){return this.Iq},function(a){var b=this.Iq;f&&t.o(a,Y,"interval");a=Math.floor(a);b!==a&&0<=a&&(this.Iq=a,this.h&&vi(this.h),this.aa(),this.i("interval",b,a))});function va(){X.call(this);this.ge="";this.xb="black";this.mh="13px sans-serif";this.Pd="start";this.Lq=!0;this.Tl=this.Ul=!1;this.eo=Ol;this.tm=Pl;this.Hu=this.Xq=0;this.In=this.Ey=this.Fy=null;this.Yn={};this.xq=!1;this.ef=this.Mj=this.es=null}t.ia("TextBlock",va);t.Oa(va,X);
va.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.ge=this.ge;a.xb=this.xb;a.mh=this.mh;a.Pd=this.Pd;a.Lq=this.Lq;a.Ul=this.Ul;a.Tl=this.Tl;a.tm=this.tm;a.eo=this.eo;a.Xq=this.Xq;a.Hu=this.Hu;a.Fy=this.Fy;a.Ey=this.Ey;a.In=this.In;a.Yn=this.Yn;a.xq=this.xq;a.es=this.es;a.Mj=this.Mj;a.ef=this.ef};va.prototype.toString=function(){return 22<this.ge.length?'TextBlock("'+this.ge.substring(0,20)+'"...)':'TextBlock("'+this.ge+'")'};var Ql;va.None=Ql=t.w(va,"None",0);var Rl;
va.WrapFit=Rl=t.w(va,"WrapFit",1);var Pl;va.WrapDesiredSize=Pl=t.w(va,"WrapDesiredSize",2);var Ol;va.OverflowClip=Ol=t.w(va,"OverflowClip",0);var Sl;va.OverflowEllipsis=Sl=t.w(va,"OverflowEllipsis",1);va.prototype.aa=function(){X.prototype.aa.call(this);this.Ey=this.Fy=null};t.g(va,"font",va.prototype.font);t.defineProperty(va,{font:"font"},function(){return this.mh},function(a){var b=this.mh;b!==a&&(f&&t.j(a,"string",va,"font"),this.mh=a,this.In=null,this.aa(),this.i("font",b,a))});
t.g(va,"text",va.prototype.text);t.defineProperty(va,{text:"text"},function(){return this.ge},function(a){var b=this.ge;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.ge=a,this.aa(),this.i("text",b,a))});t.g(va,"textAlign",va.prototype.textAlign);
t.defineProperty(va,{textAlign:"textAlign"},function(){return this.Pd},function(a){var b=this.Pd;b!==a&&(f&&t.j(a,"string",va,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Pd=a,this.pa(),this.i("textAlign",b,a)):t.ha(a,'"start", "end", "left", "right", or "center"',va,"textAlign"))});
t.A(va,{Ia:"naturalBounds"},function(){if(!this.Mc.Q()){var a=Tl(this,this.ge,{},999999).width,b=Ul(this,a,{}),c=this.Ca;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);qb(this.Mc,a,b)}return this.Mc});t.g(va,"isMultiline",va.prototype.uw);t.defineProperty(va,{uw:"isMultiline"},function(){return this.Lq},function(a){var b=this.Lq;b!==a&&(f&&t.j(a,"boolean",va,"isMultiline"),this.Lq=a,this.aa(),this.i("isMultiline",b,a))});t.g(va,"isUnderline",va.prototype.sI);
t.defineProperty(va,{sI:"isUnderline"},function(){return this.Ul},function(a){var b=this.Ul;b!==a&&(f&&t.j(a,"boolean",va,"isUnderline"),this.Ul=a,this.pa(),this.i("isUnderline",b,a))});t.g(va,"isStrikethrough",va.prototype.qI);t.defineProperty(va,{qI:"isStrikethrough"},function(){return this.Tl},function(a){var b=this.Tl;b!==a&&(f&&t.j(a,"boolean",va,"isStrikethrough"),this.Tl=a,this.pa(),this.i("isStrikethrough",b,a))});t.g(va,"wrap",va.prototype.qB);
t.defineProperty(va,{qB:"wrap"},function(){return this.tm},function(a){var b=this.tm;b!==a&&(f&&t.tb(a,va,va,"wrap"),this.tm=a,this.aa(),this.i("wrap",b,a))});t.g(va,"overflow",va.prototype.overflow);t.defineProperty(va,{overflow:"overflow"},function(){return this.eo},function(a){var b=this.eo;b!==a&&(f&&t.tb(a,va,va,"overflow"),this.eo=a,this.aa(),this.i("overflow",b,a))});t.g(va,"stroke",va.prototype.stroke);
t.defineProperty(va,{stroke:"stroke"},function(){return this.xb},function(a){var b=this.xb;b!==a&&(null===a||"string"===typeof a||a instanceof fe)&&(a instanceof fe&&a.freeze(),this.xb=a,this.pa(),this.i("stroke",b,a))});t.A(va,{HE:"lineCount"},function(){return this.Xq});t.g(va,"editable",va.prototype.aw);t.defineProperty(va,{aw:"editable"},function(){return this.xq},function(a){var b=this.xq;b!==a&&(f&&t.j(a,"boolean",va,"editable"),this.xq=a,this.i("editable",b,a))});t.g(va,"textEditor",va.prototype.iB);
t.defineProperty(va,{iB:"textEditor"},function(){return this.es},function(a){var b=this.es;b!==a&&(a instanceof HTMLElement||t.l("textEditor must be an HTMLElement"),this.es=a,this.i("textEditor",b,a))});t.g(va,"errorFunction",va.prototype.Fs);t.defineProperty(va,{Fs:"errorFunction"},function(){return this.ef},function(a){var b=this.ef;b!==a&&(null!==a&&t.j(a,"function",va,"errorFunction"),this.ef=a,this.i("errorFunction",b,a))});function ek(a,b){var c=a.mh;null!==c&&b.Kt!==c&&(b.font=c,b.Kt=c)}
va.prototype.hl=function(a,b){if(null!==this.xb&&0!==this.ge.length&&null!==this.mh){var c=this.Ia.width,d=Eh(this);a.textAlign=this.Pd;fk(this,a,this.xb,!0);(this.Ul||this.Tl)&&fk(this,a,this.xb,!1);var e=this.Yn,g=0,h=!1,k=t.ic(0,0);this.he.Va(k);var l=t.ic(0,d);this.he.Va(l);var m=k.$j(l);t.B(k);t.B(l);k=b.scale;8>m*k*k&&(h=!0);m=e.Di.length;for(k=0;k<m;k++){var n=e.Di[k],l=e.xm[k];n>c&&(n=c);var p=l,l=a,q=g,r=c,s=d,v=0;h?("start"===this.Pd||"left"===this.Pd?v=0:"end"===this.Pd||"right"===this.Pd?
v=r-n:"center"===this.Pd?v=(r-n)/2:t.l("textAlign must be start, end, left, right, or center"),l.fillRect(0+v,q+0.25*s,n,1)):("start"===this.Pd||"left"===this.Pd?v=0:"end"===this.Pd||"right"===this.Pd?v=r:"center"===this.Pd?v=r/2:t.l("textAlign must be start, end, left, right, or center"),l.fillText(p,0+v,q+s-0.25*s),p=s/20|0,this.Ul&&("end"===this.Pd||"right"===this.Pd?v-=n:"center"===this.Pd&&(v-=n/2),l.beginPath(),l.lineWidth=p,l.moveTo(0+v,q+s-0.2*s),l.lineTo(0+v+n,q+s-0.2*s),l.stroke()),this.Tl&&
(l.beginPath(),l.lineWidth=p,q=q+s-s/2.2|0,0!==p%2&&(q+=0.5),l.moveTo(0,q),l.lineTo(0+n,q),l.stroke()));g+=d}}};
va.prototype.$s=function(a,b,c,d){var e={},g=0,h=0;if(isNaN(this.Ca.width)){g=this.ge;if(0===g.length)g=0;else if(this.uw){for(var k=h=0,l=!1,m={Uh:0};!l;){var n=Vl(g,k,m);-1===n&&(n=g.length,l=!0);k=Wl(g.substr(k,n-k).replace(/^\s+|\s+$/g,""),this.mh);k>h&&(h=k);k=m.Uh}g=h}else h=Vl(g,0,{}),0<=h&&(g=g.substr(0,h)),g=k=Wl(g,this.mh);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ca.width;this.ga&&(g=Math.min(g,this.ga.He.width),g=Math.max(g,this.ga.Ye.width));h=Ul(this,g,e);h=isNaN(this.Ca.height)?
Math.min(h,b/this.scale):this.Ca.height;if(this.qB===Rl||isNaN(this.Ca.width))g=e.Wi,isNaN(this.Ca.width)&&(g=Math.max(8,g));g=Math.max(c,g);h=Math.max(d,h);qb(this.Mc,g,h);Pj(this,0,0,g,h);this.Yn=e};va.prototype.Uj=function(a,b,c,d){Wj(this,a,b,c,d)};
function Tl(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");void 0===c.Wi&&(c.Wi=0);void 0===c.Di&&(c.Di=[]);void 0===c.xm&&(c.xm=[]);var e=0,g,h,k=a.mh;a.eo===Sl?(t.Gp!==k&&(t.Fp.font=k,t.Gp=k),g=0,void 0!==t.Yz[k]&&5E3>t.$D?g=t.Yz[k]:(g=t.Fp.measureText(t.VD).width,t.Yz[k]=g,t.$D++)):g=0;var l=g;if(a.tm===Ql){c.Uh=1;g=Wl(b,k);if(0===l||g<=d)return c.Wi=g,c.Di.push(c.Wi),c.xm.push(b),new pa(g,Eh(a));var m=Xl(b);b=b.substr(m.length);h=Xl(b);for(g=Wl(m+h,k);0<h.length&&g<=d;)m+=h,b=b.substr(h.length),h=Xl(b),
g=Wl((m+h).replace(/^\s+|\s+$/g,""),k);m+=h.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-l);Wl(m,k)>d&&1<m.length;)m=m.substr(0,m.length-1);m+=t.VD;h=Wl(m,k);c.Di.push(h);c.Wi=h;c.xm.push(m);return new pa(h,Eh(a))}l=0;0===b.length&&(l=1,c.Di.push(0),c.xm.push(b));for(;0<b.length;){m=Xl(b);for(b=b.substr(m.length);Wl(m,k)>d;){var n=1;g=Wl(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Wl(m.substr(0,n),k);1===n?(c.Di[l]=g,e=Math.max(e,g)):(c.Di[l]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.xm[l]=m.substr(0,n);l++;
m=m.substr(n)}h=Xl(b);for(g=Wl(m+h,k);0<h.length&&g<=d;)m+=h,b=b.substr(h.length),h=Xl(b),g=Wl((m+h).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");""!==m&&(0===h.length?(c.Di.push(g),e=Math.max(e,g)):(h=Wl(m,k),c.Di.push(h),e=Math.max(e,h)),c.xm.push(m),l++)}c.Uh=l;c.Wi=Math.max(c.Wi,e);return new pa(c.Wi,Eh(a)*c.Uh)}function Xl(a){for(var b=a.length,c=0;c<b&&" "!==a.charAt(c);)c++;for(;c<b&&" "===a.charAt(c);)c++;return c>=b?a:a.substr(0,c)}
function Wl(a,b){t.Gp!==b&&(t.Fp.font=b,t.Gp=b);return t.Fp.measureText(a).width}function Eh(a){if(null!==a.In)return a.In;var b=a.mh;t.Gp!==b&&(t.Fp.font=b,t.Gp=b);var c=0;void 0!==t.Zz[b]&&5E3>t.aE?c=t.Zz[b]:(c=1.3*t.Fp.measureText("M").width,t.Zz[b]=c,t.aE++);return a.In=c}function Vl(a,b,c){void 0===c.Uh&&(c.Uh=0);var d=a.indexOf("\r",b);-1===d&&(d=a.indexOf("\n",b));0<=d&&(c.Uh="\r"===a[d]&&d+1<a.length&&"\n"===a[d+1]?d+2:d+1);return d}
function Ul(a,b,c){var d=a.ge,e=Eh(a);if(0===d.length)return c.Wi=0,a.Xq=1,e;if(!a.uw){var g=Vl(d,0,{});0<=g&&(d=d.substr(0,g))}for(var h=g=0,k=0,l=-1,m={Uh:0},n=!1;!n;)l=Vl(d,k,m),-1===l&&(l=d.length,n=!0),k<=l&&(k=d.substr(k,l-k),a.tm!==Ql?(c.Uh=0,k=Tl(a,k,c,b),g+=k.height,h+=c.Uh):(Tl(a,k,c,b),g+=e,h++)),k=m.Uh;a.Xq=h;return a.Hu=g}t.g(va,"textValidation",va.prototype.Dt);
t.defineProperty(va,{Dt:"textValidation"},function(){return this.Mj},function(a){var b=this.Mj;b!==a&&(null!==a&&t.j(a,"function",va,"textValidation"),this.Mj=a,this.i("textValidation",b,a))});function Dk(){X.call(this);this.Vf=null;this.$r="";this.Lj=(new D(NaN,NaN,NaN,NaN)).freeze();this.Ln=Nc;this.cs=this.ef=null;this.zu=this.Zn=!1}t.ia("Picture",Dk);t.Oa(Dk,X);Dk.cacheFlush=function(){t.gA={};t.hA=0};
Dk.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.element=this.Vf;a.$r=this.$r;a.Lj.assign(this.Lj);a.Ln=this.Ln;a.ef=this.ef};Dk.prototype.toString=function(){return"Picture("+this.source+")#"+t.oc(this)};t.g(Dk,"element",Dk.prototype.element);
t.defineProperty(Dk,{element:"element"},function(){return this.Vf},function(a){var b=this.Vf;if(b!==a){a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||t.l("Picture.element must be an instance of Image, Canvas, or Video.");var c=this;a instanceof HTMLCanvasElement?this.zu=!0:(this.zu=!1,a.onerror=function(a){null!==c.ef&&c.ef(c,a)});this.Vf=a;!0===a.complete||void 0===a.complete?(this.Zn=!0,this.Ca.Q()||(Tj(this,!1),this.aa())):(t.nB.push(this),null===
t.Gw&&(t.Gw=setInterval(function(){for(var a=[],b=t.nB,c=b.length,h=0;h<c;h++){var k=b[h],l;l=k;var m=l.Vf;if(m)if(m.complete){l.Zn=!0;l.Ca.Q()||(Tj(l,!1),l.aa());if(l.h)l.Ca.Q()||l.h.Fc(),l.h.pa();else{l=t.ND;var n=l.length;if(0===n)for(var n=document.getElementsByTagName("canvas"),p=n.length,m=0;m<p;m++){var q=n[m];q.parentElement&&q.parentElement.ea&&l.push(q.parentElement.ea)}n=l.length;for(m=0;m<n;m++)l[m].pa()}l=!0}else l=!1;else l=!0;l||a.push(k)}0===a.length&&(clearInterval(t.Gw),t.Gw=null);
t.nB=a},200)));this.i("element",b,a);this.pa()}});t.g(Dk,"source",Dk.prototype.source);t.defineProperty(Dk,{source:"source"},function(){return this.$r},function(a){var b=this.$r;if(b!==a){t.j(a,"string",Dk,"source");this.$r=a;var c=t.gA;if(void 0!==c[a])this.element=c[a];else{10<t.hA&&(Dk.cacheFlush(),c=t.gA);var d=document.createElement("img");d.src=a;c[a]=d;t.hA++;d instanceof HTMLImageElement&&(this.element=d)}this.pa();this.i("source",b,a)}});t.g(Dk,"sourceRect",Dk.prototype.Qh);
t.defineProperty(Dk,{Qh:"sourceRect"},function(){return this.Lj},function(a){var b=this.Lj;b.N(a)||(t.m(a,D,Dk,"sourceRect"),this.Lj=a=a.Z(),this.pa(),this.i("sourceRect",b,a))});t.g(Dk,"imageStretch",Dk.prototype.gI);t.defineProperty(Dk,{gI:"imageStretch"},function(){return this.Ln},function(a){var b=this.Ln;b!==a&&(t.tb(a,X,Dk,"imageStretch"),this.Ln=a,this.pa(),this.i("imageStretch",b,a))});t.g(Dk,"errorFunction",Dk.prototype.Fs);
t.defineProperty(Dk,{Fs:"errorFunction"},function(){return this.ef},function(a){var b=this.ef;if(b!==a){null!==a&&t.j(a,"function",Dk,"errorFunction");this.ef=a;if(this.Vf){var c=this;this.Vf.onerror=function(a){null!==c.ef&&c.ef(c,a)}}this.i("errorFunction",b,a)}});
Dk.prototype.hl=function(a,b){if(!b.En){if(null===this.cs)if(null===this.Vf)this.cs=!1;else{var c=document.createElement("canvas").getContext("2d");0!==this.Vf.width&&0!==this.Vf.height&&c.drawImage(this.Vf,0,0);try{c.getImageData(0,0,1,1),this.cs=!1}catch(d){this.cs=!0}}if(this.cs)return}c=this.Vf;if(null!==c){var e=c.src;null!==e&&""!==e||t.l("Element has no source attribute: "+c);var e=this.Ia,g=0,h=0,k=this.zu,l=k?+c.width:c.naturalWidth,k=k?+c.height:c.naturalHeight;if(0!==l&&0!==k){void 0===
l&&c.videoWidth&&(l=c.videoWidth||e.width);void 0===k&&c.videoHeight&&(k=c.videoHeight||e.height);this.Qh.Q()&&(g=this.Lj.x,h=this.Lj.y,l=this.Lj.width,k=this.Lj.height);var m=l,n=k,p=this.Ln;switch(p){case Wg:if(this.Qh.Q())break;g+=Math.max((m-e.width)/2,0);h+=Math.max((n-e.height)/2,0);l=Math.min(e.width,m);k=Math.min(e.height,n);break;case Nc:m=e.width;n=e.height;break;case Yg:case Zg:p===Yg?(p=Math.min(e.height/n,e.width/m),m*=p,n*=p):p===Zg&&(p=Math.max(e.height/n,e.width/m),m*=p,n*=p,g+=(m-
e.width)/2,h+=(n-e.height)/2,l*=1/(m/e.width),k*=1/(n/e.height),m=e.width,n=e.height)}a.drawImage(c,g,h,l,k,Math.max((e.width-m)/2,0),Math.max((e.height-n)/2,0),Math.min(e.width,m),Math.min(e.height,n))}}};t.A(Dk,{Ia:"naturalBounds"},function(){return this.Mc});
Dk.prototype.$s=function(a,b,c,d){var e=this.Ca,g=Sj(this),h=this.Vf,k=this.zu;if(k||!this.Zn&&h&&h.complete)this.Zn=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||g===Nc||g===Kj?(isFinite(a)||(a=this.Qh.Q()?this.Qh.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.Zn&&(a=this.Qh.Q()?this.Qh.width:k?+h.width:h.naturalWidth);isFinite(e.height)||g===Nc||g===Jj?(isFinite(b)||(b=this.Qh.Q()?this.Qh.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.Zn&&(b=this.Qh.Q()?
this.Qh.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.He;g=this.Ye;c=Math.max(c,g.width);d=Math.max(d,g.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null===h||h.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));qb(this.Mc,a,b);Pj(this,0,0,a,b)};Dk.prototype.Uj=function(a,b,c,d){Wj(this,a,b,c,d)};function ra(){this.s=new M;this.Qb=null}aa=ra.prototype;aa.reset=function(){this.s=new M;this.Qb=null};
function O(a,b,c,d,e,g){null===a.s&&t.l("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.Qb&&t.l("Need to call beginFigure first"),d=new S(kd),d.D=b,d.F=c,a.Qb.Ga.add(d)):(a.Qb=new Mc,a.Qb.na=b,a.Qb.oa=c,a.Qb.ap=d,a.s.ub.add(a.Qb));void 0!==g&&(a.Qb.Qn=g)}function Q(a){null===a.s&&t.l("StreamGeometryContext has been closed");null===a.Qb&&t.l("Need to call beginFigure first");var b=a.Qb.Ga.length;0<b&&a.Qb.Ga.p[b-1].close()}
function cd(a){null===a.s&&t.l("StreamGeometryContext has been closed");null===a.Qb&&t.l("Need to call beginFigure first");0<a.Qb.Ga.length&&(a.Qb.ap=!0)}aa.ab=function(a){null===this.s&&t.l("StreamGeometryContext has been closed");null===this.Qb&&t.l("Need to call beginFigure first");this.Qb.Lh=a};aa.moveTo=function(a,b,c){null===this.s&&t.l("StreamGeometryContext has been closed");null===this.Qb&&t.l("Need to call beginFigure first");var d=new S(kd);d.D=a;d.F=b;c&&d.close();this.Qb.Ga.add(d)};
aa.lineTo=function(a,b,c){null===this.s&&t.l("StreamGeometryContext has been closed");null===this.Qb&&t.l("Need to call beginFigure first");var d=new S(Xc);d.D=a;d.F=b;c&&d.close();this.Qb.Ga.add(d)};function P(a,b,c,d,e,g,h,k){null===a.s&&t.l("StreamGeometryContext has been closed");null===a.Qb&&t.l("Need to call beginFigure first");var l=new S(md);l.vb=b;l.Lb=c;l.oe=d;l.pe=e;l.D=g;l.F=h;k&&l.close();a.Qb.Ga.add(l)}
function ad(a,b,c,d,e){null===a.s&&t.l("StreamGeometryContext has been closed");null===a.Qb&&t.l("Need to call beginFigure first");var g=new S(nd);g.vb=b;g.Lb=c;g.D=d;g.F=e;a.Qb.Ga.add(g)}aa.arcTo=function(a,b,c,d,e,g,h){null===this.s&&t.l("StreamGeometryContext has been closed");null===this.Qb&&t.l("Need to call beginFigure first");var k=new S(od);k.yg=a;k.Sh=b;k.Fa=c;k.Sa=d;k.radiusX=e;k.radiusY=g?g:e;h&&k.close();this.Qb.Ga.add(k)};
function bd(a,b,c,d,e,g,h,k){null===a.s&&t.l("StreamGeometryContext has been closed");null===a.Qb&&t.l("Need to call beginFigure first");b=new S(pd,h,k,b,c,d,e,g);a.Qb.Ga.add(b)}
J.makeGeometry=function(a,b,c){var d=a.Ca,e=d.width,d=d.height;void 0!==b&&!isNaN(b)&&isFinite(b)&&(e=b);void 0!==c&&!isNaN(c)&&isFinite(c)&&(d=c);isFinite(e)||(e=100);isFinite(d)||(d=100);var g=void 0;if("None"!==a.fn)g=J.No(a.fn);else if("None"!==a.jw)g=J.No(a.jw);else{var h=J.Qi[a.Ib];"string"===typeof h&&(h=J.Qi[h]);void 0===h&&t.l("Unknown Shape.figure: "+a.Ib);g=h(a,e,d);g.de=new pa(e,d)}void 0===g&&(h=J.Qi.Rectangle)&&(g=h(a,e,d));g.yu=b;g.xu=c;return g};
J.Hi=function(a,b,c,d,e,g,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+g*l;e=e*s+h*l;g=g*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+g*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=g};J.Go=function(a){a=J.Gm(a);var b=t.Cb();b[0]=a[0];for(var c=1,d=1;c<a.length;c+=2,d+=3)b[d]=a[c],b[d+1]=a[c],b[d+2]=a[c+1];t.Da(a);return b};
J.Gm=function(a){var b=J.el(a),c=t.Cb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var g=0;g<e;g++){var h=b[g],k=b[g+1],l=b[(d+g-1)%e],m=b[(d+g+a)%e];c[2*g]=h;c[2*g+1]=J.kl(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new C)}c[c.length]=c[0];t.Da(b);return c};J.kl=function(a,b,c,d,e,g,h,k,l){c=a-c;h=e-h;0===c||0===h?0===c?(h=(g-k)/h,k=a,e=h*k+(g-h*e)):(d=(b-d)/c,k=e,e=d*k+(b-d*a)):(d=(b-d)/c,h=(g-k)/h,a=b-d*a,k=(g-h*e-a)/(d-h),e=d*k+a);l.q(k,e);return l};
J.el=function(a){for(var b=t.Cb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new C(0.5+0.5*Math.cos(d),0.5+0.5*Math.sin(d));b.push(b[0]);return b};J.tB=(new K(0.156,0.156)).Na();J.uB=(new K(0.844,0.844)).Na();
J.Qi={None:"Rectangle",Rectangle:function(a,b,c){a=new M;a.type=Uc;a.na=0;a.oa=0;a.D=b;a.F=c;return a},Square:function(a,b,c){a=new M;a.kc=Yg;a.type=Uc;a.na=0;a.oa=0;a.D=b;a.F=c;return a},Ellipse:function(a,b,c){a=new M;a.type=Vc;a.na=0;a.oa=0;a.D=b;a.F=c;a.G=J.tB;a.H=J.uB;return a},Circle:function(a,b,c){a=new M;a.kc=Yg;a.type=Vc;a.na=0;a.oa=0;a.D=b;a.F=c;a.G=J.tB;a.H=J.uB;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new M;var d=new Mc,e=new S;e.D=b;e.F=0.5*c;d.Ga.add(e);b=new S;
b.D=0;b.F=c;d.Ga.add(b.close());a.ub.add(d);a.G=new K(0,0.25);a.H=new K(0.5,0.75);return a},TriangleDown:function(a,b,c){a=new M;var d=new Mc,e=new S;e.D=b;e.F=0;d.Ga.add(e);e=new S;e.D=0.5*b;e.F=c;d.Ga.add(e.close());a.ub.add(d);a.G=new K(0.25,0);a.H=new K(0.75,0.5);return a},TriangleLeft:function(a,b,c){a=new M;var d=new Mc;d.na=b;d.oa=c;var e=new S;e.D=0;e.F=0.5*c;d.Ga.add(e);c=new S;c.D=b;c.F=0;d.Ga.add(c.close());a.ub.add(d);a.G=new K(0.5,0.25);a.H=new K(1,0.75);return a},TriangleUp:function(a,
b,c){a=new M;var d=new Mc;d.na=b;d.oa=c;var e=new S;e.D=0;e.F=c;d.Ga.add(e);c=new S;c.D=0.5*b;c.F=0;d.Ga.add(c.close());a.ub.add(d);a.G=new K(0.25,0.5);a.H=new K(0.75,1);return a},Line1:function(a,b,c){a=new M;a.type=Tc;a.na=0;a.oa=0;a.D=b;a.F=c;return a},Line2:function(a,b,c){a=new M;a.type=Tc;a.na=b;a.oa=0;a.D=0;a.F=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new M;a.type=Tc;a.na=0;a.oa=c/2;a.D=b;a.F=c/2;return a},LineV:function(a,b,c){a=new M;a.type=Tc;a.na=b/2;a.oa=0;a.D=b/2;a.F=c;return a},
Curve1:function(a,b,c){var d=J.va;a=t.u();O(a,0,0,!1);P(a,d*b,0,1*b,(1-d)*c,b,c);b=a.s;t.v(a);return b},Curve2:function(a,b,c){var d=J.va;a=t.u();O(a,0,0,!1);P(a,0,d*c,(1-d)*b,c,b,c);b=a.s;t.v(a);return b},Curve3:function(a,b,c){var d=J.va;a=t.u();O(a,1*b,0,!1);P(a,1*b,d*c,d*b,1*c,0,1*c);b=a.s;t.v(a);return b},Curve4:function(a,b,c){var d=J.va;a=t.u();O(a,1*b,0,!1);P(a,(1-d)*b,0,0,(1-d)*c,0,1*c);b=a.s;t.v(a);return b},Alternative:"Triangle",Merge:"Triangle",Triangle:function(a,b,c){a=t.u();O(a,0.5*
b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.s;b.G=new K(0.25,0.5);b.H=new K(0.75,1);t.v(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(0,0.5*c);a.lineTo(0.5*b,1*c);a.lineTo(1*b,0.5*c,!0);b=a.s;b.G=new K(0.25,0.25);b.H=new K(0.75,0.75);t.v(a);return b},Pentagon:function(a,b,c){var d=J.el(5);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;5>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.2,0.22);b.H=new K(0.8,0.9);t.v(a);return b},DataTransmission:"Hexagon",
Hexagon:function(a,b,c){var d=J.el(6);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.07,0.25);b.H=new K(0.93,0.75);t.v(a);return b},Heptagon:function(a,b,c){var d=J.el(7);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.2,0.15);b.H=new K(0.8,0.85);t.v(a);return b},Octagon:function(a,b,c){var d=J.el(8);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;8>e;e++)a.lineTo(d[e].x*
b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.15,0.15);b.H=new K(0.85,0.85);t.v(a);return b},Nonagon:function(a,b,c){var d=J.el(9);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.17,0.13);b.H=new K(0.82,0.82);t.v(a);return b},Decagon:function(a,b,c){var d=J.el(10);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.16,0.16);b.H=new K(0.84,0.84);t.v(a);return b},Dodecagon:function(a,
b,c){var d=J.el(12);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.16,0.16);b.H=new K(0.84,0.84);t.v(a);return b},FivePointedStar:function(a,b,c){var d=J.Gm(5);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.312,0.383);b.H=new K(0.693,0.765);t.v(a);return b},SixPointedStar:function(a,b,c){var d=J.Gm(6);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*
b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.17,0.251);b.H=new K(0.833,0.755);t.v(a);return b},SevenPointedStar:function(a,b,c){var d=J.Gm(7);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.363,0.361);b.H=new K(0.641,0.709);t.v(a);return b},EightPointedStar:function(a,b,c){var d=J.Gm(8);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.252,0.255);b.H=new K(0.75,0.75);t.v(a);
return b},NinePointedStar:function(a,b,c){var d=J.Gm(9);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.355,0.361);b.H=new K(0.645,0.651);t.v(a);return b},TenPointedStar:function(a,b,c){var d=J.Gm(10);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.281,0.261);b.H=new K(0.723,0.748);t.v(a);return b},FivePointedBurst:function(a,b,c){var d=J.Go(5);a=t.u();O(a,d[0].x*b,d[0].y*
c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.312,0.383);b.H=new K(0.693,0.765);t.v(a);return b},SixPointedBurst:function(a,b,c){var d=J.Go(6);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.17,0.251);b.H=new K(0.833,0.755);t.v(a);return b},SevenPointedBurst:function(a,b,c){var d=J.Go(7);a=t.u();O(a,d[0].x*
b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.363,0.361);b.H=new K(0.641,0.709);t.v(a);return b},EightPointedBurst:function(a,b,c){var d=J.Go(8);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.252,0.255);b.H=new K(0.75,0.75);t.v(a);return b},NinePointedBurst:function(a,b,c){var d=J.Go(9);a=t.u();
O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.355,0.361);b.H=new K(0.645,0.651);t.v(a);return b},TenPointedBurst:function(a,b,c){var d=J.Go(10);a=t.u();O(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)P(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);t.Da(d);Q(a);b=a.s;b.G=new K(0.281,0.261);b.H=new K(0.723,0.748);t.v(a);return b},Cloud:function(a,b,c){a=t.u();O(a,0.08034461*
b,0.1944299*c,!0);P(a,-0.09239631*b,0.07836421*c,0.1406031*b,-0.0542823*c,0.2008615*b,0.05349299*c);P(a,0.2450511*b,-0.00697547*c,0.3776197*b,-0.01112067*c,0.4338609*b,0.074219*c);P(a,0.4539471*b,0,0.6066018*b,-0.02526587*c,0.6558228*b,0.07004196*c);P(a,0.6914277*b,-0.01904177*c,0.8921095*b,-0.01220843*c,0.8921095*b,0.08370865*c);P(a,1.036446*b,0.04105738*c,1.020377*b,0.3022052*c,0.9147671*b,0.3194596*c);P(a,1.04448*b,0.360238*c,0.992256*b,0.5219009*c,0.9082935*b,0.562044*c);P(a,1.032337*b,0.5771781*
c,1.018411*b,0.8120651*c,0.9212406*b,0.8217117*c);P(a,1.028411*b,0.9571472*c,0.8556702*b,1.052487*c,0.7592566*b,0.9156953*c);P(a,0.7431877*b,1.009325*c,0.5624123*b,1.021761*c,0.5101666*b,0.9310455*c);P(a,0.4820677*b,1.031761*c,0.3030112*b,1.002796*c,0.2609328*b,0.9344623*c);P(a,0.2329994*b,1.01518*c,0.03213784*b,1.01518*c,0.08034461*b,0.870098*c);P(a,-0.02812061*b,0.9032597*c,-0.01205169*b,0.6835638*c,0.06829292*b,0.6545475*c);P(a,-0.01812061*b,0.6089503*c,-0.00606892*b,0.4555777*c,0.06427569*b,0.4265613*
c);P(a,-0.01606892*b,0.3892545*c,-0.01205169*b,0.1944299*c,0.08034461*b,0.1944299*c);Q(a);b=a.s;b.G=new K(0.1,0.1);b.H=new K(0.9,0.9);t.v(a);return b},Gate:"Crescent",Crescent:function(a,b,c){a=t.u();O(a,0,0,!0);P(a,1*b,0,1*b,1*c,0,1*c);P(a,0.5*b,0.75*c,0.5*b,0.25*c,0,0);Q(a);b=a.s;b.G=new K(0.511,0.19);b.H=new K(0.776,0.76);t.v(a);return b},FramedRectangle:function(a,b,c){var d=t.u(),e=a?a.yc:0;a=a?a.lt:0;0===e&&(e=0.1);0===a&&(a=0.1);O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,
!0);O(d,e*b,a*c,!1,!0);d.lineTo(e*b,(1-a)*c);d.lineTo((1-e)*b,(1-a)*c);d.lineTo((1-e)*b,a*c,!0);b=d.s;b.G=new K(e,a);b.H=new K(1-e,1-a);t.v(d);return b},Delay:"HalfEllipse",HalfEllipse:function(a,b,c){var d=J.va;a=t.u();O(a,0,0,!0);P(a,d*b,0,1*b,(0.5-d/2)*c,1*b,0.5*c);P(a,1*b,(0.5+d/2)*c,d*b,1*c,0,1*c);Q(a);b=a.s;b.G=new K(0,0.2);b.H=new K(0.75,0.8);t.v(a);return b},Heart:function(a,b,c){a=t.u();O(a,0.5*b,1*c,!0);P(a,0.1*b,0.8*c,0,0.5*c,0*b,0.3*c);P(a,0*b,0,0.45*b,0,0.5*b,0.3*c);P(a,0.55*b,0,1*b,
0,1*b,0.3*c);P(a,b,0.5*c,0.9*b,0.8*c,0.5*b,1*c);Q(a);b=a.s;b.G=new K(0.15,0.29);b.H=new K(0.86,0.68);t.v(a);return b},Spade:function(a,b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(0.51*b,0.01*c);P(a,0.6*b,0.2*c,b,0.25*c,b,0.5*c);P(a,b,0.8*c,0.6*b,0.8*c,0.55*b,0.7*c);P(a,0.5*b,0.75*c,0.55*b,0.95*c,0.75*b,c);a.lineTo(0.25*b,c);P(a,0.45*b,0.95*c,0.5*b,0.75*c,0.45*b,0.7*c);P(a,0.4*b,0.8*c,0,0.8*c,0,0.5*c);P(a,0,0.25*c,0.4*b,0.2*c,0.49*b,0.01*c);Q(a);b=a.s;b.G=new K(0.19,0.26);b.H=new K(0.8,0.68);t.v(a);return b},
Club:function(a,b,c){a=t.u();O(a,0.4*b,0.6*c,!0);P(a,0.5*b,0.75*c,0.45*b,0.95*c,0.15*b,1*c);a.lineTo(0.85*b,c);P(a,0.55*b,0.95*c,0.5*b,0.75*c,0.6*b,0.6*c);var d=0.2,e=0.3,g=0,h=4*(Math.SQRT2-1)/3*d;P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e+0.05)*b,(0.5-h+g-0.02)*c,0.65*b,0.36771243*
c);d=0.2;e=0;g=-0.3;h=4*(Math.SQRT2-1)/3*d;P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,0.35*b,0.36771243*c);d=0.2;e=-0.3;g=0;h=4*(Math.SQRT2-1)/3*d;P(a,(0.5+d+e-0.05)*b,(0.5-h+g-0.02)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+
e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,0.4*b,0.6*c);Q(a);b=a.s;b.G=new K(0.06,0.39);b.H=new K(0.93,0.58);t.v(a);return b},Ring:function(a,b,c){a=t.u();var d=4*(Math.SQRT2-1)/3*0.5;O(a,b,0.5*c,!0);P(a,b,(0.5-d)*c,(0.5+d)*b,0,0.5*b,0);P(a,(0.5-d)*b,0,0,(0.5-d)*c,0,0.5*c);P(a,0,(0.5+d)*c,(0.5-d)*b,c,0.5*b,c);P(a,(0.5+d)*b,c,b,(0.5+d)*c,b,0.5*c);d=4*(Math.SQRT2-1)/3*0.4;O(a,
0.5*b,0.1*c,!0,!0);P(a,(0.5+d)*b,0.1*c,0.9*b,(0.5-d)*c,0.9*b,0.5*c);P(a,0.9*b,(0.5+d)*c,(0.5+d)*b,0.9*c,0.5*b,0.9*c);P(a,(0.5-d)*b,0.9*c,0.1*b,(0.5+d)*c,0.1*b,0.5*c);P(a,0.1*b,(0.5-d)*c,(0.5-d)*b,0.1*c,0.5*b,0.1*c);b=a.s;b.G=new K(0.146,0.146);b.H=new K(0.853,0.853);b.kc=Yg;t.v(a);return b},YinYang:function(a,b,c){var d=0.5;a=t.u();d=0.5;O(a,0.5*b,0,!0);a.arcTo(270,180,0.5*b,0.5*b,0.5*b);P(a,1*b,d*c,0,d*c,d*b,0,!0);var d=0.1,e=0.25;O(a,(0.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,0.5*b,c*e,d*b);Q(a);O(a,0.5*
b,0,!1);a.arcTo(270,-180,0.5*b,0.5*b,0.5*b);a.ab(!1);e=0.75;O(a,(0.5+d)*b,e*c,!0);a.arcTo(0,360,0.5*b,c*e,d*b);Q(a);b=a.s;b.kc=Yg;t.v(a);return b},Peace:function(a,b,c){a=t.u();var d=4*(Math.SQRT2-1)/3*0.5;O(a,b,0.5*c,!0);P(a,b,(0.5-d)*c,(0.5+d)*b,0,0.5*b,0);P(a,(0.5-d)*b,0,0,(0.5-d)*c,0,0.5*c);P(a,0,(0.5+d)*c,(0.5-d)*b,c,0.5*b,c);P(a,(0.5+d)*b,c,b,(0.5+d)*c,b,0.5*c);d=4*(Math.SQRT2-1)/3*0.4;O(a,0.5*b,0.1*c,!0,!0);P(a,(0.5+d)*b,0.1*c,0.9*b,(0.5-d)*c,0.9*b,0.5*c);P(a,0.9*b,(0.5+d)*c,(0.5+d)*b,0.9*
c,0.5*b,0.9*c);P(a,(0.5-d)*b,0.9*c,0.1*b,(0.5+d)*c,0.1*b,0.5*c);P(a,0.1*b,(0.5-d)*c,(0.5-d)*b,0.1*c,0.5*b,0.1*c);var d=0.07,e=0,g=-0.707*0.11,h=4*(Math.SQRT2-1)/3*d;O(a,(0.5+d+e)*b,(0.5+g)*c,!0);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);d=0.07;
e=-0.707*0.11;g=0.707*0.11;h=4*(Math.SQRT2-1)/3*d;O(a,(0.5+d+e)*b,(0.5+g)*c,!0);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);d=0.07;e=0.707*0.11;g=0.707*0.11;h=4*(Math.SQRT2-1)/3*d;O(a,(0.5+d+e)*b,(0.5+g)*c,!0);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+
e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);b=a.s;b.G=new K(0.146,0.146);b.H=new K(0.853,0.853);b.kc=Yg;t.v(a);return b},NotAllowed:function(a,b,c){var d=J.va,e=0.5*d,g=0.5;a=t.u();O(a,0.5*b,(0.5-g)*c,!0);P(a,(0.5-e)*b,(0.5-g)*c,(0.5-g)*b,(0.5-e)*c,(0.5-g)*b,0.5*c);P(a,(0.5-g)*b,
(0.5+e)*c,(0.5-e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,(0.5+e)*b,(0.5+g)*c,(0.5+g)*b,(0.5+e)*c,(0.5+g)*b,0.5*c);P(a,(0.5+g)*b,(0.5-e)*c,(0.5+e)*b,(0.5-g)*c,0.5*b,(0.5-g)*c);var g=0.4,e=0.4*d,d=t.O(),h=t.O(),k=t.O(),l=t.O();J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-e,0.5+g,0.5,0.42,d,h,k,l,l);var m=t.O(),n=t.O(),p=t.O();J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-e,0.5+g,0.5,0.58,l,l,p,m,n);var q=t.O(),r=t.O(),s=t.O();J.Hi(0.5,0.5+g,0.5-e,0.5+g,0.5-g,0.5+e,0.5-g,0.5,0.42,q,r,s,l,l);var v=t.O(),x=t.O(),E=t.O();J.Hi(0.5,
0.5+g,0.5-e,0.5+g,0.5-g,0.5+e,0.5-g,0.5,0.58,l,l,E,v,x);O(a,E.x*b,E.y*c,!0,!0);P(a,v.x*b,v.y*c,x.x*b,x.y*c,(0.5-g)*b,0.5*c);P(a,(0.5-g)*b,(0.5-e)*c,(0.5-e)*b,(0.5-g)*c,0.5*b,(0.5-g)*c);P(a,d.x*b,d.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(E.x*b,E.y*c);Q(a);O(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);P(a,m.x*b,m.y*c,n.x*b,n.y*c,(0.5+g)*b,0.5*c);P(a,(0.5+g)*b,(0.5+e)*c,(0.5+e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);Q(a);t.B(d);t.B(h);t.B(k);t.B(l);t.B(m);t.B(n);t.B(p);t.B(q);
t.B(r);t.B(s);t.B(v);t.B(x);t.B(E);b=a.s;t.v(a);b.kc=Yg;return b},Fragile:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.25*b,0);a.lineTo(0.2*b,0.15*c);a.lineTo(0.3*b,0.25*c);a.lineTo(0.29*b,0.33*c);a.lineTo(0.35*b,0.25*c);a.lineTo(0.3*b,0.15*c);a.lineTo(0.4*b,0);a.lineTo(1*b,0);P(a,1*b,0.25*c,0.75*b,0.5*c,0.55*b,0.5*c);a.lineTo(0.55*b,0.9*c);a.lineTo(0.7*b,0.9*c);a.lineTo(0.7*b,1*c);a.lineTo(0.3*b,1*c);a.lineTo(0.3*b,0.9*c);a.lineTo(0.45*b,0.9*c);a.lineTo(0.45*b,0.5*c);P(a,0.25*b,0.5*c,0,0.25*c,
0,0);Q(a);b=a.s;b.G=new K(0.25,0);b.H=new K(0.75,0.4);t.v(a);return b},HourGlass:function(a,b,c){a=t.u();O(a,0.65*b,0.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0.35*b,0.5*c);a.lineTo(0,0);a.lineTo(1*b,0);Q(a);b=a.s;t.v(a);return b},Lightning:function(a,b,c){a=t.u();O(a,0*b,0.55*c,!0);a.lineTo(0.75*b,0);a.lineTo(0.25*b,0.45*c);a.lineTo(0.9*b,0.48*c);a.lineTo(0.4*b,1*c);a.lineTo(0.65*b,0.55*c);Q(a);b=a.s;t.v(a);return b},Parallelogram1:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=t.u();
O(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);Q(d);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);t.v(d);return b},Input:"Output",Output:function(a,b,c){a=t.u();O(a,0,1*c,!0);a.lineTo(0.1*b,0);a.lineTo(1*b,0);a.lineTo(0.9*b,1*c);Q(a);b=a.s;b.G=new K(0.1,0);b.H=new K(0.9,1);t.v(a);return b},Parallelogram2:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.25);var d=t.u();O(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);Q(d);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);t.v(d);return b},
ThickCross:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.25);var d=t.u();O(d,(0.5-a/2)*b,0,!0);d.lineTo((0.5+a/2)*b,0);d.lineTo((0.5+a/2)*b,(0.5-a/2)*c);d.lineTo(1*b,(0.5-a/2)*c);d.lineTo(1*b,(0.5+a/2)*c);d.lineTo((0.5+a/2)*b,(0.5+a/2)*c);d.lineTo((0.5+a/2)*b,1*c);d.lineTo((0.5-a/2)*b,1*c);d.lineTo((0.5-a/2)*b,(0.5+a/2)*c);d.lineTo(0,(0.5+a/2)*c);d.lineTo(0,(0.5-a/2)*c);d.lineTo((0.5-a/2)*b,(0.5-a/2)*c);Q(d);b=d.s;b.G=new K(0.5-a/2,0.5-a/2);b.H=new K(0.5+a/2,0.5+a/2);t.v(d);return b},ThickX:function(a,b,
c){a=0.25/Math.SQRT2;var d=t.u();O(d,0.3*b,0,!0);d.lineTo(0.5*b,0.2*c);d.lineTo(0.7*b,0);d.lineTo(1*b,0.3*c);d.lineTo(0.8*b,0.5*c);d.lineTo(1*b,0.7*c);d.lineTo(0.7*b,1*c);d.lineTo(0.5*b,0.8*c);d.lineTo(0.3*b,1*c);d.lineTo(0,0.7*c);d.lineTo(0.2*b,0.5*c);d.lineTo(0,0.3*c);Q(d);b=d.s;b.G=new K(0.5-a,0.5-a);b.H=new K(0.5+a,0.5+a);t.v(d);return b},ThinCross:function(a,b,c){var d=a?a.yc:0;0===d&&(d=0.1);a=t.u();O(a,(0.5-d/2)*b,0,!0);a.lineTo((0.5+d/2)*b,0);a.lineTo((0.5+d/2)*b,(0.5-d/2)*c);a.lineTo(1*b,
(0.5-d/2)*c);a.lineTo(1*b,(0.5+d/2)*c);a.lineTo((0.5+d/2)*b,(0.5+d/2)*c);a.lineTo((0.5+d/2)*b,1*c);a.lineTo((0.5-d/2)*b,1*c);a.lineTo((0.5-d/2)*b,(0.5+d/2)*c);a.lineTo(0,(0.5+d/2)*c);a.lineTo(0,(0.5-d/2)*c);a.lineTo((0.5-d/2)*b,(0.5-d/2)*c);Q(a);b=a.s;t.v(a);return b},ThinX:function(a,b,c){a=t.u();O(a,0.1*b,0,!0);a.lineTo(0.5*b,0.4*c);a.lineTo(0.9*b,0);a.lineTo(1*b,0.1*c);a.lineTo(0.6*b,0.5*c);a.lineTo(1*b,0.9*c);a.lineTo(0.9*b,1*c);a.lineTo(0.5*b,0.6*c);a.lineTo(0.1*b,1*c);a.lineTo(0,0.9*c);a.lineTo(0.4*
b,0.5*c);a.lineTo(0,0.1*c);Q(a);return a.s},RightTriangle:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);Q(a);b=a.s;b.G=new K(0,0.5);b.H=new K(0.5,1);t.v(a);return b},RoundedIBeam:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(1*b,0);P(a,0.5*b,0.25*c,0.5*b,0.75*c,1*b,1*c);a.lineTo(0,1*c);P(a,0.5*b,0.75*c,0.5*b,0.25*c,0,0);Q(a);b=a.s;t.v(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.yc:0;0>=d&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*J.va;var e=t.u();O(e,d,0,!0);
e.lineTo(b-d,0);P(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);P(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);P(e,a,c,0,c-a,0,c-d);e.lineTo(0,d);P(e,0,a,a,0,d,0);Q(e);b=e.s;1<a?(b.G=new K(0,0,a,a),b.H=new K(1,1,-a,-a)):(b.G=Sb,b.H=$b);t.v(e);return b},Border:function(a,b,c){var d=a?a.yc:0;0>=d&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=t.u();O(a,d,0,!0);a.lineTo(b-d,0);P(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);P(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);P(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);P(a,0,0,0,0,d,0);Q(a);b=a.s;b.G=Sb;b.H=$b;
t.v(a);return b},SquareIBeam:function(a,b,c){var d=a?a.yc:0;0===d&&(d=0.2);a=t.u();O(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,d*c);a.lineTo((0.5+d/2)*b,d*c);a.lineTo((0.5+d/2)*b,(1-d)*c);a.lineTo(1*b,(1-d)*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,(1-d)*c);a.lineTo((0.5-d/2)*b,(1-d)*c);a.lineTo((0.5-d/2)*b,d*c);a.lineTo(0,d*c);Q(a);b=a.s;t.v(a);return b},Trapezoid:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.2);var d=t.u();O(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);b=d.s;
b.G=new K(a,0);b.H=new K(1-a,1);t.v(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=a?a.yc:0;a=t.u();O(a,d,0,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(0.9*b,1*c);a.lineTo(0.1*b,1*c);Q(a);b=a.s;b.G=new K(0.1,0);b.H=new K(0.9,1);t.v(a);return b},GenderMale:function(a,b,c){a=t.u();var d=J.va,e=0.4*d,g=0.4,h=t.O(),k=t.O(),l=t.O(),m=t.O();O(a,(0.5-g)*b,0.5*c,!0);P(a,(0.5-g)*b,(0.5-e)*c,(0.5-e)*b,(0.5-g)*c,0.5*b,(0.5-g)*c);J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-e,0.5+g,0.5,
0.44,l,m,k,h,h);P(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);var n=t.ic(k.x,k.y);J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-e,0.5+g,0.5,0.56,h,h,k,l,m);var p=t.ic(k.x,k.y);a.lineTo((0.1*n.x+0.855)*b,0.1*n.y*c);a.lineTo(0.85*b,0.1*n.y*c);a.lineTo(0.85*b,0);a.lineTo(1*b,0);a.lineTo(1*b,0.15*c);a.lineTo((0.1*p.x+0.9)*b,0.15*c);a.lineTo((0.1*p.x+0.9)*b,(0.1*p.y+0.05*0.9)*c);a.lineTo(p.x*b,p.y*c);P(a,l.x*b,l.y*c,m.x*b,m.y*c,(0.5+g)*b,0.5*c);P(a,(0.5+g)*b,(0.5+e)*c,(0.5+e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,(0.5-e)*
b,(0.5+g)*c,(0.5-g)*b,(0.5+e)*c,(0.5-g)*b,0.5*c);g=0.35;e=0.35*d;O(a,0.5*b,(0.5-g)*c,!0,!0);P(a,(0.5-e)*b,(0.5-g)*c,(0.5-g)*b,(0.5-e)*c,(0.5-g)*b,0.5*c);P(a,(0.5-g)*b,(0.5+e)*c,(0.5-e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,(0.5+e)*b,(0.5+g)*c,(0.5+g)*b,(0.5+e)*c,(0.5+g)*b,0.5*c);P(a,(0.5+g)*b,(0.5-e)*c,(0.5+e)*b,(0.5-g)*c,0.5*b,(0.5-g)*c);O(a,(0.5-g)*b,0.5*c,!0);t.B(h);t.B(k);t.B(l);t.B(m);t.B(n);t.B(p);b=a.s;b.G=new K(0.202,0.257);b.H=new K(0.692,0.839);b.kc=Yg;t.v(a);return b},GenderFemale:function(a,
b,c){a=t.u();var d=0.375,e=0,g=-0.125,h=4*(Math.SQRT2-1)/3*d;O(a,(0.525+e)*b,(0.5+d+g)*c,!0);P(a,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+d+e)*b,(0.5+g)*c);P(a,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5-h+e)*b,(0.5-d+g)*c,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-h+e)*b,(0.5+d+g)*c,(0.475+e)*b,(0.5+d+g)*c);a.lineTo(0.475*b,0.85*c);a.lineTo(0.425*b,0.85*c);a.lineTo(0.425*b,0.9*c);a.lineTo(0.475*b,0.9*c);a.lineTo(0.475*
b,1*c);a.lineTo(0.525*b,1*c);a.lineTo(0.525*b,0.9*c);a.lineTo(0.575*b,0.9*c);a.lineTo(0.575*b,0.85*c);a.lineTo(0.525*b,0.85*c);Q(a);d=0.325;e=0;g=-0.125;h=4*(Math.SQRT2-1)/3*d;O(a,(0.5+d+e)*b,(0.5+g)*c,!0,!0);P(a,(0.5+d+e)*b,(0.5+h+g)*c,(0.5+h+e)*b,(0.5+d+g)*c,(0.5+e)*b,(0.5+d+g)*c);P(a,(0.5-h+e)*b,(0.5+d+g)*c,(0.5-d+e)*b,(0.5+h+g)*c,(0.5-d+e)*b,(0.5+g)*c);P(a,(0.5-d+e)*b,(0.5-h+g)*c,(0.5-h+e)*b,(0.5-d+g)*c,(0.5+e)*b,(0.5-d+g)*c);P(a,(0.5+h+e)*b,(0.5-d+g)*c,(0.5+d+e)*b,(0.5-h+g)*c,(0.5+d+e)*b,(0.5+
g)*c);O(a,(0.525+e)*b,(0.5+d+g)*c,!0);b=a.s;b.G=new K(0.232,0.136);b.H=new K(0.782,0.611);b.kc=Yg;t.v(a);return b},PlusLine:function(a,b,c){a=t.u();O(a,0,0.5*c,!1);a.lineTo(1*b,0.5*c);a.moveTo(0.5*b,0);a.lineTo(0.5*b,1*c);b=a.s;t.v(a);return b},XLine:function(a,b,c){a=t.u();O(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},AsteriskLine:function(a,b,c){a=t.u();var d=0.2/Math.SQRT2;O(a,d*b,(1-d)*c,!1);a.lineTo((1-d)*b,d*c);a.moveTo(d*b,d*c);a.lineTo((1-d)*b,(1-d)*
c);a.moveTo(0*b,0.5*c);a.lineTo(1*b,0.5*c);a.moveTo(0.5*b,0*c);a.lineTo(0.5*b,1*c);b=a.s;t.v(a);return b},CircleLine:function(a,b,c){var d=0.5*J.va;a=t.u();O(a,1*b,0.5*c,!1);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);b=a.s;b.G=new K(0.146,0.146);b.H=new K(0.853,0.853);b.kc=Yg;t.v(a);return b},Pie:function(a,b,c){a=t.u();var d=4*(Math.SQRT2-1)/3*0.5;O(a,(0.5*Math.SQRT2/2+0.5)*b,(0.5-
0.5*Math.SQRT2/2)*c,!0);P(a,0.7*b,0*c,0.5*b,0*c,0.5*b,0*c);P(a,(0.5-d+0)*b,0*c,0*b,(0.5-d+0)*c,0*b,0.5*c);P(a,0*b,(0.5+d+0)*c,(0.5-d+0)*b,1*c,0.5*b,1*c);P(a,(0.5+d+0)*b,1*c,1*b,(0.5+d+0)*c,1*b,0.5*c);a.lineTo(0.5*b,0.5*c);Q(a);b=a.s;t.v(a);return b},PiePiece:function(a,b,c){var d=J.va/Math.SQRT2*0.5,e=Math.SQRT2/2,g=1-Math.SQRT2/2;a=t.u();O(a,b,c,!0);P(a,b,(1-d)*c,(e+d)*b,(g+d)*c,e*b,g*c);a.lineTo(0,c);Q(a);b=a.s;t.v(a);return b},StopSign:function(a,b,c){a=1/(Math.SQRT2+2);var d=t.u();O(d,a*b,0,!0);
d.lineTo((1-a)*b,0);d.lineTo(1*b,a*c);d.lineTo(1*b,(1-a)*c);d.lineTo((1-a)*b,1*c);d.lineTo(a*b,1*c);d.lineTo(0,(1-a)*c);d.lineTo(0,a*c);Q(d);b=d.s;b.G=new K(a/2,a/2);b.H=new K(1-a/2,1-a/2);t.v(d);return b},LogicImplies:function(a,b,c){var d=a?a.yc:0;0===d&&(d=0.2);a=t.u();O(a,(1-d)*b,0*c,!1);a.lineTo(1*b,0.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,0.5*c);a.lineTo(b,0.5*c);b=a.s;b.G=Sb;b.H=new K(0.8,0.5);t.v(a);return b},LogicIff:function(a,b,c){var d=a?a.yc:0;0===d&&(d=0.2);a=t.u();O(a,(1-d)*b,0*c,!1);
a.lineTo(1*b,0.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,0.5*c);a.lineTo(b,0.5*c);a.moveTo(d*b,0);a.lineTo(0,0.5*c);a.lineTo(d*b,c);b=a.s;b.G=new K(0.2,0);b.H=new K(0.8,0.5);t.v(a);return b},LogicNot:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},LogicAnd:function(a,b,c){a=t.u();O(a,0,1*c,!1);a.lineTo(0.5*b,0);a.lineTo(1*b,1*c);b=a.s;b.G=new K(0.25,0.5);b.H=new K(0.75,1);t.v(a);return b},LogicOr:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(0.5*b,1*c);a.lineTo(1*
b,0);b=a.s;b.G=new K(0.219,0);b.H=new K(0.78,0.409);t.v(a);return b},LogicXor:function(a,b,c){a=t.u();O(a,0.5*b,0,!1);a.lineTo(0.5*b,1*c);a.moveTo(0,0.5*c);a.lineTo(1*b,0.5*c);var d=0.5*J.va;P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);b=a.s;b.kc=Yg;t.v(a);return b},LogicTruth:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(0.5*b,0);a.lineTo(0.5*b,1*c);b=a.s;t.v(a);return b},
LogicFalsity:function(a,b,c){a=t.u();O(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(0.5*b,1*c);a.lineTo(0.5*b,0);b=a.s;t.v(a);return b},LogicThereExists:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,0.5*c);a.lineTo(0,0.5*c);a.moveTo(1*b,0.5*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);b=a.s;t.v(a);return b},LogicForAll:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(0.5*b,1*c);a.lineTo(1*b,0);a.moveTo(0.25*b,0.5*c);a.lineTo(0.75*b,0.5*c);b=a.s;b.G=new K(0.25,0);b.H=new K(0.75,0.5);t.v(a);return b},
LogicIsDefinedAs:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(b,0);a.moveTo(0,0.5*c);a.lineTo(b,0.5*c);a.moveTo(0,c);a.lineTo(b,c);b=a.s;b.G=new K(0.01,0.01);b.H=new K(0.99,0.49);t.v(a);return b},LogicIntersect:function(a,b,c){var d=0.5*J.va;a=t.u();O(a,0,1*c,!1);a.lineTo(0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);a.lineTo(1*b,1*c);b=a.s;b.G=new K(0,0.5);b.H=$b;t.v(a);return b},LogicUnion:function(a,b,c){var d=0.5*J.va;a=t.u();O(a,1*b,0,!1);a.lineTo(1*b,
0.5*c);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);a.lineTo(0,0);b=a.s;b.G=Sb;b.H=new K(1,0.5);t.v(a);return b},Arrow:function(a,b,c){var d=a?a.yc:0,e=a?a.lt:0;0===d&&(d=0.3);0===e&&(e=0.3);a=t.u();O(a,0,(0.5-e/2)*c,!0);a.lineTo((1-d)*b,(0.5-e/2)*c);a.lineTo((1-d)*b,0);a.lineTo(1*b,0.5*c);a.lineTo((1-d)*b,1*c);a.lineTo((1-d)*b,(0.5+e/2)*c);a.lineTo(0,(0.5+e/2)*c);Q(a);b=a.s;b.G=new K(0,0.5-e/2);d=J.kl(0,0.5+e/2,1,0.5+e/2,1-d,1,1,0.5,t.O());b.H=new K(d.x,d.y);
t.B(d);t.v(a);return b},ISOProcess:"Chevron",Chevron:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.5*b,0);a.lineTo(1*b,0.5*c);a.lineTo(0.5*b,1*c);a.lineTo(0,1*c);a.lineTo(0.5*b,0.5*c);Q(a);b=a.s;t.v(a);return b},DoubleArrow:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.3*b,0.214*c);a.lineTo(0.3*b,0);a.lineTo(1*b,0.5*c);a.lineTo(0.3*b,1*c);a.lineTo(0.3*b,0.786*c);a.lineTo(0,1*c);Q(a);O(a,0.3*b,0.214*c,!1);a.lineTo(0.3*b,0.786*c);a.ab(!1);b=a.s;t.v(a);return b},DoubleEndArrow:function(a,b,c){a=t.u();
O(a,1*b,0.5*c,!0);a.lineTo(0.7*b,1*c);a.lineTo(0.7*b,0.7*c);a.lineTo(0.3*b,0.7*c);a.lineTo(0.3*b,1*c);a.lineTo(0,0.5*c);a.lineTo(0.3*b,0);a.lineTo(0.3*b,0.3*c);a.lineTo(0.7*b,0.3*c);a.lineTo(0.7*b,0);Q(a);b=a.s;c=J.kl(0,0.5,0.3,0,0,0.3,0.3,0.3,t.O());b.G=new K(c.x,c.y);c=J.kl(0.7,1,1,0.5,0.7,0.7,1,0.7,c);b.H=new K(c.x,c.y);t.B(c);t.v(a);return b},IBeamArrow:function(a,b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0.7*b,1*c);a.lineTo(0.7*b,0.7*c);a.lineTo(0.2*b,0.7*c);a.lineTo(0.2*b,1*c);a.lineTo(0,1*c);
a.lineTo(0,0);a.lineTo(0.2*b,0);a.lineTo(0.2*b,0.3*c);a.lineTo(0.7*b,0.3*c);a.lineTo(0.7*b,0);Q(a);b=a.s;b.G=new K(0,0.3);c=J.kl(0.7,1,1,0.5,0.7,0.7,1,0.7,t.O());b.H=new K(c.x,c.y);t.B(c);t.v(a);return b},Pointer:function(a,b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0,1*c);a.lineTo(0.2*b,0.5*c);a.lineTo(0,0);Q(a);b=a.s;b.G=new K(0.2,0.35);c=J.kl(0.2,0.65,1,0.65,0,1,1,0.5,t.O());b.H=new K(c.x,c.y);t.B(c);t.v(a);return b},RoundedPointer:function(a,b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0,1*c);P(a,0.5*
b,0.75*c,0.5*b,0.25*c,0,0);Q(a);b=a.s;b.G=new K(0.4,0.35);c=J.kl(0.2,0.65,1,0.65,0,1,1,0.5,t.O());b.H=new K(c.x,c.y);t.B(c);t.v(a);return b},SplitEndArrow:function(a,b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0.7*b,1*c);a.lineTo(0.7*b,0.7*c);a.lineTo(0,0.7*c);a.lineTo(0.2*b,0.5*c);a.lineTo(0,0.3*c);a.lineTo(0.7*b,0.3*c);a.lineTo(0.7*b,0);Q(a);b=a.s;b.G=new K(0.2,0.3);c=J.kl(0.7,1,1,0.5,0.7,0.7,1,0.7,t.O());b.H=new K(c.x,c.y);t.B(c);t.v(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,
b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0.7*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(0.7*b,0);Q(a);b=a.s;b.G=Sb;b.H=new K(0.7,1);t.v(a);return b},Cone1:function(a,b,c){var d=J.va;a=0.5*d;var e=0.1*d,d=t.u();O(d,0,0.9*c,!0);d.lineTo(0.5*b,0);d.lineTo(1*b,0.9*c);P(d,1*b,(0.9+e)*c,(0.5+a)*b,1*c,0.5*b,1*c);P(d,(0.5-a)*b,1*c,0,(0.9+e)*c,0,0.9*c);Q(d);b=d.s;b.G=new K(0.25,0.5);b.H=new K(0.75,0.97);t.v(d);return b},Cone2:function(a,b,c){a=t.u();O(a,0,0.9*c,!0);P(a,(1-0.85/0.9)*b,1*c,0.85/0.9*b,1*c,
1*b,0.9*c);a.lineTo(0.5*b,0);a.lineTo(0,0.9*c);Q(a);O(a,0,0.9*c,!1);P(a,(1-0.85/0.9)*b,0.8*c,0.85/0.9*b,0.8*c,1*b,0.9*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.5);b.H=new K(0.75,0.82);t.v(a);return b},Cube1:function(a,b,c){a=t.u();O(a,0.5*b,1*c,!0);a.lineTo(1*b,0.85*c);a.lineTo(1*b,0.15*c);a.lineTo(0.5*b,0*c);a.lineTo(0*b,0.15*c);a.lineTo(0*b,0.85*c);Q(a);O(a,0.5*b,1*c,!1);a.lineTo(0.5*b,0.3*c);a.lineTo(0,0.15*c);a.moveTo(0.5*b,0.3*c);a.lineTo(1*b,0.15*c);a.ab(!1);b=a.s;b.G=new K(0,0.3);b.H=new K(0.5,0.85);
t.v(a);return b},Cube2:function(a,b,c){a=t.u();O(a,0,0.3*c,!0);a.lineTo(0*b,1*c);a.lineTo(0.7*b,c);a.lineTo(1*b,0.7*c);a.lineTo(1*b,0*c);a.lineTo(0.3*b,0*c);Q(a);O(a,0,0.3*c,!1);a.lineTo(0.7*b,0.3*c);a.lineTo(1*b,0*c);a.moveTo(0.7*b,0.3*c);a.lineTo(0.7*b,1*c);a.ab(!1);b=a.s;b.G=new K(0,0.3);b.H=new K(0.7,1);t.v(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=J.va;a=0.5*d;var e=0.1*d,d=t.u();O(d,0,0.1*c,!0);P(d,0,(0.1-e)*c,(0.5-a)*b,0,0.5*b,0);P(d,(0.5+a)*b,0,1*b,(0.1-e)*c,1*
b,0.1*c);d.lineTo(b,0.9*c);P(d,1*b,(0.9+e)*c,(0.5+a)*b,1*c,0.5*b,1*c);P(d,(0.5-a)*b,1*c,0,(0.9+e)*c,0,0.9*c);d.lineTo(0,0.1*c);O(d,0,0.1*c,!1);P(d,0,(0.1+e)*c,(0.5-a)*b,0.2*c,0.5*b,0.2*c);P(d,(0.5+a)*b,0.2*c,1*b,(0.1+e)*c,1*b,0.1*c);d.ab(!1);b=d.s;b.G=new K(0,0.2);b.H=new K(1,0.9);t.v(d);return b},Cylinder2:function(a,b,c){var d=J.va;a=0.5*d;var e=0.1*d,d=t.u();O(d,0,0.9*c,!0);d.lineTo(0,0.1*c);P(d,0,(0.1-e)*c,(0.5-a)*b,0,0.5*b,0);P(d,(0.5+a)*b,0,1*b,(0.1-e)*c,1*b,0.1*c);d.lineTo(1*b,0.9*c);P(d,1*
b,(0.9+e)*c,(0.5+a)*b,1*c,0.5*b,1*c);P(d,(0.5-a)*b,1*c,0,(0.9+e)*c,0,0.9*c);O(d,0,0.9*c,!1);P(d,0,(0.9-e)*c,(0.5-a)*b,0.8*c,0.5*b,0.8*c);P(d,(0.5+a)*b,0.8*c,1*b,(0.9-e)*c,1*b,0.9*c);d.ab(!1);b=d.s;b.G=new K(0,0.1);b.H=new K(1,0.8);t.v(d);return b},Cylinder3:function(a,b,c){var d=J.va;a=0.1*d;var e=0.5*d,d=t.u();O(d,0.1*b,0,!0);d.lineTo(0.9*b,0);P(d,(0.9+a)*b,0,1*b,(0.5-e)*c,1*b,0.5*c);P(d,1*b,(0.5+e)*c,(0.9+a)*b,1*c,0.9*b,1*c);d.lineTo(0.1*b,1*c);P(d,(0.1-a)*b,1*c,0,(0.5+e)*c,0,0.5*c);P(d,0,(0.5-
e)*c,(0.1-a)*b,0,0.1*b,0);O(d,0.1*b,0,!1);P(d,(0.1+a)*b,0,0.2*b,(0.5-e)*c,0.2*b,0.5*c);P(d,0.2*b,(0.5+e)*c,(0.1+a)*b,1*c,0.1*b,1*c);d.ab(!1);b=d.s;b.G=new K(0.2,0);b.H=new K(0.9,1);t.v(d);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=J.va;a=0.1*d;var e=0.5*d,d=t.u();O(d,0.9*b,0,!0);P(d,(0.9+a)*b,0,1*b,(0.5-e)*c,1*b,0.5*c);P(d,1*b,(0.5+e)*c,(0.9+a)*b,1*c,0.9*b,1*c);d.lineTo(0.1*b,1*c);P(d,(0.1-a)*b,1*c,0,(0.5+e)*c,0,0.5*c);P(d,0,(0.5-e)*c,(0.1-a)*b,0,0.1*b,0);d.lineTo(0.9*b,0);O(d,
0.9*b,0,!1);P(d,(0.9-a)*b,0,0.8*b,(0.5-e)*c,0.8*b,0.5*c);P(d,0.8*b,(0.5+e)*c,(0.9-a)*b,1*c,0.9*b,1*c);d.ab(!1);b=d.s;b.G=new K(0.1,0);b.H=new K(0.8,1);t.v(d);return b},Prism1:function(a,b,c){a=t.u();O(a,0.25*b,0.25*c,!0);a.lineTo(0.75*b,0);a.lineTo(b,0.5*c);a.lineTo(0.5*b,c);a.lineTo(0,c);Q(a);O(a,0.25*b,0.25*c,!1);a.lineTo(0.5*b,c);a.ab(!1);b=a.s;b.G=new K(0.408,0.172);b.H=new K(0.833,0.662);t.v(a);return b},Prism2:function(a,b,c){a=t.u();O(a,0,0.25*c,!0);a.lineTo(0.75*b,0);a.lineTo(1*b,0.25*c);
a.lineTo(0.75*b,0.75*c);a.lineTo(0,1*c);Q(a);O(a,0,c,!1);a.lineTo(0.25*b,0.5*c);a.lineTo(b,0.25*c);a.moveTo(0,0.25*c);a.lineTo(0.25*b,0.5*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.5);b.H=new K(0.75,0.75);t.v(a);return b},Pyramid1:function(a,b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(b,0.75*c);a.lineTo(0.5*b,1*c);a.lineTo(0,0.75*c);Q(a);O(a,0.5*b,0,!1);a.lineTo(0.5*b,1*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.367);b.H=new K(0.75,0.875);t.v(a);return b},Pyramid2:function(a,b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(b,0.85*
c);a.lineTo(0.5*b,1*c);a.lineTo(0,0.85*c);Q(a);O(a,0.5*b,0,!1);a.lineTo(0.5*b,0.7*c);a.lineTo(0,0.85*c);a.moveTo(0.5*b,0.7*c);a.lineTo(1*b,0.85*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.367);b.H=new K(0.75,0.875);t.v(a);return b},Actor:function(a,b,c){var d=J.va,e=0.2*d,g=0.1*d,h=0.5,k=0.1;a=t.u();O(a,h*b,(k+0.1)*c,!0);P(a,(h-e)*b,(k+0.1)*c,(h-0.2)*b,(k+g)*c,(h-0.2)*b,k*c);P(a,(h-0.2)*b,(k-g)*c,(h-e)*b,(k-0.1)*c,h*b,(k-0.1)*c);P(a,(h+e)*b,(k-0.1)*c,(h+0.2)*b,(k-g)*c,(h+0.2)*b,k*c);P(a,(h+0.2)*b,(k+g)*c,
(h+e)*b,(k+0.1)*c,h*b,(k+0.1)*c);e=0.05;g=d*e;O(a,0.5*b,0.2*c,!0);a.lineTo(0.95*b,0.2*c);h=0.95;k=0.25;P(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);a.lineTo(1*b,0.6*c);a.lineTo(0.85*b,0.6*c);a.lineTo(0.85*b,0.35*c);e=0.025;g=d*e;h=0.825;k=0.35;P(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);P(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(0.8*b,1*c);a.lineTo(0.55*b,1*c);a.lineTo(0.55*b,0.7*c);e=0.05;g=d*e;h=0.5;k=0.7;P(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);P(a,(h-g)*b,(k-e)*
c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(0.45*b,1*c);a.lineTo(0.2*b,1*c);a.lineTo(0.2*b,0.35*c);e=0.025;g=d*e;h=0.175;k=0.35;P(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);P(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(0.15*b,0.6*c);a.lineTo(0*b,0.6*c);a.lineTo(0*b,0.25*c);e=0.05;g=d*e;h=0.05;k=0.25;P(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);a.lineTo(0.5*b,0.2*c);b=a.s;b.G=new K(0.2,0.2);b.H=new K(0.8,0.65);t.v(a);return b},Card:function(a,b,c){a=t.u();O(a,1*b,0*c,!0);a.lineTo(1*
b,1*c);a.lineTo(0*b,1*c);a.lineTo(0*b,0.2*c);a.lineTo(0.2*b,0*c);Q(a);b=a.s;b.G=new K(0,0.2);b.H=$b;t.v(a);return b},Collate:function(a,b,c){a=t.u();O(a,0.5*b,0.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(0.5*b,0.5*c);O(a,0.5*b,0.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0.5*b,0.5*c);b=a.s;b.G=new K(0.25,0);b.H=new K(0.75,0.25);t.v(a);return b},CreateRequest:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);O(d,0,a*
c,!1);d.lineTo(1*b,a*c);d.moveTo(0,(1-a)*c);d.lineTo(1*b,(1-a)*c);d.ab(!1);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);t.v(d);return b},Database:function(a,b,c){a=t.u();var d=J.va,e=0.5*d,d=0.1*d;O(a,1*b,0.1*c,!0);a.lineTo(1*b,0.9*c);P(a,1*b,(0.9+d)*c,(0.5+e)*b,1*c,0.5*b,1*c);P(a,(0.5-e)*b,1*c,0,(0.9+d)*c,0,0.9*c);a.lineTo(0,0.1*c);P(a,0,(0.1-d)*c,(0.5-e)*b,0,0.5*b,0);P(a,(0.5+e)*b,0,1*b,(0.1-d)*c,1*b,0.1*c);O(a,1*b,0.1*c,!1);P(a,1*b,(0.1+d)*c,(0.5+e)*b,0.2*c,0.5*b,0.2*c);P(a,(0.5-e)*b,0.2*c,0,(0.1+d)*
c,0,0.1*c);a.moveTo(1*b,0.2*c);P(a,1*b,(0.2+d)*c,(0.5+e)*b,0.3*c,0.5*b,0.3*c);P(a,(0.5-e)*b,0.3*c,0,(0.2+d)*c,0,0.2*c);a.moveTo(1*b,0.3*c);P(a,1*b,(0.3+d)*c,(0.5+e)*b,0.4*c,0.5*b,0.4*c);P(a,(0.5-e)*b,0.4*c,0,(0.3+d)*c,0,0.3*c);a.ab(!1);b=a.s;b.G=new K(0,0.4);b.H=new K(1,0.9);t.v(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.75*b,0);P(a,1*b,0,1*b,1*c,0.75*b,1*c);a.lineTo(0,1*c);P(a,0.25*b,0.9*c,0.25*b,0.1*c,0,0);Q(a);b=a.s;b.G=new K(0.226,0);b.H=new K(0.81,
1);t.v(a);return b},DiskStorage:function(a,b,c){a=t.u();var d=J.va,e=0.5*d,d=0.1*d;O(a,1*b,0.1*c,!0);a.lineTo(1*b,0.9*c);P(a,1*b,(0.9+d)*c,(0.5+e)*b,1*c,0.5*b,1*c);P(a,(0.5-e)*b,1*c,0,(0.9+d)*c,0,0.9*c);a.lineTo(0,0.1*c);P(a,0,(0.1-d)*c,(0.5-e)*b,0,0.5*b,0);P(a,(0.5+e)*b,0,1*b,(0.1-d)*c,1*b,0.1*c);O(a,1*b,0.1*c,!1);P(a,1*b,(0.1+d)*c,(0.5+e)*b,0.2*c,0.5*b,0.2*c);P(a,(0.5-e)*b,0.2*c,0,(0.1+d)*c,0,0.1*c);a.moveTo(1*b,0.2*c);P(a,1*b,(0.2+d)*c,(0.5+e)*b,0.3*c,0.5*b,0.3*c);P(a,(0.5-e)*b,0.3*c,0,(0.2+d)*
c,0,0.2*c);a.ab(!1);b=a.s;b.G=new K(0,0.3);b.H=new K(1,0.9);t.v(a);return b},Display:function(a,b,c){a=t.u();O(a,0.25*b,0,!0);a.lineTo(0.75*b,0);P(a,1*b,0,1*b,1*c,0.75*b,1*c);a.lineTo(0.25*b,1*c);a.lineTo(0,0.5*c);Q(a);b=a.s;b.G=new K(0.25,0);b.H=new K(0.75,1);t.v(a);return b},DividedEvent:function(a,b,c){a=a?a.yc:0;0===a?a=0.2:0.15>a&&(a=0.15);var d=t.u(),e=0.2*J.va;O(d,0,0.2*c,!0);P(d,0,(0.2-e)*c,(0.2-e)*b,0,0.2*b,0);d.lineTo(0.8*b,0);P(d,(0.8+e)*b,0,1*b,(0.2-e)*c,1*b,0.2*c);d.lineTo(1*b,0.8*c);
P(d,1*b,(0.8+e)*c,(0.8+e)*b,1*c,0.8*b,1*c);d.lineTo(0.2*b,1*c);P(d,(0.2-e)*b,1*c,0,(0.8+e)*c,0,0.8*c);d.lineTo(0,0.2*c);O(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ab(!1);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);t.v(d);return b},DividedProcess:function(a,b,c){a=a?a.yc:0;0.1>a&&(a=0.1);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);O(d,0,a*c,!1);d.lineTo(1*b,a*c);d.ab(!1);b=d.s;b.G=new K(0,a);b.H=$b;t.v(d);return b},Document:function(a,b,c){c/=0.8;a=t.u();O(a,0,0.7*c,!0);a.lineTo(0,
0);a.lineTo(1*b,0);a.lineTo(1*b,0.7*c);P(a,0.5*b,0.4*c,0.5*b,1*c,0,0.7*c);Q(a);b=a.s;b.G=Sb;b.H=new K(1,0.6);t.v(a);return b},ExternalOrganization:function(a,b,c){a=a?a.yc:0;0.2>a&&(a=0.2);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);O(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.ab(!1);b=d.s;b.G=new K(a/2,a/2);b.H=new K(1-a/2,1-a/2);t.v(d);return b},ExternalProcess:function(a,
b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(1*b,0.5*c);a.lineTo(0.5*b,1*c);a.lineTo(0,0.5*c);Q(a);O(a,0.1*b,0.4*c,!1);a.lineTo(0.1*b,0.6*c);a.moveTo(0.9*b,0.6*c);a.lineTo(0.9*b,0.4*c);a.moveTo(0.6*b,0.1*c);a.lineTo(0.4*b,0.1*c);a.moveTo(0.4*b,0.9*c);a.lineTo(0.6*b,0.9*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.25);b.H=new K(0.75,0.75);t.v(a);return b},File:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.75*b,0);a.lineTo(1*b,0.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);Q(a);O(a,0.75*b,0,!1);a.lineTo(0.75*b,0.25*c);
a.lineTo(1*b,0.25*c);a.ab(!1);b=a.s;b.G=new K(0,0.25);b.H=$b;t.v(a);return b},Interrupt:function(a,b,c){a=t.u();O(a,1*b,0.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,0.5*c);O(a,1*b,0.5*c,!1);a.lineTo(1*b,1*c);O(a,1*b,0.5*c,!1);a.lineTo(1*b,0);b=a.s;b.G=new K(0,0.25);b.H=new K(0.5,0.75);t.v(a);return b},InternalStorage:function(a,b,c){var d=a?a.yc:0;a=a?a.lt:0;0===d&&(d=0.1);0===a&&(a=0.1);var e=t.u();O(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);Q(e);O(e,d*b,0,!1);e.lineTo(d*
b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.ab(!1);b=e.s;b.G=new K(d,a);b.H=$b;t.v(e);return b},Junction:function(a,b,c){a=t.u();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=0.5*J.va;O(a,1*b,0.5*c,!0);P(a,1*b,(0.5+g)*c,(0.5+g)*b,1*c,0.5*b,1*c);P(a,(0.5-g)*b,1*c,0,(0.5+g)*c,0,0.5*c);P(a,0,(0.5-g)*c,(0.5-g)*b,0,0.5*b,0);P(a,(0.5+g)*b,0,1*b,(0.5-g)*c,1*b,0.5*c);O(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.ab(!1);b=a.s;b.kc=Yg;t.v(a);return b},LinedDocument:function(a,
b,c){c/=0.8;a=t.u();O(a,0,0.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,0.7*c);P(a,0.5*b,0.4*c,0.5*b,1*c,0,0.7*c);Q(a);O(a,0.1*b,0,!1);a.lineTo(0.1*b,0.75*c);a.ab(!1);b=a.s;b.G=new K(0.1,0);b.H=new K(1,0.6);t.v(a);return b},LoopLimit:function(a,b,c){a=t.u();O(a,0,1*c,!0);a.lineTo(0,0.25*c);a.lineTo(0.25*b,0);a.lineTo(0.75*b,0);a.lineTo(1*b,0.25*c);a.lineTo(1*b,1*c);Q(a);b=a.s;b.G=new K(0,0.25);b.H=$b;t.v(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=t.u();var d=
0.5*J.va;O(a,0.5*b,1*c,!0);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);P(a,1*b,(0.5+d)*c,(0.5+d)*b,0.9*c,0.6*b,0.9*c);a.lineTo(1*b,0.9*c);a.lineTo(1*b,1*c);a.lineTo(0.5*b,1*c);b=a.s;b.G=new K(0.15,0.15);b.H=new K(0.85,0.8);t.v(a);return b},ManualInput:function(a,b,c){a=t.u();O(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0.25*c);Q(a);b=a.s;b.G=new K(0,0.25);b.H=$b;t.v(a);return b},MessageFromUser:function(a,b,c){a=
a?a.yc:0;0===a&&(a=0.7);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,0.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);b=d.s;b.G=Sb;b.H=new K(a,1);t.v(d);return b},MicroformProcessing:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.25);var d=t.u();O(d,0,0,!0);d.lineTo(0.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0.5*b,(1-a)*c);d.lineTo(0,1*c);Q(d);b=d.s;b.G=new K(0,a);b.H=new K(1,1-a);t.v(d);return b},MicroformRecording:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.75*b,0.25*c);a.lineTo(1*b,
0.15*c);a.lineTo(1*b,0.85*c);a.lineTo(0.75*b,0.75*c);a.lineTo(0,1*c);Q(a);b=a.s;b.G=new K(0,0.25);b.H=new K(1,0.75);t.v(a);return b},MultiDocument:function(a,b,c){c/=0.8;a=t.u();O(a,b,0,!0);a.lineTo(b,0.5*c);P(a,0.96*b,0.47*c,0.93*b,0.45*c,0.9*b,0.44*c);a.lineTo(0.9*b,0.6*c);P(a,0.86*b,0.57*c,0.83*b,0.55*c,0.8*b,0.54*c);a.lineTo(0.8*b,0.7*c);P(a,0.4*b,0.4*c,0.4*b,1*c,0,0.7*c);a.lineTo(0,0.2*c);a.lineTo(0.1*b,0.2*c);a.lineTo(0.1*b,0.1*c);a.lineTo(0.2*b,0.1*c);a.lineTo(0.2*b,0);Q(a);O(a,0.1*b,0.2*c,
!1);a.lineTo(0.8*b,0.2*c);a.lineTo(0.8*b,0.54*c);a.moveTo(0.2*b,0.1*c);a.lineTo(0.9*b,0.1*c);a.lineTo(0.9*b,0.44*c);a.ab(!1);b=a.s;b.G=new K(0,0.25);b.H=new K(0.8,0.77);t.v(a);return b},MultiProcess:function(a,b,c){a=t.u();O(a,0.1*b,0.1*c,!0);a.lineTo(0.2*b,0.1*c);a.lineTo(0.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,0.8*c);a.lineTo(0.9*b,0.8*c);a.lineTo(0.9*b,0.9*c);a.lineTo(0.8*b,0.9*c);a.lineTo(0.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0.2*c);a.lineTo(0.1*b,0.2*c);Q(a);O(a,0.2*b,0.1*c,!1);a.lineTo(0.9*b,
0.1*c);a.lineTo(0.9*b,0.8*c);a.moveTo(0.1*b,0.2*c);a.lineTo(0.8*b,0.2*c);a.lineTo(0.8*b,0.9*c);a.ab(!1);b=a.s;b.G=new K(0,0.2);b.H=new K(0.8,1);t.v(a);return b},OfflineStorage:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=1-a,e=t.u();O(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(0.5*b,1*c);Q(e);O(e,0.5*a*b,a*c,!1);e.lineTo((1-0.5*a)*b,a*c);e.ab(!1);b=e.s;b.G=new K(d/4+0.5*a,a);b.H=new K(3*d/4+0.5*a,a+0.5*d);t.v(e);return b},OffPageConnector:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(0.75*b,0);a.lineTo(1*
b,0.5*c);a.lineTo(0.75*b,1*c);a.lineTo(0,1*c);Q(a);b=a.s;b.G=Sb;b.H=new K(0.75,1);t.v(a);return b},Or:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,1*b,0.5*c,!0);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);O(a,1*b,0.5*c,!1);a.lineTo(0,0.5*c);a.moveTo(0.5*b,1*c);a.lineTo(0.5*b,0);a.ab(!1);b=a.s;b.kc=Yg;t.v(a);return b},PaperTape:function(a,b,c){c/=0.8;a=t.u();O(a,0,0.7*c,!0);a.lineTo(0,
0.3*c);P(a,0.5*b,0.6*c,0.5*b,0,1*b,0.3);a.lineTo(1*b,0.7*c);P(a,0.5*b,0.4*c,0.5*b,1*c,0,0.7*c);Q(a);b=a.s;b.G=new K(0,0.49);b.H=new K(1,0.75);t.v(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.yc:0;a=a?a.lt:0;0===d&&(d=0.1);0===a&&(a=0.3);var e=t.u();O(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1-a)*b,0.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);Q(e);b=e.s;b.G=new K(d,0);b.H=new K(1-a,1);t.v(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.yc:0;a=a?a.lt:0;0===d&&(d=0.1);0===a&&(a=0.3);var e=
t.u();O(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,0.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);Q(e);b=e.s;b.G=new K(d,0);b.H=new K(1-a,1);t.v(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);O(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.ab(!1);b=d.s;b.G=new K(a,0);b.H=new K(1-a,1);t.v(d);return b},Process:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=
t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);Q(d);O(d,a*b,0,!1);d.lineTo(a*b,1*c);d.ab(!1);b=d.s;b.G=new K(a,0);b.H=$b;t.v(d);return b},Sort:function(a,b,c){a=t.u();O(a,0.5*b,0,!0);a.lineTo(1*b,0.5*c);a.lineTo(0.5*b,1*c);a.lineTo(0,0.5*c);Q(a);O(a,0,0.5*c,!1);a.lineTo(1*b,0.5*c);a.ab(!1);b=a.s;b.G=new K(0.25,0.25);b.H=new K(0.75,0.5);t.v(a);return b},Start:function(a,b,c){a=t.u();O(a,0.25*b,0,!0);O(a,0.25*b,0,!0);a.arcTo(270,180,0.75*b,0.5*c,0.25*b,0.5*c);a.arcTo(90,180,0.25*
b,0.5*c,0.25*b,0.5*c);O(a,0.25*b,0,!1);a.lineTo(0.25*b,1*c);a.moveTo(0.75*b,0);a.lineTo(0.75*b,1*c);a.ab(!1);b=a.s;b.G=new K(0.25,0);b.H=new K(0.75,1);t.v(a);return b},Terminator:function(a,b,c){a=t.u();O(a,0.25*b,0,!0);a.arcTo(270,180,0.75*b,0.5*c,0.25*b,0.5*c);a.arcTo(90,180,0.25*b,0.5*c,0.25*b,0.5*c);b=a.s;b.G=new K(0.23,0);b.H=new K(0.77,1);t.v(a);return b},TransmittalTape:function(a,b,c){a=a?a.yc:0;0===a&&(a=0.1);var d=t.u();O(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0.75*b,(1-a)*
c);d.lineTo(0,(1-a)*c);Q(d);b=d.s;b.G=Sb;b.H=new K(1,1-a);t.v(d);return b},AndGate:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,0,0,!0);a.lineTo(0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);a.lineTo(0,1*c);Q(a);b=a.s;b.G=Sb;b.H=new K(0.55,1);t.v(a);return b},Buffer:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(1*b,0.5*c);a.lineTo(0,1*c);Q(a);b=a.s;b.G=new K(0,0.25);b.H=new K(0.5,0.75);t.v(a);return b},Clock:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,1*
b,0.5*c,!0);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);O(a,1*b,0.5*c,!1);a.lineTo(1*b,0.5*c);O(a,0.8*b,0.75*c,!1);a.lineTo(0.8*b,0.25*c);a.lineTo(0.6*b,0.25*c);a.lineTo(0.6*b,0.75*c);a.lineTo(0.4*b,0.75*c);a.lineTo(0.4*b,0.25*c);a.lineTo(0.2*b,0.25*c);a.lineTo(0.2*b,0.75*c);a.ab(!1);b=a.s;b.kc=Yg;t.v(a);return b},Ground:function(a,b,c){a=t.u();O(a,0.5*b,0,!1);a.lineTo(0.5*b,0.4*c);
a.moveTo(0.2*b,0.6*c);a.lineTo(0.8*b,0.6*c);a.moveTo(0.3*b,0.8*c);a.lineTo(0.7*b,0.8*c);a.moveTo(0.4*b,1*c);a.lineTo(0.6*b,1*c);b=a.s;t.v(a);return b},Inverter:function(a,b,c){a=t.u();var d=0.1*J.va;O(a,0.8*b,0.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(0.8*b,0.5*c);O(a,1*b,0.5*c,!0);P(a,1*b,(0.5+d)*c,(0.9+d)*b,0.6*c,0.9*b,0.6*c);P(a,(0.9-d)*b,0.6*c,0.8*b,(0.5+d)*c,0.8*b,0.5*c);P(a,0.8*b,(0.5-d)*c,(0.9-d)*b,0.4*c,0.9*b,0.4*c);P(a,(0.9+d)*b,0.4*c,1*b,(0.5-d)*c,1*b,0.5*c);b=a.s;b.G=new K(0,0.25);
b.H=new K(0.4,0.75);t.v(a);return b},NandGate:function(a,b,c){a=t.u();var d=J.va,e=0.5*d,g=0.4*d,d=0.1*d;O(a,0.8*b,0.5*c,!0);P(a,0.8*b,(0.5+g)*c,(0.4+e)*b,1*c,0.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(0.4*b,0);P(a,(0.4+e)*b,0,0.8*b,(0.5-g)*c,0.8*b,0.5*c);O(a,1*b,0.5*c,!0);P(a,1*b,(0.5+d)*c,(0.9+d)*b,0.6*c,0.9*b,0.6*c);P(a,(0.9-d)*b,0.6*c,0.8*b,(0.5+d)*c,0.8*b,0.5*c);P(a,0.8*b,(0.5-d)*c,(0.9-d)*b,0.4*c,0.9*b,0.4*c);P(a,(0.9+d)*b,0.4*c,1*b,(0.5-d)*c,1*b,0.5*c);b=a.s;b.G=new K(0,0.05);b.H=new K(0.55,
0.95);t.v(a);return b},NorGate:function(a,b,c){a=t.u();var d=J.va,e=0.5,g=d*e,h=0,k=0.5;O(a,0.8*b,0.5*c,!0);P(a,0.7*b,(k+g)*c,(h+g)*b,(k+e)*c,0,1*c);P(a,0.25*b,0.75*c,0.25*b,0.25*c,0,0);P(a,(h+g)*b,(k-e)*c,0.7*b,(k-g)*c,0.8*b,0.5*c);e=0.1;g=0.1*d;h=0.9;k=0.5;O(a,(h-e)*b,k*c,!0);P(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);P(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);P(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);P(a,(h-g)*b,(k+e)*c,(h-e)*b,(k+g)*c,(h-e)*b,k*c);b=a.s;b.G=new K(0.2,0.25);
b.H=new K(0.6,0.75);t.v(a);return b},OrGate:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,0,0,!0);P(a,(0+d+d)*b,0*c,0.8*b,(0.5-d)*c,1*b,0.5*c);P(a,0.8*b,(0.5+d)*c,(0+d+d)*b,1*c,0,1*c);P(a,0.25*b,0.75*c,0.25*b,0.25*c,0,0);Q(a);b=a.s;b.G=new K(0.2,0.25);b.H=new K(0.75,0.75);t.v(a);return b},XnorGate:function(a,b,c){a=t.u();var d=J.va,e=0.5,g=d*e,h=0.2,k=0.5;O(a,0.1*b,0,!1);P(a,0.35*b,0.25*c,0.35*b,0.75*c,0.1*b,1*c);O(a,0.8*b,0.5*c,!0);P(a,0.7*b,(k+g)*c,(h+g)*b,(k+e)*c,0.2*b,1*c);P(a,0.45*b,0.75*c,0.45*
b,0.25*c,0.2*b,0);P(a,(h+g)*b,(k-e)*c,0.7*b,(k-g)*c,0.8*b,0.5*c);e=0.1;g=0.1*d;h=0.9;k=0.5;O(a,(h-e)*b,k*c,!0);P(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);P(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);P(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);P(a,(h-g)*b,(k+e)*c,(h-e)*b,(k+g)*c,(h-e)*b,k*c);b=a.s;b.G=new K(0.4,0.25);b.H=new K(0.65,0.75);t.v(a);return b},XorGate:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,0.1*b,0,!1);P(a,0.35*b,0.25*c,0.35*b,0.75*c,0.1*b,1*c);O(a,0.2*b,0,!0);P(a,(0.2+
d)*b,0*c,0.9*b,(0.5-d)*c,1*b,0.5*c);P(a,0.9*b,(0.5+d)*c,(0.2+d)*b,1*c,0.2*b,1*c);P(a,0.45*b,0.75*c,0.45*b,0.25*c,0.2*b,0);Q(a);b=a.s;b.G=new K(0.4,0.25);b.H=new K(0.8,0.75);t.v(a);return b},Capacitor:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},Resistor:function(a,b,c){a=t.u();O(a,0,0.5*c,!1);a.lineTo(0.1*b,0);a.lineTo(0.2*b,1*c);a.lineTo(0.3*b,0);a.lineTo(0.4*b,1*c);a.lineTo(0.5*b,0);a.lineTo(0.6*b,1*c);a.lineTo(0.7*b,0.5*c);b=a.s;t.v(a);
return b},Inductor:function(a,b,c){a=t.u();var d=0.1*J.va,e=0.1,g=0.5;O(a,(e-0.5*d)*b,(g+0.1)*c,!1);P(a,(e-d)*b,(g+0.1)*c,(e-0.1)*b,(g+d)*c,(e+0.1)*b,(g+d)*c);e=0.3;g=0.5;P(a,(e+0.1)*b,(g+d)*c,(e+d)*b,(g+0.1)*c,e*b,(g+0.1)*c);P(a,(e-d)*b,(g+0.1)*c,(e-0.1)*b,(g+d)*c,(e+0.1)*b,(g+d)*c);g=e=0.5;P(a,(e+0.1)*b,(g+d)*c,(e+d)*b,(g+0.1)*c,e*b,(g+0.1)*c);P(a,(e-d)*b,(g+0.1)*c,(e-0.1)*b,(g+d)*c,(e+0.1)*b,(g+d)*c);e=0.7;g=0.5;P(a,(e+0.1)*b,(g+d)*c,(e+d)*b,(g+0.1)*c,e*b,(g+0.1)*c);P(a,(e-d)*b,(g+0.1)*c,(e-0.1)*
b,(g+d)*c,(e+0.1)*b,(g+d)*c);e=0.9;g=0.5;P(a,(e+0.1)*b,(g+d)*c,(e+d)*b,(g+0.1)*c,(e+0.5*d)*b,(g+0.1)*c);b=a.s;t.v(a);return b},ACvoltageSource:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,0*b,0.5*c,!1);P(a,0*b,(0.5-d)*c,(0.5-d)*b,0*c,0.5*b,0*c);P(a,(0.5+d)*b,0*c,1*b,(0.5-d)*c,1*b,0.5*c);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0*b,(0.5+d)*c,0*b,0.5*c);a.moveTo(0.1*b,0.5*c);P(a,0.5*b,0*c,0.5*b,1*c,0.9*b,0.5*c);b=a.s;b.kc=Yg;t.v(a);return b},DCvoltageSource:function(a,b,c){a=t.u();
O(a,0,0.75*c,!1);a.lineTo(0,0.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},Diode:function(a,b,c){a=t.u();O(a,1*b,0,!1);a.lineTo(1*b,0.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,0.5*c);a.lineTo(1*b,1*c);b=a.s;b.G=new K(0,0.25);b.H=new K(0.5,0.75);t.v(a);return b},Wifi:function(a,b,c){var d=b,e=c;b*=0.38;c*=0.6;a=t.u();var g=J.va,h=0.8*g,k=0.8,l=0,m=0.5,d=(d-b)/2,e=(e-c)/2;O(a,l*b+d,(m+k)*c+e,!0);P(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);P(a,(l-k)*b+d,(m-h)*
c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);P(a,l*b+d,(m-k)*c+e,(l-k+0.5*h)*b+d,(m-h)*c+e,(l-k+0.5*h)*b+d,m*c+e);P(a,(l-k+0.5*h)*b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);Q(a);h=0.4*g;k=0.4;l=0.2;m=0.5;O(a,l*b+d,(m+k)*c+e,!0);P(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);P(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);P(a,l*b+d,(m-k)*c+e,(l-k+0.5*h)*b+d,(m-h)*c+e,(l-k+0.5*h)*b+d,m*c+e);P(a,(l-k+0.5*h)*b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);Q(a);h=0.2*g;k=0.2;
m=l=0.5;O(a,(l-k)*b+d,m*c+e,!0);P(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);P(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);P(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);P(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);h=0.4*g;k=0.4;l=0.8;m=0.5;O(a,l*b+d,(m-k)*c+e,!0);P(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);P(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);P(a,l*b+d,(m+k)*c+e,(l+k-0.5*h)*b+d,(m+h)*c+e,(l+k-0.5*
h)*b+d,m*c+e);P(a,(l+k-0.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);Q(a);h=0.8*g;k=0.8;l=1;m=0.5;O(a,l*b+d,(m-k)*c+e,!0);P(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);P(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);P(a,l*b+d,(m+k)*c+e,(l+k-0.5*h)*b+d,(m+h)*c+e,(l+k-0.5*h)*b+d,m*c+e);P(a,(l+k-0.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);Q(a);b=a.s;t.v(a);return b},Email:function(a,b,c){a=t.u();O(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*
c);a.lineTo(0,0);Q(a);O(a,0,0,!1);a.lineTo(0.5*b,0.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(0.45*b,0.54*c);a.moveTo(1*b,1*c);a.lineTo(0.55*b,0.54*c);a.ab(!1);b=a.s;t.v(a);return b},Ethernet:function(a,b,c){a=t.u();O(a,0.35*b,0,!0);a.lineTo(0.65*b,0);a.lineTo(0.65*b,0.4*c);a.lineTo(0.35*b,0.4*c);a.lineTo(0.35*b,0);Q(a);O(a,0.1*b,1*c,!0,!0);a.lineTo(0.4*b,1*c);a.lineTo(0.4*b,0.6*c);a.lineTo(0.1*b,0.6*c);a.lineTo(0.1*b,1*c);Q(a);O(a,0.6*b,1*c,!0,!0);a.lineTo(0.9*b,1*c);a.lineTo(0.9*b,0.6*c);a.lineTo(0.6*
b,0.6*c);a.lineTo(0.6*b,1*c);Q(a);O(a,0,0.5*c,!1);a.lineTo(1*b,0.5*c);a.moveTo(0.5*b,0.5*c);a.lineTo(0.5*b,0.4*c);a.moveTo(0.75*b,0.5*c);a.lineTo(0.75*b,0.6*c);a.moveTo(0.25*b,0.5*c);a.lineTo(0.25*b,0.6*c);a.ab(!1);b=a.s;t.v(a);return b},Power:function(a,b,c){a=t.u();var d=J.va,e=0.4*d,g=0.4,h=t.O(),k=t.O(),l=t.O(),m=t.O();J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-e,0.5+g,0.5,0.5,h,h,k,l,m);var n=t.ic(k.x,k.y);O(a,k.x*b,k.y*c,!0);P(a,l.x*b,l.y*c,m.x*b,m.y*c,(0.5+g)*b,0.5*c);P(a,(0.5+g)*b,(0.5+e)*c,(0.5+
e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,(0.5-e)*b,(0.5+g)*c,(0.5-g)*b,(0.5+e)*c,(0.5-g)*b,0.5*c);J.Hi(0.5-g,0.5,0.5-g,0.5-e,0.5-e,0.5-g,0.5,0.5-g,0.5,l,m,k,h,h);P(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);e=0.3*d;g=0.3;J.Hi(0.5-g,0.5,0.5-g,0.5-e,0.5-e,0.5-g,0.5,0.5-g,0.5,l,m,k,h,h);a.lineTo(k.x*b,k.y*c);P(a,m.x*b,m.y*c,l.x*b,l.y*c,(0.5-g)*b,0.5*c);P(a,(0.5-g)*b,(0.5+e)*c,(0.5-e)*b,(0.5+g)*c,0.5*b,(0.5+g)*c);P(a,(0.5+e)*b,(0.5+g)*c,(0.5+g)*b,(0.5+e)*c,(0.5+g)*b,0.5*c);J.Hi(0.5,0.5-g,0.5+e,0.5-g,0.5+g,0.5-
e,0.5+g,0.5,0.5,h,h,k,l,m);P(a,m.x*b,m.y*c,l.x*b,l.y*c,k.x*b,k.y*c);Q(a);O(a,0.45*b,0,!0);a.lineTo(0.45*b,0.5*c);a.lineTo(0.55*b,0.5*c);a.lineTo(0.55*b,0);Q(a);t.B(h);t.B(k);t.B(l);t.B(m);t.B(n);b=a.s;b.G=new K(0.25,0.55);b.H=new K(0.75,0.8);t.v(a);return b},Fallout:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,0*b,0.5*c,!0);P(a,0*b,(0.5-d)*c,(0.5-d)*b,0*c,0.5*b,0*c);P(a,(0.5+d)*b,0*c,1*b,(0.5-d)*c,1*b,0.5*c);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0*b,(0.5+d)*c,0*b,0.5*c);var e=
d=0;O(a,(0.3+d)*b,(0.8+e)*c,!0,!0);a.lineTo((0.5+d)*b,(0.5+e)*c);a.lineTo((0.1+d)*b,(0.5+e)*c);a.lineTo((0.3+d)*b,(0.8+e)*c);d=0.4;e=0;Q(a);O(a,(0.3+d)*b,(0.8+e)*c,!0,!0);a.lineTo((0.5+d)*b,(0.5+e)*c);a.lineTo((0.1+d)*b,(0.5+e)*c);a.lineTo((0.3+d)*b,(0.8+e)*c);d=0.2;e=-0.3;Q(a);O(a,(0.3+d)*b,(0.8+e)*c,!0,!0);a.lineTo((0.5+d)*b,(0.5+e)*c);a.lineTo((0.1+d)*b,(0.5+e)*c);a.lineTo((0.3+d)*b,(0.8+e)*c);Q(a);b=a.s;b.kc=Yg;t.v(a);return b},IrritationHazard:function(a,b,c){a=t.u();O(a,0.2*b,0*c,!0);a.lineTo(0.5*
b,0.3*c);a.lineTo(0.8*b,0*c);a.lineTo(1*b,0.2*c);a.lineTo(0.7*b,0.5*c);a.lineTo(1*b,0.8*c);a.lineTo(0.8*b,1*c);a.lineTo(0.5*b,0.7*c);a.lineTo(0.2*b,1*c);a.lineTo(0*b,0.8*c);a.lineTo(0.3*b,0.5*c);a.lineTo(0*b,0.2*c);Q(a);b=a.s;b.G=new K(0.3,0.3);b.H=new K(0.7,0.7);t.v(a);return b},ElectricalHazard:function(a,b,c){a=t.u();O(a,0.37,0*c,!0);a.lineTo(0.5*b,0.11*c);a.lineTo(0.77*b,0.04*c);a.lineTo(0.33*b,0.49*c);a.lineTo(1*b,0.37*c);a.lineTo(0.63*b,0.86*c);a.lineTo(0.77*b,0.91*c);a.lineTo(0.34*b,1*c);a.lineTo(0.34*
b,0.78*c);a.lineTo(0.44*b,0.8*c);a.lineTo(0.65*b,0.56*c);a.lineTo(0*b,0.68*c);Q(a);b=a.s;t.v(a);return b},FireHazard:function(a,b,c){a=t.u();O(a,0.1*b,1*c,!0);P(a,-0.25*b,0.63*c,0.45*b,0.44*c,0.29*b,0*c);P(a,0.48*b,0.17*c,0.54*b,0.35*c,0.51*b,0.42*c);P(a,0.59*b,0.29*c,0.58*b,0.28*c,0.59*b,0.18*c);P(a,0.8*b,0.34*c,0.88*b,0.43*c,0.75*b,0.6*c);P(a,0.87*b,0.48*c,0.88*b,0.43*c,0.88*b,0.31*c);P(a,1.17*b,0.76*c,0.82*b,0.8*c,0.9*b,1*c);Q(a);b=a.s;b.G=new K(0.05,0.645);b.H=new K(0.884,0.908);t.v(a);return b},
BpmnActivityLoop:function(a,b,c){a=t.u();var d=4*(Math.SQRT2-1)/3*0.5;O(a,(0.5*Math.SQRT2/2+0.5)*b,(1-(0.5-0.5*Math.SQRT2/2))*c,!1);P(a,1*b,0.7*c,1*b,0.5*c,1*b,0.5*c);P(a,1*b,(0.5-d+0)*c,(0.5+d+0)*b,0*c,0.5*b,0*c);P(a,(0.5-d+0)*b,0*c,0*b,(0.5-d+0)*c,0*b,0.5*c);P(a,0*b,(0.5+d+0)*c,(0.5-d+0)*b,1*c,0.35*b,0.98*c);a.moveTo(0.35*b,0.8*c);a.lineTo(0.35*b,1*c);a.lineTo(0.15*b,1*c);b=a.s;t.v(a);return b},BpmnActivityParallel:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(0.5*b,0);a.lineTo(0.5*
b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},BpmnActivitySequential:function(a,b,c){a=t.u();O(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(0,0.5*c);a.lineTo(1*b,0.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.s;t.v(a);return b},BpmnActivityAdHoc:function(a,b,c){a=t.u();O(a,0,0,!1);O(a,1*b,1*c,!1);O(a,0,0.5*c,!1);P(a,0.2*b,0.35*c,0.3*b,0.35*c,0.5*b,0.5*c);P(a,0.7*b,0.65*c,0.8*b,0.65*c,1*b,0.5*c);b=a.s;t.v(a);return b},BpmnActivityCompensation:function(a,b,c){a=t.u();O(a,0,0.5*c,!0);a.lineTo(0.5*
b,0);a.lineTo(0.5*b,0.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(0.5*b,0.5*c);a.lineTo(0.5*b,1*c);Q(a);b=a.s;t.v(a);return b},BpmnTaskMessage:function(a,b,c){a=t.u();O(a,0,0.2*c,!0);a.lineTo(1*b,0.2*c);a.lineTo(1*b,0.8*c);a.lineTo(0,0.8*c);a.lineTo(0,0.8*c);Q(a);O(a,0,0.2*c,!1);a.lineTo(0.5*b,0.5*c);a.lineTo(1*b,0.2*c);a.ab(!1);b=a.s;t.v(a);return b},BpmnTaskScript:function(a,b,c){a=t.u();O(a,0.7*b,1*c,!0);a.lineTo(0.3*b,1*c);P(a,0.6*b,0.5*c,0,0.5*c,0.3*b,0);a.lineTo(0.7*b,0);P(a,0.4*b,0.5*c,
1*b,0.5*c,0.7*b,1*c);Q(a);O(a,0.45*b,0.73*c,!1);a.lineTo(0.7*b,0.73*c);a.moveTo(0.38*b,0.5*c);a.lineTo(0.63*b,0.5*c);a.moveTo(0.31*b,0.27*c);a.lineTo(0.56*b,0.27*c);a.ab(!1);b=a.s;t.v(a);return b},BpmnTaskUser:function(a,b,c){a=t.u();O(a,0,0,!1);O(a,0.335*b,(1-0.555)*c,!0);a.lineTo(0.335*b,0.595*c);a.lineTo(0.665*b,0.595*c);a.lineTo(0.665*b,(1-0.555)*c);P(a,0.88*b,0.46*c,0.98*b,0.54*c,1*b,0.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0.68*c);P(a,0.02*b,0.54*c,0.12*b,0.46*c,0.335*b,(1-0.555)*
c);a.lineTo(0.365*b,0.405*c);var d=0.5-0.285,e=Math.PI/4,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;P(a,(0.5-(e+d)/2)*b,(d+(d+g)/2)*c,(0.5-d)*b,(d+g)*c,(0.5-d)*b,d*c);P(a,(0.5-d)*b,(d-g)*c,(0.5-e)*b,(d-d)*c,0.5*b,(d-d)*c);P(a,(0.5+e)*b,(d-d)*c,(0.5+d)*b,(d-g)*c,(0.5+d)*b,d*c);P(a,(0.5+d)*b,(d+g)*c,(0.5+(e+d)/2)*b,(d+(d+g)/2)*c,0.635*b,0.405*c);a.lineTo(0.635*b,0.405*c);a.lineTo(0.665*b,(1-0.555)*c);a.lineTo(0.665*b,0.595*c);a.lineTo(0.335*b,0.595*c);O(a,0.2*b,1*c,!1);a.lineTo(0.2*b,0.8*c);O(a,
0.8*b,1*c,!1);a.lineTo(0.8*b,0.8*c);b=a.s;t.v(a);return b},BpmnEventConditional:function(a,b,c){a=t.u();O(a,0.1*b,0,!0);a.lineTo(0.9*b,0);a.lineTo(0.9*b,1*c);a.lineTo(0.1*b,1*c);Q(a);O(a,0.2*b,0.2*c,!1);a.lineTo(0.8*b,0.2*c);a.moveTo(0.2*b,0.4*c);a.lineTo(0.8*b,0.4*c);a.moveTo(0.2*b,0.6*c);a.lineTo(0.8*b,0.6*c);a.moveTo(0.2*b,0.8*c);a.lineTo(0.8*b,0.8*c);a.ab(!1);b=a.s;t.v(a);return b},BpmnEventError:function(a,b,c){a=t.u();O(a,0,1*c,!0);a.lineTo(0.33*b,0);a.lineTo(0.66*b,0.5*c);a.lineTo(1*b,0);a.lineTo(0.66*
b,1*c);a.lineTo(0.33*b,0.5*c);Q(a);b=a.s;t.v(a);return b},BpmnEventEscalation:function(a,b,c){a=t.u();O(a,0,0,!1);O(a,1*b,1*c,!1);O(a,0.1*b,1*c,!0);a.lineTo(0.5*b,0);a.lineTo(0.9*b,1*c);a.lineTo(0.5*b,0.5*c);Q(a);b=a.s;t.v(a);return b},BpmnEventTimer:function(a,b,c){a=t.u();var d=0.5*J.va;O(a,1*b,0.5*c,!0);P(a,1*b,(0.5+d)*c,(0.5+d)*b,1*c,0.5*b,1*c);P(a,(0.5-d)*b,1*c,0,(0.5+d)*c,0,0.5*c);P(a,0,(0.5-d)*c,(0.5-d)*b,0,0.5*b,0);P(a,(0.5+d)*b,0,1*b,(0.5-d)*c,1*b,0.5*c);O(a,0.5*b,0,!1);a.lineTo(0.5*b,0.15*
c);a.moveTo(0.5*b,1*c);a.lineTo(0.5*b,0.85*c);a.moveTo(0,0.5*c);a.lineTo(0.15*b,0.5*c);a.moveTo(1*b,0.5*c);a.lineTo(0.85*b,0.5*c);a.moveTo(0.5*b,0.5*c);a.lineTo(0.58*b,0.1*c);a.moveTo(0.5*b,0.5*c);a.lineTo(0.78*b,0.54*c);a.ab(!1);b=a.s;b.kc=Yg;t.v(a);return b}};for(var Yl in J.Qi)J.Qi[Yl.toLowerCase()]=Yl;
J.Kv={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
BackwardOpenTriangleLine:"m 8,0 l  -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",
BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z  m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",
OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z",None:""};J.GA={};J.Lv={};J.No=function(a){if(J.Kv){for(var b in J.Kv){var c=$c(J.Kv[b],!1);J.Lv[b]=c;b.toLowerCase()!==b&&(J.Lv[b.toLowerCase()]=b)}J.Kv=void 0}return J.Lv[a]};Y.FigureGenerators=J.Qi;Y.ArrowheadGeometries=J.Lv;
function w(a){0===arguments.length?B.call(this):B.call(this,a);this.ca=49663;this.Vn=this.gh="";this.Ir=this.Fr=this.Sr=this.Vq=null;this.Ur="";this.Bg=this.Tr=this.lm=null;this.Hr="";this.jo=null;this.Gr=(new pa(NaN,NaN)).freeze();this.Jr="";this.lo=null;this.ge="";this.Un=this.kq=this.Ck=null;this.ki=(new C(NaN,NaN)).freeze();this.cr="";this.Pk=null;this.dr=Sb;this.mr=J.nG;this.fr=J.mG;this.uq=null;this.Wq=Zl;this.om=(new C(6,6)).freeze();this.nm="gray";this.mm=4;this.AG=-1;this.xG=new D;this.Bj=
null;this.zj=NaN}t.ia("Part",w);t.Oa(w,B);w.prototype.cloneProtected=function(a){B.prototype.cloneProtected.call(this,a);a.ca=this.ca&-4097|49152;a.gh=this.gh;a.Vn=this.Vn;a.Vq=this.Vq;a.Sr=this.Sr;a.Fr=this.Fr;a.Ir=this.Ir;a.Ur=this.Ur;a.Tr=this.Tr;a.Bg=null;a.Hr=this.Hr;a.Gr.assign(this.Gr);a.Jr=this.Jr;a.ge=this.ge;a.kq=this.kq;a.ki.assign(this.ki);a.cr=this.cr;a.dr=this.dr.Z();a.mr=this.mr.Z();a.fr=this.fr.Z();a.uq=this.uq;a.Wq=this.Wq;a.om.assign(this.om);a.nm=this.nm;a.mm=this.mm};
w.prototype.Gh=function(a){B.prototype.Gh.call(this,a);Yj(a);a.lm=null;a.jo=null;a.lo=null;a.Pk=null;a.Bj=null};w.prototype.toString=function(){var a=t.Tg(Object.getPrototypeOf(this))+"#"+t.oc(this);this.data&&(a+="("+la(this.data)+")");return a};w.LayoutNone=0;var Ki;w.LayoutAdded=Ki=1;var Pi;w.LayoutRemoved=Pi=2;var Mh;w.LayoutShown=Mh=4;var Nh;w.LayoutHidden=Nh=8;w.LayoutNodeSized=16;var gj;w.LayoutGroupLayout=gj=32;w.LayoutNodeReplaced=64;var Zl;w.LayoutStandard=Zl=Ki|Pi|Mh|Nh|16|gj|64;
w.prototype.Zm=function(a,b,c,d,e,g,h){var k=this.h;null!==k&&(a===Dd&&"elements"===b?e instanceof B&&Li(e,function(a){Mi(k,a)}):a===Md&&"elements"===b&&e instanceof B&&Li(e,function(a){Oi(k,a)}),k.Vc(a,b,c,d,e,g,h))};w.prototype.updateTargetBindings=w.prototype.Jb=function(a){B.prototype.Jb.call(this,a);if(null!==this.data)for(a=this.elements;a.next();){var b=a.value;b instanceof B&&Li(b,function(a){null!==a.data&&a.Jb()})}};t.A(w,{Fv:"adornments"},function(){return null===this.Bg?t.dh:this.Bg.k});
w.prototype.findAdornment=w.prototype.Mo=function(a){f&&t.j(a,"string",w,"findAdornment:category");var b=this.Bg;return null===b?null:b.Ba(a)};w.prototype.addAdornment=w.prototype.Xk=function(a,b){if(null!==b){f&&(t.j(a,"string",w,"addAdornment:category"),t.m(b,Ve,w,"addAdornment:ad"));var c=null,d=this.Bg;null!==d&&(c=d.Ba(a));if(c!==b){if(null!==c){var e=c.h;null!==e&&e.remove(c)}null===d&&(this.Bg=d=new sa("string",Ve));b.gh!==a&&(b.Qc=a);d.add(a,b);c=this.h;null!==c&&(c.add(b),b.data=this.data)}}};
w.prototype.removeAdornment=w.prototype.tl=function(a){f&&t.j(a,"string",w,"removeAdornment:category");var b=this.Bg;if(null!==b){var c=b.Ba(a);if(null!==c){var d=c.h;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Bg=null)}};w.prototype.clearAdornments=w.prototype.Ae=function(){var a=this.Bg;if(null!==a){for(var b=t.Cb(),a=a.k;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.tl(b[c]);t.Da(b)}};
w.prototype.updateAdornments=function(){var a=this.h;if(null!==a){$l(this,a);for(var a=a.Db.sf.p,b=a.length,c=0;c<b;c++){var d=a[c];d.isEnabled&&d.updateAdornments(this)}for(a=this.Fv;a.next();)b=a.value,b.nl||null!==b.wb&&b.aa()}};
function $l(a,b){if(a.bb&&a.WA){var c=a.an;if(null===c||!(a.ya.Q()&&a.zb()&&c.ol()&&c.ya.Q()))return;var d=a.Mo("Selection");if(null===d){d=a.uF;null===d&&(a instanceof A?d=b.LE:a instanceof w&&(d=a instanceof z?b.kE:b.YE));if(!(d instanceof Ve))return;Xe(d);d=d.copy();if(!(d instanceof Ve))return;d.Qc="Selection";d.nl=!0;d.Pc=c}if(null!==d){var e=d.placeholder;if(null!==e){var g=c.fk(),h=0;c instanceof Y&&(h=c.ib);var k=t.xl();k.q((c.Ia.width+h)*g,(c.Ia.height+h)*g);e.Ca=k;t.dk(k)}d.angle=c.jl();
d.type!==Cg?(e=t.O(),d.location=c.gb(Sb,e),t.B(e)):d.aa();a.Xk("Selection",d);return}}a.tl("Selection")}t.A(w,{layer:"layer"},function(){return this.Un});t.A(w,{h:"diagram"},function(){var a=this.Un;return null!==a?a.h:null});t.g(w,"layerName",w.prototype.Xd);
t.defineProperty(w,{Xd:"layerName"},function(){return this.Vn},function(a){var b=this.Vn;if(b!==a){t.j(a,"string",w,"layerName");var c=this.h;if(null===c||null!==c.il(a))if(this.Vn=a,this.i("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.h,null!==c&&(a=c.il(a),null!==a&&a!==b))){var d=b.Te(-1,this,!0);0<=d&&c.Vc(Md,"parts",b,this,null,d,!0);d=a.Pm(99999999,this,!0);0<=d&&c.Vc(Dd,"parts",a,null,this,!0,d);d=this.ep;if(null!==d){var e=c.Wa;c.Wa=!0;d(this,b,a);c.Wa=e}}}});
t.g(w,"layerChanged",w.prototype.ep);t.defineProperty(w,{ep:"layerChanged"},function(){return this.Vq},function(a){var b=this.Vq;b!==a&&(null!==a&&t.j(a,"function",w,"layerChanged"),this.Vq=a,this.i("layerChanged",b,a))});t.A(w,{pc:"isTemporary"},function(){return null!==this.Un?this.Un.pc:!1});function am(a){var b=a.h;null!==b&&(ci(b),0!==(a.ca&16384)!==!0&&(a.ca|=16384,a.pa(),b.Yf.add(a),b.Nf()))}
function Ih(a){0!==(a.ca&16384)!==!1&&(a.updateAdornments(),a.ca&=-16385,a=a.h,null!==a&&(a.Je=!0))}t.g(w,"location",w.prototype.location);t.defineProperty(w,{location:"location"},function(){return this.ki},function(a){var b=this.ki;if(!(b.N(a)||this instanceof A)){f&&t.m(a,C,w,"location");a=a.Z();var c=this.h;this.ki=a;if(!1===Bi(this)){var d=this.rb,e=a.x-b.x,g=a.y-b.y,h=d.copy();d.q(h.x+e,h.y+g);sk(this);!d.N(h)&&c&&this.i("position",h,d)}this.i("location",b,a)}});
function sk(a){if(!1===Ci(a)){var b=a.h;null!==b&&(b.Yf.add(a),a instanceof y&&!b.Aa.qb&&a.Vg(),b.Nf());bm(a,!0)}}function tk(a){if(!1!==Ci(a)){var b=a.position,c=a.location;c.Q()&&b.Q()||(cm(a,b,c),Uj(a));var b=a.rb,c=a.Fb,d=c.copy();c.Ua();c.x=b.x;c.y=b.y;c.freeze();Vj(a,d,c);bm(a,!1)}}
t.A(w,{Ub:"locationObject"},function(){if(null===this.Pk){var a=this.Zs;void 0!==a&&null!==a&&""!==a?(a=this.le(a),this.Pk=null!==a?a:this):this.Pk=this instanceof Ve&&this.ba!==Cg&&null!==this.wb?this.wb:this}return this.Pk.visible?this.Pk:this});t.g(w,"minLocation",w.prototype.TE);t.defineProperty(w,{TE:"minLocation"},function(){return this.mr},function(a){var b=this.mr;b.N(a)||(f&&t.m(a,C,w,"minLocation"),this.mr=a=a.Z(),this.i("minLocation",b,a))});t.g(w,"maxLocation",w.prototype.NE);
t.defineProperty(w,{NE:"maxLocation"},function(){return this.fr},function(a){var b=this.fr;b.N(a)||(f&&t.m(a,C,w,"maxLocation"),this.fr=a=a.Z(),this.i("maxLocation",b,a))});t.g(w,"locationObjectName",w.prototype.Zs);t.defineProperty(w,{Zs:"locationObjectName"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(f&&t.j(a,"string",w,"locationObjectName"),this.cr=a,this.Pk=null,lk(this),this.i("locationObjectName",b,a))});t.g(w,"locationSpot",w.prototype.We);
t.defineProperty(w,{We:"locationSpot"},function(){return this.dr},function(a){var b=this.dr;b.N(a)||(f&&(t.m(a,K,w,"locationSpot"),a.rd()||t.l("Part.locationSpot must be a specific Spot value, not: "+a)),this.dr=a=a.Z(),lk(this),this.i("locationSpot",b,a))});w.prototype.move=w.prototype.move=function(a){this.position=a};w.prototype.moveTo=w.prototype.moveTo=function(a,b){var c=t.ic(a,b);this.move(c);t.B(c)};
w.prototype.isVisible=w.prototype.zb=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.fb;if(!(null===a||a.Ve&&a.zb()))return!1;if(this instanceof y){a=this.ZD();if(null!==a&&!a.Hc)return!1;a=this.Tc;if(null!==a){var b={};b[t.oc(this)]=!0;return dm(a,b)}}else if(this instanceof A){var b=!0,c=this.h;null!==c&&(b=c.fd);c=this.da;if(null!==c){if(this.xc&&b&&!c.Hc)return!1;c=em(c);if(null===c||c===a)return!1}c=this.ja;if(null!==c){if(this.xc&&!b&&!c.Hc)return!1;
b=em(c);if(null===b||b===a)return!1}}return!0};function dm(a,b){var c=a.da;if(null!==c){var d=c.Tc;if(null!==d)b[t.oc(c)]||(b[t.oc(c)]=!0,dm(d,b));else if(null===em(c))return!1}c=a.ja;if(null!==c)if(d=c.Tc,null!==d)b[t.oc(c)]||(b[t.oc(c)]=!0,dm(d,b));else if(null===em(c))return!1;return!0}
w.prototype.findObject=w.prototype.le=function(a){if(this.name===a)return this;null===this.Bj&&(this.Bj={});var b=this.Bj;if(void 0!==b[a])return b[a];for(var c=this.za.p,d=c.length,e=0;e<d;e++){var g=c[e];if(g.name===a)return b[a]=g;if(g instanceof B)if(!g.AE()){if(g=g.le(a),null!==g)return b[a]=g}else if(Bl(g)&&(g=g.za.eb(),null!==g&&g.name===a))return b[a]=g}return b[a]=null};
function fm(a,b,c,d){void 0===d&&(d=new C);c.qd()&&(c=Vb);var e=b.Ia;d.q(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.Va(d);for(b=b.ga;null!==b&&b!==a;)b.transform.Va(d),b=b.ga;a.Ok.Va(d);d.offset(-a.Lc.x,-a.Lc.y);return d}w.prototype.ensureBounds=w.prototype.Gf=function(){Dh(this,Infinity,Infinity);this.Dc()};
function Lh(a,b,c){c=void 0===c?a.xG:c;var d;isNaN(a.zj)&&(a.zj=Dl(a));d=a.zj;var e=2*d;if(!a.Lh)return c.q(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,g=b.width;b=b.height;var h=a.shadowBlur;a=a.zF;g+=h;b+=h;d-=h/2;e-=h/2;0<a.x?g+=a.x:(d+=a.x,g-=a.x);0<a.y?b+=a.y:(e+=a.y,b-=a.y);c.q(d-1,e-1,g+2,b+2);return c}
w.prototype.Dc=function(){Uj(this);if(!1===Bi(this))tk(this);else{var a=t.wf();a.assign(this.Fb);ik(this);this.Fb.Ua();var b=Hh(this);this.Uj(0,0,this.Lc.width,this.Lc.height);var c=this.position;cm(this,c,this.location);var d=this.Fb;d.x=c.x;d.y=c.y;d.freeze();Uj(this);Vj(this,a,d);a.N(d)?this.Of(b):!this.Ud()||J.I(a.width,d.width)&&J.I(a.height,d.height)||this.K(16);t.Rc(a);bm(this,!1)}};
function cm(a,b,c){var d=NaN,e=NaN,g=t.O(),h=a.We,d=a.Ub;h.qd()&&t.l("Spot must be real: "+h.toString());var e=d.Ia,k=0;d.ib&&(k=d.fe);g.xt(0,0,e.width+k,e.height+k,h);if(d!==a)for(d.ib&&g.offset(-k/2,-k/2),d.transform.Va(g),h=d.ga;null!==h&&h!==a;)h.transform.Va(g),h=h.ga;a.Ok.Va(g);g.offset(-a.Lc.x,-a.Lc.y);h=a.h;c.Q()?(d=c.x-g.x,e=c.y-g.y,c=b.copy(),b.q(d,e),b.N(c)||null===h||(d=h.Bb,h.Bb=!0,a.i("position",c,b),h.Bb=d)):b.Q()&&(d=b.x,e=b.y,b=c.copy(),c.q(d+g.x,e+g.y),c.N(b)||null===h||(d=h.Bb,
h.Bb=!0,a.i("location",b,c),h.Bb=d));t.B(g)}function Ni(a,b,c){ak(a,!1);a instanceof y&&pj(c,a);a.layer.pc||b||c.Fc();b=a.Fb;var d=c.nb;d.Q()?(Hh(a)?xb(b,d)||(a.Of(!1),am(a)):b.If(d)&&a.Of(!0),a.updateAdornments()):c.Lk=!0}w.prototype.ml=function(){return!0};
function Jh(a,b){if(a.visible){var c=a.Fb;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=a.transform,e=a.ga,g=a.Xh;g.reset();null!==e&&(e.bh()?g.multiply(e.he):null!==e.ga&&g.multiply(e.ga.he));g.multiply(a.bd);null!==a.jc&&(fk(a,b,a.jc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.jc&&null===a.Gb&&(b.fillStyle="rgba(0,0,0,0.4)",b.fillRect(c.x,c.y,c.width,c.height));null!==a.Gb&&(d.Ts()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),e=a.Ia,c=e.width,e=e.height,fk(a,b,a.Gb,
!0),b.fillRect(0,0,c+0,e+0),d.Ts()||(c=1/(d.m11*d.m22-d.m12*d.m21),b.transform(d.m22*c,-d.m12*c,-d.m21*c,d.m11*c,c*(d.m21*d.dy-d.m22*d.dx),c*(d.m12*d.dx-d.m11*d.dy))))}}}w.prototype.Ud=function(){return!0};t.g(w,"category",w.prototype.Qc);
t.defineProperty(w,{Qc:"category"},function(){return this.gh},function(a){var b=this.gh;if(b!==a){t.j(a,"string",w,"category");this.gh=a;this.i("category",b,a);var c=this.h,d=this.data;if(null!==c&&null!==d){var e=c.fa;this instanceof A?(e instanceof U?e.xF(d,a):e instanceof Sd&&e.bJ(d,a),c=c.findTemplateForLinkData(d,a),c instanceof A&&(Xe(c),c=c.copy(),c instanceof A&&gm(this,c,b,a))):this instanceof Ve||(null!==e&&e.Mw(d,a),c=c.findTemplateForNodeData(d,a),c instanceof w&&(Xe(c),c=c.copy(),c instanceof
w&&!(c instanceof A)&&gm(this,c,b,a)))}this instanceof Ve&&(a=this.Dh,null!==a&&(c=a.Bg,null!==c&&c.remove(b),a.Xk(this.gh,this)))}});
function gm(a,b,c,d){b.constructor===a.constructor||t.bG||(t.bG=!0,t.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),t.trace("  Old class: "+t.Tg(a)+", new class: "+t.Tg(b)+", part: "+a.toString()));a.Ae();var e=a.data;c=a.Xd;var g=a.bb,h=!0,k=!0,l=!1;a instanceof y&&(h=a.Mh,k=a.Hc,l=a.hn);b.Gh(a);b.cloneProtected(a);a.gh=d;a.aa();a.pa();b=a.h;d=!0;null!==b&&(d=b.Bb,b.Bb=!0);a.Kl=e;null!==e&&a.Jb();null!==b&&(b.Bb=d);e=a.Xd;e!==c&&(a.Vn=c,a.Xd=e);a instanceof
y&&(a.Mh=h,a.Hc=k,a.hn=l,a.Ud()&&a.K(64));a.bb=g}w.prototype.canCopy=function(){if(!this.Oz)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sj)return!1;a=a.h;return null===a?!0:a.Sj?!0:!1};w.prototype.canDelete=function(){if(!this.Rz)return!1;var a=this.layer;if(null===a)return!0;if(!a.$k)return!1;a=a.h;return null===a?!0:a.$k?!0:!1};w.prototype.canEdit=function(){if(!this.hB)return!1;var a=this.layer;if(null===a)return!0;if(!a.Bo)return!1;a=a.h;return null===a?!0:a.Bo?!0:!1};
w.prototype.canGroup=function(){if(!this.eA)return!1;var a=this.layer;if(null===a)return!0;if(!a.xo)return!1;a=a.h;return null===a?!0:a.xo?!0:!1};w.prototype.canMove=function(){if(!this.xA)return!1;var a=this.layer;if(null===a)return!0;if(!a.al)return!1;a=a.h;return null===a?!0:a.al?!0:!1};w.prototype.canReshape=function(){if(!this.RA)return!1;var a=this.layer;if(null===a)return!0;if(!a.yo)return!1;a=a.h;return null===a?!0:a.yo?!0:!1};
w.prototype.canResize=function(){if(!this.SA)return!1;var a=this.layer;if(null===a)return!0;if(!a.zo)return!1;a=a.h;return null===a?!0:a.zo?!0:!1};w.prototype.canRotate=function(){if(!this.TA)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ao)return!1;a=a.h;return null===a?!0:a.Ao?!0:!1};w.prototype.canSelect=function(){if(!this.jk)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ne)return!1;a=a.h;return null===a?!0:a.Ne?!0:!1};t.g(w,"copyable",w.prototype.Oz);
t.defineProperty(w,{Oz:"copyable"},function(){return 0!==(this.ca&1)},function(a){var b=0!==(this.ca&1);b!==a&&(f&&t.j(a,"boolean",w,"copyable"),this.ca^=1,this.i("copyable",b,a))});t.g(w,"deletable",w.prototype.Rz);t.defineProperty(w,{Rz:"deletable"},function(){return 0!==(this.ca&2)},function(a){var b=0!==(this.ca&2);b!==a&&(f&&t.j(a,"boolean",w,"deletable"),this.ca^=2,this.i("deletable",b,a))});t.g(w,"textEditable",w.prototype.hB);
t.defineProperty(w,{hB:"textEditable"},function(){return 0!==(this.ca&4)},function(a){var b=0!==(this.ca&4);b!==a&&(f&&t.j(a,"boolean",w,"textEditable"),this.ca^=4,this.i("textEditable",b,a),this.updateAdornments())});t.g(w,"groupable",w.prototype.eA);t.defineProperty(w,{eA:"groupable"},function(){return 0!==(this.ca&8)},function(a){var b=0!==(this.ca&8);b!==a&&(f&&t.j(a,"boolean",w,"groupable"),this.ca^=8,this.i("groupable",b,a))});t.g(w,"movable",w.prototype.xA);
t.defineProperty(w,{xA:"movable"},function(){return 0!==(this.ca&16)},function(a){var b=0!==(this.ca&16);b!==a&&(f&&t.j(a,"boolean",w,"movable"),this.ca^=16,this.i("movable",b,a))});t.g(w,"selectionAdorned",w.prototype.WA);t.defineProperty(w,{WA:"selectionAdorned"},function(){return 0!==(this.ca&32)},function(a){var b=0!==(this.ca&32);b!==a&&(f&&t.j(a,"boolean",w,"selectionAdorned"),this.ca^=32,this.i("selectionAdorned",b,a),this.updateAdornments())});t.g(w,"isInDocumentBounds",w.prototype.rw);
t.defineProperty(w,{rw:"isInDocumentBounds"},function(){return 0!==(this.ca&64)},function(a){var b=0!==(this.ca&64);b!==a&&(f&&t.j(a,"boolean",w,"isInDocumentBounds"),this.ca^=64,this.i("isInDocumentBounds",b,a))});t.g(w,"isLayoutPositioned",w.prototype.tw);t.defineProperty(w,{tw:"isLayoutPositioned"},function(){return 0!==(this.ca&128)},function(a){var b=0!==(this.ca&128);b!==a&&(f&&t.j(a,"boolean",w,"isLayoutPositioned"),this.ca^=128,this.i("isLayoutPositioned",b,a),this.K(a?Mh:Nh))});
t.g(w,"selectable",w.prototype.jk);t.defineProperty(w,{jk:"selectable"},function(){return 0!==(this.ca&256)},function(a){var b=0!==(this.ca&256);b!==a&&(f&&t.j(a,"boolean",w,"selectable"),this.ca^=256,this.i("selectable",b,a),this.updateAdornments())});t.g(w,"reshapable",w.prototype.RA);t.defineProperty(w,{RA:"reshapable"},function(){return 0!==(this.ca&512)},function(a){var b=0!==(this.ca&512);b!==a&&(f&&t.j(a,"boolean",w,"reshapable"),this.ca^=512,this.i("reshapable",b,a),this.updateAdornments())});
t.g(w,"resizable",w.prototype.SA);t.defineProperty(w,{SA:"resizable"},function(){return 0!==(this.ca&1024)},function(a){var b=0!==(this.ca&1024);b!==a&&(f&&t.j(a,"boolean",w,"resizable"),this.ca^=1024,this.i("resizable",b,a),this.updateAdornments())});t.g(w,"rotatable",w.prototype.TA);t.defineProperty(w,{TA:"rotatable"},function(){return 0!==(this.ca&2048)},function(a){var b=0!==(this.ca&2048);b!==a&&(f&&t.j(a,"boolean",w,"rotatable"),this.ca^=2048,this.i("rotatable",b,a),this.updateAdornments())});
t.g(w,"isSelected",w.prototype.bb);t.defineProperty(w,{bb:"isSelected"},function(){return 0!==(this.ca&4096)},function(a){var b=0!==(this.ca&4096);if(b!==a){f&&t.j(a,"boolean",w,"isSelected");var c=this.h;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.OE)){this.ca^=4096;var d=!1;if(null!==c){d=c.Bb;c.Bb=!0;var e=c.selection;e.Ua();a?e.add(this):e.remove(this);e.freeze()}this.i("isSelected",b,a);am(this);a=this.vF;null!==a&&a(this);null!==c&&(c.Nf(),c.Bb=d)}}});t.g(w,"isShadowed",w.prototype.Lh);
t.defineProperty(w,{Lh:"isShadowed"},function(){return 0!==(this.ca&8192)},function(a){var b=0!==(this.ca&8192);b!==a&&(f&&t.j(a,"boolean",w,"isShadowed"),this.ca^=8192,this.i("isShadowed",b,a),this.pa())});function Ci(a){return 0!==(a.ca&32768)}function bm(a,b){a.ca=b?a.ca|32768:a.ca&-32769}function ak(a,b){a.ca=b?a.ca|65536:a.ca&-65537}function Hh(a){return 0!==(a.ca&131072)}w.prototype.Of=function(a){this.ca=a?this.ca|131072:this.ca&-131073};t.g(w,"selectionObjectName",w.prototype.vt);
t.defineProperty(w,{vt:"selectionObjectName"},function(){return this.Ur},function(a){var b=this.Ur;b!==a&&(f&&t.j(a,"string",w,"selectionObjectName"),this.Ur=a,this.lm=null,this.i("selectionObjectName",b,a))});t.g(w,"selectionAdornmentTemplate",w.prototype.uF);t.defineProperty(w,{uF:"selectionAdornmentTemplate"},function(){return this.Sr},function(a){var b=this.Sr;b!==a&&(f&&t.m(a,Ve,w,"selectionAdornmentTemplate"),this instanceof A&&(a.type=Cg),this.Sr=a,this.i("selectionAdornmentTemplate",b,a))});
t.A(w,{an:"selectionObject"},function(){if(null===this.lm){var a=this.vt;null!==a&&""!==a?(a=this.le(a),this.lm=null!==a?a:this):this instanceof A?(a=this.path,this.lm=null!==a?a:this):this.lm=this}return this.lm});t.g(w,"selectionChanged",w.prototype.vF);t.defineProperty(w,{vF:"selectionChanged"},function(){return this.Tr},function(a){var b=this.Tr;b!==a&&(null!==a&&t.j(a,"function",w,"selectionChanged"),this.Tr=a,this.i("selectionChanged",b,a))});t.g(w,"resizeAdornmentTemplate",w.prototype.hF);
t.defineProperty(w,{hF:"resizeAdornmentTemplate"},function(){return this.Fr},function(a){var b=this.Fr;b!==a&&(f&&t.m(a,Ve,w,"resizeAdornmentTemplate"),this.Fr=a,this.i("resizeAdornmentTemplate",b,a))});t.g(w,"resizeObjectName",w.prototype.kF);t.defineProperty(w,{kF:"resizeObjectName"},function(){return this.Hr},function(a){var b=this.Hr;b!==a&&(f&&t.j(a,"string",w,"resizeObjectName"),this.Hr=a,this.jo=null,this.i("resizeObjectName",b,a))});
t.A(w,{jF:"resizeObject"},function(){if(null===this.jo){var a=this.kF;null!==a&&""!==a?(a=this.le(a),this.jo=null!==a?a:this):this.jo=this}return this.jo});t.g(w,"resizeCellSize",w.prototype.iF);t.defineProperty(w,{iF:"resizeCellSize"},function(){return this.Gr},function(a){var b=this.Gr;b.N(a)||(f&&t.m(a,pa,w,"resizeCellSize"),this.Gr=a=a.Z(),this.i("resizeCellSize",b,a))});t.g(w,"rotateAdornmentTemplate",w.prototype.mF);
t.defineProperty(w,{mF:"rotateAdornmentTemplate"},function(){return this.Ir},function(a){var b=this.Ir;b!==a&&(f&&t.m(a,Ve,w,"rotateAdornmentTemplate"),this.Ir=a,this.i("rotateAdornmentTemplate",b,a))});t.g(w,"rotateObjectName",w.prototype.oF);t.defineProperty(w,{oF:"rotateObjectName"},function(){return this.Jr},function(a){var b=this.Jr;b!==a&&(f&&t.j(a,"string",w,"rotateObjectName"),this.Jr=a,this.lo=null,this.i("rotateObjectName",b,a))});
t.A(w,{nF:"rotateObject"},function(){if(null===this.lo){var a=this.oF;null!==a&&""!==a?(a=this.le(a),this.lo=null!==a?a:this):this.lo=this}return this.lo});t.g(w,"text",w.prototype.text);t.defineProperty(w,{text:"text"},function(){return this.ge},function(a){var b=this.ge;b!==a&&(f&&t.j(a,"string",w,"text"),this.ge=a,this.i("text",b,a))});t.g(w,"containingGroup",w.prototype.fb);
t.defineProperty(w,{fb:"containingGroup"},function(){return this.Ck},function(a){if(this.Ud()){var b=this.Ck;if(b!==a){f&&null!==a&&t.m(a,z,w,"containingGroup");null===a||this!==a&&!a.Us(this)||(this===a&&t.l("Cannot make a Group a member of itself: "+this.toString()),t.l("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.K(Pi);var c=this.h;null!==b?hm(b,this):this instanceof z&&null!==c&&c.Vk.remove(this);this.Ck=a;null!==a?im(a,this):this instanceof
z&&null!==c&&c.Vk.add(this);this.K(Ki);if(null!==c){var d=this.data,e=c.fa;null!==d&&e instanceof U&&e.$A(d,e.Nb(null!==a?a.data:null))}d=this.Lz;null!==d&&(e=!0,null!==c&&(e=c.Wa,c.Wa=!0),d(this,b,a),null!==c&&(c.Wa=e));if(this instanceof z)for(c=new ua(w),Ue(c,this,!0,0),c=c.k;c.next();)if(d=c.value,d instanceof y)for(d=d.Dd;d.next();)e=d.value,cj(e);if(this instanceof y)for(d=this.Dd;d.next();)e=d.value,cj(e);this.i("containingGroup",b,a);null!==a&&a.Pw()}}else t.l("cannot set the Part.containingGroup of a Link or Adornment")});
function Yj(a){a=a.fb;null!==a&&(a.aa(),null!==a.wb&&a.wb.aa(),a.Vg())}w.prototype.Ps=function(){var a=this.Ck;null!==a&&im(a,this)};w.prototype.Qs=function(){var a=this.Ck;null!==a&&hm(a,this)};w.prototype.Im=function(){var a=this.data;if(null!==a){var b=this.h;null!==b&&(b=b.fa,null!==b&&b.Iw(a))}};t.g(w,"containingGroupChanged",w.prototype.Lz);
t.defineProperty(w,{Lz:"containingGroupChanged"},function(){return this.kq},function(a){var b=this.kq;b!==a&&(null!==a&&t.j(a,"function",w,"containingGroupChanged"),this.kq=a,this.i("containingGroupChanged",b,a))});w.prototype.findTopLevelPart=function(){return jm(this,this)};function jm(a,b){var c=b.fb;return null!==c?jm(a,c):b instanceof y&&(c=b.Tc,null!==c)?jm(a,c):b}t.A(w,{dp:"isTopLevel"},function(){return null!==this.fb||this instanceof y&&this.Ih?!1:!0});
w.prototype.isMemberOf=w.prototype.Us=function(a){return a instanceof z?km(this,this,a):!1};function km(a,b,c){if(b===c||null===c)return!1;var d=b.fb;return null===d||d!==c&&!km(a,d,c)?b instanceof y&&(b=b.Tc,null!==b)?km(a,b,c):!1:!0}w.prototype.findCommonContainingGroup=w.prototype.UH=function(a){return lm(this,this,a)};
function lm(a,b,c){if(null===b||null===c)return null;var d=b.fb;if(null===d)return null;if(b===c)return d;var e=c.fb;return null===e?null:d===e?e:km(a,c,d)?d:km(a,b,e)?e:lm(a,d,e)}t.g(w,"layoutConditions",w.prototype.GE);t.defineProperty(w,{GE:"layoutConditions"},function(){return this.Wq},function(a){var b=this.Wq;b!==a&&(f&&t.j(a,"number",w,"layoutConditions"),this.Wq=a,this.i("layoutConditions",b,a))});
w.prototype.canLayout=function(){if(!this.tw||!this.zb())return!1;var a=this.layer;return null!==a&&a.pc||this instanceof y&&this.Ih?!1:!0};w.prototype.invalidateLayout=w.prototype.K=function(a){void 0===a&&(a=16777215);var b;this.tw&&0!==(a&this.GE)?(b=this.layer,null!==b&&b.pc||this instanceof y&&this.Ih?b=!1:(b=this.h,b=null!==b&&b.Aa.qb?!1:!0)):b=!1;if(b)if(b=this.Ck,null!==b){var c=b.Tb;null!==c?c.K():b.K(a)}else a=this.h,null!==a&&(c=a.Tb,null!==c&&c.K())};t.g(w,"dragComputation",w.prototype.Sz);
t.defineProperty(w,{Sz:"dragComputation"},function(){return this.uq},function(a){var b=this.uq;b!==a&&(null!==a&&t.j(a,"function",w,"dragComputation"),this.uq=a,this.i("dragComputation",b,a))});t.g(w,"shadowOffset",w.prototype.zF);t.defineProperty(w,{zF:"shadowOffset"},function(){return this.om},function(a){var b=this.om;b.N(a)||(f&&t.m(a,C,w,"shadowOffset"),this.om=a=a.Z(),this.pa(),this.i("shadowOffset",b,a))});t.g(w,"shadowColor",w.prototype.shadowColor);
t.defineProperty(w,{shadowColor:"shadowColor"},function(){return this.nm},function(a){var b=this.nm;b!==a&&(f&&t.j(a,"string",w,"shadowColor"),this.nm=a,this.pa(),this.i("shadowColor",b,a))});t.g(w,"shadowBlur",w.prototype.shadowBlur);t.defineProperty(w,{shadowBlur:"shadowBlur"},function(){return this.mm},function(a){var b=this.mm;b!==a&&(f&&t.j(a,"number",w,"shadowBlur"),this.mm=a,this.pa(),this.i("shadowBlur",b,a))});
function Ve(a){0===arguments.length?w.call(this,ah):w.call(this,a);this.Xd="Adornment";this.La=null;this.ca&=-257;this.ki=new C(NaN,NaN);this.Yh=new H(D);this.wb=null;this.yy=!1}t.ia("Adornment",Ve);t.Oa(Ve,w);aa=Ve.prototype;aa.toString=function(){var a=this.Dh;return"Adornment("+this.Qc+")"+(null!==a?a.toString():"")};aa.pj=function(){return this.La&&this.La.U instanceof A?this.La.U.pj():null};aa.Fq=function(){return null};
aa.zw=function(){var a=this.Pc.U,b=this.Pc;if(a instanceof A&&b instanceof Y){var c=a.path,b=c.Ra;a.zw();for(var b=c.Ra,a=this.za,c=a.length,d=0;d<c;d++){var e=a.p[d];e.Jh&&e instanceof Y&&(e.Ra=b)}}};aa.jy=function(){var a=this.Dh;return a instanceof A?a.mc:null};t.A(Ve,{placeholder:"placeholder"},function(){return this.wb});t.g(Ve,"isStandard",Ve.prototype.nl);
t.defineProperty(Ve,{nl:"isStandard"},function(){return this.yy},function(a){var b=this.yy;b!==a&&(f&&t.j(a,"boolean",Ve,"isStandard"),this.yy=a,this.i("isStandard",b,a))});t.g(Ve,"adornedObject",Ve.prototype.Pc);t.defineProperty(Ve,{Pc:"adornedObject"},function(){return this.La},function(a){f&&null!==a&&t.m(a,X,w,"adornedObject:val");var b=this.Dh,c=null;null!==a&&(c=a.U);null===b||null!==a&&b===c||b.tl(this.Qc);this.La=a;c&&c.Xk(this.Qc,this)});
t.A(Ve,{Dh:"adornedPart"},function(){var a=this.La;return null!==a?a.U:null});Ve.prototype.ml=function(){var a=this.La;if(null===a)return!0;a=a.U;return null===a||!Bi(a)};Ve.prototype.Ud=function(){return!1};t.A(Ve,{fb:"containingGroup"},function(){return null});
Ve.prototype.Zm=function(a,b,c,d,e,g,h){if(a===Dd&&"elements"===b)if(e instanceof Vg)null===this.wb?this.wb=e:this.wb!==e&&t.l("Cannot insert a second Placeholder into the visual tree of an Adornment.");else{if(e instanceof B){var k=Al(e,e,function(a){return a instanceof Vg});k instanceof Vg&&(null===this.wb?this.wb=k:this.wb!==k&&t.l("Cannot insert a second Placeholder into the visual tree of an Adornment."))}}else a===Md&&"elements"===b&&null!==this.wb&&(d===this.wb?this.wb=null:d instanceof B&&
this.wb.Ti(d)&&(this.wb=null));w.prototype.Zm.call(this,a,b,c,d,e,g,h)};Ve.prototype.updateAdornments=function(){};Ve.prototype.Im=function(){};function y(a){0===arguments.length?w.call(this,ah):w.call(this,a);this.dc=new H(A);this.Tn=this.Nk=this.$q=this.Zq=null;this.Qq=!0;this.ns=!1;this.is=null;this.dq=this.Rq=!0;this.eq=J.pG;this.yd=this.fh=null;this.Bh=!1}t.ia("Node",y);t.Oa(y,w);
y.prototype.cloneProtected=function(a){w.prototype.cloneProtected.call(this,a);a.Zq=this.Zq;a.$q=this.$q;a.Nk=this.Nk;a.Qq=this.Qq;a.ns=this.ns;a.is=this.is;a.Rq=this.Rq;a.dq=this.dq;a.eq=this.eq.Z()};y.prototype.Gh=function(a){w.prototype.Gh.call(this,a);a.Vg();a.fh=this.fh;a.yd=null};var mm;y.DirectionDefault=mm=t.w(y,"DirectionDefault",0);y.DirectionAbsolute=t.w(y,"DirectionAbsolute",1);var nm;y.DirectionRotatedNode=nm=t.w(y,"DirectionRotatedNode",2);var Mj;
y.DirectionRotatedNodeOrthogonal=Mj=t.w(y,"DirectionRotatedNodeOrthogonal",3);function om(a,b){null!==b&&(null===a.fh&&(a.fh=new ua(pm)),a.fh.add(b))}y.prototype.Zm=function(a,b,c,d,e,g,h){a===Dd&&"elements"===b?this.yd=null:a===Md&&"elements"===b&&(null===this.h?this.yd=null:d instanceof X&&yl(this,d,function(a,b){uk(a,b,!0)}));w.prototype.Zm.call(this,a,b,c,d,e,g,h)};
y.prototype.invalidateConnectedLinks=y.prototype.Vg=function(a){void 0===a&&(a=null);for(var b=this.Dd;b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Sc;null!==d&&(d.ee=null);var e=c.Ed;null!==e&&e!==d&&(e.ee=null);c.$b()}}};y.prototype.ml=function(){return!0};t.g(y,"avoidable",y.prototype.Hz);
t.defineProperty(y,{Hz:"avoidable"},function(){return this.dq},function(a){var b=this.dq;if(b!==a){f&&t.j(a,"boolean",y,"avoidable");this.dq=a;var c=this.h;null!==c&&pj(c,this);this.i("avoidable",b,a)}});t.g(y,"avoidableMargin",y.prototype.lD);t.defineProperty(y,{lD:"avoidableMargin"},function(){return this.eq},function(a){"number"===typeof a?a=new sb(a):t.m(a,sb,y,"avoidableMargin");var b=this.eq;if(!b.N(a)){this.eq=a=a.Z();var c=this.h;null!==c&&pj(c,this);this.i("avoidableMargin",b,a)}});
y.prototype.canAvoid=function(){return this.Hz&&!this.Ih};y.prototype.getAvoidableRect=function(a){a.set(this.ya);a.Ev(this.lD);return a};function em(a){for(;null!==a&&!a.zb();)a=a.fb;return a}t.A(y,{Dd:"linksConnected"},function(){return this.dc.k});y.prototype.findLinksConnected=y.prototype.VH=function(a){void 0===a&&(a=null);if(null===a)return this.dc.k;f&&t.j(a,"string",y,"findLinksConnected:pid");var b=new La(this.dc),c=this;b.sl=function(b){return b.da===c&&b.nf===a||b.ja===c&&b.Qf===a};return b};
y.prototype.findLinksOutOf=y.prototype.fw=function(a){void 0===a&&(a=null);f&&null!==a&&t.j(a,"string",y,"findLinksOutOf:pid");var b=new La(this.dc),c=this;b.sl=function(b){return b.da!==c?!1:null===a?!0:b.nf===a};return b};y.prototype.findLinksInto=y.prototype.mg=function(a){void 0===a&&(a=null);f&&null!==a&&t.j(a,"string",y,"findLinksInto:pid");var b=new La(this.dc),c=this;b.sl=function(b){return b.ja!==c?!1:null===a?!0:b.Qf===a};return b};
y.prototype.findNodesConnected=y.prototype.WD=function(a){void 0===a&&(a=null);f&&null!==a&&t.j(a,"string",y,"findNodesConnected:pid");for(var b=null,c=null,d=this.dc.k;d.next();){var e=d.value;if(e.da===this){if(null===a||e.nf===a)e=e.ja,null!==b?b.add(e):null!==c&&c!==e?(b=new ua(y),b.add(c),b.add(e)):c=e}else e.ja!==this||null!==a&&e.Qf!==a||(e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new ua(y),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ia(c):t.dh};
y.prototype.findNodesOutOf=function(a){void 0===a&&(a=null);f&&null!==a&&t.j(a,"string",y,"findNodesOutOf:pid");for(var b=null,c=null,d=this.dc.k;d.next();){var e=d.value;e.da!==this||null!==a&&e.nf!==a||(e=e.ja,null!==b?b.add(e):null!==c&&c!==e?(b=new ua(y),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ia(c):t.dh};
y.prototype.findNodesInto=function(a){void 0===a&&(a=null);f&&null!==a&&t.j(a,"string",y,"findNodesInto:pid");for(var b=null,c=null,d=this.dc.k;d.next();){var e=d.value;e.ja!==this||null!==a&&e.Qf!==a||(e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new ua(y),b.add(c),b.add(e)):c=e)}return null!==b?b.k:null!==c?new Ia(c):t.dh};
y.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);f&&(t.m(a,y,y,"findLinksBetween:othernode"),null!==b&&t.j(b,"string",y,"findLinksBetween:pid"),null!==c&&t.j(c,"string",y,"findLinksBetween:otherpid"));var d=new La(this.dc),e=this;d.sl=function(d){return(d.da!==e||d.ja!==a||null!==b&&d.nf!==b||null!==c&&d.Qf!==c)&&(d.da!==a||d.ja!==e||null!==c&&d.nf!==c||null!==b&&d.Qf!==b)?!1:!0};return d};
y.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);f&&(t.m(a,y,y,"findLinksTo:othernode"),null!==b&&t.j(b,"string",y,"findLinksTo:pid"),null!==c&&t.j(c,"string",y,"findLinksTo:otherpid"));var d=new La(this.dc),e=this;d.sl=function(d){return d.da!==e||d.ja!==a||null!==b&&d.nf!==b||null!==c&&d.Qf===c?!1:!0};return d};t.g(y,"linkConnected",y.prototype.IE);
t.defineProperty(y,{IE:"linkConnected"},function(){return this.Zq},function(a){var b=this.Zq;b!==a&&(null!==a&&t.j(a,"function",y,"linkConnected"),this.Zq=a,this.i("linkConnected",b,a))});t.g(y,"linkDisconnected",y.prototype.JE);t.defineProperty(y,{JE:"linkDisconnected"},function(){return this.$q},function(a){var b=this.$q;b!==a&&(null!==a&&t.j(a,"function",y,"linkDisconnected"),this.$q=a,this.i("linkDisconnected",b,a))});t.g(y,"linkValidation",y.prototype.np);
t.defineProperty(y,{np:"linkValidation"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(null!==a&&t.j(a,"function",y,"linkValidation"),this.Nk=a,this.i("linkValidation",b,a))});
function qm(a,b,c){if(!a.dc.contains(b)){a.dc.add(b);var d=a.IE;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Wa,g.Wa=!0);d(a,b,c);null!==g&&(g.Wa=e)}b.xc&&(c=b.da,b=b.ja,null!==c&&null!==b&&c!==b&&(d=!0,g=a.h,null!==g&&(d=g.fd),a=d?b:c,e=d?c:b,a.Bh||(a.Bh=e),!e.Mh||null!==g&&g.Aa.qb||(d?c===e&&(e.Mh=!1):b===e&&(e.Mh=!1))))}}
function rm(a,b,c){if(a.dc.remove(b)){var d=a.JE,e=a.h;if(null!==d){var g=!0;null!==e&&(g=e.Wa,e.Wa=!0);d(a,b,c);null!==e&&(e.Wa=g)}b.xc&&(c=!0,null!==e&&(c=e.fd),a=c?b.ja:b.da,b=c?b.da:b.ja,null!==a&&(a.Bh=!1),null===b||b.Mh||(0===b.dc.count?(b.Bh=null,null!==e&&e.Aa.qb||(b.Mh=!0)):hj(b)))}}
function hj(a){a.Bh=!1;if(0!==a.dc.count){var b=!0,c=a.h;if(null===c||!c.Aa.qb){null!==c&&(b=c.fd);for(c=a.dc.k;c.next();){var d=c.value;if(d.xc)if(b){if(d.da===a){a.Mh=!1;return}}else if(d.ja===a){a.Mh=!1;return}}a.Mh=!0}}}y.prototype.Ps=function(){w.prototype.Ps.call(this);hj(this);var a=this.Tn;null!==a&&sm(a,this)};y.prototype.Qs=function(){w.prototype.Qs.call(this);var a=this.Tn;null!==a&&null!==a.ff&&(a.ff.remove(this),a.aa())};
y.prototype.Im=function(){if(0<this.dc.count){var a=this.h;if(null===a)return;for(var b=this.dc.copy().k;b.next();)a.remove(b.value)}this.Tc=null;w.prototype.Im.call(this)};t.A(y,{Ih:"isLinkLabel"},function(){return null!==this.Tn});t.g(y,"labeledLink",y.prototype.Tc);
t.defineProperty(y,{Tc:"labeledLink"},function(){return this.Tn},function(a){var b=this.Tn;if(b!==a){f&&null!==a&&t.m(a,A,y,"labeledLink");var c=this.h,d=this.data;if(null!==b&&(null!==b.ff&&(b.ff.remove(this),b.aa()),null!==c&&null!==d&&!c.Aa.qb)){var e=b.data,g=c.fa;if(null!==e&&g instanceof U){var h=g.Nb(d);void 0!==h&&g.WI(e,h)}}this.Tn=a;null!==a&&(sm(a,this),null===c||null===d||c.Aa.qb||(e=a.data,g=c.fa,null!==e&&g instanceof U&&(h=g.Nb(d),void 0!==h&&g.cD(e,h))));lk(this);this.i("labeledLink",
b,a)}});y.prototype.findPort=y.prototype.Is=function(a){f&&t.j(a,"string",y,"findPort:pid");if(null===this.yd){if(""===a&&!1===this.qj)return this;vk(this)}var b=this.yd.Ba(a);return null!==b||""!==a&&(b=this.yd.Ba(""),null!==b)?b:this};t.A(y,{port:"port"},function(){return this.Is("")});t.A(y,{ports:"ports"},function(){null===this.yd&&vk(this);return this.yd.k});
function vk(a){null===a.yd?a.yd=new sa("string",X):a.yd.clear();yl(a,a,function(a,c){var d=c.sd;null!==d&&a.yd.add(d,c)});0===a.yd.count&&a.yd.add("",a)}function uk(a,b,c){var d=b.sd;if(null!==d&&(null!==a.yd&&a.yd.remove(d),b=a.h,null!==b&&c)){c=null;for(a=a.VH(d);a.next();)null===c&&(c=t.Cb()),c.push(a.value);if(null!==c){for(a=0;a<c.length;a++)b.remove(c[a]);t.Da(c)}}}
y.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.h;null!==c&&(b=c.fd);c=this;if(b)for(;c!==a;){for(var b=null,d=c.dc.k;d.next();){var e=d.value;if(e.xc&&(b=e.da,b!==c&&b!==this))break}if(b===this||null===b||b===c)return!1;c=b}else for(;c!==a;){b=null;for(d=c.dc.k;d.next()&&(e=d.value,!e.xc||(b=e.ja,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
y.prototype.findTreeRoot=function(){var a=!0,b=this.h;null!==b&&(a=b.fd);b=this;if(a)for(;;){for(var a=null,c=b.dc.k;c.next();){var d=c.value;if(d.xc&&(a=d.da,a!==b&&a!==this))break}if(a===this)return this;if(null===a||a===b)return b;b=a}else for(;;){a=null;for(c=b.dc.k;c.next()&&(d=c.value,!d.xc||(a=d.ja,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
y.prototype.findTreeParentLink=y.prototype.Js=function(){var a=!0,b=this.h;null!==b&&(a=b.fd);b=this.dc.k;if(a)for(;b.next();){if(a=b.value,a.xc&&a.da!==this)return a}else for(;b.next();)if(a=b.value,a.xc&&a.ja!==this)return a;return null};
y.prototype.findTreeParentNode=y.prototype.ZD=function(){if(null===this.Bh||this.Bh instanceof y)return this.Bh;var a=!0,b=this.h;null!==b&&(a=b.fd);var b=this.dc.p,c=b.length;if(a)for(a=0;a<c;a++){var d=b[a];if(d.xc&&(d=d.da,d!==this))return this.Bh=d}else for(a=0;a<c;a++)if(d=b[a],d.xc&&(d=d.ja,d!==this))return this.Bh=d;return this.Bh=null};
y.prototype.findTreeChildrenLinks=y.prototype.iw=function(){var a=!0,b=this.h;null!==b&&(a=b.fd);if(a){var a=new La(this.dc),c=this;a.sl=function(a){return a.xc&&a.da===c?!0:!1}}else a=new La(this.dc),c=this,a.sl=function(a){return a.xc&&a.ja===c?!0:!1};return a};
y.prototype.findTreeChildrenNodes=y.prototype.YD=function(){var a=!0,b=this.h;null!==b&&(a=b.fd);var c=b=null,d=this.dc.k;if(a)for(;d.next();)a=d.value,a.xc&&a.da===this&&(a=a.ja,null!==b?b.add(a):null!==c&&c!==a?(b=new H(y),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.xc&&a.ja===this&&(a=a.da,null!==b?b.add(a):null!==c&&c!==a?(b=new H(y),b.add(c),b.add(a)):c=a);return null!==b?b.k:null!==c?new Ia(c):t.dh};
y.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);t.j(a,"number",y,"collapseTree:level");var b=new ua(w);Ue(b,this,!1,a);return b};y.prototype.collapseTree=y.prototype.collapseTree=function(a){void 0===a&&(a=1);t.o(a,y,"collapseTree:level");1>a&&(a=1);var b=this.h;if(null!==b&&!b.Sd){b.Sd=!0;var c=b.fd,d=new ua(y);d.add(this);tm(this,d,c,a,this.Hc);b.Sd=!1;b.pa()}};
function tm(a,b,c,d,e){if(1<d)for(e=c?a.fw():a.mg();e.next();){var g=e.value;g.xc&&(g=g.bA(a),null===g||g===a||b.contains(g)||(b.add(g),tm(g,b,c,d-1,g.Hc)))}else um(a,b,c,e)}function um(a,b,c,d){a.Hc=!1;for(var e=c?a.fw():a.mg();e.next();){var g=e.value;d&&g.Ae();g.xc&&(g=g.bA(a),null===g||g===a||b.contains(g)||(b.add(g),d&&(g.pa(),g.Ae(),Yj(g),g.K(Nh)),g.Hc&&(g.hn=g.Hc,um(g,b,c,g.hn))))}}
y.prototype.expandTree=y.prototype.expandTree=function(a){void 0===a&&(a=2);t.o(a,y,"collapseTree:level");2>a&&(a=2);var b=this.h;if(null!==b&&!b.Sd){b.Sd=!0;var c=b.fd,d=new ua(y);d.add(this);vm(this,d,c,a,this.Hc);b.Sd=!1}};function vm(a,b,c,d,e){a.Hc=!0;for(var g=c?a.fw():a.mg();g.next();){var h=g.value;h.xc&&(e||(h.Rg||h.$b(),h.updateAdornments()),h=h.bA(a),null!==h&&h!==a&&!b.contains(h)&&(b.add(h),e||(h.pa(),h.updateAdornments(),Yj(h),h.K(Mh)),2<d||h.hn))&&(h.hn=!1,vm(h,b,c,d-1,h.Hc))}}
t.g(y,"isTreeExpanded",y.prototype.Hc);
t.defineProperty(y,{Hc:"isTreeExpanded"},function(){return this.Qq},function(a){var b=this.Qq;if(b!==a){f&&t.j(a,"boolean",y,"isTreeExpanded");this.Qq=a;var c=this.h;this.i("isTreeExpanded",b,a);b=this.VF;if(null!==b){var d=!0;null!==c&&(d=c.Wa,c.Wa=!0);b(this);null!==c&&(c.Wa=d)}null!==c&&c.Aa.qb||(a?(a=2,2>a&&(a=2),null===c||c.Sd||(c.Sd=!0,b=c.fd,d=new ua(y),d.add(this),vm(this,d,b,a,!1),c.Sd=!1)):(a=1,1>a&&(a=1),null===c||c.Sd||(c.Sd=!0,b=c.fd,d=new ua(y),d.add(this),tm(this,d,b,a,!0),c.Sd=!1)))}});
t.g(y,"wasTreeExpanded",y.prototype.hn);t.defineProperty(y,{hn:"wasTreeExpanded"},function(){return this.ns},function(a){var b=this.ns;b!==a&&(f&&t.j(a,"boolean",y,"wasTreeExpanded"),this.ns=a,this.i("wasTreeExpanded",b,a))});t.g(y,"treeExpandedChanged",y.prototype.VF);t.defineProperty(y,{VF:"treeExpandedChanged"},function(){return this.is},function(a){var b=this.is;b!==a&&(null!==a&&t.j(a,"function",y,"treeExpandedChanged"),this.is=a,this.i("treeExpandedChanged",b,a))});t.g(y,"isTreeLeaf",y.prototype.Mh);
t.defineProperty(y,{Mh:"isTreeLeaf"},function(){return this.Rq},function(a){var b=this.Rq;b!==a&&(f&&t.j(a,"boolean",y,"isTreeLeaf"),this.Rq=a,this.i("isTreeLeaf",b,a))});
function A(){w.call(this,Cg);this.Wf=null;this.nh="";this.fg=this.Dq=null;this.Ah="";this.hs=null;this.Er=this.Dr=this.Cr=!1;this.Sq=!0;this.Zp=Ig;this.lq=0;this.oq=Ig;this.pq=NaN;this.hm=Ik;this.Zr=0.5;this.ti=this.ff=null;this.mc=(new H(C)).freeze();this.ue=null;this.Rg=!1;this.Uy=null;this.fz=!1;this.qn=this.fi=this.Ra=null;this.cf=0;this.An=this.wn=null;this.Yh=new H(D);this.kz=new C;this.RC=this.PC=null;this.Ix=!1;this.V=null}t.ia("Link",A);t.Oa(A,w);
A.prototype.cloneProtected=function(a){w.prototype.cloneProtected.call(this,a);a.nh=this.nh;a.Dq=this.Dq;a.Ah=this.Ah;a.hs=this.hs;a.Cr=this.Cr;a.Dr=this.Dr;a.Er=this.Er;a.Sq=this.Sq;a.Zp=this.Zp;a.lq=this.lq;a.oq=this.oq;a.pq=this.pq;a.hm=this.hm;a.Zr=this.Zr};A.prototype.Gh=function(a){w.prototype.Gh.call(this,a);this.nh=a.nh;this.Ah=a.Ah;a.ti=null;a.ue=null;a.$b();a.qn=this.qn;a.cf=this.cf};var Ik;A.Normal=Ik=t.w(A,"Normal",1);A.Orthogonal=t.w(A,"Orthogonal",2);
A.AvoidsNodes=t.w(A,"AvoidsNodes",6);var wm;A.AvoidsNodesStraight=wm=t.w(A,"AvoidsNodesStraight",7);var Ig;A.None=Ig=t.w(A,"None",0);var Qg;A.Bezier=Qg=t.w(A,"Bezier",9);var Hg;A.JumpGap=Hg=t.w(A,"JumpGap",10);var Gg;A.JumpOver=Gg=t.w(A,"JumpOver",11);var Fk;A.End=Fk=t.w(A,"End",17);var Gk;A.Scale=Gk=t.w(A,"Scale",18);var Hk;A.Stretch=Hk=t.w(A,"Stretch",19);var Nl;A.OrientAlong=Nl=t.w(A,"OrientAlong",21);var xm;A.OrientPlus90=xm=t.w(A,"OrientPlus90",22);var ym;
A.OrientMinus90=ym=t.w(A,"OrientMinus90",23);var zm;A.OrientOpposite=zm=t.w(A,"OrientOpposite",24);var Am;A.OrientUpright=Am=t.w(A,"OrientUpright",25);var Bm;A.OrientPlus90Upright=Bm=t.w(A,"OrientPlus90Upright",26);var Cm;A.OrientMinus90Upright=Cm=t.w(A,"OrientMinus90Upright",27);var Dm;A.OrientUpright45=Dm=t.w(A,"OrientUpright45",28);A.prototype.Ge=function(){this.V={oj:Qb,Qj:Qb,mj:NaN,Oj:NaN,lj:mm,Nj:mm,nj:NaN,Pj:NaN}};
A.prototype.ml=function(){var a=this.da;if(null!==a&&(Bi(a)||Ci(a)))return!1;a=this.ja;return null!==a&&(Bi(a)||Ci(a))?!1:!0};A.prototype.Ud=function(){return!1};
A.prototype.computeAngle=function(a,b,c){switch(b){default:case Ig:a=0;break;case Nl:a=c;break;case xm:a=c+90;break;case ym:a=c-90;break;case zm:a=c+180;break;case Am:a=J.jt(c);90<a&&270>a&&(a-=180);break;case Bm:a=J.jt(c+90);90<a&&270>a&&(a-=180);break;case Cm:a=J.jt(c-90);90<a&&270>a&&(a-=180);break;case Dm:a=J.jt(c);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return J.jt(a)};t.g(A,"fromNode",A.prototype.da);
t.defineProperty(A,{da:"fromNode"},function(){return this.Wf},function(a){var b=this.Wf;if(b!==a){f&&null!==a&&t.m(a,y,A,"fromNode");var c=this.Sc;null!==b&&(this.fg!==b&&rm(b,this,c),null!==c&&(c.ee=null),Em(this),b.K(Pi));this.Wf=a;this.fi=null;this.$b();var d=this.h;if(null!==d){var e=this.data,g=d.fa;if(null!==e)if(g instanceof U){var h=null!==a?a.data:null;g.YA(e,g.Nb(h))}else g instanceof Sd&&(h=null!==a?a.data:null,d.fd?g.Ph(e,g.Nb(h)):(null!==b&&g.Ph(b.data,void 0),g.Ph(h,g.Nb(null!==this.fg?
this.fg.data:null))))}e=this.Sc;g=this.aA;null!==g&&(h=!0,null!==d&&(h=d.Wa,d.Wa=!0),g(this,c,e),null!==d&&(d.Wa=h));null!==a&&(this.fg!==a&&qm(a,this,e),null!==e&&(e.ee=null),Fm(this),a.K(Ki));this.i("fromNode",b,a);cj(this)}});t.g(A,"fromPortId",A.prototype.nf);
t.defineProperty(A,{nf:"fromPortId"},function(){return this.nh},function(a){var b=this.nh;if(b!==a){f&&t.j(a,"string",A,"fromPortId");var c=this.Sc;null!==c&&(c.ee=null);Em(this);this.nh=a;var d=this.Sc;null!==d&&(d.ee=null);var e=this.h;if(null!==e){var g=this.data,h=e.fa;null!==g&&h instanceof U&&h.ZA(g,a)}c!==d&&(this.fi=null,this.$b(),g=this.aA,null!==g&&(h=!0,null!==e&&(h=e.Wa,e.Wa=!0),g(this,c,d),null!==e&&(e.Wa=h)));Fm(this);this.i("fromPortId",b,a)}});
t.A(A,{Sc:"fromPort"},function(){var a=this.Wf;return null===a?null:a.Is(this.nh)});t.g(A,"fromPortChanged",A.prototype.aA);t.defineProperty(A,{aA:"fromPortChanged"},function(){return this.Dq},function(a){var b=this.Dq;b!==a&&(null!==a&&t.j(a,"function",A,"fromPortChanged"),this.Dq=a,this.i("fromPortChanged",b,a))});t.g(A,"toNode",A.prototype.ja);
t.defineProperty(A,{ja:"toNode"},function(){return this.fg},function(a){var b=this.fg;if(b!==a){f&&null!==a&&t.m(a,y,A,"toNode");var c=this.Ed;null!==b&&(this.Wf!==b&&rm(b,this,c),null!==c&&(c.ee=null),Em(this),b.K(Pi));this.fg=a;this.fi=null;this.$b();var d=this.h;if(null!==d){var e=this.data,g=d.fa;if(null!==e)if(g instanceof U){var h=null!==a?a.data:null;g.cB(e,g.Nb(h))}else g instanceof Sd&&(h=null!==a?a.data:null,d.fd?(null!==b&&g.Ph(b.data,void 0),g.Ph(h,g.Nb(null!==this.Wf?this.Wf.data:null))):
g.Ph(e,g.Nb(h)))}e=this.Ed;g=this.lB;null!==g&&(h=!0,null!==d&&(h=d.Wa,d.Wa=!0),g(this,c,e),null!==d&&(d.Wa=h));null!==a&&(this.Wf!==a&&qm(a,this,e),null!==e&&(e.ee=null),Fm(this),a.K(Ki));this.i("toNode",b,a);cj(this)}});t.g(A,"toPortId",A.prototype.Qf);
t.defineProperty(A,{Qf:"toPortId"},function(){return this.Ah},function(a){var b=this.Ah;if(b!==a){f&&t.j(a,"string",A,"toPortId");var c=this.Ed;null!==c&&(c.ee=null);Em(this);this.Ah=a;var d=this.Ed;null!==d&&(d.ee=null);var e=this.h;if(null!==e){var g=this.data,h=e.fa;null!==g&&h instanceof U&&h.dB(g,a)}c!==d&&(this.fi=null,this.$b(),g=this.lB,null!==g&&(h=!0,null!==e&&(h=e.Wa,e.Wa=!0),g(this,c,d),null!==e&&(e.Wa=h)));Fm(this);this.i("toPortId",b,a)}});
t.A(A,{Ed:"toPort"},function(){var a=this.fg;return null===a?null:a.Is(this.Ah)});t.g(A,"toPortChanged",A.prototype.lB);t.defineProperty(A,{lB:"toPortChanged"},function(){return this.hs},function(a){var b=this.hs;b!==a&&(null!==a&&t.j(a,"function",A,"toPortChanged"),this.hs=a,this.i("toPortChanged",b,a))});
t.defineProperty(A,{lb:"fromSpot"},function(){return null!==this.V?this.V.oj:Qb},function(a){null===this.V&&this.Ge();var b=this.V.oj;b.N(a)||(f&&t.m(a,K,A,"fromSpot"),a=a.Z(),this.V.oj=a,this.i("fromSpot",b,a),this.$b())});
t.defineProperty(A,{ek:"fromEndSegmentLength"},function(){return null!==this.V?this.V.mj:NaN},function(a){null===this.V&&this.Ge();var b=this.V.mj;b!==a&&(f&&t.j(a,"number",A,"fromEndSegmentLength"),0>a&&t.ha(a,">= 0",A,"fromEndSegmentLength"),this.V.mj=a,this.i("fromEndSegmentLength",b,a),this.$b())});
t.defineProperty(A,{Ro:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.lj:mm},function(a){null===this.V&&this.Ge();var b=this.V.lj;b!==a&&(f&&t.tb(a,y,A,"fromEndSegmentDirection"),this.V.lj=a,this.i("fromEndSegmentDirection",b,a),this.$b())});t.defineProperty(A,{So:"fromShortLength"},function(){return null!==this.V?this.V.nj:NaN},function(a){null===this.V&&this.Ge();var b=this.V.nj;b!==a&&(f&&t.j(a,"number",A,"fromShortLength"),this.V.nj=a,this.i("fromShortLength",b,a),this.$b())});
t.defineProperty(A,{mb:"toSpot"},function(){return null!==this.V?this.V.Qj:Qb},function(a){null===this.V&&this.Ge();var b=this.V.Qj;b.N(a)||(f&&t.m(a,K,A,"toSpot"),a=a.Z(),this.V.Qj=a,this.i("toSpot",b,a),this.$b())});
t.defineProperty(A,{mk:"toEndSegmentLength"},function(){return null!==this.V?this.V.Oj:NaN},function(a){null===this.V&&this.Ge();var b=this.V.Oj;b!==a&&(f&&t.j(a,"number",A,"toEndSegmentLength"),0>a&&t.ha(a,">= 0",A,"toEndSegmentLength"),this.V.Oj=a,this.i("toEndSegmentLength",b,a),this.$b())});
t.defineProperty(A,{Kp:"toEndSegmentDirection"},function(){return null!==this.V?this.V.Nj:mm},function(a){null===this.V&&this.Ge();var b=this.V.Nj;b!==a&&(f&&t.tb(a,y,A,"toEndSegmentDirection"),this.V.Nj=a,this.i("toEndSegmentDirection",b,a),this.$b())});t.defineProperty(A,{Lp:"toShortLength"},function(){return null!==this.V?this.V.Pj:NaN},function(a){null===this.V&&this.Ge();var b=this.V.Pj;b!==a&&(f&&t.j(a,"number",A,"toShortLength"),this.V.Pj=a,this.i("toShortLength",b,a),this.$b())});
function cj(a){var b=a.da,c=a.ja;null!==b&&null!==c?Gm(a,b.UH(c)):Gm(a,null)}function Gm(a,b){var c=a.Ck;if(c!==b){null!==c&&hm(c,a);a.Ck=b;null!==b&&im(b,a);var d=a.Lz;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Wa,g.Wa=!0);d(a,c,b);null!==g&&(g.Wa=e)}!a.Rg||a.PC!==c&&a.RC!==c||a.$b()}}A.prototype.getOtherNode=A.prototype.bA=function(a){f&&t.m(a,y,A,"getOtherNode:node");var b=this.da;return a===b?this.ja:b};
A.prototype.getOtherPort=function(a){f&&t.m(a,X,A,"getOtherPort:port");var b=this.Sc;return a===b?this.Ed:b};t.A(A,{uJ:"isLabeledLink"},function(){return null===this.ff?!1:0<this.ff.count});t.A(A,{Ui:"labelNodes"},function(){return null===this.ff?t.dh:this.ff.k});function sm(a,b){null===a.ff&&(a.ff=new ua(y));a.ff.add(b);a.aa()}
A.prototype.Ps=function(){w.prototype.Ps.call(this);Hm(this)&&Jg(this,this.ya);var a=this.Wf,b=this.fg;if(null!==a){var c=this.Sc;null!==c&&(c.ee=null);qm(a,this,c);Fm(this)}null!==b&&(c=this.Ed,null!==c&&(c.ee=null),qm(b,this,c),Fm(this))};A.prototype.Qs=function(){w.prototype.Qs.call(this);Hm(this)&&Jg(this,this.ya);var a=this.Wf,b=this.fg;if(null!==a){var c=this.Sc;null!==c&&(c.ee=null);rm(a,this,c);Em(this)}null!==b&&(c=this.Ed,null!==c&&(c.ee=null),rm(b,this,c),Em(this))};
A.prototype.Im=function(){if(null!==this.ff){var a=this.h;if(null===a)return;for(var b=this.ff.copy().k;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.h,null!==a&&(a=a.fa,a instanceof U?a.OA(b):a instanceof Sd&&a.Ph(b,void 0)))};A.prototype.move=A.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);c=a.x-c;b=a.y-b;w.prototype.move.call(this,a);this.pl(c,b);for(a=this.Ui;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};
t.g(A,"relinkableFrom",A.prototype.cF);t.defineProperty(A,{cF:"relinkableFrom"},function(){return this.Cr},function(a){var b=this.Cr;b!==a&&(f&&t.j(a,"boolean",A,"relinkableFrom"),this.Cr=a,this.i("relinkableFrom",b,a),this.updateAdornments())});t.g(A,"relinkableTo",A.prototype.dF);t.defineProperty(A,{dF:"relinkableTo"},function(){return this.Dr},function(a){var b=this.Dr;b!==a&&(f&&t.j(a,"boolean",A,"relinkableTo"),this.Dr=a,this.i("relinkableTo",b,a),this.updateAdornments())});
A.prototype.canRelinkFrom=function(){if(!this.cF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Tj)return!1;a=a.h;return null===a||a.Tj?!0:!1};A.prototype.canRelinkTo=function(){if(!this.dF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Tj)return!1;a=a.h;return null===a||a.Tj?!0:!1};t.g(A,"resegmentable",A.prototype.xp);
t.defineProperty(A,{xp:"resegmentable"},function(){return this.Er},function(a){var b=this.Er;b!==a&&(f&&t.j(a,"boolean",A,"resegmentable"),this.Er=a,this.i("resegmentable",b,a),this.updateAdornments())});t.g(A,"isTreeLink",A.prototype.xc);t.defineProperty(A,{xc:"isTreeLink"},function(){return this.Sq},function(a){var b=this.Sq;b!==a&&(f&&t.j(a,"boolean",A,"isTreeLink"),this.Sq=a,this.i("isTreeLink",b,a),null!==this.da&&hj(this.da),null!==this.ja&&hj(this.ja))});
t.A(A,{path:"path"},function(){var a=this.ti;if(null!==a)return a;a=this.za;a=mk(this,a,a.length);return a instanceof Y?this.ti=a:null});A.prototype.Fq=function(){return this.path};A.prototype.jy=function(){return this.mc};A.prototype.pj=function(){this.updateRoute();var a=new D;this.kf(a);return this.Uy=a};
A.prototype.kf=function(a){var b=Infinity,c=Infinity,d=this.ma;if(0===d)return a.q(NaN,NaN,0,0),a;if(1===d)d=this.n(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.q(d.x,d.y,0,0);else if(2===d){var e=this.n(0),g=this.n(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y);a.q(e.x,e.y,0,0);a.aj(g)}else if(this.computeCurve()===Qg&&3<=d&&!this.ac)if(e=this.n(0),b=e.x,c=e.y,a.q(b,c,0,0),3===d)d=this.n(1),b=Math.min(d.x,b),c=Math.min(d.y,c),g=this.n(2),b=Math.min(g.x,b),c=Math.min(g.y,c),J.Do(e.x,e.y,d.x,d.y,d.x,d.y,g.x,
g.y,0.5,a);else for(var h,k,l=3;l<d;l+=3)h=this.n(l-2),l+3>=d&&(l=d-1),k=this.n(l-1),g=this.n(l),J.Do(e.x,e.y,h.x,h.y,k.x,k.y,g.x,g.y,0.5,a),b=Math.min(g.x,b),c=Math.min(g.y,c),e=g;else for(e=this.n(0),g=this.n(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.q(e.x,e.y,0,0),a.aj(g),l=2;l<d;l++)e=this.n(l),b=Math.min(e.x,b),c=Math.min(e.y,c),a.aj(e);this.kz.q(b-a.x,c-a.y);return a};t.A(A,{SE:"midPoint"},function(){this.updateRoute();return this.computeMidPoint(new C)});
A.prototype.computeMidPoint=function(a){var b=this.ma;if(0===b)return a.assign(J.oG),a;if(1===b)return a.assign(this.n(0)),a;if(2===b){var c=this.n(0),d=this.n(1);a.q((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===Qg&&3<=b&&!this.ac){if(3===b)return this.n(1);var b=(b-1)/3|0,e=3*(b/2|0);1===b%2?(c=this.n(e),d=this.n(e+1),b=this.n(e+2),e=this.n(e+3),J.kH(c.x,c.y,d.x,d.y,b.x,b.y,e.x,e.y,a)):a.assign(this.n(e));return a}for(var e=0,g=t.Cb(),h=0;h<b-1;h++)c=this.n(h),d=this.n(h+1),J.Ka(c.x,
d.x)?(c=d.y-c.y,0>c&&(c=-c)):J.Ka(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.$j(d)),g.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=g[h];if(c+d>e/2)break;c+=d;h++}t.Da(g);b=this.n(h);g=this.n(h+1);b.x===g.x?b.y>g.y?a.q(b.x,b.y-(e/2-c)):a.q(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.q(b.x-(e/2-c),b.y):a.q(b.x+(e/2-c),b.y):(e=(e/2-c)/d,a.q(b.x+e*(g.x-b.x),b.y+e*(g.y-b.y)));return a};t.A(A,{RE:"midAngle"},function(){this.updateRoute();return this.computeMidAngle()});
A.prototype.computeMidAngle=function(){var a=this.ma;if(2>a)return NaN;if(this.computeCurve()===Qg&&4<=a&&!this.ac){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),a=this.n(c),b=this.n(c+1),d=this.n(c+2),c=this.n(c+3);return J.jH(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0<c&&c+1<a)return a=this.n(c-1),b=this.n(c+1),a.Li(b)}d=a/2|0;if(0===a%2)return a=this.n(d-1),b=this.n(d),a.Li(b);var a=this.n(d-1),b=this.n(d),d=this.n(d+1),c=a.$j(b),e=b.$j(d);return c>e?a.Li(b):b.Li(d)};t.g(A,"points",A.prototype.points);
t.defineProperty(A,{points:"points"},function(){return this.mc},function(a){f&&(Array.isArray(a)||a instanceof H||t.l("Link.points value is not an instance of List or Array"));var b=this.mc;if(b!==a){if(Array.isArray(a)){for(var c=0===a.length%2,d=0;d<a.length;d++)if("number"!==typeof a[d]){c=!1;break}if(c)for(var e=new H(C),c=0;c<a.length/2;c++)d=new C(a[2*c],a[2*c+1]),e.add(d);else t.l("Link.points array must contain an even number of numbers")}else for(e=a.copy(),a=e.k;a.next();)a.value.freeze();
e.freeze();this.mc=e;this.Jf();Im(this);this.i("points",b,e)}});t.A(A,{ma:"pointsCount"},function(){return this.mc.count});A.prototype.getPoint=A.prototype.n=function(a){return this.mc.p[a]};A.prototype.setPoint=A.prototype.uf=function(a,b){f&&(t.m(b,C,A,"setPoint"),b.Q()||t.l("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.xg(a,b)};
A.prototype.setPointAt=A.prototype.Y=function(a,b,c){f&&(t.o(b,A,"setPointAt:x"),t.o(c,A,"setPointAt:y"));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.xg(a,new C(b,c))};A.prototype.insertPoint=function(a,b){f&&(t.m(b,C,A,"insertPoint"),b.Q()||t.l("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.Ad(a,b)};
A.prototype.insertPointAt=A.prototype.C=function(a,b,c){f&&(t.o(b,A,"insertPointAt:x"),t.o(c,A,"insertPointAt:y"));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.Ad(a,new C(b,c))};A.prototype.addPoint=A.prototype.Ch=function(a){f&&(t.m(a,C,A,"addPoint"),a.Q()||t.l("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.add(a)};
A.prototype.addPointAt=A.prototype.Yk=function(a,b){f&&(t.o(a,A,"insertPointAt:x"),t.o(b,A,"insertPointAt:y"));null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.add(new C(a,b))};A.prototype.removePoint=A.prototype.fF=function(a){null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.gd(a)};
A.prototype.clearPoints=A.prototype.Eo=function(){null===this.ue&&t.l("Call Link.startRoute before modifying the points of the route.");this.mc.clear()};A.prototype.movePoints=A.prototype.pl=function(a,b){for(var c=new H(C),d=this.mc.k;d.next();){var e=d.value;c.add((new C(e.x+a,e.y+b)).freeze())}c.freeze();d=this.mc;this.mc=c;this.Jf();Im(this);this.i("points",d,c)};A.prototype.startRoute=A.prototype.wl=function(){null===this.ue&&(this.ue=this.mc,this.mc=this.mc.copy())};
A.prototype.commitRoute=A.prototype.Ii=function(){if(null!==this.ue){for(var a=this.ue,b=this.mc,c=Infinity,d=Infinity,e=a.count,g=0;g<e;g++)var h=a.p[g],c=Math.min(h.x,c),d=Math.min(h.y,d);for(var k=Infinity,l=Infinity,m=b.count,g=0;g<m;g++)h=b.p[g],k=Math.min(h.x,k),l=Math.min(h.y,l),h.freeze();b.freeze();if(m===e)for(g=0;g<m;g++)if(e=a.p[g],h=b.p[g],e.x-c!==h.x-k||e.y-d!==h.y-l){this.Jf();break}this.ue=null;Im(this);this.i("points",a,b)}};
A.prototype.rollbackRoute=A.prototype.YI=function(){null!==this.ue&&(this.mc=this.ue,this.ue=null)};function Im(a){0===a.mc.count?a.Rg=!1:(a.Rg=!0,a.wn=a.n(0).copy(),a.An=a.n(a.ma-1).copy(),Jm(a,!1))}A.prototype.invalidateRoute=A.prototype.$b=function(){if(!(this.fz||this.h&&this.h.Aa.qb)){var a=this.Fq();null!==a&&(this.Rg=!1,this.Jf(),a.aa())}};t.defineProperty(A,{Jp:null},function(){return this.fz},function(a){this.fz=a});
A.prototype.updateRoute=function(){if(!this.Rg&&!this.Ix){var a=!0;try{this.Ix=!0,this.wl(),a=this.computePoints()}finally{this.Ix=!1,a?this.Ii():this.YI()}}};
A.prototype.computePoints=function(){var a=this.h;if(null===a)return!1;var b=this.da,c=null;null===b?(a.im||(a.dv=new Y,a.dv.Ca=J.kn,a.dv.ib=0,a.im=new y,a.im.add(a.dv),a.im.Gf()),this.wn&&(a.im.position=a.im.location=this.wn,a.im.Gf(),b=a.im,c=a.dv)):c=this.Sc;if(null!==c){var d=wk(c);d!==b&&b.zb()?c=d:(d=em(b),null!==d&&d!==b?(b=d,c=d.Is("")):b=d)}this.PC=b;if(null===b||null===c||!b.location.Q())return!1;var d=this.ja,e=null;null===d?(a.jm||(a.ev=new Y,a.ev.Ca=J.kn,a.ev.ib=0,a.jm=new y,a.jm.add(a.ev),
a.jm.Gf()),this.An&&(a.jm.position=a.jm.location=this.An,a.jm.Gf(),d=a.jm,e=a.ev)):e=this.Ed;null!==e&&(a=wk(e),a!==d&&d.zb()?e=a:(a=em(d),null!==a&&a!==d?(d=a,e=a.Is("")):d=a));this.RC=d;if(null===d||null===e||!d.location.Q())return!1;var a=this.ma,g=Km(this,c),h=Lm(this,e),k=c===e,l=this.ac,m=this.Ee===Qg;this.fi=k&&!l?m=!0:!1;var n=this.wo===Ig||k;if(l||g!==Pb||h!==Pb||k){m=this.Si;n&&(l&&m||k)&&this.Eo();var p=k?this.computeCurviness():0,q=this.getLinkPoint(b,c,g,!0,l,d,e),r=0,s=0,v=0;if(l||g!==
Pb||k){var x=this.computeEndSegmentLength(b,c,g,!0),v=this.getLinkDirection(b,c,q,g,!0,l,d,e);k&&(v-=l?90:30,0>p&&(v-=180));0>v?v+=360:360<=v&&(v-=360);k&&(x+=Math.abs(p));0===v?r=x:90===v?s=x:180===v?r=-x:270===v?s=-x:(r=x*Math.cos(v*Math.PI/180),s=x*Math.sin(v*Math.PI/180));if(g.qd()&&k){var E=c.gb(Vb,t.O()),F=t.ic(E.x+1E3*r,E.y+1E3*s);this.getLinkPointFromPoint(b,c,E,F,!0,q);t.B(E);t.B(F)}}var x=this.getLinkPoint(d,e,h,!1,l,b,c),G=0,L=0,N=0;if(l||h!==Pb||k)E=this.computeEndSegmentLength(d,e,h,
!1),N=this.getLinkDirection(d,e,x,h,!1,l,b,c),k&&(N+=l?0:30,0>p&&(N+=180)),0>N?N+=360:360<=N&&(N-=360),k&&(E+=Math.abs(p)),0===N?G=E:90===N?L=E:180===N?G=-E:270===N?L=-E:(G=E*Math.cos(N*Math.PI/180),L=E*Math.sin(N*Math.PI/180)),h.qd()&&k&&(E=e.gb(Vb,t.O()),F=t.ic(E.x+1E3*G,E.y+1E3*L),this.getLinkPointFromPoint(d,e,E,F,!1,x),t.B(E),t.B(F));e=q;if(l||g!==Pb||k)e=new C(q.x+r,q.y+s);c=x;if(l||h!==Pb||k)c=new C(x.x+G,x.y+L);!n&&!l&&g.qd()&&3<a&&this.adjustPoints(0,q,a-2,c)?this.uf(a-1,x):!n&&!l&&h.qd()&&
3<a&&this.adjustPoints(1,e,a-1,x)?this.uf(0,q):!n&&!l&&4<a&&this.adjustPoints(1,e,a-2,c)?(this.uf(0,q),this.uf(a-1,x)):!n&&l&&6<=a&&!m&&this.adjustPoints(1,e,a-2,c)?(this.uf(0,q),this.uf(a-1,x)):(this.Eo(),this.Ch(q),(l||g!==Pb||k)&&this.Ch(e),l&&this.addOrthoPoints(e,v,c,N,b,d),(l||h!==Pb||k)&&this.Ch(c),this.Ch(x))}else g=!1,!n&&3<=a&&(n=this.getLinkPoint(b,c,Pb,!0,!1,d,e),g=this.getLinkPoint(d,e,Pb,!1,!1,b,c),g=this.adjustPoints(0,n,a-1,g)),g||(this.Eo(),m?(a=this.getLinkPoint(b,c,Pb,!0,!1,d,e),
n=this.getLinkPoint(d,e,Pb,!1,!1,b,c),g=n.x-a.x,h=n.y-a.y,k=this.computeCurviness(),m=l=0,q=a.x+g/3,v=a.y+h/3,r=q,s=v,J.I(h,0)?s=0<g?s-k:s+k:(l=-g/h,m=Math.sqrt(k*k/(l*l+1)),0>k&&(m=-m),r=(0>h?-1:1)*m+q,s=l*(r-q)+v),q=a.x+2*g/3,v=a.y+2*h/3,x=q,G=v,J.I(h,0)?G=0<g?G-k:G+k:(x=(0>h?-1:1)*m+q,G=l*(x-q)+v),this.Eo(),this.Ch(a),this.Yk(r,s),this.Yk(x,G),this.Ch(n),this.uf(0,this.getLinkPoint(b,c,Pb,!0,!1,d,e)),this.uf(3,this.getLinkPoint(d,e,Pb,!1,!1,b,c))):(a=d,d=this.getLinkPoint(b,c,Pb,!0,!1,a,e),e=this.getLinkPoint(a,
e,Pb,!1,!1,b,c),this.hasCurviness()?(h=e.x-d.x,b=e.y-d.y,c=this.computeCurviness(),a=d.x+h/2,n=d.y+b/2,g=a,k=n,J.I(b,0)?k=0<h?k-c:k+c:(h=-h/b,g=Math.sqrt(c*c/(h*h+1)),0>c&&(g=-g),g=(0>b?-1:1)*g+a,k=h*(g-a)+n),this.Ch(d),this.Yk(g,k)):this.Ch(d),this.Ch(e)));return!0};function Mm(a,b){Math.abs(b.x-a.x)>Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b}
A.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new C);if(null===a||null===b)return g.assign(c),g;a.zb()||(e=em(a),null!==e&&e!==a&&(b=e.port));var h;a=null;if(null===b.ga)e=d.x,d=d.y,h=c.x,c=c.y;else{a=b.ga.he;e=1/(a.m11*a.m22-a.m12*a.m21);h=a.m22*e;var k=-a.m12*e,l=-a.m21*e,m=a.m11*e,n=e*(a.m21*a.dy-a.m22*a.dx),p=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*h+d.y*l+n;d=d.x*k+d.y*m+p;h=c.x*h+c.y*l+n;c=c.x*k+c.y*m+p}b.Ls(e,d,h,c,g);a&&g.transform(a);return g};
function Nm(a,b){var c=b.ee;null===c&&(c=new Om,c.port=b,c.Jc=b.U,b.ee=c);return Pm(c,a)}
A.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new C);if(c.rd())return b.gb(c,k),k;if(c.cp()&&(c=Nm(this,b),null!==c)){k.assign(c.jp);if(e&&this.st===wm){var l=Nm(this,h);if(c.Fm<l.Fm){c=t.O();var l=t.O(),m=new D(b.gb(Sb,c),b.gb($b,l)),n=this.computeSpot(!d);a=this.getLinkPoint(g,h,n,!d,e,a,b,l);a.x>=m.x&&a.x<=m.x+m.width?k.x=a.x:a.y>=m.y&&a.y<=m.y+m.height&&(k.y=a.y);t.B(c);t.B(l)}}return k}g=b.gb(Vb,t.O());c=null;this.ma>(e?6:2)?(h=d?this.n(1):this.n(this.ma-2),e&&(h=Mm(g,h.copy()))):
(c=t.O(),h=h.gb(Vb,c),e&&(h=Mm(g,h)));this.getLinkPointFromPoint(a,b,g,h,d,k);t.B(g);null!==c&&t.B(c);return k};
A.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.rd())c=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:0.5>d.x?225:0.5<d.x?45:0;else{if(d.cp()&&(a=Nm(this,b),null!==a))switch(a.Ie){case t.Fd:c=270;break a;case t.hd:c=180;break a;default:case t.ud:c=0;break a;case t.td:c=90;break a}a=b.gb(Vb,t.O());d=null;this.ma>(g?6:2)?(k=e?this.n(1):this.n(this.ma-2),k=g?Mm(a,k.copy()):c):(d=t.O(),k=k.gb(Vb,d));c=Math.abs(k.x-a.x)>Math.abs(k.y-a.y)?k.x>=a.x?0:180:k.y>=
a.y?90:270;t.B(a);null!==d&&t.B(d)}g=mm;g=e?this.Ro:this.Kp;g===mm&&(g=e?b.Ro:b.Kp);switch(g){case nm:b=b.jl();c+=b;360<=c&&(c-=360);break;case mm:case Mj:b=b.jl();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c};A.prototype.computeEndSegmentLength=function(a,b,c,d){if(c.cp()&&(a=Nm(this,b),null!==a))return a.cw;a=NaN;a=d?this.ek:this.mk;isNaN(a)&&(a=d?b.ek:b.mk);isNaN(a)&&(a=10);return a};
A.prototype.computeSpot=function(a){return a?Km(this,this.Sc):Lm(this,this.Ed)};function Km(a,b){var c=a.lb;c.Gc()&&(void 0===b&&(b=a.Sc),null!==b&&(c=b.lb));return c===Qb?Pb:c}function Lm(a,b){var c=a.mb;c.Gc()&&(void 0===b&&(b=a.Ed),null!==b&&(c=b.mb));return c===Qb?Pb:c}A.prototype.computeOtherPoint=function(a,b){var c=b.gb(Vb),d;d=b.ee;d=null!==d?Pm(d,this):null;null!==d&&(c=d.jp);return c};A.prototype.computeShortLength=function(a){return a?Qm(this):Rm(this)};
function Qm(a){var b=a.So;isNaN(b)&&(a=a.Sc,null!==a&&(b=a.So));return isNaN(b)?0:b}function Rm(a){var b=a.Lp;isNaN(b)&&(a=a.Ed,null!==a&&(b=a.Lp));return isNaN(b)?0:b}
A.prototype.ck=function(a,b,c,d,e,g){if(!1===this.Ze)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=t.ah(),h.reset());h.multiply(this.transform);if(this.Em(a,h))return El(this,b,c,e),void 0===g&&t.Se(h),!0;if(this.If(a,h)){var k=!1;if(!this.Ig)for(var l=this.za.length;l--;){var m=this.za.p[l];if(m.visible||m===this.Ub){var n=m.ya,p=this.Ia;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=t.ah();n.set(h);if(m instanceof B)k=m.ck(a,b,c,d,e,n);else if(this.path===
m){var k=m,q=a,r=d,p=n;if(!1===k.Ze)k=!1;else if(p.multiply(k.transform),r)b:{var s=q,v=p;if(k.Em(s,v))k=!0;else{if(void 0===v&&(v=k.transform,s.Wj(k.ya))){k=!0;break b}var p=s.left,q=s.right,r=s.top,s=s.bottom,x=t.O(),E=t.O(),F=t.O(),G=t.ah();G.set(v);G.yA(k.transform);G.jA();E.x=q;E.y=r;E.transform(G);x.x=p;x.y=r;x.transform(G);v=!1;Ll(k,x,E,F)?v=!0:(x.x=q,x.y=s,x.transform(G),Ll(k,x,E,F)?v=!0:(E.x=p,E.y=s,E.transform(G),Ll(k,x,E,F)?v=!0:(x.x=p,x.y=r,x.transform(G),Ll(k,x,E,F)&&(v=!0))));t.Se(G);
t.B(x);t.B(E);t.B(F);k=v}}else k=k.Em(q,p)}else k=Rj(m,a,d,n);k&&(null!==b&&(m=b(m)),m&&(null===c||c(m))&&e.add(m));t.Se(n)}}}void 0===g&&t.Se(h);return k||null!==this.background||null!==this.Ci}void 0===g&&t.Se(h);return!1};t.A(A,{ac:"isOrthogonal"},function(){return 2===(this.hm.value&2)});t.A(A,{Si:"isAvoiding"},function(){return 4===(this.hm.value&4)});A.prototype.computeCurve=function(){if(null===this.fi){var a=this.ac;this.fi=this.Sc===this.Ed&&!a}return this.fi?Qg:this.Ee};
A.prototype.computeCorner=function(){if(this.Ee===Qg)return 0;var a=this.Wv;if(isNaN(a)||0>a)a=10;return a};A.prototype.computeCurviness=function(){var a=this.Cs;if(isNaN(a)){var b=this.cf;if(0!==b){var a=10,c=this.h;null!==c&&(a=c.kp);c=Math.abs(b);a=a/2+((c-1)/2|0)*a;0===c%2&&(a=-a);0>b&&(a=-a)}else a=10}return a};A.prototype.hasCurviness=function(){return!isNaN(this.Cs)||0!==this.cf&&!this.ac};
A.prototype.adjustPoints=function(a,b,c,d){var e=this.wo;if(this.ac){if(e===Gk)return!1;e===Hk&&(e=Fk)}switch(e){case Gk:var g=this.n(a),h=this.n(c);if(!g.N(b)||!h.N(d)){var e=g.x,g=g.y,k=h.x-e,l=h.y-g,m=Math.sqrt(k*k+l*l);if(!J.I(m,0)){var n;J.I(k,0)?n=0>l?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,k=d.x-h,q=d.y-p,l=Math.sqrt(k*k+q*q);J.I(k,0)?q=0>q?-Math.PI/2:Math.PI/2:(q=Math.atan(q/Math.abs(k)),0>k&&(q=Math.PI-q));m=l/m;n=q-n;this.uf(a,b);for(a+=1;a<c;a++)b=
this.n(a),k=b.x-e,l=b.y-g,b=Math.sqrt(k*k+l*l),J.I(b,0)||(J.I(k,0)?l=0>l?-Math.PI/2:Math.PI/2:(l=Math.atan(l/Math.abs(k)),0>k&&(l=Math.PI-l)),k=l+n,b*=m,this.Y(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.uf(c,d)}}return!0;case Hk:g=this.n(a);p=this.n(c);if(!g.N(b)||!p.N(d)){e=g.x;g=g.y;h=p.x;p=p.y;m=(h-e)*(h-e)+(p-g)*(p-g);k=b.x;n=b.y;var l=d.x,q=d.y,r=0,s=1,r=0!==l-k?(q-n)/(l-k):9E9;0!==r&&(s=Math.sqrt(1+1/(r*r)));this.uf(a,b);for(a+=1;a<c;a++){b=this.n(a);var v=b.x,x=b.y,E=0.5;0!==m&&(E=((e-v)*(e-
h)+(g-x)*(g-p))/m);var F=e+E*(h-e),G=g+E*(p-g);b=Math.sqrt((v-F)*(v-F)+(x-G)*(x-G));x<r*(v-F)+G&&(b=-b);0<r&&(b=-b);v=k+E*(l-k);E=n+E*(q-n);0!==r?(b=v+b/s,this.Y(a,b,E-(b-v)/r)):this.Y(a,v,E+b)}this.uf(c,d)}return!0;case Fk:return this.ac&&(e=this.n(a),g=this.n(a+1),h=this.n(a+2),J.I(e.y,g.y)?J.I(g.x,h.x)?this.Y(a+1,g.x,b.y):J.I(g.y,h.y)&&this.Y(a+1,b.x,g.y):J.I(e.x,g.x)&&(J.I(g.y,h.y)?this.Y(a+1,b.x,g.y):J.I(g.x,h.x)&&this.Y(a+1,g.x,b.y)),e=this.n(c),g=this.n(c-1),h=this.n(c-2),J.I(e.y,g.y)?J.I(g.x,
h.x)?this.Y(c-1,g.x,d.y):J.I(g.y,h.y)&&this.Y(c-1,d.x,g.y):J.I(e.x,g.x)&&(J.I(g.y,h.y)?this.Y(c-1,d.x,g.y):J.I(g.x,h.x)&&this.Y(c-1,g.x,d.y))),this.uf(a,b),this.uf(c,d),!0;default:return!1}};
A.prototype.addOrthoPoints=function(a,b,c,d,e,g){b=-45<=b&&45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.ya.copy(),k=g.ya.copy();if(h.Q()&&k.Q()){h.Ug(8,8);k.Ug(8,8);h.aj(a);k.aj(c);var l,m;if(0===b)if(c.x>a.x||270===d&&c.y<a.y&&k.right>a.x||90===d&&c.y>a.y&&k.right>a.x)l=new C(c.x,a.y),m=new C(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,
k.left,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.x<k.left&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new C(a.x,c.y);m=new C((a.x+c.x)/2,c.y);if(180===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)180===d&&(k.Ha(a)||h.Ha(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,
k.bottom),!0):c.y>a.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x>=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new C(Math.max((a.x+c.x)/2,a.x),a.y),m=new C(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,0===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,0===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(180===b)if(c.x<a.x||270===d&&c.y<a.y&&k.left<a.x||
90===d&&c.y>a.y&&k.left<a.x)l=new C(c.x,a.y),m=new C(c.x,(a.y+c.y)/2),0===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,k.right,!1):a.x>k.left&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new C(a.x,c.y);m=new C((a.x+
c.x)/2,c.y);if(0===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)0===d&&(k.Ha(a)||h.Ha(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.bottom)if(c.x<=h.right&&c.x>=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l=new C(Math.min((a.x+c.x)/2,a.x),a.y),m=new C(l.x,c.y)}else l.y=270===
d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,180===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,180===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(90===b)if(c.y>a.y||180===d&&c.x<a.x&&k.bottom>a.y||0===d&&c.x>a.x&&k.bottom>a.y)l=new C(a.x,c.y),m=new C((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.y,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.y,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?
this.computeMidOrthoPosition(a.y,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.y<k.top&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new C(c.x,a.y);m=new C(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===d&&c.x>h.right)270===d&&(k.Ha(a)||h.Ha(c))?l.x=this.computeMidOrthoPosition(a.x,c.x,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,
Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y>=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new C(a.x,Math.max((a.y+c.y)/2,a.y)),m=new C(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,90===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,90===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}else if(c.y<a.y||180===d&&c.x<a.x&&k.top<a.y||0===d&&c.x>a.x&&k.top<a.y)l=new C(a.x,c.y),m=new C((a.x+c.x)/2,c.y),90===d?(l.y=this.computeMidOrthoPosition(a.y,
c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.y,k.bottom,!0):a.y>k.top&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new C(c.x,a.y);m=new C(c.x,(a.y+c.y)/2);if(90===d||0===d&&c.x<h.left||180===d&&c.x>h.right)90===d&&(k.Ha(a)||h.Ha(c))?l.x=this.computeMidOrthoPosition(a.x,
c.x,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.right)if(c.y<=h.bottom&&c.y>=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new C(a.x,Math.min((a.y+c.y)/2,a.y)),m=new C(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,270===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,270===d?h.right:Math.max(h.right,
k.right)),m.x=l.x,m.y=c.y}var n=l,p=m;if(this.Si){var q=this.h;if(null===q||h.Ha(c)||k.Ha(a)||e===g||this.layer.pc)a=!1;else if(e=ia(q,!0,this),Sm(e,Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&Sm(e,Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&Sm(e,Math.min(p.x,c.x),Math.min(p.y,c.y),Math.abs(p.x-c.x),Math.abs(p.y-c.y)))a=!1;else if(h=h.copy().nk(k),h.Ug(2*e.Bm,2*e.Am),Tm(e,a,b,c,d,h),k=Um(e,c.x,c.y),e.abort||k!==ka||(lj(e),k=e.DF,h.Ug(e.Bm*
k,e.Am*k),Tm(e,a,b,c,d,h),k=Um(e,c.x,c.y)),e.abort||k!==ka||(lj(e),k=e.EE,h.Ug(e.Bm*k,e.Am*k),Tm(e,a,b,c,d,h),k=Um(e,c.x,c.y)),!e.abort&&k===ka&&e.iG&&(lj(e),Tm(e,a,b,c,d,e.Mb),k=Um(e,c.x,c.y)),!e.abort&&k<ka&&Um(e,c.x,c.y)!==ja){Vm(this,e,c.x,c.y,d,!0);d=this.n(2);if(4>this.ma)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.Y(2,d.x,d.y),this.C(3,d.x,d.y);else if(c=this.n(3),0===b||180===b)J.I(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.Y(2,b,a.y),this.Y(3,b,c.y)):J.I(d.y,c.y)?
(Math.abs(a.y-d.y)<=e.Am/2&&(this.Y(2,d.x,a.y),this.Y(3,c.x,a.y)),this.C(2,d.x,a.y)):this.Y(2,a.x,d.y);else if(90===b||270===b)J.I(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.Y(2,a.x,b),this.Y(3,c.x,b)):J.I(d.x,c.x)?(Math.abs(a.x-d.x)<=e.Bm/2&&(this.Y(2,a.x,d.y),this.Y(3,a.x,c.y)),this.C(2,a.x,d.y)):this.Y(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.Ch(l),this.Ch(m))}};
A.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function Ef(a){if(!a.Si)return!1;var b=a.points.p,c=b.length;if(4>c)return!1;a=ia(a.h,!0,a);for(var d=1;d<c-2;d++){var e=b[d],g=b[d+1];if(!Sm(a,Math.min(e.x,g.x),Math.min(e.y,g.y),Math.abs(e.x-g.x),Math.abs(e.y-g.y)))return!0}return!1}
function Vm(a,b,c,d,e,g){var h=b.Bm,k=b.Am,l=Um(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;l>Wm&&Um(b,m,n)===l-Xm;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,l-=Xm;if(g){if(l>Wm)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/k)*k+k/2;l>Wm&&(g=e,m=c,n=d,0===e?(g=90,n+=k):90===e?(g=180,m-=h):180===e?(g=270,n-=k):270===e&&(g=0,m+=h),Um(b,m,n)===l-Xm?Vm(a,b,m,n,g,!1):(m=c,n=d,0===e?(g=270,n-=
k):90===e?(g=0,m+=h):180===e?(g=90,n+=k):270===e&&(g=180,m-=h),Um(b,m,n)===l-Xm&&Vm(a,b,m,n,g,!1)));a.Yk(c,d)}A.prototype.findClosestSegment=function(a){f&&t.m(a,C,A,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.n(0),d=this.n(1),e=db(b,a,c.x,c.y,d.x,d.y),g=0,h=1;h<this.ma-1;h++){var c=this.n(h+1),k=db(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(g=h,e=k)}return g};A.prototype.invalidateGeometry=A.prototype.Jf=function(){this.ti=this.Ra=null;this.aa()};
t.A(A,{ed:"geometry"},function(){null===this.Ra&&(this.updateRoute(),this.Ra=this.makeGeometry());return this.Ra});A.prototype.zw=function(){if(null===this.Ra&&!1!==this.Rg){this.Ra=this.makeGeometry();var a=this.Fq();if(null!==a){a.Ra=this.Ra;for(var b=this.za,c=b.length,d=0;d<c;d++){var e=b.p[d];e!==a&&e.Jh&&e instanceof Y&&(e.Ra=this.Ra)}}}};
A.prototype.makeGeometry=function(){var a=this.ma;if(2>a){var b=new M(Lc),c=new Mc(0,0);b.ub.add(c);return b}var d=this.n(0).copy(),e=d.copy(),g=this.computeCurve();if(g===Qg&&3<=a&&!J.Ka(this.dn,0))if(3===a)var h=this.n(1),b=Math.min(d.x,h.x),c=Math.min(d.y,h.y),h=this.n(2),b=Math.min(b,h.x),c=Math.min(c,h.y);else{if(this.ac)for(h=0;h<a;h++)b=this.mc.p[h],e.x=Math.min(b.x,e.x),e.y=Math.min(b.y,e.y);else for(var k,h=3;h<a;h+=3)h+3>=a&&(h=a-1),k=this.n(h),e.x=Math.min(k.x,e.x),e.y=Math.min(k.y,e.y);
b=e.x;c=e.y}else{for(h=0;h<a;h++)b=this.mc.p[h],e.x=Math.min(b.x,e.x),e.y=Math.min(b.y,e.y);b=e.x;c=e.y}b-=this.kz.x;c-=this.kz.y;d.x-=b;d.y-=c;if(2===a){var l=this.n(1).copy();l.x-=b;l.y-=c;0!==Qm(this)&&Ym(this,d,!0,e);0!==Rm(this)&&Ym(this,l,!1,e);b=new M(Tc);b.na=d.x;b.oa=d.y;b.D=l.x;b.F=l.y}else{l=t.u();0!==Qm(this)&&Ym(this,d,!0,e);O(l,d.x,d.y,!1,!1);if(g===Qg&&3<=a&&!J.Ka(this.dn,0))if(3===a)h=this.n(1),a=h.x-b,d=h.y-c,h=this.n(2).copy(),h.x-=b,h.y-=c,0!==Rm(this)&&Ym(this,h,!1,e),P(l,a,d,
a,d,h.x,h.y);else if(this.ac){d=new C(b,c);g=this.n(1).copy();k=new C(b,c);for(var a=new C(b,c),e=this.n(0),m=null,n=this.dn/3,h=1;h<this.ma-1;h++){var m=this.n(h),p=e,q=m,r=this.n(Zm(this,m,h,!1));if(!J.Ka(p.x,q.x)||!J.Ka(q.x,r.x))if(!J.Ka(p.y,q.y)||!J.Ka(q.y,r.y)){var s=n,v=k,x=a;isNaN(s)&&(s=this.dn/3);var E=p.x,p=p.y,F=q.x,q=q.y,G=r.x,r=r.y,L=s*$m(E,p,F,q),s=s*$m(F,q,G,r);J.Ka(p,q)&&J.Ka(F,G)&&(F>E?r>q?(v.x=F-L,v.y=q-L,x.x=F+s,x.y=q+s):(v.x=F-L,v.y=q+L,x.x=F+s,x.y=q-s):r>q?(v.x=F+L,v.y=q-L,x.x=
F-s,x.y=q+s):(v.x=F+L,v.y=q+L,x.x=F-s,x.y=q-s));J.Ka(E,F)&&J.Ka(q,r)&&(q>p?(G>F?(v.x=F-L,v.y=q-L,x.x=F+s):(v.x=F+L,v.y=q-L,x.x=F-s),x.y=q+s):(G>F?(v.x=F-L,v.y=q+L,x.x=F+s):(v.x=F+L,v.y=q+L,x.x=F-s),x.y=q-s));if(J.Ka(E,F)&&J.Ka(F,G)||J.Ka(p,q)&&J.Ka(q,r))E=0.5*(E+G),p=0.5*(p+r),v.x=E,v.y=p,x.x=E,x.y=p;1===h?(g.x=0.5*(e.x+m.x),g.y=0.5*(e.y+m.y)):2===h&&J.Ka(e.x,this.n(0).x)&&J.Ka(e.y,this.n(0).y)&&(g.x=0.5*(e.x+m.x),g.y=0.5*(e.y+m.y));P(l,g.x-b,g.y-c,k.x-b,k.y-c,m.x-b,m.y-c);d.set(k);g.set(a);e=m}}h=
e.x;e=e.y;d=this.n(this.ma-1);h=0.5*(h+d.x);e=0.5*(e+d.y);P(l,a.x-b,a.y-c,h-b,e-c,d.x-b,d.y-c)}else for(h=3;h<a;h+=3)e=this.n(h-2),h+3>=a&&(h=a-1),d=this.n(h-1),k=this.n(h),h===a-1&&0!==Rm(this)&&(k=k.copy(),Ym(this,k,!1,J.ok)),P(l,e.x-b,e.y-c,d.x-b,d.y-c,k.x-b,k.y-c);else{e=t.O();e.assign(this.n(0));for(h=1;h<a;){h=Zm(this,e,h,1<h);n=this.n(h);if(h>=a-1){e!==n&&(0!==Rm(this)&&(n=n.copy(),Ym(this,n,!1,J.ok)),an(this,l,-b,-c,e,n));break}h=Zm(this,n,h+1,h<a-3);d=l;g=-b;k=-c;m=e;v=this.n(h);x=e;J.I(m.y,
n.y)&&J.I(n.x,v.x)?(E=this.computeCorner(),E=Math.min(E,Math.abs(n.x-m.x)/2),E=p=Math.min(E,Math.abs(v.y-n.y)/2),J.I(E,0)?(an(this,d,g,k,m,n),x.assign(n)):(s=n.x,F=n.y,q=s,G=F,s=n.x>m.x?n.x-E:n.x+E,G=v.y>n.y?n.y+p:n.y-p,an(this,d,g,k,m,new C(s,F)),ad(d,n.x+g,n.y+k,q+g,G+k),x.q(q,G))):J.I(m.x,n.x)&&J.I(n.y,v.y)?(E=this.computeCorner(),p=Math.min(E,Math.abs(n.y-m.y)/2),p=E=Math.min(p,Math.abs(v.x-n.x)/2),J.I(E,0)?(an(this,d,g,k,m,n),x.assign(n)):(s=n.x,G=F=n.y,F=n.y>m.y?n.y-p:n.y+p,q=v.x>n.x?n.x+E:
n.x-E,an(this,d,g,k,m,new C(s,F)),ad(d,n.x+g,n.y+k,q+g,G+k),x.q(q,G))):(an(this,d,g,k,m,n),x.assign(n))}t.B(e)}b=l.s;t.v(l)}return b};function $m(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return J.Ka(a,0)?b:J.Ka(b,0)?a:Math.sqrt(a*a+b*b)}
function Ym(a,b,c,d){var e=a.ma;if(!(2>e))if(c){var g=a.n(1);c=g.x-d.x;d=g.y-d.y;g=$m(b.x,b.y,c,d);0!==g&&(e=2===e?0.5*g:g,a=Qm(a),a>e&&(a=e),c=a*(c-b.x)/g,a=a*(d-b.y)/g,b.x+=c,b.y+=a)}else g=a.n(e-2),c=g.x-d.x,d=g.y-d.y,g=$m(b.x,b.y,c,d),0!==g&&(e=2===e?0.5*g:g,a=Rm(a),a>e&&(a=e),c=a*(b.x-c)/g,a=a*(b.y-d)/g,b.x-=c,b.y-=a)}
function Zm(a,b,c,d){for(var e=a.ma,g=b;J.Ka(b.x,g.x)&&J.Ka(b.y,g.y);){if(c>=e)return e-1;g=a.n(c++)}if(!J.Ka(b.x,g.x)&&!J.Ka(b.y,g.y))return c-1;for(var h=g;J.Ka(b.x,g.x)&&J.Ka(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||J.Ka(b.y,g.y)&&J.Ka(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.n(c++)}return c-2}
function an(a,b,c,d,e,g){if(Hm(a)){var h=new H("number"),k=bn(a,e,g,h),l=e.x,l=e.y;if(0<k)if(J.I(e.y,g.y))if(e.x<g.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h.p[m++]-5,g.x-10));b.lineTo(n+c,g.y+d);for(var l=n+c,p=Math.min(n+10,g.x);m<k;){var q=h.p[m];if(q<p+10)m++,p=Math.min(q+5,g.x);else break}q=(n+p)/2+c;q=g.y-10+d;n=p+c;p=g.y+d;a.Ee===Hg?O(b,n,p,!1,!1):P(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h.p[m--]+5,g.x+10));b.lineTo(n+c,g.y+d);l=n+c;for(p=Math.max(n-10,g.x);0<=
m;)if(q=h.p[m],q>p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.Ee===Hg?O(b,n,p,!1,!1):P(b,l,q,n,q,n,p)}else if(J.I(e.x,g.x))if(e.y<g.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h.p[m++]-5,g.y-10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.min(n+10,g.y);m<k;)if(q=h.p[m],q<p+10)m++,p=Math.min(q+5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Ee===Hg?O(b,n,p,!1,!1):P(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h.p[m--]+5,g.y+10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.max(n-10,
g.y);0<=m;)if(q=h.p[m],q>p-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Ee===Hg?O(b,n,p,!1,!1):P(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)}
function bn(a,b,c,d){var e=a.h;if(null===e)return 0;Math.min(b.x,c.x);Math.min(b.y,c.y);Math.max(b.x,c.x);Math.max(b.y,c.y);for(e=e.Tm;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.cb.p,h=g.length,k=0;k<h;k++){var l=g[k];if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l instanceof A&&a.zb()&&l.zb()&&Hm(l)){var m=l.pj();m.Q()&&a.pj().If(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.ol()&&cn(b,c,d,l))}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
function cn(a,b,c,d){for(var e=d.ma,g=1;g<e;g++){var h=d.n(g-1),k=d.n(g),l=t.O(),m;a:{m=a;var n=b,p=l;if(!J.I(m.x,n.x)){if(J.I(h.x,k.x)&&Math.min(m.x,n.x)<=h.x&&Math.max(m.x,n.x)>=h.x&&Math.min(h.y,k.y)<=m.y&&Math.max(h.y,k.y)>=m.y&&!J.I(h.y,k.y)){p.x=h.x;p.y=m.y;m=!0;break a}}else if(J.I(h.y,k.y)&&Math.min(m.y,n.y)<=h.y&&Math.max(m.y,n.y)>=h.y&&Math.min(h.x,k.x)<=m.x&&Math.max(h.x,k.x)>=m.x&&!J.I(h.x,k.x)){p.x=m.x;p.y=h.y;m=!0;break a}p.x=0;p.y=0;m=!1}m&&(J.I(a.y,b.y)?c.add(l.x):c.add(l.y));t.B(l)}}
t.A(A,{Ks:"firstPickIndex"},function(){return 2>=this.ma?0:this.ac||Km(this)!==Pb?1:0});t.A(A,{ww:"lastPickIndex"},function(){var a=this.ma;return 0===a?0:2>=a?a-1:this.ac||Lm(this)!==Pb?a-2:a-1});function Hm(a){a=a.Ee;return a===Gg||a===Hg}function Jm(a,b){if(b||Hm(a)){var c=a.h;null===c||c.Dn.contains(a)||null===a.Uy||c.Dn.add(a,a.Uy)}}
function Jg(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.pc){var d=c.h;if(null!==d)for(var e=!1,d=d.Tm;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.cb.p,k=g.length,l=0;l<k;l++){var m=g[l];m instanceof A&&(m===a?h=!0:h&&dn(a,m,b))}else if(e)for(g=g.cb.p,k=g.length,l=0;l<k;l++)m=g[l],m instanceof A&&dn(a,m,b)}}}function dn(a,b,c){if(null!==b&&Hm(b)&&null!==b.Ra){var d=b.pj();d.Q()&&(a.pj().If(d)||c.If(d))&&(a.usesSamePort(b)||b.Jf())}}
A.prototype.usesSamePort=function(a){var b=this.ma,c=a.ma;if(0<b&&0<c){if(this.n(0).Oi(a.n(0))||this.n(b-1).Oi(a.n(c-1)))return!0}else if(this.da===a.da||this.ja===a.ja)return!0;return!1};t.g(A,"adjusting",A.prototype.wo);t.defineProperty(A,{wo:"adjusting"},function(){return this.Zp},function(a){var b=this.Zp;b!==a&&(f&&t.tb(a,A,A,"adjusting"),this.Zp=a,this.i("adjusting",b,a))});t.g(A,"corner",A.prototype.Wv);
t.defineProperty(A,{Wv:"corner"},function(){return this.lq},function(a){var b=this.lq;b!==a&&(f&&t.j(a,"number",A,"corner"),this.lq=a,this.Jf(),this.i("corner",b,a))});t.g(A,"curve",A.prototype.Ee);t.defineProperty(A,{Ee:"curve"},function(){return this.oq},function(a){var b=this.oq;b!==a&&(f&&t.tb(a,A,A,"curve"),this.oq=a,this.$b(),Jm(this,b===Hg||b===Gg||a===Hg||a===Gg),this.i("curve",b,a))});t.g(A,"curviness",A.prototype.Cs);
t.defineProperty(A,{Cs:"curviness"},function(){return this.pq},function(a){var b=this.pq;b!==a&&(f&&t.j(a,"number",A,"curviness"),this.pq=a,this.$b(),this.i("curviness",b,a))});t.g(A,"routing",A.prototype.st);t.defineProperty(A,{st:"routing"},function(){return this.hm},function(a){var b=this.hm;b!==a&&(f&&t.tb(a,A,A,"routing"),this.hm=a,this.fi=null,this.$b(),Jm(this,2===(b.value&2)||2===(a.value&2)),this.i("routing",b,a))});t.g(A,"smoothness",A.prototype.dn);
t.defineProperty(A,{dn:"smoothness"},function(){return this.Zr},function(a){var b=this.Zr;b!==a&&(f&&t.j(a,"number",A,"smoothness"),this.Zr=a,this.Jf(),this.i("smoothness",b,a))});
function Fm(a){var b=a.Wf;if(null!==b){var c=a.fg;if(null!==c){var d=a.nh;a=a.Ah;var e;a:{if(null!==c&&null!==b.fh)for(e=b.fh.k;e.next();){var g=e.value;if(g.sp===b&&g.gt===c&&g.Dw===d&&g.Ew===a||g.sp===c&&g.gt===b&&g.Dw===a&&g.Ew===d){e=g;break a}}e=null}for(var h=g=null,k=b.dc.p,l=k.length,m=0;m<l;m++){var n=k[m];if(n.Wf===b&&n.nh===d&&n.fg===c&&n.Ah===a||n.Wf===c&&n.nh===a&&n.fg===b&&n.Ah===d)null===h?h=n:(null===g&&(g=new H(A),g.add(h)),g.add(n))}if(null!==g)for(null===e&&(e=new pm,e.sp=b,e.Dw=
d,e.gt=c,e.Ew=a,om(b,e),om(c,e)),e.links=g,m=0;m<g.count;m++)if(n=g.p[m],0===n.cf){b=1;for(c=0;c<g.count;c++)Math.abs(g.p[c].cf)===b&&(b++,c=-1);n.qn=e;n.cf=n.da===e.sp?b:-b;n.$b()}}}}
function Em(a){var b=a.qn;if(null!==b){var c=a.cf;a.qn=null;a.cf=0;a.$b();b.links.remove(a);if(2>b.links.count)1===b.links.count&&(c=b.links.p[0],c.qn=null,c.cf=0,c.$b()),c=b.sp,null!==b&&null!==c.fh&&c.fh.remove(b),c=b.gt,null!==b&&null!==c.fh&&c.fh.remove(b);else for(c=Math.abs(c),a=0===c%2,b=b.links.k;b.next();){var d=b.value,e=Math.abs(d.cf),g=0===e%2;e>c&&a===g&&(d.cf=0<d.cf?d.cf-2:d.cf+2,d.$b())}}}function pm(){t.zc(this);this.links=this.Ew=this.gt=this.Dw=this.sp=null}
t.je(pm,{sp:!0,Dw:!0,gt:!0,Ew:!0,links:!0,spacing:!0});function jj(){t.zc(this);this.group=null;this.Zo=!0;this.abort=!1;this.Cf=this.Bf=1;this.hr=this.gr=-1;this.kd=this.vd=8;this.bc=null;this.iG=!1;this.DF=22;this.EE=111}t.je(jj,{group:!0,Zo:!0,abort:!0,iG:!0,DF:!0,EE:!0});var ja=0,Wm=1,Xm=1,ka=999999999,en=ka;
jj.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Bf=Math.floor((a.x-this.vd)/this.vd)*this.vd;this.Cf=Math.floor((b-this.kd)/this.kd)*this.kd;this.gr=Math.ceil((c+2*this.vd)/this.vd)*this.vd;this.hr=Math.ceil((d+2*this.kd)/this.kd)*this.kd;a=1+(Math.ceil((this.gr-this.Bf)/this.vd)|0);b=1+(Math.ceil((this.hr-this.Cf)/this.kd)|0);if(null===this.bc||this.rm<a-1||this.sm<b-1){c=[];for(d=0;d<=a;d++){for(var e=[],g=0;g<=b;g++)e[g]=0;c[d]=e}this.bc=
c;this.rm=a-1;this.sm=b-1}if(null!==this.bc)for(a=0;a<=this.rm;a++)for(b=0;b<=this.sm;b++)this.bc[a][b]=en}};t.A(jj,{Mb:null},function(){return new D(this.Bf,this.Cf,this.gr-this.Bf,this.hr-this.Cf)});t.g(jj,"cellWidth",jj.prototype.Bm);t.defineProperty(jj,{Bm:null},function(){return this.vd},function(a){0<a&&a!==this.vd&&(this.vd=a,this.initialize(this.Mb))});t.g(jj,"cellHeight",jj.prototype.Am);t.defineProperty(jj,{Am:null},function(){return this.kd},function(a){0<a&&a!==this.kd&&(this.kd=a,this.initialize(this.Mb))});
function fn(a,b,c){return a.Bf<=b&&b<=a.gr&&a.Cf<=c&&c<=a.hr}function Um(a,b,c){if(!fn(a,b,c))return 0;b-=a.Bf;b/=a.vd;c-=a.Cf;c/=a.kd;return a.bc[b|0][c|0]}function mj(a,b,c){fn(a,b,c)&&(b-=a.Bf,b/=a.vd,c-=a.Cf,c/=a.kd,a.bc[b|0][c|0]=ja)}function lj(a){if(null!==a.bc)for(var b=0;b<=a.rm;b++)for(var c=0;c<=a.sm;c++)a.bc[b][c]>=Wm&&(a.bc[b][c]|=ka)}
function Sm(a,b,c,d,e){if(b>a.gr||b+d<a.Bf||c>a.hr||c+e<a.Cf)return!0;b=(b-a.Bf)/a.vd|0;c=(c-a.Cf)/a.kd|0;d=Math.max(0,d)/a.vd+1|0;var g=Math.max(0,e)/a.kd+1|0;0>b&&(d+=b,b=0);0>c&&(g+=c,c=0);if(0>d||0>g)return!0;e=Math.min(b+d-1,a.rm)|0;for(d=Math.min(c+g-1,a.sm)|0;b<=e;b++)for(g=c;g<=d;g++)if(a.bc[b][g]===ja)return!1;return!0}
function gn(a,b,c,d,e,g,h,k,l){if(!(b<g||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.bc[m][n];if(p>=Wm&&p<ka)for(e?n+=d:m+=d,p+=Xm;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.bc[m][n]);)a.bc[m][n]=p,p+=Xm,e?n+=d:m+=d;m=e?n:m;if(e)if(0<d)for(c+=d;c<m;c+=d)gn(a,b,c,1,!e,g,h,k,l),gn(a,b,c,-1,!e,g,h,k,l);else for(c+=d;c>m;c+=d)gn(a,b,c,1,!e,g,h,k,l),gn(a,b,c,-1,!e,g,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)gn(a,b,c,1,!e,g,h,k,l),gn(a,b,c,-1,!e,g,h,k,l);else for(b+=d;b>m;b+=d)gn(a,b,c,1,!e,g,h,k,l),gn(a,b,c,-1,!e,g,h,
k,l)}}function hn(a,b,c,d,e,g,h,k,l,m,n){for(var p=b|0,q=c|0,r=a.bc[p][q];0===r&&p>k&&p<l&&q>m&&q<n;)if(h?q+=g:p+=g,r=a.bc[p][q],1>=Math.abs(p-d)&&1>=Math.abs(q-e))return a.abort=!0,0;p=b|0;q=c|0;r=a.bc[p][q];b=Wm;for(a.bc[p][q]=b;0===r&&p>k&&p<l&&q>m&&q<n;)h?q+=g:p+=g,r=a.bc[p][q],a.bc[p][q]=b,b+=Xm;return h?q:p}
function Tm(a,b,c,d,e,g){if(null!==a.bc){a.abort=!1;var h=b.x,k=b.y;if(fn(a,h,k)){var h=h-a.Bf,h=h/a.vd,k=k-a.Cf,k=k/a.kd,l=d.x,m=d.y;if(fn(a,l,m))if(l-=a.Bf,l/=a.vd,m-=a.Cf,m/=a.kd,1>=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=g.x;b=g.y;d=g.x+g.width;var p=g.y+g.height,n=n-a.Bf,n=n/a.vd;b-=a.Cf;b/=a.kd;d-=a.Bf;d/=a.vd;p-=a.Cf;p/=a.kd;g=Math.max(0,Math.min(a.rm,n|0));d=Math.min(a.rm,Math.max(0,d|0));b=Math.max(0,Math.min(a.sm,b|0));var p=Math.min(a.sm,Math.max(0,p|0)),h=h|0,k=k|0,l=l|0,
m=m|0,n=h,q=k,r=0===c||90===c?1:-1;(c=90===c||270===c)?q=hn(a,h,k,l,m,r,c,g,d,b,p):n=hn(a,h,k,l,m,r,c,g,d,b,p);if(!a.abort){a:{c=0===e||90===e?1:-1;e=90===e||270===e;for(var r=l|0,s=m|0,v=a.bc[r][s];0===v&&r>g&&r<d&&s>b&&s<p;)if(e?s+=c:r+=c,v=a.bc[r][s],1>=Math.abs(r-h)&&1>=Math.abs(s-k)){a.abort=!0;break a}r=l|0;s=m|0;v=a.bc[r][s];for(a.bc[r][s]=en;0===v&&r>g&&r<d&&s>b&&s<p;)e?s+=c:r+=c,v=a.bc[r][s],a.bc[r][s]=en}a.abort||(gn(a,n,q,1,!1,g,d,b,p),gn(a,n,q,-1,!1,g,d,b,p),gn(a,n,q,1,!0,g,d,b,p),gn(a,
n,q,-1,!0,g,d,b,p))}}}}}function Om(){t.zc(this);this.port=this.Jc=null;this.rg=[];this.ft=!1}t.je(Om,{Jc:!0,port:!0,rg:!0,ft:!0});Om.prototype.toString=function(){for(var a=this.rg,b=this.Jc.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n  "+d.toString())}return b};
function jn(a,b,c,d){b=b.offsetY;switch(b){case t.td:return 90;case t.hd:return 180;case t.Fd:return 270;case t.ud:return 0}switch(b){case t.td|t.Fd:return 180<c?270:90;case t.hd|t.ud:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case t.hd|t.Fd:return c>a&&c<=180+a?180:270;case t.Fd|t.ud:return c>180-a&&c<=360-a?270:0;case t.ud|t.td:return c>a&&c<=180+a?90:0;case t.td|t.hd:return c>180-a&&c<=360-a?180:90;case t.hd|t.Fd|t.ud:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
a?270:0;case t.Fd|t.ud|t.td:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case t.ud|t.td|t.hd:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case t.td|t.hd|t.Fd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(t.hd|t.Fd|t.ud|t.td)&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}
function Pm(a,b){var c=a.rg;if(0===c.length){if(!a.ft){c=a.ft;a.ft=!0;var d=a.Jc.Dd,e=a.rg.length=0,g=a.port.gb(Sb,t.O()),h=a.port.gb($b,t.O()),k=t.lk(g.x,g.y,0,0);k.aj(h);t.B(g);t.B(h);g=t.ic(k.x+k.width/2,k.y+k.height/2);for(d=d.k;d.next();)if(h=d.value,h.zb()){var l=Pb,l=h.Sc===a.port?Km(h,a.port):Lm(h,a.port);if(l.cp()){var m;m=h.Sc===a.port?h.Ed:h.Sc;if(null!==m){var n=m.U;if(null!==n){m=h.computeOtherPoint(n,m);var n=g.Li(m),l=jn(k,l,n,h.ac),p;0===l?(p=t.ud,180<n&&(n-=360)):p=90===l?t.td:180===
l?t.hd:t.Fd;(l=a.rg[e])?(l.link=h,l.angle=n,l.Ie=p):(l=new kn(h,n,p),a.rg[e]=l);l.Cw.set(m);e++}}}}t.B(g);a.rg.sort(Om.prototype.GI);g=a.rg.length;d=-1;for(e=h=0;e<g;e++)l=a.rg[e],null!==l&&(l.Ie!==d&&(d=l.Ie,h=0),l.Yo=h,h++);d=-1;h=0;for(e=g-1;0<=e;e--)l=a.rg[e],null!==l&&(l.Ie!==d&&(d=l.Ie,h=l.Yo+1),l.Fm=h);e=a.rg;for(g=0;g<e.length;g++)if(d=e[g],null!==d){l=d;m=a.port;d=t.O();h=t.O();switch(l.Ie){case t.td:m.gb($b,d);m.gb(Wb,h);break;case t.hd:m.gb(Wb,d);m.gb(Sb,h);break;case t.Fd:m.gb(Sb,d);m.gb(Ub,
h);break;default:case t.ud:m.gb(Ub,d),m.gb($b,h)}m=h.y-d.y;n=(l.Yo+1)/(l.Fm+1);l=l.jp;l.x=d.x+(h.x-d.x)*n;l.y=d.y+m*n;t.B(d);t.B(h)}e=a.rg;for(g=0;g<e.length;g++)d=e[g],null!==d&&(d.cw=a.computeEndSegmentLength(d));a.ft=c;t.Rc(k)}c=a.rg}for(k=0;k<c.length;k++)if(e=c[k],null!==e&&e.link===b)return e;return null}Om.prototype.GI=function(a,b){return a===b?0:null===a?-1:null===b?1:a.Ie<b.Ie?-1:a.Ie>b.Ie?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
Om.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Jc,this.port,Pb,b.Sc===this.port),d=a.Yo;if(0>d)return c;var e=a.Fm;if(1>=e||!b.ac)return c;var b=a.Cw,g=a.jp;if(a.Ie===t.hd||a.Ie===t.td)d=e-1-d;return((a=a.Ie===t.hd||a.Ie===t.ud)?b.y<g.y:b.x<g.x)?c+8*d:(a?b.y===g.y:b.x===g.x)?c:c+8*(e-1-d)};function kn(a,b,c){this.link=a;this.angle=b;this.Ie=c;this.Cw=new C;this.Fm=this.Yo=0;this.jp=new C;this.cw=0}
t.je(kn,{link:!0,angle:!0,Ie:!0,Cw:!0,Yo:!0,Fm:!0,jp:!0,cw:!0});kn.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Ie.toString()+":"+this.Yo.toString()+"/"+this.Fm.toString()+" "+this.jp.toString()+" "+this.cw.toString()+" "+this.Cw.toString()};
function z(a){0===arguments.length?y.call(this,ah):y.call(this,a);this.jr=new ua(w);this.bm=new ua(z);this.Qk=this.kr=this.ir=null;this.ls=!1;this.Pq=!0;this.ms=!1;this.wb=this.bs=null;this.hq=!1;this.iq=!0;this.jq=!1;this.Ld=new ue;this.Ld.group=this}t.ia("Group",z);t.Oa(z,y);
z.prototype.cloneProtected=function(a){y.prototype.cloneProtected.call(this,a);a.ir=this.ir;a.kr=this.kr;a.Qk=this.Qk;a.ls=this.ls;a.Pq=this.Pq;a.ms=this.ms;a.bs=this.bs;var b=Al(a,a,function(a){return a instanceof Vg});a.wb=b instanceof Vg?b:null;a.hq=this.hq;a.iq=this.iq;a.jq=this.jq;null!==this.Ld?(a.Ld=this.Ld.copy(),a instanceof z&&(a.Ld.group=a)):(null!==a.Ld&&(a.Ld.group=null),a.Ld=null)};
z.prototype.Gh=function(a){y.prototype.Gh.call(this,a);var b=a.Po();for(a=a.Ic;a.next();){var c=a.value;c.aa();c.K(Nh);c.Ae();c instanceof z&&(c.Vw=c.Ve,ln(c,b));if(c instanceof y)c.Vg(b);else if(c instanceof A)for(c=c.Ui;c.next();)c.value.Vg(b)}};
z.prototype.Zm=function(a,b,c,d,e,g,h){if(a===Dd&&"elements"===b)if(e instanceof Vg)null===this.wb?this.wb=e:this.wb!==e&&t.l("Cannot insert a second Placeholder into the visual tree of a Group.");else{if(e instanceof B){var k=Al(e,e,function(a){return a instanceof Vg});k instanceof Vg&&(null===this.wb?this.wb=k:this.wb!==k&&t.l("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Md&&"elements"===b&&null!==this.wb&&(d===this.wb?this.wb=null:d instanceof B&&this.wb.Ti(d)&&
(this.wb=null));y.prototype.Zm.call(this,a,b,c,d,e,g,h)};z.prototype.Uj=function(a,b,c,d){this.Pk=this.wb;B.prototype.Uj.call(this,a,b,c,d)};z.prototype.ml=function(){if(!y.prototype.ml.call(this))return!1;for(var a=this.Ic;a.next();){var b=a.value;if(b instanceof y){if(b.zb()&&Bi(b))return!1}else if(b instanceof A&&b.zb()&&Bi(b)&&b.da!==this&&b.ja!==this)return!1}return!0};t.A(z,{placeholder:"placeholder"},function(){return this.wb});t.g(z,"computesBoundsAfterDrag",z.prototype.Kz);
t.defineProperty(z,{Kz:"computesBoundsAfterDrag"},function(){return this.hq},function(a){var b=this.hq;b!==a&&(t.j(a,"boolean",z,"computesBoundsAfterDrag"),this.hq=a,this.i("computesBoundsAfterDrag",b,a))});t.g(z,"computesBoundsIncludingLinks",z.prototype.uD);t.defineProperty(z,{uD:"computesBoundsIncludingLinks"},function(){return this.iq},function(a){t.j(a,"boolean",z,"computesBoundsIncludingLinks");var b=this.iq;b!==a&&(this.iq=a,this.i("computesBoundsIncludingLinks",b,a))});
t.g(z,"computesBoundsIncludingLocation",z.prototype.vD);t.defineProperty(z,{vD:"computesBoundsIncludingLocation"},function(){return this.jq},function(a){t.j(a,"boolean",z,"computesBoundsIncludingLocation");var b=this.jq;b!==a&&(this.jq=a,this.i("computesBoundsIncludingLocation",b,a))});t.A(z,{Ic:"memberParts"},function(){return this.jr.k});
function im(a,b){if(a.jr.add(b)){b instanceof z&&a.bm.add(b);var c=a.PE;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Wa,e.Wa=!0);c(a,b);null!==e&&(e.Wa=d)}}c=a.wb;null===c&&(c=a);c.aa()}function hm(a,b){if(a.jr.remove(b)){b instanceof z&&a.bm.remove(b);var c=a.QE;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Wa,e.Wa=!0);c(a,b);null!==e&&(e.Wa=d)}}c=a.wb;null===c&&(c=a);c.aa()}z.prototype.Im=function(){if(0<this.jr.count){var a=this.h;if(null===a)return;for(var b=this.jr.copy().k;b.next();)a.remove(b.value)}y.prototype.Im.call(this)};
z.prototype.Pw=function(){var a=this.layer;null!==a&&a.Pw(this)};t.g(z,"layout",z.prototype.Tb);t.defineProperty(z,{Tb:"layout"},function(){return this.Ld},function(a){var b=this.Ld;b!==a&&(null!==a&&t.m(a,ue,z,"layout"),null!==b&&(b.h=null,b.group=null),this.Ld=a,null!==a&&(a.h=this.h,a.group=this),this.i("layout",b,a))});t.g(z,"memberAdded",z.prototype.PE);
t.defineProperty(z,{PE:"memberAdded"},function(){return this.ir},function(a){var b=this.ir;b!==a&&(null!==a&&t.j(a,"function",z,"memberAdded"),this.ir=a,this.i("memberAdded",b,a))});t.g(z,"memberRemoved",z.prototype.QE);t.defineProperty(z,{QE:"memberRemoved"},function(){return this.kr},function(a){var b=this.kr;b!==a&&(null!==a&&t.j(a,"function",z,"memberRemoved"),this.kr=a,this.i("memberRemoved",b,a))});t.g(z,"memberValidation",z.prototype.at);
t.defineProperty(z,{at:"memberValidation"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(null!==a&&t.j(a,"function",z,"memberValidation"),this.Qk=a,this.i("memberValidation",b,a))});z.prototype.canAddMembers=function(a){var b=this.h;if(null===b)return!1;b=b.lg;for(a=$e(a).k;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};
z.prototype.addMembers=function(a,b){var c=this.h;if(null===c)return!1;for(var c=c.lg,d=!0,e=$e(a).k;e.next();){var g=e.value;!b||c.isValidMember(this,g)?g.fb=this:d=!1}return d};t.g(z,"ungroupable",z.prototype.XF);t.defineProperty(z,{XF:"ungroupable"},function(){return this.ls},function(a){var b=this.ls;b!==a&&(t.j(a,"boolean",z,"ungroupable"),this.ls=a,this.i("ungroupable",b,a))});
z.prototype.canUngroup=function(){if(!this.XF)return!1;var a=this.layer;if(null!==a&&!a.Co)return!1;a=a.h;return null===a||a.Co?!0:!1};z.prototype.findExternalLinksConnected=function(){var a=this.Po();a.add(this);for(var b=new ua(A),c=a.k;c.next();){var d=c.value;if(d instanceof y)for(d=d.Dd;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.k};
z.prototype.findExternalNodesConnected=function(){var a=this.Po();a.add(this);for(var b=new ua(y),c=a.k;c.next();){var d=c.value;if(d instanceof y)for(d=d.Dd;d.next();){var e=d.value,g=e.da;a.contains(g)&&g!==this||b.add(g);e=e.ja;a.contains(e)&&e!==this||b.add(e)}}return b.k};z.prototype.findSubGraphParts=z.prototype.Po=function(){var a=new ua(w);Ue(a,this,!0,0);a.remove(this);return a};
z.prototype.collapseSubGraph=z.prototype.collapseSubGraph=function(){var a=this.h;if(null!==a&&!a.Sd){a.Sd=!0;var b=this.Po();ln(this,b);a.Sd=!1}};function ln(a,b){a.Ve=!1;for(var c=a.Ic;c.next();){var d=c.value;d.aa();d.K(Nh);d.Ae();d instanceof z&&(d.Vw=d.Ve,ln(d,b));if(d instanceof y)d.Vg(b);else if(d instanceof A)for(d=d.Ui;d.next();)d.value.Vg(b)}}z.prototype.expandSubGraph=z.prototype.expandSubGraph=function(){var a=this.h;if(null!==a&&!a.Sd){a.Sd=!0;var b=this.Po();mn(this,b);a.Sd=!1}};
function mn(a,b){a.Ve=!0;for(var c=a.Ic;c.next();){var d=c.value;d.aa();d.K(Mh);d.updateAdornments();d instanceof z&&d.Vw&&mn(d,b);if(d instanceof y)d.Vg(b);else if(d instanceof A)for(d=d.Ui;d.next();)d.value.Vg(b)}}t.g(z,"isSubGraphExpanded",z.prototype.Ve);
t.defineProperty(z,{Ve:"isSubGraphExpanded"},function(){return this.Pq},function(a){var b=this.Pq;if(b!==a){t.j(a,"boolean",z,"isSubGraphExpanded");this.Pq=a;var c=this.h;this.i("isSubGraphExpanded",b,a);b=this.JF;if(null!==b){var d=!0;null!==c&&(d=c.Wa,c.Wa=!0);b(this);null!==c&&(c.Wa=d)}null!==c&&c.Aa.qb||(a?this.expandSubGraph():this.collapseSubGraph())}});t.g(z,"wasSubGraphExpanded",z.prototype.Vw);
t.defineProperty(z,{Vw:"wasSubGraphExpanded"},function(){return this.ms},function(a){var b=this.ms;b!==a&&(t.j(a,"boolean",z,"wasSubGraphExpanded"),this.ms=a,this.i("wasSubGraphExpanded",b,a))});t.g(z,"subGraphExpandedChanged",z.prototype.JF);t.defineProperty(z,{JF:"subGraphExpandedChanged"},function(){return this.bs},function(a){var b=this.bs;b!==a&&(null!==a&&t.j(a,"function",z,"subGraphExpandedChanged"),this.bs=a,this.i("subGraphExpandedChanged",b,a))});
z.prototype.move=z.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);var c=a.x-c,b=a.y-b,d=t.ic(c,b);y.prototype.move.call(this,a);for(a=this.Po().k;a.next();){var e=a.value;if(!(e instanceof A||e.Ih)){var g=e.position;d.x=g.x+c;d.y=g.y+b;y.prototype.move.call(e,d)}}for(a.reset();a.next();)e=a.value,e instanceof A&&(g=e.position,d.x=g.x+c,d.y=g.y+b,e.move(d));t.B(d)};function Vg(){X.call(this);this.Le=J.Tp;this.Lr=new D(NaN,NaN,NaN,NaN)}
t.ia("Placeholder",Vg);t.Oa(Vg,X);Vg.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Le=this.Le.Z();a.Lr=this.Lr.copy()};Vg.prototype.Vj=function(a){if(null===this.background&&null===this.Ci)return!1;var b=this.Ia;return Eb(0,0,b.width,b.height,a.x,a.y)};
Vg.prototype.$s=function(){var a=this.U;null!==a&&(a instanceof z||a instanceof Ve)||t.l("Placeholder is not inside a Group or Adornment.");if(a instanceof z){var b=this.computeBorder(this.Lr),c=this.Mc;qb(c,b.width||0,b.height||0);Pj(this,0,0,c.width,c.height);for(var c=a.Ic,d=!1;c.next();)if(c.value.zb()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new C,c.wt(b,a.We),a.location=new C(c.x,c.y))}else{var b=this.Ca,c=this.Mc,a=this.padding,d=a.left+a.right,e=a.top+a.bottom;if(b.Q())qb(c,b.width+d||0,
b.height+e||0),Pj(this,-a.left,-a.top,c.width,c.height);else{var g=this.U,h=g.Pc,k=h.gb(Sb,t.O()),b=t.lk(k.x,k.y,0,0);b.aj(h.gb($b,k));b.aj(h.gb(Ub,k));b.aj(h.gb(Wb,k));g.ki.q(b.x,b.y);qb(c,b.width+d||0,b.height+e||0);Pj(this,-a.left,-a.top,c.width,c.height);t.B(k);t.Rc(b)}}};Vg.prototype.Uj=function(a,b,c,d){var e=this.ya;e.x=a;e.y=b;e.width=c;e.height=d};
Vg.prototype.computeBorder=function(a){var b=this.U;if(b instanceof z&&b.Kz&&this.Lr.Q()){var c=b.h;if(null!==c&&(c=c.Za,c instanceof ff&&!c.vq&&null!==c.wc&&!c.wc.contains(b)))return a.assign(this.Lr),a}var c=t.wf(),d=this.computeMemberBounds(c),e=this.padding;a.q(d.x-e.left,d.y-e.top,d.width+e.left+e.right,d.height+e.top+e.bottom);t.Rc(c);b instanceof z&&b.vD&&b.location.Q()&&a.aj(b.location);return a};
Vg.prototype.computeMemberBounds=function(a){var b=this.U;if(!(b instanceof z))return a.q(0,0,0,0),a;for(var c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=b.Ic;h.next();){var k=h.value;if(k.zb()){if(k instanceof A){if(!b.uD)continue;if(Ai(k))continue;if(k.da===b||k.ja===b)continue}k=k.ya;k.left<c&&(c=k.left);k.top<d&&(d=k.top);k.right>e&&(e=k.right);k.bottom>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.q(c,d,e-c,g-d):(b=b.location,c=this.padding,a.q(b.x+c.left,b.y+c.top,0,0));return a};
t.g(Vg,"padding",Vg.prototype.padding);t.defineProperty(Vg,{padding:"padding"},function(){return this.Le},function(a){"number"===typeof a?(0>a&&t.ha(a,">= 0",Vg,"padding"),a=new sb(a)):(t.m(a,sb,Vg,"padding"),0>a.left&&t.ha(a.left,">= 0",Vg,"padding:val.left"),0>a.right&&t.ha(a.right,">= 0",Vg,"padding:val.right"),0>a.top&&t.ha(a.top,">= 0",Vg,"padding:val.top"),0>a.bottom&&t.ha(a.bottom,">= 0",Vg,"padding:val.bottom"));var b=this.Le;b.N(a)||(this.Le=a=a.Z(),this.i("padding",b,a))});
function ue(){0<arguments.length&&t.l("Layout constructor cannot take any arguments.");t.zc(this);this.ny=this.ea=null;this.Kq=this.Mq=!0;this.Tq=this.Rn=!1;this.aq=(new C(0,0)).freeze();this.xy=!0;this.Ky=null;this.Nq=!0}t.ia("Layout",ue);ue.prototype.cloneProtected=function(a){a.Mq=this.Mq;a.Kq=this.Kq;this.Kq||(a.Rn=!0);a.Tq=this.Tq;a.aq.assign(this.aq);a.Nq=this.Nq};ue.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};
ue.prototype.toString=function(){var a=t.Tg(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.h&&(a+=" for "+this.h);return a+")"};t.g(ue,"diagram",ue.prototype.h);t.defineProperty(ue,{h:"diagram"},function(){return this.ea},function(a){this.ea!==a&&(null!==a&&t.m(a,u,ue,"diagram"),this.ea=a)});t.g(ue,"group",ue.prototype.group);t.defineProperty(ue,{group:"group"},function(){return this.ny},function(a){this.ny!==a&&(null!==a&&t.m(a,z,ue,"group"),this.ny=a)});
t.g(ue,"isOngoing",ue.prototype.BE);t.defineProperty(ue,{BE:"isOngoing"},function(){return this.Mq},function(a){this.Mq!==a&&(t.j(a,"boolean",ue,"isOngoing"),this.Mq=a)});t.g(ue,"isInitial",ue.prototype.zE);t.defineProperty(ue,{zE:"isInitial"},function(){return this.Kq},function(a){t.j(a,"boolean",ue,"isInitial");this.Kq=a;a||(this.Rn=!0)});t.g(ue,"isValidLayout",ue.prototype.of);
t.defineProperty(ue,{of:"isValidLayout"},function(){return this.Rn},function(a){this.Rn!==a&&(t.j(a,"boolean",ue,"isValidLayout"),this.Rn=a,a||(a=this.h,null!==a&&(a.Tt=!0)))});ue.prototype.invalidateLayout=ue.prototype.K=function(){if(this.Rn){var a=this.h;null!==a&&!a.Aa.qb&&(this.BE&&a.Xf||this.zE&&!a.Xf)&&(this.of=!1,a.Nf(!0))}};t.g(ue,"isRealtime",ue.prototype.nA);
t.defineProperty(ue,{nA:"isRealtime"},function(){return this.Nq},function(a){this.Nq!==a&&(t.j(a,"boolean",ue,"isRealtime"),this.Nq=a)});t.g(ue,"isViewportSized",ue.prototype.Ws);t.defineProperty(ue,{Ws:"isViewportSized"},function(){return this.Tq},function(a){this.Tq!==a&&(t.j(a,"boolean",ue,"isViewportSized"),(this.Tq=a)&&this.K())});t.g(ue,"isRouting",ue.prototype.Vs);
t.defineProperty(ue,{Vs:"isRouting"},function(){return this.xy},function(a){this.xy!==a&&(t.j(a,"boolean",ue,"isRouting"),this.xy=a)});t.g(ue,"network",ue.prototype.network);t.defineProperty(ue,{network:"network"},function(){return this.Ky},function(a){var b=this.Ky;b!==a&&(null!==a&&t.m(a,Ba,ue,"network"),null!==b&&nn(b,null),this.Ky=a,null!==a&&nn(a,this))});ue.prototype.createNetwork=function(){var a=new Ba;nn(a,this);return a};
ue.prototype.makeNetwork=function(a){var b=this.createNetwork();a instanceof u?(b.rs(a.Zi,!0),b.rs(a.links,!0)):a instanceof z?b.rs(a.Ic):b.rs(a.k);return b};ue.prototype.updateParts=function(){var a=this.h;if(null===a&&null!==this.network)for(var b=this.network.vertexes.k;b.next();){var c=b.value.Jc;if(null!==c&&(a=c.h,null!==a))break}this.of=!0;null!==a&&a.rc("Layout");this.commitLayout();null!==a&&a.De("Layout")};ue.prototype.commitLayout=function(){};
ue.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new ua(w);a===this.h?(on(this,b,a.Zi,!0,this.zA,!0,!1,!0),on(this,b,a.rl,!0,this.zA,!0,!1,!0)):a===this.group?on(this,b,a.Ic,!1,this.zA,!0,!1,!0):b.Me(a.k);var c=b.count;if(0<c){a=this.h;null!==a&&a.rc("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.zd.x,e=d,g=this.zd.y,h=0,k=0,b=b.k;b.next();){var l=b.value;l.Gf();var m=l.Ea,n=m.width,m=m.height;
l.moveTo(e,g);delete l.zC;e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.De("Layout")}this.of=!0};ue.prototype.zA=function(a){return!a.location.Q()||a instanceof z&&a.zC?!0:!1};function on(a,b,c,d,e,g,h,k){for(c=c.k;c.next();){var l=c.value;d&&!l.dp||e&&!e(l)||l.canLayout()&&(g&&l instanceof y?l.Ih||(l instanceof z&&null===l.Tb?on(a,b,l.Ic,!1,e,g,h,k):b.add(l)):h&&l instanceof A?b.add(l):!k||!l.Ud()||l instanceof y||b.add(l))}}
t.g(ue,"arrangementOrigin",ue.prototype.zd);t.defineProperty(ue,{zd:"arrangementOrigin"},function(){return this.aq},function(a){this.aq.N(a)||(t.m(a,C,ue,"arrangementOrigin"),this.aq.assign(a),this.K())});ue.prototype.initialOrigin=ue.prototype.iA=function(a){var b=this.group;if(null!==b){var c=b.location;if(isNaN(c.x)||isNaN(c.y))return a;a=b.placeholder;null!==a?(c=a.gb(Sb),c.x+=a.padding.left,c.y+=a.padding.top):c=b.position.copy();return c}return a};
function Ba(){t.zc(this);this.Ld=null;this.clear()}t.ia("LayoutNetwork",Ba);Ba.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.k;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.k;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new ua(Da);this.edges=new ua(Ea);this.CA=new sa(y,Da);this.pA=new sa(A,Ea)};Ba.prototype.toString=function(){return"LayoutNetwork"+(null!==this.Tb?"("+this.Tb.toString()+")":"")};t.A(Ba,{Tb:"layout"},function(){return this.Ld});
function nn(a,b){f&&null!==b&&t.m(b,ue,Ba,"setLayout");a.Ld=b}Ba.prototype.createVertex=function(){return new Da};Ba.prototype.createEdge=function(){return new Ea};
Ba.prototype.addParts=Ba.prototype.rs=function(a,b){if(null!==a){void 0===b&&(b=!1);t.j(b,"boolean",Ba,"addParts:toplevelonly");for(var c=a.k;c.next();){var d=c.value;if(d instanceof y&&(!b||d.dp)&&d.canLayout()&&!d.Ih)if(d instanceof z&&null===d.Tb)this.rs(d.Ic,!1);else if(null===this.Mm(d)){var e=this.createVertex();e.Jc=d;this.Zk(e)}}for(c.reset();c.next();)if(d=c.value,d instanceof A&&(!b||d.dp)&&d.canLayout()&&null===this.dw(d)){var g=d.da,e=d.ja;g!==e&&(g=this.ew(g),e=this.ew(e),null!==g&&null!==
e&&this.Um(g,e,d))}}};Ba.prototype.findGroupVertex=Ba.prototype.ew=function(a){if(null===a)return null;a=em(a);if(null===a)return null;var b=this.Mm(a);if(null!==b)return b;a=a.fb;return null!==a&&(b=this.Mm(a),null!==b)?b:null};Ba.prototype.addVertex=Ba.prototype.Zk=function(a){if(null!==a){f&&t.m(a,Da,Ba,"addVertex:vertex");this.vertexes.add(a);var b=a.Jc;null!==b&&this.CA.add(b,a);a.network=this}};
Ba.prototype.addNode=Ba.prototype.vo=function(a){if(null===a)return null;f&&t.m(a,y,Ba,"addNode:node");var b=this.Mm(a);null===b&&(b=this.createVertex(),b.Jc=a,this.Zk(b));return b};Ba.prototype.deleteVertex=Ba.prototype.LD=function(a){if(null!==a&&(f&&t.m(a,Da,Ba,"deleteVertex:vertex"),pn(this,a))){for(var b=a.$e,c=b.count-1;0<=c;c--){var d=b.qa(c);this.Jo(d)}b=a.Qe;for(c=b.count-1;0<=c;c--)d=b.qa(c),this.Jo(d)}};
function pn(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.CA.remove(b.Jc),b.network=null);return c}Ba.prototype.deleteNode=function(a){null!==a&&(f&&t.m(a,y,Ba,"deleteNode:node"),a=this.Mm(a),null!==a&&this.LD(a))};Ba.prototype.findVertex=Ba.prototype.Mm=function(a){if(null===a)return null;f&&t.m(a,y,Ba,"findVertex:node");return this.CA.Ba(a)};
Ba.prototype.addEdge=Ba.prototype.uo=function(a){if(null!==a){f&&t.m(a,Ea,Ba,"addEdge:edge");this.edges.add(a);var b=a.link;null!==b&&null===this.dw(b)&&this.pA.add(b,a);b=a.toVertex;null!==b&&b.dD(a);b=a.fromVertex;null!==b&&b.bD(a);a.network=this}};
Ba.prototype.addLink=function(a){if(null===a)return null;f&&t.m(a,A,Ba,"addLink:link");var b=a.da,c=a.ja,d=this.dw(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.vo(b)),null!==c&&(d.toVertex=this.vo(c)),this.uo(d)):(d.fromVertex=null!==b?this.vo(b):null,d.toVertex=null!==c?this.vo(c):null);return d};Ba.prototype.deleteEdge=Ba.prototype.Jo=function(a){if(null!==a){f&&t.m(a,Ea,Ba,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.KD(a);b=a.fromVertex;null!==b&&b.JD(a);qn(this,a)}};
function qn(a,b){null!==b&&a.edges.remove(b)&&(a.pA.remove(b.link),b.network=null)}Ba.prototype.deleteLink=function(a){null!==a&&(f&&t.m(a,A,Ba,"deleteLink:link"),a=this.dw(a),null!==a&&this.Jo(a))};Ba.prototype.findEdge=Ba.prototype.dw=function(a){if(null===a)return null;f&&t.m(a,A,Ba,"findEdge:link");return this.pA.Ba(a)};
Ba.prototype.linkVertexes=Ba.prototype.Um=function(a,b,c){if(null===a||null===b)return null;f&&(t.m(a,Da,Ba,"linkVertexes:fromVertex"),t.m(b,Da,Ba,"linkVertexes:toVertex"),null!==c&&t.m(c,A,Ba,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.uo(d);return d}return null};
Ba.prototype.reverseEdge=Ba.prototype.Jw=function(a){if(null!==a){f&&t.m(a,Ea,Ba,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.JD(a),c.KD(a),a.Jw(),b.dD(a),c.bD(a))}};Ba.prototype.deleteSelfEdges=Ba.prototype.$v=function(){for(var a=t.Cb(),b=this.edges.k;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.Jo(a[c]);t.Da(a)};
Ba.prototype.deleteArtificialVertexes=function(){for(var a=t.Cb(),b=this.vertexes.k;b.next();){var c=b.value;null===c.Jc&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.LD(a[b]);c=t.Cb();for(b=this.edges.k;b.next();){var d=b.value;null===d.link&&c.push(d)}d=c.length;for(b=0;b<d;b++)this.Jo(c[b]);t.Da(a);t.Da(c)};function rn(a){for(var b=t.Cb(),c=a.edges.k;c.next();){var d=c.value;null!==d.fromVertex&&null!==d.toVertex||b.push(d)}c=b.length;for(d=0;d<c;d++)a.Jo(b[d]);t.Da(b)}
Ba.prototype.splitIntoSubNetworks=Ba.prototype.dJ=function(){this.deleteArtificialVertexes();rn(this);this.$v();for(var a=new H(Ba),b=!0;b;)for(var b=!1,c=this.vertexes.k;c.next();){var d=c.value;if(0<d.$e.count||0<d.Qe.count){b=this.Tb.createNetwork();a.add(b);sn(this,b,d);b=!0;break}}a.sort(function(a,b){return null===a||null===b||a===b?0:b.vertexes.count-a.vertexes.count});return a};
function sn(a,b,c){if(null!==c&&c.network!==b){pn(a,c);b.Zk(c);for(var d=c.hc;d.next();){var e=d.value;e.network!==b&&(qn(a,e),b.uo(e),sn(a,b,e.fromVertex))}for(d=c.Zb;d.next();)e=d.value,e.network!==b&&(qn(a,e),b.uo(e),sn(a,b,e.toVertex))}}Ba.prototype.findAllParts=function(){for(var a=new ua(w),b=this.vertexes.k;b.next();)a.add(b.value.Jc);for(b=this.edges.k;b.next();)a.add(b.value.link);return a};
function Da(){t.zc(this);this.network=null;this.S=(new D(0,0,10,10)).freeze();this.P=(new C(5,5)).freeze();this.clear()}t.ia("LayoutVertex",Da);Da.prototype.clear=function(){this.nd=null;this.$e=new H(Ea);this.Qe=new H(Ea)};Da.prototype.toString=function(){return"LayoutVertex#"+t.oc(this)+(null!==this.Jc?"("+this.Jc.toString()+")":"")};t.g(Da,"node",Da.prototype.Jc);
t.defineProperty(Da,{Jc:"node"},function(){return this.nd},function(a){if(this.nd!==a){f&&null!==a&&t.m(a,y,Da,"node");this.nd=a;a.Gf();var b=a.ya,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.S.q(c,d,e,b);c=a.Ub;c===a||a instanceof z?this.P.q(e/2,b/2):(a=c.ya,this.P.q(a.x+a.width/2,a.y+a.height/2))}});t.g(Da,"bounds",Da.prototype.Mb);t.defineProperty(Da,{Mb:"bounds"},function(){return this.S},function(a){this.S.N(a)||(f&&t.m(a,D,Da,"bounds"),this.S.assign(a))});
t.g(Da,"focus",Da.prototype.focus);t.defineProperty(Da,{focus:"focus"},function(){return this.P},function(a){this.P.N(a)||(f&&t.m(a,C,Da,"focus"),this.P.assign(a))});t.g(Da,"centerX",Da.prototype.Fa);t.defineProperty(Da,{Fa:"centerX"},function(){return this.S.x+this.P.x},function(a){var b=this.S;b.x+this.P.x!==a&&(f&&t.o(a,Da,"centerX"),b.Ua(),b.x=a-this.P.x,b.freeze())});t.g(Da,"centerY",Da.prototype.Sa);
t.defineProperty(Da,{Sa:"centerY"},function(){return this.S.y+this.P.y},function(a){var b=this.S;b.y+this.P.y!==a&&(f&&t.o(a,Da,"centerY"),b.Ua(),b.y=a-this.P.y,b.freeze())});t.g(Da,"focusX",Da.prototype.WH);t.defineProperty(Da,{WH:"focusX"},function(){return this.P.x},function(a){var b=this.P;b.x!==a&&(b.Ua(),b.x=a,b.freeze())});t.g(Da,"focusY",Da.prototype.XH);t.defineProperty(Da,{XH:"focusY"},function(){return this.P.y},function(a){var b=this.P;b.y!==a&&(b.Ua(),b.y=a,b.freeze())});t.g(Da,"x",Da.prototype.x);
t.defineProperty(Da,{x:"x"},function(){return this.S.x},function(a){var b=this.S;b.x!==a&&(b.Ua(),b.x=a,b.freeze())});t.g(Da,"y",Da.prototype.y);t.defineProperty(Da,{y:"y"},function(){return this.S.y},function(a){var b=this.S;b.y!==a&&(b.Ua(),b.y=a,b.freeze())});t.g(Da,"width",Da.prototype.width);t.defineProperty(Da,{width:"width"},function(){return this.S.width},function(a){var b=this.S;b.width!==a&&(b.Ua(),b.width=a,b.freeze())});t.g(Da,"height",Da.prototype.height);
t.defineProperty(Da,{height:"height"},function(){return this.S.height},function(a){var b=this.S;b.height!==a&&(b.Ua(),b.height=a,b.freeze())});Da.prototype.commit=function(){var a=this.Jc;if(null!==a){var b=this.Mb;a.moveTo(b.x,b.y)}};Da.prototype.addSourceEdge=Da.prototype.dD=function(a){null!==a&&(f&&t.m(a,Ea,Da,"addSourceEdge:edge"),this.$e.contains(a)||this.$e.add(a))};Da.prototype.deleteSourceEdge=Da.prototype.KD=function(a){null!==a&&(f&&t.m(a,Ea,Da,"deleteSourceEdge:edge"),this.$e.remove(a))};
Da.prototype.addDestinationEdge=Da.prototype.bD=function(a){null!==a&&(f&&t.m(a,Ea,Da,"addDestinationEdge:edge"),this.Qe.contains(a)||this.Qe.add(a))};Da.prototype.deleteDestinationEdge=Da.prototype.JD=function(a){null!==a&&(f&&t.m(a,Ea,Da,"deleteDestinationEdge:edge"),this.Qe.remove(a))};t.A(Da,{cJ:"sourceVertexes"},function(){for(var a=new ua(Da),b=this.hc;b.next();){var c=b.value.fromVertex;null===c||a.contains(c)||a.add(c)}return a.k});
t.A(Da,{FH:"destinationVertexes"},function(){for(var a=new ua(Da),b=this.Zb;b.next();){var c=b.value.toVertex;null===c||a.contains(c)||a.add(c)}return a.k});t.A(Da,{vertexes:"vertexes"},function(){for(var a=new ua(Da),b=this.hc;b.next();){var c=b.value,c=c.fromVertex;null===c||a.contains(c)||a.add(c)}for(b=this.Zb;b.next();)c=b.value,c=c.toVertex,null===c||a.contains(c)||a.add(c);return a.k});t.A(Da,{hc:"sourceEdges"},function(){return this.$e.k});t.A(Da,{Zb:"destinationEdges"},function(){return this.Qe.k});
t.A(Da,{edges:"edges"},function(){for(var a=new H(Ea),b=this.hc;b.next();){var c=b.value;a.add(c)}for(b=this.Zb;b.next();)c=b.value,a.add(c);return a.k});t.A(Da,{TH:"edgesCount"},function(){return this.$e.count+this.Qe.count});var tn;Da.standardComparer=tn=function(a,b){f&&t.m(a,Da,Da,"standardComparer:m");f&&t.m(b,Da,Da,"standardComparer:n");var c=a.nd,d=b.nd;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
Da.smartComparer=function(a,b){f&&t.m(a,Da,Da,"smartComparer:m");f&&t.m(b,Da,Da,"smartComparer:n");if(null!==a){if(null!==b){var c=a.nd,d=b.nd;if(null!==c){if(null!==d){var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e;for(e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;
if(0!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==d?-1:0}return 1}return null!==b?-1:0};function Ea(){t.zc(this);this.network=null;this.clear()}t.ia("LayoutEdge",Ea);Ea.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=null};Ea.prototype.toString=function(){return"LayoutEdge#"+t.oc(this)+(null!==this.link?"("+this.link.toString()+")":"")};
Ea.prototype.Jw=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};Ea.prototype.commit=function(){};Ea.prototype.getOtherVertex=Ea.prototype.$H=function(a){f&&t.m(a,Da,Ea,"getOtherVertex:v");return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};
function Fj(){0<arguments.length&&t.l("GridLayout constructor cannot take any arguments.");ue.call(this);this.Ws=!0;this.os=this.ps=NaN;this.fj=(new pa(NaN,NaN)).freeze();this.yh=(new pa(10,10)).freeze();this.re=Qk;this.jd=Ok;this.xh=Kk;this.ih=un}t.ia("GridLayout",Fj);t.Oa(Fj,ue);Fj.prototype.cloneProtected=function(a){ue.prototype.cloneProtected.call(this,a);a.ps=this.ps;a.os=this.os;a.fj.assign(this.fj);a.yh.assign(this.yh);a.re=this.re;a.jd=this.jd;a.xh=this.xh;a.ih=this.ih};
Fj.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=this.h;null===b&&t.l("The diagram for this layout is not set.");this.zd=this.iA(this.zd);var c=new ua(w);a===this.h?(on(this,c,a.Zi,!0,null,!0,!0,!0),on(this,c,a.links,!0,null,!0,!0,!0),on(this,c,a.rl,!0,null,!0,!0,!0)):a===this.group?on(this,c,a.Ic,!1,null,!0,!0,!0):c.Me(a.k);for(a=c.copy().k;a.next();){var d=a.value;if(d instanceof A&&(null!==d.da||
null!==d.ja))c.remove(d);else if(d.Gf(),d instanceof z)for(d=d.Ic;d.next();)c.remove(d.value)}c=c.af();if(0!==c.length){switch(this.sorting){case Nk:c.reverse();break;case Kk:c.sort(this.comparer);break;case Lk:c.sort(this.comparer),c.reverse()}d=this.jG;isNaN(d)&&(d=0);a=this.rB;a=isNaN(a)?Math.max(this.h.nb.width-b.padding.left-b.padding.right,0):Math.max(this.rB,0);0>=d&&0>=a&&(d=1);var e=this.spacing.width;isFinite(e)||(e=0);var g=this.spacing.height;isFinite(g)||(g=0);b.rc("Layout");switch(this.alignment){case Rk:var h=
Math.max(this.bl.width,1);if(!isFinite(h))for(var k=h=0;k<c.length;k++)var l=c[k],m=l.Ea,h=Math.max(h,m.width);var h=Math.max(h+e,1),n=Math.max(this.bl.height,1);if(!isFinite(n))for(k=n=0;k<c.length;k++)l=c[k],m=l.Ea,n=Math.max(n,m.height);for(var n=Math.max(n+g,1),p=this.Oe,q=this.zd.x,r=q,s=this.zd.y,v=0,x=0,k=0;k<c.length;k++){var l=c[k],m=l.Ea,E=Math.ceil((m.width+e)/h)*h,F=Math.ceil((m.height+g)/n)*n,G;switch(p){case Pk:G=Math.abs(r-m.width)+q;break;default:G=r+m.width-q}if(0<d&&v>d-1||0<a&&
0<v&&G>a)v=0,r=q,s+=x,x=0;x=Math.max(x,F);switch(p){case Pk:m=-m.width;break;default:m=0}l.moveTo(r+m,s);switch(p){case Pk:r-=E;break;default:r+=E}v++}break;case Qk:h=Math.max(this.bl.width,1);k=x=v=0;l=t.O();for(n=0;n<c.length;n++)p=c[n],q=p.Ea,r=fm(p,p.Ub,p.We,l),v=Math.max(v,r.x),x=Math.max(x,q.width-r.x),k=Math.max(k,r.y);s=this.Oe;switch(s){case Pk:v+=e;break;default:x+=e}var h=isFinite(h)?Math.max(h+e,1):Math.max(v+x,1),L=v=this.zd.x,x=this.zd.y,m=E=0,F=Math.max(this.bl.height,1);G=k=0;for(var N=
!0,V=t.O(),n=0;n<c.length;n++){p=c[n];q=p.Ea;r=fm(p,p.Ub,p.We,l);if(0<E)switch(s){case Pk:L=Math.floor((L-v-(q.width-r.x))/h)*h+v;break;default:L=Math.ceil((L-v+r.x)/h)*h+v}else switch(s){case Pk:m=L+r.x+q.width;break;default:m=L-r.x}var T;switch(s){case Pk:T=-(L+r.x)+v+m;break;default:T=L+q.width-r.x-v-m}if(0<d&&E>d-1||0<a&&0<E&&T>a){for(L=0;L<E&&n!==E;L++){T=c[n-E+L];var W=fm(T,T.Ub,T.We,V);T.moveTo(T.position.x,T.position.y+k-W.y)}G+=g;x=N?x+G:x+(G+k);E=G=k=0;L=v;N=!1}k=Math.max(k,r.y);G=Math.max(G,
q.height-r.y);isFinite(F)&&(G=Math.max(G,Math.max(q.height,F)-r.y));N?p.moveTo(L-r.x,x-r.y):p.moveTo(L-r.x,x);switch(s){case Pk:L-=r.x+e;break;default:L+=q.width-r.x+e}E++}for(L=0;L<E&&n!==E;L++)T=c[n-E+L],W=fm(T,T.Ub,T.We,l),T.moveTo(T.position.x,T.position.y+k-W.y);t.B(l);t.B(V)}b.De("Layout");this.of=!0}};t.g(Fj,"wrappingWidth",Fj.prototype.rB);t.defineProperty(Fj,{rB:"wrappingWidth"},function(){return this.ps},function(a){this.ps!==a&&(0<a||isNaN(a))&&(this.ps=a,this.Ws=isNaN(a),this.K())});
t.g(Fj,"wrappingColumn",Fj.prototype.jG);t.defineProperty(Fj,{jG:"wrappingColumn"},function(){return this.os},function(a){this.os!==a&&(0<a||isNaN(a))&&(this.os=a,this.K())});t.g(Fj,"cellSize",Fj.prototype.bl);t.defineProperty(Fj,{bl:"cellSize"},function(){return this.fj},function(a){this.fj.N(a)||(this.fj.assign(a),this.K())});t.g(Fj,"spacing",Fj.prototype.spacing);t.defineProperty(Fj,{spacing:"spacing"},function(){return this.yh},function(a){this.yh.N(a)||(this.yh.assign(a),this.K())});
t.g(Fj,"alignment",Fj.prototype.alignment);t.defineProperty(Fj,{alignment:"alignment"},function(){return this.re},function(a){this.re!==a&&(f&&t.m(a,oa,Fj,"alignment"),a===Qk||a===Rk)&&(this.re=a,this.K())});t.g(Fj,"arrangement",Fj.prototype.Oe);t.defineProperty(Fj,{Oe:"arrangement"},function(){return this.jd},function(a){this.jd!==a&&(f&&t.m(a,oa,Fj,"arrangement"),a===Ok||a===Pk)&&(this.jd=a,this.K())});t.g(Fj,"sorting",Fj.prototype.sorting);
t.defineProperty(Fj,{sorting:"sorting"},function(){return this.xh},function(a){this.xh!==a&&(f&&t.m(a,oa,Fj,"sorting"),a===Mk||a===Nk||a===Kk||a===Lk)&&(this.xh=a,this.K())});t.g(Fj,"comparer",Fj.prototype.comparer);t.defineProperty(Fj,{comparer:"comparer"},function(){return this.ih},function(a){this.ih!==a&&(f&&t.j(a,"function",Fj,"comparer"),this.ih=a,this.K())});var un;
Fj.standardComparer=un=function(a,b){f&&t.m(a,w,Fj,"standardComparer:a");f&&t.m(b,w,Fj,"standardComparer:b");var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
Fj.smartComparer=function(a,b){f&&t.m(a,w,Fj,"standardComparer:a");f&&t.m(b,w,Fj,"standardComparer:b");if(null!==a){if(null!==b){var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e;for(e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;
if(0!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var Rk;Fj.Position=Rk=t.w(Fj,"Position",0);var Qk;Fj.Location=Qk=t.w(Fj,"Location",1);var Ok;Fj.LeftToRight=Ok=t.w(Fj,"LeftToRight",2);var Pk;Fj.RightToLeft=Pk=t.w(Fj,"RightToLeft",3);var Mk;Fj.Forward=Mk=t.w(Fj,"Forward",4);var Nk;Fj.Reverse=Nk=t.w(Fj,"Reverse",5);var Kk;Fj.Ascending=Kk=t.w(Fj,"Ascending",6);var Lk;Fj.Descending=Lk=t.w(Fj,"Descending",7);
function Sk(){0<arguments.length&&t.l("CircularLayout constructor cannot take any arguments.");ue.call(this);this.ay=this.Fn=this.wd=0;this.wq=360;this.$x=dl;this.Ek=0;this.ZB=dl;this.bu=this.jg=this.UC=0;this.Av=new vn;this.eu=this.em=0;this.DG=600;this.Ar=NaN;this.cq=1;this.xe=0;this.ye=360;this.jd=dl;this.sa=$k;this.xh=Xk;this.ih=tn;this.yh=6;this.ur=gl}t.ia("CircularLayout",Sk);t.Oa(Sk,ue);
Sk.prototype.cloneProtected=function(a){ue.prototype.cloneProtected.call(this,a);a.Ar=this.Ar;a.cq=this.cq;a.xe=this.xe;a.ye=this.ye;a.jd=this.jd;a.sa=this.sa;a.xh=this.xh;a.ih=this.ih;a.yh=this.yh;a.ur=this.ur};Sk.prototype.createNetwork=function(){var a=new wn;nn(a,this);return a};
Sk.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.eb(),a.Fa=0,a.Sa=0);else{var b=new H(xn);b.Me(a.k);a=new H(xn);var c=new H(xn),b=this.sort(b);a=new H(xn);var c=new H(xn),d=this.$x,e=this.ZB,g=this.wd,h=this.Fn,k=this.ay,l=this.wq,m=this.Ek,n=this.UC,p=this.jg,q=this.bu,d=this.Oe,e=this.ht,g=
this.bF;if(!isFinite(g)||0>=g)g=NaN;h=this.iD;if(!isFinite(h)||0>=h)h=1;k=this.yg;isFinite(k)||(k=0);l=this.Sh;if(!isFinite(l)||360<l||1>l)l=360;m=this.spacing;isFinite(m)||(m=NaN);d===el&&e===fl?d=dl:d===el&&e!==fl&&(e=fl,d=this.Oe);if((this.direction===Yk||this.direction===Zk)&&this.sorting!==Xk){for(var r=0;!(r>=b.length);r+=2){a.add(b.qa(r));if(r+1>=b.length)break;c.add(b.qa(r+1))}this.direction===Yk?(this.Oe===el&&a.reverse(),b=new H(xn),b.Me(a),b.Me(c)):(this.Oe===el&&c.reverse(),b=new H(xn),
b.Me(c),b.Me(a))}for(var s=b.length,v=n=0,r=0;r<b.length;r++){var p=k+l*v*(this.direction===$k?1:-1)/s,x=b.qa(r).diameter;isNaN(x)&&(x=yn(b.qa(r),p));360>l&&(0===r||r===b.length-1)&&(x/=2);n+=x;v++}if(isNaN(g)||d===el){isNaN(m)&&(m=6);if(d!==dl&&d!==el){x=-Infinity;for(r=0;r<s;r++){var q=b.qa(r),E=b.qa(r===s-1?0:r+1);isNaN(q.diameter)&&yn(q,0);isNaN(E.diameter)&&yn(E,0);x=Math.max(x,(q.diameter+E.diameter)/2)}q=x+m;d===bl?(p=2*Math.PI/s,g=(x+m)/p):g=zn(this,q*(360<=l?s:s-1),h,k*Math.PI/180,l*Math.PI/
180)}else g=zn(this,n+(360<=l?s:s-1)*(d!==el?m:1.6*m),h,k*Math.PI/180,l*Math.PI/180);p=g*h}else if(p=g*h,v=An(this,g,p,k*Math.PI/180,l*Math.PI/180),isNaN(m)){if(d===dl||d===el)m=(v-n)/(360<=l?s:s-1)}else if(d===dl||d===el)r=(v-n)/(360<=l?s:s-1),r<m?(g=zn(this,n+m*(360<=l?s:s-1),h,k*Math.PI/180,l*Math.PI/180),p=g*h):m=r;else{x=-Infinity;for(r=0;r<s;r++)q=b.qa(r),E=b.qa(r===s-1?0:r+1),isNaN(q.diameter)&&yn(q,0),isNaN(E.diameter)&&yn(E,0),x=Math.max(x,(q.diameter+E.diameter)/2);q=x+m;r=zn(this,q*(360<=
l?s:s-1),h,k*Math.PI/180,l*Math.PI/180);r>g?(g=r,p=g*h):q=v/(360<=l?s:s-1)}this.$x=d;this.ZB=e;this.wd=g;this.Fn=h;this.ay=k;this.wq=l;this.Ek=m;this.UC=n;this.jg=p;this.bu=q;c=[b,a,c];b=c[0];a=c[1];c=c[2];d=this.$x;e=this.wd;h=this.ay;k=this.wq;l=this.Ek;m=this.jg;n=this.bu;if(this.direction!==Yk&&this.direction!==Zk||d!==el)if(this.direction===Yk||this.direction===Zk){g=0;switch(d){case cl:g=180*Bn(this,e,m,h,n)/Math.PI;break;case dl:n=b=0;g=a.eb();null!==g&&(b=yn(g,Math.PI/2));g=c.eb();null!==
g&&(n=yn(g,Math.PI/2));g=180*Bn(this,e,m,h,l+(b+n)/2)/Math.PI;break;case bl:g=k/b.length}if(this.direction===Yk){switch(d){case cl:Cn(this,a,h,al);break;case dl:Dn(this,a,h,al);break;case bl:En(this,a,k/2,h,al)}switch(d){case cl:Cn(this,c,h+g,$k);break;case dl:Dn(this,c,h+g,$k);break;case bl:En(this,c,k/2,h+g,$k)}}else{switch(d){case cl:Cn(this,c,h,al);break;case dl:Dn(this,c,h,al);break;case bl:En(this,c,k/2,h,al)}switch(d){case cl:Cn(this,a,h+g,$k);break;case dl:Dn(this,a,h+g,$k);break;case bl:En(this,
a,k/2,h+g,$k)}}}else switch(d){case cl:Cn(this,b,h,this.direction);break;case dl:Dn(this,b,h,this.direction);break;case bl:En(this,b,k,h,this.direction);break;case el:Fn(this,b,k,h,this.direction)}else Fn(this,b,k,h-k/2,$k)}this.updateParts();this.network=null;this.of=!0};
function En(a,b,c,d,e){var g=a.wq,h=a.wd;a=a.jg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===$k?l*c/(360<=g?k:k-1):-(l*c)/k),n=b.qa(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.Fa=p*Math.cos(m);n.Sa=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
function Dn(a,b,c,d){var e=a.wd,g=a.jg,h=a.Ek;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.qa(l),n=b.qa(l===k-1?0:l+1),p=g*Math.sin(c);m.Fa=e*Math.cos(c);m.Sa=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&yn(m,0);isNaN(n.diameter)&&yn(n,0);m=Bn(a,e,g,d===$k?c:-c,(m.diameter+n.diameter)/2+h);c+=d===$k?m:-m}}
function Cn(a,b,c,d){var e=a.wd,g=a.jg,h=a.bu;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.qa(l);m.Fa=e*Math.cos(c);m.Sa=g*Math.sin(c);m.actualAngle=180*c/Math.PI;m=Bn(a,e,g,d===$k?c:-c,h);c+=d===$k?m:-m}}function Fn(a,b,c,d,e){var g=a.eu,g=a.wq;a.em=0;a.Av=new vn;if(360>c){for(g=d+(e===$k?g:-g);0>g;)g+=360;g%=360;180<g&&(g-=360);g*=Math.PI/180;a.eu=g;Gn(a,b,c,d,e)}else Hn(a,b,c,d,e);a.Av.commit(b)}
function Hn(a,b,c,d,e){var g=a.wd,h=a.Ek,k=a.Fn,l=g*Math.cos(d*Math.PI/180),m=a.jg*Math.sin(d*Math.PI/180),n=b.af();if(3===n.length)n[0].Fa=g,n[0].Sa=0,n[1].Fa=n[0].Fa-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].Fa=(n[0].Fa+n[1].Fa)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].Fa=g,n[0].Sa=0,n[2].Fa=-n[0].Fa,n[2].Sa=n[0].Sa,n[1].Fa=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].Fa=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(g=0;g<n.length;g++){n[g].Fa=
l;n[g].Sa=m;if(g>=n.length-1)break;var p=In(a,l,m,n,g,e);p[0]||(p=Jn(a,l,m,n,g,e));l=p[1];m=p[2]}a.em++;if(!(23<a.em)){var l=n[0].Fa,m=n[0].Sa,g=n[n.length-1].Fa,p=n[n.length-1].Sa,q=Math.abs(l-g)-((n[0].width+n[n.length-1].width)/2+h),r=Math.abs(m-p)-((n[0].height+n[n.length-1].height)/2+h),h=0;1>Math.abs(r)?Math.abs(l-g)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0<r?r:1>Math.abs(q)?0:q;q=!1;q=Math.abs(g)>Math.abs(p)?0<g!==m>p:0<p!==l<g;if(q=e===$k?q:!q)h=-Math.abs(h),h=Math.min(h,-n[n.length-
1].width),h=Math.min(h,-n[n.length-1].height);l=a.Av;if(0<h&&0>l.To||Math.abs(h)<Math.abs(l.To)&&!(0>h&&0<l.To))for(l.To=h,l.jn=[],l.Np=[],m=0;m<n.length;m++)l.jn[m]=n[m].Mb.x,l.Np[m]=n[m].Mb.y;1<Math.abs(h)&&(a.wd=8>a.em?a.wd-h/(2*Math.PI):5>n.length&&10<h?a.wd/2:a.wd-(0<h?1.7:-2.3),a.jg=a.wd*k,Hn(a,b,c,d,e))}}}
function Gn(a,b,c,d,e){for(var g=a.wd,h=a.jg,k=a.Fn,l=g*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=b.af(),p=0;p<n.length;p++){n[p].Fa=l;n[p].Sa=m;if(p>=n.length-1)break;var q=In(a,l,m,n,p,e);q[0]||(q=Jn(a,l,m,n,p,e));l=q[1];m=q[2]}a.em++;if(!(23<a.em)){l=Math.atan2(m,l);l=e===$k?a.eu-l:l-a.eu;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;g=l*(g+h)/2;h=a.Av;if(Math.abs(g)<Math.abs(h.To))for(h.To=g,h.jn=[],h.Np=[],l=0;l<n.length;l++)h.jn[l]=n[l].Mb.x,h.Np[l]=n[l].Mb.y;1<Math.abs(g)&&
(a.wd=8>a.em?a.wd-g/(2*Math.PI):a.wd-(0<g?1.7:-2.3),a.jg=a.wd*k,Gn(a,b,c,d,e))}}function In(a,b,c,d,e,g){var h=a.wd,k=a.jg,l=0,m=0;a=(d[e].width+d[e+1].width)/2+a.Ek;var n=!1;if(0<=c!==(g===$k)){if(l=b+a,l>h){l=b-a;if(l<-h)return b=[!1],b[1]=l,b[2]=m,b;n=!0}}else if(l=b-a,l<-h){l=b+a;if(l>h)return b=[!1],b[1]=l,b[2]=m,b;n=!0}m=Math.sqrt(1-Math.min(1,l*l/(h*h)))*k;0>c!==n&&(m=-m);b=Math.abs(c-m)>(d[e].height+d[e+1].height)/2?[!1]:[!0];b[1]=l;b[2]=m;return b}
function Jn(a,b,c,d,e,g){var h=a.wd,k=a.jg,l=0,m=0;a=(d[e].height+d[e+1].height)/2+a.Ek;var n=!1;if(0<=b!==(g===$k)){if(m=c-a,m<-k){m=c+a;if(m>k)return b=[!1],b[1]=l,b[2]=m,b;n=!0}}else if(m=c+a,m>k){m=c-a;if(m<-k)return b=[!1],b[1]=l,b[2]=m,b;n=!0}l=Math.sqrt(1-Math.min(1,m*m/(k*k)))*h;0>b!==n&&(l=-l);b=Math.abs(b-l)>(d[e].width+d[e+1].width)/2?[!1]:[!0];b[1]=l;b[2]=m;return b}function vn(){this.To=-Infinity;this.Np=this.jn=null}
vn.prototype.commit=function(a){if(null!==this.jn&&null!==this.Np)for(var b=0;b<this.jn.length;b++){var c=a.qa(b);c.x=this.jn[b];c.y=this.Np[b]}};Sk.prototype.commitLayout=function(){this.commitNodes();this.Vs&&this.commitLinks()};Sk.prototype.commitNodes=function(){for(var a=this.LG,b=this.network.vertexes.k,c;b.next();)c=b.value,c.x+=a.x,c.y+=a.y,c.commit()};Sk.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};
function An(a,b,c,d,e){var g=a.DG;if(0.001>Math.abs(a.Fn-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var h=0,k;k=void 0!==d&&void 0!==e?e/(g+1):Math.PI/(2*(g+1));for(var l=0;l<=g;l++)var m=Math.sin(void 0!==d&&void 0!==e?d+l*e/g:l*Math.PI/(2*g)),h=h+Math.sqrt(1-a*a*m*m)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function zn(a,b,c,d,e){a=void 0!==d&&void 0!==e?An(a,1,c,d,e):An(a,1,c);return b/a}
function Bn(a,b,c,d,e){if(0.001>Math.abs(a.Fn-1))return e/b;var g=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-g*g*l*l)*a;if(h>=e)return k*a}return 0}
Sk.prototype.sort=function(a){switch(this.sorting){case Vk:break;case Wk:a.reverse();break;case Tk:a.sort(this.comparer);break;case Uk:a.sort(this.comparer);a.reverse();break;case Xk:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new H(xn),c=0;c<a.length;c++){var e=-1,g=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.qa(h).TH;k>e&&(e=k,g=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,g=h);d.add(a.qa(g));b[g]=-1;g=a.qa(g);e=g.hc;for(g=g.Zb;e.next();)h=e.value,h=h.fromVertex,h=a.indexOf(h),0>
h||0<=b[h]&&b[h]++;for(;g.next();)h=g.value,h=h.toVertex,h=a.indexOf(h),0>h||0<=b[h]&&b[h]++}a=[];for(b=0;b<d.length;b++){k=d.qa(b);a[b]=[];for(var c=k.Zb,e=k.hc,l,m;c.next();)l=c.value,m=d.indexOf(l.toVertex),m!==b&&0>a[b].indexOf(m)&&a[b].push(m);for(;e.next();)l=e.value,m=d.indexOf(l.fromVertex),m!==b&&0>a[b].indexOf(m)&&a[b].push(m)}k=[];for(b=0;b<a.length;b++)k[b]=0;for(var c=[],n=[],p=[],e=[],g=new H(xn),h=b=0;b<a.length;b++){var q=a[b].length;if(1===q)e.push(b);else if(0===q)g.add(d.qa(b));
else{if(0===h)c.push(b);else{for(var r=Infinity,s=Infinity,v=-1,x=[],q=0;q<c.length;q++)0>a[c[q]].indexOf(c[q===c.length-1?0:q+1])&&x.push(q===c.length-1?0:q+1);if(0===x.length)for(q=0;q<c.length;q++)x.push(q);for(q=0;q<x.length;q++){var E=x[q],F;m=a[b];l=n;F=p;for(var G=k,L=E,N=c,V=0,T=0;T<l.length;T++){var W=G[l[T]],da=G[F[T]],R=0,xa=0;W<da?(R=W,xa=da):(R=da,xa=W);if(R<L&&L<=xa)for(W=0;W<m.length;W++)da=m[W],0>N.indexOf(da)||R<G[da]&&G[da]<xa||R===G[da]||xa===G[da]||V++;else for(W=0;W<m.length;W++)da=
m[W],0>N.indexOf(da)||R<G[da]&&G[da]<xa&&R!==G[da]&&xa!==G[da]&&V++}F=V;for(l=G=0;l<a[b].length;l++)m=c.indexOf(a[b][l]),0<=m&&(m=Math.abs(E-(m>=E?m+1:m)),G+=m<c.length+1-m?m:c.length+1-m);for(l=0;l<n.length;l++)m=k[n[l]],L=k[p[l]],m>=E&&m++,L>=E&&L++,m>L&&(N=L,L=m,m=N),L-m<(c.length+2)/2===(m<E&&E<=L)&&G++;if(F<r||F===r&&G<s)r=F,s=G,v=E}c.splice(v,0,b);for(q=0;q<c.length;q++)k[c[q]]=q;for(q=0;q<a[b].length;q++)r=a[b][q],0<=c.indexOf(r)&&(n.push(b),p.push(r))}h++}}n=!1;for(p=c.length;;){n=!0;for(k=
0;k<e.length;k++)if(b=e[k],q=a[b][0],m=c.indexOf(q),0<=m){for(h=s=0;h<a[q].length;h++)r=a[q][h],r=c.indexOf(r),0>r||r===m||(v=r>m?r-m:m-r,s+=r<m!==v>p-v?1:-1);c.splice(0>s?m:m+1,0,b);e.splice(k,1);k--}else n=!1;if(n)break;else c.push(e[0]),e.splice(0,1)}for(b=0;b<c.length;b++)m=c[b],g.add(d.qa(m));return g;default:t.l("Invalid sorting type.")}return a};t.g(Sk,"radius",Sk.prototype.bF);
t.defineProperty(Sk,{bF:"radius"},function(){return this.Ar},function(a){this.Ar!==a&&(0<a||isNaN(a))&&(this.Ar=a,this.K())});t.g(Sk,"aspectRatio",Sk.prototype.iD);t.defineProperty(Sk,{iD:"aspectRatio"},function(){return this.cq},function(a){this.cq!==a&&0<a&&(this.cq=a,this.K())});t.g(Sk,"startAngle",Sk.prototype.yg);t.defineProperty(Sk,{yg:"startAngle"},function(){return this.xe},function(a){this.xe!==a&&(this.xe=a,this.K())});t.g(Sk,"sweepAngle",Sk.prototype.Sh);
t.defineProperty(Sk,{Sh:"sweepAngle"},function(){return this.ye},function(a){this.ye!==a&&(this.ye=0<a&&360>=a?a:360,this.K())});t.g(Sk,"arrangement",Sk.prototype.Oe);t.defineProperty(Sk,{Oe:"arrangement"},function(){return this.jd},function(a){this.jd!==a&&(f&&t.m(a,oa,Sk,"arrangement"),a===el||a===dl||a===cl||a===bl)&&(this.jd=a,this.K())});t.g(Sk,"direction",Sk.prototype.direction);
t.defineProperty(Sk,{direction:"direction"},function(){return this.sa},function(a){this.sa!==a&&(f&&t.m(a,oa,Sk,"direction"),a===$k||a===al||a===Yk||a===Zk)&&(this.sa=a,this.K())});t.g(Sk,"sorting",Sk.prototype.sorting);t.defineProperty(Sk,{sorting:"sorting"},function(){return this.xh},function(a){this.xh!==a&&(f&&t.m(a,oa,Sk,"sorting"),a===Vk||a===Wk||a===Tk||Uk||a===Xk)&&(this.xh=a,this.K())});t.g(Sk,"comparer",Sk.prototype.comparer);
t.defineProperty(Sk,{comparer:"comparer"},function(){return this.ih},function(a){this.ih!==a&&(f&&t.j(a,"function",Sk,"comparer"),this.ih=a,this.K())});t.g(Sk,"spacing",Sk.prototype.spacing);t.defineProperty(Sk,{spacing:"spacing"},function(){return this.yh},function(a){this.yh!==a&&(this.yh=a,this.K())});t.g(Sk,"nodeDiameterFormula",Sk.prototype.ht);
t.defineProperty(Sk,{ht:"nodeDiameterFormula"},function(){return this.ur},function(a){this.ur!==a&&(f&&t.m(a,oa,Sk,"nodeDiameterFormula"),a===gl||a===fl)&&(this.ur=a,this.K())});t.A(Sk,{MG:"actualXRadius"},function(){return this.wd});t.A(Sk,{NG:"actualYRadius"},function(){return this.jg});t.A(Sk,{nJ:"actualSpacing"},function(){return this.Ek});t.A(Sk,{LG:"actualCenter"},function(){return isNaN(this.zd.x)||isNaN(this.zd.y)?new C(0,0):new C(this.zd.x+this.MG,this.zd.y+this.NG)});var dl;
Sk.ConstantSpacing=dl=t.w(Sk,"ConstantSpacing",0);var cl;Sk.ConstantDistance=cl=t.w(Sk,"ConstantDistance",1);var bl;Sk.ConstantAngle=bl=t.w(Sk,"ConstantAngle",2);var el;Sk.Packed=el=t.w(Sk,"Packed",3);var $k;Sk.Clockwise=$k=t.w(Sk,"Clockwise",4);var al;Sk.Counterclockwise=al=t.w(Sk,"Counterclockwise",5);var Yk;Sk.BidirectionalLeft=Yk=t.w(Sk,"BidirectionalLeft",6);var Zk;Sk.BidirectionalRight=Zk=t.w(Sk,"BidirectionalRight",7);var Vk;Sk.Forwards=Vk=t.w(Sk,"Forwards",8);var Wk;
Sk.Reverse=Wk=t.w(Sk,"Reverse",9);var Tk;Sk.Ascending=Tk=t.w(Sk,"Ascending",10);var Uk;Sk.Descending=Uk=t.w(Sk,"Descending",11);var Xk;Sk.Optimized=Xk=t.w(Sk,"Optimized",12);var gl;Sk.Pythagorean=gl=t.w(Sk,"Pythagorean",13);var fl;Sk.Circular=fl=t.w(Sk,"Circular",14);function wn(){Ba.call(this)}t.ia("CircularNetwork",wn);t.Oa(wn,Ba);wn.prototype.createVertex=function(){return new xn};wn.prototype.createEdge=function(){return new Kn};function xn(){Da.call(this);this.actualAngle=this.diameter=NaN}
t.ia("CircularVertex",xn);t.Oa(xn,Da);function yn(a,b){var c=a.network;if(null===c)return NaN;c=c.Tb;if(null===c)return NaN;if(c.Oe===el)if(c.ht===fl)a.diameter=Math.max(a.width,a.height);else{var c=Math.abs(Math.sin(b)),d=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===d)return a.height;a.diameter=Math.min(a.height/c,a.width/d)}else a.diameter=c.ht===fl?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function Kn(){Ea.call(this)}t.ia("CircularEdge",Kn);
t.Oa(Kn,Ea);function Ln(){0<arguments.length&&t.l("ForceDirectedLayout constructor cannot take any arguments.");ue.call(this);this.ig=null;this.Uq=0;this.Rf=(new pa(100,100)).freeze();this.bq=!1;this.wh=!0;this.hh=!1;this.$n=100;this.yq=1;this.oh=1E3;this.zn=0.05;this.yn=50;this.vn=150;this.xn=0;this.sq=10;this.rq=5}t.ia("ForceDirectedLayout",Ln);t.Oa(Ln,ue);
Ln.prototype.cloneProtected=function(a){ue.prototype.cloneProtected.call(this,a);a.Rf.assign(this.Rf);a.bq=this.bq;a.wh=this.wh;a.hh=this.hh;a.$n=this.$n;a.yq=this.yq;a.oh=this.oh;a.zn=this.zn;a.yn=this.yn;a.vn=this.vn;a.xn=this.xn;a.sq=this.sq;a.rq=this.rq};Ln.prototype.createNetwork=function(){var a=new Mn;nn(a,this);return a};
Ln.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));a=this.Aw;if(0<this.network.vertexes.count){this.network.$v();for(var b=this.network.vertexes.k;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.k;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
this.Dz();this.Uq=0;if(this.needsClusterLayout()){for(var b=this.network,d=b.dJ().k;d.next();){var e=d.value;this.network=e;for(c=this.network.vertexes.k;c.next();){for(var e=c.value,g=0,h=e.vertexes;h.next();)g++;e.Lf=g;e.ik=1;e.Dm=null;e.$g=null}Nn(this,0,a)}this.network=b;d.reset();f&&t.m(b,Mn,Ln,"arrangeConnectedGraphs:singletons");for(var c=this.Jv,k=d.count,l=!0,g=e=0,h=t.Cb(),m=0;m<k+b.vertexes.count+2;m++)h[m]=null;k=0;d.reset();for(m=t.wf();d.next();){var n=d.value;this.kf(n,m);if(l)l=!1,
e=m.x+m.width/2,g=m.y+m.height/2,h[0]=new C(m.x+m.width+c.width,m.y),h[1]=new C(m.x,m.y+m.height+c.height),k=2;else{var p=On(h,k,e,g,m.width,m.height,c),q=h[p],r=new C(q.x+m.width+c.width,q.y),s=new C(q.x,q.y+m.height+c.height);p+1<k&&h.splice(p+1,0,null);h[p]=r;h[p+1]=s;k++;p=q.x-m.x;q=q.y-m.y;for(n=n.vertexes.k;n.next();){var v=n.value;v.Fa+=p;v.Sa+=q}}}t.Rc(m);for(n=b.vertexes.k;n.next();)v=n.value,l=v.S,2>k?(e=l.x+l.width/2,g=l.y+l.height/2,h[0]=new C(l.x+l.width+c.width,l.y),h[1]=new C(l.x,l.y+
l.height+c.height),k=2):(p=On(h,k,e,g,l.width,l.height,c),q=h[p],r=new C(q.x+l.width+c.width,q.y),s=new C(q.x,q.y+l.height+c.height),p+1<k&&h.splice(p+1,0,null),h[p]=r,h[p+1]=s,k++,v.Fa=q.x+v.width/2,v.Sa=q.y+v.height/2);t.Da(h);for(d.reset();d.next();){e=d.value;for(g=e.vertexes.k;g.next();)c=g.value,b.Zk(c);for(e=e.edges.k;e.next();)c=e.value,b.uo(c)}}Pn(this,a);this.updateParts()}this.$n=a;this.network=null;this.of=!0};
Ln.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;var a=0,b=0,c=this.network.vertexes.k;c.next();for(var d=c.value.S;c.next();){if(c.value.S.If(d)&&(a++,1<a))return!0;if(10<b)break;b++}return!1};Ln.prototype.kf=function(a,b){for(var c=!0,d=a.vertexes.k;d.next();){var e=d.value;c?(c=!1,b.set(e.S)):b.nk(e.S)}return b};
function Qn(a,b,c){f&&(t.o(b,Ln,"computeClusterLayoutIterations:level"),t.o(c,Ln,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
function Nn(a,b,c){f&&(t.o(b,Ln,"layoutClusters:level"),t.o(c,Ln,"layoutClusters:maxiter"));if(Rn(a,b)){var d=a.oh;a.oh*=1+1/(b+1);var e=Sn(a,b),g=Math.max(0,Qn(a,b,c));a.Aw+=g;Nn(a,b+1,c);Pn(a,g);Tn(a,e,b);c=a.ig;null===c?c=new H(Un):c.clear();c.Me(e.vertexes);c.sort(function(a,b){return null===a||null===b||a===b?0:b.Lf-a.Lf});for(e=c.k;e.next();)Vn(a,e.value,b);a.oh=d}}
function Rn(a,b){f&&t.o(b,Ln,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;null===a.ig?a.ig=new H(Un):a.ig.clear();a.ig.Me(a.network.vertexes);var c=a.ig;c.sort(function(a,b){return null===a||null===b||a===b?0:b.Lf-a.Lf});for(var d=c.count-1;0<=d&&1>=c.p[d].Lf;)d--;return 1<c.count-d}
function Sn(a,b){f&&t.o(b,Ln,"pushSubNetwork:level");for(var c=a.network,d=new Mn,e=a.ig.k;e.next();){var g=e.value;if(1<g.Lf){d.Zk(g);var h={wB:g.Lf,yB:g.width,vB:g.height,kG:g.P.x,lG:g.P.y};null===g.$g&&(g.$g=new H);g.$g.add(h);g.UA=g.$g.count-1}else break}for(var k=c.edges.k;k.next();){var l=k.value;if(l.fromVertex.network===d&&l.toVertex.network===d)d.uo(l);else if(l.fromVertex.network===d){var m=l.fromVertex.Dm;null===m&&(m=new H(Un),l.fromVertex.Dm=m);m.add(l.toVertex);l.fromVertex.Lf--;l.fromVertex.ik+=
l.toVertex.ik}else l.toVertex.network===d&&(m=l.toVertex.Dm,null===m&&(m=new H(Un),l.toVertex.Dm=m),m.add(l.fromVertex),l.toVertex.Lf--,l.toVertex.ik+=l.fromVertex.ik)}for(k=d.edges.k;k.next();)l=k.value,l.length*=Math.max(1,J.sqrt((l.fromVertex.ik+l.toVertex.ik)/(4*b+1)));for(e=d.vertexes.k;e.next();)if(g=e.value,m=g.Dm,null!==m&&0<m.count&&(h=g.$g.p[g.$g.count-1],h=h.wB-g.Lf,!(0>=h))){for(var n=0,p=0,q=m.count-h;q<m.count;q++){for(var r=m.p[q],l=null,k=r.edges.k;k.next();){var s=k.value;if(s.$H(r)===
g){l=s;break}}null!==l&&(p+=l.length,n+=r.width*r.height)}m=g.Fa;k=g.Sa;l=g.width;q=g.height;r=g.P;s=l*q;1>s&&(s=1);n=J.sqrt((n+s+p*p*4/(h*h))/s);h=(n-1)*l/2;n=(n-1)*q/2;g.Mb=new D(m-r.x-h,k-r.y-n,l+2*h,q+2*n);g.focus=new C(r.x+h,r.y+n)}a.network=d;return c}
function Tn(a,b,c){f&&(t.m(b,Mn,Ln,"popNetwork:oldnet"),t.o(c,Ln,"popNetwork:level"));for(c=a.network.vertexes.k;c.next();){var d=c.value;d.network=b;if(null!==d.$g){var e=d.$g.p[d.UA];d.Lf=e.wB;var g=e.kG,h=e.lG;d.Mb=new D(d.Fa-g,d.Sa-h,e.yB,e.vB);d.focus=new C(g,h);d.UA--}}for(c=a.network.edges.k;c.next();)c.value.network=b;a.network=b}
function Vn(a,b,c){f&&(t.m(b,Un,Ln,"surroundNode:oldnet"),t.o(c,Ln,"surroundNode:level"));var d=b.Dm;if(null!==d&&0!==d.count){c=b.Fa;var e=b.Sa,g=b.width,h=b.height;null!==b.$g&&0<b.$g.count&&(h=b.$g.p[0],g=h.yB,h=h.vB);for(var g=J.sqrt(g*g+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.k;n.next();){var p=n.value;1>=p.Lf?l++:(k=!0,m++,h+=Math.atan2(b.Sa-p.Sa,b.Fa-p.Fa))}if(0!==l)for(0<m&&(h/=m),m=b=0,b=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(m=b/2),1<d.count&&d.sort(function(a,b){return null===a||null===b||
a===b?0:b.width*b.height-a.width*a.height}),k=0===l%2?0:1,n=d.k;n.next();)if(p=n.value,!(1<p.Lf||a.isFixed(p))){d=null;for(l=p.edges.k;l.next();){d=l.value;break}var l=p.width,q=p.height,l=J.sqrt(l*l+q*q)/2,d=g+d.length+l,l=h+(b*(k/2>>1)+m)*(0==k%2?1:-1);p.Fa=c+d*Math.cos(l);p.Sa=e+d*Math.sin(l);k++}}}
function On(a,b,c,d,e,g,h){var k=9E19,l=-1,m=0;a:for(;m<b;m++){var n=a[m],p=n.x-c,q=n.y-d,p=p*p+q*q;if(p<k){for(q=m-1;0<=q;q--)if(a[q].y>n.y&&a[q].x-n.x<e+h.width)continue a;for(q=m+1;q<b;q++)if(a[q].x>n.x&&a[q].y-n.y<g+h.height)continue a;l=m;k=p}}return l}Ln.prototype.Dz=function(){if(this.comments)for(var a=this.network.vertexes.k;a.next();)this.addComments(a.value)};
Ln.prototype.addComments=function(a){var b=a.Jc;if(null!==b)for(b=b.WD();b.next();){var c=b.value;if("Comment"===c.Qc&&c.zb()){var d=this.network.Mm(c);null===d&&(d=this.network.vo(c));d.charge=this.CD;for(var c=null,e=d.Zb;e.next();)if(e.value.toVertex===a){c=e.value;break}if(null===c)for(e=d.hc;e.next();)if(e.value.fromVertex===a){c=e.value;break}null===c&&(c=this.network.Um(a,d,null));c.length=this.DD}}};
function Wn(a,b){f&&(t.m(a,Un,Ln,"getNodeDistance:vertexA"),t.m(b,Un,Ln,"getNodeDistance:vertexB"));var c=a.S,d=c.x,e=c.y,g=c.width,c=c.height,h=b.S,k=h.x,l=h.y,m=h.width,h=h.height;return d+g<k?e>l+h?(d=d+g-k,e=e-l-h,J.sqrt(d*d+e*e)):e+c<l?(d=d+g-k,e=e+c-l,J.sqrt(d*d+e*e)):k-(d+g):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,J.sqrt(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,J.sqrt(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):0.1}
function Pn(a,b){f&&t.o(b,Ln,"performIterations:num");a.ig=null;for(var c=a.Uq+b;a.Uq<c&&(a.Uq++,Xn(a)););a.ig=null}
function Xn(a){null===a.ig&&(a.ig=new H(Un),a.ig.Me(a.network.vertexes));var b=a.ig.p;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.Fa,e=d,g=c.Sa,h=g,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.Fa,k=k.Sa,d=Math.min(d,l),e=Math.max(e,l),g=Math.min(g,k),h=Math.max(h,k)}(g=e-d>h-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.Fa-b.Fa}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.Sa-b.Sa});for(var h=a.oh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
b[c],l=k.S,q=k.P,d=l.x+q.x,l=l.y+q.y,n=k.charge*a.electricalFieldX(d,l),p=k.charge*a.electricalFieldY(d,l),n=n+k.mass*a.gravitationalFieldX(d,l),p=p+k.mass*a.gravitationalFieldY(d,l);k.forceX+=n;k.forceY+=p;for(q=c+1;q<b.length;q++)if(e=b[q],e!==k){var n=e.S,r=e.P,p=n.x+r.x,r=n.y+r.y;if(d-p>h||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=Wn(k,e);1>s?(d>p?(n=Math.abs(e.S.right-k.S.x),n=(1+n)*Math.random()):d<p?(n=Math.abs(e.S.x-k.S.right),n=-(1+n)*Math.random()):(n=Math.max(e.width,
k.width),n=(1+n)*Math.random()-n/2),l>r?(p=Math.abs(e.S.bottom-k.S.y),p=(1+p)*Math.random()):d<p?(p=Math.abs(e.S.y-k.S.bottom),p=-(1+p)*Math.random()):(p=Math.max(e.height,k.height),p=(1+p)*Math.random()-p/2)):(m=-(k.charge*e.charge)/(s*s),n=(p-d)/s*m,p=(r-l)/s*m);k.forceX+=n;k.forceY+=p;e.forceX-=n;e.forceY-=p}}}for(c=a.network.edges.k;c.next();)g=c.value,k=g.fromVertex,e=g.toVertex,l=k.S,q=k.P,d=l.x+q.x,l=l.y+q.y,n=e.S,r=e.P,p=n.x+r.x,r=n.y+r.y,s=Wn(k,e),1>s?(n=(d>p?1:-1)*(1+(e.width>k.width)?e.width:
k.width)*Math.random(),p=(l>r?1:-1)*(1+(e.height>k.height)?e.height:k.height)*Math.random()):(m=g.stiffness*(s-g.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.oh/20,50);for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(g=k.forceX,h=k.forceY,g<-d?g=-d:g>d&&(g=d),h<-d?h=-d:h>d&&(h=d),k.Fa+=g,k.Sa+=h,c=Math.max(c,g*g+h*h));return c>a.Vz*a.Vz}Ln.prototype.moveFixedVertex=function(){};
Ln.prototype.commitLayout=function(){this.bB();this.commitNodes();this.Vs&&this.commitLinks()};Ln.prototype.bB=function(){if(this.vl)for(var a=this.network.edges.k;a.next();){var b=a.value.link;null!==b&&(b.lb=Qb,b.mb=Qb)}};Ln.prototype.commitNodes=function(){var a=0,b=0;if(this.gD){var c=t.wf();this.kf(this.network,c);b=this.zd;a=b.x-c.x;b=b.y-c.y;t.Rc(c)}for(var c=t.wf(),d=this.network.vertexes.k;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.S),c.x+=a,c.y+=b,e.Mb=c;e.commit()}t.Rc(c)};
Ln.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};Ln.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.zn:a};Ln.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.yn:a};Ln.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.vn:a};Ln.prototype.electricalFieldX=function(){return 0};Ln.prototype.electricalFieldY=function(){return 0};
Ln.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.xn:a};Ln.prototype.gravitationalFieldX=function(){return 0};Ln.prototype.gravitationalFieldY=function(){return 0};Ln.prototype.isFixed=function(a){return a.isFixed};t.A(Ln,{oJ:"currentIteration"},function(){return this.Uq});t.g(Ln,"arrangementSpacing",Ln.prototype.Jv);t.defineProperty(Ln,{Jv:"arrangementSpacing"},function(){return this.Rf},function(a){this.Rf.N(a)||(this.Rf.assign(a),this.K())});t.g(Ln,"arrangesToOrigin",Ln.prototype.gD);
t.defineProperty(Ln,{gD:"arrangesToOrigin"},function(){return this.bq},function(a){this.bq!==a&&(this.bq=a,this.K())});t.g(Ln,"setsPortSpots",Ln.prototype.vl);t.defineProperty(Ln,{vl:"setsPortSpots"},function(){return this.wh},function(a){this.wh!==a&&(this.wh=a,this.K())});t.g(Ln,"comments",Ln.prototype.comments);t.defineProperty(Ln,{comments:"comments"},function(){return this.hh},function(a){this.hh!==a&&(this.hh=a,this.K())});t.g(Ln,"maxIterations",Ln.prototype.Aw);
t.defineProperty(Ln,{Aw:"maxIterations"},function(){return this.$n},function(a){this.$n!==a&&0<=a&&(this.$n=a,this.K())});t.g(Ln,"epsilonDistance",Ln.prototype.Vz);t.defineProperty(Ln,{Vz:"epsilonDistance"},function(){return this.yq},function(a){this.yq!==a&&0<a&&(this.yq=a,this.K())});t.g(Ln,"infinityDistance",Ln.prototype.hI);t.defineProperty(Ln,{hI:"infinityDistance"},function(){return this.oh},function(a){this.oh!==a&&1<a&&(this.oh=a,this.K())});t.g(Ln,"defaultSpringStiffness",Ln.prototype.EH);
t.defineProperty(Ln,{EH:"defaultSpringStiffness"},function(){return this.zn},function(a){this.zn!==a&&(this.zn=a,this.K())});t.g(Ln,"defaultSpringLength",Ln.prototype.DH);t.defineProperty(Ln,{DH:"defaultSpringLength"},function(){return this.yn},function(a){this.yn!==a&&(this.yn=a,this.K())});t.g(Ln,"defaultElectricalCharge",Ln.prototype.xH);t.defineProperty(Ln,{xH:"defaultElectricalCharge"},function(){return this.vn},function(a){this.vn!==a&&(this.vn=a,this.K())});
t.g(Ln,"defaultGravitationalMass",Ln.prototype.yH);t.defineProperty(Ln,{yH:"defaultGravitationalMass"},function(){return this.xn},function(a){this.xn!==a&&(this.xn=a,this.K())});t.g(Ln,"defaultCommentSpringLength",Ln.prototype.DD);t.defineProperty(Ln,{DD:"defaultCommentSpringLength"},function(){return this.sq},function(a){this.sq!==a&&(this.sq=a,this.K())});t.g(Ln,"defaultCommentElectricalCharge",Ln.prototype.CD);
t.defineProperty(Ln,{CD:"defaultCommentElectricalCharge"},function(){return this.rq},function(a){this.rq!==a&&(this.rq=a,this.K())});function Mn(){Ba.call(this)}t.ia("ForceDirectedNetwork",Mn);t.Oa(Mn,Ba);Mn.prototype.createVertex=function(){return new Un};Mn.prototype.createEdge=function(){return new Yn};function Un(){Da.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.ik=this.Lf=this.forceY=this.forceX=0;this.$g=this.Dm=null;this.UA=0}t.ia("ForceDirectedVertex",Un);t.Oa(Un,Da);
function Yn(){Ea.call(this);this.length=this.stiffness=NaN}t.ia("ForceDirectedEdge",Yn);t.Oa(Yn,Ea);
function Jk(){0<arguments.length&&t.l("LayeredDigraphLayout constructor cannot take any arguments.");ue.call(this);this.Gd=this.Wn=25;this.sa=0;this.un=Zn;this.Xn=$n;this.Nn=ao;this.Wl=4;this.nn=bo;this.ri=co;this.wh=!0;this.vj=4;this.Hb=this.Gu=this.ob=-1;this.Af=this.lr=0;this.Kd=this.yf=this.Kg=this.th=this.Hd=null;this.rr=0;this.Pu=this.am=null;this.ag=0;this.sr=null;this.Mg=[];this.Mg.length=100}t.ia("LayeredDigraphLayout",Jk);t.Oa(Jk,ue);
Jk.prototype.cloneProtected=function(a){ue.prototype.cloneProtected.call(this,a);a.Wn=this.Wn;a.Gd=this.Gd;a.sa=this.sa;a.un=this.un;a.Xn=this.Xn;a.Nn=this.Nn;a.Wl=this.Wl;a.nn=this.nn;a.ri=this.ri;a.wh=this.wh;a.vj=this.vj};Jk.prototype.createNetwork=function(){var a=new eo;nn(a,this);return a};
Jk.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.zd=this.iA(this.zd);this.Gu=-1;this.Af=this.lr=0;this.sr=this.Pu=this.am=null;for(a=0;a<this.Mg.length;a++)this.Mg[a]=null;if(0<this.network.vertexes.count){this.network.$v();for(a=this.network.edges.k;a.next();)a.value.rev=!1;switch(this.un){default:case fo:var b=0,c=this.network.vertexes.count-
1;a=[];a.length=c+1;for(var d=this.network.vertexes.k;d.next();)d.value.valid=!0;for(;null!==ho(this.network);){for(d=io(this.network);null!==d;)a[c]=d,c--,d.valid=!1,d=io(this.network);for(d=jo(this.network);null!==d;)a[b]=d,b++,d.valid=!1,d=jo(this.network);for(var d=null,e=0,g=this.network.vertexes.k;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.Zb;l.next();)l.value.toVertex.valid&&k++;for(var l=0,m=h.hc;m.next();)m.value.fromVertex.valid&&l++;if(null===d||e<k-l)d=h,e=k-l}}null!==d&&(a[b]=
d,b++,d.valid=!1)}for(b=0;b<this.network.vertexes.count;b++)a[b].index=b;for(a=this.network.edges.k;a.next();)b=a.value,b.fromVertex.index>b.toVertex.index&&(this.network.Jw(b),b.rev=!0);break;case Zn:for(b=this.network.vertexes.k;b.next();)b.value.Ko=-1,b.value.finish=-1;for(a=this.network.edges.k;a.next();)a.value.forest=!1;this.rr=0;for(b.reset();b.next();)0===b.value.hc.count&&lo(this,b.value);for(b.reset();b.next();)-1===b.value.Ko&&lo(this,b.value);for(a.reset();a.next();)b=a.value,b.forest||
(c=b.fromVertex,d=c.finish,e=b.toVertex,g=e.finish,e.Ko<c.Ko&&d<g&&(this.network.Jw(b),b.rev=!0))}for(a=this.network.vertexes.k;a.next();)b=a.value,b.layer=-1;this.ob=-1;this.assignLayers();for(a.reset();a.next();)this.ob=Math.max(this.ob,a.value.layer);c=this.network.edges.k;for(b=[];c.next();)a=c.value,a.valid=!1,b.push(a);for(c=0;c<b.length;c++)if(a=b[c],!a.valid&&(null!==a.fromVertex.nd&&null!==a.toVertex.nd||a.fromVertex.layer!==a.toVertex.layer)){g=k=h=l=0;e=a.fromVertex;d=a.toVertex;if(null!==
a.link){k=a.link;if(null===k)continue;var n=e.nd,g=d.nd;if(null===n||null===g)continue;var p=k.da,h=k.ja,q=k.Sc,l=k.Ed;a.rev&&(k=p,m=q,p=h,q=l,h=k,l=m);var r=e.P,k=a.toVertex.P,s=a.rev?d.S:e.S,m=t.O();isNaN(s.x)?m.assign(r):fm(p,q,Vb,m);n!==p&&!isNaN(s.x)&&p.zb()&&(n=e.S,isNaN(n.x)||(m.x+=s.x-n.x,m.y+=s.y-n.y));p=a.rev?e.S:d.S;n=t.O();isNaN(p.x)?n.assign(k):fm(h,l,Vb,n);g!==h&&!isNaN(p.x)&&h.zb()&&(g=d.S,isNaN(g.x)||(n.x+=p.x-g.x,n.y+=p.y-g.y));90===this.sa||270===this.sa?(g=Math.round((m.x-r.x)/
this.Gd),h=m.x,k=Math.round((n.x-k.x)/this.Gd),l=n.x):(g=Math.round((m.y-r.y)/this.Gd),h=m.y,k=Math.round((n.y-k.y)/this.Gd),l=n.y);t.B(m);t.B(n);a.portFromColOffset=g;a.portFromPos=h;a.portToColOffset=k;a.portToPos=l}else a.portFromColOffset=0,a.portFromPos=0,a.portToColOffset=0,a.portToPos=0;m=e.layer;r=d.layer;n=a;p=0;s=n.link;if(null!==s){var v=s.Sc,x=s.Ed;if(null!==v&&null!==x){var E=s.da,q=s.ja;if(null!==E&&null!==q){var F=v.lb,G=x.mb;this.vl||(s.lb.Gc()||(F=s.lb),s.mb.Gc()||(G=s.mb));if(F.Gc()||
F===Pb)F=uo(this,!0);if(G.Gc()||G===Pb)G=uo(this,!1);var L=s.ac,N=s.getLinkPoint(E,v,F,!0,L,q,x,t.O()),F=s.getLinkDirection(E,v,N,F,!0,L,q,x);t.B(N);F===Ao(this,n,!0)?p+=1:this.vl&&null!==E&&1===E.ports.count&&n.rev&&(p+=1);N=s.getLinkPoint(q,x,G,!1,L,E,v,t.O());s=s.getLinkDirection(q,x,N,G,!1,L,E,v);t.B(N);s===Ao(this,n,!1)?p+=2:this.vl&&null!==q&&1===q.ports.count&&n.rev&&(p+=2)}}}n=1===p||3===p?!0:!1;if(p=2===p||3===p?!0:!1)q=this.network.createVertex(),q.nd=null,q.ym=1,q.layer=m,q.near=e,this.network.Zk(q),
e=this.network.Um(e,q,a.link),e.valid=!1,e.rev=a.rev,e.portFromColOffset=g,e.portToColOffset=0,e.portFromPos=h,e.portToPos=0,e=q;s=1;n&&s--;if(m-r>s&&0<m){a.valid=!1;q=this.network.createVertex();q.nd=null;q.ym=2;q.layer=m-1;this.network.Zk(q);e=this.network.Um(e,q,a.link);e.valid=!0;e.rev=a.rev;e.portFromColOffset=p?0:g;e.portToColOffset=0;e.portFromPos=p?0:h;e.portToPos=0;e=q;for(m--;m-r>s&&0<m;)q=this.network.createVertex(),q.nd=null,q.ym=3,q.layer=m-1,this.network.Zk(q),e=this.network.Um(e,q,
a.link),e.valid=!0,e.rev=a.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,m--;e=this.network.Um(q,d,a.link);e.valid=!n;n&&(q.near=d);e.rev=a.rev;e.portFromColOffset=0;e.portToColOffset=k;e.portFromPos=0;e.portToPos=l}else a.valid=!0}b=this.Hd=[];for(c=0;c<=this.ob;c++)b[c]=0;for(a=this.network.vertexes.k;a.next();)a.value.index=-1;this.initializeIndices();this.Gu=-1;for(c=this.Af=this.lr=0;c<=this.ob;c++)b[c]>b[this.Af]&&(this.Gu=b[c]-1,this.Af=c),b[c]<b[this.lr]&&
(this.lr=c);this.sr=[];for(c=0;c<b.length;c++)this.sr[c]=[];for(a.reset();a.next();)c=a.value,b=c.layer,this.sr[b][c.index]=c;this.Hb=-1;for(a=0;a<=this.ob;a++){b=Bo(this,a);c=0;d=this.Hd[a];for(e=0;e<d;e++)g=b[e],c+=this.nodeMinColumnSpace(g,!0),g.column=c,c+=1,c+=this.nodeMinColumnSpace(g,!1);this.Hb=Math.max(this.Hb,c-1);Co(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.of=!0};
function Do(a){var b=a.toVertex,c=0;for(a=a.fromVertex.Zb;a.next();)a.value.toVertex===b&&c++;return 1<c?2:1}function Eo(a){var b=a.fromVertex.nd;a=a.toVertex.nd;return null===b&&null===a?8:null===b||null===a?4:1}Jk.prototype.nodeMinLayerSpace=function(a,b){return null===a.nd?0:90===this.sa||270===this.sa?b?a.P.y+10:a.S.height-a.P.y+10:b?a.P.x+10:a.S.width-a.P.x+10};
Jk.prototype.nodeMinColumnSpace=function(a,b){if(null===a.nd)return 0;var c=b?a.BA:a.AA;if(void 0!==c)return c;c=this.sa;return 90===c||270===c?b?a.BA=a.P.x/this.Gd+1|0:a.AA=(a.S.width-a.P.x)/this.Gd+1|0:b?a.BA=a.P.y/this.Gd+1|0:a.AA=(a.S.height-a.P.y)/this.Gd+1|0};function Fo(a){null===a.am&&(a.am=[]);for(var b=0,c=a.network.vertexes.k,d;c.next();)d=c.value,a.am[b]=d.layer,b++,a.am[b]=d.column,b++,a.am[b]=d.index,b++;return a.am}
function Go(a,b){for(var c=0,d=a.network.vertexes.k,e;d.next();)e=d.value,e.layer=b[c],c++,e.column=b[c],c++,e.index=b[c],c++}
function Ho(a,b,c){f&&(t.o(b,Jk,"crossingMatrix:unfixedLayer"),t.o(c,Jk,"crossingMatrix:direction"));var d=Bo(a,b),e=a.Hd[b];a.Pu||(a.Pu=[]);for(var g=a.Pu,h,k=0;k<e;k++){h=0;var l=d[k],m=l.near,n,p;if(null!==m&&m.layer===l.layer)if(l=m.index,l>k)for(p=k+1;p<l;p++)n=d[p],n.near===m&&n.ym===m.ym||h++;else for(p=k-1;p>l;p--)n=d[p],n.near===m&&n.ym===m.ym||h++;var q,r,s,v,x,E;if(0<=c)for(l=d[k].$e,m=0;m<l.count;m++)if(q=l.p[m],q.valid&&q.fromVertex.layer!==b)for(n=q.fromVertex.index,p=q.portToPos,q=
q.portFromPos,r=m+1;r<l.count;r++)s=l.p[r],s.valid&&s.fromVertex.layer!==b&&(v=s.fromVertex.index,x=s.portToPos,s=s.portFromPos,p<x&&(n>v||n===v&&q>s)&&h++,x<p&&(v>n||v===n&&s>q)&&h++);if(0>=c)for(l=d[k].Qe,m=0;m<l.count;m++)if(q=l.p[m],q.valid&&q.toVertex.layer!==b)for(n=q.toVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<l.count;r++)s=l.p[r],s.valid&&s.toVertex.layer!==b&&(v=s.toVertex.index,x=s.portToPos,s=s.portFromPos,q<s&&(n>v||n===v&&p>x)&&h++,s<q&&(v>n||v===n&&x>p)&&h++);g[k*e+k]=h;for(l=
k+1;l<e;l++){var F=0,G=0;if(0<=c)for(h=d[k].$e,E=d[l].$e,m=0;m<h.count;m++)if(q=h.p[m],q.valid&&q.fromVertex.layer!==b)for(n=q.fromVertex.index,q=q.portFromPos,r=0;r<E.count;r++)s=E.p[r],s.valid&&s.fromVertex.layer!==b&&(v=s.fromVertex.index,s=s.portFromPos,(n<v||n===v&&q<s)&&G++,(v<n||v===n&&s<q)&&F++);if(0>=c)for(h=d[k].Qe,E=d[l].Qe,m=0;m<h.count;m++)if(q=h.p[m],q.valid&&q.toVertex.layer!==b)for(n=q.toVertex.index,p=q.portToPos,r=0;r<E.count;r++)s=E.p[r],s.valid&&s.toVertex.layer!==b&&(v=s.toVertex.index,
x=s.portToPos,(n<v||n===v&&p<x)&&G++,(v<n||v===n&&x<p)&&F++);g[k*e+l]=F;g[l*e+k]=G}}Co(a,b,d);return g}Jk.prototype.countCrossings=function(){var a,b=0,c,d;for(a=0;a<=this.ob;a++){c=Ho(this,a,1);d=this.Hd[a];for(var e=0;e<d;e++)for(var g=e;g<d;g++)b+=c[e*d+g]}return b};
function Io(a){for(var b=0,c=0;c<=a.ob;c++){for(var d=a,e=c,g=Bo(d,e),h=d.Hd[e],k=0,l=void 0,l=0;l<h;l++){var m=g[l].Qe,n,p,q;if("undefined"!==typeof m)for(var r=0;r<m.count;r++)n=m.p[r],n.valid&&n.toVertex.layer!==e&&(p=n.fromVertex.column+n.portFromColOffset,q=n.toVertex.column+n.portToColOffset,k+=(Math.abs(p-q)+1)*Eo(n))}Co(d,e,g);b+=k}return b}
Jk.prototype.normalize=function(){var a=Infinity;this.Hb=-1;for(var b=this.network.vertexes.k,c;b.next();)c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0)),this.Hb=Math.max(this.Hb,c.column+this.nodeMinColumnSpace(c,!1));for(b.reset();b.next();)b.value.column-=a;this.Hb-=a};
function Jo(a,b,c){f&&(t.o(b,Jk,"barycenters:unfixedLayer"),t.o(c,Jk,"barycenters:direction"));var d=Bo(a,b),e=a.Hd[b],g=[],h;for(h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.$e);var m=null;0<=c&&(m=k.Qe);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q<l.count;q++){var k=l.p[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(n+=r.column+k.portFromColOffset,p++)}if(null!==m)for(l=0;l<m.count;l++)k=m.p[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column+
k.portToColOffset,p++);g[h]=0===p?-1:n/p}Co(a,b,d);return g}
function Ko(a,b,c){f&&(t.o(b,Jk,"medians:unfixedLayer"),t.o(c,Jk,"medians:direction"));for(var d=Bo(a,b),e=a.Hd[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.$e);var m=null;0<=c&&(m=k.Qe);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q<l.count;q++){var k=l.p[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(p[n]=r.column+k.portFromColOffset,n++)}if(null!==m)for(l=0;l<m.count;l++)k=m.p[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,
n++);0===n?g[h]=-1:(p.sort(function(a,b){return a-b}),m=n>>1,g[h]=n&1?p[m]:p[m-1]+p[m]>>1)}Co(a,b,d);return g}function Lo(a,b,c,d,e,g){if(b.component===d){b.component=c;var h,k;if(e)for(var l=b.Zb;l.next();){var m=l.value.toVertex;h=b.layer-m.layer;k=Do(l.value);h===k&&Lo(a,m,c,d,e,g)}if(g)for(l=b.hc;l.next();)m=l.value.fromVertex,h=m.layer-b.layer,k=Do(l.value),h===k&&Lo(a,m,c,d,e,g)}}
function Mo(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.Zb,k;h.next();)k=h.value.toVertex,Mo(a,k,c,d,e,g);if(g)for(b=b.hc;b.next();)h=b.value.fromVertex,Mo(a,h,c,d,e,g)}}function ho(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid)return b}return null}function io(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.Zb;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
function jo(a){for(a=a.vertexes.k;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.hc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function lo(a,b){b.Ko=a.rr;a.rr++;for(var c=b.Zb;c.next();){var d=c.value,e=d.toVertex;-1===e.Ko&&(d.forest=!0,lo(a,e))}b.finish=a.rr;a.rr++}
Jk.prototype.assignLayers=function(){switch(this.Xn){case No:Oo(this);break;case Po:for(var a,b=this.network.vertexes.k;b.next();)a=Qo(this,b.value),this.ob=Math.max(a,this.ob);for(b.reset();b.next();)a=b.value,a.layer=this.ob-a.layer;break;default:case $n:Oo(this);for(b=this.network.vertexes.k;b.next();)b.value.valid=!1;for(b.reset();b.next();)0===b.value.hc.count&&Ro(this,b.value);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.ob=-1;for(b.reset();b.next();)b.value.layer-=a,
this.ob=Math.max(this.ob,b.value.layer)}};function Oo(a){for(var b=a.network.vertexes.k;b.next();){var c=So(a,b.value);a.ob=Math.max(c,a.ob)}}function So(a,b){var c=0;if(-1===b.layer){for(var d=b.Zb;d.next();)var e=d.value,g=Do(e),c=Math.max(c,So(a,e.toVertex)+g);b.layer=c}else c=b.layer;return c}function Qo(a,b){var c=0;if(-1===b.layer){for(var d,e,g=b.hc;g.next();)e=g.value,d=Do(e),c=Math.max(c,Qo(a,e.fromVertex)+d);b.layer=c}else c=b.layer;return c}
function Ro(a,b){if(!b.valid){b.valid=!0;for(var c=b.Zb;c.next();)Ro(a,c.value.toVertex);for(c=a.network.vertexes.k;c.next();)c.value.component=-1;for(var d=b.$e.p,e=d.length,g=0;g<e;g++){var h=d[g],k=Do(h);h.fromVertex.layer-h.toVertex.layer>k&&Lo(a,h.fromVertex,0,-1,!0,!1)}for(Lo(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.k;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.$e.p,e=s.length,g=0;g<e;g++){var h=s[g],v=h.fromVertex,q=q+1;
1!==v.component&&(k+=1,v=v.layer-p.layer,h=Do(h),d=Math.min(d,v-h))}h=p.Qe.p;e=h.length;for(g=0;g<e;g++)s=h[g].toVertex,q-=1,1!==s.component?k-=1:r=!0;(null===m||q<l)&&!r&&(m=p,l=q)}}if(0<k){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else m.component=0}for(c=a.network.vertexes.k;c.next();)c.value.component=-1;for(Lo(a,b,1,-1,!0,!1);0!==b.component;){g=0;e=Infinity;d=0;k=null;for(l=a.network.vertexes.k;l.next();)if(m=l.value,1===m.component){n=0;p=!1;h=m.$e.p;q=h.length;
for(r=0;r<q;r++)s=h[r].fromVertex,n+=1,1!==s.component?g+=1:p=!0;h=m.Qe.p;q=h.length;for(r=0;r<q;r++)s=h[r],v=s.toVertex,n-=1,1!==v.component&&(g-=1,v=m.layer-v.layer,s=Do(s),e=Math.min(e,v-s));(null===k||n>d)&&!p&&(k=m,d=n)}if(0>g){for(c.reset();c.next();)g=c.value,1===g.component&&(g.layer-=e);b.component=0}else k.component=0}}}function Ao(a,b,c){return 90===a.sa?c&&!b.rev||!c&&b.rev?270:90:180===a.sa?c&&!b.rev||!c&&b.rev?0:180:270===a.sa?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
Jk.prototype.initializeIndices=function(){switch(this.Nn){default:case To:for(var a,b=this.network.vertexes.k;b.next();){var c=b.value;a=c.layer;c.index=this.Hd[a];this.Hd[a]++}break;case ao:b=this.network.vertexes.k;for(a=this.ob;0<=a;a--){for(;b.next();)b.value.layer===a&&-1===b.value.index&&Uo(this,b.value);b.reset()}break;case Vo:for(b=this.network.vertexes.k,a=0;a<=this.ob;a++){for(;b.next();)b.value.layer===a&&-1===b.value.index&&Wo(this,b.value);b.reset()}}};
function Uo(a,b){var c=b.layer;b.index=a.Hd[c];a.Hd[c]++;for(var c=b.Qe.af(),d=!0,e;d;)for(d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&Uo(a,d))}
function Wo(a,b){var c=b.layer;b.index=a.Hd[c];a.Hd[c]++;for(var c=b.$e.af(),d=!0,e;d;)for(d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&Wo(a,d))}
Jk.prototype.reduceCrossings=function(){var a=this.countCrossings(),b=Fo(this),c,d,e;for(c=0;c<this.Wl;c++){for(d=0;d<=this.ob;d++)Xo(this,d,1),Yo(this,d,1);e=this.countCrossings();e<a&&(a=e,b=Fo(this));for(d=this.ob;0<=d;d--)Xo(this,d,-1),Yo(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=Fo(this))}Go(this,b);for(c=0;c<this.Wl;c++){for(d=0;d<=this.ob;d++)Xo(this,d,0),Yo(this,d,0);e=this.countCrossings();e<a&&(a=e,b=Fo(this));for(d=this.ob;0<=d;d--)Xo(this,d,0),Yo(this,d,0);e=this.countCrossings();
e<a&&(a=e,b=Fo(this))}Go(this,b);var g,h,k;switch(this.nn){case Zo:break;case $o:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.ob;0<=c;c--)for(h=0;h<=c;h++){for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,-1)||g;e=this.countCrossings();e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,1)||g;e=this.countCrossings();e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Yo(this,d,1)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=
Yo(this,d,-1)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,0)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Yo(this,d,0)||g;e>=a?Go(this,b):(a=e,b=Fo(this))}break;default:case bo:for(c=this.ob,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,-1)||g;e=this.countCrossings();e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,1)||g;e=this.countCrossings();e>=a?Go(this,b):
(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Yo(this,d,1)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Yo(this,d,-1)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=Yo(this,d,0)||g;e>=a?Go(this,b):(a=e,b=Fo(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=Yo(this,d,0)||g;e>=a?Go(this,b):(a=e,b=Fo(this))}}Go(this,b)};
function Xo(a,b,c){f&&(t.o(b,Jk,"medianBarycenterCrossingReduction:unfixedLayer"),t.o(c,Jk,"medianBarycenterCrossingReduction:direction"));var d=Bo(a,b),e=a.Hd[b],g=Ko(a,b,c),h=Jo(a,b,c);for(c=0;c<e;c++)-1===h[c]&&(h[c]=d[c].column),-1===g[c]&&(g[c]=d[c].column);for(var k=!0,l;k;)for(k=!1,c=0;c<e-1;c++)if(g[c+1]<g[c]||g[c+1]===g[c]&&h[c+1]<h[c])k=!0,l=g[c],g[c]=g[c+1],g[c+1]=l,l=h[c],h[c]=h[c+1],h[c+1]=l,l=d[c],d[c]=d[c+1],d[c+1]=l;for(c=g=0;c<e;c++)l=d[c],l.index=c,g+=a.nodeMinColumnSpace(l,!0),
l.column=g,g+=1,g+=a.nodeMinColumnSpace(l,!1);Co(a,b,d)}
function Yo(a,b,c){var d=Bo(a,b),e=a.Hd[b];c=Ho(a,b,c);var g,h;h=[];for(g=0;g<e;g++)h[g]=-1;var k;k=[];for(g=0;g<e;g++)k[g]=-1;for(var l=!1,m=!0;m;)for(m=!1,g=0;g<e-1;g++){var n=c[d[g].index*e+d[g+1].index],p=c[d[g+1].index*e+d[g].index],q=0,r=0,s=d[g].column,v=d[g+1].column,x=a.nodeMinColumnSpace(d[g],!0),E=a.nodeMinColumnSpace(d[g],!1),F=a.nodeMinColumnSpace(d[g+1],!0),G=a.nodeMinColumnSpace(d[g+1],!1),x=s-x+F,E=v-E+G,L=d[g].hc.k;for(L.reset();L.next();)if(G=L.value,G.valid&&G.fromVertex.layer===
b){G=G.fromVertex;for(F=0;d[F]!==G;)F++;F<g&&(q+=2*(g-F),r+=2*(g+1-F));F===g+1&&(q+=1);F>g+1&&(q+=4*(F-g),r+=4*(F-(g+1)))}L=d[g].Zb.k;for(L.reset();L.next();)if(G=L.value,G.valid&&G.toVertex.layer===b){G=G.toVertex;for(F=0;d[F]!==G;)F++;F===g+1&&(r+=1)}L=d[g+1].hc.k;for(L.reset();L.next();)if(G=L.value,G.valid&&G.fromVertex.layer===b){G=G.fromVertex;for(F=0;d[F]!==G;)F++;F<g&&(q+=2*(g+1-F),r+=2*(g-F));F===g&&(r+=1);F>g+1&&(q+=4*(F-(g+1)),r+=4*(F-g))}L=d[g+1].Zb.k;for(L.reset();L.next();)if(G=L.value,
G.valid&&G.toVertex.layer===b){G=G.toVertex;for(F=0;d[F]!==G;)F++;F===g&&(q+=1)}var F=G=0,L=h[d[g].index],N=k[d[g].index],V=h[d[g+1].index],T=k[d[g+1].index];-1!==L&&(G+=Math.abs(L-s),F+=Math.abs(L-E));-1!==N&&(G+=Math.abs(N-s),F+=Math.abs(N-E));-1!==V&&(G+=Math.abs(V-v),F+=Math.abs(V-x));-1!==T&&(G+=Math.abs(T-v),F+=Math.abs(T-x));if(r<q-0.5||r===q&&p<n-0.5||r===q&&p===n&&F<G-0.5)m=l=!0,d[g].column=E,d[g+1].column=x,n=d[g],d[g]=d[g+1],d[g+1]=n}for(g=0;g<e;g++)d[g].index=g;Co(a,b,d);return l}
Jk.prototype.straightenAndPack=function(){var a,b,c=0!==(this.ri&ap);a=this.ri===co;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=0;a<=this.ob;a++)b[a]=0;for(var d=this.network.vertexes.k,e,g;d.next();)e=d.value,a=e.layer,g=e.column,e=this.nodeMinColumnSpace(e,!1),b[a]=Math.max(b[a],g+e);for(d.reset();d.next();)e=d.value,a=e.layer,g=e.column,e.column=(8*(this.Hb-b[a])>>1)+8*g;this.Hb*=8}if(0!==(this.ri&bp))for(b=!0;b;){b=!1;for(a=this.Af+1;a<=this.ob;a++)b=cp(this,a,1)||b;for(a=this.Af-
1;0<=a;a--)b=cp(this,a,-1)||b;b=cp(this,this.Af,0)||b}if(0!==(this.ri&dp)){for(a=this.Af+1;a<=this.ob;a++)ep(this,a,1);for(a=this.Af-1;0<=a;a--)ep(this,a,-1);ep(this,this.Af,0)}c&&(fp(this,-1),fp(this,1));if(0!==(this.ri&bp))for(b=!0;b;){b=!1;b=cp(this,this.Af,0)||b;for(a=this.Af+1;a<=this.ob;a++)b=cp(this,a,0)||b;for(a=this.Af-1;0<=a;a--)b=cp(this,a,0)||b}};function cp(a,b,c){f&&(t.o(b,Jk,"bendStraighten:unfixedLayer"),t.o(c,Jk,"bendStraighten:direction"));for(var d=!1;gp(a,b,c);)d=!0;return d}
function gp(a,b,c){f&&(t.o(b,Jk,"shiftbendStraighten:unfixedLayer"),t.o(c,Jk,"shiftbendStraighten:direction"));var d,e=Bo(a,b),g=a.Hd[b],h=Jo(a,b,-1);if(0<c)for(d=0;d<g;d++)h[d]=-1;var k=Jo(a,b,1);if(0>c)for(d=0;d<g;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<g;d++){var n=e[d].column,p=a.nodeMinColumnSpace(e[d],!0),q=a.nodeMinColumnSpace(e[d],!1),p=0>d-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,q=d+1>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,r=0,s=0,v=0,x,
E,F,G;if(0>=c)for(var L=e[d].hc.k;L.next();)x=L.value,x.valid&&x.fromVertex.layer!==b&&(E=Eo(x),F=x.portFromColOffset,G=x.portToColOffset,x=x.fromVertex.column,r+=(Math.abs(n+G-(x+F))+1)*E,s+=(Math.abs(p+G-(x+F))+1)*E,v+=(Math.abs(q+G-(x+F))+1)*E);if(0<=c)for(L=e[d].Zb.k;L.next();)x=L.value,x.valid&&x.toVertex.layer!==b&&(E=Eo(x),F=x.portFromColOffset,G=x.portToColOffset,x=x.toVertex.column,r+=(Math.abs(n+F-(x+G))+1)*E,s+=(Math.abs(p+F-(x+G))+1)*E,v+=(Math.abs(q+F-(x+G))+1)*E);G=F=E=0;x=h[e[d].index];
L=k[e[d].index];-1!==x&&(E+=Math.abs(x-n),F+=Math.abs(x-p),G+=Math.abs(x-q));-1!==L&&(E+=Math.abs(L-n),F+=Math.abs(L-p),G+=Math.abs(L-q));if(s<r||s===r&&F<E)m=l=!0,e[d].column=p;if(v<r||v===r&&G<E)m=l=!0,e[d].column=q}Co(a,b,e);a.normalize();return l}
function ep(a,b,c){f&&(t.o(b,Jk,"medianStraighten:unfixedLayer"),t.o(c,Jk,"medianStraighten:direction"));var d=Bo(a,b),e=a.Hd[b],g=Ko(a,b,c),h=[];for(c=0;c<e;c++)h[c]=g[c];for(g=!0;g;)for(g=!1,c=0;c<e;c++){var k=d[c].column,l=a.nodeMinColumnSpace(d[c],!0),m=a.nodeMinColumnSpace(d[c],!1),n=0,p;-1===h[c]?0===c&&c===e-1?n=k:0===c?(p=d[c+1].column,n=p-k===m+a.nodeMinColumnSpace(d[c+1],!0)?k-1:k):c===e-1?(p=d[c-1].column,n=k-p===l+a.nodeMinColumnSpace(d[c-1],!1)?k+1:k):(p=d[c-1].column,l=p+a.nodeMinColumnSpace(d[c-
1],!1)+l+1,p=d[c+1].column,m=p-a.nodeMinColumnSpace(d[c+1],!0)-m-1,n=(l+m)/2|0):0===c&&c===e-1?n=h[c]:0===c?(p=d[c+1].column,m=p-a.nodeMinColumnSpace(d[c+1],!0)-m-1,n=Math.min(h[c],m)):c===e-1?(p=d[c-1].column,l=p+a.nodeMinColumnSpace(d[c-1],!1)+l+1,n=Math.max(h[c],l)):(p=d[c-1].column,l=p+a.nodeMinColumnSpace(d[c-1],!1)+l+1,p=d[c+1].column,m=p-a.nodeMinColumnSpace(d[c+1],!0)-m-1,l<h[c]&&h[c]<m?n=h[c]:l>=h[c]?n=l:m<=h[c]&&(n=m));n!==k&&(g=!0,d[c].column=n)}Co(a,b,d);a.normalize()}
function hp(a,b){f&&(t.o(b,Jk,"packAux:column"),t.o(1,Jk,"packAux:direction"));for(var c=!0,d=a.network.vertexes.k,e;d.next();){e=d.value;var g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=b&&e.column+h>=b){c=!1;break}}g=!1;if(c)for(d.reset();d.next();)e=d.value,e.column>b&&(e.column-=1,g=!0);return g}
function ip(a,b){f&&(t.o(b,Jk,"tightPackAux:column"),t.o(1,Jk,"tightPackAux:direction"));var c=b,c=b+1,d,e=[],g=[];for(d=0;d<=a.ob;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.k;h.next();){d=h.value;var k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.ob;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)d=h.value,d.column>b&&(d.column-=1,c=!0);return c}
function fp(a,b){f&&t.o(b,Jk,"componentPack:direction");for(var c=0;c<=a.Hb;c++)for(;hp(a,c););a.normalize();for(c=0;c<a.Hb;c++)for(;ip(a,c););a.normalize();var d,e,g,h;if(0<b)for(c=0;c<=a.Hb;c++)for(d=Fo(a),e=Io(a),g=e+1;e<g;)g=e,jp(a,c,1),h=Io(a),h>e?Go(a,d):h<e&&(e=h,d=Fo(a));if(0>b)for(c=a.Hb;0<=c;c--)for(d=Fo(a),e=Io(a),g=e+1;e<g;)g=e,jp(a,c,-1),h=Io(a),h>e?Go(a,d):h<e&&(e=h,d=Fo(a));a.normalize()}
function jp(a,b,c){a.ag=0;for(var d=a.network.vertexes.k,e;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();)e=d.value,e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.ag);if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.ag);a.ag++;for(d.reset();d.next();)e=d.value,-1===e.component&&(Mo(a,e,a.ag,-1,!0,!0),a.ag++);b=[];for(e=0;e<a.ag*a.ag;e++)b[e]=!1;var g=[];for(e=0;e<(a.ob+1)*(a.Hb+1);e++)g[e]=-1;for(d.reset();d.next();){e=d.value;
for(var h=e.layer,k=Math.max(0,e.column-a.nodeMinColumnSpace(e,!0)),l=Math.min(a.Hb,e.column+a.nodeMinColumnSpace(e,!1));k<=l;k++)g[h*(a.Hb+1)+k]=e.component}for(e=0;e<=a.ob;e++){if(0<c)for(k=0;k<a.Hb;k++)-1!==g[e*(a.Hb+1)+k]&&-1!==g[e*(a.Hb+1)+k+1]&&g[e*(a.Hb+1)+k]!==g[e*(a.Hb+1)+k+1]&&(b[g[e*(a.Hb+1)+k]*a.ag+g[e*(a.Hb+1)+k+1]]=!0);if(0>c)for(k=a.Hb;0<k;k--)-1!==g[e*(a.Hb+1)+k]&&-1!==g[e*(a.Hb+1)+k-1]&&g[e*(a.Hb+1)+k]!==g[e*(a.Hb+1)+k-1]&&(b[g[e*(a.Hb+1)+k]*a.ag+g[e*(a.Hb+1)+k-1]]=!0)}g=[];for(e=
0;e<a.ag;e++)g[e]=!0;h=new H("number");for(h.add(0);0!==h.count;)if(l=h.p[h.count-1],h.gd(h.count-1),g[l])for(g[l]=!1,e=0;e<a.ag;e++)b[l*a.ag+e]&&h.Ad(0,e);if(0<c)for(d.reset();d.next();)e=d.value,g[e.component]&&(e.column-=1);if(0>c)for(d.reset();d.next();)e=d.value,g[e.component]&&(e.column+=1)}Jk.prototype.commitLayout=function(){if(this.vl)for(var a=uo(this,!0),b=uo(this,!1),c=this.network.edges.k,d;c.next();)d=c.value.link,null!==d&&(d.lb=a,d.mb=b);this.commitNodes();this.Vs&&this.commitLinks()};
function uo(a,b){return 270===a.sa?b?ac:dc:90===a.sa?b?dc:ac:180===a.sa?b?bc:cc:b?cc:bc}
Jk.prototype.commitNodes=function(){this.th=[];this.Kg=[];this.yf=[];this.Kd=[];for(var a=0;a<=this.ob;a++)this.th[a]=0,this.Kg[a]=0,this.yf[a]=0,this.Kd[a]=0;for(var a=this.network.vertexes.k,b,c;a.next();)b=a.value,c=b.layer,this.th[c]=Math.max(this.th[c],this.nodeMinLayerSpace(b,!0)),this.Kg[c]=Math.max(this.Kg[c],this.nodeMinLayerSpace(b,!1));b=0;for(var d=this.Wn,e=0;e<=this.ob;e++)c=d,0>=this.th[e]+this.Kg[e]&&(c=0),0<e&&(b+=c/2),90===this.sa||0===this.sa?(b+=this.Kg[e],this.yf[e]=b,b+=this.th[e]):
(b+=this.th[e],this.yf[e]=b,b+=this.Kg[e]),e<this.ob&&(b+=c/2),this.Kd[e]=b;d=this.zd;for(e=0;e<=this.ob;e++)270===this.sa?(this.yf[e]=d.y+this.yf[e],this.Kd[e]=d.y+this.Kd[e]):90===this.sa?(this.yf[e]=d.y+b-this.yf[e],this.Kd[e]=d.y+b-this.Kd[e]):180===this.sa?(this.yf[e]=d.x+this.yf[e],this.Kd[e]=d.x+this.Kd[e]):(this.yf[e]=d.x+b-this.yf[e],this.Kd[e]=d.x+b-this.Kd[e]);for(a.reset();a.next();){b=a.value;c=b.layer;var g=b.column|0;270===this.sa||90===this.sa?(e=d.x+this.Gd*g,c=this.yf[c]):(e=this.yf[c],
c=d.y+this.Gd*g);b.Fa=e;b.Sa=c;b.commit()}};
Jk.prototype.commitLinks=function(){for(var a=this.network.edges.k,b,c;a.next();)c=a.value.link,"undefined"!==typeof c&&null!==c&&(c.wl(),c.Eo(),c.Ii());for(a.reset();a.next();)c=a.value.link,"undefined"!==typeof c&&null!==c&&c.updateRoute();for(a.reset();a.next();)if(b=a.value,c=b.link){c.wl();var d=c,e=d.da,g=d.ja,h=d.Sc,k=d.Ed;if(b.valid){if(c.Ee===Qg&&4===c.ma){if(b.rev)var l=e,e=g,g=l,m=h,h=k,k=m;if(b.fromVertex.column===b.toVertex.column){var n=c.getLinkPoint(e,h,c.computeSpot(!0),!0,!1,g,k),
p=c.getLinkPoint(g,k,c.computeSpot(!1),!1,!1,e,h);c.Eo();c.Yk(n.x,n.y);c.Yk((2*n.x+p.x)/3,(2*n.y+p.y)/3);c.Yk((n.x+2*p.x)/3,(n.y+2*p.y)/3);c.Yk(p.x,p.y)}else{var q=!1,r=!1;null!==h&&c.computeSpot(!0)===Pb&&(q=!0);null!==k&&c.computeSpot(!1)===Pb&&(r=!0);if(q||r){var s=c.n(0).x,v=c.n(0).y,x=c.n(1).x,E=c.n(1).y,F=c.n(2).x,G=c.n(2).y,L=c.n(3).x,N=c.n(3).y;if(q){90===this.sa||270===this.sa?(x=s,E=(v+N)/2):(x=(s+L)/2,E=v);c.Y(1,x,E);var V=c.getLinkPoint(e,h,c.computeSpot(!0),!0,!1,g,k);c.Y(0,V.x,V.y)}r&&
(90===this.sa||270===this.sa?(F=L,G=(v+N)/2):(F=(s+L)/2,G=N),c.Y(2,F,G),V=c.getLinkPoint(g,k,c.computeSpot(!1),!1,!1,e,h),c.Y(3,V.x,V.y))}}}c.Ii()}else if(b.fromVertex.layer===b.toVertex.layer)c.Ii();else{var T=!1,W=!1,da,R=c.Ks+1;if(c.ac)W=!0,da=c.ma,4<da&&c.points.removeRange(2,da-3);else if(c.Ee===Qg)T=!0,da=c.ma,4<da&&c.points.removeRange(2,da-3),R=2;else{da=c.ma;var xa=c.computeSpot(!0)===Pb,Ja=c.computeSpot(!1)===Pb;2<da&&xa&&Ja?c.points.removeRange(1,da-2):3<da&&xa&&!Ja?c.points.removeRange(1,
da-3):3<da&&!xa&&Ja?c.points.removeRange(2,da-2):4<da&&!xa&&!Ja&&c.points.removeRange(2,da-3)}var Ma=b.fromVertex,Na=b.toVertex,ya,Ra;if(b.rev){for(var Ca;null!==Na&&Ma!==Na;){Ra=ya=null;for(var ob=Na.hc.k;ob.next()&&(ic=ob.value,ic.link!==b.link||(ya=ic.fromVertex,Ra=ic.toVertex,null!==ya.nd)););ya!==Ma&&(hb=c.n(R-1).x,ib=c.n(R-1).y,Ga=ya.Fa,Ka=ya.Sa,W?180===this.sa||0===this.sa?2===R?(c.C(R++,hb,ib),c.C(R++,hb,Ka)):(Hf=null!==Ra?Ra.Sa:ib,Hf!==Ka&&(bb=this.Kd[ya.layer-1],c.C(R++,bb,ib),c.C(R++,bb,
Ka))):2===R?(c.C(R++,hb,ib),c.C(R++,Ga,ib)):(fd=null!==Ra?Ra.Fa:hb,fd!==Ga&&(bb=this.Kd[ya.layer-1],c.C(R++,hb,bb),c.C(R++,Ga,bb))):2===R?T?(tb=Math.max(10,this.th[Na.layer]),Ya=Math.max(10,this.Kg[Na.layer]),180===this.sa?(Ca=Na.S.x,c.C(R++,Ca-tb,Ka),c.C(R++,Ca,Ka),c.C(R++,Ca+Ya,Ka)):90===this.sa?(Ca=Na.S.y+Na.S.height,c.C(R++,Ga,Ca+Ya),c.C(R++,Ga,Ca),c.C(R++,Ga,Ca-tb)):270===this.sa?(Ca=Na.S.y,c.C(R++,Ga,Ca-tb),c.C(R++,Ga,Ca),c.C(R++,Ga,Ca+Ya)):(Ca=Na.S.x+Na.S.width,c.C(R++,Ca+Ya,Ka),c.C(R++,Ca,
Ka),c.C(R++,Ca-tb,Ka))):(c.C(R++,hb,ib),180===this.sa||0===this.sa?c.C(R++,hb,Ka):c.C(R++,Ga,ib),c.C(R++,Ga,Ka)):(tb=Math.max(10,this.th[ya.layer]),Ya=Math.max(10,this.Kg[ya.layer]),180===this.sa?(T&&c.C(R++,Ga-tb,Ka),c.C(R++,Ga,Ka),T&&c.C(R++,Ga+Ya,Ka)):90===this.sa?(T&&c.C(R++,Ga,Ka+Ya),c.C(R++,Ga,Ka),T&&c.C(R++,Ga,Ka-tb)):270===this.sa?(T&&c.C(R++,Ga,Ka-tb),c.C(R++,Ga,Ka),T&&c.C(R++,Ga,Ka+Ya)):(T&&c.C(R++,Ga+Ya,Ka),c.C(R++,Ga,Ka),T&&c.C(R++,Ga-tb,Ka))));Na=ya}if(null===k||c.computeSpot(!1)!==Pb)if(hb=
c.n(R-1).x,ib=c.n(R-1).y,Ga=c.n(R).x,Ka=c.n(R).y,W){var kf=this.Kg[Ma.layer],hc;180===this.sa||0===this.sa?(hc=ib,hc>=Ma.S.y&&hc<=Ma.S.bottom&&(Ca=Ma.Fa+kf,hc=hc<Ma.S.y+Ma.S.height/2?Ma.S.y-this.Gd/2:Ma.S.bottom+this.Gd/2,c.C(R++,Ca,ib),c.C(R++,Ca,hc)),c.C(R++,Ga,hc)):(hc=hb,hc>=Ma.S.x&&hc<=Ma.S.right&&(Ca=Ma.Sa+kf,hc=hc<Ma.S.x+Ma.S.width/2?Ma.S.x-this.Gd/2:Ma.S.right+this.Gd/2,c.C(R++,hb,Ca),c.C(R++,hc,Ca)),c.C(R++,hc,Ka));c.C(R++,Ga,Ka)}else T?(tb=Math.max(10,this.th[Ma.layer]),Ya=Math.max(10,this.Kg[Ma.layer]),
180===this.sa?(Ca=Ma.S.x+Ma.S.width,c.Y(R-2,Ca,ib),c.Y(R-1,Ca+Ya,ib)):90===this.sa?(Ca=Ma.S.y,c.Y(R-2,hb,Ca),c.Y(R-1,hb,Ca-tb)):270===this.sa?(Ca=Ma.S.y+Ma.S.height,c.Y(R-2,hb,Ca),c.Y(R-1,hb,Ca+Ya)):(Ca=Ma.S.x,c.Y(R-2,Ca,ib),c.Y(R-1,Ca-tb,ib))):(180===this.sa||0===this.sa?c.C(R++,Ga,ib):c.C(R++,hb,Ka),c.C(R++,Ga,Ka))}else{for(;null!==Ma&&Ma!==Na;){Ra=ya=null;for(var lf=Ma.Zb.k,ic;lf.next()&&(ic=lf.value,ic.link!==b.link||(ya=ic.toVertex,Ra=ic.fromVertex,null!==Ra.nd&&(Ra=null),null!==ya.nd)););var hb,
ib,Ga,Ka,bb,tb,Ya;if(ya!==Na)if(hb=c.n(R-1).x,ib=c.n(R-1).y,Ga=ya.Fa,Ka=ya.Sa,W)if(180===this.sa||0===this.sa){var Hf=null!==Ra?Ra.Sa:ib;Hf!==Ka&&(bb=this.Kd[ya.layer],2===R&&(bb=0===this.sa?Math.max(bb,hb):Math.min(bb,hb)),c.C(R++,bb,ib),c.C(R++,bb,Ka))}else{var fd=null!==Ra?Ra.Fa:hb;fd!==Ga&&(bb=this.Kd[ya.layer],2===R&&(bb=90===this.sa?Math.max(bb,ib):Math.min(bb,ib)),c.C(R++,hb,bb),c.C(R++,Ga,bb))}else tb=Math.max(10,this.th[ya.layer]),Ya=Math.max(10,this.Kg[ya.layer]),180===this.sa?(c.C(R++,
Ga+Ya,Ka),T&&c.C(R++,Ga,Ka),c.C(R++,Ga-tb,Ka)):90===this.sa?(c.C(R++,Ga,Ka-tb),T&&c.C(R++,Ga,Ka),c.C(R++,Ga,Ka+Ya)):270===this.sa?(c.C(R++,Ga,Ka+Ya),T&&c.C(R++,Ga,Ka),c.C(R++,Ga,Ka-tb)):(c.C(R++,Ga-tb,Ka),T&&c.C(R++,Ga,Ka),c.C(R++,Ga+Ya,Ka));Ma=ya}W&&(hb=c.n(R-1).x,ib=c.n(R-1).y,Ga=c.n(R).x,Ka=c.n(R).y,180===this.sa||0===this.sa?ib!==Ka&&(bb=0===this.sa?Math.min(Math.max((Ga+hb)/2,this.Kd[Na.layer]),Ga):Math.max(Math.min((Ga+hb)/2,this.Kd[Na.layer]),Ga),c.C(R++,bb,ib),c.C(R++,bb,Ka)):hb!==Ga&&(bb=
90===this.sa?Math.min(Math.max((Ka+ib)/2,this.Kd[Na.layer]),Ka):Math.max(Math.min((Ka+ib)/2,this.Kd[Na.layer]),Ka),c.C(R++,hb,bb),c.C(R++,Ga,bb)))}if(null!==d&&T){if(null!==h){if(c.computeSpot(!0).qd()){var vd=c.n(0),Ed=c.n(2);vd.N(Ed)||c.Y(1,(vd.x+Ed.x)/2,(vd.y+Ed.y)/2)}V=c.getLinkPoint(e,h,Pb,!0,!1,g,k);c.Y(0,V.x,V.y)}null!==k&&(c.computeSpot(!1).qd()&&(vd=c.n(c.ma-1),Ed=c.n(c.ma-3),vd.N(Ed)||c.Y(c.ma-2,(vd.x+Ed.x)/2,(vd.y+Ed.y)/2)),V=c.getLinkPoint(g,k,Pb,!1,!1,e,h),c.Y(c.ma-1,V.x,V.y))}c.Ii();
b.commit()}}for(var Ud=new H(A),wd=this.network.edges.k,Vd;wd.next();)Vd=wd.value.link,null!==Vd&&Vd.ac&&!Ud.contains(Vd)&&Ud.add(Vd);if(0<Ud.count)if(90===this.sa||270===this.sa){for(var Dg=0,Cb=new H(kp),mf=Ud.k,Ib,ec,Kb;mf.next();)if(Ib=mf.value,null!==Ib&&Ib.ac)for(var Sa=2;Sa<Ib.ma-3;Sa++)if(ec=Ib.n(Sa),Kb=Ib.n(Sa+1),this.I(ec.y,Kb.y)&&!this.I(ec.x,Kb.x)){var jc=new kp;jc.layer=Math.floor(ec.y/2);var Ie=Ib.n(0),If=Ib.n(Ib.ma-1);jc.eb=Ie.x*Ie.x+Ie.y;jc.Wd=If.x*If.x+If.y;jc.Ce=Math.min(ec.x,Kb.x);
jc.Qd=Math.max(ec.x,Kb.x);jc.index=Sa;jc.link=Ib;if(Sa+2<Ib.ma){var fg=Ib.n(Sa-1),Fb=Ib.n(Sa+2),gd=0;fg.y<ec.y?gd=Fb.y<ec.y?3:ec.x<Kb.x?2:1:fg.y>ec.y&&(gd=Fb.y>ec.y?0:Kb.x<ec.x?2:1);jc.Th=gd}Cb.add(jc)}if(1<Cb.count){Cb.sort(this.sF);for(var qc=0;qc<Cb.count;){for(var hd=Cb.p[qc].layer,Za=qc+1;Za<Cb.count&&Cb.p[Za].layer===hd;)Za++;if(1<Za-qc)for(var fb=qc;fb<Za;){for(var Yb=Cb.p[fb].Qd,ub=qc+1;ub<Za&&Cb.p[ub].Ce<Yb;)Yb=Math.max(Yb,Cb.p[ub].Qd),ub++;var kc=ub-fb;if(1<kc){Cb.Hp(this.Lw,fb,fb+kc);for(var nf=
1,rc=Cb.p[fb].Wd,zb,Sa=fb;Sa<ub;Sa++)zb=Cb.p[Sa],zb.Wd!==rc&&(nf++,rc=zb.Wd);Cb.Hp(this.rF,fb,fb+kc);for(var Wd=1,rc=Cb.p[fb].eb,Sa=fb;Sa<ub;Sa++)zb=Cb.p[Sa],zb.eb!==rc&&(Wd++,rc=zb.eb);var Je,Ab;nf<Wd?(Je=!1,Ab=nf,rc=Cb.p[fb].Wd,Cb.Hp(this.Lw,fb,fb+kc)):(Je=!0,Ab=Wd,rc=Cb.p[fb].eb);for(var Fd=0,Sa=fb;Sa<ub;Sa++){zb=Cb.p[Sa];(Je?zb.eb:zb.Wd)!==rc&&(Fd++,rc=Je?zb.eb:zb.Wd);Ib=zb.link;ec=Ib.n(zb.index);Kb=Ib.n(zb.index+1);var Ke=this.kp*(Fd-(Ab-1)/2);if(!Ib.Si||lp(ec.x,ec.y+Ke,Kb.x,Kb.y+Ke))Dg++,Ib.wl(),
Ib.Y(zb.index,ec.x,ec.y+Ke),Ib.Y(zb.index+1,Kb.x,Kb.y+Ke),Ib.Ii()}}fb=ub}qc=Za}}}else{for(var me=0,gb=new H(kp),of=Ud.k,Bb,$a,Oc;of.next();)if(Bb=of.value,null!==Bb&&Bb.ac)for(var Lb=2;Lb<Bb.ma-3;Lb++)if($a=Bb.n(Lb),Oc=Bb.n(Lb+1),this.I($a.x,Oc.x)&&!this.I($a.y,Oc.y)){var Gd=new kp;Gd.layer=Math.floor($a.x/2);var Xd=Bb.n(0),Yd=Bb.n(Bb.ma-1);Gd.eb=Xd.x+Xd.y*Xd.y;Gd.Wd=Yd.x+Yd.y*Yd.y;Gd.Ce=Math.min($a.y,Oc.y);Gd.Qd=Math.max($a.y,Oc.y);Gd.index=Lb;Gd.link=Bb;if(Lb+2<Bb.ma){var ne=Bb.n(Lb-1),Pc=Bb.n(Lb+
2),xd=0;ne.x<$a.x?xd=Pc.x<$a.x?3:$a.y<Oc.y?2:1:ne.x>$a.x&&(xd=Pc.x>$a.x?0:Oc.y<$a.y?2:1);Gd.Th=xd}gb.add(Gd)}if(1<gb.count){gb.sort(this.sF);for(var jb=0;jb<gb.count;){for(var Le=gb.p[jb].layer,Me=jb+1;Me<gb.count&&gb.p[Me].layer===Le;)Me++;if(1<Me-jb)for(var mb=jb;mb<Me;){for(var oe=gb.p[mb].Qd,Db=jb+1;Db<Me&&gb.p[Db].Ce<oe;)oe=Math.max(oe,gb.p[Db].Qd),Db++;var lc=Db-mb;if(1<lc){gb.Hp(this.Lw,mb,mb+lc);for(var yd=1,sc=gb.p[mb].Wd,Mb,Lb=mb;Lb<Db;Lb++)Mb=gb.p[Lb],Mb.Wd!==sc&&(yd++,sc=Mb.Wd);gb.Hp(this.rF,
mb,mb+lc);for(var Ne=1,sc=gb.p[mb].eb,Lb=mb;Lb<Db;Lb++)Mb=gb.p[Lb],Mb.eb!==sc&&(Ne++,sc=Mb.eb);var kb,cb;yd<Ne?(kb=!1,cb=yd,sc=gb.p[mb].Wd,gb.Hp(this.Lw,mb,mb+lc)):(kb=!0,cb=Ne,sc=gb.p[mb].eb);for(var Jf=0,Lb=mb;Lb<Db;Lb++){Mb=gb.p[Lb];(kb?Mb.eb:Mb.Wd)!==sc&&(Jf++,sc=kb?Mb.eb:Mb.Wd);Bb=Mb.link;$a=Bb.n(Mb.index);Oc=Bb.n(Mb.index+1);var Dc=this.kp*(Jf-(cb-1)/2);if(!Bb.Si||lp($a.x+Dc,$a.y,Oc.x+Dc,Oc.y))me++,Bb.wl(),Bb.Y(Mb.index,$a.x+Dc,$a.y),Bb.Y(Mb.index+1,Oc.x+Dc,Oc.y),Bb.Ii()}}mb=Db}jb=Me}}}};
function kp(){this.index=this.Qd=this.Ce=this.Wd=this.eb=this.layer=0;this.link=null;this.Th=0}t.je(kp,{layer:!0,eb:!0,Wd:!0,Ce:!0,Qd:!0,index:!0,link:!0,Th:!0});Jk.prototype.sF=function(a,b){return a instanceof kp&&b instanceof kp&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Ce<b.Ce?-1:a.Ce>b.Ce?1:a.Qd<b.Qd?-1:a.Qd>b.Qd?1:0:0};
Jk.prototype.rF=function(a,b){return a instanceof kp&&b instanceof kp&&a!==b?a.eb<b.eb?-1:a.eb>b.eb||a.Th<b.Th?1:a.Th>b.Th||a.Ce<b.Ce?-1:a.Ce>b.Ce?1:a.Qd<b.Qd?-1:a.Qd>b.Qd?1:0:0};Jk.prototype.Lw=function(a,b){return a instanceof kp&&b instanceof kp&&a!==b?a.Wd<b.Wd?-1:a.Wd>b.Wd||a.Th<b.Th?1:a.Th>b.Th||a.Ce<b.Ce?-1:a.Ce>b.Ce?1:a.Qd<b.Qd?-1:a.Qd>b.Qd?1:0:0};Jk.prototype.I=function(a,b){f&&(t.o(a,Jk,"isApprox:a"),t.o(b,Jk,"isApprox:b"));var c=a-b;return-1<c&&1>c};
function lp(a,b,c,d){f&&(t.o(a,Jk,"isUnoccupied2:px"),t.o(b,Jk,"isUnoccupied2:py"),t.o(c,Jk,"isUnoccupied2:qx"),t.o(d,Jk,"isUnoccupied2:qy"));return!0}function Bo(a,b){var c,d=a.Hd[b];if(d>=a.Mg.length){c=[];var e;for(e=0;e<a.Mg.length;e++)c[e]=a.Mg[e];a.Mg=c}"undefined"===typeof a.Mg[d]||null===a.Mg[d]?c=[]:(c=a.Mg[d],a.Mg[d]=null);var d=a.sr[b],g;for(e=0;e<d.length;e++)g=d[e],g instanceof mp&&(c[g.index]=g);return c}function Co(a,b,c){a.Mg[a.Hd[b]]=c}t.g(Jk,"layerSpacing",Jk.prototype.layerSpacing);
t.defineProperty(Jk,{layerSpacing:"layerSpacing"},function(){return this.Wn},function(a){this.Wn!==a&&"number"===typeof a&&0<=a&&(this.Wn=a,this.K())});t.g(Jk,"columnSpacing",Jk.prototype.oH);t.defineProperty(Jk,{oH:"columnSpacing"},function(){return this.Gd},function(a){this.Gd!==a&&"number"===typeof a&&0<=a&&(this.Gd=a,this.K())});t.g(Jk,"direction",Jk.prototype.direction);
t.defineProperty(Jk,{direction:"direction"},function(){return this.sa},function(a){this.sa!==a&&"number"===typeof a&&(this.sa=a,this.K())});t.g(Jk,"cycleRemoveOption",Jk.prototype.BD);t.defineProperty(Jk,{BD:"cycleRemoveOption"},function(){return this.un},function(a){this.un!==a&&(f&&t.m(a,oa,eo,"cycleRemoveOption"),a===fo||a===Zn)&&(this.un=a,this.K())});t.g(Jk,"layeringOption",Jk.prototype.FE);
t.defineProperty(Jk,{FE:"layeringOption"},function(){return this.Xn},function(a){this.Xn!==a&&(f&&t.m(a,oa,eo,"layeringOption"),a===$n||a===No||a===Po)&&(this.Xn=a,this.K())});t.g(Jk,"initializeOption",Jk.prototype.vE);t.defineProperty(Jk,{vE:"initializeOption"},function(){return this.Nn},function(a){this.Nn!==a&&(f&&t.m(a,oa,eo,"initializeOption"),a===ao||a===Vo||a===To)&&(this.Nn=a,this.K())});t.g(Jk,"iterations",Jk.prototype.wI);
t.defineProperty(Jk,{wI:"iterations"},function(){return this.Wl},function(a){f&&t.o(a,eo,"iterations");this.Wl!==a&&"number"===typeof a&&0<=a&&(this.Wl=a,this.K())});t.g(Jk,"aggressiveOption",Jk.prototype.eD);t.defineProperty(Jk,{eD:"aggressiveOption"},function(){return this.nn},function(a){this.nn!==a&&(f&&t.m(a,oa,eo,"cycleRemoveOption"),a===Zo||a===bo||a===$o)&&(this.nn=a,this.K())});t.g(Jk,"packOption",Jk.prototype.RI);
t.defineProperty(Jk,{RI:"packOption"},function(){return this.ri},function(a){this.ri!==a&&"number"===typeof a&&0<=a&&8>a&&(this.ri=a,this.K())});t.g(Jk,"setsPortSpots",Jk.prototype.vl);t.defineProperty(Jk,{vl:"setsPortSpots"},function(){return this.wh},function(a){this.wh!==a&&"boolean"===typeof a&&(this.wh=a,this.K())});t.g(Jk,"linkSpacing",Jk.prototype.kp);t.defineProperty(Jk,{kp:"linkSpacing"},function(){return this.vj},function(a){this.vj!==a&&(this.vj=a,this.K())});t.A(Jk,{zJ:"maxLayer"},function(){return this.ob});
t.A(Jk,{xJ:"maxIndex"},function(){return this.Gu});t.A(Jk,{wJ:"maxColumn"},function(){return this.Hb});t.A(Jk,{AJ:"minIndexLayer"},function(){return this.lr});t.A(Jk,{yJ:"maxIndexLayer"},function(){return this.Af});var Zn;Jk.CycleDepthFirst=Zn=t.w(Jk,"CycleDepthFirst",0);var fo;Jk.CycleGreedy=fo=t.w(Jk,"CycleGreedy",1);var $n;Jk.LayerOptimalLinkLength=$n=t.w(Jk,"LayerOptimalLinkLength",0);var No;Jk.LayerLongestPathSink=No=t.w(Jk,"LayerLongestPathSink",1);var Po;
Jk.LayerLongestPathSource=Po=t.w(Jk,"LayerLongestPathSource",2);var ao;Jk.InitDepthFirstOut=ao=t.w(Jk,"InitDepthFirstOut",0);var Vo;Jk.InitDepthFirstIn=Vo=t.w(Jk,"InitDepthFirstIn",1);var To;Jk.InitNaive=To=t.w(Jk,"InitNaive",2);var Zo;Jk.AggressiveNone=Zo=t.w(Jk,"AggressiveNone",0);var bo;Jk.AggressiveLess=bo=t.w(Jk,"AggressiveLess",1);var $o;Jk.AggressiveMore=$o=t.w(Jk,"AggressiveMore",2);Jk.PackNone=0;var ap;Jk.PackExpand=ap=1;var bp;Jk.PackStraighten=bp=2;var dp;Jk.PackMedian=dp=4;var co;
Jk.PackAll=co=7;function eo(){Ba.call(this)}t.ia("LayeredDigraphNetwork",eo);t.Oa(eo,Ba);eo.prototype.createVertex=function(){return new mp};eo.prototype.createEdge=function(){return new np};function mp(){Da.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.Ko=NaN;this.ym=0;this.AA=this.BA=void 0}t.ia("LayeredDigraphVertex",mp);t.Oa(mp,Da);
function np(){Ea.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}t.ia("LayeredDigraphEdge",np);t.Oa(np,Ea);function Z(){0<arguments.length&&t.l("TreeLayout constructor cannot take any arguments.");ue.call(this);this.Oc=new ua(Object);this.ti=op;this.xf=pp;this.js=qp;this.hh=!0;this.jd=rp;this.Rf=(new pa(10,10)).freeze();this.ua=new sp;this.ta=new sp}t.ia("TreeLayout",Z);t.Oa(Z,ue);
Z.prototype.cloneProtected=function(a){ue.prototype.cloneProtected.call(this,a);a.ti=this.ti;a.js=this.js;a.hh=this.hh;a.jd=this.jd;a.Rf.assign(this.Rf);a.ua.copyInheritedPropertiesFrom(this.ua);a.ta.copyInheritedPropertiesFrom(this.ta)};Z.prototype.createNetwork=function(){var a=new tp;nn(a,this);return a};Z.prototype.makeNetwork=function(a){var b=this.createNetwork();a instanceof u?(up(this,b,a.Zi,!0),up(this,b,a.links,!0)):a instanceof z?up(this,b,a.Ic,!1):up(this,b,a.k,!1);return b};
function up(a,b,c,d){for(c=c.k;c.next();){var e=c.value;e instanceof y&&e.canLayout()&&"Comment"!==e.Qc&&(!d||e.dp)&&(e.Ih||(e instanceof z&&null===e.Tb?up(a,b,e.Ic,!1):b.vo(e)))}for(c.reset();c.next();)if(e=c.value,e instanceof A&&e.canLayout()&&"Comment"!==e.Qc&&(!d||e.dp)){var g=e.da;a=e.ja;null!==g&&null!==a&&g!==a&&"Comment"!==g.Qc&&"Comment"!==a.Qc&&(g=b.ew(g),a=b.ew(a),null!==g&&null!==a&&b.Um(g,a,e))}}
Z.prototype.doLayout=function(a){a||t.l("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.Oe!==vp&&(this.zd=this.iA(this.zd));var b=this.h;null===b&&a instanceof u&&(b=a);this.xf=this.path===op&&null!==b?b.fd?pp:wp:this.path===op?pp:this.path;if(0<this.network.vertexes.count){this.network.$v();for(b=this.network.vertexes.k;b.next();)a=b.value,a.initialized=!1,a.level=0,a.parent=null,
a.children=[];if(0<this.Oc.count)for(b=this.Oc.k,this.Oc=new ua(sp);b.next();)a=b.value,a instanceof y?(a=this.network.Mm(a),null!==a&&this.Oc.add(a)):a instanceof sp&&this.Oc.add(a);if(0===this.Oc.count){for(a=this.network.vertexes.k;a.next();)switch(b=a.value,this.xf){case pp:0===b.hc.count&&this.Oc.add(b);break;case wp:0===b.Zb.count&&this.Oc.add(b);break;default:t.l("Unhandled path value "+this.xf.toString())}if(0===this.Oc.count){a=999999;for(var b=null,c=this.network.vertexes.k;c.next();){var d=
c.value;switch(this.xf){case pp:d.hc.count<a&&(a=d.hc.count,b=d);break;case wp:d.Zb.count<a&&(a=d.Zb.count,b=d);break;default:t.l("Unhandled path value "+this.xf.toString())}}null!==b&&this.Oc.add(b)}}for(b=this.Oc.k;b.next();)a=b.value,a.initialized||(a.initialized=!0,xp(this,a));for(a=this.Oc.k;a.next();)yp(this,a.value);for(a=this.Oc.k;a.next();)zp(this,a.value);for(a=this.Oc.k;a.next();)Ap(this,a.value);this.Dz();for(a=this.Oc.k;a.next();)Bp(this,a.value);this.arrangeTrees();this.updateParts()}this.network=
null;this.Oc=new ua(Object);this.of=!0};
function xp(a,b){f&&t.m(b,sp,Z,"walkTree:v");if(null!==b){switch(a.xf){case pp:if(0<b.Zb.count){for(var c=new H(sp),d=b.FH;d.next();){var e=d.value;Cp(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.af())}break;case wp:if(0<b.hc.count){c=new H(sp);for(d=b.cJ;d.next();)e=d.value,Cp(a,b,e)&&c.add(e);0<c.count&&(b.children=c.af())}break;default:t.l("Unhandled path value"+a.xf.toString())}for(var c=b.children,d=c.length,g=0;g<d;g++)e=c[g],e.initialized=!0,e.level=b.level+1,e.parent=b,a.Oc.remove(e);for(g=0;g<
d;g++)e=c[g],xp(a,e)}}function Cp(a,b,c){f&&t.m(b,sp,Z,"walkOK:v");f&&t.m(c,sp,Z,"walkOK:c");if(c.initialized){var d;f&&t.m(c,sp,Z,"isAncestor:a");f&&t.m(b,sp,Z,"isAncestor:b");if(null===b)d=!1;else{for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}
Z.prototype.removeChild=function(a,b){f&&t.m(a,sp,Z,"removeChild:p");f&&t.m(b,sp,Z,"removeChild:c");if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){for(var d=Array(c.length-d),g=0,e=0;e<c.length;e++)c[e]!==b&&(d[g++]=c[e]);a.children=d}}};
function yp(a,b){f&&t.m(b,sp,Z,"initializeTree:v");if(null!==b){a.initializeTreeVertexValues(b);b.alignment===Dp&&a.sortTreeVertexChildren(b);for(var c=0,d=b.Cm,e=0,g=b.children,h=g.length,k=0;k<h;k++){var l=g[k];yp(a,l);c+=l.descendantCount+1;d=Math.max(d,l.maxChildrenCount);e=Math.max(e,l.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}}
function Ep(a,b){f&&t.m(b,sp,Z,"mom:v");switch(a.js){default:case qp:return null!==b.parent?b.parent:a.ua;case Fp:return null===b.parent?a.ua:null===b.parent.parent?a.ta:b.parent;case Gp:if(null!==b.parent)return null!==b.parent.parent?b.parent.parent:a.ta;case Hp:var c=!0;if(0===b.Cm)c=!1;else for(var d=b.children,e=d.length,g=0;g<e;g++)if(0<d[g].Cm){c=!1;break}return c&&null!==b.parent?a.ta:null!==b.parent?b.parent:a.ua}}
Z.prototype.initializeTreeVertexValues=function(a){f&&t.m(a,sp,Z,"initializeTreeVertexValues:v");var b=Ep(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===Dp){for(var b=a.angle,c=a.parent.children,d=0;d<c.length&&a!==c[d];)d++;0===d%2?d!==c.length-1&&(b=90===b?180:180===b?270:270===b?180:270):b=90===b?0:180===b?90:270===b?0:90;a.angle=b}a.initialized=!0};
function zp(a,b){f&&t.m(b,sp,Z,"assignTree:v");if(null!==b){a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)zp(a,c[e])}}Z.prototype.assignTreeVertexValues=function(){};function Ap(a,b){f&&t.m(b,sp,Z,"sortTree:v");if(null!==b){b.alignment!==Dp&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Ap(a,c[e])}}
Z.prototype.sortTreeVertexChildren=function(a){f&&t.m(a,sp,Z,"sortTreeVertexChildren:v");switch(a.sorting){case Ip:break;case Jp:a.children.reverse();break;case Kp:a.children.sort(a.comparer);break;case Lp:a.children.sort(a.comparer);a.children.reverse();break;default:t.l("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.Dz=function(){if(this.comments)for(var a=this.network.vertexes.k;a.next();)this.addComments(a.value)};
Z.prototype.addComments=function(a){f&&t.m(a,sp,Z,"addComments:v");var b=a.angle,c=a.parent,d=0,e=Mp,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=Np(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.Cm,g=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Jc)for(var m=a.Jc.WD();m.next();){var n=m.value;"Comment"===n.Qc&&n.zb()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.Gf(),n=n.Ea,b&&!c||!e&&!d&&c||e&&d&&c?(g=Math.max(g,n.width),h+=n.height+Math.abs(k)):(g+=n.width+Math.abs(k),h=Math.max(h,n.height)),
k=l)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(g+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),g=Math.max(0,g-a.width)),e=t.lk(0,0,a.S.width+g,a.S.height+h),a.Mb=e,t.Rc(e))};function Np(a){return a===Op||a===Dp||a===Pp||a===Qp}function Rp(a){return a===Op||a===Dp}
function Sp(a){f&&t.m(a,sp,Z,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(Np(c)){if(Rp(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===Pp)return!0}}return!1}
Z.prototype.layoutComments=function(a){f&&t.m(a,sp,Z,"layoutComments:v");if(null!==a.comments){var b=a.Jc.Ea,c=a.parent,d=a.angle,e=0,g=Mp,g=!1;null!==c&&(e=c.angle,g=c.alignment,g=Np(g));for(var d=90===d||270===d,h=90===e||270===e,k=0===a.Cm,l=Sp(a),m=0,n=a.comments,p=n.length,q=t.O(),r=0;r<p;r++){var c=n[r],s=c.Ea;if(d&&!k||!g&&!h&&k||g&&h&&k){if(135<e&&!g||h&&l)if(0<=a.commentMargin){q.q(a.S.x-a.commentMargin-s.width,a.S.y+m);c.location=q;for(var v=c.mg();v.next();)c=v.value,c.lb=bc,c.mb=cc}else for(q.q(a.S.x+
2*a.P.x-a.commentMargin,a.S.y+m),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=cc,c.mb=bc;else if(0<=a.commentMargin)for(q.q(a.S.x+2*a.P.x+a.commentMargin,a.S.y+m),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=cc,c.mb=bc;else for(q.q(a.S.x+a.commentMargin-s.width,a.S.y+m),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=bc,c.mb=cc;m=0<=a.commentSpacing?m+(s.height+a.commentSpacing):m+(a.commentSpacing-s.height)}else{if(135<e&&!g||!h&&l)if(0<=a.commentMargin)for(q.q(a.S.x+m,a.S.y-a.commentMargin-s.height),
c.location=q,v=c.mg();v.next();)c=v.value,c.lb=ac,c.mb=dc;else for(q.q(a.S.x+m,a.S.y+2*a.P.y-a.commentMargin),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=dc,c.mb=ac;else if(0<=a.commentMargin)for(q.q(a.S.x+m,a.S.y+2*a.P.y+a.commentMargin),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=dc,c.mb=ac;else for(q.q(a.S.x+m,a.S.y+a.commentMargin-s.height),c.location=q,v=c.mg();v.next();)c=v.value,c.lb=ac,c.mb=dc;m=0<=a.commentSpacing?m+(s.width+a.commentSpacing):m+(a.commentSpacing-s.width)}}t.B(q);b=
m-a.commentSpacing-(d?b.height:b.width);if(this.xf===pp)for(a=a.Zb;a.next();)e=a.value,(c=e.link)&&!c.Si&&(c.ek=0<b?b:NaN);else for(a=a.hc;a.next();)e=a.value,(c=e.link)&&!c.Si&&(c.mk=0<b?b:NaN)}};
function Bp(a,b){f&&t.m(b,sp,Z,"layoutTree:v");if(null!==b){for(var c=b.children,d=c.length,e=0;e<d;e++)Bp(a,c[e]);switch(b.compaction){case Tp:Up(a,b);break;case Vp:if(b.alignment===Dp)Up(a,b);else if(f&&t.m(b,sp,Z,"layoutTreeBlock:v"),0===b.Cm){var e=b.parent,c=!1,d=0,g=Mp;null!==e&&(d=e.angle,g=e.alignment,c=Np(g));e=Sp(b);b.la.q(0,0);b.Ya.q(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Ma.q(0,0):180===d&&!c||(90===d||270===d)&&e?b.Ma.q(b.width-2*b.P.x,0):b.Ma.q(0,
b.height-2*b.P.y);b.Ys=null;b.qt=null}else{for(var h=Wp(b),c=90===h||270===h,k=0,l=b.children,m=l.length,n=0;n<m;n++)var p=l[n],k=Math.max(k,c?p.Ya.width:p.Ya.height);var q=b.alignment,e=q===Xp,r=q===Yp,s=Np(q),v=Math.max(0,b.breadthLimit),d=Zp(b),x=b.nodeSpacing,E=$p(b),F=b.rowSpacing,G=0;if(e||r||b.Ap||b.Bp&&1===b.maxGenerationCount)G=Math.max(0,b.rowIndent);var e=b.width,g=b.height,L=0,N=0,V=0,T=null,W=null,da=0,R=0,xa=0,Ja=0,Ma=0,Na=0,ya=0,Ra=0,p=0;s&&!Rp(q)&&135<h&&l.reverse();if(Rp(q))if(1<
m)for(n=0;n<m;n++)0===n%2&&n!==m-1?Ra=Math.max(Ra,c?l[n].Ya.width:l[n].Ya.height):0!==n%2&&(p=Math.max(p,c?l[n].Ya.width:l[n].Ya.height));else 1===m&&(Ra=c?l[0].Ya.width:l[0].Ya.height);if(s){switch(q){case Op:R=135>h?aq(b,l,Ra,L,N):bq(b,l,Ra,L,N);Ra=R[0];L=R[1];N=R[2];break;case Pp:for(n=0;n<m;n++){var p=l[n],Ca=p.Ya,T=0===Na?0:F;c?(p.la.q(k-Ca.width,Ja+T),L=Math.max(L,Ca.width),N=Math.max(N,Ja+T+Ca.height),Ja+=T+Ca.height):(p.la.q(xa+T,k-Ca.height),L=Math.max(L,xa+T+Ca.width),N=Math.max(N,Ca.height),
xa+=T+Ca.width);Na++}break;case Qp:for(n=0;n<m;n++)p=l[n],Ca=p.Ya,T=0===Na?0:F,c?(p.la.q(x/2+b.P.x,Ja+T),L=Math.max(L,Ca.width),N=Math.max(N,Ja+T+Ca.height),Ja+=T+Ca.height):(p.la.q(xa+T,x/2+b.P.y),L=Math.max(L,xa+T+Ca.width),N=Math.max(N,Ca.height),xa+=T+Ca.width),Na++}T=cq(a,2);W=cq(a,2);c?(T[0].q(0,0),T[1].q(0,N),W[0].q(L,0)):(T[0].q(0,0),T[1].q(L,0),W[0].q(0,N));W[1].q(L,N)}else for(n=0;n<m;n++){p=l[n];Ca=p.Ya;if(c){0<v&&0<Na&&xa+x+Ca.width>v&&(xa<k&&dq(b,q,k-xa,0,ya,n-1),Ma++,Na=0,ya=n,V=N,xa=
0,Ja=135<h?-N-F:N+F);eq(a,p,0,Ja);var ob=0;if(0===Na){if(T=p.Ys,W=p.qt,da=Ca.width,R=Ca.height,null===T||null===W||h!==Wp(p))T=cq(a,2),W=cq(a,2),T[0].q(0,0),T[1].q(0,R),W[0].q(da,0),W[1].q(da,R)}else R=fq(a,b,p,T,W,da,R),ob=R[0],T=R[1],W=R[2],da=R[3],R=R[4],xa<Ca.width&&0>ob&&(gq(b,-ob,0,ya,n-1),hq(T,-ob,0),hq(W,-ob,0),ob=0);p.la.q(ob,Ja);L=Math.max(L,da);N=Math.max(N,V+(0===Ma?0:F)+Ca.height);xa=da}else{0<v&&0<Na&&Ja+x+Ca.height>v&&(Ja<k&&dq(b,q,0,k-Ja,ya,n-1),Ma++,Na=0,ya=n,V=L,Ja=0,xa=135<h?-L-
F:L+F);eq(a,p,xa,0);ob=0;if(0===Na){if(T=p.Ys,W=p.qt,da=Ca.width,R=Ca.height,null===T||null===W||h!==Wp(p))T=cq(a,2),W=cq(a,2),T[0].q(0,0),T[1].q(da,0),W[0].q(0,R),W[1].q(da,R)}else R=fq(a,b,p,T,W,da,R),ob=R[0],T=R[1],W=R[2],da=R[3],R=R[4],Ja<Ca.height&&0>ob&&(gq(b,0,-ob,ya,n-1),hq(T,0,-ob),hq(W,0,-ob),ob=0);p.la.q(xa,ob);N=Math.max(N,R);L=Math.max(L,V+(0===Ma?0:F)+Ca.width);Ja=R}Na++}0<Ma&&(c?(N+=Math.max(0,d),xa<L&&dq(b,q,L-xa,0,ya,m-1),0<G&&(r||gq(b,G,0,0,m-1),L+=G)):(L+=Math.max(0,d),Ja<N&&dq(b,
q,0,N-Ja,ya,m-1),0<G&&(r||gq(b,0,G,0,m-1),N+=G)));r=k=0;switch(q){case iq:c?k+=L/2-b.P.x-E/2:r+=N/2-b.P.y-E/2;break;case Mp:0<Ma?c?k+=L/2-b.P.x-E/2:r+=N/2-b.P.y-E/2:c?(n=l[0].la.x+l[0].Ma.x,Ra=l[m-1].la.x+l[m-1].Ma.x+2*l[m-1].P.x,k+=n+(Ra-n)/2-b.P.x-E/2):(n=l[0].la.y+l[0].Ma.y,Ra=l[m-1].la.y+l[m-1].Ma.y+2*l[m-1].P.y,r+=n+(Ra-n)/2-b.P.y-E/2);break;case Xp:c?(k-=E,L+=E):(r-=E,N+=E);break;case Yp:c?(k+=L-b.width+E,L+=E):(r+=N-b.height+E,N+=E);break;case Op:c?k=1<m?k+(Ra+x/2-b.P.x):k+(l[0].P.x-b.P.x+
l[0].Ma.x):r=1<m?r+(Ra+x/2-b.P.y):r+(l[0].P.y-b.P.y+l[0].Ma.y);break;case Pp:c?k+=L+x/2-b.P.x:r+=N+x/2-b.P.y;break;case Qp:break;default:t.l("Unhandled alignment value "+q.toString())}for(n=0;n<m;n++)p=l[n],c?p.la.q(p.la.x+p.Ma.x-k,p.la.y+(135<h?(s?-N:-p.Ya.height)+p.Ma.y-d:g+d+p.Ma.y)):p.la.q(p.la.x+(135<h?(s?-L:-p.Ya.width)+p.Ma.x-d:e+d+p.Ma.x),p.la.y+p.Ma.y-r);m=l=0;s?c?(L=jq(b,L,k),0>k&&(k=0),135<h&&(r+=N+d),N+=g+d,q===Qp&&(l+=x/2+b.P.x),m+=g+d):(135<h&&(k+=L+d),L+=e+d,N=kq(b,N,r),0>r&&(r=0),
q===Qp&&(m+=x/2+b.P.y),l+=e+d):c?(null===b.comments?e>L&&(q=lq(q,e-L,0),l=q[0],m=q[1],L=e,k=0):L=jq(b,L,k),0>k&&(l-=k,k=0),135<h&&(r+=N+d),N=Math.max(Math.max(N,g),N+g+d),m+=g+d):(135<h&&(k+=L+d),L=Math.max(Math.max(L,e),L+e+d),null===b.comments?g>N&&(q=lq(q,0,g-N),l=q[0],m=q[1],N=g,r=0):N=kq(b,N,r),0>r&&(m-=r,r=0),l+=e+d);if(0<Ma)h=cq(a,4),q=cq(a,4),c?(h[2].q(0,g+d),h[3].q(h[2].x,N),q[2].q(L,h[2].y),q[3].q(q[2].x,h[3].y)):(h[2].q(e+d,0),h[3].q(L,h[2].y),q[2].q(h[2].x,N),q[3].q(h[3].x,q[2].y));else{h=
cq(a,T.length+2);q=cq(a,W.length+2);for(n=0;n<T.length;n++)s=T[n],h[n+2].q(s.x+l,s.y+m);for(n=0;n<W.length;n++)s=W[n],q[n+2].q(s.x+l,s.y+m)}c?(h[0].q(k,0),h[1].q(h[0].x,g),h[2].y<h[1].y&&(h[2].x>h[0].x?h[2].assign(h[1]):h[1].assign(h[2])),h[3].y<h[2].y&&(h[3].x>h[0].x?h[3].assign(h[2]):h[2].assign(h[3])),q[0].q(k+e,0),q[1].q(q[0].x,g),q[2].y<q[1].y&&(q[2].x<q[0].x?q[2].assign(q[1]):q[1].assign(q[2])),q[3].y<q[2].y&&(q[3].x<q[0].x?q[3].assign(q[2]):q[2].assign(q[3])),h[2].y-=d/2,q[2].y-=d/2):(h[0].q(0,
r),h[1].q(e,h[0].y),h[2].x<h[1].x&&(h[2].y>h[0].y?h[2].assign(h[1]):h[1].assign(h[2])),h[3].x<h[2].x&&(h[3].y>h[0].y?h[3].assign(h[2]):h[2].assign(h[3])),q[0].q(0,r+g),q[1].q(e,q[0].y),q[2].x<q[1].x&&(q[2].y<q[0].y?q[2].assign(q[1]):q[1].assign(q[2])),q[3].x<q[2].x&&(q[3].y<q[0].y?q[3].assign(q[2]):q[2].assign(q[3])),h[2].x-=d/2,q[2].x-=d/2);mq(a,T);mq(a,W);b.Ys=h;b.qt=q;b.Ma.q(k,r);b.Ya.q(L,N)}break;default:t.l("Unhandled compaction value "+b.compaction.toString())}}}
function Up(a,b){f&&t.m(b,sp,Z,"layoutTreeNone:v");if(0===b.Cm){var c=!1,d=0,e=Mp;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=Np(e));e=Sp(b);b.la.q(0,0);b.Ya.q(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Ma.q(0,0):180===d&&!c||(90===d||270===d)&&e?b.Ma.q(b.width-2*b.P.x,0):b.Ma.q(0,b.height-2*b.P.y)}else{for(var c=Wp(b),d=90===c||270===c,g=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],g=Math.max(g,d?l.Ya.width:l.Ya.height);var m=b.alignment,n=
m===Xp,p=m===Yp,q=Np(m),r=Math.max(0,b.breadthLimit),s=Zp(b),v=b.nodeSpacing,x=$p(b),E=n||p?0:x/2,F=b.rowSpacing,G=0;if(n||p||b.Ap||b.Bp&&1===b.maxGenerationCount)G=Math.max(0,b.rowIndent);var n=b.width,L=b.height,N=0,V=0,T=0,W=0,da=0,R=0,xa=0,Ja=0,Ma=0,Na=0;q&&!Rp(m)&&135<c&&e.reverse();if(Rp(m))if(1<h)for(k=0;k<h;k++){var l=e[k],ya=l.Ya;0===k%2&&k!==h-1?Ma=Math.max(Ma,(d?ya.width:ya.height)+nq(l)-v):0!==k%2&&(Na=Math.max(Na,(d?ya.width:ya.height)+nq(l)-v))}else 1===h&&(Ma=d?e[0].Ya.width:e[0].Ya.height);
if(q)switch(m){case Op:case Dp:V=135>c?aq(b,e,Ma,N,V):bq(b,e,Ma,N,V);Ma=V[0];N=V[1];V=V[2];break;case Pp:for(k=0;k<h;k++)l=e[k],ya=l.Ya,r=0===xa?0:F,d?(l.la.q(g-ya.width,da+r),N=Math.max(N,ya.width),V=Math.max(V,da+r+ya.height),da+=r+ya.height):(l.la.q(W+r,g-ya.height),N=Math.max(N,W+r+ya.width),V=Math.max(V,ya.height),W+=r+ya.width),xa++;break;case Qp:for(g=0;g<h;g++)l=e[g],ya=l.Ya,r=0===xa?0:F,d?(l.la.q(v/2+b.P.x,da+r),N=Math.max(N,ya.width),V=Math.max(V,da+r+ya.height),da+=r+ya.height):(l.la.q(W+
r,v/2+b.P.y),N=Math.max(N,W+r+ya.width),V=Math.max(V,ya.height),W+=r+ya.width),xa++}else for(k=0;k<h;k++)l=e[k],ya=l.Ya,d?(0<r&&0<xa&&W+v+ya.width>r&&(W<g&&dq(b,m,g-W,0,Ja,k-1),R++,xa=0,Ja=k,T=V,W=0,da=135<c?-V-F:V+F),Na=0===xa?E:v,eq(a,l,0,da),l.la.q(W+Na,da),N=Math.max(N,W+Na+ya.width),V=Math.max(V,T+(0===R?0:F)+ya.height),W+=Na+ya.width):(0<r&&0<xa&&da+v+ya.height>r&&(da<g&&dq(b,m,0,g-da,Ja,k-1),R++,xa=0,Ja=k,T=N,da=0,W=135<c?-N-F:N+F),Na=0===xa?E:v,eq(a,l,W,0),l.la.q(W,da+Na),V=Math.max(V,da+
Na+ya.height),N=Math.max(N,T+(0===R?0:F)+ya.width),da+=Na+ya.height),xa++;0<R&&(d?(V+=Math.max(0,s),W<N&&dq(b,m,N-W,0,Ja,h-1),0<G&&(p||gq(b,G,0,0,h-1),N+=G)):(N+=Math.max(0,s),da<V&&dq(b,m,0,V-da,Ja,h-1),0<G&&(p||gq(b,0,G,0,h-1),V+=G)));G=p=0;switch(m){case iq:d?p+=N/2-b.P.x-x/2:G+=V/2-b.P.y-x/2;break;case Mp:0<R?d?p+=N/2-b.P.x-x/2:G+=V/2-b.P.y-x/2:d?(m=e[0].la.x+e[0].Ma.x,v=e[h-1].la.x+e[h-1].Ma.x+2*e[h-1].P.x,p+=m+(v-m)/2-b.P.x-x/2):(m=e[0].la.y+e[0].Ma.y,v=e[h-1].la.y+e[h-1].Ma.y+2*e[h-1].P.y,
G+=m+(v-m)/2-b.P.y-x/2);break;case Xp:d?(p-=x,N+=x):(G-=x,V+=x);break;case Yp:d?(p+=N-b.width+x,N+=x):(G+=V-b.height+x,V+=x);break;case Op:case Dp:d?p=1<h?p+(Ma+v/2-b.P.x):p+(e[0].P.x-b.P.x+e[0].Ma.x):G=1<h?G+(Ma+v/2-b.P.y):G+(e[0].P.y-b.P.y+e[0].Ma.y);break;case Pp:d?p+=N+v/2-b.P.x:G+=V+v/2-b.P.y;break;case Qp:break;default:t.l("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.la.q(l.la.x+l.Ma.x-p,l.la.y+(135<c?(q?-V:-l.Ya.height)+l.Ma.y-s:L+s+l.Ma.y)):l.la.q(l.la.x+(135<c?(q?
-N:-l.Ya.width)+l.Ma.x-s:n+s+l.Ma.x),l.la.y+l.Ma.y-G);d?(N=jq(b,N,p),0>p&&(p=0),135<c&&(G+=V+s),V+=L+s):(135<c&&(p+=N+s),N+=n+s,V=kq(b,V,G),0>G&&(G=0));b.Ma.q(p,G);b.Ya.q(N,V)}}
function aq(a,b,c,d,e){f&&t.m(a,sp,Z,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return a=[],a[0]=c,a[1]=d,a[2]=e,a;if(1===g){var h=b[0];d=h.Ya.width;e=h.Ya.height;a=[];a[0]=c;a[1]=d;a[2]=e;return a}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Wp(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.Ya,v=0===n?0:l;if(m){var x=nq(h)-k;h.la.q(c-(s.width+x),q+v);d=Math.max(d,s.width+x);e=Math.max(e,q+v+s.height);q+=v+s.height}else x=nq(h)-k,h.la.q(p+v,c-(s.height+x)),e=Math.max(e,
s.height+x),d=Math.max(d,p+v+s.width),p+=v+s.width;n++}var n=0,E=p,F=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.Ya,v=0===n?0:l,m?(x=nq(h)-k,h.la.q(p+x,q+v),d=Math.max(d,p+s.width+x),e=Math.max(e,q+v+s.height),q+=v+s.height):(x=nq(h)-k,h.la.q(p+v,q+x),d=Math.max(d,p+v+s.width),e=Math.max(e,q+s.height+x),p+=v+s.width),n++);1<g&&1===g%2&&(h=b[g-1],s=h.Ya,b=oq(h,m?Math.max(Math.abs(F),Math.abs(q)):Math.max(Math.abs(E),Math.abs(p))),m?(h.la.q(c+k/2-h.P.x-h.Ma.x,e+b),m=c+k/2-h.P.x-
h.Ma.x,d=Math.max(d,m+s.width),0>m&&(d-=m),e=Math.max(e,Math.max(F,q)+b+s.height),0>h.la.x&&(c=uq(a,h.la.x,!1,c,k))):(h.la.q(d+b,c+k/2-h.P.y-h.Ma.y),d=Math.max(d,Math.max(E,p)+b+s.width),m=c+k/2-h.P.y-h.Ma.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.la.y&&(c=uq(a,h.la.y,!0,c,k))));a=[];a[0]=c;a[1]=d;a[2]=e;return a}
function bq(a,b,c,d,e){f&&t.m(a,sp,Z,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return a=[],a[0]=c,a[1]=d,a[2]=e,a;if(1===g){var h=b[0];d=h.Ya.width;e=h.Ya.height;a=[];a[0]=c;a[1]=d;a[2]=e;return a}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Wp(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.Ya,v=0===n?0:l;if(m){var x=nq(h)-k,q=q-(v+s.height);h.la.q(c-(s.width+x),q);d=Math.max(d,s.width+x);e=Math.max(e,Math.abs(q))}else x=nq(h)-k,p-=v+s.width,h.la.q(p,c-(s.height+
x)),e=Math.max(e,s.height+x),d=Math.max(d,Math.abs(p));n++}var n=0,E=p,F=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.Ya,v=0===n?0:l,m?(x=nq(h)-k,q-=v+s.height,h.la.q(p+x,q),d=Math.max(d,p+s.width+x),e=Math.max(e,Math.abs(q))):(x=nq(h)-k,p-=v+s.width,h.la.q(p,q+x),e=Math.max(e,q+s.height+x),d=Math.max(d,Math.abs(p))),n++);1<g&&1===g%2&&(h=b[g-1],s=h.Ya,l=oq(h,m?Math.max(Math.abs(F),Math.abs(q)):Math.max(Math.abs(E),Math.abs(p))),m?(h.la.q(c+k/2-h.P.x-h.Ma.x,-e-s.height-l),p=c+
k/2-h.P.x-h.Ma.x,d=Math.max(d,p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(F,q))+l+s.height),0>h.la.x&&(c=uq(a,h.la.x,!1,c,k))):(h.la.q(-d-s.width-l,c+k/2-h.P.y-h.Ma.y),d=Math.max(d,Math.abs(Math.min(E,p))+l+s.width),p=c+k/2-h.P.y-h.Ma.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.la.y&&(c=uq(a,h.la.y,!0,c,k))));for(r=0;r<g;r++)h=b[r],m?h.la.q(h.la.x,h.la.y+e):h.la.q(h.la.x+d,h.la.y);a=[];a[0]=c;a[1]=d;a[2]=e;return a}
function nq(a){f&&t.m(a,sp,Z,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}function oq(a){f&&t.m(a,sp,Z,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function uq(a,b,c,d,e){f&&t.m(a,sp,Z,"fixRelativePostions:v");a=a.children;for(var g=a.length,h=0;h<g;h++)c?a[h].la.q(a[h].la.x,a[h].la.y-b):a[h].la.q(a[h].la.x-b,a[h].la.y);b=a[g-1];return Math.max(d,c?b.Ma.y+b.P.y-e/2:b.Ma.x+b.P.x-e/2)}
function jq(a,b,c){f&&t.m(a,sp,Z,"calculateSubwidth:v");switch(a.alignment){case Mp:case iq:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case Xp:return a.width>b?a.width:b;case Yp:return 2*a.P.x>b?a.width:b+a.width-2*a.P.x;case Op:case Dp:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Pp:return a.width-a.P.x+a.nodeSpacing/2+b;case Qp:return Math.max(a.width,a.P.x+a.nodeSpacing/2+b);default:return b}}
function kq(a,b,c){f&&t.m(a,sp,Z,"calculateSubheight:v");switch(a.alignment){case Mp:case iq:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Xp:return a.height>b?a.height:b;case Yp:return 2*a.P.y>b?a.height:b+a.height-2*a.P.y;case Op:case Dp:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Pp:return a.height-a.P.y+a.nodeSpacing/2+b;case Qp:return Math.max(a.height,a.P.y+a.nodeSpacing/2+b);default:return b}}
function lq(a,b,c){f&&t.m(a,oa,Z,"alignOffset:align");switch(a){case iq:b/=2;c/=2;break;case Mp:b/=2;c/=2;break;case Xp:c=b=0;break;case Yp:break;default:t.l("Unhandled alignment value "+a.toString())}a=[];a[0]=b;a[1]=c;return a}function dq(a,b,c,d,e,g){f&&t.m(a,sp,Z,"shiftRelPosAlign:v");f&&t.m(b,oa,Z,"shiftRelPosAlign:align");b=lq(b,c,d);gq(a,b[0],b[1],e,g)}function gq(a,b,c,d,e){f&&t.m(a,sp,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].la;g.x+=b;g.y+=c}}
function eq(a,b,c,d){f&&(t.m(b,sp,Z,"recordMidPoints:v"),t.j(c,"number",Z,"recordMidPoints:x"),t.j(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.xf){case pp:for(a=b.hc;a.next();)b=a.value,b.fromVertex===e&&b.Br.q(c,d);break;case wp:for(a=b.Zb;a.next();)b=a.value,b.toVertex===e&&b.Br.q(c,d);break;default:t.l("Unhandled path value "+a.xf.toString())}}function hq(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
function fq(a,b,c,d,e,g,h){f&&t.m(b,sp,Z,"mergeFringes:parent");f&&t.m(c,sp,Z,"mergeFringes:child");var k=Wp(b),l=90===k||270===k,m=b.nodeSpacing;b=d;var n=e;d=g;e=h;var p=c.Ys,q=c.qt;h=c.Ya;var r=l?Math.max(e,h.height):Math.max(d,h.width);if(null===p||k!==Wp(c))p=cq(a,2),q=cq(a,2),l?(p[0].q(0,0),p[1].q(0,h.height),q[0].q(h.width,0),q[1].q(q[0].x,p[1].y)):(p[0].q(0,0),p[1].q(h.width,0),q[0].q(0,h.height),q[1].q(p[1].x,q[0].y));if(l){c=d;d=9999999;if(!(null===n||2>n.length||null===p||2>p.length))for(g=
e=0;e<n.length&&g<p.length;){var k=n[e],s=p[g],l=s.x,v=s.y,l=l+c,x=k;e+1<n.length&&(x=n[e+1]);var E=s,s=E.x,E=E.y;g+1<p.length&&(E=p[g+1],s=E.x,E=E.y,s+=c);var F=d;k.y===v?F=l-k.x:k.y>v&&k.y<E?F=l+(k.y-v)/(E-v)*(s-l)-k.x:v>k.y&&v<x.y&&(F=l-(k.x+(v-k.y)/(x.y-k.y)*(x.x-k.x)));F<d&&(d=F);x.y<=k.y?e++:E<=v?g++:(x.y<=E&&e++,E<=x.y&&g++)}c-=d;c+=m;e=p;g=c;if(null===b||2>b.length||null===e||2>e.length)d=null;else{m=cq(a,b.length+e.length);for(d=l=k=0;l<e.length&&e[l].y<b[0].y;)v=e[l++],m[d++].q(v.x+g,v.y);
for(;k<b.length;)v=b[k++],m[d++].q(v.x,v.y);for(k=b[b.length-1].y;l<e.length&&e[l].y<=k;)l++;for(;l<e.length&&e[l].y>k;)v=e[l++],m[d++].q(v.x+g,v.y);e=cq(a,d);for(k=0;k<d;k++)e[k].assign(m[k]);mq(a,m);d=e}l=q;v=c;if(null===n||2>n.length||null===l||2>l.length)e=null;else{m=cq(a,n.length+l.length);for(g=x=e=0;e<n.length&&n[e].y<l[0].y;)k=n[e++],m[g++].q(k.x,k.y);for(;x<l.length;)k=l[x++],m[g++].q(k.x+v,k.y);for(l=l[l.length-1].y;e<n.length&&n[e].y<=l;)e++;for(;e<n.length&&n[e].y>l;)k=n[e++],m[g++].q(k.x,
k.y);k=cq(a,g);for(e=0;e<g;e++)k[e].assign(m[e]);mq(a,m);e=k}g=Math.max(0,c)+h.width;h=r}else{c=e;d=9999999;if(!(null===n||2>n.length||null===p||2>p.length))for(g=e=0;e<n.length&&g<p.length;)k=n[e],s=p[g],l=s.x,v=s.y,v+=c,x=k,e+1<n.length&&(x=n[e+1]),E=s,s=E.x,E=E.y,g+1<p.length&&(E=p[g+1],s=E.x,E=E.y,E+=c),F=d,k.x===l?F=v-k.y:k.x>l&&k.x<s?F=v+(k.x-l)/(s-l)*(E-v)-k.y:l>k.x&&l<x.x&&(F=v-(k.y+(l-k.x)/(x.x-k.x)*(x.y-k.y))),F<d&&(d=F),x.x<=k.x?e++:s<=l?g++:(x.x<=s&&e++,s<=x.x&&g++);c-=d;c+=m;e=p;g=c;
if(null===b||2>b.length||null===e||2>e.length)d=null;else{m=cq(a,b.length+e.length);for(d=l=k=0;l<e.length&&e[l].x<b[0].x;)v=e[l++],m[d++].q(v.x,v.y+g);for(;k<b.length;)v=b[k++],m[d++].q(v.x,v.y);for(k=b[b.length-1].x;l<e.length&&e[l].x<=k;)l++;for(;l<e.length&&e[l].x>k;)v=e[l++],m[d++].q(v.x,v.y+g);e=cq(a,d);for(k=0;k<d;k++)e[k].assign(m[k]);mq(a,m);d=e}l=q;v=c;if(null===n||2>n.length||null===l||2>l.length)e=null;else{m=cq(a,n.length+l.length);for(g=x=e=0;e<n.length&&n[e].x<l[0].x;)k=n[e++],m[g++].q(k.x,
k.y);for(;x<l.length;)k=l[x++],m[g++].q(k.x,k.y+v);for(l=l[l.length-1].x;e<n.length&&n[e].x<=l;)e++;for(;e<n.length&&n[e].x>l;)k=n[e++],m[g++].q(k.x,k.y);k=cq(a,g);for(e=0;e<g;e++)k[e].assign(m[e]);mq(a,m);e=k}g=r;h=Math.max(0,c)+h.height}mq(a,b);mq(a,p);mq(a,n);mq(a,q);a=[];a[0]=c;a[1]=d;a[2]=e;a[3]=g;a[4]=h;return a}function cq(a,b){a.ds||(a.ds=[]);var c=a.ds[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new C;return c}
function mq(a,b){if(a.ds){var c=b.length,d=a.ds[c];void 0===d&&(d=[],a.ds[c]=d);d.push(b)}}
Z.prototype.arrangeTrees=function(){if(this.jd===vp)for(var a=this.Oc.k;a.next();){var b=a.value,c=b.Jc;if(null!==c){var d=c.position,c=d.x,d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);vq(this,b,c,d)}}else for(a=this.zd,c=a.x,d=a.y,a=this.Oc.k;a.next();)switch(b=a.value,vq(this,b,c+b.Ma.x,d+b.Ma.y),this.jd){case rp:d+=b.Ya.height+this.Rf.height;break;case wq:c+=b.Ya.width+this.Rf.width;break;default:t.l("Unhandled arrangement value "+this.jd.toString())}};
function vq(a,b,c,d){if(null!==b){f&&t.m(b,sp,Z,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,g=0;g<e;g++){var h=b[g];vq(a,h,c+h.la.x,d+h.la.y)}}}Z.prototype.commitLayout=function(){this.bB();this.commitNodes();this.Vs&&this.commitLinks()};Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.k,b;a.next();)b=a.value,b.commit();for(a.reset();a.next();)b=a.value,this.layoutComments(b)};Z.prototype.commitLinks=function(){for(var a=this.network.edges.k;a.next();)a.value.commit()};
Z.prototype.bB=function(){for(var a=this.Oc.k;a.next();)xq(this,a.value)};function xq(a,b){if(null!==b){f&&t.m(b,sp,Z,"setPortSpotsTree:v");a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)xq(a,c[e])}}
Z.prototype.setPortSpots=function(a){f&&t.m(a,sp,Z,"setPortSpots:v");var b=a.alignment;if(Np(b)){f&&t.m(a,sp,Z,"setPortSpotsBus:v");f&&t.m(b,oa,Z,"setPortSpots:align");var c=this.xf===pp,d=Wp(a),e;switch(d){case 0:e=cc;break;case 90:e=dc;break;case 180:e=bc;break;default:e=ac}var g=a.children,h=g.length;switch(b){case Op:case Dp:for(b=0;b<h;b++){var k=g[b],k=c?k.hc:k.Zb;if(k.next()){var l=k.value,l=l.link;if(null!==l){var m=90===d||270===d?bc:ac;if(1===h||b===h-1&&1===h%2)switch(d){case 0:m=bc;break;
case 90:m=ac;break;case 180:m=cc;break;default:m=dc}else 0===b%2&&(m=90===d||270===d?cc:dc);c?(a.setsPortSpot&&(l.lb=e),a.setsChildPortSpot&&(l.mb=m)):(a.setsPortSpot&&(l.lb=m),a.setsChildPortSpot&&(l.mb=e))}}}break;case Pp:m=90===d||270===d?cc:dc;for(k=c?a.Zb:a.hc;k.next();)l=k.value,l=l.link,null!==l&&(c?(a.setsPortSpot&&(l.lb=e),a.setsChildPortSpot&&(l.mb=m)):(a.setsPortSpot&&(l.lb=m),a.setsChildPortSpot&&(l.mb=e)));break;case Qp:for(m=90===d||270===d?bc:ac,k=c?a.Zb:a.hc;k.next();)l=k.value,l=
l.link,null!==l&&(c?(a.setsPortSpot&&(l.lb=e),a.setsChildPortSpot&&(l.mb=m)):(a.setsPortSpot&&(l.lb=m),a.setsChildPortSpot&&(l.mb=e)))}}else if(c=Wp(a),this.xf===pp)for(d=a.Zb;d.next();){if(e=d.value,e=e.link,null!==e){if(a.setsPortSpot)if(a.portSpot.Gc())switch(c){case 0:e.lb=cc;break;case 90:e.lb=dc;break;case 180:e.lb=bc;break;default:e.lb=ac}else e.lb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Gc())switch(c){case 0:e.mb=bc;break;case 90:e.mb=ac;break;case 180:e.mb=cc;break;default:e.mb=
dc}else e.mb=a.childPortSpot}}else for(d=a.hc;d.next();)if(e=d.value,e=e.link,null!==e){if(a.setsPortSpot)if(a.portSpot.Gc())switch(c){case 0:e.mb=cc;break;case 90:e.mb=dc;break;case 180:e.mb=bc;break;default:e.mb=ac}else e.mb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Gc())switch(c){case 0:e.lb=bc;break;case 90:e.lb=ac;break;case 180:e.lb=cc;break;default:e.lb=dc}else e.lb=a.childPortSpot}};function Wp(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
function Zp(a){f&&t.m(a,sp,Z,"computeLayerSpacing:v");var b=Wp(a),b=90===b||270===b,c=a.layerSpacing;if(0<a.layerSpacingParentOverlap)var d=Math.min(1,a.layerSpacingParentOverlap),c=c-(b?a.height*d:a.width*d);c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}function $p(a){f&&t.m(a,sp,Z,"computeNodeIndent:v");var b=Wp(a),b=90===b||270===b,c=a.nodeIndent;if(0<a.nodeIndentPastParent)var d=Math.min(1,a.nodeIndentPastParent),c=c+(b?a.width*d:a.height*d);return c=Math.max(0,c)}
t.g(Z,"roots",Z.prototype.$I);t.defineProperty(Z,{$I:"roots"},function(){return this.Oc},function(a){this.Oc!==a&&(t.m(a,ua,Z,"roots"),this.Oc=a,this.K())});t.g(Z,"path",Z.prototype.path);t.defineProperty(Z,{path:"path"},function(){return this.ti},function(a){this.ti!==a&&(t.m(a,oa,Z,"path"),this.ti=a,this.K())});t.g(Z,"treeStyle",Z.prototype.WF);
t.defineProperty(Z,{WF:"treeStyle"},function(){return this.js},function(a){this.jd!==a&&(f&&t.m(a,oa,Z,"treeStyle"),a===qp||a===Gp||a===Hp||a===Fp)&&(this.js=a,this.K())});t.g(Z,"comments",Z.prototype.comments);t.defineProperty(Z,{comments:"comments"},function(){return this.hh},function(a){this.hh!==a&&(this.hh=a,this.K())});t.g(Z,"arrangement",Z.prototype.Oe);
t.defineProperty(Z,{Oe:"arrangement"},function(){return this.jd},function(a){this.jd!==a&&(f&&t.m(a,oa,Z,"arrangement"),a===rp||a===wq||a===vp)&&(this.jd=a,this.K())});t.g(Z,"arrangementSpacing",Z.prototype.Jv);t.defineProperty(Z,{Jv:"arrangementSpacing"},function(){return this.Rf},function(a){this.Rf.N(a)||(this.Rf.assign(a),this.K())});t.g(Z,"rootDefaults",Z.prototype.ZI);
t.defineProperty(Z,{ZI:"rootDefaults"},function(){return this.ua},function(a){this.ua!==a&&(f&&t.m(a,sp,Z,"rootDefaults"),this.ua=a,this.K())});t.g(Z,"alternateDefaults",Z.prototype.YG);t.defineProperty(Z,{YG:"alternateDefaults"},function(){return this.ta},function(a){this.ta!==a&&(f&&t.m(a,sp,Z,"alternateDefaults"),this.ta=a,this.K())});t.g(Z,"sorting",Z.prototype.sorting);
t.defineProperty(Z,{sorting:"sorting"},function(){return this.ua.sorting},function(a){this.ua.sorting!==a&&(f&&t.m(a,oa,Z,"sorting"),a===Ip||a===Jp||a===Kp||Lp)&&(this.ua.sorting=a,this.K())});t.g(Z,"comparer",Z.prototype.comparer);t.defineProperty(Z,{comparer:"comparer"},function(){return this.ua.comparer},function(a){this.ua.comparer!==a&&(f&&t.j(a,"function",Z,"comparer"),this.ua.comparer=a,this.K())});t.g(Z,"angle",Z.prototype.angle);
t.defineProperty(Z,{angle:"angle"},function(){return this.ua.angle},function(a){this.ua.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.ua.angle=a,this.K())});t.g(Z,"alignment",Z.prototype.alignment);t.defineProperty(Z,{alignment:"alignment"},function(){return this.ua.alignment},function(a){this.ua.alignment!==a&&(f&&t.tb(a,Z,Z,"alignment"),this.ua.alignment=a,this.K())});t.g(Z,"nodeIndent",Z.prototype.nodeIndent);
t.defineProperty(Z,{nodeIndent:"nodeIndent"},function(){return this.ua.nodeIndent},function(a){this.ua.nodeIndent!==a&&0<=a&&(this.ua.nodeIndent=a,this.K())});t.g(Z,"nodeIndentPastParent",Z.prototype.nodeIndentPastParent);t.defineProperty(Z,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.ua.nodeIndentPastParent},function(a){this.ua.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.ua.nodeIndentPastParent=a,this.K())});t.g(Z,"nodeSpacing",Z.prototype.nodeSpacing);
t.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.ua.nodeSpacing},function(a){this.ua.nodeSpacing!==a&&(this.ua.nodeSpacing=a,this.K())});t.g(Z,"layerSpacing",Z.prototype.layerSpacing);t.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.ua.layerSpacing},function(a){this.ua.layerSpacing!==a&&(this.ua.layerSpacing=a,this.K())});t.g(Z,"layerSpacingParentOverlap",Z.prototype.layerSpacingParentOverlap);
t.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.ua.layerSpacingParentOverlap},function(a){this.ua.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.ua.layerSpacingParentOverlap=a,this.K())});t.g(Z,"compaction",Z.prototype.compaction);t.defineProperty(Z,{compaction:"compaction"},function(){return this.ua.compaction},function(a){this.ua.compaction!==a&&(f&&t.m(a,oa,Z,"compaction"),a===Tp||a===Vp)&&(this.ua.compaction=a,this.K())});
t.g(Z,"breadthLimit",Z.prototype.breadthLimit);t.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.ua.breadthLimit},function(a){this.ua.breadthLimit!==a&&0<=a&&(this.ua.breadthLimit=a,this.K())});t.g(Z,"rowSpacing",Z.prototype.rowSpacing);t.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.ua.rowSpacing},function(a){this.ua.rowSpacing!==a&&(this.ua.rowSpacing=a,this.K())});t.g(Z,"rowIndent",Z.prototype.rowIndent);
t.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.ua.rowIndent},function(a){this.ua.rowIndent!==a&&0<=a&&(this.ua.rowIndent=a,this.K())});t.g(Z,"commentSpacing",Z.prototype.commentSpacing);t.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.ua.commentSpacing},function(a){this.ua.commentSpacing!==a&&(this.ua.commentSpacing=a,this.K())});t.g(Z,"commentMargin",Z.prototype.commentMargin);
t.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.ua.commentMargin},function(a){this.ua.commentMargin!==a&&(this.ua.commentMargin=a,this.K())});t.g(Z,"setsPortSpot",Z.prototype.setsPortSpot);t.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.ua.setsPortSpot},function(a){this.ua.setsPortSpot!==a&&(this.ua.setsPortSpot=a,this.K())});t.g(Z,"portSpot",Z.prototype.portSpot);
t.defineProperty(Z,{portSpot:"portSpot"},function(){return this.ua.portSpot},function(a){this.ua.portSpot.N(a)||(this.ua.portSpot=a,this.K())});t.g(Z,"setsChildPortSpot",Z.prototype.setsChildPortSpot);t.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.ua.setsChildPortSpot},function(a){this.ua.setsChildPortSpot!==a&&(this.ua.setsChildPortSpot=a,this.K())});t.g(Z,"childPortSpot",Z.prototype.childPortSpot);
t.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.ua.childPortSpot},function(a){this.ua.childPortSpot.N(a)||(this.ua.childPortSpot=a,this.K())});t.g(Z,"alternateSorting",Z.prototype.iH);t.defineProperty(Z,{iH:"alternateSorting"},function(){return this.ta.sorting},function(a){this.ta.sorting!==a&&(f&&t.m(a,oa,Z,"alternateSorting"),a===Ip||a===Jp||a===Kp||Lp)&&(this.ta.sorting=a,this.K())});t.g(Z,"alternateComparer",Z.prototype.XG);
t.defineProperty(Z,{XG:"alternateComparer"},function(){return this.ta.comparer},function(a){this.ta.comparer!==a&&(f&&t.j(a,"function",Z,"alternateComparer"),this.ta.comparer=a,this.K())});t.g(Z,"alternateAngle",Z.prototype.RG);t.defineProperty(Z,{RG:"alternateAngle"},function(){return this.ta.angle},function(a){this.ta.angle===a||0!==a&&90!==a&&180!==a&&270!==a||(this.ta.angle=a,this.K())});t.g(Z,"alternateAlignment",Z.prototype.QG);
t.defineProperty(Z,{QG:"alternateAlignment"},function(){return this.ta.alignment},function(a){this.ta.alignment!==a&&(f&&t.tb(a,Z,Z,"alternateAlignment"),this.ta.alignment=a,this.K())});t.g(Z,"alternateNodeIndent",Z.prototype.aH);t.defineProperty(Z,{aH:"alternateNodeIndent"},function(){return this.ta.nodeIndent},function(a){this.ta.nodeIndent!==a&&0<=a&&(this.ta.nodeIndent=a,this.K())});t.g(Z,"alternateNodeIndentPastParent",Z.prototype.bH);
t.defineProperty(Z,{bH:"alternateNodeIndentPastParent"},function(){return this.ta.nodeIndentPastParent},function(a){this.ta.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.ta.nodeIndentPastParent=a,this.K())});t.g(Z,"alternateNodeSpacing",Z.prototype.cH);t.defineProperty(Z,{cH:"alternateNodeSpacing"},function(){return this.ta.nodeSpacing},function(a){this.ta.nodeSpacing!==a&&(this.ta.nodeSpacing=a,this.K())});t.g(Z,"alternateLayerSpacing",Z.prototype.ZG);
t.defineProperty(Z,{ZG:"alternateLayerSpacing"},function(){return this.ta.layerSpacing},function(a){this.ta.layerSpacing!==a&&(this.ta.layerSpacing=a,this.K())});t.g(Z,"alternateLayerSpacingParentOverlap",Z.prototype.$G);t.defineProperty(Z,{$G:"alternateLayerSpacingParentOverlap"},function(){return this.ta.layerSpacingParentOverlap},function(a){this.ta.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.ta.layerSpacingParentOverlap=a,this.K())});t.g(Z,"alternateCompaction",Z.prototype.WG);
t.defineProperty(Z,{WG:"alternateCompaction"},function(){return this.ta.compaction},function(a){this.ta.compaction!==a&&(f&&t.m(a,oa,Z,"alternateCompaction"),a===Tp||a===Vp)&&(this.ta.compaction=a,this.K())});t.g(Z,"alternateBreadthLimit",Z.prototype.SG);t.defineProperty(Z,{SG:"alternateBreadthLimit"},function(){return this.ta.breadthLimit},function(a){this.ta.breadthLimit!==a&&0<=a&&(this.ta.breadthLimit=a,this.K())});t.g(Z,"alternateRowSpacing",Z.prototype.fH);
t.defineProperty(Z,{fH:"alternateRowSpacing"},function(){return this.ta.rowSpacing},function(a){this.ta.rowSpacing!==a&&(this.ta.rowSpacing=a,this.K())});t.g(Z,"alternateRowIndent",Z.prototype.eH);t.defineProperty(Z,{eH:"alternateRowIndent"},function(){return this.ta.rowIndent},function(a){this.ta.rowIndent!==a&&0<=a&&(this.ta.rowIndent=a,this.K())});t.g(Z,"alternateCommentSpacing",Z.prototype.VG);
t.defineProperty(Z,{VG:"alternateCommentSpacing"},function(){return this.ta.commentSpacing},function(a){this.ta.commentSpacing!==a&&(this.ta.commentSpacing=a,this.K())});t.g(Z,"alternateCommentMargin",Z.prototype.UG);t.defineProperty(Z,{UG:"alternateCommentMargin"},function(){return this.ta.commentMargin},function(a){this.ta.commentMargin!==a&&(this.ta.commentMargin=a,this.K())});t.g(Z,"alternateSetsPortSpot",Z.prototype.hH);
t.defineProperty(Z,{hH:"alternateSetsPortSpot"},function(){return this.ta.setsPortSpot},function(a){this.ta.setsPortSpot!==a&&(this.ta.setsPortSpot=a,this.K())});t.g(Z,"alternatePortSpot",Z.prototype.dH);t.defineProperty(Z,{dH:"alternatePortSpot"},function(){return this.ta.portSpot},function(a){this.ta.portSpot.N(a)||(this.ta.portSpot=a,this.K())});t.g(Z,"alternateSetsChildPortSpot",Z.prototype.gH);
t.defineProperty(Z,{gH:"alternateSetsChildPortSpot"},function(){return this.ta.setsChildPortSpot},function(a){this.ta.setsChildPortSpot!==a&&(this.ta.setsChildPortSpot=a,this.K())});t.g(Z,"alternateChildPortSpot",Z.prototype.TG);t.defineProperty(Z,{TG:"alternateChildPortSpot"},function(){return this.ta.childPortSpot},function(a){this.ta.childPortSpot.N(a)||(this.ta.childPortSpot=a,this.K())});var op;Z.PathDefault=op=t.w(Z,"PathDefault",-1);var pp;Z.PathDestination=pp=t.w(Z,"PathDestination",0);var wp;
Z.PathSource=wp=t.w(Z,"PathSource",1);var Ip;Z.SortingForwards=Ip=t.w(Z,"SortingForwards",10);var Jp;Z.SortingReverse=Jp=t.w(Z,"SortingReverse",11);var Kp;Z.SortingAscending=Kp=t.w(Z,"SortingAscending",12);var Lp;Z.SortingDescending=Lp=t.w(Z,"SortingDescending",13);var iq;Z.AlignmentCenterSubtrees=iq=t.w(Z,"AlignmentCenterSubtrees",20);var Mp;Z.AlignmentCenterChildren=Mp=t.w(Z,"AlignmentCenterChildren",21);var Xp;Z.AlignmentStart=Xp=t.w(Z,"AlignmentStart",22);var Yp;
Z.AlignmentEnd=Yp=t.w(Z,"AlignmentEnd",23);var Op;Z.AlignmentBus=Op=t.w(Z,"AlignmentBus",24);var Dp;Z.AlignmentBusBranching=Dp=t.w(Z,"AlignmentBusBranching",25);var Pp;Z.AlignmentTopLeftBus=Pp=t.w(Z,"AlignmentTopLeftBus",26);var Qp;Z.AlignmentBottomRightBus=Qp=t.w(Z,"AlignmentBottomRightBus",27);var Tp;Z.CompactionNone=Tp=t.w(Z,"CompactionNone",30);var Vp;Z.CompactionBlock=Vp=t.w(Z,"CompactionBlock",31);var qp;Z.StyleLayered=qp=t.w(Z,"StyleLayered",40);var Hp;
Z.StyleLastParents=Hp=t.w(Z,"StyleLastParents",41);var Gp;Z.StyleAlternating=Gp=t.w(Z,"StyleAlternating",42);var Fp;Z.StyleRootOnly=Fp=t.w(Z,"StyleRootOnly",43);var rp;Z.ArrangementVertical=rp=t.w(Z,"ArrangementVertical",50);var wq;Z.ArrangementHorizontal=wq=t.w(Z,"ArrangementHorizontal",51);var vp;Z.ArrangementFixedRoots=vp=t.w(Z,"ArrangementFixedRoots",52);function tp(){Ba.call(this)}t.ia("TreeNetwork",tp);t.Oa(tp,Ba);tp.prototype.createVertex=function(){return new sp};tp.prototype.createEdge=function(){return new yq};
function sp(){Da.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.la=new C(0,0);this.Ya=new pa(0,0);this.Ma=new C(0,0);this.Bp=this.Ap=this.aJ=!1;this.qt=this.Ys=null;this.sorting=Ip;this.comparer=tn;this.angle=0;this.alignment=Mp;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Vp;this.breadthLimit=
0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Qb;this.setsChildPortSpot=!0;this.childPortSpot=Qb}t.ia("TreeVertex",sp);t.Oa(sp,Da);
sp.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing,
this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};t.A(sp,{Cm:"childrenCount"},function(){return this.children.length});t.g(sp,"relativePosition",sp.prototype.VI);t.defineProperty(sp,{VI:"relativePosition"},function(){return this.la},function(a){t.m(a,C,sp,"relativePosition");this.la.set(a)});t.g(sp,"subtreeSize",sp.prototype.iJ);
t.defineProperty(sp,{iJ:"subtreeSize"},function(){return this.Ya},function(a){t.m(a,pa,sp,"subtreeSize");this.Ya.set(a)});t.g(sp,"subtreeOffset",sp.prototype.hJ);t.defineProperty(sp,{hJ:"subtreeOffset"},function(){return this.Ma},function(a){t.m(a,C,sp,"subtreeOffset");this.Ma.set(a)});function yq(){Ea.call(this);this.Br=new C(0,0)}t.ia("TreeEdge",yq);t.Oa(yq,Ea);
yq.prototype.commit=function(){var a=this.link;if(null!==a&&!a.Si){var b=this.network.Tb,c=null,d=null;switch(b.xf){case pp:c=this.fromVertex;d=this.toVertex;break;case wp:c=this.toVertex;d=this.fromVertex;break;default:t.l("Unhandled path value "+b.xf.toString())}if(null!==c&&null!==d)if(b=this.Br,0!==b.x||0!==b.y||c.aJ){var d=c.Mb,e=Wp(c),g=Zp(c),h=c.rowSpacing;a.updateRoute();var k=a.Ee===Qg,l=a.ac,m,n,p,q;a.wl();if(l||k){for(m=2;4<a.ma;)a.fF(2);n=a.n(1);p=a.n(2)}else{for(m=1;3<a.ma;)a.fF(1);n=
a.n(0);p=a.n(a.ma-1)}q=a.n(a.ma-1);0===e?(c.alignment===Yp?(e=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(e=Math.min(e,Math.max(n.y,e-$p(c))))):c.alignment===Xp?(e=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(e=Math.max(e,Math.min(n.y,e+$p(c))))):e=c.Ap||c.Bp&&1===c.maxGenerationCount?d.top-c.Ma.y+b.y:d.y+d.height/2+b.y,k?(a.C(m,n.x,e),m++,a.C(m,d.right+g,e),m++,a.C(m,d.right+g+(b.x-h)/3,e),m++,a.C(m,d.right+g+2*(b.x-h)/3,e),m++,a.C(m,d.right+g+(b.x-h),e),m++,a.C(m,p.x,e)):(l&&(a.C(m,d.right+g/2,n.y),
m++),a.C(m,d.right+g/2,e),m++,a.C(m,d.right+g+b.x-(l?h/2:h),e),m++,l&&a.C(m,a.n(m-1).x,p.y))):90===e?(c.alignment===Yp?(e=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(e=Math.min(e,Math.max(n.x,e-$p(c))))):c.alignment===Xp?(e=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(e=Math.max(e,Math.min(n.x,e+$p(c))))):e=c.Ap||c.Bp&&1===c.maxGenerationCount?d.left-c.Ma.x+b.x:d.x+d.width/2+b.x,k?(a.C(m,e,n.y),m++,a.C(m,e,d.bottom+g),m++,a.C(m,e,d.bottom+g+(b.y-h)/3),m++,a.C(m,e,d.bottom+g+2*(b.y-h)/3),m++,a.C(m,e,d.bottom+
g+(b.y-h)),m++,a.C(m,e,p.y)):(l&&(a.C(m,n.x,d.bottom+g/2),m++),a.C(m,e,d.bottom+g/2),m++,a.C(m,e,d.bottom+g+b.y-(l?h/2:h)),m++,l&&a.C(m,p.x,a.n(m-1).y))):180===e?(c.alignment===Yp?(e=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(e=Math.min(e,Math.max(n.y,e-$p(c))))):c.alignment===Xp?(e=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(e=Math.max(e,Math.min(n.y,e+$p(c))))):e=c.Ap||c.Bp&&1===c.maxGenerationCount?d.top-c.Ma.y+b.y:d.y+d.height/2+b.y,k?(a.C(m,n.x,e),m++,a.C(m,d.left-g,e),m++,a.C(m,d.left-g+(b.x+
h)/3,e),m++,a.C(m,d.left-g+2*(b.x+h)/3,e),m++,a.C(m,d.left-g+(b.x+h),e),m++,a.C(m,p.x,e)):(l&&(a.C(m,d.left-g/2,n.y),m++),a.C(m,d.left-g/2,e),m++,a.C(m,d.left-g+b.x+(l?h/2:h),e),m++,l&&a.C(m,a.n(m-1).x,p.y))):270===e?(c.alignment===Yp?(e=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(e=Math.min(e,Math.max(n.x,e-$p(c))))):c.alignment===Xp?(e=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(e=Math.max(e,Math.min(n.x,e+$p(c))))):e=c.Ap||c.Bp&&1===c.maxGenerationCount?d.left-c.Ma.x+b.x:d.x+d.width/2+b.x,k?(a.C(m,
e,n.y),m++,a.C(m,e,d.top-g),m++,a.C(m,e,d.top-g+(b.y+h)/3),m++,a.C(m,e,d.top-g+2*(b.y+h)/3),m++,a.C(m,e,d.top-g+(b.y+h)),m++,a.C(m,e,p.y)):(l&&(a.C(m,n.x,d.top-g/2),m++),a.C(m,e,d.top-g/2),m++,a.C(m,e,d.top-g+b.y+(l?h/2:h)),m++,l&&a.C(m,p.x,a.n(m-1).y))):t.l("Invalid angle "+e);a.Ii()}else g=c,h=d,f&&t.m(g,sp,yq,"adjustRouteForAngleChange:parent"),f&&t.m(h,sp,yq,"adjustRouteForAngleChange:child"),a=this.link,c=Wp(g),c!==Wp(h)&&(b=Zp(g),d=g.Mb,g=h.Mb,0===c&&g.left-d.right<b+1||90===c&&g.top-d.bottom<
b+1||180===c&&d.left-g.right<b+1||270===c&&d.top-g.bottom<b+1||(a.updateRoute(),g=a.Ee===Qg,h=a.ac,k=Np(this.fromVertex.alignment),a.wl(),0===c?(c=d.right+b/2,g?4===a.ma&&(b=a.n(3).y,a.Y(1,c-20,a.n(1).y),a.C(2,c-20,b),a.C(3,c,b),a.C(4,c+20,b),a.Y(5,a.n(5).x,b)):h?k?a.Y(3,a.n(2).x,a.n(4).y):6===a.ma&&(a.Y(2,c,a.n(2).y),a.Y(3,c,a.n(3).y)):4===a.ma?a.C(2,c,a.n(2).y):3===a.ma?a.Y(1,c,a.n(2).y):2===a.ma&&a.C(1,c,a.n(1).y)):90===c?(b=d.bottom+b/2,g?4===a.ma&&(c=a.n(3).x,a.Y(1,a.n(1).x,b-20),a.C(2,c,b-20),
a.C(3,c,b),a.C(4,c,b+20),a.Y(5,c,a.n(5).y)):h?k?a.Y(3,a.n(2).x,a.n(4).y):6===a.ma&&(a.Y(2,a.n(2).x,b),a.Y(3,a.n(3).x,b)):4===a.ma?a.C(2,a.n(2).x,b):3===a.ma?a.Y(1,a.n(2).x,b):2===a.ma&&a.C(1,a.n(1).x,b)):180===c?(c=d.left-b/2,g?4===a.ma&&(b=a.n(3).y,a.Y(1,c+20,a.n(1).y),a.C(2,c+20,b),a.C(3,c,b),a.C(4,c-20,b),a.Y(5,a.n(5).x,b)):h?k?a.Y(3,a.n(2).x,a.n(4).y):6===a.ma&&(a.Y(2,c,a.n(2).y),a.Y(3,c,a.n(3).y)):4===a.ma?a.C(2,c,a.n(2).y):3===a.ma?a.Y(1,c,a.n(2).y):2===a.ma&&a.C(1,c,a.n(1).y)):270===c&&(b=
d.top-b/2,g?4===a.ma&&(c=a.n(3).x,a.Y(1,a.n(1).x,b+20),a.C(2,c,b+20),a.C(3,c,b),a.C(4,c,b-20),a.Y(5,c,a.n(5).y)):h?k?a.Y(3,a.n(2).x,a.n(4).y):6===a.ma&&(a.Y(2,a.n(2).x,b),a.Y(3,a.n(3).x,b)):4===a.ma?a.C(2,a.n(2).x,b):3===a.ma?a.Y(1,a.n(2).x,b):2===a.ma&&a.C(1,a.n(1).x,b)),a.Ii()))}};t.g(yq,"relativePoint",yq.prototype.UI);t.defineProperty(yq,{UI:"relativePoint"},function(){return this.Br},function(a){this.Br.set(a)});function zq(){this.Kn=[]}
function zk(a){var b=new zq,c;if("string"===typeof a)c=(new DOMParser).parseFromString(a,"text/xml");else if(a instanceof Document)c=a.implementation.createDocument("http://www.w3.org/2000/svg","svg",null),c.appendChild(c.importNode(a.documentElement,!0));else return null;a=c.getElementsByTagName("svg");if(0===a.length)return null;var d=a[0],e=c.getElementsByTagName("linearGradient"),g=c.getElementsByTagName("radialGradient");for(a=0;a<e.length;a++){for(var h=e[a],k=Ak(fe,ie,{start:gc,end:nc}),l=
h.childNodes,m=0;m<l.length;m++)if("stop"===l[m].tagName){var n=Aq(b,l[m],"stop-color");if(n){var p=Aq(b,l[m],"offset");p||(p="0");var q=parseFloat(p);isNaN(q)&&(q=0);k.addColorStop((-1!==p.indexOf("%")?0.01:1)*q,n)}}h=h.getAttribute("id");"string"===typeof h&&(b["_brush"+h]=k)}for(a=0;a<g.length;a++){h=g[a];k=Ak(fe,je,{start:Vb,end:Vb});l=h.childNodes;for(m=0;m<l.length;m++)"stop"===l[m].tagName&&(n=Aq(b,l[m],"stop-color"))&&((p=Aq(b,l[m],"offset"))||(p="0"),q=parseFloat(p),isNaN(q)&&(q=0),k.addColorStop((-1!==
p.indexOf("%")?0.01:1)*q,n));h=h.getAttribute("id");"string"===typeof h&&(b["_brush"+h]=k)}for(e=!0;e;)for(e=!1,g=c.getElementsByTagName("use"),a=0;a<g.length;a++)k=g[a],0===k.childNodes.length&&(h=k.href,void 0!==h&&(h=c.getElementById(h.baseVal.substring(1)),null!==h&&(h=h.cloneNode(!0),h.removeAttribute("id"),l=parseFloat(k.getAttribute("x")),isNaN(l)&&(l=0),m=parseFloat(k.getAttribute("y")),isNaN(m)&&(m=0),n=k.getAttribute("transform"),null===n&&(n=""),k.setAttribute("transform",n+" translate("+
l+","+m+")"),k.appendChild(h),"use"===h.tagName&&(e=!0))));Bq(b,d,null);c=new B;if(0===b.Kn.length)return c;if(1===b.Kn.length)return b.Kn[0];for(a=0;a<b.Kn.length;a++)c.add(b.Kn[a]);return c}function Cq(a,b){var c=a.getAttribute(b);"string"!==typeof c&&a.style&&(c=a.style[b]);return"string"!==typeof c?null:c}
function Aq(a,b,c){var d=b.getAttribute(c);"string"!==typeof d&&b.style&&(d=b.style[c]);return"string"!==typeof d||""===d||"inherit"===d?(b=b.parentNode,"g"===b.tagName||"use"===b.tagName?Aq(a,b,c):null):d}
function Bq(a,b,c){var d=b.tagName;if(("g"===d||"svg"===d||"use"===d||"symbol"===d)&&"none"!==Aq(a,b,"display")){for(var d=b.childNodes,e=0;e<d.length;e++){var g=d[e],h=null;if(void 0!==g.getAttribute){var k=g.getAttribute("transform");switch(g.tagName){case "g":null===k?Bq(a,g,null):(h=new B,Bq(a,g,h));break;case "use":null===k?Bq(a,g,null):(h=new B,Bq(a,g,h));break;case "symbol":if("use"!==b.tagName)break;h=new B;Bq(a,g,h);var l=h,m=a,n=g;Aq(m,n,"preserveAspectRatio");Aq(m,n,"viewBox");l.scale=
1;break;case "path":l=g;h=new Y;l=l.getAttribute("d");"string"===typeof l&&(h.fE=Zc(l));break;case "line":var p=g,h=new Y,l=parseFloat(p.getAttribute("x1"));isNaN(l)&&(l=0);m=parseFloat(p.getAttribute("y1"));isNaN(m)&&(m=0);n=parseFloat(p.getAttribute("x2"));isNaN(n)&&(n=0);p=parseFloat(p.getAttribute("y2"));isNaN(p)&&(p=0);var q=new M(Tc);h.position=new C(Math.min(l,n),Math.min(m,p));0<(n-l)/(p-m)?(q.na=0,q.oa=0,q.D=Math.abs(n-l),q.F=Math.abs(p-m)):(q.na=0,q.oa=Math.abs(p-m),q.D=Math.abs(n-l),q.F=
0);h.ed=q;break;case "circle":n=g;h=new Y;l=parseFloat(n.getAttribute("r"));isNaN(l)||0>l?h=null:(m=parseFloat(n.getAttribute("cx")),isNaN(m)&&(m=0),n=parseFloat(n.getAttribute("cy")),isNaN(n)&&(n=0),p=new M(Vc),p.na=0,p.oa=0,p.D=2*l,p.F=2*l,h.position=new C(m-l,n-l),h.ed=p);break;case "ellipse":p=g;h=new Y;l=parseFloat(p.getAttribute("rx"));isNaN(l)||0>l?h=null:(m=parseFloat(p.getAttribute("ry")),isNaN(m)||0>m?h=null:(n=parseFloat(p.getAttribute("cx")),isNaN(n)&&(n=0),p=parseFloat(p.getAttribute("cy")),
isNaN(p)&&(p=0),q=new M(Vc),q.na=0,q.oa=0,q.D=2*l,q.F=2*m,h.position=new C(n-l,p-m),h.ed=q));break;case "rect":q=g;h=new Y;l=parseFloat(q.getAttribute("width"));if(isNaN(l)||0>l)h=null;else if(m=parseFloat(q.getAttribute("height")),isNaN(m)||0>m)h=null;else{n=parseFloat(q.getAttribute("x"));isNaN(n)&&(n=0);p=parseFloat(q.getAttribute("y"));isNaN(p)&&(p=0);var r=q.getAttribute("rx"),s=q.getAttribute("ry"),q=parseFloat(r);if(isNaN(q)||0>q)q=0;var v=parseFloat(s);if(isNaN(v)||0>v)v=0;!r&&s?q=v:r&&!s&&
(v=q);q=Math.min(q,l/2);v=Math.min(v,m/2);s=void 0;0===q&&0===v?(s=new M(Uc),s.na=0,s.oa=0,s.D=l,s.F=m):(s=J.va/2,r=t.u(),O(r,q,0,!0),r.lineTo(l-q,0),P(r,l-q*s,0,l,v*s,l,v),r.lineTo(l,m-v),P(r,l,m-v*s,l-q*s,m,l-q,m),r.lineTo(q,m),P(r,q*s,m,0,m-v*s,0,m-v),r.lineTo(0,v),P(r,0,v*s,q*s,0,q,0),Q(r),s=r.s,t.v(r));h.position=new C(n,p);h.ed=s}break;case "polygon":h=Dq(g);break;case "polyline":h=Dq(g)}if(null!==h){if(h instanceof Y){l=Aq(a,g,"fill");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+
1,l.length-1),l=a["_brush"+l],h.fill=l instanceof fe?l:"black"):h.fill=null===l?"black":"none"===l?null:l;l=Aq(a,g,"stroke");null!==l&&-1!==l.indexOf("url")?(l=l.substring(l.indexOf("#")+1,l.length-1),l=a["_brush"+l],h.stroke=l instanceof fe?l:"black"):h.stroke="none"===l?null:l;l=parseFloat(Aq(a,g,"stroke-width"));isNaN(l)||(h.ib=l);l=Aq(a,g,"stroke-linecap");null!==l&&(h.HF=l);if(l=Aq(a,g,"stroke-dasharray")){m=l.split(",");n=[];for(l=0;l<m.length;l++)p=parseFloat(m[l]),!isNaN(p)&&0<p&&n.push(p);
h.Rw=n}if(g=Aq(a,g,"stroke-dashoffset"))g=parseFloat(g),isNaN(g)||(h.IF=g);h.kA=!0}if(null!==k){k=k.split(")");g=!0;for(l=0;l<k.length;l++)/\(.*[^0-9\.,\s-]/.test(k[l])&&(g=!1),/\(.*[0-9]-[0-9]/.test(k[l])&&(g=!1);if(g)for(l=k.length-1;0<=l;l--)if(m=k[l],""!==m)switch(n=m.indexOf("("),g=m.substring(0,n).replace(/\s*/,""),n=m.substring(n+1).split(/\s*[\s,]\s*/),g){case "rotate":Eq(a,h,n);break;case "translate":g=h;m=parseFloat(n[0]);isNaN(m)&&(m=0);n=parseFloat(n[1]);isNaN(n)&&(n=0);if(0!==m||0!==
n)p=g.position.copy(),isNaN(p.x)&&(p.x=0),isNaN(p.y)&&(p.y=0),g.position=new C(m+p.x,n+p.y);break;case "scale":Fq(a,h,n);break;case "skewX":Gq(a,h,n);break;case "skewY":Hq(a,h,n);break;case "matrix":Iq(a,h,n)}}if(h instanceof B){k=h.elements.k;l=g=0;m=h.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);for(;k.next();)n=k.value.position.copy(),isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0),n.x<g&&(g=n.x),n.y<l&&(l=n.y);m.x+=g;m.y+=l;h.position=m}null===c?a.Kn.push(h):c.add(h)}}}if(null!==h){a=Cq(b,
"visibility");if("hidden"===a||"collapse"===a)h.visible=!1;if(b=Cq(b,"opacity"))b=parseFloat(b),isNaN(b)||(h.opacity=b)}}}
function Iq(a,b,c){var d=parseFloat(c[0]),e=parseFloat(c[1]),g=parseFloat(c[2]),h=parseFloat(c[3]),k=parseFloat(c[4]),l=parseFloat(c[5]);if(!isNaN(d+e+g+h+k+l)){var m=b.position.copy();isNaN(m.x)&&(m.x=0);isNaN(m.y)&&(m.y=0);if(b instanceof Y){c=b.ed.copy();if(c.type===Uc)c=a.ks(c);else if(c.type===Vc)c=Jq(c);else if(c.type===Tc){c.type=Lc;a=new Mc(c.na,c.oa);var n=new S(Xc,c.D,c.F);a.Ga.add(n);c.ub.add(a)}c.offset(m.x,m.y);c.transform(d,e,g,h,k-m.x,l-m.y);a=c.normalize();b.ed=c;m.x-=a.x;m.y-=a.y;
b.position=m}else{for(b=b.elements.k;b.next();)d=b.value.position.copy(),d.x+=m.x,d.y+=m.y,b.value.position=d;for(b.reset();b.next();)Iq(a,b.value,c);for(b.reset();b.next();)d=b.value.position.copy(),d.x-=m.x,d.y-=m.y,b.value.position=d}}}
function Eq(a,b,c){var d=parseFloat(c[0]);isNaN(d)&&(d=0);var e=parseFloat(c[1]);isNaN(e)&&(e=0);var g=parseFloat(c[2]);isNaN(g)&&(g=0);if(0!==d){var h=d*Math.PI/180,k=b.position.copy();isNaN(k.x)&&(k.x=0);isNaN(k.y)&&(k.y=0);if(b instanceof Y){c=b.ed.copy();c.type===Vc?c=Jq(c):c.type===Uc&&(c=a.ks(c));if(c.type===Lc)c.rotate(d,e-k.x,g-k.y),g=c.normalize(),b.ed=c,k.x-=g.x,k.y-=g.y,b.position=k;else{var d=c.na-e+k.x,l=c.oa-g+k.y,m=c.D-e+k.x,n=c.F-g+k.y;a=d*Math.cos(h)-l*Math.sin(h)+e-k.x;d=l*Math.cos(h)+
d*Math.sin(h)+g-k.y;e=m*Math.cos(h)-n*Math.sin(h)+e-k.x;g=n*Math.cos(h)+m*Math.sin(h)+g-k.y;m=Math.min(a,e);n=Math.min(d,g);c.na=a-m;c.oa=d-n;c.D=e-m;c.F=g-n;k.x+=m;k.y+=n;b.position=k;b.ed=c}b.fill instanceof fe&&(k=b.fill.copy(),c=Math.atan((0.5-k.start.y)/(0.5-k.start.x)),isNaN(c)||(c+=h,k.start=new K((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new K((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.fill=k);b.stroke instanceof fe&&(k=b.stroke.copy(),c=Math.atan((0.5-k.start.y)/(0.5-k.start.x)),isNaN(c)||
(c+=h,k.start=new K((1-Math.cos(c))/2,(1-Math.sin(c))/2),k.end=new K((1+Math.cos(c))/2,(1+Math.sin(c))/2)),b.stroke=k)}else{for(b=b.elements.k;b.next();)h=b.value.position.copy(),h.x+=k.x,h.y+=k.y,b.value.position=h;for(b.reset();b.next();)Eq(a,b.value,c);for(b.reset();b.next();)h=b.value.position.copy(),h.x-=k.x,h.y-=k.y,b.value.position=h}}}
function Fq(a,b,c){var d=parseFloat(c[0]);isNaN(d)&&(d=1);var e=parseFloat(c[1]);isNaN(e)&&(e=d);if(1!==d||1!==e){var g=b.position.copy();isNaN(g.x)&&(g.x=0);isNaN(g.y)&&(g.y=0);if(b instanceof Y)a=b.ed.copy(),g.x*=d,g.y*=e,b.position=g,a.scale(d,e),b.ed=a;else{for(b=b.elements.k;b.next();)d=b.value.position.copy(),d.x+=g.x,d.y+=g.y,b.value.position=d;for(b.reset();b.next();)Fq(a,b.value,c);for(b.reset();b.next();)d=b.value.position.copy(),d.x-=g.x,d.y-=g.y,b.value.position=d}}}
function Gq(a,b,c){var d=parseFloat(c[0]);if(!isNaN(d)){var d=d*Math.PI/180,e=b.position.copy();isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);if(b instanceof Y){c=b.ed.copy();if(c.type===Uc)c=a.ks(c);else if(c.type===Vc)c=Jq(c);else if(c.type===Tc){c.type=Lc;a=new Mc(c.na,c.oa);var g=new S(Xc,c.D,c.F);a.Ga.add(g);c.ub.add(a)}c.offset(e.x,e.y);c.transform(1,0,Math.tan(d),1,-e.x,-e.y);a=c.normalize();b.ed=c;e.x-=a.x;e.y-=a.y;b.position=e}else{for(b=b.elements.k;b.next();)d=b.value.position.copy(),d.x+=e.x,
d.y+=e.y,b.value.position=d;for(b.reset();b.next();)Gq(a,b.value,c);for(b.reset();b.next();)d=b.value.position.copy(),d.x-=e.x,d.y-=e.y,b.value.position=d}}}
function Hq(a,b,c){var d=parseFloat(c[0]);if(!isNaN(d)){var d=d*Math.PI/180,e=b.position.copy();isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);if(b instanceof Y){c=b.ed.copy();if(c.type===Uc)c=a.ks(c);else if(c.type===Vc)c=Jq(c);else if(c.type===Tc){c.type=Lc;a=new Mc(c.na,c.oa);var g=new S(Xc,c.D,c.F);a.Ga.add(g);c.ub.add(a)}c.offset(e.x,e.y);c.transform(1,Math.tan(d),0,1,-e.x,-e.y);a=c.normalize();b.ed=c;e.x-=a.x;e.y-=a.y;b.position=e}else{for(b=b.elements.k;b.next();)d=b.value.position.copy(),d.x+=e.x,
d.y+=e.y,b.value.position=d;for(b.reset();b.next();)Hq(a,b.value,c);for(b.reset();b.next();)d=b.value.position.copy(),d.x-=e.x,d.y-=e.y,b.value.position=d}}}
function Dq(a){var b=!1;if("polygon"===a.tagName)b=!0;else if("polyline"!==a.tagName)return null;var c=new Y,d=a.getAttribute("points");a=new M;var e=new H(Mc),g=d.split(/\s*[\s,]\s*/);if(4>g.length)return null;for(var h,d=new H(S),k,l,m=1;m<g.length;m+=2){k=eval(g[m-1]);l=eval(g[m]);if("number"!==typeof k||isNaN(k)||"number"!==typeof l||isNaN(l))return null;1===m?h=new Mc(k,l):d.add(new S(Xc,k,l))}b&&(b=new S(Xc,h.na,h.oa),b.close(),d.add(b));h.Ga=d;e.add(h);a.ub=e;h=a.normalize();c.position=new C(-h.x,
-h.y);c.ed=a;return c}
function Jq(a){var b=a.na,c=a.oa,d=a.D,e=a.F,g=Math.abs(d-b)/2,h=Math.abs(e-c)/2,b=Math.min(b,d)+g,c=Math.min(c,e)+h;new C;e=new Mc(b,c-h);d=new S(md);d.vb=b+J.va*g;d.Lb=c-h;d.oe=b+g;d.pe=c-J.va*h;d.D=b+g;d.F=c;e.Ga.add(d);d=new S(md);d.vb=b+g;d.Lb=c+J.va*h;d.oe=b+J.va*g;d.pe=c+h;d.D=b;d.F=c+h;e.Ga.add(d);d=new S(md);d.vb=b-J.va*g;d.Lb=c+h;d.oe=b-g;d.pe=c+J.va*h;d.D=b-g;d.F=c;e.Ga.add(d);d=new S(md);d.vb=b-g;d.Lb=c-J.va*h;d.oe=b-J.va*g;d.pe=c-h;d.D=b;d.F=c-h;e.Ga.add(d);a.type=Lc;a.ub.add(e);return a}
zq.prototype.ks=function(a){var b=a.na,c=a.oa,d=a.D,e=a.F,g=Math.min(b,d),h=Math.min(c,e),b=Math.abs(d-b),c=Math.abs(e-c),e=new Mc(g,h);e.Ga.add(new S(Xc,g+b,h));e.Ga.add(new S(Xc,g+b,h+c));e.Ga.add((new S(Xc,g,h+c)).close());a.type=Lc;a.ub.add(e);return a};ba.version="1.3.8";
window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=ba:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=ba,window.define(ba)):window.go=ba); })(window);