text: !function(t){function i(t,i,e){xh.ec(this),this.yB=t,this.Qb=i,this.BG=e}function e(){this.wB=[]}function n(){}function o(t){void 0===t&&(t=42),this.seed=t,this.Rx=48271,this.uu=2147483647,this.gB=this.uu/this.Rx,this.aG=this.uu%this.Rx,this.WF=1/this.uu,this.random()}function r(){}function s(t){this.key=-1,this.value=t}function a(t,i){this.Lk=t,this.Mk=i,this.yu=!1}function h(t){this.tc=t,this.Lh=null,this.reset()}function l(t){this.tc=t,this.reset()}function u(t){xh.ec(this),this.D=!1,this.n=[],this.F=0,this.xj=this.Xb=null,void 0===t||null===t?this.ja=null:"string"==typeof t?"object"===t||"string"===t||"number"===t||"boolean"===t||"function"===t?this.ja=t:xh.wa(t,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"==typeof t?this.ja=t===Object?"object":t===String?"string":t===Number?"number":t===Boolean?"boolean":t===Function?"function":t:xh.wa(t,"null, a primitive type name, or a class type","List constructor: type")}function f(t){this.Nh=t,this.reset()}function c(t){xh.ec(this),this.D=!1,void 0===t||null===t?this.ja=null:"string"==typeof t?"object"===t||"string"===t||"number"===t?this.ja=t:xh.wa(t,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"==typeof t?this.ja=t===Object?"object":t===String?"string":t===Number?"number":t:xh.wa(t,"null, a primitive type name, or a class type","Set constructor: type"),this.kd={},this.jd=0,this.Xb=null,this.F=0,this.Ih=this.Ea=null}function p(t){this.Ha=t,this.reset()}function d(t){xh.ec(this),this.D=!0,this.Ha=t}function y(t){this.Ha=t,this.reset()}function v(t,i){this.key=t,this.value=i,this.to=this.Wa=null}function g(t){this.Ha=t,this.reset()}function m(t,i){xh.ec(this),this.D=!1,void 0===t||null===t?this.yi=null:"string"==typeof t?"object"===t||"string"===t||"number"===t?this.yi=t:xh.wa(t,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"==typeof t?this.yi=t===Object?"object":t===String?"string":t===Number?"number":t:xh.wa(t,"null, a primitive type name, or a class type","Map constructor: keytype"),void 0===i||null===i?this.Ps=null:"string"==typeof i?"object"===i||"string"===i||"boolean"===i||"number"===i||"function"===i?this.Ps=i:xh.wa(i,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"==typeof i?this.Ps=i===Object?"object":i===String?"string":i===Number?"number":i===Boolean?"boolean":i===Function?"function":i:xh.wa(i,"null, a primitive type name, or a class type","Map constructor: valtype"),this.kd={},this.jd=0,this.yj=this.Xb=null,this.F=0,this.Ih=this.Ea=null}function b(t,i){void 0===t?this.y=this.x=0:(this.x=t,this.y=i),this.D=!1}function x(t,i){if(0===t)return 0<i?90:0>i?270:0;if(0===i)return 0<t?0:180;if(isNaN(t)||isNaN(i))return 0;var e=180*Math.atan(Math.abs(i/t))/Math.PI;return 0>t?e=0>i?e+180:180-e:0>i&&(e=360-e),e}function w(t,i){return i.$h(t),t}function k(t,i){void 0===t?this.height=this.width=0:(this.width=t,this.height=i),this.D=!1}function M(t,i,e,n){void 0===t?this.height=this.width=this.y=this.x=0:t instanceof b?i instanceof b?(this.x=Math.min(t.x,i.x),this.y=Math.min(t.y,i.y),this.width=Math.abs(t.x-i.x),this.height=Math.abs(t.y-i.y)):i instanceof k?(this.x=t.x,this.y=t.y,this.width=i.width,this.height=i.height):xh.k("Incorrect arguments supplied to Rect constructor"):(this.x=t,this.y=i,this.width=e,this.height=n),this.D=!1}function P(t,i,e){t.width=i,t.height=e}function T(t,i,e,n,o){t.Eb();var r=t.width;return e+o<=-r?(t.x+=r/2,t.width=0):(t.x-=o,t.width+=e+o),e=t.height,i+n<=-e?(t.y+=e/2,t.height=0):(t.y-=i,t.height+=i+n),t}function S(t,i,e,n,o){t.Eb();var r=Math.max(t.x,i),s=Math.max(t.y,e);return i=Math.min(t.x+t.width,i+n),e=Math.min(t.y+t.height,e+o),t.x=r,t.y=s,t.width=Math.max(0,i-r),t.height=Math.max(0,e-s),t}function N(t,i){var e=t.width,n=i.width+10+10,o=t.x,r=i.x-10;return!(o>n+r||r>e+o)&&(e=t.height,n=i.height+10+10,o=t.y,r=i.y-10,!(o>n+r||r>e+o))}function C(t,i,e,n,o){var r=Math.min(t.x,i),s=Math.min(t.y,e);return i=Math.max(t.x+t.width,i+n),e=Math.max(t.y+t.height,e+o),t.x=r,t.y=s,t.width=i-r,t.height=e-s,t}function j(t,i,e,n){void 0===t?this.left=this.bottom=this.right=this.top=0:void 0===i?this.left=this.bottom=this.right=this.top=t:void 0===e?(n=i,this.top=t,this.right=i,this.bottom=t,this.left=n):void 0!==n?(this.top=t,this.right=i,this.bottom=e,this.left=n):xh.k("Invalid arguments to Margin constructor"),this.D=!1}function L(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}function D(t,i,e,n){void 0===t?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===i&&(i=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=i,this.offsetX=e,this.offsetY=n),this.D=!1}function A(t,i){return t.x=NaN,t.y=NaN,t.offsetX=i,t}function F(){this.hf=[1,0,0,1,0,0]}function z(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.OD=[]}function O(t,i,e){this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lx=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=i||document,this.fE=e,this.ix=null,this.path=[],this.Wi=new F,this.stack=[],this.tf=[],this.Nw=t,this.MI="http://www.w3.org/2000/svg",this.width=this.Nw.width,this.height=this.Nw.height,this.Nl=q(this,"svg",{width:this.width+"px",height:this.height+"px",JL:"0 0 "+this.Nw.width+" "+this.Nw.height}),this.Nl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Nl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),V(this,1,0,0,1,0,0),(i=q(this,"clipPath",{id:"mainClip"+(t=xh.Tl++)})).appendChild(q(this,"rect",{x:0,y:0,width:this.width,height:this.height})),this.Nl.appendChild(i),this.tf[0].setAttributeNS(null,"clip-path","url(#mainClip"+t+")")}function q(t,i,e,n){if(t=t.document.createElementNS(t.MI,i),xh.Va(e))for(var o in e)t.setAttributeNS("href"===o?"http://www.w3.org/1999/xlink":"",o,e[o]);return void 0!==n&&(t.textContent=n),t}function B(t,i,e,n,o){1!==t.globalAlpha&&(e.opacity=t.globalAlpha),"fill"===i?(/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",e["fill-opacity"]=t[4]):e.fill=t.fillStyle instanceof z?E(t,t.fillStyle):t.fillStyle,e.stroke="none"):"stroke"===i&&(e.fill="none",/^rgba\(/.test(t.strokeStyle)?(i=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle),e.stroke="rgb("+i[1]+","+i[2]+","+i[3]+")",e["stroke-opacity"]=i[4]):e.stroke=t.strokeStyle instanceof z?E(t,t.strokeStyle):t.strokeStyle,e["stroke-width"]=t.lineWidth,e["stroke-linecap"]=t.lineCap,e["stroke-linejoin"]=t.lineJoin,e["stroke-miterlimit"]=t.miterLimit),n="matrix("+(n=n.hf)[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+")",void 0!==o&&(n+=o),e.transform=n}function E(t,i){var e,n="GRAD"+xh.Tl++;if("linear"===i.type)e={x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2,id:n,gradientUnits:"userSpaceOnUse"},e=q(t,"linearGradient",e);else{if("radial"!==i.type)throw Error("invalid gradient");e=q(t,"radialGradient",e={x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2,r1:i.r1,r2:i.r2,id:n})}for(var o=i.OD,r=o.length,s=[],a=0;a<r;a++){var h=(l=o[a]).color,l={offset:l.offset,"stop-color":h};/^rgba\(/.test(h)&&(h=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(h),l["stop-color"]="rgb("+h[1]+","+h[2]+","+h[3]+")",l["stop-opacity"]=h[4]),s.push(l)}for(s.sort(function(t,i){return t.offset>i.offset?1:-1}),a=0;a<r;a++)e.appendChild(q(t,"stop",s[a]));return t.Nl.appendChild(e),"url(#"+n+")"}function I(t,i,e,n){B(t,i,e={x:e[0],y:e[1],width:e[2],height:e[3]},n),t.addElement("rect",e)}function R(t,i,e,n){for(var o=[],r=0;r<e.length;r++){var s=xh.il(e[r]),a=[s.shift()];if("A"===a[0])a.push(s.shift()+","+s.shift(),s.shift(),s.shift()+","+s.shift(),s.shift()+","+s.shift());else for(;s.length;)a.push(s.shift()+","+s.shift());o.push(a.join(" "))}B(t,i,e={d:o.join(" ")},n),"clipPath"===i?(i="CLIP"+xh.Tl++,(n=q(t,"clipPath",{id:i})).appendChild(q(t,"path",e)),t.Nl.appendChild(n),0<t.tf.length&&t.tf[t.tf.length-1].setAttributeNS(null,"clip-path","url(#"+i+")")):t.addElement("path",e)}function G(t,i,e,n,o,r,s){var a=Math.abs(o-r);if(o!==r){var h=i+n*Math.cos(r);r=e+n*Math.sin(r),a>=2*Math.PI?(G(t,i,e,n,o,o+Math.PI,s),G(t,i,e,n,o+Math.PI,o+2*Math.PI,s),t.path.push(["M",h,r])):(i+=n*Math.cos(o),e+=n*Math.sin(o),a=180*a/Math.PI,o=s?0:1,s=180<=a==!!s?0:1,0!==t.path.length?t.path.push(["L",i,e]):t.path.push(["M",i,e]),t.path.push(["A",n,n,a,s,o,h,r]))}}function V(t,i,e,n,o,r,s){var a=new F;a.hf=[i,e,n,o,r,s],B(t,"g",i={},a),a=t.addElement("g",i),t.tf.push(a)}function H(t,i){this.ownerDocument=void 0===i?document:i;var e=this.ownerDocument.createElement("canvas");e.tabIndex=0,this.Od=e,e.getContext&&e.getContext("2d")||xh.k("Browser does not support HTML Canvas Element"),this.dH=e.getContext("2d"),e.U=t,Object.seal(this)}function K(t){1<arguments.length&&xh.k("Geometry constructor can take at most one optional argument, the Geometry type."),xh.ec(this),this.D=!1,void 0===t&&(t=cl),this.ja=t,this.Db=this.yb=this.Cc=this.wc=0,this.nj=new u(Q),this.fv=this.nj.F,this.Qu=(new M).freeze(),this.ab=!0,this.Li=Lh,this.Mi=Eh,this.Yn=this.$n=NaN,this.qi=Lu}function U(t,i){if(t.type!==ll||i.type!==cl)return!1;if(1===i.Wb.count){var e=i.Wb.ha(0);if(1===e.vb.count&&hl.G(t.za,e.za)&&hl.G(t.xa,e.xa)&&(e=e.vb.ha(0)).type===vl&&hl.G(t.I,e.I)&&hl.G(t.J,e.J))return!0}return!1}function J(t,i){for(var e=t.length,n=xh.M(),o=0;o<e;o++){var r=t[o];n.x=r[0],n.y=r[1],i.xb(n),r[0]=n.x,r[1]=n.y,n.x=r[2],n.y=r[3],i.xb(n),r[2]=n.x,r[3]=n.y,n.x=r[4],n.y=r[5],i.xb(n),r[4]=n.x,r[5]=n.y,n.x=r[6],n.y=r[7],i.xb(n),r[6]=n.x,r[7]=n.y}xh.v(n)}function Y(t,i,e){switch(t.type){case ll:case ul:case fl:e?i.m(t.wc,t.Cc,0,0):C(i,t.wc,t.Cc,0,0),C(i,t.yb,t.Db,0,0);break;case cl:t=(n=t.Wb).n;for(var n=n.length,o=0;o<n;o++){var r=t[o];e&&0===o?i.m(r.za,r.xa,0,0):C(i,r.za,r.xa,0,0);for(var s=r.vb.n,a=s.length,h=r.za,l=r.xa,u=0;u<a;u++){switch((p=s[u]).type){case vl:case yl:C(i,h=p.I,l=p.J,0,0);break;case gl:hl.Ro(h,l,p.rc,p.Kc,p.nh,p.oh,p.I,p.J,.5,i),h=p.I,l=p.J;break;case ml:hl.uA(h,l,p.rc,p.Kc,p.I,p.J,.5,i),h=p.I,l=p.J;break;case bl:case xl:var f=p.type===bl?$(p,r):_(p,r,h,l),c=f.length;if(0===c){C(i,h=p.oa,l=p.va,0,0);break}for(var p=null,d=0;d<c;d++)p=f[d],hl.Ro(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],.5,i);null!==p&&(h=p[6],l=p[7]);break;default:xh.k("Unknown Segment type: "+p.type)}}}break;default:xh.k("Unknown Geometry type: "+t.type)}}function W(t,i,e,n,o,r,s,a){if(hl.Dd(o,r,s,a,.05,t,i))return NaN;var h=(t-e)*(r-a);if(0===h)return 0;var l=((t*n-i*e)*(o-s)-(t-e)*(o*a-r*s))/h;if(i=(t*n-i*e)*(r-a)/h,l>=t)return 0;if((o>s?o-s:s-o)<(r>a?r-a:a-r)){if(o=t=0,r<a?(t=r,o=a):(t=a,o=r),i<t||i>o)return 0}else if(o<s?(t=o,o=s):t=s,l<t||l>o)return 0;return 0<h?1:-1}function X(t,i,e,n){for(var o=(t=t.Wb.n).length,r=0;r<o;r++)if(t[r].Ga(i,e,n))return!0;return!1}function Q(t,i,e,n){xh.ec(this),this.D=!1,void 0===e&&(e=!0),this.cm=e,void 0===n&&(n=!0),this.ao=n,this.wc=void 0!==t?t:0,this.Cc=void 0!==i?i:0,this.xo=new u(Z),this.fw=this.xo.F,this.ab=!0}function Z(t,i,e,n,o,r,s,a){xh.ec(this),this.D=!1,void 0===t&&(t=vl),this.ja=t,this.yb=void 0!==i?i:0,this.Db=void 0!==e?e:0,void 0===n&&(n=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===s&&(s=0),t===xl?(0>(t=r%360)&&(t+=360),this.vd=t,this.Ie=0,this.Ug=Math.max(n,0),this.mg=Math.max(o,0),this.ho="boolean"==typeof s&&!!s,this.zn=!!a):(this.vd=n,this.Ie=o,t===bl&&(r=Math.max(r,0)),this.Ug=r,"number"==typeof s?(t===bl&&(s=Math.max(s,0)),this.mg=s):this.mg=0,this.zn=this.ho=!1),this.Hh=!1,this.ab=!0,this.cg=null}function $(t,i){if(null!==t.cg&&!1===i.ab)return t.cg;var e=t.radiusX,n=t.radiusY;if(void 0===n&&(n=e),0===e||0===n)return t.cg=[],t.cg;var o=t.vd,r=t.Ie,s=hl.XD(0,0,e<n?e:n,t.xe,t.xe+t.Bf,!1);if(e!==n){var a=xh.sh();a.reset(),e<n?a.scale(1,n/e):a.scale(e/n,1),J(s,a),xh.cf(a)}for(e=s.length,n=0;n<e;n++)a=s[n],a[0]+=o,a[1]+=r,a[2]+=o,a[3]+=r,a[4]+=o,a[5]+=r,a[6]+=o,a[7]+=r;return t.cg=s,t.cg}function _(t,i,e,n){function o(t,i,e,n){return(t*n<i*e?-1:1)*Math.acos(r(t,i,e,n))}function r(t,i,e,n){return(t*e+i*n)/(Math.sqrt(t*t+i*i)*Math.sqrt(e*e+n*n))}if(null!==t.cg&&!1===i.ab)return t.cg;i=t.Ug;var s=t.mg;if(0===i||0===s)return t.cg=[],t.cg;var a=Math.PI/180*t.vd,h=t.ho,l=t.zn,u=t.yb,f=t.Db,c=Math.cos(a),p=Math.sin(a),d=c*(e-u)/2+p*(n-f)/2,y=d*d/(i*i)+(a=-p*(e-u)/2+c*(n-f)/2)*a/(s*s);return 1<y&&(i*=Math.sqrt(y),s*=Math.sqrt(y)),y=(h===l?-1:1)*Math.sqrt((i*i*s*s-i*i*a*a-s*s*d*d)/(i*i*a*a+s*s*d*d)),isNaN(y)&&(y=0),h=y*i*a/s,y=y*-s*d/i,isNaN(h)&&(h=0),isNaN(y)&&(y=0),e=(e+u)/2+c*h-p*y,n=(n+f)/2+p*h+c*y,f=o(1,0,(d-h)/i,(a-y)/s),c=(d-h)/i,u=(a-y)/s,d=(-d-h)/i,h=(-a-y)/s,a=o(c,u,d,h),-1>=(d=r(c,u,d,h))?a=Math.PI:1<=d&&(a=0),!l&&0<a&&(a-=2*Math.PI),l&&0>a&&(a+=2*Math.PI),l=i>s?1:i/s,d=i>s?s/i:1,i=hl.XD(0,0,i>s?i:s,f,f+a,!0),(s=xh.sh()).reset(),s.translate(e,n),s.rotate(t.vd,0,0),s.scale(l,d),J(i,s),xh.cf(s),t.cg=i,t.cg}function tt(){this.U=null,this.pz=new b(0,0).freeze(),this.xy=new b(0,0).freeze(),this.Mu=this.Jv=0,this.Nu=1,this.yv="",this.qw=this.cv=!1,this.Zu=this.Pu=0,this.jj=this.kv=this.uv=!1,this.Qq=null,this.ow=0,this.ng=this.nw=null}function it(){this.U=null,this.Qb="",this.Sv=this.kw=null,this.Ou=!1}function et(){this.mq=kl,this.vm=this.Iv="",this.Nr=this.Pr=this.Sr=this.Tr=this.Rr=this.U=this.Vd=null}function nt(t){1<arguments.length&&xh.k("Model constructor can only take one optional argument, the Array of node data."),xh.ec(this),this.Cq=this.Qb="",this.wi=!1,this.Wy={},this.Jf=[],this.uc=new m(null,Object),this.Gj="key",this.Dn=this.lo=null,this.tq=this.Su=!1,this.dq=null,this.qm="category",this.ri=new m(null,c),this.Aj=null,this.Ki=!1,this.oz=null,this.ma=new Ct,void 0!==t&&(this.Yf=t)}function ot(t){return',\n  "modelData": '+ft(t,t.gk)}function rt(t,i){var e=i.modelData;xh.Va(e)&&(t.au(e),t.gk=e)}function st(t,i,e,n){if(i===e)return!0;if(typeof i!=typeof e||"function"==typeof i||"function"==typeof e)return!1;if(Array.isArray(i)&&Array.isArray(e)){if(n.ka(i)===e)return!0;if(n.add(i,e),i.length!==e.length)return!1;for(var o=0;o<i.length;o++)if(!st(t,i[o],e[o],n))return!1;return!0}if(xh.Va(i)&&xh.Va(e)){if(n.ka(i)===e)return!0;n.add(i,e);for(o in i){var r=i[o];if(!lt(o,r)){var s=e[o];if(void 0===s||!st(t,r,s,n))return!1}}for(var a in e)if(s=e[a],!(lt(a,s)||void 0!==(r=i[a])&&st(t,r,s,n)))return!1;return!0}return!1}function at(t,i,e){t[e]!==i[e]&&xh.k("Model.computeJsonDifference: Model."+e+' is not the same in both models: "'+t[e]+'" and "'+i[e]+'"')}function ht(t,i,n){void 0===n&&(n=!1);var o=xh.Xa(i);if(0>=o)return"[]";var r=new e;r.add("[ "),n&&1<o&&r.add("\n");for(var s=0;s<o;s++){var a=xh.Pa(i,s);void 0!==a&&(0<s&&(r.add(","),n&&r.add("\n")),r.add(t.tu(a)))}return n&&1<o&&r.add("\n"),r.add(" ]"),r.toString()}function lt(t,i){return void 0===i||"__gohashid"===t||"_"===t[0]||"function"==typeof i}function ut(t){return isNaN(t)?"NaN":1/0===t?"9e9999":-1/0===t?"-9e9999":t}function ft(t,e){var n=e;if(n instanceof b){var o=n;e={class:"go.Point",x:ut(o.x),y:ut(o.y)}}else if(n instanceof k){var r=n;e={class:"go.Size",width:ut(r.width),height:ut(r.height)}}else if(n instanceof M)e={class:"go.Rect",x:ut(n.x),y:ut(n.y),width:ut(n.width),height:ut(n.height)};else if(n instanceof j)e={class:"go.Margin",top:ut(n.top),right:ut(n.right),bottom:ut(n.bottom),left:ut(n.left)};else if(n instanceof D)r=n,e=r.ed()?{class:"go.Spot",x:ut(r.x),y:ut(r.y),offsetX:ut(r.offsetX),offsetY:ut(r.offsetY)}:{class:"go.Spot",enum:r.toString()};else if(n instanceof kn){if(e={class:"go.Brush",type:n.type.name},n.type===xu?e.color=n.color:n.type!==wu&&n.type!==ku||(e.start=n.start,e.end=n.end,n.type===ku&&(0!==n.nu&&(e.startRadius=ut(n.nu)),isNaN(n.lt)||(e.endRadius=ut(n.lt)))),null!==n.ht){for(var s={},a=n.ht.i;a.next();)s[a.key]=a.value;e.colorStops=s}}else if(n instanceof K)e={class:"go.Geometry",type:n.type.name},0!==n.za&&(e.startX=ut(n.za)),0!==n.xa&&(e.startY=ut(n.xa)),0!==n.I&&(e.endX=ut(n.I)),0!==n.J&&(e.endY=ut(n.J)),n.B.L(Lh)||(e.spot1=n.B),n.C.L(Eh)||(e.spot2=n.C),n.type===cl&&(e.path=pl(n));else if(n instanceof i)e={class:"go.EnumValue",classType:xh.df(n.qe),name:n.name};else if(n instanceof Mn||n instanceof Qi||n instanceof Yi||n instanceof nt||n instanceof zt||n instanceof Lt||n instanceof ks||n instanceof Ps||n instanceof Ct||n instanceof Nt)return xh.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+n.toString()),"{}";s="{",n=!0;for(o in e)if(r=xh.sb(e,o),!lt(o,r))if(n?n=!1:s+=", ",s+='"'+o+'":',"points"===o&&r instanceof u&&r.ja===b){for(a=r,r="[",a=a.i;a.next();){var h=a.value;1<r.length&&(r+=","),r+=t.tu(h.x),r+=",",r+=t.tu(h.y)}s+=r+="]"}else s+=t.tu(r);return s+"}"}function ct(t){return"number"==typeof t?t:"NaN"===t?NaN:"9e9999"===t?1/0:"-9e9999"===t?-1/0:parseFloat(t)}function pt(t,i,e,n,o,r,s,a,h){void 0===a&&(a=null),void 0===h&&(h=null);var l=new et;l.Z=t,l.xc=e,l.kf=i,l.propertyName=n,l.object=o,l.oldValue=r,l.Bg=a,l.newValue=s,l.zg=h,t.Fw(l)}function dt(t,i,e){"string"!=typeof t&&"function"!=typeof t&&xh.Ed(t,"string or function",i,e)}function yt(t){return"number"==typeof t||"string"==typeof t}function vt(t,i,e){var n=t.ib(i);if(void 0===n||t.uc.ka(n)!==i)if(t.gA(i),void 0===(n=t.ib(i)))xh.k("Model.makeNodeDataKeyUnique failed on "+i+".  Data not added to Model.");else{if(t.uc.add(n,i),e){var o=xh.Xa(t.Jf);xh.Si(t.Jf,o,i)}pt(t,"nodeDataArray",Ml,"nodeDataArray",t,null,i,null,o),t.Hp(i),t.Gp(i)}}function gt(t,i,e){if(void 0!==i){var n=t.ri.ka(i);null===n&&(n=new c(Object),t.ri.add(i,n)),n.add(e)}}function mt(t,i,e){if(void 0!==i){var n=t.ri.ka(i);n instanceof c&&(void 0===e||null===e?t.ri.remove(i):(n.remove(e),0===n.count&&t.ri.remove(i)))}}function bt(t,i){if(void 0===i)return null;var e=t.ri.ka(i);return e instanceof c?e:null}function xt(t,i,e){if(t.Gz&&Array.isArray(i)){var n=[];for(e=0;e<i.length;e++){o=xt(t,i[e],t.Fz);n.push(o)}return xh.ec(n),n}if(e&&xh.Va(i)){e=(e=i.constructor)?new e:{};for(n in i)if("__gohashid"!==n){var o,r;(r=o=xh.sb(i,n))instanceof Mn||r instanceof Qi||r instanceof Yi||r instanceof Mo||r instanceof Fi||r instanceof zt||r instanceof Lt||r instanceof ks||r instanceof tt||r instanceof it?("_"!==n[0]&&xh.trace('Warning: found GraphObject or Diagram reference when copying model data on property "'+n+'" of data object: '+i.toString()+"  \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+r.toString()),r=!0):r=r instanceof nt||r instanceof Ct||r instanceof Nt||r instanceof et,r||(o=xt(t,o,!1)),xh.Ka(e,n,o)}return xh.ec(e),e}return i instanceof b?i.copy():i instanceof k?i.copy():i instanceof M?i.copy():i instanceof D?i.copy():i instanceof j?i.copy():i}function wt(t,i){2<arguments.length&&xh.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data."),nt.call(this),this.Hf=[],this.jo=new c(Object),this.Yc=new m(null,Object),this.Pk="",this.Vl=this.Cn=this.mo=null,this.Jh="from",this.Kh="to",this.nm=this.mm="",this.lm="category",this.ig="",this.qo="isGroup",this.Rg="group",this.uq=!1,void 0!==t&&(this.Yf=t),void 0!==i&&(this.yg=i)}function kt(t,i,e){if(""!==t.cj){var n=t.ef(i);if(void 0!==n&&t.Yc.ka(n)===i)return;if(t.fA(i),void 0===(n=t.ef(i)))return void xh.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+i+". Data not added to model.");t.Yc.add(n,i)}if(t.jo.add(i),e){var o=xh.Xa(t.Hf);xh.Si(t.Hf,o,i)}pt(t,"linkDataArray",Ml,"linkDataArray",t,null,i,null,o),Mt(t,i)}function Mt(t,i){var e=t.vl(i),e=t.en(e);null===t.$d(e)&&gt(t,e,i),e=t.yl(i),e=t.en(e),null===t.$d(e)&&gt(t,e,i);var n=t.dk(i);if(xh.isArray(n))for(var o=xh.Xa(n),r=0;r<o;r++)e=xh.Pa(n,r),null===t.$d(e)&&gt(t,e,i)}function Pt(t){1<arguments.length&&xh.k("TreeModel constructor can only take one optional argument, the Array of node data."),nt.call(this),this.Sg="parent",this.vq=!1,this.sm="parentLinkCategory",void 0!==t&&(this.Yf=t)}function Tt(t,i,e){xh.ec(this),this.D=!1,void 0===t?t="":xh.j(t,"string",Tt,"constructor:targetprop"),void 0===i?i=t:xh.j(i,"string",Tt,"constructor:sourceprop"),void 0===e?e=null:null!==e&&xh.j(e,"function",Tt,"constructor:conv"),this.cD=-1,this.ng=null,this.Jo=t,this.Io=this.Hs=0,this.hw=null,this.ir=!1,this.zo=i,this.sq=e,this.Fr=Sl,this.lq=null}function St(t,i,e){return null===(t=t.mn)||""===t?i:"."===t?e:".."===t?e.T:i.ae(t)}function Nt(){this.fG=new u(et).freeze(),this.Qb="",this.jC=!1}function Ct(){this.Xy=new c(nt),this.Ue=!1,this.jG=new u(Nt).freeze(),this.Lg=-1,this.yC=999,this.xi=!1,this.Yu=null,this.al=0,this.xB=!1,this.Qg=new u("string").freeze(),this.po=new u("number"),this.Fy=!0,this.Ry=!1}function jt(t,i,e){if(t.kb)return!1;t.Bz&&1>t.uh&&xh.trace("Ending transaction without having started a transaction: "+e);var n=1===t.uh;n&&i&&t.isEnabled&&t.$c("CommittingTransaction",e,t.Vi);var o=0;if(0<t.uh&&(t.al--,t.isEnabled)){var r=t.Qg.count;0<r&&(""===e&&(e=t.Qg.ha(0)),t.Qg.Oa(),t.Qg.Vc(r-1),t.Qg.freeze()),0<(r=t.po.count)&&(o=t.po.ha(r-1),t.po.Vc(r-1))}if(r=t.Vi,n){if(i){if(t.Ry=!1,t.isEnabled&&null!==r){for((i=r).Dt=!0,i.name=e,(n=t.history).Oa(),o=n.count-1;o>t.Zi;o--)null!==(r=n.ha(o))&&r.clear(),n.Vc(o),t.Ry=!0;0===(o=t.RE)&&(o=1),0<o&&n.count>=o&&(null!==(r=n.ha(0))&&r.clear(),n.Vc(0),t.Lg--),n.add(i),t.Lg++,n.freeze(),r=i}t.$c("CommittedTransaction",e,r)}else{t.xi=!0;try{t.isEnabled&&null!==r&&(r.Dt=!0,r.undo())}finally{t.$c("RolledBackTransaction",e,r),t.xi=!1}null!==r&&r.clear()}return t.Yu=null,!0}if(t.isEnabled&&!i&&null!==r){for(t=o,i=(e=r.Of).count-1;i>=t;i--)null!==(n=e.ha(i))&&n.undo(),e.Oa(),e.Vc(i);e.freeze()}return!1}function Lt(){0<arguments.length&&xh.fd(Lt),xh.ec(this),this.U=null,this.AB=!1,this.RB=this.BB=!0,this.DB=this.EB=this.SB=this.FB=!1,this.Tk=this.qB=null,this.vD=1.05,this.PB=1,this.Sy=NaN,this.vC=null,this.sz=NaN,this.rz=hl.Yx,this.Jj=null}function Dt(t,i,e,n,o,r){if(void 0===r&&(r=null),!(t.contains(i)||null!==r&&!r(i)||i instanceof xr))if(t.add(i),i instanceof wr){if(e&&i instanceof vs)for(var s=i.Ic;s.next();)Dt(t,s.value,e,n,o,r);if(o)for(s=i.ue;s.next();){var a=s.value;if(!t.contains(a)){var h=a.V,l=a.ba;null!==h&&t.contains(h)&&null!==l&&t.contains(l)?Dt(t,a,e,n,o,r):null!==h&&null!==l||Dt(t,a,e,n,o,r)}}if(1<n)for(i=i.lE();i.next();)Dt(t,i.value,e,n-1,o,r)}else if(i instanceof zr)for(s=i.Sf;s.next();)Dt(t,s.value,e,n,o,r)}function At(t,i,e,n,o){if(null===i||o&&!i.canCopy())return null;if(n.contains(i))return n.ka(i);var r=null,s=i.data;if(null!==s&&null!==e){var a=e.Z;i instanceof zr?a instanceof wt&&(s=a.Jw(s),xh.Va(s)&&(a.Ws(s),r=e.sf(s))):(s=a.copyNodeData(s),xh.Va(s)&&(a.cl(s),r=e.ug(s)))}else bo(i),null!==(r=i.copy())&&(null!==e?e.add(r):null!==s&&t.fH&&(a=t.g.Z,s=r instanceof zr&&a instanceof wt?a.Jw(s):a.copyNodeData(s),xh.Va(s)&&(r.data=s)));if(!(r instanceof tr))return null;if(r.jb=!1,r.dh=!1,n.add(i,r),i instanceof wr){for(s=i.ue;s.next();){if((a=s.value).V===i){var h=n.ka(a);null!==h&&(h.V=r)}a.ba===i&&null!==(h=n.ka(a))&&(h.ba=r)}if(i instanceof vs&&r instanceof vs)for(s=r,i=i.Ic;i.next();)(a=At(t,i.value,e,n,o))instanceof zr||null===a||(a.Ta=s)}else if(i instanceof zr)for(null!==(s=i.V)&&null!==(s=n.ka(s))&&(r.V=s),null!==(s=i.ba)&&null!==(s=n.ka(s))&&(r.ba=s),i=i.Sf;i.next();)null!==(s=At(t,i.value,e,n,o))&&(s.fe=r);return r}function Ft(t){var i=xh.lb();for(t=t.i;t.next();){(e=t.value)instanceof zr||i.push(e)}t=new c(tr);for(var e=i.length,n=0;n<e;n++){for(var o=i[n],r=!0,s=0;s<e;s++)if(o.ai(i[s])){r=!1;break}r&&t.add(o)}return xh.ta(i),t}function zt(){0<arguments.length&&xh.fd(zt),xh.ec(this),this.U=null,this.Qb="",this.Ue=!0,this.hC=!1,this.rD=null,this.tw=-1}function Ot(t,i,e){i.zc=!1;var n=0;i.left?n=1===i.Ze?1:2===i.Ze?2:1:i.right&&1===i.Ze&&(n=3);var o="";if(null!==t){switch(n){case 1:o="ObjectSingleClicked";break;case 2:o="ObjectDoubleClicked";break;case 3:o="ObjectContextClicked"}0!==n&&e.Ba(o,t)}else{switch(n){case 1:o="BackgroundSingleClicked";break;case 2:o="BackgroundDoubleClicked";break;case 3:o="BackgroundContextClicked"}0!==n&&e.Ba(o)}if(null!==t)for(;null!==t;){switch(e=null,n){case 1:e=t.click;break;case 2:e=t.kt?t.kt:t.click;break;case 3:e=t.Dz}if(null!==e&&(e(i,t),i.zc))break;t=t.T}else{switch(t=null,n){case 1:t=e.click;break;case 2:t=e.kt?e.kt:e.click;break;case 3:t=e.Dz}null!==t&&t(i)}}function qt(){0<arguments.length&&xh.fd(qt),zt.call(this),this.name="Dragging",this.CB=this.lC=!0,this.cr=this.YB=!1,this.pC=!0,this.Hy=new k(NaN,NaN).freeze(),this.Iy=Lh,this.Jy=new b(NaN,NaN).freeze(),this.XB=!1,this.VB=this.zB=this.WB=this.JB=this.Ii=null,this.Mq=this.nC=!1,this.Co=new b(NaN,NaN),this.iw=new b,this.lw=!1,this.kC=!0,this.Nn=100,this.mj=[],this.iG=new c(tr).freeze()}function Bt(t,i){if(t.Xi){var e=t.g;null!==e&&e.Im&&(e.Z instanceof wt&&1===i.count&&i.first()instanceof zr?(t.ad=i.first(),t.ad.canRelinkFrom()&&t.ad.canRelinkTo()&&t.ad.et(),t.Ii=e.cb.aF,null===t.Ii&&(t.Ii=new pi,t.Ii.Mc(e))):(t.ad=null,t.Ii=null))}}function Et(t){return new ri(void 0===t?hl.mk:t.copy())}function It(t,i,e,n){if(!i.contains(e)&&(!n||e.canMove()||e.canCopy()))if(e instanceof wr){if(i.add(e,Et(e.location)),e instanceof vs)for(var o=e.Ic;o.next();)It(t,i,o.value,n);for(o=e.ue;o.next();){var r=o.value;if(!i.contains(r)){var s=r.V,a=r.ba;null!==s&&i.contains(s)&&null!==a&&i.contains(a)&&It(t,i,r,n)}}if(t.xH)for(e=e.lE();e.next();)It(t,i,e.value,n)}else if(e instanceof zr)for(r=e,i.add(r,Et()),o=r.Sf;o.next();)It(t,i,o.value,n);else e instanceof xr||i.add(e,Et(e.location))}function Rt(t){var i=t.g;if(null!==i){var e=i.wb;i.wb=!0,_t(t,i.P,null),i.wb=e}t.mj.length=0}function Gt(){var t=Al;Jt(t),Qt(t);var i=t.g;null!==i&&t.Co.K()&&(i.position=t.Co),null!==i&&cn(i)}function Vt(t,i){if(null!==i){t.lw=!0;for(var e=i.i;e.next();){var n=e.key;n instanceof zr&&(n.Sp=!0)}}}function Ht(t,i){if(null!==i){for(var e=i.i;e.next();){var n=e.key;n instanceof zr&&(n.Sp=!1,n.Al&&function(t){if(!t.Al)return!1;var i=t.points.n,e=i.length;if(4>e)return!1;t=an(t.g,!0,t.Ta,null);for(var n=1;n<e-2;n++){var o=i[n],r=i[n+1];if(!t.pp(Math.min(o.x,r.x),Math.min(o.y,r.y),Math.abs(o.x-r.x),Math.abs(o.y-r.y)))return!0}return!1}(n)&&n.jc())}t.lw=!1}}function Kt(t,i){for(var e=1/0,n=1/0,o=-1/0,r=-1/0,s=t.i;s.next();){if((a=s.value).Pd()&&a.isVisible()){var a=(h=a.location).x,h=h.y;isNaN(a)||isNaN(h)||(a<e&&(e=a),h<n&&(n=h),a>o&&(o=a),h>r&&(r=h))}}1/0===e?i.m(0,0,0,0):i.m(e,n,o-e,r-n)}function Ut(t,i){if(null===t.hc){if(!(null===(n=t.g)||i&&(n.bb||n.wf))&&null!==t.ac){var e=n.ma;for(e.isEnabled&&e.GE?null!==e.Vi&&0<e.Vi.Of.count&&(n.ma.Ip(),n.Sb("Drag")):Qt(t),n.wb=!i,n.bq=!i,t.jk=n.yc.da,e=t.hH?t.ac.fj():n.selection,n=(e=n.Xo(e,n,!0)).i;n.next();)n.value.location=n.key.location;Kt(e,n=xh.ag()),xh.ic(n);for(var n=new m(tr),o=t.ac.i;o.next();){var r=o.key;r.Pd()&&r.canCopy()&&null!==(r=e.ka(r))&&(r.rf(),n.add(r,Et(r.location)))}for(e=e.i;e.next();)(o=e.value)instanceof zr&&o.canCopy()&&n.add(o,Et());t.hc=n,Bt(t,n.fj()),null!==t.ad&&(n=t.ad,e=n.ln,n.Gl(t.jk.x-(e.x+e.width/2),t.jk.y-(e.y+e.height/2)))}}}function Jt(t){var i=t.g;if(null!==i){if(null!==t.hc&&(i.DA(t.hc.fj(),!1),t.hc=null,null!==t.ac))for(var e=t.ac.i;e.next();)e.key instanceof zr&&(e.value.point=new b(0,0));i.wb=!1,i.bq=!1,t.jk=i.yc.da}}function Yt(t){if(null!==t.ad){if(t.Xi&&null!==t.Ii){var i=t.Ii;i.g.remove(i.ze),i.g.remove(i.Ae)}t.ad=null,t.Ii=null}}function Wt(t,i,e){var n=t.g;if(null!==n){var o=t.jk,r=xh.M();r.assign(n.P.da),t.moveParts(i,r.ou(o),e),xh.v(r)}}function Xt(t,i,e){if(null!==(i=i.Ta)){if(null!==(t=Xt(t,i,e)))return t;if(null!==(t=e.ka(i)))return t}return null}function Qt(t){if(null!==t.ac){for(var i=t.g,e=t.ac.i;e.next();){var n=e.key;n.Pd()&&(n.location=e.value.point)}for(e=t.ac.i;e.next();)if((n=e.key)instanceof zr&&n.Sp){var o=e.value.point;t.ac.add(n,Et()),n.Gl(-o.x,-o.y)}i.Uf()}}function Zt(t,i){if(null===i)return!0;var e=i.aa;return!!(null===e||e instanceof xr||e.layer.Gc||t.ac&&t.ac.contains(e)||t.hc&&t.hc.contains(e))}function $t(t,i,e,n){var o=t.g;if(null!==o){t.Xi&&(null!==t.ad&&(t.ad.V=null,t.ad.ba=null),ei(t,!1));var r=ae(o,i,null,function(i){return!Zt(t,i)}),s=o.P;s.ye=r;var a=o.wb,h=!1;try{if(o.wb=!0,h=_t(t,s,r),!t.ra&&null===Al)return;if(null===r){var l=o.II;null!==l&&(l(s),h=!0)}if(!t.ra&&null===Al)return;if(t.doDragOver(i,r),!t.ra&&null===Al)return}finally{o.wb=a,h&&o.Uf()}(o.ne||o.oe)&&(e||n)&&un(o,s.lf)}}function _t(t,i,e){var n=!1,o=t.mj.length,r=0<o?t.mj[0]:null;if(e===r)return!1;i.zc=!1;for(var s=0;s<o;s++){var a=t.mj[s],h=a.HI;if(null!==h&&(h(i,a,e),n=!0,i.zc))break}if(t.mj.length=0,!t.ra&&null===Al||null===e)return n;for(i.zc=!1;null!==e;)t.mj.push(e),e=ti(e);for(o=t.mj.length,s=0;s<o&&(a=t.mj[s],null===(h=a.GI)||(h(i,a,r),n=!0,!i.zc));s++);return n}function ti(t){var i=t.T;return null!==i?i:t instanceof tr&&!(t instanceof vs)&&null!==(t=t.Ta)&&t.SH?t:null}function ii(t,i,e){var n=t.Ii;if(null===n)return null;s=t.g.Vm(i,n.ZE,function(t){return n.findValidLinkablePort(t,e)});t=xh.M();for(var o=1/0,r=null,s=s.i;s.next();){var a=s.value;if(null!==a.aa){var h=a.Za(zh,t);(h=i.$j(h))<o&&(r=a,o=h)}}return xh.v(t),r}function ei(t,i){var e=t.ad;if(null!==e&&!(2>e.pa)){var n=t.g;if(null!==n&&!n.bb&&null!==(n=t.Ii)){var o=null,r=null;null===e.V&&null!==(o=ii(t,e.l(0),!1))&&(r=o.aa);var s=null,a=null;null===e.ba&&null!==(s=ii(t,e.l(e.pa-1),!0))&&(a=s.aa),n.isValidLink(r,o,a,s)?i?(e.Hn=e.l(0).copy(),e.Ln=e.l(e.pa-1).copy(),e.Sp=!1,e.V=r,null!==o&&(e.vg=o.Sd),e.ba=a,null!==s&&(e.th=s.Sd)):di(n,r,o,a,s):di(n,null,null,null,null)}}}function ni(t,i){var e=t.g;if(null!==e){t.Xi&&ei(t,!0),Rt(t);var n=ae(e,i,null,function(i){return!Zt(t,i)}),o=e.P;if(o.ye=n,null!==n){o.zc=!1;for(var r=n;null!==r;){var s=r.jA;if(null!==s&&(s(o,r),o.zc))break;r=ti(r)}}else null!==(s=e.jA)&&s(o);if((t.ra||null!==Al)&&(t.doDropOnto(i,n),t.ra||null!==Al))for(n=e.selection.i;n.next();)(o=n.value)instanceof wr&&function(t,i){var e=!1;if(t.tb.Zj(i)&&(e=!0),0!==(e=t.Oz(i,function(t){return t.aa},function(t){return t instanceof zr},!0,function(t){return t instanceof zr},e)).count)for(e=e.i;e.next();){var n=e.value;n.Al&&n.jc()}}(e,o.Y)}}function oi(t,i,e){if(null===t.hc){var n=t.g;if(null!==n&&!n.bb&&!n.wf){n.wb=!e,n.bq=!e,t.jk=n.P.da,n=n.Xo(i,n,!0),Kt(i,e=xh.ag());var o=e.x+e.width/2,r=e.y+e.height/2;xh.ic(e);var s=t.iw;e=new m(tr);var a=xh.M();for(i=i.i;i.next();){if((l=i.value).Pd()&&l.canCopy()){var h=l.location,l=n.ka(l);a.m(s.x-(o-h.x),s.y-(r-h.y)),l.location=a,l.rf(),e.add(l,Et(a))}}for(xh.v(a),n=n.i;n.next();)(o=n.value)instanceof zr&&o.canCopy()&&e.add(o,Et());t.hc=e,Bt(t,e.fj()),null!==t.ad&&(e=t.ad,n=e.ln,e.Gl(t.jk.x-(n.x+n.width/2),t.jk.y-(n.y+n.height/2)))}}}function ri(t){this.point=t,this.xF=hl.mk}function si(t,i,e){this.Jc=t,this.info=i,this.PH=e}function ai(){0<arguments.length&&xh.fd(ai),zt.call(this),this.RC=100,this.tC=!1;var t=new zr,i=new To;i.Rf=!0,i.stroke="blue",t.add(i),(i=new To).Tp="Standard",i.fill="blue",i.stroke="blue",t.add(i),t.Tf="Tool",this.jD=t,t=new wr,(i=new To).Sd="",i.Cb="Rectangle",i.fill=null,i.stroke="magenta",i.pb=2,i.ya=hl.Vx,t.add(i),t.Kl=!1,t.Tf="Tool",this.hD=t,this.iD=i,t=new wr,(i=new To).Sd="",i.Cb="Rectangle",i.fill=null,i.stroke="magenta",i.pb=2,i.ya=hl.Vx,t.add(i),t.Kl=!1,t.Tf="Tool",this.kD=t,this.lD=i,this.OC=this.NC=this.JC=this.IC=this.KC=null,this.oC=!0,this.AG=new m(Mn,"boolean"),this.SC=this.Qk=this.dD=null}function hi(t,i,e,n){if(i===e)return!0;var o=i.V;return!(null===o||!o.vf||(n.add(o),!hi(t,o.fe,e,n)))||!(null===(i=i.ba)||!i.vf||(n.add(i),!hi(t,i.fe,e,n)))}function li(t,i,e,n,o){if(i===e)return!0;if(null===i||null===e)return!1;for(var r=i.ue;r.next();){var s=r.value;if(s!==n&&(!o||s.Hc)&&s.ba===i&&(s=s.V)!==i&&li(t,s,e,n,o))return!0}return!1}function ui(t,i,e,n,o){if(e===n)return!0;if(null===e||null===n||i.contains(e))return!1;i.add(e);for(var r=e.ue;r.next();){var s=r.value;if(s!==o&&s.ba===e&&(s=s.V)!==e&&ui(t,i,s,n,o))return!0}return!1}function fi(t,i,e,n,o){if(e===n)return!0;if(null===e||null===n||i.contains(e))return!1;i.add(e);for(var r=e.ue;r.next();){if((a=r.value)!==o){var s=a.V,a=a.ba;if((s=s===e?a:s)!==e&&fi(t,i,s,n,o))return!0}}return!1}function ci(){0<arguments.length&&xh.fd(ci),ai.call(this),this.name="Linking",this.sB={},this.rB=null,this.ca=zl,this.aD=null}function pi(){0<arguments.length&&xh.fd(pi),ai.call(this),this.name="Relinking";var t=new To;t.Cb="Diamond",t.ya=hl.Sx,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="pointer",t.ve=0,this.bC=t,(t=new To).Cb="Diamond",t.ya=hl.Sx,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="pointer",t.ve=-1,this.mD=t,this.Ub=null,this.LC=new M}function di(t,i,e,n,o){null!==i?(t.copyPortProperties(i,e,t.ze,t.nn,!1),t.g.add(t.ze)):t.g.remove(t.ze),null!==n?(t.copyPortProperties(n,o,t.Ae,t.on,!0),t.g.add(t.Ae)):t.g.remove(t.Ae)}function yi(){0<arguments.length&&xh.fd(yi),zt.call(this),this.name="LinkReshaping";var t=new To;t.Cb="Rectangle",t.ya=hl.Vp,t.fill="lightblue",t.stroke="dodgerblue",this.Gk=t,(t=new To).Cb="Diamond",t.ya=hl.Vp,t.fill="lightblue",t.stroke="dodgerblue",this.zC=t,this.TC=3,this.jy=this.Ub=null,this.MC=new b,this.Pv=null}function vi(t,i,e,n,o,r){return r?Math.abs(i.y-e.y)<t.ph&&Math.abs(e.y-n.y)<t.ph&&Math.abs(n.y-o.y)<t.ph:Math.abs(i.x-e.x)<t.ph&&Math.abs(e.x-n.x)<t.ph&&Math.abs(n.x-o.x)<t.ph}function gi(){0<arguments.length&&xh.fd(gi),zt.call(this),this.name="Resizing",this.Ej=new k(1,1).freeze(),this.Cj=new k(9999,9999).freeze(),this.kj=new k(NaN,NaN).freeze(),this.cr=!1,this.Fb=null;var t=new To;t.Wj=zh,t.Cb="Rectangle",t.ya=hl.Vp,t.fill="lightblue",t.stroke="dodgerblue",t.pb=1,t.cursor="pointer",this.Gk=t,this.Ub=null,this.Ov=new k,this.az=new b,this.Ey=new k(0,0),this.Dy=new k(1/0,1/0),this.Cy=new k(1,1),this.FC=!0}function mi(t,i,e){if(null!==i)if(i.alignment.Uc()||""===i.cursor){if(i instanceof eo)for(i=i.elements;i.next();)mi(t,i.value,e)}else t:{if((t=i.alignment).te()&&(t=zh),0>=t.x)e=0>=t.y?e+225:1<=t.y?e+135:e+180;else if(1<=t.x)0>=t.y?e+=315:1<=t.y&&(e+=45);else if(0>=t.y)e+=270;else{if(!(1<=t.y))break t;e+=90}0>e?e+=360:360<=e&&(e-=360),i.cursor=22.5>e?"e-resize":67.5>e?"se-resize":112.5>e?"s-resize":157.5>e?"sw-resize":202.5>e?"w-resize":247.5>e?"nw-resize":292.5>e?"n-resize":337.5>e?"ne-resize":"e-resize"}}function bi(){0<arguments.length&&xh.fd(bi),zt.call(this),this.name="Rotating",this.ZC=45,this.YC=2,this.Fb=null;var t=new To;t.Cb="Ellipse",t.ya=hl.Sx,t.fill="lightblue",t.stroke="dodgerblue",t.pb=1,t.cursor="pointer",this.Gk=t,this.Ub=null,this.Nv=0,this.VC=new b}function xi(){0<arguments.length&&xh.fd(xi),zt.call(this),this.name="ClickSelecting"}function wi(){0<arguments.length&&xh.fd(wi),zt.call(this),this.name="Action",this.vn=null}function ki(){0<arguments.length&&xh.fd(ki),zt.call(this),this.name="ClickCreating",this.Vl=null,this.mC=!0,this.aC=new b(0,0)}function Mi(t,i,e){this.text=t,this.QD=i,this.visible=e}function Pi(){0<arguments.length&&xh.fd(Pi),zt.call(this),this.name="ContextMenu",this.yq=this.GB=null,this.DC=new b,this.sy=this.Mn=null,function(i){if(i.Mn=new xr,i.nD=function(){i.stopTool()},!1===xh.ZD){var e=xh.createElement("div"),n=xh.createElement("div");e.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",n.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 o=xh.createElement("style");t.document.getElementsByTagName("head")[0].appendChild(o),o.sheet.insertRule(".defaultCXul { list-style: none; }",0),o.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),o.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),e.addEventListener("contextmenu",function(t){return t.preventDefault(),!1},!1),e.addEventListener("selectstart",function(t){return t.preventDefault(),!1},!1),n.addEventListener("contextmenu",function(t){return t.preventDefault(),!1},!1),t.document.body&&(t.document.body.appendChild(e),t.document.body.appendChild(n)),xh.gt=e,xh.ft=n,xh.ZD=!0}}(this)}function Ti(t){var i=t.g;if(null!==i)if(t.ra){if(null!==t.Pf){var e=i.re(i.P.da,null,null);null!==e&&e.Cl(t.Pf)&&t.standardMouseClick(null,null),t.stopTool(),t.canStart()&&(i.Ya=t,t.doMouseUp())}}else t.canStart()&&(Si(t,!0),t.ra||t.stopTool())}function Si(t,i,e){void 0===e&&(e=null),i&&t.standardMouseSelect(),t.standardMouseClick()||(t.ra=!0,null===e&&(e=t.findObjectWithContextMenu()),null!==e&&null!==(i=e.contextMenu)?(t.yq=e instanceof Mn?e:null,t.showContextMenu(i,t.yq)):t.showDefaultContextMenu())}function Ni(){0<arguments.length&&xh.fd(Ni),zt.call(this),this.name="DragSelecting",this.Nn=175,this.rC=!1;var t=new tr;t.Tf="Tool",t.Kl=!1;var i=new To;i.name="SHAPE",i.Cb="Rectangle",i.fill=null,i.stroke="magenta",t.add(i),this.Xl=t}function Ci(){0<arguments.length&&xh.fd(Ci),zt.call(this),this.name="Panning",this.bz=new b,this.jj=!1;var i=this;this.bD=function(){t.document.removeEventListener("scroll",i.bD,!1),i.stopTool()}}function ji(){0<arguments.length&&xh.fd(ji),zt.call(this),this.name="TextEditing",this.KB=this.mz=this.fD=null,this.Do=Ul,this.Zk=null,this.gb=Jl,this.Wk=null,this.AC=1,this.WC=!0;var t=xh.createElement("textarea");t.nB=!0,this.QB=t,t.addEventListener("input",function(){var t=this.textEditingTool;if(null!==t&&void 0!==t&&null!==t.Be){var i=t.fD;i.text=this.value;var e=this.xJ;jn(i,t.Be.zv,1/0),this.style.width=20+i.Ca.width*e+"px",this.style.height=10+i.Ca.height*e+"px",this.rows=i.qI}},!1),t.addEventListener("keydown",function(t){var i=t.which,e=this.textEditingTool;null!==e&&void 0!==e&&null!==e.Be&&(13===i?(!1===e.Be.gx&&t.preventDefault(),e.acceptText(Kl)):9===i?(e.acceptText(Hl),t.preventDefault()):27===i&&(e.doCancel(),null!==e.g&&e.g.focus()))},!1),t.addEventListener("focus",function(){var t=this.textEditingTool;null!==t&&void 0!==t&&(t.gb===Yl?t.gb=Wl:t.gb===Zl?t.gb=Xl:t.gb===Xl&&(t.gb=Wl),"function"==typeof this.select&&t.IA&&(this.select(),this.setSelectionRange(0,9999)))},!1),t.addEventListener("blur",function(){"function"==typeof this.focus&&this.focus();var t=this.textEditingTool;null!==t&&void 0!==t&&"function"==typeof this.select&&t.IA&&(this.select(),this.setSelectionRange(0,9999))},!1)}function Li(t){if(null!==t.Be&&null!==t.rg){var i=t.Be,e=t.Be.text,n=t.rg.value,o="",o="function"==typeof n?n():n;if(!t.isValidText(t.Be,e,o))return t.gb=Wl,null!==i.Mz&&i.Mz(t,e,o),null===t.Wk&&(t.Wk=t.rg.style.border,t.rg.style.border="3px solid red"),void("function"==typeof t.rg.focus&&t.rg.focus());t.Sb(t.name),t.gb=Zl,e!==o&&(t.Be.text=o),t.Cf=t.name,null!==(i=t.g)&&i.Ba("TextEdited",t.Be,e),t.kk(),t.stopTool(),null!==i&&i.focus()}null!==t.Wk&&(t.rg.style.border=t.Wk,t.Wk=null)}function Di(){zt.call(this),this.name="ToolManager",this.lG=new u(zt),this.mG=new u(zt),this.nG=new u(zt),this.eC=this.fC=850,this.UB=new k(2,2).Fa(),this.oD=5e3,this.EC=$l,this.cC=tu,this.Xu=this.qy=null,this.Em=-1}function Ai(t,i,e,n){xh.j(i,"string",Di,"replaceStandardTool:name"),xh.A(n,u,Di,"replaceStandardTool:list"),null!==e&&(xh.A(e,zt,Di,"replaceStandardTool:newtool"),e.g&&e.g!==t.g&&xh.k("Cannot share tools between Diagrams: "+e.toString()),e.name=i,e.Mc(t.g)),t.findTool(i)?t.replaceTool(i,e):null!==e&&n.add(e)}function Fi(){this.LB=zi,this.Hq=this.Iq=this.U=null,this.Jq=this.Kq=0,this.Ju=this.vc=this.bo=this.uj=!1,this.vj=this.Ue=!0,this.Wu=this.Vu=this.IB=null,this.HB=0,this.Do=null,this.Hu=new c("string"),this.zy=600,this.rG=new b(0,0),this.vB=this.uB=this.sD=!1,this.Uk=new m(Mn,Ji)}function zi(t,i,e,n){return 1>(t/=n/2)?e/2*t*t+i:-e/2*(--t*(t-2)-1)+i}function Oi(t){t.Ue&&(t.Hu.clear(),t.vc&&requestAnimationFrame(function(){!1===t.vc||t.uj||(t.U.Pj=1,_i(t.U),t.vc=!1,t.U.Ba("AnimationStarting"),function(t){var i;void 0===i&&(i=new n);var e=t.U;if(null!==e){t.uj=!0;var o=i.CK||t.LB,r=i.fL||null,s=i.gL||null,a=i.duration||t.zy,h=t.rG;for(i=t.Uk.i;i.next();){var l=i.value.start.position;l instanceof b&&(l.K()||l.assign(h))}t.IB=o,t.Vu=r,t.Wu=s,t.HB=a;var u=t.Uk;for(i=u.i;i.next();)(r=i.value.end)["position:placeholder"]&&(s=r["position:placeholder"],h=s.Za(Lh),h.x+=s.padding.left,h.y+=s.padding.top,r["position:placeholder"]=h);Ei(t),Ri(t,e,u,o,0,a),ye(t.U),Ii(t),requestAnimationFrame(function(i){var n=i||+new Date,r=n+a;!function i(s){if(!1!==t.uj){var h=(s=s||+new Date)>r?a:s-n;Ei(t),Ri(t,e,u,o,h,a),t.Vu&&t.Vu(),ye(e),Ii(t),s>r?Gi(t):requestAnimationFrame(i)}}(n)})}}(t))}))}function qi(t,i,e,o,r,s){if(!(!t.vc||"position"===e&&o.L(r)||i instanceof tr&&!i.AE)){void 0===s&&(s=!1);var a=t.Uk;if(a.contains(i)){var h=(t=a.ka(i)).start,l=t.end;void 0===h[e]&&(h[e]=Bi(o)),t.Iz&&void 0!==l[e]?t.Nz[e]=Bi(r):(s||(t.Nz[e]=Bi(r)),l[e]=Bi(r))}else h=new n,l=new n,h[e]=Bi(o),l[e]=Bi(r),e=l,(o=h.position)instanceof b&&!o.K()&&t.Hu.contains("Expand SubGraph")&&o.assign(e.position),a.add(i,new Ji(h,l,s))}}function Bi(t){return t instanceof b?t.copy():t instanceof k?t.copy():t}function Ei(t){if(!t.bo){var i=t.U;t.sD=i.wb,t.uB=i.we,t.vB=i.mu,i.wb=!0,i.we=!0,i.mu=!0,t.bo=!0}}function Ii(t){var i=t.U;i.wb=t.sD,i.we=t.uB,i.mu=t.vB,t.bo=!1}function Ri(t,i,e,n,o,r){for(e=e.i;e.next();){var s,a=e.key,h=(l=e.value).start,l=l.end;for(s in l)"position"===s&&(l["position:placeholder"]||l["position:node"])||void 0===nu[s]||nu[s](a,h[s],l[s],n,o,r)}n=i.Yz,i.Yz=!0,s=t.LB,0!==t.Kq&&0!==t.Jq&&(e=t.Kq,i.Vb=s(o,e,t.Jq-e,r)),null!==t.Iq&&null!==t.Hq&&(e=t.Iq,t=t.Hq,i.mb=new b(s(o,e.x,t.x-e.x,r),s(o,e.y,t.y-e.y,r))),i.Yz=n}function Gi(t){t.uj=!1,t.Iq=null,t.Hq=null,t.Kq=0,t.Jq=0,Ei(t);for(var i=t.U,e=t.IB,n=t.HB,o=t.Uk.i;o.next();){var r,s=o.key,a=o.value,h=a.start,l=a.end,u=a.Nz;for(r in l)if(void 0!==nu[r]){var f=r;!a.Iz||"position:node"!==f&&"position:placeholder"!==f||(f="position"),nu[f](s,h[r],a.Iz?void 0!==u[r]?u[r]:h[r]:l[r],e,n,n)}a.yx&&s.rd(!1)}for(e=t.U.links;e.next();)null!==(n=e.value).wo&&(n.points=n.wo,n.wo=null);i.nx.clear(),i.Pj=null,i.pc(),i.Uf(),pe(i),Ii(t),t.Uk=new m(Mn,Ji),t.Wu&&t.Wu(),t.Wu=null,t.Vu=null,i.Ba("AnimationFinished"),i.Re()}function Vi(t,i,e){var n=i.Y,o=e.Y,r=null;if(e instanceof vs&&(r=e.placeholder),null!==r?(n=r.Za(Lh),n.x+=r.padding.left,n.y+=r.padding.top,qi(t,i,"position",n,i.position,!1)):qi(t,i,"position",new b(o.x+o.width/2-n.width/2,o.y+o.height/2-n.height/2),i.position,!1),qi(t,i,"scale",.01,i.scale,!1),i instanceof vs)for(i=i.Ic;i.next();)(r=i.value)instanceof wr&&Vi(t,r,e)}function Hi(t,i,e){if(i.isVisible()){var n=null;if(e instanceof vs&&(n=e.placeholder),null!==n?qi(t,i,"position:placeholder",i.position,n,!0):qi(t,i,"position:node",i.position,e,!0),qi(t,i,"scale",i.scale,.01,!0),t.vc&&(n=t.Uk).contains(i)&&(n.ka(i).yx=!0),i instanceof vs)for(i=i.Ic;i.next();)(n=i.value)instanceof wr&&Hi(t,n,e)}}function Ki(t,i,e){t.vc&&(null===t.Iq&&i.K()&&null===t.Hq&&(t.Iq=i.copy()),t.Hq=e.copy(),t.Ju=!0)}function Ui(t,i,e){t.vc&&t.U.bn&&(0===t.Kq&&0===t.Jq&&(t.Kq=i),t.Jq=e,t.Ju=!0)}function Ji(t,i,e){this.start=t,this.end=i,this.Nz=new n,this.Iz=e,this.yx=!1}function Yi(){0<arguments.length&&xh.fd(Yi),xh.ec(this),this.U=null,this.zb=new u(tr),this.Qb="",this.Rc=1,this.Qy=!1,this.Yk=this.qz=this.wk=this.vk=this.uk=this.tk=this.rk=this.sk=this.qk=this.yk=this.pk=this.xk=this.ok=this.nk=!0,this.Ly=!1,this.Qv=[]}function Wi(t,i,e,n){if(t.visible&&0!==t.Rc){1!==t.Rc&&(i.globalAlpha=t.Rc);var o=t.Qv;o.length=0;for(var r=e.scale,s=(t=t.zb.n).length,a=n.length,h=0;h<s;h++){var l=t[h];if(dr(l)){if(l instanceof zr){if((f=l).kc&&o.push(f),!1===f.Mf)continue}var u,f=rr(l,l.Y);t:{u=f;for(var c=n,p=a,d=2/r,y=4/r,v=0;v<p;v++){var g=c[v];if(0!==g.width&&0!==g.height&&u.yE(g.x-d,g.y-d,g.width+y,g.height+y)){u=!0;break t}}u=!1}u&&(1<f.width*r||1<f.height*r?l.$e(i,e):lr(l,i))}}i.globalAlpha=1}}function Xi(t,i,e){if(i=function(t,i,e){var n=e.sn;if(isNaN(n))return i;var o=(t=t.zb).count;if(1>=o)return i;if(0>i&&(i=t.indexOf(e)),0>i)return-1;for(var r=i-1,s=NaN;0<=r&&(s=t.ha(r).sn,isNaN(s));)r--;for(var a=i+1,h=NaN;a<o&&(h=t.ha(a).sn,isNaN(h));)a++;if(!isNaN(s)&&s>n)for(;;){if(-1===r||s<=n){if(++r===i)break;return t.Vc(i),t.Cd(r,e),r}for(s=NaN;0<=--r&&(s=t.ha(r).sn,isNaN(s)););}else if(!isNaN(h)&&h<n)for(;;){if(a===o||h>=n){if(--a===i)break;return t.Vc(i),t.Cd(a,e),a}for(h=NaN;++a<o&&(h=t.ha(a).sn,isNaN(h)););}return i}(t,i,e),e instanceof vs&&null!==e&&isNaN(e.sn)){if(0!==e.Ic.count){for(var n=-1,o=t.zb.n,r=o.length,s=0;s<r;s++){var a=o[s];if(a===e&&(i=s,0<=n))break;if(0>n&&a.Ta===e&&(n=s,0<=i))break}!(0>n)&&n<i&&((o=t.zb).Vc(i),o.Cd(n,e))}null!==(e=e.Ta)&&Xi(t,-1,e)}}function Qi(i){function e(){t.document.removeEventListener("DOMContentLoaded",e,!1),$i(n)}1<arguments.length&&xh.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id."),xh.ec(this),pf=[],this.Pc=!0,this.pB=new Fi,this.pB.Mc(this),this.yd=17;var n=this;null!==t.document.body?$i(this):t.document.addEventListener("DOMContentLoaded",e,!1),this.sC=!1,this.Yb=new u(Yi),this.Lb=this.Gb=0,this.Ij=this.Mb=this.zh=this.ub=null,this.hF(),this.Zn=null,this.gF(),this.mb=new b(NaN,NaN).freeze(),this.Vb=1,this.qv=new b(NaN,NaN).freeze(),this.rv=NaN,this.Hv=1e-4,this.Fv=100,this.me=new L,this.uw=new b(NaN,NaN).freeze(),this.hv=new M(NaN,NaN,NaN,NaN).freeze(),this.bw=new j(0,0,0,0).freeze(),this.cw=pu,this.Zv=this.Vv=null,this.Wl=ou,this.Bn=jh,this.Jk=ou,this.Wn=jh,this.sv=this.pv=Lh,this.ke=!0,this.$q=!1,this.eg=new c(Mn),this.Dk=new m(zr,M),this.On=!0,this.tB=250,this.xn=-1,this.Lu=new j(16,16,16,16).freeze(),this.$u=this.Lf=!1,this.Sn=!0,this.ui=new tt,this.Sc=new tt,this.Pb=new tt,this.Og=this.ii=null,this.mw=!1,this.vy=this.wy=null,on(this),this.ro=new c(wr),this.$k=new c(vs),this.ko=new c(zr),this.zb=new c(tr),this.xv=!0,this.pw=yu,this.iC=!1,this.rw=au,this.py=this.ty=this.nz=null,this.Uu="",this.Gq="auto",this.ni=this.Ni=this.Ci=this.Kv=this.Di=this.Ei=this.Fi=this.mi=this.si=this.ji=null,this.Yy=!1,this.QC={},this.Uv=0,this.Kf=[null,null],this.ly=null,this.bq=this.uy=this.hz=this.XC=this.Ki=!1,this.uC=!0,this.Ny=this.Kd=!1,this.gz=this.fz=0,this.Vg="gray",this.Qh=0,this.Vd=null;var o=this;this.BC=function(t){if(t.Z===o.Z&&o.Ra){o.Ra=!1;try{var i=t.xc;""===t.kf&&i===kl&&Fe(o,t.object,t.propertyName)}finally{o.Ra=!0}}},this.CC=function(t){!function(t,i){if(i.Z===t.Z){var e=i.xc,n=i.propertyName;if(e===wl&&"S"===n[0])if("StartingFirstTransaction"===n)(e=t.cb).Qe.each(function(i){i.Mc(t)}),e.Vf.each(function(i){i.Mc(t)}),e.Wf.each(function(i){i.Mc(t)}),t.Kd||t.Ng||(t.$u=!0,t.Sn&&(t.Lf=!0));else if("StartingUndo"===n||"StartingRedo"===n){var o=t.Sa;o.uf&&!t.wb&&o.ci(),t.Ba("ChangingSelection")}else"StartedTransaction"===n&&(o=t.Sa).uf&&!t.wb&&o.ci();else if(t.Ra){t.Ra=!1;try{var r=i.kf;if(""!==r)if(e===kl){if("linkFromKey"===r){var s=i.object,a=t.sf(s);if(null!==a){var h=i.newValue,l=t.bf(h);a.V=l}}else if("linkToKey"===r)s=i.object,null!==(a=t.sf(s))&&(h=i.newValue,l=t.bf(h),a.ba=l);else if("linkFromPortId"===r){if(s=i.object,null!==(a=t.sf(s))){var u=i.newValue;"string"==typeof u&&(a.vg=u)}}else if("linkToPortId"===r)s=i.object,null!==(a=t.sf(s))&&"string"==typeof(u=i.newValue)&&(a.th=u);else if("nodeGroupKey"===r){var s=i.object,f=t.ug(s);if(null!==f){var c=i.newValue;if(void 0!==c){var p=t.bf(c);f.Ta=p instanceof vs?p:null}else f.Ta=null}}else if("linkLabelKeys"===r){if(s=i.object,null!==(a=t.sf(s))){var d=i.oldValue,y=i.newValue;if(xh.isArray(d))for(var v=xh.Xa(d),g=0;g<v;g++){var m=xh.Pa(d,g);null!==(l=t.bf(m))&&(l.fe=null)}if(xh.isArray(y))for(v=xh.Xa(y),g=0;g<v;g++)m=xh.Pa(y,g),null!==(l=t.bf(m))&&(l.fe=a)}}else if("nodeParentKey"===r){var b=i.object,x=t.bf(i.newValue);if(null!==(k=t.Tw(b))){var w=k.ep();null!==w?null===x?t.remove(w):t.Qd?w.V=x:w.ba=x:Ke(t,x,k)}}else if("parentLinkCategory"===r){var b=i.object,k=t.Tw(b),M=i.newValue;null!==k&&"string"==typeof M&&null!==(w=k.ep())&&(w.Fc=M)}else if("nodeCategory"===r){var s=i.object,P=t.ug(s),M=i.newValue;null!==P&&"string"==typeof M&&(P.Fc=M)}else if("linkCategory"===r){var s=i.object,T=t.sf(s),M=i.newValue;null!==T&&"string"==typeof M&&(T.Fc=M)}else if("nodeDataArray"===r){var S=i.oldValue;We(t,S);var N=i.newValue;Re(t,N)}else"linkDataArray"===r&&(S=i.oldValue,We(t,S),N=i.newValue,Ue(t,N));t.bi=!0}else e===Ml?(N=i.newValue,"nodeDataArray"===r&&xh.Va(N)?Ge(t,N):"linkDataArray"===r&&xh.Va(N)?Je(t,N):"linkLabelKeys"===r&&yt(N)&&(a=t.sf(i.object),l=t.bf(N),null!==a&&null!==l&&(l.fe=a)),t.bi=!0):e===Pl?(S=i.oldValue,"nodeDataArray"===r&&xh.Va(S)?Xe(t,S):"linkDataArray"===r&&xh.Va(S)?Xe(t,S):"linkLabelKeys"===r&&yt(S)&&null!==(l=t.bf(S))&&(l.fe=null),t.bi=!0):e===wl&&("SourceChanged"===r?null!==i.object?Fe(t,i.object,i.propertyName):(t.GJ(),t.QF()):"ModelDisplaced"===r&&t.Il());else if(e===kl){var C=i.propertyName;(s=i.object)===t.Z?"nodeKeyProperty"!==C&&"nodeCategoryProperty"!==C&&"linkFromKeyProperty"!==C&&"linkToKeyProperty"!==C&&"linkFromPortIdProperty"!==C&&"linkToPortIdProperty"!==C&&"linkLabelKeysProperty"!==C&&"nodeIsGroupProperty"!==C&&"nodeGroupKeyProperty"!==C&&"nodeParentKeyProperty"!==C&&"linkCategoryProperty"!==C||t.ma.kb||t.Il():Fe(t,s,C),t.bi=!0}else if(e===Ml||e===Pl)(function(t,i){var e=i.xc===Ml,n=e?i.zg:i.Bg,o=e?i.newValue:i.oldValue,r=t.gm.ka(i.object);if(Array.isArray(r))for(var s=0;s<r.length;s++){var a=r[s];if(e)wo(a,o,n);else{var h=n;if(!(0>h)){var l=h;xo(a)&&l++,a.Oe(l),ko(a,l,h)}}}})(t,i),t.bi=!0;else if(e===wl){"FinishedUndo"!==n&&"FinishedRedo"!==n||(t.ma.xi=!0,t.Ba("ChangedSelection"),ve(t),t.ma.xi=!1),o=t.Sa,"RolledBackTransaction"===n&&o.ci(),t.$u=!0,t.Uf(),0===t.ma.uh&&Oi(o),"CommittedTransaction"===n&&t.ma.Ry&&(t.Lg=Math.min(t.Lg,t.ma.Zi-1));var j=i.KE;j&&(Ae(t),t.nx.clear()),!t.Yy&&j&&(t.Yy=!0,xh.setTimeout(function(){t.Ya.standardMouseOver(),t.Yy=!1},10))}}finally{t.Ra=!0}}}}(o,t)},this.uD=!0,this.Lg=-2,this.oi=new m(Object,tr),this.Ck=new m(Object,zr),this.gm=new m(Object,Array),this.so=new m("string",Array),this.PC=new u(Ho),this.wi=!1,this.ok=this.nk=this.zu=this.Ue=!0,this.Bu=this.Au=!1,this.Gu=this.Eu=this.wk=this.vk=this.uk=this.tk=this.rk=this.sk=this.qk=this.Du=this.yk=this.pk=this.xk=!0,this.dm=this.qC=!1,this.Fu=this.Cu=this.nv=this.mv=!0,this.ew=this.aw=16,this.cz=this.$v=!1,this.os=this.dw=null,this.dz=this.ez=0,this.We=new j(5).freeze(),this.gw=new c(tr).freeze(),this.Gv=999999999,this.ov=new c(tr).freeze(),this.Kk=this.bm=this.tj=!0,this.Hk=this.sj=!1,this.Ud=null,this.Iu=!0,this.Ng=!1,this.kG=new c(zr),this.gC=new c(es),this.wd=null,this.HC=1,this.Gy=!1,this.$C=0,this.tD=new M(NaN,NaN,NaN,NaN).freeze(),this.av=new M(NaN,NaN,NaN,NaN).freeze(),this.Rv=new c(mn),ie(this),this.Cv=this.jv=this.Lv=this.NB=this.MB=this.OB=this.zj=this.Fk=this.Gi=null,Zi(this),this.ld=null,this.iv=!1,this.En=null,this.cb=new Di,this.cb.initializeStandardTools(),this.Ya=this.jt=this.cb,this.ob=new Lt,this.Z=new wt,this.Ki=!0,this.Rb=new ks,this.Ki=!1,this.ZB=this.yy=null,this.He=1,this.Pj=null,this.Ik=new yn,void 0!==i&&vn(this,i),this.im=1,this.jm=0,this.wC=new b,this.qD=500,this.Ku=new b,this.zs=null,this.Pc=this.wv=!1}function Zi(t){t.Gi=new m("string",tr);var i=new wr,e=new zo;e.bind(new Tt("text","",Cl)),i.add(e),t.OB=i,t.Gi.add("",i),i=new wr,(e=new zo).stroke="brown",e.bind(new Tt("text","",Cl)),i.add(e),t.Gi.add("Comment",i),(i=new wr).Kl=!1,i.KD=!1,(e=new To).Cb="Ellipse",e.fill="black",e.stroke=null,e.ya=new k(3,3).Fa(),i.add(e),t.Gi.add("LinkLabel",i),t.Fk=new m("string",vs),(i=new vs).HA="GROUPPANEL",i.type=Eu,(e=new zo).font="bold 12pt sans-serif",e.bind(new Tt("text","",Cl)),i.add(e),(e=new eo(Ru)).name="GROUPPANEL";var n=new To;n.Cb="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",e.add(n),(n=new ws).padding=new j(5,5,5,5).Fa(),e.add(n),i.add(e),t.MB=i,t.Fk.add("",i),t.zj=new m("string",zr),i=new zr,(e=new To).Rf=!0,i.add(e),(e=new To).Tp="Standard",e.fill="black",e.stroke=null,e.pb=0,i.add(e),t.NB=i,t.zj.add("",i),i=new zr,(e=new To).Rf=!0,e.stroke="brown",i.add(e),t.zj.add("Comment",i),(i=new xr).type=Ru,(e=new To).fill=null,e.stroke="dodgerblue",e.pb=3,i.add(e),(e=new ws).margin=new j(1.5,1.5,1.5,1.5).Fa(),i.add(e),t.Lv=i,t.jv=i,(i=new xr).type=Ku,(e=new To).Rf=!0,e.fill=null,e.stroke="dodgerblue",e.pb=3,i.add(e),t.Cv=i}function $i(i){var e=xh.createElement("p");e.style.width="100%",e.style.height="200px",e.style.boxSizing="content-box";var n=xh.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.width="200px",n.style.height="150px",n.style.overflow="hidden",n.style.boxSizing="content-box",n.appendChild(e),t.document.body.appendChild(n);var o=e.offsetWidth;n.style.overflow="scroll",o===(e=e.offsetWidth)&&(e=n.clientWidth),t.document.body.removeChild(n),0!==(n=o-e)||xh.FE||(n=11),i.yd=n}function _i(t){if(null!==t.ub){var i=t.Mb;if(0!==i.clientWidth&&0!==i.clientHeight){var e=t.Hk?t.yd:0,n=t.sj?t.yd:0,o=t.He;t.He=t.computePixelRatio(),t.He!==o&&(t.$q=!0,t.Re()),i.clientWidth===t.Gb+e&&i.clientHeight===t.Lb+n||(t.bm=!0,t.ke=!0,null!==(i=t.Rb)&&i.hx&&t.gl===ou&&i.H(),t.Kd||t.Re())}}}function te(t,i,e){void 0===i&&(i=t.zh),void 0===e&&(e=!0),e&&(i.wu=""),i.un="",i.tn=""}function ie(t){var i=new Yi;i.name="Background",t.Vs(i),(i=new Yi).name="",t.Vs(i),(i=new Yi).name="Foreground",t.Vs(i),(i=new Yi).name="Adornment",i.Gc=!0,t.Vs(i),(i=new Yi).name="Tool",i.Gc=!0,i.BE=!0,t.Vs(i),(i=new Yi).name="Grid",i.pf=!1,i.Cg=!1,i.Gc=!0,t.IG(i,t.nt("Background"))}function ee(t){t.ld=new eo(Uu),t.ld.name="GRID";var i=new To;i.Cb="LineH",i.stroke="lightgray",i.pb=.5,i.interval=1,t.ld.add(i),(i=new To).Cb="LineH",i.stroke="gray",i.pb=.5,i.interval=5,t.ld.add(i),(i=new To).Cb="LineH",i.stroke="gray",i.pb=1,i.interval=10,t.ld.add(i),(i=new To).Cb="LineV",i.stroke="lightgray",i.pb=.5,i.interval=1,t.ld.add(i),(i=new To).Cb="LineV",i.stroke="gray",i.pb=.5,i.interval=5,t.ld.add(i),(i=new To).Cb="LineV",i.stroke="gray",i.pb=1,i.interval=10,t.ld.add(i),(i=new tr).add(t.ld),i.Tf="Grid",i.sn=0,i.$z=!1,i.AE=!1,i.Cg=!1,i.eA="GRID",t.add(i),t.zb.remove(i),t.ld.visible=!1}function ne(t){if(t.mE.K()){var i=t.mE.copy();return i.vw(t.padding),i}for(var e=!0,n=t.Yb.n,o=n.length,r=0;r<o;r++){if((s=n[r]).visible&&(!s.Gc||s.BE))for(var s=s.zb.n,a=s.length,h=0;h<a;h++){var l=s[h];l.$z&&l.isVisible()&&(l=l.Y).K()&&(e?(e=!1,i=l.copy()):i.ei(l))}}return e&&(i=new M(0,0,0,0)),i.vw(t.padding),i}function oe(t,i){if((i||t.Ng)&&!t.Pc&&null!==t.ub&&!t.Sa.uf&&t.Bd.K()){t.Pc=!0;n=t.Wl;i&&t.Jk!==ou&&(n=t.Jk);var e=n!==ou?re(t,n):t.scale,n=t.tb.copy(),o=t.Gb/e,r=t.Lb/e,s=null,a=t.Sa;a.vc&&(s=t.mb.copy()),t.position.Oa();var h=t.Bn;i&&!h.ed()&&t.Wn.ed()&&(h=t.Wn),se(t,t.mb,t.Bd,o,r,h,i),t.position.freeze(),null!==s&&Ki(a,s,t.mb),t.scale=e,t.Pc=!1,(e=t.tb).od(n)||t.Wt(n,e)}}function re(t,i){var e=t.ob.Lw;if(null===t.ub)return e;t.tj&&$e(t,t.Zg());if(!(o=t.Bd).K())return e;var n=o.width,o=o.height,r=t.Gb,s=t.Lb,a=r/n,h=s/o;return i===ru?((n=Math.min(h,a))>e&&(n=e),n<t.fh&&(n=t.fh),n>t.eh&&(n=t.eh),n):i===su?((n=h>a?(s-t.yd)/o:(r-t.yd)/n)>e&&(n=e),n<t.fh&&(n=t.fh),n>t.eh&&(n=t.eh),n):t.scale}function se(t,i,e,n,o,r,s){var a=i.x,h=i.y;(s||t.GA===pu)&&(r.ed()&&(n>e.width&&(a=e.x+(r.x*e.width+r.offsetX)-(r.x*n-r.offsetX)),o>e.height&&(h=e.y+(r.y*e.height+r.offsetY)-(r.y*o-r.offsetY))),r=t.oF,s=n-e.width,n<e.width+r.left+r.right?(a=Math.min(a+n/2,e.right+Math.max(s,r.right)-n/2),a=Math.max(a,e.left-Math.max(s,r.left)+n/2),a-=n/2):a>e.left?a=e.left:a<e.right-n&&(a=e.right-n),n=o-e.height,o<e.height+r.top+r.bottom?(h=Math.min(h+o/2,e.bottom+Math.max(n,r.bottom)-o/2),h=Math.max(h,e.top-Math.max(n,r.top)+o/2),h-=o/2):h>e.top?h=e.top:h<e.bottom-o&&(h=e.bottom-o)),i.x=isFinite(a)?a:-t.padding.left,i.y=isFinite(h)?h:-t.padding.top,null!==t.$E&&(t=t.$E(t,i),i.x=t.x,i.y=t.y)}function ae(t,i,e,n){for(void 0===e&&(e=null),void 0===n&&(n=null),ve(t),t=t.Yb.cn;t.next();){var o=t.value;if(o.visible&&!o.Gc&&null!==(o=o.re(i,e,n)))return o}return null}function he(t,i,e,n,o){n.g=i,n.event=e,o?ce(t,e,n):(n.lf=i.Pb.lf,n.da=i.Pb.da),t=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),n.sd=t,n.button=e.button,e.buttons&&(n.buttons=e.buttons),xh.fk&&0===e.button&&e.ctrlKey&&(n.button=2),n.pl=!1,n.up=!1,n.Ze=1,n.nl=0,n.zc=!1,n.bubbles=!1,n.timestamp=Date.now(),n.Gt=!1,n.Eg=e.target.U?e.target.U:null,n.ye=null}function le(t,i,e,n,o){n.g=t,ce(t,e,n),n.sd=0,n.button=0,n.buttons=1,n.pl=!0,n.up=!1,n.Ze=1,n.nl=0,n.zc=!1,n.bubbles=!0,n.event=i,n.timestamp=Date.now(),n.Gt=o,n.Eg=i.target.U?i.target.U:null,n.ye=null,t.ui=n.copy(),Al=null}function ue(i,e,n,o,r){var s=null;o.g=i,null!==n?((s=t.document.elementFromPoint(n.clientX,n.clientY))&&s.U?s=s.U:(n=e.changedTouches[0],s=i),o.Eg=s,ce(i,n,o)):null!==i.Sc?(o.da=i.Sc.da,o.lf=i.Sc.lf,o.Eg=i.Sc.Eg):null!==i.ui&&(o.da=i.ui.da,o.lf=i.ui.lf,o.Eg=i.ui.Eg),o.sd=0,o.button=0,o.buttons=1,o.pl=!1,o.up=!1,o.Ze=1,o.nl=0,o.zc=!1,o.bubbles=!1,o.event=e,o.timestamp=Date.now(),o.Gt=r,o.ye=null}function fe(t,i){return!!t.bubbles||(void 0!==i.stopPropagation&&i.stopPropagation(),(void 0===i.touches||2>i.touches.length)&&i.preventDefault(),i.cancelBubble=!0,!1)}function ce(t,i,e){var n=t.ub,o=t.Gb,r=t.Lb,s=0,a=0;null!==n&&(n=n.getBoundingClientRect(),s=i.clientX-o/n.width*n.left,a=i.clientY-r/n.height*n.top),e.lf.m(s,a),null!==t.me?(i=xh.Ob(s,a),t.me.$h(i),e.da.assign(i),xh.v(i)):e.da.m(s,a)}function pe(t){t.Kd||ve(t),t.tj&&$e(t,t.Zg())}function de(t,i){t.Sa.uf||t.Pc||!t.bm||Ne(t)||(i&&ve(t),oe(t,!1))}function ye(t){if(!t.Kd&&(t.Lf=!1,null!==t.Mb)){t.Kd=!0;var i=t.Sa,e=t.PC;if(!i.bo&&0!==e.length){for(var n=e.n,o=n.length,r=0;r<o;r++){var s=n[r];Wn(s,!1),s.Q()}e.clear()}0<(e=t.gC).count&&(e.each(function(t){t.WA()}),e.clear()),n=e=!1,i.uf&&(n=!0,e=t.wb,t.wb=!0),i.vc||_i(t),de(t,!1),null!==t.ld&&(t.ld.visible&&!t.iv&&(Le(t),t.iv=!0),!t.ld.visible&&t.iv&&(t.iv=!1)),ve(t),o=!1,t.Ng&&!t.Iu||(t.Ng?en(t,!t.$u):(t.Sb("Initial Layout"),!1===i.isEnabled&&i.ci(),en(t,!1)),o=!0),t.$u=!1,ve(t),t.hz||i.uf||pe(t),de(t,!0),o&&(t.Ng||function(t){var i=t.Yb.n;if(t.zf(i,i.length,t),t.Jk!==ou?t.scale=re(t,t.Jk):t.Wl!==ou?t.scale=re(t,t.Wl):(i=t.YH,isFinite(i)&&0<i&&(t.scale=i)),(i=t.XH).K())t.position=i;else{(i=xh.M()).iu(t.Bd,t.WH);var e=t.tb,e=xh.lk(0,0,e.width,e.height),n=xh.M();n.iu(e,t.ZH),n.m(i.x-n.x,i.y-n.y),t.position=n,xh.ic(e),xh.v(n),xh.v(i),de(t,!0),oe(t,!0)}t.Ba("InitialLayoutCompleted"),Le(t)}(t),t.Ba("LayoutCompleted")),ve(t),o&&!t.Ng&&(t.Ng=!0,t.Ad("Initial Layout"),t.wb||t.ma.clear(),xh.setTimeout(function(){t.bi=!1},1)),we(t),Oi(i),t.$e(),n&&(t.wb=e),t.Kd=!1}}function ve(t){if((t.Kd||!t.Sa.uf)&&0!==t.eg.count)for(var i=0;23>i;i++){var e=t.eg.i;if(null===e||0===t.eg.count)break;t.eg=new c(Mn),t.WA(e,t.eg)}}function ge(t,i){for(var e=xh.lb(),n=xh.lb(),o=i.Ic;o.next();){var r=o.value;r.isVisible()&&(r instanceof vs?(Yn(r)||Xn(r)||fr(r))&&ge(t,r):r instanceof zr?r.V===i||r.ba===i?n.push(r):e.push(r):(jn(r,1/0,1/0),r.Ec()))}for(var o=e.length,s=0;s<o;s++)r=e[s],jn(r,1/0,1/0),r.Ec();for(xh.ta(e),jn(i,1/0,1/0),i.Ec(),o=n.length,s=0;s<o;s++)r=n[s],jn(r,1/0,1/0),r.Ec();xh.ta(n)}function me(t,i,e,n,o){null===t.Mb&&xh.k("No div specified");if(null===(a=t.ub)&&xh.k("No canvas specified"),!t.Sa.vc){var r=t.zh;if(t.ke){Pe(t);var s=t.He;xh.an?(a.width=a.width,te(t,r)):(r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.Gb*s,t.Lb*s)),r.xE=!1,r.drawImage(t.yy.Od,0<n?0:Math.round(-n),0<o?0:Math.round(-o)),o=t.mb;var a=t.Vb,h=Math.round(o.x*a)/a,l=Math.round(o.y*a)/a;for((n=t.me).reset(),1!==a&&n.scale(a),0===o.x&&0===o.y||n.translate(-h,-l),r.save(),r.beginPath(),o=e.length,a=0;a<o;a++)0!==(h=e[a]).width&&0!==h.height&&r.rect(Math.floor(h.x),Math.floor(h.y),Math.ceil(h.width),Math.ceil(h.height));for(r.clip(),r.setTransform(1,0,0,1,0,0),r.scale(s,s),r.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),o=(e=t.Yb.n).length,t.zf(e,o,t),xe(t,r),a=0;a<o;a++)Wi(e[a],r,t,i);r.restore(),te(t),t.Ik?t.Ik.Rl(t)&&t.iy():t.Vq=function(){return new b(0,0)},t.Kk=!1,t.ke=!1,t.BA()}}}function be(t,i,e,n,o,r,s,a,h,l){null===t.Mb&&xh.k("No div specified"),null===t.ub&&xh.k("No canvas specified"),void 0===s&&(s=null),void 0===a&&(a=null),void 0===h&&(h=!1),void 0===l&&(l=!1),Pe(t),te(t),Me(t),t.Ny=!0;var u=new M(r.x,r.y,n.width/o,n.height/o),f=u.copy();f.vw(e),Le(t,f),ve(t);var p=(f=t.Yb.n).length;if(t.zf(f,p,t,u),u=t.He,i.setTransform(1,0,0,1,0,0),i.scale(u,u),i.clearRect(0,0,n.width,n.height),null!==a&&""!==a&&(i.fillStyle=a,i.fillRect(0,0,n.width,n.height)),(n=xh.sh()).reset(),n.translate(e.left,e.top),n.scale(o),0===r.x&&0===r.y||n.translate(-r.x,-r.y),i.setTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),xh.cf(n),xe(t,i),null!==s){var d=new c(Mn);for((e=s.i).reset();e.next();)o=e.value,!1===l&&"Grid"===o.layer.name||null===o||d.add(o);e=function(e){n=h;if(e.visible&&0!==e.Rc&&(void 0===n&&(n=!0),n||!e.Gc)){var n,o=(n=e.zb.n).length;if(0!==o){1!==e.Rc&&(i.globalAlpha=e.Rc),(e=e.Qv).length=0;for(var r=t.scale,s=0;s<o;s++){var a=n[s];if(dr(a)&&d.contains(a)){if(a instanceof zr){var l=a;if(l.kc&&e.push(l),!1===l.Mf)continue}1<(l=a.Y).width*r||1<l.height*r?a.$e(i,t):lr(a,i)}}i.globalAlpha=1}}}}else if(!h&&l){var y=t.xt.aa,v=y.layer;e=function(e){e===v?y.$e(i,t):e.$e(i,t,h,l)}}else e=function(e){e.$e(i,t,h,l)};for(o=0;o<p;o++)e(f[o]);t.Ny=!1,t.Ik?t.Ik.Rl(t)&&t.iy():t.Vq=function(){return new b(0,0)},te(t),Me(t),t.zf(f,p,t),Le(t)}function xe(t,i){var e=t.Ij;if(null!==e){if(void 0!==e.imageSmoothingEnabled){var n=!!e.imageSmoothingEnabled;i.xE=n,i.dL=n}void 0!==(e=e.defaultFont)&&null!==e&&(i.font=e,i.wu=e)}}function we(t){if(0===t.ma.uh&&0!==t.Dk.count){for(;0<t.Dk.count;){var i=t.Dk;for(t.Dk=new m(zr,M),i=i.i;i.next();){var e=i.key;$r(e,i.value),e.se()}}t.qa()}}function ke(t){!1===t.bm&&(t.bm=!0)}function Me(t){!1===t.Kk&&(t.Kk=!0)}function Pe(t){!1!==t.$q&&(t.$q=!1,Te(t,t.Gb,t.Lb))}function Te(t,i,e){var n=t.ub,o=i*(r=t.He),r=e*r;n.width===o&&n.height===r||(n.width=o,n.height=r,n.style.width=i+"px",n.style.height=e+"px",t.ke=!0,te(t))}function Se(t){var i=t.Gb,e=t.Lb;return t=t.ub.getBoundingClientRect(),xh.Ob(i/t.width*t.left,e/t.height*t.top)}function Ne(t){var i=t.ub;if(null===i)return!0;var e=t.Mb,n=t.Gb,o=t.Lb,r=t.tD.copy();if(!r.K())return!0;var s=!1,a=t.Hk?t.yd:0,h=t.sj?t.yd:0,l=e.clientWidth||n+a,e=e.clientHeight||o+h;l===n+a&&e===o+h||(t.Hk=!1,t.sj=!1,h=a=0,t.Gb=l,t.Lb=e,s=t.$q=!0),t.bm=!1;var u=t.tb,l=(b=t.Bd).width,e=b.height,f=u.width,c=u.height,p=b.x,d=u.x,y=b.right,v=u.right+a,g=b.y,m=u.y,b=b.bottom,u=u.bottom+h,x="1px",w="1px",k=t.scale;return t.GA===pu&&l<f+a&&e<c+h||(t.Uz&&t.ne&&(x=1,p+1<d&&(x=Math.max((d-p)*k+t.Gb,x)),y>v+1&&(x=Math.max((y-v)*k+t.Gb,x)),f+a+1<l&&(x=Math.max((l-f+a)*k+t.Gb,x)),x+="px"),t.Vz&&t.oe&&(w=1,g+1<m&&(w=Math.max((m-g)*k+t.Lb,w)),b>u+1&&(w=Math.max((b-u)*k+t.Lb,w)),c+h+1<e&&(w=Math.max((e-c+h)*k+t.Lb,w)),w+="px")),a="1px"!==x,h="1px"!==w,a&&h||!a&&!h||(h&&(v-=t.yd),a&&(u-=t.yd),t.Uz&&t.ne&&(x=1,p+1<d&&(x=Math.max((d-p)*k+t.Gb,x)),y>v+1&&(x=Math.max((y-v)*k+t.Gb,x)),f+1<l&&(x=Math.max((l-f)*k+t.Gb,x)),x+="px"),a="1px"!==x,h=a!==t.sj?t.Lb-t.yd:t.Lb,t.Vz&&t.oe&&(w=1,g+1<m&&(w=Math.max((m-g)*k+h,w)),b>u+1&&(w=Math.max((b-u)*k+h,w)),c+1<e&&(w=Math.max((e-c)*k+h,w)),w+="px"),h="1px"!==w),t.$v&&a===t.sj&&h===t.Hk?(n===t.Gb&&o===t.Lb||t.Uf(),!1):(a!==t.sj&&(t.Lb="1px"===x?t.Lb+t.yd:Math.max(t.Lb-t.yd,1),s=!0),t.sj=a,t.os.style.width=x,h!==t.Hk&&(t.Gb="1px"===w?t.Gb+t.yd:Math.max(t.Gb-t.yd,1),s=!0,t.sC&&(a=xh.M(),h?(i.style.left=t.yd+"px",t.position=a.m(t.mb.x+t.yd/t.scale,t.mb.y)):(i.style.left="0px",t.position=a.m(t.mb.x-t.yd/t.scale,t.mb.y)),xh.v(a))),t.Hk=h,t.os.style.height=w,i=t.dw,t.Uz&&t.ne&&(f+1<l?i.scrollLeft=(t.position.x-p)*k:p+1<d?i.scrollLeft=i.scrollWidth-i.clientWidth:y>v+1&&(i.scrollLeft=t.position.x*k)),t.Vz&&t.oe&&(c+1<e?i.scrollTop=(t.position.y-g)*k:g+1<m?i.scrollTop=i.scrollHeight-i.clientHeight:b>u+1&&(i.scrollTop=t.position.y*k)),s&&(t.$q=!0),l=t.Gb,e=t.Lb,i.style.width=l+(t.Hk?t.yd:0)+"px",i.style.height=e+(t.sj?t.yd:0)+"px",t.cz=!1,n===l&&o===e&&!t.Sa.vc||(u=t.tb,t.Wt(r,u,s),!1))}function Ce(t,i,e){if(xh.A(i,Yi,Qi,"addLayer:layer"),null!==i.g&&i.g!==t&&xh.k("Cannot share a Layer with another Diagram: "+i+" of "+i.g),null===e?null!==i.g&&xh.k("Cannot add an existing Layer to this Diagram again: "+i):(xh.A(e,Yi,Qi,"addLayer:existingLayer"),e.g!==t&&xh.k("Existing Layer must be in this Diagram: "+e+" not in "+e.g),i===e&&xh.k("Cannot move a Layer before or after itself: "+i)),i.g!==t){i=i.name,e=(t=t.Yb).count;for(var n=0;n<e;n++)t.ha(n).name===i&&xh.k("Cannot add Layer with the name '"+i+"'; a Layer with the same name is already present in this Diagram.")}}function je(t,i,e){if(t.Pc||t.Kd)t.Vb=e,(e=t.Sa).vc&&Ui(e,i,t.Vb);else if(t.Pc=!0,null===t.ub)t.Vb=e;else{var n=t.tb.copy(),o=t.Gb,r=t.Lb;n.width=t.Gb/i,n.height=t.Lb/i;var s=t.Sl.x,a=t.Sl.y,h=t.UD;isNaN(s)&&(h.$i()?h.jp(Wh)?s=0:h.jp(Xh)&&(s=o-1):s=h.ed()?h.x*(o-1):o/2),isNaN(a)&&(h.$i()?h.jp(Yh)?a=0:h.jp(Qh)&&(a=r-1):a=h.ed()?h.y*(r-1):r/2),null!==t.nF&&(e=t.nF(t,e)),e<t.fh&&(e=t.fh),e>t.eh&&(e=t.eh),o=xh.Ob(t.mb.x+s/i-s/e,t.mb.y+a/i-a/e),t.position=o,xh.v(o),t.Vb=e,t.Wt(n,t.tb),t.Pc=!1,oe(t,!1),(e=t.Sa).vc&&Ui(e,i,t.Vb),t.qa(),ke(t)}}function Le(t,i){void 0===i&&(i=null);var e=t.ld;if(null!==e&&e.visible){for(var n=xh.Pl(),o=1,r=1,s=e.Aa.n,a=s.length,h=0;h<a;h++){var l=s[h],u=l.interval;2>u||(ao(l.Cb)?r=r*u/hl.pE(r,u):o=o*u/hl.pE(o,u))}if(s=e.Ww,n.m(r*s.width,o*s.height),s=r=h=a=0,null!==i)a=i.width,h=i.height,r=i.x,s=i.y;else{for(o=xh.ag(),r=t.tb,o.m(r.x,r.y,r.width,r.height),s=t.Rv.i;s.next();)(r=s.value.tb).K()&&C(o,r.x,r.y,r.width,r.height);if(a=o.width,h=o.height,r=o.x,s=o.y,!o.K())return}e.width=a+2*n.width,e.height=h+2*n.height,o=xh.M(),hl.pt(r,s,0,0,n.width,n.height,o),o.offset(-n.width,-n.height),xh.ck(n),e.aa.location=o,xh.v(o)}}function De(t){if(0<(t=t.selection).count){for(var i=t.dc(),e=i.length,n=0;n<e;n++)i[n].jb=!1;t.Oa(),t.clear(),t.freeze()}}function Ae(t){var i=t.bi;t.uD!==i&&(t.uD=i,t.Ba("Modified"))}function Fe(t,i,e){if("string"==typeof e){if(null!==(n=t.ug(i)))n.Jb(e),t.Z instanceof Pt&&null!==(n=t.sf(i))&&n.Jb(e);else{for(var n=null,o=t.gm.i;o.next();){for(var r=o.value,s=0;s<r.length;s++){var a=r[s].AH(i);null!==a&&(null===n&&(n=xh.lb()),n.push(a))}if(null!==n)break}if(null!==n){for(o=0;o<n.length;o++)n[o].Jb(e);xh.ta(n)}}i===t.Z.gk&&t.QF(e)}}function ze(t,i){var e=i.wj;if(xh.isArray(e)){var n=t.gm.ka(e);if(null===n)(n=[]).push(i),t.gm.add(e,n);else{for(e=0;e<n.length;e++)if(n[e]===i)return;n.push(i)}}}function Oe(t,i){var e=i.wj;if(xh.isArray(e)){var n=t.gm.ka(e);if(null!==n)for(var o=0;o<n.length;o++)if(n[o]===i){n.splice(o,1),0===n.length&&t.gm.remove(e);break}}}function qe(t,i){for(var e=i.Aa.n,n=e.length,o=0;o<n;o++){var r=e[o];r instanceof Ho&&Be(t,r)}}function Be(t,i){if(null!==(e=i.element)&&e instanceof HTMLImageElement){var e=e.src,n=t.so.ka(e);if(null===n)(n=[]).push(i),t.so.add(e,n);else{for(e=0;e<n.length;e++)if(n[e]===i)return;n.push(i)}}}function Ee(t,i){for(var e=i.Aa.n,n=e.length,o=0;o<n;o++){var r=e[o];r instanceof Ho&&Ie(t,r)}}function Ie(t,i){if(null!==(e=i.element)&&e instanceof HTMLImageElement){var e=e.src,n=t.so.ka(e);if(null!==n)for(var o=0;o<n.length;o++)if(n[o]===i){n.splice(o,1),0===n.length&&t.so.remove(e);break}}}function Re(t,i){if(null!==i){for(var e=t.Z,n=xh.Xa(i),o=0;o<n;o++){var r=xh.Pa(i,o);e.Ke(r)?Ge(t,r,!1):e instanceof wt&&Je(t,r)}if(e instanceof wt||e instanceof Pt){for(o=0;o<n;o++)r=xh.Pa(i,o),e.Ke(r)&&He(t,r);if(e instanceof wt)for(e=t.links;e.next();)Or(e.value)}_e(t,!1)}}function Ge(t,i,e){if(void 0!==i&&null!==i&&!t.ma.kb&&!t.oi.contains(i)){void 0===e&&(e=!0);var n=t.Rz(i),o=Ve(t,i,n);if(null!==o&&(bo(o),null!==(o=o.copy()))){var r=t.we;t.we=!0,o.hi=n,o.je=i,t.add(o),o.je=null,o.data=i,e&&He(t,i),t.we=r}}}function Ve(t,i,e){var n=!1,o=t.Z;return o instanceof wt&&(n=o.Zz(i)),n?null===(i=t.Tz.ka(e))&&null===(i=t.Tz.ka(""))&&(gu||(gu=!0,xh.trace('No Group template found for category "'+e+'"'),xh.trace("  Using default group template")),i=t.MB):null===(i=t.qA.ka(e))&&null===(i=t.qA.ka(""))&&(vu||(vu=!0,xh.trace('No Node template found for category "'+e+'"'),xh.trace("  Using default node template")),i=t.OB),i}function He(t,i){var e=t.Z;if(e instanceof wt||e instanceof Pt){var n=e.ib(i);if(void 0!==n){var o=bt(e,n),r=t.ug(i);if(null!==o&&null!==r){for(o=o.i;o.next();){a=o.value;if(e instanceof wt){var s=e;if(s.Ke(a)){if(r instanceof vs&&s.Xm(a)===n){var a,h=r;null!==(a=t.ug(a))&&(a.Ta=h)}}else{var l=t.sf(a);if(null!==l&&r instanceof wr&&(h=r,s.vl(a)===n&&(l.V=h),s.yl(a)===n&&(l.ba=h),a=s.dk(a),xh.isArray(a)))for(s=0;s<xh.Xa(a);s++)if(xh.Pa(a,s)===n){h.fe=l;break}}}else e instanceof Pt&&(l=e).Ke(a)&&r instanceof wr&&(h=r,l.Ym(a)===n&&(a=t.Tw(a),Ke(t,h,a)))}mt(e,n)}e instanceof wt?void 0!==(e=e.Xm(i))&&(e=t.bf(e))instanceof vs&&(r.Ta=e):e instanceof Pt&&void 0!==(e=e.Ym(i))&&r instanceof wr&&(h=r,r=t.bf(e),Ke(t,r,h))}}}function Ke(t,i,e){if(null!==i&&null!==e){var n=t.cb.QE,o=i,r=e;if(t.Qd){for(i=r.ue;i.next();)if(i.value.ba===r)return}else for(o=e,r=i,i=o.ue;i.next();)if(i.value.V===o)return;if((null===n||!li(n,o,r,null,!0))&&(n=t.Vw(e.data),null!==(i=Ye(t,n))&&(bo(i),null!==(i=i.copy())))){var s=t.we;t.we=!0,i.hi=n,i.je=e.data,i.V=o,i.ba=r,t.add(i),i.je=null,i.data=e.data,t.we=s}}}function Ue(t,i){if(null!==i){for(var e=xh.Xa(i),n=0;n<e;n++){Je(t,xh.Pa(i,n))}_e(t,!1)}}function Je(t,i){if(void 0!==i&&null!==i&&!t.ma.kb&&!t.Ck.contains(i)){var e=t.Vw(i),n=Ye(t,e);if(null!==n&&(bo(n),null!==(n=n.copy()))){var o=t.we;t.we=!0,n.hi=e,n.je=i;if(""!==(r=(e=t.Z).JH(i))&&(n.vg=r),void 0!==(r=e.vl(i))&&(r=t.bf(r))instanceof wr&&(n.V=r),""!==(r=e.MH(i))&&(n.th=r),void 0!==(r=e.yl(i))&&(r=t.bf(r))instanceof wr&&(n.ba=r),e=e.dk(i),xh.isArray(e))for(var r=xh.Xa(e),s=0;s<r;s++){var a=xh.Pa(e,s);null!==(a=t.bf(a))&&(a.fe=n)}t.add(n),n.je=null,n.data=i,t.we=o}}}function Ye(t,i){var e=t.cA.ka(i);return null===e&&null===(e=t.cA.ka(""))&&(mu||(mu=!0,xh.trace('No Link template found for category "'+i+'"'),xh.trace("  Using default link template")),e=t.NB),e}function We(t,i){for(var e=xh.Xa(i),n=0;n<e;n++){Xe(t,xh.Pa(i,n))}}function Xe(t,i){if(void 0!==i&&null!==i){var e=t.ug(i);if(null!==e){e.jb=!1,e.dh=!1;var n=e.layer;if(null!==n&&n.g===t){var o=t.Z;if(o instanceof wt&&e instanceof wr){var r=e,s=o.ib(r.data);if(void 0!==s){for(var a=r.ue;a.next();)gt(o,s,a.value.data);if(r.vf&&null!==(a=r.fe)&&gt(o,s,a.data),r instanceof vs)for(r=r.Ic;r.next();)a=r.value.data,o.Ke(a)&&gt(o,s,a)}}else if(o instanceof Pt&&e instanceof wr){if(r=e,null!==(a=t.sf(r.data))){a.jb=!1,a.dh=!1;var h=a.layer;if(null!==h){var l=h.Oe(-1,a,!1);0<=l&&t.Lc(Pl,"parts",h,a,null,l,null),null!==(l=a.Jt)&&l(a,h,null)}}for(a=t.Qd,r=r.ue;r.next();)h=r.value,h=(a?h.ba:h.V).data,o.Ke(h)&&gt(o,s,h)}0<=(o=n.Oe(-1,e,!1))&&t.Lc(Pl,"parts",n,e,null,o,null),null!==(o=e.Jt)&&o(e,n,null)}}}}function Qe(t,i,e){for(var n in e){var o=i[n],r=e[n];if(xh.isArray(r)){if(!xh.isArray(o)||o.length<r.length)return!1;for(var s=0;s<o.length;s++){var a=o[s],h=r[s];if(void 0!==h&&!Ze(t,a,h))return!1}}else if(!Ze(t,o,r))return!1}return!0}function Ze(t,i,e){if("function"==typeof e){if(!e(i))return!1}else if(e instanceof RegExp){if(!i||!e.test(i.toString()))return!1}else if(xh.Va(i)&&xh.Va(e)){if(!Qe(t,i,e))return!1}else if(i!==e)return!1;return!0}function $e(t,i){t.tj=!1;var e=t.av;e.L(i)||(i=i.S(),t.av=i,oe(t,!1),t.Ba("DocumentBoundsChanged",null,e.copy()),ke(t))}function _e(t,i){for(var e=t.$k.i;e.next();)tn(t,e.value,i);null!==t.Rb&&(i?t.Rb.xf=!1:t.Rb.H())}function tn(t,i,e){if(null!==i){for(var n=i.oo.i;n.next();)tn(t,n.value,e);null!==i.Rb&&(e?i.Rb.xf=!1:i.Rb.H())}}function en(t,i){if(!t.uy){var e=t.Rb,n=t.Ra;t.Ra=!0;try{t.Sb("Layout");var o=t.Sa;1!==t.ma.uh||o.uf||o.vc||o.jn("Layout");for(var r=t.$k.i;r.next();)nn(t,r.value,i);e.xf||i&&!e.JE&&1!==t.ma.uh||(e.doLayout(t),ve(t),e.xf=!0)}finally{t.Ad("Layout"),t.Iu=!e.xf,t.Ra=n}}}function nn(t,i,e){if(null!==i){for(var n=i.oo.i;n.next();)nn(t,n.value,e);null===(n=i.Rb)||n.xf||e&&!n.JE||(i.Zy=!i.location.K(),n.doLayout(i),i.H(gf),n.xf=!0,ge(t,i))}}function on(t){function i(t){var i=t.toLowerCase(),o=new u("function");e.add(t,o),e.add(i,o),n.add(t,t),n.add(i,t)}var e=new m("string",u),n=new m("string","string");i("AnimationStarting"),i("AnimationFinished"),i("BackgroundSingleClicked"),i("BackgroundDoubleClicked"),i("BackgroundContextClicked"),i("ClipboardChanged"),i("ClipboardPasted"),i("DocumentBoundsChanged"),i("ExternalObjectsDropped"),i("InitialLayoutCompleted"),i("LayoutCompleted"),i("LinkDrawn"),i("LinkRelinked"),i("LinkReshaped"),i("Modified"),i("ObjectSingleClicked"),i("ObjectDoubleClicked"),i("ObjectContextClicked"),i("PartCreated"),i("PartResized"),i("PartRotated"),i("SelectionMoved"),i("SelectionCopied"),i("SelectionDeleting"),i("SelectionDeleted"),i("SelectionGrouped"),i("SelectionUngrouped"),i("ChangingSelection"),i("ChangedSelection"),i("SubGraphCollapsed"),i("SubGraphExpanded"),i("TextEdited"),i("TreeCollapsed"),i("TreeExpanded"),i("ViewportBoundsChanged"),t.wy=e,t.vy=n}function rn(t,i){var e=t.vy.ka(i);return null!==e?e:t.vy.ka(i.toLowerCase())}function sn(t,i){var e=t.wy.ka(i);return null!==e?e:null!==(e=t.wy.ka(i.toLowerCase()))?e:(xh.k("Unknown DiagramEvent name: "+i),null)}function an(t,i,e,n){if(null===t.wd&&(t.wd=new ns),t.wd.Ct||t.wd.group!==e||t.wd.NA!==n){if(null===e){(i=t.tj?ne(t):t.Bd.copy()).Qf(100,100),t.wd.initialize(i),i=xh.ag();for(var o=t.Ag;o.next();){var r=o.value,s=r.layer;null!==s&&s.visible&&!s.Gc&&hn(t,r,n,i)}}else for(e.Y.K()||e.rf(),(i=e.Y.copy()).Qf(20,20),t.wd.initialize(i),i=xh.ag(),o=e.Ic;o.next();)(r=o.value)instanceof wr&&hn(t,r,n,i);xh.ic(i),t.wd.group=e,t.wd.NA=n,t.wd.Ct=!1}else i&&as(t.wd);return t.wd}function hn(t,i,e,n){if(i!==e)if(i.isVisible()&&i.canAvoid()){e=i.getAvoidableRect(n),n=t.wd.Uo,i=t.wd.So;for(var o=e.x+e.width,r=e.y+e.height,s=e.x;s<o;s+=n){for(var a=e.y;a<r;a+=i)ss(t.wd,s,a);ss(t.wd,s,r)}for(a=e.y;a<r;a+=i)ss(t.wd,o,a);ss(t.wd,o,r)}else if(i instanceof vs)for(i=i.Ic;i.next();)(o=i.value)instanceof wr&&hn(t,o,e,n)}function ln(t,i){null===t.wd||t.wd.Ct||null!==i&&!i.canAvoid()||(t.wd.Ct=!0)}function un(t,i){t.Ku.assign(i),pn(t,t.Ku).od(t.position)?cn(t):fn(t)}function fn(t){-1===t.xn&&(t.xn=xh.setTimeout(function(){if(-1!==t.xn){cn(t);var i=t.P.event;if(null!==i){var e=pn(t,t.Ku);e.od(t.position)||(t.position=e,t.P.da=t.OF(t.Ku),t.Lx(i,null,i.target.U)||t.doMouseMove(),t.tj=!0,$e(t,t.Zg()),t.ke=!0,t.Uf(),fn(t))}}},t.tB))}function cn(t){-1!==t.xn&&(xh.clearTimeout(t.xn),t.xn=-1)}function pn(t,i){var e=t.position,n=t.JD;if(0>=n.top&&0>=n.left&&0>=n.right&&0>=n.bottom)return e;var o=t.tb,r=t.scale,o=xh.lk(0,0,o.width*r,o.height*r),s=xh.Ob(0,0);if(i.x>=o.x&&i.x<o.x+n.left){var a=0|(a=Math.max(t.du,1));s.x-=a,i.x<o.x+n.left/2&&(s.x-=a),i.x<o.x+n.left/4&&(s.x-=4*a)}else i.x<=o.x+o.width&&i.x>o.x+o.width-n.right&&(a=Math.max(t.du,1),a|=0,s.x+=a,i.x>o.x+o.width-n.right/2&&(s.x+=a),i.x>o.x+o.width-n.right/4&&(s.x+=4*a));return i.y>=o.y&&i.y<o.y+n.top?(a=Math.max(t.eu,1),a|=0,s.y-=a,i.y<o.y+n.top/2&&(s.y-=a),i.y<o.y+n.top/4&&(s.y-=4*a)):i.y<=o.y+o.height&&i.y>o.y+o.height-n.bottom&&(a=Math.max(t.eu,1),a|=0,s.y+=a,i.y>o.y+o.height-n.bottom/2&&(s.y+=a),i.y>o.y+o.height-n.bottom/4&&(s.y+=4*a)),s.od(hl.mk)||(e=new b(e.x+s.x/r,e.y+s.y/r)),xh.ic(o),xh.v(s),e}function dn(t,i){if(t.Sa.ci(),t.Uf(),null===t.ub)return null;"object"!=typeof i&&xh.k("properties argument must be an Object.");var e=!1,n=i.size||null,o=i.scale||null;void 0!==i.scale&&isNaN(i.scale)&&(o="NaN");var r=i.maxSize;void 0===i.maxSize&&(e=!0,r="svg"===i.context?new k(1/0,1/0):new k(2e3,2e3));var s=i.position||null,a=i.parts||null,h=void 0===i.padding?1:i.padding,l=i.background||null,u=i.omitTemporary;void 0===u&&(u=!0);var f=i.document||document,c=i.elementFinished||null,p=i.showTemporary;void 0===p&&(p=!u),void 0===(u=i.showGrid)&&(u=p),null!==n&&isNaN(n.width)&&isNaN(n.height)&&(n=null),"number"==typeof h?h=new j(h):h instanceof j||(h=new j(0)),h.left=Math.max(h.left,0),h.right=Math.max(h.right,0),h.top=Math.max(h.top,0),h.bottom=Math.max(h.bottom,0),t.On=!1,te(t);var d=new H(null,f),y=d.getContext("2d"),v=d;if(!(n||o||a||s))return d.width=t.Gb+Math.ceil(h.left+h.right),d.height=t.Lb+Math.ceil(h.top+h.bottom),"svg"===i.context&&(y=v=new O(d.Od,f,c))instanceof O&&(t.On=!0),be(t,y,h,new k(d.width,d.height),t.Vb,t.mb,a,l,p,u),t.On=!0,v;var g=t.ob.Lw,m=new b(0,0),x=t.Bd.copy();if(x.vJ(t.padding),p)for(var w=!0,w=t.Yb.n,P=w.length,T=0;T<P;T++){if((N=w[T]).visible&&N.Gc)for(var S=N.zb.n,N=S.length,C=0;C<N;C++){var L=S[C];L.$z&&L.isVisible()&&(L=L.Y).K()&&x.ei(L)}}if(m.x=x.x,m.y=x.y,null!==a){var D,w=!0;for((S=a.i).reset();S.next();)(P=S.value)instanceof tr&&(L=P,null!==(N=L.layer)&&!N.visible||null!==N&&!p&&N.Gc||!L.isVisible()||(L=L.Y).K()&&(w?(w=!1,D=L.copy()):D.ei(L)));w&&(D=new M(0,0,0,0)),x.width=D.width,x.height=D.height,m.x=D.x,m.y=D.y}return null!==s&&s.K()&&(m=s,o||(o=g)),w=S=0,null!==h&&(S=h.left+h.right,w=h.top+h.bottom),T=P=0,null!==n&&(P=n.width,T=n.height,isFinite(P)&&(P=Math.max(0,P-S)),isFinite(T)&&(T=Math.max(0,T-w))),D=s=0,null!==n&&null!==o?("NaN"===o&&(o=g),n.K()?(s=P,D=T):isNaN(T)?(s=P,D=x.height*o):(s=x.width*o,D=T)):null!==n?n.K()?(o=Math.min(P/x.width,T/x.height),s=P,D=T):isNaN(T)?(o=P/x.width,s=P,D=x.height*o):(o=T/x.height,s=x.width*o,D=T):null!==o?"NaN"===o&&r.K()?(o=Math.min((r.width-S)/x.width,(r.height-w)/x.height))>g?(o=g,s=x.width,D=x.height):(s=r.width,D=r.height):(s=x.width*o,D=x.height*o):(o=g,s=x.width,D=x.height),null!==h?(s+=S,D+=w):h=new j(0),null!==r&&(n=r.width,r=r.height,"svg"!==i.context&&e&&!bu&&(s>n||D>r)&&(xh.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(s)+"x"+Math.ceil(D)+" vs 2000x2000) Consider increasing the max size."),bu=!0),isNaN(n)&&(n=2e3),isNaN(r)&&(r=2e3),isFinite(n)&&(s=Math.min(s,n)),isFinite(r)&&(D=Math.min(D,r))),d.width=Math.ceil(s),d.height=Math.ceil(D),"svg"===i.context&&(y=v=new O(d.Od,f,c))instanceof O&&(t.On=!0),be(t,y,h,new k(Math.ceil(s),Math.ceil(D)),o,m,a,l,p,u),t.On=!0,v}function yn(){this.zG="63ad05bbe23a1786468a4c741b6d2",this.Dh=this.zG===this._tk||null}function vn(i,e){void 0!==e&&null!==e||xh.k("Diagram setup requires an argument DIV."),null!==i.Mb&&xh.k("Diagram has already completed setup."),"string"==typeof e?i.Mb=t.document.getElementById(e):e instanceof HTMLDivElement?i.Mb=e:xh.k("No DIV or DIV id supplied: "+e),null===i.Mb&&xh.k("Invalid DIV id; could not get element with id: "+e),void 0!==i.Mb.U&&xh.k("Invalid div id; div already has a Diagram associated with it."),"static"===t.getComputedStyle(i.Mb,null).position&&(i.Mb.style.position="relative"),i.Mb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)",i.Mb.style["-ms-touch-action"]="none",i.Mb.innerHTML="",i.Mb.U=i;var n=new H(i);n.Od.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.",void 0!==n.style&&(n.style.position="absolute",n.style.top="0px",n.style.left="0px","rtl"===t.getComputedStyle(i.Mb,null).getPropertyValue("direction")&&(i.sC=!0),n.style.zIndex="2",n.style.IL="none",n.style.webkitUserSelect="none",n.style.MozUserSelect="none"),i.Gb=i.Mb.clientWidth||1,i.Lb=i.Mb.clientHeight||1,i.ub=n,i.zh=n.getContext("2d");var o=i.zh;i.oG=(t.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1),i.He=i.computePixelRatio(),Te(i,i.Gb,i.Lb),i.iy=function(){return!0},i.Mb.insertBefore(n.Od,i.Mb.firstChild),(n=new H(null)).width=1,n.height=1,i.yy=n,i.ZB=n.getContext("2d"),n=xh.createElement("div"),o=xh.createElement("div"),n.style.position="absolute",n.style.overflow="auto",n.style.width=i.Gb+"px",n.style.height=i.Lb+"px",n.style.zIndex="1",o.style.position="absolute",o.style.width="1px",o.style.height="1px",i.Mb.appendChild(n),n.appendChild(o),n.onscroll=i.qG,n.onmousedown=i.GC,n.ontouchstart=i.GC,n.U=i,n.uG=!0,n.vG=!0,i.dw=n,i.os=o,i.BA=xh.YD(function(){i.Pj=null,i.qa()},300,!1),i.TF=xh.YD(function(){_i(i)},250,!1),i.preventDefault=function(t){return t.preventDefault(),!1},i.xp=function(t){if(i.isEnabled){i.dm=!0;var e=i.Sc;xh.an&&e.aj?(t.preventDefault(),t.simulated=!0,i.zs=t):(i.Sc=i.Pb,i.Pb=e,he(i,i,t,e,!0),i.Lx(t,null,t.target.U)||(i.doMouseMove(),i.Ya.isBeyondDragSize()&&(i.im=0),fe(e,t)))}},i.wp=function(t){if(i.isEnabled){i.dm=!0;var e=i.Sc;xh.an&&null!==i.zs?(i.zs=t,t.preventDefault()):xh.an&&400>t.timeStamp-i.jm?t.preventDefault():i.wv&&2===t.button?t.preventDefault():(i.Sc=i.Pb,i.Pb=e,he(i,i,t,e,!0),e.pl=!0,e.Ze=t.detail,i.ui=e,i.focus(),!0===e.Qq.simulated?(t.preventDefault(),t.simulated=!0):(Al=null,i.doMouseDown(),i.ui=i.ui.copy(),1===t.button?t.preventDefault():fe(e,t)))}},i.zp=function(t){if(i.isEnabled){i.dm=!0;var e=i.Sc;if(xh.an){if(400>t.timeStamp-i.jm)return void t.preventDefault();i.jm=t.timeStamp}xh.an&&null!==i.zs?(i.zs=null,t.preventDefault()):(i.Sc=i.Pb,i.Pb=e,he(i,i,t,e,!0),e.up=!0,e.Ze=t.detail,(xh.eI||xh.fI)&&(t.timeStamp-i.jm<i.qD&&!i.Ya.isBeyondDragSize()?i.im++:i.im=1,i.jm=t.timeStamp,e.Ze=i.im),e.bubbles=t.bubbles,t.target.U&&(e.Eg=t.target.U),i.yF(t,null,new b,e.Eg)||(i.doMouseUp(),cn(i),fe(e,t)))}},i.hh=function(t){if(i.isEnabled){var e=i.Sc;i.Sc=i.Pb,i.Pb=e,he(i,i,t,e,!0),e.bubbles=!0,e.nl=void 0!==t.wheelDelta?t.wheelDelta:-40*t.detail,i.doMouseWheel(),fe(e,t)}},i.yp=function(){if(i.isEnabled){i.dm=!1;var t=i.Ya;t.cancelWaitAfter(),t instanceof Di&&t.hideToolTip()}},i.JF=function(t){if(i.isEnabled){i.mw=!1,i.wv=!0;var e=i.Sc;i.Sc=i.Pb,i.Pb=e,le(i,t,t.targetTouches[0],e,1<t.touches.length),i.doMouseDown(),fe(e,t)}},i.IF=function(t){if(i.isEnabled){var e=i.Sc;i.Sc=i.Pb,i.Pb=e;var n=null;0<t.changedTouches.length?n=t.changedTouches[0]:0<t.targetTouches.length&&(n=t.targetTouches[0]),ue(i,t,n,e,1<t.touches.length),i.Lx(n||t,null,e.Eg)||i.doMouseMove(),fe(e,t)}},i.HF=function(e){if(i.isEnabled)if(i.mw)e.preventDefault();else{var n=i.Sc;if(i.Sc=i.Pb,i.Pb=n,1<e.touches.length)i.hp("hasGestureZoom")&&(i.Gy=!1);else{var o=null,r=null;if(0<e.changedTouches.length?r=e.changedTouches[0]:0<e.targetTouches.length&&(r=e.targetTouches[0]),n.g=i,n.Ze=1,null!==r){null!==(o=t.document.elementFromPoint(r.clientX,r.clientY))&&o.U instanceof Qi&&o.U!==i&&ce(o.U,r,n),ce(i,e.changedTouches[0],n);var s=r.screenX,a=r.screenY,h=i.wC;e.timeStamp-i.jm<i.qD&&!(25<Math.abs(h.x-s)||25<Math.abs(h.y-a))?i.im++:i.im=1,n.Ze=i.im,i.jm=e.timeStamp,i.wC.m(s,a)}n.sd=0,n.button=0,n.buttons=1,n.pl=!1,n.up=!0,n.nl=0,n.zc=!1,n.bubbles=!1,n.event=e,n.timestamp=Date.now(),n.Eg=null===o?e.target.U:o.U?o.U:null,n.ye=null,i.yF(r||e,null,new b,n.Eg)||i.doMouseUp(),fe(n,e),i.wv=!1}}},i.OI=function(t){if("touch"===t.pointerType){var e=i.QC;void 0===e[t.pointerId]&&(i.Uv++,e[t.pointerId]=t),i.Kf[0]=null,i.Kf[1]=null;for(var n in e)if(null===i.Kf[0])i.Kf[0]=e[n];else if(null===i.Kf[1]){i.Kf[1]=e[n];break}i.isEnabled&&(i.mw=!1,e=i.Sc,i.Sc=i.Pb,i.Pb=e,le(i,t,t,e,1<i.Uv),i.doMouseDown(),fe(e,t))}},i.RI=function(t){if("touch"===t.pointerType&&!(2>i.Uv)){var e=i.Kf;e[0].pointerId===t.pointerId&&(e[0]=t),e[1].pointerId===t.pointerId&&(e[1]=t),i.isEnabled&&(e=i.Sc,i.Sc=i.Pb,i.Pb=e,ue(i,t,t,e,!0),i.Lx(t,null,e.Eg)||(i.doMouseMove(),fe(e,t)))}},i.QI=function(t){if("touch"===t.pointerType){var e=i.QC;void 0!==e[t.pointerId]&&(i.Uv--,delete e[t.pointerId],null!==(e=i.Kf)[0]&&e[0].pointerId===t.pointerId&&(e[0]=null),null!==e[1]&&e[1].pointerId===t.pointerId&&(e[1]=null))}},te(i),function(i){var e=i.ub;e.addEventListener("touchstart",i.JF,!1),e.addEventListener("touchmove",i.IF,!1),e.addEventListener("touchend",i.HF,!1),e.addEventListener("mousemove",i.xp,!1),e.addEventListener("mousedown",i.wp,!1),e.addEventListener("mouseup",i.zp,!1),e.addEventListener("mousewheel",i.hh,!1),e.addEventListener("DOMMouseScroll",i.hh,!1),e.addEventListener("mouseout",i.yp,!1),e.addEventListener("keydown",i.mI,!1),e.addEventListener("keyup",i.nI,!1),e.addEventListener("selectstart",function(t){return t.preventDefault(),!1},!1),e.addEventListener("contextmenu",function(t){return t.preventDefault(),!1},!1),e.addEventListener("gesturechange",function(t){i.cb.gp===iu&&t.preventDefault()},!1),e.addEventListener("pointerdown",i.OI,!1),e.addEventListener("pointermove",i.RI,!1),e.addEventListener("pointerleave",i.QI,!1),t.addEventListener("resize",i.TF,!1)}(i)}function gn(t){1<arguments.length&&xh.k("Palette constructor can only take one optional argument, the DIV HTML element or its id."),Qi.call(this,t),this.$s=!0,this.fl=!1,this.bb=!0,this.UD=Dh,this.Rb=new Ls}function mn(t){1<arguments.length&&xh.k("Overview constructor can only take one optional argument, the DIV HTML element or its id."),Qi.call(this,t),this.Sa.isEnabled=!1,this.Pc=!0,this.Hj=null,this.dv=!0,this.nJ("drawShadows",!1);var i=new tr,e=new To;e.stroke="magenta",e.pb=2,e.fill="transparent",e.name="BOXSHAPE",i.Kl=!0,i.HA="BOXSHAPE",i.eA="BOXSHAPE",i.kF="BOXSHAPE",i.cursor="move",i.add(e),this.Xl=i,(e=new xr).type=Iu,e.gf=zh;var n=new ws;n.Rf=!0,e.add(n),(n=new To).Wj=zh,n.Cb="Rectangle",n.ya=new k(64,64),n.cursor="se-resize",n.alignment=Eh,e.add(n),i.iF=e,this.Hm=this.Xj=!1,this.pf=this.bt=!0,this.JD=0,this.kz=xh.createElement("canvas"),this.yG=this.kz.getContext("2d"),this.cb.Zd=new xn,this.cb.lF=new wn;var o=this;this.click=function(){var t=o.Hj;if(null!==t){var i=t.tb,e=o.P.da;t.position=new b(e.x-i.width/2,e.y-i.height/2)}},this.YE=function(){bn(o)},this.XE=function(){null!==o.Hj&&(o.pc(),o.qa())},this.gl=ru,this.Pc=!1}function bn(t){var i=t.Yg;if(null!==i){if(null!==(e=t.Hj)){t.ke=!0;var e=e.tb,n=i.gu,o=xh.Pl();o.m(e.width,e.height),n.ya=o,xh.ck(o),t=2/t.scale,n instanceof To&&(n.pb=t),i.location=new b(e.x-t/2,e.y-t/2)}}}function xn(){qt.call(this),this.Vk=null}function wn(){gi.call(this)}function kn(t){1<arguments.length&&xh.k("Brush constructor can take at most one optional argument, the Brush type."),xh.ec(this),this.D=!1,void 0===t?(this.ja=xu,this.An="black"):"string"==typeof t?(this.ja=xu,this.An=t):(this.ja=t,this.An="black");var i=this.ja;i===wu?(this.Bo=Dh,this.Qn=Bh):this.Qn=this.Bo=i===ku?zh:Ch,this.jw=0,this.ev=NaN,this.Jg=this.Tv=this.Ig=null,this.ny=this.oy=0}function Mn(){xh.ec(this),this.fa=30723,this.Rc=1,this.Tg=null,this.Qb="",this.nc=this.Kb=null,this.mb=new b(NaN,NaN).freeze(),this.nf=hl.fB,this.Ej=hl.Xp,this.Cj=hl.eG,this.me=new L,this.fq=new L,this.Rk=new L,this.Vb=this.bv=1,this.Ul=0,this.Th=Nu,this.wr=hl.Wp,this.md=new M(NaN,NaN,NaN,NaN).freeze(),this.mc=new M(NaN,NaN,NaN,NaN).freeze(),this.Qc=new M(0,0,NaN,NaN).freeze(),this.Js=this.Rq=this.ga=this.Yr=this.um=null,this.Ks=this.Sq=1/0,this.eq=this.Ce=jh,this.ls=0,this.Ji=1,this.nq=0,this.li=1,this.Ds=null,this.qs=-1/0,this.ps=0,this.rs=hl.mk,this.ss=Nf,this.zq="",this.sc=this.ia=null,this.yn=-1,this.tm=this.ys=this.ki=this.Bk=this.Ao=null}function Pn(t){null===t.ia&&(t.ia=new io)}function Tn(t,i,e,n,o,r,s){var a=.001,h=r.length;t.moveTo(i,e),a=o-e,0===(n-=i)&&(n=.001),o=a/n;for(var l=Math.sqrt(n*n+a*a),u=0,f=!0,c=0!==s;.1<=l;){if(c){for(a=r[u++%h],a-=s;0>a;)a+=r[u++%h],f=!f;c=!1}else a=r[u++%h];a>l&&(a=l);var p=Math.sqrt(a*a/(1+o*o));0>n&&(p=-p),i+=p,e+=o*p,f?t.lineTo(i,e):t.moveTo(i,e),l-=a,f=!f}}function Sn(t,i,e){var n=t.dp();if(null!==n)for(var o=t.sc.i;o.next();){var r=o.value,s=null;if(null!==r.mn){if(null===(s=St(r,n,t)))continue;r.Ox(t,s,e,null)}else if(r.It){var a=i.g;null===a||a.we||r.Ox(t,a.Z.gk,e,a)}else{var h=n.data;if(null===h)continue;null===(a=i.g)||a.we||r.Ox(t,h,e,a)}null!==s&&null!==(a=n.Rw(r.Ol))&&r.RF(a,s,e)}}function Nn(t,i,e,n,o){var r=t.md,s=t.Rk;s.reset(),En(t,s,i,e,n,o),t.Rk=s,r.x=i,r.y=e,r.width=n,r.height=o,s.Ft()||s.NF(r)}function Cn(t,i,e,n){return!1!==t.Cg&&(n.multiply(t.transform),e?t.xg(i,n):t.Om(i,n))}function jn(t,i,e,n,o){if(!1!==Yn(t)){var r=(s=t.margin).right+s.left,s=s.top+s.bottom;i=Math.max(i-r,0),e=Math.max(e-s,0),o=o||0,n=Math.max((n||0)-r,0),o=Math.max(o-s,0);var r=t.angle,s=0,s=t.ya,a=0;t.pb&&(a=t.pb),90===r||270===r?(i=isFinite(s.height)?s.height+a:i,e=isFinite(s.width)?s.width+a:e):(i=isFinite(s.width)?s.width+a:i,e=isFinite(s.height)?s.height+a:e);var s=n||0,a=o||0,h=t instanceof eo;switch(Rn(t,!0)){case Su:a=s=0,h&&(e=i=1/0);break;case Lu:isFinite(i)&&i>n&&(s=i),isFinite(e)&&e>o&&(a=e);break;case ju:isFinite(i)&&i>n&&(s=i),a=0,h&&(e=1/0);break;case Cu:isFinite(e)&&e>o&&(a=e),s=0,h&&(i=1/0)}var h=t.yf,l=t.gh;s>h.width&&l.width<h.width&&(s=h.width),a>h.height&&l.height<h.height&&(a=h.height),n=Math.max(s/t.scale,l.width),o=Math.max(a/t.scale,l.height),h.width<n&&(n=Math.min(l.width,n)),h.height<o&&(o=Math.min(l.height,o)),i=Math.min(h.width,i),e=Math.min(h.height,e),i=Math.max(n,i),e=Math.max(o,e),90!==r&&270!==r||(s=i,i=e,e=s,s=n,n=o,o=s),t.md.Oa(),t.vp(i,e,n,o),t.md.freeze(),t.md.K()||xh.k("Non-real measuredBounds has been set. Object "+t+", measuredBounds: "+t.md.toString()),Wn(t,!1)}}function Ln(t,i,e,n,o){var r=t.Y;if(r.x=i,r.y=e,r.width=n,r.height=o,!t.ya.K()){r=t.md,i=(e=t.margin).right+e.left;var s=e.top+e.bottom;switch(e=r.width+i,r=r.height+s,n+=i,o+=s,i=Rn(t,!0),e===n&&r===o&&(i=Su),i){case Su:(e>n||r>o)&&(Wn(t,!0),jn(t,e>n?n:e,r>o?o:r));break;case Lu:Wn(t,!0),jn(t,n,o,0,0);break;case ju:Wn(t,!0),jn(t,n,r,0,0);break;case Cu:Wn(t,!0),jn(t,e,o,0,0)}}}function Dn(t){t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0}function An(t,i){i.shadowOffsetX=t.fz,i.shadowOffsetY=t.gz,i.shadowBlur=t.Qh}function Fn(t,i,e){var n=t.mc;0===n.width||0===n.height||isNaN(n.x)||isNaN(n.y)||(null!==t.nc&&(qn(t,i,t.nc,!0,!0),t.nc instanceof kn&&t.nc.type===ku?(i.beginPath(),i.rect(n.x,n.y,n.width,n.height),zn(i,t.nc)):i.fillRect(n.x,n.y,n.width,n.height)),null!==t.Kb&&(qn(t,i,t.Kb,!0,!1),t.Kb instanceof kn&&t.Kb.type===ku?(i.beginPath(),i.rect(n.x,n.y,n.width,n.height),zn(i,t.Kb)):i.fillRect(n.x,n.y,n.width,n.height)),t.ak(i,e))}function zn(t,i){if(i instanceof kn&&i.type===ku&&!(t instanceof O)){var e=i.oy,n=i.ny;n>e?(t.scale(e/n,1),t.translate((n-e)/2,0)):e>n&&(t.scale(1,n/e),t.translate(0,(e-n)/2)),t.xu?t.clip():t.fill(),n>e?(t.translate(-(n-e)/2,0),t.scale(1/(e/n),1)):e>n&&(t.translate(0,-(e-n)/2),t.scale(1,1/(n/e)))}else t.xu?t.clip():t.fill()}function On(t){t.xu||t.stroke()}function qn(t,i,e,n,o){if(null!==e){var r=1,s=1;if("string"==typeof e)n?i.tn!==e&&(i.fillStyle=e,i.tn=e):i.un!==e&&(i.strokeStyle=e,i.un=e);else if(e.type===xu)e=e.color,n?i.tn!==e&&(i.fillStyle=e,i.tn=e):i.un!==e&&(i.strokeStyle=e,i.un=e);else{var a,r=(s=t.Ia).width,s=s.height;if(o)var h=t.Y,r=h.width,s=h.height;var l=i instanceof CanvasRenderingContext2D;if(l&&(e.Jg&&e.type===Mu||e.oy===r&&e.ny===s))a=e.Jg;else{var u=h=0,f=0,c=0,p=0,d=0,d=p=0;if(o&&(h=t.Y,r=h.width,s=h.height,p=h.x,d=h.y),h=e.start.x*r+e.start.offsetX,u=e.start.y*s+e.start.offsetY,f=e.end.x*r+e.end.offsetX,c=e.end.y*s+e.end.offsetY,h+=p,f+=p,u+=d,c+=d,e.type===wu?a=i.createLinearGradient(h,u,f,c):e.type===ku?(d=isNaN(e.lt)?Math.max(r,s)/2:e.lt,isNaN(e.nu)?(p=0,d=Math.max(r,s)/2):p=e.nu,a=i.createRadialGradient(h,u,p,f,c,d)):e.type===Mu?a=i.createPattern(e.pattern,"repeat"):xh.Ed(e.type,"Brush type"),e.type!==Mu&&null!==(t=e.ht))for(t=t.i;t.next();)a.addColorStop(t.key,t.value);l&&(e.Jg=a,e.oy=r,e.ny=s)}n?i.tn!==a&&(i.fillStyle=a,i.tn=a):i.un!==a&&(i.strokeStyle=a,i.un=a)}}}function Bn(t){if(0!=(2048&t.fa)==!0){var i=t.me;if(i.reset(),!t.mc.K()||!t.md.K())return void Un(t,!1);i.translate(t.mc.x,t.mc.y),i.translate(-t.Ca.x,-t.Ca.y);var e=t.Ia;En(t,i,e.x,e.y,e.width,e.height),Un(t,!1),Jn(t,!0)}0!=(4096&t.fa)==!0&&(null===(i=t.T)?(t.fq.set(t.me),t.bv=t.scale,Jn(t,!1)):null!==i.Xg&&((e=t.fq).reset(),i.Gg()?e.multiply(i.fq):null!==i.T&&e.multiply(i.T.fq),e.multiply(t.me),t.bv=t.scale*i.bv,Jn(t,!1)))}function En(t,i,e,n,o,r){if(1!==t.scale&&i.scale(t.scale),0!==t.angle){var s=zh;t.gf&&t.gf.ed()&&(s=t.gf);var a=xh.M();if(t instanceof tr&&t.bc!==t)for(e=t.bc,n=e.Ia,a.ku(n.x,n.y,n.width,n.height,s),e.Rk.xb(a),a.offset(-e.Ca.x,-e.Ca.y),s=e.T;null!==s&&s!==t;)s.Rk.xb(a),a.offset(-s.Ca.x,-s.Ca.y),s=s.T;else a.ku(e,n,o,r,s);i.rotate(t.angle,a.x,a.y),xh.v(a)}}function In(t){if(!1===Xn(t)){if(null!==t.T)t.T.Q();else{var i=t.g;null!==i&&(i.eg.add(t),t instanceof wr&&t.ff(),i.Re())}Qn(t,!0)}}function Rn(t,i){var e=t.stretch,n=t.T;return null!==n&&n.ja===Gu?Gn(t,n.dd(t.cc),n.cd(t.column),i):null!==n&&n.ja===Ru&&n.af()===t?Vn(t,Lu,i):e===Nu?null!==n?n.ja===Iu&&n.af()===t?Vn(t,Lu,i):(e=n.Md)===Nu?Vn(t,Su,i):Vn(t,e,i):Vn(t,Su,i):Vn(t,e,i)}function Gn(t,i,e,n){var o=t.stretch;if(o!==Nu)return Vn(t,o,n);var r=o=null;switch(i.stretch){case Cu:r=!0;break;case Lu:r=!0}switch(e.stretch){case ju:o=!0;break;case Lu:o=!0}return i=t.T.Md,null===o&&(o=i===ju||i===Lu),null===r&&(r=i===Cu||i===Lu),!0===o&&!0===r?Vn(t,Lu,n):!0===o?Vn(t,ju,n):!0===r?Vn(t,Cu,n):Vn(t,Su,n)}function Vn(t,i,e){if(e)return i;if(i===Su)return Su;if((e=t.ya).K())return Su;if(t=t.angle,!isNaN(e.width))if(90!==t&&270!==t){if(i===ju)return Su;if(i===Lu)return Cu}else{if(i===Cu)return Su;if(i===Lu)return ju}if(!isNaN(e.height))if(90!==t&&270!==t){if(i===Cu)return Su;if(i===Lu)return ju}else{if(i===ju)return Su;if(i===Lu)return Cu}return i}function Hn(t,i){t.fa=i?512|t.fa:-513&t.fa}function Kn(t,i){t.fa=i?1024|t.fa:-1025&t.fa}function Un(t,i){t.fa=i?2048|t.fa:-2049&t.fa}function Jn(t,i){t.fa=i?4096|t.fa:-4097&t.fa}function Yn(t){return 0!=(8192&t.fa)}function Wn(t,i){t.fa=i?8192|t.fa:-8193&t.fa}function Xn(t){return 0!=(16384&t.fa)}function Qn(t,i){t.fa=i?16384|t.fa:-16385&t.fa}function Zn(t){var i={value:null};return $n(t,i),i.value}function $n(t,i){var e=t.T;return!(null===e||!$n(e,i)&&t.visible)||(i.value=t,!1)}function _n(t){var i=t.aa;i instanceof wr&&(null===(t=t.g)||t.ma.kb||i.ff())}function to(t,e){if("string"==typeof e)if(t instanceof zo)t.text=e;else if(t instanceof To)t.Cb=e;else if(t instanceof Ho)t.source=e;else if(t instanceof eo){null!==(s=wh(eo,e))?t.type=s:xh.k("Unknown Panel type as an argument to GraphObject.make: "+e)}else t instanceof kn?null!==(s=wh(kn,e))?t.type=s:xh.k("Unknown Brush type as an argument to GraphObject.make: "+e):t instanceof K?null!==(s=wh(K,e))?t.type=s:xh.k("Unknown Geometry type as an argument to GraphObject.make: "+e):t instanceof Z?null!==(s=wh(Z,e))?t.type=s:xh.k("Unknown PathSegment type as an argument to GraphObject.make: "+e):xh.k("Unable to use a string as an argument to GraphObject.make: "+e);else if(e instanceof Mn)s=e,t instanceof eo||xh.k("A GraphObject can only be added to a Panel, not to: "+t),t.add(s);else if(e instanceof Mo){var o,r=e,s=t;r.de&&s.dd?o=s.dd(r.index):!r.de&&s.cd?o=s.cd(r.index):xh.k("A RowColumnDefinition can only be added to a Panel, not to: "+t),o.it(r)}else if(e instanceof i)t instanceof zr&&e.qe===zr?2==(2&e.value)?t.Cx=e:e===Cf||e===jf||e===Lf?t.Le=e:e===Df||e===Af||e===Ff?t.Ys=e:e!==Tf&&e!==Nf&&xh.k("Unknown Link enum value for a Link property: "+e):t instanceof eo&&e.qe===eo?t.type=e:t instanceof zo&&e.qe===zo?t.UF=e:t instanceof To&&(e===Su||e===Du||e===Au||e===Nu)?t.Qz=e:t instanceof Ho&&(e===Su||e===Du||e===Au)?t.VH=e:t instanceof Mn&&e.qe===zr?(s=t,0===e.name.indexOf("Orient")?s.fu=e:xh.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+e)):t instanceof Mn&&e.qe===Mn?t.stretch=e:t instanceof Mo&&e.qe===Mo?t.lu=e:t instanceof Qi&&e.qe===Qi?t.gl=e:t instanceof kn&&e.qe===kn?t.type=e:t instanceof K&&e.qe===K?t.type=e:t instanceof Z&&e.qe===Z?t.type=e:t instanceof Tt&&e.qe===Tt?t.mode=e:t instanceof et&&e.qe===et?t.xc=e:t instanceof Ea&&e.qe===Ea?0===e.name.indexOf("Alignment")?t.alignment=e:0===e.name.indexOf("Arrangement")?t.Nf=e:0===e.name.indexOf("Compaction")?t.compaction=e:0===e.name.indexOf("Path")?t.path=e:0===e.name.indexOf("Sorting")?t.sorting=e:0===e.name.indexOf("Style")?t.EJ=e:xh.k("Unknown enum value: "+e):t instanceof na&&e.qe===na?0===e.name.indexOf("Aggressive")?t.MG=e:0===e.name.indexOf("Cycle")?t.lH=e:0===e.name.indexOf("Init")?t.$H=e:0===e.name.indexOf("Layer")?t.oI=e:xh.k("Unknown enum value: "+e):t instanceof Ls&&e.qe===Ls?e===Qf||e===Zf||e===Wf||e===Xf?t.sorting=e:e===Jf||e===Yf?t.Nf=e:e===Uf||e===Kf?t.alignment=e:xh.k("Unknown enum value: "+e):t instanceof Ds&&e.qe===Ds?e===hc||e===lc||e===sc||e===ac||e===uc?t.sorting=e:e===oc||e===rc||e===ec||e===nc?t.direction=e:e===tc||e===_f||e===$f||e===ic?t.Nf=e:e===cc||e===fc?t.ox=e:xh.k("Unknown enum value: "+e):xh.k("No property to set for this enum value: "+e);else if(e instanceof Tt)t instanceof Mn?t.bind(e):t instanceof Mo?t.bind(e):xh.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof Q)t instanceof K?t.Wb.add(e):xh.k("A PathFigure can only be added to a Geometry, not to: "+t);else if(e instanceof Z)t instanceof Q?t.vb.add(e):xh.k("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof ks)t instanceof Qi?t.Rb=e:t instanceof vs?t.Rb=e:xh.k("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(s=0;s<e.length;s++)to(t,e[s]);else if("object"==typeof e&&null!==e)if(t instanceof kn){o=new n;for(s in e)r=parseFloat(s),isNaN(r)?o[s]=e[s]:t.addColorStop(r,e[s]);xh.hu(t,o)}else if(t instanceof Mo){void 0!==e.row?((void 0===(o=e.row)||null===o||1/0===o||isNaN(o)||0>o)&&xh.k("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+o),t.de=!0,t.index=o):void 0!==e.column&&((void 0===(o=e.column)||null===o||1/0===o||isNaN(o)||0>o)&&xh.k("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+o),t.de=!1,t.index=o),o=new n;for(s in e)"row"!==s&&"column"!==s&&(o[s]=e[s]);xh.hu(t,o)}else xh.hu(t,e);else xh.k('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}function io(){this.ni=this.Ni=this.Yp=this.aq=this.$p=this.Zp=this.Ci=this.Hr=this.Gr=this.Di=this.Ei=this.Fi=this.Jr=this.Ir=this.mi=this.si=this.ji=null}function eo(t){Mn.call(this),void 0===t?0===arguments.length?this.ja=Bu:xh.k("invalid argument to Panel constructor: undefined"):(xh.rb(t,eo,eo,"type"),this.ja=t),this.Aa=new u(Mn),this.We=hl.Wp,this.Mg=!1,this.ja===Uu&&(this.Mg=!0),this.ar=!1,this.Dq=jh,this.qi=Nu,this.ja===Gu&&no(this),this.No=Du,this.Wq=hl.cG,this.Xq=hl.mk,this.zk=this.je=null,this.nr=NaN,this.gg=this.wj=null,this.eo="category",this.fg=null,this.Pi=new M(NaN,NaN,NaN,NaN),this.Dm=null,this.Fh=!1,this.ms=null}function no(t){t.lj=hl.Wp,t.Ch=1,t.pi=null,t.am=null,t.Bh=1,t.Ah=null,t.$l=null,t.Ld=[],t.Gd=[],t.zm=Qu,t.Yl=Qu,t.Oi=0,t.zi=0}function oo(t,i,e,n){for(var o=n.length,r=t.Y,s=e?t.dd(0):t.cd(0),a=0;a<o;a++){var h=n[a];if(void 0!==h&&h!==s&&0!==h.Na){if(e){if(h.position>r.height)continue}else if(h.position>r.width)continue;var l=h.Np;isNaN(l)&&(l=e?t.Ch:t.Bh);if(null===(u=h.Mp)&&(u=e?t.pi:t.Ah),0!==l&&null!==u){qn(t,i,u,!1,!1);var u=!1,f=!0,c=h.lJ;null!==c&&(u=!0,void 0!==i.setLineDash?(i.setLineDash(c),i.lineDashOffset=t.nd):void 0!==i.webkitLineDash?(i.webkitLineDash=c,i.webkitLineDashOffset=t.nd):void 0!==i.mozDash?(i.mozDash=c,i.mozDashOffset=t.nd):f=!1),i.beginPath();var p=h.position+l;e?p>r.height&&(l-=p-r.height):p>r.width&&(l-=p-r.width),h=h.position+l/2,i.lineWidth=l,p=t.padding,e?(h+=p.top,l=p.left,p=r.width-p.right,u&&!f?Tn(i,l,h,p,h,c,0):(i.moveTo(l,h),i.lineTo(p,h))):(h+=p.left,l=p.top,p=r.height-p.bottom,u&&!f?Tn(i,h,l,h,p,c,0):(i.moveTo(h,l),i.lineTo(h,p))),i.stroke(),u&&(void 0!==i.setLineDash?(i.setLineDash(xh.vh),i.lineDashOffset=0):void 0!==i.webkitLineDash?(i.webkitLineDash=xh.vh,i.webkitLineDashOffset=0):void 0!==i.mozDash&&(i.mozDash=null,i.mozDashOffset=0))}}}}function ro(t,i,e,n,o){for(var r=n.length,s=t.Y,a=0;a<r;a++){var h=n[a];if(void 0!==h&&null!==h.background&&h.Jz!==o&&0!==h.Na){var l=e?s.height:s.width;if(!(h.position>l)){var u=h.qf(),f=h.Np;isNaN(f)&&(f=e?t.Ch:t.Bh);var c=h.Mp;null===c&&(c=e?t.pi:t.Ah),null===c&&(f=0),u-=f,(f=h.position+f)+(u+=h.Na)>l&&(u=l-f),0>=u||(l=t.padding,qn(t,i,h.background,!0,!1),e?i.fillRect(l.left,f+l.top,s.width-(l.left+l.right),u):i.fillRect(f+l.left,l.top,u,s.height-(l.top+l.bottom)))}}}}function so(t,i,e){if(0!=t%i)return!1;i=e.length;for(var n=0;n<i;n++)if(0==t%e[n])return!1;return!0}function ao(t){return"LineV"===t||"BarV"===t}function ho(t,i,e){if(e(t,i),i instanceof eo)for(var n=(i=i.Aa.n).length,o=0;o<n;o++)ho(t,i[o],e)}function lo(t,i){uo(t,t,i)}function uo(t,i,e){e(i);for(var n=(i=i.Aa.n).length,o=0;o<n;o++){var r=i[o];r instanceof eo&&uo(t,r,e)}}function fo(t,i,e){if(e(i),i instanceof eo)for(var n=(i=i.Aa.n).length,o=0;o<n;o++)fo(t,i[o],e)}function co(t,i,e){if(e(i))return i;if(i instanceof eo)for(var n=(i=i.Aa.n).length,o=0;o<n;o++){var r=co(t,i[o],e);if(null!==r)return r}return null}function po(t){for(var i=(t=t.Aa.n).length,e=0,n=0;n<i;n++){var o=t[n];if(o instanceof eo)e=Math.max(e,po(o));else if(o instanceof To){t:{if(!o.Oh)switch(o.Rn){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":o=0;break t}o=o.Uh/2*o.Cm*o.Yi()}e=Math.max(e,o)}}return e}function yo(t,i,e,n){for(var o=t.Aa.n,r=o.length;r--;){var s=o[r];if(s.visible){var a=s.Y,h=t.Ia;a.x>h.width||a.y>h.height||0>a.x+a.width||0>a.y+a.height||(s instanceof eo&&yo(s,i,e,n),null!==i&&(s=i(s)),null===s||null!==e&&!e(s)||n.add(s))}}}function vo(t){var i=t.B;return void 0!==i&&i!==jh||(i=null),null===i&&t instanceof To&&null!==(t=t.Ua)&&(i=t.B),null===i&&(i=Lh),i}function go(t){var i=t.C;return void 0!==i&&i!==jh||(i=null),null===i&&t instanceof To&&null!==(t=t.Ua)&&(i=t.C),null===i&&(i=Eh),i}function mo(t){return null!==(t=t.zk)&&t.D}function bo(t){var i=t.zk;if(null===i)null!==t.data&&xh.k("Template cannot have .data be non-null: "+t),t.zk=i=new u(Tt);else if(i.D)return;var e=new u(Mn);ho(t,t,function(t,n){var o=n.sc;if(null!==o)for(Kn(n,!1),o=o.i;o.next();){var r=o.value;if(r.mode===Nl&&Kn(n,!0),null!==r.mn){var s=St(r,t,n);null!==s&&(e.add(s),null===s.Ao&&(s.Ao=new u(Tt)),s.Ao.add(r))}i.add(r)}if(n instanceof eo&&n.type===Gu){if(0<n.Ld.length)for(o=n.Ld,r=o.length,s=0;s<r;s++){var a=o[s];if(void 0!==a&&null!==a.sc)for(var h=a.sc.i;h.next();){var l=h.value;l.ng=a,l.Hs=2,l.Io=a.index,i.add(l)}}if(0<n.Gd.length)for(o=n.Gd,r=o.length,s=0;s<r;s++)if(void 0!==(a=o[s])&&null!==a.sc)for(h=a.sc.i;h.next();)l=h.value,l.ng=a,l.Hs=1,l.Io=a.index,i.add(l)}});for(var n=e.i;n.next();){var o=n.value;if(null!==o.Ao){Kn(o,!0);for(var r=o.Ao.i;r.next();){var s=r.value;null===o.sc&&(o.sc=new u(Tt)),o.sc.add(s)}}o.Ao=null}for(n=i.i;n.next();)if(o=n.value,null!==(r=o.ng)){o.ng=null;var a=o.Nx,h=a.indexOf(".");0<h&&r instanceof eo&&(s=a.substring(0,h),a=a.substr(h+1),null!==(h=r.ae(s))?(r=h,o.Nx=a):xh.trace('Warning: unable to find GraphObject named "'+s+'" for Binding: '+o.toString())),r instanceof Mo?(o.Ol=xh.pd(r.T),r.T.yn=o.Ol):(o.Ol=xh.pd(r),r.yn=o.Ol)}i.freeze(),t instanceof tr&&t.Pd()&&(jn(t,1/0,1/0),t.Ec())}function xo(t){return!!(t.type===Iu||t.type===Ru||t.type===Ku||t.type===Gu&&0<t.Aa.length&&(t=t.Aa.ha(0)).Rf&&t instanceof eo&&(t.type===Vu||t.type===Hu))}function wo(t,i,e){if(!(void 0===i||null===i||0>e)){var n;n=function(t,i){if(null===i)return"";var e=t.eo,n="";if("function"==typeof e)n=e(i);else{if("string"!=typeof e||"object"!=typeof i)return"";if(""===e)return"";n=xh.sb(i,e)}return void 0===n?"":"string"==typeof n?n:(xh.k("Panel.getCategoryForItemData found a non-string category for "+i+": "+n),"")}(t,i);var o=t.lI,r=null;null!==o&&(r=o.ka(n)),null===r&&(Ju||(Ju=!0,xh.trace('No item template Panel found for category "'+n+'" on '+t),xh.trace("  Using default item template."),n=new eo,(o=new zo).bind(new Tt("text","",Cl)),n.add(o),Yu=n),r=Yu),null!==(n=r)&&(bo(n),n=n.copy(),"object"==typeof i&&(null===t.fg&&(t.fg=new m(Object,eo)),t.fg.add(i,n)),o=e,xo(t)&&o++,t.Cd(o,n),ko(t,o,e),n.je=null,n.data=i)}}function ko(t,i,e){for(t=t.Aa;i<t.length;){var n=t.ha(i);if(n instanceof eo){var o=i,r=e;n.type===Vu?n.cc=o:n.type===Hu&&(n.column=o),n.kI=r}i++,e++}}function Mo(){xh.ec(this),this.Tg=null,this.vv=!0,this.Oc=0,this.Xe=NaN,this.Fj=0,this.Dj=1/0,this.Ce=jh,this.mb=this.eb=0,this.sc=null,this.As=Wu,this.Th=Nu,this.ws=this.Kj=null,this.xs=NaN,this.Kb=this.Mh=null,this.xq=!1}function Po(t){if(t.lu===Wu){var i=t.Tg;return t.de?i.gJ:i.$G}return t.lu}function To(){Mn.call(this),this.Ua=null,this.Rn="None",this.Oh=!1,this.Uq=Nu,this.Zl=null,this.Dc=this.td="black",this.Uh=1,this.Eo="butt",this.Go="miter",this.Cm=10,this.Fo=null,this.nd=0,this.Mi=this.Li=jh,this.Vr=this.Ur=NaN,this.br=!1,this.Xr=null,this.Un=this.Ko="None",this.Zq=1}function So(t,i,e,n){if(!(4>(g=e.length))){for(var o=n.Ca,r=Math.max(1,o.width),o=o.height,s=e[0],a=e[1],h=0,l=0,u=0,f=0,c=0,p=0,d=f=0,y=xh.lb(),v=2;v<g;v+=2)h=e[v],l=e[v+1],u=h-s,f=l-a,0===u&&(u=.001),c=f/u,p=Math.atan2(f,u),f=Math.sqrt(u*u+f*f),y.push([u,p,c,f]),d+=f,s=h,a=l;s=e[0],a=e[1],u=n.Ca.width,n instanceof To&&(u-=n.pb),1>u&&(u=1);for(var g=0,h=e=u,v=0!==(l=r/2),m=0,u=(f=y[m])[0],p=f[1],c=f[2],f=f[3],b=0;.1<=d;){if(0===b&&(v?(h=e,g++,h-=l,d-=l,v=!1):(h=e,g++),0===h&&(h=1)),h>d)return void xh.ta(y);h>f?(b=h-f,h=f):b=0;var x=Math.sqrt(h*h/(1+c*c));if(0>u&&(x=-x),s+=x,a+=c*x,t.translate(s,a),t.rotate(p),t.translate(-r/2,-o/2),0===b&&n.ak(t,i),t.translate(r/2,o/2),t.rotate(-p),t.translate(-s,-a),d-=h,f-=h,0!==b){if(++m===y.length)return void xh.ta(y);u=(f=y[m])[0],p=f[1],c=f[2],f=f[3],h=b}}xh.ta(y)}}function No(t,i,e,n){if(!(4>(y=i.length))){var o=.001,r=e.length,s=i[0],a=i[1];if(4===y)Tn(t,s,a,i[2],i[3],e,n);else{t.moveTo(s,a);for(var h=o=0,l=0,u=0,f=0,c=u=0,p=xh.lb(),d=2;d<y;d+=2)o=i[d],h=i[d+1],l=o-s,u=h-a,0===l&&(l=.001),f=u/l,u=Math.sqrt(l*l+u*u),p.push([l,f,u]),c+=u,s=o,a=h;s=i[0],a=i[1];for(var y=!0,o=e[(i=0)%r],h=0!==n,l=(u=p[d=0])[0],f=u[1],u=u[2],v=0;.1<=c;){0===v&&(o=e[i%r],i++,h&&(n%=o,o-=n,h=!1)),o>c&&(o=c),o>u?(v=o-u,o=u):v=0;var g=Math.sqrt(o*o/(1+f*f));if(0>l&&(g=-g),s+=g,a+=f*g,y?t.lineTo(s,a):t.moveTo(s,a),c-=o,u-=o,0!==v){if(++d===p.length)return void xh.ta(p);l=(u=p[d])[0],f=u[1],u=u[2],o=v}else y=!y}xh.ta(p)}}}function Co(t,i,e,n){if(!1!==Yn(t)){t.md.Oa();var o=t.Uh;0===o&&n instanceof xr&&n.type===Ku&&n.gc instanceof To&&(o=n.gc.pb),o*=t.Vb,n instanceof zr&&null!==n.Ua?(i=n.Ua.nb,Nn(t,i.x-o/2,i.y-o/2,i.width+o,i.height+o)):Nn(t,-o/2,-o/2,i+o,e+o),t.md.freeze(),t.md.K()||xh.k("Non-real measuredBounds has been set. Object "+t+", measuredBounds: "+t.md.toString()),Wn(t,!1)}}function jo(t){var i=t.Qz;return t.Oh?i===Nu?Lu:i:i===Nu?hl.Wx[t.Cb].Md:i}function Lo(t,i,e,n,o){return t=e.x-t,i=e.y-i,(i=t*t+i*i)<n?(o.x=e.x,o.y=e.y,i):n}function Do(t,i,e,n,o,r,s,a,h){var l=!1,u=(o-s)*(i-n)-(r-a)*(t-e);return 0!==u&&(h.x=((o*a-r*s)*(t-e)-(o-s)*(t*n-i*e))/u,h.y=((o*a-r*s)*(i-n)-(r-a)*(t*n-i*e))/u,(t>e?t-e:e-t)<(i>n?i-n:n-i)?(o=i<n?i:n,t=i<n?n:i,(h.y>o||hl.Qa(h.y,o))&&(h.y<t||hl.Qa(h.y,t))&&(l=!0)):(o=t<e?t:e,t=t<e?e:t,(h.x>o||hl.Qa(h.x,o))&&(h.x<t||hl.Qa(h.x,t))&&(l=!0)),l)}function Ao(t,i,e,n){if(!t.xl(i,e,n))return!1;t=i.x,i=i.y;var o=e.x;e=e.y;var r=n.x;if(n=n.y,t===o){var s=0;return t=0,i<e?(s=i,t=e):(s=e,t=i),n>=s&&n<=t}return t<o?(s=t,t=o):s=o,r>=s&&r<=t}function Fo(t){var i=t.g;null!==i&&i.ma.kb||(t.fu=zf,"None"!==t.Ko?(t.ve=-1,t.Wj=Gh):"None"!==t.Un&&(t.ve=0,t.Wj=new D(1-Gh.x,Gh.y)))}function zo(){Mn.call(this),this.le="",this.Dc="black",this.Kg="13px sans-serif",this.zd="start",this.dr=!0,this.em=this.fm=!1,this.Xk=hf,this.Fm=af,this.Ev=this.Fe=0,this.Tn=this.Uy=this.Vy=null,this.Ok=new Vo,this.Oq=!1,this.of=this.Zk=this.Is=null,this.Nj=this.Mj=0,this.Bi=1/0,this.zv=0}function Oo(t,i){var e=t.Kg;null!==e&&i.wu!==e&&(i.font=e,i.wu=e)}function qo(t,i,e,n){i=i.replace(/^\s+|\s+$/g,"");var o=0,r=0,s=0,a=t.Kg,r=t.Mj+t.Nj,h=Math.max(0,Io(t)+r),s=t.Xk===lf?Ro(a):0;if(t.Fe>=t.Bi)return new k(0,h);if(t.Fm===rf){if(e.Qi=1,r=Eo(i,a),0===s||r<=n)return e.Ve=r,e.mf.push(e.Ve),e.De.push(i),new k(r,h);for(var l=Bo(i),u=Bo(i=i.substr(l.length)),r=Eo(l+u,a);0<u.length&&r<=n;)l+=u,i=i.substr(u.length),u=Bo(i),r=Eo((l+u).replace(/^\s+|\s+$/g,""),a);for(l+=u.replace(/^\s+|\s+$/g,""),n=Math.max(1,n-s);Eo(l,a)>n&&1<l.length;)l=l.substr(0,l.length-1);return l+=ef,s=Eo(l,a),e.mf.push(s),e.Ve=s,e.De.push(l),new k(s,h)}var f=0;for(0===i.length&&(f=1,e.mf.push(0),e.De.push(i));0<i.length;){for(l=Bo(i),i=i.substr(l.length);Eo(l,a)>n;){for(u=1,r=Eo(l.substr(0,u),a),s=0;r<=n;)u++,s=r,r=Eo(l.substr(0,u),a);if(1===u?(e.mf[t.Fe+f]=r,o=Math.max(o,r)):(e.mf[t.Fe+f]=s,o=Math.max(o,s)),1>--u&&(u=1),e.De[t.Fe+f]=l.substr(0,u),f++,l=l.substr(u),t.Fe+f>t.Bi)break}for(r=Eo(l+(u=Bo(i)),a);0<u.length&&r<=n;)l+=u,i=i.substr(u.length),u=Bo(i),r=Eo((l+u).replace(/^\s+|\s+$/g,""),a);if(""!==(l=l.replace(/^\s+|\s+$/g,""))&&(0===u.length?(e.mf.push(r),o=Math.max(o,r)):(s=Eo(l,a),e.mf.push(s),o=Math.max(o,s)),e.De.push(l),f++,t.Fe+f>t.Bi))break}return e.Qi=Math.min(t.Bi,f),e.Ve=Math.max(e.Ve,o),new k(e.Ve,h*e.Qi)}function Bo(t){for(var i=t.length,e=0;e<i&&" "!==t.charAt(e);)e++;for(;e<i&&" "===t.charAt(e);)e++;return e>=i?t:t.substr(0,e)}function Eo(t,i){return nf!==i&&(nf=of.font=i),of.measureText(t).width}function Io(t){if(null!==t.Tn)return t.Tn;var i=t.Kg;nf!==i&&(nf=of.font=i);var e=0;return void 0!==Zu[i]&&5e3>$u?e=Zu[i]:(e=1.3*of.measureText("M").width,Zu[i]=e,$u++),t.Tn=e}function Ro(t){nf!==t&&(nf=of.font=t);var i=0;return void 0!==_u[t]&&5e3>tf?i=_u[t]:(i=of.measureText(ef).width,_u[t]=i,tf++),i}function Go(t,i,e){var n=t.le.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),o=t.Mj+t.Nj,o=Math.max(0,Io(t)+o);if(0===n.length)return e.Ve=0,t.Fe=1,o;if(!t.gx){0<=(r=n.indexOf("\n",0))&&(n=n.substr(0,r))}for(var r=0,s=t.Fe=0,a=-1,h=!1;!h;)-1===(a=n.indexOf("\n",s))&&(a=n.length,h=!0),s<=a&&(s=n.substr(s,a-s),t.Fm!==rf?(e.Qi=0,s=qo(t,s,e,i),r+=s.height,t.Fe+=e.Qi):(qo(t,s,e,i),r+=o,t.Fe++),t.Fe===t.Bi&&(h=!0)),s=a+1;return t.Ev=r}function Vo(){this.Ve=this.Qi=0,this.mf=[],this.De=[]}function Ho(){Mn.call(this),this.Te=null,this.Cs="",this.Lj=hl.$F,this.Vn=Lu,this.Ho=this.Oj=this.of=null,this.My=!1,this.gv=!0,this.yo=null}function Ko(){var i=pf;if(0===i.length)for(var e=t.document.getElementsByTagName("canvas"),n=e.length,o=0;o<n;o++){var r=e[o];r.parentElement&&r.parentElement.U&&i.push(r.parentElement.U)}return i}function Uo(t,i){t.Oy=!0,t.lv=!1;for(var e=null,n=Ko(),o=n.length,r=0;r<o;r++){var s=n[r],a=s.so.ka(t.src);if(null!==a){for(o=a.length,r=0;r<o;r++)(e=a[r]).ya.K()||(s.PC.add(e),s.Re()),null!==e.Oj&&e.Oj(e,i);s.qa()}}}function Jo(t,i){t.lv=i;for(var e=null,n=Ko(),o=n.length,r=0;r<o;r++)if(null!==(e=n[r].so.ka(t.src))){for(var o=e.length,s=xh.lb(),r=0;r<o;r++)s.push(e[r]);for(r=0;r<o;r++)null!==(e=s[r]).of&&e.of(e,i);xh.ta(s)}}function Yo(t,i,e,n){var o=new H(null),r=o.getContext("2d"),s=1/i;o.width=e/i,o.height=n/i,i=new Wo(o.Od,i),e=t.Qo[t.Qo.length-1],r.setTransform(s*e.Fp,0,0,s*e.Fp,0,0),r.drawImage(e.source,0,0),t.Qo.push(i)}function Wo(t,i){this.source=t,this.Fp=i}function Xo(){this.o=new K,this.Tb=null}function Qo(t,i,e,n,o,r){null===t.o&&xh.k("StreamGeometryContext has been closed"),void 0!==o&&!0===o?(null===t.Tb&&xh.k("Need to call beginFigure first"),n=new Z(yl),n.I=i,n.J=e,t.Tb.vb.add(n)):(t.Tb=new Q,t.Tb.za=i,t.Tb.xa=e,t.Tb.Et=n,t.o.Wb.add(t.Tb)),void 0!==r&&(t.Tb.ao=r)}function Zo(t){null===t.o&&xh.k("StreamGeometryContext has been closed"),null===t.Tb&&xh.k("Need to call beginFigure first");var i=t.Tb.vb.length;0<i&&t.Tb.vb.ha(i-1).close()}function $o(t,i,e,n,o,r,s,a){void 0===a&&(a=!1),null===t.o&&xh.k("StreamGeometryContext has been closed"),null===t.Tb&&xh.k("Need to call beginFigure first");var h=new Z(gl);h.rc=i,h.Kc=e,h.nh=n,h.oh=o,h.I=r,h.J=s,a&&h.close(),t.Tb.vb.add(h)}function _o(t,i,e,n,o){var r;void 0===r&&(r=!1),null===t.o&&xh.k("StreamGeometryContext has been closed"),null===t.Tb&&xh.k("Need to call beginFigure first");var s=new Z(ml);s.rc=i,s.Kc=e,s.I=n,s.J=o,r&&s.close(),t.Tb.vb.add(s)}function tr(t){0===arguments.length?eo.call(this):eo.call(this,t),this.R=311807,this.Nk=this.hi="",this.js=this.fs=this.ts=this.pr=null,this.vs="",this.fi=this.us=this.Am=null,this.hs="",this.uo=null,this.gs=hl.fB,this.ks="",this.vo=null,this.le="",this.Av=this.rq=this.Ak=null,this.Ai=new b(NaN,NaN).freeze(),this.ur="",this.Sk=null,this.vr=Lh,this.Er=hl.YF,this.xr=hl.XF,this.Lq=null,this.qr=mf,this.Bm=hl.bG,this.Vg="gray",this.Qh=4,this.xC=-1,this.Us=NaN,this.hG=new M,this.pm=null,this.Bj=NaN}function ir(t){0!=(16384&t.R)!=!1&&(t.updateAdornments(),t.R&=-16385)}function er(t){if(!1===fr(t)){var i=t.g;null!==i&&(i.eg.add(t),t instanceof wr&&!i.ma.kb&&t.ff()),cr(t,!0),t.vi()}}function nr(t){if(!1!==fr(t)){var i=t.position,e=t.location;e.K()&&i.K()||ar(t,i,e);var n=(e=t.mc).copy();e.Oa(),e.x=i.x,e.y=i.y,e.freeze(),t.qx(n,e),cr(t,!1)}}function or(t,i,e,n){void 0===n&&(n=new b),e=e.te()?zh:e;var o=i.Ia;if(n.m(o.width*e.x+e.offsetX,o.height*e.y+e.offsetY),null===i||i===t)return n;for(i.transform.xb(n),i=i.T;null!==i&&i!==t;)i.transform.xb(n),i=i.T;return t.Rk.xb(n),n.offset(-t.md.x,-t.md.y),n}function rr(t,i){var e,n=t.hG;isNaN(t.Bj)&&(t.Bj=po(t));o=2*(e=t.Bj);if(!t.El)return n.m(i.x-1-e,i.y-1-e,i.width+2+o,i.height+2+o),n;e=i.x;var o=i.y,r=i.width,s=i.height,a=t.shadowBlur,h=t.pJ,r=r+a,s=s+a;return e-=a/2,o-=a/2,0<h.x?r+=h.x:(e+=h.x,r-=h.x),0<h.y?s+=h.y:(o+=h.y,s-=h.y),n.m(e-1,o-1,r+2,s+2),n}function sr(t,i,e,n){null===i||t instanceof xr||(i=t.g.Sa).vc&&qi(i,t,"position",n.copy(),e.copy(),!1)}function ar(t,i,e){var n=xh.M(),o=t.gf,r=t.bc;o.te()&&xh.k("determineOffset: Part's locationSpot must be real: "+o.toString());var s=r.Ia,a=r instanceof To?r.pb:0;if(n.ku(0,0,s.width+a,s.height+a,o),r!==t)for(n.offset(-a/2,-a/2),r.transform.xb(n),o=r.T;null!==o&&o!==t;)o.transform.xb(n),o=o.T;t.Rk.xb(n),n.offset(-t.md.x,-t.md.y),o=t.g,e.K()?(r=i.x,s=i.y,i.m(e.x-n.x,e.y-n.y),null!==o&&(e=o.Sa,(a=e.uj)||!e.vc||t instanceof xr||qi(e,t,"position",new b(r,s),i,!1),a||i.x===r&&i.y===s||(a=o.wb,o.wb=!0,t.h("position",new b(r,s),i),o.wb=a))):i.K()&&(r=e.copy(),e.m(i.x+n.x,i.y+n.y),e.L(r)||null===o||(a=o.wb,o.wb=!0,t.h("location",r,e),o.wb=a)),xh.v(n),t.vi()}function hr(t,i,e){pr(t,!1),t instanceof wr&&ln(e,t),t.layer.Gc||i||e.pc(),i=t.mc;var n=e.tb;n.K()?(dr(t)?N(i,n)||t.zf(!1):i.xg(n)&&t.zf(!0),t.updateAdornments()):e.Kk=!0}function lr(t,i){var e=t.mc;if(0!==e.width&&0!==e.height&&!isNaN(e.x)&&!isNaN(e.y)&&t.isVisible()){var n=t.transform;null!==t.nc&&(qn(t,i,t.nc,!0,!0),i.fillRect(e.x,e.y,e.width,e.height)),null===t.nc&&null===t.Kb&&(qn(t,i,"rgba(0,0,0,0.4)",!0,!1),i.fillRect(e.x,e.y,e.width,e.height)),null!==t.Kb&&(n.Ft()||i.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),e=t.Ia,qn(t,i,t.Kb,!0,!1),i.fillRect(0,0,e.width,e.height),n.Ft()||(e=1/(n.m11*n.m22-n.m12*n.m21),i.transform(n.m22*e,-n.m12*e,-n.m21*e,n.m11*e,e*(n.m21*n.dy-n.m22*n.dx),e*(n.m12*n.dx-n.m11*n.dy))))}}function ur(t,i,e,n){i.constructor===t.constructor||bf||(bf=!0,xh.trace('Should not change the class of the Part when changing category from "'+e+'" to "'+n+'"'),xh.trace("  Old class: "+xh.df(t)+", new class: "+xh.df(i)+", part: "+t.toString())),t.et();var o=t.data;e=t.Tf;var r=t.jb,s=t.dh,a=!0,h=!0,l=!1;if(t instanceof wr)var u=t,a=u.bj,h=u.qd,l=u.su;i.Zh(t),i.cloneProtected(t),t.hi=n,t.Q(),t.qa(),n=!0,null!==(i=t.g)&&(n=i.wb,i.wb=!0),t.je=o,null!==o&&t.Jb(),null!==i&&(i.wb=n),(o=t.Tf)!==e&&(t.Nk=e,t.Tf=o),t instanceof wr&&(u=t,u.bj=a,u.qd=h,u.su=l,u.Pd()&&u.H(64)),t.jb=r,t.dh=s}function fr(t){return 0!=(32768&t.R)}function cr(t,i){t.R=i?32768|t.R:-32769&t.R}function pr(t,i){t.R=i?65536|t.R:-65537&t.R}function dr(t){return 0!=(131072&t.R)}function yr(t,i){t.R=i?1048576|t.R:-1048577&t.R}function vr(t,i){var e=i.Ta;return null!==e?1+vr(t,e):i instanceof wr&&null!==(e=i.fe)?vr(t,e):0}function gr(t,i){var e=i.Ta;return null!==e?gr(t,e):i instanceof wr&&null!==(e=i.fe)?gr(t,e):i}function mr(t,i,e){if(i===e||null===e)return!1;var n=i.Ta;return!(null===n||n!==e&&!mr(t,n,e))||i instanceof wr&&null!==(i=i.fe)&&mr(t,i,e)}function br(t){return!!t.isVisible()&&(null===(t=t.layer)||!t.Gc)}function xr(t){0===arguments.length?tr.call(this,Bu):tr.call(this,t),this.R&=-257,this.Nk="Adornment",this.Ib=this.Hg=this.Fb=null}function wr(t){0===arguments.length?tr.call(this,Bu):tr.call(this,t),this.fc=new u(zr),this.fo=this.Qk=this.sr=this.rr=null,this.jr=!0,this.Rs=!1,this.Ms=null,this.jq=this.kr=!0,this.kq=hl.dG,this.Wd=this.wh=null,this.Zr=Mf,this.Uj=!1}function kr(t,i){null!==i&&(null===t.wh&&(t.wh=new c(es)),t.wh.add(i))}function Mr(t,i,e,n){if(null===i||null===t.wh)return null;for(var o=t.wh.i;o.next();){var r=o.value;if(r.Bp===t&&r.Tt===i&&r.ux===e&&r.vx===n||r.Bp===i&&r.Tt===t&&r.ux===n&&r.vx===e)return r}return null}function Pr(t,i){if(null!==i){i.um=null;var e=t.Ta;null===e||e.ee||Pr(e,e.ql(""))}}function Tr(t,i,e){if(Pr(t,e),!t.fc.contains(i)){t.fc.add(i);var n=t.rI;if(null!==n){var o=!0,r=t.g;null!==r&&(o=r.Ra,r.Ra=!0),n(t,i,e),null!==r&&(r.Ra=o)}i.Hc&&(e=i.V,i=i.ba,null!==e&&null!==i&&e!==i&&(n=!0,null!==(r=t.g)&&(n=r.Qd),t=n?i:e,o=n?e:i,t.Uj||(t.Uj=o),!o.bj||null!==r&&r.ma.kb||(n?e===o&&(o.bj=!1):i===o&&(o.bj=!1))))}}function Sr(t,i,e){if(Pr(t,e),t.fc.remove(i)){var n=t.sI,o=t.g;if(null!==n){var r=!0;null!==o&&(r=o.Ra,o.Ra=!0),n(t,i,e),null!==o&&(o.Ra=r)}i.Hc&&(e=!0,null!==o&&(e=o.Qd),t=e?i.ba:i.V,i=e?i.V:i.ba,null!==t&&(t.Uj=!1),null===i||i.bj||(0===i.fc.count?(i.Uj=null,null!==o&&o.ma.kb||(i.bj=!0)):Nr(i)))}}function Nr(t){if(t.Uj=!1,0!==t.fc.count){var i=!0,e=t.g;if(null===e||!e.ma.kb){for(null!==e&&(i=e.Qd),e=t.fc.i;e.next();){var n=e.value;if(n.Hc)if(i){if(n.V===t)return void(t.bj=!1)}else if(n.ba===t)return void(t.bj=!1)}t.bj=!0}}}function Cr(t){null===t.Wd?t.Wd=new m("string",Mn):t.Wd.clear(),ho(t,t,function(t,i){var e=i.Sd;null!==e&&t.Wd.add(e,i)}),0===t.Wd.count&&t.Wd.add("",t)}function jr(t,i,e){var n=i.Sd;if(null!==n&&(null!==t.Wd&&t.Wd.remove(n),null!==(i=t.g)&&e)){for(e=null,n=t.iE(n);n.next();)t=n.value,null===e&&(e=xh.lb()),e.push(t);if(null!==e){for(n=0;n<e.length;n++)t=e[n],i.remove(t);xh.ta(e)}}}function Lr(t,i){var e=i.rl();return null===e?0:1+Lr(t,e)}function Dr(t,i,e,n,o,r,s){if(1<n)for(var a=e?t.Sw():t.tg();a.next();){var h=a.value;h.Hc&&(null===(h=h.Sz(t))||h===t||i.contains(h)||(i.add(h),Dr(h,i,e,n-1,o,r,s)))}else Ar(t,i,e,o,r,s)}function Ar(t,i,e,n,o,r){for(var s=o===t||t.qd,a=e?t.Sw():t.tg();a.next();){var h=a.value;h.Hc&&(null===(h=h.Sz(t))||h===t||i.contains(h)||(i.add(h),s&&(r&&Hi(n,h,o),h.zl(),h.rd(!1)),h.qd&&(h.su=h.qd,Ar(h,i,e,n,o,r))))}t.qd=!1}function Fr(t,i,e,n,o,r,s){for(var a=r!==t&&t.qd,h=e?t.Sw():t.tg();h.next();){var l=h.value;l.Hc&&(a||l.Mf||l.jc(),null!==(l=l.Sz(t))&&l!==t&&!i.contains(l)&&(i.add(l),a||(l.rd(!0),l.zl(),s&&Vi(o,l,r)),2<n||l.su))&&(l.su=!1,Fr(l,i,e,n-1,o,r,s))}t.qd=!0}function zr(){tr.call(this,Ku),this.dg=null,this.Eh="",this.og=this.Tq=null,this.Vh="",this.Ls=null,this.es=this.ds=this.cs=!1,this.lr=!0,this.cq=Nf,this.wq=0,this.Aq=Nf,this.Bq=NaN,this.wm=Tf,this.Bs=.5,this.Ee=null,this.Zc=new u(b).freeze(),this.wo=this.Ge=null,this.Mf=!1,this.Wv=null,this.iz=!1,this.Hg=this.Ln=this.Hn=this.gi=this.ti=this.Ua=null,this.lz=new b,this.gD=this.eD=null,this.my=!1,this.ga=null}function Or(t){var i=t.V,e=t.ba;null!==i&&null!==e?qr(t,i.zH(e)):qr(t,null)}function qr(t,i){var e=t.Ak;if(e!==i){null!==e&&ms(e,t),t.Ak=i,null!==i&&gs(i,t);var n=t.TD;if(null!==n){var o=!0,r=t.g;null!==r&&(o=r.Ra,r.Ra=!0),n(t,e,i),null!==r&&(r.Ra=o)}!t.Mf||t.eD!==e&&t.gD!==e||t.jc()}}function Br(t,i){null===t.Ee&&(t.Ee=new c(wr)),t.Ee.add(i),t.Q()}function Er(t){0===t.Zc.count?t.Mf=!1:(t.Mf=!0,t.Hn=t.l(0).copy(),t.Ln=t.l(t.pa-1).copy(),Zr(t,!1))}function Ir(t,i){return Math.abs(i.x-t.x)>Math.abs(i.y-t.y)?(i.x=i.x>=t.x?t.x+9e9:t.x-9e9,i.y=t.y):(i.y=i.y>=t.y?t.y+9e9:t.y-9e9,i.x=t.x),i}function Rr(t,i){var e=i.um;return null===e&&(e=new fs,e.port=i,e.Jc=i.aa,i.um=e),ps(e,t)}function Gr(t,i){if(null===i)return zh;var e=t.Ab;return e.Uc()&&(void 0===i&&(i=t.bd),null!==i&&(e=i.Ab)),e===jh?Ch:e}function Vr(t,i){if(null===i)return zh;var e=t.Bb;return e.Uc()&&(void 0===i&&(i=t.Fd),null!==i&&(e=i.Bb)),e===jh?Ch:e}function Hr(t){var i=t.wt;return isNaN(i)&&null!==(t=t.bd)&&(i=t.wt),isNaN(i)?0:i}function Kr(t){var i=t.qu;return isNaN(i)&&null!==(t=t.Fd)&&(i=t.qu),isNaN(i)?0:i}function Ur(t,i,e,n,o,r){var s=i.Uo,a=i.So,h=rs(i,e,n),l=e,u=n;for(0===o?l+=s:90===o?u+=a:180===o?l-=s:u-=a;1<h&&rs(i,l,u)===h-1;)e=l,n=u,0===o?l+=s:90===o?u+=a:180===o?l-=s:u-=a,h-=1;r?1<h&&(180===o||0===o?e=Math.floor(e/s)*s+s/2:90!==o&&270!==o||(n=Math.floor(n/a)*a+a/2)):(e=Math.floor(e/s)*s+s/2,n=Math.floor(n/a)*a+a/2),1<h&&(r=o,l=e,u=n,0===o?(r=90,u+=a):90===o?(r=180,l-=s):180===o?(r=270,u-=a):270===o&&(r=0,l+=s),rs(i,l,u)===h-1?Ur(t,i,l,u,r,!1):(l=e,u=n,0===o?(r=270,u-=a):90===o?(r=0,l+=s):180===o?(r=90,u+=a):270===o&&(r=180,l-=s),rs(i,l,u)===h-1&&Ur(t,i,l,u,r,!1))),t.dl(e,n)}function Jr(t,i,e,n){return t=e-t,isNaN(t)||1/0===t||-1/0===t?NaN:(0>t&&(t=-t),i=n-i,isNaN(i)||1/0===i||-1/0===i?NaN:(0>i&&(i=-i),hl.Qa(t,0)?i:hl.Qa(i,0)?t:Math.sqrt(t*t+i*i)))}function Yr(t,i,e,n){var o=t.pa;if(!(2>o))if(e){var r=t.l(1);e=r.x-n.x,n=r.y-n.y,0!==(r=Jr(i.x,i.y,e,n))&&(o=2===o?.5*r:r,(t=Hr(t))>o&&(t=o),e=t*(e-i.x)/r,t=t*(n-i.y)/r,i.x+=e,i.y+=t)}else r=t.l(o-2),e=r.x-n.x,n=r.y-n.y,0!==(r=Jr(i.x,i.y,e,n))&&(o=2===o?.5*r:r,(t=Kr(t))>o&&(t=o),e=t*(i.x-e)/r,t=t*(i.y-n)/r,i.x-=e,i.y-=t)}function Wr(t,i,e,n){for(var o=t.pa,r=i;hl.Qa(i.x,r.x)&&hl.Qa(i.y,r.y);){if(e>=o)return o-1;r=t.l(e++)}if(!hl.Qa(i.x,r.x)&&!hl.Qa(i.y,r.y))return e-1;for(var s=r;hl.Qa(i.x,r.x)&&hl.Qa(r.x,s.x)&&(!n||(i.y>=r.y?r.y>=s.y:r.y<=s.y))||hl.Qa(i.y,r.y)&&hl.Qa(r.y,s.y)&&(!n||(i.x>=r.x?r.x>=s.x:r.x<=s.x));){if(e>=o)return o-1;s=t.l(e++)}return e-2}function Xr(t,i,e,n,o,r,s){if(!s&&Qr(t)){s=[];var a=0;t.isVisible()&&(a=function(t,i,e,n){var o=t.g;if(null===o||i.L(e))return 0;for(o=o.kx;o.next();){if(null!==(r=o.value)&&r.visible)for(var r=r.zb.n,s=r.length,a=0;a<s;a++){var h=r[a];if(h instanceof zr){if(h===t)return 0<n.length&&n.sort(function(t,i){return t-i}),n.length;if(h.isVisible()&&Qr(h)){var l=h.ln;l.K()&&t.ln.xg(l)&&!t.usesSamePort(h)&&null!==(l=h.path)&&l.Fl()&&function(t,i,e,n){for(var o=hl.G(t.y,i.y),r=n.pa,s=n.l(0),a=xh.M(),h=1;h<r;h++){var l=n.l(h);if(h<r-1){u=n.l(h+1);s.y===l.y&&l.y===u.y?(l.x>s.x&&u.x>l.x||l.x<s.x&&u.x<l.x)&&(l=u,h++):s.x===l.x&&l.x===u.x&&(l.y>s.y&&u.y>l.y||l.y<s.y&&u.y<l.y)&&(l=u,h++)}t:{var u=a,f=t.x,c=t.y,p=i.x,d=i.y,y=s.x,s=s.y,v=l.x,g=l.y;if(hl.G(f,p)){if(!hl.G(c,d)&&hl.G(s,g)&&Math.min(c,d)<s&&Math.max(c,d)>s&&Math.min(y,v)<f&&Math.max(y,v)>f&&!hl.G(y,v)){u.x=f,u.y=s,u=!0;break t}}else if(hl.G(c,d)&&hl.G(y,v)&&Math.min(f,p)<y&&Math.max(f,p)>y&&Math.min(s,g)<c&&Math.max(s,g)>c&&!hl.G(s,g)){u.x=y,u.y=c,u=!0;break t}u.x=0,u.y=0,u=!1}u&&(o?e.push(a.x):e.push(a.y)),s=l}xh.v(a)}(i,e,n,h)}}}}return 0<n.length&&n.sort(function(t,i){return t-i}),n.length}(t,o,r,s));var h=o.x,h=o.y;if(0<a)if(hl.G(o.y,r.y))if(o.x<r.x)for(var l=0;l<a;){var u=Math.max(o.x,Math.min(s[l++]-5,r.x-10));i.lineTo(u+e,r.y+n);for(var h=u+e,f=Math.min(u+10,r.x);l<a;){var c=s[l];if(!(c<f+10))break;l++,f=Math.min(c+5,r.x)}c=(u+f)/2+e,c=r.y-10+n,u=f+e,f=r.y+n,t.Le===jf?Qo(i,u,f,!1,!1):$o(i,h,c,u,c,u,f)}else for(l=a-1;0<=l;){for(u=Math.min(o.x,Math.max(s[l--]+5,r.x+10)),i.lineTo(u+e,r.y+n),h=u+e,f=Math.max(u-10,r.x);0<=l&&(c=s[l])>f-10;)l--,f=Math.max(c-5,r.x);c=r.y-10+n,u=f+e,f=r.y+n,t.Le===jf?Qo(i,u,f,!1,!1):$o(i,h,c,u,c,u,f)}else if(hl.G(o.x,r.x))if(o.y<r.y)for(l=0;l<a;){for(u=Math.max(o.y,Math.min(s[l++]-5,r.y-10)),i.lineTo(r.x+e,u+n),h=u+n,f=Math.min(u+10,r.y);l<a&&(c=s[l])<f+10;)l++,f=Math.min(c+5,r.y);c=r.x-10+e,u=r.x+e,f+=n,t.Le===jf?Qo(i,u,f,!1,!1):$o(i,c,h,c,f,u,f)}else for(l=a-1;0<=l;){for(u=Math.min(o.y,Math.max(s[l--]+5,r.y+10)),i.lineTo(r.x+e,u+n),h=u+n,f=Math.max(u-10,r.y);0<=l&&(c=s[l])>f-10;)l--,f=Math.max(c-5,r.y);c=r.x-10+e,u=r.x+e,f+=n,t.Le===jf?Qo(i,u,f,!1,!1):$o(i,c,h,c,f,u,f)}}i.lineTo(r.x+e,r.y+n)}function Qr(t){return(t=t.Le)===Lf||t===jf}function Zr(t,i){if(i||Qr(t)){var e=t.g;null===e||e.Dk.contains(t)||null===t.Wv||e.Dk.add(t,t.Wv)}}function $r(t,i){var e=t.layer;if(null!==e&&e.visible&&!e.Gc){if(null!==(o=e.g))for(var n=!1,o=o.kx;o.next();){if((s=o.value).visible)if(s===e)for(var n=!0,r=!1,s=s.zb.n,a=s.length,h=0;h<a;h++){var l=s[h];l instanceof zr&&(l===t?r=!0:r&&_r(t,l,i))}else if(n)for(s=s.zb.n,a=s.length,h=0;h<a;h++)(l=s[h])instanceof zr&&_r(t,l,i)}}}function _r(t,i,e){if(null!==i&&null!==i.Ua&&Qr(i)){var n=i.ln;n.K()&&(t.ln.xg(n)||e.xg(n))&&(t.usesSamePort(i)||i.se())}}function ts(t){var i=t.dg;if(null!==i){var e=t.og;if(null!==e){var n=t.Eh;t=t.Vh;for(var o=null,r=null,s=i.fc.n,a=s.length,h=0;h<a;h++){var l=s[h];(l.dg===i&&l.Eh===n&&l.og===e&&l.Vh===t||l.dg===e&&l.Eh===t&&l.og===i&&l.Vh===n)&&(null===r?r=l:(null===o&&(o=[]).push(r),o.push(l)))}if(null!==o){for(null===(r=Mr(i,e,n,t))&&(r=new es,r.Bp=i,r.ux=n,r.Tt=e,r.vx=t,kr(i,r),kr(e,r)),r.links=o,h=0;h<o.length;h++)l=o[h],l.gi=r;r.$m()}}}}function is(t){var i=t.gi;null!==i&&(t.gi=null,0<=(t=i.links.indexOf(t))&&(xh.Xh(i.links,t),i.$m()))}function es(){xh.ec(this),this.tv=!1,this.vx=this.Tt=this.ux=this.Bp=null,this.links=[]}function ns(){xh.ec(this),this.NA=this.group=null,this.Ct=!0,this.abort=!1,this.kg=this.jg=1,this.zr=this.yr=-1,this.ie=this.he=8,this.oc=null,this.SF=!1,this.zF=22,this.OE=111}function os(t,i,e){return t.jg<=i&&i<=t.yr&&t.kg<=e&&e<=t.zr}function rs(t,i,e){return os(t,i,e)?(i-=t.jg,i/=t.he,e-=t.kg,e/=t.ie,t.oc[0|i][0|e]):0}function ss(t,i,e){os(t,i,e)&&(i-=t.jg,i/=t.he,e-=t.kg,e/=t.ie,t.oc[0|i][0|e]=0)}function as(t){if(null!==t.oc)for(var i=0;i<=t.Lo;i++)for(var e=0;e<=t.Mo;e++)1<=t.oc[i][e]&&(t.oc[i][e]|=999999)}function hs(t,i,e,n,o,r,s,a,h){if(!(i<r||i>s||e<a||e>h)){var l,u;l=0|i,u=0|e;var f=t.oc[l][u];if(1<=f&&999999>f)for(o?u+=n:l+=n,f+=1;r<=l&&l<=s&&a<=u&&u<=h&&!(f>=t.oc[l][u]);)t.oc[l][u]=f,f+=1,o?u+=n:l+=n;if(l=o?u:l,o)if(0<n)for(e+=n;e<l;e+=n)hs(t,i,e,1,!o,r,s,a,h),hs(t,i,e,-1,!o,r,s,a,h);else for(e+=n;e>l;e+=n)hs(t,i,e,1,!o,r,s,a,h),hs(t,i,e,-1,!o,r,s,a,h);else if(0<n)for(i+=n;i<l;i+=n)hs(t,i,e,1,!o,r,s,a,h),hs(t,i,e,-1,!o,r,s,a,h);else for(i+=n;i>l;i+=n)hs(t,i,e,1,!o,r,s,a,h),hs(t,i,e,-1,!o,r,s,a,h)}}function ls(t,i,e,n,o,r,s,a,h,l,u){for(var f=0|i,c=0|e,p=t.oc[f][c];0===p&&f>a&&f<h&&c>l&&c<u;)if(s?c+=r:f+=r,p=t.oc[f][c],1>=Math.abs(f-n)&&1>=Math.abs(c-o))return t.abort=!0,0;for(f=0|i,c=0|e,p=t.oc[f][c],i=1,t.oc[f][c]=i;0===p&&f>a&&f<h&&c>l&&c<u;)s?c+=r:f+=r,p=t.oc[f][c],t.oc[f][c]=i,i+=1;return s?c:f}function us(t,i,e,n,o,r){if(null!==t.oc){t.abort=!1;if(os(t,s=i.x,a=i.y)){var s=(s=s-t.jg)/t.he,a=(a=a-t.kg)/t.ie;if(os(t,u=n.x,f=n.y))if(u-=t.jg,u/=t.he,f-=t.kg,f/=t.ie,1>=Math.abs(s-u)&&1>=Math.abs(a-f))t.abort=!0;else{l=r.x;i=r.y,n=r.x+r.width;var h=r.y+r.height,l=(l=l-t.jg)/t.he;i-=t.kg,i/=t.ie,n-=t.jg,n/=t.he,h-=t.kg,h/=t.ie,r=Math.max(0,Math.min(t.Lo,0|l)),n=Math.min(t.Lo,Math.max(0,0|n)),i=Math.max(0,Math.min(t.Mo,0|i));var h=Math.min(t.Mo,Math.max(0,0|h)),u=0|u,f=0|f,l=s=0|s,c=a=0|a,p=0===e||90===e?1:-1;if((e=90===e||270===e)?c=ls(t,s,a,u,f,p,e,r,n,i,h):l=ls(t,s,a,u,f,p,e,r,n,i,h),!t.abort){t:{e=0===o||90===o?1:-1,o=90===o||270===o;for(var p=0|u,d=0|f,y=t.oc[p][d];0===y&&p>r&&p<n&&d>i&&d<h;)if(o?d+=e:p+=e,y=t.oc[p][d],1>=Math.abs(p-s)&&1>=Math.abs(d-a)){t.abort=!0;break t}for(p=0|u,d=0|f,y=t.oc[p][d],t.oc[p][d]=999999;0===y&&p>r&&p<n&&d>i&&d<h;)o?d+=e:p+=e,y=t.oc[p][d],t.oc[p][d]=999999}t.abort||(hs(t,l,c,1,!1,r,n,i,h),hs(t,l,c,-1,!1,r,n,i,h),hs(t,l,c,1,!0,r,n,i,h),hs(t,l,c,-1,!0,r,n,i,h))}}}}}function fs(){xh.ec(this),this.port=this.Jc=null,this.Xf=[],this.Ap=!1}function cs(t,i,e,n){switch(i=i.offsetY){case xh.Wc:return 90;case xh.Nc:return 180;case xh.gd:return 270;case xh.Xc:return 0}switch(i){case xh.Wc|xh.gd:return 180<e?270:90;case xh.Nc|xh.Xc:return 90<e&&270>=e?180:0}switch(t=180*Math.atan2(t.height,t.width)/Math.PI,i){case xh.Nc|xh.gd:return e>t&&e<=180+t?180:270;case xh.gd|xh.Xc:return e>180-t&&e<=360-t?270:0;case xh.Xc|xh.Wc:return e>t&&e<=180+t?90:0;case xh.Wc|xh.Nc:return e>180-t&&e<=360-t?180:90;case xh.Nc|xh.gd|xh.Xc:return 90<e&&e<=180+t?180:e>180+t&&e<=360-t?270:0;case xh.gd|xh.Xc|xh.Wc:return 180<e&&e<=360-t?270:e>t&&180>=e?90:0;case xh.Xc|xh.Wc|xh.Nc:return e>t&&e<=180-t?90:e>180-t&&270>=e?180:0;case xh.Wc|xh.Nc|xh.gd:return e>180-t&&e<=180+t?180:e>180+t?270:90}return n&&i!==(xh.Nc|xh.gd|xh.Xc|xh.Wc)&&0>(e-=15)&&(e+=360),e>t&&e<180-t?90:e>=180-t&&e<=180+t?180:e>180+t&&e<360-t?270:0}function ps(t,i){var e=t.Xf;if(0===e.length){t:if(!t.Ap){e=t.Ap,t.Ap=!0;var n,o=null,r=t.Jc;if(null===(r=r instanceof vs?r:null)||r.ee)n=t.Jc.iE(t.port.Sd);else{if(!r.Y.K()){t.Ap=e;break t}n=(o=r).hE()}var s=t.Xf.length=0,a=t.port.Za(Lh,xh.M()),h=t.port.Za(Eh,xh.M());for((r=xh.lk(a.x,a.y,0,0)).gj(h),xh.v(a),xh.v(h),a=xh.Ob(r.x+r.width/2,r.y+r.height/2),n=n.i;n.next();)if((h=n.value).isVisible()){u=Ch;if((u=(f=h.bd===t.port||h.V.ai(o))?Gr(h,t.port):Vr(h,t.port)).$i()&&null!==(f=f?h.Fd:h.bd)){l=f.aa;if(null!==l){var l,u,f=h.computeOtherPoint(l,f),c=0;0===(u=cs(r,u,l=a.ah(f),h.kc))?(c=xh.Xc,180<l&&(l-=360)):c=90===u?xh.Wc:180===u?xh.Nc:xh.gd,void 0===(u=t.Xf[s])?(u=new ds(h,l,c),t.Xf[s]=u):(u.link=h,u.angle=l,u.ge=c),u.sx.set(f),s++}}}for(xh.v(a),t.Xf.sort(fs.prototype.KI),o=t.Xf.length,a=-1,s=n=0;s<o;s++)void 0!==(u=t.Xf[s])&&(u.ge!==a&&(a=u.ge,n=0),u.kp=n,n++);for(a=-1,n=0,s=o-1;0<=s;s--)void 0!==(u=t.Xf[s])&&(u.ge!==a&&(a=u.ge,n=u.kp+1),u.Rm=n);s=t.Xf,f=t.port,o=t.Jc.SI,a=xh.M(),n=xh.M(),h=xh.M(),u=xh.M(),f.Za(Lh,a),f.Za(Ah,n),f.Za(Eh,h),f.Za(qh,u);var p=c=l=f=0;if(o===Pf)for(b=0;b<s.length;b++){var d=s[b];if(null!==d){var y=d.link.computeThickness();switch(d.ge){case xh.Wc:c+=y;break;case xh.Nc:p+=y;break;case xh.gd:f+=y;break;default:case xh.Xc:l+=y}}}for(var v=0,g=0,m=1,b=0;b<s.length;b++)if(null!==(d=s[b])){var x,w;if(v!==d.ge){switch(v=d.ge){case xh.Wc:x=h,w=u;break;case xh.Nc:x=u,w=a;break;case xh.gd:x=a,w=n;break;default:case xh.Xc:x=n,w=h}var k=w.x-x.x;switch(w=w.y-x.y,v){case xh.Wc:c>Math.abs(k)?(m=Math.abs(k)/c,c=Math.abs(k)):m=1;break;case xh.Nc:p>Math.abs(w)?(m=Math.abs(w)/p,p=Math.abs(w)):m=1;break;case xh.gd:f>Math.abs(k)?(m=Math.abs(k)/f,f=Math.abs(k)):m=1;break;default:case xh.Xc:l>Math.abs(w)?(m=Math.abs(w)/l,l=Math.abs(w)):m=1}g=0}var M=d.rp;if(o===Pf){switch(y=d.link.computeThickness(),y*=m,M.set(x),v){case xh.Wc:M.x=x.x+k/2+c/2-g-y/2;break;case xh.Nc:M.y=x.y+w/2+p/2-g-y/2;break;case xh.gd:M.x=x.x+k/2-f/2+g+y/2;break;default:case xh.Xc:M.y=x.y+w/2-l/2+g+y/2}g+=y}else y=.5,o===Mf&&(y=(d.kp+1)/(d.Rm+1)),M.x=x.x+k*y,M.y=x.y+w*y}for(xh.v(a),xh.v(n),xh.v(h),xh.v(u),x=t.Xf,k=0;k<x.length;k++)null!==(w=x[k])&&(w.Ow=t.computeEndSegmentLength(w));t.Ap=e,xh.ic(r)}e=t.Xf}for(r=0;r<e.length;r++)if(null!==(x=e[r])&&x.link===i)return x;return null}function ds(t,i,e){this.link=t,this.angle=i,this.ge=e,this.sx=new b,this.Rm=this.kp=0,this.rp=new b,this.Ow=0}function ys(){this.Tj=this.rj=jh,this.Rj=this.pj=NaN,this.Qj=this.oj=xf,this.Sj=this.qj=NaN}function vs(t){0===arguments.length?wr.call(this,Bu):wr.call(this,t),this.Br=new c(tr),this.oo=new c(vs),this.Tk=this.Cr=this.Ar=null,this.Os=!1,this.hr=!0,this.Qs=!1,this.Ib=this.Fs=null,this.oq=!1,this.pq=!0,this.Yq=this.qq=!1,this.Ud=new ks,this.Ud.group=this,this.Zy=!1}function gs(t,i){if(t.Br.add(i)){i instanceof vs&&t.oo.add(i);var e=t.BI;if(null!==e){var n=!0,o=t.g;null!==o&&(n=o.Ra,o.Ra=!0),e(t,i),null!==o&&(o.Ra=n)}t.isVisible()&&t.ee||i.rd(!1)}i instanceof zr&&!t.Iw||(null===(e=t.Ib)&&(e=t),e.Q())}function ms(t,i){if(t.Br.remove(i)){i instanceof vs&&t.oo.remove(i);var e=t.CI;if(null!==e){var n=!0,o=t.g;null!==o&&(n=o.Ra,o.Ra=!0),e(t,i),null!==o&&(o.Ra=n)}t.isVisible()&&t.ee||i.rd(!0)}i instanceof zr&&!t.Iw||(null===(e=t.Ib)&&(e=t),e.Q())}function bs(t,i,e,n){for(var o=t.Ic;o.next();){var r=o.value;if(r.rd(!1),r instanceof vs){var s=r;s.ee&&(s.YA=s.ee,bs(s,i,e,n))}if(r instanceof wr)r.ff(i),Hi(e,r,n);else if(r instanceof zr)for(r=r.Sf;r.next();)r.value.ff(i)}t.ee=!1}function xs(t,i,e,n){for(var o=t.Ic;o.next();){var r=o.value;if(r.rd(!0),r instanceof vs){var s=r;s.YA&&(s.YA=!1,xs(s,i,e,n))}if(r instanceof wr)r.ff(i),Vi(e,r,n);else if(r instanceof zr)for(r=r.Sf;r.next();)r.value.ff(i)}t.ee=!0}function ws(){Mn.call(this),this.We=hl.Wp,this.ns=new M(NaN,NaN,NaN,NaN)}function ks(){0<arguments.length&&xh.fd(ks),xh.ec(this),this.Ky=this.U=null,this.vj=this.er=!0,this.mr=!1,this.gq=new b(0,0).freeze(),this.fr=this.gr=!0,this.TB="",this.co=!1,this.$y=null}function Ms(t,i,e,n,o,r,s,a){for(e=e.i;e.next();){var h=e.value;n&&!h.np||null!==o&&!o(h)||!h.canLayout()||(r&&h instanceof wr?h.vf||(h instanceof vs&&null===h.Rb?Ms(t,i,h.Ic,!1,o,r,s,a):i.add(h)):s&&h instanceof zr?i.add(h):!a||!h.Pd()||h instanceof wr||i.add(h))}}function Ps(){xh.ec(this),this.Ud=null,this.clear()}function Ts(t,i){if(null===i)return!1;var e=t.vertexes.remove(i);return e&&(t.rA.remove(i.Jc),i.network=null),e}function Ss(t,i){null!==i&&t.edges.remove(i)&&(t.dA.remove(i.link),i.network=null)}function Ns(t,i,e){if(null!==e&&e.network!==i){Ts(t,e),i.el(e);for(var n=e.lc;n.next();){var o=n.value;o.network!==i&&(Ss(t,o),i.Oo(o),Ns(t,i,o.fromVertex))}for(n=e.$b;n.next();)(e=n.value).network!==i&&(Ss(t,e),i.Oo(e),Ns(t,i,e.toVertex))}}function Cs(){xh.ec(this),this.network=null,this.N=new M(0,0,10,10).freeze(),this.O=new b(5,5).freeze(),this.clear()}function js(){xh.ec(this),this.network=null,this.clear()}function Ls(){0<arguments.length&&xh.fd(Ls),ks.call(this),this.hx=!0,this.Ss=this.Ts=NaN,this.kj=new k(NaN,NaN).freeze(),this.Sh=new k(10,10).freeze(),this.Ce=Uf,this.hd=Jf,this.Rh=Qf,this.yh=Hf}function Ds(){0<arguments.length&&xh.fd(Ds),ks.call(this),this.By=this.Pn=this.Jd=0,this.Nq=360,this.Ay=$f,this.Ek=0,this.$B=$f,this.Ru=this.qg=this.pD=0,this.sw=new Hs,this.Tu=this.rm=0,this.tG=600,this.$r=NaN,this.iq=1,this.Es=0,this.Gs=360,this.hd=$f,this.ca=ec,this.Rh=uc,this.yh=Vf,this.Sh=6,this.Qr=fc}function As(t,i,e,n,o){var r=t.Nq,s=t.Jd;t=t.qg,n=n*Math.PI/180,e=e*Math.PI/180;for(var a=i.length,h=0;h<a;h++){var l=n+(o===ec?h*e/(360<=r?a:a-1):-h*e/a),u=i.ha(h),f=s*Math.tan(l)/t,f=Math.sqrt((s*s+t*t*f*f)/(1+f*f));u.oa=f*Math.cos(l),u.va=f*Math.sin(l),u.actualAngle=180*l/Math.PI}}function Fs(t,i,e,n){var o=t.Jd,r=t.qg,s=t.Ek;e=e*Math.PI/180;for(var a=i.length,h=0;h<a;h++){var l=i.ha(h),u=i.ha(h===a-1?0:h+1),f=r*Math.sin(e);l.oa=o*Math.cos(e),l.va=f,l.actualAngle=180*e/Math.PI,isNaN(l.diameter)&&Js(l,0),isNaN(u.diameter)&&Js(u,0),l=Vs(t,o,r,n===ec?e:-e,(l.diameter+u.diameter)/2+s),e+=n===ec?l:-l}}function zs(t,i,e,n){var o=t.Jd,r=t.qg,s=t.Ru;e=e*Math.PI/180;for(var a=i.length,h=0;h<a;h++){var l=i.ha(h);l.oa=o*Math.cos(e),l.va=r*Math.sin(e),l.actualAngle=180*e/Math.PI,l=Vs(t,o,r,n===ec?e:-e,s),e+=n===ec?l:-l}}function Os(t,i,e,n,o){var r=t.Tu,r=t.Nq;if(t.rm=0,t.sw=new Hs,360>e){for(r=n+(o===ec?r:-r);0>r;)r+=360;180<(r%=360)&&(r-=360),r*=Math.PI/180,t.Tu=r,Bs(t,i,e,n,o)}else qs(t,i,e,n,o);t.sw.commit(i)}function qs(t,i,e,n,o){var r=t.Jd,s=t.Ek,a=t.Pn,h=r*Math.cos(n*Math.PI/180),l=t.qg*Math.sin(n*Math.PI/180),u=i.dc();if(3===u.length)u[0].oa=r,u[0].va=0,u[1].oa=u[0].oa-u[0].width/2-u[1].width/2-s,u[1].y=u[0].y,u[2].oa=(u[0].oa+u[1].oa)/2,u[2].y=u[0].y-u[2].height-s;else if(4===u.length)u[0].oa=r,u[0].va=0,u[2].oa=-u[0].oa,u[2].va=u[0].va,u[1].oa=0,u[1].y=Math.min(u[0].y,u[2].y)-u[1].height-s,u[3].oa=0,u[3].y=Math.max(u[0].y+u[0].height+s,u[2].y+u[2].height+s);else{for(var r=xh.M(),f=0;f<u.length&&(u[f].oa=h,u[f].va=l,!(f>=u.length-1));f++)Es(t,h,l,u,f,o,r)||Is(t,h,l,u,f,o,r),h=r.x,l=r.y;if(xh.v(r),t.rm++,!(23<t.rm)){var h=u[0].oa,l=u[0].va,r=u[u.length-1].oa,f=u[u.length-1].va,c=Math.abs(h-r)-((u[0].width+u[u.length-1].width)/2+s),p=Math.abs(l-f)-((u[0].height+u[u.length-1].height)/2+s),s=0;1>Math.abs(p)?Math.abs(h-r)<(u[0].width+u[u.length-1].width)/2&&(s=0):s=0<p?p:1>Math.abs(c)?0:c,c=!1,c=Math.abs(r)>Math.abs(f)?0<r!=l>f:0<f!=h<r,(c=o===ec?c:!c)&&(s=-Math.abs(s),s=Math.min(s,-u[u.length-1].width),s=Math.min(s,-u[u.length-1].height)),t.sw.compare(s,u),1<Math.abs(s)&&(t.Jd=8>t.rm?t.Jd-s/(2*Math.PI):5>u.length&&10<s?t.Jd/2:t.Jd-(0<s?1.7:-2.3),t.qg=t.Jd*a,qs(t,i,e,n,o))}}}function Bs(t,i,e,n,o){for(var r=t.Jd,s=t.qg,a=t.Pn,h=r*Math.cos(n*Math.PI/180),l=s*Math.sin(n*Math.PI/180),u=xh.M(),f=i.dc(),c=0;c<f.length&&(f[c].oa=h,f[c].va=l,!(c>=f.length-1));c++)Es(t,h,l,f,c,o,u)||Is(t,h,l,f,c,o,u),h=u.x,l=u.y;if(xh.v(u),t.rm++,!(23<t.rm)){if(h=Math.atan2(l,h),h=o===ec?t.Tu-h:h-t.Tu,h=Math.abs(h)<Math.abs(h-2*Math.PI)?h:h-2*Math.PI,r=h*(r+s)/2,s=t.sw,Math.abs(r)<Math.abs(s.fp))for(s.fp=r,s.rn=[],s.Up=[],h=0;h<f.length;h++)s.rn[h]=f[h].nb.x,s.Up[h]=f[h].nb.y;1<Math.abs(r)&&(t.Jd=8>t.rm?t.Jd-r/(2*Math.PI):t.Jd-(0<r?1.7:-2.3),t.qg=t.Jd*a,Bs(t,i,e,n,o))}}function Es(t,i,e,n,o,r,s){var a=t.Jd,h=t.qg,l=0,u=0;t=(n[o].width+n[o+1].width)/2+t.Ek;var f=!1;if(0<=e!=(r===ec)){if((l=i+t)>a){if((l=i-t)<-a)return s.x=l,s.y=u,!1;f=!0}}else if((l=i-t)<-a){if((l=i+t)>a)return s.x=l,s.y=u,!1;f=!0}return u=Math.sqrt(1-Math.min(1,l*l/(a*a)))*h,0>e!==f&&(u=-u),Math.abs(e-u)>(n[o].height+n[o+1].height)/2?(s.x=l,s.y=u,!1):(s.x=l,s.y=u,!0)}function Is(t,i,e,n,o,r,s){var a=t.Jd,h=t.qg,l=0,u=0;if(t=(n[o].height+n[o+1].height)/2+t.Ek,n=!1,0<=i!=(r===ec)){if((u=e-t)<-h){if((u=e+t)>h)return s.x=l,void(s.y=u);n=!0}}else if((u=e+t)>h){if((u=e-t)<-h)return s.x=l,void(s.y=u);n=!0}l=Math.sqrt(1-Math.min(1,u*u/(h*h)))*a,0>i!==n&&(l=-l),s.x=l,s.y=u}function Rs(t,i,e,n,o){var r=t.tG;if(.001>Math.abs(t.Pn-1))return void 0!==n&&void 0!==o?o*i:2*Math.PI*i;t=i>e?Math.sqrt(i*i-e*e)/i:Math.sqrt(e*e-i*i)/e;for(var s=0,a=0,a=void 0!==n&&void 0!==o?o/(r+1):Math.PI/(2*(r+1)),h=0,l=0;l<=r;l++)h=void 0!==n&&void 0!==o?n+l*o/r:l*Math.PI/(2*r),h=Math.sin(h),s+=Math.sqrt(1-t*t*h*h)*a;return void 0!==n&&void 0!==o?(i>e?i:e)*s:4*(i>e?i:e)*s}function Gs(t,i,e,n,o){return i/(void 0!==n&&void 0!==o?Rs(t,1,e,n,o):Rs(t,1,e))}function Vs(t,i,e,n,o){if(.001>Math.abs(t.Pn-1))return o/i;var r=i>e?Math.sqrt(i*i-e*e)/i:Math.sqrt(e*e-i*i)/e,s=0;t=2*Math.PI/(700*t.network.vertexes.count),i>e&&(n+=Math.PI/2);for(var a=0;;a++){var h=Math.sin(n+a*t);if((s=s+(i>e?i:e)*Math.sqrt(1-r*r*h*h)*t)>=o)return a*t}}function Hs(){this.fp=-1/0,this.Up=this.rn=null}function Ks(){Ps.call(this)}function Us(){Cs.call(this),this.actualAngle=this.diameter=NaN}function Js(t,i){if(null===(e=t.network))return NaN;if(null===(e=e.Rb))return NaN;if(e.Nf===ic)if(e.ox===cc)t.diameter=Math.max(t.width,t.height);else{var e=Math.abs(Math.sin(i)),n=Math.abs(Math.cos(i));if(0===e)return t.width;if(0===n)return t.height;t.diameter=Math.min(t.height/e,t.width/n)}else t.diameter=e.ox===cc?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.diameter}function Ys(){js.call(this)}function Ws(){0<arguments.length&&xh.fd(Ws),ks.call(this),this.pg=null,this.or=0,this.bg=new k(100,100).freeze(),this.hq=!1,this.Ph=!0,this.xh=!1,this.no=100,this.Pq=1,this.Gh=1e3,this.as=Math,this.Kn=.05,this.Jn=50,this.Gn=150,this.In=0,this.Fq=10,this.Eq=5}function Xs(t,i,e){if(function(t,i){if(10<i||3>t.network.vertexes.count)return!1;null===t.pg?t.pg=new u(ia):t.pg.clear(),t.pg.Tc(t.network.vertexes);var e=t.pg;e.sort(function(t,i){return null===t||null===i||t===i?0:i.Zf-t.Zf});for(var n=e.count-1;0<=n&&1>=e.ha(n).Zf;)n--;return 1<e.count-n}(t,i)){var n=t.Gh;t.Gh*=1+1/(i+1);var o=function(t,i){for(var e=t.network,n=new ta,o=t.pg.i;o.next();){var r=o.value;if(!(1<r.Zf))break;n.el(r);var s=new _s;s.Ux=r.Zf,s.Xx=r.width,s.Tx=r.height,s.bB=r.O.x,s.cB=r.O.y,null===r.qh&&(r.qh=new u(_s)),r.qh.add(s),r.FA=r.qh.count-1}for(d=e.edges.i;d.next();)if((o=d.value).fromVertex.network===n&&o.toVertex.network===n)n.Oo(o);else if(o.fromVertex.network===n){var a=o.fromVertex.Nm;null===a&&(a=new u(ia),o.fromVertex.Nm=a),a.add(o.toVertex),o.fromVertex.Zf--,o.fromVertex.hk+=o.toVertex.hk}else o.toVertex.network===n&&(null===(a=o.toVertex.Nm)&&(a=new u(ia),o.toVertex.Nm=a),a.add(o.fromVertex),o.toVertex.Zf--,o.toVertex.hk+=o.fromVertex.hk);for(o=n.edges.i;o.next();)r=o.value,r.length*=Math.max(1,hl.sqrt((r.fromVertex.hk+r.toVertex.hk)/(4*i+1)));for(o=n.vertexes.i;o.next();)if(r=o.value,null!==(a=r.Nm)&&0<a.count&&(s=r.qh.ha(r.qh.count-1),!(0>=(s=s.Ux-r.Zf)))){for(var h=0,l=0,f=a.count-s;f<a.count;f++){for(var c=a.ha(f),p=null,d=c.edges.i;d.next();){var y=d.value;if(y.KH(c)===r){p=y;break}}null!==p&&(l+=p.length,h+=c.width*c.height)}a=r.oa,d=r.va,f=r.width,c=r.height,p=r.O,1>(y=f*c)&&(y=1),h=hl.sqrt((h+y+l*l*4/(s*s))/y),s=(h-1)*f/2,h=(h-1)*c/2,r.nb=new M(a-p.x-s,d-p.y-h,f+2*s,c+2*h),r.focus=new b(p.x+s,p.y+h)}return t.network=n,e}(t,i),r=Math.max(0,Math.max(Math.min(t.network.vertexes.count,e*(i+1)/11),10));for(t.hA+=r,Xs(t,i+1,e),$s(t,r),function(t,i){for(var e=t.network.vertexes.i;e.next();){var n=e.value;if(n.network=i,null!==n.qh){var o=n.qh.ha(n.FA);n.Zf=o.Ux;var r=o.bB,s=o.cB;n.nb=new M(n.oa-r,n.va-s,o.Xx,o.Tx),n.focus=new b(r,s),n.FA--}}for(e=t.network.edges.i;e.next();)e.value.network=i;t.network=i}(t,o),null===(i=t.pg)?i=new u(ia):i.clear(),i.Tc(o.vertexes),i.sort(function(t,i){return null===t||null===i||t===i?0:i.Zf-t.Zf}),o=i.i;o.next();)!function(t,i){var e=i.Nm;if(null!==e&&0!==e.count){var n=i.oa,o=i.va,r=i.width,s=i.height;null!==i.qh&&0<i.qh.count&&(s=i.qh.ha(0),r=s.Xx,s=s.Tx);for(var r=hl.sqrt(r*r+s*s)/2,a=!1,h=s=0,l=0,u=i.vertexes.i;u.next();){1>=(f=u.value).Zf?h++:(a=!0,l++,s+=Math.atan2(i.va-f.va,i.oa-f.oa))}if(0!==h)for(0<l&&(s/=l),u=l=0,l=a?2*Math.PI/(h+1):2*Math.PI/h,0==h%2&&(u=l/2),1<e.count&&e.sort(function(t,i){return null===t||null===i||t===i?0:i.width*i.height-t.width*t.height}),a=0==h%2?0:1,e=e.i;e.next();)if(!(1<(h=e.value).Zf||t.isFixed(h))){for(var f=null,c=h.edges.i;c.next();){f=c.value;break}var c=h.width,p=h.height,c=hl.sqrt(c*c+p*p)/2,f=r+f.length+c,c=s+(l*(a/2>>1)+u)*(0==a%2?1:-1);h.oa=n+f*Math.cos(c),h.va=o+f*Math.sin(c),a++}}}(t,o.value);t.Gh=n}}function Qs(t,i,e,n,o,r,s){var a=9e19,h=-1,l=0;t:for(;l<i;l++){var u=t[l],f=u.x-e,c=u.y-n;if((f=f*f+c*c)<a){for(c=l-1;0<=c;c--)if(t[c].y>u.y&&t[c].x-u.x<o+s.width)continue t;for(c=l+1;c<i;c++)if(t[c].x>u.x&&t[c].y-u.y<r+s.height)continue t;h=l,a=f}}return h}function Zs(t,i){var e=(r=t.N).x,n=r.y,o=r.width,r=r.height,s=(l=i.N).x,a=l.y,h=l.width,l=l.height;return e+o<s?n>a+l?(e=e+o-s,n=n-a-l,hl.sqrt(e*e+n*n)):n+r<a?(e=e+o-s,n=n+r-a,hl.sqrt(e*e+n*n)):s-(e+o):e>s+h?n>a+l?(e=e-s-h,n=n-a-l,hl.sqrt(e*e+n*n)):n+r<a?(e=e-s-h,n=n+r-a,hl.sqrt(e*e+n*n)):e-(s+h):n>a+l?n-(a+l):n+r<a?a-(n+r):.1}function $s(t,i){t.pg=null;for(var e=t.or+i;t.or<e&&(t.or++,function(t){null===t.pg&&(t.pg=new u(ia),t.pg.Tc(t.network.vertexes));var i=t.pg.n;if(0>=i.length)return!1;(r=i[0]).forceX=0,r.forceY=0;for(var e=h=r.oa,n=l=r.va,r=1;r<i.length;r++){(a=i[r]).forceX=0,a.forceY=0;var s=a.oa,a=a.va,h=Math.min(h,s),e=Math.max(e,s),l=Math.min(l,a),n=Math.max(n,a)}(l=e-h>n-l)?i.sort(function(t,i){return null===t||null===i||t===i?0:t.oa-i.oa}):i.sort(function(t,i){return null===t||null===i||t===i?0:t.va-i.va});for(var n=t.Gh,f=0,c=0,p=0,r=0;r<i.length;r++){var s=(a=i[r]).N,d=a.O,h=s.x+d.x,s=s.y+d.y,c=a.charge*t.electricalFieldX(h,s),p=a.charge*t.electricalFieldY(h,s),c=c+a.mass*t.gravitationalFieldX(h,s),p=p+a.mass*t.gravitationalFieldY(h,s);for(a.forceX+=c,a.forceY+=p,d=r+1;d<i.length;d++)if((e=i[d])!==a){var y=e.N,c=e.O,p=y.x+c.x,y=y.y+c.y;if(h-p>n||p-h>n){if(l)break}else if(s-y>n||y-s>n){if(!l)break}else{var v=Zs(a,e);1>v?(null===(c=t.xx)&&(t.xx=c=new o(0)),f=c.random(),v=c.random(),h>p?(c=Math.abs(e.N.right-a.N.x),c=(1+c)*f):h<p?(c=Math.abs(e.N.x-a.N.right),c=-(1+c)*f):(c=Math.max(e.width,a.width),c=(1+c)*f-c/2),s>y?(p=Math.abs(e.N.bottom-a.N.y),p=(1+p)*v):h<p?(p=Math.abs(e.N.y-a.N.bottom),p=-(1+p)*v):(p=Math.max(e.height,a.height),p=(1+p)*v-p/2)):(f=-a.charge*e.charge/(v*v),c=(p-h)/v*f,p=(y-s)/v*f),a.forceX+=c,a.forceY+=p,e.forceX-=c,e.forceY-=p}}}for(r=t.network.edges.i;r.next();)l=r.value,a=l.fromVertex,e=l.toVertex,s=a.N,d=a.O,h=s.x+d.x,s=s.y+d.y,y=e.N,c=e.O,p=y.x+c.x,y=y.y+c.y,1>(v=Zs(a,e))?(null===(c=t.xx)&&(t.xx=c=new o(0)),f=c.random(),v=c.random(),c=(h>p?1:-1)*(1+(e.width>a.width)?e.width:a.width)*f,p=(s>y?1:-1)*(1+(e.height>a.height)?e.height:a.height)*v):(f=l.stiffness*(v-l.length),c=(p-h)/v*f,p=(y-s)/v*f),a.forceX+=c,a.forceY+=p,e.forceX-=c,e.forceY-=p;for(r=0,h=Math.max(t.Gh/20,50),e=0;e<i.length;e++)a=i[e],t.isFixed(a)?t.moveFixedVertex(a):(l=a.forceX,n=a.forceY,l<-h?l=-h:l>h&&(l=h),n<-h?n=-h:n>h&&(n=h),a.oa+=l,a.va+=n,r=Math.max(r,l*l+n*n));return r>t.gE*t.gE}(t)););t.pg=null}function _s(){this.cB=this.bB=this.Tx=this.Xx=this.Ux=0}function ta(){Ps.call(this)}function ia(){Cs.call(this),this.isFixed=!1,this.mass=this.charge=NaN,this.hk=this.Zf=this.forceY=this.forceX=0,this.qh=this.Nm=null,this.FA=0}function ea(){js.call(this),this.length=this.stiffness=NaN}function na(){0<arguments.length&&xh.fd(na),ks.call(this),this.Hd=this.km=25,this.ca=0,this.Fn=pc,this.io=yc,this.Xn=mc,this.hm=4,this.wn=kc,this.Hi=Nc,this.Ph=!0,this.tr=4,this.Hb=this.Dv=this.qb=-1,this.If=this.Dr=0,this.Nb=this.Ff=this.Gf=this.hg=this.Td=null,this.Lr=0,this.Kr=this.om=null,this.lg=0,this.Mr=null,this.Pg=[],this.Pg.length=100}function oa(t){var i=t.fromVertex.ud;return t=t.toVertex.ud,null===i&&null===t?8:null===i||null===t?4:1}function ra(t){null===t.om&&(t.om=[]);for(var i=0,e=t.network.vertexes.i;e.next();){var n=e.value;t.om[i]=n.layer,i++,t.om[i]=n.column,i++,t.om[i]=n.index,i++}return t.om}function sa(t,i){for(var e=0,n=t.network.vertexes.i;n.next();){var o=n.value;o.layer=i[e],e++,o.column=i[e],e++,o.index=i[e],e++}}function aa(t,i,e){var n=Aa(t,i),o=t.Td[i];(null===t.Kr||t.Kr.length<o*o)&&(t.Kr=[]);for(var r=t.Kr,s=0;s<o;s++){var a=0,h=n[s],l=0;if(null!==(p=h.near)&&p.layer===h.layer)if((l=p.index)>s)for(var u=s+1;u<l;u++)(h=n[u]).near===p&&h.Km===p.Km||a++;else for(u=s-1;u>l;u--)(h=n[u]).near===p&&h.Km===p.Km||a++;var f,c,p=0,d=f=u=h=0,y=0,v=0;c=0;var g;if(0<=e)for(l=n[s].Se,p=0;p<l.count;p++)if((f=l.n[p]).valid&&f.fromVertex.layer!==i)for(h=f.fromVertex.index,u=f.portToPos,f=f.portFromPos,d=p+1;d<l.count;d++)(c=l.n[d]).valid&&c.fromVertex.layer!==i&&(y=c.fromVertex.index,v=c.portToPos,c=c.portFromPos,u<v&&(h>y||h===y&&f>c)&&a++,v<u&&(y>h||y===h&&c>f)&&a++);if(0>=e)for(l=n[s].Me,p=0;p<l.count;p++)if((f=l.n[p]).valid&&f.toVertex.layer!==i)for(h=f.toVertex.index,u=f.portToPos,f=f.portFromPos,d=p+1;d<l.count;d++)(c=l.n[d]).valid&&c.toVertex.layer!==i&&(y=c.toVertex.index,v=c.portToPos,c=c.portFromPos,f<c&&(h>y||h===y&&u>v)&&a++,c<f&&(y>h||y===h&&v>u)&&a++);for(r[s*o+s]=a,l=s+1;l<o;l++){var m=0,b=0;if(0<=e)for(a=n[s].Se,g=n[l].Se,p=0;p<a.count;p++)if((f=a.n[p]).valid&&f.fromVertex.layer!==i)for(h=f.fromVertex.index,f=f.portFromPos,d=0;d<g.count;d++)(c=g.n[d]).valid&&c.fromVertex.layer!==i&&(y=c.fromVertex.index,c=c.portFromPos,(h<y||h===y&&f<c)&&b++,(y<h||y===h&&c<f)&&m++);if(0>=e)for(a=n[s].Me,g=n[l].Me,p=0;p<a.count;p++)if((f=a.n[p]).valid&&f.toVertex.layer!==i)for(h=f.toVertex.index,u=f.portToPos,d=0;d<g.count;d++)(c=g.n[d]).valid&&c.toVertex.layer!==i&&(y=c.toVertex.index,v=c.portToPos,(h<y||h===y&&u<v)&&b++,(y<h||y===h&&v<u)&&m++);r[s*o+l]=m,r[l*o+s]=b}}return Fa(t,i,n),r}function ha(t){for(var i=0,e=0;e<=t.qb;e++){for(var n=t,o=e,r=Aa(n,o),s=n.Td[o],a=0,h=0;h<s;h++){var l,u=null,f=0,c=0;if(null!==(u=r[h].Me))for(var p=0;p<u.count;p++)(l=u.n[p]).valid&&l.toVertex.layer!==o&&(f=l.fromVertex.column+l.portFromColOffset,c=l.toVertex.column+l.portToColOffset,a+=(Math.abs(f-c)+1)*oa(l))}Fa(n,o,r),i+=a}return i}function la(t,i,e){for(var n=Aa(t,i),o=t.Td[i],r=[],s=0;s<o;s++){var a=n[s],h=null;0>=e&&(h=a.Se);var l=null;0<=e&&(l=a.Me);var u=0,f=0,c=a.near;if(null!==c&&c.layer===a.layer&&(u+=c.column-1,f++),null!==h)for(c=0;c<h.count;c++){var p=(a=h.n[c]).fromVertex;a.valid&&!a.rev&&p.layer!==i&&(u+=p.column+a.portFromColOffset,f++)}if(null!==l)for(h=0;h<l.count;h++)a=l.n[h],c=a.toVertex,a.valid&&!a.rev&&c.layer!==i&&(u+=c.column+a.portToColOffset,f++);r[s]=0===f?-1:u/f}return Fa(t,i,n),r}function ua(t,i,e){for(var n=Aa(t,i),o=t.Td[i],r=[],s=0;s<o;s++){var a=n[s],h=null;0>=e&&(h=a.Se);var l=null;0<=e&&(l=a.Me);var u=0,f=[],c=a.near;if(null!==c&&c.layer===a.layer&&(f[u]=c.column-1,u++),null!==h)for(c=0;c<h.count;c++){var p=(a=h.n[c]).fromVertex;a.valid&&!a.rev&&p.layer!==i&&(f[u]=p.column+a.portFromColOffset,u++)}if(null!==l)for(h=0;h<l.count;h++)a=l.n[h],c=a.toVertex,a.valid&&!a.rev&&c.layer!==i&&(f[u]=c.column+a.portToColOffset,u++);0===u?r[s]=-1:(f.sort(function(t,i){return t-i}),l=u>>1,r[s]=1&u?f[l]:f[l-1]+f[l]>>1)}return Fa(t,i,n),r}function fa(t,i,e,n,o,r){if(i.component===n){i.component=e;var s=0,a=0;if(o)for(var h=i.$b;h.next();){var l=(a=h.value).toVertex;(s=i.layer-l.layer)===(a=t.linkMinLength(a))&&fa(t,l,e,n,o,r)}if(r)for(h=i.lc;h.next();)a=h.value,l=a.fromVertex,s=l.layer-i.layer,a=t.linkMinLength(a),s===a&&fa(t,l,e,n,o,r)}}function ca(t,i,e,n,o,r){if(i.component===n){if(i.component=e,o)for(var s=i.$b;s.next();)ca(t,s.value.toVertex,e,n,o,r);if(r)for(i=i.lc;i.next();)ca(t,i.value.fromVertex,e,n,o,r)}}function pa(t){for(t=t.vertexes.i;t.next();){var i=t.value;if(i.valid){for(var e=!0,n=i.$b;n.next();)if(n.value.toVertex.valid){e=!1;break}if(e)return i}}return null}function da(t){for(t=t.vertexes.i;t.next();){var i=t.value;if(i.valid){for(var e=!0,n=i.lc;n.next();)if(n.value.fromVertex.valid){e=!1;break}if(e)return i}}return null}function ya(t,i){i.$o=t.Lr,t.Lr++;for(var e=i.$b;e.next();){var n=e.value,o=n.toVertex;-1===o.$o&&(n.forest=!0,ya(t,o))}i.finish=t.Lr,t.Lr++}function va(t){for(var i=t.network.vertexes.i;i.next();){var e=ga(t,i.value);t.qb=Math.max(e,t.qb)}}function ga(t,i){r=0;if(-1===i.layer){for(var e=i.$b;e.next();)var n=e.value,o=n.toVertex,n=t.linkMinLength(n),r=Math.max(r,ga(t,o)+n);i.layer=r}else r=i.layer;return r}function ma(t,i){r=0;if(-1===i.layer){for(var e=i.lc;e.next();)var n=e.value,o=n.fromVertex,n=t.linkMinLength(n),r=Math.max(r,ma(t,o)+n);i.layer=r}else r=i.layer;return r}function ba(t,i){if(!i.valid){i.valid=!0;for(var e=i.$b;e.next();)ba(t,e.value.toVertex);for(e=t.network.vertexes.i;e.next();)e.value.component=-1;for(var n=(a=i.Se.n).length,o=0;o<n;o++){var r=a[o],s=t.linkMinLength(r);r.fromVertex.layer-r.toVertex.layer>s&&fa(t,r.fromVertex,0,-1,!0,!1)}for(fa(t,i,1,-1,!0,!0);0!==i.component;){for(var s=0,a=1/0,h=0,l=null,u=t.network.vertexes.i;u.next();){var f=u.value;if(1===f.component){for(var c=0,p=!1,d=f.Se.n,n=d.length,o=0;o<n;o++){var y=(r=d[o]).fromVertex,c=c+1;1!==y.component&&(s+=1,y=y.layer-f.layer,r=t.linkMinLength(r),a=Math.min(a,y-r))}for(n=(r=f.Me.n).length,o=0;o<n;o++)d=r[o].toVertex,c-=1,1!==d.component?s-=1:p=!0;(null===l||c<h)&&!p&&(l=f,h=c)}}if(0<s){for(e.reset();e.next();)1===(n=e.value).component&&(n.layer+=a);i.component=0}else l.component=0}for(e=t.network.vertexes.i;e.next();)e.value.component=-1;for(fa(t,i,1,-1,!0,!1);0!==i.component;){for(o=0,n=1/0,a=0,s=null,h=t.network.vertexes.i;h.next();)if(1===(l=h.value).component){for(u=0,f=!1,c=(r=l.Se.n).length,p=0;p<c;p++)d=r[p].fromVertex,u+=1,1!==d.component?o+=1:f=!0;for(c=(r=l.Me.n).length,p=0;p<c;p++)d=r[p],y=d.toVertex,u-=1,1!==y.component&&(o-=1,y=l.layer-y.layer,d=t.linkMinLength(d),n=Math.min(n,y-d));(null===s||u>a)&&!f&&(s=l,a=u)}if(0>o){for(e.reset();e.next();)1===(o=e.value).component&&(o.layer-=n);i.component=0}else s.component=0}}}function xa(t,i,e){return 90===t.ca?e&&!i.rev||!e&&i.rev?270:90:180===t.ca?e&&!i.rev||!e&&i.rev?0:180:270===t.ca?e&&!i.rev||!e&&i.rev?90:270:e&&!i.rev||!e&&i.rev?180:0}function wa(t,i){e=i.layer;i.index=t.Td[e],t.Td[e]++;for(var e=i.Me.dc(),n=!0;n;)for(var n=!1,o=0;o<e.length-1;o++){var r=e[o],s=e[o+1];r.portFromColOffset>s.portFromColOffset&&(n=!0,e[o]=s,e[o+1]=r)}for(o=0;o<e.length;o++)(n=e[o]).valid&&-1===(n=n.toVertex).index&&wa(t,n)}function ka(t,i){e=i.layer;i.index=t.Td[e],t.Td[e]++;for(var e=i.Se.dc(),n=!0,o=0;n;)for(n=!1,o=0;o<e.length-1;o++){var r=e[o],s=e[o+1];r.portToColOffset>s.portToColOffset&&(n=!0,e[o]=s,e[o+1]=r)}for(o=0;o<e.length;o++)(n=e[o]).valid&&-1===(n=n.fromVertex).index&&ka(t,n)}function Ma(t,i,e){var n=0,o=Aa(t,i),r=t.Td[i],s=ua(t,i,e);for(e=la(t,i,e),n=0;n<r;n++)-1===e[n]&&(e[n]=o[n].column),-1===s[n]&&(s[n]=o[n].column);for(var a,h=!0;h;)for(h=!1,n=0;n<r-1;n++)(s[n+1]<s[n]||s[n+1]===s[n]&&e[n+1]<e[n])&&(h=!0,a=s[n],s[n]=s[n+1],s[n+1]=a,a=e[n],e[n]=e[n+1],e[n+1]=a,a=o[n],o[n]=o[n+1],o[n+1]=a);for(n=s=0;n<r;n++)a=o[n],a.index=n,s+=t.nodeMinColumnSpace(a,!0),a.column=s,s+=1,s+=t.nodeMinColumnSpace(a,!1);Fa(t,i,o)}function Pa(t,i,e){var n=Aa(t,i),o=t.Td[i];e=aa(t,i,e);var r,s=0;for(r=[],s=0;s<o;s++)r[s]=-1;var a;for(a=[],s=0;s<o;s++)a[s]=-1;for(var h=!1,l=!0;l;)for(l=!1,s=0;s<o-1;s++){var u=e[n[s].index*o+n[s+1].index],f=e[n[s+1].index*o+n[s].index],c=0,p=0,d=n[s].column,y=n[s+1].column,v=t.nodeMinColumnSpace(n[s],!0),g=t.nodeMinColumnSpace(n[s],!1),m=t.nodeMinColumnSpace(n[s+1],!0),b=t.nodeMinColumnSpace(n[s+1],!1),v=d-v+m,g=y-g+b,m=m=0;for((x=n[s].lc.i).reset();x.next();)if((b=x.value).valid&&b.fromVertex.layer===i){for(b=b.fromVertex,m=0;n[m]!==b;)m++;m<s&&(c+=2*(s-m),p+=2*(s+1-m)),m===s+1&&(c+=1),m>s+1&&(c+=4*(m-s),p+=4*(m-(s+1)))}for((x=n[s].$b.i).reset();x.next();)if((b=x.value).valid&&b.toVertex.layer===i){for(b=b.toVertex,m=0;n[m]!==b;)m++;m===s+1&&(p+=1)}for((x=n[s+1].lc.i).reset();x.next();)if((b=x.value).valid&&b.fromVertex.layer===i){for(b=b.fromVertex,m=0;n[m]!==b;)m++;m<s&&(c+=2*(s+1-m),p+=2*(s-m)),m===s&&(p+=1),m>s+1&&(c+=4*(m-(s+1)),p+=4*(m-s))}for((x=n[s+1].$b.i).reset();x.next();)if((b=x.value).valid&&b.toVertex.layer===i){for(b=b.toVertex,m=0;n[m]!==b;)m++;m===s&&(c+=1)}var m=b=0,x=r[n[s].index],w=a[n[s].index],k=r[n[s+1].index],M=a[n[s+1].index];-1!==x&&(b+=Math.abs(x-d),m+=Math.abs(x-g)),-1!==w&&(b+=Math.abs(w-d),m+=Math.abs(w-g)),-1!==k&&(b+=Math.abs(k-y),m+=Math.abs(k-v)),-1!==M&&(b+=Math.abs(M-y),m+=Math.abs(M-v)),(p<c-.5||p===c&&f<u-.5||p===c&&f===u&&m<b-.5)&&(l=h=!0,n[s].column=g,n[s+1].column=v,u=n[s],n[s]=n[s+1],n[s+1]=u)}for(s=0;s<o;s++)n[s].index=s;return Fa(t,i,n),h}function Ta(t,i,e){for(var n=!1;function(t,i,e){var n=0,o=Aa(t,i),r=t.Td[i],s=la(t,i,-1);if(0<e)for(n=0;n<r;n++)s[n]=-1;var a=la(t,i,1);if(0>e)for(n=0;n<r;n++)a[n]=-1;for(var h=!1,l=!0;l;)for(l=!1,n=0;n<r;n++){var u=o[n].column,f=t.nodeMinColumnSpace(o[n],!0),c=t.nodeMinColumnSpace(o[n],!1),p=0,p=0>n-1||u-o[n-1].column-1>f+t.nodeMinColumnSpace(o[n-1],!1)?u-1:u,f=0,f=n+1>=r||o[n+1].column-u-1>c+t.nodeMinColumnSpace(o[n+1],!0)?u+1:u,d=c=0,y=0,v=0,g=0,m=0;if(0>=e)for(var b=o[n].lc.i;b.next();){var x=b.value;x.valid&&x.fromVertex.layer!==i&&(v=oa(x),g=x.portFromColOffset,m=x.portToColOffset,x=x.fromVertex.column,c+=(Math.abs(u+m-(x+g))+1)*v,d+=(Math.abs(p+m-(x+g))+1)*v,y+=(Math.abs(f+m-(x+g))+1)*v)}if(0<=e)for(b=o[n].$b.i;b.next();)(x=b.value).valid&&x.toVertex.layer!==i&&(v=oa(x),g=x.portFromColOffset,m=x.portToColOffset,x=x.toVertex.column,c+=(Math.abs(u+g-(x+m))+1)*v,d+=(Math.abs(p+g-(x+m))+1)*v,y+=(Math.abs(f+g-(x+m))+1)*v);m=g=v=0,b=s[o[n].index],x=a[o[n].index],-1!==b&&(v+=Math.abs(b-u),g+=Math.abs(b-p),m+=Math.abs(b-f)),-1!==x&&(v+=Math.abs(x-u),g+=Math.abs(x-p),m+=Math.abs(x-f)),(d<c||d===c&&g<v)&&(l=h=!0,o[n].column=p),(y<c||y===c&&m<v)&&(l=h=!0,o[n].column=f)}return Fa(t,i,o),t.normalize(),h}(t,i,e);)n=!0;return n}function Sa(t,i,e){var n=0,o=Aa(t,i),r=t.Td[i],s=ua(t,i,e);for(e=[],n=0;n<r;n++)e[n]=s[n];for(s=!0;s;)for(s=!1,n=0;n<r;n++){var a=o[n].column,h=t.nodeMinColumnSpace(o[n],!0),l=t.nodeMinColumnSpace(o[n],!1),u=0,f=0,c=0,c=f=0;-1===e[n]?0===n&&n===r-1?u=a:0===n?(f=o[n+1].column,u=f-a===l+t.nodeMinColumnSpace(o[n+1],!0)?a-1:a):n===r-1?(c=o[n-1].column,u=a-c===h+t.nodeMinColumnSpace(o[n-1],!1)?a+1:a):(c=o[n-1].column,c=c+t.nodeMinColumnSpace(o[n-1],!1)+h+1,f=o[n+1].column,f=f-t.nodeMinColumnSpace(o[n+1],!0)-l-1,u=(c+f)/2|0):0===n&&n===r-1?u=e[n]:0===n?(f=o[n+1].column,f=f-t.nodeMinColumnSpace(o[n+1],!0)-l-1,u=Math.min(e[n],f)):n===r-1?(c=o[n-1].column,c=c+t.nodeMinColumnSpace(o[n-1],!1)+h+1,u=Math.max(e[n],c)):(c=o[n-1].column,c=c+t.nodeMinColumnSpace(o[n-1],!1)+h+1,f=o[n+1].column,f=f-t.nodeMinColumnSpace(o[n+1],!0)-l-1,c<e[n]&&e[n]<f?u=e[n]:c>=e[n]?u=c:f<=e[n]&&(u=f)),u!==a&&(s=!0,o[n].column=u)}Fa(t,i,o),t.normalize()}function Na(t,i){for(var e=!0,n=t.network.vertexes.i;n.next();){var o=n.value,r=t.nodeMinColumnSpace(o,!0),s=t.nodeMinColumnSpace(o,!1);if(o.column-r<=i&&o.column+s>=i){e=!1;break}}if(o=!1,e)for(n.reset();n.next();)(e=n.value).column>i&&(e.column-=1,o=!0);return o}function Ca(t,i){for(var e=i,e=i+1,n=0,o=[],r=[],n=0;n<=t.qb;n++)o[n]=!1,r[n]=!1;for(var s=t.network.vertexes.i;s.next();){var a=(n=s.value).column-t.nodeMinColumnSpace(n,!0),h=n.column+t.nodeMinColumnSpace(n,!1);a<=i&&h>=i&&(o[n.layer]=!0),a<=e&&h>=e&&(r[n.layer]=!0)}for(a=!0,e=!1,n=0;n<=t.qb;n++)a=a&&!(o[n]&&r[n]);if(a)for(s.reset();s.next();)(o=s.value).column>i&&(o.column-=1,e=!0);return e}function ja(t,i){for(n=0;n<=t.Hb;n++)for(;Na(t,n););for(t.normalize(),n=0;n<t.Hb;n++)for(;Ca(t,n););t.normalize();var e,n=0,o=0,r=0,s=0;if(0<i)for(n=0;n<=t.Hb;n++)for(e=ra(t),o=ha(t),r=o+1;o<r;)r=o,La(t,n,1),(s=ha(t))>o?sa(t,e):s<o&&(o=s,e=ra(t));if(0>i)for(n=t.Hb;0<=n;n--)for(e=ra(t),o=ha(t),r=o+1;o<r;)r=o,La(t,n,-1),(s=ha(t))>o?sa(t,e):s<o&&(o=s,e=ra(t));t.normalize()}function La(t,i,e){t.lg=0;for(var n=t.network.vertexes.i;n.next();)n.value.component=-1;if(0<e)for(n.reset();n.next();){var o=n.value;o.column-t.nodeMinColumnSpace(o,!0)<=i&&(o.component=t.lg)}if(0>e)for(n.reset();n.next();)(o=n.value).column+t.nodeMinColumnSpace(o,!1)>=i&&(o.component=t.lg);for(t.lg++,n.reset();n.next();)-1===(i=n.value).component&&(ca(t,i,t.lg,-1,!0,!0),t.lg++);r=0;for(i=[],r=0;r<t.lg*t.lg;r++)i[r]=!1;for(o=[],r=0;r<(t.qb+1)*(t.Hb+1);r++)o[r]=-1;for(n.reset();n.next();)for(var r=n.value,s=r.layer,a=Math.max(0,r.column-t.nodeMinColumnSpace(r,!0)),h=Math.min(t.Hb,r.column+t.nodeMinColumnSpace(r,!1));a<=h;a++)o[s*(t.Hb+1)+a]=r.component;for(r=0;r<=t.qb;r++){if(0<e)for(a=0;a<t.Hb;a++)-1!==o[r*(t.Hb+1)+a]&&-1!==o[r*(t.Hb+1)+a+1]&&o[r*(t.Hb+1)+a]!==o[r*(t.Hb+1)+a+1]&&(i[o[r*(t.Hb+1)+a]*t.lg+o[r*(t.Hb+1)+a+1]]=!0);if(0>e)for(a=t.Hb;0<a;a--)-1!==o[r*(t.Hb+1)+a]&&-1!==o[r*(t.Hb+1)+a-1]&&o[r*(t.Hb+1)+a]!==o[r*(t.Hb+1)+a-1]&&(i[o[r*(t.Hb+1)+a]*t.lg+o[r*(t.Hb+1)+a-1]]=!0)}for(o=[],r=0;r<t.lg;r++)o[r]=!0;for((s=new u("number")).add(0),h=0;0!==s.count;)if(h=s.n[s.count-1],s.Vc(s.count-1),o[h])for(o[h]=!1,r=0;r<t.lg;r++)i[h*t.lg+r]&&s.Cd(0,r);if(0<e)for(n.reset();n.next();)t=n.value,o[t.component]&&(t.column-=1);if(0>e)for(n.reset();n.next();)e=n.value,o[e.component]&&(e.column+=1)}function Da(t,i){return 270===t.ca?i?Ih:Vh:90===t.ca?i?Vh:Ih:180===t.ca?i?Rh:Gh:i?Gh:Rh}function Aa(t,i){var e,n=t.Td[i];if(n>=t.Pg.length){e=[];for(var o=0;o<t.Pg.length;o++)e[o]=t.Pg[o];t.Pg=e}for(void 0===t.Pg[n]||null===t.Pg[n]?e=[]:(e=t.Pg[n],t.Pg[n]=null),n=t.Mr[i],o=0;o<n.length;o++){var r=n[o];e[r.index]=r}return e}function Fa(t,i,e){t.Pg[t.Td[i]]=e}function za(){this.index=this.Yd=this.Je=this.Rd=this.first=this.layer=0,this.link=null,this.di=0}function Oa(){Ps.call(this)}function qa(){Cs.call(this),this.index=this.column=this.layer=-1,this.component=NaN,this.near=null,this.valid=!1,this.finish=this.$o=NaN,this.Km=0,this.oA=this.pA=null}function Ba(){js.call(this),this.forest=this.rev=this.valid=!1,this.portToPos=this.portFromPos=NaN,this.portToColOffset=this.portFromColOffset=0}function Ea(){0<arguments.length&&xh.fd(Ea),ks.call(this),this.xd=new c(Object),this.Wr=Cc,this.Ef=jc,this.Ns=Uc,this.Bv=$c,this.oB=null,this.xh=!0,this.hd=Xc,this.bg=new k(10,10).freeze(),this.sa=new yh,this.ua=new yh,this.jz=[]}function Ia(t,i){if(null!==i){switch(t.Ef){case jc:if(0<i.$b.count){for(var e=new u(yh),n=i.rH;n.next();){var o=n.value;Ra(t,i,o)&&e.add(o)}0<e.count&&(i.children=e.dc())}break;case Lc:if(0<i.lc.count){for(e=new u(yh),n=i.sJ;n.next();)o=n.value,Ra(t,i,o)&&e.add(o);0<e.count&&(i.children=e.dc())}break;default:xh.k("Unhandled path value"+t.Ef.toString())}for(n=(e=i.children).length,o=0;o<n;o++){var r=e[o];r.initialized=!0,r.level=i.level+1,r.parent=i,t.xd.remove(r)}for(o=0;o<n;o++)r=e[o],Ia(t,r)}}function Ra(t,i,e){if(e.initialized){var n;if(null===i)n=!1;else{for(n=i.parent;null!==n&&n!==e;)n=n.parent;n=n===e}if(n||e.level>i.level)return!1;t.removeChild(e.parent,e)}return!0}function Ga(t,i){if(null!==i){t.initializeTreeVertexValues(i),i.alignment===Rc&&t.sortTreeVertexChildren(i);for(var e=0,n=i.Mm,o=0,r=i.children,s=r.length,a=0;a<s;a++){var h=r[a];Ga(t,h),e+=h.descendantCount+1,n=Math.max(n,h.maxChildrenCount),o=Math.max(o,h.maxGenerationCount)}i.descendantCount=e,i.maxChildrenCount=n,i.maxGenerationCount=0<n?o+1:0}}function Va(t,i){if(null!==i){t.assignTreeVertexValues(i);for(var e=i.children,n=e.length,o=0;o<n;o++)Va(t,e[o])}}function Ha(t,i){if(null!==i){i.alignment!==Rc&&t.sortTreeVertexChildren(i);for(var e=i.children,n=e.length,o=0;o<n;o++)Ha(t,e[o])}}function Ka(t){return t===Ic||t===Rc||t===Gc||t===Vc}function Ua(t){return t===Ic||t===Rc}function Ja(t){var i=t.parent;if(null!==i){var e=i.alignment;if(Ka(e)){if(Ua(e)){for(i=i.children,e=0;e<i.length&&t!==i[e];)e++;return 0==e%2}if(e===Gc)return!0}}return!1}function Ya(t,i){if(0===i.Mm){var e=!1,n=0,o=qc;null!==i.parent&&(n=i.parent.angle,o=i.parent.alignment,e=Ka(o)),o=Ja(i),i.na.m(0,0),i.hb.m(i.width,i.height),null===i.parent||null===i.comments||(180!==n&&270!==n||e)&&!o?i.Ma.m(0,0):180===n&&!e||(90===n||270===n)&&o?i.Ma.m(i.width-2*i.O.x,0):i.Ma.m(0,i.height-2*i.O.y)}else{for(var n=90===(e=fh(i))||270===e,r=0,s=(o=i.children).length,a=0;a<s;a++)var h=o[a],r=Math.max(r,n?h.hb.width:h.hb.height);var l=i.alignment,u=l===Bc,f=l===Ec,c=Ka(l),p=Math.max(0,i.breadthLimit),d=ch(i),y=i.nodeSpacing,v=ph(i),g=u||f?0:v/2,m=i.rowSpacing,b=0;(u||f||i.Jp||i.Kp&&1===i.maxGenerationCount)&&(b=Math.max(0,i.rowIndent));var u=i.width,x=i.height,w=0,k=0,M=0,P=0,T=0,S=0,N=0,C=0,j=0,L=0;if(c&&!Ua(l)&&135<e&&o.reverse(),Ua(l))if(1<s)for(a=0;a<s;a++){var D=(h=o[a]).hb;0==a%2&&a!==s-1?j=Math.max(j,(n?D.width:D.height)+Qa(h)-y):0!=a%2&&(L=Math.max(L,(n?D.width:D.height)+Qa(h)-y))}else 1===s&&(j=n?o[0].hb.width:o[0].hb.height);if(c)switch(l){case Ic:case Rc:j=(k=135>e?Wa(i,o,j,w,k):Xa(i,o,j,w,k)).x,w=k.width,k=k.height;break;case Gc:for(a=0;a<s;a++)h=o[a],D=h.hb,p=0===N?0:m,n?(h.na.m(r-D.width,T+p),w=Math.max(w,D.width),k=Math.max(k,T+p+D.height),T+=p+D.height):(h.na.m(P+p,r-D.height),w=Math.max(w,P+p+D.width),k=Math.max(k,D.height),P+=p+D.width),N++;break;case Vc:for(r=0;r<s;r++)h=o[r],D=h.hb,p=0===N?0:m,n?(h.na.m(y/2+i.O.x,T+p),w=Math.max(w,D.width),k=Math.max(k,T+p+D.height),T+=p+D.height):(h.na.m(P+p,y/2+i.O.y),w=Math.max(w,P+p+D.width),k=Math.max(k,D.height),P+=p+D.width),N++}else for(a=0;a<s;a++)h=o[a],D=h.hb,n?(0<p&&0<N&&P+y+D.width>p&&(P<r&&eh(i,l,r-P,0,C,a-1),S++,N=0,C=a,M=k,P=0,T=135<e?-k-m:k+m),L=0===N?g:y,oh(t,h,0,T),h.na.m(P+L,T),w=Math.max(w,P+L+D.width),k=Math.max(k,M+(0===S?0:m)+D.height),P+=L+D.width):(0<p&&0<N&&T+y+D.height>p&&(T<r&&eh(i,l,0,r-T,C,a-1),S++,N=0,C=a,M=w,T=0,P=135<e?-w-m:w+m),L=0===N?g:y,oh(t,h,P,0),h.na.m(P,T+L),k=Math.max(k,T+L+D.height),w=Math.max(w,M+(0===S?0:m)+D.width),T+=L+D.height),N++;switch(0<S&&(n?(k+=Math.max(0,d),P<w&&eh(i,l,w-P,0,C,s-1),0<b&&(f||nh(i,b,0,0,s-1),w+=b)):(w+=Math.max(0,d),T<k&&eh(i,l,0,k-T,C,s-1),0<b&&(f||nh(i,0,b,0,s-1),k+=b))),b=f=0,l){case Oc:n?f+=w/2-i.O.x-v/2:b+=k/2-i.O.y-v/2;break;case qc:0<S?n?f+=w/2-i.O.x-v/2:b+=k/2-i.O.y-v/2:n?(l=o[0].na.x+o[0].Ma.x,y=o[s-1].na.x+o[s-1].Ma.x+2*o[s-1].O.x,f+=l+(y-l)/2-i.O.x-v/2):(l=o[0].na.y+o[0].Ma.y,y=o[s-1].na.y+o[s-1].Ma.y+2*o[s-1].O.y,b+=l+(y-l)/2-i.O.y-v/2);break;case Bc:n?(f-=v,w+=v):(b-=v,k+=v);break;case Ec:n?(f+=w-i.width+v,w+=v):(b+=k-i.height+v,k+=v);break;case Ic:case Rc:n?f=1<s?f+(j+y/2-i.O.x):f+(o[0].O.x-i.O.x+o[0].Ma.x):b=1<s?b+(j+y/2-i.O.y):b+(o[0].O.y-i.O.y+o[0].Ma.y);break;case Gc:n?f+=w+y/2-i.O.x:b+=k+y/2-i.O.y;break;case Vc:break;default:xh.k("Unhandled alignment value "+l.toString())}for(a=0;a<s;a++)h=o[a],n?h.na.m(h.na.x+h.Ma.x-f,h.na.y+(135<e?(c?-k:-h.hb.height)+h.Ma.y-d:x+d+h.Ma.y)):h.na.m(h.na.x+(135<e?(c?-w:-h.hb.width)+h.Ma.x-d:u+d+h.Ma.x),h.na.y+h.Ma.y-b);n?(w=_a(i,w,f),0>f&&(f=0),135<e&&(b+=k+d),k+=x+d):(135<e&&(f+=w+d),w+=u+d,k=th(i,k,b),0>b&&(b=0)),i.Ma.m(f,b),i.hb.m(w,k)}}function Wa(t,i,e,n,o){var r=i.length;if(0===r)return new M(e,0,n,o);if(1===r){return n=(p=i[0]).hb.width,o=p.hb.height,new M(e,0,n,o)}for(var s=t.nodeSpacing,a=t.rowSpacing,h=90===fh(t),l=0,u=0,f=0,c=0;c<r;c++)if(!(0!=c%2||1<r&&c===r-1)){var p=i[c],d=p.hb,y=0===l?0:a;if(h){var v=Qa(p)-s;p.na.m(e-(d.width+v),f+y),n=Math.max(n,d.width+v),o=Math.max(o,f+y+d.height),f+=y+d.height}else v=Qa(p)-s,p.na.m(u+y,e-(d.height+v)),o=Math.max(o,d.height+v),n=Math.max(n,u+y+d.width),u+=y+d.width;l++}var l=0,g=u,m=f;for(h?(u=e+s,f=0):(u=0,f=e+s),c=0;c<r;c++)0!=c%2&&(p=i[c],d=p.hb,y=0===l?0:a,h?(v=Qa(p)-s,p.na.m(u+v,f+y),n=Math.max(n,u+d.width+v),o=Math.max(o,f+y+d.height),f+=y+d.height):(v=Qa(p)-s,p.na.m(u+y,f+v),n=Math.max(n,u+y+d.width),o=Math.max(o,f+d.height+v),u+=y+d.width),l++);return 1<r&&1==r%2&&(p=i[r-1],d=p.hb,i=Za(p,h?Math.max(Math.abs(m),Math.abs(f)):Math.max(Math.abs(g),Math.abs(u))),h?(p.na.m(e+s/2-p.O.x-p.Ma.x,o+i),h=e+s/2-p.O.x-p.Ma.x,n=Math.max(n,h+d.width),0>h&&(n-=h),o=Math.max(o,Math.max(m,f)+i+d.height),0>p.na.x&&(e=$a(t,p.na.x,!1,e,s))):(p.na.m(n+i,e+s/2-p.O.y-p.Ma.y),n=Math.max(n,Math.max(g,u)+i+d.width),h=e+s/2-p.O.y-p.Ma.y,o=Math.max(o,h+d.height),0>h&&(o-=h),0>p.na.y&&(e=$a(t,p.na.y,!0,e,s)))),new M(e,0,n,o)}function Xa(t,i,e,n,o){var r=i.length;if(0===r)return new M(e,0,n,o);if(1===r){return n=(p=i[0]).hb.width,o=p.hb.height,new M(e,0,n,o)}for(var s=t.nodeSpacing,a=t.rowSpacing,h=270===fh(t),l=0,u=0,f=0,c=0;c<r;c++)if(!(0!=c%2||1<r&&c===r-1)){var p=i[c],d=p.hb,y=0===l?0:a;if(h){var v=Qa(p)-s,f=f-(y+d.height);p.na.m(e-(d.width+v),f),n=Math.max(n,d.width+v),o=Math.max(o,Math.abs(f))}else v=Qa(p)-s,u-=y+d.width,p.na.m(u,e-(d.height+v)),o=Math.max(o,d.height+v),n=Math.max(n,Math.abs(u));l++}var l=0,g=u,m=f;for(h?(u=e+s,f=0):(u=0,f=e+s),c=0;c<r;c++)0!=c%2&&(p=i[c],d=p.hb,y=0===l?0:a,h?(v=Qa(p)-s,f-=y+d.height,p.na.m(u+v,f),n=Math.max(n,u+d.width+v),o=Math.max(o,Math.abs(f))):(v=Qa(p)-s,u-=y+d.width,p.na.m(u,f+v),o=Math.max(o,f+d.height+v),n=Math.max(n,Math.abs(u))),l++);for(1<r&&1==r%2&&(p=i[r-1],d=p.hb,a=Za(p,h?Math.max(Math.abs(m),Math.abs(f)):Math.max(Math.abs(g),Math.abs(u))),h?(p.na.m(e+s/2-p.O.x-p.Ma.x,-o-d.height-a),u=e+s/2-p.O.x-p.Ma.x,n=Math.max(n,u+d.width),0>u&&(n-=u),o=Math.max(o,Math.abs(Math.min(m,f))+a+d.height),0>p.na.x&&(e=$a(t,p.na.x,!1,e,s))):(p.na.m(-n-d.width-a,e+s/2-p.O.y-p.Ma.y),n=Math.max(n,Math.abs(Math.min(g,u))+a+d.width),u=e+s/2-p.O.y-p.Ma.y,o=Math.max(o,u+d.height),0>u&&(o-=u),0>p.na.y&&(e=$a(t,p.na.y,!0,e,s)))),c=0;c<r;c++)p=i[c],h?p.na.m(p.na.x,p.na.y+o):p.na.m(p.na.x+n,p.na.y);return new M(e,0,n,o)}function Qa(t){return null===t.parent?0:t.parent.nodeSpacing}function Za(t){return null===t.parent?0:t.parent.rowSpacing}function $a(t,i,e,n,o){for(var r=(t=t.children).length,s=0;s<r;s++)e?t[s].na.m(t[s].na.x,t[s].na.y-i):t[s].na.m(t[s].na.x-i,t[s].na.y);return i=t[r-1],Math.max(n,e?i.Ma.y+i.O.y-o/2:i.Ma.x+i.O.x-o/2)}function _a(t,i,e){switch(t.alignment){case qc:case Oc:var n=i;return e+t.width>n&&(n=e+t.width),0>e&&(n-=e),n;case Bc:return t.width>i?t.width:i;case Ec:return 2*t.O.x>i?t.width:i+t.width-2*t.O.x;case Ic:case Rc:return n=Math.min(0,e),e=Math.max(i,e+t.width),Math.max(t.width,e-n);case Gc:return t.width-t.O.x+t.nodeSpacing/2+i;case Vc:return Math.max(t.width,t.O.x+t.nodeSpacing/2+i);default:return i}}function th(t,i,e){switch(t.alignment){case qc:case Oc:var n=i;return e+t.height>n&&(n=e+t.height),0>e&&(n-=e),n;case Bc:return t.height>i?t.height:i;case Ec:return 2*t.O.y>i?t.height:i+t.height-2*t.O.y;case Ic:case Rc:return n=Math.min(0,e),e=Math.max(i,e+t.height),Math.max(t.height,e-n);case Gc:return t.height-t.O.y+t.nodeSpacing/2+i;case Vc:return Math.max(t.height,t.O.y+t.nodeSpacing/2+i);default:return i}}function ih(t,i,e){switch(t){case Oc:case qc:i/=2,e/=2;break;case Bc:e=i=0;break;case Ec:break;default:xh.k("Unhandled alignment value "+t.toString())}return new b(i,e)}function eh(t,i,e,n,o,r){nh(t,(i=ih(i,e,n)).x,i.y,o,r)}function nh(t,i,e,n,o){if(0!==i||0!==e)for(t=t.children;n<=o;n++){var r=t[n].na;r.x+=i,r.y+=e}}function oh(t,i,e,n){var o=i.parent;switch(t.Ef){case jc:for(t=i.lc;t.next();)(i=t.value).fromVertex===o&&i.bs.m(e,n);break;case Lc:for(t=i.$b;t.next();)(i=t.value).toVertex===o&&i.bs.m(e,n);break;default:xh.k("Unhandled path value "+t.Ef.toString())}}function rh(t,i,e){for(var n=0;n<t.length;n++){var o=t[n];o.x+=i,o.y+=e}}function sh(t,i,e,n,o,r,s,a){var h=fh(i),l=90===h||270===h,u=i.nodeSpacing;i=n;var f=o;n=r,o=s;var c=e.Kt,p=e.cu;s=e.hb;var d=l?Math.max(o,s.height):Math.max(n,s.width);if(null!==c&&h===fh(e)||(c=ah(t,2),p=ah(t,2),l?(c[0].m(0,0),c[1].m(0,s.height),p[0].m(s.width,0),p[1].m(p[0].x,c[1].y)):(c[0].m(0,0),c[1].m(s.width,0),p[0].m(0,s.height),p[1].m(c[1].x,p[0].y))),l){if(e=n,n=9999999,!(null===f||2>f.length||null===c||2>c.length))for(l=h=0;h<f.length&&l<c.length;){o=f[h];r=(g=c[l]).x;var y=g.y;r+=e;var v=o;h+1<f.length&&(v=f[h+1]);var g=(m=g).x,m=m.y;l+1<c.length&&(m=c[l+1],g=m.x,m=m.y,g+=e);var b=n;o.y===y?b=r-o.x:o.y>y&&o.y<m?b=r+(o.y-y)/(m-y)*(g-r)-o.x:y>o.y&&y<v.y&&(b=r-(o.x+(y-o.y)/(v.y-o.y)*(v.x-o.x))),b<n&&(n=b),v.y<=o.y?h++:m<=y?l++:(v.y<=m&&h++,m<=v.y&&l++)}if(e-=n,e+=u,h=c,l=e,null===i||2>i.length||null===h||2>h.length)n=null;else{for(u=ah(t,i.length+h.length),n=r=o=0;r<h.length&&h[r].y<i[0].y;)y=h[r++],u[n++].m(y.x+l,y.y);for(;o<i.length;)y=i[o++],u[n++].m(y.x,y.y);for(o=i[i.length-1].y;r<h.length&&h[r].y<=o;)r++;for(;r<h.length&&h[r].y>o;)y=h[r++],u[n++].m(y.x+l,y.y);for(h=ah(t,n),o=0;o<n;o++)h[o].assign(u[o]);hh(t,u),n=h}if(r=p,y=e,null===f||2>f.length||null===r||2>r.length)o=null;else{for(u=ah(t,f.length+r.length),l=v=h=0;h<f.length&&f[h].y<r[0].y;)o=f[h++],u[l++].m(o.x,o.y);for(;v<r.length;)o=r[v++],u[l++].m(o.x+y,o.y);for(r=r[r.length-1].y;h<f.length&&f[h].y<=r;)h++;for(;h<f.length&&f[h].y>r;)o=f[h++],u[l++].m(o.x,o.y);for(o=ah(t,l),h=0;h<l;h++)o[h].assign(u[h]);hh(t,u)}r=Math.max(0,e)+s.width,s=d}else{if(e=o,n=9999999,!(null===f||2>f.length||null===c||2>c.length))for(l=h=0;h<f.length&&l<c.length;)o=f[h],g=c[l],r=g.x,y=g.y,y+=e,v=o,h+1<f.length&&(v=f[h+1]),m=g,g=m.x,m=m.y,l+1<c.length&&(m=c[l+1],g=m.x,m=m.y,m+=e),b=n,o.x===r?b=y-o.y:o.x>r&&o.x<g?b=y+(o.x-r)/(g-r)*(m-y)-o.y:r>o.x&&r<v.x&&(b=y-(o.y+(r-o.x)/(v.x-o.x)*(v.y-o.y))),b<n&&(n=b),v.x<=o.x?h++:g<=r?l++:(v.x<=g&&h++,g<=v.x&&l++);if(e-=n,e+=u,h=c,l=e,null===i||2>i.length||null===h||2>h.length)n=null;else{for(u=ah(t,i.length+h.length),n=r=o=0;r<h.length&&h[r].x<i[0].x;)y=h[r++],u[n++].m(y.x,y.y+l);for(;o<i.length;)y=i[o++],u[n++].m(y.x,y.y);for(o=i[i.length-1].x;r<h.length&&h[r].x<=o;)r++;for(;r<h.length&&h[r].x>o;)y=h[r++],u[n++].m(y.x,y.y+l);for(h=ah(t,n),o=0;o<n;o++)h[o].assign(u[o]);hh(t,u),n=h}if(r=p,y=e,null===f||2>f.length||null===r||2>r.length)o=null;else{for(u=ah(t,f.length+r.length),l=v=h=0;h<f.length&&f[h].x<r[0].x;)o=f[h++],u[l++].m(o.x,o.y);for(;v<r.length;)o=r[v++],u[l++].m(o.x,o.y+y);for(r=r[r.length-1].x;h<f.length&&f[h].x<=r;)h++;for(;h<f.length&&f[h].x>r;)o=f[h++],u[l++].m(o.x,o.y);for(o=ah(t,l),h=0;h<l;h++)o[h].assign(u[h]);hh(t,u)}r=d,s=Math.max(0,e)+s.height}return hh(t,i),hh(t,c),hh(t,f),hh(t,p),a[0]=n,a[1]=o,new M(e,0,r,s)}function ah(t,i){if(void 0!==(e=t.jz[i])&&void 0!==(e=e.pop()))return e;for(var e=[],n=0;n<i;n++)e[n]=new b;return e}function hh(t,i){var e=i.length,n=t.jz[e];void 0===n&&(n=[],t.jz[e]=n),n.push(i)}function lh(t,i,e,n){if(null!==i){i.x=e,i.y=n;for(var o=(i=i.children).length,r=0;r<o;r++){var s=i[r];lh(t,s,e+s.na.x,n+s.na.y)}}}function uh(t,i){if(null!==i){t.setPortSpots(i);for(var e=i.children,n=e.length,o=0;o<n;o++)uh(t,e[o])}}function fh(t){return 45>=(t=t.angle)?0:135>=t?90:225>=t?180:315>=t?270:0}function ch(t){var i=90===(i=fh(t))||270===i,e=t.layerSpacing;if(0<t.layerSpacingParentOverlap)var n=Math.min(1,t.layerSpacingParentOverlap),e=e-(i?t.height*n:t.width*n);return e<(i?-t.height:-t.width)&&(e=i?-t.height:-t.width),e}function ph(t){var i=90===(i=fh(t))||270===i,e=t.nodeIndent;if(0<t.nodeIndentPastParent)var n=Math.min(1,t.nodeIndentPastParent),e=e+(i?t.width*n:t.height*n);return e=Math.max(0,e)}function dh(){Ps.call(this)}function yh(){Cs.call(this),this.initialized=!1,this.parent=null,this.children=[],this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0,this.comments=null,this.na=new b(0,0),this.hb=new k(0,0),this.Ma=new b(0,0),this.Kp=this.Jp=this.fJ=!1,this.cu=this.Kt=null,this.sorting=Dc,this.comparer=Vf,this.angle=0,this.alignment=qc,this.nodeIndentPastParent=this.nodeIndent=0,this.nodeSpacing=20,this.layerSpacing=50,this.layerSpacingParentOverlap=0,this.compaction=Kc,this.breadthLimit=0,this.rowSpacing=25,this.commentSpacing=this.rowIndent=10,this.commentMargin=20,this.setsPortSpot=!0,this.portSpot=jh,this.setsChildPortSpot=!0,this.childPortSpot=jh}function vh(){js.call(this),this.bs=new b(0,0)}function gh(){Mn.call(this),this.Te=null}var mh,bh={};if(!t.document||void 0===t.document.createElement("canvas").getContext)throw t.console&&t.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(t){function i(){return r.apply(t,o.concat(n.call(arguments)))}function e(){}var n=Array.prototype.slice,o=n.call(arguments,1),r=this;return e.prototype=this.prototype,i.prototype=new e,i}),function(){for(var i=0,e=["ms","moz","webkit","o"],n=0;n<e.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[e[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[e[n]+"CancelAnimationFrame"]||t[e[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(e){var n=(new Date).getTime(),o=Math.max(8,16-(n-i)),r=t.setTimeout(function(){e(n+o)},o);return i=n+o,r}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(i){t.clearTimeout(i)})}(),bh.Debug=null;var xh={gd:1,Nc:2,Xc:4,Wc:8,an:void 0!==t.navigator&&0<t.navigator.userAgent.indexOf("534.30")&&0<t.navigator.userAgent.indexOf("Android"),eI:void 0!==t.navigator&&0<t.navigator.userAgent.indexOf("MSIE 10.0"),fI:void 0!==t.navigator&&0<t.navigator.userAgent.indexOf("Trident/7"),JK:void 0!==t.navigator&&0<t.navigator.userAgent.indexOf("Edge/"),fk:void 0!==t.navigator&&void 0!==t.navigator.platform&&0<=t.navigator.platform.toUpperCase().indexOf("MAC"),FE:void 0!==t.navigator&&void 0!==t.navigator.platform&&null!==t.navigator.platform.match(/(iPhone|iPod|iPad)/i),YD:function(t,i,e){var n=-1;return function(){var o=this,r=arguments;-1!==n&&xh.clearTimeout(n),n=xh.setTimeout(function(){n=-1,e||t.apply(o,r)},i),e&&!n&&t.apply(o,r)}},setTimeout:function(i,e){return t.setTimeout(i,e)},clearTimeout:function(i){t.clearTimeout(i)},createElement:function(i){return t.document.createElement(i)},k:function(t){throw Error(t)},la:function(t,i){var e="The object is frozen, so its properties cannot be set: "+t.toString();void 0!==i&&(e+="  to value: "+i),xh.k(e)},A:function(t,i,e,n){t instanceof i||(e=xh.getTypeName(e),void 0!==n&&(e+="."+n),xh.Ed(t,i,e))},j:function(t,i,e,n){typeof t!==i&&(e=xh.getTypeName(e),void 0!==n&&(e+="."+n),xh.Ed(t,i,e))},Ye:function(t,i,e){"number"==typeof t&&isFinite(t)||(i=xh.getTypeName(i),void 0!==e&&(i+="."+e),xh.k(i+" must be a real number type, and not NaN or Infinity: "+t))},rb:function(t,e,n,o){t instanceof i&&t.qe===e||(n=xh.getTypeName(n),void 0!==o&&(n+="."+o),xh.Ed(t,"a constant of class "+xh.df(e),n))},jK:function(t,i){"string"==typeof t?Pu(t)||xh.k('Color "'+t+'" is not a valid color string for '+i):t instanceof kn||xh.k("Value for "+i+" must be a color string or a Brush, not "+t)},Ed:function(t,i,e,n){i=xh.getTypeName(i),e=xh.getTypeName(e),void 0!==n&&(e+="."+n),"string"==typeof t?xh.k(e+" value is not an instance of "+i+': "'+t+'"'):xh.k(e+" value is not an instance of "+i+": "+t)},wa:function(t,i,e,n){e=xh.getTypeName(e),void 0!==n&&(e+="."+n),xh.k(e+" is not in the range "+i+": "+t)},fd:function(t){xh.k(xh.df(t)+" constructor cannot take any arguments.")},La:function(t){xh.k("Collection was modified during iteration: "+t.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(i){t.console&&t.console.log(i)},Va:function(t){return"object"==typeof t&&null!==t},isArray:function(t){return Array.isArray(t)||t instanceof NodeList||t instanceof HTMLCollection},gI:function(t){return Array.isArray(t)},Az:function(t,i,e){xh.isArray(t)||xh.Ed(t,"Array or NodeList or HTMLCollection",i,e)},Xa:function(t){return t.length},il:function(t){return Array.prototype.slice.call(t)},Pa:function(t,i){return Array.isArray(t),t[i]},HD:function(t,i,e){Array.isArray(t)?t[i]=e:xh.k("Cannot replace an object in an HTMLCollection or NodeList at "+i)},zz:function(t,i){if(Array.isArray(t))return t.indexOf(i);for(var e=t.length,n=0;n<e;n++)if(t[n]===i)return n;return-1},Si:function(t,i,e){Array.isArray(t)?i>=t.length?t.push(e):t.splice(i,0,e):xh.k("Cannot insert an object into an HTMLCollection or NodeList: "+e+" at "+i)},Xh:function(t,i){Array.isArray(t)?i>=t.length?t.pop():t.splice(i,1):xh.k("Cannot remove an object from an HTMLCollection or NodeList at "+i)},Zx:[],M:function(){var t=xh.Zx.pop();return void 0===t?new b:t},Ob:function(t,i){var e=xh.Zx.pop();return void 0===e?new b(t,i):(e.x=t,e.y=i,e)},v:function(t){xh.Zx.push(t)},jB:[],Pl:function(){var t=xh.jB.pop();return void 0===t?new k:t},ck:function(t){xh.jB.push(t)},$x:[],ag:function(){var t=xh.$x.pop();return void 0===t?new M:t},lk:function(t,i,e,n){var o=xh.$x.pop();return void 0===o?new M(t,i,e,n):(o.x=t,o.y=i,o.width=e,o.height=n,o)},ic:function(t){xh.$x.push(t)},kB:[],sh:function(){var t=xh.kB.pop();return void 0===t?new L:t},cf:function(t){xh.kB.push(t)},ay:null,q:function(){var t=xh.ay;return null!==t?(xh.ay=null,t):new Xo},s:function(t){t.reset(),xh.ay=t},iB:[],lb:function(){var t=xh.iB.pop();return void 0===t?[]:t},ta:function(t){t.length=0,xh.iB.push(t)},vh:Object.freeze([]),Tl:1,ec:function(t){t.__gohashid=xh.Tl++},zt:function(t){var i=t.__gohashid;return void 0===i&&(i=xh.Tl++,t.__gohashid=i),i},pd:function(t){return t.__gohashid},ea:function(t,i){i.ky=t,bh[t]=i},Ja:function(t,i){function e(){}e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t},Yh:function(t){t.wG=!0},defineProperty:function(t,i,e,n,o){xh.j(t,"function","Util.defineProperty:classfunc"),xh.j(i,"object","Util.defineProperty:propobj"),xh.j(e,"function","Util.defineProperty:getter"),xh.j(n,"function","Util.defineProperty:setter");for(var r in i){if(i=i[r],e={get:e,set:n,enumerable:!0},void 0!==o)for(var s in o)e[s]=o[s];Object.defineProperty(t.prototype,r,e),o=Object.getOwnPropertyDescriptor(t.prototype,r),i&&o&&Object.defineProperty(t.prototype,i,o);break}},LJ:!1,u:function(t,i,e,n){xh.j(t,"function","Util.defineReadOnlyProperty:classfunc"),xh.j(i,"object","Util.defineReadOnlyProperty:propobj"),xh.j(e,"function","Util.defineReadOnlyProperty:getter");for(var o in i){var r=i[o];if(i={get:e,set:function(t){xh.k('The property "'+r+'" is read-only and cannot be set to '+t)},enumerable:!0},void 0!==n)for(var s in n)i[s]=n[s];Object.defineProperty(t.prototype,o,i),n=Object.getOwnPropertyDescriptor(t.prototype,o),r&&n&&Object.defineProperty(t.prototype,r,n);break}},Nd:function(t,i){for(var e in i)i[e]=!0;t.prototype.sG=i},getTypeName:function(t){return void 0===t?"":"string"==typeof t?t:"function"==typeof t?xh.df(t):null===t?"*":""},df:function(t){if("function"==typeof t){if(t.ky)return t.ky;if(t.name)return t.name;var i=t.toString(),e=i.indexOf("(");if(""!==(i=i.substring(9,e).trim()))return t.ky=i}else if("object"==typeof t&&t.constructor)return xh.df(t.constructor);return typeof t},p:function(t,e,n){xh.j(t,"function","Util.defineEnumValue:classfunc"),xh.j(e,"string","Util.defineEnumValue:name"),xh.j(n,"number","Util.defineEnumValue:num"),n=new i(t,e,n),Object.freeze(n),t[e]=n;var o=t.vu;return o instanceof m||(o=new m("string",i),t.vu=o),o.add(e,n),n},sb:function(t,i){if(!t||!i)return null;var e=void 0;try{"function"==typeof i?e=i(t):"function"==typeof t.getAttribute?null===(e=t.getAttribute(i))&&(e=void 0):e=t[i]}catch(t){}return e},Ka:function(t,i,e){if(t&&i)try{"function"==typeof i?i(t,e):"function"==typeof t.setAttribute?t.setAttribute(i,e):t[i]=e}catch(t){}},hu:function(t,i){xh.j(t,"object","Setting properties requires Objects as arguments"),xh.j(i,"object","Setting properties requires Objects as arguments");var e,n=t instanceof eo,o=t instanceof Qi;for(e in i){""===e&&xh.k("Setting properties requires non-empty property names");var r=t,s=e;if(n||o){var a=e.indexOf(".");if(0<a){var h=e.substring(0,a);n?r=t.ae(h):void 0!==(r=t[h])&&null!==r||(r=t.cb[h]),xh.Va(r)?s=e.substr(a+1):xh.k("Unable to find object named: "+h+" in "+t.toString()+" when trying to set property: "+e)}}if("_"!==s[0]&&!xh.vE(r,s)){if(o&&"ModelChanged"===s){t.KG(i[s]);continue}if(o&&"Changed"===s){t.Gm(i[s]);continue}if(o&&xh.vE(t.cb,s))r=t.cb;else{if(o&&rn(t,s)){t.uz(s,i[s]);continue}if(t instanceof nt&&"Changed"===s){t.Gm(i[s]);continue}xh.k('Trying to set undefined property "'+s+'" on object: '+r.toString())}}r[s]=i[e],"_"===s[0]&&r instanceof Mn&&r.HG(s)}},vE:function(t,i){if(t.hasOwnProperty(i))return!0;for(var e=Object.getPrototypeOf(t);e&&e!==Function;){if(e.hasOwnProperty(i))return!0;var n=e.sG;if(n&&n[i])return!0;e=Object.getPrototypeOf(e)}return!1},UI:function(t){for(var i=[],e=0;256>e;e++)i[e]=e;for(var n=0,o=0,e=0;256>e;e++)n=(n+i[e]+119)%256,o=i[e],i[e]=i[n],i[n]=o;for(var n=e=0,r="",s=0;s<t.length;s++)e=(e+1)%256,n=(n+i[e])%256,o=i[e],i[e]=i[n],i[n]=o,r+=String.fromCharCode(t.charCodeAt(s)^i[(i[e]+i[n])%256]);return r},TH:function(t){for(var i=[],e=0;256>e;e++)i["0123456789abcdef".charAt(e>>4)+"0123456789abcdef".charAt(15&e)]=String.fromCharCode(e);t.length%2&&(t="0"+t);for(var n=[],o=0,e=0;e<t.length;e+=2)n[o++]=i[t.substr(e,2)];return""===(t=n.join(""))?"0":t},sg:function(t){return xh.UI(xh.TH(t))},Rl:null,adym:"7da71ca0ad381e90",YG:"@COLOR1",ZG:"@COLOR2"};xh.Rl=function(){var e=t.document.createElement("canvas"),n=e.getContext("2d");n[xh.sg("7ca11abfd022028846")]=xh.sg("398c3597c01238");for(var o=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],r=1;5>r;r++)n[xh.sg("7ca11abfd7330390")](xh.sg(o[r-1]),10,15*r+0);for(n[xh.sg("7ca11abfd022028846")]=xh.sg("39f046ebb36e4b"),r=1;5>r;r++)n[xh.sg("7ca11abfd7330390")](xh.sg(o[r-1]),10,15*r+0);return 4===o.length&&"5"===o[0][0]&&"7"===o[3][0]||(xh.p=function(t,e){var n=new i(t,e,2);Object.freeze(n),t[e]=n;var o=t.vu;return o instanceof m||(o=new m("string",i),t.vu=o),o.add(e,n),n}),e}(),xh.ea("EnumValue",i),i.prototype.toString=function(){return xh.df(this.yB)+"."+this.Qb},xh.u(i,{qe:"classType"},function(){return this.yB}),xh.u(i,{name:"name"},function(){return this.Qb}),xh.u(i,{value:"value"},function(){return this.BG});var wh;i.findName=wh=function(t,i){if(void 0===i||null===i||""===i)return null;xh.j(t,"function","findName:classfunc"),xh.j(i,"string","EnumValue.findName:name");var e=t.vu;return e instanceof m?e.ka(i):null},e.prototype.toString=function(){return this.wB.join("")},e.prototype.add=function(t){""!==t&&this.wB.push(t)},o.prototype.random=function(){var t=this.seed%this.gB*this.Rx-this.seed/this.gB*this.aG;return this.seed=0<t?t:t+this.uu,this.seed*this.WF},xh.u(r,{i:"iterator"},function(){return this}),r.prototype.reset=r.prototype.reset=function(){},r.prototype.next=r.prototype.hasNext=r.prototype.next=function(){return!1},r.prototype.first=r.prototype.first=function(){return null},r.prototype.any=function(){return!1},r.prototype.all=function(){return!0},r.prototype.each=function(){return this},r.prototype.map=function(){return this},r.prototype.filter=function(){return this},r.prototype.concat=function(t){return t.i},xh.u(r,{count:"count"},function(){return 0}),r.prototype.Df=function(){},r.prototype.toString=function(){return"EmptyIterator"};var kh=new r;xh.Nd(s,{key:!0,value:!0}),xh.u(s,{i:"iterator"},function(){return this}),s.prototype.reset=s.prototype.reset=function(){this.key=-1},s.prototype.next=s.prototype.hasNext=s.prototype.next=function(){return-1===this.key&&(this.key=0,!0)},s.prototype.first=s.prototype.first=function(){return this.key=0,this.value},s.prototype.any=function(t){return this.key=-1,t(this.value)},s.prototype.all=function(t){return this.key=-1,t(this.value)},s.prototype.each=function(t){return this.key=-1,t(this.value),this},s.prototype.map=function(t){return new s(t(this.value))},s.prototype.filter=function(t){return t(this.value)?new s(this.value):kh},s.prototype.concat=function(t){return new a(this,t.i)},xh.u(s,{count:"count"},function(){return 1}),s.prototype.Df=function(){this.value=null},s.prototype.toString=function(){return"SingletonIterator("+this.value+")"},xh.Nd(a,{key:!0,value:!0}),xh.u(a,{i:"iterator"},function(){return this}),a.prototype.reset=a.prototype.reset=function(){this.Lk.reset(),this.Mk.reset(),this.yu=!1},a.prototype.next=a.prototype.hasNext=a.prototype.next=function(){if(!this.yu){var t=this.Lk;if(t.next())return this.key=t.key,this.value=t.value,!0;this.yu=!0}return!(!this.yu||!(t=this.Mk).next())&&(this.key=t.key,this.value=t.value,!0)},a.prototype.first=a.prototype.first=function(){return this.reset(),this.next()?this.value:null},a.prototype.any=function(t){return!(!this.Lk.any(t)&&!this.Mk.any(t))},a.prototype.all=function(t){return!(!this.Lk.all(t)||!this.Mk.all(t))},a.prototype.each=function(t){return this.Lk.each(t),this.Mk.each(t),this},a.prototype.map=function(t){return new a(this.Lk.map(t),this.Mk.map(t))},a.prototype.filter=function(t){return new a(this.Lk.filter(t),this.Mk.filter(t))},a.prototype.concat=function(t){return new a(this,t.i)},xh.u(a,{count:"count"},function(){return this.Lk.count+this.Mk.count}),a.prototype.Df=function(){this.value=this.key=null},a.prototype.toString=function(){return"ConcatIterator()"},xh.Nd(h,{key:!0,value:!0}),xh.u(h,{i:"iterator"},function(){return this}),xh.defineProperty(h,{hn:"predicate"},function(){return this.Lh},function(t){this.Lh=t}),h.prototype.reset=h.prototype.reset=function(){var t=this.tc;t.Xb=null,this.gb=t.F,this.Oc=-1},h.prototype.next=h.prototype.hasNext=h.prototype.next=function(){t=this.tc;if(t.F!==this.gb){if(0>this.key)return!1;xh.La(t)}var t,i=(t=t.n).length,e=++this.Oc,n=this.Lh;if(null!==n)for(;e<i;){var o=t[e];if(n(o))return this.key=this.Oc=e,this.value=o,!0;e++}else{if(e<i)return this.key=e,this.value=t[e],!0;this.Df()}return!1},h.prototype.first=h.prototype.first=function(){t=this.tc;this.gb=t.F,this.Oc=0;var t,i=(t=t.n).length,e=this.Lh;if(null!==e){for(var n=0;n<i;){var o=t[n];if(e(o))return this.key=this.Oc=n,this.value=o;n++}return null}return 0<i?(o=t[0],this.key=0,this.value=o):null},h.prototype.any=function(t){var i=this.tc;i.Xb=null;var e=i.F;this.Oc=-1;for(var n=i.n,o=n.length,r=this.Lh,s=0;s<o;s++){var a=n[s];if(null===r||r(a)){if(t(a))return!0;i.F!==e&&xh.La(i)}}return!1},h.prototype.all=function(t){var i=this.tc;i.Xb=null;var e=i.F;this.Oc=-1;for(var n=i.n,o=n.length,r=this.Lh,s=0;s<o;s++){var a=n[s];if(null===r||r(a)){if(!t(a))return!1;i.F!==e&&xh.La(i)}}return!0},h.prototype.each=function(t){var i=this.tc;i.Xb=null;var e=i.F;this.Oc=-1;for(var n=i.n,o=n.length,r=this.Lh,s=0;s<o;s++){var a=n[s];(null===r||r(a))&&(t(a),i.F!==e&&xh.La(i))}return this},h.prototype.map=function(t){var i=this.tc;i.Xb=null;var e=i.F;this.Oc=-1;for(var n=[],o=i.n,r=o.length,s=this.Lh,a=0;a<r;a++){var h=o[a];(null===s||s(h))&&(n.push(t(h)),i.F!==e&&xh.La(i))}return t=new u,t.n=n,t.Bc(),t.i},h.prototype.filter=function(t){var i=this.tc;i.Xb=null;var e=i.F;this.Oc=-1;for(var n=[],o=i.n,r=o.length,s=this.Lh,a=0;a<r;a++){var h=o[a];(null===s||s(h))&&(t(h)&&n.push(h),i.F!==e&&xh.La(i))}return t=new u(i.ja),t.n=n,t.Bc(),t.i},h.prototype.concat=function(t){return this.tc.Xb=null,new a(this,t.i)},xh.u(h,{count:"count"},function(){var t=this.Lh;if(null!==t){for(var i=0,e=this.tc.n,n=e.length,o=0;o<n;o++)t(e[o])&&i++;return i}return this.tc.n.length}),h.prototype.Df=function(){this.key=-1,this.value=null,this.gb=-1,this.Lh=null,this.tc.Xb=this},h.prototype.toString=function(){return"ListIterator@"+this.Oc+"/"+this.tc.count},xh.Nd(l,{key:!0,value:!0}),xh.u(l,{i:"iterator"},function(){return this}),l.prototype.reset=l.prototype.reset=function(){var t=this.tc;t.xj=null,this.gb=t.F,this.Oc=t.n.length},l.prototype.next=l.prototype.hasNext=l.prototype.next=function(){var t=this.tc;if(t.F!==this.gb){if(0>this.key)return!1;xh.La(t)}var i=--this.Oc;return 0<=i?(this.key=i,this.value=t.n[i],!0):(this.Df(),!1)},l.prototype.first=l.prototype.first=function(){var t=this.tc;this.gb=t.F;var i=t.n;return this.Oc=t=i.length-1,0<=t?(i=i[t],this.key=t,this.value=i):null},l.prototype.any=function(t){var i=this.tc;i.xj=null;var e=i.F,n=i.n,o=n.length;for(this.Oc=o,o-=1;0<=o;o--){if(t(n[o]))return!0;i.F!==e&&xh.La(i)}return!1},l.prototype.all=function(t){var i=this.tc;i.xj=null;var e=i.F,n=i.n,o=n.length;for(this.Oc=o,o-=1;0<=o;o--){if(!t(n[o]))return!1;i.F!==e&&xh.La(i)}return!0},l.prototype.each=function(t){var i=this.tc;i.xj=null;var e=i.F,n=i.n,o=n.length;for(this.Oc=o,o-=1;0<=o;o--)t(n[o]),i.F!==e&&xh.La(i);return this},l.prototype.map=function(t){var i=this.tc;i.xj=null;var e=i.F,n=[],o=i.n,r=o.length;for(this.Oc=r,r-=1;0<=r;r--)n.push(t(o[r])),i.F!==e&&xh.La(i);return t=new u,t.n=n,t.Bc(),t.i},l.prototype.filter=function(t){var i=this.tc;i.xj=null;var e=i.F,n=[],o=i.n,r=o.length;for(this.Oc=r,r-=1;0<=r;r--){var s=o[r];t(s)&&n.push(s),i.F!==e&&xh.La(i)}return t=new u(i.ja),t.n=n,t.Bc(),t.i},l.prototype.concat=function(t){return this.tc.xj=null,new a(this,t.i)},xh.u(l,{count:"count"},function(){return this.tc.n.length}),l.prototype.Df=function(){this.key=-1,this.value=null,this.gb=-1,this.tc.xj=this},l.prototype.toString=function(){return"ListIteratorBackwards("+this.Oc+"/"+this.tc.count+")"},xh.ea("List",u),u.prototype.Bc=function(){var t=this.F;999999999<++t&&(t=0),this.F=t},u.prototype.freeze=u.prototype.freeze=function(){return this.D=!0,this},u.prototype.thaw=u.prototype.Oa=function(){return this.D=!1,this},u.prototype.toString=function(){return"List("+xh.getTypeName(this.ja)+")#"+xh.pd(this)},u.prototype.add=u.prototype.push=u.prototype.add=function(t){null!==t&&(this.D&&xh.la(this,t),this.n.push(t),this.Bc())},u.prototype.addAll=u.prototype.Tc=function(t){if(null===t)return this;this.D&&xh.la(this);var i=this.n;if(xh.isArray(t))for(var e=xh.Xa(t),n=0;n<e;n++){var o=xh.Pa(t,n);i.push(o)}else for(t=t.i;t.next();)o=t.value,i.push(o);return this.Bc(),this},u.prototype.clear=u.prototype.clear=function(){this.D&&xh.la(this),this.n.length=0,this.Bc()},u.prototype.contains=u.prototype.has=u.prototype.contains=function(t){return null!==t&&-1!==this.n.indexOf(t)},u.prototype.indexOf=u.prototype.indexOf=function(t){return null===t?-1:this.n.indexOf(t)},u.prototype.elt=u.prototype.get=u.prototype.ha=function(t){var i=this.n;return(0>t||t>=i.length)&&xh.wa(t,"0 <= i < length",u,"elt:i"),i[t]},u.prototype.setElt=u.prototype.set=u.prototype.Dg=function(t,i){var e=this.n;(0>t||t>=e.length)&&xh.wa(t,"0 <= i < length",u,"setElt:i"),this.D&&xh.la(this,t),e[t]=i},u.prototype.first=u.prototype.first=function(){var t=this.n;return 0===t.length?null:t[0]},u.prototype.last=u.prototype.Rd=function(){var t=this.n,i=t.length;return 0<i?t[i-1]:null},u.prototype.pop=u.prototype.pop=function(){this.D&&xh.la(this);var t=this.n;return 0<t.length?t.pop():null},u.prototype.any=function(t){for(var i=this.n,e=this.F,n=i.length,o=0;o<n;o++){if(t(i[o]))return!0;this.F!==e&&xh.La(this)}return!1},u.prototype.all=function(t){for(var i=this.n,e=this.F,n=i.length,o=0;o<n;o++){if(!t(i[o]))return!1;this.F!==e&&xh.La(this)}return!0},u.prototype.each=function(t){for(var i=this.n,e=this.F,n=i.length,o=0;o<n;o++)t(i[o]),this.F!==e&&xh.La(this);return this},u.prototype.map=function(t){for(var i=new u,e=[],n=this.n,o=this.F,r=n.length,s=0;s<r;s++)e.push(t(n[s])),this.F!==o&&xh.La(this);return i.n=e,i.Bc(),i},u.prototype.filter=function(t){for(var i=new u(this.ja),e=[],n=this.n,o=this.F,r=n.length,s=0;s<r;s++){var a=n[s];t(a)&&e.push(a),this.F!==o&&xh.La(this)}return i.n=e,i.Bc(),i},u.prototype.concat=function(t){return this.copy().Tc(t)},u.prototype.insertAt=u.prototype.Cd=function(t,i){0>t&&xh.wa(t,">= 0",u,"insertAt:i"),this.D&&xh.la(this,t);var e=this.n;return t>=e.length?e.push(i):e.splice(t,0,i),this.Bc(),!0},u.prototype.remove=u.prototype.delete=u.prototype.remove=function(t){if(null===t)return!1;this.D&&xh.la(this,t);var i=this.n;return-1!==(t=i.indexOf(t))&&(t===i.length-1?i.pop():i.splice(t,1),this.Bc(),!0)},u.prototype.removeAt=u.prototype.Vc=function(t){var i=this.n;(0>t||t>=i.length)&&xh.wa(t,"0 <= i < length",u,"removeAt:i"),this.D&&xh.la(this,t),t===i.length-1?i.pop():i.splice(t,1),this.Bc()},u.prototype.removeRange=u.prototype.removeRange=function(t,i){var e=this.n;(0>t||t>=e.length)&&xh.wa(t,"0 <= from < length",u,"elt:from"),(0>i||i>=e.length)&&xh.wa(i,"0 <= to < length",u,"elt:to"),this.D&&xh.la(this,t);var n=e.slice((i||t)+1||e.length);e.length=0>t?e.length+t:t,e.push.apply(e,n),this.Bc()},u.prototype.copy=function(){var t=new u(this.ja),i=this.n;return 0<i.length&&(t.n=Array.prototype.slice.call(i)),t},u.prototype.toArray=u.prototype.dc=function(){for(var t=this.n,i=this.count,e=Array(i),n=0;n<i;n++)e[n]=t[n];return e},u.prototype.toSet=u.prototype.GF=function(){for(var t=new c(this.ja),i=this.n,e=this.count,n=0;n<e;n++)t.add(i[n]);return t},u.prototype.sort=u.prototype.sort=function(t){return this.D&&xh.la(this),this.n.sort(t),this.Bc(),this},u.prototype.sortRange=u.prototype.Rp=function(t,i,e){var n=this.n,o=n.length;void 0===i&&(i=0),void 0===e&&(e=o),this.D&&xh.la(this);var r=e-i;if(1>=r)return this;if((0>i||i>=o-1)&&xh.wa(i,"0 <= from < length",u,"sortRange:from"),2===r)return e=n[i],o=n[i+1],0<t(e,o)&&(n[i]=o,n[i+1]=e,this.Bc()),this;if(0===i)if(e>=o)n.sort(t);else for((r=n.slice(0,e)).sort(t),t=0;t<e;t++)n[t]=r[t];else if(e>=o)for((r=n.slice(i)).sort(t),t=i;t<o;t++)n[t]=r[t-i];else for((r=n.slice(i,e)).sort(t),t=i;t<e;t++)n[t]=r[t-i];return this.Bc(),this},u.prototype.reverse=u.prototype.reverse=function(){return this.D&&xh.la(this),this.n.reverse(),this.Bc(),this},xh.u(u,{count:"count"},function(){return this.n.length}),xh.u(u,{size:"size"},function(){return this.n.length}),xh.u(u,{length:"length"},function(){return this.n.length}),xh.u(u,{i:"iterator"},function(){if(0>=this.n.length)return kh;var t=this.Xb;return null!==t?(t.reset(),t):new h(this)}),xh.u(u,{cn:"iteratorBackwards"},function(){if(0>=this.n.length)return kh;var t=this.xj;return null!==t?(t.reset(),t):new l(this)}),xh.Nd(f,{key:!0,value:!0}),xh.u(f,{i:"iterator"},function(){return this}),f.prototype.reset=f.prototype.reset=function(){var t=this.Nh;t.Xb=null,this.gb=t.F,this.fb=null},f.prototype.next=f.prototype.hasNext=f.prototype.next=function(){var t=this.Nh;if(t.F!==this.gb){if(null===this.key)return!1;xh.La(t)}var i=this.fb;return null!==(i=null===i?t.Ea:i.Wa)?(this.fb=i,this.value=i.value,this.key=i.key,!0):(this.Df(),!1)},f.prototype.first=f.prototype.first=function(){var t=this.Nh;if(this.gb=t.F,null!==(t=t.Ea)){this.fb=t;var i=t.value;return this.key=t.key,this.value=i}return null},f.prototype.any=function(t){var i=this.Nh;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(t(n.value))return!0;i.F!==e&&xh.La(i),n=n.Wa}return!1},f.prototype.all=function(t){var i=this.Nh;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(!t(n.value))return!1;i.F!==e&&xh.La(i),n=n.Wa}return!0},f.prototype.each=function(t){var i=this.Nh;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;)t(n.value),i.F!==e&&xh.La(i),n=n.Wa;return this},f.prototype.map=function(t){var i=this.Nh;i.Xb=null;for(var e=new u,n=i.F,o=i.Ea;null!==o;)e.add(t(o.value)),i.F!==n&&xh.La(i),o=o.Wa;return e.i},f.prototype.filter=function(t){var i=this.Nh;i.Xb=null;for(var e=new u(i.ja),n=i.F,o=i.Ea;null!==o;){var r=o.value;t(r)&&e.add(r),i.F!==n&&xh.La(i),o=o.Wa}return e.i},f.prototype.concat=function(t){return this.Nh.Xb=null,new a(this,t.i)},xh.u(f,{count:"count"},function(){return this.Nh.jd}),f.prototype.Df=function(){this.value=this.key=null,this.gb=-1,this.Nh.Xb=this},f.prototype.toString=function(){return null!==this.fb?"SetIterator@"+this.fb.value:"SetIterator"},xh.ea("Set",c),c.prototype.Bc=function(){var t=this.F;999999999<++t&&(t=0),this.F=t},c.prototype.freeze=c.prototype.freeze=function(){return this.D=!0,this},c.prototype.thaw=c.prototype.Oa=function(){return this.D=!1,this},c.prototype.toString=function(){return"Set("+xh.getTypeName(this.ja)+")#"+xh.pd(this)},c.prototype.add=c.prototype.add=function(t){if(null===t)return!1;this.D&&xh.la(this,t);var i=t;return xh.Va(t)&&(i=xh.zt(t)),void 0===this.kd[i]&&(this.jd++,t=new v(t,t),this.kd[i]=t,null===(i=this.Ih)?this.Ea=t:(t.to=i,i.Wa=t),this.Ih=t,this.Bc(),!0)},c.prototype.addAll=c.prototype.Tc=function(t){if(null===t)return this;if(this.D&&xh.la(this),xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.add(xh.Pa(t,e));else for(t=t.i;t.next();)this.add(t.value);return this},c.prototype.contains=c.prototype.has=c.prototype.contains=function(t){if(null===t)return!1;var i=t;return(!xh.Va(t)||void 0!==(i=xh.pd(t)))&&void 0!==this.kd[i]},c.prototype.containsAll=function(t){if(null===t)return!0;for(t=t.i;t.next();)if(!this.contains(t.value))return!1;return!0},c.prototype.containsAny=function(t){if(null===t)return!0;for(t=t.i;t.next();)if(this.contains(t.value))return!0;return!1},c.prototype.first=c.prototype.first=function(){var t=this.Ea;return null===t?null:t.value},c.prototype.any=function(t){for(var i=this.F,e=this.Ea;null!==e;){if(t(e.value))return!0;this.F!==i&&xh.La(this),e=e.Wa}return!1},c.prototype.all=function(t){for(var i=this.F,e=this.Ea;null!==e;){if(!t(e.value))return!1;this.F!==i&&xh.La(this),e=e.Wa}return!0},c.prototype.each=function(t){for(var i=this.F,e=this.Ea;null!==e;)t(e.value),this.F!==i&&xh.La(this),e=e.Wa;return this},c.prototype.map=function(t){for(var i=new c,e=this.F,n=this.Ea;null!==n;)i.add(t(n.value)),this.F!==e&&xh.La(this),n=n.Wa;return i},c.prototype.filter=function(t){for(var i=new c(this.ja),e=this.F,n=this.Ea;null!==n;){var o=n.value;t(o)&&i.add(o),this.F!==e&&xh.La(this),n=n.Wa}return i},c.prototype.concat=function(t){return this.copy().Tc(t)},c.prototype.remove=c.prototype.delete=c.prototype.remove=function(t){if(null===t)return!1;this.D&&xh.la(this,t);var i=t;if(xh.Va(t)&&void 0===(i=xh.pd(t)))return!1;if(void 0===(t=this.kd[i]))return!1;var e=t.Wa,n=t.to;return null!==e&&(e.to=n),null!==n&&(n.Wa=e),this.Ea===t&&(this.Ea=e),this.Ih===t&&(this.Ih=n),delete this.kd[i],this.jd--,this.Bc(),!0},c.prototype.removeAll=c.prototype.CA=function(t){if(null===t)return this;if(this.D&&xh.la(this),xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.remove(xh.Pa(t,e));else for(t=t.i;t.next();)this.remove(t.value);return this},c.prototype.retainAll=function(t){if(null===t||0===this.count)return this;this.D&&xh.la(this);var i=new c(this.ja);i.Tc(t),t=[];for(var e=this.i;e.next();){var n=e.value;i.contains(n)||t.push(n)}return this.CA(t),this},c.prototype.clear=c.prototype.clear=function(){this.D&&xh.la(this),this.kd={},this.jd=0,this.Ih=this.Ea=null,this.Bc()},c.prototype.copy=function(){var t,i=new c(this.ja),e=this.kd;for(t in e)i.add(e[t].value);return i},c.prototype.toArray=c.prototype.dc=function(){var t,i=Array(this.jd),e=this.kd,n=0;for(t in e)i[n]=e[t].value,n++;return i},c.prototype.toList=function(){var t,i=new u(this.ja),e=this.kd;for(t in e)i.add(e[t].value);return i},xh.u(c,{count:"count"},function(){return this.jd}),xh.u(c,{size:"size"},function(){return this.jd}),xh.u(c,{i:"iterator"},function(){if(0>=this.jd)return kh;var t=this.Xb;return null!==t?(t.reset(),t):new f(this)}),xh.Nd(p,{key:!0,value:!0}),xh.u(p,{i:"iterator"},function(){return this}),p.prototype.reset=p.prototype.reset=function(){this.gb=this.Ha.F,this.fb=null},p.prototype.next=p.prototype.hasNext=p.prototype.next=function(){var t=this.Ha;if(t.F!==this.gb){if(null===this.key)return!1;xh.La(t)}var i=this.fb;return null!==(i=null===i?t.Ea:i.Wa)?(this.fb=i,this.value=this.key=t=i.key,!0):(this.Df(),!1)},p.prototype.first=p.prototype.first=function(){var t=this.Ha;return this.gb=t.F,null!==(t=t.Ea)?(this.fb=t,this.value=this.key=t=t.key):null},p.prototype.any=function(t){var i=this.Ha,e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(t(n.key))return!0;i.F!==e&&xh.La(i),n=n.Wa}return!1},p.prototype.all=function(t){var i=this.Ha,e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(!t(n.key))return!1;i.F!==e&&xh.La(i),n=n.Wa}return!0},p.prototype.each=function(t){var i=this.Ha,e=i.F;this.fb=null;for(var n=i.Ea;null!==n;)t(n.key),i.F!==e&&xh.La(i),n=n.Wa;return this},p.prototype.map=function(t){var i=this.Ha,e=i.F;this.fb=null;for(var n=new u,o=i.Ea;null!==o;)n.add(t(o.key)),i.F!==e&&xh.La(i),o=o.Wa;return n.i},p.prototype.filter=function(t){var i=this.Ha,e=i.F;this.fb=null;for(var n=new u(i.yi),o=i.Ea;null!==o;){var r=o.key;t(r)&&n.add(r),i.F!==e&&xh.La(i),o=o.Wa}return n.i},p.prototype.concat=function(t){return new a(this,t.i)},xh.u(p,{count:"count"},function(){return this.Ha.jd}),p.prototype.Df=function(){this.value=this.key=null,this.gb=-1},p.prototype.toString=function(){return null!==this.fb?"MapKeySetIterator@"+this.fb.value:"MapKeySetIterator"},xh.Ja(d,c),d.prototype.freeze=function(){return this},d.prototype.Oa=function(){return this},d.prototype.toString=function(){return"MapKeySet("+this.Ha.toString()+")"},d.prototype.add=d.prototype.set=d.prototype.add=function(){return xh.k("This Set is read-only: "+this.toString()),!1},d.prototype.contains=d.prototype.has=d.prototype.contains=function(t){return this.Ha.contains(t)},d.prototype.remove=d.prototype.delete=d.prototype.remove=function(){return xh.k("This Set is read-only: "+this.toString()),!1},d.prototype.clear=d.prototype.clear=function(){xh.k("This Set is read-only: "+this.toString())},d.prototype.first=d.prototype.first=function(){var t=this.Ha.Ea;return null!==t?t.key:null},d.prototype.any=function(t){for(var i=this.Ha.Ea;null!==i;){if(t(i.key))return!0;i=i.Wa}return!1},d.prototype.all=function(t){for(var i=this.Ha.Ea;null!==i;){if(!t(i.key))return!1;i=i.Wa}return!0},d.prototype.each=function(t){for(var i=this.Ha.Ea;null!==i;)t(i.key),i=i.Wa;return this},d.prototype.map=function(t){for(var i=new c,e=this.Ha.Ea;null!==e;)i.add(t(e.key)),e=e.Wa;return i},d.prototype.filter=function(t){for(var i=new c(this.Ha.yi),e=this.Ha.Ea;null!==e;){var n=e.key;t(n)&&i.add(n),e=e.Wa}return i},d.prototype.concat=function(t){return this.GF().Tc(t)},d.prototype.copy=function(){return new d(this.Ha)},d.prototype.toSet=d.prototype.GF=function(){var t,i=new c(this.Ha.yi),e=this.Ha.kd;for(t in e)i.add(e[t].key);return i},d.prototype.toArray=d.prototype.dc=function(){var t,i=this.Ha.kd,e=Array(this.Ha.jd),n=0;for(t in i)e[n]=i[t].key,n++;return e},d.prototype.toList=function(){var t,i=new u(this.ja),e=this.Ha.kd;for(t in e)i.add(e[t].key);return i},xh.u(d,{count:"count"},function(){return this.Ha.jd}),xh.u(d,{size:"size"},function(){return this.Ha.jd}),xh.u(d,{i:"iterator"},function(){return 0>=this.Ha.jd?kh:new p(this.Ha)}),xh.Nd(y,{key:!0,value:!0}),xh.u(y,{i:"iterator"},function(){return this}),y.prototype.reset=y.prototype.reset=function(){var t=this.Ha;t.yj=null,this.gb=t.F,this.fb=null},y.prototype.next=y.prototype.hasNext=y.prototype.next=function(){var t=this.Ha;if(t.F!==this.gb){if(null===this.key)return!1;xh.La(t)}var i=this.fb;return null!==(i=null===i?t.Ea:i.Wa)?(this.fb=i,this.value=i.value,this.key=i.key,!0):(this.Df(),!1)},y.prototype.first=y.prototype.first=function(){var t=this.Ha;if(this.gb=t.F,null!==(t=t.Ea)){this.fb=t;var i=t.value;return this.key=t.key,this.value=i}return null},y.prototype.any=function(t){var i=this.Ha;i.yj=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(t(n.value))return!0;i.F!==e&&xh.La(i),n=n.Wa}return!1},y.prototype.all=function(t){var i=this.Ha;i.yj=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(!t(n.value))return!1;i.F!==e&&xh.La(i),n=n.Wa}return!0},y.prototype.each=function(t){var i=this.Ha;i.yj=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;)t(n.value),i.F!==e&&xh.La(i),n=n.Wa;return this},y.prototype.map=function(t){var i=this.Ha;i.yj=null;var e=i.F;this.fb=null;for(var n=new u,o=i.Ea;null!==o;)n.add(t(o.value)),i.F!==e&&xh.La(i),o=o.Wa;return n.i},y.prototype.filter=function(t){var i=this.Ha;i.yj=null;var e=i.F;this.fb=null;for(var n=new u(i.yi),o=i.Ea;null!==o;){var r=o.value;t(r)&&n.add(r),i.F!==e&&xh.La(i),o=o.Wa}return n.i},y.prototype.concat=function(t){return this.Ha.yj=null,new a(this,t.i)},xh.u(y,{count:"count"},function(){return this.Ha.jd}),y.prototype.Df=function(){this.value=this.key=null,this.gb=-1,this.Ha.yj=this},y.prototype.toString=function(){return null!==this.fb?"MapValueSetIterator@"+this.fb.value:"MapValueSetIterator"},xh.Nd(v,{key:!0,value:!0}),v.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},xh.Nd(g,{key:!0,value:!0}),xh.u(g,{i:"iterator"},function(){return this}),g.prototype.reset=g.prototype.reset=function(){var t=this.Ha;t.Xb=null,this.gb=t.F,this.fb=null},g.prototype.next=g.prototype.hasNext=g.prototype.next=function(){var t=this.Ha;if(t.F!==this.gb){if(null===this.key)return!1;xh.La(t)}var i=this.fb;return null!==(i=null===i?t.Ea:i.Wa)?(this.fb=i,this.key=i.key,this.value=i.value,!0):(this.Df(),!1)},g.prototype.first=g.prototype.first=function(){var t=this.Ha;return this.gb=t.F,null!==(t=t.Ea)?(this.fb=t,this.key=t.key,this.value=t.value,t):null},g.prototype.any=function(t){var i=this.Ha;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(t(n))return!0;i.F!==e&&xh.La(i),n=n.Wa}return!1},g.prototype.all=function(t){var i=this.Ha;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;){if(!t(n))return!1;i.F!==e&&xh.La(i),n=n.Wa}return!0},g.prototype.each=function(t){var i=this.Ha;i.Xb=null;var e=i.F;this.fb=null;for(var n=i.Ea;null!==n;)t(n),i.F!==e&&xh.La(i),n=n.Wa;return this},g.prototype.map=function(t){var i=this.Ha;i.Xb=null;var e=i.F;this.fb=null;for(var n=new u,o=i.Ea;null!==o;)n.add(t(o)),i.F!==e&&xh.La(i),o=o.Wa;return n.i},g.prototype.filter=function(t){var i=this.Ha;i.Xb=null;var e=i.F;this.fb=null;for(var n=new u,o=i.Ea;null!==o;)t(o)&&n.add(o),i.F!==e&&xh.La(i),o=o.Wa;return n.i},g.prototype.concat=function(t){return this.Ha.Xb=null,new a(this,t.i)},xh.u(g,{count:"count"},function(){return this.Ha.jd}),g.prototype.Df=function(){this.value=this.key=null,this.gb=-1,this.Ha.Xb=this},g.prototype.toString=function(){return null!==this.fb?"MapIterator@"+this.fb:"MapIterator"},xh.ea("Map",m),m.prototype.Bc=function(){var t=this.F;999999999<++t&&(t=0),this.F=t},m.prototype.freeze=m.prototype.freeze=function(){return this.D=!0,this},m.prototype.thaw=m.prototype.Oa=function(){return this.D=!1,this},m.prototype.toString=function(){return"Map("+xh.getTypeName(this.yi)+","+xh.getTypeName(this.Ps)+")#"+xh.pd(this)},m.prototype.add=m.prototype.set=m.prototype.add=function(t,i){this.D&&xh.la(this,t);var e=t;xh.Va(t)&&(e=xh.zt(t));var n=this.kd[e];return void 0===n?(this.jd++,n=new v(t,i),this.kd[e]=n,null===(e=this.Ih)?this.Ea=n:(n.to=e,e.Wa=n),this.Ih=n,this.Bc(),!0):(n.value=i,!1)},m.prototype.addAll=m.prototype.Tc=function(t){if(null===t)return this;if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++){var n=xh.Pa(t,e);this.add(n.key,n.value)}else for(t=t.i;t.next();)this.add(t.key,t.value);return this},m.prototype.first=m.prototype.first=function(){return this.Ea},m.prototype.any=function(t){for(var i=this.F,e=this.Ea;null!==e;){if(t(e))return!0;this.F!==i&&xh.La(this),e=e.Wa}return!1},m.prototype.all=function(t){for(var i=this.F,e=this.Ea;null!==e;){if(!t(e))return!1;this.F!==i&&xh.La(this),e=e.Wa}return!0},m.prototype.each=function(t){for(var i=this.F,e=this.Ea;null!==e;)t(e),this.F!==i&&xh.La(this),e=e.Wa;return this},m.prototype.map=function(t){for(var i=new m(this.yi),e=this.F,n=this.Ea;null!==n;)i.add(n.key,t(n)),this.F!==e&&xh.La(this),n=n.Wa;return i},m.prototype.filter=function(t){for(var i=new m(this.yi,this.Ps),e=this.F,n=this.Ea;null!==n;)t(n)&&i.add(n.key,n.value),this.F!==e&&xh.La(this),n=n.Wa;return i},m.prototype.concat=function(t){return this.copy().Tc(t)},m.prototype.contains=m.prototype.has=m.prototype.contains=function(t){var i=t;return(!xh.Va(t)||void 0!==(i=xh.pd(t)))&&void 0!==this.kd[i]},m.prototype.getValue=m.prototype.get=m.prototype.ka=function(t){var i=t;return xh.Va(t)&&void 0===(i=xh.pd(t))?null:void 0===(t=this.kd[i])?null:t.value},m.prototype.remove=m.prototype.delete=m.prototype.remove=function(t){if(null===t)return!1;this.D&&xh.la(this,t);var i=t;if(xh.Va(t)&&void 0===(i=xh.pd(t)))return!1;if(void 0===(t=this.kd[i]))return!1;var e=t.Wa,n=t.to;return null!==e&&(e.to=n),null!==n&&(n.Wa=e),this.Ea===t&&(this.Ea=e),this.Ih===t&&(this.Ih=n),delete this.kd[i],this.jd--,this.Bc(),!0},m.prototype.clear=m.prototype.clear=function(){this.D&&xh.la(this),this.kd={},this.jd=0,this.Ih=this.Ea=null,this.Bc()},m.prototype.copy=function(){var t,i=new m(this.yi,this.Ps),e=this.kd;for(t in e){var n=e[t];i.add(n.key,n.value)}return i},m.prototype.toArray=m.prototype.dc=function(){var t,i=this.kd,e=Array(this.jd),n=0;for(t in i){var o=i[t];e[n]=new v(o.key,o.value),n++}return e},m.prototype.toKeySet=m.prototype.fj=function(){return new d(this)},xh.u(m,{count:"count"},function(){return this.jd}),xh.u(m,{size:"size"},function(){return this.jd}),xh.u(m,{i:"iterator"},function(){if(0>=this.count)return kh;var t=this.Xb;return null!==t?(t.reset(),t):new g(this)}),xh.u(m,{ME:"iteratorKeys"},function(){return 0>=this.count?kh:new p(this)}),xh.u(m,{NE:"iteratorValues"},function(){if(0>=this.count)return kh;var t=this.yj;return null!==t?(t.reset(),t):new y(this)}),xh.ea("Point",b),xh.Yh(b),xh.Nd(b,{x:!0,y:!0}),b.prototype.assign=function(t){this.x=t.x,this.y=t.y},b.prototype.setTo=b.prototype.m=function(t,i){return this.x=t,this.y=i,this},b.prototype.set=b.prototype.set=function(t){return this.Eb(),this.x=t.x,this.y=t.y,this},b.prototype.copy=function(){var t=new b;return t.x=this.x,t.y=this.y,t},(mh=b.prototype).Fa=function(){return this.D=!0,Object.freeze(this),this},mh.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()},mh.freeze=function(){return this.D=!0,this},mh.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,this},mh.Eb=function(t){if(this.D){var i="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==t&&(i+="  to value: "+t),xh.k(i)}},b.parse=function(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];n&&(e=parseFloat(n));for(var o=0;""===t[i];)i++;return(n=t[i++])&&(o=parseFloat(n)),new b(e,o)}return new b},b.stringify=function(t){return t instanceof b?t.x.toString()+" "+t.y.toString():t.toString()},b.prototype.toString=function(){return"Point("+this.x+","+this.y+")"},b.prototype.equals=b.prototype.L=function(t){return t instanceof b&&(this.x===t.x&&this.y===t.y)},b.prototype.equalTo=b.prototype.Pw=function(t,i){return this.x===t&&this.y===i},b.prototype.equalsApprox=b.prototype.od=function(t){return hl.G(this.x,t.x)&&hl.G(this.y,t.y)},b.prototype.add=b.prototype.add=function(t){return this.Eb(),this.x+=t.x,this.y+=t.y,this},b.prototype.subtract=b.prototype.ou=function(t){return this.Eb(),this.x-=t.x,this.y-=t.y,this},b.prototype.offset=b.prototype.offset=function(t,i){return this.Eb(),this.x+=t,this.y+=i,this},b.prototype.rotate=b.prototype.rotate=function(t){if(this.Eb(),0===t)return this;var i=this.x,e=this.y;if(0===i&&0===e)return this;var n=0,o=0;return 360<=t?t-=360:0>t&&(t+=360),90===t?(n=0,o=1):180===t?(n=-1,o=0):270===t?(n=0,o=-1):(t=t*Math.PI/180,n=Math.cos(t),o=Math.sin(t)),this.x=n*i-o*e,this.y=o*i+n*e,this},b.prototype.scale=b.prototype.scale=function(t,i){return this.x*=t,this.y*=i,this},b.prototype.distanceSquaredPoint=b.prototype.$j=function(t){var i=t.x-this.x;return t=t.y-this.y,i*i+t*t},b.prototype.distanceSquared=b.prototype.ap=function(t,i){var e=t-this.x,n=i-this.y;return e*e+n*n},b.prototype.normalize=b.prototype.normalize=function(){this.Eb();var t=this.x,i=this.y,e=Math.sqrt(t*t+i*i);return 0<e&&(this.x=t/e,this.y=i/e),this},b.prototype.directionPoint=b.prototype.ah=function(t){return x(t.x-this.x,t.y-this.y)},b.prototype.direction=b.prototype.direction=function(t,i){return x(t-this.x,i-this.y)},b.prototype.projectOntoLineSegment=function(t,i,e,n){return hl.fn(t,i,e,n,this.x,this.y,this),this},b.prototype.projectOntoLineSegmentPoint=function(t,i){return hl.fn(t.x,t.y,i.x,i.y,this.x,this.y,this),this},b.prototype.snapToGrid=function(t,i,e,n){return hl.pt(this.x,this.y,t,i,e,n,this),this},b.prototype.snapToGridPoint=function(t,i){return hl.pt(this.x,this.y,t.x,t.y,i.width,i.height,this),this},b.prototype.setRectSpot=b.prototype.iu=function(t,i){return this.Eb(),this.x=t.x+i.x*t.width+i.offsetX,this.y=t.y+i.y*t.height+i.offsetY,this},b.prototype.setSpot=b.prototype.ku=function(t,i,e,n,o){return this.Eb(),this.x=t+o.x*e+o.offsetX,this.y=i+o.y*n+o.offsetY,this},b.prototype.transform=function(t){return t.xb(this),this};var Mh;b.distanceLineSegmentSquared=Mh=function(t,i,e,n,o,r){var s=o-e,a=r-n,h=s*s+a*a,l=-(e-=t)*s-(n-=i)*a;return 0>=l||l>=h?(s=o-t,a=r-i,Math.min(e*e+n*n,s*s+a*a)):(t=s*n-a*e)*t/h};var Ph;b.distanceSquared=Ph=function(t,i,e,n){return t=e-t,i=n-i,t*t+i*i};var Th;b.direction=Th=function(t,i,e,n){return t=e-t,i=n-i,0===t?0<i?90:0>i?270:0:0===i?0<t?0:180:isNaN(t)||isNaN(i)?0:(n=180*Math.atan(Math.abs(i/t))/Math.PI,0>t?n=0>i?n+180:180-n:0>i&&(n=360-n),n)},b.prototype.isReal=b.prototype.K=function(){return isFinite(this.x)&&isFinite(this.y)},xh.ea("Size",k),xh.Yh(k),xh.Nd(k,{width:!0,height:!0}),k.prototype.assign=function(t){this.width=t.width,this.height=t.height},k.prototype.setTo=k.prototype.m=function(t,i){return this.width=t,this.height=i,this},k.prototype.set=k.prototype.set=function(t){return this.Eb(),this.width=t.width,this.height=t.height,this},k.prototype.copy=function(){var t=new k;return t.width=this.width,t.height=this.height,t},(mh=k.prototype).Fa=function(){return this.D=!0,Object.freeze(this),this},mh.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()},mh.freeze=function(){return this.D=!0,this},mh.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,this},mh.Eb=function(t){if(this.D){var i="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==t&&(i+="  to value: "+t),xh.k(i)}},k.parse=function(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];n&&(e=parseFloat(n));for(var o=0;""===t[i];)i++;return(n=t[i++])&&(o=parseFloat(n)),new k(e,o)}return new k},k.stringify=function(t){return t instanceof k?t.width.toString()+" "+t.height.toString():t.toString()},k.prototype.toString=function(){return"Size("+this.width+","+this.height+")"},k.prototype.equals=k.prototype.L=function(t){return t instanceof k&&(this.width===t.width&&this.height===t.height)},k.prototype.equalTo=k.prototype.Pw=function(t,i){return this.width===t&&this.height===i},k.prototype.equalsApprox=k.prototype.od=function(t){return hl.G(this.width,t.width)&&hl.G(this.height,t.height)},k.prototype.isReal=k.prototype.K=function(){return isFinite(this.width)&&isFinite(this.height)},xh.ea("Rect",M),xh.Yh(M),xh.Nd(M,{x:!0,y:!0,width:!0,height:!0}),M.prototype.assign=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},M.prototype.setTo=M.prototype.m=function(t,i,e,n){return this.x=t,this.y=i,this.width=e,this.height=n,this},M.prototype.set=M.prototype.set=function(t){return this.Eb(),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},M.prototype.setPoint=M.prototype.Af=function(t){return this.Eb(),this.x=t.x,this.y=t.y,this},M.prototype.setSize=function(t){return this.Eb(),this.width=t.width,this.height=t.height,this},M.prototype.copy=function(){var t=new M;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},(mh=M.prototype).Fa=function(){return this.D=!0,Object.freeze(this),this},mh.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()},mh.freeze=function(){return this.D=!0,this},mh.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,this},mh.Eb=function(t){if(this.D){var i="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==t&&(i+="  to value: "+t),xh.k(i)}},M.parse=function(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];n&&(e=parseFloat(n));for(var o=0;""===t[i];)i++;(n=t[i++])&&(o=parseFloat(n));for(var r=0;""===t[i];)i++;(n=t[i++])&&(r=parseFloat(n));for(var s=0;""===t[i];)i++;return(n=t[i++])&&(s=parseFloat(n)),new M(e,o,r,s)}return new M},M.stringify=function(t){return t instanceof M?t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString():t.toString()},M.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},M.prototype.equals=M.prototype.L=function(t){return t instanceof M&&(this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height)},M.prototype.equalTo=M.prototype.Pw=function(t,i,e,n){return this.x===t&&this.y===i&&this.width===e&&this.height===n},M.prototype.equalsApprox=M.prototype.od=function(t){return hl.G(this.x,t.x)&&hl.G(this.y,t.y)&&hl.G(this.width,t.width)&&hl.G(this.height,t.height)},M.prototype.containsPoint=M.prototype.Ga=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},M.prototype.containsRect=M.prototype.Zj=function(t){return this.x<=t.x&&t.x+t.width<=this.x+this.width&&this.y<=t.y&&t.y+t.height<=this.y+this.height},M.prototype.contains=M.prototype.contains=function(t,i,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.x<=t&&t+e<=this.x+this.width&&this.y<=i&&i+n<=this.y+this.height},M.prototype.reset=function(){this.Eb(),this.height=this.width=this.y=this.x=0},M.prototype.offset=M.prototype.offset=function(t,i){return this.Eb(),this.x+=t,this.y+=i,this},M.prototype.inflate=M.prototype.Qf=function(t,i){return T(this,i,t,i,t)},M.prototype.addMargin=M.prototype.vw=function(t){return T(this,t.top,t.right,t.bottom,t.left)},M.prototype.subtractMargin=M.prototype.vJ=function(t){return T(this,-t.top,-t.right,-t.bottom,-t.left)},M.prototype.grow=function(t,i,e,n){return T(this,t,i,e,n)},M.prototype.intersectRect=function(t){return S(this,t.x,t.y,t.width,t.height)},M.prototype.intersect=function(t,i,e,n){return S(this,t,i,e,n)},M.prototype.intersectsRect=M.prototype.xg=function(t){return this.yE(t.x,t.y,t.width,t.height)},M.prototype.intersects=M.prototype.yE=function(t,i,e,n){var o=this.width,r=this.x;return!(1/0!==o&&1/0!==e&&(o+=r,e+=t,isNaN(e)||isNaN(o)||r>e||t>o))&&(t=this.height,e=this.y,!(1/0!==t&&1/0!==n&&(t+=e,n+=i,isNaN(n)||isNaN(t)||e>n||i>t)))},M.prototype.unionPoint=M.prototype.gj=function(t){return C(this,t.x,t.y,0,0)},M.prototype.unionRect=M.prototype.ei=function(t){return C(this,t.x,t.y,t.width,t.height)},M.prototype.union=M.prototype.PF=function(t,i,e,n){return this.Eb(),void 0===e&&(e=0),void 0===n&&(n=0),C(this,t,i,e,n)},M.prototype.setSpot=M.prototype.ku=function(t,i,e){return this.Eb(),this.x=t-e.offsetX-e.x*this.width,this.y=i-e.offsetY-e.y*this.height,this};var Sh;M.contains=Sh=function(t,i,e,n,o,r,s,a){return void 0===s&&(s=0),void 0===a&&(a=0),t<=o&&o+s<=t+e&&i<=r&&r+a<=i+n},M.intersects=function(t,i,e,n,o,r,s,a){return e+=t,s+=o,!(t>s||o>e)&&(t=n+i,a+=r,!(i>a||r>t))},xh.defineProperty(M,{left:"left"},function(){return this.x},function(t){this.Eb(t),this.x=t}),xh.defineProperty(M,{top:"top"},function(){return this.y},function(t){this.Eb(t),this.y=t}),xh.defineProperty(M,{right:"right"},function(){return this.x+this.width},function(t){this.Eb(t),this.x+=t-(this.x+this.width)}),xh.defineProperty(M,{bottom:"bottom"},function(){return this.y+this.height},function(t){this.Eb(t),this.y+=t-(this.y+this.height)}),xh.defineProperty(M,{position:"position"},function(){return new b(this.x,this.y)},function(t){this.Eb(t),this.x=t.x,this.y=t.y}),xh.defineProperty(M,{size:"size"},function(){return new k(this.width,this.height)},function(t){this.Eb(t),this.width=t.width,this.height=t.height}),xh.defineProperty(M,{hl:"center"},function(){return new b(this.x+this.width/2,this.y+this.height/2)},function(t){this.Eb(t),this.x=t.x-this.width/2,this.y=t.y-this.height/2}),xh.defineProperty(M,{oa:"centerX"},function(){return this.x+this.width/2},function(t){this.Eb(t),this.x=t-this.width/2}),xh.defineProperty(M,{va:"centerY"},function(){return this.y+this.height/2},function(t){this.Eb(t),this.y=t-this.height/2}),M.prototype.isReal=M.prototype.K=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},M.prototype.isEmpty=function(){return 0===this.width&&0===this.height},xh.ea("Margin",j),xh.Yh(j),xh.Nd(j,{top:!0,right:!0,bottom:!0,left:!0}),j.prototype.assign=function(t){this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left},j.prototype.setTo=j.prototype.m=function(t,i,e,n){return this.Eb(),this.top=t,this.right=i,this.bottom=e,this.left=n,this},j.prototype.set=j.prototype.set=function(t){return this.Eb(),this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},j.prototype.copy=function(){var t=new j;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},(mh=j.prototype).Fa=function(){return this.D=!0,Object.freeze(this),this},mh.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()},mh.freeze=function(){return this.D=!0,this},mh.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,this},mh.Eb=function(t){if(this.D){var i="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==t&&(i+="  to value: "+t),xh.k(i)}},j.parse=function(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=NaN;""===t[i];)i++;var n=t[i++];if(n&&(e=parseFloat(n)),isNaN(e))return new j;for(var o=NaN;""===t[i];)i++;if((n=t[i++])&&(o=parseFloat(n)),isNaN(o))return new j(e);for(var r=NaN;""===t[i];)i++;if((n=t[i++])&&(r=parseFloat(n)),isNaN(r))return new j(e,o);for(var s=NaN;""===t[i];)i++;return(n=t[i++])&&(s=parseFloat(n)),isNaN(s)?new j(e,o):new j(e,o,r,s)}return new j},j.stringify=function(t){return t instanceof j?t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString():t.toString()},j.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},j.prototype.equals=j.prototype.L=function(t){return t instanceof j&&(this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left)},j.prototype.equalTo=j.prototype.Pw=function(t,i,e,n){return this.top===t&&this.right===i&&this.bottom===e&&this.left===n},j.prototype.equalsApprox=j.prototype.od=function(t){return hl.G(this.top,t.top)&&hl.G(this.right,t.right)&&hl.G(this.bottom,t.bottom)&&hl.G(this.left,t.left)},j.prototype.isReal=j.prototype.K=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},xh.Yh(L),xh.Nd(L,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0}),L.prototype.set=L.prototype.set=function(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this},L.prototype.copy=function(){var t=new L;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t},L.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},L.prototype.equals=L.prototype.L=function(t){return t instanceof L&&(this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy)},L.prototype.isIdentity=L.prototype.Ft=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy},L.prototype.reset=L.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},L.prototype.multiply=L.prototype.multiply=function(t){var i=this.m12*t.m11+this.m22*t.m12,e=this.m11*t.m21+this.m21*t.m22,n=this.m12*t.m21+this.m22*t.m22,o=this.m11*t.dx+this.m21*t.dy+this.dx,r=this.m12*t.dx+this.m22*t.dy+this.dy;return this.m11=this.m11*t.m11+this.m21*t.m12,this.m12=i,this.m21=e,this.m22=n,this.dx=o,this.dy=r,this},L.prototype.multiplyInverted=L.prototype.VE=function(t){var i=1/(t.m11*t.m22-t.m12*t.m21),e=t.m22*i,n=-t.m12*i,o=-t.m21*i,r=t.m11*i,s=i*(t.m21*t.dy-t.m22*t.dx),a=i*(t.m12*t.dx-t.m11*t.dy);return t=this.m12*e+this.m22*n,i=this.m11*o+this.m21*r,o=this.m12*o+this.m22*r,r=this.m11*s+this.m21*a+this.dx,s=this.m12*s+this.m22*a+this.dy,this.m11=this.m11*e+this.m21*n,this.m12=t,this.m21=i,this.m22=o,this.dx=r,this.dy=s,this},L.prototype.invert=L.prototype.Xz=function(){var t=1/(this.m11*this.m22-this.m12*this.m21),i=-this.m12*t,e=-this.m21*t,n=this.m11*t,o=t*(this.m21*this.dy-this.m22*this.dx),r=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*t,this.m12=i,this.m21=e,this.m22=n,this.dx=o,this.dy=r,this},L.prototype.rotate=L.prototype.rotate=function(t,i,e){if(360<=t?t-=360:0>t&&(t+=360),0===t)return this;this.translate(i,e);var n=0,o=0;90===t?(n=0,o=1):180===t?(n=-1,o=0):270===t?(n=0,o=-1):(o=t*Math.PI/180,n=Math.cos(o),o=Math.sin(o)),t=this.m12*n+this.m22*o;var r=this.m11*-o+this.m21*n,s=this.m12*-o+this.m22*n;return this.m11=this.m11*n+this.m21*o,this.m12=t,this.m21=r,this.m22=s,this.translate(-i,-e),this},L.prototype.translate=L.prototype.translate=function(t,i){return this.dx+=this.m11*t+this.m21*i,this.dy+=this.m12*t+this.m22*i,this},L.prototype.scale=L.prototype.scale=function(t,i){return void 0===i&&(i=t),this.m11*=t,this.m12*=t,this.m21*=i,this.m22*=i,this},L.prototype.transformPoint=L.prototype.xb=function(t){var i=t.x,e=t.y;return t.x=i*this.m11+e*this.m21+this.dx,t.y=i*this.m12+e*this.m22+this.dy,t},L.prototype.invertedTransformPoint=L.prototype.$h=function(t){var i=1/(this.m11*this.m22-this.m12*this.m21),e=-this.m12*i,n=this.m11*i,o=i*(this.m12*this.dx-this.m11*this.dy),r=t.x,s=t.y;return t.x=r*this.m22*i+s*-this.m21*i+i*(this.m21*this.dy-this.m22*this.dx),t.y=r*e+s*n+o,t},L.prototype.transformRect=L.prototype.NF=function(t){var i=t.x,e=t.y,n=i+t.width,o=e+t.height,r=this.m11,s=this.m12,a=this.m21,h=this.m22,l=this.dx,u=this.dy,f=i*r+e*a+l,c=i*s+e*h+u,p=n*r+e*a+l,e=n*s+e*h+u,d=i*r+o*a+l,i=i*s+o*h+u,r=n*r+o*a+l,n=n*s+o*h+u,o=f,s=c,f=Math.min(f,p),o=Math.max(o,p),s=Math.min(s,e),c=Math.max(c,e),f=Math.min(f,d),o=Math.max(o,d),s=Math.min(s,i),c=Math.max(c,i),f=Math.min(f,r),o=Math.max(o,r),s=Math.min(s,n),c=Math.max(c,n);return t.x=f,t.y=s,t.width=o-f,t.height=c-s,t},xh.ea("Spot",D),xh.Yh(D),xh.Nd(D,{x:!0,y:!0,offsetX:!0,offsetY:!0}),D.prototype.assign=function(t){this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY},D.prototype.setTo=D.prototype.m=function(t,i,e,n){return this.Eb(),this.x=t,this.y=i,this.offsetX=e,this.offsetY=n,this},D.prototype.set=D.prototype.set=function(t){return this.Eb(),this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},D.prototype.copy=function(){var t=new D;return t.x=this.x,t.y=this.y,t.offsetX=this.offsetX,t.offsetY=this.offsetY,t},(mh=D.prototype).Fa=function(){return this.D=!0,Object.freeze(this),this},mh.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()},mh.freeze=function(){return this.D=!0,this},mh.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,this},mh.Eb=function(t){if(this.D){var i="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==t&&(i+="  to value: "+t),xh.k(i)}};var Nh;D.parse=Nh=function(t){if("string"==typeof t){if("None"===(t=t.trim()))return Ch;if("TopLeft"===t)return Lh;if("Top"===t||"TopCenter"===t||"MiddleTop"===t)return Dh;if("TopRight"===t)return Ah;if("Left"===t||"LeftCenter"===t||"MiddleLeft"===t)return Fh;if("Center"===t)return zh;if("Right"===t||"RightCenter"===t||"MiddleRight"===t)return Oh;if("BottomLeft"===t)return qh;if("Bottom"===t||"BottomCenter"===t||"MiddleBottom"===t)return Bh;if("BottomRight"===t)return Eh;if("TopSide"===t)return Yh;if("LeftSide"===t)return Wh;if("RightSide"===t)return Xh;if("BottomSide"===t)return Qh;if("TopBottomSides"===t)return Zh;if("LeftRightSides"===t)return $h;if("TopLeftSides"===t)return _h;if("TopRightSides"===t)return tl;if("BottomLeftSides"===t)return il;if("BottomRightSides"===t)return el;if("NotTopSide"===t)return nl;if("NotLeftSide"===t)return ol;if("NotRightSide"===t)return rl;if("NotBottomSide"===t)return sl;if("AllSides"===t)return al;if("Default"===t)return jh;t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];void 0!==n&&0<n.length&&(e=parseFloat(n));for(var o=0;""===t[i];)i++;void 0!==(n=t[i++])&&0<n.length&&(o=parseFloat(n));for(var r=0;""===t[i];)i++;void 0!==(n=t[i++])&&0<n.length&&(r=parseFloat(n));for(var s=0;""===t[i];)i++;return void 0!==(n=t[i++])&&0<n.length&&(s=parseFloat(n)),new D(e,o,r,s)}return new D},D.stringify=function(t){return t instanceof D&&t.ed()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()},D.prototype.toString=function(){return this.ed()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(Ch)?"None":this.L(Lh)?"TopLeft":this.L(Dh)?"Top":this.L(Ah)?"TopRight":this.L(Fh)?"Left":this.L(zh)?"Center":this.L(Oh)?"Right":this.L(qh)?"BottomLeft":this.L(Bh)?"Bottom":this.L(Eh)?"BottomRight":this.L(Yh)?"TopSide":this.L(Wh)?"LeftSide":this.L(Xh)?"RightSide":this.L(Qh)?"BottomSide":this.L(Zh)?"TopBottomSides":this.L($h)?"LeftRightSides":this.L(_h)?"TopLeftSides":this.L(tl)?"TopRightSides":this.L(il)?"BottomLeftSides":this.L(el)?"BottomRightSides":this.L(nl)?"NotTopSide":this.L(ol)?"NotLeftSide":this.L(rl)?"NotRightSide":this.L(sl)?"NotBottomSide":this.L(al)?"AllSides":this.L(jh)?"Default":"None"},D.prototype.equals=D.prototype.L=function(t){return t instanceof D&&((this.x===t.x||isNaN(this.x)&&isNaN(t.x))&&(this.y===t.y||isNaN(this.y)&&isNaN(t.y))&&this.offsetX===t.offsetX&&this.offsetY===t.offsetY)},D.prototype.opposite=function(){return new D(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},D.prototype.includesSide=D.prototype.jp=function(t){if(!this.$i())return!1;if(!t.$i())if(t.L(Kh))t=Wh;else if(t.L(Uh))t=Xh;else if(t.L(Hh))t=Yh;else{if(!t.L(Jh))return!1;t=Qh}return t=t.offsetY,(this.offsetY&t)===t},D.prototype.isSpot=D.prototype.ed=function(){return!isNaN(this.x)&&!isNaN(this.y)},D.prototype.isNoSpot=D.prototype.te=function(){return isNaN(this.x)||isNaN(this.y)},D.prototype.isSide=D.prototype.$i=function(){return this.te()&&1===this.offsetX&&0!==this.offsetY},D.prototype.isDefault=D.prototype.Uc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var Ch;D.None=Ch=A(new D(0,0,0,0),0).Fa();var jh;D.Default=jh=A(new D(0,0,-1,0),-1).Fa();var Lh;D.TopLeft=Lh=new D(0,0,0,0).Fa();var Dh;D.TopCenter=Dh=new D(.5,0,0,0).Fa();var Ah;D.TopRight=Ah=new D(1,0,0,0).Fa();var Fh;D.LeftCenter=Fh=new D(0,.5,0,0).Fa();var zh;D.Center=zh=new D(.5,.5,0,0).Fa();var Oh;D.RightCenter=Oh=new D(1,.5,0,0).Fa();var qh;D.BottomLeft=qh=new D(0,1,0,0).Fa();var Bh;D.BottomCenter=Bh=new D(.5,1,0,0).Fa();var Eh;D.BottomRight=Eh=new D(1,1,0,0).Fa();var Ih;D.MiddleTop=Ih=Dh;var Rh;D.MiddleLeft=Rh=Fh;var Gh;D.MiddleRight=Gh=Oh;var Vh;D.MiddleBottom=Vh=Bh;var Hh;D.Top=Hh=Dh;var Kh;D.Left=Kh=Fh;var Uh;D.Right=Uh=Oh;var Jh;D.Bottom=Jh=Bh;var Yh;D.TopSide=Yh=A(new D(0,0,1,xh.gd),1).Fa();var Wh;D.LeftSide=Wh=A(new D(0,0,1,xh.Nc),1).Fa();var Xh;D.RightSide=Xh=A(new D(0,0,1,xh.Xc),1).Fa();var Qh;D.BottomSide=Qh=A(new D(0,0,1,xh.Wc),1).Fa();var Zh;D.TopBottomSides=Zh=A(new D(0,0,1,xh.gd|xh.Wc),1).Fa();var $h;D.LeftRightSides=$h=A(new D(0,0,1,xh.Nc|xh.Xc),1).Fa();var _h;D.TopLeftSides=_h=A(new D(0,0,1,xh.gd|xh.Nc),1).Fa();var tl;D.TopRightSides=tl=A(new D(0,0,1,xh.gd|xh.Xc),1).Fa();var il;D.BottomLeftSides=il=A(new D(0,0,1,xh.Wc|xh.Nc),1).Fa();var el;D.BottomRightSides=el=A(new D(0,0,1,xh.Wc|xh.Xc),1).Fa();var nl;D.NotTopSide=nl=A(new D(0,0,1,xh.Nc|xh.Xc|xh.Wc),1).Fa();var ol;D.NotLeftSide=ol=A(new D(0,0,1,xh.gd|xh.Xc|xh.Wc),1).Fa();var rl;D.NotRightSide=rl=A(new D(0,0,1,xh.gd|xh.Nc|xh.Wc),1).Fa();var sl;D.NotBottomSide=sl=A(new D(0,0,1,xh.gd|xh.Nc|xh.Xc),1).Fa();var al;D.AllSides=al=A(new D(0,0,1,xh.gd|xh.Nc|xh.Xc|xh.Wc),1).Fa(),F.prototype.copy=function(){var t=new F;return t.hf[0]=this.hf[0],t.hf[1]=this.hf[1],t.hf[2]=this.hf[2],t.hf[3]=this.hf[3],t.hf[4]=this.hf[4],t.hf[5]=this.hf[5],t},z.prototype.addColorStop=function(t,i){this.OD.push({offset:t,color:i})},(mh=O.prototype).arc=function(t,i,e,n,o,r){G(this,t,i,e,n,o,r)},mh.beginPath=function(){this.path=[]},mh.bezierCurveTo=function(t,i,e,n,o,r){this.path.push(["C",t,i,e,n,o,r])},mh.clearRect=function(){},mh.clip=function(){R(this,"clipPath",this.path,new F)},mh.closePath=function(){this.path.push(["z"])},mh.createLinearGradient=function(t,i,e,n){var o=new z("linear");return o.x1=t,o.y1=i,o.x2=e,o.y2=n,o},mh.createPattern=function(){},mh.createRadialGradient=function(t,i,e,n,o,r){var s=new z("radial");return s.x1=t,s.y1=i,s.r1=e,s.x2=n,s.y2=o,s.r2=r,s},mh.drawImage=function(t,i,e,n,o,r,s,a,h){var l="";t instanceof HTMLCanvasElement&&(l=t.toDataURL()),t instanceof HTMLImageElement&&(l=t.src),(l={x:0,y:0,width:t.naturalWidth,height:t.naturalHeight,href:l}).preserveAspectRatio=hl.Qa(n,a)&&hl.Qa(o,h)?"xMidYMid slice":"none";var u="";a/=n,h/=o,0===r&&0===s||(u+=" translate("+r+", "+s+")"),1===a&&1===h||(u+=" scale("+a+", "+h+")"),0===i&&0===e||(u+=" translate("+-i+", "+-e+")"),0===i&&0===e&&n===t.naturalWidth&&o===t.naturalHeight||(t="CLIP"+xh.Tl++,(r=q(this,"clipPath",{id:t})).appendChild(q(this,"rect",{x:i,y:e,width:n,height:o})),this.Nl.appendChild(r),l["clip-path"]="url(#"+t+")"),B(this,"image",l,this.Wi,u),this.addElement("image",l)},mh.fill=function(){R(this,"fill",this.path,this.Wi)},mh.fillRect=function(t,i,e,n){I(this,"fill",[t,i,e,n],this.Wi)},mh.fillText=function(t,i,e){t=[t,i,e],"left"===(i=this.textAlign)?i="start":"right"===i?i="end":"center"===i&&(i="middle"),B(this,"fill",i={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":i},this.Wi),this.addElement("text",i,t[0])},mh.lineTo=function(t,i){this.path.push(["L",t,i])},mh.moveTo=function(t,i){this.path.push(["M",t,i])},mh.quadraticCurveTo=function(t,i,e,n){this.path.push(["Q",t,i,e,n])},mh.rect=function(t,i,e,n){this.path.push(["M",t,i],["L",t+e,i],["L",t+e,i+n],["L",t,i+n],["z"])},mh.restore=function(){this.Wi=this.stack.pop(),this.path=this.stack.pop();var t=this.stack.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lx=t.lx,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign},mh.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lx:this.lx,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 t=[],i=0;i<this.path.length;i++)t.push(this.path[i]);this.stack.push(t),this.stack.push(this.Wi.copy())},mh.setTransform=function(t,i,e,n,o,r){1===t&&0===i&&0===e&&1===n&&0===o&&0===r||V(this,t,i,e,n,o,r)},mh.scale=function(){},mh.stroke=function(){R(this,"stroke",this.path,this.Wi)},mh.strokeRect=function(t,i,e,n){I(this,"stroke",[t,i,e,n],this.Wi)},mh.addElement=function(t,i,e){return t=q(this,t,i,e),0<this.tf.length?this.tf[this.tf.length-1].appendChild(t):this.Nl.appendChild(t),this.ix=t},mh.$a=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var t,i,e,n,o,r="SHADOW"+xh.Tl++,s=this.addElement("filter",{id:r,x:"-100%",y:"-100%",width:"300%",height:"300%"},null);t=q(this,"feGaussianBlur",{in:"SourceAlpha",result:"blur",zL:this.shadowBlur/2}),i=q(this,"feFlood",{in:"blur",result:"flood","flood-color":this.shadowColor}),e=q(this,"feComposite",{in:"flood",in2:"blur",operator:"in",result:"comp"}),n=q(this,"feOffset",{in:"comp",result:"offsetBlur",dx:this.shadowOffsetX,dy:this.shadowOffsetY}),(o=q(this,"feMerge",{})).appendChild(q(this,"feMergeNode",{in:"offsetBlur"})),o.appendChild(q(this,"feMergeNode",{in:"SourceGraphic"})),s.appendChild(t),s.appendChild(i),s.appendChild(e),s.appendChild(n),s.appendChild(o),0<this.tf.length&&this.tf[this.tf.length-1].setAttributeNS(null,"filter","url(#"+r+")")}},(mh=H.prototype).getContext=function(){return this.dH},mh.toDataURL=function(t,i){return this.Od.toDataURL(t,i)},mh.getBoundingClientRect=function(){return this.Od.getBoundingClientRect()},mh.focus=function(){return this.Od.focus()},mh.addEventListener=function(t,i,e){this.Od.addEventListener(t,i,e)},mh.removeEventListener=function(t,i,e){this.Od.removeEventListener(t,i,e)},xh.defineProperty(H,{width:"width"},function(){return this.Od.width},function(t){this.Od.width=t}),xh.defineProperty(H,{height:"height"},function(){return this.Od.height},function(t){this.Od.height=t}),xh.defineProperty(H,{style:"style"},function(){return this.Od.style},function(t){this.Od.style=t});var hl={Da:(Math.sqrt(2)-1)/3*4,mk:new b(0,0).Fa(),Yx:new M(0,0,0,0).Fa(),Wp:new j(0,0,0,0).Fa(),dG:new j(2,2,2,2).Fa(),bG:new b(6,6).Fa(),YF:new b(-1/0,-1/0).Fa(),XF:new b(1/0,1/0).Fa(),Xp:new k(0,0).Fa(),Vx:new k(1,1).Fa(),Vp:new k(6,6).Fa(),Sx:new k(8,8).Fa(),cG:new k(10,10).Fa(),eG:new k(1/0,1/0).Fa(),ZF:new b(NaN,NaN).Fa(),fB:new k(NaN,NaN).Fa(),$F:new M(NaN,NaN,NaN,NaN).Fa(),Wx:new n,ij:new n,hB:null,sqrt:function(t){if(0>=t)return 0;if(null===(i=hl.hB)){for(var i=[],e=0;2e3>=e;e++)i[e]=Math.sqrt(e);hl.hB=i}return 1>t?2e3>=(e=1/t)?1/i[0|e]:Math.sqrt(t):2e3>=t?i[0|t]:Math.sqrt(t)},G:function(t,i){var e=t-i;return.5>e&&-.5<e},Qa:function(t,i){var e=t-i;return 5e-8>e&&-5e-8<e},Dd:function(t,i,e,n,o,r,s){0>=o&&(o=1e-6);var a=0,h=0,l=0,u=0;if(t<e?(h=t,a=e):(h=e,a=t),i<n?(u=i,l=n):(u=n,l=i),t===e)return u<=s&&s<=l&&t-o<=r&&r<=t+o;if(i===n)return h<=r&&r<=a&&i-o<=s&&s<=i+o;if(a+=o,(h-=o)<=r&&r<=a&&(l+=o,(u-=o)<=s&&s<=l))if(a-h>l-u){if(!(t-e>o||e-t>o))return!0;if((r=(n-i)/(e-t)*(r-t)+i)-o<=s&&s<=r+o)return!0}else{if(!(i-n>o||n-i>o))return!0;if((s=(e-t)/(n-i)*(s-i)+t)-o<=r&&r<=s+o)return!0}return!1},Ew:function(t,i,e,n,o,r,s,a,h,l,u,f){if(hl.Dd(t,i,s,a,f,e,n)&&hl.Dd(t,i,s,a,f,o,r))return hl.Dd(t,i,s,a,f,l,u);var c=(t+e)/2,p=(i+n)/2,d=(e+o)/2,y=(n+r)/2,v=((n=(c+d)/2)+(d=(d+(o=(o+s)/2))/2))/2,g=((e=(p+y)/2)+(y=(y+(r=(r+a)/2))/2))/2;return hl.Ew(t,i,c,p,n,e,v,g,h,l,u,f)||hl.Ew(v,g,d,y,o,r,s,a,h,l,u,f)},TG:function(t,i,e,n,o,r,s,a,h){var l=(e+o)/2,u=(n+r)/2;return h.x=(((t+e)/2+l)/2+(l+(o+s)/2)/2)/2,h.y=(((i+n)/2+u)/2+(u+(r+a)/2)/2)/2,h},SG:function(t,i,e,n,o,r,s,a){var h=(e+o)/2,l=(n+r)/2;return Th(((t+e)/2+h)/2,((i+n)/2+l)/2,(h+(o+s)/2)/2,(l+(r+a)/2)/2)},Ro:function(t,i,e,n,o,r,s,a,h,l){if(hl.Dd(t,i,s,a,h,e,n)&&hl.Dd(t,i,s,a,h,o,r))C(l,t,i,0,0),C(l,s,a,0,0);else{var u=(t+e)/2,f=(i+n)/2,c=(e+o)/2,p=(n+r)/2,d=((n=(u+c)/2)+(c=(c+(o=(o+s)/2))/2))/2,y=((e=(f+p)/2)+(p=(p+(r=(r+a)/2))/2))/2;hl.Ro(t,i,u,f,n,e,d,y,h,l),hl.Ro(d,y,c,p,o,r,s,a,h,l)}return l},pe:function(t,i,e,n,o,r,s,a,h,l){if(hl.Dd(t,i,s,a,h,e,n)&&hl.Dd(t,i,s,a,h,o,r))0===l.length&&(l.push(t),l.push(i)),l.push(s),l.push(a);else{var u=(t+e)/2,f=(i+n)/2,c=(e+o)/2,p=(n+r)/2,d=((n=(u+c)/2)+(c=(c+(o=(o+s)/2))/2))/2,y=((e=(f+p)/2)+(p=(p+(r=(r+a)/2))/2))/2;hl.pe(t,i,u,f,n,e,d,y,h,l),hl.pe(d,y,c,p,o,r,s,a,h,l)}return l},vA:function(t,i,e,n,o,r,s,a,h,l){if(hl.Dd(t,i,o,r,l,e,n))return hl.Dd(t,i,o,r,l,a,h);var u=(t+e)/2,f=(i+n)/2,c=(u+(e=(e+o)/2))/2,p=(f+(n=(n+r)/2))/2;return hl.vA(t,i,u,f,c,p,s,a,h,l)||hl.vA(c,p,e,n,o,r,s,a,h,l)},rL:function(t,i,e,n,o,r,s){return s.x=((t+e)/2+(e+o)/2)/2,s.y=((i+n)/2+(n+r)/2)/2,s},uA:function(t,i,e,n,o,r,s,a){if(hl.Dd(t,i,o,r,s,e,n))C(a,t,i,0,0),C(a,o,r,0,0);else{var h=(t+e)/2,l=(i+n)/2,u=(h+(e=(e+o)/2))/2,f=(l+(n=(n+r)/2))/2;hl.uA(t,i,h,l,u,f,s,a),hl.uA(u,f,e,n,o,r,s,a)}return a},Ep:function(t,i,e,n,o,r,s,a){if(hl.Dd(t,i,o,r,s,e,n))0===a.length&&(a.push(t),a.push(i)),a.push(o),a.push(r);else{var h=(t+e)/2,l=(i+n)/2,u=(h+(e=(e+o)/2))/2,f=(l+(n=(n+r)/2))/2;hl.Ep(t,i,h,l,u,f,s,a),hl.Ep(u,f,e,n,o,r,s,a)}return a},ct:function(t,i,e,n,o,r,s,a,h,l,u,f,c,p){if(0>=c&&(c=1e-6),hl.Dd(t,i,s,a,c,e,n)&&hl.Dd(t,i,s,a,c,o,r)){if(0===(d=(t-s)*(l-f)-(i-a)*(h-u)))return!1;if(c=((t*a-i*s)*(h-u)-(t-s)*(h*f-l*u))/d,d=((t*a-i*s)*(l-f)-(i-a)*(h*f-l*u))/d,(h>u?h-u:u-h)<(l>f?l-f:f-l)){if(s=h=0,i<a?(h=i,s=a):(h=a,s=i),d<h||d>s)return!1}else if(t<s?h=t:(h=s,s=t),c<h||c>s)return!1;return p.x=c,p.y=d,!0}var d=(t+e)/2,y=(i+n)/2,v=(d+(e=(e+o)/2))/2,g=(y+(n=(n+r)/2))/2,m=(v+(e=(e+(o=(o+s)/2))/2))/2,b=(g+(n=(n+(r=(r+a)/2))/2))/2,x=(u-h)*(u-h)+(f-l)*(f-l),w=!1;return hl.ct(t,i,d,y,v,g,m,b,h,l,u,f,c,p)&&(i=(p.x-h)*(p.x-h)+(p.y-l)*(p.y-l))<x&&(x=i,w=!0),t=p.x,d=p.y,hl.ct(m,b,e,n,o,r,s,a,h,l,u,f,c,p)&&((i=(p.x-h)*(p.x-h)+(p.y-l)*(p.y-l))<x?w=!0:(p.x=t,p.y=d)),w},dt:function(t,i,e,n,o,r,s,a,h,l,u,f,c){b=0;if(0>=c&&(c=1e-6),hl.Dd(t,i,s,a,c,e,n)&&hl.Dd(t,i,s,a,c,o,r)){if(0==(c=(t-s)*(l-f)-(i-a)*(h-u)))return b;d=((t*a-i*s)*(l-f)-(i-a)*(h*f-l*u))/c;if((p=((t*a-i*s)*(h-u)-(t-s)*(h*f-l*u))/c)>=u)return b;if((h>u?h-u:u-h)<(l>f?l-f:f-l)){if(t=h=0,i<a?(h=i,t=a):(h=a,t=i),d<h||d>t)return b}else if(t<s?(h=t,t=s):h=s,p<h||p>t)return b;0<c?b++:0>c&&b--}else var p=(t+e)/2,d=(i+n)/2,y=(e+o)/2,v=(n+r)/2,g=((n=(p+y)/2)+(y=(y+(o=(o+s)/2))/2))/2,m=((e=(d+v)/2)+(v=(v+(r=(r+a)/2))/2))/2,b=(b=b+hl.dt(t,i,p,d,n,e,g,m,h,l,u,f,c))+hl.dt(g,m,y,v,o,r,s,a,h,l,u,f,c);return b},fn:function(t,i,e,n,o,r,s){if(hl.Qa(t,e)){var a=0;return e=0,i<n?(a=i,e=n):(a=n,e=i),(n=r)<a?(s.x=t,s.y=a,!1):n>e?(s.x=t,s.y=e,!1):(s.x=t,s.y=n,!0)}return hl.Qa(i,n)?(t<e?a=t:(a=e,e=t),(n=o)<a?(s.x=a,s.y=i,!1):n>e?(s.x=e,s.y=i,!1):(s.x=n,s.y=i,!0)):-5e-6>(a=((t-o)*(t-e)+(i-r)*(i-n))/((e-t)*(e-t)+(n-i)*(n-i)))?(s.x=t,s.y=i,!1):1.000005<a?(s.x=e,s.y=n,!1):(s.x=t+a*(e-t),s.y=i+a*(n-i),!0)},ih:function(t,i,e,n,o,r,s,a,h){return hl.G(t,e)&&hl.G(i,n)?(h.x=t,h.y=i,!1):hl.Qa(o,s)?hl.Qa(t,e)?(hl.fn(t,i,e,n,o,r,h),!1):(r=(n-i)/(e-t)*(o-t)+i,hl.fn(t,i,e,n,o,r,h)):(a=(a-r)/(s-o),hl.Qa(t,e)?(r=a*(t-o)+r,e=s=0,i<n?(s=i,e=n):(s=n,e=i),r<s?(h.x=t,h.y=s,!1):r>e?(h.x=t,h.y=e,!1):(h.x=t,h.y=r,!0)):(s=(n-i)/(e-t),hl.Qa(a,s)?(hl.fn(t,i,e,n,o,r,h),!1):(o=(s*t-a*o+r-i)/(s-a),hl.Qa(s,0)?(t<e?s=t:(s=e,e=t),o<s?(h.x=s,h.y=i,!1):o>e?(h.x=e,h.y=i,!1):(h.x=o,h.y=i,!0)):(r=s*(o-t)+i,hl.fn(t,i,e,n,o,r,h)))))},SK:function(t,i,e,n,o){return hl.ih(e.x,e.y,n.x,n.y,t.x,t.y,i.x,i.y,o)},DK:function(t,i,e,n,o,r,s,a,h,l){function u(e,n){var o=(e-t)*(e-t)+(n-i)*(n-i);o<f&&(f=o,h.x=e,h.y=n)}var f=1/0;u(h.x,h.y);var c=0,p=0,d=0,y=0;if(o<s?(c=o,p=s):(c=s,p=o),r<a?(d=o,y=s):(d=s,y=o),c=(p-c)/2+l,l=(y-d)/2+l,o=(o+s)/2,r=(r+a)/2,0===c||0===l)return h;if(.5>(e>t?e-t:t-e)){if(0>(c=1-(e-o)*(e-o)/(c*c)))return h;n=-l*(c=Math.sqrt(c))+r,u(e,l*c+r),u(e,n)}else{if(e=(n-i)/(e-t),n=1/(c*c)+e*e/(l*l),a=2*e*(i-e*t)/(l*l)-2*e*r/(l*l)-2*o/(c*c),0>(c=a*a-4*n*(2*e*t*r/(l*l)-2*i*r/(l*l)+r*r/(l*l)+o*o/(c*c)-1+(i-e*t)*(i-e*t)/(l*l))))return h;u(l=(-a+(c=Math.sqrt(c)))/(2*n),e*l-e*t+i),u(c=(-a-c)/(2*n),e*c-e*t+i)}return h},xl:function(t,i,e,n,o,r,s,a,h){var l=1e21,u=t,f=i;if(hl.ih(t,i,t,n,o,r,s,a,h)){var c=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r);c<l&&(l=c,u=h.x,f=h.y)}return hl.ih(e,i,e,n,o,r,s,a,h)&&(c=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r))<l&&(l=c,u=h.x,f=h.y),hl.ih(t,i,e,i,o,r,s,a,h)&&(c=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r))<l&&(l=c,u=h.x,f=h.y),hl.ih(t,n,e,n,o,r,s,a,h)&&(c=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r))<l&&(l=c,u=h.x,f=h.y),h.x=u,h.y=f,1e21>l},Yw:function(t,i,e){var n=i.x,o=i.y,r=e.x,s=e.y,a=t.left,h=t.right,l=t.top,u=t.bottom;return n===r?(r=t=0,o<s?(t=o,r=s):(t=s,r=o),a<=n&&n<=h&&t<=u&&r>=l):o===s?(n<r?t=n:(t=r,r=n),l<=o&&o<=u&&t<=h&&r>=a):!!(t.Ga(i)||t.Ga(e)||hl.Xw(a,l,h,l,n,o,r,s)||hl.Xw(h,l,h,u,n,o,r,s)||hl.Xw(h,u,a,u,n,o,r,s)||hl.Xw(a,u,a,l,n,o,r,s))},Xw:function(t,i,e,n,o,r,s,a){return 0>=hl.Hw(t,i,e,n,o,r)*hl.Hw(t,i,e,n,s,a)&&0>=hl.Hw(o,r,s,a,t,i)*hl.Hw(o,r,s,a,e,n)},Hw:function(t,i,e,n,o,r){return e-=t,n-=i,t=o-t,i=r-i,0===(r=t*n-i*e)&&0<(r=t*e+i*n)&&0>(r=(t-e)*e+(i-n)*n)&&(r=0),0>r?-1:0<r?1:0},Vt:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},XD:function(t,i,e,n,o,r){var s=Math.PI;r||(n*=s/180,o*=s/180),r=n<o?1:-1;var a=[],h=s/2,l=n;for(n=Math.min(2*s,Math.abs(o-n));1e-5<n;)o=l+r*Math.min(n,h),a.push(hl.kH(e,l,o,t,i)),n-=Math.abs(o-l),l=o;return a},kH:function(t,i,e,n,o){var r=(e-i)/2,s=t*Math.cos(r),a=(u=s*s+(l=-(h=t*Math.sin(r)))*l)+s*s+l*h,h=s-(u=4/3*(Math.sqrt(2*u*a)-a)/(s*h-l*s))*l,l=-(s=l+u*s),u=r+i,r=Math.cos(u),u=Math.sin(u);return[n+t*Math.cos(i),o+t*Math.sin(i),n+h*r-s*u,o+h*u+s*r,n+h*r-l*u,o+h*u+l*r,n+t*Math.cos(e),o+t*Math.sin(e)]},pt:function(t,i,e,n,o,r,s){e=Math.floor((t-e)/o)*o+e,n=Math.floor((i-n)/r)*r+n;var a=e;return e+o-t<o/2&&(a=e+o),t=n,n+r-i<r/2&&(t=n+r),s.m(a,t),s},pE:function(t,i){var e=Math.max(t,i),n=Math.min(t,i),o=1,r=1;do{o=e%n,e=r=n,n=o}while(0<o);return r},tH:function(t,i,e,n){var o=0>e,r=0>n,s=0,a=s=0;t<i?(s=1,a=0):(s=0,a=1);var h=0,l=0,u=0,h=0===s?t:i,l=0===s?e:n;return(0===s?o:r)&&(l=-l),s=a,u=0===s?e:n,(0===s?o:r)&&(u=-u),hl.uH(h,0===s?t:i,l,u,0,0)},uH:function(t,i,e,n,o,r){if(o=0,0<n)if(0<e){r=t*t,t*=e;var s=i*n,a=-(o=i*i)+s,h=-o+Math.sqrt(t*t+s*s);i=a;for(var l=0;9999999999>l&&((i=.5*(a+h))!==a&&i!==h);++l){var u=t/(i+r),f=s/(i+o);if(0<(u=u*u+f*f-1))a=i;else{if(!(0>u))break;h=i}}e=r*e/(i+r)-e,n=o*n/(i+o)-n,o=Math.sqrt(e*e+n*n)}else o=Math.abs(n-i);else n=t*t-i*i,(o=t*e)<n?(n=o/n,o=t*n,r=i*Math.sqrt(Math.abs(1-n*n)),e=o-e,o=Math.sqrt(e*e+r*r)):o=Math.abs(e-t);return o}};xh.ea("Geometry",K),xh.Yh(K),K.prototype.copy=function(){var t=new K;t.ja=this.ja,t.wc=this.wc,t.Cc=this.Cc,t.yb=this.yb,t.Db=this.Db;for(var i=this.nj.n,e=i.length,n=t.nj,o=0;o<e;o++){var r=i[o].copy();n.add(r)}return t.fv=this.fv,t.Qu.assign(this.Qu),t.ab=this.ab,t.Li=this.Li.S(),t.Mi=this.Mi.S(),t.$n=this.$n,t.Yn=this.Yn,t.qi=this.qi,t};var ll;K.Line=ll=xh.p(K,"Line",0);var ul;K.Rectangle=ul=xh.p(K,"Rectangle",1);var fl;K.Ellipse=fl=xh.p(K,"Ellipse",2);var cl;K.Path=cl=xh.p(K,"Path",3),K.prototype.Fa=function(){return this.freeze(),Object.freeze(this),this},K.prototype.freeze=function(){this.D=!0;t=this.Wb;t.freeze();for(var t,i=(t=t.n).length,e=0;e<i;e++)t[e].freeze();return this},K.prototype.Oa=function(){Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1;t=this.Wb;t.Oa();for(var t,i=(t=t.n).length,e=0;e<i;e++)t[e].Oa();return this},K.prototype.equalsApprox=K.prototype.od=function(t){if(!(t instanceof K))return!1;if(this.type!==t.type)return this.type===ll&&t.type===cl?U(this,t):t.type===ll&&this.type===cl&&U(t,this);if(this.type===cl){var i=this.Wb.n;t=t.Wb.n;var e=i.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(!i[n].od(t[n]))return!1;return!0}return hl.G(this.za,t.za)&&hl.G(this.xa,t.xa)&&hl.G(this.I,t.I)&&hl.G(this.J,t.J)};var pl;K.stringify=pl=function(t){return t.toString()},K.prototype.toString=function(t){switch(void 0===t&&(t=-1),this.type){case ll:return 0>t?"M"+this.za.toString()+" "+this.xa.toString()+"L"+this.I.toString()+" "+this.J.toString():"M"+this.za.toFixed(t)+" "+this.xa.toFixed(t)+"L"+this.I.toFixed(t)+" "+this.J.toFixed(t);case ul:return(n=new M(this.za,this.xa,0,0)).PF(this.I,this.J,0,0),0>t?"M"+n.x.toString()+" "+n.y.toString()+"H"+n.right.toString()+"V"+n.bottom.toString()+"H"+n.left.toString()+"z":"M"+n.x.toFixed(t)+" "+n.y.toFixed(t)+"H"+n.right.toFixed(t)+"V"+n.bottom.toFixed(t)+"H"+n.left.toFixed(t)+"z";case fl:if((n=new M(this.za,this.xa,0,0)).PF(this.I,this.J,0,0),0>t){var i=n.left.toString()+" "+(n.y+n.height/2).toString(),e=n.right.toString()+" "+(n.y+n.height/2).toString();return"M"+i+"A"+(n.width/2).toString()+" "+(n.height/2).toString()+" 0 0 1 "+e+"A"+(n.width/2).toString()+" "+(n.height/2).toString()+" 0 0 1 "+i}return i=n.left.toFixed(t)+" "+(n.y+n.height/2).toFixed(t),e=n.right.toFixed(t)+" "+(n.y+n.height/2).toFixed(t),"M"+i+"A"+(n.width/2).toFixed(t)+" "+(n.height/2).toFixed(t)+" 0 0 1 "+e+"A"+(n.width/2).toFixed(t)+" "+(n.height/2).toFixed(t)+" 0 0 1 "+i;case cl:for(var n="",e=(i=this.Wb.n).length,o=0;o<e;o++){var r=i[o];0<o&&(n+=" x "),r.Et&&(n+="F "),n+=r.toString(t)}return n;default:return this.type.toString()}},K.fillPath=function(t){"string"!=typeof t&&xh.Ed(t,"string",K,"fillPath:str");for(var i=(t=t.split(/[Xx]/)).length,e="",n=0;n<i;n++)var o=t[n],e=null!==o.match(/[Ff]/)?0===n?e+o:e+"X"+(" "===o[0]?"":" ")+o:e+(0===n?"":"X ")+"F"+(" "===o[0]?"":" ")+o;return e};var dl;K.parse=dl=function(t,i){function e(){return l>=y-1||null!==h[l+1].match(/[A-Za-z]/)}function n(){return l++,h[l]}function o(){var t=new b(parseFloat(n()),parseFloat(n()));return u===u.toLowerCase()&&(t.x=d.x+t.x,t.y=d.y+t.y),t}function r(){return d=o()}function s(){return p=o()}function a(){return"c"!==f.toLowerCase()&&"s"!==f.toLowerCase()?d:new b(2*d.x-p.x,2*d.y-p.y)}void 0===i&&(i=!1),"string"!=typeof t&&xh.Ed(t,"string",K,"parse:str");for(var h=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/,/gm," ")).replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2")).replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2")).replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2")).replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2")).replace(/([0-9])([+\-])/gm,"$1 $2")).replace(/(\.[0-9]*)(\.)/gm,"$1 $2")).replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ")).replace(/[\s\r\t\n]+/gm," ")).replace(/^\s+|\s+$/g,"")).split(" "),l=-1,u="",f="",c=new b(0,0),p=new b(0,0),d=new b(0,0),y=h.length,v=xh.q(),g=!1,m=!1,x=!0;!(l>=y-1);)if(f=u,""!==(u=n()))switch(u.toUpperCase()){case"X":x=!0,m=g=!1;break;case"M":M=r();for(null===v.Tb||!0===x?(Qo(v,M.x,M.y,g,!1,!m),x=!1):v.moveTo(M.x,M.y),c=d;!e();)M=r(),v.lineTo(M.x,M.y);break;case"L":for(;!e();)M=r(),v.lineTo(M.x,M.y);break;case"H":for(;!e();)d=M=new b((u===u.toLowerCase()?d.x:0)+parseFloat(n()),d.y),v.lineTo(d.x,d.y);break;case"V":for(;!e();)d=M=new b(d.x,(u===u.toLowerCase()?d.y:0)+parseFloat(n())),v.lineTo(d.x,d.y);break;case"C":for(;!e();){var w=o(),k=s(),M=r();$o(v,w.x,w.y,k.x,k.y,M.x,M.y)}break;case"S":for(;!e();)w=a(),k=s(),M=r(),$o(v,w.x,w.y,k.x,k.y,M.x,M.y);break;case"Q":for(;!e();)k=s(),M=r(),_o(v,k.x,k.y,M.x,M.y);break;case"T":for(;!e();)p=k=a(),M=r(),_o(v,k.x,k.y,M.x,M.y);break;case"B":for(;!e();){var M=parseFloat(n()),w=parseFloat(n()),k=parseFloat(n()),P=parseFloat(n()),T=parseFloat(n()),S=T,N=!1;e()||(S=parseFloat(n()),e()||(N=0!==parseFloat(n()))),u===u.toLowerCase()&&(k+=d.x,P+=d.y),v.arcTo(M,w,k,P,T,S,N)}break;case"A":for(;!e();)w=Math.abs(parseFloat(n())),k=Math.abs(parseFloat(n())),P=parseFloat(n()),T=!!parseFloat(n()),S=!!parseFloat(n()),M=r(),function(t,i,e,n,o,r,s,a){var h;void 0===h&&(h=!1),null===t.o&&xh.k("StreamGeometryContext has been closed"),null===t.Tb&&xh.k("Need to call beginFigure first"),i=new Z(xl,s,a,i,e,n,o,r),h&&i.close(),t.Tb.vb.add(i)}(v,w,k,P,T,S,M.x,M.y);break;case"Z":M=v.o.Wb.n[v.o.Wb.length-1],Zo(v),d=c;break;case"F":for(M="",w=1;h[l+w];)if(null!==h[l+w].match(/[Uu]/))w++;else{if(null!==h[l+w].match(/[A-Za-z]/)){M=h[l+w];break}w++}M.match(/[Mm]/)?g=!0:function(t){null===t.o&&xh.k("StreamGeometryContext has been closed"),null===t.Tb&&xh.k("Need to call beginFigure first"),0<t.Tb.vb.length&&(t.Tb.Et=!0)}(v);break;case"U":for(M="",w=1;h[l+w];)if(null!==h[l+w].match(/[Ff]/))w++;else{if(null!==h[l+w].match(/[A-Za-z]/)){M=h[l+w];break}w++}M.match(/[Mm]/)?m=!0:v.$a(!1)}if(c=v.o,xh.s(v),i)for(v=c.Wb.i;v.next();)M=v.value,M.Et=!0;return c},K.prototype.aA=function(){if(this.ab||this.fv!==this.Wb.F)return!0;for(var t=this.Wb.n,i=t.length,e=0;e<i;e++)if(t[e].aA())return!0;return!1},K.prototype.XA=function(){this.ab=!1,this.fv=this.Wb.F;for(var t=this.Wb.n,i=t.length,e=0;e<i;e++)t[e].XA()},K.prototype.Zg=function(){var t=this.Qu;t.Oa(),isNaN(this.$n)||isNaN(this.Yn)?t.m(0,0,0,0):t.m(0,0,this.$n,this.Yn),Y(this,t,!1),C(t,0,0,0,0),t.freeze()},K.prototype.computeBoundsWithoutOrigin=K.prototype.bH=function(){var t=new M;return Y(this,t,!0),t},K.prototype.normalize=K.prototype.normalize=function(){this.D&&xh.la(this);var t=this.bH();return this.offset(-t.x,-t.y),new b(-t.x,-t.y)},K.prototype.offset=K.prototype.offset=function(t,i){return this.D&&xh.la(this),this.transform(1,0,0,1,t,i),this},K.prototype.scale=K.prototype.scale=function(t,i){return this.D&&xh.la(this),this.transform(t,0,0,i,0,0),this},K.prototype.rotate=K.prototype.rotate=function(t,i,e){this.D&&xh.la(this),void 0===i&&(i=0),void 0===e&&(e=0);var n=xh.sh();return n.reset(),n.rotate(t,i,e),this.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),xh.cf(n),this},K.prototype.transform=K.prototype.transform=function(t,i,e,n,o,r){var s=0,a=0;switch(this.type){case ll:case ul:case fl:s=this.wc,a=this.Cc,this.wc=s*t+a*e+o,this.Cc=s*i+a*n+r,s=this.yb,a=this.Db,this.yb=s*t+a*e+o,this.Db=s*i+a*n+r;break;case cl:for(var h=this.Wb.n,l=h.length,u=0;u<l;u++){var f=h[u],s=f.za,a=f.xa;f.za=s*t+a*e+o,f.xa=s*i+a*n+r;for(var c=(f=f.vb.n).length,p=0;p<c;p++){var d=f[p];switch(d.type){case vl:case yl:s=d.I,a=d.J,d.I=s*t+a*e+o,d.J=s*i+a*n+r;break;case gl:s=d.rc,a=d.Kc,d.rc=s*t+a*e+o,d.Kc=s*i+a*n+r,s=d.nh,a=d.oh,d.nh=s*t+a*e+o,d.oh=s*i+a*n+r,s=d.I,a=d.J,d.I=s*t+a*e+o,d.J=s*i+a*n+r;break;case ml:s=d.rc,a=d.Kc,d.rc=s*t+a*e+o,d.Kc=s*i+a*n+r,s=d.I,a=d.J,d.I=s*t+a*e+o,d.J=s*i+a*n+r;break;case bl:s=d.oa,a=d.va,d.oa=s*t+a*e+o,d.va=s*i+a*n+r,0!==i&&(0>(s=180*Math.atan2(i,t)/Math.PI)&&(s+=360),d.xe+=s),0>t&&(d.xe=180-d.xe,d.Bf=-d.Bf),0>n&&(d.xe=-d.xe,d.Bf=-d.Bf),d.radiusX*=Math.sqrt(t*t+e*e),void 0!==d.radiusY&&(d.radiusY*=Math.sqrt(i*i+n*n));break;case xl:s=d.I,a=d.J,d.I=s*t+a*e+o,d.J=s*i+a*n+r,0!==i&&(0>(s=180*Math.atan2(i,t)/Math.PI)&&(s+=360),d.hj+=s),0>t&&(d.hj=180-d.hj,d.Bl=!d.Bl),0>n&&(d.hj=-d.hj,d.Bl=!d.Bl),d.radiusX*=Math.sqrt(t*t+e*e),d.radiusY*=Math.sqrt(i*i+n*n);break;default:xh.k("Unknown Segment type: "+d.type)}}}}return this.ab=!0,this},K.prototype.Ga=function(t,i,e,n){var o=t.x,r=t.y,s=this.nb.x-20;t=t.y;for(var a=0,h=0,l=0,u=0,f=0,c=0,p=this.Wb.n,d=p.length,y=0;y<d;y++){var v=p[y];if(v.Et){if(e&&v.Ga(o,r,i))return!0;for(var g=v.vb,m=h=v.za,b=l=v.xa,x=g.n,w=0;w<=g.length;w++){var k,M;switch(w!==g.length?(k=x[w],M=k.type,f=k.I,c=k.J):(M=vl,f=m,c=b),M){case yl:if(u=W(o,r,s,t,h,l,m,b),isNaN(u))return!0;a+=u,m=f,b=c;break;case vl:if(u=W(o,r,s,t,h,l,f,c),isNaN(u))return!0;a+=u;break;case gl:a+=u=hl.dt(h,l,k.rc,k.Kc,k.nh,k.oh,f,c,s,t,o,r,.5);break;case ml:a+=u=hl.dt(h,l,(h+2*k.rc)/3,(l+2*k.Kc)/3,(2*k.rc+f)/3,(2*k.Kc+c)/3,f,c,s,t,o,r,.5);break;case bl:case xl:var P=(M=k.type===bl?$(k,v):_(k,v,h,l)).length;if(0===P){if(u=W(o,r,s,t,h,l,k.oa,k.va),isNaN(u))return!0;a+=u;break}for(var T=null,S=0;S<P;S++){if(T=M[S],0===S){if(u=W(o,r,s,t,h,l,T[0],T[1]),isNaN(u))return!0;a+=u}a+=u=hl.dt(T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],s,t,o,r,.5)}null!==T&&(f=T[6],c=T[7]);break;default:xh.k("Unknown Segment type: "+k.type)}h=f,l=c}if(0!==a)return!0;a=0}else if(v.Ga(o,r,n?i:i+2))return!0}return 0!==a},K.prototype.getPointAlongPath=function(t){(0>t||1<t)&&xh.wa(t,"0 <= fraction <= 1",K,"getPointAlongPath:fraction");var i=this.Wb.first(),e=xh.lb(),n=[];n.push(i.za),n.push(i.xa);for(var o=i.za,r=i.xa,s=o,a=r,h=i.vb.n,l=h.length,u=0;u<l;u++){var f=h[u];switch(f.ja){case yl:e.push(n),(n=[]).push(f.I),n.push(f.J),s=o=f.I,a=r=f.J;break;case vl:n.push(f.I),n.push(f.J),o=f.I,r=f.J;break;case gl:hl.pe(o,r,f.vd,f.Ie,f.Ug,f.mg,f.yb,f.Db,.5,n),o=f.I,r=f.J;break;case ml:hl.Ep(o,r,f.vd,f.Ie,f.yb,f.Db,.5,n),o=f.I,r=f.J;break;case bl:var c=$(f,i),p=c.length;if(0===p){n.push(f.oa),n.push(f.va),o=f.oa,r=f.va;break}for(var d=0;d<p;d++){var y=c[d];hl.pe(o,r,y[2],y[3],y[4],y[5],y[6],y[7],.5,n),o=y[6],r=y[7]}break;case xl:for(p=(c=_(f,i,o,r)).length,d=0;d<p;d++)y=c[d],hl.pe(o,r,y[2],y[3],y[4],y[5],y[6],y[7],.5,n),o=y[6],r=y[7];break;default:xh.k("Segment not of valid type")}f.Hh&&(n.push(s),n.push(a))}for(e.push(n),c=0,s=e.length,a=n=i=0;a<s;a++)for(h=e[a],l=h.length,u=0;u<l;u+=2)o=h[u],r=h[u+1],0!==u&&(f=Math.sqrt(Ph(i,n,o,r)),c+=f),i=o,n=r;for(t*=c,a=c=0;a<s;a++)for(h=e[a],l=h.length,u=0;u<l;u++){if(o=h[u],r=h[u+1],0!==u){if(f=Math.sqrt(Ph(i,n,o,r)),c+f>t)return u=(t-c)/f,xh.ta(e),new b(i+(o-i)*u,n+(r-n)*u);c+=f}i=o,n=r}return xh.ta(e),null},xh.defineProperty(K,{type:"type"},function(){return this.ja},function(t){this.ja!==t&&(this.D&&xh.la(this,t),this.ja=t,this.ab=!0)}),xh.defineProperty(K,{za:"startX"},function(){return this.wc},function(t){this.wc!==t&&(this.D&&xh.la(this,t),this.wc=t,this.ab=!0)}),xh.defineProperty(K,{xa:"startY"},function(){return this.Cc},function(t){this.Cc!==t&&(this.D&&xh.la(this,t),this.Cc=t,this.ab=!0)}),xh.defineProperty(K,{I:"endX"},function(){return this.yb},function(t){this.yb!==t&&(this.D&&xh.la(this,t),this.yb=t,this.ab=!0)}),xh.defineProperty(K,{J:"endY"},function(){return this.Db},function(t){this.Db!==t&&(this.D&&xh.la(this,t),this.Db=t,this.ab=!0)}),xh.defineProperty(K,{Wb:"figures"},function(){return this.nj},function(t){this.nj!==t&&(this.D&&xh.la(this,t),this.nj=t,this.ab=!0)}),K.prototype.add=K.prototype.add=function(t){return this.nj.add(t),this},xh.defineProperty(K,{B:"spot1"},function(){return this.Li},function(t){this.D&&xh.la(this,t),this.Li=t.S()}),xh.defineProperty(K,{C:"spot2"},function(){return this.Mi},function(t){this.D&&xh.la(this,t),this.Mi=t.S()}),xh.defineProperty(K,{Md:"defaultStretch"},function(){return this.qi},function(t){this.D&&xh.la(this,t),this.qi=t}),xh.u(K,{nb:"bounds"},function(){return this.aA()&&(this.XA(),this.Zg()),this.Qu}),xh.ea("PathFigure",Q),xh.Yh(Q),Q.prototype.copy=function(){var t=new Q;t.cm=this.cm,t.ao=this.ao,t.wc=this.wc,t.Cc=this.Cc;for(var i=this.xo.n,e=i.length,n=t.xo,o=0;o<e;o++){var r=i[o].copy();n.add(r)}return t.fw=this.fw,t.ab=this.ab,t},Q.prototype.equalsApprox=Q.prototype.od=function(t){if(!(t instanceof Q&&hl.G(this.za,t.za)&&hl.G(this.xa,t.xa)))return!1;var i=this.vb.n;t=t.vb.n;var e=i.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(!i[n].od(t[n]))return!1;return!0},(mh=Q.prototype).toString=function(t){void 0===t&&(t=-1);for(var i=0>t?"M"+this.za.toString()+" "+this.xa.toString():"M"+this.za.toFixed(t)+" "+this.xa.toFixed(t),e=this.vb.n,n=e.length,o=0;o<n;o++)i+=" "+e[o].toString(t);return i},mh.freeze=function(){this.D=!0;(i=this.vb).freeze();for(var t=i.n,i=i.length,e=0;e<i;e++)t[e].freeze();return this},mh.Oa=function(){this.D=!1;t=this.vb;t.Oa();for(var t,i=(t=t.n).length,e=0;e<i;e++)t[e].Oa();return this},mh.aA=function(){if(this.ab)return!0;t=this.vb;if(this.fw!==t.F)return!0;for(var t,i=(t=t.n).length,e=0;e<i;e++)if(t[e].ab)return!0;return!1},mh.XA=function(){this.ab=!1;t=this.vb;this.fw=t.F;for(var t,i=(t=t.n).length,e=0;e<i;e++){var n=t[e];n.ab=!1,n.cg=null}},xh.defineProperty(Q,{Et:"isFilled"},function(){return this.cm},function(t){this.D&&xh.la(this,t),this.cm=t}),xh.defineProperty(Q,{El:"isShadowed"},function(){return this.ao},function(t){this.D&&xh.la(this,t),this.ao=t}),xh.defineProperty(Q,{za:"startX"},function(){return this.wc},function(t){this.D&&xh.la(this,t),this.wc=t,this.ab=!0}),xh.defineProperty(Q,{xa:"startY"},function(){return this.Cc},function(t){this.D&&xh.la(this,t),this.Cc=t,this.ab=!0}),xh.defineProperty(Q,{vb:"segments"},function(){return this.xo},function(t){this.D&&xh.la(this,t),this.xo=t,this.ab=!0}),Q.prototype.add=Q.prototype.add=function(t){return this.xo.add(t),this},Q.prototype.Ga=function(t,i,e){for(var n=this.za,o=this.xa,r=n,s=o,a=this.vb.n,h=a.length,l=0;l<h;l++){var u=a[l];switch(u.type){case yl:r=u.I,s=u.J,n=u.I,o=u.J;break;case vl:if(hl.Dd(n,o,u.I,u.J,e,t,i))return!0;n=u.I,o=u.J;break;case gl:if(hl.Ew(n,o,u.rc,u.Kc,u.nh,u.oh,u.I,u.J,.5,t,i,e))return!0;n=u.I,o=u.J;break;case ml:if(hl.vA(n,o,u.rc,u.Kc,u.I,u.J,.5,t,i,e))return!0;n=u.I,o=u.J;break;case bl:case xl:var f=u.type===bl?$(u,this):_(u,this,n,o),c=f.length;if(0===c){if(hl.Dd(n,o,u.oa,u.va,e,t,i))return!0;n=u.oa,o=u.va;break}for(var p=null,d=0;d<c;d++)if(p=f[d],0===d&&hl.Dd(n,o,p[0],p[1],e,t,i)||hl.Ew(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],.5,t,i,e))return!0;null!==p&&(n=p[6],o=p[7]);break;default:xh.k("Unknown Segment type: "+u.type)}if(u.$w&&(n!==r||o!==s)&&hl.Dd(n,o,r,s,e,t,i))return!0}return!1},xh.ea("PathSegment",Z),xh.Yh(Z),Z.prototype.copy=function(){var t=new Z;return t.ja=this.ja,t.yb=this.yb,t.Db=this.Db,t.vd=this.vd,t.Ie=this.Ie,t.Ug=this.Ug,t.mg=this.mg,t.ho=this.ho,t.zn=this.zn,t.Hh=this.Hh,t.ab=this.ab,t},Z.prototype.equalsApprox=Z.prototype.od=function(t){if(!(t instanceof Z)||this.type!==t.type||this.$w!==t.$w)return!1;switch(this.type){case yl:case vl:return hl.G(this.I,t.I)&&hl.G(this.J,t.J);case gl:return hl.G(this.I,t.I)&&hl.G(this.J,t.J)&&hl.G(this.rc,t.rc)&&hl.G(this.Kc,t.Kc)&&hl.G(this.nh,t.nh)&&hl.G(this.oh,t.oh);case ml:return hl.G(this.I,t.I)&&hl.G(this.J,t.J)&&hl.G(this.rc,t.rc)&&hl.G(this.Kc,t.Kc);case bl:return hl.G(this.xe,t.xe)&&hl.G(this.Bf,t.Bf)&&hl.G(this.oa,t.oa)&&hl.G(this.va,t.va)&&hl.G(this.radiusX,t.radiusX)&&hl.G(this.radiusY,t.radiusY);case xl:return this.Bl===t.Bl&&this.ex===t.ex&&hl.G(this.hj,t.hj)&&hl.G(this.I,t.I)&&hl.G(this.J,t.J)&&hl.G(this.radiusX,t.radiusX)&&hl.G(this.radiusY,t.radiusY);default:return!1}},Z.prototype.toString=function(t){void 0===t&&(t=-1);var i="";switch(this.type){case yl:i=0>t?"M"+this.I.toString()+" "+this.J.toString():"M"+this.I.toFixed(t)+" "+this.J.toFixed(t);break;case vl:i=0>t?"L"+this.I.toString()+" "+this.J.toString():"L"+this.I.toFixed(t)+" "+this.J.toFixed(t);break;case gl:i=0>t?"C"+this.rc.toString()+" "+this.Kc.toString()+" "+this.nh.toString()+" "+this.oh.toString()+" "+this.I.toString()+" "+this.J.toString():"C"+this.rc.toFixed(t)+" "+this.Kc.toFixed(t)+" "+this.nh.toFixed(t)+" "+this.oh.toFixed(t)+" "+this.I.toFixed(t)+" "+this.J.toFixed(t);break;case ml:i=0>t?"Q"+this.rc.toString()+" "+this.Kc.toString()+" "+this.I.toString()+" "+this.J.toString():"Q"+this.rc.toFixed(t)+" "+this.Kc.toFixed(t)+" "+this.I.toFixed(t)+" "+this.J.toFixed(t);break;case bl:i=0>t?"B"+this.xe.toString()+" "+this.Bf.toString()+" "+this.oa.toString()+" "+this.va.toString()+" "+this.radiusX:"B"+this.xe.toFixed(t)+" "+this.Bf.toFixed(t)+" "+this.oa.toFixed(t)+" "+this.va.toFixed(t)+" "+this.radiusX;break;case xl:i=0>t?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.hj.toString()+" "+(this.ex?1:0)+" "+(this.Bl?1:0)+" "+this.I.toString()+" "+this.J.toString():"A"+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t)+" "+this.hj.toFixed(t)+" "+(this.ex?1:0)+" "+(this.Bl?1:0)+" "+this.I.toFixed(t)+" "+this.J.toFixed(t);break;default:i=this.type.toString()}return i+(this.Hh?"z":"")};var yl;Z.Move=yl=xh.p(Z,"Move",0);var vl;Z.Line=vl=xh.p(Z,"Line",1);var gl;Z.Bezier=gl=xh.p(Z,"Bezier",2);var ml;Z.QuadraticBezier=ml=xh.p(Z,"QuadraticBezier",3);var bl;Z.Arc=bl=xh.p(Z,"Arc",4);var xl;Z.SvgArc=xl=xh.p(Z,"SvgArc",4),Z.prototype.freeze=function(){return this.D=!0,this},Z.prototype.Oa=function(){return this.D=!1,this},Z.prototype.close=Z.prototype.close=function(){return this.Hh=!0,this},xh.defineProperty(Z,{$w:"isClosed"},function(){return this.Hh},function(t){this.Hh!==t&&(this.Hh=t,this.ab=!0)}),xh.defineProperty(Z,{type:"type"},function(){return this.ja},function(t){this.D&&xh.la(this,t),this.ja=t,this.ab=!0}),xh.defineProperty(Z,{I:"endX"},function(){return this.yb},function(t){this.D&&xh.la(this,t),this.yb=t,this.ab=!0}),xh.defineProperty(Z,{J:"endY"},function(){return this.Db},function(t){this.D&&xh.la(this,t),this.Db=t,this.ab=!0}),xh.defineProperty(Z,{rc:"point1X"},function(){return this.vd},function(t){this.D&&xh.la(this,t),this.vd=t,this.ab=!0}),xh.defineProperty(Z,{Kc:"point1Y"},function(){return this.Ie},function(t){this.D&&xh.la(this,t),this.Ie=t,this.ab=!0}),xh.defineProperty(Z,{nh:"point2X"},function(){return this.Ug},function(t){this.D&&xh.la(this,t),this.Ug=t,this.ab=!0}),xh.defineProperty(Z,{oh:"point2Y"},function(){return this.mg},function(t){this.D&&xh.la(this,t),this.mg=t,this.ab=!0}),xh.defineProperty(Z,{oa:"centerX"},function(){return this.vd},function(t){this.D&&xh.la(this,t),this.vd=t,this.ab=!0}),xh.defineProperty(Z,{va:"centerY"},function(){return this.Ie},function(t){this.D&&xh.la(this,t),this.Ie=t,this.ab=!0}),xh.defineProperty(Z,{radiusX:"radiusX"},function(){return this.Ug},function(t){0>t&&xh.wa(t,">= zero",Z,"radiusX"),this.D&&xh.la(this,t),this.Ug=t,this.ab=!0}),xh.defineProperty(Z,{radiusY:"radiusY"},function(){return this.mg},function(t){0>t&&xh.wa(t,">= zero",Z,"radiusY"),this.D&&xh.la(this,t),this.mg=t,this.ab=!0}),xh.defineProperty(Z,{xe:"startAngle"},function(){return this.yb},function(t){this.yb!==t&&(this.D&&xh.la(this,t),0>(t%=360)&&(t+=360),this.yb=t,this.ab=!0)}),xh.defineProperty(Z,{Bf:"sweepAngle"},function(){return this.Db},function(t){this.D&&xh.la(this,t),360<t&&(t=360),-360>t&&(t=-360),this.Db=t,this.ab=!0}),xh.defineProperty(Z,{Bl:"isClockwiseArc"},function(){return this.zn},function(t){this.D&&xh.la(this,t),this.zn=t,this.ab=!0}),xh.defineProperty(Z,{ex:"isLargeArc"},function(){return this.ho},function(t){this.D&&xh.la(this,t),this.ho=t,this.ab=!0}),xh.defineProperty(Z,{hj:"xAxisRotation"},function(){return this.vd},function(t){0>(t%=360)&&(t+=360),this.D&&xh.la(this,t),this.vd=t,this.ab=!0}),xh.ea("InputEvent",tt),tt.prototype.copy=function(){var t=new tt;return t.U=this.U,t.pz.assign(this.lf),t.xy.assign(this.da),t.Jv=this.Jv,t.Mu=this.Mu,t.Nu=this.Nu,t.yv=this.yv,t.cv=this.cv,t.qw=this.qw,t.Pu=this.Pu,t.Zu=this.Zu,t.uv=this.uv,t.kv=this.kv,t.jj=this.jj,t.Qq=this.Qq,t.ow=this.ow,t.nw=this.nw,t.ng=this.ng,t},tt.prototype.toString=function(){var t="^";return 0!==this.sd&&(t+="M:"+this.sd),0!==this.button&&(t+="B:"+this.button),""!==this.key&&(t+="K:"+this.key),0!==this.Ze&&(t+="C:"+this.Ze),0!==this.nl&&(t+="D:"+this.nl),this.zc&&(t+="h"),this.bubbles&&(t+="b"),null!==this.da&&(t+="@"+this.da.toString()),t},xh.defineProperty(tt,{g:"diagram"},function(){return this.U},function(t){this.U=t}),xh.defineProperty(tt,{lf:"viewPoint"},function(){return this.pz},function(t){xh.A(t,b,tt,"viewPoint"),this.pz.assign(t)}),xh.defineProperty(tt,{da:"documentPoint"},function(){return this.xy},function(t){xh.A(t,b,tt,"documentPoint"),this.xy.assign(t)}),xh.defineProperty(tt,{sd:"modifiers"},function(){return this.Jv},function(t){this.Jv=t}),xh.defineProperty(tt,{button:"button"},function(){return this.Mu},function(t){if(this.Mu=t,null===this.event)switch(t){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}),xh.defineProperty(tt,{buttons:"buttons"},function(){return this.Nu},function(t){this.Nu=t}),xh.defineProperty(tt,{key:"key"},function(){return this.yv},function(t){this.yv=t}),xh.defineProperty(tt,{pl:"down"},function(){return this.cv},function(t){this.cv=t}),xh.defineProperty(tt,{up:"up"},function(){return this.qw},function(t){this.qw=t}),xh.defineProperty(tt,{Ze:"clickCount"},function(){return this.Pu},function(t){this.Pu=t}),xh.defineProperty(tt,{nl:"delta"},function(){return this.Zu},function(t){this.Zu=t}),xh.defineProperty(tt,{Gt:"isMultiTouch"},function(){return this.uv},function(t){this.uv=t}),xh.defineProperty(tt,{zc:"handled"},function(){return this.kv},function(t){this.kv=t}),xh.defineProperty(tt,{bubbles:"bubbles"},function(){return this.jj},function(t){this.jj=t}),xh.defineProperty(tt,{event:"event"},function(){return this.Qq},function(t){this.Qq=t}),xh.u(tt,{aj:"isTouchEvent"},function(){var i=t.TouchEvent;return!!(i&&this.event instanceof i)||(i=t.PointerEvent)&&this.event instanceof i&&"touch"===this.event.pointerType}),xh.u(tt,{fk:"isMac"},function(){return xh.fk}),xh.defineProperty(tt,{timestamp:"timestamp"},function(){return this.ow},function(t){this.ow=t}),xh.defineProperty(tt,{Eg:"targetDiagram"},function(){return this.nw},function(t){this.nw=t}),xh.defineProperty(tt,{ye:"targetObject"},function(){return this.ng},function(t){this.ng=t}),xh.defineProperty(tt,{control:"control"},function(){return 0!=(1&this.sd)},function(t){this.sd=t?1|this.sd:-2&this.sd}),xh.defineProperty(tt,{shift:"shift"},function(){return 0!=(4&this.sd)},function(t){this.sd=t?4|this.sd:-5&this.sd}),xh.defineProperty(tt,{alt:"alt"},function(){return 0!=(2&this.sd)},function(t){this.sd=t?2|this.sd:-3&this.sd}),xh.defineProperty(tt,{Pt:"meta"},function(){return 0!=(8&this.sd)},function(t){this.sd=t?8|this.sd:-9&this.sd}),xh.defineProperty(tt,{left:"left"},function(){var t=this.event;return null!==t&&t instanceof MouseEvent&&("mousedown"===t.type||"mouseup"===t.type)?0===this.button:0!=(1&this.buttons)},function(t){this.buttons=t?1|this.buttons:-2&this.buttons}),xh.defineProperty(tt,{right:"right"},function(){var t=this.event;return null!==t&&t instanceof MouseEvent&&("mousedown"===t.type||"mouseup"===t.type)?2===this.button:0!=(2&this.buttons)},function(t){this.buttons=t?2|this.buttons:-3&this.buttons}),xh.defineProperty(tt,{aL:"middle"},function(){var t=this.event;return null!==t&&t instanceof MouseEvent&&("mousedown"===t.type||"mouseup"===t.type)?1===this.button:0!=(4&this.buttons)},function(t){this.buttons=t?4|this.buttons:-5&this.buttons}),xh.ea("DiagramEvent",it),it.prototype.copy=function(){var t=new it;return t.U=this.U,t.Qb=this.Qb,t.kw=this.kw,t.Sv=this.Sv,t.Ou=this.Ou,t},it.prototype.toString=function(){var t="*"+this.name;return this.cancel&&(t+="x"),null!==this.PA&&(t+=":"+this.PA.toString()),null!==this.tA&&(t+="("+this.tA.toString()+")"),t},xh.defineProperty(it,{g:"diagram"},function(){return this.U},function(t){this.U=t}),xh.defineProperty(it,{name:"name"},function(){return this.Qb},function(t){this.Qb=t}),xh.defineProperty(it,{PA:"subject"},function(){return this.kw},function(t){this.kw=t}),xh.defineProperty(it,{tA:"parameter"},function(){return this.Sv},function(t){this.Sv=t}),xh.defineProperty(it,{cancel:"cancel"},function(){return this.Ou},function(t){this.Ou=t}),xh.ea("ChangedEvent",et);var wl;et.Transaction=wl=xh.p(et,"Transaction",-1);var kl;et.Property=kl=xh.p(et,"Property",0);var Ml;et.Insert=Ml=xh.p(et,"Insert",1);var Pl;et.Remove=Pl=xh.p(et,"Remove",2),et.prototype.clear=et.prototype.clear=function(){this.Nr=this.Pr=this.Sr=this.Tr=this.Rr=this.U=this.Vd=null},et.prototype.copy=function(){var t=new et;t.mq=this.mq,t.Iv=this.Iv,t.vm=this.vm,t.Vd=this.Vd,t.U=this.U,t.Rr=this.Rr;var i=this.Tr;return t.Tr=xh.Va(i)&&"function"==typeof i.S?i.S():i,i=this.Sr,t.Sr=xh.Va(i)&&"function"==typeof i.S?i.S():i,i=this.Pr,t.Pr=xh.Va(i)&&"function"==typeof i.S?i.S():i,i=this.Nr,t.Nr=xh.Va(i)&&"function"==typeof i.S?i.S():i,t},et.prototype.toString=function(){var t="",t=this.xc===wl?t+"* ":this.xc===kl?t+(null!==this.Z?"!m":"!d"):t+(null!==this.Z?"!m":"!d")+this.xc;return this.propertyName&&"string"==typeof this.propertyName&&(t+=" "+this.propertyName),this.kf&&this.kf!==this.propertyName&&(t+=" "+this.kf),t+=": ",this.xc===wl?null!==this.oldValue&&(t+=" "+this.oldValue):(null!==this.object&&(t+=Cl(this.object)),null!==this.oldValue&&(t+="  old: "+Cl(this.oldValue)),null!==this.Bg&&(t+=" "+this.Bg),null!==this.newValue&&(t+="  new: "+Cl(this.newValue)),null!==this.zg&&(t+=" "+this.zg)),t},et.prototype.getValue=et.prototype.ka=function(t){return t?this.oldValue:this.newValue},et.prototype.getParam=function(t){return t?this.Bg:this.zg},et.prototype.canUndo=et.prototype.canUndo=function(){return null!==this.Z||null!==this.g},et.prototype.undo=et.prototype.undo=function(){this.canUndo()&&(null!==this.Z?this.Z.Lm(this,!0):null!==this.g&&this.g.Lm(this,!0))},et.prototype.canRedo=et.prototype.canRedo=function(){return null!==this.Z||null!==this.g},et.prototype.redo=et.prototype.redo=function(){this.canRedo()&&(null!==this.Z?this.Z.Lm(this,!1):null!==this.g&&this.g.Lm(this,!1))},xh.defineProperty(et,{Z:"model"},function(){return this.Vd},function(t){this.Vd=t}),xh.defineProperty(et,{g:"diagram"},function(){return this.U},function(t){this.U=t}),xh.defineProperty(et,{xc:"change"},function(){return this.mq},function(t){this.mq=t}),xh.defineProperty(et,{kf:"modelChange"},function(){return this.Iv},function(t){this.Iv=t}),xh.defineProperty(et,{propertyName:"propertyName"},function(){return this.vm},function(t){this.vm=t}),xh.u(et,{KE:"isTransactionFinished"},function(){return this.mq===wl&&("CommittedTransaction"===this.vm||"FinishedUndo"===this.vm||"FinishedRedo"===this.vm)}),xh.defineProperty(et,{object:"object"},function(){return this.Rr},function(t){this.Rr=t}),xh.defineProperty(et,{oldValue:"oldValue"},function(){return this.Tr},function(t){this.Tr=t}),xh.defineProperty(et,{Bg:"oldParam"},function(){return this.Sr},function(t){this.Sr=t}),xh.defineProperty(et,{newValue:"newValue"},function(){return this.Pr},function(t){this.Pr=t}),xh.defineProperty(et,{zg:"newParam"},function(){return this.Nr},function(t){this.Nr=t}),xh.ea("Model",nt),nt.prototype.cloneProtected=function(t){t.Qb=this.Qb,t.Cq=this.Cq,t.wi=this.wi,t.Gj=this.Gj,t.lo=this.lo,t.Dn=this.Dn,t.KJ=this.Su,t.tq=this.tq,t.dq=this.dq,t.qm=this.qm},nt.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},nt.prototype.clear=nt.prototype.clear=function(){this.Jf=[],this.uc.clear(),this.ri.clear(),this.ma.clear()},(mh=nt.prototype).toString=function(t){if(void 0===t&&(t=0),1<t)return this.SA();o=(""!==this.name?this.name:"")+" Model";if(0<t){o+="\n node data:",t=this.Yf;for(var i=xh.Xa(t),e=0;e<i;e++)var n=xh.Pa(t,e),o=o+" "+this.ib(n)+":"+Cl(n)}return o},mh.qn=function(){var t="";return""!==this.name&&(t+=',\n  "name": '+this.quote(this.name)),""!==this.ll&&(t+=',\n  "dataFormat": '+this.quote(this.ll)),this.bb&&(t+=',\n  "isReadOnly": '+this.bb),"key"!==this.Hl&&"string"==typeof this.Hl&&(t+=',\n  "nodeKeyProperty": '+this.quote(this.Hl)),this.Gz&&(t+=',\n  "copiesArrays": true'),this.Fz&&(t+=',\n  "copiesArrayObjects": true'),"category"!==this.gn&&"string"==typeof this.gn&&(t+=',\n  "nodeCategoryProperty": '+this.quote(this.gn)),t},mh.Yt=function(t){t.name&&(this.name=t.name),t.dataFormat&&(this.ll=t.dataFormat),t.isReadOnly&&(this.bb=t.isReadOnly),t.nodeKeyProperty&&(this.Hl=t.nodeKeyProperty),t.copiesArrays&&(this.Gz=t.copiesArrays),t.copiesArrayObjects&&(this.Fz=t.copiesArrayObjects),t.nodeCategoryProperty&&(this.gn=t.nodeCategoryProperty)},mh.$A=function(){var t,i=this.gk,e=!1;for(t in i)if(!lt(t,i[t])){e=!0;break}return i="",e&&(i=ot(this)),i+',\n  "nodeDataArray": '+ht(this,this.Yf,!0)},mh.yA=function(t){rt(this,t),t=t.nodeDataArray,xh.isArray(t)&&(this.au(t),this.Yf=t)},mh.aB=function(t){at(this,t,"nodeKeyProperty"),this instanceof Pt&&at(this,t,"nodeParentKeyProperty");for(var i=new c,e=new c,n=(new c).Tc(this.uc.ME),o=new m,r=t.Yf,s=0;s<r.length;s++){var a=r[s],h=t.ib(a);if(void 0!==h){n.remove(h);var l=this.$d(h);null===l?(i.add(h),e.add(a)):st(this,l,a,o)||e.add(a)}else this.gA(a),h=this.ib(a),i.add(h),e.add(a)}return r="",st(this,this.gk,t.gk,o)||(r+=ot(this)),0<i.count&&(r+=this.ey+ht(this,i.dc(),!0)),0<e.count&&(r+=this.mB+ht(this,e.dc(),!0)),0<n.count&&(r+=this.hy+ht(this,n.dc(),!0)),r},nt.prototype.computeJsonDifference=nt.prototype.computeJSONDifference=function(t,i){return xh.A(t,nt,nt,"computeJsonDifference:newmodel"),void 0===i&&(i=this.constructor===nt?"go.Model":this.constructor===wt?"go.GraphLinksModel":this.constructor===Pt?"go.TreeModel":xh.df(this)),'{ "class": '+this.quote(i)+', "incremental": 1'+this.qn()+this.aB(t)+"}"},(mh=nt.prototype).ey=',\n  "insertedNodeKeys": ',mh.mB=',\n  "modifiedNodeData": ',mh.hy=',\n  "removedNodeKeys": ',mh.ZA=function(t,i){var e=this,n=!1,o=new c,r=new c,s=new c;t.Of.each(function(t){t.Z===e&&("nodeDataArray"===t.kf?t.xc===Ml?o.add(t.newValue):t.xc===Pl&&s.add(t.oldValue):e.Ke(t.object)?r.add(t.object):e.gk===t.object&&t.xc===kl&&(n=!0))});var a=new c;o.each(function(t){a.add(e.ib(t)),i||r.add(t)});var h=new c;s.each(function(t){h.add(e.ib(t)),i&&r.add(t)});var l="";return n&&(l+=ot(this)),0<a.count&&(l+=(i?this.hy:this.ey)+ht(this,a.dc(),!0)),0<r.count&&(l+=this.mB+ht(this,r.dc(),!0)),0<h.count&&(l+=(i?this.ey:this.hy)+ht(this,h.dc(),!0)),l},mh.xA=function(t){rt(this,t);var i=t.insertedNodeKeys;if(xh.isArray(i))for(var e=xh.Xa(i),n=0;n<e;n++){r=xh.Pa(i,n);null===(s=this.$d(r))&&(s=this.copyNodeData({}),this.Ix(s,r),this.cl(s))}if(i=t.modifiedNodeData,xh.isArray(i))for(e=xh.Xa(i),n=0;n<e;n++){var o=xh.Pa(i,n),r=this.ib(o),s=this.$d(r);if(null!==s)for(var a in o)"__gohashid"!==a&&a!==this.Hl&&this.setDataProperty(s,a,o[a])}if(t=t.removedNodeKeys,xh.isArray(t))for(e=xh.Xa(t),n=0;n<e;n++)r=xh.Pa(t,n),null!==(s=this.$d(r))&&this.Ax(s)},nt.prototype.toIncrementalJson=nt.prototype.toIncrementalJSON=function(t,i){xh.A(t,et,nt,"toIncrementalJson:e"),t.xc!==wl&&xh.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+t.toString());var e=t.object;return t.KE&&e instanceof Nt?(void 0===i&&(i=this.constructor===nt?"go.Model":this.constructor===wt?"go.GraphLinksModel":this.constructor===Pt?"go.TreeModel":xh.df(this)),'{ "class": '+this.quote(i)+', "incremental": 1'+this.qn()+this.ZA(e,"FinishedUndo"===t.propertyName)+"}"):'{ "incremental": 0 }'},nt.prototype.toJson=nt.prototype.toJSON=nt.prototype.SA=function(t){return void 0===t&&(t=this.constructor===nt?"go.Model":this.constructor===wt?"go.GraphLinksModel":this.constructor===Pt?"go.TreeModel":xh.df(this)),'{ "class": '+this.quote(t)+this.qn()+this.$A()+"}"},nt.prototype.applyIncrementalJson=nt.prototype.applyIncrementalJSON=function(i){var e=null;if("string"==typeof i)if(t.JSON&&t.JSON.parse)try{e=t.JSON.parse(i)}catch(t){}else xh.trace("WARNING: no JSON.parse available");else"object"==typeof i?e=i:xh.k("Unable to modify a Model from: "+i);var n=e.incremental;"number"!=typeof n&&xh.k("Unable to apply non-incremental changes to Model: "+i),0!==n&&(this.Sb("applyIncrementalJson"),this.xA(e),this.Ad("applyIncrementalJson"))},nt.fromJson=nt.fromJSON=function(i,e){void 0===e&&(e=null),null!==e&&xh.A(e,nt,nt,"fromJson:model");var n=null;if("string"==typeof i)if(t.JSON&&t.JSON.parse)try{n=t.JSON.parse(i)}catch(t){}else xh.trace("WARNING: no JSON.parse available");else"object"==typeof i?n=i:xh.k("Unable to construct a Model from: "+i);if(null===e){var o;o=null;var r=n.class;if("string"==typeof r)try{var s=null;0===r.indexOf("go.")?(r=r.substr(3),s=bh[r]):void 0===(s=bh[r])&&(s=t[r]),"function"==typeof s&&(o=new s)}catch(t){}null===o||o instanceof nt?e=o:xh.k("Unable to construct a Model of declared class: "+n.class)}return null===e&&(e=new wt),e.Yt(n),e.yA(n),e},nt.prototype.replaceJsonObjects=nt.prototype.au=function(t){if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++){var n=xh.Pa(t,e);xh.Va(n)&&xh.HD(t,e,this.au(n))}else if(xh.Va(t)){for(e in t)if(n=t[e],xh.Va(n)&&(n=this.au(n),t[e]=n,"points"===e&&Array.isArray(n))){for(var o=0==n.length%2,r=0;r<n.length;r++)if("number"!=typeof n[r]){o=!1;break}if(o){for(o=new u(b),r=0;r<n.length/2;r++)o.add(new b(n[2*r],n[2*r+1]));o.freeze(),t[e]=o}}if("object"==typeof t){if(e=t,"NaN"===(n=t.class))e=NaN;else if("Date"===n)e=new Date(t.value);else if("go.Point"===n)e=new b(ct(t.x),ct(t.y));else if("go.Size"===n)e=new k(ct(t.width),ct(t.height));else if("go.Rect"===n)e=new M(ct(t.x),ct(t.y),ct(t.width),ct(t.height));else if("go.Margin"===n)e=new j(ct(t.top),ct(t.right),ct(t.bottom),ct(t.left));else if("go.Spot"===n)e="string"==typeof t.enum?Nh(t.enum):new D(ct(t.x),ct(t.y),ct(t.offsetX),ct(t.offsetY));else if("go.Brush"===n){if(e=new kn,e.type=wh(kn,t.type),"string"==typeof t.color&&(e.color=t.color),t.start instanceof D&&(e.start=t.start),t.end instanceof D&&(e.end=t.end),"number"==typeof t.startRadius&&(e.nu=ct(t.startRadius)),"number"==typeof t.endRadius&&(e.lt=ct(t.endRadius)),t=t.colorStops,xh.Va(t))for(i in t)e.addColorStop(parseFloat(i),t[i])}else"go.Geometry"===n?(i=null,i="string"==typeof t.path?dl(t.path):new K,i.type=wh(K,t.type),"number"==typeof t.startX&&(i.za=ct(t.startX)),"number"==typeof t.startY&&(i.xa=ct(t.startY)),"number"==typeof t.endX&&(i.I=ct(t.endX)),"number"==typeof t.endY&&(i.J=ct(t.endY)),t.spot1 instanceof D&&(i.B=t.spot1),t.spot2 instanceof D&&(i.C=t.spot2),e=i):"go.EnumValue"===n&&(0===(i=t.classType).indexOf("go.")&&(i=i.substr(3)),e=wh(bh[i],t.name));t=e}}return t},nt.prototype.quote=function(t){for(var i="",e=t.length,n=0;n<e;n++){var o=t[n];if('"'===o||"\\"===o)i+="\\"+o;else if("\b"===o)i+="\\b";else if("\f"===o)i+="\\f";else if("\n"===o)i+="\\n";else if("\r"===o)i+="\\r";else if("\t"===o)i+="\\t";else var r=t.charCodeAt(n),i=16>r?i+"\\u000"+t.charCodeAt(n).toString(16):32>r?i+"\\u00"+t.charCodeAt(n).toString(16):8232===r?i+"\\u2028":8233===r?i+"\\u2029":i+o}return'"'+i+'"'},nt.prototype.writeJsonValue=nt.prototype.tu=function(t){return void 0===t?"undefined":null===t?"null":!0===t?"true":!1===t?"false":"string"==typeof t?this.quote(t):"number"==typeof t?1/0===t?"9e9999":-1/0===t?"-9e9999":isNaN(t)?'{"class":"NaN"}':t.toString():t instanceof Date?'{"class":"Date", "value":"'+t.toJSON()+'"}':t instanceof Number?this.tu(t.valueOf()):xh.isArray(t)?ht(this,t):xh.Va(t)?ft(this,t):"function"==typeof t?"null":t.toString()},xh.defineProperty(nt,{name:"name"},function(){return this.Qb},function(t){var i=this.Qb;i!==t&&(xh.j(t,"string",nt,"name"),this.Qb=t,this.h("name",i,t))}),xh.defineProperty(nt,{ll:"dataFormat"},function(){return this.Cq},function(t){var i=this.Cq;i!==t&&(xh.j(t,"string",nt,"dataFormat"),this.Cq=t,this.h("dataFormat",i,t))}),xh.defineProperty(nt,{bb:"isReadOnly"},function(){return this.wi},function(t){var i=this.wi;i!==t&&(xh.j(t,"boolean",nt,"isReadOnly"),this.wi=t,this.h("isReadOnly",i,t))}),xh.defineProperty(nt,{gk:"modelData"},function(){return this.Wy},function(t){var i=this.Wy;i!==t&&(xh.j(t,"object",nt,"modelData"),this.Wy=t,this.h("modelData",i,t),this.Jb(t))}),nt.prototype.addChangedListener=nt.prototype.Gm=function(t){xh.j(t,"function",nt,"addChangedListener:listener"),null===this.Aj&&(this.Aj=new u("function")),this.Aj.add(t)},nt.prototype.removeChangedListener=nt.prototype.Zt=function(t){xh.j(t,"function",nt,"removeChangedListener:listener"),null!==this.Aj&&(this.Aj.remove(t),0===this.Aj.count&&(this.Aj=null))},nt.prototype.Fw=function(t){if(this.wb||this.ma.uE(t),null!==this.Aj){var i=this.Aj,e=i.length;if(1===e)(i=i.ha(0))(t);else if(0!==e)for(var n=i.dc(),o=0;o<e;o++)(i=n[o])(t)}},nt.prototype.raiseChangedEvent=nt.prototype.Lc=function(t,i,e,n,o,r,s){pt(this,"",t,i,e,n,o,r,s)},nt.prototype.raiseChanged=nt.prototype.h=function(t,i,e,n,o){pt(this,"",kl,t,this,i,e,n,o)},nt.prototype.raiseDataChanged=nt.prototype.wA=function(t,i,e,n,o,r){pt(this,"",kl,i,t,e,n,o,r)},xh.defineProperty(nt,{ma:"undoManager"},function(){return this.oz},function(t){var i=this.oz;i!==t&&(xh.A(t,Ct,nt,"undoManager"),null!==i&&i.XI(this),this.oz=t,null!==t&&t.JG(this))}),xh.defineProperty(nt,{wb:"skipsUndoManager"},function(){return this.Ki},function(t){xh.j(t,"boolean",nt,"skipsUndoManager"),this.Ki=t}),nt.prototype.Lm=function(t,i){if(null!==t&&t.Z===this)if(t.xc===kl){var e=t.object,n=t.propertyName,o=t.ka(i);xh.Ka(e,n,o)}else t.xc===Ml?"nodeDataArray"===t.kf?(e=t.newValue,xh.Va(e)&&void 0!==(n=this.ib(e))&&(i?(xh.Xh(this.Jf,t.zg),this.uc.remove(n)):(xh.Si(this.Jf,t.zg,e),this.uc.add(n,e)))):""===t.kf?(e=t.object,!xh.isArray(e)&&t.propertyName&&(e=xh.sb(t.object,t.propertyName)),xh.isArray(e)&&(n=t.newValue,o=t.zg,i?xh.Xh(e,o):xh.Si(e,o,n))):xh.k("unknown ChangedEvent.Insert object: "+t.toString()):t.xc===Pl?"nodeDataArray"===t.kf?(e=t.oldValue,xh.Va(e)&&void 0!==(n=this.ib(e))&&(i?(xh.Si(this.Jf,t.Bg,e),this.uc.add(n,e)):(xh.Xh(this.Jf,t.Bg),this.uc.remove(n)))):""===t.kf?(e=t.object,!xh.isArray(e)&&t.propertyName&&(e=xh.sb(t.object,t.propertyName)),xh.isArray(e)&&(n=t.oldValue,o=t.Bg,i?xh.Si(e,o,n):xh.Xh(e,o))):xh.k("unknown ChangedEvent.Remove object: "+t.toString()):t.xc!==wl&&xh.k("unknown ChangedEvent: "+t.toString())},nt.prototype.startTransaction=nt.prototype.Sb=function(t){return this.ma.Sb(t)},nt.prototype.commitTransaction=nt.prototype.Ad=function(t){return this.ma.Ad(t)},nt.prototype.rollbackTransaction=nt.prototype.Ip=function(){return this.ma.Ip()},nt.prototype.updateTargetBindings=nt.prototype.Jb=function(t,i){void 0===i&&(i=""),pt(this,"SourceChanged",wl,i,t,null,null)},xh.defineProperty(nt,{Hl:"nodeKeyProperty"},function(){return this.Gj},function(t){var i=this.Gj;i!==t&&(dt(t,nt,"nodeKeyProperty"),""===t&&xh.k("Model.nodeKeyProperty may not be the empty string"),0<this.uc.count&&xh.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Gj=t,this.h("nodeKeyProperty",i,t))}),nt.prototype.getKeyForNodeData=nt.prototype.ib=function(t){if(null!==t){var i=this.Gj;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("Key value for node data "+t+" is not a number or a string: "+i)}}},nt.prototype.setKeyForNodeData=nt.prototype.Ix=function(t,i){if(void 0!==i&&null!==i&&yt(i)||xh.Ed(i,"number or string",nt,"setKeyForNodeData:key"),null!==t){var e=this.Gj;if(""!==e)if(this.Ke(t)){var n=xh.sb(t,e);n!==i&&null===this.$d(i)&&(xh.Ka(t,e,i),this.uc.remove(n),this.uc.add(i,t),pt(this,"nodeKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e),this.$t(n,i))}else xh.Ka(t,e,i)}},xh.defineProperty(nt,{UK:"makeUniqueKeyFunction"},function(){return this.lo},function(t){var i=this.lo;i!==t&&(null!==t&&xh.j(t,"function",nt,"makeUniqueKeyFunction"),this.lo=t,this.h("makeUniqueKeyFunction",i,t))}),nt.prototype.containsNodeData=nt.prototype.Ke=function(t){var i=this.ib(t);return void 0!==i&&this.uc.ka(i)===t},nt.prototype.findNodeDataForKey=nt.prototype.$d=function(t){return null===t&&xh.k("Model.findNodeDataForKey:key must not be null"),void 0!==t&&yt(t)?this.uc.ka(t):null},xh.defineProperty(nt,{Yf:"nodeDataArray"},function(){return this.Jf},function(t){var i=this.Jf;if(i!==t){xh.Az(t,nt,"nodeDataArray"),this.uc.clear(),this.VA();for(var e=xh.Xa(t),n=0;n<e;n++){r=xh.Pa(t,n);if(!xh.Va(r))return void xh.k("Model.nodeDataArray must only contain Objects, not: "+r);xh.zt(r)}this.Jf=t;for(var o=new u(Object),n=0;n<e;n++){var r=xh.Pa(t,n),s=this.ib(r);void 0===s?o.add(r):null!==this.uc.ka(s)?o.add(r):this.uc.add(s,r)}for(n=o.i;n.next();)r=n.value,this.gA(r),void 0!==(o=this.ib(r))&&this.uc.add(o,r);for(pt(this,"nodeDataArray",kl,"nodeDataArray",this,i,t),n=0;n<e;n++)r=xh.Pa(t,n),this.Hp(r),this.Gp(r);this.ND(),xh.gI(t)||(this.bb=!0)}}),nt.prototype.makeNodeDataKeyUnique=nt.prototype.gA=function(t){if(null!==t){var i=this.Gj;if(""!==i){var e=this.ib(t);if(void 0===e||this.uc.contains(e)){var n=this.lo;if(null!==n&&void 0!==(e=n(this,t))&&null!==e&&!this.uc.contains(e))return void xh.Ka(t,i,e);if("string"==typeof e){for(n=2;this.uc.contains(e+n);)n++;xh.Ka(t,i,e+n)}else if(void 0===e||"number"==typeof e){for(n=-this.uc.count-1;this.uc.contains(n);)n--;xh.Ka(t,i,n)}else xh.k("Model.getKeyForNodeData returned something other than a string or a number: "+e)}}}},nt.prototype.addNodeData=nt.prototype.cl=function(t){null!==t&&(xh.zt(t),vt(this,t,!0))},nt.prototype.addNodeDataCollection=function(t){if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.cl(xh.Pa(t,e));else for(t=t.i;t.next();)this.cl(t.value)},nt.prototype.removeNodeData=nt.prototype.Ax=function(t){if(null!==t){var i=this.ib(t);void 0!==i&&this.uc.contains(i)&&(this.uc.remove(i),0>(i=xh.zz(this.Jf,t))||(xh.Xh(this.Jf,i),pt(this,"nodeDataArray",Pl,"nodeDataArray",this,t,null,i,null),this.ru(t)))}},nt.prototype.removeNodeDataCollection=function(t){if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.Ax(xh.Pa(t,e));else for(t=t.i;t.next();)this.Ax(t.value)},(mh=nt.prototype).$t=function(t,i){var e=bt(this,t);e instanceof c&&this.ri.add(i,e)},mh.VA=function(){},mh.Hp=function(){},mh.Gp=function(){},mh.ru=function(){},nt.prototype.clearUnresolvedReferences=nt.prototype.ND=function(t){void 0===t?this.ri.clear():this.ri.remove(t)},xh.defineProperty(nt,{lK:"copyNodeDataFunction"},function(){return this.Dn},function(t){var i=this.Dn;i!==t&&(null!==t&&xh.j(t,"function",nt,"copyNodeDataFunction"),this.Dn=t,this.h("copyNodeDataFunction",i,t))}),xh.defineProperty(nt,{Gz:"copiesArrays"},function(){return this.Su},function(t){var i=this.Su;i!==t&&(null!==t&&xh.j(t,"boolean",nt,"copiesArrays"),this.Su=t,this.h("copiesArrays",i,t))}),xh.defineProperty(nt,{Fz:"copiesArrayObjects"},function(){return this.tq},function(t){var i=this.tq;i!==t&&(null!==t&&xh.j(t,"boolean",nt,"copiesArrayObjects"),this.tq=t,this.h("copiesArrayObjects",i,t))}),nt.prototype.copyNodeData=function(t){if(null===t)return null;var i=null,i=null!==(i=this.Dn)?i(t,this):xt(this,t,!0);return xh.Va(i)&&xh.ec(i),i},xh.defineProperty(nt,{LG:"afterCopyFunction"},function(){return this.dq},function(t){var i=this.dq;i!==t&&(null!==t&&xh.j(t,"function",nt,"afterCopyFunction"),this.dq=t,this.h("afterCopyFunction",i,t))});var Tl=!1;nt.prototype.setDataProperty=function(t,i,e){if(this.Ke(t)){if(i===this.Hl)this.Ix(t,e);else if(i===this.gn)return void this.Fx(t,e)}else!Tl&&t instanceof Mn&&(Tl=!0,xh.trace('Model.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),xh.trace("  Is that really your intent?"));var n=xh.sb(t,i);n!==e&&(xh.Ka(t,i,e),this.wA(t,i,n,e))},nt.prototype.addArrayItem=function(t,i){this.aI(t,-1,i)},nt.prototype.insertArrayItem=nt.prototype.aI=function(t,i,e){t===this.Jf&&xh.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"),0>i&&(i=xh.Xa(t)),xh.Si(t,i,e),pt(this,"",Ml,"",t,null,e,null,i)},nt.prototype.removeArrayItem=function(t,i){void 0===i&&(i=-1),t===this.Jf&&xh.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"),-1===i&&(i=xh.Xa(t)-1);var e=xh.Pa(t,i);xh.Xh(t,i),pt(this,"",Pl,"",t,e,null,i,null)},xh.defineProperty(nt,{gn:"nodeCategoryProperty"},function(){return this.qm},function(t){var i=this.qm;i!==t&&(dt(t,nt,"nodeCategoryProperty"),this.qm=t,this.h("nodeCategoryProperty",i,t))}),nt.prototype.getCategoryForNodeData=nt.prototype.Rz=function(t){if(null===t)return"";var i=this.qm;return""===i?"":void 0===(i=xh.sb(t,i))?"":"string"==typeof i?i:(xh.k("getCategoryForNodeData found a non-string category for "+t+": "+i),"")},nt.prototype.setCategoryForNodeData=nt.prototype.Fx=function(t,i){if(xh.j(i,"string",nt,"setCategoryForNodeData:cat"),null!==t){var e=this.qm;if(""!==e)if(this.Ke(t)){var n=xh.sb(t,e);void 0===n&&(n=""),n!==i&&(xh.Ka(t,e,i),pt(this,"nodeCategory",kl,e,t,n,i))}else xh.Ka(t,e,i)}},xh.Ja(wt,nt),xh.ea("GraphLinksModel",wt),wt.prototype.cloneProtected=function(t){nt.prototype.cloneProtected.call(this,t),t.Pk=this.Pk,t.mo=this.mo,t.Cn=this.Cn,t.Jh=this.Jh,t.Kh=this.Kh,t.mm=this.mm,t.nm=this.nm,t.lm=this.lm,t.ig=this.ig,t.qo=this.qo,t.Rg=this.Rg,t.uq=this.uq},wt.prototype.clear=wt.prototype.clear=function(){nt.prototype.clear.call(this),this.Hf=[],this.Yc.clear(),this.jo.clear()},(mh=wt.prototype).toString=function(t){if(void 0===t&&(t=0),2<=t)return this.SA();o=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<t){o+="\n node data:",t=this.Yf;for(var i=xh.Xa(t),e=0,e=0;e<i;e++)var n=xh.Pa(t,e),o=o+" "+this.ib(n)+":"+Cl(n);for(o+="\n link data:",t=this.yg,i=xh.Xa(t),e=0;e<i;e++)n=xh.Pa(t,e),o+=" "+this.vl(n)+"--\x3e"+this.yl(n)}return o},mh.qn=function(){var t=nt.prototype.qn.call(this),i="";return"category"!==this.Lt&&"string"==typeof this.Lt&&(i+=',\n  "linkCategoryProperty": '+this.quote(this.Lt)),""!==this.cj&&"string"==typeof this.cj&&(i+=',\n  "linkKeyProperty": '+this.quote(this.cj)),"from"!==this.qp&&"string"==typeof this.qp&&(i+=',\n  "linkFromKeyProperty": '+this.quote(this.qp)),"to"!==this.sp&&"string"==typeof this.sp&&(i+=',\n  "linkToKeyProperty": '+this.quote(this.sp)),""!==this.Mt&&"string"==typeof this.Mt&&(i+=',\n  "linkFromPortIdProperty": '+this.quote(this.Mt)),""!==this.Ot&&"string"==typeof this.Ot&&(i+=',\n  "linkToPortIdProperty": '+this.quote(this.Ot)),""!==this.Nt&&"string"==typeof this.Nt&&(i+=',\n  "linkLabelKeysProperty": '+this.quote(this.Nt)),"isGroup"!==this.Ut&&"string"==typeof this.Ut&&(i+=',\n  "nodeIsGroupProperty": '+this.quote(this.Ut)),"group"!==this.Cp&&"string"==typeof this.Cp&&(i+=',\n  "nodeGroupKeyProperty": '+this.quote(this.Cp)),t+i},mh.Yt=function(t){nt.prototype.Yt.call(this,t),t.linkKeyProperty&&(this.cj=t.linkKeyProperty),t.linkFromKeyProperty&&(this.qp=t.linkFromKeyProperty),t.linkToKeyProperty&&(this.sp=t.linkToKeyProperty),t.linkFromPortIdProperty&&(this.Mt=t.linkFromPortIdProperty),t.linkToPortIdProperty&&(this.Ot=t.linkToPortIdProperty),t.linkCategoryProperty&&(this.Lt=t.linkCategoryProperty),t.linkLabelKeysProperty&&(this.Nt=t.linkLabelKeysProperty),t.nodeIsGroupProperty&&(this.Ut=t.nodeIsGroupProperty),t.nodeGroupKeyProperty&&(this.Cp=t.nodeGroupKeyProperty)},mh.$A=function(){return nt.prototype.$A.call(this)+(',\n  "linkDataArray": '+ht(this,this.yg,!0))},mh.yA=function(t){nt.prototype.yA.call(this,t),t=t.linkDataArray,xh.isArray(t)&&(this.au(t),this.yg=t)},mh.aB=function(t){t instanceof wt||xh.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),""===this.cj&&xh.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var i=nt.prototype.aB.call(this,t);at(this,t,"linkKeyProperty"),at(this,t,"linkFromKeyProperty"),at(this,t,"linkToKeyProperty"),at(this,t,"linkLabelKeysProperty"),at(this,t,"nodeIsGroupProperty"),at(this,t,"nodeGroupKeyProperty");for(var e=new c,n=new c,o=(new c).Tc(this.Yc.ME),r=new m,s=t.yg,a=0;a<s.length;a++){var h=s[a],l=t.ef(h);if(void 0!==l){o.remove(l);var u=this.ot(l);null===u?(e.add(l),n.add(h)):st(this,u,h,r)||n.add(h)}else this.fA(h),l=this.ef(h),e.add(l),n.add(h)}return t=i,0<e.count&&(t+=this.by+ht(this,e.dc(),!0)),0<n.count&&(t+=this.lB+ht(this,n.dc(),!0)),0<o.count&&(t+=this.gy+ht(this,o.dc(),!0)),t},mh.by=',\n  "insertedLinkKeys": ',mh.lB=',\n  "modifiedLinkData": ',mh.gy=',\n  "removedLinkKeys": ',mh.ZA=function(t,i){""===this.cj&&xh.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var e=nt.prototype.ZA.call(this,t,i),n=this,o=new c,r=new c,s=new c;t.Of.each(function(t){t.Z===n&&("linkDataArray"===t.kf?t.xc===Ml?o.add(t.newValue):t.xc===Pl&&s.add(t.oldValue):n.$g(t.object)&&r.add(t.object))});var a=new c;o.each(function(t){a.add(n.ef(t)),i||r.add(t)});var h=new c;return s.each(function(t){h.add(n.ef(t)),i&&r.add(t)}),0<a.count&&(e+=(i?this.gy:this.by)+ht(this,a.dc(),!0)),0<r.count&&(e+=this.lB+ht(this,r.dc(),!0)),0<h.count&&(e+=(i?this.by:this.gy)+ht(this,h.dc(),!0)),e},mh.xA=function(t){nt.prototype.xA.call(this,t);var i=t.insertedLinkKeys;if(xh.isArray(i))for(var e=xh.Xa(i),n=0;n<e;n++){r=xh.Pa(i,n);null===(s=this.ot(r))&&(s=this.Jw({}),this.vF(s,r),this.Ws(s))}if(i=t.modifiedLinkData,xh.isArray(i))for(e=xh.Xa(i),n=0;n<e;n++){var o=xh.Pa(i,n),r=this.ef(o),s=this.ot(r);if(null!==s)for(var a in o)"__gohashid"!==a&&a!==this.cj&&this.setDataProperty(s,a,o[a])}if(t=t.removedLinkKeys,xh.isArray(t))for(e=xh.Xa(t),n=0;n<e;n++)r=xh.Pa(t,n),null!==(s=this.ot(r))&&this.zx(s)},mh.Lm=function(t,i){e=null;if(t.xc===Ml){if("linkDataArray"===t.kf?e=this.Hf:"linkLabelKeys"===t.kf&&(e=this.dk(t.object)),xh.isArray(e)){if(i)xh.Xh(e,t.zg),e===this.Hf&&void 0!==(e=this.ef(t.newValue))&&this.Yc.remove(e);else if(xh.Si(e,t.zg,t.newValue),e===this.Hf){var e,n=t.newValue;void 0!==(e=this.ef(n))&&this.Yc.add(e,n)}return}}else if(t.xc===Pl&&("linkDataArray"===t.kf?e=this.Hf:"linkLabelKeys"===t.kf&&(e=this.dk(t.object)),xh.isArray(e)))return void(i?(xh.Si(e,t.Bg,t.oldValue),e===this.Hf&&(n=t.newValue,void 0!==(e=this.ef(n))&&this.Yc.add(e,n))):(xh.Xh(e,t.Bg),e===this.Hf&&void 0!==(e=this.ef(t.newValue))&&this.Yc.remove(e)));nt.prototype.Lm.call(this,t,i)},xh.defineProperty(wt,{yz:"archetypeNodeData"},function(){return this.Vl},function(t){var i=this.Vl;i!==t&&(null!==t&&xh.A(t,Object,wt,"archetypeNodeData"),this.Vl=t,this.h("archetypeNodeData",i,t))}),wt.prototype.en=function(t){if(void 0!==t){var i=this.Vl;if(null!==i){var e=this.$d(t);null===e&&(e=this.copyNodeData(i),xh.Ka(e,this.Gj,t),this.cl(e))}return t}},xh.defineProperty(wt,{qp:"linkFromKeyProperty"},function(){return this.Jh},function(t){var i=this.Jh;i!==t&&(dt(t,wt,"linkFromKeyProperty"),this.Jh=t,this.h("linkFromKeyProperty",i,t))}),wt.prototype.getFromKeyForLinkData=wt.prototype.vl=function(t){if(null!==t){var i=this.Jh;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("FromKey value for link data "+t+" is not a number or a string: "+i)}}},wt.prototype.setFromKeyForLinkData=wt.prototype.Gx=function(t,i){if(null===i&&(i=void 0),void 0===i||yt(i)||xh.Ed(i,"number or string",wt,"setFromKeyForLinkData:key"),null!==t){var e=this.Jh;if(""!==e)if(i=this.en(i),this.$g(t)){var n=xh.sb(t,e);n!==i&&(mt(this,n,t),xh.Ka(t,e,i),null===this.$d(i)&&gt(this,i,t),pt(this,"linkFromKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(wt,{sp:"linkToKeyProperty"},function(){return this.Kh},function(t){var i=this.Kh;i!==t&&(dt(t,wt,"linkToKeyProperty"),this.Kh=t,this.h("linkToKeyProperty",i,t))}),wt.prototype.getToKeyForLinkData=wt.prototype.yl=function(t){if(null!==t){var i=this.Kh;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("ToKey value for link data "+t+" is not a number or a string: "+i)}}},wt.prototype.setToKeyForLinkData=wt.prototype.Kx=function(t,i){if(null===i&&(i=void 0),void 0===i||yt(i)||xh.Ed(i,"number or string",wt,"setToKeyForLinkData:key"),null!==t){var e=this.Kh;if(""!==e)if(i=this.en(i),this.$g(t)){var n=xh.sb(t,e);n!==i&&(mt(this,n,t),xh.Ka(t,e,i),null===this.$d(i)&&gt(this,i,t),pt(this,"linkToKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(wt,{Mt:"linkFromPortIdProperty"},function(){return this.mm},function(t){var i=this.mm;i!==t&&(dt(t,wt,"linkFromPortIdProperty"),this.mm=t,this.h("linkFromPortIdProperty",i,t))}),wt.prototype.getFromPortIdForLinkData=wt.prototype.JH=function(t){if(null===t)return"";var i=this.mm;return""===i?"":void 0===(t=xh.sb(t,i))?"":t},wt.prototype.setFromPortIdForLinkData=wt.prototype.JA=function(t,i){if(xh.j(i,"string",wt,"setFromPortIdForLinkData:portname"),null!==t){var e=this.mm;if(""!==e)if(this.$g(t)){var n=xh.sb(t,e);void 0===n&&(n=""),n!==i&&(xh.Ka(t,e,i),pt(this,"linkFromPortId",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(wt,{Ot:"linkToPortIdProperty"},function(){return this.nm},function(t){var i=this.nm;i!==t&&(dt(t,wt,"linkToPortIdProperty"),this.nm=t,this.h("linkToPortIdProperty",i,t))}),wt.prototype.getToPortIdForLinkData=wt.prototype.MH=function(t){if(null===t)return"";var i=this.nm;return""===i?"":void 0===(t=xh.sb(t,i))?"":t},wt.prototype.setToPortIdForLinkData=wt.prototype.MA=function(t,i){if(xh.j(i,"string",wt,"setToPortIdForLinkData:portname"),null!==t){var e=this.nm;if(""!==e)if(this.$g(t)){var n=xh.sb(t,e);void 0===n&&(n=""),n!==i&&(xh.Ka(t,e,i),pt(this,"linkToPortId",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(wt,{Nt:"linkLabelKeysProperty"},function(){return this.ig},function(t){var i=this.ig;i!==t&&(dt(t,wt,"linkLabelKeysProperty"),this.ig=t,this.h("linkLabelKeysProperty",i,t))}),wt.prototype.getLabelKeysForLinkData=wt.prototype.dk=function(t){if(null===t)return xh.vh;var i=this.ig;return""===i?xh.vh:void 0===(t=xh.sb(t,i))?xh.vh:t},wt.prototype.setLabelKeysForLinkData=wt.prototype.wF=function(t,i){if(xh.Az(i,wt,"setLabelKeysForLinkData:arr"),null!==t){var e=this.ig;if(""!==e)if(this.$g(t)){var n=xh.sb(t,e);if(void 0===n&&(n=xh.vh),n!==i){for(var o=xh.Xa(n),r=0;r<o;r++){var s=xh.Pa(n,r);mt(this,s,t)}for(xh.Ka(t,e,i),o=xh.Xa(i),r=0;r<o;r++)s=xh.Pa(i,r),null===this.$d(s)&&gt(this,s,t);pt(this,"linkLabelKeys",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e)}}else xh.Ka(t,e,i)}},wt.prototype.addLabelKeyForLinkData=wt.prototype.vz=function(t,i){if(null!==i&&void 0!==i&&(yt(i)||xh.Ed(i,"number or string",wt,"addLabelKeyForLinkData:key"),null!==t)){var e=this.ig;if(""!==e){var n=xh.sb(t,e);void 0===n?((e=[]).push(i),this.wF(t,e)):xh.isArray(n)?0<=xh.zz(n,i)||(xh.Si(n,1/0,i),this.$g(t)&&(null===this.$d(i)&&gt(this,i,t),pt(this,"linkLabelKeys",Ml,e,t,null,i))):xh.k(e+" property is not an Array; cannot addLabelKeyForLinkData: "+t)}}},wt.prototype.removeLabelKeyForLinkData=wt.prototype.dF=function(t,i){if(null!==i&&void 0!==i&&(yt(i)||xh.Ed(i,"number or string",wt,"removeLabelKeyForLinkData:key"),null!==t)){var e=this.ig;if(""!==e){var n=xh.sb(t,e);if(xh.isArray(n)){var o=xh.zz(n,i);0>o||(xh.Xh(n,o),this.$g(t)&&(mt(this,i,t),pt(this,"linkLabelKeys",Pl,e,t,i,null)))}else void 0!==n&&xh.k(e+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},xh.defineProperty(wt,{yg:"linkDataArray"},function(){return this.Hf},function(t){var i=this.Hf;if(i!==t){xh.Az(t,wt,"linkDataArray"),this.Yc.clear();for(var e=xh.Xa(t),n=0;n<e;n++){r=xh.Pa(t,n);if(!xh.Va(r))return void xh.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+r);xh.zt(r)}if(this.Hf=t,""!==this.cj){for(var o=new u(Object),n=0;n<e;n++){var r=xh.Pa(t,n),s=this.ef(r);void 0===s?o.add(r):null!==this.Yc.ka(s)?o.add(r):this.Yc.add(s,r)}for(n=o.i;n.next();)r=n.value,this.fA(r),void 0!==(o=this.ef(r))&&this.Yc.add(o,r)}for(o=new c(Object),n=0;n<e;n++)r=xh.Pa(t,n),o.add(r);for(this.jo=o,pt(this,"linkDataArray",kl,"linkDataArray",this,i,t),n=0;n<e;n++)r=xh.Pa(t,n),Mt(this,r)}}),xh.defineProperty(wt,{cj:"linkKeyProperty"},function(){return this.Pk},function(t){var i=this.Pk;if(i!==t){dt(t,wt,"linkKeyProperty"),this.Pk=t,this.Yc.clear();for(var e=xh.Xa(this.yg),n=0;n<e;n++){var o=xh.Pa(this.yg,n),r=this.ef(o);void 0!==r&&this.Yc.add(r,o)}this.h("linkKeyProperty",i,t)}}),wt.prototype.getKeyForLinkData=wt.prototype.ef=function(t){if(null!==t){var i=this.Pk;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("Key value for link data "+t+" is not a number or a string: "+i)}}},wt.prototype.setKeyForLinkData=wt.prototype.vF=function(t,i){if(void 0!==i&&null!==i&&yt(i)||xh.Ed(i,"number or string",wt,"setKeyForLinkData:key"),null!==t){var e=this.Pk;if(""!==e)if(this.$g(t)){var n=xh.sb(t,e);n!==i&&null===this.ot(i)&&(xh.Ka(t,e,i),this.Yc.remove(n),this.Yc.add(i,t),pt(this,"linkKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(wt,{VK:"makeUniqueLinkKeyFunction"},function(){return this.mo},function(t){var i=this.mo;i!==t&&(null!==t&&xh.j(t,"function",wt,"makeUniqueLinkKeyFunction"),this.mo=t,this.h("makeUniqueLinkKeyFunction",i,t))}),wt.prototype.findLinkDataForKey=wt.prototype.ot=function(t){return null===t&&xh.k("GraphLinksModel.findLinkDataForKey:key must not be null"),void 0!==t&&yt(t)?this.Yc.ka(t):null},wt.prototype.makeLinkDataKeyUnique=wt.prototype.fA=function(t){if(null!==t){var i=this.Pk;if(""!==i){var e=this.ef(t);if(void 0===e||this.Yc.contains(e)){var n=this.mo;if(null!==n&&void 0!==(e=n(this,t))&&null!==e&&!this.Yc.contains(e))return void xh.Ka(t,i,e);if("string"==typeof e){for(n=2;this.Yc.contains(e+n);)n++;xh.Ka(t,i,e+n)}else if(void 0===e||"number"==typeof e){for(n=-this.Yc.count-1;this.Yc.contains(n);)n--;xh.Ka(t,i,n)}else xh.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+e)}}}},wt.prototype.containsLinkData=wt.prototype.$g=function(t){return null!==t&&this.jo.contains(t)},wt.prototype.addLinkData=wt.prototype.Ws=function(t){if(null!==t){if(void 0===xh.pd(t))xh.ec(t);else if(this.$g(t))return;kt(this,t,!0)}},wt.prototype.addLinkDataCollection=function(t){if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.Ws(xh.Pa(t,e));else for(t=t.i;t.next();)this.Ws(t.value)},wt.prototype.removeLinkData=wt.prototype.zx=function(t){if(null!==t){this.jo.remove(t);var i=this.ef(t);if(void 0!==i&&this.Yc.remove(i),!(0>(i=this.Hf.indexOf(t)))){xh.Xh(this.Hf,i),pt(this,"linkDataArray",Pl,"linkDataArray",this,t,null,i,null),mt(this,i=this.vl(t),t),mt(this,i=this.yl(t),t);var e=this.dk(t);if(xh.isArray(e))for(var n=xh.Xa(e),o=0;o<n;o++)i=xh.Pa(e,o),mt(this,i,t)}}},wt.prototype.removeLinkDataCollection=function(t){if(xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++)this.zx(xh.Pa(t,e));else for(t=t.i;t.next();)this.zx(t.value)},xh.defineProperty(wt,{kK:"copyLinkDataFunction"},function(){return this.Cn},function(t){var i=this.Cn;i!==t&&(null!==t&&xh.j(t,"function",wt,"copyLinkDataFunction"),this.Cn=t,this.h("copyLinkDataFunction",i,t))}),wt.prototype.copyLinkData=wt.prototype.Jw=function(t){if(null===t)return null;var i=null,i=null!==(i=this.Cn)?i(t,this):xt(this,t,!0);return xh.Va(i)&&(xh.ec(i),""!==this.Jh&&xh.Ka(i,this.Jh,void 0),""!==this.Kh&&xh.Ka(i,this.Kh,void 0),""!==this.ig&&xh.Ka(i,this.ig,[])),i},xh.defineProperty(wt,{Ut:"nodeIsGroupProperty"},function(){return this.qo},function(t){var i=this.qo;i!==t&&(dt(t,wt,"nodeIsGroupProperty"),this.qo=t,this.h("nodeIsGroupProperty",i,t))}),wt.prototype.isGroupForNodeData=wt.prototype.Zz=function(t){if(null===t)return!1;var i=this.qo;return""!==i&&!!xh.sb(t,i)},xh.defineProperty(wt,{Cp:"nodeGroupKeyProperty"},function(){return this.Rg},function(t){var i=this.Rg;i!==t&&(dt(t,wt,"nodeGroupKeyProperty"),this.Rg=t,this.h("nodeGroupKeyProperty",i,t))}),xh.defineProperty(wt,{Pm:"copiesGroupKeyOfNodeData"},function(){return this.uq},function(t){this.uq!==t&&(xh.j(t,"boolean",wt,"copiesGroupKeyOfNodeData"),this.uq=t)}),wt.prototype.getGroupKeyForNodeData=wt.prototype.Xm=function(t){if(null!==t){var i=this.Rg;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("GroupKey value for node data "+t+" is not a number or a string: "+i)}}},wt.prototype.setGroupKeyForNodeData=wt.prototype.Hx=function(t,i){if(null===i&&(i=void 0),void 0===i||yt(i)||xh.Ed(i,"number or string",wt,"setGroupKeyForNodeData:key"),null!==t){var e=this.Rg;if(""!==e)if(this.Ke(t)){var n=xh.sb(t,e);n!==i&&(mt(this,n,t),xh.Ka(t,e,i),null===this.$d(i)&&gt(this,i,t),pt(this,"nodeGroupKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},wt.prototype.copyNodeData=function(t){return null===t?null:(t=nt.prototype.copyNodeData.call(this,t),this.Pm||""===this.Rg||void 0===xh.sb(t,this.Rg)||xh.Ka(t,this.Rg,void 0),t)},wt.prototype.setDataProperty=function(t,i,e){if(this.Ke(t))if(i===this.Hl)this.Ix(t,e);else{if(i===this.gn)return void this.Fx(t,e);if(i===this.Cp)return void this.Hx(t,e);i===this.Ut&&xh.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+i)}else if(this.$g(t)){if(i===this.qp)return void this.Gx(t,e);if(i===this.sp)return void this.Kx(t,e);if(i===this.Mt)return void this.JA(t,e);if(i===this.Ot)return void this.MA(t,e);if(i===this.cj)return void this.vF(t,e);if(i===this.Lt)return void this.uF(t,e);if(i===this.Nt)return void this.wF(t,e)}else!Tl&&t instanceof Mn&&(Tl=!0,xh.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),xh.trace("  Is that really your intent?"));var n=xh.sb(t,i);n!==e&&(xh.Ka(t,i,e),this.wA(t,i,n,e))},(mh=wt.prototype).$t=function(t,i){nt.prototype.$t.call(this,t,i);for(var e=this.uc.i;e.next();)this.EA(e.value,t,i);for(e=this.jo.i;e.next();){var n=e.value,o=t,r=i;if(this.vl(n)===o){h=this.Jh;xh.Ka(n,h,r),pt(this,"linkFromKey",kl,h,n,o,r),"string"==typeof h&&this.Jb(n,h)}this.yl(n)===o&&(h=this.Kh,xh.Ka(n,h,r),pt(this,"linkToKey",kl,h,n,o,r),"string"==typeof h&&this.Jb(n,h));var s=this.dk(n);if(xh.isArray(s))for(var a=xh.Xa(s),h=this.ig,l=0;l<a;l++)xh.Pa(s,l)===o&&(xh.HD(s,l,r),pt(this,"linkLabelKeys",Ml,h,n,o,r))}},mh.EA=function(t,i,e){if(this.Xm(t)===i){var n=this.Rg;xh.Ka(t,n,e),pt(this,"nodeGroupKey",kl,n,t,i,e),"string"==typeof n&&this.Jb(t,n)}},mh.VA=function(){nt.prototype.VA.call(this);for(var t=this.yg,i=xh.Xa(t),e=0;e<i;e++){Mt(this,xh.Pa(t,e))}},mh.Hp=function(t){nt.prototype.Hp.call(this,t);if(null!==(e=bt(this,t=this.ib(t)))){for(var i=new u(Object),e=e.i;e.next();){var n=e.value;if(this.Ke(n)){if(this.Xm(n)===t){s=this.Rg;pt(this,"nodeGroupKey",kl,s,n,t,t),"string"==typeof s&&this.Jb(n,s),i.add(n)}}else{this.vl(n)===t&&(s=this.Jh,pt(this,"linkFromKey",kl,s,n,t,t),"string"==typeof s&&this.Jb(n,s),i.add(n)),this.yl(n)===t&&(s=this.Kh,pt(this,"linkToKey",kl,s,n,t,t),"string"==typeof s&&this.Jb(n,s),i.add(n));var o=this.dk(n);if(xh.isArray(o))for(var r=xh.Xa(o),s=this.ig,a=0;a<r;a++)xh.Pa(o,a)===t&&(pt(this,"linkLabelKeys",Ml,s,n,t,t),i.add(n))}}for(i=i.i;i.next();)mt(this,t,i.value)}},mh.Gp=function(t){nt.prototype.Gp.call(this,t);var i=this.Xm(t);null===this.$d(i)&&gt(this,i,t)},mh.ru=function(t){nt.prototype.ru.call(this,t);mt(this,this.Xm(t),t)},xh.defineProperty(wt,{Lt:"linkCategoryProperty"},function(){return this.lm},function(t){var i=this.lm;i!==t&&(dt(t,wt,"linkCategoryProperty"),this.lm=t,this.h("linkCategoryProperty",i,t))}),wt.prototype.getCategoryForLinkData=wt.prototype.Vw=function(t){if(null===t)return"";var i=this.lm;return""===i?"":void 0===(i=xh.sb(t,i))?"":"string"==typeof i?i:(xh.k("getCategoryForLinkData found a non-string category for "+t+": "+i),"")},wt.prototype.setCategoryForLinkData=wt.prototype.uF=function(t,i){if(xh.j(i,"string",wt,"setCategoryForLinkData:cat"),null!==t){var e=this.lm;if(""!==e)if(this.$g(t)){var n=xh.sb(t,e);void 0===n&&(n=""),n!==i&&(xh.Ka(t,e,i),pt(this,"linkCategory",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.Ja(Pt,nt),xh.ea("TreeModel",Pt),Pt.prototype.cloneProtected=function(t){nt.prototype.cloneProtected.call(this,t),t.Sg=this.Sg,t.vq=this.vq,t.sm=this.sm},Pt.prototype.toString=function(t){if(void 0===t&&(t=0),2<=t)return this.SA();o=(""!==this.name?this.name:"")+" TreeModel";if(0<t){o+="\n node data:",t=this.Yf;for(var i=xh.Xa(t),e=0;e<i;e++)var n=xh.Pa(t,e),o=o+" "+this.ib(n)+":"+Cl(n)}return o},Pt.prototype.qn=function(){var t=nt.prototype.qn.call(this),i="";return"parent"!==this.Dp&&"string"==typeof this.Dp&&(i+=',\n  "nodeParentKeyProperty": '+this.quote(this.Dp)),t+i},Pt.prototype.Yt=function(t){nt.prototype.Yt.call(this,t),t.nodeParentKeyProperty&&(this.Dp=t.nodeParentKeyProperty)},Pt.prototype.en=function(t){return t},xh.defineProperty(Pt,{Dp:"nodeParentKeyProperty"},function(){return this.Sg},function(t){var i=this.Sg;i!==t&&(dt(t,Pt,"nodeParentKeyProperty"),this.Sg=t,this.h("nodeParentKeyProperty",i,t))}),xh.defineProperty(Pt,{Qm:"copiesParentKeyOfNodeData"},function(){return this.vq},function(t){this.vq!==t&&(xh.j(t,"boolean",Pt,"copiesParentKeyOfNodeData"),this.vq=t)}),Pt.prototype.getParentKeyForNodeData=Pt.prototype.Ym=function(t){if(null!==t){var i=this.Sg;if(""!==i&&void 0!==(i=xh.sb(t,i))){if(yt(i))return i;xh.k("ParentKey value for node data "+t+" is not a number or a string: "+i)}}},Pt.prototype.setParentKeyForNodeData=Pt.prototype.rh=function(t,i){if(null===i&&(i=void 0),void 0===i||yt(i)||xh.Ed(i,"number or string",Pt,"setParentKeyForNodeData:key"),null!==t){var e=this.Sg;if(""!==e)if(i=this.en(i),this.Ke(t)){var n=xh.sb(t,e);n!==i&&(mt(this,n,t),xh.Ka(t,e,i),null===this.$d(i)&&gt(this,i,t),pt(this,"nodeParentKey",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},xh.defineProperty(Pt,{oL:"parentLinkCategoryProperty"},function(){return this.sm},function(t){var i=this.sm;i!==t&&(dt(t,Pt,"parentLinkCategoryProperty"),this.sm=t,this.h("parentLinkCategoryProperty",i,t))}),Pt.prototype.getParentLinkCategoryForNodeData=Pt.prototype.LH=function(t){if(null===t)return"";var i=this.sm;return""===i?"":void 0===(i=xh.sb(t,i))?"":"string"==typeof i?i:(xh.k("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+i),"")},Pt.prototype.setParentLinkCategoryForNodeData=Pt.prototype.mJ=function(t,i){if(xh.j(i,"string",Pt,"setParentLinkCategoryForNodeData:cat"),null!==t){var e=this.sm;if(""!==e)if(this.Ke(t)){var n=xh.sb(t,e);void 0===n&&(n=""),n!==i&&(xh.Ka(t,e,i),pt(this,"parentLinkCategory",kl,e,t,n,i),"string"==typeof e&&this.Jb(t,e))}else xh.Ka(t,e,i)}},Pt.prototype.copyNodeData=function(t){return null===t?null:(t=nt.prototype.copyNodeData.call(this,t),this.Qm||""===this.Sg||void 0===xh.sb(t,this.Sg)||xh.Ka(t,this.Sg,void 0),t)},Pt.prototype.setDataProperty=function(t,i,e){if(this.Ke(t))if(i===this.Hl)this.Ix(t,e);else{if(i===this.gn)return void this.Fx(t,e);if(i===this.Dp)return void this.rh(t,e)}else!Tl&&t instanceof Mn&&(Tl=!0,xh.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),xh.trace("  Is that really your intent?"));var n=xh.sb(t,i);n!==e&&(xh.Ka(t,i,e),this.wA(t,i,n,e))},(mh=Pt.prototype).$t=function(t,i){nt.prototype.$t.call(this,t,i);for(var e=this.uc.i;e.next();)this.EA(e.value,t,i)},mh.EA=function(t,i,e){if(this.Ym(t)===i){var n=this.Sg;xh.Ka(t,n,e),pt(this,"nodeParentKey",kl,n,t,i,e),"string"==typeof n&&this.Jb(t,n)}},mh.Hp=function(t){nt.prototype.Hp.call(this,t);if(null!==(e=bt(this,t=this.ib(t)))){for(var i=new u(Object),e=e.i;e.next();){var n=e.value;if(this.Ke(n)&&this.Ym(n)===t){var o=this.Sg;pt(this,"nodeParentKey",kl,o,n,t,t),"string"==typeof o&&this.Jb(n,o),i.add(n)}}for(i=i.i;i.next();)mt(this,t,i.value)}},mh.Gp=function(t){nt.prototype.Gp.call(this,t);var i=this.Ym(t),i=this.en(i);null===this.$d(i)&&gt(this,i,t)},mh.ru=function(t){nt.prototype.ru.call(this,t);mt(this,this.Ym(t),t)},xh.ea("Binding",Tt),Tt.prototype.copy=function(){var t=new Tt;return t.Jo=this.Jo,t.Hs=this.Hs,t.Io=this.Io,t.hw=this.hw,t.ir=this.ir,t.zo=this.zo,t.sq=this.sq,t.Fr=this.Fr,t.lq=this.lq,t};var Sl;Tt.OneWay=Sl=xh.p(Tt,"OneWay",1);var Nl;Tt.TwoWay=Nl=xh.p(Tt,"TwoWay",2),Tt.parseEnum=function(t,i){return xh.j(t,"function",Tt,"parseEnum:ctor"),xh.rb(i,t,Tt,"parseEnum:defval"),function(e){return null===(e=wh(t,e))?i:e}};var Cl;Tt.toString=Cl=function(t){var i=t;return xh.Va(t)&&(t.text?i=t.text:t.name?i=t.name:void 0!==t.key?i=t.key:void 0!==t.id?i=t.id:t.constructor===Object&&(t.Text?i=t.Text:t.Name?i=t.Name:void 0!==t.Key?i=t.Key:void 0!==t.Id?i=t.Id:void 0!==t.ID&&(i=t.ID))),void 0===i?"undefined":null===i?"null":i.toString()},Tt.prototype.toString=function(){return"Binding("+this.Nx+":"+this.AF+(-1!==this.Ol?" "+this.Ol:"")+" "+this.mode.name+")"},Tt.prototype.freeze=function(){return this.D=!0,this},Tt.prototype.Oa=function(){return this.D=!1,this},xh.defineProperty(Tt,{Ol:null},function(){return this.cD},function(t){this.D&&xh.la(this),xh.j(t,"number",Tt,"targetId"),this.cD=t}),xh.defineProperty(Tt,{Nx:"targetProperty"},function(){return this.Jo},function(t){this.D&&xh.la(this),xh.j(t,"string",Tt,"targetProperty"),this.Jo=t}),xh.defineProperty(Tt,{mn:"sourceName"},function(){return this.hw},function(t){this.D&&xh.la(this),null!==t&&xh.j(t,"string",Tt,"sourceName"),this.hw=t,null!==t&&(this.ir=!1)}),xh.defineProperty(Tt,{It:"isToModel"},function(){return this.ir},function(t){this.D&&xh.la(this),xh.j(t,"boolean",Tt,"isToModel"),this.ir=t}),xh.defineProperty(Tt,{AF:"sourceProperty"},function(){return this.zo},function(t){this.D&&xh.la(this),xh.j(t,"string",Tt,"sourceProperty"),this.zo=t}),xh.defineProperty(Tt,{eH:"converter"},function(){return this.sq},function(t){this.D&&xh.la(this),null!==t&&xh.j(t,"function",Tt,"converter"),this.sq=t}),xh.defineProperty(Tt,{RG:"backConverter"},function(){return this.lq},function(t){this.D&&xh.la(this),null!==t&&xh.j(t,"function",Tt,"backConverter"),this.lq=t}),xh.defineProperty(Tt,{mode:"mode"},function(){return this.Fr},function(t){this.D&&xh.la(this),xh.rb(t,Tt,Tt,"mode"),this.Fr=t}),Tt.prototype.makeTwoWay=Tt.prototype.wI=function(t){return void 0===t&&(t=null),null!==t&&xh.j(t,"function",Tt,"makeTwoWay"),this.mode=Nl,this.RG=t,this},Tt.prototype.ofObject=Tt.prototype.px=function(t){return void 0===t&&(t=""),this.mn=t,this.It=!1,this},Tt.prototype.ofModel=function(){return this.mn=null,this.It=!0,this},Tt.prototype.ofData=function(){return this.mn=null,this.It=!1,this},Tt.prototype.updateTarget=Tt.prototype.RF=function(t,i,e){var n=this.zo;if(void 0===e||n===e){e=this.Jo;var o=this.sq;if(null===o&&""===e)xh.trace("Binding error: target property is the empty string: "+this.toString());else{var r=i;if(""!==n&&(r=xh.sb(i,n)),void 0!==r)if(null===o)""!==e&&xh.Ka(t,e,r);else try{if(""!==e){var s=o(r,t);xh.Ka(t,e,s)}else o(r,t)}catch(t){}}}},Tt.prototype.updateSource=Tt.prototype.Ox=function(t,i,e,n){if(void 0===n&&(n=null),this.Fr===Nl){var o=this.Jo;if(void 0===e||o===e){e=this.zo;var r=this.lq;if(null!==r||""!==e){var s=t;if(""!==o&&(s=xh.sb(t,o)),void 0!==s)if(null===r)null!==n&&null!==n.Z?n.Z.setDataProperty(i,e,s):xh.Ka(i,e,s);else try{if(""!==e){var a=r(s,i);null!==n&&null!==n.Z?n.Z.setDataProperty(i,e,a):xh.Ka(i,e,a)}else r(s,i)}catch(t){}}}}},xh.ea("Transaction",Nt),Nt.prototype.toString=function(t){var i="Transaction: "+this.name+" "+this.Of.count.toString()+(this.Dt?"":", incomplete");if(void 0!==t&&0<t){t=this.Of.count;for(var e=0;e<t;e++){var n=this.Of.ha(e);null!==n&&(i+="\n  "+n.toString())}}return i},Nt.prototype.clear=Nt.prototype.clear=function(){var t=this.Of;t.Oa();for(var i=t.count-1;0<=i;i--){var e=t.ha(i);null!==e&&e.clear()}t.clear(),t.freeze()},Nt.prototype.canUndo=Nt.prototype.canUndo=function(){return this.Dt},Nt.prototype.undo=Nt.prototype.undo=function(){if(this.canUndo())for(var t=this.Of.count-1;0<=t;t--){var i=this.Of.ha(t);null!==i&&i.undo()}},Nt.prototype.canRedo=Nt.prototype.canRedo=function(){return this.Dt},Nt.prototype.redo=Nt.prototype.redo=function(){if(this.canRedo())for(var t=this.Of.count,i=0;i<t;i++){var e=this.Of.ha(i);null!==e&&e.redo()}},xh.u(Nt,{Of:"changes"},function(){return this.fG}),xh.defineProperty(Nt,{name:"name"},function(){return this.Qb},function(t){this.Qb=t}),xh.defineProperty(Nt,{Dt:"isComplete"},function(){return this.jC},function(t){this.jC=t}),xh.ea("UndoManager",Ct),Ct.prototype.toString=function(t){for(var i=(i="UndoManager "+this.Zi+"<"+this.history.count+"<="+this.RE)+"[",e=this.WE.count,n=0;n<e;n++)0<n&&(i+=" "),i+=this.WE.ha(n);if(i+="]",void 0!==t&&0<t)for(e=this.history.count,n=0;n<e;n++)i+="\n "+this.history.ha(n).toString(t-1);return i},Ct.prototype.clear=Ct.prototype.clear=function(){var t=this.history;t.Oa();for(var i=t.count-1;0<=i;i--){var e=t.ha(i);null!==e&&e.clear()}t.clear(),this.Lg=-1,t.freeze(),this.xi=!1,this.Yu=null,this.al=0,this.Qg.Oa(),this.Qg.clear(),this.Qg.freeze(),this.po.clear()},Ct.prototype.addModel=Ct.prototype.JG=function(t){this.Xy.add(t)},Ct.prototype.removeModel=Ct.prototype.XI=function(t){this.Xy.remove(t)},Ct.prototype.startTransaction=Ct.prototype.Sb=function(t){if(void 0===t&&(t=""),null===t&&(t=""),this.kb)return!1;!0===this.Fy&&(this.Fy=!1,this.al++,this.$c("StartingFirstTransaction",t,this.Vi),0<this.al&&this.al--),this.isEnabled&&(this.Qg.Oa(),this.Qg.add(t),this.Qg.freeze(),null===this.Vi?this.po.add(0):this.po.add(this.Vi.Of.count)),this.al++;var i=1===this.uh;return i&&this.$c("StartedTransaction",t,this.Vi),i},Ct.prototype.commitTransaction=Ct.prototype.Ad=function(t){return void 0===t&&(t=""),jt(this,!0,t)},Ct.prototype.rollbackTransaction=Ct.prototype.Ip=function(){return jt(this,!1,"")},Ct.prototype.canUndo=Ct.prototype.canUndo=function(){if(!this.isEnabled||0<this.uh||this.kb)return!1;var t=this.LF;return!(null===t||!t.canUndo())},Ct.prototype.undo=Ct.prototype.undo=function(){if(this.canUndo()){var t=this.LF;try{this.$c("StartingUndo","Undo",t),this.xi=!0,this.Lg--,t.undo()}catch(t){xh.trace("undo error: "+t.toString())}finally{this.xi=!1,this.$c("FinishedUndo","Undo",t)}}},Ct.prototype.canRedo=Ct.prototype.canRedo=function(){if(!this.isEnabled||0<this.uh||this.kb)return!1;var t=this.KF;return!(null===t||!t.canRedo())},Ct.prototype.redo=Ct.prototype.redo=function(){if(this.canRedo()){var t=this.KF;try{this.$c("StartingRedo","Redo",t),this.xi=!0,this.Lg++,t.redo()}catch(t){xh.trace("redo error: "+t.toString())}finally{this.xi=!1,this.$c("FinishedRedo","Redo",t)}}},Ct.prototype.$c=function(t,i,e){void 0===e&&(e=null);var n=new et;for(n.xc=wl,n.propertyName=t,n.object=e,n.oldValue=i,t=this.FI;t.next();)i=t.value,n.Z=i,i.Fw(n)},Ct.prototype.handleChanged=Ct.prototype.uE=function(t){if(this.isEnabled&&!this.kb&&!this.skipsEvent(t)){i=this.Vi;null===i&&(this.Yu=i=new Nt);var i,e=t.copy();(i=i.Of).Oa(),i.add(e),i.freeze(),this.Bz&&0>=this.uh&&!this.Fy&&(null!==(t=t.g)&&!1===t.bn||xh.trace("Change not within a transaction: "+e.toString()))}},Ct.prototype.skipsEvent=function(t){if(null===t||0>t.xc.value)return!0;if((t=t.object)instanceof Mn){if(null!==(t=t.layer)&&t.Gc)return!0}else if(t instanceof Yi&&t.Gc)return!0;return!1},xh.u(Ct,{FI:"models"},function(){return this.Xy.i}),xh.defineProperty(Ct,{isEnabled:"isEnabled"},function(){return this.Ue},function(t){this.Ue=t}),xh.u(Ct,{LF:"transactionToUndo"},function(){return 0<=this.Zi&&this.Zi<=this.history.count-1?this.history.ha(this.Zi):null}),xh.u(Ct,{KF:"transactionToRedo"},function(){return this.Zi<this.history.count-1?this.history.ha(this.Zi+1):null}),xh.u(Ct,{kb:"isUndoingRedoing"},function(){return this.xi}),xh.u(Ct,{history:"history"},function(){return this.jG}),xh.defineProperty(Ct,{RE:"maxHistoryLength"},function(){return this.yC},function(t){this.yC=t}),xh.u(Ct,{Zi:"historyIndex"},function(){return this.Lg}),xh.u(Ct,{Vi:"currentTransaction"},function(){return this.Yu}),xh.u(Ct,{uh:"transactionLevel"},function(){return this.al}),xh.u(Ct,{GE:"isInTransaction"},function(){return 0<this.al}),xh.defineProperty(Ct,{Bz:"checksTransactionLevel"},function(){return this.xB},function(t){this.xB=t}),xh.u(Ct,{WE:"nestedTransactionNames"},function(){return this.Qg}),xh.ea("CommandHandler",Lt);var jl=null,Ll="";Lt.prototype.toString=function(){return"CommandHandler"},xh.u(Lt,{g:"diagram"},function(){return this.U}),Lt.prototype.Mc=function(t){this.U=t},Lt.prototype.doKeyDown=function(){var t=this.g;if(null!==t){var i=t.P,e=xh.fk?i.Pt:i.control,n=i.shift,o=i.alt,r=i.key;!e||"C"!==r&&"Insert"!==r?e&&"X"===r||n&&"Del"===r?this.canCutSelection()&&this.cutSelection():e&&"V"===r||n&&"Insert"===r?this.canPasteSelection()&&this.pasteSelection():e&&"Y"===r||o&&n&&"Backspace"===r?this.canRedo()&&this.redo():e&&"Z"===r||o&&"Backspace"===r?this.canUndo()&&this.undo():"Del"===r||"Backspace"===r?this.canDeleteSelection()&&this.deleteSelection():e&&"A"===r?this.canSelectAll()&&this.selectAll():"Esc"===r?this.canStopCommand()&&this.stopCommand():"Up"===r?t.oe&&(e?t.scroll("pixel","up"):t.scroll("line","up")):"Down"===r?t.oe&&(e?t.scroll("pixel","down"):t.scroll("line","down")):"Left"===r?t.ne&&(e?t.scroll("pixel","left"):t.scroll("line","left")):"Right"===r?t.ne&&(e?t.scroll("pixel","right"):t.scroll("line","right")):"PageUp"===r?n&&t.ne?t.scroll("page","left"):t.oe&&t.scroll("page","up"):"PageDown"===r?n&&t.ne?t.scroll("page","right"):t.oe&&t.scroll("page","down"):"Home"===r?e&&t.oe?t.scroll("document","up"):!e&&t.ne&&t.scroll("document","left"):"End"===r?e&&t.oe?t.scroll("document","down"):!e&&t.ne&&t.scroll("document","right"):" "===r?this.canScrollToPart()&&this.scrollToPart():"Subtract"===r?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===r?this.canIncreaseZoom()&&this.increaseZoom():e&&"0"===r?this.canResetZoom()&&this.resetZoom():n&&"Z"===r?this.canZoomToFit()&&this.zoomToFit():e&&!n&&"G"===r?this.canGroupSelection()&&this.groupSelection():e&&n&&"G"===r?this.canUngroupSelection()&&this.ungroupSelection():i.event&&113===i.event.which?this.canEditTextBlock()&&this.editTextBlock():i.event&&93===i.event.which?this.canShowContextMenu()&&this.showContextMenu():i.bubbles=!0:this.canCopySelection()&&this.copySelection()}},Lt.prototype.doKeyUp=function(){var t=this.g;null!==t&&(t.P.bubbles=!0)},Lt.prototype.stopCommand=function(){var t=this.g;if(null!==t){var i=t.Ya;i instanceof Di&&t.pf&&t.Gw(),null!==i&&i.doCancel()}},Lt.prototype.canStopCommand=function(){return!0},Lt.prototype.selectAll=function(){var t=this.g;if(null!==t){t.qa();try{t.Zb="wait",t.Ba("ChangingSelection");for(var i=t.ik;i.next();)i.value.jb=!0;for(var e=t.Ag;e.next();)e.value.jb=!0;for(var n=t.links;n.next();)n.value.jb=!0}finally{t.Ba("ChangedSelection"),t.Zb=""}}},Lt.prototype.canSelectAll=function(){var t=this.g;return null!==t&&t.pf},Lt.prototype.deleteSelection=function(){var t=this.g;if(null!==t&&!t.Ba("SelectionDeleting",t.selection))try{t.Zb="wait",t.Sb("Delete"),t.Ba("ChangingSelection");for(var i=new c(tr),e=t.selection.i;e.next();)Dt(i,e.value,!0,this.qH?1/0:0,this.dE,function(t){return t.canDelete()});t.DA(i,!0),t.Ba("SelectionDeleted",i)}finally{t.Ba("ChangedSelection"),t.Ad("Delete"),t.Zb=""}},Lt.prototype.canDeleteSelection=function(){var t=this.g;return!(null===t||t.bb||t.wf||!t.Hm||0===t.selection.count)},Lt.prototype.Xo=function(t,i,e){var n=new m(tr,tr);for(t=t.i;t.next();)At(this,t.value,i,n,e);if(null!==i){e=i.Z,t=!1,null!==i.cb.Zd&&(t=i.cb.Zd.Xi);for(var o=new c(zr),r=new m(zr,zr),s=n.i;s.next();){a=s.value;if(a instanceof zr){h=a;t||null!==h.V&&null!==h.ba||o.add(h)}else if(e instanceof Pt&&a instanceof wr&&null!==a.data){var a,h=e,l=a,u=(a=s.key).rl();null!==u&&(null!==(u=n.ka(u))?(h.rh(l.data,h.ib(u.data)),h=i.sf(l.data),null!==(a=a.ep())&&null!==h&&r.add(a,h)):h.rh(l.data,void 0))}}if(0<o.count&&i.DA(o,!1),0<r.count)for(e=r.i;e.next();)n.add(e.key,e.value)}if(null!==i&&(i=i.Z,null!==(e=i.LG))){var f=new m;n.each(function(t){null!==t.key.data&&f.add(t.key.data,t.value.data)}),e(f,i,this.g.Z)}for(i=n.i;i.next();)i.value.Jb();return n},Lt.prototype.copySelection=function(){if(null!==(i=this.g)){for(var t=new c(tr),i=i.selection.i;i.next();)Dt(t,i.value,!0,this.iH?1/0:0,this.gH,function(t){return t.canCopy()});this.copyToClipboard(t)}},Lt.prototype.canCopySelection=function(){var t=this.g;return!(null===t||!t.Xj||!t.wz||0===t.selection.count)},Lt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Lt.prototype.canCutSelection=function(){var t=this.g;return!(null===t||t.bb||t.wf||!t.Xj||!t.Hm||!t.wz||0===t.selection.count)},Lt.prototype.copyToClipboard=function(t){var i=this.g;if(null!==i){e=null;if(null===t)jl=null,Ll="";else{var e=i.Z,n=!1,o=!1,r=null;try{if(e instanceof Pt){var s=e,n=s.Qm;s.Qm=this.WD}e instanceof wt&&(s=e,o=s.Pm,s.Pm=this.VD),r=i.Xo(t,null,!0)}finally{e instanceof Pt&&(e.Qm=n),e instanceof wt&&(e.Pm=o),(e=new u(tr)).Tc(r),jl=e,Ll=i.Z.ll}}i.Ba("ClipboardChanged",e)}},Lt.prototype.pasteFromClipboard=function(){var t=new c(tr),i=jl;if(null===i)return t;var e=this.g;if(null===e||Ll!==e.Z.ll)return t;var n=e.Z,o=!1,r=!1,s=null;try{if(n instanceof Pt){var a=n,o=a.Qm;a.Qm=this.WD}n instanceof wt&&(a=n,r=a.Pm,a.Pm=this.VD),s=e.Xo(i,e,!1)}finally{for(n instanceof Pt&&(n.Qm=o),n instanceof wt&&(n.Pm=r),i=s.i;i.next();)e=i.value,n=i.key,e.location.K()||(n.location.K()?e.location=n.location:!e.position.K()&&n.position.K()&&(e.position=n.position)),t.add(e)}return t},Lt.prototype.pasteSelection=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i)try{i.Zb="wait",i.Sb("Paste"),i.Ba("ChangingSelection");var e=this.pasteFromClipboard();0<e.count&&De(i);for(var n=e.i;n.next();)n.value.jb=!0;if(i.Ba("ChangedSelection"),null!==t){var o=i.computePartsBounds(i.selection);if(o){var r=i.cb.Zd;null===r&&(r=new qt).Mc(i);var s=r.computeEffectiveCollection(i.selection);r.moveParts(s,new b(t.x-o.oa,t.y-o.va),!1)}}i.Ba("ClipboardPasted",e)}finally{i.Ad("Paste"),i.Zb=""}},Lt.prototype.canPasteSelection=function(){var t=this.g;return!(null===t||t.bb||t.wf||!t.Po||!t.wz||null===jl||Ll!==t.Z.ll)},Lt.prototype.undo=function(){var t=this.g;null!==t&&t.ma.undo()},Lt.prototype.canUndo=function(){var t=this.g;return null!==t&&!t.bb&&!t.wf&&(t.DD&&t.ma.canUndo())},Lt.prototype.redo=function(){var t=this.g;null!==t&&t.ma.redo()},Lt.prototype.canRedo=function(){var t=this.g;return null!==t&&!t.bb&&!t.wf&&(t.DD&&t.ma.canRedo())},Lt.prototype.decreaseZoom=function(t){void 0===t&&(t=1/this.Qx),xh.Ye(t,Lt,"decreaseZoom:factor");var i=this.g;null!==i&&i.gl===ou&&((t*=i.scale)<i.fh||t>i.eh||(i.scale=t))},Lt.prototype.canDecreaseZoom=function(t){void 0===t&&(t=1/this.Qx),xh.Ye(t,Lt,"canDecreaseZoom:factor");var i=this.g;return null!==i&&i.gl===ou&&(!((t*=i.scale)<i.fh||t>i.eh)&&i.Cw)},Lt.prototype.increaseZoom=function(t){void 0===t&&(t=this.Qx),xh.Ye(t,Lt,"increaseZoom:factor");var i=this.g;null!==i&&i.gl===ou&&((t*=i.scale)<i.fh||t>i.eh||(i.scale=t))},Lt.prototype.canIncreaseZoom=function(t){void 0===t&&(t=this.Qx),xh.Ye(t,Lt,"canIncreaseZoom:factor");var i=this.g;return null!==i&&i.gl===ou&&(!((t*=i.scale)<i.fh||t>i.eh)&&i.Cw)},Lt.prototype.resetZoom=function(t){void 0===t&&(t=this.Lw),xh.Ye(t,Lt,"resetZoom:newscale");var i=this.g;null===i||t<i.fh||t>i.eh||(i.scale=t)},Lt.prototype.canResetZoom=function(t){void 0===t&&(t=this.Lw),xh.Ye(t,Lt,"canResetZoom:newscale");var i=this.g;return!(null===i||t<i.fh||t>i.eh)&&i.Cw},Lt.prototype.zoomToFit=function(){var t=this.g;if(null!==t){var i=t.scale,e=t.position;i===this.sz&&!isNaN(this.Sy)&&t.Bd.L(this.rz)?(t.scale=this.Sy,t.position=this.vC,this.sz=NaN,this.rz=hl.Yx):(this.Sy=i,this.vC=e.copy(),t.zoomToFit(),this.sz=t.scale,this.rz=t.Bd.copy())}},Lt.prototype.canZoomToFit=function(){var t=this.g;return null!==t&&t.Cw},Lt.prototype.scrollToPart=function(t){void 0===t&&(t=null),null!==t&&xh.A(t,tr,Lt,"part");var i=this.g;if(null!==i){if(null===t){try{null!==this.Jj&&(this.Jj.next()?t=this.Jj.value:this.Jj=null)}catch(t){}null===t&&(0<i.Zm.count?this.Jj=i.Zm.i:0<i.selection.count&&(this.Jj=i.selection.i),null!==this.Jj&&this.Jj.next()&&(t=this.Jj.value))}if(null!==t){var e=i.Sa;e.jn("Scroll To Part");var n=i.position.copy();i.UG(t.Y),n.od(i.position)&&e.ci()}}},Lt.prototype.canScrollToPart=function(t){return void 0===t&&(t=null),null!==t&&xh.A(t,tr,Lt,"part"),null!==(t=this.g)&&(0!==t.selection.count||0!==t.Zm.count)&&(t.ne&&t.oe)},Lt.prototype.collapseTree=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i)try{i.Sb("Collapse Tree"),i.Sa.jn("Collapse Tree");var e=new u(wr);if(null!==t&&t.qd)t.collapseTree(),e.add(t);else for(var n=i.selection.i;n.next();){var o=n.value;o instanceof wr&&(t=o).qd&&(t.collapseTree(),e.add(t))}i.Ba("TreeCollapsed",e)}finally{i.Ad("Collapse Tree")}},Lt.prototype.canCollapseTree=function(t){void 0===t&&(t=null);var i=this.g;if(null===i||i.bb)return!1;if(null!==t){if(!t.qd)return!1;if(0<t.Uw().count)return!0}else for(t=i.selection.i;t.next();)if((i=t.value)instanceof wr&&i.qd&&0<i.Uw().count)return!0;return!1},Lt.prototype.expandTree=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i)try{i.Sb("Expand Tree"),i.Sa.jn("Expand Tree");var e=new u(wr);if(null===t||t.qd)for(var n=i.selection.i;n.next();){var o=n.value;o instanceof wr&&((t=o).qd||(t.expandTree(),e.add(t)))}else t.expandTree(),e.add(t);i.Ba("TreeExpanded",e)}finally{i.Ad("Expand Tree")}},Lt.prototype.canExpandTree=function(t){void 0===t&&(t=null);var i=this.g;if(null===i||i.bb)return!1;if(null!==t){if(t.qd)return!1;if(0<t.Uw().count)return!0}else for(t=i.selection.i;t.next();)if((i=t.value)instanceof wr&&!i.qd&&0<i.Uw().count)return!0;return!1},Lt.prototype.groupSelection=function(){var t=this.g;if(null!==t){var i=t.Z;if(i instanceof wt){var e=this.ED;if(null!==e){var n=null;try{t.Zb="wait",t.Sb("Group"),t.Ba("ChangingSelection");for(var o=new u(tr),r=t.selection.i;r.next();){var s=r.value;s.Pd()&&s.canGroup()&&o.add(s)}for(var a=new u(tr),h=o.i;h.next();){for(var l=h.value,r=!1,f=o.i;f.next();)if(l.ai(f.value)){r=!0;break}r||a.add(l)}if(0<a.count){var c=a.first().Ta;if(null!==c)for(;null!==c;){for(var o=!1,p=a.i;p.next();)if(!p.value.ai(c)){o=!0;break}if(!o)break;c=c.Ta}if(e instanceof vs)bo(e),null!==(n=e.copy())&&t.add(n);else if(i.Zz(e)){var d=i.copyNodeData(e);xh.Va(d)&&(i.cl(d),n=t.Tw(d))}if(null!==n){null!==c&&this.isValidMember(c,n)&&(n.Ta=c);for(var y=a.i;y.next();){var v=y.value;this.isValidMember(n,v)&&(v.Ta=n)}t.select(n)}}t.Ba("ChangedSelection"),t.Ba("SelectionGrouped",n)}finally{t.Ad("Group"),t.Zb=""}}}}},Lt.prototype.canGroupSelection=function(){var t=this.g;if(null===t||t.bb||t.wf||!t.Po||!t.xw||!(t.Z instanceof wt)||null===this.ED)return!1;for(t=t.selection.i;t.next();){var i=t.value;if(i.Pd()&&i.canGroup())return!0}return!1},Lt.prototype.isValidMember=function(t,i){if(null===i||t===i||i instanceof zr)return!1;if(null!==t){if(t===i||t.ai(i))return!1;var e=t.iA;if(null!==e&&!e(t,i)||null===t.data&&null!==i.data||null!==t.data&&null===i.data)return!1}return null===(e=this.iA)||e(t,i)},Lt.prototype.ungroupSelection=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i){var e=i.Z;if(e instanceof wt)try{i.Zb="wait",i.Sb("Ungroup"),i.Ba("ChangingSelection");var n=new u(vs);if(null!==t)n.add(t);else for(var o=i.selection.i;o.next();){var r=o.value;r instanceof vs&&(t=r).canUngroup()&&n.add(t)}if(0<n.count){i.Gw();for(var s=n.i;s.next();){var a=s.value;a.expandSubGraph();var h=a.Ta,l=null!==h&&null!==h.data?e.ib(h.data):void 0,f=new u(tr);f.Tc(a.Ic);for(var c=f.i;c.next();){var p=c.value;if(p.jb=!0,!(p instanceof zr)){var d=p.data;null!==d?e.Hx(d,l):p.Ta=h}}i.remove(a)}}i.Ba("ChangedSelection"),i.Ba("SelectionUngrouped",n,f)}finally{i.Ad("Ungroup"),i.Zb=""}}},Lt.prototype.canUngroupSelection=function(t){void 0===t&&(t=null);var i=this.g;if(null===i||i.bb||i.wf||!i.Hm||!i.Bw||!(i.Z instanceof wt))return!1;if(null!==t){if(t.canUngroup())return!0}else for(t=i.selection.i;t.next();)if((i=t.value)instanceof vs&&i.canUngroup())return!0;return!1},Lt.prototype.addTopLevelParts=function(t,i){for(var e=!0,n=Ft(t).i;n.next();){var o=n.value;null!==o.Ta&&(!i||this.isValidMember(null,o)?o.Ta=null:e=!1)}return e},Lt.prototype.collapseSubGraph=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i)try{i.Sb("Collapse SubGraph"),i.Sa.jn("Collapse SubGraph");var e=new u(vs);if(null!==t&&t.ee)t.collapseSubGraph(),e.add(t);else for(var n=i.selection.i;n.next();){var o=n.value;o instanceof vs&&(t=o).ee&&(t.collapseSubGraph(),e.add(t))}i.Ba("SubGraphCollapsed",e)}finally{i.Ad("Collapse SubGraph")}},Lt.prototype.canCollapseSubGraph=function(t){void 0===t&&(t=null);var i=this.g;if(null===i||i.bb)return!1;if(null!==t)return!!t.ee;for(t=i.selection.i;t.next();)if((i=t.value)instanceof vs&&i.ee)return!0;return!1},Lt.prototype.expandSubGraph=function(t){void 0===t&&(t=null);var i=this.g;if(null!==i)try{i.Sb("Expand SubGraph"),i.Sa.jn("Expand SubGraph");var e=new u(vs);if(null===t||t.ee)for(var n=i.selection.i;n.next();){var o=n.value;o instanceof vs&&((t=o).ee||(t.expandSubGraph(),e.add(t)))}else t.expandSubGraph(),e.add(t);i.Ba("SubGraphExpanded",e)}finally{i.Ad("Expand SubGraph")}},Lt.prototype.canExpandSubGraph=function(t){void 0===t&&(t=null);var i=this.g;if(null===i||i.bb)return!1;if(null!==t)return!t.ee;for(t=i.selection.i;t.next();)if((i=t.value)instanceof vs&&!i.ee)return!0;return!1},Lt.prototype.editTextBlock=function(t){void 0===t&&(t=null),null!==t&&xh.A(t,zo,Lt,"editTextBlock");var i=this.g;if(null!==i){var e=i.cb.QA;if(null!==e){if(null===t){t=null;for(var n=i.selection.i;n.next();){var o=n.value;if(o.canEdit()){t=o;break}}if(null===t)return;t=t.mt(function(t){return t instanceof zo&&t.Lz})}null!==t&&(i.Ya=null,e.Be=t,i.Ya=e)}}},Lt.prototype.canEditTextBlock=function(t){void 0===t&&(t=null),null!==t&&xh.A(t,zo,Lt,"canEditTextBlock");var i=this.g;if(null===i||i.bb||i.wf||!i.Aw||null===i.cb.QA)return!1;if(null!==t){if(null!==(t=t.aa)&&t.canEdit())return!0}else for(i=i.selection.i;i.next();)if((t=i.value).canEdit()&&null!==(t=t.mt(function(t){return t instanceof zo&&t.Lz})))return!0;return!1},Lt.prototype.showContextMenu=function(t){var i=this.g;if(null!==i){var e=i.cb.Ez;if(null!==e&&(void 0===t&&(t=0<i.selection.count?i.selection.first():i),null!==(t=e.findObjectWithContextMenu(t)))){var n=new tt,o=null;t instanceof Mn?o=t.Za(zh):i.hI||(o=i.tb,o=new b(o.x+o.width/2,o.y+o.height/2)),null!==o&&(n.g=i,n.lf=i.MF(o),n.da=o,n.left=!1,n.right=!0,n.up=!0,i.P=n),i.Ya=e,Si(e,!1,t)}}},Lt.prototype.canShowContextMenu=function(t){var i=this.g;if(null===i)return!1;var e=i.cb.Ez;return null!==e&&(void 0===t&&(t=0<i.selection.count?i.selection.first():i),null!==e.findObjectWithContextMenu(t))},xh.defineProperty(Lt,{fH:"copiesClipboardData"},function(){return this.AB},function(t){xh.j(t,"boolean",Lt,"copiesClipboardData"),this.AB=t}),xh.defineProperty(Lt,{gH:"copiesConnectedLinks"},function(){return this.BB},function(t){xh.j(t,"boolean",Lt,"copiesConnectedLinks"),this.BB=t}),xh.defineProperty(Lt,{dE:"deletesConnectedLinks"},function(){return this.RB},function(t){xh.j(t,"boolean",Lt,"deletesConnectedLinks"),this.RB=t}),xh.defineProperty(Lt,{iH:"copiesTree"},function(){return this.FB},function(t){xh.j(t,"boolean",Lt,"copiesTree"),this.FB=t}),xh.defineProperty(Lt,{qH:"deletesTree"},function(){return this.SB},function(t){xh.j(t,"boolean",Lt,"deletesTree"),this.SB=t}),xh.defineProperty(Lt,{WD:"copiesParentKey"},function(){return this.EB},function(t){xh.j(t,"boolean",Lt,"copiesParentKey"),this.EB=t}),xh.defineProperty(Lt,{VD:"copiesGroupKey"},function(){return this.DB},function(t){xh.j(t,"boolean",Lt,"copiesGroupKey"),this.DB=t}),xh.defineProperty(Lt,{ED:"archetypeGroupData"},function(){return this.qB},function(t){null!==t&&xh.A(t,Object,Lt,"archetypeGroupData");var i=this.g;null!==i&&(i=i.Z)instanceof wt&&(t instanceof vs||i.Zz(t)||xh.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+t)),this.qB=t}),xh.defineProperty(Lt,{iA:"memberValidation"},function(){return this.Tk},function(t){null!==t&&xh.j(t,"function",Lt,"memberValidation"),this.Tk=t}),xh.defineProperty(Lt,{Lw:"defaultScale"},function(){return this.PB},function(t){xh.Ye(t,Lt,"defaultScale"),0<t||xh.k("defaultScale must be larger than zero, not: "+t),this.PB=t}),xh.defineProperty(Lt,{Qx:"zoomFactor"},function(){return this.vD},function(t){xh.Ye(t,Lt,"zoomFactor"),1<t||xh.k("zoomFactor must be larger than 1.0, not: "+t),this.vD=t}),xh.ea("Tool",zt),zt.prototype.Mc=function(t){this.U=t},zt.prototype.toString=function(){return""!==this.name?this.name+" Tool":xh.df(Object.getPrototypeOf(this))},zt.prototype.updateAdornments=function(){},zt.prototype.canStart=function(){return this.isEnabled},zt.prototype.doStart=function(){},zt.prototype.doActivate=function(){this.ra=!0},zt.prototype.doDeactivate=function(){this.ra=!1},zt.prototype.doStop=function(){},zt.prototype.doCancel=function(){this.stopTool()},zt.prototype.stopTool=function(){var t=this.g;null!==t&&t.Ya===this&&(t.Ya=null,t.Zb="")},zt.prototype.doMouseDown=function(){!this.ra&&this.canStart()&&this.doActivate()},zt.prototype.doMouseMove=function(){},zt.prototype.doMouseUp=function(){this.stopTool()},zt.prototype.doMouseWheel=function(){},zt.prototype.canStartMultiTouch=function(){return!0},zt.prototype.standardPinchZoomStart=function(){var t=this.g;if(null!==t){var i=t.P.event,e=null,n=null;if(void 0!==i.targetTouches){if(2>i.targetTouches.length)return;e=i.targetTouches[0],n=i.targetTouches[1]}else{if(null===t.Kf[0])return;e=t.Kf[0],n=t.Kf[1]}if(this.doCancel(),t.hp("hasGestureZoom")){t.Gy=!0,t.HC=t.scale;var o=Se(t),r=(s=e).clientX-o.x,e=s.clientY-o.y,n=(s=n).clientX-o.x,s=s.clientY-o.y;xh.v(o),o=n-r,e=s-e,o=Math.sqrt(o*o+e*e),t.$C=o,i.preventDefault(),i.cancelBubble=!0}}},zt.prototype.standardPinchZoomMove=function(){var t=this.g;if(null!==t){var i=t.P.event;this.doCancel();var e=null,n=null;if(void 0!==i.targetTouches){if(2>i.targetTouches.length)return;e=i.targetTouches[0],n=i.targetTouches[1]}else{if(null===t.Kf[0])return;e=t.Kf[0],n=t.Kf[1]}if(t.hp("hasGestureZoom")&&t.Gy){var o=Se(t),e=(s=e).clientX-o.x,r=s.clientY-o.y,n=(s=n).clientX-o.x,s=s.clientY-o.y;xh.v(o);var o=n-e,a=s-r,o=Math.sqrt(o*o+a*a)/t.$C,e=new b((Math.min(n,e)+Math.max(n,e))/2,(Math.min(s,r)+Math.max(s,r))/2),r=t.HC*o,n=t.ob;r!==t.scale&&n.canResetZoom(r)&&(o=t.Sl,t.Sl=e,n.resetZoom(r),t.Sl=o),i.preventDefault(),i.cancelBubble=!0}}},zt.prototype.doKeyDown=function(){var t=this.g;null!==t&&"Esc"===t.P.key&&this.doCancel()},zt.prototype.doKeyUp=function(){},zt.prototype.startTransaction=zt.prototype.Sb=function(t){void 0===t&&(t=this.name),this.Cf=null;var i=this.g;return null!==i&&i.Sb(t)},zt.prototype.stopTransaction=zt.prototype.kk=function(){var t=this.g;return null!==t&&(null===this.Cf?t.Ip():t.Ad(this.Cf))},zt.prototype.standardMouseSelect=function(){var t=this.g;if(null!==t&&t.pf){var i=t.P,e=t.rt(i.da,!1);if(null!==e){if(xh.fk?i.Pt:i.control){for(t.Ba("ChangingSelection"),i=e;null!==i&&!i.canSelect();)i=i.Ta;null!==i&&(i.jb=!i.jb),t.Ba("ChangedSelection")}else if(i.shift){if(!e.jb){for(t.Ba("ChangingSelection"),i=e;null!==i&&!i.canSelect();)i=i.Ta;null!==i&&(i.jb=!0),t.Ba("ChangedSelection")}}else if(!e.jb){for(i=e;null!==i&&!i.canSelect();)i=i.Ta;null!==i&&t.select(i)}}else!i.left||(xh.fk?i.Pt:i.control)||i.shift||t.Gw()}},zt.prototype.standardMouseClick=function(t,i){void 0===t&&(t=null),void 0===i&&(i=function(t){return!t.layer.Gc});var e=this.g;if(null===e)return!1;var n=e.P,o=e.re(n.da,t,i);return n.ye=o,Ot(o,n,e),n.zc},zt.prototype.standardMouseOver=function(){var t=this.g;if(null!==t){var i=t.P;if(null!==i.g&&!0!==t.Sa.vc){var e=t.wb;t.wb=!0;var n=t.re(i.da,null,null);i.ye=n;var o=!1;if(n!==t.En){var r=t.En,s=r;for(t.En=n,this.doCurrentObjectChanged(r,n),i.zc=!1;null!==r;){var a=r.Rt;if(null!==a){if(n===r)break;if(null!==n&&n.Cl(r))break;if(a(i,r,n),o=!0,i.zc)break}r=r.T}for(r=s,i.zc=!1;null!==n;){if(null!==(a=n.Qt)){if(r===n)break;if(null!==r&&r.Cl(n))break;if(a(i,n,r),o=!0,i.zc)break}n=n.T}n=t.En}if(null!==n){for(r=n,a="";null!==r&&""===(a=r.cursor);)r=r.T;for(t.Zb=a,i.zc=!1,r=n;null!==r&&(null===(a=r.mA)||(a(i,r),o=!0,!i.zc));)r=r.T}else t.Zb="",null!==(a=t.mA)&&(a(i),o=!0);o&&t.Re(),t.wb=e}}},zt.prototype.doCurrentObjectChanged=function(){},zt.prototype.standardMouseWheel=function(){var t=this.g;if(null!==t){var i=t.P,e=i.nl;if(0!==e&&t.Bd.K()){n=t.ob;if(((o=t.cb.St)===_l&&!i.shift||o===$l&&i.control)&&(0<e?n.canIncreaseZoom():n.canDecreaseZoom()))o=t.Sl,t.Sl=i.lf,0<e?n.increaseZoom():n.decreaseZoom(),t.Sl=o,i.bubbles=!1;else if(o===_l&&i.shift||o===$l&&!i.control){var n=t.position.copy(),o=0<e?e:-e,r=i.event.deltaX,s=i.event.deltaY;void 0===r||void 0===s||0===r&&0===s?!i.shift&&t.oe?(r=t.eu,o=o/40*r,0<e?t.scroll("pixel","up",o):t.scroll("pixel","down",o)):i.shift&&t.ne&&(r=t.du,o=o/40*r,0<e?t.scroll("pixel","left",o):t.scroll("pixel","right",o)):(0!==r&&t.ne&&(0<r?t.scroll("pixel","left",-r):t.scroll("pixel","right",r)),0!==s&&t.oe&&(0<s?t.scroll("pixel","up",-s):t.scroll("pixel","down",s))),t.position.L(n)||(i.bubbles=!1)}}}},zt.prototype.standardWaitAfter=function(t,i){xh.j(t,"number",zt,"standardWaitAfter:delay"),this.cancelWaitAfter();var e=this,n=i.copy();this.tw=xh.setTimeout(function(){e.doWaitAfter(n)},t)},zt.prototype.cancelWaitAfter=function(){-1!==this.tw&&xh.clearTimeout(this.tw),this.tw=-1},zt.prototype.doWaitAfter=function(){},zt.prototype.findToolHandleAt=function(t,i){var e=this.g;return null===e?null:null===(e=e.re(t,function(t){for(;null!==t&&!(t.T instanceof xr);)t=t.T;return t}))?null:e.T.Fc===i?e:null},zt.prototype.isBeyondDragSize=function(t,i){var e=this.g;if(null===e)return!1;void 0===t&&(t=e.yc.lf),void 0===i&&(i=e.P.lf);var n=(o=e.cb.wH).width,o=o.height;return e.yc.aj&&(n+=6,o+=6),Math.abs(i.x-t.x)>n||Math.abs(i.y-t.y)>o},xh.u(zt,{g:"diagram"},function(){return this.U}),xh.defineProperty(zt,{name:"name"},function(){return this.Qb},function(t){xh.j(t,"string",zt,"name"),this.Qb=t}),xh.defineProperty(zt,{isEnabled:"isEnabled"},function(){return this.Ue},function(t){xh.j(t,"boolean",zt,"isEnabled"),this.Ue=t}),xh.defineProperty(zt,{ra:"isActive"},function(){return this.hC},function(t){xh.j(t,"boolean",zt,"isActive"),this.hC=t}),xh.defineProperty(zt,{Cf:"transactionResult"},function(){return this.rD},function(t){null!==t&&xh.j(t,"string",zt,"transactionResult"),this.rD=t}),xh.Ja(qt,zt),xh.ea("DraggingTool",qt),xh.defineProperty(qt,{DE:"isCopyEnabled"},function(){return this.lC},function(t){xh.j(t,"boolean",qt,"isCopyEnabled"),this.lC=t}),xh.defineProperty(qt,{hH:"copiesEffectiveCollection"},function(){return this.CB},function(t){xh.j(t,"boolean",qt,"copiesEffectiveCollection"),this.CB=t}),xh.defineProperty(qt,{xH:"dragsTree"},function(){return this.YB},function(t){xh.j(t,"boolean",qt,"dragsTree"),this.YB=t}),xh.defineProperty(qt,{bx:"isGridSnapEnabled"},function(){return this.cr},function(t){xh.j(t,"boolean",qt,"isGridSnapEnabled"),this.cr=t}),xh.defineProperty(qt,{bI:"isComplexRoutingRealtime"},function(){return this.kC},function(t){xh.j(t,"boolean",qt,"isComplexRoutingRealtime"),this.kC=t}),xh.defineProperty(qt,{dI:"isGridSnapRealtime"},function(){return this.pC},function(t){xh.j(t,"boolean",qt,"isGridSnapRealtime"),this.pC=t}),xh.defineProperty(qt,{tE:"gridSnapCellSize"},function(){return this.Hy},function(t){xh.A(t,k,qt,"gridSnapCellSize"),this.Hy.L(t)||(this.Hy=t=t.S())}),xh.defineProperty(qt,{NH:"gridSnapCellSpot"},function(){return this.Iy},function(t){xh.A(t,D,qt,"gridSnapCellSpot"),this.Iy.L(t)||(this.Iy=t=t.S())}),xh.defineProperty(qt,{OH:"gridSnapOrigin"},function(){return this.Jy},function(t){xh.A(t,b,qt,"gridSnapOrigin"),this.Jy.L(t)||(this.Jy=t=t.S())}),xh.defineProperty(qt,{Xi:"dragsLink"},function(){return this.XB},function(t){xh.j(t,"boolean",qt,"dragsLink"),this.XB=t}),xh.defineProperty(qt,{Tm:"currentPart"},function(){return this.JB},function(t){null!==t&&xh.A(t,tr,qt,"currentPart"),this.JB=t}),xh.defineProperty(qt,{hc:"copiedParts"},function(){return this.zB},function(t){this.zB=t}),xh.defineProperty(qt,{ac:"draggedParts"},function(){return this.WB},function(t){this.WB=t}),xh.u(qt,{AK:"draggingParts"},function(){return null!==this.hc?this.hc.fj():null!==this.ac?this.ac.fj():this.iG}),xh.defineProperty(qt,{ad:"draggedLink"},function(){return this.VB},function(t){null!==t&&xh.A(t,zr,qt,"draggedLink"),this.VB=t}),xh.defineProperty(qt,{ax:"isDragOutStarted"},function(){return this.nC},function(t){this.nC=t}),xh.defineProperty(qt,{jk:"startPoint"},function(){return this.iw},function(t){xh.A(t,b,qt,"startPoint"),this.iw.L(t)||(this.iw=t=t.S())}),xh.defineProperty(qt,{$D:"delay"},function(){return this.Nn},function(t){xh.j(t,"number",qt,"delay"),this.Nn=t}),qt.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t||t.bb&&!t.$s||!t.fl&&!t.Xj&&!t.$s||!t.pf)return!1;var i=t.P;return!(!i.left||t.Ya!==this&&(!this.isBeyondDragSize()||i.aj&&i.timestamp-t.yc.timestamp<this.Nn))&&null!==this.findDraggablePart()},qt.prototype.findDraggablePart=function(){var t=this.g;if(null===t)return null;if(null===(t=t.rt(t.yc.da,!1)))return null;for(;null!==t&&!t.canSelect();)t=t.Ta;return null!==t&&(t.canMove()||t.canCopy())?t:null},qt.prototype.standardMouseSelect=function(){var t=this.g;if(null!==t&&t.pf){var i=t.rt(t.yc.da,!1);if(null!==i){for(;null!==i&&!i.canSelect();)i=i.Ta;this.Tm=i,this.Tm.jb||(t.Ba("ChangingSelection"),i=t.P,(xh.fk?i.Pt:i.control)||i.shift||De(t),this.Tm.jb=!0,t.Ba("ChangedSelection"))}}},qt.prototype.doActivate=function(){var t=this.g;if(null!==t){null===this.Tm&&this.standardMouseSelect();var i=this.Tm;null!==i&&(i.canMove()||i.canCopy())&&(this.ra=!0,this.Co.set(t.position),Bt(this,t.selection),this.mj.length=0,this.ac=this.computeEffectiveCollection(t.selection),t.mu=!0,Vt(this,this.ac),this.Sb("Drag"),this.jk=t.yc.da,t.Pe=!0,t.$s&&(this.ax=!0,this.Mq=!1,Al=this,Fl=this.g,this.doSimulatedDragOut()))}},qt.prototype.computeEffectiveCollection=function(t){var i=null!==this.g&&this.g.Ya===this,e=new m(tr);if(null===t)return e;for(var n=t.i;n.next();)It(this,e,n.value,i);if(null!==this.ad&&this.Xi)return e;for(n=t.i;n.next();)(t=n.value)instanceof zr&&(null===(i=t.V)||e.contains(i)?null===(i=t.ba)||e.contains(i)||e.remove(t):e.remove(t));return e},qt.prototype.doDeactivate=function(){this.ra=!1;var t=this.g;if(null!==t&&cn(t),Rt(this),Ht(this,this.ac),this.ac=this.Tm=null,this.Mq=this.ax=!1,0<Dl.count){for(var i=Dl.length,e=0;e<i;e++){var n=Dl.ha(e);Yt(n),Jt(n),Rt(n),null!==n.g&&cn(n.g)}Dl.clear()}Yt(this),this.Co.m(NaN,NaN),Al=Fl=null,Jt(this),t.Pe=!1,t.Zb="",t.mu=!1,this.kk()},qt.prototype.doCancel=function(){Jt(this),Qt(this);var t=this.g;null!==t&&this.Co.K()&&(t.position=this.Co),this.stopTool()},qt.prototype.doKeyDown=function(){var t=this.g;null!==t&&null!==(t=t.P)&&this.ra&&("Esc"===t.key?this.doCancel():this.doMouseMove())},qt.prototype.doKeyUp=function(){var t=this.g;null!==t&&null!==t.P&&this.ra&&this.doMouseMove()},qt.prototype.moveParts=function(t,i,e){if(null!==t&&(xh.A(t,m,qt,"moveParts:parts"),0!==t.count)){var n=xh.M(),o=xh.M();o.assign(i),isNaN(o.x)&&(o.x=0),isNaN(o.y)&&(o.y=0),(i=this.lw)||Vt(this,t);for(var r=new u(si),s=new u(v),a=t.i;a.next();){var h=a.key;if(h.Pd()){var l=Xt(this,h,t);if(null!==l)r.add(new si(h,a.value,l));else if(!e||h.canMove()){l=a.value.point,n.assign(l);var f=xh.M(),c=this.computeMove(h,n.add(o),t,f);h.location=c,a.value.xF=f.ou(l),xh.v(f)}}else a.key instanceof zr&&s.add(a.fb)}for(e=r.i;e.next();)r=e.value,l=r.info.point,n.assign(l),r.Jc.location=n.add(r.PH.xF);for(e=xh.M(),l=xh.M(),s=s.i;s.next();)a=s.value,(r=a.key)instanceof zr&&(r.Sp?(h=r.V,f=r.ba,null!==this.ad&&this.Xi?(a=a.value.point,t.add(r,Et(o)),h=o.x-a.x,a=o.y-a.y,r.Gl(h,a)):(null!==h&&(e.assign(h.location),null!==(c=t.ka(h))&&e.ou(c.point)),null!==f&&(l.assign(f.location),null!==(c=t.ka(f))&&l.ou(c.point)),null!==h&&null!==f?e.od(l)?(a=a.value.point,(h=n).assign(e),h.ou(a),t.add(r,Et(e)),r.Gl(h.x,h.y)):(r.Sp=!1,r.jc()):(a=a.value.point,f=null!==h?e:null!==f?l:o,t.add(r,Et(f)),h=f.x-a.x,a=f.y-a.y,r.Gl(h,a)))):null!==r.V&&null!==r.ba||(a=a.value.point,t.add(r,Et(o)),h=o.x-a.x,a=o.y-a.y,r.Gl(h,a)));xh.v(n),xh.v(o),xh.v(e),xh.v(l),i||Ht(this,t)}},qt.prototype.computeMove=function(t,i,e,n){if(void 0===n&&(n=new b),n.assign(i),null===t)return n;void 0===e&&(e=null);var o=i;if(this.bx&&(this.dI||null===e||this.g.P.up)&&(o=xh.M(),(e=o).assign(i),null!==t)){if(null!==(s=this.g)){var r=s.xt,s=(a=this.tE).width,a=a.height,h=(l=this.OH).x,l=l.y,u=this.NH;if(null!==r){var f=r.Ww;isNaN(s)&&(s=f.width),isNaN(a)&&(a=f.height),r=r.sE,isNaN(h)&&(h=r.x),isNaN(l)&&(l=r.y)}(r=xh.Ob(0,0)).ku(0,0,s,a,u),hl.pt(i.x,i.y,h+r.x,l+r.y,s,a,e),xh.v(r)}}return e=null!==t.eE?t.eE(t,i,o):o,a=t.EI,s=a.x,isNaN(s)&&(s=t.location.x),a=a.y,isNaN(a)&&(a=t.location.y),r=t.zI,h=r.x,isNaN(h)&&(h=t.location.x),r=r.y,isNaN(r)&&(r=t.location.y),n.m(Math.max(s,Math.min(e.x,h)),Math.max(a,Math.min(e.y,r))),o!==i&&xh.v(o),n},qt.prototype.doDragOver=function(){},qt.prototype.doDropOnto=function(){},qt.prototype.doMouseMove=function(){if(this.ra){var t=this.g;if(null!==t&&null!==this.Tm&&null!==this.ac){var i=!1,e=!1;this.mayCopy()?(i=!0,t.Zb="copy",Ut(this,!1),Vt(this,this.hc),Wt(this,this.hc,!1),Ht(this,this.hc)):this.mayMove()?(e=!0,t.Zb="default",Jt(this),Wt(this,this.ac,!0)):this.mayDragOut()?(t.Zb="no-drop",Ut(this,!1),Wt(this,this.hc,!1)):Jt(this),$t(this,t.P.da,e,i)}}},qt.prototype.doMouseUp=function(){if(this.ra){var t=this.g;if(null!==t){var i=!1,e=this.mayCopy();if(e&&null!==this.hc?(Jt(this),Ut(this,!0),Vt(this,this.hc),Wt(this,this.hc,!1),Ht(this,this.hc),null!==this.hc&&t.sF(this.hc.fj())):(i=!0,Jt(this),this.mayMove()&&(Wt(this,this.ac,!0),$t(this,t.P.da,!0,!1))),this.Mq=!0,ni(this,t.P.da),this.ra){if(this.hc=null,i&&null!==this.ac)for(i=this.ac.i;i.next();){var n=i.key;n instanceof wr&&(null===(n=n.Ta)||null===n.placeholder||this.ac.contains(n)||n.SD&&n.Q())}t.pc(),Ht(this,this.ac),this.Cf=e?"Copy":"Move",t.Ba(e?"SelectionCopied":"SelectionMoved",t.selection)}this.stopTool()}}},qt.prototype.mayCopy=function(){if(!this.DE)return!1;var t=this.g;if(null===t||t.bb||t.wf||!t.Po||!t.Xj||(xh.fk?!t.P.alt:!t.P.control))return!1;for(t=t.selection.i;t.next();){var i=t.value;if(i.Pd()&&i.canCopy())return!0}return!(null===this.ad||!this.Xi||!this.ad.canCopy())},qt.prototype.mayDragOut=function(){if(!this.DE)return!1;var t=this.g;if(null===t||!t.$s||!t.Xj||t.fl)return!1;for(t=t.selection.i;t.next();){var i=t.value;if(i.Pd()&&i.canCopy())return!0}return!(null===this.ad||!this.Xi||!this.ad.canCopy())},qt.prototype.mayMove=function(){var t=this.g;if(null===t||t.bb||!t.fl)return!1;for(t=t.selection.i;t.next();){var i=t.value;if(i.Pd()&&i.canMove())return!0}return!(null===this.ad||!this.Xi||!this.ad.canMove())};var Dl=new u(qt),Al=null,Fl=null;qt.prototype.mayDragIn=function(){var t=this.g;if(null===t||!t.CD||t.bb||t.wf||!t.Po)return!1;var i=Al;return null!==i&&i.g.Z.ll===t.Z.ll},qt.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var t=this.g;t.Sa.ci(),ye(t),null!==(t=Al)&&(t.g.Zb="copy")}},qt.prototype.doSimulatedDragLeave=function(){var t=Al;null!==t&&t.doSimulatedDragOut(),this.doCancel()},qt.prototype.doSimulatedDragOver=function(){var t=this.g;if(null!==t){var i=Al;null!==i&&null!==i.ac&&this.mayDragIn()&&(t.Zb="copy",oi(this,i.ac.fj(),!1),Wt(this,this.hc,!1),$t(this,t.P.da,!1,!0))}},qt.prototype.doSimulatedDrop=function(){var t=this.g;if(null!==t){var i=Al;if(null!==i){var e=i.g;i.Mq=!0,Jt(this),this.mayDragIn()&&(this.Sb("Drop"),oi(this,i.ac.fj(),!0),Wt(this,this.hc,!1),null!==this.hc&&t.sF(this.hc.fj()),ni(this,t.P.da),t.pc(),i=t.selection,null!==this.hc?this.Cf="ExternalCopy":i=new c(tr),this.hc=null,t.focus(),t.Ba("ExternalObjectsDropped",i,e),this.kk())}}},qt.prototype.doSimulatedDragOut=function(){var t=this.g;null!==t&&(this.mayCopy()||this.mayMove()?t.Zb="":t.Zb="no-drop")},xh.ea("DraggingInfo",ri),xh.Ja(ai,zt),xh.ea("LinkingBaseTool",ai),ai.prototype.doStop=function(){var t=this.g;null!==t&&cn(t),this.mh=this.lh=this.kh=this.jh=this.qc=null,this.Px.clear(),this.$f=null},xh.defineProperty(ai,{ZE:"portGravity"},function(){return this.RC},function(t){xh.j(t,"number",ai,"portGravity"),0<=t&&(this.RC=t)}),xh.defineProperty(ai,{op:"isUnconnectedLinkValid"},function(){return this.tC},function(t){xh.j(t,"boolean",ai,"isUnconnectedLinkValid"),this.tC=t}),xh.defineProperty(ai,{Fg:"temporaryLink"},function(){return this.jD},function(t){xh.A(t,zr,ai,"temporaryLink"),this.jD=t}),xh.defineProperty(ai,{ze:"temporaryFromNode"},function(){return this.hD},function(t){xh.A(t,wr,ai,"temporaryFromNode"),this.hD=t}),xh.defineProperty(ai,{nn:"temporaryFromPort"},function(){return this.iD},function(t){xh.A(t,Mn,ai,"temporaryFromPort"),this.iD=t}),xh.defineProperty(ai,{Ae:"temporaryToNode"},function(){return this.kD},function(t){xh.A(t,wr,ai,"temporaryToNode"),this.kD=t}),xh.defineProperty(ai,{on:"temporaryToPort"},function(){return this.lD},function(t){xh.A(t,Mn,ai,"temporaryToPort"),this.lD=t}),xh.defineProperty(ai,{qc:"originalLink"},function(){return this.KC},function(t){null!==t&&xh.A(t,zr,ai,"originalLink"),this.KC=t}),xh.defineProperty(ai,{jh:"originalFromNode"},function(){return this.IC},function(t){null!==t&&xh.A(t,wr,ai,"originalFromNode"),this.IC=t}),xh.defineProperty(ai,{kh:"originalFromPort"},function(){return this.JC},function(t){null!==t&&xh.A(t,Mn,ai,"originalFromPort"),this.JC=t}),xh.defineProperty(ai,{lh:"originalToNode"},function(){return this.NC},function(t){null!==t&&xh.A(t,wr,ai,"originalToNode"),this.NC=t}),xh.defineProperty(ai,{mh:"originalToPort"},function(){return this.OC},function(t){null!==t&&xh.A(t,Mn,ai,"originalToPort"),this.OC=t}),xh.defineProperty(ai,{ce:"isForwards"},function(){return this.oC},function(t){xh.j(t,"boolean",ai,"isForwards"),this.oC=t}),xh.u(ai,{Px:"validPortsCache"},function(){return this.AG}),xh.defineProperty(ai,{$f:"targetPort"},function(){return this.dD},function(t){null!==t&&xh.A(t,Mn,ai,"targetPort"),this.dD=t}),ai.prototype.copyPortProperties=function(t,i,e,n,o){if(null!==t&&null!==i&&null!==e&&null!==n){n.ya=i.Y.size,o?(n.Bb=i.Bb,n.Ql=i.Ql):(n.Ab=i.Ab,n.sl=i.sl),e.gf=zh;var r=xh.M();e.location=i.Za(zh,r),xh.v(r),n.angle=i.ul(),null!==this.wx&&this.wx(t,i,e,n,o)}},ai.prototype.setNoTargetPortProperties=function(t,i,e){null!==i&&(i.ya=hl.Vx,i.Ab=Ch,i.Bb=Ch),null!==t&&(t.location=this.g.P.da),null!==this.wx&&this.wx(null,null,t,i,e)},ai.prototype.doMouseDown=function(){this.ra&&this.doMouseMove()},ai.prototype.doMouseMove=function(){if(this.ra){var t=this.g;if(null!==t){if(this.$f=this.findTargetPort(this.ce),null!==this.$f){var i=this.$f.aa;if(i instanceof wr)return void(this.ce?this.copyPortProperties(i,this.$f,this.Ae,this.on,!0):this.copyPortProperties(i,this.$f,this.ze,this.nn,!1))}this.ce?this.setNoTargetPortProperties(this.Ae,this.on,!0):this.setNoTargetPortProperties(this.ze,this.nn,!1),(t.ne||t.oe)&&un(t,t.P.lf)}}},ai.prototype.findValidLinkablePort=function(t,i){if(null===t)return null;var e=t.aa;if(!(e instanceof wr))return null;for(;null!==t;){var n=i?t.EF:t.nE;if(!0===n&&(null!==t.Sd||t instanceof wr)&&(i?this.isValidTo(e,t):this.isValidFrom(e,t)))return t;if(!1===n)break;t=t.T}return null},ai.prototype.findTargetPort=function(t){var i=(r=this.g).P.da;0>=(o=this.ZE)&&(o=.1);for(var e=this,n=r.Vm(i,o,function(i){return e.findValidLinkablePort(i,t)},null,!0),o=1/0,r=null,n=n.i;n.next();){var s=n.value,a=s.aa;if(a instanceof wr){var h=s.Za(zh,xh.M()),l=i.x-h.x,u=i.y-h.y;xh.v(h),(h=l*l+u*u)<o&&(null!==(l=this.Px.ka(s))?l&&(r=s,o=h):t&&this.isValidLink(this.jh,this.kh,a,s)||!t&&this.isValidLink(a,s,this.lh,this.mh)?(this.Px.add(s,!0),r=s,o=h):this.Px.add(s,!1))}}return null!==r&&(i=r.aa)instanceof wr&&(null===i.layer||i.layer.at)?r:null},ai.prototype.isValidFrom=function(t,i){if(null===t||null===i)return this.op;if(this.g.Ya===this&&(null!==t.layer&&!t.layer.at||!0!==i.nE))return!1;var e=i.HH;if(1/0>e){if(null!==this.qc&&t===this.jh&&i===this.kh)return!0;var n=i.Sd;if(null===n&&(n=""),t.Sw(n).count>=e)return!1}return!0},ai.prototype.isValidTo=function(t,i){if(null===t||null===i)return this.op;if(this.g.Ya===this&&(null!==t.layer&&!t.layer.at||!0!==i.EF))return!1;var e=i.BJ;if(1/0>e){if(null!==this.qc&&t===this.lh&&i===this.mh)return!0;var n=i.Sd;if(null===n&&(n=""),t.tg(n).count>=e)return!1}return!0},ai.prototype.isInSameNode=function(t,i){if(null===t||null===i)return!1;if(t===i)return!0;var e=t.aa,n=i.aa;return null!==e&&e===n},ai.prototype.isLinked=function(t,i){if(null===t||null===i)return!1;var e=t.aa;if(!(e instanceof wr))return!1;var n=t.Sd;null===n&&(n="");var o=i.aa;if(!(o instanceof wr))return!1;var r=i.Sd;for(null===r&&(r=""),o=o.tg(r);o.next();)if((r=o.value).V===e&&r.vg===n)return!0;return!1},ai.prototype.isValidLink=function(t,i,e,n){if(!this.isValidFrom(t,i)||!this.isValidTo(e,n)||!(null===i||null===n||(i.GH&&n.AJ||!this.isInSameNode(i,n))&&(i.FH&&n.zJ||!this.isLinked(i,n)))||null!==this.qc&&(null!==t&&this.isLabelDependentOnLink(t,this.qc)||null!==e&&this.isLabelDependentOnLink(e,this.qc))||null!==t&&null!==e&&(null===t.data&&null!==e.data||null!==t.data&&null===e.data)||!this.isValidCycle(t,e,this.qc))return!1;if(null!==t){var o=t.mx;if(null!==o&&!o(t,i,e,n,this.qc))return!1}return!(null!==e&&null!==(o=e.mx)&&!o(t,i,e,n,this.qc))&&(null===(o=this.mx)||o(t,i,e,n,this.qc))},ai.prototype.isLabelDependentOnLink=function(t,i){if(null===t)return!1;var e=t.fe;if(null===e)return!1;if(e===i)return!0;var n=new c(wr);return n.add(t),hi(this,e,i,n)},ai.prototype.isValidCycle=function(t,i,e){if(void 0===e&&(e=null),null===t||null===i)return this.op;var n=this.g.HJ;if(n!==au){if(n===fu){if(null!==e&&!e.Hc)return!0;for(n=i.ue;n.next();){var o=n.value;if(o!==e&&o.Hc&&o.ba===i)return!1}return!li(this,t,i,e,!0)}if(n===cu){if(null!==e&&!e.Hc)return!0;for(n=t.ue;n.next();)if((o=n.value)!==e&&o.Hc&&o.V===t)return!1;return!li(this,t,i,e,!0)}if(n===hu)return t===i?t=!0:((n=new c(wr)).add(i),t=ui(this,n,t,i,e)),!t;if(n===lu)return!li(this,t,i,e,!1);if(n===uu)return t===i?t=!0:((n=new c(wr)).add(i),t=fi(this,n,t,i,e)),!t}return!0},xh.defineProperty(ai,{mx:"linkValidation"},function(){return this.Qk},function(t){null!==t&&xh.j(t,"function",ai,"linkValidation"),this.Qk=t}),xh.defineProperty(ai,{wx:"portTargeted"},function(){return this.SC},function(t){null!==t&&xh.j(t,"function",ai,"portTargeted"),this.SC=t}),xh.Ja(ci,ai),xh.ea("LinkingTool",ci);var zl;ci.Either=zl=xh.p(ci,"Either",0);var Ol;ci.ForwardsOnly=Ol=xh.p(ci,"ForwardsOnly",0);var ql;ci.BackwardsOnly=ql=xh.p(ci,"BackwardsOnly",0),xh.defineProperty(ci,{NG:"archetypeLinkData"},function(){return this.sB},function(t){null!==t&&xh.A(t,Object,ci,"archetypeLinkData"),t instanceof Mn&&xh.A(t,zr,ci,"archetypeLinkData"),this.sB=t}),xh.defineProperty(ci,{FD:"archetypeLabelNodeData"},function(){return this.rB},function(t){null!==t&&xh.A(t,Object,ci,"archetypeLabelNodeData"),t instanceof Mn&&xh.A(t,wr,ci,"archetypeLabelNodeData"),this.rB=t}),xh.defineProperty(ci,{direction:"direction"},function(){return this.ca},function(t){xh.rb(t,ci,ci,"direction"),this.ca=t}),xh.defineProperty(ci,{BF:"startObject"},function(){return this.aD},function(t){null!==t&&xh.A(t,Mn,ci,"startObject"),this.aD=t}),ci.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t||t.bb||t.wf||!t.at)return!1;var i=t.Z;return!(!(i instanceof wt||i instanceof Pt)||!t.P.left||t.Ya!==this&&!this.isBeyondDragSize())&&null!==this.findLinkablePort()},ci.prototype.findLinkablePort=function(){var t=this.g;if(null===t)return null;var i=this.BF;if(null===i&&(i=t.re(t.yc.da,null,null)),null===i||!(i.aa instanceof wr))return null;if((t=this.direction)===zl||t===Ol){var e=this.findValidLinkablePort(i,!1);if(null!==e)return this.ce=!0,e}return t!==zl&&t!==ql||null===(e=this.findValidLinkablePort(i,!0))?null:(this.ce=!1,e)},ci.prototype.doActivate=function(){var t=this.g;if(null!==t){var i=this.findLinkablePort();null!==i&&(this.Sb(this.name),t.Pe=!0,t.Zb="pointer",this.ce?(this.kh=i,(i=this.kh.aa)instanceof wr&&(this.jh=i),this.copyPortProperties(this.jh,this.kh,this.ze,this.nn,!1)):(this.mh=i,(i=this.mh.aa)instanceof wr&&(this.lh=i),this.copyPortProperties(this.lh,this.mh,this.Ae,this.on,!0)),t.add(this.ze),t.add(this.Ae),null!==this.Fg&&(null!==this.ze&&(this.Fg.V=this.ze),null!==this.Ae&&(this.Fg.ba=this.Ae),this.Fg.jc(),t.add(this.Fg)),this.ra=!0)}},ci.prototype.doDeactivate=function(){this.ra=!1;var t=this.g;null!==t&&(t.remove(this.Fg),t.remove(this.ze),t.remove(this.Ae),t.Pe=!1,t.Zb="",this.kk())},ci.prototype.doStop=function(){ai.prototype.doStop.call(this),this.BF=null},ci.prototype.doMouseUp=function(){if(this.ra){var t=this.g;if(null===t)return;var i=this.Cf=null,e=null,n=null,o=null,r=this.$f=this.findTargetPort(this.ce);if(null!==r){var s=r.aa;s instanceof wr&&(this.ce?(null!==this.jh&&(i=this.jh,e=this.kh),n=s,o=r):(i=s,e=r,null!==this.lh&&(n=this.lh,o=this.mh)))}else this.ce?null!==this.jh&&this.op&&(i=this.jh,e=this.kh):null!==this.lh&&this.op&&(n=this.lh,o=this.mh);null===i&&null===n||(null!==(i=this.insertLink(i,e,n,o))?(null===r&&(this.ce?i.Ln=t.P.da.copy():i.Hn=t.P.da.copy()),t.pf&&t.select(i),this.Cf=this.name,t.Ba("LinkDrawn",i)):t.Z.ND())}this.stopTool()},ci.prototype.insertLink=function(t,i,e,n){var o=this.g;if(null===o)return null;var r=o.Z;if(r instanceof Pt){var s=t;if(i=e,o.Qd||(s=e,i=t),null!==s&&null!==i)return r.rh(i.data,r.ib(s.data)),i.ep()}else if(r instanceof wt)if(s="",null!==t&&(null===i&&(i=t),null===(s=i.Sd)&&(s="")),i="",null!==e&&(null===n&&(n=e),null===(i=n.Sd)&&(i="")),(n=this.NG)instanceof zr){if(bo(n),null!==(r=n.copy()))return r.V=t,r.vg=s,r.ba=e,r.th=i,o.add(r),(t=this.FD)instanceof wr&&(bo(t),null!==(t=t.copy())&&(t.fe=r,o.add(t))),r}else if(null!==n&&(n=r.Jw(n),xh.Va(n)))return null!==t&&r.Gx(n,r.ib(t.data)),r.JA(n,s),null!==e&&r.Kx(n,r.ib(e.data)),r.MA(n,i),r.Ws(n),null===(t=this.FD)||t instanceof wr||(t=r.copyNodeData(t),xh.Va(t)&&(r.cl(t),void 0!==(t=r.ib(t))&&r.vz(n,t))),r=o.sf(n);return null},xh.Ja(pi,ai),xh.ea("RelinkingTool",pi),pi.prototype.updateAdornments=function(t){if(null!==t&&t instanceof zr){var i="RelinkFrom",e=null;if(t.jb&&!this.g.bb){var n=t.gu;null!==n&&t.canRelinkFrom()&&t.Y.K()&&t.isVisible()&&n.Y.K()&&n.Fl()&&null===(e=t.bp(i))&&(null!==(e=this.makeAdornment(n,!1))&&(e.Fc=i),t.bl(i,e))}null===e&&t.Jl(i),i="RelinkTo",e=null,t.jb&&!this.g.bb&&null!==(n=t.gu)&&t.canRelinkTo()&&t.Y.K()&&t.isVisible()&&n.Y.K()&&n.Fl()&&null===(e=t.bp(i))&&(null!==(e=this.makeAdornment(n,!0))&&(e.Fc=i),t.bl(i,e)),null===e&&t.Jl(i)}},pi.prototype.makeAdornment=function(t,i){var e=new xr;e.type=Ku;var n=i?this.yJ:this.EH;return null!==n&&e.add(n.copy()),e.gc=t,e},xh.defineProperty(pi,{EH:"fromHandleArchetype"},function(){return this.bC},function(t){null!==t&&xh.A(t,Mn,pi,"fromHandleArchetype"),this.bC=t}),xh.defineProperty(pi,{yJ:"toHandleArchetype"},function(){return this.mD},function(t){null!==t&&xh.A(t,Mn,pi,"toHandleArchetype"),this.mD=t}),xh.u(pi,{handle:"handle"},function(){return this.Ub}),pi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t||t.bb||t.wf||!t.Im)return!1;var i=t.Z;return!(!(i instanceof wt||i instanceof Pt)||!t.P.left)&&(null===(i=this.findToolHandleAt(t.yc.da,"RelinkFrom"))&&(i=this.findToolHandleAt(t.yc.da,"RelinkTo")),null!==i)},pi.prototype.doActivate=function(){var t=this.g;if(null!==t){if(null===this.qc){var i=this.findToolHandleAt(t.yc.da,"RelinkFrom");if(null===i&&(i=this.findToolHandleAt(t.yc.da,"RelinkTo")),null===i)return;var e=i.aa;if(!(e instanceof xr&&e.Wg instanceof zr))return;this.Ub=i,this.ce=null===e||"RelinkTo"===e.Fc,this.qc=e.Wg}this.Sb(this.name),t.Pe=!0,t.Zb="pointer",this.kh=this.qc.bd,this.jh=this.qc.V,this.mh=this.qc.Fd,this.lh=this.qc.ba,this.LC.set(this.qc.Y),null!==this.qc&&0<this.qc.pa&&(null===this.qc.V&&(null!==this.nn&&(this.nn.ya=hl.Xp),null!==this.ze&&(this.ze.location=this.qc.l(0))),null===this.qc.ba&&(null!==this.on&&(this.on.ya=hl.Xp),null!==this.Ae&&(this.Ae.location=this.qc.l(this.qc.pa-1)))),this.copyPortProperties(this.jh,this.kh,this.ze,this.nn,!1),this.copyPortProperties(this.lh,this.mh,this.Ae,this.on,!0),t.add(this.ze),t.add(this.Ae),null!==this.Fg&&(null!==this.ze&&(this.Fg.V=this.ze),null!==this.Ae&&(this.Fg.ba=this.Ae),this.copyLinkProperties(this.qc,this.Fg),this.Fg.jc(),t.add(this.Fg)),this.ra=!0}},pi.prototype.copyLinkProperties=function(t,i){if(null!==t&&null!==i){i.Ys=t.Ys,i.Hz=t.Hz;var e=t.Le;e!==Lf&&e!==jf||(e=Nf),i.Le=e,i.Kw=t.Kw,i.Cx=t.Cx,i.Qp=t.Qp,i.Ab=t.Ab,i.sl=t.sl,i.vt=t.vt,i.wt=t.wt,i.Bb=t.Bb,i.Ql=t.Ql,i.pu=t.pu,i.qu=t.qu}},pi.prototype.doDeactivate=function(){this.ra=!1;var t=this.g;null!==t&&(t.remove(this.Fg),t.remove(this.ze),t.remove(this.Ae),t.Pe=!1,t.Zb="",this.kk())},pi.prototype.doStop=function(){ai.prototype.doStop.call(this),this.Ub=null},pi.prototype.doMouseUp=function(){if(this.ra){var t=this.g;if(null===t)return;this.Cf=null;var i=this.jh,e=this.kh,n=this.lh,o=this.mh,r=this.qc;if(this.$f=this.findTargetPort(this.ce),null!==this.$f){var s=this.$f.aa;s instanceof wr&&(this.ce?(n=s,o=this.$f):(i=s,e=this.$f))}else this.op?this.ce?o=n=null:e=i=null:r=null;null!==r&&(this.reconnectLink(r,this.ce?n:i,this.ce?o:e,this.ce),null===this.$f&&(this.ce?r.Ln=t.P.da.copy():r.Hn=t.P.da.copy(),r.jc()),t.pf&&(r.jb=!0),this.Cf=this.name,t.Ba("LinkRelinked",r,this.ce?this.mh:this.kh)),$r(this.qc,this.LC)}this.stopTool()},pi.prototype.reconnectLink=function(t,i,e,n){return null!==this.g&&(e=null!==e&&null!==e.Sd?e.Sd:"",n?(t.ba=i,t.th=e):(t.V=i,t.vg=e),!0)},xh.Ja(yi,zt),xh.ea("LinkReshapingTool",yi);var Bl;yi.None=Bl=xh.p(yi,"None",0);var El;yi.Horizontal=El=xh.p(yi,"Horizontal",1);var Il;yi.Vertical=Il=xh.p(yi,"Vertical",2);var Rl;yi.All=Rl=xh.p(yi,"All",3),yi.prototype.getReshapingBehavior=yi.prototype.rE=function(t){return t&&t.UC?t.UC:Bl},yi.prototype.setReshapingBehavior=yi.prototype.ju=function(t,i){xh.A(t,Mn,yi,"setReshapingBehavior:obj"),xh.rb(i,yi,yi,"setReshapingBehavior:behavior"),t.UC=i},yi.prototype.updateAdornments=function(t){if(null!==t&&t instanceof zr){if(t.jb&&!this.g.bb){var i=t.path;if(null!==i&&t.canReshape()&&t.Y.K()&&t.isVisible()&&i.Y.K()&&i.Fl()){var e=t.bp(this.name);if(null!==e&&e.pG===t.pa&&e.CG===t.bu||null!==(e=this.makeAdornment(i))&&(e.pG=t.pa,e.CG=t.bu,t.bl(this.name,e)),null!==e)return void(e.location=t.position)}}t.Jl(this.name)}},yi.prototype.makeAdornment=function(t){var i=t.aa,e=i.pa,n=i.kc,o=null;if(null!==i.points&&1<e){(o=new xr).type=Ku;var e=i.st,r=i.jx,s=n?1:0;if(i.bu&&i.Le!==Cf)for(var a=e+s;a<r-s;a++){var h=this.makeResegmentHandle(t,a);null!==h&&(h.ve=a,h.Ex=.5,o.add(h))}for(a=e+1;a<r;a++)if(null!==(h=this.makeHandle(t,a))){if(h.ve=a,a!==e)if(a===e+1&&n){var s=i.l(e),l=i.l(e+1);hl.G(s.x,l.x)&&hl.G(s.y,l.y)&&(l=i.l(e-1)),hl.G(s.x,l.x)?(this.ju(h,Il),h.cursor="n-resize"):hl.G(s.y,l.y)&&(this.ju(h,El),h.cursor="w-resize")}else a===r-1&&n?(s=i.l(r-1),l=i.l(r),hl.G(s.x,l.x)&&hl.G(s.y,l.y)&&(s=i.l(r+1)),hl.G(s.x,l.x)?(this.ju(h,Il),h.cursor="n-resize"):hl.G(s.y,l.y)&&(this.ju(h,El),h.cursor="w-resize")):a!==r&&(this.ju(h,Rl),h.cursor="move");o.add(h)}o.Fc=this.name,o.gc=t}return o},yi.prototype.makeHandle=function(){var t=this.yt;return null===t?null:t.copy()},xh.defineProperty(yi,{yt:"handleArchetype"},function(){return this.Gk},function(t){null!==t&&xh.A(t,Mn,yi,"handleArchetype"),this.Gk=t}),yi.prototype.makeResegmentHandle=function(){var t=this.DI;return null===t?null:t.copy()},xh.defineProperty(yi,{DI:"midHandleArchetype"},function(){return this.zC},function(t){null!==t&&xh.A(t,Mn,yi,"midHandleArchetype"),this.zC=t}),xh.u(yi,{handle:"handle"},function(){return this.Ub}),xh.u(yi,{Zs:"adornedLink"},function(){return this.jy}),yi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||t.bb||!t.yw||!t.P.left)&&null!==this.findToolHandleAt(t.yc.da,this.name)},yi.prototype.doActivate=function(){var t=this.g;if(null!==t&&(this.Ub=this.findToolHandleAt(t.yc.da,this.name),null!==this.Ub)){var i=this.Ub.aa.Wg;if(i instanceof zr){if(this.jy=i,t.Pe=!0,this.Sb(this.name),i.bu&&.5===this.Ub.Ex){var e=i.points.copy(),n=this.Ub.Za(zh);if(e.Cd(this.Ub.ve+1,n),i.kc&&e.Cd(this.Ub.ve+1,n),i.points=e,i.be(),this.Ub=this.findToolHandleAt(t.yc.da,this.name),null===this.Ub)return void this.doDeactivate()}this.MC=i.l(this.Ub.ve),this.Pv=i.points.copy(),this.ra=!0}}},yi.prototype.doDeactivate=function(){this.kk(),this.jy=this.Ub=null;var t=this.g;null!==t&&(t.Pe=!1),this.ra=!1},yi.prototype.doCancel=function(){var t=this.Zs;null!==t&&(t.points=this.Pv),this.stopTool()},yi.prototype.doMouseMove=function(){var t=this.g;this.ra&&null!==t&&(t=this.computeReshape(t.P.da),this.reshape(t))},yi.prototype.doMouseUp=function(){var t=this.g;if(this.ra&&null!==t){var i=this.computeReshape(t.P.da);if(this.reshape(i),null!==(i=this.Zs)&&i.bu){var e=this.handle.ve,n=i.l(e-1),o=i.l(e),r=i.l(e+1);if(i.kc){if(e>i.st+1&&e<i.jx-1){var s=i.l(e-2);if(Math.abs(n.x-o.x)<this.ph&&Math.abs(n.y-o.y)<this.ph&&(vi(this,s,n,o,r,!0)||vi(this,s,n,o,r,!1))){var a=i.points.copy();vi(this,s,n,o,r,!0)?(a.Dg(e-2,new b(s.x,(r.y+s.y)/2)),a.Dg(e+1,new b(r.x,(r.y+s.y)/2))):(a.Dg(e-2,new b((r.x+s.x)/2,s.y)),a.Dg(e+1,new b((r.x+s.x)/2,r.y))),a.Vc(e),a.Vc(e-1),i.points=a,i.be()}else s=i.l(e+2),Math.abs(o.x-r.x)<this.ph&&Math.abs(o.y-r.y)<this.ph&&(vi(this,n,o,r,s,!0)||vi(this,n,o,r,s,!1))&&(a=i.points.copy(),vi(this,n,o,r,s,!0)?(a.Dg(e-1,new b(n.x,(n.y+s.y)/2)),a.Dg(e+2,new b(s.x,(n.y+s.y)/2))):(a.Dg(e-1,new b((n.x+s.x)/2,n.y)),a.Dg(e+2,new b((n.x+s.x)/2,s.y))),a.Vc(e+1),a.Vc(e),i.points=a,i.be())}}else s=xh.M(),hl.fn(n.x,n.y,r.x,r.y,o.x,o.y,s)&&s.$j(o)<this.ph*this.ph&&((a=i.points.copy()).Vc(e),i.points=a,i.be()),xh.v(s)}t.pc(),this.Cf=this.name,t.Ba("LinkReshaped",this.Zs,this.Pv)}this.stopTool()},xh.defineProperty(yi,{ph:"resegmentingDistance"},function(){return this.TC},function(t){xh.j(t,"number",yi,"resegmentingDistance"),this.TC=t}),yi.prototype.reshape=function(t){var i=this.Zs;i.Ml();var e=this.handle.ve,n=this.rE(this.handle);if(i.kc)if(e===i.st+1)e=i.st+1,n===Il?(i.W(e,i.l(e-1).x,t.y),i.W(e+1,i.l(e+2).x,t.y)):n===El&&(i.W(e,t.x,i.l(e-1).y),i.W(e+1,t.x,i.l(e+2).y));else if(e===i.jx-1)e=i.jx-1,n===Il?(i.W(e-1,i.l(e-2).x,t.y),i.W(e,i.l(e+1).x,t.y)):n===El&&(i.W(e-1,t.x,i.l(e-2).y),i.W(e,t.x,i.l(e+1).y));else{var n=e,o=i.l(n),r=i.l(n-1),s=i.l(n+1);hl.G(r.x,o.x)&&hl.G(o.y,s.y)?(hl.G(r.x,i.l(n-2).x)&&!hl.G(r.y,i.l(n-2).y)?(i.w(n,t.x,r.y),e++,n++):i.W(n-1,t.x,r.y),hl.G(s.y,i.l(n+2).y)&&!hl.G(s.x,i.l(n+2).x)?i.w(n+1,s.x,t.y):i.W(n+1,s.x,t.y)):hl.G(r.y,o.y)&&hl.G(o.x,s.x)?(hl.G(r.y,i.l(n-2).y)&&!hl.G(r.x,i.l(n-2).x)?(i.w(n,r.x,t.y),e++,n++):i.W(n-1,r.x,t.y),hl.G(s.x,i.l(n+2).x)&&!hl.G(s.y,i.l(n+2).y)?i.w(n+1,t.x,s.y):i.W(n+1,t.x,s.y)):hl.G(r.x,o.x)&&hl.G(o.x,s.x)?(hl.G(r.x,i.l(n-2).x)&&!hl.G(r.y,i.l(n-2).y)?(i.w(n,t.x,r.y),e++,n++):i.W(n-1,t.x,r.y),hl.G(s.x,i.l(n+2).x)&&!hl.G(s.y,i.l(n+2).y)?i.w(n+1,t.x,s.y):i.W(n+1,t.x,s.y)):hl.G(r.y,o.y)&&hl.G(o.y,s.y)&&(hl.G(r.y,i.l(n-2).y)&&!hl.G(r.x,i.l(n-2).x)?(i.w(n,r.x,t.y),e++,n++):i.W(n-1,r.x,t.y),hl.G(s.y,i.l(n+2).y)&&!hl.G(s.x,i.l(n+2).x)?i.w(n+1,s.x,t.y):i.W(n+1,s.x,t.y)),i.W(e,t.x,t.y)}else i.W(e,t.x,t.y),1===e&&i.computeSpot(!0).te()&&(o=i.V,r=i.bd,null===o||o.isVisible()||(o=o.findVisibleNode())!==i.V&&(r=o.ql("")),n=r.Za(zh,xh.M()),o=i.getLinkPointFromPoint(o,r,n,t,!0,xh.M()),i.W(0,o.x,o.y),xh.v(n),xh.v(o)),e===i.pa-2&&i.computeSpot(!1).te()&&(e=i.ba,o=i.Fd,null===e||e.isVisible()||(e=e.findVisibleNode())!==i.ba&&(o=e.ql("")),n=o.Za(zh,xh.M()),o=i.getLinkPointFromPoint(e,o,n,t,!1,xh.M()),i.W(i.pa-1,o.x,o.y),xh.v(n),xh.v(o));i.Ui()},yi.prototype.computeReshape=function(t){var i=this.Zs,e=this.handle.ve;switch(this.rE(this.handle)){case Rl:return t;case Il:return i=i.l(e),new b(i.x,t.y);case El:return i=i.l(e),new b(t.x,i.y);default:case Bl:return i.l(e)}},xh.u(yi,{kL:"originalPoint"},function(){return this.MC}),xh.u(yi,{lL:"originalPoints"},function(){return this.Pv}),xh.Ja(gi,zt),xh.ea("ResizingTool",gi),gi.prototype.updateAdornments=function(t){if(!(null===t||t instanceof zr)){if(t.jb&&!this.g.bb){if(null!==(r=t.jF)&&t.canResize()&&t.Y.K()&&t.isVisible()&&r.Y.K()&&r.Fl()){var i=t.bp(this.name);if(null!==i&&i.gc===r||(i=this.makeAdornment(r)),null!==i){var e=r.ul();i.angle=e;var n=r.Za(i.gf,xh.M()),o=r.Yi();if(i.location=n,xh.v(n),null!==(n=i.placeholder)){var r=r.Ia,s=xh.Pl();s.m(r.width*o,r.height*o),n.ya=s,xh.ck(s)}return mi(this,i,e),void t.bl(this.name,i)}}}t.Jl(this.name)}},gi.prototype.makeAdornment=function(t){var i=null;if(null===(i=t.aa.iF)){(i=new xr).type=Iu,i.gf=zh;var e=new ws;e.Rf=!0,i.add(e),i.add(this.makeHandle(t,Lh)),i.add(this.makeHandle(t,Ah)),i.add(this.makeHandle(t,Eh)),i.add(this.makeHandle(t,qh)),i.add(this.makeHandle(t,Ih)),i.add(this.makeHandle(t,Gh)),i.add(this.makeHandle(t,Vh)),i.add(this.makeHandle(t,Rh))}else if(bo(i),null===(i=i.copy()))return null;return i.Fc=this.name,i.gc=t,i},gi.prototype.makeHandle=function(t,i){var e=this.yt;return null===e?null:(e=e.copy(),e.alignment=i,e)},xh.defineProperty(gi,{yt:"handleArchetype"},function(){return this.Gk},function(t){null!==t&&xh.A(t,Mn,gi,"handleArchetype"),this.Gk=t}),xh.u(gi,{handle:"handle"},function(){return this.Ub}),xh.defineProperty(gi,{gc:"adornedObject"},function(){return this.Fb},function(t){null!==t&&xh.A(t,Mn,gi,"adornedObject"),this.Fb=t}),gi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||t.bb||!t.bt||!t.P.left)&&null!==this.findToolHandleAt(t.yc.da,this.name)},gi.prototype.doActivate=function(){var t=this.g;null!==t&&(this.Ub=this.findToolHandleAt(t.yc.da,this.name),null!==this.Ub&&(this.Fb=this.Ub.aa.gc,this.az.set(this.Fb.aa.location),this.Ov.set(this.Fb.ya),this.Cy=this.computeCellSize(),this.Ey=this.computeMinSize(),this.Dy=this.computeMaxSize(),t.Pe=!0,this.FC=t.Sa.isEnabled,t.Sa.isEnabled=!1,this.Sb(this.name),this.ra=!0))},gi.prototype.doDeactivate=function(){var t=this.g;null!==t&&(this.kk(),this.Fb=this.Ub=null,this.ra=t.Pe=!1,t.Sa.isEnabled=this.FC)},gi.prototype.doCancel=function(){this.Fb.ya=this.Ov,this.Fb.aa.location=this.az,this.stopTool()},gi.prototype.doMouseMove=function(){var t=this.g;if(this.ra&&null!==t){var i=this.Ey,e=this.Dy,n=this.Cy,o=this.Fb.qE(t.P.da,xh.M()),r=Su;this.Fb instanceof To&&(r=jo(this.Fb)),i=this.computeResize(o,this.Ub.alignment,i,e,n,!(r===Du||r===Au||t.P.shift)),this.resize(i),t.Uf(),xh.v(o)}},gi.prototype.doMouseUp=function(){var t=this.g;if(this.ra&&null!==t){var i=this.Ey,e=this.Dy,n=this.Cy,o=this.Fb.qE(t.P.da,xh.M()),r=Su;this.Fb instanceof To&&(r=jo(this.Fb)),i=this.computeResize(o,this.Ub.alignment,i,e,n,!(r===Du||r===Au||t.P.shift)),this.resize(i),xh.v(o),t.pc(),this.Cf=this.name,t.Ba("PartResized",this.Fb,this.Ov)}this.stopTool()},gi.prototype.resize=function(t){if(null!==this.g){var i=this.gc,e=i.aa,n=i.ul(),o=i.Yi(),r=Math.PI*n/180,s=Math.cos(r),r=Math.sin(r),a=0<n&&180>n?1:0,h=90<n&&270>n?1:0,n=180<n&&360>n?1:0,l=i.Ia.width,u=i.Ia.height;i.ya=t.size;var f=e.position.copy();e.rf(),l=i.Ia.width-l,u=i.Ia.height-u,0===l&&0===u||(0!==l&&(f.x+=o*((t.x+l*h)*s-(t.y+u*a)*r)),0!==u&&(f.y+=o*((t.x+l*n)*r+(t.y+u*h)*s)),e.move(f),e instanceof wr&&e.ff())}},gi.prototype.computeResize=function(t,i,e,n,o,r){i.te()&&(i=zh);var s=this.gc.Ia,a=s.x,h=s.y,l=s.x+s.width,u=s.y+s.height,f=1;if(!r){var f=s.width,c=s.height;0>=f&&(f=1),0>=c&&(c=1),f=c/f}return c=xh.M(),hl.pt(t.x,t.y,a,h,o.width,o.height,c),t=s.copy(),0>=i.x?0>=i.y?(t.x=Math.max(c.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=Math.max(l-t.x,e.width),t.y=Math.max(c.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=Math.max(u-t.y,e.height),r||(i=t.height/t.width,f<i?(t.height=f*t.width,t.y=u-t.height):(t.width=t.height/f,t.x=l-t.width))):1<=i.y?(t.x=Math.max(c.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=Math.max(l-t.x,e.width),t.height=Math.max(Math.min(c.y-h,n.height),e.height),r||(i=t.height/t.width,f<i?t.height=f*t.width:(t.width=t.height/f,t.x=l-t.width))):(t.x=Math.max(c.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=l-t.x,r||(t.height=f*t.width,t.y=h+.5*(u-h-t.height))):1<=i.x?0>=i.y?(t.width=Math.max(Math.min(c.x-a,n.width),e.width),t.y=Math.max(c.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=Math.max(u-t.y,e.height),r||(i=t.height/t.width,f<i?(t.height=f*t.width,t.y=u-t.height):t.width=t.height/f)):1<=i.y?(t.width=Math.max(Math.min(c.x-a,n.width),e.width),t.height=Math.max(Math.min(c.y-h,n.height),e.height),r||(i=t.height/t.width,f<i?t.height=f*t.width:t.width=t.height/f)):(t.width=Math.max(Math.min(c.x-a,n.width),e.width),r||(t.height=f*t.width,t.y=h+.5*(u-h-t.height))):0>=i.y?(t.y=Math.max(c.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=u-t.y,r||(t.width=t.height/f,t.x=a+.5*(l-a-t.width))):1<=i.y&&(t.height=Math.max(Math.min(c.y-h,n.height),e.height),r||(t.width=t.height/f,t.x=a+.5*(l-a-t.width))),xh.v(c),t},gi.prototype.computeMinSize=function(){var t=this.gc.gh.copy(),i=this.gh;return!isNaN(i.width)&&i.width>t.width&&(t.width=i.width),!isNaN(i.height)&&i.height>t.height&&(t.height=i.height),t},gi.prototype.computeMaxSize=function(){var t=this.gc.yf.copy(),i=this.yf;return!isNaN(i.width)&&i.width<t.width&&(t.width=i.width),!isNaN(i.height)&&i.height<t.height&&(t.height=i.height),t},gi.prototype.computeCellSize=function(){var t=new k(NaN,NaN),i=this.gc.aa;if(null!==i){var e=i.$I;!isNaN(e.width)&&0<e.width&&(t.width=e.width),!isNaN(e.height)&&0<e.height&&(t.height=e.height)}return e=this.To,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height),i=this.g,(isNaN(t.width)||isNaN(t.height))&&i&&(null!==(e=i.cb.Zd)&&e.bx&&(e=e.tE,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height)),null!==(i=i.xt)&&i.visible&&this.bx&&(e=i.Ww,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height))),(isNaN(t.width)||0===t.width||1/0===t.width)&&(t.width=1),(isNaN(t.height)||0===t.height||1/0===t.height)&&(t.height=1),t},xh.defineProperty(gi,{gh:"minSize"},function(){return this.Ej},function(t){if(xh.A(t,k,gi,"minSize"),!this.Ej.L(t)){var i=t.width;isNaN(i)&&(i=0),t=t.height,isNaN(t)&&(t=0),this.Ej.m(i,t)}}),xh.defineProperty(gi,{yf:"maxSize"},function(){return this.Cj},function(t){if(xh.A(t,k,gi,"maxSize"),!this.Cj.L(t)){var i=t.width;isNaN(i)&&(i=1/0),t=t.height,isNaN(t)&&(t=1/0),this.Cj.m(i,t)}}),xh.defineProperty(gi,{To:"cellSize"},function(){return this.kj},function(t){xh.A(t,k,gi,"cellSize"),this.kj.L(t)||this.kj.assign(t)}),xh.defineProperty(gi,{bx:"isGridSnapEnabled"},function(){return this.cr},function(t){xh.j(t,"boolean",gi,"isGridSnapEnabled"),this.cr=t}),xh.u(gi,{iL:"originalDesiredSize"},function(){return this.Ov}),xh.u(gi,{jL:"originalLocation"},function(){return this.az}),xh.Ja(bi,zt),xh.ea("RotatingTool",bi),bi.prototype.updateAdornments=function(t){if(!(null===t||t instanceof zr)){if(t.jb&&!this.g.bb){var i=t.mF;if(null!==i&&t.canRotate()&&t.Y.K()&&t.isVisible()&&i.Y.K()&&i.Fl()){var e=t.bp(this.name);if(null!==e&&e.gc===i||(e=this.makeAdornment(i)),null!==e){e.angle=i.ul();var n=null,o=null;i===t||i===t.bc?(n=t.bc,o=t.gf):(n=i,o=zh);for(var r=n.Ia,o=xh.Ob(r.width*o.x+o.offsetX,r.height*o.y+o.offsetY);null!==n&&n!==i;)n.transform.xb(o),n=n.T;var n=o.y,r=Math.max(o.x-i.Ia.width,0),s=xh.M();return e.location=i.Za(new D(1,0,50+r,n),s),xh.v(s),xh.v(o),void t.bl(this.name,e)}}}t.Jl(this.name)}},bi.prototype.makeAdornment=function(t){var i=null;if(null===(i=t.aa.cJ)){(i=new xr).type=Bu,i.gf=zh;var e=this.yt;null!==e&&i.add(e.copy())}else if(bo(i),null===(i=i.copy()))return null;return i.Fc=this.name,i.gc=t,i},xh.defineProperty(bi,{yt:"handleArchetype"},function(){return this.Gk},function(t){null!==t&&xh.A(t,Mn,bi,"handleArchetype"),this.Gk=t}),xh.u(bi,{handle:"handle"},function(){return this.Ub}),xh.defineProperty(bi,{gc:"adornedObject"},function(){return this.Fb},function(t){null!==t&&xh.A(t,Mn,bi,"adornedObject"),this.Fb=t}),bi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||t.bb||!t.zw||!t.P.left)&&null!==this.findToolHandleAt(t.yc.da,this.name)},bi.prototype.doActivate=function(){var t=this.g;if(null!==t&&(this.Ub=this.findToolHandleAt(t.yc.da,this.name),null!==this.Ub)){this.Fb=this.Ub.aa.gc;var i=this.Fb.aa,e=i.bc;this.VC=this.Fb===i||this.Fb===e?e.Za(i.gf):this.Fb.Za(zh),this.Nv=this.Fb.angle,t.Pe=!0,t.Kz=!0,this.Sb(this.name),this.ra=!0}},bi.prototype.doDeactivate=function(){var t=this.g;null!==t&&(this.kk(),this.Fb=this.Ub=null,this.ra=t.Pe=!1)},bi.prototype.doCancel=function(){var t=this.g;null!==t&&(t.Kz=!1),this.rotate(this.Nv),this.stopTool()},bi.prototype.doMouseMove=function(){var t=this.g;this.ra&&null!==t&&(t=this.computeRotate(t.P.da),this.rotate(t))},bi.prototype.doMouseUp=function(){var t=this.g;if(this.ra&&null!==t){t.Kz=!1;var i=this.computeRotate(t.P.da);this.rotate(i),t.pc(),this.Cf=this.name,t.Ba("PartRotated",this.Fb,this.Nv)}this.stopTool()},bi.prototype.rotate=function(t){null!==this.Fb&&(this.Fb.angle=t)},bi.prototype.computeRotate=function(t){t=this.VC.ah(t);null!==(i=this.Fb.T)&&(360<=(t-=i.ul())?t-=360:0>t&&(t+=360));var i=Math.min(Math.abs(this.rJ),180),e=Math.min(Math.abs(this.qJ),i/2);return!this.g.P.shift&&0<i&&0<e&&(t%i<e?t=Math.floor(t/i)*i:t%i>i-e&&(t=(Math.floor(t/i)+1)*i)),360<=t?t-=360:0>t&&(t+=360),t},xh.defineProperty(bi,{rJ:"snapAngleMultiple"},function(){return this.ZC},function(t){xh.j(t,"number",bi,"snapAngleMultiple"),this.ZC=t}),xh.defineProperty(bi,{qJ:"snapAngleEpsilon"},function(){return this.YC},function(t){xh.j(t,"number",bi,"snapAngleEpsilon"),this.YC=t}),xh.u(bi,{hL:"originalAngle"},function(){return this.Nv}),xh.Ja(xi,zt),xh.ea("ClickSelectingTool",xi),xi.prototype.canStart=function(){return!(!this.isEnabled||null===this.g||this.isBeyondDragSize())},xi.prototype.doMouseUp=function(){this.ra&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.g.P.aj&&this.g.cb.doToolTip()),this.stopTool()},xh.Ja(wi,zt),xh.ea("ActionTool",wi),wi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t)return!1;var i=t.P,e=t.re(i.da,function(t){for(;null!==t.T&&!t.Zw;)t=t.T;return t});return null!==e&&(!!e.Zw&&(this.vn=e,t.En=t.re(i.da,null,null),!0))},wi.prototype.doMouseDown=function(){if(this.ra){var t=this.g.P,i=this.vn;null!==i&&(t.ye=i,null!==i.xD&&i.xD(t,i))}else this.canStart()&&this.doActivate()},wi.prototype.doMouseMove=function(){if(this.ra){var t=this.g.P,i=this.vn;null!==i&&(t.ye=i,null!==i.yD&&i.yD(t,i))}},wi.prototype.doMouseUp=function(){if(this.ra){var t=this.g,i=t.P,e=this.vn;if(null===e)return;i.ye=e,null!==e.zD&&e.zD(i,e),this.isBeyondDragSize()||Ot(e,i,t)}this.stopTool()},wi.prototype.doCancel=function(){if(null!==(t=this.g)){var t=t.P,i=this.vn;if(null===i)return;t.ye=i,null!==i.wD&&i.wD(t,i)}this.stopTool()},wi.prototype.doStop=function(){this.vn=null},xh.Ja(ki,zt),xh.ea("ClickCreatingTool",ki),ki.prototype.canStart=function(){if(!this.isEnabled||null===this.yz)return!1;var t=this.g;if(null===t||t.bb||t.wf||!t.Po||!t.P.left||this.isBeyondDragSize())return!1;if(this.cI){if(1===t.P.Ze&&(this.aC=t.P.lf.copy()),2!==t.P.Ze||this.isBeyondDragSize(this.aC))return!1}else if(1!==t.P.Ze)return!1;return t.Ya===this||null===t.rt(t.P.da,!0)},ki.prototype.doMouseUp=function(){var t=this.g;this.ra&&null!==t&&this.insertPart(t.P.da),this.stopTool()},ki.prototype.insertPart=function(t){var i=this.g;if(null===i)return null;var e=this.yz;if(null===e)return null;this.Sb(this.name);var n=null;return e instanceof tr?e.Pd()&&(bo(e),null!==(n=e.copy())&&i.add(n)):null!==e&&(e=i.Z.copyNodeData(e),xh.Va(e)&&(i.Z.cl(e),n=i.ug(e))),null!==n&&(n.location=t,i.pf&&i.select(n)),i.pc(),this.Cf=this.name,i.Ba("PartCreated",n),this.kk(),n},xh.defineProperty(ki,{yz:"archetypeNodeData"},function(){return this.Vl},function(t){null!==t&&xh.A(t,Object,ki,"archetypeNodeData"),this.Vl=t}),xh.defineProperty(ki,{cI:"isDoubleClick"},function(){return this.mC},function(t){xh.j(t,"boolean",ki,"isDoubleClick"),this.mC=t}),xh.Ja(Pi,zt),xh.ea("ContextMenuTool",Pi),xh.ZD=!1,xh.ft=null,xh.gt=null,Pi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||this.isBeyondDragSize()||!t.P.right)&&!!(null!==this.Mn&&t.P.aj||null!==this.findObjectWithContextMenu())},Pi.prototype.doStart=function(){var t=this.g;null!==t&&this.DC.set(t.yc.da)},Pi.prototype.doStop=function(){this.hideDefaultContextMenu(),this.hideContextMenu(),this.yq=null},Pi.prototype.findObjectWithContextMenu=function(t){void 0===t&&(t=null);var i=this.g;if(null===i)return null;var e=i.P,n=null;if(t instanceof Qi||(n=t instanceof Mn?t:i.re(e.da,null,function(t){return!t.layer.Gc})),null!==n){for(t=n;null!==t;){if(null!==t.contextMenu)return t;t=t.T}if(null!==this.Mn&&i.P.aj)return n.aa}else if(null!==i.contextMenu)return i;return null},Pi.prototype.doActivate=function(){},Pi.prototype.doMouseDown=function(){zt.prototype.doMouseDown.call(this),null!==this.g&&this.g.cb.Qe.contains(this)&&Ti(this)},Pi.prototype.doMouseUp=function(){Ti(this)},Pi.prototype.doMouseMove=function(){this.ra&&this.g.cb.doMouseMove()},Pi.prototype.showContextMenu=function(t,i){xh.A(t,xr,Pi,"showContextMenu:contextmenu"),null!==i&&xh.A(i,Mn,Pi,"showContextMenu:obj");if(null!==(e=this.g)){if(t!==this.Pf&&this.hideContextMenu(),t.Tf="Tool",t.Kl=!1,t.scale=1/e.scale,t.Fc=this.name,e.add(t),null!==i){var e=null,n=i.dp();null!==n&&(e=n.data),t.gc=i,t.data=e}else t.data=e.Z;t.rf(),this.positionContextMenu(t,i),this.Pf=t}},Pi.prototype.positionContextMenu=function(t){if(null===t.placeholder){var i=this.g;if(null!==i){var e=i.P.da.copy(),n=t.Ca,o=i.tb;i.P.aj&&(e.x-=n.width),e.x+n.width>o.right&&(e.x-=n.width+5),e.x<o.x&&(e.x=o.x),e.y+n.height>o.bottom&&(e.y-=n.height+5),e.y<o.y&&(e.y=o.y),t.position=e}}},Pi.prototype.hideContextMenu=function(){var t=this.g;null!==t&&null!==this.Pf&&(this.Pf.data=null,this.Pf.gc=null,t.remove(this.Pf),this.Pf=null,this.standardMouseOver())},Pi.prototype.showDefaultContextMenu=function(){var t=this.g;if(null!==t){null===this.sy&&(this.sy=function(t){return null===t.g?null:((t=new u(Mi)).add(new Mi("Copy",function(t){t.ob.copySelection()},function(t){return t.ob.canCopySelection()})),t.add(new Mi("Cut",function(t){t.ob.cutSelection()},function(t){return t.ob.canCutSelection()})),t.add(new Mi("Delete",function(t){t.ob.deleteSelection()},function(t){return t.ob.canDeleteSelection()})),t.add(new Mi("Paste",function(t){t.ob.pasteSelection(t.P.da)},function(t){return t.ob.canPasteSelection()})),t.add(new Mi("Select All",function(t){t.ob.selectAll()},function(t){return t.ob.canSelectAll()})),t.add(new Mi("Undo",function(t){t.ob.undo()},function(t){return t.ob.canUndo()})),t.add(new Mi("Redo",function(t){t.ob.redo()},function(t){return t.ob.canRedo()})),t.add(new Mi("Scroll To Part",function(t){t.ob.scrollToPart()},function(t){return t.ob.canScrollToPart()})),t.add(new Mi("Zoom To Fit",function(t){t.ob.zoomToFit()},function(t){return t.ob.canZoomToFit()})),t.add(new Mi("Reset Zoom",function(t){t.ob.resetZoom()},function(t){return t.ob.canResetZoom()})),t.add(new Mi("Group Selection",function(t){t.ob.groupSelection()},function(t){return t.ob.canGroupSelection()})),t.add(new Mi("Ungroup Selection",function(t){t.ob.ungroupSelection()},function(t){return t.ob.canUngroupSelection()})),t.add(new Mi("Edit Text",function(t){t.ob.editTextBlock()},function(t){return t.ob.canEditTextBlock()})),t)}(this)),this.Mn!==this.Pf&&this.hideContextMenu(),xh.gt.innerHTML="",xh.ft.addEventListener("click",this.nD,!1);var i=this,e=xh.createElement("ul");e.className="defaultCXul",xh.gt.appendChild(e),e.innerHTML="";for(var n=this.sy.i;n.next();){var o=n.value,r=o.text,s=o.visible;if("function"==typeof o.QD&&("function"!=typeof s||s(t))){(s=xh.createElement("li")).className="defaultCXli";var a=xh.createElement("a");a.className="defaultCXa",a.href="#",a.gG=o.QD,a.addEventListener("click",function(e){return this.gG(t),i.stopTool(),e.preventDefault(),!1},!1),a.textContent=r,s.appendChild(a),e.appendChild(s)}}xh.gt.style.display="block",xh.ft.style.display="block",this.Pf=this.Mn}},Pi.prototype.hideDefaultContextMenu=function(){null!==this.Pf&&this.Pf===this.Mn&&(xh.gt.style.display="none",xh.ft.style.display="none",xh.ft.removeEventListener("click",this.nD,!1),this.Pf=null)},xh.defineProperty(Pi,{Pf:"currentContextMenu"},function(){return this.GB},function(t){null!==t&&xh.A(t,xr,Pi,"currentContextMenu"),this.GB=t}),xh.defineProperty(Pi,{nK:"currentObject"},function(){return this.yq},function(t){null!==t&&xh.A(t,Mn,Pi,"currentObject"),this.yq=t}),xh.u(Pi,{cL:"mouseDownPoint"},function(){return this.DC}),xh.Ja(Ni,zt),xh.ea("DragSelectingTool",Ni),Ni.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t||!t.pf)return!1;var i=t.P;return!(!i.left||t.Ya!==this&&(!this.isBeyondDragSize()||i.timestamp-t.yc.timestamp<this.$D||null!==t.rt(i.da,!0)))},Ni.prototype.doActivate=function(){var t=this.g;null!==t&&(this.ra=!0,t.Pe=!0,t.wb=!0,t.add(this.Yg),this.doMouseMove())},Ni.prototype.doDeactivate=function(){var t=this.g;null!==t&&(t.remove(this.Yg),t.wb=!1,this.ra=t.Pe=!1)},Ni.prototype.doMouseMove=function(){if(null!==this.g&&this.ra&&null!==this.Yg){var t=this.computeBoxBounds(),i=this.Yg.ae("SHAPE");null===i&&(i=this.Yg.af()),i.ya=t.size,this.Yg.position=t.position}},Ni.prototype.doMouseUp=function(){if(this.ra){var t=this.g;t.remove(this.Yg);try{t.Zb="wait",this.selectInRect(this.computeBoxBounds())}finally{t.Zb=""}}this.stopTool()},Ni.prototype.computeBoxBounds=function(){var t=this.g;return null===t?new M(0,0,0,0):new M(t.yc.da,t.P.da)},Ni.prototype.selectInRect=function(t){var i=this.g;if(null!==i){e=i.P;if(i.Ba("ChangingSelection"),t=i.bk(t,null,function(t){return t instanceof tr&&t.canSelect()},this.jI),xh.fk?e.Pt:e.control)if(e.shift)for(t=t.i;t.next();)(e=t.value).jb&&(e.jb=!1);else for(t=t.i;t.next();)e=t.value,e.jb=!e.jb;else{if(!e.shift){for(var e=new u(tr),n=i.selection.i;n.next();){var o=n.value;t.contains(o)||e.add(o)}for(e=e.i;e.next();)e.value.jb=!1}for(t=t.i;t.next();)(e=t.value).jb||(e.jb=!0)}i.Ba("ChangedSelection")}},xh.defineProperty(Ni,{$D:"delay"},function(){return this.Nn},function(t){xh.j(t,"number",Ni,"delay"),this.Nn=t}),xh.defineProperty(Ni,{jI:"isPartialInclusion"},function(){return this.rC},function(t){xh.j(t,"boolean",Ni,"isPartialInclusion"),this.rC=t}),xh.defineProperty(Ni,{Yg:"box"},function(){return this.Xl},function(t){null!==t&&xh.A(t,tr,Ni,"box"),this.Xl=t}),xh.Ja(Ci,zt),xh.ea("PanningTool",Ci),Ci.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||!t.ne&&!t.oe||!t.P.left||t.Ya!==this&&!this.isBeyondDragSize())},Ci.prototype.doActivate=function(){var i=this.g;null!==i&&(this.jj?(i.P.bubbles=!0,t.document.addEventListener("scroll",this.bD,!1)):(i.Zb="move",i.Pe=!0,this.bz=i.position.copy()),this.ra=!0)},Ci.prototype.doDeactivate=function(){var t=this.g;null!==t&&(t.Zb="",this.ra=t.Pe=!1)},Ci.prototype.doCancel=function(){var t=this.g;null!==t&&(t.position=this.bz,t.Pe=!1),this.stopTool()},Ci.prototype.doMouseMove=function(){this.move()},Ci.prototype.doMouseUp=function(){this.move(),this.stopTool()},Ci.prototype.move=function(){var t=this.g;if(this.ra&&t)if(this.jj)t.P.bubbles=!0;else{var i=t.position,e=t.yc.da,n=t.P.da,o=i.x+e.x-n.x,e=i.y+e.y-n.y;t.ne||(o=i.x),t.oe||(e=i.y),t.position=new b(o,e)}},xh.defineProperty(Ci,{bubbles:"bubbles"},function(){return this.jj},function(t){xh.j(t,"boolean",Ci,"bubbles"),this.jj=t}),xh.u(Ci,{mL:"originalPosition"},function(){return this.bz}),xh.ea("TextEditingTool",ji),xh.Ja(ji,zt);var Gl;ji.LostFocus=Gl=xh.p(ji,"LostFocus",0);var Vl;ji.MouseDown=Vl=xh.p(ji,"MouseDown",1);var Hl;ji.Tab=Hl=xh.p(ji,"Tab",2);var Kl;ji.Enter=Kl=xh.p(ji,"Enter",3),ji.SingleClick=xh.p(ji,"SingleClick",0);var Ul;ji.SingleClickSelected=Ul=xh.p(ji,"SingleClickSelected",1);var Jl=xh.p(ji,"StateNone",0),Yl=xh.p(ji,"StateActive",1),Wl=xh.p(ji,"StateEditing",2),Xl=xh.p(ji,"StateEditing2",3),Ql=xh.p(ji,"StateValidating",4),Zl=xh.p(ji,"StateValidated",5);xh.defineProperty(ji,{Be:"textBlock"},function(){return this.mz},function(t){null!==t&&xh.A(t,zo,ji,"textBlock"),this.mz=t}),xh.defineProperty(ji,{rg:"currentTextEditor"},function(){return this.KB},function(t){this.KB=t}),xh.defineProperty(ji,{oH:"defaultTextEditor"},function(){return this.QB},function(t){xh.A(t,Element,ji,"defaultTextEditor"),this.QB=t}),xh.defineProperty(ji,{OA:"starting"},function(){return this.Do},function(t){xh.rb(t,ji,ji,"starting"),this.Do=t}),ji.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;return!(null===t||t.bb||!t.P.left||this.isBeyondDragSize())&&(!(null===(t=t.re(t.P.da,null,function(t){return t instanceof zo}))||!t.Lz||!t.aa.canEdit())&&!(null===(t=t.aa)||this.OA===Ul&&!t.jb))},ji.prototype.doStart=function(){this.ra||null===this.Be||this.doActivate()},ji.prototype.doActivate=function(){if(!this.ra){var t=this.g;if(null!==t){var i=this.Be;if(null===i&&(i=t.re(t.P.da,function(t){return t instanceof zo?t:null})),null!==i&&(this.Be=i,null!==i.aa)){this.ra=!0,this.gb=Yl;var e=this.oH,n=!1;null!==i.DF&&(e=i.DF),null===e||e.nB||(n=!0),this.fD=this.Be.copy();h=new M(this.Be.Za(Lh),this.Be.Za(Eh));if(t.hJ(h),e.nB){var o=i.Za(zh),r=t.position,s=t.scale,a=i.Yi()*s;a<this.UE&&(a=this.UE);var h=i.Ia.width*a,l=i.Ia.height*a,u=(o.x-r.x)*s,o=(o.y-r.y)*s;e.value=i.text,t.ol.style.font=i.font,e.style.font="inherit",e.style.fontSize=100*a+"%",e.style.lineHeight="normal",e.style.width=h+6+"px",e.style.height=l+2+"px",e.style.left=(u-h/2|0)-1+"px",e.style.top=(o-l/2|0)-1+"px",e.style.textAlign=i.textAlign,e.style.margin="0",e.style.padding="1px",e.style.border="0",e.style.outline="none",e.style["white-space"]="pre-wrap",e.style.overflow="hidden"}t.ol.appendChild(e),e.style.position="absolute",e.style.zIndex=100,e.className="start",e.textEditingTool=this,e.xJ=a,n&&"function"==typeof e.onActivate&&e.onActivate(),this.rg=e,"function"==typeof e.focus&&e.focus(),"function"==typeof e.select&&this.IA&&(e.select(),e.setSelectionRange(0,9999))}}}},ji.prototype.doCancel=function(){null!==this.Wk&&(this.rg.style.border=this.Wk,this.Wk=null),this.stopTool()},ji.prototype.doMouseUp=function(){!this.ra&&this.canStart()&&this.doActivate()},ji.prototype.doMouseDown=function(){this.ra&&this.acceptText(Vl)},ji.prototype.acceptText=function(t){switch(t){case Vl:this.gb===Zl||this.gb===Xl?"function"==typeof this.rg.focus&&this.rg.focus():this.gb!==Yl&&this.gb!==Wl||(this.gb=Ql,Li(this));break;case Gl:case Kl:case Hl:if(Kl===t&&!0===this.mz.gx)break;this.gb!==Yl&&this.gb!==Wl||(this.gb=Ql,Li(this))}},ji.prototype.doDeactivate=function(){var t=this.g;if(null!==t){if(this.gb=Jl,this.Be=null,null!==this.rg){var i=this.rg;"function"==typeof i.onDeactivate&&i.onDeactivate(),null!==i&&t.ol.removeChild(i)}this.ra=!1}},ji.prototype.isValidText=function(t,i,e){xh.A(t,zo,ji,"isValidText:textblock");var n=this.RA;return!(null!==n&&!n(t,i,e))&&!(null!==(n=t.RA)&&!n(t,i,e))},xh.defineProperty(ji,{RA:"textValidation"},function(){return this.Zk},function(t){null!==t&&xh.j(t,"function",ji,"textValidation"),this.Zk=t}),xh.defineProperty(ji,{UE:"minimumEditorScale"},function(){return this.AC},function(t){null!==t&&xh.j(t,"number",ji,"minimumEditorScale"),this.AC=t}),xh.defineProperty(ji,{IA:"selectsTextOnActivate"},function(){return this.WC},function(t){null!==t&&xh.j(t,"boolean",ji,"selectsTextOnActivate"),this.WC=t}),xh.Ja(Di,zt),xh.ea("ToolManager",Di);var $l;Di.WheelScroll=$l=xh.p(Di,"WheelScroll",0);var _l;Di.WheelZoom=_l=xh.p(Di,"WheelZoom",1),Di.WheelNone=xh.p(Di,"WheelNone",2);var tu;Di.GestureZoom=tu=xh.p(Di,"GestureZoom",3);var iu;Di.GestureCancel=iu=xh.p(Di,"GestureCancel",4);var eu;Di.GestureNone=eu=xh.p(Di,"GestureNone",5),xh.defineProperty(Di,{St:"mouseWheelBehavior"},function(){return this.EC},function(t){xh.rb(t,Di,Di,"mouseWheelBehavior"),this.EC=t}),xh.defineProperty(Di,{gp:"gestureBehavior"},function(){return this.cC},function(t){xh.rb(t,Di,Di,"gestureBehavior"),this.cC=t}),Di.prototype.initializeStandardTools=function(){this.DG=new wi,this.aF=new pi,this.tI=new yi,this.lF=new gi,this.eJ=new bi,this.QE=new ci,this.Zd=new qt,this.vH=new Ni,this.NI=new Ci,this.Ez=new Pi,this.QA=new ji,this.VG=new ki,this.WG=new xi},Di.prototype.doMouseDown=function(){var t=this.g;if(null!==t){var i=t.P;if(i.aj&&this.gp===iu&&(i.bubbles=!1),i.Gt){if(this.gp===eu)return void(i.bubbles=!0);if(this.gp===iu)return;if(t.Ya.canStartMultiTouch())return void t.Ya.standardPinchZoomStart()}(e=t.ma).Bz&&0!==e.uh&&xh.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var e=this.Qe.length,n=0;n<e;n++){var o=this.Qe.ha(n);if(null===o.g&&o.Mc(this.g),o.canStart())return t.Ya=o,void(t.Ya===o&&(o.ra||o.doActivate(),o.doMouseDown()))}1===t.P.button&&(this.St===$l?this.St=_l:this.St===_l&&(this.St=$l)),this.doActivate(),this.standardWaitAfter(this.wE,i)}},Di.prototype.doMouseMove=function(){var t=this.g;if(null!==t){var i=t.P;if(i.Gt){if(this.gp===eu)return void(i.bubbles=!0);if(this.gp===iu)return;if(t.Ya.canStartMultiTouch())return void t.Ya.standardPinchZoomMove()}if(this.ra)for(var e=this.Vf.length,n=0;n<e;n++){var o=this.Vf.ha(n);if(null===o.g&&o.Mc(this.g),o.canStart())return t.Ya=o,void(t.Ya===o&&(o.ra||o.doActivate(),o.doMouseMove()))}this.standardMouseOver(),this.isBeyondDragSize()&&this.standardWaitAfter(this.ra?this.wE:this.UH,i),i.bubbles=!0}},Di.prototype.doCurrentObjectChanged=function(t,i){var e=this.kl;null===e||null!==i&&(i===e||i.Cl(e))||this.hideToolTip()},Di.prototype.doWaitAfter=function(t){var i=this.g;null!==i&&i.ub&&(this.doMouseHover(),this.ra||this.doToolTip(),t.aj&&!i.P.zc&&(t=t.copy(),t.button=2,t.buttons=2,i.P=t,i.mw=!0,i.doMouseUp()))},Di.prototype.doMouseHover=function(){var t=this.g;if(null!==t){var i=t.P;null===i.ye&&(i.ye=t.re(i.da,null,null));var e=i.ye;if(null!==e)for(i.zc=!1;null!==e&&(null===(t=this.ra?e.kA:e.lA)||(t(i,e),!i.zc));)e=e.T;else null!==(t=this.ra?t.kA:t.lA)&&t(i)}},Di.prototype.doToolTip=function(){var t=this.g;if(null!==t){var i=t.P;if(null===i.ye&&(i.ye=t.re(i.da,null,null)),null!==(i=i.ye)){if(i!==this.kl&&!i.Cl(this.kl)){for(;null!==i;){if(null!==(t=i.TA))return void this.showToolTip(t,i);i=i.T}this.hideToolTip()}}else null!==(t=t.TA)?this.showToolTip(t,null):this.hideToolTip()}},Di.prototype.showToolTip=function(t,i){xh.A(t,xr,Di,"showToolTip:tooltip"),null!==i&&xh.A(i,Mn,Di,"showToolTip:obj");if(null!==(e=this.g)){if(t!==this.kl&&this.hideToolTip(),t.Tf="Tool",t.Kl=!1,t.scale=1/e.scale,e.add(t),null!==i&&i!==this.Xu){var e=null,n=i.dp();null!==n&&(e=n.data),t.gc=i,t.data=e}else null===i&&(t.data=e.Z);if(null!==i&&i===this.Xu||(t.rf(),this.positionToolTip(t,i)),this.qy=t,this.Xu=i,-1!==this.Em&&(xh.clearTimeout(this.Em),this.Em=-1),0<(e=this.CJ)&&1/0!==e){var o=this;this.Em=xh.setTimeout(function(){o.hideToolTip()},e)}}},Di.prototype.positionToolTip=function(t){if(null===t.placeholder){var i=this.g;if(null!==i){var e=i.P.da.copy(),n=t.Ca,o=i.tb;i.P.aj&&(e.x-=n.width),e.x+n.width>o.right&&(e.x-=n.width+5),e.x<o.x&&(e.x=o.x),e.y=e.y+20+n.height>o.bottom?e.y-(n.height+5):e.y+20,e.y<o.y&&(e.y=o.y),t.position=e}}},Di.prototype.hideToolTip=function(){if(-1!==this.Em&&(xh.clearTimeout(this.Em),this.Em=-1),null!==this.kl){var t=this.g;null!==t&&(this.kl.data=null,this.kl.gc=null,t.remove(this.kl),this.Xu=this.qy=null)}},xh.u(Di,{kl:"currentToolTip"},function(){return this.qy}),Di.prototype.doMouseUp=function(){if(this.cancelWaitAfter(),this.ra){var t=this.g;if(null===t)return;for(var i=this.Wf.length,e=0;e<i;e++){var n=this.Wf.ha(e);if(null===n.g&&n.Mc(this.g),n.canStart())return t.Ya=n,void(t.Ya===n&&(n.ra||n.doActivate(),n.doMouseUp()))}}this.doDeactivate()},Di.prototype.doMouseWheel=function(){this.standardMouseWheel()},Di.prototype.doKeyDown=function(){var t=this.g;null!==t&&t.ob.doKeyDown()},Di.prototype.doKeyUp=function(){var t=this.g;null!==t&&t.ob.doKeyUp()},Di.prototype.doCancel=function(){null!==Al&&Al.doCancel(),zt.prototype.doCancel.call(this)},Di.prototype.findTool=function(t){xh.j(t,"string",Di,"findTool:name");for(var i=this.Qe.length,e=0;e<i;e++){var n=this.Qe.ha(e);if(n.name===t)return n}for(i=this.Vf.length,e=0;e<i;e++)if((n=this.Vf.ha(e)).name===t)return n;for(i=this.Wf.length,e=0;e<i;e++)if((n=this.Wf.ha(e)).name===t)return n;return null},Di.prototype.replaceTool=function(t,i){xh.j(t,"string",Di,"replaceTool:name"),null!==i&&(xh.A(i,zt,Di,"replaceTool:newtool"),i.g&&i.g!==this.g&&xh.k("Cannot share tools between Diagrams: "+i.toString()),i.Mc(this.g));for(var e=this.Qe.length,n=0;n<e;n++){var o=this.Qe.ha(n);if(o.name===t)return null!==i?this.Qe.Dg(n,i):this.Qe.Vc(n),o}for(e=this.Vf.length,n=0;n<e;n++)if((o=this.Vf.ha(n)).name===t)return null!==i?this.Vf.Dg(n,i):this.Vf.Vc(n),o;for(e=this.Wf.length,n=0;n<e;n++)if((o=this.Wf.ha(n)).name===t)return null!==i?this.Wf.Dg(n,i):this.Wf.Vc(n),o;return null},xh.u(Di,{Qe:"mouseDownTools"},function(){return this.lG}),xh.u(Di,{Vf:"mouseMoveTools"},function(){return this.mG}),xh.u(Di,{Wf:"mouseUpTools"},function(){return this.nG}),xh.defineProperty(Di,{UH:"hoverDelay"},function(){return this.fC},function(t){xh.j(t,"number",Di,"hoverDelay"),this.fC=t}),xh.defineProperty(Di,{wE:"holdDelay"},function(){return this.eC},function(t){xh.j(t,"number",Di,"holdDelay"),this.eC=t}),xh.defineProperty(Di,{wH:"dragSize"},function(){return this.UB},function(t){xh.A(t,k,Di,"dragSize"),this.UB=t.S()}),xh.defineProperty(Di,{CJ:"toolTipDuration"},function(){return this.oD},function(t){xh.j(t,"number",Di,"toolTipDuration"),this.oD=t}),xh.defineProperty(Di,{DG:"actionTool"},function(){return this.findTool("Action")},function(t){Ai(this,"Action",t,this.Qe)}),xh.defineProperty(Di,{aF:"relinkingTool"},function(){return this.findTool("Relinking")},function(t){Ai(this,"Relinking",t,this.Qe)}),xh.defineProperty(Di,{tI:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(t){Ai(this,"LinkReshaping",t,this.Qe)}),xh.defineProperty(Di,{lF:"resizingTool"},function(){return this.findTool("Resizing")},function(t){Ai(this,"Resizing",t,this.Qe)}),xh.defineProperty(Di,{eJ:"rotatingTool"},function(){return this.findTool("Rotating")},function(t){Ai(this,"Rotating",t,this.Qe)}),xh.defineProperty(Di,{QE:"linkingTool"},function(){return this.findTool("Linking")},function(t){Ai(this,"Linking",t,this.Vf)}),xh.defineProperty(Di,{Zd:"draggingTool"},function(){return this.findTool("Dragging")},function(t){Ai(this,"Dragging",t,this.Vf)}),xh.defineProperty(Di,{vH:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(t){Ai(this,"DragSelecting",t,this.Vf)}),xh.defineProperty(Di,{NI:"panningTool"},function(){return this.findTool("Panning")},function(t){Ai(this,"Panning",t,this.Vf)}),xh.defineProperty(Di,{Ez:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(t){Ai(this,"ContextMenu",t,this.Wf)}),xh.defineProperty(Di,{QA:"textEditingTool"},function(){return this.findTool("TextEditing")},function(t){Ai(this,"TextEditing",t,this.Wf)}),xh.defineProperty(Di,{VG:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(t){Ai(this,"ClickCreating",t,this.Wf)}),xh.defineProperty(Di,{WG:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(t){Ai(this,"ClickSelecting",t,this.Wf)}),xh.ea("AnimationManager",Fi),Fi.prototype.Mc=function(t){this.U=t},xh.defineProperty(Fi,{OA:"starting"},function(){return this.Do},function(t){this.Do!==t&&(null!==t&&xh.j(t,"function",Fi,"starting"),this.Do=t)}),xh.u(Fi,{gK:"animationReasons"},function(){return this.Hu}),Fi.prototype.prepareAutomaticAnimation=Fi.prototype.jn=function(t){if(this.Ue&&(this.vj||this.U.bn)){this.Hu.add(t);var i=this.OA;(null===i||i(this,t))&&(this.uj&&this.ci(),this.vc=!0,this.Ju=!1)}};var nu={opacity:function(t,i,e,n,o,r){t.opacity=n(o,i,e-i,r)},position:function(t,i,e,n,o,r){o!==r?t.Jx(n(o,i.x,e.x-i.x,r),n(o,i.y,e.y-i.y,r)):t.position=new b(n(o,i.x,e.x-i.x,r),n(o,i.y,e.y-i.y,r))},"position:node":function(t,i,e,n,o,r){var s=t.Y,a=e.Y;e=a.x+a.width/2-s.width/2,s=a.y+a.height/2-s.height/2,o!==r?t.Jx(n(o,i.x,e-i.x,r),n(o,i.y,s-i.y,r)):t.position=new b(n(o,i.x,e-i.x,r),n(o,i.y,s-i.y,r))},"position:placeholder":function(t,i,e,n,o,r){o!==r?t.Jx(n(o,i.x,e.x-i.x,r),n(o,i.y,e.y-i.y,r)):t.position=new b(n(o,i.x,e.x-i.x,r),n(o,i.y,e.y-i.y,r))},scale:function(t,i,e,n,o,r){t.scale=n(o,i,e-i,r)},visible:function(t,i,e,n,o,r){t.visible=o!==r?i:e}};Fi.prototype.stopAnimation=Fi.prototype.ci=function(){!0===this.vc&&(this.vc=!1,this.Ju&&this.U.Re()),this.uj&&this.Ue&&Gi(this)},xh.defineProperty(Fi,{isEnabled:"isEnabled"},function(){return this.Ue},function(t){xh.j(t,"boolean",Fi,"isEnabled"),this.Ue=t}),xh.defineProperty(Fi,{duration:"duration"},function(){return this.zy},function(t){xh.j(t,"number",Fi,"duration"),1>t&&xh.wa(t,">= 1",Fi,"duration"),this.zy=t}),xh.u(Fi,{uf:"isAnimating"},function(){return this.uj}),xh.u(Fi,{MK:"isTicking"},function(){return this.bo}),xh.defineProperty(Fi,{HE:"isInitial"},function(){return this.vj},function(t){xh.j(t,"boolean",Fi,"isInitial"),this.vj=t}),xh.ea("Layer",Yi),Yi.prototype.Mc=function(t){this.U=t},Yi.prototype.toString=function(t){void 0===t&&(t=0);var i='Layer "'+this.name+'"';if(0>=t)return i;for(var e=0,n=0,o=0,r=0,s=0,a=this.zb.i;a.next();){var h=a.value;h instanceof vs?o++:h instanceof wr?n++:h instanceof zr?r++:h instanceof xr?s++:e++}if(a="",0<e&&(a+=e+" Parts "),0<n&&(a+=n+" Nodes "),0<o&&(a+=o+" Groups "),0<r&&(a+=r+" Links "),0<s&&(a+=s+" Adornments "),1<t)for(t=this.zb.i;t.next();)e=t.value,a+="\n    "+e.toString(),null!==(n=e.data)&&xh.pd(n)&&(a+=" #"+xh.pd(n)),e instanceof wr?a+=" "+Cl(n):e instanceof zr&&(a+=" "+Cl(e.V)+" "+Cl(e.ba));return i+" "+this.zb.count+": "+a},Yi.prototype.findObjectAt=Yi.prototype.re=function(t,i,e){if(void 0===i&&(i=null),void 0===e&&(e=null),!1===this.Yk)return null;var n=!1;this.g.tb.Ga(t)&&(n=!0);for(var o=xh.M(),r=this.zb.n,s=r.length;s--;){var a=r[s];if((!0!==n||!1!==dr(a))&&a.isVisible()&&(o.assign(t),w(o,a.Xg),null!==(a=a.re(o,i,e))&&(null!==i&&(a=i(a)),null!==a&&(null===e||e(a)))))return xh.v(o),a}return xh.v(o),null},Yi.prototype.findObjectsAt=Yi.prototype.qt=function(t,i,e,n){if(void 0===i&&(i=null),void 0===e&&(e=null),n instanceof u||n instanceof c||(n=new c(Mn)),!1===this.Yk)return n;var o=!1;this.g.tb.Ga(t)&&(o=!0);for(var r=xh.M(),s=this.zb.n,a=s.length;a--;){var h=s[a];!0===o&&!1===dr(h)||!h.isVisible()||(r.assign(t),w(r,h.Xg),h.qt(r,i,e,n)&&(null!==i&&(h=i(h)),null===h||null!==e&&!e(h)||n.add(h)))}return xh.v(r),n},Yi.prototype.findObjectsIn=Yi.prototype.bk=function(t,i,e,n,o){if(void 0===i&&(i=null),void 0===e&&(e=null),void 0===n&&(n=!1),o instanceof u||o instanceof c||(o=new c(Mn)),!1===this.Yk)return o;var r=!1;this.g.tb.Zj(t)&&(r=!0);for(var s=this.zb.n,a=s.length;a--;){var h=s[a];(!0!==r||!1!==dr(h))&&h.isVisible()&&h.bk(t,i,e,n,o)&&(null!==i&&(h=i(h)),null===h||null!==e&&!e(h)||o.add(h))}return o},Yi.prototype.Oz=function(t,i,e,n,o,r,s){if(!1===this.Yk)return o;for(var a=this.zb.n,h=a.length;h--;){var l=a[h];(!0!==s||!1!==dr(l))&&r(l)&&l.isVisible()&&l.bk(t,i,e,n,o)&&(null!==i&&(l=i(l)),null===l||null!==e&&!e(l)||o.add(l))}return o},Yi.prototype.findObjectsNear=Yi.prototype.Vm=function(t,i,e,n,o,r){if(void 0===e&&(e=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof u||o instanceof c)&&(r=o),o=!0),r instanceof u||r instanceof c||(r=new c(Mn)),!1===this.Yk)return r;var s=!1;this.g.tb.Ga(t)&&(s=!0);for(var a=xh.M(),h=xh.M(),l=this.zb.n,f=l.length;f--;){var p=l[f];!0===s&&!1===dr(p)||!p.isVisible()||(a.assign(t),w(a,p.Xg),h.m(t.x+i,t.y),w(h,p.Xg),p.Vm(a,h,e,n,o,r)&&(null!==e&&(p=e(p)),null===p||null!==n&&!n(p)||r.add(p)))}return xh.v(a),xh.v(h),r},(mh=Yi.prototype).zf=function(t,i){if(this.visible){var e;e=void 0===i?t.tb:i;for(var n=this.zb.n,o=n.length,r=0;r<o;r++){var s=n[r];if(s.xC=r,!(s instanceof zr&&!1===s.Mf)){if(s instanceof xr){var a=s;if(null!==a.Wg)continue}if(N(s.Y,e))for(s.zf(!0),ir(s),s=s.ww;s.next();)a=s.value,jn(a,1/0,1/0),a.Ec(),a.zf(!0);else s.zf(!1),null!==s.ww&&0<s.ww.count&&ir(s)}}}},mh.$e=function(t,i,e){if(this.visible&&0!==this.Rc&&(void 0===e&&(e=!0),e||!this.Gc)){var n=(e=this.zb.n).length;if(0!==n){1!==this.Rc&&(t.globalAlpha=this.Rc);var o=this.Qv;o.length=0;for(var r=i.scale,s=0;s<n;s++){var a=e[s];if(dr(a)){if(a instanceof zr){var h=a;if(h.kc&&o.push(h),!1===h.Mf)continue}1<(h=a.Y).width*r||1<h.height*r?a.$e(t,i):lr(a,t)}}t.globalAlpha=1}}},mh.h=function(t,i,e,n,o){var r=this.g;null!==r&&r.Lc(kl,t,this,i,e,n,o)},mh.lp=function(t,i,e){var n=this.zb;if(i.Av=this,t>=n.count)t=n.count;else if(n.ha(t)===i)return-1;return n.Cd(t,i),i.At(e),null!==(n=this.g)&&(e?n.qa():n.lp(i)),Xi(this,t,i),t},mh.Oe=function(t,i,e){if(!e&&i.layer!==this&&null!==i.layer)return i.layer.Oe(t,i,e);var n=this.zb;if(0>t||t>=n.length){if(0>(t=n.indexOf(i)))return-1}else if(n.ha(t)!==i&&0>(t=n.indexOf(i)))return-1;return i.Bt(e),n.Vc(t),null!==(n=this.g)&&(e?n.qa():n.Oe(i)),i.Av=null,t},mh.clear=function(){for(var t=this.zb.dc(),i=t.length,e=0;e<i;e++)t[e].zf(!1),this.Oe(-1,t[e],!1)},xh.u(Yi,{ik:"parts"},function(){return this.zb.i}),xh.u(Yi,{pL:"partsBackwards"},function(){return this.zb.cn}),xh.u(Yi,{g:"diagram"},function(){return this.U}),xh.defineProperty(Yi,{name:"name"},function(){return this.Qb},function(t){xh.j(t,"string",Yi,"name");var i=this.Qb;if(i!==t){var e=this.g;if(null!==e)for(""===i&&xh.k("Cannot rename default Layer to: "+t),e=e.kx;e.next();)e.value.name===t&&xh.k("Layer.name is already present in this diagram: "+t);for(this.Qb=t,this.h("name",i,t),t=this.zb.i;t.next();)t.value.Tf=this.Qb}}),xh.defineProperty(Yi,{opacity:"opacity"},function(){return this.Rc},function(t){var i=this.Rc;i!==t&&(xh.j(t,"number",Yi,"opacity"),(0>t||1<t)&&xh.wa(t,"0 <= value <= 1",Yi,"opacity"),this.Rc=t,this.h("opacity",i,t),null!==(t=this.g)&&t.qa())}),xh.defineProperty(Yi,{Gc:"isTemporary"},function(){return this.Qy},function(t){var i=this.Qy;i!==t&&(xh.j(t,"boolean",Yi,"isTemporary"),this.Qy=t,this.h("isTemporary",i,t))}),xh.defineProperty(Yi,{visible:"visible"},function(){return this.qz},function(t){var i=this.qz;if(i!==t){for(xh.j(t,"boolean",Yi,"visible"),this.qz=t,this.h("visible",i,t),i=this.zb.i;i.next();)i.value.rd(t);null!==(t=this.g)&&t.qa()}}),xh.defineProperty(Yi,{Cg:"pickable"},function(){return this.Yk},function(t){var i=this.Yk;i!==t&&(xh.j(t,"boolean",Yi,"pickable"),this.Yk=t,this.h("pickable",i,t))}),xh.defineProperty(Yi,{BE:"isBoundsIncluded"},function(){return this.Ly},function(t){this.Ly!==t&&(this.Ly=t,null!==this.g&&this.g.pc())}),xh.defineProperty(Yi,{Xj:"allowCopy"},function(){return this.nk},function(t){var i=this.nk;i!==t&&(xh.j(t,"boolean",Yi,"allowCopy"),this.nk=t,this.h("allowCopy",i,t))}),xh.defineProperty(Yi,{Hm:"allowDelete"},function(){return this.ok},function(t){var i=this.ok;i!==t&&(xh.j(t,"boolean",Yi,"allowDelete"),this.ok=t,this.h("allowDelete",i,t))}),xh.defineProperty(Yi,{Aw:"allowTextEdit"},function(){return this.xk},function(t){var i=this.xk;i!==t&&(xh.j(t,"boolean",Yi,"allowTextEdit"),this.xk=t,this.h("allowTextEdit",i,t))}),xh.defineProperty(Yi,{xw:"allowGroup"},function(){return this.pk},function(t){var i=this.pk;i!==t&&(xh.j(t,"boolean",Yi,"allowGroup"),this.pk=t,this.h("allowGroup",i,t))}),xh.defineProperty(Yi,{Bw:"allowUngroup"},function(){return this.yk},function(t){var i=this.yk;i!==t&&(xh.j(t,"boolean",Yi,"allowUngroup"),this.yk=t,this.h("allowUngroup",i,t))}),xh.defineProperty(Yi,{at:"allowLink"},function(){return this.qk},function(t){var i=this.qk;i!==t&&(xh.j(t,"boolean",Yi,"allowLink"),this.qk=t,this.h("allowLink",i,t))}),xh.defineProperty(Yi,{Im:"allowRelink"},function(){return this.sk},function(t){var i=this.sk;i!==t&&(xh.j(t,"boolean",Yi,"allowRelink"),this.sk=t,this.h("allowRelink",i,t))}),xh.defineProperty(Yi,{fl:"allowMove"},function(){return this.rk},function(t){var i=this.rk;i!==t&&(xh.j(t,"boolean",Yi,"allowMove"),this.rk=t,this.h("allowMove",i,t))}),xh.defineProperty(Yi,{yw:"allowReshape"},function(){return this.tk},function(t){var i=this.tk;i!==t&&(xh.j(t,"boolean",Yi,"allowReshape"),this.tk=t,this.h("allowReshape",i,t))}),xh.defineProperty(Yi,{bt:"allowResize"},function(){return this.uk},function(t){var i=this.uk;i!==t&&(xh.j(t,"boolean",Yi,"allowResize"),this.uk=t,this.h("allowResize",i,t))}),xh.defineProperty(Yi,{zw:"allowRotate"},function(){return this.vk},function(t){var i=this.vk;i!==t&&(xh.j(t,"boolean",Yi,"allowRotate"),this.vk=t,this.h("allowRotate",i,t))}),xh.defineProperty(Yi,{pf:"allowSelect"},function(){return this.wk},function(t){var i=this.wk;i!==t&&(xh.j(t,"boolean",Yi,"allowSelect"),this.wk=t,this.h("allowSelect",i,t))}),xh.ea("Diagram",Qi),Qi.prototype.toString=function(t){void 0===t&&(t=0);var i="";if(this.id&&(i=this.id),this.ol&&this.ol.id&&(i=this.ol.id),i='Diagram "'+i+'"',0>=t)return i;for(var e=this.Yb.i;e.next();)i+="\n  "+e.value.toString(t-1);return i},Qi.fromDiv=function(i){var e=i;return"string"==typeof i&&(e=t.document.getElementById(i)),e instanceof HTMLDivElement&&e.U instanceof Qi?e.U:null},xh.defineProperty(Qi,{ol:"div"},function(){return this.Mb},function(i){if(null!==i&&xh.A(i,HTMLDivElement,Qi,"div"),this.Mb!==i){pf=[];var e=this.Mb;null!==e?(e.U=void 0,e.innerHTML="",null!==this.ub&&(this.ub.removeEventListener("touchstart",this.JF,!1),this.ub.removeEventListener("touchmove",this.IF,!1),this.ub.removeEventListener("touchend",this.HF,!1),this.ub.Od.U=null),null!==(e=this.cb)&&(e.Qe.each(function(t){t.cancelWaitAfter()}),e.Vf.each(function(t){t.cancelWaitAfter()}),e.Wf.each(function(t){t.cancelWaitAfter()})),e.cancelWaitAfter(),this.Ya.doCancel(),this.zh=this.ub=null,t.removeEventListener("resize",this.TF,!1),t.removeEventListener("mousemove",this.xp,!0),t.removeEventListener("mousedown",this.wp,!0),t.removeEventListener("mouseup",this.zp,!0),t.removeEventListener("mousewheel",this.hh,!0),t.removeEventListener("DOMMouseScroll",this.hh,!0),t.removeEventListener("mouseout",this.yp,!0)):this.Ng=!1,this.Mb=null,null!==i&&((e=i.U)&&(e.ol=null),vn(this,i),this.AA())}}),Qi.prototype.computePixelRatio=function(){return null!==this.Pj?this.Pj:this.oG},Qi.prototype.doMouseMove=function(){this.Ya.doMouseMove()},Qi.prototype.doMouseDown=function(){this.Ya.doMouseDown()},Qi.prototype.doMouseUp=function(){this.Ya.doMouseUp()},Qi.prototype.doMouseWheel=function(){this.Ya.doMouseWheel()},Qi.prototype.doKeyDown=function(){this.Ya.doKeyDown()},Qi.prototype.doKeyUp=function(){this.Ya.doKeyUp()},Qi.prototype.focus=Qi.prototype.focus=function(){this.ub&&this.ub.focus()},Qi.prototype.qG=function(){this.U.isEnabled?this.U.sH(this):Ne(this.U)},Qi.prototype.GC=function(t){this.U.isEnabled?(this.U.cz=!0,this.U.ez=t.target.scrollTop,this.U.dz=t.target.scrollLeft):Ne(this.U)},Qi.prototype.diagramScroll=Qi.prototype.sH=function(t){if(this.cz&&null!==this.ub){this.$v=!0;var i,e=this.Bd,n=this.tb,o=e.width,r=n.width,s=e.height,a=n.height,h=e.right,l=n.right,u=e.bottom,f=n.bottom,c=e.x,p=n.x,e=e.y,n=n.y,d=this.scale;r<o||a<s?(i=xh.Ob(this.position.x,this.position.y),this.ne&&this.dz!==t.scrollLeft&&(i.x=t.scrollLeft/d+c,this.dz=t.scrollLeft),this.oe&&this.ez!==t.scrollTop&&(i.y=t.scrollTop/d+e,this.ez=t.scrollTop),this.position=i,xh.v(i),this.bm=this.$v=!1):(i=xh.M(),t.uG&&this.ne&&(c<p&&(this.position=i.m(t.scrollLeft+c,this.position.y)),h>l&&(this.position=i.m(-(this.dw.scrollWidth-this.Gb)+t.scrollLeft-this.Gb/d+this.Bd.right,this.position.y))),t.vG&&this.oe&&(e<n&&(this.position=i.m(this.position.x,t.scrollTop+e)),u>f&&(this.position=i.m(this.position.x,-(this.dw.scrollHeight-this.Lb)+t.scrollTop-this.Lb/d+this.Bd.bottom))),xh.v(i),Me(this),this.bm=this.$v=!1,e=this.Bd,n=this.tb,h=e.right,l=n.right,u=e.bottom,f=n.bottom,c=e.x,p=n.x,e=e.y,n=n.y,r>=o&&c>=p&&h<=l&&(this.os.style.width="1px"),a>=s&&e>=n&&u<=f&&(this.os.style.height="1px"))}},Qi.prototype.computeBounds=Qi.prototype.Zg=function(){return 0<this.eg.count&&ve(this),ne(this)},Qi.prototype.computePartsBounds=function(t){var i=null;for(t=t.i;t.next();){var e=t.value;e instanceof zr||(e.rf(),null===i?i=e.Y.copy():i.ei(e.Y))}return null===i?new M(NaN,NaN,0,0):i},Qi.prototype.zoomToFit=Qi.prototype.zoomToFit=function(){this.scale=re(this,ru)},Qi.prototype.zoomToRect=function(t,i){void 0===i&&(i=ru);var e=t.width,n=t.height;if(!(0===e||0===n||isNaN(e)&&isNaN(n))){o=1;if(i===ru||i===su)if(isNaN(e))o=this.tb.height*this.scale/n;else if(isNaN(n))o=this.tb.width*this.scale/e;else var o=this.Gb,r=this.Lb,o=i===su?r/n>o/e?(r-(this.sj?this.yd:0))/n:(o-(this.Hk?this.yd:0))/e:Math.min(r/n,o/e);this.scale=o,this.position=new b(t.x,t.y)}},xh.defineProperty(Qi,{Yz:null},function(){return this.Pc},function(t){this.Pc=t}),Qi.prototype.alignDocument=function(t,i){this.tj&&$e(this,this.Zg());var e=this.Bd,n=this.tb;this.position=new b(e.x+(t.x*e.width+t.offsetX)-(i.x*n.width-i.offsetX),e.y+(t.y*e.height+t.offsetY)-(i.y*n.height-i.offsetY))},Qi.prototype.findPartAt=Qi.prototype.rt=function(t,i){var e=i?ae(this,t,function(t){return t.aa},function(t){return t.canSelect()}):ae(this,t,function(t){return t.aa});return e instanceof tr?e:null},Qi.prototype.findObjectAt=Qi.prototype.re=function(t,i,e){void 0===i&&(i=null),void 0===e&&(e=null),ve(this);for(var n=this.Yb.cn;n.next();){var o=n.value;if(o.visible&&null!==(o=o.re(t,i,e)))return o}return null},Qi.prototype.findObjectsAt=Qi.prototype.qt=function(t,i,e,n){void 0===i&&(i=null),void 0===e&&(e=null),n instanceof u||n instanceof c||(n=new c(Mn)),ve(this);for(var o=this.Yb.cn;o.next();){var r=o.value;r.visible&&r.qt(t,i,e,n)}return n},Qi.prototype.findObjectsIn=Qi.prototype.bk=function(t,i,e,n,o){void 0===i&&(i=null),void 0===e&&(e=null),void 0===n&&(n=!1),o instanceof u||o instanceof c||(o=new c(Mn)),ve(this);for(var r=this.Yb.cn;r.next();){var s=r.value;s.visible&&s.bk(t,i,e,n,o)}return o},Qi.prototype.Oz=function(t,i,e,n,o,r){var s=new c(Mn);ve(this);for(var a=this.Yb.cn;a.next();){var h=a.value;h.visible&&h.Oz(t,i,e,n,s,o,r)}return s},Qi.prototype.findObjectsNear=Qi.prototype.Vm=function(t,i,e,n,o,r){void 0===e&&(e=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof u||o instanceof c)&&(r=o),o=!0),r instanceof u||r instanceof c||(r=new c(Mn)),ve(this);for(var s=this.Yb.cn;s.next();){var a=s.value;a.visible&&a.Vm(t,i,e,n,o,r)}return r},Qi.prototype.acceptEvent=function(t){var i=this.Sc;return this.Sc=this.Pb,this.Pb=i,he(this,this,t,i,t instanceof MouseEvent),i},Qi.prototype.mI=function(t){if(!this.U.isEnabled)return!1;var i=this.U.Pb;switch(he(this.U,this.U,t,i,!1),i.key=String.fromCharCode(t.which),i.pl=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del";break;case 48:i.key="0";break;case 187:case 61:case 107:i.key="Add";break;case 189:case 173:case 109:i.key="Subtract";break;case 27:i.key="Esc"}return this.U.doKeyDown(),187!==t.which&&189!==t.which&&48!==t.which&&107!==t.which&&109!==t.which&&61!==t.which&&173!==t.which||!0!==t.ctrlKey?fe(i,t):(t.cancelBubble=!0,t.preventDefault(),t.stopPropagation(),!1)},Qi.prototype.nI=function(t){if(!this.U.isEnabled)return!1;var i=this.U.Pb;switch(he(this.U,this.U,t,i,!1),i.key=String.fromCharCode(t.which),i.up=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del";break;case 93:t.preventDefault()}return this.U.doKeyUp(),fe(i,t)},Qi.prototype.Vq=function(t){if(null===(n=this.ub))return new b(0,0);var i=this.Gb,e=this.Lb,n=n.getBoundingClientRect(),i=t.clientX-i/n.width*n.left;return t=t.clientY-e/n.height*n.top,null!==this.me?(t=new b(i,t),w(t,this.me),t):new b(i,t)},Qi.prototype.invalidateDocumentBounds=Qi.prototype.pc=function(){this.tj||(this.tj=!0,this.Re(!0))},Qi.prototype.redraw=Qi.prototype.AA=function(){this.Pc||this.Kd||(this.qa(),ke(this),Me(this),this.pc(),this.Uf())},Qi.prototype.isUpdateRequested=function(){return this.Lf},Qi.prototype.delayInitialization=function(t){void 0===t&&(t=null);var i=this.Sa,e=i.isEnabled;i.ci(),i.isEnabled=!1,ye(this),this.Ng=!1,i.isEnabled=e,null!==t&&xh.setTimeout(t,1)},Qi.prototype.requestUpdate=Qi.prototype.Re=function(t){if(void 0===t&&(t=!1),!0!==this.Lf&&!(this.Pc||!1===t&&this.Kd)){this.Lf=!0;var i=this;requestAnimationFrame(function(){i.Lf&&i.Uf()})}},Qi.prototype.maybeUpdate=Qi.prototype.Uf=function(){this.Sn&&!this.Lf||(this.Sn&&(this.Sn=!1),ye(this))},xh.u(Qi,{bn:null},function(){return this.Ng}),Qi.prototype.WA=function(t,i){for(t.reset();t.next();){var e=t.value;!e.Pd()||e instanceof vs||!e.isVisible()||(e.Dl()?(jn(e,1/0,1/0),e.Ec()):i.add(e))}for(t.reset();t.next();)(e=t.value)instanceof vs&&e.isVisible()&&ge(this,e);for(t.reset();t.next();)(e=t.value)instanceof zr&&e.isVisible()&&(e.Dl()?(jn(e,1/0,1/0),e.Ec()):i.add(e));for(t.reset();t.next();)(e=t.value)instanceof xr&&e.isVisible()&&(e.Dl()?(jn(e,1/0,1/0),e.Ec()):i.add(e))},Qi.prototype.zf=function(t,i,e,n){var o=this.Sa;if(this.Kk||o.uf)for(o=0;o<i;o++)t[o].zf(e,n)},Qi.prototype.$e=function(t,i){void 0===t&&(t=this.zh),void 0===i&&(i=null),null===this.Mb&&xh.k("No div specified");var e=this.ub;null===e&&xh.k("No canvas specified");a=this.Sa;if(!a.vc&&(Pe(this),"0"!==this.Mb.style.opacity)){var n=t!==this.zh,o=this.Yb.n,r=o.length,s=this;if(this.zf(o,r,s),n)te(this,t),Me(this);else if(!this.ke&&null===i&&!a.uj)return;var a,r=this.mb,h=this.Vb,l=Math.round(r.x*h)/h,u=Math.round(r.y*h)/h;for((a=this.me).reset(),1!==h&&a.scale(h),0===r.x&&0===r.y||a.translate(-l,-u),h=this.He,xh.an?(e.width=e.width,te(this,t),t.scale(h,h)):(t.setTransform(1,0,0,1,0,0),t.scale(h,h),t.clearRect(0,0,this.Gb,this.Lb)),t.setTransform(1,0,0,1,0,0),t.scale(h,h),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),e=null!==i?function(e){var n=t,o=i;if(e.visible&&0!==e.Rc){var r=e.zb.n,a=r.length;if(0!==a){1!==e.Rc&&(n.globalAlpha=e.Rc),(e=e.Qv).length=0;for(var h=s.scale,l=0;l<a;l++){var u=r[l];if(dr(u)&&!o.contains(u)){if(u instanceof zr){var f=u;if(f.kc&&e.push(f),!1===f.Mf)continue}1<(f=u.Y).width*h||1<f.height*h?u.$e(n,s):lr(u,n)}}n.globalAlpha=1}}}:function(i){i.$e(t,s)},xe(this,t),r=o.length,l=0;l<r;l++)t.setTransform(1,0,0,1,0,0),t.scale(h,h),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),e(o[l]);this.Ik?this.Ik.Rl(this)&&this.iy():this.Vq=function(){return new b(0,0)},n?(te(this),Me(this)):this.ke=this.Kk=!1}},Qi.prototype.getRenderingHint=Qi.prototype.ek=function(t){return this.Ij[t]},Qi.prototype.setRenderingHint=Qi.prototype.nJ=function(t,i){this.Ij[t]=i,this.AA()},Qi.prototype.resetRenderingHints=Qi.prototype.hF=function(){this.Ij=new n,this.Ij.drawShadows=!0,this.Ij.textGreeking=!0,this.Ij.viewportOptimizations=!xh.FE,this.Ij.temporaryPixelRatio=!0,this.Ij.pictureRatioOptimization=!0},Qi.prototype.getInputOption=Qi.prototype.hp=function(t){return this.Zn[t]},Qi.prototype.setInputOption=function(t,i){this.Zn[t]=i},Qi.prototype.resetInputOptions=Qi.prototype.gF=function(){this.Zn=new n,this.Zn.extraTouchArea=10,this.Zn.extraTouchThreshold=10,this.Zn.hasGestureZoom=!0},Qi.prototype.setProperties=function(t){xh.hu(this,t)},Qi.prototype.qa=function(t){if(void 0===t&&(t=null),null===t)this.ke=!0,this.Re();else{var i=this.tb;null!==t&&t.K()&&i.xg(t)&&(this.ke=!0,this.Re())}for(i=this.Rv.i;i.next();)i.value.qa(t)},Qi.prototype.zE=function(t,i){if(!0!==this.ke){this.ke=!0;var e=!0===this.ek("temporaryPixelRatio");if(!0===this.ek("viewportOptimizations")&&this.GA!==du&&this.oF.Pw(0,0,0,0)&&i.width===t.width&&i.height===t.height){var n=this.scale,o=xh.ag(),r=Math.max(t.x,i.x),s=Math.max(t.y,i.y),a=Math.min(t.x+t.width,i.x+i.width),h=Math.min(t.y+t.height,i.y+i.height);if(o.x=r,o.y=s,o.width=Math.max(0,a-r)*n,o.height=Math.max(0,h-s)*n,0<o.width&&0<o.height){if(!this.Kd&&(this.Lf=!1,null!==this.Mb)){this.Kd=!0,we(this),this.Bd.K()||$e(this,this.Zg());if(null!==(v=this.ub)){var l=this.He,s=this.Gb*l,a=this.Lb*l,r=this.scale*l,n=Math.round(Math.round(i.x*r)-Math.round(t.x*r)),r=Math.round(Math.round(i.y*r)-Math.round(t.y*r)),h=this.yy,u=this.ZB;h.width!==s&&(h.width=s),h.height!==a&&(h.height=a),u.clearRect(0,0,s,a);var h=190*this.He,f=70*this.He,c=Math.max(n,0),p=Math.max(r,0),d=Math.floor(s-c),y=Math.floor(a-p);u.xE=!1,u.drawImage(v.Od,c,p,d,y,0,0,d,y),this.Ik.Rl(this)&&u.clearRect(0,0,h,f);var v=xh.lb(),u=xh.lb(),y=Math.abs(n),d=Math.abs(r),g=0===c?0:s-y,c=xh.Ob(g,0),y=xh.Ob(y+g,a);u.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y)));var m=this.me;m.reset(),m.scale(l,l),1!==this.Vb&&m.scale(this.Vb),(0!==(l=this.mb).x||0!==l.y)&&isFinite(l.x)&&isFinite(l.y)&&m.translate(-l.x,-l.y),w(c,m),w(y,m),v.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y))),g=0===p?0:a-d,c.m(0,g),y.m(s,d+g),u.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y))),w(c,m),w(y,m),v.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y))),this.Ik.Rl(this)&&(s=0<n?0:-n,a=0<r?0:-r,c.m(s,a),y.m(h+s,f+a),u.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y))),w(c,m),w(y,m),v.push(new M(Math.min(c.x,y.x),Math.min(c.y,y.y),Math.abs(c.x-y.x),Math.abs(c.y-y.y)))),xh.v(c),xh.v(y),de(this,!1),me(this,v,u,n,r),xh.ta(v),xh.ta(u),this.Kd=!1}}}else this.Uf();xh.ic(o),e&&(this.Pj=1,this.Uf(),this.Pj=null,this.BA())}else e?(this.Pj=1,this.Uf(),this.Pj=null,this.BA()):this.Uf()}},Qi.prototype.add=Qi.prototype.add=function(t){xh.A(t,tr,Qi,"add:part");i=t.g;if(i!==this){null!==i&&xh.k("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+i.toString()),this.bq&&(t.Nk="Tool");var i,e=t.Tf;null===(i=this.nt(e))&&(i=this.nt("")),null===i&&xh.k('Cannot add a Part when unable find a Layer named "'+e+'" and there is no default Layer'),t.layer!==i&&(0<=(e=i.lp(99999999,t,t.g===this))&&this.Lc(Ml,"parts",i,null,t,null,e),i.Gc||this.pc(),t.H(yf),null!==(e=t.Jt)&&e(t,null,i))}},Qi.prototype.lp=function(t){if(t instanceof wr){if(this.ro.add(t),t instanceof vs){var i=t.Ta;null===i?this.$k.add(t):i.oo.add(t),null!==(i=t.Rb)&&(i.g=this)}}else t instanceof zr?this.ko.add(t):t instanceof xr||this.zb.add(t);var e=this;lo(t,function(t){qe(e,t)}),t.Ib&&t.Q(),null!==(i=t.data)&&(t instanceof xr||(t instanceof zr?this.Ck.add(i,t):this.oi.add(i,t)),lo(t,function(t){ze(e,t)})),!0!==Xn(t)&&!0!==fr(t)||this.eg.add(t),hr(t,!0,this),br(t)?(t.Y.K()&&this.qa(rr(t,t.Y)),this.pc()):t.isVisible()&&t.Y.K()&&this.qa(rr(t,t.Y)),this.Re()},Qi.prototype.Oe=function(t){if(t.et(),t instanceof wr){if(this.ro.remove(t),t instanceof vs){var i=t.Ta;null===i?this.$k.remove(t):i.oo.remove(t),null!==(i=t.Rb)&&(i.g=null)}}else t instanceof zr?this.ko.remove(t):t instanceof xr||this.zb.remove(t);var e=this;lo(t,function(t){Ee(e,t)}),null!==(i=t.data)&&(t instanceof xr||(t instanceof zr?this.Ck.remove(i):this.oi.remove(i)),lo(t,function(t){Oe(e,t)})),this.eg.remove(t),br(t)?(t.Y.K()&&this.qa(rr(t,t.Y)),this.pc()):t.isVisible()&&t.Y.K()&&this.qa(rr(t,t.Y)),this.Re()},Qi.prototype.remove=Qi.prototype.remove=function(t){xh.A(t,tr,Qi,"remove:part"),t.jb=!1,t.dh=!1;var i=t.layer;if(null!==i&&i.g===this){t.H(vf),t.Um();var e=i.Oe(-1,t,!1);0<=e&&this.Lc(Pl,"parts",i,t,null,e,null),null!==(e=t.Jt)&&e(t,i,null)}},Qi.prototype.removeParts=Qi.prototype.DA=function(t,i){if(xh.isArray(t))for(var e=xh.Xa(t),n=0;n<e;n++){var o=xh.Pa(t,n);i&&!o.canDelete()||this.remove(o)}else for((o=new c(tr)).Tc(t),e=o.i;e.next();)o=e.value,i&&!o.canDelete()||this.remove(o)},Qi.prototype.copyParts=Qi.prototype.Xo=function(t,i,e){return this.ob.Xo(t,i,e)},Qi.prototype.moveParts=Qi.prototype.moveParts=function(t,i,e){xh.A(i,b,Qi,"moveParts:offset");var n=this.cb;if(null!==n){null===(n=n.Zd)&&(n=new qt).Mc(this);var o=new m(tr,Object);if(null!==t)t=t.i;else{for(t=this.ik;t.next();)It(n,o,t.value,e);for(t=this.Ag;t.next();)It(n,o,t.value,e);t=this.links}for(;t.next();)It(n,o,t.value,e);n.moveParts(o,i,e)}},Qi.prototype.addLayer=Qi.prototype.Vs=function(t){Ce(this,t,null),t.Mc(this);var i=this.Yb,e=i.count-1;if(!t.Gc)for(;0<=e&&i.ha(e).Gc;)e--;i.Cd(e+1,t),null!==this.Vd&&this.Lc(Ml,"layers",this,null,t,null,e+1),this.qa(),this.pc()},Qi.prototype.addLayerBefore=Qi.prototype.IG=function(t,i){Ce(this,t,i),t.Mc(this);var e=this.Yb,n=e.indexOf(t);0<=n&&(e.remove(t),null!==this.Vd&&this.Lc(Pl,"layers",this,t,null,n,null));for(var o=e.count,r=0;r<o;r++)if(e.ha(r)===i){e.Cd(r,t);break}null!==this.Vd&&this.Lc(Ml,"layers",this,null,t,null,r),this.qa(),0>n&&this.pc()},Qi.prototype.addLayerAfter=function(t,i){Ce(this,t,i),t.Mc(this);var e=this.Yb,n=e.indexOf(t);0<=n&&(e.remove(t),null!==this.Vd&&this.Lc(Pl,"layers",this,t,null,n,null));for(var o=e.count,r=0;r<o;r++)if(e.ha(r)===i){e.Cd(r+1,t);break}null!==this.Vd&&this.Lc(Ml,"layers",this,null,t,null,r+1),this.qa(),0>n&&this.pc()},Qi.prototype.removeLayer=function(t){if(xh.A(t,Yi,Qi,"removeLayer:layer"),t.g!==this&&xh.k("Cannot remove a Layer from another Diagram: "+t+" of "+t.g),""!==t.name){var i=this.Yb,e=i.indexOf(t);if(i.remove(t)){for(i=t.zb.copy().i;i.next();){var n=i.value,o=n.Tf;n.Tf=o!==t.name?o:""}null!==this.Vd&&this.Lc(Pl,"layers",this,t,null,e,null),this.qa(),this.pc()}}},Qi.prototype.findLayer=Qi.prototype.nt=function(t){for(var i=this.kx;i.next();){var e=i.value;if(e.name===t)return e}return null},Qi.prototype.addModelChangedListener=Qi.prototype.KG=function(t){xh.j(t,"function",Qi,"addModelChangedListener:listener"),null===this.Og&&(this.Og=new u("function")),this.Og.add(t),this.Z.Gm(t)},Qi.prototype.removeModelChangedListener=function(t){xh.j(t,"function",Qi,"removeModelChangedListener:listener"),null!==this.Og&&(this.Og.remove(t),0===this.Og.count&&(this.Og=null)),this.Z.Zt(t)},Qi.prototype.addChangedListener=Qi.prototype.Gm=function(t){xh.j(t,"function",Qi,"addChangedListener:listener"),null===this.ii&&(this.ii=new u("function")),this.ii.add(t)},Qi.prototype.removeChangedListener=Qi.prototype.Zt=function(t){xh.j(t,"function",Qi,"removeChangedListener:listener"),null!==this.ii&&(this.ii.remove(t),0===this.ii.count&&(this.ii=null))},Qi.prototype.Fw=function(t){if(this.wb||this.ma.uE(t),t.xc!==wl&&(this.bi=!0),null!==this.ii){var i=this.ii,e=i.length;if(1===e)(i=i.ha(0))(t);else if(0!==e)for(var n=i.dc(),o=0;o<e;o++)(i=n[o])(t)}},Qi.prototype.raiseChangedEvent=Qi.prototype.Lc=function(t,i,e,n,o,r,s){void 0===r&&(r=null),void 0===s&&(s=null);var a=new et;a.g=this,a.xc=t,a.propertyName=i,a.object=e,a.oldValue=n,a.Bg=r,a.newValue=o,a.zg=s,this.Fw(a)},Qi.prototype.raiseChanged=Qi.prototype.h=function(t,i,e,n,o){this.Lc(kl,t,this,i,e,n,o)},xh.u(Qi,{Sa:"animationManager"},function(){return this.pB}),xh.u(Qi,{ma:"undoManager"},function(){return this.Vd.ma}),xh.defineProperty(Qi,{wb:"skipsUndoManager"},function(){return this.Ki},function(t){xh.j(t,"boolean",Qi,"skipsUndoManager"),this.Ki=t,this.Vd.Ki=t}),xh.defineProperty(Qi,{Kz:"delaysLayout"},function(){return this.uy},function(t){this.uy=t}),Qi.prototype.Lm=function(t,i){if(null!==t&&t.g===this){var e=this.we;try{this.we=!0;var n=t.xc;if(n===kl){var o=t.object,r=t.propertyName,s=t.ka(i);if(xh.Ka(o,r,s),o instanceof Mn){var a;null!==(p=o.aa)&&p.be()}this.bi=!0}else if(n===Ml){var h=t.object,l=t.zg,o=t.newValue;if(h instanceof eo){if("number"==typeof l&&o instanceof Mn){a=o;f=h;i?f.Oe(l):f.Cd(l,a),null!==(p=h.aa)&&p.be()}else if("number"==typeof l&&o instanceof Mo){var u=o,f=h;i?u.de?f.fF(l):f.bF(l):(u.de?f.dd(u.index):f.cd(u.index)).it(u)}}else if(h instanceof Yi){var c=!0===t.Bg;if("number"==typeof l&&o instanceof tr){var p=o,d=h;i?(p.be(),d.Oe(c?l:-1,p,c)):d.lp(l,p,c)}}else if(h instanceof Qi){if("number"==typeof l&&o instanceof Yi){var y=o;i?this.Yb.Vc(l):((n=y).Mc(this),this.Yb.Cd(l,n))}}else xh.k("unknown ChangedEvent.Insert object: "+t.toString());this.bi=!0}else n===Pl?(h=t.object,l=t.Bg,o=t.oldValue,h instanceof eo?"number"==typeof l&&o instanceof Mn?(f=h,i?f.Cd(l,o):f.Oe(l)):"number"==typeof l&&o instanceof Mo&&(u=o,f=h,i?(u.de?f.dd(u.index):f.cd(u.index)).it(u):u.de?f.fF(l):f.bF(l)):h instanceof Yi?(c=!0===t.zg,"number"==typeof l&&o instanceof tr&&(p=o,d=h,i?d.lp(l,p,c):(p.be(),d.Oe(c?l:-1,p,c)))):h instanceof Qi?"number"==typeof l&&o instanceof Yi&&(y=o,i?((n=y).Mc(this),this.Yb.Cd(l,n)):this.Yb.Vc(l)):xh.k("unknown ChangedEvent.Remove object: "+t.toString()),this.bi=!0):n!==wl&&xh.k("unknown ChangedEvent: "+t.toString())}finally{this.we=e}}},Qi.prototype.startTransaction=Qi.prototype.Sb=function(t){return this.ma.Sb(t)},Qi.prototype.commitTransaction=Qi.prototype.Ad=function(t){return this.ma.Ad(t)},Qi.prototype.rollbackTransaction=Qi.prototype.Ip=function(){return this.ma.Ip()},Qi.prototype.updateAllTargetBindings=Qi.prototype.QF=function(t){void 0===t&&(t="");for(var i=this.ik;i.next();)i.value.Jb(t);for(i=this.Ag;i.next();)i.value.Jb(t);for(i=this.links;i.next();)i.value.Jb(t)},Qi.prototype.updateAllRelationshipsFromData=Qi.prototype.GJ=function(){if(0<arguments.length){for(var t=this.Z,i=new c,e=new c,n=t.Yf,o=0;o<n.length;o++){var r=n[o];e.add(r);var s=this.ug(r);null===s?(vt(t,r,!1),i.add(this.ug(r))):i.add(s)}if(t instanceof wt){for(var i=new c,a=new c,n=t.yg,o=0;o<n.length;o++)r=n[o],a.add(r),null===(s=this.sf(r))?(kt(t,r,!1),i.add(this.sf(r))):i.add(s);var h=[];this.links.each(function(t){null===t.data||a.contains(t.data)||h.push(t.data)}),We(this,h)}var l=[];this.Ag.each(function(t){null===t.data||e.contains(t.data)||l.push(t.data)}),this.ik.each(function(t){null===t.data||e.contains(t.data)||l.push(t.data)}),We(this,l)}for(t=this.ik;t.next();)(s=t.value).updateRelationshipsFromData();for(t=this.Ag;t.next();)t.value.updateRelationshipsFromData();for(t=this.links;t.next();)(s=t.value).updateRelationshipsFromData()},Qi.prototype.Wt=function(t,i,e){if(!t.L(i)){void 0===e&&(e=!1),e||ke(this),Me(this);var n=this.Rb;null===n||!n.hx||this.gl!==ou||e||t.width===i.width&&t.height===i.height||n.H(),n=this.Ya,!0===this.dm&&n instanceof Di&&(this.P.da=this.OF(this.P.lf),n.doMouseMove()),this.Pc||this.zE(t,i),Le(this),this.Ba("ViewportBoundsChanged",e?xh.vh:null,t)}},Qi.prototype.clearSelection=Qi.prototype.Gw=function(){var t=0<this.selection.count;t&&this.Ba("ChangingSelection"),De(this),t&&this.Ba("ChangedSelection")},Qi.prototype.select=Qi.prototype.select=function(t){null!==t&&(xh.A(t,tr,Qi,"select:part"),t.layer.g===this&&(!t.jb||1<this.selection.count)&&(this.Ba("ChangingSelection"),De(this),t.jb=!0,this.Ba("ChangedSelection")))},Qi.prototype.selectCollection=Qi.prototype.sF=function(t){if(this.Ba("ChangingSelection"),De(this),xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++){var n=xh.Pa(t,e);n instanceof tr||xh.k("Diagram.selectCollection given something that is not a Part: "+n),n.jb=!0}else for(t=t.i;t.next();)(n=t.value)instanceof tr||xh.k("Diagram.selectCollection given something that is not a Part: "+n),n.jb=!0;this.Ba("ChangedSelection")},Qi.prototype.clearHighlighteds=Qi.prototype.MD=function(){var t=this.Zm;if(0<t.count){for(var i=t.dc(),e=i.length,n=0;n<e;n++)i[n].dh=!1;t.Oa(),t.clear(),t.freeze()}},Qi.prototype.highlight=function(t){null!==t&&t.layer.g===this&&(xh.A(t,tr,Qi,"highlight:part"),!t.dh||1<this.Zm.count)&&(this.MD(),t.dh=!0)},Qi.prototype.highlightCollection=function(t){if(this.MD(),xh.isArray(t))for(var i=xh.Xa(t),e=0;e<i;e++){var n=xh.Pa(t,e);n instanceof tr||xh.k("Diagram.highlightCollection given something that is not a Part: "+n),n.dh=!0}else for(t=t.i;t.next();)(n=t.value)instanceof tr||xh.k("Diagram.highlightCollection given something that is not a Part: "+n),n.dh=!0},Qi.prototype.scroll=Qi.prototype.scroll=function(t,i,e){void 0===e&&(e=1);var n="up"===i||"down"===i,o=0;if("pixel"===t)o=e;else if("line"===t)o=e*(n?this.eu:this.du);else if("page"===t)t=n?this.tb.height:this.tb.width,0!==(t*=this.scale)&&(o=Math.max(t-(n?this.eu:this.du),0),o*=e);else{if("document"===t)return o=this.Bd,n=this.tb,e=xh.M(),"up"===i?this.position=e.m(n.x,o.y):"left"===i?this.position=e.m(o.x,n.y):"down"===i?this.position=e.m(n.x,o.bottom-n.height):"right"===i&&(this.position=e.m(o.right-n.width,n.y)),void xh.v(e);xh.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t)}o/=this.scale,e=this.position.copy(),"up"===i?e.y=this.position.y-o:"down"===i?e.y=this.position.y+o:"left"===i?e.x=this.position.x-o:"right"===i?e.x=this.position.x+o:xh.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+i),this.position=e},Qi.prototype.scrollToRect=Qi.prototype.hJ=function(t){var i=this.tb;i.Zj(t)||(t=t.hl,t.x-=i.width/2,t.y-=i.height/2,this.position=t)},Qi.prototype.centerRect=Qi.prototype.UG=function(t){var i=this.tb;(t=t.hl).x-=i.width/2,t.y-=i.height/2,this.position=t},Qi.prototype.transformDocToView=Qi.prototype.MF=function(t){var i=this.me;i.reset(),1!==this.Vb&&i.scale(this.Vb);var e=this.mb;return(0!==e.x||0!==e.y)&&isFinite(e.x)&&isFinite(e.y)&&i.translate(-e.x,-e.y),t.copy().transform(this.me)},Qi.prototype.transformViewToDoc=Qi.prototype.OF=function(t){var i=this.me;i.reset(),1!==this.Vb&&i.scale(this.Vb);var e=this.mb;return(0!==e.x||0!==e.y)&&isFinite(e.x)&&isFinite(e.y)&&i.translate(-e.x,-e.y),w(t.copy(),this.me)};var ou;Qi.None=ou=xh.p(Qi,"None",0);var ru;Qi.Uniform=ru=xh.p(Qi,"Uniform",1);var su;Qi.UniformToFill=su=xh.p(Qi,"UniformToFill",2);var au;Qi.CycleAll=au=xh.p(Qi,"CycleAll",10);var hu;Qi.CycleNotDirected=hu=xh.p(Qi,"CycleNotDirected",11);var lu;Qi.CycleNotDirectedFast=lu=xh.p(Qi,"CycleNotDirectedFast",12);var uu;Qi.CycleNotUndirected=uu=xh.p(Qi,"CycleNotUndirected",13);var fu;Qi.CycleDestinationTree=fu=xh.p(Qi,"CycleDestinationTree",14);var cu;Qi.CycleSourceTree=cu=xh.p(Qi,"CycleSourceTree",15);var pu;Qi.DocumentScroll=pu=xh.p(Qi,"DocumentScroll",1);var du;Qi.InfiniteScroll=du=xh.p(Qi,"InfiniteScroll",2);var yu;Qi.TreeParentCollapsed=yu=xh.p(Qi,"TreeParentCollapsed",1),Qi.AllParentsCollapsed=xh.p(Qi,"AllParentsCollapsed",2),xh.defineProperty(Qi,{HJ:"validCycle"},function(){return this.rw},function(t){var i=this.rw;i!==t&&(xh.rb(t,Qi,Qi,"validCycle"),this.rw=t,this.h("validCycle",i,t))}),xh.u(Qi,{kx:"layers"},function(){return this.Yb.i}),xh.defineProperty(Qi,{wf:"isModelReadOnly"},function(){var t=this.Vd;return null!==t&&t.bb},function(t){var i=this.Vd;null!==i&&(i.bb=t)}),xh.defineProperty(Qi,{bb:"isReadOnly"},function(){return this.wi},function(t){var i=this.wi;i!==t&&(xh.j(t,"boolean",Qi,"isReadOnly"),this.wi=t,this.h("isReadOnly",i,t))}),xh.defineProperty(Qi,{isEnabled:"isEnabled"},function(){return this.Ue},function(t){var i=this.Ue;i!==t&&(xh.j(t,"boolean",Qi,"isEnabled"),this.Ue=t,this.h("isEnabled",i,t))}),xh.defineProperty(Qi,{wz:"allowClipboard"},function(){return this.zu},function(t){var i=this.zu;i!==t&&(xh.j(t,"boolean",Qi,"allowClipboard"),this.zu=t,this.h("allowClipboard",i,t))}),xh.defineProperty(Qi,{Xj:"allowCopy"},function(){return this.nk},function(t){var i=this.nk;i!==t&&(xh.j(t,"boolean",Qi,"allowCopy"),this.nk=t,this.h("allowCopy",i,t))}),xh.defineProperty(Qi,{Hm:"allowDelete"},function(){return this.ok},function(t){var i=this.ok;i!==t&&(xh.j(t,"boolean",Qi,"allowDelete"),this.ok=t,this.h("allowDelete",i,t))}),xh.defineProperty(Qi,{$s:"allowDragOut"},function(){return this.Au},function(t){var i=this.Au;i!==t&&(xh.j(t,"boolean",Qi,"allowDragOut"),this.Au=t,this.h("allowDragOut",i,t))}),xh.defineProperty(Qi,{CD:"allowDrop"},function(){return this.Bu},function(t){var i=this.Bu;i!==t&&(xh.j(t,"boolean",Qi,"allowDrop"),this.Bu=t,this.h("allowDrop",i,t))}),xh.defineProperty(Qi,{Aw:"allowTextEdit"},function(){return this.xk},function(t){var i=this.xk;i!==t&&(xh.j(t,"boolean",Qi,"allowTextEdit"),this.xk=t,this.h("allowTextEdit",i,t))}),xh.defineProperty(Qi,{xw:"allowGroup"},function(){return this.pk},function(t){var i=this.pk;i!==t&&(xh.j(t,"boolean",Qi,"allowGroup"),this.pk=t,this.h("allowGroup",i,t))}),xh.defineProperty(Qi,{Bw:"allowUngroup"},function(){return this.yk},function(t){var i=this.yk;i!==t&&(xh.j(t,"boolean",Qi,"allowUngroup"),this.yk=t,this.h("allowUngroup",i,t))}),xh.defineProperty(Qi,{Po:"allowInsert"},function(){return this.Du},function(t){var i=this.Du;i!==t&&(xh.j(t,"boolean",Qi,"allowInsert"),this.Du=t,this.h("allowInsert",i,t))}),xh.defineProperty(Qi,{at:"allowLink"},function(){return this.qk},function(t){var i=this.qk;i!==t&&(xh.j(t,"boolean",Qi,"allowLink"),this.qk=t,this.h("allowLink",i,t))}),xh.defineProperty(Qi,{Im:"allowRelink"},function(){return this.sk},function(t){var i=this.sk;i!==t&&(xh.j(t,"boolean",Qi,"allowRelink"),this.sk=t,this.h("allowRelink",i,t))}),xh.defineProperty(Qi,{fl:"allowMove"},function(){return this.rk},function(t){var i=this.rk;i!==t&&(xh.j(t,"boolean",Qi,"allowMove"),this.rk=t,this.h("allowMove",i,t))}),xh.defineProperty(Qi,{yw:"allowReshape"},function(){return this.tk},function(t){var i=this.tk;i!==t&&(xh.j(t,"boolean",Qi,"allowReshape"),this.tk=t,this.h("allowReshape",i,t))}),xh.defineProperty(Qi,{bt:"allowResize"},function(){return this.uk},function(t){var i=this.uk;i!==t&&(xh.j(t,"boolean",Qi,"allowResize"),this.uk=t,this.h("allowResize",i,t))}),xh.defineProperty(Qi,{zw:"allowRotate"},function(){return this.vk},function(t){var i=this.vk;i!==t&&(xh.j(t,"boolean",Qi,"allowRotate"),this.vk=t,this.h("allowRotate",i,t))}),xh.defineProperty(Qi,{pf:"allowSelect"},function(){return this.wk},function(t){var i=this.wk;i!==t&&(xh.j(t,"boolean",Qi,"allowSelect"),this.wk=t,this.h("allowSelect",i,t))}),xh.defineProperty(Qi,{DD:"allowUndo"},function(){return this.Eu},function(t){var i=this.Eu;i!==t&&(xh.j(t,"boolean",Qi,"allowUndo"),this.Eu=t,this.h("allowUndo",i,t))}),xh.defineProperty(Qi,{Cw:"allowZoom"},function(){return this.Gu},function(t){var i=this.Gu;i!==t&&(xh.j(t,"boolean",Qi,"allowZoom"),this.Gu=t,this.h("allowZoom",i,t))}),xh.defineProperty(Qi,{Vz:"hasVerticalScrollbar"},function(){return this.nv},function(t){var i=this.nv;i!==t&&(xh.j(t,"boolean",Qi,"hasVerticalScrollbar"),this.nv=t,ke(this),this.qa(),this.h("hasVerticalScrollbar",i,t),oe(this,!1))}),xh.defineProperty(Qi,{Uz:"hasHorizontalScrollbar"},function(){return this.mv},function(t){var i=this.mv;i!==t&&(xh.j(t,"boolean",Qi,"hasHorizontalScrollbar"),this.mv=t,ke(this),this.qa(),this.h("hasHorizontalScrollbar",i,t),oe(this,!1))}),xh.defineProperty(Qi,{ne:"allowHorizontalScroll"},function(){return this.Cu},function(t){var i=this.Cu;i!==t&&(xh.j(t,"boolean",Qi,"allowHorizontalScroll"),this.Cu=t,this.h("allowHorizontalScroll",i,t),oe(this,!1))}),xh.defineProperty(Qi,{oe:"allowVerticalScroll"},function(){return this.Fu},function(t){var i=this.Fu;i!==t&&(xh.j(t,"boolean",Qi,"allowVerticalScroll"),this.Fu=t,this.h("allowVerticalScroll",i,t),oe(this,!1))}),xh.defineProperty(Qi,{du:"scrollHorizontalLineChange"},function(){return this.aw},function(t){var i=this.aw;i!==t&&(xh.j(t,"number",Qi,"scrollHorizontalLineChange"),0>t&&xh.wa(t,">= 0",Qi,"scrollHorizontalLineChange"),this.aw=t,this.h("scrollHorizontalLineChange",i,t))}),xh.defineProperty(Qi,{eu:"scrollVerticalLineChange"},function(){return this.ew},function(t){var i=this.ew;i!==t&&(xh.j(t,"number",Qi,"scrollVerticalLineChange"),0>t&&xh.wa(t,">= 0",Qi,"scrollVerticalLineChange"),this.ew=t,this.h("scrollVerticalLineChange",i,t))}),xh.defineProperty(Qi,{P:"lastInput"},function(){return this.Pb},function(t){this.Pb=t}),xh.defineProperty(Qi,{yc:"firstInput"},function(){return this.ui},function(t){this.ui=t}),xh.defineProperty(Qi,{Zb:"currentCursor"},function(){return this.Uu},function(t){""===t&&(t=this.Gq),this.Uu!==t&&(xh.j(t,"string",Qi,"currentCursor"),null!==this.ub&&(this.Uu=t,this.ub.style.cursor=t,this.Mb.style.cursor=t))}),xh.defineProperty(Qi,{rK:"defaultCursor"},function(){return this.Gq},function(t){""===t&&(t="auto");var i=this.Gq;i!==t&&(xh.j(t,"string",Qi,"defaultCursor"),this.Gq=t,this.h("defaultCursor",i,t))}),xh.defineProperty(Qi,{click:"click"},function(){return this.ji},function(t){var i=this.ji;i!==t&&(null!==t&&xh.j(t,"function",Qi,"click"),this.ji=t,this.h("click",i,t))}),xh.defineProperty(Qi,{kt:"doubleClick"},function(){return this.si},function(t){var i=this.si;i!==t&&(null!==t&&xh.j(t,"function",Qi,"doubleClick"),this.si=t,this.h("doubleClick",i,t))}),xh.defineProperty(Qi,{Dz:"contextClick"},function(){return this.mi},function(t){var i=this.mi;i!==t&&(null!==t&&xh.j(t,"function",Qi,"contextClick"),this.mi=t,this.h("contextClick",i,t))}),xh.defineProperty(Qi,{mA:"mouseOver"},function(){return this.Fi},function(t){var i=this.Fi;i!==t&&(null!==t&&xh.j(t,"function",Qi,"mouseOver"),this.Fi=t,this.h("mouseOver",i,t))}),xh.defineProperty(Qi,{lA:"mouseHover"},function(){return this.Ei},function(t){var i=this.Ei;i!==t&&(null!==t&&xh.j(t,"function",Qi,"mouseHover"),this.Ei=t,this.h("mouseHover",i,t))}),xh.defineProperty(Qi,{kA:"mouseHold"},function(){return this.Di},function(t){var i=this.Di;i!==t&&(null!==t&&xh.j(t,"function",Qi,"mouseHold"),this.Di=t,this.h("mouseHold",i,t))}),xh.defineProperty(Qi,{II:"mouseDragOver"},function(){return this.Kv},function(t){var i=this.Kv;i!==t&&(null!==t&&xh.j(t,"function",Qi,"mouseDragOver"),this.Kv=t,this.h("mouseDragOver",i,t))}),xh.defineProperty(Qi,{jA:"mouseDrop"},function(){return this.Ci},function(t){var i=this.Ci;i!==t&&(null!==t&&xh.j(t,"function",Qi,"mouseDrop"),this.Ci=t,this.h("mouseDrop",i,t))}),xh.defineProperty(Qi,{TA:"toolTip"},function(){return this.Ni},function(t){var i=this.Ni;i!==t&&(null!==t&&xh.A(t,xr,Qi,"toolTip"),this.Ni=t,this.h("toolTip",i,t))}),xh.defineProperty(Qi,{contextMenu:"contextMenu"},function(){return this.ni},function(t){var i=this.ni;i!==t&&(null!==t&&xh.A(t,xr,Qi,"contextMenu"),this.ni=t,this.h("contextMenu",i,t))}),xh.defineProperty(Qi,{ob:"commandHandler"},function(){return this.ly},function(t){var i=this.ly;i!==t&&(xh.A(t,Lt,Qi,"commandHandler"),null!==t.g&&xh.k("Cannot share CommandHandlers between Diagrams: "+t.toString()),null!==i&&i.Mc(null),this.ly=t,t.Mc(this))}),xh.defineProperty(Qi,{cb:"toolManager"},function(){return this.nz},function(t){var i=this.nz;i!==t&&(xh.A(t,Di,Qi,"toolManager"),null!==t.g&&xh.k("Cannot share ToolManagers between Diagrams: "+t.toString()),null!==i&&i.Mc(null),this.nz=t,t.Mc(this))}),xh.defineProperty(Qi,{jt:"defaultTool"},function(){return this.ty},function(t){var i=this.ty;i!==t&&(xh.A(t,zt,Qi,"defaultTool"),this.ty=t,this.Ya===i&&(this.Ya=t))}),xh.defineProperty(Qi,{Ya:"currentTool"},function(){return this.py},function(t){var i=this.py;null!==i&&(i.ra&&i.doDeactivate(),i.cancelWaitAfter(),i.doStop()),null===t&&(t=this.jt),null!==t&&(xh.A(t,zt,Qi,"currentTool"),this.py=t,t.Mc(this),t.doStart())}),xh.u(Qi,{selection:"selection"},function(){return this.gw}),xh.defineProperty(Qi,{AI:"maxSelectionCount"},function(){return this.Gv},function(t){if((i=this.Gv)!==t)if(xh.j(t,"number",Qi,"maxSelectionCount"),0<=t&&!isNaN(t)){if(this.Gv=t,this.h("maxSelectionCount",i,t),!this.ma.kb&&0<(t=this.selection.count-t)){this.Ba("ChangingSelection");for(var i=this.selection.dc(),e=0;e<t;e++)i[e].jb=!1;this.Ba("ChangedSelection")}}else xh.wa(t,">= 0",Qi,"maxSelectionCount")}),xh.defineProperty(Qi,{LI:"nodeSelectionAdornmentTemplate"},function(){return this.Lv},function(t){var i=this.Lv;i!==t&&(xh.A(t,xr,Qi,"nodeSelectionAdornmentTemplate"),this.Lv=t,this.h("nodeSelectionAdornmentTemplate",i,t))}),xh.defineProperty(Qi,{QH:"groupSelectionAdornmentTemplate"},function(){return this.jv},function(t){var i=this.jv;i!==t&&(xh.A(t,xr,Qi,"groupSelectionAdornmentTemplate"),this.jv=t,this.h("groupSelectionAdornmentTemplate",i,t))}),xh.defineProperty(Qi,{uI:"linkSelectionAdornmentTemplate"},function(){return this.Cv},function(t){var i=this.Cv;i!==t&&(xh.A(t,xr,Qi,"linkSelectionAdornmentTemplate"),this.Cv=t,this.h("linkSelectionAdornmentTemplate",i,t))}),xh.u(Qi,{Zm:"highlighteds"},function(){return this.ov}),xh.defineProperty(Qi,{bi:"isModified"},function(){var t=this.ma;return t.isEnabled?null!==t.Vi||this.Py&&this.Lg!==t.Zi:this.Py},function(t){if(this.Py!==t){xh.j(t,"boolean",Qi,"isModified"),this.Py=t;var i=this.ma;!t&&i.isEnabled&&(this.Lg=i.Zi),t||Ae(this)}}),xh.defineProperty(Qi,{Z:"model"},function(){return this.Vd},function(t){var i=this.Vd;if(i!==t){xh.A(t,nt,Qi,"model"),this.Ya.doCancel(),null!==i&&i.ma!==t.ma&&i.ma.GE&&xh.k("Do not replace a Diagram.model while a transaction is in progress."),this.Sa.ci(),this.Gw(),this.Ng=!1,this.Sn=!0,this.Lg=-2,this.Lf=!1;var e=this.Kd;this.Kd=!0,this.Sa.jn("Model"),null!==i&&(null!==this.Og&&this.Og.each(function(t){i.Zt(t)}),i.Zt(this.CC),i instanceof wt&&We(this,i.yg),We(this,i.Yf)),this.Vd=t,t.Gm(this.BC),Re(this,t.Yf),t instanceof wt&&Ue(this,t.yg),t.Zt(this.BC),t.Gm(this.CC),null!==this.Og&&this.Og.each(function(i){t.Gm(i)}),this.Kd=e,this.Pc||this.qa(),null!==i&&(t.ma.isEnabled=i.ma.isEnabled)}}),xh.defineProperty(Qi,{Ra:null},function(){return this.uC},function(t){this.uC=t}),xh.u(Qi,{nx:null},function(){return this.kG}),xh.defineProperty(Qi,{we:"skipsModelSourceBindings"},function(){return this.XC},function(t){this.XC=t}),xh.defineProperty(Qi,{mu:null},function(){return this.hz},function(t){this.hz=t}),Qi.prototype.clear=Qi.prototype.clear=function(){var t=null;null!==this.ld&&(t=this.ld.aa),this.Z.clear();for(var i=this.Yb.length,e=0;e<i;e++)this.Yb.n[e].clear();this.eg.clear(),this.Dk.clear(),this.ro.clear(),this.$k.clear(),this.ko.clear(),this.zb.clear(),this.oi.clear(),this.Ck.clear(),this.gm.clear(),this.gw.Oa(),this.gw.clear(),this.gw.freeze(),this.ov.Oa(),this.ov.clear(),this.ov.freeze(),jl=this.En=null,Ll="",this.av=new M(NaN,NaN,NaN,NaN).freeze(),null!==t&&(this.add(t),this.zb.remove(t)),this.qa()},Qi.prototype.reset=Qi.prototype.reset=function(){this.Pc=!0,this.clear(),this.Yb=new u(Yi),this.hF(),this.gF(),this.mb=new b(NaN,NaN).freeze(),this.Vb=1,this.qv=new b(NaN,NaN).freeze(),this.rv=NaN,this.Hv=1e-4,this.Fv=100,this.uw=new b(NaN,NaN).freeze(),this.hv=new M(NaN,NaN,NaN,NaN).freeze(),this.bw=new j(0,0,0,0).freeze(),this.cw=pu,this.Zv=this.Vv=null,this.Wl=ou,this.Bn=jh,this.Jk=ou,this.Wn=jh,this.sv=this.pv=Lh,this.tB=250,this.Lu=new j(16,16,16,16).freeze(),this.xv=!0,this.pw=yu,this.rw=au,this.Gq="auto",this.ni=this.Ni=this.Ci=this.Kv=this.Di=this.Ei=this.Fi=this.mi=this.si=this.ji=null,this.wi=!1,this.ok=this.nk=this.zu=this.Ue=!0,this.Bu=this.Au=!1,this.Fu=this.Cu=this.nv=this.mv=this.Gu=this.Eu=this.wk=this.vk=this.uk=this.tk=this.rk=this.sk=this.qk=this.Du=this.yk=this.pk=this.xk=!0,this.ew=this.aw=16,this.We=new j(5).freeze(),this.Gv=999999999,this.Ud=null,Zi(this),this.ld=null,this.cb=new Di,this.cb.initializeStandardTools(),this.Ya=this.jt=this.cb,this.ob=new Lt,this.Ki=!0,ie(this),this.Rb=new ks,this.Ki=!1,this.Z=new wt,this.Ng=!1,this.Sn=!0,this.Pc=this.Lf=!1,this.qa(),this.Og=this.ii=null,on(this),this.Uu=""},Qi.prototype.rebuildParts=Qi.prototype.Il=function(){for(var t=this.qA.i;t.next();){var i=t.value,e=t.key;(!i.Pd()||i instanceof vs)&&xh.k('Invalid node template in Diagram.nodeTemplateMap: template for "'+e+'" must be a Node or a simple Part, not a Group or Link: '+i)}for(t=this.Tz.i;t.next();)i=t.value,e=t.key,i instanceof vs||xh.k('Invalid group template in Diagram.groupTemplateMap: template for "'+e+'" must be a Group, not a normal Node or Link: '+i);for(t=this.cA.i;t.next();)i=t.value,e=t.key,i instanceof zr||xh.k('Invalid link template in Diagram.linkTemplateMap: template for "'+e+'" must be a Link, not a normal Node or simple Part: '+i);for(t=xh.lb(),i=this.selection.i;i.next();)(e=i.value.data)&&t.push(e);for(var i=xh.lb(),n=this.Zm.i;n.next();)(e=n.value.data)&&i.push(e);for(e=xh.lb(),n=this.Ag.i;n.next();){var o=n.value;null!==o.data&&(e.push(o.data),e.push(o.location))}for(n=this.links.i;n.next();)null!==(o=n.value).data&&(e.push(o.data),e.push(o.location));for(n=this.ik.i;n.next();)null!==(o=n.value).data&&(e.push(o.data),e.push(o.location));for((n=this.Z)instanceof wt&&We(this,n.yg),We(this,n.Yf),Re(this,n.Yf),n instanceof wt&&Ue(this,n.yg),n=0;n<t.length;n++)null!==(o=this.ug(t[n]))&&(o.jb=!0);for(n=0;n<i.length;n++)null!==(o=this.ug(i[n]))&&(o.dh=!0);for(n=0;n<e.length;n+=2)null!==(o=this.ug(e[n]))&&(o.location=e[n+1]);xh.ta(t),xh.ta(i),xh.ta(e)},Qi.prototype.Rz=function(t){return this.Z.Rz(t)};var vu=!1,gu=!1;Qi.prototype.Vw=function(t){var i=this.Z,e="";return i instanceof wt?e=i.Vw(t):i instanceof Pt&&(e=i.LH(t)),e};var mu=!1;Qi.prototype.findPartForKey=Qi.prototype.DH=function(t){return null===t||void 0===t?null:null===(t=this.Z.$d(t))?null:this.oi.ka(t)},Qi.prototype.findNodeForKey=Qi.prototype.bf=function(t){return null===t||void 0===t?null:null===(t=this.Z.$d(t))?null:(t=this.oi.ka(t))instanceof wr?t:null},Qi.prototype.findPartForData=Qi.prototype.ug=function(t){if(null===t)return null;var i=this.oi.ka(t);return null!==i?i:i=this.Ck.ka(t)},Qi.prototype.findNodeForData=Qi.prototype.Tw=function(t){return null===t?null:(t=this.oi.ka(t))instanceof wr?t:null},Qi.prototype.findLinkForData=Qi.prototype.sf=function(t){return null===t?null:this.Ck.ka(t)},Qi.prototype.findNodesByExample=function(t){for(var i=new c,e=this.ro.i;e.next();){var n=e.value,o=n.data;if(null!==o)for(var r=0;r<arguments.length;r++){var s=arguments[r];if(xh.Va(s)&&Qe(this,o,s)){i.add(n);break}}}return i.i},Qi.prototype.findLinksByExample=function(t){for(var i=new c,e=this.ko.i;e.next();){var n=e.value,o=n.data;if(null!==o)for(var r=0;r<arguments.length;r++){var s=arguments[r];if(xh.Va(s)&&Qe(this,o,s)){i.add(n);break}}}return i.i},xh.defineProperty(Qi,{eL:"nodeTemplate"},function(){return this.Gi.ka("")},function(t){var i=this.Gi.ka("");i!==t&&(xh.A(t,tr,Qi,"nodeTemplate"),this.Gi.add("",t),this.h("nodeTemplate",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{qA:"nodeTemplateMap"},function(){return this.Gi},function(t){var i=this.Gi;i!==t&&(xh.A(t,m,Qi,"nodeTemplateMap"),this.Gi=t,this.h("nodeTemplateMap",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{EK:"groupTemplate"},function(){return this.Fk.ka("")},function(t){var i=this.Fk.ka("");i!==t&&(xh.A(t,vs,Qi,"groupTemplate"),this.Fk.add("",t),this.h("groupTemplate",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{Tz:"groupTemplateMap"},function(){return this.Fk},function(t){var i=this.Fk;i!==t&&(xh.A(t,m,Qi,"groupTemplateMap"),this.Fk=t,this.h("groupTemplateMap",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{TK:"linkTemplate"},function(){return this.zj.ka("")},function(t){var i=this.zj.ka("");i!==t&&(xh.A(t,zr,Qi,"linkTemplate"),this.zj.add("",t),this.h("linkTemplate",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{cA:"linkTemplateMap"},function(){return this.zj},function(t){var i=this.zj;i!==t&&(xh.A(t,m,Qi,"linkTemplateMap"),this.zj=t,this.h("linkTemplateMap",i,t),this.ma.kb||this.Il())}),xh.defineProperty(Qi,{hI:null},function(){return this.dm},function(t){this.dm=t}),xh.defineProperty(Qi,{Pe:"isMouseCaptured"},function(){return this.qC},function(i){var e=this.ub;null!==e&&(i?(this.P.bubbles=!1,e.removeEventListener("mousemove",this.xp,!1),e.removeEventListener("mousedown",this.wp,!1),e.removeEventListener("mouseup",this.zp,!1),e.removeEventListener("mousewheel",this.hh,!1),e.removeEventListener("DOMMouseScroll",this.hh,!1),e.removeEventListener("mouseout",this.yp,!1),t.addEventListener("mousemove",this.xp,!0),t.addEventListener("mousedown",this.wp,!0),t.addEventListener("mouseup",this.zp,!0),t.addEventListener("mousewheel",this.hh,!0),t.addEventListener("DOMMouseScroll",this.hh,!0),t.addEventListener("mouseout",this.yp,!0),t.addEventListener("selectstart",this.preventDefault,!1)):(t.removeEventListener("mousemove",this.xp,!0),t.removeEventListener("mousedown",this.wp,!0),t.removeEventListener("mouseup",this.zp,!0),t.removeEventListener("mousewheel",this.hh,!0),t.removeEventListener("DOMMouseScroll",this.hh,!0),t.removeEventListener("mouseout",this.yp,!0),t.removeEventListener("selectstart",this.preventDefault,!1),e.addEventListener("mousemove",this.xp,!1),e.addEventListener("mousedown",this.wp,!1),e.addEventListener("mouseup",this.zp,!1),e.addEventListener("mousewheel",this.hh,!1),e.addEventListener("DOMMouseScroll",this.hh,!1),e.addEventListener("mouseout",this.yp,!1)),this.qC=i)}),xh.defineProperty(Qi,{position:"position"},function(){return this.mb},function(t){var i=this.mb;if(!i.L(t)){xh.A(t,b,Qi,"position");var e=this.tb.copy();if(t=t.copy(),!this.Pc&&null!==this.ub){this.Pc=!0;var n=this.scale;se(this,t,this.Bd,this.Gb/n,this.Lb/n,this.Bn,!1),this.Pc=!1}this.mb=t.S(),(t=this.Sa).vc&&Ki(t,i,this.mb),this.Pc||this.Wt(e,this.tb)}}),xh.defineProperty(Qi,{XH:"initialPosition"},function(){return this.qv},function(t){this.qv.L(t)||(xh.A(t,b,Qi,"initialPosition"),this.qv=t.S())}),xh.defineProperty(Qi,{YH:"initialScale"},function(){return this.rv},function(t){this.rv!==t&&(xh.j(t,"number",Qi,"initialScale"),this.rv=t)}),xh.defineProperty(Qi,{xt:"grid"},function(){return null===this.ld&&ee(this),this.ld},function(t){var i=this.ld;if(i!==t){null===i&&(ee(this),i=this.ld),xh.A(t,eo,Qi,"grid"),t.type!==Uu&&xh.k("Diagram.grid must be a Panel of type Panel.Grid");var e=i.T;null!==e&&e.remove(i),this.ld=t,t.name="GRID",null!==e&&e.add(t),Le(this),this.qa(),this.h("grid",i,t)}}),xh.u(Qi,{tb:"viewportBounds"},function(){var t=this.tD;if(null===this.ub)return t;var i=this.mb,e=this.Vb;return t.m(i.x,i.y,Math.max(this.Gb,0)/e,Math.max(this.Lb,0)/e),t}),xh.defineProperty(Qi,{mE:"fixedBounds"},function(){return this.hv},function(t){var i=this.hv;i.L(t)||(xh.A(t,M,Qi,"fixedBounds"),-1/0!==t.width&&1/0!==t.height&&-1/0!==t.height||xh.k("fixedBounds width/height must not be Infinity"),this.hv=t=t.S(),this.pc(),this.h("fixedBounds",i,t))}),xh.defineProperty(Qi,{oF:"scrollMargin"},function(){return this.bw},function(t){"number"==typeof t?t=new j(t):xh.A(t,j,Qi,"scrollMargin");var i=this.bw;i.L(t)||(this.bw=t=t.S(),this.pc(),this.h("scrollMargin",i,t))}),xh.defineProperty(Qi,{GA:"scrollMode"},function(){return this.cw},function(t){var i=this.cw;i!==t&&(xh.rb(t,Qi,Qi,"scrollMode"),this.cw=t,t===pu&&oe(this,!1),this.h("scrollMode",i,t))}),xh.defineProperty(Qi,{$E:"positionComputation"},function(){return this.Vv},function(t){var i=this.Vv;i!==t&&(null!==t&&xh.j(t,"function",Qi,"positionComputation"),this.Vv=t,oe(this,!1),this.h("positionComputation",i,t))}),xh.defineProperty(Qi,{nF:"scaleComputation"},function(){return this.Zv},function(t){var i=this.Zv;i!==t&&(null!==t&&xh.j(t,"function",Qi,"scaleComputation"),this.Zv=t,je(this,this.scale,this.scale),this.h("scaleComputation",i,t))}),xh.u(Qi,{Bd:"documentBounds"},function(){return this.av}),xh.defineProperty(Qi,{scale:"scale"},function(){return this.Vb},function(t){var i=this.Vb;xh.Ye(t,Qi,"scale"),i!==t&&je(this,i,t)}),xh.defineProperty(Qi,{gl:"autoScale"},function(){return this.Wl},function(t){var i=this.Wl;i!==t&&(xh.rb(t,Qi,Qi,"autoScale"),this.Wl=t,this.h("autoScale",i,t),t!==ou&&oe(this,!1))}),xh.defineProperty(Qi,{GK:"initialAutoScale"},function(){return this.Jk},function(t){var i=this.Jk;i!==t&&(xh.rb(t,Qi,Qi,"initialAutoScale"),this.Jk=t,this.h("initialAutoScale",i,t))}),xh.defineProperty(Qi,{ZH:"initialViewportSpot"},function(){return this.sv},function(t){var i=this.sv;i!==t&&(xh.A(t,D,Qi,"initialViewportSpot"),t.ed()||xh.k("initialViewportSpot must be a specific Spot: "+t),this.sv=t,this.h("initialViewportSpot",i,t))}),xh.defineProperty(Qi,{WH:"initialDocumentSpot"},function(){return this.pv},function(t){var i=this.pv;i!==t&&(xh.A(t,D,Qi,"initialDocumentSpot"),t.ed()||xh.k("initialViewportSpot must be a specific Spot: "+t),this.pv=t,this.h("initialDocumentSpot",i,t))}),xh.defineProperty(Qi,{fh:"minScale"},function(){return this.Hv},function(t){xh.Ye(t,Qi,"minScale");var i=this.Hv;i!==t&&(0<t?(this.Hv=t,this.h("minScale",i,t),t>this.scale&&(this.scale=t)):xh.wa(t,"> 0",Qi,"minScale"))}),xh.defineProperty(Qi,{eh:"maxScale"},function(){return this.Fv},function(t){xh.Ye(t,Qi,"maxScale");var i=this.Fv;i!==t&&(0<t?(this.Fv=t,this.h("maxScale",i,t),t<this.scale&&(this.scale=t)):xh.wa(t,"> 0",Qi,"maxScale"))}),xh.defineProperty(Qi,{Sl:"zoomPoint"},function(){return this.uw},function(t){this.uw.L(t)||(xh.A(t,b,Qi,"zoomPoint"),this.uw=t=t.S())}),xh.defineProperty(Qi,{UD:"contentAlignment"},function(){return this.Bn},function(t){var i=this.Bn;i.L(t)||(xh.A(t,D,Qi,"contentAlignment"),this.Bn=t=t.S(),this.h("contentAlignment",i,t),oe(this,!1))}),xh.defineProperty(Qi,{HK:"initialContentAlignment"},function(){return this.Wn},function(t){var i=this.Wn;i.L(t)||(xh.A(t,D,Qi,"initialContentAlignment"),this.Wn=t=t.S(),this.h("initialContentAlignment",i,t))}),xh.defineProperty(Qi,{padding:"padding"},function(){return this.We},function(t){"number"==typeof t?t=new j(t):xh.A(t,j,Qi,"padding");var i=this.We;i.L(t)||(this.We=t=t.S(),this.pc(),this.h("padding",i,t))}),xh.u(Qi,{Ag:"nodes"},function(){return this.ro.i}),xh.u(Qi,{links:"links"},function(){return this.ko.i}),xh.u(Qi,{ik:"parts"},function(){return this.zb.i}),Qi.prototype.findTopLevelNodesAndLinks=function(){for(var t=new c(tr),i=this.ro.i;i.next();){var e=i.value;e.np&&t.add(e)}for(i=this.ko.i;i.next();)(e=i.value).np&&t.add(e);return t.i},Qi.prototype.findTopLevelGroups=function(){return this.$k.i},xh.defineProperty(Qi,{Rb:"layout"},function(){return this.Ud},function(t){var i=this.Ud;i!==t&&(xh.A(t,ks,Qi,"layout"),null!==i&&(i.g=null,i.group=null),this.Ud=t,t.g=this,t.group=null,this.Iu=!0,this.h("layout",i,t),this.Re())}),Qi.prototype.layoutDiagram=function(t){ve(this),t&&_e(this,!0),en(this,!1)},xh.defineProperty(Qi,{Qd:"isTreePathToChildren"},function(){return this.xv},function(t){var i=this.xv;if(i!==t&&(xh.j(t,"boolean",Qi,"isTreePathToChildren"),this.xv=t,this.h("isTreePathToChildren",i,t),!this.ma.kb))for(t=this.Ag;t.next();)Nr(t.value)}),Qi.prototype.findTreeRoots=function(){for(var t=new u(wr),i=this.Ag;i.next();){var e=i.value;e.np&&null===e.ep()&&t.add(e)}return t.i},xh.defineProperty(Qi,{UA:"treeCollapsePolicy"},function(){return this.pw},function(t){var i=this.pw;i!==t&&(xh.rb(t,Qi,Qi,"treeCollapsePolicy"),this.pw=t,this.h("treeCollapsePolicy",i,t))}),xh.defineProperty(Qi,{bh:null},function(){return this.iC},function(t){this.iC=t}),Qi.prototype.addDiagramListener=Qi.prototype.uz=function(t,i){xh.j(t,"string",Qi,"addDiagramListener:name"),xh.j(i,"function",Qi,"addDiagramListener:listener");var e=sn(this,t);null!==e&&e.add(i)},Qi.prototype.removeDiagramListener=Qi.prototype.cF=function(t,i){xh.j(t,"string",Qi,"removeDiagramListener:name"),xh.j(i,"function",Qi,"addDiagramListener:listener");var e=sn(this,t);null!==e&&e.remove(i)},Qi.prototype.raiseDiagramEvent=Qi.prototype.Ba=function(t,i,e){var n=sn(this,t),o=new it;if(o.g=this,o.name=rn(this,t),void 0!==i&&(o.PA=i),void 0!==e&&(o.tA=e),1===(t=n.length))(n=n.ha(0))(o);else if(0!==t)for(i=n.dc(),e=0;e<t;e++)(n=i[e])(o);return o.cancel},Qi.prototype.isUnoccupied=Qi.prototype.pp=function(t,i){return void 0===i&&(i=null),an(this,!1,null,i).pp(t.x,t.y,t.width,t.height)},Qi.prototype.simulatedMouseMove=Qi.prototype.Lx=function(t,i,e){if(null!==Al){var n=Al.g;e instanceof Qi||(e=null);var o=Fl;return e!==o&&(null!==o&&o!==n&&null!==o.cb.Zd&&(cn(o),Al.ax=!1,o.cb.Zd.doSimulatedDragLeave()),Fl=e,null!==e&&e!==n&&null!==e.cb.Zd&&(Gt(),o=e.cb.Zd,Dl.contains(o)||Dl.add(o),e.cb.Zd.doSimulatedDragEnter())),null!==e&&e!==n&&e.CD&&!e.bb&&e.Po?(null!==(n=e.cb.Zd)&&(null!==t?i=e.Vq(t):null===i&&(i=new b),e.Pb.da=i,e.Pb.pl=!1,e.Pb.up=!1,n.doSimulatedDragOver()),!0):!1}return!1},Qi.prototype.simulatedMouseUp=Qi.prototype.yF=function(t,i,e,n){if(null!==Al){null===n&&(n=i),i=Fl;var o=Al.g;if(n!==i){if(null!==i&&i!==o&&null!==i.cb.Zd)return cn(i),Al.ax=!1,i.cb.Zd.doSimulatedDragLeave(),!1;Fl=n,null!==n&&null!==n.cb.Zd&&(Gt(),i=n.cb.Zd,Dl.contains(i)||Dl.add(i),n.cb.Zd.doSimulatedDragEnter())}if(null===n)return Al.doCancel(),!0;if(n!==this)return null!==t&&(e=n.Vq(t)),n.Pb.da=e,n.Pb.pl=!1,n.Pb.up=!0,null!==(t=n.cb.Zd)&&t.doSimulatedDrop(),null!==(t=Al)&&(n=t.mayCopy(),t.Cf=n?"Copy":"Move",t.stopTool()),!0}return!1},xh.defineProperty(Qi,{JD:"autoScrollRegion"},function(){return this.Lu},function(t){"number"==typeof t?t=new j(t):xh.A(t,j,Qi,"autoScrollRegion");var i=this.Lu;i.L(t)||(this.Lu=t=t.S(),this.pc(),this.h("autoScrollRegion",i,t))}),Qi.prototype.makeSVG=Qi.prototype.makeSvg=function(t){return void 0===t&&(t=new n),t.context="svg",null!==(t=dn(this,t))?t.Nl:null},Qi.prototype.makeImage=function(t){void 0===t&&(t=new n);var i=(t.document||document).createElement("img");return i.src=this.vI(t),i},Qi.prototype.makeImageData=Qi.prototype.vI=function(t){void 0===t&&(t=new n);var i=dn(this,t);return null!==i?i.toDataURL(t.type,t.details):""};var bu=!1;Qi.inherit=function(t,i){xh.j(t,"function",Qi,"inherit"),xh.j(i,"function",Qi,"inherit"),i.wG&&xh.k("Cannot inherit from "+xh.df(i)),xh.Ja(t,i)},yn.prototype.Rl=function(i){if(i.zh.setTransform(i.He,0,0,i.He,0,0),null===this.Dh)t:{var e="f",n=t[xh.sg("76a715b2f73f148a")][xh.sg("72ba13b5")];if((i=xh.sg)("77bb5bb2f32603de")===t[i("76a715b2f73f148a")][i("6aba19a7ec351488")])try{if(this.Dh=!t[i("4da118b7ec2108")]([i("5bb806bfea351a904a84515e1b6d38b6")])([i("49bc19a1e6")])([i("59bd04a1e6380fa5539b")])([i("7bb8069ae7")]===i(xh.adym)),!1===this.Dh)break t;if(this.Dh=!t[i("4da118b7ec2108")]([i("5bb806bfea351a904a84515e1b6d38b6")])([i("49bc19a1e6")])([i("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([i("7bb8069ae7")]===i(xh.adym)),!1===this.Dh)break t}catch(t){}for(var o=n[i("76ad18b4f73e")],r=n[i("73a612b6fb191d")](i("35e7"))+2;r<o;r++)e+=n[r];0>(n=e[i("73a612b6fb191d")](i(xh.adym)))&&i(xh.adym)!==i("7da71ca0ad381e90")&&(n=e[i("73a612b6fb191d")](i("76a715b2ef3e149757"))),(this.Dh=!(0<=n&&n<e[i("73a612b6fb191d")](i("35"))))&&(e=t.document[i("79ba13b2f7333e8846865a7d00")]("div"),"."===(n=i("02cncncn"))[0]&&(n=n[i("69bd14a0f724128a44")](1)),e[i("79a417a0f0181a8946")]=n,t.document[i("78a712aa")]?(t.document[i("78a712aa")][i("7bb806b6ed32388c4a875b")](e),n=t[i("7dad0290ec3b0b91578e5b40007031bf")](e)[i("7dad0283f1390b81519f4645156528bf")](i("78a704b7e62456904c9b12701b6532a8")),t.document[i("78a712aa")][i("68ad1bbcf533388c4a875b")](e),n&&-1!==n.indexOf(i(xh.YG))&&-1!==n.indexOf(i(xh.ZG))&&(this.Dh=!1)):(this.Dh=null,this.Dh=!1))}return 0<this.Dh&&this!==this.xG},yn.prototype.t=function(){this.xG=null},xh.Ja(gn,Qi),xh.ea("Palette",gn),xh.Ja(mn,Qi),xh.ea("Overview",mn),mn.prototype.computePixelRatio=function(){return 1},mn.prototype.$e=function(){if(null===this.Mb&&xh.k("No div specified"),null===this.ub&&xh.k("No canvas specified"),this.ke){if(null!==(a=this.Hj)&&!a.Sa.uf){Pe(this);(null!==(i=a.xt)&&i.visible&&isNaN(i.width)||isNaN(i.height))&&Le(a);var t=this.ub,i=this.zh,e=this.kz,n=this.yG;e.width=t.width,e.height=t.height,i.wu="",i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,this.ub.width,this.ub.height),(e=this.me).reset(),1!==this.scale&&e.scale(this.scale),0===this.position.x&&0===this.position.y||e.translate(-this.position.x,-this.position.y),i.setTransform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);for(var e=this.dv,o=this.tb,r=a.Yb.n,s=r.length,a=0;a<s;a++){var h=r[a],l=i,u=o,f=e;if(h.visible&&0!==h.Rc&&(void 0===f&&(f=!0),f||!h.Gc)){1!==h.Rc&&(l.globalAlpha=h.Rc);for(var f=this.scale,c=(h=h.zb.n).length,p=0;p<c;p++){var d=h[p],y=d.Y;y.xg(u)&&(1<y.width*f||1<y.height*f?d.$e(l,this):lr(d,l))}l.globalAlpha=1}}for(n.drawImage(t.Od,0,0),n=(t=this.Yb.n).length,a=0;a<n;a++)t[a].$e(i,this);this.ke=this.Kk=!1}}},xh.defineProperty(mn,{sA:"observed"},function(){return this.Hj},function(t){var i=this.Hj;null!==t&&xh.A(t,Qi,mn,"observed"),t instanceof mn&&xh.k("Overview.observed Diagram may not be an Overview itself: "+t),i!==t&&(null!==i&&(this.remove(this.Yg),i.cF("ViewportBoundsChanged",this.YE),i.cF("DocumentBoundsChanged",this.XE),i.Rv.remove(this)),this.Hj=t,null!==t&&(t.uz("ViewportBoundsChanged",this.YE),t.uz("DocumentBoundsChanged",this.XE),t.Rv.add(this),this.add(this.Yg),bn(this)),this.pc(),this.h("observed",i,t))}),xh.defineProperty(mn,{Yg:"box"},function(){return this.Xl},function(t){var i=this.Xl;i!==t&&(this.Xl=t,this.remove(i),this.add(this.Xl),bn(this),this.h("box",i,t))}),xh.defineProperty(mn,{BK:"drawsTemporaryLayers"},function(){return this.dv},function(t){this.dv!==t&&(this.dv=t,this.AA())}),mn.prototype.Zg=function(){var t=this.Hj;return null===t?hl.Yx:t.Bd},mn.prototype.zE=function(){!0!==this.ke&&(this.ke=!0,function(t){t.Pc||t.Kd||!1!==t.Lf||(t.Lf=!0,requestAnimationFrame(function(){if(t.Lf&&!t.Kd&&(t.Lf=!1,null!==t.Mb)){if(t.Kd=!0,ve(t),t.Bd.K()||$e(t,t.Zg()),null===t.Mb&&xh.k("No div specified"),null===t.ub&&xh.k("No canvas specified"),t.ke&&null!==(i=t.Hj)&&!i.Sa.uf&&!i.Sa.vc){var i=t.zh,e=t.kz;i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,t.ub.width,t.ub.height),i.drawImage(e,0,0),(e=t.me).reset(),1!==t.scale&&e.scale(t.scale),0===t.position.x&&0===t.position.y||e.translate(-t.position.x,-t.position.y),i.setTransform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);for(var n=(e=t.Yb.n).length,o=0;o<n;o++)e[o].$e(i,t);t.Kk=!1,t.ke=!1}t.Kd=!1}}))}(this))},mn.prototype.Wt=function(t){this.Pc||(Me(this),this.qa(),ke(this),this.pc(),bn(this),this.Ba("ViewportBoundsChanged",null,t))},xh.Ja(xn,qt),xn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.g;if(null===t||!t.fl||!t.pf)return!1;var i=t.sA;if(null===i)return!1;if(null===this.findDraggablePart()){var e=i.tb;this.Vk=new b(e.width/2,e.height/2),t=t.yc.da,i.position=new b(t.x-this.Vk.x,t.y-this.Vk.y)}return!0},xn.prototype.doActivate=function(){this.Vk=null,qt.prototype.doActivate.call(this)},xn.prototype.moveParts=function(){var t=this.g,i=t.sA;if(null!==i){if(null!==(n=t.Yg)){if(null===this.Vk){var e=t.yc.da,n=n.location;this.Vk=new b(e.x-n.x,e.y-n.y)}t=t.P.da,i.position=new b(t.x-this.Vk.x,t.y-this.Vk.y)}}},xh.Ja(wn,gi),wn.prototype.resize=function(t){var i=this.g.sA;if(null!==i){var e=i.tb.copy();i.position=t.position,(e.width!==t.width||e.height!==t.height)&&0<t.width&&0<t.height&&(i.scale=Math.min(e.width/t.width,e.height/t.height))}},xh.ea("Brush",kn);var xu;kn.Solid=xu=xh.p(kn,"Solid",0);var wu;kn.Linear=wu=xh.p(kn,"Linear",1);var ku;kn.Radial=ku=xh.p(kn,"Radial",2);var Mu;kn.Pattern=Mu=xh.p(kn,"Pattern",4),kn.prototype.copy=function(){var t=new kn;return t.ja=this.ja,t.An=this.An,t.Bo=this.Bo.S(),t.Qn=this.Qn.S(),t.jw=this.jw,t.ev=this.ev,null!==this.Ig&&(t.Ig=this.Ig.copy()),t.Tv=this.Tv,t},kn.prototype.Fa=function(){return this.freeze(),Object.freeze(this),this},kn.prototype.freeze=function(){return this.D=!0,null!==this.Ig&&this.Ig.freeze(),this},kn.prototype.Oa=function(){return Object.isFrozen(this)&&xh.k("cannot thaw constant: "+this),this.D=!1,null!==this.Ig&&this.Ig.Oa(),this},kn.prototype.toString=function(){var t="Brush(";if(this.type===xu)t+=this.color;else if(t=this.type===wu?t+"Linear ":this.type===ku?t+"Radial ":this.type===Mu?t+"Pattern ":t+"(unknown) ",t+=this.start+" "+this.end,null!==this.ht)for(var i=this.ht.i;i.next();)t+=" "+i.key+":"+i.value;return t+")"},kn.prototype.addColorStop=kn.prototype.addColorStop=function(t,i){this.D&&xh.la(this),("number"!=typeof t||!isFinite(t)||1<t||0>t)&&xh.wa(t,"0 <= loc <= 1",kn,"addColorStop:loc"),xh.j(i,"string",kn,"addColorStop:color"),null===this.Ig&&(this.Ig=new m("number","string")),this.Ig.add(t,i),this.ja===xu&&(this.type=wu),this.Jg=null},xh.defineProperty(kn,{type:"type"},function(){return this.ja},function(t){this.D&&xh.la(this,t),xh.rb(t,kn,kn,"type"),this.ja=t,this.start.te()&&(t===wu?this.start=Dh:t===ku&&(this.start=zh)),this.end.te()&&(t===wu?this.end=Bh:t===ku&&(this.end=zh)),this.Jg=null}),xh.defineProperty(kn,{color:"color"},function(){return this.An},function(t){this.D&&xh.la(this,t),this.An=t,this.Jg=null}),xh.defineProperty(kn,{start:"start"},function(){return this.Bo},function(t){this.D&&xh.la(this,t),xh.A(t,D,kn,"start"),this.Bo=t.S(),this.Jg=null}),xh.defineProperty(kn,{end:"end"},function(){return this.Qn},function(t){this.D&&xh.la(this,t),xh.A(t,D,kn,"end"),this.Qn=t.S(),this.Jg=null}),xh.defineProperty(kn,{nu:"startRadius"},function(){return this.jw},function(t){this.D&&xh.la(this,t),xh.Ye(t,kn,"startRadius"),0>t&&xh.wa(t,">= zero",kn,"startRadius"),this.jw=t,this.Jg=null}),xh.defineProperty(kn,{lt:"endRadius"},function(){return this.ev},function(t){this.D&&xh.la(this,t),xh.Ye(t,kn,"endRadius"),0>t&&xh.wa(t,">= zero",kn,"endRadius"),this.ev=t,this.Jg=null}),xh.defineProperty(kn,{ht:"colorStops"},function(){return this.Ig},function(t){this.D&&xh.la(this,t),this.Ig=t,this.Jg=null}),xh.defineProperty(kn,{pattern:"pattern"},function(){return this.Tv},function(t){this.D&&xh.la(this,t),this.Tv=t,this.Jg=null}),kn.randomColor=function(t,i){void 0===t&&(t=128),void 0===i&&(i=Math.max(t,255));var e=Math.abs(i-t),n=Math.floor(t+Math.random()*e).toString(16),o=Math.floor(t+Math.random()*e).toString(16),e=Math.floor(t+Math.random()*e).toString(16);return 2>n.length&&(n="0"+n),2>o.length&&(o="0"+o),2>e.length&&(e="0"+e),"#"+n+o+e};var Pu,Tu=xh.createElement("canvas").getContext("2d");kn.isValidColor=Pu=function(t){if("black"===t)return!0;if(""===t)return!1;Tu.fillStyle="#000000";var i=Tu.fillStyle;return Tu.fillStyle=t,Tu.fillStyle!==i||(Tu.fillStyle="#FFFFFF",i=Tu.fillStyle,Tu.fillStyle=t,Tu.fillStyle!==i)},xh.Yh(Mn),xh.ea("GraphObject",Mn),Mn.prototype.cloneProtected=function(t){t.fa=6144|this.fa,t.Rc=this.Rc,t.Qb=this.Qb,t.Kb=this.Kb,t.nc=this.nc,t.mb.assign(this.mb),t.nf=this.nf.S(),t.Ej=this.Ej.S(),t.Cj=this.Cj.S(),t.Rk=this.Rk.copy(),t.Vb=this.Vb,t.Ul=this.Ul,t.Th=this.Th,t.wr=this.wr.S(),t.md.assign(this.md),t.mc.assign(this.mc),t.Qc.assign(this.Qc),t.Yr=this.Yr,null!==this.ga&&(t.ga=this.ga.copy()),t.Rq=this.Rq,t.Js=this.Js,t.Sq=this.Sq,t.Ks=this.Ks,t.Ce=this.Ce.S(),t.eq=this.eq.S(),t.ls=this.ls,t.Ji=this.Ji,t.nq=this.nq,t.li=this.li,t.Ds=this.Ds,t.qs=this.qs,t.ps=this.ps,t.rs=this.rs.S(),t.ss=this.ss,t.zq=this.zq,null!==this.ia&&(t.ia=this.ia.copy()),t.sc=this.sc,t.yn=this.yn,null!==this.Bk&&(t.Bk=xh.il(this.Bk)),null!==this.ki&&(t.ki=this.ki.copy()),t.ys=this.ys},Mn.prototype.addCopyProperty=Mn.prototype.HG=function(t){var i=this.Bk;if(xh.isArray(i)){for(var e=0;e<i.length;e++)if(i[e]===t)return}else this.Bk=i=[];i.push(t)},Mn.prototype.Zh=function(t){t.um=null,t.tm=null,t.Q()},Mn.prototype.clone=function(){var t=new this.constructor;if(this.cloneProtected(t),null!==this.Bk)for(var i=0;i<this.Bk.length;i++){var e=this.Bk[i];t[e]=this[e]}return t},Mn.prototype.copy=function(){return this.clone()},Mn.prototype.toString=function(){return xh.df(Object.getPrototypeOf(this))+"#"+xh.pd(this)};var Su;Mn.None=Su=xh.p(Mn,"None",0);var Nu;Mn.Default=Nu=xh.p(Mn,"Default",0);var Cu;Mn.Vertical=Cu=xh.p(Mn,"Vertical",4);var ju;Mn.Horizontal=ju=xh.p(Mn,"Horizontal",5);var Lu;Mn.Fill=Lu=xh.p(Mn,"Fill",3);var Du;Mn.Uniform=Du=xh.p(Mn,"Uniform",1);var Au;Mn.UniformToFill=Au=xh.p(Mn,"UniformToFill",2),Mn.prototype.Ne=function(){if(null===this.ga){var t=new ys;t.rj=Ch,t.Tj=Ch,t.pj=10,t.Rj=10,t.oj=kf,t.Qj=kf,t.qj=0,t.Sj=0,this.ga=t}},Mn.prototype.raiseChangedEvent=Mn.prototype.Lc=function(t,i,e,n,o,r,s){var a=this.aa;null!==a&&(a.kn(t,i,e,n,o,r,s),0!=(1024&this.fa)&&e===this&&t===kl&&Sn(this,a,i))},Mn.prototype.Rw=function(t){return this.yn===t?this:null},Mn.prototype.raiseChanged=Mn.prototype.h=function(t,i,e){this.Lc(kl,t,this,i,e)},Mn.prototype.kE=function(t,i,e){if(!1===this.Cg)return!1;var n=this.Ia;i=t.$j(i);var o=!1;return e&&(o=Mh(t.x,t.y,0,0,0,n.height)<i||Mh(t.x,t.y,0,n.height,n.width,n.height)<i||Mh(t.x,t.y,n.width,n.height,n.width,0)<i||Mh(t.x,t.y,n.width,0,0,0)<i),e||(o=Mh(t.x,t.y,0,0,0,n.height)<i&&Mh(t.x,t.y,0,n.height,n.width,n.height)<i&&Mh(t.x,t.y,n.width,n.height,n.width,0)<i&&Mh(t.x,t.y,n.width,0,0,0)<i),o},Mn.prototype.Gg=function(){return!0},Mn.prototype.containsPoint=Mn.prototype.Ga=function(t){var i=xh.M();i.assign(t),this.transform.xb(i);var e=this.Y;if(!e.K())return!1;n=this.g;if(null!==n&&n.wv){var n,o=n.hp("extraTouchThreshold"),r=n.hp("extraTouchArea"),s=r/2,a=this.Ia,h=1/(n=this.Yi()*n.scale);if(a.width*n<o&&a.height*n<o)return t=Sh(e.x-s*h,e.y-s*h,e.width+r*h,e.height+r*h,i.x,i.y),xh.v(i),t}return(this instanceof xr||this instanceof To?Sh(e.x-5,e.y-5,e.width+10,e.height+10,i.x,i.y):e.Ga(i))?!(this.ki&&!this.ki.Ga(i))&&(!!(null!==this.nc&&e.Ga(i)||null!==this.Kb&&this.Qc.Ga(t))||(xh.v(i),this.Yj(t))):(xh.v(i),!1)},Mn.prototype.Yj=function(t){var i=this.Ia;return Sh(0,0,i.width,i.height,t.x,t.y)},Mn.prototype.containsRect=Mn.prototype.Zj=function(t){if(0===this.angle)return this.Y.Zj(t);var i=this.Ia,i=xh.lk(0,0,i.width,i.height),e=this.transform,n=!1,o=xh.Ob(t.x,t.y);return i.Ga(e.$h(o))&&(o.m(t.x,t.bottom),i.Ga(e.$h(o))&&(o.m(t.right,t.bottom),i.Ga(e.$h(o))&&(o.m(t.right,t.y),i.Ga(e.$h(o))&&(n=!0)))),xh.v(o),xh.ic(i),n},Mn.prototype.containedInRect=Mn.prototype.Om=function(t,i){if(void 0===i)return t.Zj(this.Y);var e=this.Ia,n=!1,o=xh.Ob(0,0);return t.Ga(i.xb(o))&&(o.m(0,e.height),t.Ga(i.xb(o))&&(o.m(e.width,e.height),t.Ga(i.xb(o))&&(o.m(e.width,0),t.Ga(i.xb(o))&&(n=!0)))),n},Mn.prototype.intersectsRect=Mn.prototype.xg=function(t,i){if(void 0===i&&(i=this.transform,0===this.angle))return t.xg(this.Y);var e=this.Ia,n=i,o=xh.Ob(0,0),r=xh.Ob(0,e.height),s=xh.Ob(e.width,e.height),a=xh.Ob(e.width,0),h=!1;if(t.Ga(n.xb(o))||t.Ga(n.xb(r))||t.Ga(n.xb(s))||t.Ga(n.xb(a)))h=!0;else{var e=xh.lk(0,0,e.width,e.height),l=xh.Ob(t.x,t.y);e.Ga(n.$h(l))?h=!0:(l.m(t.x,t.bottom),e.Ga(n.$h(l))?h=!0:(l.m(t.right,t.bottom),e.Ga(n.$h(l))?h=!0:(l.m(t.right,t.y),e.Ga(n.$h(l))&&(h=!0)))),xh.v(l),xh.ic(e),!h&&(hl.Yw(t,o,r)||hl.Yw(t,r,s)||hl.Yw(t,s,a)||hl.Yw(t,a,o))&&(h=!0)}return xh.v(o),xh.v(r),xh.v(s),xh.v(a),h},Mn.prototype.getDocumentPoint=Mn.prototype.Za=function(t,i){void 0===i&&(i=new b),t.te()&&xh.k("getDocumentPoint:s Spot must be specific: "+t.toString());var e=this.Ia;return i.m(t.x*e.width+t.offsetX,t.y*e.height+t.offsetY),this.Xg.xb(i),i},Mn.prototype.getDocumentAngle=Mn.prototype.ul=function(){var t;return 1===(t=this.Xg).m11&&0===t.m12?t=0:0>(t=180*Math.atan2(t.m12,t.m11)/Math.PI)&&(t+=360),t},Mn.prototype.getDocumentScale=Mn.prototype.Yi=function(){if(0!=(4096&this.fa)==!1)return this.bv;var t=this.Vb;return null!==this.T?t*this.T.Yi():t},Mn.prototype.getLocalPoint=Mn.prototype.qE=function(t,i){return void 0===i&&(i=new b),i.assign(t),this.Xg.$h(i),i},Mn.prototype.getNearestIntersectionPoint=Mn.prototype.xl=function(t,i,e){return this.ip(t.x,t.y,i.x,i.y,e)},(mh=Mn.prototype).ip=function(t,i,e,n,o){var r=this.transform,s=1/(r.m11*r.m22-r.m12*r.m21),a=r.m22*s,h=-r.m12*s,l=-r.m21*s,u=r.m11*s,f=s*(r.m21*r.dy-r.m22*r.dx),c=s*(r.m12*r.dx-r.m11*r.dy);return null!==this.Jm?(r=this.Y,hl.xl(r.left,r.top,r.right,r.bottom,t,i,e,n,o)):(s=t*a+i*l+f,t=t*h+i*u+c,i=e*a+n*l+f,e=e*h+n*u+c,o.m(0,0),n=this.Ia,e=hl.xl(0,0,n.width,n.height,s,t,i,e,o),o.transform(r),e)},mh.Ec=function(t,i,e,n,o){this.vi();var r=xh.ag();if(r.assign(this.mc),this.mc.Oa(),!1===Xn(this)){var s=this.mc;s.x=t,s.y=i,s.width=e,s.height=n}else this.Ri(t,i,e,n);this.mc.freeze(),this.ki=void 0===o?null:o,e=!1,void 0!==o?e=!0:null!==this.T&&(o=this.T.Qc,n=this.Ca,null!==this.Jm&&(n=this.mc),e=i+n.height,n=t+n.width,e=!(0<=t+.05&&n<=o.width+.05&&0<=i+.05&&e<=o.height+.05),this instanceof zo&&(t=this.Qc,this.Ev>t.height||this.Ok.Ve>t.width))&&(e=!0),this.fa=e?256|this.fa:-257&this.fa,this.mc.K()||xh.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.mc.toString()),this.qx(r,this.mc),xh.ic(r)},mh.Ri=function(){},mh.qx=function(t,i){Qn(this,!1);var e=this.aa;if(null!==e&&null!==e.g){var n=this.aa;null!==n&&(n.gu!==this&&n.jF!==this&&n.mF!==this||pr(n,!0)),this.qa(),t.L(i)||(e.zl(),this.Mv(e))}},mh.Mv=function(t){null!==this.Sd&&pr(t,!0)},xh.defineProperty(Mn,{Pp:"shadowVisible"},function(){return this.ys},function(t){var i=this.ys;i!==t&&(this.ys=t,this.h("shadowVisible",i,t))}),Mn.prototype.$e=function(t,i){if(this.visible){if(0!==(l=this.mc).width&&0!==l.height&&!isNaN(l.x)&&!isNaN(l.y)){var e=this.opacity,n=1;if(1!==e){if(0===e)return;n=t.globalAlpha,t.globalAlpha=n*e}if(t instanceof O){t:if(this.visible){var o=null,r=t.ix;if(this instanceof eo&&(this.type===Vu||this.type===Hu))Fn(this,t,i);else{var s=this.mc;if(0!==s.width&&0!==s.height&&!isNaN(s.x)&&!isNaN(s.y)){var a=this.transform,h=this.T;0!=(4096&this.fa)==!0&&Bn(this);var l=0!=(256&this.fa),u=!1;if(this instanceof zo&&Oo(this,t),l){if(u=h.Gg()?h.Ia:h.Y,null!==this.ki)var f=this.ki,c=f.x,p=f.y,d=f.width,f=f.height;else c=Math.max(s.x,u.x),p=Math.max(s.y,u.y),d=Math.min(s.right,u.right)-c,f=Math.min(s.bottom,u.bottom)-p;if(c>s.width+s.x||s.x>u.width+u.x||p>s.height+s.y||s.y>u.height+u.y)break t;u=!0,V(t,1,0,0,1,0,0),t.save(),t.beginPath(),t.rect(c,p,d,f),t.clip()}if(c=!1,this instanceof tr){var y=this,c=!0;if(!y.isVisible())break t}if(t.Wi.hf=[1,0,0,1,0,0],p=!1,c&&this.El&&i.ek("drawShadows")&&(d=this.Bm,i.fz=d.x*i.scale*i.He,i.gz=d.y*i.scale*i.He,i.Qh=y.Qh,i.Vg=y.Vg,An(i,t),t.shadowColor=i.Vg),y=!1,this.aa&&i.ek("drawShadows")&&(y=this.aa.El),!0===this.Pp?(An(i,t),!1===p&&y&&(V(t,1,0,0,1,0,0),t.$a(),p=!0)):!1===this.Pp&&Dn(t),null!==this.nc&&(qn(this,t,this.nc,!0,!0),!1===p&&y&&(V(t,1,0,0,1,0,0),t.$a(),p=!0),this.nc instanceof kn&&this.nc.type===ku?(t.beginPath(),t.rect(s.x,s.y,s.width,s.height),zn(t,this.nc)):t.fillRect(s.x,s.y,s.width,s.height)),this instanceof eo?V(t,a.m11,a.m12,a.m21,a.m22,a.dx,a.dy):t.Wi.hf=[a.m11,a.m12,a.m21,a.m22,a.dx,a.dy],null!==this.Kb){!1===p&&y&&(V(t,1,0,0,1,0,0),t.$a(),p=!0);var a=s=0,d=(f=this.Ia).width,f=f.height,v=0;this instanceof To&&(f=this.Ua.nb,s=f.x,a=f.y,d=f.width,f=f.height,v=this.Uh),qn(this,t,this.Kb,!0,!1),this.Kb instanceof kn&&this.Kb.type===ku?(t.beginPath(),t.rect(s-v/2,a-v/2,d+v,f+v),zn(t,this.Kb)):t.fillRect(s-v/2,a-v/2,d+v,f+v)}y&&(null!==this.Kb||null!==this.nc||null!==h&&0!=(512&h.fa)||null!==h&&(h.type===Ru||h.type===Iu)&&h.af()!==this)?(Hn(this,!0),null===this.Pp&&Dn(t)):Hn(this,!1),this.ak(t,i),y&&0!=(512&this.fa)==!0&&An(i,t),c&&y&&Dn(t),l&&(t.restore(),u&&t.tf.pop(),te(i,t)),this instanceof eo&&(o=t.tf.pop()),!0===p&&t.tf.pop(),null!==t.fE&&(null===o&&(r===t.ix?(V(t,1,0,0,1,0,0),o=t.tf.pop()):o=t.ix),t.fE(this,o))}}}}else{if(this instanceof eo&&(this.type===Vu||this.type===Hu))return Fn(this,t,i),void(1!==e&&(t.globalAlpha=n));if(this instanceof zr&&this.dn(!1),o=this.transform,r=this.T,0!=(4096&this.fa)==!0&&Bn(this),h=0!=(256&this.fa),this instanceof zo&&Oo(this,t),h){if(u=r.Gg()?r.Ia:r.Y,null!==this.ki?(y=this.ki,s=y.x,a=y.y,c=y.width,y=y.height):(s=Math.max(l.x,u.x),a=Math.max(l.y,u.y),c=Math.min(l.right,u.right)-s,y=Math.min(l.bottom,u.bottom)-a),s>l.width+l.x||l.x>u.width+u.x||a>l.height+l.y||l.y>u.height+u.y)return void(1!==e&&(t.globalAlpha=n));t.save(),t.beginPath(),t.rect(s,a,c,y),t.clip()}if(u=!1,this instanceof tr){if(u=!0,!this.isVisible())return void(1!==e&&(t.globalAlpha=n));this.El&&i.ek("drawShadows")&&(s=this.Bm,i.fz=s.x*i.scale*i.He,i.gz=s.y*i.scale*i.He,i.Qh=this.Qh,i.Vg=this.Vg,An(i,t),t.shadowColor=i.Vg)}s=!1,this.aa&&i.ek("drawShadows")&&(s=this.aa.El),!0===this.Pp?An(i,t):!1===this.Pp&&Dn(t),null!==this.nc&&(qn(this,t,this.nc,!0,!0),this.nc instanceof kn&&this.nc.type===ku?(t.beginPath(),t.rect(l.x,l.y,l.width,l.height),zn(t,this.nc)):t.fillRect(l.x,l.y,l.width,l.height)),o.Ft()||t.transform(o.m11,o.m12,o.m21,o.m22,o.dx,o.dy),null!==this.Kb&&(y=this.Ia,a=l=0,c=y.width,y=y.height,p=0,this instanceof To&&(y=this.Ua.nb,l=y.x,a=y.y,c=y.width,y=y.height,p=this.Uh),qn(this,t,this.Kb,!0,!1),this.Kb instanceof kn&&this.Kb.type===ku?(t.beginPath(),t.rect(l-p/2,a-p/2,c+p,y+p),zn(t,this.Kb)):t.fillRect(l-p/2,a-p/2,c+p,y+p)),s&&(null!==this.Kb||null!==this.nc||null!==r&&0!=(512&r.fa)||null!==r&&(r.type===Ru||r.type===Iu)&&r.af()!==this)?(Hn(this,!0),null===this.Pp&&Dn(t)):Hn(this,!1),this.ak(t,i),s&&0!=(512&this.fa)==!0&&An(i,t),u&&s&&Dn(t),h?(t.restore(),this instanceof eo?te(i,t,!0):te(i,t,!1)):o.Ft()||(r=1/(o.m11*o.m22-o.m12*o.m21),t.transform(o.m22*r,-o.m12*r,-o.m21*r,o.m11*r,r*(o.m21*o.dy-o.m22*o.dx),r*(o.m12*o.dx-o.m11*o.dy)))}1!==e&&(t.globalAlpha=n)}}},Mn.prototype.ak=function(){},Mn.prototype.isContainedBy=Mn.prototype.Cl=function(t){if(t instanceof eo)t:{if(this!==t&&null!==t)for(var i=this.T;null!==i;){if(i===t){t=!0;break t}i=i.T}t=!1}else t=!1;return t},Mn.prototype.isVisibleObject=Mn.prototype.Fl=function(){if(!this.visible)return!1;var t=this.T;return null===t||t.Fl()},(mh=Mn.prototype).Q=function(t){if(void 0===t&&(t=!1),!0!==Yn(this)){Wn(this,!0),Qn(this,!0);if(null!==(i=this.T)?t||i.Q():null!==(t=this.g)&&(t.eg.add(this),this instanceof wr&&(t.ma.kb||this.ff(),null!==this.fe&&In(this.fe)),t.Re(!0)),this instanceof eo){this.ja!==Ru&&this.ja!==Ku||null!==(t=this.af())&&t.Q(!0);for(var i=(t=this.Aa.n).length,e=0;e<i;e++){var n=t[e];!0!==Yn(n)&&(n.ya.K()||(n instanceof ws||n instanceof eo||n instanceof zo||Rn(n,!1)!==Su)&&n.Q(!0))}}}},mh.mp=function(){!1===Yn(this)&&(Wn(this,!0),Qn(this,!0))},mh.vi=function(){0!=(2048&this.fa)==!1&&(Un(this,!0),Jn(this,!0))},mh.Wz=function(){Jn(this,!0)},mh.qa=function(){var t=this.aa;null!==t&&t.qa()},xh.defineProperty(Mn,{fu:"segmentOrientation"},function(){return this.ss},function(t){var i=this.ss;i!==t&&(this.ss=t,this.Q(),this.h("segmentOrientation",i,t),t===Nf&&(this.angle=0))}),xh.defineProperty(Mn,{ve:"segmentIndex"},function(){return this.qs},function(t){t=Math.round(t);var i=this.qs;i!==t&&(this.qs=t,this.Q(),this.h("segmentIndex",i,t))}),xh.defineProperty(Mn,{Ex:"segmentFraction"},function(){return this.ps},function(t){isNaN(t)?t=0:0>t?t=0:1<t&&(t=1);var i=this.ps;i!==t&&(this.ps=t,this.Q(),this.h("segmentFraction",i,t))}),xh.defineProperty(Mn,{rF:"segmentOffset"},function(){return this.rs},function(t){var i=this.rs;i.L(t)||(this.rs=t=t.S(),this.Q(),this.h("segmentOffset",i,t))}),xh.defineProperty(Mn,{stretch:"stretch"},function(){return this.Th},function(t){var i=this.Th;i!==t&&(this.Th=t,this.Q(),this.h("stretch",i,t))}),xh.defineProperty(Mn,{name:"name"},function(){return this.Qb},function(t){var i=this.Qb;i!==t&&(this.Qb=t,null!==this.aa&&(this.aa.pm=null),this.h("name",i,t))}),xh.defineProperty(Mn,{opacity:"opacity"},function(){return this.Rc},function(t){var i=this.Rc;i!==t&&(xh.j(t,"number",Mn,"opacity"),(0>t||1<t)&&xh.wa(t,"0 <= value <= 1",Mn,"opacity"),this.Rc=t,this.h("opacity",i,t),t=this.g,i=this.aa,null!==t&&null!==i&&t.qa(rr(i,i.Y)))}),xh.defineProperty(Mn,{visible:"visible"},function(){return 0!=(1&this.fa)},function(t){var i=0!=(1&this.fa);i!==t&&(this.fa^=1,this.h("visible",i,t),null!==(i=this.T)?i.Q():this instanceof tr&&this.rd(t),this.qa(),_n(this))}),xh.defineProperty(Mn,{Cg:"pickable"},function(){return 0!=(2&this.fa)},function(t){var i=0!=(2&this.fa);i!==t&&(this.fa^=2,this.h("pickable",i,t))}),xh.defineProperty(Mn,{FH:"fromLinkableDuplicates"},function(){return 0!=(4&this.fa)},function(t){var i=0!=(4&this.fa);i!==t&&(this.fa^=4,this.h("fromLinkableDuplicates",i,t))}),xh.defineProperty(Mn,{GH:"fromLinkableSelfNode"},function(){return 0!=(8&this.fa)},function(t){var i=0!=(8&this.fa);i!==t&&(this.fa^=8,this.h("fromLinkableSelfNode",i,t))}),xh.defineProperty(Mn,{zJ:"toLinkableDuplicates"},function(){return 0!=(16&this.fa)},function(t){var i=0!=(16&this.fa);i!==t&&(this.fa^=16,this.h("toLinkableDuplicates",i,t))}),xh.defineProperty(Mn,{AJ:"toLinkableSelfNode"},function(){return 0!=(32&this.fa)},function(t){var i=0!=(32&this.fa);i!==t&&(this.fa^=32,this.h("toLinkableSelfNode",i,t))}),xh.defineProperty(Mn,{Rf:"isPanelMain"},function(){return 0!=(64&this.fa)},function(t){var i=0!=(64&this.fa);i!==t&&(this.fa^=64,this.Q(),this.h("isPanelMain",i,t))}),xh.defineProperty(Mn,{Zw:"isActionable"},function(){return 0!=(128&this.fa)},function(t){var i=0!=(128&this.fa);i!==t&&(this.fa^=128,this.h("isActionable",i,t))}),xh.defineProperty(Mn,{Jm:"areaBackground"},function(){return this.nc},function(t){var i=this.nc;i!==t&&(t instanceof kn&&t.freeze(),this.nc=t,this.qa(),this.h("areaBackground",i,t))}),xh.defineProperty(Mn,{background:"background"},function(){return this.Kb},function(t){var i=this.Kb;i!==t&&(t instanceof kn&&t.freeze(),this.Kb=t,this.qa(),this.h("background",i,t))}),xh.u(Mn,{aa:"part"},function(){if(this instanceof tr)return this;if(null!==this.tm)return this.tm;var t;for(t=this.T;t;){if(t instanceof tr)return this.tm=t;t=t.T}return null}),xh.u(Mn,{T:"panel"},function(){return this.Tg}),Mn.prototype.Ll=function(t){this.Tg=t},xh.u(Mn,{layer:"layer"},function(){var t=this.aa;return null!==t?t.layer:null},{configurable:!0}),xh.u(Mn,{g:"diagram"},function(){var t=this.aa;return null!==t?t.g:null},{configurable:!0}),xh.defineProperty(Mn,{position:"position"},function(){return this.mb},function(t){var i=this.mb;i.L(t)||(t=t.S(),this.LA(t,i)&&this.h("position",i,t))}),Mn.prototype.LA=function(t){return this.mb=t,In(this),this.vi(),!0},Mn.prototype.Jx=function(t,i){this.mb.m(t,i),er(this),this.vi()},xh.u(Mn,{Y:"actualBounds"},function(){return this.mc}),xh.defineProperty(Mn,{scale:"scale"},function(){return this.Vb},function(t){var i=this.Vb;i!==t&&(0>=t&&xh.k("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Vb=t,this.vi(),this.Q(),this.h("scale",i,t))}),xh.defineProperty(Mn,{angle:"angle"},function(){return this.Ul},function(t){var i=this.Ul;i!==t&&(0>(t%=360)&&(t+=360),i!==t&&(this.Ul=t,this.Q(),this.vi(),this.h("angle",i,t)))}),xh.defineProperty(Mn,{ya:"desiredSize"},function(){return this.nf},function(t){var i=this.nf;i.L(t)||(this.nf=t=t.S(),this.Q(),this instanceof To&&this.se(),this.h("desiredSize",i,t),null!==(t=this.aa)&&0!=(1024&this.fa)&&(Sn(this,t,"width"),Sn(this,t,"height")))}),xh.defineProperty(Mn,{width:"width"},function(){return this.nf.width},function(t){if(this.nf.width!==t){var i=this.nf;this.nf=t=new k(t,this.nf.height).freeze(),this.Q(),this instanceof To&&this.se(),this.h("desiredSize",i,t),null!==(i=this.aa)&&0!=(1024&this.fa)&&Sn(this,i,"width")}}),xh.defineProperty(Mn,{height:"height"},function(){return this.nf.height},function(t){if(this.nf.height!==t){var i=this.nf;this.nf=t=new k(this.nf.width,t).freeze(),this.Q(),this instanceof To&&this.se(),this.h("desiredSize",i,t),null!==(i=this.aa)&&0!=(1024&this.fa)&&Sn(this,i,"height")}}),xh.defineProperty(Mn,{gh:"minSize"},function(){return this.Ej},function(t){var i=this.Ej;i.L(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),this.Ej=t,this.Q(),this.h("minSize",i,t))}),xh.defineProperty(Mn,{yf:"maxSize"},function(){return this.Cj},function(t){var i=this.Cj;i.L(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),this.Cj=t,this.Q(),this.h("maxSize",i,t))}),xh.u(Mn,{Ca:"measuredBounds"},function(){return this.md}),xh.u(Mn,{Ia:"naturalBounds"},function(){return this.Qc},{configurable:!0}),xh.defineProperty(Mn,{margin:"margin"},function(){return this.wr},function(t){"number"==typeof t&&(t=new j(t));var i=this.wr;i.L(t)||(this.wr=t=t.S(),this.Q(),this.h("margin",i,t))}),xh.u(Mn,{transform:null},function(){return 0!=(2048&this.fa)==!0&&Bn(this),this.me}),xh.u(Mn,{Xg:null},function(){return 0!=(4096&this.fa)==!0&&Bn(this),this.fq}),xh.defineProperty(Mn,{alignment:"alignment"},function(){return this.Ce},function(t){var i=this.Ce;i.L(t)||(t.te()&&!t.Uc()&&xh.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.Ce=t=t.S(),In(this),this.h("alignment",i,t))}),xh.defineProperty(Mn,{column:"column"},function(){return this.nq},function(t){t=Math.round(t);var i=this.nq;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"column"),this.nq=t,this.Q(),this.h("column",i,t))}),xh.defineProperty(Mn,{aH:"columnSpan"},function(){return this.li},function(t){t=Math.round(t);var i=this.li;i!==t&&(1>t&&xh.wa(t,">= 1",Mn,"columnSpan"),this.li=t,this.Q(),this.h("columnSpan",i,t))}),xh.defineProperty(Mn,{cc:"row"},function(){return this.ls},function(t){t=Math.round(t);var i=this.ls;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"row"),this.ls=t,this.Q(),this.h("row",i,t))}),xh.defineProperty(Mn,{rowSpan:"rowSpan"},function(){return this.Ji},function(t){t=Math.round(t);var i=this.Ji;i!==t&&(1>t&&xh.wa(t,">= 1",Mn,"rowSpan"),this.Ji=t,this.Q(),this.h("rowSpan",i,t))}),xh.defineProperty(Mn,{Mx:"spanAllocation"},function(){return this.Ds},function(t){var i=this.Ds;i!==t&&(null!==t&&xh.j(t,"function",Mn,"spanAllocation"),this.Ds=t,this.h("spanAllocation",i,t))}),xh.defineProperty(Mn,{Wj:"alignmentFocus"},function(){return this.eq},function(t){var i=this.eq;i.L(t)||(!t.te()||t.Uc()||t.L(Ch)&&this instanceof wr||xh.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+t),this.eq=t=t.S(),this.Q(),this.h("alignmentFocus",i,t))}),xh.defineProperty(Mn,{Sd:"portId"},function(){return this.Yr},function(t){var i=this.Yr;if(i!==t){var e=this.aa;if(null===e||e instanceof wr||(xh.k("Cannot set portID on a Link: "+t),e=null),null!==i&&null!==e&&jr(e,this),this.Yr=t,null!==t&&e){e.Fh=!0,null===e.Wd&&Cr(e);var n=this.Sd;null!==n&&e.Wd.add(n,this)}this.h("portId",i,t)}}),xh.defineProperty(Mn,{Bb:"toSpot"},function(){return null!==this.ga?this.ga.Tj:Ch},function(t){this.Ne();var i=this.ga.Tj;i.L(t)||(t=t.S(),this.ga.Tj=t,this.h("toSpot",i,t),_n(this))}),xh.defineProperty(Mn,{Ql:"toEndSegmentLength"},function(){return null!==this.ga?this.ga.Rj:10},function(t){this.Ne();var i=this.ga.Rj;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"toEndSegmentLength"),this.ga.Rj=t,this.h("toEndSegmentLength",i,t),_n(this))}),xh.defineProperty(Mn,{pu:"toEndSegmentDirection"},function(){return null!==this.ga?this.ga.Qj:kf},function(t){this.Ne();var i=this.ga.Qj;i!==t&&(this.ga.Qj=t,this.h("toEndSegmentDirection",i,t),_n(this))}),xh.defineProperty(Mn,{qu:"toShortLength"},function(){return null!==this.ga?this.ga.Sj:0},function(t){this.Ne();var i=this.ga.Sj;i!==t&&(this.ga.Sj=t,this.h("toShortLength",i,t),_n(this))}),xh.defineProperty(Mn,{EF:"toLinkable"},function(){return this.Js},function(t){var i=this.Js;i!==t&&(this.Js=t,this.h("toLinkable",i,t))}),xh.defineProperty(Mn,{BJ:"toMaxLinks"},function(){return this.Ks},function(t){var i=this.Ks;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"toMaxLinks"),this.Ks=t,this.h("toMaxLinks",i,t))}),xh.defineProperty(Mn,{Ab:"fromSpot"},function(){return null!==this.ga?this.ga.rj:Ch},function(t){this.Ne();var i=this.ga.rj;i.L(t)||(t=t.S(),this.ga.rj=t,this.h("fromSpot",i,t),_n(this))}),xh.defineProperty(Mn,{sl:"fromEndSegmentLength"},function(){return null!==this.ga?this.ga.pj:10},function(t){this.Ne();var i=this.ga.pj;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"fromEndSegmentLength"),this.ga.pj=t,this.h("fromEndSegmentLength",i,t),_n(this))}),xh.defineProperty(Mn,{vt:"fromEndSegmentDirection"},function(){return null!==this.ga?this.ga.oj:kf},function(t){this.Ne();var i=this.ga.oj;i!==t&&(this.ga.oj=t,this.h("fromEndSegmentDirection",i,t),_n(this))}),xh.defineProperty(Mn,{wt:"fromShortLength"},function(){return null!==this.ga?this.ga.qj:0},function(t){this.Ne();var i=this.ga.qj;i!==t&&(this.ga.qj=t,this.h("fromShortLength",i,t),_n(this))}),xh.defineProperty(Mn,{nE:"fromLinkable"},function(){return this.Rq},function(t){var i=this.Rq;i!==t&&(this.Rq=t,this.h("fromLinkable",i,t))}),xh.defineProperty(Mn,{HH:"fromMaxLinks"},function(){return this.Sq},function(t){var i=this.Sq;i!==t&&(0>t&&xh.wa(t,">= 0",Mn,"fromMaxLinks"),this.Sq=t,this.h("fromMaxLinks",i,t))}),xh.defineProperty(Mn,{cursor:"cursor"},function(){return this.zq},function(t){var i=this.zq;i!==t&&(xh.j(t,"string",Mn,"cursor"),this.zq=t,this.h("cursor",i,t))}),xh.defineProperty(Mn,{click:"click"},function(){return null!==this.ia?this.ia.ji:null},function(t){Pn(this);var i=this.ia.ji;i!==t&&(null!==t&&xh.j(t,"function",Mn,"click"),this.ia.ji=t,this.h("click",i,t))}),xh.defineProperty(Mn,{kt:"doubleClick"},function(){return null!==this.ia?this.ia.si:null},function(t){Pn(this);var i=this.ia.si;i!==t&&(null!==t&&xh.j(t,"function",Mn,"doubleClick"),this.ia.si=t,this.h("doubleClick",i,t))}),xh.defineProperty(Mn,{Dz:"contextClick"},function(){return null!==this.ia?this.ia.mi:null},function(t){Pn(this);var i=this.ia.mi;i!==t&&(null!==t&&xh.j(t,"function",Mn,"contextClick"),this.ia.mi=t,this.h("contextClick",i,t))}),xh.defineProperty(Mn,{Qt:"mouseEnter"},function(){return null!==this.ia?this.ia.Ir:null},function(t){Pn(this);var i=this.ia.Ir;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseEnter"),this.ia.Ir=t,this.h("mouseEnter",i,t))}),xh.defineProperty(Mn,{Rt:"mouseLeave"},function(){return null!==this.ia?this.ia.Jr:null},function(t){Pn(this);var i=this.ia.Jr;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseLeave"),this.ia.Jr=t,this.h("mouseLeave",i,t))}),xh.defineProperty(Mn,{mA:"mouseOver"},function(){return null!==this.ia?this.ia.Fi:null},function(t){Pn(this);var i=this.ia.Fi;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseOver"),this.ia.Fi=t,this.h("mouseOver",i,t))}),xh.defineProperty(Mn,{lA:"mouseHover"},function(){return null!==this.ia?this.ia.Ei:null},function(t){Pn(this);var i=this.ia.Ei;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseHover"),this.ia.Ei=t,this.h("mouseHover",i,t))}),xh.defineProperty(Mn,{kA:"mouseHold"},function(){return null!==this.ia?this.ia.Di:null},function(t){Pn(this);var i=this.ia.Di;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseHold"),this.ia.Di=t,this.h("mouseHold",i,t))}),xh.defineProperty(Mn,{GI:"mouseDragEnter"},function(){return null!==this.ia?this.ia.Gr:null},function(t){Pn(this);var i=this.ia.Gr;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseDragEnter"),this.ia.Gr=t,this.h("mouseDragEnter",i,t))}),xh.defineProperty(Mn,{HI:"mouseDragLeave"},function(){return null!==this.ia?this.ia.Hr:null},function(t){Pn(this);var i=this.ia.Hr;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseDragLeave"),this.ia.Hr=t,this.h("mouseDragLeave",i,t))}),xh.defineProperty(Mn,{jA:"mouseDrop"},function(){return null!==this.ia?this.ia.Ci:null},function(t){Pn(this);var i=this.ia.Ci;i!==t&&(null!==t&&xh.j(t,"function",Mn,"mouseDrop"),this.ia.Ci=t,this.h("mouseDrop",i,t))}),xh.defineProperty(Mn,{xD:"actionDown"},function(){return null!==this.ia?this.ia.Zp:null},function(t){Pn(this);var i=this.ia.Zp;i!==t&&(null!==t&&xh.j(t,"function",Mn,"actionDown"),this.ia.Zp=t,this.h("actionDown",i,t))}),xh.defineProperty(Mn,{yD:"actionMove"},function(){return null!==this.ia?this.ia.$p:null},function(t){Pn(this);var i=this.ia.$p;i!==t&&(null!==t&&xh.j(t,"function",Mn,"actionMove"),this.ia.$p=t,this.h("actionMove",i,t))}),xh.defineProperty(Mn,{zD:"actionUp"},function(){return null!==this.ia?this.ia.aq:null},function(t){Pn(this);var i=this.ia.aq;i!==t&&(null!==t&&xh.j(t,"function",Mn,"actionUp"),this.ia.aq=t,this.h("actionUp",i,t))}),xh.defineProperty(Mn,{wD:"actionCancel"},function(){return null!==this.ia?this.ia.Yp:null},function(t){Pn(this);var i=this.ia.Yp;i!==t&&(null!==t&&xh.j(t,"function",Mn,"actionCancel"),this.ia.Yp=t,this.h("actionCancel",i,t))}),xh.defineProperty(Mn,{TA:"toolTip"},function(){return null!==this.ia?this.ia.Ni:null},function(t){Pn(this);var i=this.ia.Ni;i!==t&&(null!==t&&xh.A(t,xr,Mn,"toolTip"),this.ia.Ni=t,this.h("toolTip",i,t))}),xh.defineProperty(Mn,{contextMenu:"contextMenu"},function(){return null!==this.ia?this.ia.ni:null},function(t){Pn(this);var i=this.ia.ni;i!==t&&(null!==t&&xh.A(t,xr,Mn,"contextMenu"),this.ia.ni=t,this.h("contextMenu",i,t))}),Mn.prototype.bind=Mn.prototype.bind=function(t){t.ng=this;var i=this.dp();null!==i&&mo(i)&&xh.k("Cannot add a Binding to a template that has already been copied: "+t),null===this.sc&&(this.sc=new u(Tt)),this.sc.add(t)},Mn.prototype.findTemplateBinder=Mn.prototype.dp=function(){for(var t=this instanceof eo?this:this.T;null!==t;){if(null!==t.zk)return t;t=t.T}return null},Mn.prototype.setProperties=function(t){xh.hu(this,t)};var Fu;Mn.make=Fu=function(i,e){var n=arguments,o=null,r=null;if("function"==typeof i)r=i;else if("string"==typeof i){var s=zu.ka(i);"function"==typeof s?(n=xh.il(arguments),o=s(n)):r=bh[i]}if(null===o&&(void 0===r&&(void 0!==(o=t.$)&&void 0!==o.noop&&xh.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),xh.k("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==r&&r.constructor||xh.k("GraphObject.make requires a class function or class name, not: "+i),o=new r),s=1,o instanceof Qi&&1<n.length){var a=o;("string"==typeof(r=n[1])||r instanceof HTMLDivElement)&&(vn(a,r),s++)}for(;s<n.length;s++)void 0===(r=n[s])?xh.k("Undefined value at argument "+s+" for object being constructed by GraphObject.make: "+o):to(o,r);return o};var zu=new m("string","function");Mn.getBuilders=function(){var t,i=new m("string","function");for(t in zu)if(t!==t.toLowerCase()){var e=zu[t];"function"==typeof e&&i.add(t,e)}return i.freeze(),i};var Ou;Mn.defineBuilder=Ou=function(t,i){xh.j(t,"string",Mn,"defineBuilder:name"),xh.j(i,"function",Mn,"defineBuilder:func");var e=t.toLowerCase();""!==t&&"none"!==e&&t!==e||xh.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+t),zu.add(t,i)};var qu;Mn.takeBuilderArgument=qu=function(t,i,e){void 0===e&&(e=null);var n=t[1];if("function"==typeof e?e(n):"string"==typeof n)return t.splice(1,1),n;if(void 0===i)throw Error("no "+("function"==typeof e?"satisfactory":"string")+" argument for GraphObject builder "+t[0]);return i},Ou("Button",function(){var t=new kn(wu);t.addColorStop(0,"white"),t.addColorStop(1,"lightgray");var i=new kn(wu);return i.addColorStop(0,"white"),i.addColorStop(1,"dodgerblue"),t=Fu(eo,Ru,{Zw:!0},{_buttonFillNormal:t,_buttonStrokeNormal:"gray",_buttonFillOver:i,_buttonStrokeOver:"blue"},Fu(To,{name:"ButtonBorder",Cb:"Rectangle",B:new D(0,0,2.761423749153968,2.761423749153968),C:new D(1,1,-2.761423749153968,-2.761423749153968),fill:t,stroke:"gray"})),t.Qt=function(t,i){var e=i.ae("ButtonBorder");if(e instanceof To){var n=i._buttonFillOver;i._buttonFillNormal=e.fill,e.fill=n,n=i._buttonStrokeOver,i._buttonStrokeNormal=e.stroke,e.stroke=n}},t.Rt=function(t,i){var e=i.ae("ButtonBorder");e instanceof To&&(e.fill=i._buttonFillNormal,e.stroke=i._buttonStrokeNormal)},t}),Ou("TreeExpanderButton",function(){var t=Fu("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Fu(To,{name:"ButtonIcon",Cb:"MinusLine",ya:hl.Vp},new Tt("figure","isTreeExpanded",function(t,i){var e=i.T;return t?e._treeExpandedFigure:e._treeCollapsedFigure}).px()),{visible:!1},new Tt("visible","isTreeLeaf",function(t){return!t}).px());return t.click=function(t,i){var e=i.aa;if(e instanceof xr&&(e=e.Wg),e instanceof wr){var n=e.g;if(null!==n){if(n=n.ob,e.qd){if(!n.canCollapseTree(e))return}else if(!n.canExpandTree(e))return;t.zc=!0,e.qd?n.collapseTree(e):n.expandTree(e)}}},t}),Ou("SubGraphExpanderButton",function(){var t=Fu("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Fu(To,{name:"ButtonIcon",Cb:"MinusLine",ya:hl.Vp},new Tt("figure","isSubGraphExpanded",function(t,i){var e=i.T;return t?e._subGraphExpandedFigure:e._subGraphCollapsedFigure}).px()));return t.click=function(t,i){var e=i.aa;if(e instanceof xr&&(e=e.Wg),e instanceof vs){var n=e.g;if(null!==n){if(n=n.ob,e.ee){if(!n.canCollapseSubGraph(e))return}else if(!n.canExpandSubGraph(e))return;t.zc=!0,e.ee?n.collapseSubGraph(e):n.expandSubGraph(e)}}},t}),Ou("ContextMenuButton",function(){var t=Fu("Button");t.stretch=ju;var i=t.ae("ButtonBorder");return i instanceof To&&(i.Cb="Rectangle",i.B=new D(0,0,2,3),i.C=new D(1,1,-2,-2)),t}),Ou("PanelExpanderButton",function(t){var i=qu(t,"COLLAPSIBLE"),e=(t=Fu("Button",Fu(To,"TriangleUp",{ya:new k(6,4)},new Tt("figure","visible",function(t){return t?"TriangleUp":"TriangleDown"}).px(i)))).ae("ButtonBorder");return e instanceof To&&(e.stroke=null,e.fill="transparent"),t.click=function(t,e){var n=e.g;if(null!==n&&!n.bb){var o=e.aa.ae(i);null!==o&&(n.Sb("Collapse/Expand Panel"),o.visible=!o.visible,n.Ad("Collapse/Expand Panel"))}},t}),Ou("CheckBoxButton",function(t){var i=qu(t);return t=Fu("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},Fu(To,{name:"ButtonIcon",IH:"M0 4 L3 9 9 0",pb:2,stretch:Lu,Qz:Du,visible:!1},""!==i?new Tt("visible",i).wI():[])),t.click=function(t,e){if(!(t.g.bb||""!==i&&t.g.Z.bb)){t.zc=!0;var n=e.ae("ButtonIcon");n.g.Sb("checkbox"),n.visible=!n.visible,"function"==typeof e._doClick&&e._doClick(t,e),n.g.Ad("checkbox")}},t}),Ou("CheckBox",function(t){t=qu(t),t=Fu("CheckBoxButton",t,{name:"Button",margin:new j(0,1,0,0)});var i=Fu(eo,"Horizontal",t,{Zw:!0,margin:1,_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,Qt:t.Qt,Rt:t.Rt,click:t.click,_buttonClick:t.click});return t.Qt=null,t.Rt=null,t.click=null,i}),io.prototype.copy=function(){var t=new io;return t.ji=this.ji,t.si=this.si,t.mi=this.mi,t.Ir=this.Ir,t.Jr=this.Jr,t.Fi=this.Fi,t.Ei=this.Ei,t.Di=this.Di,t.Gr=this.Gr,t.Hr=this.Hr,t.Ci=this.Ci,t.Zp=this.Zp,t.$p=this.$p,t.aq=this.aq,t.Yp=this.Yp,t.Ni=this.Ni,t.ni=this.ni,t},xh.Ja(eo,Mn),xh.Yh(eo),xh.ea("Panel",eo),eo.prototype.cloneProtected=function(t){if(Mn.prototype.cloneProtected.call(this,t),t.ja=this.ja,t.We=this.We.S(),t.Mg=this.Mg,t.ar=this.ar,t.Dq=this.Dq.S(),t.qi=this.qi,t.ja===Gu){t.lj=this.lj.S(),t.Ch=this.Ch,t.pi=this.pi,t.am=this.am,t.Bh=this.Bh,t.Ah=this.Ah,t.$l=this.$l;var i=[];if(0<this.Ld.length)for(var e=this.Ld,n=e.length,o=0;o<n;o++)if(void 0!==e[o]){var r=e[o].copy();r.Ll(t),i[o]=r}if(t.Ld=i,i=[],0<this.Gd.length)for(e=this.Gd,n=e.length,o=0;o<n;o++)void 0!==e[o]&&((r=e[o].copy()).Ll(t),i[o]=r);t.Gd=i,t.zm=this.zm,t.Yl=this.Yl,t.Oi=this.Oi,t.zi=this.zi}t.No=this.No,t.Wq=this.Wq.S(),t.Xq=this.Xq.S(),t.je=this.je,t.zk=this.zk,t.nr=this.nr,t.wj=this.wj,t.gg=this.gg,t.eo=this.eo,t.Pi.assign(this.Pi),t.Fh=this.Fh,null!==this.ms&&(t.ms=this.ms)},eo.prototype.Zh=function(t){Mn.prototype.Zh.call(this,t),t.Aa=this.Aa;for(var i=t.Aa.n,e=i.length,n=0;n<e;n++)i[n].Tg=t;t.Dm=null},eo.prototype.copy=function(){var t=Mn.prototype.copy.call(this);if(null!==t){for(var i=this.Aa.n,e=i.length,n=0;n<e;n++){var o=i[n].copy(),r=t;o.Ll(r),o.tm=null;var s=r.Aa,a=s.count;if(s.Cd(a,o),null!==(s=r.aa)){s.pm=null,null!==o.Sd&&s instanceof wr&&(s.Fh=!0);var h=r.g;null!==h&&h.ma.kb||s.Lc(Ml,"elements",r,null,o,null,a)}}return t}return null},eo.prototype.toString=function(){return"Panel("+this.type+")#"+xh.pd(this)};var Bu;eo.Position=Bu=xh.p(eo,"Position",0),eo.Horizontal=xh.p(eo,"Horizontal",1);var Eu;eo.Vertical=Eu=xh.p(eo,"Vertical",2);var Iu;eo.Spot=Iu=xh.p(eo,"Spot",3);var Ru;eo.Auto=Ru=xh.p(eo,"Auto",4);var Gu;eo.Table=Gu=xh.p(eo,"Table",5),eo.Viewbox=xh.p(eo,"Viewbox",6);var Vu;eo.TableRow=Vu=xh.p(eo,"TableRow",7);var Hu;eo.TableColumn=Hu=xh.p(eo,"TableColumn",8);var Ku;eo.Link=Ku=xh.p(eo,"Link",9);var Uu;eo.Grid=Uu=xh.p(eo,"Grid",10),xh.defineProperty(eo,{type:"type"},function(){return this.ja},function(t){var i=this.ja;i!==t&&(i!==Vu&&i!==Hu||xh.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+t),this.ja=t,this.ja===Uu?this.Mg=!0:this.ja===Gu&&no(this),this.Q(),this.h("type",i,t))}),xh.u(eo,{elements:"elements"},function(){return this.Aa.i}),xh.u(eo,{Ia:"naturalBounds"},function(){return this.Qc}),xh.defineProperty(eo,{padding:"padding"},function(){return this.We},function(t){"number"==typeof t?(0>t&&xh.wa(t,">= 0",eo,"padding"),t=new j(t)):(xh.A(t,j,eo,"padding"),0>t.left&&xh.wa(t.left,">= 0",eo,"padding:value.left"),0>t.right&&xh.wa(t.right,">= 0",eo,"padding:value.right"),0>t.top&&xh.wa(t.top,">= 0",eo,"padding:value.top"),0>t.bottom&&xh.wa(t.bottom,">= 0",eo,"padding:value.bottom"));var i=this.We;i.L(t)||(this.We=t=t.S(),this.Q(),this.h("padding",i,t))}),xh.defineProperty(eo,{ml:"defaultAlignment"},function(){return this.Dq},function(t){var i=this.Dq;i.L(t)||(this.Dq=t=t.S(),this.Q(),this.h("defaultAlignment",i,t))}),xh.defineProperty(eo,{Md:"defaultStretch"},function(){return this.qi},function(t){var i=this.qi;i!==t&&(xh.rb(t,Mn,eo,"defaultStretch"),this.qi=t,this.Q(),this.h("defaultStretch",i,t))}),xh.defineProperty(eo,{xK:"defaultSeparatorPadding"},function(){return void 0===this.lj?hl.Wp:this.lj},function(t){if(void 0!==this.lj){"number"==typeof t&&(t=new j(t));var i=this.lj;i.L(t)||(this.lj=t=t.S(),this.h("defaultSeparatorPadding",i,t))}}),xh.defineProperty(eo,{vK:"defaultRowSeparatorStroke"},function(){return void 0===this.pi?null:this.pi},function(t){var i=this.pi;i!==t&&(null===t||"string"==typeof t||t instanceof kn)&&(t instanceof kn&&t.freeze(),this.pi=t,this.h("defaultRowSeparatorStroke",i,t))}),xh.defineProperty(eo,{wK:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Ch?1:this.Ch},function(t){if(void 0!==this.Ch){var i=this.Ch;i!==t&&isFinite(t)&&0<=t&&(this.Ch=t,this.h("defaultRowSeparatorStrokeWidth",i,t))}}),xh.defineProperty(eo,{uK:"defaultRowSeparatorDashArray"},function(){return void 0===this.am?null:this.am},function(t){if(void 0!==this.am){var i=this.am;if(i!==t){if(null===t||Array.isArray(t)||xh.Ed(t,"Array",eo,"defaultRowSeparatorDashArray:value"),null!==t){for(var e=t.length,n=0,o=0;o<e;o++){var r=t[o];"number"==typeof r&&0<=r&&isFinite(r)||xh.k("defaultRowSeparatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===i)return;t=null}}this.am=t,this.qa(),this.h("defaultRowSeparatorDashArray",i,t)}}}),xh.defineProperty(eo,{pK:"defaultColumnSeparatorStroke"},function(){return void 0===this.Ah?null:this.Ah},function(t){if(void 0!==this.Ah){var i=this.Ah;i!==t&&(null===t||"string"==typeof t||t instanceof kn)&&(t instanceof kn&&t.freeze(),this.Ah=t,this.h("defaultColumnSeparatorStroke",i,t))}}),xh.defineProperty(eo,{qK:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.Bh?1:this.Bh},function(t){if(void 0!==this.Bh){var i=this.Bh;i!==t&&isFinite(t)&&0<=t&&(this.Bh=t,this.h("defaultColumnSeparatorStrokeWidth",i,t))}}),xh.defineProperty(eo,{oK:"defaultColumnSeparatorDashArray"},function(){return void 0===this.$l?null:this.$l},function(t){if(void 0!==this.$l){var i=this.$l;if(i!==t){if(null===t||Array.isArray(t)||xh.Ed(t,"Array",eo,"defaultColumnSeparatorDashArray:value"),null!==t){for(var e=t.length,n=0,o=0;o<e;o++){var r=t[o];"number"==typeof r&&0<=r&&isFinite(r)||xh.k("defaultColumnSeparatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===i)return;t=null}}this.$l=t,this.qa(),this.h("defaultColumnSeparatorDashArray",i,t)}}}),xh.defineProperty(eo,{KL:"viewboxStretch"},function(){return this.No},function(t){var i=this.No;i!==t&&(xh.rb(t,Mn,eo,"viewboxStretch"),this.No=t,this.h("viewboxStretch",i,t))}),xh.defineProperty(eo,{Ww:"gridCellSize"},function(){return this.Wq},function(t){var i=this.Wq;i.L(t)||(xh.A(t,k,eo,"gridCellSize"),t.K()&&0!==t.width&&0!==t.height||xh.k("Invalid Panel.gridCellSize: "+t),this.Wq=t.S(),null!==this.g&&this===this.g.xt&&Le(this.g),this.qa(),this.h("gridCellSize",i,t))}),xh.defineProperty(eo,{sE:"gridOrigin"},function(){return this.Xq},function(t){var i=this.Xq;i.L(t)||(xh.A(t,b,eo,"gridOrigin"),t.K()||xh.k("Invalid Panel.gridOrigin: "+t),this.Xq=t.S(),null!==this.g&&Le(this.g),this.qa(),this.h("gridOrigin",i,t))}),(mh=eo.prototype).Mv=function(t){Mn.prototype.Mv.call(this,t);for(var i=this.Aa.n,e=i.length,n=0;n<e;n++)i[n].Mv(t)},mh.ak=function(t,i){if(this.ja===Uu){var e=this.Yi()*i.scale;0>=e&&(e=1);var n=(o=this.Ww).width,o=o.height,r=(s=this.Ia).width,s=s.height,a=Math.ceil(r/n),h=Math.ceil(s/o),l=this.sE;t.save(),t.beginPath(),t.rect(0,0,r,s),t.clip();for(var u=[],f=this.Aa.n,c=f.length,p=0;p<c;p++){var d=f[p],y=[];if(u.push(y),d.visible)for(var d=ao(d.Cb),v=p+1;v<c;v++){var g=f[v];g.visible&&ao(g.Cb)===d&&2<=(g=g.interval)&&y.push(g)}}for(c=(f=this.Aa.n).length,p=0;p<c;p++){var m=f[p];if(m.visible&&(y=m.interval,!(2>n*y*e))){var d=u[p],v=!1,b=!0,x=m.CF;if(null!==x&&(v=!0,void 0!==t.setLineDash?(t.setLineDash(x),t.lineDashOffset=m.nd):void 0!==t.webkitLineDash?(t.webkitLineDash=x,t.webkitLineDashOffset=m.nd):void 0!==t.mozDash?(t.mozDash=x,t.mozDashOffset=m.nd):b=!1),"LineV"===m.Cb){t.lineWidth=m.pb,qn(this,t,m.stroke,!1,!1),t.beginPath();for(var w=g=Math.floor(-l.x/n);w<=g+a;w++){var k=w*n+l.x;0<=k&&k<r&&so(w,y,d)&&(v&&!b?Tn(t,k,0,k,s,x,m.nd):(t.moveTo(k,0),t.lineTo(k,s)))}t.stroke()}else if("LineH"===m.Cb){for(t.lineWidth=m.pb,qn(this,t,m.stroke,!1,!1),t.beginPath(),w=g=Math.floor(-l.y/o);w<=g+h;w++)0<=(k=w*o+l.y)&&k<=s&&so(w,y,d)&&(v&&!b?Tn(t,0,k,r,k,x,m.nd):(t.moveTo(0,k),t.lineTo(r,k)));t.stroke()}else if("BarV"===m.Cb)for(qn(this,t,m.fill,!0,!1),m=m.width,isNaN(m)&&(m=n),w=g=Math.floor(-l.x/n);w<=g+a;w++)0<=(k=w*n+l.x)&&k<r&&so(w,y,d)&&t.fillRect(k,0,m,s);else if("BarH"===m.Cb)for(qn(this,t,m.fill,!0,!1),m=m.height,isNaN(m)&&(m=o),w=g=Math.floor(-l.y/o);w<=g+h;w++)0<=(k=w*o+l.y)&&k<=s&&so(w,y,d)&&t.fillRect(0,k,r,m);v&&(void 0!==t.setLineDash?(t.setLineDash(xh.vh),t.lineDashOffset=0):void 0!==t.webkitLineDash?(t.webkitLineDash=xh.vh,t.webkitLineDashOffset=0):void 0!==t.mozDash&&(t.mozDash=null,t.mozDashOffset=0))}}t.restore(),te(i,t,!1)}else{for(this.ja===Gu&&(t.lineCap="butt",ro(this,t,!0,this.Ld,!0),ro(this,t,!1,this.Gd,!0),oo(this,t,!0,this.Ld),oo(this,t,!1,this.Gd),ro(this,t,!0,this.Ld,!1),ro(this,t,!1,this.Gd,!1)),(e=this.CE)&&t.save(),n=this.af(),r=(o=this.Aa.n).length,s=0;s<r;s++)a=o[s],e&&a===n&&(t.xu=!0),a.$e(t,i),e&&a===n&&(t.xu=!1);e&&(t.restore(),te(i,t,!1))}},mh.ip=function(t,i,e,n,o){var r=this.Gg(),s=this.transform,a=1/(s.m11*s.m22-s.m12*s.m21),h=s.m22*a,l=-s.m12*a,u=-s.m21*a,f=s.m11*a,c=a*(s.m21*s.dy-s.m22*s.dx),p=a*(s.m12*s.dx-s.m11*s.dy);if(null!==this.Jm)return s=this.Y,hl.xl(s.left,s.top,s.right,s.bottom,t,i,e,n,o);if(null!==this.background)r=t*h+i*u+c,a=t*l+i*f+p,t=e*h+n*u+c,e=e*l+n*f+p,o.m(0,0),n=this.Ia,e=hl.xl(0,0,n.width,n.height,r,a,t,e,o),o.transform(s);else{for(r||(h=1,u=l=0,f=1,p=c=0),a=t*h+i*u+c,t=t*l+i*f+p,h=e*h+n*u+c,n=e*l+n*f+p,o.m(h,n),l=(h-a)*(h-a)+(n-t)*(n-t),e=!1,p=(f=this.Aa.n).length,u=xh.M(),c=0;c<p;c++)(i=f[c]).visible&&i.ip(a,t,h,n,u)&&(e=!0,(i=(a-u.x)*(a-u.x)+(t-u.y)*(t-u.y))<l&&(l=i,o.set(u)));xh.v(u),r&&o.transform(s)}return e},mh.Q=function(t){Mn.prototype.Q.call(this,t),this.ja===Ru&&null!==(t=this.af())&&t.Q(!0);for(var i=(t=this.Aa.n).length,e=0;e<i;e++){var n=t[e];!0!==Yn(n)&&(n.ya.K()||(n instanceof ws||n instanceof eo||n instanceof zo||Rn(n,!1)!==Su)&&n.Q(!0))}},mh.mp=function(){if(!1===Yn(this)){Wn(this,!0),Qn(this,!0);for(var t=this.Aa.n,i=t.length,e=0;e<i;e++)t[e].mp()}},mh.vi=function(){if(0!=(2048&this.fa)==!1){Un(this,!0),Jn(this,!0);for(var t=this.Aa.n,i=t.length,e=0;e<i;e++)t[e].Wz()}},mh.Wz=function(){Jn(this,!0);for(var t=this.Aa.n,i=t.length,e=0;e<i;e++)t[e].Wz()},mh.vp=function(t,i,e,n){var o=this.Pi;o.width=0,o.height=0;var r=this.ya,s=this.gh;void 0===e&&(e=s.width,n=s.height),e=Math.max(e,s.width),n=Math.max(n,s.height);var a=this.yf;isNaN(r.width)||(t=Math.min(r.width,a.width)),isNaN(r.height)||(i=Math.min(r.height,a.height)),t=Math.max(e,t),i=Math.max(n,i);var h=this.padding;t=Math.max(t-h.left-h.right,0),i=Math.max(i-h.top-h.bottom,0);var l=this.Aa.n;if(0!==l.length){var f=this.ja.Qb;switch(f){case"Position":var c=t,p=i,d=e,y=n,v=l.length;o.x=0,o.y=0,o.width=0;for(var g=o.height=0;g<v;g++){var m=l[g];if(m.visible||m===this.bc){var b=m.margin,x=b.right+b.left,w=b.top+b.bottom;jn(m,c,p,d,y);var k=m.Ca,T=Math.max(k.width+x,0),S=Math.max(k.height+w,0),N=m.position.x,j=m.position.y;if(isFinite(N)||(N=0),isFinite(j)||(j=0),m instanceof To){var L=m;if(L.EE)var D=L.pb/2,N=N-D,j=j-D}C(o,N,j,T,S)}}break;case"Vertical":for(var A=t,F=e,z=l.length,O=xh.lb(),q=0;q<z;q++){var B=l[q];if(B.visible||B===this.bc){var E=Rn(B,!1);if(E!==Su&&E!==Cu)O.push(B);else{var I=B.margin,R=I.right+I.left,G=I.top+I.bottom;jn(B,A,1/0,F,0);var V=B.Ca,H=Math.max(V.width+R,0),K=Math.max(V.height+G,0);o.width=Math.max(o.width,H),o.height+=K}}}var U=O.length;if(0!==U){for(this.ya.width?A=Math.min(this.ya.width,this.yf.width):0!==o.width&&(A=Math.min(o.width,this.yf.width)),q=0;q<U;q++)((B=O[q]).visible||B===this.bc)&&(I=B.margin,R=I.right+I.left,G=I.top+I.bottom,jn(B,A,1/0,F,0),V=B.Ca,H=Math.max(V.width+R,0),K=Math.max(V.height+G,0),o.width=Math.max(o.width,H),o.height+=K);xh.ta(O)}break;case"Horizontal":for(var J=i,Y=n,W=l.length,X=xh.lb(),Q=0;Q<W;Q++){var Z=l[Q];if(Z.visible||Z===this.bc){var $=Rn(Z,!1);if($!==Su&&$!==ju)X.push(Z);else{var _=Z.margin,tt=_.right+_.left,it=_.top+_.bottom;jn(Z,1/0,J,0,Y);var et=Z.Ca,nt=Math.max(et.width+tt,0),ot=Math.max(et.height+it,0);o.width+=nt,o.height=Math.max(o.height,ot)}}}var rt=X.length;if(0!==rt){for(this.ya.height?J=Math.min(this.ya.height,this.yf.height):0!==o.height&&(J=Math.min(o.height,this.yf.height)),Q=0;Q<rt;Q++)((Z=X[Q]).visible||Z===this.bc)&&(_=Z.margin,tt=_.right+_.left,it=_.top+_.bottom,jn(Z,1/0,J,0,Y),et=Z.Ca,nt=Math.max(et.width+tt,0),ot=Math.max(et.height+it,0),o.width+=nt,o.height=Math.max(o.height,ot));xh.ta(X)}break;case"Spot":t:{var st=t,at=i,ht=e,lt=n,ut=l.length,ft=this.af(),ct=ft.margin,pt=0,dt=0,yt=ct.right+ct.left,vt=ct.top+ct.bottom;jn(ft,st,at,ht,lt);var gt=(Mt=ft.Ca).width,mt=Mt.height,bt=Math.max(gt+yt,0),xt=Math.max(mt+vt,0);o.x=-ct.left,o.y=-ct.top,o.width=bt,o.height=xt;for(var wt=0;wt<ut;wt++){var kt=l[wt];if(kt!==ft&&(kt.visible||kt===this.bc)){pt=(ct=kt.margin).right+ct.left,dt=ct.top+ct.bottom,jn(kt,st,at,0,0);var Mt=kt.Ca,bt=Math.max(Mt.width+pt,0),xt=Math.max(Mt.height+dt,0),Pt=kt.alignment;Pt.Uc()&&(Pt=this.ml),Pt.ed()||(Pt=zh);var Tt=kt.Wj;Tt.Uc()&&(Tt=zh),C(o,Pt.x*gt+Pt.offsetX-(Tt.x*Mt.width-Tt.offsetX)-ct.left,Pt.y*mt+Pt.offsetY-(Tt.y*Mt.height-Tt.offsetY)-ct.top,bt,xt)}}var St=ft.stretch;switch(St===Nu&&(St=Rn(ft,!1)),St){case Su:break t;case Lu:if(!isFinite(st)&&!isFinite(at))break t;break;case ju:if(!isFinite(st))break t;break;case Cu:if(!isFinite(at))break t}for(gt=(Mt=ft.Ca).width,mt=Mt.height,bt=Math.max(gt+yt,0),xt=Math.max(mt+vt,0),ct=ft.margin,o.x=-ct.left,o.y=-ct.top,o.width=bt,o.height=xt,wt=0;wt<ut;wt++)(kt=l[wt])===ft||!kt.visible&&kt!==this.bc||(ct=kt.margin,pt=ct.right+ct.left,dt=ct.top+ct.bottom,Mt=kt.Ca,bt=Math.max(Mt.width+pt,0),xt=Math.max(Mt.height+dt,0),(Pt=kt.alignment).Uc()&&(Pt=this.ml),Pt.ed()||(Pt=zh),(Tt=kt.Wj).Uc()&&(Tt=zh),C(o,Pt.x*gt+Pt.offsetX-(Tt.x*Mt.width-Tt.offsetX)-ct.left,Pt.y*mt+Pt.offsetY-(Tt.y*Mt.height-Tt.offsetY)-ct.top,bt,xt))}break;case"Auto":var Nt=t,Ct=i,jt=e,Lt=n,Dt=l.length,At=this.af(),Ft=At.margin,zt=Ft.right+Ft.left,Ot=Ft.top+Ft.bottom;jn(At,Nt,Ct,jt,Lt);var qt=At.Ca,Bt=Math.max(qt.width+zt,0),Et=Math.max(qt.height+Ot,0),It=vo(At),Rt=It.x*Bt+It.offsetX,Gt=It.y*Et+It.offsetY,Vt=(It=go(At)).x*Bt+It.offsetX,Ht=It.y*Et+It.offsetY,Kt=Nt,Ut=Ct;isFinite(Nt)&&(Kt=Math.abs(Rt-Vt)),isFinite(Ct)&&(Ut=Math.abs(Gt-Ht));var Jt=xh.Pl();Jt.m(0,0);for(var Yt=0;Yt<Dt;Yt++){var Wt=l[Yt];if(Wt!==At&&(Wt.visible||Wt===this.bc)){var Xt=(Ft=Wt.margin).right+Ft.left,Qt=Ft.top+Ft.bottom;jn(Wt,Kt,Ut,0,0),qt=Wt.Ca,Bt=Math.max(qt.width+Xt,0),Et=Math.max(qt.height+Qt,0),Jt.m(Math.max(Bt,Jt.width),Math.max(Et,Jt.height))}}if(1===Dt)o.width=Bt,o.height=Et,xh.ck(Jt);else{var Zt=vo(At),$t=go(At),_t=0,ti=0;$t.x!==Zt.x&&$t.y!==Zt.y&&(_t=Jt.width/Math.abs($t.x-Zt.x),ti=Jt.height/Math.abs($t.y-Zt.y)),xh.ck(Jt);ei=0;if(At instanceof To){var ii=At,ei=ii.pb*ii.scale;jo(ii)===Du&&(_t=ti=Math.max(_t,ti))}var _t=_t+(Math.abs(Zt.offsetX)+Math.abs($t.offsetX)+ei),ti=ti+(Math.abs(Zt.offsetY)+Math.abs($t.offsetY)+ei),ni=At.stretch;switch(ni===Nu&&(ni=Rn(At,!1)),ni){case Su:Lt=jt=0;break;case Lu:isFinite(Nt)&&(_t=Nt),isFinite(Ct)&&(ti=Ct);break;case ju:isFinite(Nt)&&(_t=Nt),Lt=0;break;case Cu:jt=0,isFinite(Ct)&&(ti=Ct)}At instanceof To&&!At.ya.K()&&((ii=At).Oh?ii.Zl=null:ii.Ua=null),At.mp(),jn(At,_t,ti,jt,Lt),o.width=At.Ca.width+zt,o.height=At.Ca.height+Ot}break;case"Table":for(var oi=t,ri=i,si=e,ai=n,hi=l.length,li=xh.lb(),ui=xh.lb(),fi=0;fi<hi;fi++){var ci=(Zi=l[fi])instanceof eo?Zi:null;if(null===ci||ci.type!==Vu&&ci.type!==Hu||!Zi.visible)li.push(Zi);else{ui.push(Zi);for(var pi=ci.Aa.n,di=pi.length,yi=0;yi<di;yi++){var vi=pi[yi];ci.type===Vu?vi.cc=Zi.cc:ci.type===Hu&&(vi.column=Zi.column),li.push(vi)}}}0===(hi=li.length)&&(this.dd(0),this.cd(0));for(var gi=[],fi=0;fi<hi;fi++)Zi=li[fi],Wn(Zi,!0),Qn(Zi,!0),gi[Zi.cc]||(gi[Zi.cc]=[]),gi[Zi.cc][Zi.column]||(gi[Zi.cc][Zi.column]=[]),gi[Zi.cc][Zi.column].push(Zi);xh.ta(li);for(var mi=xh.lb(),bi=xh.lb(),xi=xh.lb(),wi={count:0},ki={count:0},Mi=oi,Pi=ri,Ti=this.Ld,hi=Ti.length,fi=0;fi<hi;fi++){void 0!==(pe=Ti[fi])&&(pe.Na=0)}for(hi=(Ti=this.Gd).length,fi=0;fi<hi;fi++)void 0!==(pe=Ti[fi])&&(pe.Na=0);for(var Si=gi.length,Ni=0,fi=0;fi<Si;fi++)gi[fi]&&(Ni=Math.max(Ni,gi[fi].length));for(var Ci=Math.min(this.Oi,Si-1),ji=Math.min(this.zi,Ni-1),Li=0,Si=gi.length,fi=0;fi<Si;fi++)if(gi[fi])for(var Ni=gi[fi].length,Di=this.dd(fi),yi=Di.Na=0;yi<Ni;yi++)if(gi[fi][yi]){$i=this.cd(yi);void 0===mi[yi]&&($i.Na=0,mi[yi]=!0);for(var Ai=gi[fi][yi],Fi=Ai.length,zi=0;zi<Fi;zi++)if((Zi=Ai[zi]).visible||Zi===this.bc){var Oi=1<Zi.Ji||1<Zi.li;Oi&&(fi<Ci||yi<ji||bi.push(Zi));var qi=(te=Zi.margin).right+te.left,Bi=te.top+te.bottom,Ei=Gn(Zi,Di,$i,!1),Ii=Zi.ya,Ri=!isNaN(Ii.height),Gi=!isNaN(Ii.width)&&Ri;if(Oi||Ei===Su||Gi||fi<Ci||yi<ji||(void 0===wi[yi]&&(wi[yi]=-1,wi.count++),void 0===ki[fi]&&(ki[fi]=-1,ki.count++),xi.push(Zi)),jn(Zi,1/0,1/0,0,0),!(fi<Ci||yi<ji)){var Vi=Zi.Ca,Hi=Math.max(Vi.width+qi,0),Ki=Math.max(Vi.height+Bi,0);if(1===Zi.Ji&&(Ei===Su||Ei===ju)){var Ui=(pe=this.dd(fi)).qf();(Li=Math.max(Ki-pe.Na,0))+Ui>Pi&&(Li=Math.max(Pi-Ui,0));var Ji=0===pe.Na;pe.Na+=Li,Pi=Math.max(Pi-(Li+(Ji?Ui:0)),0)}1!==Zi.li||Ei!==Su&&Ei!==Cu||(pe=this.cd(yi),Ui=pe.qf(),(Li=Math.max(Hi-pe.Na,0))+Ui>Mi&&(Li=Math.max(Mi-Ui,0)),Ji=0===pe.Na,pe.Na+=Li,Mi=Math.max(Mi-(Li+(Ji?Ui:0)),0)),Oi&&Zi.mp()}}}xh.ta(mi);for(var Yi=0,Wi=0,hi=this.Wo,fi=0;fi<hi;fi++)void 0!==this.Gd[fi]&&(Yi+=this.cd(fi).eb);for(hi=this.Lp,fi=0;fi<hi;fi++)void 0!==this.Ld[fi]&&(Wi+=this.dd(fi).eb);for(var Mi=Math.max(oi-Yi,0),Xi=Pi=Math.max(ri-Wi,0),Qi=Mi,hi=xi.length,fi=0;fi<hi;fi++){var Zi=xi[fi],Di=this.dd(Zi.cc),$i=this.cd(Zi.column),_i=Zi.Ca,te=Zi.margin,qi=te.right+te.left,Bi=te.top+te.bottom;wi[Zi.column]=0===$i.Na?Math.max(_i.width+qi,wi[Zi.column]):null,ki[Zi.cc]=0===Di.Na?Math.max(_i.height+Bi,ki[Zi.cc]):null}var ie=0,ee=0;for(fi in ki)"count"!==fi&&(ie+=ki[fi]);for(fi in wi)"count"!==fi&&(ee+=wi[fi]);for(var ne=xh.Pl(),fi=0;fi<hi;fi++)if((Zi=xi[fi]).visible||Zi===this.bc){var Di=this.dd(Zi.cc),$i=this.cd(Zi.column),oe=0;isFinite($i.width)?oe=$i.width:(oe=isFinite(Mi)&&null!==wi[Zi.column]?0===ee?$i.Na+Mi:wi[Zi.column]/ee*Qi:null!==wi[Zi.column]?Mi:$i.Na||Mi,oe=Math.max(0,oe-$i.qf()));var re=0;switch(isFinite(Di.height)?re=Di.height:(re=isFinite(Pi)&&null!==ki[Zi.cc]?0===ie?Di.Na+Pi:ki[Zi.cc]/ie*Xi:null!==ki[Zi.cc]?Pi:Di.Na||Pi,re=Math.max(0,re-Di.qf())),ne.m(Math.max($i.dj,Math.min(oe,$i.jf)),Math.max(Di.dj,Math.min(re,Di.jf))),Ei=Gn(Zi,Di,$i,!1)){case ju:ne.height=1/0;break;case Cu:ne.width=1/0}qi=(te=Zi.margin).right+te.left,Bi=te.top+te.bottom,Zi.mp(),jn(Zi,ne.width,ne.height,$i.dj,Di.dj),Vi=Zi.Ca,Hi=Math.max(Vi.width+qi,0),Ki=Math.max(Vi.height+Bi,0),isFinite(Mi)&&(Hi=Math.min(Hi,ne.width)),isFinite(Pi)&&(Ki=Math.min(Ki,ne.height));var se=0,se=Di.Na;Di.Na=Math.max(Di.Na,Ki),Li=Di.Na-se,Pi=Math.max(Pi-Li,0),se=$i.Na,$i.Na=Math.max($i.Na,Hi),Li=$i.Na-se,Mi=Math.max(Mi-Li,0)}xh.ta(xi);for(var ae=xh.Pl(),hi=bi.length,fi=0;fi<hi;fi++)if((Zi=bi[fi]).visible||Zi===this.bc){switch(Di=this.dd(Zi.cc),$i=this.cd(Zi.column),ne.m(Math.max($i.dj,Math.min(oi,$i.jf)),Math.max(Di.dj,Math.min(ri,Di.jf))),Ei=Gn(Zi,Di,$i,!1)){case Lu:0!==$i.Na&&(ne.width=Math.min(ne.width,$i.Na)),0!==Di.Na&&(ne.height=Math.min(ne.height,Di.Na));break;case ju:0!==$i.Na&&(ne.width=Math.min(ne.width,$i.Na));break;case Cu:0!==Di.Na&&(ne.height=Math.min(ne.height,Di.Na))}isFinite($i.width)&&(ne.width=$i.width),isFinite(Di.height)&&(ne.height=Di.height),ae.m(0,0);for(le=1;le<Zi.Ji&&!(Zi.cc+le>=this.Lp);le++)pe=this.dd(Zi.cc+le),ae.height+=Math.max(pe.dj,isNaN(pe.Xe)?pe.jf:Math.min(pe.Xe,pe.jf));for(le=1;le<Zi.li&&!(Zi.column+le>=this.Wo);le++)pe=this.cd(Zi.column+le),ae.width+=Math.max(pe.dj,isNaN(pe.Xe)?pe.jf:Math.min(pe.Xe,pe.jf));ne.width+=ae.width,ne.height+=ae.height,qi=(te=Zi.margin).right+te.left,Bi=te.top+te.bottom,jn(Zi,ne.width,ne.height,si,ai);for(var Vi=Zi.Ca,Hi=Math.max(Vi.width+qi,0),Ki=Math.max(Vi.height+Bi,0),he=0,le=0;le<Zi.Ji&&!(Zi.cc+le>=this.Lp);le++)pe=this.dd(Zi.cc+le),he+=pe.total||0;if(he<Ki){var ue=Ki-he,fe=Ki-he;if(null!==Zi.Mx)for(var ce=Zi.Mx,le=0;le<Zi.Ji&&!(0>=ue)&&!(Zi.cc+le>=this.Lp);le++){var pe=this.dd(Zi.cc+le),de=pe.eb||0,ye=ce(Zi,pe,fe);pe.Na=Math.min(pe.jf,de+ye),pe.eb!==de&&(ue-=pe.eb-de)}for(;0<ue&&(de=pe.eb||0,isNaN(pe.height)&&pe.jf>de&&(pe.Na=Math.min(pe.jf,de+ue),pe.eb!==de&&(ue-=pe.eb-de)),0!==pe.index);)pe=this.dd(pe.index-1)}for(var ve=0,le=0;le<Zi.li&&!(Zi.column+le>=this.Wo);le++)pe=this.cd(Zi.column+le),ve+=pe.total||0;if(ve<Hi){if(ue=Hi-ve,fe=Hi-ve,null!==Zi.Mx)for(ce=Zi.Mx,le=0;le<Zi.li&&!(0>=ue)&&!(Zi.column+le>=this.Wo);le++)pe=this.cd(Zi.column+le),de=pe.eb||0,ye=ce(Zi,pe,fe),pe.Na=Math.min(pe.jf,de+ye),pe.eb!==de&&(ue-=pe.eb-de);for(;0<ue&&(de=pe.eb||0,isNaN(pe.width)&&pe.jf>de&&(pe.Na=Math.min(pe.jf,de+ue),pe.eb!==de&&(ue-=pe.eb-de)),0!==pe.index);)pe=this.cd(pe.index-1)}}xh.ta(bi),xh.ck(ae),xh.ck(ne);for(var ge=0,me=0,Ei=Rn(this,!0),be=this.ya,xe=this.yf,we=Wi=Yi=0,ke=0,hi=this.Wo,fi=0;fi<hi;fi++)void 0!==this.Gd[fi]&&(pe=this.cd(fi),isFinite(pe.width)?(we+=pe.width,we+=pe.qf()):Po(pe)===Xu?(we+=pe.eb,we+=pe.qf()):0!==pe.eb&&(Yi+=pe.eb,Yi+=pe.qf()));var ge=isFinite(be.width)?Math.min(be.width,xe.width):Ei!==Su&&isFinite(oi)?oi:Yi,ge=Math.max(ge,this.gh.width),ge=Math.max(ge-we,0),Me=Math.max(ge/Yi,1);for(isFinite(Me)||(Me=1),fi=0;fi<hi;fi++)void 0!==this.Gd[fi]&&(pe=this.cd(fi),isFinite(pe.width)||Po(pe)===Xu||(pe.Na=pe.eb*Me),pe.position=o.width,0!==pe.eb&&(o.width+=pe.eb,o.width+=pe.qf()));for(hi=this.Lp,fi=0;fi<hi;fi++)void 0!==this.Ld[fi]&&(pe=this.dd(fi),isFinite(pe.height)?(ke+=pe.height,ke+=pe.qf()):Po(pe)===Xu?(ke+=pe.eb,ke+=pe.qf()):0!==pe.eb&&(Wi+=pe.eb,Wi+=pe.qf()));var me=isFinite(be.height)?Math.min(be.height,xe.height):Ei!==Su&&isFinite(ri)?ri:Wi,me=Math.max(me,this.gh.height),me=Math.max(me-ke,0),Pe=Math.max(me/Wi,1);for(isFinite(Pe)||(Pe=1),fi=0;fi<hi;fi++)void 0!==this.Ld[fi]&&(pe=this.dd(fi),isFinite(pe.height)||Po(pe)===Xu||(pe.Na=pe.eb*Pe),pe.position=o.height,0!==pe.eb&&(o.height+=pe.eb,o.height+=pe.qf()));for(hi=ui.length,fi=0;fi<hi;fi++){var Te=ui[fi];Te.type===Vu?(oe=o.width,pe=this.dd(Te.cc),re=pe.Na):(pe=this.cd(Te.column),oe=pe.Na,re=o.height),Te.md.m(0,0,oe,re),Wn(Te,!1),gi[Te.cc]||(gi[Te.cc]=[]),gi[Te.cc][Te.column]||(gi[Te.cc][Te.column]=[]),gi[Te.cc][Te.column].push(Te)}xh.ta(ui),this.ms=gi;break;case"Viewbox":var Se=t,Ne=i,Ce=e,je=n;1<l.length&&xh.k("Viewbox Panel cannot contain more than one GraphObject.");var Le=l[0];Le.Vb=1,Le.mp(),jn(Le,1/0,1/0,Ce,je);var De=Le.Ca,Ae=Le.margin,Fe=Ae.right+Ae.left,ze=Ae.top+Ae.bottom;if(isFinite(Se)||isFinite(Ne)){var Oe=Le.scale,qe=De.width,Be=De.height,Ee=Math.max(Se-Fe,0),Ie=Math.max(Ne-ze,0),Re=1;this.No===Du?0!==qe&&0!==Be&&(Re=Math.min(Ee/qe,Ie/Be)):0!==qe&&0!==Be&&(Re=Math.max(Ee/qe,Ie/Be)),0===Re&&(Re=1e-4),Le.Vb*=Re,Oe!==Le.scale&&(Wn(Le,!0),jn(Le,1/0,1/0,Ce,je))}De=Le.Ca,o.width=isFinite(Se)?Se:Math.max(De.width+Fe,0),o.height=isFinite(Ne)?Ne:Math.max(De.height+ze,0);break;case"Link":var Ge=l.length,Ve=this instanceof xr?this.Wg:this;if(Ve instanceof zr)if(0===Ge){P(vn=this.Qc,0,0);(yn=this.Ca).m(0,0,0,0)}else{var He=this instanceof xr?null:Ve.path,Ke=Ve.ln,Ue=this.Pi;Ue.assign(Ke),Ue.x=0;var Je=Ue.y=0,Ye=Ve.points,Je=void 0!==this.pa?this.pa:Ye.count;this instanceof xr?this.dn(!1):Ve.dn(!1);var We=Ke.width,Xe=Ke.height;this.Ai.m(Ke.x,Ke.y),null===this.Hg&&(this.Hg=new u(M)),this.Hg.clear(),null!==He&&(Co(He,We,Xe,this),yn=He.Ca,Ue.ei(yn),this.Hg.add(yn));for(var Qe=xh.sh(),Ze=xh.M(),$e=xh.M(),_e=0;_e<Ge;_e++){var tn=l[_e];if(tn!==He)if(tn.Rf&&tn instanceof To)Co(tn,We,Xe,this),yn=tn.Ca,Ue.ei(yn),this.Hg.add(yn);else if(2>Je)jn(tn,1/0,1/0),yn=tn.Ca,Ue.ei(yn),this.Hg.add(yn);else{var en=tn.ve,nn=tn.Ex,on=tn.Wj;on.te()&&(on=zh);var rn=tn.fu,sn=tn.rF,an=0,hn=0,ln=0;if(en<-Je||en>=Je){var un=Ve.TE,fn=Ve.SE;rn!==Nf&&(ln=Ve.computeAngle(tn,rn,fn),tn.Ul=ln),an=un.x-Ke.x,hn=un.y-Ke.y}else{var cn,pn;if(0<=en)cn=Ye.ha(en),pn=en<Je-1?Ye.ha(en+1):cn;else{var dn=Je+en;cn=Ye.ha(dn),pn=0<dn?Ye.ha(dn-1):cn}fn=0<=en?cn.ah(pn):pn.ah(cn),rn!==Nf&&(ln=Ve.computeAngle(tn,rn,fn),tn.Ul=ln),an=cn.x+(pn.x-cn.x)*nn-Ke.x,hn=cn.y+(pn.y-cn.y)*nn-Ke.y}jn(tn,1/0,1/0);var yn=tn.Ca,vn=tn.Ia,gn=0;tn instanceof To&&(gn=tn.pb);var mn=vn.width+gn,bn=vn.height+gn;Qe.reset(),Qe.translate(-yn.x,-yn.y),Qe.scale(tn.scale,tn.scale),Qe.rotate(rn===Nf?tn.angle:fn,mn/2,bn/2);var xn=new M(0,0,mn,bn);Ze.iu(xn,on),Qe.xb(Ze);var wn=-Ze.x+gn/2,kn=-Ze.y+gn/2;$e.assign(sn),isNaN($e.x)&&($e.x=0<=en?mn/2+3:-(mn/2+3)),isNaN($e.y)&&($e.y=-(bn/2+3)),$e.rotate(fn),an+=$e.x,hn+=$e.y,xn.set(yn),xn.x=an+wn,xn.y=hn+kn,this.Hg.add(xn),Ue.ei(xn)}}if(this.Ee)for(var Mn=this.Sf;Mn.next();)jn(Mn.value,1/0,1/0);this.Pi=Ue;var Pn=this.Ai;Pn.m(Pn.x+Ue.x,Pn.y+Ue.y),P(o,Ue.width||0,Ue.height||0),xh.cf(Qe),xh.v(Ze),xh.v($e)}break;case"Grid":break;case"TableRow":case"TableColumn":xh.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:xh.k("Unknown panel type: "+f)}}var Tn=o.width,Sn=o.height,Cn=this.padding,Ln=Cn.top+Cn.bottom,Tn=Tn+(Cn.left+Cn.right),Sn=Sn+Ln;isFinite(r.width)&&(Tn=r.width),isFinite(r.height)&&(Sn=r.height),Tn=Math.min(a.width,Tn),Sn=Math.min(a.height,Sn),Tn=Math.max(s.width,Tn),Sn=Math.max(s.height,Sn),Tn=Math.max(e,Tn),Sn=Math.max(n,Sn),o.width=Tn,o.height=Sn,P(this.Qc,Tn,Sn),Nn(this,0,0,Tn,Sn)},eo.prototype.findMainElement=eo.prototype.af=function(){if(null===this.Dm){var t=this.Aa.n,i=t.length;if(0===i)return null;for(var e=0;e<i;e++){var n=t[e];if(!0===n.Rf)return this.Dm=n}this.Dm=t[0]}return this.Dm},eo.prototype.Ri=function(t,i,e,n){var o=this.Pi,r=this.Aa.n,s=xh.lk(0,0,0,0);if(0===r.length){var a=this.Y;a.x=t,a.y=i,a.width=e,a.height=n}else{if(!this.ya.K()){var h=Rn(this,!0),l=this.md,u=l.width,f=l.height,c=this.margin,p=c.left+c.right,d=c.top+c.bottom;switch(u===e&&f===n&&(h=Su),h){case Su:(u>e||f>n)&&(this.Q(),jn(this,u>e?e:u,f>n?n:f));break;case Lu:this.Q(!0),jn(this,e+p,n+d,0,0);break;case ju:this.Q(!0),jn(this,e+p,f+d,0,0);break;case Cu:this.Q(!0),jn(this,u+p,n+d,0,0)}}(a=this.Y).x=t,a.y=i,a.width=e,a.height=n;var y=this.ja.Qb;switch(y){case"Position":for(var v=r.length,g=o.x-this.padding.left,m=o.y-this.padding.top,x=0;x<v;x++){var w=r[x],k=w.Ca,P=w.margin,T=w.position.x,S=w.position.y;if(s.x=isNaN(T)?-g:T-g,s.y=isNaN(S)?-m:S-m,w instanceof To){var N=w;if(N.EE){var j=N.pb/2;s.x-=j,s.y-=j}}s.x+=P.left,s.y+=P.top,s.width=k.width,s.height=k.height,w.visible&&w.Ec(s.x,s.y,s.width,s.height)}break;case"Vertical":for(var L=r.length,D=this.padding.left,A=this.padding.top,F=0;F<L;F++){var z=D,O=r[F];if(O.visible){var q=O.Ca,B=O.margin,E=B.left+B.right,I=D+this.padding.right,R=q.width,G=Rn(O,!1);(isNaN(O.ya.width)&&G===Lu||G===ju)&&(R=Math.max(o.width-E-I,0));var V=R+E+I,H=O.alignment;H.Uc()&&(H=this.ml),H.ed()||(H=zh),O.Ec(z+H.offsetX+B.left+(o.width*H.x-V*H.x),A+H.offsetY+B.top,R,q.height),A+=q.height+B.bottom+B.top}}break;case"Horizontal":for(var K=r.length,U=this.padding.top,J=this.padding.left,Y=0;Y<K;Y++){var W=U,X=r[Y];if(X.visible){var Q=X.Ca,Z=X.margin,$=Z.top+Z.bottom,_=U+this.padding.bottom,tt=Q.height,it=Rn(X,!1);(isNaN(X.ya.height)&&it===Lu||it===Cu)&&(tt=Math.max(o.height-$-_,0));var et=tt+$+_,nt=X.alignment;nt.Uc()&&(nt=this.ml),nt.ed()||(nt=zh),X.Ec(J+nt.offsetX+Z.left,W+nt.offsetY+Z.top+(o.height*nt.y-et*nt.y),Q.width,tt),J+=Q.width+Z.left+Z.right}}break;case"Spot":var ot=r.length,rt=this.af(),st=rt.Ca,at=st.width,ht=st.height,lt=this.padding,ut=lt.left,ft=lt.top;s.x=ut-o.x,s.y=ft-o.y,rt.Ec(s.x,s.y,at,ht);for(var ct=0;ct<ot;ct++){var pt=r[ct];if(pt!==rt){var dt=pt.Ca,yt=dt.width,vt=dt.height,gt=pt.alignment;gt.Uc()&&(gt=this.ml),gt.ed()||(gt=zh);var mt=pt.Wj;mt.Uc()&&(mt=zh),s.x=gt.x*at+gt.offsetX-(mt.x*yt-mt.offsetX),s.y=gt.y*ht+gt.offsetY-(mt.y*vt-mt.offsetY),s.x-=o.x,s.y-=o.y,pt.visible&&pt.Ec(ut+s.x,ft+s.y,yt,vt)}}break;case"Auto":var bt=r.length,xt=this.af(),wt=xt.Ca,kt=xh.ag();kt.m(0,0,1,1);var Mt=(qt=xt.margin).left,Pt=qt.top,Tt=this.padding,St=Tt.left,Nt=Tt.top;s.x=Mt,s.y=Pt,s.width=wt.width,s.height=wt.height,xt.Ec(St+s.x,Nt+s.y,s.width,s.height);var Ct=vo(xt),jt=go(xt),Lt=0+Ct.y*wt.height+Ct.offsetY,Dt=0+jt.x*wt.width+jt.offsetX,At=0+jt.y*wt.height+jt.offsetY;kt.x=0+Ct.x*wt.width+Ct.offsetX,kt.y=Lt,C(kt,Dt,At,0,0),kt.x+=Mt+St,kt.y+=Pt+Nt;for(var Ft=0;Ft<bt;Ft++){var zt=r[Ft];if(zt!==xt){var Ot=zt.Ca,qt=zt.margin,Bt=Math.max(Ot.width+qt.right+qt.left,0),Et=Math.max(Ot.height+qt.top+qt.bottom,0),It=zt.alignment;It.Uc()&&(It=this.ml),It.ed()||(It=zh),s.x=kt.width*It.x+It.offsetX-Bt*It.x+qt.left+kt.x,s.y=kt.height*It.y+It.offsetY-Et*It.y+qt.top+kt.y,s.width=kt.width,s.height=kt.height,zt.visible&&(Sh(kt.x,kt.y,kt.width,kt.height,s.x,s.y,Ot.width,Ot.height)?zt.Ec(s.x,s.y,Ot.width,Ot.height):zt.Ec(s.x,s.y,Ot.width,Ot.height,new M(kt.x,kt.y,kt.width,kt.height)))}}xh.ic(kt);break;case"Table":for(var Rt=r.length,Gt=this.padding,Vt=Gt.left,Ht=Gt.top,Kt=this.ms,Ut=0,Jt=0,Yt=Kt.length,Wt=0,Xt=0;Xt<Yt;Xt++)Kt[Xt]&&(Wt=Math.max(Wt,Kt[Xt].length));for(Qt=Math.min(this.Oi,Yt-1);Qt!==Yt&&(void 0===this.Ld[Qt]||0===this.Ld[Qt].eb);)Qt++;for(var Qt=Math.min(Qt,Yt-1),Zt=-this.Ld[Qt].mb,$t=Math.min(this.zi,Wt-1);$t!==Wt&&(void 0===this.Gd[$t]||0===this.Gd[$t].eb);)$t++;for(var $t=Math.min($t,Wt-1),_t=-this.Gd[$t].mb,ti=xh.Pl(),Xt=0;Xt<Yt;Xt++)if(Kt[Xt])for(var Wt=Kt[Xt].length,ii=this.dd(Xt),Jt=ii.mb+Zt+Ht+ii.RD(),ei=0;ei<Wt;ei++)if(Kt[Xt][ei])for(var ni=this.cd(ei),Ut=ni.mb+_t+Vt+ni.RD(),oi=Kt[Xt][ei],ri=oi.length,si=0;si<ri;si++){var ai=oi[si],hi=ai.Ca,li=ai instanceof eo?ai:null;if(null===li||li.type!==Vu&&li.type!==Hu){ti.m(0,0);for(var ui=1;ui<ai.rowSpan&&!(Xt+ui>=this.Lp);ui++){var fi=this.dd(Xt+ui);ti.height+=fi.total}for(ui=1;ui<ai.aH&&!(ei+ui>=this.Wo);ui++){var ci=this.cd(ei+ui);ti.width+=ci.total}var pi=ni.eb+ti.width,di=ii.eb+ti.height;s.x=Ut,s.y=Jt,s.width=pi,s.height=di;var yi=Ut,vi=Jt,gi=pi,mi=di;Ut+pi>o.width&&(gi=Math.max(o.width-Ut,0)),Jt+di>o.height&&(mi=Math.max(o.height-Jt,0));var bi=ai.alignment,xi=0,wi=0,ki=0,Mi=0;if(bi.Uc()){(bi=this.ml).ed()||(bi=zh);var xi=bi.x,wi=bi.y,ki=bi.offsetX,Mi=bi.offsetY,Pi=ni.alignment,Ti=ii.alignment;Pi.ed()&&(xi=Pi.x,ki=Pi.offsetX),Ti.ed()&&(wi=Ti.y,Mi=Ti.offsetY)}else xi=bi.x,wi=bi.y,ki=bi.offsetX,Mi=bi.offsetY;(isNaN(xi)||isNaN(wi))&&(wi=xi=.5,Mi=ki=0);var Si=hi.width,Ni=hi.height,Ci=ai.margin,ji=Ci.left+Ci.right,Li=Ci.top+Ci.bottom,Di=Gn(ai,ii,ni,!1);!isNaN(ai.ya.width)||Di!==Lu&&Di!==ju||(Si=Math.max(pi-ji,0)),!isNaN(ai.ya.height)||Di!==Lu&&Di!==Cu||(Ni=Math.max(di-Li,0));var Ai=ai.yf,Fi=ai.gh,Si=Math.min(Ai.width,Si),Ni=Math.min(Ai.height,Ni),Si=Math.max(Fi.width,Si),zi=(Ni=Math.max(Fi.height,Ni))+Li;s.x+=s.width*xi-(Si+ji)*xi+ki+Ci.left,s.y+=s.height*wi-zi*wi+Mi+Ci.top,ai.visible&&(Sh(yi,vi,gi,mi,s.x,s.y,hi.width,hi.height)?ai.Ec(s.x,s.y,Si,Ni):ai.Ec(s.x,s.y,Si,Ni,new M(yi,vi,gi,mi)))}else{ai.vi(),ai.mc.Oa();var Oi=ai.mc;Oi.x=li.type===Vu?Vt:Ut,Oi.y=li.type===Hu?Ht:Jt,Oi.width=hi.width,Oi.height=hi.height,ai.mc.freeze(),Qn(ai,!1)}}for(xh.ck(ti),Xt=0;Xt<Rt;Xt++)ai=r[Xt],null===(li=ai instanceof eo?ai:null)||li.type!==Vu&&li.type!==Hu||(Oi=ai.mc,ai.Qc.Oa(),ai.Qc.m(0,0,Oi.width,Oi.height),ai.Qc.freeze());break;case"Viewbox":var qi=r[0],Bi=qi.Ca,Ei=qi.margin,Ii=Ei.top+Ei.bottom,Ri=Math.max(Bi.width+(Ei.right+Ei.left),0),Gi=Math.max(Bi.height+Ii,0),Vi=qi.alignment;Vi.Uc()&&(Vi=this.ml),Vi.ed()||(Vi=zh),s.x=o.width*Vi.x-Ri*Vi.x+Vi.offsetX,s.y=o.height*Vi.y-Gi*Vi.y+Vi.offsetY,s.width=Bi.width,s.height=Bi.height,qi.Ec(s.x,s.y,s.width,s.height);break;case"Link":var Hi=r.length,Ki=this instanceof xr?this.Wg:this;if(Ki instanceof zr){var Ui=this instanceof xr?null:Ki.path;if(null!==this.Hg){var Ji=this.Hg.n,Yi=0;if(null!==Ui&&Yi<this.Hg.count){var Wi=Ji[Yi];Yi++,Ui.Ec(Wi.x-this.Pi.x,Wi.y-this.Pi.y,Wi.width,Wi.height)}for(var Xi=0;Xi<Hi;Xi++){var Qi=r[Xi];Qi!==Ui&&Yi<this.Hg.count&&(Wi=Ji[Yi],Yi++,Qi.Ec(Wi.x-this.Pi.x,Wi.y-this.Pi.y,Wi.width,Wi.height))}}var Zi=Ki.points,$i=Zi.count;if(2<=$i&&this.Ee)for(var _i=this.Sf;_i.next();){var te=_i.value,ie=$i,ee=Zi,ne=te.ve,oe=te.Ex,re=te.Wj,se=te.fu,ae=te.rF,he=0,le=0,ue=0;if(ne<-ie||ne>=ie){var fe=this.TE,ce=this.SE;se!==Nf&&(ue=this.computeAngle(te,se,ce),te.angle=ue),he=fe.x,le=fe.y}else{var pe=void 0,de=void 0;if(0<=ne)pe=ee.n[ne],de=ne<ie-1?ee.n[ne+1]:pe;else var ye=ie+ne,pe=ee.n[ye],de=0<ye?ee.n[ye-1]:pe;ce=0<=ne?pe.ah(de):de.ah(pe),se!==Nf&&(ue=this.computeAngle(te,se,ce),te.angle=ue),he=pe.x+(de.x-pe.x)*oe,le=pe.y+(de.y-pe.y)*oe}if(re.L(Ch))te.location=new b(he,le);else{re.te()&&(re=zh);var ve=xh.sh();ve.reset(),ve.scale(te.scale,te.scale),ve.rotate(te.angle,0,0);var ge=te.Ia,me=xh.lk(0,0,ge.width,ge.height),be=xh.M();be.iu(me,re),ve.xb(be);var xe=-be.x,we=-be.y,ke=ae.copy();isNaN(ke.x)&&(ke.x=0<=ne?be.x+3:-(be.x+3)),isNaN(ke.y)&&(ke.y=-(be.y+3)),ke.rotate(ce),he+=ke.x,le+=ke.y,ve.NF(me);var xe=xe+me.x,we=we+me.y,Me=xh.Ob(he+xe,le+we);te.move(Me),xh.v(Me),xh.v(be),xh.ic(me),xh.cf(ve)}}this instanceof xr?this.dn(!1):Ki.dn(!1)}break;case"Grid":break;case"TableRow":case"TableColumn":xh.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:xh.k("Unknown panel type: "+y)}xh.ic(s)}},eo.prototype.Yj=function(t){i=this.Ia;if(Sh(0,0,i.width,i.height,t.x,t.y)){for(var i,e=(i=this.Aa.n).length,n=xh.Ob(0,0);e--;){var o=i[e];if((o.visible||o===this.bc)&&(w(n.set(t),o.transform),o.Ga(n)))return xh.v(n),!0}return xh.v(n),null!==this.Kb||null!==this.nc}return!1},eo.prototype.Rw=function(t){if(this.yn===t)return this;for(var i=this.Aa.n,e=i.length,n=0;n<e;n++){var o=i[n].Rw(t);if(null!==o)return o}return null},eo.prototype.walkVisualTree=eo.prototype.IJ=function(t){fo(this,this,t)},eo.prototype.findInVisualTree=eo.prototype.mt=function(t){return co(this,this,t)},eo.prototype.findObject=eo.prototype.ae=function(t){if(this.name===t)return this;for(var i=this.Aa.n,e=i.length,n=0;n<e;n++){var o=i[n];if(o.name===t)return o;if(o instanceof eo)if(null===o.wj&&null===o.gg){if(null!==(o=o.ae(t)))return o}else if(xo(o)&&null!==(o=o.Aa.first())&&null!==(o=o.ae(t)))return o}return null},(mh=eo.prototype).Gg=function(){return!(this.type===Vu||this.type===Hu)},mh.re=function(t,i,e){if(!1===this.Cg)return null;if(void 0===i&&(i=null),void 0===e&&(e=null),Xn(this))return null;var n=this.Ia,o=1/this.Yi(),r=this.Gg(),s=r?t:w(xh.Ob(t.x,t.y),this.transform),a=10,h=5;if(null!==(u=this.g)&&(a=u.hp("extraTouchArea"),h=a/2),Sh(-h*o,-h*o,n.width+a*o,n.height+a*o,s.x,s.y)){if(!this.Mg){var l=(o=this.Aa.n).length,u=xh.M(),h=(a=this.CE)?this.af():null;if(a&&(h.Gg()?w(u.set(t),h.transform):u.set(t),!h.Ga(u)))return xh.v(u),r||xh.v(s),null;for(;l--;){var f=o[l];if((f.visible||f===this.bc)&&(f.Gg()?w(u.set(t),f.transform):u.set(t),!a||f!==h)){var c=null;if(f instanceof eo?c=f.re(u,i,e):!0===f.Cg&&f.Ga(u)&&(c=f),null!==c&&(null!==i&&(c=i(c)),null!==c&&(null===e||e(c))))return xh.v(u),r||xh.v(s),c}}xh.v(u)}return null===this.background&&null===this.Jm?(r||xh.v(s),null):(t=Sh(0,0,n.width,n.height,s.x,s.y)?this:null,r||xh.v(s),t)}return r||xh.v(s),null},mh.qt=function(t,i,e,n){if(!1===this.Cg)return!1;void 0===i&&(i=null),void 0===e&&(e=null),n instanceof u||n instanceof c||(n=new u(Mn));var o=this.Ia,r=this.Gg(),s=r?t:w(xh.Ob(t.x,t.y),this.transform);if(Sh(0,0,o.width,o.height,s.x,s.y)){if(!this.Mg){for(var a=(o=this.Aa.n).length,h=xh.M();a--;){l=o[a];if(l.visible||l===this.bc){l.Gg()?w(h.set(t),l.transform):h.set(t);var l,f=l;(null!==(l=l instanceof eo?l:null)?l.qt(h,i,e,n):f.Ga(h))&&!1!==f.Cg&&(null!==i&&(f=i(f)),null===f||null!==e&&!e(f)||n.add(f))}}xh.v(h)}return r||xh.v(s),null!==this.background||null!==this.Jm}return r||xh.v(s),!1},mh.bk=function(t,i,e,n,o,r){if(!1===this.Cg)return!1;void 0===i&&(i=null),void 0===e&&(e=null);var s=r;if(void 0===r&&(s=xh.sh()).reset(),s.multiply(this.transform),this.Om(t,s))return yo(this,i,e,o),void 0===r&&xh.cf(s),!0;if(this.xg(t,s)){if(!this.Mg)for(var a=this.Aa.n,h=a.length;h--;){var l=a[h];if(l.visible||l===this.bc){var u=l.Y,f=this.Ia;u.x>f.width||u.y>f.height||0>u.x+u.width||0>u.y+u.height||(u=l,l=l instanceof eo?l:null,(f=xh.sh()).set(s),(null!==l?l.bk(t,i,e,n,o,f):Cn(u,t,n,f))&&(null!==i&&(u=i(u)),null===u||null!==e&&!e(u)||o.add(u)),xh.cf(f))}}return void 0===r&&xh.cf(s),n}return void 0===r&&xh.cf(s),!1},mh.Vm=function(t,i,e,n,o,r){if(!1===this.Cg)return!1;void 0===e&&(e=null),void 0===n&&(n=null);var s=this.Ia,a=this.Gg(),h=a?t:w(xh.Ob(t.x,t.y),this.transform),l=a?i:w(xh.Ob(i.x,i.y),this.transform),u=h.$j(l),f=0<h.x&&h.x<s.width&&0<h.y&&h.y<s.height||Mh(h.x,h.y,0,0,0,s.height)<u||Mh(h.x,h.y,0,s.height,s.width,s.height)<u||Mh(h.x,h.y,s.width,s.height,s.width,0)<u||Mh(h.x,h.y,s.width,0,0,0)<u,s=0<h.x&&h.x<s.width&&0<h.y&&h.y<s.height&&Mh(h.x,h.y,0,0,0,s.height)<u&&Mh(h.x,h.y,0,s.height,s.width,s.height)<u&&Mh(h.x,h.y,s.width,s.height,s.width,0)<u&&Mh(h.x,h.y,s.width,0,0,0)<u;if(a||(xh.v(h),xh.v(l)),f){if(!this.Mg){for(a=xh.M(),h=xh.M(),u=(l=this.Aa.n).length;u--;){var c=l[u];if(c.visible||c===this.bc){var p=c.Y,d=this.Ia;p.x>d.width||p.y>d.height||0>p.x+p.width||0>p.y+p.height||(c.Gg()?(p=c.transform,w(a.set(t),p),w(h.set(i),p)):(a.set(t),h.set(i)),p=c,null!==(c=c instanceof eo?c:null)?!c.Vm(a,h,e,n,o,r):!p.kE(a,h,o))||(null!==e&&(p=e(p)),null===p||null!==n&&!n(p)||r.add(p))}}xh.v(a),xh.v(h)}return o?f:s}return!1},eo.prototype.add=eo.prototype.add=function(t){xh.A(t,Mn,eo,"add:element"),this.Cd(this.Aa.count,t)},eo.prototype.elt=eo.prototype.ha=function(t){return this.Aa.ha(t)},eo.prototype.insertAt=eo.prototype.Cd=function(t,i){i instanceof tr&&xh.k("Cannot add a Part to a Panel: "+i),(this===i||this.Cl(i))&&(this===i&&xh.k("Cannot make a Panel contain itself: "+this.toString()),xh.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+i.toString()));var e=i.T;if(null!==e&&e!==this&&xh.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+i.toString()+", already contained by "+e.toString()+", cannot be shared by this Panel: "+this.toString()),this.ja!==Uu||i instanceof To||xh.k("Can only add Shapes to a Grid Panel, not: "+i),i.Ll(this),i.tm=null,null!==this.LE){null!==(o=i.data)&&"object"==typeof o&&(null===this.fg&&(this.fg=new m(Object,eo)),this.fg.add(o,i))}var n=this.Aa,o=-1;if(e===this){for(var r=-1,s=this.Aa.n,a=s.length,h=0;h<a;h++)if(s[h]===i){r=h;break}if(-1!==r){if(r===t||r+1>=n.count&&t>=n.count)return;n.Vc(r),o=r}else xh.k("element "+i.toString()+" has panel "+e.toString()+" but is not contained by it.")}(0>t||t>n.count)&&(t=n.count),n.Cd(t,i),this.Q(),i.Q(),null!==i.Sd?this.Fh=!0:i instanceof eo&&!0===i.Fh&&(this.Fh=!0),null!==(e=this.aa)&&(e.pm=null,e.Bj=NaN,this.Fh&&e instanceof wr&&(e.Fh=!0),e.Fh&&(e.Wd=null),null!==(n=this.g)&&n.ma.kb||(-1!==o&&e.Lc(Pl,"elements",this,i,null,o,null),e.Lc(Ml,"elements",this,null,i,null,t)))},eo.prototype.remove=eo.prototype.remove=function(t){xh.A(t,Mn,eo,"remove:element");for(var i=this.Aa.n,e=i.length,n=-1,o=0;o<e;o++)if(i[o]===t){n=o;break}-1!==n&&this.Oe(n)},eo.prototype.removeAt=eo.prototype.Vc=function(t){0<=t&&this.Oe(t)},eo.prototype.Oe=function(t){var i=this.Aa,e=i.ha(t);if(e.tm=null,e.Ll(null),null!==this.fg){var n=e.data;"object"==typeof n&&this.fg.remove(n)}i.Vc(t),Wn(this,!1),this.Q(),this.Dm===e&&(this.Dm=null),null!==(i=this.aa)&&(i.pm=null,i.Bj=NaN,null!==(n=this.g)&&n.ma.kb||i.Lc(Pl,"elements",this,e,null,t,null))},xh.u(eo,{Lp:"rowCount"},function(){return void 0===this.Ld?0:this.Ld.length}),eo.prototype.getRowDefinition=eo.prototype.dd=function(t){0>t&&xh.wa(t,">= 0",eo,"getRowDefinition:idx"),t=Math.round(t);var i=this.Ld;if(void 0===i[t]){var e=new Mo;e.Ll(this),e.de=!0,e.index=t,i[t]=e}return i[t]},eo.prototype.removeRowDefinition=eo.prototype.fF=function(t){0>t&&xh.wa(t,">= 0",eo,"removeRowDefinition:idx"),t=Math.round(t);var i=this.Ld;this.Lc(Pl,"coldefs",this,i[t],null,t,null),i[t]&&delete i[t],this.Q()},xh.u(eo,{Wo:"columnCount"},function(){return void 0===this.Gd?0:this.Gd.length}),eo.prototype.getColumnDefinition=eo.prototype.cd=function(t){0>t&&xh.wa(t,">= 0",eo,"getColumnDefinition:idx"),t=Math.round(t);var i=this.Gd;if(void 0===i[t]){var e=new Mo;e.Ll(this),e.de=!1,e.index=t,i[t]=e}return i[t]},eo.prototype.removeColumnDefinition=eo.prototype.bF=function(t){0>t&&xh.wa(t,">= 0",eo,"removeColumnDefinition:idx"),t=Math.round(t);var i=this.Gd;this.Lc(Pl,"coldefs",this,i[t],null,t,null),i[t]&&delete i[t],this.Q()},xh.defineProperty(eo,{gJ:"rowSizing"},function(){return void 0===this.zm?Qu:this.zm},function(t){if(void 0!==this.zm){var i=this.zm;i!==t&&(t!==Qu&&t!==Xu&&xh.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+t),this.zm=t,this.Q(),this.h("rowSizing",i,t))}}),xh.defineProperty(eo,{$G:"columnSizing"},function(){return void 0===this.Yl?Qu:this.Yl},function(t){if(void 0!==this.Yl){var i=this.Yl;i!==t&&(t!==Qu&&t!==Xu&&xh.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+t),this.Yl=t,this.Q(),this.h("columnSizing",i,t))}}),xh.defineProperty(eo,{HL:"topIndex"},function(){return void 0===this.Oi?0:this.Oi},function(t){if(void 0!==this.Oi){var i=this.Oi;i!==t&&((!isFinite(t)||0>t)&&xh.k("Panel.topIndex must be greater than zero and a real number, not: "+t),this.Oi=t,this.Q(),this.h("topIndex",i,t))}}),xh.defineProperty(eo,{RK:"leftIndex"},function(){return void 0===this.zi?0:this.zi},function(t){if(void 0!==this.zi){var i=this.zi;i!==t&&((!isFinite(t)||0>t)&&xh.k("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.zi=t,this.Q(),this.h("leftIndex",i,t))}}),eo.prototype.findRowForLocalY=function(t){if(0>t)return-1;if(this.type!==Gu)return NaN;for(var i=0,e=this.Ld,n=e.length,o=this.Oi;o<n;o++){var r=e[o];if(void 0!==r&&(i+=r.total,t<i))return o}return-1},eo.prototype.findColumnForLocalX=function(t){if(0>t)return-1;if(this.type!==Gu)return NaN;for(var i=0,e=this.Gd,n=e.length,o=this.zi;o<n;o++){var r=e[o];if(void 0!==r&&(i+=r.total,t<i))return o}return-1},xh.defineProperty(eo,{data:"data"},function(){return this.je},function(t){var i=this.je;if(i!==t){var e=this instanceof tr&&!(this instanceof xr);e&&xh.j(t,"object",eo,"data"),bo(this),this.je=t;var n=this.g;null!==n&&(e?this instanceof zr?(null!==i&&n.Ck.remove(i),null!==t&&n.Ck.add(t,this)):this instanceof tr&&(null!==i&&n.oi.remove(i),null!==t&&n.oi.add(t,this)):null!==(e=this.T)&&null!==e.fg&&(null!==i&&e.fg.remove(i),null!==t&&e.fg.add(t,this))),this.h("data",i,t),null!==n&&n.ma.kb||null!==t&&this.Jb()}}),xh.defineProperty(eo,{kI:"itemIndex"},function(){return this.nr},function(t){var i=this.nr;i!==t&&(this.nr=t,this.h("itemIndex",i,t))}),eo.prototype.copyTemplate=function(){var t=this.copy();return t.IJ(function(t){t instanceof eo&&(t.zk=null,t.je=null);var i=t.sc;null!==i&&(t.sc=null,i.each(function(i){t.bind(i.copy())}))}),t},eo.prototype.updateTargetBindings=eo.prototype.Jb=function(t){var i=this.zk;if(null!==i)for(void 0===t&&(t=""),i=i.i;i.next();){var e=i.value,n=e.AF;if((""===t||""===n||n===t)&&(n=e.Nx,null!==e.eH||""!==n)){var n=this.data,o=e.mn;if(null!==o)n=""===o?this:"."===o?this:".."===o?this:this.ae(o);else{null!==(r=this.g)&&e.It&&(n=r.Z.gk)}if(null!==n){var r=this,s=e.Ol;if(-1!==s){if(null===(r=this.Rw(s)))continue}else null!==e.ng&&(r=e.ng);if("."===o?n=r:".."===o&&(n=r.T),0!==(o=e.Hs)){if(!(r instanceof eo))continue;s=r,1===o?r=s.cd(e.Io):2===o&&(r=s.dd(e.Io))}void 0!==r&&e.RF(r,n)}}}},xh.defineProperty(eo,{LE:"itemArray"},function(){return this.wj},function(t){var i=this.wj;if(i!==t){var e=this.g;null!==e&&null!==i&&Oe(e,this),this.wj=t,null!==e&&null!==t&&ze(e,this),this.h("itemArray",i,t),null!==e&&e.ma.kb||this.zA()}}),eo.prototype.rebuildItemElements=eo.prototype.zA=function(){var t=0;for(xo(this)&&(t=1);this.Aa.length>t;)this.Oe(t);if(null!==(t=this.LE))for(var i=xh.Xa(t),e=0;e<i;e++)wo(this,xh.Pa(t,e),e)},eo.prototype.findItemPanelForData=eo.prototype.AH=function(t){return void 0===t||null===t||null===this.fg?null:(xh.j(t,"object",eo,"findItemPanelForData"),this.fg.ka(t))},xh.defineProperty(eo,{PK:"itemTemplate"},function(){return null===this.gg?null:this.gg.ka("")},function(t){if(null===this.gg){if(null===t)return;this.gg=new m("string",eo)}var i=this.gg.ka("");i!==t&&(xh.A(t,eo,eo,"itemTemplate"),(t instanceof tr||t.Rf)&&xh.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.gg.add("",t),this.h("itemTemplate",i,t),null!==(t=this.g)&&t.ma.kb||this.zA())}),xh.defineProperty(eo,{lI:"itemTemplateMap"},function(){return this.gg},function(t){var i=this.gg;if(i!==t){xh.A(t,m,eo,"itemTemplateMap");for(var e=t.i;e.next();){var n=e.value;(n instanceof tr||n.Rf)&&xh.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+n)}this.gg=t,this.h("itemTemplateMap",i,t),null!==(t=this.g)&&t.ma.kb||this.zA()}}),xh.defineProperty(eo,{OK:"itemCategoryProperty"},function(){return this.eo},function(t){var i=this.eo;i!==t&&("string"!=typeof t&&"function"!=typeof t&&xh.Ed(t,"string or function",eo,"itemCategoryProperty"),this.eo=t,this.h("itemCategoryProperty",i,t))});var Ju=!1,Yu=null;xh.defineProperty(eo,{IK:"isAtomic"},function(){return this.Mg},function(t){var i=this.Mg;i!==t&&(xh.j(t,"boolean",eo,"isAtomic"),this.Mg=t,this.h("isAtomic",i,t))}),xh.defineProperty(eo,{CE:"isClipping"},function(){return this.ar},function(t){var i=this.ar;i!==t&&(xh.j(t,"boolean",eo,"isClipping"),this.ar=t,this.h("isClipping",i,t))}),xh.ea("RowColumnDefinition",Mo),Mo.prototype.copy=function(){var t=new Mo;return t.vv=this.vv,t.Oc=this.Oc,t.Xe=this.Xe,t.Fj=this.Fj,t.Dj=this.Dj,t.Ce=this.Ce,t.eb=this.eb,t.mb=this.mb,t.Th=this.Th,t.As=this.As,t.Kj=null===this.Kj?null:this.Kj.S(),t.ws=this.ws,t.xs=this.xs,t.Mh=null,null!==this.Mh&&(t.Mh=xh.il(this.Mh)),t.Kb=this.Kb,t.xq=this.xq,t.sc=this.sc,t},Mo.prototype.it=function(t){xh.A(t,Mo,Mo,"copyFrom:pd"),t.de?this.height=t.height:this.width=t.width,this.dj=t.dj,this.jf=t.jf,this.alignment=t.alignment,this.stretch=t.stretch,this.lu=t.lu,this.Kj=null===t.Kj?null:t.Kj.S(),this.Mp=t.Mp,this.Np=t.Np,this.Mh=null,t.Mh&&(this.Mh=xh.il(t.Mh)),this.background=t.background,this.Jz=t.Jz,this.sc=t.sc},Mo.prototype.toString=function(){return"RowColumnDefinition "+(this.de?"(Row ":"(Column ")+this.index+") #"+xh.pd(this)};var Wu;Mo.Default=Wu=xh.p(Mo,"Default",0);var Xu;Mo.None=Xu=xh.p(Mo,"None",1);var Qu;Mo.ProportionalExtra=Qu=xh.p(Mo,"ProportionalExtra",2),Mo.prototype.Ll=function(t){this.Tg=t},Mo.prototype.computeEffectiveSpacingTop=Mo.prototype.RD=function(){var t=0;if(0!==this.index){var i=this.Tg,e=this.Mp;null===e&&null!==i&&(e=this.de?i.pi:i.Ah),null!==e&&(t=this.Np,isNaN(t)&&(t=null!==i?this.de?i.Ch:i.Bh:0))}if(null===(i=this.tF)){if(null===(i=this.Tg))return t;i=i.lj}return t+(this.de?i.top:i.left)},Mo.prototype.computeEffectiveSpacing=Mo.prototype.qf=function(){var t=0;if(0!==this.index){var i=this.Tg,e=this.Mp;null===e&&null!==i&&(e=this.de?i.pi:i.Ah),null!==e&&(t=this.Np,isNaN(t)&&(t=null!==i?this.de?i.Ch:i.Bh:0))}if(null===(i=this.tF)){if(null===(i=this.Tg))return t;i=i.lj}return t+(this.de?i.top+i.bottom:i.left+i.right)},Mo.prototype.$c=function(t,i,e,n,o){var r=this.Tg;if(null!==r&&(r.Lc(kl,t,this,i,e,n,o),null!==this.sc&&null!==(i=r.g)&&!i.we&&null!==(r=r.dp())&&null!==(r=r.data)))for(e=this.sc.i;e.next();)e.value.Ox(this,r,t,i)},xh.u(Mo,{T:"panel"},function(){return this.Tg}),xh.defineProperty(Mo,{de:"isRow"},function(){return this.vv},function(t){this.vv=t}),xh.defineProperty(Mo,{index:"index"},function(){return this.Oc},function(t){this.Oc=t}),xh.defineProperty(Mo,{height:"height"},function(){return this.Xe},function(t){var i=this.Xe;i!==t&&(0>t&&xh.wa(t,">= 0",Mo,"height"),this.Xe=t,this.Na=this.eb,null!==this.T&&this.T.Q(),this.$c("height",i,t))}),xh.defineProperty(Mo,{width:"width"},function(){return this.Xe},function(t){var i=this.Xe;i!==t&&(0>t&&xh.wa(t,">= 0",Mo,"width"),this.Xe=t,this.Na=this.eb,null!==this.T&&this.T.Q(),this.$c("width",i,t))}),xh.defineProperty(Mo,{dj:"minimum"},function(){return this.Fj},function(t){var i=this.Fj;i!==t&&((0>t||!isFinite(t))&&xh.wa(t,">= 0",Mo,"minimum"),this.Fj=t,this.Na=this.eb,null!==this.T&&this.T.Q(),this.$c("minimum",i,t))}),xh.defineProperty(Mo,{jf:"maximum"},function(){return this.Dj},function(t){var i=this.Dj;i!==t&&(0>t&&xh.wa(t,">= 0",Mo,"maximum"),this.Dj=t,this.Na=this.eb,null!==this.T&&this.T.Q(),this.$c("maximum",i,t))}),xh.defineProperty(Mo,{alignment:"alignment"},function(){return this.Ce},function(t){var i=this.Ce;i.L(t)||(this.Ce=t.S(),null!==this.T&&this.T.Q(),this.$c("alignment",i,t))}),xh.defineProperty(Mo,{stretch:"stretch"},function(){return this.Th},function(t){var i=this.Th;i!==t&&(this.Th=t,null!==this.T&&this.T.Q(),this.$c("stretch",i,t))}),xh.defineProperty(Mo,{tF:"separatorPadding"},function(){return this.Kj},function(t){"number"==typeof t&&(t=new j(t));var i=this.Kj;null!==t&&null!==i&&i.L(t)||(null!==t&&(t=t.S()),this.Kj=t,null!==this.T&&this.T.Q(),this.$c("separatorPadding",i,t))}),xh.defineProperty(Mo,{Mp:"separatorStroke"},function(){return this.ws},function(t){var i=this.ws;i!==t&&(null===t||"string"==typeof t||t instanceof kn)&&(t instanceof kn&&t.freeze(),this.ws=t,null!==this.T&&this.T.Q(),this.$c("separatorStroke",i,t))}),xh.defineProperty(Mo,{Np:"separatorStrokeWidth"},function(){return this.xs},function(t){var i=this.xs;i!==t&&(this.xs=t,null!==this.T&&this.T.Q(),this.$c("separatorStrokeWidth",i,t))}),xh.defineProperty(Mo,{lJ:"separatorDashArray"},function(){return this.Mh},function(t){var i=this.Mh;if(i!==t){if(null===t||Array.isArray(t)||xh.Ed(t,"Array",Mo,"separatorDashArray:value"),null!==t){for(var e=t.length,n=0,o=0;o<e;o++){var r=t[o];"number"==typeof r&&0<=r&&isFinite(r)||xh.k("separatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===i)return;t=null}}this.Mh=t,null!==this.T&&this.T.qa(),this.$c("separatorDashArray",i,t)}}),xh.defineProperty(Mo,{background:"background"},function(){return this.Kb},function(t){var i=this.Kb;i!==t&&(null===t||"string"==typeof t||t instanceof kn)&&(t instanceof kn&&t.freeze(),this.Kb=t,null!==this.T&&this.T.qa(),this.$c("background",i,t))}),xh.defineProperty(Mo,{Jz:"coversSeparators"},function(){return this.xq},function(t){var i=this.xq;i!==t&&(xh.j(t,"boolean",Mo,"coversSeparators"),this.xq=t,null!==this.T&&this.T.qa(),this.$c("coversSeparators",i,t))}),xh.defineProperty(Mo,{lu:"sizing"},function(){return this.As},function(t){var i=this.As;i!==t&&(this.As=t,null!==this.T&&this.T.Q(),this.$c("sizing",i,t))}),xh.defineProperty(Mo,{Na:"actual"},function(){return this.eb},function(t){this.eb=isNaN(this.Xe)?Math.max(Math.min(this.Dj,t),this.Fj):Math.max(Math.min(this.Dj,this.Xe),this.Fj)}),xh.defineProperty(Mo,{total:"total"},function(){return this.eb+this.qf()},function(t){this.eb=isNaN(this.Xe)?Math.max(Math.min(this.Dj,t),this.Fj):Math.max(Math.min(this.Dj,this.Xe),this.Fj),this.eb=Math.max(0,this.eb-this.qf())}),xh.defineProperty(Mo,{position:"position"},function(){return this.mb},function(t){this.mb=t}),Mo.prototype.bind=Mo.prototype.bind=function(t){t.ng=this;var i=this.T;if(null!==i){var e=i.dp();null!==e&&mo(e)&&xh.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+t+" on "+i)}null===this.sc&&(this.sc=new u(Tt)),this.sc.add(t)},xh.Ja(To,Mn),xh.ea("Shape",To),To.prototype.cloneProtected=function(t){Mn.prototype.cloneProtected.call(this,t),t.Ua=this.Ua,t.Rn=this.Rn,t.Oh=this.Oh,t.Uq=this.Uq,t.Zl=this.Zl,t.td=this.td,t.Dc=this.Dc,t.Uh=this.Uh,t.Eo=this.Eo,t.Go=this.Go,t.Cm=this.Cm,null!==this.Fo&&(t.Fo=xh.il(this.Fo)),t.nd=this.nd,t.Li=this.Li.S(),t.Mi=this.Mi.S(),t.Ur=this.Ur,t.Vr=this.Vr,t.br=this.br,t.Xr=this.Xr,t.Ko=this.Ko,t.Un=this.Un,t.Zq=this.Zq},To.prototype.toString=function(){return"Shape("+("None"!==this.Cb?this.Cb:"None"!==this.Tp?this.Tp:this.Pz)+")#"+xh.pd(this)},To.prototype.ak=function(t,i){if(null!==this.Dc||null!==this.td){null!==this.td&&qn(this,t,this.td,!0,!1),null!==this.Dc&&qn(this,t,this.Dc,!1,!1);var e=this.Uh;if(0===e){(r=this.aa)instanceof xr&&r.type===Ku&&"Selection"===r.Fc&&r.gc instanceof To&&r.Wg.af()===r.gc&&(e=r.gc.pb)}t.lineWidth=e,t.lineJoin=this.Go,t.lineCap=this.Eo,t.miterLimit=this.Cm;var n=!1;this.aa&&i.ek("drawShadows")&&(n=this.aa.El);var o=!0;null!==this.Dc&&null===this.td&&(o=!1);var r=!1,s=!0,a=this.CF;null!==a&&(r=!0,void 0!==t.setLineDash?(t.setLineDash(a),t.lineDashOffset=this.nd):void 0!==t.webkitLineDash?(t.webkitLineDash=a,t.webkitLineDashOffset=this.nd):void 0!==t.mozDash?(t.mozDash=a,t.mozDashOffset=this.nd):s=!1);if(null!==(c=this.Ua)){if(c.ja===ll)t.beginPath(),r&&!s?Tn(t,c.wc,c.Cc,c.yb,c.Db,a,this.nd):(t.moveTo(c.wc,c.Cc),t.lineTo(c.yb,c.Db)),null!==this.td&&zn(t,this.td),0!==e&&null!==this.Dc&&On(t);else if(c.ja===ul){var h=c.wc,l=c.Cc,u=c.yb,f=c.Db,c=Math.min(h,u),p=Math.min(l,f),h=Math.abs(u-h),l=Math.abs(f-l);if(null!==this.td&&(t.beginPath(),t.rect(c,p,h,l),zn(t,this.td)),null!==this.Dc){var d=u=0,y=0;o&&n&&(u=t.shadowOffsetX,d=t.shadowOffsetY,y=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0),r&&!s?((s=xh.lb()).push(c),s.push(p),s.push(c+h),s.push(p),s.push(c+h),s.push(p+l),s.push(c),s.push(p+l),s.push(c),s.push(p),t.beginPath(),No(t,s,a,this.nd),On(t),xh.ta(s)):0!==e&&(t.beginPath(),t.rect(c,p,h,l),On(t)),o&&n&&(t.shadowOffsetX=u,t.shadowOffsetY=d,t.shadowBlur=y)}}else if(c.ja===fl)h=c.wc,l=c.Cc,u=c.yb,f=c.Db,c=Math.abs(u-h)/2,p=Math.abs(f-l)/2,h=Math.min(h,u)+c,l=Math.min(l,f)+p,t.beginPath(),t.moveTo(h,l-p),t.bezierCurveTo(h+hl.Da*c,l-p,h+c,l-hl.Da*p,h+c,l),t.bezierCurveTo(h+c,l+hl.Da*p,h+hl.Da*c,l+p,h,l+p),t.bezierCurveTo(h-hl.Da*c,l+p,h-c,l+hl.Da*p,h-c,l),t.bezierCurveTo(h-c,l-hl.Da*p,h-hl.Da*c,l-p,h,l-p),t.closePath(),null!==this.td&&zn(t,this.td),r&&!s&&(s=xh.lb(),hl.pe(h,l-p,h+hl.Da*c,l-p,h+c,l-hl.Da*p,h+c,l,.5,s),hl.pe(h+c,l,h+c,l+hl.Da*p,h+hl.Da*c,l+p,h,l+p,.5,s),hl.pe(h,l+p,h-hl.Da*c,l+p,h-c,l+hl.Da*p,h-c,l,.5,s),hl.pe(h-c,l,h-c,l-hl.Da*p,h-hl.Da*c,l-p,h,l-p,.5,s),t.beginPath(),No(t,s,a,this.nd),xh.ta(s)),0!==e&&null!==this.Dc&&(o&&n?(u=t.shadowOffsetX,d=t.shadowOffsetY,y=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,On(t),t.shadowOffsetX=u,t.shadowOffsetY=d,t.shadowBlur=y):On(t));else if(c.ja===cl){for(l=(p=c.nj).length,f=0;f<l;f++){h=p.n[f],t.beginPath(),t.moveTo(h.za,h.xa);for(var d=(u=h.vb.n).length,v=null,y=0;y<d;y++){var g=u[y];switch(g.ja){case yl:t.moveTo(g.I,g.J);break;case vl:t.lineTo(g.I,g.J);break;case gl:t.bezierCurveTo(g.vd,g.Ie,g.Ug,g.mg,g.yb,g.Db);break;case ml:t.quadraticCurveTo(g.vd,g.Ie,g.yb,g.Db);break;case bl:if(g.radiusX===g.radiusY)v=Math.PI/180,t.arc(g.vd,g.Ie,g.radiusX,g.xe*v,(g.xe+g.Bf)*v,0>g.Bf);else{var m=(v=$(g,h)).length;if(0===m){t.lineTo(g.oa,g.va);break}for(var b=0;b<m;b++){var x=v[b];0===b&&t.lineTo(x[0],x[1]),t.bezierCurveTo(x[2],x[3],x[4],x[5],x[6],x[7])}}break;case xl:if(b=m=0,null!==v&&v.type===bl){if(v=$(v,h),0===(x=v.length)){t.lineTo(g.oa,g.va);break}null!==(v=v[x-1]||null)&&(m=v[6],b=v[7])}else m=null!==v?v.I:h.za,b=null!==v?v.J:h.xa;if(v=_(g,h,m,b),0===(m=v.length)){t.lineTo(g.oa,g.va);break}for(b=0;b<m;b++)x=v[b],t.bezierCurveTo(x[2],x[3],x[4],x[5],x[6],x[7]);break;default:xh.k("Segment not of valid type: "+g.ja)}g.Hh&&t.closePath(),v=g}n?(y=d=u=0,h.ao?(!0===h.cm&&null!==this.td?(zn(t,this.td),o=!0):o=!1,0!==e&&null!==this.Dc&&(o&&(u=t.shadowOffsetX,d=t.shadowOffsetY,y=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0),r&&!s||On(t),o&&(t.shadowOffsetX=u,t.shadowOffsetY=d,t.shadowBlur=y))):(o&&(u=t.shadowOffsetX,d=t.shadowOffsetY,y=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0),!0===h.cm&&null!==this.td&&zn(t,this.td),0!==e&&null!==this.Dc&&(r&&!s||On(t)),o&&(t.shadowOffsetX=u,t.shadowOffsetY=d,t.shadowBlur=y))):(!0===h.cm&&null!==this.td&&zn(t,this.td),0===e||null===this.Dc||r&&!s||On(t))}if(r&&!s)for(e=o,o=c.nj,s=o.length,c=0;c<s;c++){for(p=o.n[c],t.beginPath(),(l=xh.lb()).push(p.za),l.push(p.xa),u=f=p.za,d=h=p.xa,g=(y=p.vb.n).length,v=0;v<g;v++){switch((m=y[v]).ja){case yl:No(t,l,a,this.nd),l.length=0,l.push(m.I),l.push(m.J),u=f=m.I,d=h=m.J;break;case vl:l.push(m.I),l.push(m.J),f=m.I,h=m.J;break;case gl:hl.pe(f,h,m.vd,m.Ie,m.Ug,m.mg,m.yb,m.Db,.5,l),f=m.I,h=m.J;break;case ml:hl.Ep(f,h,m.vd,m.Ie,m.yb,m.Db,.5,l),f=m.I,h=m.J;break;case bl:if(b=$(m,p),0===(x=b.length)){l.push(m.oa),l.push(m.va),f=m.oa,h=m.va;break}for(var w=0;w<x;w++){var k=b[w];hl.pe(f,h,k[2],k[3],k[4],k[5],k[6],k[7],.5,l),f=k[6],h=k[7]}break;case xl:if(b=_(m,p,f,h),0===(x=b.length)){l.push(m.oa),l.push(m.va),f=m.oa,h=m.va;break}for(w=0;w<x;w++)k=b[w],hl.pe(f,h,k[2],k[3],k[4],k[5],k[6],k[7],.5,l),f=k[6],h=k[7];break;default:xh.k("Segment not of valid type: "+m.ja)}m.Hh&&(l.push(u),l.push(d),No(t,l,a,this.nd))}No(t,l,a,this.nd),xh.ta(l),null!==this.Dc&&(f=l=p=0,e&&n&&(p=t.shadowOffsetX,l=t.shadowOffsetY,f=t.shadowBlur,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0),On(t),e&&n&&(t.shadowOffsetX=p,t.shadowOffsetY=l,t.shadowBlur=f))}}if(r&&(void 0!==t.setLineDash?(t.setLineDash(xh.vh),t.lineDashOffset=0):void 0!==t.webkitLineDash?(t.webkitLineDash=xh.vh,t.webkitLineDashOffset=0):void 0!==t.mozDash&&(t.mozDash=null,t.mozDashOffset=0)),null!==this.tx){if(r=this.tx,jn(r,1/0,1/0),a=r.Ca,r.Ec(0,0,a.width,a.height),e=this.tl,t.save(),t.beginPath(),a=xh.lb(),e.type===ll)a.push(e.za),a.push(e.xa),a.push(e.I),a.push(e.J),So(t,i,a,r);else if(e.type===cl)for(s=e.Wb.i;s.next();){for(c=s.value,a.length=0,a.push(c.za),a.push(c.xa),l=o=c.za,f=p=c.xa,u=(h=c.vb.n).length,d=0;d<u;d++){switch((y=h[d]).ja){case yl:So(t,i,a,r),a.length=0,a.push(y.I),a.push(y.J),l=o=y.I,f=p=y.J;break;case vl:a.push(y.I),a.push(y.J),o=y.I,p=y.J;break;case gl:hl.pe(o,p,y.vd,y.Ie,y.Ug,y.mg,y.yb,y.Db,.5,a),o=y.I,p=y.J;break;case ml:hl.Ep(o,p,y.vd,y.Ie,y.yb,y.Db,.5,a),o=y.I,p=y.J;break;case bl:if(e=$(y,c),0===(n=e.length)){a.push(y.oa),a.push(y.va),o=y.oa,p=y.va;break}for(g=0;g<n;g++)v=e[g],hl.pe(o,p,v[2],v[3],v[4],v[5],v[6],v[7],.5,a),o=v[6],p=v[7];break;case xl:if(e=_(y,c,o,p),0===(n=e.length)){a.push(y.oa),a.push(y.va),o=y.oa,p=y.va;break}for(g=0;g<n;g++)v=e[g],hl.pe(o,p,v[2],v[3],v[4],v[5],v[6],v[7],.5,a),o=v[6],p=v[7];break;default:xh.k("Segment not of valid type: "+y.ja)}y.Hh&&(a.push(l),a.push(f),So(t,i,a,r))}So(t,i,a,r)}else if(e.type===ul)a.push(e.za),a.push(e.xa),a.push(e.I),a.push(e.xa),a.push(e.I),a.push(e.J),a.push(e.za),a.push(e.J),a.push(e.za),a.push(e.xa),So(t,i,a,r);else if(e.type===fl){if(s=new Q,s.za=e.I,s.xa=(e.xa+e.J)/2,o=new Z(bl),o.xe=0,o.Bf=360,o.oa=(e.za+e.I)/2,o.va=(e.xa+e.J)/2,o.radiusX=Math.abs(e.za-e.I)/2,o.radiusY=Math.abs(e.xa-e.J)/2,s.add(o),e=$(o,s),0===(n=e.length))a.push(o.oa),a.push(o.va);else for(o=s.za,p=s.xa,g=0;g<n;g++)v=e[g],hl.pe(o,p,v[2],v[3],v[4],v[5],v[6],v[7],.5,a),o=v[6],p=v[7];So(t,i,a,r)}xh.ta(a),t.restore(),te(i,t,!1)}}}},To.prototype.getDocumentPoint=To.prototype.Za=function(t,i){void 0===i&&(i=new b),t.te()&&xh.k("getDocumentPoint Spot must be a real, specific Spot, not: "+t.toString());var e=this.Ia,n=this.pb;return i.m(t.x*(e.width+n)-n/2+e.x+t.offsetX,t.y*(e.height+n)-n/2+e.y+t.offsetY),this.Xg.xb(i),i},To.prototype.Yj=function(t,i){if(null===(l=this.Ua)||null===this.fill&&null===this.stroke)return!1;var e=l.nb,n=this.pb/2;l.type!==ll||i||(n+=2);var o=xh.ag();if(o.assign(e),o.Qf(n+2,n+2),!o.Ga(t))return xh.ic(o),!1;if(e=n+1e-4,l.type===ll)return null!==this.stroke&&(e=(l.I-l.za)*(t.x-l.za)+(l.J-l.xa)*(t.y-l.xa),!(0>(l.za-l.I)*(t.x-l.I)+(l.xa-l.J)*(t.y-l.J)||0>e)&&(xh.ic(o),hl.Dd(l.za,l.xa,l.I,l.J,n,t.x,t.y)));if(l.type===ul){var r=l.za,s=l.xa,a=l.I,h=l.J;if(o.x=Math.min(r,a),o.y=Math.min(s,h),o.width=Math.abs(a-r),o.height=Math.abs(h-s),null===this.fill){if(o.Qf(-e,-e),o.Ga(t))return xh.ic(o),!1;o.Qf(e,e)}return null!==this.stroke&&o.Qf(n,n),n=o.Ga(t),xh.ic(o),n}if(l.type===fl){var r=l.za,s=l.xa,a=l.I,h=l.J,l=Math.min(r,a),u=Math.min(s,h),r=Math.abs(a-r)/2,s=Math.abs(h-s)/2,l=t.x-(l+r),u=t.y-(u+s);if(null===this.fill){if(r-=e,s-=e,0>=r||0>=s||1>=l*l/(r*r)+u*u/(s*s))return xh.ic(o),!1;r+=e,s+=e}return null!==this.stroke&&(r+=n,s+=n),xh.ic(o),!(0>=r||0>=s)&&1>=l*l/(r*r)+u*u/(s*s)}return l.type===cl?(xh.ic(o),null===this.fill?X(l,t.x,t.y,n):l.Ga(t,n,1<this.pb,i)):(xh.k("Unknown Geometry type: "+l.type),!1)},To.prototype.vp=function(t,i,e,n){var o=this.ya,r=this.Uh;t=Math.max(t,0),i=Math.max(i,0);var s;if(this.Oh)s=this.tl.nb;else{a=this.Cb;if(void 0===(h=hl.Wx[a])){"string"==typeof(l=hl.wg[a])&&(l=hl.wg[l]),"function"==typeof l?(h=l(null,100,100),hl.Wx[a]=h):xh.k("Unsupported Figure: "+a)}s=h.nb}var a=s.width,h=s.height,l=s.width,u=s.height;switch(Rn(this,!0)){case Su:n=e=0;break;case Lu:l=Math.max(t-r,0),u=Math.max(i-r,0);break;case ju:l=Math.max(t-r,0),n=0;break;case Cu:e=0,u=Math.max(i-r,0)}switch(isFinite(o.width)&&(l=o.width),isFinite(o.height)&&(u=o.height),o=this.yf,s=this.gh,e=Math.max(e,s.width)-r,n=Math.max(n,s.height)-r,l=Math.min(o.width,l),u=Math.min(o.height,u),l=isFinite(l)?Math.max(e,l):Math.max(a,e),u=isFinite(u)?Math.max(n,u):Math.max(h,n),e=jo(this)){case Su:break;case Lu:a=l,h=u;break;case Du:e=Math.min(l/a,u/h),isFinite(e)||(e=1),a*=e,h*=e;break;default:xh.k(e+" is not a valid geometryStretch.")}this.Oh?(s=this.tl,o=a,n=h,e=s.copy(),s=s.nb,o/=s.width,n/=s.height,isFinite(o)||(o=1),isFinite(n)||(n=1),1===o&&1===n||e.scale(o,n),this.Ua=e):null!==this.Ua&&this.Ua.$n===t-r&&this.Ua.Yn===i-r||(this.Ua=hl.makeGeometry(this,a,h)),s=this.Ua.nb,1/0===t||1/0===i?Nn(this,s.x-r/2,s.y-r/2,0===t&&0===a?0:s.width+r,0===i&&0===h?0:s.height+r):Nn(this,-r/2,-r/2,l+r,u+r)},To.prototype.Ri=function(t,i,e,n){Ln(this,t,i,e,n)},To.prototype.getNearestIntersectionPoint=To.prototype.xl=function(t,i,e){return this.ip(t.x,t.y,i.x,i.y,e)},To.prototype.ip=function(t,i,e,n,o){var r=1/((c=this.transform).m11*c.m22-c.m12*c.m21),s=c.m22*r,a=-c.m12*r,h=-c.m21*r,l=c.m11*r,u=r*(c.m21*c.dy-c.m22*c.dx),f=r*(c.m12*c.dx-c.m11*c.dy),c=t*s+i*h+u,r=t*a+i*l+f,s=e*s+n*h+u,a=e*a+n*l+f,h=this.pb/2;if(null===(u=this.Ua)&&(jn(this,1/0,1/0),u=this.Ua),f=u.nb,l=!1,u.type===ll)if(1.5>=this.pb)l=hl.ih(u.wc,u.Cc,u.yb,u.Db,c,r,s,a,o);else{var p=0,d=0;if(u.wc===u.yb?(p=h,d=0):(i=(u.Db-u.Cc)/(u.yb-u.wc),d=h/Math.sqrt(1+i*i),p=d*i),n=xh.lb(),i=new b,hl.ih(u.wc+p,u.Cc+d,u.yb+p,u.Db+d,c,r,s,a,i)&&n.push(i),i=new b,hl.ih(u.wc-p,u.Cc-d,u.yb-p,u.Db-d,c,r,s,a,i)&&n.push(i),i=new b,hl.ih(u.wc+p,u.Cc+d,u.wc-p,u.Cc-d,c,r,s,a,i)&&n.push(i),i=new b,hl.ih(u.yb+p,u.Db+d,u.yb-p,u.Db-d,c,r,s,a,i)&&n.push(i),0===(i=n.length))return xh.ta(n),!1;for(l=!0,d=1/0,p=0;p<i;p++){(N=((s=n[p]).x-c)*(s.x-c)+(s.y-r)*(s.y-r))<d&&(d=N,o.x=s.x,o.y=s.y)}xh.ta(n)}else if(u.type===ul)i=f.x-h,l=hl.xl(i,f.y-h,f.x+f.width+h,f.y+f.height+h,c,r,s,a,o);else if(u.type===fl)t:if(0===(i=f.copy().Qf(h,h)).width)l=hl.ih(i.x,i.y,i.x,i.y+i.height,c,r,s,a,o);else if(0===i.height)l=hl.ih(i.x,i.y,i.x+i.width,i.y,c,r,s,a,o);else{t=i.width/2;var y=i.height/2;if(n=i.x+t,i=i.y+y,e=9999,c!==s&&(e=(r-a)/(c-s)),9999>Math.abs(e)){if(l=r-i-e*(c-n),0>t*t*e*e+y*y-l*l){o.x=NaN,o.y=NaN,l=!1;break t}a=e*((s=(-t*t*e*l+t*y*(h=Math.sqrt(t*t*e*e+y*y-l*l)))/(y*y+t*t*e*e)+n)-n)+l+i,i=e*((t=(-t*t*e*l-t*y*h)/(y*y+t*t*e*e)+n)-n)+l+i,(n=Math.abs((c-s)*(c-s))+Math.abs((r-a)*(r-a)))<(r=Math.abs((c-t)*(c-t))+Math.abs((r-i)*(r-i)))?(o.x=s,o.y=a):(o.x=t,o.y=i)}else{if(s=y*y,a=c-n,0>(s-=s/(t*t)*a*a)){o.x=NaN,o.y=NaN,l=!1;break t}a=i+(h=Math.sqrt(s)),i-=h,(n=Math.abs(a-r))<(r=Math.abs(i-r))?(o.x=c,o.y=a):(o.x=c,o.y=i)}l=!0}else if(u.type===cl){var v=0,g=0,m=N=0,f=xh.M(),d=(p=s-c)*p+(d=a-r)*d;for(o.x=s,o.y=a,p=0;p<u.Wb.count;p++)for(var x=u.Wb.n[p],w=x.vb,v=x.za,g=x.xa,k=v,M=g,P=0;P<w.count;P++){var T=w.n[P],S=T.type,N=T.I,m=T.J,C=!1;switch(S){case yl:k=N,M=m;break;case vl:C=Do(v,g,N,m,c,r,s,a,f);break;case gl:var C=T.rc,S=T.Kc,j=T.nh,L=T.oh,C=hl.ct(v,g,C,S,j,L,N,m,c,r,s,a,.5,f);break;case ml:C=(v+2*T.rc)/3,S=(g+2*T.Kc)/3,j=(2*T.rc+N)/3,L=(2*T.rc+N)/3,C=hl.ct(v,g,C,S,j,L,N,m,c,r,s,a,.5,f);break;case bl:case xl:if(S=T.type===bl?$(T,x):_(T,x,v,g),0===(j=S.length)){C=Do(v,g,T.oa,T.va,c,r,s,a,f);break}for(m=0;m<j;m++)y=S[m],0===m&&Do(v,g,y[0],y[1],c,r,s,a,f)&&(N=Lo(c,r,f,d,o))<d&&(d=N,l=!0),hl.ct(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],c,r,s,a,.5,f)&&(N=Lo(c,r,f,d,o))<d&&(d=N,l=!0);N=y[6],m=y[7];break;default:xh.k("Unknown Segment type: "+S)}v=N,g=m,C&&(N=Lo(c,r,f,d,o))<d&&(d=N,l=!0),T.$w&&(N=k,m=M,Do(v,g,N,m,c,r,s,a,f)&&(N=Lo(c,r,f,d,o))<d&&(d=N,l=!0))}c=e-t,r=n-i,0!==(i=Math.sqrt(c*c+r*r))&&(c/=i,r/=i),o.x-=c*h,o.y-=r*h,xh.v(f)}else xh.k("Unknown Geometry type: "+u.type);return!!l&&(this.transform.xb(o),!0)},To.prototype.containedInRect=To.prototype.Om=function(t,i){if(void 0===i)return t.Zj(this.Y);null===(e=this.Ua)&&(jn(this,1/0,1/0),e=this.Ua);var e=e.nb,n=this.pb/2,o=!1,r=xh.M();return r.m(e.x-n,e.y-n),t.Ga(i.xb(r))&&(r.m(e.x-n,e.bottom+n),t.Ga(i.xb(r))&&(r.m(e.right+n,e.bottom+n),t.Ga(i.xb(r))&&(r.m(e.right+n,e.y-n),t.Ga(i.xb(r))&&(o=!0)))),xh.v(r),o},To.prototype.intersectsRect=To.prototype.xg=function(t,i){if(this.Om(t,i)||void 0===i&&(i=this.transform,t.Zj(this.Y)))return!0;var e=xh.sh();e.set(i),e.Xz();var n=t.left,o=t.right,r=t.top,s=t.bottom,a=xh.M();if(a.m(n,r),e.xb(a),this.Yj(a,!0))return xh.v(a),!0;if(a.m(o,r),e.xb(a),this.Yj(a,!0))return xh.v(a),!0;if(a.m(n,s),e.xb(a),this.Yj(a,!0))return xh.v(a),!0;if(a.m(o,s),e.xb(a),this.Yj(a,!0))return xh.v(a),!0;var h=xh.M(),l=xh.M();e.set(i),e.VE(this.transform),e.Xz(),h.x=o,h.y=r,h.transform(e),a.x=n,a.y=r,a.transform(e);var u=!1;return Ao(this,a,h,l)?u=!0:(a.x=o,a.y=s,a.transform(e),Ao(this,a,h,l)?u=!0:(h.x=n,h.y=s,h.transform(e),Ao(this,a,h,l)?u=!0:(a.x=n,a.y=r,a.transform(e),Ao(this,a,h,l)&&(u=!0)))),xh.v(a),xh.cf(e),xh.v(h),xh.v(l),u},To.prototype.kE=function(t,i,e){function n(t,i){for(var e=t.length,n=0;n<e;n+=2)if(i.ap(t[n],t[n+1])>o)return!0;return!1}if(e&&null!==this.fill&&this.Yj(t,!0))return!0;var o=t.$j(i);i=o,1.5<this.pb&&(o=this.pb/2+Math.sqrt(o),o*=o);if(null===(l=this.Ua)&&(jn(this,1/0,1/0),null===(l=this.Ua)))return!1;if(!e){var r=(h=l.nb).x,s=h.y,a=h.x+h.width,h=h.y+h.height;if(Ph(t.x,t.y,r,s)<=o&&Ph(t.x,t.y,a,s)<=o&&Ph(t.x,t.y,r,h)<=o&&Ph(t.x,t.y,a,h)<=o)return!0}if(r=l.wc,s=l.Cc,a=l.yb,h=l.Db,l.type===ll){if(e=Mh(t.x,t.y,r,s,a,h),l=(r-a)*(t.x-a)+(s-h)*(t.y-h),e<=(0<=(a-r)*(t.x-r)+(h-s)*(t.y-s)&&0<=l?o:i))return!0}else{if(l.type===ul)return i=!1,e&&(i=Mh(t.x,t.y,r,s,r,h)<=o||Mh(t.x,t.y,r,s,a,s)<=o||Mh(t.x,t.y,a,s,a,h)<=o||Mh(t.x,t.y,r,h,a,h)<=o),i;if(l.type===fl){i=t.x-(r+a)/2;var l=t.y-(s+h)/2,u=Math.abs(a-r)/2,f=Math.abs(h-s)/2;if(0===u||0===f)return(e=Mh(t.x,t.y,r,s,a,h))<=o;if(!e)return!(Ph(i,l,-u,0)>=o||Ph(i,l,0,-f)>=o||Ph(i,l,0,f)>=o||Ph(i,l,u,0)>=o);if((t=hl.tH(u,f,i,l))*t<=o)return!0}else if(l.type===cl){if(h=l.nb,r=h.x,s=h.y,a=h.x+h.width,h=h.y+h.height,t.x>a&&t.x<r&&t.y>h&&t.y<s&&Mh(t.x,t.y,r,s,r,h)>o&&Mh(t.x,t.y,r,s,a,s)>o&&Mh(t.x,t.y,a,h,r,h)>o&&Mh(t.x,t.y,a,h,a,s)>o)return!1;if(i=Math.sqrt(o),!e){for(e=l.Wb,i=0;i<e.count;i++){if(r=e.n[i],u=r.za,f=r.xa,t.ap(u,f)>o)return!1;for(a=(s=r.vb.n).length,h=0;h<a;h++){var c=s[h];switch(c.type){case yl:case vl:if(u=c.I,f=c.J,t.ap(u,f)>o)return!1;break;case gl:if(l=xh.lb(),hl.pe(u,f,c.rc,c.Kc,c.nh,c.oh,c.I,c.J,.8,l),u=n(l,t),xh.ta(l),u)return!1;if(u=c.I,f=c.J,t.ap(u,f)>o)return!1;break;case ml:if(l=xh.lb(),hl.Ep(u,f,c.rc,c.Kc,c.I,c.J,.8,l),u=n(l,t),xh.ta(l),u)return!1;if(u=c.I,f=c.J,t.ap(u,f)>o)return!1;break;case bl:case xl:var p=c.type===bl?$(c,r):_(c,r,u,f),d=p.length;if(0===d){if(u=c.oa,f=c.va,t.ap(u,f)>o)return!1;break}for(c=null,l=xh.lb(),i=0;i<d;i++)if(c=p[i],l.length=0,hl.pe(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],.8,l),n(l,t))return xh.ta(l),!1;xh.ta(l),null!==c&&(u=c[6],f=c[7]);break;default:xh.k("Unknown Segment type: "+c.type)}}}return!0}if(null===this.fill?X(l,t.x,t.y,i):l.Ga(t,i,!0))return!0}}return!1},xh.defineProperty(To,{tl:"geometry"},function(){return this.Zl?this.Zl:this.Ua},function(t){var i=this.Ua;if(i!==t){this.Zl=this.Ua=null!==t?t.freeze():null;var e=this.aa;null!==e&&(e.Bj=NaN),this.Oh=!0,this.Q(),this.h("geometry",i,t),null!==(t=this.aa)&&0!=(1024&this.fa)&&Sn(this,t,"geometryString")}}),xh.defineProperty(To,{IH:"geometryString"},function(){return null===this.tl?"":this.tl.toString()},function(t){var i=(t=dl(t)).normalize();this.tl=t,this.position=t=xh.Ob(-i.x,-i.y),xh.v(t)}),xh.defineProperty(To,{EE:"isGeometryPositioned"},function(){return this.br},function(t){var i=this.br;i!==t&&(this.br=t,this.Q(),this.h("isGeometryPositioned",i,t))}),To.prototype.se=function(){this.Ua=null,this.Q()},xh.defineProperty(To,{fill:"fill"},function(){return this.td},function(t){var i=this.td;i!==t&&(t instanceof kn&&t.freeze(),this.td=t,this.qa(),this.h("fill",i,t))}),xh.defineProperty(To,{stroke:"stroke"},function(){return this.Dc},function(t){var i=this.Dc;i!==t&&(t instanceof kn&&t.freeze(),this.Dc=t,this.qa(),this.h("stroke",i,t))}),xh.defineProperty(To,{pb:"strokeWidth"},function(){return this.Uh},function(t){var i=this.Uh;if(i!==t)if(0<=t){this.Uh=t,this.Q();var e=this.aa;null!==e&&(e.Bj=NaN),this.h("strokeWidth",i,t)}else xh.wa(t,"value >= 0",To,"strokeWidth:value")}),xh.defineProperty(To,{AL:"strokeCap"},function(){return this.Eo},function(t){var i=this.Eo;i!==t&&("string"!=typeof t||"butt"!==t&&"round"!==t&&"square"!==t?xh.wa(t,'"butt", "round", or "square"',To,"strokeCap"):(this.Eo=t,this.qa(),this.h("strokeCap",i,t)))}),xh.defineProperty(To,{CL:"strokeJoin"},function(){return this.Go},function(t){var i=this.Go;i!==t&&("string"!=typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?xh.wa(t,'"miter", "bevel", or "round"',To,"strokeJoin"):(this.Go=t,this.qa(),this.h("strokeJoin",i,t)))}),xh.defineProperty(To,{DL:"strokeMiterLimit"},function(){return this.Cm},function(t){var i=this.Cm;if(i!==t)if(1<=t){this.Cm=t,this.qa();var e=this.aa;null!==e&&(e.Bj=NaN),this.h("strokeMiterLimit",i,t)}else xh.wa(t,"value >= 1",To,"strokeWidth:value")}),xh.defineProperty(To,{CF:"strokeDashArray"},function(){return this.Fo},function(t){var i=this.Fo;if(i!==t){if(null===t||Array.isArray(t)||xh.Ed(t,"Array",To,"strokeDashArray:value"),null!==t){for(var e=t.length,n=0,o=0;o<e;o++){var r=t[o];"number"==typeof r&&0<=r&&isFinite(r)||xh.k("strokeDashArray:value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===i)return;t=null}}this.Fo=t,this.qa(),this.h("strokeDashArray",i,t)}}),xh.defineProperty(To,{BL:"strokeDashOffset"},function(){return this.nd},function(t){var i=this.nd;i!==t&&0<=t&&(this.nd=t,this.qa(),this.h("strokeDashOffset",i,t))}),xh.defineProperty(To,{Cb:"figure"},function(){return this.Rn},function(t){var i=this.Rn;if(i!==t){var e=hl.wg[t];"function"==typeof e?e=t:(e=hl.wg[t.toLowerCase()])||xh.k("Unknown Shape.figure: "+t),i!==e&&(null!==(t=this.aa)&&(t.Bj=NaN),this.Rn=e,this.Oh=!1,this.se(),this.h("figure",i,e))}}),xh.defineProperty(To,{Tp:"toArrow"},function(){return this.Ko},function(t){var i=this.Ko;if(!0===t?t="Standard":!1===t&&(t=""),i!==t){var e=hl.LD(t);null===e?xh.k("Unknown Shape.toArrow: "+t):i!==e&&(this.Ko=e,this.Oh=!1,this.se(),Fo(this),this.h("toArrow",i,e))}}),xh.defineProperty(To,{Pz:"fromArrow"},function(){return this.Un},function(t){var i=this.Un;if(!0===t?t="Standard":!1===t&&(t=""),i!==t){var e=hl.LD(t);null===e?xh.k("Unknown Shape.fromArrow: "+t):i!==e&&(this.Un=e,this.Oh=!1,this.se(),Fo(this),this.h("fromArrow",i,e))}}),xh.defineProperty(To,{B:"spot1"},function(){return this.Li},function(t){xh.A(t,D,To,"spot1");var i=this.Li;i.L(t)||(this.Li=t=t.S(),this.Q(),this.h("spot1",i,t))}),xh.defineProperty(To,{C:"spot2"},function(){return this.Mi},function(t){xh.A(t,D,To,"spot2");var i=this.Mi;i.L(t)||(this.Mi=t=t.S(),this.Q(),this.h("spot2",i,t))}),xh.defineProperty(To,{Ac:"parameter1"},function(){return this.Ur},function(t){var i=this.Ur;i!==t&&(this.Ur=t,this.se(),this.h("parameter1",i,t))}),xh.defineProperty(To,{Xt:"parameter2"},function(){return this.Vr},function(t){var i=this.Vr;i!==t&&(this.Vr=t,this.se(),this.h("parameter2",i,t))}),xh.u(To,{Ia:"naturalBounds"},function(){if(null!==this.Ua)return this.Qc.assign(this.Ua.nb),this.Qc;var t=this.ya;return new M(0,0,t.width,t.height)}),xh.defineProperty(To,{tx:"pathPattern"},function(){return this.Xr},function(t){var i=this.Xr;i!==t&&(this.Xr=t,this.qa(),this.h("pathPattern",i,t))}),xh.defineProperty(To,{qL:"pathObject"},function(){return this.tx},function(t){this.tx=t}),xh.defineProperty(To,{Qz:"geometryStretch"},function(){return this.Uq},function(t){var i=this.Uq;i!==t&&(xh.rb(t,Mn,To,"geometryStretch"),this.Uq=t,this.h("geometryStretch",i,t))}),xh.defineProperty(To,{interval:"interval"},function(){return this.Zq},function(t){var i=this.Zq;i!==(t=Math.floor(t))&&0<=t&&(this.Zq=t,null!==this.g&&Le(this.g),this.Q(),this.h("interval",i,t))}),To.getFigureGenerators=function(){var t,i=new m("string","function");for(t in hl.wg)if(t!==t.toLowerCase()){var e=hl.wg[t];"function"==typeof e&&i.add(t,e)}return i.freeze(),i},To.defineFigureGenerator=function(t,i){xh.j(t,"string",To,"defineFigureGenerator:name"),"string"==typeof i?""!==i&&hl.wg[i]||xh.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+i):xh.j(i,"function",To,"defineFigureGenerator:func");var e=t.toLowerCase();""!==t&&"none"!==e&&t!==e||xh.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+t);var n=hl.wg;n[t]=i,n[e]=t},To.getArrowheadGeometries=function(){var t,i=new m("string",K);for(t in hl.ij)if(t!==t.toLowerCase()){var e=hl.ij[t];e instanceof K&&i.add(t,e)}return i.freeze(),i},To.defineArrowheadGeometry=function(t,i){xh.j(t,"string",To,"defineArrowheadGeometry:name");var e=null;"string"==typeof i?(xh.j(i,"string",To,"defineArrowheadGeometry:pathstr"),e=dl(i,!1)):(xh.A(i,K,To,"defineArrowheadGeometry:pathstr"),e=i);var n=t.toLowerCase();""!==t&&"none"!==n&&t!==n||xh.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var o=hl.ij;o[t]=e,o[n]=t},xh.Ja(zo,Mn),xh.ea("TextBlock",zo);var Zu=new n,$u=0,_u=new n,tf=0,ef="...",nf="",of=xh.createElement("canvas").getContext("2d");zo.getEllipsis=function(){return ef},zo.setEllipsis=function(t){ef=t,_u=new n,tf=0},zo.prototype.cloneProtected=function(t){Mn.prototype.cloneProtected.call(this,t),t.le=this.le,t.Dc=this.Dc,t.Kg=this.Kg,t.zd=this.zd,t.dr=this.dr,t.fm=this.fm,t.em=this.em,t.Xk=this.Xk,t.Fm=this.Fm,t.Fe=this.Fe,t.Ev=this.Ev,t.Vy=this.Vy,t.Uy=this.Uy,t.Tn=this.Tn,t.Ok.it(this.Ok),t.Oq=this.Oq,t.Is=this.Is,t.Zk=this.Zk,t.of=this.of,t.Mj=this.Mj,t.Nj=this.Nj,t.Bi=this.Bi,t.zv=this.zv},zo.prototype.toString=function(){return 22<this.le.length?'TextBlock("'+this.le.substring(0,20)+'"...)':'TextBlock("'+this.le+'")'};var rf;zo.None=rf=xh.p(zo,"None",0);var sf;zo.WrapFit=sf=xh.p(zo,"WrapFit",1);var af;zo.WrapDesiredSize=af=xh.p(zo,"WrapDesiredSize",2);var hf;zo.OverflowClip=hf=xh.p(zo,"OverflowClip",0);var lf;zo.OverflowEllipsis=lf=xh.p(zo,"OverflowEllipsis",1),zo.prototype.Q=function(){Mn.prototype.Q.call(this),this.Uy=this.Vy=null},xh.defineProperty(zo,{font:"font"},function(){return this.Kg},function(t){var i=this.Kg;i!==t&&(this.Kg=t,this.Tn=null,this.Q(),this.h("font",i,t))}),zo.isValidFont=function(t){var i=of.font;if(t===i||"10px sans-serif"===t)return!0;of.font="10px sans-serif";var e;of.font=t;var n=of.font;return"10px sans-serif"!==n?(of.font=i,!0):(of.font="19px serif",e=of.font,of.font=t,n=of.font,of.font=i,n!==e)},xh.defineProperty(zo,{text:"text"},function(){return this.le},function(t){var i=this.le;i!==(t=null!==t&&void 0!==t?t.toString():"")&&(this.le=t,this.Q(),this.h("text",i,t))}),xh.defineProperty(zo,{textAlign:"textAlign"},function(){return this.zd},function(t){var i=this.zd;i!==t&&("start"===t||"end"===t||"left"===t||"right"===t||"center"===t?(this.zd=t,this.qa(),this.h("textAlign",i,t)):xh.wa(t,'"start", "end", "left", "right", or "center"',zo,"textAlign"))}),xh.u(zo,{Ia:"naturalBounds"},function(){if(!this.Qc.K()){var t=qo(this,this.le,this.Ok,999999).width,i=Go(this,t,this.Ok),e=this.ya;isNaN(e.width)||(t=e.width),isNaN(e.height)||(i=e.height),P(this.Qc,t,i)}return this.Qc}),xh.defineProperty(zo,{gx:"isMultiline"},function(){return this.dr},function(t){var i=this.dr;i!==t&&(this.dr=t,this.Q(),this.h("isMultiline",i,t))}),xh.defineProperty(zo,{NK:"isUnderline"},function(){return this.fm},function(t){var i=this.fm;i!==t&&(this.fm=t,this.qa(),this.h("isUnderline",i,t))}),xh.defineProperty(zo,{LK:"isStrikethrough"},function(){return this.em},function(t){var i=this.em;i!==t&&(this.em=t,this.qa(),this.h("isStrikethrough",i,t))}),xh.defineProperty(zo,{UF:"wrap"},function(){return this.Fm},function(t){var i=this.Fm;i!==t&&(this.Fm=t,this.Q(),this.h("wrap",i,t))}),xh.defineProperty(zo,{overflow:"overflow"},function(){return this.Xk},function(t){var i=this.Xk;i!==t&&(this.Xk=t,this.Q(),this.h("overflow",i,t))}),xh.defineProperty(zo,{stroke:"stroke"},function(){return this.Dc},function(t){var i=this.Dc;i!==t&&(t instanceof kn&&t.freeze(),this.Dc=t,this.qa(),this.h("stroke",i,t))}),xh.u(zo,{qI:"lineCount"},function(){return this.Fe}),xh.defineProperty(zo,{Lz:"editable"},function(){return this.Oq},function(t){var i=this.Oq;i!==t&&(this.Oq=t,this.h("editable",i,t))}),xh.defineProperty(zo,{DF:"textEditor"},function(){return this.Is},function(t){var i=this.Is;i!==t&&(t instanceof HTMLElement||xh.k("textEditor must be an HTMLElement, not: "+t),this.Is=t,this.h("textEditor",i,t))}),xh.defineProperty(zo,{Mz:"errorFunction"},function(){return this.of},function(t){var i=this.of;i!==t&&(null!==t&&xh.j(t,"function",zo,"errorFunction"),this.of=t,this.h("errorFunction",i,t))}),zo.prototype.ak=function(t,i){if(null!==this.Dc&&0!==this.le.length&&null!==this.Kg){var e=this.Ia.width,n=Io(this);t.textAlign=this.zd,qn(this,t,this.Dc,!0,!1),(this.fm||this.em)&&qn(this,t,this.Dc,!1,!1);var o=this.Ok,r=0,s=!1,a=xh.Ob(0,0);this.Xg.xb(a);l=xh.Ob(0,n);this.Xg.xb(l);h=a.$j(l);xh.v(a),xh.v(l),8>h*(a=i.scale)*a&&(s=!0),i.zh!==t&&(s=!1),!1===i.ek("textGreeking")&&(s=!1);for(var h=this.Mj,a=this.Nj,l=this.Fe,u=0;u<l;u++){var f=o.mf[u],c=o.De[u];f>e&&(f=e);var p=c,c=t,d=r=r+h,y=e,v=n,g=0;s?("start"===this.zd||"left"===this.zd?g=0:"end"===this.zd||"right"===this.zd?g=y-f:"center"===this.zd?g=(y-f)/2:xh.k("textAlign must be start, end, left, right, or center: "+this.zd),c.fillRect(0+g,d+.25*v,f,1)):("start"===this.zd||"left"===this.zd?g=0:"end"===this.zd||"right"===this.zd?g=y:"center"===this.zd?g=y/2:xh.k("textAlign must be start, end, left, right, or center: "+this.zd),c.fillText(p,0+g,d+v-.25*v),0===(p=v/20|0)&&(p=1),"end"===this.zd||"right"===this.zd?g-=f:"center"===this.zd&&(g-=f/2),this.fm&&(c.beginPath(),c.lineWidth=p,c.moveTo(0+g,d+v-.2*v),c.lineTo(0+g+f,d+v-.2*v),c.stroke()),this.em&&(c.beginPath(),c.lineWidth=p,d=d+v-v/2.2|0,0!=p%2&&(d+=.5),c.moveTo(0+g,d),c.lineTo(0+g+f,d),c.stroke())),r+=n+a}}},zo.prototype.vp=function(t,i,e,n){this.zv=t;var o=this.Ok;o.reset();var r=0,s=0;if(isNaN(this.ya.width)){if(0===(r=this.le.replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length)r=0;else if(this.gx){for(var a=s=0,h=!1;!h;){var l=r.indexOf("\n",a);-1===l&&(l=r.length,h=!0),(a=Eo(r.substr(a,l-a).replace(/^\s+|\s+$/g,""),this.Kg))>s&&(s=a),a=l+1}r=s}else 0<=(s=r.indexOf("\n",0))&&(r=r.substr(0,s)),r=a=Eo(r,this.Kg);r=Math.min(r,t/this.scale),r=Math.max(8,r)}else r=this.ya.width;if(null!==this.T&&(r=Math.min(r,this.T.yf.width),r=Math.max(r,this.T.gh.width)),s=Go(this,r,o),l=s=isNaN(this.ya.height)?Math.min(s,i/this.scale):this.ya.height,0!==o.Ve&&1!==o.De.length&&this.Xk===lf&&(i=this.Kg,h=this.Xk===lf?Ro(i):0,a=this.Mj+this.Nj,a=Math.max(0,Io(this)+a),!((l=Math.min(this.yI-1,Math.max(Math.floor(l/a+.01)-1,0)))+1>=o.De.length))){for(a=o.De[l],t=Math.max(1,t-h);Eo(a,i)>t&&1<a.length;)a=a.substr(0,a.length-1);t=Eo(a+=ef,i),o.De[l]=a,o.De=o.De.slice(0,l+1),o.mf[l]=t,o.mf=o.mf.slice(0,l+1),o.Qi=o.De.length,o.Ve=Math.max(o.Ve,t),this.Fe=o.Qi}(this.UF===sf||isNaN(this.ya.width))&&(r=o.Ve,isNaN(this.ya.width)&&(r=Math.max(8,r))),r=Math.max(e,r),s=Math.max(n,s),P(this.Qc,r,s),Nn(this,0,0,r,s)},zo.prototype.Ri=function(t,i,e,n){Ln(this,t,i,e,n)},xh.defineProperty(zo,{RA:"textValidation"},function(){return this.Zk},function(t){var i=this.Zk;i!==t&&(null!==t&&xh.j(t,"function",zo,"textValidation"),this.Zk=t,this.h("textValidation",i,t))}),xh.defineProperty(zo,{xL:"spacingAbove"},function(){return this.Mj},function(t){var i=this.Mj;i!==t&&(this.Mj=t,this.h("spacingAbove",i,t))}),xh.defineProperty(zo,{yL:"spacingBelow"},function(){return this.Nj},function(t){var i=this.Nj;i!==t&&(this.Nj=t,this.h("spacingBelow",i,t))}),xh.defineProperty(zo,{yI:"maxLines"},function(){return this.Bi},function(t){var i=this.Bi;i!==t&&(0>=(t=Math.floor(t))&&xh.wa(t,"> 0",zo,"maxLines"),this.Bi=t,this.h("maxLines",i,t),this.Q())}),xh.u(zo,{$K:"metrics"},function(){return this.Ok}),Vo.prototype.reset=function(){this.Ve=this.Qi=0,this.mf=[],this.De=[]},Vo.prototype.it=function(t){this.Qi=t.Qi,this.Ve=t.Ve,this.mf=xh.il(t.mf),this.De=xh.il(t.De)},xh.u(Vo,{hK:"arrSize"},function(){return this.mf}),xh.u(Vo,{iK:"arrText"},function(){return this.De}),xh.u(Vo,{ZK:"maxLineWidth"},function(){return this.Ve}),xh.Ja(Ho,Mn),xh.ea("Picture",Ho),Ho.prototype.cloneProtected=function(t){Mn.prototype.cloneProtected.call(this,t),t.element=this.Te,t.Cs=this.Cs,t.Lj=this.Lj.S(),t.Vn=this.Vn,t.of=this.of,t.Oj=this.Oj,t.gv=this.gv,t.yo=this.yo};var uf,ff=new n,cf=0,pf=[];Ho.clearCache=uf=function(t){void 0===t&&(t=""),xh.j(t,"string",Ho,"clearCache:url"),""!==t?ff[t]&&(delete ff[t],cf--):(ff=new n,cf=0)},Ho.prototype.toString=function(){return"Picture("+this.source+")#"+xh.pd(this)},xh.defineProperty(Ho,{element:"element"},function(){return this.Te},function(t){var i=this.Te;i!==t&&(null===t||t instanceof HTMLImageElement||t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||xh.k("Picture.element must be an instance of Image, Canvas, or Video, not: "+t),this.My=t instanceof HTMLCanvasElement,this.Te=t,null!==t&&(!0===t.complete||void 0===t.complete?(t.lv instanceof Event&&null!==this.of&&this.of(this,t.lv),!0===t.Oy&&null!==this.Oj&&this.Oj(this,null),t.Oy=!0,this.ya.K()||(Wn(this,!1),this.Q())):t.dC||(t.addEventListener("load",function(i){Uo(t,i)}),t.addEventListener("error",function(i){Jo(t,i)}),t.dC=!0)),this.h("element",i,t),this.qa())}),xh.defineProperty(Ho,{source:"source"},function(){return this.Cs},function(t){var i=this.Cs;if(i!==t){xh.j(t,"string",Ho,"source"),this.Cs=t;var e=ff,n=this.g;if(void 0!==e[t])var o=e[t].Qo[0].source;else{30<cf&&(uf(),e=ff),(o=xh.createElement("img")).addEventListener("load",function(t){Uo(o,t)}),o.addEventListener("error",function(t){Jo(o,t)}),o.dC=!0,o.src=t;var r=this.yo;null!==r&&(o.crossOrigin=r(this)),e[t]=new function(t){this.Qo=[new Wo(t,1)]}(o),cf++}null!==n&&Ie(n,this),this.element=o,null!==n&&Be(n,this),this.Q(),this.qa(),this.h("source",i,t)}}),xh.defineProperty(Ho,{wL:"sourceCrossOrigin"},function(){return this.yo},function(t){if(this.yo!==t&&(null!==t&&xh.j(t,"function",Ho,"sourceCrossOrigin"),this.yo=t,null!==this.element)){var i=this.element.src;null===t&&"string"==typeof i?this.element.crossOrigin=null:null!==t&&(this.element.crossOrigin=t(this))}}),xh.defineProperty(Ho,{ej:"sourceRect"},function(){return this.Lj},function(t){var i=this.Lj;i.L(t)||(xh.A(t,M,Ho,"sourceRect"),this.Lj=t=t.S(),this.qa(),this.h("sourceRect",i,t))}),xh.defineProperty(Ho,{VH:"imageStretch"},function(){return this.Vn},function(t){var i=this.Vn;i!==t&&(xh.rb(t,Mn,Ho,"imageStretch"),this.Vn=t,this.qa(),this.h("imageStretch",i,t))}),xh.defineProperty(Ho,{Mz:"errorFunction"},function(){return this.of},function(t){var i=this.of;i!==t&&(null!==t&&xh.j(t,"function",Ho,"errorFunction"),this.of=t,this.h("errorFunction",i,t))}),xh.defineProperty(Ho,{GL:"successFunction"},function(){return this.Oj},function(t){var i=this.Oj;i!==t&&(null!==t&&xh.j(t,"function",Ho,"successFunction"),this.Oj=t,this.h("successFunction",i,t))}),Ho.prototype.ak=function(t,i){var e=this.Te;if(null!==e){if(null!==(n=e.src)&&""!==n||xh.k('Element has no source ("src") attribute: '+e),!(e.lv instanceof Event)&&!0===e.Oy){var n=this.Ia,o=0,r=0,s=(a=this.My)?+e.width:e.naturalWidth,a=a?+e.height:e.naturalHeight;if(void 0===s&&e.videoWidth&&(s=e.videoWidth),void 0===a&&e.videoHeight&&(a=e.videoHeight),s=s||n.width,a=a||n.height,0!==s&&0!==a){var h=s,l=a;this.ej.K()&&(o=this.Lj.x,r=this.Lj.y,s=this.Lj.width,a=this.Lj.height);var u=s,f=a;switch(d=this.Vn){case Su:if(this.ej.K())break;o+=Math.max((u-n.width)/2,0),r+=Math.max((f-n.height)/2,0),s=Math.min(n.width,u),a=Math.min(n.height,f);break;case Lu:u=n.width,f=n.height;break;case Du:case Au:c=0;d===Du?(c=Math.min(n.height/f,n.width/u),u*=c,f*=c):d===Au&&(c=Math.max(n.height/f,n.width/u),u*=c,f*=c,o+=(u-n.width)/2,r+=(f-n.height)/2,s*=1/(u/n.width),a*=1/(f/n.height),u=n.width,f=n.height)}var c,p=s*a/(u*(d=this.Yi()*i.scale)*f*d),d=null;if(void 0!==(c=ff[this.source])&&16<p){2>c.Qo.length&&(Yo(c,4,h,l),Yo(c,16,h,l));for(var l=(h=c.Qo).length,d=h[0],y=0;y<l&&h[y].Fp*h[y].Fp<p;y++)d=h[y]}if(!i.On){if(null===this.Ho)if(null===this.Te)this.Ho=!1;else{(h=xh.createElement("canvas").getContext("2d")).drawImage(this.Te,0,0);try{h.getImageData(0,0,1,1).data[3]&&(this.Ho=!1),this.Ho=!1}catch(t){this.Ho=!0}}if(this.Ho)return}if(i.ek("pictureRatioOptimization")&&!i.Ny&&void 0!==c&&null!==d&&1!==d.Fp){t.save(),c=d.Fp;try{t.drawImage(d.source,o/c,r/c,Math.min(d.source.width,s/c),Math.min(d.source.height,a/c),Math.max((n.width-u)/2,0),Math.max((n.height-f)/2,0),Math.min(n.width,u),Math.min(n.height,f))}catch(t){this.gv=!1}t.restore()}else try{t.drawImage(e,o,r,s,a,Math.max((n.width-u)/2,0),Math.max((n.height-f)/2,0),Math.min(n.width,u),Math.min(n.height,f))}catch(t){this.gv=!1}}}}},xh.u(Ho,{Ia:"naturalBounds"},function(){return this.Qc}),Ho.prototype.vp=function(t,i,e,n){var o=this.ya,r=Rn(this,!0),s=this.Te,a=this.My;(a||!this.Ty&&s&&s.complete)&&(this.Ty=!0),null===s&&(isFinite(t)||(t=0),isFinite(i)||(i=0)),isFinite(o.width)||r===Lu||r===ju?(isFinite(t)||(t=this.ej.K()?this.ej.width:a?+s.width:s.naturalWidth),e=0):null!==s&&!1!==this.Ty&&(t=this.ej.K()?this.ej.width:a?+s.width:s.naturalWidth),isFinite(o.height)||r===Lu||r===Cu?(isFinite(i)||(i=this.ej.K()?this.ej.height:a?+s.height:s.naturalHeight),n=0):null!==s&&!1!==this.Ty&&(i=this.ej.K()?this.ej.height:a?+s.height:s.naturalHeight),isFinite(o.width)&&(t=o.width),isFinite(o.height)&&(i=o.height),o=this.yf,r=this.gh,e=Math.max(e,r.width),n=Math.max(n,r.height),t=Math.min(o.width,t),i=Math.min(o.height,i),t=Math.max(e,t),i=Math.max(n,i),null===s||s.complete||(isFinite(t)||(t=0),isFinite(i)||(i=0)),P(this.Qc,t,i),Nn(this,0,0,t,i)},Ho.prototype.Ri=function(t,i,e,n){Ln(this,t,i,e,n)},(mh=Xo.prototype).reset=function(){this.o=new K,this.Tb=null},mh.$a=function(t){null===this.o&&xh.k("StreamGeometryContext has been closed"),null===this.Tb&&xh.k("Need to call beginFigure first"),this.Tb.El=t},mh.moveTo=function(t,i,e){void 0===e&&(e=!1),null===this.o&&xh.k("StreamGeometryContext has been closed"),null===this.Tb&&xh.k("Need to call beginFigure first");var n=new Z(yl);n.I=t,n.J=i,e&&n.close(),this.Tb.vb.add(n)},mh.lineTo=function(t,i,e){void 0===e&&(e=!1),null===this.o&&xh.k("StreamGeometryContext has been closed"),null===this.Tb&&xh.k("Need to call beginFigure first");var n=new Z(vl);n.I=t,n.J=i,e&&n.close(),this.Tb.vb.add(n)},mh.arcTo=function(t,i,e,n,o,r,s){void 0===r&&(r=0),void 0===s&&(s=!1),null===this.o&&xh.k("StreamGeometryContext has been closed"),null===this.Tb&&xh.k("Need to call beginFigure first");var a=new Z(bl);a.xe=t,a.Bf=i,a.oa=e,a.va=n,a.radiusX=o,a.radiusY=0!==r?r:o,s&&a.close(),this.Tb.vb.add(a)},hl.makeGeometry=function(t,i,e){var n=(o=t.ya).width,o=o.height;return void 0!==i&&!isNaN(i)&&isFinite(i)&&(n=i),void 0!==e&&!isNaN(e)&&isFinite(e)&&(o=e),isFinite(n)||(n=100),isFinite(o)||(o=100),i=null,"None"!==t.Tp?i=hl.ij[t.Tp]:"None"!==t.Pz?i=hl.ij[t.Pz]:("string"==typeof(e=hl.wg[t.Cb])&&(e=hl.wg[e]),void 0===e&&xh.k("Unknown Shape.figure: "+t.Cb),i=e(t,n,o),i.$n=n,i.Yn=o),null===i&&"function"==typeof(e=hl.wg.Rectangle)&&(i=e(t,n,o)),i},hl.Ti=function(t,i,e,n,o,r,s,a,h,l,u,f,c,p){var d=1-h;t=t*d+e*h,i=i*d+n*h,e=e*d+o*h,n=n*d+r*h,o=o*d+s*h,r=r*d+a*h,a=t*d+e*h,s=i*d+n*h,e=e*d+o*h,n=n*d+r*h,l.x=t,l.y=i,u.x=a,u.y=s,f.x=a*d+e*h,f.y=s*d+n*h,c.x=e,c.y=n,p.x=o,p.y=r},hl.Yo=function(t){t=hl.Sm(t);var i=xh.lb();i[0]=t[0];for(var e=1,n=1;n<t.length;)i[e]=t[n],i[e+1]=t[n],i[e+2]=t[n+1],n+=2,e+=3;return xh.ta(t),i},hl.Sm=function(t){var i=hl.jl(t),e=xh.lb(),n=Math.floor(i.length/2),o=i.length-1;t=0==t%2?2:1;for(var r=0;r<o;r++){var s=i[r],a=i[r+1],h=i[(n+r-1)%o],l=i[(n+r+t)%o];e[2*r]=s,e[2*r+1]=hl.wl(s.x,s.y,h.x,h.y,a.x,a.y,l.x,l.y,new b)}return e[e.length]=e[0],xh.ta(i),e},hl.wl=function(t,i,e,n,o,r,s,a,h){var l=o-s,u=s=0;return 0===(e=t-e)||0===l?0===e?(a=(r-a)/l,s=t,u=a*s+(r-a*o)):(n=(i-n)/e,s=o,u=n*s+(i-n*t)):(n=(i-n)/e,a=(r-a)/l,t=i-n*t,s=(r-a*o-t)/(n-a),u=n*s+t),h.m(s,u),h},hl.jl=function(t){for(var i=xh.lb(),e=1.5*Math.PI,n=0,o=0;o<t;o++)n=2*Math.PI/t*o+e,i[o]=new b(.5+.5*Math.cos(n),.5+.5*Math.sin(n));return i.push(i[0]),i},hl.dB=new D(.156,.156).Fa(),hl.eB=new D(.844,.844).Fa(),hl.wg={None:"Rectangle",Rectangle:function(t,i,e){return t=new K,t.type=ul,t.za=0,t.xa=0,t.I=i,t.J=e,t},Square:function(t,i,e){return t=new K,t.Md=Du,t.type=ul,t.za=0,t.xa=0,t.I=Math.min(i,e),t.J=Math.min(i,e),t},Ellipse:function(t,i,e){return t=new K,t.type=fl,t.za=0,t.xa=0,t.I=i,t.J=e,t.B=hl.dB,t.C=hl.eB,t},Circle:function(t,i,e){return t=new K,t.Md=Du,t.type=fl,t.za=0,t.xa=0,t.I=Math.min(i,e),t.J=Math.min(i,e),t.B=hl.dB,t.C=hl.eB,t},Connector:"Ellipse",TriangleRight:function(t,i,e){t=new K;var n=new Q,o=new Z;return o.I=i,o.J=.5*e,n.vb.add(o),i=new Z,i.I=0,i.J=e,n.vb.add(i.close()),t.Wb.add(n),t.B=new D(0,.25),t.C=new D(.5,.75),t},TriangleDown:function(t,i,e){t=new K;var n=new Q,o=new Z;return o.I=i,o.J=0,n.vb.add(o),o=new Z,o.I=.5*i,o.J=e,n.vb.add(o.close()),t.Wb.add(n),t.B=new D(.25,0),t.C=new D(.75,.5),t},TriangleLeft:function(t,i,e){t=new K;var n=new Q;n.za=i,n.xa=e;var o=new Z;return o.I=0,o.J=.5*e,n.vb.add(o),e=new Z,e.I=i,e.J=0,n.vb.add(e.close()),t.Wb.add(n),t.B=new D(.5,.25),t.C=new D(1,.75),t},TriangleUp:function(t,i,e){t=new K;var n=new Q;n.za=i,n.xa=e;var o=new Z;return o.I=0,o.J=e,n.vb.add(o),e=new Z,e.I=.5*i,e.J=0,n.vb.add(e.close()),t.Wb.add(n),t.B=new D(.25,.5),t.C=new D(.75,1),t},Line1:function(t,i,e){return t=new K,t.type=ll,t.za=0,t.xa=0,t.I=i,t.J=e,t},Line2:function(t,i,e){return t=new K,t.type=ll,t.za=i,t.xa=0,t.I=0,t.J=e,t},MinusLine:"LineH",LineH:function(t,i,e){return t=new K,t.type=ll,t.za=0,t.xa=e/2,t.I=i,t.J=e/2,t},LineV:function(t,i,e){return t=new K,t.type=ll,t.za=i/2,t.xa=0,t.I=i/2,t.J=e,t},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(t,i,e){var n=hl.Da;return t=xh.q(),Qo(t,0,0,!1),$o(t,n*i,0,1*i,(1-n)*e,i,e),i=t.o,xh.s(t),i},Curve2:function(t,i,e){var n=hl.Da;return t=xh.q(),Qo(t,0,0,!1),$o(t,0,n*e,(1-n)*i,e,i,e),i=t.o,xh.s(t),i},Curve3:function(t,i,e){var n=hl.Da;return t=xh.q(),Qo(t,1*i,0,!1),$o(t,1*i,n*e,n*i,1*e,0,1*e),i=t.o,xh.s(t),i},Curve4:function(t,i,e){var n=hl.Da;return t=xh.q(),Qo(t,1*i,0,!1),$o(t,(1-n)*i,0,0,(1-n)*e,0,1*e),i=t.o,xh.s(t),i},Alternative:"Triangle",Merge:"Triangle",Triangle:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0*e,!0),t.lineTo(0*i,1*e),t.lineTo(1*i,1*e,!0),i=t.o,i.B=new D(.25,.5),i.C=new D(.75,1),xh.s(t),i},Decision:"Diamond",Diamond:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(0,.5*e),t.lineTo(.5*i,1*e),t.lineTo(1*i,.5*e,!0),i=t.o,i.B=new D(.25,.25),i.C=new D(.75,.75),xh.s(t),i},Pentagon:function(t,i,e){var n=hl.jl(5);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;5>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.2,.22),i.C=new D(.8,.9),xh.s(t),i},DataTransmission:"Hexagon",Hexagon:function(t,i,e){var n=hl.jl(6);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;6>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.07,.25),i.C=new D(.93,.75),xh.s(t),i},Heptagon:function(t,i,e){var n=hl.jl(7);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;7>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.2,.15),i.C=new D(.8,.85),xh.s(t),i},Octagon:function(t,i,e){var n=hl.jl(8);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;8>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.15,.15),i.C=new D(.85,.85),xh.s(t),i},Nonagon:function(t,i,e){var n=hl.jl(9);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;9>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.17,.13),i.C=new D(.82,.82),xh.s(t),i},Decagon:function(t,i,e){var n=hl.jl(10);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;10>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.16,.16),i.C=new D(.84,.84),xh.s(t),i},Dodecagon:function(t,i,e){var n=hl.jl(12);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;12>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.16,.16),i.C=new D(.84,.84),xh.s(t),i},FivePointedStar:function(t,i,e){var n=hl.Sm(5);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;10>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.312,.383),i.C=new D(.693,.765),xh.s(t),i},SixPointedStar:function(t,i,e){var n=hl.Sm(6);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;12>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.17,.251),i.C=new D(.833,.755),xh.s(t),i},SevenPointedStar:function(t,i,e){var n=hl.Sm(7);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;14>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.363,.361),i.C=new D(.641,.709),xh.s(t),i},EightPointedStar:function(t,i,e){var n=hl.Sm(8);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;16>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.252,.255),i.C=new D(.75,.75),xh.s(t),i},NinePointedStar:function(t,i,e){var n=hl.Sm(9);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;18>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.355,.361),i.C=new D(.645,.651),xh.s(t),i},TenPointedStar:function(t,i,e){var n=hl.Sm(10);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;20>o;o++)t.lineTo(n[o].x*i,n[o].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.281,.261),i.C=new D(.723,.748),xh.s(t),i},FivePointedBurst:function(t,i,e){var n=hl.Yo(5);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.312,.383),i.C=new D(.693,.765),xh.s(t),i},SixPointedBurst:function(t,i,e){var n=hl.Yo(6);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.17,.251),i.C=new D(.833,.755),xh.s(t),i},SevenPointedBurst:function(t,i,e){var n=hl.Yo(7);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.363,.361),i.C=new D(.641,.709),xh.s(t),i},EightPointedBurst:function(t,i,e){var n=hl.Yo(8);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.252,.255),i.C=new D(.75,.75),xh.s(t),i},NinePointedBurst:function(t,i,e){var n=hl.Yo(9);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.355,.361),i.C=new D(.645,.651),xh.s(t),i},TenPointedBurst:function(t,i,e){var n=hl.Yo(10);Qo(t=xh.q(),n[0].x*i,n[0].y*e,!0);for(var o=1;o<n.length;o+=3)$o(t,n[o].x*i,n[o].y*e,n[o+1].x*i,n[o+1].y*e,n[o+2].x*i,n[o+2].y*e);return xh.ta(n),Zo(t),i=t.o,i.B=new D(.281,.261),i.C=new D(.723,.748),xh.s(t),i},Cloud:function(t,i,e){return t=xh.q(),Qo(t,.08034461*i,.1944299*e,!0),$o(t,-.09239631*i,.07836421*e,.1406031*i,-.0542823*e,.2008615*i,.05349299*e),$o(t,.2450511*i,-.00697547*e,.3776197*i,-.01112067*e,.4338609*i,.074219*e),$o(t,.4539471*i,0,.6066018*i,-.02526587*e,.6558228*i,.07004196*e),$o(t,.6914277*i,-.01904177*e,.8921095*i,-.01220843*e,.8921095*i,.08370865*e),$o(t,1.036446*i,.04105738*e,1.020377*i,.3022052*e,.9147671*i,.3194596*e),$o(t,1.04448*i,.360238*e,.992256*i,.5219009*e,.9082935*i,.562044*e),$o(t,1.032337*i,.5771781*e,1.018411*i,.8120651*e,.9212406*i,.8217117*e),$o(t,1.028411*i,.9571472*e,.8556702*i,1.052487*e,.7592566*i,.9156953*e),$o(t,.7431877*i,1.009325*e,.5624123*i,1.021761*e,.5101666*i,.9310455*e),$o(t,.4820677*i,1.031761*e,.3030112*i,1.002796*e,.2609328*i,.9344623*e),$o(t,.2329994*i,1.01518*e,.03213784*i,1.01518*e,.08034461*i,.870098*e),$o(t,-.02812061*i,.9032597*e,-.01205169*i,.6835638*e,.06829292*i,.6545475*e),$o(t,-.01812061*i,.6089503*e,-.00606892*i,.4555777*e,.06427569*i,.4265613*e),$o(t,-.01606892*i,.3892545*e,-.01205169*i,.1944299*e,.08034461*i,.1944299*e),Zo(t),i=t.o,i.B=new D(.1,.1),i.C=new D(.9,.9),xh.s(t),i},Gate:"Crescent",Crescent:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),$o(t,1*i,0,1*i,1*e,0,1*e),$o(t,.5*i,.75*e,.5*i,.25*e,0,0),Zo(t),i=t.o,i.B=new D(.511,.19),i.C=new D(.776,.76),xh.s(t),i},FramedRectangle:function(t,i,e){var n=xh.q(),o=t?t.Ac:NaN;return t=t?t.Xt:NaN,isNaN(o)&&(o=.1),isNaN(t)&&(t=.1),Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e,!0),Qo(n,o*i,t*e,!1,!0),n.lineTo(o*i,(1-t)*e),n.lineTo((1-o)*i,(1-t)*e),n.lineTo((1-o)*i,t*e,!0),i=n.o,i.B=new D(o,t),i.C=new D(1-o,1-t),xh.s(n),i},Delay:"HalfEllipse",HalfEllipse:function(t,i,e){var n=hl.Da;return t=xh.q(),Qo(t,0,0,!0),$o(t,n*i,0,1*i,(.5-n/2)*e,1*i,.5*e),$o(t,1*i,(.5+n/2)*e,n*i,1*e,0,1*e),Zo(t),i=t.o,i.B=new D(0,.2),i.C=new D(.75,.8),xh.s(t),i},Heart:function(t,i,e){return t=xh.q(),Qo(t,.5*i,1*e,!0),$o(t,.1*i,.8*e,0,.5*e,0*i,.3*e),$o(t,0*i,0,.45*i,0,.5*i,.3*e),$o(t,.55*i,0,1*i,0,1*i,.3*e),$o(t,i,.5*e,.9*i,.8*e,.5*i,1*e),Zo(t),i=t.o,i.B=new D(.15,.29),i.C=new D(.86,.68),xh.s(t),i},Spade:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(.51*i,.01*e),$o(t,.6*i,.2*e,i,.25*e,i,.5*e),$o(t,i,.8*e,.6*i,.8*e,.55*i,.7*e),$o(t,.5*i,.75*e,.55*i,.95*e,.75*i,e),t.lineTo(.25*i,e),$o(t,.45*i,.95*e,.5*i,.75*e,.45*i,.7*e),$o(t,.4*i,.8*e,0,.8*e,0,.5*e),$o(t,0,.25*e,.4*i,.2*e,.49*i,.01*e),Zo(t),i=t.o,i.B=new D(.19,.26),i.C=new D(.8,.68),xh.s(t),i},Club:function(t,i,e){Qo(t=xh.q(),.4*i,.6*e,!0),$o(t,.5*i,.75*e,.45*i,.95*e,.15*i,1*e),t.lineTo(.85*i,e),$o(t,.55*i,.95*e,.5*i,.75*e,.6*i,.6*e);var n=.2,o=.3,r=0,s=4*(Math.SQRT2-1)/3*n;return $o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o+.05)*i,(.5-s+r-.02)*e,.65*i,.36771243*e),n=.2,o=0,r=-.3,s=4*(Math.SQRT2-1)/3*n,$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,.35*i,.36771243*e),n=.2,o=-.3,r=0,s=4*(Math.SQRT2-1)/3*n,$o(t,(.5+n+o-.05)*i,(.5-s+r-.02)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,.4*i,.6*e),Zo(t),i=t.o,i.B=new D(.06,.39),i.C=new D(.93,.58),xh.s(t),i},Ring:function(t,i,e){t=xh.q();var n=4*(Math.SQRT2-1)/3*.5;return Qo(t,i,.5*e,!0),$o(t,i,(.5-n)*e,(.5+n)*i,0,.5*i,0),$o(t,(.5-n)*i,0,0,(.5-n)*e,0,.5*e),$o(t,0,(.5+n)*e,(.5-n)*i,e,.5*i,e),$o(t,(.5+n)*i,e,i,(.5+n)*e,i,.5*e),n=4*(Math.SQRT2-1)/3*.4,Qo(t,.5*i,.1*e,!0,!0),$o(t,(.5+n)*i,.1*e,.9*i,(.5-n)*e,.9*i,.5*e),$o(t,.9*i,(.5+n)*e,(.5+n)*i,.9*e,.5*i,.9*e),$o(t,(.5-n)*i,.9*e,.1*i,(.5+n)*e,.1*i,.5*e),$o(t,.1*i,(.5-n)*e,(.5-n)*i,.1*e,.5*i,.1*e),i=t.o,i.B=new D(.146,.146),i.C=new D(.853,.853),i.Md=Du,xh.s(t),i},YinYang:function(t,i,e){n=.5;n=.5,Qo(t=xh.q(),.5*i,0,!0),t.arcTo(270,180,.5*i,.5*i,.5*i),$o(t,1*i,n*e,0,n*e,n*i,0,!0);var n,o=.25;return Qo(t,(.5+(n=.1))*i,o*e,!0,!0),t.arcTo(0,-360,.5*i,e*o,n*i),Zo(t),Qo(t,.5*i,0,!1),t.arcTo(270,-180,.5*i,.5*i,.5*i),t.$a(!1),o=.75,Qo(t,(.5+n)*i,o*e,!0),t.arcTo(0,360,.5*i,e*o,n*i),Zo(t),i=t.o,i.Md=Du,xh.s(t),i},Peace:function(t,i,e){t=xh.q();n=4*(Math.SQRT2-1)/3*.5;Qo(t,i,.5*e,!0),$o(t,i,(.5-n)*e,(.5+n)*i,0,.5*i,0),$o(t,(.5-n)*i,0,0,(.5-n)*e,0,.5*e),$o(t,0,(.5+n)*e,(.5-n)*i,e,.5*i,e),$o(t,(.5+n)*i,e,i,(.5+n)*e,i,.5*e),n=4*(Math.SQRT2-1)/3*.4,Qo(t,.5*i,.1*e,!0,!0),$o(t,(.5+n)*i,.1*e,.9*i,(.5-n)*e,.9*i,.5*e),$o(t,.9*i,(.5+n)*e,(.5+n)*i,.9*e,.5*i,.9*e),$o(t,(.5-n)*i,.9*e,.1*i,(.5+n)*e,.1*i,.5*e),$o(t,.1*i,(.5-n)*e,(.5-n)*i,.1*e,.5*i,.1*e);var n=.07,o=0,r=.11*-.707,s=4*(Math.SQRT2-1)/3*n;return Qo(t,(.5+n+o)*i,(.5+r)*e,!0),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),n=.07,o=.11*-.707,r=.707*.11,s=4*(Math.SQRT2-1)/3*n,Qo(t,(.5+n+o)*i,(.5+r)*e,!0),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),n=.07,o=.707*.11,r=.707*.11,s=4*(Math.SQRT2-1)/3*n,Qo(t,(.5+n+o)*i,(.5+r)*e,!0),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),i=t.o,i.B=new D(.146,.146),i.C=new D(.853,.853),i.Md=Du,xh.s(t),i},NotAllowed:function(t,i,e){var n=.5*(r=hl.Da),o=.5;Qo(t=xh.q(),.5*i,(.5-o)*e,!0),$o(t,(.5-n)*i,(.5-o)*e,(.5-o)*i,(.5-n)*e,(.5-o)*i,.5*e),$o(t,(.5-o)*i,(.5+n)*e,(.5-n)*i,(.5+o)*e,.5*i,(.5+o)*e),$o(t,(.5+n)*i,(.5+o)*e,(.5+o)*i,(.5+n)*e,(.5+o)*i,.5*e),$o(t,(.5+o)*i,(.5-n)*e,(.5+n)*i,(.5-o)*e,.5*i,(.5-o)*e);var o=.4,n=.4*r,r=xh.M(),s=xh.M(),a=xh.M(),h=xh.M();hl.Ti(.5,.5-o,.5+n,.5-o,.5+o,.5-n,.5+o,.5,.42,r,s,a,h,h);var l=xh.M(),u=xh.M(),f=xh.M();hl.Ti(.5,.5-o,.5+n,.5-o,.5+o,.5-n,.5+o,.5,.58,h,h,f,l,u);var c=xh.M(),p=xh.M(),d=xh.M();hl.Ti(.5,.5+o,.5-n,.5+o,.5-o,.5+n,.5-o,.5,.42,c,p,d,h,h);var y=xh.M(),v=xh.M(),g=xh.M();return hl.Ti(.5,.5+o,.5-n,.5+o,.5-o,.5+n,.5-o,.5,.58,h,h,g,y,v),Qo(t,g.x*i,g.y*e,!0,!0),$o(t,y.x*i,y.y*e,v.x*i,v.y*e,(.5-o)*i,.5*e),$o(t,(.5-o)*i,(.5-n)*e,(.5-n)*i,(.5-o)*e,.5*i,(.5-o)*e),$o(t,r.x*i,r.y*e,s.x*i,s.y*e,a.x*i,a.y*e),t.lineTo(g.x*i,g.y*e),Zo(t),Qo(t,d.x*i,d.y*e,!0,!0),t.lineTo(f.x*i,f.y*e),$o(t,l.x*i,l.y*e,u.x*i,u.y*e,(.5+o)*i,.5*e),$o(t,(.5+o)*i,(.5+n)*e,(.5+n)*i,(.5+o)*e,.5*i,(.5+o)*e),$o(t,c.x*i,c.y*e,p.x*i,p.y*e,d.x*i,d.y*e),Zo(t),xh.v(r),xh.v(s),xh.v(a),xh.v(h),xh.v(l),xh.v(u),xh.v(f),xh.v(c),xh.v(p),xh.v(d),xh.v(y),xh.v(v),xh.v(g),i=t.o,xh.s(t),i.Md=Du,i},Fragile:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.25*i,0),t.lineTo(.2*i,.15*e),t.lineTo(.3*i,.25*e),t.lineTo(.29*i,.33*e),t.lineTo(.35*i,.25*e),t.lineTo(.3*i,.15*e),t.lineTo(.4*i,0),t.lineTo(1*i,0),$o(t,1*i,.25*e,.75*i,.5*e,.55*i,.5*e),t.lineTo(.55*i,.9*e),t.lineTo(.7*i,.9*e),t.lineTo(.7*i,1*e),t.lineTo(.3*i,1*e),t.lineTo(.3*i,.9*e),t.lineTo(.45*i,.9*e),t.lineTo(.45*i,.5*e),$o(t,.25*i,.5*e,0,.25*e,0,0),Zo(t),i=t.o,i.B=new D(.25,0),i.C=new D(.75,.4),xh.s(t),i},HourGlass:function(t,i,e){return t=xh.q(),Qo(t,.65*i,.5*e,!0),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(.35*i,.5*e),t.lineTo(0,0),t.lineTo(1*i,0),Zo(t),i=t.o,xh.s(t),i},Lightning:function(t,i,e){return t=xh.q(),Qo(t,0*i,.55*e,!0),t.lineTo(.75*i,0),t.lineTo(.25*i,.45*e),t.lineTo(.9*i,.48*e),t.lineTo(.4*i,1*e),t.lineTo(.65*i,.55*e),Zo(t),i=t.o,xh.s(t),i},Parallelogram1:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=xh.q();return Qo(n,t*i,0,!0),n.lineTo(1*i,0),n.lineTo((1-t)*i,1*e),n.lineTo(0,1*e),Zo(n),i=n.o,i.B=new D(t,0),i.C=new D(1-t,1),xh.s(n),i},Input:"Output",Output:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!0),t.lineTo(.1*i,0),t.lineTo(1*i,0),t.lineTo(.9*i,1*e),Zo(t),i=t.o,i.B=new D(.1,0),i.C=new D(.9,1),xh.s(t),i},Parallelogram2:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.25);var n=xh.q();return Qo(n,t*i,0,!0),n.lineTo(1*i,0),n.lineTo((1-t)*i,1*e),n.lineTo(0,1*e),Zo(n),i=n.o,i.B=new D(t,0),i.C=new D(1-t,1),xh.s(n),i},ThickCross:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.25);var n=xh.q();return Qo(n,(.5-t/2)*i,0,!0),n.lineTo((.5+t/2)*i,0),n.lineTo((.5+t/2)*i,(.5-t/2)*e),n.lineTo(1*i,(.5-t/2)*e),n.lineTo(1*i,(.5+t/2)*e),n.lineTo((.5+t/2)*i,(.5+t/2)*e),n.lineTo((.5+t/2)*i,1*e),n.lineTo((.5-t/2)*i,1*e),n.lineTo((.5-t/2)*i,(.5+t/2)*e),n.lineTo(0,(.5+t/2)*e),n.lineTo(0,(.5-t/2)*e),n.lineTo((.5-t/2)*i,(.5-t/2)*e),Zo(n),i=n.o,i.B=new D(.5-t/2,.5-t/2),i.C=new D(.5+t/2,.5+t/2),xh.s(n),i},ThickX:function(t,i,e){t=.25/Math.SQRT2;var n=xh.q();return Qo(n,.3*i,0,!0),n.lineTo(.5*i,.2*e),n.lineTo(.7*i,0),n.lineTo(1*i,.3*e),n.lineTo(.8*i,.5*e),n.lineTo(1*i,.7*e),n.lineTo(.7*i,1*e),n.lineTo(.5*i,.8*e),n.lineTo(.3*i,1*e),n.lineTo(0,.7*e),n.lineTo(.2*i,.5*e),n.lineTo(0,.3*e),Zo(n),i=n.o,i.B=new D(.5-t,.5-t),i.C=new D(.5+t,.5+t),xh.s(n),i},ThinCross:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=.1),t=xh.q(),Qo(t,(.5-n/2)*i,0,!0),t.lineTo((.5+n/2)*i,0),t.lineTo((.5+n/2)*i,(.5-n/2)*e),t.lineTo(1*i,(.5-n/2)*e),t.lineTo(1*i,(.5+n/2)*e),t.lineTo((.5+n/2)*i,(.5+n/2)*e),t.lineTo((.5+n/2)*i,1*e),t.lineTo((.5-n/2)*i,1*e),t.lineTo((.5-n/2)*i,(.5+n/2)*e),t.lineTo(0,(.5+n/2)*e),t.lineTo(0,(.5-n/2)*e),t.lineTo((.5-n/2)*i,(.5-n/2)*e),Zo(t),i=t.o,xh.s(t),i},ThinX:function(t,i,e){return t=xh.q(),Qo(t,.1*i,0,!0),t.lineTo(.5*i,.4*e),t.lineTo(.9*i,0),t.lineTo(1*i,.1*e),t.lineTo(.6*i,.5*e),t.lineTo(1*i,.9*e),t.lineTo(.9*i,1*e),t.lineTo(.5*i,.6*e),t.lineTo(.1*i,1*e),t.lineTo(0,.9*e),t.lineTo(.4*i,.5*e),t.lineTo(0,.1*e),Zo(t),t.o},RightTriangle:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(1*i,1*e),t.lineTo(0,1*e),Zo(t),i=t.o,i.B=new D(0,.5),i.C=new D(.5,1),xh.s(t),i},RoundedIBeam:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(1*i,0),$o(t,.5*i,.25*e,.5*i,.75*e,1*i,1*e),t.lineTo(0,1*e),$o(t,.5*i,.75*e,.5*i,.25*e,0,0),Zo(t),i=t.o,xh.s(t),i},RoundedRectangle:function(t,i,e){var n=t?t.Ac:NaN;isNaN(n)&&(n=5),n=Math.min(n,i/3),t=(n=Math.min(n,e/3))*hl.Da;var o=xh.q();return Qo(o,n,0,!0),o.lineTo(i-n,0),$o(o,i-t,0,i,t,i,n),o.lineTo(i,e-n),$o(o,i,e-t,i-t,e,i-n,e),o.lineTo(n,e),$o(o,t,e,0,e-t,0,e-n),o.lineTo(0,n),$o(o,0,t,t,0,n,0),Zo(o),i=o.o,1<t?(i.B=new D(0,0,t,t),i.C=new D(1,1,-t,-t)):(i.B=Lh,i.C=Eh),xh.s(o),i},Border:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=5),n=Math.min(n,i/3),n=Math.min(n,e/3),t=xh.q(),Qo(t,n,0,!0),t.lineTo(i-n,0),$o(t,i-0,0,i,0,i,n),t.lineTo(i,e-n),$o(t,i,e-0,i-0,e,i-n,e),t.lineTo(n,e),$o(t,0,e,0,e-0,0,e-n),t.lineTo(0,n),$o(t,0,0,0,0,n,0),Zo(t),i=t.o,i.B=Lh,i.C=Eh,xh.s(t),i},SquareIBeam:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=.2),t=xh.q(),Qo(t,0,0,!0),t.lineTo(1*i,0),t.lineTo(1*i,n*e),t.lineTo((.5+n/2)*i,n*e),t.lineTo((.5+n/2)*i,(1-n)*e),t.lineTo(1*i,(1-n)*e),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(0,(1-n)*e),t.lineTo((.5-n/2)*i,(1-n)*e),t.lineTo((.5-n/2)*i,n*e),t.lineTo(0,n*e),Zo(t),i=t.o,xh.s(t),i},Trapezoid:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.2);var n=xh.q();return Qo(n,t*i,0,!0),n.lineTo((1-t)*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),i=n.o,i.B=new D(t,0),i.C=new D(1-t,1),xh.s(n),i},ManualLoop:"ManualOperation",ManualOperation:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=0),t=xh.q(),Qo(t,n,0,!0),t.lineTo(0,0),t.lineTo(1*i,0),t.lineTo(.9*i,1*e),t.lineTo(.1*i,1*e),Zo(t),i=t.o,i.B=new D(.1,0),i.C=new D(.9,1),xh.s(t),i},GenderMale:function(t,i,e){t=xh.q();var n=hl.Da,o=.4*n,r=.4,s=xh.M(),a=xh.M(),h=xh.M(),l=xh.M();Qo(t,(.5-r)*i,.5*e,!0),$o(t,(.5-r)*i,(.5-o)*e,(.5-o)*i,(.5-r)*e,.5*i,(.5-r)*e),hl.Ti(.5,.5-r,.5+o,.5-r,.5+r,.5-o,.5+r,.5,.44,h,l,a,s,s),$o(t,h.x*i,h.y*e,l.x*i,l.y*e,a.x*i,a.y*e);var u=xh.Ob(a.x,a.y);hl.Ti(.5,.5-r,.5+o,.5-r,.5+r,.5-o,.5+r,.5,.56,s,s,a,h,l);var f=xh.Ob(a.x,a.y);return t.lineTo((.1*u.x+.855)*i,.1*u.y*e),t.lineTo(.85*i,.1*u.y*e),t.lineTo(.85*i,0),t.lineTo(1*i,0),t.lineTo(1*i,.15*e),t.lineTo((.1*f.x+.9)*i,.15*e),t.lineTo((.1*f.x+.9)*i,(.1*f.y+.05*.9)*e),t.lineTo(f.x*i,f.y*e),$o(t,h.x*i,h.y*e,l.x*i,l.y*e,(.5+r)*i,.5*e),$o(t,(.5+r)*i,(.5+o)*e,(.5+o)*i,(.5+r)*e,.5*i,(.5+r)*e),$o(t,(.5-o)*i,(.5+r)*e,(.5-r)*i,(.5+o)*e,(.5-r)*i,.5*e),r=.35,o=.35*n,Qo(t,.5*i,(.5-r)*e,!0,!0),$o(t,(.5-o)*i,(.5-r)*e,(.5-r)*i,(.5-o)*e,(.5-r)*i,.5*e),$o(t,(.5-r)*i,(.5+o)*e,(.5-o)*i,(.5+r)*e,.5*i,(.5+r)*e),$o(t,(.5+o)*i,(.5+r)*e,(.5+r)*i,(.5+o)*e,(.5+r)*i,.5*e),$o(t,(.5+r)*i,(.5-o)*e,(.5+o)*i,(.5-r)*e,.5*i,(.5-r)*e),Qo(t,(.5-r)*i,.5*e,!0),xh.v(s),xh.v(a),xh.v(h),xh.v(l),xh.v(u),xh.v(f),i=t.o,i.B=new D(.202,.257),i.C=new D(.692,.839),i.Md=Du,xh.s(t),i},GenderFemale:function(t,i,e){t=xh.q();var n=.375,o=0,r=-.125,s=4*(Math.SQRT2-1)/3*n;return Qo(t,(.525+o)*i,(.5+n+r)*e,!0),$o(t,(.5+s+o)*i,(.5+n+r)*e,(.5+n+o)*i,(.5+s+r)*e,(.5+n+o)*i,(.5+r)*e),$o(t,(.5+n+o)*i,(.5-s+r)*e,(.5+s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5-s+o)*i,(.5-n+r)*e,(.5-n+o)*i,(.5-s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5+s+r)*e,(.5-s+o)*i,(.5+n+r)*e,(.475+o)*i,(.5+n+r)*e),t.lineTo(.475*i,.85*e),t.lineTo(.425*i,.85*e),t.lineTo(.425*i,.9*e),t.lineTo(.475*i,.9*e),t.lineTo(.475*i,1*e),t.lineTo(.525*i,1*e),t.lineTo(.525*i,.9*e),t.lineTo(.575*i,.9*e),t.lineTo(.575*i,.85*e),t.lineTo(.525*i,.85*e),Zo(t),n=.325,o=0,r=-.125,s=4*(Math.SQRT2-1)/3*n,Qo(t,(.5+n+o)*i,(.5+r)*e,!0,!0),$o(t,(.5+n+o)*i,(.5+s+r)*e,(.5+s+o)*i,(.5+n+r)*e,(.5+o)*i,(.5+n+r)*e),$o(t,(.5-s+o)*i,(.5+n+r)*e,(.5-n+o)*i,(.5+s+r)*e,(.5-n+o)*i,(.5+r)*e),$o(t,(.5-n+o)*i,(.5-s+r)*e,(.5-s+o)*i,(.5-n+r)*e,(.5+o)*i,(.5-n+r)*e),$o(t,(.5+s+o)*i,(.5-n+r)*e,(.5+n+o)*i,(.5-s+r)*e,(.5+n+o)*i,(.5+r)*e),Qo(t,(.525+o)*i,(.5+n+r)*e,!0),i=t.o,i.B=new D(.232,.136),i.C=new D(.782,.611),i.Md=Du,xh.s(t),i},PlusLine:function(t,i,e){return t=xh.q(),Qo(t,0,.5*e,!1),t.lineTo(1*i,.5*e),t.moveTo(.5*i,0),t.lineTo(.5*i,1*e),i=t.o,xh.s(t),i},XLine:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!1),t.lineTo(1*i,0),t.moveTo(0,0),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},AsteriskLine:function(t,i,e){t=xh.q();var n=.2/Math.SQRT2;return Qo(t,n*i,(1-n)*e,!1),t.lineTo((1-n)*i,n*e),t.moveTo(n*i,n*e),t.lineTo((1-n)*i,(1-n)*e),t.moveTo(0*i,.5*e),t.lineTo(1*i,.5*e),t.moveTo(.5*i,0*e),t.lineTo(.5*i,1*e),i=t.o,xh.s(t),i},CircleLine:function(t,i,e){var n=.5*hl.Da;return t=xh.q(),Qo(t,1*i,.5*e,!1),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),i=t.o,i.B=new D(.146,.146),i.C=new D(.853,.853),i.Md=Du,xh.s(t),i},Pie:function(t,i,e){t=xh.q();var n=4*(Math.SQRT2-1)/3*.5;return Qo(t,(.5*Math.SQRT2/2+.5)*i,(.5-.5*Math.SQRT2/2)*e,!0),$o(t,.7*i,0*e,.5*i,0*e,.5*i,0*e),$o(t,(.5-n+0)*i,0*e,0*i,(.5-n+0)*e,0*i,.5*e),$o(t,0*i,(.5+n+0)*e,(.5-n+0)*i,1*e,.5*i,1*e),$o(t,(.5+n+0)*i,1*e,1*i,(.5+n+0)*e,1*i,.5*e),t.lineTo(.5*i,.5*e),Zo(t),i=t.o,xh.s(t),i},PiePiece:function(t,i,e){var n=hl.Da/Math.SQRT2*.5,o=Math.SQRT2/2,r=1-Math.SQRT2/2;return t=xh.q(),Qo(t,i,e,!0),$o(t,i,(1-n)*e,(o+n)*i,(r+n)*e,o*i,r*e),t.lineTo(0,e),Zo(t),i=t.o,xh.s(t),i},StopSign:function(t,i,e){t=1/(Math.SQRT2+2);var n=xh.q();return Qo(n,t*i,0,!0),n.lineTo((1-t)*i,0),n.lineTo(1*i,t*e),n.lineTo(1*i,(1-t)*e),n.lineTo((1-t)*i,1*e),n.lineTo(t*i,1*e),n.lineTo(0,(1-t)*e),n.lineTo(0,t*e),Zo(n),i=n.o,i.B=new D(t/2,t/2),i.C=new D(1-t/2,1-t/2),xh.s(n),i},LogicImplies:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=.2),t=xh.q(),Qo(t,(1-n)*i,0*e,!1),t.lineTo(1*i,.5*e),t.lineTo((1-n)*i,e),t.moveTo(0,.5*e),t.lineTo(i,.5*e),i=t.o,i.B=Lh,i.C=new D(.8,.5),xh.s(t),i},LogicIff:function(t,i,e){var n=t?t.Ac:NaN;return isNaN(n)&&(n=.2),t=xh.q(),Qo(t,(1-n)*i,0*e,!1),t.lineTo(1*i,.5*e),t.lineTo((1-n)*i,e),t.moveTo(0,.5*e),t.lineTo(i,.5*e),t.moveTo(n*i,0),t.lineTo(0,.5*e),t.lineTo(n*i,e),i=t.o,i.B=new D(.2,0),i.C=new D(.8,.5),xh.s(t),i},LogicNot:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(1*i,0),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},LogicAnd:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!1),t.lineTo(.5*i,0),t.lineTo(1*i,1*e),i=t.o,i.B=new D(.25,.5),i.C=new D(.75,1),xh.s(t),i},LogicOr:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(.5*i,1*e),t.lineTo(1*i,0),i=t.o,i.B=new D(.219,0),i.C=new D(.78,.409),xh.s(t),i},LogicXor:function(t,i,e){Qo(t=xh.q(),.5*i,0,!1),t.lineTo(.5*i,1*e),t.moveTo(0,.5*e),t.lineTo(1*i,.5*e);var n=.5*hl.Da;return $o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),i=t.o,i.Md=Du,xh.s(t),i},LogicTruth:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(1*i,0),t.moveTo(.5*i,0),t.lineTo(.5*i,1*e),i=t.o,xh.s(t),i},LogicFalsity:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!1),t.lineTo(1*i,1*e),t.moveTo(.5*i,1*e),t.lineTo(.5*i,0),i=t.o,xh.s(t),i},LogicThereExists:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(1*i,0),t.lineTo(1*i,.5*e),t.lineTo(0,.5*e),t.moveTo(1*i,.5*e),t.lineTo(1*i,1*e),t.lineTo(0,1*e),i=t.o,xh.s(t),i},LogicForAll:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(.5*i,1*e),t.lineTo(1*i,0),t.moveTo(.25*i,.5*e),t.lineTo(.75*i,.5*e),i=t.o,i.B=new D(.25,0),i.C=new D(.75,.5),xh.s(t),i},LogicIsDefinedAs:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(i,0),t.moveTo(0,.5*e),t.lineTo(i,.5*e),t.moveTo(0,e),t.lineTo(i,e),i=t.o,i.B=new D(.01,.01),i.C=new D(.99,.49),xh.s(t),i},LogicIntersect:function(t,i,e){var n=.5*hl.Da;return t=xh.q(),Qo(t,0,1*e,!1),t.lineTo(0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),t.lineTo(1*i,1*e),i=t.o,i.B=new D(0,.5),i.C=Eh,xh.s(t),i},LogicUnion:function(t,i,e){var n=.5*hl.Da;return t=xh.q(),Qo(t,1*i,0,!1),t.lineTo(1*i,.5*e),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),t.lineTo(0,0),i=t.o,i.B=Lh,i.C=new D(1,.5),xh.s(t),i},Arrow:function(t,i,e){var n=t?t.Ac:NaN,o=t?t.Xt:NaN;return isNaN(n)&&(n=.3),isNaN(o)&&(o=.3),t=xh.q(),Qo(t,0,(.5-o/2)*e,!0),t.lineTo((1-n)*i,(.5-o/2)*e),t.lineTo((1-n)*i,0),t.lineTo(1*i,.5*e),t.lineTo((1-n)*i,1*e),t.lineTo((1-n)*i,(.5+o/2)*e),t.lineTo(0,(.5+o/2)*e),Zo(t),i=t.o,i.B=new D(0,.5-o/2),n=hl.wl(0,.5+o/2,1,.5+o/2,1-n,1,1,.5,xh.M()),i.C=new D(n.x,n.y),xh.v(n),xh.s(t),i},ISOProcess:"Chevron",Chevron:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.5*i,0),t.lineTo(1*i,.5*e),t.lineTo(.5*i,1*e),t.lineTo(0,1*e),t.lineTo(.5*i,.5*e),Zo(t),i=t.o,xh.s(t),i},DoubleArrow:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.3*i,.214*e),t.lineTo(.3*i,0),t.lineTo(1*i,.5*e),t.lineTo(.3*i,1*e),t.lineTo(.3*i,.786*e),t.lineTo(0,1*e),Zo(t),Qo(t,.3*i,.214*e,!1),t.lineTo(.3*i,.786*e),t.$a(!1),i=t.o,xh.s(t),i},DoubleEndArrow:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(.7*i,1*e),t.lineTo(.7*i,.7*e),t.lineTo(.3*i,.7*e),t.lineTo(.3*i,1*e),t.lineTo(0,.5*e),t.lineTo(.3*i,0),t.lineTo(.3*i,.3*e),t.lineTo(.7*i,.3*e),t.lineTo(.7*i,0),Zo(t),i=t.o,e=hl.wl(0,.5,.3,0,0,.3,.3,.3,xh.M()),i.B=new D(e.x,e.y),e=hl.wl(.7,1,1,.5,.7,.7,1,.7,e),i.C=new D(e.x,e.y),xh.v(e),xh.s(t),i},IBeamArrow:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(.7*i,1*e),t.lineTo(.7*i,.7*e),t.lineTo(.2*i,.7*e),t.lineTo(.2*i,1*e),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(.2*i,0),t.lineTo(.2*i,.3*e),t.lineTo(.7*i,.3*e),t.lineTo(.7*i,0),Zo(t),i=t.o,i.B=new D(0,.3),e=hl.wl(.7,1,1,.5,.7,.7,1,.7,xh.M()),i.C=new D(e.x,e.y),xh.v(e),xh.s(t),i},Pointer:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(0,1*e),t.lineTo(.2*i,.5*e),t.lineTo(0,0),Zo(t),i=t.o,i.B=new D(.2,.35),e=hl.wl(.2,.65,1,.65,0,1,1,.5,xh.M()),i.C=new D(e.x,e.y),xh.v(e),xh.s(t),i},RoundedPointer:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(0,1*e),$o(t,.5*i,.75*e,.5*i,.25*e,0,0),Zo(t),i=t.o,i.B=new D(.4,.35),e=hl.wl(.2,.65,1,.65,0,1,1,.5,xh.M()),i.C=new D(e.x,e.y),xh.v(e),xh.s(t),i},SplitEndArrow:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(.7*i,1*e),t.lineTo(.7*i,.7*e),t.lineTo(0,.7*e),t.lineTo(.2*i,.5*e),t.lineTo(0,.3*e),t.lineTo(.7*i,.3*e),t.lineTo(.7*i,0),Zo(t),i=t.o,i.B=new D(.2,.3),e=hl.wl(.7,1,1,.5,.7,.7,1,.7,xh.M()),i.C=new D(e.x,e.y),xh.v(e),xh.s(t),i},MessageToUser:"SquareArrow",SquareArrow:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(.7*i,1*e),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(.7*i,0),Zo(t),i=t.o,i.B=Lh,i.C=new D(.7,1),xh.s(t),i},Cone1:function(t,i,e){n=hl.Da;t=.5*n;var n,o=.1*n;return Qo(n=xh.q(),0,.9*e,!0),n.lineTo(.5*i,0),n.lineTo(1*i,.9*e),$o(n,1*i,(.9+o)*e,(.5+t)*i,1*e,.5*i,1*e),$o(n,(.5-t)*i,1*e,0,(.9+o)*e,0,.9*e),Zo(n),i=n.o,i.B=new D(.25,.5),i.C=new D(.75,.97),xh.s(n),i},Cone2:function(t,i,e){return t=xh.q(),Qo(t,0,.9*e,!0),$o(t,(1-.85/.9)*i,1*e,.85/.9*i,1*e,1*i,.9*e),t.lineTo(.5*i,0),t.lineTo(0,.9*e),Zo(t),Qo(t,0,.9*e,!1),$o(t,(1-.85/.9)*i,.8*e,.85/.9*i,.8*e,1*i,.9*e),t.$a(!1),i=t.o,i.B=new D(.25,.5),i.C=new D(.75,.82),xh.s(t),i},Cube1:function(t,i,e){return t=xh.q(),Qo(t,.5*i,1*e,!0),t.lineTo(1*i,.85*e),t.lineTo(1*i,.15*e),t.lineTo(.5*i,0*e),t.lineTo(0*i,.15*e),t.lineTo(0*i,.85*e),Zo(t),Qo(t,.5*i,1*e,!1),t.lineTo(.5*i,.3*e),t.lineTo(0,.15*e),t.moveTo(.5*i,.3*e),t.lineTo(1*i,.15*e),t.$a(!1),i=t.o,i.B=new D(0,.3),i.C=new D(.5,.85),xh.s(t),i},Cube2:function(t,i,e){return t=xh.q(),Qo(t,0,.3*e,!0),t.lineTo(0*i,1*e),t.lineTo(.7*i,e),t.lineTo(1*i,.7*e),t.lineTo(1*i,0*e),t.lineTo(.3*i,0*e),Zo(t),Qo(t,0,.3*e,!1),t.lineTo(.7*i,.3*e),t.lineTo(1*i,0*e),t.moveTo(.7*i,.3*e),t.lineTo(.7*i,1*e),t.$a(!1),i=t.o,i.B=new D(0,.3),i.C=new D(.7,1),xh.s(t),i},MagneticData:"Cylinder1",Cylinder1:function(t,i,e){n=hl.Da;t=.5*n;var n,o=.1*n;return Qo(n=xh.q(),0,.1*e,!0),$o(n,0,(.1-o)*e,(.5-t)*i,0,.5*i,0),$o(n,(.5+t)*i,0,1*i,(.1-o)*e,1*i,.1*e),n.lineTo(i,.9*e),$o(n,1*i,(.9+o)*e,(.5+t)*i,1*e,.5*i,1*e),$o(n,(.5-t)*i,1*e,0,(.9+o)*e,0,.9*e),n.lineTo(0,.1*e),Qo(n,0,.1*e,!1),$o(n,0,(.1+o)*e,(.5-t)*i,.2*e,.5*i,.2*e),$o(n,(.5+t)*i,.2*e,1*i,(.1+o)*e,1*i,.1*e),n.$a(!1),i=n.o,i.B=new D(0,.2),i.C=new D(1,.9),xh.s(n),i},Cylinder2:function(t,i,e){n=hl.Da;t=.5*n;var n,o=.1*n;return Qo(n=xh.q(),0,.9*e,!0),n.lineTo(0,.1*e),$o(n,0,(.1-o)*e,(.5-t)*i,0,.5*i,0),$o(n,(.5+t)*i,0,1*i,(.1-o)*e,1*i,.1*e),n.lineTo(1*i,.9*e),$o(n,1*i,(.9+o)*e,(.5+t)*i,1*e,.5*i,1*e),$o(n,(.5-t)*i,1*e,0,(.9+o)*e,0,.9*e),Qo(n,0,.9*e,!1),$o(n,0,(.9-o)*e,(.5-t)*i,.8*e,.5*i,.8*e),$o(n,(.5+t)*i,.8*e,1*i,(.9-o)*e,1*i,.9*e),n.$a(!1),i=n.o,i.B=new D(0,.1),i.C=new D(1,.8),xh.s(n),i},Cylinder3:function(t,i,e){n=hl.Da;t=.1*n;var n,o=.5*n;return Qo(n=xh.q(),.1*i,0,!0),n.lineTo(.9*i,0),$o(n,(.9+t)*i,0,1*i,(.5-o)*e,1*i,.5*e),$o(n,1*i,(.5+o)*e,(.9+t)*i,1*e,.9*i,1*e),n.lineTo(.1*i,1*e),$o(n,(.1-t)*i,1*e,0,(.5+o)*e,0,.5*e),$o(n,0,(.5-o)*e,(.1-t)*i,0,.1*i,0),Qo(n,.1*i,0,!1),$o(n,(.1+t)*i,0,.2*i,(.5-o)*e,.2*i,.5*e),$o(n,.2*i,(.5+o)*e,(.1+t)*i,1*e,.1*i,1*e),n.$a(!1),i=n.o,i.B=new D(.2,0),i.C=new D(.9,1),xh.s(n),i},DirectData:"Cylinder4",Cylinder4:function(t,i,e){n=hl.Da;t=.1*n;var n,o=.5*n;return Qo(n=xh.q(),.9*i,0,!0),$o(n,(.9+t)*i,0,1*i,(.5-o)*e,1*i,.5*e),$o(n,1*i,(.5+o)*e,(.9+t)*i,1*e,.9*i,1*e),n.lineTo(.1*i,1*e),$o(n,(.1-t)*i,1*e,0,(.5+o)*e,0,.5*e),$o(n,0,(.5-o)*e,(.1-t)*i,0,.1*i,0),n.lineTo(.9*i,0),Qo(n,.9*i,0,!1),$o(n,(.9-t)*i,0,.8*i,(.5-o)*e,.8*i,.5*e),$o(n,.8*i,(.5+o)*e,(.9-t)*i,1*e,.9*i,1*e),n.$a(!1),i=n.o,i.B=new D(.1,0),i.C=new D(.8,1),xh.s(n),i},Prism1:function(t,i,e){return t=xh.q(),Qo(t,.25*i,.25*e,!0),t.lineTo(.75*i,0),t.lineTo(i,.5*e),t.lineTo(.5*i,e),t.lineTo(0,e),Zo(t),Qo(t,.25*i,.25*e,!1),t.lineTo(.5*i,e),t.$a(!1),i=t.o,i.B=new D(.408,.172),i.C=new D(.833,.662),xh.s(t),i},Prism2:function(t,i,e){return t=xh.q(),Qo(t,0,.25*e,!0),t.lineTo(.75*i,0),t.lineTo(1*i,.25*e),t.lineTo(.75*i,.75*e),t.lineTo(0,1*e),Zo(t),Qo(t,0,e,!1),t.lineTo(.25*i,.5*e),t.lineTo(i,.25*e),t.moveTo(0,.25*e),t.lineTo(.25*i,.5*e),t.$a(!1),i=t.o,i.B=new D(.25,.5),i.C=new D(.75,.75),xh.s(t),i},Pyramid1:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(i,.75*e),t.lineTo(.5*i,1*e),t.lineTo(0,.75*e),Zo(t),Qo(t,.5*i,0,!1),t.lineTo(.5*i,1*e),t.$a(!1),i=t.o,i.B=new D(.25,.367),i.C=new D(.75,.875),xh.s(t),i},Pyramid2:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(i,.85*e),t.lineTo(.5*i,1*e),t.lineTo(0,.85*e),Zo(t),Qo(t,.5*i,0,!1),t.lineTo(.5*i,.7*e),t.lineTo(0,.85*e),t.moveTo(.5*i,.7*e),t.lineTo(1*i,.85*e),t.$a(!1),i=t.o,i.B=new D(.25,.367),i.C=new D(.75,.875),xh.s(t),i},Actor:function(t,i,e){var n=hl.Da,o=.2*n,r=.1*n,s=.5,a=.1;return t=xh.q(),Qo(t,s*i,(a+.1)*e,!0),$o(t,(s-o)*i,(a+.1)*e,(s-.2)*i,(a+r)*e,(s-.2)*i,a*e),$o(t,(s-.2)*i,(a-r)*e,(s-o)*i,(a-.1)*e,s*i,(a-.1)*e),$o(t,(s+o)*i,(a-.1)*e,(s+.2)*i,(a-r)*e,(s+.2)*i,a*e),$o(t,(s+.2)*i,(a+r)*e,(s+o)*i,(a+.1)*e,s*i,(a+.1)*e),o=.05,r=n*o,Qo(t,.5*i,.2*e,!0),t.lineTo(.95*i,.2*e),s=.95,a=.25,$o(t,(s+r)*i,(a-o)*e,(s+o)*i,(a-r)*e,(s+o)*i,a*e),t.lineTo(1*i,.6*e),t.lineTo(.85*i,.6*e),t.lineTo(.85*i,.35*e),o=.025,r=n*o,s=.825,a=.35,$o(t,(s+o)*i,(a-r)*e,(s+r)*i,(a-o)*e,s*i,(a-o)*e),$o(t,(s-r)*i,(a-o)*e,(s-o)*i,(a-r)*e,(s-o)*i,a*e),t.lineTo(.8*i,1*e),t.lineTo(.55*i,1*e),t.lineTo(.55*i,.7*e),o=.05,r=n*o,s=.5,a=.7,$o(t,(s+o)*i,(a-r)*e,(s+r)*i,(a-o)*e,s*i,(a-o)*e),$o(t,(s-r)*i,(a-o)*e,(s-o)*i,(a-r)*e,(s-o)*i,a*e),t.lineTo(.45*i,1*e),t.lineTo(.2*i,1*e),t.lineTo(.2*i,.35*e),o=.025,r=n*o,s=.175,a=.35,$o(t,(s+o)*i,(a-r)*e,(s+r)*i,(a-o)*e,s*i,(a-o)*e),$o(t,(s-r)*i,(a-o)*e,(s-o)*i,(a-r)*e,(s-o)*i,a*e),t.lineTo(.15*i,.6*e),t.lineTo(0*i,.6*e),t.lineTo(0*i,.25*e),o=.05,r=n*o,s=.05,a=.25,$o(t,(s-o)*i,(a-r)*e,(s-r)*i,(a-o)*e,s*i,(a-o)*e),t.lineTo(.5*i,.2*e),i=t.o,i.B=new D(.2,.2),i.C=new D(.8,.65),xh.s(t),i},Card:function(t,i,e){return t=xh.q(),Qo(t,1*i,0*e,!0),t.lineTo(1*i,1*e),t.lineTo(0*i,1*e),t.lineTo(0*i,.2*e),t.lineTo(.2*i,0*e),Zo(t),i=t.o,i.B=new D(0,.2),i.C=Eh,xh.s(t),i},Collate:function(t,i,e){return t=xh.q(),Qo(t,.5*i,.5*e,!0),t.lineTo(0,0),t.lineTo(1*i,0),t.lineTo(.5*i,.5*e),Qo(t,.5*i,.5*e,!0),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(.5*i,.5*e),i=t.o,i.B=new D(.25,0),i.C=new D(.75,.25),xh.s(t),i},CreateRequest:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),Qo(n,0,t*e,!1),n.lineTo(1*i,t*e),n.moveTo(0,(1-t)*e),n.lineTo(1*i,(1-t)*e),n.$a(!1),i=n.o,i.B=new D(0,t),i.C=new D(1,1-t),xh.s(n),i},Database:function(t,i,e){t=xh.q();var n=.5*(o=hl.Da),o=.1*o;return Qo(t,1*i,.1*e,!0),t.lineTo(1*i,.9*e),$o(t,1*i,(.9+o)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.9+o)*e,0,.9*e),t.lineTo(0,.1*e),$o(t,0,(.1-o)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.1-o)*e,1*i,.1*e),Qo(t,1*i,.1*e,!1),$o(t,1*i,(.1+o)*e,(.5+n)*i,.2*e,.5*i,.2*e),$o(t,(.5-n)*i,.2*e,0,(.1+o)*e,0,.1*e),t.moveTo(1*i,.2*e),$o(t,1*i,(.2+o)*e,(.5+n)*i,.3*e,.5*i,.3*e),$o(t,(.5-n)*i,.3*e,0,(.2+o)*e,0,.2*e),t.moveTo(1*i,.3*e),$o(t,1*i,(.3+o)*e,(.5+n)*i,.4*e,.5*i,.4*e),$o(t,(.5-n)*i,.4*e,0,(.3+o)*e,0,.3*e),t.$a(!1),i=t.o,i.B=new D(0,.4),i.C=new D(1,.9),xh.s(t),i},StoredData:"DataStorage",DataStorage:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.75*i,0),$o(t,1*i,0,1*i,1*e,.75*i,1*e),t.lineTo(0,1*e),$o(t,.25*i,.9*e,.25*i,.1*e,0,0),Zo(t),i=t.o,i.B=new D(.226,0),i.C=new D(.81,1),xh.s(t),i},DiskStorage:function(t,i,e){t=xh.q();var n=.5*(o=hl.Da),o=.1*o;return Qo(t,1*i,.1*e,!0),t.lineTo(1*i,.9*e),$o(t,1*i,(.9+o)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.9+o)*e,0,.9*e),t.lineTo(0,.1*e),$o(t,0,(.1-o)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.1-o)*e,1*i,.1*e),Qo(t,1*i,.1*e,!1),$o(t,1*i,(.1+o)*e,(.5+n)*i,.2*e,.5*i,.2*e),$o(t,(.5-n)*i,.2*e,0,(.1+o)*e,0,.1*e),t.moveTo(1*i,.2*e),$o(t,1*i,(.2+o)*e,(.5+n)*i,.3*e,.5*i,.3*e),$o(t,(.5-n)*i,.3*e,0,(.2+o)*e,0,.2*e),t.$a(!1),i=t.o,i.B=new D(0,.3),i.C=new D(1,.9),xh.s(t),i},Display:function(t,i,e){return t=xh.q(),Qo(t,.25*i,0,!0),t.lineTo(.75*i,0),$o(t,1*i,0,1*i,1*e,.75*i,1*e),t.lineTo(.25*i,1*e),t.lineTo(0,.5*e),Zo(t),i=t.o,i.B=new D(.25,0),i.C=new D(.75,1),xh.s(t),i},DividedEvent:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)?t=.2:.15>t&&(t=.15);var n=xh.q(),o=.2*hl.Da;return Qo(n,0,.2*e,!0),$o(n,0,(.2-o)*e,(.2-o)*i,0,.2*i,0),n.lineTo(.8*i,0),$o(n,(.8+o)*i,0,1*i,(.2-o)*e,1*i,.2*e),n.lineTo(1*i,.8*e),$o(n,1*i,(.8+o)*e,(.8+o)*i,1*e,.8*i,1*e),n.lineTo(.2*i,1*e),$o(n,(.2-o)*i,1*e,0,(.8+o)*e,0,.8*e),n.lineTo(0,.2*e),Qo(n,0,t*e,!1),n.lineTo(1*i,t*e),n.$a(!1),i=n.o,i.B=new D(0,t),i.C=new D(1,1-t),xh.s(n),i},DividedProcess:function(t,i,e){t=t?t.Ac:NaN,(isNaN(t)||.1>t)&&(t=.1);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),Qo(n,0,t*e,!1),n.lineTo(1*i,t*e),n.$a(!1),i=n.o,i.B=new D(0,t),i.C=Eh,xh.s(n),i},Document:function(t,i,e){return e/=.8,t=xh.q(),Qo(t,0,.7*e,!0),t.lineTo(0,0),t.lineTo(1*i,0),t.lineTo(1*i,.7*e),$o(t,.5*i,.4*e,.5*i,1*e,0,.7*e),Zo(t),i=t.o,i.B=Lh,i.C=new D(1,.6),xh.s(t),i},ExternalOrganization:function(t,i,e){t=t?t.Ac:NaN,(isNaN(t)||.2>t)&&(t=.2);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),Qo(n,t*i,0,!1),n.lineTo(0,t*e),n.moveTo(1*i,t*e),n.lineTo((1-t)*i,0),n.moveTo(0,(1-t)*e),n.lineTo(t*i,1*e),n.moveTo((1-t)*i,1*e),n.lineTo(1*i,(1-t)*e),n.$a(!1),i=n.o,i.B=new D(t/2,t/2),i.C=new D(1-t/2,1-t/2),xh.s(n),i},ExternalProcess:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(1*i,.5*e),t.lineTo(.5*i,1*e),t.lineTo(0,.5*e),Zo(t),Qo(t,.1*i,.4*e,!1),t.lineTo(.1*i,.6*e),t.moveTo(.9*i,.6*e),t.lineTo(.9*i,.4*e),t.moveTo(.6*i,.1*e),t.lineTo(.4*i,.1*e),t.moveTo(.4*i,.9*e),t.lineTo(.6*i,.9*e),t.$a(!1),i=t.o,i.B=new D(.25,.25),i.C=new D(.75,.75),xh.s(t),i},File:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.75*i,0),t.lineTo(1*i,.25*e),t.lineTo(1*i,1*e),t.lineTo(0,1*e),Zo(t),Qo(t,.75*i,0,!1),t.lineTo(.75*i,.25*e),t.lineTo(1*i,.25*e),t.$a(!1),i=t.o,i.B=new D(0,.25),i.C=Eh,xh.s(t),i},Interrupt:function(t,i,e){return t=xh.q(),Qo(t,1*i,.5*e,!0),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(1*i,.5*e),Qo(t,1*i,.5*e,!1),t.lineTo(1*i,1*e),Qo(t,1*i,.5*e,!1),t.lineTo(1*i,0),i=t.o,i.B=new D(0,.25),i.C=new D(.5,.75),xh.s(t),i},InternalStorage:function(t,i,e){var n=t?t.Ac:NaN;t=t?t.Xt:NaN,isNaN(n)&&(n=.1),isNaN(t)&&(t=.1);var o=xh.q();return Qo(o,0,0,!0),o.lineTo(1*i,0),o.lineTo(1*i,1*e),o.lineTo(0,1*e),Zo(o),Qo(o,n*i,0,!1),o.lineTo(n*i,1*e),o.moveTo(0,t*e),o.lineTo(1*i,t*e),o.$a(!1),i=o.o,i.B=new D(n,t),i.C=Eh,xh.s(o),i},Junction:function(t,i,e){t=xh.q();var n=1/Math.SQRT2,o=(1-1/Math.SQRT2)/2,r=.5*hl.Da;return Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+r)*e,(.5+r)*i,1*e,.5*i,1*e),$o(t,(.5-r)*i,1*e,0,(.5+r)*e,0,.5*e),$o(t,0,(.5-r)*e,(.5-r)*i,0,.5*i,0),$o(t,(.5+r)*i,0,1*i,(.5-r)*e,1*i,.5*e),Qo(t,(o+n)*i,(o+n)*e,!1),t.lineTo(o*i,o*e),t.moveTo(o*i,(o+n)*e),t.lineTo((o+n)*i,o*e),t.$a(!1),i=t.o,i.Md=Du,xh.s(t),i},LinedDocument:function(t,i,e){return e/=.8,t=xh.q(),Qo(t,0,.7*e,!0),t.lineTo(0,0),t.lineTo(1*i,0),t.lineTo(1*i,.7*e),$o(t,.5*i,.4*e,.5*i,1*e,0,.7*e),Zo(t),Qo(t,.1*i,0,!1),t.lineTo(.1*i,.75*e),t.$a(!1),i=t.o,i.B=new D(.1,0),i.C=new D(1,.6),xh.s(t),i},LoopLimit:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!0),t.lineTo(0,.25*e),t.lineTo(.25*i,0),t.lineTo(.75*i,0),t.lineTo(1*i,.25*e),t.lineTo(1*i,1*e),Zo(t),i=t.o,i.B=new D(0,.25),i.C=Eh,xh.s(t),i},SequentialData:"MagneticTape",MagneticTape:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,.5*i,1*e,!0),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),$o(t,1*i,(.5+n)*e,(.5+n)*i,.9*e,.6*i,.9*e),t.lineTo(1*i,.9*e),t.lineTo(1*i,1*e),t.lineTo(.5*i,1*e),i=t.o,i.B=new D(.15,.15),i.C=new D(.85,.8),xh.s(t),i},ManualInput:function(t,i,e){return t=xh.q(),Qo(t,1*i,0,!0),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(0,.25*e),Zo(t),i=t.o,i.B=new D(0,.25),i.C=Eh,xh.s(t),i},MessageFromUser:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.7);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(t*i,.5*e),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),i=n.o,i.B=Lh,i.C=new D(t,1),xh.s(n),i},MicroformProcessing:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.25);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(.5*i,t*e),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(.5*i,(1-t)*e),n.lineTo(0,1*e),Zo(n),i=n.o,i.B=new D(0,t),i.C=new D(1,1-t),xh.s(n),i},MicroformRecording:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.75*i,.25*e),t.lineTo(1*i,.15*e),t.lineTo(1*i,.85*e),t.lineTo(.75*i,.75*e),t.lineTo(0,1*e),Zo(t),i=t.o,i.B=new D(0,.25),i.C=new D(1,.75),xh.s(t),i},MultiDocument:function(t,i,e){return e/=.8,t=xh.q(),Qo(t,i,0,!0),t.lineTo(i,.5*e),$o(t,.96*i,.47*e,.93*i,.45*e,.9*i,.44*e),t.lineTo(.9*i,.6*e),$o(t,.86*i,.57*e,.83*i,.55*e,.8*i,.54*e),t.lineTo(.8*i,.7*e),$o(t,.4*i,.4*e,.4*i,1*e,0,.7*e),t.lineTo(0,.2*e),t.lineTo(.1*i,.2*e),t.lineTo(.1*i,.1*e),t.lineTo(.2*i,.1*e),t.lineTo(.2*i,0),Zo(t),Qo(t,.1*i,.2*e,!1),t.lineTo(.8*i,.2*e),t.lineTo(.8*i,.54*e),t.moveTo(.2*i,.1*e),t.lineTo(.9*i,.1*e),t.lineTo(.9*i,.44*e),t.$a(!1),i=t.o,i.B=new D(0,.25),i.C=new D(.8,.77),xh.s(t),i},MultiProcess:function(t,i,e){return t=xh.q(),Qo(t,.1*i,.1*e,!0),t.lineTo(.2*i,.1*e),t.lineTo(.2*i,0),t.lineTo(1*i,0),t.lineTo(1*i,.8*e),t.lineTo(.9*i,.8*e),t.lineTo(.9*i,.9*e),t.lineTo(.8*i,.9*e),t.lineTo(.8*i,1*e),t.lineTo(0,1*e),t.lineTo(0,.2*e),t.lineTo(.1*i,.2*e),Zo(t),Qo(t,.2*i,.1*e,!1),t.lineTo(.9*i,.1*e),t.lineTo(.9*i,.8*e),t.moveTo(.1*i,.2*e),t.lineTo(.8*i,.2*e),t.lineTo(.8*i,.9*e),t.$a(!1),i=t.o,i.B=new D(0,.2),i.C=new D(.8,1),xh.s(t),i},OfflineStorage:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=1-t,o=xh.q();return Qo(o,0,0,!0),o.lineTo(1*i,0),o.lineTo(.5*i,1*e),Zo(o),Qo(o,.5*t*i,t*e,!1),o.lineTo((1-.5*t)*i,t*e),o.$a(!1),i=o.o,i.B=new D(n/4+.5*t,t),i.C=new D(3*n/4+.5*t,t+.5*n),xh.s(o),i},OffPageConnector:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(.75*i,0),t.lineTo(1*i,.5*e),t.lineTo(.75*i,1*e),t.lineTo(0,1*e),Zo(t),i=t.o,i.B=Lh,i.C=new D(.75,1),xh.s(t),i},Or:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),Qo(t,1*i,.5*e,!1),t.lineTo(0,.5*e),t.moveTo(.5*i,1*e),t.lineTo(.5*i,0),t.$a(!1),i=t.o,i.Md=Du,xh.s(t),i},PaperTape:function(t,i,e){return e/=.8,t=xh.q(),Qo(t,0,.7*e,!0),t.lineTo(0,.3*e),$o(t,.5*i,.6*e,.5*i,0,1*i,.3*e),t.lineTo(1*i,.7*e),$o(t,.5*i,.4*e,.5*i,1*e,0,.7*e),Zo(t),i=t.o,i.B=new D(0,.49),i.C=new D(1,.75),xh.s(t),i},PrimitiveFromCall:function(t,i,e){var n=t?t.Ac:NaN;t=t?t.Xt:NaN,isNaN(n)&&(n=.1),isNaN(t)&&(t=.3);var o=xh.q();return Qo(o,0,0,!0),o.lineTo(1*i,0),o.lineTo((1-t)*i,.5*e),o.lineTo(1*i,1*e),o.lineTo(0,1*e),Zo(o),i=o.o,i.B=new D(n,0),i.C=new D(1-t,1),xh.s(o),i},PrimitiveToCall:function(t,i,e){var n=t?t.Ac:NaN;t=t?t.Xt:NaN,isNaN(n)&&(n=.1),isNaN(t)&&(t=.3);var o=xh.q();return Qo(o,0,0,!0),o.lineTo((1-t)*i,0),o.lineTo(1*i,.5*e),o.lineTo((1-t)*i,1*e),o.lineTo(0,1*e),Zo(o),i=o.o,i.B=new D(n,0),i.C=new D(1-t,1),xh.s(o),i},Subroutine:"Procedure",Procedure:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),Qo(n,(1-t)*i,0,!1),n.lineTo((1-t)*i,1*e),n.moveTo(t*i,0),n.lineTo(t*i,1*e),n.$a(!1),i=n.o,i.B=new D(t,0),i.C=new D(1-t,1),xh.s(n),i},Process:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(0,1*e),Zo(n),Qo(n,t*i,0,!1),n.lineTo(t*i,1*e),n.$a(!1),i=n.o,i.B=new D(t,0),i.C=Eh,xh.s(n),i},Sort:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!0),t.lineTo(1*i,.5*e),t.lineTo(.5*i,1*e),t.lineTo(0,.5*e),Zo(t),Qo(t,0,.5*e,!1),t.lineTo(1*i,.5*e),t.$a(!1),i=t.o,i.B=new D(.25,.25),i.C=new D(.75,.5),xh.s(t),i},Start:function(t,i,e){return t=xh.q(),Qo(t,.25*i,0,!0),Qo(t,.25*i,0,!0),t.arcTo(270,180,.75*i,.5*e,.25*i,.5*e),t.arcTo(90,180,.25*i,.5*e,.25*i,.5*e),Qo(t,.25*i,0,!1),t.lineTo(.25*i,1*e),t.moveTo(.75*i,0),t.lineTo(.75*i,1*e),t.$a(!1),i=t.o,i.B=new D(.25,0),i.C=new D(.75,1),xh.s(t),i},Terminator:function(t,i,e){return t=xh.q(),Qo(t,.25*i,0,!0),t.arcTo(270,180,.75*i,.5*e,.25*i,.5*e),t.arcTo(90,180,.25*i,.5*e,.25*i,.5*e),i=t.o,i.B=new D(.23,0),i.C=new D(.77,1),xh.s(t),i},TransmittalTape:function(t,i,e){t=t?t.Ac:NaN,isNaN(t)&&(t=.1);var n=xh.q();return Qo(n,0,0,!0),n.lineTo(1*i,0),n.lineTo(1*i,1*e),n.lineTo(.75*i,(1-t)*e),n.lineTo(0,(1-t)*e),Zo(n),i=n.o,i.B=Lh,i.C=new D(1,1-t),xh.s(n),i},AndGate:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,0,0,!0),t.lineTo(.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),t.lineTo(0,1*e),Zo(t),i=t.o,i.B=Lh,i.C=new D(.55,1),xh.s(t),i},Buffer:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(1*i,.5*e),t.lineTo(0,1*e),Zo(t),i=t.o,i.B=new D(0,.25),i.C=new D(.5,.75),xh.s(t),i},Clock:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),Qo(t,1*i,.5*e,!1),t.lineTo(1*i,.5*e),Qo(t,.8*i,.75*e,!1),t.lineTo(.8*i,.25*e),t.lineTo(.6*i,.25*e),t.lineTo(.6*i,.75*e),t.lineTo(.4*i,.75*e),t.lineTo(.4*i,.25*e),t.lineTo(.2*i,.25*e),t.lineTo(.2*i,.75*e),t.$a(!1),i=t.o,i.Md=Du,xh.s(t),i},Ground:function(t,i,e){return t=xh.q(),Qo(t,.5*i,0,!1),t.lineTo(.5*i,.4*e),t.moveTo(.2*i,.6*e),t.lineTo(.8*i,.6*e),t.moveTo(.3*i,.8*e),t.lineTo(.7*i,.8*e),t.moveTo(.4*i,1*e),t.lineTo(.6*i,1*e),i=t.o,xh.s(t),i},Inverter:function(t,i,e){t=xh.q();var n=.1*hl.Da;return Qo(t,.8*i,.5*e,!0),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(.8*i,.5*e),Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+n)*e,(.9+n)*i,.6*e,.9*i,.6*e),$o(t,(.9-n)*i,.6*e,.8*i,(.5+n)*e,.8*i,.5*e),$o(t,.8*i,(.5-n)*e,(.9-n)*i,.4*e,.9*i,.4*e),$o(t,(.9+n)*i,.4*e,1*i,(.5-n)*e,1*i,.5*e),i=t.o,i.B=new D(0,.25),i.C=new D(.4,.75),xh.s(t),i},NandGate:function(t,i,e){t=xh.q();var n=.5*(r=hl.Da),o=.4*r,r=.1*r;return Qo(t,.8*i,.5*e,!0),$o(t,.8*i,(.5+o)*e,(.4+n)*i,1*e,.4*i,1*e),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(.4*i,0),$o(t,(.4+n)*i,0,.8*i,(.5-o)*e,.8*i,.5*e),Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+r)*e,(.9+r)*i,.6*e,.9*i,.6*e),$o(t,(.9-r)*i,.6*e,.8*i,(.5+r)*e,.8*i,.5*e),$o(t,.8*i,(.5-r)*e,(.9-r)*i,.4*e,.9*i,.4*e),$o(t,(.9+r)*i,.4*e,1*i,(.5-r)*e,1*i,.5*e),i=t.o,i.B=new D(0,.05),i.C=new D(.55,.95),xh.s(t),i},NorGate:function(t,i,e){t=xh.q();var n=hl.Da,o=.5,r=n*o,s=0,a=.5;return Qo(t,.8*i,.5*e,!0),$o(t,.7*i,(a+r)*e,(s+r)*i,(a+o)*e,0,1*e),$o(t,.25*i,.75*e,.25*i,.25*e,0,0),$o(t,(s+r)*i,(a-o)*e,.7*i,(a-r)*e,.8*i,.5*e),o=.1,r=.1*n,s=.9,a=.5,Qo(t,(s-o)*i,a*e,!0),$o(t,(s-o)*i,(a-r)*e,(s-r)*i,(a-o)*e,s*i,(a-o)*e),$o(t,(s+r)*i,(a-o)*e,(s+o)*i,(a-r)*e,(s+o)*i,a*e),$o(t,(s+o)*i,(a+r)*e,(s+r)*i,(a+o)*e,s*i,(a+o)*e),$o(t,(s-r)*i,(a+o)*e,(s-o)*i,(a+r)*e,(s-o)*i,a*e),i=t.o,i.B=new D(.2,.25),i.C=new D(.6,.75),xh.s(t),i},OrGate:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,0,0,!0),$o(t,(0+n+n)*i,0*e,.8*i,(.5-n)*e,1*i,.5*e),$o(t,.8*i,(.5+n)*e,(0+n+n)*i,1*e,0,1*e),$o(t,.25*i,.75*e,.25*i,.25*e,0,0),Zo(t),i=t.o,i.B=new D(.2,.25),i.C=new D(.75,.75),xh.s(t),i},XnorGate:function(t,i,e){t=xh.q();var n=hl.Da,o=.5,r=n*o,s=.2,a=.5;return Qo(t,.1*i,0,!1),$o(t,.35*i,.25*e,.35*i,.75*e,.1*i,1*e),Qo(t,.8*i,.5*e,!0),$o(t,.7*i,(a+r)*e,(s+r)*i,(a+o)*e,.2*i,1*e),$o(t,.45*i,.75*e,.45*i,.25*e,.2*i,0),$o(t,(s+r)*i,(a-o)*e,.7*i,(a-r)*e,.8*i,.5*e),o=.1,r=.1*n,s=.9,a=.5,Qo(t,(s-o)*i,a*e,!0),$o(t,(s-o)*i,(a-r)*e,(s-r)*i,(a-o)*e,s*i,(a-o)*e),$o(t,(s+r)*i,(a-o)*e,(s+o)*i,(a-r)*e,(s+o)*i,a*e),$o(t,(s+o)*i,(a+r)*e,(s+r)*i,(a+o)*e,s*i,(a+o)*e),$o(t,(s-r)*i,(a+o)*e,(s-o)*i,(a+r)*e,(s-o)*i,a*e),i=t.o,i.B=new D(.4,.25),i.C=new D(.65,.75),xh.s(t),i},XorGate:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,.1*i,0,!1),$o(t,.35*i,.25*e,.35*i,.75*e,.1*i,1*e),Qo(t,.2*i,0,!0),$o(t,(.2+n)*i,0*e,.9*i,(.5-n)*e,1*i,.5*e),$o(t,.9*i,(.5+n)*e,(.2+n)*i,1*e,.2*i,1*e),$o(t,.45*i,.75*e,.45*i,.25*e,.2*i,0),Zo(t),i=t.o,i.B=new D(.4,.25),i.C=new D(.8,.75),xh.s(t),i},Capacitor:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(0,1*e),t.moveTo(1*i,0),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},Resistor:function(t,i,e){return t=xh.q(),Qo(t,0,.5*e,!1),t.lineTo(.1*i,0),t.lineTo(.2*i,1*e),t.lineTo(.3*i,0),t.lineTo(.4*i,1*e),t.lineTo(.5*i,0),t.lineTo(.6*i,1*e),t.lineTo(.7*i,.5*e),i=t.o,xh.s(t),i},Inductor:function(t,i,e){t=xh.q();var n=.1*hl.Da,o=.1;return Qo(t,(o-.5*n)*i,e,!1),$o(t,(o-n)*i,e,(o-.1)*i,0,(o+.1)*i,0),o=.3,$o(t,(o+.1)*i,0,(o+n)*i,e,o*i,e),$o(t,(o-n)*i,e,(o-.1)*i,0,(o+.1)*i,0),o=.5,$o(t,(o+.1)*i,0,(o+n)*i,e,o*i,e),$o(t,(o-n)*i,e,(o-.1)*i,0,(o+.1)*i,0),o=.7,$o(t,(o+.1)*i,0,(o+n)*i,e,o*i,e),$o(t,(o-n)*i,e,(o-.1)*i,0,(o+.1)*i,0),o=.9,$o(t,(o+.1)*i,0,(o+n)*i,e,(o+.5*n)*i,e),i=t.o,xh.s(t),i},ACvoltageSource:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,0*i,.5*e,!1),$o(t,0*i,(.5-n)*e,(.5-n)*i,0*e,.5*i,0*e),$o(t,(.5+n)*i,0*e,1*i,(.5-n)*e,1*i,.5*e),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0*i,(.5+n)*e,0*i,.5*e),t.moveTo(.1*i,.5*e),$o(t,.5*i,0*e,.5*i,1*e,.9*i,.5*e),i=t.o,i.Md=Du,xh.s(t),i},DCvoltageSource:function(t,i,e){return t=xh.q(),Qo(t,0,.75*e,!1),t.lineTo(0,.25*e),t.moveTo(1*i,0),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},Diode:function(t,i,e){return t=xh.q(),Qo(t,1*i,0,!1),t.lineTo(1*i,.5*e),t.lineTo(0,1*e),t.lineTo(0,0),t.lineTo(1*i,.5*e),t.lineTo(1*i,1*e),i=t.o,i.B=new D(0,.25),i.C=new D(.5,.75),xh.s(t),i},Wifi:function(t,i,e){var n=i,o=e;i*=.38,e*=.6,t=xh.q();var r=hl.Da,s=.8*r,a=.8,h=0,l=.5;return Qo(t,h*i+(n=(n-i)/2),(l+a)*e+(o=(o-e)/2),!0),$o(t,(h-s)*i+n,(l+a)*e+o,(h-a)*i+n,(l+s)*e+o,(h-a)*i+n,l*e+o),$o(t,(h-a)*i+n,(l-s)*e+o,(h-s)*i+n,(l-a)*e+o,h*i+n,(l-a)*e+o),$o(t,h*i+n,(l-a)*e+o,(h-a+.5*s)*i+n,(l-s)*e+o,(h-a+.5*s)*i+n,l*e+o),$o(t,(h-a+.5*s)*i+n,(l+s)*e+o,h*i+n,(l+a)*e+o,h*i+n,(l+a)*e+o),Zo(t),s=.4*r,a=.4,h=.2,l=.5,Qo(t,h*i+n,(l+a)*e+o,!0),$o(t,(h-s)*i+n,(l+a)*e+o,(h-a)*i+n,(l+s)*e+o,(h-a)*i+n,l*e+o),$o(t,(h-a)*i+n,(l-s)*e+o,(h-s)*i+n,(l-a)*e+o,h*i+n,(l-a)*e+o),$o(t,h*i+n,(l-a)*e+o,(h-a+.5*s)*i+n,(l-s)*e+o,(h-a+.5*s)*i+n,l*e+o),$o(t,(h-a+.5*s)*i+n,(l+s)*e+o,h*i+n,(l+a)*e+o,h*i+n,(l+a)*e+o),Zo(t),s=.2*r,a=.2,l=h=.5,Qo(t,(h-a)*i+n,l*e+o,!0),$o(t,(h-a)*i+n,(l-s)*e+o,(h-s)*i+n,(l-a)*e+o,h*i+n,(l-a)*e+o),$o(t,(h+s)*i+n,(l-a)*e+o,(h+a)*i+n,(l-s)*e+o,(h+a)*i+n,l*e+o),$o(t,(h+a)*i+n,(l+s)*e+o,(h+s)*i+n,(l+a)*e+o,h*i+n,(l+a)*e+o),$o(t,(h-s)*i+n,(l+a)*e+o,(h-a)*i+n,(l+s)*e+o,(h-a)*i+n,l*e+o),s=.4*r,a=.4,h=.8,l=.5,Qo(t,h*i+n,(l-a)*e+o,!0),$o(t,(h+s)*i+n,(l-a)*e+o,(h+a)*i+n,(l-s)*e+o,(h+a)*i+n,l*e+o),$o(t,(h+a)*i+n,(l+s)*e+o,(h+s)*i+n,(l+a)*e+o,h*i+n,(l+a)*e+o),$o(t,h*i+n,(l+a)*e+o,(h+a-.5*s)*i+n,(l+s)*e+o,(h+a-.5*s)*i+n,l*e+o),$o(t,(h+a-.5*s)*i+n,(l-s)*e+o,h*i+n,(l-a)*e+o,h*i+n,(l-a)*e+o),Zo(t),s=.8*r,a=.8,h=1,l=.5,Qo(t,h*i+n,(l-a)*e+o,!0),$o(t,(h+s)*i+n,(l-a)*e+o,(h+a)*i+n,(l-s)*e+o,(h+a)*i+n,l*e+o),$o(t,(h+a)*i+n,(l+s)*e+o,(h+s)*i+n,(l+a)*e+o,h*i+n,(l+a)*e+o),$o(t,h*i+n,(l+a)*e+o,(h+a-.5*s)*i+n,(l+s)*e+o,(h+a-.5*s)*i+n,l*e+o),$o(t,(h+a-.5*s)*i+n,(l-s)*e+o,h*i+n,(l-a)*e+o,h*i+n,(l-a)*e+o),Zo(t),i=t.o,xh.s(t),i},Email:function(t,i,e){return t=xh.q(),Qo(t,0,0,!0),t.lineTo(1*i,0),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(0,0),Zo(t),Qo(t,0,0,!1),t.lineTo(.5*i,.6*e),t.lineTo(1*i,0),t.moveTo(0,1*e),t.lineTo(.45*i,.54*e),t.moveTo(1*i,1*e),t.lineTo(.55*i,.54*e),t.$a(!1),i=t.o,xh.s(t),i},Ethernet:function(t,i,e){return t=xh.q(),Qo(t,.35*i,0,!0),t.lineTo(.65*i,0),t.lineTo(.65*i,.4*e),t.lineTo(.35*i,.4*e),t.lineTo(.35*i,0),Zo(t),Qo(t,.1*i,1*e,!0,!0),t.lineTo(.4*i,1*e),t.lineTo(.4*i,.6*e),t.lineTo(.1*i,.6*e),t.lineTo(.1*i,1*e),Zo(t),Qo(t,.6*i,1*e,!0,!0),t.lineTo(.9*i,1*e),t.lineTo(.9*i,.6*e),t.lineTo(.6*i,.6*e),t.lineTo(.6*i,1*e),Zo(t),Qo(t,0,.5*e,!1),t.lineTo(1*i,.5*e),t.moveTo(.5*i,.5*e),t.lineTo(.5*i,.4*e),t.moveTo(.75*i,.5*e),t.lineTo(.75*i,.6*e),t.moveTo(.25*i,.5*e),t.lineTo(.25*i,.6*e),t.$a(!1),i=t.o,xh.s(t),i},Power:function(t,i,e){t=xh.q();var n=hl.Da,o=.4*n,r=.4,s=xh.M(),a=xh.M(),h=xh.M(),l=xh.M();hl.Ti(.5,.5-r,.5+o,.5-r,.5+r,.5-o,.5+r,.5,.5,s,s,a,h,l);var u=xh.Ob(a.x,a.y);return Qo(t,a.x*i,a.y*e,!0),$o(t,h.x*i,h.y*e,l.x*i,l.y*e,(.5+r)*i,.5*e),$o(t,(.5+r)*i,(.5+o)*e,(.5+o)*i,(.5+r)*e,.5*i,(.5+r)*e),$o(t,(.5-o)*i,(.5+r)*e,(.5-r)*i,(.5+o)*e,(.5-r)*i,.5*e),hl.Ti(.5-r,.5,.5-r,.5-o,.5-o,.5-r,.5,.5-r,.5,h,l,a,s,s),$o(t,h.x*i,h.y*e,l.x*i,l.y*e,a.x*i,a.y*e),o=.3*n,r=.3,hl.Ti(.5-r,.5,.5-r,.5-o,.5-o,.5-r,.5,.5-r,.5,h,l,a,s,s),t.lineTo(a.x*i,a.y*e),$o(t,l.x*i,l.y*e,h.x*i,h.y*e,(.5-r)*i,.5*e),$o(t,(.5-r)*i,(.5+o)*e,(.5-o)*i,(.5+r)*e,.5*i,(.5+r)*e),$o(t,(.5+o)*i,(.5+r)*e,(.5+r)*i,(.5+o)*e,(.5+r)*i,.5*e),hl.Ti(.5,.5-r,.5+o,.5-r,.5+r,.5-o,.5+r,.5,.5,s,s,a,h,l),$o(t,l.x*i,l.y*e,h.x*i,h.y*e,a.x*i,a.y*e),Zo(t),Qo(t,.45*i,0,!0),t.lineTo(.45*i,.5*e),t.lineTo(.55*i,.5*e),t.lineTo(.55*i,0),Zo(t),xh.v(s),xh.v(a),xh.v(h),xh.v(l),xh.v(u),i=t.o,i.B=new D(.25,.55),i.C=new D(.75,.8),xh.s(t),i},Fallout:function(t,i,e){t=xh.q();var n=.5*hl.Da;Qo(t,0*i,.5*e,!0),$o(t,0*i,(.5-n)*e,(.5-n)*i,0*e,.5*i,0*e),$o(t,(.5+n)*i,0*e,1*i,(.5-n)*e,1*i,.5*e),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0*i,(.5+n)*e,0*i,.5*e);var o=n=0;return Qo(t,(.3+n)*i,(.8+o)*e,!0,!0),t.lineTo((.5+n)*i,(.5+o)*e),t.lineTo((.1+n)*i,(.5+o)*e),t.lineTo((.3+n)*i,(.8+o)*e),n=.4,o=0,Zo(t),Qo(t,(.3+n)*i,(.8+o)*e,!0,!0),t.lineTo((.5+n)*i,(.5+o)*e),t.lineTo((.1+n)*i,(.5+o)*e),t.lineTo((.3+n)*i,(.8+o)*e),n=.2,o=-.3,Zo(t),Qo(t,(.3+n)*i,(.8+o)*e,!0,!0),t.lineTo((.5+n)*i,(.5+o)*e),t.lineTo((.1+n)*i,(.5+o)*e),t.lineTo((.3+n)*i,(.8+o)*e),Zo(t),i=t.o,i.Md=Du,xh.s(t),i},IrritationHazard:function(t,i,e){return t=xh.q(),Qo(t,.2*i,0*e,!0),t.lineTo(.5*i,.3*e),t.lineTo(.8*i,0*e),t.lineTo(1*i,.2*e),t.lineTo(.7*i,.5*e),t.lineTo(1*i,.8*e),t.lineTo(.8*i,1*e),t.lineTo(.5*i,.7*e),t.lineTo(.2*i,1*e),t.lineTo(0*i,.8*e),t.lineTo(.3*i,.5*e),t.lineTo(0*i,.2*e),Zo(t),i=t.o,i.B=new D(.3,.3),i.C=new D(.7,.7),xh.s(t),i},ElectricalHazard:function(t,i,e){return t=xh.q(),Qo(t,.37*i,0*e,!0),t.lineTo(.5*i,.11*e),t.lineTo(.77*i,.04*e),t.lineTo(.33*i,.49*e),t.lineTo(1*i,.37*e),t.lineTo(.63*i,.86*e),t.lineTo(.77*i,.91*e),t.lineTo(.34*i,1*e),t.lineTo(.34*i,.78*e),t.lineTo(.44*i,.8*e),t.lineTo(.65*i,.56*e),t.lineTo(0*i,.68*e),Zo(t),i=t.o,xh.s(t),i},FireHazard:function(t,i,e){return t=xh.q(),Qo(t,.1*i,1*e,!0),$o(t,-.25*i,.63*e,.45*i,.44*e,.29*i,0*e),$o(t,.48*i,.17*e,.54*i,.35*e,.51*i,.42*e),$o(t,.59*i,.29*e,.58*i,.28*e,.59*i,.18*e),$o(t,.8*i,.34*e,.88*i,.43*e,.75*i,.6*e),$o(t,.87*i,.48*e,.88*i,.43*e,.88*i,.31*e),$o(t,1.17*i,.76*e,.82*i,.8*e,.9*i,1*e),Zo(t),i=t.o,i.B=new D(.05,.645),i.C=new D(.884,.908),xh.s(t),i},BpmnActivityLoop:function(t,i,e){t=xh.q();var n=4*(Math.SQRT2-1)/3*.5;return Qo(t,.65*i,1*e,!1),$o(t,(1-n+0)*i,1*e,1*i,(.5+n+0)*e,1*i,.5*e),$o(t,1*i,(.5-n+0)*e,(.5+n+0)*i,0*e,.5*i,0*e),$o(t,(.5-n+0)*i,0*e,0*i,(.5-n+0)*e,0*i,.5*e),$o(t,0*i,(.5+n+0)*e,(.5-n+0)*i,1*e,.35*i,.98*e),t.moveTo(.25*i,.8*e),t.lineTo(.35*i,1*e),t.lineTo(.1*i,1*e),i=t.o,xh.s(t),i},BpmnActivityParallel:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(0,1*e),t.moveTo(.5*i,0),t.lineTo(.5*i,1*e),t.moveTo(1*i,0),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},BpmnActivitySequential:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),t.lineTo(1*i,0),t.moveTo(0,.5*e),t.lineTo(1*i,.5*e),t.moveTo(0,1*e),t.lineTo(1*i,1*e),i=t.o,xh.s(t),i},BpmnActivityAdHoc:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),Qo(t,1*i,1*e,!1),Qo(t,0,.5*e,!1),$o(t,.2*i,.35*e,.3*i,.35*e,.5*i,.5*e),$o(t,.7*i,.65*e,.8*i,.65*e,1*i,.5*e),i=t.o,xh.s(t),i},BpmnActivityCompensation:function(t,i,e){return t=xh.q(),Qo(t,0,.5*e,!0),t.lineTo(.5*i,0),t.lineTo(.5*i,.5*e),t.lineTo(1*i,1*e),t.lineTo(1*i,0),t.lineTo(.5*i,.5*e),t.lineTo(.5*i,1*e),Zo(t),i=t.o,xh.s(t),i},BpmnTaskMessage:function(t,i,e){return t=xh.q(),Qo(t,0,.2*e,!0),t.lineTo(1*i,.2*e),t.lineTo(1*i,.8*e),t.lineTo(0,.8*e),t.lineTo(0,.8*e),Zo(t),Qo(t,0,.2*e,!1),t.lineTo(.5*i,.5*e),t.lineTo(1*i,.2*e),t.$a(!1),i=t.o,xh.s(t),i},BpmnTaskScript:function(t,i,e){return t=xh.q(),Qo(t,.7*i,1*e,!0),t.lineTo(.3*i,1*e),$o(t,.6*i,.5*e,0,.5*e,.3*i,0),t.lineTo(.7*i,0),$o(t,.4*i,.5*e,1*i,.5*e,.7*i,1*e),Zo(t),Qo(t,.45*i,.73*e,!1),t.lineTo(.7*i,.73*e),t.moveTo(.38*i,.5*e),t.lineTo(.63*i,.5*e),t.moveTo(.31*i,.27*e),t.lineTo(.56*i,.27*e),t.$a(!1),i=t.o,xh.s(t),i},BpmnTaskUser:function(t,i,e){Qo(t=xh.q(),0,0,!1),Qo(t,.335*i,(1-.555)*e,!0),t.lineTo(.335*i,.595*e),t.lineTo(.665*i,.595*e),t.lineTo(.665*i,(1-.555)*e),$o(t,.88*i,.46*e,.98*i,.54*e,1*i,.68*e),t.lineTo(1*i,1*e),t.lineTo(0,1*e),t.lineTo(0,.68*e),$o(t,.02*i,.54*e,.12*i,.46*e,.335*i,(1-.555)*e),t.lineTo(.365*i,.405*e);var n=.5-.285,o=Math.PI/4,r=4*(1-Math.cos(o))/(3*Math.sin(o));return $o(t,(.5-((o=r*n)+n)/2)*i,(n+(n+(r=r*n))/2)*e,.285*i,(n+r)*e,.285*i,n*e),$o(t,.285*i,(n-r)*e,(.5-o)*i,0*e,.5*i,0*e),$o(t,(.5+o)*i,0*e,(.5+n)*i,(n-r)*e,(.5+n)*i,n*e),$o(t,(.5+n)*i,(n+r)*e,(.5+(o+n)/2)*i,(n+(n+r)/2)*e,.635*i,.405*e),t.lineTo(.635*i,.405*e),t.lineTo(.665*i,(1-.555)*e),t.lineTo(.665*i,.595*e),t.lineTo(.335*i,.595*e),Qo(t,.2*i,1*e,!1),t.lineTo(.2*i,.8*e),Qo(t,.8*i,1*e,!1),t.lineTo(.8*i,.8*e),i=t.o,xh.s(t),i},BpmnEventConditional:function(t,i,e){return t=xh.q(),Qo(t,.1*i,0,!0),t.lineTo(.9*i,0),t.lineTo(.9*i,1*e),t.lineTo(.1*i,1*e),Zo(t),Qo(t,.2*i,.2*e,!1),t.lineTo(.8*i,.2*e),t.moveTo(.2*i,.4*e),t.lineTo(.8*i,.4*e),t.moveTo(.2*i,.6*e),t.lineTo(.8*i,.6*e),t.moveTo(.2*i,.8*e),t.lineTo(.8*i,.8*e),t.$a(!1),i=t.o,xh.s(t),i},BpmnEventError:function(t,i,e){return t=xh.q(),Qo(t,0,1*e,!0),t.lineTo(.33*i,0),t.lineTo(.66*i,.5*e),t.lineTo(1*i,0),t.lineTo(.66*i,1*e),t.lineTo(.33*i,.5*e),Zo(t),i=t.o,xh.s(t),i},BpmnEventEscalation:function(t,i,e){return t=xh.q(),Qo(t,0,0,!1),Qo(t,1*i,1*e,!1),Qo(t,.1*i,1*e,!0),t.lineTo(.5*i,0),t.lineTo(.9*i,1*e),t.lineTo(.5*i,.5*e),Zo(t),i=t.o,xh.s(t),i},BpmnEventTimer:function(t,i,e){t=xh.q();var n=.5*hl.Da;return Qo(t,1*i,.5*e,!0),$o(t,1*i,(.5+n)*e,(.5+n)*i,1*e,.5*i,1*e),$o(t,(.5-n)*i,1*e,0,(.5+n)*e,0,.5*e),$o(t,0,(.5-n)*e,(.5-n)*i,0,.5*i,0),$o(t,(.5+n)*i,0,1*i,(.5-n)*e,1*i,.5*e),Qo(t,.5*i,0,!1),t.lineTo(.5*i,.15*e),t.moveTo(.5*i,1*e),t.lineTo(.5*i,.85*e),t.moveTo(0,.5*e),t.lineTo(.15*i,.5*e),t.moveTo(1*i,.5*e),t.lineTo(.85*i,.5*e),t.moveTo(.5*i,.5*e),t.lineTo(.58*i,.1*e),t.moveTo(.5*i,.5*e),t.lineTo(.78*i,.54*e),t.$a(!1),i=t.o,i.Md=Du,xh.s(t),i}};for(var df in hl.wg)hl.wg[df.toLowerCase()]=df;hl.Dw={"":"",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"},hl.oJ=function(){if(null!==hl.Dw){for(var t in hl.Dw){var i=dl(hl.Dw[t],!1);hl.ij[t]=i,t.toLowerCase()!==t&&(hl.ij[t.toLowerCase()]=t)}hl.Dw=null}},hl.LD=function(t){hl.oJ();var i=hl.ij[t];if(void 0===i){if("none"===(i=t.toLowerCase()))return"None";i=hl.ij[i]}return"string"==typeof i?i:i instanceof K?t:null},xh.Ja(tr,eo),xh.ea("Part",tr),tr.prototype.cloneProtected=function(t){eo.prototype.cloneProtected.call(this,t),t.R=-4097&this.R|49152,t.hi=this.hi,t.Nk=this.Nk,t.pr=this.pr,t.ts=this.ts,t.fs=this.fs,t.js=this.js,t.vs=this.vs,t.us=this.us,t.fi=null,t.hs=this.hs,t.gs=this.gs.S(),t.ks=this.ks,t.le=this.le,t.rq=this.rq,t.Ai.assign(this.Ai),t.ur=this.ur,t.vr=this.vr.S(),t.Er=this.Er.S(),t.xr=this.xr.S(),t.Lq=this.Lq,t.qr=this.qr,t.Bm=this.Bm.S(),t.Vg=this.Vg,t.Qh=this.Qh,t.Us=this.Us},tr.prototype.Zh=function(t){eo.prototype.Zh.call(this,t),t.zl(),t.Am=null,t.uo=null,t.vo=null,t.Sk=null,t.pm=null},tr.prototype.toString=function(){var t=xh.df(Object.getPrototypeOf(this))+"#"+xh.pd(this);return null!==this.data&&(t+="("+Cl(this.data)+")"),t},tr.LayoutNone=0;var yf;tr.LayoutAdded=yf=1;var vf;tr.LayoutRemoved=vf=2,tr.LayoutShown=4,tr.LayoutHidden=8,tr.LayoutNodeSized=16;var gf;tr.LayoutGroupLayout=gf=32,tr.LayoutNodeReplaced=64;var mf;tr.LayoutStandard=mf=yf|vf|28|gf|64,tr.LayoutAll=16777215,tr.prototype.kn=function(t,i,e,n,o,r,s){var a=this.g;null!==a&&(t===Ml&&"elements"===i?o instanceof eo?lo(o,function(t){ze(a,t),qe(a,t)}):o instanceof Ho&&Be(a,o):t===Pl&&"elements"===i&&(o instanceof eo?lo(o,function(t){Oe(a,t),Ee(a,t)}):o instanceof Ho&&Ie(a,o)),a.Lc(t,i,e,n,o,r,s))},tr.prototype.updateTargetBindings=tr.prototype.Jb=function(t){if(eo.prototype.Jb.call(this,t),null!==this.data)for(var i=(t=this.Aa.n).length,e=0;e<i;e++){var n=t[e];n instanceof eo&&lo(n,function(t){null!==t.data&&t.Jb()})}},tr.prototype.updateRelationshipsFromData=function(){var t=this.data;if(null!==t){if(null!==(n=this.g)){var i=n.Z;if(i instanceof wt){var e=i.Xm(t),n=n.DH(e),o=this.Ta;n!==o&&(n=null!==o?i.ib(o.data):void 0,"function"==typeof(o=i.Cp)?o(t,n):t[o]=n,i.Hx(t,e))}}}},xh.u(tr,{ww:"adornments"},function(){return null===this.fi?kh:this.fi.NE}),tr.prototype.findAdornment=tr.prototype.bp=function(t){var i=this.fi;return null===i?null:i.ka(t)},tr.prototype.addAdornment=tr.prototype.bl=function(t,i){if(null!==i){var e=null,n=this.fi;if(null!==n&&(e=n.ka(t)),e!==i){if(null!==e){var o=e.g;null!==o&&o.remove(e)}null===n&&(this.fi=n=new m("string",xr)),i.hi!==t&&(i.Fc=t),n.add(t,i),null!==(e=this.g)&&(e.add(i),i.data=this.data)}}},tr.prototype.removeAdornment=tr.prototype.Jl=function(t){var i=this.fi;if(null!==i){var e=i.ka(t);if(null!==e){var n=e.g;null!==n&&n.remove(e)}i.remove(t),0===i.count&&(this.fi=null)}},tr.prototype.clearAdornments=tr.prototype.et=function(){if(null!==(i=this.fi)){for(var t=xh.lb(),i=i.i;i.next();)t.push(i.key);for(var i=t.length,e=0;e<i;e++)this.Jl(t[e]);xh.ta(t)}},tr.prototype.updateAdornments=function(){var t=this.g;if(null!==t){t:{if(this.jb&&this.iJ){var i=this.gu;if(!(null!==i&&this.Y.K()&&this.isVisible()&&i.Fl()&&i.Y.K()))break t;var e=this.bp("Selection");if(null===e){if(null===(e=this.jJ)&&(e=this instanceof zr?t.uI:this instanceof vs?t.QH:t.LI),!(e instanceof xr))break t;bo(e),null!==(e=e.copy())&&(e.Fc="Selection",e.gc=i)}if(null!==e){var n=e.placeholder;if(null!==n){var o=i.Yi(),r=0;i instanceof To&&(r=i.pb);var s=xh.Pl();s.m((i.Ia.width+r)*o,(i.Ia.height+r)*o),n.ya=s,xh.ck(s)}e.angle=i.ul(),e.type!==Ku&&(n=xh.M(),e.location=i.Za(Lh,n),xh.v(n)),this.bl("Selection",e);break t}}this.Jl("Selection")}for(function(t,i){i.cb.Qe.each(function(i){i.isEnabled&&i.updateAdornments(t)})}(this,t),t=this.ww;t.next();)(i=t.value).Jb(),i.Q()}},xh.u(tr,{layer:"layer"},function(){return this.Av}),xh.u(tr,{g:"diagram"},function(){var t=this.Av;return null!==t?t.g:null}),xh.defineProperty(tr,{Tf:"layerName"},function(){return this.Nk},function(t){var i=this.Nk;if(i!==t){xh.j(t,"string",tr,"layerName");var e=this.g;if((null===e||null!==e.nt(t)&&!e.bq)&&(this.Nk=t,null!==e&&e.pc(),this.h("layerName",i,t),null!==(i=this.layer)&&i.name!==t&&null!==(e=i.g)&&null!==(t=e.nt(t))&&t!==i)){var n=i.Oe(-1,this,!0);if(0<=n&&e.Lc(Pl,"parts",i,this,null,n,!0),i.visible!==t.visible&&this.rd(t.visible),0<=(n=t.lp(99999999,this,!0))&&e.Lc(Ml,"parts",t,null,this,!0,n),null!==(n=this.Jt)){var o=e.Ra;e.Ra=!0,n(this,i,t),e.Ra=o}}}}),xh.defineProperty(tr,{Jt:"layerChanged"},function(){return this.pr},function(t){var i=this.pr;i!==t&&(null!==t&&xh.j(t,"function",tr,"layerChanged"),this.pr=t,this.h("layerChanged",i,t))}),xh.defineProperty(tr,{sn:"zOrder"},function(){return this.Us},function(t){var i=this.Us;if(i!==t){xh.j(t,"number",tr,"zOrder"),this.Us=t;var e=this.layer;null!==e&&Xi(e,-1,this),this.h("zOrder",i,t),null!==(t=this.g)&&t.qa()}}),tr.prototype.invalidateAdornments=tr.prototype.be=function(){var t=this.g;null!==t&&(Me(t),0!=(16384&this.R)!=!0&&(this.R|=16384,t.Re()))},xh.u(tr,{bc:"locationObject"},function(){if(null===this.Sk){var t=this.eA;""!==t?(t=this.ae(t),this.Sk=null!==t?t:this):this.Sk=this instanceof xr&&this.type!==Ku&&null!==this.placeholder?this.placeholder:this}return this.Sk.visible?this.Sk:this}),xh.defineProperty(tr,{EI:"minLocation"},function(){return this.Er},function(t){var i=this.Er;i.L(t)||(this.Er=t=t.S(),this.h("minLocation",i,t))}),xh.defineProperty(tr,{zI:"maxLocation"},function(){return this.xr},function(t){var i=this.xr;i.L(t)||(this.xr=t=t.S(),this.h("maxLocation",i,t))}),xh.defineProperty(tr,{eA:"locationObjectName"},function(){return this.ur},function(t){var i=this.ur;i!==t&&(this.ur=t,this.Sk=null,In(this),this.h("locationObjectName",i,t))}),xh.defineProperty(tr,{gf:"locationSpot"},function(){return this.vr},function(t){var i=this.vr;i.L(t)||(this.vr=t=t.S(),In(this),this.h("locationSpot",i,t))}),tr.prototype.move=function(t){this.position=t},tr.prototype.moveTo=tr.prototype.moveTo=function(t,i){var e=xh.Ob(t,i);this.move(e),xh.v(e)},tr.prototype.isVisible=function(){if(!this.visible)return!1;var t=this.layer;return!(null!==t&&!t.visible)&&(!(null===(t=this.g)||!(t=t.Sa).uf||null===(t=t.Uk.ka(this))||!t.yx)||!!(null===(t=this.Ta)||t.ee&&t.isVisible()))},tr.prototype.rd=function(t){var i=this.g;t?(this.H(4),this.be(),null!==i&&i.eg.add(this)):(this.H(8),this.et()),this.zl(),null!==i&&(i.pc(),i.qa())},tr.prototype.findObject=tr.prototype.ae=function(t){if(this.name===t)return this;var i=this.pm;if(null===i&&(this.pm=i=new n),void 0!==i[t])return i[t];for(var e=this.Aa.n,o=e.length,r=0;r<o;r++){var s=e[r];if(s.name===t)return i[t]=s;if(s instanceof eo)if(null===s.wj&&null===s.gg){if(null!==(s=s.ae(t)))return i[t]=s}else if(xo(s)&&null!==(s=s.Aa.first())&&s.name===t)return i[t]=s}return i[t]=null},tr.prototype.ensureBounds=tr.prototype.rf=function(){jn(this,1/0,1/0),this.Ec()},tr.prototype.Ec=function(){if(this.vi(),!1===Xn(this))nr(this);else{var t=this.mc,i=xh.ag();i.assign(t),t.Oa();var e=dr(this);this.Ri(0,0,this.md.width,this.md.height);var n=this.position;ar(this,n,this.location),t.x=n.x,t.y=n.y,t.freeze(),this.qx(i,t),i.L(t)?this.zf(e):!this.Pd()||hl.G(i.width,t.width)&&hl.G(i.height,t.height)||0<=this.xC&&this.H(16),xh.ic(i),cr(this,!1)}},tr.prototype.qx=function(t,i){Qn(this,!1);var e=this.g;if(null!==e){var n=!1;if(!1===e.tj&&t.K()){var o=e.Bd,r=e.padding,s=o.x+r.left,a=o.y+r.top,h=o.width-2*r.right,o=o.height-2*r.bottom;t.x>s&&t.y>a&&t.right<h&&t.bottom<o&&i.x>s&&i.y>a&&i.right<h&&i.bottom<o&&(n=!0)}0!=(65536&this.R)!=!0&&t.L(i)||hr(this,n,e),e.qa(),t.L(i)||this.zl()}},xh.defineProperty(tr,{location:"location"},function(){return this.Ai},function(t){var i=this.Ai;if(!i.L(t)){var e;if(e=t=t.S(),this instanceof zr)e=!1;else{if(this.Ai=e,!1===Xn(this)){er(this);var n=this.mb;if(n.K()){var o=n.copy();n.m(n.x+(e.x-i.x),n.y+(e.y-i.y)),sr(this,this.g,n,o),this.h("position",o,n)}}e=!0}e&&this.h("location",i,t)}}),tr.prototype.LA=function(t,i){if(this instanceof zr||!t.K())return!1;var e=this.g;if(null!==e&&(sr(this,e,t,i),!0===e.ma.kb))return!0;if(this.mb=t,(e=this.Ai).K()){var n=e.copy();e.m(e.x+(t.x-i.x),e.y+(t.y-i.y)),this.h("location",n,e)}return!1===fr(this)&&!1===Xn(this)&&(er(this),nr(this)),!0},tr.prototype.Jx=function(t,i){var e=this.Ai,n=this.mb;fr(this)||Xn(this)?e.m(NaN,NaN):e.m(e.x+t-n.x,e.y+i-n.y),n.m(t,i),er(this)},tr.prototype.Dl=function(){return!0},tr.prototype.Pd=function(){return!0},xh.defineProperty(tr,{Fc:"category"},function(){return this.hi},function(t){var i=this.hi;if(i!==t){xh.j(t,"string",tr,"category");var e=this.g,n=this.data,o=null;if(null!==e&&null!==n&&!(this instanceof xr)){var r=e.Z.ma;r.isEnabled&&!r.kb&&(o=this.clone()).Aa.Tc(this.Aa)}this.hi=t,this.h("category",i,t),null===e||null===n||this instanceof xr?null!==(o=this.Wg)&&(null!==(t=o.fi)&&t.remove(i),o.bl(this.Fc,this)):(r=e.Z).ma.kb||(this instanceof zr?(r instanceof wt?r.uF(n,t):r instanceof Pt&&r.mJ(n,t),null!==(e=Ye(e,t))&&(bo(e),null!==(e=e.copy())&&ur(this,e,i,t))):(null!==r&&r.Fx(n,t),null!==(e=Ve(e,n,t))&&(bo(e),null===(e=e.copy())||e instanceof zr||(e.location=this.location,ur(this,e,i,t)))),null!==o&&((i=this.clone()).Aa.Tc(this.Aa),this.h("self",o,i)))}}),xh.defineProperty(tr,{self:"self"},function(){return this},function(t){ur(this,t,this.Fc,t.Fc)});var bf=!1;tr.prototype.canCopy=function(){if(!this.jH)return!1;var t=this.layer;return null===t||!!t.Xj&&(null===(t=t.g)||!!t.Xj)},tr.prototype.canDelete=function(){if(!this.pH)return!1;var t=this.layer;return null===t||!!t.Hm&&(null===(t=t.g)||!!t.Hm)},tr.prototype.canEdit=function(){if(!this.wJ)return!1;var t=this.layer;return null===t||!!t.Aw&&(null===(t=t.g)||!!t.Aw)},tr.prototype.canGroup=function(){if(!this.RH)return!1;var t=this.layer;return null===t||!!t.xw&&(null===(t=t.g)||!!t.xw)},tr.prototype.canMove=function(){if(!this.JI)return!1;var t=this.layer;return null===t||!!t.fl&&(null===(t=t.g)||!!t.fl)},tr.prototype.canReshape=function(){if(!this.YI)return!1;var t=this.layer;return null===t||!!t.yw&&(null===(t=t.g)||!!t.yw)},tr.prototype.canResize=function(){if(!this.ZI)return!1;var t=this.layer;return null===t||!!t.bt&&(null===(t=t.g)||!!t.bt)},tr.prototype.canRotate=function(){if(!this.bJ)return!1;var t=this.layer;return null===t||!!t.zw&&(null===(t=t.g)||!!t.zw)},tr.prototype.canSelect=function(){if(!this.Kl)return!1;var t=this.layer;return null===t||!!t.pf&&(null===(t=t.g)||!!t.pf)},xh.defineProperty(tr,{jH:"copyable"},function(){return 0!=(1&this.R)},function(t){var i=0!=(1&this.R);i!==t&&(this.R^=1,this.h("copyable",i,t))}),xh.defineProperty(tr,{pH:"deletable"},function(){return 0!=(2&this.R)},function(t){var i=0!=(2&this.R);i!==t&&(this.R^=2,this.h("deletable",i,t))}),xh.defineProperty(tr,{wJ:"textEditable"},function(){return 0!=(4&this.R)},function(t){var i=0!=(4&this.R);i!==t&&(this.R^=4,this.h("textEditable",i,t),this.be())}),xh.defineProperty(tr,{RH:"groupable"},function(){return 0!=(8&this.R)},function(t){var i=0!=(8&this.R);i!==t&&(this.R^=8,this.h("groupable",i,t))}),xh.defineProperty(tr,{JI:"movable"},function(){return 0!=(16&this.R)},function(t){var i=0!=(16&this.R);i!==t&&(this.R^=16,this.h("movable",i,t))}),xh.defineProperty(tr,{iJ:"selectionAdorned"},function(){return 0!=(32&this.R)},function(t){var i=0!=(32&this.R);i!==t&&(this.R^=32,this.h("selectionAdorned",i,t),this.be())}),xh.defineProperty(tr,{$z:"isInDocumentBounds"},function(){return 0!=(64&this.R)},function(t){var i=0!=(64&this.R);if(i!==t){this.R^=64;var e=this.g;null!==e&&e.pc(),this.h("isInDocumentBounds",i,t)}}),xh.defineProperty(tr,{IE:"isLayoutPositioned"},function(){return 0!=(128&this.R)},function(t){var i=0!=(128&this.R);i!==t&&(this.R^=128,this.h("isLayoutPositioned",i,t),this.H(t?4:8))}),xh.defineProperty(tr,{Kl:"selectable"},function(){return 0!=(256&this.R)},function(t){var i=0!=(256&this.R);i!==t&&(this.R^=256,this.h("selectable",i,t),this.be())}),xh.defineProperty(tr,{YI:"reshapable"},function(){return 0!=(512&this.R)},function(t){var i=0!=(512&this.R);i!==t&&(this.R^=512,this.h("reshapable",i,t),this.be())}),xh.defineProperty(tr,{ZI:"resizable"},function(){return 0!=(1024&this.R)},function(t){var i=0!=(1024&this.R);i!==t&&(this.R^=1024,this.h("resizable",i,t),this.be())}),xh.defineProperty(tr,{bJ:"rotatable"},function(){return 0!=(2048&this.R)},function(t){var i=0!=(2048&this.R);i!==t&&(this.R^=2048,this.h("rotatable",i,t),this.be())}),xh.defineProperty(tr,{jb:"isSelected"},function(){return 0!=(4096&this.R)},function(t){var i=0!=(4096&this.R);if(i!==t){var e=this.g;if(!t||this.canSelect()&&!(null!==e&&e.selection.count>=e.AI)){this.R^=4096;var n=!1;if(null!==e){n=e.wb,e.wb=!0;var o=e.selection;o.Oa(),t?o.add(this):o.remove(this),o.freeze()}this.h("isSelected",i,t),this.be(),null!==(t=this.kJ)&&t(this),null!==e&&(e.Re(),e.wb=n)}}}),xh.defineProperty(tr,{dh:"isHighlighted"},function(){return 0!=(524288&this.R)},function(t){var i=0!=(524288&this.R);if(i!==t){this.R^=524288;var e=this.g;null!==e&&((e=e.Zm).Oa(),t?e.add(this):e.remove(this),e.freeze()),this.h("isHighlighted",i,t),this.qa()}}),xh.defineProperty(tr,{El:"isShadowed"},function(){return 0!=(8192&this.R)},function(t){var i=0!=(8192&this.R);i!==t&&(this.R^=8192,this.h("isShadowed",i,t),this.qa())}),tr.prototype.zf=function(t){this.R=t?131072|this.R:-131073&this.R},xh.defineProperty(tr,{AE:"isAnimated"},function(){return 0!=(262144&this.R)},function(t){var i=0!=(262144&this.R);i!==t&&(this.R^=262144,this.h("isAnimated",i,t))}),xh.defineProperty(tr,{HA:"selectionObjectName"},function(){return this.vs},function(t){var i=this.vs;i!==t&&(this.vs=t,this.Am=null,this.h("selectionObjectName",i,t))}),xh.defineProperty(tr,{jJ:"selectionAdornmentTemplate"},function(){return this.ts},function(t){var i=this.ts;i!==t&&(this instanceof zr&&(t.type=Ku),this.ts=t,this.h("selectionAdornmentTemplate",i,t))}),xh.u(tr,{gu:"selectionObject"},function(){if(null===this.Am){var t=this.HA;null!==t&&""!==t?(t=this.ae(t),this.Am=null!==t?t:this):this instanceof zr?(t=this.path,this.Am=null!==t?t:this):this.Am=this}return this.Am}),xh.defineProperty(tr,{kJ:"selectionChanged"},function(){return this.us},function(t){var i=this.us;i!==t&&(null!==t&&xh.j(t,"function",tr,"selectionChanged"),this.us=t,this.h("selectionChanged",i,t))}),xh.defineProperty(tr,{iF:"resizeAdornmentTemplate"},function(){return this.fs},function(t){var i=this.fs;i!==t&&(this.fs=t,this.h("resizeAdornmentTemplate",i,t))}),xh.defineProperty(tr,{kF:"resizeObjectName"},function(){return this.hs},function(t){var i=this.hs;i!==t&&(this.hs=t,this.uo=null,this.h("resizeObjectName",i,t))}),xh.u(tr,{jF:"resizeObject"},function(){if(null===this.uo){var t=this.kF;null!==t&&""!==t?(t=this.ae(t),this.uo=null!==t?t:this):this.uo=this}return this.uo}),xh.defineProperty(tr,{$I:"resizeCellSize"},function(){return this.gs},function(t){var i=this.gs;i.L(t)||(this.gs=t=t.S(),this.h("resizeCellSize",i,t))}),xh.defineProperty(tr,{cJ:"rotateAdornmentTemplate"},function(){return this.js},function(t){var i=this.js;i!==t&&(this.js=t,this.h("rotateAdornmentTemplate",i,t))}),xh.defineProperty(tr,{dJ:"rotateObjectName"},function(){return this.ks},function(t){var i=this.ks;i!==t&&(this.ks=t,this.vo=null,this.h("rotateObjectName",i,t))}),xh.u(tr,{mF:"rotateObject"},function(){if(null===this.vo){var t=this.dJ;null!==t&&""!==t?(t=this.ae(t),this.vo=null!==t?t:this):this.vo=this}return this.vo}),xh.defineProperty(tr,{text:"text"},function(){return this.le},function(t){var i=this.le;i!==t&&(this.le=t,this.h("text",i,t))}),xh.defineProperty(tr,{Ta:"containingGroup"},function(){return this.Ak},function(t){if(this.Pd()){var i=this.Ak;if(i!==t){null===t||this!==t&&!t.ai(this)||(this===t&&xh.k("Cannot make a Group a member of itself: "+this.toString()),xh.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.H(vf);var e=this.g;if(null!==i?ms(i,this):this instanceof vs&&null!==e&&e.$k.remove(this),this.Ak=t,null!==t?gs(t,this):this instanceof vs&&null!==e&&e.$k.add(this),this.H(yf),null!==e){var n=this.data,o=e.Z;null!==n&&o instanceof wt&&o.Hx(n,o.ib(null!==t?t.data:null))}if(null!==(n=this.TD)&&(o=!0,null!==e&&(o=e.Ra,e.Ra=!0),n(this,i,t),null!==e&&(e.Ra=o)),this instanceof vs)for(e=new c(tr),Dt(e,this,!0,0,!0),e=e.i;e.next();)if((n=e.value)instanceof wr)for(n=n.ue;n.next();)Or(n.value);if(this instanceof wr)for(n=this.ue;n.next();)Or(n.value);this.h("containingGroup",i,t),null!==t&&null!==(i=t.layer)&&Xi(i,-1,t)}}else xh.k("cannot set the Part.containingGroup of a Link or Adornment")}),(mh=tr.prototype).zl=function(){var t=this.Ta;null!==t&&(t.Q(),null!==t.Ib&&t.Ib.Q(),t.ff())},mh.qa=function(){var t=this.g;null!==t&&!Xn(this)&&!fr(this)&&this.isVisible()&&this.mc.K()&&t.qa(rr(this,this.mc))},mh.At=function(t){t||null!==(t=this.Ak)&&gs(t,this)},mh.Bt=function(t){t||null!==(t=this.Ak)&&ms(t,this)},mh.Um=function(){var t=this.data;if(null!==t){var i=this.g;null!==i&&null!==(i=i.Z)&&i.Ax(t)}},xh.defineProperty(tr,{TD:"containingGroupChanged"},function(){return this.rq},function(t){var i=this.rq;i!==t&&(null!==t&&xh.j(t,"function",tr,"containingGroupChanged"),this.rq=t,this.h("containingGroupChanged",i,t))}),tr.prototype.findSubGraphLevel=function(){return vr(this,this)},tr.prototype.findTopLevelPart=function(){return gr(this,this)},xh.u(tr,{np:"isTopLevel"},function(){return!(null!==this.Ta||this instanceof wr&&this.vf)}),tr.prototype.isMemberOf=tr.prototype.ai=function(t){return t instanceof vs&&mr(this,this,t)},tr.prototype.findCommonContainingGroup=tr.prototype.zH=function(t){if(null===t)return null;if(this===t)return this.Ta;for(e=this;null!==e;)e instanceof vs&&yr(e,!0),e=e.Ta;for(var i=null,e=t;null!==e;){if(0!=(1048576&e.R)){i=e;break}e=e.Ta}for(e=this;null!==e;)e instanceof vs&&yr(e,!1),e=e.Ta;return i},xh.defineProperty(tr,{pI:"layoutConditions"},function(){return this.qr},function(t){var i=this.qr;i!==t&&(this.qr=t,this.h("layoutConditions",i,t))}),tr.prototype.canLayout=function(){if(!this.IE||!this.isVisible())return!1;var t=this.layer;return!(null!==t&&t.Gc||this instanceof wr&&this.vf)},tr.prototype.invalidateLayout=tr.prototype.H=function(t){void 0===t&&(t=16777215);var i;if(this.IE&&0!=(t&this.pI)?null!==(i=this.layer)&&i.Gc||this instanceof wr&&this.vf?i=!1:(i=this.g,i=null===i||!i.ma.kb):i=!1,i)if(null!==(i=this.Ak)){var e=i.Rb;null!==e?e.H():i.H(t)}else null!==(t=this.g)&&null!==(e=t.Rb)&&e.H()},xh.defineProperty(tr,{eE:"dragComputation"},function(){return this.Lq},function(t){var i=this.Lq;i!==t&&(null!==t&&xh.j(t,"function",tr,"dragComputation"),this.Lq=t,this.h("dragComputation",i,t))}),xh.defineProperty(tr,{pJ:"shadowOffset"},function(){return this.Bm},function(t){var i=this.Bm;i.L(t)||(this.Bm=t=t.S(),this.qa(),this.h("shadowOffset",i,t))}),xh.defineProperty(tr,{shadowColor:"shadowColor"},function(){return this.Vg},function(t){var i=this.Vg;i!==t&&(this.Vg=t,this.qa(),this.h("shadowColor",i,t))}),xh.defineProperty(tr,{shadowBlur:"shadowBlur"},function(){return this.Qh},function(t){var i=this.Qh;i!==t&&(this.Qh=t,this.qa(),this.h("shadowBlur",i,t))}),xh.Ja(xr,tr),xh.ea("Adornment",xr),xr.prototype.toString=function(){var t=this.Wg;return"Adornment("+this.Fc+")"+(null!==t?t.toString():"")},xr.prototype.updateRelationshipsFromData=function(){},xr.prototype.dn=function(t){var i=this.gc.aa,e=this.gc;if(i instanceof zr&&e instanceof To){var n=i.path,e=n.Ua;for(i.dn(t),e=n.Ua,i=(t=this.Aa.n).length,n=0;n<i;n++){var o=t[n];o.Rf&&o instanceof To&&(o.Ua=e)}}},xh.u(xr,{placeholder:"placeholder"},function(){return this.Ib}),xh.defineProperty(xr,{gc:"adornedObject"},function(){return this.Fb},function(t){var i=this.Wg,e=null;null!==t&&(e=t.aa),null===i||null!==t&&i===e||i.Jl(this.Fc),this.Fb=t,null!==e&&e.bl(this.Fc,this)}),xh.u(xr,{Wg:"adornedPart"},function(){var t=this.Fb;return null!==t?t.aa:null}),xr.prototype.Dl=function(){var t=this.Fb;return null===t||(null===(t=t.aa)||!Xn(t))},xr.prototype.Pd=function(){return!1},xh.u(xr,{Ta:"containingGroup"},function(){return null}),xr.prototype.kn=function(t,i,e,n,o,r,s){if(t===Ml&&"elements"===i)if(o instanceof ws){var a=o;null===this.Ib?this.Ib=a:this.Ib!==a&&xh.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else o instanceof eo&&(a=o.mt(function(t){return t instanceof ws}))instanceof ws&&(null===this.Ib?this.Ib=a:this.Ib!==a&&xh.k("Cannot insert a second Placeholder into the visual tree of an Adornment."));else t===Pl&&"elements"===i&&null!==this.Ib&&(n===this.Ib?this.Ib=null:n instanceof eo&&this.Ib.Cl(n)&&(this.Ib=null));tr.prototype.kn.call(this,t,i,e,n,o,r,s)},xr.prototype.updateAdornments=function(){},xr.prototype.Um=function(){},xh.Ja(wr,tr),xh.ea("Node",wr),wr.prototype.cloneProtected=function(t){tr.prototype.cloneProtected.call(this,t),t.rr=this.rr,t.sr=this.sr,t.Qk=this.Qk,t.jr=this.jr,t.Rs=this.Rs,t.Ms=this.Ms,t.kr=this.kr,t.jq=this.jq,t.kq=this.kq.S(),t.Zr=this.Zr},wr.prototype.Zh=function(t){tr.prototype.Zh.call(this,t),t.ff(),t.wh=this.wh,t.Wd=null};var xf;wr.DirectionDefault=xf=xh.p(wr,"DirectionDefault",0),wr.DirectionAbsolute=xh.p(wr,"DirectionAbsolute",1);var wf;wr.DirectionRotatedNode=wf=xh.p(wr,"DirectionRotatedNode",2);var kf;wr.DirectionRotatedNodeOrthogonal=kf=xh.p(wr,"DirectionRotatedNodeOrthogonal",3),wr.SpreadingNone=xh.p(wr,"SpreadingNone",10);var Mf;wr.SpreadingEvenly=Mf=xh.p(wr,"SpreadingEvenly",11);var Pf;wr.SpreadingPacked=Pf=xh.p(wr,"SpreadingPacked",12),wr.prototype.invalidateLinkBundle=function(t,i,e){void 0!==i&&null!==i||(i=""),void 0!==e&&null!==e||(e=""),null!==(t=Mr(this,t,i,e))&&t.$m()},wr.prototype.kn=function(t,i,e,n,o,r,s){t===Ml&&"elements"===i?this.Wd=null:t===Pl&&"elements"===i&&(null===this.g?this.Wd=null:n instanceof Mn&&ho(this,n,function(t,i){jr(t,i,!0)})),tr.prototype.kn.call(this,t,i,e,n,o,r,s)},wr.prototype.invalidateConnectedLinks=wr.prototype.ff=function(t){void 0===t&&(t=null);for(var i=this.ue;i.next();){var e=i.value;null!==t&&t.contains(e)||(Pr(this,e.bd),Pr(this,e.Fd),e.jc())}},wr.prototype.Dl=function(){return!0},xh.defineProperty(wr,{SI:"portSpreading"},function(){return this.Zr},function(t){var i=this.Zr;i!==t&&(this.Zr=t,this.h("portSpreading",i,t),null!==(t=this.g)&&t.ma.kb||this.ff())}),xh.defineProperty(wr,{KD:"avoidable"},function(){return this.jq},function(t){var i=this.jq;if(i!==t){this.jq=t;var e=this.g;null!==e&&ln(e,this),this.h("avoidable",i,t)}}),xh.defineProperty(wr,{QG:"avoidableMargin"},function(){return this.kq},function(t){"number"==typeof t?t=new j(t):xh.A(t,j,wr,"avoidableMargin");var i=this.kq;if(!i.L(t)){this.kq=t=t.S();var e=this.g;null!==e&&ln(e,this),this.h("avoidableMargin",i,t)}}),wr.prototype.canAvoid=function(){return this.KD&&!this.vf},wr.prototype.getAvoidableRect=function(t){return t.set(this.Y),t.vw(this.QG),t},wr.prototype.findVisibleNode=function(){for(var t=this;null!==t&&!t.isVisible();)t=t.Ta;return t},wr.prototype.isVisible=function(){if(!tr.prototype.isVisible.call(this))return!1;var t=!0,i=!0,e=this.g;if(null!==e){if((t=e.Sa).uf&&null!==(t=t.Uk.ka(this))&&t.yx)return!0;t=e.Qd,i=e.UA===yu}if(i){if(null!==(e=this.rl())&&!e.qd)return!1}else if(0<(e=t?this.BH():this.CH()).count&&e.all(function(t){return!t.qd}))return!1;return null===(e=this.fe)||e.isVisible()},wr.prototype.rd=function(t){tr.prototype.rd.call(this,t);for(var i=this.ue;i.next();)i.value.rd(t)},xh.u(wr,{ue:"linksConnected"},function(){return this.fc.i}),wr.prototype.findLinksConnected=wr.prototype.iE=function(t){if(void 0===t&&(t=null),null===t)return this.fc.i;var i=new h(this.fc),e=this;return i.hn=function(i){return i.V===e&&i.vg===t||i.ba===e&&i.th===t},i},wr.prototype.findLinksOutOf=wr.prototype.Sw=function(t){void 0===t&&(t=null);var i=new h(this.fc),e=this;return i.hn=function(i){return i.V===e&&(null===t||i.vg===t)},i},wr.prototype.findLinksInto=wr.prototype.tg=function(t){void 0===t&&(t=null);var i=new h(this.fc),e=this;return i.hn=function(i){return i.ba===e&&(null===t||i.th===t)},i},wr.prototype.findNodesConnected=wr.prototype.jE=function(t){void 0===t&&(t=null);for(var i=null,e=null,n=this.fc.i;n.next();){var o=n.value;o.V===this?null!==t&&o.vg!==t||(o=o.ba,null!==i?i.add(o):null!==e&&e!==o?((i=new c(wr)).add(e),i.add(o)):e=o):o.ba!==this||null!==t&&o.th!==t||(o=o.V,null!==i?i.add(o):null!==e&&e!==o?((i=new c(wr)).add(e),i.add(o)):e=o)}return null!==i?i.i:null!==e?new s(e):kh},wr.prototype.findNodesOutOf=wr.prototype.CH=function(t){void 0===t&&(t=null);for(var i=null,e=null,n=this.fc.i;n.next();){var o=n.value;o.V!==this||null!==t&&o.vg!==t||(o=o.ba,null!==i?i.add(o):null!==e&&e!==o?((i=new c(wr)).add(e),i.add(o)):e=o)}return null!==i?i.i:null!==e?new s(e):kh},wr.prototype.findNodesInto=wr.prototype.BH=function(t){void 0===t&&(t=null);for(var i=null,e=null,n=this.fc.i;n.next();){var o=n.value;o.ba!==this||null!==t&&o.th!==t||(o=o.V,null!==i?i.add(o):null!==e&&e!==o?((i=new c(wr)).add(e),i.add(o)):e=o)}return null!==i?i.i:null!==e?new s(e):kh},wr.prototype.findLinksBetween=function(t,i,e){void 0===i&&(i=null),void 0===e&&(e=null);var n=new h(this.fc),o=this;return n.hn=function(n){return!(n.V!==o||n.ba!==t||null!==i&&n.vg!==i||null!==e&&n.th!==e)||!(n.V!==t||n.ba!==o||null!==e&&n.vg!==e||null!==i&&n.th!==i)},n},wr.prototype.findLinksTo=function(t,i,e){void 0===i&&(i=null),void 0===e&&(e=null);var n=new h(this.fc),o=this;return n.hn=function(n){return!(n.V!==o||n.ba!==t||null!==i&&n.vg!==i||null!==e&&n.th===e)},n},xh.defineProperty(wr,{rI:"linkConnected"},function(){return this.rr},function(t){var i=this.rr;i!==t&&(null!==t&&xh.j(t,"function",wr,"linkConnected"),this.rr=t,this.h("linkConnected",i,t))}),xh.defineProperty(wr,{sI:"linkDisconnected"},function(){return this.sr},function(t){var i=this.sr;i!==t&&(null!==t&&xh.j(t,"function",wr,"linkDisconnected"),this.sr=t,this.h("linkDisconnected",i,t))}),xh.defineProperty(wr,{mx:"linkValidation"},function(){return this.Qk},function(t){var i=this.Qk;i!==t&&(null!==t&&xh.j(t,"function",wr,"linkValidation"),this.Qk=t,this.h("linkValidation",i,t))}),wr.prototype.updateRelationshipsFromData=function(){tr.prototype.updateRelationshipsFromData.call(this);var t=this.data;if(null!==t){if(null!==(n=this.g)){var i=n.Z;if(i instanceof Pt){var e=i.Ym(t),n=n.bf(e),o=this.rl();n!==o&&(n=null!==o?i.ib(o.data):void 0,"function"==typeof(o=i.Dp)?o(t,n):t[o]=n,i.rh(t,e))}}}},wr.prototype.At=function(t){tr.prototype.At.call(this,t),t||(Nr(this),null!==(t=this.fo)&&Br(t,this))},wr.prototype.Bt=function(t){tr.prototype.Bt.call(this,t),t||null!==(t=this.fo)&&null!==t.Ee&&(t.Ee.remove(this),t.Q())},wr.prototype.Um=function(){if(0<this.fc.count){var t=this.g;if(null!==t)for(var i=t.ob.dE,e=this.fc.copy().i;e.next();){var n=e.value;i?t.remove(n):(n.V===this&&(n.V=null),n.ba===this&&(n.ba=null))}}this.fe=null,tr.prototype.Um.call(this)},xh.u(wr,{vf:"isLinkLabel"},function(){return null!==this.fo}),xh.defineProperty(wr,{fe:"labeledLink"},function(){return this.fo},function(t){var i=this.fo;if(i!==t){var e=this.g,n=this.data;if(null!==i&&(null!==i.Ee&&(i.Ee.remove(this),i.Q()),null!==e&&null!==n&&!e.ma.kb)){var o=i.data,r=e.Z;if(null!==o&&r instanceof wt){var s=r.ib(n);void 0!==s&&r.dF(o,s)}}this.fo=t,null!==t&&(Br(t,this),null===e||null===n||e.ma.kb||(o=t.data,r=e.Z,null!==o&&r instanceof wt&&void 0!==(s=r.ib(n))&&r.vz(o,s))),In(this),this.h("labeledLink",i,t)}}),wr.prototype.findPort=wr.prototype.ql=function(t){if(null===this.Wd){if(""===t&&!1===this.Fh)return this;Cr(this)}var i=this.Wd.ka(t);return null!==i||""!==t&&null!==(i=this.Wd.ka(""))?i:this},xh.u(wr,{port:"port"},function(){return this.ql("")}),xh.u(wr,{ports:"ports"},function(){return null===this.Wd&&Cr(this),this.Wd.NE}),wr.prototype.isInTreeOf=function(t){if(null===t||t===this)return!1;var i=!0,e=this.g;if(null!==e&&(i=e.Qd),e=this,i)for(;e!==t;){for(var i=null,n=e.fc.i;n.next();){var o=n.value;if(o.Hc&&(i=o.V)!==e&&i!==this)break}if(i===this||null===i||i===e)return!1;e=i}else for(;e!==t;){for(i=null,n=e.fc.i;n.next()&&(!(o=n.value).Hc||(i=o.ba)===e||i===this););if(i===this||null===i||i===e)return!1;e=i}return!0},wr.prototype.findTreeRoot=function(){var t=!0,i=this.g;if(null!==i&&(t=i.Qd),i=this,t)for(;;){for(var t=null,e=i.fc.i;e.next();){var n=e.value;if(n.Hc&&(t=n.V)!==i&&t!==this)break}if(t===this)return this;if(null===t||t===i)return i;i=t}else for(;;){for(t=null,e=i.fc.i;e.next()&&(!(n=e.value).Hc||(t=n.ba)===i||t===this););if(t===this)return this;if(null===t||t===i)return i;i=t}},wr.prototype.findCommonTreeParent=function(t){if(null===t)return null;if(this===t)return this;for(e=this;null!==e;)yr(e,!0),e=e.rl();for(var i=null,e=t;null!==e;){if(0!=(1048576&e.R)){i=e;break}e=e.rl()}for(e=this;null!==e;)yr(e,!1),e=e.rl();return i},wr.prototype.findTreeParentLink=wr.prototype.ep=function(){var t=!0,i=this.g;if(null!==i&&(t=i.Qd),i=this.fc.i,t){for(;i.next();)if((t=i.value).Hc&&t.V!==this)return t}else for(;i.next();)if((t=i.value).Hc&&t.ba!==this)return t;return null},wr.prototype.findTreeParentNode=wr.prototype.rl=function(){t=this.Uj;if(null===t)return null;if(t instanceof wr)return t;var t,i=!0;if(null!==(t=this.g)&&(i=t.Qd),t=this.fc.i,i){for(;t.next();)if((i=t.value).Hc&&(i=i.V)!==this)return this.Uj=i}else for(;t.next();)if((i=t.value).Hc&&(i=i.ba)!==this)return this.Uj=i;return this.Uj=null},wr.prototype.findTreeParentChain=function(){function t(i,e){if(null!==i){e.add(i);var n=i.ep();null!==n&&(e.add(n),t(i.rl(),e))}}var i=new c(tr);return t(this,i),i},wr.prototype.findTreeLevel=function(){return Lr(this,this)},wr.prototype.findTreeChildrenLinks=wr.prototype.Uw=function(){var t=!0,i=this.g;if(null!==i&&(t=i.Qd),t){var e=this;(t=new h(this.fc)).hn=function(t){return!(!t.Hc||t.V!==e)}}else t=new h(this.fc),e=this,t.hn=function(t){return!(!t.Hc||t.ba!==e)};return t},wr.prototype.findTreeChildrenNodes=wr.prototype.lE=function(){var t=!0,i=this.g;null!==i&&(t=i.Qd);var e=i=null,n=this.fc.i;if(t)for(;n.next();)(t=n.value).Hc&&t.V===this&&(t=t.ba,null!==i?i.add(t):null!==e&&e!==t?((i=new u(wr)).add(e),i.add(t)):e=t);else for(;n.next();)(t=n.value).Hc&&t.ba===this&&(t=t.V,null!==i?i.add(t):null!==e&&e!==t?((i=new u(wr)).add(e),i.add(t)):e=t);return null!==i?i.i:null!==e?new s(e):kh},wr.prototype.findTreeParts=function(t){void 0===t&&(t=1/0),xh.j(t,"number",wr,"collapseTree:level");var i=new c(tr);return Dt(i,this,!1,t,!0),i},wr.prototype.collapseTree=wr.prototype.collapseTree=function(t){void 0===t&&(t=1),xh.Ye(t,wr,"collapseTree:level"),1>t&&(t=1);var i=this.g;if(null!==i&&!i.bh){i.bh=!0;var e=new c(wr);e.add(this),Dr(this,e,i.Qd,t,i.Sa,this,i.UA===yu),i.bh=!1}},wr.prototype.expandTree=wr.prototype.expandTree=function(t){void 0===t&&(t=2),xh.Ye(t,wr,"expandTree:level"),2>t&&(t=2);var i=this.g;if(null!==i&&!i.bh){i.bh=!0;var e=new c(wr);e.add(this),Fr(this,e,i.Qd,t,i.Sa,this,i.UA===yu),i.bh=!1}},xh.defineProperty(wr,{qd:"isTreeExpanded"},function(){return this.jr},function(t){var i=this.jr;if(i!==t){this.jr=t;var e=this.g;if(this.h("isTreeExpanded",i,t),null!==(i=this.DJ)){var n=!0;null!==e&&(n=e.Ra,e.Ra=!0),i(this),null!==e&&(e.Ra=n)}null!==e&&e.ma.kb?this.rd(t):t?this.expandTree():this.collapseTree()}}),xh.defineProperty(wr,{su:"wasTreeExpanded"},function(){return this.Rs},function(t){var i=this.Rs;i!==t&&(this.Rs=t,this.h("wasTreeExpanded",i,t))}),xh.defineProperty(wr,{DJ:"treeExpandedChanged"},function(){return this.Ms},function(t){var i=this.Ms;i!==t&&(null!==t&&xh.j(t,"function",wr,"treeExpandedChanged"),this.Ms=t,this.h("treeExpandedChanged",i,t))}),xh.defineProperty(wr,{bj:"isTreeLeaf"},function(){return this.kr},function(t){var i=this.kr;i!==t&&(this.kr=t,this.h("isTreeLeaf",i,t))}),xh.Ja(zr,tr),xh.ea("Link",zr),zr.prototype.cloneProtected=function(t){tr.prototype.cloneProtected.call(this,t),t.Eh=this.Eh,t.Tq=this.Tq,t.Vh=this.Vh,t.Ls=this.Ls,t.cs=this.cs,t.ds=this.ds,t.es=this.es,t.lr=this.lr,t.cq=this.cq,t.wq=this.wq,t.Aq=this.Aq,t.Bq=this.Bq,t.wm=this.wm,t.Bs=this.Bs,null!==this.ga&&(t.ga=this.ga.copy())},zr.prototype.Zh=function(t){tr.prototype.Zh.call(this,t),this.Eh=t.Eh,this.Vh=t.Vh,t.Ge=null,t.jc(),t.gi=this.gi};var Tf;zr.Normal=Tf=xh.p(zr,"Normal",1),zr.Orthogonal=xh.p(zr,"Orthogonal",2),zr.AvoidsNodes=xh.p(zr,"AvoidsNodes",6);var Sf;zr.AvoidsNodesStraight=Sf=xh.p(zr,"AvoidsNodesStraight",7);var Nf;zr.None=Nf=xh.p(zr,"None",0);var Cf;zr.Bezier=Cf=xh.p(zr,"Bezier",9);var jf;zr.JumpGap=jf=xh.p(zr,"JumpGap",10);var Lf;zr.JumpOver=Lf=xh.p(zr,"JumpOver",11);var Df;zr.End=Df=xh.p(zr,"End",17);var Af;zr.Scale=Af=xh.p(zr,"Scale",18);var Ff;zr.Stretch=Ff=xh.p(zr,"Stretch",19);var zf;zr.OrientAlong=zf=xh.p(zr,"OrientAlong",21);var Of;zr.OrientPlus90=Of=xh.p(zr,"OrientPlus90",22);var qf;zr.OrientMinus90=qf=xh.p(zr,"OrientMinus90",23);var Bf;zr.OrientOpposite=Bf=xh.p(zr,"OrientOpposite",24);var Ef;zr.OrientUpright=Ef=xh.p(zr,"OrientUpright",25);var If;zr.OrientPlus90Upright=If=xh.p(zr,"OrientPlus90Upright",26);var Rf;zr.OrientMinus90Upright=Rf=xh.p(zr,"OrientMinus90Upright",27);var Gf;zr.OrientUpright45=Gf=xh.p(zr,"OrientUpright45",28),zr.prototype.Ne=function(){null===this.ga&&(this.ga=new ys)},zr.prototype.Dl=function(){var t=this.V;if(null!==t){var i=t.findVisibleNode();if(null!==i&&(t=i),Xn(t)||fr(t))return!1}return null===(t=this.ba)||(null!==(i=t.findVisibleNode())&&(t=i),!Xn(t)&&!fr(t))},zr.prototype.LA=function(){return!1},zr.prototype.Pd=function(){return!1},zr.prototype.computeAngle=function(t,i,e){switch(t=0,i){default:case Nf:t=0;break;case zf:t=e;break;case Of:t=e+90;break;case qf:t=e-90;break;case Bf:t=e+180;break;case Ef:90<(t=hl.Vt(e))&&270>t&&(t-=180);break;case If:90<(t=hl.Vt(e+90))&&270>t&&(t-=180);break;case Rf:90<(t=hl.Vt(e-90))&&270>t&&(t-=180);break;case Gf:if(45<(t=hl.Vt(e))&&135>t||225<t&&315>t)return 0;90<t&&270>t&&(t-=180)}return hl.Vt(t)},xh.defineProperty(zr,{V:"fromNode"},function(){return this.dg},function(t){var i=this.dg;if(i!==t){var e=this.bd;null!==i&&(this.og!==i&&Sr(i,this,e),is(this),this.H(vf)),this.dg=t,null!==t&&this.rd(t.isVisible()),this.ti=null,this.jc();var n=this.g;if(null!==n){var o=this.data,r=n.Z;if(null!==o)if(r instanceof wt){var s=null!==t?t.data:null;r.Gx(o,r.ib(s))}else r instanceof Pt&&(s=null!==t?t.data:null,n.Qd?r.rh(o,r.ib(s)):(null!==i&&r.rh(i.data,void 0),r.rh(s,r.ib(null!==this.og?this.og.data:null))))}o=this.bd,null!==(r=this.oE)&&(s=!0,null!==n&&(s=n.Ra,n.Ra=!0),r(this,e,o),null!==n&&(n.Ra=s)),null!==t&&(this.og!==t&&Tr(t,this,o),ts(this),this.H(yf)),this.h("fromNode",i,t),Or(this)}}),xh.defineProperty(zr,{vg:"fromPortId"},function(){return this.Eh},function(t){var i=this.Eh;if(i!==t){var e=this.bd;null!==e&&Pr(this.V,e),is(this),this.Eh=t;var n=this.bd;null!==n&&Pr(this.V,n);var o=this.g;if(null!==o){var r=this.data,s=o.Z;null!==r&&s instanceof wt&&s.JA(r,t)}e!==n&&(this.ti=null,this.jc(),null!==(r=this.oE)&&(s=!0,null!==o&&(s=o.Ra,o.Ra=!0),r(this,e,n),null!==o&&(o.Ra=s))),ts(this),this.h("fromPortId",i,t)}}),xh.u(zr,{bd:"fromPort"},function(){var t=this.dg;return null===t?null:t.ql(this.Eh)}),xh.defineProperty(zr,{oE:"fromPortChanged"},function(){return this.Tq},function(t){var i=this.Tq;i!==t&&(null!==t&&xh.j(t,"function",zr,"fromPortChanged"),this.Tq=t,this.h("fromPortChanged",i,t))}),xh.defineProperty(zr,{ba:"toNode"},function(){return this.og},function(t){var i=this.og;if(i!==t){var e=this.Fd;null!==i&&(this.dg!==i&&Sr(i,this,e),is(this),this.H(vf)),this.og=t,null!==t&&this.rd(t.isVisible()),this.ti=null,this.jc();var n=this.g;if(null!==n){var o=this.data,r=n.Z;if(null!==o)if(r instanceof wt){var s=null!==t?t.data:null;r.Kx(o,r.ib(s))}else r instanceof Pt&&(s=null!==t?t.data:null,n.Qd?(null!==i&&r.rh(i.data,void 0),r.rh(s,r.ib(null!==this.dg?this.dg.data:null))):r.rh(o,r.ib(s)))}o=this.Fd,null!==(r=this.FF)&&(s=!0,null!==n&&(s=n.Ra,n.Ra=!0),r(this,e,o),null!==n&&(n.Ra=s)),null!==t&&(this.dg!==t&&Tr(t,this,o),ts(this),this.H(yf)),this.h("toNode",i,t),Or(this)}}),xh.defineProperty(zr,{th:"toPortId"},function(){return this.Vh},function(t){var i=this.Vh;if(i!==t){var e=this.Fd;null!==e&&Pr(this.ba,e),is(this),this.Vh=t;var n=this.Fd;null!==n&&Pr(this.ba,n);var o=this.g;if(null!==o){var r=this.data,s=o.Z;null!==r&&s instanceof wt&&s.MA(r,t)}e!==n&&(this.ti=null,this.jc(),null!==(r=this.FF)&&(s=!0,null!==o&&(s=o.Ra,o.Ra=!0),r(this,e,n),null!==o&&(o.Ra=s))),ts(this),this.h("toPortId",i,t)}}),xh.u(zr,{Fd:"toPort"},function(){var t=this.og;return null===t?null:t.ql(this.Vh)}),xh.defineProperty(zr,{FF:"toPortChanged"},function(){return this.Ls},function(t){var i=this.Ls;i!==t&&(null!==t&&xh.j(t,"function",zr,"toPortChanged"),this.Ls=t,this.h("toPortChanged",i,t))}),xh.defineProperty(zr,{Ab:"fromSpot"},function(){return null!==this.ga?this.ga.rj:jh},function(t){this.Ne();var i=this.ga.rj;i.L(t)||(t=t.S(),this.ga.rj=t,this.h("fromSpot",i,t),this.jc())}),xh.defineProperty(zr,{sl:"fromEndSegmentLength"},function(){return null!==this.ga?this.ga.pj:NaN},function(t){this.Ne();var i=this.ga.pj;i!==t&&(0>t&&xh.wa(t,">= 0",zr,"fromEndSegmentLength"),this.ga.pj=t,this.h("fromEndSegmentLength",i,t),this.jc())}),xh.defineProperty(zr,{vt:"fromEndSegmentDirection"},function(){return null!==this.ga?this.ga.oj:xf},function(t){this.Ne();var i=this.ga.oj;i!==t&&(this.ga.oj=t,this.h("fromEndSegmentDirection",i,t),this.jc())}),xh.defineProperty(zr,{wt:"fromShortLength"},function(){return null!==this.ga?this.ga.qj:NaN},function(t){this.Ne();var i=this.ga.qj;i!==t&&(this.ga.qj=t,this.h("fromShortLength",i,t),this.jc())}),xh.defineProperty(zr,{Bb:"toSpot"},function(){return null!==this.ga?this.ga.Tj:jh},function(t){this.Ne();var i=this.ga.Tj;i.L(t)||(t=t.S(),this.ga.Tj=t,this.h("toSpot",i,t),this.jc())}),xh.defineProperty(zr,{Ql:"toEndSegmentLength"},function(){return null!==this.ga?this.ga.Rj:NaN},function(t){this.Ne();var i=this.ga.Rj;i!==t&&(0>t&&xh.wa(t,">= 0",zr,"toEndSegmentLength"),this.ga.Rj=t,this.h("toEndSegmentLength",i,t),this.jc())}),xh.defineProperty(zr,{pu:"toEndSegmentDirection"},function(){return null!==this.ga?this.ga.Qj:xf},function(t){this.Ne();var i=this.ga.Qj;i!==t&&(this.ga.Qj=t,this.h("toEndSegmentDirection",i,t),this.jc())}),xh.defineProperty(zr,{qu:"toShortLength"},function(){return null!==this.ga?this.ga.Sj:NaN},function(t){this.Ne();var i=this.ga.Sj;i!==t&&(this.ga.Sj=t,this.h("toShortLength",i,t),this.jc())}),zr.prototype.zl=function(){var t=this.Ta;null!==t&&this.V!==t&&this.ba!==t&&t.Iw&&tr.prototype.zl.call(this)},zr.prototype.getOtherNode=zr.prototype.Sz=function(t){var i=this.V;return t===i?this.ba:i},zr.prototype.getOtherPort=function(t){var i=this.bd;return t===i?this.Fd:i},xh.u(zr,{KK:"isLabeledLink"},function(){return null!==this.Ee&&0<this.Ee.count}),xh.u(zr,{Sf:"labelNodes"},function(){return null===this.Ee?kh:this.Ee.i}),zr.prototype.At=function(t){tr.prototype.At.call(this,t),Qr(this)&&$r(this,this.Y),t||(null!==(t=this.dg)&&Tr(t,this,this.bd),null!==(t=this.og)&&Tr(t,this,this.Fd),ts(this))},zr.prototype.Bt=function(t){tr.prototype.Bt.call(this,t),Qr(this)&&$r(this,this.Y),t||(null!==(t=this.dg)&&Sr(t,this,this.bd),null!==(t=this.og)&&Sr(t,this,this.Fd),is(this))},zr.prototype.Um=function(){if(this.Mf=!0,null!==this.Ee){var t=this.g;if(null!==t)for(var i=this.Ee.copy().i;i.next();)t.remove(i.value)}null!==(i=this.data)&&null!==(t=this.g)&&((t=t.Z)instanceof wt?t.zx(i):t instanceof Pt&&t.rh(i,void 0))},zr.prototype.updateRelationshipsFromData=function(){var t=this.data;if(null!==t){var i=this.g;if(null!==i){var e=i.Z;if(e instanceof wt){var n=e.vl(t),o=i.bf(n),r=this.V;o!==r&&(o=null!==r?e.ib(r.data):void 0,"function"==typeof(r=e.qp)?r(t,o):t[r]=o,e.Gx(t,n)),n=e.yl(t),(o=i.bf(n))!==(r=this.ba)&&(o=null!==r?e.ib(r.data):void 0,"function"==typeof(r=e.sp)?r(t,o):t[r]=o,e.Kx(t,n));var s=e.dk(t);if(0<s.length||0<this.Sf.count){if(1===s.length&&1===this.Sf.count&&(i=s[0],n=this.Sf.first(),e.ib(n.data)===i))return;var n=(new c).Tc(s),a=new c;this.Sf.each(function(t){null!==t.data&&void 0!==(t=e.ib(t.data))&&a.add(t)}),(i=a.copy()).CA(n),(n=n.copy()).CA(a),(0<i.count||0<n.count)&&(s.length=0,a.each(function(t){s.push(t)}),i.each(function(i){e.dF(t,i)}),n.each(function(i){e.vz(t,i)}))}}}}},zr.prototype.move=function(t){var i=this.position,e=i.x;for(isNaN(e)&&(e=0),i=i.y,isNaN(i)&&(i=0),e=t.x-e,i=t.y-i,tr.prototype.move.call(this,t),this.Gl(e,i),t=this.Sf;t.next();){var n=t.value,o=n.position;n.moveTo(o.x+e,o.y+i)}},xh.defineProperty(zr,{VI:"relinkableFrom"},function(){return this.cs},function(t){var i=this.cs;i!==t&&(this.cs=t,this.h("relinkableFrom",i,t),this.be())}),xh.defineProperty(zr,{WI:"relinkableTo"},function(){return this.ds},function(t){var i=this.ds;i!==t&&(this.ds=t,this.h("relinkableTo",i,t),this.be())}),zr.prototype.canRelinkFrom=function(){if(!this.VI)return!1;var t=this.layer;return null===t||!!t.Im&&!(null!==(t=t.g)&&!t.Im)},zr.prototype.canRelinkTo=function(){if(!this.WI)return!1;var t=this.layer;return null===t||!!t.Im&&!(null!==(t=t.g)&&!t.Im)},xh.defineProperty(zr,{bu:"resegmentable"},function(){return this.es},function(t){var i=this.es;i!==t&&(this.es=t,this.h("resegmentable",i,t),this.be())}),xh.defineProperty(zr,{Hc:"isTreeLink"},function(){return this.lr},function(t){var i=this.lr;i!==t&&(this.lr=t,this.h("isTreeLink",i,t),null!==this.V&&Nr(this.V),null!==this.ba&&Nr(this.ba))}),xh.u(zr,{path:"path"},function(){var t=this.af();return t instanceof To?t:null}),xh.u(zr,{ln:"routeBounds"},function(){this.pn();var t=new M,i=1/0,e=1/0,n=this.pa;if(0===n)t.m(NaN,NaN,0,0);else{if(1===n)n=this.l(0),i=Math.min(n.x,i),e=Math.min(n.y,e),t.m(n.x,n.y,0,0);else if(2===n){var o=this.l(0),r=this.l(1),i=Math.min(o.x,r.x),e=Math.min(o.y,r.y);t.m(o.x,o.y,0,0),t.gj(r)}else if(this.computeCurve()===Cf&&3<=n&&!this.kc)if(o=this.l(0),i=o.x,e=o.y,t.m(i,e,0,0),3===n)n=this.l(1),i=Math.min(n.x,i),e=Math.min(n.y,e),r=this.l(2),i=Math.min(r.x,i),e=Math.min(r.y,e),hl.Ro(o.x,o.y,n.x,n.y,n.x,n.y,r.x,r.y,.5,t);else for(var s=3;s<n;s+=3){var a=this.l(s-2);s+3>=n&&(s=n-1);var h=this.l(s-1),r=this.l(s);hl.Ro(o.x,o.y,a.x,a.y,h.x,h.y,r.x,r.y,.5,t),i=Math.min(r.x,i),e=Math.min(r.y,e),o=r}else for(o=this.l(0),r=this.l(1),i=Math.min(o.x,r.x),e=Math.min(o.y,r.y),t.m(o.x,o.y,0,0),t.gj(r),s=2;s<n;s++)o=this.l(s),i=Math.min(o.x,i),e=Math.min(o.y,e),t.gj(o);this.lz.m(i-t.x,e-t.y)}return this.Wv=t}),xh.u(zr,{TE:"midPoint"},function(){return this.pn(),this.computeMidPoint(new b)}),zr.prototype.computeMidPoint=function(t){n=this.pa;if(0===n)return t.assign(hl.ZF),t;if(1===n)return t.assign(this.l(0)),t;if(2===n){var i=this.l(0),e=this.l(1);return t.m((i.x+e.x)/2,(i.y+e.y)/2),t}if(this.computeCurve()===Cf&&3<=n&&!this.kc){if(3===n)return this.l(1);var n,o=3*((n=(n-1)/3|0)/2|0);return 1==n%2?(i=this.l(o),e=this.l(o+1),n=this.l(o+2),o=this.l(o+3),hl.TG(i.x,i.y,e.x,e.y,n.x,n.y,o.x,o.y,t)):t.assign(this.l(o)),t}for(var o=0,r=xh.lb(),s=0;s<n-1;s++)i=0,i=this.l(s),e=this.l(s+1),hl.Qa(i.x,e.x)?0>(i=e.y-i.y)&&(i=-i):hl.Qa(i.y,e.y)?0>(i=e.x-i.x)&&(i=-i):i=Math.sqrt(i.$j(e)),r.push(i),o+=i;for(e=s=i=0;i<o/2&&s<n&&(e=r[s],!(i+e>o/2));)i+=e,s++;return xh.ta(r),n=this.l(s),r=this.l(s+1),n.x===r.x?n.y>r.y?t.m(n.x,n.y-(o/2-i)):t.m(n.x,n.y+(o/2-i)):n.y===r.y?n.x>r.x?t.m(n.x-(o/2-i),n.y):t.m(n.x+(o/2-i),n.y):(o=(o/2-i)/e,t.m(n.x+o*(r.x-n.x),n.y+o*(r.y-n.y))),t},xh.u(zr,{SE:"midAngle"},function(){return this.pn(),this.computeMidAngle()}),zr.prototype.computeMidAngle=function(){if(2>(i=this.pa))return NaN;if(this.computeCurve()===Cf&&4<=i&&!this.kc){t=3*((e=(i-1)/3|0)/2|0);if(1==e%2){var t=Math.floor(t),i=this.l(t),e=this.l(t+1),n=this.l(t+2),t=this.l(t+3);return hl.SG(i.x,i.y,e.x,e.y,n.x,n.y,t.x,t.y)}if(0<t&&t+1<i)return i=this.l(t-1),e=this.l(t+1),i.ah(e)}if(n=i/2|0,0==i%2)return i=this.l(n-1),e=this.l(n),i.ah(e);var i=this.l(n-1),e=this.l(n),n=this.l(n+1),t=i.$j(e),o=e.$j(n);return t>o+10?i.ah(e):o>t+10?e.ah(n):i.ah(n)},xh.defineProperty(zr,{points:"points"},function(){return this.Zc},function(t){var i=this.Zc;if(i!==t){var e=null;if(Array.isArray(t)){if(r=0==t.length%2)for(var n=0;n<t.length;n++)if("number"!=typeof t[n]||isNaN(t[n])){r=!1;break}if(r)for(e=new u(b),r=0;r<t.length/2;r++)n=new b(t[2*r],t[2*r+1]).freeze(),e.add(n);else{for(var o=!0,r=0;r<t.length;r++)if(n=t[r],!xh.Va(n)||"number"!=typeof n.x||isNaN(n.x)||"number"!=typeof n.y||isNaN(n.y)){o=!1;break}if(o)for(e=new u(b),r=0;r<t.length;r++)n=t[r],e.add(new b(n.x,n.y).freeze());else xh.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+t)}}else if(t instanceof u)for(e=t.copy(),t=e.i;t.next();)t.value.freeze();else xh.k("Link.points value is not an instance of List or Array: "+t);e.freeze(),this.Zc=e,this.se(),this.Q(),Er(this),null!==(t=this.g)&&(t.bn||t.ma.kb||t.nx.add(this),t.Sa.vc&&(this.wo=e)),this.h("points",i,e)}}),xh.u(zr,{pa:"pointsCount"},function(){return this.Zc.count}),zr.prototype.getPoint=zr.prototype.l=function(t){return this.Zc.n[t]},zr.prototype.setPoint=zr.prototype.Af=function(t,i){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.Dg(t,i)},zr.prototype.setPointAt=zr.prototype.W=function(t,i,e){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.Dg(t,new b(i,e))},zr.prototype.insertPoint=function(t,i){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.Cd(t,i)},zr.prototype.insertPointAt=zr.prototype.w=function(t,i,e){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.Cd(t,new b(i,e))},zr.prototype.addPoint=zr.prototype.Wh=function(t){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.add(t)},zr.prototype.addPointAt=zr.prototype.dl=function(t,i){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.add(new b(t,i))},zr.prototype.removePoint=zr.prototype.eF=function(t){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.Vc(t)},zr.prototype.clearPoints=zr.prototype.Vo=function(){null===this.Ge&&xh.k("Call Link.startRoute before modifying the points of the route."),this.Zc.clear()},zr.prototype.movePoints=zr.prototype.Gl=function(t,i){for(var e=new u(b),n=this.Zc.i;n.next();){var o=n.value;e.add(new b(o.x+t,o.y+i).freeze())}e.freeze(),n=this.Zc,this.Zc=e,this.Q(),Er(this),null!==(o=this.g)&&o.Sa.vc&&(this.wo=e),this.h("points",n,e)},zr.prototype.startRoute=zr.prototype.Ml=function(){null===this.Ge&&(this.Ge=this.Zc,this.Zc=this.Zc.copy())},zr.prototype.commitRoute=zr.prototype.Ui=function(){if(null!==this.Ge){for(var t=this.Ge,i=this.Zc,e=1/0,n=1/0,o=t.n,r=o.length,s=0;s<r;s++)var a=o[s],e=Math.min(a.x,e),n=Math.min(a.y,n);for(var h=1/0,l=1/0,u=i.n,f=u.length,s=0;s<f;s++)a=u[s],h=Math.min(a.x,h),l=Math.min(a.y,l),a.freeze();if(i.freeze(),f===r){for(s=0;s<f;s++)if(r=o[s],a=u[s],r.x-e!=a.x-h||r.y-n!=a.y-l){this.Q(),this.se();break}}else this.Q(),this.se();this.Ge=null,null!==(e=this.g)&&e.Sa.vc&&(this.wo=i),Er(this),this.h("points",t,i)}},zr.prototype.rollbackRoute=zr.prototype.aJ=function(){null!==this.Ge&&(this.Zc=this.Ge,this.Ge=null)},zr.prototype.invalidateRoute=zr.prototype.jc=function(){if(!(this.iz||this.g&&(this.g.nx.contains(this)||this.g.ma.kb))){var t=this.path;if(null!==t){if(this.Mf){var i=this.bd;null!==i&&null!==(i=i.um)&&i.$m(),null!==(i=this.Fd)&&null!==(i=i.um)&&i.$m()}this.Mf=!1,this.Q(),t.Q()}}},xh.defineProperty(zr,{Sp:"suspendsRouting"},function(){return this.iz},function(t){this.iz=t}),zr.prototype.updateRoute=zr.prototype.pn=function(){if(!this.Mf&&!this.my){var t=!0;try{this.my=!0,this.Ml(),t=this.computePoints()}finally{this.my=!1,t?this.Ui():this.aJ()}}},zr.prototype.computePoints=function(){if(null===(o=this.g))return!1;var t=this.V,i=null;if(null===t?(o.xm||(o.Xv=new To,o.Xv.ya=hl.Xp,o.Xv.pb=0,o.xm=new wr,o.xm.add(o.Xv),o.xm.rf()),this.Hn&&(o.xm.position=o.xm.location=this.Hn,o.xm.rf(),t=o.xm,i=o.Xv)):i=this.bd,null!==i){(e=Zn(i))!==t&&t.isVisible()?i=e:null!==(e=t.findVisibleNode())&&e!==t?(t=e,i=e.ql("")):t=e}if(this.eD=t,null===t||null===i||!t.location.K())return!1;var e=this.ba,n=null;if(null===e?(o.ym||(o.Yv=new To,o.Yv.ya=hl.Xp,o.Yv.pb=0,o.ym=new wr,o.ym.add(o.Yv),o.ym.rf()),this.Ln&&(o.ym.position=o.ym.location=this.Ln,o.ym.rf(),e=o.ym,n=o.Yv)):n=this.Fd,null!==n&&((o=Zn(n))!==e&&e.isVisible()?n=o:null!==(o=e.findVisibleNode())&&o!==e?(e=o,n=o.ql("")):e=o),this.gD=e,null===e||null===n||!e.location.K())return!1;var o=this.pa,r=Gr(this,i),s=Vr(this,n),a=i===n&&null!==i,h=this.kc,l=this.Le===Cf;this.ti=!(!a||h)&&(l=!0);var u=this.Ys===Nf||a;if(h||r!==Ch||s!==Ch||a){l=this.Al,u&&(h&&l||a)&&this.Vo();var f=a?this.computeCurviness():0,c=this.getLinkPoint(t,i,r,!0,h,e,n),p=0,d=0,y=0;if(h||r!==Ch||a){var v=this.computeEndSegmentLength(t,i,r,!0),y=this.getLinkDirection(t,i,c,r,!0,h,e,n);if(a&&(y-=h?90:30,0>f&&(y-=180)),0>y?y+=360:360<=y&&(y-=360),a&&(v+=Math.abs(f)),0===y?p=v:90===y?d=v:180===y?p=-v:270===y?d=-v:(p=v*Math.cos(y*Math.PI/180),d=v*Math.sin(y*Math.PI/180)),r.te()&&a){var g=i.Za(zh,xh.M()),m=xh.Ob(g.x+1e3*p,g.y+1e3*d);this.getLinkPointFromPoint(t,i,g,m,!0,c),xh.v(g),xh.v(m)}}var v=this.getLinkPoint(e,n,s,!1,h,t,i),x=0,w=0,k=0;(h||s!==Ch||a)&&(g=this.computeEndSegmentLength(e,n,s,!1),k=this.getLinkDirection(e,n,v,s,!1,h,t,i),a&&(k+=h?0:30,0>f&&(k+=180)),0>k?k+=360:360<=k&&(k-=360),a&&(g+=Math.abs(f)),0===k?x=g:90===k?w=g:180===k?x=-g:270===k?w=-g:(x=g*Math.cos(k*Math.PI/180),w=g*Math.sin(k*Math.PI/180)),s.te()&&a&&(g=n.Za(zh,xh.M()),m=xh.Ob(g.x+1e3*x,g.y+1e3*w),this.getLinkPointFromPoint(e,n,g,m,!1,v),xh.v(g),xh.v(m))),n=c,(h||r!==Ch||a)&&(n=new b(c.x+p,c.y+d)),i=v,(h||s!==Ch||a)&&(i=new b(v.x+x,v.y+w)),!u&&!h&&r===Ch&&3<o&&this.adjustPoints(0,c,o-2,i)?this.Af(o-1,v):!u&&!h&&s===Ch&&3<o&&this.adjustPoints(1,n,o-1,v)?this.Af(0,c):!u&&!h&&4<o&&this.adjustPoints(1,n,o-2,i)?(this.Af(0,c),this.Af(o-1,v)):!u&&h&&6<=o&&!l&&this.adjustPoints(1,n,o-2,i)?(this.Af(0,c),this.Af(o-1,v)):(this.Vo(),this.Wh(c),(h||r!==Ch||a)&&this.Wh(n),h&&this.addOrthoPoints(n,y,i,k,t,e),(h||s!==Ch||a)&&this.Wh(i),this.Wh(v))}else r=!1,!u&&3<=o&&(u=this.getLinkPoint(t,i,Ch,!0,!1,e,n),s=this.getLinkPoint(e,n,Ch,!1,!1,t,i),r=this.adjustPoints(0,u,o-1,s))&&(u=this.getLinkPoint(t,i,Ch,!0,!1,e,n),s=this.getLinkPoint(e,n,Ch,!1,!1,t,i),this.adjustPoints(0,u,o-1,s)),r||(this.Vo(),l?(o=this.getLinkPoint(t,i,Ch,!0,!1,e,n),u=this.getLinkPoint(e,n,Ch,!1,!1,t,i),r=u.x-o.x,s=u.y-o.y,a=this.computeCurviness(),l=h=0,c=o.x+r/3,y=o.y+s/3,p=c,d=y,hl.G(s,0)?d=0<r?d-a:d+a:(h=-r/s,l=Math.sqrt(a*a/(h*h+1)),0>a&&(l=-l),p=(0>s?-1:1)*l+c,d=h*(p-c)+y),c=o.x+2*r/3,y=o.y+2*s/3,v=c,x=y,hl.G(s,0)?x=0<r?x-a:x+a:(v=(0>s?-1:1)*l+c,x=h*(v-c)+y),this.Vo(),this.Wh(o),this.dl(p,d),this.dl(v,x),this.Wh(u),this.Af(0,this.getLinkPoint(t,i,Ch,!0,!1,e,n)),this.Af(3,this.getLinkPoint(e,n,Ch,!1,!1,t,i))):(o=e,e=this.getLinkPoint(t,i,Ch,!0,!1,o,n),n=this.getLinkPoint(o,n,Ch,!1,!1,t,i),this.hasCurviness()?(s=n.x-e.x,t=n.y-e.y,i=this.computeCurviness(),o=e.x+s/2,u=e.y+t/2,r=o,a=u,hl.G(t,0)?a=0<s?a-i:a+i:(s=-s/t,r=Math.sqrt(i*i/(s*s+1)),0>i&&(r=-r),r=(0>t?-1:1)*r+o,a=s*(r-o)+u),this.Wh(e),this.dl(r,a)):this.Wh(e),this.Wh(n)));return!0},zr.prototype.getLinkPointFromPoint=function(t,i,e,n,o,r){if(void 0===r&&(r=new b),null===t||null===i)return r.assign(e),r;t.isVisible()||null!==(o=t.findVisibleNode())&&o!==t&&(i=o.port);var s=o=0,a=0,h=0;if(t=null,null===(o=i.T)||o.Gg()||(o=o.T),null===o)o=n.x,s=n.y,a=e.x,h=e.y;else{o=1/((t=o.Xg).m11*t.m22-t.m12*t.m21);var a=t.m22*o,h=-t.m12*o,l=-t.m21*o,u=t.m11*o,f=o*(t.m21*t.dy-t.m22*t.dx),c=o*(t.m12*t.dx-t.m11*t.dy);o=n.x*a+n.y*l+f,s=n.x*h+n.y*u+c,a=e.x*a+e.y*l+f,h=e.x*h+e.y*u+c}return i.ip(o,s,a,h,r),null!==t&&r.transform(t),r},zr.prototype.getLinkPoint=function(t,i,e,n,o,r,s,a){if(void 0===a&&(a=new b),e.ed())return i.Za(e,a),a;if(e.$i()&&null!==(e=Rr(this,i))){if(a.assign(e.rp),o&&this.Cx===Sf){if(null!==(h=Rr(this,s))&&e.Rm<h.Rm){e=xh.M();var h=xh.M(),l=new M(i.Za(Lh,e),i.Za(Eh,h)),u=this.computeSpot(!n);(t=this.getLinkPoint(r,s,u,!n,o,t,i,h)).x>=l.x&&t.x<=l.x+l.width?a.x=t.x:t.y>=l.y&&t.y<=l.y+l.height&&(a.y=t.y),xh.v(e),xh.v(h)}}return a}return r=i.Za(zh,xh.M()),h=e=null,this.pa>(o?6:2)?(h=n?this.l(1):this.l(this.pa-2),o&&(h=Ir(r,h.copy()))):(e=xh.M(),h=s.Za(zh,e),o&&(h=Ir(r,h))),this.getLinkPointFromPoint(t,i,r,h,n,a),xh.v(r),null!==e&&xh.v(e),a},zr.prototype.getLinkDirection=function(t,i,e,n,o,r,s,a){t:if(n.ed())e=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x<n.y?n.x>1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5<n.x?45:0;else{if(n.$i()){if(null!==(h=Rr(this,i)))switch(h.ge){case xh.gd:e=270;break t;case xh.Nc:e=180;break t;default:case xh.Xc:e=0;break t;case xh.Wc:e=90;break t}}var h=i.Za(zh,xh.M()),l=null,u=null;this.pa>(r?6:2)?(u=o?this.l(1):this.l(this.pa-2),u=r?Ir(h,u.copy()):e):(l=xh.M(),u=a.Za(zh,l)),e=0,e=Math.abs(u.x-h.x)>Math.abs(u.y-h.y)?u.x>=h.x?0:180:u.y>=h.y?90:270,xh.v(h),null!==l&&xh.v(l)}switch(n.te()&&s.ai(t)&&360<=(e+=180)&&(e-=360),t=xf,(t=o?this.vt:this.pu)===xf&&(t=o?i.vt:i.pu),t){case wf:360<=(e+=i=i.ul())&&(e-=360);break;case xf:case kf:if(0===(i=i.ul()))break;45<=i&&135>i?e+=90:135<=i&&225>i?e+=180:225<=i&&315>i&&(e+=270),360<=e&&(e-=360)}return e},zr.prototype.computeEndSegmentLength=function(t,i,e,n){return null!==i&&e.$i()&&null!==(t=Rr(this,i))?t.Ow:(t=NaN,t=n?this.sl:this.Ql,null!==i&&isNaN(t)&&(t=n?i.sl:i.Ql),isNaN(t)&&(t=10),t)},zr.prototype.computeSpot=function(t){return t?Gr(this,this.bd):Vr(this,this.Fd)},zr.prototype.computeOtherPoint=function(t,i){var e,n=i.Za(zh);return e=i.um,null!==(e=null!==e?ps(e,this):null)&&(n=e.rp),n},zr.prototype.computeShortLength=function(t){return t?Hr(this):Kr(this)},zr.prototype.bk=function(t,i,e,n,o,r){if(!1===this.Cg)return!1;void 0===i&&(i=null),void 0===e&&(e=null);var s=r;if(void 0===r&&(s=xh.sh()).reset(),s.multiply(this.transform),this.Om(t,s))return yo(this,i,e,o),void 0===r&&xh.cf(s),!0;if(this.xg(t,s)){c=!1;if(!this.Mg)for(var a=this.Aa.n,h=a.length;h--;){var l=a[h];if(l.visible||l===this.bc){var u=l.Y,f=this.Ia;if(!(u.x>f.width||u.y>f.height||0>u.x+u.width||0>u.y+u.height)){if((u=xh.sh()).set(s),l instanceof eo)c=l.bk(t,i,e,n,o,u);else if(this.path===l){var c,p=t,d=n,f=u;if(!1===(c=l).Cg)c=!1;else if(f.multiply(c.transform),d)t:{var y=p,v=f;if(c.Om(y,v))c=!0;else{if(void 0===v&&(v=c.transform,y.Zj(c.Y))){c=!0;break t}var f=y.left,p=y.right,d=y.top,y=y.bottom,g=xh.M(),m=xh.M(),b=xh.M(),x=xh.sh();x.set(v),x.VE(c.transform),x.Xz(),m.x=p,m.y=d,m.transform(x),g.x=f,g.y=d,g.transform(x),v=!1,Ao(c,g,m,b)?v=!0:(g.x=p,g.y=y,g.transform(x),Ao(c,g,m,b)?v=!0:(m.x=f,m.y=y,m.transform(x),Ao(c,g,m,b)?v=!0:(g.x=f,g.y=d,g.transform(x),Ao(c,g,m,b)&&(v=!0)))),xh.cf(x),xh.v(g),xh.v(m),xh.v(b),c=v}}else c=c.Om(p,f)}else c=Cn(l,t,n,u);c&&(null!==i&&(l=i(l)),l&&(null===e||e(l))&&o.add(l)),xh.cf(u)}}}return void 0===r&&xh.cf(s),c||null!==this.background||null!==this.Jm}return void 0===r&&xh.cf(s),!1},xh.u(zr,{kc:"isOrthogonal"},function(){return 2==(2&this.wm.value)}),xh.u(zr,{Al:"isAvoiding"},function(){return 4==(4&this.wm.value)}),zr.prototype.computeCurve=function(){if(null===this.ti){var t=this.bd,i=this.kc;this.ti=null!==t&&t===this.Fd&&!i}return this.ti?Cf:this.Le},zr.prototype.computeCorner=function(){if(this.Le===Cf)return 0;var t=this.Hz;return(isNaN(t)||0>t)&&(t=10),t},zr.prototype.findMidLabel=function(){for(var t=this.path,i=this.Aa.n,e=i.length,n=0;n<e;n++){var o=i[n];if(o!==t&&!o.Rf&&(-1/0===o.ve||isNaN(o.ve)))return o}for(t=this.Sf;t.next();)if(i=t.value,-1/0===i.ve||isNaN(i.ve))return i;return null},zr.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var t;t=Math.max(14,this.computeThickness());var i=this.bd,e=this.Fd;if(null!==i&&null!==e){n=this.findMidLabel();if(null!==n){var n,o=n.Ia,r=n.margin,s=isNaN(o.width)?30:o.width*n.scale+r.left+r.right,o=isNaN(o.height)?14:o.height*n.scale+r.top+r.bottom;(n=n.fu)===zf||n===Ef||n===Bf?t=Math.max(t,o):n===qf||n===Rf||n===Of||n===If?t=Math.max(t,s):(i=i.Za(zh).ah(e.Za(zh))/180*Math.PI,t=Math.max(t,Math.abs(Math.sin(i)*s)+Math.abs(Math.cos(i)*o)+1)),this.Le===Cf&&(t*=1.333)}}return t},zr.prototype.arrangeBundledLinks=function(t,i){if(i)for(var e=0;e<t.length;e++)t[e].jc()},zr.prototype.computeCurviness=function(){t=this.Kw;if(isNaN(t)){var t=16,i=this.gi;if(null!==i){for(var e=xh.lb(),n=0,o=i.links,r=0;r<o.length;r++){var s=(s=o[r]).computeSpacing();e.push(s),n+=s}for(n=-n/2,r=0;r<o.length;r++){if((s=o[r])===this){t=n+e[r]/2;break}n+=e[r]}i.Bp===this.V&&(t=-t),xh.ta(e)}}return t},zr.prototype.computeThickness=function(){if(!this.isVisible())return 0;var t=this.path;return null!==t?Math.max(t.pb,1):1},zr.prototype.hasCurviness=function(){return!isNaN(this.Kw)||null!==this.gi},zr.prototype.adjustPoints=function(t,i,e,n){s=this.Ys;if(this.kc){if(s===Af)return!1;s===Ff&&(s=Df)}switch(s){case Af:var o=this.l(t),r=this.l(e);if(!o.od(i)||!r.od(n)){var s=o.x,o=o.y,a=r.x-s,h=r.y-o,l=Math.sqrt(a*a+h*h);if(!hl.Qa(l,0)){p=0;hl.Qa(a,0)?p=0>h?-Math.PI/2:Math.PI/2:(p=Math.atan(h/Math.abs(a)),0>a&&(p=Math.PI-p));var r=i.x,u=i.y,h=n.x-r,f=n.y-u,c=Math.sqrt(h*h+f*f),a=0;for(hl.Qa(h,0)?a=0>f?-Math.PI/2:Math.PI/2:(a=Math.atan(f/Math.abs(h)),0>h&&(a=Math.PI-a)),l=c/l,p=a-p,this.Af(t,i),t+=1;t<e;t++)i=this.l(t),a=i.x-s,h=i.y-o,i=Math.sqrt(a*a+h*h),hl.Qa(i,0)||(f=0,hl.Qa(a,0)?f=0>h?-Math.PI/2:Math.PI/2:(f=Math.atan(h/Math.abs(a)),0>a&&(f=Math.PI-f)),a=f+p,i*=l,this.W(t,r+i*Math.cos(a),u+i*Math.sin(a)));this.Af(e,n)}}return!0;case Ff:if(o=this.l(t),u=this.l(e),!o.od(i)||!u.od(n)){var s=o.x,o=o.y,l=((r=u.x)-s)*(r-s)+((u=u.y)-o)*(u-o),a=i.x,p=i.y,h=n.x,f=n.y,c=0,d=1;for(0!=h-a?(c=(f-p)/(h-a),d=Math.sqrt(1+1/(c*c))):c=9e9,this.Af(t,i),t+=1;t<e;t++){var y=(i=this.l(t)).x,v=i.y,g=.5;0!==l&&(g=((s-y)*(s-r)+(o-v)*(o-u))/l);var m=s+g*(r-s),b=o+g*(u-o);i=Math.sqrt((y-m)*(y-m)+(v-b)*(v-b)),v<c*(y-m)+b&&(i=-i),0<c&&(i=-i),y=a+g*(h-a),g=p+g*(f-p),0!==c?(i=y+i/d,this.W(t,i,g-(i-y)/c)):this.W(t,y,g+i)}this.Af(e,n)}return!0;case Df:return this.kc&&(s=this.l(t),o=this.l(t+1),r=this.l(t+2),hl.G(s.y,o.y)?hl.G(o.x,r.x)?this.W(t+1,o.x,i.y):hl.G(o.y,r.y)&&this.W(t+1,i.x,o.y):hl.G(s.x,o.x)&&(hl.G(o.y,r.y)?this.W(t+1,i.x,o.y):hl.G(o.x,r.x)&&this.W(t+1,o.x,i.y)),s=this.l(e),o=this.l(e-1),r=this.l(e-2),hl.G(s.y,o.y)?hl.G(o.x,r.x)?this.W(e-1,o.x,n.y):hl.G(o.y,r.y)&&this.W(e-1,n.x,o.y):hl.G(s.x,o.x)&&(hl.G(o.y,r.y)?this.W(e-1,n.x,o.y):hl.G(o.x,r.x)&&this.W(e-1,o.x,n.y))),this.Af(t,i),this.Af(e,n),!0;default:return!1}},zr.prototype.addOrthoPoints=function(t,i,e,n,o,r){i=-45<=i&&45>i?0:45<=i&&135>i?90:135<=i&&225>i?180:270,n=-45<=n&&45>n?0:45<=n&&135>n?90:135<=n&&225>n?180:270;var s=o.Y.copy(),a=r.Y.copy();if(s.K()&&a.K()){s.Qf(8,8),a.Qf(8,8),s.gj(t),a.gj(e);var h,l;0===i?e.x>t.x||270===n&&e.y<t.y&&a.right>t.x||90===n&&e.y>t.y&&a.right>t.x?(h=new b(e.x,t.y),l=new b(e.x,(t.y+e.y)/2),180===n?(h.x=this.computeMidOrthoPosition(t.x,e.x,!1),l.x=h.x,l.y=e.y):270===n&&e.y<t.y||90===n&&e.y>t.y?(h.x=t.x<a.left?this.computeMidOrthoPosition(t.x,a.left,!1):t.x<a.right&&(270===n&&t.y<a.top||90===n&&t.y>a.bottom)?this.computeMidOrthoPosition(t.x,e.x,!1):a.right,l.x=h.x,l.y=e.y):0===n&&t.x<a.left&&t.y>a.top&&t.y<a.bottom&&(h.x=t.x,h.y=t.y<e.y?Math.min(e.y,a.top):Math.max(e.y,a.bottom),l.y=h.y)):(h=new b(t.x,e.y),l=new b((t.x+e.x)/2,e.y),(180===n||90===n&&e.y<s.top||270===n&&e.y>s.bottom)&&(180===n&&(a.Ga(t)||s.Ga(e))?h.y=this.computeMidOrthoPosition(t.y,e.y,!0):e.y<t.y&&(180===n||90===n)?h.y=this.computeMidOrthoPosition(s.top,Math.max(e.y,a.bottom),!0):e.y>t.y&&(180===n||270===n)&&(h.y=this.computeMidOrthoPosition(s.bottom,Math.min(e.y,a.top),!0)),l.x=e.x,l.y=h.y),h.y>s.top&&h.y<s.bottom&&(e.x>=s.left&&e.x<=t.x||t.x<=a.right&&t.x>=e.x?90!==n&&270!==n||(h=new b(Math.max((t.x+e.x)/2,t.x),t.y),l=new b(h.x,e.y)):(h.y=270===n||(0===n||180===n)&&e.y<t.y?Math.min(e.y,0===n?s.top:Math.min(s.top,a.top)):Math.max(e.y,0===n?s.bottom:Math.max(s.bottom,a.bottom)),l.x=e.x,l.y=h.y))):180===i?e.x<t.x||270===n&&e.y<t.y&&a.left<t.x||90===n&&e.y>t.y&&a.left<t.x?(h=new b(e.x,t.y),l=new b(e.x,(t.y+e.y)/2),0===n?(h.x=this.computeMidOrthoPosition(t.x,e.x,!1),l.x=h.x,l.y=e.y):270===n&&e.y<t.y||90===n&&e.y>t.y?(h.x=t.x>a.right?this.computeMidOrthoPosition(t.x,a.right,!1):t.x>a.left&&(270===n&&t.y<a.top||90===n&&t.y>a.bottom)?this.computeMidOrthoPosition(t.x,e.x,!1):a.left,l.x=h.x,l.y=e.y):180===n&&t.x>a.right&&t.y>a.top&&t.y<a.bottom&&(h.x=t.x,h.y=t.y<e.y?Math.min(e.y,a.top):Math.max(e.y,a.bottom),l.y=h.y)):(h=new b(t.x,e.y),l=new b((t.x+e.x)/2,e.y),(0===n||90===n&&e.y<s.top||270===n&&e.y>s.bottom)&&(0===n&&(a.Ga(t)||s.Ga(e))?h.y=this.computeMidOrthoPosition(t.y,e.y,!0):e.y<t.y&&(0===n||90===n)?h.y=this.computeMidOrthoPosition(s.top,Math.max(e.y,a.bottom),!0):e.y>t.y&&(0===n||270===n)&&(h.y=this.computeMidOrthoPosition(s.bottom,Math.min(e.y,a.top),!0)),l.x=e.x,l.y=h.y),h.y>s.top&&h.y<s.bottom&&(e.x<=s.right&&e.x>=t.x||t.x>=a.left&&t.x<=e.x?90!==n&&270!==n||(h=new b(Math.min((t.x+e.x)/2,t.x),t.y),l=new b(h.x,e.y)):(h.y=270===n||(0===n||180===n)&&e.y<t.y?Math.min(e.y,180===n?s.top:Math.min(s.top,a.top)):Math.max(e.y,180===n?s.bottom:Math.max(s.bottom,a.bottom)),l.x=e.x,l.y=h.y))):90===i?e.y>t.y||180===n&&e.x<t.x&&a.bottom>t.y||0===n&&e.x>t.x&&a.bottom>t.y?(h=new b(t.x,e.y),l=new b((t.x+e.x)/2,e.y),270===n?(h.y=this.computeMidOrthoPosition(t.y,e.y,!0),l.x=e.x,l.y=h.y):180===n&&e.x<t.x||0===n&&e.x>t.x?(h.y=t.y<a.top?this.computeMidOrthoPosition(t.y,a.top,!0):t.y<a.bottom&&(180===n&&t.x<a.left||0===n&&t.x>a.right)?this.computeMidOrthoPosition(t.y,e.y,!0):a.bottom,l.x=e.x,l.y=h.y):90===n&&t.y<a.top&&t.x>a.left&&t.x<a.right&&(h.x=t.x<e.x?Math.min(e.x,a.left):Math.max(e.x,a.right),h.y=t.y,l.x=h.x)):(h=new b(e.x,t.y),l=new b(e.x,(t.y+e.y)/2),(270===n||0===n&&e.x<s.left||180===n&&e.x>s.right)&&(270===n&&(a.Ga(t)||s.Ga(e))?h.x=this.computeMidOrthoPosition(t.x,e.x,!1):e.x<t.x&&(270===n||0===n)?h.x=this.computeMidOrthoPosition(s.left,Math.max(e.x,a.right),!1):e.x>t.x&&(270===n||180===n)&&(h.x=this.computeMidOrthoPosition(s.right,Math.min(e.x,a.left),!1)),l.x=h.x,l.y=e.y),h.x>s.left&&h.x<s.right&&(e.y>=s.top&&e.y<=t.y||t.y<=a.bottom&&t.y>=e.y?0!==n&&180!==n||(h=new b(t.x,Math.max((t.y+e.y)/2,t.y)),l=new b(e.x,h.y)):(h.x=180===n||(90===n||270===n)&&e.x<t.x?Math.min(e.x,90===n?s.left:Math.min(s.left,a.left)):Math.max(e.x,90===n?s.right:Math.max(s.right,a.right)),l.x=h.x,l.y=e.y))):e.y<t.y||180===n&&e.x<t.x&&a.top<t.y||0===n&&e.x>t.x&&a.top<t.y?(h=new b(t.x,e.y),l=new b((t.x+e.x)/2,e.y),90===n?(h.y=this.computeMidOrthoPosition(t.y,e.y,!0),l.x=e.x,l.y=h.y):180===n&&e.x<t.x||0===n&&e.x>=t.x?(h.y=t.y>a.bottom?this.computeMidOrthoPosition(t.y,a.bottom,!0):t.y>a.top&&(180===n&&t.x<a.left||0===n&&t.x>a.right)?this.computeMidOrthoPosition(t.y,e.y,!0):a.top,l.x=e.x,l.y=h.y):270===n&&t.y>a.bottom&&t.x>a.left&&t.x<a.right&&(h.x=t.x<e.x?Math.min(e.x,a.left):Math.max(e.x,a.right),h.y=t.y,l.x=h.x)):(h=new b(e.x,t.y),l=new b(e.x,(t.y+e.y)/2),(90===n||0===n&&e.x<s.left||180===n&&e.x>s.right)&&(90===n&&(a.Ga(t)||s.Ga(e))?h.x=this.computeMidOrthoPosition(t.x,e.x,!1):e.x<t.x&&(90===n||0===n)?h.x=this.computeMidOrthoPosition(s.left,Math.max(e.x,a.right),!1):e.x>t.x&&(90===n||180===n)&&(h.x=this.computeMidOrthoPosition(s.right,Math.min(e.x,a.left),!1)),l.x=h.x,l.y=e.y),h.x>s.left&&h.x<s.right&&(e.y<=s.bottom&&e.y>=t.y||t.y>=a.top&&t.y<=e.y?0!==n&&180!==n||(h=new b(t.x,Math.min((t.y+e.y)/2,t.y)),l=new b(e.x,h.y)):(h.x=180===n||(90===n||270===n)&&e.x<t.x?Math.min(e.x,270===n?s.left:Math.min(s.left,a.left)):Math.max(e.x,270===n?s.right:Math.max(s.right,a.right)),l.x=h.x,l.y=e.y)));var u=h,f=l;if(this.Al){var c,p=this.g;(c=null===p)||(p.Sa.uf?c=!1:(c=p.Ya,c=!(c instanceof qt)||(!c.lw||c.bI)),c=!c),c||s.Ga(e)&&!r.ai(o)||a.Ga(t)&&!o.ai(r)||o===r||this.layer.Gc?t=!1:(o=an(p,!0,this.Ta,null)).pp(Math.min(t.x,u.x),Math.min(t.y,u.y),Math.abs(t.x-u.x),Math.abs(t.y-u.y))&&o.pp(Math.min(u.x,f.x),Math.min(u.y,f.y),Math.abs(u.x-f.x),Math.abs(u.y-f.y))&&o.pp(Math.min(f.x,e.x),Math.min(f.y,e.y),Math.abs(f.x-e.x),Math.abs(f.y-e.y))?t=!1:((s=s.copy().ei(a)).Qf(2*o.Uo,2*o.So),us(o,t,i,e,n,s),a=rs(o,e.x,e.y),o.abort||999999!==a||(as(o),a=o.zF,s.Qf(o.Uo*a,o.So*a),us(o,t,i,e,n,s),a=rs(o,e.x,e.y)),o.abort||999999!==a||(as(o),a=o.OE,s.Qf(o.Uo*a,o.So*a),us(o,t,i,e,n,s),a=rs(o,e.x,e.y)),!o.abort&&999999===a&&o.SF&&(as(o),us(o,t,i,e,n,o.nb),a=rs(o,e.x,e.y)),!o.abort&&999999>a&&0!==rs(o,e.x,e.y)?(Ur(this,o,e.x,e.y,n,!0),n=this.l(2),4>this.pa?(0===i||180===i?(n.x=t.x,n.y=e.y):(n.x=e.x,n.y=t.y),this.W(2,n.x,n.y),this.w(3,n.x,n.y)):(e=this.l(3),0===i||180===i?hl.G(n.x,e.x)?(i=0===i?Math.max(n.x,t.x):Math.min(n.x,t.x),this.W(2,i,t.y),this.W(3,i,e.y)):hl.G(n.y,e.y)?(Math.abs(t.y-n.y)<=o.So/2&&(this.W(2,n.x,t.y),this.W(3,e.x,t.y)),this.w(2,n.x,t.y)):this.W(2,t.x,n.y):90!==i&&270!==i||(hl.G(n.y,e.y)?(i=90===i?Math.max(n.y,t.y):Math.min(n.y,t.y),this.W(2,t.x,i),this.W(3,e.x,i)):hl.G(n.x,e.x)?(Math.abs(t.x-n.x)<=o.Uo/2&&(this.W(2,t.x,n.y),this.W(3,t.x,e.y)),this.w(2,t.x,n.y)):this.W(2,n.x,t.y))),t=!0):t=!1)}else t=!1;t||(this.Wh(h),this.Wh(l))}},zr.prototype.computeMidOrthoPosition=function(t,i){if(this.hasCurviness()){return(t+i)/2+this.computeCurviness()}return(t+i)/2},zr.prototype.findClosestSegment=function(t){var i=t.x;t=t.y;for(var e=this.l(0),n=this.l(1),o=Mh(i,t,e.x,e.y,n.x,n.y),r=0,s=1;s<this.pa-1;s++){var e=this.l(s+1),a=Mh(i,t,n.x,n.y,e.x,e.y),n=e;a<o&&(r=s,o=a)}return r},zr.prototype.invalidateGeometry=zr.prototype.se=function(){this.Ua=null},xh.u(zr,{tl:"geometry"},function(){return null===this.Ua&&(this.pn(),this.Ua=this.makeGeometry()),this.Ua}),zr.prototype.dn=function(t){if(!t){if(!1===this.Mf)return;if(t=this.af(),null!==this.Ua&&(null===t||null!==t.tl))return}if(this.Ua=this.makeGeometry(),null!==(t=this.path)){t.Ua=this.Ua;for(var i=this.Aa.n,e=i.length,n=0;n<e;n++){var o=i[n];o!==t&&o.Rf&&o instanceof To&&(o.Ua=this.Ua)}}},zr.prototype.makeGeometry=function(){if(2>(a=this.pa)){var t=new K(cl),i=new Q(0,0);return t.Wb.add(i),t}h=!1;null!==(t=this.g)&&Qr(this)&&t.Dk.contains(this)&&null!==this.Wv&&(h=!0);var i=t=0,e=(r=this.l(0).copy()).copy(),t=this.Zc.n;if((s=this.computeCurve())===Cf&&3<=a&&!hl.Qa(this.Qp,0))if(3===a)var n=this.l(1),t=Math.min(r.x,n.x),i=Math.min(r.y,n.y),n=this.l(2),t=Math.min(t,n.x),i=Math.min(i,n.y);else{if(this.kc)for(n=0;n<a;n++)i=t[n],e.x=Math.min(i.x,e.x),e.y=Math.min(i.y,e.y);else for(n=3;n<a;n+=3)n+3>=a&&(n=a-1),t=this.l(n),e.x=Math.min(t.x,e.x),e.y=Math.min(t.y,e.y);t=e.x,i=e.y}else{for(n=0;n<a;n++)i=t[n],e.x=Math.min(i.x,e.x),e.y=Math.min(i.y,e.y);t=e.x,i=e.y}if(t-=this.lz.x,i-=this.lz.y,r.x-=t,r.y-=i,2===a){var o=this.l(1).copy();o.x-=t,o.y-=i,0!==Hr(this)&&Yr(this,r,!0,e),0!==Kr(this)&&Yr(this,o,!1,e),(t=new K(ll)).za=r.x,t.xa=r.y,t.I=o.x,t.J=o.y}else{if(o=xh.q(),0!==Hr(this)&&Yr(this,r,!0,e),Qo(o,r.x,r.y,!1,!1),s===Cf&&3<=a&&!hl.Qa(this.Qp,0))if(3===a)n=this.l(1),a=n.x-t,h=n.y-i,n=this.l(2).copy(),n.x-=t,n.y-=i,0!==Kr(this)&&Yr(this,n,!1,e),$o(o,a,h,a,h,n.x,n.y);else if(this.kc){for(var e=new b(t,i),r=this.l(1).copy(),s=new b(t,i),a=new b(t,i),h=this.l(0),l=null,u=this.Qp/3,n=1;n<this.pa-1;n++){var f=h,c=l=this.l(n),p=this.l(Wr(this,l,n,!1));if(!(hl.Qa(f.x,c.x)&&hl.Qa(c.x,p.x)||hl.Qa(f.y,c.y)&&hl.Qa(c.y,p.y))){var d=u,y=s,v=a;isNaN(d)&&(d=this.Qp/3);var g=f.x,f=f.y,m=c.x,c=c.y,x=p.x,p=p.y,w=d*Jr(g,f,m,c),d=d*Jr(m,c,x,p);hl.Qa(f,c)&&hl.Qa(m,x)&&(m>g?p>c?(y.x=m-w,y.y=c-w,v.x=m+d,v.y=c+d):(y.x=m-w,y.y=c+w,v.x=m+d,v.y=c-d):p>c?(y.x=m+w,y.y=c-w,v.x=m-d,v.y=c+d):(y.x=m+w,y.y=c+w,v.x=m-d,v.y=c-d)),hl.Qa(g,m)&&hl.Qa(c,p)&&(c>f?(x>m?(y.x=m-w,y.y=c-w,v.x=m+d):(y.x=m+w,y.y=c-w,v.x=m-d),v.y=c+d):(x>m?(y.x=m-w,y.y=c+w,v.x=m+d):(y.x=m+w,y.y=c+w,v.x=m-d),v.y=c-d)),(hl.Qa(g,m)&&hl.Qa(m,x)||hl.Qa(f,c)&&hl.Qa(c,p))&&(g=.5*(g+x),f=.5*(f+p),y.x=g,y.y=f,v.x=g,v.y=f),1===n?(r.x=.5*(h.x+l.x),r.y=.5*(h.y+l.y)):2===n&&hl.Qa(h.x,this.l(0).x)&&hl.Qa(h.y,this.l(0).y)&&(r.x=.5*(h.x+l.x),r.y=.5*(h.y+l.y)),$o(o,r.x-t,r.y-i,s.x-t,s.y-i,l.x-t,l.y-i),e.set(s),r.set(a),h=l}}n=h.x,h=h.y,n=.5*(n+(e=this.l(this.pa-1)).x),h=.5*(h+e.y),$o(o,a.x-t,a.y-i,n-t,h-i,e.x-t,e.y-i)}else for(n=3;n<a;n+=3)h=this.l(n-2),n+3>=a&&(n=a-1),e=this.l(n-1),r=this.l(n),n===a-1&&0!==Kr(this)&&(r=r.copy(),Yr(this,r,!1,hl.mk)),$o(o,h.x-t,h.y-i,e.x-t,e.y-i,r.x-t,r.y-i);else{for((e=xh.M()).assign(this.l(0)),n=1;n<a;){if(n=Wr(this,e,n,1<n),y=this.l(n),n>=a-1){e!==y&&(0!==Kr(this)&&(y=y.copy(),Yr(this,y,!1,hl.mk)),Xr(this,o,-t,-i,e,y,h));break}n=Wr(this,y,n+1,n<a-3),r=o,s=-t,l=-i,u=e,v=this.l(n),g=e,f=h,hl.G(u.y,y.y)&&hl.G(y.x,v.x)?(d=this.computeCorner(),d=Math.min(d,Math.abs(y.x-u.x)/2),d=m=Math.min(d,Math.abs(v.y-y.y)/2),hl.G(d,0)?(Xr(this,r,s,l,u,y,f),g.assign(y)):(c=y.x,x=y.y,p=c,w=x,c=y.x>u.x?y.x-d:y.x+d,w=v.y>y.y?y.y+m:y.y-m,Xr(this,r,s,l,u,new b(c,x),f),_o(r,y.x+s,y.y+l,p+s,w+l),g.m(p,w))):hl.G(u.x,y.x)&&hl.G(y.y,v.y)?(d=this.computeCorner(),m=Math.min(d,Math.abs(y.y-u.y)/2),m=d=Math.min(m,Math.abs(v.x-y.x)/2),hl.G(d,0)?(Xr(this,r,s,l,u,y,f),g.assign(y)):(c=y.x,w=x=y.y,x=y.y>u.y?y.y-m:y.y+m,p=v.x>y.x?y.x+d:y.x-d,Xr(this,r,s,l,u,new b(c,x),f),_o(r,y.x+s,y.y+l,p+s,w+l),g.m(p,w))):(Xr(this,r,s,l,u,y,f),g.assign(y))}xh.v(e)}t=o.o,xh.s(o)}return t},xh.u(zr,{st:"firstPickIndex"},function(){return 2>=this.pa?0:this.kc||Gr(this)!==Ch?1:0}),xh.u(zr,{jx:"lastPickIndex"},function(){var t=this.pa;return 0===t?0:2>=t?t-1:this.kc||Vr(this)!==Ch?t-2:t-1}),zr.prototype.usesSamePort=function(t){var i=this.pa,e=t.pa;if(0<i&&0<e){var n=this.l(0),o=t.l(0);if(n.od(o))return!0;if(i=this.l(i-1),t=t.l(e-1),i.od(t)||n.od(t)||i.od(o))return!0}else if(this.V===t.V||this.ba===t.ba||this.V===t.ba||this.ba===t.V)return!0;return!1},zr.prototype.isVisible=function(){if(!tr.prototype.isVisible.call(this))return!1;var t=this.Ta,i=!0,e=this.g;if(null!==e&&(i=e.Qd),null!==(e=this.V)){if(this.Hc&&i&&!e.qd)return!1;if(e===t)return!0;if(null===(e=e.findVisibleNode())||e===t)return!1}if(null!==(e=this.ba)){if(this.Hc&&!i&&!e.qd)return!1;if(e===t)return!0;if(null===(i=e.findVisibleNode())||i===t)return!1}return!0},zr.prototype.rd=function(t){if(tr.prototype.rd.call(this,t),null!==this.gi&&this.gi.$m(),null!==this.Ee)for(var i=this.Ee.i;i.next();)i.value.rd(t)},xh.defineProperty(zr,{Ys:"adjusting"},function(){return this.cq},function(t){var i=this.cq;i!==t&&(this.cq=t,this.h("adjusting",i,t))}),xh.defineProperty(zr,{Hz:"corner"},function(){return this.wq},function(t){var i=this.wq;i!==t&&(this.wq=t,this.se(),this.h("corner",i,t))}),xh.defineProperty(zr,{Le:"curve"},function(){return this.Aq},function(t){var i=this.Aq;i!==t&&(this.Aq=t,this.jc(),this.se(),Zr(this,i===jf||i===Lf||t===jf||t===Lf),this.h("curve",i,t))}),xh.defineProperty(zr,{Kw:"curviness"},function(){return this.Bq},function(t){var i=this.Bq;i!==t&&(this.Bq=t,this.jc(),this.se(),this.h("curviness",i,t))}),xh.defineProperty(zr,{Cx:"routing"},function(){return this.wm},function(t){var i=this.wm;i!==t&&(this.wm=t,this.ti=null,this.jc(),Zr(this,2==(2&i.value)||2==(2&t.value)),this.h("routing",i,t))}),xh.defineProperty(zr,{Qp:"smoothness"},function(){return this.Bs},function(t){var i=this.Bs;i!==t&&(this.Bs=t,this.se(),this.h("smoothness",i,t))}),es.prototype.$m=function(){if(!this.tv){var t=this.links;0<t.length&&null!==(t=t[0].g)&&t.gC.add(this)}this.tv=!0},es.prototype.WA=function(){if(this.tv){this.tv=!1;var t=this.links;if(0<t.length){var i=t[0],e=i.g;i.arrangeBundledLinks(t,null===e||e.bn),1===t.length&&(i.gi=null,t.length=0)}0===t.length&&(t=this.Bp,null!==this&&null!==t.wh&&t.wh.remove(this),t=this.Tt,null!==this&&null!==t.wh&&t.wh.remove(this))}},xh.Nd(es,{Bp:!0,ux:!0,Tt:!0,vx:!0,links:!0,spacing:!0}),xh.Nd(ns,{group:!0,NA:!0,Ct:!0,abort:!0,SF:!0,zF:!0,OE:!0}),ns.prototype.initialize=function(t){if(!(0>=t.width||0>=t.height)){var i=t.y,e=t.x+t.width,n=t.y+t.height;if(this.jg=Math.floor((t.x-this.he)/this.he)*this.he,this.kg=Math.floor((i-this.ie)/this.ie)*this.ie,this.yr=Math.ceil((e+2*this.he)/this.he)*this.he,this.zr=Math.ceil((n+2*this.ie)/this.ie)*this.ie,t=1+(0|Math.ceil((this.yr-this.jg)/this.he)),i=1+(0|Math.ceil((this.zr-this.kg)/this.ie)),null===this.oc||this.Lo<t-1||this.Mo<i-1){for(e=[],n=0;n<=t;n++){for(var o=[],r=0;r<=i;r++)o[r]=0;e[n]=o}this.oc=e,this.Lo=t-1,this.Mo=i-1}if(null!==this.oc)for(t=0;t<=this.Lo;t++)for(i=0;i<=this.Mo;i++)this.oc[t][i]=999999}},xh.u(ns,{nb:null},function(){return new M(this.jg,this.kg,this.yr-this.jg,this.zr-this.kg)}),xh.defineProperty(ns,{Uo:null},function(){return this.he},function(t){0<t&&t!==this.he&&(this.he=t,this.initialize(this.nb))}),xh.defineProperty(ns,{So:null},function(){return this.ie},function(t){0<t&&t!==this.ie&&(this.ie=t,this.initialize(this.nb))}),ns.prototype.pp=function(t,i,e,n){if(t>this.yr||t+e<this.jg||i>this.zr||i+n<this.kg)return!0;t=(t-this.jg)/this.he|0,i=(i-this.kg)/this.ie|0,e=Math.max(0,e)/this.he+1|0;var o=Math.max(0,n)/this.ie+1|0;if(0>t&&(e+=t,t=0),0>i&&(o+=i,i=0),0>e||0>o)return!0;for(n=0|Math.min(t+e-1,this.Lo),e=0|Math.min(i+o-1,this.Mo);t<=n;t++)for(o=i;o<=e;o++)if(0===this.oc[t][o])return!1;return!0},xh.Nd(fs,{Jc:!0,port:!0,Xf:!0,Ap:!0}),fs.prototype.toString=function(){for(var t=this.Xf,i=this.Jc.toString()+" "+t.length.toString()+":",e=0;e<t.length;e++){var n=t[e];null!==n&&(i+="\n  "+n.toString())}return i},fs.prototype.$m=function(){this.Xf.length=0},fs.prototype.KI=function(t,i){return t===i?0:null===t?-1:null===i?1:t.ge<i.ge?-1:t.ge>i.ge?1:t.angle<i.angle?-1:t.angle>i.angle?1:0},fs.prototype.computeEndSegmentLength=function(t){var i=(o=t.link).computeEndSegmentLength(this.Jc,this.port,Ch,o.bd===this.port),e=t.kp;if(0>e)return i;var n=t.Rm;if(1>=n||!o.kc)return i;var o=t.sx,r=t.rp;return t.ge!==xh.Nc&&t.ge!==xh.Wc||(e=n-1-e),((t=t.ge===xh.Nc||t.ge===xh.Xc)?o.y<r.y:o.x<r.x)?i+8*e:(t?o.y===r.y:o.x===r.x)?i:i+8*(n-1-e)},xh.Nd(ds,{link:!0,angle:!0,ge:!0,sx:!0,kp:!0,Rm:!0,rp:!0,Ow:!0}),ds.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.ge.toString()+":"+this.kp.toString()+"/"+this.Rm.toString()+" "+this.rp.toString()+" "+this.Ow.toString()+" "+this.sx.toString()},ys.prototype.copy=function(){var t=new ys;return t.rj=this.rj.S(),t.Tj=this.Tj.S(),t.pj=this.pj,t.Rj=this.Rj,t.oj=this.oj,t.Qj=this.Qj,t.qj=this.qj,t.Sj=this.Sj,t},xh.Ja(vs,wr),xh.ea("Group",vs),vs.prototype.cloneProtected=function(t){wr.prototype.cloneProtected.call(this,t),t.Ar=this.Ar,t.Cr=this.Cr,t.Tk=this.Tk,t.Os=this.Os,t.hr=this.hr,t.Qs=this.Qs,t.Fs=this.Fs;var i=t.mt(function(t){return t instanceof ws});t.Ib=i instanceof ws?i:null,t.oq=this.oq,t.pq=this.pq,t.qq=this.qq,t.Yq=this.Yq,null!==this.Ud?(t.Ud=this.Ud.copy(),t.Ud.group=t):(null!==t.Ud&&(t.Ud.group=null),t.Ud=null)},vs.prototype.Zh=function(t){wr.prototype.Zh.call(this,t);var i=t.cp();for(t=t.Ic;t.next();){var e=t.value;if(e.Q(),e.H(8),e.et(),e instanceof wr)e.ff(i);else if(e instanceof zr)for(e=e.Sf;e.next();)e.value.ff(i)}},vs.prototype.kn=function(t,i,e,n,o,r,s){if(t===Ml&&"elements"===i)if(o instanceof ws){var a=o;null===this.Ib?this.Ib=a:this.Ib!==a&&xh.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else o instanceof eo&&(a=o.mt(function(t){return t instanceof ws}))instanceof ws&&(null===this.Ib?this.Ib=a:this.Ib!==a&&xh.k("Cannot insert a second Placeholder into the visual tree of a Group."));else t===Pl&&"elements"===i&&null!==this.Ib&&(n===this.Ib?this.Ib=null:n instanceof eo&&this.Ib.Cl(n)&&(this.Ib=null));wr.prototype.kn.call(this,t,i,e,n,o,r,s)},vs.prototype.Ri=function(t,i,e,n){this.Sk=this.Ib,eo.prototype.Ri.call(this,t,i,e,n)},vs.prototype.Dl=function(){if(!wr.prototype.Dl.call(this))return!1;for(var t=this.Ic;t.next();){var i=t.value;if(i instanceof wr){if(i.isVisible()&&Xn(i))return!1}else if(i instanceof zr&&i.isVisible()&&Xn(i)&&i.V!==this&&i.ba!==this)return!1}return!0},xh.u(vs,{placeholder:"placeholder"},function(){return this.Ib}),xh.defineProperty(vs,{SD:"computesBoundsAfterDrag"},function(){return this.oq},function(t){var i=this.oq;i!==t&&(xh.j(t,"boolean",vs,"computesBoundsAfterDrag"),this.oq=t,this.h("computesBoundsAfterDrag",i,t))}),xh.defineProperty(vs,{Iw:"computesBoundsIncludingLinks"},function(){return this.pq},function(t){xh.j(t,"boolean",vs,"computesBoundsIncludingLinks");var i=this.pq;i!==t&&(this.pq=t,this.h("computesBoundsIncludingLinks",i,t))}),xh.defineProperty(vs,{cH:"computesBoundsIncludingLocation"},function(){return this.qq},function(t){xh.j(t,"boolean",vs,"computesBoundsIncludingLocation");var i=this.qq;i!==t&&(this.qq=t,this.h("computesBoundsIncludingLocation",i,t))}),xh.defineProperty(vs,{SH:"handlesDragDropForMembers"},function(){return this.Yq},function(t){xh.j(t,"boolean",vs,"handlesDragDropForMembers");var i=this.Yq;i!==t&&(this.Yq=t,this.h("handlesDragDropForMembers",i,t))}),xh.u(vs,{Ic:"memberParts"},function(){return this.Br.i}),vs.prototype.Um=function(){if(0<this.Br.count){var t=this.g;if(null!==t)for(var i=this.Br.copy().i;i.next();)t.remove(i.value)}wr.prototype.Um.call(this)},xh.defineProperty(vs,{Rb:"layout"},function(){return this.Ud},function(t){var i=this.Ud;i!==t&&(null!==t&&xh.A(t,ks,vs,"layout"),null!==i&&(i.g=null,i.group=null),this.Ud=t,null!==t&&(t.g=this.g,t.group=this),this.h("layout",i,t))}),xh.defineProperty(vs,{BI:"memberAdded"},function(){return this.Ar},function(t){var i=this.Ar;i!==t&&(null!==t&&xh.j(t,"function",vs,"memberAdded"),this.Ar=t,this.h("memberAdded",i,t))}),xh.defineProperty(vs,{CI:"memberRemoved"},function(){return this.Cr},function(t){var i=this.Cr;i!==t&&(null!==t&&xh.j(t,"function",vs,"memberRemoved"),this.Cr=t,this.h("memberRemoved",i,t))}),xh.defineProperty(vs,{iA:"memberValidation"},function(){return this.Tk},function(t){var i=this.Tk;i!==t&&(null!==t&&xh.j(t,"function",vs,"memberValidation"),this.Tk=t,this.h("memberValidation",i,t))}),vs.prototype.canAddMembers=function(t){var i=this.g;if(null===i)return!1;for(i=i.ob,t=Ft(t).i;t.next();)if(!i.isValidMember(this,t.value))return!1;return!0},vs.prototype.addMembers=function(t,i){if(null===(e=this.g))return!1;for(var e=e.ob,n=!0,o=Ft(t).i;o.next();){var r=o.value;!i||e.isValidMember(this,r)?r.Ta=this:n=!1}return n},xh.defineProperty(vs,{FJ:"ungroupable"},function(){return this.Os},function(t){var i=this.Os;i!==t&&(xh.j(t,"boolean",vs,"ungroupable"),this.Os=t,this.h("ungroupable",i,t))}),vs.prototype.canUngroup=function(){if(!this.FJ)return!1;var t=this.layer;return!(null!==t&&!t.Bw)&&!(null!==(t=t.g)&&!t.Bw)},vs.prototype.ff=function(t){void 0===t&&(t=null),wr.prototype.ff.call(this,t);for(var i=this.hE();i.next();){var e=i.value;if(null===t||!t.contains(e)){var n=e.V;null!==n&&n!==this&&n.ai(this)&&!n.isVisible()?e.jc():null!==(n=e.ba)&&n!==this&&n.ai(this)&&!n.isVisible()&&e.jc()}}},vs.prototype.findExternalLinksConnected=vs.prototype.hE=function(){var t=this.cp();t.add(this);for(var i=new c(zr),e=t.i;e.next();){var n=e.value;if(n instanceof wr)for(n=n.ue;n.next();){var o=n.value;t.contains(o)||i.add(o)}}return i.i},vs.prototype.findExternalNodesConnected=function(){var t=this.cp();t.add(this);for(var i=new c(wr),e=t.i;e.next();){var n=e.value;if(n instanceof wr)for(n=n.ue;n.next();){var o=n.value,r=o.V;t.contains(r)&&r!==this||i.add(r),o=o.ba,t.contains(o)&&o!==this||i.add(o)}}return i.i},vs.prototype.findContainingGroupChain=function(){function t(i,e){null!==i&&(e.add(i),t(i.Ta,e))}var i=new c(tr);return t(this,i),i},vs.prototype.findSubGraphParts=vs.prototype.cp=function(){var t=new c(tr);return Dt(t,this,!0,0,!0),t.remove(this),t},vs.prototype.rd=function(t){wr.prototype.rd.call(this,t);for(var i=this.Ic;i.next();)i.value.rd(t)},vs.prototype.collapseSubGraph=vs.prototype.collapseSubGraph=function(){var t=this.g;if(null!==t&&!t.bh){t.bh=!0;bs(this,this.cp(),t.Sa,this),t.bh=!1}},vs.prototype.expandSubGraph=vs.prototype.expandSubGraph=function(){var t=this.g;if(null!==t&&!t.bh){t.bh=!0;xs(this,this.cp(),t.Sa,this),t.bh=!1}},xh.defineProperty(vs,{ee:"isSubGraphExpanded"},function(){return this.hr},function(t){var i=this.hr;if(i!==t){xh.j(t,"boolean",vs,"isSubGraphExpanded"),this.hr=t;var e=this.g;if(this.h("isSubGraphExpanded",i,t),null!==(i=this.uJ)){var n=!0;null!==e&&(n=e.Ra,e.Ra=!0),i(this),null!==e&&(e.Ra=n)}null!==e&&e.ma.kb?null!==this.Ib&&this.Ib.Q():t?this.expandSubGraph():this.collapseSubGraph()}}),xh.defineProperty(vs,{YA:"wasSubGraphExpanded"},function(){return this.Qs},function(t){var i=this.Qs;i!==t&&(xh.j(t,"boolean",vs,"wasSubGraphExpanded"),this.Qs=t,this.h("wasSubGraphExpanded",i,t))}),xh.defineProperty(vs,{uJ:"subGraphExpandedChanged"},function(){return this.Fs},function(t){var i=this.Fs;i!==t&&(null!==t&&xh.j(t,"function",vs,"subGraphExpandedChanged"),this.Fs=t,this.h("subGraphExpandedChanged",i,t))}),vs.prototype.move=function(t){i=(e=this.position).x;isNaN(i)&&(i=0),e=e.y,isNaN(e)&&(e=0);var i=t.x-i,e=t.y-e,n=xh.Ob(i,e);for(wr.prototype.move.call(this,t),t=this.cp().i;t.next();){var o=t.value;if(!(o instanceof zr||o instanceof wr&&o.vf)){var r=o.position,s=o.location;r.K()?(n.x=r.x+i,n.y=r.y+e,o.position=n):s.K()&&(n.x=s.x+i,n.y=s.y+e,o.location=n)}}for(t.reset();t.next();)(o=t.value)instanceof zr&&(r=o.position,n.x=r.x+i,n.y=r.y+e,o.move(n));xh.v(n)},xh.Ja(ws,Mn),xh.ea("Placeholder",ws),ws.prototype.cloneProtected=function(t){Mn.prototype.cloneProtected.call(this,t),t.We=this.We.S(),t.ns=this.ns.copy()},ws.prototype.Yj=function(t){if(null===this.background&&null===this.Jm)return!1;var i=this.Ia;return Sh(0,0,i.width,i.height,t.x,t.y)},ws.prototype.vp=function(){var t=this.aa;if(null!==t&&(t instanceof vs||t instanceof xr)||xh.k("Placeholder is not inside a Group or Adornment."),t instanceof vs){n=this.computeBorder(this.ns);P(i=this.Qc,n.width||0,n.height||0),Nn(this,0,0,i.width,i.height);for(var i=t.Ic,e=!1;i.next();)if(i.value.isVisible()){e=!0;break}!e||isNaN(n.x)||isNaN(n.y)||((i=new b).iu(n,t.gf),t.location=new b(i.x,i.y))}else{var n=this.ya,i=this.Qc,o=(e=this.padding).left+e.right,r=e.top+e.bottom;if(n.K())P(i,n.width+o||0,n.height+r||0),Nn(this,-e.left,-e.top,i.width,i.height);else{var s=t.gc,a=s.Za(Lh,xh.M());(n=xh.lk(a.x,a.y,0,0)).gj(s.Za(Eh,a)),n.gj(s.Za(Ah,a)),n.gj(s.Za(qh,a)),t.Ai.m(n.x,n.y),P(i,n.width+o||0,n.height+r||0),Nn(this,-e.left,-e.top,i.width,i.height),xh.v(a),xh.ic(n)}}},ws.prototype.Ri=function(t,i,e,n){var o=this.Y;o.x=t,o.y=i,o.width=e,o.height=n},ws.prototype.computeBorder=function(t){var i=this.aa;if(i instanceof vs){if((e=i).SD&&this.ns.K()){if(null!==(n=e.g)&&(n=n.Ya)instanceof qt&&!n.Mq&&null!==n.ac&&!n.ac.contains(e))return t.assign(this.ns),t}}var e=xh.ag(),n=this.computeMemberBounds(e),o=this.padding;return t.m(n.x-o.left,n.y-o.top,n.width+o.left+o.right,n.height+o.top+o.bottom),xh.ic(e),i instanceof vs&&(e=i).cH&&e.location.K()&&t.gj(e.location),t},ws.prototype.computeMemberBounds=function(t){if(!(this.aa instanceof vs))return t.m(0,0,0,0),t;for(var i=this.aa,e=1/0,n=1/0,o=-1/0,r=-1/0,s=i.Ic;s.next();){var a=s.value;if(a.isVisible()){if(a instanceof zr){var h=a;if(!i.Iw)continue;if(Yn(h))continue;if(h.V===i||h.ba===i)continue}(a=a.Y).left<e&&(e=a.left),a.top<n&&(n=a.top),a.right>o&&(o=a.right),a.bottom>r&&(r=a.bottom)}}return isFinite(e)&&isFinite(n)?t.m(e,n,o-e,r-n):(i=i.location,e=this.padding,t.m(i.x+e.left,i.y+e.top,0,0)),t},xh.defineProperty(ws,{padding:"padding"},function(){return this.We},function(t){"number"==typeof t?((isNaN(t)||0>t)&&xh.wa(t,">= 0",ws,"padding"),t=new j(t)):(xh.A(t,j,ws,"padding"),(isNaN(t.left)||0>t.left)&&xh.wa(t.left,">= 0",ws,"padding:value.left"),(isNaN(t.right)||0>t.right)&&xh.wa(t.right,">= 0",ws,"padding:value.right"),(isNaN(t.top)||0>t.top)&&xh.wa(t.top,">= 0",ws,"padding:value.top"),(isNaN(t.bottom)||0>t.bottom)&&xh.wa(t.bottom,">= 0",ws,"padding:value.bottom"));var i=this.We;i.L(t)||(this.We=t=t.S(),this.h("padding",i,t))}),xh.ea("Layout",ks),ks.prototype.cloneProtected=function(t){t.er=this.er,t.vj=this.vj,t.mr=this.mr,t.gq.assign(this.gq),t.gr=this.gr,t.fr=this.fr,t.TB=this.TB,this.vj||(t.co=!0)},ks.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},ks.prototype.toString=function(){var t=(t=xh.df(Object.getPrototypeOf(this)))+"(";return null!==this.group&&(t+=" in "+this.group),null!==this.g&&(t+=" for "+this.g),t+")"},xh.defineProperty(ks,{g:"diagram"},function(){return this.U},function(t){null!==t&&xh.A(t,Qi,ks,"diagram"),this.U=t}),xh.defineProperty(ks,{group:"group"},function(){return this.Ky},function(t){this.Ky!==t&&(null!==t&&xh.A(t,vs,ks,"group"),this.Ky=t,null!==t&&(this.U=t.g))}),xh.defineProperty(ks,{iI:"isOngoing"},function(){return this.er},function(t){this.er!==t&&(xh.j(t,"boolean",ks,"isOngoing"),this.er=t)}),xh.defineProperty(ks,{HE:"isInitial"},function(){return this.vj},function(t){xh.j(t,"boolean",ks,"isInitial"),this.vj=t,t||(this.co=!0)}),xh.defineProperty(ks,{hx:"isViewportSized"},function(){return this.mr},function(t){this.mr!==t&&(xh.j(t,"boolean",ks,"isViewportSized"),(this.mr=t)&&this.H())}),xh.defineProperty(ks,{Ht:"isRouting"},function(){return this.gr},function(t){this.gr!==t&&(xh.j(t,"boolean",ks,"isRouting"),this.gr=t)}),xh.defineProperty(ks,{JE:"isRealtime"},function(){return this.fr},function(t){this.fr!==t&&(xh.j(t,"boolean",ks,"isRealtime"),this.fr=t)}),xh.defineProperty(ks,{xf:"isValidLayout"},function(){return this.co},function(t){this.co!==t&&(xh.j(t,"boolean",ks,"isValidLayout"),this.co=t,t||null!==(t=this.g)&&(t.Iu=!0))}),ks.prototype.invalidateLayout=ks.prototype.H=function(){if(this.co){var t=this.g;if(null!==t&&!t.ma.kb){var i=t.Sa;!i.bo&&(i.uf&&i.ci(),this.iI&&t.bn||this.HE&&!t.bn)&&(this.xf=!1,t.Re())}}},xh.defineProperty(ks,{network:"network"},function(){return this.$y},function(t){var i=this.$y;i!==t&&(null!==t&&xh.A(t,Ps,ks,"network"),null!==i&&(i.Rb=null),this.$y=t,null!==t&&(t.Rb=this))}),ks.prototype.createNetwork=function(){return new Ps},ks.prototype.makeNetwork=function(t){var i=this.createNetwork();return i.Rb=this,t instanceof Qi?(i.Vj(t.Ag,!0),i.Vj(t.links,!0)):t instanceof vs?i.Vj(t.Ic):i.Vj(t.i),i},ks.prototype.updateParts=function(){var t=this.g;if(null===t&&null!==this.network)for(var i=this.network.vertexes.i;i.next();){var e=i.value.Jc;if(null!==e&&null!==(t=e.g))break}this.xf=!0;try{null!==t&&t.Sb("Layout"),this.commitLayout()}finally{null!==t&&t.Ad("Layout")}},ks.prototype.commitLayout=function(){for(var t=this.network.vertexes.i;t.next();)t.value.commit();if(this.Ht)for(t=this.network.edges.i;t.next();)t.value.commit()},ks.prototype.doLayout=function(t){null===t&&xh.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");a=new c(tr);t instanceof Qi?(Ms(this,a,t.Ag,!0,this.nA,!0,!1,!0),Ms(this,a,t.ik,!0,this.nA,!0,!1,!0)):t instanceof vs?Ms(this,a,t.Ic,!1,this.nA,!0,!1,!0):a.Tc(t.i);if(0<(i=a.count)){null!==(t=this.g)&&t.Sb("Layout");for(var i=Math.ceil(Math.sqrt(i)),e=this.Xd.x,n=e,o=this.Xd.y,r=0,s=0,a=a.i;a.next();){var h=a.value;h.rf();var l=(u=h.Ca).width,u=u.height;h.moveTo(n,o),h.Zy=!1,n+=Math.max(l,50)+20,s=Math.max(s,Math.max(u,50)),r>=i-1?(r=0,n=e,o+=s+20,s=0):r++}null!==t&&t.Ad("Layout")}this.xf=!0},ks.prototype.nA=function(t){return!(t.location.K()&&!(t instanceof vs&&t.Zy))},ks.prototype.collectParts=ks.prototype.XG=function(t){var i=new c(tr);return t instanceof Qi?(Ms(this,i,t.Ag,!0,null,!0,!0,!0),Ms(this,i,t.links,!0,null,!0,!0,!0),Ms(this,i,t.ik,!0,null,!0,!0,!0)):t instanceof vs?Ms(this,i,t.Ic,!1,null,!0,!0,!0):Ms(this,i,t.i,!1,null,!0,!0,!0),i},xh.defineProperty(ks,{Xd:"arrangementOrigin"},function(){return this.gq},function(t){xh.A(t,b,ks,"arrangementOrigin"),this.gq.L(t)||(this.gq.assign(t),this.H())}),ks.prototype.initialOrigin=function(t){var i=this.group;if(null!==i){var e=i.position.copy();return(isNaN(e.x)||isNaN(e.y))&&e.set(t),null!==(i=i.placeholder)&&(e=i.Za(Lh),(isNaN(e.x)||isNaN(e.y))&&e.set(t),e.x+=i.padding.left,e.y+=i.padding.top),e}return t},xh.ea("LayoutNetwork",Ps),Ps.prototype.clear=function(){if(this.vertexes)for(var t=this.vertexes.i;t.next();){var i=t.value;i.clear(),i.network=null}if(this.edges)for(t=this.edges.i;t.next();)(i=t.value).clear(),i.network=null;this.vertexes=new c(Cs),this.edges=new c(js),this.rA=new m(wr,Cs),this.dA=new m(zr,js)},Ps.prototype.toString=function(t){void 0===t&&(t=0);var i="LayoutNetwork"+(null!==this.Rb?"("+this.Rb.toString()+")":"");if(0>=t)return i;if(i+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count,1<t){for(var e=this.vertexes.i;e.next();)i+="\n    "+e.value.toString(t-1);for(e=this.edges.i;e.next();)i+="\n    "+e.value.toString(t-1)}return i},xh.defineProperty(Ps,{Rb:"layout"},function(){return this.Ud},function(t){this.Ud=t}),Ps.prototype.createVertex=function(){return new Cs},Ps.prototype.createEdge=function(){return new js},Ps.prototype.addParts=Ps.prototype.Vj=function(t,i,e){if(null!==t){for(void 0===i&&(i=!1),xh.j(i,"boolean",Ps,"addParts:toplevelonly"),void 0===e&&(e=null),null===e&&(e=function(t){if(t instanceof wr)return!t.vf;if(t instanceof zr){var i=t.V;return null!==i&&!i.vf&&(null!==(t=t.ba)&&!t.vf)}return!1}),t=t.i;t.next();){var n=t.value;if(n instanceof wr&&(!i||n.np)&&n.canLayout()&&e(n))if(n instanceof vs&&null===n.Rb)this.Vj(n.Ic,!1);else if(null===this.Wm(n)){(r=this.createVertex()).Jc=n,this.el(r)}}for(t.reset();t.next();)if((n=t.value)instanceof zr&&(!i||n.np)&&n.canLayout()&&e(n)&&null===this.Qw(n)){var o=n.V,r=n.ba;null!==o&&null!==r&&o!==r&&(o=this.findGroupVertex(o),r=this.findGroupVertex(r),null!==o&&null!==r&&this.tp(o,r,n))}}},Ps.prototype.findGroupVertex=function(t){if(null===t)return null;var i=t.findVisibleNode();if(null===i)return null;if(null!==(t=this.Wm(i)))return t;for(i=i.Ta;null!==i;){if(null!==(t=this.Wm(i)))return t;i=i.Ta}return null},Ps.prototype.addVertex=Ps.prototype.el=function(t){if(null!==t){this.vertexes.add(t);var i=t.Jc;null!==i&&this.rA.add(i,t),t.network=this}},Ps.prototype.addNode=Ps.prototype.Xs=function(t){if(null===t)return null;var i=this.Wm(t);return null===i&&(i=this.createVertex(),i.Jc=t,this.el(i)),i},Ps.prototype.deleteVertex=Ps.prototype.cE=function(t){if(null!==t&&Ts(this,t)){for(var i=t.Se,e=i.count-1;0<=e;e--){var n=i.ha(e);this.Zo(n)}for(e=(i=t.Me).count-1;0<=e;e--)n=i.ha(e),this.Zo(n)}},Ps.prototype.deleteNode=function(t){null!==t&&null!==(t=this.Wm(t))&&this.cE(t)},Ps.prototype.findVertex=Ps.prototype.Wm=function(t){return null===t?null:this.rA.ka(t)},Ps.prototype.addEdge=Ps.prototype.Oo=function(t){if(null!==t){this.edges.add(t);var i=t.link;null!==i&&null===this.Qw(i)&&this.dA.add(i,t),null!==(i=t.toVertex)&&i.BD(t),null!==(i=t.fromVertex)&&i.AD(t),t.network=this}},Ps.prototype.addLink=function(t){if(null===t)return null;var i=t.V,e=t.ba,n=this.Qw(t);return null===n?(n=this.createEdge(),n.link=t,null!==i&&(n.fromVertex=this.Xs(i)),null!==e&&(n.toVertex=this.Xs(e)),this.Oo(n)):(n.fromVertex=null!==i?this.Xs(i):null,n.toVertex=null!==e?this.Xs(e):null),n},Ps.prototype.deleteEdge=Ps.prototype.Zo=function(t){if(null!==t){var i=t.toVertex;null!==i&&i.bE(t),null!==(i=t.fromVertex)&&i.aE(t),Ss(this,t)}},Ps.prototype.deleteLink=function(t){null!==t&&null!==(t=this.Qw(t))&&this.Zo(t)},Ps.prototype.findEdge=Ps.prototype.Qw=function(t){return null===t?null:this.dA.ka(t)},Ps.prototype.linkVertexes=Ps.prototype.tp=function(t,i,e){if(null===t||null===i)return null;if(t.network===this&&i.network===this){var n=this.createEdge();return n.link=e,n.fromVertex=t,n.toVertex=i,this.Oo(n),n}return null},Ps.prototype.reverseEdge=Ps.prototype.Bx=function(t){if(null!==t){var i=t.fromVertex,e=t.toVertex;null!==i&&null!==e&&(i.aE(t),e.bE(t),t.Bx(),i.BD(t),e.AD(t))}},Ps.prototype.deleteSelfEdges=Ps.prototype.Mw=function(){for(var t=xh.lb(),i=this.edges.i;i.next();){var e=i.value;e.fromVertex===e.toVertex&&t.push(e)}for(i=t.length,e=0;e<i;e++)this.Zo(t[e]);xh.ta(t)},Ps.prototype.deleteArtificialVertexes=function(){for(var t=xh.lb(),i=this.vertexes.i;i.next();){var e=i.value;null===e.Jc&&t.push(e)}for(e=t.length,i=0;i<e;i++)this.cE(t[i]);for(e=xh.lb(),i=this.edges.i;i.next();){var n=i.value;null===n.link&&e.push(n)}for(n=e.length,i=0;i<n;i++)this.Zo(e[i]);xh.ta(t),xh.ta(e)},Ps.prototype.splitIntoSubNetworks=Ps.prototype.tJ=function(){this.deleteArtificialVertexes(),function(t){for(var i=xh.lb(),e=t.edges.i;e.next();){var n=e.value;null!==n.fromVertex&&null!==n.toVertex||i.push(n)}for(e=i.length,n=0;n<e;n++)t.Zo(i[n]);xh.ta(i)}(this),this.Mw();for(var t=new u(Ps),i=!0;i;)for(var i=!1,e=this.vertexes.i;e.next();){var n=e.value;if(0<n.Se.count||0<n.Me.count){i=this.Rb.createNetwork(),t.add(i),Ns(this,i,n),i=!0;break}}return t.sort(function(t,i){return null===t||null===i||t===i?0:i.vertexes.count-t.vertexes.count}),t},Ps.prototype.findAllParts=function(){for(var t=new c(tr),i=this.vertexes.i;i.next();)t.add(i.value.Jc);for(i=this.edges.i;i.next();)t.add(i.value.link);return t},xh.ea("LayoutVertex",Cs),Cs.prototype.clear=function(){this.ud=this.je=null,this.Se=new u(js),this.Me=new u(js)},Cs.prototype.toString=function(t){void 0===t&&(t=0);var i="LayoutVertex#"+xh.pd(this);if(0<t&&(i+=null!==this.Jc?"("+this.Jc.toString()+")":"",1<t)){t="";for(var e=!0,n=this.Se.i;n.next();){var o=n.value;e?e=!1:t+=",",t+=o.toString(0)}for(o="",e=!0,n=this.Me.i;n.next();){var r=n.value;e?e=!1:o+=",",o+=r.toString(0)}i+=" sources: "+t+" destinations: "+o}return i},xh.defineProperty(Cs,{data:"data"},function(){return this.je},function(t){if(this.je=t,null!==t){t=(n=t.bounds).x;var i=n.y,e=n.width,n=n.height;this.O.m(e/2,n/2),this.N.m(t,i,e,n)}}),xh.defineProperty(Cs,{Jc:"node"},function(){return this.ud},function(t){if(this.ud!==t){this.ud=t,t.rf();var i=(o=t.Y).x,e=o.y,n=o.width,o=o.height;if(isNaN(i)&&(i=0),isNaN(e)&&(e=0),this.N.m(i,e,n,o),!(t instanceof vs)&&(t=t.bc.Za(zh)).K())return void this.O.m(t.x-i,t.y-e);this.O.m(n/2,o/2)}}),xh.defineProperty(Cs,{nb:"bounds"},function(){return this.N},function(t){this.N.L(t)||this.N.assign(t)}),xh.defineProperty(Cs,{focus:"focus"},function(){return this.O},function(t){this.O.L(t)||this.O.assign(t)}),xh.defineProperty(Cs,{oa:"centerX"},function(){return this.N.x+this.O.x},function(t){var i=this.N;i.x+this.O.x!==t&&(i.Oa(),i.x=t-this.O.x,i.freeze())}),xh.defineProperty(Cs,{va:"centerY"},function(){return this.N.y+this.O.y},function(t){var i=this.N;i.y+this.O.y!==t&&(i.Oa(),i.y=t-this.O.y,i.freeze())}),xh.defineProperty(Cs,{tt:"focusX"},function(){return this.O.x},function(t){var i=this.O;i.x!==t&&(i.Oa(),i.x=t,i.freeze())}),xh.defineProperty(Cs,{ut:"focusY"},function(){return this.O.y},function(t){var i=this.O;i.y!==t&&(i.Oa(),i.y=t,i.freeze())}),xh.defineProperty(Cs,{x:"x"},function(){return this.N.x},function(t){var i=this.N;i.x!==t&&(i.Oa(),i.x=t,i.freeze())}),xh.defineProperty(Cs,{y:"y"},function(){return this.N.y},function(t){var i=this.N;i.y!==t&&(i.Oa(),i.y=t,i.freeze())}),xh.defineProperty(Cs,{width:"width"},function(){return this.N.width},function(t){var i=this.N;i.width!==t&&(i.Oa(),i.width=t,i.freeze())}),xh.defineProperty(Cs,{height:"height"},function(){return this.N.height},function(t){var i=this.N;i.height!==t&&(i.Oa(),i.height=t,i.freeze())}),Cs.prototype.commit=function(){var t=this.je;if(null!==t){var i=this.nb,e=t.bounds;xh.Va(e)?(e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height):t.bounds=i.copy()}else if(null!==(t=this.Jc)){if(i=this.nb,!(t instanceof vs)){var e=t.Y,n=t.bc.Za(zh);if(e.K()&&n.K())return void t.moveTo(i.x+this.tt-(n.x-e.x),i.y+this.ut-(n.y-e.y))}t.moveTo(i.x,i.y)}},Cs.prototype.addSourceEdge=Cs.prototype.BD=function(t){null!==t&&(this.Se.contains(t)||this.Se.add(t))},Cs.prototype.deleteSourceEdge=Cs.prototype.bE=function(t){null!==t&&this.Se.remove(t)},Cs.prototype.addDestinationEdge=Cs.prototype.AD=function(t){null!==t&&(this.Me.contains(t)||this.Me.add(t))},Cs.prototype.deleteDestinationEdge=Cs.prototype.aE=function(t){null!==t&&this.Me.remove(t)},xh.u(Cs,{sJ:"sourceVertexes"},function(){for(var t=new c(Cs),i=this.lc;i.next();)t.add(i.value.fromVertex);return t.i}),xh.u(Cs,{rH:"destinationVertexes"},function(){for(var t=new c(Cs),i=this.$b;i.next();)t.add(i.value.toVertex);return t.i}),xh.u(Cs,{vertexes:"vertexes"},function(){for(var t=new c(Cs),i=this.lc;i.next();)t.add(i.value.fromVertex);for(i=this.$b;i.next();)t.add(i.value.toVertex);return t.i}),xh.u(Cs,{lc:"sourceEdges"},function(){return this.Se.i}),xh.u(Cs,{$b:"destinationEdges"},function(){return this.Me.i}),xh.u(Cs,{edges:"edges"},function(){for(var t=new u(js),i=this.lc;i.next();)t.add(i.value);for(i=this.$b;i.next();)t.add(i.value);return t.i}),xh.u(Cs,{yH:"edgesCount"},function(){return this.Se.count+this.Me.count});var Vf;Cs.standardComparer=Vf=function(t,i){var e=t.ud,n=i.ud;return e?n?(e=e.text,n=n.text,e<n?-1:e>n?1:0):1:null!==n?-1:0},Cs.smartComparer=function(t,i){if(null!==t){if(null!==i){var e=t.ud,n=i.ud;if(null!==e){if(null!==n){for(var e=e.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),n=n.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),o=0;o<e.length;o++)if(""!==n[o]&&void 0!==n[o]){var r=parseFloat(e[o]),s=parseFloat(n[o]);if(isNaN(r)){if(!isNaN(s))return 1;if(0!==e[o].localeCompare(n[o]))return e[o].localeCompare(n[o])}else{if(isNaN(s))return-1;if(0!=r-s)return r-s}}else if(""!==e[o])return 1;return""!==n[o]&&void 0!==n[o]?-1:0}return 1}return null!==n?-1:0}return 1}return null!==i?-1:0},xh.ea("LayoutEdge",js),js.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null},js.prototype.toString=function(t){void 0===t&&(t=0);var i="LayoutEdge#"+xh.pd(this);return 0<t&&(i+=null!==this.link?"("+this.link.toString()+")":"",1<t&&(i+=" "+(this.fromVertex?this.fromVertex.toString():"null")+" --\x3e "+(this.toVertex?this.toVertex.toString():"null"))),i},js.prototype.Bx=function(){var t=this.fromVertex;this.fromVertex=this.toVertex,this.toVertex=t},js.prototype.commit=function(){},js.prototype.getOtherVertex=js.prototype.KH=function(t){return this.toVertex===t?this.fromVertex:this.fromVertex===t?this.toVertex:null},xh.Ja(Ls,ks),xh.ea("GridLayout",Ls),Ls.prototype.cloneProtected=function(t){ks.prototype.cloneProtected.call(this,t),t.Ts=this.Ts,t.Ss=this.Ss,t.kj.assign(this.kj),t.Sh.assign(this.Sh),t.Ce=this.Ce,t.hd=this.hd,t.Rh=this.Rh,t.yh=this.yh},Ls.prototype.doLayout=function(t){null===t&&xh.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"),this.Xd=this.initialOrigin(this.Xd);for(var i=this.g,e=(t=this.XG(t)).copy().i;e.next();){var n=e.value;if(n instanceof zr){var o=n;if(null!==o.V||null!==o.ba){t.remove(o);continue}}if(n.rf(),n instanceof vs)for(n=n.Ic;n.next();)t.remove(n.value)}if(0!==(o=t.dc()).length){switch(this.sorting){case Xf:o.reverse();break;case Qf:o.sort(this.comparer);break;case Zf:o.sort(this.comparer),o.reverse()}C=this.JJ;isNaN(C)&&(C=0);var r=this.VF,r=isNaN(r)&&null!==i?Math.max(i.tb.width-i.padding.left-i.padding.right,0):Math.max(this.VF,0);switch(0>=C&&0>=r&&(C=1),t=this.spacing.width,isFinite(t)||(t=0),e=this.spacing.height,isFinite(e)||(e=0),null!==i&&i.Sb("Layout"),n=[],this.alignment){case Kf:var s=t,a=e,h=Math.max(this.To.width,1);if(!isFinite(h))for(m=h=0;m<o.length;m++)var l=o[m],u=l.Ca,h=Math.max(h,u.width);var h=Math.max(h+s,1),f=Math.max(this.To.height,1);if(!isFinite(f))for(m=f=0;m<o.length;m++)l=o[m],u=l.Ca,f=Math.max(f,u.height);for(var f=Math.max(f+a,1),c=this.Nf,p=this.Xd.x,d=p,y=this.Xd.y,v=0,g=0,m=0;m<o.length;m++){var u=(l=o[m]).Ca,x=Math.ceil((u.width+s)/h)*h,w=Math.ceil((u.height+a)/f)*f,k=0;switch(c){case Yf:k=Math.abs(d-u.width);break;default:k=d+u.width}switch((0<C&&v>C-1||0<r&&0<v&&k>r)&&(n.push(new M(0,y,r+s,g)),v=0,d=p,y+=g,g=0),g=Math.max(g,w),w=0,c){case Yf:w=-u.width;break;default:w=0}switch(l.moveTo(d+w,y),c){case Yf:d-=x;break;default:d+=x}v++}n.push(new M(0,y,r+s,g));break;case Uf:for(s=C,a=t,h=e,m=Math.max(this.To.width,1),l=y=x=0,u=xh.M(),C=0;C<o.length;C++)f=o[C],c=f.Ca,p=or(f,f.bc,f.gf,u),x=Math.max(x,p.x),y=Math.max(y,c.width-p.x),l=Math.max(l,p.y);switch(d=this.Nf){case Yf:x+=a;break;default:y+=a}var m=isFinite(m)?Math.max(m+a,1):Math.max(x+y,1),P=y=this.Xd.x,v=this.Xd.y,g=0;r>=x&&(r-=x);for(var x=w=0,k=Math.max(this.To.height,1),T=l=0,S=!0,N=xh.M(),C=0;C<o.length;C++){if(f=o[C],c=f.Ca,p=or(f,f.bc,f.gf,u),0<g)switch(d){case Yf:P=(P-y-(c.width-p.x))/m,P=(P=hl.Qa(Math.round(P),P)?Math.round(P):Math.floor(P))*m+y;break;default:P=(P-y+p.x)/m,P=(P=hl.Qa(Math.round(P),P)?Math.round(P):Math.ceil(P))*m+y}else switch(d){case Yf:w=P+p.x+c.width;break;default:w=P-p.x}j=0;switch(d){case Yf:j=-(P+p.x)+w;break;default:j=P+c.width-p.x-w}if(0<s&&g>s-1||0<r&&0<g&&j>r){for(n.push(new M(0,S?v-l:v,r+a,T+l+h)),P=0;P<g&&C!==g;P++){var j,L=or(j=o[C-g+P],j.bc,j.gf,N);j.moveTo(j.position.x,j.position.y+l-L.y)}T+=h,v=S?v+T:v+(T+l),g=T=l=0,P=y,S=!1}switch(P===y&&(x=d===Yf?Math.max(x,c.width-p.x):Math.min(x,-p.x)),l=Math.max(l,p.y),T=Math.max(T,c.height-p.y),isFinite(k)&&(T=Math.max(T,Math.max(c.height,k)-p.y)),S?f.moveTo(P-p.x,v-p.y):f.moveTo(P-p.x,v),d){case Yf:P-=p.x+a;break;default:P+=c.width-p.x+a}g++}for(n.push(new M(0,v,r+a,(S?T:T+l)+h)),P=0;P<g&&C!==g;P++)j=o[C-g+P],L=or(j,j.bc,j.gf,u),j.moveTo(j.position.x,j.position.y+l-L.y);if(xh.v(u),xh.v(N),d===Yf)for(C=0;C<n.length;C++)o=n[C],o.width+=x,o.x-=x;else for(C=0;C<n.length;C++)(o=n[C]).x>x&&(o.width+=o.x-x,o.x=x)}for(s=C=r=o=0;s<n.length;s++)a=n[s],o=Math.min(o,a.x),r=Math.min(r,a.y),C=Math.max(C,a.x+a.width);this.Nf===Yf?this.commitLayers(n,new b(o+t/2-(C+o),r-e/2)):this.commitLayers(n,new b(o-t/2,r-e/2)),null!==i&&i.Ad("Layout"),this.xf=!0}},Ls.prototype.commitLayers=function(){},xh.defineProperty(Ls,{VF:"wrappingWidth"},function(){return this.Ts},function(t){this.Ts!==t&&(xh.j(t,"number",Ls,"wrappingWidth"),0<t||isNaN(t))&&(this.Ts=t,this.hx=isNaN(t),this.H())}),xh.defineProperty(Ls,{JJ:"wrappingColumn"},function(){return this.Ss},function(t){this.Ss!==t&&(xh.j(t,"number",Ls,"wrappingColumn"),0<t||isNaN(t))&&(this.Ss=t,this.H())}),xh.defineProperty(Ls,{To:"cellSize"},function(){return this.kj},function(t){xh.A(t,k,Ls,"cellSize"),this.kj.L(t)||(this.kj.assign(t),this.H())}),xh.defineProperty(Ls,{spacing:"spacing"},function(){return this.Sh},function(t){xh.A(t,k,Ls,"spacing"),this.Sh.L(t)||(this.Sh.assign(t),this.H())}),xh.defineProperty(Ls,{alignment:"alignment"},function(){return this.Ce},function(t){this.Ce!==t&&(xh.rb(t,Ls,Ls,"alignment"),t===Uf||t===Kf)&&(this.Ce=t,this.H())}),xh.defineProperty(Ls,{Nf:"arrangement"},function(){return this.hd},function(t){this.hd!==t&&(xh.rb(t,Ls,Ls,"arrangement"),t===Jf||t===Yf)&&(this.hd=t,this.H())}),xh.defineProperty(Ls,{sorting:"sorting"},function(){return this.Rh},function(t){this.Rh!==t&&(xh.rb(t,Ls,Ls,"sorting"),t===Wf||t===Xf||t===Qf||t===Zf)&&(this.Rh=t,this.H())}),xh.defineProperty(Ls,{comparer:"comparer"},function(){return this.yh},function(t){this.yh!==t&&(xh.j(t,"function",Ls,"comparer"),this.yh=t,this.H())});var Hf;Ls.standardComparer=Hf=function(t,i){var e=t.text,n=i.text;return e<n?-1:e>n?1:0},Ls.smartComparer=function(t,i){if(null!==t){if(null!==i){for(var e=t.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),n=i.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),o=0;o<e.length;o++)if(""!==n[o]&&void 0!==n[o]){var r=parseFloat(e[o]),s=parseFloat(n[o]);if(isNaN(r)){if(!isNaN(s))return 1;if(0!==e[o].localeCompare(n[o]))return e[o].localeCompare(n[o])}else{if(isNaN(s))return-1;if(0!=r-s)return r-s}}else if(""!==e[o])return 1;return""!==n[o]&&void 0!==n[o]?-1:0}return 1}return null!==i?-1:0};var Kf;Ls.Position=Kf=xh.p(Ls,"Position",0);var Uf;Ls.Location=Uf=xh.p(Ls,"Location",1);var Jf;Ls.LeftToRight=Jf=xh.p(Ls,"LeftToRight",2);var Yf;Ls.RightToLeft=Yf=xh.p(Ls,"RightToLeft",3);var Wf;Ls.Forward=Wf=xh.p(Ls,"Forward",4);var Xf;Ls.Reverse=Xf=xh.p(Ls,"Reverse",5);var Qf;Ls.Ascending=Qf=xh.p(Ls,"Ascending",6);var Zf;Ls.Descending=Zf=xh.p(Ls,"Descending",7),xh.Ja(Ds,ks),xh.ea("CircularLayout",Ds),Ds.prototype.cloneProtected=function(t){ks.prototype.cloneProtected.call(this,t),t.$r=this.$r,t.iq=this.iq,t.Es=this.Es,t.Gs=this.Gs,t.hd=this.hd,t.ca=this.ca,t.Rh=this.Rh,t.yh=this.yh,t.Sh=this.Sh,t.Qr=this.Qr},Ds.prototype.createNetwork=function(){return new Ks},Ds.prototype.doLayout=function(t){if(null===t&&xh.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(t)),1>=(t=this.network.vertexes).count)1===t.count&&(t=t.first(),t.oa=0,t.va=0);else{(l=new u(Us)).Tc(t.i),t=new u(Us);var i,e=new u(Us);i=this.sort(l);var n=this.Ay,o=this.$B,r=this.Jd,s=this.Pn,a=this.By,h=this.Nq,l=this.Ek,f=this.pD,c=this.qg,p=this.Ru,n=this.Nf,o=this.ox,r=this.TI;if((!isFinite(r)||0>=r)&&(r=NaN),s=this.PG,(!isFinite(s)||0>=s)&&(s=1),a=this.xe,isFinite(a)||(a=0),h=this.Bf,(!isFinite(h)||360<h||1>h)&&(h=360),l=this.spacing,isFinite(l)||(l=NaN),n===ic&&o===cc?n=$f:n===ic&&o!==cc&&(o=cc,n=this.Nf),(this.direction===oc||this.direction===rc)&&this.sorting!==uc){for(v=0;!(v>=i.length)&&(t.add(i.ha(v)),!(v+1>=i.length));v+=2)e.add(i.ha(v+1));this.direction===oc?(this.Nf===ic&&t.reverse(),(i=new u(Us)).Tc(t),i.Tc(e)):(this.Nf===ic&&e.reverse(),(i=new u(Us)).Tc(e),i.Tc(t))}for(var d=i.length,y=f=0,v=0;v<i.length;v++){var c=a+h*y*(this.direction===ec?1:-1)/d,g=i.ha(v).diameter;isNaN(g)&&(g=Js(i.ha(v),c)),360>h&&(0===v||v===i.length-1)&&(g/=2),f+=g,y++}if(isNaN(r)||n===ic){if(isNaN(l)&&(l=6),n!==$f&&n!==ic){for(g=-1/0,v=0;v<d;v++){var p=i.ha(v),m=i.ha(v===d-1?0:v+1);isNaN(p.diameter)&&Js(p,0),isNaN(m.diameter)&&Js(m,0),g=Math.max(g,(p.diameter+m.diameter)/2)}p=g+l,n===tc?(c=2*Math.PI/d,r=(g+l)/c):r=Gs(this,p*(360<=h?d:d-1),s,a*Math.PI/180,h*Math.PI/180)}else r=Gs(this,f+(360<=h?d:d-1)*(n!==ic?l:1.6*l),s,a*Math.PI/180,h*Math.PI/180);c=r*s}else if(c=r*s,y=Rs(this,r,c,a*Math.PI/180,h*Math.PI/180),isNaN(l))n!==$f&&n!==ic||(l=(y-f)/(360<=h?d:d-1));else if(n===$f||n===ic)(v=(y-f)/(360<=h?d:d-1))<l?(r=Gs(this,f+l*(360<=h?d:d-1),s,a*Math.PI/180,h*Math.PI/180),c=r*s):l=v;else{for(g=-1/0,v=0;v<d;v++)p=i.ha(v),m=i.ha(v===d-1?0:v+1),isNaN(p.diameter)&&Js(p,0),isNaN(m.diameter)&&Js(m,0),g=Math.max(g,(p.diameter+m.diameter)/2);(v=Gs(this,(p=g+l)*(360<=h?d:d-1),s,a*Math.PI/180,h*Math.PI/180))>r?(r=v,c=r*s):p=y/(360<=h?d:d-1)}if(this.Ay=n,this.$B=o,this.Jd=r,this.Pn=s,this.By=a,this.Nq=h,this.Ek=l,this.pD=f,this.qg=c,this.Ru=p,l=i,i=this.Ay,n=this.Jd,o=this.By,s=this.Nq,a=this.Ek,h=this.qg,f=this.Ru,this.direction!==oc&&this.direction!==rc||i!==ic)if(this.direction===oc||this.direction===rc){switch(r=0,i){case _f:r=180*Vs(this,n,h,o,f)/Math.PI;break;case $f:f=l=0,null!==(r=t.first())&&(l=Js(r,Math.PI/2)),null!==(r=e.first())&&(f=Js(r,Math.PI/2)),r=180*Vs(this,n,h,o,a+(l+f)/2)/Math.PI;break;case tc:r=s/l.length}if(this.direction===oc){switch(i){case _f:zs(this,t,o,nc);break;case $f:Fs(this,t,o,nc);break;case tc:As(this,t,s/2,o,nc)}switch(i){case _f:zs(this,e,o+r,ec);break;case $f:Fs(this,e,o+r,ec);break;case tc:As(this,e,s/2,o+r,ec)}}else{switch(i){case _f:zs(this,e,o,nc);break;case $f:Fs(this,e,o,nc);break;case tc:As(this,e,s/2,o,nc)}switch(i){case _f:zs(this,t,o+r,ec);break;case $f:Fs(this,t,o+r,ec);break;case tc:As(this,t,s/2,o+r,ec)}}}else switch(i){case _f:zs(this,l,o,this.direction);break;case $f:Fs(this,l,o,this.direction);break;case tc:As(this,l,s,o,this.direction);break;case ic:Os(this,l,s,o,this.direction)}else Os(this,l,s,o-s/2,ec)}this.updateParts(),this.network=null,this.xf=!0},Ds.prototype.commitLayout=function(){this.commitNodes(),this.Ht&&this.commitLinks()},Ds.prototype.commitNodes=function(){for(var t=this.EG,i=this.network.vertexes.i;i.next();){var e=i.value;e.x+=t.x,e.y+=t.y,e.commit()}},Ds.prototype.commitLinks=function(){for(var t=this.network.edges.i;t.next();)t.value.commit()},Ds.prototype.sort=function(t){switch(this.sorting){case sc:break;case ac:t.reverse();break;case hc:t.sort(this.comparer);break;case lc:t.sort(this.comparer),t.reverse();break;case uc:for(var i=[],e=0;e<t.length;e++)i.push(0);for(var n=new u(Us),e=0;e<t.length;e++){var o=-1,r=-1;if(0===e)for(var s=0;s<t.length;s++){(h=t.ha(s).yH)>o&&(o=h,r=s)}else for(s=0;s<t.length;s++)(h=i[s])>o&&(o=h,r=s);for(n.add(t.ha(r)),i[r]=-1,o=0,s=(r=t.ha(r)).lc;s.next();)0>(o=t.indexOf(s.value.fromVertex))||0<=i[o]&&i[o]++;for(r=r.$b;r.next();)0>(o=t.indexOf(r.value.toVertex))||0<=i[o]&&i[o]++}for(t=[],i=0;i<n.length;i++){s=n.ha(i),t[i]=[];for(var a=0,e=s.$b;e.next();)(a=n.indexOf(e.value.toVertex))!==i&&0>t[i].indexOf(a)&&t[i].push(a);for(e=s.lc;e.next();)(a=n.indexOf(e.value.fromVertex))!==i&&0>t[i].indexOf(a)&&t[i].push(a)}for(s=[],i=0;i<t.length;i++)s[i]=0;for(var e=[],h=[],l=[],o=[],r=new u(Us),f=0,i=0;i<t.length;i++){if(1===(v=t[i].length))o.push(i);else if(0===v)r.add(n.ha(i));else{if(0===f)e.push(i);else{for(var c=1/0,p=1/0,d=-1,y=[],v=0;v<e.length;v++)0>t[e[v]].indexOf(e[v===e.length-1?0:v+1])&&y.push(v===e.length-1?0:v+1);if(0===y.length)for(v=0;v<e.length;v++)y.push(v);for(v=0;v<y.length;v++){var g,m=y[v],a=t[i];g=h;for(var b=l,x=s,w=m,k=e,M=0,P=0;P<g.length;P++){var T=x[g[P]],S=x[b[P]],N=0,C=0;if(T<S?(N=T,C=S):(N=S,C=T),N<w&&w<=C)for(T=0;T<a.length;T++)S=a[T],0>k.indexOf(S)||N<x[S]&&x[S]<C||N===x[S]||C===x[S]||M++;else for(T=0;T<a.length;T++)S=a[T],0>k.indexOf(S)||N<x[S]&&x[S]<C&&N!==x[S]&&C!==x[S]&&M++}for(g=M,x=b=0;x<t[i].length;x++)0<=(a=e.indexOf(t[i][x]))&&(a=Math.abs(m-(a>=m?a+1:a)),b+=a<e.length+1-a?a:e.length+1-a);for(x=0;x<h.length;x++)a=s[h[x]],w=s[l[x]],a>=m&&a++,w>=m&&w++,a>w&&(k=w,w=a,a=k),w-a<(e.length+2)/2==(a<m&&m<=w)&&b++;(g<c||g===c&&b<p)&&(c=g,p=b,d=m)}for(e.splice(d,0,i),v=0;v<e.length;v++)s[e[v]]=v;for(v=0;v<t[i].length;v++)c=t[i][v],0<=e.indexOf(c)&&(h.push(i),l.push(c))}f++}}for(h=!1,l=e.length;;){for(h=!0,s=0;s<o.length;s++)if(i=o[s],f=t[i][0],0<=(a=e.indexOf(f))){for(p=v=0;p<t[f].length;p++)c=t[f][p],0>(c=e.indexOf(c))||c===a||(d=c>a?c-a:a-c,v+=c<a!=d>l-d?1:-1);e.splice(0>v?a:a+1,0,i),o.splice(s,1),s--}else h=!1;if(h)break;e.push(o[0]),o.splice(0,1)}for(i=0;i<e.length;i++)a=e[i],r.add(n.ha(a));return r;default:xh.k("Invalid sorting type.")}return t},xh.defineProperty(Ds,{TI:"radius"},function(){return this.$r},function(t){this.$r!==t&&(xh.j(t,"number",Ds,"radius"),0<t||isNaN(t))&&(this.$r=t,this.H())}),xh.defineProperty(Ds,{PG:"aspectRatio"},function(){return this.iq},function(t){this.iq!==t&&(xh.j(t,"number",Ds,"aspectRatio"),0<t&&(this.iq=t,this.H()))}),xh.defineProperty(Ds,{xe:"startAngle"},function(){return this.Es},function(t){this.Es!==t&&(xh.j(t,"number",Ds,"startAngle"),this.Es=t,this.H())}),xh.defineProperty(Ds,{Bf:"sweepAngle"},function(){return this.Gs},function(t){this.Gs!==t&&(xh.j(t,"number",Ds,"sweepAngle"),this.Gs=0<t&&360>=t?t:360,this.H())}),xh.defineProperty(Ds,{Nf:"arrangement"},function(){return this.hd},function(t){this.hd!==t&&(xh.rb(t,Ds,Ds,"arrangement"),t===ic||t===$f||t===_f||t===tc)&&(this.hd=t,this.H())}),xh.defineProperty(Ds,{direction:"direction"},function(){return this.ca},function(t){this.ca!==t&&(xh.rb(t,Ds,Ds,"direction"),t===ec||t===nc||t===oc||t===rc)&&(this.ca=t,this.H())}),xh.defineProperty(Ds,{sorting:"sorting"},function(){return this.Rh},function(t){this.Rh!==t&&(xh.rb(t,Ds,Ds,"sorting"),t===sc||t===ac||t===hc||lc||t===uc)&&(this.Rh=t,this.H())}),xh.defineProperty(Ds,{comparer:"comparer"},function(){return this.yh},function(t){this.yh!==t&&(xh.j(t,"function",Ds,"comparer"),this.yh=t,this.H())}),xh.defineProperty(Ds,{spacing:"spacing"},function(){return this.Sh},function(t){this.Sh!==t&&(xh.j(t,"number",Ds,"spacing"),this.Sh=t,this.H())}),xh.defineProperty(Ds,{ox:"nodeDiameterFormula"},function(){return this.Qr},function(t){this.Qr!==t&&(xh.rb(t,Ds,Ds,"nodeDiameterFormula"),t===fc||t===cc)&&(this.Qr=t,this.H())}),xh.u(Ds,{FG:"actualXRadius"},function(){return this.Jd}),xh.u(Ds,{GG:"actualYRadius"},function(){return this.qg}),xh.u(Ds,{MJ:"actualSpacing"},function(){return this.Ek}),xh.u(Ds,{EG:"actualCenter"},function(){return isNaN(this.Xd.x)||isNaN(this.Xd.y)?new b(0,0):new b(this.Xd.x+this.FG,this.Xd.y+this.GG)});var $f;Ds.ConstantSpacing=$f=xh.p(Ds,"ConstantSpacing",0);var _f;Ds.ConstantDistance=_f=xh.p(Ds,"ConstantDistance",1);var tc;Ds.ConstantAngle=tc=xh.p(Ds,"ConstantAngle",2);var ic;Ds.Packed=ic=xh.p(Ds,"Packed",3);var ec;Ds.Clockwise=ec=xh.p(Ds,"Clockwise",4);var nc;Ds.Counterclockwise=nc=xh.p(Ds,"Counterclockwise",5);var oc;Ds.BidirectionalLeft=oc=xh.p(Ds,"BidirectionalLeft",6);var rc;Ds.BidirectionalRight=rc=xh.p(Ds,"BidirectionalRight",7);var sc;Ds.Forwards=sc=xh.p(Ds,"Forwards",8);var ac;Ds.Reverse=ac=xh.p(Ds,"Reverse",9);var hc;Ds.Ascending=hc=xh.p(Ds,"Ascending",10);var lc;Ds.Descending=lc=xh.p(Ds,"Descending",11);var uc;Ds.Optimized=uc=xh.p(Ds,"Optimized",12);var fc;Ds.Pythagorean=fc=xh.p(Ds,"Pythagorean",13);var cc;Ds.Circular=cc=xh.p(Ds,"Circular",14),Hs.prototype.compare=function(t,i){if(0<t&&0>this.fp||Math.abs(t)<Math.abs(this.fp)&&!(0>t&&0<this.fp)){this.fp=t,this.rn=[],this.Up=[];for(var e=0;e<i.length;e++)this.rn[e]=i[e].nb.x,this.Up[e]=i[e].nb.y}},Hs.prototype.commit=function(t){if(null!==this.rn&&null!==this.Up)for(var i=0;i<this.rn.length;i++){var e=t.ha(i);e.x=this.rn[i],e.y=this.Up[i]}},xh.Ja(Ks,Ps),xh.ea("CircularNetwork",Ks),Ks.prototype.createVertex=function(){return new Us},Ks.prototype.createEdge=function(){return new Ys},xh.Ja(Us,Cs),xh.ea("CircularVertex",Us),xh.Ja(Ys,js),xh.ea("CircularEdge",Ys),xh.Ja(Ws,ks),xh.ea("ForceDirectedLayout",Ws),Ws.prototype.cloneProtected=function(t){ks.prototype.cloneProtected.call(this,t),t.bg.assign(this.bg),t.hq=this.hq,t.Ph=this.Ph,t.xh=this.xh,t.no=this.no,t.Pq=this.Pq,t.Gh=this.Gh,t.as=this.as,t.Kn=this.Kn,t.Jn=this.Jn,t.Gn=this.Gn,t.In=this.In,t.Fq=this.Fq,t.Eq=this.Eq},Ws.prototype.createNetwork=function(){return new ta},Ws.prototype.doLayout=function(t){if(null===t&&xh.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(t)),t=this.hA,0<this.network.vertexes.count){this.network.Mw();for(var i=this.network.vertexes.i;i.next();){var e=i.value;e.charge=this.electricalCharge(e),e.mass=this.gravitationalMass(e)}for(i=this.network.edges.i;i.next();)e=i.value,e.stiffness=this.springStiffness(e),e.length=this.springLength(e);if(this.xz(),this.or=0,this.needsClusterLayout()){for(e=(i=this.network).tJ().i;e.next();){this.network=e.value;for(o=this.network.vertexes.i;o.next();){var n=o.value;n.Zf=n.vertexes.count,n.hk=1,n.Nm=null,n.qh=null}Xs(this,0,t)}this.network=i,e.reset();for(var o=this.GD,r=e.count,s=!0,a=n=0,h=xh.lb(),l=0;l<r+i.vertexes.count+2;l++)h[l]=null;r=0,e.reset();for(var u=xh.ag();e.next();)if(l=e.value,this.Zg(l,u),s)s=!1,n=u.x+u.width/2,a=u.y+u.height/2,h[0]=new b(u.x+u.width+o.width,u.y),h[1]=new b(u.x,u.y+u.height+o.height),r=2;else{var f=Qs(h,r,n,a,u.width,u.height,o),c=h[f],p=new b(c.x+u.width+o.width,c.y),d=new b(c.x,c.y+u.height+o.height);for(f+1<r&&h.splice(f+1,0,null),h[f]=p,h[f+1]=d,r++,f=c.x-u.x,c=c.y-u.y,l=l.vertexes.i;l.next();)p=l.value,p.oa+=f,p.va+=c}for(xh.ic(u),l=i.vertexes.i;l.next();)s=l.value,u=s.nb,2>r?(n=u.x+u.width/2,a=u.y+u.height/2,h[0]=new b(u.x+u.width+o.width,u.y),h[1]=new b(u.x,u.y+u.height+o.height),r=2):(f=Qs(h,r,n,a,u.width,u.height,o),c=h[f],p=new b(c.x+u.width+o.width,c.y),d=new b(c.x,c.y+u.height+o.height),f+1<r&&h.splice(f+1,0,null),h[f]=p,h[f+1]=d,r++,s.oa=c.x+s.width/2,s.va=c.y+s.height/2);for(xh.ta(h),e.reset();e.next();){for(n=(o=e.value).vertexes.i;n.next();)i.el(n.value);for(o=o.edges.i;o.next();)i.Oo(o.value)}}$s(this,t),this.updateParts()}this.no=t,this.network=null,this.xf=!0},Ws.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var t=0,i=0,e=this.network.vertexes.first().nb,n=this.network.vertexes.i;n.next();){if(n.value.nb.xg(e)&&2<++t)return!0;if(10<i)break;i++}return!1},Ws.prototype.Zg=function(t,i){for(var e=!0,n=t.vertexes.i;n.next();){var o=n.value;e?(e=!1,i.set(o.nb)):i.ei(o.nb)}return i},Ws.prototype.xz=function(){if(this.comments)for(var t=this.network.vertexes.i;t.next();)this.addComments(t.value)},Ws.prototype.addComments=function(t){var i=t.Jc;if(null!==i)for(i=i.jE();i.next();){if("Comment"===(n=i.value).Fc&&n.isVisible()){var e=this.network.Wm(n);null===e&&(e=this.network.Xs(n)),e.charge=this.mH;for(var n=null,o=e.$b;o.next();){var r=o.value;if(r.toVertex===t){n=r;break}}if(null===n)for(o=e.lc;o.next();)if((r=o.value).fromVertex===t){n=r;break}null===n&&(n=this.network.tp(t,e,null)),n.length=this.nH}}},Ws.prototype.moveFixedVertex=function(){},Ws.prototype.commitLayout=function(){this.KA(),this.commitNodes(),this.Ht&&this.commitLinks()},Ws.prototype.KA=function(){if(this.Op)for(var t=this.network.edges.i;t.next();){var i=t.value.link;null!==i&&(i.Ab=jh,i.Bb=jh)}},Ws.prototype.commitNodes=function(){var t=0,i=0;if(this.OG){e=xh.ag();this.Zg(this.network,e),t=(i=this.Xd).x-e.x,i=i.y-e.y,xh.ic(e)}for(var e=xh.ag(),n=this.network.vertexes.i;n.next();){var o=n.value;0===t&&0===i||(e.assign(o.nb),e.x+=t,e.y+=i,o.nb=e),o.commit()}xh.ic(e)},Ws.prototype.commitLinks=function(){for(var t=this.network.edges.i;t.next();)t.value.commit()},Ws.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.Kn:t},Ws.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.Jn:t},Ws.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.Gn:t},Ws.prototype.electricalFieldX=function(){return 0},Ws.prototype.electricalFieldY=function(){return 0},Ws.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.In:t},Ws.prototype.gravitationalFieldX=function(){return 0},Ws.prototype.gravitationalFieldY=function(){return 0},Ws.prototype.isFixed=function(t){return t.isFixed},xh.u(Ws,{mK:"currentIteration"},function(){return this.or}),xh.defineProperty(Ws,{GD:"arrangementSpacing"},function(){return this.bg},function(t){xh.A(t,k,Ws,"arrangementSpacing"),this.bg.L(t)||(this.bg.assign(t),this.H())}),xh.defineProperty(Ws,{OG:"arrangesToOrigin"},function(){return this.hq},function(t){this.hq!==t&&(xh.j(t,"boolean",Ws,"arrangesToOrigin"),this.hq=t,this.H())}),xh.defineProperty(Ws,{Op:"setsPortSpots"},function(){return this.Ph},function(t){this.Ph!==t&&(xh.j(t,"boolean",Ws,"setsPortSpots"),this.Ph=t,this.H())}),xh.defineProperty(Ws,{comments:"comments"},function(){return this.xh},function(t){this.xh!==t&&(xh.j(t,"boolean",Ws,"comments"),this.xh=t,this.H())}),xh.defineProperty(Ws,{hA:"maxIterations"},function(){return this.no},function(t){this.no!==t&&(xh.j(t,"number",Ws,"maxIterations"),0<=t&&(this.no=t,this.H()))}),xh.defineProperty(Ws,{gE:"epsilonDistance"},function(){return this.Pq},function(t){this.Pq!==t&&(xh.j(t,"number",Ws,"epsilonDistance"),0<t&&(this.Pq=t,this.H()))}),xh.defineProperty(Ws,{FK:"infinityDistance"},function(){return this.Gh},function(t){this.Gh!==t&&(xh.j(t,"number",Ws,"infinityDistance"),1<t&&(this.Gh=t,this.H()))}),xh.defineProperty(Ws,{xx:"randomNumberGenerator"},function(){return this.as},function(t){this.as!==t&&(null!==t&&"function"!=typeof t.random&&xh.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.as=t)}),xh.defineProperty(Ws,{zK:"defaultSpringStiffness"},function(){return this.Kn},function(t){this.Kn!==t&&(xh.j(t,"number",Ws,"defaultSpringStiffness"),this.Kn=t,this.H())}),xh.defineProperty(Ws,{yK:"defaultSpringLength"},function(){return this.Jn},function(t){this.Jn!==t&&(xh.j(t,"number",Ws,"defaultSpringLength"),this.Jn=t,this.H())}),xh.defineProperty(Ws,{sK:"defaultElectricalCharge"},function(){return this.Gn},function(t){this.Gn!==t&&(xh.j(t,"number",Ws,"defaultElectricalCharge"),this.Gn=t,this.H())}),xh.defineProperty(Ws,{tK:"defaultGravitationalMass"},function(){return this.In},function(t){this.In!==t&&(xh.j(t,"number",Ws,"defaultGravitationalMass"),this.In=t,this.H())}),xh.defineProperty(Ws,{nH:"defaultCommentSpringLength"},function(){return this.Fq},function(t){this.Fq!==t&&(xh.j(t,"number",Ws,"defaultCommentSpringLength"),this.Fq=t,this.H())}),xh.defineProperty(Ws,{mH:"defaultCommentElectricalCharge"},function(){return this.Eq},function(t){this.Eq!==t&&(xh.j(t,"number",Ws,"defaultCommentElectricalCharge"),this.Eq=t,this.H())}),xh.Ja(ta,Ps),xh.ea("ForceDirectedNetwork",ta),ta.prototype.createVertex=function(){return new ia},ta.prototype.createEdge=function(){return new ea},xh.Ja(ia,Cs),xh.ea("ForceDirectedVertex",ia),xh.Ja(ea,js),xh.ea("ForceDirectedEdge",ea),xh.Ja(na,ks),xh.ea("LayeredDigraphLayout",na),na.prototype.cloneProtected=function(t){ks.prototype.cloneProtected.call(this,t),t.km=this.km,t.Hd=this.Hd,t.ca=this.ca,t.Fn=this.Fn,t.io=this.io,t.Xn=this.Xn,t.hm=this.hm,t.wn=this.wn,t.Hi=this.Hi,t.Ph=this.Ph,t.tr=this.tr},na.prototype.createNetwork=function(){return new Oa},na.prototype.doLayout=function(t){for(null===t&&xh.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(t)),this.Xd=this.initialOrigin(this.Xd),this.Dv=-1,this.If=this.Dr=0,this.Mr=this.Kr=this.om=null,t=0;t<this.Pg.length;t++)this.Pg[t]=null;if(0<this.network.vertexes.count){for(this.network.Mw(),t=this.network.edges.i;t.next();)t.value.rev=!1;switch(this.Fn){default:case dc:var i=0,e=this.network.vertexes.count-1;(t=[]).length=e+1;for(n=this.network.vertexes.i;n.next();)n.value.valid=!0;for(;null!==function(t){for(t=t.vertexes.i;t.next();){var i=t.value;if(i.valid)return i}return null}(this.network);){for(n=pa(this.network);null!==n;)t[e]=n,e--,n.valid=!1,n=pa(this.network);for(n=da(this.network);null!==n;)t[i]=n,i++,n.valid=!1,n=da(this.network);for(var n=null,o=0,r=this.network.vertexes.i;r.next();){if((f=r.value).valid){for(var s=0,a=f.$b;a.next();)a.value.toVertex.valid&&s++;for(var a=0,h=f.lc;h.next();)h.value.fromVertex.valid&&a++;(null===n||o<s-a)&&(n=f,o=s-a)}}null!==n&&(t[i]=n,i++,n.valid=!1)}for(i=0;i<this.network.vertexes.count;i++)t[i].index=i;for(t=this.network.edges.i;t.next();)(i=t.value).fromVertex.index>i.toVertex.index&&(this.network.Bx(i),i.rev=!0);break;case pc:for(i=this.network.vertexes.i;i.next();)t=i.value,t.$o=-1,t.finish=-1;for(t=this.network.edges.i;t.next();)t.value.forest=!1;for(this.Lr=0,i.reset();i.next();)0===(e=i.value).lc.count&&ya(this,e);for(i.reset();i.next();)-1===(e=i.value).$o&&ya(this,e);for(t.reset();t.next();)(i=t.value).forest||(e=i.fromVertex,n=e.finish,o=i.toVertex,r=o.finish,o.$o<e.$o&&n<r&&(this.network.Bx(i),i.rev=!0))}for(t=this.network.vertexes.i;t.next();)t.value.layer=-1;for(this.qb=-1,this.assignLayers(),t.reset();t.next();)this.qb=Math.max(this.qb,t.value.layer);for(t=[],e=this.network.edges.i;e.next();)i=e.value,i.valid=!1,t.push(i);for(e=0;e<t.length;e++)if(!(i=t[e]).valid&&(null!==i.fromVertex.ud&&null!==i.toVertex.ud||i.fromVertex.layer!==i.toVertex.layer)){if(a=f=s=r=0,o=i.fromVertex,n=i.toVertex,null!==i.link){if(null===(s=i.link))continue;var l=o.ud,r=n.ud;if(null===l||null===r)continue;var u=s.V,f=s.ba,c=s.bd,a=s.Fd;i.rev&&(s=u,h=c,u=f,c=a,f=s,a=h);var p=o.O,s=i.toVertex.O,d=i.rev?n.N:o.N,h=xh.M();d.K()?(or(u,c,zh,h),h.K()||h.assign(p)):h.assign(p),l!==u&&d.K()&&u.isVisible()&&(l=o.N).K()&&(h.x+=d.x-l.x,h.y+=d.y-l.y),u=i.rev?o.N:n.N,l=xh.M(),u.K()?(or(f,a,zh,l),l.K()||l.assign(s)):l.assign(s),r!==f&&u.K()&&f.isVisible()&&(r=n.N).K()&&(l.x+=u.x-r.x,l.y+=u.y-r.y),90===this.ca||270===this.ca?(r=Math.round((h.x-p.x)/this.Hd),f=h.x,s=Math.round((l.x-s.x)/this.Hd),a=l.x):(r=Math.round((h.y-p.y)/this.Hd),f=h.y,s=Math.round((l.y-s.y)/this.Hd),a=l.y),xh.v(h),xh.v(l),i.portFromColOffset=r,i.portFromPos=f,i.portToColOffset=s,i.portToPos=a}else i.portFromColOffset=0,i.portFromPos=0,i.portToColOffset=0,i.portToPos=0;h=o.layer,p=n.layer;t:if(l=i,u=0,null!==(d=l.link)){var y=d.bd,v=d.Fd;if(null!==y&&null!==v){var g=d.V,c=d.ba;if(null!==g&&null!==c){var m=y.Ab,b=v.Bb;this.Op||(d.Ab.Uc()||(m=d.Ab),d.Bb.Uc()||(b=d.Bb));var x=d.kc,w=Da(this,!0);(m.Uc()||m===Ch)&&(m=w);var k=Da(this,!1);if((b.Uc()||b===Ch)&&(b=k),m.$i()&&m.jp(k)&&b.$i()&&b.jp(w)){u=0;break t}w=d.getLinkPoint(g,y,m,!0,x,c,v,xh.M()),m=d.getLinkDirection(g,y,w,m,!0,x,c,v),xh.v(w),m===xa(this,l,!0)?u+=1:this.Op&&null!==g&&1===g.ports.count&&l.rev&&(u+=1),m=d.getLinkPoint(c,v,b,!1,x,g,y,xh.M()),d=d.getLinkDirection(c,v,m,b,!1,x,g,y),xh.v(m),d===xa(this,l,!1)?u+=2:this.Op&&null!==c&&1===c.ports.count&&l.rev&&(u+=2)}}}if(l=1===u||3===u,(u=2===u||3===u)&&(c=this.network.createVertex(),c.ud=null,c.Km=1,c.layer=h,c.near=o,this.network.el(c),o=this.network.tp(o,c,i.link),o.valid=!1,o.rev=i.rev,o.portFromColOffset=r,o.portToColOffset=0,o.portFromPos=f,o.portToPos=0,o=c),d=1,l&&d--,h-p>d&&0<h){for(i.valid=!1,(c=this.network.createVertex()).ud=null,c.Km=2,c.layer=h-1,this.network.el(c),(o=this.network.tp(o,c,i.link)).valid=!0,o.rev=i.rev,o.portFromColOffset=u?0:r,o.portToColOffset=0,o.portFromPos=u?0:f,o.portToPos=0,o=c,h--;h-p>d&&0<h;)c=this.network.createVertex(),c.ud=null,c.Km=3,c.layer=h-1,this.network.el(c),o=this.network.tp(o,c,i.link),o.valid=!0,o.rev=i.rev,o.portFromColOffset=0,o.portToColOffset=0,o.portFromPos=0,o.portToPos=0,o=c,h--;(o=this.network.tp(c,n,i.link)).valid=!l,l&&(c.near=n),o.rev=i.rev,o.portFromColOffset=0,o.portToColOffset=s,o.portFromPos=0,o.portToPos=a}else i.valid=!0}for(i=this.Td=[],e=0;e<=this.qb;e++)i[e]=0;for(t=this.network.vertexes.i;t.next();)e=t.value,e.index=-1;for(this.initializeIndices(),this.Dv=-1,e=this.If=this.Dr=0;e<=this.qb;e++)i[e]>i[this.If]&&(this.Dv=i[e]-1,this.If=e),i[e]<i[this.Dr]&&(this.Dr=e);for(this.Mr=[],e=0;e<i.length;e++)this.Mr[e]=[];for(t.reset();t.next();)i=t.value,e=this.Mr[i.layer],e[i.index]=i;for(this.Hb=-1,t=0;t<=this.qb;t++){for(i=Aa(this,t),e=0,n=this.Td[t],o=0;o<n;o++)r=i[o],e+=this.nodeMinColumnSpace(r,!0),r.column=e,e+=1,e+=this.nodeMinColumnSpace(r,!1);this.Hb=Math.max(this.Hb,e-1),Fa(this,t,i)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.xf=!0},na.prototype.linkMinLength=function(t){var i=t.toVertex;for(t=t.fromVertex.$b;t.next();)t.value.toVertex===i&&0;return 1},na.prototype.nodeMinLayerSpace=function(t,i){return null===t.ud?0:90===this.ca||270===this.ca?i?t.O.y+10:t.N.height-t.O.y+10:i?t.O.x+10:t.N.width-t.O.x+10},na.prototype.nodeMinColumnSpace=function(t,i){if(null===t.ud)return 0;var e=i?t.pA:t.oA;return null!==e?e:90===(e=this.ca)||270===e?i?t.pA=t.O.x/this.Hd+1|0:t.oA=(t.N.width-t.O.x)/this.Hd+1|0:i?t.pA=t.O.y/this.Hd+1|0:t.oA=(t.N.height-t.O.y)/this.Hd+1|0},na.prototype.countCrossings=function(){for(var t=0,i=0;i<=this.qb;i++)for(var e=aa(this,i,1),n=this.Td[i],o=0;o<n;o++)for(var r=o;r<n;r++)t+=e[o*n+r];return t},na.prototype.normalize=function(){e=1/0;this.Hb=-1;for(var t=this.network.vertexes.i;t.next();){var i=t.value,e=Math.min(e,i.column-this.nodeMinColumnSpace(i,!0));this.Hb=Math.max(this.Hb,i.column+this.nodeMinColumnSpace(i,!1))}for(t.reset();t.next();)t.value.column-=e;this.Hb-=e},na.prototype.assignLayers=function(){switch(this.io){case vc:va(this);break;case gc:for(var t=0,i=this.network.vertexes.i;i.next();)t=ma(this,i.value),this.qb=Math.max(t,this.qb);for(i.reset();i.next();)t=i.value,t.layer=this.qb-t.layer;break;default:case yc:for(va(this),i=this.network.vertexes.i;i.next();)i.value.valid=!1;for(i.reset();i.next();)0===(t=i.value).lc.count&&ba(this,t);for(t=1/0,i.reset();i.next();)t=Math.min(t,i.value.layer);for(this.qb=-1,i.reset();i.next();){var e=i.value;e.layer-=t,this.qb=Math.max(this.qb,e.layer)}}},na.prototype.initializeIndices=function(){switch(this.Xn){default:case xc:for(var t=this.network.vertexes.i;t.next();){var i=t.value,e=i.layer;i.index=this.Td[e],this.Td[e]++}break;case mc:for(t=this.network.vertexes.i,i=this.qb;0<=i;i--)for(t.reset();t.next();)(e=t.value).layer===i&&-1===e.index&&wa(this,e);break;case bc:for(t=this.network.vertexes.i,i=0;i<=this.qb;i++)for(t.reset();t.next();)(e=t.value).layer===i&&-1===e.index&&ka(this,e)}},na.prototype.reduceCrossings=function(){for(var t=this.countCrossings(),i=ra(this),e=0,n=0,o=0,e=0;e<this.hm;e++){for(n=0;n<=this.qb;n++)Ma(this,n,1),Pa(this,n,1);for((o=this.countCrossings())<t&&(t=o,i=ra(this)),n=this.qb;0<=n;n--)Ma(this,n,-1),Pa(this,n,-1);(o=this.countCrossings())<t&&(t=o,i=ra(this))}for(sa(this,i),e=0;e<this.hm;e++){for(n=0;n<=this.qb;n++)Ma(this,n,0),Pa(this,n,0);for((o=this.countCrossings())<t&&(t=o,i=ra(this)),n=this.qb;0<=n;n--)Ma(this,n,0),Pa(this,n,0);(o=this.countCrossings())<t&&(t=o,i=ra(this))}sa(this,i);var r=!1,s=e=0,a=0,n=0;switch(this.wn){case wc:break;case Mc:for(a=t+1;(n=this.countCrossings())<a;)for(a=n,e=this.qb;0<=e;e--)for(s=0;s<=e;s++){for(r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,-1)||r;for((o=this.countCrossings())>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,1)||r;for((o=this.countCrossings())>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,1)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,-1)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,0)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,0)||r;o>=t?sa(this,i):(t=o,i=ra(this))}break;default:case kc:for(e=this.qb,s=0,a=t+1;(n=this.countCrossings())<a;){for(a=n,r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,-1)||r;for((o=this.countCrossings())>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,1)||r;for((o=this.countCrossings())>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,1)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,-1)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=e;n>=s;n--)r=Pa(this,n,0)||r;for(o>=t?sa(this,i):(t=o,i=ra(this)),r=!0;r;)for(r=!1,n=s;n<=e;n++)r=Pa(this,n,0)||r;o>=t?sa(this,i):(t=o,i=ra(this))}}sa(this,i)},na.prototype.straightenAndPack=function(){var t=0,i=!1,e=0!=(this.Hi&Pc),t=this.Hi===Nc;if(1e3<this.network.edges.count&&!t&&(e=!1),e){for(i=[],t=t=0;t<=this.qb;t++)i[t]=0;for(var n=0,o=this.network.vertexes.i;o.next();){var t=(r=o.value).layer,n=r.column,r=this.nodeMinColumnSpace(r,!1);i[t]=Math.max(i[t],n+r)}for(o.reset();o.next();)r=o.value,t=r.layer,n=r.column,r.column=(8*(this.Hb-i[t])>>1)+8*n;this.Hb*=8}if(0!=(this.Hi&Tc))for(i=!0;i;){for(i=!1,t=this.If+1;t<=this.qb;t++)i=Ta(this,t,1)||i;for(t=this.If-1;0<=t;t--)i=Ta(this,t,-1)||i;i=Ta(this,this.If,0)||i}if(0!=(this.Hi&Sc)){for(t=this.If+1;t<=this.qb;t++)Sa(this,t,1);for(t=this.If-1;0<=t;t--)Sa(this,t,-1);Sa(this,this.If,0)}if(e&&(ja(this,-1),ja(this,1)),0!=(this.Hi&Tc))for(i=!0;i;){for(i=!1,i=Ta(this,this.If,0)||i,t=this.If+1;t<=this.qb;t++)i=Ta(this,t,0)||i;for(t=this.If-1;0<=t;t--)i=Ta(this,t,0)||i}},na.prototype.commitLayout=function(){if(this.Op)for(var t=Da(this,!0),i=Da(this,!1),e=this.network.edges.i;e.next();){var n=e.value.link;null!==n&&(n.Ab=t,n.Bb=i)}this.commitNodes(),this.Cz(),this.Ht&&this.commitLinks()},na.prototype.commitNodes=function(){this.hg=[],this.Gf=[],this.Ff=[],this.Nb=[];for(var t=0;t<=this.qb;t++)this.hg[t]=0,this.Gf[t]=0,this.Ff[t]=0,this.Nb[t]=0;for(t=this.network.vertexes.i;t.next();){n=(i=t.value).layer;this.hg[n]=Math.max(this.hg[n],this.nodeMinLayerSpace(i,!0)),this.Gf[n]=Math.max(this.Gf[n],this.nodeMinLayerSpace(i,!1))}for(var i=0,e=this.km,n=0;n<=this.qb;n++){o=e;0>=this.hg[n]+this.Gf[n]&&(o=0),0<n&&(i+=o/2),90===this.ca||0===this.ca?(i+=this.Gf[n],this.Ff[n]=i,i+=this.hg[n]):(i+=this.hg[n],this.Ff[n]=i,i+=this.Gf[n]),n<this.qb&&(i+=o/2),this.Nb[n]=i}for(e=i,i=this.Xd.copy(),null!==this.group&&(270===this.direction||90===this.direction?i.y-=10:i.x-=10,270===this.direction||90===this.direction?i.x-=this.PD/2:i.y-=this.PD/2),n=0;n<=this.qb;n++)270===this.ca?this.Ff[n]=i.y+this.Ff[n]:90===this.ca?(this.Ff[n]=i.y+e-this.Ff[n],this.Nb[n]=e-this.Nb[n]):180===this.ca?this.Ff[n]=i.x+this.Ff[n]:(this.Ff[n]=i.x+e-this.Ff[n],this.Nb[n]=e-this.Nb[n]);for(t.reset();t.next();){var e=(n=t.value).layer,o=0|n.column,r=0,s=0;270===this.ca||90===this.ca?(r=i.x+this.Hd*o,s=this.Ff[e]):(r=this.Ff[e],s=i.y+this.Hd*o),n.oa=r,n.va=s,n.commit()}},na.prototype.Cz=function(){for(var t=0,i=this.km,e=0;e<=this.qb;e++)t+=this.hg[e],t+=this.Gf[e];for(var t=t+this.qb*i,i=[],e=this.Hd*this.Hb,n=this.xI;0<=n;n--)270===this.ca?0===n?i.push(new M(0,0,e,Math.abs(this.Nb[0]))):i.push(new M(0,this.Nb[n-1],e,Math.abs(this.Nb[n-1]-this.Nb[n]))):90===this.ca?0===n?i.push(new M(0,this.Nb[0],e,Math.abs(this.Nb[0]-t))):i.push(new M(0,this.Nb[n],e,Math.abs(this.Nb[n-1]-this.Nb[n]))):180===this.ca?0===n?i.push(new M(0,0,Math.abs(this.Nb[0]),e)):i.push(new M(this.Nb[n-1],0,Math.abs(this.Nb[n-1]-this.Nb[n]),e)):0===n?i.push(new M(this.Nb[0],0,Math.abs(this.Nb[0]-t),e)):i.push(new M(this.Nb[n],0,Math.abs(this.Nb[n-1]-this.Nb[n]),e));this.commitLayers(i,hl.mk)},na.prototype.commitLayers=function(){},na.prototype.commitLinks=function(){for(var t,i=this.network.edges.i;i.next();)null!==(t=i.value.link)&&(t.Ml(),t.Vo(),t.Ui());for(i.reset();i.next();)null!==(t=i.value.link)&&t.pn();for(i.reset();i.next();){var e=i.value;if(null!==(t=e.link)){t.Ml();var n=t,o=n.V,r=n.ba,s=n.bd,a=n.Fd;if(e.valid){if(t.Le===Cf&&4===t.pa){if(e.rev)var h=o,o=r,r=h,l=s,s=a,a=l;if(e.fromVertex.column===e.toVertex.column){var f=t.getLinkPoint(o,s,t.computeSpot(!0),!0,!1,r,a),c=t.getLinkPoint(r,a,t.computeSpot(!1),!1,!1,o,s);f.K()||f.set(o.Y.hl),c.K()||c.set(r.Y.hl),t.Vo(),t.dl(f.x,f.y),t.dl((2*f.x+c.x)/3,(2*f.y+c.y)/3),t.dl((f.x+2*c.x)/3,(f.y+2*c.y)/3),t.dl(c.x,c.y)}else{var p=!1,d=!1;if(null!==s&&t.computeSpot(!0)===Ch&&(p=!0),null!==a&&t.computeSpot(!1)===Ch&&(d=!0),p||d){var y=t.l(0).x,v=t.l(0).y,g=t.l(1).x,m=t.l(1).y,b=t.l(2).x,x=t.l(2).y,w=t.l(3).x,k=t.l(3).y;if(p){90===this.ca||270===this.ca?(g=y,m=(v+k)/2):(g=(y+w)/2,m=v),t.W(1,g,m);var M=t.getLinkPoint(o,s,t.computeSpot(!0),!0,!1,r,a);M.K()||M.set(o.Y.hl),t.W(0,M.x,M.y)}d&&(90===this.ca||270===this.ca?(b=w,x=(v+k)/2):(b=(y+w)/2,x=k),t.W(2,b,x),(M=t.getLinkPoint(r,a,t.computeSpot(!1),!1,!1,o,s)).K()||M.set(r.Y.hl),t.W(3,M.x,M.y))}}}t.Ui()}else if(e.fromVertex.layer===e.toVertex.layer)t.Ui();else{var P=!1,T=!1,S=0,N=t.st+1;if(t.kc)T=!0,4<(S=t.pa)&&t.points.removeRange(2,S-3);else if(t.Le===Cf)P=!0,4<(S=t.pa)&&t.points.removeRange(2,S-3),N=2;else{var S=t.pa,C=t.computeSpot(!0)===Ch,j=t.computeSpot(!1)===Ch;2<S&&C&&j?t.points.removeRange(1,S-2):3<S&&C&&!j?t.points.removeRange(1,S-3):3<S&&!C&&j?t.points.removeRange(2,S-2):4<S&&!C&&!j&&t.points.removeRange(2,S-3)}var L,D,A=e.fromVertex,F=e.toVertex;if(e.rev){for(var z=0;null!==F&&A!==F;){D=L=null;for(var O=F.lc.i;O.next();){var q=O.value;if(q.link===e.link&&(L=q.fromVertex,D=q.toVertex,null===L.ud))break}if(L!==A)if(V=t.l(N-1).x,H=t.l(N-1).y,K=L.oa,U=L.va,T)180===this.ca||0===this.ca?2===N?(t.w(N++,V,H),t.w(N++,V,U)):(X=null!==D?D.va:H)!==U&&(J=this.Nb[L.layer-1],t.w(N++,J,H),t.w(N++,J,U)):2===N?(t.w(N++,V,H),t.w(N++,K,H)):(Q=null!==D?D.oa:V)!==K&&(J=this.Nb[L.layer-1],t.w(N++,V,J),t.w(N++,K,J));else if(2===N)if(Y=Math.max(10,this.hg[F.layer]),W=Math.max(10,this.Gf[F.layer]),P)180===this.ca?K<=F.N.x?(z=F.N.x,t.w(N++,z-Y,U),t.w(N++,z,U),t.w(N++,z+W,U)):(t.w(N++,K-Y,U),t.w(N++,K,U),t.w(N++,K+W,U)):90===this.ca?U>=F.N.bottom?(z=F.N.y+F.N.height,t.w(N++,K,z+W),t.w(N++,K,z),t.w(N++,K,z-Y)):(t.w(N++,K,U+W),t.w(N++,K,U),t.w(N++,K,U-Y)):270===this.ca?U<=F.N.y?(z=F.N.y,t.w(N++,K,z-Y),t.w(N++,K,z),t.w(N++,K,z+W)):(t.w(N++,K,U-Y),t.w(N++,K,U),t.w(N++,K,U+W)):0===this.ca&&(K>=F.N.right?(z=F.N.x+F.N.width,t.w(N++,z+W,U),t.w(N++,z,U),t.w(N++,z-Y,U)):(t.w(N++,K+W,U),t.w(N++,K,U),t.w(N++,K-Y,U)));else{t.w(N++,V,H);var B=0;180===this.ca||0===this.ca?((180===this.ca?K>=F.N.right:K<=F.N.x)&&(B=(0===this.ca?-Y:W)/2),t.w(N++,V+B,U)):((270===this.ca?U>=F.N.bottom:U<=F.N.y)&&(B=(90===this.ca?-Y:W)/2),t.w(N++,K,H+B)),t.w(N++,K,U)}else Y=Math.max(10,this.hg[L.layer]),W=Math.max(10,this.Gf[L.layer]),180===this.ca?(P&&t.w(N++,K-Y,U),t.w(N++,K,U),P&&t.w(N++,K+W,U)):90===this.ca?(P&&t.w(N++,K,U+W),t.w(N++,K,U),P&&t.w(N++,K,U-Y)):270===this.ca?(P&&t.w(N++,K,U-Y),t.w(N++,K,U),P&&t.w(N++,K,U+W)):(P&&t.w(N++,K+W,U),t.w(N++,K,U),P&&t.w(N++,K-Y,U));F=L}if(null===a||t.computeSpot(!1)!==Ch||T)if(V=t.l(N-1).x,H=t.l(N-1).y,K=t.l(N).x,U=t.l(N).y,T){var E=this.Gf[A.layer],I=0;180===this.ca||0===this.ca?((I=H)>=A.N.y&&I<=A.N.bottom&&(180===this.ca?K>=A.N.x:K<=A.N.right)&&(z=A.oa+(180===this.ca?-E:E),I=I<A.N.y+A.N.height/2?A.N.y-this.Hd/2:A.N.bottom+this.Hd/2,t.w(N++,z,H),t.w(N++,z,I)),t.w(N++,K,I)):((I=V)>=A.N.x&&I<=A.N.right&&(270===this.ca?U>=A.N.y:U<=A.N.bottom)&&(z=A.va+(270===this.ca?-E:E),I=I<A.N.x+A.N.width/2?A.N.x-this.Hd/2:A.N.right+this.Hd/2,t.w(N++,V,z),t.w(N++,I,z)),t.w(N++,I,U)),t.w(N++,K,U)}else P?(Y=Math.max(10,this.hg[A.layer]),W=Math.max(10,this.Gf[A.layer]),180===this.ca&&K>=A.N.x?(z=A.N.x+A.N.width,t.W(N-2,z,H),t.W(N-1,z+W,H)):90===this.ca&&U<=A.N.bottom?(z=A.N.y,t.W(N-2,V,z),t.W(N-1,V,z-Y)):270===this.ca&&U>=A.N.y?(z=A.N.y+A.N.height,t.W(N-2,V,z),t.W(N-1,V,z+W)):0===this.ca&&K<=A.N.right&&(z=A.N.x,t.W(N-2,z,H),t.W(N-1,z-Y,H))):(Y=Math.max(10,this.hg[A.layer]),W=Math.max(10,this.Gf[A.layer]),B=0,180===this.ca||0===this.ca?((180===this.ca?K<=A.N.x:K>=A.N.right)&&(B=(0===this.ca?W:-Y)/2),t.w(N++,K+B,H)):((270===this.ca?U<=A.N.y:U>=A.N.bottom)&&(B=(90===this.ca?W:-Y)/2),t.w(N++,V,U+B)),t.w(N++,K,U))}else{for(;null!==A&&A!==F;){D=L=null;for(var R=A.$b.i;R.next();){var G=R.value;if(G.link===e.link&&(L=G.toVertex,null!==(D=G.fromVertex).ud&&(D=null),null===L.ud))break}var V=0,H=0,K=0,U=0,J=0,Y=0,W=0;if(L!==F)if(V=t.l(N-1).x,H=t.l(N-1).y,K=L.oa,U=L.va,T)if(180===this.ca||0===this.ca){var X=null!==D?D.va:H;X!==U&&(J=this.Nb[L.layer],2===N&&(J=0===this.ca?Math.max(J,V):Math.min(J,V)),t.w(N++,J,H),t.w(N++,J,U))}else{var Q=null!==D?D.oa:V;Q!==K&&(J=this.Nb[L.layer],2===N&&(J=90===this.ca?Math.max(J,H):Math.min(J,H)),t.w(N++,V,J),t.w(N++,K,J))}else Y=Math.max(10,this.hg[L.layer]),W=Math.max(10,this.Gf[L.layer]),180===this.ca?(t.w(N++,K+W,U),P&&t.w(N++,K,U),t.w(N++,K-Y,U)):90===this.ca?(t.w(N++,K,U-Y),P&&t.w(N++,K,U),t.w(N++,K,U+W)):270===this.ca?(t.w(N++,K,U+W),P&&t.w(N++,K,U),t.w(N++,K,U-Y)):(t.w(N++,K-Y,U),P&&t.w(N++,K,U),t.w(N++,K+W,U));A=L}T&&(V=t.l(N-1).x,H=t.l(N-1).y,K=t.l(N).x,U=t.l(N).y,180===this.ca||0===this.ca?H!==U&&(J=0===this.ca?Math.min(Math.max((K+V)/2,this.Nb[F.layer]),K):Math.max(Math.min((K+V)/2,this.Nb[F.layer]),K),t.w(N++,J,H),t.w(N++,J,U)):V!==K&&(J=90===this.ca?Math.min(Math.max((U+H)/2,this.Nb[F.layer]),U):Math.max(Math.min((U+H)/2,this.Nb[F.layer]),U),t.w(N++,V,J),t.w(N++,K,J)))}if(null!==n&&P){if(null!==s){if(t.computeSpot(!0)===Ch){var Z=t.l(0),$=t.l(2);Z.L($)||t.W(1,(Z.x+$.x)/2,(Z.y+$.y)/2)}(M=t.getLinkPoint(o,s,Ch,!0,!1,r,a)).K()||M.set(o.Y.hl),t.W(0,M.x,M.y)}null!==a&&(t.computeSpot(!1)===Ch&&(Z=t.l(t.pa-1),$=t.l(t.pa-3),Z.L($)||t.W(t.pa-2,(Z.x+$.x)/2,(Z.y+$.y)/2)),(M=t.getLinkPoint(r,a,Ch,!1,!1,o,s)).K()||M.set(r.Y.hl),t.W(t.pa-1,M.x,M.y))}t.Ui(),e.commit()}}}for(var _=new u(zr),tt=this.network.edges.i;tt.next();){var it=tt.value.link;null!==it&&it.kc&&!_.contains(it)&&_.add(it)}if(0<_.count)if(90===this.ca||270===this.ca){for(var et,nt,ot=new u(za),rt=_.i;rt.next();){var st=rt.value;if(null!==st&&st.kc)for(kt=2;kt<st.pa-3;kt++)if(et=st.l(kt),nt=st.l(kt+1),this.G(et.y,nt.y)&&!this.G(et.x,nt.x)){var at=new za;at.layer=Math.floor(et.y/2);var ht=st.l(0),lt=st.l(st.pa-1);if(at.first=ht.x*ht.x+ht.y,at.Rd=lt.x*lt.x+lt.y,at.Je=Math.min(et.x,nt.x),at.Yd=Math.max(et.x,nt.x),at.index=kt,at.link=st,kt+2<st.pa){var ut=st.l(kt-1),ft=st.l(kt+2),ct=0;ut.y<et.y?ct=ft.y<et.y?3:et.x<nt.x?2:1:ut.y>et.y&&(ct=ft.y>et.y?0:nt.x<et.x?2:1),at.di=ct}ot.add(at)}}if(1<ot.count){ot.sort(this.qF);for(var pt=0;pt<ot.count;){for(var dt=ot.n[pt].layer,yt=pt+1;yt<ot.count&&ot.n[yt].layer===dt;)yt++;if(1<yt-pt)for(var vt=pt;vt<yt;){for(var gt=ot.n[vt].Yd,mt=pt+1;mt<yt&&ot.n[mt].Je<gt;)gt=Math.max(gt,ot.n[mt].Yd),mt++;var bt=mt-vt;if(1<bt){ot.Rp(this.Dx,vt,vt+bt);for(var xt=1,wt=ot.n[vt].Rd,kt=vt;kt<mt;kt++){var Mt=ot.n[kt];Mt.Rd!==wt&&(xt++,wt=Mt.Rd)}ot.Rp(this.pF,vt,vt+bt);for(var Pt=1,wt=ot.n[vt].first,kt=vt;kt<mt;kt++)(Mt=ot.n[kt]).first!==wt&&(Pt++,wt=Mt.first);var Tt=!0,St=Pt;xt<Pt?(Tt=!1,St=xt,wt=ot.n[vt].Rd,ot.Rp(this.Dx,vt,vt+bt)):wt=ot.n[vt].first;for(var Nt=0,kt=vt;kt<mt;kt++){Mt=ot.n[kt],(Tt?Mt.first:Mt.Rd)!==wt&&(Nt++,wt=Tt?Mt.first:Mt.Rd),et=(st=Mt.link).l(Mt.index),nt=st.l(Mt.index+1);var Ct=this.PE*(Nt-(St-1)/2);0,st.Ml(),st.W(Mt.index,et.x,et.y+Ct),st.W(Mt.index+1,nt.x,nt.y+Ct),st.Ui()}}vt=mt}pt=yt}}}else{for(var jt,Lt,Dt=new u(za),At=_.i;At.next();){var Ft=At.value;if(null!==Ft&&Ft.kc)for(Xt=2;Xt<Ft.pa-3;Xt++)if(jt=Ft.l(Xt),Lt=Ft.l(Xt+1),this.G(jt.x,Lt.x)&&!this.G(jt.y,Lt.y)){var zt=new za;zt.layer=Math.floor(jt.x/2);var Ot=Ft.l(0),qt=Ft.l(Ft.pa-1);if(zt.first=Ot.x+Ot.y*Ot.y,zt.Rd=qt.x+qt.y*qt.y,zt.Je=Math.min(jt.y,Lt.y),zt.Yd=Math.max(jt.y,Lt.y),zt.index=Xt,zt.link=Ft,Xt+2<Ft.pa){var Bt=Ft.l(Xt-1),Et=Ft.l(Xt+2),It=0;Bt.x<jt.x?It=Et.x<jt.x?3:jt.y<Lt.y?2:1:Bt.x>jt.x&&(It=Et.x>jt.x?0:Lt.y<jt.y?2:1),zt.di=It}Dt.add(zt)}}if(1<Dt.count){Dt.sort(this.qF);for(var Rt=0;Rt<Dt.count;){for(var Gt=Dt.n[Rt].layer,Vt=Rt+1;Vt<Dt.count&&Dt.n[Vt].layer===Gt;)Vt++;if(1<Vt-Rt)for(var Ht=Rt;Ht<Vt;){for(var Kt=Dt.n[Ht].Yd,Ut=Rt+1;Ut<Vt&&Dt.n[Ut].Je<Kt;)Kt=Math.max(Kt,Dt.n[Ut].Yd),Ut++;var Jt=Ut-Ht;if(1<Jt){Dt.Rp(this.Dx,Ht,Ht+Jt);for(var Yt=1,Wt=Dt.n[Ht].Rd,Xt=Ht;Xt<Ut;Xt++){var Qt=Dt.n[Xt];Qt.Rd!==Wt&&(Yt++,Wt=Qt.Rd)}Dt.Rp(this.pF,Ht,Ht+Jt);for(var Zt=1,Wt=Dt.n[Ht].first,Xt=Ht;Xt<Ut;Xt++)(Qt=Dt.n[Xt]).first!==Wt&&(Zt++,Wt=Qt.first);var $t=!0,_t=Zt;Yt<Zt?($t=!1,_t=Yt,Wt=Dt.n[Ht].Rd,Dt.Rp(this.Dx,Ht,Ht+Jt)):Wt=Dt.n[Ht].first;for(var ti=0,Xt=Ht;Xt<Ut;Xt++){Qt=Dt.n[Xt],($t?Qt.first:Qt.Rd)!==Wt&&(ti++,Wt=$t?Qt.first:Qt.Rd),jt=(Ft=Qt.link).l(Qt.index),Lt=Ft.l(Qt.index+1);var ii=this.PE*(ti-(_t-1)/2);0,Ft.Ml(),Ft.W(Qt.index,jt.x+ii,jt.y),Ft.W(Qt.index+1,Lt.x+ii,Lt.y),Ft.Ui()}}Ht=Ut}Rt=Vt}}}},na.prototype.qF=function(t,i){return t instanceof za&&i instanceof za&&t!==i?t.layer<i.layer?-1:t.layer>i.layer?1:t.Je<i.Je?-1:t.Je>i.Je?1:t.Yd<i.Yd?-1:t.Yd>i.Yd?1:0:0},na.prototype.pF=function(t,i){return t instanceof za&&i instanceof za&&t!==i?t.first<i.first?-1:t.first>i.first||t.di<i.di?1:t.di>i.di||t.Je<i.Je?-1:t.Je>i.Je?1:t.Yd<i.Yd?-1:t.Yd>i.Yd?1:0:0},na.prototype.Dx=function(t,i){return t instanceof za&&i instanceof za&&t!==i?t.Rd<i.Rd?-1:t.Rd>i.Rd||t.di<i.di?1:t.di>i.di||t.Je<i.Je?-1:t.Je>i.Je?1:t.Yd<i.Yd?-1:t.Yd>i.Yd?1:0:0},na.prototype.G=function(t,i){var e=t-i;return-1<e&&1>e},xh.defineProperty(na,{layerSpacing:"layerSpacing"},function(){return this.km},function(t){this.km!==t&&(xh.j(t,"number",na,"layerSpacing"),0<=t&&(this.km=t,this.H()))}),xh.defineProperty(na,{PD:"columnSpacing"},function(){return this.Hd},function(t){this.Hd!==t&&(xh.j(t,"number",na,"columnSpacing"),0<t&&(this.Hd=t,this.H()))}),xh.defineProperty(na,{direction:"direction"},function(){return this.ca},function(t){this.ca!==t&&(xh.j(t,"number",na,"direction"),0===t||90===t||180===t||270===t?(this.ca=t,this.H()):xh.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}),xh.defineProperty(na,{angle:"angle"},function(){return this.direction},function(t){this.direction=t}),xh.defineProperty(na,{lH:"cycleRemoveOption"},function(){return this.Fn},function(t){this.Fn!==t&&(xh.rb(t,na,na,"cycleRemoveOption"),t===dc||t===pc)&&(this.Fn=t,this.H())}),xh.defineProperty(na,{oI:"layeringOption"},function(){return this.io},function(t){this.io!==t&&(xh.rb(t,na,na,"layeringOption"),t===yc||t===vc||t===gc)&&(this.io=t,this.H())}),xh.defineProperty(na,{$H:"initializeOption"},function(){return this.Xn},function(t){this.Xn!==t&&(xh.rb(t,na,na,"initializeOption"),t===mc||t===bc||t===xc)&&(this.Xn=t,this.H())}),xh.defineProperty(na,{QK:"iterations"},function(){return this.hm},function(t){this.hm!==t&&(xh.Ye(t,Oa,"iterations"),0<=t&&(this.hm=t,this.H()))}),xh.defineProperty(na,{MG:"aggressiveOption"},function(){return this.wn},function(t){this.wn!==t&&(xh.rb(t,na,na,"aggressiveOption"),t===wc||t===kc||t===Mc)&&(this.wn=t,this.H())}),xh.defineProperty(na,{nL:"packOption"},function(){return this.Hi},function(t){this.Hi!==t&&(xh.j(t,"number",na,"packOption"),0<=t&&8>t&&(this.Hi=t,this.H()))}),xh.defineProperty(na,{Op:"setsPortSpots"},function(){return this.Ph},function(t){this.Ph!==t&&(xh.j(t,"boolean",na,"setsPortSpots"),this.Ph=t,this.H())}),xh.defineProperty(na,{PE:"linkSpacing"},function(){return this.tr},function(t){this.tr!==t&&(xh.j(t,"number",na,"linkSpacing"),0<=t&&(this.tr=t,this.H()))}),xh.u(na,{xI:"maxLayer"},function(){return this.qb}),xh.u(na,{XK:"maxIndex"},function(){return this.Dv}),xh.u(na,{WK:"maxColumn"},function(){return this.Hb}),xh.u(na,{bL:"minIndexLayer"},function(){return this.Dr}),xh.u(na,{YK:"maxIndexLayer"},function(){return this.If});var pc;na.CycleDepthFirst=pc=xh.p(na,"CycleDepthFirst",0);var dc;na.CycleGreedy=dc=xh.p(na,"CycleGreedy",1);var yc;na.LayerOptimalLinkLength=yc=xh.p(na,"LayerOptimalLinkLength",0);var vc;na.LayerLongestPathSink=vc=xh.p(na,"LayerLongestPathSink",1);var gc;na.LayerLongestPathSource=gc=xh.p(na,"LayerLongestPathSource",2);var mc;na.InitDepthFirstOut=mc=xh.p(na,"InitDepthFirstOut",0);var bc;na.InitDepthFirstIn=bc=xh.p(na,"InitDepthFirstIn",1);var xc;na.InitNaive=xc=xh.p(na,"InitNaive",2);var wc;na.AggressiveNone=wc=xh.p(na,"AggressiveNone",0);var kc;na.AggressiveLess=kc=xh.p(na,"AggressiveLess",1);var Mc;na.AggressiveMore=Mc=xh.p(na,"AggressiveMore",2),na.PackNone=0;var Pc;na.PackExpand=Pc=1;var Tc;na.PackStraighten=Tc=2;var Sc;na.PackMedian=Sc=4;var Nc;na.PackAll=Nc=7,xh.Nd(za,{layer:!0,first:!0,Rd:!0,Je:!0,Yd:!0,index:!0,link:!0,di:!0}),xh.Ja(Oa,Ps),xh.ea("LayeredDigraphNetwork",Oa),Oa.prototype.createVertex=function(){return new qa},Oa.prototype.createEdge=function(){return new Ba},xh.Ja(qa,Cs),xh.ea("LayeredDigraphVertex",qa),xh.Ja(Ba,js),xh.ea("LayeredDigraphEdge",Ba),xh.Ja(Ea,ks),xh.ea("TreeLayout",Ea),Ea.prototype.cloneProtected=function(t){ks.prototype.cloneProtected.call(this,t),t.Wr=this.Wr,t.Ns=this.Ns,t.Bv=this.Bv,t.xh=this.xh,t.hd=this.hd,t.bg.assign(this.bg),t.sa.copyInheritedPropertiesFrom(this.sa),t.ua.copyInheritedPropertiesFrom(this.ua)},Ea.prototype.createNetwork=function(){return new dh},Ea.prototype.makeNetwork=function(t){function i(t){if(t instanceof wr)return!t.vf&&"Comment"!==t.Fc;if(t instanceof zr){var i=t.V;return null!==i&&!i.vf&&"Comment"!==i.Fc&&(null!==(t=t.ba)&&!t.vf&&"Comment"!==t.Fc)}return!1}var e=this.createNetwork();return e.Rb=this,t instanceof Qi?(e.Vj(t.Ag,!0,i),e.Vj(t.links,!0,i)):t instanceof vs?e.Vj(t.Ic,!1,i):e.Vj(t.i,!1,i),e},Ea.prototype.doLayout=function(t){null===t&&xh.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(t)),this.Nf!==Zc&&(this.Xd=this.initialOrigin(this.Xd));if(null===(n=this.g)&&t instanceof Qi&&(n=t),this.Ef=this.path===Cc&&null!==n?n.Qd?jc:Lc:this.path===Cc?jc:this.path,0<this.network.vertexes.count){for(this.network.Mw(),t=this.network.vertexes.i;t.next();)n=t.value,n.initialized=!1,n.level=0,n.parent=null,n.children=[];if(0<this.xd.count){for(t=new c(yh),n=this.xd.i;n.next();){var i=n.value;i instanceof wr?null!==(i=this.network.Wm(i))&&t.add(i):i instanceof yh&&t.add(i)}this.xd=t}for(0===this.xd.count&&this.findRoots(),t=this.xd.copy().i;t.next();)(n=t.value).initialized||(n.initialized=!0,Ia(this,n));for(t=this.xd.i;t.next();)(n=t.value)instanceof yh&&Ga(this,n);for(t=this.xd.i;t.next();)(n=t.value)instanceof yh&&Va(this,n);for(t=this.xd.i;t.next();)(n=t.value)instanceof yh&&Ha(this,n);if(this.xz(),this.bA===tp){for(i=[],t=this.network.vertexes.i;t.next();){var e=t.value;null===(n=e.parent)&&(n=e);var n=0===n.angle||180===n.angle;void 0===(r=i[e.level])&&(r=0),i[e.level]=Math.max(r,n?e.width:e.height)}for(e=0;e<i.length;e++)void 0===i[e]&&(i[e]=0);for(this.oB=i,t=this.network.vertexes.i;t.next();)e=t.value,null===(n=e.parent)&&(n=e),0===n.angle||180===n.angle?(180===n.angle&&(e.tt+=i[e.level]-e.width),e.width=i[e.level]):(270===n.angle&&(e.ut+=i[e.level]-e.height),e.height=i[e.level])}else if(this.bA===_c)for(t=this.network.vertexes.i;t.next();){for(n=0===(i=t.value).angle||180===i.angle,r=-1,e=0;e<i.children.length;e++)var o=i.children[e],r=Math.max(r,n?o.width:o.height);if(0<=r)for(e=0;e<i.children.length;e++)o=i.children[e],n?(180===i.angle&&(o.tt+=r-o.width),o.width=r):(270===i.angle&&(o.ut+=r-o.height),o.height=r)}for(t=this.xd.i;t.next();)(n=t.value)instanceof yh&&this.layoutTree(n);this.arrangeTrees(),this.updateParts()}this.network=null,this.xd=new c(Object),this.xf=!0},Ea.prototype.findRoots=function(){for(t=this.network.vertexes.i;t.next();){i=t.value;switch(this.Ef){case jc:0===i.lc.count&&this.xd.add(i);break;case Lc:0===i.$b.count&&this.xd.add(i);break;default:xh.k("Unhandled path value "+this.Ef.toString())}}if(0===this.xd.count){for(var t=999999,i=null,e=this.network.vertexes.i;e.next();){var n=e.value;switch(this.Ef){case jc:n.lc.count<t&&(t=n.lc.count,i=n);break;case Lc:n.$b.count<t&&(t=n.$b.count,i=n);break;default:xh.k("Unhandled path value "+this.Ef.toString())}}null!==i&&this.xd.add(i)}},Ea.prototype.removeChild=function(t,i){if(null!==t&&null!==i){for(var e=t.children,n=0,o=0;o<e.length;o++)e[o]===i&&n++;if(0<n){for(var n=Array(e.length-n),r=0,o=0;o<e.length;o++)e[o]!==i&&(n[r++]=e[o]);t.children=n}}},Ea.prototype.initializeTreeVertexValues=function(t){i=function(t,i){switch(t.Ns){default:case Uc:return null!==i.parent?i.parent:t.sa;case Wc:return null===i.parent?t.sa:null===i.parent.parent?t.ua:i.parent;case Yc:return null!==i.parent?null!==i.parent.parent?i.parent.parent:t.ua:t.sa;case Jc:var e=!0;if(0===i.Mm)e=!1;else for(var n=i.children,o=n.length,r=0;r<o;r++)if(0<n[r].Mm){e=!1;break}return e&&null!==i.parent?t.ua:null!==i.parent?i.parent:t.sa}}(this,t);if(t.copyInheritedPropertiesFrom(i),null!==t.parent&&t.parent.alignment===Rc){for(var i=t.angle,e=t.parent.children,n=0;n<e.length&&t!==e[n];)n++;0==n%2?n!==e.length-1&&(i=90===i?180:180===i?270:270===i?180:270):i=90===i?0:180===i?90:270===i?0:90,t.angle=i}t.initialized=!0},Ea.prototype.assignTreeVertexValues=function(){},Ea.prototype.sortTreeVertexChildren=function(t){switch(t.sorting){case Dc:break;case Ac:t.children.reverse();break;case Fc:t.children.sort(t.comparer);break;case zc:t.children.sort(t.comparer),t.children.reverse();break;default:xh.k("Unhandled sorting value "+t.sorting.toString())}},Ea.prototype.xz=function(){if(this.comments)for(var t=this.network.vertexes.i;t.next();)this.addComments(t.value)},Ea.prototype.addComments=function(t){var i=t.angle,e=t.parent,n=0,o=qc,o=!1;null!==e&&(n=e.angle,o=e.alignment,o=Ka(o));var i=90===i||270===i,n=90===n||270===n,e=0===t.Mm,r=0,s=0,a=0,h=t.commentSpacing;if(null!==t.Jc)for(var l=t.Jc.jE();l.next();){var u=l.value;"Comment"===u.Fc&&u.canLayout()&&(null===t.comments&&(t.comments=[]),t.comments.push(u),u.rf(),u=u.Ca,i&&!e||!o&&!n&&e||o&&n&&e?(r=Math.max(r,u.width),s+=u.height+Math.abs(a)):(r+=u.width+Math.abs(a),s=Math.max(s,u.height)),a=h)}null!==t.comments&&(i&&!e||!o&&!n&&e||o&&n&&e?(r+=Math.abs(t.commentMargin),s=Math.max(0,s-t.height)):(s+=Math.abs(t.commentMargin),r=Math.max(0,r-t.width)),o=xh.lk(0,0,t.N.width+r,t.N.height+s),t.nb=o,xh.ic(o))},Ea.prototype.layoutComments=function(t){if(null!==t.comments){var i=t.Jc.Ca,e=t.parent,n=t.angle,o=0,r=qc,r=!1;null!==e&&(o=e.angle,r=e.alignment,r=Ka(r));for(var e=90===n||270===n,n=90===o||270===o,s=0===t.Mm,a=Ja(t),h=0,l=t.comments,u=l.length,f=xh.M(),c=0;c<u;c++){var p=l[c],d=p.Ca;if(e&&!s||!r&&!n&&s||r&&n&&s){if(135<o&&!r||n&&a)if(0<=t.commentMargin)for(f.m(t.N.x-t.commentMargin-d.width,t.N.y+h),p.move(f),p=p.tg();p.next();){var y=p.value;y.Ab=Rh,y.Bb=Gh}else for(f.m(t.N.x+2*t.O.x-t.commentMargin,t.N.y+h),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Gh,y.Bb=Rh;else if(0<=t.commentMargin)for(f.m(t.N.x+2*t.O.x+t.commentMargin,t.N.y+h),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Gh,y.Bb=Rh;else for(f.m(t.N.x+t.commentMargin-d.width,t.N.y+h),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Rh,y.Bb=Gh;h=0<=t.commentSpacing?h+(d.height+t.commentSpacing):h+(t.commentSpacing-d.height)}else{if(135<o&&!r||!n&&a)if(0<=t.commentMargin)for(f.m(t.N.x+h,t.N.y-t.commentMargin-d.height),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Ih,y.Bb=Vh;else for(f.m(t.N.x+h,t.N.y+2*t.O.y-t.commentMargin),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Vh,y.Bb=Ih;else if(0<=t.commentMargin)for(f.m(t.N.x+h,t.N.y+2*t.O.y+t.commentMargin),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Vh,y.Bb=Ih;else for(f.m(t.N.x+h,t.N.y+t.commentMargin-d.height),p.move(f),p=p.tg();p.next();)y=p.value,y.Ab=Ih,y.Bb=Vh;h=0<=t.commentSpacing?h+(d.width+t.commentSpacing):h+(t.commentSpacing-d.width)}}if(xh.v(f),i=h-t.commentSpacing-(e?i.height:i.width),this.Ef===jc)for(o=t.$b;o.next();)null===(t=o.value.link)||t.Al||(t.sl=0<i?i:NaN);else for(o=t.lc;o.next();)null===(t=o.value.link)||t.Al||(t.Ql=0<i?i:NaN)}},Ea.prototype.layoutTree=function(t){if(null!==t){for(var i=(n=t.children).length,e=0;e<i;e++)this.layoutTree(n[e]);switch(t.compaction){case Hc:Ya(this,t);break;case Kc:if(t.alignment===Rc)Ya(this,t);else if(0===t.Mm){var e=t.parent,n=!1,i=0,o=qc;null!==e&&(i=e.angle,o=e.alignment,n=Ka(o)),e=Ja(t),t.na.m(0,0),t.hb.m(t.width,t.height),null===t.parent||null===t.comments||(180!==i&&270!==i||n)&&!e?t.Ma.m(0,0):180===i&&!n||(90===i||270===i)&&e?t.Ma.m(t.width-2*t.O.x,0):t.Ma.m(0,t.height-2*t.O.y),t.Kt=null,t.cu=null}else{for(var r=fh(t),n=90===r||270===r,s=0,a=t.children,h=a.length,l=0;l<h;l++)var u=a[l],s=Math.max(s,n?u.hb.width:u.hb.height);var f=t.alignment,e=f===Bc,c=f===Ec,p=Ka(f),d=Math.max(0,t.breadthLimit),i=ch(t),y=t.nodeSpacing,v=ph(t),g=t.rowSpacing,m=0;(e||c||t.Jp||t.Kp&&1===t.maxGenerationCount)&&(m=Math.max(0,t.rowIndent));var e=t.width,o=t.height,b=0,x=0,w=0,k=null,M=null,P=0,T=0,S=0,N=0,C=0,j=0,L=0,D=0,u=0;if(p&&!Ua(f)&&135<r&&a.reverse(),Ua(f))if(1<h)for(l=0;l<h;l++)0==l%2&&l!==h-1?D=Math.max(D,n?a[l].hb.width:a[l].hb.height):0!=l%2&&(u=Math.max(u,n?a[l].hb.width:a[l].hb.height));else 1===h&&(D=n?a[0].hb.width:a[0].hb.height);if(p){switch(f){case Ic:D=(T=135>r?Wa(t,a,D,b,x):Xa(t,a,D,b,x)).x,b=T.width,x=T.height;break;case Gc:for(l=0;l<h;l++){var A=(u=a[l]).hb,k=0===j?0:g;n?(u.na.m(s-A.width,N+k),b=Math.max(b,A.width),x=Math.max(x,N+k+A.height),N+=k+A.height):(u.na.m(S+k,s-A.height),b=Math.max(b,S+k+A.width),x=Math.max(x,A.height),S+=k+A.width),j++}break;case Vc:for(l=0;l<h;l++)u=a[l],A=u.hb,k=0===j?0:g,n?(u.na.m(y/2+t.O.x,N+k),b=Math.max(b,A.width),x=Math.max(x,N+k+A.height),N+=k+A.height):(u.na.m(S+k,y/2+t.O.y),b=Math.max(b,S+k+A.width),x=Math.max(x,A.height),S+=k+A.width),j++}k=ah(this,2),M=ah(this,2),n?(k[0].m(0,0),k[1].m(0,x),M[0].m(b,0)):(k[0].m(0,0),k[1].m(b,0),M[0].m(0,x)),M[1].m(b,x)}else for(l=0;l<h;l++){if(u=a[l],A=u.hb,n){0<d&&0<j&&S+y+A.width>d&&(S<s&&eh(t,f,s-S,0,L,l-1),C++,j=0,L=l,w=x,S=0,N=135<r?-x-g:x+g),oh(this,u,0,N);z=0;if(0===j)k=u.Kt,M=u.cu,P=A.width,T=A.height,(null===k||null===M||r!==fh(u))&&(k=ah(this,2),M=ah(this,2),k[0].m(0,0),k[1].m(0,T),M[0].m(P,0),M[1].m(P,T));else{var F=xh.lb(),z=(T=sh(this,t,u,k,M,P,T,F)).x,k=F[0],M=F[1],P=T.width,T=T.height;xh.ta(F),S<A.width&&0>z&&(nh(t,-z,0,L,l-1),rh(k,-z,0),rh(M,-z,0),z=0)}u.na.m(z,N),b=Math.max(b,P),x=Math.max(x,w+(0===C?0:g)+A.height),S=P}else 0<d&&0<j&&N+y+A.height>d&&(N<s&&eh(t,f,0,s-N,L,l-1),C++,j=0,L=l,w=b,N=0,S=135<r?-b-g:b+g),oh(this,u,S,0),z=0,0===j?(k=u.Kt,M=u.cu,P=A.width,T=A.height,(null===k||null===M||r!==fh(u))&&(k=ah(this,2),M=ah(this,2),k[0].m(0,0),k[1].m(P,0),M[0].m(0,T),M[1].m(P,T))):(F=xh.lb(),T=sh(this,t,u,k,M,P,T,F),z=T.x,k=F[0],M=F[1],P=T.width,T=T.height,xh.ta(F),N<A.height&&0>z&&(nh(t,0,-z,L,l-1),rh(k,0,-z),rh(M,0,-z),z=0)),u.na.m(S,z),x=Math.max(x,T),b=Math.max(b,w+(0===C?0:g)+A.width),N=T;j++}switch(0<C&&(n?(x+=Math.max(0,i),S<b&&eh(t,f,b-S,0,L,h-1),0<m&&(c||nh(t,m,0,0,h-1),b+=m)):(b+=Math.max(0,i),N<x&&eh(t,f,0,x-N,L,h-1),0<m&&(c||nh(t,0,m,0,h-1),x+=m))),c=s=0,f){case Oc:n?s+=b/2-t.O.x-v/2:c+=x/2-t.O.y-v/2;break;case qc:0<C?n?s+=b/2-t.O.x-v/2:c+=x/2-t.O.y-v/2:n?(l=a[0].na.x+a[0].Ma.x,D=a[h-1].na.x+a[h-1].Ma.x+2*a[h-1].O.x,s+=l+(D-l)/2-t.O.x-v/2):(l=a[0].na.y+a[0].Ma.y,D=a[h-1].na.y+a[h-1].Ma.y+2*a[h-1].O.y,c+=l+(D-l)/2-t.O.y-v/2);break;case Bc:n?(s-=v,b+=v):(c-=v,x+=v);break;case Ec:n?(s+=b-t.width+v,b+=v):(c+=x-t.height+v,x+=v);break;case Ic:n?s=1<h?s+(D+y/2-t.O.x):s+(a[0].O.x-t.O.x+a[0].Ma.x):c=1<h?c+(D+y/2-t.O.y):c+(a[0].O.y-t.O.y+a[0].Ma.y);break;case Gc:n?s+=b+y/2-t.O.x:c+=x+y/2-t.O.y;break;case Vc:break;default:xh.k("Unhandled alignment value "+f.toString())}for(l=0;l<h;l++)u=a[l],n?u.na.m(u.na.x+u.Ma.x-s,u.na.y+(135<r?(p?-x:-u.hb.height)+u.Ma.y-i:o+i+u.Ma.y)):u.na.m(u.na.x+(135<r?(p?-b:-u.hb.width)+u.Ma.x-i:e+i+u.Ma.x),u.na.y+u.Ma.y-c);if(h=a=0,p?n?(b=_a(t,b,s),0>s&&(s=0),135<r&&(c+=x+i),x+=o+i,f===Vc&&(a+=y/2+t.O.x),h+=o+i):(135<r&&(s+=b+i),b+=e+i,x=th(t,x,c),0>c&&(c=0),f===Vc&&(h+=y/2+t.O.y),a+=e+i):n?(null===t.comments?e>b&&(f=ih(f,e-b,0),a=f.x,h=f.y,b=e,s=0):b=_a(t,b,s),0>s&&(a-=s,s=0),135<r&&(c+=x+i),x=Math.max(Math.max(x,o),x+o+i),h+=o+i):(135<r&&(s+=b+i),b=Math.max(Math.max(b,e),b+e+i),null===t.comments?o>x&&(f=ih(f,0,o-x),a=f.x,h=f.y,x=o,c=0):x=th(t,x,c),0>c&&(h-=c,c=0),a+=e+i),0<C)r=ah(this,4),f=ah(this,4),n?(r[2].m(0,o+i),r[3].m(r[2].x,x),f[2].m(b,r[2].y),f[3].m(f[2].x,r[3].y)):(r[2].m(e+i,0),r[3].m(b,r[2].y),f[2].m(r[2].x,x),f[3].m(r[3].x,f[2].y));else{for(r=ah(this,k.length+2),f=ah(this,M.length+2),l=0;l<k.length;l++)p=k[l],r[l+2].m(p.x+a,p.y+h);for(l=0;l<M.length;l++)p=M[l],f[l+2].m(p.x+a,p.y+h)}n?(r[0].m(s,0),r[1].m(r[0].x,o),r[2].y<r[1].y&&(r[2].x>r[0].x?r[2].assign(r[1]):r[1].assign(r[2])),r[3].y<r[2].y&&(r[3].x>r[0].x?r[3].assign(r[2]):r[2].assign(r[3])),f[0].m(s+e,0),f[1].m(f[0].x,o),f[2].y<f[1].y&&(f[2].x<f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].y<f[2].y&&(f[3].x<f[0].x?f[3].assign(f[2]):f[2].assign(f[3])),r[2].y-=i/2,f[2].y-=i/2):(r[0].m(0,c),r[1].m(e,r[0].y),r[2].x<r[1].x&&(r[2].y>r[0].y?r[2].assign(r[1]):r[1].assign(r[2])),r[3].x<r[2].x&&(r[3].y>r[0].y?r[3].assign(r[2]):r[2].assign(r[3])),f[0].m(0,c+o),f[1].m(e,f[0].y),f[2].x<f[1].x&&(f[2].y<f[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].x<f[2].x&&(f[3].y<f[0].y?f[3].assign(f[2]):f[2].assign(f[3])),r[2].x-=i/2,f[2].x-=i/2),hh(this,k),hh(this,M),t.Kt=r,t.cu=f,t.Ma.m(s,c),t.hb.m(b,x)}break;default:xh.k("Unhandled compaction value "+t.compaction.toString())}}},Ea.prototype.arrangeTrees=function(){if(this.hd===Zc)for(var t=this.xd.i;t.next();){var i=t.value;if(i instanceof yh){if(null!==(e=i.Jc)){var e=(n=e.position).x,n=n.y;isFinite(e)||(e=0),isFinite(n)||(n=0),lh(this,i,e,n)}}}else{for(e=[],t=this.xd.i;t.next();)(i=t.value)instanceof yh&&e.push(i);switch(this.sorting){case Dc:break;case Ac:e.reverse();break;case Fc:e.sort(this.comparer);break;case zc:e.sort(this.comparer),e.reverse();break;default:xh.k("Unhandled sorting value "+this.sorting.toString())}for(t=(i=this.Xd).x,i=i.y,n=0;n<e.length;n++){var o=e[n];switch(lh(this,o,t+o.Ma.x,i+o.Ma.y),this.hd){case Xc:i+=o.hb.height+this.bg.height;break;case Qc:t+=o.hb.width+this.bg.width;break;default:xh.k("Unhandled arrangement value "+this.hd.toString())}}}},Ea.prototype.commitLayout=function(){this.KA(),this.commitNodes(),this.Cz(),this.Ht&&this.commitLinks()},Ea.prototype.commitNodes=function(){for(var t=this.network.vertexes.i;t.next();)t.value.commit();for(t.reset();t.next();)this.layoutComments(t.value)},Ea.prototype.Cz=function(){if(this.bA===tp){for(var t=this.oB,i=[],e=null,n=this.network.vertexes.i;n.next();){var o=n.value;null===e?e=o.nb.copy():e.ei(o.nb);r=void 0===(r=i[o.level])?ch(o):Math.max(r,ch(o));i[o.level]=r}for(n=0;n<i.length;n++)void 0===i[n]&&(i[n]=0);90===this.angle||270===this.angle?(e.Qf(this.nodeSpacing/2,this.layerSpacing),o=new b(-this.nodeSpacing/2,-this.layerSpacing/2)):(e.Qf(this.layerSpacing,this.nodeSpacing/2),o=new b(-this.layerSpacing/2,-this.nodeSpacing/2));var r=[],e=90===this.angle||270===this.angle?e.width:e.height,s=0;if(180===this.angle||270===this.angle)for(n=0;n<t.length;n++)s+=t[n]+i[n];for(n=0;n<t.length;n++){var a=t[n]+i[n];270===this.angle?(s-=a,r.push(new M(0,s,e,a))):90===this.angle?(r.push(new M(0,s,e,a)),s+=a):180===this.angle?(s-=a,r.push(new M(s,0,a,e))):(r.push(new M(s,0,a,e)),s+=a)}this.commitLayers(r,o)}},Ea.prototype.commitLayers=function(){},Ea.prototype.commitLinks=function(){for(var t=this.network.edges.i;t.next();)t.value.commit()},Ea.prototype.KA=function(){for(var t=this.xd.i;t.next();){var i=t.value;i instanceof yh&&uh(this,i)}},Ea.prototype.setPortSpots=function(t){var i=t.alignment;if(Ka(i)){var e,n=this.Ef===jc,o=fh(t);switch(o){case 0:e=Gh;break;case 90:e=Vh;break;case 180:e=Rh;break;default:e=Ih}var r=t.children,s=r.length;switch(i){case Ic:case Rc:for(i=0;i<s;i++){var a=r[i];if(null!==(a=(n?a.lc:a.$b).first())&&null!==(a=a.link)){var h=90===o||270===o?Rh:Ih;if(1===s||i===s-1&&1==s%2)switch(o){case 0:h=Rh;break;case 90:h=Ih;break;case 180:h=Gh;break;default:h=Vh}else 0==i%2&&(h=90===o||270===o?Gh:Vh);n?(t.setsPortSpot&&(a.Ab=e),t.setsChildPortSpot&&(a.Bb=h)):(t.setsPortSpot&&(a.Ab=h),t.setsChildPortSpot&&(a.Bb=e))}}break;case Gc:for(h=90===o||270===o?Gh:Vh,o=n?t.$b:t.lc;o.next();)null!==(a=o.value.link)&&(n?(t.setsPortSpot&&(a.Ab=e),t.setsChildPortSpot&&(a.Bb=h)):(t.setsPortSpot&&(a.Ab=h),t.setsChildPortSpot&&(a.Bb=e)));break;case Vc:for(h=90===o||270===o?Rh:Ih,o=n?t.$b:t.lc;o.next();)null!==(a=o.value.link)&&(n?(t.setsPortSpot&&(a.Ab=e),t.setsChildPortSpot&&(a.Bb=h)):(t.setsPortSpot&&(a.Ab=h),t.setsChildPortSpot&&(a.Bb=e)))}}else if(n=fh(t),this.Ef===jc){for(e=t.$b;e.next();)if(null!==(o=e.value.link)){if(t.setsPortSpot)if(t.portSpot.Uc())switch(n){case 0:o.Ab=Gh;break;case 90:o.Ab=Vh;break;case 180:o.Ab=Rh;break;default:o.Ab=Ih}else o.Ab=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Uc())switch(n){case 0:o.Bb=Rh;break;case 90:o.Bb=Ih;break;case 180:o.Bb=Gh;break;default:o.Bb=Vh}else o.Bb=t.childPortSpot}}else for(e=t.lc;e.next();)if(null!==(o=e.value.link)){if(t.setsPortSpot)if(t.portSpot.Uc())switch(n){case 0:o.Bb=Gh;break;case 90:o.Bb=Vh;break;case 180:o.Bb=Rh;break;default:o.Bb=Ih}else o.Bb=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Uc())switch(n){case 0:o.Ab=Rh;break;case 90:o.Ab=Ih;break;case 180:o.Ab=Gh;break;default:o.Ab=Vh}else o.Ab=t.childPortSpot}},xh.defineProperty(Ea,{vL:"roots"},function(){return this.xd},function(t){this.xd!==t&&(xh.A(t,c,Ea,"roots"),this.xd=t,this.H())}),xh.defineProperty(Ea,{path:"path"},function(){return this.Wr},function(t){this.Wr!==t&&(xh.rb(t,Ea,Ea,"path"),this.Wr=t,this.H())}),xh.defineProperty(Ea,{EJ:"treeStyle"},function(){return this.Ns},function(t){this.hd!==t&&(xh.rb(t,Ea,Ea,"treeStyle"),t===Uc||t===Yc||t===Jc||t===Wc)&&(this.Ns=t,this.H())}),xh.defineProperty(Ea,{bA:"layerStyle"},function(){return this.Bv},function(t){this.hd!==t&&(xh.rb(t,Ea,Ea,"layerStyle"),t===$c||t===_c||t===tp)&&(this.Bv=t,this.H())}),xh.defineProperty(Ea,{comments:"comments"},function(){return this.xh},function(t){this.xh!==t&&(xh.j(t,"boolean",Ea,"comments"),this.xh=t,this.H())}),xh.defineProperty(Ea,{Nf:"arrangement"},function(){return this.hd},function(t){this.hd!==t&&(xh.rb(t,Ea,Ea,"arrangement"),t===Xc||t===Qc||t===Zc)&&(this.hd=t,this.H())}),xh.defineProperty(Ea,{GD:"arrangementSpacing"},function(){return this.bg},function(t){xh.A(t,k,Ea,"arrangementSpacing"),this.bg.L(t)||(this.bg.assign(t),this.H())}),xh.defineProperty(Ea,{uL:"rootDefaults"},function(){return this.sa},function(t){this.sa!==t&&(xh.A(t,yh,Ea,"rootDefaults"),this.sa=t,this.H())}),xh.defineProperty(Ea,{VJ:"alternateDefaults"},function(){return this.ua},function(t){this.ua!==t&&(xh.A(t,yh,Ea,"alternateDefaults"),this.ua=t,this.H())}),xh.defineProperty(Ea,{sorting:"sorting"},function(){return this.sa.sorting},function(t){this.sa.sorting!==t&&(xh.rb(t,Ea,Ea,"sorting"),t===Dc||t===Ac||t===Fc||zc)&&(this.sa.sorting=t,this.H())}),xh.defineProperty(Ea,{comparer:"comparer"},function(){return this.sa.comparer},function(t){this.sa.comparer!==t&&(xh.j(t,"function",Ea,"comparer"),this.sa.comparer=t,this.H())}),xh.defineProperty(Ea,{angle:"angle"},function(){return this.sa.angle},function(t){this.sa.angle!==t&&(xh.j(t,"number",Ea,"angle"),0===t||90===t||180===t||270===t?(this.sa.angle=t,this.H()):xh.k("TreeLayout.angle must be 0, 90, 180, or 270"))}),xh.defineProperty(Ea,{alignment:"alignment"},function(){return this.sa.alignment},function(t){this.sa.alignment!==t&&(xh.rb(t,Ea,Ea,"alignment"),this.sa.alignment=t,this.H())}),xh.defineProperty(Ea,{nodeIndent:"nodeIndent"},function(){return this.sa.nodeIndent},function(t){this.sa.nodeIndent!==t&&(xh.j(t,"number",Ea,"nodeIndent"),0<=t&&(this.sa.nodeIndent=t,this.H()))}),xh.defineProperty(Ea,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.sa.nodeIndentPastParent},function(t){this.sa.nodeIndentPastParent!==t&&(xh.j(t,"number",Ea,"nodeIndentPastParent"),0<=t&&1>=t&&(this.sa.nodeIndentPastParent=t,this.H()))}),xh.defineProperty(Ea,{nodeSpacing:"nodeSpacing"},function(){return this.sa.nodeSpacing},function(t){this.sa.nodeSpacing!==t&&(xh.j(t,"number",Ea,"nodeSpacing"),this.sa.nodeSpacing=t,this.H())}),xh.defineProperty(Ea,{layerSpacing:"layerSpacing"},function(){return this.sa.layerSpacing},function(t){this.sa.layerSpacing!==t&&(xh.j(t,"number",Ea,"layerSpacing"),this.sa.layerSpacing=t,this.H())}),xh.defineProperty(Ea,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.sa.layerSpacingParentOverlap},function(t){this.sa.layerSpacingParentOverlap!==t&&(xh.j(t,"number",Ea,"layerSpacingParentOverlap"),0<=t&&1>=t&&(this.sa.layerSpacingParentOverlap=t,this.H()))}),xh.defineProperty(Ea,{compaction:"compaction"},function(){return this.sa.compaction},function(t){this.sa.compaction!==t&&(xh.rb(t,Ea,Ea,"compaction"),t===Hc||t===Kc)&&(this.sa.compaction=t,this.H())}),xh.defineProperty(Ea,{breadthLimit:"breadthLimit"},function(){return this.sa.breadthLimit},function(t){this.sa.breadthLimit!==t&&(xh.j(t,"number",Ea,"breadthLimit"),0<=t&&(this.sa.breadthLimit=t,this.H()))}),xh.defineProperty(Ea,{rowSpacing:"rowSpacing"},function(){return this.sa.rowSpacing},function(t){this.sa.rowSpacing!==t&&(xh.j(t,"number",Ea,"rowSpacing"),this.sa.rowSpacing=t,this.H())}),xh.defineProperty(Ea,{rowIndent:"rowIndent"},function(){return this.sa.rowIndent},function(t){this.sa.rowIndent!==t&&(xh.j(t,"number",Ea,"rowIndent"),0<=t&&(this.sa.rowIndent=t,this.H()))}),xh.defineProperty(Ea,{commentSpacing:"commentSpacing"},function(){return this.sa.commentSpacing},function(t){this.sa.commentSpacing!==t&&(xh.j(t,"number",Ea,"commentSpacing"),this.sa.commentSpacing=t,this.H())}),xh.defineProperty(Ea,{commentMargin:"commentMargin"},function(){return this.sa.commentMargin},function(t){this.sa.commentMargin!==t&&(xh.j(t,"number",Ea,"commentMargin"),this.sa.commentMargin=t,this.H())}),xh.defineProperty(Ea,{setsPortSpot:"setsPortSpot"},function(){return this.sa.setsPortSpot},function(t){this.sa.setsPortSpot!==t&&(xh.j(t,"boolean",Ea,"setsPortSpot"),this.sa.setsPortSpot=t,this.H())}),xh.defineProperty(Ea,{portSpot:"portSpot"},function(){return this.sa.portSpot},function(t){xh.A(t,D,Ea,"portSpot"),this.sa.portSpot.L(t)||(this.sa.portSpot=t,this.H())}),xh.defineProperty(Ea,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.sa.setsChildPortSpot},function(t){this.sa.setsChildPortSpot!==t&&(xh.j(t,"boolean",Ea,"setsChildPortSpot"),this.sa.setsChildPortSpot=t,this.H())}),xh.defineProperty(Ea,{childPortSpot:"childPortSpot"},function(){return this.sa.childPortSpot},function(t){xh.A(t,D,Ea,"childPortSpot"),this.sa.childPortSpot.L(t)||(this.sa.childPortSpot=t,this.H())}),xh.defineProperty(Ea,{fK:"alternateSorting"},function(){return this.ua.sorting},function(t){this.ua.sorting!==t&&(xh.rb(t,Ea,Ea,"alternateSorting"),t===Dc||t===Ac||t===Fc||zc)&&(this.ua.sorting=t,this.H())}),xh.defineProperty(Ea,{UJ:"alternateComparer"},function(){return this.ua.comparer},function(t){this.ua.comparer!==t&&(xh.j(t,"function",Ea,"alternateComparer"),this.ua.comparer=t,this.H())}),xh.defineProperty(Ea,{OJ:"alternateAngle"},function(){return this.ua.angle},function(t){this.ua.angle!==t&&(xh.j(t,"number",Ea,"alternateAngle"),0===t||90===t||180===t||270===t)&&(this.ua.angle=t,this.H())}),xh.defineProperty(Ea,{NJ:"alternateAlignment"},function(){return this.ua.alignment},function(t){this.ua.alignment!==t&&(xh.rb(t,Ea,Ea,"alternateAlignment"),this.ua.alignment=t,this.H())}),xh.defineProperty(Ea,{YJ:"alternateNodeIndent"},function(){return this.ua.nodeIndent},function(t){this.ua.nodeIndent!==t&&(xh.j(t,"number",Ea,"alternateNodeIndent"),0<=t&&(this.ua.nodeIndent=t,this.H()))}),xh.defineProperty(Ea,{ZJ:"alternateNodeIndentPastParent"},function(){return this.ua.nodeIndentPastParent},function(t){this.ua.nodeIndentPastParent!==t&&(xh.j(t,"number",Ea,"alternateNodeIndentPastParent"),0<=t&&1>=t&&(this.ua.nodeIndentPastParent=t,this.H()))}),xh.defineProperty(Ea,{$J:"alternateNodeSpacing"},function(){return this.ua.nodeSpacing},function(t){this.ua.nodeSpacing!==t&&(xh.j(t,"number",Ea,"alternateNodeSpacing"),this.ua.nodeSpacing=t,this.H())}),xh.defineProperty(Ea,{WJ:"alternateLayerSpacing"},function(){return this.ua.layerSpacing},function(t){this.ua.layerSpacing!==t&&(xh.j(t,"number",Ea,"alternateLayerSpacing"),this.ua.layerSpacing=t,this.H())}),xh.defineProperty(Ea,{XJ:"alternateLayerSpacingParentOverlap"},function(){return this.ua.layerSpacingParentOverlap},function(t){this.ua.layerSpacingParentOverlap!==t&&(xh.j(t,"number",Ea,"alternateLayerSpacingParentOverlap"),0<=t&&1>=t&&(this.ua.layerSpacingParentOverlap=t,this.H()))}),xh.defineProperty(Ea,{TJ:"alternateCompaction"},function(){return this.ua.compaction},function(t){this.ua.compaction!==t&&(xh.rb(t,Ea,Ea,"alternateCompaction"),t===Hc||t===Kc)&&(this.ua.compaction=t,this.H())}),xh.defineProperty(Ea,{PJ:"alternateBreadthLimit"},function(){return this.ua.breadthLimit},function(t){this.ua.breadthLimit!==t&&(xh.j(t,"number",Ea,"alternateBreadthLimit"),0<=t&&(this.ua.breadthLimit=t,this.H()))}),xh.defineProperty(Ea,{cK:"alternateRowSpacing"},function(){return this.ua.rowSpacing},function(t){this.ua.rowSpacing!==t&&(xh.j(t,"number",Ea,"alternateRowSpacing"),this.ua.rowSpacing=t,this.H())}),xh.defineProperty(Ea,{bK:"alternateRowIndent"},function(){return this.ua.rowIndent},function(t){this.ua.rowIndent!==t&&(xh.j(t,"number",Ea,"alternateRowIndent"),0<=t&&(this.ua.rowIndent=t,this.H()))}),xh.defineProperty(Ea,{SJ:"alternateCommentSpacing"},function(){return this.ua.commentSpacing},function(t){this.ua.commentSpacing!==t&&(xh.j(t,"number",Ea,"alternateCommentSpacing"),this.ua.commentSpacing=t,this.H())}),xh.defineProperty(Ea,{RJ:"alternateCommentMargin"},function(){return this.ua.commentMargin},function(t){this.ua.commentMargin!==t&&(xh.j(t,"number",Ea,"alternateCommentMargin"),this.ua.commentMargin=t,this.H())}),xh.defineProperty(Ea,{eK:"alternateSetsPortSpot"},function(){return this.ua.setsPortSpot},function(t){this.ua.setsPortSpot!==t&&(xh.j(t,"boolean",Ea,"alternateSetsPortSpot"),this.ua.setsPortSpot=t,this.H())}),xh.defineProperty(Ea,{aK:"alternatePortSpot"},function(){return this.ua.portSpot},function(t){xh.A(t,D,Ea,"alternatePortSpot"),this.ua.portSpot.L(t)||(this.ua.portSpot=t,this.H())}),xh.defineProperty(Ea,{dK:"alternateSetsChildPortSpot"},function(){return this.ua.setsChildPortSpot},function(t){this.ua.setsChildPortSpot!==t&&(xh.j(t,"boolean",Ea,"alternateSetsChildPortSpot"),this.ua.setsChildPortSpot=t,this.H())}),xh.defineProperty(Ea,{QJ:"alternateChildPortSpot"},function(){return this.ua.childPortSpot},function(t){xh.A(t,D,Ea,"alternateChildPortSpot"),this.ua.childPortSpot.L(t)||(this.ua.childPortSpot=t,this.H())});var Cc;Ea.PathDefault=Cc=xh.p(Ea,"PathDefault",-1);var jc;Ea.PathDestination=jc=xh.p(Ea,"PathDestination",0);var Lc;Ea.PathSource=Lc=xh.p(Ea,"PathSource",1);var Dc;Ea.SortingForwards=Dc=xh.p(Ea,"SortingForwards",10);var Ac;Ea.SortingReverse=Ac=xh.p(Ea,"SortingReverse",11);var Fc;Ea.SortingAscending=Fc=xh.p(Ea,"SortingAscending",12);var zc;Ea.SortingDescending=zc=xh.p(Ea,"SortingDescending",13);var Oc;Ea.AlignmentCenterSubtrees=Oc=xh.p(Ea,"AlignmentCenterSubtrees",20);var qc;Ea.AlignmentCenterChildren=qc=xh.p(Ea,"AlignmentCenterChildren",21);var Bc;Ea.AlignmentStart=Bc=xh.p(Ea,"AlignmentStart",22);var Ec;Ea.AlignmentEnd=Ec=xh.p(Ea,"AlignmentEnd",23);var Ic;Ea.AlignmentBus=Ic=xh.p(Ea,"AlignmentBus",24);var Rc;Ea.AlignmentBusBranching=Rc=xh.p(Ea,"AlignmentBusBranching",25);var Gc;Ea.AlignmentTopLeftBus=Gc=xh.p(Ea,"AlignmentTopLeftBus",26);var Vc;Ea.AlignmentBottomRightBus=Vc=xh.p(Ea,"AlignmentBottomRightBus",27);var Hc;Ea.CompactionNone=Hc=xh.p(Ea,"CompactionNone",30);var Kc;Ea.CompactionBlock=Kc=xh.p(Ea,"CompactionBlock",31);var Uc;Ea.StyleLayered=Uc=xh.p(Ea,"StyleLayered",40);var Jc;Ea.StyleLastParents=Jc=xh.p(Ea,"StyleLastParents",41);var Yc;Ea.StyleAlternating=Yc=xh.p(Ea,"StyleAlternating",42);var Wc;Ea.StyleRootOnly=Wc=xh.p(Ea,"StyleRootOnly",43);var Xc;Ea.ArrangementVertical=Xc=xh.p(Ea,"ArrangementVertical",50);var Qc;Ea.ArrangementHorizontal=Qc=xh.p(Ea,"ArrangementHorizontal",51);var Zc;Ea.ArrangementFixedRoots=Zc=xh.p(Ea,"ArrangementFixedRoots",52);var $c;Ea.LayerIndividual=$c=xh.p(Ea,"LayerIndividual",60);var _c;Ea.LayerSiblings=_c=xh.p(Ea,"LayerSiblings",61);var tp;Ea.LayerUniform=tp=xh.p(Ea,"LayerUniform",62),xh.Ja(dh,Ps),xh.ea("TreeNetwork",dh),dh.prototype.createVertex=function(){return new yh},dh.prototype.createEdge=function(){return new vh},xh.Ja(yh,Cs),xh.ea("TreeVertex",yh),yh.prototype.copyInheritedPropertiesFrom=function(t){null!==t&&(this.sorting=t.sorting,this.comparer=t.comparer,this.angle=t.angle,this.alignment=t.alignment,this.nodeIndent=t.nodeIndent,this.nodeIndentPastParent=t.nodeIndentPastParent,this.nodeSpacing=t.nodeSpacing,this.layerSpacing=t.layerSpacing,this.layerSpacingParentOverlap=t.layerSpacingParentOverlap,this.compaction=t.compaction,this.breadthLimit=t.breadthLimit,this.rowSpacing=t.rowSpacing,this.rowIndent=t.rowIndent,this.commentSpacing=t.commentSpacing,this.commentMargin=t.commentMargin,this.setsPortSpot=t.setsPortSpot,this.portSpot=t.portSpot,this.setsChildPortSpot=t.setsChildPortSpot,this.childPortSpot=t.childPortSpot)},xh.u(yh,{Mm:"childrenCount"},function(){return this.children.length}),xh.defineProperty(yh,{tL:"relativePosition"},function(){return this.na},function(t){this.na.set(t)}),xh.defineProperty(yh,{FL:"subtreeSize"},function(){return this.hb},function(t){this.hb.set(t)}),xh.defineProperty(yh,{EL:"subtreeOffset"},function(){return this.Ma},function(t){this.Ma.set(t)}),xh.Ja(vh,js),xh.ea("TreeEdge",vh),vh.prototype.commit=function(){var t=this.link;if(null!==t&&!t.Al){var i=this.network.Rb,e=null,n=null;switch(i.Ef){case jc:e=this.fromVertex,n=this.toVertex;break;case Lc:e=this.toVertex,n=this.fromVertex;break;default:xh.k("Unhandled path value "+i.Ef.toString())}if(null!==e&&null!==n)if(0!==(i=this.bs).x||0!==i.y||e.fJ){var n=e.nb,o=fh(e),r=ch(e),s=e.rowSpacing;t.pn();var a,h,l=t.Le===Cf,u=t.kc,f=0;if(t.Ml(),u||l){for(f=2;4<t.pa;)t.eF(2);a=t.l(1),h=t.l(2)}else{for(f=1;3<t.pa;)t.eF(1);a=t.l(0),h=t.l(t.pa-1)}var c=t.l(t.pa-1),p=0;0===o?(e.alignment===Ec?(p=n.bottom+i.y,0===i.y&&a.y>c.y+e.rowIndent&&(p=Math.min(p,Math.max(a.y,p-ph(e))))):e.alignment===Bc?(p=n.top+i.y,0===i.y&&a.y<c.y-e.rowIndent&&(p=Math.max(p,Math.min(a.y,p+ph(e))))):p=e.Jp||e.Kp&&1===e.maxGenerationCount?n.top-e.Ma.y+i.y:n.y+n.height/2+i.y,l?(t.w(f,a.x,p),f++,t.w(f,n.right+r,p),f++,t.w(f,n.right+r+(i.x-s)/3,p),f++,t.w(f,n.right+r+2*(i.x-s)/3,p),f++,t.w(f,n.right+r+(i.x-s),p),f++,t.w(f,h.x,p)):(u&&(t.w(f,n.right+r/2,a.y),f++),t.w(f,n.right+r/2,p),f++,t.w(f,n.right+r+i.x-(u?s/2:s),p),f++,u&&t.w(f,t.l(f-1).x,h.y))):90===o?(e.alignment===Ec?(p=n.right+i.x,0===i.x&&a.x>c.x+e.rowIndent&&(p=Math.min(p,Math.max(a.x,p-ph(e))))):e.alignment===Bc?(p=n.left+i.x,0===i.x&&a.x<c.x-e.rowIndent&&(p=Math.max(p,Math.min(a.x,p+ph(e))))):p=e.Jp||e.Kp&&1===e.maxGenerationCount?n.left-e.Ma.x+i.x:n.x+n.width/2+i.x,l?(t.w(f,p,a.y),f++,t.w(f,p,n.bottom+r),f++,t.w(f,p,n.bottom+r+(i.y-s)/3),f++,t.w(f,p,n.bottom+r+2*(i.y-s)/3),f++,t.w(f,p,n.bottom+r+(i.y-s)),f++,t.w(f,p,h.y)):(u&&(t.w(f,a.x,n.bottom+r/2),f++),t.w(f,p,n.bottom+r/2),f++,t.w(f,p,n.bottom+r+i.y-(u?s/2:s)),f++,u&&t.w(f,h.x,t.l(f-1).y))):180===o?(e.alignment===Ec?(p=n.bottom+i.y,0===i.y&&a.y>c.y+e.rowIndent&&(p=Math.min(p,Math.max(a.y,p-ph(e))))):e.alignment===Bc?(p=n.top+i.y,0===i.y&&a.y<c.y-e.rowIndent&&(p=Math.max(p,Math.min(a.y,p+ph(e))))):p=e.Jp||e.Kp&&1===e.maxGenerationCount?n.top-e.Ma.y+i.y:n.y+n.height/2+i.y,l?(t.w(f,a.x,p),f++,t.w(f,n.left-r,p),f++,t.w(f,n.left-r+(i.x+s)/3,p),f++,t.w(f,n.left-r+2*(i.x+s)/3,p),f++,t.w(f,n.left-r+(i.x+s),p),f++,t.w(f,h.x,p)):(u&&(t.w(f,n.left-r/2,a.y),f++),t.w(f,n.left-r/2,p),f++,t.w(f,n.left-r+i.x+(u?s/2:s),p),f++,u&&t.w(f,t.l(f-1).x,h.y))):270===o?(e.alignment===Ec?(p=n.right+i.x,0===i.x&&a.x>c.x+e.rowIndent&&(p=Math.min(p,Math.max(a.x,p-ph(e))))):e.alignment===Bc?(p=n.left+i.x,0===i.x&&a.x<c.x-e.rowIndent&&(p=Math.max(p,Math.min(a.x,p+ph(e))))):p=e.Jp||e.Kp&&1===e.maxGenerationCount?n.left-e.Ma.x+i.x:n.x+n.width/2+i.x,l?(t.w(f,p,a.y),f++,t.w(f,p,n.top-r),f++,t.w(f,p,n.top-r+(i.y+s)/3),f++,t.w(f,p,n.top-r+2*(i.y+s)/3),f++,t.w(f,p,n.top-r+(i.y+s)),f++,t.w(f,p,h.y)):(u&&(t.w(f,a.x,n.top-r/2),f++),t.w(f,p,n.top-r/2),f++,t.w(f,p,n.top-r+i.y+(u?s/2:s)),f++,u&&t.w(f,h.x,t.l(f-1).y))):xh.k("Invalid angle "+o),t.Ui()}else o=e,r=n,t=this.link,(e=fh(o))!==fh(r)&&(i=ch(o),n=o.nb,o=r.nb,0===e&&o.left-n.right<i+1||90===e&&o.top-n.bottom<i+1||180===e&&n.left-o.right<i+1||270===e&&n.top-o.bottom<i+1||(t.pn(),o=t.Le===Cf,r=t.kc,s=Ka(this.fromVertex.alignment),t.Ml(),0===e?(e=n.right+i/2,o?4===t.pa&&(i=t.l(3).y,t.W(1,e-20,t.l(1).y),t.w(2,e-20,i),t.w(3,e,i),t.w(4,e+20,i),t.W(5,t.l(5).x,i)):r?s?t.W(3,t.l(2).x,t.l(4).y):6===t.pa&&(t.W(2,e,t.l(2).y),t.W(3,e,t.l(3).y)):4===t.pa?t.w(2,e,t.l(2).y):3===t.pa?t.W(1,e,t.l(2).y):2===t.pa&&t.w(1,e,t.l(1).y)):90===e?(i=n.bottom+i/2,o?4===t.pa&&(e=t.l(3).x,t.W(1,t.l(1).x,i-20),t.w(2,e,i-20),t.w(3,e,i),t.w(4,e,i+20),t.W(5,e,t.l(5).y)):r?s?t.W(3,t.l(2).x,t.l(4).y):6===t.pa&&(t.W(2,t.l(2).x,i),t.W(3,t.l(3).x,i)):4===t.pa?t.w(2,t.l(2).x,i):3===t.pa?t.W(1,t.l(2).x,i):2===t.pa&&t.w(1,t.l(1).x,i)):180===e?(e=n.left-i/2,o?4===t.pa&&(i=t.l(3).y,t.W(1,e+20,t.l(1).y),t.w(2,e+20,i),t.w(3,e,i),t.w(4,e-20,i),t.W(5,t.l(5).x,i)):r?s?t.W(3,t.l(2).x,t.l(4).y):6===t.pa&&(t.W(2,e,t.l(2).y),t.W(3,e,t.l(3).y)):4===t.pa?t.w(2,e,t.l(2).y):3===t.pa?t.W(1,e,t.l(2).y):2===t.pa&&t.w(1,e,t.l(1).y)):270===e&&(i=n.top-i/2,o?4===t.pa&&(e=t.l(3).x,t.W(1,t.l(1).x,i+20),t.w(2,e,i+20),t.w(3,e,i),t.w(4,e,i-20),t.W(5,e,t.l(5).y)):r?s?t.W(3,t.l(2).x,t.l(4).y):6===t.pa&&(t.W(2,t.l(2).x,i),t.W(3,t.l(3).x,i)):4===t.pa?t.w(2,t.l(2).x,i):3===t.pa?t.W(1,t.l(2).x,i):2===t.pa&&t.w(1,t.l(1).x,i)),t.Ui()))}},xh.defineProperty(vh,{sL:"relativePoint"},function(){return this.bs},function(t){this.bs.set(t)}),xh.Ja(gh,Mn),gh.prototype.cloneProtected=function(t){Mn.prototype.cloneProtected.call(this,t),t.element=this.Te.cloneNode(!0)},gh.prototype.toString=function(){return"HTMLHost("+this.Te.toString()+")#"+xh.pd(this)},gh.prototype.ak=function(t,i){var e=this.Te;if(null!==e){(n=this.Za(zh)).x-=this.Y.width/2,n.y-=this.Y.height/2,n.x-=this.Y.x,n.y-=this.Y.y;var n=i.MF(n),o=i.ol;null===o||o.contains(e)||o.appendChild(e),o=this.transform,e.style.transform="matrix("+o.m11+","+o.m12+","+o.m21+","+o.m22+","+o.dx+","+o.dy+")",e.style.transformOrigin="0 0",o=n.y,e.style.left=n.x+"px",e.style.top=o+"px"}},gh.prototype.vp=function(t,i,e,n){o=this.ya;isFinite(o.width)&&(t=o.width),isFinite(o.height)&&(i=o.height);var o=this.yf,r=this.gh;e=Math.max(e,r.width),n=Math.max(n,r.height),t=Math.min(o.width,t),i=Math.min(o.height,i),t=Math.max(e,t),i=Math.max(n,i),null!==(e=this.Te)&&(i=e.getBoundingClientRect(),t=i.width,i=i.height),P(this.Qc,t,i),Nn(this,0,0,t,i)},gh.prototype.Ri=function(t,i,e,n){Ln(this,t,i,e,n)},xh.u(gh,{Ia:"naturalBounds"},function(){return this.Qc}),xh.defineProperty(gh,{element:"element"},function(){return this.Te},function(t){var i=this.Te;i!==t&&(t instanceof HTMLElement||xh.k("HTMLHost.element must be an instance of HTMLElement."),this.Te=t,t.className="HTMLHost",this.h("element",i,t),this.qa())}),bh.version="1.6.10",t&&(t.module&&"object"==typeof t.module&&"object"==typeof t.module.exports?t.module.exports=bh:t.define&&"function"==typeof t.define&&t.define.amd?(t.go=bh,t.define(bh)):t.go=bh),"undefined"!=typeof module&&"object"==typeof module.exports&&(module.exports=bh)}(window);