/*
 * GoJS v1.6.2 JavaScript Library for HTML Diagrams
 * Northwoods Software, http://www.nwoods.com/
 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
 * Copyright (C) 1998-2016 by Northwoods Software Corporation.  All Rights Reserved.
 * THIS SOFTWARE IS LICENSED.  THE LICENSE AGREEMENT IS AT: http://gojs.net/1.6.2/doc/license.html.
 */
(function(window) { var f,ca={};if(!window.document||void 0===window.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.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
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){window.clearTimeout(a)})})();
var u={dj:!1,jA:!1,KE:!1,jI:!1,CF:!1,bF:!1,rt:null,enableBoundsInfo:function(a){u.dj=!0;a&&a.iu()},disableBoundsInfo:function(a){u.dj=!1;a&&(da(a),a.iu())},HE:function(a,b){void 0===a&&(a=u.rt);void 0===b&&(b=a.Kl("").pb);var c=b.length,d=a.nb.getContext("2d");d.fillStyle="rgba(255,255,0,.3)";for(var e=0;e<c;e++){var g=b.ia(e),h=g.ba;if(null!==g.wa)u.HE(a,g.wa);else{var k=g.Fk.copy();k.MA(g.Ld);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()}}},
IE:function(a,b){a||(a=u.rt);b||(b=a.Kl("").pb);var c=a.nb.getContext("2d"),d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.ia(e),h=g.Ga,k=g.Fk;null!==g.wa?u.IE(a,g.wa):(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())}},eI:function(a,b){a||(a=u.rt);b||(b=a.Kl("").pb);var c=a.nb.getContext("2d"),d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.ia(e),h=g.Ia,k=g.Fk;null!==g.wa?u.eI(a,g.wa):(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())}},hL:function(){u.IE();u.HE()},iL:function(a){a||(a=u.rt);var b=a.Ec;a=a.nb.getContext("2d");a.strokeStyle="rgba(0,255,0,.9)";a.strokeRect(b.x,b.y,b.width,b.height)},JE: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.Ab;b.strokeRect(c.x,c.y,c.width,c.height);b.fillStyle="rgba(0,255,0,.2)";b.fillRect(a.Ec.x,a.Ec.y,a.Ec.width,a.Ec.height)},
fI:function(a,b){b instanceof fa||(a.lineWidth=2,a.strokeStyle="rgba(255,0,0,.5)",a.strokeRect(b.Yb.x,b.Yb.y,b.Yb.width,b.Yb.height),void 0!==b.stroke&&(a.strokeStyle=b.stroke),void 0!==b.ve&&(a.lineWidth=b.ve),null!==b.V&&b.V.type===ia&&(a.lineWidth=1,a.strokeStyle="rgba(10,200,10,.6)",void 0!==b.stroke&&(a.strokeStyle=b.stroke),void 0!==b.ve&&(a.lineWidth=b.ve)))},gI:function(a,b){a.lineWidth=1;a.strokeStyle="rgba(0,0,255,.5)";a.strokeRect(b.Ga.x,b.Ga.y,b.Ga.width,b.Ga.height);void 0!==b.stroke&&
(a.strokeStyle=b.stroke);void 0!==b.ve&&(a.lineWidth=b.ve)},iA:function(a,b,c){a.setTransform(1,0,0,1,0,0);a.scale(b.ge,b.ge);a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);c=b.Zb.length;for(var d=0;d<c;d++)for(var e=b.Zb.ia(d),g=e.pb.length,h=0;h<g;h++){var k=e.pb.ia(h);if(void 0!==k.location&&null!==k.location){if(k.location.G()){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)},jL:function(a,b,c){var d=a.length;b.fillStyle="rgba(255,0,0,.1)";for(var e=0;e<d;e++){var g,h=a[e];g=c.Ld;var k=h.x,l=h.y,m=k+h.width,n=l+h.height,p=g.m11,q=g.m12,r=g.m21,s=g.m22,t=g.dx,v=g.dy,y=k*p+l*r+t,h=k*q+l*s+v;g=m*p+l*r+t;var l=m*q+l*s+v,A=k*p+n*r+t,k=k*q+n*s+v,p=m*p+n*r+t,m=m*q+n*s+
v,n=y,q=h,n=Math.min(n,g),y=Math.max(y,g),q=Math.min(q,l),h=Math.max(h,l),n=Math.min(n,A),y=Math.max(y,A),q=Math.min(q,k),h=Math.max(h,k),n=Math.min(n,p),y=Math.max(y,p),q=Math.min(q,m),h=Math.max(h,m);g=new w(n,q,y-n,h-q);b.fillRect(g.x,g.y,g.width,g.height)}},hI:function(a,b,c,d,e){a.fillStyle="rgba(0,255,0,.2)";a.fillRect(b,c,d,e)},iI:function(a,b,c){a.save();var d=b.Ld;d.reset();1!==b.scale&&d.scale(b.scale);b=b.position;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.Yc.o;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()},fL:function(a){a||(a=u.rt);for(a=a.vn;a.next();)x.trace(a.value.toString())},cM:function(a,b){var c=b.to(a),d=b.Rb;d.te=b.rB(c);d.ha=c;return ja(b,d,a)},YL:function(a,b){b.ne(a.ha)&&(b.Ze.fillStyle="lime",b.Ze.im="lime",b.Ze.fillRect(a.te.x,a.te.y,1*b.scale,1*b.scale))},
ZL:function(a){var b=ka(a,!1,null,null);if(!b.Ep){a=a.Ze;for(var c=0;c<=b.Vm;c++)for(var d=0;d<=b.Wm;d++){var e=b.mc[c][d];if(0!==e){var g=c*b.Rd+b.Uf,h=d*b.Bd+b.Vf;0!==e&&(a.fillStyle="rgba(255, 0, 0, .2)",a.fillRect(g,h,b.Rd,b.Bd));999999<=e||(e%=10,a.fillStyle="blue",a.fillText(e.toString(),g,h+b.Bd))}}}},dumpReferences:function(a){if(a instanceof z)for(a=a.vn;a.next();){var b=a.value;x.trace(b.toString());for(b=b.sj;b.next();)u.dumpReferences(b.value)}else if(a instanceof D){x.trace("References for "+
a);null!==a.layer&&x.trace("  "+a.layer.toString()+' LayerName: "'+a.Jf+'"');a.Dn!==a&&x.trace("  SelectionObject: "+a.Dn.toString()+' SelectionObjectName: "'+a.Vx+'"');a.$b!==a&&x.trace("  LocationObject: "+a.$b.toString()+' LocationObjectName: "'+a.Ex+'"');if(a.Qg){for(var c="",b=a.Qg.i;b.next();)c+=b.key+" ";x.trace("  Adornments: "+c)}null!==a.Xa&&x.trace("  ContainingGroup: "+a.Xa.toString());if(a instanceof E){if(a.Fd)for(b=a.Fd.i;b.next(););if(0<a.ce.count){c="";for(b=a.ce;b.next();)c+=b.value.toString()+
", ";x.trace("  Links: "+c)}null!==a.Od&&x.trace("  LabeledLink: "+a.Od.toString());if(a instanceof F){x.trace("  Placeholder: "+a.placeholder);c="";for(b=a.Gc;b.next();)c+=b.value.toString()+", ";x.trace("  Members: "+c);c="";for(b=a.Fm.i;b.next();)c+=b.value.toString()+", ";x.trace("  NestedGroups: "+c);x.trace("  Layout: "+a.Tb)}}else if(a instanceof G){x.trace("  Path: "+a.path);x.trace("  From: "+a.Z+" "+a.ad+' "'+a.bg+'"');x.trace("  To: "+a.fa+" "+a.Ad+' "'+a.Og+'"');c="";for(b=a.If;b.next();)c+=
b.value.toString()+", ";x.trace("  LabelNodes: "+c)}}},dumpVisualTree:function(a){if(a instanceof z)for(a=a.vn;a.next();){var b=a.value;x.trace(b.toString());for(b=b.sj;b.next();)u.dumpVisualTree(b.value)}else a instanceof D&&(b=" ",a.wE&&(b+="c"),a.BE&&(b+="d"),a.$E&&(b+="g"),a.AF&&(b+="m"),a.PF&&(b+="h"),a.QF&&(b+="z"),a.VF&&(b+="o"),a.Ak&&(b+="s"),a.nG&&(b+="t"),a.cG&&(b+="A"),a.vx&&(b+="B"),a.AA&&(b+="L"),a.lb&&(b+="S"),a.xk&&(b+="H"),u.vC(a,1,b))},vC: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.ig&&(c+="p");a.Gf&&(c+="m");a.Kt&&(c+="a");d+=c;if(0!==a.ac||0!==a.column)d+=" ["+a.ac+","+a.column+"]";d+=" "+a.ba.toString();a.Ba.G()&&(d+=" d:"+a.Ba.toString());a.Ga.G()&&(d+=" n:"+a.Ga.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.zl&&(d+=" a:"+a.background.toString());a instanceof H&&(d+=" elts:"+a.wa.count,0!==a.sG&&(d+=" top:"+a.sG),0!==
a.tF&&(d+=" left:"+a.tF),null!==a.Rt&&(d+=" itemArray#:"+x.ab(a.Rt)),a.XI&&(d+=" cat:"+a.XI),null!==a.data&&(d+=" data:"+a.data));null!==a.zd&&(d+=' portId: "'+a.zd+'"');x.trace(d);if(a instanceof H)for(a=a.elements;a.next();)u.vC(a.value,b+1,"")},lL:function(a){x.trace("DelayedReferences ("+a.ng.count+")");for(a=a.ng.i;a.next();){for(var b="",c=a.value.i;c.next();)b+=la(c.value)+", ";x.trace("  "+a.key+": "+b)}},lE:function(a,b){if(!x.Ya(b)||b instanceof Element||b instanceof CanvasRenderingContext2D||
b instanceof ma||b instanceof pa)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=x.wb(b,d);if(null!==e&&"function"!==typeof e){if(b.hasOwnProperty(d)){var g=Object.getPrototypeOf(b);if(g&&g.bw&&g.bw[d])continue}else if(x.ox(b,d))continue;""===c&&(c=b+"\n");c+='  unknown property "'+d+'" has value: '+e+" at "+a+"\n"}}return c},Vw:function(a,b){if(null!==b&&void 0!==b&&"number"!==typeof b&&
"string"!==typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==x.od(b)){if(!u.qw.contains(b))if(u.qw.add(b),u.Qv.add(u.lE(a,b)),b instanceof J||b instanceof K||b instanceof ra)for(var c=b.i;c.next();)u.Vw(a+"["+c.key+"]",c.value);else for(c in b){var d=x.wb(b,c);if(void 0!==d&&null!==d&&x.Ya(d)&&d!==b.bw){if(b instanceof sa){if(d===b.Pj)continue}else if(b instanceof H){if("data"===c||d===b.Ke)continue;if("itemArray"===c||d===b.Ki)continue;if(b instanceof D&&d===b.ll)continue}else if(!(b instanceof
z))if(b instanceof ua){if("archetypeGroupData"===c||d===b.Cy)continue}else if(b instanceof va){if("archetypeLinkData"===c||d===b.Ey)continue;if("archetypeLabelNodeData"===c||d===b.Dy)continue}else if(b instanceof wa){if("archetypeNodeData"===c||d===b.Sk)continue}else if(b instanceof L){if("nodeDataArray"===c||d===b.xf)continue;if("linkDataArray"===c||d===b.wf||d===b.Bm)continue;if(d===b.vc)continue;if(d===b.ng)continue}else if(b instanceof xa||b instanceof ya||b instanceof Aa)continue;u.Vw(a+"."+
c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)u.Vw(a+"["+c+"]",b[c]);else u.Qv.add(u.lE(a,b))},checkProperties:function(a){void 0===u.qw?u.qw=new K(Object):u.qw.clear();u.Qv=new Ba;u.Vw("",a);a=u.Qv.toString();u.Qv=null;return a}};ca.Debug=u;
var x={qd:1,Tc:2,fd:4,ed:8,tn:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),RI:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),SI:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),tL:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Edge/"),wk:void 0!==window.navigator&&void 0!==window.navigator.platform&&0<=window.navigator.platform.toUpperCase().indexOf("MAC"),
lF:void 0!==window.navigator&&void 0!==window.navigator.platform&&null!==window.navigator.platform.match(/(iPhone|iPod|iPad)/i),yE:function(a,b,c){var d=-1;return function(){var e=this,g=arguments;-1!==d&&x.clearTimeout(d);d=x.setTimeout(function(){d=-1;c||a.apply(e,g)},b);c&&!d&&a.apply(e,g)}},setTimeout:function(a,b){return window.setTimeout(a,b)},clearTimeout:function(a){window.clearTimeout(a)},createElement:function(a){return window.document.createElement(a)},k:function(a){throw Error(a);},pa:function(a,
b){var c="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(c+="  to value: "+b);x.k(c)},l:function(a,b,c,d){a instanceof b||(c=x.getTypeName(c),void 0!==d&&(c+="."+d),x.jc(a,b,c))},g:function(a,b,c,d){typeof a!==b&&(c=x.getTypeName(c),void 0!==d&&(c+="."+d),x.jc(a,b,c))},p:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=x.getTypeName(b),void 0!==c&&(b+="."+c),x.k(b+" must be a real number type, and not NaN or Infinity: "+a))},Ca:function(a,b,c,d){a instanceof
Ca&&a.ye===b||(c=x.getTypeName(c),void 0!==d&&(c+="."+d),x.jc(a,"a constant of class "+x.kf(b),c))},lt:function(a,b){"string"===typeof a?Da(a)||x.k('Color "'+a+'" is not a valid color string for '+b):a instanceof Ea||x.k("Value for "+b+" must be a color string or a Brush, not "+a)},jc:function(a,b,c,d){b=x.getTypeName(b);c=x.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?x.k(c+" value is not an instance of "+b+': "'+a+'"'):x.k(c+" value is not an instance of "+b+": "+a)},la:function(a,
b,c,d){c=x.getTypeName(c);void 0!==d&&(c+="."+d);x.k(c+" is not in the range "+b+": "+a)},pd:function(a){x.k(x.kf(a)+" constructor cannot take any arguments.")},Sa:function(a){x.k("Collection was modified during iteration: "+a.toString()+"\n  Perhaps you should iterate over a copy of the collection,\n  or you could collect items to be removed from the collection after the iteration.")},trace:function(a){window.console&&window.console.log(a)},Ya:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||
a instanceof NodeList||a instanceof HTMLCollection},TI:function(a){return Array.isArray(a)},kt:function(a,b,c){x.isArray(a)||x.jc(a,"Array or NodeList or HTMLCollection",b,c)},ab:function(a){return a.length},Cl:function(a){return Array.prototype.slice.call(a)},Wa:function(a,b){Array.isArray(a);return a[b]},hE:function(a,b,c){Array.isArray(a)?a[b]=c:x.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Yz:function(a,b){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},cj:function(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):x.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},ki:function(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):x.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},ty:[],P:function(){var a=x.ty.pop();return void 0===a?new N:a},Xb:function(a,b){var c=x.ty.pop();if(void 0===c)return new N(a,b);c.x=a;c.y=b;return c},A:function(a){x.ty.push(a)},
JB:[],dm:function(){var a=x.JB.pop();return void 0===a?new Fa:a},tk:function(a){x.JB.push(a)},uy:[],kg:function(){var a=x.uy.pop();return void 0===a?new w:a},Dk:function(a,b,c,d){var e=x.uy.pop();if(void 0===e)return new w(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},qc:function(a){x.uy.push(a)},KB:[],Ih:function(){var a=x.KB.pop();return void 0===a?new Ha:a},jf:function(a){x.KB.push(a)},vy:null,u:function(){var a=x.vy;return null!==a?(x.vy=null,a):new Ia},v:function(a){a.reset();x.vy=a},IB:[],
ub:function(){var a=x.IB.pop();return void 0===a?[]:a},xa:function(a){a.length=0;x.IB.push(a)},Kh:Object.freeze([]),hm:1,lc:function(a){a.__gohashid=x.hm++},Ht:function(a){var b=a.__gohashid;void 0===b&&(b=x.hm++,a.__gohashid=b);return b},od:function(a){return a.__gohashid},ja:function(a,b){b.Hy=a;ca[a]=b},Qa:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},li:function(a){a.eH=!0},defineProperty:function(a,b,c,d,e){x.g(a,"function","Util.defineProperty:classfunc");
x.g(b,"object","Util.defineProperty:propobj");x.g(c,"function","Util.defineProperty:getter");x.g(d,"function","Util.defineProperty:setter");for(var g in b){b=b[g];c={get:c,set:d,enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,g,c);e=Object.getOwnPropertyDescriptor(a.prototype,g);b&&e&&Object.defineProperty(a.prototype,b,e);break}},qK:!1,w:function(a,b,c,d){x.g(a,"function","Util.defineReadOnlyProperty:classfunc");x.g(b,"object","Util.defineReadOnlyProperty:propobj");
x.g(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=b[e];b={get:c,set:function(a){x.k('The property "'+g+'" is read-only and cannot be set to '+a)},enumerable:!0};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);break}},Yd:function(a,b){for(var c in b)b[c]=!0;a.prototype.bw=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===
typeof a?x.kf(a):null===a?"*":""},kf:function(a){if("function"===typeof a){if(a.Hy)return a.Hy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,c).trim();if(""!==b)return a.Hy=b}else if("object"===typeof a&&a.constructor)return x.kf(a.constructor);return typeof a},s:function(a,b,c){x.g(a,"function","Util.defineEnumValue:classfunc");x.g(b,"string","Util.defineEnumValue:name");x.g(c,"number","Util.defineEnumValue:num");c=new Ca(a,b,c);Object.freeze(c);a[b]=c;var d=a.Gu;d instanceof
ra||(d=new ra("string",Ca),a.Gu=d);d.add(b,c);return c},wb: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]}catch(d){u&&x.trace("property get error: "+d.toString())}return c},Ra:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){u&&x.trace("property set error: "+d.toString())}},ru:function(a,b){x.g(a,"object",
"Setting properties requires Objects as arguments");x.g(b,"object","Setting properties requires Objects as arguments");var c=a instanceof H,d=a instanceof z,e;for(e in b){""===e&&x.k("Setting properties requires non-empty property names");var g=a,h=e;if(c||d){var k=e.indexOf(".");if(0<k){var l=e.substring(0,k);if(c)g=a.me(l);else if(g=a[l],void 0===g||null===g)g=a.vb[l];x.Ya(g)?h=e.substr(k+1):x.k("Unable to find object named: "+l+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==
h[0]&&!x.ox(g,h))if(d&&"ModelChanged"===h){a.sH(b[h]);continue}else if(d&&"Changed"===h){a.Ym(b[h]);continue}else if(d&&x.ox(a.vb,h))g=a.vb;else if(d&&Ja(a,h)){a.Tz(h,b[h]);continue}else if(a instanceof L&&"Changed"===h){a.Ym(b[h]);continue}else x.k('Trying to set undefined property "'+h+'" on object: '+g.toString());g[h]=b[e];"_"===h[0]&&g instanceof O&&g.pH(h)}},ox:function(a,b){if(a.hasOwnProperty(b))return!0;for(var c=Object.getPrototypeOf(a);c&&c!==Function;){if(c.hasOwnProperty(b))return!0;
var d=c.bw;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},FJ:function(a){for(var b=[],c=0;256>c;c++)b[c]=c;for(var d=0,e=0,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},EI: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},Dg:function(a){return x.FJ(x.EI(a))},fm:null,adym:"7da71ca0ad381e90",GH:"@COLOR1",HH:"@COLOR2"};
x.fm=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[x.Dg("7ca11abfd022028846")]=x.Dg("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[x.Dg("7ca11abfd7330390")](x.Dg(c[d-1]),10,15*d+0);b[x.Dg("7ca11abfd022028846")]=x.Dg("39f046ebb36e4b");for(d=1;5>d;d++)b[x.Dg("7ca11abfd7330390")](x.Dg(c[d-
1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])x.s=function(a,b){var c=new Ca(a,b,2);Object.freeze(c);a[b]=c;var d=a.Gu;d instanceof ra||(d=new ra("string",Ca),a.Gu=d);d.add(b,c);return c};return a}();function Ca(a,b,c){x.lc(this);this.UB=a;this.Vb=b;this.jH=c}x.ja("EnumValue",Ca);Ca.prototype.toString=function(){return x.kf(this.UB)+"."+this.Vb};x.w(Ca,{ye:"classType"},function(){return this.UB});x.w(Ca,{name:"name"},function(){return this.Vb});x.w(Ca,{value:"value"},function(){return this.jH});
var La;Ca.findName=La=function(a,b){if(void 0===b||null===b||""===b)return null;x.g(a,"function","findName:classfunc");x.g(b,"string","EnumValue.findName:name");var c=a.Gu;return c instanceof ra?c.oa(b):null};function Ba(){this.TB=[]}Ba.prototype.toString=function(){return this.TB.join("")};Ba.prototype.add=function(a){""!==a&&this.TB.push(a)};function pa(){}
function Oa(a){void 0===a&&(a=42);this.seed=a;this.ky=48271;this.Fu=2147483647;this.FB=this.Fu/this.ky;this.MG=this.Fu%this.ky;this.HG=1/this.Fu;this.random()}Oa.prototype.random=function(){var a=this.seed%this.FB*this.ky-this.seed/this.FB*this.MG;this.seed=0<a?a:a+this.Fu;return this.seed*this.HG};function Qa(){}x.w(Qa,{i:"iterator"},function(){return this});Qa.prototype.reset=Qa.prototype.reset=function(){};Qa.prototype.next=Qa.prototype.hasNext=Qa.prototype.next=function(){return!1};
Qa.prototype.first=Qa.prototype.first=function(){return null};Qa.prototype.any=function(){return!1};Qa.prototype.all=function(){return!0};Qa.prototype.each=function(){return this};Qa.prototype.map=function(){return this};Qa.prototype.filter=function(){return this};Qa.prototype.concat=function(a){return a.i};x.w(Qa,{count:"count"},function(){return 0});Qa.prototype.Pf=function(){};Qa.prototype.toString=function(){return"EmptyIterator"};var Ra=new Qa;function Sa(a){this.key=-1;this.value=a}
x.Yd(Sa,{key:!0,value:!0});x.w(Sa,{i:"iterator"},function(){return this});Sa.prototype.reset=Sa.prototype.reset=function(){this.key=-1};Sa.prototype.next=Sa.prototype.hasNext=Sa.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Sa.prototype.first=Sa.prototype.first=function(){this.key=0;return this.value};Sa.prototype.any=function(a){this.key=-1;return a(this.value)};Sa.prototype.all=function(a){this.key=-1;return a(this.value)};
Sa.prototype.each=function(a){this.key=-1;a(this.value);return this};Sa.prototype.map=function(a){return new Sa(a(this.value))};Sa.prototype.filter=function(a){return a(this.value)?new Sa(this.value):Ra};Sa.prototype.concat=function(a){return new Ua(this,a.i)};x.w(Sa,{count:"count"},function(){return 1});Sa.prototype.Pf=function(){this.value=null};Sa.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Ua(a,b){this.el=a;this.fl=b;this.Ju=!1}x.Yd(Ua,{key:!0,value:!0});
x.w(Ua,{i:"iterator"},function(){return this});Ua.prototype.reset=Ua.prototype.reset=function(){this.el.reset();this.fl.reset();this.Ju=!1};Ua.prototype.next=Ua.prototype.hasNext=Ua.prototype.next=function(){if(!this.Ju){var a=this.el;if(a.next())return this.key=a.key,this.value=a.value,!0;this.Ju=!0}return this.Ju&&(a=this.fl,a.next())?(this.key=a.key,this.value=a.value,!0):!1};Ua.prototype.first=Ua.prototype.first=function(){this.reset();return this.next()?this.value:null};
Ua.prototype.any=function(a){return this.el.any(a)||this.fl.any(a)?!0:!1};Ua.prototype.all=function(a){return this.el.all(a)&&this.fl.all(a)?!0:!1};Ua.prototype.each=function(a){this.el.each(a);this.fl.each(a);return this};Ua.prototype.map=function(a){return new Ua(this.el.map(a),this.fl.map(a))};Ua.prototype.filter=function(a){return new Ua(this.el.filter(a),this.fl.filter(a))};Ua.prototype.concat=function(a){return new Ua(this,a.i)};x.w(Ua,{count:"count"},function(){return this.el.count+this.fl.count});
Ua.prototype.Pf=function(){this.value=this.key=null};Ua.prototype.toString=function(){return"ConcatIterator()"};function Wa(a){this.Ac=a;this.$h=null;this.reset()}x.Yd(Wa,{key:!0,value:!0});x.w(Wa,{i:"iterator"},function(){return this});x.defineProperty(Wa,{zn:"predicate"},function(){return this.$h},function(a){this.$h=a});Wa.prototype.reset=Wa.prototype.reset=function(){var a=this.Ac;a.fc=null;this.qb=a.I;this.Vc=-1};
Wa.prototype.next=Wa.prototype.hasNext=Wa.prototype.next=function(){var a=this.Ac;if(a.I!==this.qb){if(0>this.key)return!1;x.Sa(a)}var a=a.o,b=a.length,c=++this.Vc,d=this.$h;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Vc=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Pf()}return!1};
Wa.prototype.first=Wa.prototype.first=function(){var a=this.Ac;this.qb=a.I;this.Vc=0;var a=a.o,b=a.length,c=this.$h;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Vc=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Wa.prototype.any=function(a){var b=this.Ac;b.fc=null;var c=b.I;this.Vc=-1;for(var d=b.o,e=d.length,g=this.$h,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(a(k))return!0;b.I!==c&&x.Sa(b)}}return!1};
Wa.prototype.all=function(a){var b=this.Ac;b.fc=null;var c=b.I;this.Vc=-1;for(var d=b.o,e=d.length,g=this.$h,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(!a(k))return!1;b.I!==c&&x.Sa(b)}}return!0};Wa.prototype.each=function(a){var b=this.Ac;b.fc=null;var c=b.I;this.Vc=-1;for(var d=b.o,e=d.length,g=this.$h,h=0;h<e;h++){var k=d[h];if(null===g||g(k))a(k),b.I!==c&&x.Sa(b)}return this};
Wa.prototype.map=function(a){var b=this.Ac;b.fc=null;var c=b.I;this.Vc=-1;for(var d=[],e=b.o,g=e.length,h=this.$h,k=0;k<g;k++){var l=e[k];if(null===h||h(l))d.push(a(l)),b.I!==c&&x.Sa(b)}a=new J;a.o=d;a.Ic();return a.i};Wa.prototype.filter=function(a){var b=this.Ac;b.fc=null;var c=b.I;this.Vc=-1;for(var d=[],e=b.o,g=e.length,h=this.$h,k=0;k<g;k++){var l=e[k];if(null===h||h(l))a(l)&&d.push(l),b.I!==c&&x.Sa(b)}a=new J(b.da);a.o=d;a.Ic();return a.i};
Wa.prototype.concat=function(a){this.Ac.fc=null;return new Ua(this,a.i)};x.w(Wa,{count:"count"},function(){var a=this.$h;if(null!==a){for(var b=0,c=this.Ac.o,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Ac.o.length});Wa.prototype.Pf=function(){this.key=-1;this.value=null;this.qb=-1;this.$h=null;this.Ac.fc=this};Wa.prototype.toString=function(){return"ListIterator@"+this.Vc+"/"+this.Ac.count};function Xa(a){this.Ac=a;this.reset()}x.Yd(Xa,{key:!0,value:!0});x.w(Xa,{i:"iterator"},function(){return this});
Xa.prototype.reset=Xa.prototype.reset=function(){var a=this.Ac;a.Mj=null;this.qb=a.I;this.Vc=a.o.length};Xa.prototype.next=Xa.prototype.hasNext=Xa.prototype.next=function(){var a=this.Ac;if(a.I!==this.qb){if(0>this.key)return!1;x.Sa(a)}var b=--this.Vc;if(0<=b)return this.key=b,this.value=a.o[b],!0;this.Pf();return!1};Xa.prototype.first=Xa.prototype.first=function(){var a=this.Ac;this.qb=a.I;var b=a.o;this.Vc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};
Xa.prototype.any=function(a){var b=this.Ac;b.Mj=null;var c=b.I,d=b.o,e=d.length;this.Vc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.I!==c&&x.Sa(b)}return!1};Xa.prototype.all=function(a){var b=this.Ac;b.Mj=null;var c=b.I,d=b.o,e=d.length;this.Vc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.I!==c&&x.Sa(b)}return!0};Xa.prototype.each=function(a){var b=this.Ac;b.Mj=null;var c=b.I,d=b.o,e=d.length;this.Vc=e;for(e-=1;0<=e;e--)a(d[e]),b.I!==c&&x.Sa(b);return this};
Xa.prototype.map=function(a){var b=this.Ac;b.Mj=null;var c=b.I,d=[],e=b.o,g=e.length;this.Vc=g;for(g-=1;0<=g;g--)d.push(a(e[g])),b.I!==c&&x.Sa(b);a=new J;a.o=d;a.Ic();return a.i};Xa.prototype.filter=function(a){var b=this.Ac;b.Mj=null;var c=b.I,d=[],e=b.o,g=e.length;this.Vc=g;for(g-=1;0<=g;g--){var h=e[g];a(h)&&d.push(h);b.I!==c&&x.Sa(b)}a=new J(b.da);a.o=d;a.Ic();return a.i};Xa.prototype.concat=function(a){this.Ac.Mj=null;return new Ua(this,a.i)};x.w(Xa,{count:"count"},function(){return this.Ac.o.length});
Xa.prototype.Pf=function(){this.key=-1;this.value=null;this.qb=-1;this.Ac.Mj=this};Xa.prototype.toString=function(){return"ListIteratorBackwards("+this.Vc+"/"+this.Ac.count+")"};
function J(a){x.lc(this);this.H=!1;this.o=[];this.I=0;this.Mj=this.fc=null;void 0===a||null===a?this.da=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.da=a:x.la(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.da=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:x.la(a,"null, a primitive type name, or a class type",
"List constructor: type")}x.ja("List",J);J.prototype.Sg=function(a){null!==this.da&&("string"===typeof this.da?typeof a===this.da&&null!==a||x.jc(a,this.da):a instanceof this.da||x.jc(a,this.da))};J.prototype.Ic=function(){var a=this.I;a++;999999999<a&&(a=0);this.I=a};J.prototype.freeze=J.prototype.freeze=function(){this.H=!0;return this};J.prototype.thaw=J.prototype.Va=function(){this.H=!1;return this};J.prototype.toString=function(){return"List("+x.getTypeName(this.da)+")#"+x.od(this)};
J.prototype.add=J.prototype.push=J.prototype.add=function(a){null!==a&&(u&&this.Sg(a),this.H&&x.pa(this,a),this.o.push(a),this.Ic())};J.prototype.addAll=J.prototype.$c=function(a){if(null===a)return this;this.H&&x.pa(this);var b=this.o;if(x.isArray(a))for(var c=x.ab(a),d=0;d<c;d++){var e=x.Wa(a,d);u&&this.Sg(e);b.push(e)}else for(a=a.i;a.next();)e=a.value,u&&this.Sg(e),b.push(e);this.Ic();return this};J.prototype.clear=J.prototype.clear=function(){this.H&&x.pa(this);this.o.length=0;this.Ic()};
J.prototype.contains=J.prototype.has=J.prototype.contains=function(a){if(null===a)return!1;u&&this.Sg(a);return-1!==this.o.indexOf(a)};J.prototype.indexOf=J.prototype.indexOf=function(a){if(null===a)return-1;u&&this.Sg(a);return this.o.indexOf(a)};J.prototype.elt=J.prototype.get=J.prototype.ia=function(a){u&&x.p(a,J,"elt:i");var b=this.o;(0>a||a>=b.length)&&x.la(a,"0 <= i < length",J,"elt:i");return b[a]};
J.prototype.setElt=J.prototype.set=J.prototype.Lg=function(a,b){u&&(this.Sg(b),x.p(a,J,"setElt:i"));var c=this.o;(0>a||a>=c.length)&&x.la(a,"0 <= i < length",J,"setElt:i");this.H&&x.pa(this,a);c[a]=b};J.prototype.first=J.prototype.first=function(){var a=this.o;return 0===a.length?null:a[0]};J.prototype.last=J.prototype.be=function(){var a=this.o,b=a.length;return 0<b?a[b-1]:null};J.prototype.pop=J.prototype.pop=function(){this.H&&x.pa(this);var a=this.o;return 0<a.length?a.pop():null};
J.prototype.any=function(a){for(var b=this.o,c=this.I,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.I!==c&&x.Sa(this)}return!1};J.prototype.all=function(a){for(var b=this.o,c=this.I,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.I!==c&&x.Sa(this)}return!0};J.prototype.each=function(a){for(var b=this.o,c=this.I,d=b.length,e=0;e<d;e++)a(b[e]),this.I!==c&&x.Sa(this);return this};
J.prototype.map=function(a){for(var b=new J,c=[],d=this.o,e=this.I,g=d.length,h=0;h<g;h++)c.push(a(d[h])),this.I!==e&&x.Sa(this);b.o=c;b.Ic();return b};J.prototype.filter=function(a){for(var b=new J(this.da),c=[],d=this.o,e=this.I,g=d.length,h=0;h<g;h++){var k=d[h];a(k)&&c.push(k);this.I!==e&&x.Sa(this)}b.o=c;b.Ic();return b};J.prototype.concat=function(a){return this.copy().$c(a)};
J.prototype.insertAt=J.prototype.Nd=function(a,b){u&&(this.Sg(b),x.p(a,J,"insertAt:i"));0>a&&x.la(a,">= 0",J,"insertAt:i");this.H&&x.pa(this,a);var c=this.o;a>=c.length?c.push(b):c.splice(a,0,b);this.Ic();return!0};J.prototype.remove=J.prototype["delete"]=J.prototype.remove=function(a){if(null===a)return!1;u&&this.Sg(a);this.H&&x.pa(this,a);var b=this.o;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Ic();return!0};
J.prototype.removeAt=J.prototype.dd=function(a){u&&x.p(a,J,"removeAt:i");var b=this.o;(0>a||a>=b.length)&&x.la(a,"0 <= i < length",J,"removeAt:i");this.H&&x.pa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Ic()};
J.prototype.removeRange=J.prototype.removeRange=function(a,b){u&&(x.p(a,J,"removeRange:from"),x.p(b,J,"removeRange:to"));var c=this.o;(0>a||a>=c.length)&&x.la(a,"0 <= from < length",J,"elt:from");(0>b||b>=c.length)&&x.la(b,"0 <= to < length",J,"elt:to");this.H&&x.pa(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.Ic()};J.prototype.copy=function(){var a=new J(this.da),b=this.o;0<b.length&&(a.o=Array.prototype.slice.call(b));return a};
J.prototype.toArray=J.prototype.kc=function(){for(var a=this.o,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};J.prototype.toSet=J.prototype.rG=function(){for(var a=new K(this.da),b=this.o,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};J.prototype.sort=J.prototype.sort=function(a){u&&x.g(a,"function",J,"sort:sortfunc");this.H&&x.pa(this);this.o.sort(a);this.Ic();return this};
J.prototype.sortRange=J.prototype.iq=function(a,b,c){var d=this.o,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);u&&(x.g(a,"function",J,"sortRange:sortfunc"),x.p(b,J,"sortRange:from"),x.p(c,J,"sortRange:to"));this.H&&x.pa(this);var g=c-b;if(1>=g)return this;(0>b||b>=e-1)&&x.la(b,"0 <= from < length",J,"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.Ic()),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.Ic();return this};J.prototype.reverse=J.prototype.reverse=function(){this.H&&x.pa(this);this.o.reverse();this.Ic();return this};x.w(J,{count:"count"},function(){return this.o.length});x.w(J,{size:"size"},function(){return this.o.length});x.w(J,{length:"length"},function(){return this.o.length});x.w(J,{i:"iterator"},function(){if(0>=this.o.length)return Ra;var a=this.fc;return null!==a?(a.reset(),a):new Wa(this)});
x.w(J,{un:"iteratorBackwards"},function(){if(0>=this.o.length)return Ra;var a=this.Mj;return null!==a?(a.reset(),a):new Xa(this)});function Ya(a){this.bi=a;this.reset()}x.Yd(Ya,{key:!0,value:!0});x.w(Ya,{i:"iterator"},function(){return this});Ya.prototype.reset=Ya.prototype.reset=function(){var a=this.bi;a.fc=null;this.qb=a.I;this.ob=null};
Ya.prototype.next=Ya.prototype.hasNext=Ya.prototype.next=function(){var a=this.bi;if(a.I!==this.qb){if(null===this.key)return!1;x.Sa(a)}var b=this.ob,b=null===b?a.La:b.cb;if(null!==b)return this.ob=b,this.value=b.value,this.key=b.key,!0;this.Pf();return!1};Ya.prototype.first=Ya.prototype.first=function(){var a=this.bi;this.qb=a.I;a=a.La;if(null!==a){this.ob=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Ya.prototype.any=function(a){var b=this.bi;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(a(d.value))return!0;b.I!==c&&x.Sa(b);d=d.cb}return!1};Ya.prototype.all=function(a){var b=this.bi;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(!a(d.value))return!1;b.I!==c&&x.Sa(b);d=d.cb}return!0};Ya.prototype.each=function(a){var b=this.bi;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;)a(d.value),b.I!==c&&x.Sa(b),d=d.cb;return this};
Ya.prototype.map=function(a){var b=this.bi;b.fc=null;for(var c=new J,d=b.I,e=b.La;null!==e;)c.add(a(e.value)),b.I!==d&&x.Sa(b),e=e.cb;return c.i};Ya.prototype.filter=function(a){var b=this.bi;b.fc=null;for(var c=new J(b.da),d=b.I,e=b.La;null!==e;){var g=e.value;a(g)&&c.add(g);b.I!==d&&x.Sa(b);e=e.cb}return c.i};Ya.prototype.concat=function(a){this.bi.fc=null;return new Ua(this,a.i)};x.w(Ya,{count:"count"},function(){return this.bi.sd});
Ya.prototype.Pf=function(){this.value=this.key=null;this.qb=-1;this.bi.fc=this};Ya.prototype.toString=function(){return null!==this.ob?"SetIterator@"+this.ob.value:"SetIterator"};
function K(a){x.lc(this);this.H=!1;void 0===a||null===a?this.da=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.da=a:x.la(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.da=a===Object?"object":a===String?"string":a===Number?"number":a:x.la(a,"null, a primitive type name, or a class type","Set constructor: type");this.td={};this.sd=0;this.fc=null;this.I=0;this.Wh=this.La=null}x.ja("Set",K);
K.prototype.Sg=function(a){null!==this.da&&("string"===typeof this.da?typeof a===this.da&&null!==a||x.jc(a,this.da):a instanceof this.da||x.jc(a,this.da))};K.prototype.Ic=function(){var a=this.I;a++;999999999<a&&(a=0);this.I=a};K.prototype.freeze=K.prototype.freeze=function(){this.H=!0;return this};K.prototype.thaw=K.prototype.Va=function(){this.H=!1;return this};K.prototype.toString=function(){return"Set("+x.getTypeName(this.da)+")#"+x.od(this)};
K.prototype.add=K.prototype.add=function(a){if(null===a)return!1;u&&this.Sg(a);this.H&&x.pa(this,a);var b=a;x.Ya(a)&&(b=x.Ht(a));return void 0===this.td[b]?(this.sd++,a=new Za(a,a),this.td[b]=a,b=this.Wh,null===b?this.La=a:(a.Po=b,b.cb=a),this.Wh=a,this.Ic(),!0):!1};K.prototype.addAll=K.prototype.$c=function(a){if(null===a)return this;this.H&&x.pa(this);if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.add(x.Wa(a,c));else for(a=a.i;a.next();)this.add(a.value);return this};
K.prototype.contains=K.prototype.has=K.prototype.contains=function(a){if(null===a)return!1;u&&this.Sg(a);var b=a;return x.Ya(a)&&(b=x.od(a),void 0===b)?!1:void 0!==this.td[b]};K.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(!this.contains(a.value))return!1;return!0};K.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(this.contains(a.value))return!0;return!1};
K.prototype.first=K.prototype.first=function(){var a=this.La;return null===a?null:a.value};K.prototype.any=function(a){for(var b=this.I,c=this.La;null!==c;){if(a(c.value))return!0;this.I!==b&&x.Sa(this);c=c.cb}return!1};K.prototype.all=function(a){for(var b=this.I,c=this.La;null!==c;){if(!a(c.value))return!1;this.I!==b&&x.Sa(this);c=c.cb}return!0};K.prototype.each=function(a){for(var b=this.I,c=this.La;null!==c;)a(c.value),this.I!==b&&x.Sa(this),c=c.cb;return this};
K.prototype.map=function(a){for(var b=new K,c=this.I,d=this.La;null!==d;)b.add(a(d.value)),this.I!==c&&x.Sa(this),d=d.cb;return b};K.prototype.filter=function(a){for(var b=new K(this.da),c=this.I,d=this.La;null!==d;){var e=d.value;a(e)&&b.add(e);this.I!==c&&x.Sa(this);d=d.cb}return b};K.prototype.concat=function(a){return this.copy().$c(a)};
K.prototype.remove=K.prototype["delete"]=K.prototype.remove=function(a){if(null===a)return!1;u&&this.Sg(a);this.H&&x.pa(this,a);var b=a;if(x.Ya(a)&&(b=x.od(a),void 0===b))return!1;a=this.td[b];if(void 0===a)return!1;var c=a.cb,d=a.Po;null!==c&&(c.Po=d);null!==d&&(d.cb=c);this.La===a&&(this.La=c);this.Wh===a&&(this.Wh=d);delete this.td[b];this.sd--;this.Ic();return!0};
K.prototype.removeAll=K.prototype.aB=function(a){if(null===a)return this;this.H&&x.pa(this);if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.remove(x.Wa(a,c));else for(a=a.i;a.next();)this.remove(a.value);return this};K.prototype.retainAll=function(a){if(null===a||0===this.count)return this;this.H&&x.pa(this);var b=new K(this.da);b.$c(a);a=[];for(var c=this.i;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.aB(a);return this};
K.prototype.clear=K.prototype.clear=function(){this.H&&x.pa(this);this.td={};this.sd=0;this.Wh=this.La=null;this.Ic()};K.prototype.copy=function(){var a=new K(this.da),b=this.td,c;for(c in b)a.add(b[c].value);return a};K.prototype.toArray=K.prototype.kc=function(){var a=Array(this.sd),b=this.td,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};K.prototype.toList=function(){var a=new J(this.da),b=this.td,c;for(c in b)a.add(b[c].value);return a};x.w(K,{count:"count"},function(){return this.sd});
x.w(K,{size:"size"},function(){return this.sd});x.w(K,{i:"iterator"},function(){if(0>=this.sd)return Ra;var a=this.fc;return null!==a?(a.reset(),a):new Ya(this)});function $a(a){this.Oa=a;this.reset()}x.Yd($a,{key:!0,value:!0});x.w($a,{i:"iterator"},function(){return this});$a.prototype.reset=$a.prototype.reset=function(){this.qb=this.Oa.I;this.ob=null};
$a.prototype.next=$a.prototype.hasNext=$a.prototype.next=function(){var a=this.Oa;if(a.I!==this.qb){if(null===this.key)return!1;x.Sa(a)}var b=this.ob,b=null===b?a.La:b.cb;if(null!==b)return this.ob=b,this.value=this.key=a=b.key,!0;this.Pf();return!1};$a.prototype.first=$a.prototype.first=function(){var a=this.Oa;this.qb=a.I;a=a.La;return null!==a?(this.ob=a,this.value=this.key=a=a.key):null};
$a.prototype.any=function(a){var b=this.Oa,c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(a(d.key))return!0;b.I!==c&&x.Sa(b);d=d.cb}return!1};$a.prototype.all=function(a){var b=this.Oa,c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(!a(d.key))return!1;b.I!==c&&x.Sa(b);d=d.cb}return!0};$a.prototype.each=function(a){var b=this.Oa,c=b.I;this.ob=null;for(var d=b.La;null!==d;)a(d.key),b.I!==c&&x.Sa(b),d=d.cb;return this};
$a.prototype.map=function(a){var b=this.Oa,c=b.I;this.ob=null;for(var d=new J,e=b.La;null!==e;)d.add(a(e.key)),b.I!==c&&x.Sa(b),e=e.cb;return d.i};$a.prototype.filter=function(a){var b=this.Oa,c=b.I;this.ob=null;for(var d=new J(b.bf),e=b.La;null!==e;){var g=e.key;a(g)&&d.add(g);b.I!==c&&x.Sa(b);e=e.cb}return d.i};$a.prototype.concat=function(a){return new Ua(this,a.i)};x.w($a,{count:"count"},function(){return this.Oa.sd});$a.prototype.Pf=function(){this.value=this.key=null;this.qb=-1};
$a.prototype.toString=function(){return null!==this.ob?"MapKeySetIterator@"+this.ob.value:"MapKeySetIterator"};function cb(a){x.lc(this);this.H=!0;this.Oa=a}x.Qa(cb,K);cb.prototype.freeze=function(){return this};cb.prototype.Va=function(){return this};cb.prototype.toString=function(){return"MapKeySet("+this.Oa.toString()+")"};cb.prototype.add=cb.prototype.set=cb.prototype.add=function(){x.k("This Set is read-only: "+this.toString());return!1};
cb.prototype.contains=cb.prototype.has=cb.prototype.contains=function(a){return this.Oa.contains(a)};cb.prototype.remove=cb.prototype["delete"]=cb.prototype.remove=function(){x.k("This Set is read-only: "+this.toString());return!1};cb.prototype.clear=cb.prototype.clear=function(){x.k("This Set is read-only: "+this.toString())};cb.prototype.first=cb.prototype.first=function(){var a=this.Oa.La;return null!==a?a.key:null};
cb.prototype.any=function(a){for(var b=this.Oa.La;null!==b;){if(a(b.key))return!0;b=b.cb}return!1};cb.prototype.all=function(a){for(var b=this.Oa.La;null!==b;){if(!a(b.key))return!1;b=b.cb}return!0};cb.prototype.each=function(a){for(var b=this.Oa.La;null!==b;)a(b.key),b=b.cb;return this};cb.prototype.map=function(a){for(var b=new K,c=this.Oa.La;null!==c;)b.add(a(c.key)),c=c.cb;return b};
cb.prototype.filter=function(a){for(var b=new K(this.Oa.bf),c=this.Oa.La;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.cb}return b};cb.prototype.concat=function(a){return this.rG().$c(a)};cb.prototype.copy=function(){return new cb(this.Oa)};cb.prototype.toSet=cb.prototype.rG=function(){var a=new K(this.Oa.bf),b=this.Oa.td,c;for(c in b)a.add(b[c].key);return a};cb.prototype.toArray=cb.prototype.kc=function(){var a=this.Oa.td,b=Array(this.Oa.sd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};
cb.prototype.toList=function(){var a=new J(this.da),b=this.Oa.td,c;for(c in b)a.add(b[c].key);return a};x.w(cb,{count:"count"},function(){return this.Oa.sd});x.w(cb,{size:"size"},function(){return this.Oa.sd});x.w(cb,{i:"iterator"},function(){return 0>=this.Oa.sd?Ra:new $a(this.Oa)});function eb(a){this.Oa=a;this.reset()}x.Yd(eb,{key:!0,value:!0});x.w(eb,{i:"iterator"},function(){return this});eb.prototype.reset=eb.prototype.reset=function(){var a=this.Oa;a.Nj=null;this.qb=a.I;this.ob=null};
eb.prototype.next=eb.prototype.hasNext=eb.prototype.next=function(){var a=this.Oa;if(a.I!==this.qb){if(null===this.key)return!1;x.Sa(a)}var b=this.ob,b=null===b?a.La:b.cb;if(null!==b)return this.ob=b,this.value=b.value,this.key=b.key,!0;this.Pf();return!1};eb.prototype.first=eb.prototype.first=function(){var a=this.Oa;this.qb=a.I;a=a.La;if(null!==a){this.ob=a;var b=a.value;this.key=a.key;return this.value=b}return null};
eb.prototype.any=function(a){var b=this.Oa;b.Nj=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(a(d.value))return!0;b.I!==c&&x.Sa(b);d=d.cb}return!1};eb.prototype.all=function(a){var b=this.Oa;b.Nj=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(!a(d.value))return!1;b.I!==c&&x.Sa(b);d=d.cb}return!0};eb.prototype.each=function(a){var b=this.Oa;b.Nj=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;)a(d.value),b.I!==c&&x.Sa(b),d=d.cb;return this};
eb.prototype.map=function(a){var b=this.Oa;b.Nj=null;var c=b.I;this.ob=null;for(var d=new J,e=b.La;null!==e;)d.add(a(e.value)),b.I!==c&&x.Sa(b),e=e.cb;return d.i};eb.prototype.filter=function(a){var b=this.Oa;b.Nj=null;var c=b.I;this.ob=null;for(var d=new J(b.bf),e=b.La;null!==e;){var g=e.value;a(g)&&d.add(g);b.I!==c&&x.Sa(b);e=e.cb}return d.i};eb.prototype.concat=function(a){this.Oa.Nj=null;return new Ua(this,a.i)};x.w(eb,{count:"count"},function(){return this.Oa.sd});
eb.prototype.Pf=function(){this.value=this.key=null;this.qb=-1;this.Oa.Nj=this};eb.prototype.toString=function(){return null!==this.ob?"MapValueSetIterator@"+this.ob.value:"MapValueSetIterator"};function Za(a,b){this.key=a;this.value=b;this.Po=this.cb=null}x.Yd(Za,{key:!0,value:!0});Za.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function fb(a){this.Oa=a;this.reset()}x.Yd(fb,{key:!0,value:!0});x.w(fb,{i:"iterator"},function(){return this});
fb.prototype.reset=fb.prototype.reset=function(){var a=this.Oa;a.fc=null;this.qb=a.I;this.ob=null};fb.prototype.next=fb.prototype.hasNext=fb.prototype.next=function(){var a=this.Oa;if(a.I!==this.qb){if(null===this.key)return!1;x.Sa(a)}var b=this.ob,b=null===b?a.La:b.cb;if(null!==b)return this.ob=b,this.key=b.key,this.value=b.value,!0;this.Pf();return!1};
fb.prototype.first=fb.prototype.first=function(){var a=this.Oa;this.qb=a.I;a=a.La;return null!==a?(this.ob=a,this.key=a.key,this.value=a.value,a):null};fb.prototype.any=function(a){var b=this.Oa;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(a(d))return!0;b.I!==c&&x.Sa(b);d=d.cb}return!1};fb.prototype.all=function(a){var b=this.Oa;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;){if(!a(d))return!1;b.I!==c&&x.Sa(b);d=d.cb}return!0};
fb.prototype.each=function(a){var b=this.Oa;b.fc=null;var c=b.I;this.ob=null;for(var d=b.La;null!==d;)a(d),b.I!==c&&x.Sa(b),d=d.cb;return this};fb.prototype.map=function(a){var b=this.Oa;b.fc=null;var c=b.I;this.ob=null;for(var d=new J,e=b.La;null!==e;)d.add(a(e)),b.I!==c&&x.Sa(b),e=e.cb;return d.i};fb.prototype.filter=function(a){var b=this.Oa;b.fc=null;var c=b.I;this.ob=null;for(var d=new J,e=b.La;null!==e;)a(e)&&d.add(e),b.I!==c&&x.Sa(b),e=e.cb;return d.i};
fb.prototype.concat=function(a){this.Oa.fc=null;return new Ua(this,a.i)};x.w(fb,{count:"count"},function(){return this.Oa.sd});fb.prototype.Pf=function(){this.value=this.key=null;this.qb=-1;this.Oa.fc=this};fb.prototype.toString=function(){return null!==this.ob?"MapIterator@"+this.ob:"MapIterator"};
function ra(a,b){x.lc(this);this.H=!1;void 0===a||null===a?this.bf=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.bf=a:x.la(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.bf=a===Object?"object":a===String?"string":a===Number?"number":a:x.la(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.ii=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
b||"function"===b?this.ii=b:x.la(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.ii=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:x.la(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.td={};this.sd=0;this.Nj=this.fc=null;this.I=0;this.Wh=this.La=null}x.ja("Map",ra);
function hb(a,b){null!==a.bf&&("string"===typeof a.bf?typeof b===a.bf&&null!==b||x.jc(b,a.bf):b instanceof a.bf||x.jc(b,a.bf))}ra.prototype.Ic=function(){var a=this.I;a++;999999999<a&&(a=0);this.I=a};ra.prototype.freeze=ra.prototype.freeze=function(){this.H=!0;return this};ra.prototype.thaw=ra.prototype.Va=function(){this.H=!1;return this};ra.prototype.toString=function(){return"Map("+x.getTypeName(this.bf)+","+x.getTypeName(this.ii)+")#"+x.od(this)};
ra.prototype.add=ra.prototype.set=ra.prototype.add=function(a,b){u&&(hb(this,a),null!==this.ii&&("string"===typeof this.ii?typeof b===this.ii&&null!==b||x.jc(b,this.ii):b instanceof this.ii||x.jc(b,this.ii)));this.H&&x.pa(this,a);var c=a;x.Ya(a)&&(c=x.Ht(a));var d=this.td[c];if(void 0===d)return this.sd++,d=new Za(a,b),this.td[c]=d,c=this.Wh,null===c?this.La=d:(d.Po=c,c.cb=d),this.Wh=d,this.Ic(),!0;d.value=b;return!1};
ra.prototype.addAll=ra.prototype.$c=function(a){if(null===a)return this;if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++){var d=x.Wa(a,c);this.add(d.key,d.value)}else for(a=a.i;a.next();)this.add(a.key,a.value);return this};ra.prototype.first=ra.prototype.first=function(){return this.La};ra.prototype.any=function(a){for(var b=this.I,c=this.La;null!==c;){if(a(c))return!0;this.I!==b&&x.Sa(this);c=c.cb}return!1};
ra.prototype.all=function(a){for(var b=this.I,c=this.La;null!==c;){if(!a(c))return!1;this.I!==b&&x.Sa(this);c=c.cb}return!0};ra.prototype.each=function(a){for(var b=this.I,c=this.La;null!==c;)a(c),this.I!==b&&x.Sa(this),c=c.cb;return this};ra.prototype.map=function(a){for(var b=new ra(this.bf),c=this.I,d=this.La;null!==d;)b.add(d.key,a(d)),this.I!==c&&x.Sa(this),d=d.cb;return b};
ra.prototype.filter=function(a){for(var b=new ra(this.bf,this.ii),c=this.I,d=this.La;null!==d;)a(d)&&b.add(d.key,d.value),this.I!==c&&x.Sa(this),d=d.cb;return b};ra.prototype.concat=function(a){return this.copy().$c(a)};ra.prototype.contains=ra.prototype.has=ra.prototype.contains=function(a){u&&hb(this,a);var b=a;return x.Ya(a)&&(b=x.od(a),void 0===b)?!1:void 0!==this.td[b]};
ra.prototype.getValue=ra.prototype.get=ra.prototype.oa=function(a){u&&hb(this,a);var b=a;if(x.Ya(a)&&(b=x.od(a),void 0===b))return null;a=this.td[b];return void 0===a?null:a.value};
ra.prototype.remove=ra.prototype["delete"]=ra.prototype.remove=function(a){if(null===a)return!1;u&&hb(this,a);this.H&&x.pa(this,a);var b=a;if(x.Ya(a)&&(b=x.od(a),void 0===b))return!1;a=this.td[b];if(void 0===a)return!1;var c=a.cb,d=a.Po;null!==c&&(c.Po=d);null!==d&&(d.cb=c);this.La===a&&(this.La=c);this.Wh===a&&(this.Wh=d);delete this.td[b];this.sd--;this.Ic();return!0};ra.prototype.clear=ra.prototype.clear=function(){this.H&&x.pa(this);this.td={};this.sd=0;this.Wh=this.La=null;this.Ic()};
ra.prototype.copy=function(){var a=new ra(this.bf,this.ii),b=this.td,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ra.prototype.toArray=ra.prototype.kc=function(){var a=this.td,b=Array(this.sd),c=0,d;for(d in a){var e=a[d];b[c]=new Za(e.key,e.value);c++}return b};ra.prototype.toKeySet=ra.prototype.vj=function(){return new cb(this)};x.w(ra,{count:"count"},function(){return this.sd});x.w(ra,{size:"size"},function(){return this.sd});
x.w(ra,{i:"iterator"},function(){if(0>=this.count)return Ra;var a=this.fc;return null!==a?(a.reset(),a):new fb(this)});x.w(ra,{qF:"iteratorKeys"},function(){return 0>=this.count?Ra:new $a(this)});x.w(ra,{rF:"iteratorValues"},function(){if(0>=this.count)return Ra;var a=this.Nj;return null!==a?(a.reset(),a):new eb(this)});function N(a,b){void 0===a?this.L=this.K=0:"number"===typeof a&&"number"===typeof b?(this.K=a,this.L=b):x.k("Invalid arguments to Point constructor: "+a+", "+b);this.H=!1}
x.ja("Point",N);x.li(N);x.Yd(N,{x:!0,y:!0});N.prototype.assign=function(a){this.K=a.K;this.L=a.L};N.prototype.setTo=N.prototype.n=function(a,b){u&&(x.g(a,"number",N,"setTo:x"),x.g(b,"number",N,"setTo:y"));this.K=a;this.L=b;return this};N.prototype.set=N.prototype.set=function(a){u&&x.l(a,N,N,"set:p");this.Pa();this.K=a.K;this.L=a.L;return this};N.prototype.copy=function(){var a=new N;a.K=this.K;a.L=this.L;return a};f=N.prototype;f.Ma=function(){this.H=!0;Object.freeze(this);return this};
f.Y=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.H=!0;return this};f.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;return this};f.Pa=function(a){if(this.H){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);x.k(b)}};
N.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 N(c,e)}return new N};N.stringify=function(a){return a instanceof N?a.x.toString()+" "+a.y.toString():a.toString()};N.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};N.prototype.equals=N.prototype.O=function(a){return a instanceof N?this.K===a.x&&this.L===a.y:!1};
N.prototype.equalTo=N.prototype.gx=function(a,b){return this.K===a&&this.L===b};N.prototype.equalsApprox=N.prototype.wd=function(a){return Q.F(this.K,a.x)&&Q.F(this.L,a.y)};N.prototype.add=N.prototype.add=function(a){u&&x.l(a,N,N,"add:p");this.Pa();this.K+=a.x;this.L+=a.y;return this};N.prototype.subtract=N.prototype.yu=function(a){u&&x.l(a,N,N,"subtract:p");this.Pa();this.K-=a.x;this.L-=a.y;return this};
N.prototype.offset=N.prototype.offset=function(a,b){u&&(x.p(a,N,"offset:dx"),x.p(b,N,"offset:dy"));this.Pa();this.K+=a;this.L+=b;return this};N.prototype.rotate=N.prototype.rotate=function(a){u&&x.p(a,N,"rotate:angle");this.Pa();if(0===a)return this;var b=this.K,c=this.L;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.K=d*b-e*c;this.L=e*b+d*c;return this};
N.prototype.scale=N.prototype.scale=function(a,b){u&&(x.p(a,N,"scale:sx"),x.p(b,N,"scale:sy"));this.K*=a;this.L*=b;return this};N.prototype.distanceSquaredPoint=N.prototype.qk=function(a){u&&x.l(a,N,N,"distanceSquaredPoint:p");var b=a.x-this.K;a=a.y-this.L;return b*b+a*a};N.prototype.distanceSquared=N.prototype.qp=function(a,b){u&&(x.p(a,N,"distanceSquared:px"),x.p(b,N,"distanceSquared:py"));var c=a-this.K,d=b-this.L;return c*c+d*d};
N.prototype.normalize=N.prototype.normalize=function(){this.Pa();var a=this.K,b=this.L,c=Math.sqrt(a*a+b*b);0<c&&(this.K=a/c,this.L=b/c);return this};N.prototype.directionPoint=N.prototype.qh=function(a){u&&x.l(a,N,N,"directionPoint:p");return mb(a.x-this.K,a.y-this.L)};N.prototype.direction=N.prototype.direction=function(a,b){u&&(x.p(a,N,"direction:px"),x.p(b,N,"direction:py"));return mb(a-this.K,b-this.L)};
function mb(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}N.prototype.projectOntoLineSegment=function(a,b,c,d){u&&(x.p(a,N,"projectOntoLineSegment:px"),x.p(b,N,"projectOntoLineSegment:py"),x.p(c,N,"projectOntoLineSegment:qx"),x.p(d,N,"projectOntoLineSegment:qy"));Q.xn(a,b,c,d,this.K,this.L,this);return this};
N.prototype.projectOntoLineSegmentPoint=function(a,b){u&&(x.l(a,N,N,"projectOntoLineSegmentPoint:p"),x.l(b,N,N,"projectOntoLineSegmentPoint:q"));Q.xn(a.x,a.y,b.x,b.y,this.K,this.L,this);return this};N.prototype.snapToGrid=function(a,b,c,d){u&&(x.p(a,N,"snapToGrid:originx"),x.p(b,N,"snapToGrid:originy"),x.p(c,N,"snapToGrid:cellwidth"),x.p(d,N,"snapToGrid:cellheight"));Q.xt(this.K,this.L,a,b,c,d,this);return this};
N.prototype.snapToGridPoint=function(a,b){u&&(x.l(a,N,N,"snapToGridPoint:p"),x.l(b,Fa,N,"snapToGridPoint:q"));Q.xt(this.K,this.L,a.x,a.y,b.width,b.height,this);return this};N.prototype.setRectSpot=N.prototype.su=function(a,b){u&&(x.l(a,w,N,"setRectSpot:r"),x.l(b,R,N,"setRectSpot:spot"));this.Pa();this.K=a.x+b.x*a.width+b.offsetX;this.L=a.y+b.y*a.height+b.offsetY;return this};
N.prototype.setSpot=N.prototype.uu=function(a,b,c,d,e){u&&(x.p(a,N,"setSpot:x"),x.p(b,N,"setSpot:y"),x.p(c,N,"setSpot:w"),x.p(d,N,"setSpot:h"),(0>c||0>d)&&x.k("Point.setSpot:Width and height cannot be negative"),x.l(e,R,N,"setSpot:spot"));this.Pa();this.K=a+e.x*c+e.offsetX;this.L=b+e.y*d+e.offsetY;return this};N.prototype.transform=function(a){u&&x.l(a,Ha,N,"transform:t");a.Fb(this);return this};function rb(a,b){u&&x.l(b,Ha,N,"transformInverted:t");b.oi(a);return a}var sb;
N.distanceLineSegmentSquared=sb=function(a,b,c,d,e,g){u&&(x.p(a,N,"distanceLineSegmentSquared:px"),x.p(b,N,"distanceLineSegmentSquared:py"),x.p(c,N,"distanceLineSegmentSquared:ax"),x.p(d,N,"distanceLineSegmentSquared:ay"),x.p(e,N,"distanceLineSegmentSquared:bx"),x.p(g,N,"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 tb;
N.distanceSquared=tb=function(a,b,c,d){u&&(x.p(a,N,"distanceSquared:px"),x.p(b,N,"distanceSquared:py"),x.p(c,N,"distanceSquared:qx"),x.p(d,N,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var ub;
N.direction=ub=function(a,b,c,d){u&&(x.p(a,N,"direction:px"),x.p(b,N,"direction:py"),x.p(c,N,"direction:qx"),x.p(d,N,"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};x.defineProperty(N,{x:"x"},function(){return this.K},function(a){this.Pa(a);u&&x.g(a,"number",N,"x");this.K=a});
x.defineProperty(N,{y:"y"},function(){return this.L},function(a){this.Pa(a);u&&x.g(a,"number",N,"y");this.L=a});N.prototype.isReal=N.prototype.G=function(){return isFinite(this.x)&&isFinite(this.y)};function Fa(a,b){void 0===a?this.Ea=this.Fa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.Fa=a,this.Ea=b):x.k("Invalid arguments to Size constructor: "+a+", "+b);this.H=!1}x.ja("Size",Fa);x.li(Fa);x.Yd(Fa,{width:!0,height:!0});
Fa.prototype.assign=function(a){this.Fa=a.Fa;this.Ea=a.Ea};Fa.prototype.setTo=Fa.prototype.n=function(a,b){u&&(x.g(a,"number",Fa,"setTo:w"),x.g(b,"number",Fa,"setTo:h"),0>a&&x.la(a,">= 0",Fa,"setTo:w"),0>b&&x.la(b,">= 0",Fa,"setTo:h"));this.Fa=a;this.Ea=b;return this};Fa.prototype.set=Fa.prototype.set=function(a){u&&x.l(a,Fa,Fa,"set:s");this.Pa();this.Fa=a.Fa;this.Ea=a.Ea;return this};Fa.prototype.copy=function(){var a=new Fa;a.Fa=this.Fa;a.Ea=this.Ea;return a};f=Fa.prototype;
f.Ma=function(){this.H=!0;Object.freeze(this);return this};f.Y=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.H=!0;return this};f.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;return this};f.Pa=function(a){if(this.H){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);x.k(b)}};
Fa.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 Fa(c,e)}return new Fa};Fa.stringify=function(a){return a instanceof Fa?a.width.toString()+" "+a.height.toString():a.toString()};Fa.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};
Fa.prototype.equals=Fa.prototype.O=function(a){return a instanceof Fa?this.Fa===a.width&&this.Ea===a.height:!1};Fa.prototype.equalTo=Fa.prototype.gx=function(a,b){return this.Fa===a&&this.Ea===b};Fa.prototype.equalsApprox=Fa.prototype.wd=function(a){return Q.F(this.Fa,a.width)&&Q.F(this.Ea,a.height)};x.defineProperty(Fa,{width:"width"},function(){return this.Fa},function(a){this.Pa(a);u&&x.g(a,"number",Fa,"width");0>a&&x.la(a,">= 0",Fa,"width");this.Fa=a});
x.defineProperty(Fa,{height:"height"},function(){return this.Ea},function(a){this.Pa(a);u&&x.g(a,"number",Fa,"height");0>a&&x.la(a,">= 0",Fa,"height");this.Ea=a});Fa.prototype.isReal=Fa.prototype.G=function(){return isFinite(this.width)&&isFinite(this.height)};
function w(a,b,c,d){void 0===a?this.Ea=this.Fa=this.L=this.K=0:a instanceof N?b instanceof N?(this.K=Math.min(a.K,b.K),this.L=Math.min(a.L,b.L),this.Fa=Math.abs(a.K-b.K),this.Ea=Math.abs(a.L-b.L)):b instanceof Fa?(this.K=a.K,this.L=a.L,this.Fa=b.Fa,this.Ea=b.Ea):x.k("Incorrect arguments supplied to Rect constructor"):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.K=a,this.L=b,this.Fa=c,this.Ea=d):x.k("Invalid arguments to Rect constructor: "+
a+", "+b+", "+c+", "+d);this.H=!1}x.ja("Rect",w);x.li(w);x.Yd(w,{x:!0,y:!0,width:!0,height:!0});w.prototype.assign=function(a){this.K=a.K;this.L=a.L;this.Fa=a.Fa;this.Ea=a.Ea};function vb(a,b,c){a.Fa=b;a.Ea=c}w.prototype.setTo=w.prototype.n=function(a,b,c,d){u&&(x.g(a,"number",w,"setTo:x"),x.g(b,"number",w,"setTo:y"),x.g(c,"number",w,"setTo:w"),x.g(d,"number",w,"setTo:h"),0>c&&x.la(c,">= 0",w,"setTo:w"),0>d&&x.la(d,">= 0",w,"setTo:h"));this.K=a;this.L=b;this.Fa=c;this.Ea=d;return this};
w.prototype.set=w.prototype.set=function(a){u&&x.l(a,w,w,"set:r");this.Pa();this.K=a.K;this.L=a.L;this.Fa=a.Fa;this.Ea=a.Ea;return this};w.prototype.setPoint=w.prototype.Mf=function(a){u&&x.l(a,N,w,"setPoint:p");this.Pa();this.K=a.K;this.L=a.L;return this};w.prototype.setSize=function(a){u&&x.l(a,Fa,w,"setSize:s");this.Pa();this.Fa=a.Fa;this.Ea=a.Ea;return this};w.prototype.copy=function(){var a=new w;a.K=this.K;a.L=this.L;a.Fa=this.Fa;a.Ea=this.Ea;return a};f=w.prototype;
f.Ma=function(){this.H=!0;Object.freeze(this);return this};f.Y=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.H=!0;return this};f.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;return this};f.Pa=function(a){if(this.H){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);x.k(b)}};
w.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 w(c,e,g,h)}return new w};w.stringify=function(a){return a instanceof w?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};
w.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};w.prototype.equals=w.prototype.O=function(a){return a instanceof w?this.K===a.x&&this.L===a.y&&this.Fa===a.width&&this.Ea===a.height:!1};w.prototype.equalTo=w.prototype.gx=function(a,b,c,d){return this.K===a&&this.L===b&&this.Fa===c&&this.Ea===d};w.prototype.equalsApprox=w.prototype.wd=function(a){return Q.F(this.K,a.x)&&Q.F(this.L,a.y)&&Q.F(this.Fa,a.width)&&Q.F(this.Ea,a.height)};
w.prototype.containsPoint=w.prototype.Na=function(a){u&&x.l(a,N,w,"containsPoint:p");return this.K<=a.x&&this.K+this.Fa>=a.x&&this.L<=a.y&&this.L+this.Ea>=a.y};w.prototype.containsRect=w.prototype.pk=function(a){u&&x.l(a,w,w,"containsRect:r");return this.K<=a.x&&a.x+a.width<=this.K+this.Fa&&this.L<=a.y&&a.y+a.height<=this.L+this.Ea};
w.prototype.contains=w.prototype.contains=function(a,b,c,d){u?(x.p(a,w,"contains:x"),x.p(b,w,"contains:y"),void 0===c?c=0:x.p(c,w,"contains:w"),void 0===d?d=0:x.p(d,w,"contains:h"),(0>c||0>d)&&x.k("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.K<=a&&a+c<=this.K+this.Fa&&this.L<=b&&b+d<=this.L+this.Ea};w.prototype.reset=function(){this.Pa();this.Ea=this.Fa=this.L=this.K=0};
w.prototype.offset=w.prototype.offset=function(a,b){u&&(x.p(a,w,"offset:dx"),x.p(b,w,"offset:dy"));this.Pa();this.K+=a;this.L+=b;return this};w.prototype.inflate=w.prototype.cg=function(a,b){u&&(x.p(a,w,"inflate:w"),x.p(b,w,"inflate:h"));return wb(this,b,a,b,a)};w.prototype.addMargin=w.prototype.Kw=function(a){u&&x.l(a,yb,w,"addMargin:m");return wb(this,a.top,a.right,a.bottom,a.left)};
w.prototype.subtractMargin=w.prototype.cK=function(a){u&&x.l(a,yb,w,"subtractMargin:m");return wb(this,-a.top,-a.right,-a.bottom,-a.left)};w.prototype.grow=function(a,b,c,d){u&&(x.p(a,w,"grow:t"),x.p(b,w,"grow:r"),x.p(c,w,"grow:b"),x.p(d,w,"grow:l"));return wb(this,a,b,c,d)};function wb(a,b,c,d,e){a.Pa();var g=a.Fa;c+e<=-g?(a.K+=g/2,a.Fa=0):(a.K-=e,a.Fa+=c+e);c=a.Ea;b+d<=-c?(a.L+=c/2,a.Ea=0):(a.L-=b,a.Ea+=b+d);return a}
w.prototype.intersectRect=function(a){u&&x.l(a,w,w,"intersectRect:r");return zb(this,a.x,a.y,a.width,a.height)};w.prototype.intersect=function(a,b,c,d){u&&(x.p(a,w,"intersect:x"),x.p(b,w,"intersect:y"),x.p(c,w,"intersect:w"),x.p(d,w,"intersect:h"),(0>c||0>d)&&x.k("Rect.intersect:Width and height cannot be negative"));return zb(this,a,b,c,d)};
function zb(a,b,c,d,e){a.Pa();var g=Math.max(a.K,b),h=Math.max(a.L,c);b=Math.min(a.K+a.Fa,b+d);c=Math.min(a.L+a.Ea,c+e);a.K=g;a.L=h;a.Fa=Math.max(0,b-g);a.Ea=Math.max(0,c-h);return a}w.prototype.intersectsRect=w.prototype.Hg=function(a){u&&x.l(a,w,w,"intersectsRect:r");return this.eF(a.x,a.y,a.width,a.height)};
w.prototype.intersects=w.prototype.eF=function(a,b,c,d){u&&(x.p(a,w,"intersects:x"),x.p(b,w,"intersects:y"),x.p(a,w,"intersects:w"),x.p(b,w,"intersects:h"),(0>c||0>d)&&x.k("Rect.intersects:Width and height cannot be negative"));var e=this.Fa,g=this.K;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.Ea;c=this.L;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
function Db(a,b){var c=a.Fa,d=b.width+10+10,e=a.K,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.Ea;d=b.height+10+10;e=a.L;g=b.y-10;return e>d+g||g>c+e?!1:!0}w.prototype.unionPoint=w.prototype.wj=function(a){u&&x.l(a,N,w,"unionPoint:p");return Eb(this,a.x,a.y,0,0)};w.prototype.unionRect=w.prototype.si=function(a){u&&x.l(a,w,w,"unionRect:r");return Eb(this,a.K,a.L,a.Fa,a.Ea)};
w.prototype.union=w.prototype.AG=function(a,b,c,d){this.Pa();u?(x.p(a,w,"union:x"),x.p(b,w,"union:y"),void 0===c?c=0:x.p(c,w,"union:w"),void 0===d?d=0:x.p(d,w,"union:h"),(0>c||0>d)&&x.k("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return Eb(this,a,b,c,d)};function Eb(a,b,c,d,e){var g=Math.min(a.K,b),h=Math.min(a.L,c);b=Math.max(a.K+a.Fa,b+d);c=Math.max(a.L+a.Ea,c+e);a.K=g;a.L=h;a.Fa=b-g;a.Ea=c-h;return a}
w.prototype.setSpot=w.prototype.uu=function(a,b,c){u&&(x.p(a,w,"setSpot:x"),x.p(b,w,"setSpot:y"),x.l(c,R,w,"setSpot:spot"));this.Pa();this.K=a-c.offsetX-c.x*this.Fa;this.L=b-c.offsetY-c.y*this.Ea;return this};var Gb;
w.contains=Gb=function(a,b,c,d,e,g,h,k){u?(x.p(a,w,"contains:rx"),x.p(b,w,"contains:ry"),x.p(c,w,"contains:rw"),x.p(d,w,"contains:rh"),x.p(e,w,"contains:x"),x.p(g,w,"contains:y"),void 0===h?h=0:x.p(h,w,"contains:w"),void 0===k?k=0:x.p(k,w,"contains:h"),(0>c||0>d||0>h||0>k)&&x.k("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};
w.intersects=function(a,b,c,d,e,g,h,k){u&&(x.p(a,w,"intersects:rx"),x.p(b,w,"intersects:ry"),x.p(c,w,"intersects:rw"),x.p(d,w,"intersects:rh"),x.p(e,w,"intersects:x"),x.p(g,w,"intersects:y"),x.p(h,w,"intersects:w"),x.p(k,w,"intersects:h"),(0>c||0>d||0>h||0>k)&&x.k("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};x.defineProperty(w,{x:"x"},function(){return this.K},function(a){this.Pa(a);u&&x.g(a,"number",w,"x");this.K=a});
x.defineProperty(w,{y:"y"},function(){return this.L},function(a){this.Pa(a);u&&x.g(a,"number",w,"y");this.L=a});x.defineProperty(w,{width:"width"},function(){return this.Fa},function(a){this.Pa(a);u&&x.g(a,"number",w,"width");0>a&&x.la(a,">= 0",w,"width");this.Fa=a});x.defineProperty(w,{height:"height"},function(){return this.Ea},function(a){this.Pa(a);u&&x.g(a,"number",w,"height");0>a&&x.la(a,">= 0",w,"height");this.Ea=a});
x.defineProperty(w,{left:"left"},function(){return this.K},function(a){this.Pa(a);u&&x.g(a,"number",w,"left");this.K=a});x.defineProperty(w,{top:"top"},function(){return this.L},function(a){this.Pa(a);u&&x.g(a,"number",w,"top");this.L=a});x.defineProperty(w,{right:"right"},function(){return this.K+this.Fa},function(a){this.Pa(a);u&&x.p(a,w,"right");this.K+=a-(this.K+this.Fa)});
x.defineProperty(w,{bottom:"bottom"},function(){return this.L+this.Ea},function(a){this.Pa(a);u&&x.p(a,w,"top");this.L+=a-(this.L+this.Ea)});x.defineProperty(w,{position:"position"},function(){return new N(this.K,this.L)},function(a){this.Pa(a);u&&x.l(a,N,w,"position");this.K=a.x;this.L=a.y});x.defineProperty(w,{size:"size"},function(){return new Fa(this.Fa,this.Ea)},function(a){this.Pa(a);u&&x.l(a,Fa,w,"size");this.Fa=a.width;this.Ea=a.height});
x.defineProperty(w,{Bl:"center"},function(){return new N(this.K+this.Fa/2,this.L+this.Ea/2)},function(a){this.Pa(a);u&&x.l(a,N,w,"center");this.K=a.x-this.Fa/2;this.L=a.y-this.Ea/2});x.defineProperty(w,{sa:"centerX"},function(){return this.K+this.Fa/2},function(a){this.Pa(a);u&&x.p(a,w,"centerX");this.K=a-this.Fa/2});x.defineProperty(w,{Aa:"centerY"},function(){return this.L+this.Ea/2},function(a){this.Pa(a);u&&x.p(a,w,"centerY");this.L=a-this.Ea/2});
w.prototype.isReal=w.prototype.G=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};w.prototype.isEmpty=function(){return 0===this.width&&0===this.height};
function yb(a,b,c,d){void 0===a?this.Zg=this.Rg=this.hh=this.kh=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):x.k("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.H=!1}x.ja("Margin",yb);x.li(yb);x.Yd(yb,{top:!0,right:!0,bottom:!0,left:!0});yb.prototype.assign=function(a){this.kh=a.kh;this.hh=a.hh;this.Rg=a.Rg;this.Zg=a.Zg};
yb.prototype.setTo=yb.prototype.n=function(a,b,c,d){u&&(x.g(a,"number",yb,"setTo:t"),x.g(b,"number",yb,"setTo:r"),x.g(c,"number",yb,"setTo:b"),x.g(d,"number",yb,"setTo:l"));this.Pa();this.kh=a;this.hh=b;this.Rg=c;this.Zg=d;return this};yb.prototype.set=yb.prototype.set=function(a){u&&x.l(a,yb,yb,"assign:m");this.Pa();this.kh=a.kh;this.hh=a.hh;this.Rg=a.Rg;this.Zg=a.Zg;return this};yb.prototype.copy=function(){var a=new yb;a.kh=this.kh;a.hh=this.hh;a.Rg=this.Rg;a.Zg=this.Zg;return a};f=yb.prototype;
f.Ma=function(){this.H=!0;Object.freeze(this);return this};f.Y=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.H=!0;return this};f.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;return this};f.Pa=function(a){if(this.H){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);x.k(b)}};
yb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new yb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new yb(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new yb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new yb(c,e):new yb(c,e,g,h)}return new yb};
yb.stringify=function(a){return a instanceof yb?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};yb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};yb.prototype.equals=yb.prototype.O=function(a){return a instanceof yb?this.kh===a.top&&this.hh===a.right&&this.Rg===a.bottom&&this.Zg===a.left:!1};
yb.prototype.equalTo=yb.prototype.gx=function(a,b,c,d){return this.kh===a&&this.hh===b&&this.Rg===c&&this.Zg===d};yb.prototype.equalsApprox=yb.prototype.wd=function(a){return Q.F(this.kh,a.top)&&Q.F(this.hh,a.right)&&Q.F(this.Rg,a.bottom)&&Q.F(this.Zg,a.left)};x.defineProperty(yb,{top:"top"},function(){return this.kh},function(a){this.Pa(a);u&&x.p(a,yb,"top");this.kh=a});x.defineProperty(yb,{right:"right"},function(){return this.hh},function(a){this.Pa(a);u&&x.p(a,yb,"right");this.hh=a});
x.defineProperty(yb,{bottom:"bottom"},function(){return this.Rg},function(a){this.Pa(a);u&&x.p(a,yb,"bottom");this.Rg=a});x.defineProperty(yb,{left:"left"},function(){return this.Zg},function(a){this.Pa(a);u&&x.p(a,yb,"left");this.Zg=a});yb.prototype.isReal=yb.prototype.G=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function Ha(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}x.li(Ha);
x.Yd(Ha,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});Ha.prototype.set=Ha.prototype.set=function(a){u&&x.l(a,Ha,Ha,"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};Ha.prototype.copy=function(){var a=new Ha;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};Ha.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
Ha.prototype.equals=Ha.prototype.O=function(a){return a instanceof Ha?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};Ha.prototype.isIdentity=Ha.prototype.Nt=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};Ha.prototype.reset=Ha.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
Ha.prototype.multiply=Ha.prototype.multiply=function(a){u&&x.l(a,Ha,Ha,"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};
Ha.prototype.multiplyInverted=Ha.prototype.MA=function(a){u&&x.l(a,Ha,Ha,"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};
Ha.prototype.invert=Ha.prototype.wA=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;return this};
Ha.prototype.rotate=Ha.prototype.rotate=function(a,b,c){u&&(x.p(a,Ha,"rotate:angle"),x.p(b,Ha,"rotate:rx"),x.p(c,Ha,"rotate:ry"));360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var g=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=g;this.m22=h;this.translate(-b,-c);return this};
Ha.prototype.translate=Ha.prototype.translate=function(a,b){u&&(x.p(a,Ha,"translate:x"),x.p(b,Ha,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};Ha.prototype.scale=Ha.prototype.scale=function(a,b){void 0===b&&(b=a);u&&(x.p(a,Ha,"translate:sx"),x.p(b,Ha,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};
Ha.prototype.transformPoint=Ha.prototype.Fb=function(a){u&&x.l(a,N,Ha,"transformPoint:p");var b=a.K,c=a.L;a.K=b*this.m11+c*this.m21+this.dx;a.L=b*this.m12+c*this.m22+this.dy;return a};Ha.prototype.invertedTransformPoint=Ha.prototype.oi=function(a){u&&x.l(a,N,Ha,"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.K,h=a.L;a.K=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.L=g*c+h*d+e;return a};
Ha.prototype.transformRect=Ha.prototype.yG=function(a){u&&x.l(a,w,Ha,"transformRect:rect");var b=a.K,c=a.L,d=b+a.Fa,e=c+a.Ea,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.K=p;a.L=h;a.Fa=
e-p;a.Ea=q-h;return a};function R(a,b,c,d){void 0===a?this.wg=this.vg=this.L=this.K=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);this.H=!1}x.ja("Spot",R);x.li(R);x.Yd(R,{x:!0,y:!0,offsetX:!0,offsetY:!0});R.prototype.assign=function(a){this.K=a.K;this.L=a.L;this.vg=a.vg;this.wg=a.wg};
R.prototype.setTo=R.prototype.n=function(a,b,c,d){u&&(Hb(a,"setTo:x"),Hb(b,"setTo:y"),Mb(c,"setTo:offx"),Mb(d,"setTo:offy"));this.Pa();this.K=a;this.L=b;this.vg=c;this.wg=d;return this};R.prototype.set=R.prototype.set=function(a){u&&x.l(a,R,R,"set:s");this.Pa();this.K=a.K;this.L=a.L;this.vg=a.vg;this.wg=a.wg;return this};R.prototype.copy=function(){var a=new R;a.K=this.K;a.L=this.L;a.vg=this.vg;a.wg=this.wg;return a};f=R.prototype;f.Ma=function(){this.H=!0;Object.freeze(this);return this};
f.Y=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.H=!0;return this};f.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;return this};f.Pa=function(a){if(this.H){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);x.k(b)}};function Pb(a,b){a.K=NaN;a.L=NaN;a.vg=b;return a}function Hb(a,b){(isNaN(a)||1<a||0>a)&&x.la(a,"0 <= "+b+" <= 1",R,b)}
function Mb(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&x.la(a,"real number, not NaN or Infinity",R,b)}var Vb;
R.parse=Vb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return Wb;if("TopLeft"===a)return Xb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return ac;if("TopRight"===a)return bc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return cc;if("Center"===a)return dc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return ec;if("BottomLeft"===a)return fc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return kc;if("BottomRight"===a)return lc;if("TopSide"===a)return mc;if("LeftSide"===
a)return nc;if("RightSide"===a)return oc;if("BottomSide"===a)return pc;if("TopBottomSides"===a)return wc;if("LeftRightSides"===a)return xc;if("TopLeftSides"===a)return yc;if("TopRightSides"===a)return zc;if("BottomLeftSides"===a)return Ac;if("BottomRightSides"===a)return Bc;if("NotTopSide"===a)return Cc;if("NotLeftSide"===a)return Dc;if("NotRightSide"===a)return Gc;if("NotBottomSide"===a)return Hc;if("AllSides"===a)return Ic;if("Default"===a)return Jc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;
var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new R(c,e,g,h)}return new R};R.stringify=function(a){return a instanceof R?a.cd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
R.prototype.toString=function(){return this.cd()?0===this.vg&&0===this.wg?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.O(Wb)?"None":this.O(Xb)?"TopLeft":this.O(ac)?"Top":this.O(bc)?"TopRight":this.O(cc)?"Left":this.O(dc)?"Center":this.O(ec)?"Right":this.O(fc)?"BottomLeft":this.O(kc)?"Bottom":this.O(lc)?"BottomRight":this.O(mc)?"TopSide":this.O(nc)?"LeftSide":this.O(oc)?"RightSide":this.O(pc)?"BottomSide":this.O(wc)?"TopBottomSides":this.O(xc)?
"LeftRightSides":this.O(yc)?"TopLeftSides":this.O(zc)?"TopRightSides":this.O(Ac)?"BottomLeftSides":this.O(Bc)?"BottomRightSides":this.O(Cc)?"NotTopSide":this.O(Dc)?"NotLeftSide":this.O(Gc)?"NotRightSide":this.O(Hc)?"NotBottomSide":this.O(Ic)?"AllSides":this.O(Jc)?"Default":"None"};R.prototype.equals=R.prototype.O=function(a){return a instanceof R?(this.K===a.x||isNaN(this.K)&&isNaN(a.x))&&(this.L===a.y||isNaN(this.L)&&isNaN(a.y))&&this.vg===a.offsetX&&this.wg===a.offsetY:!1};
R.prototype.opposite=function(){return new R(.5-(this.K-.5),.5-(this.L-.5),-this.vg,-this.wg)};R.prototype.includesSide=R.prototype.Bp=function(a){if(!this.mj())return!1;if(!a.mj())if(a.O(Kc))a=nc;else if(a.O(Oc))a=oc;else if(a.O(Pc))a=mc;else if(a.O(Qc))a=pc;else return!1;a=a.offsetY;return(this.wg&a)===a};x.defineProperty(R,{x:"x"},function(){return this.K},function(a){this.Pa(a);u&&Hb(a,"x");this.K=a});
x.defineProperty(R,{y:"y"},function(){return this.L},function(a){this.Pa(a);u&&Hb(a,"y");this.L=a});x.defineProperty(R,{offsetX:"offsetX"},function(){return this.vg},function(a){this.Pa(a);u&&Mb(a,"offsetX");this.vg=a});x.defineProperty(R,{offsetY:"offsetY"},function(){return this.wg},function(a){this.Pa(a);u&&Mb(a,"offsetY");this.wg=a});R.prototype.isSpot=R.prototype.cd=function(){return!isNaN(this.x)&&!isNaN(this.y)};R.prototype.isNoSpot=R.prototype.ze=function(){return isNaN(this.x)||isNaN(this.y)};
R.prototype.isSide=R.prototype.mj=function(){return this.ze()&&1===this.offsetX&&0!==this.offsetY};R.prototype.isDefault=R.prototype.bd=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var Wb;R.None=Wb=Pb(new R(0,0,0,0),0).Ma();var Jc;R.Default=Jc=Pb(new R(0,0,-1,0),-1).Ma();var Xb;R.TopLeft=Xb=(new R(0,0,0,0)).Ma();var ac;R.TopCenter=ac=(new R(.5,0,0,0)).Ma();var bc;R.TopRight=bc=(new R(1,0,0,0)).Ma();var cc;R.LeftCenter=cc=(new R(0,.5,0,0)).Ma();var dc;
R.Center=dc=(new R(.5,.5,0,0)).Ma();var ec;R.RightCenter=ec=(new R(1,.5,0,0)).Ma();var fc;R.BottomLeft=fc=(new R(0,1,0,0)).Ma();var kc;R.BottomCenter=kc=(new R(.5,1,0,0)).Ma();var lc;R.BottomRight=lc=(new R(1,1,0,0)).Ma();var Rc;R.MiddleTop=Rc=ac;var Sc;R.MiddleLeft=Sc=cc;var Tc;R.MiddleRight=Tc=ec;var bd;R.MiddleBottom=bd=kc;var Pc;R.Top=Pc=ac;var Kc;R.Left=Kc=cc;var Oc;R.Right=Oc=ec;var Qc;R.Bottom=Qc=kc;var mc;R.TopSide=mc=Pb(new R(0,0,1,x.qd),1).Ma();var nc;
R.LeftSide=nc=Pb(new R(0,0,1,x.Tc),1).Ma();var oc;R.RightSide=oc=Pb(new R(0,0,1,x.fd),1).Ma();var pc;R.BottomSide=pc=Pb(new R(0,0,1,x.ed),1).Ma();var wc;R.TopBottomSides=wc=Pb(new R(0,0,1,x.qd|x.ed),1).Ma();var xc;R.LeftRightSides=xc=Pb(new R(0,0,1,x.Tc|x.fd),1).Ma();var yc;R.TopLeftSides=yc=Pb(new R(0,0,1,x.qd|x.Tc),1).Ma();var zc;R.TopRightSides=zc=Pb(new R(0,0,1,x.qd|x.fd),1).Ma();var Ac;R.BottomLeftSides=Ac=Pb(new R(0,0,1,x.ed|x.Tc),1).Ma();var Bc;
R.BottomRightSides=Bc=Pb(new R(0,0,1,x.ed|x.fd),1).Ma();var Cc;R.NotTopSide=Cc=Pb(new R(0,0,1,x.Tc|x.fd|x.ed),1).Ma();var Dc;R.NotLeftSide=Dc=Pb(new R(0,0,1,x.qd|x.fd|x.ed),1).Ma();var Gc;R.NotRightSide=Gc=Pb(new R(0,0,1,x.qd|x.Tc|x.ed),1).Ma();var Hc;R.NotBottomSide=Hc=Pb(new R(0,0,1,x.qd|x.Tc|x.fd),1).Ma();var Ic;R.AllSides=Ic=Pb(new R(0,0,1,x.qd|x.Tc|x.fd|x.ed),1).Ma();function cd(){this.pf=[1,0,0,1,0,0]}
cd.prototype.copy=function(){var a=new cd;a.pf[0]=this.pf[0];a.pf[1]=this.pf[1];a.pf[2]=this.pf[2];a.pf[3]=this.pf[3];a.pf[4]=this.pf[4];a.pf[5]=this.pf[5];return a};function dd(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.oE=[]}dd.prototype.addColorStop=function(a,b){this.oE.push({offset:a,color:b})};
function ed(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.Bx=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.document=b||document;this.LE=c;this.zx=null;this.path=[];this.hj=new cd;this.stack=[];this.Cf=[];this.bx=a;this.yJ="http://www.w3.org/2000/svg";this.width=this.bx.width;this.height=
this.bx.height;this.bm=fd(this,"svg",{width:this.width+"px",height:this.height+"px",uM:"0 0 "+this.bx.width+" "+this.bx.height});this.bm.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.bm.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");gd(this,1,0,0,1,0,0);a=x.hm++;b=fd(this,"clipPath",{id:"mainClip"+a});b.appendChild(fd(this,"rect",{x:0,y:0,width:this.width,height:this.height}));this.bm.appendChild(b);this.Cf[0].setAttributeNS(null,
"clip-path","url(#mainClip"+a+")")}f=ed.prototype;f.arc=function(a,b,c,d,e,g){hd(this,a,b,c,d,e,g)};f.beginPath=function(){this.path=[]};f.bezierCurveTo=function(a,b,c,d,e,g){this.path.push(["C",a,b,c,d,e,g])};f.clearRect=function(){};f.clip=function(){id(this,"clipPath",this.path,new cd)};f.closePath=function(){this.path.push(["z"])};f.createLinearGradient=function(a,b,c,d){var e=new dd("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};f.createPattern=function(){};
f.createRadialGradient=function(a,b,c,d,e,g){var h=new dd("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=g;return h};
f.drawImage=function(a,b,c,d,e,g,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m};m.preserveAspectRatio=Q.jb(d,k)&&Q.jb(e,l)?"xMidYMid slice":"none";var n="";k/=d;l/=e;if(0!==g||0!==h)n+=" translate("+g+", "+h+")";if(1!==k||1!==l)n+=" scale("+k+", "+l+")";if(0!==b||0!==c)n+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==a.naturalWidth||e!==a.naturalHeight)a="CLIP"+x.hm++,g=fd(this,
"clipPath",{id:a}),g.appendChild(fd(this,"rect",{x:b,y:c,width:d,height:e})),this.bm.appendChild(g),m["clip-path"]="url(#"+a+")";jd(this,"image",m,this.hj,n);this.addElement("image",m)};f.fill=function(){id(this,"fill",this.path,this.hj)};f.fillRect=function(a,b,c,d){kd(this,"fill",[a,b,c,d],this.hj)};
f.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};jd(this,"fill",b,this.hj);this.addElement("text",b,a[0])};f.lineTo=function(a,b){this.path.push(["L",a,b])};f.moveTo=function(a,b){this.path.push(["M",a,b])};f.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};f.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"])};
f.restore=function(){this.hj=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.Bx=a.Bx;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};
f.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,Bx:this.Bx,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.hj.copy())};
f.setTransform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||gd(this,a,b,c,d,e,g)};f.scale=function(){};f.stroke=function(){id(this,"stroke",this.path,this.hj)};f.strokeRect=function(a,b,c,d){kd(this,"stroke",[a,b,c,d],this.hj)};function fd(a,b,c,d){a=a.document.createElementNS(a.yJ,b);if(x.Ya(c))for(var e in c)a.setAttributeNS("href"===e?"http://www.w3.org/1999/xlink":"",e,c[e]);void 0!==d&&(a.textContent=d);return a}
f.addElement=function(a,b,c){a=fd(this,a,b,c);0<this.Cf.length?this.Cf[this.Cf.length-1].appendChild(a):this.bm.appendChild(a);return this.zx=a};
function jd(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 dd?td(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 dd?td(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.pf;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
function td(a,b){var c="GRAD"+x.hm++,d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=fd(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=fd(a,"radialGradient",d);else throw Error("invalid gradient");for(var e=b.oE,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(fd(a,"stop",h[k]));a.bm.appendChild(d);return"url(#"+c+")"}function kd(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};jd(a,b,c,d);a.addElement("rect",c)}
function id(a,b,c,d){for(var e=[],g=0;g<c.length;g++){var h=x.Cl(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(" ")};jd(a,b,c,d);"clipPath"===b?(b="CLIP"+x.hm++,d=fd(a,"clipPath",{id:b}),d.appendChild(fd(a,"path",c)),a.bm.appendChild(d),0<a.Cf.length&&a.Cf[a.Cf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
c)}function hd(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?(hd(a,b,c,d,e,e+Math.PI,h),hd(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 gd(a,b,c,d,e,g,h){var k=new cd;k.pf=[b,c,d,e,g,h];b={};jd(a,"g",b,k);k=a.addElement("g",b);a.Cf.push(k)}
f.hb=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+x.hm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,g,h;c=fd(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",lM:this.shadowBlur/2});d=fd(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=fd(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});g=fd(this,"feOffset",{"in":"comp",result:"offsetBlur",
dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=fd(this,"feMerge",{});h.appendChild(fd(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(fd(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(g);b.appendChild(h);0<this.Cf.length&&this.Cf[this.Cf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};
function ma(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.Zd=c;c.getContext&&c.getContext("2d")||x.k("Browser does not support HTML Canvas Element");this.NH=c.getContext("2d");c.W=a;Object.seal(this)}f=ma.prototype;f.getContext=function(){return this.NH};f.toDataURL=function(a,b){return this.Zd.toDataURL(a,b)};f.getBoundingClientRect=function(){return this.Zd.getBoundingClientRect()};f.focus=function(){return this.Zd.focus()};
f.addEventListener=function(a,b,c){this.Zd.addEventListener(a,b,c)};f.removeEventListener=function(a,b,c){this.Zd.removeEventListener(a,b,c)};x.defineProperty(ma,{width:"width"},function(){return this.Zd.width},function(a){this.Zd.width=a});x.defineProperty(ma,{height:"height"},function(){return this.Zd.height},function(a){this.Zd.height=a});x.defineProperty(ma,{style:"style"},function(){return this.Zd.style},function(a){this.Zd.style=a});
var Q={Ka:4*((Math.sqrt(2)-1)/3),Ek:(new N(0,0)).Ma(),sy:(new w(0,0,0,0)).Ma(),nq:(new yb(0,0,0,0)).Ma(),PG:(new yb(2,2,2,2)).Ma(),NG:(new N(6,6)).Ma(),JG:(new N(-Infinity,-Infinity)).Ma(),IG:(new N(Infinity,Infinity)).Ma(),Ln:(new Fa(0,0)).Ma(),oy:(new Fa(1,1)).Ma(),mq:(new Fa(6,6)).Ma(),ly:(new Fa(8,8)).Ma(),OG:(new Fa(10,10)).Ma(),HB:(new Fa(Infinity,Infinity)).Ma(),KG:(new N(NaN,NaN)).Ma(),EB:(new Fa(NaN,NaN)).Ma(),LG:(new w(NaN,NaN,NaN,NaN)).Ma(),py:new pa,yj:new pa,GB:null,sqrt:function(a){if(0>=
a)return 0;var b=Q.GB;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Q.GB=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},F:function(a,b){var c=a-b;return.5>c&&-.5<c},jb:function(a,b){var c=a-b;return 5E-8>c&&-5E-8<c},Pd:function(a,b,c,d,e,g,h){0>=e&&(e=1E-6);var k=0,l=0,m=0,n=0;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},Tw:function(a,b,c,d,e,g,h,k,l,m,n,p){if(Q.Pd(a,b,h,k,p,c,d)&&Q.Pd(a,b,h,k,p,e,g))return Q.Pd(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,t=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+t)/2;var s=(s+e)/2,t=(t+g)/2,v=(d+s)/2,y=(c+t)/2;return Q.Tw(a,b,q,r,d,c,v,y,l,m,n,p)||Q.Tw(v,y,s,t,e,g,h,k,l,m,n,p)},BH: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},AH:function(a,b,c,d,e,g,h,k){var l=(c+e)/2,m=(d+g)/2;return ub(((a+c)/2+l)/2,((b+d)/2+m)/2,(l+(e+h)/2)/2,(m+(g+k)/2)/2)},gp:function(a,b,c,d,e,g,h,k,l,m){if(Q.Pd(a,b,h,k,l,c,d)&&Q.Pd(a,b,h,k,l,e,g))Eb(m,a,b,0,0),Eb(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,t=(c+r)/2;Q.gp(a,b,n,p,d,c,s,
t,l,m);Q.gp(s,t,q,r,e,g,h,k,l,m)}return m},xe:function(a,b,c,d,e,g,h,k,l,m){if(Q.Pd(a,b,h,k,l,c,d)&&Q.Pd(a,b,h,k,l,e,g))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(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,t=(c+r)/2;Q.xe(a,b,n,p,d,c,s,t,l,m);Q.xe(s,t,q,r,e,g,h,k,l,m)}return m},VA:function(a,b,c,d,e,g,h,k,l,m){if(Q.Pd(a,b,e,g,m,c,d))return Q.Pd(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 Q.VA(a,b,n,p,q,r,h,k,l,m)||Q.VA(q,r,c,d,e,g,h,k,l,m)},dM: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},UA:function(a,b,c,d,e,g,h,k){if(Q.Pd(a,b,e,g,h,c,d))Eb(k,a,b,0,0),Eb(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;Q.UA(a,b,l,m,n,p,h,k);Q.UA(n,p,c,d,e,g,h,k)}return k},Wp:function(a,b,c,d,e,g,h,k){if(Q.Pd(a,b,e,g,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(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;Q.Wp(a,b,l,m,n,p,h,k);Q.Wp(n,p,c,d,e,g,h,k)}return k},it:function(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Q.Pd(a,b,h,k,q,c,d)&&Q.Pd(a,b,h,k,q,e,g)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===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(h=l=0,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,t=(b+d)/2;c=
(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var v=(s+c)/2,y=(t+d)/2;c=(c+e)/2;d=(d+g)/2;var A=(v+c)/2,B=(y+d)/2,C=(n-l)*(n-l)+(p-m)*(p-m),M=!1;Q.it(a,b,s,t,v,y,A,B,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C&&(C=b,M=!0));a=r.x;s=r.y;Q.it(A,B,c,d,e,g,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C?M=!0:(r.x=a,r.y=s));return M},jt:function(a,b,c,d,e,g,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(Q.Pd(a,b,h,k,q,c,d)&&Q.Pd(a,b,h,k,q,e,g)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*
k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,t=((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(a=l=0,b<k?(l=b,a=k):(l=k,a=b),t<l||t>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,t=(b+d)/2,v=(c+e)/2,y=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+v)/2;c=(t+y)/2;var v=(v+e)/2,y=(y+g)/2,A=(d+v)/2,B=(c+y)/2,r=r+Q.jt(a,b,s,t,d,c,A,B,l,m,n,p,q),r=r+Q.jt(A,B,v,y,e,g,h,k,l,m,n,p,q)}return r},xn:function(a,b,c,d,e,g,h){if(Q.jb(a,c)){var k=0;c=0;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(Q.jb(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},xh:function(a,b,c,d,e,g,h,k,l){if(Q.F(a,c)&&Q.F(b,d))return l.x=a,l.y=b,!1;if(Q.jb(e,h)){if(Q.jb(a,c))return Q.xn(a,b,c,
d,e,g,l),!1;g=(d-b)/(c-a)*(e-a)+b;return Q.xn(a,b,c,d,e,g,l)}k=(k-g)/(h-e);if(Q.jb(a,c)){g=k*(a-e)+g;c=h=0;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(Q.jb(k,h))return Q.xn(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(Q.jb(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 Q.xn(a,b,c,d,e,g,l)},BL:function(a,b,c,d,e){return Q.xh(c.x,c.y,d.x,d.y,a.x,a.y,b.x,
b.y,e)},nL: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=0,r=0,s=0,t=0;e<h?(q=e,r=h):(q=h,r=e);g<k?(s=e,t=h):(s=h,t=e);q=(r-q)/2+m;m=(t-s)/2+m;e=(e+h)/2;g=(g+k)/2;if(0===q||0===m)return l;if(.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},Ql:function(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(Q.xh(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)}Q.xh(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));Q.xh(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));Q.xh(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},qx: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?(g=a=0,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.Na(b)||a.Na(c)||Q.px(k,m,l,m,d,e,g,h)||Q.px(l,m,l,n,d,e,g,h)||Q.px(l,n,k,n,d,e,g,h)||Q.px(k,n,k,m,d,e,g,h)?!0:!1},px:function(a,b,c,d,e,g,h,k){return 0>=Q.Xw(a,b,c,d,e,g)*Q.Xw(a,b,c,d,h,k)&&0>=Q.Xw(e,g,h,k,a,b)*Q.Xw(e,g,h,k,c,d)},Xw: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},eu:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},xE: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,Math.abs(e-d));1E-5<d;)e=m+g*Math.min(d,l),k.push(Q.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=-k,m=h*h+l*l,n=m+h*h+l*k,m=4/3*(Math.sqrt(2*m*
n)-n)/(h*k-l*h),k=h-m*l,h=l+m*h,l=-h,m=g+b,g=Math.cos(m),m=Math.sin(m);return[d+a*Math.cos(b),e+a*Math.sin(b),d+k*g-h*m,e+k*m+h*g,d+k*g-l*m,e+k*m+l*g,d+a*Math.cos(c),e+a*Math.sin(c)]},xt: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.n(k,a);return h},VE: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},$H:function(a,b,c,d){var e=0>c,g=0>d,h=0,k=h=0;a<b?(h=1,k=0):(h=0,k=
1);var l=0,m=0,n=0,l=0===h?a:b,m=0===h?c:d;if(0===h?e:g)m=-m;h=k;n=0===h?c:d;if(0===h?e:g)n=-n;return Q.aI(l,0===h?a:b,m,n,0,0)},aI:function(a,b,c,d,e,g){e=0;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=.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;e=Math.sqrt(c*c+d*d)}else e=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,e=Math.sqrt(c*c+g*g)):e=Math.abs(c-a);return e}};function ud(a){1<arguments.length&&x.k("Geometry constructor can take at most one optional argument, the Geometry type.");x.lc(this);this.H=!1;void 0===a?a=vd:u&&x.Ca(a,ud,ud,"constructor:type");this.da=a;this.Ib=this.Db=this.Cc=this.wc=0;this.Dj=new J(wd);this.pv=this.Dj.I;this.av=(new w).freeze();this.ib=!0;this.Wi=Xb;this.Xi=lc;this.xo=this.zo=NaN;this.Di=xd}x.ja("Geometry",ud);x.li(ud);
ud.prototype.copy=function(){var a=new ud;a.da=this.da;a.wc=this.wc;a.Cc=this.Cc;a.Db=this.Db;a.Ib=this.Ib;for(var b=this.Dj.o,c=b.length,d=a.Dj,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.pv=this.pv;a.av.assign(this.av);a.ib=this.ib;a.Wi=this.Wi.Y();a.Xi=this.Xi.Y();a.zo=this.zo;a.xo=this.xo;a.Di=this.Di;return a};var yd;ud.Line=yd=x.s(ud,"Line",0);var zd;ud.Rectangle=zd=x.s(ud,"Rectangle",1);var Ad;ud.Ellipse=Ad=x.s(ud,"Ellipse",2);var vd;ud.Path=vd=x.s(ud,"Path",3);
ud.prototype.Ma=function(){this.freeze();Object.freeze(this);return this};ud.prototype.freeze=function(){this.H=!0;var a=this.ec;a.freeze();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].freeze();return this};ud.prototype.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;var a=this.ec;a.Va();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Va();return this};
ud.prototype.equalsApprox=ud.prototype.wd=function(a){if(!(a instanceof ud))return!1;if(this.type!==a.type)return this.type===yd&&a.type===vd?Bd(this,a):a.type===yd&&this.type===vd?Bd(a,this):!1;if(this.type===vd){var b=this.ec.o;a=a.ec.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].wd(a[d]))return!1;return!0}return Q.F(this.Ha,a.Ha)&&Q.F(this.Da,a.Da)&&Q.F(this.M,a.M)&&Q.F(this.N,a.N)};
function Bd(a,b){if(a.type!==yd||b.type!==vd)return!1;if(1===b.ec.count){var c=b.ec.ia(0);if(1===c.Eb.count&&Q.F(a.Ha,c.Ha)&&Q.F(a.Da,c.Da)&&(c=c.Eb.ia(0),c.type===Cd&&Q.F(a.M,c.M)&&Q.F(a.N,c.N)))return!0}return!1}var Dd;ud.stringify=Dd=function(a){return a.toString()};
ud.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case yd:return 0>a?"M"+this.Ha.toString()+" "+this.Da.toString()+"L"+this.M.toString()+" "+this.N.toString():"M"+this.Ha.toFixed(a)+" "+this.Da.toFixed(a)+"L"+this.M.toFixed(a)+" "+this.N.toFixed(a);case zd:var b=new w(this.Ha,this.Da,0,0);b.AG(this.M,this.N,0,0);return 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 Ad:b=new w(this.Ha,this.Da,0,0);b.AG(this.M,this.N,0,0);if(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 vd:for(var b="",c=this.ec.o,d=c.length,e=0;e<d;e++){var g=c[e];0<e&&(b+=" x ");g.Mt&&(b+="F ");b+=g.toString(a)}return b;default:return this.type.toString()}};
ud.fillPath=function(a){"string"!==typeof a&&x.jc(a,"string",ud,"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 Hd;
ud.parse=Hd=function(a,b){function c(){return m>=t-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new N(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function g(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new N(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&x.jc(a,"string",ud,"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 l=a.split(" "),m=-1,n="",p="",q=new N(0,0),r=new N(0,0),s=new N(0,
0),t=l.length,v=x.u(),y=!1,A=!1,B=!0;!(m>=t-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":B=!0;A=y=!1;break;case "M":var C=g();null===v.bc||!0===B?(S(v,C.x,C.y,y,!1,!A),B=!1):v.moveTo(C.x,C.y);for(q=s;!c();)C=g(),v.lineTo(C.x,C.y);break;case "L":for(;!c();)C=g(),v.lineTo(C.x,C.y);break;case "H":for(;!c();)s=C=new N((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),v.lineTo(s.x,s.y);break;case "V":for(;!c();)s=C=new N(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),v.lineTo(s.x,s.y);break;
case "C":for(;!c();){var M=e(),I=h(),C=g();T(v,M.x,M.y,I.x,I.y,C.x,C.y)}break;case "S":for(;!c();)M=k(),I=h(),C=g(),T(v,M.x,M.y,I.x,I.y,C.x,C.y);break;case "Q":for(;!c();)I=h(),C=g(),Id(v,I.x,I.y,C.x,C.y);break;case "T":for(;!c();)r=I=k(),C=g(),Id(v,I.x,I.y,C.x,C.y);break;case "B":for(;!c();){var C=parseFloat(d()),M=parseFloat(d()),I=parseFloat(d()),V=parseFloat(d()),ea=parseFloat(d()),W=ea,P=!1;c()||(W=parseFloat(d()),c()||(P=0!==parseFloat(d())));n===n.toLowerCase()&&(I+=s.x,V+=s.y);v.arcTo(C,M,
I,V,ea,W,P)}break;case "A":for(;!c();)M=Math.abs(parseFloat(d())),I=Math.abs(parseFloat(d())),V=parseFloat(d()),ea=!!parseFloat(d()),W=!!parseFloat(d()),C=g(),Jd(v,M,I,V,ea,W,C.x,C.y);break;case "Z":C=v.q.ec.o[v.q.ec.length-1];U(v);s=q;break;case "F":C="";for(M=1;l[m+M];)if(null!==l[m+M].match(/[Uu]/))M++;else if(null===l[m+M].match(/[A-Za-z]/))M++;else{C=l[m+M];break}C.match(/[Mm]/)?y=!0:Kd(v);break;case "U":C="";for(M=1;l[m+M];)if(null!==l[m+M].match(/[Ff]/))M++;else if(null===l[m+M].match(/[A-Za-z]/))M++;
else{C=l[m+M];break}C.match(/[Mm]/)?A=!0:v.hb(!1)}q=v.q;x.v(v);if(b)for(v=q.ec.i;v.next();)C=v.value,C.Mt=!0;return q};function Ld(a,b){for(var c=a.length,d=x.P(),e=0;e<c;e++){var g=a[e];d.x=g[0];d.y=g[1];b.Fb(d);g[0]=d.x;g[1]=d.y;d.x=g[2];d.y=g[3];b.Fb(d);g[2]=d.x;g[3]=d.y;d.x=g[4];d.y=g[5];b.Fb(d);g[4]=d.x;g[5]=d.y;d.x=g[6];d.y=g[7];b.Fb(d);g[6]=d.x;g[7]=d.y}x.A(d)}
ud.prototype.zA=function(){if(this.ib||this.pv!==this.ec.I)return!0;for(var a=this.ec.o,b=a.length,c=0;c<b;c++)if(a[c].zA())return!0;return!1};ud.prototype.vB=function(){this.ib=!1;this.pv=this.ec.I;for(var a=this.ec.o,b=a.length,c=0;c<b;c++)a[c].vB()};ud.prototype.oh=function(){var a=this.av;a.Va();isNaN(this.zo)||isNaN(this.xo)?a.n(0,0,0,0):a.n(0,0,this.zo,this.xo);Md(this,a,!1);Eb(a,0,0,0,0);a.freeze()};
ud.prototype.computeBoundsWithoutOrigin=ud.prototype.KH=function(){var a=new w;Md(this,a,!0);return a};
function Md(a,b,c){switch(a.type){case yd:case zd:case Ad:c?b.n(a.wc,a.Cc,0,0):Eb(b,a.wc,a.Cc,0,0);Eb(b,a.Db,a.Ib,0,0);break;case vd:var d=a.ec;a=d.o;for(var d=d.length,e=0;e<d;e++){var g=a[e];c&&0===e?b.n(g.Ha,g.Da,0,0):Eb(b,g.Ha,g.Da,0,0);for(var h=g.Eb.o,k=h.length,l=g.Ha,m=g.Da,n=0;n<k;n++){var p=h[n];switch(p.type){case Cd:case Nd:l=p.M;m=p.N;Eb(b,l,m,0,0);break;case Od:Q.gp(l,m,p.zc,p.Qc,p.Dh,p.Eh,p.M,p.N,.5,b);l=p.M;m=p.N;break;case Pd:Q.UA(l,m,p.zc,p.Qc,p.M,p.N,.5,b);l=p.M;m=p.N;break;case Qd:case Rd:var q=
p.type===Qd?Sd(p,g):de(p,g,l,m),r=q.length;if(0===r){l=p.sa;m=p.Aa;Eb(b,l,m,0,0);break}for(var p=null,s=0;s<r;s++)p=q[s],Q.gp(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],.5,b);null!==p&&(l=p[6],m=p[7]);break;default:x.k("Unknown Segment type: "+p.type)}}}break;default:x.k("Unknown Geometry type: "+a.type)}}ud.prototype.normalize=ud.prototype.normalize=function(){this.H&&x.pa(this);var a=this.KH();this.offset(-a.x,-a.y);return new N(-a.x,-a.y)};
ud.prototype.offset=ud.prototype.offset=function(a,b){this.H&&x.pa(this);u&&(x.p(a,ud,"offset"),x.p(b,ud,"offset"));this.transform(1,0,0,1,a,b);return this};ud.prototype.scale=ud.prototype.scale=function(a,b){this.H&&x.pa(this);u&&(x.p(a,ud,"scale:x"),x.p(b,ud,"scale:y"),0===a&&x.la(a,"scale must be non-zero",ud,"scale:x"),0===b&&x.la(b,"scale must be non-zero",ud,"scale:y"));this.transform(a,0,0,b,0,0);return this};
ud.prototype.rotate=ud.prototype.rotate=function(a,b,c){this.H&&x.pa(this);void 0===b&&(b=0);void 0===c&&(c=0);u&&(x.p(a,ud,"rotate:angle"),x.p(b,ud,"rotate:x"),x.p(c,ud,"rotate:y"));var d=x.Ih();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);x.jf(d);return this};
ud.prototype.transform=ud.prototype.transform=function(a,b,c,d,e,g){var h=0,k=0;switch(this.type){case yd:case zd:case Ad:h=this.wc;k=this.Cc;this.wc=h*a+k*c+e;this.Cc=h*b+k*d+g;h=this.Db;k=this.Ib;this.Db=h*a+k*c+e;this.Ib=h*b+k*d+g;break;case vd:for(var l=this.ec.o,m=l.length,n=0;n<m;n++){var p=l[n],h=p.Ha,k=p.Da;p.Ha=h*a+k*c+e;p.Da=h*b+k*d+g;for(var p=p.Eb.o,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case Cd:case Nd:h=s.M;k=s.N;s.M=h*a+k*c+e;s.N=h*b+k*d+g;break;case Od:h=s.zc;k=s.Qc;s.zc=
h*a+k*c+e;s.Qc=h*b+k*d+g;h=s.Dh;k=s.Eh;s.Dh=h*a+k*c+e;s.Eh=h*b+k*d+g;h=s.M;k=s.N;s.M=h*a+k*c+e;s.N=h*b+k*d+g;break;case Pd:h=s.zc;k=s.Qc;s.zc=h*a+k*c+e;s.Qc=h*b+k*d+g;h=s.M;k=s.N;s.M=h*a+k*c+e;s.N=h*b+k*d+g;break;case Qd:h=s.sa;k=s.Aa;s.sa=h*a+k*c+e;s.Aa=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.De+=h);0>a&&(s.De=180-s.De,s.Nf=-s.Nf);0>d&&(s.De=-s.De,s.Nf=-s.Nf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case Rd:h=s.M;k=s.N;s.M=h*
a+k*c+e;s.N=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.xj+=h);0>a&&(s.xj=180-s.xj,s.Tl=!s.Tl);0>d&&(s.xj=-s.xj,s.Tl=!s.Tl);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:x.k("Unknown Segment type: "+s.type)}}}}this.ib=!0;return this};
ud.prototype.Na=function(a,b,c,d){var e=a.x,g=a.y,h=this.Cb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.ec.o,s=r.length,t=0;t<s;t++){var v=r[t];if(v.Mt){if(c&&v.Na(e,g,b))return!0;for(var y=v.Eb,l=v.Ha,m=v.Da,A=l,B=m,C=y.o,M=0;M<=y.length;M++){var I,V;M!==y.length?(I=C[M],V=I.type,p=I.M,q=I.N):(V=Cd,p=A,q=B);switch(V){case Nd:n=ee(e,g,h,a,l,m,A,B);if(isNaN(n))return!0;k+=n;A=p;B=q;break;case Cd:n=ee(e,g,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case Od:n=Q.jt(l,m,I.zc,I.Qc,I.Dh,I.Eh,p,q,
h,a,e,g,.5);k+=n;break;case Pd:n=Q.jt(l,m,(l+2*I.zc)/3,(m+2*I.Qc)/3,(2*I.zc+p)/3,(2*I.Qc+q)/3,p,q,h,a,e,g,.5);k+=n;break;case Qd:case Rd:V=I.type===Qd?Sd(I,v):de(I,v,l,m);var ea=V.length;if(0===ea){n=ee(e,g,h,a,l,m,I.sa,I.Aa);if(isNaN(n))return!0;k+=n;break}for(var W=null,P=0;P<ea;P++){W=V[P];if(0===P){n=ee(e,g,h,a,l,m,W[0],W[1]);if(isNaN(n))return!0;k+=n}n=Q.jt(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],h,a,e,g,.5);k+=n}null!==W&&(p=W[6],q=W[7]);break;default:x.k("Unknown Segment type: "+I.type)}l=
p;m=q}if(0!==k)return!0;k=0}else if(v.Na(e,g,d?b:b+2))return!0}return 0!==k};function ee(a,b,c,d,e,g,h,k){if(Q.Pd(e,g,h,k,.05,a,b))return NaN;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(e=a=0,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 fe(a,b,c,d){a=a.ec.o;for(var e=a.length,g=0;g<e;g++)if(a[g].Na(b,c,d))return!0;return!1}
ud.prototype.getPointAlongPath=function(a){(0>a||1<a)&&x.la(a,"0 <= fraction <= 1",ud,"getPointAlongPath:fraction");var b=this.ec.first(),c=x.ub(),d=[];d.push(b.Ha);d.push(b.Da);for(var e=b.Ha,g=b.Da,h=e,k=g,l=b.Eb.o,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.da){case Nd:c.push(d);d=[];d.push(p.M);d.push(p.N);e=p.M;g=p.N;h=e;k=g;break;case Cd:d.push(p.M);d.push(p.N);e=p.M;g=p.N;break;case Od:Q.xe(e,g,p.Ed,p.Pe,p.gh,p.xg,p.Db,p.Ib,.5,d);e=p.M;g=p.N;break;case Pd:Q.Wp(e,g,p.Ed,p.Pe,p.Db,p.Ib,.5,d);
e=p.M;g=p.N;break;case Qd:var q=Sd(p,b),r=q.length;if(0===r){d.push(p.sa);d.push(p.Aa);e=p.sa;g=p.Aa;break}for(var s=0;s<r;s++){var t=q[s];Q.xe(e,g,t[2],t[3],t[4],t[5],t[6],t[7],.5,d);e=t[6];g=t[7]}break;case Rd:q=de(p,b,e,g);r=q.length;for(s=0;s<r;s++)t=q[s],Q.xe(e,g,t[2],t[3],t[4],t[5],t[6],t[7],.5,d),e=t[6],g=t[7];break;default:x.k("Segment not of valid type")}p.Vh&&(d.push(h),d.push(k))}c.push(d);q=0;h=c.length;for(k=d=b=0;k<h;k++)for(l=c[k],m=l.length,n=0;n<m;n+=2)e=l[n],g=l[n+1],0!==n&&(p=Math.sqrt(tb(b,
d,e,g)),q+=p),b=e,d=g;a*=q;for(k=q=0;k<h;k++)for(l=c[k],m=l.length,n=0;n<m;n++){e=l[n];g=l[n+1];if(0!==n){p=Math.sqrt(tb(b,d,e,g));if(q+p>a)return n=(a-q)/p,x.xa(c),new N(b+(e-b)*n,d+(g-d)*n);q+=p}b=e;d=g}x.xa(c);return null};x.defineProperty(ud,{type:"type"},function(){return this.da},function(a){this.da!==a&&(u&&x.Ca(a,ud,ud,"type"),this.H&&x.pa(this,a),this.da=a,this.ib=!0)});
x.defineProperty(ud,{Ha:"startX"},function(){return this.wc},function(a){this.wc!==a&&(u&&x.p(a,ud,"startX"),this.H&&x.pa(this,a),this.wc=a,this.ib=!0)});x.defineProperty(ud,{Da:"startY"},function(){return this.Cc},function(a){this.Cc!==a&&(u&&x.p(a,ud,"startY"),this.H&&x.pa(this,a),this.Cc=a,this.ib=!0)});x.defineProperty(ud,{M:"endX"},function(){return this.Db},function(a){this.Db!==a&&(u&&x.p(a,ud,"endX"),this.H&&x.pa(this,a),this.Db=a,this.ib=!0)});
x.defineProperty(ud,{N:"endY"},function(){return this.Ib},function(a){this.Ib!==a&&(u&&x.p(a,ud,"endY"),this.H&&x.pa(this,a),this.Ib=a,this.ib=!0)});x.defineProperty(ud,{ec:"figures"},function(){return this.Dj},function(a){this.Dj!==a&&(u&&x.l(a,J,ud,"figures"),this.H&&x.pa(this,a),this.Dj=a,this.ib=!0)});ud.prototype.add=ud.prototype.add=function(a){this.Dj.add(a);return this};
x.defineProperty(ud,{C:"spot1"},function(){return this.Wi},function(a){u&&x.l(a,R,ud,"spot1");this.H&&x.pa(this,a);this.Wi=a.Y()});x.defineProperty(ud,{D:"spot2"},function(){return this.Xi},function(a){u&&x.l(a,R,ud,"spot2");this.H&&x.pa(this,a);this.Xi=a.Y()});x.defineProperty(ud,{Xd:"defaultStretch"},function(){return this.Di},function(a){u&&x.Ca(a,O,ud,"stretch");this.H&&x.pa(this,a);this.Di=a});x.w(ud,{Cb:"bounds"},function(){this.zA()&&(this.vB(),this.oh());return this.av});
function wd(a,b,c,d){x.lc(this);this.H=!1;void 0===c&&(c=!0);this.rm=c;void 0===d&&(d=!0);this.Ao=d;void 0!==a?(u&&x.p(a,wd,"sx"),this.wc=a):this.wc=0;void 0!==b?(u&&x.p(b,wd,"sy"),this.Cc=b):this.Cc=0;this.To=new J(ge);this.rw=this.To.I;this.ib=!0}x.ja("PathFigure",wd);x.li(wd);wd.prototype.copy=function(){var a=new wd;a.rm=this.rm;a.Ao=this.Ao;a.wc=this.wc;a.Cc=this.Cc;for(var b=this.To.o,c=b.length,d=a.To,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.rw=this.rw;a.ib=this.ib;return a};
wd.prototype.equalsApprox=wd.prototype.wd=function(a){if(!(a instanceof wd&&Q.F(this.Ha,a.Ha)&&Q.F(this.Da,a.Da)))return!1;var b=this.Eb.o;a=a.Eb.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].wd(a[d]))return!1;return!0};f=wd.prototype;f.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.Ha.toString()+" "+this.Da.toString():"M"+this.Ha.toFixed(a)+" "+this.Da.toFixed(a),c=this.Eb.o,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};
f.freeze=function(){this.H=!0;var a=this.Eb;a.freeze();for(var b=a.o,a=a.length,c=0;c<a;c++)b[c].freeze();return this};f.Va=function(){this.H=!1;var a=this.Eb;a.Va();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Va();return this};f.zA=function(){if(this.ib)return!0;var a=this.Eb;if(this.rw!==a.I)return!0;for(var a=a.o,b=a.length,c=0;c<b;c++)if(a[c].ib)return!0;return!1};f.vB=function(){this.ib=!1;var a=this.Eb;this.rw=a.I;for(var a=a.o,b=a.length,c=0;c<b;c++){var d=a[c];d.ib=!1;d.mg=null}};
x.defineProperty(wd,{Mt:"isFilled"},function(){return this.rm},function(a){u&&x.g(a,"boolean",wd,"isFilled");this.H&&x.pa(this,a);this.rm=a});x.defineProperty(wd,{xk:"isShadowed"},function(){return this.Ao},function(a){u&&x.g(a,"boolean",wd,"isShadowed");this.H&&x.pa(this,a);this.Ao=a});x.defineProperty(wd,{Ha:"startX"},function(){return this.wc},function(a){u&&x.p(a,wd,"startX");this.H&&x.pa(this,a);this.wc=a;this.ib=!0});
x.defineProperty(wd,{Da:"startY"},function(){return this.Cc},function(a){u&&x.p(a,wd,"startY");this.H&&x.pa(this,a);this.Cc=a;this.ib=!0});x.defineProperty(wd,{Eb:"segments"},function(){return this.To},function(a){u&&x.l(a,J,wd,"segments");this.H&&x.pa(this,a);this.To=a;this.ib=!0});wd.prototype.add=wd.prototype.add=function(a){this.To.add(a);return this};
wd.prototype.Na=function(a,b,c){for(var d=this.Ha,e=this.Da,g=d,h=e,k=this.Eb.o,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case Nd:g=n.M;h=n.N;d=n.M;e=n.N;break;case Cd:if(Q.Pd(d,e,n.M,n.N,c,a,b))return!0;d=n.M;e=n.N;break;case Od:if(Q.Tw(d,e,n.zc,n.Qc,n.Dh,n.Eh,n.M,n.N,.5,a,b,c))return!0;d=n.M;e=n.N;break;case Pd:if(Q.VA(d,e,n.zc,n.Qc,n.M,n.N,.5,a,b,c))return!0;d=n.M;e=n.N;break;case Qd:case Rd:var p=n.type===Qd?Sd(n,this):de(n,this,d,e),q=p.length;if(0===q){if(Q.Pd(d,e,n.sa,n.Aa,c,a,b))return!0;
d=n.sa;e=n.Aa;break}for(var r=null,s=0;s<q;s++)if(r=p[s],0===s&&Q.Pd(d,e,r[0],r[1],c,a,b)||Q.Tw(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:x.k("Unknown Segment type: "+n.type)}if(n.sx&&(d!==g||e!==h)&&Q.Pd(d,e,g,h,c,a,b))return!0}return!1};
function ge(a,b,c,d,e,g,h,k){x.lc(this);this.H=!1;void 0===a?a=Cd:u&&x.Ca(a,ge,ge,"constructor:type");this.da=a;void 0!==b?(u&&x.p(b,ge,"ex"),this.Db=b):this.Db=0;void 0!==c?(u&&x.p(c,ge,"ey"),this.Ib=c):this.Ib=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===g&&(g=0);void 0===h&&(h=0);a===Rd?(a=g%360,0>a&&(a+=360),this.Ed=a,this.Pe=0,u&&x.p(d,ge,"x1"),this.gh=Math.max(d,0),u&&x.p(e,ge,"y1"),this.xg=Math.max(e,0),this.Fo="boolean"===typeof h?!!h:!1,this.Sn=!!k):(u&&x.p(d,ge,"x1"),this.Ed=d,u&&x.p(e,
ge,"y1"),this.Pe=e,u&&x.p(g,ge,"x2"),a===Qd&&(g=Math.max(g,0)),this.gh=g,"number"===typeof h?(a===Qd&&(h=Math.max(h,0)),this.xg=h):this.xg=0,this.Sn=this.Fo=!1);this.Vh=!1;this.ib=!0;this.mg=null}x.ja("PathSegment",ge);x.li(ge);ge.prototype.copy=function(){var a=new ge;a.da=this.da;a.Db=this.Db;a.Ib=this.Ib;a.Ed=this.Ed;a.Pe=this.Pe;a.gh=this.gh;a.xg=this.xg;a.Fo=this.Fo;a.Sn=this.Sn;a.Vh=this.Vh;a.ib=this.ib;return a};
ge.prototype.equalsApprox=ge.prototype.wd=function(a){if(!(a instanceof ge)||this.type!==a.type||this.sx!==a.sx)return!1;switch(this.type){case Nd:case Cd:return Q.F(this.M,a.M)&&Q.F(this.N,a.N);case Od:return Q.F(this.M,a.M)&&Q.F(this.N,a.N)&&Q.F(this.zc,a.zc)&&Q.F(this.Qc,a.Qc)&&Q.F(this.Dh,a.Dh)&&Q.F(this.Eh,a.Eh);case Pd:return Q.F(this.M,a.M)&&Q.F(this.N,a.N)&&Q.F(this.zc,a.zc)&&Q.F(this.Qc,a.Qc);case Qd:return Q.F(this.De,a.De)&&Q.F(this.Nf,a.Nf)&&Q.F(this.sa,a.sa)&&Q.F(this.Aa,a.Aa)&&Q.F(this.radiusX,
a.radiusX)&&Q.F(this.radiusY,a.radiusY);case Rd:return this.Tl===a.Tl&&this.wx===a.wx&&Q.F(this.xj,a.xj)&&Q.F(this.M,a.M)&&Q.F(this.N,a.N)&&Q.F(this.radiusX,a.radiusX)&&Q.F(this.radiusY,a.radiusY);default:return!1}};
ge.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Nd:b=0>a?"M"+this.M.toString()+" "+this.N.toString():"M"+this.M.toFixed(a)+" "+this.N.toFixed(a);break;case Cd:b=0>a?"L"+this.M.toString()+" "+this.N.toString():"L"+this.M.toFixed(a)+" "+this.N.toFixed(a);break;case Od:b=0>a?"C"+this.zc.toString()+" "+this.Qc.toString()+" "+this.Dh.toString()+" "+this.Eh.toString()+" "+this.M.toString()+" "+this.N.toString():"C"+this.zc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.Dh.toFixed(a)+
" "+this.Eh.toFixed(a)+" "+this.M.toFixed(a)+" "+this.N.toFixed(a);break;case Pd:b=0>a?"Q"+this.zc.toString()+" "+this.Qc.toString()+" "+this.M.toString()+" "+this.N.toString():"Q"+this.zc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.M.toFixed(a)+" "+this.N.toFixed(a);break;case Qd:b=0>a?"B"+this.De.toString()+" "+this.Nf.toString()+" "+this.sa.toString()+" "+this.Aa.toString()+" "+this.radiusX:"B"+this.De.toFixed(a)+" "+this.Nf.toFixed(a)+" "+this.sa.toFixed(a)+" "+this.Aa.toFixed(a)+" "+this.radiusX;
break;case Rd:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xj.toString()+" "+(this.wx?1:0)+" "+(this.Tl?1:0)+" "+this.M.toString()+" "+this.N.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xj.toFixed(a)+" "+(this.wx?1:0)+" "+(this.Tl?1:0)+" "+this.M.toFixed(a)+" "+this.N.toFixed(a);break;default:b=this.type.toString()}return b+(this.Vh?"z":"")};var Nd;ge.Move=Nd=x.s(ge,"Move",0);var Cd;ge.Line=Cd=x.s(ge,"Line",1);var Od;
ge.Bezier=Od=x.s(ge,"Bezier",2);var Pd;ge.QuadraticBezier=Pd=x.s(ge,"QuadraticBezier",3);var Qd;ge.Arc=Qd=x.s(ge,"Arc",4);var Rd;ge.SvgArc=Rd=x.s(ge,"SvgArc",4);ge.prototype.freeze=function(){this.H=!0;return this};ge.prototype.Va=function(){this.H=!1;return this};ge.prototype.close=ge.prototype.close=function(){this.Vh=!0;return this};
function Sd(a,b){if(null!==a.mg&&!1===b.ib)return a.mg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.mg=[],a.mg;var e=a.Ed,g=a.Pe,h=Q.xE(0,0,c<d?c:d,a.De,a.De+a.Nf,!1);if(c!==d){var k=x.Ih();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Ld(h,k);x.jf(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=g,k[2]+=e,k[3]+=g,k[4]+=e,k[5]+=g,k[6]+=e,k[7]+=g;a.mg=h;return a.mg}
function de(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos(g(a,b,c,d))}function g(a,b,c,d){return(a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d))}if(null!==a.mg&&!1===b.ib)return a.mg;b=a.gh;var h=a.xg;if(0===b||0===h)return a.mg=[],a.mg;var k=Math.PI/180*a.Ed,l=a.Fo,m=a.Sn,n=a.Db,p=a.Ib,q=Math.cos(k),r=Math.sin(k),s=q*(c-n)/2+r*(d-p)/2,k=-r*(c-n)/2+q*(d-p)/2,t=s*s/(b*b)+k*k/(h*h);1<t&&(b*=Math.sqrt(t),h*=Math.sqrt(t));t=(l===m?-1:1)*Math.sqrt((b*b*h*h-b*b*k*k-h*h*s*s)/(b*b*k*k+h*h*
s*s));isNaN(t)&&(t=0);l=t*b*k/h;t=t*-h*s/b;isNaN(l)&&(l=0);isNaN(t)&&(t=0);c=(c+n)/2+q*l-r*t;d=(d+p)/2+r*l+q*t;p=e(1,0,(s-l)/b,(k-t)/h);q=(s-l)/b;n=(k-t)/h;s=(-s-l)/b;l=(-k-t)/h;k=e(q,n,s,l);s=g(q,n,s,l);-1>=s?k=Math.PI:1<=s&&(k=0);!m&&0<k&&(k-=2*Math.PI);m&&0>k&&(k+=2*Math.PI);m=b>h?1:b/h;s=b>h?h/b:1;b=Q.xE(0,0,b>h?b:h,p,p+k,!0);h=x.Ih();h.reset();h.translate(c,d);h.rotate(a.Ed,0,0);h.scale(m,s);Ld(b,h);x.jf(h);a.mg=b;return a.mg}
x.defineProperty(ge,{sx:"isClosed"},function(){return this.Vh},function(a){this.Vh!==a&&(this.Vh=a,this.ib=!0)});x.defineProperty(ge,{type:"type"},function(){return this.da},function(a){u&&x.Ca(a,ge,ge,"type");this.H&&x.pa(this,a);this.da=a;this.ib=!0});x.defineProperty(ge,{M:"endX"},function(){return this.Db},function(a){u&&x.p(a,ge,"endX");this.H&&x.pa(this,a);this.Db=a;this.ib=!0});
x.defineProperty(ge,{N:"endY"},function(){return this.Ib},function(a){u&&x.p(a,ge,"endY");this.H&&x.pa(this,a);this.Ib=a;this.ib=!0});x.defineProperty(ge,{zc:"point1X"},function(){return this.Ed},function(a){u&&x.p(a,ge,"point1X");this.H&&x.pa(this,a);this.Ed=a;this.ib=!0});x.defineProperty(ge,{Qc:"point1Y"},function(){return this.Pe},function(a){u&&x.p(a,ge,"point1Y");this.H&&x.pa(this,a);this.Pe=a;this.ib=!0});
x.defineProperty(ge,{Dh:"point2X"},function(){return this.gh},function(a){u&&x.p(a,ge,"point2X");this.H&&x.pa(this,a);this.gh=a;this.ib=!0});x.defineProperty(ge,{Eh:"point2Y"},function(){return this.xg},function(a){u&&x.p(a,ge,"point2Y");this.H&&x.pa(this,a);this.xg=a;this.ib=!0});x.defineProperty(ge,{sa:"centerX"},function(){return this.Ed},function(a){u&&x.p(a,ge,"centerX");this.H&&x.pa(this,a);this.Ed=a;this.ib=!0});
x.defineProperty(ge,{Aa:"centerY"},function(){return this.Pe},function(a){u&&x.p(a,ge,"centerY");this.H&&x.pa(this,a);this.Pe=a;this.ib=!0});x.defineProperty(ge,{radiusX:"radiusX"},function(){return this.gh},function(a){u&&x.p(a,ge,"radiusX");0>a&&x.la(a,">= zero",ge,"radiusX");this.H&&x.pa(this,a);this.gh=a;this.ib=!0});x.defineProperty(ge,{radiusY:"radiusY"},function(){return this.xg},function(a){u&&x.p(a,ge,"radiusY");0>a&&x.la(a,">= zero",ge,"radiusY");this.H&&x.pa(this,a);this.xg=a;this.ib=!0});
x.defineProperty(ge,{De:"startAngle"},function(){return this.Db},function(a){this.Db!==a&&(this.H&&x.pa(this,a),u&&x.p(a,ge,"startAngle"),a%=360,0>a&&(a+=360),this.Db=a,this.ib=!0)});x.defineProperty(ge,{Nf:"sweepAngle"},function(){return this.Ib},function(a){u&&x.p(a,ge,"sweepAngle");this.H&&x.pa(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Ib=a;this.ib=!0});x.defineProperty(ge,{Tl:"isClockwiseArc"},function(){return this.Sn},function(a){this.H&&x.pa(this,a);this.Sn=a;this.ib=!0});
x.defineProperty(ge,{wx:"isLargeArc"},function(){return this.Fo},function(a){this.H&&x.pa(this,a);this.Fo=a;this.ib=!0});x.defineProperty(ge,{xj:"xAxisRotation"},function(){return this.Ed},function(a){u&&x.p(a,ge,"xAxisRotation");a%=360;0>a&&(a+=360);this.H&&x.pa(this,a);this.Ed=a;this.ib=!0});
function he(){this.W=null;this.Pz=(new N(0,0)).freeze();this.Vy=(new N(0,0)).freeze();this.Xu=this.Tv=0;this.Yu=1;this.Hv="";this.Fw=this.mv=!1;this.iv=this.$u=0;this.zj=this.tv=this.Dv=!1;this.$q=null;this.Dw=0;this.yg=this.Bw=null}x.ja("InputEvent",he);
he.prototype.copy=function(){var a=new he;a.W=this.W;a.Pz.assign(this.te);a.Vy.assign(this.ha);a.Tv=this.Tv;a.Xu=this.Xu;a.Yu=this.Yu;a.Hv=this.Hv;a.mv=this.mv;a.Fw=this.Fw;a.$u=this.$u;a.iv=this.iv;a.Dv=this.Dv;a.tv=this.tv;a.zj=this.zj;a.$q=this.$q;a.Dw=this.Dw;a.Bw=this.Bw;a.yg=this.yg;return a};
he.prototype.toString=function(){var a="^";0!==this.yd&&(a+="M:"+this.yd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.ff&&(a+="C:"+this.ff);0!==this.Hl&&(a+="D:"+this.Hl);this.Mc&&(a+="h");this.bubbles&&(a+="b");null!==this.ha&&(a+="@"+this.ha.toString());return a};x.defineProperty(he,{h:"diagram"},function(){return this.W},function(a){this.W=a});x.defineProperty(he,{te:"viewPoint"},function(){return this.Pz},function(a){x.l(a,N,he,"viewPoint");this.Pz.assign(a)});
x.defineProperty(he,{ha:"documentPoint"},function(){return this.Vy},function(a){x.l(a,N,he,"documentPoint");this.Vy.assign(a)});x.defineProperty(he,{yd:"modifiers"},function(){return this.Tv},function(a){this.Tv=a});x.defineProperty(he,{button:"button"},function(){return this.Xu},function(a){this.Xu=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});
x.defineProperty(he,{buttons:"buttons"},function(){return this.Yu},function(a){this.Yu=a});x.defineProperty(he,{key:"key"},function(){return this.Hv},function(a){this.Hv=a});x.defineProperty(he,{Jl:"down"},function(){return this.mv},function(a){this.mv=a});x.defineProperty(he,{up:"up"},function(){return this.Fw},function(a){this.Fw=a});x.defineProperty(he,{ff:"clickCount"},function(){return this.$u},function(a){this.$u=a});
x.defineProperty(he,{Hl:"delta"},function(){return this.iv},function(a){this.iv=a});x.defineProperty(he,{Ot:"isMultiTouch"},function(){return this.Dv},function(a){this.Dv=a});x.defineProperty(he,{Mc:"handled"},function(){return this.tv},function(a){this.tv=a});x.defineProperty(he,{bubbles:"bubbles"},function(){return this.zj},function(a){this.zj=a});x.defineProperty(he,{event:"event"},function(){return this.$q},function(a){this.$q=a});
x.w(he,{nj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});x.w(he,{wk:"isMac"},function(){return x.wk});x.defineProperty(he,{timestamp:"timestamp"},function(){return this.Dw},function(a){this.Dw=a});x.defineProperty(he,{Mg:"targetDiagram"},function(){return this.Bw},function(a){this.Bw=a});
x.defineProperty(he,{Ee:"targetObject"},function(){return this.yg},function(a){this.yg=a});x.defineProperty(he,{control:"control"},function(){return 0!==(this.yd&1)},function(a){this.yd=a?this.yd|1:this.yd&-2});x.defineProperty(he,{shift:"shift"},function(){return 0!==(this.yd&4)},function(a){this.yd=a?this.yd|4:this.yd&-5});x.defineProperty(he,{alt:"alt"},function(){return 0!==(this.yd&2)},function(a){this.yd=a?this.yd|2:this.yd&-3});
x.defineProperty(he,{Zt:"meta"},function(){return 0!==(this.yd&8)},function(a){this.yd=a?this.yd|8:this.yd&-9});x.defineProperty(he,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2});
x.defineProperty(he,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});x.defineProperty(he,{KL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5});
function ie(){this.W=null;this.Vb="";this.cw=this.xw=null;this.Zu=!1}x.ja("DiagramEvent",ie);ie.prototype.copy=function(){var a=new ie;a.W=this.W;a.Vb=this.Vb;a.xw=this.xw;a.cw=this.cw;a.Zu=this.Zu;return a};ie.prototype.toString=function(){var a="*"+this.name;this.cancel&&(a+="x");null!==this.mB&&(a+=":"+this.mB.toString());null!==this.TA&&(a+="("+this.TA.toString()+")");return a};x.defineProperty(ie,{h:"diagram"},function(){return this.W},function(a){this.W=a});
x.defineProperty(ie,{name:"name"},function(){return this.Vb},function(a){this.Vb=a});x.defineProperty(ie,{mB:"subject"},function(){return this.xw},function(a){this.xw=a});x.defineProperty(ie,{TA:"parameter"},function(){return this.cw},function(a){this.cw=a});x.defineProperty(ie,{cancel:"cancel"},function(){return this.Zu},function(a){this.Zu=a});function ve(){this.Aq=we;this.Lm=this.Sv="";this.Vr=this.Wr=this.Zr=this.$r=this.Yr=this.W=this.fe=null}x.ja("ChangedEvent",ve);var xe;
ve.Transaction=xe=x.s(ve,"Transaction",-1);var we;ve.Property=we=x.s(ve,"Property",0);var ye;ve.Insert=ye=x.s(ve,"Insert",1);var ze;ve.Remove=ze=x.s(ve,"Remove",2);ve.prototype.clear=ve.prototype.clear=function(){this.Vr=this.Wr=this.Zr=this.$r=this.Yr=this.W=this.fe=null};
ve.prototype.copy=function(){var a=new ve;a.Aq=this.Aq;a.Sv=this.Sv;a.Lm=this.Lm;a.fe=this.fe;a.W=this.W;a.Yr=this.Yr;var b=this.$r;a.$r=x.Ya(b)&&"function"===typeof b.Y?b.Y():b;b=this.Zr;a.Zr=x.Ya(b)&&"function"===typeof b.Y?b.Y():b;b=this.Wr;a.Wr=x.Ya(b)&&"function"===typeof b.Y?b.Y():b;b=this.Vr;a.Vr=x.Ya(b)&&"function"===typeof b.Y?b.Y():b;return a};
ve.prototype.toString=function(){var a="",a=this.Dc===xe?a+"* ":this.Dc===we?a+(null!==this.aa?"!m":"!d"):a+((null!==this.aa?"!m":"!d")+this.Dc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.rf&&this.rf!==this.propertyName&&(a+=" "+this.rf);a+=": ";this.Dc===xe?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=la(this.object)),null!==this.oldValue&&(a+="  old: "+la(this.oldValue)),null!==this.Kg&&(a+=" "+this.Kg),null!==this.newValue&&
(a+="  new: "+la(this.newValue)),null!==this.Ig&&(a+=" "+this.Ig));return a};ve.prototype.getValue=ve.prototype.oa=function(a){return a?this.oldValue:this.newValue};ve.prototype.getParam=function(a){return a?this.Kg:this.Ig};ve.prototype.canUndo=ve.prototype.canUndo=function(){return null!==this.aa||null!==this.h?!0:!1};ve.prototype.undo=ve.prototype.undo=function(){this.canUndo()&&(null!==this.aa?this.aa.bn(this,!0):null!==this.h&&this.h.bn(this,!0))};
ve.prototype.canRedo=ve.prototype.canRedo=function(){return null!==this.aa||null!==this.h?!0:!1};ve.prototype.redo=ve.prototype.redo=function(){this.canRedo()&&(null!==this.aa?this.aa.bn(this,!1):null!==this.h&&this.h.bn(this,!1))};x.defineProperty(ve,{aa:"model"},function(){return this.fe},function(a){this.fe=a});x.defineProperty(ve,{h:"diagram"},function(){return this.W},function(a){this.W=a});
x.defineProperty(ve,{Dc:"change"},function(){return this.Aq},function(a){u&&x.Ca(a,ve,ve,"change");this.Aq=a});x.defineProperty(ve,{rf:"modelChange"},function(){return this.Sv},function(a){u&&x.g(a,"string",ve,"modelChange");this.Sv=a});x.defineProperty(ve,{propertyName:"propertyName"},function(){return this.Lm},function(a){u&&"string"!==typeof a&&x.g(a,"function",ve,"propertyName");this.Lm=a});
x.w(ve,{pF:"isTransactionFinished"},function(){return this.Aq===xe&&("CommittedTransaction"===this.Lm||"FinishedUndo"===this.Lm||"FinishedRedo"===this.Lm)});x.defineProperty(ve,{object:"object"},function(){return this.Yr},function(a){this.Yr=a});x.defineProperty(ve,{oldValue:"oldValue"},function(){return this.$r},function(a){this.$r=a});x.defineProperty(ve,{Kg:"oldParam"},function(){return this.Zr},function(a){this.Zr=a});
x.defineProperty(ve,{newValue:"newValue"},function(){return this.Wr},function(a){this.Wr=a});x.defineProperty(ve,{Ig:"newParam"},function(){return this.Vr},function(a){this.Vr=a});
function L(a){1<arguments.length&&x.k("Model constructor can only take one optional argument, the Array of node data.");x.lc(this);this.Oq=this.Vb="";this.Ii=!1;this.wz={};this.xf=[];this.vc=new ra(null,Object);this.Xj="key";this.Wn=this.Io=null;this.Gq=this.cv=!1;this.tq=null;this.Gm="category";this.ng=new ra(null,K);this.Rj=null;this.Vi=!1;this.Oz=null;this.qa=new Ae;void 0!==a&&(this.Jg=a)}x.ja("Model",L);
L.prototype.cloneProtected=function(a){a.Vb=this.Vb;a.Oq=this.Oq;a.Ii=this.Ii;a.Xj=this.Xj;a.Io=this.Io;a.Wn=this.Wn;a.pK=this.cv;a.Gq=this.Gq;a.tq=this.tq;a.Gm=this.Gm};L.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};L.prototype.clear=L.prototype.clear=function(){this.xf=[];this.vc.clear();this.ng.clear();this.qa.clear()};f=L.prototype;
f.toString=function(a){void 0===a&&(a=0);if(1<a)return this.pB();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.Jg;for(var c=x.ab(a),d=0;d<c;d++)var e=x.Wa(a,d),b=b+(" "+this.sb(e)+":"+la(e))}return b};
f.In=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Fl&&(a+=',\n  "dataFormat": '+this.quote(this.Fl));this.kb&&(a+=',\n  "isReadOnly": '+this.kb);"key"!==this.rj&&"string"===typeof this.rj&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.rj));this.dA&&(a+=',\n  "copiesArrays": true');this.cA&&(a+=',\n  "copiesArrayObjects": true');"category"!==this.yn&&"string"===typeof this.yn&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.yn));return a};
f.hu=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Fl=a.dataFormat);a.isReadOnly&&(this.kb=a.isReadOnly);a.nodeKeyProperty&&(this.rj=a.nodeKeyProperty);a.copiesArrays&&(this.dA=a.copiesArrays);a.copiesArrayObjects&&(this.cA=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.yn=a.nodeCategoryProperty)};function Be(a){return',\n  "modelData": '+Ce(a,a.yk)}function Qe(a,b){var c=b.modelData;x.Ya(c)&&(a.lu(c),a.yk=c)}
f.yB=function(){var a=this.yk,b=!1,c;for(c in a)if(!Re(c,a[c])){b=!0;break}a="";b&&(a=Be(this));return a+',\n  "nodeDataArray": '+Se(this,this.Jg,!0)};f.YA=function(a){Qe(this,a);a=a.nodeDataArray;x.isArray(a)&&(this.lu(a),this.Jg=a)};
function Te(a,b,c,d){if(b===c)return!0;if(typeof b!==typeof c||"function"===typeof b||"function"===typeof c)return!1;if(Array.isArray(b)&&Array.isArray(c)){if(d.oa(b)===c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!Te(a,b[e],c[e],d))return!1;return!0}if(x.Ya(b)&&x.Ya(c)){if(d.oa(b)===c)return!0;d.add(b,c);for(e in b){var g=b[e];if(!Re(e,g)){var h=c[e];if(void 0===h||!Te(a,g,h,d))return!1}}for(var k in c)if(h=c[k],!Re(k,h)&&(g=b[k],void 0===g||!Te(a,g,h,d)))return!1;
return!0}return!1}function Ue(a,b,c){a[c]!==b[c]&&x.k("Model.computeJsonDifference: Model."+c+' is not the same in both models: "'+a[c]+'" and "'+b[c]+'"')}
f.zB=function(a){Ue(this,a,"nodeKeyProperty");this instanceof Ve&&Ue(this,a,"nodeParentKeyProperty");for(var b=new K,c=new K,d=(new K).$c(this.vc.qF),e=new ra,g=a.Jg,h=0;h<g.length;h++){var k=g[h],l=a.sb(k);if(void 0!==l){d.remove(l);var m=this.le(l);null===m?(b.add(l),c.add(k)):Te(this,m,k,e)||c.add(k)}else this.FA(k),l=this.sb(k),b.add(l),c.add(k)}g="";Te(this,this.yk,a.yk,e)||(g+=Be(this));0<b.count&&(g+=this.xy+Se(this,b.kc(),!0));0<c.count&&(g+=this.MB+Se(this,c.kc(),!0));0<d.count&&(g+=this.zy+
Se(this,d.kc(),!0));return g};L.prototype.computeJsonDifference=L.prototype.computeJSONDifference=function(a,b){x.l(a,L,L,"computeJsonDifference:newmodel");void 0===b&&(b=this.constructor===L?"go.Model":this.constructor===X?"go.GraphLinksModel":this.constructor===Ve?"go.TreeModel":x.kf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.In()+this.zB(a)+"}"};f=L.prototype;f.xy=',\n  "insertedNodeKeys": ';f.MB=',\n  "modifiedNodeData": ';f.zy=',\n  "removedNodeKeys": ';
f.xB=function(a,b){var c=this,d=!1,e=new K,g=new K,h=new K;a.$f.each(function(a){a.aa===c&&("nodeDataArray"===a.rf?a.Dc===ye?e.add(a.newValue):a.Dc===ze&&h.add(a.oldValue):c.je(a.object)?g.add(a.object):c.yk===a.object&&a.Dc===we&&(d=!0))});var k=new K;e.each(function(a){k.add(c.sb(a));b||g.add(a)});var l=new K;h.each(function(a){l.add(c.sb(a));b&&g.add(a)});var m="";d&&(m+=Be(this));0<k.count&&(m+=(b?this.zy:this.xy)+Se(this,k.kc(),!0));0<g.count&&(m+=this.MB+Se(this,g.kc(),!0));0<l.count&&(m+=(b?
this.xy:this.zy)+Se(this,l.kc(),!0));return m};
f.XA=function(a){Qe(this,a);var b=a.insertedNodeKeys;if(x.isArray(b))for(var c=x.ab(b),d=0;d<c;d++){var e=x.Wa(b,d),g=this.le(e);null===g&&(g=this.copyNodeData({}),this.Zx(g,e),this.vl(g))}b=a.modifiedNodeData;if(x.isArray(b))for(c=x.ab(b),d=0;d<c;d++){var h=x.Wa(b,d),e=this.sb(h),g=this.le(e);if(null!==g)for(var k in h)"__gohashid"!==k&&k!==this.rj&&this.setDataProperty(g,k,h[k])}a=a.removedNodeKeys;if(x.isArray(a))for(c=x.ab(a),d=0;d<c;d++)e=x.Wa(a,d),g=this.le(e),null!==g&&this.Qx(g)};
L.prototype.toIncrementalJson=L.prototype.toIncrementalJSON=function(a,b){x.l(a,ve,L,"toIncrementalJson:e");a.Dc!==xe&&x.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.pF&&c instanceof We))return'{ "incremental": 0 }';void 0===b&&(b=this.constructor===L?"go.Model":this.constructor===X?"go.GraphLinksModel":this.constructor===Ve?"go.TreeModel":x.kf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.In()+this.xB(c,"FinishedUndo"===
a.propertyName)+"}"};L.prototype.toJson=L.prototype.toJSON=L.prototype.pB=function(a){void 0===a&&(a=this.constructor===L?"go.Model":this.constructor===X?"go.GraphLinksModel":this.constructor===Ve?"go.TreeModel":x.kf(this));return'{ "class": '+this.quote(a)+this.In()+this.yB()+"}"};
L.prototype.applyIncrementalJson=L.prototype.applyIncrementalJSON=function(a){var b=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{b=window.JSON.parse(a)}catch(c){u&&x.trace("JSON.parse error: "+c.toString())}else x.trace("WARNING: no JSON.parse available");else"object"===typeof a?b=a:x.k("Unable to modify a Model from: "+a);var d=b.incremental;"number"!==typeof d&&x.k("Unable to apply non-incremental changes to Model: "+a);0!==d&&(this.Wb("applyIncrementalJson"),this.XA(b),this.Md("applyIncrementalJson"))};
L.fromJson=L.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&x.l(b,L,L,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){u&&x.trace("JSON.parse error: "+d.toString())}else x.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:x.k("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=ca[g]):(h=ca[g],
void 0===h&&(h=window[g]));"function"===typeof h&&(e=new h)}catch(k){}null===e||e instanceof L?b=e:x.k("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new X);b.hu(c);b.YA(c);return b};
L.prototype.replaceJsonObjects=L.prototype.lu=function(a){if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++){var d=x.Wa(a,c);x.Ya(d)&&x.hE(a,c,this.lu(d))}else if(x.Ya(a)){for(c in a)if(d=a[c],x.Ya(d)&&(d=this.lu(d),a[c]=d,"points"===c&&Array.isArray(d))){for(var e=0===d.length%2,g=0;g<d.length;g++)if("number"!==typeof d[g]){e=!1;break}if(e){e=new J(N);for(g=0;g<d.length/2;g++){var h=new N(d[2*g],d[2*g+1]);e.add(h)}e.freeze();a[c]=e}}if("object"===typeof a){c=a;d=a["class"];if("NaN"===d)c=NaN;else if("Date"===
d)c=new Date(a.value);else if("go.Point"===d)c=new N(Xe(a.x),Xe(a.y));else if("go.Size"===d)c=new Fa(Xe(a.width),Xe(a.height));else if("go.Rect"===d)c=new w(Xe(a.x),Xe(a.y),Xe(a.width),Xe(a.height));else if("go.Margin"===d)c=new yb(Xe(a.top),Xe(a.right),Xe(a.bottom),Xe(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?Vb(a["enum"]):new R(Xe(a.x),Xe(a.y),Xe(a.offsetX),Xe(a.offsetY));else if("go.Brush"===d){if(c=new Ea,c.type=La(Ea,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof
R&&(c.start=a.start),a.end instanceof R&&(c.end=a.end),"number"===typeof a.startRadius&&(c.xu=Xe(a.startRadius)),"number"===typeof a.endRadius&&(c.ut=Xe(a.endRadius)),a=a.colorStops,x.Ya(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"go.Geometry"===d?(b=null,b="string"===typeof a.path?Hd(a.path):new ud,b.type=La(ud,a.type),"number"===typeof a.startX&&(b.Ha=Xe(a.startX)),"number"===typeof a.startY&&(b.Da=Xe(a.startY)),"number"===typeof a.endX&&(b.M=Xe(a.endX)),"number"===typeof a.endY&&(b.N=
Xe(a.endY)),a.spot1 instanceof R&&(b.C=a.spot1),a.spot2 instanceof R&&(b.D=a.spot2),c=b):"go.EnumValue"===d&&(b=a.classType,0===b.indexOf("go.")&&(b=b.substr(3)),c=La(ca[b],a.name));a=c}}return a};
L.prototype.quote=function(a){for(var b="",c=a.length,d=0;d<c;d++){var e=a[d];if('"'===e||"\\"===e)b+="\\"+e;else if("\b"===e)b+="\\b";else if("\f"===e)b+="\\f";else if("\n"===e)b+="\\n";else if("\r"===e)b+="\\r";else if("\t"===e)b+="\\t";else var g=a.charCodeAt(d),b=16>g?b+("\\u000"+a.charCodeAt(d).toString(16)):32>g?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===g?b+"\\u2028":8233===g?b+"\\u2029":b+e}return'"'+b+'"'};
L.prototype.writeJsonValue=L.prototype.Eu=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.Eu(a.valueOf()):x.isArray(a)?Se(this,a):x.Ya(a)?Ce(this,a):"function"===typeof a?"null":a.toString()};
function Se(a,b,c){void 0===c&&(c=!1);var d=x.ab(b);if(0>=d)return"[]";var e=new Ba;e.add("[ ");c&&1<d&&e.add("\n");for(var g=0;g<d;g++){var h=x.Wa(b,g);void 0!==h&&(0<g&&(e.add(","),c&&e.add("\n")),e.add(a.Eu(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function Re(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function Ye(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
function Ce(a,b){var c=b;if(c instanceof N){var d=c;b={"class":"go.Point",x:Ye(d.x),y:Ye(d.y)}}else if(c instanceof Fa){var e=c;b={"class":"go.Size",width:Ye(e.width),height:Ye(e.height)}}else if(c instanceof w)b={"class":"go.Rect",x:Ye(c.x),y:Ye(c.y),width:Ye(c.width),height:Ye(c.height)};else if(c instanceof yb)b={"class":"go.Margin",top:Ye(c.top),right:Ye(c.right),bottom:Ye(c.bottom),left:Ye(c.left)};else if(c instanceof R)e=c,b=e.cd()?{"class":"go.Spot",x:Ye(e.x),y:Ye(e.y),offsetX:Ye(e.offsetX),
offsetY:Ye(e.offsetY)}:{"class":"go.Spot","enum":e.toString()};else if(c instanceof Ea){b={"class":"go.Brush",type:c.type.name};if(c.type===Ze)b.color=c.color;else if(c.type===$e||c.type===af)b.start=c.start,b.end=c.end,c.type===af&&(0!==c.xu&&(b.startRadius=Ye(c.xu)),isNaN(c.ut)||(b.endRadius=Ye(c.ut)));if(null!==c.pt){for(var g={},h=c.pt.i;h.next();)g[h.key]=h.value;b.colorStops=g}}else if(c instanceof ud)b={"class":"go.Geometry",type:c.type.name},0!==c.Ha&&(b.startX=Ye(c.Ha)),0!==c.Da&&(b.startY=
Ye(c.Da)),0!==c.M&&(b.endX=Ye(c.M)),0!==c.N&&(b.endY=Ye(c.N)),c.C.O(Xb)||(b.spot1=c.C),c.D.O(lc)||(b.spot2=c.D),c.type===vd&&(b.path=Dd(c));else if(c instanceof Ca)b={"class":"go.EnumValue",classType:x.kf(c.ye),name:c.name};else if(c instanceof O||c instanceof z||c instanceof bf||c instanceof L||c instanceof cf||c instanceof ua||c instanceof df||c instanceof xa||c instanceof Ae||c instanceof We)return x.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+
c.toString()),"{}";g="{";c=!0;for(d in b)if(e=x.wb(b,d),!Re(d,e))if(c?c=!1:g+=", ",g+='"'+d+'":',"points"===d&&e instanceof J&&e.da===N){h=e;e="[";for(h=h.i;h.next();){var k=h.value;1<e.length&&(e+=",");e+=a.Eu(k.x);e+=",";e+=a.Eu(k.y)}e+="]";g+=e}else g+=a.Eu(e);return g+"}"}function Xe(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}
x.defineProperty(L,{name:"name"},function(){return this.Vb},function(a){var b=this.Vb;b!==a&&(x.g(a,"string",L,"name"),this.Vb=a,this.j("name",b,a))});x.defineProperty(L,{Fl:"dataFormat"},function(){return this.Oq},function(a){var b=this.Oq;b!==a&&(x.g(a,"string",L,"dataFormat"),this.Oq=a,this.j("dataFormat",b,a))});x.defineProperty(L,{kb:"isReadOnly"},function(){return this.Ii},function(a){var b=this.Ii;b!==a&&(x.g(a,"boolean",L,"isReadOnly"),this.Ii=a,this.j("isReadOnly",b,a))});
x.defineProperty(L,{yk:"modelData"},function(){return this.wz},function(a){var b=this.wz;b!==a&&(x.g(a,"object",L,"modelData"),this.wz=a,this.j("modelData",b,a),this.Ob(a))});L.prototype.addChangedListener=L.prototype.Ym=function(a){x.g(a,"function",L,"addChangedListener:listener");null===this.Rj&&(this.Rj=new J("function"));this.Rj.add(a)};
L.prototype.removeChangedListener=L.prototype.ju=function(a){x.g(a,"function",L,"removeChangedListener:listener");null!==this.Rj&&(this.Rj.remove(a),0===this.Rj.count&&(this.Rj=null))};L.prototype.Uw=function(a){this.xb||this.qa.aF(a);if(null!==this.Rj){var b=this.Rj,c=b.length;if(1===c)b=b.ia(0),b(a);else if(0!==c)for(var d=b.kc(),e=0;e<c;e++)b=d[e],b(a)}};L.prototype.raiseChangedEvent=L.prototype.Rc=function(a,b,c,d,e,g,h){lf(this,"",a,b,c,d,e,g,h)};
L.prototype.raiseChanged=L.prototype.j=function(a,b,c,d,e){lf(this,"",we,a,this,b,c,d,e)};L.prototype.raiseDataChanged=L.prototype.WA=function(a,b,c,d,e,g){lf(this,"",we,b,a,c,d,e,g)};function lf(a,b,c,d,e,g,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new ve;m.aa=a;m.Dc=c;m.rf=b;m.propertyName=d;m.object=e;m.oldValue=g;m.Kg=k;m.newValue=h;m.Ig=l;a.Uw(m)}
x.defineProperty(L,{qa:"undoManager"},function(){return this.Oz},function(a){var b=this.Oz;b!==a&&(x.l(a,Ae,L,"undoManager"),null!==b&&b.IJ(this),this.Oz=a,null!==a&&a.rH(this))});x.defineProperty(L,{xb:"skipsUndoManager"},function(){return this.Vi},function(a){x.g(a,"boolean",L,"skipsUndoManager");this.Vi=a});
L.prototype.bn=function(a,b){if(null!==a&&a.aa===this)if(a.Dc===we){var c=a.object,d=a.propertyName,e=a.oa(b);x.Ra(c,d,e)}else a.Dc===ye?"nodeDataArray"===a.rf?(c=a.newValue,x.Ya(c)&&(d=this.sb(c),void 0!==d&&(b?(x.ki(this.xf,a.Ig),this.vc.remove(d)):(x.cj(this.xf,a.Ig,c),this.vc.add(d,c))))):""===a.rf?(c=a.object,!x.isArray(c)&&a.propertyName&&(c=x.wb(a.object,a.propertyName)),x.isArray(c)&&(d=a.newValue,e=a.Ig,b?x.ki(c,e):x.cj(c,e,d))):x.k("unknown ChangedEvent.Insert object: "+a.toString()):a.Dc===
ze?"nodeDataArray"===a.rf?(c=a.oldValue,x.Ya(c)&&(d=this.sb(c),void 0!==d&&(b?(x.cj(this.xf,a.Kg,c),this.vc.add(d,c)):(x.ki(this.xf,a.Kg),this.vc.remove(d))))):""===a.rf?(c=a.object,!x.isArray(c)&&a.propertyName&&(c=x.wb(a.object,a.propertyName)),x.isArray(c)&&(d=a.oldValue,e=a.Kg,b?x.cj(c,e,d):x.ki(c,e))):x.k("unknown ChangedEvent.Remove object: "+a.toString()):a.Dc!==xe&&x.k("unknown ChangedEvent: "+a.toString())};L.prototype.startTransaction=L.prototype.Wb=function(a){return this.qa.Wb(a)};
L.prototype.commitTransaction=L.prototype.Md=function(a){return this.qa.Md(a)};L.prototype.rollbackTransaction=L.prototype.$p=function(){return this.qa.$p()};L.prototype.updateTargetBindings=L.prototype.Ob=function(a,b){void 0===b&&(b="");lf(this,"SourceChanged",xe,b,a,null,null)};
x.defineProperty(L,{rj:"nodeKeyProperty"},function(){return this.Xj},function(a){var b=this.Xj;b!==a&&(mf(a,L,"nodeKeyProperty"),""===a&&x.k("Model.nodeKeyProperty may not be the empty string"),0<this.vc.count&&x.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Xj=a,this.j("nodeKeyProperty",b,a))});function mf(a,b,c){"string"!==typeof a&&"function"!==typeof a&&x.jc(a,"string or function",b,c)}
L.prototype.getKeyForNodeData=L.prototype.sb=function(a){if(null!==a){var b=this.Xj;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
L.prototype.setKeyForNodeData=L.prototype.Zx=function(a,b){void 0!==b&&null!==b&&nf(b)||x.jc(b,"number or string",L,"setKeyForNodeData:key");if(null!==a){var c=this.Xj;if(""!==c)if(this.je(a)){var d=x.wb(a,c);d!==b&&null===this.le(b)&&(x.Ra(a,c,b),this.vc.remove(d),this.vc.add(b,a),lf(this,"nodeKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c),this.ku(d,b))}else x.Ra(a,c,b)}};
x.defineProperty(L,{DL:"makeUniqueKeyFunction"},function(){return this.Io},function(a){var b=this.Io;b!==a&&(null!==a&&x.g(a,"function",L,"makeUniqueKeyFunction"),this.Io=a,this.j("makeUniqueKeyFunction",b,a))});function nf(a){return"number"===typeof a||"string"===typeof a}L.prototype.containsNodeData=L.prototype.je=function(a){var b=this.sb(a);return void 0===b?!1:this.vc.oa(b)===a};
L.prototype.findNodeDataForKey=L.prototype.le=function(a){null===a&&x.k("Model.findNodeDataForKey:key must not be null");return void 0!==a&&nf(a)?this.vc.oa(a):null};
x.defineProperty(L,{Jg:"nodeDataArray"},function(){return this.xf},function(a){var b=this.xf;if(b!==a){x.kt(a,L,"nodeDataArray");this.vc.clear();this.tB();for(var c=x.ab(a),d=0;d<c;d++){var e=x.Wa(a,d);if(!x.Ya(e)){x.k("Model.nodeDataArray must only contain Objects, not: "+e);return}x.Ht(e)}this.xf=a;for(var g=new J(Object),d=0;d<c;d++){var e=x.Wa(a,d),h=this.sb(e);void 0===h?g.add(e):null!==this.vc.oa(h)?g.add(e):this.vc.add(h,e)}for(d=g.i;d.next();)e=d.value,this.FA(e),g=this.sb(e),void 0!==g&&
this.vc.add(g,e);lf(this,"nodeDataArray",we,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=x.Wa(a,d),this.Zp(e),this.Yp(e);this.nE();x.TI(a)||(this.kb=!0)}});
L.prototype.makeNodeDataKeyUnique=L.prototype.FA=function(a){if(null!==a){var b=this.Xj;if(""!==b){var c=this.sb(a);if(void 0===c||this.vc.contains(c)){var d=this.Io;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.vc.contains(c))){x.Ra(a,b,c);return}if("string"===typeof c){for(d=2;this.vc.contains(c+d);)d++;x.Ra(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.vc.count-1;this.vc.contains(d);)d--;x.Ra(a,b,d)}else x.k("Model.getKeyForNodeData returned something other than a string or a number: "+
c)}}}};L.prototype.addNodeData=L.prototype.vl=function(a){if(null!==a){x.Ht(a);var b=this.sb(a);if(void 0===b||this.vc.oa(b)!==a)this.FA(a),b=this.sb(a),void 0===b?x.k("Model.makeNodeDataKeyUnique failed on "+a+".  Data not added to Model."):(this.vc.add(b,a),b=x.ab(this.xf),x.cj(this.xf,b,a),lf(this,"nodeDataArray",ye,"nodeDataArray",this,null,a,null,b),this.Zp(a),this.Yp(a))}};
L.prototype.addNodeDataCollection=function(a){if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.vl(x.Wa(a,c));else for(a=a.i;a.next();)this.vl(a.value)};L.prototype.removeNodeData=L.prototype.Qx=function(a){if(null!==a){var b=this.sb(a);void 0!==b&&this.vc.contains(b)&&(this.vc.remove(b),b=x.Yz(this.xf,a),0>b||(x.ki(this.xf,b),lf(this,"nodeDataArray",ze,"nodeDataArray",this,a,null,b,null),this.Cu(a)))}};
L.prototype.removeNodeDataCollection=function(a){if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.Qx(x.Wa(a,c));else for(a=a.i;a.next();)this.Qx(a.value)};f=L.prototype;f.ku=function(a,b){var c=of(this,a);c instanceof K&&this.ng.add(b,c)};f.tB=function(){};f.Zp=function(){};f.Yp=function(){};f.Cu=function(){};function pf(a,b,c){if(void 0!==b){var d=a.ng.oa(b);null===d&&(d=new K(Object),a.ng.add(b,d));d.add(c)}}
function qf(a,b,c){if(void 0!==b){var d=a.ng.oa(b);d instanceof K&&(void 0===c||null===c?a.ng.remove(b):(d.remove(c),0===d.count&&a.ng.remove(b)))}}function of(a,b){if(void 0===b)return null;var c=a.ng.oa(b);return c instanceof K?c:null}L.prototype.clearUnresolvedReferences=L.prototype.nE=function(a){void 0===a?this.ng.clear():this.ng.remove(a)};
x.defineProperty(L,{RK:"copyNodeDataFunction"},function(){return this.Wn},function(a){var b=this.Wn;b!==a&&(null!==a&&x.g(a,"function",L,"copyNodeDataFunction"),this.Wn=a,this.j("copyNodeDataFunction",b,a))});x.defineProperty(L,{dA:"copiesArrays"},function(){return this.cv},function(a){var b=this.cv;b!==a&&(null!==a&&x.g(a,"boolean",L,"copiesArrays"),this.cv=a,this.j("copiesArrays",b,a))});
x.defineProperty(L,{cA:"copiesArrayObjects"},function(){return this.Gq},function(a){var b=this.Gq;b!==a&&(null!==a&&x.g(a,"boolean",L,"copiesArrayObjects"),this.Gq=a,this.j("copiesArrayObjects",b,a))});L.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.Wn,b=null!==b?b(a,this):rf(this,a,!0);x.Ya(b)&&x.lc(b);return b};
function rf(a,b,c){if(a.dA&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=rf(a,b[c],a.cA);d.push(e)}x.lc(d);return d}if(c&&x.Ya(b)){c=(c=b.constructor)?new c:{};for(d in b)if("__gohashid"!==d){var e=x.wb(b,d),g;g=e;g instanceof O||g instanceof z||g instanceof bf||g instanceof sf||g instanceof tf||g instanceof cf||g instanceof ua||g instanceof df||g instanceof he||g instanceof ie?("_"!==d[0]&&x.trace('Warning: found GraphObject or Diagram reference when copying model data on property "'+
d+'" of data object: '+b.toString()+"  \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+g.toString()),g=!0):g=g instanceof L||g instanceof Ae||g instanceof We||g instanceof ve?!0:!1;g||(e=rf(a,e,!1));x.Ra(c,d,e)}x.lc(c);return c}return b instanceof N?b.copy():b instanceof Fa?b.copy():b instanceof w?b.copy():b instanceof R?b.copy():b instanceof yb?b.copy():b}
x.defineProperty(L,{tH:"afterCopyFunction"},function(){return this.tq},function(a){var b=this.tq;b!==a&&(null!==a&&x.g(a,"function",L,"afterCopyFunction"),this.tq=a,this.j("afterCopyFunction",b,a))});var uf=!1;
L.prototype.setDataProperty=function(a,b,c){u&&(x.g(a,"object",L,"setDataProperty:data"),x.g(b,"string",L,"setDataProperty:propname"),""===b&&x.k("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.je(a))if(b===this.rj)this.Zx(a,c);else{if(b===this.yn){this.Wx(a,c);return}}else!uf&&a instanceof O&&(uf=!0,x.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),x.trace("  Is that really your intent?"));var d=x.wb(a,b);d!==c&&
(x.Ra(a,b,c),this.WA(a,b,d,c))};L.prototype.addArrayItem=function(a,b){this.MI(a,-1,b)};L.prototype.insertArrayItem=L.prototype.MI=function(a,b,c){u&&(x.kt(a,L,"insertArrayItem:arr"),x.p(b,L,"insertArrayItem:idx"));a===this.xf&&x.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=x.ab(a));x.cj(a,b,c);lf(this,"",ye,"",a,null,c,null,b)};
L.prototype.removeArrayItem=function(a,b){void 0===b&&(b=-1);u&&(x.kt(a,L,"removeArrayItem:arr"),x.p(b,L,"removeArrayItem:idx"));a===this.xf&&x.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=x.ab(a)-1);var c=x.Wa(a,b);x.ki(a,b);lf(this,"",ze,"",a,c,null,b,null)};x.defineProperty(L,{yn:"nodeCategoryProperty"},function(){return this.Gm},function(a){var b=this.Gm;b!==a&&(mf(a,L,"nodeCategoryProperty"),this.Gm=a,this.j("nodeCategoryProperty",b,a))});
L.prototype.getCategoryForNodeData=L.prototype.qA=function(a){if(null===a)return"";var b=this.Gm;if(""===b)return"";b=x.wb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;x.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
L.prototype.setCategoryForNodeData=L.prototype.Wx=function(a,b){x.g(b,"string",L,"setCategoryForNodeData:cat");if(null!==a){var c=this.Gm;if(""!==c)if(this.je(a)){var d=x.wb(a,c);void 0===d&&(d="");d!==b&&(x.Ra(a,c,b),lf(this,"nodeCategory",we,c,a,d,b))}else x.Ra(a,c,b)}};
function X(a,b){2<arguments.length&&x.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");L.call(this);this.wf=[];this.Bm=new K(Object);this.hd=new ra(null,Object);this.gl="";this.Sk=this.Vn=this.Jo=null;this.Xh="from";this.Yh="to";this.Dm=this.Cm="";this.Am="category";this.tg="";this.Mo="isGroup";this.dh="group";this.Hq=!1;void 0!==a&&(this.Jg=a);void 0!==b&&(this.th=b)}x.Qa(X,L);x.ja("GraphLinksModel",X);
X.prototype.cloneProtected=function(a){L.prototype.cloneProtected.call(this,a);a.gl=this.gl;a.Jo=this.Jo;a.Vn=this.Vn;a.Xh=this.Xh;a.Yh=this.Yh;a.Cm=this.Cm;a.Dm=this.Dm;a.Am=this.Am;a.tg=this.tg;a.Mo=this.Mo;a.dh=this.dh;a.Hq=this.Hq};X.prototype.clear=X.prototype.clear=function(){L.prototype.clear.call(this);this.wf=[];this.hd.clear();this.Bm.clear()};f=X.prototype;
f.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.pB();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.Jg;for(var c=x.ab(a),d=0,d=0;d<c;d++)var e=x.Wa(a,d),b=b+(" "+this.sb(e)+":"+la(e));b+="\n link data:";a=this.th;c=x.ab(a);for(d=0;d<c;d++)e=x.Wa(a,d),b+=" "+this.Ol(e)+"--\x3e"+this.Rl(e)}return b};
f.In=function(){var a=L.prototype.In.call(this),b="";"category"!==this.Ut&&"string"===typeof this.Ut&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.Ut));""!==this.pj&&"string"===typeof this.pj&&(b+=',\n  "linkKeyProperty": '+this.quote(this.pj));"from"!==this.Jp&&"string"===typeof this.Jp&&(b+=',\n  "linkFromKeyProperty": '+this.quote(this.Jp));"to"!==this.Lp&&"string"===typeof this.Lp&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.Lp));""!==this.Vt&&"string"===typeof this.Vt&&(b+=',\n  "linkFromPortIdProperty": '+
this.quote(this.Vt));""!==this.Xt&&"string"===typeof this.Xt&&(b+=',\n  "linkToPortIdProperty": '+this.quote(this.Xt));""!==this.Wt&&"string"===typeof this.Wt&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.Wt));"isGroup"!==this.du&&"string"===typeof this.du&&(b+=',\n  "nodeIsGroupProperty": '+this.quote(this.du));"group"!==this.Up&&"string"===typeof this.Up&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.Up));return a+b};
f.hu=function(a){L.prototype.hu.call(this,a);a.linkKeyProperty&&(this.pj=a.linkKeyProperty);a.linkFromKeyProperty&&(this.Jp=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.Lp=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.Vt=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.Xt=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.Ut=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.Wt=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.du=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&
(this.Up=a.nodeGroupKeyProperty)};f.yB=function(){var a=L.prototype.yB.call(this),b=',\n  "linkDataArray": '+Se(this,this.th,!0);return a+b};f.YA=function(a){L.prototype.YA.call(this,a);a=a.linkDataArray;x.isArray(a)&&(this.lu(a),this.th=a)};
f.zB=function(a){a instanceof X||x.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel");""===this.pj&&x.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=L.prototype.zB.call(this,a);Ue(this,a,"linkKeyProperty");Ue(this,a,"linkFromKeyProperty");Ue(this,a,"linkToKeyProperty");Ue(this,a,"linkLabelKeysProperty");Ue(this,a,"nodeIsGroupProperty");Ue(this,a,"nodeGroupKeyProperty");for(var c=new K,d=new K,e=(new K).$c(this.hd.qF),
g=new ra,h=a.th,k=0;k<h.length;k++){var l=h[k],m=a.lf(l);if(void 0!==m){e.remove(m);var n=this.wt(m);null===n?(c.add(m),d.add(l)):Te(this,n,l,g)||d.add(l)}else this.EA(l),m=this.lf(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.wy+Se(this,c.kc(),!0));0<d.count&&(a+=this.LB+Se(this,d.kc(),!0));0<e.count&&(a+=this.yy+Se(this,e.kc(),!0));return a};f.wy=',\n  "insertedLinkKeys": ';f.LB=',\n  "modifiedLinkData": ';f.yy=',\n  "removedLinkKeys": ';
f.xB=function(a,b){""===this.pj&&x.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=L.prototype.xB.call(this,a,b),d=this,e=new K,g=new K,h=new K;a.$f.each(function(a){a.aa===d&&("linkDataArray"===a.rf?a.Dc===ye?e.add(a.newValue):a.Dc===ze&&h.add(a.oldValue):d.ph(a.object)&&g.add(a.object))});var k=new K;e.each(function(a){k.add(d.lf(a));b||g.add(a)});var l=new K;h.each(function(a){l.add(d.lf(a));b&&g.add(a)});0<k.count&&(c+=(b?this.yy:this.wy)+
Se(this,k.kc(),!0));0<g.count&&(c+=this.LB+Se(this,g.kc(),!0));0<l.count&&(c+=(b?this.wy:this.yy)+Se(this,l.kc(),!0));return c};
f.XA=function(a){L.prototype.XA.call(this,a);var b=a.insertedLinkKeys;if(x.isArray(b))for(var c=x.ab(b),d=0;d<c;d++){var e=x.Wa(b,d),g=this.wt(e);null===g&&(g=this.Yw({}),this.fG(g,e),this.bt(g))}b=a.modifiedLinkData;if(x.isArray(b))for(c=x.ab(b),d=0;d<c;d++){var h=x.Wa(b,d),e=this.lf(h),g=this.wt(e);if(null!==g)for(var k in h)"__gohashid"!==k&&k!==this.pj&&this.setDataProperty(g,k,h[k])}a=a.removedLinkKeys;if(x.isArray(a))for(c=x.ab(a),d=0;d<c;d++)e=x.Wa(a,d),g=this.wt(e),null!==g&&this.Px(g)};
f.bn=function(a,b){var c=null;if(a.Dc===ye){if("linkDataArray"===a.rf?c=this.wf:"linkLabelKeys"===a.rf&&(c=this.uk(a.object)),x.isArray(c)){if(b)x.ki(c,a.Ig),c===this.wf&&(c=this.lf(a.newValue),void 0!==c&&this.hd.remove(c));else if(x.cj(c,a.Ig,a.newValue),c===this.wf){var d=a.newValue,c=this.lf(d);void 0!==c&&this.hd.add(c,d)}return}}else if(a.Dc===ze&&("linkDataArray"===a.rf?c=this.wf:"linkLabelKeys"===a.rf&&(c=this.uk(a.object)),x.isArray(c))){b?(x.cj(c,a.Kg,a.oldValue),c===this.wf&&(d=a.newValue,
c=this.lf(d),void 0!==c&&this.hd.add(c,d))):(x.ki(c,a.Kg),c===this.wf&&(c=this.lf(a.newValue),void 0!==c&&this.hd.remove(c)));return}L.prototype.bn.call(this,a,b)};x.defineProperty(X,{Xz:"archetypeNodeData"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(null!==a&&x.l(a,Object,X,"archetypeNodeData"),this.Sk=a,this.j("archetypeNodeData",b,a))});X.prototype.wn=function(a){if(void 0!==a){var b=this.Sk;if(null!==b){var c=this.le(a);null===c&&(c=this.copyNodeData(b),x.Ra(c,this.Xj,a),this.vl(c))}return a}};
x.defineProperty(X,{Jp:"linkFromKeyProperty"},function(){return this.Xh},function(a){var b=this.Xh;b!==a&&(mf(a,X,"linkFromKeyProperty"),this.Xh=a,this.j("linkFromKeyProperty",b,a))});X.prototype.getFromKeyForLinkData=X.prototype.Ol=function(a){if(null!==a){var b=this.Xh;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setFromKeyForLinkData=X.prototype.Xx=function(a,b){null===b&&(b=void 0);void 0===b||nf(b)||x.jc(b,"number or string",X,"setFromKeyForLinkData:key");if(null!==a){var c=this.Xh;if(""!==c)if(b=this.wn(b),this.ph(a)){var d=x.wb(a,c);d!==b&&(qf(this,d,a),x.Ra(a,c,b),null===this.le(b)&&pf(this,b,a),lf(this,"linkFromKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
x.defineProperty(X,{Lp:"linkToKeyProperty"},function(){return this.Yh},function(a){var b=this.Yh;b!==a&&(mf(a,X,"linkToKeyProperty"),this.Yh=a,this.j("linkToKeyProperty",b,a))});X.prototype.getToKeyForLinkData=X.prototype.Rl=function(a){if(null!==a){var b=this.Yh;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setToKeyForLinkData=X.prototype.ay=function(a,b){null===b&&(b=void 0);void 0===b||nf(b)||x.jc(b,"number or string",X,"setToKeyForLinkData:key");if(null!==a){var c=this.Yh;if(""!==c)if(b=this.wn(b),this.ph(a)){var d=x.wb(a,c);d!==b&&(qf(this,d,a),x.Ra(a,c,b),null===this.le(b)&&pf(this,b,a),lf(this,"linkToKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
x.defineProperty(X,{Vt:"linkFromPortIdProperty"},function(){return this.Cm},function(a){var b=this.Cm;b!==a&&(mf(a,X,"linkFromPortIdProperty"),this.Cm=a,this.j("linkFromPortIdProperty",b,a))});X.prototype.getFromPortIdForLinkData=X.prototype.vI=function(a){if(null===a)return"";var b=this.Cm;if(""===b)return"";a=x.wb(a,b);return void 0===a?"":a};
X.prototype.setFromPortIdForLinkData=X.prototype.gB=function(a,b){x.g(b,"string",X,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Cm;if(""!==c)if(this.ph(a)){var d=x.wb(a,c);void 0===d&&(d="");d!==b&&(x.Ra(a,c,b),lf(this,"linkFromPortId",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};x.defineProperty(X,{Xt:"linkToPortIdProperty"},function(){return this.Dm},function(a){var b=this.Dm;b!==a&&(mf(a,X,"linkToPortIdProperty"),this.Dm=a,this.j("linkToPortIdProperty",b,a))});
X.prototype.getToPortIdForLinkData=X.prototype.yI=function(a){if(null===a)return"";var b=this.Dm;if(""===b)return"";a=x.wb(a,b);return void 0===a?"":a};X.prototype.setToPortIdForLinkData=X.prototype.jB=function(a,b){x.g(b,"string",X,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Dm;if(""!==c)if(this.ph(a)){var d=x.wb(a,c);void 0===d&&(d="");d!==b&&(x.Ra(a,c,b),lf(this,"linkToPortId",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
x.defineProperty(X,{Wt:"linkLabelKeysProperty"},function(){return this.tg},function(a){var b=this.tg;b!==a&&(mf(a,X,"linkLabelKeysProperty"),this.tg=a,this.j("linkLabelKeysProperty",b,a))});X.prototype.getLabelKeysForLinkData=X.prototype.uk=function(a){if(null===a)return x.Kh;var b=this.tg;if(""===b)return x.Kh;a=x.wb(a,b);return void 0===a?x.Kh:a};
X.prototype.setLabelKeysForLinkData=X.prototype.gG=function(a,b){x.kt(b,X,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.tg;if(""!==c)if(this.ph(a)){var d=x.wb(a,c);void 0===d&&(d=x.Kh);if(d!==b){for(var e=x.ab(d),g=0;g<e;g++){var h=x.Wa(d,g);qf(this,h,a)}x.Ra(a,c,b);e=x.ab(b);for(g=0;g<e;g++)h=x.Wa(b,g),null===this.le(h)&&pf(this,h,a);lf(this,"linkLabelKeys",we,c,a,d,b);"string"===typeof c&&this.Ob(a,c)}}else x.Ra(a,c,b)}};
X.prototype.addLabelKeyForLinkData=X.prototype.Uz=function(a,b){if(null!==b&&void 0!==b&&(nf(b)||x.jc(b,"number or string",X,"addLabelKeyForLinkData:key"),null!==a)){var c=this.tg;if(""!==c){var d=x.wb(a,c);void 0===d?(c=[],c.push(b),this.gG(a,c)):x.isArray(d)?0<=x.Yz(d,b)||(x.cj(d,Infinity,b),this.ph(a)&&(null===this.le(b)&&pf(this,b,a),lf(this,"linkLabelKeys",ye,c,a,null,b))):x.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
X.prototype.removeLabelKeyForLinkData=X.prototype.KF=function(a,b){if(null!==b&&void 0!==b&&(nf(b)||x.jc(b,"number or string",X,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.tg;if(""!==c){var d=x.wb(a,c);if(x.isArray(d)){var e=x.Yz(d,b);0>e||(x.ki(d,e),this.ph(a)&&(qf(this,b,a),lf(this,"linkLabelKeys",ze,c,a,b,null)))}else void 0!==d&&x.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
x.defineProperty(X,{th:"linkDataArray"},function(){return this.wf},function(a){var b=this.wf;if(b!==a){x.kt(a,X,"linkDataArray");this.hd.clear();for(var c=x.ab(a),d=0;d<c;d++){var e=x.Wa(a,d);if(!x.Ya(e)){x.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}x.Ht(e)}this.wf=a;if(""!==this.pj){for(var g=new J(Object),d=0;d<c;d++){var e=x.Wa(a,d),h=this.lf(e);void 0===h?g.add(e):null!==this.hd.oa(h)?g.add(e):this.hd.add(h,e)}for(d=g.i;d.next();)e=d.value,this.EA(e),g=this.lf(e),
void 0!==g&&this.hd.add(g,e)}g=new K(Object);for(d=0;d<c;d++)e=x.Wa(a,d),g.add(e);this.Bm=g;lf(this,"linkDataArray",we,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=x.Wa(a,d),vf(this,e)}});x.defineProperty(X,{pj:"linkKeyProperty"},function(){return this.gl},function(a){var b=this.gl;if(b!==a){mf(a,X,"linkKeyProperty");this.gl=a;this.hd.clear();for(var c=x.ab(this.th),d=0;d<c;d++){var e=x.Wa(this.th,d),g=this.lf(e);void 0!==g&&this.hd.add(g,e)}this.j("linkKeyProperty",b,a)}});
X.prototype.getKeyForLinkData=X.prototype.lf=function(a){if(null!==a){var b=this.gl;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("Key value for link data "+a+" is not a number or a string: "+b)}}};
X.prototype.setKeyForLinkData=X.prototype.fG=function(a,b){void 0!==b&&null!==b&&nf(b)||x.jc(b,"number or string",X,"setKeyForLinkData:key");if(null!==a){var c=this.gl;if(""!==c)if(this.ph(a)){var d=x.wb(a,c);d!==b&&null===this.wt(b)&&(x.Ra(a,c,b),this.hd.remove(d),this.hd.add(b,a),lf(this,"linkKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
x.defineProperty(X,{EL:"makeUniqueLinkKeyFunction"},function(){return this.Jo},function(a){var b=this.Jo;b!==a&&(null!==a&&x.g(a,"function",X,"makeUniqueLinkKeyFunction"),this.Jo=a,this.j("makeUniqueLinkKeyFunction",b,a))});X.prototype.findLinkDataForKey=X.prototype.wt=function(a){null===a&&x.k("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&nf(a)?this.hd.oa(a):null};
X.prototype.makeLinkDataKeyUnique=X.prototype.EA=function(a){if(null!==a){var b=this.gl;if(""!==b){var c=this.lf(a);if(void 0===c||this.hd.contains(c)){var d=this.Jo;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.hd.contains(c))){x.Ra(a,b,c);return}if("string"===typeof c){for(d=2;this.hd.contains(c+d);)d++;x.Ra(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.hd.count-1;this.hd.contains(d);)d--;x.Ra(a,b,d)}else x.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+
c)}}}};X.prototype.containsLinkData=X.prototype.ph=function(a){return null===a?!1:this.Bm.contains(a)};
X.prototype.addLinkData=X.prototype.bt=function(a){if(null!==a){if(void 0===x.od(a))x.lc(a);else if(this.ph(a))return;if(""!==this.pj){var b=this.lf(a);if(void 0!==b&&this.hd.oa(b)===a)return;this.EA(a);b=this.lf(a);if(void 0===b){x.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+a+". Data not added to model.");return}this.hd.add(b,a)}this.Bm.add(a);b=x.ab(this.wf);x.cj(this.wf,b,a);lf(this,"linkDataArray",ye,"linkDataArray",this,null,a,null,b);vf(this,a)}};
X.prototype.addLinkDataCollection=function(a){if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.bt(x.Wa(a,c));else for(a=a.i;a.next();)this.bt(a.value)};
X.prototype.removeLinkData=X.prototype.Px=function(a){if(null!==a){this.Bm.remove(a);var b=this.lf(a);void 0!==b&&this.hd.remove(b);b=this.wf.indexOf(a);if(!(0>b)){x.ki(this.wf,b);lf(this,"linkDataArray",ze,"linkDataArray",this,a,null,b,null);b=this.Ol(a);qf(this,b,a);b=this.Rl(a);qf(this,b,a);var c=this.uk(a);if(x.isArray(c))for(var d=x.ab(c),e=0;e<d;e++)b=x.Wa(c,e),qf(this,b,a)}}};
X.prototype.removeLinkDataCollection=function(a){if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++)this.Px(x.Wa(a,c));else for(a=a.i;a.next();)this.Px(a.value)};function vf(a,b){var c=a.Ol(b),c=a.wn(c);null===a.le(c)&&pf(a,c,b);c=a.Rl(b);c=a.wn(c);null===a.le(c)&&pf(a,c,b);var d=a.uk(b);if(x.isArray(d))for(var e=x.ab(d),g=0;g<e;g++)c=x.Wa(d,g),null===a.le(c)&&pf(a,c,b)}
x.defineProperty(X,{QK:"copyLinkDataFunction"},function(){return this.Vn},function(a){var b=this.Vn;b!==a&&(null!==a&&x.g(a,"function",X,"copyLinkDataFunction"),this.Vn=a,this.j("copyLinkDataFunction",b,a))});X.prototype.copyLinkData=X.prototype.Yw=function(a){if(null===a)return null;var b=null,b=this.Vn,b=null!==b?b(a,this):rf(this,a,!0);x.Ya(b)&&(x.lc(b),""!==this.Xh&&x.Ra(b,this.Xh,void 0),""!==this.Yh&&x.Ra(b,this.Yh,void 0),""!==this.tg&&x.Ra(b,this.tg,[]));return b};
x.defineProperty(X,{du:"nodeIsGroupProperty"},function(){return this.Mo},function(a){var b=this.Mo;b!==a&&(mf(a,X,"nodeIsGroupProperty"),this.Mo=a,this.j("nodeIsGroupProperty",b,a))});X.prototype.isGroupForNodeData=X.prototype.yA=function(a){if(null===a)return!1;var b=this.Mo;return""===b?!1:x.wb(a,b)?!0:!1};x.defineProperty(X,{Up:"nodeGroupKeyProperty"},function(){return this.dh},function(a){var b=this.dh;b!==a&&(mf(a,X,"nodeGroupKeyProperty"),this.dh=a,this.j("nodeGroupKeyProperty",b,a))});
x.defineProperty(X,{fn:"copiesGroupKeyOfNodeData"},function(){return this.Hq},function(a){this.Hq!==a&&(x.g(a,"boolean",X,"copiesGroupKeyOfNodeData"),this.Hq=a)});X.prototype.getGroupKeyForNodeData=X.prototype.pn=function(a){if(null!==a){var b=this.dh;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
X.prototype.setGroupKeyForNodeData=X.prototype.Yx=function(a,b){null===b&&(b=void 0);void 0===b||nf(b)||x.jc(b,"number or string",X,"setGroupKeyForNodeData:key");if(null!==a){var c=this.dh;if(""!==c)if(this.je(a)){var d=x.wb(a,c);d!==b&&(qf(this,d,a),x.Ra(a,c,b),null===this.le(b)&&pf(this,b,a),lf(this,"nodeGroupKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
X.prototype.copyNodeData=function(a){if(null===a)return null;a=L.prototype.copyNodeData.call(this,a);this.fn||""===this.dh||void 0===x.wb(a,this.dh)||x.Ra(a,this.dh,void 0);return a};
X.prototype.setDataProperty=function(a,b,c){u&&(x.g(a,"object",X,"setDataProperty:data"),x.g(b,"string",X,"setDataProperty:propname"),""===b&&x.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.je(a))if(b===this.rj)this.Zx(a,c);else{if(b===this.yn){this.Wx(a,c);return}if(b===this.Up){this.Yx(a,c);return}b===this.du&&x.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.ph(a)){if(b===
this.Jp){this.Xx(a,c);return}if(b===this.Lp){this.ay(a,c);return}if(b===this.Vt){this.gB(a,c);return}if(b===this.Xt){this.jB(a,c);return}if(b===this.pj){this.fG(a,c);return}if(b===this.Ut){this.eG(a,c);return}if(b===this.Wt){this.gG(a,c);return}}else!uf&&a instanceof O&&(uf=!0,x.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),x.trace("  Is that really your intent?"));var d=x.wb(a,b);d!==c&&(x.Ra(a,b,c),this.WA(a,b,d,c))};f=X.prototype;
f.ku=function(a,b){L.prototype.ku.call(this,a,b);for(var c=this.vc.i;c.next();)this.cB(c.value,a,b);for(c=this.Bm.i;c.next();){var d=c.value,e=a,g=b;if(this.Ol(d)===e){var h=this.Xh;x.Ra(d,h,g);lf(this,"linkFromKey",we,h,d,e,g);"string"===typeof h&&this.Ob(d,h)}this.Rl(d)===e&&(h=this.Yh,x.Ra(d,h,g),lf(this,"linkToKey",we,h,d,e,g),"string"===typeof h&&this.Ob(d,h));var k=this.uk(d);if(x.isArray(k))for(var l=x.ab(k),h=this.tg,m=0;m<l;m++)x.Wa(k,m)===e&&(x.hE(k,m,g),lf(this,"linkLabelKeys",ye,h,d,e,
g))}};f.cB=function(a,b,c){if(this.pn(a)===b){var d=this.dh;x.Ra(a,d,c);lf(this,"nodeGroupKey",we,d,a,b,c);"string"===typeof d&&this.Ob(a,d)}};f.tB=function(){L.prototype.tB.call(this);for(var a=this.th,b=x.ab(a),c=0;c<b;c++){var d=x.Wa(a,c);vf(this,d)}};
f.Zp=function(a){L.prototype.Zp.call(this,a);a=this.sb(a);var b=of(this,a);if(null!==b){for(var c=new J(Object),b=b.i;b.next();){var d=b.value;if(this.je(d)){if(this.pn(d)===a){var e=this.dh;lf(this,"nodeGroupKey",we,e,d,a,a);"string"===typeof e&&this.Ob(d,e);c.add(d)}}else{this.Ol(d)===a&&(e=this.Xh,lf(this,"linkFromKey",we,e,d,a,a),"string"===typeof e&&this.Ob(d,e),c.add(d));this.Rl(d)===a&&(e=this.Yh,lf(this,"linkToKey",we,e,d,a,a),"string"===typeof e&&this.Ob(d,e),c.add(d));var g=this.uk(d);if(x.isArray(g))for(var h=
x.ab(g),e=this.tg,k=0;k<h;k++)x.Wa(g,k)===a&&(lf(this,"linkLabelKeys",ye,e,d,a,a),c.add(d))}}for(c=c.i;c.next();)qf(this,a,c.value)}};f.Yp=function(a){L.prototype.Yp.call(this,a);var b=this.pn(a);null===this.le(b)&&pf(this,b,a)};f.Cu=function(a){L.prototype.Cu.call(this,a);var b=this.pn(a);qf(this,b,a)};x.defineProperty(X,{Ut:"linkCategoryProperty"},function(){return this.Am},function(a){var b=this.Am;b!==a&&(mf(a,X,"linkCategoryProperty"),this.Am=a,this.j("linkCategoryProperty",b,a))});
X.prototype.getCategoryForLinkData=X.prototype.mx=function(a){if(null===a)return"";var b=this.Am;if(""===b)return"";b=x.wb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;x.k("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
X.prototype.setCategoryForLinkData=X.prototype.eG=function(a,b){x.g(b,"string",X,"setCategoryForLinkData:cat");if(null!==a){var c=this.Am;if(""===c)return"";if(this.ph(a)){var d=x.wb(a,c);void 0===d&&(d="");d!==b&&(x.Ra(a,c,b),lf(this,"linkCategory",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
function Ve(a){1<arguments.length&&x.k("TreeModel constructor can only take one optional argument, the Array of node data.");L.call(this);this.eh="parent";this.Iq=!1;this.Im="parentLinkCategory";void 0!==a&&(this.Jg=a)}x.Qa(Ve,L);x.ja("TreeModel",Ve);Ve.prototype.cloneProtected=function(a){L.prototype.cloneProtected.call(this,a);a.eh=this.eh;a.Iq=this.Iq;a.Im=this.Im};
Ve.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.pB();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.Jg;for(var c=x.ab(a),d=0;d<c;d++)var e=x.Wa(a,d),b=b+(" "+this.sb(e)+":"+la(e))}return b};Ve.prototype.In=function(){var a=L.prototype.In.call(this),b="";"parent"!==this.Vp&&"string"===typeof this.Vp&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.Vp));return a+b};
Ve.prototype.hu=function(a){L.prototype.hu.call(this,a);a.nodeParentKeyProperty&&(this.Vp=a.nodeParentKeyProperty)};Ve.prototype.wn=function(a){return a};x.defineProperty(Ve,{Vp:"nodeParentKeyProperty"},function(){return this.eh},function(a){var b=this.eh;b!==a&&(mf(a,Ve,"nodeParentKeyProperty"),this.eh=a,this.j("nodeParentKeyProperty",b,a))});
x.defineProperty(Ve,{gn:"copiesParentKeyOfNodeData"},function(){return this.Iq},function(a){this.Iq!==a&&(x.g(a,"boolean",Ve,"copiesParentKeyOfNodeData"),this.Iq=a)});Ve.prototype.getParentKeyForNodeData=Ve.prototype.qn=function(a){if(null!==a){var b=this.eh;if(""!==b&&(b=x.wb(a,b),void 0!==b)){if(nf(b))return b;x.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
Ve.prototype.setParentKeyForNodeData=Ve.prototype.Hh=function(a,b){null===b&&(b=void 0);void 0===b||nf(b)||x.jc(b,"number or string",Ve,"setParentKeyForNodeData:key");if(null!==a){var c=this.eh;if(""!==c)if(b=this.wn(b),this.je(a)){var d=x.wb(a,c);d!==b&&(qf(this,d,a),x.Ra(a,c,b),null===this.le(b)&&pf(this,b,a),lf(this,"nodeParentKey",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
x.defineProperty(Ve,{$L:"parentLinkCategoryProperty"},function(){return this.Im},function(a){var b=this.Im;b!==a&&(mf(a,Ve,"parentLinkCategoryProperty"),this.Im=a,this.j("parentLinkCategoryProperty",b,a))});Ve.prototype.getParentLinkCategoryForNodeData=Ve.prototype.xI=function(a){if(null===a)return"";var b=this.Im;if(""===b)return"";b=x.wb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;x.k("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
Ve.prototype.setParentLinkCategoryForNodeData=Ve.prototype.UJ=function(a,b){x.g(b,"string",Ve,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.Im;if(""===c)return"";if(this.je(a)){var d=x.wb(a,c);void 0===d&&(d="");d!==b&&(x.Ra(a,c,b),lf(this,"parentLinkCategory",we,c,a,d,b),"string"===typeof c&&this.Ob(a,c))}else x.Ra(a,c,b)}};
Ve.prototype.copyNodeData=function(a){if(null===a)return null;a=L.prototype.copyNodeData.call(this,a);this.gn||""===this.eh||void 0===x.wb(a,this.eh)||x.Ra(a,this.eh,void 0);return a};
Ve.prototype.setDataProperty=function(a,b,c){u&&(x.g(a,"object",Ve,"setDataProperty:data"),x.g(b,"string",Ve,"setDataProperty:propname"),""===b&&x.k("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.je(a))if(b===this.rj)this.Zx(a,c);else{if(b===this.yn){this.Wx(a,c);return}if(b===this.Vp){this.Hh(a,c);return}}else!uf&&a instanceof O&&(uf=!0,x.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),x.trace("  Is that really your intent?"));
var d=x.wb(a,b);d!==c&&(x.Ra(a,b,c),this.WA(a,b,d,c))};f=Ve.prototype;f.ku=function(a,b){L.prototype.ku.call(this,a,b);for(var c=this.vc.i;c.next();)this.cB(c.value,a,b)};f.cB=function(a,b,c){if(this.qn(a)===b){var d=this.eh;x.Ra(a,d,c);lf(this,"nodeParentKey",we,d,a,b,c);"string"===typeof d&&this.Ob(a,d)}};
f.Zp=function(a){L.prototype.Zp.call(this,a);a=this.sb(a);var b=of(this,a);if(null!==b){for(var c=new J(Object),b=b.i;b.next();){var d=b.value;if(this.je(d)&&this.qn(d)===a){var e=this.eh;lf(this,"nodeParentKey",we,e,d,a,a);"string"===typeof e&&this.Ob(d,e);c.add(d)}}for(c=c.i;c.next();)qf(this,a,c.value)}};f.Yp=function(a){L.prototype.Yp.call(this,a);var b=this.qn(a),b=this.wn(b);null===this.le(b)&&pf(this,b,a)};f.Cu=function(a){L.prototype.Cu.call(this,a);var b=this.qn(a);qf(this,b,a)};
function wf(a,b,c){x.lc(this);this.H=!1;void 0===a?a="":x.g(a,"string",wf,"constructor:targetprop");void 0===b?b=a:x.g(b,"string",wf,"constructor:sourceprop");void 0===c?c=null:null!==c&&x.g(c,"function",wf,"constructor:conv");this.CD=-1;this.yg=null;this.Cw=a;this.Aw=this.Iz=0;this.yD=null;this.oz=!1;this.uw=b;this.My=c;this.vz=Bf;this.Fy=null}x.ja("Binding",wf);var Bf;wf.OneWay=Bf=x.s(wf,"OneWay",1);var Cf;wf.TwoWay=Cf=x.s(wf,"TwoWay",2);
wf.parseEnum=function(a,b){x.g(a,"function",wf,"parseEnum:ctor");x.Ca(b,a,wf,"parseEnum:defval");return function(c){c=La(a,c);return null===c?b:c}};var la;wf.toString=la=function(a){var b=a;x.Ya(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()};
wf.prototype.toString=function(){return"Binding("+this.zu+":"+this.kG+(-1!==this.cm?" "+this.cm:"")+" "+this.mode.name+")"};wf.prototype.freeze=function(){this.H=!0;return this};wf.prototype.Va=function(){this.H=!1;return this};x.defineProperty(wf,{cm:null},function(){return this.CD},function(a){this.H&&x.pa(this);x.g(a,"number",wf,"targetId");this.CD=a});
x.defineProperty(wf,{zu:"targetProperty"},function(){return this.Cw},function(a){this.H&&x.pa(this);x.g(a,"string",wf,"targetProperty");this.Cw=a});x.defineProperty(wf,{En:"sourceName"},function(){return this.yD},function(a){this.H&&x.pa(this);null!==a&&x.g(a,"string",wf,"sourceName");this.yD=a;null!==a&&(this.oz=!1)});x.defineProperty(wf,{Qt:"isToModel"},function(){return this.oz},function(a){this.H&&x.pa(this);x.g(a,"boolean",wf,"isToModel");this.oz=a});
x.defineProperty(wf,{kG:"sourceProperty"},function(){return this.uw},function(a){this.H&&x.pa(this);x.g(a,"string",wf,"sourceProperty");this.uw=a});x.defineProperty(wf,{OH:"converter"},function(){return this.My},function(a){this.H&&x.pa(this);null!==a&&x.g(a,"function",wf,"converter");this.My=a});x.defineProperty(wf,{zH:"backConverter"},function(){return this.Fy},function(a){this.H&&x.pa(this);null!==a&&x.g(a,"function",wf,"backConverter");this.Fy=a});
x.defineProperty(wf,{mode:"mode"},function(){return this.vz},function(a){this.H&&x.pa(this);x.Ca(a,wf,wf,"mode");this.vz=a});wf.prototype.makeTwoWay=wf.prototype.jJ=function(a){void 0===a&&(a=null);null!==a&&x.g(a,"function",wf,"makeTwoWay");this.mode=Cf;this.zH=a;return this};wf.prototype.ofObject=wf.prototype.Gx=function(a){void 0===a&&(a="");u&&x.g(a,"string",wf,"ofObject:srcname");this.En=a;this.Qt=!1;return this};wf.prototype.ofModel=function(){this.En=null;this.Qt=!0;return this};
wf.prototype.ofData=function(){this.En=null;this.Qt=!1;return this};function Df(a,b,c){a=a.En;var d=null;return d=null===a||""===a?b:"."===a?c:".."===a?c.V:b.me(a)}
wf.prototype.updateTarget=wf.prototype.CG=function(a,b,c){var d=this.uw;if(void 0===c||d===c){c=this.Cw;var e=this.My;if(null===e&&""===c)x.trace("Binding error: target property is the empty string: "+this.toString());else{u&&"string"===typeof c&&("function"!==typeof a.setAttribute&&0<c.length&&"_"!==c[0]&&!x.ox(a,c)?x.trace("Binding error: undefined target property: "+c+" on "+a.toString()):"name"===c&&a instanceof O&&x.trace("Binding error: cannot modify GraphObject.name on "+a.toString()));var g=
b;""!==d&&(g=x.wb(b,d));if(void 0!==g)if(null===e)""!==c&&x.Ra(a,c,g);else try{if(""!==c){var h=e(g,a);u&&void 0===h&&x.trace('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);x.Ra(a,c,h)}else e(g,a)}catch(k){u&&x.trace("Binding error: "+k.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}};
wf.prototype.updateSource=wf.prototype.hy=function(a,b,c,d){void 0===d&&(d=null);if(this.vz===Cf){var e=this.Cw;if(void 0===c||e===c){c=this.uw;var g=this.Fy;if(null!==g||""!==c){var h=a;""!==e&&(h=x.wb(a,e));if(void 0!==h)if(null===g)null!==d&&d.aa?(u&&d.aa.rj===c&&d.aa.je(b)&&x.trace("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),d.aa.setDataProperty(b,c,h)):x.Ra(b,c,h);else try{if(""!==c){var k=g(h,b);null!==d&&d.aa?(u&&(d.aa.rj===c&&d.aa.je(b)&&x.trace("Binding error: cannot have TwoWay Binding on node data key property: "+
this.toString()),void 0===k&&x.trace('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+g)),d.aa.setDataProperty(b,c,k)):x.Ra(b,c,k)}else g(h,b)}catch(l){u&&x.trace("Binding error: "+l.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+g)}}}}};function We(){this.QG=(new J(ve)).freeze();this.Vb="";this.GC=!1}x.ja("Transaction",We);
We.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.$f.count.toString()+(this.Lt?"":", incomplete");if(void 0!==a&&0<a){a=this.$f.count;for(var c=0;c<a;c++){var d=this.$f.ia(c);null!==d&&(b+="\n  "+d.toString())}}return b};We.prototype.clear=We.prototype.clear=function(){var a=this.$f;a.Va();for(var b=a.count-1;0<=b;b--){var c=a.ia(b);null!==c&&c.clear()}a.clear();a.freeze()};We.prototype.canUndo=We.prototype.canUndo=function(){return this.Lt};
We.prototype.undo=We.prototype.undo=function(){if(this.canUndo())for(var a=this.$f.count-1;0<=a;a--){var b=this.$f.ia(a);null!==b&&b.undo()}};We.prototype.canRedo=We.prototype.canRedo=function(){return this.Lt};We.prototype.redo=We.prototype.redo=function(){if(this.canRedo())for(var a=this.$f.count,b=0;b<a;b++){var c=this.$f.ia(b);null!==c&&c.redo()}};x.w(We,{$f:"changes"},function(){return this.QG});x.defineProperty(We,{name:"name"},function(){return this.Vb},function(a){this.Vb=a});
x.defineProperty(We,{Lt:"isComplete"},function(){return this.GC},function(a){this.GC=a});function Ae(){this.xz=new K(L);this.af=!1;this.UG=(new J(We)).freeze();this.Xg=-1;this.VC=999;this.Ji=!1;this.hv=null;this.tl=0;this.Gy=!1;u&&(this.Gy=!0);this.bh=(new J("string")).freeze();this.Lo=new J("number");this.cz=!0;this.pz=!1}x.ja("UndoManager",Ae);
Ae.prototype.toString=function(a){for(var b="UndoManager "+this.kj+"<"+this.history.count+"<="+this.wF,b=b+"[",c=this.BF.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.BF.ia(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.ia(d).toString(a-1);return b};
Ae.prototype.clear=Ae.prototype.clear=function(){var a=this.history;a.Va();for(var b=a.count-1;0<=b;b--){var c=a.ia(b);null!==c&&c.clear()}a.clear();this.Xg=-1;a.freeze();this.Ji=!1;this.hv=null;this.tl=0;this.bh.Va();this.bh.clear();this.bh.freeze();this.Lo.clear()};Ae.prototype.addModel=Ae.prototype.rH=function(a){this.xz.add(a)};Ae.prototype.removeModel=Ae.prototype.IJ=function(a){this.xz.remove(a)};
Ae.prototype.startTransaction=Ae.prototype.Wb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.tb)return!1;!0===this.cz&&(this.cz=!1,this.tl++,this.kd("StartingFirstTransaction",a,this.gj),0<this.tl&&this.tl--);this.isEnabled&&(this.bh.Va(),this.bh.add(a),this.bh.freeze(),null===this.gj?this.Lo.add(0):this.Lo.add(this.gj.$f.count));this.tl++;var b=1===this.Jh;b&&this.kd("StartedTransaction",a,this.gj);return b};
Ae.prototype.commitTransaction=Ae.prototype.Md=function(a){void 0===a&&(a="");return Ef(this,!0,a)};Ae.prototype.rollbackTransaction=Ae.prototype.$p=function(){return Ef(this,!1,"")};
function Ef(a,b,c){if(a.tb)return!1;a.Zz&&1>a.Jh&&x.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Jh;d&&b&&a.isEnabled&&a.kd("CommittingTransaction",c,a.gj);var e=0;if(0<a.Jh&&(a.tl--,a.isEnabled)){var g=a.bh.count;0<g&&(""===c&&(c=a.bh.ia(0)),a.bh.Va(),a.bh.dd(g-1),a.bh.freeze());g=a.Lo.count;0<g&&(e=a.Lo.ia(g-1),a.Lo.dd(g-1))}g=a.gj;if(d){if(b){a.pz=!1;if(a.isEnabled&&null!==g){b=g;b.Lt=!0;b.name=c;d=a.history;d.Va();for(e=d.count-1;e>a.kj;e--)g=d.ia(e),null!==
g&&g.clear(),d.dd(e),a.pz=!0;e=a.wF;0===e&&(e=1);0<e&&d.count>=e&&(g=d.ia(0),null!==g&&g.clear(),d.dd(0),a.Xg--);d.add(b);a.Xg++;d.freeze();g=b}a.kd("CommittedTransaction",c,g)}else{a.Ji=!0;try{a.isEnabled&&null!==g&&(g.Lt=!0,g.undo())}finally{a.kd("RolledBackTransaction",c,g),a.Ji=!1}null!==g&&g.clear()}a.hv=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.$f;for(b=c.count-1;b>=a;b--)d=c.ia(b),null!==d&&d.undo(),c.Va(),c.dd(b);c.freeze()}return!1}
Ae.prototype.canUndo=Ae.prototype.canUndo=function(){if(!this.isEnabled||0<this.Jh||this.tb)return!1;var a=this.xG;return null!==a&&a.canUndo()?!0:!1};Ae.prototype.undo=Ae.prototype.undo=function(){if(this.canUndo()){var a=this.xG;try{this.kd("StartingUndo","Undo",a),this.Ji=!0,this.Xg--,a.undo()}catch(b){x.trace("undo error: "+b.toString())}finally{this.Ji=!1,this.kd("FinishedUndo","Undo",a)}}};
Ae.prototype.canRedo=Ae.prototype.canRedo=function(){if(!this.isEnabled||0<this.Jh||this.tb)return!1;var a=this.wG;return null!==a&&a.canRedo()?!0:!1};Ae.prototype.redo=Ae.prototype.redo=function(){if(this.canRedo()){var a=this.wG;try{this.kd("StartingRedo","Redo",a),this.Ji=!0,this.Xg++,a.redo()}catch(b){x.trace("redo error: "+b.toString())}finally{this.Ji=!1,this.kd("FinishedRedo","Redo",a)}}};
Ae.prototype.kd=function(a,b,c){void 0===c&&(c=null);var d=new ve;d.Dc=xe;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.sJ;a.next();)b=a.value,d.aa=b,b.Uw(d)};Ae.prototype.handleChanged=Ae.prototype.aF=function(a){if(this.isEnabled&&!this.tb&&!this.skipsEvent(a)){var b=this.gj;null===b&&(this.hv=b=new We);var c=a.copy(),b=b.$f;b.Va();b.add(c);b.freeze();this.Zz&&0>=this.Jh&&!this.cz&&(a=a.h,null!==a&&!1===a.Le||x.trace("Change not within a transaction: "+c.toString()))}};
Ae.prototype.skipsEvent=function(a){if(null===a||0>a.Dc.value)return!0;a=a.object;if(a instanceof O){if(a=a.layer,null!==a&&a.Nc)return!0}else if(a instanceof bf&&a.Nc)return!0;return!1};x.w(Ae,{sJ:"models"},function(){return this.xz.i});x.defineProperty(Ae,{isEnabled:"isEnabled"},function(){return this.af},function(a){this.af=a});x.w(Ae,{xG:"transactionToUndo"},function(){return 0<=this.kj&&this.kj<=this.history.count-1?this.history.ia(this.kj):null});
x.w(Ae,{wG:"transactionToRedo"},function(){return this.kj<this.history.count-1?this.history.ia(this.kj+1):null});x.w(Ae,{tb:"isUndoingRedoing"},function(){return this.Ji});x.w(Ae,{history:"history"},function(){return this.UG});x.defineProperty(Ae,{wF:"maxHistoryLength"},function(){return this.VC},function(a){this.VC=a});x.w(Ae,{kj:"historyIndex"},function(){return this.Xg});x.w(Ae,{gj:"currentTransaction"},function(){return this.hv});x.w(Ae,{Jh:"transactionLevel"},function(){return this.tl});
x.w(Ae,{mF:"isInTransaction"},function(){return 0<this.tl});x.defineProperty(Ae,{Zz:"checksTransactionLevel"},function(){return this.Gy},function(a){this.Gy=a});x.w(Ae,{BF:"nestedTransactionNames"},function(){return this.bh});function ua(){0<arguments.length&&x.pd(ua);x.lc(this);this.W=null;this.WB=!1;this.mC=this.XB=!0;this.ZB=this.$B=this.nC=this.aC=!1;this.kl=this.Cy=null;this.WD=1.05;this.kC=1;this.qz=NaN;this.SC=null;this.Sz=NaN;this.Rz=Q.sy;this.$j=null}x.ja("CommandHandler",ua);
var Ff=null,Gf="";ua.prototype.toString=function(){return"CommandHandler"};x.w(ua,{h:"diagram"},function(){return this.W});ua.prototype.Sc=function(a){u&&null!==a&&x.l(a,z,ua,"setDiagram");this.W=a};
ua.prototype.doKeyDown=function(){var a=this.h;if(null!==a){var b=a.S,c=x.wk?b.Zt: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():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():"Del"===g||"Backspace"===g?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===g?this.canSelectAll()&&
this.selectAll():"Esc"===g?this.canStopCommand()&&this.stopCommand():"Up"===g?a.Re&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===g?a.Re&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===g?a.Qe&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===g?a.Qe&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===g?d&&a.Qe?a.scroll("page","left"):a.Re&&a.scroll("page","up"):"PageDown"===g?d&&a.Qe?a.scroll("page","right"):a.Re&&a.scroll("page","down"):"Home"===
g?c&&a.Re?a.scroll("document","up"):!c&&a.Qe&&a.scroll("document","left"):"End"===g?c&&a.Re?a.scroll("document","down"):!c&&a.Qe&&a.scroll("document","right"):" "===g?this.canScrollToPart()&&this.scrollToPart():"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()}};ua.prototype.doKeyUp=function(){var a=this.h;null!==a&&(a.S.bubbles=!0)};ua.prototype.stopCommand=function(){var a=this.h;if(null!==a){var b=a.eb;b instanceof Hf&&a.yf&&a.Ww();null!==b&&b.doCancel()}};ua.prototype.canStopCommand=function(){return!0};
ua.prototype.selectAll=function(){var a=this.h;if(null!==a){a.ua();try{a.gc="wait";a.Ja("ChangingSelection");for(var b=a.sj;b.next();)b.value.lb=!0;for(var c=a.yh;c.next();)c.value.lb=!0;for(var d=a.links;d.next();)d.value.lb=!0}finally{a.Ja("ChangedSelection"),a.gc=""}}};ua.prototype.canSelectAll=function(){var a=this.h;return null!==a&&a.yf};
ua.prototype.deleteSelection=function(){var a=this.h;if(null!==a&&!a.Ja("SelectionDeleting",a.selection))try{a.gc="wait";a.Wb("Delete");a.Ja("ChangingSelection");for(var b=new K(D),c=a.selection.i;c.next();)If(b,c.value,!0,this.YH?Infinity:0,this.FE,function(a){return a.canDelete()});a.bB(b,!0);a.Ja("SelectionDeleted",b)}finally{a.Ja("ChangedSelection"),a.Md("Delete"),a.gc=""}};ua.prototype.canDeleteSelection=function(){var a=this.h;return null===a||a.kb||a.Ff||!a.Zm||0===a.selection.count?!1:!0};
function If(a,b,c,d,e,g){void 0===g&&(g=null);if(!(a.contains(b)||null!==g&&!g(b)||b instanceof fa))if(a.add(b),b instanceof E){if(c&&b instanceof F)for(var h=b.Gc;h.next();)If(a,h.value,c,d,e,g);if(e)for(h=b.ce;h.next();){var k=h.value;if(!a.contains(k)){var l=k.Z,m=k.fa;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?If(a,k,c,d,e,g):null!==l&&null!==m||If(a,k,c,d,e,g)}}if(1<d)for(b=b.RE();b.next();)If(a,b.value,c,d-1,e,g)}else if(b instanceof G)for(h=b.If;h.next();)If(a,h.value,c,d,e,g)}
ua.prototype.mp=function(a,b,c){var d=new ra(D,D);for(a=a.i;a.next();)Jf(this,a.value,b,d,c);if(null!==b){c=b.aa;a=!1;null!==b.vb.ke&&(a=b.vb.ke.ij);for(var e=new K(G),g=new ra(G,G),h=d.i;h.next();){var k=h.value;if(k instanceof G){var l=k;a||null!==l.Z&&null!==l.fa||e.add(l)}else if(c instanceof Ve&&k instanceof E&&null!==k.data){var l=c,m=k,k=h.key,n=k.nn();null!==n&&(n=d.oa(n),null!==n?(l.Hh(m.data,l.sb(n.data)),l=b.Eg(m.data),k=k.zt(),null!==k&&null!==l&&g.add(k,l)):l.Hh(m.data,void 0))}}0<e.count&&
b.bB(e,!1);if(0<g.count)for(c=g.i;c.next();)d.add(c.key,c.value)}if(null!==b&&(b=b.aa,c=b.tH,null!==c)){var p=new ra;d.each(function(a){null!==a.key.data&&p.add(a.key.data,a.value.data)});c(p,b,this.h.aa)}for(b=d.i;b.next();)b.value.Ob();return d};
function Jf(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.oa(b);var g=null,h=b.data;if(null!==h&&null!==c){var k=c.aa;b instanceof G?k instanceof X&&(h=k.Yw(h),x.Ya(h)&&(k.bt(h),g=c.Eg(h))):(h=k.copyNodeData(h),x.Ya(h)&&(k.vl(h),g=c.ni(h)))}else Kf(b),g=b.copy(),null!==g&&(null!==c?c.add(g):null!==h&&a.PH&&(k=a.h.aa,h=g instanceof G&&k instanceof X?k.Yw(h):k.copyNodeData(h),x.Ya(h)&&(g.data=h)));if(!(g instanceof D))return null;g.lb=!1;g.sh=!1;d.add(b,g);if(b instanceof
E){for(h=b.ce;h.next();){k=h.value;if(k.Z===b){var l=d.oa(k);null!==l&&(l.Z=g)}k.fa===b&&(l=d.oa(k),null!==l&&(l.fa=g))}if(b instanceof F&&g instanceof F)for(h=g,b=b.Gc;b.next();)k=Jf(a,b.value,c,d,e),k instanceof G||null===k||(k.Xa=h)}else if(b instanceof G)for(h=b.Z,null!==h&&(h=d.oa(h),null!==h&&(g.Z=h)),h=b.fa,null!==h&&(h=d.oa(h),null!==h&&(g.fa=h)),b=b.If;b.next();)h=Jf(a,b.value,c,d,e),null!==h&&(h.Od=g);return g}
ua.prototype.copySelection=function(){var a=this.h;if(null!==a){for(var b=new K(D),a=a.selection.i;a.next();)If(b,a.value,!0,this.SH?Infinity:0,this.QH,function(a){return a.canCopy()});this.copyToClipboard(b)}};ua.prototype.canCopySelection=function(){var a=this.h;return null!==a&&a.nk&&a.Vz&&0!==a.selection.count?!0:!1};ua.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
ua.prototype.canCutSelection=function(){var a=this.h;return null!==a&&!a.kb&&!a.Ff&&a.nk&&a.Zm&&a.Vz&&0!==a.selection.count?!0:!1};ua.prototype.copyToClipboard=function(a){var b=this.h;if(null!==b){var c=null;if(null===a)Ff=null,Gf="";else{var c=b.aa,d=!1,e=!1,g=null;try{if(c instanceof Ve){var h=c,d=h.gn;h.gn=this.vE}c instanceof X&&(h=c,e=h.fn,h.fn=this.uE);g=b.mp(a,null,!0)}finally{c instanceof Ve&&(c.gn=d),c instanceof X&&(c.fn=e),c=new J(D),c.$c(g),Ff=c,Gf=b.aa.Fl}}b.Ja("ClipboardChanged",c)}};
ua.prototype.pasteFromClipboard=function(){var a=new K(D),b=Ff;if(null===b)return a;var c=this.h;if(null===c||Gf!==c.aa.Fl)return a;var d=c.aa,e=!1,g=!1,h=null;try{if(d instanceof Ve){var k=d,e=k.gn;k.gn=this.vE}d instanceof X&&(k=d,g=k.fn,k.fn=this.uE);h=c.mp(b,c,!1)}finally{for(d instanceof Ve&&(d.gn=e),d instanceof X&&(d.fn=g),b=h.i;b.next();)c=b.value,d=b.key,c.location.G()||(d.location.G()?c.location=d.location:!c.position.G()&&d.position.G()&&(c.position=d.position)),a.add(c)}return a};
ua.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.gc="wait";b.Wb("Paste");b.Ja("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&Lf(b);for(var d=c.i;d.next();)d.value.lb=!0;b.Ja("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e){var g=b.vb.ke;null===g&&(g=new Mf,g.Sc(b));var h=g.computeEffectiveCollection(b.selection);g.moveParts(h,new N(a.x-e.sa,a.y-e.Aa),!1)}}b.Ja("ClipboardPasted",c)}finally{b.Md("Paste"),b.gc=
""}};ua.prototype.canPasteSelection=function(){var a=this.h;return null===a||a.kb||a.Ff||!a.ep||!a.Vz||null===Ff||Gf!==a.aa.Fl?!1:!0};ua.prototype.undo=function(){var a=this.h;null!==a&&a.qa.undo()};ua.prototype.canUndo=function(){var a=this.h;return null===a||a.kb||a.Ff?!1:a.dE&&a.qa.canUndo()};ua.prototype.redo=function(){var a=this.h;null!==a&&a.qa.redo()};ua.prototype.canRedo=function(){var a=this.h;return null===a||a.kb||a.Ff?!1:a.dE&&a.qa.canRedo()};
ua.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.jy);x.p(a,ua,"decreaseZoom:factor");var b=this.h;null!==b&&b.Al===Nf&&(a*=b.scale,a<b.vh||a>b.uh||(b.scale=a))};ua.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.jy);x.p(a,ua,"canDecreaseZoom:factor");var b=this.h;if(null===b||b.Al!==Nf)return!1;a*=b.scale;return a<b.vh||a>b.uh?!1:b.Rw};
ua.prototype.increaseZoom=function(a){void 0===a&&(a=this.jy);x.p(a,ua,"increaseZoom:factor");var b=this.h;null!==b&&b.Al===Nf&&(a*=b.scale,a<b.vh||a>b.uh||(b.scale=a))};ua.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.jy);x.p(a,ua,"canIncreaseZoom:factor");var b=this.h;if(null===b||b.Al!==Nf)return!1;a*=b.scale;return a<b.vh||a>b.uh?!1:b.Rw};ua.prototype.resetZoom=function(a){void 0===a&&(a=this.$w);x.p(a,ua,"resetZoom:newscale");var b=this.h;null===b||a<b.vh||a>b.uh||(b.scale=a)};
ua.prototype.canResetZoom=function(a){void 0===a&&(a=this.$w);x.p(a,ua,"canResetZoom:newscale");var b=this.h;return null===b||a<b.vh||a>b.uh?!1:b.Rw};ua.prototype.zoomToFit=function(){var a=this.h;if(null!==a){var b=a.scale,c=a.position;b===this.Sz&&!isNaN(this.qz)&&a.Ec.O(this.Rz)?(a.scale=this.qz,a.position=this.SC,this.Sz=NaN,this.Rz=Q.sy):(this.qz=b,this.SC=c.copy(),a.zoomToFit(),this.Sz=a.scale,this.Rz=a.Ec.copy())}};ua.prototype.canZoomToFit=function(){var a=this.h;return null===a?!1:a.Rw};
ua.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&x.l(a,D,ua,"part");var b=this.h;if(null!==b){if(null===a){try{null!==this.$j&&(this.$j.next()?a=this.$j.value:this.$j=null)}catch(c){}null===a&&(0<b.rn.count?this.$j=b.rn.i:0<b.selection.count&&(this.$j=b.selection.i),null!==this.$j&&this.$j.next()&&(a=this.$j.value))}if(null!==a){var d=b.$a;d.An("Scroll To Part");var e=b.position.copy();b.CH(a.ba);e.wd(b.position)&&d.uj()}}};
ua.prototype.canScrollToPart=function(a){void 0===a&&(a=null);null!==a&&x.l(a,D,ua,"part");a=this.h;return null===a||0===a.selection.count&&0===a.rn.count?!1:a.Qe&&a.Re};
ua.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.Wb("Collapse Tree");b.$a.An("Collapse Tree");var c=new J(E);if(null!==a&&a.xd)a.collapseTree(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof E&&(a=e,a.xd&&(a.collapseTree(),c.add(a)))}b.Ja("TreeCollapsed",c)}finally{b.Md("Collapse Tree")}};
ua.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.kb)return!1;if(null!==a){if(!a.xd)return!1;if(0<a.lx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof E&&b.xd&&0<b.lx().count)return!0;return!1};
ua.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.Wb("Expand Tree");b.$a.An("Expand Tree");var c=new J(E);if(null===a||a.xd)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof E&&(a=e,a.xd||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Ja("TreeExpanded",c)}finally{b.Md("Expand Tree")}};
ua.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.kb)return!1;if(null!==a){if(a.xd)return!1;if(0<a.lx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof E&&!b.xd&&0<b.lx().count)return!0;return!1};
ua.prototype.groupSelection=function(){var a=this.h;if(null!==a){var b=a.aa;if(b instanceof X){var c=this.eE;if(null!==c){var d=null;try{a.gc="wait";a.Wb("Group");a.Ja("ChangingSelection");for(var e=new J(D),g=a.selection.i;g.next();){var h=g.value;h.$d()&&h.canGroup()&&e.add(h)}for(var k=new J(D),l=e.i;l.next();){for(var m=l.value,g=!1,n=e.i;n.next();)if(m.pi(n.value)){g=!0;break}g||k.add(m)}if(0<k.count){var p=k.first().Xa;if(null!==p)for(;null!==p;){for(var e=!1,q=k.i;q.next();)if(!q.value.pi(p)){e=
!0;break}if(e)p=p.Xa;else break}if(c instanceof F)Kf(c),d=c.copy(),null!==d&&a.add(d);else if(b.yA(c)){var r=b.copyNodeData(c);x.Ya(r)&&(b.vl(r),d=a.kx(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Xa=p);for(var s=k.i;s.next();){var t=s.value;this.isValidMember(d,t)&&(t.Xa=d)}a.select(d)}}a.Ja("ChangedSelection");a.Ja("SelectionGrouped",d)}finally{a.Md("Group"),a.gc=""}}}}};
ua.prototype.canGroupSelection=function(){var a=this.h;if(null===a||a.kb||a.Ff||!a.ep||!a.Mw||!(a.aa instanceof X)||null===this.eE)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.$d()&&b.canGroup())return!0}return!1};function Of(a){var b=x.ub();for(a=a.i;a.next();){var c=a.value;c instanceof G||b.push(c)}a=new K(D);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],g=!0,h=0;h<c;h++)if(e.pi(b[h])){g=!1;break}g&&a.add(e)}x.xa(b);return a}
ua.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof G)return!1;if(null!==a){if(a===b||a.pi(b))return!1;var c=a.HA;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.HA;return null!==c?c(a,b):!0};
ua.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b){var c=b.aa;if(c instanceof X)try{b.gc="wait";b.Wb("Ungroup");b.Ja("ChangingSelection");var d=new J(F);if(null!==a)d.add(a);else for(var e=b.selection.i;e.next();){var g=e.value;g instanceof F&&(a=g,a.canUngroup()&&d.add(a))}if(0<d.count){b.Ww();for(var h=d.i;h.next();){var k=h.value;k.expandSubGraph();var l=k.Xa,m=null!==l&&null!==l.data?c.sb(l.data):void 0,n=new J(D);n.$c(k.Gc);for(var p=n.i;p.next();){var q=
p.value;q.lb=!0;if(!(q instanceof G)){var r=q.data;null!==r?c.Yx(r,m):q.Xa=l}}b.remove(k)}}b.Ja("ChangedSelection");b.Ja("SelectionUngrouped",d,n)}finally{b.Md("Ungroup"),b.gc=""}}};ua.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.kb||b.Ff||!b.Zm||!b.Qw||!(b.aa instanceof X))return!1;if(null!==a){if(a.canUngroup())return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&b.canUngroup())return!0;return!1};
ua.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=Of(a).i;d.next();){var e=d.value;null!==e.Xa&&(!b||this.isValidMember(null,e)?e.Xa=null:c=!1)}return c};
ua.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.Wb("Collapse SubGraph");b.$a.An("Collapse SubGraph");var c=new J(F);if(null!==a&&a.re)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof F&&(a=e,a.re&&(a.collapseSubGraph(),c.add(a)))}b.Ja("SubGraphCollapsed",c)}finally{b.Md("Collapse SubGraph")}};
ua.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.kb)return!1;if(null!==a)return a.re?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&b.re)return!0;return!1};
ua.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return!1;try{b.Wb("Expand SubGraph");b.$a.An("Expand SubGraph");var c=new J(F);if(null===a||a.re)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof F&&(a=e,a.re||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Ja("SubGraphExpanded",c)}finally{b.Md("Expand SubGraph")}};
ua.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.kb)return!1;if(null!==a)return a.re?!1:!0;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&!b.re)return!0;return!1};
ua.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&x.l(a,sa,ua,"editTextBlock");var b=this.h;if(null!==b){var c=b.vb.nB;if(null!==c){if(null===a){a=null;for(var d=b.selection.i;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.vt(function(a){return a instanceof sa&&a.kA})}null!==a&&(b.eb=null,c.He=a,b.eb=c)}}};
ua.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);null!==a&&x.l(a,sa,ua,"canEditTextBlock");var b=this.h;if(null===b||b.kb||b.Ff||!b.Pw||null===b.vb.nB)return!1;if(null!==a){if(a=a.ea,null!==a&&a.canEdit())return!0}else for(b=b.selection.i;b.next();)if(a=b.value,a.canEdit()&&(a=a.vt(function(a){return a instanceof sa&&a.kA}),null!==a))return!0;return!1};
ua.prototype.showContextMenu=function(a){var b=this.h;if(null!==b){var c=b.vb.bA;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new he,e=null;a instanceof O?e=a.gb(dc):b.UI||(e=b.Ab,e=new N(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.te=b.rB(e),d.ha=e,b.S=d);b.eb=c;Pf(c,!1,a)}}};
ua.prototype.canShowContextMenu=function(a){var b=this.h;if(null===b)return!1;var c=b.vb.bA;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};x.defineProperty(ua,{PH:"copiesClipboardData"},function(){return this.WB},function(a){x.g(a,"boolean",ua,"copiesClipboardData");this.WB=a});
x.defineProperty(ua,{QH:"copiesConnectedLinks"},function(){return this.XB},function(a){x.g(a,"boolean",ua,"copiesConnectedLinks");this.XB=a});x.defineProperty(ua,{FE:"deletesConnectedLinks"},function(){return this.mC},function(a){x.g(a,"boolean",ua,"deletesConnectedLinks");this.mC=a});x.defineProperty(ua,{SH:"copiesTree"},function(){return this.aC},function(a){x.g(a,"boolean",ua,"copiesTree");this.aC=a});
x.defineProperty(ua,{YH:"deletesTree"},function(){return this.nC},function(a){x.g(a,"boolean",ua,"deletesTree");this.nC=a});x.defineProperty(ua,{vE:"copiesParentKey"},function(){return this.$B},function(a){x.g(a,"boolean",ua,"copiesParentKey");this.$B=a});x.defineProperty(ua,{uE:"copiesGroupKey"},function(){return this.ZB},function(a){x.g(a,"boolean",ua,"copiesGroupKey");this.ZB=a});
x.defineProperty(ua,{eE:"archetypeGroupData"},function(){return this.Cy},function(a){null!==a&&x.l(a,Object,ua,"archetypeGroupData");var b=this.h;null!==b&&(b=b.aa,b instanceof X&&(a instanceof F||b.yA(a)||x.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.Cy=a});x.defineProperty(ua,{HA:"memberValidation"},function(){return this.kl},function(a){null!==a&&x.g(a,"function",ua,"memberValidation");this.kl=a});
x.defineProperty(ua,{$w:"defaultScale"},function(){return this.kC},function(a){x.p(a,ua,"defaultScale");0<a||x.k("defaultScale must be larger than zero, not: "+a);this.kC=a});x.defineProperty(ua,{jy:"zoomFactor"},function(){return this.WD},function(a){x.p(a,ua,"zoomFactor");1<a||x.k("zoomFactor must be larger than 1.0, not: "+a);this.WD=a});function cf(){0<arguments.length&&x.pd(cf);x.lc(this);this.W=null;this.Vb="";this.af=!0;this.EC=!1;this.SD=null;this.Iw=-1}x.ja("Tool",cf);
cf.prototype.Sc=function(a){u&&null!==a&&x.l(a,z,cf,"setDiagram");this.W=a};cf.prototype.toString=function(){return""!==this.name?this.name+" Tool":x.kf(Object.getPrototypeOf(this))};cf.prototype.updateAdornments=function(){};cf.prototype.canStart=function(){return this.isEnabled};cf.prototype.doStart=function(){};cf.prototype.doActivate=function(){this.va=!0};cf.prototype.doDeactivate=function(){this.va=!1};cf.prototype.doStop=function(){};cf.prototype.doCancel=function(){this.stopTool()};
cf.prototype.stopTool=function(){var a=this.h;null!==a&&a.eb===this&&(a.eb=null,a.gc="")};cf.prototype.doMouseDown=function(){!this.va&&this.canStart()&&this.doActivate()};cf.prototype.doMouseMove=function(){};cf.prototype.doMouseUp=function(){this.stopTool()};cf.prototype.doMouseWheel=function(){};cf.prototype.canStartMultiTouch=function(){return!0};
cf.prototype.standardPinchZoomStart=function(){var a=this.h;if(null!==a){var b=a.S.event,c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Wf[0])c=a.Wf[0],d=a.Wf[1];else return;this.doCancel();if(a.zp("hasGestureZoom")){a.dz=!0;a.dD=a.scale;var e=Qf(a),g=c,h=g.clientX-e.x,c=g.clientY-e.y,g=d,d=g.clientX-e.x,g=g.clientY-e.y;x.A(e);e=d-h;c=g-c;e=Math.sqrt(e*e+c*c);a.zD=e;b.preventDefault();b.cancelBubble=!0}}};
cf.prototype.standardPinchZoomMove=function(){var a=this.h;if(null!==a){var b=a.S.event;this.doCancel();var c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Wf[0])c=a.Wf[0],d=a.Wf[1];else return;if(a.zp("hasGestureZoom")&&a.dz){var e=Qf(a),g=c,c=g.clientX-e.x,h=g.clientY-e.y,g=d,d=g.clientX-e.x,g=g.clientY-e.y;x.A(e);var e=d-c,k=g-h,e=Math.sqrt(e*e+k*k)/a.zD,c=new N((Math.min(d,c)+Math.max(d,c))/2,(Math.min(g,
h)+Math.max(g,h))/2),h=a.dD*e,d=a.zb;h!==a.scale&&d.canResetZoom(h)&&(e=a.gm,a.gm=c,d.resetZoom(h),a.gm=e);b.preventDefault();b.cancelBubble=!0}}};cf.prototype.doKeyDown=function(){var a=this.h;null!==a&&"Esc"===a.S.key&&this.doCancel()};cf.prototype.doKeyUp=function(){};cf.prototype.startTransaction=cf.prototype.Wb=function(a){void 0===a&&(a=this.name);this.Of=null;var b=this.h;return null===b?!1:b.Wb(a)};
cf.prototype.stopTransaction=cf.prototype.Ck=function(){var a=this.h;return null===a?!1:null===this.Of?a.$p():a.Md(this.Of)};
cf.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.yf){var b=a.S,c=a.yt(b.ha,!1);if(null!==c)if(x.wk?b.Zt:b.control){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Xa;null!==b&&(b.lb=!b.lb);a.Ja("ChangedSelection")}else if(b.shift){if(!c.lb){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Xa;null!==b&&(b.lb=!0);a.Ja("ChangedSelection")}}else{if(!c.lb){for(b=c;null!==b&&!b.canSelect();)b=b.Xa;null!==b&&a.select(b)}}else!b.left||(x.wk?b.Zt:b.control)||
b.shift||a.Ww()}};cf.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Nc});var c=this.h;if(null!==c){var d=c.S,e=c.ne(d.ha,a,b);d.Ee=e;Rf(e,d,c)}};
function Rf(a,b,c){var d=0;b.left?d=1===b.ff?1:2===b.ff?2:1:b.right&&1===b.ff&&(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(b.Mc=!1;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.tt?a.tt:a.click;break;case 3:c=
a.aA}if(null!==c&&(c(b,a),b.Mc))break;a=a.V}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.tt?c.tt:c.click;break;case 3:a=c.aA}null!==a&&a(b)}}
cf.prototype.standardMouseOver=function(){var a=this.h;if(null!==a){var b=a.S;if(null!==b.h&&!0!==a.$a.Bc){var c=a.xb;a.xb=!0;var d=a.ne(b.ha,null,null);b.Ee=d;var e=!1;if(d!==a.Xn){var g=a.Xn,h=g;a.Xn=d;this.doCurrentObjectChanged(g,d);for(b.Mc=!1;null!==g;){var k=g.au;if(null!==k){if(d===g)break;if(null!==d&&d.Ul(g))break;k(b,g,d);e=!0;if(b.Mc)break}g=g.V}g=h;for(b.Mc=!1;null!==d;){k=d.$t;if(null!==k){if(g===d)break;if(null!==g&&g.Ul(d))break;k(b,d,g);e=!0;if(b.Mc)break}d=d.V}d=a.Xn}if(null!==d){g=
d;for(k="";null!==g;){k=g.cursor;if(""!==k)break;g=g.V}a.gc=k;b.Mc=!1;for(g=d;null!==g;){k=g.LA;if(null!==k&&(k(b,g),e=!0,b.Mc))break;g=g.V}}else a.gc="",k=a.LA,null!==k&&(k(b),e=!0);e&&a.Be();a.xb=c}}};cf.prototype.doCurrentObjectChanged=function(){};
cf.prototype.standardMouseWheel=function(){var a=this.h;if(null!==a){var b=a.S,c=b.Hl;if(0!==c&&a.Ec.G()){var d=a.zb,e=a.vb.bu;if((e===cg&&!b.shift||e===dg&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.gm,a.gm=b.te,0<c?d.increaseZoom():d.decreaseZoom(),a.gm=e,b.bubbles=!1;else if(e===cg&&b.shift||e===dg&&!b.control){d=a.position.copy();e=0<c?c:-c;if(!b.shift&&a.Re){var g=a.pu,e=e/40*g;0<c?a.scroll("pixel","up",e):a.scroll("pixel","down",e)}else b.shift&&a.Qe&&(g=a.ou,e=e/40*g,0<c?
a.scroll("pixel","left",e):a.scroll("pixel","right",e));a.position.O(d)||(b.bubbles=!1)}}}};cf.prototype.standardWaitAfter=function(a,b){x.g(a,"number",cf,"standardWaitAfter:delay");this.cancelWaitAfter();var c=this,d=b.copy();this.Iw=x.setTimeout(function(){c.doWaitAfter(d)},a)};cf.prototype.cancelWaitAfter=function(){-1!==this.Iw&&x.clearTimeout(this.Iw);this.Iw=-1};cf.prototype.doWaitAfter=function(){};
cf.prototype.findToolHandleAt=function(a,b){var c=this.h;if(null===c)return null;c=c.ne(a,function(a){for(;null!==a&&!(a.V instanceof fa);)a=a.V;return a});return null===c?null:c.V.Lc===b?c:null};cf.prototype.isBeyondDragSize=function(a,b){var c=this.h;if(null===c)return!1;void 0===a&&(a=c.Fc.te);void 0===b&&(b=c.S.te);var d=c.vb.cI,e=d.width,d=d.height;c.Fc.nj&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};x.w(cf,{h:"diagram"},function(){return this.W});
x.defineProperty(cf,{name:"name"},function(){return this.Vb},function(a){x.g(a,"string",cf,"name");this.Vb=a});x.defineProperty(cf,{isEnabled:"isEnabled"},function(){return this.af},function(a){x.g(a,"boolean",cf,"isEnabled");this.af=a});x.defineProperty(cf,{va:"isActive"},function(){return this.EC},function(a){x.g(a,"boolean",cf,"isActive");this.EC=a});x.defineProperty(cf,{Of:"transactionResult"},function(){return this.SD},function(a){null!==a&&x.g(a,"string",cf,"transactionResult");this.SD=a});
function Mf(){0<arguments.length&&x.pd(Mf);cf.call(this);this.name="Dragging";this.YB=this.IC=!0;this.lr=this.tC=!1;this.MC=!0;this.ez=(new Fa(NaN,NaN)).freeze();this.fz=Xb;this.gz=(new N(NaN,NaN)).freeze();this.sC=!1;this.qC=this.VB=this.rC=this.eC=this.Ti=null;this.Wq=this.KC=!1;this.Xo=new N(NaN,NaN);this.vw=new N;this.yw=!1;this.tw=this.HC=!0;this.io=100;this.Cj=[];this.TG=(new K(D)).freeze()}x.Qa(Mf,cf);x.ja("DraggingTool",Mf);
x.defineProperty(Mf,{jF:"isCopyEnabled"},function(){return this.IC},function(a){x.g(a,"boolean",Mf,"isCopyEnabled");this.IC=a});x.defineProperty(Mf,{RH:"copiesEffectiveCollection"},function(){return this.YB},function(a){x.g(a,"boolean",Mf,"copiesEffectiveCollection");this.YB=a});x.defineProperty(Mf,{dI:"dragsTree"},function(){return this.tC},function(a){x.g(a,"boolean",Mf,"dragsTree");this.tC=a});
x.defineProperty(Mf,{ux:"isGridSnapEnabled"},function(){return this.lr},function(a){x.g(a,"boolean",Mf,"isGridSnapEnabled");this.lr=a});x.defineProperty(Mf,{NI:"isComplexRoutingRealtime"},function(){return this.HC},function(a){x.g(a,"boolean",Mf,"isComplexRoutingRealtime");this.HC=a});x.defineProperty(Mf,{QI:"isGridSnapRealtime"},function(){return this.MC},function(a){x.g(a,"boolean",Mf,"isGridSnapRealtime");this.MC=a});
x.defineProperty(Mf,{ZE:"gridSnapCellSize"},function(){return this.ez},function(a){x.l(a,Fa,Mf,"gridSnapCellSize");this.ez.O(a)||(this.ez=a=a.Y())});x.defineProperty(Mf,{zI:"gridSnapCellSpot"},function(){return this.fz},function(a){x.l(a,R,Mf,"gridSnapCellSpot");this.fz.O(a)||(this.fz=a=a.Y())});x.defineProperty(Mf,{AI:"gridSnapOrigin"},function(){return this.gz},function(a){x.l(a,N,Mf,"gridSnapOrigin");this.gz.O(a)||(this.gz=a=a.Y())});
x.defineProperty(Mf,{ij:"dragsLink"},function(){return this.sC},function(a){x.g(a,"boolean",Mf,"dragsLink");this.sC=a});x.defineProperty(Mf,{kn:"currentPart"},function(){return this.eC},function(a){null!==a&&x.l(a,D,Mf,"currentPart");this.eC=a});x.defineProperty(Mf,{pc:"copiedParts"},function(){return this.VB},function(a){this.VB=a});x.defineProperty(Mf,{ic:"draggedParts"},function(){return this.rC},function(a){this.rC=a});
x.w(Mf,{gL:"draggingParts"},function(){return null!==this.pc?this.pc.vj():null!==this.ic?this.ic.vj():this.TG});x.defineProperty(Mf,{ld:"draggedLink"},function(){return this.qC},function(a){null!==a&&x.l(a,G,Mf,"draggedLink");this.qC=a});x.defineProperty(Mf,{tx:"isDragOutStarted"},function(){return this.KC},function(a){this.KC=a});x.defineProperty(Mf,{Bk:"startPoint"},function(){return this.vw},function(a){x.l(a,N,Mf,"startPoint");this.vw.O(a)||(this.vw=a=a.Y())});
x.defineProperty(Mf,{AE:"delay"},function(){return this.io},function(a){x.g(a,"number",Mf,"delay");this.io=a});Mf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.kb&&!a.ft||!a.yl&&!a.nk&&!a.ft||!a.yf)return!1;var b=a.S;return!b.left||a.eb!==this&&(!this.isBeyondDragSize()||b.nj&&b.timestamp-a.Fc.timestamp<this.io)?!1:null!==this.findDraggablePart()};
Mf.prototype.findDraggablePart=function(){var a=this.h;if(null===a)return null;a=a.yt(a.Fc.ha,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Xa;return null!==a&&(a.canMove()||a.canCopy())?a:null};Mf.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.yf){var b=a.yt(a.Fc.ha,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Xa;this.kn=b;this.kn.lb||(a.Ja("ChangingSelection"),b=a.S,(x.wk?b.Zt:b.control)||b.shift||Lf(a),this.kn.lb=!0,a.Ja("ChangedSelection"))}}};
Mf.prototype.doActivate=function(){var a=this.h;if(null!==a){null===this.kn&&this.standardMouseSelect();var b=this.kn;null!==b&&(b.canMove()||b.canCopy())&&(this.va=!0,this.Xo.set(a.position),eg(this,a.selection),this.Cj.length=0,this.ic=this.computeEffectiveCollection(a.selection),a.wu=!0,fg(this,this.ic),this.Wb("Drag"),this.Bk=a.Fc.ha,a.Xe=!0,a.ft&&(this.tx=!0,this.Wq=!1,gg=this,hg=this.h,this.doSimulatedDragOut()))}};
function eg(a,b){if(a.ij){var c=a.h;null!==c&&c.$m&&(c.aa instanceof X&&1===b.count&&b.first()instanceof G?(a.ld=b.first(),a.ld.canRelinkFrom()&&a.ld.canRelinkTo()&&a.ld.mt(),a.Ti=c.vb.HF,null===a.Ti&&(a.Ti=new ig,a.Ti.Sc(c))):(a.ld=null,a.Ti=null))}}
Mf.prototype.computeEffectiveCollection=function(a){var b=null!==this.h&&this.h.eb===this,c=new ra(D);if(null===a)return c;for(var d=a.i;d.next();)jg(this,c,d.value,b);if(null!==this.ld&&this.ij)return c;for(d=a.i;d.next();)a=d.value,a instanceof G&&(b=a.Z,null===b||c.contains(b)?(b=a.fa,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function kg(a){return void 0===a?new lg(Q.Ek):new lg(a.copy())}
function jg(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof E){b.add(c,kg(c.location));if(c instanceof F)for(var e=c.Gc;e.next();)jg(a,b,e.value,d);for(e=c.ce;e.next();){var g=e.value;if(!b.contains(g)){var h=g.Z,k=g.fa;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&jg(a,b,g,d)}}if(a.dI)for(c=c.RE();c.next();)jg(a,b,c.value,d)}else if(c instanceof G)for(g=c,b.add(g,kg()),e=g.If;e.next();)jg(a,b,e.value,d);else c instanceof fa||b.add(c,kg(c.location))}
Mf.prototype.doDeactivate=function(){this.va=!1;var a=this.h;null!==a&&mg(a);ng(this);og(this,this.ic);this.ic=this.kn=null;this.Wq=this.tx=!1;if(0<pg.count){for(var b=pg.length,c=0;c<b;c++){var d=pg.ia(c);qg(d);rg(d);ng(d);null!==d.h&&mg(d.h)}pg.clear()}qg(this);this.Xo.n(NaN,NaN);gg=hg=null;rg(this);a.Xe=!1;a.gc="";a.wu=!1;this.Ck()};function ng(a){var b=a.h;if(null!==b){var c=b.xb;b.xb=!0;sg(a,b.S,null);b.xb=c}a.Cj.length=0}
function tg(){var a=gg;rg(a);ug(a);var b=a.h;null!==b&&a.Xo.G()&&(b.position=a.Xo);null!==b&&mg(b)}Mf.prototype.doCancel=function(){rg(this);ug(this);var a=this.h;null!==a&&this.Xo.G()&&(a.position=this.Xo);this.stopTool()};function fg(a,b){if(null!==b){a.yw=!0;for(var c=b.i;c.next();){var d=c.key;d instanceof G&&(d.jq=!0)}}}function og(a,b){if(null!==b){for(var c=b.i;c.next();){var d=c.key;d instanceof G&&(d.jq=!1,d.lj&&vg(d)&&d.rc())}a.yw=!1}}
Mf.prototype.doKeyDown=function(){var a=this.h;null!==a&&(a=a.S,null!==a&&this.va&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};Mf.prototype.doKeyUp=function(){var a=this.h;null!==a&&null!==a.S&&this.va&&this.doMouseMove()};function wg(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=a.i;h.next();){var k=h.value;if(k.$d()&&k.isVisible()){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.n(0,0,0,0):b.n(c,d,e-c,g-d)}
function Ig(a,b){if(null===a.pc){var c=a.h;if(!(null===c||b&&(c.kb||c.Ff))&&null!==a.ic){var d=c.qa;d.isEnabled&&d.mF?null!==d.gj&&0<d.gj.$f.count&&(c.qa.$p(),c.Wb("Drag")):ug(a);c.xb=!b;c.On=!b;a.Bk=c.Fc.ha;d=a.RH?a.ic.vj():c.selection;d=c.mp(d,c,!0);for(c=d.i;c.next();)c.value.location=c.key.location;c=x.kg();wg(d,c);x.qc(c);for(var c=new ra(D),e=a.ic.i;e.next();){var g=e.key;g.$d()&&g.canCopy()&&(g=d.oa(g),null!==g&&(g.Af(),c.add(g,kg(g.location))))}for(d=d.i;d.next();)e=d.value,e instanceof G&&
e.canCopy()&&c.add(e,kg());a.pc=c;eg(a,c.vj());null!==a.ld&&(c=a.ld,d=c.Cn,c.Xl(a.Bk.x-(d.x+d.width/2),a.Bk.y-(d.y+d.height/2)))}}}function rg(a){var b=a.h;if(null!==b){if(null!==a.pc&&(b.bB(a.pc.vj(),!1),a.pc=null,null!==a.ic))for(var c=a.ic.i;c.next();)c.key instanceof G&&(c.value.point=new N(0,0));b.xb=!1;b.On=!1;a.Bk=b.Fc.ha}}function qg(a){if(null!==a.ld){if(a.ij&&null!==a.Ti){var b=a.Ti;b.h.remove(b.Fe);b.h.remove(b.Ge)}a.ld=null;a.Ti=null}}
function Jg(a,b,c){var d=a.h;if(null!==d){var e=a.Bk,g=x.P();g.assign(d.S.ha);a.moveParts(b,g.yu(e),c);x.A(g)}}
Mf.prototype.moveParts=function(a,b,c){if(null!==a&&(x.l(a,ra,Mf,"moveParts:parts"),0!==a.count)){var d=x.P(),e=x.P();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);(b=this.yw)||fg(this,a);for(var g=new J(Kg),h=new J(Za),k=a.i;k.next();){var l=k.key;if(l.$d()){var m=Lg(this,l,a);if(null!==m)g.add(new Kg(l,k.value,m));else if(!c||l.canMove()){m=k.value.point;d.assign(m);var n=x.P(),p=this.computeMove(l,d.add(e),a,n);l.location=p;k.value.hG=n.yu(m);x.A(n)}}else k.key instanceof G&&h.add(k.ob)}for(c=
g.i;c.next();)g=c.value,m=g.info.point,d.assign(m),g.Pc.location=d.add(g.BI.hG);c=x.P();m=x.P();for(h=h.i;h.next();)if(k=h.value,g=k.key,g instanceof G)if(g.jq)l=g.Z,n=g.fa,null!==this.ld&&this.ij?(k=k.value.point,a.add(g,kg(e)),l=e.x-k.x,k=e.y-k.y,g.Xl(l,k)):(null!==l&&(c.assign(l.location),p=a.oa(l),null!==p&&c.yu(p.point)),null!==n&&(m.assign(n.location),p=a.oa(n),null!==p&&m.yu(p.point)),null!==l&&null!==n?c.wd(m)?(k=k.value.point,l=d,l.assign(c),l.yu(k),a.add(g,kg(c)),g.Xl(l.x,l.y)):(g.jq=!1,
g.rc()):(k=k.value.point,n=null!==l?c:null!==n?m:e,a.add(g,kg(n)),l=n.x-k.x,k=n.y-k.y,g.Xl(l,k)));else if(null===g.Z||null===g.fa)k=k.value.point,a.add(g,kg(e)),l=e.x-k.x,k=e.y-k.y,g.Xl(l,k);x.A(d);x.A(e);x.A(c);x.A(m);b||og(this,a)}};function Lg(a,b,c){b=b.Xa;if(null!==b){a=Lg(a,b,c);if(null!==a)return a;a=c.oa(b);if(null!==a)return a}return null}
function ug(a){if(null!==a.ic){for(var b=a.h,c=a.ic.i;c.next();){var d=c.key;d.$d()&&(d.location=c.value.point)}for(c=a.ic.i;c.next();)if(d=c.key,d instanceof G&&d.jq){var e=c.value.point;a.ic.add(d,kg());d.Xl(-e.x,-e.y)}b.dg()}}
Mf.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new N);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.ux&&(this.QI||null===c||this.h.S.up)&&(e=x.P(),c=e,c.assign(b),null!==a)){var g=this.h;if(null!==g){var h=g.Ft,k=this.ZE,g=k.width,k=k.height,l=this.AI,m=l.x,l=l.y,n=this.zI;if(null!==h){var p=h.nx;isNaN(g)&&(g=p.width);isNaN(k)&&(k=p.height);h=h.YE;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=x.Xb(0,0);h.uu(0,0,g,k,n);Q.xt(b.x,b.y,m+h.x,l+h.y,g,k,c);x.A(h)}}c=null!==a.GE?
a.GE(a,b,e):e;k=a.rJ;g=k.x;isNaN(g)&&(g=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.mJ;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.n(Math.max(g,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&x.A(e);return d};function Mg(a,b){if(null===b)return!0;var c=b.ea;return null===c||c instanceof fa||c.layer.Nc||a.ic&&a.ic.contains(c)||a.pc&&a.pc.contains(c)?!0:!1}
function Ng(a,b,c,d){var e=a.h;if(null!==e){a.ij&&(null!==a.ld&&(a.ld.Z=null,a.ld.fa=null),Og(a,!1));var g=!1;!1===a.tw&&(g=e.xb,e.xb=!0);var h=Pg(e,b,null,function(b){return!Mg(a,b)}),k=e.S;k.Ee=h;var l=e.xb;e.xb=!0;var m=sg(a,k,h);if(a.va||null!==gg){if(null===h){var n=e.vJ;null!==n&&(n(k),m=!0)}if(a.va||null!==gg)if(a.doDragOver(b,h),a.va||null!==gg)e.xb=l,m&&e.dg(),!1===a.tw&&(e.xb=g),(e.Qe||e.Re)&&(c||d)&&Qg(e,k.te)}}}
function sg(a,b,c){var d=!1,e=a.Cj.length,g=0<e?a.Cj[0]:null;if(c===g)return!1;b.Mc=!1;for(var h=0;h<e;h++){var k=a.Cj[h],l=k.uJ;if(null!==l&&(l(b,k,c),d=!0,b.Mc))break}a.Cj.length=0;if(!a.va&&null===gg||null===c)return d;for(b.Mc=!1;null!==c;)a.Cj.push(c),c=Rg(c);e=a.Cj.length;for(h=0;h<e&&(k=a.Cj[h],l=k.tJ,null===l||(l(b,k,g),d=!0,!b.Mc));h++);return d}function Rg(a){var b=a.V;return null!==b?b:a instanceof D&&!(a instanceof F)&&(a=a.Xa,null!==a&&a.DI)?a:null}
function Sg(a,b,c){var d=a.Ti;if(null===d)return null;var e=a.h.mn(b,d.FF,function(a){return d.findValidLinkablePort(a,c)});a=x.P();for(var g=Infinity,h=null,e=e.i;e.next();){var k=e.value;if(null!==k.ea){var l=k.gb(dc,a),l=b.qk(l);l<g&&(h=k,g=l)}}x.A(a);return h}
function Og(a,b){var c=a.ld;if(null!==c&&!(2>c.ta)){var d=a.h;if(null!==d&&!d.kb&&(d=a.Ti,null!==d)){var e=null,g=null;null===c.Z&&(e=Sg(a,c.m(0),!1),null!==e&&(g=e.ea));var h=null,k=null;null===c.fa&&(h=Sg(a,c.m(c.ta-1),!0),null!==h&&(k=h.ea));d.isValidLink(g,e,k,h)?b?(c.ao=c.m(0).copy(),c.fo=c.m(c.ta-1).copy(),c.jq=!1,c.Z=g,null!==e&&(c.bg=e.zd),c.fa=k,null!==h&&(c.Og=h.zd)):Tg(d,g,e,k,h):Tg(d,null,null,null,null)}}}Mf.prototype.doDragOver=function(){};
function Ug(a,b){var c=a.h;if(null!==c){a.ij&&Og(a,!0);ng(a);var d=Pg(c,b,null,function(b){return!Mg(a,b)}),e=c.S;e.Ee=d;if(null!==d){e.Mc=!1;for(var g=d;null!==g;){var h=g.IA;if(null!==h&&(h(e,g),e.Mc))break;g=Rg(g)}}else h=c.IA,null!==h&&h(e);if(a.va||null!==gg)if(a.doDropOnto(b,d),a.va||null!==gg)for(d=c.selection.i;d.next();)e=d.value,e instanceof E&&Vg(c,e.ba)}}Mf.prototype.doDropOnto=function(){};
Mf.prototype.doMouseMove=function(){if(this.va){var a=this.h;if(null!==a&&null!==this.kn&&null!==this.ic){var b=!1,c=!1;this.mayCopy()?(b=!0,a.gc="copy",Ig(this,!1),fg(this,this.pc),Jg(this,this.pc,!1),og(this,this.pc)):this.mayMove()?(c=!0,a.gc="default",rg(this),Jg(this,this.ic,!0)):this.mayDragOut()?(a.gc="no-drop",Ig(this,!1),Jg(this,this.pc,!1)):rg(this);Ng(this,a.S.ha,c,b)}}};
Mf.prototype.doMouseUp=function(){if(this.va){var a=this.h;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.pc?(rg(this),Ig(this,!0),fg(this,this.pc),Jg(this,this.pc,!1),og(this,this.pc),null!==this.pc&&a.bG(this.pc.vj())):(b=!0,rg(this),this.mayMove()&&(Jg(this,this.ic,!0),this.tw=!1,Ng(this,a.S.ha,!0,!1),this.tw=!0));this.Wq=!0;Ug(this,a.S.ha);if(this.va){this.pc=null;if(b&&null!==this.ic)for(b=this.ic.i;b.next();){var d=b.key;d instanceof E&&(d=d.Xa,null===d||null===d.placeholder||this.ic.contains(d)||
d.rE&&d.T())}a.xc();og(this,this.ic);this.Of=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};Mf.prototype.mayCopy=function(){if(!this.jF)return!1;var a=this.h;if(null===a||a.kb||a.Ff||!a.ep||!a.nk||(x.wk?!a.S.alt:!a.S.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.$d()&&b.canCopy())return!0}return null!==this.ld&&this.ij&&this.ld.canCopy()?!0:!1};
Mf.prototype.mayDragOut=function(){if(!this.jF)return!1;var a=this.h;if(null===a||!a.ft||!a.nk||a.yl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.$d()&&b.canCopy())return!0}return null!==this.ld&&this.ij&&this.ld.canCopy()?!0:!1};Mf.prototype.mayMove=function(){var a=this.h;if(null===a||a.kb||!a.yl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.$d()&&b.canMove())return!0}return null!==this.ld&&this.ij&&this.ld.canMove()?!0:!1};var pg=new J(Mf),gg=null,hg=null;
Mf.prototype.mayDragIn=function(){var a=this.h;if(null===a||!a.cE||a.kb||a.Ff||!a.ep)return!1;var b=gg;return null===b||b.h.aa.Fl!==a.aa.Fl?!1:!0};Mf.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.h;a.$a.uj();Wg(a);a=gg;null!==a&&(a.h.gc="copy")}};Mf.prototype.doSimulatedDragLeave=function(){var a=gg;null!==a&&a.doSimulatedDragOut();this.doCancel()};
Mf.prototype.doSimulatedDragOver=function(){var a=this.h;if(null!==a){var b=gg;null!==b&&null!==b.ic&&this.mayDragIn()&&(a.gc="copy",Xg(this,b.ic.vj(),!1),Jg(this,this.pc,!1),Ng(this,a.S.ha,!1,!0))}};
Mf.prototype.doSimulatedDrop=function(){var a=this.h;if(null!==a){var b=gg;if(null!==b){var c=b.h;b.Wq=!0;rg(this);this.mayDragIn()&&(this.Wb("Drop"),Xg(this,b.ic.vj(),!0),Jg(this,this.pc,!1),null!==this.pc&&a.bG(this.pc.vj()),Ug(this,a.S.ha),a.xc(),b=a.selection,null!==this.pc?this.Of="ExternalCopy":b=new K(D),this.pc=null,a.focus(),a.Ja("ExternalObjectsDropped",b,c),this.Ck())}}};
function Xg(a,b,c){if(null===a.pc){var d=a.h;if(null!==d&&!d.kb&&!d.Ff){d.xb=!c;d.On=!c;a.Bk=d.S.ha;d=d.mp(b,d,!0);c=x.kg();wg(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;x.qc(c);var h=a.vw;c=new ra(D);var k=x.P();for(b=b.i;b.next();){var l=b.value;if(l.$d()&&l.canCopy()){var m=l.location,l=d.oa(l);k.n(h.x-(e-m.x),h.y-(g-m.y));l.location=k;l.Af();c.add(l,kg(k))}}x.A(k);for(d=d.i;d.next();)e=d.value,e instanceof G&&e.canCopy()&&c.add(e,kg());a.pc=c;eg(a,c.vj());null!==a.ld&&(c=a.ld,d=c.Cn,c.Xl(a.Bk.x-
(d.x+d.width/2),a.Bk.y-(d.y+d.height/2)))}}}Mf.prototype.doSimulatedDragOut=function(){var a=this.h;null!==a&&(this.mayCopy()||this.mayMove()?a.gc="":a.gc="no-drop")};function lg(a){this.point=a;this.hG=Q.Ek}x.ja("DraggingInfo",lg);function Kg(a,b,c){this.Pc=a;this.info=b;this.BI=c}
function dh(){0<arguments.length&&x.pd(dh);cf.call(this);this.nD=100;this.QC=!1;var a=new G,b=new Y;b.Gf=!0;b.stroke="blue";a.add(b);b=new Y;b.kq="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.Jf="Tool";this.KD=a;a=new E;b=new Y;b.zd="";b.Jb="Rectangle";b.fill=null;b.stroke="magenta";b.yb=2;b.Ba=Q.oy;a.add(b);a.Ak=!1;a.Jf="Tool";this.HD=a;this.JD=b;a=new E;b=new Y;b.zd="";b.Jb="Rectangle";b.fill=null;b.stroke="magenta";b.yb=2;b.Ba=Q.oy;a.add(b);a.Ak=!1;a.Jf="Tool";this.LD=a;this.MD=b;this.kD=
this.jD=this.fD=this.eD=this.gD=null;this.LC=!0;this.iH=new ra(O,"boolean");this.oD=this.hl=this.DD=null}x.Qa(dh,cf);x.ja("LinkingBaseTool",dh);dh.prototype.doStop=function(){var a=this.h;null!==a&&mg(a);this.Ch=this.Bh=this.Ah=this.zh=this.yc=null;this.iy.clear();this.jg=null};x.defineProperty(dh,{FF:"portGravity"},function(){return this.nD},function(a){x.g(a,"number",dh,"portGravity");0<=a&&(this.nD=a)});
x.defineProperty(dh,{Hp:"isUnconnectedLinkValid"},function(){return this.QC},function(a){x.g(a,"boolean",dh,"isUnconnectedLinkValid");this.QC=a});x.defineProperty(dh,{Ng:"temporaryLink"},function(){return this.KD},function(a){x.l(a,G,dh,"temporaryLink");this.KD=a});x.defineProperty(dh,{Fe:"temporaryFromNode"},function(){return this.HD},function(a){x.l(a,E,dh,"temporaryFromNode");this.HD=a});
x.defineProperty(dh,{Fn:"temporaryFromPort"},function(){return this.JD},function(a){x.l(a,O,dh,"temporaryFromPort");this.JD=a});x.defineProperty(dh,{Ge:"temporaryToNode"},function(){return this.LD},function(a){x.l(a,E,dh,"temporaryToNode");this.LD=a});x.defineProperty(dh,{Gn:"temporaryToPort"},function(){return this.MD},function(a){x.l(a,O,dh,"temporaryToPort");this.MD=a});x.defineProperty(dh,{yc:"originalLink"},function(){return this.gD},function(a){null!==a&&x.l(a,G,dh,"originalLink");this.gD=a});
x.defineProperty(dh,{zh:"originalFromNode"},function(){return this.eD},function(a){null!==a&&x.l(a,E,dh,"originalFromNode");this.eD=a});x.defineProperty(dh,{Ah:"originalFromPort"},function(){return this.fD},function(a){null!==a&&x.l(a,O,dh,"originalFromPort");this.fD=a});x.defineProperty(dh,{Bh:"originalToNode"},function(){return this.jD},function(a){null!==a&&x.l(a,E,dh,"originalToNode");this.jD=a});
x.defineProperty(dh,{Ch:"originalToPort"},function(){return this.kD},function(a){null!==a&&x.l(a,O,dh,"originalToPort");this.kD=a});x.defineProperty(dh,{pe:"isForwards"},function(){return this.LC},function(a){x.g(a,"boolean",dh,"isForwards");this.LC=a});x.w(dh,{iy:"validPortsCache"},function(){return this.iH});x.defineProperty(dh,{jg:"targetPort"},function(){return this.DD},function(a){null!==a&&x.l(a,O,dh,"targetPort");this.DD=a});
dh.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Ba=b.ba.size;e?(d.Hb=b.Hb,d.em=b.em):(d.Gb=b.Gb,d.Ml=b.Ml);c.of=dc;var g=x.P();c.location=b.gb(dc,g);x.A(g);d.angle=b.Nl();null!==this.Mx&&this.Mx(a,b,c,d,e)}};dh.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Ba=Q.oy,b.Gb=Wb,b.Hb=Wb);null!==a&&(a.location=this.h.S.ha);null!==this.Mx&&this.Mx(null,null,a,b,c)};dh.prototype.doMouseDown=function(){this.va&&this.doMouseMove()};
dh.prototype.doMouseMove=function(){if(this.va){var a=this.h;if(null!==a){this.jg=this.findTargetPort(this.pe);if(null!==this.jg){var b=this.jg.ea;if(b instanceof E){this.pe?this.copyPortProperties(b,this.jg,this.Ge,this.Gn,!0):this.copyPortProperties(b,this.jg,this.Fe,this.Fn,!1);return}}this.pe?this.setNoTargetPortProperties(this.Ge,this.Gn,!0):this.setNoTargetPortProperties(this.Fe,this.Fn,!1);(a.Qe||a.Re)&&Qg(a,a.S.te)}}};
dh.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.ea;if(!(c instanceof E))return null;for(;null!==a;){var d=b?a.pG:a.TE;if(!0===d&&(null!==a.zd||a instanceof E)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.V}return null};
dh.prototype.findTargetPort=function(a){var b=this.h,c=b.S.ha,d=this.FF;0>=d&&(d=.1);for(var e=this,g=b.mn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.i;g.next();){var h=g.value,k=h.ea;if(k instanceof E){var l=h.gb(dc,x.P()),m=c.x-l.x,n=c.y-l.y;x.A(l);l=m*m+n*n;l<d&&(m=this.iy.oa(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.zh,this.Ah,k,h)||!a&&this.isValidLink(k,h,this.Bh,this.Ch)?(this.iy.add(h,!0),b=h,d=l):this.iy.add(h,!1))}}return null!==b&&(c=b.ea,
c instanceof E&&(null===c.layer||c.layer.gt))?b:null};dh.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Hp;if(this.h.eb===this&&(null!==a.layer&&!a.layer.gt||!0!==b.TE))return!1;var c=b.tI;if(Infinity>c){if(null!==this.yc&&a===this.zh&&b===this.Ah)return!0;var d=b.zd;null===d&&(d="");if(a.jx(d).count>=c)return!1}return!0};
dh.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Hp;if(this.h.eb===this&&(null!==a.layer&&!a.layer.gt||!0!==b.pG))return!1;var c=b.hK;if(Infinity>c){if(null!==this.yc&&a===this.Bh&&b===this.Ch)return!0;var d=b.zd;null===d&&(d="");if(a.Fg(d).count>=c)return!1}return!0};dh.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.ea,d=b.ea;return null!==c&&c===d};
dh.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.ea;if(!(c instanceof E))return!1;var d=a.zd;null===d&&(d="");var e=b.ea;if(!(e instanceof E))return!1;var g=b.zd;null===g&&(g="");for(e=e.Fg(g);e.next();)if(g=e.value,g.Z===c&&g.bg===d)return!0;return!1};
dh.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.sI&&d.gK||!this.isInSameNode(b,d))&&(b.rI&&d.fK||!this.isLinked(b,d)))||null!==this.yc&&(null!==a&&this.isLabelDependentOnLink(a,this.yc)||null!==c&&this.isLabelDependentOnLink(c,this.yc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.yc))return!1;if(null!==a){var e=a.Cx;if(null!==e&&!e(a,b,c,d,this.yc))return!1}if(null!==
c&&(e=c.Cx,null!==e&&!e(a,b,c,d,this.yc)))return!1;e=this.Cx;return null!==e?e(a,b,c,d,this.yc):!0};dh.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Od;if(null===c)return!1;if(c===b)return!0;var d=new K(E);d.add(a);return eh(this,c,b,d)};function eh(a,b,c,d){if(b===c)return!0;var e=b.Z;if(null!==e&&e.Ef&&(d.add(e),eh(a,e.Od,c,d)))return!0;b=b.fa;return null!==b&&b.Ef&&(d.add(b),eh(a,b.Od,c,d))?!0:!1}
dh.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Hp;var d=this.h.nK;if(d!==fh){if(d===gh){if(null!==c&&!c.Oc)return!0;for(d=b.ce;d.next();){var e=d.value;if(e!==c&&e.Oc&&e.fa===b)return!1}return!hh(this,a,b,c,!0)}if(d===ih){if(null!==c&&!c.Oc)return!0;for(d=a.ce;d.next();)if(e=d.value,e!==c&&e.Oc&&e.Z===a)return!1;return!hh(this,a,b,c,!0)}if(d===jh)return a===b?a=!0:(d=new K(E),d.add(b),a=kh(this,d,a,b,c)),!a;if(d===lh)return!hh(this,a,b,c,!1);if(d===
mh)return a===b?a=!0:(d=new K(E),d.add(b),a=nh(this,d,a,b,c)),!a}return!0};function hh(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.ce;g.next();){var h=g.value;if(h!==d&&(!e||h.Oc)&&h.fa===b&&(h=h.Z,h!==b&&hh(a,h,c,d,e)))return!0}return!1}function kh(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.ce;g.next();){var h=g.value;if(h!==e&&h.fa===c&&(h=h.Z,h!==c&&kh(a,b,h,d,e)))return!0}return!1}
function nh(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.ce;g.next();){var h=g.value;if(h!==e){var k=h.Z,h=h.fa,k=k===c?h:k;if(k!==c&&nh(a,b,k,d,e))return!0}}return!1}x.defineProperty(dh,{Cx:"linkValidation"},function(){return this.hl},function(a){null!==a&&x.g(a,"function",dh,"linkValidation");this.hl=a});x.defineProperty(dh,{Mx:"portTargeted"},function(){return this.oD},function(a){null!==a&&x.g(a,"function",dh,"portTargeted");this.oD=a});
function va(){0<arguments.length&&x.pd(va);dh.call(this);this.name="Linking";this.Ey={};this.Dy=null;this.ga=oh;this.AD=null}x.Qa(va,dh);x.ja("LinkingTool",va);var oh;va.Either=oh=x.s(va,"Either",0);var ph;va.ForwardsOnly=ph=x.s(va,"ForwardsOnly",0);var qh;va.BackwardsOnly=qh=x.s(va,"BackwardsOnly",0);x.defineProperty(va,{vH:"archetypeLinkData"},function(){return this.Ey},function(a){null!==a&&x.l(a,Object,va,"archetypeLinkData");a instanceof O&&x.l(a,G,va,"archetypeLinkData");this.Ey=a});
x.defineProperty(va,{fE:"archetypeLabelNodeData"},function(){return this.Dy},function(a){null!==a&&x.l(a,Object,va,"archetypeLabelNodeData");a instanceof O&&x.l(a,E,va,"archetypeLabelNodeData");this.Dy=a});x.defineProperty(va,{direction:"direction"},function(){return this.ga},function(a){x.Ca(a,va,va,"direction");this.ga=a});x.defineProperty(va,{lG:"startObject"},function(){return this.AD},function(a){null!==a&&x.l(a,O,va,"startObject");this.AD=a});
va.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.kb||a.Ff||!a.gt)return!1;var b=a.aa;return(b instanceof X||b instanceof Ve)&&a.S.left&&(a.eb===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
va.prototype.findLinkablePort=function(){var a=this.h;if(null===a)return null;var b=this.lG;null===b&&(b=a.ne(a.Fc.ha,null,null));if(null===b||!(b.ea instanceof E))return null;a=this.direction;if(a===oh||a===ph){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.pe=!0,c}if(a===oh||a===qh)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.pe=!1,c;return null};
va.prototype.doActivate=function(){var a=this.h;if(null!==a){var b=this.findLinkablePort();null!==b&&(this.Wb(this.name),a.Xe=!0,a.gc="pointer",this.pe?(this.Ah=b,b=this.Ah.ea,b instanceof E&&(this.zh=b),this.copyPortProperties(this.zh,this.Ah,this.Fe,this.Fn,!1)):(this.Ch=b,b=this.Ch.ea,b instanceof E&&(this.Bh=b),this.copyPortProperties(this.Bh,this.Ch,this.Ge,this.Gn,!0)),a.add(this.Fe),a.add(this.Ge),null!==this.Ng&&(null!==this.Fe&&(this.Ng.Z=this.Fe),null!==this.Ge&&(this.Ng.fa=this.Ge),this.Ng.rc(),
a.add(this.Ng)),this.va=!0)}};va.prototype.doDeactivate=function(){this.va=!1;var a=this.h;null!==a&&(a.remove(this.Ng),a.remove(this.Fe),a.remove(this.Ge),a.Xe=!1,a.gc="",this.Ck())};va.prototype.doStop=function(){dh.prototype.doStop.call(this);this.lG=null};
va.prototype.doMouseUp=function(){if(this.va){var a=this.h;if(null===a)return;var b=this.Of=null,c=null,d=null,e=null,g=this.jg=this.findTargetPort(this.pe);if(null!==g){var h=g.ea;h instanceof E&&(this.pe?(null!==this.zh&&(b=this.zh,c=this.Ah),d=h,e=g):(b=h,c=g,null!==this.Bh&&(d=this.Bh,e=this.Ch)))}else this.pe?null!==this.zh&&this.Hp&&(b=this.zh,c=this.Ah):null!==this.Bh&&this.Hp&&(d=this.Bh,e=this.Ch);if(null!==b||null!==d)b=this.insertLink(b,c,d,e),null!==b?(null===g&&(this.pe?b.fo=a.S.ha.copy():
b.ao=a.S.ha.copy()),a.yf&&a.select(b),this.Of=this.name,a.Ja("LinkDrawn",b)):a.aa.nE()}this.stopTool()};
va.prototype.insertLink=function(a,b,c,d){var e=this.h;if(null===e)return null;var g=e.aa;if(g instanceof Ve){var h=a;b=c;e.ae||(h=c,b=a);if(null!==h&&null!==b)return g.Hh(b.data,g.sb(h.data)),b.zt()}else if(g instanceof X)if(h="",null!==a&&(null===b&&(b=a),h=b.zd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.zd,null===b&&(b="")),d=this.vH,d instanceof G){if(Kf(d),g=d.copy(),null!==g)return g.Z=a,g.bg=h,g.fa=c,g.Og=b,e.add(g),a=this.fE,a instanceof E&&(Kf(a),a=a.copy(),null!==a&&(a.Od=g,e.add(a))),
g}else if(null!==d&&(d=g.Yw(d),x.Ya(d)))return null!==a&&g.Xx(d,g.sb(a.data)),g.gB(d,h),null!==c&&g.ay(d,g.sb(c.data)),g.jB(d,b),g.bt(d),a=this.fE,null===a||a instanceof E||(a=g.copyNodeData(a),x.Ya(a)&&(g.vl(a),a=g.sb(a),void 0!==a&&g.Uz(d,a))),g=e.Eg(d);return null};
function ig(){0<arguments.length&&x.pd(ig);dh.call(this);this.name="Relinking";var a=new Y;a.Jb="Diamond";a.Ba=Q.ly;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Ce=0;this.yC=a;a=new Y;a.Jb="Diamond";a.Ba=Q.ly;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Ce=-1;this.ND=a;this.cc=null;this.hD=new w}x.Qa(ig,dh);x.ja("RelinkingTool",ig);
ig.prototype.updateAdornments=function(a){if(null!==a&&a instanceof G){var b="RelinkFrom",c=null;if(a.lb&&!this.h.kb){var d=a.Dn;null!==d&&a.canRelinkFrom()&&a.ba.G()&&a.isVisible()&&d.ba.G()&&d.Wl()&&(c=a.rp(b),null===c&&(c=this.makeAdornment(d,!1),null!==c&&(c.Lc=b),a.ul(b,c)))}null===c&&a.Zl(b);b="RelinkTo";c=null;a.lb&&!this.h.kb&&(d=a.Dn,null!==d&&a.canRelinkTo()&&a.ba.G()&&a.isVisible()&&d.ba.G()&&d.Wl()&&(c=a.rp(b),null===c&&(c=this.makeAdornment(d,!0),null!==c&&(c.Lc=b),a.ul(b,c))));null===
c&&a.Zl(b)}};ig.prototype.makeAdornment=function(a,b){var c=new fa;c.type=rh;var d=b?this.eK:this.qI;null!==d&&c.add(d.copy());c.oc=a;return c};x.defineProperty(ig,{qI:"fromHandleArchetype"},function(){return this.yC},function(a){null!==a&&x.l(a,O,ig,"fromHandleArchetype");this.yC=a});x.defineProperty(ig,{eK:"toHandleArchetype"},function(){return this.ND},function(a){null!==a&&x.l(a,O,ig,"toHandleArchetype");this.ND=a});x.w(ig,{handle:"handle"},function(){return this.cc});
ig.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.kb||a.Ff||!a.$m)return!1;var b=a.aa;if(!(b instanceof X||b instanceof Ve)||!a.S.left)return!1;b=this.findToolHandleAt(a.Fc.ha,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Fc.ha,"RelinkTo"));return null!==b};
ig.prototype.doActivate=function(){var a=this.h;if(null!==a){if(null===this.yc){var b=this.findToolHandleAt(a.Fc.ha,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Fc.ha,"RelinkTo"));if(null===b)return;var c=b.ea;if(!(c instanceof fa&&c.lh instanceof G))return;this.cc=b;this.pe=null===c||"RelinkTo"===c.Lc;this.yc=c.lh}this.Wb(this.name);a.Xe=!0;a.gc="pointer";this.Ah=this.yc.ad;this.zh=this.yc.Z;this.Ch=this.yc.Ad;this.Bh=this.yc.fa;this.hD.set(this.yc.ba);null!==this.yc&&0<this.yc.ta&&(null===
this.yc.Z&&(null!==this.Fn&&(this.Fn.Ba=Q.Ln),null!==this.Fe&&(this.Fe.location=this.yc.m(0))),null===this.yc.fa&&(null!==this.Gn&&(this.Gn.Ba=Q.Ln),null!==this.Ge&&(this.Ge.location=this.yc.m(this.yc.ta-1))));this.copyPortProperties(this.zh,this.Ah,this.Fe,this.Fn,!1);this.copyPortProperties(this.Bh,this.Ch,this.Ge,this.Gn,!0);a.add(this.Fe);a.add(this.Ge);null!==this.Ng&&(null!==this.Fe&&(this.Ng.Z=this.Fe),null!==this.Ge&&(this.Ng.fa=this.Ge),this.copyLinkProperties(this.yc,this.Ng),this.Ng.rc(),
a.add(this.Ng));this.va=!0}};ig.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.dt=a.dt;b.eA=a.eA;var c=a.Te;if(c===sh||c===th)c=uh;b.Te=c;b.Zw=a.Zw;b.Sx=a.Sx;b.hq=a.hq;b.Gb=a.Gb;b.Ml=a.Ml;b.Dt=a.Dt;b.Et=a.Et;b.Hb=a.Hb;b.em=a.em;b.Au=a.Au;b.Bu=a.Bu}};ig.prototype.doDeactivate=function(){this.va=!1;var a=this.h;null!==a&&(a.remove(this.Ng),a.remove(this.Fe),a.remove(this.Ge),a.Xe=!1,a.gc="",this.Ck())};ig.prototype.doStop=function(){dh.prototype.doStop.call(this);this.cc=null};
ig.prototype.doMouseUp=function(){if(this.va){var a=this.h;if(null===a)return;this.Of=null;var b=this.zh,c=this.Ah,d=this.Bh,e=this.Ch,g=this.yc;this.jg=this.findTargetPort(this.pe);if(null!==this.jg){var h=this.jg.ea;h instanceof E&&(this.pe?(d=h,e=this.jg):(b=h,c=this.jg))}else this.Hp?this.pe?e=d=null:c=b=null:g=null;null!==g&&(this.reconnectLink(g,this.pe?d:b,this.pe?e:c,this.pe),null===this.jg&&(this.pe?g.fo=a.S.ha.copy():g.ao=a.S.ha.copy(),g.rc()),a.yf&&(g.lb=!0),this.Of=this.name,a.Ja("LinkRelinked",
g,this.pe?this.Ch:this.Ah));vh(this.yc,this.hD)}this.stopTool()};ig.prototype.reconnectLink=function(a,b,c,d){if(null===this.h)return!1;c=null!==c&&null!==c.zd?c.zd:"";d?(a.fa=b,a.Og=c):(a.Z=b,a.bg=c);return!0};function Tg(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.Fe,a.Fn,!1),a.h.add(a.Fe)):a.h.remove(a.Fe);null!==d?(a.copyPortProperties(d,e,a.Ge,a.Gn,!0),a.h.add(a.Ge)):a.h.remove(a.Ge)}
function wh(){0<arguments.length&&x.pd(wh);cf.call(this);this.name="LinkReshaping";var a=new Y;a.Jb="Rectangle";a.Ba=Q.mq;a.fill="lightblue";a.stroke="dodgerblue";this.$k=a;a=new Y;a.Jb="Diamond";a.Ba=Q.mq;a.fill="lightblue";a.stroke="dodgerblue";this.WC=a;this.pD=3;this.By=this.cc=null;this.iD=new N;this.Zv=null}x.Qa(wh,cf);x.ja("LinkReshapingTool",wh);var xh;wh.None=xh=x.s(wh,"None",0);var yh;wh.Horizontal=yh=x.s(wh,"Horizontal",1);var zh;wh.Vertical=zh=x.s(wh,"Vertical",2);var Ah;
wh.All=Ah=x.s(wh,"All",3);wh.prototype.getReshapingBehavior=wh.prototype.XE=function(a){return a&&a.qD?a.qD:xh};wh.prototype.setReshapingBehavior=wh.prototype.tu=function(a,b){x.l(a,O,wh,"setReshapingBehavior:obj");x.Ca(b,wh,wh,"setReshapingBehavior:behavior");a.qD=b};
wh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof G){if(a.lb&&!this.h.kb){var b=a.path;if(null!==b&&a.canReshape()&&a.ba.G()&&a.isVisible()&&b.ba.G()&&b.Wl()){var c=a.rp(this.name);if(null===c||c.ZG!==a.ta||c.kH!==a.mu)c=this.makeAdornment(b),null!==c&&(c.ZG=a.ta,c.kH=a.mu,a.ul(this.name,c));if(null!==c){c.location=a.position;return}}}a.Zl(this.name)}};
wh.prototype.makeAdornment=function(a){var b=a.ea,c=b.ta,d=b.sc,e=null;if(null!==b.points&&1<c){e=new fa;e.type=rh;var c=b.At,g=b.Ax,h=d?1:0;if(b.mu&&b.Te!==Bh)for(var k=c+h;k<g-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Ce=k,l.Ux=.5,e.add(l))}for(k=c+1;k<g;k++)if(l=this.makeHandle(a,k),null!==l){l.Ce=k;if(k!==c)if(k===c+1&&d){var h=b.m(c),m=b.m(c+1);Q.F(h.x,m.x)&&Q.F(h.y,m.y)&&(m=b.m(c-1));Q.F(h.x,m.x)?(this.tu(l,zh),l.cursor="n-resize"):Q.F(h.y,m.y)&&(this.tu(l,yh),l.cursor="w-resize")}else k===
g-1&&d?(h=b.m(g-1),m=b.m(g),Q.F(h.x,m.x)&&Q.F(h.y,m.y)&&(h=b.m(g+1)),Q.F(h.x,m.x)?(this.tu(l,zh),l.cursor="n-resize"):Q.F(h.y,m.y)&&(this.tu(l,yh),l.cursor="w-resize")):k!==g&&(this.tu(l,Ah),l.cursor="move");e.add(l)}e.Lc=this.name;e.oc=a}return e};wh.prototype.makeHandle=function(){var a=this.Gt;return null===a?null:a.copy()};x.defineProperty(wh,{Gt:"handleArchetype"},function(){return this.$k},function(a){null!==a&&x.l(a,O,wh,"handleArchetype");this.$k=a});
wh.prototype.makeResegmentHandle=function(){var a=this.qJ;return null===a?null:a.copy()};x.defineProperty(wh,{qJ:"midHandleArchetype"},function(){return this.WC},function(a){null!==a&&x.l(a,O,wh,"midHandleArchetype");this.WC=a});x.w(wh,{handle:"handle"},function(){return this.cc});x.w(wh,{et:"adornedLink"},function(){return this.By});wh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.kb&&a.Nw&&a.S.left?null!==this.findToolHandleAt(a.Fc.ha,this.name):!1};
wh.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.cc=this.findToolHandleAt(a.Fc.ha,this.name),null!==this.cc)){var b=this.cc.ea.lh;if(b instanceof G){this.By=b;a.Xe=!0;this.Wb(this.name);if(b.mu&&.5===this.cc.Ux){var c=b.points.copy(),d=this.cc.gb(dc);c.Nd(this.cc.Ce+1,d);b.sc&&c.Nd(this.cc.Ce+1,d);b.points=c;b.oe();this.cc=this.findToolHandleAt(a.Fc.ha,this.name);if(null===this.cc){this.doDeactivate();return}}this.iD=b.m(this.cc.Ce);this.Zv=b.points.copy();this.va=!0}}};
wh.prototype.doDeactivate=function(){this.Ck();this.By=this.cc=null;var a=this.h;null!==a&&(a.Xe=!1);this.va=!1};wh.prototype.doCancel=function(){var a=this.et;null!==a&&(a.points=this.Zv);this.stopTool()};wh.prototype.doMouseMove=function(){var a=this.h;this.va&&null!==a&&(a=this.computeReshape(a.S.ha),this.reshape(a))};
wh.prototype.doMouseUp=function(){var a=this.h;if(this.va&&null!==a){var b=this.computeReshape(a.S.ha);this.reshape(b);b=this.et;if(null!==b&&b.mu){var c=this.handle.Ce,d=b.m(c-1),e=b.m(c),g=b.m(c+1);if(b.sc){if(c>b.At+1&&c<b.Ax-1){var h=b.m(c-2);if(Math.abs(d.x-e.x)<this.Fh&&Math.abs(d.y-e.y)<this.Fh&&(Ch(this,h,d,e,g,!0)||Ch(this,h,d,e,g,!1))){var k=b.points.copy();Ch(this,h,d,e,g,!0)?(k.Lg(c-2,new N(h.x,(g.y+h.y)/2)),k.Lg(c+1,new N(g.x,(g.y+h.y)/2))):(k.Lg(c-2,new N((g.x+h.x)/2,h.y)),k.Lg(c+1,
new N((g.x+h.x)/2,g.y)));k.dd(c);k.dd(c-1);b.points=k;b.oe()}else h=b.m(c+2),Math.abs(e.x-g.x)<this.Fh&&Math.abs(e.y-g.y)<this.Fh&&(Ch(this,d,e,g,h,!0)||Ch(this,d,e,g,h,!1))&&(k=b.points.copy(),Ch(this,d,e,g,h,!0)?(k.Lg(c-1,new N(d.x,(d.y+h.y)/2)),k.Lg(c+2,new N(h.x,(d.y+h.y)/2))):(k.Lg(c-1,new N((d.x+h.x)/2,d.y)),k.Lg(c+2,new N((d.x+h.x)/2,h.y))),k.dd(c+1),k.dd(c),b.points=k,b.oe())}}else h=x.P(),Q.xn(d.x,d.y,g.x,g.y,e.x,e.y,h)&&h.qk(e)<this.Fh*this.Fh&&(k=b.points.copy(),k.dd(c),b.points=k,b.oe()),
x.A(h)}a.xc();this.Of=this.name;a.Ja("LinkReshaped",this.et,this.Zv)}this.stopTool()};function Ch(a,b,c,d,e,g){return g?Math.abs(b.y-c.y)<a.Fh&&Math.abs(c.y-d.y)<a.Fh&&Math.abs(d.y-e.y)<a.Fh:Math.abs(b.x-c.x)<a.Fh&&Math.abs(c.x-d.x)<a.Fh&&Math.abs(d.x-e.x)<a.Fh}x.defineProperty(wh,{Fh:"resegmentingDistance"},function(){return this.pD},function(a){x.g(a,"number",wh,"resegmentingDistance");this.pD=a});
wh.prototype.reshape=function(a){var b=this.et;b.am();var c=this.handle.Ce,d=this.XE(this.handle);if(b.sc)if(c===b.At+1)c=b.At+1,d===zh?(b.ca(c,b.m(c-1).x,a.y),b.ca(c+1,b.m(c+2).x,a.y)):d===yh&&(b.ca(c,a.x,b.m(c-1).y),b.ca(c+1,a.x,b.m(c+2).y));else if(c===b.Ax-1)c=b.Ax-1,d===zh?(b.ca(c-1,b.m(c-2).x,a.y),b.ca(c,b.m(c+1).x,a.y)):d===yh&&(b.ca(c-1,a.x,b.m(c-2).y),b.ca(c,a.x,b.m(c+1).y));else{var d=c,e=b.m(d),g=b.m(d-1),h=b.m(d+1);Q.F(g.x,e.x)&&Q.F(e.y,h.y)?(Q.F(g.x,b.m(d-2).x)&&!Q.F(g.y,b.m(d-2).y)?
(b.B(d,a.x,g.y),c++,d++):b.ca(d-1,a.x,g.y),Q.F(h.y,b.m(d+2).y)&&!Q.F(h.x,b.m(d+2).x)?b.B(d+1,h.x,a.y):b.ca(d+1,h.x,a.y)):Q.F(g.y,e.y)&&Q.F(e.x,h.x)?(Q.F(g.y,b.m(d-2).y)&&!Q.F(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.ca(d-1,g.x,a.y),Q.F(h.x,b.m(d+2).x)&&!Q.F(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.ca(d+1,a.x,h.y)):Q.F(g.x,e.x)&&Q.F(e.x,h.x)?(Q.F(g.x,b.m(d-2).x)&&!Q.F(g.y,b.m(d-2).y)?(b.B(d,a.x,g.y),c++,d++):b.ca(d-1,a.x,g.y),Q.F(h.x,b.m(d+2).x)&&!Q.F(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.ca(d+1,a.x,h.y)):
Q.F(g.y,e.y)&&Q.F(e.y,h.y)&&(Q.F(g.y,b.m(d-2).y)&&!Q.F(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.ca(d-1,g.x,a.y),Q.F(h.y,b.m(d+2).y)&&!Q.F(h.x,b.m(d+2).x)?b.B(d+1,h.x,a.y):b.ca(d+1,h.x,a.y));b.ca(c,a.x,a.y)}else b.ca(c,a.x,a.y),1===c&&b.computeSpot(!0).ze()&&(e=b.Z,g=b.ad,null===e||e.isVisible()||(e=e.findVisibleNode(),e!==b.Z&&(g=e.Ll(""))),d=g.gb(dc,x.P()),e=b.getLinkPointFromPoint(e,g,d,a,!0,x.P()),b.ca(0,e.x,e.y),x.A(d),x.A(e)),c===b.ta-2&&b.computeSpot(!1).ze()&&(c=b.fa,e=b.Ad,null===c||c.isVisible()||
(c=c.findVisibleNode(),c!==b.fa&&(e=c.Ll(""))),d=e.gb(dc,x.P()),e=b.getLinkPointFromPoint(c,e,d,a,!1,x.P()),b.ca(b.ta-1,e.x,e.y),x.A(d),x.A(e));b.fj()};wh.prototype.computeReshape=function(a){var b=this.et,c=this.handle.Ce;switch(this.XE(this.handle)){case Ah:return a;case zh:return b=b.m(c),new N(b.x,a.y);case yh:return b=b.m(c),new N(a.x,b.y);default:case xh:return b.m(c)}};x.w(wh,{UL:"originalPoint"},function(){return this.iD});x.w(wh,{VL:"originalPoints"},function(){return this.Zv});
function Dh(){0<arguments.length&&x.pd(Dh);cf.call(this);this.name="Resizing";this.Vj=(new Fa(1,1)).freeze();this.Tj=(new Fa(9999,9999)).freeze();this.Aj=(new Fa(NaN,NaN)).freeze();this.lr=!1;this.Kb=null;var a=new Y;a.mk=dc;a.Jb="Rectangle";a.Ba=Q.mq;a.fill="lightblue";a.stroke="dodgerblue";a.yb=1;a.cursor="pointer";this.$k=a;this.cc=null;this.Yv=new Fa;this.Bz=new N;this.bz=new Fa(0,0);this.az=new Fa(Infinity,Infinity);this.$y=new Fa(1,1);this.bD=!0}x.Qa(Dh,cf);x.ja("ResizingTool",Dh);
Dh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof G)){if(a.lb&&!this.h.kb){var b=a.SF;if(null!==b&&a.canResize()&&a.ba.G()&&a.isVisible()&&b.ba.G()&&b.Wl()){var c=a.rp(this.name);if(null===c||c.oc!==b)c=this.makeAdornment(b);if(null!==c){var d=b.Nl();c.angle=d;var e=b.gb(c.of,x.P()),g=b.jj();c.location=e;x.A(e);e=c.placeholder;if(null!==e){var b=b.Ga,h=x.dm();h.n(b.width*g,b.height*g);e.Ba=h;x.tk(h)}Eh(this,c,d);a.ul(this.name,c);return}}}a.Zl(this.name)}};
Dh.prototype.makeAdornment=function(a){var b=null,b=a.ea.RF;if(null===b){b=new fa;b.type=Fh;b.of=dc;var c=new Gh;c.Gf=!0;b.add(c);b.add(this.makeHandle(a,Xb));b.add(this.makeHandle(a,bc));b.add(this.makeHandle(a,lc));b.add(this.makeHandle(a,fc));b.add(this.makeHandle(a,Rc));b.add(this.makeHandle(a,Tc));b.add(this.makeHandle(a,bd));b.add(this.makeHandle(a,Sc))}else if(Kf(b),b=b.copy(),null===b)return null;b.Lc=this.name;b.oc=a;return b};
Dh.prototype.makeHandle=function(a,b){var c=this.Gt;if(null===c)return null;c=c.copy();c.alignment=b;return c};
function Eh(a,b,c){if(null!==b)if(!b.alignment.bd()&&""!==b.cursor)a:{a=b.alignment;a.ze()&&(a=dc);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 H)for(b=b.elements;b.next();)Eh(a,
b.value,c)}x.defineProperty(Dh,{Gt:"handleArchetype"},function(){return this.$k},function(a){null!==a&&x.l(a,O,Dh,"handleArchetype");this.$k=a});x.w(Dh,{handle:"handle"},function(){return this.cc});x.defineProperty(Dh,{oc:"adornedObject"},function(){return this.Kb},function(a){null!==a&&x.l(a,O,Dh,"adornedObject");this.Kb=a});Dh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.kb&&a.ht&&a.S.left?null!==this.findToolHandleAt(a.Fc.ha,this.name)?!0:!1:!1};
Dh.prototype.doActivate=function(){var a=this.h;null!==a&&(this.cc=this.findToolHandleAt(a.Fc.ha,this.name),null!==this.cc&&(this.Kb=this.cc.ea.oc,this.Bz.set(this.Kb.ea.location),this.Yv.set(this.Kb.Ba),this.$y=this.computeCellSize(),this.bz=this.computeMinSize(),this.az=this.computeMaxSize(),a.Xe=!0,this.bD=a.$a.isEnabled,a.$a.isEnabled=!1,this.Wb(this.name),this.va=!0))};Dh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.Ck(),this.Kb=this.cc=null,this.va=a.Xe=!1,a.$a.isEnabled=this.bD)};
Dh.prototype.doCancel=function(){this.Kb.Ba=this.Yv;this.Kb.ea.location=this.Bz;this.stopTool()};Dh.prototype.doMouseMove=function(){var a=this.h;if(this.va&&null!==a){var b=this.bz,c=this.az,d=this.$y,e=this.Kb.WE(a.S.ha,x.P()),g=Hh;this.Kb instanceof Y&&(g=Ih(this.Kb));b=this.computeResize(e,this.cc.alignment,b,c,d,!(g===Jh||g===Kh||a.S.shift));this.resize(b);a.dg();x.A(e)}};
Dh.prototype.doMouseUp=function(){var a=this.h;if(this.va&&null!==a){var b=this.bz,c=this.az,d=this.$y,e=this.Kb.WE(a.S.ha,x.P()),g=Hh;this.Kb instanceof Y&&(g=Ih(this.Kb));b=this.computeResize(e,this.cc.alignment,b,c,d,!(g===Jh||g===Kh||a.S.shift));this.resize(b);x.A(e);a.xc();this.Of=this.name;a.Ja("PartResized",this.Kb,this.Yv)}this.stopTool()};
Dh.prototype.resize=function(a){if(null!==this.h){var b=this.oc,c=b.ea,d=b.Nl(),e=b.jj(),g=Math.PI*d/180,h=Math.cos(g),g=Math.sin(g),k=0<d&&180>d?1:0,l=90<d&&270>d?1:0,d=180<d&&360>d?1:0,m=b.Ga.width,n=b.Ga.height;b.Ba=a.size;var p=c.position.copy();c.Af();m=b.Ga.width-m;n=b.Ga.height-n;if(0!==m||0!==n)0!==m&&(p.x+=e*((a.x+m*l)*h-(a.y+n*k)*g)),0!==n&&(p.y+=e*((a.x+m*d)*g+(a.y+n*l)*h)),c.move(p),c instanceof E&&c.mf()}};
Dh.prototype.computeResize=function(a,b,c,d,e,g){b.ze()&&(b=dc);var h=this.oc.Ga,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=x.P();Q.xt(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+.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+.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+.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+.5*(m-k-a.width)));x.A(q);return a};Dh.prototype.computeMinSize=function(){var a=this.oc.Kf.copy(),b=this.Kf;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
Dh.prototype.computeMaxSize=function(){var a=this.oc.Ae.copy(),b=this.Ae;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
Dh.prototype.computeCellSize=function(){var a=new Fa(NaN,NaN),b=this.oc.ea;if(null!==b){var c=b.JJ;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.ip;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.vb.ke,null!==c&&c.ux&&(c=c.ZE,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.Ft,null!==b&&b.visible&&this.ux&&(c=b.nx,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};
x.defineProperty(Dh,{Kf:"minSize"},function(){return this.Vj},function(a){x.l(a,Fa,Dh,"minSize");if(!this.Vj.O(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.Vj.n(b,a)}});x.defineProperty(Dh,{Ae:"maxSize"},function(){return this.Tj},function(a){x.l(a,Fa,Dh,"maxSize");if(!this.Tj.O(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.Tj.n(b,a)}});
x.defineProperty(Dh,{ip:"cellSize"},function(){return this.Aj},function(a){x.l(a,Fa,Dh,"cellSize");this.Aj.O(a)||this.Aj.assign(a)});x.defineProperty(Dh,{ux:"isGridSnapEnabled"},function(){return this.lr},function(a){x.g(a,"boolean",Dh,"isGridSnapEnabled");this.lr=a});x.w(Dh,{SL:"originalDesiredSize"},function(){return this.Yv});x.w(Dh,{TL:"originalLocation"},function(){return this.Bz});
function Lh(){0<arguments.length&&x.pd(Lh);cf.call(this);this.name="Rotating";this.xD=45;this.wD=2;this.Kb=null;var a=new Y;a.Jb="Ellipse";a.Ba=Q.ly;a.fill="lightblue";a.stroke="dodgerblue";a.yb=1;a.cursor="pointer";this.$k=a;this.cc=null;this.Xv=0;this.rD=new N}x.Qa(Lh,cf);x.ja("RotatingTool",Lh);
Lh.prototype.updateAdornments=function(a){if(!(null===a||a instanceof G)){if(a.lb&&!this.h.kb){var b=a.WF;if(null!==b&&a.canRotate()&&a.ba.G()&&a.isVisible()&&b.ba.G()&&b.Wl()){var c=a.rp(this.name);if(null===c||c.oc!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.Nl();var d=null,e=null;b===a||b===a.$b?(d=a.$b,e=a.of):(d=b,e=dc);for(var g=d.Ga,e=x.Xb(g.width*e.x+e.offsetX,g.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.Fb(e),d=d.V;var d=e.y,g=Math.max(e.x-b.Ga.width,0),h=x.P();c.location=
b.gb(new R(1,0,50+g,d),h);x.A(h);x.A(e);a.ul(this.name,c);return}}}a.Zl(this.name)}};Lh.prototype.makeAdornment=function(a){var b=null,b=a.ea.LJ;if(null===b){b=new fa;b.type=Mh;b.of=dc;var c=this.Gt;null!==c&&b.add(c.copy())}else if(Kf(b),b=b.copy(),null===b)return null;b.Lc=this.name;b.oc=a;return b};x.defineProperty(Lh,{Gt:"handleArchetype"},function(){return this.$k},function(a){null!==a&&x.l(a,O,Lh,"handleArchetype");this.$k=a});x.w(Lh,{handle:"handle"},function(){return this.cc});
x.defineProperty(Lh,{oc:"adornedObject"},function(){return this.Kb},function(a){null!==a&&x.l(a,O,Lh,"adornedObject");this.Kb=a});Lh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.kb&&a.Ow&&a.S.left?null!==this.findToolHandleAt(a.Fc.ha,this.name)?!0:!1:!1};
Lh.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.cc=this.findToolHandleAt(a.Fc.ha,this.name),null!==this.cc)){this.Kb=this.cc.ea.oc;var b=this.Kb.ea,c=b.$b;this.rD=this.Kb===b||this.Kb===c?c.gb(b.of):this.Kb.gb(dc);this.Xv=this.Kb.angle;a.Xe=!0;a.hA=!0;this.Wb(this.name);this.va=!0}};Lh.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.Ck(),this.Kb=this.cc=null,this.va=a.Xe=!1)};Lh.prototype.doCancel=function(){var a=this.h;null!==a&&(a.hA=!1);this.rotate(this.Xv);this.stopTool()};
Lh.prototype.doMouseMove=function(){var a=this.h;this.va&&null!==a&&(a=this.computeRotate(a.S.ha),this.rotate(a))};Lh.prototype.doMouseUp=function(){var a=this.h;if(this.va&&null!==a){a.hA=!1;var b=this.computeRotate(a.S.ha);this.rotate(b);a.xc();this.Of=this.name;a.Ja("PartRotated",this.Kb,this.Xv)}this.stopTool()};Lh.prototype.rotate=function(a){u&&x.p(a,Lh,"rotate:newangle");null!==this.Kb&&(this.Kb.angle=a)};
Lh.prototype.computeRotate=function(a){a=this.rD.qh(a);var b=this.Kb.V;null!==b&&(a-=b.Nl(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.ZJ),180),c=Math.min(Math.abs(this.YJ),b/2);!this.h.S.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};x.defineProperty(Lh,{ZJ:"snapAngleMultiple"},function(){return this.xD},function(a){x.g(a,"number",Lh,"snapAngleMultiple");this.xD=a});
x.defineProperty(Lh,{YJ:"snapAngleEpsilon"},function(){return this.wD},function(a){x.g(a,"number",Lh,"snapAngleEpsilon");this.wD=a});x.w(Lh,{RL:"originalAngle"},function(){return this.Xv});function Nh(){0<arguments.length&&x.pd(Nh);cf.call(this);this.name="ClickSelecting"}x.Qa(Nh,cf);x.ja("ClickSelectingTool",Nh);Nh.prototype.canStart=function(){return!this.isEnabled||null===this.h||this.isBeyondDragSize()?!1:!0};
Nh.prototype.doMouseUp=function(){this.va&&(this.standardMouseSelect(),this.standardMouseClick(),this.h.S.nj&&this.h.vb.doToolTip());this.stopTool()};function $h(){0<arguments.length&&x.pd($h);cf.call(this);this.name="Action";this.Nn=null}x.Qa($h,cf);x.ja("ActionTool",$h);
$h.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a)return!1;var b=a.S,c=a.ne(b.ha,function(a){for(;null!==a.V&&!a.Kt;)a=a.V;return a});if(null!==c){if(!c.Kt)return!1;this.Nn=c;a.Xn=a.ne(b.ha,null,null);return!0}return!1};$h.prototype.doMouseDown=function(){if(this.va){var a=this.h.S,b=this.Nn;null!==b&&(a.Ee=b,null!==b.YD&&b.YD(a,b))}else this.canStart()&&this.doActivate()};
$h.prototype.doMouseMove=function(){if(this.va){var a=this.h.S,b=this.Nn;null!==b&&(a.Ee=b,null!==b.ZD&&b.ZD(a,b))}};$h.prototype.doMouseUp=function(){if(this.va){var a=this.h,b=a.S,c=this.Nn;if(null===c)return;b.Ee=c;null!==c.$D&&c.$D(b,c);this.isBeyondDragSize()||Rf(c,b,a)}this.stopTool()};$h.prototype.doCancel=function(){var a=this.h;if(null!==a){var a=a.S,b=this.Nn;if(null===b)return;a.Ee=b;null!==b.XD&&b.XD(a,b)}this.stopTool()};$h.prototype.doStop=function(){this.Nn=null};
function wa(){0<arguments.length&&x.pd(wa);cf.call(this);this.name="ClickCreating";this.Sk=null;this.JC=!0;this.xC=new N(0,0)}x.Qa(wa,cf);x.ja("ClickCreatingTool",wa);
wa.prototype.canStart=function(){if(!this.isEnabled||null===this.Xz)return!1;var a=this.h;if(null===a||a.kb||a.Ff||!a.ep||!a.S.left||this.isBeyondDragSize())return!1;if(this.OI){if(1===a.S.ff&&(this.xC=a.S.te.copy()),2!==a.S.ff||this.isBeyondDragSize(this.xC))return!1}else if(1!==a.S.ff)return!1;return a.eb!==this&&null!==a.yt(a.S.ha,!0)?!1:!0};wa.prototype.doMouseUp=function(){var a=this.h;this.va&&null!==a&&this.insertPart(a.S.ha);this.stopTool()};
wa.prototype.insertPart=function(a){var b=this.h;if(null===b)return null;var c=this.Xz;if(null===c)return null;this.Wb(this.name);var d=null;c instanceof D?c.$d()&&(Kf(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.aa.copyNodeData(c),x.Ya(c)&&(b.aa.vl(c),d=b.ni(c)));null!==d&&(d.location=a,b.yf&&b.select(d));b.xc();this.Of=this.name;b.Ja("PartCreated",d);this.Ck();return d};
x.defineProperty(wa,{Xz:"archetypeNodeData"},function(){return this.Sk},function(a){null!==a&&x.l(a,Object,wa,"archetypeNodeData");this.Sk=a});x.defineProperty(wa,{OI:"isDoubleClick"},function(){return this.JC},function(a){x.g(a,"boolean",wa,"isDoubleClick");this.JC=a});function ai(a,b,c){this.text=a;this.pE=b;this.visible=c}function bi(){0<arguments.length&&x.pd(bi);cf.call(this);this.name="ContextMenu";this.Yn=this.bC=null;this.$C=new N;this.Qy=this.ho=null;ci(this)}x.Qa(bi,cf);
x.ja("ContextMenuTool",bi);x.zE=!1;x.nt=null;x.ot=null;
function ci(a){a.ho=new fa;a.OD=function(){a.stopTool()};if(!1===x.zE){var b=x.createElement("div"),c=x.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=
x.createElement("style");window.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);window.document.body&&(window.document.body.appendChild(b),window.document.body.appendChild(c));x.ot=b;x.nt=c;x.zE=!0}}bi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||this.isBeyondDragSize()||!a.S.right?!1:null!==this.ho&&a.S.nj||null!==this.findObjectWithContextMenu()?!0:!1};
bi.prototype.doStart=function(){var a=this.h;null!==a&&this.$C.set(a.Fc.ha)};bi.prototype.doStop=function(){this.hideDefaultContextMenu();this.hideContextMenu();this.Yn=null};
bi.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return null;var c=b.S,d=null;a instanceof z||(d=a instanceof O?a:b.ne(c.ha,null,function(a){return!a.layer.Nc}));if(null!==d){for(a=d;null!==a;){c=a.contextMenu;if(null!==c)return a;a=a.V}if(null!==this.ho&&b.S.nj)return d.ea}else if(c=b.contextMenu,null!==c)return b;return null};bi.prototype.doActivate=function(){};
bi.prototype.doMouseUp=function(){var a=this.h;if(null!==a)if(!this.va)this.canStart()&&Pf(this,!0);else if(null!==this.ag){var b=a.ne(a.S.ha,null,null);null!==b&&b.Ul(this.ag)&&this.standardMouseClick(null,null);this.stopTool();this.canStart()&&(a.eb=this,this.doMouseUp())}};
function Pf(a,b,c){void 0===c&&(c=null);a.va=!0;b&&a.standardMouseSelect();a.standardMouseClick();a.Yn=null;null===c&&(c=a.findObjectWithContextMenu());null!==c?(b=c.contextMenu,null!==b?(a.Yn=c instanceof O?c:null,a.showContextMenu(b,a.Yn)):a.showDefaultContextMenu()):a.showDefaultContextMenu()}bi.prototype.doMouseMove=function(){this.va&&this.h.vb.doMouseMove()};
bi.prototype.showContextMenu=function(a,b){x.l(a,fa,bi,"showContextMenu:contextmenu");null!==b&&x.l(b,O,bi,"showContextMenu:obj");var c=this.h;if(null!==c){a!==this.ag&&this.hideContextMenu();a.Jf="Tool";a.Ak=!1;a.scale=1/c.scale;a.Lc=this.name;c.add(a);if(null!==b){var c=null,d=b.vp();null!==d&&(c=d.data);a.oc=b;a.data=c}else a.data=c.aa;a.Af();this.positionContextMenu(a,b);this.ag=a}};
bi.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.S.ha.copy(),d=a.Ia,e=b.Ab;b.S.nj&&(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}}};bi.prototype.hideContextMenu=function(){var a=this.h;null!==a&&null!==this.ag&&(this.ag.data=null,this.ag.oc=null,a.remove(this.ag),this.ag=null,this.standardMouseOver())};
function di(a){if(null===a.h)return null;a=new J(ai);a.add(new ai("Copy",function(a){a.zb.copySelection()},function(a){return a.zb.canCopySelection()}));a.add(new ai("Cut",function(a){a.zb.cutSelection()},function(a){return a.zb.canCutSelection()}));a.add(new ai("Delete",function(a){a.zb.deleteSelection()},function(a){return a.zb.canDeleteSelection()}));a.add(new ai("Paste",function(a){a.zb.pasteSelection(a.S.ha)},function(a){return a.zb.canPasteSelection()}));a.add(new ai("Select All",function(a){a.zb.selectAll()},
function(a){return a.zb.canSelectAll()}));a.add(new ai("Undo",function(a){a.zb.undo()},function(a){return a.zb.canUndo()}));a.add(new ai("Redo",function(a){a.zb.redo()},function(a){return a.zb.canRedo()}));a.add(new ai("Scroll To Part",function(a){a.zb.scrollToPart()},function(a){return a.zb.canScrollToPart()}));a.add(new ai("Zoom To Fit",function(a){a.zb.zoomToFit()},function(a){return a.zb.canZoomToFit()}));a.add(new ai("Reset Zoom",function(a){a.zb.resetZoom()},function(a){return a.zb.canResetZoom()}));
a.add(new ai("Group Selection",function(a){a.zb.groupSelection()},function(a){return a.zb.canGroupSelection()}));a.add(new ai("Ungroup Selection",function(a){a.zb.ungroupSelection()},function(a){return a.zb.canUngroupSelection()}));a.add(new ai("Edit Text",function(a){a.zb.editTextBlock()},function(a){return a.zb.canEditTextBlock()}));return a}
bi.prototype.showDefaultContextMenu=function(){var a=this.h;if(null!==a){null===this.Qy&&(this.Qy=di(this));this.ho!==this.ag&&this.hideContextMenu();x.ot.innerHTML="";x.nt.addEventListener("click",this.OD,!1);var b=this,c=x.createElement("ul");c.className="defaultCXul";x.ot.appendChild(c);c.innerHTML="";for(var d=this.Qy.i;d.next();){var e=d.value,g=e.text,h=e.visible;if("function"===typeof e.pE&&("function"!==typeof h||h(a))){h=x.createElement("li");h.className="defaultCXli";var k=x.createElement("a");
k.className="defaultCXa";k.href="#";k.RG=e.pE;k.addEventListener("click",function(c){this.RG(a);b.stopTool();c.preventDefault();return!1},!1);k.textContent=g;h.appendChild(k);c.appendChild(h)}}x.ot.style.display="block";x.nt.style.display="block";this.ag=this.ho}};bi.prototype.hideDefaultContextMenu=function(){null!==this.ag&&this.ag===this.ho&&(x.ot.style.display="none",x.nt.style.display="none",x.nt.removeEventListener("click",this.OD,!1),this.ag=null)};
x.defineProperty(bi,{ag:"currentContextMenu"},function(){return this.bC},function(a){null!==a&&x.l(a,fa,bi,"currentContextMenu");this.bC=a});x.defineProperty(bi,{TK:"currentObject"},function(){return this.Yn},function(a){null!==a&&x.l(a,O,bi,"currentObject");this.Yn=a});x.w(bi,{ML:"mouseDownPoint"},function(){return this.$C});
function ei(){0<arguments.length&&x.pd(ei);cf.call(this);this.name="DragSelecting";this.io=175;this.OC=!1;var a=new D;a.Jf="Tool";a.Ak=!1;var b=new Y;b.name="SHAPE";b.Jb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.mm=a}x.Qa(ei,cf);x.ja("DragSelectingTool",ei);
ei.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.yf)return!1;var b=a.S;return!b.left||a.eb!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Fc.timestamp<this.AE||null!==a.yt(b.ha,!0))?!1:!0};ei.prototype.doActivate=function(){var a=this.h;null!==a&&(this.va=!0,a.Xe=!0,a.xb=!0,a.add(this.nh),this.doMouseMove())};ei.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.remove(this.nh),a.xb=!1,this.va=a.Xe=!1)};
ei.prototype.doMouseMove=function(){if(null!==this.h&&this.va&&null!==this.nh){var a=this.computeBoxBounds(),b=this.nh.me("SHAPE");null===b&&(b=this.nh.Bf());b.Ba=a.size;this.nh.position=a.position}};ei.prototype.doMouseUp=function(){if(this.va){var a=this.h;a.remove(this.nh);try{a.gc="wait",this.selectInRect(this.computeBoxBounds())}finally{a.gc=""}}this.stopTool()};ei.prototype.computeBoxBounds=function(){var a=this.h;return null===a?new w(0,0,0,0):new w(a.Fc.ha,a.S.ha)};
ei.prototype.selectInRect=function(a){var b=this.h;if(null!==b){var c=b.S;b.Ja("ChangingSelection");a=b.sk(a,null,function(a){return a instanceof D?a.canSelect():!1},this.WI);if(x.wk?c.Zt:c.control)if(c.shift)for(a=a.i;a.next();)c=a.value,c.lb&&(c.lb=!1);else for(a=a.i;a.next();)c=a.value,c.lb=!c.lb;else{if(!c.shift){for(var c=new J(D),d=b.selection.i;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.i;c.next();)c.value.lb=!1}for(a=a.i;a.next();)c=a.value,c.lb||(c.lb=!0)}b.Ja("ChangedSelection")}};
x.defineProperty(ei,{AE:"delay"},function(){return this.io},function(a){x.g(a,"number",ei,"delay");this.io=a});x.defineProperty(ei,{WI:"isPartialInclusion"},function(){return this.OC},function(a){x.g(a,"boolean",ei,"isPartialInclusion");this.OC=a});x.defineProperty(ei,{nh:"box"},function(){return this.mm},function(a){null!==a&&x.l(a,D,ei,"box");this.mm=a});
function fi(){0<arguments.length&&x.pd(fi);cf.call(this);this.name="Panning";this.Cz=new N;this.zj=!1;var a=this;this.BD=function(){window.document.removeEventListener("scroll",a.BD,!1);a.stopTool()}}x.Qa(fi,cf);x.ja("PanningTool",fi);fi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||!a.Qe&&!a.Re||!a.S.left||a.eb!==this&&!this.isBeyondDragSize()?!1:!0};
fi.prototype.doActivate=function(){var a=this.h;null!==a&&(this.zj?(a.S.bubbles=!0,window.document.addEventListener("scroll",this.BD,!1)):(a.gc="move",a.Xe=!0,this.Cz=a.position.copy()),this.va=!0)};fi.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.gc="",this.va=a.Xe=!1)};fi.prototype.doCancel=function(){var a=this.h;null!==a&&(a.position=this.Cz,a.Xe=!1);this.stopTool()};fi.prototype.doMouseMove=function(){this.move()};fi.prototype.doMouseUp=function(){this.move();this.stopTool()};
fi.prototype.move=function(){var a=this.h;if(this.va&&a)if(this.zj)a.S.bubbles=!0;else{var b=a.position,c=a.Fc.ha,d=a.S.ha,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.Qe||(e=b.x);a.Re||(c=b.y);a.position=new N(e,c)}};x.defineProperty(fi,{bubbles:"bubbles"},function(){return this.zj},function(a){x.g(a,"boolean",fi,"bubbles");this.zj=a});x.w(fi,{WL:"originalPosition"},function(){return this.Cz});
function gi(){0<arguments.length&&x.pd(gi);cf.call(this);this.name="TextEditing";this.fC=this.Mz=this.FD=null;this.Yo=hi;this.rl=null;this.qb=ii;this.ol=null;this.XC=1;this.uD=!0;var a=x.createElement("textarea");a.NB=!0;this.lC=a;a.addEventListener("input",function(){var a=this.textEditingTool;if(null!==a&&void 0!==a&&null!==a.He){var c=a.FD;c.text=this.value;var d=this.dK;ji(c,a.He.Iv,Infinity);this.style.width=20+c.Ia.width*d+"px";this.style.height=10+c.Ia.height*d+"px";this.rows=c.dJ}},!1);a.addEventListener("keydown",
function(a){var c=a.which,d=this.textEditingTool;if(null!==d&&void 0!==d&&null!==d.He)if(13===c)!1===d.He.xx&&a.preventDefault(),d.acceptText(ki);else{if(9===c)return d.acceptText(li),a.preventDefault(),!1;27===c&&(d.doCancel(),null!==d.h&&d.h.focus())}},!1);a.addEventListener("focus",function(){var a=this.textEditingTool;null!==a&&void 0!==a&&(a.qb===mi?a.qb=ni:a.qb===oi?a.qb=pi:a.qb===pi&&(a.qb=ni),"function"===typeof this.select&&a.fB&&(this.select(),this.setSelectionRange(0,9999)))},!1);a.addEventListener("blur",
function(){"function"===typeof this.focus&&this.focus();var a=this.textEditingTool;null!==a&&void 0!==a&&"function"===typeof this.select&&a.fB&&(this.select(),this.setSelectionRange(0,9999))},!1)}x.ja("TextEditingTool",gi);x.Qa(gi,cf);var qi;gi.LostFocus=qi=x.s(gi,"LostFocus",0);var ri;gi.MouseDown=ri=x.s(gi,"MouseDown",1);var li;gi.Tab=li=x.s(gi,"Tab",2);var ki;gi.Enter=ki=x.s(gi,"Enter",3);gi.SingleClick=x.s(gi,"SingleClick",0);var hi;gi.SingleClickSelected=hi=x.s(gi,"SingleClickSelected",1);
var ii=x.s(gi,"StateNone",0),mi=x.s(gi,"StateActive",1),ni=x.s(gi,"StateEditing",2),pi=x.s(gi,"StateEditing2",3),si=x.s(gi,"StateValidating",4),oi=x.s(gi,"StateValidated",5);x.defineProperty(gi,{He:"textBlock"},function(){return this.Mz},function(a){null!==a&&x.l(a,sa,gi,"textBlock");this.Mz=a});x.defineProperty(gi,{Cg:"currentTextEditor"},function(){return this.fC},function(a){this.fC=a});
x.defineProperty(gi,{XH:"defaultTextEditor"},function(){return this.lC},function(a){x.l(a,Element,gi,"defaultTextEditor");this.lC=a});x.defineProperty(gi,{lB:"starting"},function(){return this.Yo},function(a){x.Ca(a,gi,gi,"starting");this.Yo=a});
gi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.kb||!a.S.left||this.isBeyondDragSize())return!1;a=a.ne(a.S.ha,null,function(a){return a instanceof sa});if(null===a||!a.kA||!a.ea.canEdit())return!1;a=a.ea;return null===a||this.lB===hi&&!a.lb?!1:!0};gi.prototype.doStart=function(){this.va||null===this.He||this.doActivate()};
gi.prototype.doActivate=function(){if(!this.va){var a=this.h;if(null!==a){var b=this.He;null===b&&(b=a.ne(a.S.ha,function(a){return a instanceof sa?a:null}));if(null!==b&&(this.He=b,null!==b.ea)){this.va=!0;this.qb=mi;var c=this.XH,d=!1;null!==b.oG&&(c=b.oG);null===c||c.NB||(d=!0);this.FD=this.He.copy();var e=new w(this.He.gb(Xb),this.He.gb(lc));a.QJ(e);if(c.NB){var g=b.gb(dc),h=a.position,k=a.scale,l=b.jj()*k;l<this.zF&&(l=this.zF);var e=b.Ga.width*l,m=b.Ga.height*l,n=(g.x-h.x)*k,g=(g.y-h.y)*k;c.value=
b.text;a.Il.style.font=b.font;c.style.font="inherit";c.style.fontSize=100*l+"%";c.style.lineHeight="normal";c.style.width=e+6+"px";c.style.height=m+2+"px";c.style.left=(n-e/2|0)-1+"px";c.style.top=(g-m/2|0)-1+"px";c.style.textAlign=b.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style["white-space"]="pre-wrap";c.style.overflow="hidden"}a.Il.appendChild(c);c.style.position="absolute";c.style.zIndex=100;c.className="start";c.textEditingTool=this;c.dK=
l;if(d&&"function"===typeof c.onActivate)c.onActivate();this.Cg=c;"function"===typeof c.focus&&c.focus();"function"===typeof c.select&&this.fB&&(c.select(),c.setSelectionRange(0,9999))}}}};gi.prototype.doCancel=function(){null!==this.ol&&(this.Cg.style.border=this.ol,this.ol=null);this.stopTool()};gi.prototype.doMouseUp=function(){!this.va&&this.canStart()&&this.doActivate()};gi.prototype.doMouseDown=function(){this.va&&this.acceptText(ri)};
gi.prototype.acceptText=function(a){switch(a){case ri:if(this.qb===oi||this.qb===pi)"function"===typeof this.Cg.focus&&this.Cg.focus();else if(this.qb===mi||this.qb===ni)this.qb=si,ti(this);break;case qi:case ki:case li:if(ki===a&&!0===this.Mz.xx)break;if(this.qb===mi||this.qb===ni)this.qb=si,ti(this)}};
function ti(a){if(null!==a.He&&null!==a.Cg){var b=a.He,c=a.He.text,d=a.Cg.value,e="",e="function"===typeof d?d():d;if(!a.isValidText(a.He,c,e)){a.qb=ni;null!==b.lA&&b.lA(a,c,e);null===a.ol&&(a.ol=a.Cg.style.border,a.Cg.style.border="3px solid red");"function"===typeof a.Cg.focus&&a.Cg.focus();return}a.Wb(a.name);a.qb=oi;c!==e&&(a.He.text=e);a.Of=a.name;b=a.h;null!==b&&b.Ja("TextEdited",a.He,c);a.Ck();a.stopTool();null!==b&&b.focus()}null!==a.ol&&(a.Cg.style.border=a.ol,a.ol=null)}
gi.prototype.doDeactivate=function(){var a=this.h;if(null!==a){this.qb=ii;this.He=null;if(null!==this.Cg){var b=this.Cg;if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.Il.removeChild(b)}this.va=!1}};gi.prototype.isValidText=function(a,b,c){x.l(a,sa,gi,"isValidText:textblock");var d=this.oB;if(null!==d&&!d(a,b,c))return!1;d=a.oB;return null===d||d(a,b,c)?!0:!1};
x.defineProperty(gi,{oB:"textValidation"},function(){return this.rl},function(a){null!==a&&x.g(a,"function",gi,"textValidation");this.rl=a});x.defineProperty(gi,{zF:"minimumEditorScale"},function(){return this.XC},function(a){null!==a&&x.g(a,"number",gi,"minimumEditorScale");this.XC=a});x.defineProperty(gi,{fB:"selectsTextOnActivate"},function(){return this.uD},function(a){null!==a&&x.g(a,"boolean",gi,"selectsTextOnActivate");this.uD=a});
function Hf(){cf.call(this);this.name="ToolManager";this.WG=new J(cf);this.XG=new J(cf);this.YG=new J(cf);this.BC=this.CC=850;this.pC=(new Fa(2,2)).Ma();this.PD=5E3;this.aD=dg;this.zC=ui;this.gv=this.Py=null;this.Um=-1}x.Qa(Hf,cf);x.ja("ToolManager",Hf);var dg;Hf.WheelScroll=dg=x.s(Hf,"WheelScroll",0);var cg;Hf.WheelZoom=cg=x.s(Hf,"WheelZoom",1);Hf.WheelNone=x.s(Hf,"WheelNone",2);var ui;Hf.GestureZoom=ui=x.s(Hf,"GestureZoom",3);var vi;Hf.GestureCancel=vi=x.s(Hf,"GestureCancel",4);var wi;
Hf.GestureNone=wi=x.s(Hf,"GestureNone",5);x.defineProperty(Hf,{bu:"mouseWheelBehavior"},function(){return this.aD},function(a){x.Ca(a,Hf,Hf,"mouseWheelBehavior");this.aD=a});x.defineProperty(Hf,{yp:"gestureBehavior"},function(){return this.zC},function(a){x.Ca(a,Hf,Hf,"gestureBehavior");this.zC=a});
Hf.prototype.initializeStandardTools=function(){this.lH=new $h;this.HF=new ig;this.gJ=new wh;this.UF=new Dh;this.NJ=new Lh;this.vF=new va;this.ke=new Mf;this.bI=new ei;this.zJ=new fi;this.bA=new bi;this.nB=new gi;this.DH=new wa;this.EH=new Nh};
Hf.prototype.doMouseDown=function(){var a=this.h;if(null!==a){var b=a.S;b.nj&&this.yp===vi&&(b.bubbles=!1);if(b.Ot){if(this.yp===wi){b.bubbles=!0;return}if(this.yp===vi)return;if(a.eb.canStartMultiTouch()){a.eb.standardPinchZoomStart();return}}var c=a.qa;c.Zz&&0!==c.Jh&&x.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.sf.length,d=0;d<c;d++){var e=this.sf.ia(d);null===e.h&&e.Sc(this.h);if(e.canStart()){a.eb=e;a.eb===e&&(e.va||e.doActivate(),e.doMouseDown());
return}}1===a.S.button&&(this.bu===dg?this.bu=cg:this.bu===cg&&(this.bu=dg));this.doActivate();this.standardWaitAfter(this.cF,b)}};
Hf.prototype.doMouseMove=function(){var a=this.h;if(null!==a){var b=a.S;if(b.Ot){if(this.yp===wi){b.bubbles=!0;return}if(this.yp===vi)return;if(a.eb.canStartMultiTouch()){a.eb.standardPinchZoomMove();return}}if(this.va)for(var c=this.eg.length,d=0;d<c;d++){var e=this.eg.ia(d);null===e.h&&e.Sc(this.h);if(e.canStart()){a.eb=e;a.eb===e&&(e.va||e.doActivate(),e.doMouseMove());return}}this.standardMouseOver();this.isBeyondDragSize()&&this.standardWaitAfter(this.va?this.cF:this.FI,b)}};
Hf.prototype.doCurrentObjectChanged=function(a,b){var c=this.El;null===c||null!==b&&(b===c||b.Ul(c))||this.hideToolTip()};Hf.prototype.doWaitAfter=function(a){var b=this.h;null!==b&&b.nb&&(this.doMouseHover(),this.va||this.doToolTip(),a.nj&&!b.S.Mc&&(a=a.copy(),a.button=2,a.buttons=2,b.S=a,b.zw=!0,b.doMouseUp()))};
Hf.prototype.doMouseHover=function(){var a=this.h;if(null!==a){var b=a.S;null===b.Ee&&(b.Ee=a.ne(b.ha,null,null));var c=b.Ee;if(null!==c)for(b.Mc=!1;null!==c;){a=this.va?c.JA:c.KA;if(null!==a&&(a(b,c),b.Mc))break;c=c.V}else a=this.va?a.JA:a.KA,null!==a&&a(b)}};
Hf.prototype.doToolTip=function(){var a=this.h;if(null!==a){var b=a.S;null===b.Ee&&(b.Ee=a.ne(b.ha,null,null));b=b.Ee;if(null!==b){if(b!==this.El&&!b.Ul(this.El)){for(;null!==b;){a=b.qB;if(null!==a){this.showToolTip(a,b);return}b=b.V}this.hideToolTip()}}else a=a.qB,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
Hf.prototype.showToolTip=function(a,b){x.l(a,fa,Hf,"showToolTip:tooltip");null!==b&&x.l(b,O,Hf,"showToolTip:obj");var c=this.h;if(null!==c){a!==this.El&&this.hideToolTip();a.Jf="Tool";a.Ak=!1;a.scale=1/c.scale;c.add(a);if(null!==b&&b!==this.gv){var c=null,d=b.vp();null!==d&&(c=d.data);a.oc=b;a.data=c}else null===b&&(a.data=c.aa);if(null===b||b!==this.gv)a.Af(),this.positionToolTip(a,b);this.Py=a;this.gv=b;-1!==this.Um&&(x.clearTimeout(this.Um),this.Um=-1);c=this.iK;if(0<c&&Infinity!==c){var e=this;
this.Um=x.setTimeout(function(){e.hideToolTip()},c)}}};Hf.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.S.ha.copy(),d=a.Ia,e=b.Ab;b.S.nj&&(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}}};
Hf.prototype.hideToolTip=function(){-1!==this.Um&&(x.clearTimeout(this.Um),this.Um=-1);if(null!==this.El){var a=this.h;null!==a&&(this.El.data=null,this.El.oc=null,a.remove(this.El),this.gv=this.Py=null)}};x.w(Hf,{El:"currentToolTip"},function(){return this.Py});
Hf.prototype.doMouseUp=function(){this.cancelWaitAfter();if(this.va){var a=this.h;if(null===a)return;for(var b=this.fg.length,c=0;c<b;c++){var d=this.fg.ia(c);null===d.h&&d.Sc(this.h);if(d.canStart()){a.eb=d;a.eb===d&&(d.va||d.doActivate(),d.doMouseUp());return}}}this.doDeactivate()};Hf.prototype.doMouseWheel=function(){this.standardMouseWheel()};Hf.prototype.doKeyDown=function(){var a=this.h;null!==a&&a.zb.doKeyDown()};Hf.prototype.doKeyUp=function(){var a=this.h;null!==a&&a.zb.doKeyUp()};
Hf.prototype.doCancel=function(){null!==gg&&gg.doCancel();cf.prototype.doCancel.call(this)};Hf.prototype.findTool=function(a){x.g(a,"string",Hf,"findTool:name");for(var b=this.sf.length,c=0;c<b;c++){var d=this.sf.ia(c);if(d.name===a)return d}b=this.eg.length;for(c=0;c<b;c++)if(d=this.eg.ia(c),d.name===a)return d;b=this.fg.length;for(c=0;c<b;c++)if(d=this.fg.ia(c),d.name===a)return d;return null};
Hf.prototype.replaceTool=function(a,b){x.g(a,"string",Hf,"replaceTool:name");null!==b&&(x.l(b,cf,Hf,"replaceTool:newtool"),b.h&&b.h!==this.h&&x.k("Cannot share tools between Diagrams: "+b.toString()),b.Sc(this.h));for(var c=this.sf.length,d=0;d<c;d++){var e=this.sf.ia(d);if(e.name===a)return null!==b?this.sf.Lg(d,b):this.sf.dd(d),e}c=this.eg.length;for(d=0;d<c;d++)if(e=this.eg.ia(d),e.name===a)return null!==b?this.eg.Lg(d,b):this.eg.dd(d),e;c=this.fg.length;for(d=0;d<c;d++)if(e=this.fg.ia(d),e.name===
a)return null!==b?this.fg.Lg(d,b):this.fg.dd(d),e;return null};function xi(a,b,c,d){x.g(b,"string",Hf,"replaceStandardTool:name");x.l(d,J,Hf,"replaceStandardTool:list");null!==c&&(x.l(c,cf,Hf,"replaceStandardTool:newtool"),c.h&&c.h!==a.h&&x.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Sc(a.h));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}x.w(Hf,{sf:"mouseDownTools"},function(){return this.WG});x.w(Hf,{eg:"mouseMoveTools"},function(){return this.XG});
x.w(Hf,{fg:"mouseUpTools"},function(){return this.YG});x.defineProperty(Hf,{FI:"hoverDelay"},function(){return this.CC},function(a){x.g(a,"number",Hf,"hoverDelay");this.CC=a});x.defineProperty(Hf,{cF:"holdDelay"},function(){return this.BC},function(a){x.g(a,"number",Hf,"holdDelay");this.BC=a});x.defineProperty(Hf,{cI:"dragSize"},function(){return this.pC},function(a){x.l(a,Fa,Hf,"dragSize");this.pC=a.Y()});
x.defineProperty(Hf,{iK:"toolTipDuration"},function(){return this.PD},function(a){x.g(a,"number",Hf,"toolTipDuration");this.PD=a});x.defineProperty(Hf,{lH:"actionTool"},function(){return this.findTool("Action")},function(a){xi(this,"Action",a,this.sf)});x.defineProperty(Hf,{HF:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){xi(this,"Relinking",a,this.sf)});
x.defineProperty(Hf,{gJ:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){xi(this,"LinkReshaping",a,this.sf)});x.defineProperty(Hf,{UF:"resizingTool"},function(){return this.findTool("Resizing")},function(a){xi(this,"Resizing",a,this.sf)});x.defineProperty(Hf,{NJ:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){xi(this,"Rotating",a,this.sf)});
x.defineProperty(Hf,{vF:"linkingTool"},function(){return this.findTool("Linking")},function(a){xi(this,"Linking",a,this.eg)});x.defineProperty(Hf,{ke:"draggingTool"},function(){return this.findTool("Dragging")},function(a){xi(this,"Dragging",a,this.eg)});x.defineProperty(Hf,{bI:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){xi(this,"DragSelecting",a,this.eg)});
x.defineProperty(Hf,{zJ:"panningTool"},function(){return this.findTool("Panning")},function(a){xi(this,"Panning",a,this.eg)});x.defineProperty(Hf,{bA:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){xi(this,"ContextMenu",a,this.fg)});x.defineProperty(Hf,{nB:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){xi(this,"TextEditing",a,this.fg)});
x.defineProperty(Hf,{DH:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){xi(this,"ClickCreating",a,this.fg)});x.defineProperty(Hf,{EH:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){xi(this,"ClickSelecting",a,this.fg)});
function tf(){this.gC=yi;this.Tq=this.Uq=this.W=null;this.jo=this.ko=0;this.Uu=this.Bc=this.Bo=this.Kj=!1;this.Lj=this.af=!0;this.fv=this.ev=this.dC=null;this.cC=0;this.Yo=null;this.Su=new K("string");this.Xy=600;this.aH=new N(0,0);this.SB=this.RB=this.TD=!1;this.ml=new ra(O,zi)}x.ja("AnimationManager",tf);tf.prototype.Sc=function(a){this.W=a};function yi(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function Ai(a,b,c,d){return 0==a?b:c*Math.pow(2,10*(a/d-1))+b}
function Bi(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}x.defineProperty(tf,{lB:"starting"},function(){return this.Yo},function(a){this.Yo!==a&&(null!==a&&x.g(a,"function",tf,"starting"),this.Yo=a)});x.w(tf,{MK:"animationReasons"},function(){return this.Su});tf.prototype.prepareAutomaticAnimation=tf.prototype.An=function(a){if(this.af&&(this.Lj||this.W.Le)){this.Su.add(a);var b=this.lB;if(null===b||b(this,a))this.Kj&&this.uj(),this.Bc=!0,this.Uu=!1}};
function Ci(a){a.af&&(a.Su.clear(),a.Bc&&requestAnimationFrame(function(){!1===a.Bc||a.Kj||(a.W.fk=1,Di(a.W),a.Bc=!1,a.W.Ja("AnimationStarting"),Ei(a))}))}
function Fi(a,b,c,d,e,g){if(a.Bc&&(u&&x.l(b,O,tf,"addPropToAnimation:obj"),!("position"===c&&d.O(e)||b instanceof D&&!b.gF))){void 0===g&&(g=!1);var h=a.ml;if(h.contains(b)){a=h.oa(b);var k=a.start,l=a.end;void 0===k[c]&&(k[c]=Gi(d));a.fA&&void 0!==l[c]?a.mA[c]=Gi(e):(g||(a.mA[c]=Gi(e)),l[c]=Gi(e))}else k=new pa,l=new pa,k[c]=Gi(d),l[c]=Gi(e),c=l,d=k.position,d instanceof N&&!d.G()&&a.Su.contains("Expand SubGraph")&&d.assign(c.position),h.add(b,new zi(k,l,g))}}
function Gi(a){return a instanceof N?a.copy():a instanceof Fa?a.copy():a}
function Ei(a){var b;void 0===b&&(b=new pa);var c=a.W;if(null!==c){a.Kj=!0;var d=b.mL||a.gC,e=b.PL||null,g=b.QL||null,h=b.duration||a.Xy,k=a.aH;for(b=a.ml.i;b.next();){var l=b.value.start.position;l instanceof N&&(l.G()||l.assign(k))}a.dC=d;a.ev=e;a.fv=g;a.cC=h;var m=a.ml;for(b=m.i;b.next();)e=b.value.end,e["position:placeholder"]&&(g=e["position:placeholder"],k=g.gb(Xb),k.x+=g.padding.left,k.y+=g.padding.top,e["position:placeholder"]=k);Hi(a);Ii(a,c,m,d,0,h);Wg(a.W);Ji(a);requestAnimationFrame(function(b){var e=
b||+new Date,g=e+h;(function s(b){if(!1!==a.Kj){b=b||+new Date;var k=b>g?h:b-e;Hi(a);Ii(a,c,m,d,k,h);a.ev&&a.ev();Wg(c);Ji(a);b>g?Ki(a):requestAnimationFrame(s)}})(e)})}}
var Li={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.$x(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},"position:node":function(a,b,c,d,e,g){var h=a.ba,k=c.ba;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==g?a.$x(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g)):a.position=new N(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g))},"position:placeholder":function(a,b,c,d,e,g){e!==g?a.$x(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):
a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};function Hi(a){if(!a.Bo){var b=a.W;a.TD=b.xb;a.RB=b.ey;a.SB=b.wu;b.xb=!0;b.ey=!0;b.wu=!0;a.Bo=!0}}function Ji(a){var b=a.W;b.xb=a.TD;b.ey=a.RB;b.wu=a.SB;a.Bo=!1}
function Ii(a,b,c,d,e,g){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==Li[m])Li[m](h,l[m],k[m],d,e,g)}d=b.xA;b.xA=!0;0!==a.ko&&0!==a.jo&&(m=a.ko,c=a.jo,h=Ai,m>c&&(h=Bi),b.dc=h(e,m,c-m,g));null!==a.Uq&&null!==a.Tq&&(m=a.Uq,c=a.Tq,h=a.gC,a.ko>a.jo&&(h=Ai),b.fb=new N(h(e,m.x,c.x-m.x,g),h(e,m.y,c.y-m.y,g)));b.xA=d}
tf.prototype.stopAnimation=tf.prototype.uj=function(){!0===this.Bc&&(this.Bc=!1,this.Uu&&this.W.Be());this.Kj&&this.af&&Ki(this)};
function Ki(a){a.Kj=!1;a.Uq=null;a.Tq=null;a.ko=0;a.jo=0;Hi(a);for(var b=a.W,c=a.dC,d=a.cC,e=a.ml.i;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.mA,n;for(n in l)if(void 0!==Li[n]){var p=n;!h.fA||"position:node"!==p&&"position:placeholder"!==p||(p="position");Li[p](g,k[n],h.fA?void 0!==m[n]?m[n]:k[n]:l[n],c,d,d)}h.Ox&&g.Qd(!1)}for(c=a.W.links;c.next();)d=c.value,null!==d.So&&(d.points=d.So,d.So=null);b.Dx.clear();b.fk=null;b.xc();b.dg();Mi(b);Ji(a);a.ml=new ra(O,zi);a.fv&&a.fv();a.fv=null;
a.ev=null;b.Ja("AnimationFinished");b.Be()}function Ni(a,b,c){var d=b.ba,e=c.ba,g=null;c instanceof F&&(g=c.placeholder);null!==g?(d=g.gb(Xb),d.x+=g.padding.left,d.y+=g.padding.top,Fi(a,b,"position",d,b.position,!1)):Fi(a,b,"position",new N(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Fi(a,b,"scale",.01,b.scale,!1);if(b instanceof F)for(b=b.Gc;b.next();)g=b.value,g instanceof E&&Ni(a,g,c)}
function Oi(a,b,c){if(b.isVisible()){var d=null;c instanceof F&&(d=c.placeholder);null!==d?Fi(a,b,"position:placeholder",b.position,d,!0):Fi(a,b,"position:node",b.position,c,!0);Fi(a,b,"scale",b.scale,.01,!0);a.Bc&&(d=a.ml,d.contains(b)&&(d.oa(b).Ox=!0));if(b instanceof F)for(b=b.Gc;b.next();)d=b.value,d instanceof E&&Oi(a,d,c)}}function Pi(a,b,c){a.Bc&&(null===a.Uq&&b.G()&&null===a.Tq&&(a.Uq=b.copy()),a.Tq=c.copy(),a.Uu=!0)}
function Qi(a,b,c){a.Bc&&a.W.Le&&(0===a.ko&&0===a.jo&&(a.ko=b),a.jo=c,a.Uu=!0)}x.defineProperty(tf,{isEnabled:"isEnabled"},function(){return this.af},function(a){x.g(a,"boolean",tf,"isEnabled");this.af=a});x.defineProperty(tf,{duration:"duration"},function(){return this.Xy},function(a){x.g(a,"number",tf,"duration");1>a&&x.la(a,">= 1",tf,"duration");this.Xy=a});x.w(tf,{Df:"isAnimating"},function(){return this.Kj});x.w(tf,{wL:"isTicking"},function(){return this.Bo});
x.defineProperty(tf,{nF:"isInitial"},function(){return this.Lj},function(a){x.g(a,"boolean",tf,"isInitial");this.Lj=a});function zi(a,b,c){this.start=a;this.end=b;this.mA=new pa;this.fA=c;this.Ox=!1}function bf(){0<arguments.length&&x.pd(bf);x.lc(this);this.W=null;this.pb=new J(D);this.Vb="";this.Xc=1;this.nz=!1;this.ql=this.Qz=this.Pk=this.Ok=this.Nk=this.Mk=this.Kk=this.Lk=this.Jk=this.Rk=this.Ik=this.Qk=this.Hk=this.Gk=!0;this.iz=!1;this.$v=[]}x.ja("Layer",bf);
bf.prototype.Sc=function(a){this.W=a};
bf.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.pb.i;k.next();){var l=k.value;l instanceof F?e++:l instanceof E?d++:l instanceof G?g++:l instanceof fa?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(a=this.pb.i;a.next();)c=a.value,k+="\n    "+c.toString(),d=c.data,null!==d&&x.od(d)&&(k+=" #"+x.od(d)),c instanceof E?k+=" "+
la(d):c instanceof G&&(k+=" "+la(c.Z)+" "+la(c.fa));return b+" "+this.pb.count+": "+k};
bf.prototype.findObjectAt=bf.prototype.ne=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.ql)return null;u&&!a.G()&&x.k("findObjectAt: Point must have a real value, not: "+a.toString());var d=!1;this.h.Ab.Na(a)&&(d=!0);for(var e=x.P(),g=this.pb.o,h=g.length;h--;){var k=g[h];if((!0!==d||!1!==Ri(k))&&k.isVisible()&&(e.assign(a),rb(e,k.mh),k=k.ne(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return x.A(e),k}x.A(e);return null};
bf.prototype.findObjectsAt=bf.prototype.sp=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new K(O));if(!1===this.ql)return d;u&&!a.G()&&x.k("findObjectsAt: Point must have a real value, not: "+a.toString());var e=!1;this.h.Ab.Na(a)&&(e=!0);for(var g=x.P(),h=this.pb.o,k=h.length;k--;){var l=h[k];!0===e&&!1===Ri(l)||!l.isVisible()||(g.assign(a),rb(g,l.mh),l.sp(g,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l)))}x.A(g);return d};
bf.prototype.findObjectsIn=bf.prototype.sk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof J||e instanceof K||(e=new K(O));if(!1===this.ql)return e;u&&!a.G()&&x.k("findObjectsIn: Rect must have a real value, not: "+a.toString());var g=!1;this.h.Ab.pk(a)&&(g=!0);for(var h=this.pb.o,k=h.length;k--;){var l=h[k];(!0!==g||!1!==Ri(l))&&l.isVisible()&&l.sk(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}return e};
bf.prototype.nA=function(a,b,c,d,e,g,h){if(!1===this.ql)return e;for(var k=this.pb.o,l=k.length;l--;){var m=k[l];(!0!==h||!1!==Ri(m))&&g(m)&&m.isVisible()&&m.sk(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}return e};
bf.prototype.findObjectsNear=bf.prototype.mn=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 J||e instanceof K)g=e;e=!0}g instanceof J||g instanceof K||(g=new K(O));if(!1===this.ql)return g;u&&!a.G()&&x.k("findObjectsNear: Point must have a real value, not: "+a.toString());var h=!1;this.h.Ab.Na(a)&&(h=!0);for(var k=x.P(),l=x.P(),m=this.pb.o,n=m.length;n--;){var p=m[n];!0===h&&!1===Ri(p)||!p.isVisible()||(k.assign(a),rb(k,p.mh),
l.n(a.x+b,a.y),rb(l,p.mh),p.mn(k,l,c,d,e,g)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||g.add(p)))}x.A(k);x.A(l);return g};f=bf.prototype;f.Lf=function(a,b){if(this.visible){var c;c=void 0===b?a.Ab:b;for(var d=this.pb.o,e=d.length,g=0;g<e;g++){var h=d[g];h.UC=g;if(!(h instanceof G&&!1===h.Yf)){if(h instanceof fa){var k=h;if(null!==k.lh)continue}if(Db(h.ba,c))for(h.Lf(!0),bj(h),h=h.Lw;h.next();)k=h.value,ji(k,Infinity,Infinity),k.Kc(),k.Lf(!0);else h.Lf(!1),null!==h.Lw&&0<h.Lw.count&&bj(h)}}}};
f.gf=function(a,b,c,d){if(this.visible&&0!==this.Xc&&(void 0===d&&(d=!0),d||!this.Nc)){1!==this.Xc&&(a.globalAlpha=this.Xc);c=this.$v;c.length=0;d=b.scale;for(var e=this.pb.o,g=e.length,h=0;h<g;h++){var k=e[h];if(Ri(k)||cj(k)){if(k instanceof G){var l=k;l.sc&&c.push(l);if(!1===l.Yf)continue}l=k.ba;1<l.width*d||1<l.height*d?k.gf(a,b):dj(k,a)}}a.globalAlpha=1}};
function ej(a,b,c,d){if(a.visible&&0!==a.Xc){1!==a.Xc&&(b.globalAlpha=a.Xc);var e=a.$v;e.length=0;var g=c.scale;a=a.pb.o;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(Ri(m)||cj(m)){if(m instanceof G){var n=m;n.sc&&e.push(n);if(!1===n.Yf)continue}var n=fj(m,m.ba),p;a:{p=n;for(var q=d,r=k,s=2/g,t=4/g,v=0;v<r;v++){var y=q[v];if(0!==y.width&&0!==y.height&&p.eF(y.x-s,y.y-s,y.width+t,y.height+t)){p=!0;break a}}p=!1}p&&(1<n.width*g||1<n.height*g?m.gf(b,c):dj(m,b))}}b.globalAlpha=1}}
f.j=function(a,b,c,d,e){var g=this.h;null!==g&&g.Rc(we,a,this,b,c,d,e)};f.Dp=function(a,b,c){var d=this.pb;b.Jv=this;if(a>=d.count)a=d.count;else if(d.ia(a)===b)return-1;d.Nd(a,b);b.It(c);d=this.h;null!==d&&(c?d.ua():d.Dp(b));gj(this,a,b);return a};
f.We=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.We(a,b,c);var d=this.pb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ia(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Jt(c);d.dd(a);d=this.h;null!==d&&(c?d.ua():d.We(b));b.Jv=null;return a};
function gj(a,b,c){b=hj(a,b,c);if(c instanceof F&&null!==c&&isNaN(c.Kn)){if(0!==c.Gc.count){for(var d=-1,e=a.pb.o,g=e.length,h=0;h<g;h++){var k=e[h];if(k===c&&(b=h,0<=d))break;if(0>d&&k.Xa===c&&(d=h,0<=b))break}!(0>d)&&d<b&&(e=a.pb,e.dd(b),e.Nd(d,c))}c=c.Xa;null!==c&&gj(a,-1,c)}}
function hj(a,b,c){var d=c.Kn;if(isNaN(d))return b;a=a.pb;var e=a.count;if(1>=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var g=b-1,h=NaN;0<=g;){h=a.ia(g).Kn;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;k<e;){l=a.ia(k).Kn;if(!isNaN(l))break;k++}if(!isNaN(h)&&h>d)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.dd(b);a.Nd(g,c);return g}for(h=NaN;0<=--g&&(h=a.ia(g).Kn,isNaN(h)););}else if(!isNaN(l)&&l<d)for(;;){if(k===e||l>=d){k--;if(k===b)break;a.dd(b);a.Nd(k,c);return k}for(l=NaN;++k<e&&(l=a.ia(k).Kn,
isNaN(l)););}return b}f.clear=function(){for(var a=this.pb.kc(),b=a.length,c=0;c<b;c++)a[c].Lf(!1),this.We(-1,a[c],!1)};x.w(bf,{sj:"parts"},function(){return this.pb.i});x.w(bf,{aM:"partsBackwards"},function(){return this.pb.un});x.w(bf,{h:"diagram"},function(){return this.W});
x.defineProperty(bf,{name:"name"},function(){return this.Vb},function(a){x.g(a,"string",bf,"name");var b=this.Vb;if(b!==a){var c=this.h;if(null!==c)for(""===b&&x.k("Cannot rename default Layer to: "+a),c=c.vn;c.next();)c.value.name===a&&x.k("Layer.name is already present in this diagram: "+a);this.Vb=a;this.j("name",b,a);for(a=this.pb.i;a.next();)a.value.Jf=this.Vb}});
x.defineProperty(bf,{opacity:"opacity"},function(){return this.Xc},function(a){var b=this.Xc;b!==a&&(x.g(a,"number",bf,"opacity"),(0>a||1<a)&&x.la(a,"0 <= value <= 1",bf,"opacity"),this.Xc=a,this.j("opacity",b,a),a=this.h,null!==a&&a.ua())});x.defineProperty(bf,{Nc:"isTemporary"},function(){return this.nz},function(a){var b=this.nz;b!==a&&(x.g(a,"boolean",bf,"isTemporary"),this.nz=a,this.j("isTemporary",b,a))});
x.defineProperty(bf,{visible:"visible"},function(){return this.Qz},function(a){var b=this.Qz;if(b!==a){x.g(a,"boolean",bf,"visible");this.Qz=a;this.j("visible",b,a);for(b=this.pb.i;b.next();)b.value.Qd(a);a=this.h;null!==a&&a.ua()}});x.defineProperty(bf,{ig:"pickable"},function(){return this.ql},function(a){var b=this.ql;b!==a&&(x.g(a,"boolean",bf,"pickable"),this.ql=a,this.j("pickable",b,a))});
x.defineProperty(bf,{hF:"isBoundsIncluded"},function(){return this.iz},function(a){this.iz!==a&&(this.iz=a,null!==this.h&&this.h.xc())});x.defineProperty(bf,{nk:"allowCopy"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(x.g(a,"boolean",bf,"allowCopy"),this.Gk=a,this.j("allowCopy",b,a))});x.defineProperty(bf,{Zm:"allowDelete"},function(){return this.Hk},function(a){var b=this.Hk;b!==a&&(x.g(a,"boolean",bf,"allowDelete"),this.Hk=a,this.j("allowDelete",b,a))});
x.defineProperty(bf,{Pw:"allowTextEdit"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(x.g(a,"boolean",bf,"allowTextEdit"),this.Qk=a,this.j("allowTextEdit",b,a))});x.defineProperty(bf,{Mw:"allowGroup"},function(){return this.Ik},function(a){var b=this.Ik;b!==a&&(x.g(a,"boolean",bf,"allowGroup"),this.Ik=a,this.j("allowGroup",b,a))});
x.defineProperty(bf,{Qw:"allowUngroup"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(x.g(a,"boolean",bf,"allowUngroup"),this.Rk=a,this.j("allowUngroup",b,a))});x.defineProperty(bf,{gt:"allowLink"},function(){return this.Jk},function(a){var b=this.Jk;b!==a&&(x.g(a,"boolean",bf,"allowLink"),this.Jk=a,this.j("allowLink",b,a))});
x.defineProperty(bf,{$m:"allowRelink"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(x.g(a,"boolean",bf,"allowRelink"),this.Lk=a,this.j("allowRelink",b,a))});x.defineProperty(bf,{yl:"allowMove"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(x.g(a,"boolean",bf,"allowMove"),this.Kk=a,this.j("allowMove",b,a))});
x.defineProperty(bf,{Nw:"allowReshape"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(x.g(a,"boolean",bf,"allowReshape"),this.Mk=a,this.j("allowReshape",b,a))});x.defineProperty(bf,{ht:"allowResize"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(x.g(a,"boolean",bf,"allowResize"),this.Nk=a,this.j("allowResize",b,a))});
x.defineProperty(bf,{Ow:"allowRotate"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(x.g(a,"boolean",bf,"allowRotate"),this.Ok=a,this.j("allowRotate",b,a))});x.defineProperty(bf,{yf:"allowSelect"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(x.g(a,"boolean",bf,"allowSelect"),this.Pk=a,this.j("allowSelect",b,a))});
function z(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);ij(c)}1<arguments.length&&x.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");x.lc(this);jj=[];this.gd=!0;this.PB=new tf;this.PB.Sc(this);this.Jd=17;var c=this;null!==window.document.body?ij(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.PC=!1;this.Zb=new J(bf);this.Qb=this.Lb=0;this.Zj=this.Ub=this.Ze=this.nb=null;this.OF();this.yo=null;this.NF();
this.fb=(new N(NaN,NaN)).freeze();this.dc=1;this.zv=(new N(NaN,NaN)).freeze();this.Av=NaN;this.Rv=1E-4;this.Ov=100;this.Ld=new Ha;this.Jw=(new N(NaN,NaN)).freeze();this.qv=(new w(NaN,NaN,NaN,NaN)).freeze();this.mw=(new yb(0,0,0,0)).freeze();this.nw=kj;this.jw=this.fw=null;this.km=Nf;this.Un=Jc;this.cl=Nf;this.vo=Jc;this.Bv=this.yv=Xb;this.ue=!0;this.ir=!1;this.pg=new K(O);this.Xk=new ra(G,w);this.lo=!0;this.QB=250;this.Qn=-1;this.Wu=(new yb(16,16,16,16)).freeze();this.jv=this.Xf=!1;this.qo=!0;this.Gi=
new he;this.Zc=new he;this.Rb=new he;this.$g=this.vi=null;this.zw=!1;this.Ty=this.Uy=null;lj(this);this.No=new K(E);this.sl=new K(F);this.Ho=new K(G);this.pb=new K(D);this.Gv=!0;this.Ew=mj;this.FC=!1;this.Gw=fh;this.Oy=this.Ry=this.Nz=null;this.Ny="";this.Sq="auto";this.Ai=this.Yi=this.Ni=this.Uv=this.Oi=this.Pi=this.Qi=this.zi=this.Ei=this.wi=null;this.yz=!1;this.mD={};this.ew=0;this.Wf=[null,null];this.Iy=null;this.On=this.Sy=this.Gz=this.vD=this.Vi=!1;this.RC=!0;this.kz=this.Vd=!1;this.Fz=this.Ez=
0;this.jh="gray";this.di=0;this.fe=null;var d=this;this.YC=function(a){if(a.aa===d.aa&&d.Za){d.Za=!1;try{var b=a.Dc;""===a.rf&&b===we&&nj(d,a.object,a.propertyName)}finally{d.Za=!0}}};this.ZC=function(a){oj(d,a)};this.VD=!0;this.Xg=-2;this.Bi=new ra(Object,D);this.Wk=new ra(Object,G);this.vm=new ra(Object,Array);this.Oo=new ra("string",Array);this.lD=new J(pj);this.Ii=!1;this.Hk=this.Gk=this.Ku=this.af=!0;this.Mu=this.Lu=!1;this.Ru=this.Pu=this.Pk=this.Ok=this.Nk=this.Mk=this.Kk=this.Lk=this.Jk=this.Ou=
this.Rk=this.Ik=this.Qk=!0;this.sm=this.NC=!1;this.Qu=this.Nu=this.wv=this.vv=!0;this.pw=this.lw=16;this.Dz=this.kw=!1;this.vs=this.ow=null;this.sD=this.tD=0;this.df=(new yb(5)).freeze();this.sw=(new K(D)).freeze();this.Pv=999999999;this.xv=(new K(D)).freeze();this.dl=this.qm=this.Jj=!0;this.al=this.Ij=!1;this.ee=null;this.Tu=!0;this.Le=!1;this.VG=new K(G);this.DC=new K(qj);this.Gd=null;this.dD=1;this.dz=!1;this.zD=0;this.UD=(new w(NaN,NaN,NaN,NaN)).freeze();this.kv=(new w(NaN,NaN,NaN,NaN)).freeze();
this.aw=new K(rj);sj(this);this.Lv=this.sv=this.Vv=this.iC=this.hC=this.jC=this.Qj=this.Zk=this.Ri=null;tj(this);this.ud=null;this.rv=!1;this.Xn=null;this.vb=new Hf;this.vb.initializeStandardTools();this.eb=this.st=this.vb;this.zb=new ua;this.aa=new X;this.Vi=!0;this.Tb=new df;this.Vi=!1;this.uC=this.Wy=null;this.ge=1;this.fk=null;this.bl=new uj;void 0!==a&&vj(this,a);this.xm=1;this.ym=0;this.TC=new N;this.RD=500;this.Vu=new N;this.Gs=null;this.gd=this.Fv=!1}x.ja("Diagram",z);
function tj(a){a.Ri=new ra("string",D);var b=new E,c=new sa;c.bind(new wf("text","",la));b.add(c);a.jC=b;a.Ri.add("",b);b=new E;c=new sa;c.stroke="brown";c.bind(new wf("text","",la));b.add(c);a.Ri.add("Comment",b);b=new E;b.Ak=!1;b.jE=!1;c=new Y;c.Jb="Ellipse";c.fill="black";c.stroke=null;c.Ba=(new Fa(3,3)).Ma();b.add(c);a.Ri.add("LinkLabel",b);a.Zk=new ra("string",F);b=new F;b.Vx="GROUPPANEL";b.type=wj;c=new sa;c.font="bold 12pt sans-serif";c.bind(new wf("text","",la));b.add(c);c=new H(xj);c.name=
"GROUPPANEL";var d=new Y;d.Jb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Gh;d.padding=(new yb(5,5,5,5)).Ma();c.add(d);b.add(c);a.hC=b;a.Zk.add("",b);a.Qj=new ra("string",G);b=new G;c=new Y;c.Gf=!0;b.add(c);c=new Y;c.kq="Standard";c.fill="black";c.stroke=null;c.yb=0;b.add(c);a.iC=b;a.Qj.add("",b);b=new G;c=new Y;c.Gf=!0;c.stroke="brown";b.add(c);a.Qj.add("Comment",b);b=new fa;b.type=xj;c=new Y;c.fill=null;c.stroke="dodgerblue";c.yb=3;b.add(c);c=new Gh;c.margin=(new yb(1.5,
1.5,1.5,1.5)).Ma();b.add(c);a.Vv=b;a.sv=b;b=new fa;b.type=rh;c=new Y;c.Gf=!0;c.fill=null;c.stroke="dodgerblue";c.yb=3;b.add(c);a.Lv=b}
function ij(a){var b=x.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=x.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);c=d-b;0!==c||x.lF||
(c=11);a.Jd=c}z.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.Il&&this.Il.id&&(b=this.Il.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.Zb.i;c.next();)b+="\n  "+c.value.toString(a-1);return b};z.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.W instanceof z?b.W:null};
x.defineProperty(z,{Il:"div"},function(){return this.Ub},function(a){null!==a&&x.l(a,HTMLDivElement,z,"div");if(this.Ub!==a){jj=[];var b=this.Ub;null!==b?(b.W=void 0,b.innerHTML="",null!==this.nb&&(this.nb.removeEventListener("touchstart",this.vG,!1),this.nb.removeEventListener("touchmove",this.uG,!1),this.nb.removeEventListener("touchend",this.tG,!1),this.nb.Zd.W=null),b=this.vb,null!==b&&(b.sf.each(function(a){a.cancelWaitAfter()}),b.eg.each(function(a){a.cancelWaitAfter()}),b.fg.each(function(a){a.cancelWaitAfter()})),
b.cancelWaitAfter(),this.eb.doCancel(),this.Ze=this.nb=null,window.removeEventListener("resize",this.EG,!1),window.removeEventListener("mousemove",this.Pp,!0),window.removeEventListener("mousedown",this.Op,!0),window.removeEventListener("mouseup",this.Rp,!0),window.removeEventListener("mousewheel",this.wh,!0),window.removeEventListener("DOMMouseScroll",this.wh,!0),window.removeEventListener("mouseout",this.Qp,!0)):this.Le=!1;this.Ub=null;if(null!==a){if(b=a.W)b.Il=null;vj(this,a);this.iu()}}});
function yj(a){var b=a.nb;b.addEventListener("touchstart",a.vG,!1);b.addEventListener("touchmove",a.uG,!1);b.addEventListener("touchend",a.tG,!1);b.addEventListener("mousemove",a.Pp,!1);b.addEventListener("mousedown",a.Op,!1);b.addEventListener("mouseup",a.Rp,!1);b.addEventListener("mousewheel",a.wh,!1);b.addEventListener("DOMMouseScroll",a.wh,!1);b.addEventListener("mouseout",a.Qp,!1);b.addEventListener("keydown",a.$I,!1);b.addEventListener("keyup",a.aJ,!1);b.addEventListener("selectstart",function(a){a.preventDefault();
return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.vb.yp===vi&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.AJ,!1);b.addEventListener("pointermove",a.CJ,!1);b.addEventListener("pointerleave",a.BJ,!1);window.addEventListener("resize",a.EG,!1)}
z.prototype.computePixelRatio=function(){if(null!==this.fk)return this.fk;var a=this.Ze;return(window.devicePixelRatio||1)/(a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||a.backingStorePixelRatio||1)};z.prototype.doMouseMove=function(){this.eb.doMouseMove()};z.prototype.doMouseDown=function(){this.eb.doMouseDown()};z.prototype.doMouseUp=function(){this.eb.doMouseUp()};z.prototype.doMouseWheel=function(){this.eb.doMouseWheel()};
z.prototype.doKeyDown=function(){this.eb.doKeyDown()};z.prototype.doKeyUp=function(){this.eb.doKeyUp()};z.prototype.focus=z.prototype.focus=function(){this.nb&&this.nb.focus()};function Di(a){if(null!==a.nb){var b=a.Ub;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.al?a.Jd:0,d=a.Ij?a.Jd:0,e=a.ge;a.ge=a.computePixelRatio();a.ge!==e&&(a.ir=!0,a.Be());if(b.clientWidth!==a.Lb+c||b.clientHeight!==a.Qb+d)a.qm=!0,a.ue=!0,b=a.Tb,null!==b&&b.yx&&a.Al===Nf&&b.J(),a.Vd||a.Be()}}}
function da(a,b,c){void 0===b&&(b=a.Ze);void 0===c&&(c=!0);c&&(b.Hu="");b.Mn="";b.im=""}function sj(a){var b=new bf;b.name="Background";a.at(b);b=new bf;b.name="";a.at(b);b=new bf;b.name="Foreground";a.at(b);b=new bf;b.name="Adornment";b.Nc=!0;a.at(b);b=new bf;b.name="Tool";b.Nc=!0;b.hF=!0;a.at(b);b=new bf;b.name="Grid";b.yf=!1;b.ig=!1;b.Nc=!0;a.qH(b,a.Kl("Background"))}
function zj(a){a.ud=new H(Aj);a.ud.name="GRID";var b=new Y;b.Jb="LineH";b.stroke="lightgray";b.yb=.5;b.interval=1;a.ud.add(b);b=new Y;b.Jb="LineH";b.stroke="gray";b.yb=.5;b.interval=5;a.ud.add(b);b=new Y;b.Jb="LineH";b.stroke="gray";b.yb=1;b.interval=10;a.ud.add(b);b=new Y;b.Jb="LineV";b.stroke="lightgray";b.yb=.5;b.interval=1;a.ud.add(b);b=new Y;b.Jb="LineV";b.stroke="gray";b.yb=.5;b.interval=5;a.ud.add(b);b=new Y;b.Jb="LineV";b.stroke="gray";b.yb=1;b.interval=10;a.ud.add(b);b=new D;b.add(a.ud);
b.Jf="Grid";b.Kn=0;b.vx=!1;b.gF=!1;b.ig=!1;b.Ex="GRID";a.add(b);a.pb.remove(b);a.ud.visible=!1}
z.prototype.$G=function(){if(this.W.isEnabled){var a=this.W;if(a.Dz&&null!==a.nb){a.kw=!0;var b=a.Ec,c=a.Ab,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,s;e<d||h<g?(s=x.Xb(a.position.x,a.position.y),a.Qe&&a.sD!==this.scrollLeft&&(s.x=this.scrollLeft/r+p),a.Re&&a.tD!==this.scrollTop&&(s.y=this.scrollTop/r+b),a.position=s,x.A(s),a.kw=!1,a.qm=!1):(s=x.P(),this.cH&&a.Qe&&(p<q&&(a.position=s.n(this.scrollLeft+p,a.position.y)),k>l&&
(a.position=s.n(-(a.ow.scrollWidth-a.Lb)+this.scrollLeft-a.Lb/r+a.Ec.right,a.position.y))),this.dH&&a.Re&&(b<c&&(a.position=s.n(a.position.x,this.scrollTop+b)),m>n&&(a.position=s.n(a.position.x,-(a.ow.scrollHeight-a.Qb)+this.scrollTop-a.Qb/r+a.Ec.bottom))),x.A(s),Bj(a),a.kw=!1,a.qm=!1,b=a.Ec,c=a.Ab,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.vs.style.width="1px"),h>=g&&b>=c&&m<=n&&(a.vs.style.height="1px"))}}else Cj(this.W)};
z.prototype.cD=function(a){this.W.isEnabled?(this.W.Dz=!0,this.W.tD=a.target.scrollTop,this.W.sD=a.target.scrollLeft):Cj(this.W)};z.prototype.computeBounds=z.prototype.oh=function(){0<this.pg.count&&Dj(this);return Ej(this)};
function Ej(a){if(a.SE.G()){var b=a.SE.copy();b.Kw(a.padding);return b}for(var c=!0,d=a.Zb.o,e=d.length,g=0;g<e;g++){var h=d[g];if(h.visible&&(!h.Nc||h.hF))for(var h=h.pb.o,k=h.length,l=0;l<k;l++){var m=h[l];m.vx&&m.isVisible()&&(m=m.ba,m.G()&&(c?(c=!1,b=m.copy()):b.si(m)))}}c&&(b=new w(0,0,0,0));b.Kw(a.padding);return b}
z.prototype.computePartsBounds=function(a){var b=null;for(a=a.i;a.next();){var c=a.value;c instanceof G||(c.Af(),null===b?b=c.ba.copy():b.si(c.ba))}return null===b?new w(NaN,NaN,0,0):b};
function Fj(a,b){if((b||a.Le)&&!a.gd&&null!==a.nb&&!a.$a.Df&&a.Ec.G()){a.gd=!0;var c=a.km;b&&a.cl!==Nf&&(c=a.cl);var d=c!==Nf?Gj(a,c):a.scale,c=a.Ab.copy(),e=a.Lb/d,g=a.Qb/d,h=null,k=a.$a;k.Bc&&(h=a.fb.copy());a.position.Va();var l=a.Un;b&&!l.cd()&&a.vo.cd()&&(l=a.vo);Hj(a,a.fb,a.Ec,e,g,l,b);a.position.freeze();null!==h&&Pi(k,h,a.fb);a.scale=d;a.gd=!1;d=a.Ab;d.wd(c)||a.fu(c,d)}}
function Gj(a,b){var c=a.zb.$w;if(null===a.nb)return c;a.Jj&&Ij(a,a.oh());var d=a.Ec;if(!d.G())return c;var e=d.width,d=d.height,g=a.Lb,h=a.Qb,k=g/e,l=h/d;return b===Jj?(e=Math.min(l,k),e>c&&(e=c),e<a.vh&&(e=a.vh),e>a.uh&&(e=a.uh),e):b===Kj?(e=l>k?(h-a.Jd)/d:(g-a.Jd)/e,e>c&&(e=c),e<a.vh&&(e=a.vh),e>a.uh&&(e=a.uh),e):a.scale}z.prototype.zoomToFit=z.prototype.zoomToFit=function(){this.scale=Gj(this,Jj)};
z.prototype.zoomToRect=function(a,b){void 0===b&&(b=Jj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Jj||b===Kj)if(isNaN(c))e=this.Ab.height*this.scale/d;else if(isNaN(d))e=this.Ab.width*this.scale/c;else var e=this.Lb,g=this.Qb,e=b===Kj?g/d>e/c?(g-(this.Ij?this.Jd:0))/d:(e-(this.al?this.Jd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new N(a.x,a.y)}};x.defineProperty(z,{xA:null},function(){return this.gd},function(a){this.gd=a});
z.prototype.alignDocument=function(a,b){this.Jj&&Ij(this,this.oh());var c=this.Ec,d=this.Ab;this.position=new N(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))};
function Hj(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.eB===kj)g.cd()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.YF,h=d-c.width,d<c.width+g.left+g.right?(k=Math.min(k+d/2,c.right+Math.max(h,g.right)-d/2),k=Math.max(k,c.left-Math.max(h,g.left)+d/2),k-=d/2):k>c.left?k=c.left:k<c.right-d&&(k=c.right-d),d=e-c.height,e<c.height+g.top+g.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,g.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
g.top)+e/2),l-=e/2):l>c.top?l=c.top:l<c.bottom-e&&(l=c.bottom-e);b.x=isFinite(k)?k:-a.padding.left;b.y=isFinite(l)?l:-a.padding.top;null!==a.GF&&(a=a.GF(a,b),b.x=a.x,b.y=a.y)}z.prototype.findPartAt=z.prototype.yt=function(a,b){var c=b?Pg(this,a,function(a){return a.ea},function(a){return a.canSelect()}):Pg(this,a,function(a){return a.ea});return c instanceof D?c:null};
z.prototype.findObjectAt=z.prototype.ne=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);Dj(this);for(var d=this.Zb.un;d.next();){var e=d.value;if(e.visible&&(e=e.ne(a,b,c),null!==e))return e}return null};function Pg(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);Dj(a);for(a=a.Zb.un;a.next();){var e=a.value;if(e.visible&&!e.Nc&&(e=e.ne(b,c,d),null!==e))return e}return null}
z.prototype.findObjectsAt=z.prototype.sp=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new K(O));Dj(this);for(var e=this.Zb.un;e.next();){var g=e.value;g.visible&&g.sp(a,b,c,d)}return d};z.prototype.findObjectsIn=z.prototype.sk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof J||e instanceof K||(e=new K(O));Dj(this);for(var g=this.Zb.un;g.next();){var h=g.value;h.visible&&h.sk(a,b,c,d,e)}return e};
z.prototype.nA=function(a,b,c,d,e,g){var h=new K(O);Dj(this);for(var k=this.Zb.un;k.next();){var l=k.value;l.visible&&l.nA(a,b,c,d,h,e,g)}return h};z.prototype.findObjectsNear=z.prototype.mn=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 J||e instanceof K)g=e;e=!0}g instanceof J||g instanceof K||(g=new K(O));Dj(this);for(var h=this.Zb.un;h.next();){var k=h.value;k.visible&&k.mn(a,b,c,d,e,g)}return g};
z.prototype.acceptEvent=function(a){var b=this.Zc;this.Zc=this.Rb;this.Rb=b;Lj(this,this,a,b,a instanceof MouseEvent);return b};
function Lj(a,b,c,d,e){d.h=b;d.event=c;e?Mj(a,c,d):(d.te=b.Rb.te,d.ha=b.Rb.ha);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.yd=a;d.button=c.button;void 0!==c.buttons&&(d.buttons=c.buttons);x.wk&&0===c.button&&c.ctrlKey&&(d.button=2);d.Jl=!1;d.up=!1;d.ff=1;d.Hl=0;d.Mc=!1;d.bubbles=!1;d.timestamp=Date.now();d.Ot=!1;d.Mg=c.target.W?c.target.W:null;d.Ee=null}
function Nj(a,b,c,d,e){d.h=a;Mj(a,c,d);d.yd=0;d.button=0;d.buttons=1;d.Jl=!0;d.up=!1;d.ff=1;d.Hl=0;d.Mc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Ot=e;d.Mg=b.target.W?b.target.W:null;d.Ee=null;a.Gi=d.copy();gg=null}
function Oj(a,b,c,d,e){var g=null;d.h=a;null!==c?((g=window.document.elementFromPoint(c.clientX,c.clientY))&&g.W?g=g.W:(c=b.changedTouches[0],g=a),d.Mg=g,Mj(a,c,d)):null!==a.Zc?(d.ha=a.Zc.ha,d.te=a.Zc.te,d.Mg=a.Zc.Mg):null!==a.Gi&&(d.ha=a.Gi.ha,d.te=a.Gi.te,d.Mg=a.Gi.Mg);d.yd=0;d.button=0;d.buttons=1;d.Jl=!1;d.up=!1;d.ff=1;d.Hl=0;d.Mc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.Ot=e;d.Ee=null}
function ja(a,b,c){if(b.bubbles)return u&&u.bF&&x.trace("NOT handled "+c.type+" "+b.toString()),!0;u&&u.bF&&x.trace("handled "+c.type+" "+a.eb.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();(void 0===c.touches||2>c.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1}
z.prototype.$I=function(a){if(!this.W.isEnabled)return!1;var b=this.W.Rb;Lj(this.W,this.W,a,b,!1);b.key=String.fromCharCode(a.which);b.Jl=!0;switch(a.which){case 8:b.key="Backspace";break;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:case 61:case 107:b.key=
"Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.W.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?ja(this.W,b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)};
z.prototype.aJ=function(a){if(!this.W.isEnabled)return!1;var b=this.W.Rb;Lj(this.W,this.W,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;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 93:a.preventDefault()}this.W.doKeyUp();
return ja(this.W,b,a)};z.prototype.to=function(a){var b=this.nb;if(null===b)return new N(0,0);var c=this.Lb,d=this.Qb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Ld?(a=new N(c,a),rb(a,this.Ld),a):new N(c,a)};
function Mj(a,b,c){var d=a.nb,e=a.Lb,g=a.Qb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-g/d.height*d.top);c.te.n(h,k);null!==a.Ld?(b=x.Xb(h,k),a.Ld.oi(b),c.ha.assign(b),x.A(b)):c.ha.n(h,k)}z.prototype.invalidateDocumentBounds=z.prototype.xc=function(){this.Jj||(this.Jj=!0,this.Be(!0))};function Mi(a){a.Vd||Dj(a);a.Jj&&Ij(a,a.oh())}z.prototype.redraw=z.prototype.iu=function(){this.gd||this.Vd||(this.ua(),Pj(this),Bj(this),this.xc(),this.dg())};
z.prototype.isUpdateRequested=function(){return this.Xf};z.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.$a,c=b.isEnabled;b.uj();b.isEnabled=!1;Wg(this);this.Le=!1;b.isEnabled=c;null!==a&&x.setTimeout(a,1)};z.prototype.requestUpdate=z.prototype.Be=function(a){void 0===a&&(a=!1);if(!0!==this.Xf&&!(this.gd||!1===a&&this.Vd)){this.Xf=!0;var b=this;requestAnimationFrame(function(){b.Xf&&b.dg()})}};
z.prototype.maybeUpdate=z.prototype.dg=function(){if(!this.qo||this.Xf)this.qo&&(this.qo=!1),Wg(this)};function Qj(a,b){a.$a.Df||a.gd||!a.qm||Cj(a)||(b&&Dj(a),Fj(a,!1))}
function Wg(a){if(!a.Vd&&(a.Xf=!1,null!==a.Ub)){a.Vd=!0;var b=a.$a,c=a.lD;if(!b.Bo&&0!==c.length){for(var d=c.o,e=d.length,g=0;g<e;g++){var h=d[g];Rj(h,!1);h.T()}c.clear()}c=a.DC;0<c.count&&(c.each(function(a){a.uB()}),c.clear());d=c=!1;b.Df&&(d=!0,c=a.xb,a.xb=!0);b.Bc||Di(a);Qj(a,!1);null!==a.ud&&(a.ud.visible&&!a.rv&&(Sj(a),a.rv=!0),!a.ud.visible&&a.rv&&(a.rv=!1));Dj(a);e=!1;if(!a.Le||a.Tu)a.Le?Tj(a,!a.jv):(a.Wb("Initial Layout"),!1===b.isEnabled&&b.uj(),Tj(a,!1)),e=!0;a.jv=!1;Dj(a);a.Gz||b.Df||
Mi(a);Qj(a,!0);e&&(a.Le||Uj(a),a.Ja("LayoutCompleted"));Dj(a);e&&!a.Le&&(a.Le=!0,a.Md("Initial Layout"),a.xb||a.qa.clear(),x.setTimeout(function(){a.qi=!1},1));Vj(a);Ci(b);a.gf();d&&(a.xb=c);a.Vd=!1}}
function Uj(a){var b=a.Zb.o;a.Lf(b,b.length,a);a.cl!==Nf?a.scale=Gj(a,a.cl):a.km!==Nf?a.scale=Gj(a,a.km):(b=a.JI,isFinite(b)&&0<b&&(a.scale=b));b=a.II;if(b.G())a.position=b;else{b=x.P();b.su(a.Ec,a.HI);var c=a.Ab,c=x.Dk(0,0,c.width,c.height),d=x.P();d.su(c,a.KI);d.n(b.x-d.x,b.y-d.y);a.position=d;x.qc(c);x.A(d);x.A(b);Qj(a,!0);Fj(a,!0)}a.Ja("InitialLayoutCompleted");Sj(a)}
function Dj(a){if((a.Vd||!a.$a.Df)&&0!==a.pg.count)for(var b=0;23>b;b++){var c=a.pg.i;if(null===c||0===a.pg.count)break;a.pg=new K(O);a.uB(c,a.pg);u&&22===b&&x.trace("failure to validate parts")}}
z.prototype.uB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.$d()||c instanceof F||!c.isVisible()||(c.Vl()?(ji(c,Infinity,Infinity),c.Kc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof F&&c.isVisible()&&Wj(this,c);for(a.reset();a.next();)c=a.value,c instanceof G&&c.isVisible()&&(c.Vl()?(ji(c,Infinity,Infinity),c.Kc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof fa&&c.isVisible()&&(c.Vl()?(ji(c,Infinity,Infinity),c.Kc()):b.add(c))};
function Wj(a,b){for(var c=x.ub(),d=x.ub(),e=b.Gc;e.next();){var g=e.value;g.isVisible()&&(g instanceof F?(Xj(g)||Yj(g)||Zj(g))&&Wj(a,g):g instanceof G?g.Z===b||g.fa===b?d.push(g):c.push(g):(ji(g,Infinity,Infinity),g.Kc()))}for(var e=c.length,h=0;h<e;h++)g=c[h],ji(g,Infinity,Infinity),g.Kc();x.xa(c);ji(b,Infinity,Infinity);b.Kc();e=d.length;for(h=0;h<e;h++)g=d[h],ji(g,Infinity,Infinity),g.Kc();x.xa(d)}z.prototype.Lf=function(a,b,c,d){var e=this.$a;if(this.dl||e.Df)for(e=0;e<b;e++)a[e].Lf(c,d)};
z.prototype.gf=function(a,b){void 0===a&&(a=this.Ze);void 0===b&&(b=null);null===this.Ub&&x.k("No div specified");var c=this.nb;null===c&&x.k("No canvas specified");var d=this.$a;if(!d.Bc){ak(this);var e=a!==this.Ze,g=this.Zb.o,h=g.length,k=this;this.Lf(g,h,k);if(e)da(this,a),Bj(this);else if(!this.ue&&null===b&&!d.Kj)return;var h=this.fb,l=this.dc,m=Math.round(h.x*l)/l,n=Math.round(h.y*l)/l,d=this.Ld;d.reset();1!==l&&d.scale(l);0===h.x&&0===h.y||d.translate(-m,-n);l=this.ge;x.tn?(c.width=c.width,
da(this,a),a.scale(l,l)):(a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.clearRect(0,0,this.Lb,this.Qb));a.miterLimit=9;a.setTransform(1,0,0,1,0,0);a.scale(l,l);a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);u&&u.dj&&u.JE(this,a);c=null!==b?function(c){var d=a,e=b;if(c.visible&&0!==c.Xc){1!==c.Xc&&(d.globalAlpha=c.Xc);var g=c.$v;g.length=0;var h=k.scale;c=c.pb.o;for(var l=c.length,m=0;m<l;m++){var n=c[m];if((Ri(n)||cj(n))&&!e.contains(n)){if(n instanceof G){var B=n;B.sc&&g.push(B);if(!1===B.Yf)continue}B=
n.ba;1<B.width*h||1<B.height*h?n.gf(d,k):dj(n,d)}}d.globalAlpha=1}}:function(b){b.gf(a,k)};bk(this,a);h=g.length;for(m=0;m<h;m++)a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c(g[m]);this.bl?this.bl.fm(this)&&this.Ay():this.to=function(){return new N(0,0)};u&&(u.jA||u.dj)&&u.iA(a,this,d);e?(da(this),Bj(this)):this.ue=this.dl=!1}};
function ck(a,b,c,d,e){null===a.Ub&&x.k("No div specified");var g=a.nb;null===g&&x.k("No canvas specified");if(!a.$a.Bc){var h=a.Ze;if(a.ue){ak(a);var k=a.ge;x.tn?(g.width=g.width,da(a,h)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Lb*k,a.Qb*k));h.dF=!1;h.drawImage(a.Wy.Zd,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.fb;var g=a.dc,l=Math.round(e.x*g)/g,m=Math.round(e.y*g)/g;d=a.Ld;d.reset();1!==g&&d.scale(g);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(g=0;g<e;g++)l=
c[g],0!==l.width&&0!==l.height&&h.rect(Math.floor(l.x),Math.floor(l.y),Math.ceil(l.width),Math.ceil(l.height));h.clip();h.setTransform(1,0,0,1,0,0);h.scale(k,k);h.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);u&&u.dj&&u.JE(a,h);c=a.Zb.o;e=c.length;a.Lf(c,e,a);bk(a,h);for(g=0;g<e;g++)ej(c[g],h,a,b);h.restore();da(a);u&&(u.jA||u.dj)&&u.iA(h,a,d);a.bl?a.bl.fm(a)&&a.Ay():a.to=function(){return new N(0,0)};a.dl=!1;a.ue=!1;a.$A()}}}
function dk(a,b,c,d,e,g,h,k,l,m){null===a.Ub&&x.k("No div specified");null===a.nb&&x.k("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);ak(a);da(a);Bj(a);a.kz=!0;var n=new w(g.x,g.y,d.width/e,d.height/e),p=n.copy();p.Kw(c);Sj(a,p);Dj(a);var p=a.Zb.o,q=p.length;a.Lf(p,q,a,n);var r=a.ge;b.setTransform(1,0,0,1,0,0);b.scale(r,r);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));d=x.Ih();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);x.jf(d);bk(a,b);if(null!==h){var s=new K(O);c=h.i;for(c.reset();c.next();)e=c.value,!1===m&&"Grid"===e.layer.name||null===e||s.add(e);c=function(c){var d=l;if(c.visible&&0!==c.Xc&&(void 0===d&&(d=!0),d||!c.Nc)){1!==c.Xc&&(b.globalAlpha=c.Xc);d=c.$v;d.length=0;var e=a.scale;c=c.pb.o;for(var g=c.length,h=0;h<g;h++){var k=c[h];if((Ri(k)||cj(k))&&s.contains(k)){if(k instanceof
G){var m=k;m.sc&&d.push(m);if(!1===m.Yf)continue}m=k.ba;1<m.width*e||1<m.height*e?k.gf(b,a):dj(k,b)}}b.globalAlpha=1}}}else if(!l&&m){var t=a.Ft.ea,v=t.layer;c=function(c){c===v?t.gf(b,a):c.gf(b,a,n,l,m)}}else c=function(c){c.gf(b,a,n,l,m)};for(e=0;e<q;e++)c(p[e]);a.kz=!1;a.bl?a.bl.fm(a)&&a.Ay():a.to=function(){return new N(0,0)};da(a);Bj(a);a.Lf(p,q,a);Sj(a)}z.prototype.getRenderingHint=z.prototype.vk=function(a){return this.Zj[a]};
z.prototype.setRenderingHint=z.prototype.VJ=function(a,b){this.Zj[a]=b;this.iu()};z.prototype.resetRenderingHints=z.prototype.OF=function(){this.Zj=new pa;this.Zj.drawShadows=!0;this.Zj.textGreeking=!0;this.Zj.viewportOptimizations=x.lF?!1:!0;this.Zj.temporaryPixelRatio=!0;this.Zj.pictureRatioOptimization=!0};function bk(a,b){var c=a.Zj;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.dF=d;b.NL=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c,b.Hu=c)}}
z.prototype.getInputOption=z.prototype.zp=function(a){return this.yo[a]};z.prototype.setInputOption=function(a,b){this.yo[a]=b};z.prototype.resetInputOptions=z.prototype.NF=function(){this.yo=new pa;this.yo.extraTouchArea=10;this.yo.extraTouchThreshold=10;this.yo.hasGestureZoom=!0};z.prototype.setProperties=function(a){x.ru(this,a)};function Vj(a){if(0===a.qa.Jh&&0!==a.Xk.count){for(;0<a.Xk.count;){var b=a.Xk;a.Xk=new ra(G,w);for(b=b.i;b.next();){var c=b.key;vh(c,b.value);c.nf()}}a.ua()}}
z.prototype.ua=function(a){void 0===a&&(a=null);if(null===a)this.ue=!0,this.Be();else{var b=this.Ab;null!==a&&a.G()&&b.Hg(a)&&(this.ue=!0,this.Be())}for(b=this.aw.i;b.next();)b.value.ua(a)};
z.prototype.fF=function(a,b){if(!0!==this.ue){this.ue=!0;var c=!0===this.vk("temporaryPixelRatio");if(!0===this.vk("viewportOptimizations")&&this.eB!==ek&&this.YF.gx(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=x.kg(),g=Math.max(a.x,b.x),h=Math.max(a.y,b.y),k=Math.min(a.x+a.width,b.x+b.width),l=Math.min(a.y+a.height,b.y+b.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(!this.Vd&&(this.Xf=!1,null!==this.Ub)){this.Vd=!0;Vj(this);
this.Ec.G()||Ij(this,this.oh());var m=this.nb;if(null!==m){var n=this.ge,h=this.Lb*n,k=this.Qb*n,g=this.scale*n,d=Math.round(Math.round(b.x*g)-Math.round(a.x*g)),g=Math.round(Math.round(b.y*g)-Math.round(a.y*g)),l=this.Wy,p=this.uC;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.ge,q=70*this.ge,r=Math.max(d,0),s=Math.max(g,0),t=Math.floor(h-r),v=Math.floor(k-s);p.dF=!1;p.drawImage(m.Zd,r,s,t,v,0,0,t,v);this.bl.fm(this)&&p.clearRect(0,0,l,q);var m=x.ub(),p=x.ub(),
v=Math.abs(d),t=Math.abs(g),y=0===r?0:h-v,r=x.Xb(y,0),v=x.Xb(v+y,k);p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));var A=this.Ld;A.reset();A.scale(n,n);1!==this.dc&&A.scale(this.dc);n=this.fb;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&A.translate(-n.x,-n.y);rb(r,A);rb(v,A);m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));y=0===s?0:k-t;r.n(0,y);v.n(h,t+y);p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-
v.x),Math.abs(r.y-v.y)));rb(r,A);rb(v,A);m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));this.bl.fm(this)&&(h=0<d?0:-d,k=0<g?0:-g,r.n(h,k),v.n(l+h,q+k),p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))),rb(r,A),rb(v,A),m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))));x.A(r);x.A(v);Qj(this,!1);ck(this,m,p,d,g);x.xa(m);x.xa(p);this.Vd=!1}}}else this.dg();x.qc(e);c&&(this.fk=1,this.dg(),
this.fk=null,this.$A())}else c?(this.fk=1,this.dg(),this.fk=null,this.$A()):this.dg()}};function Pj(a){!1===a.qm&&(a.qm=!0)}function Bj(a){!1===a.dl&&(a.dl=!0)}function ak(a){!1!==a.ir&&(a.ir=!1,fk(a,a.Lb,a.Qb))}function fk(a,b,c){var d=a.nb,e=a.ge,g=b*e,e=c*e;if(d.width!==g||d.height!==e)d.width=g,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.ue=!0,da(a)}function Qf(a){var b=a.Lb,c=a.Qb;a=a.nb.getBoundingClientRect();return x.Xb(b/a.width*a.left,c/a.height*a.top)}
function Cj(a){var b=a.nb;if(null===b)return!0;var c=a.Ub,d=a.Lb,e=a.Qb,g=a.UD.copy();if(!g.G())return!0;var h=!1,k=a.al?a.Jd:0,l=a.Ij?a.Jd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.al=!1,a.Ij=!1,l=k=0,a.Lb=m,a.Qb=c,h=a.ir=!0;a.qm=!1;var n=a.Ab,p=a.Ec,m=p.width,c=p.height,q=n.width,r=n.height,s=p.x,t=n.x,v=p.right,y=n.right+k,A=p.y,B=n.y,p=p.bottom,n=n.bottom+l,C="1px",M="1px",I=a.scale;a.eB===kj&&m<q+k&&c<r+l||(a.tA&&a.Qe&&(C=1,s+1<t&&(C=Math.max((t-s)*I+a.Lb,C)),v>y+1&&
(C=Math.max((v-y)*I+a.Lb,C)),q+k+1<m&&(C=Math.max((m-q+k)*I+a.Lb,C)),C+="px"),a.uA&&a.Re&&(M=1,A+1<B&&(M=Math.max((B-A)*I+a.Qb,M)),p>n+1&&(M=Math.max((p-n)*I+a.Qb,M)),r+l+1<c&&(M=Math.max((c-r+l)*I+a.Qb,M)),M+="px"));k="1px"!==C;l="1px"!==M;if((!k||!l)&&k||l)l&&(y-=a.Jd),k&&(n-=a.Jd),a.tA&&a.Qe&&(C=1,s+1<t&&(C=Math.max((t-s)*I+a.Lb,C)),v>y+1&&(C=Math.max((v-y)*I+a.Lb,C)),q+1<m&&(C=Math.max((m-q)*I+a.Lb,C)),C+="px"),k="1px"!==C,l=k!==a.Ij?a.Qb-a.Jd:a.Qb,a.uA&&a.Re&&(M=1,A+1<B&&(M=Math.max((B-A)*I+
l,M)),p>n+1&&(M=Math.max((p-n)*I+l,M)),r+1<c&&(M=Math.max((c-r)*I+l,M)),M+="px"),l="1px"!==M;if(a.kw&&k===a.Ij&&l===a.al)return d===a.Lb&&e===a.Qb||a.dg(),!1;k!==a.Ij&&(a.Qb="1px"===C?a.Qb+a.Jd:Math.max(a.Qb-a.Jd,1),h=!0);a.Ij=k;a.vs.style.width=C;l!==a.al&&(a.Lb="1px"===M?a.Lb+a.Jd:Math.max(a.Lb-a.Jd,1),h=!0,a.PC&&(k=x.P(),l?(b.style.left=a.Jd+"px",a.position=k.n(a.fb.x+a.Jd/a.scale,a.fb.y)):(b.style.left="0px",a.position=k.n(a.fb.x-a.Jd/a.scale,a.fb.y)),x.A(k)));a.al=l;a.vs.style.height=M;b=a.ow;
a.tA&&a.Qe&&(q+1<m?b.scrollLeft=(a.position.x-s)*I:s+1<t?b.scrollLeft=b.scrollWidth-b.clientWidth:v>y+1&&(b.scrollLeft=a.position.x*I));a.uA&&a.Re&&(r+1<c?b.scrollTop=(a.position.y-A)*I:A+1<B?b.scrollTop=b.scrollHeight-b.clientHeight:p>n+1&&(b.scrollTop=a.position.y*I));h&&(a.ir=!0);m=a.Lb;c=a.Qb;b.style.width=m+(a.al?a.Jd:0)+"px";b.style.height=c+(a.Ij?a.Jd:0)+"px";a.Dz=!1;return d!==m||e!==c||a.$a.Bc?(n=a.Ab,a.fu(g,n,h),!1):!0}
z.prototype.add=z.prototype.add=function(a){x.l(a,D,z,"add:part");var b=a.h;if(b!==this){null!==b&&x.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.On&&(a.Oj="Tool");var c=a.Jf,b=this.Kl(c);null===b&&(b=this.Kl(""));null===b&&x.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.Dp(99999999,a,a.h===this),0<=c&&this.Rc(ye,"parts",b,null,a,null,c),b.Nc||this.xc(),a.J(gk),c=a.St,null!==
c&&c(a,null,b))}};
z.prototype.Dp=function(a){if(a instanceof E){if(this.No.add(a),a instanceof F){var b=a.Xa;null===b?this.sl.add(a):b.Fm.add(a);b=a.Tb;null!==b&&(b.h=this)}}else a instanceof G?this.Ho.add(a):a instanceof fa||this.pb.add(a);var c=this;hk(a,function(a){ik(c,a)});a.Nb&&a.T();b=a.data;null!==b&&(a instanceof fa||(a instanceof G?this.Wk.add(b,a):this.Bi.add(b,a)),hk(a,function(a){jk(c,a)}));!0!==Yj(a)&&!0!==Zj(a)||this.pg.add(a);kk(a,!0,this);lk(a)?(a.ba.G()&&this.ua(fj(a,a.ba)),this.xc()):a.isVisible()&&
a.ba.G()&&this.ua(fj(a,a.ba));this.Be()};
z.prototype.We=function(a){a.mt();if(a instanceof E){if(this.No.remove(a),a instanceof F){var b=a.Xa;null===b?this.sl.remove(a):b.Fm.remove(a);b=a.Tb;null!==b&&(b.h=null)}}else a instanceof G?this.Ho.remove(a):a instanceof fa||this.pb.remove(a);var c=this;hk(a,function(a){mk(c,a)});b=a.data;null!==b&&(a instanceof fa||(a instanceof G?this.Wk.remove(b):this.Bi.remove(b)),hk(a,function(a){nk(c,a)}));this.pg.remove(a);lk(a)?(a.ba.G()&&this.ua(fj(a,a.ba)),this.xc()):a.isVisible()&&a.ba.G()&&this.ua(fj(a,
a.ba));this.Be()};z.prototype.remove=z.prototype.remove=function(a){x.l(a,D,z,"remove:part");a.lb=!1;a.sh=!1;var b=a.layer;if(null!==b&&b.h===this){a.J(ok);a.ln();var c=b.We(-1,a,!1);0<=c&&this.Rc(ze,"parts",b,a,null,c,null);c=a.St;null!==c&&c(a,b,null)}};z.prototype.removeParts=z.prototype.bB=function(a,b){if(x.isArray(a))for(var c=x.ab(a),d=0;d<c;d++){var e=x.Wa(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new K(D),e.$c(a),c=e.i;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};
z.prototype.copyParts=z.prototype.mp=function(a,b,c){return this.zb.mp(a,b,c)};z.prototype.moveParts=z.prototype.moveParts=function(a,b,c){x.l(b,N,z,"moveParts:offset");var d=this.vb;if(null!==d){d=d.ke;null===d&&(d=new Mf,d.Sc(this));var e=new ra(D,Object);if(null!==a)a=a.i;else{for(a=this.sj;a.next();)jg(d,e,a.value,c);for(a=this.yh;a.next();)jg(d,e,a.value,c);a=this.links}for(;a.next();)jg(d,e,a.value,c);d.moveParts(e,b,c)}};
function pk(a,b,c){x.l(b,bf,z,"addLayer:layer");null!==b.h&&b.h!==a&&x.k("Cannot share a Layer with another Diagram: "+b+" of "+b.h);null===c?null!==b.h&&x.k("Cannot add an existing Layer to this Diagram again: "+b):(x.l(c,bf,z,"addLayer:existingLayer"),c.h!==a&&x.k("Existing Layer must be in this Diagram: "+c+" not in "+c.h),b===c&&x.k("Cannot move a Layer before or after itself: "+b));if(b.h!==a){b=b.name;a=a.Zb;c=a.count;for(var d=0;d<c;d++)a.ia(d).name===b&&x.k("Cannot add Layer with the name '"+
b+"'; a Layer with the same name is already present in this Diagram.")}}z.prototype.addLayer=z.prototype.at=function(a){pk(this,a,null);a.Sc(this);var b=this.Zb,c=b.count-1;if(!a.Nc)for(;0<=c&&b.ia(c).Nc;)c--;b.Nd(c+1,a);null!==this.fe&&this.Rc(ye,"layers",this,null,a,null,c+1);this.ua();this.xc()};
z.prototype.addLayerBefore=z.prototype.qH=function(a,b){pk(this,a,b);a.Sc(this);var c=this.Zb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.fe&&this.Rc(ze,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.ia(g)===b){c.Nd(g,a);break}null!==this.fe&&this.Rc(ye,"layers",this,null,a,null,g);this.ua();0>d&&this.xc()};
z.prototype.addLayerAfter=function(a,b){pk(this,a,b);a.Sc(this);var c=this.Zb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.fe&&this.Rc(ze,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.ia(g)===b){c.Nd(g+1,a);break}null!==this.fe&&this.Rc(ye,"layers",this,null,a,null,g+1);this.ua();0>d&&this.xc()};
z.prototype.removeLayer=function(a){x.l(a,bf,z,"removeLayer:layer");a.h!==this&&x.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.h);if(""!==a.name){var b=this.Zb,c=b.indexOf(a);if(b.remove(a)){for(b=a.pb.copy().i;b.next();){var d=b.value,e=d.Jf;d.Jf=e!==a.name?e:""}null!==this.fe&&this.Rc(ze,"layers",this,a,null,c,null);this.ua();this.xc()}}};z.prototype.findLayer=z.prototype.Kl=function(a){for(var b=this.vn;b.next();){var c=b.value;if(c.name===a)return c}return null};
z.prototype.addModelChangedListener=z.prototype.sH=function(a){x.g(a,"function",z,"addModelChangedListener:listener");null===this.$g&&(this.$g=new J("function"));this.$g.add(a);this.aa.Ym(a)};z.prototype.removeModelChangedListener=function(a){x.g(a,"function",z,"removeModelChangedListener:listener");null!==this.$g&&(this.$g.remove(a),0===this.$g.count&&(this.$g=null));this.aa.ju(a)};
z.prototype.addChangedListener=z.prototype.Ym=function(a){x.g(a,"function",z,"addChangedListener:listener");null===this.vi&&(this.vi=new J("function"));this.vi.add(a)};z.prototype.removeChangedListener=z.prototype.ju=function(a){x.g(a,"function",z,"removeChangedListener:listener");null!==this.vi&&(this.vi.remove(a),0===this.vi.count&&(this.vi=null))};
z.prototype.Uw=function(a){this.xb||this.qa.aF(a);a.Dc!==xe&&(this.qi=!0);if(null!==this.vi){var b=this.vi,c=b.length;if(1===c)b=b.ia(0),b(a);else if(0!==c)for(var d=b.kc(),e=0;e<c;e++)b=d[e],b(a)}};z.prototype.raiseChangedEvent=z.prototype.Rc=function(a,b,c,d,e,g,h){void 0===g&&(g=null);void 0===h&&(h=null);var k=new ve;k.h=this;k.Dc=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Kg=g;k.newValue=e;k.Ig=h;this.Uw(k)};
z.prototype.raiseChanged=z.prototype.j=function(a,b,c,d,e){this.Rc(we,a,this,b,c,d,e)};x.w(z,{$a:"animationManager"},function(){return this.PB});x.w(z,{qa:"undoManager"},function(){return this.fe.qa});x.defineProperty(z,{xb:"skipsUndoManager"},function(){return this.Vi},function(a){x.g(a,"boolean",z,"skipsUndoManager");this.Vi=a;this.fe.Vi=a});x.defineProperty(z,{hA:"delaysLayout"},function(){return this.Sy},function(a){this.Sy=a});
z.prototype.bn=function(a,b){if(null!==a&&a.h===this){var c=a.Dc;if(c===we){var d=a.object,c=a.propertyName,e=a.oa(b);x.Ra(d,c,e);d instanceof O&&(d=d.ea,null!==d&&d.oe());this.qi=!0}else if(c===ye){e=a.object;c=a.Ig;d=a.newValue;if(e instanceof H)if("number"===typeof c&&d instanceof O){var g=e;b?g.We(c):g.Nd(c,d);d=e.ea;null!==d&&d.oe()}else"number"===typeof c&&d instanceof sf&&(g=e,b?d.qe?g.MF(c):g.IF(c):(c=d.qe?g.nd(d.index):g.md(d.index),c.qt(d)));else e instanceof bf?(g=!0===a.Kg,"number"===
typeof c&&d instanceof D&&(b?(d.oe(),e.We(g?c:-1,d,g)):e.Dp(c,d,g))):e instanceof z?"number"===typeof c&&d instanceof bf&&(e=d,b?this.Zb.dd(c):(e.Sc(this),this.Zb.Nd(c,e))):x.k("unknown ChangedEvent.Insert object: "+a.toString());this.qi=!0}else c===ze?(e=a.object,c=a.Kg,d=a.oldValue,e instanceof H?"number"===typeof c&&d instanceof O?(g=e,b?g.Nd(c,d):g.We(c)):"number"===typeof c&&d instanceof sf&&(g=e,b?(c=d.qe?g.nd(d.index):g.md(d.index),c.qt(d)):d.qe?g.MF(c):g.IF(c)):e instanceof bf?(g=!0===a.Ig,
"number"===typeof c&&d instanceof D&&(b?e.Dp(c,d,g):(d.oe(),e.We(g?c:-1,d,g)))):e instanceof z?"number"===typeof c&&d instanceof bf&&(e=d,b?(e.Sc(this),this.Zb.Nd(c,e)):this.Zb.dd(c)):x.k("unknown ChangedEvent.Remove object: "+a.toString()),this.qi=!0):c!==xe&&x.k("unknown ChangedEvent: "+a.toString())}};z.prototype.startTransaction=z.prototype.Wb=function(a){return this.qa.Wb(a)};z.prototype.commitTransaction=z.prototype.Md=function(a){return this.qa.Md(a)};
z.prototype.rollbackTransaction=z.prototype.$p=function(){return this.qa.$p()};z.prototype.updateAllTargetBindings=z.prototype.BG=function(a){void 0===a&&(a="");for(var b=this.sj;b.next();)b.value.Ob(a);for(b=this.yh;b.next();)b.value.Ob(a);for(b=this.links;b.next();)b.value.Ob(a)};z.prototype.updateAllRelationshipsFromData=z.prototype.mK=function(){for(var a=this.sj;a.next();)a.value.updateRelationshipsFromData();for(a=this.yh;a.next();)a.value.updateRelationshipsFromData();for(a=this.links;a.next();)a.value.updateRelationshipsFromData()};
function tk(a,b,c){if(a.gd||a.Vd)a.dc=c,c=a.$a,c.Bc&&Qi(c,b,a.dc);else if(a.gd=!0,null===a.nb)a.dc=c;else{var d=a.Ab.copy(),e=a.Lb,g=a.Qb;d.width=a.Lb/b;d.height=a.Qb/b;var h=a.gm.x,k=a.gm.y,l=a.tE;isNaN(h)&&(l.mj()?l.Bp(nc)?h=0:l.Bp(oc)&&(h=e-1):h=l.cd()?l.x*(e-1):e/2);isNaN(k)&&(l.mj()?l.Bp(mc)?k=0:l.Bp(pc)&&(k=g-1):k=l.cd()?l.y*(g-1):g/2);null!==a.XF&&(c=a.XF(a,c));c<a.vh&&(c=a.vh);c>a.uh&&(c=a.uh);e=x.Xb(a.fb.x+h/b-h/c,a.fb.y+k/b-k/c);a.position=e;x.A(e);a.dc=c;a.fu(d,a.Ab);a.gd=!1;Fj(a,!1);c=
a.$a;c.Bc&&Qi(c,b,a.dc);a.ua();Pj(a)}}z.prototype.fu=function(a,b,c){void 0===c&&(c=!1);c||Pj(this);Bj(this);var d=this.Tb;null===d||!d.yx||this.Al!==Nf||c||a.width===b.width&&a.height===b.height||d.J();d=this.eb;!0===this.sm&&d instanceof Hf&&(this.S.ha=this.zG(this.S.te),d.doMouseMove());this.fF(a,b);Sj(this);this.Ja("ViewportBoundsChanged",c?x.Kh:null,a)};
function Sj(a,b){void 0===b&&(b=null);var c=a.ud;if(null!==c&&c.visible){for(var d=x.dm(),e=1,g=1,h=c.wa.o,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(Ek(m.Jb)?g=g*n/Q.VE(g,n):e=e*n/Q.VE(e,n))}h=c.nx;d.n(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=x.kg();g=a.Ab;e.n(g.x,g.y,g.width,g.height);for(h=a.aw.i;h.next();)g=h.value.Ab,g.G()&&Eb(e,g.x,g.y,g.width,g.height);k=e.width;l=e.height;g=e.x;h=e.y;if(!e.G())return}c.width=k+2*d.width;c.height=l+2*d.height;
e=x.P();Q.xt(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);x.tk(d);c.ea.location=e;x.A(e)}}z.prototype.clearSelection=z.prototype.Ww=function(){var a=0<this.selection.count;a&&this.Ja("ChangingSelection");Lf(this);a&&this.Ja("ChangedSelection")};function Lf(a){a=a.selection;if(0<a.count){for(var b=a.kc(),c=b.length,d=0;d<c;d++)b[d].lb=!1;a.Va();a.clear();a.freeze()}}
z.prototype.select=z.prototype.select=function(a){null!==a&&(x.l(a,D,z,"select:part"),a.layer.h===this&&(!a.lb||1<this.selection.count)&&(this.Ja("ChangingSelection"),Lf(this),a.lb=!0,this.Ja("ChangedSelection")))};
z.prototype.selectCollection=z.prototype.bG=function(a){this.Ja("ChangingSelection");Lf(this);if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++){var d=x.Wa(a,c);d instanceof D||x.k("Diagram.selectCollection given something that is not a Part: "+d);d.lb=!0}else for(a=a.i;a.next();)d=a.value,d instanceof D||x.k("Diagram.selectCollection given something that is not a Part: "+d),d.lb=!0;this.Ja("ChangedSelection")};
z.prototype.clearHighlighteds=z.prototype.mE=function(){var a=this.rn;if(0<a.count){for(var b=a.kc(),c=b.length,d=0;d<c;d++)b[d].sh=!1;a.Va();a.clear();a.freeze()}};z.prototype.highlight=function(a){null!==a&&a.layer.h===this&&(x.l(a,D,z,"highlight:part"),!a.sh||1<this.rn.count)&&(this.mE(),a.sh=!0)};
z.prototype.highlightCollection=function(a){this.mE();if(x.isArray(a))for(var b=x.ab(a),c=0;c<b;c++){var d=x.Wa(a,c);d instanceof D||x.k("Diagram.highlightCollection given something that is not a Part: "+d);d.sh=!0}else for(a=a.i;a.next();)d=a.value,d instanceof D||x.k("Diagram.highlightCollection given something that is not a Part: "+d),d.sh=!0};
z.prototype.scroll=z.prototype.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e=0;if("pixel"===a)e=c;else if("line"===a)e=c*(d?this.pu:this.ou);else if("page"===a)a=d?this.Ab.height:this.Ab.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.pu:this.ou),0),e*=c);else{if("document"===a){e=this.Ec;d=this.Ab;c=x.P();"up"===b?this.position=c.n(d.x,e.y):"left"===b?this.position=c.n(e.x,d.y):"down"===b?this.position=c.n(d.x,e.bottom-d.height):"right"===b&&(this.position=c.n(e.right-d.width,
d.y));x.A(c);return}x.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', 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:x.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c};z.prototype.scrollToRect=z.prototype.QJ=function(a){var b=this.Ab;b.pk(a)||(a=a.Bl,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};
z.prototype.centerRect=z.prototype.CH=function(a){var b=this.Ab;a=a.Bl;a.x-=b.width/2;a.y-=b.height/2;this.position=a};z.prototype.transformDocToView=z.prototype.rB=function(a){var b=this.Ld;b.reset();1!==this.dc&&b.scale(this.dc);var c=this.fb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Ld)};
z.prototype.transformViewToDoc=z.prototype.zG=function(a){var b=this.Ld;b.reset();1!==this.dc&&b.scale(this.dc);var c=this.fb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return rb(a.copy(),this.Ld)};var Nf;z.None=Nf=x.s(z,"None",0);var Jj;z.Uniform=Jj=x.s(z,"Uniform",1);var Kj;z.UniformToFill=Kj=x.s(z,"UniformToFill",2);var fh;z.CycleAll=fh=x.s(z,"CycleAll",10);var jh;z.CycleNotDirected=jh=x.s(z,"CycleNotDirected",11);var lh;
z.CycleNotDirectedFast=lh=x.s(z,"CycleNotDirectedFast",12);var mh;z.CycleNotUndirected=mh=x.s(z,"CycleNotUndirected",13);var gh;z.CycleDestinationTree=gh=x.s(z,"CycleDestinationTree",14);var ih;z.CycleSourceTree=ih=x.s(z,"CycleSourceTree",15);var kj;z.DocumentScroll=kj=x.s(z,"DocumentScroll",1);var ek;z.InfiniteScroll=ek=x.s(z,"InfiniteScroll",2);var mj;z.TreeParentCollapsed=mj=x.s(z,"TreeParentCollapsed",1);z.AllParentsCollapsed=x.s(z,"AllParentsCollapsed",2);
x.defineProperty(z,{nK:"validCycle"},function(){return this.Gw},function(a){var b=this.Gw;b!==a&&(x.Ca(a,z,z,"validCycle"),this.Gw=a,this.j("validCycle",b,a))});x.w(z,{vn:"layers"},function(){return this.Zb.i});x.defineProperty(z,{Ff:"isModelReadOnly"},function(){var a=this.fe;return null===a?!1:a.kb},function(a){var b=this.fe;null!==b&&(b.kb=a)});
x.defineProperty(z,{kb:"isReadOnly"},function(){return this.Ii},function(a){var b=this.Ii;b!==a&&(x.g(a,"boolean",z,"isReadOnly"),this.Ii=a,this.j("isReadOnly",b,a))});x.defineProperty(z,{isEnabled:"isEnabled"},function(){return this.af},function(a){var b=this.af;b!==a&&(x.g(a,"boolean",z,"isEnabled"),this.af=a,this.j("isEnabled",b,a))});
x.defineProperty(z,{Vz:"allowClipboard"},function(){return this.Ku},function(a){var b=this.Ku;b!==a&&(x.g(a,"boolean",z,"allowClipboard"),this.Ku=a,this.j("allowClipboard",b,a))});x.defineProperty(z,{nk:"allowCopy"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(x.g(a,"boolean",z,"allowCopy"),this.Gk=a,this.j("allowCopy",b,a))});
x.defineProperty(z,{Zm:"allowDelete"},function(){return this.Hk},function(a){var b=this.Hk;b!==a&&(x.g(a,"boolean",z,"allowDelete"),this.Hk=a,this.j("allowDelete",b,a))});x.defineProperty(z,{ft:"allowDragOut"},function(){return this.Lu},function(a){var b=this.Lu;b!==a&&(x.g(a,"boolean",z,"allowDragOut"),this.Lu=a,this.j("allowDragOut",b,a))});
x.defineProperty(z,{cE:"allowDrop"},function(){return this.Mu},function(a){var b=this.Mu;b!==a&&(x.g(a,"boolean",z,"allowDrop"),this.Mu=a,this.j("allowDrop",b,a))});x.defineProperty(z,{Pw:"allowTextEdit"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(x.g(a,"boolean",z,"allowTextEdit"),this.Qk=a,this.j("allowTextEdit",b,a))});
x.defineProperty(z,{Mw:"allowGroup"},function(){return this.Ik},function(a){var b=this.Ik;b!==a&&(x.g(a,"boolean",z,"allowGroup"),this.Ik=a,this.j("allowGroup",b,a))});x.defineProperty(z,{Qw:"allowUngroup"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(x.g(a,"boolean",z,"allowUngroup"),this.Rk=a,this.j("allowUngroup",b,a))});
x.defineProperty(z,{ep:"allowInsert"},function(){return this.Ou},function(a){var b=this.Ou;b!==a&&(x.g(a,"boolean",z,"allowInsert"),this.Ou=a,this.j("allowInsert",b,a))});x.defineProperty(z,{gt:"allowLink"},function(){return this.Jk},function(a){var b=this.Jk;b!==a&&(x.g(a,"boolean",z,"allowLink"),this.Jk=a,this.j("allowLink",b,a))});
x.defineProperty(z,{$m:"allowRelink"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(x.g(a,"boolean",z,"allowRelink"),this.Lk=a,this.j("allowRelink",b,a))});x.defineProperty(z,{yl:"allowMove"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(x.g(a,"boolean",z,"allowMove"),this.Kk=a,this.j("allowMove",b,a))});
x.defineProperty(z,{Nw:"allowReshape"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(x.g(a,"boolean",z,"allowReshape"),this.Mk=a,this.j("allowReshape",b,a))});x.defineProperty(z,{ht:"allowResize"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(x.g(a,"boolean",z,"allowResize"),this.Nk=a,this.j("allowResize",b,a))});
x.defineProperty(z,{Ow:"allowRotate"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(x.g(a,"boolean",z,"allowRotate"),this.Ok=a,this.j("allowRotate",b,a))});x.defineProperty(z,{yf:"allowSelect"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(x.g(a,"boolean",z,"allowSelect"),this.Pk=a,this.j("allowSelect",b,a))});
x.defineProperty(z,{dE:"allowUndo"},function(){return this.Pu},function(a){var b=this.Pu;b!==a&&(x.g(a,"boolean",z,"allowUndo"),this.Pu=a,this.j("allowUndo",b,a))});x.defineProperty(z,{Rw:"allowZoom"},function(){return this.Ru},function(a){var b=this.Ru;b!==a&&(x.g(a,"boolean",z,"allowZoom"),this.Ru=a,this.j("allowZoom",b,a))});
x.defineProperty(z,{uA:"hasVerticalScrollbar"},function(){return this.wv},function(a){var b=this.wv;b!==a&&(x.g(a,"boolean",z,"hasVerticalScrollbar"),this.wv=a,Pj(this),this.ua(),this.j("hasVerticalScrollbar",b,a),Fj(this,!1))});x.defineProperty(z,{tA:"hasHorizontalScrollbar"},function(){return this.vv},function(a){var b=this.vv;b!==a&&(x.g(a,"boolean",z,"hasHorizontalScrollbar"),this.vv=a,Pj(this),this.ua(),this.j("hasHorizontalScrollbar",b,a),Fj(this,!1))});
x.defineProperty(z,{Qe:"allowHorizontalScroll"},function(){return this.Nu},function(a){var b=this.Nu;b!==a&&(x.g(a,"boolean",z,"allowHorizontalScroll"),this.Nu=a,this.j("allowHorizontalScroll",b,a),Fj(this,!1))});x.defineProperty(z,{Re:"allowVerticalScroll"},function(){return this.Qu},function(a){var b=this.Qu;b!==a&&(x.g(a,"boolean",z,"allowVerticalScroll"),this.Qu=a,this.j("allowVerticalScroll",b,a),Fj(this,!1))});
x.defineProperty(z,{ou:"scrollHorizontalLineChange"},function(){return this.lw},function(a){var b=this.lw;b!==a&&(x.g(a,"number",z,"scrollHorizontalLineChange"),0>a&&x.la(a,">= 0",z,"scrollHorizontalLineChange"),this.lw=a,this.j("scrollHorizontalLineChange",b,a))});
x.defineProperty(z,{pu:"scrollVerticalLineChange"},function(){return this.pw},function(a){var b=this.pw;b!==a&&(x.g(a,"number",z,"scrollVerticalLineChange"),0>a&&x.la(a,">= 0",z,"scrollVerticalLineChange"),this.pw=a,this.j("scrollVerticalLineChange",b,a))});x.defineProperty(z,{S:"lastInput"},function(){return this.Rb},function(a){u&&x.l(a,he,z,"lastInput");this.Rb=a});x.defineProperty(z,{Fc:"firstInput"},function(){return this.Gi},function(a){u&&x.l(a,he,z,"firstInput");this.Gi=a});
x.defineProperty(z,{gc:"currentCursor"},function(){return this.Ny},function(a){""===a&&(a=this.Sq);this.Ny!==a&&(x.g(a,"string",z,"currentCursor"),null!==this.nb&&(this.Ny=a,this.nb.style.cursor=a,this.Ub.style.cursor=a))});x.defineProperty(z,{XK:"defaultCursor"},function(){return this.Sq},function(a){""===a&&(a="auto");var b=this.Sq;b!==a&&(x.g(a,"string",z,"defaultCursor"),this.Sq=a,this.j("defaultCursor",b,a))});
x.defineProperty(z,{click:"click"},function(){return this.wi},function(a){var b=this.wi;b!==a&&(null!==a&&x.g(a,"function",z,"click"),this.wi=a,this.j("click",b,a))});x.defineProperty(z,{tt:"doubleClick"},function(){return this.Ei},function(a){var b=this.Ei;b!==a&&(null!==a&&x.g(a,"function",z,"doubleClick"),this.Ei=a,this.j("doubleClick",b,a))});
x.defineProperty(z,{aA:"contextClick"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(null!==a&&x.g(a,"function",z,"contextClick"),this.zi=a,this.j("contextClick",b,a))});x.defineProperty(z,{LA:"mouseOver"},function(){return this.Qi},function(a){var b=this.Qi;b!==a&&(null!==a&&x.g(a,"function",z,"mouseOver"),this.Qi=a,this.j("mouseOver",b,a))});
x.defineProperty(z,{KA:"mouseHover"},function(){return this.Pi},function(a){var b=this.Pi;b!==a&&(null!==a&&x.g(a,"function",z,"mouseHover"),this.Pi=a,this.j("mouseHover",b,a))});x.defineProperty(z,{JA:"mouseHold"},function(){return this.Oi},function(a){var b=this.Oi;b!==a&&(null!==a&&x.g(a,"function",z,"mouseHold"),this.Oi=a,this.j("mouseHold",b,a))});
x.defineProperty(z,{vJ:"mouseDragOver"},function(){return this.Uv},function(a){var b=this.Uv;b!==a&&(null!==a&&x.g(a,"function",z,"mouseDragOver"),this.Uv=a,this.j("mouseDragOver",b,a))});x.defineProperty(z,{IA:"mouseDrop"},function(){return this.Ni},function(a){var b=this.Ni;b!==a&&(null!==a&&x.g(a,"function",z,"mouseDrop"),this.Ni=a,this.j("mouseDrop",b,a))});
x.defineProperty(z,{qB:"toolTip"},function(){return this.Yi},function(a){var b=this.Yi;b!==a&&(null!==a&&x.l(a,fa,z,"toolTip"),this.Yi=a,this.j("toolTip",b,a))});x.defineProperty(z,{contextMenu:"contextMenu"},function(){return this.Ai},function(a){var b=this.Ai;b!==a&&(null!==a&&x.l(a,fa,z,"contextMenu"),this.Ai=a,this.j("contextMenu",b,a))});
x.defineProperty(z,{zb:"commandHandler"},function(){return this.Iy},function(a){var b=this.Iy;b!==a&&(x.l(a,ua,z,"commandHandler"),null!==a.h&&x.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.Iy=a,a.Sc(this))});x.defineProperty(z,{vb:"toolManager"},function(){return this.Nz},function(a){var b=this.Nz;b!==a&&(x.l(a,Hf,z,"toolManager"),null!==a.h&&x.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.Nz=a,a.Sc(this))});
x.defineProperty(z,{st:"defaultTool"},function(){return this.Ry},function(a){var b=this.Ry;b!==a&&(x.l(a,cf,z,"defaultTool"),this.Ry=a,this.eb===b&&(this.eb=a))});x.defineProperty(z,{eb:"currentTool"},function(){return this.Oy},function(a){var b=this.Oy;null!==b&&(b.va&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.st);null!==a&&(x.l(a,cf,z,"currentTool"),this.Oy=a,a.Sc(this),a.doStart())});x.w(z,{selection:"selection"},function(){return this.sw});
x.defineProperty(z,{nJ:"maxSelectionCount"},function(){return this.Pv},function(a){var b=this.Pv;if(b!==a)if(x.g(a,"number",z,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Pv=a,this.j("maxSelectionCount",b,a),!this.qa.tb&&(a=this.selection.count-a,0<a)){this.Ja("ChangingSelection");for(var b=this.selection.kc(),c=0;c<a;c++)b[c].lb=!1;this.Ja("ChangedSelection")}}else x.la(a,">= 0",z,"maxSelectionCount")});
x.defineProperty(z,{xJ:"nodeSelectionAdornmentTemplate"},function(){return this.Vv},function(a){var b=this.Vv;b!==a&&(x.l(a,fa,z,"nodeSelectionAdornmentTemplate"),this.Vv=a,this.j("nodeSelectionAdornmentTemplate",b,a))});x.defineProperty(z,{CI:"groupSelectionAdornmentTemplate"},function(){return this.sv},function(a){var b=this.sv;b!==a&&(x.l(a,fa,z,"groupSelectionAdornmentTemplate"),this.sv=a,this.j("groupSelectionAdornmentTemplate",b,a))});
x.defineProperty(z,{hJ:"linkSelectionAdornmentTemplate"},function(){return this.Lv},function(a){var b=this.Lv;b!==a&&(x.l(a,fa,z,"linkSelectionAdornmentTemplate"),this.Lv=a,this.j("linkSelectionAdornmentTemplate",b,a))});x.w(z,{rn:"highlighteds"},function(){return this.xv});
x.defineProperty(z,{qi:"isModified"},function(){var a=this.qa;return a.isEnabled?null!==a.gj?!0:this.mz&&this.Xg!==a.kj:this.mz},function(a){if(this.mz!==a){x.g(a,"boolean",z,"isModified");this.mz=a;var b=this.qa;!a&&b.isEnabled&&(this.Xg=b.kj);a||Fk(this)}});function Fk(a){var b=a.qi;a.VD!==b&&(a.VD=b,a.Ja("Modified"))}
x.defineProperty(z,{aa:"model"},function(){return this.fe},function(a){var b=this.fe;if(b!==a){x.l(a,L,z,"model");this.eb.doCancel();null!==b&&b.qa!==a.qa&&b.qa.mF&&x.k("Do not replace a Diagram.model while a transaction is in progress.");this.$a.uj();this.Ww();this.Le=!1;this.qo=!0;this.Xg=-2;this.Xf=!1;var c=this.Vd;this.Vd=!0;this.$a.An("Model");null!==b&&(null!==this.$g&&this.$g.each(function(a){b.ju(a)}),b.ju(this.ZC),b instanceof X&&Gk(this,b.th),Gk(this,b.Jg));this.fe=a;a.Ym(this.YC);Hk(this,
a.Jg);a instanceof X&&Ik(this,a.th);a.ju(this.YC);a.Ym(this.ZC);null!==this.$g&&this.$g.each(function(b){a.Ym(b)});this.Vd=c;this.gd||this.ua();null!==b&&(a.qa.isEnabled=b.qa.isEnabled)}});x.defineProperty(z,{Za:null},function(){return this.RC},function(a){this.RC=a});x.w(z,{Dx:null},function(){return this.VG});
function oj(a,b){if(b.aa===a.aa){var c=b.Dc,d=b.propertyName;if(c===xe&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.vb,c.sf.each(function(b){b.Sc(a)}),c.eg.each(function(b){b.Sc(a)}),c.fg.each(function(b){b.Sc(a)}),a.Vd||a.Le||(a.jv=!0,a.qo&&(a.Xf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.$a;e.Df&&!a.xb&&e.uj();a.Ja("ChangingSelection")}else"StartedTransaction"===d&&(e=a.$a,e.Df&&!a.xb&&e.uj());else if(a.Za){a.Za=!1;try{var g=b.rf;if(""!==g)if(c===we){if("linkFromKey"===g){var h=
b.object,k=a.Eg(h);if(null!==k){var l=b.newValue,m=a.hf(l);k.Z=m}}else if("linkToKey"===g)h=b.object,k=a.Eg(h),null!==k&&(l=b.newValue,m=a.hf(l),k.fa=m);else if("linkFromPortId"===g){if(h=b.object,k=a.Eg(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.bg=n)}}else if("linkToPortId"===g)h=b.object,k=a.Eg(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Og=n));else if("nodeGroupKey"===g){var h=b.object,p=a.ni(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.hf(q);p.Xa=r instanceof F?r:
null}else p.Xa=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.Eg(h),null!==k){var s=b.oldValue,t=b.newValue;if(x.isArray(s))for(var v=x.ab(s),y=0;y<v;y++){var A=x.Wa(s,y),m=a.hf(A);null!==m&&(m.Od=null)}if(x.isArray(t))for(v=x.ab(t),y=0;y<v;y++)A=x.Wa(t,y),m=a.hf(A),null!==m&&(m.Od=k)}}else if("nodeParentKey"===g){var B=b.object,C=a.hf(b.newValue),M=a.kx(B);if(null!==M){var I=M.zt();null!==I?null===C?a.remove(I):a.ae?I.Z=C:I.fa=C:Jk(a,C,M)}}else if("parentLinkCategory"===g){var B=b.object,M=
a.kx(B),V=b.newValue;null!==M&&"string"===typeof V&&(I=M.zt(),null!==I&&(I.Lc=V))}else if("nodeCategory"===g){var h=b.object,ea=a.ni(h),V=b.newValue;null!==ea&&"string"===typeof V&&(ea.Lc=V)}else if("linkCategory"===g){var h=b.object,W=a.Eg(h),V=b.newValue;null!==W&&"string"===typeof V&&(W.Lc=V)}else if("nodeDataArray"===g){var P=b.oldValue;Gk(a,P);var ba=b.newValue;Hk(a,ba)}else"linkDataArray"===g&&(P=b.oldValue,Gk(a,P),ba=b.newValue,Ik(a,ba));a.qi=!0}else c===ye?(ba=b.newValue,"nodeDataArray"===
g&&x.Ya(ba)?Kk(a,ba):"linkDataArray"===g&&x.Ya(ba)?Lk(a,ba):"linkLabelKeys"===g&&nf(ba)&&(k=a.Eg(b.object),m=a.hf(ba),null!==k&&null!==m&&(m.Od=k)),a.qi=!0):c===ze?(P=b.oldValue,"nodeDataArray"===g&&x.Ya(P)?Mk(a,P):"linkDataArray"===g&&x.Ya(P)?Mk(a,P):"linkLabelKeys"===g&&nf(P)&&(m=a.hf(P),null!==m&&(m.Od=null)),a.qi=!0):c===xe&&("SourceChanged"===g?null!==b.object?nj(a,b.object,b.propertyName):(a.mK(),a.BG()):"ModelDisplaced"===g&&a.Yl());else if(c===we){var Na=b.propertyName,h=b.object;if(h===a.aa){if("nodeKeyProperty"===
Na||"nodeCategoryProperty"===Na||"linkFromKeyProperty"===Na||"linkToKeyProperty"===Na||"linkFromPortIdProperty"===Na||"linkToPortIdProperty"===Na||"linkLabelKeysProperty"===Na||"nodeIsGroupProperty"===Na||"nodeGroupKeyProperty"===Na||"nodeParentKeyProperty"===Na||"linkCategoryProperty"===Na)a.qa.tb||a.Yl()}else nj(a,h,Na);a.qi=!0}else if(c===ye||c===ze)Nk(a,b),a.qi=!0;else if(c===xe){if("FinishedUndo"===d||"FinishedRedo"===d)a.qa.Ji=!0,a.Ja("ChangedSelection"),Dj(a),a.qa.Ji=!1;a.jv=!0;a.dg();e=a.$a;
0===a.qa.Jh&&Ci(e);"CommittedTransaction"===d&&a.qa.pz&&(a.Xg=Math.min(a.Xg,a.qa.kj-1));var qa=b.pF;qa&&(Fk(a),a.Dx.clear());!a.yz&&qa&&(a.yz=!0,x.setTimeout(function(){a.eb.standardMouseOver();a.yz=!1},10))}}finally{a.Za=!0}}}}
function nj(a,b,c){if("string"===typeof c){var d=a.ni(b);if(null!==d)d.Ob(c),a.aa instanceof Ve&&(d=a.Eg(b),null!==d&&d.Ob(c));else{for(var d=null,e=a.vm.i;e.next();){for(var g=e.value,h=0;h<g.length;h++){var k=g[h].mI(b);null!==k&&(null===d&&(d=x.ub()),d.push(k))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Ob(c);x.xa(d)}}b===a.aa.yk&&a.BG(c)}}x.defineProperty(z,{ey:"skipsModelSourceBindings"},function(){return this.vD},function(a){this.vD=a});
x.defineProperty(z,{wu:null},function(){return this.Gz},function(a){this.Gz=a});function Nk(a,b){var c=b.Dc===ye,d=c?b.Ig:b.Kg,e=c?b.newValue:b.oldValue,g=a.vm.oa(b.object);if(Array.isArray(g))for(var h=0;h<g.length;h++){var k=g[h];if(c)Ok(k,e,d);else{var l=d;if(!(0>l)){var m=l;Pk(k)&&m++;k.We(m);Qk(k,m,l)}}}}function jk(a,b){var c=b.Ki;if(x.isArray(c)){var d=a.vm.oa(c);if(null===d)d=[],d.push(b),a.vm.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function nk(a,b){var c=b.Ki;if(x.isArray(c)){var d=a.vm.oa(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.vm.remove(c);break}}}function ik(a,b){for(var c=b.wa.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof pj&&Rk(a,g)}}function Rk(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.Oo.oa(c);if(null===d)d=[],d.push(b),a.Oo.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function mk(a,b){for(var c=b.wa.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof pj&&Sk(a,g)}}function Sk(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.Oo.oa(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Oo.remove(c);break}}}
z.prototype.clear=z.prototype.clear=function(){var a=null;null!==this.ud&&(a=this.ud.ea);this.aa.clear();for(var b=this.Zb.length,c=0;c<b;c++)this.Zb.o[c].clear();this.pg.clear();this.Xk.clear();this.No.clear();this.sl.clear();this.Ho.clear();this.pb.clear();this.Bi.clear();this.Wk.clear();this.vm.clear();this.sw.Va();this.sw.clear();this.sw.freeze();this.xv.Va();this.xv.clear();this.xv.freeze();Ff=this.Xn=null;Gf="";this.kv=(new w(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.pb.remove(a));
this.ua()};
z.prototype.reset=z.prototype.reset=function(){this.gd=!0;this.clear();this.Zb=new J(bf);this.OF();this.NF();this.fb=(new N(NaN,NaN)).freeze();this.dc=1;this.zv=(new N(NaN,NaN)).freeze();this.Av=NaN;this.Rv=1E-4;this.Ov=100;this.Jw=(new N(NaN,NaN)).freeze();this.qv=(new w(NaN,NaN,NaN,NaN)).freeze();this.mw=(new yb(0,0,0,0)).freeze();this.nw=kj;this.jw=this.fw=null;this.km=Nf;this.Un=Jc;this.cl=Nf;this.vo=Jc;this.Bv=this.yv=Xb;this.QB=250;this.Wu=(new yb(16,16,16,16)).freeze();this.Gv=!0;this.Ew=mj;
this.Gw=fh;this.Sq="auto";this.Ai=this.Yi=this.Ni=this.Uv=this.Oi=this.Pi=this.Qi=this.zi=this.Ei=this.wi=null;this.Ii=!1;this.Hk=this.Gk=this.Ku=this.af=!0;this.Mu=this.Lu=!1;this.Qu=this.Nu=this.wv=this.vv=this.Ru=this.Pu=this.Pk=this.Ok=this.Nk=this.Mk=this.Kk=this.Lk=this.Jk=this.Ou=this.Rk=this.Ik=this.Qk=!0;this.pw=this.lw=16;this.df=(new yb(5)).freeze();this.Pv=999999999;this.ee=null;tj(this);this.ud=null;this.vb=new Hf;this.vb.initializeStandardTools();this.eb=this.st=this.vb;this.zb=new ua;
this.Vi=!0;sj(this);this.Tb=new df;this.Vi=!1;this.aa=new X;this.Le=!1;this.qo=!0;this.gd=this.Xf=!1;this.ua();this.$g=this.vi=null;lj(this)};
z.prototype.rebuildParts=z.prototype.Yl=function(){for(var a=this.QA.i;a.next();){var b=a.value,c=a.key;(!b.$d()||b instanceof F)&&x.k('Invalid node template in Diagram.nodeTemplateMap: template for "'+c+'" must be a Node or a simple Part, not a Group or Link: '+b)}for(a=this.sA.i;a.next();)b=a.value,c=a.key,b instanceof F||x.k('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.CA.i;a.next();)b=a.value,c=a.key,b instanceof
G||x.k('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=x.ub();for(b=this.selection.i;b.next();)(c=b.value.data)&&a.push(c);for(var b=x.ub(),d=this.rn.i;d.next();)(c=d.value.data)&&b.push(c);c=x.ub();for(d=this.yh.i;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.i;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));for(d=this.sj.i;d.next();)e=d.value,null!==
e.data&&(c.push(e.data),c.push(e.location));d=this.aa;d instanceof X&&Gk(this,d.th);Gk(this,d.Jg);Hk(this,d.Jg);d instanceof X&&Ik(this,d.th);for(d=0;d<a.length;d++)e=this.ni(a[d]),null!==e&&(e.lb=!0);for(d=0;d<b.length;d++)e=this.ni(b[d]),null!==e&&(e.sh=!0);for(d=0;d<c.length;d+=2)e=this.ni(c[d]),null!==e&&(e.location=c[d+1]);x.xa(a);x.xa(b);x.xa(c)};
function Hk(a,b){if(null!==b){for(var c=a.aa,d=x.ab(b),e=0;e<d;e++){var g=x.Wa(b,e);c.je(g)?Kk(a,g,!1):c instanceof X&&Lk(a,g)}if(c instanceof X||c instanceof Ve){for(e=0;e<d;e++)g=x.Wa(b,e),c.je(g)&&Tk(a,g);if(c instanceof X)for(c=a.links;c.next();)Uk(c.value)}Vk(a,!1)}}
function Kk(a,b,c){if(void 0!==b&&null!==b&&!a.qa.tb&&!a.Bi.contains(b)){void 0===c&&(c=!0);var d=a.qA(b),e=Wk(a,b,d);null!==e&&(Kf(e),e=e.copy(),null!==e&&(e.ui=d,e.Ke=b,a.On&&(e.Oj="Tool"),a.add(e),e.Ke=null,e.data=b,c&&Tk(a,b)))}}z.prototype.qA=function(a){return this.aa.qA(a)};var Xk=!1,Yk=!1;
function Wk(a,b,c){var d=!1,e=a.aa;e instanceof X&&(d=e.yA(b));d?(b=a.sA.oa(c),null===b&&(b=a.sA.oa(""),null===b&&(Yk||(Yk=!0,x.trace('No Group template found for category "'+c+'"'),x.trace("  Using default group template")),b=a.hC))):(b=a.QA.oa(c),null===b&&(b=a.QA.oa(""),null===b&&(Xk||(Xk=!0,x.trace('No Node template found for category "'+c+'"'),x.trace("  Using default node template")),b=a.jC)));return b}
function Tk(a,b){var c=a.aa;if(c instanceof X||c instanceof Ve){var d=c.sb(b);if(void 0!==d){var e=of(c,d),g=a.ni(b);if(null!==e&&null!==g){for(e=e.i;e.next();){var h=e.value;if(c instanceof X){var k=c;if(k.je(h)){if(g instanceof F&&k.pn(h)===d){var l=g,h=a.ni(h);null!==h&&(h.Xa=l)}}else{var m=a.Eg(h);if(null!==m&&g instanceof E&&(l=g,k.Ol(h)===d&&(m.Z=l),k.Rl(h)===d&&(m.fa=l),h=k.uk(h),x.isArray(h)))for(k=0;k<x.ab(h);k++)if(x.Wa(h,k)===d){l.Od=m;break}}}else c instanceof Ve&&(m=c,m.je(h)&&g instanceof
E&&(l=g,m.qn(h)===d&&(h=a.kx(h),Jk(a,l,h))))}qf(c,d)}c instanceof X?(c=c.pn(b),void 0!==c&&(c=a.hf(c),c instanceof F&&(g.Xa=c))):c instanceof Ve&&(c=c.qn(b),void 0!==c&&g instanceof E&&(l=g,g=a.hf(c),Jk(a,g,l)))}}}
function Jk(a,b,c){if(null!==b&&null!==c){var d=a.vb.vF,e=b,g=c;if(a.ae)for(b=g.ce;b.next();){if(b.value.fa===g)return}else for(e=c,g=b,b=e.ce;b.next();)if(b.value.Z===e)return;null!==d&&hh(d,e,g,null,!0)||(d=a.mx(c.data),b=Zk(a,d),null!==b&&(Kf(b),b=b.copy(),null!==b&&(b.ui=d,b.Ke=c.data,b.Z=e,b.fa=g,a.add(b),b.Ke=null,b.data=c.data)))}}function Ik(a,b){if(null!==b){for(var c=x.ab(b),d=0;d<c;d++){var e=x.Wa(b,d);Lk(a,e)}Vk(a,!1)}}
function Lk(a,b){if(void 0!==b&&null!==b&&!a.qa.tb&&!a.Wk.contains(b)){var c=a.mx(b),d=Zk(a,c);if(null!==d&&(Kf(d),d=d.copy(),null!==d)){d.ui=c;d.Ke=b;var c=a.aa,e=c.vI(b);""!==e&&(d.bg=e);e=c.Ol(b);void 0!==e&&(e=a.hf(e),e instanceof E&&(d.Z=e));e=c.yI(b);""!==e&&(d.Og=e);e=c.Rl(b);void 0!==e&&(e=a.hf(e),e instanceof E&&(d.fa=e));c=c.uk(b);if(x.isArray(c))for(var e=x.ab(c),g=0;g<e;g++){var h=x.Wa(c,g),h=a.hf(h);null!==h&&(h.Od=d)}a.add(d);d.Ke=null;d.data=b}}}
z.prototype.mx=function(a){var b=this.aa,c="";b instanceof X?c=b.mx(a):b instanceof Ve&&(c=b.xI(a));return c};var $k=!1;function Zk(a,b){var c=a.CA.oa(b);null===c&&(c=a.CA.oa(""),null===c&&($k||($k=!0,x.trace('No Link template found for category "'+b+'"'),x.trace("  Using default link template")),c=a.iC));return c}function Gk(a,b){for(var c=x.ab(b),d=0;d<c;d++){var e=x.Wa(b,d);Mk(a,e)}}
function Mk(a,b){if(void 0!==b&&null!==b){var c=a.ni(b);if(null!==c){c.lb=!1;c.sh=!1;var d=c.layer;if(null!==d&&d.h===a){var e=a.aa;if(e instanceof X&&c instanceof E){var g=c,h=e.sb(g.data);if(void 0!==h){for(var k=g.ce;k.next();)pf(e,h,k.value.data);g.Ef&&(k=g.Od,null!==k&&pf(e,h,k.data));if(g instanceof F)for(g=g.Gc;g.next();)k=g.value.data,e.je(k)&&pf(e,h,k)}}else if(e instanceof Ve&&c instanceof E){g=c;k=a.Eg(g.data);if(null!==k){k.lb=!1;k.sh=!1;var l=k.layer;if(null!==l){var m=l.We(-1,k,!1);
0<=m&&a.Rc(ze,"parts",l,k,null,m,null);m=k.St;null!==m&&m(k,l,null)}}k=a.ae;for(g=g.ce;g.next();)l=g.value,l=(k?l.fa:l.Z).data,e.je(l)&&pf(e,h,l)}e=d.We(-1,c,!1);0<=e&&a.Rc(ze,"parts",d,c,null,e,null);e=c.St;null!==e&&e(c,d,null)}}}}z.prototype.findPartForKey=z.prototype.pI=function(a){if(null===a||void 0===a)return null;a=this.aa.le(a);return null===a?null:this.Bi.oa(a)};
z.prototype.findNodeForKey=z.prototype.hf=function(a){if(null===a||void 0===a)return null;a=this.aa.le(a);if(null===a)return null;a=this.Bi.oa(a);return a instanceof E?a:null};z.prototype.findPartForData=z.prototype.ni=function(a){if(null===a)return null;var b=this.Bi.oa(a);return null!==b?b:b=this.Wk.oa(a)};z.prototype.findNodeForData=z.prototype.kx=function(a){if(null===a)return null;a=this.Bi.oa(a);return a instanceof E?a:null};
z.prototype.findLinkForData=z.prototype.Eg=function(a){return null===a?null:this.Wk.oa(a)};z.prototype.findNodesByExample=function(a){for(var b=new K,c=this.No.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(x.Ya(h)&&al(this,e,h)){b.add(d);break}}}return b.i};
z.prototype.findLinksByExample=function(a){for(var b=new K,c=this.Ho.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(x.Ya(h)&&al(this,e,h)){b.add(d);break}}}return b.i};function al(a,b,c){for(var d in c){var e=b[d],g=c[d];if(x.isArray(g)){if(!x.isArray(e)||e.length>=g.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=g[h];if(void 0!==l&&!bl(a,k,l))return!1}}else if(!bl(a,e,g))return!1}return!0}
function bl(a,b,c){if("function"===typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(x.Ya(b)&&x.Ya(c)){if(!al(a,b,c))return!1}else if(b!==c)return!1;return!0}x.defineProperty(z,{OL:"nodeTemplate"},function(){return this.Ri.oa("")},function(a){var b=this.Ri.oa("");b!==a&&(x.l(a,D,z,"nodeTemplate"),this.Ri.add("",a),this.j("nodeTemplate",b,a),this.qa.tb||this.Yl())});
x.defineProperty(z,{QA:"nodeTemplateMap"},function(){return this.Ri},function(a){var b=this.Ri;b!==a&&(x.l(a,ra,z,"nodeTemplateMap"),this.Ri=a,this.j("nodeTemplateMap",b,a),this.qa.tb||this.Yl())});x.defineProperty(z,{oL:"groupTemplate"},function(){return this.Zk.oa("")},function(a){var b=this.Zk.oa("");b!==a&&(x.l(a,F,z,"groupTemplate"),this.Zk.add("",a),this.j("groupTemplate",b,a),this.qa.tb||this.Yl())});
x.defineProperty(z,{sA:"groupTemplateMap"},function(){return this.Zk},function(a){var b=this.Zk;b!==a&&(x.l(a,ra,z,"groupTemplateMap"),this.Zk=a,this.j("groupTemplateMap",b,a),this.qa.tb||this.Yl())});x.defineProperty(z,{CL:"linkTemplate"},function(){return this.Qj.oa("")},function(a){var b=this.Qj.oa("");b!==a&&(x.l(a,G,z,"linkTemplate"),this.Qj.add("",a),this.j("linkTemplate",b,a),this.qa.tb||this.Yl())});
x.defineProperty(z,{CA:"linkTemplateMap"},function(){return this.Qj},function(a){var b=this.Qj;b!==a&&(x.l(a,ra,z,"linkTemplateMap"),this.Qj=a,this.j("linkTemplateMap",b,a),this.qa.tb||this.Yl())});x.defineProperty(z,{UI:null},function(){return this.sm},function(a){this.sm=a});
x.defineProperty(z,{Xe:"isMouseCaptured"},function(){return this.NC},function(a){var b=this.nb;null!==b&&(a?(this.S.bubbles=!1,b.removeEventListener("mousemove",this.Pp,!1),b.removeEventListener("mousedown",this.Op,!1),b.removeEventListener("mouseup",this.Rp,!1),b.removeEventListener("mousewheel",this.wh,!1),b.removeEventListener("DOMMouseScroll",this.wh,!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.wh,!0),window.addEventListener("DOMMouseScroll",this.wh,!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.wh,!0),window.removeEventListener("DOMMouseScroll",
this.wh,!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.wh,!1),b.addEventListener("DOMMouseScroll",this.wh,!1),b.addEventListener("mouseout",this.Qp,!1)),this.NC=a)});
x.defineProperty(z,{position:"position"},function(){return this.fb},function(a){var b=this.fb;if(!b.O(a)){x.l(a,N,z,"position");var c=this.Ab.copy();a=a.copy();if(!this.gd&&null!==this.nb){this.gd=!0;var d=this.scale;Hj(this,a,this.Ec,this.Lb/d,this.Qb/d,this.Un,!1);this.gd=!1}this.fb=a.Y();a=this.$a;a.Bc&&Pi(a,b,this.fb);this.gd||this.fu(c,this.Ab)}});x.defineProperty(z,{II:"initialPosition"},function(){return this.zv},function(a){this.zv.O(a)||(x.l(a,N,z,"initialPosition"),this.zv=a.Y())});
x.defineProperty(z,{JI:"initialScale"},function(){return this.Av},function(a){this.Av!==a&&(x.g(a,"number",z,"initialScale"),this.Av=a)});x.defineProperty(z,{Ft:"grid"},function(){null===this.ud&&zj(this);return this.ud},function(a){var b=this.ud;if(b!==a){null===b&&(zj(this),b=this.ud);x.l(a,H,z,"grid");a.type!==Aj&&x.k("Diagram.grid must be a Panel of type Panel.Grid");var c=b.V;null!==c&&c.remove(b);this.ud=a;a.name="GRID";null!==c&&c.add(a);Sj(this);this.ua();this.j("grid",b,a)}});
x.w(z,{Ab:"viewportBounds"},function(){var a=this.UD;if(null===this.nb)return a;var b=this.fb,c=this.dc;a.n(b.x,b.y,Math.max(this.Lb,0)/c,Math.max(this.Qb,0)/c);return a});x.defineProperty(z,{SE:"fixedBounds"},function(){return this.qv},function(a){var b=this.qv;b.O(a)||(x.l(a,w,z,"fixedBounds"),(u&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&x.k("fixedBounds width/height must not be Infinity"),this.qv=a=a.Y(),this.xc(),this.j("fixedBounds",b,a))});
x.defineProperty(z,{YF:"scrollMargin"},function(){return this.mw},function(a){"number"===typeof a?a=new yb(a):x.l(a,yb,z,"scrollMargin");var b=this.mw;b.O(a)||(this.mw=a=a.Y(),this.xc(),this.j("scrollMargin",b,a))});x.defineProperty(z,{eB:"scrollMode"},function(){return this.nw},function(a){var b=this.nw;b!==a&&(x.Ca(a,z,z,"scrollMode"),this.nw=a,a===kj&&Fj(this,!1),this.j("scrollMode",b,a))});
x.defineProperty(z,{GF:"positionComputation"},function(){return this.fw},function(a){var b=this.fw;b!==a&&(null!==a&&x.g(a,"function",z,"positionComputation"),this.fw=a,Fj(this,!1),this.j("positionComputation",b,a))});x.defineProperty(z,{XF:"scaleComputation"},function(){return this.jw},function(a){var b=this.jw;b!==a&&(null!==a&&x.g(a,"function",z,"scaleComputation"),this.jw=a,tk(this,this.scale,this.scale),this.j("scaleComputation",b,a))});x.w(z,{Ec:"documentBounds"},function(){return this.kv});
function Ij(a,b){a.Jj=!1;var c=a.kv;c.O(b)||(b=b.Y(),a.kv=b,Fj(a,!1),a.Ja("DocumentBoundsChanged",null,c.copy()),Pj(a))}x.defineProperty(z,{scale:"scale"},function(){return this.dc},function(a){var b=this.dc;x.p(a,z,"scale");b!==a&&tk(this,b,a)});x.defineProperty(z,{Al:"autoScale"},function(){return this.km},function(a){var b=this.km;b!==a&&(x.Ca(a,z,z,"autoScale"),this.km=a,this.j("autoScale",b,a),a!==Nf&&Fj(this,!1))});
x.defineProperty(z,{qL:"initialAutoScale"},function(){return this.cl},function(a){var b=this.cl;b!==a&&(x.Ca(a,z,z,"initialAutoScale"),this.cl=a,this.j("initialAutoScale",b,a))});x.defineProperty(z,{KI:"initialViewportSpot"},function(){return this.Bv},function(a){var b=this.Bv;b!==a&&(x.l(a,R,z,"initialViewportSpot"),a.cd()||x.k("initialViewportSpot must be a specific Spot: "+a),this.Bv=a,this.j("initialViewportSpot",b,a))});
x.defineProperty(z,{HI:"initialDocumentSpot"},function(){return this.yv},function(a){var b=this.yv;b!==a&&(x.l(a,R,z,"initialDocumentSpot"),a.cd()||x.k("initialViewportSpot must be a specific Spot: "+a),this.yv=a,this.j("initialDocumentSpot",b,a))});x.defineProperty(z,{vh:"minScale"},function(){return this.Rv},function(a){x.p(a,z,"minScale");var b=this.Rv;b!==a&&(0<a?(this.Rv=a,this.j("minScale",b,a),a>this.scale&&(this.scale=a)):x.la(a,"> 0",z,"minScale"))});
x.defineProperty(z,{uh:"maxScale"},function(){return this.Ov},function(a){x.p(a,z,"maxScale");var b=this.Ov;b!==a&&(0<a?(this.Ov=a,this.j("maxScale",b,a),a<this.scale&&(this.scale=a)):x.la(a,"> 0",z,"maxScale"))});x.defineProperty(z,{gm:"zoomPoint"},function(){return this.Jw},function(a){this.Jw.O(a)||(x.l(a,N,z,"zoomPoint"),this.Jw=a=a.Y())});
x.defineProperty(z,{tE:"contentAlignment"},function(){return this.Un},function(a){var b=this.Un;b.O(a)||(x.l(a,R,z,"contentAlignment"),this.Un=a=a.Y(),this.j("contentAlignment",b,a),Fj(this,!1))});x.defineProperty(z,{rL:"initialContentAlignment"},function(){return this.vo},function(a){var b=this.vo;b.O(a)||(x.l(a,R,z,"initialContentAlignment"),this.vo=a=a.Y(),this.j("initialContentAlignment",b,a))});
x.defineProperty(z,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?a=new yb(a):x.l(a,yb,z,"padding");var b=this.df;b.O(a)||(this.df=a=a.Y(),this.xc(),this.j("padding",b,a))});x.w(z,{yh:"nodes"},function(){return this.No.i});x.w(z,{links:"links"},function(){return this.Ho.i});x.w(z,{sj:"parts"},function(){return this.pb.i});
z.prototype.findTopLevelNodesAndLinks=function(){for(var a=new K(D),b=this.No.i;b.next();){var c=b.value;c.Gp&&a.add(c)}for(b=this.Ho.i;b.next();)c=b.value,c.Gp&&a.add(c);return a.i};z.prototype.findTopLevelGroups=function(){return this.sl.i};x.defineProperty(z,{Tb:"layout"},function(){return this.ee},function(a){var b=this.ee;b!==a&&(x.l(a,df,z,"layout"),null!==b&&(b.h=null,b.group=null),this.ee=a,a.h=this,a.group=null,this.Tu=!0,this.j("layout",b,a),this.Be())});
z.prototype.layoutDiagram=function(a){Dj(this);a&&Vk(this,!0);Tj(this,!1)};function Vk(a,b){for(var c=a.sl.i;c.next();)cl(a,c.value,b);null!==a.Tb&&(b?a.Tb.Hf=!1:a.Tb.J())}function cl(a,b,c){if(null!==b){for(var d=b.Fm.i;d.next();)cl(a,d.value,c);null!==b.Tb&&(c?b.Tb.Hf=!1:b.Tb.J())}}
function Tj(a,b){if(!a.Sy){var c=a.Tb,d=a.Za;a.Za=!0;try{a.Wb("Layout");var e=a.$a;1!==a.qa.Jh||e.Df||e.Bc||e.An("Layout");for(var g=a.sl.i;g.next();)dl(a,g.value,b);c.Hf||b&&!c.oF&&1!==a.qa.Jh||(c.doLayout(a),Dj(a),c.Hf=!0)}finally{a.Md("Layout"),a.Tu=!c.Hf,a.Za=d}}}function dl(a,b,c){if(null!==b){for(var d=b.Fm.i;d.next();)dl(a,d.value,c);d=b.Tb;null===d||d.Hf||c&&!d.oF||(b.zz=!b.location.G(),d.doLayout(b),b.J(el),d.Hf=!0,Wj(a,b))}}
x.defineProperty(z,{ae:"isTreePathToChildren"},function(){return this.Gv},function(a){var b=this.Gv;if(b!==a&&(x.g(a,"boolean",z,"isTreePathToChildren"),this.Gv=a,this.j("isTreePathToChildren",b,a),!this.qa.tb))for(a=this.yh;a.next();)fl(a.value)});z.prototype.findTreeRoots=function(){for(var a=new J(E),b=this.yh;b.next();){var c=b.value;c.Gp&&null===c.zt()&&a.add(c)}return a.i};
x.defineProperty(z,{sB:"treeCollapsePolicy"},function(){return this.Ew},function(a){var b=this.Ew;b!==a&&(x.Ca(a,z,z,"treeCollapsePolicy"),this.Ew=a,this.j("treeCollapsePolicy",b,a))});x.defineProperty(z,{rh:null},function(){return this.FC},function(a){this.FC=a});
function lj(a){function b(a){var b=a.toLowerCase(),h=new J("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ra("string",J),d=new ra("string","string");b("AnimationStarting");b("AnimationFinished");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.Uy=c;a.Ty=d}
function Ja(a,b){var c=a.Ty.oa(b);return null!==c?c:a.Ty.oa(b.toLowerCase())}function gl(a,b){var c=a.Uy.oa(b);if(null!==c)return c;c=a.Uy.oa(b.toLowerCase());if(null!==c)return c;x.k("Unknown DiagramEvent name: "+b);return null}z.prototype.addDiagramListener=z.prototype.Tz=function(a,b){x.g(a,"string",z,"addDiagramListener:name");x.g(b,"function",z,"addDiagramListener:listener");var c=gl(this,a);null!==c&&c.add(b)};
z.prototype.removeDiagramListener=z.prototype.JF=function(a,b){x.g(a,"string",z,"removeDiagramListener:name");x.g(b,"function",z,"addDiagramListener:listener");var c=gl(this,a);null!==c&&c.remove(b)};z.prototype.raiseDiagramEvent=z.prototype.Ja=function(a,b,c){u&&x.g(a,"string",z,"raiseDiagramEvent:name");var d=gl(this,a),e=new ie;e.h=this;e.name=Ja(this,a);void 0!==b&&(e.mB=b);void 0!==c&&(e.TA=c);a=d.length;if(1===a)d=d.ia(0),d(e);else if(0!==a)for(b=d.kc(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
function Vg(a,b){var c=!1;a.Ab.pk(b)&&(c=!0);c=a.nA(b,function(a){return a.ea},function(a){return a instanceof G},!0,function(a){return a instanceof G},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.lj&&d.rc()}}z.prototype.isUnoccupied=z.prototype.Ip=function(a,b){void 0===b&&(b=null);return ka(this,!1,null,b).Ip(a.x,a.y,a.width,a.height)};
function ka(a,b,c,d){null===a.Gd&&(a.Gd=new hl);if(a.Gd.Ep||a.Gd.group!==c||a.Gd.kB!==d){if(null===c){b=a.Jj?Ej(a):a.Ec.copy();b.cg(100,100);a.Gd.initialize(b);b=x.kg();for(var e=a.yh;e.next();){var g=e.value,h=g.layer;null!==h&&h.visible&&!h.Nc&&il(a,g,d,b)}}else for(c.ba.G()||c.Af(),b=c.ba.copy(),b.cg(20,20),a.Gd.initialize(b),b=x.kg(),e=c.Gc;e.next();)g=e.value,g instanceof E&&il(a,g,d,b);x.qc(b);a.Gd.group=c;a.Gd.kB=d;a.Gd.Ep=!1}else b&&jl(a.Gd);return a.Gd}
function il(a,b,c,d){if(b!==c)if(b.isVisible()&&b.canAvoid()){c=b.getAvoidableRect(d);d=a.Gd.jp;b=a.Gd.hp;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)kl(a.Gd,h,k);kl(a.Gd,h,g)}for(k=c.y;k<g;k+=b)kl(a.Gd,e,k);kl(a.Gd,e,g)}else if(b instanceof F)for(b=b.Gc;b.next();)e=b.value,e instanceof E&&il(a,e,c,d)}function ll(a,b){null===a.Gd||a.Gd.Ep||null!==b&&!b.canAvoid()||(a.Gd.Ep=!0)}
z.prototype.simulatedMouseMove=z.prototype.by=function(a,b,c){if(null!==gg){var d=gg.h;c instanceof z||(c=null);var e=hg;c!==e&&(null!==e&&e!==d&&null!==e.vb.ke&&(mg(e),gg.tx=!1,e.vb.ke.doSimulatedDragLeave()),hg=c,null!==c&&c!==d&&null!==c.vb.ke&&(tg(),e=c.vb.ke,pg.contains(e)||pg.add(e),c.vb.ke.doSimulatedDragEnter()));if(null===c||c===d||!c.cE||c.kb||!c.ep)return!1;d=c.vb.ke;null!==d&&(null!==a?b=c.to(a):null===b&&(b=new N),c.Rb.ha=b,c.Rb.Jl=!1,c.Rb.up=!1,d.doSimulatedDragOver());return!0}return!1};
z.prototype.simulatedMouseUp=z.prototype.iG=function(a,b,c,d){if(null!==gg){null===d&&(d=b);b=hg;var e=gg.h;if(d!==b){if(null!==b&&b!==e&&null!==b.vb.ke)return mg(b),gg.tx=!1,b.vb.ke.doSimulatedDragLeave(),!1;hg=d;null!==d&&null!==d.vb.ke&&(tg(),b=d.vb.ke,pg.contains(b)||pg.add(b),d.vb.ke.doSimulatedDragEnter())}if(null===d)return gg.doCancel(),!0;if(d!==this)return null!==a&&(c=d.to(a)),d.Rb.ha=c,d.Rb.Jl=!1,d.Rb.up=!0,a=d.vb.ke,null!==a&&a.doSimulatedDrop(),a=gg,null!==a&&(d=a.mayCopy(),a.Of=d?"Copy":
"Move",a.stopTool()),!0}return!1};x.defineProperty(z,{iE:"autoScrollRegion"},function(){return this.Wu},function(a){"number"===typeof a?a=new yb(a):x.l(a,yb,z,"autoScrollRegion");var b=this.Wu;b.O(a)||(this.Wu=a=a.Y(),this.xc(),this.j("autoScrollRegion",b,a))});function Qg(a,b){a.Vu.assign(b);ml(a,a.Vu).wd(a.position)?mg(a):nl(a)}
function nl(a){-1===a.Qn&&(a.Qn=x.setTimeout(function(){if(-1!==a.Qn){mg(a);var b=a.S.event;if(null!==b){var c=ml(a,a.Vu);c.wd(a.position)||(a.position=c,a.S.ha=a.zG(a.Vu),a.by(b,null,b.target.W)||a.doMouseMove(),a.Jj=!0,Ij(a,a.oh()),a.ue=!0,a.dg(),nl(a))}}},a.QB))}function mg(a){-1!==a.Qn&&(x.clearTimeout(a.Qn),a.Qn=-1)}
function ml(a,b){var c=a.position,d=a.iE;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.Ab,g=a.scale,e=x.Dk(0,0,e.width*g,e.height*g),h=x.Xb(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.ou,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.ou,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.pu,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.pu,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.wd(Q.Ek)||(c=new N(c.x+h.x/g,c.y+h.y/g));x.qc(e);x.A(h);return c}z.prototype.makeSVG=z.prototype.makeSvg=function(a){void 0===a&&(a=new pa);a.context="svg";a=ol(this,a);return null!==a?a.bm:null};
z.prototype.makeImage=function(a){void 0===a&&(a=new pa);var b=(a.document||document).createElement("img");b.src=this.iJ(a);return b};z.prototype.makeImageData=z.prototype.iJ=function(a){void 0===a&&(a=new pa);var b=ol(this,a);return null!==b?b.toDataURL(a.type,a.details):""};var pl=!1;
function ol(a,b){a.$a.uj();a.dg();if(null===a.nb)return null;"object"!==typeof b&&x.k("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;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new Fa(Infinity,Infinity):new Fa(2E3,2E3));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.document||document,q=b.elementFinished||null,r=
b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new yb(l):l instanceof yb||(l=new yb(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.lo=!1;da(a);var s=new ma(null,p),t=s.getContext("2d"),v=s;if(!(d||e||k||h))return s.width=a.Lb+Math.ceil(l.left+l.right),s.height=a.Qb+Math.ceil(l.top+l.bottom),"svg"===b.context&&(t=v=new ed(s.Zd,p,q),t instanceof
ed&&(a.lo=!0)),dk(a,t,l,new Fa(s.width,s.height),a.dc,a.fb,k,m,r,n),a.lo=!0,v;var y=a.zb.$w,A=new N(0,0),B=a.Ec.copy();B.cK(a.padding);if(r)for(var C=!0,C=a.Zb.o,M=C.length,I=0;I<M;I++){var V=C[I];if(V.visible&&V.Nc)for(var ea=V.pb.o,V=ea.length,W=0;W<V;W++){var P=ea[W];P.vx&&P.isVisible()&&(P=P.ba,P.G()&&B.si(P))}}A.x=B.x;A.y=B.y;if(null!==k){var ba,C=!0,ea=k.i;for(ea.reset();ea.next();)M=ea.value,M instanceof D&&(P=M,V=P.layer,null!==V&&!V.visible||null!==V&&!r&&V.Nc||!P.isVisible()||(P=P.ba,P.G()&&
(C?(C=!1,ba=P.copy()):ba.si(P))));C&&(ba=new w(0,0,0,0));B.width=ba.width;B.height=ba.height;A.x=ba.x;A.y=ba.y}null!==h&&h.G()&&(A=h,e||(e=y));C=ea=0;null!==l&&(ea=l.left+l.right,C=l.top+l.bottom);I=M=0;null!==d&&(M=d.width,I=d.height,isFinite(M)&&(M=Math.max(0,M-ea)),isFinite(I)&&(I=Math.max(0,I-C)));ba=h=0;null!==d&&null!==e?("NaN"===e&&(e=y),d.G()?(h=M,ba=I):isNaN(I)?(h=M,ba=B.height*e):(h=B.width*e,ba=I)):null!==d?d.G()?(e=Math.min(M/B.width,I/B.height),h=M,ba=I):isNaN(I)?(e=M/B.width,h=M,ba=
B.height*e):(e=I/B.height,h=B.width*e,ba=I):null!==e?"NaN"===e&&g.G()?(e=Math.min((g.width-ea)/B.width,(g.height-C)/B.height),e>y?(e=y,h=B.width,ba=B.height):(h=g.width,ba=g.height)):(h=B.width*e,ba=B.height*e):(e=y,h=B.width,ba=B.height);null!==l?(h+=ea,ba+=C):l=new yb(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!pl&&(h>d||ba>g)&&(x.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ba)+" vs 2000x2000) Consider increasing the max size."),
pl=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ba=Math.min(ba,g)));s.width=Math.ceil(h);s.height=Math.ceil(ba);"svg"===b.context&&(t=v=new ed(s.Zd,p,q),t instanceof ed&&(a.lo=!0));dk(a,t,l,new Fa(Math.ceil(h),Math.ceil(ba)),e,A,k,m,r,n);a.lo=!0;return v}z.inherit=function(a,b){x.g(a,"function",z,"inherit");x.g(b,"function",z,"inherit");b.eH&&x.k("Cannot inherit from "+x.kf(b));x.Qa(a,b)};
function uj(){this.hH="63ad05bbe23a1786468a4c741b6d2";this.Rh=this.hH===this._tk?!0:null}
uj.prototype.fm=function(a){a.Ze.setTransform(a.ge,0,0,a.ge,0,0);if(null===this.Rh)a:{var b="f",c=window[x.Dg("76a715b2f73f148a")][x.Dg("72ba13b5")];a=x.Dg;if(a("77bb5bb2f32603de")===window[a("76a715b2f73f148a")][a("6aba19a7ec351488")])try{this.Rh=!window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b")])([a("7bb8069ae7")]===a(x.adym));if(!1===this.Rh)break a;this.Rh=!window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([a("7bb8069ae7")]===
a(x.adym));if(!1===this.Rh)break a}catch(d){}for(var e=c[a("76ad18b4f73e")],g=c[a("73a612b6fb191d")](a("35e7"))+2;g<e;g++)b+=c[g];c=b[a("73a612b6fb191d")](a(x.adym));0>c&&a(x.adym)!==a("7da71ca0ad381e90")&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));if(this.Rh=!(0<=c&&c<b[a("73a612b6fb191d")](a("35"))))b=window.document[a("79ba13b2f7333e8846865a7d00")]("div"),c=a("02cncncn"),"."===c[0]&&(c=c[a("69bd14a0f724128a44")](1)),b[a("79a417a0f0181a8946")]=c,window.document[a("78a712aa")]?(window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](b),
c=window[a("7dad0290ec3b0b91578e5b40007031bf")](b)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")),window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(a(x.GH))&&-1!==c.indexOf(a(x.HH))&&(this.Rh=!1)):(this.Rh=null,this.Rh=!1)}return 0<this.Rh&&this!==this.fH?!0:!1};uj.prototype.t=function(){this.fH=null};
function vj(a,b){void 0!==b&&null!==b||x.k("Diagram setup requires an argument DIV.");null!==a.Ub&&x.k("Diagram has already completed setup.");"string"===typeof b?a.Ub=window.document.getElementById(b):b instanceof HTMLDivElement?a.Ub=b:x.k("No DIV or DIV id supplied: "+b);null===a.Ub&&x.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Ub.W&&x.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Ub,null).position&&(a.Ub.style.position=
"relative");a.Ub.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Ub.style["-ms-touch-action"]="none";a.Ub.innerHTML="";a.Ub.W=a;var c=new ma(a);c.Zd.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","rtl"===window.getComputedStyle(a.Ub,null).getPropertyValue("direction")&&(a.PC=!0),c.style.zIndex="2",c.style.tM="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
"none");a.Lb=a.Ub.clientWidth||1;a.Qb=a.Ub.clientHeight||1;a.nb=c;a.Ze=c.getContext("2d");var d=a.Ze;a.ge=a.computePixelRatio();fk(a,a.Lb,a.Qb);a.Ay=d[x.Dg("7eba17a4ca3b1a8346")][x.Dg("78a118b7")](d,x.fm,4,4);a.Ub.insertBefore(c.Zd,a.Ub.firstChild);c=new ma(null);c.width=1;c.height=1;a.Wy=c;a.uC=c.getContext("2d");c=x.createElement("div");d=x.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Lb+"px";c.style.height=a.Qb+"px";c.style.zIndex="1";d.style.position=
"absolute";d.style.width="1px";d.style.height="1px";a.Ub.appendChild(c);c.appendChild(d);c.onscroll=a.$G;c.onmousedown=a.cD;c.ontouchstart=a.cD;c.W=a;c.cH=!0;c.dH=!0;a.ow=c;a.vs=d;a.$A=x.yE(function(){a.fk=null;a.ua()},300,!1);a.EG=x.yE(function(){Di(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.Pp=function(b){if(a.isEnabled){a.sm=!0;var c=a.Zc;x.tn&&c.nj?(b.preventDefault(),b.simulated=!0,a.Gs=b):(a.Zc=a.Rb,a.Rb=c,Lj(a,a,b,c,!0),a.by(b,null,b.target.W)||(a.doMouseMove(),
a.eb.isBeyondDragSize()&&(a.xm=0),ja(a,c,b)))}};a.Op=function(b){if(a.isEnabled){a.sm=!0;var c=a.Zc;if(x.tn&&null!==a.Gs)a.Gs=b,b.preventDefault();else if(x.tn&&400>b.timeStamp-a.ym)b.preventDefault();else if(a.Fv&&2===b.button)b.preventDefault();else if(a.Zc=a.Rb,a.Rb=c,Lj(a,a,b,c,!0),c.Jl=!0,c.ff=b.detail,a.Gi=c,a.focus(),!0===c.$q.simulated)b.preventDefault(),b.simulated=!0;else{u&&u.CF&&(window.CF=a.sp(c.ha));gg=null;a.doMouseDown();a.Gi=a.Gi.copy();if(1===b.button)return b.preventDefault(),!1;
ja(a,c,b)}}};a.Rp=function(b){if(a.isEnabled){a.sm=!0;var c=a.Zc;if(x.tn){if(400>b.timeStamp-a.ym){b.preventDefault();return}a.ym=b.timeStamp}if(x.tn&&null!==a.Gs)a.Gs=null,b.preventDefault();else{a.Zc=a.Rb;a.Rb=c;Lj(a,a,b,c,!0);c.up=!0;c.ff=b.detail;if(x.RI||x.SI)b.timeStamp-a.ym<a.RD&&!a.eb.isBeyondDragSize()?a.xm++:a.xm=1,a.ym=b.timeStamp,c.ff=a.xm;c.bubbles=b.bubbles;b.target.W&&(c.Mg=b.target.W);a.iG(b,null,new N,c.Mg)||(a.doMouseUp(),mg(a),ja(a,c,b))}}};a.wh=function(b){if(a.isEnabled){var c=
a.Zc;a.Zc=a.Rb;a.Rb=c;Lj(a,a,b,c,!0);c.bubbles=!0;c.Hl=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();ja(a,c,b)}};a.Qp=function(){if(a.isEnabled){a.sm=!1;var b=a.eb;b.cancelWaitAfter();b instanceof Hf&&b.hideToolTip()}};a.vG=function(b){if(a.isEnabled){a.zw=!1;a.Fv=!0;var c=a.Zc;a.Zc=a.Rb;a.Rb=c;Nj(a,b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();ja(a,c,b)}};a.uG=function(b){if(a.isEnabled){var c=a.Zc;a.Zc=a.Rb;a.Rb=c;var d=null;0<b.changedTouches.length?d=b.changedTouches[0]:
0<b.targetTouches.length&&(d=b.targetTouches[0]);Oj(a,b,d,c,1<b.touches.length);a.by(d?d:b,null,c.Mg)||a.doMouseMove();ja(a,c,b)}};a.tG=function(b){if(a.isEnabled){if(a.zw)return b.preventDefault(),!1;var c=a.Zc;a.Zc=a.Rb;a.Rb=c;if(1<b.touches.length)a.zp("hasGestureZoom")&&(a.dz=!1);else{var d=null,k=null;0<b.changedTouches.length?k=b.changedTouches[0]:0<b.targetTouches.length&&(k=b.targetTouches[0]);c.h=a;c.ff=1;if(null!==k){d=window.document.elementFromPoint(k.clientX,k.clientY);null!==d&&d.W instanceof
z&&d.W!==a&&Mj(d.W,k,c);Mj(a,b.changedTouches[0],c);var l=k.screenX,m=k.screenY,n=a.TC;b.timeStamp-a.ym<a.RD&&!(25<Math.abs(n.x-l)||25<Math.abs(n.y-m))?a.xm++:a.xm=1;c.ff=a.xm;a.ym=b.timeStamp;a.TC.n(l,m)}c.yd=0;c.button=0;c.buttons=1;c.Jl=!1;c.up=!0;c.Hl=0;c.Mc=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.Mg=null===d?b.target.W:d.W?d.W:null;c.Ee=null;a.iG(k?k:b,null,new N,c.Mg)||a.doMouseUp();ja(a,c,b);a.Fv=!1}}};a.AJ=function(b){if("touch"===b.pointerType){var c=a.mD;void 0===c[b.pointerId]&&
(a.ew++,c[b.pointerId]=b);a.Wf[0]=null;a.Wf[1]=null;for(var d in c)if(null===a.Wf[0])a.Wf[0]=c[d];else if(null===a.Wf[1]){a.Wf[1]=c[d];break}a.isEnabled&&(a.zw=!1,c=a.Zc,a.Zc=a.Rb,a.Rb=c,Nj(a,b,b,c,1<a.ew),a.doMouseDown(),ja(a,c,b))}};a.CJ=function(b){if("touch"===b.pointerType&&!(2>a.ew)){var c=a.Wf;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Zc,a.Zc=a.Rb,a.Rb=c,Oj(a,b,b,c,!0),a.by(b,null,c.Mg)||(a.doMouseMove(),ja(a,c,b)))}};a.BJ=function(b){if("touch"===
b.pointerType){var c=a.mD;void 0!==c[b.pointerId]&&(a.ew--,delete c[b.pointerId],c=a.Wf,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};da(a);yj(a)}function ql(a){1<arguments.length&&x.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");z.call(this,a);this.ft=!0;this.yl=!1;this.kb=!0;this.tE=ac;this.Tb=new rl}x.Qa(ql,z);x.ja("Palette",ql);
function rj(a){1<arguments.length&&x.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");z.call(this,a);this.$a.isEnabled=!1;this.gd=!0;this.Yj=null;this.nv=!0;this.VJ("drawShadows",!1);var b=new D,c=new Y;c.stroke="magenta";c.yb=2;c.fill="transparent";c.name="BOXSHAPE";b.Ak=!0;b.Vx="BOXSHAPE";b.Ex="BOXSHAPE";b.TF="BOXSHAPE";b.cursor="move";b.add(c);this.mm=b;c=new fa;c.type=Fh;c.of=dc;var d=new Gh;d.Gf=!0;c.add(d);d=new Y;d.mk=dc;d.Jb="Rectangle";d.Ba=new Fa(64,
64);d.cursor="se-resize";d.alignment=lc;c.add(d);b.RF=c;this.Zm=this.nk=!1;this.yf=this.ht=!0;this.iE=0;this.Kz=x.createElement("canvas");this.gH=this.Kz.getContext("2d");this.vb.ke=new sl;this.vb.UF=new tl;var e=this;this.click=function(){var a=e.Yj;if(null!==a){var b=a.Ab,c=e.S.ha;a.position=new N(c.x-b.width/2,c.y-b.height/2)}};this.EF=function(){ul(e)};this.DF=function(){null!==e.Yj&&(e.xc(),e.ua())};this.Al=Jj;this.gd=!1}x.Qa(rj,z);x.ja("Overview",rj);
function vl(a){a.gd||a.Vd||!1!==a.Xf||(a.Xf=!0,requestAnimationFrame(function(){if(a.Xf&&!a.Vd&&(a.Xf=!1,null!==a.Ub)){a.Vd=!0;Dj(a);a.Ec.G()||Ij(a,a.oh());null===a.Ub&&x.k("No div specified");null===a.nb&&x.k("No canvas specified");if(a.ue){var b=a.Yj;if(null!==b&&!b.$a.Df&&!b.$a.Bc){var b=a.Ze,c=a.Kz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.nb.width,a.nb.height);b.drawImage(c,0,0);c=a.Ld;c.reset();1!==a.scale&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.position.x,-a.position.y);
b.setTransform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.Zb.o,d=c.length,e=0;e<d;e++)c[e].gf(b,a);a.dl=!1;a.ue=!1}}a.Vd=!1}}))}rj.prototype.computePixelRatio=function(){return 1};
rj.prototype.gf=function(){null===this.Ub&&x.k("No div specified");null===this.nb&&x.k("No canvas specified");if(this.ue){var a=this.Yj;if(null!==a&&!a.$a.Df){ak(this);var b=a.Ft;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&Sj(a);var c=this.nb,b=this.Ze,d=this.Kz,e=this.gH;d.width=c.width;d.height=c.height;b.Hu="";b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.nb.width,this.nb.height);var g=this.Ld;g.reset();1!==this.scale&&g.scale(this.scale);0===this.position.x&&0===this.position.y||
g.translate(-this.position.x,-this.position.y);b.setTransform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);for(var h=this.nv,k=this.Ab,l=a.Zb.o,m=l.length,a=0;a<m;a++){var n=l[a],p=b,q=k,r=h;if(n.visible&&0!==n.Xc&&(void 0===r&&(r=!0),r||!n.Nc)){1!==n.Xc&&(p.globalAlpha=n.Xc);for(var r=this.scale,n=n.pb.o,s=n.length,t=0;t<s;t++){var v=n[t],y=v.ba;y.Hg(q)&&(1<y.width*r||1<y.height*r?v.gf(p,this):dj(v,p))}p.globalAlpha=1}}e.drawImage(c.Zd,0,0);u&&u.dj&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));c=
this.Zb.o;d=c.length;for(a=0;a<d;a++)c[a].gf(b,this);u&&(u.jA||u.dj)&&u.iA(b,this,g);this.ue=this.dl=!1}}};
x.defineProperty(rj,{SA:"observed"},function(){return this.Yj},function(a){var b=this.Yj;null!==a&&x.l(a,z,rj,"observed");a instanceof rj&&x.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.nh),b.JF("ViewportBoundsChanged",this.EF),b.JF("DocumentBoundsChanged",this.DF),b.aw.remove(this)),this.Yj=a,null!==a&&(a.Tz("ViewportBoundsChanged",this.EF),a.Tz("DocumentBoundsChanged",this.DF),a.aw.add(this),this.add(this.nh),ul(this)),this.xc(),this.j("observed",
b,a))});x.defineProperty(rj,{nh:"box"},function(){return this.mm},function(a){var b=this.mm;b!==a&&(this.mm=a,this.remove(b),this.add(this.mm),ul(this),this.j("box",b,a))});x.defineProperty(rj,{kL:"drawsTemporaryLayers"},function(){return this.nv},function(a){this.nv!==a&&(this.nv=a,this.iu())});
function ul(a){var b=a.nh;if(null!==b){var c=a.Yj;if(null!==c){a.ue=!0;var c=c.Ab,d=b.Dn,e=x.dm();e.n(c.width,c.height);d.Ba=e;x.tk(e);a=2/a.scale;d instanceof Y&&(d.yb=a);b.location=new N(c.x-a/2,c.y-a/2)}}}rj.prototype.oh=function(){var a=this.Yj;return null===a?Q.sy:a.Ec};rj.prototype.fF=function(){!0!==this.ue&&(this.ue=!0,vl(this))};rj.prototype.fu=function(a){this.gd||(Bj(this),this.ua(),Pj(this),this.xc(),ul(this),this.Ja("ViewportBoundsChanged",null,a))};
function sl(){Mf.call(this);this.nl=null}x.Qa(sl,Mf);sl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.yl||!a.yf)return!1;var b=a.SA;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.Ab;this.nl=new N(c.width/2,c.height/2);a=a.Fc.ha;b.position=new N(a.x-this.nl.x,a.y-this.nl.y)}return!0};sl.prototype.doActivate=function(){this.nl=null;Mf.prototype.doActivate.call(this)};
sl.prototype.moveParts=function(){var a=this.h,b=a.SA;if(null!==b){var c=a.nh;if(null!==c){if(null===this.nl){var d=a.Fc.ha,c=c.location;this.nl=new N(d.x-c.x,d.y-c.y)}a=a.S.ha;b.position=new N(a.x-this.nl.x,a.y-this.nl.y)}}};function tl(){Dh.call(this)}x.Qa(tl,Dh);tl.prototype.resize=function(a){var b=this.h.SA;if(null!==b){var c=b.Ab.copy();b.position=a.position;(c.width!==a.width||c.height!==a.height)&&0<a.width&&0<a.height&&(b.scale=Math.min(c.width/a.width,c.height/a.height))}};
function Ea(a){1<arguments.length&&x.k("Brush constructor can take at most one optional argument, the Brush type.");x.lc(this);this.H=!1;void 0===a?(this.da=Ze,this.Tn="black"):"string"===typeof a?(this.da=Ze,u&&!Da(a)&&x.k('Color "'+a+'" is not a valid color string for Brush constructor'),this.Tn=a):(u&&x.Ca(a,Ea,Ea,"constructor:type"),this.da=a,this.Tn="black");var b=this.da;b===$e?(this.Wo=ac,this.no=kc):this.no=b===af?this.Wo=dc:this.Wo=Wb;this.ww=0;this.ov=NaN;this.Vg=this.dw=this.Ug=null;this.Ky=
this.Ly=0}x.ja("Brush",Ea);var Ze;Ea.Solid=Ze=x.s(Ea,"Solid",0);var $e;Ea.Linear=$e=x.s(Ea,"Linear",1);var af;Ea.Radial=af=x.s(Ea,"Radial",2);var wl;Ea.Pattern=wl=x.s(Ea,"Pattern",4);Ea.prototype.copy=function(){var a=new Ea;a.da=this.da;a.Tn=this.Tn;a.Wo=this.Wo.Y();a.no=this.no.Y();a.ww=this.ww;a.ov=this.ov;null!==this.Ug&&(a.Ug=this.Ug.copy());a.dw=this.dw;return a};Ea.prototype.Ma=function(){this.freeze();Object.freeze(this);return this};
Ea.prototype.freeze=function(){this.H=!0;null!==this.Ug&&this.Ug.freeze();return this};Ea.prototype.Va=function(){Object.isFrozen(this)&&x.k("cannot thaw constant: "+this);this.H=!1;null!==this.Ug&&this.Ug.Va();return this};
Ea.prototype.toString=function(){var a="Brush(";if(this.type===Ze)a+=this.color;else if(a=this.type===$e?a+"Linear ":this.type===af?a+"Radial ":this.type===wl?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.pt)for(var b=this.pt.i;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
Ea.prototype.addColorStop=Ea.prototype.addColorStop=function(a,b){this.H&&x.pa(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&x.la(a,"0 <= loc <= 1",Ea,"addColorStop:loc");x.g(b,"string",Ea,"addColorStop:color");u&&!Da(b)&&x.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.Ug&&(this.Ug=new ra("number","string"));this.Ug.add(a,b);this.da===Ze&&(this.type=$e);this.Vg=null};
x.defineProperty(Ea,{type:"type"},function(){return this.da},function(a){this.H&&x.pa(this,a);x.Ca(a,Ea,Ea,"type");this.da=a;this.start.ze()&&(a===$e?this.start=ac:a===af&&(this.start=dc));this.end.ze()&&(a===$e?this.end=kc:a===af&&(this.end=dc));this.Vg=null});x.defineProperty(Ea,{color:"color"},function(){return this.Tn},function(a){this.H&&x.pa(this,a);u&&!Da(a)&&x.k('Color "'+a+'" is not a valid color string for Brush.color');this.Tn=a;this.Vg=null});
x.defineProperty(Ea,{start:"start"},function(){return this.Wo},function(a){this.H&&x.pa(this,a);x.l(a,R,Ea,"start");this.Wo=a.Y();this.Vg=null});x.defineProperty(Ea,{end:"end"},function(){return this.no},function(a){this.H&&x.pa(this,a);x.l(a,R,Ea,"end");this.no=a.Y();this.Vg=null});x.defineProperty(Ea,{xu:"startRadius"},function(){return this.ww},function(a){this.H&&x.pa(this,a);x.p(a,Ea,"startRadius");0>a&&x.la(a,">= zero",Ea,"startRadius");this.ww=a;this.Vg=null});
x.defineProperty(Ea,{ut:"endRadius"},function(){return this.ov},function(a){this.H&&x.pa(this,a);x.p(a,Ea,"endRadius");0>a&&x.la(a,">= zero",Ea,"endRadius");this.ov=a;this.Vg=null});x.defineProperty(Ea,{pt:"colorStops"},function(){return this.Ug},function(a){this.H&&x.pa(this,a);u&&x.l(a,ra,Ea,"colorStops");this.Ug=a;this.Vg=null});x.defineProperty(Ea,{pattern:"pattern"},function(){return this.dw},function(a){this.H&&x.pa(this,a);this.dw=a;this.Vg=null});
Ea.randomColor=function(a,b){void 0===a&&(a=128);u&&(x.p(a,Ea,"randomColor:min"),(0>a||255<a)&&x.la(a,"0 <= min <= 255",Ea,"randomColor:min"));void 0===b&&(b=Math.max(a,255));u&&(x.p(b,Ea,"randomColor:max"),(b<a||255<b)&&x.la(b,"min <= max <= 255",Ea,"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};var xl=x.createElement("canvas").getContext("2d"),Da;Ea.isValidColor=Da=function(a){if("black"===a)return!0;if(""===a)return!1;u&&x.g(a,"string",Ea,"isValidColor");xl.fillStyle="#000000";var b=xl.fillStyle;xl.fillStyle=a;if(xl.fillStyle!==b)return!0;xl.fillStyle="#FFFFFF";b=xl.fillStyle;xl.fillStyle=a;return xl.fillStyle!==b};
function O(){x.lc(this);this.ka=30723;this.Xc=1;this.fh=null;this.Vb="";this.uc=this.Pb=null;this.fb=(new N(NaN,NaN)).freeze();this.uf=Q.EB;this.Vj=Q.Ln;this.Tj=Q.HB;this.Ld=new Ha;this.Fk=new Ha;this.il=new Ha;this.dc=this.lv=1;this.jm=0;this.gi=yl;this.Er=Q.nq;this.jd=(new w(NaN,NaN,NaN,NaN)).freeze();this.Yb=(new w(NaN,NaN,NaN,NaN)).freeze();this.Wc=(new w(0,0,NaN,NaN)).freeze();this.Qs=this.ar=this.ma=this.es=this.Km=null;this.Rs=this.br=Infinity;this.uq=this.Ie=Jc;this.ss=0;this.Ui=1;this.Bq=
0;this.yi=1;this.Ks=null;this.xs=-Infinity;this.ws=0;this.ys=Q.Ek;this.zs=uh;this.Lq="";this.Uc=this.na=null;this.Rn=-1;this.Jm=this.Fs=this.xi=this.Vk=this.Vo=null}x.li(O);x.ja("GraphObject",O);
O.prototype.cloneProtected=function(a){a.ka=this.ka|6144;a.Xc=this.Xc;a.Vb=this.Vb;a.Pb=this.Pb;a.uc=this.uc;a.fb.assign(this.fb);a.uf=this.uf.Y();a.Vj=this.Vj.Y();a.Tj=this.Tj.Y();a.il=this.il.copy();a.dc=this.dc;a.jm=this.jm;a.gi=this.gi;a.Er=this.Er.Y();a.jd.assign(this.jd);a.Yb.assign(this.Yb);a.Wc.assign(this.Wc);a.es=this.es;null!==this.ma&&(a.ma=this.ma.copy());a.ar=this.ar;a.Qs=this.Qs;a.br=this.br;a.Rs=this.Rs;a.Ie=this.Ie.Y();a.uq=this.uq.Y();a.ss=this.ss;a.Ui=this.Ui;a.Bq=this.Bq;a.yi=
this.yi;a.Ks=this.Ks;a.xs=this.xs;a.ws=this.ws;a.ys=this.ys.Y();a.zs=this.zs;a.Lq=this.Lq;null!==this.na&&(a.na=this.na.copy());a.Uc=this.Uc;a.Rn=this.Rn;null!==this.Vk&&(a.Vk=x.Cl(this.Vk));null!==this.xi&&(a.xi=this.xi.copy());a.Fs=this.Fs};O.prototype.addCopyProperty=O.prototype.pH=function(a){var b=this.Vk;if(x.isArray(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.Vk=b=[];b.push(a)};O.prototype.mi=function(a){a.Km=null;a.Jm=null;a.T()};
O.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.Vk)for(var b=0;b<this.Vk.length;b++){var c=this.Vk[b];a[c]=this[c]}return a};O.prototype.copy=function(){return this.clone()};O.prototype.toString=function(){return x.kf(Object.getPrototypeOf(this))+"#"+x.od(this)};var Hh;O.None=Hh=x.s(O,"None",0);var yl;O.Default=yl=x.s(O,"Default",0);var zl;O.Vertical=zl=x.s(O,"Vertical",4);var Al;O.Horizontal=Al=x.s(O,"Horizontal",5);var xd;O.Fill=xd=x.s(O,"Fill",3);var Jh;
O.Uniform=Jh=x.s(O,"Uniform",1);var Kh;O.UniformToFill=Kh=x.s(O,"UniformToFill",2);function Bl(a){null===a.na&&(a.na=new Cl)}O.prototype.Ve=function(){if(null===this.ma){var a=new Dl;a.Hj=Wb;a.jk=Wb;a.Fj=10;a.hk=10;a.Ej=El;a.gk=El;a.Gj=0;a.ik=0;this.ma=a}};
function Fl(a,b,c,d,e,g,h){var k=.001,l=g.length;a.moveTo(b,c);d-=b;k=e-c;0===d&&(d=.001);e=k/d;for(var m=Math.sqrt(d*d+k*k),n=0,p=!0,q=0===h?!1:!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}}O.prototype.raiseChangedEvent=O.prototype.Rc=function(a,b,c,d,e,g,h){var k=this.ea;null!==k&&(k.Bn(a,b,c,d,e,g,h),0!==(this.ka&1024)&&c===this&&a===we&&Gl(this,k,b))};
function Gl(a,b,c){var d=a.vp();if(null!==d)for(var e=a.Uc.i;e.next();){var g=e.value,h=null;if(null!==g.En){h=Df(g,d,a);if(null===h)continue;g.hy(a,h,c,null)}else if(g.Qt){var k=b.h;null!==k&&g.hy(a,k.aa.yk,c,k)}else{var l=d.data;if(null===l)continue;k=b.h;null!==k&&k.ey||g.hy(a,l,c,k)}null!==h&&(k=d.ix(g.cm),null!==k&&g.CG(k,h,c))}}O.prototype.ix=function(a){return this.Rn===a?this:null};O.prototype.raiseChanged=O.prototype.j=function(a,b,c){this.Rc(we,a,this,b,c)};
function Hl(a,b,c,d,e){var g=a.jd,h=a.il;h.reset();Il(a,h,b,c,d,e);a.il=h;g.x=b;g.y=c;g.width=d;g.height=e;h.Nt()||h.yG(g)}function Jl(a,b,c,d){if(!1===a.ig)return!1;d.multiply(a.transform);return c?a.Hg(b,d):a.en(b,d)}
O.prototype.QE=function(a,b,c){if(!1===this.ig)return!1;var d=this.Ga;b=a.qk(b);var e=!1;c&&(e=sb(a.x,a.y,0,0,0,d.height)<b||sb(a.x,a.y,0,d.height,d.width,d.height)<b||sb(a.x,a.y,d.width,d.height,d.width,0)<b||sb(a.x,a.y,d.width,0,0,0)<b);c||(e=sb(a.x,a.y,0,0,0,d.height)<b&&sb(a.x,a.y,0,d.height,d.width,d.height)<b&&sb(a.x,a.y,d.width,d.height,d.width,0)<b&&sb(a.x,a.y,d.width,0,0,0)<b);return e};O.prototype.Pg=function(){return!0};
O.prototype.containsPoint=O.prototype.Na=function(a){u&&x.l(a,N,O,"containsPoint:p");var b=x.P();b.assign(a);this.transform.Fb(b);var c=this.ba;if(!c.G())return!1;var d=this.h;if(null!==d&&d.Fv){var e=d.zp("extraTouchThreshold"),g=d.zp("extraTouchArea"),h=g/2,k=this.Ga,d=this.jj()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=Gb(c.x-h*l,c.y-h*l,c.width+g*l,c.height+g*l,b.x,b.y),x.A(b),a}if(this instanceof fa||this instanceof Y?Gb(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Na(b)){if(this.xi&&
!this.xi.Na(b))return!1;if(null!==this.uc&&c.Na(b)||null!==this.Pb&&this.Wc.Na(a))return!0;x.A(b);return this.ok(a)}x.A(b);return!1};O.prototype.ok=function(a){var b=this.Ga;return Gb(0,0,b.width,b.height,a.x,a.y)};
O.prototype.containsRect=O.prototype.pk=function(a){u&&x.l(a,w,O,"containsRect:r");if(0===this.angle)return this.ba.pk(a);var b=this.Ga,b=x.Dk(0,0,b.width,b.height),c=this.transform,d=!1,e=x.Xb(a.x,a.y);b.Na(c.oi(e))&&(e.n(a.x,a.bottom),b.Na(c.oi(e))&&(e.n(a.right,a.bottom),b.Na(c.oi(e))&&(e.n(a.right,a.y),b.Na(c.oi(e))&&(d=!0))));x.A(e);x.qc(b);return d};
O.prototype.containedInRect=O.prototype.en=function(a,b){u&&x.l(a,w,O,"containedInRect:r");if(void 0===b)return a.pk(this.ba);var c=this.Ga,d=!1,e=x.Xb(0,0);a.Na(b.Fb(e))&&(e.n(0,c.height),a.Na(b.Fb(e))&&(e.n(c.width,c.height),a.Na(b.Fb(e))&&(e.n(c.width,0),a.Na(b.Fb(e))&&(d=!0))));return d};
O.prototype.intersectsRect=O.prototype.Hg=function(a,b){u&&x.l(a,w,O,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.Hg(this.ba);var c=this.Ga,d=b,e=x.Xb(0,0),g=x.Xb(0,c.height),h=x.Xb(c.width,c.height),k=x.Xb(c.width,0),l=!1;if(a.Na(d.Fb(e))||a.Na(d.Fb(g))||a.Na(d.Fb(h))||a.Na(d.Fb(k)))l=!0;else{var c=x.Dk(0,0,c.width,c.height),m=x.Xb(a.x,a.y);c.Na(d.oi(m))?l=!0:(m.n(a.x,a.bottom),c.Na(d.oi(m))?l=!0:(m.n(a.right,a.bottom),c.Na(d.oi(m))?l=!0:(m.n(a.right,a.y),c.Na(d.oi(m))&&
(l=!0))));x.A(m);x.qc(c);!l&&(Q.qx(a,e,g)||Q.qx(a,g,h)||Q.qx(a,h,k)||Q.qx(a,k,e))&&(l=!0)}x.A(e);x.A(g);x.A(h);x.A(k);return l};O.prototype.getDocumentPoint=O.prototype.gb=function(a,b){void 0===b&&(b=new N);a.ze()&&x.k("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.Ga;b.n(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY);this.mh.Fb(b);return b};
O.prototype.getDocumentAngle=O.prototype.Nl=function(){var a;a=this.mh;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};O.prototype.getDocumentScale=O.prototype.jj=function(){if(0!==(this.ka&4096)===!1)return this.lv;var a=this.dc;return null!==this.V?a*this.V.jj():a};O.prototype.getLocalPoint=O.prototype.WE=function(a,b){void 0===b&&(b=new N);b.assign(a);this.mh.oi(b);return b};
O.prototype.getNearestIntersectionPoint=O.prototype.Ql=function(a,b,c){return this.Ap(a.x,a.y,b.x,b.y,c)};f=O.prototype;f.Ap=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.zl)return g=this.ba,Q.Ql(g.left,g.top,g.right,g.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.n(0,0);d=this.Ga;c=Q.Ql(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c};
function ji(a,b,c,d,e){if(!1!==Xj(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.Ba,k=0;a.yb&&(k=a.yb);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof H;switch(Kl(a,!0)){case Hh:k=g=0;l&&(c=b=Infinity);break;case xd:isFinite(b)&&b>d&&(g=b);isFinite(c)&&
c>e&&(k=c);break;case Al:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case zl:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.Ae,m=a.Kf;g>l.width&&m.width<l.width&&(g=l.width);k>l.height&&m.height<l.height&&(k=l.height);d=Math.max(g/a.scale,m.width);e=Math.max(k/a.scale,m.height);l.width<d&&(d=Math.min(m.width,d));l.height<e&&(e=Math.min(m.height,e));b=Math.min(l.width,b);c=Math.min(l.height,c);b=Math.max(d,b);c=Math.max(e,c);if(90===h||270===h)g=b,b=c,c=g,g=d,d=e,e=g;a.jd.Va();a.Np(b,c,
d,e);a.jd.freeze();a.jd.G()||x.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.jd.toString());Rj(a,!1)}}
f.Kc=function(a,b,c,d,e){this.Hi();var g=x.kg();g.assign(this.Yb);this.Yb.Va();if(!1===Yj(this)){var h=this.Yb;h.x=a;h.y=b;h.width=c;h.height=d}else this.bj(a,b,c,d);this.Yb.freeze();this.xi=void 0===e?null:e;c=!1;void 0!==e?c=!0:null!==this.V&&(e=this.V.Wc,d=this.Ia,null!==this.zl&&(d=this.Yb),c=b+d.height,d=a+d.width,c=!(0<=a+.05&&d<=e.width+.05&&0<=b+.05&&c<=e.height+.05),this instanceof sa&&(a=this.Wc,this.Nv>a.height||this.Pj.cf>a.width))&&(c=!0);this.ka=c?this.ka|256:this.ka&-257;this.Yb.G()||
x.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Yb.toString());this.Hx(g,this.Yb);x.qc(g)};f.bj=function(){};
function Ll(a,b,c,d,e){var g=a.ba;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Ba.G()){g=a.jd;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=Kl(a,!0);c===d&&g===e&&(b=Hh);switch(b){case Hh:if(c>d||g>e)Rj(a,!0),ji(a,c>d?d:c,g>e?e:g);break;case xd:Rj(a,!0);ji(a,d,e,0,0);break;case Al:Rj(a,!0);ji(a,d,g,0,0);break;case zl:Rj(a,!0),ji(a,c,e,0,0)}}}
f.Hx=function(a,b){Ml(this,!1);var c=this.ea;if(null!==c&&null!==c.h){var d=this.ea;null!==d&&(d.Dn!==this&&d.SF!==this&&d.WF!==this||Nl(d,!0));this.ua();a.O(b)||(c.Sl(),this.Wv(c))}};f.Wv=function(a){null!==this.zd&&Nl(a,!0)};x.defineProperty(O,{gq:"shadowVisible"},function(){return this.Fs},function(a){var b=this.Fs;b!==a&&(u&&null!==a&&x.g(a,"boolean",O,"shadowVisible"),this.Fs=a,this.j("shadowVisible",b,a))});
O.prototype.gf=function(a,b){if(this.visible){var c=this.opacity,d=1;if(1!==c){if(0===c)return;d=a.globalAlpha;a.globalAlpha=d*c}if(a instanceof ed)a:{if(this.visible){var e=null,g=a.zx;if(this instanceof H&&(this.type===Ol||this.type===Pl))Ql(this,a,b);else{var h=this.Yb;if(0!==h.width&&0!==h.height&&!isNaN(h.x)&&!isNaN(h.y)){var k=this.transform,l=this.V;0!==(this.ka&4096)===!0&&Rl(this);var m=0!==(this.ka&256),n=!1;this instanceof sa&&Sl(this,a);if(m){n=l.Pg()?l.Ga:l.ba;if(null!==this.xi)var p=
this.xi,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(h.x,n.x),r=Math.max(h.y,n.y),s=Math.min(h.right,n.right)-q,p=Math.min(h.bottom,n.bottom)-r;if(q>h.width+h.x||h.x>n.width+n.x||r>h.height+h.y||h.y>n.height+n.y)break a;n=!0;gd(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}q=!1;if(this instanceof D){var t=this,q=!0;if(!t.isVisible())break a}a.hj.pf=[1,0,0,1,0,0];r=!1;q&&this.xk&&b.vk("drawShadows")&&(s=this.Rm,b.Ez=s.x*b.scale*b.ge,b.Fz=s.y*b.scale*b.ge,b.di=t.di,b.jh=t.jh,Tl(b,
a),a.shadowColor=b.jh);t=!1;this.ea&&b.vk("drawShadows")&&(t=this.ea.xk);!0===this.gq?(Tl(b,a),!1===r&&t&&(gd(a,1,0,0,1,0,0),a.hb(),r=!0)):!1===this.gq&&Ul(a);null!==this.uc&&(Vl(this,a,this.uc,!0,!0),!1===r&&t&&(gd(a,1,0,0,1,0,0),a.hb(),r=!0),this.uc instanceof Ea&&this.uc.type===af?(a.beginPath(),a.rect(h.x,h.y,h.width,h.height),Wl(a,this.uc)):a.fillRect(h.x,h.y,h.width,h.height));this instanceof H?gd(a,k.m11,k.m12,k.m21,k.m22,k.dx,k.dy):a.hj.pf=[k.m11,k.m12,k.m21,k.m22,k.dx,k.dy];if(null!==this.Pb){!1===
r&&t&&(gd(a,1,0,0,1,0,0),a.hb(),r=!0);var p=this.Ga,k=h=0,s=p.width,p=p.height,v=0;this instanceof Y&&(p=this.bb.Cb,h=p.x,k=p.y,s=p.width,p=p.height,v=this.ve);Vl(this,a,this.Pb,!0,!1);this.Pb instanceof Ea&&this.Pb.type===af?(a.beginPath(),a.rect(h-v/2,k-v/2,s+v,p+v),Wl(a,this.Pb)):a.fillRect(h-v/2,k-v/2,s+v,p+v)}t&&(null!==this.Pb||null!==this.uc||null!==l&&0!==(l.ka&512)||null!==l&&(l.type===xj||l.type===Fh)&&l.Bf()!==this)?(Xl(this,!0),null===this.gq&&Ul(a)):Xl(this,!1);this.rk(a,b);t&&0!==(this.ka&
512)===!0&&Tl(b,a);q&&t&&Ul(a);m&&(a.restore(),n&&a.Cf.pop(),da(b,a));this instanceof H&&(e=a.Cf.pop());!0===r&&a.Cf.pop();null!==a.LE&&(null===e&&(g===a.zx?(gd(a,1,0,0,1,0,0),e=a.Cf.pop()):e=a.zx),a.LE(this,e))}}}}else{if(this instanceof H&&(this.type===Ol||this.type===Pl)){Ql(this,a,b);1!==c&&(a.globalAlpha=d);return}m=this.Yb;if(0!==m.width&&0!==m.height&&!isNaN(m.x)&&!isNaN(m.y)){this instanceof G&&this.Yt(!1);u&&u.dj&&u.fI(a,this);e=this.transform;g=this.V;0!==(this.ka&4096)===!0&&Rl(this);l=
0!==(this.ka&256);this instanceof sa&&Sl(this,a);if(l){u&&u.KE&&x.trace("clip"+this.toString());n=g.Pg()?g.Ga:g.ba;null!==this.xi?(r=this.xi,h=r.x,k=r.y,q=r.width,r=r.height):(h=Math.max(m.x,n.x),k=Math.max(m.y,n.y),q=Math.min(m.right,n.right)-h,r=Math.min(m.bottom,n.bottom)-k);if(h>m.width+m.x||m.x>n.width+n.x||k>m.height+m.y||m.y>n.height+n.y){1!==c&&(a.globalAlpha=d);return}u&&u.KE&&u.hI(a,h,k,q,r);a.save();a.beginPath();a.rect(h,k,q,r);a.clip()}n=!1;if(this instanceof D){n=!0;if(!this.isVisible()){1!==
c&&(a.globalAlpha=d);return}this.xk&&b.vk("drawShadows")&&(h=this.Rm,b.Ez=h.x*b.scale*b.ge,b.Fz=h.y*b.scale*b.ge,b.di=this.di,b.jh=this.jh,Tl(b,a),a.shadowColor=b.jh)}h=!1;this.ea&&b.vk("drawShadows")&&(h=this.ea.xk);!0===this.gq?Tl(b,a):!1===this.gq&&Ul(a);null!==this.uc&&(Vl(this,a,this.uc,!0,!0),this.uc instanceof Ea&&this.uc.type===af?(a.beginPath(),a.rect(m.x,m.y,m.width,m.height),Wl(a,this.uc)):a.fillRect(m.x,m.y,m.width,m.height));e.Nt()||a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);null!==
this.Pb&&(r=this.Ga,k=m=0,q=r.width,r=r.height,t=0,this instanceof Y&&(r=this.bb.Cb,m=r.x,k=r.y,q=r.width,r=r.height,t=this.ve),Vl(this,a,this.Pb,!0,!1),this.Pb instanceof Ea&&this.Pb.type===af?(a.beginPath(),a.rect(m-t/2,k-t/2,q+t,r+t),Wl(a,this.Pb)):a.fillRect(m-t/2,k-t/2,q+t,r+t));u&&u.dj&&u.gI(a,this);h&&(null!==this.Pb||null!==this.uc||null!==g&&0!==(g.ka&512)||null!==g&&(g.type===xj||g.type===Fh)&&g.Bf()!==this)?(Xl(this,!0),null===this.gq&&Ul(a)):Xl(this,!1);this.rk(a,b);h&&0!==(this.ka&512)===
!0&&Tl(b,a);n&&h&&Ul(a);l?(a.restore(),this instanceof H?da(b,a,!0):da(b,a,!1)):e.Nt()||(g=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*g,-e.m12*g,-e.m21*g,e.m11*g,g*(e.m21*e.dy-e.m22*e.dx),g*(e.m12*e.dx-e.m11*e.dy)))}}1!==c&&(a.globalAlpha=d)}};function Ul(a){a.shadowOffsetX=0;a.shadowOffsetY=0;a.shadowBlur=0}function Tl(a,b){b.shadowOffsetX=a.Ez;b.shadowOffsetY=a.Fz;b.shadowBlur=a.di}
function Ql(a,b,c){var d=a.Yb;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.uc&&(Vl(a,b,a.uc,!0,!0),a.uc instanceof Ea&&a.uc.type===af?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),Wl(b,a.uc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Pb&&(Vl(a,b,a.Pb,!0,!1),a.Pb instanceof Ea&&a.Pb.type===af?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),Wl(b,a.Pb)):b.fillRect(d.x,d.y,d.width,d.height)),a.rk(b,c))}O.prototype.rk=function(){};
function Wl(a,b){if(b instanceof Ea&&b.type===af&&!(a instanceof ed)){var c=b.Ly,d=b.Ky;d>c?(a.scale(c/d,1),a.translate((d-c)/2,0)):c>d&&(a.scale(1,d/c),a.translate(0,(c-d)/2));a.Iu?a.clip():a.fill();d>c?(a.translate(-(d-c)/2,0),a.scale(1/(c/d),1)):c>d&&(a.translate(0,-(c-d)/2),a.scale(1,1/(d/c)))}else a.Iu?a.clip():a.fill()}function Yl(a){a.Iu||a.stroke()}
function Vl(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.im!==c&&(b.fillStyle=c,b.im=c):b.Mn!==c&&(b.strokeStyle=c,b.Mn=c);else if(c.type===Ze)c=c.color,d?b.im!==c&&(b.fillStyle=c,b.im=c):b.Mn!==c&&(b.strokeStyle=c,b.Mn=c);else{var k,h=a.Ga,g=h.width,h=h.height;if(e)var l=a.ba,g=l.width,h=l.height;var m=b instanceof CanvasRenderingContext2D;if(m&&(c.Vg&&c.type===wl||c.Ly===g&&c.Ky===h))k=c.Vg;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.ba,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*
g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY;l+=r;p+=r;n+=s;q+=s;c.type===$e?k=b.createLinearGradient(l,n,p,q):c.type===af?(s=isNaN(c.ut)?Math.max(g,h)/2:c.ut,isNaN(c.xu)?(r=0,s=Math.max(g,h)/2):r=c.xu,k=b.createRadialGradient(l,n,r,p,q,s)):c.type===wl?k=b.createPattern(c.pattern,"repeat"):x.jc(c.type,"Brush type");if(c.type!==wl&&(a=c.pt,null!==a))for(a=a.i;a.next();)k.addColorStop(a.key,a.value);m&&(c.Vg=k,c.Ly=g,c.Ky=h)}d?b.im!==k&&(b.fillStyle=
k,b.im=k):b.Mn!==k&&(b.strokeStyle=k,b.Mn=k)}}}O.prototype.isContainedBy=O.prototype.Ul=function(a){if(a instanceof H)a:{if(this!==a&&null!==a)for(var b=this.V;null!==b;){if(b===a){a=!0;break a}b=b.V}a=!1}else a=!1;return a};O.prototype.isVisibleObject=O.prototype.Wl=function(){if(!this.visible)return!1;var a=this.V;return null!==a?a.Wl():!0};
function Rl(a){if(0!==(a.ka&2048)===!0){var b=a.Ld;b.reset();if(!a.Yb.G()||!a.jd.G()){Zl(a,!1);return}b.translate(a.Yb.x,a.Yb.y);b.translate(-a.Ia.x,-a.Ia.y);var c=a.Ga;Il(a,b,c.x,c.y,c.width,c.height);Zl(a,!1);$l(a,!0)}0!==(a.ka&4096)===!0&&(b=a.V,null===b?(a.Fk.set(a.Ld),a.lv=a.scale,$l(a,!1)):null!==b.mh&&(c=a.Fk,c.reset(),b.Pg()?c.multiply(b.Fk):null!==b.V&&c.multiply(b.V.Fk),c.multiply(a.Ld),a.lv=a.scale*b.lv,$l(a,!1)))}
function Il(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=dc;a.of&&a.of.cd()&&(h=a.of);var k=x.P();if(a instanceof D&&a.$b!==a)for(c=a.$b,d=c.Ga,k.uu(d.x,d.y,d.width,d.height,h),c.il.Fb(k),k.offset(-c.Ia.x,-c.Ia.y),h=c.V;null!==h&&h!==a;)h.il.Fb(k),k.offset(-h.Ia.x,-h.Ia.y),h=h.V;else k.uu(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);x.A(k)}}f=O.prototype;
f.T=function(a){void 0===a&&(a=!1);if(!0!==Xj(this)){Rj(this,!0);Ml(this,!0);var b=this.V;null!==b?a||b.T():(a=this.h,null!==a&&(a.pg.add(this),this instanceof E&&(a.qa.tb||this.mf(),null!==this.Od&&am(this.Od)),a.Be(!0)));if(this instanceof H){if(this.da===xj||this.da===rh)a=this.Bf(),null!==a&&a.T(!0);a=this.wa.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Xj(d)&&(d.Ba.G()||(d instanceof Gh||d instanceof H||d instanceof sa||Kl(d,!1)!==Hh)&&d.T(!0))}}}};
f.Fp=function(){!1===Xj(this)&&(Rj(this,!0),Ml(this,!0))};function am(a){if(!1===Yj(a)){if(null!==a.V)a.V.T();else{var b=a.h;null!==b&&(b.pg.add(a),a instanceof E&&a.mf(),b.Be())}Ml(a,!0)}}f.Hi=function(){0!==(this.ka&2048)===!1&&(Zl(this,!0),$l(this,!0))};f.vA=function(){$l(this,!0)};f.ua=function(){var a=this.ea;null!==a&&a.ua()};
function Kl(a,b){var c=a.stretch,d=a.V;if(null!==d&&d.da===ia)return bm(a,d.nd(a.ac),d.md(a.column),b);if(null!==d&&d.da===xj&&d.Bf()===a)return cm(a,xd,b);if(c===yl){if(null!==d){if(d.da===Fh&&d.Bf()===a)return cm(a,xd,b);c=d.Xd;return c===yl?cm(a,Hh,b):cm(a,c,b)}return cm(a,Hh,b)}return cm(a,c,b)}
function bm(a,b,c,d){var e=a.stretch;if(e!==yl)return cm(a,e,d);var g=e=null;switch(b.stretch){case zl:g=!0;break;case xd:g=!0}switch(c.stretch){case Al:e=!0;break;case xd:e=!0}b=a.V.Xd;null===e&&(e=b===Al||b===xd);null===g&&(g=b===zl||b===xd);return!0===e&&!0===g?cm(a,xd,d):!0===e?cm(a,Al,d):!0===g?cm(a,zl,d):cm(a,Hh,d)}
function cm(a,b,c){if(c)return b;if(b===Hh)return Hh;c=a.Ba;if(c.G())return Hh;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Al)return Hh;if(b===xd)return zl}else{if(b===zl)return Hh;if(b===xd)return Al}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===zl)return Hh;if(b===xd)return Al}else{if(b===Al)return Hh;if(b===xd)return zl}return b}
x.defineProperty(O,{qu:"segmentOrientation"},function(){return this.zs},function(a){var b=this.zs;b!==a&&(u&&x.Ca(a,G,O,"segmentOrientation"),this.zs=a,this.T(),this.j("segmentOrientation",b,a),a===uh&&(this.angle=0))});x.defineProperty(O,{Ce:"segmentIndex"},function(){return this.xs},function(a){u&&x.g(a,"number",O,"segmentIndex");a=Math.round(a);var b=this.xs;b!==a&&(this.xs=a,this.T(),this.j("segmentIndex",b,a))});
x.defineProperty(O,{Ux:"segmentFraction"},function(){return this.ws},function(a){u&&x.g(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.ws;b!==a&&(this.ws=a,this.T(),this.j("segmentFraction",b,a))});x.defineProperty(O,{aG:"segmentOffset"},function(){return this.ys},function(a){var b=this.ys;b.O(a)||(u&&x.l(a,N,O,"segmentOffset"),this.ys=a=a.Y(),this.T(),this.j("segmentOffset",b,a))});
x.defineProperty(O,{stretch:"stretch"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(u&&x.Ca(a,O,O,"stretch"),this.gi=a,this.T(),this.j("stretch",b,a))});x.defineProperty(O,{name:"name"},function(){return this.Vb},function(a){var b=this.Vb;b!==a&&(u&&x.g(a,"string",O,"name"),this.Vb=a,null!==this.ea&&(this.ea.ll=null),this.j("name",b,a))});
x.defineProperty(O,{opacity:"opacity"},function(){return this.Xc},function(a){var b=this.Xc;b!==a&&(x.g(a,"number",O,"opacity"),(0>a||1<a)&&x.la(a,"0 <= value <= 1",O,"opacity"),this.Xc=a,this.j("opacity",b,a),a=this.h,b=this.ea,null!==a&&null!==b&&a.ua(fj(b,b.ba)))});
x.defineProperty(O,{visible:"visible"},function(){return 0!==(this.ka&1)},function(a){var b=0!==(this.ka&1);b!==a&&(u&&x.g(a,"boolean",O,"visible"),this.ka^=1,this.j("visible",b,a),b=this.V,null!==b?b.T():this instanceof D&&this.Qd(a),this.ua(),dm(this))});x.defineProperty(O,{ig:"pickable"},function(){return 0!==(this.ka&2)},function(a){var b=0!==(this.ka&2);b!==a&&(u&&x.g(a,"boolean",O,"pickable"),this.ka^=2,this.j("pickable",b,a))});
x.defineProperty(O,{rI:"fromLinkableDuplicates"},function(){return 0!==(this.ka&4)},function(a){var b=0!==(this.ka&4);b!==a&&(u&&x.g(a,"boolean",O,"fromLinkableDuplicates"),this.ka^=4,this.j("fromLinkableDuplicates",b,a))});x.defineProperty(O,{sI:"fromLinkableSelfNode"},function(){return 0!==(this.ka&8)},function(a){var b=0!==(this.ka&8);b!==a&&(u&&x.g(a,"boolean",O,"fromLinkableSelfNode"),this.ka^=8,this.j("fromLinkableSelfNode",b,a))});
x.defineProperty(O,{fK:"toLinkableDuplicates"},function(){return 0!==(this.ka&16)},function(a){var b=0!==(this.ka&16);b!==a&&(u&&x.g(a,"boolean",O,"toLinkableDuplicates"),this.ka^=16,this.j("toLinkableDuplicates",b,a))});x.defineProperty(O,{gK:"toLinkableSelfNode"},function(){return 0!==(this.ka&32)},function(a){var b=0!==(this.ka&32);b!==a&&(u&&x.g(a,"boolean",O,"toLinkableSelfNode"),this.ka^=32,this.j("toLinkableSelfNode",b,a))});
x.defineProperty(O,{Gf:"isPanelMain"},function(){return 0!==(this.ka&64)},function(a){var b=0!==(this.ka&64);b!==a&&(u&&x.g(a,"boolean",O,"isPanelMain"),this.ka^=64,this.T(),this.j("isPanelMain",b,a))});x.defineProperty(O,{Kt:"isActionable"},function(){return 0!==(this.ka&128)},function(a){var b=0!==(this.ka&128);b!==a&&(u&&x.g(a,"boolean",O,"isActionable"),this.ka^=128,this.j("isActionable",b,a))});
x.defineProperty(O,{zl:"areaBackground"},function(){return this.uc},function(a){var b=this.uc;b!==a&&(u&&null!==a&&x.lt(a,"GraphObject.areaBackground"),a instanceof Ea&&a.freeze(),this.uc=a,this.ua(),this.j("areaBackground",b,a))});x.defineProperty(O,{background:"background"},function(){return this.Pb},function(a){var b=this.Pb;b!==a&&(u&&null!==a&&x.lt(a,"GraphObject.background"),a instanceof Ea&&a.freeze(),this.Pb=a,this.ua(),this.j("background",b,a))});
function Xl(a,b){a.ka=b?a.ka|512:a.ka&-513}function em(a,b){a.ka=b?a.ka|1024:a.ka&-1025}function Zl(a,b){a.ka=b?a.ka|2048:a.ka&-2049}function $l(a,b){a.ka=b?a.ka|4096:a.ka&-4097}function Xj(a){return 0!==(a.ka&8192)}function Rj(a,b){a.ka=b?a.ka|8192:a.ka&-8193}function Yj(a){return 0!==(a.ka&16384)}function Ml(a,b){a.ka=b?a.ka|16384:a.ka&-16385}
x.w(O,{ea:"part"},function(){if(this instanceof D)return this;if(null!==this.Jm)return this.Jm;var a;for(a=this.V;a;){if(a instanceof D)return this.Jm=a;a=a.V}return null});x.w(O,{V:"panel"},function(){return this.fh});O.prototype.$l=function(a){this.fh=a};x.w(O,{layer:"layer"},function(){var a=this.ea;return null!==a?a.layer:null},{configurable:!0});x.w(O,{h:"diagram"},function(){var a=this.ea;return null!==a?a.h:null},{configurable:!0});
x.defineProperty(O,{position:"position"},function(){return this.fb},function(a){var b=this.fb;b.O(a)||(u&&x.l(a,N,O,"position"),a=a.Y(),this.iB(a,b)&&this.j("position",b,a))});O.prototype.iB=function(a){this.fb=a;am(this);this.Hi();return!0};O.prototype.$x=function(a,b){this.fb.n(a,b);fm(this,!0);this.Hi()};x.w(O,{ba:"actualBounds"},function(){return this.Yb});
x.defineProperty(O,{scale:"scale"},function(){return this.dc},function(a){var b=this.dc;b!==a&&(u&&x.p(a,O,"scale"),0>=a&&x.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.dc=a,this.Hi(),this.T(),this.j("scale",b,a))});x.defineProperty(O,{angle:"angle"},function(){return this.jm},function(a){var b=this.jm;b!==a&&(u&&x.p(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.jm=a,this.T(),this.Hi(),this.j("angle",b,a)))});
x.defineProperty(O,{Ba:"desiredSize"},function(){return this.uf},function(a){var b=this.uf;b.O(a)||(u&&x.l(a,Fa,O,"desiredSize"),this.uf=a=a.Y(),this.T(),this instanceof Y&&this.nf(),this.j("desiredSize",b,a),a=this.ea,null!==a&&0!==(this.ka&1024)&&(Gl(this,a,"width"),Gl(this,a,"height")))});
x.defineProperty(O,{width:"width"},function(){return this.uf.width},function(a){if(this.uf.width!==a){u&&x.g(a,"number",O,"width");var b=this.uf;this.uf=a=(new Fa(a,this.uf.height)).freeze();this.T();this instanceof Y&&this.nf();this.j("desiredSize",b,a);b=this.ea;null!==b&&0!==(this.ka&1024)&&Gl(this,b,"width")}});
x.defineProperty(O,{height:"height"},function(){return this.uf.height},function(a){if(this.uf.height!==a){u&&x.g(a,"number",O,"height");var b=this.uf;this.uf=a=(new Fa(this.uf.width,a)).freeze();this.T();this instanceof Y&&this.nf();this.j("desiredSize",b,a);b=this.ea;null!==b&&0!==(this.ka&1024)&&Gl(this,b,"height")}});
x.defineProperty(O,{Kf:"minSize"},function(){return this.Vj},function(a){var b=this.Vj;b.O(a)||(u&&x.l(a,Fa,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Vj=a,this.T(),this.j("minSize",b,a))});x.defineProperty(O,{Ae:"maxSize"},function(){return this.Tj},function(a){var b=this.Tj;b.O(a)||(u&&x.l(a,Fa,O,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Tj=a,this.T(),this.j("maxSize",b,a))});
x.w(O,{Ia:"measuredBounds"},function(){return this.jd});x.w(O,{Ga:"naturalBounds"},function(){return this.Wc},{configurable:!0});x.defineProperty(O,{margin:"margin"},function(){return this.Er},function(a){"number"===typeof a?a=new yb(a):u&&x.l(a,yb,O,"margin");var b=this.Er;b.O(a)||(this.Er=a=a.Y(),this.T(),this.j("margin",b,a))});x.w(O,{transform:null},function(){0!==(this.ka&2048)===!0&&Rl(this);return this.Ld});x.w(O,{mh:null},function(){0!==(this.ka&4096)===!0&&Rl(this);return this.Fk});
x.defineProperty(O,{alignment:"alignment"},function(){return this.Ie},function(a){var b=this.Ie;b.O(a)||(u&&x.l(a,R,O,"alignment"),a.ze()&&!a.bd()&&x.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Ie=a=a.Y(),am(this),this.j("alignment",b,a))});x.defineProperty(O,{column:"column"},function(){return this.Bq},function(a){u&&x.p(a,O,"column");a=Math.round(a);var b=this.Bq;b!==a&&(0>a&&x.la(a,">= 0",O,"column"),this.Bq=a,this.T(),this.j("column",b,a))});
x.defineProperty(O,{JH:"columnSpan"},function(){return this.yi},function(a){u&&x.g(a,"number",O,"columnSpan");a=Math.round(a);var b=this.yi;b!==a&&(1>a&&x.la(a,">= 1",O,"columnSpan"),this.yi=a,this.T(),this.j("columnSpan",b,a))});x.defineProperty(O,{ac:"row"},function(){return this.ss},function(a){u&&x.p(a,O,"row");a=Math.round(a);var b=this.ss;b!==a&&(0>a&&x.la(a,">= 0",O,"row"),this.ss=a,this.T(),this.j("row",b,a))});
x.defineProperty(O,{rowSpan:"rowSpan"},function(){return this.Ui},function(a){u&&x.g(a,"number",O,"rowSpan");a=Math.round(a);var b=this.Ui;b!==a&&(1>a&&x.la(a,">= 1",O,"rowSpan"),this.Ui=a,this.T(),this.j("rowSpan",b,a))});x.defineProperty(O,{gy:"spanAllocation"},function(){return this.Ks},function(a){var b=this.Ks;b!==a&&(null!==a&&x.g(a,"function",O,"spanAllocation"),this.Ks=a,this.j("spanAllocation",b,a))});
x.defineProperty(O,{mk:"alignmentFocus"},function(){return this.uq},function(a){var b=this.uq;b.O(a)||(u&&x.l(a,R,O,"alignmentFocus"),!a.ze()||a.bd()||a.O(Wb)&&this instanceof E||x.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.uq=a=a.Y(),this.T(),this.j("alignmentFocus",b,a))});
x.defineProperty(O,{zd:"portId"},function(){return this.es},function(a){var b=this.es;if(b!==a){u&&null!==a&&x.g(a,"string",O,"portId");var c=this.ea;null===c||c instanceof E||(x.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&gm(c,this);this.es=a;if(null!==a&&c){c.Th=!0;null===c.Fd&&hm(c);var d=this.zd;null!==d&&c.Fd.add(d,this)}this.j("portId",b,a)}});function im(a){var b={value:null};jm(a,b);return b.value}
function jm(a,b){var c=a.V;return null===c||!jm(c,b)&&a.visible?(b.value=a,!1):!0}function dm(a){var b=a.ea;b instanceof E&&(a=a.h,null===a||a.qa.tb||b.mf())}x.defineProperty(O,{Hb:"toSpot"},function(){return null!==this.ma?this.ma.jk:Wb},function(a){this.Ve();var b=this.ma.jk;b.O(a)||(u&&x.l(a,R,O,"toSpot"),a=a.Y(),this.ma.jk=a,this.j("toSpot",b,a),dm(this))});
x.defineProperty(O,{em:"toEndSegmentLength"},function(){return null!==this.ma?this.ma.hk:10},function(a){this.Ve();var b=this.ma.hk;b!==a&&(u&&x.g(a,"number",O,"toEndSegmentLength"),0>a&&x.la(a,">= 0",O,"toEndSegmentLength"),this.ma.hk=a,this.j("toEndSegmentLength",b,a),dm(this))});
x.defineProperty(O,{Au:"toEndSegmentDirection"},function(){return null!==this.ma?this.ma.gk:El},function(a){this.Ve();var b=this.ma.gk;b!==a&&(u&&x.Ca(a,E,O,"toEndSegmentDirection"),this.ma.gk=a,this.j("toEndSegmentDirection",b,a),dm(this))});x.defineProperty(O,{Bu:"toShortLength"},function(){return null!==this.ma?this.ma.ik:0},function(a){this.Ve();var b=this.ma.ik;b!==a&&(u&&x.g(a,"number",O,"toShortLength"),this.ma.ik=a,this.j("toShortLength",b,a),dm(this))});
x.defineProperty(O,{pG:"toLinkable"},function(){return this.Qs},function(a){var b=this.Qs;b!==a&&(u&&null!==a&&x.g(a,"boolean",O,"toLinkable"),this.Qs=a,this.j("toLinkable",b,a))});x.defineProperty(O,{hK:"toMaxLinks"},function(){return this.Rs},function(a){var b=this.Rs;b!==a&&(u&&x.g(a,"number",O,"toMaxLinks"),0>a&&x.la(a,">= 0",O,"toMaxLinks"),this.Rs=a,this.j("toMaxLinks",b,a))});
x.defineProperty(O,{Gb:"fromSpot"},function(){return null!==this.ma?this.ma.Hj:Wb},function(a){this.Ve();var b=this.ma.Hj;b.O(a)||(u&&x.l(a,R,O,"fromSpot"),a=a.Y(),this.ma.Hj=a,this.j("fromSpot",b,a),dm(this))});x.defineProperty(O,{Ml:"fromEndSegmentLength"},function(){return null!==this.ma?this.ma.Fj:10},function(a){this.Ve();var b=this.ma.Fj;b!==a&&(u&&x.g(a,"number",O,"fromEndSegmentLength"),0>a&&x.la(a,">= 0",O,"fromEndSegmentLength"),this.ma.Fj=a,this.j("fromEndSegmentLength",b,a),dm(this))});
x.defineProperty(O,{Dt:"fromEndSegmentDirection"},function(){return null!==this.ma?this.ma.Ej:El},function(a){this.Ve();var b=this.ma.Ej;b!==a&&(u&&x.Ca(a,E,O,"fromEndSegmentDirection"),this.ma.Ej=a,this.j("fromEndSegmentDirection",b,a),dm(this))});x.defineProperty(O,{Et:"fromShortLength"},function(){return null!==this.ma?this.ma.Gj:0},function(a){this.Ve();var b=this.ma.Gj;b!==a&&(u&&x.g(a,"number",O,"fromShortLength"),this.ma.Gj=a,this.j("fromShortLength",b,a),dm(this))});
x.defineProperty(O,{TE:"fromLinkable"},function(){return this.ar},function(a){var b=this.ar;b!==a&&(u&&null!==a&&x.g(a,"boolean",O,"fromLinkable"),this.ar=a,this.j("fromLinkable",b,a))});x.defineProperty(O,{tI:"fromMaxLinks"},function(){return this.br},function(a){var b=this.br;b!==a&&(u&&x.g(a,"number",O,"fromMaxLinks"),0>a&&x.la(a,">= 0",O,"fromMaxLinks"),this.br=a,this.j("fromMaxLinks",b,a))});
x.defineProperty(O,{cursor:"cursor"},function(){return this.Lq},function(a){var b=this.Lq;b!==a&&(x.g(a,"string",O,"cursor"),this.Lq=a,this.j("cursor",b,a))});x.defineProperty(O,{click:"click"},function(){return null!==this.na?this.na.wi:null},function(a){Bl(this);var b=this.na.wi;b!==a&&(null!==a&&x.g(a,"function",O,"click"),this.na.wi=a,this.j("click",b,a))});
x.defineProperty(O,{tt:"doubleClick"},function(){return null!==this.na?this.na.Ei:null},function(a){Bl(this);var b=this.na.Ei;b!==a&&(null!==a&&x.g(a,"function",O,"doubleClick"),this.na.Ei=a,this.j("doubleClick",b,a))});x.defineProperty(O,{aA:"contextClick"},function(){return null!==this.na?this.na.zi:null},function(a){Bl(this);var b=this.na.zi;b!==a&&(null!==a&&x.g(a,"function",O,"contextClick"),this.na.zi=a,this.j("contextClick",b,a))});
x.defineProperty(O,{$t:"mouseEnter"},function(){return null!==this.na?this.na.Qr:null},function(a){Bl(this);var b=this.na.Qr;b!==a&&(null!==a&&x.g(a,"function",O,"mouseEnter"),this.na.Qr=a,this.j("mouseEnter",b,a))});x.defineProperty(O,{au:"mouseLeave"},function(){return null!==this.na?this.na.Rr:null},function(a){Bl(this);var b=this.na.Rr;b!==a&&(null!==a&&x.g(a,"function",O,"mouseLeave"),this.na.Rr=a,this.j("mouseLeave",b,a))});
x.defineProperty(O,{LA:"mouseOver"},function(){return null!==this.na?this.na.Qi:null},function(a){Bl(this);var b=this.na.Qi;b!==a&&(null!==a&&x.g(a,"function",O,"mouseOver"),this.na.Qi=a,this.j("mouseOver",b,a))});x.defineProperty(O,{KA:"mouseHover"},function(){return null!==this.na?this.na.Pi:null},function(a){Bl(this);var b=this.na.Pi;b!==a&&(null!==a&&x.g(a,"function",O,"mouseHover"),this.na.Pi=a,this.j("mouseHover",b,a))});
x.defineProperty(O,{JA:"mouseHold"},function(){return null!==this.na?this.na.Oi:null},function(a){Bl(this);var b=this.na.Oi;b!==a&&(null!==a&&x.g(a,"function",O,"mouseHold"),this.na.Oi=a,this.j("mouseHold",b,a))});x.defineProperty(O,{tJ:"mouseDragEnter"},function(){return null!==this.na?this.na.Nr:null},function(a){Bl(this);var b=this.na.Nr;b!==a&&(null!==a&&x.g(a,"function",O,"mouseDragEnter"),this.na.Nr=a,this.j("mouseDragEnter",b,a))});
x.defineProperty(O,{uJ:"mouseDragLeave"},function(){return null!==this.na?this.na.Pr:null},function(a){Bl(this);var b=this.na.Pr;b!==a&&(null!==a&&x.g(a,"function",O,"mouseDragLeave"),this.na.Pr=a,this.j("mouseDragLeave",b,a))});x.defineProperty(O,{IA:"mouseDrop"},function(){return null!==this.na?this.na.Ni:null},function(a){Bl(this);var b=this.na.Ni;b!==a&&(null!==a&&x.g(a,"function",O,"mouseDrop"),this.na.Ni=a,this.j("mouseDrop",b,a))});
x.defineProperty(O,{YD:"actionDown"},function(){return null!==this.na?this.na.pq:null},function(a){Bl(this);var b=this.na.pq;b!==a&&(null!==a&&x.g(a,"function",O,"actionDown"),this.na.pq=a,this.j("actionDown",b,a))});x.defineProperty(O,{ZD:"actionMove"},function(){return null!==this.na?this.na.qq:null},function(a){Bl(this);var b=this.na.qq;b!==a&&(null!==a&&x.g(a,"function",O,"actionMove"),this.na.qq=a,this.j("actionMove",b,a))});
x.defineProperty(O,{$D:"actionUp"},function(){return null!==this.na?this.na.rq:null},function(a){Bl(this);var b=this.na.rq;b!==a&&(null!==a&&x.g(a,"function",O,"actionUp"),this.na.rq=a,this.j("actionUp",b,a))});x.defineProperty(O,{XD:"actionCancel"},function(){return null!==this.na?this.na.oq:null},function(a){Bl(this);var b=this.na.oq;b!==a&&(null!==a&&x.g(a,"function",O,"actionCancel"),this.na.oq=a,this.j("actionCancel",b,a))});
x.defineProperty(O,{qB:"toolTip"},function(){return null!==this.na?this.na.Yi:null},function(a){Bl(this);var b=this.na.Yi;b!==a&&(null!==a&&x.l(a,fa,O,"toolTip"),this.na.Yi=a,this.j("toolTip",b,a))});x.defineProperty(O,{contextMenu:"contextMenu"},function(){return null!==this.na?this.na.Ai:null},function(a){Bl(this);var b=this.na.Ai;b!==a&&(null!==a&&x.l(a,fa,O,"contextMenu"),this.na.Ai=a,this.j("contextMenu",b,a))});
O.prototype.bind=O.prototype.bind=function(a){a.yg=this;var b=this.vp();null!==b&&km(b)&&x.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Uc&&(this.Uc=new J(wf));this.Uc.add(a)};O.prototype.findTemplateBinder=O.prototype.vp=function(){for(var a=this instanceof H?this:this.V;null!==a;){if(null!==a.lm)return a;a=a.V}return null};O.prototype.setProperties=function(a){x.ru(this,a)};var lm;
O.make=lm=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=mm.oa(a);"function"===typeof g?(c=x.Cl(arguments),d=g(c)):e=ca[a]}null===d&&(void 0===e&&(d=window.$,void 0!==d&&void 0!==d.noop&&x.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),x.k("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==e&&e.constructor||x.k("GraphObject.make requires a class function or class name, not: "+
a),d=new e);g=1;if(d instanceof z&&1<c.length){var h=d,e=c[1];if("string"===typeof e||e instanceof HTMLDivElement)vj(h,e),g++}for(;g<c.length;g++)e=c[g],void 0===e?x.k("Undefined value at argument "+g+" for object being constructed by GraphObject.make: "+d):nm(d,e);return d};
function nm(a,b){if("string"===typeof b)if(a instanceof sa)a.text=b;else if(a instanceof Y)a.Jb=b;else if(a instanceof pj)a.source=b;else if(a instanceof H){var c=La(H,b);null!==c?a.type=c:x.k("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof Ea?(c=La(Ea,b),null!==c?a.type=c:x.k("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof ud?(c=La(ud,b),null!==c?a.type=c:x.k("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof ge?
(c=La(ge,b),null!==c?a.type=c:x.k("Unknown PathSegment type as an argument to GraphObject.make: "+b)):x.k("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof O)c=b,a instanceof H||x.k("A GraphObject can only be added to a Panel, not to: "+a),a.add(c);else if(b instanceof sf){var d=b,c=a,e;d.qe&&c.nd?e=c.nd(d.index):!d.qe&&c.md?e=c.md(d.index):x.k("A RowColumnDefinition can only be added to a Panel, not to: "+a);e.qt(d)}else if(b instanceof Ca)a instanceof G&&b.ye===
G?2===(b.value&2)?a.Sx=b:b===Bh||b===th||b===sh?a.Te=b:b===om||b===pm||b===qm?a.dt=b:b!==rm&&b!==uh&&x.k("Unknown Link enum value for a Link property: "+b):a instanceof H&&b.ye===H?a.type=b:a instanceof sa&&b.ye===sa?a.FG=b:a instanceof Y&&(b===Hh||b===Jh||b===Kh||b===yl)?a.pA=b:a instanceof pj&&(b===Hh||b===Jh||b===Kh)?a.GI=b:a instanceof O&&b.ye===G?(c=a,0===b.name.indexOf("Orient")?c.qu=b:x.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+b)):a instanceof O&&b.ye===O?a.stretch=
b:a instanceof sf&&b.ye===sf?a.vu=b:a instanceof z&&b.ye===z?a.Al=b:a instanceof Ea&&b.ye===Ea?a.type=b:a instanceof ud&&b.ye===ud?a.type=b:a instanceof ge&&b.ye===ge?a.type=b:a instanceof wf&&b.ye===wf?a.mode=b:a instanceof ve&&b.ye===ve?a.Dc=b:a instanceof Z&&b.ye===Z?0===b.name.indexOf("Alignment")?a.alignment=b:0===b.name.indexOf("Arrangement")?a.Zf=b:0===b.name.indexOf("Compaction")?a.compaction=b:0===b.name.indexOf("Path")?a.path=b:0===b.name.indexOf("Sorting")?a.sorting=b:0===b.name.indexOf("Style")?
a.kK=b:x.k("Unknown enum value: "+b):a instanceof sm&&b.ye===sm?0===b.name.indexOf("Aggressive")?a.uH=b:0===b.name.indexOf("Cycle")?a.UH=b:0===b.name.indexOf("Init")?a.LI=b:0===b.name.indexOf("Layer")?a.bJ=b:x.k("Unknown enum value: "+b):a instanceof rl&&b.ye===rl?b===tm||b===um||b===vm||b===wm?a.sorting=b:b===xm||b===ym?a.Zf=b:b===zm||b===Am?a.alignment=b:x.k("Unknown enum value: "+b):a instanceof Bm&&b.ye===Bm?b===Cm||b===Dm||b===Em||b===Fm||b===Gm?a.sorting=b:b===Hm||b===Om||b===Pm||b===Qm?a.direction=
b:b===Rm||b===Sm||b===Tm||b===Um?a.Zf=b:b===Vm||b===Wm?a.Fx=b:x.k("Unknown enum value: "+b):x.k("No property to set for this enum value: "+b);else if(b instanceof wf)a instanceof O?a.bind(b):a instanceof sf?a.bind(b):x.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof wd)a instanceof ud?a.ec.add(b):x.k("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof ge)a instanceof wd?a.Eb.add(b):x.k("A PathSegment can only be added to a PathFigure, not to: "+
a);else if(b instanceof df)a instanceof z?a.Tb=b:a instanceof F?a.Tb=b:x.k("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)nm(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof Ea){e=new pa;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);x.ru(a,e)}else if(a instanceof sf){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&x.k("Must specify non-negative integer row for RowColumnDefinition "+
b+", not: "+e),a.qe=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&x.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.qe=!1,a.index=e);e=new pa;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);x.ru(a,e)}else x.ru(a,b);else x.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var mm=new ra("string","function");
O.getBuilders=function(){var a=new ra("string","function"),b;for(b in mm)if(b!==b.toLowerCase()){var c=mm[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var Xm;O.defineBuilder=Xm=function(a,b){x.g(a,"string",O,"defineBuilder:name");x.g(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||x.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);mm.add(a,b)};var Ym;
O.takeBuilderArgument=Ym=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b};
Xm("Button",function(){var a=new Ea($e);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new Ea($e);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=lm(H,xj,{Kt:!0},{_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue"},lm(Y,{name:"ButtonBorder",Jb:"Rectangle",C:new R(0,0,2.761423749153968,2.761423749153968),D:new R(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.$t=function(a,b){var e=b.me("ButtonBorder");if(e instanceof
Y){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}};a.au=function(a,b){var e=b.me("ButtonBorder");e instanceof Y&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)};return a});
Xm("TreeExpanderButton",function(){var a=lm("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},lm(Y,{name:"ButtonIcon",Jb:"MinusLine",Ba:Q.mq},(new wf("figure","isTreeExpanded",function(a,c){var d=c.V;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Gx()),{visible:!1},(new wf("visible","isTreeLeaf",function(a){return!a})).Gx());a.click=function(a,c){var d=c.ea;d instanceof fa&&(d=d.lh);if(d instanceof E){var e=d.h;if(null!==e){e=e.zb;if(d.xd){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
a.Mc=!0;d.xd?e.collapseTree(d):e.expandTree(d)}}};return a});
Xm("SubGraphExpanderButton",function(){var a=lm("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},lm(Y,{name:"ButtonIcon",Jb:"MinusLine",Ba:Q.mq},(new wf("figure","isSubGraphExpanded",function(a,c){var d=c.V;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Gx()));a.click=function(a,c){var d=c.ea;d instanceof fa&&(d=d.lh);if(d instanceof F){var e=d.h;if(null!==e){e=e.zb;if(d.re){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Mc=
!0;d.re?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});Xm("ContextMenuButton",function(){var a=lm("Button");a.stretch=Al;var b=a.me("ButtonBorder");b instanceof Y&&(b.Jb="Rectangle",b.C=new R(0,0,2,3),b.D=new R(1,1,-2,-2));return a});
Xm("PanelExpanderButton",function(a){var b=Ym(a,"COLLAPSIBLE");a=lm("Button",lm(Y,"TriangleUp",{Ba:new Fa(6,4)},(new wf("figure","visible",function(a){return a?"TriangleUp":"TriangleDown"})).Gx(b)));var c=a.me("ButtonBorder");c instanceof Y&&(c.stroke=null,c.fill="transparent");a.click=function(a,c){var g=c.h;if(null!==g&&!g.kb){var h=c.ea.me(b);null!==h&&(g.Wb("Collapse/Expand Panel"),h.visible=!h.visible,g.Md("Collapse/Expand Panel"))}};return a});
Xm("CheckBoxButton",function(a){var b=Ym(a);a=lm("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},lm(Y,{name:"ButtonIcon",uI:"M0 4 L3 9 9 0",yb:2,stretch:xd,pA:Jh,visible:!1},""!==b?(new wf("visible",b)).jJ():[]));a.click=function(a,d){if(!(a.h.kb||""!==b&&a.h.aa.kb)){a.Mc=!0;var e=d.me("ButtonIcon");e.h.Wb("checkbox");e.visible=!e.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.h.Md("checkbox")}};return a});
Xm("CheckBox",function(a){a=Ym(a);a=lm("CheckBoxButton",a,{name:"Button",margin:new yb(0,1,0,0)});var b=lm(H,"Horizontal",a,{Kt:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,$t:a.$t,au:a.au,click:a.click,_buttonClick:a.click});a.$t=null;a.au=null;a.click=null;return b});
function Cl(){this.Ai=this.Yi=this.oq=this.rq=this.qq=this.pq=this.Ni=this.Pr=this.Nr=this.Oi=this.Pi=this.Qi=this.Rr=this.Qr=this.zi=this.Ei=this.wi=null}Cl.prototype.copy=function(){var a=new Cl;a.wi=this.wi;a.Ei=this.Ei;a.zi=this.zi;a.Qr=this.Qr;a.Rr=this.Rr;a.Qi=this.Qi;a.Pi=this.Pi;a.Oi=this.Oi;a.Nr=this.Nr;a.Pr=this.Pr;a.Ni=this.Ni;a.pq=this.pq;a.qq=this.qq;a.rq=this.rq;a.oq=this.oq;a.Yi=this.Yi;a.Ai=this.Ai;return a};
function H(a){O.call(this);void 0===a?0===arguments.length?this.da=Mh:x.k("invalid argument to Panel constructor: undefined"):(x.Ca(a,H,H,"type"),this.da=a);this.wa=new J(O);this.df=Q.nq;this.Yg=!1;this.da===Aj&&(this.Yg=!0);this.jr=!1;this.Pq=Jc;this.Di=yl;this.da===ia&&Zm(this);this.cp=Jh;this.er=Q.OG;this.fr=Q.Ek;this.lm=this.Ke=null;this.vr=NaN;this.rg=this.Ki=null;this.Do="category";this.qg=null;this.$i=new w(NaN,NaN,NaN,NaN);this.Tm=null;this.Th=!1;this.ts=null}x.Qa(H,O);x.li(H);
x.ja("Panel",H);function Zm(a){a.Bj=Q.nq;a.Qh=1;a.Ci=null;a.pm=null;a.Ph=1;a.Oh=null;a.om=null;a.Wd=[];a.Sd=[];a.Pm=$m;a.nm=$m;a.Zi=0;a.Li=0}
H.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.da=this.da;a.df=this.df.Y();a.Yg=this.Yg;a.jr=this.jr;a.Pq=this.Pq.Y();a.Di=this.Di;if(a.da===ia){a.Bj=this.Bj.Y();a.Qh=this.Qh;a.Ci=this.Ci;a.pm=this.pm;a.Ph=this.Ph;a.Oh=this.Oh;a.om=this.om;var b=[];if(0<this.Wd.length)for(var c=this.Wd,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var g=c[e].copy();g.$l(a);b[e]=g}a.Wd=b;b=[];if(0<this.Sd.length)for(c=this.Sd,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(g=c[e].copy(),g.$l(a),
b[e]=g);a.Sd=b;a.Pm=this.Pm;a.nm=this.nm;a.Zi=this.Zi;a.Li=this.Li}a.cp=this.cp;a.er=this.er.Y();a.fr=this.fr.Y();a.Ke=this.Ke;a.lm=this.lm;a.vr=this.vr;a.Ki=this.Ki;a.rg=this.rg;a.Do=this.Do;a.$i.assign(this.$i);a.Th=this.Th;null!==this.ts&&(a.ts=this.ts)};H.prototype.mi=function(a){O.prototype.mi.call(this,a);a.wa=this.wa;for(var b=a.wa.o,c=b.length,d=0;d<c;d++)b[d].fh=a;a.Tm=null};
H.prototype.copy=function(){var a=O.prototype.copy.call(this);if(null!==a){for(var b=this.wa.o,c=b.length,d=0;d<c;d++){var e=b[d].copy(),g=a;e.$l(g);e.Jm=null;var h=g.wa,k=h.count;h.Nd(k,e);h=g.ea;if(null!==h){h.ll=null;null!==e.zd&&h instanceof E&&(h.Th=!0);var l=g.h;null!==l&&l.qa.tb||h.Rc(ye,"elements",g,null,e,null,k)}}return a}return null};H.prototype.toString=function(){return"Panel("+this.type+")#"+x.od(this)};var Mh;H.Position=Mh=x.s(H,"Position",0);H.Horizontal=x.s(H,"Horizontal",1);var wj;
H.Vertical=wj=x.s(H,"Vertical",2);var Fh;H.Spot=Fh=x.s(H,"Spot",3);var xj;H.Auto=xj=x.s(H,"Auto",4);var ia;H.Table=ia=x.s(H,"Table",5);H.Viewbox=x.s(H,"Viewbox",6);var Ol;H.TableRow=Ol=x.s(H,"TableRow",7);var Pl;H.TableColumn=Pl=x.s(H,"TableColumn",8);var rh;H.Link=rh=x.s(H,"Link",9);var Aj;H.Grid=Aj=x.s(H,"Grid",10);
x.defineProperty(H,{type:"type"},function(){return this.da},function(a){var b=this.da;b!==a&&(u&&x.Ca(a,H,H,"type"),b!==Ol&&b!==Pl||x.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.da=a,this.da===Aj?this.Yg=!0:this.da===ia&&Zm(this),this.T(),this.j("type",b,a))});x.w(H,{elements:"elements"},function(){return this.wa.i});x.w(H,{Ga:"naturalBounds"},function(){return this.Wc});
x.defineProperty(H,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?(0>a&&x.la(a,">= 0",H,"padding"),a=new yb(a)):(x.l(a,yb,H,"padding"),0>a.left&&x.la(a.left,">= 0",H,"padding:value.left"),0>a.right&&x.la(a.right,">= 0",H,"padding:value.right"),0>a.top&&x.la(a.top,">= 0",H,"padding:value.top"),0>a.bottom&&x.la(a.bottom,">= 0",H,"padding:value.bottom"));var b=this.df;b.O(a)||(this.df=a=a.Y(),this.T(),this.j("padding",b,a))});
x.defineProperty(H,{Gl:"defaultAlignment"},function(){return this.Pq},function(a){var b=this.Pq;b.O(a)||(u&&x.l(a,R,H,"defaultAlignment"),this.Pq=a=a.Y(),this.T(),this.j("defaultAlignment",b,a))});x.defineProperty(H,{Xd:"defaultStretch"},function(){return this.Di},function(a){var b=this.Di;b!==a&&(x.Ca(a,O,H,"defaultStretch"),this.Di=a,this.T(),this.j("defaultStretch",b,a))});
x.defineProperty(H,{cL:"defaultSeparatorPadding"},function(){return void 0===this.Bj?Q.nq:this.Bj},function(a){if(void 0!==this.Bj){"number"===typeof a?a=new yb(a):u&&x.l(a,yb,H,"defaultSeparatorPadding");var b=this.Bj;b.O(a)||(this.Bj=a=a.Y(),this.j("defaultSeparatorPadding",b,a))}});
x.defineProperty(H,{aL:"defaultRowSeparatorStroke"},function(){return void 0===this.Ci?null:this.Ci},function(a){var b=this.Ci;b!==a&&(null===a||"string"===typeof a||a instanceof Ea)&&(a instanceof Ea&&a.freeze(),this.Ci=a,this.j("defaultRowSeparatorStroke",b,a))});x.defineProperty(H,{bL:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Qh?1:this.Qh},function(a){if(void 0!==this.Qh){var b=this.Qh;b!==a&&isFinite(a)&&0<=a&&(this.Qh=a,this.j("defaultRowSeparatorStrokeWidth",b,a))}});
x.defineProperty(H,{$K:"defaultRowSeparatorDashArray"},function(){return void 0===this.pm?null:this.pm},function(a){if(void 0!==this.pm){var b=this.pm;if(b!==a){null===a||Array.isArray(a)||x.jc(a,"Array",H,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||x.k("defaultRowSeparatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.pm=a;this.ua();
this.j("defaultRowSeparatorDashArray",b,a)}}});x.defineProperty(H,{VK:"defaultColumnSeparatorStroke"},function(){return void 0===this.Oh?null:this.Oh},function(a){if(void 0!==this.Oh){var b=this.Oh;b!==a&&(null===a||"string"===typeof a||a instanceof Ea)&&(a instanceof Ea&&a.freeze(),this.Oh=a,this.j("defaultColumnSeparatorStroke",b,a))}});
x.defineProperty(H,{WK:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.Ph?1:this.Ph},function(a){if(void 0!==this.Ph){var b=this.Ph;b!==a&&isFinite(a)&&0<=a&&(this.Ph=a,this.j("defaultColumnSeparatorStrokeWidth",b,a))}});
x.defineProperty(H,{UK:"defaultColumnSeparatorDashArray"},function(){return void 0===this.om?null:this.om},function(a){if(void 0!==this.om){var b=this.om;if(b!==a){null===a||Array.isArray(a)||x.jc(a,"Array",H,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||x.k("defaultColumnSeparatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.om=
a;this.ua();this.j("defaultColumnSeparatorDashArray",b,a)}}});x.defineProperty(H,{vM:"viewboxStretch"},function(){return this.cp},function(a){var b=this.cp;b!==a&&(x.Ca(a,O,H,"viewboxStretch"),this.cp=a,this.j("viewboxStretch",b,a))});
x.defineProperty(H,{nx:"gridCellSize"},function(){return this.er},function(a){var b=this.er;b.O(a)||(x.l(a,Fa,H,"gridCellSize"),a.G()&&0!==a.width&&0!==a.height||x.k("Invalid Panel.gridCellSize: "+a),this.er=a.Y(),null!==this.h&&this===this.h.Ft&&Sj(this.h),this.ua(),this.j("gridCellSize",b,a))});
x.defineProperty(H,{YE:"gridOrigin"},function(){return this.fr},function(a){var b=this.fr;b.O(a)||(x.l(a,N,H,"gridOrigin"),a.G()||x.k("Invalid Panel.gridOrigin: "+a),this.fr=a.Y(),null!==this.h&&Sj(this.h),this.ua(),this.j("gridOrigin",b,a))});f=H.prototype;f.Wv=function(a){O.prototype.Wv.call(this,a);for(var b=this.wa.o,c=b.length,d=0;d<c;d++)b[d].Wv(a)};
f.rk=function(a,b){if(this.da===Aj){var c=this.jj()*b.scale;0>=c&&(c=1);var d=this.nx,e=d.width,d=d.height,g=this.Ga,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.YE;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.wa.o,q=p.length,r=0;r<q;r++){var s=p[r],t=[];n.push(t);if(s.visible)for(var s=Ek(s.Jb),v=r+1;v<q;v++){var y=p[v];y.visible&&Ek(y.Jb)===s&&(y=y.interval,2<=y&&t.push(y))}}p=this.wa.o;q=p.length;for(r=0;r<q;r++){var A=p[r];if(A.visible){var t=n[r],s=A.interval,
v=!1,B=!0,C=A.mG;null!==C&&(v=!0,void 0!==a.setLineDash?(a.setLineDash(C),a.lineDashOffset=A.vd):void 0!==a.webkitLineDash?(a.webkitLineDash=C,a.webkitLineDashOffset=A.vd):void 0!==a.mozDash?(a.mozDash=C,a.mozDashOffset=A.vd):B=!1);if("LineV"===A.Jb){a.lineWidth=A.yb;Vl(this,a,A.stroke,!1,!1);a.beginPath();for(var M=y=Math.floor(-m.x/e);M<=y+k;M++){var I=M*e+m.x;if(0<=I&&I<h&&an(M,s,t)&&(v&&!B?Fl(a,I,0,I,g,C,A.vd):(a.moveTo(I,0),a.lineTo(I,g)),2>e*s*c))break}a.stroke()}else if("LineH"===A.Jb){a.lineWidth=
A.yb;Vl(this,a,A.stroke,!1,!1);a.beginPath();for(M=y=Math.floor(-m.y/d);M<=y+l&&!(I=M*d+m.y,0<=I&&I<=g&&an(M,s,t)&&(v&&!B?Fl(a,0,I,h,I,C,A.vd):(a.moveTo(0,I),a.lineTo(h,I)),2>d*s*c));M++);a.stroke()}else if("BarV"===A.Jb)for(Vl(this,a,A.fill,!0,!1),A=A.width,isNaN(A)&&(A=e),M=y=Math.floor(-m.x/e);M<=y+k&&!(I=M*e+m.x,0<=I&&I<h&&an(M,s,t)&&(a.fillRect(I,0,A,g),2>e*s*c));M++);else if("BarH"===A.Jb)for(Vl(this,a,A.fill,!0,!1),A=A.height,isNaN(A)&&(A=d),M=y=Math.floor(-m.y/d);M<=y+l&&!(I=M*d+m.y,0<=I&&
I<=g&&an(M,s,t)&&(a.fillRect(0,I,h,A),2>d*s*c));M++);v&&(void 0!==a.setLineDash?(a.setLineDash(x.Kh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=x.Kh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0))}}a.restore();da(b,a,!1)}else{this.da===ia&&(a.lineCap="butt",bn(this,a,!0,this.Wd,!0),bn(this,a,!1,this.Sd,!0),cn(this,a,!0,this.Wd),cn(this,a,!1,this.Sd),bn(this,a,!0,this.Wd,!1),bn(this,a,!1,this.Sd,!1));(c=this.iF)&&a.save();e=this.Bf();d=this.wa.o;
h=d.length;for(g=0;g<h;g++)k=d[g],c&&k===e&&(a.Iu=!0),k.gf(a,b),c&&k===e&&(a.Iu=!1);c&&(a.restore(),da(b,a,!1));u&&u.jI&&this instanceof G&&u.iI(a,b,this)}};
function cn(a,b,c,d){for(var e=d.length,g=a.ba,h=c?a.nd(0):a.md(0),k=0;k<e;k++){var l=d[k];if(void 0!==l&&l!==h&&0!==l.Ua){if(c){if(l.position>g.height)continue}else if(l.position>g.width)continue;var m=l.eq;isNaN(m)&&(m=c?a.Qh:a.Ph);var n=l.dq;null===n&&(n=c?a.Ci:a.Oh);if(0!==m&&null!==n){Vl(a,b,n,!1,!1);var n=!1,p=!0,q=l.TJ;null!==q&&(n=!0,void 0!==b.setLineDash?(b.setLineDash(q),b.lineDashOffset=a.vd):void 0!==b.webkitLineDash?(b.webkitLineDash=q,b.webkitLineDashOffset=a.vd):void 0!==b.mozDash?
(b.mozDash=q,b.mozDashOffset=a.vd):p=!1);b.beginPath();var r=l.position+m;c?r>g.height&&(m-=r-g.height):r>g.width&&(m-=r-g.width);l=l.position+m/2;b.lineWidth=m;r=a.padding;c?(l+=r.top,m=r.left,r=g.width-r.right,n&&!p?Fl(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=g.height-r.bottom,n&&!p?Fl(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&(void 0!==b.setLineDash?(b.setLineDash(x.Kh),b.lineDashOffset=0):void 0!==b.webkitLineDash?(b.webkitLineDash=x.Kh,b.webkitLineDashOffset=
0):void 0!==b.mozDash&&(b.mozDash=null,b.mozDashOffset=0))}}}}
function bn(a,b,c,d,e){for(var g=d.length,h=a.ba,k=0;k<g;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.gA!==e&&0!==l.Ua){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.zf(),p=l.eq;isNaN(p)&&(p=c?a.Qh:a.Ph);var q=l.dq;null===q&&(q=c?a.Ci:a.Oh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Ua;p+n>m&&(n=m-p);0>=n||(m=a.padding,Vl(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}}
function an(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}function Ek(a){return"LineV"===a||"BarV"===a}
f.Ap=function(a,b,c,d,e){var g=this.Pg(),h=this.transform,k=1/(h.m11*h.m22-h.m12*h.m21),l=h.m22*k,m=-h.m12*k,n=-h.m21*k,p=h.m11*k,q=k*(h.m21*h.dy-h.m22*h.dx),r=k*(h.m12*h.dx-h.m11*h.dy);if(null!==this.zl)return h=this.ba,Q.Ql(h.left,h.top,h.right,h.bottom,a,b,c,d,e);if(null!==this.background)g=a*l+b*n+q,k=a*m+b*p+r,a=c*l+d*n+q,c=c*m+d*p+r,e.n(0,0),d=this.Ga,c=Q.Ql(0,0,d.width,d.height,g,k,a,c,e),e.transform(h);else{g||(l=1,n=m=0,p=1,r=q=0);k=a*l+b*n+q;a=a*m+b*p+r;l=c*l+d*n+q;d=c*m+d*p+r;e.n(l,d);
m=(l-k)*(l-k)+(d-a)*(d-a);c=!1;p=this.wa.o;r=p.length;n=x.P();for(q=0;q<r;q++)b=p[q],b.visible&&b.Ap(k,a,l,d,n)&&(c=!0,b=(k-n.x)*(k-n.x)+(a-n.y)*(a-n.y),b<m&&(m=b,e.set(n)));x.A(n);g&&e.transform(h)}return c};f.T=function(a){O.prototype.T.call(this,a);this.da===xj&&(a=this.Bf(),null!==a&&a.T(!0));a=this.wa.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==Xj(d)&&(d.Ba.G()||(d instanceof Gh||d instanceof H||d instanceof sa||Kl(d,!1)!==Hh)&&d.T(!0))}};
f.Fp=function(){if(!1===Xj(this)){Rj(this,!0);Ml(this,!0);for(var a=this.wa.o,b=a.length,c=0;c<b;c++)a[c].Fp()}};f.Hi=function(){if(0!==(this.ka&2048)===!1){Zl(this,!0);$l(this,!0);for(var a=this.wa.o,b=a.length,c=0;c<b;c++)a[c].vA()}};f.vA=function(){$l(this,!0);for(var a=this.wa.o,b=a.length,c=0;c<b;c++)a[c].vA()};
f.Np=function(a,b,c,d){var e=this.$i;e.width=0;e.height=0;var g=this.Ba,h=this.Kf;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.Ae;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.wa.o;if(0!==m.length){var n=this.da.Vb;switch(n){case "Position":var p=a,q=b,r=c,s=d,t=m.length;e.x=0;e.y=
0;e.width=0;for(var v=e.height=0;v<t;v++){var y=m[v];if(y.visible||y===this.$b){var A=y.margin,B=A.right+A.left,C=A.top+A.bottom;ji(y,p,q,r,s);var M=y.Ia,I=Math.max(M.width+B,0),V=Math.max(M.height+C,0),ea=y.position.x,W=y.position.y;isFinite(ea)||(ea=0);isFinite(W)||(W=0);if(y instanceof Y){var P=y;if(P.kF)var ba=P.yb/2,ea=ea-ba,W=W-ba}Eb(e,ea,W,I,V)}}break;case "Vertical":for(var Na=a,qa=c,Ma=m.length,ta=x.ub(),Ga=0;Ga<Ma;Ga++){var za=m[Ga];if(za.visible||za===this.$b){var gc=Kl(za,!1);if(gc!==
Hh&&gc!==zl)ta.push(za);else{var ld=za.margin,md=ld.right+ld.left,De=ld.top+ld.bottom;ji(za,Na,Infinity,qa,0);var Yb=za.Ia,xg=Math.max(Yb.width+md,0),nd=Math.max(Yb.height+De,0);e.width=Math.max(e.width,xg);e.height+=nd}}}var nb=ta.length;if(0!==nb){this.Ba.width?Na=Math.min(this.Ba.width,this.Ae.width):0!==e.width&&(Na=Math.min(e.width,this.Ae.width));for(Ga=0;Ga<nb;Ga++)if(za=ta[Ga],za.visible||za===this.$b)ld=za.margin,md=ld.right+ld.left,De=ld.top+ld.bottom,ji(za,Na,Infinity,qa,0),Yb=za.Ia,xg=
Math.max(Yb.width+md,0),nd=Math.max(Yb.height+De,0),e.width=Math.max(e.width,xg),e.height+=nd;x.xa(ta)}break;case "Horizontal":for(var gb=b,na=d,oa=m.length,ob=x.ub(),Va=0;Va<oa;Va++){var Ta=m[Va];if(Ta.visible||Ta===this.$b){var je=Kl(Ta,!1);if(je!==Hh&&je!==Al)ob.push(Ta);else{var od=Ta.margin,Td=od.right+od.left,Ed=od.top+od.bottom;ji(Ta,Infinity,gb,0,na);var Ud=Ta.Ia,yg=Math.max(Ud.width+Td,0),Uc=Math.max(Ud.height+Ed,0);e.width+=yg;e.height=Math.max(e.height,Uc)}}}var Oh=ob.length;if(0!==Oh){this.Ba.height?
gb=Math.min(this.Ba.height,this.Ae.height):0!==e.height&&(gb=Math.min(e.height,this.Ae.height));for(Va=0;Va<Oh;Va++)if(Ta=ob[Va],Ta.visible||Ta===this.$b)od=Ta.margin,Td=od.right+od.left,Ed=od.top+od.bottom,ji(Ta,Infinity,gb,0,na),Ud=Ta.Ia,yg=Math.max(Ud.width+Td,0),Uc=Math.max(Ud.height+Ed,0),e.width+=yg,e.height=Math.max(e.height,Uc);x.xa(ob)}break;case "Spot":a:{var xb=a,Nb=b,Vc=c,Yg=d,Ib=m.length,ib=this.Bf(),ab=ib.margin,Ee=0,Fd=0,zg=ab.right+ab.left,Ag=ab.top+ab.bottom;ji(ib,xb,Nb,Vc,Yg);var hc=
ib.Ia,ic=hc.width,Vd=hc.height,Wc=Math.max(ic+zg,0),jb=Math.max(Vd+Ag,0);e.x=-ab.left;e.y=-ab.top;e.width=Wc;e.height=jb;for(var Lc=0;Lc<Ib;Lc++){var Pa=m[Lc];if(Pa!==ib&&(Pa.visible||Pa===this.$b)){ab=Pa.margin;Ee=ab.right+ab.left;Fd=ab.top+ab.bottom;ji(Pa,xb,Nb,0,0);var hc=Pa.Ia,Wc=Math.max(hc.width+Ee,0),jb=Math.max(hc.height+Fd,0),kb=Pa.alignment;kb.bd()&&(kb=this.Gl);kb.cd()||(kb=dc);var qc=Pa.mk;qc.bd()&&(qc=dc);Eb(e,kb.x*ic+kb.offsetX-(qc.x*hc.width-qc.offsetX)-ab.left,kb.y*Vd+kb.offsetY-(qc.y*
hc.height-qc.offsetY)-ab.top,Wc,jb)}}var pd=ib.stretch;pd===yl&&(pd=Kl(ib,!1));switch(pd){case Hh:break a;case xd:if(!isFinite(xb)&&!isFinite(Nb))break a;break;case Al:if(!isFinite(xb))break a;break;case zl:if(!isFinite(Nb))break a}hc=ib.Ia;ic=hc.width;Vd=hc.height;Wc=Math.max(ic+zg,0);jb=Math.max(Vd+Ag,0);ab=ib.margin;e.x=-ab.left;e.y=-ab.top;e.width=Wc;e.height=jb;for(Lc=0;Lc<Ib;Lc++)Pa=m[Lc],Pa===ib||!Pa.visible&&Pa!==this.$b||(ab=Pa.margin,Ee=ab.right+ab.left,Fd=ab.top+ab.bottom,hc=Pa.Ia,Wc=Math.max(hc.width+
Ee,0),jb=Math.max(hc.height+Fd,0),kb=Pa.alignment,kb.bd()&&(kb=this.Gl),kb.cd()||(kb=dc),qc=Pa.mk,qc.bd()&&(qc=dc),Eb(e,kb.x*ic+kb.offsetX-(qc.x*hc.width-qc.offsetX)-ab.left,kb.y*Vd+kb.offsetY-(qc.y*hc.height-qc.offsetY)-ab.top,Wc,jb))}break;case "Auto":var Jb=a,Wd=b,ef=c,Fe=d,xf=m.length,Kb=this.Bf(),ke=Kb.margin,Ob=ke.right+ke.left,Qb=ke.top+ke.bottom;ji(Kb,Jb,Wd,ef,Fe);var Lb=Kb.Ia,Xc=Math.max(Lb.width+Ob,0),Ab=Math.max(Lb.height+Qb,0),lb=dn(Kb),jc=lb.x*Xc+lb.offsetX,Zg=lb.y*Ab+lb.offsetY,lb=en(Kb),
Bg=lb.x*Xc+lb.offsetX,$g=lb.y*Ab+lb.offsetY,Cg=Jb,Xd=Wd;isFinite(Jb)&&(Cg=Math.abs(jc-Bg));isFinite(Wd)&&(Xd=Math.abs(Zg-$g));var Zb=x.dm();Zb.n(0,0);for(var Ge=0;Ge<xf;Ge++){var rc=m[Ge];if(rc!==Kb&&(rc.visible||rc===this.$b)){var ke=rc.margin,Fb=ke.right+ke.left,Rb=ke.top+ke.bottom;ji(rc,Cg,Xd,0,0);Lb=rc.Ia;Xc=Math.max(Lb.width+Fb,0);Ab=Math.max(Lb.height+Rb,0);Zb.n(Math.max(Xc,Zb.width),Math.max(Ab,Zb.height))}}if(1===xf)e.width=Xc,e.height=Ab,x.tk(Zb);else{var Sb=dn(Kb),le=en(Kb),sc=0,tc=0;le.x!==
Sb.x&&le.y!==Sb.y&&(sc=Zb.width/Math.abs(le.x-Sb.x),tc=Zb.height/Math.abs(le.y-Sb.y));x.tk(Zb);var Bb=0;if(Kb instanceof Y){var Yc=Kb,Bb=Yc.yb*Yc.scale;Ih(Yc)===Jh&&(sc=tc=Math.max(sc,tc))}var sc=sc+(Math.abs(Sb.offsetX)+Math.abs(le.offsetX)+Bb),tc=tc+(Math.abs(Sb.offsetY)+Math.abs(le.offsetY)+Bb),Gd=Kb.stretch;Gd===yl&&(Gd=Kl(Kb,!1));switch(Gd){case Hh:Fe=ef=0;break;case xd:isFinite(Jb)&&(sc=Jb);isFinite(Wd)&&(tc=Wd);break;case Al:isFinite(Jb)&&(sc=Jb);Fe=0;break;case zl:ef=0,isFinite(Wd)&&(tc=Wd)}Kb instanceof
Y&&!Kb.Ba.G()&&(Yc=Kb,Yc.ih?Yc.Tk=null:Yc.bb=null);Kb.Fp();ji(Kb,sc,tc,ef,Fe);e.width=Kb.Ia.width+Ob;e.height=Kb.Ia.height+Qb}break;case "Table":for(var Yd=a,ff=b,Dg=c,Si=d,Ka=m.length,He=x.ub(),Zd=x.ub(),ga=0;ga<Ka;ga++){var ha=m[ga],Zc=ha instanceof H?ha:null;if(null===Zc||Zc.type!==Ol&&Zc.type!==Pl||!ha.visible)He.push(ha);else{u&&(Zc.Ba.G()&&x.k(Zc.toString()+" TableRow/TableColumn Panels cannot set a desiredSize: "+Zc.Ba.toString()),Zc.Kf.O(Q.Ln)||x.k(Zc.toString()+" TableRow/TableColumn Panels cannot set a minSize: "+
Zc.Kf.toString()),Zc.Ae.O(Q.HB)||x.k(Zc.toString()+" TableRow/TableColumn Panels cannot set a maxSize: "+Zc.Ae.toString()));Zd.push(ha);for(var ah=Zc.wa.o,Ph=ah.length,uc=0;uc<Ph;uc++){var Qh=ah[uc];Zc.type===Ol?Qh.ac=ha.ac:Zc.type===Pl&&(Qh.column=ha.column);He.push(Qh)}}}Ka=He.length;0===Ka&&(this.nd(0),this.md(0));for(var $b=[],ga=0;ga<Ka;ga++)ha=He[ga],Rj(ha,!0),Ml(ha,!0),$b[ha.ac]||($b[ha.ac]=[]),$b[ha.ac][ha.column]||($b[ha.ac][ha.column]=[]),$b[ha.ac][ha.column].push(ha);x.xa(He);for(var bh=
x.ub(),$c=x.ub(),me=x.ub(),Mc={count:0},qd={count:0},Ec=Yd,rd=ff,Sf=this.Wd,Ka=Sf.length,ga=0;ga<Ka;ga++){var aa=Sf[ga];void 0!==aa&&(aa.Ua=0)}Sf=this.Sd;Ka=Sf.length;for(ga=0;ga<Ka;ga++)aa=Sf[ga],void 0!==aa&&(aa.Ua=0);for(var ne=$b.length,Ie=0,ga=0;ga<ne;ga++)$b[ga]&&(Ie=Math.max(Ie,$b[ga].length));for(var Rh=Math.min(this.Zi,ne-1),Sh=Math.min(this.Li,Ie-1),Fc=0,ne=$b.length,ga=0;ga<ne;ga++)if($b[ga])for(var Ie=$b[ga].length,pb=this.nd(ga),uc=pb.Ua=0;uc<Ie;uc++)if($b[ga][uc]){var qb=this.md(uc);
void 0===bh[uc]&&(qb.Ua=0,bh[uc]=!0);for(var qk=$b[ga][uc],Tf=qk.length,Eg=0;Eg<Tf;Eg++)if(ha=qk[Eg],ha.visible||ha===this.$b){var Fg=1<ha.Ui||1<ha.yi;Fg&&(ga<Rh||uc<Sh||$c.push(ha));var Tb=ha.margin,Uf=Tb.right+Tb.left,Vf=Tb.top+Tb.bottom,$d=bm(ha,pb,qb,!1),oe=ha.Ba,Im=!isNaN(oe.height),Th=!isNaN(oe.width)&&Im;Fg||$d===Hh||Th||ga<Rh||uc<Sh||(void 0===Mc[uc]&&(Mc[uc]=-1,Mc.count++),void 0===qd[ga]&&(qd[ga]=-1,qd.count++),me.push(ha));ji(ha,Infinity,Infinity,0,0);if(!(ga<Rh||uc<Sh)){var Je=ha.Ia,Ke=
Math.max(Je.width+Uf,0),sd=Math.max(Je.height+Vf,0);if(1===ha.Ui&&($d===Hh||$d===Al)){var aa=this.nd(ga),ad=aa.zf(),Fc=Math.max(sd-aa.Ua,0);Fc+ad>rd&&(Fc=Math.max(rd-ad,0));var ch=0===aa.Ua;aa.Ua+=Fc;rd=Math.max(rd-(Fc+(ch?ad:0)),0)}1!==ha.yi||$d!==Hh&&$d!==zl||(aa=this.md(uc),ad=aa.zf(),Fc=Math.max(Ke-aa.Ua,0),Fc+ad>Ec&&(Fc=Math.max(Ec-ad,0)),ch=0===aa.Ua,aa.Ua+=Fc,Ec=Math.max(Ec-(Fc+(ch?ad:0)),0));Fg&&ha.Fp()}}}x.xa(bh);for(var pe=0,qe=0,Ka=this.lp,ga=0;ga<Ka;ga++)void 0!==this.Sd[ga]&&(pe+=this.md(ga).mb);
Ka=this.cq;for(ga=0;ga<Ka;ga++)void 0!==this.Wd[ga]&&(qe+=this.nd(ga).mb);for(var Ec=Math.max(Yd-pe,0),rk=rd=Math.max(ff-qe,0),sk=Ec,Ka=me.length,ga=0;ga<Ka;ga++){var ha=me[ga],pb=this.nd(ha.ac),qb=this.md(ha.column),Nc=ha.Ia,Tb=ha.margin,Uf=Tb.right+Tb.left,Vf=Tb.top+Tb.bottom;Mc[ha.column]=0===qb.Ua?Math.max(Nc.width+Uf,Mc[ha.column]):null;qd[ha.ac]=0===pb.Ua?Math.max(Nc.height+Vf,qd[ha.ac]):null}var Wf=0,Xf=0;for(ga in qd)"count"!==ga&&(Wf+=qd[ga]);for(ga in Mc)"count"!==ga&&(Xf+=Mc[ga]);for(var db=
x.dm(),ga=0;ga<Ka;ga++)if(ha=me[ga],ha.visible||ha===this.$b){var pb=this.nd(ha.ac),qb=this.md(ha.column),gf=0;isFinite(qb.width)?gf=qb.width:(gf=isFinite(Ec)&&null!==Mc[ha.column]?0===Xf?qb.Ua+Ec:Mc[ha.column]/Xf*sk:null!==Mc[ha.column]?Ec:qb.Ua||Ec,gf=Math.max(0,gf-qb.zf()));var re=0;isFinite(pb.height)?re=pb.height:(re=isFinite(rd)&&null!==qd[ha.ac]?0===Wf?pb.Ua+rd:qd[ha.ac]/Wf*rk:null!==qd[ha.ac]?rd:pb.Ua||rd,re=Math.max(0,re-pb.zf()));db.n(Math.max(qb.qj,Math.min(gf,qb.qf)),Math.max(pb.qj,Math.min(re,
pb.qf)));$d=bm(ha,pb,qb,!1);switch($d){case Al:db.height=Infinity;break;case zl:db.width=Infinity}Tb=ha.margin;Uf=Tb.right+Tb.left;Vf=Tb.top+Tb.bottom;ha.Fp();ji(ha,db.width,db.height,qb.qj,pb.qj);Je=ha.Ia;Ke=Math.max(Je.width+Uf,0);sd=Math.max(Je.height+Vf,0);isFinite(Ec)&&(Ke=Math.min(Ke,db.width));isFinite(rd)&&(sd=Math.min(sd,db.height));var Yf=0,Yf=pb.Ua;pb.Ua=Math.max(pb.Ua,sd);Fc=pb.Ua-Yf;rd=Math.max(rd-Fc,0);Yf=qb.Ua;qb.Ua=Math.max(qb.Ua,Ke);Fc=qb.Ua-Yf;Ec=Math.max(Ec-Fc,0)}x.xa(me);for(var yf=
x.dm(),Ka=$c.length,ga=0;ga<Ka;ga++)if(ha=$c[ga],ha.visible||ha===this.$b){pb=this.nd(ha.ac);qb=this.md(ha.column);db.n(Math.max(qb.qj,Math.min(Yd,qb.qf)),Math.max(pb.qj,Math.min(ff,pb.qf)));$d=bm(ha,pb,qb,!1);switch($d){case xd:0!==qb.Ua&&(db.width=Math.min(db.width,qb.Ua));0!==pb.Ua&&(db.height=Math.min(db.height,pb.Ua));break;case Al:0!==qb.Ua&&(db.width=Math.min(db.width,qb.Ua));break;case zl:0!==pb.Ua&&(db.height=Math.min(db.height,pb.Ua))}isFinite(qb.width)&&(db.width=qb.width);isFinite(pb.height)&&
(db.height=pb.height);yf.n(0,0);for(var bb=1;bb<ha.Ui&&!(ha.ac+bb>=this.cq);bb++)aa=this.nd(ha.ac+bb),yf.height+=Math.max(aa.qj,isNaN(aa.ef)?aa.qf:Math.min(aa.ef,aa.qf));for(bb=1;bb<ha.yi&&!(ha.column+bb>=this.lp);bb++)aa=this.md(ha.column+bb),yf.width+=Math.max(aa.qj,isNaN(aa.ef)?aa.qf:Math.min(aa.ef,aa.qf));db.width+=yf.width;db.height+=yf.height;Tb=ha.margin;Uf=Tb.right+Tb.left;Vf=Tb.top+Tb.bottom;ji(ha,db.width,db.height,Dg,Si);for(var Je=ha.Ia,Ke=Math.max(Je.width+Uf,0),sd=Math.max(Je.height+
Vf,0),Le=0,bb=0;bb<ha.Ui&&!(ha.ac+bb>=this.cq);bb++)aa=this.nd(ha.ac+bb),Le+=aa.total||0;if(Le<sd){var vc=sd-Le,Uh=sd-Le;if(null!==ha.gy)for(var Gg=ha.gy,bb=0;bb<ha.Ui&&!(0>=vc)&&!(ha.ac+bb>=this.cq);bb++){var aa=this.nd(ha.ac+bb),Cb=aa.mb||0,ae=Gg(ha,aa,Uh);u&&"number"!==typeof ae&&x.k(ha+" spanAllocation does not return a number: "+ae);aa.Ua=Math.min(aa.qf,Cb+ae);aa.mb!==Cb&&(vc-=aa.mb-Cb)}for(;0<vc;){Cb=aa.mb||0;isNaN(aa.height)&&aa.qf>Cb&&(aa.Ua=Math.min(aa.qf,Cb+vc),aa.mb!==Cb&&(vc-=aa.mb-Cb));
if(0===aa.index)break;aa=this.nd(aa.index-1)}}for(var Zf=0,bb=0;bb<ha.yi&&!(ha.column+bb>=this.lp);bb++)aa=this.md(ha.column+bb),Zf+=aa.total||0;if(Zf<Ke){vc=Ke-Zf;Uh=Ke-Zf;if(null!==ha.gy)for(Gg=ha.gy,bb=0;bb<ha.yi&&!(0>=vc)&&!(ha.column+bb>=this.lp);bb++)aa=this.md(ha.column+bb),Cb=aa.mb||0,ae=Gg(ha,aa,Uh),u&&"number"!==typeof ae&&x.k(ha+" spanAllocation does not return a number: "+ae),aa.Ua=Math.min(aa.qf,Cb+ae),aa.mb!==Cb&&(vc-=aa.mb-Cb);for(;0<vc;){Cb=aa.mb||0;isNaN(aa.width)&&aa.qf>Cb&&(aa.Ua=
Math.min(aa.qf,Cb+vc),aa.mb!==Cb&&(vc-=aa.mb-Cb));if(0===aa.index)break;aa=this.md(aa.index-1)}}}x.xa($c);x.tk(yf);x.tk(db);for(var se=0,$f=0,$d=Kl(this,!0),zf=this.Ba,hf=this.Ae,te=qe=pe=0,ue=0,Ka=this.lp,ga=0;ga<Ka;ga++)void 0!==this.Sd[ga]&&(aa=this.md(ga),isFinite(aa.width)?(te+=aa.width,te+=aa.zf()):fn(aa)===gn?(te+=aa.mb,te+=aa.zf()):0!==aa.mb&&(pe+=aa.mb,pe+=aa.zf()));var se=isFinite(zf.width)?Math.min(zf.width,hf.width):$d!==Hh&&isFinite(Yd)?Yd:pe,se=Math.max(se,this.Kf.width),se=Math.max(se-
te,0),jf=Math.max(se/pe,1);isFinite(jf)||(jf=1);for(ga=0;ga<Ka;ga++)void 0!==this.Sd[ga]&&(aa=this.md(ga),isFinite(aa.width)||fn(aa)===gn||(aa.Ua=aa.mb*jf),aa.position=e.width,0!==aa.mb&&(e.width+=aa.mb,e.width+=aa.zf()));Ka=this.cq;for(ga=0;ga<Ka;ga++)void 0!==this.Wd[ga]&&(aa=this.nd(ga),isFinite(aa.height)?(ue+=aa.height,ue+=aa.zf()):fn(aa)===gn?(ue+=aa.mb,ue+=aa.zf()):0!==aa.mb&&(qe+=aa.mb,qe+=aa.zf()));var $f=isFinite(zf.height)?Math.min(zf.height,hf.height):$d!==Hh&&isFinite(ff)?ff:qe,$f=Math.max($f,
this.Kf.height),$f=Math.max($f-ue,0),Vh=Math.max($f/qe,1);isFinite(Vh)||(Vh=1);for(ga=0;ga<Ka;ga++)void 0!==this.Wd[ga]&&(aa=this.nd(ga),isFinite(aa.height)||fn(aa)===gn||(aa.Ua=aa.mb*Vh),aa.position=e.height,0!==aa.mb&&(e.height+=aa.mb,e.height+=aa.zf()));Ka=Zd.length;for(ga=0;ga<Ka;ga++){var be=Zd[ga];be.type===Ol?(gf=e.width,aa=this.nd(be.ac),re=aa.Ua):(aa=this.md(be.column),gf=aa.Ua,re=e.height);be.jd.n(0,0,gf,re);Rj(be,!1);$b[be.ac]||($b[be.ac]=[]);$b[be.ac][be.column]||($b[be.ac][be.column]=
[]);$b[be.ac][be.column].push(be)}x.xa(Zd);this.ts=$b;break;case "Viewbox":var uk=a,vk=b,cq=c,dq=d;1<m.length&&x.k("Viewbox Panel cannot contain more than one GraphObject.");var Me=m[0];Me.dc=1;Me.Fp();ji(Me,Infinity,Infinity,cq,dq);var Ti=Me.Ia,wk=Me.margin,eq=wk.right+wk.left,fq=wk.top+wk.bottom;if(isFinite(uk)||isFinite(vk)){var fs=Me.scale,xk=Ti.width,yk=Ti.height,gq=Math.max(uk-eq,0),hq=Math.max(vk-fq,0),Ui=1;this.cp===Jh?0!==xk&&0!==yk&&(Ui=Math.min(gq/xk,hq/yk)):0!==xk&&0!==yk&&(Ui=Math.max(gq/
xk,hq/yk));0===Ui&&(Ui=1E-4);Me.dc*=Ui;fs!==Me.scale&&(Rj(Me,!0),ji(Me,Infinity,Infinity,cq,dq))}Ti=Me.Ia;e.width=isFinite(uk)?uk:Math.max(Ti.width+eq,0);e.height=isFinite(vk)?vk:Math.max(Ti.height+fq,0);break;case "Link":var iq=m.length,Hg=this instanceof fa?this.lh:this;if(Hg instanceof G)if(0===iq){var zk=this.Wc;vb(zk,0,0);var ce=this.Ia;ce.n(0,0,0,0)}else{var Ak=this instanceof fa?null:Hg.path,kf=Hg.Cn,Ne=this.$i;Ne.assign(kf);Ne.x=0;var Wh=Ne.y=0,Vi=Hg.points,Wh=void 0!==this.ta?this.ta:Vi.count;
this.Zh.n(kf.x,kf.y);null===this.Tg&&(this.Tg=new J(w));this.Tg.clear();null!==Ak&&(hn(Ak,kf.width,kf.height),ce=Ak.Ia,Ne.si(ce),this.Tg.add(ce));for(var Xh=x.Ih(),Wi=x.P(),ag=x.P(),Jm=0;Jm<iq;Jm++){var Ub=m[Jm];if(Ub!==Ak)if(Ub.Gf&&Ub instanceof Y)hn(Ub,kf.width,kf.height),ce=Ub.Ia,Ne.si(ce),this.Tg.add(ce);else if(2>Wh)ji(Ub,Infinity,Infinity),ce=Ub.Ia,Ne.si(ce),this.Tg.add(ce);else{var bg=Ub.Ce,kq=Ub.Ux,Km=Ub.mk;Km.ze()&&(Km=dc);var Xi=Ub.qu,gs=Ub.aG,Yi=0,Zi=0,Bk=0;if(bg<-Wh||bg>=Wh){var lq=Hg.yF,
$i=Hg.xF;Xi!==uh&&(Bk=Hg.computeAngle(Ub,Xi,$i),Ub.jm=Bk);Yi=lq.x-kf.x;Zi=lq.y-kf.y}else{var Af,Yh;if(0<=bg)Af=Vi.ia(bg),Yh=bg<Wh-1?Vi.ia(bg+1):Af;else{var Lm=Wh+bg;Af=Vi.ia(Lm);Yh=0<Lm?Vi.ia(Lm-1):Af}$i=0<=bg?Af.qh(Yh):Yh.qh(Af);Xi!==uh&&(Bk=Hg.computeAngle(Ub,Xi,$i),Ub.jm=Bk);Yi=Af.x+(Yh.x-Af.x)*kq-kf.x;Zi=Af.y+(Yh.y-Af.y)*kq-kf.y}ji(Ub,Infinity,Infinity);var ce=Ub.Ia,zk=Ub.Ga,aj=0;Ub instanceof Y&&(aj=Ub.yb);var Ck=zk.width+aj,Mm=zk.height+aj;Xh.reset();Xh.translate(-ce.x,-ce.y);Xh.scale(Ub.scale,
Ub.scale);Xh.rotate(Xi===uh?Ub.angle:$i,Ck/2,Mm/2);var Zh=new w(0,0,Ck,Mm);Wi.su(Zh,Km);Xh.Fb(Wi);var hs=-Wi.x+aj/2,is=-Wi.y+aj/2;ag.assign(gs);isNaN(ag.x)&&(ag.x=0<=bg?Ck/2+3:-(Ck/2+3));isNaN(ag.y)&&(ag.y=-(Mm/2+3));ag.rotate($i);Yi+=ag.x;Zi+=ag.y;Zh.set(ce);Zh.x=Yi+hs;Zh.y=Zi+is;this.Tg.add(Zh);Ne.si(Zh)}}if(this.Me)for(var mq=this.If;mq.next();)ji(mq.value,Infinity,Infinity);this.$i=Ne;var Nm=this.Zh;Nm.n(Nm.x+Ne.x,Nm.y+Ne.y);vb(e,Ne.width||0,Ne.height||0);x.jf(Xh);x.A(Wi);x.A(ag)}break;case "Grid":break;
case "TableRow":case "TableColumn":x.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:x.k("Unknown panel type: "+n)}}var Oe=e.width,Pe=e.height,Dk=this.padding,js=Dk.top+Dk.bottom,Oe=Oe+(Dk.left+Dk.right),Pe=Pe+js;isFinite(g.width)&&(Oe=g.width);isFinite(g.height)&&(Pe=g.height);Oe=Math.min(k.width,Oe);Pe=Math.min(k.height,Pe);Oe=Math.max(h.width,Oe);Pe=Math.max(h.height,Pe);Oe=Math.max(c,Oe);Pe=Math.max(d,
Pe);e.width=Oe;e.height=Pe;vb(this.Wc,Oe,Pe);Hl(this,0,0,Oe,Pe)};H.prototype.findMainElement=H.prototype.Bf=function(){if(null===this.Tm){var a=this.wa.o,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.Gf)return this.Tm=d}this.Tm=a[0]}return this.Tm};
H.prototype.bj=function(a,b,c,d){var e=this.$i,g=this.wa.o,h=x.Dk(0,0,0,0);if(0===g.length){var k=this.ba;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.Ba.G()){var l=Kl(this,!0),m=this.jd,n=m.width,p=m.height,q=this.margin,r=q.left+q.right,s=q.top+q.bottom;n===c&&p===d&&(l=Hh);switch(l){case Hh:if(n>c||p>d)this.T(),ji(this,n>c?c:n,p>d?d:p);break;case xd:this.T(!0);ji(this,c+r,d+s,0,0);break;case Al:this.T(!0);ji(this,c+r,p+s,0,0);break;case zl:this.T(!0),ji(this,n+r,d+s,0,0)}}k=this.ba;k.x=a;k.y=
b;k.width=c;k.height=d;var t=this.da.Vb;switch(t){case "Position":for(var v=g.length,y=e.x-this.padding.left,A=e.y-this.padding.top,B=0;B<v;B++){var C=g[B],M=C.Ia,I=C.margin,V=C.position.x,ea=C.position.y;h.x=isNaN(V)?-y:V-y;h.y=isNaN(ea)?-A:ea-A;if(C instanceof Y){var W=C;if(W.kF){var P=W.yb/2;h.x-=P;h.y-=P}}h.x+=I.left;h.y+=I.top;h.width=M.width;h.height=M.height;C.visible&&C.Kc(h.x,h.y,h.width,h.height)}break;case "Vertical":for(var ba=g.length,Na=this.padding.left,qa=this.padding.top,Ma=0;Ma<
ba;Ma++){var ta=Na,Ga=g[Ma];if(Ga.visible){var za=Ga.Ia,gc=Ga.margin,ld=gc.left+gc.right,md=Na+this.padding.right,De=za.width,Yb=Kl(Ga,!1);if(isNaN(Ga.Ba.width)&&Yb===xd||Yb===Al)De=Math.max(e.width-ld-md,0);var xg=De+ld+md,nd=Ga.alignment;nd.bd()&&(nd=this.Gl);nd.cd()||(nd=dc);Ga.Kc(ta+nd.offsetX+gc.left+(e.width*nd.x-xg*nd.x),qa+nd.offsetY+gc.top,De,za.height);qa+=za.height+gc.bottom+gc.top}}break;case "Horizontal":for(var nb=g.length,gb=this.padding.top,na=this.padding.left,oa=0;oa<nb;oa++){var ob=
gb,Va=g[oa];if(Va.visible){var Ta=Va.Ia,je=Va.margin,od=je.top+je.bottom,Td=gb+this.padding.bottom,Ed=Ta.height,Ud=Kl(Va,!1);if(isNaN(Va.Ba.height)&&Ud===xd||Ud===zl)Ed=Math.max(e.height-od-Td,0);var yg=Ed+od+Td,Uc=Va.alignment;Uc.bd()&&(Uc=this.Gl);Uc.cd()||(Uc=dc);Va.Kc(na+Uc.offsetX+je.left,ob+Uc.offsetY+je.top+(e.height*Uc.y-yg*Uc.y),Ta.width,Ed);na+=Ta.width+je.left+je.right}}break;case "Spot":var Oh=g.length,xb=this.Bf(),Nb=xb.Ia,Vc=Nb.width,Yg=Nb.height,Ib=this.padding,ib=Ib.left,ab=Ib.top;
h.x=ib-e.x;h.y=ab-e.y;xb.Kc(h.x,h.y,Vc,Yg);for(var Ee=0;Ee<Oh;Ee++){var Fd=g[Ee];if(Fd!==xb){var zg=Fd.Ia,Ag=zg.width,hc=zg.height,ic=Fd.alignment;ic.bd()&&(ic=this.Gl);ic.cd()||(ic=dc);var Vd=Fd.mk;Vd.bd()&&(Vd=dc);h.x=ic.x*Vc+ic.offsetX-(Vd.x*Ag-Vd.offsetX);h.y=ic.y*Yg+ic.offsetY-(Vd.y*hc-Vd.offsetY);h.x-=e.x;h.y-=e.y;Fd.visible&&Fd.Kc(ib+h.x,ab+h.y,Ag,hc)}}break;case "Auto":var Wc=g.length,jb=this.Bf(),Lc=jb.Ia,Pa=x.kg();Pa.n(0,0,1,1);var kb=jb.margin,qc=kb.left,pd=kb.top,Jb=this.padding,Wd=Jb.left,
ef=Jb.top;h.x=qc;h.y=pd;h.width=Lc.width;h.height=Lc.height;jb.Kc(Wd+h.x,ef+h.y,h.width,h.height);var Fe=dn(jb),xf=en(jb),Kb=0+Fe.y*Lc.height+Fe.offsetY,ke=0+xf.x*Lc.width+xf.offsetX,Ob=0+xf.y*Lc.height+xf.offsetY;Pa.x=0+Fe.x*Lc.width+Fe.offsetX;Pa.y=Kb;Eb(Pa,ke,Ob,0,0);Pa.x+=qc+Wd;Pa.y+=pd+ef;for(var Qb=0;Qb<Wc;Qb++){var Lb=g[Qb];if(Lb!==jb){var Xc=Lb.Ia,kb=Lb.margin,Ab=Math.max(Xc.width+kb.right+kb.left,0),lb=Math.max(Xc.height+kb.top+kb.bottom,0),jc=Lb.alignment;jc.bd()&&(jc=this.Gl);jc.cd()||
(jc=dc);h.x=Pa.width*jc.x+jc.offsetX-Ab*jc.x+kb.left+Pa.x;h.y=Pa.height*jc.y+jc.offsetY-lb*jc.y+kb.top+Pa.y;h.width=Pa.width;h.height=Pa.height;Lb.visible&&(Gb(Pa.x,Pa.y,Pa.width,Pa.height,h.x,h.y,Xc.width,Xc.height)?Lb.Kc(h.x,h.y,Xc.width,Xc.height):Lb.Kc(h.x,h.y,Xc.width,Xc.height,new w(Pa.x,Pa.y,Pa.width,Pa.height)))}}x.qc(Pa);break;case "Table":for(var Zg=g.length,Bg=this.padding,$g=Bg.left,Cg=Bg.top,Xd=this.ts,Zb=0,Ge=0,rc=Xd.length,Fb=0,Rb=0;Rb<rc;Rb++)Xd[Rb]&&(Fb=Math.max(Fb,Xd[Rb].length));
for(var Sb=Math.min(this.Zi,rc-1);Sb!==rc&&(void 0===this.Wd[Sb]||0===this.Wd[Sb].mb);)Sb++;for(var Sb=Math.min(Sb,rc-1),le=-this.Wd[Sb].fb,sc=Math.min(this.Li,Fb-1);sc!==Fb&&(void 0===this.Sd[sc]||0===this.Sd[sc].mb);)sc++;for(var sc=Math.min(sc,Fb-1),tc=-this.Sd[sc].fb,Bb=x.dm(),Rb=0;Rb<rc;Rb++)if(Xd[Rb])for(var Fb=Xd[Rb].length,Yc=this.nd(Rb),Ge=Yc.fb+le+Cg+Yc.qE(),Gd=0;Gd<Fb;Gd++)if(Xd[Rb][Gd])for(var Yd=this.md(Gd),Zb=Yd.fb+tc+$g+Yd.qE(),ff=Xd[Rb][Gd],Dg=ff.length,Si=0;Si<Dg;Si++){var Ka=ff[Si],
He=Ka.Ia,Zd=Ka instanceof H?Ka:null;if(null===Zd||Zd.type!==Ol&&Zd.type!==Pl){Bb.n(0,0);for(var ga=1;ga<Ka.rowSpan&&!(Rb+ga>=this.cq);ga++){var ha=this.nd(Rb+ga);Bb.height+=ha.total}for(ga=1;ga<Ka.JH&&!(Gd+ga>=this.lp);ga++){var Zc=this.md(Gd+ga);Bb.width+=Zc.total}var ah=Yd.mb+Bb.width,Ph=Yc.mb+Bb.height;h.x=Zb;h.y=Ge;h.width=ah;h.height=Ph;var uc=Zb,Qh=Ge,$b=ah,bh=Ph;Zb+ah>e.width&&($b=Math.max(e.width-Zb,0));Ge+Ph>e.height&&(bh=Math.max(e.height-Ge,0));var $c=Ka.alignment,me=0,Mc=0,qd=0,Ec=0;if($c.bd()){$c=
this.Gl;$c.cd()||($c=dc);var me=$c.x,Mc=$c.y,qd=$c.offsetX,Ec=$c.offsetY,rd=Yd.alignment,Sf=Yc.alignment;rd.cd()&&(me=rd.x,qd=rd.offsetX);Sf.cd()&&(Mc=Sf.y,Ec=Sf.offsetY)}else me=$c.x,Mc=$c.y,qd=$c.offsetX,Ec=$c.offsetY;if(isNaN(me)||isNaN(Mc))Mc=me=.5,Ec=qd=0;var aa=He.width,ne=He.height,Ie=Ka.margin,Rh=Ie.left+Ie.right,Sh=Ie.top+Ie.bottom,Fc=bm(Ka,Yc,Yd,!1);!isNaN(Ka.Ba.width)||Fc!==xd&&Fc!==Al||(aa=Math.max(ah-Rh,0));!isNaN(Ka.Ba.height)||Fc!==xd&&Fc!==zl||(ne=Math.max(Ph-Sh,0));var pb=Ka.Ae,qb=
Ka.Kf,aa=Math.min(pb.width,aa),ne=Math.min(pb.height,ne),aa=Math.max(qb.width,aa),ne=Math.max(qb.height,ne),qk=ne+Sh;h.x+=h.width*me-(aa+Rh)*me+qd+Ie.left;h.y+=h.height*Mc-qk*Mc+Ec+Ie.top;Ka.visible&&(Gb(uc,Qh,$b,bh,h.x,h.y,He.width,He.height)?Ka.Kc(h.x,h.y,aa,ne):Ka.Kc(h.x,h.y,aa,ne,new w(uc,Qh,$b,bh)))}else{Ka.Hi();Ka.Yb.Va();var Tf=Ka.Yb;Tf.x=Zd.type===Ol?$g:Zb;Tf.y=Zd.type===Pl?Cg:Ge;Tf.width=He.width;Tf.height=He.height;Ka.Yb.freeze();Ml(Ka,!1)}}x.tk(Bb);for(Rb=0;Rb<Zg;Rb++)Ka=g[Rb],Zd=Ka instanceof
H?Ka:null,null===Zd||Zd.type!==Ol&&Zd.type!==Pl||(Tf=Ka.Yb,Ka.Wc.Va(),Ka.Wc.n(0,0,Tf.width,Tf.height),Ka.Wc.freeze());break;case "Viewbox":var Eg=g[0],Fg=Eg.Ia,Tb=Eg.margin,Uf=Tb.top+Tb.bottom,Vf=Math.max(Fg.width+(Tb.right+Tb.left),0),$d=Math.max(Fg.height+Uf,0),oe=Eg.alignment;oe.bd()&&(oe=this.Gl);oe.cd()||(oe=dc);h.x=e.width*oe.x-Vf*oe.x+oe.offsetX;h.y=e.height*oe.y-$d*oe.y+oe.offsetY;h.width=Fg.width;h.height=Fg.height;Eg.Kc(h.x,h.y,h.width,h.height);break;case "Link":var Im=g.length,Th=this instanceof
fa?this.lh:this;if(Th instanceof G){var Je=this instanceof fa?null:Th.path;if(null!==this.Tg){var Ke=this.Tg.o,sd=0;if(null!==Je&&sd<this.Tg.count){var ad=Ke[sd];sd++;Je.Kc(ad.x-this.$i.x,ad.y-this.$i.y,ad.width,ad.height)}for(var ch=0;ch<Im;ch++){var pe=g[ch];pe!==Je&&sd<this.Tg.count&&(ad=Ke[sd],sd++,pe.Kc(ad.x-this.$i.x,ad.y-this.$i.y,ad.width,ad.height))}}var qe=Th.points,rk=qe.count;if(2<=rk&&this.Me)for(var sk=this.If;sk.next();){var Nc=sk.value,Wf=rk,Xf=qe,db=Nc.Ce,gf=Nc.Ux,re=Nc.mk,Yf=Nc.qu,
yf=Nc.aG,bb=0,Le=0,vc=0;if(db<-Wf||db>=Wf){var Uh=this.yF,Gg=this.xF;Yf!==uh&&(vc=this.computeAngle(Nc,Yf,Gg),Nc.angle=vc);bb=Uh.x;Le=Uh.y}else{var Cb=void 0,ae=void 0;if(0<=db)Cb=Xf.o[db],ae=db<Wf-1?Xf.o[db+1]:Cb;else var Zf=Wf+db,Cb=Xf.o[Zf],ae=0<Zf?Xf.o[Zf-1]:Cb;Gg=0<=db?Cb.qh(ae):ae.qh(Cb);Yf!==uh&&(vc=this.computeAngle(Nc,Yf,Gg),Nc.angle=vc);bb=Cb.x+(ae.x-Cb.x)*gf;Le=Cb.y+(ae.y-Cb.y)*gf}if(re.O(Wb))Nc.location=new N(bb,Le);else{re.ze()&&(re=dc);var se=x.Ih();se.reset();se.scale(Nc.scale,Nc.scale);
se.rotate(Nc.angle,0,0);var $f=Nc.Ga,zf=x.Dk(0,0,$f.width,$f.height),hf=x.P();hf.su(zf,re);se.Fb(hf);var te=-hf.x,ue=-hf.y,jf=yf.copy();isNaN(jf.x)&&(jf.x=0<=db?hf.x+3:-(hf.x+3));isNaN(jf.y)&&(jf.y=-(hf.y+3));jf.rotate(Gg);bb+=jf.x;Le+=jf.y;se.yG(zf);var te=te+zf.x,ue=ue+zf.y,Vh=x.Xb(bb+te,Le+ue);Nc.move(Vh);x.A(Vh);x.A(hf);x.qc(zf);x.jf(se)}}this instanceof fa?this.Yt(!1):Th.Yt(!1)}break;case "Grid":break;case "TableRow":case "TableColumn":x.k(this.toString()+" is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
break;default:x.k("Unknown panel type: "+t)}x.qc(h)}};H.prototype.ok=function(a){var b=this.Ga;if(Gb(0,0,b.width,b.height,a.x,a.y)){for(var b=this.wa.o,c=b.length,d=x.Xb(0,0);c--;){var e=b[c];if(e.visible||e===this.$b)if(rb(d.set(a),e.transform),e.Na(d))return x.A(d),!0}x.A(d);return null===this.Pb&&null===this.uc?!1:!0}return!1};H.prototype.ix=function(a){if(this.Rn===a)return this;for(var b=this.wa.o,c=b.length,d=0;d<c;d++){var e=b[d].ix(a);if(null!==e)return e}return null};
function jn(a,b,c){c(a,b);if(b instanceof H){b=b.wa.o;for(var d=b.length,e=0;e<d;e++)jn(a,b[e],c)}}function hk(a,b){kn(a,a,b)}function kn(a,b,c){c(b);b=b.wa.o;for(var d=b.length,e=0;e<d;e++){var g=b[e];g instanceof H&&kn(a,g,c)}}H.prototype.walkVisualTree=function(a){ln(this,this,a)};function ln(a,b,c){c(b);if(b instanceof H){b=b.wa.o;for(var d=b.length,e=0;e<d;e++)ln(a,b[e],c)}}H.prototype.findInVisualTree=H.prototype.vt=function(a){return mn(this,this,a)};
function mn(a,b,c){if(c(b))return b;if(b instanceof H){b=b.wa.o;for(var d=b.length,e=0;e<d;e++){var g=mn(a,b[e],c);if(null!==g)return g}}return null}H.prototype.findObject=H.prototype.me=function(a){if(this.name===a)return this;for(var b=this.wa.o,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof H)if(null===e.Ki&&null===e.rg){if(e=e.me(a),null!==e)return e}else if(Pk(e)&&(e=e.wa.first(),null!==e&&(e=e.me(a),null!==e)))return e}return null};
function nn(a){a=a.wa.o;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof H)c=Math.max(c,nn(e));else if(e instanceof Y){a:{if(!e.ih)switch(e.oo){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.ve/2*e.Sm*e.jj()}c=Math.max(c,e)}}return c}f=H.prototype;f.Pg=function(){return!(this.type===Ol||this.type===Pl)};
f.ne=function(a,b,c){if(!1===this.ig)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Yj(this))return null;var d=this.Ga,e=1/this.jj(),g=this.Pg(),h=g?a:rb(x.Xb(a.x,a.y),this.transform),k=this.h,l=10,m=5;null!==k&&(l=k.zp("extraTouchArea"),m=l/2);if(Gb(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.Yg){var e=this.wa.o,n=e.length,k=x.P(),m=(l=this.iF)?this.Bf():null;if(l&&(m.Pg()?rb(k.set(a),m.transform):k.set(a),!m.Na(k)))return x.A(k),g||x.A(h),null;for(;n--;){var p=e[n];if(p.visible||
p===this.$b)if(p.Pg()?rb(k.set(a),p.transform):k.set(a),!l||p!==m){var q=null;p instanceof H?q=p.ne(k,b,c):!0===p.ig&&p.Na(k)&&(q=p);if(null!==q&&(null!==b&&(q=b(q)),null!==q&&(null===c||c(q))))return x.A(k),g||x.A(h),q}}x.A(k)}if(null===this.background&&null===this.zl)return g||x.A(h),null;a=Gb(0,0,d.width,d.height,h.x,h.y)?this:null;g||x.A(h);return a}g||x.A(h);return null};
f.sp=function(a,b,c,d){if(!1===this.ig)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new J(O));var e=this.Ga,g=this.Pg(),h=g?a:rb(x.Xb(a.x,a.y),this.transform);if(Gb(0,0,e.width,e.height,h.x,h.y)){if(!this.Yg){for(var e=this.wa.o,k=e.length,l=x.P();k--;){var m=e[k];if(m.visible||m===this.$b){m.Pg()?rb(l.set(a),m.transform):l.set(a);var n=m,m=m instanceof H?m:null;(null!==m?m.sp(l,b,c,d):n.Na(l))&&!1!==n.ig&&(null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||d.add(n))}}x.A(l)}g||
x.A(h);return null!==this.background||null!==this.zl}g||x.A(h);return!1};
f.sk=function(a,b,c,d,e,g){if(!1===this.ig)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=x.Ih(),h.reset());h.multiply(this.transform);if(this.en(a,h))return on(this,b,c,e),void 0===g&&x.jf(h),!0;if(this.Hg(a,h)){if(!this.Yg)for(var k=this.wa.o,l=k.length;l--;){var m=k[l];if(m.visible||m===this.$b){var n=m.ba,p=this.Ga;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof H?m:null;p=x.Ih();p.set(h);if(null!==m?m.sk(a,b,c,d,e,p):Jl(n,a,d,p))null!==
b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);x.jf(p)}}}void 0===g&&x.jf(h);return d}void 0===g&&x.jf(h);return!1};function on(a,b,c,d){for(var e=a.wa.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.ba,l=a.Ga;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof H&&on(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
f.mn=function(a,b,c,d,e,g){if(!1===this.ig)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ga,k=this.Pg(),l=k?a:rb(x.Xb(a.x,a.y),this.transform),m=k?b:rb(x.Xb(b.x,b.y),this.transform),n=l.qk(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||sb(l.x,l.y,0,0,0,h.height)<n||sb(l.x,l.y,0,h.height,h.width,h.height)<n||sb(l.x,l.y,h.width,h.height,h.width,0)<n||sb(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&&sb(l.x,l.y,0,0,0,h.height)<n&&sb(l.x,l.y,0,h.height,h.width,h.height)<
n&&sb(l.x,l.y,h.width,h.height,h.width,0)<n&&sb(l.x,l.y,h.width,0,0,0)<n;k||(x.A(l),x.A(m));if(p){if(!this.Yg){k=x.P();l=x.P();m=this.wa.o;for(n=m.length;n--;){var q=m[n];if(q.visible||q===this.$b){var r=q.ba,s=this.Ga;r.x>s.width||r.y>s.height||0>r.x+r.width||0>r.y+r.height||(q.Pg()?(r=q.transform,rb(k.set(a),r),rb(l.set(b),r)):(k.set(a),l.set(b)),r=q,q=q instanceof H?q:null,null!==q?!q.mn(k,l,c,d,e,g):!r.QE(k,l,e))||(null!==c&&(r=c(r)),null===r||null!==d&&!d(r)||g.add(r))}}x.A(k);x.A(l)}return e?
p:h}return!1};function dn(a){var b=a.C;if(void 0===b||b===Jc)b=null;null===b&&a instanceof Y&&(a=a.bb,null!==a&&(b=a.C));null===b&&(b=Xb);return b}function en(a){var b=a.D;if(void 0===b||b===Jc)b=null;null===b&&a instanceof Y&&(a=a.bb,null!==a&&(b=a.D));null===b&&(b=lc);return b}H.prototype.add=H.prototype.add=function(a){x.l(a,O,H,"add:element");this.Nd(this.wa.count,a)};H.prototype.elt=H.prototype.ia=function(a){return this.wa.ia(a)};
H.prototype.insertAt=H.prototype.Nd=function(a,b){b instanceof D&&x.k("Cannot add a Part to a Panel: "+b);if(this===b||this.Ul(b))this===b&&x.k("Cannot make a Panel contain itself: "+this.toString()),x.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.V;null!==c&&c!==this&&x.k("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.da!==Aj||b instanceof Y||x.k("Can only add Shapes to a Grid Panel, not: "+b);b.$l(this);b.Jm=null;if(null!==this.Rt){var d=b.data;null!==d&&"object"===typeof d&&(null===this.qg&&(this.qg=new ra(Object,H)),this.qg.add(d,b))}var e=this.wa,d=-1;if(c===this){for(var g=-1,h=this.wa.o,k=h.length,l=0;l<k;l++)if(h[l]===b){g=l;break}if(-1!==g){if(g===a||g+1>=e.count&&a>=e.count)return;e.dd(g);d=g}else x.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>
a||a>e.count)a=e.count;e.Nd(a,b);this.T();b.T();null!==b.zd?this.Th=!0:b instanceof H&&!0===b.Th&&(this.Th=!0);c=this.ea;null!==c&&(c.ll=null,c.Sj=NaN,this.Th&&c instanceof E&&(c.Th=!0),c.Th&&(c.Fd=null),e=this.h,null!==e&&e.qa.tb||(-1!==d&&c.Rc(ze,"elements",this,b,null,d,null),c.Rc(ye,"elements",this,null,b,null,a)))};H.prototype.remove=H.prototype.remove=function(a){x.l(a,O,H,"remove:element");for(var b=this.wa.o,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.We(d)};
H.prototype.removeAt=H.prototype.dd=function(a){u&&x.p(a,H,"removeAt:idx");0<=a&&this.We(a)};H.prototype.We=function(a){var b=this.wa,c=b.ia(a);c.Jm=null;c.$l(null);if(null!==this.qg){var d=c.data;"object"===typeof d&&this.qg.remove(d)}b.dd(a);Rj(this,!1);this.T();this.Tm===c&&(this.Tm=null);b=this.ea;null!==b&&(b.ll=null,b.Sj=NaN,d=this.h,null!==d&&d.qa.tb||b.Rc(ze,"elements",this,c,null,a,null))};x.w(H,{cq:"rowCount"},function(){return void 0===this.Wd?0:this.Wd.length});
H.prototype.getRowDefinition=H.prototype.nd=function(a){u&&x.p(a,H,"getRowDefinition:idx");0>a&&x.la(a,">= 0",H,"getRowDefinition:idx");a=Math.round(a);var b=this.Wd;if(void 0===b[a]){var c=new sf;c.$l(this);c.qe=!0;c.index=a;b[a]=c}return b[a]};H.prototype.removeRowDefinition=H.prototype.MF=function(a){u&&x.p(a,H,"removeRowDefinition:idx");0>a&&x.la(a,">= 0",H,"removeRowDefinition:idx");a=Math.round(a);var b=this.Wd;this.Rc(ze,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.T()};
x.w(H,{lp:"columnCount"},function(){return void 0===this.Sd?0:this.Sd.length});H.prototype.getColumnDefinition=H.prototype.md=function(a){u&&x.p(a,H,"getColumnDefinition:idx");0>a&&x.la(a,">= 0",H,"getColumnDefinition:idx");a=Math.round(a);var b=this.Sd;if(void 0===b[a]){var c=new sf;c.$l(this);c.qe=!1;c.index=a;b[a]=c}return b[a]};
H.prototype.removeColumnDefinition=H.prototype.IF=function(a){u&&x.p(a,H,"removeColumnDefinition:idx");0>a&&x.la(a,">= 0",H,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Sd;this.Rc(ze,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.T()};
x.defineProperty(H,{PJ:"rowSizing"},function(){return void 0===this.Pm?$m:this.Pm},function(a){if(void 0!==this.Pm){var b=this.Pm;b!==a&&(a!==$m&&a!==gn&&x.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Pm=a,this.T(),this.j("rowSizing",b,a))}});
x.defineProperty(H,{IH:"columnSizing"},function(){return void 0===this.nm?$m:this.nm},function(a){if(void 0!==this.nm){var b=this.nm;b!==a&&(a!==$m&&a!==gn&&x.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.nm=a,this.T(),this.j("columnSizing",b,a))}});
x.defineProperty(H,{sG:"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)&&x.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Zi=a,this.T(),this.j("topIndex",b,a))}});
x.defineProperty(H,{tF:"leftIndex"},function(){return void 0===this.Li?0:this.Li},function(a){if(void 0!==this.Li){var b=this.Li;b!==a&&((!isFinite(a)||0>a)&&x.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Li=a,this.T(),this.j("leftIndex",b,a))}});H.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==ia)return NaN;for(var b=0,c=this.Wd,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};
H.prototype.findColumnForLocalX=function(a){if(0>a)return-1;if(this.type!==ia)return NaN;for(var b=0,c=this.Sd,d=c.length,e=this.Li;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};
x.defineProperty(H,{data:"data"},function(){return this.Ke},function(a){var b=this.Ke;if(b!==a){var c=this instanceof D&&!(this instanceof fa);c&&x.g(a,"object",H,"data");Kf(this);this.Ke=a;var d=this.h;null!==d&&(c?this instanceof G?(null!==b&&d.Wk.remove(b),null!==a&&d.Wk.add(a,this)):this instanceof D&&(null!==b&&d.Bi.remove(b),null!==a&&d.Bi.add(a,this)):(c=this.V,null!==c&&null!==c.qg&&(null!==b&&c.qg.remove(b),null!==a&&c.qg.add(a,this))));this.j("data",b,a);null!==d&&d.qa.tb||null!==a&&this.Ob()}});
x.defineProperty(H,{YI:"itemIndex"},function(){return this.vr},function(a){var b=this.vr;b!==a&&(this.vr=a,this.j("itemIndex",b,a))});function km(a){a=a.lm;return null!==a&&a.H}
function Kf(a){var b=a.lm;if(null===b)null!==a.data&&x.k("Template cannot have .data be non-null: "+a),a.lm=b=new J(wf);else if(b.H)return;var c=new J(O);jn(a,a,function(a,d){var e=d.Uc;if(null!==e)for(em(d,!1),e=e.i;e.next();){var g=e.value;g.mode===Cf&&em(d,!0);if(null!==g.En){var h=Df(g,a,d);null!==h&&(c.add(h),null===h.Vo&&(h.Vo=new J(wf)),h.Vo.add(g))}b.add(g)}if(d instanceof H&&d.type===ia){if(0<d.Wd.length)for(e=d.Wd,g=e.length,h=0;h<g;h++){var k=e[h];if(void 0!==k&&null!==k.Uc)for(var l=k.Uc.i;l.next();){var v=
l.value;v.yg=k;v.Iz=2;v.Aw=k.index;b.add(v)}}if(0<d.Sd.length)for(e=d.Sd,g=e.length,h=0;h<g;h++)if(k=e[h],void 0!==k&&null!==k.Uc)for(l=k.Uc.i;l.next();)v=l.value,v.yg=k,v.Iz=1,v.Aw=k.index,b.add(v)}});for(var d=c.i;d.next();){var e=d.value;if(null!==e.Vo){em(e,!0);for(var g=e.Vo.i;g.next();){var h=g.value;null===e.Uc&&(e.Uc=new J(wf));e.Uc.add(h)}}e.Vo=null}for(d=b.i;d.next();)if(e=d.value,g=e.yg,null!==g){e.yg=null;var k=e.zu,l=k.indexOf(".");0<l&&g instanceof H&&(h=k.substring(0,l),k=k.substr(l+
1),l=g.me(h),null!==l?(g=l,e.zu=k):x.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));g instanceof sf?(e.cm=x.od(g.V),g.V.Rn=e.cm):(e.cm=x.od(g),g.Rn=e.cm)}b.freeze();a instanceof D&&(a.$d()&&(ji(a,Infinity,Infinity),a.Kc()),u&&!pn&&jn(a,a,function(a,c){if(c instanceof H&&(c.type===xj||c.type===Fh)&&1>=c.elements.count&&!(c instanceof D)){if(1===c.elements.count){var d=null!==c.Rt;if(!d)for(var e=b.i;e.next();)if("itemArray"===e.value.zu){d=!0;break}}d||(x.trace("Auto or Spot Panel should not have zero or one elements: "+
c.toString()+" in "+a.toString()),pn=!0)}}))}var pn=!1;
H.prototype.updateTargetBindings=H.prototype.Ob=function(a){var b=this.lm;if(null!==b)for(void 0===a&&(a=""),b=b.i;b.next();){var c=b.value,d=c.kG;if(""===a||""===d||d===a)if(d=c.zu,null!==c.OH||""!==d){var d=this.data,e=c.En;if(null!==e)d=""===e?this:"."===e?this:".."===e?this:this.me(e);else{var g=this.h;null!==g&&c.Qt&&(d=g.aa.yk)}if(null===d)u&&x.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.cm;if(-1!==h){if(g=this.ix(h),null===g)continue}else null!==
c.yg&&(g=c.yg);"."===e?d=g:".."===e&&(d=g.V);e=c.Iz;if(0!==e){if(!(g instanceof H))continue;h=g;1===e?g=h.md(c.Aw):2===e&&(g=h.nd(c.Aw))}void 0!==g&&c.CG(g,d)}}}};x.defineProperty(H,{Rt:"itemArray"},function(){return this.Ki},function(a){var b=this.Ki;if(b!==a){u&&null!==a&&!x.isArray(a)&&x.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.h;null!==c&&null!==b&&nk(c,this);this.Ki=a;null!==c&&null!==a&&jk(c,this);this.j("itemArray",b,a);null!==c&&c.qa.tb||this.ZA()}});
function Pk(a){return a.type===Fh||a.type===xj||a.type===rh||a.type===ia&&0<a.wa.length&&(a=a.wa.ia(0),a.Gf&&a instanceof H&&(a.type===Ol||a.type===Pl))?!0:!1}H.prototype.rebuildItemElements=H.prototype.ZA=function(){var a=0;for(Pk(this)&&(a=1);this.wa.length>a;)this.We(a);a=this.Rt;if(null!==a)for(var b=x.ab(a),c=0;c<b;c++)Ok(this,x.Wa(a,c),c)};
H.prototype.findItemPanelForData=H.prototype.mI=function(a){if(void 0===a||null===a||null===this.qg)return null;x.g(a,"object",H,"findItemPanelForData");return this.qg.oa(a)};
function Ok(a,b,c){if(!(void 0===b||null===b||0>c)){var d;d=qn(a,b);var e=a.ZI,g=null;null!==e&&(g=e.oa(d));null===g&&(rn||(rn=!0,x.trace('No item template Panel found for category "'+d+'" on '+a),x.trace("  Using default item template."),d=new H,e=new sa,e.bind(new wf("text","",la)),d.add(e),sn=d),g=sn);d=g;null!==d&&(Kf(d),d=d.copy(),"object"===typeof b&&(null===a.qg&&(a.qg=new ra(Object,H)),a.qg.add(b,d)),e=c,Pk(a)&&e++,a.Nd(e,d),Qk(a,e,c),d.data=b)}}
function Qk(a,b,c){for(a=a.wa;b<a.length;){var d=a.ia(b);if(d instanceof H){var e=b,g=c;d.type===Ol?d.ac=e:d.type===Pl&&(d.column=e);d.YI=g}b++;c++}}function cj(a){a=a.wa.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];if(d instanceof tn||d instanceof H&&cj(d))return!0}return!1}
x.defineProperty(H,{zL:"itemTemplate"},function(){return null===this.rg?null:this.rg.oa("")},function(a){if(null===this.rg){if(null===a)return;this.rg=new ra("string",H)}var b=this.rg.oa("");b!==a&&(x.l(a,H,H,"itemTemplate"),(a instanceof D||a.Gf)&&x.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.rg.add("",a),this.j("itemTemplate",b,a),a=this.h,null!==a&&a.qa.tb||this.ZA())});
x.defineProperty(H,{ZI:"itemTemplateMap"},function(){return this.rg},function(a){var b=this.rg;if(b!==a){x.l(a,ra,H,"itemTemplateMap");for(var c=a.i;c.next();){var d=c.value;(d instanceof D||d.Gf)&&x.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.rg=a;this.j("itemTemplateMap",b,a);a=this.h;null!==a&&a.qa.tb||this.ZA()}});
x.defineProperty(H,{yL:"itemCategoryProperty"},function(){return this.Do},function(a){var b=this.Do;b!==a&&("string"!==typeof a&&"function"!==typeof a&&x.jc(a,"string or function",H,"itemCategoryProperty"),this.Do=a,this.j("itemCategoryProperty",b,a))});
function qn(a,b){if(null===b)return"";var c=a.Do,d="";if("function"===typeof c)d=c(b);else if("string"===typeof c&&"object"===typeof b){if(""===c)return"";d=x.wb(b,c)}else return"";if(void 0===d)return"";if("string"===typeof d)return d;x.k("Panel.getCategoryForItemData found a non-string category for "+b+": "+d);return""}var rn=!1,sn=null;x.defineProperty(H,{sL:"isAtomic"},function(){return this.Yg},function(a){var b=this.Yg;b!==a&&(x.g(a,"boolean",H,"isAtomic"),this.Yg=a,this.j("isAtomic",b,a))});
x.defineProperty(H,{iF:"isClipping"},function(){return this.jr},function(a){var b=this.jr;b!==a&&(x.g(a,"boolean",H,"isClipping"),this.jr=a,this.j("isClipping",b,a))});function sf(){x.lc(this);this.fh=null;this.Ev=!0;this.Vc=0;this.ef=NaN;this.Wj=0;this.Uj=Infinity;this.Ie=Jc;this.fb=this.mb=0;this.Uc=null;this.Hs=un;this.gi=yl;this.Ds=this.ak=null;this.Es=NaN;this.Pb=this.ai=null;this.Kq=!1}x.ja("RowColumnDefinition",sf);
sf.prototype.copy=function(){var a=new sf;a.Ev=this.Ev;a.Vc=this.Vc;a.ef=this.ef;a.Wj=this.Wj;a.Uj=this.Uj;a.Ie=this.Ie;a.mb=this.mb;a.fb=this.fb;a.gi=this.gi;a.Hs=this.Hs;a.ak=null===this.ak?null:this.ak.Y();a.Ds=this.Ds;a.Es=this.Es;a.ai=null;null!==this.ai&&(a.ai=x.Cl(this.ai));a.Pb=this.Pb;a.Kq=this.Kq;a.Uc=this.Uc;return a};
sf.prototype.qt=function(a){x.l(a,sf,sf,"copyFrom:pd");a.qe?this.height=a.height:this.width=a.width;this.qj=a.qj;this.qf=a.qf;this.alignment=a.alignment;this.stretch=a.stretch;this.vu=a.vu;this.ak=null===a.ak?null:a.ak.Y();this.dq=a.dq;this.eq=a.eq;this.ai=null;a.ai&&(this.ai=x.Cl(a.ai));this.background=a.background;this.gA=a.gA;this.Uc=a.Uc};sf.prototype.toString=function(){return"RowColumnDefinition "+(this.qe?"(Row ":"(Column ")+this.index+") #"+x.od(this)};var un;
sf.Default=un=x.s(sf,"Default",0);var gn;sf.None=gn=x.s(sf,"None",1);var $m;sf.ProportionalExtra=$m=x.s(sf,"ProportionalExtra",2);sf.prototype.$l=function(a){this.fh=a};sf.prototype.computeEffectiveSpacingTop=sf.prototype.qE=function(){var a=0;if(0!==this.index){var b=this.fh,c=this.dq;null===c&&null!==b&&(c=this.qe?b.Ci:b.Oh);null!==c&&(a=this.eq,isNaN(a)&&(a=null!==b?this.qe?b.Qh:b.Ph:0))}b=this.dG;if(null===b)if(b=this.fh,null!==b)b=b.Bj;else return a;return a+(this.qe?b.top:b.left)};
sf.prototype.computeEffectiveSpacing=sf.prototype.zf=function(){var a=0;if(0!==this.index){var b=this.fh,c=this.dq;null===c&&null!==b&&(c=this.qe?b.Ci:b.Oh);null!==c&&(a=this.eq,isNaN(a)&&(a=null!==b?this.qe?b.Qh:b.Ph:0))}b=this.dG;if(null===b)if(b=this.fh,null!==b)b=b.Bj;else return a;return a+(this.qe?b.top+b.bottom:b.left+b.right)};
sf.prototype.kd=function(a,b,c,d,e){var g=this.fh;if(null!==g&&(g.Rc(we,a,this,b,c,d,e),null!==this.Uc&&(b=g.vp(),null!==b&&(b=b.data,null!==b))))for(c=this.Uc.i;c.next();)c.value.hy(this,b,a,null)};x.w(sf,{V:"panel"},function(){return this.fh});x.defineProperty(sf,{qe:"isRow"},function(){return this.Ev},function(a){this.Ev=a});x.defineProperty(sf,{index:"index"},function(){return this.Vc},function(a){this.Vc=a});
x.defineProperty(sf,{height:"height"},function(){return this.ef},function(a){var b=this.ef;b!==a&&(u&&x.g(a,"number",sf,"height"),0>a&&x.la(a,">= 0",sf,"height"),this.ef=a,this.Ua=this.mb,null!==this.V&&this.V.T(),this.kd("height",b,a))});x.defineProperty(sf,{width:"width"},function(){return this.ef},function(a){var b=this.ef;b!==a&&(u&&x.g(a,"number",sf,"width"),0>a&&x.la(a,">= 0",sf,"width"),this.ef=a,this.Ua=this.mb,null!==this.V&&this.V.T(),this.kd("width",b,a))});
x.defineProperty(sf,{qj:"minimum"},function(){return this.Wj},function(a){var b=this.Wj;b!==a&&(u&&x.g(a,"number",sf,"minimum"),(0>a||!isFinite(a))&&x.la(a,">= 0",sf,"minimum"),this.Wj=a,this.Ua=this.mb,null!==this.V&&this.V.T(),this.kd("minimum",b,a))});x.defineProperty(sf,{qf:"maximum"},function(){return this.Uj},function(a){var b=this.Uj;b!==a&&(u&&x.g(a,"number",sf,"maximum"),0>a&&x.la(a,">= 0",sf,"maximum"),this.Uj=a,this.Ua=this.mb,null!==this.V&&this.V.T(),this.kd("maximum",b,a))});
x.defineProperty(sf,{alignment:"alignment"},function(){return this.Ie},function(a){var b=this.Ie;b.O(a)||(u&&x.l(a,R,sf,"alignment"),this.Ie=a.Y(),null!==this.V&&this.V.T(),this.kd("alignment",b,a))});x.defineProperty(sf,{stretch:"stretch"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(u&&x.Ca(a,O,sf,"stretch"),this.gi=a,null!==this.V&&this.V.T(),this.kd("stretch",b,a))});
x.defineProperty(sf,{dG:"separatorPadding"},function(){return this.ak},function(a){"number"===typeof a?a=new yb(a):null!==a&&u&&x.l(a,yb,sf,"separatorPadding");var b=this.ak;null!==a&&null!==b&&b.O(a)||(null!==a&&(a=a.Y()),this.ak=a,null!==this.V&&this.V.T(),this.kd("separatorPadding",b,a))});
x.defineProperty(sf,{dq:"separatorStroke"},function(){return this.Ds},function(a){var b=this.Ds;b!==a&&(null===a||"string"===typeof a||a instanceof Ea)&&(a instanceof Ea&&a.freeze(),this.Ds=a,null!==this.V&&this.V.T(),this.kd("separatorStroke",b,a))});x.defineProperty(sf,{eq:"separatorStrokeWidth"},function(){return this.Es},function(a){var b=this.Es;b!==a&&(this.Es=a,null!==this.V&&this.V.T(),this.kd("separatorStrokeWidth",b,a))});
x.defineProperty(sf,{TJ:"separatorDashArray"},function(){return this.ai},function(a){var b=this.ai;if(b!==a){null===a||Array.isArray(a)||x.jc(a,"Array",sf,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||x.k("separatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.ai=a;null!==this.V&&this.V.ua();this.kd("separatorDashArray",b,a)}});
x.defineProperty(sf,{background:"background"},function(){return this.Pb},function(a){var b=this.Pb;b!==a&&(null===a||"string"===typeof a||a instanceof Ea)&&(a instanceof Ea&&a.freeze(),this.Pb=a,null!==this.V&&this.V.ua(),this.kd("background",b,a))});x.defineProperty(sf,{gA:"coversSeparators"},function(){return this.Kq},function(a){var b=this.Kq;b!==a&&(x.g(a,"boolean",sf,"coversSeparators"),this.Kq=a,null!==this.V&&this.V.ua(),this.kd("coversSeparators",b,a))});
x.defineProperty(sf,{vu:"sizing"},function(){return this.Hs},function(a){var b=this.Hs;b!==a&&(u&&x.Ca(a,sf,sf,"sizing"),this.Hs=a,null!==this.V&&this.V.T(),this.kd("sizing",b,a))});function fn(a){if(a.vu===un){var b=a.fh;return a.qe?b.PJ:b.IH}return a.vu}x.defineProperty(sf,{Ua:"actual"},function(){return this.mb},function(a){this.mb=isNaN(this.ef)?Math.max(Math.min(this.Uj,a),this.Wj):Math.max(Math.min(this.Uj,this.ef),this.Wj)});
x.defineProperty(sf,{total:"total"},function(){return this.mb+this.zf()},function(a){this.mb=isNaN(this.ef)?Math.max(Math.min(this.Uj,a),this.Wj):Math.max(Math.min(this.Uj,this.ef),this.Wj);this.mb=Math.max(0,this.mb-this.zf())});x.defineProperty(sf,{position:"position"},function(){return this.fb},function(a){this.fb=a});
sf.prototype.bind=sf.prototype.bind=function(a){a.yg=this;var b=this.V;if(null!==b){var c=b.vp();null!==c&&km(c)&&x.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null===this.Uc&&(this.Uc=new J(wf));this.Uc.add(a)};
function Y(){O.call(this);this.bb=null;this.oo="None";this.ih=!1;this.dr=yl;this.Tk=null;this.Jc=this.Cd="black";this.ve=1;this.Zo="butt";this.ap="miter";this.Sm=10;this.$o=null;this.vd=0;this.Xi=this.Wi=Jc;this.bs=this.as=NaN;this.kr=!1;this.ds=null;this.so=this.bp="None";this.hr=1}x.Qa(Y,O);x.ja("Shape",Y);
Y.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.bb=this.bb;a.oo=this.oo;a.ih=this.ih;a.dr=this.dr;a.Tk=this.Tk;a.Cd=this.Cd;a.Jc=this.Jc;a.ve=this.ve;a.Zo=this.Zo;a.ap=this.ap;a.Sm=this.Sm;null!==this.$o&&(a.$o=x.Cl(this.$o));a.vd=this.vd;a.Wi=this.Wi.Y();a.Xi=this.Xi.Y();a.as=this.as;a.bs=this.bs;a.kr=this.kr;a.ds=this.ds;a.bp=this.bp;a.so=this.so;a.hr=this.hr};
Y.prototype.toString=function(){return"Shape("+("None"!==this.Jb?this.Jb:"None"!==this.kq?this.kq:this.oA)+")#"+x.od(this)};
function vn(a,b,c,d){var e=d.Ia,g=Math.max(1,e.width),e=e.height,h=0,k=0,l=0,m=0,n=c.length;if(!(4>n)){for(var h=c[0],k=c[1],p=0,q=0,r=0,s=l=0,t=q=0,v=x.ub(),y=2;y<n;y+=2)l=c[y],m=c[y+1],p=l-h,q=m-k,0===p&&(p=.001),r=q/p,s=Math.atan2(q,p),q=Math.sqrt(p*p+q*q),h=[],h[0]=p,h[1]=s,h[2]=r,h[3]=q,v.push(h),t+=q,h=l,k=m;h=c[0];k=c[1];p=d.Ia.width;d instanceof Y&&(p-=d.yb);1>p&&(p=1);c=p;for(var n=0,m=c,y=g/2,q=0===y?!1:!0,A=0,l=v[A],p=l[0],s=l[1],r=l[2],l=l[3],B=0;.1<=t;){0===B&&(q?(m=c,n++,m-=y,t-=y,q=
!1):(m=c,n++),0===m&&(m=1));if(m>t){x.xa(v);return}m>l?(B=m-l,m=l):B=0;var C=Math.sqrt(m*m/(1+r*r));0>p&&(C=-C);h+=C;k+=r*C;a.translate(h,k);a.rotate(s);a.translate(-(g/2),-(e/2));0===B&&d.rk(a,b);a.translate(g/2,e/2);a.rotate(-s);a.translate(-h,-k);t-=m;l-=m;if(0!==B){A++;if(A===v.length){x.xa(v);return}l=v[A];p=l[0];s=l[1];r=l[2];l=l[3];m=B}}x.xa(v)}}
Y.prototype.rk=function(a,b){if(null!==this.Jc||null!==this.Cd){null!==this.Cd&&Vl(this,a,this.Cd,!0,!1);null!==this.Jc&&Vl(this,a,this.Jc,!1,!1);var c=this.ve;if(0===c){var d=this.ea;d instanceof fa&&d.type===rh&&"Selection"===d.Lc&&d.oc instanceof Y&&d.lh.Bf()===d.oc&&(c=d.oc.yb)}a.lineWidth=c;a.lineJoin=this.ap;a.lineCap=this.Zo;a.miterLimit=this.Sm;var e=!1;this.ea&&b.vk("drawShadows")&&(e=this.ea.xk);var g=!0;null!==this.Jc&&null===this.Cd&&(g=!1);var d=!1,h=!0,k=this.mG;null!==k&&(d=!0,void 0!==
a.setLineDash?(a.setLineDash(k),a.lineDashOffset=this.vd):void 0!==a.webkitLineDash?(a.webkitLineDash=k,a.webkitLineDashOffset=this.vd):void 0!==a.mozDash?(a.mozDash=k,a.mozDashOffset=this.vd):h=!1);var l=this.bb;if(null!==l){if(l.da===yd)a.beginPath(),d&&!h?Fl(a,l.wc,l.Cc,l.Db,l.Ib,k,this.vd):(a.moveTo(l.wc,l.Cc),a.lineTo(l.Db,l.Ib)),null!==this.Cd&&Wl(a,this.Cd),0!==c&&null!==this.Jc&&Yl(a);else if(l.da===zd){var m=l.wc,n=l.Cc,p=l.Db,q=l.Ib,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-
n);null!==this.Cd&&(a.beginPath(),a.rect(l,r,m,n),Wl(a,this.Cd));if(null!==this.Jc){var s=p=0,t=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0);d&&!h?(h=x.ub(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),wn(a,h,k,this.vd),Yl(a),x.xa(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),Yl(a));g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t)}}else if(l.da===Ad)m=
l.wc,n=l.Cc,p=l.Db,q=l.Ib,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+Q.Ka*l,n-r,m+l,n-Q.Ka*r,m+l,n),a.bezierCurveTo(m+l,n+Q.Ka*r,m+Q.Ka*l,n+r,m,n+r),a.bezierCurveTo(m-Q.Ka*l,n+r,m-l,n+Q.Ka*r,m-l,n),a.bezierCurveTo(m-l,n-Q.Ka*r,m-Q.Ka*l,n-r,m,n-r),a.closePath(),null!==this.Cd&&Wl(a,this.Cd),d&&!h&&(h=x.ub(),Q.xe(m,n-r,m+Q.Ka*l,n-r,m+l,n-Q.Ka*r,m+l,n,.5,h),Q.xe(m+l,n,m+l,n+Q.Ka*r,m+Q.Ka*l,n+r,m,n+r,.5,h),Q.xe(m,n+r,m-Q.Ka*
l,n+r,m-l,n+Q.Ka*r,m-l,n,.5,h),Q.xe(m-l,n,m-l,n-Q.Ka*r,m-Q.Ka*l,n-r,m,n-r,.5,h),a.beginPath(),wn(a,h,k,this.vd),x.xa(h)),0!==c&&null!==this.Jc&&(t=s=p=0,g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),Yl(a),g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t));else if(l.da===vd){r=l.Dj;n=r.length;for(q=0;q<n;q++){m=r.o[q];a.beginPath();a.moveTo(m.Ha,m.Da);for(var p=m.Eb.o,s=p.length,v=null,t=0;t<s;t++){var y=p[t];switch(y.da){case Nd:a.moveTo(y.M,
y.N);break;case Cd:a.lineTo(y.M,y.N);break;case Od:a.bezierCurveTo(y.Ed,y.Pe,y.gh,y.xg,y.Db,y.Ib);break;case Pd:a.quadraticCurveTo(y.Ed,y.Pe,y.Db,y.Ib);break;case Qd:if(y.radiusX===y.radiusY)v=Math.PI/180,a.arc(y.Ed,y.Pe,y.radiusX,y.De*v,(y.De+y.Nf)*v,0>y.Nf);else{var v=Sd(y,m),A=v.length;if(0===A){a.lineTo(y.sa,y.Aa);break}for(var B=0;B<A;B++){var C=v[B];0===B&&a.lineTo(C[0],C[1]);a.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7])}}break;case Rd:B=A=0;if(null!==v&&v.type===Qd){v=Sd(v,m);C=v.length;if(0===
C){a.lineTo(y.sa,y.Aa);break}v=v[C-1]||null;null!==v&&(A=v[6],B=v[7])}else A=null!==v?v.M:m.Ha,B=null!==v?v.N:m.Da;v=de(y,m,A,B);A=v.length;if(0===A){a.lineTo(y.sa,y.Aa);break}for(B=0;B<A;B++)C=v[B],a.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7]);break;default:x.k("Segment not of valid type: "+y.da)}y.Vh&&a.closePath();v=y}e?(t=s=p=0,m.Ao?(!0===m.rm&&null!==this.Cd?(Wl(a,this.Cd),g=!0):g=!1,0!==c&&null!==this.Jc&&(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
0,a.shadowBlur=0),d&&!h||Yl(a),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),!0===m.rm&&null!==this.Cd&&Wl(a,this.Cd),0!==c&&null!==this.Jc&&(d&&!h||Yl(a)),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(!0===m.rm&&null!==this.Cd&&Wl(a,this.Cd),0===c||null===this.Jc||d&&!h||Yl(a))}if(d&&!h)for(c=g,g=l.Dj,h=g.length,l=0;l<h;l++){r=g.o[l];a.beginPath();n=x.ub();n.push(r.Ha);
n.push(r.Da);q=r.Ha;m=r.Da;p=q;s=m;t=r.Eb.o;y=t.length;for(v=0;v<y;v++){A=t[v];switch(A.da){case Nd:wn(a,n,k,this.vd);n.length=0;n.push(A.M);n.push(A.N);q=A.M;m=A.N;p=q;s=m;break;case Cd:n.push(A.M);n.push(A.N);q=A.M;m=A.N;break;case Od:Q.xe(q,m,A.Ed,A.Pe,A.gh,A.xg,A.Db,A.Ib,.5,n);q=A.M;m=A.N;break;case Pd:Q.Wp(q,m,A.Ed,A.Pe,A.Db,A.Ib,.5,n);q=A.M;m=A.N;break;case Qd:B=Sd(A,r);C=B.length;if(0===C){n.push(A.sa);n.push(A.Aa);q=A.sa;m=A.Aa;break}for(var M=0;M<C;M++){var I=B[M];Q.xe(q,m,I[2],I[3],I[4],
I[5],I[6],I[7],.5,n);q=I[6];m=I[7]}break;case Rd:B=de(A,r,q,m);C=B.length;if(0===C){n.push(A.sa);n.push(A.Aa);q=A.sa;m=A.Aa;break}for(M=0;M<C;M++)I=B[M],Q.xe(q,m,I[2],I[3],I[4],I[5],I[6],I[7],.5,n),q=I[6],m=I[7];break;default:x.k("Segment not of valid type: "+A.da)}A.Vh&&(n.push(p),n.push(s),wn(a,n,k,this.vd))}wn(a,n,k,this.vd);x.xa(n);null!==this.Jc&&(q=n=r=0,c&&e&&(r=a.shadowOffsetX,n=a.shadowOffsetY,q=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),Yl(a),c&&e&&(a.shadowOffsetX=
r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&(void 0!==a.setLineDash?(a.setLineDash(x.Kh),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=x.Kh,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0));if(null!==this.Jx){d=this.Jx;ji(d,Infinity,Infinity);k=d.Ia;d.Kc(0,0,k.width,k.height);c=this.xp;a.save();a.beginPath();k=x.ub();if(c.type===yd)k.push(c.Ha),k.push(c.Da),k.push(c.M),k.push(c.N),vn(a,b,k,d);else if(c.type===vd)for(h=c.ec.i;h.next();){l=h.value;k.length=
0;k.push(l.Ha);k.push(l.Da);g=l.Ha;r=l.Da;n=g;q=r;m=l.Eb.o;p=m.length;for(s=0;s<p;s++){t=m[s];switch(t.da){case Nd:vn(a,b,k,d);k.length=0;k.push(t.M);k.push(t.N);g=t.M;r=t.N;n=g;q=r;break;case Cd:k.push(t.M);k.push(t.N);g=t.M;r=t.N;break;case Od:Q.xe(g,r,t.Ed,t.Pe,t.gh,t.xg,t.Db,t.Ib,.5,k);g=t.M;r=t.N;break;case Pd:Q.Wp(g,r,t.Ed,t.Pe,t.Db,t.Ib,.5,k);g=t.M;r=t.N;break;case Qd:c=Sd(t,l);e=c.length;if(0===e){k.push(t.sa);k.push(t.Aa);g=t.sa;r=t.Aa;break}for(y=0;y<e;y++)v=c[y],Q.xe(g,r,v[2],v[3],v[4],
v[5],v[6],v[7],.5,k),g=v[6],r=v[7];break;case Rd:c=de(t,l,g,r);e=c.length;if(0===e){k.push(t.sa);k.push(t.Aa);g=t.sa;r=t.Aa;break}for(y=0;y<e;y++)v=c[y],Q.xe(g,r,v[2],v[3],v[4],v[5],v[6],v[7],.5,k),g=v[6],r=v[7];break;default:x.k("Segment not of valid type: "+t.da)}t.Vh&&(k.push(n),k.push(q),vn(a,b,k,d))}vn(a,b,k,d)}else if(c.type===zd)k.push(c.Ha),k.push(c.Da),k.push(c.M),k.push(c.Da),k.push(c.M),k.push(c.N),k.push(c.Ha),k.push(c.N),k.push(c.Ha),k.push(c.Da),vn(a,b,k,d);else if(c.type===Ad){h=new wd;
h.Ha=c.M;h.Da=(c.Da+c.N)/2;g=new ge(Qd);g.De=0;g.Nf=360;g.sa=(c.Ha+c.M)/2;g.Aa=(c.Da+c.N)/2;g.radiusX=Math.abs(c.Ha-c.M)/2;g.radiusY=Math.abs(c.Da-c.N)/2;h.add(g);c=Sd(g,h);e=c.length;if(0===e)k.push(g.sa),k.push(g.Aa);else for(g=h.Ha,r=h.Da,y=0;y<e;y++)v=c[y],Q.xe(g,r,v[2],v[3],v[4],v[5],v[6],v[7],.5,k),g=v[6],r=v[7];vn(a,b,k,d)}x.xa(k);a.restore();da(b,a,!1)}}}};
function wn(a,b,c,d){var e=.001,g=c.length,h=0,k=0,l=0,m=0,e=b.length;if(!(4>e))if(h=b[0],k=b[1],4===e)Fl(a,h,k,b[2],b[3],c,d);else{a.moveTo(h,k);for(var n=0,p=0,q=0,r=p=l=0,s=x.ub(),t=2;t<e;t+=2)l=b[t],m=b[t+1],n=l-h,p=m-k,0===n&&(n=.001),q=p/n,p=Math.sqrt(n*n+p*p),h=[],h[0]=n,h[1]=q,h[2]=p,s.push(h),r+=p,h=l,k=m;h=b[0];k=b[1];b=0;for(var m=!0,e=c[b%g],t=0!==d,p=0,l=s[p],n=l[0],q=l[1],l=l[2],v=0;.1<=r;){0===v&&(e=c[b%g],b++,t&&(d%=e,e-=d,t=!1));e>r&&(e=r);e>l?(v=e-l,e=l):v=0;var y=Math.sqrt(e*e/
(1+q*q));0>n&&(y=-y);h+=y;k+=q*y;m?a.lineTo(h,k):a.moveTo(h,k);r-=e;l-=e;if(0!==v){p++;if(p===s.length){x.xa(s);return}l=s[p];n=l[0];q=l[1];l=l[2];e=v}else m=!m}x.xa(s)}}Y.prototype.getDocumentPoint=Y.prototype.gb=function(a,b){void 0===b&&(b=new N);a.ze()&&x.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ga,d=this.yb;b.n(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY);this.mh.Fb(b);return b};
Y.prototype.ok=function(a,b){var c=this.bb;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.Cb,e=this.yb/2;c.type!==yd||b||(e+=2);var g=x.kg();g.assign(d);g.cg(e+2,e+2);if(!g.Na(a))return x.qc(g),!1;d=e+1E-4;if(c.type===yd){if(null===this.stroke)return!1;d=(c.M-c.Ha)*(a.x-c.Ha)+(c.N-c.Da)*(a.y-c.Da);if(0>(c.Ha-c.M)*(a.x-c.M)+(c.Da-c.N)*(a.y-c.N)||0>d)return!1;x.qc(g);return Q.Pd(c.Ha,c.Da,c.M,c.N,e,a.x,a.y)}if(c.type===zd){var h=c.Ha,k=c.Da,l=c.M,m=c.N,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.cg(-d,-d);if(g.Na(a))return x.qc(g),!1;g.cg(d,d)}null!==this.stroke&&g.cg(e,e);e=g.Na(a);x.qc(g);return e}if(c.type===Ad){h=c.Ha;k=c.Da;l=c.M;m=c.N;c=Math.min(h,l);n=Math.min(k,m);h=Math.abs(l-h);k=Math.abs(m-k);h/=2;k/=2;c=a.x-(c+h);n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return x.qc(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);x.qc(g);return 0>=h||0>=k?!1:1>=c*c/
(h*h)+n*n/(k*k)}if(c.type===vd)return x.qc(g),null===this.fill?fe(c,a.x,a.y,e):c.Na(a,e,1<this.yb,b);x.k("Unknown Geometry type: "+c.type);return!1};
Y.prototype.Np=function(a,b,c,d){var e=this.Ba,g=this.ve;a=Math.max(a,0);b=Math.max(b,0);var h;if(this.ih)h=this.bb.Cb;else{var k=this.Jb,l=Q.py[k];if(void 0===l){var m=Q.Gg[k];"string"===typeof m&&(m=Q.Gg[m]);"function"===typeof m?(l=m(null,100,100),Q.py[k]=l):x.k("Unsupported Figure: "+k)}h=l.Cb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(Kl(this,!0)){case Hh:d=c=0;break;case xd:m=Math.max(a-g,0);n=Math.max(b-g,0);break;case Al:m=Math.max(a-g,0);d=0;break;case zl:c=0,n=Math.max(b-g,0)}isFinite(e.width)&&
(m=e.width);isFinite(e.height)&&(n=e.height);e=this.Ae;h=this.Kf;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=Ih(this);switch(c){case Hh:break;case xd:k=m;l=n;break;case Jh:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:x.k(c+" is not a valid geometryStretch.")}if(this.ih)h=this.xp,e=k,d=l,c=h.copy(),h=h.Cb,e/=h.width,d/=h.height,isFinite(e)||(e=1),
isFinite(d)||(d=1),1===e&&1===d||c.scale(e,d),this.bb=c;else if(null===this.bb||this.bb.zo!==a-g||this.bb.xo!==b-g)this.bb=Q.makeGeometry(this,k,l);h=this.bb.Cb;Infinity===a||Infinity===b?Hl(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):Hl(this,-(g/2),-(g/2),m+g,n+g)};
function hn(a,b,c){if(!1!==Xj(a)){a.jd.Va();var d=a.ve;if(0===d){var e=a.ea;e instanceof fa&&e.type===rh&&e.oc instanceof Y&&(d=e.oc.yb)}d*=a.dc;Hl(a,-(d/2),-(d/2),b+d,c+d);b=a.jd;c=a.Ae;d=a.Kf;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.jd.freeze();a.jd.G()||x.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.jd.toString());Rj(a,!1)}}
function Ih(a){var b=a.pA;return a.ih?b===yl?xd:b:b===yl?Q.py[a.Jb].Xd:b}Y.prototype.bj=function(a,b,c,d){Ll(this,a,b,c,d)};Y.prototype.getNearestIntersectionPoint=Y.prototype.Ql=function(a,b,c){return this.Ap(a.x,a.y,b.x,b.y,c)};
Y.prototype.Ap=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.yb/2,p=this.bb;null===p&&(ji(this,Infinity,Infinity),p=this.bb);q=p.Cb;n=!1;if(p.type===yd)if(1.5>=this.yb)n=Q.xh(p.wc,p.Cc,p.Db,p.Ib,g,h,k,l,e);else{var r=0,s=0;p.wc===p.Db?(r=m,s=0):(b=(p.Ib-p.Cc)/(p.Db-p.wc),s=m/Math.sqrt(1+b*b),r=s*b);d=x.ub();b=new N;Q.xh(p.wc+
r,p.Cc+s,p.Db+r,p.Ib+s,g,h,k,l,b)&&d.push(b);b=new N;Q.xh(p.wc-r,p.Cc-s,p.Db-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=new N;Q.xh(p.wc+r,p.Cc+s,p.wc-r,p.Cc-s,g,h,k,l,b)&&d.push(b);b=new N;Q.xh(p.Db+r,p.Ib+s,p.Db-r,p.Ib-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return x.xa(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],t=(k.x-g)*(k.x-g)+(k.y-h)*(k.y-h);t<s&&(s=t,e.x=k.x,e.y=k.y)}x.xa(d)}else if(p.type===zd)b=q.x-m,n=Q.Ql(b,q.y-m,q.x+q.width+m,q.y+q.height+m,g,h,k,l,e);else if(p.type===Ad)a:if(b=q.copy().cg(m,
m),0===b.width)n=Q.xh(b.x,b.y,b.x,b.y+b.height,g,h,k,l,e);else if(0===b.height)n=Q.xh(b.x,b.y,b.x+b.width,b.y,g,h,k,l,e);else{a=b.width/2;var v=b.height/2;d=b.x+a;b=b.y+v;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+v*v-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+v*v-n*n);k=(-(a*a*c*n)+a*v*m)/(v*v+a*a*c*c)+d;a=(-(a*a*c*n)-a*v*m)/(v*v+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=v*v;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===vd){var y=0,A=0,B=t=0,q=x.P(),r=k-g,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.ec.count;r++)for(var C=p.ec.o[r],M=C.Eb,y=C.Ha,A=C.Da,I=y,V=A,ea=0;ea<M.count;ea++){var W=M.o[ea],P=W.type,t=W.M,B=W.N,ba=!1;switch(P){case Nd:I=t;V=B;break;case Cd:ba=xn(y,A,t,B,g,h,k,l,q);break;case Od:var ba=
W.zc,P=W.Qc,Na=W.Dh,qa=W.Eh,ba=Q.it(y,A,ba,P,Na,qa,t,B,g,h,k,l,.5,q);break;case Pd:ba=(y+2*W.zc)/3;P=(A+2*W.Qc)/3;Na=(2*W.zc+t)/3;qa=(2*W.zc+t)/3;ba=Q.it(y,A,ba,P,Na,qa,t,B,g,h,k,l,.5,q);break;case Qd:case Rd:P=W.type===Qd?Sd(W,C):de(W,C,y,A);Na=P.length;if(0===Na){ba=xn(y,A,W.sa,W.Aa,g,h,k,l,q);break}for(B=0;B<Na;B++)v=P[B],0===B&&xn(y,A,v[0],v[1],g,h,k,l,q)&&(t=yn(g,h,q,s,e),t<s&&(s=t,n=!0)),Q.it(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],g,h,k,l,.5,q)&&(t=yn(g,h,q,s,e),t<s&&(s=t,n=!0));t=v[6];B=v[7];
break;default:x.k("Unknown Segment type: "+P)}y=t;A=B;ba&&(t=yn(g,h,q,s,e),t<s&&(s=t,n=!0));W.sx&&(t=I,B=V,xn(y,A,t,B,g,h,k,l,q)&&(t=yn(g,h,q,s,e),t<s&&(s=t,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;x.A(q)}else x.k("Unknown Geometry type: "+p.type);if(!n)return!1;this.transform.Fb(e);return!0};function yn(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 xn(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||Q.jb(l.y,e))&&(l.y<a||Q.jb(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||Q.jb(l.x,e))&&(l.x<a||Q.jb(l.x,a))&&(m=!0));return m}
Y.prototype.containedInRect=Y.prototype.en=function(a,b){if(void 0===b)return a.pk(this.ba);var c=this.bb;null===c&&(ji(this,Infinity,Infinity),c=this.bb);var c=c.Cb,d=this.yb/2,e=!1,g=x.P();g.n(c.x-d,c.y-d);a.Na(b.Fb(g))&&(g.n(c.x-d,c.bottom+d),a.Na(b.Fb(g))&&(g.n(c.right+d,c.bottom+d),a.Na(b.Fb(g))&&(g.n(c.right+d,c.y-d),a.Na(b.Fb(g))&&(e=!0))));x.A(g);return e};
Y.prototype.intersectsRect=Y.prototype.Hg=function(a,b){if(this.en(a,b)||void 0===b&&(b=this.transform,a.pk(this.ba)))return!0;var c=x.Ih();c.set(b);c.wA();var d=a.left,e=a.right,g=a.top,h=a.bottom,k=x.P();k.n(d,g);c.Fb(k);if(this.ok(k,!0))return x.A(k),!0;k.n(e,g);c.Fb(k);if(this.ok(k,!0))return x.A(k),!0;k.n(d,h);c.Fb(k);if(this.ok(k,!0))return x.A(k),!0;k.n(e,h);c.Fb(k);if(this.ok(k,!0))return x.A(k),!0;var l=x.P(),m=x.P();c.set(b);c.MA(this.transform);c.wA();l.x=e;l.y=g;l.transform(c);k.x=d;k.y=
g;k.transform(c);var n=!1;zn(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),zn(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),zn(this,k,l,m)?n=!0:(k.x=d,k.y=g,k.transform(c),zn(this,k,l,m)&&(n=!0))));x.A(k);x.jf(c);x.A(l);x.A(m);return n};function zn(a,b,c,d){if(!a.Ql(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var g=d.x;d=d.y;if(a===e){var h=0;a=0;b<c?(h=b,a=c):(h=c,a=b);return d>=h&&d<=a}a<e?(h=a,a=e):h=e;return g>=h&&g<=a}
Y.prototype.QE=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.qp(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.ok(a,!0))return!0;var e=a.qk(b);b=e;1.5<this.yb&&(e=this.yb/2+Math.sqrt(e),e*=e);var g=this.bb;if(null===g&&(ji(this,Infinity,Infinity),g=this.bb,null===g))return!1;if(!c){var h=g.Cb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(tb(a.x,a.y,k,l)<=e&&tb(a.x,a.y,m,l)<=e&&tb(a.x,a.y,k,h)<=e&&tb(a.x,a.y,m,h)<=e)return!0}k=g.wc;l=g.Cc;m=g.Db;h=g.Ib;if(g.type===
yd){if(c=sb(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===zd)return b=!1,c&&(b=sb(a.x,a.y,k,l,k,h)<=e||sb(a.x,a.y,k,l,m,l)<=e||sb(a.x,a.y,m,l,m,h)<=e||sb(a.x,a.y,k,h,m,h)<=e),b;if(g.type===Ad){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=sb(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=Q.$H(n,p,b,g),a*a<=e)return!0}else return tb(b,g,-n,0)>=e||tb(b,g,0,-p)>=e||tb(b,g,0,p)>=e||tb(b,g,n,
0)>=e?!1:!0}else if(g.type===vd){h=g.Cb;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&&sb(a.x,a.y,k,l,k,h)>e&&sb(a.x,a.y,k,l,m,l)>e&&sb(a.x,a.y,m,h,k,h)>e&&sb(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?fe(g,a.x,a.y,b):g.Na(a,b,!0))return!0}else{c=g.ec;for(b=0;b<c.count;b++){k=c.o[b];n=k.Ha;p=k.Da;if(a.qp(n,p)>e)return!1;l=k.Eb.o;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case Nd:case Cd:n=q.M;p=q.N;if(a.qp(n,p)>e)return!1;break;case Od:g=
x.ub();Q.xe(n,p,q.zc,q.Qc,q.Dh,q.Eh,q.M,q.N,.8,g);n=d(g,a);x.xa(g);if(n)return!1;n=q.M;p=q.N;if(a.qp(n,p)>e)return!1;break;case Pd:g=x.ub();Q.Wp(n,p,q.zc,q.Qc,q.M,q.N,.8,g);n=d(g,a);x.xa(g);if(n)return!1;n=q.M;p=q.N;if(a.qp(n,p)>e)return!1;break;case Qd:case Rd:var r=q.type===Qd?Sd(q,k):de(q,k,n,p),s=r.length;if(0===s){n=q.sa;p=q.Aa;if(a.qp(n,p)>e)return!1;break}q=null;g=x.ub();for(b=0;b<s;b++)if(q=r[b],g.length=0,Q.xe(q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],.8,g),d(g,a))return x.xa(g),!1;x.xa(g);
null!==q&&(n=q[6],p=q[7]);break;default:x.k("Unknown Segment type: "+q.type)}}}return!0}}}return!1};x.defineProperty(Y,{xp:"geometry"},function(){return this.Tk?this.Tk:this.bb},function(a){var b=this.bb;if(b!==a){null!==a?(u&&x.l(a,ud,Y,"geometry"),this.Tk=this.bb=a.freeze()):this.Tk=this.bb=null;var c=this.ea;null!==c&&(c.Sj=NaN);this.ih=!0;this.T();this.j("geometry",b,a);a=this.ea;null!==a&&0!==(this.ka&1024)&&Gl(this,a,"geometryString")}});
x.defineProperty(Y,{uI:"geometryString"},function(){return null===this.xp?"":this.xp.toString()},function(a){var b=Hd(a);a=b.normalize();this.xp=b;var b=x.P(),c=this.position;c.G()?b.n(c.x-a.x,c.y-a.y):b.n(-a.x,-a.y);this.position=b;x.A(b)});x.defineProperty(Y,{kF:"isGeometryPositioned"},function(){return this.kr},function(a){u&&x.g(a,"boolean",Y,"isGeometryPositioned");var b=this.kr;b!==a&&(this.kr=a,this.T(),this.j("isGeometryPositioned",b,a))});
Y.prototype.nf=function(){this.ih?this.Tk=null:this.bb=null;this.T()};x.defineProperty(Y,{fill:"fill"},function(){return this.Cd},function(a){var b=this.Cd;b!==a&&(u&&null!==a&&x.lt(a,"Shape.fill"),a instanceof Ea&&a.freeze(),this.Cd=a,this.ua(),this.j("fill",b,a))});x.defineProperty(Y,{stroke:"stroke"},function(){return this.Jc},function(a){var b=this.Jc;b!==a&&(u&&null!==a&&x.lt(a,"Shape.stroke"),a instanceof Ea&&a.freeze(),this.Jc=a,this.ua(),this.j("stroke",b,a))});
x.defineProperty(Y,{yb:"strokeWidth"},function(){return this.ve},function(a){var b=this.ve;if(b!==a)if(u&&x.p(a,Y,"strokeWidth"),0<=a){this.ve=a;this.T();var c=this.ea;null!==c&&(c.Sj=NaN);this.j("strokeWidth",b,a)}else x.la(a,"value >= 0",Y,"strokeWidth:value")});
x.defineProperty(Y,{mM:"strokeCap"},function(){return this.Zo},function(a){var b=this.Zo;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?x.la(a,'"butt", "round", or "square"',Y,"strokeCap"):(this.Zo=a,this.ua(),this.j("strokeCap",b,a)))});
x.defineProperty(Y,{oM:"strokeJoin"},function(){return this.ap},function(a){var b=this.ap;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?x.la(a,'"miter", "bevel", or "round"',Y,"strokeJoin"):(this.ap=a,this.ua(),this.j("strokeJoin",b,a)))});
x.defineProperty(Y,{pM:"strokeMiterLimit"},function(){return this.Sm},function(a){var b=this.Sm;if(b!==a)if(u&&x.p(a,Y,"strokeMiterLimit"),1<=a){this.Sm=a;this.ua();var c=this.ea;null!==c&&(c.Sj=NaN);this.j("strokeMiterLimit",b,a)}else x.la(a,"value >= 1",Y,"strokeWidth:value")});
x.defineProperty(Y,{mG:"strokeDashArray"},function(){return this.$o},function(a){var b=this.$o;if(b!==a){null===a||Array.isArray(a)||x.jc(a,"Array",Y,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||x.k("strokeDashArray:value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.$o=a;this.ua();this.j("strokeDashArray",b,a)}});
x.defineProperty(Y,{nM:"strokeDashOffset"},function(){return this.vd},function(a){var b=this.vd;b!==a&&(u&&x.p(a,Y,"strokeDashOffset"),0<=a&&(this.vd=a,this.ua(),this.j("strokeDashOffset",b,a)))});
x.defineProperty(Y,{Jb:"figure"},function(){return this.oo},function(a){var b=this.oo;if(b!==a){u&&x.g(a,"string",Y,"figure");var c=Q.Gg[a];"function"===typeof c?c=a:(c=Q.Gg[a.toLowerCase()])||x.k("Unknown Shape.figure: "+a);b!==c&&(a=this.ea,null!==a&&(a.Sj=NaN),this.oo=c,this.ih=!1,this.nf(),this.j("figure",b,c))}});
x.defineProperty(Y,{kq:"toArrow"},function(){return this.bp},function(a){var b=this.bp;!0===a?a="Standard":!1===a&&(a="");if(b!==a){u&&x.g(a,"string",Y,"toArrow");var c=Q.kE(a);null===c?x.k("Unknown Shape.toArrow: "+a):b!==c&&(this.bp=c,this.ih=!1,this.nf(),An(this),this.j("toArrow",b,c))}});
x.defineProperty(Y,{oA:"fromArrow"},function(){return this.so},function(a){var b=this.so;!0===a?a="Standard":!1===a&&(a="");if(b!==a){u&&x.g(a,"string",Y,"fromArrow");var c=Q.kE(a);null===c?x.k("Unknown Shape.fromArrow: "+a):b!==c&&(this.so=c,this.ih=!1,this.nf(),An(this),this.j("fromArrow",b,c))}});function An(a){var b=a.h;null!==b&&b.qa.tb||(a.qu=Bn,"None"!==a.bp?(a.Ce=-1,a.mk=Tc):"None"!==a.so&&(a.Ce=0,a.mk=new R(1-Tc.x,Tc.y)))}
x.defineProperty(Y,{C:"spot1"},function(){return this.Wi},function(a){x.l(a,R,Y,"spot1");var b=this.Wi;b.O(a)||(this.Wi=a=a.Y(),this.T(),this.j("spot1",b,a))});x.defineProperty(Y,{D:"spot2"},function(){return this.Xi},function(a){x.l(a,R,Y,"spot2");var b=this.Xi;b.O(a)||(this.Xi=a=a.Y(),this.T(),this.j("spot2",b,a))});x.defineProperty(Y,{Hc:"parameter1"},function(){return this.as},function(a){var b=this.as;b!==a&&(this.as=a,this.nf(),this.j("parameter1",b,a))});
x.defineProperty(Y,{gu:"parameter2"},function(){return this.bs},function(a){var b=this.bs;b!==a&&(this.bs=a,this.nf(),this.j("parameter2",b,a))});x.w(Y,{Ga:"naturalBounds"},function(){if(null!==this.bb)return this.Wc.assign(this.bb.Cb),this.Wc;var a=this.Ba;return new w(0,0,a.width,a.height)});x.defineProperty(Y,{Jx:"pathPattern"},function(){return this.ds},function(a){var b=this.ds;b!==a&&(u&&x.l(a,O,Y,"pathPattern"),this.ds=a,this.ua(),this.j("pathPattern",b,a))});
x.defineProperty(Y,{bM:"pathObject"},function(){return this.Jx},function(a){this.Jx=a});x.defineProperty(Y,{pA:"geometryStretch"},function(){return this.dr},function(a){var b=this.dr;b!==a&&(x.Ca(a,O,Y,"geometryStretch"),this.dr=a,this.j("geometryStretch",b,a))});x.defineProperty(Y,{interval:"interval"},function(){return this.hr},function(a){var b=this.hr;u&&x.p(a,Y,"interval");a=Math.floor(a);b!==a&&0<=a&&(this.hr=a,null!==this.h&&Sj(this.h),this.T(),this.j("interval",b,a))});
Y.getFigureGenerators=function(){var a=new ra("string","function"),b;for(b in Q.Gg)if(b!==b.toLowerCase()){var c=Q.Gg[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};
Y.defineFigureGenerator=function(a,b){x.g(a,"string",Y,"defineFigureGenerator:name");"string"===typeof b?""!==b&&Q.Gg[b]||x.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):x.g(b,"function",Y,"defineFigureGenerator:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||x.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);var d=Q.Gg;d[a]=b;d[c]=a};
Y.getArrowheadGeometries=function(){var a=new ra("string",ud),b;for(b in Q.yj)if(b!==b.toLowerCase()){var c=Q.yj[b];c instanceof ud&&a.add(b,c)}a.freeze();return a};
Y.defineArrowheadGeometry=function(a,b){x.g(a,"string",Y,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(x.g(b,"string",Y,"defineArrowheadGeometry:pathstr"),c=Hd(b,!1)):(x.l(b,ud,Y,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||x.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var e=Q.yj;e[a]=c;e[d]=a};
function sa(){O.call(this);this.we="";this.Jc="black";this.Wg="13px sans-serif";this.Kd="start";this.mr=!0;this.tm=this.um=!1;this.pl=Cn;this.Xm=Dn;this.Nv=this.Ne=0;this.ro=this.sz=this.uz=null;this.Pj=new En;this.Yq=!1;this.vf=this.rl=this.Ps=null;this.dk=this.ck=0;this.Mi=Infinity;this.Iv=0}x.Qa(sa,O);x.ja("TextBlock",sa);var Fn=new pa,Gn=0,Hn=new pa,In=0,Jn="...",Kn="",Ln=x.createElement("canvas").getContext("2d");sa.getEllipsis=function(){return Jn};
sa.setEllipsis=function(a){Jn=a;Hn=new pa;In=0};sa.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.we=this.we;a.Jc=this.Jc;a.Wg=this.Wg;a.Kd=this.Kd;a.mr=this.mr;a.um=this.um;a.tm=this.tm;a.pl=this.pl;a.Xm=this.Xm;a.Ne=this.Ne;a.Nv=this.Nv;a.uz=this.uz;a.sz=this.sz;a.ro=this.ro;a.Pj.qt(this.Pj);a.Yq=this.Yq;a.Ps=this.Ps;a.rl=this.rl;a.vf=this.vf;a.ck=this.ck;a.dk=this.dk;a.Mi=this.Mi;a.Iv=this.Iv};
sa.prototype.toString=function(){return 22<this.we.length?'TextBlock("'+this.we.substring(0,20)+'"...)':'TextBlock("'+this.we+'")'};var Mn;sa.None=Mn=x.s(sa,"None",0);var Nn;sa.WrapFit=Nn=x.s(sa,"WrapFit",1);var Dn;sa.WrapDesiredSize=Dn=x.s(sa,"WrapDesiredSize",2);var Cn;sa.OverflowClip=Cn=x.s(sa,"OverflowClip",0);var On;sa.OverflowEllipsis=On=x.s(sa,"OverflowEllipsis",1);sa.prototype.T=function(){O.prototype.T.call(this);this.sz=this.uz=null};
x.defineProperty(sa,{font:"font"},function(){return this.Wg},function(a){var b=this.Wg;b!==a&&(u&&(x.g(a,"string",sa,"font"),Pn(a)||x.k('Not a valid font: "'+a+'"')),this.Wg=a,this.ro=null,this.T(),this.j("font",b,a))});var Pn;sa.isValidFont=Pn=function(a){var b=Ln.font;if(a===b||"10px sans-serif"===a)return!0;Ln.font="10px sans-serif";var c;Ln.font=a;var d=Ln.font;if("10px sans-serif"!==d)return Ln.font=b,!0;Ln.font="19px serif";c=Ln.font;Ln.font=a;d=Ln.font;Ln.font=b;return d!==c};
x.defineProperty(sa,{text:"text"},function(){return this.we},function(a){var b=this.we;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.we=a,this.T(),this.j("text",b,a))});x.defineProperty(sa,{textAlign:"textAlign"},function(){return this.Kd},function(a){var b=this.Kd;b!==a&&(u&&x.g(a,"string",sa,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Kd=a,this.ua(),this.j("textAlign",b,a)):x.la(a,'"start", "end", "left", "right", or "center"',sa,"textAlign"))});
x.w(sa,{Ga:"naturalBounds"},function(){if(!this.Wc.G()){var a=Qn(this,this.we,this.Pj,999999).width,b=Rn(this,a,this.Pj),c=this.Ba;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);vb(this.Wc,a,b)}return this.Wc});x.defineProperty(sa,{xx:"isMultiline"},function(){return this.mr},function(a){var b=this.mr;b!==a&&(u&&x.g(a,"boolean",sa,"isMultiline"),this.mr=a,this.T(),this.j("isMultiline",b,a))});
x.defineProperty(sa,{xL:"isUnderline"},function(){return this.um},function(a){var b=this.um;b!==a&&(u&&x.g(a,"boolean",sa,"isUnderline"),this.um=a,this.ua(),this.j("isUnderline",b,a))});x.defineProperty(sa,{vL:"isStrikethrough"},function(){return this.tm},function(a){var b=this.tm;b!==a&&(u&&x.g(a,"boolean",sa,"isStrikethrough"),this.tm=a,this.ua(),this.j("isStrikethrough",b,a))});
x.defineProperty(sa,{FG:"wrap"},function(){return this.Xm},function(a){var b=this.Xm;b!==a&&(u&&x.Ca(a,sa,sa,"wrap"),this.Xm=a,this.T(),this.j("wrap",b,a))});x.defineProperty(sa,{overflow:"overflow"},function(){return this.pl},function(a){var b=this.pl;b!==a&&(u&&x.Ca(a,sa,sa,"overflow"),this.pl=a,this.T(),this.j("overflow",b,a))});
x.defineProperty(sa,{stroke:"stroke"},function(){return this.Jc},function(a){var b=this.Jc;b!==a&&(u&&null!==a&&x.lt(a,"TextBlock.stroke"),a instanceof Ea&&a.freeze(),this.Jc=a,this.ua(),this.j("stroke",b,a))});x.w(sa,{dJ:"lineCount"},function(){return this.Ne});x.defineProperty(sa,{kA:"editable"},function(){return this.Yq},function(a){var b=this.Yq;b!==a&&(u&&x.g(a,"boolean",sa,"editable"),this.Yq=a,this.j("editable",b,a))});
x.defineProperty(sa,{oG:"textEditor"},function(){return this.Ps},function(a){var b=this.Ps;b!==a&&(a instanceof HTMLElement||x.k("textEditor must be an HTMLElement, not: "+a),this.Ps=a,this.j("textEditor",b,a))});x.defineProperty(sa,{lA:"errorFunction"},function(){return this.vf},function(a){var b=this.vf;b!==a&&(null!==a&&x.g(a,"function",sa,"errorFunction"),this.vf=a,this.j("errorFunction",b,a))});function Sl(a,b){var c=a.Wg;null!==c&&b.Hu!==c&&(b.font=c,b.Hu=c)}
sa.prototype.rk=function(a,b){if(null!==this.Jc&&0!==this.we.length&&null!==this.Wg){var c=this.Ga.width,d=Sn(this);a.textAlign=this.Kd;Vl(this,a,this.Jc,!0,!1);(this.um||this.tm)&&Vl(this,a,this.Jc,!1,!1);var e=this.Pj,g=0,h=!1,k=x.Xb(0,0);this.mh.Fb(k);var l=x.Xb(0,d);this.mh.Fb(l);var m=k.qk(l);x.A(k);x.A(l);k=b.scale;8>m*k*k&&(h=!0);b.Ze!==a&&(h=!1);!1===b.vk("textGreeking")&&(h=!1);for(var m=this.ck,k=this.dk,l=this.Ne,n=0;n<l;n++){var p=e.tf[n],q=e.Je[n];p>c&&(p=c);var g=g+m,r=q,q=a,s=g,t=c,
v=d,y=0;h?("start"===this.Kd||"left"===this.Kd?y=0:"end"===this.Kd||"right"===this.Kd?y=t-p:"center"===this.Kd?y=(t-p)/2:x.k("textAlign must be start, end, left, right, or center: "+this.Kd),q.fillRect(0+y,s+.25*v,p,1)):("start"===this.Kd||"left"===this.Kd?y=0:"end"===this.Kd||"right"===this.Kd?y=t:"center"===this.Kd?y=t/2:x.k("textAlign must be start, end, left, right, or center: "+this.Kd),q.fillText(r,0+y,s+v-.25*v),r=v/20|0,0===r&&(r=1),"end"===this.Kd||"right"===this.Kd?y-=p:"center"===this.Kd&&
(y-=p/2),this.um&&(q.beginPath(),q.lineWidth=r,q.moveTo(0+y,s+v-.2*v),q.lineTo(0+y+p,s+v-.2*v),q.stroke()),this.tm&&(q.beginPath(),q.lineWidth=r,s=s+v-v/2.2|0,0!==r%2&&(s+=.5),q.moveTo(0+y,s),q.lineTo(0+y+p,s),q.stroke()));g+=d+k}}};
sa.prototype.Np=function(a,b,c,d){this.Iv=a;var e=this.Pj;e.reset();var g=0,h=0;if(isNaN(this.Ba.width)){g=this.we.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.xx){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Tn(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Wg);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Tn(g,this.Wg);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Ba.width;null!==this.V&&(g=Math.min(g,
this.V.Ae.width),g=Math.max(g,this.V.Kf.width));h=Rn(this,g,e);m=h=isNaN(this.Ba.height)?Math.min(h,b/this.scale):this.Ba.height;if(0!==e.cf&&1!==e.Je.length&&this.pl===On&&(b=this.Wg,l=this.pl===On?Un(b):0,k=this.ck+this.dk,k=Math.max(0,Sn(this)+k),m=Math.min(this.lJ-1,Math.max(Math.floor(m/k)-1,0)),!(m+1>=e.Je.length))){k=e.Je[m];for(a=Math.max(1,a-l);Tn(k,b)>a&&1<k.length;)k=k.substr(0,k.length-1);k+=Jn;a=Tn(k,b);e.Je[m]=k;e.Je=e.Je.slice(0,m+1);e.tf[m]=a;e.tf=e.tf.slice(0,m+1);e.aj=e.Je.length;
e.cf=Math.max(e.cf,a);this.Ne=e.aj}if(this.FG===Nn||isNaN(this.Ba.width))g=e.cf,isNaN(this.Ba.width)&&(g=Math.max(8,g));g=Math.max(c,g);h=Math.max(d,h);vb(this.Wc,g,h);Hl(this,0,0,g,h)};sa.prototype.bj=function(a,b,c,d){Ll(this,a,b,c,d)};
function Qn(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,g=0,h=0,k=a.Wg,g=a.ck+a.dk,l=Math.max(0,Sn(a)+g),h=a.pl===On?Un(k):0;if(a.Ne>=a.Mi)return new Fa(0,l);if(a.Xm===Mn){c.aj=1;g=Tn(b,k);if(0===h||g<=d)return c.cf=g,c.tf.push(c.cf),c.Je.push(b),new Fa(g,l);var m=Vn(b);b=b.substr(m.length);for(var n=Vn(b),g=Tn(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Vn(b),g=Tn((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);Tn(m,k)>d&&1<m.length;)m=m.substr(0,
m.length-1);m+=Jn;h=Tn(m,k);c.tf.push(h);c.cf=h;c.Je.push(m);return new Fa(h,l)}var p=0;0===b.length&&(p=1,c.tf.push(0),c.Je.push(b));for(;0<b.length;){m=Vn(b);for(b=b.substr(m.length);Tn(m,k)>d;){n=1;g=Tn(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Tn(m.substr(0,n),k);1===n?(c.tf[a.Ne+p]=g,e=Math.max(e,g)):(c.tf[a.Ne+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Je[a.Ne+p]=m.substr(0,n);p++;m=m.substr(n);if(a.Ne+p>a.Mi)break}n=Vn(b);for(g=Tn(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Vn(b),g=Tn((m+
n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&(0===n.length?(c.tf.push(g),e=Math.max(e,g)):(h=Tn(m,k),c.tf.push(h),e=Math.max(e,h)),c.Je.push(m),p++,a.Ne+p>a.Mi))break}c.aj=Math.min(a.Mi,p);c.cf=Math.max(c.cf,e);return new Fa(c.cf,l*c.aj)}function Vn(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 Tn(a,b){Kn!==b&&(Kn=Ln.font=b);return Ln.measureText(a).width}
function Sn(a){if(null!==a.ro)return a.ro;var b=a.Wg;Kn!==b&&(Kn=Ln.font=b);var c=0;void 0!==Fn[b]&&5E3>Gn?c=Fn[b]:(c=1.3*Ln.measureText("M").width,Fn[b]=c,Gn++);return a.ro=c}function Un(a){Kn!==a&&(Kn=Ln.font=a);var b=0;void 0!==Hn[a]&&5E3>In?b=Hn[a]:(b=Ln.measureText(Jn).width,Hn[a]=b,In++);return b}
function Rn(a,b,c){var d=a.we.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.ck+a.dk,e=Math.max(0,Sn(a)+e);if(0===d.length)return c.cf=0,a.Ne=1,e;if(!a.xx){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=0,h=a.Ne=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.Xm!==Mn?(c.aj=0,h=Qn(a,h,c,b),g+=h.height,a.Ne+=c.aj):(Qn(a,h,c,b),g+=e,a.Ne++),a.Ne===a.Mi&&(l=!0)),h=k+1;return a.Nv=g}
x.defineProperty(sa,{oB:"textValidation"},function(){return this.rl},function(a){var b=this.rl;b!==a&&(null!==a&&x.g(a,"function",sa,"textValidation"),this.rl=a,this.j("textValidation",b,a))});x.defineProperty(sa,{jM:"spacingAbove"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(u&&x.g(a,"number",sa,"spacingAbove"),this.ck=a,this.j("spacingAbove",b,a))});
x.defineProperty(sa,{kM:"spacingBelow"},function(){return this.dk},function(a){var b=this.dk;b!==a&&(u&&x.g(a,"number",sa,"spacingBelow"),this.dk=a,this.j("spacingBelow",b,a))});x.defineProperty(sa,{lJ:"maxLines"},function(){return this.Mi},function(a){var b=this.Mi;b!==a&&(u&&x.g(a,"number",sa,"maxLines"),a=Math.floor(a),0>=a&&x.la(a,"> 0",sa,"maxLines"),this.Mi=a,this.j("maxLines",b,a),this.T())});x.w(sa,{JL:"metrics"},function(){return this.Pj});
function En(){this.cf=this.aj=0;this.tf=[];this.Je=[]}En.prototype.reset=function(){this.cf=this.aj=0;this.tf=[];this.Je=[]};En.prototype.qt=function(a){this.aj=a.aj;this.cf=a.cf;this.tf=x.Cl(a.tf);this.Je=x.Cl(a.Je)};x.w(En,{NK:"arrSize"},function(){return this.tf});x.w(En,{OK:"arrText"},function(){return this.Je});x.w(En,{IL:"maxLineWidth"},function(){return this.cf});
function pj(){O.call(this);this.$e=null;this.Js="";this.bk=Q.LG;this.uo=xd;this.Os=this.ek=this.vf=null;this.jz=!1;this.po=!0;this.Uo=null}x.Qa(pj,O);x.ja("Picture",pj);pj.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.$e;a.Js=this.Js;a.bk=this.bk.Y();a.uo=this.uo;a.vf=this.vf;a.ek=this.ek;a.po=this.po;a.Uo=this.Uo};var Wn=new pa,Xn=0,jj=[];
function Yn(){var a=jj;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.W&&a.push(e.parentElement.W)}return a}var Zn;pj.clearCache=Zn=function(a){void 0===a&&(a="");x.g(a,"string",pj,"clearCache:url");""!==a?Wn[a]&&(delete Wn[a],Xn--):(Wn=new pa,Xn=0)};pj.prototype.toString=function(){return"Picture("+this.source+")#"+x.od(this)};
x.defineProperty(pj,{element:"element"},function(){return this.$e},function(a){var b=this.$e;b!==a&&(null===a||a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||x.k("Picture.element must be an instance of Image, Canvas, or Video, not: "+a),this.jz=a instanceof HTMLCanvasElement,this.$e=a,null!==a&&(!0===a.complete||void 0===a.complete?(a.uv instanceof Event&&null!==this.vf&&this.vf(this,a.uv),!0===a.lz&&null!==this.ek&&this.ek(this,null),a.lz=!0,this.Ba.G()||
(Rj(this,!1),this.T())):a.AC||(a.addEventListener("load",function(b){$n(a,b)}),a.addEventListener("error",function(b){ao(a,b)}),a.AC=!0)),this.j("element",b,a),this.ua())});
x.defineProperty(pj,{source:"source"},function(){return this.Js},function(a){var b=this.Js;if(b!==a){x.g(a,"string",pj,"source");this.Js=a;var c=Wn,d=this.h;if(void 0!==c[a])var e=c[a].fp[0].source;else{30<Xn&&(Zn(),c=Wn);e=x.createElement("img");e.addEventListener("load",function(a){$n(e,a)});e.addEventListener("error",function(a){ao(e,a)});e.AC=!0;e.src=a;var g=this.Uo;null!==g&&(e.crossOrigin=g(this));c[a]=new bo(e);Xn++}null!==d&&Sk(d,this);this.element=e;null!==d&&Rk(d,this);this.ua();this.j("source",
b,a)}});function $n(a,b){a.lz=!0;a.uv=!1;for(var c=null,d=Yn(),e=d.length,g=0;g<e;g++){var h=d[g],k=h.Oo.oa(a.src);if(null!==k){e=k.length;for(g=0;g<e;g++)c=k[g],c.Ba.G()||(h.lD.add(c),h.Be()),null!==c.ek&&c.ek(c,b);h.ua()}}}function ao(a,b){a.uv=b;for(var c=null,d=Yn(),e=d.length,g=0;g<e;g++)if(c=d[g].Oo.oa(a.src),null!==c){for(var e=c.length,h=x.ub(),g=0;g<e;g++)h.push(c[g]);for(g=0;g<e;g++)c=h[g],null!==c.vf&&c.vf(c,b);x.xa(h)}}
x.defineProperty(pj,{iM:"sourceCrossOrigin"},function(){return this.Uo},function(a){if(this.Uo!==a&&(null!==a&&x.g(a,"function",pj,"sourceCrossOrigin"),this.Uo=a,null!==this.element)){var b=this.element.src;null===a&&"string"===typeof b?this.element.crossOrigin=null:null!==a&&(this.element.crossOrigin=a(this))}});x.defineProperty(pj,{tj:"sourceRect"},function(){return this.bk},function(a){var b=this.bk;b.O(a)||(x.l(a,w,pj,"sourceRect"),this.bk=a=a.Y(),this.ua(),this.j("sourceRect",b,a))});
x.defineProperty(pj,{GI:"imageStretch"},function(){return this.uo},function(a){var b=this.uo;b!==a&&(x.Ca(a,O,pj,"imageStretch"),this.uo=a,this.ua(),this.j("imageStretch",b,a))});x.defineProperty(pj,{lA:"errorFunction"},function(){return this.vf},function(a){var b=this.vf;b!==a&&(null!==a&&x.g(a,"function",pj,"errorFunction"),this.vf=a,this.j("errorFunction",b,a))});
x.defineProperty(pj,{sM:"successFunction"},function(){return this.ek},function(a){var b=this.ek;b!==a&&(null!==a&&x.g(a,"function",pj,"successFunction"),this.ek=a,this.j("successFunction",b,a))});
pj.prototype.rk=function(a,b){var c=this.$e;if(null!==c){var d=c.src;null!==d&&""!==d||x.k('Element has no source ("src") attribute: '+c);if(!(c.uv instanceof Event)&&!0===c.lz){var d=this.Ga,e=0,g=0,h=this.jz,k=h?+c.width:c.naturalWidth,h=h?+c.height:c.naturalHeight;void 0===k&&c.videoWidth&&(k=c.videoWidth);void 0===h&&c.videoHeight&&(h=c.videoHeight);k=k||d.width;h=h||d.height;if(0!==k&&0!==h){var l=k,m=h;this.tj.G()&&(e=this.bk.x,g=this.bk.y,k=this.bk.width,h=this.bk.height);var n=k,p=h,q=this.uo;
switch(q){case Hh:if(this.tj.G())break;e+=Math.max((n-d.width)/2,0);g+=Math.max((p-d.height)/2,0);k=Math.min(d.width,n);h=Math.min(d.height,p);break;case xd:n=d.width;p=d.height;break;case Jh:case Kh:var r=0;q===Jh?(r=Math.min(d.height/p,d.width/n),n*=r,p*=r):q===Kh&&(r=Math.max(d.height/p,d.width/n),n*=r,p*=r,e+=(n-d.width)/2,g+=(p-d.height)/2,k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}var q=this.jj()*b.scale,s=k*h/(n*q*p*q),r=Wn[this.source],q=null;if(void 0!==r&&16<s){2>r.fp.length&&
(co(r,4,l,m),co(r,16,l,m));for(var l=r.fp,m=l.length,q=l[0],t=0;t<m;t++)if(l[t].Xp*l[t].Xp<s)q=l[t];else break}if(!b.lo){if(null===this.Os)if(null===this.$e)this.Os=!1;else{l=x.createElement("canvas").getContext("2d");l.drawImage(this.$e,0,0);try{l.getImageData(0,0,1,1),this.Os=!1}catch(v){this.Os=!0}}if(this.Os)return}if(b.vk("pictureRatioOptimization")&&!b.kz&&void 0!==r&&null!==q&&1!==q.Xp){a.save();r=q.Xp;try{a.drawImage(q.source,e/r,g/r,Math.min(q.source.width,k/r),Math.min(q.source.height,h/
r),Math.max((d.width-n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(y){u&&this.po&&x.trace(y.toString()),this.po=!1}a.restore()}else try{a.drawImage(c,e,g,k,h,Math.max((d.width-n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(A){u&&this.po&&x.trace(A.toString()),this.po=!1}}}}};x.w(pj,{Ga:"naturalBounds"},function(){return this.Wc});
pj.prototype.Np=function(a,b,c,d){var e=this.Ba,g=Kl(this,!0),h=this.$e,k=this.jz;if(k||!this.rz&&h&&h.complete)this.rz=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||g===xd||g===Al?(isFinite(a)||(a=this.tj.G()?this.tj.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.rz&&(a=this.tj.G()?this.tj.width:k?+h.width:h.naturalWidth);isFinite(e.height)||g===xd||g===zl?(isFinite(b)||(b=this.tj.G()?this.tj.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.rz&&(b=
this.tj.G()?this.tj.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.Ae;g=this.Kf;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));vb(this.Wc,a,b);Hl(this,0,0,a,b)};pj.prototype.bj=function(a,b,c,d){Ll(this,a,b,c,d)};function bo(a){this.fp=[new eo(a,1)]}
function co(a,b,c,d){var e=new ma(null),g=e.getContext("2d"),h=1/b;e.width=c/b;e.height=d/b;b=new eo(e.Zd,b);c=a.fp[a.fp.length-1];g.setTransform(h*c.Xp,0,0,h*c.Xp,0,0);g.drawImage(c.source,0,0);a.fp.push(b)}function eo(a,b){this.source=a;this.Xp=b}function Ia(){this.q=new ud;this.bc=null}f=Ia.prototype;f.reset=function(){this.q=new ud;this.bc=null};
function S(a,b,c,d,e,g){null===a.q&&x.k("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.bc&&x.k("Need to call beginFigure first"),d=new ge(Nd),d.M=b,d.N=c,a.bc.Eb.add(d)):(a.bc=new wd,a.bc.Ha=b,a.bc.Da=c,a.bc.Mt=d,a.q.ec.add(a.bc));void 0!==g&&(a.bc.Ao=g)}function U(a){null===a.q&&x.k("StreamGeometryContext has been closed");null===a.bc&&x.k("Need to call beginFigure first");var b=a.bc.Eb.length;0<b&&a.bc.Eb.ia(b-1).close()}
function Kd(a){null===a.q&&x.k("StreamGeometryContext has been closed");null===a.bc&&x.k("Need to call beginFigure first");0<a.bc.Eb.length&&(a.bc.Mt=!0)}f.hb=function(a){null===this.q&&x.k("StreamGeometryContext has been closed");null===this.bc&&x.k("Need to call beginFigure first");this.bc.xk=a};f.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&x.k("StreamGeometryContext has been closed");null===this.bc&&x.k("Need to call beginFigure first");var d=new ge(Nd);d.M=a;d.N=b;c&&d.close();this.bc.Eb.add(d)};
f.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&x.k("StreamGeometryContext has been closed");null===this.bc&&x.k("Need to call beginFigure first");var d=new ge(Cd);d.M=a;d.N=b;c&&d.close();this.bc.Eb.add(d)};function T(a,b,c,d,e,g,h,k){void 0===k&&(k=!1);null===a.q&&x.k("StreamGeometryContext has been closed");null===a.bc&&x.k("Need to call beginFigure first");var l=new ge(Od);l.zc=b;l.Qc=c;l.Dh=d;l.Eh=e;l.M=g;l.N=h;k&&l.close();a.bc.Eb.add(l)}
function Id(a,b,c,d,e){var g;void 0===g&&(g=!1);null===a.q&&x.k("StreamGeometryContext has been closed");null===a.bc&&x.k("Need to call beginFigure first");var h=new ge(Pd);h.zc=b;h.Qc=c;h.M=d;h.N=e;g&&h.close();a.bc.Eb.add(h)}f.arcTo=function(a,b,c,d,e,g,h){void 0===g&&(g=0);void 0===h&&(h=!1);null===this.q&&x.k("StreamGeometryContext has been closed");null===this.bc&&x.k("Need to call beginFigure first");var k=new ge(Qd);k.De=a;k.Nf=b;k.sa=c;k.Aa=d;k.radiusX=e;k.radiusY=0!==g?g:e;h&&k.close();this.bc.Eb.add(k)};
function Jd(a,b,c,d,e,g,h,k){var l;void 0===l&&(l=!1);null===a.q&&x.k("StreamGeometryContext has been closed");null===a.bc&&x.k("Need to call beginFigure first");b=new ge(Rd,h,k,b,c,d,e,g);l&&b.close();a.bc.Eb.add(b)}
Q.makeGeometry=function(a,b,c){var d=a.Ba,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);b=null;"None"!==a.kq?b=Q.yj[a.kq]:"None"!==a.oA?b=Q.yj[a.oA]:(c=Q.Gg[a.Jb],"string"===typeof c&&(c=Q.Gg[c]),void 0===c&&x.k("Unknown Shape.figure: "+a.Jb),b=c(a,e,d),b.zo=e,b.xo=d);null===b&&(c=Q.Gg.Rectangle,"function"===typeof c&&(b=c(a,e,d)));return b};
Q.ej=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};Q.np=function(a){a=Q.jn(a);var b=x.ub();b[0]=a[0];for(var c=1,d=1;d<a.length;)b[c]=a[d],b[c+1]=a[d],b[c+2]=a[d+1],d+=2,c+=3;x.xa(a);return b};
Q.jn=function(a){var b=Q.Dl(a),c=x.ub(),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]=Q.Pl(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new N)}c[c.length]=c[0];x.xa(b);return c};Q.Pl=function(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.n(h,n);return l};
Q.Dl=function(a){for(var b=x.ub(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new N(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b};Q.CB=(new R(.156,.156)).Ma();Q.DB=(new R(.844,.844)).Ma();
Q.Gg={None:"Rectangle",Rectangle:function(a,b,c){a=new ud;a.type=zd;a.Ha=0;a.Da=0;a.M=b;a.N=c;return a},Square:function(a,b,c){a=new ud;a.Xd=Jh;a.type=zd;a.Ha=0;a.Da=0;a.M=Math.min(b,c);a.N=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new ud;a.type=Ad;a.Ha=0;a.Da=0;a.M=b;a.N=c;a.C=Q.CB;a.D=Q.DB;return a},Circle:function(a,b,c){a=new ud;a.Xd=Jh;a.type=Ad;a.Ha=0;a.Da=0;a.M=Math.min(b,c);a.N=Math.min(b,c);a.C=Q.CB;a.D=Q.DB;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new ud;var d=
new wd,e=new ge;e.M=b;e.N=.5*c;d.Eb.add(e);b=new ge;b.M=0;b.N=c;d.Eb.add(b.close());a.ec.add(d);a.C=new R(0,.25);a.D=new R(.5,.75);return a},TriangleDown:function(a,b,c){a=new ud;var d=new wd,e=new ge;e.M=b;e.N=0;d.Eb.add(e);e=new ge;e.M=.5*b;e.N=c;d.Eb.add(e.close());a.ec.add(d);a.C=new R(.25,0);a.D=new R(.75,.5);return a},TriangleLeft:function(a,b,c){a=new ud;var d=new wd;d.Ha=b;d.Da=c;var e=new ge;e.M=0;e.N=.5*c;d.Eb.add(e);c=new ge;c.M=b;c.N=0;d.Eb.add(c.close());a.ec.add(d);a.C=new R(.5,.25);
a.D=new R(1,.75);return a},TriangleUp:function(a,b,c){a=new ud;var d=new wd;d.Ha=b;d.Da=c;var e=new ge;e.M=0;e.N=c;d.Eb.add(e);c=new ge;c.M=.5*b;c.N=0;d.Eb.add(c.close());a.ec.add(d);a.C=new R(.25,.5);a.D=new R(.75,1);return a},Line1:function(a,b,c){a=new ud;a.type=yd;a.Ha=0;a.Da=0;a.M=b;a.N=c;return a},Line2:function(a,b,c){a=new ud;a.type=yd;a.Ha=b;a.Da=0;a.M=0;a.N=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new ud;a.type=yd;a.Ha=0;a.Da=c/2;a.M=b;a.N=c/2;return a},LineV:function(a,b,c){a=
new ud;a.type=yd;a.Ha=b/2;a.Da=0;a.M=b/2;a.N=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){var d=Q.Ka;a=x.u();S(a,0,0,!1);T(a,d*b,0,1*b,(1-d)*c,b,c);b=a.q;x.v(a);return b},Curve2:function(a,b,c){var d=Q.Ka;a=x.u();S(a,0,0,!1);T(a,0,d*c,(1-d)*b,c,b,c);b=a.q;x.v(a);return b},Curve3:function(a,b,c){var d=Q.Ka;a=x.u();S(a,1*b,0,!1);T(a,1*b,d*c,d*b,1*c,0,1*c);b=a.q;x.v(a);return b},Curve4:function(a,b,c){var d=Q.Ka;a=x.u();S(a,1*b,0,!1);T(a,(1-d)*b,0,0,(1-d)*c,0,1*c);b=a.q;x.v(a);
return b},Alternative:"Triangle",Merge:"Triangle",Triangle:function(a,b,c){a=x.u();S(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,1);x.v(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(0,.5*c);a.lineTo(.5*b,1*c);a.lineTo(1*b,.5*c,!0);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);x.v(a);return b},Pentagon:function(a,b,c){var d=Q.Dl(5);a=x.u();S(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);
x.xa(d);U(a);b=a.q;b.C=new R(.2,.22);b.D=new R(.8,.9);x.v(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=Q.Dl(6);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.07,.25);b.D=new R(.93,.75);x.v(a);return b},Heptagon:function(a,b,c){var d=Q.Dl(7);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.2,.15);b.D=new R(.8,.85);x.v(a);return b},Octagon:function(a,
b,c){var d=Q.Dl(8);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.85);x.v(a);return b},Nonagon:function(a,b,c){var d=Q.Dl(9);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.17,.13);b.D=new R(.82,.82);x.v(a);return b},Decagon:function(a,b,c){var d=Q.Dl(10);a=x.u();S(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);x.xa(d);U(a);
b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);x.v(a);return b},Dodecagon:function(a,b,c){var d=Q.Dl(12);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.16,.16);b.D=new R(.84,.84);x.v(a);return b},FivePointedStar:function(a,b,c){var d=Q.jn(5);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);x.v(a);return b},SixPointedStar:function(a,b,c){var d=
Q.jn(6);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);x.v(a);return b},SevenPointedStar:function(a,b,c){var d=Q.jn(7);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);x.v(a);return b},EightPointedStar:function(a,b,c){var d=Q.jn(8);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);x.v(a);return b},NinePointedStar:function(a,b,c){var d=Q.jn(9);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);x.v(a);return b},TenPointedStar:function(a,b,c){var d=Q.jn(10);a=x.u();S(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);x.xa(d);U(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);x.v(a);return b},FivePointedBurst:function(a,
b,c){var d=Q.np(5);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.312,.383);b.D=new R(.693,.765);x.v(a);return b},SixPointedBurst:function(a,b,c){var d=Q.np(6);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.17,.251);b.D=new R(.833,.755);x.v(a);return b},SevenPointedBurst:function(a,
b,c){var d=Q.np(7);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.363,.361);b.D=new R(.641,.709);x.v(a);return b},EightPointedBurst:function(a,b,c){var d=Q.np(8);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.252,.255);b.D=new R(.75,.75);x.v(a);return b},NinePointedBurst:function(a,
b,c){var d=Q.np(9);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.355,.361);b.D=new R(.645,.651);x.v(a);return b},TenPointedBurst:function(a,b,c){var d=Q.np(10);a=x.u();S(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)T(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);x.xa(d);U(a);b=a.q;b.C=new R(.281,.261);b.D=new R(.723,.748);x.v(a);return b},Cloud:function(a,b,c){a=
x.u();S(a,.08034461*b,.1944299*c,!0);T(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*b,.05349299*c);T(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);T(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);T(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);T(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);T(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);T(a,1.032337*b,.5771781*c,1.018411*
b,.8120651*c,.9212406*b,.8217117*c);T(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*c);T(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);T(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);T(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);T(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);T(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);T(a,-.01606892*b,.3892545*c,-.01205169*
b,.1944299*c,.08034461*b,.1944299*c);U(a);b=a.q;b.C=new R(.1,.1);b.D=new R(.9,.9);x.v(a);return b},Gate:"Crescent",Crescent:function(a,b,c){a=x.u();S(a,0,0,!0);T(a,1*b,0,1*b,1*c,0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);U(a);b=a.q;b.C=new R(.511,.19);b.D=new R(.776,.76);x.v(a);return b},FramedRectangle:function(a,b,c){var d=x.u(),e=a?a.Hc:NaN;a=a?a.gu:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);S(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.q;b.C=new R(e,a);b.D=new R(1-e,1-a);x.v(d);return b},Delay:"HalfEllipse",HalfEllipse:function(a,b,c){var d=Q.Ka;a=x.u();S(a,0,0,!0);T(a,d*b,0,1*b,(.5-d/2)*c,1*b,.5*c);T(a,1*b,(.5+d/2)*c,d*b,1*c,0,1*c);U(a);b=a.q;b.C=new R(0,.2);b.D=new R(.75,.8);x.v(a);return b},Heart:function(a,b,c){a=x.u();S(a,.5*b,1*c,!0);T(a,.1*b,.8*c,0,.5*c,0*b,.3*c);T(a,0*b,0,.45*b,0,.5*b,.3*c);T(a,.55*b,0,1*b,0,1*b,.3*c);T(a,b,.5*c,.9*b,.8*c,.5*b,1*c);U(a);b=a.q;b.C=new R(.15,.29);
b.D=new R(.86,.68);x.v(a);return b},Spade:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);T(a,.6*b,.2*c,b,.25*c,b,.5*c);T(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);T(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);T(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);T(a,.4*b,.8*c,0,.8*c,0,.5*c);T(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);U(a);b=a.q;b.C=new R(.19,.26);b.D=new R(.8,.68);x.v(a);return b},Club:function(a,b,c){a=x.u();S(a,.4*b,.6*c,!0);T(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*b,c);T(a,.55*b,
.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,g=0,h=4*(Math.SQRT2-1)/3*d;T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e+.05)*b,(.5-h+g-.02)*c,.65*b,.36771243*c);d=.2;e=0;g=-.3;h=4*(Math.SQRT2-1)/3*d;T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+
g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,.35*b,.36771243*c);d=.2;e=-.3;g=0;h=4*(Math.SQRT2-1)/3*d;T(a,(.5+d+e-.05)*b,(.5-h+g-.02)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,.4*b,.6*c);U(a);b=a.q;b.C=new R(.06,.39);
b.D=new R(.93,.58);x.v(a);return b},Ring:function(a,b,c){a=x.u();var d=4*(Math.SQRT2-1)/3*.5;S(a,b,.5*c,!0);T(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);T(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);T(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);T(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;S(a,.5*b,.1*c,!0,!0);T(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);T(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);T(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);T(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,
.853);b.Xd=Jh;x.v(a);return b},YinYang:function(a,b,c){var d=.5;a=x.u();d=.5;S(a,.5*b,0,!0);a.arcTo(270,180,.5*b,.5*b,.5*b);T(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;S(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);U(a);S(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.hb(!1);e=.75;S(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);U(a);b=a.q;b.Xd=Jh;x.v(a);return b},Peace:function(a,b,c){a=x.u();var d=4*(Math.SQRT2-1)/3*.5;S(a,b,.5*c,!0);T(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);T(a,(.5-d)*b,0,0,(.5-
d)*c,0,.5*c);T(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);T(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;S(a,.5*b,.1*c,!0,!0);T(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);T(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);T(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);T(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,g=-.707*.11,h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*
b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=-.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*
c);d=.07;e=.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,.853);b.Xd=Jh;x.v(a);return b},NotAllowed:function(a,b,c){var d=Q.Ka,e=.5*d,g=.5;a=x.u();S(a,.5*b,(.5-
g)*c,!0);T(a,(.5-e)*b,(.5-g)*c,(.5-g)*b,(.5-e)*c,(.5-g)*b,.5*c);T(a,(.5-g)*b,(.5+e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);T(a,(.5+g)*b,(.5-e)*c,(.5+e)*b,(.5-g)*c,.5*b,(.5-g)*c);var g=.4,e=.4*d,d=x.P(),h=x.P(),k=x.P(),l=x.P();Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.42,d,h,k,l,l);var m=x.P(),n=x.P(),p=x.P();Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.58,l,l,p,m,n);var q=x.P(),r=x.P(),s=x.P();Q.ej(.5,.5+g,.5-e,.5+g,.5-g,.5+e,.5-g,.5,.42,q,r,s,l,l);
var t=x.P(),v=x.P(),y=x.P();Q.ej(.5,.5+g,.5-e,.5+g,.5-g,.5+e,.5-g,.5,.58,l,l,y,t,v);S(a,y.x*b,y.y*c,!0,!0);T(a,t.x*b,t.y*c,v.x*b,v.y*c,(.5-g)*b,.5*c);T(a,(.5-g)*b,(.5-e)*c,(.5-e)*b,(.5-g)*c,.5*b,(.5-g)*c);T(a,d.x*b,d.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(y.x*b,y.y*c);U(a);S(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);T(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+g)*b,.5*c);T(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);U(a);x.A(d);x.A(h);x.A(k);x.A(l);x.A(m);x.A(n);
x.A(p);x.A(q);x.A(r);x.A(s);x.A(t);x.A(v);x.A(y);b=a.q;x.v(a);b.Xd=Jh;return b},Fragile:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.25*b,0);a.lineTo(.2*b,.15*c);a.lineTo(.3*b,.25*c);a.lineTo(.29*b,.33*c);a.lineTo(.35*b,.25*c);a.lineTo(.3*b,.15*c);a.lineTo(.4*b,0);a.lineTo(1*b,0);T(a,1*b,.25*c,.75*b,.5*c,.55*b,.5*c);a.lineTo(.55*b,.9*c);a.lineTo(.7*b,.9*c);a.lineTo(.7*b,1*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.9*c);a.lineTo(.45*b,.9*c);a.lineTo(.45*b,.5*c);T(a,.25*b,.5*c,0,.25*c,0,0);U(a);b=a.q;b.C=
new R(.25,0);b.D=new R(.75,.4);x.v(a);return b},HourGlass:function(a,b,c){a=x.u();S(a,.65*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.35*b,.5*c);a.lineTo(0,0);a.lineTo(1*b,0);U(a);b=a.q;x.v(a);return b},Lightning:function(a,b,c){a=x.u();S(a,0*b,.55*c,!0);a.lineTo(.75*b,0);a.lineTo(.25*b,.45*c);a.lineTo(.9*b,.48*c);a.lineTo(.4*b,1*c);a.lineTo(.65*b,.55*c);U(a);b=a.q;x.v(a);return b},Parallelogram1:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=x.u();S(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-
a)*b,1*c);d.lineTo(0,1*c);U(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);x.v(d);return b},Input:"Output",Output:function(a,b,c){a=x.u();S(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);U(a);b=a.q;b.C=new R(.1,0);b.D=new R(.9,1);x.v(a);return b},Parallelogram2:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.25);var d=x.u();S(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);U(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);x.v(d);return b},ThickCross:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&
(a=.25);var d=x.u();S(d,(.5-a/2)*b,0,!0);d.lineTo((.5+a/2)*b,0);d.lineTo((.5+a/2)*b,(.5-a/2)*c);d.lineTo(1*b,(.5-a/2)*c);d.lineTo(1*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,1*c);d.lineTo((.5-a/2)*b,1*c);d.lineTo((.5-a/2)*b,(.5+a/2)*c);d.lineTo(0,(.5+a/2)*c);d.lineTo(0,(.5-a/2)*c);d.lineTo((.5-a/2)*b,(.5-a/2)*c);U(d);b=d.q;b.C=new R(.5-a/2,.5-a/2);b.D=new R(.5+a/2,.5+a/2);x.v(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=x.u();S(d,.3*b,0,!0);d.lineTo(.5*b,.2*c);
d.lineTo(.7*b,0);d.lineTo(1*b,.3*c);d.lineTo(.8*b,.5*c);d.lineTo(1*b,.7*c);d.lineTo(.7*b,1*c);d.lineTo(.5*b,.8*c);d.lineTo(.3*b,1*c);d.lineTo(0,.7*c);d.lineTo(.2*b,.5*c);d.lineTo(0,.3*c);U(d);b=d.q;b.C=new R(.5-a,.5-a);b.D=new R(.5+a,.5+a);x.v(d);return b},ThinCross:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=.1);a=x.u();S(a,(.5-d/2)*b,0,!0);a.lineTo((.5+d/2)*b,0);a.lineTo((.5+d/2)*b,(.5-d/2)*c);a.lineTo(1*b,(.5-d/2)*c);a.lineTo(1*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,(.5+d/2)*c);a.lineTo((.5+d/2)*
b,1*c);a.lineTo((.5-d/2)*b,1*c);a.lineTo((.5-d/2)*b,(.5+d/2)*c);a.lineTo(0,(.5+d/2)*c);a.lineTo(0,(.5-d/2)*c);a.lineTo((.5-d/2)*b,(.5-d/2)*c);U(a);b=a.q;x.v(a);return b},ThinX:function(a,b,c){a=x.u();S(a,.1*b,0,!0);a.lineTo(.5*b,.4*c);a.lineTo(.9*b,0);a.lineTo(1*b,.1*c);a.lineTo(.6*b,.5*c);a.lineTo(1*b,.9*c);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.6*c);a.lineTo(.1*b,1*c);a.lineTo(0,.9*c);a.lineTo(.4*b,.5*c);a.lineTo(0,.1*c);U(a);return a.q},RightTriangle:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(1*b,
1*c);a.lineTo(0,1*c);U(a);b=a.q;b.C=new R(0,.5);b.D=new R(.5,1);x.v(a);return b},RoundedIBeam:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(1*b,0);T(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);U(a);b=a.q;x.v(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*Q.Ka;var e=x.u();S(e,d,0,!0);e.lineTo(b-d,0);T(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);T(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);T(e,a,c,0,c-a,0,c-d);e.lineTo(0,
d);T(e,0,a,a,0,d,0);U(e);b=e.q;1<a?(b.C=new R(0,0,a,a),b.D=new R(1,1,-a,-a)):(b.C=Xb,b.D=lc);x.v(e);return b},Border:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=x.u();S(a,d,0,!0);a.lineTo(b-d,0);T(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);T(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);T(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);T(a,0,0,0,0,d,0);U(a);b=a.q;b.C=Xb;b.D=lc;x.v(a);return b},SquareIBeam:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=.2);a=x.u();S(a,0,0,!0);a.lineTo(1*b,0);
a.lineTo(1*b,d*c);a.lineTo((.5+d/2)*b,d*c);a.lineTo((.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((.5-d/2)*b,(1-d)*c);a.lineTo((.5-d/2)*b,d*c);a.lineTo(0,d*c);U(a);b=a.q;x.v(a);return b},Trapezoid:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.2);var d=x.u();S(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);x.v(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=
a?a.Hc:NaN;isNaN(d)&&(d=0);a=x.u();S(a,d,0,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);U(a);b=a.q;b.C=new R(.1,0);b.D=new R(.9,1);x.v(a);return b},GenderMale:function(a,b,c){a=x.u();var d=Q.Ka,e=.4*d,g=.4,h=x.P(),k=x.P(),l=x.P(),m=x.P();S(a,(.5-g)*b,.5*c,!0);T(a,(.5-g)*b,(.5-e)*c,(.5-e)*b,(.5-g)*c,.5*b,(.5-g)*c);Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.44,l,m,k,h,h);T(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);var n=x.Xb(k.x,k.y);Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.56,
h,h,k,l,m);var p=x.Xb(k.x,k.y);a.lineTo((.1*n.x+.855)*b,.1*n.y*c);a.lineTo(.85*b,.1*n.y*c);a.lineTo(.85*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.15*c);a.lineTo((.1*p.x+.9)*b,.15*c);a.lineTo((.1*p.x+.9)*b,(.1*p.y+.05*.9)*c);a.lineTo(p.x*b,p.y*c);T(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+g)*b,.5*c);T(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,(.5-e)*b,(.5+g)*c,(.5-g)*b,(.5+e)*c,(.5-g)*b,.5*c);g=.35;e=.35*d;S(a,.5*b,(.5-g)*c,!0,!0);T(a,(.5-e)*b,(.5-g)*c,(.5-g)*b,(.5-e)*c,(.5-g)*b,.5*c);T(a,(.5-g)*b,(.5+
e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);T(a,(.5+g)*b,(.5-e)*c,(.5+e)*b,(.5-g)*c,.5*b,(.5-g)*c);S(a,(.5-g)*b,.5*c,!0);x.A(h);x.A(k);x.A(l);x.A(m);x.A(n);x.A(p);b=a.q;b.C=new R(.202,.257);b.D=new R(.692,.839);b.Xd=Jh;x.v(a);return b},GenderFemale:function(a,b,c){a=x.u();var d=.375,e=0,g=-.125,h=4*(Math.SQRT2-1)/3*d;S(a,(.525+e)*b,(.5+d+g)*c,!0);T(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);T(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*
b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.475+e)*b,(.5+d+g)*c);a.lineTo(.475*b,.85*c);a.lineTo(.425*b,.85*c);a.lineTo(.425*b,.9*c);a.lineTo(.475*b,.9*c);a.lineTo(.475*b,1*c);a.lineTo(.525*b,1*c);a.lineTo(.525*b,.9*c);a.lineTo(.575*b,.9*c);a.lineTo(.575*b,.85*c);a.lineTo(.525*b,.85*c);U(a);d=.325;e=0;g=-.125;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e)*b,(.5+g)*c,!0,!0);T(a,(.5+d+e)*b,(.5+h+g)*c,(.5+
h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);T(a,(.5-h+e)*b,(.5+d+g)*c,(.5-d+e)*b,(.5+h+g)*c,(.5-d+e)*b,(.5+g)*c);T(a,(.5-d+e)*b,(.5-h+g)*c,(.5-h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);T(a,(.5+h+e)*b,(.5-d+g)*c,(.5+d+e)*b,(.5-h+g)*c,(.5+d+e)*b,(.5+g)*c);S(a,(.525+e)*b,(.5+d+g)*c,!0);b=a.q;b.C=new R(.232,.136);b.D=new R(.782,.611);b.Xd=Jh;x.v(a);return b},PlusLine:function(a,b,c){a=x.u();S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.q;x.v(a);return b},XLine:function(a,b,c){a=x.u();
S(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},AsteriskLine:function(a,b,c){a=x.u();var d=.2/Math.SQRT2;S(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,.5*c);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0*c);a.lineTo(.5*b,1*c);b=a.q;x.v(a);return b},CircleLine:function(a,b,c){var d=.5*Q.Ka;a=x.u();S(a,1*b,.5*c,!1);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);
T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(.146,.146);b.D=new R(.853,.853);b.Xd=Jh;x.v(a);return b},Pie:function(a,b,c){a=x.u();var d=4*(Math.SQRT2-1)/3*.5;S(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);T(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);T(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);T(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);T(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);U(a);b=a.q;x.v(a);return b},PiePiece:function(a,b,c){var d=Q.Ka/Math.SQRT2*.5,e=Math.SQRT2/2,g=1-
Math.SQRT2/2;a=x.u();S(a,b,c,!0);T(a,b,(1-d)*c,(e+d)*b,(g+d)*c,e*b,g*c);a.lineTo(0,c);U(a);b=a.q;x.v(a);return b},StopSign:function(a,b,c){a=1/(Math.SQRT2+2);var d=x.u();S(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);U(d);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);x.v(d);return b},LogicImplies:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=.2);a=x.u();S(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-
d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);b=a.q;b.C=Xb;b.D=new R(.8,.5);x.v(a);return b},LogicIff:function(a,b,c){var d=a?a.Hc:NaN;isNaN(d)&&(d=.2);a=x.u();S(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(d*b,0);a.lineTo(0,.5*c);a.lineTo(d*b,c);b=a.q;b.C=new R(.2,0);b.D=new R(.8,.5);x.v(a);return b},LogicNot:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},LogicAnd:function(a,b,c){a=x.u();S(a,0,1*c,!1);
a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,1);x.v(a);return b},LogicOr:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.q;b.C=new R(.219,0);b.D=new R(.78,.409);x.v(a);return b},LogicXor:function(a,b,c){a=x.u();S(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);var d=.5*Q.Ka;T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;
b.Xd=Jh;x.v(a);return b},LogicTruth:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.q;x.v(a);return b},LogicFalsity:function(a,b,c){a=x.u();S(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.q;x.v(a);return b},LogicThereExists:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,.5*c);a.lineTo(0,.5*c);a.moveTo(1*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);b=a.q;x.v(a);return b},LogicForAll:function(a,b,c){a=x.u();S(a,0,0,!1);
a.lineTo(.5*b,1*c);a.lineTo(1*b,0);a.moveTo(.25*b,.5*c);a.lineTo(.75*b,.5*c);b=a.q;b.C=new R(.25,0);b.D=new R(.75,.5);x.v(a);return b},LogicIsDefinedAs:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(b,0);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(0,c);a.lineTo(b,c);b=a.q;b.C=new R(.01,.01);b.D=new R(.99,.49);x.v(a);return b},LogicIntersect:function(a,b,c){var d=.5*Q.Ka;a=x.u();S(a,0,1*c,!1);a.lineTo(0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=
a.q;b.C=new R(0,.5);b.D=lc;x.v(a);return b},LogicUnion:function(a,b,c){var d=.5*Q.Ka;a=x.u();S(a,1*b,0,!1);a.lineTo(1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.q;b.C=Xb;b.D=new R(1,.5);x.v(a);return b},Arrow:function(a,b,c){var d=a?a.Hc:NaN,e=a?a.gu:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=x.u();S(a,0,(.5-e/2)*c,!0);a.lineTo((1-d)*b,(.5-e/2)*c);a.lineTo((1-d)*b,0);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,1*c);a.lineTo((1-d)*b,(.5+e/2)*c);a.lineTo(0,
(.5+e/2)*c);U(a);b=a.q;b.C=new R(0,.5-e/2);d=Q.Pl(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,x.P());b.D=new R(d.x,d.y);x.A(d);x.v(a);return b},ISOProcess:"Chevron",Chevron:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);U(a);b=a.q;x.v(a);return b},DoubleArrow:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.3*b,.214*c);a.lineTo(.3*b,0);a.lineTo(1*b,.5*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.786*c);a.lineTo(0,1*c);U(a);S(a,.3*b,.214*c,!1);
a.lineTo(.3*b,.786*c);a.hb(!1);b=a.q;x.v(a);return b},DoubleEndArrow:function(a,b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(.3*b,.7*c);a.lineTo(.3*b,1*c);a.lineTo(0,.5*c);a.lineTo(.3*b,0);a.lineTo(.3*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);U(a);b=a.q;c=Q.Pl(0,.5,.3,0,0,.3,.3,.3,x.P());b.C=new R(c.x,c.y);c=Q.Pl(.7,1,1,.5,.7,.7,1,.7,c);b.D=new R(c.x,c.y);x.A(c);x.v(a);return b},IBeamArrow:function(a,b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*
b,.7*c);a.lineTo(.2*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.2*b,0);a.lineTo(.2*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);U(a);b=a.q;b.C=new R(0,.3);c=Q.Pl(.7,1,1,.5,.7,.7,1,.7,x.P());b.D=new R(c.x,c.y);x.A(c);x.v(a);return b},Pointer:function(a,b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);U(a);b=a.q;b.C=new R(.2,.35);c=Q.Pl(.2,.65,1,.65,0,1,1,.5,x.P());b.D=new R(c.x,c.y);x.A(c);x.v(a);return b},RoundedPointer:function(a,b,c){a=x.u();
S(a,1*b,.5*c,!0);a.lineTo(0,1*c);T(a,.5*b,.75*c,.5*b,.25*c,0,0);U(a);b=a.q;b.C=new R(.4,.35);c=Q.Pl(.2,.65,1,.65,0,1,1,.5,x.P());b.D=new R(c.x,c.y);x.A(c);x.v(a);return b},SplitEndArrow:function(a,b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(0,.7*c);a.lineTo(.2*b,.5*c);a.lineTo(0,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);U(a);b=a.q;b.C=new R(.2,.3);c=Q.Pl(.7,1,1,.5,.7,.7,1,.7,x.P());b.D=new R(c.x,c.y);x.A(c);x.v(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,
b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.7*b,0);U(a);b=a.q;b.C=Xb;b.D=new R(.7,1);x.v(a);return b},Cone1:function(a,b,c){var d=Q.Ka;a=.5*d;var e=.1*d,d=x.u();S(d,0,.9*c,!0);d.lineTo(.5*b,0);d.lineTo(1*b,.9*c);T(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);T(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);U(d);b=d.q;b.C=new R(.25,.5);b.D=new R(.75,.97);x.v(d);return b},Cone2:function(a,b,c){a=x.u();S(a,0,.9*c,!0);T(a,(1-.85/.9)*b,1*c,.85/.9*b,1*c,1*b,.9*c);a.lineTo(.5*b,
0);a.lineTo(0,.9*c);U(a);S(a,0,.9*c,!1);T(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.hb(!1);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,.82);x.v(a);return b},Cube1:function(a,b,c){a=x.u();S(a,.5*b,1*c,!0);a.lineTo(1*b,.85*c);a.lineTo(1*b,.15*c);a.lineTo(.5*b,0*c);a.lineTo(0*b,.15*c);a.lineTo(0*b,.85*c);U(a);S(a,.5*b,1*c,!1);a.lineTo(.5*b,.3*c);a.lineTo(0,.15*c);a.moveTo(.5*b,.3*c);a.lineTo(1*b,.15*c);a.hb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(.5,.85);x.v(a);return b},Cube2:function(a,b,c){a=x.u();S(a,
0,.3*c,!0);a.lineTo(0*b,1*c);a.lineTo(.7*b,c);a.lineTo(1*b,.7*c);a.lineTo(1*b,0*c);a.lineTo(.3*b,0*c);U(a);S(a,0,.3*c,!1);a.lineTo(.7*b,.3*c);a.lineTo(1*b,0*c);a.moveTo(.7*b,.3*c);a.lineTo(.7*b,1*c);a.hb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(.7,1);x.v(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=Q.Ka;a=.5*d;var e=.1*d,d=x.u();S(d,0,.1*c,!0);T(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);T(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(b,.9*c);T(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);T(d,(.5-
a)*b,1*c,0,(.9+e)*c,0,.9*c);d.lineTo(0,.1*c);S(d,0,.1*c,!1);T(d,0,(.1+e)*c,(.5-a)*b,.2*c,.5*b,.2*c);T(d,(.5+a)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);d.hb(!1);b=d.q;b.C=new R(0,.2);b.D=new R(1,.9);x.v(d);return b},Cylinder2:function(a,b,c){var d=Q.Ka;a=.5*d;var e=.1*d,d=x.u();S(d,0,.9*c,!0);d.lineTo(0,.1*c);T(d,0,(.1-e)*c,(.5-a)*b,0,.5*b,0);T(d,(.5+a)*b,0,1*b,(.1-e)*c,1*b,.1*c);d.lineTo(1*b,.9*c);T(d,1*b,(.9+e)*c,(.5+a)*b,1*c,.5*b,1*c);T(d,(.5-a)*b,1*c,0,(.9+e)*c,0,.9*c);S(d,0,.9*c,!1);T(d,0,(.9-e)*c,(.5-
a)*b,.8*c,.5*b,.8*c);T(d,(.5+a)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);d.hb(!1);b=d.q;b.C=new R(0,.1);b.D=new R(1,.8);x.v(d);return b},Cylinder3:function(a,b,c){var d=Q.Ka;a=.1*d;var e=.5*d,d=x.u();S(d,.1*b,0,!0);d.lineTo(.9*b,0);T(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);T(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);T(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);T(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);S(d,.1*b,0,!1);T(d,(.1+a)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);T(d,.2*b,(.5+e)*c,(.1+a)*b,1*c,.1*b,1*c);d.hb(!1);b=d.q;b.C=
new R(.2,0);b.D=new R(.9,1);x.v(d);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=Q.Ka;a=.1*d;var e=.5*d,d=x.u();S(d,.9*b,0,!0);T(d,(.9+a)*b,0,1*b,(.5-e)*c,1*b,.5*c);T(d,1*b,(.5+e)*c,(.9+a)*b,1*c,.9*b,1*c);d.lineTo(.1*b,1*c);T(d,(.1-a)*b,1*c,0,(.5+e)*c,0,.5*c);T(d,0,(.5-e)*c,(.1-a)*b,0,.1*b,0);d.lineTo(.9*b,0);S(d,.9*b,0,!1);T(d,(.9-a)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);T(d,.8*b,(.5+e)*c,(.9-a)*b,1*c,.9*b,1*c);d.hb(!1);b=d.q;b.C=new R(.1,0);b.D=new R(.8,1);x.v(d);return b},Prism1:function(a,
b,c){a=x.u();S(a,.25*b,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(b,.5*c);a.lineTo(.5*b,c);a.lineTo(0,c);U(a);S(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.hb(!1);b=a.q;b.C=new R(.408,.172);b.D=new R(.833,.662);x.v(a);return b},Prism2:function(a,b,c){a=x.u();S(a,0,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);U(a);S(a,0,c,!1);a.lineTo(.25*b,.5*c);a.lineTo(b,.25*c);a.moveTo(0,.25*c);a.lineTo(.25*b,.5*c);a.hb(!1);b=a.q;b.C=new R(.25,.5);b.D=new R(.75,.75);x.v(a);return b},
Pyramid1:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);U(a);S(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.hb(!1);b=a.q;b.C=new R(.25,.367);b.D=new R(.75,.875);x.v(a);return b},Pyramid2:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);U(a);S(a,.5*b,0,!1);a.lineTo(.5*b,.7*c);a.lineTo(0,.85*c);a.moveTo(.5*b,.7*c);a.lineTo(1*b,.85*c);a.hb(!1);b=a.q;b.C=new R(.25,.367);b.D=new R(.75,.875);x.v(a);return b},Actor:function(a,
b,c){var d=Q.Ka,e=.2*d,g=.1*d,h=.5,k=.1;a=x.u();S(a,h*b,(k+.1)*c,!0);T(a,(h-e)*b,(k+.1)*c,(h-.2)*b,(k+g)*c,(h-.2)*b,k*c);T(a,(h-.2)*b,(k-g)*c,(h-e)*b,(k-.1)*c,h*b,(k-.1)*c);T(a,(h+e)*b,(k-.1)*c,(h+.2)*b,(k-g)*c,(h+.2)*b,k*c);T(a,(h+.2)*b,(k+g)*c,(h+e)*b,(k+.1)*c,h*b,(k+.1)*c);e=.05;g=d*e;S(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);h=.95;k=.25;T(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);a.lineTo(1*b,.6*c);a.lineTo(.85*b,.6*c);a.lineTo(.85*b,.35*c);e=.025;g=d*e;h=.825;k=.35;T(a,(h+e)*b,(k-g)*c,(h+g)*
b,(k-e)*c,h*b,(k-e)*c);T(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(.8*b,1*c);a.lineTo(.55*b,1*c);a.lineTo(.55*b,.7*c);e=.05;g=d*e;h=.5;k=.7;T(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);T(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(.45*b,1*c);a.lineTo(.2*b,1*c);a.lineTo(.2*b,.35*c);e=.025;g=d*e;h=.175;k=.35;T(a,(h+e)*b,(k-g)*c,(h+g)*b,(k-e)*c,h*b,(k-e)*c);T(a,(h-g)*b,(k-e)*c,(h-e)*b,(k-g)*c,(h-e)*b,k*c);a.lineTo(.15*b,.6*c);a.lineTo(0*b,.6*c);a.lineTo(0*b,.25*c);e=.05;
g=d*e;h=.05;k=.25;T(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);a.lineTo(.5*b,.2*c);b=a.q;b.C=new R(.2,.2);b.D=new R(.8,.65);x.v(a);return b},Card:function(a,b,c){a=x.u();S(a,1*b,0*c,!0);a.lineTo(1*b,1*c);a.lineTo(0*b,1*c);a.lineTo(0*b,.2*c);a.lineTo(.2*b,0*c);U(a);b=a.q;b.C=new R(0,.2);b.D=lc;x.v(a);return b},Collate:function(a,b,c){a=x.u();S(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);S(a,.5*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);b=a.q;b.C=new R(.25,
0);b.D=new R(.75,.25);x.v(a);return b},CreateRequest:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);S(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.hb(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);x.v(d);return b},Database:function(a,b,c){a=x.u();var d=Q.Ka,e=.5*d,d=.1*d;S(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);T(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*b,1*c);T(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);
T(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);T(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);S(a,1*b,.1*c,!1);T(a,1*b,(.1+d)*c,(.5+e)*b,.2*c,.5*b,.2*c);T(a,(.5-e)*b,.2*c,0,(.1+d)*c,0,.1*c);a.moveTo(1*b,.2*c);T(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);T(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.moveTo(1*b,.3*c);T(a,1*b,(.3+d)*c,(.5+e)*b,.4*c,.5*b,.4*c);T(a,(.5-e)*b,.4*c,0,(.3+d)*c,0,.3*c);a.hb(!1);b=a.q;b.C=new R(0,.4);b.D=new R(1,.9);x.v(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=x.u();S(a,0,0,!0);
a.lineTo(.75*b,0);T(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);T(a,.25*b,.9*c,.25*b,.1*c,0,0);U(a);b=a.q;b.C=new R(.226,0);b.D=new R(.81,1);x.v(a);return b},DiskStorage:function(a,b,c){a=x.u();var d=Q.Ka,e=.5*d,d=.1*d;S(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);T(a,1*b,(.9+d)*c,(.5+e)*b,1*c,.5*b,1*c);T(a,(.5-e)*b,1*c,0,(.9+d)*c,0,.9*c);a.lineTo(0,.1*c);T(a,0,(.1-d)*c,(.5-e)*b,0,.5*b,0);T(a,(.5+e)*b,0,1*b,(.1-d)*c,1*b,.1*c);S(a,1*b,.1*c,!1);T(a,1*b,(.1+d)*c,(.5+e)*b,.2*c,.5*b,.2*c);T(a,(.5-e)*b,.2*c,0,(.1+
d)*c,0,.1*c);a.moveTo(1*b,.2*c);T(a,1*b,(.2+d)*c,(.5+e)*b,.3*c,.5*b,.3*c);T(a,(.5-e)*b,.3*c,0,(.2+d)*c,0,.2*c);a.hb(!1);b=a.q;b.C=new R(0,.3);b.D=new R(1,.9);x.v(a);return b},Display:function(a,b,c){a=x.u();S(a,.25*b,0,!0);a.lineTo(.75*b,0);T(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);U(a);b=a.q;b.C=new R(.25,0);b.D=new R(.75,1);x.v(a);return b},DividedEvent:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=x.u(),e=.2*Q.Ka;S(d,0,.2*c,!0);T(d,0,(.2-e)*c,(.2-e)*b,
0,.2*b,0);d.lineTo(.8*b,0);T(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);T(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);T(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.hb(!1);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);x.v(d);return b},DividedProcess:function(a,b,c){a=a?a.Hc:NaN;if(isNaN(a)||.1>a)a=.1;var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);S(d,0,a*c,!1);d.lineTo(1*b,a*c);d.hb(!1);b=d.q;b.C=new R(0,a);b.D=
lc;x.v(d);return b},Document:function(a,b,c){c/=.8;a=x.u();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);U(a);b=a.q;b.C=Xb;b.D=new R(1,.6);x.v(a);return b},ExternalOrganization:function(a,b,c){a=a?a.Hc:NaN;if(isNaN(a)||.2>a)a=.2;var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);S(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.hb(!1);b=d.q;b.C=new R(a/2,a/2);b.D=new R(1-a/2,1-a/2);x.v(d);return b},ExternalProcess:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);U(a);S(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.hb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.75);x.v(a);return b},File:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);
a.lineTo(1*b,1*c);a.lineTo(0,1*c);U(a);S(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.hb(!1);b=a.q;b.C=new R(0,.25);b.D=lc;x.v(a);return b},Interrupt:function(a,b,c){a=x.u();S(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);S(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);x.v(a);return b},InternalStorage:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=x.u();S(e,0,0,!0);e.lineTo(1*
b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);U(e);S(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.hb(!1);b=e.q;b.C=new R(d,a);b.D=lc;x.v(e);return b},Junction:function(a,b,c){a=x.u();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Q.Ka;S(a,1*b,.5*c,!0);T(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);T(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);T(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);T(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);S(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.hb(!1);
b=a.q;b.Xd=Jh;x.v(a);return b},LinedDocument:function(a,b,c){c/=.8;a=x.u();S(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);U(a);S(a,.1*b,0,!1);a.lineTo(.1*b,.75*c);a.hb(!1);b=a.q;b.C=new R(.1,0);b.D=new R(1,.6);x.v(a);return b},LoopLimit:function(a,b,c){a=x.u();S(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);U(a);b=a.q;b.C=new R(0,.25);b.D=lc;x.v(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,
b,c){a=x.u();var d=.5*Q.Ka;S(a,.5*b,1*c,!0);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.q;b.C=new R(.15,.15);b.D=new R(.85,.8);x.v(a);return b},ManualInput:function(a,b,c){a=x.u();S(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);U(a);b=a.q;b.C=new R(0,.25);b.D=lc;x.v(a);return b},MessageFromUser:function(a,b,c){a=a?a.Hc:
NaN;isNaN(a)&&(a=.7);var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);b=d.q;b.C=Xb;b.D=new R(a,1);x.v(d);return b},MicroformProcessing:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.25);var d=x.u();S(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);U(d);b=d.q;b.C=new R(0,a);b.D=new R(1,1-a);x.v(d);return b},MicroformRecording:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*
c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);U(a);b=a.q;b.C=new R(0,.25);b.D=new R(1,.75);x.v(a);return b},MultiDocument:function(a,b,c){c/=.8;a=x.u();S(a,b,0,!0);a.lineTo(b,.5*c);T(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);T(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);T(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);U(a);S(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*
c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.hb(!1);b=a.q;b.C=new R(0,.25);b.D=new R(.8,.77);x.v(a);return b},MultiProcess:function(a,b,c){a=x.u();S(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);U(a);S(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*
b,.9*c);a.hb(!1);b=a.q;b.C=new R(0,.2);b.D=new R(.8,1);x.v(a);return b},OfflineStorage:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=1-a,e=x.u();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(.5*b,1*c);U(e);S(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.hb(!1);b=e.q;b.C=new R(d/4+.5*a,a);b.D=new R(3*d/4+.5*a,a+.5*d);x.v(e);return b},OffPageConnector:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);U(a);b=a.q;b.C=Xb;b.D=new R(.75,1);x.v(a);return b},
Or:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.hb(!1);b=a.q;b.Xd=Jh;x.v(a);return b},PaperTape:function(a,b,c){c/=.8;a=x.u();S(a,0,.7*c,!0);a.lineTo(0,.3*c);T(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);T(a,.5*b,.4*c,.5*b,1*c,0,.7*c);U(a);b=a.q;b.C=new R(0,.49);b.D=
new R(1,.75);x.v(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=x.u();S(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1-a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);U(e);b=e.q;b.C=new R(d,0);b.D=new R(1-a,1);x.v(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Hc:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=x.u();S(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);U(e);b=e.q;b.C=new R(d,
0);b.D=new R(1-a,1);x.v(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);S(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.hb(!1);b=d.q;b.C=new R(a,0);b.D=new R(1-a,1);x.v(d);return b},Process:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);U(d);S(d,a*b,0,!1);d.lineTo(a*b,1*c);d.hb(!1);
b=d.q;b.C=new R(a,0);b.D=lc;x.v(d);return b},Sort:function(a,b,c){a=x.u();S(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);U(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.hb(!1);b=a.q;b.C=new R(.25,.25);b.D=new R(.75,.5);x.v(a);return b},Start:function(a,b,c){a=x.u();S(a,.25*b,0,!0);S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);S(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.hb(!1);b=a.q;b.C=new R(.25,0);b.D=
new R(.75,1);x.v(a);return b},Terminator:function(a,b,c){a=x.u();S(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.q;b.C=new R(.23,0);b.D=new R(.77,1);x.v(a);return b},TransmittalTape:function(a,b,c){a=a?a.Hc:NaN;isNaN(a)&&(a=.1);var d=x.u();S(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);U(d);b=d.q;b.C=Xb;b.D=new R(1,1-a);x.v(d);return b},AndGate:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,0,0,!0);a.lineTo(.5*
b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);U(a);b=a.q;b.C=Xb;b.D=new R(.55,1);x.v(a);return b},Buffer:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);U(a);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);x.v(a);return b},Clock:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);
S(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);S(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2*b,.75*c);a.hb(!1);b=a.q;b.Xd=Jh;x.v(a);return b},Ground:function(a,b,c){a=x.u();S(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.q;x.v(a);return b},Inverter:function(a,b,c){a=x.u();var d=.1*Q.Ka;S(a,.8*
b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);T(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);T(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);T(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(0,.25);b.D=new R(.4,.75);x.v(a);return b},NandGate:function(a,b,c){a=x.u();var d=Q.Ka,e=.5*d,g=.4*d,d=.1*d;S(a,.8*b,.5*c,!0);T(a,.8*b,(.5+g)*c,(.4+e)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);T(a,(.4+e)*b,0,.8*b,(.5-g)*
c,.8*b,.5*c);S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);T(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);T(a,.8*b,(.5-d)*c,(.9-d)*b,.4*c,.9*b,.4*c);T(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new R(0,.05);b.D=new R(.55,.95);x.v(a);return b},NorGate:function(a,b,c){a=x.u();var d=Q.Ka,e=.5,g=d*e,h=0,k=.5;S(a,.8*b,.5*c,!0);T(a,.7*b,(k+g)*c,(h+g)*b,(k+e)*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);T(a,(h+g)*b,(k-e)*c,.7*b,(k-g)*c,.8*b,.5*c);e=.1;g=.1*d;h=.9;k=.5;S(a,(h-e)*b,k*c,!0);T(a,
(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);T(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);T(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);T(a,(h-g)*b,(k+e)*c,(h-e)*b,(k+g)*c,(h-e)*b,k*c);b=a.q;b.C=new R(.2,.25);b.D=new R(.6,.75);x.v(a);return b},OrGate:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,0,0,!0);T(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);T(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);T(a,.25*b,.75*c,.25*b,.25*c,0,0);U(a);b=a.q;b.C=new R(.2,.25);b.D=new R(.75,.75);x.v(a);return b},XnorGate:function(a,
b,c){a=x.u();var d=Q.Ka,e=.5,g=d*e,h=.2,k=.5;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.8*b,.5*c,!0);T(a,.7*b,(k+g)*c,(h+g)*b,(k+e)*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);T(a,(h+g)*b,(k-e)*c,.7*b,(k-g)*c,.8*b,.5*c);e=.1;g=.1*d;h=.9;k=.5;S(a,(h-e)*b,k*c,!0);T(a,(h-e)*b,(k-g)*c,(h-g)*b,(k-e)*c,h*b,(k-e)*c);T(a,(h+g)*b,(k-e)*c,(h+e)*b,(k-g)*c,(h+e)*b,k*c);T(a,(h+e)*b,(k+g)*c,(h+g)*b,(k+e)*c,h*b,(k+e)*c);T(a,(h-g)*b,(k+e)*c,(h-e)*b,(k+g)*c,(h-e)*b,k*c);b=a.q;b.C=new R(.4,.25);
b.D=new R(.65,.75);x.v(a);return b},XorGate:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,.1*b,0,!1);T(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);S(a,.2*b,0,!0);T(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);T(a,.9*b,(.5+d)*c,(.2+d)*b,1*c,.2*b,1*c);T(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);U(a);b=a.q;b.C=new R(.4,.25);b.D=new R(.8,.75);x.v(a);return b},Capacitor:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},Resistor:function(a,b,c){a=x.u();S(a,0,.5*c,!1);a.lineTo(.1*
b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.q;x.v(a);return b},Inductor:function(a,b,c){a=x.u();var d=.1*Q.Ka,e=.1;S(a,(e-.5*d)*b,c,!1);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;T(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);T(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;T(a,(e+.1)*b,0,(e+d)*b,c,
(e+.5*d)*b,c);b=a.q;x.v(a);return b},ACvoltageSource:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,0*b,.5*c,!1);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);T(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.Xd=Jh;x.v(a);return b},DCvoltageSource:function(a,b,c){a=x.u();S(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},Diode:function(a,b,
c){a=x.u();S(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new R(0,.25);b.D=new R(.5,.75);x.v(a);return b},Wifi:function(a,b,c){var d=b,e=c;b*=.38;c*=.6;a=x.u();var g=Q.Ka,h=.8*g,k=.8,l=0,m=.5,d=(d-b)/2,e=(e-c)/2;S(a,l*b+d,(m+k)*c+e,!0);T(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);T(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);T(a,l*b+d,(m-k)*c+e,(l-k+.5*h)*b+d,(m-h)*c+e,(l-k+.5*h)*b+d,m*c+e);T(a,(l-k+.5*h)*
b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);U(a);h=.4*g;k=.4;l=.2;m=.5;S(a,l*b+d,(m+k)*c+e,!0);T(a,(l-h)*b+d,(m+k)*c+e,(l-k)*b+d,(m+h)*c+e,(l-k)*b+d,m*c+e);T(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);T(a,l*b+d,(m-k)*c+e,(l-k+.5*h)*b+d,(m-h)*c+e,(l-k+.5*h)*b+d,m*c+e);T(a,(l-k+.5*h)*b+d,(m+h)*c+e,l*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);U(a);h=.2*g;k=.2;m=l=.5;S(a,(l-k)*b+d,m*c+e,!0);T(a,(l-k)*b+d,(m-h)*c+e,(l-h)*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);T(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,
(l+k)*b+d,m*c+e);T(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);T(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=.4*g;k=.4;l=.8;m=.5;S(a,l*b+d,(m-k)*c+e,!0);T(a,(l+h)*b+d,(m-k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);T(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);T(a,l*b+d,(m+k)*c+e,(l+k-.5*h)*b+d,(m+h)*c+e,(l+k-.5*h)*b+d,m*c+e);T(a,(l+k-.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);U(a);h=.8*g;k=.8;l=1;m=.5;S(a,l*b+d,(m-k)*c+e,!0);T(a,(l+h)*b+d,(m-
k)*c+e,(l+k)*b+d,(m-h)*c+e,(l+k)*b+d,m*c+e);T(a,(l+k)*b+d,(m+h)*c+e,(l+h)*b+d,(m+k)*c+e,l*b+d,(m+k)*c+e);T(a,l*b+d,(m+k)*c+e,(l+k-.5*h)*b+d,(m+h)*c+e,(l+k-.5*h)*b+d,m*c+e);T(a,(l+k-.5*h)*b+d,(m-h)*c+e,l*b+d,(m-k)*c+e,l*b+d,(m-k)*c+e);U(a);b=a.q;x.v(a);return b},Email:function(a,b,c){a=x.u();S(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);U(a);S(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.hb(!1);
b=a.q;x.v(a);return b},Ethernet:function(a,b,c){a=x.u();S(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);U(a);S(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c);a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);U(a);S(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);U(a);S(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*
b,.6*c);a.hb(!1);b=a.q;x.v(a);return b},Power:function(a,b,c){a=x.u();var d=Q.Ka,e=.4*d,g=.4,h=x.P(),k=x.P(),l=x.P(),m=x.P();Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.5,h,h,k,l,m);var n=x.Xb(k.x,k.y);S(a,k.x*b,k.y*c,!0);T(a,l.x*b,l.y*c,m.x*b,m.y*c,(.5+g)*b,.5*c);T(a,(.5+g)*b,(.5+e)*c,(.5+e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,(.5-e)*b,(.5+g)*c,(.5-g)*b,(.5+e)*c,(.5-g)*b,.5*c);Q.ej(.5-g,.5,.5-g,.5-e,.5-e,.5-g,.5,.5-g,.5,l,m,k,h,h);T(a,l.x*b,l.y*c,m.x*b,m.y*c,k.x*b,k.y*c);e=.3*d;g=.3;Q.ej(.5-g,.5,.5-g,.5-
e,.5-e,.5-g,.5,.5-g,.5,l,m,k,h,h);a.lineTo(k.x*b,k.y*c);T(a,m.x*b,m.y*c,l.x*b,l.y*c,(.5-g)*b,.5*c);T(a,(.5-g)*b,(.5+e)*c,(.5-e)*b,(.5+g)*c,.5*b,(.5+g)*c);T(a,(.5+e)*b,(.5+g)*c,(.5+g)*b,(.5+e)*c,(.5+g)*b,.5*c);Q.ej(.5,.5-g,.5+e,.5-g,.5+g,.5-e,.5+g,.5,.5,h,h,k,l,m);T(a,m.x*b,m.y*c,l.x*b,l.y*c,k.x*b,k.y*c);U(a);S(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);U(a);x.A(h);x.A(k);x.A(l);x.A(m);x.A(n);b=a.q;b.C=new R(.25,.55);b.D=new R(.75,.8);x.v(a);return b},Fallout:function(a,
b,c){a=x.u();var d=.5*Q.Ka;S(a,0*b,.5*c,!0);T(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);T(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);var e=d=0;S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;U(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;U(a);S(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+
d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);U(a);b=a.q;b.Xd=Jh;x.v(a);return b},IrritationHazard:function(a,b,c){a=x.u();S(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8*b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);U(a);b=a.q;b.C=new R(.3,.3);b.D=new R(.7,.7);x.v(a);return b},ElectricalHazard:function(a,b,c){a=x.u();S(a,.37*b,0*c,!0);a.lineTo(.5*
b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65*b,.56*c);a.lineTo(0*b,.68*c);U(a);b=a.q;x.v(a);return b},FireHazard:function(a,b,c){a=x.u();S(a,.1*b,1*c,!0);T(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);T(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);T(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);T(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);T(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*
c);T(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);U(a);b=a.q;b.C=new R(.05,.645);b.D=new R(.884,.908);x.v(a);return b},BpmnActivityLoop:function(a,b,c){a=x.u();var d=4*(Math.SQRT2-1)/3*.5;S(a,.65*b,1*c,!1);T(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);T(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);T(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);T(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.q;x.v(a);return b},BpmnActivityParallel:function(a,b,c){a=x.u();
S(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},BpmnActivitySequential:function(a,b,c){a=x.u();S(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.q;x.v(a);return b},BpmnActivityAdHoc:function(a,b,c){a=x.u();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,0,.5*c,!1);T(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);T(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.q;x.v(a);return b},BpmnActivityCompensation:function(a,
b,c){a=x.u();S(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);U(a);b=a.q;x.v(a);return b},BpmnTaskMessage:function(a,b,c){a=x.u();S(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);U(a);S(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.hb(!1);b=a.q;x.v(a);return b},BpmnTaskScript:function(a,b,c){a=x.u();S(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);T(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,
0);T(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);U(a);S(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.hb(!1);b=a.q;x.v(a);return b},BpmnTaskUser:function(a,b,c){a=x.u();S(a,0,0,!1);S(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);T(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);T(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*
b,.405*c);var d=.5-.285,e=Math.PI/4,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;T(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);T(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);T(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);T(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);S(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);S(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.q;x.v(a);
return b},BpmnEventConditional:function(a,b,c){a=x.u();S(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);U(a);S(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.hb(!1);b=a.q;x.v(a);return b},BpmnEventError:function(a,b,c){a=x.u();S(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);U(a);b=a.q;x.v(a);return b},BpmnEventEscalation:function(a,
b,c){a=x.u();S(a,0,0,!1);S(a,1*b,1*c,!1);S(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);U(a);b=a.q;x.v(a);return b},BpmnEventTimer:function(a,b,c){a=x.u();var d=.5*Q.Ka;S(a,1*b,.5*c,!0);T(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);T(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);T(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);T(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*
b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.hb(!1);b=a.q;b.Xd=Jh;x.v(a);return b}};for(var fo in Q.Gg)Q.Gg[fo.toLowerCase()]=fo;
Q.Sw={"":"",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"};Q.WJ=function(){if(null!==Q.Sw){for(var a in Q.Sw){var b=Hd(Q.Sw[a],!1);Q.yj[a]=b;a.toLowerCase()!==a&&(Q.yj[a.toLowerCase()]=a)}Q.Sw=null}};
Q.kE=function(a){Q.WJ();var b=Q.yj[a];if(void 0===b){b=a.toLowerCase();if("none"===b)return"None";b=Q.yj[b]}return"string"===typeof b?b:b instanceof ud?a:null};
function D(a){0===arguments.length?H.call(this):H.call(this,a);this.U=311807;this.Oj=this.ui="";this.qs=this.ns=this.As=this.xr=null;this.Cs="";this.Qg=this.Bs=this.Qm=null;this.ps="";this.Qo=null;this.os=Q.EB;this.rs="";this.Ro=null;this.we="";this.Jv=this.Fq=this.Uk=null;this.Zh=(new N(NaN,NaN)).freeze();this.Cr="";this.jl=null;this.Dr=Xb;this.Mr=Q.JG;this.Fr=Q.IG;this.Vq=null;this.yr=ho;this.Rm=Q.NG;this.jh="gray";this.di=4;this.UC=-1;this.$s=NaN;this.SG=new w;this.ll=null;this.Sj=NaN}x.Qa(D,H);
x.ja("Part",D);D.prototype.cloneProtected=function(a){H.prototype.cloneProtected.call(this,a);a.U=this.U&-4097|49152;a.ui=this.ui;a.Oj=this.Oj;a.xr=this.xr;a.As=this.As;a.ns=this.ns;a.qs=this.qs;a.Cs=this.Cs;a.Bs=this.Bs;a.Qg=null;a.ps=this.ps;a.os=this.os.Y();a.rs=this.rs;a.we=this.we;a.Fq=this.Fq;a.Zh.assign(this.Zh);a.Cr=this.Cr;a.Dr=this.Dr.Y();a.Mr=this.Mr.Y();a.Fr=this.Fr.Y();a.Vq=this.Vq;a.yr=this.yr;a.Rm=this.Rm.Y();a.jh=this.jh;a.di=this.di;a.$s=this.$s};
D.prototype.mi=function(a){H.prototype.mi.call(this,a);a.Sl();a.Qm=null;a.Qo=null;a.Ro=null;a.jl=null;a.ll=null};D.prototype.toString=function(){var a=x.kf(Object.getPrototypeOf(this))+"#"+x.od(this);null!==this.data&&(a+="("+la(this.data)+")");return a};D.LayoutNone=0;var gk;D.LayoutAdded=gk=1;var ok;D.LayoutRemoved=ok=2;D.LayoutShown=4;D.LayoutHidden=8;D.LayoutNodeSized=16;var el;D.LayoutGroupLayout=el=32;D.LayoutNodeReplaced=64;var ho;D.LayoutStandard=ho=gk|ok|28|el|64;D.LayoutAll=16777215;
D.prototype.Bn=function(a,b,c,d,e,g,h){var k=this.h;null!==k&&(a===ye&&"elements"===b?e instanceof H?hk(e,function(a){jk(k,a);ik(k,a)}):e instanceof pj&&Rk(k,e):a===ze&&"elements"===b&&(e instanceof H?hk(e,function(a){nk(k,a);mk(k,a)}):e instanceof pj&&Sk(k,e)),k.Rc(a,b,c,d,e,g,h))};D.prototype.updateTargetBindings=D.prototype.Ob=function(a){H.prototype.Ob.call(this,a);if(null!==this.data){a=this.wa.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof H&&hk(d,function(a){null!==a.data&&a.Ob()})}}};
D.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.aa;if(c instanceof X){var d=c.pn(a),b=b.pI(d),e=this.Xa;b!==e&&(b=null!==e?c.sb(e.data):void 0,e=c.Up,"function"===typeof e?e(a,b):a[e]=b,c.Yx(a,d))}}}};x.w(D,{Lw:"adornments"},function(){return null===this.Qg?Ra:this.Qg.rF});D.prototype.findAdornment=D.prototype.rp=function(a){u&&x.g(a,"string",D,"findAdornment:category");var b=this.Qg;return null===b?null:b.oa(a)};
D.prototype.addAdornment=D.prototype.ul=function(a,b){if(null!==b){u&&(x.g(a,"string",D,"addAdornment:category"),x.l(b,fa,D,"addAdornment:ad"));var c=null,d=this.Qg;null!==d&&(c=d.oa(a));if(c!==b){if(null!==c){var e=c.h;null!==e&&e.remove(c)}null===d&&(this.Qg=d=new ra("string",fa));b.ui!==a&&(b.Lc=a);d.add(a,b);c=this.h;null!==c&&(c.add(b),b.data=this.data)}}};
D.prototype.removeAdornment=D.prototype.Zl=function(a){u&&x.g(a,"string",D,"removeAdornment:category");var b=this.Qg;if(null!==b){var c=b.oa(a);if(null!==c){var d=c.h;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Qg=null)}};D.prototype.clearAdornments=D.prototype.mt=function(){var a=this.Qg;if(null!==a){for(var b=x.ub(),a=a.i;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.Zl(b[c]);x.xa(b)}};
D.prototype.updateAdornments=function(){var a=this.h;if(null!==a){a:{if(this.lb&&this.cG){var b=this.Dn;if(!(null!==b&&this.ba.G()&&this.isVisible()&&b.Wl()&&b.ba.G()))break a;var c=this.rp("Selection");if(null===c){c=this.RJ;null===c&&(c=this instanceof G?a.hJ:this instanceof F?a.CI:a.xJ);if(!(c instanceof fa))break a;Kf(c);c=c.copy();null!==c&&(c.Lc="Selection",c.oc=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.jj(),g=0;b instanceof Y&&(g=b.yb);var h=x.dm();h.n((b.Ga.width+g)*e,(b.Ga.height+
g)*e);d.Ba=h;x.tk(h)}c.angle=b.Nl();c.type!==rh&&(d=x.P(),c.location=b.gb(Xb,d),x.A(d));this.ul("Selection",c);break a}}this.Zl("Selection")}io(this,a);for(a=this.Lw;a.next();)b=a.value,b.Ob(),b.T()}};function io(a,b){b.vb.sf.each(function(b){b.isEnabled&&b.updateAdornments(a)})}x.w(D,{layer:"layer"},function(){return this.Jv});x.w(D,{h:"diagram"},function(){var a=this.Jv;return null!==a?a.h:null});
x.defineProperty(D,{Jf:"layerName"},function(){return this.Oj},function(a){var b=this.Oj;if(b!==a){x.g(a,"string",D,"layerName");var c=this.h;if(null===c||null!==c.Kl(a)&&!c.On)if(this.Oj=a,null!==c&&c.xc(),this.j("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.h,null!==c&&(a=c.Kl(a),null!==a&&a!==b))){var d=b.We(-1,this,!0);0<=d&&c.Rc(ze,"parts",b,this,null,d,!0);d=a.Dp(99999999,this,!0);0<=d&&c.Rc(ye,"parts",a,null,this,!0,d);d=this.St;if(null!==d){var e=c.Za;c.Za=!0;d(this,b,a);c.Za=e}}}});
x.defineProperty(D,{St:"layerChanged"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(null!==a&&x.g(a,"function",D,"layerChanged"),this.xr=a,this.j("layerChanged",b,a))});x.defineProperty(D,{Kn:"zOrder"},function(){return this.$s},function(a){var b=this.$s;if(b!==a){x.g(a,"number",D,"zOrder");this.$s=a;var c=this.layer;null!==c&&gj(c,-1,this);this.j("zOrder",b,a);a=this.h;null!==a&&a.ua()}});
D.prototype.invalidateAdornments=D.prototype.oe=function(){var a=this.h;null!==a&&(Bj(a),0!==(this.U&16384)!==!0&&(this.U|=16384,a.Be()))};function bj(a){0!==(a.U&16384)!==!1&&(a.updateAdornments(),a.U&=-16385)}function fm(a,b){if(!1===Zj(a)){var c=a.h;null!==c&&(c.pg.add(a),a instanceof E&&!c.qa.tb&&a.mf(),b||c.Be());jo(a,!0);a.Hi()}}
function ko(a){if(!1!==Zj(a)){var b=a.position,c=a.location;c.G()&&b.G()||lo(a,b,c);var b=a.fb,c=a.Yb,d=c.copy();c.Va();c.x=b.x;c.y=b.y;c.freeze();a.Hx(d,c);jo(a,!1)}}x.w(D,{$b:"locationObject"},function(){if(null===this.jl){var a=this.Ex;""!==a?(a=this.me(a),this.jl=null!==a?a:this):this.jl=this instanceof fa?this.type!==rh&&null!==this.placeholder?this.placeholder:this:this}return this.jl.visible?this.jl:this});
x.defineProperty(D,{rJ:"minLocation"},function(){return this.Mr},function(a){var b=this.Mr;b.O(a)||(u&&x.l(a,N,D,"minLocation"),this.Mr=a=a.Y(),this.j("minLocation",b,a))});x.defineProperty(D,{mJ:"maxLocation"},function(){return this.Fr},function(a){var b=this.Fr;b.O(a)||(u&&x.l(a,N,D,"maxLocation"),this.Fr=a=a.Y(),this.j("maxLocation",b,a))});
x.defineProperty(D,{Ex:"locationObjectName"},function(){return this.Cr},function(a){var b=this.Cr;b!==a&&(u&&x.g(a,"string",D,"locationObjectName"),this.Cr=a,this.jl=null,am(this),this.j("locationObjectName",b,a))});x.defineProperty(D,{of:"locationSpot"},function(){return this.Dr},function(a){var b=this.Dr;b.O(a)||(u&&(x.l(a,R,D,"locationSpot"),a.cd()||x.k("Part.locationSpot must be a specific Spot value, not: "+a)),this.Dr=a=a.Y(),am(this),this.j("locationSpot",b,a))});
D.prototype.move=function(a){this.position=a};D.prototype.moveTo=D.prototype.moveTo=function(a,b){var c=x.Xb(a,b);this.move(c);x.A(c)};D.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.h;if(null!==a&&(a=a.$a,a.Df&&(a=a.ml.oa(this),null!==a&&a.Ox)))return!0;a=this.Xa;return null===a||a.re&&a.isVisible()?!0:!1};
D.prototype.Qd=function(a){var b=this.h;a?(this.J(4),this.oe(),null!==b&&b.pg.add(this)):(this.J(8),this.mt());this.Sl();null!==b&&(b.xc(),b.ua())};
D.prototype.findObject=D.prototype.me=function(a){if(this.name===a)return this;var b=this.ll;null===b&&(this.ll=b=new pa);if(void 0!==b[a])return b[a];for(var c=this.wa.o,d=c.length,e=0;e<d;e++){var g=c[e];if(g.name===a)return b[a]=g;if(g instanceof H)if(null===g.Ki&&null===g.rg){if(g=g.me(a),null!==g)return b[a]=g}else if(Pk(g)&&(g=g.wa.first(),null!==g&&g.name===a))return b[a]=g}return b[a]=null};
function mo(a,b,c,d){void 0===d&&(d=new N);c.ze()&&(c=dc);var e=b.Ga;d.n(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.Fb(d);for(b=b.V;null!==b&&b!==a;)b.transform.Fb(d),b=b.V;a.il.Fb(d);d.offset(-a.jd.x,-a.jd.y);return d}D.prototype.ensureBounds=D.prototype.Af=function(){ji(this,Infinity,Infinity);this.Kc()};
function fj(a,b){var c;c=a.SG;var d;isNaN(a.Sj)&&(a.Sj=nn(a));d=a.Sj;var e=2*d;if(!a.xk)return c.n(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,h=b.height,k=a.shadowBlur,l=a.XJ,g=g+k,h=h+k;d-=k/2;e-=k/2;0<l.x?g+=l.x:(d+=l.x,g-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.n(d-1,e-1,g+2,h+2);return c}
D.prototype.Kc=function(){this.Hi();if(!1===Yj(this))ko(this);else{var a=this.Yb,b=x.kg();b.assign(a);a.Va();var c=Ri(this);this.bj(0,0,this.jd.width,this.jd.height);var d=this.position;lo(this,d,this.location);a.x=d.x;a.y=d.y;a.freeze();this.Hx(b,a);b.O(a)?this.Lf(c):!this.$d()||Q.F(b.width,a.width)&&Q.F(b.height,a.height)||0<=this.UC&&this.J(16);x.qc(b);jo(this,!1)}};
D.prototype.Hx=function(a,b){Ml(this,!1);var c=this.h;if(null!==c){var d=!1,e=a.G();if(!1===c.Jj){var g=c.Ec,h=c.padding,k=g.x+h.left,l=g.y+h.top,m=g.width-2*h.right,g=g.height-2*h.bottom;e&&a.x>k&&a.y>l&&a.right<m&&a.bottom<g&&b.x>k&&b.y>l&&b.right<m&&b.bottom<g&&(d=!0)}0!==(this.U&65536)!==!0&&a.O(b)||kk(this,d,c);c.ua();a.O(b)||this.Sl()}};
x.defineProperty(D,{location:"location"},function(){return this.Zh},function(a){var b=this.Zh;if(!b.O(a)){u&&x.l(a,N,D,"location");a=a.Y();var c;c=a;if(this instanceof G)c=!1;else{this.Zh=c;if(!1===Yj(this)){var d=this.fb,e=d.G(),g=null;e&&(g=d.copy(),d.n(d.x+(c.x-b.x),d.y+(c.y-b.y)));fm(this,!1);no(this,this.h,d,g);e&&this.j("position",g,d)}c=!0}c&&this.j("location",b,a)}});
D.prototype.iB=function(a,b){if(this instanceof G||!a.G())return!1;var c=this.h;if(null!==c&&(no(this,c,a,b),!0===c.qa.tb))return!0;this.fb=a;var c=this.Zh,d=c.G(),e=null;d&&(e=c.copy(),c.n(c.x+(a.x-b.x),c.y+(a.y-b.y)));!1===Zj(this)&&!1===Yj(this)&&(fm(this,!1),ko(this));d&&this.j("location",e,c);return!0};function no(a,b,c,d){null===b||a instanceof fa||(b=a.h.$a,b.Bc&&c.G()&&Fi(b,a,"position",d.copy(),c.copy(),!1))}
D.prototype.$x=function(a,b){var c=this.Zh;!1===Zj(this)&&!1===Yj(this)?this.Zh.n(c.x+a-this.fb.x,c.y+b-this.fb.y):c.n(NaN,NaN);this.fb.n(a,b);fm(this,!0)};
function lo(a,b,c){var d=NaN,e=NaN,g=x.P(),h=a.of,k=a.$b;h.ze()&&x.k("determineOffset: Part's locationSpot must be real: "+h.toString());var l=k.Ga,d=0;k.yb&&(d=k.ve);g.uu(0,0,l.width+d,l.height+d,h);if(k!==a)for(k.yb&&g.offset(-d/2,-d/2),k.transform.Fb(g),h=k.V;null!==h&&h!==a;)h.transform.Fb(g),h=h.V;a.il.Fb(g);g.offset(-a.jd.x,-a.jd.y);h=a.h;c.G()?(k=b.x,l=b.y,d=c.x-g.x,e=c.y-g.y,b.n(d,e),c=!1,null!==h&&(d=h.$a,d.Kj?c=!0:!d.Bc||a instanceof fa||Fi(d,a,"position",new N(k,l),b,!1),c||b.x===k&&b.y===
l||(d=h.xb,h.xb=!0,a.j("position",new N(k,l),b),h.xb=d))):b.G()&&(d=b.x,e=b.y,b=c.copy(),c.n(d+g.x,e+g.y),c.O(b)||null===h||(d=h.xb,h.xb=!0,a.j("location",b,c),h.xb=d));x.A(g);a.Hi()}function kk(a,b,c){Nl(a,!1);a instanceof E&&ll(c,a);a.layer.Nc||b||c.xc();b=a.Yb;var d=c.Ab;d.G()?(Ri(a)?Db(b,d)||a.Lf(!1):b.Hg(d)&&a.Lf(!0),a.updateAdornments()):c.dl=!0}D.prototype.Vl=function(){return!0};
function dj(a,b){var c=a.Yb;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&a.isVisible()){var d=a.transform;null!==a.uc&&(Vl(a,b,a.uc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.uc&&null===a.Pb&&(Vl(a,b,"rgba(0,0,0,0.4)",!0,!1),b.fillRect(c.x,c.y,c.width,c.height));null!==a.Pb&&(d.Nt()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c=a.Ga,Vl(a,b,a.Pb,!0,!1),b.fillRect(0,0,c.width,c.height),d.Nt()||(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))))}}D.prototype.$d=function(){return!0};
x.defineProperty(D,{Lc:"category"},function(){return this.ui},function(a){var b=this.ui;if(b!==a){x.g(a,"string",D,"category");var c=this.h,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof fa)){var g=c.aa.qa;g.isEnabled&&!g.tb&&(e=this.clone(),e.wa.$c(this.wa))}this.ui=a;this.j("category",b,a);null===c||null===d||this instanceof fa?(e=this.lh,null!==e&&(a=e.Qg,null!==a&&a.remove(b),e.ul(this.Lc,this))):(g=c.aa,g.qa.tb||(this instanceof G?(g instanceof X?g.eG(d,a):g instanceof Ve&&g.UJ(d,
a),c=Zk(c,a),null!==c&&(Kf(c),c=c.copy(),null!==c&&oo(this,c,b,a))):(null!==g&&g.Wx(d,a),c=Wk(c,d,a),null!==c&&(Kf(c),c=c.copy(),null===c||c instanceof G||(c.location=this.location,oo(this,c,b,a)))),null!==e&&(b=this.clone(),b.wa.$c(this.wa),this.j("self",e,b))))}});x.defineProperty(D,{self:"self"},function(){return this},function(a){oo(this,a,this.Lc,a.Lc)});var po=!1;
function oo(a,b,c,d){b.constructor===a.constructor||po||(po=!0,x.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),x.trace("  Old class: "+x.kf(a)+", new class: "+x.kf(b)+", part: "+a.toString()));a.mt();var e=a.data;c=a.Jf;var g=a.lb,h=a.sh,k=!0,l=!0,m=!1;if(a instanceof E)var n=a,k=n.oj,l=n.xd,m=n.Du;b.mi(a);b.cloneProtected(a);a.ui=d;a.T();a.ua();b=a.h;d=!0;null!==b&&(d=b.xb,b.xb=!0);a.Ke=e;null!==e&&a.Ob();null!==b&&(b.xb=d);e=a.Jf;e!==c&&(a.Oj=c,
a.Jf=e);a instanceof E&&(n=a,n.oj=k,n.xd=l,n.Du=m,n.$d()&&n.J(64));a.lb=g;a.sh=h}D.prototype.canCopy=function(){if(!this.wE)return!1;var a=this.layer;if(null===a)return!0;if(!a.nk)return!1;a=a.h;return null===a?!0:a.nk?!0:!1};D.prototype.canDelete=function(){if(!this.BE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Zm)return!1;a=a.h;return null===a?!0:a.Zm?!0:!1};
D.prototype.canEdit=function(){if(!this.nG)return!1;var a=this.layer;if(null===a)return!0;if(!a.Pw)return!1;a=a.h;return null===a?!0:a.Pw?!0:!1};D.prototype.canGroup=function(){if(!this.$E)return!1;var a=this.layer;if(null===a)return!0;if(!a.Mw)return!1;a=a.h;return null===a?!0:a.Mw?!0:!1};D.prototype.canMove=function(){if(!this.AF)return!1;var a=this.layer;if(null===a)return!0;if(!a.yl)return!1;a=a.h;return null===a?!0:a.yl?!0:!1};
D.prototype.canReshape=function(){if(!this.PF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Nw)return!1;a=a.h;return null===a?!0:a.Nw?!0:!1};D.prototype.canResize=function(){if(!this.QF)return!1;var a=this.layer;if(null===a)return!0;if(!a.ht)return!1;a=a.h;return null===a?!0:a.ht?!0:!1};D.prototype.canRotate=function(){if(!this.VF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Ow)return!1;a=a.h;return null===a?!0:a.Ow?!0:!1};
D.prototype.canSelect=function(){if(!this.Ak)return!1;var a=this.layer;if(null===a)return!0;if(!a.yf)return!1;a=a.h;return null===a?!0:a.yf?!0:!1};x.defineProperty(D,{wE:"copyable"},function(){return 0!==(this.U&1)},function(a){var b=0!==(this.U&1);b!==a&&(u&&x.g(a,"boolean",D,"copyable"),this.U^=1,this.j("copyable",b,a))});
x.defineProperty(D,{BE:"deletable"},function(){return 0!==(this.U&2)},function(a){var b=0!==(this.U&2);b!==a&&(u&&x.g(a,"boolean",D,"deletable"),this.U^=2,this.j("deletable",b,a))});x.defineProperty(D,{nG:"textEditable"},function(){return 0!==(this.U&4)},function(a){var b=0!==(this.U&4);b!==a&&(u&&x.g(a,"boolean",D,"textEditable"),this.U^=4,this.j("textEditable",b,a),this.oe())});
x.defineProperty(D,{$E:"groupable"},function(){return 0!==(this.U&8)},function(a){var b=0!==(this.U&8);b!==a&&(u&&x.g(a,"boolean",D,"groupable"),this.U^=8,this.j("groupable",b,a))});x.defineProperty(D,{AF:"movable"},function(){return 0!==(this.U&16)},function(a){var b=0!==(this.U&16);b!==a&&(u&&x.g(a,"boolean",D,"movable"),this.U^=16,this.j("movable",b,a))});
x.defineProperty(D,{cG:"selectionAdorned"},function(){return 0!==(this.U&32)},function(a){var b=0!==(this.U&32);b!==a&&(u&&x.g(a,"boolean",D,"selectionAdorned"),this.U^=32,this.j("selectionAdorned",b,a),this.oe())});x.defineProperty(D,{vx:"isInDocumentBounds"},function(){return 0!==(this.U&64)},function(a){var b=0!==(this.U&64);if(b!==a){u&&x.g(a,"boolean",D,"isInDocumentBounds");this.U^=64;var c=this.h;null!==c&&c.xc();this.j("isInDocumentBounds",b,a)}});
x.defineProperty(D,{AA:"isLayoutPositioned"},function(){return 0!==(this.U&128)},function(a){var b=0!==(this.U&128);b!==a&&(u&&x.g(a,"boolean",D,"isLayoutPositioned"),this.U^=128,this.j("isLayoutPositioned",b,a),this.J(a?4:8))});x.defineProperty(D,{Ak:"selectable"},function(){return 0!==(this.U&256)},function(a){var b=0!==(this.U&256);b!==a&&(u&&x.g(a,"boolean",D,"selectable"),this.U^=256,this.j("selectable",b,a),this.oe())});
x.defineProperty(D,{PF:"reshapable"},function(){return 0!==(this.U&512)},function(a){var b=0!==(this.U&512);b!==a&&(u&&x.g(a,"boolean",D,"reshapable"),this.U^=512,this.j("reshapable",b,a),this.oe())});x.defineProperty(D,{QF:"resizable"},function(){return 0!==(this.U&1024)},function(a){var b=0!==(this.U&1024);b!==a&&(u&&x.g(a,"boolean",D,"resizable"),this.U^=1024,this.j("resizable",b,a),this.oe())});
x.defineProperty(D,{VF:"rotatable"},function(){return 0!==(this.U&2048)},function(a){var b=0!==(this.U&2048);b!==a&&(u&&x.g(a,"boolean",D,"rotatable"),this.U^=2048,this.j("rotatable",b,a),this.oe())});
x.defineProperty(D,{lb:"isSelected"},function(){return 0!==(this.U&4096)},function(a){var b=0!==(this.U&4096);if(b!==a){u&&x.g(a,"boolean",D,"isSelected");var c=this.h;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.nJ)){this.U^=4096;var d=!1;if(null!==c){d=c.xb;c.xb=!0;var e=c.selection;e.Va();a?e.add(this):e.remove(this);e.freeze()}this.j("isSelected",b,a);this.oe();a=this.SJ;null!==a&&a(this);null!==c&&(c.Be(),c.xb=d)}}});
x.defineProperty(D,{sh:"isHighlighted"},function(){return 0!==(this.U&524288)},function(a){var b=0!==(this.U&524288);if(b!==a){u&&x.g(a,"boolean",D,"isHighlighted");this.U^=524288;var c=this.h;null!==c&&(c=c.rn,c.Va(),a?c.add(this):c.remove(this),c.freeze());this.j("isHighlighted",b,a);this.ua()}});x.defineProperty(D,{xk:"isShadowed"},function(){return 0!==(this.U&8192)},function(a){var b=0!==(this.U&8192);b!==a&&(u&&x.g(a,"boolean",D,"isShadowed"),this.U^=8192,this.j("isShadowed",b,a),this.ua())});
function Zj(a){return 0!==(a.U&32768)}function jo(a,b){a.U=b?a.U|32768:a.U&-32769}function Nl(a,b){a.U=b?a.U|65536:a.U&-65537}function Ri(a){return 0!==(a.U&131072)}D.prototype.Lf=function(a){this.U=a?this.U|131072:this.U&-131073};function qo(a,b){a.U=b?a.U|1048576:a.U&-1048577}x.defineProperty(D,{gF:"isAnimated"},function(){return 0!==(this.U&262144)},function(a){var b=0!==(this.U&262144);b!==a&&(u&&x.g(a,"boolean",D,"isAnimated"),this.U^=262144,this.j("isAnimated",b,a))});
x.defineProperty(D,{Vx:"selectionObjectName"},function(){return this.Cs},function(a){var b=this.Cs;b!==a&&(u&&x.g(a,"string",D,"selectionObjectName"),this.Cs=a,this.Qm=null,this.j("selectionObjectName",b,a))});x.defineProperty(D,{RJ:"selectionAdornmentTemplate"},function(){return this.As},function(a){var b=this.As;b!==a&&(u&&x.l(a,fa,D,"selectionAdornmentTemplate"),this instanceof G&&(a.type=rh),this.As=a,this.j("selectionAdornmentTemplate",b,a))});
x.w(D,{Dn:"selectionObject"},function(){if(null===this.Qm){var a=this.Vx;null!==a&&""!==a?(a=this.me(a),this.Qm=null!==a?a:this):this instanceof G?(a=this.path,this.Qm=null!==a?a:this):this.Qm=this}return this.Qm});x.defineProperty(D,{SJ:"selectionChanged"},function(){return this.Bs},function(a){var b=this.Bs;b!==a&&(null!==a&&x.g(a,"function",D,"selectionChanged"),this.Bs=a,this.j("selectionChanged",b,a))});
x.defineProperty(D,{RF:"resizeAdornmentTemplate"},function(){return this.ns},function(a){var b=this.ns;b!==a&&(u&&x.l(a,fa,D,"resizeAdornmentTemplate"),this.ns=a,this.j("resizeAdornmentTemplate",b,a))});x.defineProperty(D,{TF:"resizeObjectName"},function(){return this.ps},function(a){var b=this.ps;b!==a&&(u&&x.g(a,"string",D,"resizeObjectName"),this.ps=a,this.Qo=null,this.j("resizeObjectName",b,a))});
x.w(D,{SF:"resizeObject"},function(){if(null===this.Qo){var a=this.TF;null!==a&&""!==a?(a=this.me(a),this.Qo=null!==a?a:this):this.Qo=this}return this.Qo});x.defineProperty(D,{JJ:"resizeCellSize"},function(){return this.os},function(a){var b=this.os;b.O(a)||(u&&x.l(a,Fa,D,"resizeCellSize"),this.os=a=a.Y(),this.j("resizeCellSize",b,a))});
x.defineProperty(D,{LJ:"rotateAdornmentTemplate"},function(){return this.qs},function(a){var b=this.qs;b!==a&&(u&&x.l(a,fa,D,"rotateAdornmentTemplate"),this.qs=a,this.j("rotateAdornmentTemplate",b,a))});x.defineProperty(D,{MJ:"rotateObjectName"},function(){return this.rs},function(a){var b=this.rs;b!==a&&(u&&x.g(a,"string",D,"rotateObjectName"),this.rs=a,this.Ro=null,this.j("rotateObjectName",b,a))});
x.w(D,{WF:"rotateObject"},function(){if(null===this.Ro){var a=this.MJ;null!==a&&""!==a?(a=this.me(a),this.Ro=null!==a?a:this):this.Ro=this}return this.Ro});x.defineProperty(D,{text:"text"},function(){return this.we},function(a){var b=this.we;b!==a&&(u&&x.g(a,"string",D,"text"),this.we=a,this.j("text",b,a))});
x.defineProperty(D,{Xa:"containingGroup"},function(){return this.Uk},function(a){if(this.$d()){var b=this.Uk;if(b!==a){u&&null!==a&&x.l(a,F,D,"containingGroup");null===a||this!==a&&!a.pi(this)||(this===a&&x.k("Cannot make a Group a member of itself: "+this.toString()),x.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.J(ok);var c=this.h;null!==b?ro(b,this):this instanceof F&&null!==c&&c.sl.remove(this);this.Uk=a;null!==a?so(a,this):this instanceof
F&&null!==c&&c.sl.add(this);this.J(gk);if(null!==c){var d=this.data,e=c.aa;null!==d&&e instanceof X&&e.Yx(d,e.sb(null!==a?a.data:null))}d=this.sE;null!==d&&(e=!0,null!==c&&(e=c.Za,c.Za=!0),d(this,b,a),null!==c&&(c.Za=e));if(this instanceof F)for(c=new K(D),If(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof E)for(d=d.ce;d.next();)Uk(d.value);if(this instanceof E)for(d=this.ce;d.next();)Uk(d.value);this.j("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&gj(b,-1,a))}}else x.k("cannot set the Part.containingGroup of a Link or Adornment")});
f=D.prototype;f.Sl=function(){var a=this.Xa;null!==a&&(a.T(),null!==a.Nb&&a.Nb.T(),a.mf())};f.ua=function(){var a=this.h;null!==a&&!Yj(this)&&!Zj(this)&&this.isVisible()&&this.Yb.G()&&a.ua(fj(this,this.Yb))};f.It=function(a){a||(a=this.Uk,null!==a&&so(a,this))};f.Jt=function(a){a||(a=this.Uk,null!==a&&ro(a,this))};f.ln=function(){var a=this.data;if(null!==a){var b=this.h;null!==b&&(b=b.aa,null!==b&&b.Qx(a))}};
x.defineProperty(D,{sE:"containingGroupChanged"},function(){return this.Fq},function(a){var b=this.Fq;b!==a&&(null!==a&&x.g(a,"function",D,"containingGroupChanged"),this.Fq=a,this.j("containingGroupChanged",b,a))});D.prototype.findSubGraphLevel=function(){return to(this,this)};function to(a,b){var c=b.Xa;return null!==c?1+to(a,c):b instanceof E&&(c=b.Od,null!==c)?to(a,c):0}D.prototype.findTopLevelPart=function(){return uo(this,this)};
function uo(a,b){var c=b.Xa;return null!==c?uo(a,c):b instanceof E&&(c=b.Od,null!==c)?uo(a,c):b}x.w(D,{Gp:"isTopLevel"},function(){return null!==this.Xa||this instanceof E&&this.Ef?!1:!0});D.prototype.isMemberOf=D.prototype.pi=function(a){return a instanceof F?vo(this,this,a):!1};function vo(a,b,c){if(b===c||null===c)return!1;var d=b.Xa;return null===d||d!==c&&!vo(a,d,c)?b instanceof E&&(b=b.Od,null!==b)?vo(a,b,c):!1:!0}
D.prototype.findCommonContainingGroup=D.prototype.lI=function(a){if(null===a)return null;u&&x.l(a,D,D,"findCommonContainingGroup:other");if(this===a)return this.Xa;for(var b=this;null!==b;)b instanceof F&&qo(b,!0),b=b.Xa;for(var c=null,b=a;null!==b;){if(0!==(b.U&1048576)){c=b;break}b=b.Xa}for(b=this;null!==b;)b instanceof F&&qo(b,!1),b=b.Xa;return c};
x.defineProperty(D,{cJ:"layoutConditions"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(u&&x.g(a,"number",D,"layoutConditions"),this.yr=a,this.j("layoutConditions",b,a))});D.prototype.canLayout=function(){if(!this.AA||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Nc||this instanceof E&&this.Ef?!1:!0};
D.prototype.invalidateLayout=D.prototype.J=function(a){void 0===a&&(a=16777215);var b;this.AA&&0!==(a&this.cJ)?(b=this.layer,null!==b&&b.Nc||this instanceof E&&this.Ef?b=!1:(b=this.h,b=null!==b&&b.qa.tb?!1:!0)):b=!1;if(b)if(b=this.Uk,null!==b){var c=b.Tb;null!==c?c.J():b.J(a)}else a=this.h,null!==a&&(c=a.Tb,null!==c&&c.J())};function lk(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Nc?!1:!0}
x.defineProperty(D,{GE:"dragComputation"},function(){return this.Vq},function(a){var b=this.Vq;b!==a&&(null!==a&&x.g(a,"function",D,"dragComputation"),this.Vq=a,this.j("dragComputation",b,a))});x.defineProperty(D,{XJ:"shadowOffset"},function(){return this.Rm},function(a){var b=this.Rm;b.O(a)||(u&&x.l(a,N,D,"shadowOffset"),this.Rm=a=a.Y(),this.ua(),this.j("shadowOffset",b,a))});
x.defineProperty(D,{shadowColor:"shadowColor"},function(){return this.jh},function(a){var b=this.jh;b!==a&&(u&&x.g(a,"string",D,"shadowColor"),this.jh=a,this.ua(),this.j("shadowColor",b,a))});x.defineProperty(D,{shadowBlur:"shadowBlur"},function(){return this.di},function(a){var b=this.di;b!==a&&(u&&x.g(a,"number",D,"shadowBlur"),this.di=a,this.ua(),this.j("shadowBlur",b,a))});
function fa(a){0===arguments.length?D.call(this,Mh):D.call(this,a);this.U&=-257;this.Oj="Adornment";this.Nb=this.Tg=this.Kb=null}x.Qa(fa,D);x.ja("Adornment",fa);fa.prototype.toString=function(){var a=this.lh;return"Adornment("+this.Lc+")"+(null!==a?a.toString():"")};fa.prototype.updateRelationshipsFromData=function(){};
fa.prototype.Yt=function(a){var b=this.oc.ea,c=this.oc;if(b instanceof G&&c instanceof Y){var d=b.path,c=d.bb;b.Yt(a);c=d.bb;a=this.wa.o;b=a.length;for(d=0;d<b;d++){var e=a[d];e.Gf&&e instanceof Y&&(e.bb=c)}}};x.w(fa,{placeholder:"placeholder"},function(){return this.Nb});
x.defineProperty(fa,{oc:"adornedObject"},function(){return this.Kb},function(a){u&&null!==a&&x.l(a,O,D,"adornedObject:value");var b=this.lh,c=null;null!==a&&(c=a.ea);null===b||null!==a&&b===c||b.Zl(this.Lc);this.Kb=a;null!==c&&c.ul(this.Lc,this)});x.w(fa,{lh:"adornedPart"},function(){var a=this.Kb;return null!==a?a.ea:null});fa.prototype.Vl=function(){var a=this.Kb;if(null===a)return!0;a=a.ea;return null===a||!Yj(a)};fa.prototype.$d=function(){return!1};x.w(fa,{Xa:"containingGroup"},function(){return null});
fa.prototype.Bn=function(a,b,c,d,e,g,h){if(a===ye&&"elements"===b)if(e instanceof Gh){var k=e;null===this.Nb?this.Nb=k:this.Nb!==k&&x.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof H&&(k=e.vt(function(a){return a instanceof Gh}),k instanceof Gh&&(null===this.Nb?this.Nb=k:this.Nb!==k&&x.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===ze&&"elements"===b&&null!==this.Nb&&(d===this.Nb?this.Nb=null:d instanceof H&&
this.Nb.Ul(d)&&(this.Nb=null));D.prototype.Bn.call(this,a,b,c,d,e,g,h)};fa.prototype.updateAdornments=function(){};fa.prototype.ln=function(){};function E(a){0===arguments.length?D.call(this,Mh):D.call(this,a);this.nc=new J(G);this.Eo=this.hl=this.Ar=this.zr=null;this.rr=!0;this.Xs=!1;this.Ts=null;this.yq=this.sr=!0;this.zq=Q.PG;this.Fd=this.Lh=null;this.fs=wo;this.kk=!1}x.Qa(E,D);x.ja("Node",E);
E.prototype.cloneProtected=function(a){D.prototype.cloneProtected.call(this,a);a.zr=this.zr;a.Ar=this.Ar;a.hl=this.hl;a.rr=this.rr;a.Xs=this.Xs;a.Ts=this.Ts;a.sr=this.sr;a.yq=this.yq;a.zq=this.zq.Y();a.fs=this.fs};E.prototype.mi=function(a){D.prototype.mi.call(this,a);a.mf();a.Lh=this.Lh;a.Fd=null};var xo;E.DirectionDefault=xo=x.s(E,"DirectionDefault",0);E.DirectionAbsolute=x.s(E,"DirectionAbsolute",1);var yo;E.DirectionRotatedNode=yo=x.s(E,"DirectionRotatedNode",2);var El;
E.DirectionRotatedNodeOrthogonal=El=x.s(E,"DirectionRotatedNodeOrthogonal",3);E.SpreadingNone=x.s(E,"SpreadingNone",10);var wo;E.SpreadingEvenly=wo=x.s(E,"SpreadingEvenly",11);var zo;E.SpreadingPacked=zo=x.s(E,"SpreadingPacked",12);function Ao(a,b){null!==b&&(null===a.Lh&&(a.Lh=new K(qj)),a.Lh.add(b))}
function Bo(a,b,c,d){if(null===b||null===a.Lh)return null;for(var e=a.Lh.i;e.next();){var g=e.value;if(g.Tp===a&&g.cu===b&&g.Kx===c&&g.Lx===d||g.Tp===b&&g.cu===a&&g.Kx===d&&g.Lx===c)return g}return null}E.prototype.invalidateLinkBundle=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=Bo(this,a,b,c);null!==a&&a.sn()};
E.prototype.Bn=function(a,b,c,d,e,g,h){a===ye&&"elements"===b?this.Fd=null:a===ze&&"elements"===b&&(null===this.h?this.Fd=null:d instanceof O&&jn(this,d,function(a,b){gm(a,b,!0)}));D.prototype.Bn.call(this,a,b,c,d,e,g,h)};E.prototype.invalidateConnectedLinks=E.prototype.mf=function(a){void 0===a&&(a=null);for(var b=this.ce;b.next();){var c=b.value;null!==a&&a.contains(c)||(Co(this,c.ad),Co(this,c.Ad),c.rc())}};function Co(a,b){if(null!==b){b.Km=null;var c=a.Xa;null===c||c.re||Co(c,c.Ll(""))}}
E.prototype.Vl=function(){return!0};x.defineProperty(E,{DJ:"portSpreading"},function(){return this.fs},function(a){var b=this.fs;b!==a&&(u&&x.Ca(a,E,E,"portSpreading"),this.fs=a,this.j("portSpreading",b,a),a=this.h,null!==a&&a.qa.tb||this.mf())});x.defineProperty(E,{jE:"avoidable"},function(){return this.yq},function(a){var b=this.yq;if(b!==a){u&&x.g(a,"boolean",E,"avoidable");this.yq=a;var c=this.h;null!==c&&ll(c,this);this.j("avoidable",b,a)}});
x.defineProperty(E,{yH:"avoidableMargin"},function(){return this.zq},function(a){"number"===typeof a?a=new yb(a):x.l(a,yb,E,"avoidableMargin");var b=this.zq;if(!b.O(a)){this.zq=a=a.Y();var c=this.h;null!==c&&ll(c,this);this.j("avoidableMargin",b,a)}});E.prototype.canAvoid=function(){return this.jE&&!this.Ef};E.prototype.getAvoidableRect=function(a){a.set(this.ba);a.Kw(this.yH);return a};E.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.Xa;return a};
E.prototype.isVisible=function(){if(!D.prototype.isVisible.call(this))return!1;var a=!0,b=!0,c=this.h;if(null!==c){a=c.$a;if(a.Df&&(a=a.ml.oa(this),null!==a&&a.Ox))return!0;a=c.ae;b=c.sB===mj}if(b){if(c=this.nn(),null!==c&&!c.xd)return!1}else if(c=a?this.nI():this.oI(),0<c.count&&c.all(function(a){return!a.xd}))return!1;c=this.Od;return null!==c?c.isVisible():!0};E.prototype.Qd=function(a){D.prototype.Qd.call(this,a);for(var b=this.ce;b.next();)b.value.Qd(a)};x.w(E,{ce:"linksConnected"},function(){return this.nc.i});
E.prototype.findLinksConnected=E.prototype.OE=function(a){void 0===a&&(a=null);if(null===a)return this.nc.i;u&&x.g(a,"string",E,"findLinksConnected:pid");var b=new Wa(this.nc),c=this;b.zn=function(b){return b.Z===c&&b.bg===a||b.fa===c&&b.Og===a};return b};E.prototype.findLinksOutOf=E.prototype.jx=function(a){void 0===a&&(a=null);u&&null!==a&&x.g(a,"string",E,"findLinksOutOf:pid");var b=new Wa(this.nc),c=this;b.zn=function(b){return b.Z!==c?!1:null===a?!0:b.bg===a};return b};
E.prototype.findLinksInto=E.prototype.Fg=function(a){void 0===a&&(a=null);u&&null!==a&&x.g(a,"string",E,"findLinksInto:pid");var b=new Wa(this.nc),c=this;b.zn=function(b){return b.fa!==c?!1:null===a?!0:b.Og===a};return b};
E.prototype.findNodesConnected=E.prototype.PE=function(a){void 0===a&&(a=null);u&&null!==a&&x.g(a,"string",E,"findNodesConnected:pid");for(var b=null,c=null,d=this.nc.i;d.next();){var e=d.value;if(e.Z===this){if(null===a||e.bg===a)e=e.fa,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e}else e.fa!==this||null!==a&&e.Og!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Sa(c):Ra};
E.prototype.findNodesOutOf=E.prototype.oI=function(a){void 0===a&&(a=null);u&&null!==a&&x.g(a,"string",E,"findNodesOutOf:pid");for(var b=null,c=null,d=this.nc.i;d.next();){var e=d.value;e.Z!==this||null!==a&&e.bg!==a||(e=e.fa,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Sa(c):Ra};
E.prototype.findNodesInto=E.prototype.nI=function(a){void 0===a&&(a=null);u&&null!==a&&x.g(a,"string",E,"findNodesInto:pid");for(var b=null,c=null,d=this.nc.i;d.next();){var e=d.value;e.fa!==this||null!==a&&e.Og!==a||(e=e.Z,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Sa(c):Ra};
E.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);u&&(x.l(a,E,E,"findLinksBetween:othernode"),null!==b&&x.g(b,"string",E,"findLinksBetween:pid"),null!==c&&x.g(c,"string",E,"findLinksBetween:otherpid"));var d=new Wa(this.nc),e=this;d.zn=function(d){return(d.Z!==e||d.fa!==a||null!==b&&d.bg!==b||null!==c&&d.Og!==c)&&(d.Z!==a||d.fa!==e||null!==c&&d.bg!==c||null!==b&&d.Og!==b)?!1:!0};return d};
E.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);u&&(x.l(a,E,E,"findLinksTo:othernode"),null!==b&&x.g(b,"string",E,"findLinksTo:pid"),null!==c&&x.g(c,"string",E,"findLinksTo:otherpid"));var d=new Wa(this.nc),e=this;d.zn=function(d){return d.Z!==e||d.fa!==a||null!==b&&d.bg!==b||null!==c&&d.Og===c?!1:!0};return d};
x.defineProperty(E,{eJ:"linkConnected"},function(){return this.zr},function(a){var b=this.zr;b!==a&&(null!==a&&x.g(a,"function",E,"linkConnected"),this.zr=a,this.j("linkConnected",b,a))});x.defineProperty(E,{fJ:"linkDisconnected"},function(){return this.Ar},function(a){var b=this.Ar;b!==a&&(null!==a&&x.g(a,"function",E,"linkDisconnected"),this.Ar=a,this.j("linkDisconnected",b,a))});
x.defineProperty(E,{Cx:"linkValidation"},function(){return this.hl},function(a){var b=this.hl;b!==a&&(null!==a&&x.g(a,"function",E,"linkValidation"),this.hl=a,this.j("linkValidation",b,a))});
function Do(a,b,c){Co(a,c);if(!a.nc.contains(b)){a.nc.add(b);var d=a.eJ;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Za,g.Za=!0);d(a,b,c);null!==g&&(g.Za=e)}b.Oc&&(c=b.Z,b=b.fa,null!==c&&null!==b&&c!==b&&(d=!0,g=a.h,null!==g&&(d=g.ae),a=d?b:c,e=d?c:b,a.kk||(a.kk=e),!e.oj||null!==g&&g.qa.tb||(d?c===e&&(e.oj=!1):b===e&&(e.oj=!1))))}}
function Eo(a,b,c){Co(a,c);if(a.nc.remove(b)){var d=a.fJ,e=a.h;if(null!==d){var g=!0;null!==e&&(g=e.Za,e.Za=!0);d(a,b,c);null!==e&&(e.Za=g)}b.Oc&&(c=!0,null!==e&&(c=e.ae),a=c?b.fa:b.Z,b=c?b.Z:b.fa,null!==a&&(a.kk=!1),null===b||b.oj||(0===b.nc.count?(b.kk=null,null!==e&&e.qa.tb||(b.oj=!0)):fl(b)))}}
function fl(a){a.kk=!1;if(0!==a.nc.count){var b=!0,c=a.h;if(null===c||!c.qa.tb){null!==c&&(b=c.ae);for(c=a.nc.i;c.next();){var d=c.value;if(d.Oc)if(b){if(d.Z===a){a.oj=!1;return}}else if(d.fa===a){a.oj=!1;return}}a.oj=!0}}}
E.prototype.updateRelationshipsFromData=function(){D.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.aa;if(c instanceof Ve){var d=c.qn(a),b=b.hf(d),e=this.nn();b!==e&&(b=null!==e?c.sb(e.data):void 0,e=c.Vp,"function"===typeof e?e(a,b):a[e]=b,c.Hh(a,d))}}}};E.prototype.It=function(a){D.prototype.It.call(this,a);a||(fl(this),a=this.Eo,null!==a&&Fo(a,this))};
E.prototype.Jt=function(a){D.prototype.Jt.call(this,a);a||(a=this.Eo,null!==a&&null!==a.Me&&(a.Me.remove(this),a.T()))};E.prototype.ln=function(){if(0<this.nc.count){var a=this.h;if(null!==a)for(var b=a.zb.FE,c=this.nc.copy().i;c.next();){var d=c.value;b?a.remove(d):(d.Z===this&&(d.Z=null),d.fa===this&&(d.fa=null))}}this.Od=null;D.prototype.ln.call(this)};x.w(E,{Ef:"isLinkLabel"},function(){return null!==this.Eo});
x.defineProperty(E,{Od:"labeledLink"},function(){return this.Eo},function(a){var b=this.Eo;if(b!==a){u&&null!==a&&x.l(a,G,E,"labeledLink");var c=this.h,d=this.data;if(null!==b&&(null!==b.Me&&(b.Me.remove(this),b.T()),null!==c&&null!==d&&!c.qa.tb)){var e=b.data,g=c.aa;if(null!==e&&g instanceof X){var h=g.sb(d);void 0!==h&&g.KF(e,h)}}this.Eo=a;null!==a&&(Fo(a,this),null===c||null===d||c.qa.tb||(e=a.data,g=c.aa,null!==e&&g instanceof X&&(h=g.sb(d),void 0!==h&&g.Uz(e,h))));am(this);this.j("labeledLink",
b,a)}});E.prototype.findPort=E.prototype.Ll=function(a){u&&x.g(a,"string",E,"findPort:pid");if(null===this.Fd){if(""===a&&!1===this.Th)return this;hm(this)}var b=this.Fd.oa(a);return null!==b||""!==a&&(b=this.Fd.oa(""),null!==b)?b:this};x.w(E,{port:"port"},function(){return this.Ll("")});x.w(E,{ports:"ports"},function(){null===this.Fd&&hm(this);return this.Fd.rF});
function hm(a){null===a.Fd?a.Fd=new ra("string",O):a.Fd.clear();jn(a,a,function(a,c){var d=c.zd;null!==d&&a.Fd.add(d,c)});0===a.Fd.count&&a.Fd.add("",a)}function gm(a,b,c){var d=b.zd;if(null!==d&&(null!==a.Fd&&a.Fd.remove(d),b=a.h,null!==b&&c)){c=null;for(d=a.OE(d);d.next();)a=d.value,null===c&&(c=x.ub()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);x.xa(c)}}}
E.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.h;null!==c&&(b=c.ae);c=this;if(b)for(;c!==a;){for(var b=null,d=c.nc.i;d.next();){var e=d.value;if(e.Oc&&(b=e.Z,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.nc.i;d.next()&&(e=d.value,!e.Oc||(b=e.fa,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
E.prototype.findTreeRoot=function(){var a=!0,b=this.h;null!==b&&(a=b.ae);b=this;if(a)for(;;){for(var a=null,c=b.nc.i;c.next();){var d=c.value;if(d.Oc&&(a=d.Z,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.nc.i;c.next()&&(d=c.value,!d.Oc||(a=d.fa,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
E.prototype.findCommonTreeParent=function(a){if(null===a)return null;u&&x.l(a,E,E,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)qo(b,!0),b=b.nn();for(var c=null,b=a;null!==b;){if(0!==(b.U&1048576)){c=b;break}b=b.nn()}for(b=this;null!==b;)qo(b,!1),b=b.nn();return c};
E.prototype.findTreeParentLink=E.prototype.zt=function(){var a=!0,b=this.h;null!==b&&(a=b.ae);b=this.nc.i;if(a)for(;b.next();){if(a=b.value,a.Oc&&a.Z!==this)return a}else for(;b.next();)if(a=b.value,a.Oc&&a.fa!==this)return a;return null};
E.prototype.findTreeParentNode=E.prototype.nn=function(){var a=this.kk;if(null===a)return null;if(a instanceof E)return a;var b=!0,a=this.h;null!==a&&(b=a.ae);a=this.nc.i;if(b)for(;a.next();){if(b=a.value,b.Oc&&(b=b.Z,b!==this))return this.kk=b}else for(;a.next();)if(b=a.value,b.Oc&&(b=b.fa,b!==this))return this.kk=b;return this.kk=null};E.prototype.findTreeLevel=function(){return Go(this,this)};function Go(a,b){var c=b.nn();return null===c?0:1+Go(a,c)}
E.prototype.findTreeChildrenLinks=E.prototype.lx=function(){var a=!0,b=this.h;null!==b&&(a=b.ae);if(a){var a=new Wa(this.nc),c=this;a.zn=function(a){return a.Oc&&a.Z===c?!0:!1}}else a=new Wa(this.nc),c=this,a.zn=function(a){return a.Oc&&a.fa===c?!0:!1};return a};
E.prototype.findTreeChildrenNodes=E.prototype.RE=function(){var a=!0,b=this.h;null!==b&&(a=b.ae);var c=b=null,d=this.nc.i;if(a)for(;d.next();)a=d.value,a.Oc&&a.Z===this&&(a=a.fa,null!==b?b.add(a):null!==c&&c!==a?(b=new J(E),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.Oc&&a.fa===this&&(a=a.Z,null!==b?b.add(a):null!==c&&c!==a?(b=new J(E),b.add(c),b.add(a)):c=a);return null!==b?b.i:null!==c?new Sa(c):Ra};
E.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);x.g(a,"number",E,"collapseTree:level");var b=new K(D);If(b,this,!1,a,!0);return b};E.prototype.collapseTree=E.prototype.collapseTree=function(a){void 0===a&&(a=1);x.p(a,E,"collapseTree:level");1>a&&(a=1);var b=this.h;if(null!==b&&!b.rh){b.rh=!0;var c=new K(E);c.add(this);Ho(this,c,b.ae,a,b.$a,this,b.sB===mj);b.rh=!1}};
function Ho(a,b,c,d,e,g,h){if(1<d)for(var k=c?a.jx():a.Fg();k.next();){var l=k.value;l.Oc&&(l=l.rA(a),null===l||l===a||b.contains(l)||(b.add(l),Ho(l,b,c,d-1,e,g,h)))}else Io(a,b,c,e,g,h)}function Io(a,b,c,d,e,g){for(var h=e===a?!0:a.xd,k=c?a.jx():a.Fg();k.next();){var l=k.value;l.Oc&&(l=l.rA(a),null===l||l===a||b.contains(l)||(b.add(l),h&&(g&&Oi(d,l,e),l.Sl(),l.Qd(!1)),l.xd&&(l.Du=l.xd,Io(l,b,c,d,e,g))))}a.xd=!1}
E.prototype.expandTree=E.prototype.expandTree=function(a){void 0===a&&(a=2);x.p(a,E,"expandTree:level");2>a&&(a=2);var b=this.h;if(null!==b&&!b.rh){b.rh=!0;var c=new K(E);c.add(this);Jo(this,c,b.ae,a,b.$a,this,b.sB===mj);b.rh=!1}};function Jo(a,b,c,d,e,g,h){for(var k=g===a?!1:a.xd,l=c?a.jx():a.Fg();l.next();){var m=l.value;m.Oc&&(k||m.Yf||m.rc(),m=m.rA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.Qd(!0),m.Sl(),h&&Ni(e,m,g)),2<d||m.Du))&&(m.Du=!1,Jo(m,b,c,d-1,e,g,h))}a.xd=!0}
x.defineProperty(E,{xd:"isTreeExpanded"},function(){return this.rr},function(a){var b=this.rr;if(b!==a){u&&x.g(a,"boolean",E,"isTreeExpanded");this.rr=a;var c=this.h;this.j("isTreeExpanded",b,a);b=this.jK;if(null!==b){var d=!0;null!==c&&(d=c.Za,c.Za=!0);b(this);null!==c&&(c.Za=d)}null!==c&&c.qa.tb?this.Qd(a):a?this.expandTree():this.collapseTree()}});
x.defineProperty(E,{Du:"wasTreeExpanded"},function(){return this.Xs},function(a){var b=this.Xs;b!==a&&(u&&x.g(a,"boolean",E,"wasTreeExpanded"),this.Xs=a,this.j("wasTreeExpanded",b,a))});x.defineProperty(E,{jK:"treeExpandedChanged"},function(){return this.Ts},function(a){var b=this.Ts;b!==a&&(null!==a&&x.g(a,"function",E,"treeExpandedChanged"),this.Ts=a,this.j("treeExpandedChanged",b,a))});
x.defineProperty(E,{oj:"isTreeLeaf"},function(){return this.sr},function(a){var b=this.sr;b!==a&&(u&&x.g(a,"boolean",E,"isTreeLeaf"),this.sr=a,this.j("isTreeLeaf",b,a))});
function G(){D.call(this,rh);this.og=null;this.Sh="";this.zg=this.cr=null;this.hi="";this.Ss=null;this.ms=this.ls=this.ks=!1;this.tr=!0;this.sq=uh;this.Jq=0;this.Mq=uh;this.Nq=NaN;this.Mm=rm;this.Is=.5;this.Me=null;this.Yc=(new J(N)).freeze();this.So=this.Oe=null;this.Yf=!1;this.gw=null;this.Hz=!1;this.Tg=this.fo=this.ao=this.ti=this.Fi=this.bb=null;this.Lz=new N;this.GD=this.ED=null;this.Jy=!1;this.ma=null}x.Qa(G,D);x.ja("Link",G);
G.prototype.cloneProtected=function(a){D.prototype.cloneProtected.call(this,a);a.Sh=this.Sh;a.cr=this.cr;a.hi=this.hi;a.Ss=this.Ss;a.ks=this.ks;a.ls=this.ls;a.ms=this.ms;a.tr=this.tr;a.sq=this.sq;a.Jq=this.Jq;a.Mq=this.Mq;a.Nq=this.Nq;a.Mm=this.Mm;a.Is=this.Is;null!==this.ma&&(a.ma=this.ma.copy())};G.prototype.mi=function(a){D.prototype.mi.call(this,a);this.Sh=a.Sh;this.hi=a.hi;a.Oe=null;a.rc();a.ti=this.ti};var rm;G.Normal=rm=x.s(G,"Normal",1);G.Orthogonal=x.s(G,"Orthogonal",2);
G.AvoidsNodes=x.s(G,"AvoidsNodes",6);var Ko;G.AvoidsNodesStraight=Ko=x.s(G,"AvoidsNodesStraight",7);var uh;G.None=uh=x.s(G,"None",0);var Bh;G.Bezier=Bh=x.s(G,"Bezier",9);var th;G.JumpGap=th=x.s(G,"JumpGap",10);var sh;G.JumpOver=sh=x.s(G,"JumpOver",11);var om;G.End=om=x.s(G,"End",17);var pm;G.Scale=pm=x.s(G,"Scale",18);var qm;G.Stretch=qm=x.s(G,"Stretch",19);var Bn;G.OrientAlong=Bn=x.s(G,"OrientAlong",21);var Lo;G.OrientPlus90=Lo=x.s(G,"OrientPlus90",22);var Mo;
G.OrientMinus90=Mo=x.s(G,"OrientMinus90",23);var No;G.OrientOpposite=No=x.s(G,"OrientOpposite",24);var Oo;G.OrientUpright=Oo=x.s(G,"OrientUpright",25);var Po;G.OrientPlus90Upright=Po=x.s(G,"OrientPlus90Upright",26);var Qo;G.OrientMinus90Upright=Qo=x.s(G,"OrientMinus90Upright",27);var Ro;G.OrientUpright45=Ro=x.s(G,"OrientUpright45",28);G.prototype.Ve=function(){null===this.ma&&(this.ma=new Dl)};
G.prototype.Vl=function(){var a=this.Z;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Yj(a)||Zj(a))return!1}a=this.fa;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Yj(a)||Zj(a))?!1:!0};G.prototype.iB=function(){return!1};G.prototype.$d=function(){return!1};
G.prototype.computeAngle=function(a,b,c){a=0;switch(b){default:case uh:a=0;break;case Bn:a=c;break;case Lo:a=c+90;break;case Mo:a=c-90;break;case No:a=c+180;break;case Oo:a=Q.eu(c);90<a&&270>a&&(a-=180);break;case Po:a=Q.eu(c+90);90<a&&270>a&&(a-=180);break;case Qo:a=Q.eu(c-90);90<a&&270>a&&(a-=180);break;case Ro:a=Q.eu(c);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Q.eu(a)};
x.defineProperty(G,{Z:"fromNode"},function(){return this.og},function(a){var b=this.og;if(b!==a){u&&null!==a&&x.l(a,E,G,"fromNode");var c=this.ad;null!==b&&(this.zg!==b&&Eo(b,this,c),So(this),this.J(ok));this.og=a;null!==a&&this.Qd(a.isVisible());this.Fi=null;this.rc();var d=this.h;if(null!==d){var e=this.data,g=d.aa;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.Xx(e,g.sb(h))}else g instanceof Ve&&(h=null!==a?a.data:null,d.ae?g.Hh(e,g.sb(h)):(null!==b&&g.Hh(b.data,void 0),g.Hh(h,g.sb(null!==
this.zg?this.zg.data:null))))}e=this.ad;g=this.UE;null!==g&&(h=!0,null!==d&&(h=d.Za,d.Za=!0),g(this,c,e),null!==d&&(d.Za=h));null!==a&&(this.zg!==a&&Do(a,this,e),To(this),this.J(gk));this.j("fromNode",b,a);Uk(this)}});
x.defineProperty(G,{bg:"fromPortId"},function(){return this.Sh},function(a){var b=this.Sh;if(b!==a){u&&x.g(a,"string",G,"fromPortId");var c=this.ad;null!==c&&Co(this.Z,c);So(this);this.Sh=a;var d=this.ad;null!==d&&Co(this.Z,d);var e=this.h;if(null!==e){var g=this.data,h=e.aa;null!==g&&h instanceof X&&h.gB(g,a)}c!==d&&(this.Fi=null,this.rc(),g=this.UE,null!==g&&(h=!0,null!==e&&(h=e.Za,e.Za=!0),g(this,c,d),null!==e&&(e.Za=h)));To(this);this.j("fromPortId",b,a)}});
x.w(G,{ad:"fromPort"},function(){var a=this.og;return null===a?null:a.Ll(this.Sh)});x.defineProperty(G,{UE:"fromPortChanged"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(null!==a&&x.g(a,"function",G,"fromPortChanged"),this.cr=a,this.j("fromPortChanged",b,a))});
x.defineProperty(G,{fa:"toNode"},function(){return this.zg},function(a){var b=this.zg;if(b!==a){u&&null!==a&&x.l(a,E,G,"toNode");var c=this.Ad;null!==b&&(this.og!==b&&Eo(b,this,c),So(this),this.J(ok));this.zg=a;null!==a&&this.Qd(a.isVisible());this.Fi=null;this.rc();var d=this.h;if(null!==d){var e=this.data,g=d.aa;if(null!==e)if(g instanceof X){var h=null!==a?a.data:null;g.ay(e,g.sb(h))}else g instanceof Ve&&(h=null!==a?a.data:null,d.ae?(null!==b&&g.Hh(b.data,void 0),g.Hh(h,g.sb(null!==this.og?this.og.data:
null))):g.Hh(e,g.sb(h)))}e=this.Ad;g=this.qG;null!==g&&(h=!0,null!==d&&(h=d.Za,d.Za=!0),g(this,c,e),null!==d&&(d.Za=h));null!==a&&(this.og!==a&&Do(a,this,e),To(this),this.J(gk));this.j("toNode",b,a);Uk(this)}});
x.defineProperty(G,{Og:"toPortId"},function(){return this.hi},function(a){var b=this.hi;if(b!==a){u&&x.g(a,"string",G,"toPortId");var c=this.Ad;null!==c&&Co(this.fa,c);So(this);this.hi=a;var d=this.Ad;null!==d&&Co(this.fa,d);var e=this.h;if(null!==e){var g=this.data,h=e.aa;null!==g&&h instanceof X&&h.jB(g,a)}c!==d&&(this.Fi=null,this.rc(),g=this.qG,null!==g&&(h=!0,null!==e&&(h=e.Za,e.Za=!0),g(this,c,d),null!==e&&(e.Za=h)));To(this);this.j("toPortId",b,a)}});
x.w(G,{Ad:"toPort"},function(){var a=this.zg;return null===a?null:a.Ll(this.hi)});x.defineProperty(G,{qG:"toPortChanged"},function(){return this.Ss},function(a){var b=this.Ss;b!==a&&(null!==a&&x.g(a,"function",G,"toPortChanged"),this.Ss=a,this.j("toPortChanged",b,a))});x.defineProperty(G,{Gb:"fromSpot"},function(){return null!==this.ma?this.ma.Hj:Jc},function(a){this.Ve();var b=this.ma.Hj;b.O(a)||(u&&x.l(a,R,G,"fromSpot"),a=a.Y(),this.ma.Hj=a,this.j("fromSpot",b,a),this.rc())});
x.defineProperty(G,{Ml:"fromEndSegmentLength"},function(){return null!==this.ma?this.ma.Fj:NaN},function(a){this.Ve();var b=this.ma.Fj;b!==a&&(u&&x.g(a,"number",G,"fromEndSegmentLength"),0>a&&x.la(a,">= 0",G,"fromEndSegmentLength"),this.ma.Fj=a,this.j("fromEndSegmentLength",b,a),this.rc())});
x.defineProperty(G,{Dt:"fromEndSegmentDirection"},function(){return null!==this.ma?this.ma.Ej:xo},function(a){this.Ve();var b=this.ma.Ej;b!==a&&(u&&x.Ca(a,E,G,"fromEndSegmentDirection"),this.ma.Ej=a,this.j("fromEndSegmentDirection",b,a),this.rc())});x.defineProperty(G,{Et:"fromShortLength"},function(){return null!==this.ma?this.ma.Gj:NaN},function(a){this.Ve();var b=this.ma.Gj;b!==a&&(u&&x.g(a,"number",G,"fromShortLength"),this.ma.Gj=a,this.j("fromShortLength",b,a),this.rc())});
x.defineProperty(G,{Hb:"toSpot"},function(){return null!==this.ma?this.ma.jk:Jc},function(a){this.Ve();var b=this.ma.jk;b.O(a)||(u&&x.l(a,R,G,"toSpot"),a=a.Y(),this.ma.jk=a,this.j("toSpot",b,a),this.rc())});x.defineProperty(G,{em:"toEndSegmentLength"},function(){return null!==this.ma?this.ma.hk:NaN},function(a){this.Ve();var b=this.ma.hk;b!==a&&(u&&x.g(a,"number",G,"toEndSegmentLength"),0>a&&x.la(a,">= 0",G,"toEndSegmentLength"),this.ma.hk=a,this.j("toEndSegmentLength",b,a),this.rc())});
x.defineProperty(G,{Au:"toEndSegmentDirection"},function(){return null!==this.ma?this.ma.gk:xo},function(a){this.Ve();var b=this.ma.gk;b!==a&&(u&&x.Ca(a,E,G,"toEndSegmentDirection"),this.ma.gk=a,this.j("toEndSegmentDirection",b,a),this.rc())});x.defineProperty(G,{Bu:"toShortLength"},function(){return null!==this.ma?this.ma.ik:NaN},function(a){this.Ve();var b=this.ma.ik;b!==a&&(u&&x.g(a,"number",G,"toShortLength"),this.ma.ik=a,this.j("toShortLength",b,a),this.rc())});
function Uk(a){var b=a.Z,c=a.fa;null!==b?null!==c?Uo(a,b.lI(c)):Uo(a,null):Uo(a,null)}function Uo(a,b){var c=a.Uk;if(c!==b){null!==c&&ro(c,a);a.Uk=b;null!==b&&so(b,a);var d=a.sE;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.Za,g.Za=!0);d(a,c,b);null!==g&&(g.Za=e)}!a.Yf||a.ED!==c&&a.GD!==c||a.rc()}}G.prototype.Sl=function(){var a=this.Xa;null!==a&&this.Z!==a&&this.fa!==a&&D.prototype.Sl.call(this)};
G.prototype.getOtherNode=G.prototype.rA=function(a){u&&x.l(a,E,G,"getOtherNode:node");var b=this.Z;return a===b?this.fa:b};G.prototype.getOtherPort=function(a){u&&x.l(a,O,G,"getOtherPort:port");var b=this.ad;return a===b?this.Ad:b};x.w(G,{uL:"isLabeledLink"},function(){return null===this.Me?!1:0<this.Me.count});x.w(G,{If:"labelNodes"},function(){return null===this.Me?Ra:this.Me.i});function Fo(a,b){null===a.Me&&(a.Me=new K(E));a.Me.add(b);a.T()}
G.prototype.It=function(a){D.prototype.It.call(this,a);Vo(this)&&vh(this,this.ba);a||(a=this.og,null!==a&&Do(a,this,this.ad),a=this.zg,null!==a&&Do(a,this,this.Ad),To(this))};G.prototype.Jt=function(a){D.prototype.Jt.call(this,a);Vo(this)&&vh(this,this.ba);a||(a=this.og,null!==a&&Eo(a,this,this.ad),a=this.zg,null!==a&&Eo(a,this,this.Ad),So(this))};
G.prototype.ln=function(){this.Yf=!0;if(null!==this.Me){var a=this.h;if(null!==a)for(var b=this.Me.copy().i;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.h,null!==a&&(a=a.aa,a instanceof X?a.Px(b):a instanceof Ve&&a.Hh(b,void 0)))};
G.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.aa;if(c instanceof X){var d=c.Ol(a),e=b.hf(d),g=this.Z;e!==g&&(e=null!==g?c.sb(g.data):void 0,g=c.Jp,"function"===typeof g?g(a,e):a[g]=e,c.Xx(a,d));d=c.Rl(a);e=b.hf(d);g=this.fa;e!==g&&(e=null!==g?c.sb(g.data):void 0,g=c.Lp,"function"===typeof g?g(a,e):a[g]=e,c.ay(a,d));var h=c.uk(a);if(0<h.length||0<this.If.count){if(1===h.length&&1===this.If.count&&(b=h[0],d=this.If.first(),c.sb(d.data)===
b))return;var d=(new K).$c(h),k=new K;this.If.each(function(a){null!==a.data&&(a=c.sb(a.data),void 0!==a&&k.add(a))});b=k.copy();b.aB(d);d=d.copy();d.aB(k);if(0<b.count||0<d.count)h.length=0,k.each(function(a){h.push(a)}),b.each(function(b){c.KF(a,b)}),d.each(function(b){c.Uz(a,b)})}}}}};
G.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;D.prototype.move.call(this,a);this.Xl(c,b);for(a=this.If;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};x.defineProperty(G,{GJ:"relinkableFrom"},function(){return this.ks},function(a){var b=this.ks;b!==a&&(u&&x.g(a,"boolean",G,"relinkableFrom"),this.ks=a,this.j("relinkableFrom",b,a),this.oe())});
x.defineProperty(G,{HJ:"relinkableTo"},function(){return this.ls},function(a){var b=this.ls;b!==a&&(u&&x.g(a,"boolean",G,"relinkableTo"),this.ls=a,this.j("relinkableTo",b,a),this.oe())});G.prototype.canRelinkFrom=function(){if(!this.GJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.$m)return!1;a=a.h;return null===a||a.$m?!0:!1};G.prototype.canRelinkTo=function(){if(!this.HJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.$m)return!1;a=a.h;return null===a||a.$m?!0:!1};
x.defineProperty(G,{mu:"resegmentable"},function(){return this.ms},function(a){var b=this.ms;b!==a&&(u&&x.g(a,"boolean",G,"resegmentable"),this.ms=a,this.j("resegmentable",b,a),this.oe())});x.defineProperty(G,{Oc:"isTreeLink"},function(){return this.tr},function(a){var b=this.tr;b!==a&&(u&&x.g(a,"boolean",G,"isTreeLink"),this.tr=a,this.j("isTreeLink",b,a),null!==this.Z&&fl(this.Z),null!==this.fa&&fl(this.fa))});x.w(G,{path:"path"},function(){var a=this.Bf();return a instanceof Y?a:null});
x.w(G,{Cn:"routeBounds"},function(){this.Hn();var a=new w;var b=Infinity,c=Infinity,d=this.ta;if(0===d)a.n(NaN,NaN,0,0);else{if(1===d)d=this.m(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.n(d.x,d.y,0,0);else if(2===d){var e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y);a.n(e.x,e.y,0,0);a.wj(g)}else if(this.computeCurve()===Bh&&3<=d&&!this.sc)if(e=this.m(0),b=e.x,c=e.y,a.n(b,c,0,0),3===d)d=this.m(1),b=Math.min(d.x,b),c=Math.min(d.y,c),g=this.m(2),b=Math.min(g.x,b),c=Math.min(g.y,c),Q.gp(e.x,
e.y,d.x,d.y,d.x,d.y,g.x,g.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.m(h-2);h+3>=d&&(h=d-1);var l=this.m(h-1),g=this.m(h);Q.gp(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.n(e.x,e.y,0,0),a.wj(g),h=2;h<d;h++)e=this.m(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.wj(e);this.Lz.n(b-a.x,c-a.y)}return this.gw=a});x.w(G,{yF:"midPoint"},function(){this.Hn();return this.computeMidPoint(new N)});
G.prototype.computeMidPoint=function(a){var b=this.ta;if(0===b)return a.assign(Q.KG),a;if(1===b)return a.assign(this.m(0)),a;if(2===b){var c=this.m(0),d=this.m(1);a.n((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===Bh&&3<=b&&!this.sc){if(3===b)return this.m(1);var b=(b-1)/3|0,e=3*(b/2|0);1===b%2?(c=this.m(e),d=this.m(e+1),b=this.m(e+2),e=this.m(e+3),Q.BH(c.x,c.y,d.x,d.y,b.x,b.y,e.x,e.y,a)):a.assign(this.m(e));return a}for(var e=0,g=x.ub(),h=0;h<b-1;h++)c=0,c=this.m(h),d=this.m(h+1),Q.jb(c.x,
d.x)?(c=d.y-c.y,0>c&&(c=-c)):Q.jb(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.qk(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++}x.xa(g);b=this.m(h);g=this.m(h+1);b.x===g.x?b.y>g.y?a.n(b.x,b.y-(e/2-c)):a.n(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.n(b.x-(e/2-c),b.y):a.n(b.x+(e/2-c),b.y):(e=(e/2-c)/d,a.n(b.x+e*(g.x-b.x),b.y+e*(g.y-b.y)));return a};x.w(G,{xF:"midAngle"},function(){this.Hn();return this.computeMidAngle()});
G.prototype.computeMidAngle=function(){var a=this.ta;if(2>a)return NaN;if(this.computeCurve()===Bh&&4<=a&&!this.sc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),a=this.m(c),b=this.m(c+1),d=this.m(c+2),c=this.m(c+3);return Q.AH(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.m(c-1),b=this.m(c+1),a.qh(b)}d=a/2|0;if(0===a%2)return a=this.m(d-1),b=this.m(d),a.qh(b);var a=this.m(d-1),b=this.m(d),d=this.m(d+1),c=a.qk(b),e=b.qk(d);return c>e+10?a.qh(b):e>c+10?b.qh(d):a.qh(d)};
x.defineProperty(G,{points:"points"},function(){return this.Yc},function(a){var b=this.Yc;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!==typeof a[e]||isNaN(a[e])){d=!1;break}if(d)for(c=new J(N),d=0;d<a.length/2;d++)e=(new N(a[2*d],a[2*d+1])).freeze(),c.add(e);else{for(var g=!0,d=0;d<a.length;d++)if(e=a[d],!x.Ya(e)||"number"!==typeof e.x||isNaN(e.x)||"number"!==typeof e.y||isNaN(e.y)){g=!1;break}if(g)for(c=new J(N),d=0;d<a.length;d++)e=
a[d],c.add((new N(e.x,e.y)).freeze());else x.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof J)for(c=a.copy(),a=c.i;a.next();)a.value.freeze();else x.k("Link.points value is not an instance of List or Array: "+a);c.freeze();this.Yc=c;this.nf();this.T();Wo(this);a=this.h;null!==a&&(a.qa.tb||a.Dx.add(this),a.$a.Bc&&(this.So=c));this.j("points",b,c)}});x.w(G,{ta:"pointsCount"},function(){return this.Yc.count});
G.prototype.getPoint=G.prototype.m=function(a){return this.Yc.o[a]};G.prototype.setPoint=G.prototype.Mf=function(a,b){u&&(x.l(b,N,G,"setPoint"),b.G()||x.k("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Lg(a,b)};
G.prototype.setPointAt=G.prototype.ca=function(a,b,c){u&&(x.p(b,G,"setPointAt:x"),x.p(c,G,"setPointAt:y"));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Lg(a,new N(b,c))};G.prototype.insertPoint=function(a,b){u&&(x.l(b,N,G,"insertPoint"),b.G()||x.k("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Nd(a,b)};
G.prototype.insertPointAt=G.prototype.B=function(a,b,c){u&&(x.p(b,G,"insertPointAt:x"),x.p(c,G,"insertPointAt:y"));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Nd(a,new N(b,c))};G.prototype.addPoint=G.prototype.ji=function(a){u&&(x.l(a,N,G,"addPoint"),a.G()||x.k("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.add(a)};
G.prototype.addPointAt=G.prototype.wl=function(a,b){u&&(x.p(a,G,"insertPointAt:x"),x.p(b,G,"insertPointAt:y"));null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.add(new N(a,b))};G.prototype.removePoint=G.prototype.LF=function(a){null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.dd(a)};
G.prototype.clearPoints=G.prototype.kp=function(){null===this.Oe&&x.k("Call Link.startRoute before modifying the points of the route.");this.Yc.clear()};G.prototype.movePoints=G.prototype.Xl=function(a,b){for(var c=new J(N),d=this.Yc.i;d.next();){var e=d.value;c.add((new N(e.x+a,e.y+b)).freeze())}c.freeze();d=this.Yc;this.Yc=c;this.T();Wo(this);e=this.h;null!==e&&e.$a.Bc&&(this.So=c);this.j("points",d,c)};G.prototype.startRoute=G.prototype.am=function(){null===this.Oe&&(this.Oe=this.Yc,this.Yc=this.Yc.copy())};
G.prototype.commitRoute=G.prototype.fj=function(){if(null!==this.Oe){for(var a=this.Oe,b=this.Yc,c=Infinity,d=Infinity,e=a.o,g=e.length,h=0;h<g;h++)var k=e[h],c=Math.min(k.x,c),d=Math.min(k.y,d);for(var l=Infinity,m=Infinity,n=b.o,p=n.length,h=0;h<p;h++)k=n[h],l=Math.min(k.x,l),m=Math.min(k.y,m),k.freeze();b.freeze();if(p===g)for(h=0;h<p;h++){if(g=e[h],k=n[h],g.x-c!==k.x-l||g.y-d!==k.y-m){this.T();this.nf();break}}else this.T(),this.nf();this.Oe=null;c=this.h;null!==c&&c.$a.Bc&&(this.So=b);Wo(this);
this.j("points",a,b)}};G.prototype.rollbackRoute=G.prototype.KJ=function(){null!==this.Oe&&(this.Yc=this.Oe,this.Oe=null)};function Wo(a){0===a.Yc.count?a.Yf=!1:(a.Yf=!0,a.ao=a.m(0).copy(),a.fo=a.m(a.ta-1).copy(),Xo(a,!1))}G.prototype.invalidateRoute=G.prototype.rc=function(){if(!(this.Hz||this.h&&(this.h.Dx.contains(this)||this.h.qa.tb))){var a=this.path;if(null!==a){if(this.Yf){var b=this.ad;null!==b&&(b=b.Km,null!==b&&b.sn());b=this.Ad;null!==b&&(b=b.Km,null!==b&&b.sn())}this.Yf=!1;this.T();a.T()}}};
x.defineProperty(G,{jq:"suspendsRouting"},function(){return this.Hz},function(a){this.Hz=a});G.prototype.updateRoute=G.prototype.Hn=function(){if(!this.Yf&&!this.Jy){var a=!0;try{this.Jy=!0,this.am(),a=this.computePoints()}finally{this.Jy=!1,a?this.fj():this.KJ()}}};
G.prototype.computePoints=function(){var a=this.h;if(null===a)return!1;var b=this.Z,c=null;null===b?(a.Nm||(a.hw=new Y,a.hw.Ba=Q.Ln,a.hw.yb=0,a.Nm=new E,a.Nm.add(a.hw),a.Nm.Af()),this.ao&&(a.Nm.position=a.Nm.location=this.ao,a.Nm.Af(),b=a.Nm,c=a.hw)):c=this.ad;if(null!==c){var d=im(c);d!==b&&b.isVisible()?c=d:(d=b.findVisibleNode(),null!==d&&d!==b?(b=d,c=d.Ll("")):b=d)}this.ED=b;if(null===b||null===c||!b.location.G())return!1;var d=this.fa,e=null;null===d?(a.Om||(a.iw=new Y,a.iw.Ba=Q.Ln,a.iw.yb=0,
a.Om=new E,a.Om.add(a.iw),a.Om.Af()),this.fo&&(a.Om.position=a.Om.location=this.fo,a.Om.Af(),d=a.Om,e=a.iw)):e=this.Ad;null!==e&&(a=im(e),a!==d&&d.isVisible()?e=a:(a=d.findVisibleNode(),null!==a&&a!==d?(d=a,e=a.Ll("")):d=a));this.GD=d;if(null===d||null===e||!d.location.G())return!1;var a=this.ta,g=Yo(this,c),h=Zo(this,e),k=c===e&&null!==c,l=this.sc,m=this.Te===Bh;this.Fi=k&&!l?m=!0:!1;var n=this.dt===uh||k;if(l||g!==Wb||h!==Wb||k){m=this.lj;n&&(l&&m||k)&&this.kp();var p=k?this.computeCurviness():
0,q=this.getLinkPoint(b,c,g,!0,l,d,e),r=0,s=0,t=0;if(l||g!==Wb||k){var v=this.computeEndSegmentLength(b,c,g,!0),t=this.getLinkDirection(b,c,q,g,!0,l,d,e);k&&(t-=l?90:30,0>p&&(t-=180));0>t?t+=360:360<=t&&(t-=360);k&&(v+=Math.abs(p));0===t?r=v:90===t?s=v:180===t?r=-v:270===t?s=-v:(r=v*Math.cos(t*Math.PI/180),s=v*Math.sin(t*Math.PI/180));if(g.ze()&&k){var y=c.gb(dc,x.P()),A=x.Xb(y.x+1E3*r,y.y+1E3*s);this.getLinkPointFromPoint(b,c,y,A,!0,q);x.A(y);x.A(A)}}var v=this.getLinkPoint(d,e,h,!1,l,b,c),B=0,C=
0,M=0;if(l||h!==Wb||k)y=this.computeEndSegmentLength(d,e,h,!1),M=this.getLinkDirection(d,e,v,h,!1,l,b,c),k&&(M+=l?0:30,0>p&&(M+=180)),0>M?M+=360:360<=M&&(M-=360),k&&(y+=Math.abs(p)),0===M?B=y:90===M?C=y:180===M?B=-y:270===M?C=-y:(B=y*Math.cos(M*Math.PI/180),C=y*Math.sin(M*Math.PI/180)),h.ze()&&k&&(y=e.gb(dc,x.P()),A=x.Xb(y.x+1E3*B,y.y+1E3*C),this.getLinkPointFromPoint(d,e,y,A,!1,v),x.A(y),x.A(A));e=q;if(l||g!==Wb||k)e=new N(q.x+r,q.y+s);c=v;if(l||h!==Wb||k)c=new N(v.x+B,v.y+C);!n&&!l&&g===Wb&&3<a&&
this.adjustPoints(0,q,a-2,c)?this.Mf(a-1,v):!n&&!l&&h===Wb&&3<a&&this.adjustPoints(1,e,a-1,v)?this.Mf(0,q):!n&&!l&&4<a&&this.adjustPoints(1,e,a-2,c)?(this.Mf(0,q),this.Mf(a-1,v)):!n&&l&&6<=a&&!m&&this.adjustPoints(1,e,a-2,c)?(this.Mf(0,q),this.Mf(a-1,v)):(this.kp(),this.ji(q),(l||g!==Wb||k)&&this.ji(e),l&&this.addOrthoPoints(e,t,c,M,b,d),(l||h!==Wb||k)&&this.ji(c),this.ji(v))}else g=!1,!n&&3<=a&&(n=this.getLinkPoint(b,c,Wb,!0,!1,d,e),h=this.getLinkPoint(d,e,Wb,!1,!1,b,c),g=this.adjustPoints(0,n,a-
1,h))&&(n=this.getLinkPoint(b,c,Wb,!0,!1,d,e),h=this.getLinkPoint(d,e,Wb,!1,!1,b,c),this.adjustPoints(0,n,a-1,h)),g||(this.kp(),m?(a=this.getLinkPoint(b,c,Wb,!0,!1,d,e),n=this.getLinkPoint(d,e,Wb,!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,t=a.y+h/3,r=q,s=t,Q.F(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)+t),q=a.x+2*g/3,t=a.y+2*h/3,v=q,B=t,Q.F(h,0)?B=0<g?B-k:B+k:(v=(0>h?-1:1)*m+q,B=l*(v-q)+t),this.kp(),this.ji(a),this.wl(r,
s),this.wl(v,B),this.ji(n),this.Mf(0,this.getLinkPoint(b,c,Wb,!0,!1,d,e)),this.Mf(3,this.getLinkPoint(d,e,Wb,!1,!1,b,c))):(a=d,d=this.getLinkPoint(b,c,Wb,!0,!1,a,e),e=this.getLinkPoint(a,e,Wb,!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,Q.F(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.ji(d),this.wl(g,k)):this.ji(d),this.ji(e)));return!0};
function $o(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}
G.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new N);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.V;null===e||e.Pg()||(e=e.V);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.mh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Ap(e,h,k,l,
g);null!==a&&g.transform(a);return g};function ap(a,b){var c=b.Km;null===c&&(c=new bp,c.port=b,c.Pc=b.ea,b.Km=c);return cp(c,a)}
G.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new N);if(c.cd())return b.gb(c,k),k;if(c.mj()&&(c=ap(this,b),null!==c)){k.assign(c.Kp);if(e&&this.Sx===Ko){var l=ap(this,h);if(null!==l&&c.hn<l.hn){c=x.P();var l=x.P(),m=new w(b.gb(Xb,c),b.gb(lc,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);x.A(c);x.A(l)}}return k}g=b.gb(dc,x.P());l=c=null;this.ta>(e?6:2)?(l=d?this.m(1):this.m(this.ta-2),e&&
(l=$o(g,l.copy()))):(c=x.P(),l=h.gb(dc,c),e&&(l=$o(g,l)));this.getLinkPointFromPoint(a,b,g,l,d,k);x.A(g);null!==c&&x.A(c);return k};
G.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.cd())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:.5>d.x?225:.5<d.x?45:0;else{if(d.mj()){var l=ap(this,b);if(null!==l)switch(l.se){case x.qd:c=270;break a;case x.Tc:c=180;break a;default:case x.fd:c=0;break a;case x.ed:c=90;break a}}var l=b.gb(dc,x.P()),m=null,n=null;this.ta>(g?6:2)?(n=e?this.m(1):this.m(this.ta-2),n=g?$o(l,n.copy()):c):(m=x.P(),n=k.gb(dc,m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y-l.y)?n.x>=
l.x?0:180:n.y>=l.y?90:270;x.A(l);null!==m&&x.A(m)}d.ze()&&h.pi(a)&&(c+=180,360<=c&&(c-=360));a=xo;a=e?this.Dt:this.Au;a===xo&&(a=e?b.Dt:b.Au);switch(a){case yo:b=b.Nl();c+=b;360<=c&&(c-=360);break;case xo:case El:b=b.Nl();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};
G.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.mj()&&(a=ap(this,b),null!==a))return a.ex;a=NaN;a=d?this.Ml:this.em;null!==b&&isNaN(a)&&(a=d?b.Ml:b.em);isNaN(a)&&(a=10);return a};G.prototype.computeSpot=function(a){return a?Yo(this,this.ad):Zo(this,this.Ad)};function Yo(a,b){if(null===b)return dc;var c=a.Gb;c.bd()&&(void 0===b&&(b=a.ad),null!==b&&(c=b.Gb));return c===Jc?Wb:c}
function Zo(a,b){if(null===b)return dc;var c=a.Hb;c.bd()&&(void 0===b&&(b=a.Ad),null!==b&&(c=b.Hb));return c===Jc?Wb:c}G.prototype.computeOtherPoint=function(a,b){var c=b.gb(dc),d;d=b.Km;d=null!==d?cp(d,this):null;null!==d&&(c=d.Kp);return c};G.prototype.computeShortLength=function(a){return a?dp(this):ep(this)};function dp(a){var b=a.Et;isNaN(b)&&(a=a.ad,null!==a&&(b=a.Et));return isNaN(b)?0:b}function ep(a){var b=a.Bu;isNaN(b)&&(a=a.Ad,null!==a&&(b=a.Bu));return isNaN(b)?0:b}
G.prototype.sk=function(a,b,c,d,e,g){if(!1===this.ig)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=x.Ih(),h.reset());h.multiply(this.transform);if(this.en(a,h))return on(this,b,c,e),void 0===g&&x.jf(h),!0;if(this.Hg(a,h)){var k=!1;if(!this.Yg)for(var l=this.wa.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.$b){var p=n.ba,q=this.Ga;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=x.Ih();p.set(h);if(n instanceof H)k=n.sk(a,b,c,d,e,p);else if(this.path===
n){var k=n,r=a,s=d,q=p;if(!1===k.ig)k=!1;else if(q.multiply(k.transform),s)b:{var t=r,v=q;if(k.en(t,v))k=!0;else{if(void 0===v&&(v=k.transform,t.pk(k.ba))){k=!0;break b}var q=t.left,r=t.right,s=t.top,t=t.bottom,y=x.P(),A=x.P(),B=x.P(),C=x.Ih();C.set(v);C.MA(k.transform);C.wA();A.x=r;A.y=s;A.transform(C);y.x=q;y.y=s;y.transform(C);v=!1;zn(k,y,A,B)?v=!0:(y.x=r,y.y=t,y.transform(C),zn(k,y,A,B)?v=!0:(A.x=q,A.y=t,A.transform(C),zn(k,y,A,B)?v=!0:(y.x=q,y.y=s,y.transform(C),zn(k,y,A,B)&&(v=!0))));x.jf(C);
x.A(y);x.A(A);x.A(B);k=v}}else k=k.en(r,q)}else k=Jl(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&e.add(n));x.jf(p)}}}void 0===g&&x.jf(h);return k||null!==this.background||null!==this.zl}void 0===g&&x.jf(h);return!1};x.w(G,{sc:"isOrthogonal"},function(){return 2===(this.Mm.value&2)});x.w(G,{lj:"isAvoiding"},function(){return 4===(this.Mm.value&4)});G.prototype.computeCurve=function(){if(null===this.Fi){var a=this.ad,b=this.sc;this.Fi=null!==a&&a===this.Ad&&!b}return this.Fi?Bh:this.Te};
G.prototype.computeCorner=function(){if(this.Te===Bh)return 0;var a=this.eA;if(isNaN(a)||0>a)a=10;return a};G.prototype.findMidLabel=function(){for(var a=this.path,b=this.wa.o,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.Gf&&(-Infinity===e.Ce||isNaN(e.Ce)))return e}for(a=this.If;a.next();)if(b=a.value,-Infinity===b.Ce||isNaN(b.Ce))return b;return null};
G.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a;a=Math.max(14,this.computeThickness());var b=this.ad,c=this.Ad;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.Ga,g=d.margin,h=isNaN(e.width)?30:e.width*d.scale+g.left+g.right,e=isNaN(e.height)?14:e.height*d.scale+g.top+g.bottom,d=d.qu;d===Bn||d===Oo||d===No?a=Math.max(a,e):d===Mo||d===Qo||d===Lo||d===Po?a=Math.max(a,h):(b=b.gb(dc).qh(c.gb(dc))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(b)*h)+Math.abs(Math.cos(b)*
e)+1));this.Te===Bh&&(a*=1.333)}}return a};G.prototype.arrangeBundledLinks=function(a,b){if(b)for(var c=0;c<a.length;c++)a[c].rc()};G.prototype.computeCurviness=function(){var a=this.Zw;if(isNaN(a)){var a=16,b=this.ti;if(null!==b){for(var c=x.ub(),d=0,e=b.links,g=0;g<e.length;g++){var h=e[g],h=h.computeSpacing();c.push(h);d+=h}d=-d/2;for(g=0;g<e.length;g++){h=e[g];if(h===this){a=d+c[g]/2;break}d+=c[g]}b.Tp===this.Z&&(a=-a);x.xa(c)}}return a};
G.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.yb,1):1};G.prototype.hasCurviness=function(){return!isNaN(this.Zw)||null!==this.ti};
G.prototype.adjustPoints=function(a,b,c,d){var e=this.dt;if(this.sc){if(e===pm)return!1;e===qm&&(e=om)}switch(e){case pm:var g=this.m(a),h=this.m(c);if(!g.wd(b)||!h.wd(d)){var e=g.x,g=g.y,k=h.x-e,l=h.y-g,m=Math.sqrt(k*k+l*l);if(!Q.F(m,0)){var n=0;Q.F(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,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Q.F(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.Mf(a,b);for(a+=
1;a<c;a++)b=this.m(a),k=b.x-e,l=b.y-g,b=Math.sqrt(k*k+l*l),Q.F(b,0)||(q=0,Q.F(k,0)?q=0>l?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ca(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Mf(c,d)}}return!0;case qm:g=this.m(a);p=this.m(c);if(!g.wd(b)||!p.wd(d)){var 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,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.Mf(a,b);for(a+=1;a<c;a++){b=this.m(a);var t=b.x,v=b.y,y=.5;0!==
m&&(y=((e-t)*(e-h)+(g-v)*(g-p))/m);var A=e+y*(h-e),B=g+y*(p-g);b=Math.sqrt((t-A)*(t-A)+(v-B)*(v-B));v<r*(t-A)+B&&(b=-b);0<r&&(b=-b);t=k+y*(l-k);y=n+y*(q-n);0!==r?(b=t+b/s,this.ca(a,b,y-(b-t)/r)):this.ca(a,t,y+b)}this.Mf(c,d)}return!0;case om:return this.sc&&(e=this.m(a),g=this.m(a+1),h=this.m(a+2),Q.F(e.y,g.y)?Q.F(g.x,h.x)?this.ca(a+1,g.x,b.y):Q.F(g.y,h.y)&&this.ca(a+1,b.x,g.y):Q.F(e.x,g.x)&&(Q.F(g.y,h.y)?this.ca(a+1,b.x,g.y):Q.F(g.x,h.x)&&this.ca(a+1,g.x,b.y)),e=this.m(c),g=this.m(c-1),h=this.m(c-
2),Q.F(e.y,g.y)?Q.F(g.x,h.x)?this.ca(c-1,g.x,d.y):Q.F(g.y,h.y)&&this.ca(c-1,d.x,g.y):Q.F(e.x,g.x)&&(Q.F(g.y,h.y)?this.ca(c-1,d.x,g.y):Q.F(g.x,h.x)&&this.ca(c-1,g.x,d.y))),this.Mf(a,b),this.Mf(c,d),!0;default:return!1}};
G.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.ba.copy(),k=g.ba.copy();if(h.G()&&k.G()){h.cg(8,8);k.cg(8,8);h.wj(a);k.wj(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 N(c.x,a.y),m=new N(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 N(a.x,c.y);m=new N((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.Na(a)||h.Na(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 N(Math.max((a.x+c.x)/2,a.x),a.y),m=new N(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 N(c.x,a.y),m=new N(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 N(a.x,c.y);m=new N((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.Na(a)||h.Na(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 N(Math.min((a.x+c.x)/2,a.x),a.y),m=new N(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 N(a.x,c.y),m=new N((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 N(c.x,a.y);m=new N(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.Na(a)||h.Na(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 N(a.x,Math.max((a.y+c.y)/2,a.y)),m=new N(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 N(a.x,c.y),m=new N((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 N(c.x,a.y);m=new N(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.Na(a)||h.Na(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 N(a.x,Math.min((a.y+c.y)/2,a.y)),m=new N(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.lj){var q=this.h,r;(r=null===q)||(q.$a.Df?r=!1:(r=q.eb,r=r instanceof Mf?!r.yw||r.NI:!0),r=!r);if(r||h.Na(c)&&!g.pi(e)||k.Na(a)&&!e.pi(g)||e===g||this.layer.Nc)a=!1;else if(e=ka(q,!0,this.Xa,null),e.Ip(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&e.Ip(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&e.Ip(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().si(k),
h.cg(2*e.jp,2*e.hp),fp(e,a,b,c,d,h),k=gp(e,c.x,c.y),e.abort||999999!==k||(jl(e),k=e.jG,h.cg(e.jp*k,e.hp*k),fp(e,a,b,c,d,h),k=gp(e,c.x,c.y)),e.abort||999999!==k||(jl(e),k=e.sF,h.cg(e.jp*k,e.hp*k),fp(e,a,b,c,d,h),k=gp(e,c.x,c.y)),!e.abort&&999999===k&&e.DG&&(jl(e),fp(e,a,b,c,d,e.Cb),k=gp(e,c.x,c.y)),!e.abort&&999999>k&&0!==gp(e,c.x,c.y)){hp(this,e,c.x,c.y,d,!0);d=this.m(2);if(4>this.ta)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.ca(2,d.x,d.y),this.B(3,d.x,d.y);else if(c=this.m(3),0===b||
180===b)Q.F(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.ca(2,b,a.y),this.ca(3,b,c.y)):Q.F(d.y,c.y)?(Math.abs(a.y-d.y)<=e.hp/2&&(this.ca(2,d.x,a.y),this.ca(3,c.x,a.y)),this.B(2,d.x,a.y)):this.ca(2,a.x,d.y);else if(90===b||270===b)Q.F(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.ca(2,a.x,b),this.ca(3,c.x,b)):Q.F(d.x,c.x)?(Math.abs(a.x-d.x)<=e.jp/2&&(this.ca(2,a.x,d.y),this.ca(3,a.x,c.y)),this.B(2,a.x,d.y)):this.ca(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.ji(l),this.ji(m))}};
G.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function vg(a){if(!a.lj)return!1;var b=a.points.o,c=b.length;if(4>c)return!1;a=ka(a.h,!0,a.Xa,null);for(var d=1;d<c-2;d++){var e=b[d],g=b[d+1];if(!a.Ip(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 hp(a,b,c,d,e,g){var h=b.jp,k=b.hp,l=gp(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&gp(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,l-=1;if(g){if(1<l)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;1<l&&(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),gp(b,m,n)===l-1?hp(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),gp(b,m,n)===l-1&&hp(a,b,m,n,g,!1)));a.wl(c,d)}G.prototype.findClosestSegment=function(a){u&&x.l(a,N,G,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.m(0),d=this.m(1),e=sb(b,a,c.x,c.y,d.x,d.y),g=0,h=1;h<this.ta-1;h++){var c=this.m(h+1),k=sb(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(g=h,e=k)}return g};G.prototype.invalidateGeometry=G.prototype.nf=function(){this.bb=null};
x.w(G,{xp:"geometry"},function(){null===this.bb&&(this.Hn(),this.bb=this.makeGeometry());return this.bb});G.prototype.Yt=function(a){if(a||null===this.bb&&!1!==this.Yf)if(this.bb=this.makeGeometry(),a=this.path,null!==a){a.bb=this.bb;for(var b=this.wa.o,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.Gf&&e instanceof Y&&(e.bb=this.bb)}}};
G.prototype.makeGeometry=function(){var a=this.ta;if(2>a){var b=new ud(vd),c=new wd(0,0);b.ec.add(c);return b}var d=!1,b=this.h;null!==b&&Vo(this)&&b.Xk.contains(this)&&null!==this.gw&&(d=!0);var c=b=0,e=this.m(0).copy(),g=e.copy(),b=this.Yc.o,h=this.computeCurve();if(h===Bh&&3<=a&&!Q.jb(this.hq,0))if(3===a)var k=this.m(1),b=Math.min(e.x,k.x),c=Math.min(e.y,k.y),k=this.m(2),b=Math.min(b,k.x),c=Math.min(c,k.y);else{if(this.sc)for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);else for(k=
3;k<a;k+=3)k+3>=a&&(k=a-1),b=this.m(k),g.x=Math.min(b.x,g.x),g.y=Math.min(b.y,g.y);b=g.x;c=g.y}else{for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);b=g.x;c=g.y}b-=this.Lz.x;c-=this.Lz.y;e.x-=b;e.y-=c;if(2===a){var l=this.m(1).copy();l.x-=b;l.y-=c;0!==dp(this)&&ip(this,e,!0,g);0!==ep(this)&&ip(this,l,!1,g);b=new ud(yd);b.Ha=e.x;b.Da=e.y;b.M=l.x;b.N=l.y}else{l=x.u();0!==dp(this)&&ip(this,e,!0,g);S(l,e.x,e.y,!1,!1);if(h===Bh&&3<=a&&!Q.jb(this.hq,0))if(3===a)k=this.m(1),a=k.x-b,d=k.y-
c,k=this.m(2).copy(),k.x-=b,k.y-=c,0!==ep(this)&&ip(this,k,!1,g),T(l,a,d,a,d,k.x,k.y);else if(this.sc){for(var g=new N(b,c),e=this.m(1).copy(),h=new N(b,c),a=new N(b,c),d=this.m(0),m=null,n=this.hq/3,k=1;k<this.ta-1;k++){var m=this.m(k),p=d,q=m,r=this.m(jp(this,m,k,!1));if(!Q.jb(p.x,q.x)||!Q.jb(q.x,r.x))if(!Q.jb(p.y,q.y)||!Q.jb(q.y,r.y)){var s=n,t=h,v=a;isNaN(s)&&(s=this.hq/3);var y=p.x,p=p.y,A=q.x,q=q.y,B=r.x,r=r.y,C=s*kp(y,p,A,q),s=s*kp(A,q,B,r);Q.jb(p,q)&&Q.jb(A,B)&&(A>y?r>q?(t.x=A-C,t.y=q-C,v.x=
A+s,v.y=q+s):(t.x=A-C,t.y=q+C,v.x=A+s,v.y=q-s):r>q?(t.x=A+C,t.y=q-C,v.x=A-s,v.y=q+s):(t.x=A+C,t.y=q+C,v.x=A-s,v.y=q-s));Q.jb(y,A)&&Q.jb(q,r)&&(q>p?(B>A?(t.x=A-C,t.y=q-C,v.x=A+s):(t.x=A+C,t.y=q-C,v.x=A-s),v.y=q+s):(B>A?(t.x=A-C,t.y=q+C,v.x=A+s):(t.x=A+C,t.y=q+C,v.x=A-s),v.y=q-s));if(Q.jb(y,A)&&Q.jb(A,B)||Q.jb(p,q)&&Q.jb(q,r))y=.5*(y+B),p=.5*(p+r),t.x=y,t.y=p,v.x=y,v.y=p;1===k?(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y)):2===k&&Q.jb(d.x,this.m(0).x)&&Q.jb(d.y,this.m(0).y)&&(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y));
T(l,e.x-b,e.y-c,h.x-b,h.y-c,m.x-b,m.y-c);g.set(h);e.set(a);d=m}}k=d.x;d=d.y;g=this.m(this.ta-1);k=.5*(k+g.x);d=.5*(d+g.y);T(l,a.x-b,a.y-c,k-b,d-c,g.x-b,g.y-c)}else for(k=3;k<a;k+=3)d=this.m(k-2),k+3>=a&&(k=a-1),g=this.m(k-1),e=this.m(k),k===a-1&&0!==ep(this)&&(e=e.copy(),ip(this,e,!1,Q.Ek)),T(l,d.x-b,d.y-c,g.x-b,g.y-c,e.x-b,e.y-c);else{g=x.P();g.assign(this.m(0));for(k=1;k<a;){k=jp(this,g,k,1<k);t=this.m(k);if(k>=a-1){g!==t&&(0!==ep(this)&&(t=t.copy(),ip(this,t,!1,Q.Ek)),lp(this,l,-b,-c,g,t,d));break}k=
jp(this,t,k+1,k<a-3);e=l;h=-b;m=-c;n=g;v=this.m(k);y=g;p=d;Q.F(n.y,t.y)&&Q.F(t.x,v.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(t.x-n.x)/2),s=A=Math.min(s,Math.abs(v.y-t.y)/2),Q.F(s,0)?(lp(this,e,h,m,n,t,p),y.assign(t)):(q=t.x,B=t.y,r=q,C=B,q=t.x>n.x?t.x-s:t.x+s,C=v.y>t.y?t.y+A:t.y-A,lp(this,e,h,m,n,new N(q,B),p),Id(e,t.x+h,t.y+m,r+h,C+m),y.n(r,C))):Q.F(n.x,t.x)&&Q.F(t.y,v.y)?(s=this.computeCorner(),A=Math.min(s,Math.abs(t.y-n.y)/2),A=s=Math.min(A,Math.abs(v.x-t.x)/2),Q.F(s,0)?(lp(this,e,h,m,
n,t,p),y.assign(t)):(q=t.x,C=B=t.y,B=t.y>n.y?t.y-A:t.y+A,r=v.x>t.x?t.x+s:t.x-s,lp(this,e,h,m,n,new N(q,B),p),Id(e,t.x+h,t.y+m,r+h,C+m),y.n(r,C))):(lp(this,e,h,m,n,t,p),y.assign(t))}x.A(g)}b=l.q;x.v(l)}return b};function kp(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 Q.jb(a,0)?b:Q.jb(b,0)?a:Math.sqrt(a*a+b*b)}
function ip(a,b,c,d){var e=a.ta;if(!(2>e))if(c){var g=a.m(1);c=g.x-d.x;d=g.y-d.y;g=kp(b.x,b.y,c,d);0!==g&&(e=2===e?.5*g:g,a=dp(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.m(e-2),c=g.x-d.x,d=g.y-d.y,g=kp(b.x,b.y,c,d),0!==g&&(e=2===e?.5*g:g,a=ep(a),a>e&&(a=e),c=a*(b.x-c)/g,a=a*(b.y-d)/g,b.x-=c,b.y-=a)}
function jp(a,b,c,d){for(var e=a.ta,g=b;Q.jb(b.x,g.x)&&Q.jb(b.y,g.y);){if(c>=e)return e-1;g=a.m(c++)}if(!Q.jb(b.x,g.x)&&!Q.jb(b.y,g.y))return c-1;for(var h=g;Q.jb(b.x,g.x)&&Q.jb(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||Q.jb(b.y,g.y)&&Q.jb(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.m(c++)}return c-2}
function lp(a,b,c,d,e,g,h){if(!h&&Vo(a)){h=[];var k=0;a.isVisible()&&(k=mp(a,e,g,h));var l=e.x,l=e.y;if(0<k)if(Q.F(e.y,g.y))if(e.x<g.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[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[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.Te===th?S(b,n,p,!1,!1):T(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[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[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.Te===th?S(b,n,p,!1,!1):T(b,l,q,n,q,n,p)}else if(Q.F(e.x,g.x))if(e.y<g.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[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[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.Te===th?S(b,n,p,!1,!1):T(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[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[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.Te===th?S(b,n,p,!1,!1):T(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)}
function mp(a,b,c,d){var e=a.h;if(null===e||b.O(c))return 0;for(e=e.vn;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.pb.o,h=g.length,k=0;k<h;k++){var l=g[k];if(l instanceof G){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.isVisible()&&Vo(l)){var m=l.Cn;m.G()&&a.Cn.Hg(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.Wl()&&np(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
function np(a,b,c,d){for(var e=Q.F(a.y,b.y),g=d.ta,h=d.m(0),k=x.P(),l=1;l<g;l++){var m=d.m(l);if(l<g-1){var n=d.m(l+1);if(h.y===m.y&&m.y===n.y){if(m.x>h.x&&n.x>m.x||m.x<h.x&&n.x<m.x)m=n,l++}else h.x===m.x&&m.x===n.x&&(m.y>h.y&&n.y>m.y||m.y<h.y&&n.y<m.y)&&(m=n,l++)}a:{var n=k,p=a.x,q=a.y,r=b.x,s=b.y,t=h.x,h=h.y,v=m.x,y=m.y;if(!Q.F(p,r)){if(Q.F(q,s)&&Q.F(t,v)&&Math.min(p,r)<t&&Math.max(p,r)>t&&Math.min(h,y)<q&&Math.max(h,y)>q&&!Q.F(h,y)){n.x=t;n.y=q;n=!0;break a}}else if(!Q.F(q,s)&&Q.F(h,y)&&Math.min(q,
s)<h&&Math.max(q,s)>h&&Math.min(t,v)<p&&Math.max(t,v)>p&&!Q.F(t,v)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}x.A(k)}x.w(G,{At:"firstPickIndex"},function(){return 2>=this.ta?0:this.sc||Yo(this)!==Wb?1:0});x.w(G,{Ax:"lastPickIndex"},function(){var a=this.ta;return 0===a?0:2>=a?a-1:this.sc||Zo(this)!==Wb?a-2:a-1});function Vo(a){a=a.Te;return a===sh||a===th}function Xo(a,b){if(b||Vo(a)){var c=a.h;null===c||c.Xk.contains(a)||null===a.gw||c.Xk.add(a,a.gw)}}
function vh(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Nc){var d=c.h;if(null!==d)for(var e=!1,d=d.vn;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.pb.o,k=g.length,l=0;l<k;l++){var m=g[l];m instanceof G&&(m===a?h=!0:h&&op(a,m,b))}else if(e)for(g=g.pb.o,k=g.length,l=0;l<k;l++)m=g[l],m instanceof G&&op(a,m,b)}}}function op(a,b,c){if(null!==b&&null!==b.bb&&Vo(b)){var d=b.Cn;d.G()&&(a.Cn.Hg(d)||c.Hg(d))&&(a.usesSamePort(b)||b.nf())}}
G.prototype.usesSamePort=function(a){var b=this.ta,c=a.ta;if(0<b&&0<c){var d=this.m(0),e=a.m(0);if(d.wd(e))return!0;b=this.m(b-1);a=a.m(c-1);if(b.wd(a)||d.wd(a)||b.wd(e))return!0}else if(this.Z===a.Z||this.fa===a.fa||this.Z===a.fa||this.fa===a.Z)return!0;return!1};
G.prototype.isVisible=function(){if(!D.prototype.isVisible.call(this))return!1;var a=this.Xa,b=!0,c=this.h;null!==c&&(b=c.ae);c=this.Z;if(null!==c){if(this.Oc&&b&&!c.xd)return!1;if(c===a)return!0;c=c.findVisibleNode();if(null===c||c===a)return!1}c=this.fa;if(null!==c){if(this.Oc&&!b&&!c.xd)return!1;if(c===a)return!0;b=c.findVisibleNode();if(null===b||b===a)return!1}return!0};G.prototype.Qd=function(a){D.prototype.Qd.call(this,a);null!==this.ti&&this.ti.sn();if(null!==this.Me)for(var b=this.Me.i;b.next();)b.value.Qd(a)};
x.defineProperty(G,{dt:"adjusting"},function(){return this.sq},function(a){var b=this.sq;b!==a&&(u&&x.Ca(a,G,G,"adjusting"),this.sq=a,this.j("adjusting",b,a))});x.defineProperty(G,{eA:"corner"},function(){return this.Jq},function(a){var b=this.Jq;b!==a&&(u&&x.g(a,"number",G,"corner"),this.Jq=a,this.nf(),this.j("corner",b,a))});
x.defineProperty(G,{Te:"curve"},function(){return this.Mq},function(a){var b=this.Mq;b!==a&&(u&&x.Ca(a,G,G,"curve"),this.Mq=a,this.rc(),Xo(this,b===th||b===sh||a===th||a===sh),this.j("curve",b,a))});x.defineProperty(G,{Zw:"curviness"},function(){return this.Nq},function(a){var b=this.Nq;b!==a&&(u&&x.g(a,"number",G,"curviness"),this.Nq=a,this.rc(),this.j("curviness",b,a))});
x.defineProperty(G,{Sx:"routing"},function(){return this.Mm},function(a){var b=this.Mm;b!==a&&(u&&x.Ca(a,G,G,"routing"),this.Mm=a,this.Fi=null,this.rc(),Xo(this,2===(b.value&2)||2===(a.value&2)),this.j("routing",b,a))});x.defineProperty(G,{hq:"smoothness"},function(){return this.Is},function(a){var b=this.Is;b!==a&&(u&&x.g(a,"number",G,"smoothness"),this.Is=a,this.nf(),this.j("smoothness",b,a))});
function To(a){var b=a.og;if(null!==b){var c=a.zg;if(null!==c){var d=a.Sh;a=a.hi;for(var e=null,g=null,h=b.nc.o,k=h.length,l=0;l<k;l++){var m=h[l];if(m.og===b&&m.Sh===d&&m.zg===c&&m.hi===a||m.og===c&&m.Sh===a&&m.zg===b&&m.hi===d)null===g?g=m:(null===e&&(e=[],e.push(g)),e.push(m))}if(null!==e){g=Bo(b,c,d,a);null===g&&(g=new qj,g.Tp=b,g.Kx=d,g.cu=c,g.Lx=a,Ao(b,g),Ao(c,g));g.links=e;for(l=0;l<e.length;l++)m=e[l],m.ti=g;g.sn()}}}}
function So(a){var b=a.ti;null!==b&&(a.ti=null,a=b.links.indexOf(a),0<=a&&(x.ki(b.links,a),b.sn()))}function qj(){x.lc(this);this.Cv=!1;this.Lx=this.cu=this.Kx=this.Tp=null;this.links=[]}qj.prototype.sn=function(){if(!this.Cv){var a=this.links;0<a.length&&(a=a[0].h,null!==a&&a.DC.add(this))}this.Cv=!0};
qj.prototype.uB=function(){if(this.Cv){this.Cv=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.h;b.arrangeBundledLinks(a,null===c||c.Le);1===a.length&&(b.ti=null,a.length=0)}0===a.length&&(a=this.Tp,null!==this&&null!==a.Lh&&a.Lh.remove(this),a=this.cu,null!==this&&null!==a.Lh&&a.Lh.remove(this))}};x.Yd(qj,{Tp:!0,Kx:!0,cu:!0,Lx:!0,links:!0,spacing:!0});
function hl(){x.lc(this);this.kB=this.group=null;this.Ep=!0;this.abort=!1;this.Vf=this.Uf=1;this.Hr=this.Gr=-1;this.Bd=this.Rd=8;this.mc=null;this.DG=!1;this.jG=22;this.sF=111}x.Yd(hl,{group:!0,kB:!0,Ep:!0,abort:!0,DG:!0,jG:!0,sF:!0});
hl.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.Uf=Math.floor((a.x-this.Rd)/this.Rd)*this.Rd;this.Vf=Math.floor((b-this.Bd)/this.Bd)*this.Bd;this.Gr=Math.ceil((c+2*this.Rd)/this.Rd)*this.Rd;this.Hr=Math.ceil((d+2*this.Bd)/this.Bd)*this.Bd;a=1+(Math.ceil((this.Gr-this.Uf)/this.Rd)|0);b=1+(Math.ceil((this.Hr-this.Vf)/this.Bd)|0);if(null===this.mc||this.Vm<a-1||this.Wm<b-1){c=[];for(d=0;d<=a;d++){for(var e=[],g=0;g<=b;g++)e[g]=0;c[d]=e}this.mc=
c;this.Vm=a-1;this.Wm=b-1}if(null!==this.mc)for(a=0;a<=this.Vm;a++)for(b=0;b<=this.Wm;b++)this.mc[a][b]=999999}};x.w(hl,{Cb:null},function(){return new w(this.Uf,this.Vf,this.Gr-this.Uf,this.Hr-this.Vf)});x.defineProperty(hl,{jp:null},function(){return this.Rd},function(a){0<a&&a!==this.Rd&&(this.Rd=a,this.initialize(this.Cb))});x.defineProperty(hl,{hp:null},function(){return this.Bd},function(a){0<a&&a!==this.Bd&&(this.Bd=a,this.initialize(this.Cb))});
function pp(a,b,c){return a.Uf<=b&&b<=a.Gr&&a.Vf<=c&&c<=a.Hr}function gp(a,b,c){if(!pp(a,b,c))return 0;b-=a.Uf;b/=a.Rd;c-=a.Vf;c/=a.Bd;return a.mc[b|0][c|0]}function kl(a,b,c){pp(a,b,c)&&(b-=a.Uf,b/=a.Rd,c-=a.Vf,c/=a.Bd,a.mc[b|0][c|0]=0)}function jl(a){if(null!==a.mc)for(var b=0;b<=a.Vm;b++)for(var c=0;c<=a.Wm;c++)1<=a.mc[b][c]&&(a.mc[b][c]|=999999)}
hl.prototype.Ip=function(a,b,c,d){if(a>this.Gr||a+c<this.Uf||b>this.Hr||b+d<this.Vf)return!0;a=(a-this.Uf)/this.Rd|0;b=(b-this.Vf)/this.Bd|0;c=Math.max(0,c)/this.Rd+1|0;var e=Math.max(0,d)/this.Bd+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.Vm)|0;for(c=Math.min(b+e-1,this.Wm)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.mc[a][e])return!1;return!0};
function qp(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.mc[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.mc[m][n]);)a.mc[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0<d)for(c+=d;c<m;c+=d)qp(a,b,c,1,!e,g,h,k,l),qp(a,b,c,-1,!e,g,h,k,l);else for(c+=d;c>m;c+=d)qp(a,b,c,1,!e,g,h,k,l),qp(a,b,c,-1,!e,g,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)qp(a,b,c,1,!e,g,h,k,l),qp(a,b,c,-1,!e,g,h,k,l);else for(b+=d;b>m;b+=d)qp(a,b,c,1,!e,g,h,k,l),qp(a,b,c,-1,!e,g,h,
k,l)}}function rp(a,b,c,d,e,g,h,k,l,m,n){for(var p=b|0,q=c|0,r=a.mc[p][q];0===r&&p>k&&p<l&&q>m&&q<n;)if(h?q+=g:p+=g,r=a.mc[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.mc[p][q];b=1;for(a.mc[p][q]=b;0===r&&p>k&&p<l&&q>m&&q<n;)h?q+=g:p+=g,r=a.mc[p][q],a.mc[p][q]=b,b+=1;return h?q:p}
function fp(a,b,c,d,e,g){if(null!==a.mc){a.abort=!1;var h=b.x,k=b.y;if(pp(a,h,k)){var h=h-a.Uf,h=h/a.Rd,k=k-a.Vf,k=k/a.Bd,l=d.x,m=d.y;if(pp(a,l,m))if(l-=a.Uf,l/=a.Rd,m-=a.Vf,m/=a.Bd,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.Uf,n=n/a.Rd;b-=a.Vf;b/=a.Bd;d-=a.Uf;d/=a.Rd;p-=a.Vf;p/=a.Bd;g=Math.max(0,Math.min(a.Vm,n|0));d=Math.min(a.Vm,Math.max(0,d|0));b=Math.max(0,Math.min(a.Wm,b|0));var p=Math.min(a.Wm,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=rp(a,h,k,l,m,r,c,g,d,b,p):n=rp(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,t=a.mc[r][s];0===t&&r>g&&r<d&&s>b&&s<p;)if(e?s+=c:r+=c,t=a.mc[r][s],1>=Math.abs(r-h)&&1>=Math.abs(s-k)){a.abort=!0;break a}r=l|0;s=m|0;t=a.mc[r][s];for(a.mc[r][s]=999999;0===t&&r>g&&r<d&&s>b&&s<p;)e?s+=c:r+=c,t=a.mc[r][s],a.mc[r][s]=999999}a.abort||(qp(a,n,q,1,!1,g,d,b,p),qp(a,n,q,-1,!1,g,d,b,p),qp(a,n,q,1,!0,g,d,
b,p),qp(a,n,q,-1,!0,g,d,b,p))}}}}}function bp(){x.lc(this);this.port=this.Pc=null;this.gg=[];this.Sp=!1}x.Yd(bp,{Pc:!0,port:!0,gg:!0,Sp:!0});bp.prototype.toString=function(){for(var a=this.gg,b=this.Pc.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n  "+d.toString())}return b};
function sp(a,b,c,d){b=b.offsetY;switch(b){case x.ed:return 90;case x.Tc:return 180;case x.qd:return 270;case x.fd:return 0}switch(b){case x.ed|x.qd:return 180<c?270:90;case x.Tc|x.fd:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case x.Tc|x.qd:return c>a&&c<=180+a?180:270;case x.qd|x.fd:return c>180-a&&c<=360-a?270:0;case x.fd|x.ed:return c>a&&c<=180+a?90:0;case x.ed|x.Tc:return c>180-a&&c<=360-a?180:90;case x.Tc|x.qd|x.fd:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
a?270:0;case x.qd|x.fd|x.ed:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case x.fd|x.ed|x.Tc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case x.ed|x.Tc|x.qd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(x.Tc|x.qd|x.fd|x.ed)&&(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}bp.prototype.sn=function(){this.gg.length=0};
function cp(a,b){var c=a.gg;if(0===c.length){a:if(!a.Sp){c=a.Sp;a.Sp=!0;var d,e=null,g=a.Pc,g=g instanceof F?g:null;if(null===g||g.re)d=a.Pc.OE(a.port.zd);else{if(!g.ba.G()){a.Sp=c;break a}e=g;d=e.NE()}var h=a.gg.length=0,k=a.port.gb(Xb,x.P()),l=a.port.gb(lc,x.P()),g=x.Dk(k.x,k.y,0,0);g.wj(l);x.A(k);x.A(l);k=x.Xb(g.x+g.width/2,g.y+g.height/2);for(d=d.i;d.next();)if(l=d.value,l.isVisible()){var m=Wb,n=l.ad===a.port||l.Z.pi(e),m=n?Yo(l,a.port):Zo(l,a.port);if(m.mj()&&(n=n?l.Ad:l.ad,null!==n)){var p=
n.ea;if(null!==p){var n=l.computeOtherPoint(p,n),p=k.qh(n),m=sp(g,m,p,l.sc),q=0;0===m?(q=x.fd,180<p&&(p-=360)):q=90===m?x.ed:180===m?x.Tc:x.qd;m=a.gg[h];void 0===m?(m=new tp(l,p,q),a.gg[h]=m):(m.link=l,m.angle=p,m.se=q);m.Ix.set(n);h++}}}x.A(k);a.gg.sort(bp.prototype.wJ);e=a.gg.length;k=-1;for(h=d=0;h<e;h++)m=a.gg[h],void 0!==m&&(m.se!==k&&(k=m.se,d=0),m.Cp=d,d++);k=-1;d=0;for(h=e-1;0<=h;h--)m=a.gg[h],void 0!==m&&(m.se!==k&&(k=m.se,d=m.Cp+1),m.hn=d);h=a.gg;n=a.port;e=a.Pc.DJ;k=x.P();d=x.P();l=x.P();
m=x.P();n.gb(Xb,k);n.gb(bc,d);n.gb(lc,l);n.gb(fc,m);var r=q=p=n=0;if(e===zo)for(var s=0;s<h.length;s++){var t=h[s];if(null!==t){var v=t.link.computeThickness();switch(t.se){case x.ed:q+=v;break;case x.Tc:r+=v;break;case x.qd:n+=v;break;default:case x.fd:p+=v}}}for(var y=0,A=0,B=1,s=0;s<h.length;s++)if(t=h[s],null!==t){var C,M;if(y!==t.se){y=t.se;switch(y){case x.ed:C=l;M=m;break;case x.Tc:C=m;M=k;break;case x.qd:C=k;M=d;break;default:case x.fd:C=d,M=l}var I=M.x-C.x;M=M.y-C.y;switch(y){case x.ed:q>
Math.abs(I)?(B=Math.abs(I)/q,q=Math.abs(I)):B=1;break;case x.Tc:r>Math.abs(M)?(B=Math.abs(M)/r,r=Math.abs(M)):B=1;break;case x.qd:n>Math.abs(I)?(B=Math.abs(I)/n,n=Math.abs(I)):B=1;break;default:case x.fd:p>Math.abs(M)?(B=Math.abs(M)/p,p=Math.abs(M)):B=1}A=0}var V=t.Kp;if(e===zo){v=t.link.computeThickness();v*=B;V.set(C);switch(y){case x.ed:V.x=C.x+I/2+q/2-A-v/2;break;case x.Tc:V.y=C.y+M/2+r/2-A-v/2;break;case x.qd:V.x=C.x+I/2-n/2+A+v/2;break;default:case x.fd:V.y=C.y+M/2-p/2+A+v/2}A+=v}else v=.5,
e===wo&&(v=(t.Cp+1)/(t.hn+1)),V.x=C.x+I*v,V.y=C.y+M*v}x.A(k);x.A(d);x.A(l);x.A(m);C=a.gg;for(I=0;I<C.length;I++)M=C[I],null!==M&&(M.ex=a.computeEndSegmentLength(M));a.Sp=c;x.qc(g)}c=a.gg}for(g=0;g<c.length;g++)if(C=c[g],null!==C&&C.link===b)return C;return null}bp.prototype.wJ=function(a,b){return a===b?0:null===a?-1:null===b?1:a.se<b.se?-1:a.se>b.se?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
bp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Pc,this.port,Wb,b.ad===this.port),d=a.Cp;if(0>d)return c;var e=a.hn;if(1>=e||!b.sc)return c;var b=a.Ix,g=a.Kp;if(a.se===x.Tc||a.se===x.ed)d=e-1-d;return((a=a.se===x.Tc||a.se===x.fd)?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 tp(a,b,c){this.link=a;this.angle=b;this.se=c;this.Ix=new N;this.hn=this.Cp=0;this.Kp=new N;this.ex=0}
x.Yd(tp,{link:!0,angle:!0,se:!0,Ix:!0,Cp:!0,hn:!0,Kp:!0,ex:!0});tp.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.se.toString()+":"+this.Cp.toString()+"/"+this.hn.toString()+" "+this.Kp.toString()+" "+this.ex.toString()+" "+this.Ix.toString()};function Dl(){this.jk=this.Hj=Jc;this.hk=this.Fj=NaN;this.gk=this.Ej=xo;this.ik=this.Gj=NaN}
Dl.prototype.copy=function(){var a=new Dl;a.Hj=this.Hj.Y();a.jk=this.jk.Y();a.Fj=this.Fj;a.hk=this.hk;a.Ej=this.Ej;a.gk=this.gk;a.Gj=this.Gj;a.ik=this.ik;return a};function F(a){0===arguments.length?E.call(this,Mh):E.call(this,a);this.Jr=new K(D);this.Fm=new K(F);this.kl=this.Kr=this.Ir=null;this.Vs=!1;this.qr=!0;this.Ws=!1;this.Nb=this.Ms=null;this.Cq=!1;this.Dq=!0;this.gr=this.Eq=!1;this.ee=new df;this.ee.group=this;this.zz=!1}x.Qa(F,E);x.ja("Group",F);
F.prototype.cloneProtected=function(a){E.prototype.cloneProtected.call(this,a);a.Ir=this.Ir;a.Kr=this.Kr;a.kl=this.kl;a.Vs=this.Vs;a.qr=this.qr;a.Ws=this.Ws;a.Ms=this.Ms;var b=a.vt(function(a){return a instanceof Gh});a.Nb=b instanceof Gh?b:null;a.Cq=this.Cq;a.Dq=this.Dq;a.Eq=this.Eq;a.gr=this.gr;null!==this.ee?(a.ee=this.ee.copy(),a.ee.group=a):(null!==a.ee&&(a.ee.group=null),a.ee=null)};
F.prototype.mi=function(a){E.prototype.mi.call(this,a);var b=a.tp();for(a=a.Gc;a.next();){var c=a.value;c.T();c.J(8);c.mt();if(c instanceof E)c.mf(b);else if(c instanceof G)for(c=c.If;c.next();)c.value.mf(b)}};
F.prototype.Bn=function(a,b,c,d,e,g,h){if(a===ye&&"elements"===b)if(e instanceof Gh){var k=e;null===this.Nb?this.Nb=k:this.Nb!==k&&x.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof H&&(k=e.vt(function(a){return a instanceof Gh}),k instanceof Gh&&(null===this.Nb?this.Nb=k:this.Nb!==k&&x.k("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===ze&&"elements"===b&&null!==this.Nb&&(d===this.Nb?this.Nb=null:d instanceof H&&this.Nb.Ul(d)&&
(this.Nb=null));E.prototype.Bn.call(this,a,b,c,d,e,g,h)};F.prototype.bj=function(a,b,c,d){this.jl=this.Nb;H.prototype.bj.call(this,a,b,c,d)};F.prototype.Vl=function(){if(!E.prototype.Vl.call(this))return!1;for(var a=this.Gc;a.next();){var b=a.value;if(b instanceof E){if(b.isVisible()&&Yj(b))return!1}else if(b instanceof G&&b.isVisible()&&Yj(b)&&b.Z!==this&&b.fa!==this)return!1}return!0};x.w(F,{placeholder:"placeholder"},function(){return this.Nb});
x.defineProperty(F,{rE:"computesBoundsAfterDrag"},function(){return this.Cq},function(a){var b=this.Cq;b!==a&&(x.g(a,"boolean",F,"computesBoundsAfterDrag"),this.Cq=a,this.j("computesBoundsAfterDrag",b,a))});x.defineProperty(F,{LH:"computesBoundsIncludingLinks"},function(){return this.Dq},function(a){x.g(a,"boolean",F,"computesBoundsIncludingLinks");var b=this.Dq;b!==a&&(this.Dq=a,this.j("computesBoundsIncludingLinks",b,a))});
x.defineProperty(F,{MH:"computesBoundsIncludingLocation"},function(){return this.Eq},function(a){x.g(a,"boolean",F,"computesBoundsIncludingLocation");var b=this.Eq;b!==a&&(this.Eq=a,this.j("computesBoundsIncludingLocation",b,a))});x.defineProperty(F,{DI:"handlesDragDropForMembers"},function(){return this.gr},function(a){x.g(a,"boolean",F,"handlesDragDropForMembers");var b=this.gr;b!==a&&(this.gr=a,this.j("handlesDragDropForMembers",b,a))});x.w(F,{Gc:"memberParts"},function(){return this.Jr.i});
function so(a,b){if(a.Jr.add(b)){b instanceof F&&a.Fm.add(b);var c=a.oJ;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Za,e.Za=!0);c(a,b);null!==e&&(e.Za=d)}a.isVisible()&&a.re||b.Qd(!1)}c=a.Nb;null===c&&(c=a);c.T()}function ro(a,b){if(a.Jr.remove(b)){b instanceof F&&a.Fm.remove(b);var c=a.pJ;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.Za,e.Za=!0);c(a,b);null!==e&&(e.Za=d)}a.isVisible()&&a.re||b.Qd(!0)}c=a.Nb;null===c&&(c=a);c.T()}
F.prototype.ln=function(){if(0<this.Jr.count){var a=this.h;if(null!==a)for(var b=this.Jr.copy().i;b.next();)a.remove(b.value)}E.prototype.ln.call(this)};x.defineProperty(F,{Tb:"layout"},function(){return this.ee},function(a){var b=this.ee;b!==a&&(null!==a&&x.l(a,df,F,"layout"),null!==b&&(b.h=null,b.group=null),this.ee=a,null!==a&&(a.h=this.h,a.group=this),this.j("layout",b,a))});
x.defineProperty(F,{oJ:"memberAdded"},function(){return this.Ir},function(a){var b=this.Ir;b!==a&&(null!==a&&x.g(a,"function",F,"memberAdded"),this.Ir=a,this.j("memberAdded",b,a))});x.defineProperty(F,{pJ:"memberRemoved"},function(){return this.Kr},function(a){var b=this.Kr;b!==a&&(null!==a&&x.g(a,"function",F,"memberRemoved"),this.Kr=a,this.j("memberRemoved",b,a))});
x.defineProperty(F,{HA:"memberValidation"},function(){return this.kl},function(a){var b=this.kl;b!==a&&(null!==a&&x.g(a,"function",F,"memberValidation"),this.kl=a,this.j("memberValidation",b,a))});F.prototype.canAddMembers=function(a){var b=this.h;if(null===b)return!1;b=b.zb;for(a=Of(a).i;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};
F.prototype.addMembers=function(a,b){var c=this.h;if(null===c)return!1;for(var c=c.zb,d=!0,e=Of(a).i;e.next();){var g=e.value;!b||c.isValidMember(this,g)?g.Xa=this:d=!1}return d};x.defineProperty(F,{lK:"ungroupable"},function(){return this.Vs},function(a){var b=this.Vs;b!==a&&(x.g(a,"boolean",F,"ungroupable"),this.Vs=a,this.j("ungroupable",b,a))});F.prototype.canUngroup=function(){if(!this.lK)return!1;var a=this.layer;if(null!==a&&!a.Qw)return!1;a=a.h;return null===a||a.Qw?!0:!1};
F.prototype.mf=function(a){void 0===a&&(a=null);E.prototype.mf.call(this,a);for(var b=this.NE();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Z;null!==d&&d!==this&&d.pi(this)&&!d.isVisible()?c.rc():(d=c.fa,null!==d&&d!==this&&d.pi(this)&&!d.isVisible()&&c.rc())}}};F.prototype.findExternalLinksConnected=F.prototype.NE=function(){var a=this.tp();a.add(this);for(var b=new K(G),c=a.i;c.next();){var d=c.value;if(d instanceof E)for(d=d.ce;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.i};
F.prototype.findExternalNodesConnected=function(){var a=this.tp();a.add(this);for(var b=new K(E),c=a.i;c.next();){var d=c.value;if(d instanceof E)for(d=d.ce;d.next();){var e=d.value,g=e.Z;a.contains(g)&&g!==this||b.add(g);e=e.fa;a.contains(e)&&e!==this||b.add(e)}}return b.i};F.prototype.findSubGraphParts=F.prototype.tp=function(){var a=new K(D);If(a,this,!0,0,!0);a.remove(this);return a};F.prototype.Qd=function(a){E.prototype.Qd.call(this,a);for(var b=this.Gc;b.next();)b.value.Qd(a)};
F.prototype.collapseSubGraph=F.prototype.collapseSubGraph=function(){var a=this.h;if(null!==a&&!a.rh){a.rh=!0;var b=this.tp();up(this,b,a.$a,this);a.rh=!1}};function up(a,b,c,d){for(var e=a.Gc;e.next();){var g=e.value;g.Qd(!1);if(g instanceof F){var h=g;h.re&&(h.wB=h.re,up(h,b,c,d))}if(g instanceof E)g.mf(b),Oi(c,g,d);else if(g instanceof G)for(g=g.If;g.next();)g.value.mf(b)}a.re=!1}
F.prototype.expandSubGraph=F.prototype.expandSubGraph=function(){var a=this.h;if(null!==a&&!a.rh){a.rh=!0;var b=this.tp();vp(this,b,a.$a,this);a.rh=!1}};function vp(a,b,c,d){for(var e=a.Gc;e.next();){var g=e.value;g.Qd(!0);if(g instanceof F){var h=g;h.wB&&(h.wB=!1,vp(h,b,c,d))}if(g instanceof E)g.mf(b),Ni(c,g,d);else if(g instanceof G)for(g=g.If;g.next();)g.value.mf(b)}a.re=!0}
x.defineProperty(F,{re:"isSubGraphExpanded"},function(){return this.qr},function(a){var b=this.qr;if(b!==a){x.g(a,"boolean",F,"isSubGraphExpanded");this.qr=a;var c=this.h;this.j("isSubGraphExpanded",b,a);b=this.bK;if(null!==b){var d=!0;null!==c&&(d=c.Za,c.Za=!0);b(this);null!==c&&(c.Za=d)}null!==c&&c.qa.tb?null!==this.Nb&&this.Nb.T():a?this.expandSubGraph():this.collapseSubGraph()}});
x.defineProperty(F,{wB:"wasSubGraphExpanded"},function(){return this.Ws},function(a){var b=this.Ws;b!==a&&(x.g(a,"boolean",F,"wasSubGraphExpanded"),this.Ws=a,this.j("wasSubGraphExpanded",b,a))});x.defineProperty(F,{bK:"subGraphExpandedChanged"},function(){return this.Ms},function(a){var b=this.Ms;b!==a&&(null!==a&&x.g(a,"function",F,"subGraphExpandedChanged"),this.Ms=a,this.j("subGraphExpandedChanged",b,a))});
F.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=x.Xb(c,b);E.prototype.move.call(this,a);for(a=this.tp().i;a.next();){var e=a.value;if(!(e instanceof G||e instanceof E&&e.Ef)){var g=e.position,h=e.location;g.G()?(d.x=g.x+c,d.y=g.y+b,e.position=d):h.G()&&(d.x=h.x+c,d.y=h.y+b,e.location=d)}}for(a.reset();a.next();)e=a.value,e instanceof G&&(g=e.position,d.x=g.x+c,d.y=g.y+b,e.move(d));x.A(d)};
function Gh(){O.call(this);this.df=Q.nq;this.us=new w(NaN,NaN,NaN,NaN)}x.Qa(Gh,O);x.ja("Placeholder",Gh);Gh.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.df=this.df.Y();a.us=this.us.copy()};Gh.prototype.ok=function(a){if(null===this.background&&null===this.zl)return!1;var b=this.Ga;return Gb(0,0,b.width,b.height,a.x,a.y)};
Gh.prototype.Np=function(){var a=this.ea;null!==a&&(a instanceof F||a instanceof fa)||x.k("Placeholder is not inside a Group or Adornment.");if(a instanceof F){var b=this.computeBorder(this.us),c=this.Wc;vb(c,b.width||0,b.height||0);Hl(this,0,0,c.width,c.height);for(var c=a.Gc,d=!1;c.next();)if(c.value.isVisible()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new N,c.su(b,a.of),a.location=new N(c.x,c.y))}else{var b=this.Ba,c=this.Wc,d=this.padding,e=d.left+d.right,g=d.top+d.bottom;if(b.G())vb(c,b.width+
e||0,b.height+g||0),Hl(this,-d.left,-d.top,c.width,c.height);else{var h=a.oc,k=h.gb(Xb,x.P()),b=x.Dk(k.x,k.y,0,0);b.wj(h.gb(lc,k));b.wj(h.gb(bc,k));b.wj(h.gb(fc,k));a.Zh.n(b.x,b.y);vb(c,b.width+e||0,b.height+g||0);Hl(this,-d.left,-d.top,c.width,c.height);x.A(k);x.qc(b)}}};Gh.prototype.bj=function(a,b,c,d){var e=this.ba;e.x=a;e.y=b;e.width=c;e.height=d};
Gh.prototype.computeBorder=function(a){var b=this.ea;if(b instanceof F){var c=b;if(c.rE&&this.us.G()){var d=c.h;if(null!==d&&(d=d.eb,d instanceof Mf&&!d.Wq&&null!==d.ic&&!d.ic.contains(c)))return a.assign(this.us),a}}var c=x.kg(),d=this.computeMemberBounds(c),e=this.padding;a.n(d.x-e.left,d.y-e.top,d.width+e.left+e.right,d.height+e.top+e.bottom);x.qc(c);b instanceof F&&(c=b,c.MH&&c.location.G()&&a.wj(c.location));return a};
Gh.prototype.computeMemberBounds=function(a){if(!(this.ea instanceof F))return a.n(0,0,0,0),a;for(var b=this.ea,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=b.Gc;h.next();){var k=h.value;if(k.isVisible()){if(k instanceof G){var l=k;if(!b.LH)continue;if(Xj(l))continue;if(l.Z===b||l.fa===b)continue}k=k.ba;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.n(c,d,e-c,g-d):(b=b.location,c=this.padding,a.n(b.x+c.left,b.y+c.top,0,0));return a};
x.defineProperty(Gh,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?((isNaN(a)||0>a)&&x.la(a,">= 0",Gh,"padding"),a=new yb(a)):(x.l(a,yb,Gh,"padding"),(isNaN(a.left)||0>a.left)&&x.la(a.left,">= 0",Gh,"padding:value.left"),(isNaN(a.right)||0>a.right)&&x.la(a.right,">= 0",Gh,"padding:value.right"),(isNaN(a.top)||0>a.top)&&x.la(a.top,">= 0",Gh,"padding:value.top"),(isNaN(a.bottom)||0>a.bottom)&&x.la(a.bottom,">= 0",Gh,"padding:value.bottom"));var b=this.df;b.O(a)||(this.df=
a=a.Y(),this.j("padding",b,a))});function df(){0<arguments.length&&x.pd(df);x.lc(this);this.hz=this.W=null;this.Lj=this.nr=!0;this.ur=!1;this.vq=(new N(0,0)).freeze();this.or=this.pr=!0;this.oC="";this.Co=!1;this.Az=null}x.ja("Layout",df);df.prototype.cloneProtected=function(a){a.nr=this.nr;a.Lj=this.Lj;a.ur=this.ur;a.vq.assign(this.vq);a.pr=this.pr;a.or=this.or;a.oC=this.oC;this.Lj||(a.Co=!0)};df.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};
df.prototype.toString=function(){var a=x.kf(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.h&&(a+=" for "+this.h);return a+")"};x.defineProperty(df,{h:"diagram"},function(){return this.W},function(a){null!==a&&x.l(a,z,df,"diagram");this.W=a});x.defineProperty(df,{group:"group"},function(){return this.hz},function(a){this.hz!==a&&(null!==a&&x.l(a,F,df,"group"),this.hz=a,null!==a&&(this.W=a.h))});
x.defineProperty(df,{VI:"isOngoing"},function(){return this.nr},function(a){this.nr!==a&&(x.g(a,"boolean",df,"isOngoing"),this.nr=a)});x.defineProperty(df,{nF:"isInitial"},function(){return this.Lj},function(a){x.g(a,"boolean",df,"isInitial");this.Lj=a;a||(this.Co=!0)});x.defineProperty(df,{yx:"isViewportSized"},function(){return this.ur},function(a){this.ur!==a&&(x.g(a,"boolean",df,"isViewportSized"),(this.ur=a)&&this.J())});
x.defineProperty(df,{Pt:"isRouting"},function(){return this.pr},function(a){this.pr!==a&&(x.g(a,"boolean",df,"isRouting"),this.pr=a)});x.defineProperty(df,{oF:"isRealtime"},function(){return this.or},function(a){this.or!==a&&(x.g(a,"boolean",df,"isRealtime"),this.or=a)});x.defineProperty(df,{Hf:"isValidLayout"},function(){return this.Co},function(a){this.Co!==a&&(x.g(a,"boolean",df,"isValidLayout"),this.Co=a,a||(a=this.h,null!==a&&(a.Tu=!0)))});
df.prototype.invalidateLayout=df.prototype.J=function(){if(this.Co){var a=this.h;if(null!==a&&!a.qa.tb){var b=a.$a;!b.Bo&&(b.Df&&b.uj(),this.VI&&a.Le||this.nF&&!a.Le)&&(this.Hf=!1,a.Be())}}};x.defineProperty(df,{network:"network"},function(){return this.Az},function(a){var b=this.Az;b!==a&&(null!==a&&x.l(a,xa,df,"network"),null!==b&&(b.Tb=null),this.Az=a,null!==a&&(a.Tb=this))});df.prototype.createNetwork=function(){return new xa};
df.prototype.makeNetwork=function(a){var b=this.createNetwork();b.Tb=this;a instanceof z?(b.lk(a.yh,!0),b.lk(a.links,!0)):a instanceof F?b.lk(a.Gc):b.lk(a.i);return b};df.prototype.updateParts=function(){var a=this.h;if(null===a&&null!==this.network)for(var b=this.network.vertexes.i;b.next();){var c=b.value.Pc;if(null!==c&&(a=c.h,null!==a))break}this.Hf=!0;try{null!==a&&a.Wb("Layout"),this.commitLayout()}finally{null!==a&&a.Md("Layout")}};
df.prototype.commitLayout=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();if(this.Pt)for(a=this.network.edges.i;a.next();)a.value.commit()};
df.prototype.doLayout=function(a){null===a&&x.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new K(D);a instanceof z?(wp(this,b,a.yh,!0,this.NA,!0,!1,!0),wp(this,b,a.sj,!0,this.NA,!0,!1,!0)):a instanceof F?wp(this,b,a.Gc,!1,this.NA,!0,!1,!0):b.$c(a.i);var c=b.count;if(0<c){a=this.h;null!==a&&a.Wb("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.he.x,e=d,g=this.he.y,h=0,k=0,b=b.i;b.next();){var l=b.value;l.Af();var m=l.Ia,n=m.width,
m=m.height;l.moveTo(e,g);l.zz=!1;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.Md("Layout")}this.Hf=!0};df.prototype.NA=function(a){return!a.location.G()||a instanceof F&&a.zz?!0:!1};
function wp(a,b,c,d,e,g,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.Gp||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof E?l.Ef||(l instanceof F?null===l.Tb?wp(a,b,l.Gc,!1,e,g,h,k):b.add(l):b.add(l)):h&&l instanceof G?b.add(l):!k||!l.$d()||l instanceof E||b.add(l))}}
df.prototype.collectParts=df.prototype.FH=function(a){var b=new K(D);a instanceof z?(wp(this,b,a.yh,!0,null,!0,!0,!0),wp(this,b,a.links,!0,null,!0,!0,!0),wp(this,b,a.sj,!0,null,!0,!0,!0)):a instanceof F?wp(this,b,a.Gc,!1,null,!0,!0,!0):wp(this,b,a.i,!1,null,!0,!0,!0);return b};x.defineProperty(df,{he:"arrangementOrigin"},function(){return this.vq},function(a){x.l(a,N,df,"arrangementOrigin");this.vq.O(a)||(this.vq.assign(a),this.J())});
df.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.gb(Xb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};function xa(){x.lc(this);this.ee=null;this.clear()}x.ja("LayoutNetwork",xa);
xa.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new K(ya);this.edges=new K(Aa);this.RA=new ra(E,ya);this.DA=new ra(G,Aa)};
xa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Tb?"("+this.Tb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1<a){for(var c=this.vertexes.i;c.next();)b+="\n    "+c.value.toString(a-1);for(c=this.edges.i;c.next();)b+="\n    "+c.value.toString(a-1)}return b};x.defineProperty(xa,{Tb:"layout"},function(){return this.ee},function(a){u&&null!==a&&x.l(a,df,xa,"layout");this.ee=a});xa.prototype.createVertex=function(){return new ya};
xa.prototype.createEdge=function(){return new Aa};
xa.prototype.addParts=xa.prototype.lk=function(a,b,c){if(null!==a){void 0===b&&(b=!1);x.g(b,"boolean",xa,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof E)return!a.Ef;if(a instanceof G){var b=a.Z;if(null===b||b.Ef)return!1;a=a.fa;return null===a||a.Ef?!1:!0}return!1});for(a=a.i;a.next();){var d=a.value;if(d instanceof E&&(!b||d.Gp)&&d.canLayout()&&c(d))if(d instanceof F&&null===d.Tb)this.lk(d.Gc,!1);else if(null===this.on(d)){var e=this.createVertex();e.Pc=d;
this.xl(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof G&&(!b||d.Gp)&&d.canLayout()&&c(d)&&null===this.hx(d)){var g=d.Z,e=d.fa;null!==g&&null!==e&&g!==e&&(g=this.findGroupVertex(g),e=this.findGroupVertex(e),null!==g&&null!==e&&this.Mp(g,e,d))}}};xa.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.on(b);if(null!==a)return a;for(b=b.Xa;null!==b;){a=this.on(b);if(null!==a)return a;b=b.Xa}return null};
xa.prototype.addVertex=xa.prototype.xl=function(a){if(null!==a){u&&x.l(a,ya,xa,"addVertex:vertex");this.vertexes.add(a);var b=a.Pc;null!==b&&this.RA.add(b,a);a.network=this}};xa.prototype.addNode=xa.prototype.ct=function(a){if(null===a)return null;u&&x.l(a,E,xa,"addNode:node");var b=this.on(a);null===b&&(b=this.createVertex(),b.Pc=a,this.xl(b));return b};
xa.prototype.deleteVertex=xa.prototype.EE=function(a){if(null!==a&&(u&&x.l(a,ya,xa,"deleteVertex:vertex"),xp(this,a))){for(var b=a.Ye,c=b.count-1;0<=c;c--){var d=b.ia(c);this.op(d)}b=a.Ue;for(c=b.count-1;0<=c;c--)d=b.ia(c),this.op(d)}};function xp(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.RA.remove(b.Pc),b.network=null);return c}xa.prototype.deleteNode=function(a){null!==a&&(u&&x.l(a,E,xa,"deleteNode:node"),a=this.on(a),null!==a&&this.EE(a))};
xa.prototype.findVertex=xa.prototype.on=function(a){if(null===a)return null;u&&x.l(a,E,xa,"findVertex:node");return this.RA.oa(a)};xa.prototype.addEdge=xa.prototype.dp=function(a){if(null!==a){u&&x.l(a,Aa,xa,"addEdge:edge");this.edges.add(a);var b=a.link;null!==b&&null===this.hx(b)&&this.DA.add(b,a);b=a.toVertex;null!==b&&b.bE(a);b=a.fromVertex;null!==b&&b.aE(a);a.network=this}};
xa.prototype.addLink=function(a){if(null===a)return null;u&&x.l(a,G,xa,"addLink:link");var b=a.Z,c=a.fa,d=this.hx(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.ct(b)),null!==c&&(d.toVertex=this.ct(c)),this.dp(d)):(d.fromVertex=null!==b?this.ct(b):null,d.toVertex=null!==c?this.ct(c):null);return d};xa.prototype.deleteEdge=xa.prototype.op=function(a){if(null!==a){u&&x.l(a,Aa,xa,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.DE(a);b=a.fromVertex;null!==b&&b.CE(a);yp(this,a)}};
function yp(a,b){null!==b&&a.edges.remove(b)&&(a.DA.remove(b.link),b.network=null)}xa.prototype.deleteLink=function(a){null!==a&&(u&&x.l(a,G,xa,"deleteLink:link"),a=this.hx(a),null!==a&&this.op(a))};xa.prototype.findEdge=xa.prototype.hx=function(a){if(null===a)return null;u&&x.l(a,G,xa,"findEdge:link");return this.DA.oa(a)};
xa.prototype.linkVertexes=xa.prototype.Mp=function(a,b,c){if(null===a||null===b)return null;u&&(x.l(a,ya,xa,"linkVertexes:fromVertex"),x.l(b,ya,xa,"linkVertexes:toVertex"),null!==c&&x.l(c,G,xa,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.dp(d);return d}return null};
xa.prototype.reverseEdge=xa.prototype.Rx=function(a){if(null!==a){u&&x.l(a,Aa,xa,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.CE(a),c.DE(a),a.Rx(),b.bE(a),c.aE(a))}};xa.prototype.deleteSelfEdges=xa.prototype.ax=function(){for(var a=x.ub(),b=this.edges.i;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.op(a[c]);x.xa(a)};
xa.prototype.deleteArtificialVertexes=function(){for(var a=x.ub(),b=this.vertexes.i;b.next();){var c=b.value;null===c.Pc&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.EE(a[b]);c=x.ub();for(b=this.edges.i;b.next();){var d=b.value;null===d.link&&c.push(d)}d=c.length;for(b=0;b<d;b++)this.op(c[b]);x.xa(a);x.xa(c)};function zp(a){for(var b=x.ub(),c=a.edges.i;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.op(b[d]);x.xa(b)}
xa.prototype.splitIntoSubNetworks=xa.prototype.aK=function(){this.deleteArtificialVertexes();zp(this);this.ax();for(var a=new J(xa),b=!0;b;)for(var b=!1,c=this.vertexes.i;c.next();){var d=c.value;if(0<d.Ye.count||0<d.Ue.count){b=this.Tb.createNetwork();a.add(b);Ap(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 Ap(a,b,c){if(null!==c&&c.network!==b){xp(a,c);b.xl(c);for(var d=c.tc;d.next();){var e=d.value;e.network!==b&&(yp(a,e),b.dp(e),Ap(a,b,e.fromVertex))}for(d=c.hc;d.next();)c=d.value,c.network!==b&&(yp(a,c),b.dp(c),Ap(a,b,c.toVertex))}}xa.prototype.findAllParts=function(){for(var a=new K(D),b=this.vertexes.i;b.next();)a.add(b.value.Pc);for(b=this.edges.i;b.next();)a.add(b.value.link);return a};
function ya(){x.lc(this);this.network=null;this.Q=(new w(0,0,10,10)).freeze();this.R=(new N(5,5)).freeze();this.clear()}x.ja("LayoutVertex",ya);ya.prototype.clear=function(){this.Dd=this.Ke=null;this.Ye=new J(Aa);this.Ue=new J(Aa)};
ya.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+x.od(this);if(0<a&&(b+=null!==this.Pc?"("+this.Pc.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Ye.i;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Ue.i;d.next();){var g=d.value;c?c=!1:e+=",";e+=g.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
x.defineProperty(ya,{data:"data"},function(){return this.Ke},function(a){this.Ke=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.R.n(d/2,b/2);this.Q.n(a,c,d,b)}});
x.defineProperty(ya,{Pc:"node"},function(){return this.Dd},function(a){if(this.Dd!==a){u&&null!==a&&x.l(a,E,ya,"node");this.Dd=a;a.Af();var b=a.ba,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.Q.n(c,d,e,b);if(!(a instanceof F)&&(a=a.$b.gb(dc),a.G())){this.R.n(a.x-c,a.y-d);return}this.R.n(e/2,b/2)}});x.defineProperty(ya,{Cb:"bounds"},function(){return this.Q},function(a){this.Q.O(a)||(u&&x.l(a,w,ya,"bounds"),this.Q.assign(a))});
x.defineProperty(ya,{focus:"focus"},function(){return this.R},function(a){this.R.O(a)||(u&&x.l(a,N,ya,"focus"),this.R.assign(a))});x.defineProperty(ya,{sa:"centerX"},function(){return this.Q.x+this.R.x},function(a){var b=this.Q;b.x+this.R.x!==a&&(u&&x.p(a,ya,"centerX"),b.Va(),b.x=a-this.R.x,b.freeze())});x.defineProperty(ya,{Aa:"centerY"},function(){return this.Q.y+this.R.y},function(a){var b=this.Q;b.y+this.R.y!==a&&(u&&x.p(a,ya,"centerY"),b.Va(),b.y=a-this.R.y,b.freeze())});
x.defineProperty(ya,{Bt:"focusX"},function(){return this.R.x},function(a){var b=this.R;b.x!==a&&(b.Va(),b.x=a,b.freeze())});x.defineProperty(ya,{Ct:"focusY"},function(){return this.R.y},function(a){var b=this.R;b.y!==a&&(b.Va(),b.y=a,b.freeze())});x.defineProperty(ya,{x:"x"},function(){return this.Q.x},function(a){var b=this.Q;b.x!==a&&(b.Va(),b.x=a,b.freeze())});x.defineProperty(ya,{y:"y"},function(){return this.Q.y},function(a){var b=this.Q;b.y!==a&&(b.Va(),b.y=a,b.freeze())});
x.defineProperty(ya,{width:"width"},function(){return this.Q.width},function(a){var b=this.Q;b.width!==a&&(b.Va(),b.width=a,b.freeze())});x.defineProperty(ya,{height:"height"},function(){return this.Q.height},function(a){var b=this.Q;b.height!==a&&(b.Va(),b.height=a,b.freeze())});
ya.prototype.commit=function(){var a=this.Ke;if(null!==a){var b=this.Cb,c=a.bounds;x.Ya(c)?(c.x=b.x,c.y=b.y,c.width=b.width,c.height=b.height):a.bounds=b.copy()}else if(a=this.Pc,null!==a){b=this.Cb;if(!(a instanceof F)){var c=a.ba,d=a.$b.gb(dc);if(c.G()&&d.G()){a.moveTo(b.x+this.Bt-(d.x-c.x),b.y+this.Ct-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};ya.prototype.addSourceEdge=ya.prototype.bE=function(a){null!==a&&(u&&x.l(a,Aa,ya,"addSourceEdge:edge"),this.Ye.contains(a)||this.Ye.add(a))};
ya.prototype.deleteSourceEdge=ya.prototype.DE=function(a){null!==a&&(u&&x.l(a,Aa,ya,"deleteSourceEdge:edge"),this.Ye.remove(a))};ya.prototype.addDestinationEdge=ya.prototype.aE=function(a){null!==a&&(u&&x.l(a,Aa,ya,"addDestinationEdge:edge"),this.Ue.contains(a)||this.Ue.add(a))};ya.prototype.deleteDestinationEdge=ya.prototype.CE=function(a){null!==a&&(u&&x.l(a,Aa,ya,"deleteDestinationEdge:edge"),this.Ue.remove(a))};
x.w(ya,{$J:"sourceVertexes"},function(){for(var a=new K(ya),b=this.tc;b.next();)a.add(b.value.fromVertex);return a.i});x.w(ya,{ZH:"destinationVertexes"},function(){for(var a=new K(ya),b=this.hc;b.next();)a.add(b.value.toVertex);return a.i});x.w(ya,{vertexes:"vertexes"},function(){for(var a=new K(ya),b=this.tc;b.next();)a.add(b.value.fromVertex);for(b=this.hc;b.next();)a.add(b.value.toVertex);return a.i});x.w(ya,{tc:"sourceEdges"},function(){return this.Ye.i});x.w(ya,{hc:"destinationEdges"},function(){return this.Ue.i});
x.w(ya,{edges:"edges"},function(){for(var a=new J(Aa),b=this.tc;b.next();)a.add(b.value);for(b=this.hc;b.next();)a.add(b.value);return a.i});x.w(ya,{kI:"edgesCount"},function(){return this.Ye.count+this.Ue.count});var Bp;ya.standardComparer=Bp=function(a,b){u&&x.l(a,ya,ya,"standardComparer:m");u&&x.l(b,ya,ya,"standardComparer:n");var c=a.Dd,d=b.Dd;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
ya.smartComparer=function(a,b){u&&x.l(a,ya,ya,"smartComparer:m");u&&x.l(b,ya,ya,"smartComparer:n");if(null!==a){if(null!==b){var c=a.Dd,d=b.Dd;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),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 Aa(){x.lc(this);this.network=null;this.clear()}x.ja("LayoutEdge",Aa);Aa.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
Aa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+x.od(this);0<a&&(b+=null!==this.link?"("+this.link.toString()+")":"",1<a&&(b+=" "+(this.fromVertex?this.fromVertex.toString():"null")+" --\x3e "+(this.toVertex?this.toVertex.toString():"null")));return b};Aa.prototype.Rx=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};Aa.prototype.commit=function(){};
Aa.prototype.getOtherVertex=Aa.prototype.wI=function(a){u&&x.l(a,ya,Aa,"getOtherVertex:v");return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function rl(){0<arguments.length&&x.pd(rl);df.call(this);this.yx=!0;this.Ys=this.Zs=NaN;this.Aj=(new Fa(NaN,NaN)).freeze();this.fi=(new Fa(10,10)).freeze();this.Ie=zm;this.rd=xm;this.ei=tm;this.Nh=Cp}x.Qa(rl,df);x.ja("GridLayout",rl);
rl.prototype.cloneProtected=function(a){df.prototype.cloneProtected.call(this,a);a.Zs=this.Zs;a.Ys=this.Ys;a.Aj.assign(this.Aj);a.fi.assign(this.fi);a.Ie=this.Ie;a.rd=this.rd;a.ei=this.ei;a.Nh=this.Nh};
rl.prototype.doLayout=function(a){null===a&&x.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.he=this.initialOrigin(this.he);var b=this.h;a=this.FH(a);for(var c=a.copy().i;c.next();){var d=c.value;if(d instanceof G){var e=d;if(null!==e.Z||null!==e.fa){a.remove(e);continue}}d.Af();if(d instanceof F)for(d=d.Gc;d.next();)a.remove(d.value)}e=a.kc();if(0!==e.length){switch(this.sorting){case wm:e.reverse();break;case tm:e.sort(this.comparer);
break;case um:e.sort(this.comparer),e.reverse()}var g=this.oK;isNaN(g)&&(g=0);var h=this.GG,h=isNaN(h)&&null!==b?Math.max(b.Ab.width-b.padding.left-b.padding.right,0):Math.max(this.GG,0);0>=g&&0>=h&&(g=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Wb("Layout");d=[];switch(this.alignment){case Am:var k=a,l=c,m=Math.max(this.ip.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.Ia,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.ip.height,
1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.Ia,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.Zf,t=this.he.x,v=t,y=this.he.y,A=0,B=0,n=0;n<e.length;n++){var p=e[n],q=p.Ia,C=Math.ceil((q.width+k)/m)*m,M=Math.ceil((q.height+l)/r)*r,I=0;switch(s){case ym:I=Math.abs(v-q.width);break;default:I=v+q.width}if(0<g&&A>g-1||0<h&&0<A&&I>h)d.push(new w(0,y,h+k,B)),A=0,v=t,y+=B,B=0;B=Math.max(B,M);M=0;switch(s){case ym:M=-q.width;break;default:M=0}p.moveTo(v+M,y);switch(s){case ym:v-=C;break;
default:v+=C}A++}d.push(new w(0,y,h+k,B));break;case zm:k=g;l=a;m=c;n=Math.max(this.ip.width,1);p=y=C=0;q=x.P();for(g=0;g<e.length;g++)r=e[g],s=r.Ia,t=mo(r,r.$b,r.of,q),C=Math.max(C,t.x),y=Math.max(y,s.width-t.x),p=Math.max(p,t.y);v=this.Zf;switch(v){case ym:C+=l;break;default:y+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(C+y,1),V=y=this.he.x,A=this.he.y,B=0;h>=C&&(h-=C);for(var C=M=0,I=Math.max(this.ip.height,1),ea=p=0,W=!0,P=x.P(),g=0;g<e.length;g++){r=e[g];s=r.Ia;t=mo(r,r.$b,r.of,q);if(0<B)switch(v){case ym:V=
(V-y-(s.width-t.x))/n;V=Q.jb(Math.round(V),V)?Math.round(V):Math.floor(V);V=V*n+y;break;default:V=(V-y+t.x)/n,V=Q.jb(Math.round(V),V)?Math.round(V):Math.ceil(V),V=V*n+y}else switch(v){case ym:M=V+t.x+s.width;break;default:M=V-t.x}var ba=0;switch(v){case ym:ba=-(V+t.x)+M;break;default:ba=V+s.width-t.x-M}if(0<k&&B>k-1||0<h&&0<B&&ba>h){d.push(new w(0,W?A-p:A,h+l,ea+p+m));for(V=0;V<B&&g!==B;V++){var ba=e[g-B+V],Na=mo(ba,ba.$b,ba.of,P);ba.moveTo(ba.position.x,ba.position.y+p-Na.y)}ea+=m;A=W?A+ea:A+(ea+
p);B=ea=p=0;V=y;W=!1}V===y&&(C=v===ym?Math.max(C,s.width-t.x):Math.min(C,-t.x));p=Math.max(p,t.y);ea=Math.max(ea,s.height-t.y);isFinite(I)&&(ea=Math.max(ea,Math.max(s.height,I)-t.y));W?r.moveTo(V-t.x,A-t.y):r.moveTo(V-t.x,A);switch(v){case ym:V-=t.x+l;break;default:V+=s.width-t.x+l}B++}d.push(new w(0,A,h+l,(W?ea:ea+p)+m));for(V=0;V<B&&g!==B;V++)ba=e[g-B+V],Na=mo(ba,ba.$b,ba.of,q),ba.moveTo(ba.position.x,ba.position.y+p-Na.y);x.A(q);x.A(P);if(v===ym)for(g=0;g<d.length;g++)e=d[g],e.width+=C,e.x-=C;
else for(g=0;g<d.length;g++)e=d[g],e.x>C&&(e.width+=e.x-C,e.x=C)}for(k=g=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),g=Math.max(g,l.x+l.width);this.Zf===ym?this.commitLayers(d,new N(e+a/2-(g+e),h-c/2)):this.commitLayers(d,new N(e-a/2,h-c/2));null!==b&&b.Md("Layout");this.Hf=!0}};rl.prototype.commitLayers=function(){};
x.defineProperty(rl,{GG:"wrappingWidth"},function(){return this.Zs},function(a){this.Zs!==a&&(x.g(a,"number",rl,"wrappingWidth"),0<a||isNaN(a))&&(this.Zs=a,this.yx=isNaN(a),this.J())});x.defineProperty(rl,{oK:"wrappingColumn"},function(){return this.Ys},function(a){this.Ys!==a&&(x.g(a,"number",rl,"wrappingColumn"),0<a||isNaN(a))&&(this.Ys=a,this.J())});x.defineProperty(rl,{ip:"cellSize"},function(){return this.Aj},function(a){x.l(a,Fa,rl,"cellSize");this.Aj.O(a)||(this.Aj.assign(a),this.J())});
x.defineProperty(rl,{spacing:"spacing"},function(){return this.fi},function(a){x.l(a,Fa,rl,"spacing");this.fi.O(a)||(this.fi.assign(a),this.J())});x.defineProperty(rl,{alignment:"alignment"},function(){return this.Ie},function(a){this.Ie!==a&&(x.Ca(a,rl,rl,"alignment"),a===zm||a===Am)&&(this.Ie=a,this.J())});x.defineProperty(rl,{Zf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(x.Ca(a,rl,rl,"arrangement"),a===xm||a===ym)&&(this.rd=a,this.J())});
x.defineProperty(rl,{sorting:"sorting"},function(){return this.ei},function(a){this.ei!==a&&(x.Ca(a,rl,rl,"sorting"),a===vm||a===wm||a===tm||a===um)&&(this.ei=a,this.J())});x.defineProperty(rl,{comparer:"comparer"},function(){return this.Nh},function(a){this.Nh!==a&&(x.g(a,"function",rl,"comparer"),this.Nh=a,this.J())});var Cp;rl.standardComparer=Cp=function(a,b){u&&x.l(a,D,rl,"standardComparer:a");u&&x.l(b,D,rl,"standardComparer:b");var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
rl.smartComparer=function(a,b){u&&x.l(a,D,rl,"standardComparer:a");u&&x.l(b,D,rl,"standardComparer:b");if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),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 Am;rl.Position=Am=x.s(rl,"Position",0);var zm;rl.Location=zm=x.s(rl,"Location",1);var xm;rl.LeftToRight=xm=x.s(rl,"LeftToRight",2);var ym;rl.RightToLeft=ym=x.s(rl,"RightToLeft",3);var vm;rl.Forward=vm=x.s(rl,"Forward",4);var wm;rl.Reverse=wm=x.s(rl,"Reverse",5);var tm;rl.Ascending=tm=x.s(rl,"Ascending",6);var um;rl.Descending=um=x.s(rl,"Descending",7);
function Bm(){0<arguments.length&&x.pd(Bm);df.call(this);this.Zy=this.mo=this.Ud=0;this.Xq=360;this.Yy=Tm;this.Yk=0;this.wC=Tm;this.bv=this.Bg=this.QD=0;this.Hw=new Dp;this.dv=this.Hm=0;this.bH=600;this.gs=NaN;this.xq=1;this.Ls=0;this.Ns=360;this.rd=Tm;this.ga=Pm;this.ei=Gm;this.Nh=Bp;this.fi=6;this.Xr=Wm}x.Qa(Bm,df);x.ja("CircularLayout",Bm);
Bm.prototype.cloneProtected=function(a){df.prototype.cloneProtected.call(this,a);a.gs=this.gs;a.xq=this.xq;a.Ls=this.Ls;a.Ns=this.Ns;a.rd=this.rd;a.ga=this.ga;a.ei=this.ei;a.Nh=this.Nh;a.fi=this.fi;a.Xr=this.Xr};Bm.prototype.createNetwork=function(){return new Ep};
Bm.prototype.doLayout=function(a){null===a&&x.k("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.first(),a.sa=0,a.Aa=0);else{var b=new J(Fp);b.$c(a.i);a=new J(Fp);var c=new J(Fp),d;d=this.sort(b);var e=this.Yy,g=this.wC,h=this.Ud,k=this.mo,l=this.Zy,m=this.Xq,b=this.Yk,n=this.QD,p=this.Bg,q=this.bv,e=this.Zf,g=this.Fx,h=this.EJ;if(!isFinite(h)||
0>=h)h=NaN;k=this.xH;if(!isFinite(k)||0>=k)k=1;l=this.De;isFinite(l)||(l=0);m=this.Nf;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Um&&g===Vm?e=Tm:e===Um&&g!==Vm&&(g=Vm,e=this.Zf);if((this.direction===Hm||this.direction===Om)&&this.sorting!==Gm){for(var r=0;!(r>=d.length);r+=2){a.add(d.ia(r));if(r+1>=d.length)break;c.add(d.ia(r+1))}this.direction===Hm?(this.Zf===Um&&a.reverse(),d=new J(Fp),d.$c(a),d.$c(c)):(this.Zf===Um&&c.reverse(),d=new J(Fp),d.$c(c),d.$c(a))}for(var s=
d.length,t=n=0,r=0;r<d.length;r++){var p=l+m*t*(this.direction===Pm?1:-1)/s,v=d.ia(r).diameter;isNaN(v)&&(v=Gp(d.ia(r),p));360>m&&(0===r||r===d.length-1)&&(v/=2);n+=v;t++}if(isNaN(h)||e===Um){isNaN(b)&&(b=6);if(e!==Tm&&e!==Um){v=-Infinity;for(r=0;r<s;r++){var q=d.ia(r),y=d.ia(r===s-1?0:r+1);isNaN(q.diameter)&&Gp(q,0);isNaN(y.diameter)&&Gp(y,0);v=Math.max(v,(q.diameter+y.diameter)/2)}q=v+b;e===Rm?(p=2*Math.PI/s,h=(v+b)/p):h=Hp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180)}else h=Hp(this,n+(360<=
m?s:s-1)*(e!==Um?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,t=Ip(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===Tm||e===Um)b=(t-n)/(360<=m?s:s-1)}else if(e===Tm||e===Um)r=(t-n)/(360<=m?s:s-1),r<b?(h=Hp(this,n+b*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180),p=h*k):b=r;else{v=-Infinity;for(r=0;r<s;r++)q=d.ia(r),y=d.ia(r===s-1?0:r+1),isNaN(q.diameter)&&Gp(q,0),isNaN(y.diameter)&&Gp(y,0),v=Math.max(v,(q.diameter+y.diameter)/2);q=v+b;r=Hp(this,q*(360<=m?s:s-1),k,l*Math.PI/180,
m*Math.PI/180);r>h?(h=r,p=h*k):q=t/(360<=m?s:s-1)}this.Yy=e;this.wC=g;this.Ud=h;this.mo=k;this.Zy=l;this.Xq=m;this.Yk=b;this.QD=n;this.Bg=p;this.bv=q;b=d;d=this.Yy;e=this.Ud;g=this.Zy;k=this.Xq;l=this.Yk;m=this.Bg;n=this.bv;if(this.direction!==Hm&&this.direction!==Om||d!==Um)if(this.direction===Hm||this.direction===Om){h=0;switch(d){case Sm:h=180*Jp(this,e,m,g,n)/Math.PI;break;case Tm:n=b=0;h=a.first();null!==h&&(b=Gp(h,Math.PI/2));h=c.first();null!==h&&(n=Gp(h,Math.PI/2));h=180*Jp(this,e,m,g,l+(b+
n)/2)/Math.PI;break;case Rm:h=k/b.length}if(this.direction===Hm){switch(d){case Sm:Kp(this,a,g,Qm);break;case Tm:Lp(this,a,g,Qm);break;case Rm:Mp(this,a,k/2,g,Qm)}switch(d){case Sm:Kp(this,c,g+h,Pm);break;case Tm:Lp(this,c,g+h,Pm);break;case Rm:Mp(this,c,k/2,g+h,Pm)}}else{switch(d){case Sm:Kp(this,c,g,Qm);break;case Tm:Lp(this,c,g,Qm);break;case Rm:Mp(this,c,k/2,g,Qm)}switch(d){case Sm:Kp(this,a,g+h,Pm);break;case Tm:Lp(this,a,g+h,Pm);break;case Rm:Mp(this,a,k/2,g+h,Pm)}}}else switch(d){case Sm:Kp(this,
b,g,this.direction);break;case Tm:Lp(this,b,g,this.direction);break;case Rm:Mp(this,b,k,g,this.direction);break;case Um:Np(this,b,k,g,this.direction)}else Np(this,b,k,g-k/2,Pm)}this.updateParts();this.network=null;this.Hf=!0};
function Mp(a,b,c,d,e){var g=a.Xq,h=a.Ud;a=a.Bg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===Pm?l*c/(360<=g?k:k-1):-(l*c)/k),n=b.ia(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.sa=p*Math.cos(m);n.Aa=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
function Lp(a,b,c,d){var e=a.Ud,g=a.Bg,h=a.Yk;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ia(l),n=b.ia(l===k-1?0:l+1),p=g*Math.sin(c);m.sa=e*Math.cos(c);m.Aa=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&Gp(m,0);isNaN(n.diameter)&&Gp(n,0);m=Jp(a,e,g,d===Pm?c:-c,(m.diameter+n.diameter)/2+h);c+=d===Pm?m:-m}}
function Kp(a,b,c,d){var e=a.Ud,g=a.Bg,h=a.bv;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ia(l);m.sa=e*Math.cos(c);m.Aa=g*Math.sin(c);m.actualAngle=180*c/Math.PI;m=Jp(a,e,g,d===Pm?c:-c,h);c+=d===Pm?m:-m}}function Np(a,b,c,d,e){var g=a.dv,g=a.Xq;a.Hm=0;a.Hw=new Dp;if(360>c){for(g=d+(e===Pm?g:-g);0>g;)g+=360;g%=360;180<g&&(g-=360);g*=Math.PI/180;a.dv=g;Op(a,b,c,d,e)}else Pp(a,b,c,d,e);a.Hw.commit(b)}
function Pp(a,b,c,d,e){var g=a.Ud,h=a.Yk,k=a.mo,l=g*Math.cos(d*Math.PI/180),m=a.Bg*Math.sin(d*Math.PI/180),n=b.kc();if(3===n.length)n[0].sa=g,n[0].Aa=0,n[1].sa=n[0].sa-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].sa=(n[0].sa+n[1].sa)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].sa=g,n[0].Aa=0,n[2].sa=-n[0].sa,n[2].Aa=n[0].Aa,n[1].sa=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].sa=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var g=x.P(),p=0;p<n.length;p++){n[p].sa=
l;n[p].Aa=m;if(p>=n.length-1)break;Qp(a,l,m,n,p,e,g)||Rp(a,l,m,n,p,e,g);l=g.x;m=g.y}x.A(g);a.Hm++;if(!(23<a.Hm)){var l=n[0].sa,m=n[0].Aa,g=n[n.length-1].sa,p=n[n.length-1].Aa,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===Pm?q:!q)h=-Math.abs(h),h=Math.min(h,-n[n.length-1].width),
h=Math.min(h,-n[n.length-1].height);a.Hw.compare(h,n);1<Math.abs(h)&&(a.Ud=8>a.Hm?a.Ud-h/(2*Math.PI):5>n.length&&10<h?a.Ud/2:a.Ud-(0<h?1.7:-2.3),a.Bg=a.Ud*k,Pp(a,b,c,d,e))}}}
function Op(a,b,c,d,e){for(var g=a.Ud,h=a.Bg,k=a.mo,l=g*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=x.P(),p=b.kc(),q=0;q<p.length;q++){p[q].sa=l;p[q].Aa=m;if(q>=p.length-1)break;Qp(a,l,m,p,q,e,n)||Rp(a,l,m,p,q,e,n);l=n.x;m=n.y}x.A(n);a.Hm++;if(!(23<a.Hm)){l=Math.atan2(m,l);l=e===Pm?a.dv-l:l-a.dv;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;g=l*(g+h)/2;h=a.Hw;if(Math.abs(g)<Math.abs(h.wp))for(h.wp=g,h.Jn=[],h.lq=[],l=0;l<p.length;l++)h.Jn[l]=p[l].Cb.x,h.lq[l]=p[l].Cb.y;1<Math.abs(g)&&
(a.Ud=8>a.Hm?a.Ud-g/(2*Math.PI):a.Ud-(0<g?1.7:-2.3),a.Bg=a.Ud*k,Op(a,b,c,d,e))}}function Qp(a,b,c,d,e,g,h){var k=a.Ud,l=a.Bg,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.Yk;var p=!1;if(0<=c!==(g===Pm)){if(m=b+a,m>k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0}
function Rp(a,b,c,d,e,g,h){var k=a.Ud,l=a.Bg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.Yk;d=!1;if(0<=b!==(g===Pm)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Bm.prototype.commitLayout=function(){this.commitNodes();this.Pt&&this.commitLinks()};
Bm.prototype.commitNodes=function(){for(var a=this.mH,b=this.network.vertexes.i;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};Bm.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
function Ip(a,b,c,d,e){var g=a.bH;if(.001>Math.abs(a.mo-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;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function Hp(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?Ip(a,1,c,d,e):Ip(a,1,c);return b/g}
function Jp(a,b,c,d,e){if(.001>Math.abs(a.mo-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}}
Bm.prototype.sort=function(a){switch(this.sorting){case Em:break;case Fm:a.reverse();break;case Cm:a.sort(this.comparer);break;case Dm:a.sort(this.comparer);a.reverse();break;case Gm:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new J(Fp),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.ia(h).kI;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.ia(g));b[g]=-1;g=a.ia(g);e=0;for(h=g.tc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
b[e]++;for(g=g.hc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;b<d.length;b++){h=d.ia(b);a[b]=[];for(var l=0,c=h.hc;c.next();)l=d.indexOf(c.value.toVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l);for(c=h.tc;c.next();)l=d.indexOf(c.value.fromVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l)}h=[];for(b=0;b<a.length;b++)h[b]=0;for(var c=[],k=[],m=[],e=[],g=new J(Fp),n=0,b=0;b<a.length;b++){var p=a[b].length;if(1===p)e.push(b);else if(0===p)g.add(d.ia(b));else{if(0===n)c.push(b);
else{for(var q=Infinity,r=Infinity,s=-1,t=[],p=0;p<c.length;p++)0>a[c[p]].indexOf(c[p===c.length-1?0:p+1])&&t.push(p===c.length-1?0:p+1);if(0===t.length)for(p=0;p<c.length;p++)t.push(p);for(p=0;p<t.length;p++){var v=t[p],y,l=a[b];y=k;for(var A=m,B=h,C=v,M=c,I=0,V=0;V<y.length;V++){var ea=B[y[V]],W=B[A[V]],P=0,ba=0;ea<W?(P=ea,ba=W):(P=W,ba=ea);if(P<C&&C<=ba)for(ea=0;ea<l.length;ea++)W=l[ea],0>M.indexOf(W)||P<B[W]&&B[W]<ba||P===B[W]||ba===B[W]||I++;else for(ea=0;ea<l.length;ea++)W=l[ea],0>M.indexOf(W)||
P<B[W]&&B[W]<ba&&P!==B[W]&&ba!==B[W]&&I++}y=I;for(B=A=0;B<a[b].length;B++)l=c.indexOf(a[b][B]),0<=l&&(l=Math.abs(v-(l>=v?l+1:l)),A+=l<c.length+1-l?l:c.length+1-l);for(B=0;B<k.length;B++)l=h[k[B]],C=h[m[B]],l>=v&&l++,C>=v&&C++,l>C&&(M=C,C=l,l=M),C-l<(c.length+2)/2===(l<v&&v<=C)&&A++;if(y<q||y===q&&A<r)q=y,r=A,s=v}c.splice(s,0,b);for(p=0;p<c.length;p++)h[c[p]]=p;for(p=0;p<a[b].length;p++)q=a[b][p],0<=c.indexOf(q)&&(k.push(b),m.push(q))}n++}}k=!1;for(m=c.length;;){k=!0;for(h=0;h<e.length;h++)if(b=e[h],
n=a[b][0],l=c.indexOf(n),0<=l){for(r=p=0;r<a[n].length;r++)q=a[n][r],q=c.indexOf(q),0>q||q===l||(s=q>l?q-l:l-q,p+=q<l!==s>m-s?1:-1);c.splice(0>p?l:l+1,0,b);e.splice(h,1);h--}else k=!1;if(k)break;else c.push(e[0]),e.splice(0,1)}for(b=0;b<c.length;b++)l=c[b],g.add(d.ia(l));return g;default:x.k("Invalid sorting type.")}return a};x.defineProperty(Bm,{EJ:"radius"},function(){return this.gs},function(a){this.gs!==a&&(x.g(a,"number",Bm,"radius"),0<a||isNaN(a))&&(this.gs=a,this.J())});
x.defineProperty(Bm,{xH:"aspectRatio"},function(){return this.xq},function(a){this.xq!==a&&(x.g(a,"number",Bm,"aspectRatio"),0<a&&(this.xq=a,this.J()))});x.defineProperty(Bm,{De:"startAngle"},function(){return this.Ls},function(a){this.Ls!==a&&(x.g(a,"number",Bm,"startAngle"),this.Ls=a,this.J())});x.defineProperty(Bm,{Nf:"sweepAngle"},function(){return this.Ns},function(a){this.Ns!==a&&(x.g(a,"number",Bm,"sweepAngle"),this.Ns=0<a&&360>=a?a:360,this.J())});
x.defineProperty(Bm,{Zf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(x.Ca(a,Bm,Bm,"arrangement"),a===Um||a===Tm||a===Sm||a===Rm)&&(this.rd=a,this.J())});x.defineProperty(Bm,{direction:"direction"},function(){return this.ga},function(a){this.ga!==a&&(x.Ca(a,Bm,Bm,"direction"),a===Pm||a===Qm||a===Hm||a===Om)&&(this.ga=a,this.J())});
x.defineProperty(Bm,{sorting:"sorting"},function(){return this.ei},function(a){this.ei!==a&&(x.Ca(a,Bm,Bm,"sorting"),a===Em||a===Fm||a===Cm||Dm||a===Gm)&&(this.ei=a,this.J())});x.defineProperty(Bm,{comparer:"comparer"},function(){return this.Nh},function(a){this.Nh!==a&&(x.g(a,"function",Bm,"comparer"),this.Nh=a,this.J())});x.defineProperty(Bm,{spacing:"spacing"},function(){return this.fi},function(a){this.fi!==a&&(x.g(a,"number",Bm,"spacing"),this.fi=a,this.J())});
x.defineProperty(Bm,{Fx:"nodeDiameterFormula"},function(){return this.Xr},function(a){this.Xr!==a&&(x.Ca(a,Bm,Bm,"nodeDiameterFormula"),a===Wm||a===Vm)&&(this.Xr=a,this.J())});x.w(Bm,{nH:"actualXRadius"},function(){return this.Ud});x.w(Bm,{oH:"actualYRadius"},function(){return this.Bg});x.w(Bm,{rK:"actualSpacing"},function(){return this.Yk});x.w(Bm,{mH:"actualCenter"},function(){return isNaN(this.he.x)||isNaN(this.he.y)?new N(0,0):new N(this.he.x+this.nH,this.he.y+this.oH)});var Tm;
Bm.ConstantSpacing=Tm=x.s(Bm,"ConstantSpacing",0);var Sm;Bm.ConstantDistance=Sm=x.s(Bm,"ConstantDistance",1);var Rm;Bm.ConstantAngle=Rm=x.s(Bm,"ConstantAngle",2);var Um;Bm.Packed=Um=x.s(Bm,"Packed",3);var Pm;Bm.Clockwise=Pm=x.s(Bm,"Clockwise",4);var Qm;Bm.Counterclockwise=Qm=x.s(Bm,"Counterclockwise",5);var Hm;Bm.BidirectionalLeft=Hm=x.s(Bm,"BidirectionalLeft",6);var Om;Bm.BidirectionalRight=Om=x.s(Bm,"BidirectionalRight",7);var Em;Bm.Forwards=Em=x.s(Bm,"Forwards",8);var Fm;
Bm.Reverse=Fm=x.s(Bm,"Reverse",9);var Cm;Bm.Ascending=Cm=x.s(Bm,"Ascending",10);var Dm;Bm.Descending=Dm=x.s(Bm,"Descending",11);var Gm;Bm.Optimized=Gm=x.s(Bm,"Optimized",12);var Wm;Bm.Pythagorean=Wm=x.s(Bm,"Pythagorean",13);var Vm;Bm.Circular=Vm=x.s(Bm,"Circular",14);function Dp(){this.wp=-Infinity;this.lq=this.Jn=null}
Dp.prototype.compare=function(a,b){if(0<a&&0>this.wp||Math.abs(a)<Math.abs(this.wp)&&!(0>a&&0<this.wp)){this.wp=a;this.Jn=[];this.lq=[];for(var c=0;c<b.length;c++)this.Jn[c]=b[c].Cb.x,this.lq[c]=b[c].Cb.y}};Dp.prototype.commit=function(a){if(null!==this.Jn&&null!==this.lq)for(var b=0;b<this.Jn.length;b++){var c=a.ia(b);c.x=this.Jn[b];c.y=this.lq[b]}};function Ep(){xa.call(this)}x.Qa(Ep,xa);x.ja("CircularNetwork",Ep);Ep.prototype.createVertex=function(){return new Fp};Ep.prototype.createEdge=function(){return new Sp};
function Fp(){ya.call(this);this.actualAngle=this.diameter=NaN}x.Qa(Fp,ya);x.ja("CircularVertex",Fp);
function Gp(a,b){var c=a.network;if(null===c)return NaN;c=c.Tb;if(null===c)return NaN;if(c.Zf===Um)if(c.Fx===Vm)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.Fx===Vm?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function Sp(){Aa.call(this)}x.Qa(Sp,Aa);x.ja("CircularEdge",Sp);
function Tp(){0<arguments.length&&x.pd(Tp);df.call(this);this.Ag=null;this.wr=0;this.lg=(new Fa(100,100)).freeze();this.wq=!1;this.ci=!0;this.Mh=!1;this.Ko=100;this.Zq=1;this.Uh=1E3;this.hs=Math;this.eo=.05;this.co=50;this.$n=150;this.bo=0;this.Rq=10;this.Qq=5}x.Qa(Tp,df);x.ja("ForceDirectedLayout",Tp);
Tp.prototype.cloneProtected=function(a){df.prototype.cloneProtected.call(this,a);a.lg.assign(this.lg);a.wq=this.wq;a.ci=this.ci;a.Mh=this.Mh;a.Ko=this.Ko;a.Zq=this.Zq;a.Uh=this.Uh;a.hs=this.hs;a.eo=this.eo;a.co=this.co;a.$n=this.$n;a.bo=this.bo;a.Rq=this.Rq;a.Qq=this.Qq};Tp.prototype.createNetwork=function(){return new Up};
Tp.prototype.doLayout=function(a){null===a&&x.k("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.GA;if(0<this.network.vertexes.count){this.network.ax();for(var b=this.network.vertexes.i;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.i;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
this.Wz();this.wr=0;if(this.needsClusterLayout()){b=this.network;for(c=b.aK().i;c.next();){this.network=c.value;for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.hg=e.vertexes.count;e.zk=1;e.dn=null;e.Gh=null}Vp(this,0,a)}this.network=b;c.reset();u&&x.l(b,Up,Tp,"arrangeConnectedGraphs:singletons");for(var d=this.gE,g=c.count,h=!0,k=e=0,l=x.ub(),m=0;m<g+b.vertexes.count+2;m++)l[m]=null;g=0;c.reset();for(var n=x.kg();c.next();)if(m=c.value,this.oh(m,n),h)h=!1,e=n.x+n.width/2,k=n.y+n.height/
2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=2;else{var p=Wp(l,g,e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height);p+1<g&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;g++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.i;m.next();)r=m.value,r.sa+=p,r.Aa+=q}x.qc(n);for(m=b.vertexes.i;m.next();)h=m.value,n=h.Cb,2>g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=2):(p=Wp(l,g,
e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height),p+1<g&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,g++,h.sa=q.x+h.width/2,h.Aa=q.y+h.height/2);x.xa(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.i;e.next();)b.xl(e.value);for(d=d.edges.i;d.next();)b.dp(d.value)}}Xp(this,a);this.updateParts()}this.Ko=a;this.network=null;this.Hf=!0};
Tp.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().Cb,d=this.network.vertexes.i;d.next();){if(d.value.Cb.Hg(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};Tp.prototype.oh=function(a,b){for(var c=!0,d=a.vertexes.i;d.next();){var e=d.value;c?(c=!1,b.set(e.Cb)):b.si(e.Cb)}return b};
function Yp(a,b,c){u&&(x.p(b,Tp,"computeClusterLayoutIterations:level"),x.p(c,Tp,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
function Vp(a,b,c){u&&(x.p(b,Tp,"layoutClusters:level"),x.p(c,Tp,"layoutClusters:maxiter"));if(Zp(a,b)){var d=a.Uh;a.Uh*=1+1/(b+1);var e=$p(a,b),g=Math.max(0,Yp(a,b,c));a.GA+=g;Vp(a,b+1,c);Xp(a,g);aq(a,e,b);c=a.Ag;null===c?c=new J(bq):c.clear();c.$c(e.vertexes);c.sort(function(a,b){return null===a||null===b||a===b?0:b.hg-a.hg});for(e=c.i;e.next();)jq(a,e.value,b);a.Uh=d}}
function Zp(a,b){u&&x.p(b,Tp,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;null===a.Ag?a.Ag=new J(bq):a.Ag.clear();a.Ag.$c(a.network.vertexes);var c=a.Ag;c.sort(function(a,b){return null===a||null===b||a===b?0:b.hg-a.hg});for(var d=c.count-1;0<=d&&1>=c.ia(d).hg;)d--;return 1<c.count-d}
function $p(a,b){u&&x.p(b,Tp,"pushSubNetwork:level");for(var c=a.network,d=new Up,e=a.Ag.i;e.next();){var g=e.value;if(1<g.hg){d.xl(g);var h=new nq;h.ny=g.hg;h.qy=g.width;h.my=g.height;h.AB=g.R.x;h.BB=g.R.y;null===g.Gh&&(g.Gh=new J(nq));g.Gh.add(h);g.dB=g.Gh.count-1}else break}for(var k=c.edges.i;k.next();)if(e=k.value,e.fromVertex.network===d&&e.toVertex.network===d)d.dp(e);else if(e.fromVertex.network===d){var l=e.fromVertex.dn;null===l&&(l=new J(bq),e.fromVertex.dn=l);l.add(e.toVertex);e.fromVertex.hg--;
e.fromVertex.zk+=e.toVertex.zk}else e.toVertex.network===d&&(l=e.toVertex.dn,null===l&&(l=new J(bq),e.toVertex.dn=l),l.add(e.fromVertex),e.toVertex.hg--,e.toVertex.zk+=e.fromVertex.zk);for(e=d.edges.i;e.next();)g=e.value,g.length*=Math.max(1,Q.sqrt((g.fromVertex.zk+g.toVertex.zk)/(4*b+1)));for(e=d.vertexes.i;e.next();)if(g=e.value,l=g.dn,null!==l&&0<l.count&&(h=g.Gh.ia(g.Gh.count-1),h=h.ny-g.hg,!(0>=h))){for(var m=0,n=0,p=l.count-h;p<l.count;p++){for(var q=l.ia(p),r=null,k=q.edges.i;k.next();){var s=
k.value;if(s.wI(q)===g){r=s;break}}null!==r&&(n+=r.length,m+=q.width*q.height)}l=g.sa;k=g.Aa;p=g.width;q=g.height;r=g.R;s=p*q;1>s&&(s=1);m=Q.sqrt((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.Cb=new w(l-r.x-h,k-r.y-m,p+2*h,q+2*m);g.focus=new N(r.x+h,r.y+m)}a.network=d;return c}
function aq(a,b,c){u&&(x.l(b,Up,Tp,"popNetwork:oldnet"),x.p(c,Tp,"popNetwork:level"));for(c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Gh){var e=d.Gh.ia(d.dB);d.hg=e.ny;var g=e.AB,h=e.BB;d.Cb=new w(d.sa-g,d.Aa-h,e.qy,e.my);d.focus=new N(g,h);d.dB--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b}
function jq(a,b,c){u&&(x.l(b,bq,Tp,"surroundNode:oldnet"),x.p(c,Tp,"surroundNode:level"));var d=b.dn;if(null!==d&&0!==d.count){c=b.sa;var e=b.Aa,g=b.width,h=b.height;null!==b.Gh&&0<b.Gh.count&&(h=b.Gh.ia(0),g=h.qy,h=h.my);for(var g=Q.sqrt(g*g+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.i;n.next();){var p=n.value;1>=p.hg?l++:(k=!0,m++,h+=Math.atan2(b.Aa-p.Aa,b.sa-p.sa))}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,d=d.i;d.next();)if(l=d.value,!(1<l.hg||a.isFixed(l))){n=null;for(p=l.edges.i;p.next();){n=p.value;break}var p=l.width,q=l.height,p=Q.sqrt(p*p+q*q)/2,n=g+n.length+p,p=h+(b*(k/2>>1)+m)*(0===k%2?1:-1);l.sa=c+n*Math.cos(p);l.Aa=e+n*Math.sin(p);k++}}}
function Wp(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}Tp.prototype.Wz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
Tp.prototype.addComments=function(a){var b=a.Pc;if(null!==b)for(b=b.PE();b.next();){var c=b.value;if("Comment"===c.Lc&&c.isVisible()){var d=this.network.on(c);null===d&&(d=this.network.ct(c));d.charge=this.VH;for(var c=null,e=d.hc;e.next();){var g=e.value;if(g.toVertex===a){c=g;break}}if(null===c)for(e=d.tc;e.next();)if(g=e.value,g.fromVertex===a){c=g;break}null===c&&(c=this.network.Mp(a,d,null));c.length=this.WH}}};
function oq(a,b){u&&(x.l(a,bq,Tp,"getNodeDistance:vertexA"),x.l(b,bq,Tp,"getNodeDistance:vertexB"));var c=a.Q,d=c.x,e=c.y,g=c.width,c=c.height,h=b.Q,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,Q.sqrt(d*d+e*e)):e+c<l?(d=d+g-k,e=e+c-l,Q.sqrt(d*d+e*e)):k-(d+g):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,Q.sqrt(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,Q.sqrt(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}
function Xp(a,b){u&&x.p(b,Tp,"performIterations:num");a.Ag=null;for(var c=a.wr+b;a.wr<c&&(a.wr++,pq(a)););a.Ag=null}
function pq(a){null===a.Ag&&(a.Ag=new J(bq),a.Ag.$c(a.network.vertexes));var b=a.Ag.o;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.sa,e=d,g=c.Aa,h=g,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.sa,k=k.Aa,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.sa-b.sa}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.Aa-b.Aa});for(var h=a.Uh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
b[c],l=k.Q,q=k.R,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 r=e.Q,n=e.R,p=r.x+n.x,r=r.y+n.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=oq(k,e);1>s?(n=a.Nx,null===n&&(a.Nx=n=new Oa(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.Q.right-k.Q.x),n=(1+n)*m):d<p?(n=Math.abs(e.Q.x-k.Q.right),
n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.Q.bottom-k.Q.y),p=(1+p)*s):d<p?(p=Math.abs(e.Q.y-k.Q.bottom),p=-(1+p)*s):(p=Math.max(e.height,k.height),p=(1+p)*s-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.i;c.next();)g=c.value,k=g.fromVertex,e=g.toVertex,l=k.Q,q=k.R,d=l.x+q.x,l=l.y+q.y,r=e.Q,n=e.R,p=r.x+n.x,r=r.y+n.y,s=oq(k,e),1>s?(n=a.Nx,null===n&&(a.Nx=n=new Oa(0)),m=n.random(),s=
n.random(),n=(d>p?1:-1)*(1+(e.width>k.width)?e.width:k.width)*m,p=(l>r?1:-1)*(1+(e.height>k.height)?e.height:k.height)*s):(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.Uh/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.sa+=g,k.Aa+=h,c=Math.max(c,g*g+h*h));return c>a.ME*a.ME}Tp.prototype.moveFixedVertex=function(){};
Tp.prototype.commitLayout=function(){this.hB();this.commitNodes();this.Pt&&this.commitLinks()};Tp.prototype.hB=function(){if(this.fq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Gb=Jc,b.Hb=Jc)}};Tp.prototype.commitNodes=function(){var a=0,b=0;if(this.wH){var c=x.kg();this.oh(this.network,c);b=this.he;a=b.x-c.x;b=b.y-c.y;x.qc(c)}for(var c=x.kg(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.Cb),c.x+=a,c.y+=b,e.Cb=c;e.commit()}x.qc(c)};
Tp.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};Tp.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.eo:a};Tp.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.co:a};Tp.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.$n:a};Tp.prototype.electricalFieldX=function(){return 0};Tp.prototype.electricalFieldY=function(){return 0};
Tp.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.bo:a};Tp.prototype.gravitationalFieldX=function(){return 0};Tp.prototype.gravitationalFieldY=function(){return 0};Tp.prototype.isFixed=function(a){return a.isFixed};x.w(Tp,{SK:"currentIteration"},function(){return this.wr});x.defineProperty(Tp,{gE:"arrangementSpacing"},function(){return this.lg},function(a){x.l(a,Fa,Tp,"arrangementSpacing");this.lg.O(a)||(this.lg.assign(a),this.J())});
x.defineProperty(Tp,{wH:"arrangesToOrigin"},function(){return this.wq},function(a){this.wq!==a&&(x.g(a,"boolean",Tp,"arrangesToOrigin"),this.wq=a,this.J())});x.defineProperty(Tp,{fq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(x.g(a,"boolean",Tp,"setsPortSpots"),this.ci=a,this.J())});x.defineProperty(Tp,{comments:"comments"},function(){return this.Mh},function(a){this.Mh!==a&&(x.g(a,"boolean",Tp,"comments"),this.Mh=a,this.J())});
x.defineProperty(Tp,{GA:"maxIterations"},function(){return this.Ko},function(a){this.Ko!==a&&(x.g(a,"number",Tp,"maxIterations"),0<=a&&(this.Ko=a,this.J()))});x.defineProperty(Tp,{ME:"epsilonDistance"},function(){return this.Zq},function(a){this.Zq!==a&&(x.g(a,"number",Tp,"epsilonDistance"),0<a&&(this.Zq=a,this.J()))});x.defineProperty(Tp,{pL:"infinityDistance"},function(){return this.Uh},function(a){this.Uh!==a&&(x.g(a,"number",Tp,"infinityDistance"),1<a&&(this.Uh=a,this.J()))});
x.defineProperty(Tp,{Nx:"randomNumberGenerator"},function(){return this.hs},function(a){this.hs!==a&&(null!==a&&"function"!==typeof a.random&&x.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.hs=a)});x.defineProperty(Tp,{eL:"defaultSpringStiffness"},function(){return this.eo},function(a){this.eo!==a&&(x.g(a,"number",Tp,"defaultSpringStiffness"),this.eo=a,this.J())});
x.defineProperty(Tp,{dL:"defaultSpringLength"},function(){return this.co},function(a){this.co!==a&&(x.g(a,"number",Tp,"defaultSpringLength"),this.co=a,this.J())});x.defineProperty(Tp,{YK:"defaultElectricalCharge"},function(){return this.$n},function(a){this.$n!==a&&(x.g(a,"number",Tp,"defaultElectricalCharge"),this.$n=a,this.J())});x.defineProperty(Tp,{ZK:"defaultGravitationalMass"},function(){return this.bo},function(a){this.bo!==a&&(x.g(a,"number",Tp,"defaultGravitationalMass"),this.bo=a,this.J())});
x.defineProperty(Tp,{WH:"defaultCommentSpringLength"},function(){return this.Rq},function(a){this.Rq!==a&&(x.g(a,"number",Tp,"defaultCommentSpringLength"),this.Rq=a,this.J())});x.defineProperty(Tp,{VH:"defaultCommentElectricalCharge"},function(){return this.Qq},function(a){this.Qq!==a&&(x.g(a,"number",Tp,"defaultCommentElectricalCharge"),this.Qq=a,this.J())});function nq(){this.BB=this.AB=this.my=this.qy=this.ny=0}function Up(){xa.call(this)}x.Qa(Up,xa);x.ja("ForceDirectedNetwork",Up);
Up.prototype.createVertex=function(){return new bq};Up.prototype.createEdge=function(){return new qq};function bq(){ya.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.zk=this.hg=this.forceY=this.forceX=0;this.Gh=this.dn=null;this.dB=0}x.Qa(bq,ya);x.ja("ForceDirectedVertex",bq);function qq(){Aa.call(this);this.length=this.stiffness=NaN}x.Qa(qq,Aa);x.ja("ForceDirectedEdge",qq);
function sm(){0<arguments.length&&x.pd(sm);df.call(this);this.Td=this.zm=25;this.ga=0;this.Zn=rq;this.Go=sq;this.wo=tq;this.wm=4;this.Pn=uq;this.Si=vq;this.ci=!0;this.Br=4;this.Mb=this.Mv=this.Bb=-1;this.Tf=this.Lr=0;this.Sb=this.Rf=this.Sf=this.sg=this.de=null;this.Tr=0;this.Sr=this.Em=null;this.ug=0;this.Ur=null;this.ah=[];this.ah.length=100}x.Qa(sm,df);x.ja("LayeredDigraphLayout",sm);
sm.prototype.cloneProtected=function(a){df.prototype.cloneProtected.call(this,a);a.zm=this.zm;a.Td=this.Td;a.ga=this.ga;a.Zn=this.Zn;a.Go=this.Go;a.wo=this.wo;a.wm=this.wm;a.Pn=this.Pn;a.Si=this.Si;a.ci=this.ci;a.Br=this.Br};sm.prototype.createNetwork=function(){return new wq};
sm.prototype.doLayout=function(a){null===a&&x.k("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.he=this.initialOrigin(this.he);this.Mv=-1;this.Tf=this.Lr=0;this.Ur=this.Sr=this.Em=null;for(a=0;a<this.ah.length;a++)this.ah[a]=null;if(0<this.network.vertexes.count){this.network.ax();for(a=this.network.edges.i;a.next();)a.value.rev=!1;switch(this.Zn){default:case xq:var b=0,c=this.network.vertexes.count-
1;a=[];a.length=c+1;for(var d=this.network.vertexes.i;d.next();)d.value.valid=!0;for(;null!==yq(this.network);){for(d=zq(this.network);null!==d;)a[c]=d,c--,d.valid=!1,d=zq(this.network);for(d=Aq(this.network);null!==d;)a[b]=d,b++,d.valid=!1,d=Aq(this.network);for(var d=null,e=0,g=this.network.vertexes.i;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.hc;l.next();)l.value.toVertex.valid&&k++;for(var l=0,m=h.tc;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.i;a.next();)b=a.value,b.fromVertex.index>b.toVertex.index&&(this.network.Rx(b),b.rev=!0);break;case rq:for(b=this.network.vertexes.i;b.next();)a=b.value,a.pp=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.Tr=0;for(b.reset();b.next();)c=b.value,0===c.tc.count&&Bq(this,c);for(b.reset();b.next();)c=b.value,-1===c.pp&&Bq(this,c);for(a.reset();a.next();)b=a.value,b.forest||(c=b.fromVertex,
d=c.finish,e=b.toVertex,g=e.finish,e.pp<c.pp&&d<g&&(this.network.Rx(b),b.rev=!0))}for(a=this.network.vertexes.i;a.next();)a.value.layer=-1;this.Bb=-1;this.assignLayers();for(a.reset();a.next();)this.Bb=Math.max(this.Bb,a.value.layer);a=[];for(c=this.network.edges.i;c.next();)b=c.value,b.valid=!1,a.push(b);for(c=0;c<a.length;c++)if(b=a[c],!b.valid&&(null!==b.fromVertex.Dd&&null!==b.toVertex.Dd||b.fromVertex.layer!==b.toVertex.layer)){l=h=k=g=0;e=b.fromVertex;d=b.toVertex;if(null!==b.link){k=b.link;
if(null===k)continue;var n=e.Dd,g=d.Dd;if(null===n||null===g)continue;var p=k.Z,h=k.fa,q=k.ad,l=k.Ad;b.rev&&(k=p,m=q,p=h,q=l,h=k,l=m);var r=e.R,k=b.toVertex.R,s=b.rev?d.Q:e.Q,m=x.P();s.G()?(mo(p,q,dc,m),m.G()||m.assign(r)):m.assign(r);n!==p&&s.G()&&p.isVisible()&&(n=e.Q,n.G()&&(m.x+=s.x-n.x,m.y+=s.y-n.y));p=b.rev?e.Q:d.Q;n=x.P();p.G()?(mo(h,l,dc,n),n.G()||n.assign(k)):n.assign(k);g!==h&&p.G()&&h.isVisible()&&(g=d.Q,g.G()&&(n.x+=p.x-g.x,n.y+=p.y-g.y));90===this.ga||270===this.ga?(g=Math.round((m.x-
r.x)/this.Td),h=m.x,k=Math.round((n.x-k.x)/this.Td),l=n.x):(g=Math.round((m.y-r.y)/this.Td),h=m.y,k=Math.round((n.y-k.y)/this.Td),l=n.y);x.A(m);x.A(n);b.portFromColOffset=g;b.portFromPos=h;b.portToColOffset=k;b.portToPos=l}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;m=e.layer;r=d.layer;a:if(n=b,p=0,s=n.link,null!==s){var t=s.ad,v=s.Ad;if(null!==t&&null!==v){var y=s.Z,q=s.fa;if(null!==y&&null!==q){var A=t.Gb,B=v.Hb;this.fq||(s.Gb.bd()||(A=s.Gb),s.Hb.bd()||(B=s.Hb));
var C=s.sc,M=Cq(this,!0);if(A.bd()||A===Wb)A=M;var I=Cq(this,!1);if(B.bd()||B===Wb)B=I;if(A.mj()&&A.Bp(I)&&B.mj()&&B.Bp(M)){p=0;break a}M=s.getLinkPoint(y,t,A,!0,C,q,v,x.P());A=s.getLinkDirection(y,t,M,A,!0,C,q,v);x.A(M);A===Dq(this,n,!0)?p+=1:this.fq&&null!==y&&1===y.ports.count&&n.rev&&(p+=1);A=s.getLinkPoint(q,v,B,!1,C,y,t,x.P());s=s.getLinkDirection(q,v,A,B,!1,C,y,t);x.A(A);s===Dq(this,n,!1)?p+=2:this.fq&&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.Dd=null,q.an=1,q.layer=m,q.near=e,this.network.xl(q),e=this.network.Mp(e,q,b.link),e.valid=!1,e.rev=b.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){b.valid=!1;q=this.network.createVertex();q.Dd=null;q.an=2;q.layer=m-1;this.network.xl(q);e=this.network.Mp(e,q,b.link);e.valid=!0;e.rev=b.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.Dd=null,q.an=3,q.layer=m-1,this.network.xl(q),e=this.network.Mp(e,q,b.link),e.valid=!0,e.rev=b.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,m--;e=this.network.Mp(q,d,b.link);e.valid=!n;n&&(q.near=d);e.rev=b.rev;e.portFromColOffset=0;e.portToColOffset=k;e.portFromPos=0;e.portToPos=l}else b.valid=!0}b=this.de=[];for(c=0;c<=this.Bb;c++)b[c]=0;for(a=this.network.vertexes.i;a.next();)c=a.value,c.index=-1;this.initializeIndices();this.Mv=-1;for(c=this.Tf=this.Lr=0;c<=
this.Bb;c++)b[c]>b[this.Tf]&&(this.Mv=b[c]-1,this.Tf=c),b[c]<b[this.Lr]&&(this.Lr=c);this.Ur=[];for(c=0;c<b.length;c++)this.Ur[c]=[];for(a.reset();a.next();)b=a.value,c=this.Ur[b.layer],c[b.index]=b;this.Mb=-1;for(a=0;a<=this.Bb;a++){b=Eq(this,a);c=0;d=this.de[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.Mb=Math.max(this.Mb,c-1);Fq(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.Hf=
!0};sm.prototype.linkMinLength=function(a){var b=a.toVertex,c=0;for(a=a.fromVertex.hc;a.next();)a.value.toVertex===b&&c++;return 1};function Gq(a){var b=a.fromVertex.Dd;a=a.toVertex.Dd;return null===b&&null===a?8:null===b||null===a?4:1}sm.prototype.nodeMinLayerSpace=function(a,b){return null===a.Dd?0:90===this.ga||270===this.ga?b?a.R.y+10:a.Q.height-a.R.y+10:b?a.R.x+10:a.Q.width-a.R.x+10};
sm.prototype.nodeMinColumnSpace=function(a,b){if(null===a.Dd)return 0;var c=b?a.PA:a.OA;if(null!==c)return c;c=this.ga;return 90===c||270===c?b?a.PA=a.R.x/this.Td+1|0:a.OA=(a.Q.width-a.R.x)/this.Td+1|0:b?a.PA=a.R.y/this.Td+1|0:a.OA=(a.Q.height-a.R.y)/this.Td+1|0};function Hq(a){null===a.Em&&(a.Em=[]);for(var b=0,c=a.network.vertexes.i;c.next();){var d=c.value;a.Em[b]=d.layer;b++;a.Em[b]=d.column;b++;a.Em[b]=d.index;b++}return a.Em}
function Iq(a,b){for(var c=0,d=a.network.vertexes.i;d.next();){var e=d.value;e.layer=b[c];c++;e.column=b[c];c++;e.index=b[c];c++}}
function Jq(a,b,c){u&&(x.p(b,sm,"crossingMatrix:unfixedLayer"),x.p(c,sm,"crossingMatrix:direction"));var d=Eq(a,b),e=a.de[b];if(null===a.Sr||a.Sr.length<e*e)a.Sr=[];for(var g=a.Sr,h=0;h<e;h++){var k=0,l=d[h],m=l.near,n=0;if(null!==m&&m.layer===l.layer)if(n=m.index,n>h)for(var p=h+1;p<n;p++)l=d[p],l.near===m&&l.an===m.an||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.an===m.an||k++;var m=0,q,r=q=p=l=0,s,t=0,v=0;s=0;var y;if(0<=c)for(n=d[h].Ye,m=0;m<n.count;m++)if(q=n.o[m],q.valid&&q.fromVertex.layer!==
b)for(l=q.fromVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,v=s.portToPos,s=s.portFromPos,p<v&&(l>t||l===t&&q>s)&&k++,v<p&&(t>l||t===l&&s>q)&&k++);if(0>=c)for(n=d[h].Ue,m=0;m<n.count;m++)if(q=n.o[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.o[r],s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,s=s.portFromPos,q<s&&(l>t||l===t&&p>v)&&k++,
s<q&&(t>l||t===l&&v>p)&&k++);g[h*e+h]=k;for(n=h+1;n<e;n++){var A=0,B=0;if(0<=c)for(k=d[h].Ye,y=d[n].Ye,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<y.count;r++)s=y.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,s=s.portFromPos,(l<t||l===t&&q<s)&&B++,(t<l||t===l&&s<q)&&A++);if(0>=c)for(k=d[h].Ue,y=d[n].Ue,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<y.count;r++)s=y.o[r],
s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,(l<t||l===t&&p<v)&&B++,(t<l||t===l&&v<p)&&A++);g[h*e+n]=A;g[n*e+h]=B}}Fq(a,b,d);return g}sm.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.Bb;b++)for(var c=Jq(this,b,1),d=this.de[b],e=0;e<d;e++)for(var g=e;g<d;g++)a+=c[e*d+g];return a};
function Kq(a){for(var b=0,c=0;c<=a.Bb;c++){for(var d=a,e=c,g=Eq(d,e),h=d.de[e],k=0,l=0;l<h;l++){var m=null,m=g[l].Ue,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.o[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)*Gq(n))}Fq(d,e,g);b+=k}return b}
sm.prototype.normalize=function(){var a=Infinity;this.Mb=-1;for(var b=this.network.vertexes.i;b.next();){var c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Mb=Math.max(this.Mb,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Mb-=a};
function Lq(a,b,c){u&&(x.p(b,sm,"barycenters:unfixedLayer"),x.p(c,sm,"barycenters:direction"));for(var d=Eq(a,b),e=a.de[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ye);var m=null;0<=c&&(m=k.Ue);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.o[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.o[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column+k.portToColOffset,
p++);g[h]=0===p?-1:n/p}Fq(a,b,d);return g}
function Mq(a,b,c){u&&(x.p(b,sm,"medians:unfixedLayer"),x.p(c,sm,"medians:direction"));for(var d=Eq(a,b),e=a.de[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ye);var m=null;0<=c&&(m=k.Ue);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.o[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.o[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)}Fq(a,b,d);return g}function Nq(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.hc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Nq(a,m,c,d,e,g)}if(g)for(l=b.tc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Nq(a,m,c,d,e,g)}}
function Oq(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.hc;h.next();)Oq(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.tc;b.next();)Oq(a,b.value.fromVertex,c,d,e,g)}}function yq(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function zq(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.hc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
function Aq(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.tc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function Bq(a,b){b.pp=a.Tr;a.Tr++;for(var c=b.hc;c.next();){var d=c.value,e=d.toVertex;-1===e.pp&&(d.forest=!0,Bq(a,e))}b.finish=a.Tr;a.Tr++}
sm.prototype.assignLayers=function(){switch(this.Go){case Pq:Qq(this);break;case Rq:for(var a=0,b=this.network.vertexes.i;b.next();)a=Sq(this,b.value),this.Bb=Math.max(a,this.Bb);for(b.reset();b.next();)a=b.value,a.layer=this.Bb-a.layer;break;default:case sq:Qq(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.tc.count&&Tq(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.Bb=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
a;this.Bb=Math.max(this.Bb,c.layer)}}};function Qq(a){for(var b=a.network.vertexes.i;b.next();){var c=Uq(a,b.value);a.Bb=Math.max(c,a.Bb)}}function Uq(a,b){var c=0;if(-1===b.layer){for(var d=b.hc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Uq(a,g)+e);b.layer=c}else c=b.layer;return c}function Sq(a,b){var c=0;if(-1===b.layer){for(var d=b.tc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Sq(a,g)+e);b.layer=c}else c=b.layer;return c}
function Tq(a,b){if(!b.valid){b.valid=!0;for(var c=b.hc;c.next();)Tq(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Ye.o,e=d.length,g=0;g<e;g++){var h=d[g],k=a.linkMinLength(h);h.fromVertex.layer-h.toVertex.layer>k&&Nq(a,h.fromVertex,0,-1,!0,!1)}for(Nq(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Ye.o,e=s.length,g=0;g<e;g++){var h=s[g],t=h.fromVertex,
q=q+1;1!==t.component&&(k+=1,t=t.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,t-h))}h=p.Ue.o;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.i;c.next();)c.value.component=-1;for(Nq(a,b,1,-1,!0,!1);0!==b.component;){g=0;e=Infinity;d=0;k=null;for(l=a.network.vertexes.i;l.next();)if(m=l.value,1===m.component){n=
0;p=!1;h=m.Ye.o;q=h.length;for(r=0;r<q;r++)s=h[r].fromVertex,n+=1,1!==s.component?g+=1:p=!0;h=m.Ue.o;q=h.length;for(r=0;r<q;r++)s=h[r],t=s.toVertex,n-=1,1!==t.component&&(g-=1,t=m.layer-t.layer,s=a.linkMinLength(s),e=Math.min(e,t-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 Dq(a,b,c){return 90===a.ga?c&&!b.rev||!c&&b.rev?270:90:180===a.ga?c&&!b.rev||!c&&b.rev?0:180:270===a.ga?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
sm.prototype.initializeIndices=function(){switch(this.wo){default:case Vq:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.de[c];this.de[c]++}break;case tq:a=this.network.vertexes.i;for(b=this.Bb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Wq(this,c);break;case Xq:for(a=this.network.vertexes.i,b=0;b<=this.Bb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Yq(this,c)}};
function Wq(a,b){var c=b.layer;b.index=a.de[c];a.de[c]++;for(var c=b.Ue.kc(),d=!0;d;)for(var 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&&Wq(a,d))}
function Yq(a,b){var c=b.layer;b.index=a.de[c];a.de[c]++;for(var c=b.Ye.kc(),d=!0,e=0;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&&Yq(a,d))}
sm.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=Hq(this),c=0,d=0,e=0,c=0;c<this.wm;c++){for(d=0;d<=this.Bb;d++)Zq(this,d,1),$q(this,d,1);e=this.countCrossings();e<a&&(a=e,b=Hq(this));for(d=this.Bb;0<=d;d--)Zq(this,d,-1),$q(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=Hq(this))}Iq(this,b);for(c=0;c<this.wm;c++){for(d=0;d<=this.Bb;d++)Zq(this,d,0),$q(this,d,0);e=this.countCrossings();e<a&&(a=e,b=Hq(this));for(d=this.Bb;0<=d;d--)Zq(this,d,0),$q(this,d,0);e=this.countCrossings();
e<a&&(a=e,b=Hq(this))}Iq(this,b);var g=!1,h=c=0,k=0,d=0;switch(this.Pn){case ar:break;case br:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.Bb;0<=c;c--)for(h=0;h<=c;h++){for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,-1)||g;e=this.countCrossings();e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,1)||g;e=this.countCrossings();e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$q(this,d,1)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,
d=h;d<=c;d++)g=$q(this,d,-1)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,0)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$q(this,d,0)||g;e>=a?Iq(this,b):(a=e,b=Hq(this))}break;default:case uq:for(c=this.Bb,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,-1)||g;e=this.countCrossings();e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,1)||g;e=this.countCrossings();
e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$q(this,d,1)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$q(this,d,-1)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=$q(this,d,0)||g;e>=a?Iq(this,b):(a=e,b=Hq(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=$q(this,d,0)||g;e>=a?Iq(this,b):(a=e,b=Hq(this))}}Iq(this,b)};
function Zq(a,b,c){u&&(x.p(b,sm,"medianBarycenterCrossingReduction:unfixedLayer"),x.p(c,sm,"medianBarycenterCrossingReduction:direction"));var d=0,e=Eq(a,b),g=a.de[b],h=Mq(a,b,c);c=Lq(a,b,c);for(d=0;d<g;d++)-1===c[d]&&(c[d]=e[d].column),-1===h[d]&&(h[d]=e[d].column);for(var k=!0,l;k;)for(k=!1,d=0;d<g-1;d++)if(h[d+1]<h[d]||h[d+1]===h[d]&&c[d+1]<c[d])k=!0,l=h[d],h[d]=h[d+1],h[d+1]=l,l=c[d],c[d]=c[d+1],c[d+1]=l,l=e[d],e[d]=e[d+1],e[d+1]=l;for(d=h=0;d<g;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,
!0),l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);Fq(a,b,e)}
function $q(a,b,c){var d=Eq(a,b),e=a.de[b];c=Jq(a,b,c);var g=0,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,t=d[g+1].column,v=a.nodeMinColumnSpace(d[g],!0),y=a.nodeMinColumnSpace(d[g],!1),A=a.nodeMinColumnSpace(d[g+1],!0),B=a.nodeMinColumnSpace(d[g+1],!1),v=s-v+A,y=t-y+B,A=A=0,C=d[g].tc.i;for(C.reset();C.next();)if(B=C.value,B.valid&&B.fromVertex.layer===
b){B=B.fromVertex;for(A=0;d[A]!==B;)A++;A<g&&(q+=2*(g-A),r+=2*(g+1-A));A===g+1&&(q+=1);A>g+1&&(q+=4*(A-g),r+=4*(A-(g+1)))}C=d[g].hc.i;for(C.reset();C.next();)if(B=C.value,B.valid&&B.toVertex.layer===b){B=B.toVertex;for(A=0;d[A]!==B;)A++;A===g+1&&(r+=1)}C=d[g+1].tc.i;for(C.reset();C.next();)if(B=C.value,B.valid&&B.fromVertex.layer===b){B=B.fromVertex;for(A=0;d[A]!==B;)A++;A<g&&(q+=2*(g+1-A),r+=2*(g-A));A===g&&(r+=1);A>g+1&&(q+=4*(A-(g+1)),r+=4*(A-g))}C=d[g+1].hc.i;for(C.reset();C.next();)if(B=C.value,
B.valid&&B.toVertex.layer===b){B=B.toVertex;for(A=0;d[A]!==B;)A++;A===g&&(q+=1)}var A=B=0,C=h[d[g].index],M=k[d[g].index],I=h[d[g+1].index],V=k[d[g+1].index];-1!==C&&(B+=Math.abs(C-s),A+=Math.abs(C-y));-1!==M&&(B+=Math.abs(M-s),A+=Math.abs(M-y));-1!==I&&(B+=Math.abs(I-t),A+=Math.abs(I-v));-1!==V&&(B+=Math.abs(V-t),A+=Math.abs(V-v));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&A<B-.5)m=l=!0,d[g].column=y,d[g+1].column=v,n=d[g],d[g]=d[g+1],d[g+1]=n}for(g=0;g<e;g++)d[g].index=g;Fq(a,b,d);return l}
sm.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.Si&cr),a=this.Si===vq;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.Bb;a++)b[a]=0;for(var d=0,e=this.network.vertexes.i;e.next();){var g=e.value,a=g.layer,d=g.column,g=this.nodeMinColumnSpace(g,!1);b[a]=Math.max(b[a],d+g)}for(e.reset();e.next();)g=e.value,a=g.layer,d=g.column,g.column=(8*(this.Mb-b[a])>>1)+8*d;this.Mb*=8}if(0!==(this.Si&dr))for(b=!0;b;){b=!1;for(a=this.Tf+1;a<=this.Bb;a++)b=er(this,a,1)||b;
for(a=this.Tf-1;0<=a;a--)b=er(this,a,-1)||b;b=er(this,this.Tf,0)||b}if(0!==(this.Si&fr)){for(a=this.Tf+1;a<=this.Bb;a++)gr(this,a,1);for(a=this.Tf-1;0<=a;a--)gr(this,a,-1);gr(this,this.Tf,0)}c&&(hr(this,-1),hr(this,1));if(0!==(this.Si&dr))for(b=!0;b;){b=!1;b=er(this,this.Tf,0)||b;for(a=this.Tf+1;a<=this.Bb;a++)b=er(this,a,0)||b;for(a=this.Tf-1;0<=a;a--)b=er(this,a,0)||b}};
function er(a,b,c){u&&(x.p(b,sm,"bendStraighten:unfixedLayer"),x.p(c,sm,"bendStraighten:direction"));for(var d=!1;ir(a,b,c);)d=!0;return d}
function ir(a,b,c){u&&(x.p(b,sm,"shiftbendStraighten:unfixedLayer"),x.p(c,sm,"shiftbendStraighten:direction"));var d=0,e=Eq(a,b),g=a.de[b],h=Lq(a,b,-1);if(0<c)for(d=0;d<g;d++)h[d]=-1;var k=Lq(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),r=0,r=0>d-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=
0,t=0,v=0,y=0,A=0;if(0>=c)for(var B=e[d].tc.i;B.next();){var C=B.value;C.valid&&C.fromVertex.layer!==b&&(v=Gq(C),y=C.portFromColOffset,A=C.portToColOffset,C=C.fromVertex.column,q+=(Math.abs(n+A-(C+y))+1)*v,s+=(Math.abs(r+A-(C+y))+1)*v,t+=(Math.abs(p+A-(C+y))+1)*v)}if(0<=c)for(B=e[d].hc.i;B.next();)C=B.value,C.valid&&C.toVertex.layer!==b&&(v=Gq(C),y=C.portFromColOffset,A=C.portToColOffset,C=C.toVertex.column,q+=(Math.abs(n+y-(C+A))+1)*v,s+=(Math.abs(r+y-(C+A))+1)*v,t+=(Math.abs(p+y-(C+A))+1)*v);A=
y=v=0;B=h[e[d].index];C=k[e[d].index];-1!==B&&(v+=Math.abs(B-n),y+=Math.abs(B-r),A+=Math.abs(B-p));-1!==C&&(v+=Math.abs(C-n),y+=Math.abs(C-r),A+=Math.abs(C-p));if(s<q||s===q&&y<v)m=l=!0,e[d].column=r;if(t<q||t===q&&A<v)m=l=!0,e[d].column=p}Fq(a,b,e);a.normalize();return l}
function gr(a,b,c){u&&(x.p(b,sm,"medianStraighten:unfixedLayer"),x.p(c,sm,"medianStraighten:direction"));var d=0,e=Eq(a,b),g=a.de[b],h=Mq(a,b,c);c=[];for(d=0;d<g;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<g;d++){var k=e[d].column,l=a.nodeMinColumnSpace(e[d],!0),m=a.nodeMinColumnSpace(e[d],!1),n=0,p=0,q=0,q=p=0;-1===c[d]?0===d&&d===g-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===g-1?(q=e[d-1].column,n=k-q===l+a.nodeMinColumnSpace(e[d-1],!1)?k+1:k):(q=e[d-1].column,
q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=(q+p)/2|0):0===d&&d===g-1?n=c[d]:0===d?(p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=Math.min(c[d],p)):d===g-1?(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,n=Math.max(c[d],q)):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,q<c[d]&&c[d]<p?n=c[d]:q>=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}Fq(a,b,e);a.normalize()}
function jr(a,b){u&&(x.p(b,sm,"packAux:column"),x.p(1,sm,"packAux:direction"));for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e}
function kr(a,b){u&&(x.p(b,sm,"tightPackAux:column"),x.p(1,sm,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.Bb;d++)e[d]=!1,g[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,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.Bb;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
function hr(a,b){u&&x.p(b,sm,"componentPack:direction");for(var c=0;c<=a.Mb;c++)for(;jr(a,c););a.normalize();for(c=0;c<a.Mb;c++)for(;kr(a,c););a.normalize();var c=0,d,e=0,g=0,h=0;if(0<b)for(c=0;c<=a.Mb;c++)for(d=Hq(a),e=Kq(a),g=e+1;e<g;)g=e,lr(a,c,1),h=Kq(a),h>e?Iq(a,d):h<e&&(e=h,d=Hq(a));if(0>b)for(c=a.Mb;0<=c;c--)for(d=Hq(a),e=Kq(a),g=e+1;e<g;)g=e,lr(a,c,-1),h=Kq(a),h>e?Iq(a,d):h<e&&(e=h,d=Hq(a));a.normalize()}
function lr(a,b,c){a.ug=0;for(var d=a.network.vertexes.i;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();){var e=d.value;e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.ug)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.ug);a.ug++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Oq(a,b,a.ug,-1,!0,!0),a.ug++);var g=0;b=[];for(g=0;g<a.ug*a.ug;g++)b[g]=!1;e=[];for(g=0;g<(a.Bb+1)*(a.Mb+1);g++)e[g]=-1;for(d.reset();d.next();)for(var g=
d.value,h=g.layer,k=Math.max(0,g.column-a.nodeMinColumnSpace(g,!0)),l=Math.min(a.Mb,g.column+a.nodeMinColumnSpace(g,!1));k<=l;k++)e[h*(a.Mb+1)+k]=g.component;for(g=0;g<=a.Bb;g++){if(0<c)for(k=0;k<a.Mb;k++)-1!==e[g*(a.Mb+1)+k]&&-1!==e[g*(a.Mb+1)+k+1]&&e[g*(a.Mb+1)+k]!==e[g*(a.Mb+1)+k+1]&&(b[e[g*(a.Mb+1)+k]*a.ug+e[g*(a.Mb+1)+k+1]]=!0);if(0>c)for(k=a.Mb;0<k;k--)-1!==e[g*(a.Mb+1)+k]&&-1!==e[g*(a.Mb+1)+k-1]&&e[g*(a.Mb+1)+k]!==e[g*(a.Mb+1)+k-1]&&(b[e[g*(a.Mb+1)+k]*a.ug+e[g*(a.Mb+1)+k-1]]=!0)}e=[];for(g=
0;g<a.ug;g++)e[g]=!0;h=new J("number");h.add(0);for(l=0;0!==h.count;)if(l=h.o[h.count-1],h.dd(h.count-1),e[l])for(e[l]=!1,g=0;g<a.ug;g++)b[l*a.ug+g]&&h.Nd(0,g);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&(a.column-=1);if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)}
sm.prototype.commitLayout=function(){if(this.fq)for(var a=Cq(this,!0),b=Cq(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Gb=a,d.Hb=b)}this.commitNodes();this.$z();this.Pt&&this.commitLinks()};function Cq(a,b){return 270===a.ga?b?Rc:bd:90===a.ga?b?bd:Rc:180===a.ga?b?Sc:Tc:b?Tc:Sc}
sm.prototype.commitNodes=function(){this.sg=[];this.Sf=[];this.Rf=[];this.Sb=[];for(var a=0;a<=this.Bb;a++)this.sg[a]=0,this.Sf[a]=0,this.Rf[a]=0,this.Sb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.sg[c]=Math.max(this.sg[c],this.nodeMinLayerSpace(b,!0));this.Sf[c]=Math.max(this.Sf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.zm,c=0;c<=this.Bb;c++){var e=d;0>=this.sg[c]+this.Sf[c]&&(e=0);0<c&&(b+=e/2);90===this.ga||0===this.ga?(b+=this.Sf[c],this.Rf[c]=b,b+=this.sg[c]):
(b+=this.sg[c],this.Rf[c]=b,b+=this.Sf[c]);c<this.Bb&&(b+=e/2);this.Sb[c]=b}d=b;b=this.he;for(c=0;c<=this.Bb;c++)270===this.ga?this.Rf[c]=b.y+this.Rf[c]:90===this.ga?(this.Rf[c]=b.y+d-this.Rf[c],this.Sb[c]=d-this.Sb[c]):180===this.ga?this.Rf[c]=b.x+this.Rf[c]:(this.Rf[c]=b.x+d-this.Rf[c],this.Sb[c]=d-this.Sb[c]);for(a.reset();a.next();){var c=a.value,d=c.layer,e=c.column|0,g=0,h=0;270===this.ga||90===this.ga?(g=b.x+this.Td*e,h=this.Rf[d]):(g=this.Rf[d],h=b.y+this.Td*e);c.sa=g;c.Aa=h;c.commit()}};
sm.prototype.$z=function(){for(var a=0,b=this.zm,c=0;c<=this.Bb;c++)a+=this.sg[c],a+=this.Sf[c];for(var a=a+this.Bb*b,b=[],c=this.Td*this.Mb,d=this.kJ;0<=d;d--)270===this.ga?0===d?b.push(new w(0,0,c,Math.abs(this.Sb[0]))):b.push(new w(0,this.Sb[d-1],c,Math.abs(this.Sb[d-1]-this.Sb[d]))):90===this.ga?0===d?b.push(new w(0,this.Sb[0],c,Math.abs(this.Sb[0]-a))):b.push(new w(0,this.Sb[d],c,Math.abs(this.Sb[d-1]-this.Sb[d]))):180===this.ga?0===d?b.push(new w(0,0,Math.abs(this.Sb[0]),c)):b.push(new w(this.Sb[d-
1],0,Math.abs(this.Sb[d-1]-this.Sb[d]),c)):0===d?b.push(new w(this.Sb[0],0,Math.abs(this.Sb[0]-a),c)):b.push(new w(this.Sb[d],0,Math.abs(this.Sb[d-1]-this.Sb[d]),c));this.commitLayers(b,Q.Ek)};sm.prototype.commitLayers=function(){};
sm.prototype.commitLinks=function(){for(var a=this.network.edges.i,b;a.next();)b=a.value.link,null!==b&&(b.am(),b.kp(),b.fj());for(a.reset();a.next();)b=a.value.link,null!==b&&b.Hn();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.am();var d=b,e=d.Z,g=d.fa,h=d.ad,k=d.Ad;if(c.valid){if(b.Te===Bh&&4===b.ta){if(c.rev)var l=e,e=g,g=l,m=h,h=k,k=m;if(c.fromVertex.column===c.toVertex.column){var n=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,g,k),p=b.getLinkPoint(g,k,b.computeSpot(!1),!1,!1,
e,h);n.G()||n.set(e.ba.Bl);p.G()||p.set(g.ba.Bl);b.kp();b.wl(n.x,n.y);b.wl((2*n.x+p.x)/3,(2*n.y+p.y)/3);b.wl((n.x+2*p.x)/3,(n.y+2*p.y)/3);b.wl(p.x,p.y)}else{var q=!1,r=!1;null!==h&&b.computeSpot(!0)===Wb&&(q=!0);null!==k&&b.computeSpot(!1)===Wb&&(r=!0);if(q||r){var s=b.m(0).x,t=b.m(0).y,v=b.m(1).x,y=b.m(1).y,A=b.m(2).x,B=b.m(2).y,C=b.m(3).x,M=b.m(3).y;if(q){90===this.ga||270===this.ga?(v=s,y=(t+M)/2):(v=(s+C)/2,y=t);b.ca(1,v,y);var I=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,g,k);I.G()||I.set(e.ba.Bl);
b.ca(0,I.x,I.y)}r&&(90===this.ga||270===this.ga?(A=C,B=(t+M)/2):(A=(s+C)/2,B=M),b.ca(2,A,B),I=b.getLinkPoint(g,k,b.computeSpot(!1),!1,!1,e,h),I.G()||I.set(g.ba.Bl),b.ca(3,I.x,I.y))}}}b.fj()}else if(c.fromVertex.layer===c.toVertex.layer)b.fj();else{var V=!1,ea=!1,W=0,P=b.At+1;if(b.sc)ea=!0,W=b.ta,4<W&&b.points.removeRange(2,W-3);else if(b.Te===Bh)V=!0,W=b.ta,4<W&&b.points.removeRange(2,W-3),P=2;else{var W=b.ta,ba=b.computeSpot(!0)===Wb,Na=b.computeSpot(!1)===Wb;2<W&&ba&&Na?b.points.removeRange(1,W-
2):3<W&&ba&&!Na?b.points.removeRange(1,W-3):3<W&&!ba&&Na?b.points.removeRange(2,W-2):4<W&&!ba&&!Na&&b.points.removeRange(2,W-3)}var qa=c.fromVertex,Ma=c.toVertex,ta,Ga;if(c.rev){for(var za=0;null!==Ma&&qa!==Ma;){Ga=ta=null;for(var gc=Ma.tc.i;gc.next();){var ld=gc.value;if(ld.link===c.link&&(ta=ld.fromVertex,Ga=ld.toVertex,null===ta.Dd))break}if(ta!==qa)if(nb=b.m(P-1).x,gb=b.m(P-1).y,na=ta.sa,oa=ta.Aa,ea)180===this.ga||0===this.ga?2===P?(b.B(P++,nb,gb),b.B(P++,nb,oa)):(je=null!==Ga?Ga.Aa:gb,je!==oa&&
(ob=this.Sb[ta.layer-1],b.B(P++,ob,gb),b.B(P++,ob,oa))):2===P?(b.B(P++,nb,gb),b.B(P++,na,gb)):(od=null!==Ga?Ga.sa:nb,od!==na&&(ob=this.Sb[ta.layer-1],b.B(P++,nb,ob),b.B(P++,na,ob)));else if(2===P)if(Va=Math.max(10,this.sg[Ma.layer]),Ta=Math.max(10,this.Sf[Ma.layer]),V)180===this.ga?na<=Ma.Q.x?(za=Ma.Q.x,b.B(P++,za-Va,oa),b.B(P++,za,oa),b.B(P++,za+Ta,oa)):(b.B(P++,na-Va,oa),b.B(P++,na,oa),b.B(P++,na+Ta,oa)):90===this.ga?oa>=Ma.Q.bottom?(za=Ma.Q.y+Ma.Q.height,b.B(P++,na,za+Ta),b.B(P++,na,za),b.B(P++,
na,za-Va)):(b.B(P++,na,oa+Ta),b.B(P++,na,oa),b.B(P++,na,oa-Va)):270===this.ga?oa<=Ma.Q.y?(za=Ma.Q.y,b.B(P++,na,za-Va),b.B(P++,na,za),b.B(P++,na,za+Ta)):(b.B(P++,na,oa-Va),b.B(P++,na,oa),b.B(P++,na,oa+Ta)):0===this.ga&&(na>=Ma.Q.right?(za=Ma.Q.x+Ma.Q.width,b.B(P++,za+Ta,oa),b.B(P++,za,oa),b.B(P++,za-Va,oa)):(b.B(P++,na+Ta,oa),b.B(P++,na,oa),b.B(P++,na-Va,oa)));else{b.B(P++,nb,gb);var md=0;if(180===this.ga||0===this.ga){if(180===this.ga?na>=Ma.Q.right:na<=Ma.Q.x)md=(0===this.ga?-Va:Ta)/2;b.B(P++,nb+
md,oa)}else{if(270===this.ga?oa>=Ma.Q.bottom:oa<=Ma.Q.y)md=(90===this.ga?-Va:Ta)/2;b.B(P++,na,gb+md)}b.B(P++,na,oa)}else Va=Math.max(10,this.sg[ta.layer]),Ta=Math.max(10,this.Sf[ta.layer]),180===this.ga?(V&&b.B(P++,na-Va,oa),b.B(P++,na,oa),V&&b.B(P++,na+Ta,oa)):90===this.ga?(V&&b.B(P++,na,oa+Ta),b.B(P++,na,oa),V&&b.B(P++,na,oa-Va)):270===this.ga?(V&&b.B(P++,na,oa-Va),b.B(P++,na,oa),V&&b.B(P++,na,oa+Ta)):(V&&b.B(P++,na+Ta,oa),b.B(P++,na,oa),V&&b.B(P++,na-Va,oa));Ma=ta}if(null===k||b.computeSpot(!1)!==
Wb||ea)if(nb=b.m(P-1).x,gb=b.m(P-1).y,na=b.m(P).x,oa=b.m(P).y,ea){var De=this.Sf[qa.layer],Yb=0;180===this.ga||0===this.ga?(Yb=gb,Yb>=qa.Q.y&&Yb<=qa.Q.bottom&&(180===this.ga?na>=qa.Q.x:na<=qa.Q.right)&&(za=qa.sa+(180===this.ga?-De:De),Yb=Yb<qa.Q.y+qa.Q.height/2?qa.Q.y-this.Td/2:qa.Q.bottom+this.Td/2,b.B(P++,za,gb),b.B(P++,za,Yb)),b.B(P++,na,Yb)):(Yb=nb,Yb>=qa.Q.x&&Yb<=qa.Q.right&&(270===this.ga?oa>=qa.Q.y:oa<=qa.Q.bottom)&&(za=qa.Aa+(270===this.ga?-De:De),Yb=Yb<qa.Q.x+qa.Q.width/2?qa.Q.x-this.Td/
2:qa.Q.right+this.Td/2,b.B(P++,nb,za),b.B(P++,Yb,za)),b.B(P++,Yb,oa));b.B(P++,na,oa)}else if(V)Va=Math.max(10,this.sg[qa.layer]),Ta=Math.max(10,this.Sf[qa.layer]),180===this.ga&&na>=qa.Q.x?(za=qa.Q.x+qa.Q.width,b.ca(P-2,za,gb),b.ca(P-1,za+Ta,gb)):90===this.ga&&oa<=qa.Q.bottom?(za=qa.Q.y,b.ca(P-2,nb,za),b.ca(P-1,nb,za-Va)):270===this.ga&&oa>=qa.Q.y?(za=qa.Q.y+qa.Q.height,b.ca(P-2,nb,za),b.ca(P-1,nb,za+Ta)):0===this.ga&&na<=qa.Q.right&&(za=qa.Q.x,b.ca(P-2,za,gb),b.ca(P-1,za-Va,gb));else{Va=Math.max(10,
this.sg[qa.layer]);Ta=Math.max(10,this.Sf[qa.layer]);md=0;if(180===this.ga||0===this.ga){if(180===this.ga?na<=qa.Q.x:na>=qa.Q.right)md=(0===this.ga?Ta:-Va)/2;b.B(P++,na+md,gb)}else{if(270===this.ga?oa<=qa.Q.y:oa>=qa.Q.bottom)md=(90===this.ga?Ta:-Va)/2;b.B(P++,nb,oa+md)}b.B(P++,na,oa)}}else{for(;null!==qa&&qa!==Ma;){Ga=ta=null;for(var xg=qa.hc.i;xg.next();){var nd=xg.value;if(nd.link===c.link&&(ta=nd.toVertex,Ga=nd.fromVertex,null!==Ga.Dd&&(Ga=null),null===ta.Dd))break}var nb=0,gb=0,na=0,oa=0,ob=0,
Va=0,Ta=0;if(ta!==Ma)if(nb=b.m(P-1).x,gb=b.m(P-1).y,na=ta.sa,oa=ta.Aa,ea)if(180===this.ga||0===this.ga){var je=null!==Ga?Ga.Aa:gb;je!==oa&&(ob=this.Sb[ta.layer],2===P&&(ob=0===this.ga?Math.max(ob,nb):Math.min(ob,nb)),b.B(P++,ob,gb),b.B(P++,ob,oa))}else{var od=null!==Ga?Ga.sa:nb;od!==na&&(ob=this.Sb[ta.layer],2===P&&(ob=90===this.ga?Math.max(ob,gb):Math.min(ob,gb)),b.B(P++,nb,ob),b.B(P++,na,ob))}else Va=Math.max(10,this.sg[ta.layer]),Ta=Math.max(10,this.Sf[ta.layer]),180===this.ga?(b.B(P++,na+Ta,oa),
V&&b.B(P++,na,oa),b.B(P++,na-Va,oa)):90===this.ga?(b.B(P++,na,oa-Va),V&&b.B(P++,na,oa),b.B(P++,na,oa+Ta)):270===this.ga?(b.B(P++,na,oa+Ta),V&&b.B(P++,na,oa),b.B(P++,na,oa-Va)):(b.B(P++,na-Va,oa),V&&b.B(P++,na,oa),b.B(P++,na+Ta,oa));qa=ta}ea&&(nb=b.m(P-1).x,gb=b.m(P-1).y,na=b.m(P).x,oa=b.m(P).y,180===this.ga||0===this.ga?gb!==oa&&(ob=0===this.ga?Math.min(Math.max((na+nb)/2,this.Sb[Ma.layer]),na):Math.max(Math.min((na+nb)/2,this.Sb[Ma.layer]),na),b.B(P++,ob,gb),b.B(P++,ob,oa)):nb!==na&&(ob=90===this.ga?
Math.min(Math.max((oa+gb)/2,this.Sb[Ma.layer]),oa):Math.max(Math.min((oa+gb)/2,this.Sb[Ma.layer]),oa),b.B(P++,nb,ob),b.B(P++,na,ob)))}if(null!==d&&V){if(null!==h){if(b.computeSpot(!0)===Wb){var Td=b.m(0),Ed=b.m(2);Td.O(Ed)||b.ca(1,(Td.x+Ed.x)/2,(Td.y+Ed.y)/2)}I=b.getLinkPoint(e,h,Wb,!0,!1,g,k);I.G()||I.set(e.ba.Bl);b.ca(0,I.x,I.y)}null!==k&&(b.computeSpot(!1)===Wb&&(Td=b.m(b.ta-1),Ed=b.m(b.ta-3),Td.O(Ed)||b.ca(b.ta-2,(Td.x+Ed.x)/2,(Td.y+Ed.y)/2)),I=b.getLinkPoint(g,k,Wb,!1,!1,e,h),I.G()||I.set(g.ba.Bl),
b.ca(b.ta-1,I.x,I.y))}b.fj();c.commit()}}}for(var Ud=new J(G),yg=this.network.edges.i;yg.next();){var Uc=yg.value.link;null!==Uc&&Uc.sc&&!Ud.contains(Uc)&&Ud.add(Uc)}if(0<Ud.count)if(90===this.ga||270===this.ga){for(var Oh=0,xb=new J(mr),Nb,Vc,Yg=Ud.i;Yg.next();){var Ib=Yg.value;if(null!==Ib&&Ib.sc)for(var ib=2;ib<Ib.ta-3;ib++)if(Nb=Ib.m(ib),Vc=Ib.m(ib+1),this.F(Nb.y,Vc.y)&&!this.F(Nb.x,Vc.x)){var ab=new mr;ab.layer=Math.floor(Nb.y/2);var Ee=Ib.m(0),Fd=Ib.m(Ib.ta-1);ab.first=Ee.x*Ee.x+Ee.y;ab.be=
Fd.x*Fd.x+Fd.y;ab.Se=Math.min(Nb.x,Vc.x);ab.ie=Math.max(Nb.x,Vc.x);ab.index=ib;ab.link=Ib;if(ib+2<Ib.ta){var zg=Ib.m(ib-1),Ag=Ib.m(ib+2),hc=0;zg.y<Nb.y?hc=Ag.y<Nb.y?3:Nb.x<Vc.x?2:1:zg.y>Nb.y&&(hc=Ag.y>Nb.y?0:Vc.x<Nb.x?2:1);ab.ri=hc}xb.add(ab)}}if(1<xb.count){xb.sort(this.$F);for(var ic=0;ic<xb.count;){for(var Vd=xb.o[ic].layer,Wc=ic+1;Wc<xb.count&&xb.o[Wc].layer===Vd;)Wc++;if(1<Wc-ic)for(var jb=ic;jb<Wc;){for(var Lc=xb.o[jb].ie,Pa=ic+1;Pa<Wc&&xb.o[Pa].Se<Lc;)Lc=Math.max(Lc,xb.o[Pa].ie),Pa++;var kb=
Pa-jb;if(1<kb){xb.iq(this.Tx,jb,jb+kb);for(var qc=1,pd=xb.o[jb].be,ib=jb;ib<Pa;ib++){var Jb=xb.o[ib];Jb.be!==pd&&(qc++,pd=Jb.be)}xb.iq(this.ZF,jb,jb+kb);for(var Wd=1,pd=xb.o[jb].first,ib=jb;ib<Pa;ib++)Jb=xb.o[ib],Jb.first!==pd&&(Wd++,pd=Jb.first);var ef=!0,Fe=Wd;qc<Wd?(ef=!1,Fe=qc,pd=xb.o[jb].be,xb.iq(this.Tx,jb,jb+kb)):pd=xb.o[jb].first;for(var xf=0,ib=jb;ib<Pa;ib++){Jb=xb.o[ib];(ef?Jb.first:Jb.be)!==pd&&(xf++,pd=ef?Jb.first:Jb.be);Ib=Jb.link;Nb=Ib.m(Jb.index);Vc=Ib.m(Jb.index+1);var Kb=this.uF*
(xf-(Fe-1)/2);if(!Ib.lj||nr(Nb.x,Nb.y+Kb,Vc.x,Vc.y+Kb))Oh++,Ib.am(),Ib.ca(Jb.index,Nb.x,Nb.y+Kb),Ib.ca(Jb.index+1,Vc.x,Vc.y+Kb),Ib.fj()}}jb=Pa}ic=Wc}}}else{for(var ke=0,Ob=new J(mr),Qb,Lb,Xc=Ud.i;Xc.next();){var Ab=Xc.value;if(null!==Ab&&Ab.sc)for(var lb=2;lb<Ab.ta-3;lb++)if(Qb=Ab.m(lb),Lb=Ab.m(lb+1),this.F(Qb.x,Lb.x)&&!this.F(Qb.y,Lb.y)){var jc=new mr;jc.layer=Math.floor(Qb.x/2);var Zg=Ab.m(0),Bg=Ab.m(Ab.ta-1);jc.first=Zg.x+Zg.y*Zg.y;jc.be=Bg.x+Bg.y*Bg.y;jc.Se=Math.min(Qb.y,Lb.y);jc.ie=Math.max(Qb.y,
Lb.y);jc.index=lb;jc.link=Ab;if(lb+2<Ab.ta){var $g=Ab.m(lb-1),Cg=Ab.m(lb+2),Xd=0;$g.x<Qb.x?Xd=Cg.x<Qb.x?3:Qb.y<Lb.y?2:1:$g.x>Qb.x&&(Xd=Cg.x>Qb.x?0:Lb.y<Qb.y?2:1);jc.ri=Xd}Ob.add(jc)}}if(1<Ob.count){Ob.sort(this.$F);for(var Zb=0;Zb<Ob.count;){for(var Ge=Ob.o[Zb].layer,rc=Zb+1;rc<Ob.count&&Ob.o[rc].layer===Ge;)rc++;if(1<rc-Zb)for(var Fb=Zb;Fb<rc;){for(var Rb=Ob.o[Fb].ie,Sb=Zb+1;Sb<rc&&Ob.o[Sb].Se<Rb;)Rb=Math.max(Rb,Ob.o[Sb].ie),Sb++;var le=Sb-Fb;if(1<le){Ob.iq(this.Tx,Fb,Fb+le);for(var sc=1,tc=Ob.o[Fb].be,
lb=Fb;lb<Sb;lb++){var Bb=Ob.o[lb];Bb.be!==tc&&(sc++,tc=Bb.be)}Ob.iq(this.ZF,Fb,Fb+le);for(var Yc=1,tc=Ob.o[Fb].first,lb=Fb;lb<Sb;lb++)Bb=Ob.o[lb],Bb.first!==tc&&(Yc++,tc=Bb.first);var Gd=!0,Yd=Yc;sc<Yc?(Gd=!1,Yd=sc,tc=Ob.o[Fb].be,Ob.iq(this.Tx,Fb,Fb+le)):tc=Ob.o[Fb].first;for(var ff=0,lb=Fb;lb<Sb;lb++){Bb=Ob.o[lb];(Gd?Bb.first:Bb.be)!==tc&&(ff++,tc=Gd?Bb.first:Bb.be);Ab=Bb.link;Qb=Ab.m(Bb.index);Lb=Ab.m(Bb.index+1);var Dg=this.uF*(ff-(Yd-1)/2);if(!Ab.lj||nr(Qb.x+Dg,Qb.y,Lb.x+Dg,Lb.y))ke++,Ab.am(),
Ab.ca(Bb.index,Qb.x+Dg,Qb.y),Ab.ca(Bb.index+1,Lb.x+Dg,Lb.y),Ab.fj()}}Fb=Sb}Zb=rc}}}};sm.prototype.$F=function(a,b){return a instanceof mr&&b instanceof mr&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Se<b.Se?-1:a.Se>b.Se?1:a.ie<b.ie?-1:a.ie>b.ie?1:0:0};sm.prototype.ZF=function(a,b){return a instanceof mr&&b instanceof mr&&a!==b?a.first<b.first?-1:a.first>b.first||a.ri<b.ri?1:a.ri>b.ri||a.Se<b.Se?-1:a.Se>b.Se?1:a.ie<b.ie?-1:a.ie>b.ie?1:0:0};
sm.prototype.Tx=function(a,b){return a instanceof mr&&b instanceof mr&&a!==b?a.be<b.be?-1:a.be>b.be||a.ri<b.ri?1:a.ri>b.ri||a.Se<b.Se?-1:a.Se>b.Se?1:a.ie<b.ie?-1:a.ie>b.ie?1:0:0};sm.prototype.F=function(a,b){u&&(x.p(a,sm,"isApprox:a"),x.p(b,sm,"isApprox:b"));var c=a-b;return-1<c&&1>c};function nr(a,b,c,d){u&&(x.p(a,sm,"isUnoccupied2:px"),x.p(b,sm,"isUnoccupied2:py"),x.p(c,sm,"isUnoccupied2:qx"),x.p(d,sm,"isUnoccupied2:qy"));return!0}
function Eq(a,b){var c,d=a.de[b];if(d>=a.ah.length){c=[];for(var e=0;e<a.ah.length;e++)c[e]=a.ah[e];a.ah=c}void 0===a.ah[d]||null===a.ah[d]?c=[]:(c=a.ah[d],a.ah[d]=null);d=a.Ur[b];for(e=0;e<d.length;e++){var g=d[e];c[g.index]=g}return c}function Fq(a,b,c){a.ah[a.de[b]]=c}x.defineProperty(sm,{layerSpacing:"layerSpacing"},function(){return this.zm},function(a){this.zm!==a&&(x.g(a,"number",sm,"layerSpacing"),0<=a&&(this.zm=a,this.J()))});
x.defineProperty(sm,{PK:"columnSpacing"},function(){return this.Td},function(a){this.Td!==a&&(x.g(a,"number",sm,"columnSpacing"),0<=a&&(this.Td=a,this.J()))});x.defineProperty(sm,{direction:"direction"},function(){return this.ga},function(a){this.ga!==a&&(x.g(a,"number",sm,"direction"),0===a||90===a||180===a||270===a?(this.ga=a,this.J()):x.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))});
x.defineProperty(sm,{angle:"angle"},function(){return this.direction},function(a){this.direction=a});x.defineProperty(sm,{UH:"cycleRemoveOption"},function(){return this.Zn},function(a){this.Zn!==a&&(x.Ca(a,sm,sm,"cycleRemoveOption"),a===xq||a===rq)&&(this.Zn=a,this.J())});x.defineProperty(sm,{bJ:"layeringOption"},function(){return this.Go},function(a){this.Go!==a&&(x.Ca(a,sm,sm,"layeringOption"),a===sq||a===Pq||a===Rq)&&(this.Go=a,this.J())});
x.defineProperty(sm,{LI:"initializeOption"},function(){return this.wo},function(a){this.wo!==a&&(x.Ca(a,sm,sm,"initializeOption"),a===tq||a===Xq||a===Vq)&&(this.wo=a,this.J())});x.defineProperty(sm,{AL:"iterations"},function(){return this.wm},function(a){this.wm!==a&&(x.p(a,wq,"iterations"),0<=a&&(this.wm=a,this.J()))});x.defineProperty(sm,{uH:"aggressiveOption"},function(){return this.Pn},function(a){this.Pn!==a&&(x.Ca(a,sm,sm,"aggressiveOption"),a===ar||a===uq||a===br)&&(this.Pn=a,this.J())});
x.defineProperty(sm,{XL:"packOption"},function(){return this.Si},function(a){this.Si!==a&&(x.g(a,"number",sm,"packOption"),0<=a&&8>a&&(this.Si=a,this.J()))});x.defineProperty(sm,{fq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(x.g(a,"boolean",sm,"setsPortSpots"),this.ci=a,this.J())});x.defineProperty(sm,{uF:"linkSpacing"},function(){return this.Br},function(a){this.Br!==a&&(x.g(a,"number",sm,"linkSpacing"),0<=a&&(this.Br=a,this.J()))});x.w(sm,{kJ:"maxLayer"},function(){return this.Bb});
x.w(sm,{GL:"maxIndex"},function(){return this.Mv});x.w(sm,{FL:"maxColumn"},function(){return this.Mb});x.w(sm,{LL:"minIndexLayer"},function(){return this.Lr});x.w(sm,{HL:"maxIndexLayer"},function(){return this.Tf});var rq;sm.CycleDepthFirst=rq=x.s(sm,"CycleDepthFirst",0);var xq;sm.CycleGreedy=xq=x.s(sm,"CycleGreedy",1);var sq;sm.LayerOptimalLinkLength=sq=x.s(sm,"LayerOptimalLinkLength",0);var Pq;sm.LayerLongestPathSink=Pq=x.s(sm,"LayerLongestPathSink",1);var Rq;
sm.LayerLongestPathSource=Rq=x.s(sm,"LayerLongestPathSource",2);var tq;sm.InitDepthFirstOut=tq=x.s(sm,"InitDepthFirstOut",0);var Xq;sm.InitDepthFirstIn=Xq=x.s(sm,"InitDepthFirstIn",1);var Vq;sm.InitNaive=Vq=x.s(sm,"InitNaive",2);var ar;sm.AggressiveNone=ar=x.s(sm,"AggressiveNone",0);var uq;sm.AggressiveLess=uq=x.s(sm,"AggressiveLess",1);var br;sm.AggressiveMore=br=x.s(sm,"AggressiveMore",2);sm.PackNone=0;var cr;sm.PackExpand=cr=1;var dr;sm.PackStraighten=dr=2;var fr;sm.PackMedian=fr=4;var vq;
sm.PackAll=vq=7;function mr(){this.index=this.ie=this.Se=this.be=this.first=this.layer=0;this.link=null;this.ri=0}x.Yd(mr,{layer:!0,first:!0,be:!0,Se:!0,ie:!0,index:!0,link:!0,ri:!0});function wq(){xa.call(this)}x.Qa(wq,xa);x.ja("LayeredDigraphNetwork",wq);wq.prototype.createVertex=function(){return new or};wq.prototype.createEdge=function(){return new pr};
function or(){ya.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.pp=NaN;this.an=0;this.OA=this.PA=null}x.Qa(or,ya);x.ja("LayeredDigraphVertex",or);function pr(){Aa.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}x.Qa(pr,Aa);x.ja("LayeredDigraphEdge",pr);
function Z(){0<arguments.length&&x.pd(Z);df.call(this);this.Hd=new K(Object);this.cs=qr;this.Qf=rr;this.Us=sr;this.Kv=tr;this.OB=null;this.Mh=!0;this.rd=ur;this.lg=(new Fa(10,10)).freeze();this.za=new vr;this.ya=new vr;this.Jz=[]}x.Qa(Z,df);x.ja("TreeLayout",Z);Z.prototype.cloneProtected=function(a){df.prototype.cloneProtected.call(this,a);a.cs=this.cs;a.Us=this.Us;a.Kv=this.Kv;a.Mh=this.Mh;a.rd=this.rd;a.lg.assign(this.lg);a.za.copyInheritedPropertiesFrom(this.za);a.ya.copyInheritedPropertiesFrom(this.ya)};
Z.prototype.createNetwork=function(){return new wr};Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof E)return!a.Ef&&"Comment"!==a.Lc;if(a instanceof G){var b=a.Z;if(null===b||b.Ef||"Comment"===b.Lc)return!1;a=a.fa;return null===a||a.Ef||"Comment"===a.Lc?!1:!0}return!1}var c=this.createNetwork();c.Tb=this;a instanceof z?(c.lk(a.yh,!0,b),c.lk(a.links,!0,b)):a instanceof F?c.lk(a.Gc,!1,b):c.lk(a.i,!1,b);return c};
Z.prototype.doLayout=function(a){null===a&&x.k("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.Zf!==xr&&(this.he=this.initialOrigin(this.he));var b=this.h;null===b&&a instanceof z&&(b=a);this.Qf=this.path===qr&&null!==b?b.ae?rr:yr:this.path===qr?rr:this.path;if(0<this.network.vertexes.count){this.network.ax();for(a=this.network.vertexes.i;a.next();)b=a.value,b.initialized=!1,b.level=
0,b.parent=null,b.children=[];if(0<this.Hd.count){a=new K(vr);for(b=this.Hd.i;b.next();){var c=b.value;c instanceof E?(c=this.network.on(c),null!==c&&a.add(c)):c instanceof vr&&a.add(c)}this.Hd=a}0===this.Hd.count&&this.findRoots();for(a=this.Hd.copy().i;a.next();)b=a.value,b.initialized||(b.initialized=!0,zr(this,b));for(a=this.Hd.i;a.next();)b=a.value,b instanceof vr&&Ar(this,b);for(a=this.Hd.i;a.next();)b=a.value,b instanceof vr&&Br(this,b);for(a=this.Hd.i;a.next();)b=a.value,b instanceof vr&&
Cr(this,b);this.Wz();if(this.BA===Dr){c=[];for(a=this.network.vertexes.i;a.next();){var d=a.value,b=d.parent;null===b&&(b=d);var b=0===b.angle||180===b.angle,e=c[d.level];void 0===e&&(e=0);c[d.level]=Math.max(e,b?d.width:d.height)}for(d=0;d<c.length;d++)void 0===c[d]&&(c[d]=0);this.OB=c;for(a=this.network.vertexes.i;a.next();)d=a.value,b=d.parent,null===b&&(b=d),0===b.angle||180===b.angle?(180===b.angle&&(d.Bt+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Ct+=c[d.level]-d.height),d.height=
c[d.level])}else if(this.BA===Er)for(a=this.network.vertexes.i;a.next();){c=a.value;b=0===c.angle||180===c.angle;e=-1;for(d=0;d<c.children.length;d++)var g=c.children[d],e=Math.max(e,b?g.width:g.height);if(0<=e)for(d=0;d<c.children.length;d++)g=c.children[d],b?(180===c.angle&&(g.Bt+=e-g.width),g.width=e):(270===c.angle&&(g.Ct+=e-g.height),g.height=e)}for(a=this.Hd.i;a.next();)b=a.value,b instanceof vr&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Hd=new K(Object);
this.Hf=!0};
Z.prototype.findRoots=function(){for(var a=this.network.vertexes.i;a.next();){var b=a.value;switch(this.Qf){case rr:0===b.tc.count&&this.Hd.add(b);break;case yr:0===b.hc.count&&this.Hd.add(b);break;default:x.k("Unhandled path value "+this.Qf.toString())}}if(0===this.Hd.count){for(var a=999999,b=null,c=this.network.vertexes.i;c.next();){var d=c.value;switch(this.Qf){case rr:d.tc.count<a&&(a=d.tc.count,b=d);break;case yr:d.hc.count<a&&(a=d.hc.count,b=d);break;default:x.k("Unhandled path value "+this.Qf.toString())}}null!==
b&&this.Hd.add(b)}};
function zr(a,b){if(null!==b){u&&x.l(b,vr,Z,"walkTree:v");switch(a.Qf){case rr:if(0<b.hc.count){for(var c=new J(vr),d=b.ZH;d.next();){var e=d.value;Fr(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.kc())}break;case yr:if(0<b.tc.count){c=new J(vr);for(d=b.$J;d.next();)e=d.value,Fr(a,b,e)&&c.add(e);0<c.count&&(b.children=c.kc())}break;default:x.k("Unhandled path value"+a.Qf.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var g=c[e];g.initialized=!0;g.level=b.level+1;g.parent=b;a.Hd.remove(g)}for(e=0;e<
d;e++)g=c[e],zr(a,g)}}function Fr(a,b,c){u&&x.l(b,vr,Z,"walkOK:v");u&&x.l(c,vr,Z,"walkOK:c");if(c.initialized){var d;if(null===b)d=!1;else{u&&x.l(c,vr,Z,"isAncestor:a");u&&x.l(b,vr,Z,"isAncestor:b");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){if(null!==a&&null!==b){u&&x.l(a,vr,Z,"removeChild:p");u&&x.l(b,vr,Z,"removeChild:c");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 Ar(a,b){if(null!==b){u&&x.l(b,vr,Z,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===Gr&&a.sortTreeVertexChildren(b);for(var c=0,d=b.cn,e=0,g=b.children,h=g.length,k=0;k<h;k++){var l=g[k];Ar(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 Hr(a,b){u&&x.l(b,vr,Z,"mom:v");switch(a.Us){default:case sr:return null!==b.parent?b.parent:a.za;case Ir:return null===b.parent?a.za:null===b.parent.parent?a.ya:b.parent;case Jr:if(null!==b.parent)return null!==b.parent.parent?b.parent.parent:a.ya;case Kr:var c=!0;if(0===b.cn)c=!1;else for(var d=b.children,e=d.length,g=0;g<e;g++)if(0<d[g].cn){c=!1;break}return c&&null!==b.parent?a.ya:null!==b.parent?b.parent:a.za}}
Z.prototype.initializeTreeVertexValues=function(a){u&&x.l(a,vr,Z,"initializeTreeVertexValues:v");var b=Hr(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===Gr){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 Br(a,b){if(null!==b){u&&x.l(b,vr,Z,"assignTree:v");a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Br(a,c[e])}}Z.prototype.assignTreeVertexValues=function(){};function Cr(a,b){if(null!==b){u&&x.l(b,vr,Z,"sortTree:v");b.alignment!==Gr&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Cr(a,c[e])}}
Z.prototype.sortTreeVertexChildren=function(a){u&&x.l(a,vr,Z,"sortTreeVertexChildren:v");switch(a.sorting){case Lr:break;case Mr:a.children.reverse();break;case Nr:a.children.sort(a.comparer);break;case Or:a.children.sort(a.comparer);a.children.reverse();break;default:x.k("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.Wz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
Z.prototype.addComments=function(a){u&&x.l(a,vr,Z,"addComments:v");var b=a.angle,c=a.parent,d=0,e=Pr,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=Qr(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.cn,g=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Pc)for(var m=a.Pc.PE();m.next();){var n=m.value;"Comment"===n.Lc&&n.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.Af(),n=n.Ia,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=x.Dk(0,0,a.Q.width+g,a.Q.height+h),a.Cb=e,x.qc(e))};function Qr(a){return a===Rr||a===Gr||a===Sr||a===Tr}function Ur(a){return a===Rr||a===Gr}
function Vr(a){u&&x.l(a,vr,Z,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(Qr(c)){if(Ur(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===Sr)return!0}}return!1}
Z.prototype.layoutComments=function(a){u&&x.l(a,vr,Z,"layoutComments:v");if(null!==a.comments){var b=a.Pc.Ia,c=a.parent,d=a.angle,e=0,g=Pr,g=!1;null!==c&&(e=c.angle,g=c.alignment,g=Qr(g));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.cn,k=Vr(a),l=0,m=a.comments,n=m.length,p=x.P(),q=0;q<n;q++){var r=m[q],s=r.Ia;if(c&&!h||!g&&!d&&h||g&&d&&h){if(135<e&&!g||d&&k)if(0<=a.commentMargin)for(p.n(a.Q.x-a.commentMargin-s.width,a.Q.y+l),r.move(p),r=r.Fg();r.next();){var t=r.value;t.Gb=Sc;t.Hb=Tc}else for(p.n(a.Q.x+
2*a.R.x-a.commentMargin,a.Q.y+l),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=Tc,t.Hb=Sc;else if(0<=a.commentMargin)for(p.n(a.Q.x+2*a.R.x+a.commentMargin,a.Q.y+l),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=Tc,t.Hb=Sc;else for(p.n(a.Q.x+a.commentMargin-s.width,a.Q.y+l),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=Sc,t.Hb=Tc;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!g||!d&&k)if(0<=a.commentMargin)for(p.n(a.Q.x+l,a.Q.y-a.commentMargin-s.height),
r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=Rc,t.Hb=bd;else for(p.n(a.Q.x+l,a.Q.y+2*a.R.y-a.commentMargin),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=bd,t.Hb=Rc;else if(0<=a.commentMargin)for(p.n(a.Q.x+l,a.Q.y+2*a.R.y+a.commentMargin),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=bd,t.Hb=Rc;else for(p.n(a.Q.x+l,a.Q.y+a.commentMargin-s.height),r.move(p),r=r.Fg();r.next();)t=r.value,t.Gb=Rc,t.Hb=bd;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}x.A(p);b=l-a.commentSpacing-
(c?b.height:b.width);if(this.Qf===rr)for(e=a.hc;e.next();)a=e.value.link,null===a||a.lj||(a.Ml=0<b?b:NaN);else for(e=a.tc;e.next();)a=e.value.link,null===a||a.lj||(a.em=0<b?b:NaN)}};
Z.prototype.layoutTree=function(a){if(null!==a){u&&x.l(a,vr,Z,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case Wr:Xr(this,a);break;case Yr:if(a.alignment===Gr)Xr(this,a);else if(u&&x.l(a,vr,Z,"layoutTreeBlock:v"),0===a.cn){var d=a.parent,b=!1,c=0,e=Pr;null!==d&&(c=d.angle,e=d.alignment,b=Qr(e));d=Vr(a);a.ra.n(0,0);a.rb.n(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.Ta.n(0,0):180===c&&!b||(90===c||270===
c)&&d?a.Ta.n(a.width-2*a.R.x,0):a.Ta.n(0,a.height-2*a.R.y);a.Tt=null;a.nu=null}else{for(var g=Zr(a),b=90===g||270===g,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.rb.width:n.rb.height);var p=a.alignment,d=p===$r,q=p===as,r=Qr(p),s=Math.max(0,a.breadthLimit),c=bs(a),t=a.nodeSpacing,v=cs(a),y=a.rowSpacing,A=0;if(d||q||a.aq||a.bq&&1===a.maxGenerationCount)A=Math.max(0,a.rowIndent);var d=a.width,e=a.height,B=0,C=0,M=0,I=null,V=null,ea=0,W=0,P=0,ba=0,Na=0,qa=0,Ma=0,ta=0,n=0;r&&!Ur(p)&&
135<g&&k.reverse();if(Ur(p))if(1<l)for(m=0;m<l;m++)0===m%2&&m!==l-1?ta=Math.max(ta,b?k[m].rb.width:k[m].rb.height):0!==m%2&&(n=Math.max(n,b?k[m].rb.width:k[m].rb.height));else 1===l&&(ta=b?k[0].rb.width:k[0].rb.height);if(r){switch(p){case Rr:W=135>g?ds(a,k,ta,B,C):es(a,k,ta,B,C);ta=W.x;B=W.width;C=W.height;break;case Sr:for(m=0;m<l;m++){var n=k[m],Ga=n.rb,I=0===qa?0:y;b?(n.ra.n(h-Ga.width,ba+I),B=Math.max(B,Ga.width),C=Math.max(C,ba+I+Ga.height),ba+=I+Ga.height):(n.ra.n(P+I,h-Ga.height),B=Math.max(B,
P+I+Ga.width),C=Math.max(C,Ga.height),P+=I+Ga.width);qa++}break;case Tr:for(m=0;m<l;m++)n=k[m],Ga=n.rb,I=0===qa?0:y,b?(n.ra.n(t/2+a.R.x,ba+I),B=Math.max(B,Ga.width),C=Math.max(C,ba+I+Ga.height),ba+=I+Ga.height):(n.ra.n(P+I,t/2+a.R.y),B=Math.max(B,P+I+Ga.width),C=Math.max(C,Ga.height),P+=I+Ga.width),qa++}I=ks(this,2);V=ks(this,2);b?(I[0].n(0,0),I[1].n(0,C),V[0].n(B,0)):(I[0].n(0,0),I[1].n(B,0),V[0].n(0,C));V[1].n(B,C)}else for(m=0;m<l;m++){n=k[m];Ga=n.rb;if(b){0<s&&0<qa&&P+t+Ga.width>s&&(P<h&&ls(a,
p,h-P,0,Ma,m-1),Na++,qa=0,Ma=m,M=C,P=0,ba=135<g?-C-y:C+y);ms(this,n,0,ba);var za=0;if(0===qa){if(I=n.Tt,V=n.nu,ea=Ga.width,W=Ga.height,null===I||null===V||g!==Zr(n))I=ks(this,2),V=ks(this,2),I[0].n(0,0),I[1].n(0,W),V[0].n(ea,0),V[1].n(ea,W)}else{var gc=x.ub(),W=ns(this,a,n,I,V,ea,W,gc),za=W.x,I=gc[0],V=gc[1],ea=W.width,W=W.height;x.xa(gc);P<Ga.width&&0>za&&(os(a,-za,0,Ma,m-1),ps(I,-za,0),ps(V,-za,0),za=0)}n.ra.n(za,ba);B=Math.max(B,ea);C=Math.max(C,M+(0===Na?0:y)+Ga.height);P=ea}else{0<s&&0<qa&&ba+
t+Ga.height>s&&(ba<h&&ls(a,p,0,h-ba,Ma,m-1),Na++,qa=0,Ma=m,M=B,ba=0,P=135<g?-B-y:B+y);ms(this,n,P,0);za=0;if(0===qa){if(I=n.Tt,V=n.nu,ea=Ga.width,W=Ga.height,null===I||null===V||g!==Zr(n))I=ks(this,2),V=ks(this,2),I[0].n(0,0),I[1].n(ea,0),V[0].n(0,W),V[1].n(ea,W)}else gc=x.ub(),W=ns(this,a,n,I,V,ea,W,gc),za=W.x,I=gc[0],V=gc[1],ea=W.width,W=W.height,x.xa(gc),ba<Ga.height&&0>za&&(os(a,0,-za,Ma,m-1),ps(I,0,-za),ps(V,0,-za),za=0);n.ra.n(P,za);C=Math.max(C,W);B=Math.max(B,M+(0===Na?0:y)+Ga.width);ba=W}qa++}0<
Na&&(b?(C+=Math.max(0,c),P<B&&ls(a,p,B-P,0,Ma,l-1),0<A&&(q||os(a,A,0,0,l-1),B+=A)):(B+=Math.max(0,c),ba<C&&ls(a,p,0,C-ba,Ma,l-1),0<A&&(q||os(a,0,A,0,l-1),C+=A)));q=h=0;switch(p){case qs:b?h+=B/2-a.R.x-v/2:q+=C/2-a.R.y-v/2;break;case Pr:0<Na?b?h+=B/2-a.R.x-v/2:q+=C/2-a.R.y-v/2:b?(m=k[0].ra.x+k[0].Ta.x,ta=k[l-1].ra.x+k[l-1].Ta.x+2*k[l-1].R.x,h+=m+(ta-m)/2-a.R.x-v/2):(m=k[0].ra.y+k[0].Ta.y,ta=k[l-1].ra.y+k[l-1].Ta.y+2*k[l-1].R.y,q+=m+(ta-m)/2-a.R.y-v/2);break;case $r:b?(h-=v,B+=v):(q-=v,C+=v);break;
case as:b?(h+=B-a.width+v,B+=v):(q+=C-a.height+v,C+=v);break;case Rr:b?h=1<l?h+(ta+t/2-a.R.x):h+(k[0].R.x-a.R.x+k[0].Ta.x):q=1<l?q+(ta+t/2-a.R.y):q+(k[0].R.y-a.R.y+k[0].Ta.y);break;case Sr:b?h+=B+t/2-a.R.x:q+=C+t/2-a.R.y;break;case Tr:break;default:x.k("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.ra.n(n.ra.x+n.Ta.x-h,n.ra.y+(135<g?(r?-C:-n.rb.height)+n.Ta.y-c:e+c+n.Ta.y)):n.ra.n(n.ra.x+(135<g?(r?-B:-n.rb.width)+n.Ta.x-c:d+c+n.Ta.x),n.ra.y+n.Ta.y-q);l=k=0;r?b?(B=rs(a,B,h),
0>h&&(h=0),135<g&&(q+=C+c),C+=e+c,p===Tr&&(k+=t/2+a.R.x),l+=e+c):(135<g&&(h+=B+c),B+=d+c,C=ss(a,C,q),0>q&&(q=0),p===Tr&&(l+=t/2+a.R.y),k+=d+c):b?(null===a.comments?d>B&&(p=ts(p,d-B,0),k=p.x,l=p.y,B=d,h=0):B=rs(a,B,h),0>h&&(k-=h,h=0),135<g&&(q+=C+c),C=Math.max(Math.max(C,e),C+e+c),l+=e+c):(135<g&&(h+=B+c),B=Math.max(Math.max(B,d),B+d+c),null===a.comments?e>C&&(p=ts(p,0,e-C),k=p.x,l=p.y,C=e,q=0):C=ss(a,C,q),0>q&&(l-=q,q=0),k+=d+c);if(0<Na)g=ks(this,4),p=ks(this,4),b?(g[2].n(0,e+c),g[3].n(g[2].x,C),
p[2].n(B,g[2].y),p[3].n(p[2].x,g[3].y)):(g[2].n(d+c,0),g[3].n(B,g[2].y),p[2].n(g[2].x,C),p[3].n(g[3].x,p[2].y));else{g=ks(this,I.length+2);p=ks(this,V.length+2);for(m=0;m<I.length;m++)r=I[m],g[m+2].n(r.x+k,r.y+l);for(m=0;m<V.length;m++)r=V[m],p[m+2].n(r.x+k,r.y+l)}b?(g[0].n(h,0),g[1].n(g[0].x,e),g[2].y<g[1].y&&(g[2].x>g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].y<g[2].y&&(g[3].x>g[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(h+d,0),p[1].n(p[0].x,e),p[2].y<p[1].y&&(p[2].x<p[0].x?p[2].assign(p[1]):
p[1].assign(p[2])),p[3].y<p[2].y&&(p[3].x<p[0].x?p[3].assign(p[2]):p[2].assign(p[3])),g[2].y-=c/2,p[2].y-=c/2):(g[0].n(0,q),g[1].n(d,g[0].y),g[2].x<g[1].x&&(g[2].y>g[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].x<g[2].x&&(g[3].y>g[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(0,q+e),p[1].n(d,p[0].y),p[2].x<p[1].x&&(p[2].y<p[0].y?p[2].assign(p[1]):p[1].assign(p[2])),p[3].x<p[2].x&&(p[3].y<p[0].y?p[3].assign(p[2]):p[2].assign(p[3])),g[2].x-=c/2,p[2].x-=c/2);us(this,I);us(this,V);a.Tt=g;a.nu=p;
a.Ta.n(h,q);a.rb.n(B,C)}break;default:x.k("Unhandled compaction value "+a.compaction.toString())}}};
function Xr(a,b){u&&x.l(b,vr,Z,"layoutTreeNone:v");if(0===b.cn){var c=!1,d=0,e=Pr;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=Qr(e));e=Vr(b);b.ra.n(0,0);b.rb.n(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Ta.n(0,0):180===d&&!c||(90===d||270===d)&&e?b.Ta.n(b.width-2*b.R.x,0):b.Ta.n(0,b.height-2*b.R.y)}else{for(var c=Zr(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.rb.width:l.rb.height);var m=b.alignment,n=
m===$r,p=m===as,q=Qr(m),r=Math.max(0,b.breadthLimit),s=bs(b),t=b.nodeSpacing,v=cs(b),y=n||p?0:v/2,A=b.rowSpacing,B=0;if(n||p||b.aq||b.bq&&1===b.maxGenerationCount)B=Math.max(0,b.rowIndent);var n=b.width,C=b.height,M=0,I=0,V=0,ea=0,W=0,P=0,ba=0,Na=0,qa=0,Ma=0;q&&!Ur(m)&&135<c&&e.reverse();if(Ur(m))if(1<h)for(k=0;k<h;k++){var l=e[k],ta=l.rb;0===k%2&&k!==h-1?qa=Math.max(qa,(d?ta.width:ta.height)+vs(l)-t):0!==k%2&&(Ma=Math.max(Ma,(d?ta.width:ta.height)+vs(l)-t))}else 1===h&&(qa=d?e[0].rb.width:e[0].rb.height);
if(q)switch(m){case Rr:case Gr:I=135>c?ds(b,e,qa,M,I):es(b,e,qa,M,I);qa=I.x;M=I.width;I=I.height;break;case Sr:for(k=0;k<h;k++)l=e[k],ta=l.rb,r=0===ba?0:A,d?(l.ra.n(g-ta.width,W+r),M=Math.max(M,ta.width),I=Math.max(I,W+r+ta.height),W+=r+ta.height):(l.ra.n(ea+r,g-ta.height),M=Math.max(M,ea+r+ta.width),I=Math.max(I,ta.height),ea+=r+ta.width),ba++;break;case Tr:for(g=0;g<h;g++)l=e[g],ta=l.rb,r=0===ba?0:A,d?(l.ra.n(t/2+b.R.x,W+r),M=Math.max(M,ta.width),I=Math.max(I,W+r+ta.height),W+=r+ta.height):(l.ra.n(ea+
r,t/2+b.R.y),M=Math.max(M,ea+r+ta.width),I=Math.max(I,ta.height),ea+=r+ta.width),ba++}else for(k=0;k<h;k++)l=e[k],ta=l.rb,d?(0<r&&0<ba&&ea+t+ta.width>r&&(ea<g&&ls(b,m,g-ea,0,Na,k-1),P++,ba=0,Na=k,V=I,ea=0,W=135<c?-I-A:I+A),Ma=0===ba?y:t,ms(a,l,0,W),l.ra.n(ea+Ma,W),M=Math.max(M,ea+Ma+ta.width),I=Math.max(I,V+(0===P?0:A)+ta.height),ea+=Ma+ta.width):(0<r&&0<ba&&W+t+ta.height>r&&(W<g&&ls(b,m,0,g-W,Na,k-1),P++,ba=0,Na=k,V=M,W=0,ea=135<c?-M-A:M+A),Ma=0===ba?y:t,ms(a,l,ea,0),l.ra.n(ea,W+Ma),I=Math.max(I,
W+Ma+ta.height),M=Math.max(M,V+(0===P?0:A)+ta.width),W+=Ma+ta.height),ba++;0<P&&(d?(I+=Math.max(0,s),ea<M&&ls(b,m,M-ea,0,Na,h-1),0<B&&(p||os(b,B,0,0,h-1),M+=B)):(M+=Math.max(0,s),W<I&&ls(b,m,0,I-W,Na,h-1),0<B&&(p||os(b,0,B,0,h-1),I+=B)));B=p=0;switch(m){case qs:d?p+=M/2-b.R.x-v/2:B+=I/2-b.R.y-v/2;break;case Pr:0<P?d?p+=M/2-b.R.x-v/2:B+=I/2-b.R.y-v/2:d?(m=e[0].ra.x+e[0].Ta.x,t=e[h-1].ra.x+e[h-1].Ta.x+2*e[h-1].R.x,p+=m+(t-m)/2-b.R.x-v/2):(m=e[0].ra.y+e[0].Ta.y,t=e[h-1].ra.y+e[h-1].Ta.y+2*e[h-1].R.y,
B+=m+(t-m)/2-b.R.y-v/2);break;case $r:d?(p-=v,M+=v):(B-=v,I+=v);break;case as:d?(p+=M-b.width+v,M+=v):(B+=I-b.height+v,I+=v);break;case Rr:case Gr:d?p=1<h?p+(qa+t/2-b.R.x):p+(e[0].R.x-b.R.x+e[0].Ta.x):B=1<h?B+(qa+t/2-b.R.y):B+(e[0].R.y-b.R.y+e[0].Ta.y);break;case Sr:d?p+=M+t/2-b.R.x:B+=I+t/2-b.R.y;break;case Tr:break;default:x.k("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.ra.n(l.ra.x+l.Ta.x-p,l.ra.y+(135<c?(q?-I:-l.rb.height)+l.Ta.y-s:C+s+l.Ta.y)):l.ra.n(l.ra.x+(135<c?(q?
-M:-l.rb.width)+l.Ta.x-s:n+s+l.Ta.x),l.ra.y+l.Ta.y-B);d?(M=rs(b,M,p),0>p&&(p=0),135<c&&(B+=I+s),I+=C+s):(135<c&&(p+=M+s),M+=n+s,I=ss(b,I,B),0>B&&(B=0));b.Ta.n(p,B);b.rb.n(M,I)}}
function ds(a,b,c,d,e){u&&x.l(a,vr,Z,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new w(c,0,d,e);if(1===g){var h=b[0];d=h.rb.width;e=h.rb.height;return new w(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Zr(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.rb,t=0===n?0:l;if(m){var v=vs(h)-k;h.ra.n(c-(s.width+v),q+t);d=Math.max(d,s.width+v);e=Math.max(e,q+t+s.height);q+=t+s.height}else v=vs(h)-k,h.ra.n(p+t,c-(s.height+v)),e=Math.max(e,s.height+v),d=Math.max(d,
p+t+s.width),p+=t+s.width;n++}var n=0,y=p,A=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.rb,t=0===n?0:l,m?(v=vs(h)-k,h.ra.n(p+v,q+t),d=Math.max(d,p+s.width+v),e=Math.max(e,q+t+s.height),q+=t+s.height):(v=vs(h)-k,h.ra.n(p+t,q+v),d=Math.max(d,p+t+s.width),e=Math.max(e,q+s.height+v),p+=t+s.width),n++);1<g&&1===g%2&&(h=b[g-1],s=h.rb,b=ws(h,m?Math.max(Math.abs(A),Math.abs(q)):Math.max(Math.abs(y),Math.abs(p))),m?(h.ra.n(c+k/2-h.R.x-h.Ta.x,e+b),m=c+k/2-h.R.x-h.Ta.x,d=Math.max(d,m+s.width),
0>m&&(d-=m),e=Math.max(e,Math.max(A,q)+b+s.height),0>h.ra.x&&(c=xs(a,h.ra.x,!1,c,k))):(h.ra.n(d+b,c+k/2-h.R.y-h.Ta.y),d=Math.max(d,Math.max(y,p)+b+s.width),m=c+k/2-h.R.y-h.Ta.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.ra.y&&(c=xs(a,h.ra.y,!0,c,k))));return new w(c,0,d,e)}
function es(a,b,c,d,e){u&&x.l(a,vr,Z,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new w(c,0,d,e);if(1===g){var h=b[0];d=h.rb.width;e=h.rb.height;return new w(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Zr(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.rb,t=0===n?0:l;if(m){var v=vs(h)-k,q=q-(t+s.height);h.ra.n(c-(s.width+v),q);d=Math.max(d,s.width+v);e=Math.max(e,Math.abs(q))}else v=vs(h)-k,p-=t+s.width,h.ra.n(p,c-(s.height+v)),e=Math.max(e,s.height+
v),d=Math.max(d,Math.abs(p));n++}var n=0,y=p,A=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.rb,t=0===n?0:l,m?(v=vs(h)-k,q-=t+s.height,h.ra.n(p+v,q),d=Math.max(d,p+s.width+v),e=Math.max(e,Math.abs(q))):(v=vs(h)-k,p-=t+s.width,h.ra.n(p,q+v),e=Math.max(e,q+s.height+v),d=Math.max(d,Math.abs(p))),n++);1<g&&1===g%2&&(h=b[g-1],s=h.rb,l=ws(h,m?Math.max(Math.abs(A),Math.abs(q)):Math.max(Math.abs(y),Math.abs(p))),m?(h.ra.n(c+k/2-h.R.x-h.Ta.x,-e-s.height-l),p=c+k/2-h.R.x-h.Ta.x,d=Math.max(d,
p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(A,q))+l+s.height),0>h.ra.x&&(c=xs(a,h.ra.x,!1,c,k))):(h.ra.n(-d-s.width-l,c+k/2-h.R.y-h.Ta.y),d=Math.max(d,Math.abs(Math.min(y,p))+l+s.width),p=c+k/2-h.R.y-h.Ta.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.ra.y&&(c=xs(a,h.ra.y,!0,c,k))));for(r=0;r<g;r++)h=b[r],m?h.ra.n(h.ra.x,h.ra.y+e):h.ra.n(h.ra.x+d,h.ra.y);return new w(c,0,d,e)}function vs(a){u&&x.l(a,vr,Z,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}
function ws(a){u&&x.l(a,vr,Z,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function xs(a,b,c,d,e){u&&x.l(a,vr,Z,"fixRelativePostions:v");a=a.children;for(var g=a.length,h=0;h<g;h++)c?a[h].ra.n(a[h].ra.x,a[h].ra.y-b):a[h].ra.n(a[h].ra.x-b,a[h].ra.y);b=a[g-1];return Math.max(d,c?b.Ta.y+b.R.y-e/2:b.Ta.x+b.R.x-e/2)}
function rs(a,b,c){u&&x.l(a,vr,Z,"calculateSubwidth:v");switch(a.alignment){case Pr:case qs:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case $r:return a.width>b?a.width:b;case as:return 2*a.R.x>b?a.width:b+a.width-2*a.R.x;case Rr:case Gr:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Sr:return a.width-a.R.x+a.nodeSpacing/2+b;case Tr:return Math.max(a.width,a.R.x+a.nodeSpacing/2+b);default:return b}}
function ss(a,b,c){u&&x.l(a,vr,Z,"calculateSubheight:v");switch(a.alignment){case Pr:case qs:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case $r:return a.height>b?a.height:b;case as:return 2*a.R.y>b?a.height:b+a.height-2*a.R.y;case Rr:case Gr:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Sr:return a.height-a.R.y+a.nodeSpacing/2+b;case Tr:return Math.max(a.height,a.R.y+a.nodeSpacing/2+b);default:return b}}
function ts(a,b,c){u&&x.l(a,Ca,Z,"alignOffset:align");switch(a){case qs:b/=2;c/=2;break;case Pr:b/=2;c/=2;break;case $r:c=b=0;break;case as:break;default:x.k("Unhandled alignment value "+a.toString())}return new N(b,c)}function ls(a,b,c,d,e,g){u&&x.l(a,vr,Z,"shiftRelPosAlign:v");u&&x.l(b,Ca,Z,"shiftRelPosAlign:align");b=ts(b,c,d);os(a,b.x,b.y,e,g)}function os(a,b,c,d,e){u&&x.l(a,vr,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].ra;g.x+=b;g.y+=c}}
function ms(a,b,c,d){u&&(x.l(b,vr,Z,"recordMidPoints:v"),x.g(c,"number",Z,"recordMidPoints:x"),x.g(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.Qf){case rr:for(a=b.tc;a.next();)b=a.value,b.fromVertex===e&&b.js.n(c,d);break;case yr:for(a=b.hc;a.next();)b=a.value,b.toVertex===e&&b.js.n(c,d);break;default:x.k("Unhandled path value "+a.Qf.toString())}}function ps(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
function ns(a,b,c,d,e,g,h,k){u&&x.l(b,vr,Z,"mergeFringes:parent");u&&x.l(c,vr,Z,"mergeFringes:child");var l=Zr(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=g;e=h;var q=c.Tt,r=c.nu;h=c.rb;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==Zr(c))q=ks(a,2),r=ks(a,2),m?(q[0].n(0,0),q[1].n(0,h.height),r[0].n(h.width,0),r[1].n(r[0].x,q[1].y)):(q[0].n(0,0),q[1].n(h.width,0),r[0].n(0,h.height),r[1].n(q[1].x,r[0].y));if(m){c=d;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=
l=0;l<p.length&&m<q.length;){e=p[l];var t=q[m];g=t.x;var v=t.y;g+=c;var y=e;l+1<p.length&&(y=p[l+1]);var A=t,t=A.x,A=A.y;m+1<q.length&&(A=q[m+1],t=A.x,A=A.y,t+=c);var B=d;e.y===v?B=g-e.x:e.y>v&&e.y<A?B=g+(e.y-v)/(A-v)*(t-g)-e.x:v>e.y&&v<y.y&&(B=g-(e.x+(v-e.y)/(y.y-e.y)*(y.x-e.x)));B<d&&(d=B);y.y<=e.y?l++:A<=v?m++:(y.y<=A&&l++,A<=y.y&&m++)}c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=ks(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].y<b[0].y;)v=l[g++],n[d++].n(v.x+
m,v.y);for(;e<b.length;)v=b[e++],n[d++].n(v.x,v.y);for(e=b[b.length-1].y;g<l.length&&l[g].y<=e;)g++;for(;g<l.length&&l[g].y>e;)v=l[g++],n[d++].n(v.x+m,v.y);l=ks(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);us(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=ks(a,p.length+g.length);for(m=y=l=0;l<p.length&&p[l].y<g[0].y;)e=p[l++],n[m++].n(e.x,e.y);for(;y<g.length;)e=g[y++],n[m++].n(e.x+v,e.y);for(g=g[g.length-1].y;l<p.length&&p[l].y<=g;)l++;for(;l<p.length&&p[l].y>g;)e=p[l++],
n[m++].n(e.x,e.y);e=ks(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);us(a,n)}g=Math.max(0,c)+h.width;h=s}else{c=e;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;)e=p[l],t=q[m],g=t.x,v=t.y,v+=c,y=e,l+1<p.length&&(y=p[l+1]),A=t,t=A.x,A=A.y,m+1<q.length&&(A=q[m+1],t=A.x,A=A.y,A+=c),B=d,e.x===g?B=v-e.y:e.x>g&&e.x<t?B=v+(e.x-g)/(t-g)*(A-v)-e.y:g>e.x&&g<y.x&&(B=v-(e.y+(g-e.x)/(y.x-e.x)*(y.y-e.y))),B<d&&(d=B),y.x<=e.x?l++:t<=g?m++:(y.x<=t&&l++,t<=y.x&&m++);c-=d;c+=n;
l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=ks(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].x<b[0].x;)v=l[g++],n[d++].n(v.x,v.y+m);for(;e<b.length;)v=b[e++],n[d++].n(v.x,v.y);for(e=b[b.length-1].x;g<l.length&&l[g].x<=e;)g++;for(;g<l.length&&l[g].x>e;)v=l[g++],n[d++].n(v.x,v.y+m);l=ks(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);us(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=ks(a,p.length+g.length);for(m=y=l=0;l<p.length&&p[l].x<g[0].x;)e=p[l++],
n[m++].n(e.x,e.y);for(;y<g.length;)e=g[y++],n[m++].n(e.x,e.y+v);for(g=g[g.length-1].x;l<p.length&&p[l].x<=g;)l++;for(;l<p.length&&p[l].x>g;)e=p[l++],n[m++].n(e.x,e.y);e=ks(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);us(a,n)}g=s;h=Math.max(0,c)+h.height}us(a,b);us(a,q);us(a,p);us(a,r);k[0]=d;k[1]=e;return new w(c,0,g,h)}function ks(a,b){var c=a.Jz[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new N;return c}
function us(a,b){var c=b.length,d=a.Jz[c];void 0===d&&(d=[],a.Jz[c]=d);d.push(b)}
Z.prototype.arrangeTrees=function(){if(this.rd===xr)for(var a=this.Hd.i;a.next();){var b=a.value;if(b instanceof vr){var c=b.Pc;if(null!==c){var d=c.position,c=d.x,d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);ys(this,b,c,d)}}}else{c=[];for(a=this.Hd.i;a.next();)b=a.value,b instanceof vr&&c.push(b);switch(this.sorting){case Lr:break;case Mr:c.reverse();break;case Nr:c.sort(this.comparer);break;case Or:c.sort(this.comparer);c.reverse();break;default:x.k("Unhandled sorting value "+this.sorting.toString())}b=
this.he;a=b.x;b=b.y;for(d=0;d<c.length;d++){var e=c[d];ys(this,e,a+e.Ta.x,b+e.Ta.y);switch(this.rd){case ur:b+=e.rb.height+this.lg.height;break;case zs:a+=e.rb.width+this.lg.width;break;default:x.k("Unhandled arrangement value "+this.rd.toString())}}}};function ys(a,b,c,d){if(null!==b){u&&x.l(b,vr,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];ys(a,h,c+h.ra.x,d+h.ra.y)}}}
Z.prototype.commitLayout=function(){this.hB();this.commitNodes();this.$z();this.Pt&&this.commitLinks()};Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
Z.prototype.$z=function(){if(this.BA===Dr){for(var a=this.OB,b=[],c=null,d=this.network.vertexes.i;d.next();){var e=d.value;null===c?c=e.Cb.copy():c.si(e.Cb);var g=b[e.level],g=void 0===g?bs(e):Math.max(g,bs(e));b[e.level]=g}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.cg(this.nodeSpacing/2,this.layerSpacing),e=new N(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.cg(this.layerSpacing,this.nodeSpacing/2),e=new N(-this.layerSpacing/2,-this.nodeSpacing/2));var g=
[],c=90===this.angle||270===this.angle?c.width:c.height,h=0;if(180===this.angle||270===this.angle)for(d=0;d<a.length;d++)h+=a[d]+b[d];for(d=0;d<a.length;d++){var k=a[d]+b[d];270===this.angle?(h-=k,g.push(new w(0,h,c,k))):90===this.angle?(g.push(new w(0,h,c,k)),h+=k):180===this.angle?(h-=k,g.push(new w(h,0,k,c))):(g.push(new w(h,0,k,c)),h+=k)}this.commitLayers(g,e)}};Z.prototype.commitLayers=function(){};Z.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
Z.prototype.hB=function(){for(var a=this.Hd.i;a.next();){var b=a.value;b instanceof vr&&As(this,b)}};function As(a,b){if(null!==b){u&&x.l(b,vr,Z,"setPortSpotsTree:v");a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)As(a,c[e])}}
Z.prototype.setPortSpots=function(a){u&&x.l(a,vr,Z,"setPortSpots:v");var b=a.alignment;if(Qr(b)){u&&x.l(a,vr,Z,"setPortSpotsBus:v");u&&x.l(b,Ca,Z,"setPortSpots:align");var c=this.Qf===rr,d=Zr(a),e;switch(d){case 0:e=Tc;break;case 90:e=bd;break;case 180:e=Sc;break;default:e=Rc}var g=a.children,h=g.length;switch(b){case Rr:case Gr:for(b=0;b<h;b++){var k=g[b],k=(c?k.tc:k.hc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?Sc:Rc;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=Sc;break;case 90:l=
Rc;break;case 180:l=Tc;break;default:l=bd}else 0===b%2&&(l=90===d||270===d?Tc:bd);c?(a.setsPortSpot&&(k.Gb=e),a.setsChildPortSpot&&(k.Hb=l)):(a.setsPortSpot&&(k.Gb=l),a.setsChildPortSpot&&(k.Hb=e))}}break;case Sr:l=90===d||270===d?Tc:bd;for(d=c?a.hc:a.tc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.Gb=e),a.setsChildPortSpot&&(k.Hb=l)):(a.setsPortSpot&&(k.Gb=l),a.setsChildPortSpot&&(k.Hb=e)));break;case Tr:for(l=90===d||270===d?Sc:Rc,d=c?a.hc:a.tc;d.next();)k=d.value.link,null!==k&&(c?
(a.setsPortSpot&&(k.Gb=e),a.setsChildPortSpot&&(k.Hb=l)):(a.setsPortSpot&&(k.Gb=l),a.setsChildPortSpot&&(k.Hb=e)))}}else if(c=Zr(a),this.Qf===rr)for(e=a.hc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.bd())switch(c){case 0:d.Gb=Tc;break;case 90:d.Gb=bd;break;case 180:d.Gb=Sc;break;default:d.Gb=Rc}else d.Gb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.bd())switch(c){case 0:d.Hb=Sc;break;case 90:d.Hb=Rc;break;case 180:d.Hb=Tc;break;default:d.Hb=bd}else d.Hb=a.childPortSpot}}else for(e=
a.tc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.bd())switch(c){case 0:d.Hb=Tc;break;case 90:d.Hb=bd;break;case 180:d.Hb=Sc;break;default:d.Hb=Rc}else d.Hb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.bd())switch(c){case 0:d.Gb=Sc;break;case 90:d.Gb=Rc;break;case 180:d.Gb=Tc;break;default:d.Gb=bd}else d.Gb=a.childPortSpot}};function Zr(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
function bs(a){u&&x.l(a,vr,Z,"computeLayerSpacing:v");var b=Zr(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 cs(a){u&&x.l(a,vr,Z,"computeNodeIndent:v");var b=Zr(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)}
x.defineProperty(Z,{hM:"roots"},function(){return this.Hd},function(a){this.Hd!==a&&(x.l(a,K,Z,"roots"),this.Hd=a,this.J())});x.defineProperty(Z,{path:"path"},function(){return this.cs},function(a){this.cs!==a&&(x.Ca(a,Z,Z,"path"),this.cs=a,this.J())});x.defineProperty(Z,{kK:"treeStyle"},function(){return this.Us},function(a){this.rd!==a&&(x.Ca(a,Z,Z,"treeStyle"),a===sr||a===Jr||a===Kr||a===Ir)&&(this.Us=a,this.J())});
x.defineProperty(Z,{BA:"layerStyle"},function(){return this.Kv},function(a){this.rd!==a&&(x.Ca(a,Z,Z,"layerStyle"),a===tr||a===Er||a===Dr)&&(this.Kv=a,this.J())});x.defineProperty(Z,{comments:"comments"},function(){return this.Mh},function(a){this.Mh!==a&&(x.g(a,"boolean",Z,"comments"),this.Mh=a,this.J())});x.defineProperty(Z,{Zf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(x.Ca(a,Z,Z,"arrangement"),a===ur||a===zs||a===xr)&&(this.rd=a,this.J())});
x.defineProperty(Z,{gE:"arrangementSpacing"},function(){return this.lg},function(a){x.l(a,Fa,Z,"arrangementSpacing");this.lg.O(a)||(this.lg.assign(a),this.J())});x.defineProperty(Z,{gM:"rootDefaults"},function(){return this.za},function(a){this.za!==a&&(x.l(a,vr,Z,"rootDefaults"),this.za=a,this.J())});x.defineProperty(Z,{AK:"alternateDefaults"},function(){return this.ya},function(a){this.ya!==a&&(x.l(a,vr,Z,"alternateDefaults"),this.ya=a,this.J())});
x.defineProperty(Z,{sorting:"sorting"},function(){return this.za.sorting},function(a){this.za.sorting!==a&&(x.Ca(a,Z,Z,"sorting"),a===Lr||a===Mr||a===Nr||Or)&&(this.za.sorting=a,this.J())});x.defineProperty(Z,{comparer:"comparer"},function(){return this.za.comparer},function(a){this.za.comparer!==a&&(x.g(a,"function",Z,"comparer"),this.za.comparer=a,this.J())});
x.defineProperty(Z,{angle:"angle"},function(){return this.za.angle},function(a){this.za.angle!==a&&(x.g(a,"number",Z,"angle"),0===a||90===a||180===a||270===a?(this.za.angle=a,this.J()):x.k("TreeLayout.angle must be 0, 90, 180, or 270"))});x.defineProperty(Z,{alignment:"alignment"},function(){return this.za.alignment},function(a){this.za.alignment!==a&&(x.Ca(a,Z,Z,"alignment"),this.za.alignment=a,this.J())});
x.defineProperty(Z,{nodeIndent:"nodeIndent"},function(){return this.za.nodeIndent},function(a){this.za.nodeIndent!==a&&(x.g(a,"number",Z,"nodeIndent"),0<=a&&(this.za.nodeIndent=a,this.J()))});x.defineProperty(Z,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.za.nodeIndentPastParent},function(a){this.za.nodeIndentPastParent!==a&&(x.g(a,"number",Z,"nodeIndentPastParent"),0<=a&&1>=a&&(this.za.nodeIndentPastParent=a,this.J()))});
x.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.za.nodeSpacing},function(a){this.za.nodeSpacing!==a&&(x.g(a,"number",Z,"nodeSpacing"),this.za.nodeSpacing=a,this.J())});x.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.za.layerSpacing},function(a){this.za.layerSpacing!==a&&(x.g(a,"number",Z,"layerSpacing"),this.za.layerSpacing=a,this.J())});
x.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.za.layerSpacingParentOverlap},function(a){this.za.layerSpacingParentOverlap!==a&&(x.g(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.za.layerSpacingParentOverlap=a,this.J()))});x.defineProperty(Z,{compaction:"compaction"},function(){return this.za.compaction},function(a){this.za.compaction!==a&&(x.Ca(a,Z,Z,"compaction"),a===Wr||a===Yr)&&(this.za.compaction=a,this.J())});
x.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.za.breadthLimit},function(a){this.za.breadthLimit!==a&&(x.g(a,"number",Z,"breadthLimit"),0<=a&&(this.za.breadthLimit=a,this.J()))});x.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.za.rowSpacing},function(a){this.za.rowSpacing!==a&&(x.g(a,"number",Z,"rowSpacing"),this.za.rowSpacing=a,this.J())});
x.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.za.rowIndent},function(a){this.za.rowIndent!==a&&(x.g(a,"number",Z,"rowIndent"),0<=a&&(this.za.rowIndent=a,this.J()))});x.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.za.commentSpacing},function(a){this.za.commentSpacing!==a&&(x.g(a,"number",Z,"commentSpacing"),this.za.commentSpacing=a,this.J())});
x.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.za.commentMargin},function(a){this.za.commentMargin!==a&&(x.g(a,"number",Z,"commentMargin"),this.za.commentMargin=a,this.J())});x.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.za.setsPortSpot},function(a){this.za.setsPortSpot!==a&&(x.g(a,"boolean",Z,"setsPortSpot"),this.za.setsPortSpot=a,this.J())});
x.defineProperty(Z,{portSpot:"portSpot"},function(){return this.za.portSpot},function(a){x.l(a,R,Z,"portSpot");this.za.portSpot.O(a)||(this.za.portSpot=a,this.J())});x.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.za.setsChildPortSpot},function(a){this.za.setsChildPortSpot!==a&&(x.g(a,"boolean",Z,"setsChildPortSpot"),this.za.setsChildPortSpot=a,this.J())});
x.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.za.childPortSpot},function(a){x.l(a,R,Z,"childPortSpot");this.za.childPortSpot.O(a)||(this.za.childPortSpot=a,this.J())});x.defineProperty(Z,{LK:"alternateSorting"},function(){return this.ya.sorting},function(a){this.ya.sorting!==a&&(x.Ca(a,Z,Z,"alternateSorting"),a===Lr||a===Mr||a===Nr||Or)&&(this.ya.sorting=a,this.J())});
x.defineProperty(Z,{zK:"alternateComparer"},function(){return this.ya.comparer},function(a){this.ya.comparer!==a&&(x.g(a,"function",Z,"alternateComparer"),this.ya.comparer=a,this.J())});x.defineProperty(Z,{tK:"alternateAngle"},function(){return this.ya.angle},function(a){this.ya.angle!==a&&(x.g(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.ya.angle=a,this.J())});
x.defineProperty(Z,{sK:"alternateAlignment"},function(){return this.ya.alignment},function(a){this.ya.alignment!==a&&(x.Ca(a,Z,Z,"alternateAlignment"),this.ya.alignment=a,this.J())});x.defineProperty(Z,{DK:"alternateNodeIndent"},function(){return this.ya.nodeIndent},function(a){this.ya.nodeIndent!==a&&(x.g(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.ya.nodeIndent=a,this.J()))});
x.defineProperty(Z,{EK:"alternateNodeIndentPastParent"},function(){return this.ya.nodeIndentPastParent},function(a){this.ya.nodeIndentPastParent!==a&&(x.g(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.ya.nodeIndentPastParent=a,this.J()))});x.defineProperty(Z,{FK:"alternateNodeSpacing"},function(){return this.ya.nodeSpacing},function(a){this.ya.nodeSpacing!==a&&(x.g(a,"number",Z,"alternateNodeSpacing"),this.ya.nodeSpacing=a,this.J())});
x.defineProperty(Z,{BK:"alternateLayerSpacing"},function(){return this.ya.layerSpacing},function(a){this.ya.layerSpacing!==a&&(x.g(a,"number",Z,"alternateLayerSpacing"),this.ya.layerSpacing=a,this.J())});x.defineProperty(Z,{CK:"alternateLayerSpacingParentOverlap"},function(){return this.ya.layerSpacingParentOverlap},function(a){this.ya.layerSpacingParentOverlap!==a&&(x.g(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.ya.layerSpacingParentOverlap=a,this.J()))});
x.defineProperty(Z,{yK:"alternateCompaction"},function(){return this.ya.compaction},function(a){this.ya.compaction!==a&&(x.Ca(a,Z,Z,"alternateCompaction"),a===Wr||a===Yr)&&(this.ya.compaction=a,this.J())});x.defineProperty(Z,{uK:"alternateBreadthLimit"},function(){return this.ya.breadthLimit},function(a){this.ya.breadthLimit!==a&&(x.g(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.ya.breadthLimit=a,this.J()))});
x.defineProperty(Z,{IK:"alternateRowSpacing"},function(){return this.ya.rowSpacing},function(a){this.ya.rowSpacing!==a&&(x.g(a,"number",Z,"alternateRowSpacing"),this.ya.rowSpacing=a,this.J())});x.defineProperty(Z,{HK:"alternateRowIndent"},function(){return this.ya.rowIndent},function(a){this.ya.rowIndent!==a&&(x.g(a,"number",Z,"alternateRowIndent"),0<=a&&(this.ya.rowIndent=a,this.J()))});
x.defineProperty(Z,{xK:"alternateCommentSpacing"},function(){return this.ya.commentSpacing},function(a){this.ya.commentSpacing!==a&&(x.g(a,"number",Z,"alternateCommentSpacing"),this.ya.commentSpacing=a,this.J())});x.defineProperty(Z,{wK:"alternateCommentMargin"},function(){return this.ya.commentMargin},function(a){this.ya.commentMargin!==a&&(x.g(a,"number",Z,"alternateCommentMargin"),this.ya.commentMargin=a,this.J())});
x.defineProperty(Z,{KK:"alternateSetsPortSpot"},function(){return this.ya.setsPortSpot},function(a){this.ya.setsPortSpot!==a&&(x.g(a,"boolean",Z,"alternateSetsPortSpot"),this.ya.setsPortSpot=a,this.J())});x.defineProperty(Z,{GK:"alternatePortSpot"},function(){return this.ya.portSpot},function(a){x.l(a,R,Z,"alternatePortSpot");this.ya.portSpot.O(a)||(this.ya.portSpot=a,this.J())});
x.defineProperty(Z,{JK:"alternateSetsChildPortSpot"},function(){return this.ya.setsChildPortSpot},function(a){this.ya.setsChildPortSpot!==a&&(x.g(a,"boolean",Z,"alternateSetsChildPortSpot"),this.ya.setsChildPortSpot=a,this.J())});x.defineProperty(Z,{vK:"alternateChildPortSpot"},function(){return this.ya.childPortSpot},function(a){x.l(a,R,Z,"alternateChildPortSpot");this.ya.childPortSpot.O(a)||(this.ya.childPortSpot=a,this.J())});var qr;Z.PathDefault=qr=x.s(Z,"PathDefault",-1);var rr;
Z.PathDestination=rr=x.s(Z,"PathDestination",0);var yr;Z.PathSource=yr=x.s(Z,"PathSource",1);var Lr;Z.SortingForwards=Lr=x.s(Z,"SortingForwards",10);var Mr;Z.SortingReverse=Mr=x.s(Z,"SortingReverse",11);var Nr;Z.SortingAscending=Nr=x.s(Z,"SortingAscending",12);var Or;Z.SortingDescending=Or=x.s(Z,"SortingDescending",13);var qs;Z.AlignmentCenterSubtrees=qs=x.s(Z,"AlignmentCenterSubtrees",20);var Pr;Z.AlignmentCenterChildren=Pr=x.s(Z,"AlignmentCenterChildren",21);var $r;
Z.AlignmentStart=$r=x.s(Z,"AlignmentStart",22);var as;Z.AlignmentEnd=as=x.s(Z,"AlignmentEnd",23);var Rr;Z.AlignmentBus=Rr=x.s(Z,"AlignmentBus",24);var Gr;Z.AlignmentBusBranching=Gr=x.s(Z,"AlignmentBusBranching",25);var Sr;Z.AlignmentTopLeftBus=Sr=x.s(Z,"AlignmentTopLeftBus",26);var Tr;Z.AlignmentBottomRightBus=Tr=x.s(Z,"AlignmentBottomRightBus",27);var Wr;Z.CompactionNone=Wr=x.s(Z,"CompactionNone",30);var Yr;Z.CompactionBlock=Yr=x.s(Z,"CompactionBlock",31);var sr;
Z.StyleLayered=sr=x.s(Z,"StyleLayered",40);var Kr;Z.StyleLastParents=Kr=x.s(Z,"StyleLastParents",41);var Jr;Z.StyleAlternating=Jr=x.s(Z,"StyleAlternating",42);var Ir;Z.StyleRootOnly=Ir=x.s(Z,"StyleRootOnly",43);var ur;Z.ArrangementVertical=ur=x.s(Z,"ArrangementVertical",50);var zs;Z.ArrangementHorizontal=zs=x.s(Z,"ArrangementHorizontal",51);var xr;Z.ArrangementFixedRoots=xr=x.s(Z,"ArrangementFixedRoots",52);var tr;Z.LayerIndividual=tr=x.s(Z,"LayerIndividual",60);var Er;
Z.LayerSiblings=Er=x.s(Z,"LayerSiblings",61);var Dr;Z.LayerUniform=Dr=x.s(Z,"LayerUniform",62);function wr(){xa.call(this)}x.Qa(wr,xa);x.ja("TreeNetwork",wr);wr.prototype.createVertex=function(){return new vr};wr.prototype.createEdge=function(){return new Bs};
function vr(){ya.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.ra=new N(0,0);this.rb=new Fa(0,0);this.Ta=new N(0,0);this.bq=this.aq=this.OJ=!1;this.nu=this.Tt=null;this.sorting=Lr;this.comparer=Bp;this.angle=0;this.alignment=Pr;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Yr;this.breadthLimit=
0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Jc;this.setsChildPortSpot=!0;this.childPortSpot=Jc}x.Qa(vr,ya);x.ja("TreeVertex",vr);
vr.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)};x.w(vr,{cn:"childrenCount"},function(){return this.children.length});x.defineProperty(vr,{fM:"relativePosition"},function(){return this.ra},function(a){this.ra.set(a)});x.defineProperty(vr,{rM:"subtreeSize"},function(){return this.rb},function(a){this.rb.set(a)});
x.defineProperty(vr,{qM:"subtreeOffset"},function(){return this.Ta},function(a){this.Ta.set(a)});function Bs(){Aa.call(this);this.js=new N(0,0)}x.Qa(Bs,Aa);x.ja("TreeEdge",Bs);
Bs.prototype.commit=function(){var a=this.link;if(null!==a&&!a.lj){var b=this.network.Tb,c=null,d=null;switch(b.Qf){case rr:c=this.fromVertex;d=this.toVertex;break;case yr:c=this.toVertex;d=this.fromVertex;break;default:x.k("Unhandled path value "+b.Qf.toString())}if(null!==c&&null!==d)if(b=this.js,0!==b.x||0!==b.y||c.OJ){var d=c.Cb,e=Zr(c),g=bs(c),h=c.rowSpacing;a.Hn();var k=a.Te===Bh,l=a.sc,m=0,n,p;a.am();if(l||k){for(m=2;4<a.ta;)a.LF(2);n=a.m(1);p=a.m(2)}else{for(m=1;3<a.ta;)a.LF(1);n=a.m(0);p=
a.m(a.ta-1)}var q=a.m(a.ta-1),r=0;0===e?(c.alignment===as?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-cs(c))))):c.alignment===$r?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+cs(c))))):r=c.aq||c.bq&&1===c.maxGenerationCount?d.top-c.Ta.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.right+g,r),m++,a.B(m,d.right+g+(b.x-h)/3,r),m++,a.B(m,d.right+g+2*(b.x-h)/3,r),m++,a.B(m,d.right+g+(b.x-h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.right+g/2,n.y),
m++),a.B(m,d.right+g/2,r),m++,a.B(m,d.right+g+b.x-(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):90===e?(c.alignment===as?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-cs(c))))):c.alignment===$r?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+cs(c))))):r=c.aq||c.bq&&1===c.maxGenerationCount?d.left-c.Ta.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,r,n.y),m++,a.B(m,r,d.bottom+g),m++,a.B(m,r,d.bottom+g+(b.y-h)/3),m++,a.B(m,r,d.bottom+g+2*(b.y-h)/3),m++,a.B(m,r,d.bottom+
g+(b.y-h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.bottom+g/2),m++),a.B(m,r,d.bottom+g/2),m++,a.B(m,r,d.bottom+g+b.y-(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):180===e?(c.alignment===as?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-cs(c))))):c.alignment===$r?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+cs(c))))):r=c.aq||c.bq&&1===c.maxGenerationCount?d.top-c.Ta.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.left-g,r),m++,a.B(m,d.left-g+(b.x+
h)/3,r),m++,a.B(m,d.left-g+2*(b.x+h)/3,r),m++,a.B(m,d.left-g+(b.x+h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.left-g/2,n.y),m++),a.B(m,d.left-g/2,r),m++,a.B(m,d.left-g+b.x+(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):270===e?(c.alignment===as?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-cs(c))))):c.alignment===$r?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+cs(c))))):r=c.aq||c.bq&&1===c.maxGenerationCount?d.left-c.Ta.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,
r,n.y),m++,a.B(m,r,d.top-g),m++,a.B(m,r,d.top-g+(b.y+h)/3),m++,a.B(m,r,d.top-g+2*(b.y+h)/3),m++,a.B(m,r,d.top-g+(b.y+h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.top-g/2),m++),a.B(m,r,d.top-g/2),m++,a.B(m,r,d.top-g+b.y+(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):x.k("Invalid angle "+e);a.fj()}else e=c,g=d,u&&x.l(e,vr,Bs,"adjustRouteForAngleChange:parent"),u&&x.l(g,vr,Bs,"adjustRouteForAngleChange:child"),a=this.link,c=Zr(e),c!==Zr(g)&&(b=bs(e),d=e.Cb,e=g.Cb,0===c&&e.left-d.right<b+1||90===c&&e.top-d.bottom<
b+1||180===c&&d.left-e.right<b+1||270===c&&d.top-e.bottom<b+1||(a.Hn(),e=a.Te===Bh,g=a.sc,h=Qr(this.fromVertex.alignment),a.am(),0===c?(c=d.right+b/2,e?4===a.ta&&(b=a.m(3).y,a.ca(1,c-20,a.m(1).y),a.B(2,c-20,b),a.B(3,c,b),a.B(4,c+20,b),a.ca(5,a.m(5).x,b)):g?h?a.ca(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ca(2,c,a.m(2).y),a.ca(3,c,a.m(3).y)):4===a.ta?a.B(2,c,a.m(2).y):3===a.ta?a.ca(1,c,a.m(2).y):2===a.ta&&a.B(1,c,a.m(1).y)):90===c?(b=d.bottom+b/2,e?4===a.ta&&(c=a.m(3).x,a.ca(1,a.m(1).x,b-20),a.B(2,c,b-20),
a.B(3,c,b),a.B(4,c,b+20),a.ca(5,c,a.m(5).y)):g?h?a.ca(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ca(2,a.m(2).x,b),a.ca(3,a.m(3).x,b)):4===a.ta?a.B(2,a.m(2).x,b):3===a.ta?a.ca(1,a.m(2).x,b):2===a.ta&&a.B(1,a.m(1).x,b)):180===c?(c=d.left-b/2,e?4===a.ta&&(b=a.m(3).y,a.ca(1,c+20,a.m(1).y),a.B(2,c+20,b),a.B(3,c,b),a.B(4,c-20,b),a.ca(5,a.m(5).x,b)):g?h?a.ca(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ca(2,c,a.m(2).y),a.ca(3,c,a.m(3).y)):4===a.ta?a.B(2,c,a.m(2).y):3===a.ta?a.ca(1,c,a.m(2).y):2===a.ta&&a.B(1,c,a.m(1).y)):270===
c&&(b=d.top-b/2,e?4===a.ta&&(c=a.m(3).x,a.ca(1,a.m(1).x,b+20),a.B(2,c,b+20),a.B(3,c,b),a.B(4,c,b-20),a.ca(5,c,a.m(5).y)):g?h?a.ca(3,a.m(2).x,a.m(4).y):6===a.ta&&(a.ca(2,a.m(2).x,b),a.ca(3,a.m(3).x,b)):4===a.ta?a.B(2,a.m(2).x,b):3===a.ta?a.ca(1,a.m(2).x,b):2===a.ta&&a.B(1,a.m(1).x,b)),a.fj()))}};x.defineProperty(Bs,{eM:"relativePoint"},function(){return this.js},function(a){this.js.set(a)});function tn(){O.call(this);this.$e=null}x.Qa(tn,O);
tn.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.$e.cloneNode(!0)};tn.prototype.toString=function(){return"HTMLHost("+this.$e.toString()+")#"+x.od(this)};
tn.prototype.rk=function(a,b){var c=this.$e;if(null!==c){var d=this.gb(dc);d.x-=this.ba.width/2;d.y-=this.ba.height/2;d.x-=this.ba.x;d.y-=this.ba.y;var d=b.rB(d),e=b.Il;null===e||e.contains(c)||e.appendChild(c);e=this.transform;c.style.transform="matrix("+e.m11+","+e.m12+","+e.m21+","+e.m22+","+e.dx+","+e.dy+")";c.style.transformOrigin="0 0";e=d.y;c.style.left=d.x+"px";c.style.top=e+"px"}};
tn.prototype.Np=function(a,b,c,d){var e=this.Ba;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.Ae,g=this.Kf;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);c=this.$e;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);vb(this.Wc,a,b);Hl(this,0,0,a,b)};tn.prototype.bj=function(a,b,c,d){Ll(this,a,b,c,d)};x.w(tn,{Ga:"naturalBounds"},function(){return this.Wc});
x.defineProperty(tn,{element:"element"},function(){return this.$e},function(a){var b=this.$e;b!==a&&(a instanceof HTMLElement||x.k("HTMLHost.element must be an instance of HTMLElement."),this.$e=a,a.className="HTMLHost",this.j("element",b,a),this.ua())});ca.version="1.6.2";
window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=ca:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=ca,window.define(ca)):window.go=ca);"undefined"!==typeof module&&"object"===typeof module.exports&&(module.exports=ca); })(window);
