/* * GoJS v2.3.3 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com. * Copyright (C) 1998-2023 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.3.3/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function ba(a){var b=0;return function(){return b=e}}); ra("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c=a.length?a.push(c):a.splice(b,0,c):v("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)} function Ma(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):v("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Na(){var a=Oa.pop();return void 0===a?[]:a}function Pa(a){a.length=0;Oa.push(a)}function za(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""} function Qa(a){if("function"===typeof a){if(a.className)return a.className;if(a.name)return a.name;var b=a.toString();b=b.substring(9,b.indexOf("(")).trim();if(""!==b)return a._className=b}else if(Ga(a)&&a.constructor)return Qa(a.constructor);return typeof a} function Ra(a){var b=a;Ga(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()}function Sa(a,b){if(a.hasOwnProperty(b))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(b))return!0;var c=a.LA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ta(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})} function Va(a){for(var b=[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);c=[];for(var d=0,e=0;ec;c++)b[c]=c;for(c=d=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;d=c=0;for(var f="",g=0;gthis.key)return!1;Da(a)}a=a.s;var b=a.length,c=++this.eb,d=this.yf;if(null!==d)for(;cthis.key)return!1;Da(a)}var b=--this.eb;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.fe();return!1};hb.prototype.Ad=function(){return this.next()}; hb.prototype.first=function(){var a=this.Gb;this.wa=a.A;var b=a.s;this.eb=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};hb.prototype.any=function(a){var b=this.Gb;b.Pg=null;var c=b.A,d=b.s,e=d.length;this.eb=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.A!==c&&Da(b)}return!1};hb.prototype.all=function(a){var b=this.Gb;b.Pg=null;var c=b.A,d=b.s,e=d.length;this.eb=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.A!==c&&Da(b)}return!0}; hb.prototype.each=function(a){var b=this.Gb;b.Pg=null;var c=b.A,d=b.s,e=d.length;this.eb=e;for(--e;0<=e;e--)a(d[e]),b.A!==c&&Da(b);return this};hb.prototype.map=function(a){var b=this.Gb;b.Pg=null;var c=b.A,d=[],e=b.s,f=e.length;this.eb=f;for(--f;0<=f;f--)d.push(a(e[f])),b.A!==c&&Da(b);a=new I;a.s=d;a.Cb();return a.iterator}; hb.prototype.filter=function(a){var b=this.Gb;b.Pg=null;var c=b.A,d=[],e=b.s,f=e.length;this.eb=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.A!==c&&Da(b)}a=new I;a.s=d;a.Cb();return a.iterator};hb.prototype.fe=function(){this.key=-1;this.value=null;this.wa=-1;this.Gb.Pg=this};hb.prototype.toString=function(){return"ListIteratorBackwards("+this.eb+"/"+this.Gb.count+")"}; oa.Object.defineProperties(hb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Gb.s.length}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.Ad;hb.prototype.next=hb.prototype.next;hb.prototype.reset=hb.prototype.reset;hb.className="ListIteratorBackwards"; function I(a){Ya(this);this._isFrozen=!1;this.s=[];this.A=0;this.Pg=this.Xa=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.Cb=function(){var a=this.A;a++;999999999a||a>=b.length)&&Ba(a,"0 <= i < length",I,"elt:i");return b[a]};t.get=function(a){return this.O(a)};t.cd=function(a,b){G&&D(a,I,"setElt:i");var c=this.s;(0>a||a>=c.length)&&Ba(a,"0 <= i < length",I,"setElt:i");this._isFrozen&&xa(this,a);c[a]=b};t.set=function(a,b){this.cd(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]}; t.lc=function(){var a=this.s,b=a.length;return 0a&&Ba(a,">= 0",I,"insertAt:i");this._isFrozen&&xa(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.Cb()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(this,a);var b=this.s;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Cb();return!0};t.delete=function(a){return this.remove(a)}; t.tb=function(a){G&&D(a,I,"removeAt:i");var b=this.s;(0>a||a>=b.length)&&Ba(a,"0 <= i < length",I,"removeAt:i");this._isFrozen&&xa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Cb()};t.removeRange=function(a,b){G&&(D(a,I,"removeRange:from"),D(b,I,"removeRange:to"));var c=this.s,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this._isFrozen&&xa(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&Ba(b,"0 <= from < length",I,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a=e)for(c=d.slice(b),c.sort(a),a=b;a=this.s.length)return eb;var a=this.Xa;return null!==a?(a.reset(),a):new gb(this)}},iteratorBackwards:{configurable:!0, enumerable:!0,get:function(){if(0>=this.s.length)return eb;var a=this.Pg;return null!==a?(a.reset(),a):new hb(this)}}});I.prototype.reverse=I.prototype.reverse;I.prototype.sortRange=I.prototype.Ji;I.prototype.sort=I.prototype.sort;I.prototype.toSet=I.prototype.Pv;I.prototype.toArray=I.prototype.La;I.prototype.removeRange=I.prototype.removeRange;I.prototype.removeAt=I.prototype.tb;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.insertAt=I.prototype.Jb; I.prototype.pop=I.prototype.pop;I.prototype.last=I.prototype.lc;I.prototype.first=I.prototype.first;I.prototype.set=I.prototype.set;I.prototype.setElt=I.prototype.cd;I.prototype.get=I.prototype.get;I.prototype.elt=I.prototype.O;I.prototype.indexOf=I.prototype.indexOf;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.clear=I.prototype.clear;I.prototype.addAll=I.prototype.addAll;I.prototype.push=I.prototype.push;I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.qa; I.prototype.freeze=I.prototype.freeze;I.className="List";function lb(a){this.mg=a;a.Xa=null;this.wa=a.A;this.ya=null}lb.prototype.reset=function(){var a=this.mg;a.Xa=null;this.wa=a.A;this.ya=null};lb.prototype.next=function(){var a=this.mg;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ba;if(null!==b)return this.ya=b,this.value=b.value,this.key=b.key,!0;this.fe();return!1};lb.prototype.Ad=function(){return this.next()}; lb.prototype.first=function(){var a=this.mg;this.wa=a.A;a=a.ja;if(null!==a){this.ya=a;var b=a.value;this.key=a.key;return this.value=b}return null};lb.prototype.any=function(a){var b=this.mg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Ba}return!1};lb.prototype.all=function(a){var b=this.mg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Ba}return!0}; lb.prototype.each=function(a){var b=this.mg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Ba;return this};lb.prototype.map=function(a){var b=this.mg;b.Xa=null;for(var c=new I,d=b.A,e=b.ja;null!==e;)c.add(a(e.value)),b.A!==d&&Da(b),e=e.Ba;return c.iterator};lb.prototype.filter=function(a){var b=this.mg;b.Xa=null;for(var c=new I,d=b.A,e=b.ja;null!==e;){var f=e.value;a(f)&&c.add(f);b.A!==d&&Da(b);e=e.Ba}return c.iterator}; lb.prototype.fe=function(){this.value=this.key=null;this.wa=-1;this.mg.Xa=this};lb.prototype.toString=function(){return null!==this.ya?"SetIterator@"+this.ya.value:"SetIterator"};oa.Object.defineProperties(lb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.mg.Tb}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.Ad;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset; lb.className="SetIterator";function J(a){Ya(this);this._isFrozen=!1;this.Ub={};this.Tb=0;this.Xa=null;this.A=0;this.tf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=J.prototype;t.Cb=function(){var a=this.A;a++;999999999=this.Tb)return eb;var a=this.Xa;return null!==a?(a.reset(),a):new lb(this)}}});J.prototype.toList=J.prototype.Ov;J.prototype.toArray=J.prototype.La; J.prototype.clear=J.prototype.clear;J.prototype.retainAll=J.prototype.yA;J.prototype.removeAll=J.prototype.op;J.prototype["delete"]=J.prototype.delete;J.prototype.remove=J.prototype.remove;J.prototype.first=J.prototype.first;J.prototype.containsAny=J.prototype.bz;J.prototype.containsAll=J.prototype.az;J.prototype.has=J.prototype.has;J.prototype.contains=J.prototype.contains;J.prototype.addAll=J.prototype.addAll;J.prototype.add=J.prototype.add;J.prototype.thaw=J.prototype.qa;J.prototype.freeze=J.prototype.freeze; var ob=1;J.className="Set";J.uniqueHash=Ya;J.hashIdUnique=mb;J.hashId=ib;function pb(a){this.sa=a;this.wa=a.A;this.ya=null}pb.prototype.reset=function(){this.wa=this.sa.A;this.ya=null};pb.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ba;if(null!==b)return this.ya=b,this.value=this.key=a=b.key,!0;this.fe();return!1};pb.prototype.Ad=function(){return this.next()}; pb.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;return null!==a?(this.ya=a,this.value=this.key=a=a.key):null};pb.prototype.any=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.key))return!0;b.A!==c&&Da(b);d=d.Ba}return!1};pb.prototype.all=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.key))return!1;b.A!==c&&Da(b);d=d.Ba}return!0}; pb.prototype.each=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.key),b.A!==c&&Da(b),d=d.Ba;return this};pb.prototype.map=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e.key)),b.A!==c&&Da(b),e=e.Ba;return d.iterator};pb.prototype.filter=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;){var f=e.key;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Ba}return d.iterator}; pb.prototype.fe=function(){this.value=this.key=null;this.wa=-1};pb.prototype.toString=function(){return null!==this.ya?"MapKeySetIterator@"+this.ya.value:"MapKeySetIterator"};oa.Object.defineProperties(pb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Tb}}});pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.Ad;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset; pb.className="MapKeySetIterator";function qb(a){J.call(this);Ya(this);this._isFrozen=!0;this.sa=a}na(qb,J);t=qb.prototype;t.freeze=function(){return this};t.qa=function(){return this};t.toString=function(){return"MapKeySet("+this.sa.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString())};t.contains=function(a){return this.sa.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)}; t.clear=function(){v("This Set is read-only: "+this.toString())};t.first=function(){var a=this.sa.ja;return null!==a?a.key:null};qb.prototype.any=function(a){for(var b=this.sa.ja;null!==b;){if(a(b.key))return!0;b=b.Ba}return!1};qb.prototype.all=function(a){for(var b=this.sa.ja;null!==b;){if(!a(b.key))return!1;b=b.Ba}return!0};qb.prototype.each=function(a){for(var b=this.sa.ja;null!==b;)a(b.key),b=b.Ba;return this}; qb.prototype.map=function(a){for(var b=new J,c=this.sa.ja;null!==c;)b.add(a(c.key)),c=c.Ba;return b};qb.prototype.filter=function(a){for(var b=new J,c=this.sa.ja;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Ba}return b};qb.prototype.copy=function(){return new qb(this.sa)};qb.prototype.Pv=function(){var a=new J,b=this.sa.Ub,c;for(c in b)a.add(b[c].key);return a};qb.prototype.La=function(){var a=this.sa.Ub,b=Array(this.sa.Tb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; qb.prototype.Ov=function(){var a=new I,b=this.sa.Ub,c;for(c in b)a.add(b[c].key);return a};oa.Object.defineProperties(qb.prototype,{count:{configurable:!0,get:function(){return this.sa.Tb}},size:{configurable:!0,get:function(){return this.sa.Tb}},iterator:{configurable:!0,get:function(){return 0>=this.sa.Tb?eb:new pb(this.sa)}}});qb.prototype.toList=qb.prototype.Ov;qb.prototype.toArray=qb.prototype.La;qb.prototype.toSet=qb.prototype.Pv; qb.prototype.first=qb.prototype.first;qb.prototype.clear=qb.prototype.clear;qb.prototype["delete"]=qb.prototype.delete;qb.prototype.remove=qb.prototype.remove;qb.prototype.has=qb.prototype.has;qb.prototype.contains=qb.prototype.contains;qb.prototype.add=qb.prototype.add;qb.prototype.thaw=qb.prototype.qa;qb.prototype.freeze=qb.prototype.freeze;qb.className="MapKeySet";function rb(a){this.sa=a;a.sf=null;this.wa=a.A;this.ya=null} rb.prototype.reset=function(){var a=this.sa;a.sf=null;this.wa=a.A;this.ya=null};rb.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ba;if(null!==b)return this.ya=b,this.value=b.value,this.key=b.key,!0;this.fe();return!1};rb.prototype.Ad=function(){return this.next()};rb.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;if(null!==a){this.ya=a;var b=a.value;this.key=a.key;return this.value=b}return null}; rb.prototype.any=function(a){var b=this.sa;b.sf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Ba}return!1};rb.prototype.all=function(a){var b=this.sa;b.sf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Ba}return!0};rb.prototype.each=function(a){var b=this.sa;b.sf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Ba;return this}; rb.prototype.map=function(a){var b=this.sa;b.sf=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e.value)),b.A!==c&&Da(b),e=e.Ba;return d.iterator};rb.prototype.filter=function(a){var b=this.sa;b.sf=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;){var f=e.value;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Ba}return d.iterator};rb.prototype.fe=function(){this.value=this.key=null;this.wa=-1;this.sa.sf=this}; rb.prototype.toString=function(){return null!==this.ya?"MapValueSetIterator@"+this.ya.value:"MapValueSetIterator"};oa.Object.defineProperties(rb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Tb}}});rb.prototype.first=rb.prototype.first;rb.prototype.hasNext=rb.prototype.Ad;rb.prototype.next=rb.prototype.next;rb.prototype.reset=rb.prototype.reset;rb.className="MapValueSetIterator"; function nb(a,b){this.key=a;this.value=b;this.tl=this.Ba=null}nb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};nb.className="KeyValuePair";function ub(a){this.sa=a;a.Xa=null;this.wa=a.A;this.ya=null}ub.prototype.reset=function(){var a=this.sa;a.Xa=null;this.wa=a.A;this.ya=null}; ub.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ba;if(null!==b)return this.ya=b,this.key=b.key,this.value=b.value,!0;this.fe();return!1};ub.prototype.Ad=function(){return this.next()};ub.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;return null!==a?(this.ya=a,this.key=a.key,this.value=a.value,a):null}; ub.prototype.any=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d))return!0;b.A!==c&&Da(b);d=d.Ba}return!1};ub.prototype.all=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d))return!1;b.A!==c&&Da(b);d=d.Ba}return!0};ub.prototype.each=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d),b.A!==c&&Da(b),d=d.Ba;return this}; ub.prototype.map=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e)),b.A!==c&&Da(b),e=e.Ba;return d.iterator};ub.prototype.filter=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)a(e)&&d.add(e),b.A!==c&&Da(b),e=e.Ba;return d.iterator};ub.prototype.fe=function(){this.value=this.key=null;this.wa=-1;this.sa.Xa=this};ub.prototype.toString=function(){return null!==this.ya?"MapIterator@"+this.ya:"MapIterator"}; oa.Object.defineProperties(ub.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Tb}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.Ad;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapIterator"; function xb(a){Ya(this);this._isFrozen=!1;this.Ub={};this.Tb=0;this.sf=this.Xa=null;this.A=0;this.tf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=xb.prototype;t.Cb=function(){var a=this.A;a++;999999999=this.count)return eb;var a=this.Xa;return null!==a?(a.reset(),a):new ub(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?eb:new pb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return eb; var a=this.sf;return null!==a?(a.reset(),a):new rb(this)}}});xb.prototype.toKeySet=xb.prototype.Uf;xb.prototype.toArray=xb.prototype.La;xb.prototype.clear=xb.prototype.clear;xb.prototype["delete"]=xb.prototype.delete;xb.prototype.remove=xb.prototype.remove;xb.prototype.get=xb.prototype.get;xb.prototype.getValue=xb.prototype.L;xb.prototype.has=xb.prototype.has;xb.prototype.contains=xb.prototype.contains;xb.prototype.first=xb.prototype.first;xb.prototype.addAll=xb.prototype.addAll; xb.prototype.set=xb.prototype.set;xb.prototype.add=xb.prototype.add;xb.prototype.thaw=xb.prototype.qa;xb.prototype.freeze=xb.prototype.freeze;xb.className="Map";function K(a,b){void 0===a?this.K=this.J=0:"number"===typeof a&&"number"===typeof b?(this.J=a,this.K=b):v("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var yb,zb,Ab,Bb,Cb;K.prototype.assign=function(a){this.J=a.J;this.K=a.K;return this};K.prototype.h=function(a,b){this.J=a;this.K=b;return this}; K.prototype.Ag=function(a,b){G&&(B(a,"number",K,"setTo:x"),B(b,"number",K,"setTo:y"),this.la());this.J=a;this.K=b;return this};K.prototype.set=function(a){G&&(x(a,K,K,"set:p"),this.la());this.J=a.J;this.K=a.K;return this};K.prototype.copy=function(){var a=new K;a.J=this.J;a.K=this.K;return a};t=K.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Db(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new K(c,e)}return new K} function Eb(a){G&&x(a,K);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.D=function(a){return a instanceof K?this.J===a.x&&this.K===a.y:!1};t.ri=function(a,b){return this.J===a&&this.K===b};t.gb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)};t.add=function(a){G&&(x(a,K,K,"add:p"),this.la());this.J+=a.x;this.K+=a.y;return this};t.ve=function(a){G&&(x(a,K,K,"subtract:p"),this.la());this.J-=a.x;this.K-=a.y;return this}; t.offset=function(a,b){G&&(D(a,K,"offset:dx"),D(b,K,"offset:dy"),this.la());this.J+=a;this.K+=b;return this};K.prototype.rotate=function(a){G&&(D(a,K,"rotate:angle"),this.la());if(0===a)return this;var b=this.J,c=this.K;if(0===b&&0===c)return this;360<=a?a-=360:0>a&&(a+=360);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));this.J=a*b-d*c;this.K=d*b+a*c;return this};t=K.prototype; t.scale=function(a,b){G&&(D(a,K,"scale:sx"),D(b,K,"scale:sy"),this.la());this.J*=a;this.K*=b;return this};t.Kf=function(a){G&&x(a,K,K,"distanceSquaredPoint:p");var b=a.x-this.J;a=a.y-this.K;return b*b+a*a};t.zd=function(a,b){G&&(D(a,K,"distanceSquared:px"),D(b,K,"distanceSquared:py"));a-=this.J;b-=this.K;return a*a+b*b};t.normalize=function(){G&&this.la();var a=this.J,b=this.K,c=Math.sqrt(a*a+b*b);0b?270:0;if(0===b)return 0a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c} t.$y=function(a,b){G&&(x(a,K,K,"compareWithLineSegmentPoint:p"),x(b,K,K,"compareWithLineSegmentPoint:q"));return L.Pl(a.x,a.y,b.x,b.y,this.x,this.y)};t.oA=function(a,b,c,d){G&&(D(a,K,"projectOntoLineSegment:px"),D(b,K,"projectOntoLineSegment:py"),D(c,K,"projectOntoLineSegment:qx"),D(d,K,"projectOntoLineSegment:qy"));L.wh(a,b,c,d,this.J,this.K,this);return this}; t.pA=function(a,b){G&&(x(a,K,K,"projectOntoLineSegmentPoint:p"),x(b,K,K,"projectOntoLineSegmentPoint:q"));L.wh(a.x,a.y,b.x,b.y,this.J,this.K,this);return this};t.DA=function(a,b,c,d){G&&(D(a,K,"snapToGrid:originx"),D(b,K,"snapToGrid:originy"),D(c,K,"snapToGrid:cellwidth"),D(d,K,"snapToGrid:cellheight"));L.Vo(this.J,this.K,a,b,c,d,this);return this};t.EA=function(a,b){G&&(x(a,K,K,"snapToGridPoint:p"),x(b,Gb,K,"snapToGridPoint:q"));L.Vo(this.J,this.K,a.x,a.y,b.width,b.height,this);return this}; t.Hi=function(a,b){G&&(x(a,M,K,"setRectSpot:r"),x(b,Hb,K,"setRectSpot:spot"),this.la());this.J=a.x+b.x*a.width+b.offsetX;this.K=a.y+b.y*a.height+b.offsetY;return this};t.Ii=function(a,b,c,d,e){G&&(D(a,K,"setSpot:x"),D(b,K,"setSpot:y"),D(c,K,"setSpot:w"),D(d,K,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),x(e,Hb,K,"setSpot:spot"),this.la());this.J=a+e.x*c+e.offsetX;this.K=b+e.y*d+e.offsetY;return this}; t.transform=function(a){G&&x(a,Ib,K,"transform:t");a.Ma(this);return this};function Jb(a,b){G&&x(b,Ib,K,"transformInverted:t");b.Rd(a);return a} function Kb(a,b,c,d,e,f){G&&(D(a,K,"distanceLineSegmentSquared:px"),D(b,K,"distanceLineSegmentSquared:py"),D(c,K,"distanceLineSegmentSquared:ax"),D(d,K,"distanceLineSegmentSquared:ay"),D(e,K,"distanceLineSegmentSquared:bx"),D(f,K,"distanceLineSegmentSquared:by"));var g=e-c,h=f-d,k=g*g+h*h;c-=a;d-=b;var l=-c*g-d*h;if(0>=l||l>=k)return g=e-a,h=f-b,Math.min(c*c+d*d,g*g+h*h);a=g*d-h*c;return a*a/k} function Lb(a,b,c,d){G&&(D(a,K,"distanceSquared:px"),D(b,K,"distanceSquared:py"),D(c,K,"distanceSquared:qx"),D(d,K,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Mb(a,b,c,d){G&&(D(a,K,"direction:px"),D(b,K,"direction:py"),D(c,K,"direction:qx"),D(d,K,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0b?270:0;if(0===b)return 0a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d} t.u=function(){return isFinite(this.x)&&isFinite(this.y)};K.alloc=function(){var a=Nb.pop();return void 0===a?new K:a};K.allocAt=function(a,b){var c=Nb.pop();if(void 0===c)return new K(a,b);c.x=a;c.y=b;return c};K.free=function(a){Nb.push(a)}; oa.Object.defineProperties(K.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",K,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",K,"y"),this.la(a));this.K=a}}});K.prototype.isReal=K.prototype.u;K.prototype.setSpot=K.prototype.Ii;K.prototype.setRectSpot=K.prototype.Hi;K.prototype.snapToGridPoint=K.prototype.EA;K.prototype.snapToGrid=K.prototype.DA; K.prototype.projectOntoLineSegmentPoint=K.prototype.pA;K.prototype.projectOntoLineSegment=K.prototype.oA;K.intersectingLineSegments=function(a,b,c,d,e,f,g,h){G&&(D(a,K,"intersectingLineSegments:a1x"),D(b,K,"intersectingLineSegments:a1y"),D(c,K,"intersectingLineSegments:a2x"),D(d,K,"intersectingLineSegments:a2y"),D(e,K,"intersectingLineSegments:b1x"),D(f,K,"intersectingLineSegments:b1y"),D(g,K,"intersectingLineSegments:b2x"),D(h,K,"intersectingLineSegments:b2y"));return L.$l(a,b,c,d,e,f,g,h)}; K.prototype.compareWithLineSegmentPoint=K.prototype.$y;K.compareWithLineSegment=function(a,b,c,d,e,f){G&&(D(a,K,"compareWithLineSegment:a1x"),D(b,K,"compareWithLineSegment:a1y"),D(c,K,"compareWithLineSegment:a2x"),D(d,K,"compareWithLineSegment:a2y"),D(e,K,"compareWithLineSegment:b1x"),D(f,K,"compareWithLineSegment:b1y"));return L.Pl(a,b,c,d,e,f)};K.prototype.direction=K.prototype.direction;K.prototype.directionPoint=K.prototype.fb;K.prototype.normalize=K.prototype.normalize; K.prototype.distanceSquared=K.prototype.zd;K.prototype.distanceSquaredPoint=K.prototype.Kf;K.prototype.scale=K.prototype.scale;K.prototype.rotate=K.prototype.rotate;K.prototype.offset=K.prototype.offset;K.prototype.subtract=K.prototype.ve;K.prototype.add=K.prototype.add;K.prototype.equalsApprox=K.prototype.gb;K.prototype.equalTo=K.prototype.ri;K.prototype.equals=K.prototype.D;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.Ag;var Nb=[];K.className="Point";K.parse=Db;K.stringify=Eb; K.distanceLineSegmentSquared=Kb;K.distanceSquared=Lb;K.direction=Mb;K.Origin=yb=(new K(0,0)).na();K.InfiniteTopLeft=zb=(new K(-Infinity,-Infinity)).na();K.InfiniteBottomRight=Ab=(new K(Infinity,Infinity)).na();K.SixPoint=Bb=(new K(6,6)).na();K.NoPoint=Cb=(new K(NaN,NaN)).na();K.parse=Db;K.stringify=Eb;K.distanceLineSegmentSquared=Kb;K.distanceSquared=Lb;K.direction=Mb; function Gb(a,b){void 0===a?this.ea=this.ga=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.ga=a,this.ea=b):v("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Ob,Pb,Qb,Rb,Sb,Tb,Ub;Gb.prototype.assign=function(a){this.ga=a.ga;this.ea=a.ea;return this};Gb.prototype.h=function(a,b){this.ga=a;this.ea=b;return this}; Gb.prototype.Ag=function(a,b){G&&(B(a,"number",Gb,"setTo:w"),B(b,"number",Gb,"setTo:h"),0>a&&Ba(a,">= 0",Gb,"setTo:w"),0>b&&Ba(b,">= 0",Gb,"setTo:h"),this.la());this.ga=a;this.ea=b;return this};Gb.prototype.set=function(a){G&&(x(a,Gb,Gb,"set:s"),this.la());this.ga=a.ga;this.ea=a.ea;return this};Gb.prototype.copy=function(){var a=new Gb;a.ga=this.ga;a.ea=this.ea;return a};t=Gb.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function Vb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new Gb(c,e)}return new Gb}function Zb(a){G&&x(a,Gb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.D=function(a){return a instanceof Gb?this.ga===a.width&&this.ea===a.height:!1};t.ri=function(a,b){return this.ga===a&&this.ea===b}; t.gb=function(a){return L.C(this.ga,a.width)&&L.C(this.ea,a.height)};t.Ec=function(a,b){G&&(D(a,Gb,"inflate:w"),D(b,Gb,"inflate:h"));a=this.width+a;this.ga=0<=a?a:0;b=this.height+b;this.ea=0<=b?b:0;return this};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Gb.alloc=function(){var a=$b.pop();return void 0===a?new Gb:a};Gb.free=function(a){$b.push(a)}; oa.Object.defineProperties(Gb.prototype,{width:{configurable:!0,get:function(){return this.ga},set:function(a){G&&(B(a,"number",Gb,"width"),this.la(a));0>a&&Ba(a,">= 0",Gb,"width");this.ga=a}},height:{configurable:!0,get:function(){return this.ea},set:function(a){G&&(B(a,"number",Gb,"height"),this.la(a));0>a&&Ba(a,">= 0",Gb,"height");this.ea=a}}});Gb.prototype.isReal=Gb.prototype.u;Gb.prototype.inflate=Gb.prototype.Ec;Gb.prototype.equalsApprox=Gb.prototype.gb; Gb.prototype.equalTo=Gb.prototype.ri;Gb.prototype.equals=Gb.prototype.D;Gb.prototype.set=Gb.prototype.set;Gb.prototype.setTo=Gb.prototype.Ag;var $b=[];Gb.className="Size";Gb.parse=Vb;Gb.stringify=Zb;Gb.ZeroSize=Ob=(new Gb(0,0)).na();Gb.OneSize=Pb=(new Gb(1,1)).na();Gb.SixSize=Qb=(new Gb(6,6)).na();Gb.EightSize=Rb=(new Gb(8,8)).na();Gb.TenSize=Sb=(new Gb(10,10)).na();Gb.InfiniteSize=Tb=(new Gb(Infinity,Infinity)).na();Gb.NoSize=Ub=(new Gb(NaN,NaN)).na();Gb.parse=Vb;Gb.stringify=Zb; function M(a,b,c,d){void 0===a?this.ea=this.ga=this.K=this.J=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.J=a,this.K=b,this.ga=c,this.ea=d):a instanceof K?(c=a.x,a=a.y,b instanceof K?(d=b.x,b=b.y,this.J=Math.min(c,d),this.K=Math.min(a,b),this.ga=Math.abs(c-d),this.ea=Math.abs(a-b)):b instanceof Gb?(this.J=c,this.K=a,this.ga=b.width,this.ea=b.height):v("Incorrect second argument supplied to Rect constructor "+b)):v("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=M.prototype;t.assign=function(a){this.J=a.J;this.K=a.K;this.ga=a.ga;this.ea=a.ea;return this};t.h=function(a,b,c,d){this.J=a;this.K=b;this.ga=c;this.ea=d;return this};function ac(a,b,c){a.ga=b;a.ea=c}t.Ag=function(a,b,c,d){G&&(B(a,"number",M,"setTo:x"),B(b,"number",M,"setTo:y"),B(c,"number",M,"setTo:w"),B(d,"number",M,"setTo:h"),0>c&&Ba(c,">= 0",M,"setTo:w"),0>d&&Ba(d,">= 0",M,"setTo:h"),this.la());this.J=a;this.K=b;this.ga=c;this.ea=d;return this}; t.set=function(a){G&&(x(a,M,M,"set:r"),this.la());this.J=a.J;this.K=a.K;this.ga=a.ga;this.ea=a.ea;return this};t.dd=function(a){G&&(x(a,K,M,"setPoint:p"),this.la());this.J=a.x;this.K=a.y;return this};t.CA=function(a){G&&(x(a,Gb,M,"setSize:s"),this.la());this.ga=a.width;this.ea=a.height;return this};M.prototype.copy=function(){var a=new M;a.J=this.J;a.K=this.K;a.ga=this.ga;a.ea=this.ea;return a};t=M.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function bc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new M(c,e,f,g)}return new M}function cc(a){G&&x(a,M);return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()} t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.D=function(a){return a instanceof M?this.J===a.x&&this.K===a.y&&this.ga===a.width&&this.ea===a.height:!1};t.ri=function(a,b,c,d){return this.J===a&&this.K===b&&this.ga===c&&this.ea===d};t.gb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)&&L.C(this.ga,a.width)&&L.C(this.ea,a.height)};function dc(a,b){return L.ca(a.J,b.x)&&L.ca(a.K,b.y)&&L.ca(a.ga,b.width)&&L.ca(a.ea,b.height)} t.ha=function(a){G&&x(a,K,M,"containsPoint:p");return this.J<=a.x&&this.J+this.ga>=a.x&&this.K<=a.y&&this.K+this.ea>=a.y};t.Ze=function(a){G&&x(a,M,M,"containsRect:r");return this.J<=a.x&&a.x+a.width<=this.J+this.ga&&this.K<=a.y&&a.y+a.height<=this.K+this.ea}; t.contains=function(a,b,c,d){G?(D(a,M,"contains:x"),D(b,M,"contains:y"),void 0===c?c=0:D(c,M,"contains:w"),void 0===d?d=0:D(d,M,"contains:h"),(0>c||0>d)&&v("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.J<=a&&a+c<=this.J+this.ga&&this.K<=b&&b+d<=this.K+this.ea};t.offset=function(a,b){G&&(D(a,M,"offset:dx"),D(b,M,"offset:dy"),this.la());this.J+=a;this.K+=b;return this}; t.Ec=function(a,b){G&&(D(a,M,"inflate:w"),D(b,M,"inflate:h"));return ec(this,b,a,b,a)};t.Ko=function(a){G&&x(a,fc,M,"addMargin:m");return ec(this,a.top,a.right,a.bottom,a.left)};t.Mv=function(a){G&&x(a,fc,M,"subtractMargin:m");return ec(this,-a.top,-a.right,-a.bottom,-a.left)};t.Sz=function(a,b,c,d){G&&(D(a,M,"grow:t"),D(b,M,"grow:r"),D(c,M,"grow:b"),D(d,M,"grow:l"));return ec(this,a,b,c,d)}; function ec(a,b,c,d,e){G&&a.la();var f=a.ga;c+e<=-f?(a.J+=f/2,a.ga=0):(a.J-=e,a.ga+=c+e);c=a.ea;b+d<=-c?(a.K+=c/2,a.ea=0):(a.K-=b,a.ea+=b+d);return a}t.Ox=function(a){G&&x(a,M,M,"intersectRect:r");return gc(this,a.x,a.y,a.width,a.height)};t.ev=function(a,b,c,d){G&&(D(a,M,"intersect:x"),D(b,M,"intersect:y"),D(c,M,"intersect:w"),D(d,M,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return gc(this,a,b,c,d)}; function gc(a,b,c,d,e){G&&a.la();var f=Math.max(a.J,b),g=Math.max(a.K,c);b=Math.min(a.J+a.ga,b+d);c=Math.min(a.K+a.ea,c+e);a.J=f;a.K=g;a.ga=Math.max(0,b-f);a.ea=Math.max(0,c-g);return a}t.Zc=function(a){G&&x(a,M,M,"intersectsRect:r");return this.fv(a.x,a.y,a.width,a.height)}; t.fv=function(a,b,c,d){G&&(D(a,M,"intersects:x"),D(b,M,"intersects:y"),D(a,M,"intersects:w"),D(b,M,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.ga,f=this.J;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.ea;c=this.K;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function hc(a,b){var c=a.ga,d=a.J,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.ea;a=a.K;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.gf=function(a){G&&x(a,K,M,"unionPoint:p");return ic(this,a.x,a.y,0,0)};t.ed=function(a){G&&x(a,M,M,"unionRect:r");return ic(this,a.J,a.K,a.ga,a.ea)}; t.Rv=function(a,b,c,d){G?(D(a,M,"union:x"),D(b,M,"union:y"),void 0===c?c=0:D(c,M,"union:w"),void 0===d?d=0:D(d,M,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.la()):(void 0===c&&(c=0),void 0===d&&(d=0));return ic(this,a,b,c,d)};function ic(a,b,c,d,e){var f=Math.min(a.J,b),g=Math.min(a.K,c);b=Math.max(a.J+a.ga,b+d);c=Math.max(a.K+a.ea,c+e);a.J=f;a.K=g;a.ga=b-f;a.ea=c-g;return a} t.Ii=function(a,b,c){G&&(D(a,M,"setSpot:x"),D(b,M,"setSpot:y"),x(c,Hb,M,"setSpot:spot"),this.la());this.J=a-c.offsetX-c.x*this.ga;this.K=b-c.offsetY-c.y*this.ea;return this}; function lc(a,b,c,d,e,f,g,h){G?(D(a,M,"contains:rx"),D(b,M,"contains:ry"),D(c,M,"contains:rw"),D(d,M,"contains:rh"),D(e,M,"contains:x"),D(f,M,"contains:y"),void 0===g?g=0:D(g,M,"contains:w"),void 0===h?h=0:D(h,M,"contains:h"),(0>c||0>d||0>g||0>h)&&v("Rect.contains:Width and height cannot be negative")):(void 0===g&&(g=0),void 0===h&&(h=0));return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} function mc(a,b,c,d,e,f,g,h){G&&(D(a,M,"intersects:rx"),D(b,M,"intersects:ry"),D(c,M,"intersects:rw"),D(d,M,"intersects:rh"),D(e,M,"intersects:x"),D(f,M,"intersects:y"),D(g,M,"intersects:w"),D(h,M,"intersects:h"),(0>c||0>d||0>g||0>h)&&v("Rect.intersects:Width and height cannot be negative"));return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Xz=function(){return 0===this.width&&0===this.height}; M.alloc=function(){var a=nc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=nc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){nc.push(a)}; oa.Object.defineProperties(M.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",M,"x"),this.la(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",M,"y"),this.la(a));this.K=a}},width:{configurable:!0,get:function(){return this.ga},set:function(a){G&&(B(a,"number",M,"width"),this.la(a));0>a&&Ba(a,">= 0",M,"width");this.ga=a}},height:{configurable:!0,get:function(){return this.ea}, set:function(a){G&&(B(a,"number",M,"height"),this.la(a));0>a&&Ba(a,">= 0",M,"height");this.ea=a}},left:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",M,"left"),this.la(a));this.J=a}},top:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",M,"top"),this.la(a));this.K=a}},right:{configurable:!0,get:function(){return this.J+this.ga},set:function(a){G&&(D(a,M,"right"),this.la(a));this.J+=a-(this.J+this.ga)}}, bottom:{configurable:!0,get:function(){return this.K+this.ea},set:function(a){G&&(D(a,M,"top"),this.la(a));this.K+=a-(this.K+this.ea)}},position:{configurable:!0,get:function(){return new K(this.J,this.K)},set:function(a){G&&(x(a,K,M,"position"),this.la(a));this.J=a.x;this.K=a.y}},size:{configurable:!0,get:function(){return new Gb(this.ga,this.ea)},set:function(a){G&&(x(a,Gb,M,"size"),this.la(a));this.ga=a.width;this.ea=a.height}},center:{configurable:!0, enumerable:!0,get:function(){return new K(this.J+this.ga/2,this.K+this.ea/2)},set:function(a){G&&(x(a,K,M,"center"),this.la(a));this.J=a.x-this.ga/2;this.K=a.y-this.ea/2}},centerX:{configurable:!0,get:function(){return this.J+this.ga/2},set:function(a){G&&(D(a,M,"centerX"),this.la(a));this.J=a-this.ga/2}},centerY:{configurable:!0,get:function(){return this.K+this.ea/2},set:function(a){G&&(D(a,M,"centerY"),this.la(a));this.K=a-this.ea/2}}});M.prototype.isEmpty=M.prototype.Xz; M.prototype.isReal=M.prototype.u;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){G&&(D(a,M,"intersectsLineSegment:x"),D(b,M,"intersectsLineSegment:y"),D(c,M,"intersectsLineSegment:w"),D(d,M,"intersectsLineSegment:h"),D(e,M,"intersectsLineSegment:p1x"),D(f,M,"intersectsLineSegment:p1y"),D(g,M,"intersectsLineSegment:p2x"),D(h,M,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return L.Px(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.Ii; M.prototype.union=M.prototype.Rv;M.prototype.unionRect=M.prototype.ed;M.prototype.unionPoint=M.prototype.gf;M.prototype.intersects=M.prototype.fv;M.prototype.intersectsRect=M.prototype.Zc;M.prototype.intersect=M.prototype.ev;M.prototype.intersectRect=M.prototype.Ox;M.prototype.grow=M.prototype.Sz;M.prototype.subtractMargin=M.prototype.Mv;M.prototype.addMargin=M.prototype.Ko;M.prototype.inflate=M.prototype.Ec;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains; M.prototype.containsRect=M.prototype.Ze;M.prototype.containsPoint=M.prototype.ha;M.prototype.equalsApprox=M.prototype.gb;M.prototype.equalTo=M.prototype.ri;M.prototype.equals=M.prototype.D;M.prototype.setSize=M.prototype.CA;M.prototype.setPoint=M.prototype.dd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Ag;var oc=null,pc=null,nc=[];M.className="Rect";M.parse=bc;M.stringify=cc;M.contains=lc;M.intersects=mc;M.ZeroRect=oc=(new M(0,0,0,0)).na();M.NoRect=pc=(new M(NaN,NaN,NaN,NaN)).na(); M.parse=bc;M.stringify=cc;M.contains=lc;M.intersects=mc;function fc(a,b,c,d){void 0===a?this.Me=this.Be=this.We=this.Xe=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(this.top=a,this.right=b,this.bottom=a,this.left=b):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):v("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}fc.prototype.assign=function(a){this.Xe=a.Xe;this.We=a.We;this.Be=a.Be;this.Me=a.Me;return this}; fc.prototype.Ag=function(a,b,c,d){G&&(B(a,"number",fc,"setTo:t"),B(b,"number",fc,"setTo:r"),B(c,"number",fc,"setTo:b"),B(d,"number",fc,"setTo:l"),this.la());this.Xe=a;this.We=b;this.Be=c;this.Me=d;return this};fc.prototype.set=function(a){G&&(x(a,fc,fc,"assign:m"),this.la());this.Xe=a.Xe;this.We=a.We;this.Be=a.Be;this.Me=a.Me;return this};fc.prototype.copy=function(){var a=new fc;a.Xe=this.Xe;a.We=this.We;a.Be=this.Be;a.Me=this.Me;return a};t=fc.prototype; t.na=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function qc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new fc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new fc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new fc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new fc(c,e):new fc(c,e,f,g)}return new fc} function rc(a){G&&x(a,fc);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.D=function(a){return a instanceof fc?this.Xe===a.top&&this.We===a.right&&this.Be===a.bottom&&this.Me===a.left:!1};t.ri=function(a,b,c,d){return this.Xe===a&&this.We===b&&this.Be===c&&this.Me===d}; t.gb=function(a){return L.C(this.Xe,a.top)&&L.C(this.We,a.right)&&L.C(this.Be,a.bottom)&&L.C(this.Me,a.left)};t.u=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};fc.alloc=function(){var a=sc.pop();return void 0===a?new fc:a};fc.free=function(a){sc.push(a)}; oa.Object.defineProperties(fc.prototype,{top:{configurable:!0,get:function(){return this.Xe},set:function(a){G&&(D(a,fc,"top"),this.la(a));this.Xe=a}},right:{configurable:!0,get:function(){return this.We},set:function(a){G&&(D(a,fc,"right"),this.la(a));this.We=a}},bottom:{configurable:!0,get:function(){return this.Be},set:function(a){G&&(D(a,fc,"bottom"),this.la(a));this.Be=a}},left:{configurable:!0,get:function(){return this.Me},set:function(a){G&& (D(a,fc,"left"),this.la(a));this.Me=a}}});fc.prototype.isReal=fc.prototype.u;fc.prototype.equalsApprox=fc.prototype.gb;fc.prototype.equalTo=fc.prototype.ri;fc.prototype.equals=fc.prototype.D;fc.prototype.set=fc.prototype.set;fc.prototype.setTo=fc.prototype.Ag;var tc=null,yc=null,sc=[];fc.className="Margin";fc.parse=qc;fc.stringify=rc;fc.ZeroMargin=tc=(new fc(0,0,0,0)).na();fc.TwoMargin=yc=(new fc(2,2,2,2)).na();fc.parse=qc;fc.stringify=rc; function Hb(a,b,c,d){void 0===a?this.pe=this.oe=this.K=this.J=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this._isFrozen=!1}var zc,Ac,Bc,Gc,Hc,Ic,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c,ad,bd,cd,gd,hd,id,jd,kd,ld,md,nd,od,rd,sd;Hb.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.oe=a.oe;this.pe=a.pe;return this}; Hb.prototype.Ag=function(a,b,c,d){G&&(td(a,"setTo:x"),td(b,"setTo:y"),ud(c,"setTo:offx"),ud(d,"setTo:offy"),this.la());this.J=a;this.K=b;this.oe=c;this.pe=d;return this};Hb.prototype.set=function(a){G&&(x(a,Hb,Hb,"set:s"),this.la());this.J=a.J;this.K=a.K;this.oe=a.oe;this.pe=a.pe;return this};Hb.prototype.copy=function(){var a=new Hb;a.J=this.J;a.K=this.K;a.oe=this.oe;a.pe=this.pe;return a};t=Hb.prototype;t.na=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.la=function(a){if(G&&this._isFrozen){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function vd(a,b){a.J=NaN;a.K=NaN;a.oe=b;return a} function td(a,b){(isNaN(a)||1a)&&Ba(a,"0 <= "+b+" <= 1",Hb,b)}function ud(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&Ba(a,"real number, not NaN or Infinity",Hb,b)} function wd(a){if("string"===typeof a){a=a.trim();if("None"===a)return zc;if("TopLeft"===a)return Ac;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Bc;if("TopRight"===a)return Gc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Hc;if("Center"===a)return Ic;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Kc;if("BottomLeft"===a)return Lc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Mc;if("BottomRight"===a)return Nc;if("TopSide"===a)return Oc;if("LeftSide"=== a)return Pc;if("RightSide"===a)return Qc;if("BottomSide"===a)return Sc;if("TopBottomSides"===a)return Tc;if("LeftRightSides"===a)return Uc;if("TopLeftSides"===a)return Vc;if("TopRightSides"===a)return Wc;if("BottomLeftSides"===a)return Xc;if("BottomRightSides"===a)return Yc;if("NotTopSide"===a)return Zc;if("NotLeftSide"===a)return $c;if("NotRightSide"===a)return ad;if("NotBottomSide"===a)return bd;if("AllSides"===a)return cd;if("Default"===a)return gd;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++; var d=a[b++];void 0!==d&&0a&&(a+=360);if(0===a)return this;this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.m12*a+this.m22*d,f=this.m11*-d+this.m21*a,g=this.m12*-d+this.m22*a;this.m11=this.m11*a+this.m21*d;this.m12=e;this.m21=f;this.m22=g;this.translate(-b,-c);return this};t=Ib.prototype;t.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this}; t.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.Ma=function(a){var b=a.x,c=a.y;return a.h(b*this.m11+c*this.m21+this.dx,b*this.m12+c*this.m22+this.dy)};t.Rd=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=a.x,d=a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.kx=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=1.25*a.x,d=1.2*a.y;return a.h(c*this.m22*b+d*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx),c*-this.m12*b+d*this.m11*b+b*(this.m12*this.dx-this.m11*this.dy))}; t.xp=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};Ib.alloc=function(){var a=zd.pop();return void 0===a?new Ib:a}; Ib.free=function(a){zd.push(a)};Ib.prototype.transformRect=Ib.prototype.xp;Ib.prototype.transformPoint=Ib.prototype.Ma;Ib.prototype.scale=Ib.prototype.scale;Ib.prototype.translate=Ib.prototype.translate;Ib.prototype.rotate=Ib.prototype.rotate;Ib.prototype.invert=Ib.prototype.bm;Ib.prototype.multiplyInverted=Ib.prototype.lv;Ib.prototype.multiply=Ib.prototype.multiply;Ib.prototype.reset=Ib.prototype.reset;Ib.prototype.isIdentity=Ib.prototype.Ds;Ib.prototype.equals=Ib.prototype.D; Ib.prototype.setTransform=Ib.prototype.setTransform;Ib.prototype.set=Ib.prototype.set;var zd=[];Ib.className="Transform";Ib.xF="54a702f3e53909c447824c6706603faf4c"; var L={JA:"7da71ca0ad381e90",Eg:(Math.sqrt(2)-1)/3*4,aw:null,sqrt:function(a){if(0>=a)return 0;var b=L.aw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);L.aw=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},C:function(a,b){a-=b;return.5>a&&-.5a&&-5E-8=e&&(e=1E-6);if(am-l)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=g&&g<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(g=(c-a)/(d-b)*(g-b)+a,g-e<=f&&f<=g+e)return!0}else return!0;return!1},hs:function(a,b,c,d,e,f,g,h,k,l,m,n){if(L.Zb(a,b,g,h,n,c,d)&&L.Zb(a,b,g,h,n,e,f))return L.Zb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var z=(d+q)/2,w=(c+u)/2;return L.hs(a, b,p,r,d,c,z,w,k,l,m,n)||L.hs(z,w,q,u,e,f,g,h,k,l,m,n)},lx:function(a,b,c,d,e,f,g,h,k){var l=(c+e)/2,m=(d+f)/2;k.h((((a+c)/2+l)/2+(l+(e+g)/2)/2)/2,(((b+d)/2+m)/2+(m+(f+h)/2)/2)/2);return k},Wy:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Mb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Ml:function(a,b,c,d,e,f,g,h,k,l){if(L.Zb(a,b,g,h,k,c,d)&&L.Zb(a,b,g,h,k,e,f))ic(l,a,b,0,0),ic(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/ 2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.Ml(a,b,m,n,d,c,q,u,k,l);L.Ml(q,u,p,r,e,f,g,h,k,l)}return l},Ye:function(a,b,c,d,e,f,g,h,k,l){if(L.Zb(a,b,g,h,k,c,d)&&L.Zb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;L.Ye(a,b,m,n,d,c,q,u,k,l);L.Ye(q,u,p,r,e,f,g,h,k,l)}return l},tv:function(a,b,c,d,e,f,g,h,k,l){if(L.Zb(a,b,e,f,l,c,d))return L.Zb(a, b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return L.tv(a,b,m,n,p,r,g,h,k,l)||L.tv(p,r,c,d,e,f,g,h,k,l)},TA:function(a,b,c,d,e,f,g){g.h(((a+c)/2+(c+e)/2)/2,((b+d)/2+(d+f)/2)/2);return g},sv:function(a,b,c,d,e,f,g,h){if(L.Zb(a,b,e,f,g,c,d))ic(h,a,b,0,0),ic(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.sv(a,b,k,l,m,n,g,h);L.sv(m,n,c,d,e,f,g,h)}return h},lp:function(a,b,c,d,e,f,g,h){if(L.Zb(a,b,e,f,g,c,d))0===h.length&&(h.push(a), h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;L.lp(a,b,k,l,m,n,g,h);L.lp(m,n,c,d,e,f,g,h)}return h},Mo:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(L.Zb(a,b,g,h,p,c,d)&&L.Zb(a,b,g,h,p,e,f)){if(!L.$l(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,z=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+z)/2;c=(u+w)/2;z=(z+e)/ 2;w=(w+f)/2;var y=(d+z)/2,A=(c+w)/2,C=Infinity,E=!1,H=0,S=0;L.Mo(a,b,q,u,d,c,y,A,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a=m)return r; if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(ba)return r}else if(aa)return r;0p&&r--}else{q=(a+c)/2;u=(b+d)/2;var z=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+z)/2;c=(u+w)/2;z=(z+e)/2;w=(w+f)/2;var y=(d+z)/2,A=(c+w)/2;r+=L.No(a,b,q,u,d,c,y,A,k,l,m,n,p);r+=L.No(y,A,z,w,e,f,g,h,k,l,m,n,p)}return r},wh:function(a,b,c,d,e,f,g){if(L.ca(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(L.ca(b,d)){aa)return g.h(a,b),!1;g.h(e,b);return!0}e=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>e)return g.h(a,b),!1;if(1.000005b)return k.h(a, b),!1;k.h(a,c);return!0}g=(d-b)/(c-a);if(L.ca(h,g))return L.wh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(L.ca(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return L.wh(a,b,c,d,e,g*(e-a)+b,k)},RA:function(a,b,c,d,e){return L.df(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},QA:function(a,b,c,d,e,f,g,h,k,l){function m(c,d){var e=(c-a)*(c-a)+(d-b)*(d-b);e(c>a?c-a:a-c)){p=1-(c-e)*(c-e)/(p*p);if(0>p)return k;p=Math.sqrt(p);d=-l*p+f;m(c,l*p+f);m(c,d)}else{c=(d-b)/(c-a);d=1/(p*p)+c*c/(l*l);h=2*c*(b-c*a)/(l*l)-2*c*f/(l*l)-2*e/(p*p);p=h*h-4*d*(2*c*a*f/(l*l)-2*b*f/(l*l)+f*f/(l*l)+e*e/(p*p)-1+(b-c*a)*(b-c*a)/(l*l));if(0>p)return k;p=Math.sqrt(p);l=(-h+p)/(2*d);m(l,c*l-c*a+b);p=(-h-p)/(2*d);m(p,c*p-c*a+b)}return k},Of:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(L.df(a,b,a, d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},As:function(a,b,c){return L.Px(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Px:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f=b):f===h?(e=a):lc(a,b,c,d,e,f)||lc(a,b,c,d,g,h)||L.$l(a,b,k,b,e,f,g,h)||L.$l(k,b,k,l,e,f,g,h)||L.$l(k,l,a,l,e,f,g,h)||L.$l(a,l,a,b,e,f,g,h)?!0:!1},$l:function(a,b,c,d,e,f,g,h){return a===c&&b===d&&e===g&&f===h?a===e&&b===f:0>=L.Pl(a,b,c,d,e,f)*L.Pl(a,b,c,d,g,h)&&0>=L.Pl(e,f,g,h,a,b)*L.Pl(e,f,g,h,c,d)},Pl:function(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0f&&(f=0)));return f},jp:function(a){0>a&& (a+=360);360<=a&&(a-=360);return a},tx:function(a,b,c,d,e,f){var g=Math.PI;f||(d*=g/180,e*=g/180);var h=d>e?-1:1;f=[];var k=g/2,l=d;d=Math.min(2*g,Math.abs(e-d));if(1E-5>d)return k=l+h*Math.min(d,k),h=a+c*Math.cos(l),l=b+c*Math.sin(l),a+=c*Math.cos(k),b+=c*Math.sin(k),c=(h+a)/2,k=(l+b)/2,f.push([h,l,c,k,c,k,a,b]),f;for(;1E-5c,f=0>d;if(al;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=m*m+n*n-1;if(0m)k=b;else break}c=e*c/(b+e)-c;d=f*d/(b+f)-d;c=Math.sqrt(c*c+d*d)}else c=Math.abs(d-b);else d=a*a-b*b,f=a*c,fa?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case N.v:var b=new M(this.startX,this.startY,0,0);b.Rv(this.endX,this.endY,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+ b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case N.G:b=new M(this.startX,this.startY,0,0);b.Rv(this.endX,this.endY,0,0);if(0>a)return a=b.left.toString()+" "+(b.y+b.height/2).toString(),"M"+a+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+(b.right.toString()+" "+(b.y+b.height/2).toString())+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+a;var c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+ c+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+(b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a))+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case N.m:b="";c=this.figures.s;for(var d=c.length,e=0;e=C-1?!0:null!==l[u+1].match(E)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());z===z.toLowerCase()&&(b=A.x+b,c=A.y+c);a.h(b,c)}function f(){e(A);return A}function g(){e(y);return y}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?A:new K(2*A.x-y.x,2*A.y-y.y)}void 0===b&&(b=!1);"string"!==typeof a&&Aa(a,"string",N,"parse:str");var k=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm; a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2");a=a.replace(k,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2");a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");var l=a.split(" ");for(a=0;a=C-1);)if(w=z,z=d(),""!==z)switch(z.toUpperCase()){case "X":r=!0;n=m=!1;break;case "M":q=f();null===a.oc||!0===r?(Jd(a,q.x,q.y,m,!n,p),r=!1):a.moveTo(q.x,q.y);for(k.assign(A);!c();)q=f(),a.lineTo(q.x,q.y);break;case "L":for(;!c();)q=f(),a.lineTo(q.x,q.y);break;case "H":for(;!c();)A= new K((z===z.toLowerCase()?A.x:0)+parseFloat(d()),A.y),a.lineTo(A.x,A.y);break;case "V":for(;!c();)A=new K(A.x,(z===z.toLowerCase()?A.y:0)+parseFloat(d())),a.lineTo(A.x,A.y);break;case "C":for(;!c();){q=new K;e(q);var H=g(),S=f();Kd(a,q.x,q.y,H.x,H.y,S.x,S.y)}break;case "S":for(;!c();)q=h(),H=g(),S=f(),Kd(a,q.x,q.y,H.x,H.y,S.x,S.y);break;case "Q":for(;!c();)q=g(),H=f(),Ld(a,q.x,q.y,H.x,H.y);break;case "T":for(;!c();)y=q=h(),H=f(),Ld(a,q.x,q.y,H.x,H.y);break;case "B":for(;!c();){q=parseFloat(d()); H=parseFloat(d());S=parseFloat(d());var aa=parseFloat(d()),Z=parseFloat(d()),R=Z,O=!1;c()||(R=parseFloat(d()),c()||(O=0!==parseFloat(d())));z===z.toLowerCase()&&(S+=A.x,aa+=A.y);a.arcTo(q,H,S,aa,Z,R,O)}break;case "A":for(;!c();)q=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),S=parseFloat(d()),Z=aa=!1,O=R=0,R=d(),1===R.length?(aa=!!parseFloat(R),Z=!!parseFloat(d()),R=parseFloat(d())):2===R.length?(aa=!!parseFloat(R[0]),Z=!!parseFloat(R[1]),R=parseFloat(d())):(aa=!!parseFloat(R[0]),Z=!!parseFloat(R[1]), R=parseFloat(R.slice(2))),O=parseFloat(d()),z===z.toLowerCase()&&(R=A.x+R,O=A.y+O),A.h(R,O),Md(a,q,H,S,aa,Z,R,O);break;case "Z":Nd(a);A.assign(k);break;case "F":q="";for(H=1;l[u+H];)if("0"===l[u+H])p=!0,H++;else if(null!==l[u+H].match(/[Uu]/))H++;else if(null===l[u+H].match(E))H++;else{q=l[u+H];break}q.match(/[Mm]/)?m=!0:0g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle); 0>d&&(q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case Zd:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c); q.radiusY*=Math.sqrt(b*b+d*d);break;default:v("Unknown Segment type: "+q.type)}}}}this._isInvalidBounds=!0;return this}; t.ha=function(a,b){void 0===b&&(b=0);var c=this.md,d=this.nd,e=this.Gc,f=this.Hc;switch(this.type){case N.j:return L.Zb(c,d,e,f,b,a.x,a.y);case N.v:var g=M.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.ha(a);M.free(g);return a;case N.G:g=Math.min(c,e)-b;var h=Math.min(d,f)-b;c=(Math.abs(e-c)+2*b)/2;b=(Math.abs(f-d)+2*b)/2;if(0>=c||0>=b)return!1;g=a.x-(g+c);h=a.y-(h+b);return 1>=g*g/(c*c)+h*h/(b*b);case N.m:return be(this,a,b,!0,!1);default:return!1}}; function be(a,b,c,d,e){var f=b.x;b=b.y;for(var g=a.bounds.x-20,h=0,k,l,m,n,p=a.figures.s,r=p.length,q=0;q=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(fh)return 0}else{if(bf)return 0}else if(eg)return 0}else if(le)return 0;return 0a?a=0:1=f)return d=f-g,d=0===m?0:d/m,c=c[h],h=c[2*a],e=c[2*a+1],b.h(h+(c[2*a+2]-h)*d,e+(c[2*a+3]-e)*d),b;g+=m}}return b}; t.Gx=function(a){0>a?a=0:1=e)return e=b[g],b=e[2*a],c=e[2*a+1],d=e[2*a+2],a=e[2*a+3],1>Math.abs(d-b)&&1>Math.abs(a-c)?0:1>Math.abs(d-b)?0<=a-c?90:270:1>Math.abs(a-c)?0<=d-b?0:180:180*Math.atan2(a-c,d-b)/Math.PI;f+=l}}return NaN}; t.av=function(a,b){0>a?a=0:1=f)return d=f-g,d=0===m?0:d/m,m=c[h],c=m[2*a],h=m[2*a+1],e=m[2*a+2],a=m[2* a+3],b[0]=c+(e-c)*d,b[1]=h+(a-h)*d,b[2]=1>Math.abs(e-c)&&1>Math.abs(a-h)?0:1>Math.abs(e-c)?0<=a-h?90:270:1>Math.abs(a-h)?0<=e-c?0:180:180*Math.atan2(a-h,e-c)/Math.PI,b;g+=m}}return b}; t.Hx=function(a){if(this.type===N.j){var b=this.startX,c=this.startY,d=this.endX,e=this.endY;if(b!==d||c!==e){var f=a.x;a=a.y;if(b===d){if(c=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=K.alloc();L.wh(b,c,d,e,f,a,h);a=h.x;f=h.y;K.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===N.v){g=this.startX;h=this.startY;var k=this.endX; e=this.endY;if(g!==k||h!==e){b=k-g;c=e-h;f=2*b+2*c;d=a.x;a=a.y;d=Math.min(Math.max(d,g),k);a=Math.min(Math.max(a,h),e);g=Math.abs(d-g);k=Math.abs(d-k);h=Math.abs(a-h);e=Math.abs(a-e);var l=Math.min(g,k,h,e);if(l===h)return d/f;if(l===k)return(b+a)/f;if(l===e)return(2*b+c-d)/f;if(l===g)return(2*b+2*c-a)/f}}else{b=this.flattenedSegments;c=this.flattenedLengths;f=this.flattenedTotalLength;d=K.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;na?0:1a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.s,d=c.length,e=0;ea&&(a+=360),this.Ue=a,this.ci=0,G&&D(d,je,"x1"),this.di=Math.max(d,0),G&&D(e,je,"y1"),this.Vg=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc= !0)):(G&&D(d,je,"x1"),this.Ue=d,G&&D(e,je,"y1"),this.ci=e,G&&D(f,je,"x2"),a===Td&&(f=Math.max(f,0)),this.di=f,"number"===typeof g?(a===Td&&(g=Math.max(g,0)),this.Vg=g):this.Vg=0);this.ce=null}je.prototype.copy=function(){var a=new je;a.ta=this.ta;a.o=this.o&-2;a.Gc=this.Gc;a.Hc=this.Hc;a.Ue=this.Ue;a.ci=this.ci;a.di=this.di;a.Vg=this.Vg;return a};t=je.prototype; t.gb=function(a){if(!(a instanceof je)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Qd:case Cd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY);case Rd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y)&&L.C(this.point2X,a.point2X)&&L.C(this.point2Y,a.point2Y);case Sd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y);case Td:return L.C(this.startAngle, a.startAngle)&&L.C(this.sweepAngle,a.sweepAngle)&&L.C(this.centerX,a.centerX)&&L.C(this.centerY,a.centerY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);case Zd:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&L.C(this.xAxisRotation,a.xAxisRotation)&&L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);default:return!1}};t.xb=function(a){a.classType===je?this.type=a:Ea(this,a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Qd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Cd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Rd:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+ " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Sd:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Td:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+ " "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case Zd:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+ " "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; function $d(a,b){if(null!==a.ce&&!1===b._isInvalidBounds)return a.ce;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ce=[],a.ce;b=a.Ue;var e=a.ci,f=L.tx(0,0,c=r?g=Math.PI:1<=r&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=L.tx(0,0,b>f?b:f,m,m+g,!0);f=Ib.alloc();f.reset();f.translate(c,d);f.rotate(a.Ue,0,0);f.scale(k,r);N.Na(b,f); Ib.free(f);a.ce=b;return a.ce} oa.Object.defineProperties(je.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.o&1)},set:function(a){this.o=a?this.o|1:this.o&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.o&2)},set:function(a){this.o=a?this.o|2:this.o&-3}},isClosed:{configurable:!0,get:function(){return 0!==(this.o&8)},set:function(a){this.isClosed!==a&&(this.o=a?this.o|8:this.o&-9,this._isInvalidBounds=!0)}},type:{configurable:!0, get:function(){return this.ta},set:function(a){G&&$a(a,je,je,"type");this._isFrozen&&xa(this,a);this.ta=a;this._isInvalidBounds=!0}},endX:{configurable:!0,get:function(){return this.Gc},set:function(a){G&&D(a,je,"endX");this._isFrozen&&xa(this,a);this.Gc=a;this._isInvalidBounds=!0}},endY:{configurable:!0,get:function(){return this.Hc},set:function(a){G&&D(a,je,"endY");this._isFrozen&&xa(this,a);this.Hc=a;this._isInvalidBounds=!0}},point1X:{configurable:!0, get:function(){return this.Ue},set:function(a){G&&D(a,je,"point1X");this._isFrozen&&xa(this,a);this.Ue=a;this._isInvalidBounds=!0}},point1Y:{configurable:!0,get:function(){return this.ci},set:function(a){G&&D(a,je,"point1Y");this._isFrozen&&xa(this,a);this.ci=a;this._isInvalidBounds=!0}},point2X:{configurable:!0,get:function(){return this.di},set:function(a){G&&D(a,je,"point2X");this._isFrozen&&xa(this,a);this.di=a;this._isInvalidBounds=!0}},point2Y:{configurable:!0, get:function(){return this.Vg},set:function(a){G&&D(a,je,"point2Y");this._isFrozen&&xa(this,a);this.Vg=a;this._isInvalidBounds=!0}},centerX:{configurable:!0,get:function(){return this.Ue},set:function(a){G&&D(a,je,"centerX");this._isFrozen&&xa(this,a);this.Ue=a;this._isInvalidBounds=!0}},centerY:{configurable:!0,get:function(){return this.ci},set:function(a){G&&D(a,je,"centerY");this._isFrozen&&xa(this,a);this.ci=a;this._isInvalidBounds=!0}},radiusX:{configurable:!0, get:function(){return this.di},set:function(a){G&&D(a,je,"radiusX");0>a&&Ba(a,">= zero",je,"radiusX");this._isFrozen&&xa(this,a);this.di=a;this._isInvalidBounds=!0}},radiusY:{configurable:!0,get:function(){return this.Vg},set:function(a){G&&D(a,je,"radiusY");0>a&&Ba(a,">= zero",je,"radiusY");this._isFrozen&&xa(this,a);this.Vg=a;this._isInvalidBounds=!0}},startAngle:{configurable:!0,get:function(){return this.Gc},set:function(a){G&&D(a,je,"startAngle");this._isFrozen&&xa(this, a);a%=360;0>a&&(a+=360);this.Gc=a;this._isInvalidBounds=!0}},sweepAngle:{configurable:!0,get:function(){return this.Hc},set:function(a){G&&D(a,je,"sweepAngle");this._isFrozen&&xa(this,a);360a&&(a=-360);this.Hc=a;this._isInvalidBounds=!0}},isClockwiseArc:{configurable:!0,get:function(){return 0!==(this.o&4)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|4:this.o&-5;this._isInvalidBounds=!0}},isLargeArc:{configurable:!0,get:function(){return 0!== (this.o&16)},set:function(a){this._isFrozen&&xa(this,a);this.o=a?this.o|16:this.o&-17;this._isInvalidBounds=!0}},xAxisRotation:{configurable:!0,get:function(){return this.Ue},set:function(a){G&&D(a,je,"xAxisRotation");this._isFrozen&&xa(this,a);a%=360;0>a&&(a+=360);this.Ue=a;this._isInvalidBounds=!0}}});je.prototype.equalsApprox=je.prototype.gb; var Qd=new F(je,"Move",0),Cd=new F(je,"Line",1),Rd=new F(je,"Bezier",2),Sd=new F(je,"QuadraticBezier",3),Td=new F(je,"Arc",4),Zd=new F(je,"SvgArc",4);je.className="PathSegment";je.Move=Qd;je.Line=Cd;je.Bezier=Rd;je.QuadraticBezier=Sd;je.Arc=Td;je.SvgArc=Zd;function le(){this.H=null;this.Fu=(new K(0,0)).freeze();this.rt=(new K(0,0)).freeze();this.Ip=this.Xq=0;this.Jp=1;this.Dq="";this.bs=this.$p=!1;this.Yp=this.Lp=0;this.Fg=this.tq=this.zq=!1;this.fq=null;this.Wr=0;this.xd=this.Sr=null} le.prototype.copy=function(){var a=new le;return this.clone(a)};le.prototype.clone=function(a){a.H=this.H;a.Fu.assign(this.viewPoint);a.rt.assign(this.documentPoint);a.Xq=this.Xq;a.Ip=this.Ip;a.Jp=this.Jp;a.Dq=this.Dq;a.$p=this.$p;a.bs=this.bs;a.Lp=this.Lp;a.Yp=this.Yp;a.zq=this.zq;a.tq=this.tq;a.Fg=this.Fg;a.fq=this.fq;a.Wr=this.Wr;a.Sr=this.Sr;a.xd=this.xd;return a}; le.prototype.toString=function(){var a="^";0!==this.modifiers&&(a+="M:"+this.modifiers);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.clickCount&&(a+="C:"+this.clickCount);0!==this.delta&&(a+="D:"+this.delta);this.handled&&(a+="h");this.bubbles&&(a+="b");null!==this.documentPoint&&(a+="@"+this.documentPoint.toString());return a};le.prototype.Yo=function(a,b){var c=this.diagram;if(null===c)return b;me(c,a,b);return b}; le.prototype.Mz=function(a,b){var c=this.diagram;if(null===c)return b;me(c,a,b);b.assign(c.Vs(b));return b}; oa.Object.defineProperties(le.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{configurable:!0,get:function(){return this.Fu},set:function(a){x(a,K,le,"viewPoint");this.Fu.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.rt},set:function(a){x(a,K,le,"documentPoint");this.rt.assign(a)}},modifiers:{configurable:!0,get:function(){return this.Xq},set:function(a){this.Xq= a}},button:{configurable:!0,get:function(){return this.Ip},set:function(a){this.Ip=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{configurable:!0,get:function(){return this.Jp},set:function(a){this.Jp=a}},key:{configurable:!0,get:function(){return this.Dq},set:function(a){this.Dq=a}},down:{configurable:!0,get:function(){return this.$p},set:function(a){this.$p=a}},up:{configurable:!0, enumerable:!0,get:function(){return this.bs},set:function(a){this.bs=a}},clickCount:{configurable:!0,get:function(){return this.Lp},set:function(a){this.Lp=a}},delta:{configurable:!0,get:function(){return this.Yp},set:function(a){this.Yp=a}},isMultiTouch:{configurable:!0,get:function(){return this.zq},set:function(a){this.zq=a}},handled:{configurable:!0,get:function(){return this.tq},set:function(a){this.tq=a}},bubbles:{configurable:!0, get:function(){return this.Fg},set:function(a){this.Fg=a}},event:{configurable:!0,get:function(){return this.fq},set:function(a){this.fq=a}},isTouchEvent:{configurable:!0,get:function(){var a=this.event;return null===a?!1:"touch"===a.pointerType||"pen"===a.pointerType}},timestamp:{configurable:!0,get:function(){return this.Wr},set:function(a){this.Wr=a}},targetDiagram:{configurable:!0,get:function(){return this.Sr},set:function(a){this.Sr=a}}, targetObject:{configurable:!0,get:function(){return this.xd},set:function(a){this.xd=a}},control:{configurable:!0,get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{configurable:!0,get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{configurable:!0,get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers= a?this.modifiers|2:this.modifiers&-3}},meta:{configurable:!0,get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{configurable:!0,get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&1):0===this.button},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{configurable:!0, get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&2):2===this.button},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{configurable:!0,get:function(){var a=this.event;return null===a||"mousedown"!==a.type&&"mouseup"!==a.type&&"pointerdown"!==a.type&&"pointerup"!==a.type?0!==(this.buttons&4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons& -5}}});le.prototype.getMultiTouchDocumentPoint=le.prototype.Mz;le.prototype.getMultiTouchViewPoint=le.prototype.Yo;le.className="InputEvent";function ne(){this.H=null;this.Da="";this.gr=this.Qr=null}ne.prototype.copy=function(){var a=new ne;a.H=this.H;a.Da=this.Da;a.Qr=this.Qr;a.gr=this.gr;return a};ne.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; oa.Object.defineProperties(ne.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},name:{configurable:!0,get:function(){return this.Da},set:function(a){this.Da=a}},subject:{configurable:!0,get:function(){return this.Qr},set:function(a){this.Qr=a}},parameter:{configurable:!0,get:function(){return this.gr},set:function(a){this.gr=a}}});ne.className="DiagramEvent"; function oe(){this.Pm=pe;this.zf=this.Wq="";this.Tn=this.Un=this.Zn=this.$n=this.Yn=this.H=this.ec=null}oe.prototype.clear=function(){this.Tn=this.Un=this.Zn=this.$n=this.Yn=this.H=this.ec=null}; oe.prototype.copy=function(){var a=new oe;a.Pm=this.Pm;a.Wq=this.Wq;a.zf=this.zf;a.ec=this.ec;a.H=this.H;a.Yn=this.Yn;var b=this.$n;a.$n=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Zn;a.Zn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Un;a.Un=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Tn;a.Tn=Ga(b)&&"function"===typeof b.M?b.M():b;return a};oe.prototype.xb=function(a){a.classType===oe?this.change=a:Ea(this,a)}; oe.prototype.toString=function(){var a="";a=this.change===qe?a+"* ":this.change===pe?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===qe?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ra(this.object)),null!==this.oldValue&&(a+=" old: "+Ra(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ra(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};oe.prototype.L=function(a){return a?this.oldValue:this.newValue};oe.prototype.Oz=function(a){return a?this.oldParam:this.newParam};oe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; oe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};oe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};oe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; oa.Object.defineProperties(oe.prototype,{model:{configurable:!0,get:function(){return this.ec},set:function(a){this.ec=a}},diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},change:{configurable:!0,get:function(){return this.Pm},set:function(a){G&&$a(a,oe,oe,"change");this.Pm=a}},modelChange:{configurable:!0,get:function(){return this.Wq},set:function(a){G&&B(a,"string",oe,"modelChange");this.Wq=a}},propertyName:{configurable:!0, enumerable:!0,get:function(){return this.zf},set:function(a){G&&"string"!==typeof a&&B(a,"function",oe,"propertyName");this.zf=a}},isTransactionFinished:{configurable:!0,get:function(){return this.Pm===qe&&("CommittedTransaction"===this.zf||"FinishedUndo"===this.zf||"FinishedRedo"===this.zf)}},object:{configurable:!0,get:function(){return this.Yn},set:function(a){this.Yn=a}},oldValue:{configurable:!0,get:function(){return this.$n},set:function(a){this.$n= a}},oldParam:{configurable:!0,get:function(){return this.Zn},set:function(a){this.Zn=a}},newValue:{configurable:!0,get:function(){return this.Un},set:function(a){this.Un=a}},newParam:{configurable:!0,get:function(){return this.Tn},set:function(a){this.Tn=a}}});oe.prototype.redo=oe.prototype.redo;oe.prototype.canRedo=oe.prototype.canRedo;oe.prototype.undo=oe.prototype.undo;oe.prototype.canUndo=oe.prototype.canUndo;oe.prototype.getParam=oe.prototype.Oz; oe.prototype.getValue=oe.prototype.L;oe.prototype.clear=oe.prototype.clear;var qe=new F(oe,"Transaction",-1),pe=new F(oe,"Property",0),re=new F(oe,"Insert",1),se=new F(oe,"Remove",2);oe.className="ChangedEvent";oe.Transaction=qe;oe.Property=pe;oe.Insert=re;oe.Remove=se;function te(){this.m=(new I).freeze();this.Da="";this.j=!1} te.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.cd(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; oa.Object.defineProperties(te.prototype,{changes:{configurable:!0,get:function(){return this.m}},name:{configurable:!0,get:function(){return this.Da},set:function(a){this.Da=a}},isComplete:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}}});te.prototype.optimize=te.prototype.jk;te.prototype.redo=te.prototype.redo;te.prototype.canRedo=te.prototype.canRedo;te.prototype.undo=te.prototype.undo;te.prototype.canUndo=te.prototype.canUndo; te.prototype.clear=te.prototype.clear;te.className="Transaction";function ue(){this.Xt=new J;this.Gd=!1;this.v=(new I).freeze();this.Ie=-1;this.m=999;this.Le=!1;this.Up=null;this.ki=0;this.j=!1;G&&(this.j=!0);this.Pe=(new I).freeze();this.pl=new I;this.zt=!0;this.Jt=this.xq=this.Mt=this.Lt=!1} ue.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;da.transactionLevel&&Fa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Qb("CommittingTransaction",c,e));var f=0;if(0a.historyIndex;d--)f=b.O(d),null!==f&&f.clear(),b.tb(d),a.xq=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.O(0),null!==f&&f.clear(),b.tb(0),a.Ie--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Ie++);b.freeze()}a.isInternalTransaction||a.Qb("CommittedTransaction",c,e)}else{a.Le=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction|| a.Qb("RolledBackTransaction",c,e),a.Le=!1}null!==e&&e.clear()}a.Up=null;a.isPendingClear&&a.clear();a.isPendingClear=!1;a.isPendingUnmodified=!1;return!0}if(a.isEnabled&&!b&&null!==e){a=f;c=e.changes;for(e=c.count-1;e>=a;e--)b=c.O(e),null!==b&&b.undo(),c.qa(),c.tb(e);c.freeze()}return!1}ue.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.zt&&(a=a.diagram,null!==a&&!1===a.Ai||Fa("Change not within a transaction: "+c.toString()))}}; ue.prototype.skipsEvent=function(a){if(null===a||0>a.change.value)return!0;a=a.object;if(null===a)return!1;if(void 0!==a.layer){if(a=a.layer,null!==a&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1}; oa.Object.defineProperties(ue.prototype,{models:{configurable:!0,get:function(){return this.Xt.iterator}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){this.Gd=a}},transactionToUndo:{configurable:!0,get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.O(this.historyIndex):null}},transactionToRedo:{configurable:!0,get:function(){return this.historyIndexe||Math.abs(b.y-a.y)>d}; oa.Object.defineProperties(we.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){a instanceof Q&&(this.H=a)}},name:{configurable:!0,get:function(){return this.Da},set:function(a){B(a,"string",we,"name");this.Da=a}},isEnabled:{configurable:!0,get:function(){return this.Gd},set:function(a){B(a,"boolean",we,"isEnabled");this.Gd=a}},isActive:{configurable:!0,get:function(){return this.ub},set:function(a){B(a,"boolean", we,"isActive");this.ub=a}},transactionResult:{configurable:!0,get:function(){return this.Gm},set:function(a){null!==a&&B(a,"string",we,"transactionResult");this.Gm=a}}});we.prototype.startTransaction=we.prototype.Ka;we.className="Tool";function Ua(){we.call(this);this.name="ToolManager";this.ob=new I;this.vb=new I;this.Kb=new I;this.G=this.Z=850;this.m=(new Gb(2,2)).na();this.Na=5E3;this.ma=Ae;this.v=Ce;this.Tp=this.j=null;this.Kj=-1}na(Ua,we);Ua.prototype.initializeStandardTools=function(){}; Ua.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Be&&this.Tp===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Ua.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===De&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Je){b.bubbles=!0;return}if(this.gestureBehavior===De)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;G&&c.checksTransactionLevel&&0!==c.transactionLevel&&Fa("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");c=this.mouseDownTools.length; for(var d=0;de.right&&(c.x-=d.width+5/b.scale);c.xe.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.yc.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Ve;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Gf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Gf(a,c.i(c.pointsCount-1),!0),null!==h&&(k=h.part));e.isValidLink(g,f,k,h)?b?(c.defaultFromPoint=c.i(0),c.defaultToPoint=c.i(c.pointsCount-1),c.suspendsRouting=!1,c.fromNode=g,null!==f&&(c.fromPortId=f.portId),c.toNode=k,null!==h&&(c.toPortId=h.portId),c.fromPort!== d.Yx&&d.U("LinkRelinked",c,d.Yx),c.toPort!==d.Zx&&d.U("LinkRelinked",c,d.Zx)):Hf(e,g,f,k,h):Hf(e,null,null,null,null)}}}}Ne.prototype.doDragOver=function(){}; function If(a,b){var c=a.diagram;a.dragsLink&&uf(a,!0);Xe(a);var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;if(null!==d){e.handled=!1;for(var f=d;null!==f;){var g=f.mouseDrop;if(null!==g&&(g(e,f),e.handled))break;Jf(a,e,f);f=Ff(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Qe){for(e=(a.copiedParts||a.draggedParts).iterator;e.next();)f=e.key,f instanceof V&&f.linksConnected.each(function(a){a.suspendsRouting=!1});a.doDropOnto(b,d);if(a.isActive||null!==Qe){a=M.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&Kf(c,d,a);M.free(a)}}}function Jf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof Df||(c=a.mouseDrop,null!==c&&c(b))}function Kf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Ze(c)&&(d=!0);a=a.Yu(c,function(a){return a.part},function(a){return a instanceof T},!0,function(a){return a instanceof T},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Sd(b)&&c.isAvoiding&&c.hb()} Ne.prototype.doDropOnto=function(){};Ne.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;this.simulatedMouseMove(b.event,b.documentPoint,b.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(pf(this,!1),Te(a,this.copiedParts),rf(this,this.copiedParts,!1),hf(a,this.copiedParts)):this.mayMove()?(kf(this),rf(this,this.draggedParts,!0)):this.mayDragOut()?(pf(this,!1),rf(this,this.copiedParts,!1)):kf(this),tf(this,a.lastInput.documentPoint))}}; Ne.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(kf(this),pf(this,!0),Te(a,this.copiedParts),rf(this,this.copiedParts,!1),hf(a,this.copiedParts),null!==this.copiedParts&&(a.U("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,kf(this),this.mayMove()&&(rf(this,this.draggedParts, !0),tf(this,a.lastInput.documentPoint)));this.hn=!0;If(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Uf():this.draggedParts.Uf();this.copiedParts=null;b&&Lf(this);a.cb();hf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.U(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.U("ChangedSelection",a.selection)}}}; Ne.prototype.simulatedMouseMove=function(a,b,c){if(null===Qe)return!1;var d=Qe.diagram;c instanceof Q||(c=null);var e=Ue;c!==e&&(null!==e&&e!==d&&(e.Cg(),Qe.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Ue=c,null!==c&&c!==d&&(nf(),e=c.toolManager.findTool("Dragging"),null!==e&&(Pe.contains(e)||Pe.add(e),e.doSimulatedDragEnter())),this.doUpdateCursor(null));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging"); null!==d&&(null!==a&&(void 0!==a.targetTouches&&(0g&&(g=l),m>h&&(h=m))}}Infinity===d?f.h(0,0,0,0):f.h(d,e,g-d,h-e);d=f.x+f.width/2;e=f.y+f.height/2;M.free(f); f=a.Kr;g=new xb;h=K.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof T&&l.canCopy()&&(m=c.L(l),null!==m&&(m.points=l.points,qf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Nd())));for(b=b.iterator;b.next();)l=b.value,l.$c()&&l.canCopy()&&(k=c.L(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.$a(),g.add(k,a.Nd(h))));K.free(h);a.copiedParts=g;Re(a,g.Uf());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,qf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ 2)));a.doUpdateCursor(null)}}}Ne.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ts=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.Jn=null};Ne.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new K}; oa.Object.defineProperties(Ne.prototype,{isCopyEnabled:{configurable:!0,get:function(){return this.vb},set:function(a){B(a,"boolean",Ne,"isCopyEnabled");this.vb=a}},copiesEffectiveCollection:{configurable:!0,get:function(){return this.v},set:function(a){B(a,"boolean",Ne,"copiesEffectiveCollection");this.v=a}},dragOptions:{configurable:!0,get:function(){return this.ma},set:function(a){x(a,Oe,Ne,"dragOptions");this.ma=a}},isGridSnapEnabled:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){B(a,"boolean",Ne,"isGridSnapEnabled");this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{configurable:!0,get:function(){return this.ob},set:function(a){B(a,"boolean",Ne,"isComplexRoutingRealtime");this.ob=a}},isGridSnapRealtime:{configurable:!0,get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){B(a,"boolean",Ne,"isGridSnapRealtime");this.dragOptions.isGridSnapRealtime= a}},gridSnapCellSize:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){x(a,Gb,Ne,"gridSnapCellSize");this.dragOptions.gridSnapCellSize.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){x(a,Hb,Ne,"gridSnapCellSpot");this.dragOptions.gridSnapCellSpot.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){x(a,K,Ne,"gridSnapOrigin");this.dragOptions.gridSnapOrigin.D(a)||(a=a.M(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{configurable:!0,get:function(){return this.dragOptions.dragsLink},set:function(a){B(a,"boolean",Ne,"dragsLink");this.dragOptions.dragsLink=a}},dragsTree:{configurable:!0,get:function(){return this.dragOptions.dragsTree},set:function(a){B(a,"boolean",Ne,"dragsTree"); this.dragOptions.dragsTree=a}},copyCursor:{configurable:!0,get:function(){return this.G},set:function(a){this.G=a}},moveCursor:{configurable:!0,get:function(){return this.Rc},set:function(a){this.Rc=a}},nodropCursor:{configurable:!0,get:function(){return this.Sc},set:function(a){this.Sc=a}},currentPart:{configurable:!0,get:function(){return this.Z},set:function(a){null!==a&&x(a,U,Ne,"currentPart");this.Z=a}},copiedParts:{configurable:!0, get:function(){return this.m},set:function(a){this.m=a}},draggedParts:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na=a}},draggingParts:{configurable:!0,get:function(){return null!==this.copiedParts?this.copiedParts.Uf():null!==this.draggedParts?this.draggedParts.Uf():this.xe}},draggedLink:{configurable:!0,get:function(){return this.diagram.draggedLink},set:function(a){null!==a&&x(a,T,Ne,"draggedLink");this.diagram.draggedLink=a}}, isDragOutStarted:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb=a}},startPoint:{configurable:!0,get:function(){return this.Kr},set:function(a){x(a,K,Ne,"startPoint");this.Kr.D(a)||this.Kr.assign(a)}},delay:{configurable:!0,get:function(){return this.Qk},set:function(a){B(a,"number",Ne,"delay");this.Qk=a}}});Ne.prototype.getDraggingSource=Ne.prototype.Lz;var Qe=null,Ue=null;Ne.className="DraggingTool";Pe=new I; Ta("draggingTool",function(){return this.findTool("Dragging")},function(a){this.nb("Dragging",a,this.mouseMoveTools)});Ua.prototype.doCancel=function(){null!==Qe&&Qe.doCancel();we.prototype.doCancel.call(this)}; function Of(){0=d&&(d=.1);var e=this,f=b.wg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof V){var k=g.pa(Ic,K.alloc()),l=c.x-k.x,m=c.y-k.y;K.free(k);k=l*l+m*m;kc){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.Uo(b).count>=c)return!1}return!0}; Of.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.toLinkable))return!1;var c=b.toMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalToNode&&b===this.originalToPort)return!0;b=b.portId;null===b&&(b="");if(a.Qd(b).count>=c)return!1}return!0}; Of.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;a=a.part;b=b.part;return null!==a&&a===b};Of.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.part;if(!(c instanceof V))return!1;a=a.portId;null===a&&(a="");var d=b.part;if(!(d instanceof V))return!1;b=b.portId;null===b&&(b="");for(b=d.Qd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Of.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.fromLinkableSelfNode&&d.toLinkableSelfNode||!this.isInSameNode(b,d))&&(b.fromLinkableDuplicates&&d.toLinkableDuplicates||!this.isLinked(b,d)))||null!==this.originalLink&&(null!==a&&this.isLabelDependentOnLink(a,this.originalLink)||null!==c&&this.isLabelDependentOnLink(c,this.originalLink))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a, c,this.originalLink))return!1;if(null!==a){var e=a.linkValidation;if(null!==e&&!e(a,b,c,d,this.originalLink))return!1}if(null!==c&&(e=c.linkValidation,null!==e&&!e(a,b,c,d,this.originalLink)))return!1;e=this.linkValidation;return null!==e?e(a,b,c,d,this.originalLink):!0};Of.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.labeledLink;if(null===c)return!1;if(c===b)return!0;var d=new J;d.add(a);return Qf(this,c,b,d)}; function Qf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Qf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Qf(a,b.labeledLink,c,d))?!0:!1} Of.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.isUnconnectedLinkValid;var d=this.diagram.validCycle;if(d!==Rf){if(d===Sf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=b.linksConnected;d.next();){var e=d.value;if(e!==c&&e.isTreeLink&&e.toNode===b)return!1}return!Tf(this,a,b,c,!0)}if(d===Uf){d=c||this.temporaryLink;if(null!==d&&!d.isTreeLink)return!0;for(d=a.linksConnected;d.next();)if(e=d.value,e!==c&&e.isTreeLink&&e.fromNode=== a)return!1;return!Tf(this,a,b,c,!0)}if(d===Vf)return a===b?a=!0:(d=new J,d.add(b),a=Wf(this,d,a,b,c)),!a;if(d===Xf)return!Tf(this,a,b,c,!1);if(d===Yf)return a===b?a=!0:(d=new J,d.add(b),a=eg(this,d,a,b,c)),!a}return!0};function Tf(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.linksConnected;f.next();){var g=f.value;if(g!==d&&(!e||g.isTreeLink)&&g.toNode===b&&(g=g.fromNode,g!==b&&Tf(a,g,c,d,e)))return!0}return!1} function Wf(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e&&g.toNode===c&&(g=g.fromNode,g!==c&&Wf(a,b,g,d,e)))return!0}return!1}function eg(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.linksConnected;f.next();){var g=f.value;if(g!==e){var h=g.fromNode;g=g.toNode;h=h===c?g:h;if(h!==c&&eg(a,b,h,d,e))return!0}}return!1} oa.Object.defineProperties(Of.prototype,{portGravity:{configurable:!0,get:function(){return this.xe},set:function(a){B(a,"number",Of,"portGravity");0<=a&&(this.xe=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Na},set:function(a){B(a,"boolean",Of,"isUnconnectedLinkValid");this.Na=a}},linkingCursor:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},temporaryLink:{configurable:!0,get:function(){return this.Mi}, set:function(a){x(a,T,Of,"temporaryLink");this.Mi=a}},temporaryFromNode:{configurable:!0,get:function(){return this.Li},set:function(a){x(a,V,Of,"temporaryFromNode");if(this.Li=a)this.j=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.j},set:function(a){x(a,P,Of,"temporaryFromPort");if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.T.indexOf(this.j);b.tb(c);b.Jb(c,a)}}this.j=a}},temporaryToNode:{configurable:!0,get:function(){return this.Ni}, set:function(a){x(a,V,Of,"temporaryToNode");if(this.Ni=a)this.m=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.m},set:function(a){x(a,P,Of,"temporaryToPort");if(null!==this.m){var b=this.m.panel;if(null!==b){var c=b.T.indexOf(this.m);b.tb(c);b.Jb(c,a)}}this.m=a}},originalLink:{configurable:!0,get:function(){return this.Kb},set:function(a){null!==a&&x(a,T,Of,"originalLink");this.Kb=a}},originalFromNode:{configurable:!0,get:function(){return this.ob}, set:function(a){null!==a&&x(a,V,Of,"originalFromNode");this.ob=a}},originalFromPort:{configurable:!0,get:function(){return this.vb},set:function(a){null!==a&&x(a,P,Of,"originalFromPort");this.vb=a}},originalToNode:{configurable:!0,get:function(){return this.Rc},set:function(a){null!==a&&x(a,V,Of,"originalToNode");this.Rc=a}},originalToPort:{configurable:!0,get:function(){return this.Sc},set:function(a){null!==a&&x(a,P,Of,"originalToPort");this.Sc=a}},isForwards:{configurable:!0, enumerable:!0,get:function(){return this.ma},set:function(a){B(a,"boolean",Of,"isForwards");this.ma=a}},validPortsCache:{configurable:!0,get:function(){return this.uy}},targetPort:{configurable:!0,get:function(){return this.Yf},set:function(a){null!==a&&x(a,P,Of,"targetPort");this.Yf=a}},linkValidation:{configurable:!0,get:function(){return this.rj},set:function(a){null!==a&&B(a,"function",Of,"linkValidation");this.rj=a}},portTargeted:{configurable:!0, get:function(){return this.Xf},set:function(a){null!==a&&B(a,"function",Of,"portTargeted");this.Xf=a}}});Of.className="LinkingBaseTool";function fg(){0b.firstPickIndex+1&&c=c.x)b=0>=c.y?b+225:1<=c.y?b+135:b+180;else if(1<=c.x)0>=c.y?b+=315:1<=c.y&&(b+=45);else if(0>=c.y)b+=270;else if(1<=c.y)b+=90;else break a;0>b?b+=360:360<=b&&(b-=360);a.cursor=22.5>b?"e-resize":67.5>b?"se-resize":112.5>b?"s-resize":157.5>b?"sw-resize":202.5>b?"w-resize":247.5>b?"nw-resize":292.5>b?"n-resize":337.5>b?"ne-resize": "e-resize"}else if(a instanceof W)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};tg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1}; tg.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(a.isMouseCaptured=!0,a.animationManager.Fc(),this.Ka(this.name),this.cr.set(this.adornedObject.pa(this.handle.alignment.qv())),this.ao.set(this.adornedObject.part.location),this.Kw.set(this.adornedObject.desiredSize),this.vt=this.computeCellSize(),this.xt= this.computeMinSize(),this.wt=this.computeMaxSize(),this.isActive=!0))};tg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ze=this.handle=null;this.isActive=a.isMouseCaptured=!1};tg.prototype.stopTransaction=function(){var a=this.diagram,b=we.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.jk();return b}; tg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};tg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.xt,c=this.wt,d=this.vt,e=this.adornedObject.ws(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.bd();K.free(e)}}; tg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.xt,c=this.wt,d=this.vt,e=this.adornedObject.ws(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);K.free(e);a.cb();this.transactionResult=this.name;a.U("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; tg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.$a();c=c.pa(this.handle.alignment.qv());if(a instanceof Df){var d=new I;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Oe;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().ve(c),!0,e)}else a.location=a.location.copy().ve(c).add(this.oppositePoint);b.bd()}}; tg.prototype.computeResize=function(a,b,c,d,e,f){b.kc()&&(b=Ic);var g=this.adornedObject.naturalBounds,h=g.x,k=g.y,l=g.x+g.width,m=g.y+g.height,n=1;if(!f){n=g.width;var p=g.height;0>=n&&(n=1);0>=p&&(p=1);n=p/n}p=K.alloc();L.Vo(a.x,a.y,h,k,e.width,e.height,p);a=g.copy();0>=b.x?0>=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n* a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width,a.y=m-a.height)):1<=b.y?(a.x=Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=Math.max(l-a.x,c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width),a.x=l-a.width)):(a.x= Math.max(p.x,l-d.width),a.x=Math.min(a.x,l-c.width),a.width=l-a.x,f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.y=Math.max(p.y,m-d.height),a.y=Math.min(a.y,m-c.height),a.height=Math.max(m-a.y,c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width), a.y=m-a.height)):1<=b.y?(a.width=Math.max(Math.min(p.x-h,d.width),c.width),a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(1<=a.height/a.width?(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n):(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width))):(a.width=Math.max(Math.min(p.x-h,d.width),c.width),f||(a.height=Math.max(Math.min(n*a.width,d.height),c.height),a.width=a.height/n,a.y=k+.5*(m-k-a.height))):0>=b.y?(a.y=Math.max(p.y,m-d.height), a.y=Math.min(a.y,m-c.height),a.height=m-a.y,f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width))):1<=b.y&&(a.height=Math.max(Math.min(p.y-k,d.height),c.height),f||(a.width=Math.max(Math.min(a.height/n,d.width),c.width),a.height=n*a.width,a.x=h+.5*(l-h-a.width)));K.free(p);return a};tg.prototype.computeReshape=function(){var a=xg;this.adornedObject instanceof Pf&&(a=yg(this.adornedObject));return!(a===zg||this.diagram.lastInput.shift)}; tg.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),b=this.minSize;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};tg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.widthc?c+=360:360<=c&&(c-=360);c=Math.round(45*Math.round(c/45));var d=this.handleDistance;0===c?b.x=a.naturalBounds.width+d:45===c?(b.x=a.naturalBounds.width+d,b.y=a.naturalBounds.height+d):90===c?b.y=a.naturalBounds.height+d:135===c?(b.x=-d,b.y=a.naturalBounds.height+d):180===c?b.x=-d:225===c?(b.x=-d,b.y=-d):270===c?b.y=-d:315===c&&(b.x=a.naturalBounds.width+ d,b.y=-d);return a.pa(b)};Ag.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.ze=this.handle=null;this.rr=new K(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Ag.prototype.stopTransaction=function(){var a=this.diagram,b=we.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.jk();return b};Ag.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; Ag.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};Ag.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.cb();this.transactionResult=this.name;a.U("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Ag.prototype.rotate=function(a){G&&D(a,Ag,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.$a();var c=b.locationObject,d=b.rotateObject;if(c===d||c.zg(d))c=this.ao.copy(),b.location=c.ve(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.bd()}}; Ag.prototype.computeRotate=function(a){a=this.rotationPoint.fb(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.vi());360<=a?a-=360:0>a&&(a+=360);b=Math.min(Math.abs(this.snapAngleMultiple),180);var c=Math.min(Math.abs(this.snapAngleEpsilon),b/2);!this.diagram.lastInput.shift&&0b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a}; oa.Object.defineProperties(Ag.prototype,{handleArchetype:{configurable:!0,get:function(){return this.m},set:function(a){null!==a&&x(a,P,Ag,"handleArchetype");this.m=a}},handle:{configurable:!0,get:function(){return this.j},set:function(a){if(null!==a&&(x(a,P,Ag,"handle"),!(a.part instanceof Be)))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{configurable:!0,get:function(){return this.ze},set:function(a){if(null!==a&&(x(a,P, Ag,"handle"),a.part instanceof Be))throw Error("new handle must not be in an Adornment: "+a);this.ze=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.ma},set:function(a){B(a,"number",Ag,"snapAngleMultiple");this.ma=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.Z},set:function(a){B(a,"number",Ag,"snapAngleEpsilon");this.Z=a}},originalAngle:{configurable:!0,get:function(){return this.Jw}},rotationPoint:{configurable:!0, get:function(){return this.rr},set:function(a){this.rr=a.copy()}},handleAngle:{configurable:!0,get:function(){return this.v},set:function(a){B(a,"number",Ag,"handleAngle");this.v=a}},handleDistance:{configurable:!0,get:function(){return this.G},set:function(a){B(a,"number",Ag,"handleDistance");this.G=a}}});Ag.className="RotatingTool";Ta("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.nb("Rotating",a,this.mouseDownTools)}); function Bg(){we.call(this);0e.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};ah.prototype.doStart=function(){kh=this;null!==this.textBlock&&this.doActivate()}; ah.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.jc(a.lastInput.documentPoint));if(null!==b&&b instanceof bh&&(this.textBlock=b,null!==b.part)){a.animationManager.Fc();this.isActive=!0;this.wa=hh;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.hi=this.textBlock.copy();var d=new M(this.textBlock.pa(Ac),this.textBlock.pa(Nc));a.Cv(d);c.show(b,a,this);this.currentTextEditor=c}}}};ah.prototype.doCancel=function(){this.stopTool()}; ah.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};ah.prototype.doMouseDown=function(){this.isActive&&this.acceptText(lh)};ah.prototype.acceptText=function(a){switch(a){case lh:if(this.wa===nh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.wa===hh||this.wa===jh||this.wa===ih)this.wa=oh,ph(this);break;case qh:case fh:case gh:if(fh!==a||!0!==this.textBlock.isMultiline)if(this.wa===hh||this.wa===jh||this.wa===ih)this.wa=oh,ph(this)}}; function ph(a){var b=a.textBlock,c=a.diagram,d=a.currentTextEditor;if(null!==b&&null!==d){var e=b.text,f="";null!==d.valueFunction&&(f=d.valueFunction());a.isValidText(b,e,f)?(a.Ka(a.name),a.wa=nh,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.U("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.wa=jh,a.doError(e,f))}} ah.prototype.doError=function(a,b){var c=this.textBlock;null!==c.errorFunction&&c.errorFunction(this,a,b);(a=this.currentTextEditor)&&a.show(c,this.diagram,this)};ah.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};ah.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.wa=dh,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};ah.prototype.doStop=function(){kh=null}; ah.prototype.isValidText=function(a,b,c){x(a,bh,ah,"isValidText:textblock");var d=this.textValidation;if(null!==d&&!d(a,b,c))return!1;d=a.textValidation;return null===d||d(a,b,c)?!0:!1};ah.prototype.Wx=function(a){var b=this.hi;b.text=a;b.measure(this.textBlock.Qh,Infinity);return b}; oa.Object.defineProperties(ah.prototype,{textBlock:{configurable:!0,get:function(){return this.ma},set:function(a){null!==a&&x(a,bh,ah,"textBlock");this.ma=a}},currentTextEditor:{configurable:!0,get:function(){return this.m},set:function(a){this.m=a}},defaultTextEditor:{configurable:!0,get:function(){return this.j},set:function(a){!G||a instanceof Le||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.j=a}},starting:{configurable:!0, get:function(){return this.Z},set:function(a){$a(a,ah,ah,"starting");this.Z=a}},textValidation:{configurable:!0,get:function(){return this.Gj},set:function(a){null!==a&&B(a,"function",ah,"textValidation");this.Gj=a}},minimumEditorScale:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&B(a,"number",ah,"minimumEditorScale");this.v=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&B(a,"boolean", ah,"selectsTextOnActivate");this.G=a}},state:{configurable:!0,get:function(){return this.wa},set:function(a){this.wa!==a&&($a(a,ah,ah,"starting"),this.wa=a)}}});ah.prototype.measureTemporaryTextBlock=ah.prototype.Wx; var qh=new F(ah,"LostFocus",0),lh=new F(ah,"MouseDown",1),gh=new F(ah,"Tab",2),fh=new F(ah,"Enter",3),rh=new F(ah,"SingleClick",0),ch=new F(ah,"SingleClickSelected",1),mh=new F(ah,"DoubleClick",2),dh=new F(ah,"StateNone",0),hh=new F(ah,"StateActive",1),ih=new F(ah,"StateEditing",2),oh=new F(ah,"StateValidating",3),jh=new F(ah,"StateInvalid",4),nh=new F(ah,"StateValidated",5),kh=null;ah.className="TextEditingTool";ah.LostFocus=qh;ah.MouseDown=lh;ah.Tab=gh;ah.Enter=fh;ah.SingleClick=rh; ah.SingleClickSelected=ch;ah.DoubleClick=mh;ah.StateNone=dh;ah.StateActive=hh;ah.StateEditing=ih;ah.StateValidating=oh;ah.StateInvalid=jh;ah.StateValidated=nh;Ta("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.nb("TextEditing",a,this.mouseUpTools)}); function sh(a){th||(uh(),th=!0);this.H=xe;this.Wk=this.Eb=this.Bq=this.dc=!1;this.Xw=!0;this.Xk=vh;this.Nm=!1;this.Oh=this.Gd=!0;this.Lg=600;this.jw=this.Vw=!1;this.$d=new J;this.ee=new wh;this.ee.Zd=this;this.Oi=new J;this.xu=new J;this.Xr=new J;this.xl=new J;a&&Object.assign(this,a)}sh.prototype.ff=function(a){this.H=a};sh.prototype.canStart=function(){return!0};function xh(a,b){a.Gd&&a.canStart(b)&&(a.$d.add(b),a.defaultAnimation.isAnimating&&a.Fc(),yh(a.H),a.Eb=!0)} function zh(a){if(a.Gd&&a.Eb){var b=a.ee,c=a.H,d=a.$d.contains("Model");d&&(a.Wk=!0,a.Xk===vh?(b.isViewportUnconstrained=!0,b.yc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Xk===Ah&&b.yc.clear(),a.Xw=a.Xk===Bh&&c.lu.D(c.va)?!0:!1,c.U("InitialAnimationStarting",a));d&&!a.Oh||0===b.yc.count?(a.$d.clear(),a.Eb=!1,b.yc.clear(),Ch(b,c),a.Wk=!1,c.R()):(a.$d.clear(),c.sg=!1,d=b.yc.get(c),c.autoScale!==Dh&&null!==d&&(delete d.start.scale,delete d.end.scale), sa.requestAnimationFrame(function(){!1===a.Eb||b.dc||(c.Pf("temporaryPixelRatio")&&Se(c),Eh(c),a.Eb=!1,b.start(),b.dc&&(Fh(a),c.cb(),Gh(b,0),Mf(c,!0),Hh(a),c.U("AnimationStarting",a)))}))}}function Ih(a){return a.$d.contains("Trigger")&&1===a.$d.count}function Jh(a,b,c,d){a.isTicking||Ih(a)||b instanceof T&&(null!==b.fromNode||null!==b.toNode)||a.ee.add(b,"position",c,d,!1)}t=sh.prototype;t.pv=function(a){return this.ee.pv(a)};t.hv=function(a){return this.ee.hv(a)}; function Kh(a,b){function c(){0f?f+=360:k+=360);f=e(c,f,k-f,d)%360;g=e(c,g,l-g,d);h=e(c,h,m-h,d);c=e(c,a,b-a,d);return"hsla("+f+", "+g+"%, "+h+"%, "+c+")"} function uh(){function a(a,b,e,f,g,h){a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new xb;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&Ba(a,">= 1",sh,"duration");this.Lg=a}},isAnimating:{configurable:!0, enumerable:!0,get:function(){return this.dc}},isTicking:{configurable:!0,get:function(){return this.Bq}},isInitial:{configurable:!0,get:function(){return this.Oh},set:function(a){B(a,"boolean",sh,"isInitial");this.Oh=a}},defaultAnimation:{configurable:!0,get:function(){return this.ee}},activeAnimations:{configurable:!0,get:function(){return this.Oi}},initialAnimationStyle:{configurable:!0,get:function(){return this.Xk},set:function(a){G&& $a(a,sh,sh,"initialAnimationStyle");this.Xk=a}}});sh.prototype.stopAnimation=sh.prototype.Fc;var ai=null,th=!1,vh=new F(sh,"Default",1),Bh=new F(sh,"AnimateLocations",2),Ah=new F(sh,"None",3);sh.className="AnimationManager";sh.defineAnimationEffect=function(a,b){th||(uh(),th=!0);ai.add(a,b)};sh.Default=vh;sh.AnimateLocations=Bh;sh.None=Ah; function wh(a){this.Du=this.Uw=this.Zd=this.H=null;this.el=this.dc=this.j=!1;this.mn=this.Od=0;this.Sp=this.ut=bi;this.dl=this.po=!1;this.ku=1;this.iu=0;this.Ed=this.Lg=NaN;this.nw=0;this.nn=null;this.m=yb;this.yc=new xb;this.au=new xb;this.Hl=new J;this.bu=new J;this.kw=ci;a&&Object.assign(this,a)}wh.prototype.suspend=function(){this.el=!0};wh.prototype.advanceTo=function(a,b){b&&(this.el=!1);this.po&&a>=this.Ed&&(this.dl=!0,a-=this.Ed);this.nw=a;Lh(this,!0);Fh(this.Zd);Mf(this.H);Hh(this.Zd);this.H.redraw()}; function Ch(a,b){a.au.clear();a.dl=!1;a.iu=0;a.Ed=NaN;0a.mn?a.Ed:d-a.Od;b&&(e=a.nw,ea.mn&&(a.po&&!a.dl?(a.Od=+new Date,a.mn=a.Od+a.Ed,a.dl=!0):a.Vl(!1))}}} function Gh(a,b){for(var c=a.Ed,d=a.yc.iterator,e=a.dl;d.next();){var f=d.key;if(!(f instanceof P&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=ai,l;for(l in g)"position"===l&&(g["position:placeholder"]||g["position:nodeCollapse"])||null===k.get(l)||k.get(l)(f,h[l],g[l],a.Sp,b,c,a)}}}t.stop=function(){if(!this.dc)return this;this.Vl(!0);return this}; t.Vl=function(a){null!==this.Du&&this.Du.ro.remove(this.Uw);if(this.dc){var b=this.H,c=this.Zd;this.el=this.dc=c.Wk=!1;Fh(c);for(var d=this.yc,e=this.Hl.iterator;e.next();)b.remove(e.value);for(e=this.bu.iterator;e.next();)e.value.w();e=this.po;d=d.iterator;for(var f=ai;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.Tu,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Ou||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: h.Ou?k[n]:l[n],this.Sp,this.Ed,this.Ed,this)}h.Ou&&void 0!==m.location&&g instanceof U&&(g.location=m.location);h.wv&&g instanceof U&&g.$b(!1)}b.Gs.clear();lf(b,!1);b.cb();b.R();Mf(b,!0);if(c.defaultAnimation===this){for(n=c.xl.iterator;n.next();)e=n.value,null!==e.Af&&(e.points=e.Af,e.Af=null);c.xl.clear()}Mf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.kw);Hh(c);this.iu++;!a&&this.ku>this.iu?(this.dl=!1,this.start()):(this.nn&&this.nn(this),Ch(this,null),c.Vl(this),b.ac())}}; t.Nj=function(a,b){var c=b.actualBounds,d=null;b instanceof Df&&(d=b.placeholder);null!==d?(c=d.pa(Ac),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new K(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof Df)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Nj(d,b)}; t.Lj=function(a,b){if(a.isVisible()){var c=null;b instanceof Df&&(c=b.placeholder);if(null!==c){var d=c.pa(Ac);c=c.padding;d.x+=c.left;d.y+=c.top;this.add(a,"position:placeholder",a.position,d,!0)}else this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);d=this.yc;d.contains(a)&&(d.L(a).wv=!0);if(a instanceof Df)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Lj(d,b)}};t.Pz=function(a){var b=this.au.get(a);null===b&&(b={},this.au.add(a,b));return b}; oa.Object.defineProperties(wh.prototype,{duration:{configurable:!0,get:function(){return this.Lg},set:function(a){B(a,"number",wh,"duration");1>a&&Ba(a,">= 1",wh,"duration");this.Lg=a}},reversible:{configurable:!0,get:function(){return this.po},set:function(a){this.po=a}},runCount:{configurable:!0,get:function(){return this.ku},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function di(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}wh.className="Animation";wh.EaseLinear=function(a,b,c,d){return c*a/d+b};wh.EaseInOutQuad=bi;wh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};wh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};wh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};wh.EaseOutExpo=di; function ji(a,b,c){this.start=a;this.end=b;this.Tu={};this.Ou=c;this.wv=!1}ji.className="AnimationState";function ki(a,b,c){this.xd=null;this.zf=a;this.Ao=c||li;this.Ck=null;void 0!==b&&(this.Ck=b,void 0===c&&(this.Ao=mi))}ki.prototype.copy=function(){var a=new ki(this.zf);a.Ao=this.Ao;var b=this.Ck;if(null!==b){var c={};void 0!==b.duration&&(c.duration=b.duration);void 0!==b.finished&&(c.finished=b.finished);void 0!==b.easing&&(c.easing=b.easing);a.Ck=c}return a}; function ni(a,b){a=a.Ck;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))} oa.Object.defineProperties(ki.prototype,{propertyName:{configurable:!0,get:function(){return this.zf},set:function(a){this.zf=a}},animationSettings:{configurable:!0,get:function(){return this.Ck},set:function(a){this.Ck=a}},startCondition:{configurable:!0,get:function(){return this.Ao},set:function(a){G&&$a(a,ki,ki,"startCondition");this.Ao=a}}});var li=new F(ki,"Default",1),mi=new F(ki,"Immediate",2),oi=new F(ki,"Bundled",3);ki.className="AnimationTrigger"; ki.Default=li;ki.Immediate=mi;ki.Bundled=oi;function pi(a){Ya(this);this.H=null;this.Ta=new I;this.Da="";this.wb=1;this.m=!1;this.j=this.bi=this.v=this.Yi=this.Xi=this.Wi=this.Vi=this.Ti=this.Ui=this.Si=this.$i=this.Ri=this.Zi=this.Qi=this.Pi=!0;this.er=[];a&&Object.assign(this,a)}t=pi.prototype;t.clear=function(){for(var a=this.Ta,b=0;b=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ta.iterator;h.next();){var k=h.value;k instanceof Df?e++:k instanceof V?d++:k instanceof T?f++:k instanceof Be?g++:c++}h="";0c.Uq||h.height*e>c.Uq?b.hc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width|| 0===e.height||isNaN(e.x)||isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(ui(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(ui(b,a,"rgba(0,0,0,0.3)",!0,!1,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null!==b.background&&(a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),ui(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.Ds()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21* b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.Wc(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.jb(pe,a,this,b,c,d,e)};t.yi=function(a,b,c){var d=this.Ta;qi(b,this);if(a>=d.count)a=d.count;else if(d.O(a)===b)return-1;d.Jb(a,b);b.ap(c);d=this.diagram;null!==d&&(c?d.R():d.yi(b));vi(this,a,b);return a}; t.sc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.sc(a,b,c);var d=this.Ta;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.O(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.bp(c);d.tb(a);d=this.diagram;null!==d&&(c?d.R():d.sc(b));qi(b,null);return a}; function vi(a,b,c){b=wi(a,b,c);if(c instanceof Df&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ta.s,f=e.length,g=0;gd&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,g=NaN;0<=f;){g=a.O(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;hd)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.tb(b);a.Jb(f,c);return f}for(g=NaN;0<=--f&&(g=a.O(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.tb(b);a.Jb(h,c);return h}for(k=NaN;++h< e&&(k=a.O(h).zOrder,isNaN(k)););}return b} oa.Object.defineProperties(pi.prototype,{parts:{configurable:!0,get:function(){return this.Ta.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ta.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.H}},name:{configurable:!0,get:function(){return this.Da},set:function(a){B(a,"string",pi,"name");var b=this.Da;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&v("Cannot rename default Layer to: "+a),c= c.layers;c.next();)c.value.name===a&&v("Layer.name is already present in this diagram: "+a);this.Da=a;this.g("name",b,a);for(a=this.Ta.iterator;a.next();)a.value.layerName=this.Da}}},opacity:{configurable:!0,get:function(){return this.wb},set:function(a){var b=this.wb;b!==a&&(B(a,"number",pi,"opacity"),(0>a||1=a)return b;for(var c=this.ab.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b}; function Gi(a,b){if($g){void 0!==b&&null!==b||v("Diagram setup requires an argument DIV.");null!==a.Pa&&v("Diagram has already completed setup.");"string"===typeof b?a.Pa=sa.document.getElementById(b):b instanceof HTMLDivElement?a.Pa=b:v("No DIV or DIV id supplied: "+b);null===a.Pa&&v("Invalid DIV id; could not get element with id: "+b);void 0!==a.Pa.H&&v("Invalid div id; div already has a Diagram associated with it.");if(!a.wl&&sa.ResizeObserver){var c=ua(function(){a.ac()},250);a.wl=new sa.ResizeObserver(function(){c()}); a.wl.observe(a.Pa)}"static"===sa.getComputedStyle(a.Pa,null).position&&(a.Pa.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Pa.style["-webkit-tap-highlight-color"]=d;a.Pa.innerHTML="";a.Pa.H=a;a.Pa.goDiagram=a;a.Pa.go=sa.go;var e=new Si(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===sa.getComputedStyle(a.Pa,null).getPropertyValue("direction")&&(a.Bn=!0),e.style.zIndex="2",e.style.userSelect="none",e.style.MozUserSelect="none", e.style.touchAction="none");a.Ea=e;a.qb=e.context;d=a.qb;a.Vb=a.computePixelRatio();a.viewSize.u()||(a.Ia=a.Pa.clientWidth||1,a.Ha=a.Pa.clientHeight||1);bj(a,a.Ia,a.Ha);a.Pa.insertBefore(e.Qa,a.Pa.firstChild);e=new Si(null);e.width=1;e.height=1;a.qw=e;a.By=e.context;if($g){e=wa("div");var f=wa("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Ia+"px";e.style.height=a.Ha+"px";e.style.zIndex="1";f.style.position="absolute";f.style.width="1px";f.style.height="1px";a.Pa.appendChild(e); e.appendChild(f);e.onscroll=cj;e.addEventListener("pointerdown",dj);e.H=a;e.Gy=!0;e.Hy=!0;a.su=e;a.pu=f}a.km=ua(function(){a.gi=null;a.R()},300);a.Vv=ua(function(){Eh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.ik=function(b){if(a.isEnabled){var c=ej(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!==b.deltaX?(0!==b.deltaX&&(d=0Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&& (d=0Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0c||Math.abs(e.y-b.screenY)>c)?a.Eq++:a.Eq=1;d.clickCount=a.Eq;a.Aw=b.timeStamp;a.Bw.Ag(b.screenX, b.screenY);a.doMouseDown();1===b.button?b.preventDefault():fj(a,d,b)}};a.lk=function(b){if(a.isEnabled){a.cl=!0;var c=a.zj;if(null===c[0]||c[0].pointerId!==b.pointerId&&c[0].pointerType===b.pointerType){if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}else c[0]=b;if(c[0].pointerId===b.pointerId){c=gj(a,b,!1,!1,!1,null!==c[1]);var d=sa.document.elementFromPoint(b.clientX,b.clientY)||null;null!==d&&void 0!==d.shadowRoot&&null!==d.shadowRoot&&(d=d.shadowRoot.elementFromPoint(b.clientX, b.clientY));var e=a,f=b;d&&d.H&&(f=b,e=d.H);c.targetDiagram=e;hj(a,f,c);c.targetObject=null;a.doMouseMove();fj(a,c,b)}}};a.nk=function(b){if(a.isEnabled){a.cl=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.fu;if(c&&a.yu)delete d[b.pointerId],b.preventDefault();else if(d=a.zj,null===d[0]||d[0].pointerId!==b.pointerId&&d[0].pointerType===b.pointerType)null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null);else{d[0]=null;d=gj(a,b,!1,!0,!0,!1);var e=sa.document.elementFromPoint(b.clientX, b.clientY)||null;null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(b.clientX,b.clientY));null!==e&&e.H instanceof Q&&e.H!==a&&hj(e.H,b,d);null===e&&(e=b.target);hj(a,b,d);d.clickCount=a.Eq;d.targetDiagram=ij(b,e);d.targetObject=null;a.doMouseUp();fj(a,d,b);c&&(a.Cq=!1)}}};a.mk=function(b){if(a.isEnabled){a.cl=!1;var c=a.fu;c[b.pointerId]&&delete c[b.pointerId];c=a.zj;null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null);null!==c[1]&&c[1].pointerId===b.pointerId&& (c[1]=null);"touch"!==b.pointerType&&"pen"!==b.pointerType&&(b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())}};a.kk=function(b){var c=a.zj;null!==c[0]&&c[0].pointerId===b.pointerId?(c[0]=null,a.Cq=!1):null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null)};a.tt=d.ba["d"+jj[1]+jj[2]+"wI"+kj.slice(1,5)]["b"+lj.slice(1,b)](d.ba,mj,b,b);d.Wc(!0);nj(a);"svg"===a.vl&&(b=a.Aj.get("svg"),a.Pa.appendChild(b.Qa),a.qb=b.context)}} Q.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})};Q.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})}; function nj(a){var b=a.Ea.Qa;b instanceof HTMLCanvasElement||(b=a.div);a.addEventListener(b,"pointerdown",a.Ei,!1);a.addEventListener(b,"pointermove",a.lk,!1);a.addEventListener(b,"pointerup",a.nk,!1);a.addEventListener(b,"pointerout",a.mk,!1);a.addEventListener(b,"pointercancel",a.kk,!1);a.addEventListener(b,"pointerenter",a.kz,!1);a.addEventListener(b,"pointerleave",a.lz,!1);a.addEventListener(b,"wheel",a.ik,!1);a.addEventListener(b,"keydown",a.$z,!1);a.addEventListener(b,"keyup",a.aA,!1);a.addEventListener(b, "blur",a.Xy,!1);a.addEventListener(b,"focus",a.Yy,!1);a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1);a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1);a.addEventListener(sa,"resize",a.Vv,!1)}function Se(a){30q&&(this.position=z.h(-(b.scrollWidth-this.Ia)+w-this.Ia/e+m,this.position.y))),a.Hy&&this.allowVerticalScroll&&(hu&&(this.position= z.h(this.position.x,-(b.scrollHeight-this.Ha)+a.scrollTop-this.Ha/e+f))),K.free(z),this.vd=!0,this.Ke=this.vr=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,q=e.right,f=d.bottom,u=e.bottom,g=d.x,n=e.x,h=d.y,d=e.y,p>=k&&g>=n&&m<=q&&(c.style.width="1px"),r>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};Q.prototype.computeBounds=function(a){void 0===a&&(a=new M);yh(this);return qj(this,a)}; function qj(a,b){if(a.fixedBounds.u())return b.assign(a.fixedBounds),b.Ko(a.Db),b;for(var c=!0,d=a.ab.s,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===vj?(b=k>h?(g-a.Ib)/d:(f-a.Ib)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.Dj;this.Dj=ci;this.scale=sj(this,uj);a!==ci&&(rj(this,!1),tj(this,this.documentBounds,this.Ia/this.Ga,this.Ha/this.Ga,this.Hk,!1));this.Dj=a};t=Q.prototype; t.KA=function(a,b){void 0===b&&(b=uj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===uj||b===vj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Ia;var f=this.Ha;e=b===vj?f/d>e/c?(f-(this.He?this.Ib:0))/d:(e-(this.qf?this.Ib:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new K(a.x,a.y)}}; t.Sy=function(a,b){this.$a();var c=this.documentBounds,d=this.viewportBounds;this.position=new K(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};t.Kz=function(a){if(a instanceof P){this.kq=a;var b=K.alloc();this.lq=this.wp(a.pa(Ac,b));K.free(b)}else this.kq=null,this.lq=Cb}; function tj(a,b,c,d,e,f){var g=K.allocAt(a.va.x,a.va.y),h=g.x,k=g.y;if(null!==a.kq){var l=K.alloc();l=a.kq.pa(Ac,l);h=l.x-a.lq.x/a.scale;k=l.y-a.lq.y/a.scale;e=zc;K.free(l)}if(f||a.scrollMode===ci)e.mb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.Cj,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb;b++){var c=a.Je.iterator;if(null===c||0===a.Je.count)break;a.Je=new J;a.Uv(c,a.Je);G&&22===b&&Fa("failure to validate parts")}a.nodes.each(function(a){a instanceof Df&&0!==(a.Y&65536)!==!1&&(a.Y=a.Y^65536)})}} t.Uv=function(a,b){for(a.reset();a.next();){var c=a.value;!c.$c()||c instanceof Df||(c.Ci()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof Df&&c.isVisible()&&Fj(this,c);for(a.reset();a.next();)c=a.value,c instanceof T&&c.isVisible()&&(c.Ci()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Be&&c.isVisible()&&(c.Ci()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function Fj(a,b){for(var c=Na(),d=Na(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof Df?(Gj(f)||Hj(f)||Ij(f))&&Fj(a,f):f instanceof T?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;en&&(y=S.left, A=S.right),w.height>H&&(C=S.top,E=S.bottom)):(y=S.left,A=S.right,C=S.top,E=S.bottom);var aa=w.width+y+A,Z=w.height+C+E;S=a.scale;var R=aa>u/S,O=Z>z/S;if(!(p||a.qf||a.He||R||O))return!0;y=w.x-y;u=e.x;A=w.right+A;z=e.right+r;C=w.y-C;var la=e.y;w=w.bottom+E;e=e.bottom+q;var fa="1px";E="1px";a.scrollMode===ci&&(R||O)&&(R&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(R=1,y+1z+1&&(R=Math.max((A-z)*S+a.Ia,R)),n+r+1e+1&&(R=Math.max((w-e)*S+a.Ha,R)),H+q+1z+1&&(r=Math.max((A-z)*S+a.Ia,r)),n+1e+1&&(q=Math.max((w-e)*S+r,q)),H+1z+1&&(b=a.position.x*S));if(a.Bn)switch(a.ju){case "negative":b=-(l.scrollWidth-b-l.clientWidth);break;case "reverse":b=l.scrollWidth-b-l.clientWidth}l.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(H+1< Z?l.scrollTop=(a.position.y-C)*S:C+1e+1&&(l.scrollTop=a.position.y*S));u=a.Ia;z=a.Ha;l.style.width=u+(a.qf?a.Ib:0)+"px";l.style.height=z+(a.He?a.Ib:0)+"px";return c!==u||d!==z||a.animationManager.Eb?(c=M.allocAt(f,g,h,k),a.onViewportBoundsChanged(c,a.viewportBounds,S,p),M.free(c),!1):!0}t=Q.prototype; t.add=function(a){x(a,U,Q,"add:part");var b=a.diagram;if(b!==this&&(null!==b&&v("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.ak(a.layerName),null===b&&(b=this.ak("")),null===b&&v('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.yi(99999999,a,a.diagram===this);0<=c&&this.jb(re,"parts",b,null,a,null,c);b.isTemporary||this.cb();a.F(1);c=a.layerChanged;null!==c&&c(a,null, b)}};t.yi=function(a){this.partManager.yi(a);var b=this;Uj(a,function(a){Vj(b,a)});(a instanceof Be||a instanceof Df&&null!==a.placeholder)&&a.w();null!==a.data&&Uj(a,function(a){Wj(b.partManager,a)});!0!==Hj(a)&&!0!==Ij(a)||this.Je.add(a);Xj(a,!0,this);Yj(a)?(a.actualBounds.u()&&this.R(Tj(a,a.actualBounds)),this.cb()):a.isVisible()&&a.actualBounds.u()&&this.R(Tj(a,a.actualBounds));this.ac()}; t.sc=function(a){a.Pj();this.partManager.sc(a);var b=this;null!==a.data&&Uj(a,function(a){Zj(b.partManager,a,b)});this.Je.remove(a);Yj(a)?(a.actualBounds.u()&&this.R(Tj(a,a.actualBounds)),this.cb()):a.isVisible()&&a.actualBounds.u()&&this.R(Tj(a,a.actualBounds));this.ac()};t.remove=function(a){x(a,U,Q,"remove:part");ak(this,a,!0)}; function ak(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.F(2),c&&b.Wj(),c=d.sc(-1,b,!1),0<=c&&a.jb(se,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.Os=function(a,b){void 0===b&&(b=!1);if(Ha(a))for(var c=a.length,d=0;dd&&this.cb();return this}; t.Ny=function(a,b){gk(this,a,b);a.ff(this);var c=this.ab,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ec&&this.jb(se,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.cb();return this}; t.tA=function(a){x(a,pi,Q,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.ab,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ta.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ec&&this.jb(se,"layers",this,a,null,c,null);this.R();this.cb()}}};t.ak=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.hx=function(a){B(a,"function",Q,"addModelChangedListener:listener");null===this.xf&&(this.xf=new I);this.xf.add(a);this.model.ih(a);return this};t.vA=function(a){B(a,"function",Q,"removeModelChangedListener:listener");null!==this.xf&&(this.xf.remove(a),0===this.xf.count&&(this.xf=null));this.model.qk(a)};t.ih=function(a){B(a,"function",Q,"addChangedListener:listener");null===this.Hg&&(this.Hg=new I);this.Hg.add(a);return this}; t.qk=function(a){B(a,"function",Q,"removeChangedListener:listener");null!==this.Hg&&(this.Hg.remove(a),0===this.Hg.count&&(this.Hg=null))};t.js=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.dv(a);a.change!==qe&&(this.isModified=!0);if(null!==this.Hg)for(var b=this.Hg,c=b.length,d=0;dn.Ta.indexOf(r)&&n.yi(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Yb(),n.sc(q?p:-1,r,q)))}else n instanceof Q?"number"===typeof p&&r instanceof pi&&(b?(r.ff(this),this.ab.Jb(p,r)):this.ab.tb(p)):v("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==qe&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= c}}};Q.prototype.Ka=function(a){return this.undoManager.Ka(a)};Q.prototype.kb=function(a){return this.undoManager.kb(a)};Q.prototype.Tf=function(){return this.undoManager.Tf()};Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ka(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.kb(b):this.undoManager.Tf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; Q.prototype.zp=function(){this.partManager.zp()}; function lk(a,b,c){var d=a.animationManager;if(a.Ab||a.jd)a.Ga=c,Qi(a),a.R(),a.Ke=!0,a=a.Ga,d.Eb&&(Ih(d)||d.ee.add(d.H,"scale",b,a));else if(null===a.Ea)a.Ga=c,Qi(a);else{a.Ab=!0;var e=a.viewportBounds.copy(),f=a.Ia,g=a.Ha,h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.ad()?l.Qf(Pc)?h=0:l.Qf(Qc)&&(h=f-1):h=l.mb()?l.x*(f-1):f/2);isNaN(k)&&(l.ad()?l.Qf(Oc)?k=0:l.Qf(Sc)&&(k=g-1):k=l.mb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating||(c= a.scaleComputation(a,c));ca.maxScale&&(c=a.maxScale);f=K.allocAt(a.va.x+h/b-h/c,a.va.y+k/b-k/c);a.position=f;K.free(f);a.Ga=c;Qi(a);a.Ab=!1;a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);rj(a,!1);a=a.Ga;d.Eb&&(Ih(d)||d.ee.add(d.H,"scale",b,a))}} Q.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.D(b)){void 0===d&&(d=!1);d||(this.Ke=!0);this.vd=!0;var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Dh||a.width===b.width&&a.height===b.height||e.F();e=this.currentTool;!0===this.cl&&e instanceof Ua&&(this.lastInput.documentPoint=this.Vs(this.lastInput.viewPoint),Ke(e,this));this.Ab||this.invalidateViewport(a,b);Cj(this);this.pd.scale=c;this.pd.position.x=a.x;this.pd.position.y=a.y;this.pd.bounds.assign(a);this.pd.mx.width= Math.round(a.width*c);this.pd.mx.height=Math.round(a.height*c);this.pd.Xx.width=this.Ia;this.pd.Xx.height=this.Ha;this.pd.Rx=d;this.U("ViewportBoundsChanged",this.pd,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Zc(b)&&a.hb()})}}; function Cj(a,b){var c=a.he;if(null!==c&&c.visible){for(var d=Gb.alloc(),e=1,f=1,g=c.T.s,h=g.length,k=0;km||(mk(l.figure)?f=f*m/L.Fx(f,m):e=e*m/L.Fx(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(void 0!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=M.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.u()){M.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=K.alloc();L.Vo(a,g,0,0,d.width, d.height,b);b.offset(-d.width,-d.height);Gb.free(d);c.part.location=b;K.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.U("ChangingSelection",b);for(var c=b.La(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.Eb&&(b||xh(f,"Layout"));a.Dh=!1;for(var g=a.ji.iterator;g.next();)uk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),yh(a),e.isValidLayout=!0):a.Dh=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.kb("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||zh(f),a.da=c}}}function uk(a,b,c,d){if(null!==b){for(var e=b.ol.iterator;e.next();)uk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.xh=!b.location.u(),e.doLayout(b),b.F(32),Fj(a,b),e.isValidLayout=!0):a.Dh=!0)}}t.Jz=function(){for(var a=new I,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.qh()&&a.add(c)}return a.iterator}; function Ii(a){function b(a){var b=a.toLowerCase(),e=new I;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new xb,d=new xb;b("InitialAnimationStarting");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("GainedFocus");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped"); b("LostFocus");b("Modified");b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");b("InvalidateDraw");a.pw=c;a.ow=d} function Qj(a,b){var c=a.ow.L(b);return null!==c?c:a.ow.L(b.toLowerCase())}function vk(a,b){var c=a.pw.L(b);if(null!==c)return c;c=a.pw.L(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.Mj=function(a,b){B(a,"string",Q,"addDiagramListener:name");B(b,"function",Q,"addDiagramListener:listener");a=vk(this,a);null!==a&&a.add(b);return this};t.lm=function(a,b){B(a,"string",Q,"removeDiagramListener:name");B(b,"function",Q,"addDiagramListener:listener");a=vk(this,a);null!==a&&a.remove(b)}; t.U=function(a,b,c){G&&B(a,"string",Q,"raiseDiagramEvent:name");var d=vk(this,a),e=new ne;e.diagram=this;a=Qj(this,a);null!==a&&(e.name=a);void 0!==b&&(e.subject=b);void 0!==c&&(e.parameter=c);b=d.length;if(1===b)d.O(0)(e);else if(0!==b)for(d=d.La(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=M.allocAt(0,0,d.width*e,d.height*e);var f=K.allocAt(0,0);if(a.x>=d.x&&a.xd.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange, 1),g|=0,f.x+=g,a.x>d.x+d.width-c.right/2&&(f.x+=g),a.x>d.x+d.width-c.right/4&&(f.x+=4*g));a.y>=d.y&&a.yd.y+d.height-c.bottom&&this.allowVerticalScroll&&(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y+=g,a.y>d.y+d.height-c.bottom/2&&(f.y+=g),a.y>d.y+d.height-c.bottom/4&&(f.y+=4*g));f.gb(yb)||(b=new K(b.x+f.x/e,b.y+f.y/e)); M.free(d);K.free(f);return b};t=Q.prototype;t.Is=function(){return null};t.kv=function(){return null};t.gs=function(a,b){this.Aj.add(a,b)};t.Mu=function(a){(this.Ww=a)||this.nodes.each(function(a){a instanceof Df&&(a.gq=null)})}; function Ok(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].il){f=!1;break}f||a-l>k?b(c,e,h):sa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Ug.iterator;g.next();)if(!g.value[0].il){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;sa.requestAnimationFrame(function(){d()});return null}t.fA=function(a){if(!$g)return null;void 0===a&&(a={});a.returnType="Image";return this.Ux(a)}; t.Ux=function(a){void 0===a&&(a={});return Ok(this,this.gA,a)}; t.gA=function(a,b,c){var d=Sk(c,a,"canvas",null);if(null===d)return null;c=d.ba.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case kj+"data":e=d.getImageData(0,0,c.width,c.height);break;case kj:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&v('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.');if("function"=== typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e}; function Sk(a,b,c,d){a.animationManager.Fc();a.bd();if(null===a.Ea)return null;"object"!==typeof b&&v("properties argument must be an Object.");var e=!1,f=b.size||null,g=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(g="NaN");var h=b.maxSize;void 0===b.maxSize&&(e=!0,h="SVG"===c?new Gb(Infinity,Infinity):new Gb(2E3,2E3));var k=b.position||null,l=b.parts||null,m=void 0===b.padding?1:b.padding,n=b.background||null,p=b.omitTemporary;void 0===p&&(p=!0);var r=b.document||document,q=b.elementFinished|| null,u=b.showTemporary;void 0===u&&(u=!p);b=b.showGrid;void 0===b&&(b=u);null!==f&&isNaN(f.width)&&isNaN(f.height)&&(f=null);"number"===typeof m?m=new fc(m):m instanceof fc||v("MakeImage padding must be a Margin or a number.");m.left=Math.max(m.left,0);m.right=Math.max(m.right,0);m.top=Math.max(m.top,0);m.bottom=Math.max(m.bottom,0);a.qb.Wc(!0);p=new Si(null,r,void 0,!0);var z=p.context;if(!(f||g||l||k)){p.width=a.Ia+Math.ceil(m.left+m.right);p.height=a.Ha+Math.ceil(m.top+m.bottom);if("SVG"===c){if(null=== d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.os=q;Nj(a,d.context,m,new Gb(p.width,p.height),a.Ga,a.va,l,n,u,b);return d.context}a.gn=!1;Nj(a,z,m,new Gb(p.width,p.height),a.Ga,a.va,l,n,u,b);a.gn=!0;return p.context}var w=a.Wp,y=a.documentBounds.copy();y.Mv(a.Db);if(u)for(var A=a.ab.s,C=A.length,E=0;Ew?(g=w,f=y.width,y=y.height):(f=h.width,y=h.height)):(f=y.width*g,y=y.height*g):(g=w,f=y.width,y=y.height);null!==m?(f+=k,y+=C):m=new fc(0);null!==h&&(w=h.width,h=h.height,"SVG"!==c&&e&&!Tk&&G&&(f>w|| y>h)&&(Fa("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(f)+"x"+Math.ceil(y)+" vs 2000x2000) Consider increasing the max size."),Tk=!0),isNaN(w)&&(w=2E3),isNaN(h)&&(h=2E3),isFinite(w)&&(f=Math.min(f,w)),isFinite(h)&&(y=Math.min(y,h)));p.width=Math.ceil(f);p.height=Math.ceil(y);if("SVG"===c){if(null===d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.os=q;Nj(a,d.context,m,new Gb(Math.ceil(f),Math.ceil(y)),g,A,l,n,u,b); return d.context}a.gn=!1;Nj(a,z,m,new Gb(Math.ceil(f),Math.ceil(y)),g,A,l,n,u,b);a.gn=!0;return p.context} oa.Object.defineProperties(Q.prototype,{renderer:{configurable:!0,get:function(){return this.vl},set:function(a){this instanceof Uk||(a=a.toLowerCase(),a!==this.vl&&(this.vl=a,"default"===a?(a=this.Aj.get("svg"),null!==a&&a.Qa.remove(),this.Ea&&(this.qb=this.Ea.context)):"svg"===a?(this.Aj.contains("svg")?a=this.Aj.get("svg"):(a=new Sj(this,sa.document),this.gs("svg",a),null!==this.div&&this.div.appendChild(a.Qa)),this.qb=a.context,this.Ea&&(this.Ea.context.setTransform(this.Vb,0,0, this.Vb,0,0),this.Ea.context.clearRect(0,0,this.Ia,this.Ha))):"debug"!==a||this.Aj.contains("SVG")||(a=new Sj(this,sa.document),this.gs("SVG",a),a.Qa.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(a.Qa)),this.km()))}},div:{configurable:!0,get:function(){return this.Pa},set:function(a){null!==a&&x(a,HTMLDivElement,Q,"div");if(this.Pa!==a){var b=this.Pa;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.Ea&&(b=this.Ea.Qa,this.removeEventListener(b, "pointermove",this.lk,!1),this.removeEventListener(b,"pointerdown",this.Ei,!1),this.removeEventListener(b,"pointerup",this.nk,!1),this.removeEventListener(b,"pointerout",this.mk,!1),this.removeEventListener(b,"pointercancel",this.kk,!1),this.Ea.vx()),this.wl&&(this.wl.disconnect(),this.wl=null),b=this.toolManager,null!==b&&(b.mouseDownTools.each(function(a){a.cancelWaitAfter()}),b.mouseMoveTools.each(function(a){a.cancelWaitAfter()}),b.mouseUpTools.each(function(a){a.cancelWaitAfter()})),b.cancelWaitAfter(), this.currentTool.doCancel(),this.Ea=null,this.removeEventListener(sa,"resize",this.Vv,!1),this.removeEventListener(sa,"wheel",this.ik,!0),xe===this&&(xe=null)):null===this.Ei&&(this.rf=!1);this.Pa=null;if(null!==a){if(b=a.H)b.div=null;Gi(this,a);this.redraw()}}}},jx:{configurable:!0,get:function(){return this.Yq}},Ai:{configurable:!0,get:function(){return this.rf}},draggedLink:{configurable:!0,get:function(){return this.st},set:function(a){this.st!==a&&(this.st= a,null!==a&&(this.cu=a.fromPort,this.du=a.toPort))}},Yx:{configurable:!0,get:function(){return this.cu},set:function(a){this.cu=a}},Zx:{configurable:!0,get:function(){return this.du},set:function(a){this.du=a}},animationManager:{configurable:!0,get:function(){return this.Zd}},undoManager:{configurable:!0,get:function(){return this.ec.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.ah},set:function(a){B(a, "boolean",Q,"skipsUndoManager");this.ah=a;this.ec.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.qt},set:function(a){this.qt=a}},opacity:{configurable:!0,get:function(){return this.wb},set:function(a){var b=this.wb;b!==a&&(B(a,"number",Q,"opacity"),(0>a||1a&&Ba(a,">= 0",Q,"scrollHorizontalLineChange"),this.qu=a,this.g("scrollHorizontalLineChange", b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.uu},set:function(a){var b=this.uu;b!==a&&(B(a,"number",Q,"scrollVerticalLineChange"),0>a&&Ba(a,">= 0",Q,"scrollVerticalLineChange"),this.uu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.mj},set:function(a){G&&x(a,le,Q,"lastInput");this.mj=a}},previousInput:{configurable:!0,get:function(){return this.Wg},set:function(a){G&&x(a,le, Q,"previousInput");this.Wg=a}},firstInput:{configurable:!0,get:function(){return this.iq},set:function(a){G&&x(a,le,Q,"firstInput");this.iq=a}},currentCursor:{configurable:!0,get:function(){return this.nt},set:function(a){""===a&&(a=this.Vp);if(this.nt!==a){B(a,"string",Q,"currentCursor");var b=this.Ea,c=this.Pa;if(null!==b&&null!==c){this.nt=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===d&&(b.style.cursor="-webkit-"+a,c.style.cursor="-webkit-"+ a,b.style.cursor===d&&(b.style.cursor="-moz-"+a,c.style.cursor="-moz-"+a,b.style.cursor===d&&(b.style.cursor=a,c.style.cursor=a)))}}}},defaultCursor:{configurable:!0,get:function(){return this.Vp},set:function(a){""===a&&(a="auto");var b=this.Vp;b!==a&&(B(a,"string",Q,"defaultCursor"),this.Vp=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.Fh},set:function(a){var b=this.Fh;b!==a&&(null!==a&&B(a,"function",Q,"click"),this.Fh=a,this.g("click", b,a))}},doubleClick:{configurable:!0,get:function(){return this.Lh},set:function(a){var b=this.Lh;b!==a&&(null!==a&&B(a,"function",Q,"doubleClick"),this.Lh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return this.Hh},set:function(a){var b=this.Hh;b!==a&&(null!==a&&B(a,"function",Q,"contextClick"),this.Hh=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,get:function(){return this.Yh},set:function(a){var b=this.Yh;b!== a&&(null!==a&&B(a,"function",Q,"mouseOver"),this.Yh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.Wh},set:function(a){var b=this.Wh;b!==a&&(null!==a&&B(a,"function",Q,"mouseHover"),this.Wh=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.Vh},set:function(a){var b=this.Vh;b!==a&&(null!==a&&B(a,"function",Q,"mouseHold"),this.Vh=a,this.g("mouseHold",b,a))}},mouseDragOver:{configurable:!0, get:function(){return this.Yt},set:function(a){var b=this.Yt;b!==a&&(null!==a&&B(a,"function",Q,"mouseDragOver"),this.Yt=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.Th},set:function(a){var b=this.Th;b!==a&&(G&&null!==a&&B(a,"function",Q,"mouseDrop"),this.Th=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.Dt},set:function(a){var b=this.Dt;b!==a&&(B(a,"boolean",Q,"handlesDragDropForTopLevelParts"), this.Dt=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.Uh},set:function(a){var b=this.Uh;b!==a&&(null!==a&&B(a,"function",Q,"mouseEnter"),this.Uh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return this.Xh},set:function(a){var b=this.Xh;b!==a&&(null!==a&&B(a,"function",Q,"mouseLeave"),this.Xh=a,this.g("mouseLeave",b,a))}},toolTip:{configurable:!0,get:function(){return this.ii}, set:function(a){var b=this.ii;b!==a&&(!G||null===a||a instanceof Be||a instanceof Le||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.ii=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Ih},set:function(a){var b=this.Ih;b!==a&&(!G||a instanceof Be||a instanceof Le||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Ih=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,get:function(){return this.ub}, set:function(a){this.ub!==a&&(this.ub=a,a.ff(this))}},toolManager:{configurable:!0,get:function(){return this.xe},set:function(a){this.xe!==a&&(x(a,Ua,Q,"toolManager"),this.xe=a,a.diagram=this)}},defaultTool:{configurable:!0,get:function(){return this.vb},set:function(a){var b=this.vb;b!==a&&(x(a,we,Q,"defaultTool"),this.vb=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.ob},set:function(a){var b= this.ob;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(x(a,we,Q,"currentTool"),this.ob=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.Ow}},maxSelectionCount:{configurable:!0,get:function(){return this.Tt},set:function(a){var b=this.Tt;if(b!==a)if(B(a,"number",Q,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Tt=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&& (a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.$t},set:function(a){var b=this.$t;b!==a&&(x(a,Be,Q,"nodeSelectionAdornmentTemplate"),this.$t=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0, enumerable:!0,get:function(){return this.Ct},set:function(a){var b=this.Ct;b!==a&&(x(a,Be,Q,"groupSelectionAdornmentTemplate"),this.Ct=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.Qt},set:function(a){var b=this.Qt;b!==a&&(x(a,Be,Q,"linkSelectionAdornmentTemplate"),this.Qt=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.uw}},isModified:{configurable:!0, enumerable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.zn&&this.Ie!==a.historyIndex:this.zn},set:function(a){if(this.zn!==a){B(a,"boolean",Q,"isModified");this.zn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Ie=b.historyIndex);a||nk(this)}}},model:{configurable:!0,get:function(){return this.ec},set:function(a){var b=this.ec;if(b!==a){x(a,X,Q,"model");this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&& v("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Fc(!0);var c=Oi(this,!0);this.rf=!1;this.on=!0;this.Ie=-2;this.sg=!1;var d=this.Ab;this.Ab=!0;xh(this.animationManager,"Model");b&&(null!==this.xf&&this.xf.each(function(a){return b.qk(a)}),b.qk(this.Rc));this.ec=a;this.partManager=ok(this.ec.type);for(var e=0;ethis.scale&&(this.scale=a)):Ba(a,"> 0",Q,"minScale"))}},maxScale:{configurable:!0,get:function(){return this.St}, set:function(a){D(a,Q,"maxScale");var b=this.St;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.Hu},set:function(a){this.Hu.D(a)||(x(a,K,Q,"zoomPoint"),this.Hu=a=a.M())}},contentAlignment:{configurable:!0,get:function(){return this.Hk},set:function(a){var b=this.Hk;b.D(a)||(x(a,Hb,Q,"contentAlignment"),this.Hk=a=a.M(),this.g("contentAlignment",b,a),rj(this,!1))}}, initialContentAlignment:{configurable:!0,get:function(){return this.vq},set:function(a){var b=this.vq;b.D(a)||(x(a,Hb,Q,"initialContentAlignment"),this.vq=a=a.M(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.Db},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,Q,"padding");var b=this.Db;b.D(a)||(this.Db=a=a.M(),this.cb(),this.g("padding",b,a))}},partManager:{configurable:!0,get:function(){return this.Sc}, set:function(a){var b=this.Sc;b!==a&&(x(a,Ai,Q,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.ff(null),this.Sc=a,a.ff(this))}},nodes:{configurable:!0,get:function(){return this.partManager.nodes.iterator}},links:{configurable:!0,get:function(){return this.partManager.links.iterator}},parts:{configurable:!0,get:function(){return this.partManager.parts.iterator}},layout:{configurable:!0,get:function(){return this.Uc}, set:function(a){var b=this.Uc;b!==a&&(x(a,Ei,Q,"layout"),this.Uc=a,a.diagram=this,a.group=null,this.Dh=!0,this.g("layout",b,a),this.ac())}},isTreePathToChildren:{configurable:!0,get:function(){return this.Nt},set:function(a){var b=this.Nt;if(b!==a&&(B(a,"boolean",Q,"isTreePathToChildren"),this.Nt=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Vk(a.value)}},treeCollapsePolicy:{configurable:!0,get:function(){return this.Cu}, set:function(a){var b=this.Cu;b!==a&&(a!==Ji&&a!==Wk&&a!==Xk&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.Cu=a,this.g("treeCollapsePolicy",b,a))}},bf:{configurable:!0,get:function(){return this.ww},set:function(a){this.ww=a}},avoidanceCellSize:{configurable:!0,get:function(){return this.hw},set:function(a){this.ei=null;this.hw=new Gb(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{configurable:!0,get:function(){return this.iw},set:function(a){this.iw= Math.max(1,a)}},autoScrollInterval:{configurable:!0,get:function(){return this.Cp},set:function(a){var b=this.Cp;D(a,Q,"scale");b!==a&&(this.Cp=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.Ep},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,Q,"autoScrollRegion");var b=this.Ep;b.D(a)||(this.Ep=a=a.M(),this.cb(),this.g("autoScrollRegion",b,a))}}}); oa.Object.defineProperties(Q,{licenseKey:{configurable:!0,get:function(){return Yk.lc()},set:function(a){Yk.add(a.replace(/\s/g,""))}},version:{configurable:!0,get:function(){return Zk}}});Q.prototype.makeImageData=Q.prototype.Ux;Q.prototype.makeImage=Q.prototype.fA;Q.prototype.cacheGroupExternalLinks=Q.prototype.Mu;Q.prototype.addRenderer=Q.prototype.gs;Q.prototype.makeSVG=Q.prototype.kv;Q.prototype.makeSvg=Q.prototype.Is;Q.prototype.stopAutoScroll=Q.prototype.Cg; Q.prototype.doAutoScroll=Q.prototype.ns;Q.prototype.isUnoccupied=Q.prototype.gk;Q.prototype.raiseDiagramEvent=Q.prototype.U;Q.prototype.removeDiagramListener=Q.prototype.lm;Q.prototype.addDiagramListener=Q.prototype.Mj;Q.prototype.findTreeRoots=Q.prototype.Jz;Q.prototype.layoutDiagram=Q.prototype.dA;Q.prototype.findTopLevelGroups=Q.prototype.Cz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.Dz;Q.prototype.ensureBounds=Q.prototype.$a;Q.prototype.findLinksByExample=Q.prototype.rs; Q.prototype.findNodesByExample=Q.prototype.ss;Q.prototype.findLinkForData=Q.prototype.Oc;Q.prototype.findNodeForData=Q.prototype.si;Q.prototype.findPartForData=Q.prototype.Pc;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.Xb;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.Xd;Q.prototype.transformViewToDoc=Q.prototype.Vs;Q.prototype.transformRectDocToView=Q.prototype.IA;Q.prototype.transformDocToView=Q.prototype.wp; Q.prototype.centerRect=Q.prototype.ks;Q.prototype.scrollToRect=Q.prototype.Cv;Q.prototype.scroll=Q.prototype.scroll;Q.prototype.highlightCollection=Q.prototype.Uz;Q.prototype.highlight=Q.prototype.Tz;Q.prototype.selectCollection=Q.prototype.AA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.zp;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Tf; Q.prototype.commitTransaction=Q.prototype.kb;Q.prototype.startTransaction=Q.prototype.Ka;Q.prototype.raiseChanged=Q.prototype.g;Q.prototype.raiseChangedEvent=Q.prototype.jb;Q.prototype.removeChangedListener=Q.prototype.qk;Q.prototype.addChangedListener=Q.prototype.ih;Q.prototype.removeModelChangedListener=Q.prototype.vA;Q.prototype.addModelChangedListener=Q.prototype.hx;Q.prototype.findLayer=Q.prototype.ak;Q.prototype.removeLayer=Q.prototype.tA;Q.prototype.addLayerAfter=Q.prototype.Ny; Q.prototype.addLayerBefore=Q.prototype.ex;Q.prototype.addLayer=Q.prototype.Jl;Q.prototype.moveParts=Q.prototype.moveParts;Q.prototype.copyParts=Q.prototype.Vj;Q.prototype.removeParts=Q.prototype.Os;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.nx;Q.prototype.setProperties=Q.prototype.ym;Q.prototype.attach=Q.prototype.Lu;Q.prototype.set=Q.prototype.set;Q.prototype.resetInputOptions=Q.prototype.gy;Q.prototype.setInputOption=Q.prototype.BA; Q.prototype.getInputOption=Q.prototype.Zl;Q.prototype.resetRenderingHints=Q.prototype.hy;Q.prototype.setRenderingHint=Q.prototype.ly;Q.prototype.getRenderingHint=Q.prototype.Pf;Q.prototype.maybeUpdate=Q.prototype.bd;Q.prototype.requestUpdate=Q.prototype.ac;Q.prototype.delayInitialization=Q.prototype.fz;Q.prototype.isUpdateRequested=Q.prototype.Zz;Q.prototype.invalidateDocumentBounds=Q.prototype.cb;Q.prototype.findObjectsNear=Q.prototype.wg;Q.prototype.findPartsNear=Q.prototype.yz; Q.prototype.findObjectsIn=Q.prototype.Lf;Q.prototype.findPartsIn=Q.prototype.Ex;Q.prototype.findObjectsAt=Q.prototype.ti;Q.prototype.findPartsAt=Q.prototype.xz;Q.prototype.findObjectAt=Q.prototype.jc;Q.prototype.findPartAt=Q.prototype.Xl;Q.prototype.focusObject=Q.prototype.Kz;Q.prototype.alignDocument=Q.prototype.Sy;Q.prototype.zoomToRect=Q.prototype.KA;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.ux;Q.prototype.focus=Q.prototype.focus; var zi=new xb,Ri=null,$g=void 0!==sa.document,Mi=null,Ni="",Dh=new F(Q,"None",0),uj=new F(Q,"Uniform",1),vj=new F(Q,"UniformToFill",2),Rf=new F(Q,"CycleAll",10),Vf=new F(Q,"CycleNotDirected",11),Xf=new F(Q,"CycleNotDirectedFast",12),Yf=new F(Q,"CycleNotUndirected",13),Sf=new F(Q,"CycleDestinationTree",14),Uf=new F(Q,"CycleSourceTree",15),ci=new F(Q,"DocumentScroll",1),ei=new F(Q,"InfiniteScroll",2),Ji=new F(Q,"TreeParentCollapsed",21),Wk=new F(Q,"AllParentsCollapsed",22),Xk=new F(Q,"AnyParentsCollapsed", 23),Yk=new I,Zk="2.3.3",kj="image",Tk=!1,mj=null,xi=!1; function yi(){if($g){var a=sa.document.createElement("canvas"),b=a.getContext("2d"),c=Va("7ca11abfd022028846");b[c]=Va("398c3597c01238");for(var d=["5da73c80a36455d7038e4972187c3cae51fd22",ta.Dx+"4ae6247590da4bb21c324ba3a84e385776",Ib.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Va("7ca11abfd7330390")](Va(d[e-1]),10,15*e);b[c]=Va("39f046ebb36e4b");for(c=1;5>c;c++)b[Va("7ca11abfd7330390")](Va(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])Ib.prototype.Rd=Ib.prototype.kx; mj=a}}Q.className="Diagram";Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=sa.document.getElementById(a));return b instanceof HTMLDivElement&&b.H instanceof Q?b.H:null};Q.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);B(a,"function",Q,"inherit");B(b,"function",Q,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};Q.useDOM=function(a){$g=a?void 0!==sa.document:!1}; Q.isUsingDOM=function(){return $g};Q.None=Dh;Q.Uniform=uj;Q.UniformToFill=vj;Q.CycleAll=Rf;Q.CycleNotDirected=Vf;Q.CycleNotDirectedFast=Xf;Q.CycleNotUndirected=Yf;Q.CycleDestinationTree=Sf;Q.CycleSourceTree=Uf;Q.DocumentScroll=ci;Q.InfiniteScroll=ei;Q.TreeParentCollapsed=Ji;Q.AllParentsCollapsed=Wk;Q.AnyParentsCollapsed=Xk;function Fi(){this.Iy=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.td=this.j=!0:this.td=null} function Mj(a,b){b.qb.setTransform(b.Vb,0,0,b.Vb,0,0);b.qb.Bc();if(null===a.td)a:{b="f";var c=sa[Va("76a715b2f73f148a")][Va("72ba13b5")];a.td=!0;if($g){var d=Q[Va("76a115b6ed251eaf4692")];if(d)for(var e=Yk.iterator;e.next();){d=e.value;d=Va(d).split(Va("39e9"));if(6>d.length)break;var f=Va(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Va(ta[Va("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=sa[Va("74a900bae4370f8b51")][Va("6fbb13a1c2311e8a57")].toLowerCase();g=h[Va("73a612b6fb191d")](Va("3aad1ab6e022098b4dc4")); f=Va(d[2]);if(-1g&&f!==Va("7da71ca0ad381e90")&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=c[Va("73a612b6fb191d")](Va("7baa19a6f76c1988428554")));a.td=!(0<=g&&gk.length;)k+="9";h=k;k=k.substr(k.length-4);d="";d+=["gsh","gsf"][parseInt(k.substr(0,1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(k.substr(0,1),10)%4];g[Va("79a417a0f0181a8946")]=d;if(sa.document[Va("78a712aa")]){sa.document[Va("78a712aa")][Va("7bb806b6ed32388c4a875b")](g); k=sa.getComputedStyle(g).getPropertyValue(Va("78a704b7e62456904c9b12701b6532a8"));var l=sa.getComputedStyle(g).getPropertyValue(Va("75b817b0ea2202"));sa.document[Va("78a712aa")][Va("68ad1bbcf533388c4a875b")](g);if(k)if(g=sa[Va("77a902b0eb1b1e804a8a")],l==="0."+parseInt(h,10)%100||-1!==k.indexOf(parseInt(f[1]+f[2],16))&&-1!==k.indexOf(parseInt(f[3]+f[4],16))){a.td=!1;break}else if(g&&g(Va("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fd.updateDelay?d.R():d.m||(d.m=!0,setTimeout(function(){return d.redraw()}, d.updateDelay))};c.Xf=function(){null!==d.observed&&dl(d)};c.autoScale=uj;c.Ab=!1;b&&Object.assign(c,b);return c}na(Uk,Q);Uk.prototype.computePixelRatio=function(){return 1}; Uk.prototype.redraw=function(){if(this.m&&1<=this.updateDelay){this.m=!1;var a=this.Ea,b=this.qb;if(null!==a&&null!==b){Jj(this);if(null===this.zl){var c=new Si(null);c.width=a.width;c.height=a.height;this.zl=c}try{this.Ea=this.zl,this.qb=this.Ea.context,this.qb.Wc(!0),this.qb.setTransform(1,0,0,1,0,0),this.qb.clearRect(0,0,this.Ea.width,this.Ea.height),el(this)}finally{this.Ea=a,this.qb=b}}}Q.prototype.redraw.call(this)}; Uk.prototype.hc=function(){null===this.Pa&&v("No div specified");null===this.Ea&&v("No canvas specified");if(!(this.Ea instanceof Sj)&&(ri(this.box),this.Ic)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.Ai){Jj(this);var b=this.Ea;a=this.qb;a.Wc(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?el(this):null!==this.zl&&(a.drawImage(this.zl.Qa,0,0),b=this.Fb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&& 0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.Vb,this.Vb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy),a.Bc());b=this.ab.s;for(var c=b.length,d=0;da&&(a=0);this.ma!==a&&(this.ma=a)}}});Uk.className="Overview";function cl(){Ne.call(this);this.j=null}na(cl,Ne); cl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||!a.allowMove||!a.allowSelect)return!1;var b=a.observed;if(null===b)return!1;var c=a.lastInput;if(!c.left||a.currentTool!==this&&(!this.isBeyondDragSize()||c.isTouchEvent&&c.timestamp-a.firstInput.timestampb.maxScale||(b.scale=a))}; fl.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);D(a,fl,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Dh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};fl.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);D(a,fl,"increaseZoom:factor");var b=this.diagram;b.autoScale===Dh&&(a=b.scale*a,ab.maxScale||(b.scale=a))}; fl.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);D(a,fl,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Dh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};fl.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);D(a,fl,"resetZoom:newscale");var b=this.diagram;ab.maxScale||(b.scale=a)}; fl.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);D(a,fl,"canResetZoom:newscale");var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; fl.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Fc();a.redraw();var c=a.position,d=a.scale;xh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.Iu&&!isNaN(this.Pt)&&a.documentBounds.D(this.Gu)?(a.scale=this.Pt,a.position=this.zw,this.Iu=NaN,this.Gu=oc):(this.Pt=d,this.zw=c.copy(),a.zoomToFit(),this.Iu=a.scale,this.Gu=a.documentBounds.copy());zh(b)};fl.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; fl.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&x(a,U,fl,"part");var b=this.diagram;b.$a();if(null===a){try{null!==this.kg&&(this.kg.next()?a=this.kg.value:this.kg=null)}catch(k){this.kg=null}null===a&&(0a&&(a+=360));return a}; t.Mf=function(){if(0!==(this.o&4096)===!1)return this.Sk;var a=this.Ga;return null!==this.panel?a*this.panel.Mf():a};t.ws=function(a,b){void 0===b&&(b=new K);b.assign(a);this.se.Rd(b);return b};t.xs=function(a,b,c){return this.ck(a.x,a.y,b.x,b.y,c)}; t.ck=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,L.Of(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=L.Of(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; P.prototype.measure=function(a,b,c,d){if(!1!==Gj(this)){var e=this.Rg,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=this.qq();90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof W;switch(xl(this,!0)){case xg:g=e=0;h&&(b=a=Infinity);break;case Ad:isFinite(a)&& a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case jl:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case kl:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.widthh.height&&k.heighta.height||this.Hb> a.width)))c=!0;this.o=c?this.o|256:this.o&-257;this.Lb.u()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Lb.toString());this.gm(f,this.Lb);zl(this,!1);M.free(f)};t=P.prototype;t.kh=function(){}; function Al(a,b,c,d,e){a.Lb.h(b,c,d,e);if(!a.desiredSize.u()){var f=a.xc;c=a.Rg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=xl(a,!0);c===d&&f===e&&(b=xg);switch(b){case xg:if(c>d||f>e)Bj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Ad:Bj(a,!0);a.measure(d,e,0,0);break;case jl:Bj(a,!0);a.measure(d,f,0,0);break;case kl:Bj(a,!0),a.measure(c,e,0,0)}}} t.gm=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||Bl(c,!0),this.R(),dc(a,b)||(c.uh(),this.Xn(c)))};t.Xn=function(a){null!==this.portId&&(Bl(a,!0),a instanceof V&&Cl(a,this))}; t.hc=function(a,b){if(!Dl(this,a,b)&&this.visible){var c=this.opacity;if(0!==c){var d=1;1!==c&&(d=a.globalAlpha,a.globalAlpha=d*c);var e=this instanceof W&&yl(this),f=this.Lb;if(e){var g=this.Lb,h=this.fc,k=this.areaBackground,l=this.Wa;null===k&&null===l||a.Bc();null!==k&&(ui(this,a,k,!0,!0,h,g),k instanceof El&&k.type===Fl?(a.beginPath(),a.rect(g.x,g.y,g.width,g.height),a.vg(k)):a.fillRect(g.x,g.y,g.width,g.height));null!==l&&(ui(this,a,l,!0,!1,h,g),l instanceof El&&l.type===Fl?(a.beginPath(),a.rect(g.x, g.y,g.width,g.height),a.vg(l)):a.fillRect(g.x,g.y,g.width,g.height));this.nh(a,b)}if(!e&&(e||0!==f.width&&0!==f.height&&!isNaN(f.x)&&!isNaN(f.y))){G&&G.Nl&&G.mz&&G.mz(a,this);e=this.transform;g=this.panel;0!==(this.o&4096)===!0&&Gl(this);k=this.part;h=!1;var m=0;k&&b.Pf("drawShadows")&&(h=k.isShadowed)&&(l=k.shadowOffset,m=Math.max(l.y,l.x)*b.scale*b.Vb);l=this.cf();var n;if(!(n=b.jj||!l)){var p=this.naturalBounds;n=this.Ch;var r=n.m11,q=n.m21,u=n.dx,z=n.m12,w=n.m22,y=n.dy,A,C=A=0;n=A*r+C*q+u;var E= A*z+C*w+y;A=p.width+m;C=0;var H=A*r+C*q+u;A=A*z+C*w+y;C=Math.min(n,H);var S=Math.min(E,A);var aa=Math.max(n+0,H)-C;var Z=Math.max(E+0,A)-S;n=C;E=S;A=p.width+m;C=p.height+m;H=A*r+C*q+u;A=A*z+C*w+y;C=Math.min(n,H);S=Math.min(E,A);aa=Math.max(n+aa,H)-C;Z=Math.max(E+Z,A)-S;n=C;E=S;A=0;C=p.height+m;H=A*r+C*q+u;A=A*z+C*w+y;C=Math.min(n,H);S=Math.min(E,A);aa=Math.max(n+aa,H)-C;Z=Math.max(E+Z,A)-S;n=C;E=S;m=b.viewportBounds;p=m.x;r=m.y;n=!(n>m.width+p||p>aa+n||E>m.height+r||r>Z+E)}if(n){n=0!==(this.o&256); a.clipInsteadOfFill&&(n=!1);this instanceof bh&&(a.font=this.font);if(n){E=g.we()?g.naturalBounds:g.actualBounds;null!==this.pb?(p=this.pb,aa=p.x,Z=p.y,m=p.width,p=p.height):(aa=Math.max(f.x,E.x),Z=Math.max(f.y,E.y),m=Math.min(f.right,E.right)-aa,p=Math.min(f.bottom,E.bottom)-Z);if(aa>f.width+f.x||f.x>E.width+E.x){1!==c&&(a.globalAlpha=d);return}a.save();a.beginPath();a.rect(aa,Z,m,p);a.clip()}if(l){if(!k.isVisible()){1!==c&&(a.globalAlpha=d);return}h&&(E=k.shadowOffset,a.Lv(E.x*b.scale*this.scale* b.Vb,E.y*b.scale*this.scale*b.Vb,k.shadowBlur),Hl(a),a.shadowColor=k.shadowColor)}h&&!0===this.shadowVisible?Hl(a):h&&!1===this.shadowVisible&&Il(a);k=this.naturalBounds;null!==this.areaBackground&&(a.Bc(),Jl(this,a,k,f));a.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy);h&&(null!==g&&0!==(g.o&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.yb()!==this)&&null===this.shadowVisible&&Il(a);null!==this.Wa&&(a.Bc(),Kl(this,a,k,f));G&&G.Nl&&G.nz&&G.nz(a,this);h&&(null!==this.Wa||null!==this.areaBackground|| null!==g&&0!==(g.o&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.yb()!==this)?(Ll(this,!0),null===this.shadowVisible&&Il(a)):Ll(this,!1);this.nh(a,b);h&&0!==(this.o&512)===!0&&Hl(a);l&&h&&Il(a);n&&(a.restore(),a.Wc(this instanceof W));e.Ds()||(b=1/(e.m11*e.m22-e.m12*e.m21),a.transform(e.m22*b,-e.m12*b,-e.m21*b,e.m11*b,b*(e.m21*e.dy-e.m22*e.dx),b*(e.m12*e.dx-e.m11*e.dy)))}}1!==c&&(a.globalAlpha=d)}}}; function Ml(a,b,c,d){var e=a.part,f=!1;e&&b.Pf("drawShadows")&&(f=e.isShadowed);c.clipInsteadOfFill&&(f=!1);a.cf()&&f&&Hl(c);f&&!0===a.shadowVisible?Hl(c):f&&!1===a.shadowVisible&&Il(c);e=a.panel;f&&(null!==e&&0!==(e.o&512)||null!==e&&(e.type===W.Auto||e.type===W.Spot)&&e.yb()!==a)&&null===a.shadowVisible&&Il(c);c.Rl&&(b=b.computePixelRatio(),b="drop-shadow("+c.shadowOffsetX/b+"px "+c.shadowOffsetY/b+"px "+c.shadowBlur/b/2+"px "+c.shadowColor+")",null!==a.background&&d.Wa.setAttributeNS(null,"filter", b),null!==a.areaBackground&&d.ae.setAttributeNS(null,"filter",b));f&&(null!==a.Wa||null!==a.areaBackground||null!==e&&0!==(e.o&512)||null!==e&&(e.type===W.Auto||e.type===W.Spot)&&e.yb()!==a)?(Ll(a,!0),null===a.shadowVisible&&Il(c)):Ll(a,!1);return f}function Nl(a,b,c,d,e){d.Rl&&(c=c.computePixelRatio(),a.Kv(b,"drop-shadow("+d.shadowOffsetX/c+"px "+d.shadowOffsetY/c+"px "+d.shadowBlur/c/2+"px "+d.shadowColor+")"));e&&0!==(a.o&512)===!0&&Hl(d);a.cf()&&Il(d)}t.Kv=function(){}; function Jl(a,b,c,d){ui(a,b,a.areaBackground,!0,!0,c,d);a.areaBackground instanceof El&&a.areaBackground.type===Fl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.vg(a.areaBackground)):b.fillRect(d.x,d.y,d.width,d.height)}function Kl(a,b,c,d){var e=a.qq(),f=c.x,g=c.y,h=c.width+e,k=c.height+e;ui(a,b,a.Wa,!0,!1,c,d);a.Wa instanceof El&&a.Wa.type===Fl?(b.beginPath(),b.rect(f-e/2,g-e/2,h,k),b.vg(a.Wa)):b.fillRect(f-e/2,g-e/2,h,k)} function Ol(a,b,c){for(var d=b.T.s,e=d.length,f=-1,g=0;ge)&&v("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.isRow=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&v("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index= e);e=new bb;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Pj(a,e)}else Pj(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function km(a,b){B(a,"string",P,"defineBuilder:name");B(b,"function",P,"defineBuilder:func");var c=a.toLowerCase();G&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);gm.add(a,b)} function lm(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b} oa.Object.defineProperties(P.prototype,{bindingId:{configurable:!0,get:function(){return null!==this.B?this.B.Gp:-1},set:function(a){this.bindingId!==a&&(null===this.B&&(this.B=new rl),this.B.Gp=a)}},localBindings:{configurable:!0,get:function(){return null!==this.B?this.B.xe:null},set:function(a){this.localBindings!==a&&(null===this.B&&(this.B=new rl),this.B.xe=a)}},srcBindings:{configurable:!0,get:function(){return null!==this.B?this.B.Gm:null},set:function(a){this.srcBindings!== a&&(null===this.B&&(this.B=new rl),this.B.Gm=a)}},shadowVisible:{configurable:!0,get:function(){return null!==this.B?this.B.Mi:null},set:function(a){var b=this.shadowVisible;b!==a&&(G&&null!==a&&B(a,"boolean",P,"shadowVisible"),ql(this),this.B.Mi=a,this.R(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.B?this.B.Kb:null},set:function(a){var b=this.enabledChanged;b!==a&&(null!==a&&B(a,"function",P,"enabledChanged"),ql(this), this.B.Kb=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0,get:function(){return null!==this.Za?this.Za.wr:lg},set:function(a){var b=this.segmentOrientation;b!==a&&(G&&$a(a,T,P,"segmentOrientation"),null===this.Za&&(this.Za=new mm),this.Za.wr=a,this.w(),this.g("segmentOrientation",b,a),a===lg&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return null!==this.Za?this.Za.v:-Infinity},set:function(a){G&&B(a,"number",P,"segmentIndex");a= Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Za&&(this.Za=new mm),this.Za.v=a,this.w(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return null!==this.Za?this.Za.m:0},set:function(a){G&&B(a,"number",P,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&v("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ga=a,this.w(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.Nb},set:function(a){var b=this.Nb;b!==a&&(G&&D(a,P,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.Nb=a,cm(this),this.w(),this.g("angle",b,a)))}},desiredSize:{configurable:!0, enumerable:!0,get:function(){return this.gd},set:function(a){G&&x(a,Gb,P,"desiredSize");var b=a.width,c=a.height,d=this.gd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.gd=a=a.M(),this.w(),this instanceof Pf&&this.tc(),this.g("desiredSize",d,a),tl(this)&&(a=this.part,null!==a&&(ul(this,a,"width"),ul(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.gd.width},set:function(a){var b=this.gd.width;b===a||isNaN(b)&&isNaN(a)||(G&& B(a,"number",P,"width"),b=this.gd,this.gd=a=(new Gb(a,this.gd.height)).freeze(),this.w(),this instanceof Pf&&this.tc(),this.g("desiredSize",b,a),tl(this)&&(a=this.part,null!==a&&ul(this,a,"width")))}},height:{configurable:!0,get:function(){return this.gd.height},set:function(a){var b=this.gd.height;b===a||isNaN(b)&&isNaN(a)||(G&&B(a,"number",P,"height"),b=this.gd,this.gd=a=(new Gb(this.gd.width,a)).freeze(),this.w(),this instanceof Pf&&this.tc(),this.g("desiredSize",b,a),tl(this)&&(a= this.part,null!==a&&ul(this,a,"height")))}},minSize:{configurable:!0,get:function(){return null!==this.B?this.B.v:Ob},set:function(a){var b=this.minSize;b.D(a)||(G&&x(a,Gb,P,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),ql(this),this.B.v=a,this.w(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return null!==this.B?this.B.m:Tb},set:function(a){var b=this.maxSize;b.D(a)||(G&&x(a,Gb,P,"maxSize"),a=a.copy(),isNaN(a.width)&& (a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),ql(this),this.B.m=a,this.w(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.xc}},naturalBounds:{configurable:!0,get:function(){return this.fc}},margin:{configurable:!0,get:function(){return this.Rg},set:function(a){"number"===typeof a?a=new fc(a):G&&x(a,fc,P,"margin");var b=this.Rg;b.D(a)||(this.Rg=a=a.M(),this.w(),this.g("margin",b,a))}},transform:{configurable:!0, enumerable:!0,get:function(){0!==(this.o&2048)===!0&&Gl(this);return this.Fb}},se:{configurable:!0,get:function(){0!==(this.o&4096)===!0&&Gl(this);return this.Ch}},animationTriggers:{configurable:!0,get:function(){return null!==this.B?this.B.ob:null},set:function(a){this.animationTriggers!==a&&(ql(this),this.B.ob=a)}},reshapingBehavior:{configurable:!0,get:function(){return null!==this.B?this.B.Yf:xg},set:function(a){this.reshapingBehavior!==a&&(ql(this), this.B.Yf=a)}},alignment:{configurable:!0,get:function(){return this.Mb},set:function(a){var b=this.Mb;b.D(a)||(G&&x(a,Hb,P,"alignment"),a.kc()&&!a.Rb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Mb=a=a.M(),Yl(this),this.g("alignment",b,a))}},column:{configurable:!0,get:function(){return this.Ig},set:function(a){G&&D(a,P,"column");a=Math.round(a);var b=this.Ig;b!==a&&(0>a&&Ba(a,">= 0",P,"column"),this.Ig=a,this.w(),this.g("column", b,a),null!==this.svg&&this.svg.remove())}},columnSpan:{configurable:!0,get:function(){return null!==this.B?this.B.vb:1},set:function(a){G&&B(a,"number",P,"columnSpan");a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&Ba(a,">= 1",P,"columnSpan"),ql(this),this.B.vb=a,this.w(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.qo},set:function(a){G&&D(a,P,"row");a=Math.round(a);var b=this.qo;b!==a&&(0>a&&Ba(a,">= 0",P,"row"),this.qo=a,this.w(),this.g("row", b,a),null!==this.svg&&this.svg.remove())}},rowSpan:{configurable:!0,get:function(){return null!==this.B?this.B.Li:1},set:function(a){G&&B(a,"number",P,"rowSpan");a=Math.round(a);var b=this.rowSpan;b!==a&&(1>a&&Ba(a,">= 1",P,"rowSpan"),ql(this),this.B.Li=a,this.w(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return null!==this.B?this.B.Ni:null},set:function(a){var b=this.spanAllocation;b!==a&&(null!==a&&B(a,"function",P,"spanAllocation"),ql(this), this.B.Ni=a,this.w(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0,get:function(){return this.Ak},set:function(a){var b=this.Ak;b.D(a)||(G&&x(a,Hb,P,"alignmentFocus"),!G||!a.kc()||a.Rb()||a.ep()&&this instanceof V||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Ak=a=a.M(),this.w(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.ho},set:function(a){var b=this.ho;if(b!==a){G&&null!==a&& B(a,"string",P,"portId");var c=this.part;null===c||c instanceof V||v("Cannot set portID on a Link: "+a);null!==b&&null!==c&&om(c,this);this.ho=a;null!==a&&null!==c&&(c.af=!0,pm(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.fa?this.fa.Jj:zc},set:function(a){var b=this.toSpot;b.D(a)||(G&&x(a,Hb,P,"toSpot"),a=a.M(),this.Yc(),this.fa.Jj=a,this.g("toSpot",b,a),bm(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!== this.fa?this.fa.Hj:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&B(a,"number",P,"toEndSegmentLength"),0>a&&Ba(a,">= 0",P,"toEndSegmentLength"),this.Yc(),this.fa.Hj=a,this.g("toEndSegmentLength",b,a),bm(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Ij:0},set:function(a){var b=this.toShortLength;b!==a&&(G&&B(a,"number",P,"toShortLength"),this.Yc(),this.fa.Ij=a,this.g("toShortLength",b,a),bm(this))}},toLinkable:{configurable:!0, get:function(){return null!==this.fa?this.fa.Yr:null},set:function(a){var b=this.toLinkable;b!==a&&(G&&null!==a&&B(a,"boolean",P,"toLinkable"),this.Yc(),this.fa.Yr=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.fa?this.fa.Zr:Infinity},set:function(a){var b=this.toMaxLinks;b!==a&&(G&&B(a,"number",P,"toMaxLinks"),0>a&&Ba(a,">= 0",P,"toMaxLinks"),this.Yc(),this.fa.Zr=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!== this.fa?this.fa.gj:zc},set:function(a){var b=this.fromSpot;b.D(a)||(G&&x(a,Hb,P,"fromSpot"),a=a.M(),this.Yc(),this.fa.gj=a,this.g("fromSpot",b,a),bm(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.ej:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(G&&B(a,"number",P,"fromEndSegmentLength"),0>a&&Ba(a,">= 0",P,"fromEndSegmentLength"),this.Yc(),this.fa.ej=a,this.g("fromEndSegmentLength",b,a),bm(this))}},fromShortLength:{configurable:!0, enumerable:!0,get:function(){return null!==this.fa?this.fa.fj:0},set:function(a){var b=this.fromShortLength;b!==a&&(G&&B(a,"number",P,"fromShortLength"),this.Yc(),this.fa.fj=a,this.g("fromShortLength",b,a),bm(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.fa?this.fa.nq:null},set:function(a){var b=this.fromLinkable;b!==a&&(G&&null!==a&&B(a,"boolean",P,"fromLinkable"),this.Yc(),this.fa.nq=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0, get:function(){return null!==this.fa?this.fa.oq:Infinity},set:function(a){var b=this.fromMaxLinks;b!==a&&(G&&B(a,"number",P,"fromMaxLinks"),0>a&&Ba(a,">= 0",P,"fromMaxLinks"),this.Yc(),this.fa.oq=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return null!==this.B?this.B.j:""},set:function(a){var b=this.cursor;b!==a&&(B(a,"string",P,"cursor"),ql(this),this.B.j=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.B?this.B.Fh: null},set:function(a){var b=this.click;b!==a&&(null!==a&&B(a,"function",P,"click"),ql(this),this.B.Fh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return null!==this.B?this.B.Lh:null},set:function(a){var b=this.doubleClick;b!==a&&(null!==a&&B(a,"function",P,"doubleClick"),ql(this),this.B.Lh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.B?this.B.Hh:null},set:function(a){var b=this.contextClick;b!== a&&(null!==a&&B(a,"function",P,"contextClick"),ql(this),this.B.Hh=a,this.g("contextClick",b,a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Uh:null},set:function(a){var b=this.mouseEnter;b!==a&&(null!==a&&B(a,"function",P,"mouseEnter"),ql(this),this.B.Uh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.B?this.B.Xh:null},set:function(a){var b=this.mouseLeave;b!==a&&(null!==a&&B(a,"function",P,"mouseLeave"), ql(this),this.B.Xh=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0,get:function(){return null!==this.B?this.B.Yh:null},set:function(a){var b=this.mouseOver;b!==a&&(null!==a&&B(a,"function",P,"mouseOver"),ql(this),this.B.Yh=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.B?this.B.Wh:null},set:function(a){var b=this.mouseHover;b!==a&&(null!==a&&B(a,"function",P,"mouseHover"),ql(this),this.B.Wh=a,this.g("mouseHover",b,a))}}, mouseHold:{configurable:!0,get:function(){return null!==this.B?this.B.Vh:null},set:function(a){var b=this.mouseHold;b!==a&&(null!==a&&B(a,"function",P,"mouseHold"),ql(this),this.B.Vh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Xf:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(null!==a&&B(a,"function",P,"mouseDragEnter"),ql(this),this.B.Xf=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.Yd:null},set:function(a){var b=this.mouseDragLeave;b!==a&&(null!==a&&B(a,"function",P,"mouseDragLeave"),ql(this),this.B.Yd=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{configurable:!0,get:function(){return null!==this.B?this.B.Th:null},set:function(a){var b=this.mouseDrop;b!==a&&(null!==a&&B(a,"function",P,"mouseDrop"),ql(this),this.B.Th=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!== this.B?this.B.Z:null},set:function(a){var b=this.actionDown;b!==a&&(null!==a&&B(a,"function",P,"actionDown"),ql(this),this.B.Z=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==this.B?this.B.ma:null},set:function(a){var b=this.actionMove;b!==a&&(null!==a&&B(a,"function",P,"actionMove"),ql(this),this.B.ma=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.B?this.B.Na:null},set:function(a){var b= this.actionUp;b!==a&&(null!==a&&B(a,"function",P,"actionUp"),ql(this),this.B.Na=a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.B?this.B.G:null},set:function(a){var b=this.actionCancel;b!==a&&(null!==a&&B(a,"function",P,"actionCancel"),ql(this),this.B.G=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.B?this.B.ii:null},set:function(a){var b=this.toolTip;b!==a&&(!G||null===a||a instanceof Be||a instanceof Le||v("GraphObject.toolTip must be an Adornment or HTMLInfo."),ql(this),this.B.ii=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.B?this.B.Ih:null},set:function(a){var b=this.contextMenu;b!==a&&(!G||a instanceof Be||a instanceof Le||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),ql(this),this.B.Ih=a,this.g("contextMenu",b,a))}}});P.prototype.trigger=P.prototype.Qv;P.prototype.findBindingPanel=P.prototype.oh; P.prototype.findTemplateBinder=P.prototype.Bz;P.prototype.setProperties=P.prototype.ym;P.prototype.apply=P.prototype.apply;P.prototype.attach=P.prototype.Lu;P.prototype.set=P.prototype.set;P.prototype.isEnabledObject=P.prototype.Rf;P.prototype.isVisibleObject=P.prototype.Td;P.prototype.isContainedBy=P.prototype.zg;P.prototype.getNearestIntersectionPoint=P.prototype.xs;P.prototype.getLocalPoint=P.prototype.ws;P.prototype.getDocumentScale=P.prototype.Mf;P.prototype.getDocumentAngle=P.prototype.vi; P.prototype.getDocumentBounds=P.prototype.wi;P.prototype.getDocumentPoint=P.prototype.pa;P.prototype.intersectsRect=P.prototype.Zc;P.prototype.containedInRect=P.prototype.lh;P.prototype.containsRect=P.prototype.Ze;P.prototype.containsPoint=P.prototype.ha;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.jb;P.prototype.addCopyProperty=P.prototype.bx;var gm=null;P.className="GraphObject";gm=new xb; km("Button",function(){function a(a,b){return null!==a.diagram.jc(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=fm(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.lb("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD", _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},fm(Pf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Hb(0,0,2.76142374915397,2.761423749153969),spot2:new Hb(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Rf()&&b instanceof W&&(a=b.lb("ButtonBorder"),a instanceof Pf)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke= c}};b.mouseLeave=function(a,b){b.Rf()&&b instanceof W&&(a=b.lb("ButtonBorder"),a instanceof Pf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Rf()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.lb("ButtonBorder");if(c instanceof Pf){a=a.diagram;var d=a.skipsUndoManager;a.skipsUndoManager=!0;var g=b._buttonFillPressed;b._buttonFillOver=c.fill;c.fill=g;g=b._buttonStrokePressed;b._buttonStrokeOver=c.stroke;c.stroke=g;a.skipsUndoManager= d}}};b.actionUp=function(b,d){if(d.Rf()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.lb("ButtonBorder");if(c instanceof Pf){var f=b.diagram,g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionCancel=function(b,d){if(d.Rf()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.lb("ButtonBorder");if(c instanceof Pf){var f=b.diagram, g=f.skipsUndoManager;f.skipsUndoManager=!0;a(b,d)?(c.fill=d._buttonFillOver,c.stroke=d._buttonStrokeOver):(c.fill=d._buttonFillNormal,c.stroke=d._buttonStrokeNormal);f.skipsUndoManager=g}}};b.actionMove=function(b,d){if(d.Rf()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.lb("ButtonBorder"),b instanceof Pf))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g= d._buttonStrokePressed;b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b}); km("TreeExpanderButton",function(){var a=fm("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},fm(Pf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Rb},(new Ki("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).kp()),{visible:!1},(new Ki("visible","isTreeLeaf",function(a){return!a})).kp());a.click=function(a,c){c=c.part;c instanceof Be&&(c=c.adornedPart);if(c instanceof V){var b=c.diagram; if(null!==b){b=b.commandHandler;if(c.isTreeExpanded){if(!b.canCollapseTree(c))return}else if(!b.canExpandTree(c))return;a.handled=!0;c.isTreeExpanded?b.collapseTree(c):b.expandTree(c)}}};return a}); km("SubGraphExpanderButton",function(){var a=fm("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},fm(Pf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Rb},(new Ki("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).kp()));a.click=function(a,c){c=c.part;c instanceof Be&&(c=c.adornedPart);if(c instanceof Df){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return; a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});km("ToolTip",function(){return fm(Be,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},fm(Pf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Hb(0,0,4,6),spot2:new Hb(1,1,-4,-4)}))}); km("ContextMenu",function(){return fm(Be,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},new Ki("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});km("ContextMenuButton",function(){var a=fm("Button");a.stretch=jl;var b=a.lb("ButtonBorder");b instanceof Pf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new Hb(0,0,2,3),b.spot2=new Hb(1,1,-2,-2));return a}); km("PanelExpanderButton",function(a){var b=lm(a,"COLLAPSIBLE"),c=fm("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},fm(Pf,{name:"ButtonIcon",strokeWidth:2},(new Ki("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).kp(b))); a=c.lb("ButtonBorder");a instanceof Pf&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)");c.click=function(a,c){var d=c.diagram;if(null!==d&&!d.isReadOnly){var e=c.oh();null===e&&(e=c.part);null!==e&&(c=e.lb(b),null!==c&&(a.handled=!0,d.Ka("Collapse/Expand Panel"),c.visible=!c.visible,d.kb("Collapse/Expand Panel")))}};return c}); km("CheckBoxButton",function(a){var b=lm(a);a=fm("Button",{desiredSize:new Gb(14,14)},fm(Pf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Ad,geometryStretch:zg,visible:!1},""!==b?(new Ki("visible",b)).Vx():[]));a.click=function(a,d){if(d instanceof W){var c=a.diagram;if(!(null===c||c.isReadOnly||""!==b&&c.model.isReadOnly)){a.handled=!0;var f=d.lb("ButtonIcon");c.Ka("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.kb("checkbox")}}};return a}); km("CheckBox",function(a){a=lm(a);a=fm("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new fc(0,1,0,0)});var b=fm(W,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new fc(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave, actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});a.mouseEnter=null;a.mouseLeave=null;a.actionDown=null;a.actionUp=null;a.actionCancel=null;a.actionMove=null;a.click=null;return b});P.None=xg=new F(P,"None",0);P.Default=ll=new F(P,"Default",0);P.Vertical=kl=new F(P,"Vertical",4);P.Horizontal=jl=new F(P,"Horizontal",5);P.Fill=Ad=new F(P,"Fill",3);P.Uniform=zg=new F(P,"Uniform",1); P.UniformToFill=ml=new F(P,"UniformToFill",2);P.FlipVertical=nl=new F(P,"FlipVertical",1);P.FlipHorizontal=ol=new F(P,"FlipHorizontal",2);P.FlipBoth=pl=new F(P,"FlipBoth",3);P.make=fm;P.getBuilders=function(){var a=new xb,b;for(b in gm)if(b!==b.toLowerCase()){var c=gm.L(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};P.defineBuilder=km; P.build=function(a,b,c){for(var d=[],e=2;ea&&(a+=360);if(0!==a){this.translate(b,c);if(90===a){a=0;var d=1}else 180===a?(a=-1,d=0):270===a?(a=0,d=-1):(d=a*Math.PI/180,a=Math.cos(d),d=Math.sin(d));var e=this.oa[1]*a+this.oa[3]*d,f=this.oa[0]*-d+this.oa[2]*a,g=this.oa[1]*-d+this.oa[3]*a;this.oa[0]=this.oa[0]*a+this.oa[2]*d;this.oa[1]=e;this.oa[2]=f;this.oa[3]=g;this.translate(-b,-c)}};qm.className="STransform"; function rm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.px=[];this.pattern=null}rm.prototype.addColorStop=function(a,b){this.px.push({offset:a,color:b})};rm.className="SGradient"; function Sj(a,b,c){this.ownerDocument=a=void 0===b?sa.document:b;this.lA="http://www.w3.org/2000/svg";void 0!==a&&(this.Qa=this.Vd("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Qa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Qa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.os=null;this.context=new Oj(this,c)} Sj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.width=a,this.height=b,this.style.width=c+"px",this.style.height=d+"px",this.Qa.setAttributeNS(null,"width",c+"px"),this.Qa.setAttributeNS(null,"height",d+"px"),this.Qa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.Dw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.Dw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Sj.prototype.Vd=function(a,b,c){a=this.ownerDocument.createElementNS(this.lA,a);if(Ga(b))for(var d in b)a.setAttributeNS("href"===d?"http://www.w3.org/1999/xlink":"",d,b[d]);void 0!==c&&(a.textContent=c);return a};Sj.prototype.getBoundingClientRect=function(){return this.Qa.getBoundingClientRect()};Sj.prototype.focus=function(){this.Qa.focus()};Sj.prototype.vx=function(){this.ownerDocument=null}; oa.Object.defineProperties(Sj.prototype,{width:{configurable:!0,get:function(){return this.Qa.width.baseVal.value},set:function(a){this.Qa.setAttribute("width",a+"px")}},height:{configurable:!0,get:function(){return this.Qa.height.baseVal.value},set:function(a){this.Qa.setAttribute("height",a+"px")}},style:{configurable:!0,get:function(){return this.Qa.style}}});Sj.className="SVGSurface"; function Oj(a,b){this.Nv=a;this.svg=a.Qa;this.stack=[];this.th=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=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.Rl=!1;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.$g=this.Gr=this.Fr=0;this.yd=this.Ud=null;this.path=[];this.hm={};this.It=!1; this.dh=null;this.Fj=0;this.rc=new qm;this.j=Ql(this);this.Yj=Ql(this,"gojs-diagram");this.ls=this.Di=null;var c=ob++,d=this.Vd("clipPath",{id:"mainClip"+c});d.appendChild(this.Vd("rect",{x:0,y:0,width:a.width,height:a.height}));this.Dw=d;this.svg.appendChild(this.j);this.j.appendChild(this.Yj);this.svg.appendChild(d);this.j.setAttributeNS(null,"clip-path","url(#mainClip"+c+")");this.nA={};this.isTemporary=!!b} function Kj(a,b,c,d,e,f,g){void 0===a.Yj?Pl(a,b,c,d,e,f,g):a.Yj.setAttribute("transform","matrix("+b+", "+c+", "+d+", "+e+", "+f+", "+g+")")}t=Oj.prototype; t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[];this.hm={stroke:"none",fill:"none"}};t.$e=function(a){this.addPath(this.path,this.rc,a||0)}; t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){};t.clip=function(){this.hm.clipPath=!0};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new rm("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e}; t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.nA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+ob++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Vd("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Vd(kj,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new rm("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g}; t.drawImage=function(a,b,c,d,e,f,g,h,k){f="";a instanceof HTMLCanvasElement&&(f=a.toDataURL());a instanceof HTMLImageElement&&(f=a.getAttribute("src"));g=a instanceof HTMLImageElement?a.naturalWidth:a.width;var l=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(h=d=g,k=e=l);d=d||0;e=e||0;h=h||0;k=k||0;a={x:0,y:0,width:h||g||d,height:k||l||e,href:f};L.ca(d,h)&&L.ca(e,k)?-1===f.toLowerCase().indexOf(".svg")&&-1===f.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio="xMidYMid slice"): a.preserveAspectRatio="none";if(0!==b||0!==c||d!==g||e!==l)h="CLIP"+ob++,k=this.Vd("clipPath",{id:h}),k.appendChild(this.Vd("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(k),a["clip-path"]="url(#"+h+")";sm(this,kj,a,this.rc);this.addElement(kj,a)};t.fill=function(a){a&&(this.hm["fill-rule"]="evenodd");tm(this,this.hm)};t.vg=function(a,b){this.clipInsteadOfFill?this.clip():this.fill(b)}; t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};sm(this,"fill",a,this.rc);this.addElement("rect",a)};t.yx=function(a,b,c,d){a={x:a,y:b,width:c,height:d};sm(this,"fill",a,this.rc);tm(this,a);this.svg.prepend(this.Vd("rect",a))};t.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};sm(this,"fill",b,this.rc);this.addElement("text",b,a[0])}; t.lineTo=function(a,b){this.path.push(["L",a,b])};t.moveTo=function(a,b){this.path.push(["M",a,b])};t.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};t.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])}; t.restore=function(){this.rc=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.lineDashOffset=a.lineDashOffset;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign}; t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;bb.offset?1:-1});for(e=0;ec?(this.scale(c/a,1),this.translate((a-c)/2,0)):c>a&&(this.scale(1,a/c),this.translate(0,(c-a)/2));this.Rm?this.clip():this.fill(b);a>c?(this.translate(-(a-c)/2,0),this.scale(1/(c/a),1)):c>a&&(this.translate(0,-(c-a)/2),this.scale(1,1/(a/c)))}else this.Rm?this.clip():this.fill(b)};t.rk=function(){this.Rm||this.stroke()};t.Lv=function(a,b,c){this.Fr=a;this.Gr=b;this.$g=c}; t.ps=function(a,b){var c=this.ba;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.ms=function(){var a=this.ba;void 0!==a.setLineDash&&(a.setLineDash(xm),a.lineDashOffset=0)};t.Wc=function(a){a&&(this.it="");this.ht=this.jt=""};t.Ns=function(){}; oa.Object.defineProperties(Tl.prototype,{fillStyle:{configurable:!0,get:function(){return this.ba.fillStyle},set:function(a){this.ht!==a&&(this.ht=this.ba.fillStyle=a)}},font:{configurable:!0,get:function(){return this.ba.font},set:function(a){this.it!==a&&(this.it=this.ba.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.ba.globalAlpha},set:function(a){this.ba.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.ba.lineCap}, set:function(a){this.ba.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.ba.lineDashOffset},set:function(a){this.ba.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.ba.lineJoin},set:function(a){this.ba.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.ba.lineWidth},set:function(a){this.ba.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.ba.miterLimit},set:function(a){this.ba.miterLimit= a}},shadowBlur:{configurable:!0,get:function(){return this.ba.shadowBlur},set:function(a){this.ba.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.ba.shadowColor},set:function(a){this.ba.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.ba.shadowOffsetX},set:function(a){this.ba.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.ba.shadowOffsetY},set:function(a){this.ba.shadowOffsetY= a}},strokeStyle:{configurable:!0,get:function(){return this.ba.strokeStyle},set:function(a){this.jt!==a&&(this.jt=this.ba.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.ba.textAlign},set:function(a){this.ba.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.ba.imageSmoothingEnabled},set:function(a){this.ba.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.Rm}, set:function(a){this.Rm=a}}});var xm=Object.freeze([]);Tl.className="CanvasSurfaceContext";function ym(){this.G=this.m=this.v=this.j=0}ym.className="ColorNumbers"; function El(a,b){zm||(Am(),zm=!0);Ya(this);this._isFrozen=!1;void 0===a?(this.ta=Sl,this.Fk="black"):"string"===typeof a?(this.ta=Sl,G&&!Bm(a)&&v('Color "'+a+'" is not a valid color string for Brush constructor'),this.Fk=a):(G&&$a(a,El,El,"constructor:type"),this.ta=a,this.Fk="black");a=this.ta;a===Vl?(this.Od=Bc,this.Tk=Mc):this.Tk=a===Fl?this.Od=Ic:this.Od=zc;this.Lr=0;this.cq=NaN;this.De=this.ir=this.Ce=null;this.kt=this.Gk=0;b&&Object.assign(this,b)} El.prototype.copy=function(){var a=new El;a.ta=this.ta;a.Fk=this.Fk;a.Od=this.Od.M();a.Tk=this.Tk.M();a.Lr=this.Lr;a.cq=this.cq;null!==this.Ce&&(a.Ce=this.Ce.copy());a.ir=this.ir;return a};t=El.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.Ce&&this.Ce.freeze();return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.Ce&&this.Ce.qa();return this};t.xb=function(a){a.classType===El?this.type=a:Ea(this,a)}; t.toString=function(){var a="Brush(";if(this.type===Sl)a+=this.color;else if(a=this.type===Vl?a+"Linear ":this.type===Fl?a+"Radial ":this.type===Ul?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.colorStops)for(var b=this.colorStops.iterator;b.next();)a+=" "+b.key+":"+b.value;return a+")"}; t.addColorStop=function(a,b){this._isFrozen&&xa(this);("number"!==typeof a||!isFinite(a)||1a)&&Ba(a,"0 <= loc <= 1",El,"addColorStop:loc");B(b,"string",El,"addColorStop:color");G&&!Bm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.Ce&&(this.Ce=new xb);this.Ce.add(a,b);this.ta===Sl&&(this.type=Vl);this.De=null;return this}; function Bm(a){if("black"===a)return!0;if(""===a)return!1;G&&B(a,"string",El,"isValidColor");zm||(Am(),zm=!0);var b=Cm;if(null===b)return!0;b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;if(b.fillStyle!==c)return!0;b.fillStyle="#FFFFFF";c=b.fillStyle;b.fillStyle=a;return b.fillStyle!==c} t.eA=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?Dm:b;if(this.type===Sl)fi(this.color),this.color=Em(a,b);else if((this.type===Vl||this.type===Fl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)fi(c.value),this.addColorStop(c.key,Em(a,b));return this};function Fm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Dm:c;fi(a);return Em(b,c)} t.ez=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?Dm:b;if(this.type===Sl)fi(this.color),this.color=Em(-a,b);else if((this.type===Vl||this.type===Fl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)fi(c.value),this.addColorStop(c.key,Em(-a,b));return this};function Gm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Dm:c;fi(a);return Em(-b,c)} function Hm(a,b,c){fi(a);a=Im.j;var d=Im.v,e=Im.m,f=Im.G;fi(b);void 0===c&&(c=.5);return"rgba("+Math.round((Im.j-a)*c+a)+", "+Math.round((Im.v-d)*c+d)+", "+Math.round((Im.m-e)*c+e)+", "+Math.round((Im.G-f)*c+f)+")"} t.Qx=function(){if(this.type===Sl)return Jm(this.color);if((this.type===Vl||this.type===Fl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Fl)return Jm(a.first().value);if(null!==a.get(.5))return Jm(a.get(.5));if(2===a.count)return a=a.La(),Jm(Hm(a[0].value,a[1].value));for(var b=a.iterator,c=-1,d=-1,e=1,f=1;b.next();){var g=b.key,h=Math.abs(.5-b.key);e>f&&h=e&&hd&&(f=c,c=d,d=f,f=e);e=d-c;return Jm(Hm(a.get(c),a.get(d),1-f/e))}return!1}; function Jm(a){if(!a)return!1;if(a instanceof El)return a.Qx();fi(a);return 128>(299*Im.j+587*Im.v+114*Im.m)/1E3} function Em(a,b){switch(b){case Dm:b=100*Km(Im.j);var c=100*Km(Im.v),d=100*Km(Im.m);Lm.j=.4124564*b+.3575761*c+.1804375*d;Lm.v=.2126729*b+.7151522*c+.072175*d;Lm.m=.0193339*b+.119192*c+.9503041*d;Lm.G=Im.G;b=Mm(Lm.j/Nm[0]);c=Mm(Lm.v/Nm[1]);d=Mm(Lm.m/Nm[2]);Om.j=116*c-16;Om.v=500*(b-c);Om.m=200*(c-d);Om.G=Lm.G;Om.j=Math.min(100,Math.max(0,Om.j+100*a));a=(Om.j+16)/116;b=a-Om.m/200;Lm.j=Nm[0]*Pm(Om.v/500+a);Lm.v=Nm[1]*(Om.j>Qm*Rm?Math.pow(a,3):Om.j/Qm);Lm.m=Nm[2]*Pm(b);Lm.G=Om.G;a=-.969266*Lm.j+1.8760108* Lm.v+.041556*Lm.m;b=.0556434*Lm.j+-.2040259*Lm.v+1.0572252*Lm.m;Im.j=255*Sm((3.2404542*Lm.j+-1.5371385*Lm.v+-.4985314*Lm.m)/100);Im.v=255*Sm(a/100);Im.m=255*Sm(b/100);Im.G=Lm.G;Im.j=Math.round(Im.j);255Im.j&&(Im.j=0);Im.v=Math.round(Im.v);255Im.v&&(Im.v=0);Im.m=Math.round(Im.m);255Im.m&&(Im.m=0);return"rgba("+Im.j+", "+Im.v+", "+Im.m+", "+Im.G+")";case Tm:return gi(),hi.m=Math.min(100,Math.max(0,hi.m+100*a)),"hsla("+hi.j+", "+hi.v+"%, "+hi.m+"%, "+ hi.G+")";default:v("Unknown color space: "+b)}}function fi(a){zm||(Am(),zm=!0);var b=Cm;if(null!==b){b.clearRect(0,0,1,1);b.fillStyle="#000000";var c=b.fillStyle;b.fillStyle=a;b.fillStyle!==c?(b.fillRect(0,0,1,1),a=b.getImageData(0,0,1,1).data,Im.j=a[0],Im.v=a[1],Im.m=a[2],Im.G=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&G&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),Im.j=0,Im.v=0,Im.m=0,Im.G=1)}} function gi(){var a=Im.j/255,b=Im.v/255,c=Im.m/255,d=Math.max(a,b,c),e=Math.min(a,b,c),f=d-e;e=(d+e)/2;if(0===f)var g=a=0;else{switch(d){case a:g=(b-c)/f%6;break;case b:g=(c-a)/f+2;break;case c:g=(a-b)/f+4}g*=60;0>g&&(g+=360);a=f/(1-Math.abs(2*e-1))}hi.j=Math.round(g);hi.v=Math.round(100*a);hi.m=Math.round(100*e);hi.G=Im.G}function Km(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Sm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function Mm(a){return a>Rm?Math.pow(a,1/3):(Qm*a+16)/116}function Pm(a){var b=a*a*a;return b>Rm?b:(116*a-16)/Qm}function nm(a,b){"string"===typeof a?G&&!Bm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof El||v("Value for "+b+" must be a color string or a Brush, not "+a)}function Am(){Cm=$g?(new Si(null,void 0,{willReadFrequently:!0})).context:null} oa.Object.defineProperties(El.prototype,{type:{configurable:!0,get:function(){return this.ta},set:function(a){this._isFrozen&&xa(this,a);$a(a,El,El,"type");this.ta=a;this.start.kc()&&(a===Vl?this.start=Bc:a===Fl&&(this.start=Ic));this.end.kc()&&(a===Vl?this.end=Mc:a===Fl&&(this.end=Ic));this.De=null}},color:{configurable:!0,get:function(){return this.Fk},set:function(a){this._isFrozen&&xa(this,a);G&&!Bm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color'); this.Fk=a;this.De=null}},start:{configurable:!0,get:function(){return this.Od},set:function(a){this._isFrozen&&xa(this,a);x(a,Hb,El,"start");this.Od=a.M();this.De=null}},end:{configurable:!0,get:function(){return this.Tk},set:function(a){this._isFrozen&&xa(this,a);x(a,Hb,El,"end");this.Tk=a.M();this.De=null}},startRadius:{configurable:!0,get:function(){return this.Lr},set:function(a){this._isFrozen&&xa(this,a);D(a,El,"startRadius");0>a&&Ba(a,">= zero",El, "startRadius");this.Lr=a;this.De=null}},endRadius:{configurable:!0,get:function(){return this.cq},set:function(a){this._isFrozen&&xa(this,a);D(a,El,"endRadius");0>a&&Ba(a,">= zero",El,"endRadius");this.cq=a;this.De=null}},colorStops:{configurable:!0,get:function(){return this.Ce},set:function(a){this._isFrozen&&xa(this,a);G&&x(a,xb,El,"colorStops");this.Ce=a;this.De=null}},pattern:{configurable:!0,get:function(){return this.ir},set:function(a){this._isFrozen&& xa(this,a);this.ir=a;this.De=null}}});El.prototype.isDark=El.prototype.Qx;El.prototype.darkenBy=El.prototype.ez;El.prototype.lightenBy=El.prototype.eA;El.prototype.addColorStop=El.prototype.addColorStop;var Rm=216/24389,Qm=24389/27,Nm=[95.047,100,108.883],Cm=null,Im=new ym,hi=new ym,Lm=new ym,Om=new ym,zm=!1;El.className="Brush";var Sl;El.Solid=Sl=new F(El,"Solid",0);var Vl;El.Linear=Vl=new F(El,"Linear",1);var Fl;El.Radial=Fl=new F(El,"Radial",2);var Ul;El.Pattern=Ul=new F(El,"Pattern",4);var Dm; El.Lab=Dm=new F(El,"Lab",5);var Tm;El.HSL=Tm=new F(El,"HSL",6); El.randomColor=function(a,b){void 0===a&&(a=128);G&&(D(a,El,"randomColor:min"),(0>a||255b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+ a};El.isValidColor=Bm;El.lighten=function(a){return Fm(a)};El.lightenBy=Fm;El.darken=function(a){return Gm(a)};El.darkenBy=Gm;El.mix=Hm;El.isDark=Jm;function jm(){this.Da="Base"}jm.prototype.measure=function(){};jm.prototype.hA=function(a,b,c,d,e){a.measure(b,c,d,e)};jm.prototype.arrange=function(){};jm.prototype.Uy=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};jm.prototype.rA=function(a){a.ek()};jm.prototype.hc=function(){}; oa.Object.defineProperties(jm.prototype,{name:{configurable:!0,get:function(){return this.Da},set:function(a){this.Da=a}},classType:{configurable:!0,get:function(){return W}}});jm.prototype.remeasureObject=jm.prototype.rA;jm.prototype.arrangeElement=jm.prototype.Uy;jm.prototype.measureElement=jm.prototype.hA;jm.className="PanelLayout";function Um(){this.Da="Base"}na(Um,jm); Um.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Vm(a);for(var k=0;kaa&&(tb=Math.max(aa-wf,0));var Gk=0===O.ua;O.qc=O.qc+tb;O.actual=O.ua+tb;aa=Math.max(aa-(tb+(Gk?wf:0)),0)}if(1===uc.columnSpan&&(Yb===xg||Yb===kl)){O=a.getColumnDefinition(Xb);var Ui=O.Xc();tb=Math.max(Zf-O.actual,0);tb+Ui>S&&(tb=Math.max(S-Ui,0));var ho=0===O.ua;O.qc=O.qc+tb;O.actual=O.ua+tb;S=Math.max(S-(tb+(ho?Ui: 0)),0)}vf&&uc.ek()}}}}}Pa(y);var ge=0,Ee=0;f=a.columnCount;for(var Kg=0;Kg=a.rowCount);bf++)O=a.getRowDefinition(cb.row+bf),tb=0,tb=Yb===Ad||Yb===kl?Math.max(O.minimum,0===Hd[cb.row+bf]?O.maximum:Math.min(Hd[cb.row+bf],O.maximum)):Math.max(O.minimum,isNaN(O.Lc)?O.maximum:Math.min(O.Lc,O.maximum)),Xd.height+=tb,Fc+=O.minimum;for(var fd=1;fd=a.columnCount);fd++)O=a.getColumnDefinition(cb.column+fd),tb=0,tb=Yb===Ad||Yb===jl?Math.max(O.minimum,0===Rc[cb.column+fd]?O.maximum:Math.min(Rc[cb.column+fd], O.maximum)):Math.max(O.minimum,isNaN(O.Lc)?O.maximum:Math.min(O.Lc,O.maximum)),Xd.width+=tb,Kk+=O.minimum;wb.width+=Xd.width;wb.height+=Xd.height;var Vh=cb.margin,Bf=Vh.right+Vh.left,Wi=Vh.top+Vh.bottom;cb.measure(wb.width,wb.height,Kk,Fc);for(var Wh=cb.measuredBounds,Yd=Math.max(Wh.width+Bf,0),cg=Math.max(Wh.height+Wi,0),Cf=0,Xh=0;Xh=a.rowCount);Xh++)O=a.getRowDefinition(cb.row+Xh),Cf+=O.total||0;if(Cf=cf)&&!(cb.row+He>=a.rowCount);He++){O=a.getRowDefinition(cb.row+He);var ef=O.ua||0,ff=df(cb,O,ie);G&&"number"!==typeof ff&&v(cb+" spanAllocation does not return a number: "+ff);O.actual=Math.min(O.maximum,ef+ff);O.ua!==ef&&(cf-=O.ua-ef)}for(;0Id&&(O.actual=Math.min(O.maximum,Id+cf),O.ua!==Id&&(cf-=O.ua-Id));if(0===O.index)break;O=a.getRowDefinition(O.index-1)}}for(var Ng=0,gf=0;gf=a.columnCount);gf++)O= a.getColumnDefinition(cb.column+gf),Ng+=O.total||0;if(Ng=Og)&&!(cb.column+dg>=a.columnCount);dg++){O=a.getColumnDefinition(cb.column+dg);var Xi=O.ua||0,Yi=Ie(cb,O,jo);G&&"number"!==typeof Yi&&v(cb+" spanAllocation does not return a number: "+Yi);O.actual=Math.min(O.maximum,Xi+Yi);O.ua!==Xi&&(Og-=O.ua-Xi)}for(;0Lk&&(O.actual=Math.min(O.maximum, Lk+Og),O.ua!==Lk&&(Og-=O.ua-Lk));if(0===O.index)break;O=a.getColumnDefinition(O.index-1)}}}}Pa(A);Gb.free(Xd);Gb.free(wb);void 0!==Hd&&Pa(Hd);void 0!==Rc&&Pa(Rc);var Pg=0,Qg=0,Mk=a.desiredSize,Rr=a.maxSize;Yb=xl(a,!0);var Zi=Ee=ge=0,$i=0;f=a.columnCount;for(var Nk=0;Nk=a.rowCount);O++){var la=a.getRowDefinition(y+O);0!==la.ua&&(w.height+=la.total)}for(O=1;O=a.columnCount);O++)la=a.getColumnDefinition(C+O),0!==la.ua&&(w.width+=la.total);var fa=E.ua+w.width,ya=A.ua+w.height;O=h;la=k;var La=fa,sb=ya,vb=h,Wb=k,tb=fa,Ye=ya;h+fa>c.width&&(tb=Math.max(c.width-h,0));k+ya>c.height&&(Ye=Math.max(c.height-k,0));var jb=Z.alignment;if(jb.Rb()){jb=a.defaultAlignment;jb.mb()||(jb=Ic);var Ed=jb.x; var Xb=jb.y;var Ze=jb.offsetX;jb=jb.offsetY;var Jc=E.alignment,dd=A.alignment;Jc.mb()&&(Ed=Jc.x,Ze=Jc.offsetX);dd.mb()&&(Xb=dd.y,jb=dd.offsetY)}else Ed=jb.x,Xb=jb.y,Ze=jb.offsetX,jb=jb.offsetY;if(isNaN(Ed)||isNaN(Xb))Xb=Ed=.5,jb=Ze=0;Jc=R.width;dd=R.height;var Cc=Z.margin,uc=Cc.left+Cc.right,vf=Cc.top+Cc.bottom,Fd=Zl(Z,A,E,!1);!isNaN(Z.desiredSize.width)||Fd!==Ad&&Fd!==jl||(Jc=Math.max(fa-uc,0));!isNaN(Z.desiredSize.height)||Fd!==Ad&&Fd!==kl||(dd=Math.max(ya-vf,0));fa=Z.maxSize;ya=Z.minSize;Jc=Math.min(fa.width, Jc);dd=Math.min(fa.height,dd);Jc=Math.max(ya.width,Jc);dd=Math.max(ya.height,dd);fa=dd+vf;O+=La*Ed-(Jc+uc)*Ed+Ze+Cc.left;la+=sb*Xb-fa*Xb+jb+Cc.top;Z.visible&&(lc(vb,Wb,tb,Ye,O,la,R.width,R.height)?Z.arrange(O,la,Jc,dd):Z.arrange(O,la,Jc,dd,new M(vb,Wb,tb,Ye)))}}Gb.free(w);for(a=0;a=c&&(c=1);var d=a.gridCellSize,e=d.width;d=d.height;var f=a.naturalBounds,g=a.actualBounds,h=f.width,k=f.height,l=Math.ceil(h/e),m=Math.ceil(k/d),n=a.gridOrigin,p=n.x;n=n.y;b.save();b.beginPath();b.rect(0,0,h,k);b.clip();b.$e();for(var r=[],q=a.T.s,u=q.length,z=0;zA)){w=mk(w.figure);for(var C=0;CA&&y.push(E))}}}}q= a.T.s;u=q.length;for(z=0;ze*w*c))){A=H.segmentIndex;if(!isFinite(A)||isNaN(A))A=0;0>A&&(A=w-Math.min(-A,w));A=Math.round(A%w);w=H.opacity;C=1;if(1!==w){if(0===w)continue;C=b.globalAlpha;b.globalAlpha=C*w}E=r[z];var S=!1,aa=H.strokeDashArray;null!==aa&&(S=!0,b.ps(aa,H.strokeDashOffset));if("LineV"===H.figure&&null!==H.stroke&&0b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;en)y.measure(Infinity,Infinity,0,0),A=y.measuredBounds,c.ed(A),r.push(A);else{var C=y.segmentIndex,E=y.segmentFraction,H=y.alignmentFocus;H.kc()&&(H=Ic);var S=y.segmentOrientation,aa=y.segmentOffset;if(isNaN(C)){var Z=k.Aa;A=Na();Z.av(E,A);var R=K.allocAt(A[0],A[1]);R.add(k.i(0));Z.type=== N.j?R.offset(-Z.startX,-Z.startY):(Z=Z.figures.first(),null!==Z&&R.offset(-Z.startX,-Z.startY));Z=A[2];if(S!==lg){var O=k.computeAngle(y,S,Z);y.Nb=O}O=R.x-b.x;var la=R.y-b.y;K.free(R);Pa(A)}else if(C<-n||C>=n)A=K.alloc(),k.Dg(),k.computeMidPoint(A),Z=k.midAngle,S!==lg&&(O=k.computeAngle(y,S,Z),y.Nb=O),O=A.x-b.x,la=A.y-b.y,K.free(A);else{O=0;0<=C?(la=m.O(C),A=Cfa+10?0<=C?Z.fb(la):la.fb(Z):fa>R+10?0<=C?A.fb(O):O.fb(A):0<=C?Z.fb(O):O.fb(Z)}else Z=0<=C?la.fb(A):A.fb(la);S!==lg&&(O=k.computeAngle(y,S,Z),y.Nb=O);O=la.x+(A.x-la.x)*E-b.x;la=la.y+(A.y-la.y)*E-b.y}y.measure(Infinity,Infinity,0,0);A=y.measuredBounds;R=y.naturalBounds;var ya=0;y instanceof Pf&&(ya=y.strokeWidth);fa=R.width+ya;var La=R.height+ya;q.reset();q.translate(-A.x,-A.y);q.scale(y.scale,y.scale);q.rotate(S===lg?y.angle:Z,fa/2,La/2);S!==nn&&S!==on||q.rotate(90, fa/2,La/2);S!==pn&&S!==qn||q.rotate(-90,fa/2,La/2);S===rn&&(45Z||225Z)&&q.rotate(-Z,fa/2,La/2);R=new M(0,0,fa,La);u.Hi(R,H);q.Ma(u);H=-u.x+ya/2*y.scale;y=-u.y+ya/2*y.scale;z.assign(aa);ya=isNaN(aa.x);var sb=isNaN(aa.y);if(ya||sb){fa=fa/2+3;La=La/2+3;var vb=45<=Z&&135>=Z,Wb=225<=Z&&315>=Z;S===lg&&(vb||Wb)?(z.x=sb?fa:aa.y,z.y=ya?La:aa.x,vb?0<=C||isNaN(C)&&.5>E||!ya||(z.y=-La):Wb&&((0<=C||isNaN(C)&&.5>E)&&ya&&(z.y=-La),sb&&(z.x=-fa))):(ya&&(z.x=0<=C||isNaN(C)&&.5>E?fa:-fa),sb&&(z.y=-La), z.rotate(Z))}else z.rotate(Z);O+=z.x;la+=z.y;R.set(A);R.h(O+H,la+y,A.width,A.height);r.push(R);c.ed(R)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.rg=c;a.position.h(b.x+c.x,b.y+c.y);ac(e,c.width||0,c.height||0);Ib.free(q);K.free(u);K.free(z)}}}}; ln.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Be||a instanceof T){var d=a,e=null;a instanceof Be&&(e=a,d=e.adornedPart);var f=a instanceof Be?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)q=K.alloc(),r=n,z=q,r.Dg(),r.computeMidPoint(z),r=n.midAngle,l!==lg&&(n=n.computeAngle(g,l,r),g.angle=n),n=q.x,z=q.y, K.free(q);else{u=0;0<=h?(q=b.s[h],z=hy+10?0<=h?r.fb(q):q.fb(r):y>w+10?0<=h?z.fb(u):u.fb(z):0<=h?r.fb(u):u.fb(r)}else r=0<=h?q.fb(z):z.fb(q);l!==lg&&(n=n.computeAngle(g,l,r),g.angle=n);n=q.x+(z.x-q.x)*k;z=q.y+(z.y-q.y)*k}if(p.ep())g.location=new K(n,z);else{p.kc()&&(p=Ic);q=Ib.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle, 0,0);var A=g.naturalBounds;u=M.allocAt(0,0,A.width,A.height);w=K.alloc();w.Hi(u,p);q.Ma(w);p=-w.x;y=-w.y;var C=A.width,E=A.height;A=K.alloc();A.assign(m);var H=isNaN(m.x),S=isNaN(m.y);if(H||S){C=C/2+3;E=E/2+3;var aa=45<=r&&135>=r,Z=225<=r&&315>=r;l===lg&&(aa||Z)?(A.x=S?C:m.y,A.y=H?E:m.x,aa?0<=h||isNaN(h)&&.5>k||!H||(A.y=-E):Z&&((0<=h||isNaN(h)&&.5>k)&&H&&(A.y=-E),S&&(A.x=-C))):(H&&(A.x=0<=h||isNaN(h)&&.5>k?C:-C),S&&(A.y=-E),A.rotate(r))}else A.rotate(r);n+=A.x;z+=A.y;q.xp(u);p+=u.x;y+=u.y;h=K.allocAt(n+ p,z+y);g.move(h);K.free(h);K.free(A);K.free(w);M.free(u);Ib.free(q)}}null!==e?e.dm(!1):d.dm(!1);d=sn(a);a.location.h(a.position.x+d.x,a.position.y+d.y);K.free(d)}}; function mn(a,b,c,d){if(!1!==Gj(d)){var e=d.strokeWidth;0===e&&a instanceof Be&&a.type===W.Link&&a.adornedObject instanceof Pf&&(e=a.adornedObject.strokeWidth);e*=d.Ga;a instanceof T&&null!==a.Aa?(a=a.geometry.bounds,d.Ne(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Be&&null!==a.adornedPart.Aa?(a=a.adornedPart.Aa.bounds,d.Ne(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Ne(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.u()||null===d.Aa?d.fc.h(0,0,e.width,e.height):d.fc.assign(d.Aa.bounds);Bj(d,!1)}} function tn(){this.Da="Base"}na(tn,jm); tn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.yb();a.graduatedBounds=[];var k=h.margin,l=k.right+k.left,m=k.top+k.bottom;h.measure(b,c,f,g);var n=h.measuredBounds,p=new M(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.graduatedBounds.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,z=r.flattenedLengths,w=r.flattenedTotalLength,y=u.length,A=0,C=0,E=Na(),H=0;Hfa&&(fa+=360);aa.push(fa)}A=O;C=la}E.push(aa)}if(null===a.graduatedIntervals){for(var ya=[],La=a.T.s,sb=La.length,vb=0;vbYe))for(var jb=0;jbYe&&tb.push(Xb)}}}}a.graduatedIntervals=ya}var Ze=a.graduatedIntervals;var Jc=a.T.s,dd=Jc.length,Cc=0,uc=0,vf=w;a.graduatedMarks= [];for(var Fd,Oh=0;OhTi*Yb*w/a.graduatedRange&&null===Dc.graduatedSkip)){var Jg=z[0][0],Ud=0,vc=0;uc=w*Dc.graduatedStart-1E-4;vf=w*Dc.graduatedEnd+1E-4;var Zf=Ti*Yb,Ec=a.graduatedTickBase;if(Eca.graduatedMin+Zf&&(Ec-=Math.floor((Ec-a.graduatedMin)/Zf)*Zf);for(var Gk=Ze[Oh],Ui=Ec,ho=1E-6*a.graduatedMax, ge=1;Ec<=a.graduatedMax+ho;ge++){a:{for(var Ee=Gk.length,Kg=0;Kg-Ph){var yf=!1;break a}}yf=!0}if(yf&&(Ec>a.graduatedMax&&(Ec=a.graduatedMax),null===Dc.graduatedSkip||Dc instanceof bh&&!Dc.graduatedSkip(Ec,Dc)||Dc instanceof Pf&&!Dc.graduatedSkip(Ec,Dc))&&(Cc=(Ec-a.graduatedMin)*w/a.graduatedRange,Cc>w&&(Cc=w),uc<=Cc&&Cc<=vf)){for(var he=E[Ud][vc],$e=z[Ud][vc];UdJg&&vc< z[Ud].length-1;)vc++,he=E[Ud][vc],$e=z[Ud][vc],Jg+=$e;if(Cc<=Jg)break;Ud++;vc=0;he=E[Ud][vc];$e=z[Ud][vc];Jg+=$e}var wc=u[Ud],Vd=wc[2*vc],Hk=wc[2*vc+1],Fe=(Cc-(Jg-$e))/$e,Qh=new K(Vd+(wc[2*vc+2]-Vd)*Fe+q/2-r.bounds.x,Hk+(wc[2*vc+3]-Hk)*Fe+q/2-r.bounds.y);Qh.scale(h.scale,h.scale);a:{var Gd=he,$f=E[Ud];if(!(.5005>Fe&&.4995Fe?0Fe||.9995Lg){var Rh=1-Math.abs(.5-Fe);he=(Gd*Rh+Wd*(1-Rh))%360;break a}}}he=Gd}if(Dc instanceof bh){var pd="";null!==Dc.graduatedFunction?(pd=Dc.graduatedFunction(Ec,Dc),pd=null!==pd&&void 0!==pd?pd.toString():""):pd=(+Ec.toFixed(2)).toString();""!==pd&&Fd.push({jm:Qh,angle:he,text:pd})}else Fd.push({jm:Qh,angle:he})}Ec=Ui+ge*Zf}}}a.graduatedMarks.push(Fd)}Pa(E); var wb=a.graduatedMarks;if(null!==wb)for(var Vi=d.length,jc=0;jcqd;qd++){switch(qd){case 0:xc.h(Xd,Hd);break;case 1:xc.h(Xd+Sh,Hd);break;case 2:xc.h(Xd,Hd+bg);break;case 3:xc.h(Xd+Sh,Hd+bg)}xc.rotate(cb+kb.angle);xc.offset(Jk,Uh);0===Th&&0===qd?Rc.h(xc.x,xc.y,0,0):Rc.gf(xc);xc.offset(-Jk,-Uh);xc.rotate(-cb-kb.angle)}K.free(xc);null!==Ge.graduatedBounds&&Ge.graduatedBounds.push(Rc);ic(af,Rc.x,Rc.y,Rc.width,Rc.height)}else if(kb instanceof bh){var ed=a,Kk=e;null===ed.temporaryTextBlock&&(ed.temporaryTextBlock=new bh);var Fc=ed.temporaryTextBlock;un(Fc,kb); var bf=kb.alignmentFocus;bf.kc()&&(bf=Bc);for(var fd=kb.segmentOrientation,Vh=kb.segmentOffset,Bf=new M,Wi=0,Wh=0,Yd=0,cg=0,Cf=0,Xh=kc.length,cf=0;cfYd||225Yd)&&Id.rotate(-Yd,ef/2,ff/2);var Ng=M.allocAt(0,0,ef,ff),gf=K.alloc();gf.Hi(Ng,bf);Id.Ma(gf);var Og=-gf.x,jo=-gf.y,Ie=K.alloc();Ie.assign(Vh);isNaN(Ie.x)&&(Ie.x=ef/2+3);isNaN(Ie.y)&&(Ie.y=-(ff/2+3));Ie.rotate(Yd);Wi+=Ie.x+Og;Wh+=Ie.y+jo;var dg=new M(Wi,Wh,df.width,df.height),Xi=new M(df.x,df.y,df.width,df.height),Yi=new M(He.x,He.y,He.width,He.height); ie.bA=cg;ie.lineCount=Fc.lineCount;ie.lines=[Fc.Hb,Fc.Qh,Fc.mf,Fc.Se,Fc.Tc,Fc.bc,Fc.Fe];ie.actualBounds=dg;ie.measuredBounds=Xi;ie.naturalBounds=Yi;0===cf?Bf.assign(dg):Bf.ed(dg);K.free(Ie);K.free(gf);M.free(Ng);Ib.free(Id)}null!==ed.graduatedBounds&&ed.graduatedBounds.push(Bf);ic(Kk,Bf.x,Bf.y,Bf.width,Bf.height)}Bj(kb,!1)}}}; tn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.yb(),e=a.graduatedMarks;if(null!==e){var f=a.graduatedBounds,g=0,h=f[g];g++;null!==d&&d.arrange(h.x-c.x,h.y-c.y,h.width,h.height);for(var k=b.length,l=0;l=g&&(g=1);for(var h=f.actualBounds,k=a.T.s,l=a.graduatedMarks,m=k.length,n=0;na.graduatedTickUnit*p.interval*f.geometry.flattenedTotalLength/a.graduatedRange*g&&null===p.graduatedSkip)){var u= p.measuredBounds,z=p.strokeWidth*p.scale,w=p.alignmentFocus;w.kc()&&(w=Bc);for(var y=0;yg.height)continue}else if(l.position>g.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var n=l.separatorStroke;null===n&&(n=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(0!==m&&null!==n){ui(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray; null===p&&(p=c?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray);null!==p&&(n=!0,b.ps(p,0));b.beginPath();p=l.position+m;c?p>g.height&&(m-=p-g.height):p>g.width&&(m-=p-g.width);l=l.position+m/2;b.lineWidth=m;m=a.Db;c?(l+=m.top,p=g.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=g.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();b.$e();n&&b.ms()}}}} function yn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=An(a,!0),l=An(a,!1),m=0;mp)){var r=n.Xc(),q=n.separatorStrokeWidth;isNaN(q)&&(q=c?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var u=n.separatorStroke;null===u&&(u=c?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke);if(null===u||n.index===(c?k:l))q=0;r-= q;q=n.position+q;r+=n.actual;q+r>p&&(r=p-q);0>=r||(p=a.Db,ui(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,q+p.top,g.width-(p.left+p.right),r):b.fillRect(q+p.left,p.top,r,g.height-(p.top+p.bottom)))}}}}function An(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;dd&&e.set(q),K.free(q));K.free(m);f&&e.transform(g);return l}; t.Rj=function(){for(var a=this.T.s,b=a.length,c=0;cc||f>d)this.w(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Ad:this.w(!0);this.measure(c+h,d+g,0,0);break;case jl:this.w(!0);this.measure(c+h,f+g,0,0);break;case kl:this.w(!0),this.measure(b+h,d+g,0,0)}}this.ta.arrange(this,e,this.rg)}}; t.mh=function(a){var b=this.naturalBounds,c=Vm(this);if(lc(0,0,b.width,b.height,a.x,a.y)){b=this.T.s;for(var d=b.length,e=K.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Jb(e.set(a),f.transform),f.ha(e))return K.free(e),!0}K.free(e);return null===this.Wa&&null===this.areaBackground?!1:!0}return!1};t.qs=function(a){if(this.bindingId===a)return this;for(var b=this.T.s,c=b.length,d=0;dp.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof W?m:null;p=Ib.alloc();p.set(g); if(null!==m?m.Lf(a,b,c,d,e,p):wl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Ib.free(p)}}}void 0===f&&Ib.free(g);return d}void 0===f&&Ib.free(g);return!1};function Hn(a,b,c,d){for(var e=a.T.s,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof W&&Hn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.wg=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var g=this.naturalBounds,h=this.we(),k=h?a:Jb(K.allocAt(a.x,a.y),this.transform),l=h?b:Jb(K.allocAt(b.x,b.y),this.transform),m=k.Kf(l),n=0z.width||u.y>z.height||0>u.x+u.width||0>u.y+u.height))if(q.we()?(u=q.transform,Jb(k.set(a),u),Jb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof W?q:null,null!==q?q.wg(k,l,c,d,e,f):u.Cx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}K.free(k);K.free(l)}return e?n:g}return!1}; function an(a){var b=null;a instanceof Pf&&(b=a.spot1,b===gd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Ac);return b}function bn(a){var b=null;a instanceof Pf&&(b=a.spot2,b===gd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Nc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; e.tb(f);d=f}else v("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Jb(a,b);if(0===a||b.isPanelMain)this.fh=null;Gj(this)||this.w();b.w(!1);null!==b.portId?this.af=!0:b instanceof W&&!0===b.af&&(this.af=!0);this.graduatedIntervals=null;this.Rf()||In(this,b,!1);c=this.part;null!==c&&(c.Zh=null,c.ig=NaN,this.af&&c instanceof V&&(c.af=!0),c.af&&c instanceof V&&(c.zc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& c.jb(se,"elements",this,b,null,d,null),c.jb(re,"elements",this,null,b,null,a)))};function Jn(a,b){a.o=b?a.o|16777216:a.o&-16777217}t.remove=function(a){x(a,P,W,"remove:element");for(var b=this.T.s,c=b.length,d=-1,e=0;ea&&Ba(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new ik;c.Gi(this);c.isRow=!0;c.index=a;b[a]=c;this.jb(re,"rowdefs",this,null,c,null,a)}return b[a]}; W.prototype.xA=function(a){G&&D(a,W,"removeRowDefinition:idx");0>a&&Ba(a,">= 0",W,"removeRowDefinition:idx");if(0!==this.rowCount){a=Math.round(a);var b=this.rowDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.jb(se,"rowdefs",this,c,null,a,null);this.w()}}};function jk(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof ik?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} W.prototype.getColumnDefinition=function(a){G&&D(a,W,"getColumnDefinition:idx");0>a&&Ba(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new ik;c.Gi(this);c.isRow=!1;c.index=a;b[a]=c;this.jb(re,"coldefs",this,null,c,null,a)}return b[a]}; W.prototype.sA=function(a){G&&D(a,W,"removeColumnDefinition:idx");0>a&&Ba(a,">= 0",W,"removeColumnDefinition:idx");if(0!==this.columnCount){a=Math.round(a);var b=this.colDefs,c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.jb(se,"coldefs",this,c,null,a,null);this.w()}}};function kk(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof ik?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} W.prototype.addRowColumnDefinition=function(a){var b=null;a.isRow?b=this.getRowDefinition(a.index):a.isRow||(b=this.getColumnDefinition(a.index));b&&im(b,a);return this};t=W.prototype;t.zz=function(a){if(0>a||this.type!==W.Table||0===this.rowCount)return-1;for(var b=0,c=this.rowDefs,d=c.length,e=this.topIndex;ea||this.type!==W.Table||0===this.columnCount)return-1;for(var b=0,c=this.colDefs,d=c.length,e=this.leftIndex;e=c.elements.count&&!(c instanceof U)){var d=!1;if(1===c.elements.count&&(d=null!==c.itemArray,!d))for(h=b.iterator;h.next();)if("itemArray"===h.value.targetProperty){d=!0;break}d||(Fa("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),Ln=!0)}}))} t.cz=function(a){void 0===a&&(a=!1);var b=this.copy();Cn(b,function(a){a instanceof W&&(a.allBindings=null,a.zb=null);var b=a.localBindings;null!==b&&(a.localBindings=null,b.each(function(b){a.bind(b.copy())}));b=a.animationTriggers;null!==b&&(a.animationTriggers=null,b.each(function(b){a.Qv(b.value.copy())}))});a&&wg(b);return b}; t.Ra=function(a){var b=this.allBindings;if(null!==b)for(void 0===a&&(a=""),b=b.iterator;b.next();){var c=b.value,d=c.sourceProperty;if(""===a||""===d||d===a)if(d=c.targetProperty,null!==c.converter||""!==d){d=this.data;var e=c.sourceName;if(null!==e)if(""===e)d=this;else if("/"===e)d=this;else if("."===e)d=this;else if(".."===e)d=this;else{if(d=this.lb(e),null===d){G&&Fa("Binding error: missing GraphObject named "+e+" in "+this.toString());continue}}else if(c.isToModel)if(d=this.diagram,null!==d)d= d.model.modelData;else continue;var f=this,g=c.Ki;if(-1!==g){if(f=this.qs(g),null===f)continue}else null!==c.xd&&(f=c.xd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.Bo;if(0!==e){if(!(f instanceof W))continue;1===e?f=f.getColumnDefinition(c.Fl):2===e&&(f=f.getRowDefinition(c.Fl))}void 0!==f&&c.Tv(f,d)}}};t.Bx=function(a){if(void 0===a||null===a||null===this.ie)return null;B(a,"object",W,"findItemPanelForData");return this.ie.L(a)}; function Mn(a,b){a=a.T.s;for(var c=a.length,d=b.length,e=0,f=null;ea;)this.sc(this.T.length-1,!1);Nn(this,this.itemArray)}; function Nn(a,b){var c=Fn(a);if(null===b||0===b.length)for(;a.T.length>c;)a.sc(a.T.length-1,!1);else if(a.T.length<=c){c=b.length;for(var d=0;dc)){var e=Pn(a,b);e=Qn(a,e);if(null!==e){wg(e);e=e.copy();if(0!==(e.o&16777216)){var f=a.oh();null!==f&&Jn(f,!0)}"object"===typeof b&&(null===a.ie&&(a.ie=new xb),a.ie.add(b,e));f=c+Fn(a);a.Jb(f,e);d&&(e.zb=b,Rn(a,f,c),e.zb=null);e.data=b}}} function Rn(a,b,c){for(a=a.T;ba&&Ba(a,">= 0",W,"padding"), a=new fc(a)):(x(a,fc,W,"padding"),0>a.left&&Ba(a.left,">= 0",W,"padding:value.left"),0>a.right&&Ba(a.right,">= 0",W,"padding:value.right"),0>a.top&&Ba(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&Ba(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.Db;b.D(a)||(this.Db=a=a.M(),this.w(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.cn},set:function(a){var b=this.cn;b.D(a)||(G&&x(a,Hb,W,"defaultAlignment"),this.cn=a=a.M(),this.w(),this.g("defaultAlignment", b,a))}},defaultStretch:{configurable:!0,get:function(){return this.cg},set:function(a){var b=this.cg;b!==a&&($a(a,P,W,"defaultStretch"),this.cg=a,this.w(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return null!==this.W?this.W.Xp:tc},set:function(a){"number"===typeof a?a=new fc(a):G&&x(a,fc,W,"defaultSeparatorPadding");var b=this.defaultSeparatorPadding;b.D(a)||(a=a.M(),null===this.W&&(this.W=new Wn),this.W.Xp=a,this.w(),this.g("defaultSeparatorPadding", b,a))}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return null!==this.W?this.W.ma:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof El)&&(a instanceof El&&a.freeze(),null===this.W&&(this.W=new Wn),this.W.ma=a,this.R(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return null!==this.W?this.W.Na:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth; b!==a&&isFinite(a)&&0<=a&&(null===this.W&&(this.W=new Wn),this.W.Na=a,this.w(),this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return null!==this.W?this.W.Z:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",W,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea)&&v("Panel.topIndex must be greater than zero and a real number, not: "+a),null===this.W&&(this.W=new Wn),this.W.Kb=a,this.w(),this.g("topIndex",b,a))}},leftIndex:{configurable:!0,get:function(){return null!==this.W?this.W.ob:0},set:function(a){var b= this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+a),null===this.W&&(this.W=new Wn),this.W.ob=a,this.w(),this.g("leftIndex",b,a))}},data:{configurable:!0,get:function(){return this.zb},set:function(a){var b=this.zb;if(b!==a){var c=this instanceof U&&!(this instanceof Be);c&&B(a,"object",W,"data");wg(this);this.zb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof T?(null!==b&&c.kf.remove(b),null!==a&&c.kf.add(a, this)):this instanceof U&&(null!==b&&c.lf.remove(b),null!==a&&c.lf.add(a,this))):(c=this.panel,null!==c&&null!==c.ie&&(null!==b&&c.ie.remove(b),null!==a&&c.ie.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Ra()}}},itemIndex:{configurable:!0,get:function(){return this.Hn},set:function(a){var b=this.Hn;b!==a&&(this.Hn=a,this.g("itemIndex",b,a))}},allBindings:{configurable:!0,get:function(){return null!==this.B?this.B.ub:null},set:function(a){this.localBindings!== a&&(null===this.B&&(this.B=new rl),this.B.ub=a)}},itemArray:{configurable:!0,get:function(){return this.Ph},set:function(a){G&&null!==a&&!Array.isArray(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var b=this.Ph;if(b!==a||null!==a&&Mn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&Zj(c.partManager,this,c),this.Ph=a,null!==c&&null!==a&&Wj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||Nn(this,a)}}},itemTemplate:{configurable:!0, enumerable:!0,get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.L("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new xb}var b=this.itemTemplateMap.L("");b!==a&&(x(a,W,W,"itemTemplate"),(a instanceof U||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.vv())}},itemTemplateMap:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.Sc:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){x(a,xb,W,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;G&&(d instanceof U||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}ql(this);this.B.Sc=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.vv()}}},itemCategoryProperty:{configurable:!0,get:function(){return null!== this.B?this.B.Rc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&("string"!==typeof a&&"function"!==typeof a&&Aa(a,"string or function",W,"itemCategoryProperty"),ql(this),this.B.Rc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(B(a,"boolean",W,"isAtomic"),this.o^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0,get:function(){return 0!== (this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&(B(a,"boolean",W,"isClipping"),!a||this.type===W.Spot||this instanceof Df||Fa("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString())),this.o^=2097152,this instanceof Df&&(this.pb=null),this.w(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.o&33554432)},set:function(a){var b=0!==(this.o&33554432);b!==a&&(B(a,"boolean",W,"isOpposite"),this.o^=33554432,this.w(), this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);if(b!==a){B(a,"boolean",W,"isEnabled");var c=null===this.panel||this.panel.Rf();this.o^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&In(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.hf},set:function(a){var b=this.hf;b!==a&&(G&&B(a,"string",W,"alignmentFocusName"), this.hf=a,this.w(),this.g("alignmentFocusName",b,a))}}}); oa.Object.defineProperties(W,{Position:{configurable:!0,get:function(){return hm.L("Position")}},Horizontal:{configurable:!0,get:function(){return hm.L("Horizontal")}},Vertical:{configurable:!0,get:function(){return hm.L("Vertical")}},Spot:{configurable:!0,get:function(){return hm.L("Spot")}},Auto:{configurable:!0,get:function(){return hm.L("Auto")}},Table:{configurable:!0,get:function(){return hm.L("Table")}},Viewbox:{configurable:!0, enumerable:!0,get:function(){return hm.L("Viewbox")}},TableRow:{configurable:!0,get:function(){return hm.L("TableRow")}},TableColumn:{configurable:!0,get:function(){return hm.L("TableColumn")}},Link:{configurable:!0,get:function(){return hm.L("Link")}},Grid:{configurable:!0,get:function(){return hm.L("Grid")}},Graduated:{configurable:!0,get:function(){return hm.L("Graduated")}}});W.prototype.rebuildItemElements=W.prototype.vv; W.prototype.findItemPanelForData=W.prototype.Bx;W.prototype.updateTargetBindings=W.prototype.Ra;W.prototype.copyTemplate=W.prototype.cz;W.prototype.graduatedValueForPoint=W.prototype.Rz;W.prototype.graduatedPointForValue=W.prototype.Qz;W.prototype.findColumnForLocalX=W.prototype.qz;W.prototype.findRowForLocalY=W.prototype.zz;W.prototype.removeColumnDefinition=W.prototype.sA;W.prototype.removeRowDefinition=W.prototype.xA;W.prototype.removeAt=W.prototype.tb;W.prototype.remove=W.prototype.remove; W.prototype.insertAt=W.prototype.Jb;W.prototype.elt=W.prototype.O;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.lb;W.prototype.findInVisualTree=W.prototype.Wl;W.prototype.walkVisualTreeFrom=W.prototype.uk;W.prototype.findMainElement=W.prototype.yb;var Ln=!1,Tn=!1,Un=null,hm=new xb;W.className="Panel";W.definePanelLayout=Vn;Vn("Position",new Um);Vn("Vertical",new Xm);Vn("Auto",new $m);Vn("Link",new ln); function Xn(){this.rq=0;this.G=100;this.ma=10;this.Z=0;this.hi=this.m=this.j=this.v=null}Xn.prototype.copy=function(){var a=new Xn;a.rq=this.rq;a.G=this.G;a.ma=this.ma;a.Z=this.Z;a.v=this.v;a.j=this.j;a.m=this.m;a.hi=this.hi;return a};Xn.className="GradPanelSettings";function Wn(){this.Sc=[];this.Rc=[];this.j=this.vb=Yn;this.ob=this.Kb=0;this.Xp=tc;this.Na=1;this.Z=this.ma=null;this.G=1;this.ub=this.m=this.v=null} Wn.prototype.copy=function(a){for(var b=new Wn,c=this.Sc,d=c.length,e=b.Sc,f=0;fa&&Ba(a,">= 0",ik,"height"),this.Lc=a,this.actual=this.ua,null!== this.panel&&this.panel.w(),this.Qb("height",b,a))}},width:{configurable:!0,get:function(){return this.Lc},set:function(a){var b=this.Lc;b!==a&&(G&&B(a,"number",ik,"width"),0>a&&Ba(a,">= 0",ik,"width"),this.Lc=a,this.actual=this.ua,null!==this.panel&&this.panel.w(),this.Qb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.uj},set:function(a){var b=this.uj;b!==a&&(G&&B(a,"number",ik,"minimum"),(0>a||!isFinite(a))&&Ba(a,">= 0",ik,"minimum"),this.uj=a,this.actual= this.ua,null!==this.panel&&this.panel.w(),this.Qb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.sj},set:function(a){var b=this.sj;b!==a&&(G&&B(a,"number",ik,"maximum"),0>a&&Ba(a,">= 0",ik,"maximum"),this.sj=a,this.actual=this.ua,null!==this.panel&&this.panel.w(),this.Qb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Mb},set:function(a){var b=this.Mb;b.D(a)||(G&&x(a,Hb,ik,"alignment"),this.Mb=a.M(),null!==this.panel&&this.panel.w(), this.Qb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.pg},set:function(a){var b=this.pg;b!==a&&(G&&$a(a,P,ik,"stretch"),this.pg=a,null!==this.panel&&this.panel.w(),this.Qb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.lg},set:function(a){"number"===typeof a?a=new fc(a):null!==a&&G&&x(a,fc,ik,"separatorPadding");var b=this.lg;null!==a&&null!==b&&b.D(a)||(null!==a&&(a=a.M()),this.lg=a,null!==this.panel&&this.panel.w(), this.Qb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.to},set:function(a){var b=this.to;b!==a&&(null!==a&&nm(a,"RowColumnDefinition.separatorStroke"),a instanceof El&&a.freeze(),this.to=a,null!==this.panel&&this.panel.w(),this.Qb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.uo},set:function(a){var b=this.uo;b!==a&&(this.uo=a,null!==this.panel&&this.panel.w(),this.Qb("separatorStrokeWidth", b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.Ej},set:function(a){var b=this.Ej;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",ik,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ee)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,z=Na(),w=2;wn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;w=0;q=z[w];n=q[0];r=q[1];p=q[2];q=q[3];for(var y=0;.1<=u;){0===y&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1)); if(e>u){Pa(z);return}e>q?(y=e-q,e=q):y=0;var A=Math.sqrt(e*e/(1+p*p));0>n&&(A=-A);h+=A;k+=p*A;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===y&&d.nh(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==y){w++;if(w===z.length){Pa(z);return}q=z[w];n=q[0];r=q[1];p=q[2];q=q[3];e=y}}Pa(z)}} t.nh=function(a,b){var c=this.Ac,d=this.dj;if(null!==c||null!==d){var e=this.Aa;if(null!==e){a.Bc();var f=this.actualBounds,g=this.naturalBounds;null!==d&&ui(this,a,d,!0,!1,g,f);var h=this.part,k=this.qg;null===c||0!==k||null===h||!this.isPanelMain&&h.yb()!==this||(k=h.type===W.Link&&h instanceof Be&&"Selection"===h.category&&h.adornedObject instanceof Pf&&h.adornedPart.yb()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(ui(this,a,c,!1,!1,g,f),a.lineWidth=k,a.lineJoin= this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit);f=!1;h&&b.Pf("drawShadows")&&(f=h.isShadowed);!1===a.Rl&&(f=!1);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.ps(k,this.strokeDashOffset));if(e.type===N.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.rk(),a.$e();else if(e.type===N.v){var l=e.startX;k=e.startY;var m=e.endX,n=e.endY;e=Math.min(l,m);var p=Math.min(k,n);l=Math.abs(m-l);k=Math.abs(n- k);a.beginPath();a.rect(e,p,l,k);null!==d&&a.vg(d);null!==c&&(h&&f&&Il(a),a.rk(),h&&f&&Hl(a));a.$e()}else if(e.type===N.G)l=e.startX,k=e.startY,m=e.endX,n=e.endY,e=Math.abs(m-l)/2,p=Math.abs(n-k)/2,l=Math.min(l,m)+e,k=Math.min(k,n)+p,a.beginPath(),a.moveTo(l,k-p),a.bezierCurveTo(l+L.Eg*e,k-p,l+e,k-L.Eg*p,l+e,k),a.bezierCurveTo(l+e,k+L.Eg*p,l+L.Eg*e,k+p,l,k+p),a.bezierCurveTo(l-L.Eg*e,k+p,l-e,k+L.Eg*p,l-e,k),a.bezierCurveTo(l-e,k-L.Eg*p,l-L.Eg*e,k-p,l,k-p),a.closePath(),null!==d&&a.vg(d),null!==c&& (h&&f&&Il(a),a.rk(),h&&f&&Hl(a)),a.$e();else if(e.type===N.m)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=$d(u,l),z=r.length,0===z)a.lineTo(u.centerX,u.centerY);else for(var w=0;w(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;M.free(f);return L.Zb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== N.v){b=c.startX;var g=c.startY,h=c.endX;c=c.endY;f.x=Math.min(b,h);f.y=Math.min(g,c);f.width=Math.abs(h-b);f.height=Math.abs(c-g);if(null===this.fill){f.Ec(-d,-d);if(f.ha(a))return M.free(f),!1;f.Ec(d,d)}null!==this.stroke&&f.Ec(e,e);a=f.ha(a);M.free(f);return a}if(c.type===N.G){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return M.free(f), !1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);M.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===N.m)return M.free(f),null===this.fill?de(c,a.x,a.y,e):be(c,a,e,1=this.strokeWidth)m=L.df(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b), d=m*b);b=Na();a=new K;L.df(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new K;L.df(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new K;L.df(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new K;L.df(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Pa(b),!1;m=!0;k=Infinity;for(d=0;dMath.abs(c)){k=g-m-c*(f-d);if(0>a*a*c*c+l*l-k*k){e.x=NaN;e.y=NaN;m=!1;break a}n=Math.sqrt(a*a*c*c+l*l-k*k);h=(-(a*a*c*k)+a*l*n)/(l*l+a*a*c*c)+d;a=(-(a*a*c*k)-a*l*n)/(l*l+a*a*c*c)+d;l=c*(h-d)+k+m;k=c* (a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))h){e.x=NaN;e.y=NaN;m=!1;break a}k=Math.sqrt(h);h=m+k;k=m-k;Math.abs(h-g)Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),w-=q,y-= u;r.contains(w,y);)w-=q,y-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||L.ca(k.y,a))&&(k.yb||L.ca(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.Cx=function(a,b,c){function d(a,b){for(var c=a.length,d=0;de)return!0;return!1}if(c&&null!==this.fill&&this.mh(a,!0))return!0;var e=a.Kf(b),f=e;1.5=e||Lb(b,f,0,-n)>= e||Lb(b,f,0,n)>=e||Lb(b,f,m,0)>=e?!1:!0}else if(b.type===N.m){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.xl&&a.ye&&Kb(a.x,a.y,f,h,k,h)>e&&Kb(a.x,a.y,k,l,f,l)>e&&Kb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?de(b,a.x,a.y,f):be(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;be)return!1;h=f.segments.s;k=h.length;for(l=0;le)return!1;break;case Rd:var p=Na();L.Ye(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Sd:p=Na();L.lp(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.zd(g,m)>e)return!1;break;case Td:case Zd:p=n.type===Td?$d(n,f):ae(n,f,g,m);var r=p.length;if(0===r){g=n.type===Td?n.centerX:n.endX;m=n.type===Td?n.centerY:n.endY;if(a.zd(g,m)> e)return!1;break}n=null;for(var q=Na(),u=0;ub+1E-5||d.bounds.height>c+1E-5)&&v('Geometry made with figure "'+a.figure+'" has bounds '+d.bounds.toString()+" that are too large for the given size ("+b+","+c+"). See documentation for Shape.defineFigureGenerator."); return d};function po(a){var b=oo[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=oo[c];if(void 0===b){var d=null,e;for(e in L.Em)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=N.parse(L.Em[d],!1),oo[d]=a,c!==d&&(oo[c]=d),d}}return"string"===typeof b?b:b instanceof N?a:null} oa.Object.defineProperties(Pf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.Aa?this.Aa:this.Pd},set:function(a){var b=this.Aa,c=this.Pd;if(b!==a){null!==a?(G&&x(a,N,Pf,"geometry"),this.Pd=this.Aa=a.freeze()):this.Pd=this.Aa=null;var d=this.part;null!==d&&(d.ig=NaN);this.w();this.g("geometry",b||c,a);tl(this)&&(a=this.part,null!==a&&ul(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()}, set:function(a){a=N.parse(a);var b=a.normalize();this.geometry=a;this.position=a=K.allocAt(-b.x,-b.y);K.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){G&&B(a,"boolean",Pf,"isGeometryPositioned");var b=0!==(this.o&1048576);b!==a&&(G&&B(a,"boolean",Pf,"isGeometryPositioned"),this.o^=1048576,this.w(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.dj},set:function(a){var b= this.dj;b!==a&&(null!==a&&nm(a,"Shape.fill"),a instanceof El&&a.freeze(),this.dj=a,this.R(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Ac},set:function(a){var b=this.Ac;b!==a&&(null!==a&&nm(a,"Shape.stroke"),a instanceof El&&a.freeze(),this.Ac=a,this.R(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.qg},set:function(a){var b=this.qg;if(b!==a)if(G&&D(a,Pf,"strokeWidth"),0<=a){this.qg=a;this.w();var c=this.part; null!==c&&(c.ig=NaN);this.g("strokeWidth",b,a)}else Ba(a,"value >= 0",Pf,"strokeWidth:value")}},strokeCap:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Mr:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?Ba(a,'"butt", "round", or "square"',Pf,"strokeCap"):($n(this),this.Sa.Mr=a,this.R(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Nr:"miter"}, set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?Ba(a,'"miter", "bevel", or "round"',Pf,"strokeJoin"):($n(this),this.Sa.Nr=a,this.R(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Or:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a)if(G&&D(a,Pf,"strokeMiterLimit"),1<=a){$n(this);this.Sa.Or=a;this.R();var c=this.part;null!==c&&(c.ig=NaN);this.g("strokeMiterLimit", b,a)}else G&&Ba(a,"value >= 1",Pf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.dh},set:function(a){var b=this.dh;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",Pf,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea?a=0:1a?a=0:1(n*n+m*m)*p*p&&(c=!0);b.qb!==a&&(c=!1);b.qb instanceof Oj&& (c=!1);!1===b.Pf("textGreeking")&&(c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case ol:a.translate(e,0);a.scale(-1,1);break;case nl:a.translate(0,f);a.scale(1,-1);break;case pl:a.translate(e,f),a.scale(-1,-1)}a.Bc();m=this.Jc;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.Fe)n=this.Hb,n>e&&(n=e),this.Zj(this.Fe,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Tc&&null!==this.bc)for(p=0;pe&&(r=e);d+=b;this.Zj(this.bc[p], a,0,d,e,g,r,c,h,k,l);d+=g+n}switch(this.flip){case ol:a.scale(-1,1);a.translate(-e,0);break;case nl:a.scale(1,-1);a.translate(0,-f);break;case pl:a.scale(-1,-1),a.translate(-e,-f)}}}; t.Zj=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;if(h)"left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1);else{"left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2);e=null!==xo?xo(this,f):.75*f;b.fillText(a,c+n,d+e);a=f/20|0;0===a&&(a=1);"right"===k?n-=g:"center"===k&&(n-=g/2);if(l){h=null!==yo?yo(this,f):.8*f;k=c+n;l=d+h;e=c+n+g;h=d+h;var p=a;b.beginPath();b.lineWidth=p;b.moveTo(k,l);b.lineTo(e,h);b.stroke();b.$e();b instanceof Oj&&b.Ud.classList.add("gojs-td")}m&&(m= d+f-f/2.2|0,0!==a%2&&(m+=.5),d=c+n,f=m,c=c+n+g,g=m,n=a,b.beginPath(),b.lineWidth=n,b.moveTo(d,f),b.lineTo(c,g),b.stroke(),b.$e(),b instanceof Oj&&b.Ud.classList.add("gojs-td"))}}; t.sk=function(a,b,c){if(!P.prototype.sk.call(this,a,b,c))return!1;ui(this,a,this.Ac,!0,!1,this.naturalBounds,this.actualBounds);if(c){if(0===this.svg.getElementsByTagName("text").length)return!0;b=this.svg.getElementsByClassName("gojs-td");for(c=0;c=this.bc.length))){l=this.bc[k]; for(b=Math.max(1,a-b);Bo(l)>b&&1=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===Jo){a.Se=1;var l=Bo(b);if(0===k||l<=c)a.Hb=Math.max(a.Hb,l),Ho(a,b,a.Hb),null!==d&&d.h(l,h);else{f=Ko(a,g);g=g.substr(f.length);b=Ko(a,g);for(l=Bo(f+b);0 c&&1c;){var n=1;l=Bo(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=Bo(b.substr(0,n));if(1===n){var p=l;f=Math.max(f,l)}else p=m,f=Math.max(f,m);n--;1>n&&(n=1);Ho(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.Jc+k>a.maxLines)break}m=Ko(a,g);for(l=Bo(b+m);0a.maxLines))break}a.Se=Math.min(a.maxLines,k);a.Hb=Math.max(a.Hb,f);null!==d&&d.h(a.Hb,h*a.Se)}} function Ko(a,b){if(a.wrap===Lo)return b.substr(0,1);for(var c=b.length,d=0,e=Mo;d=b.length?b:b.substr(0,d)}function Bo(a){return null===so?8*a.length:so.measureText(a).width}function wo(a){if(null!==a.mf)return a.mf;var b=a.Ge;if(null===so){var c=16;return a.mf=c}void 0!==Oo[b]&&5E3>Po?c=Oo[b]:(c=1.3*so.measureText("M").width,Oo[b]=c,Po++);return a.mf=c} function Eo(a){if(null===so)return 6;if(void 0!==Qo[a]&&5E3>Ro)var b=Qo[a];else b=so.measureText(Fo).width,Qo[a]=b,Ro++;return b} function Co(a,b){var c=a.gc.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,wo(a)+d);if(0===c.length)return a.Hb=0,a.Jc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Jc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.wrap!==Jo){a.Se=0;var k=Gb.alloc();Io(a,f,b,k);e+=k.height;Gb.free(k);a.Jc+=a.Se}else Io(a,f,b,null),e+=d,a.Jc++;a.Jc===a.maxLines&&(h=!0)}f=g+1}return a.Rq=e} oa.Object.defineProperties(bh.prototype,{font:{configurable:!0,get:function(){return this.Ge},set:function(a){var b=this.Ge;b!==a&&(G&&(B(a,"string",bh,"font"),vo(a)||v('Not a valid font: "'+a+'"')),this.Ge=a,this.mf=null,this.w(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.gc},set:function(a){var b=this.gc;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.gc=a,this.w(),this.g("text",b,a),this.fi=!0)}},textAlign:{configurable:!0, get:function(){return null!==this.ia?this.ia.Tr:"start"},set:function(a){var b=this.textAlign;b!==a&&(G&&B(a,"string",bh,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(to(this),this.ia.Tr=a,this.R(),this.g("textAlign",b,a)):G&&Ba(a,'"start", "end", "left", "right", or "center"',bh,"textAlign"))}},flip:{configurable:!0,get:function(){return null!==this.ia?this.ia.fg:xg},set:function(a){var b=this.flip;b!==a&&($a(a,P,bh,"flip"),to(this),this.ia.fg=a,this.R(), this.g("flip",b,a))}},verticalAlignment:{configurable:!0,get:function(){return null!==this.ia?this.ia.ds:jd},set:function(a){var b=this.verticalAlignment;b.D(a)||(G&&(x(a,Hb,bh,"verticalAlignment"),a.kc()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),a=a.M(),to(this),this.ia.ds=a,Yl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.fc.u()){var a=Gb.alloc();Io(this,this.gc,999999,a);var b=a.width; Gb.free(a);a=Co(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);ac(this.fc,b,a)}return this.fc}},isMultiline:{configurable:!0,get:function(){return 0!==(this.o&2097152)},set:function(a){var b=0!==(this.o&2097152);b!==a&&(G&&B(a,"boolean",bh,"isMultiline"),this.o^=2097152,this.w(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return 0!==(this.o&4194304)},set:function(a){var b=0!==(this.o&4194304);b!==a&& (G&&B(a,"boolean",bh,"isUnderline"),this.o^=4194304,this.fi=!0,this.R(),this.g("isUnderline",b,a))}},isStrikethrough:{configurable:!0,get:function(){return 0!==(this.o&8388608)},set:function(a){var b=0!==(this.o&8388608);b!==a&&(G&&B(a,"boolean",bh,"isStrikethrough"),this.o^=8388608,this.fi=!0,this.R(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return null!==this.ia?this.ia.fs:So},set:function(a){var b=this.wrap;b!==a&&(G&&$a(a,bh,bh,"wrap"), to(this),this.ia.fs=a,this.w(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return null!==this.ia?this.ia.fr:To},set:function(a){var b=this.overflow;b!==a&&(G&&$a(a,bh,bh,"overflow"),to(this),this.ia.fr=a,this.w(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Ac},set:function(a){var b=this.Ac;b!==a&&(null!==a&&nm(a,"TextBlock.stroke"),a instanceof El&&a.freeze(),this.Ac=a,this.R(),this.g("stroke",b,a))}},lineCount:{configurable:!0, enumerable:!0,get:function(){return this.Jc}},lineHeight:{configurable:!0,get:function(){return wo(this)}},editable:{configurable:!0,get:function(){return 0!==(this.o&1048576)},set:function(a){var b=0!==(this.o&1048576);b!==a&&(G&&B(a,"boolean",bh,"editable"),this.o^=1048576,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return null!==this.ia?this.ia.Vr:null},set:function(a){var b=this.textEditor;b!==a&&(!G||a instanceof Le||v("TextBlock.textEditor must be an HTMLInfo."), to(this),this.ia.Vr=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0,get:function(){return null!==this.ia?this.ia.Fd:null},set:function(a){var b=this.errorFunction;b!==a&&(null!==a&&B(a,"function",bh,"errorFunction"),to(this),this.ia.Fd=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return null!==this.ka?this.ka.al:1},set:function(a){var b=this.interval;G&&D(a,bh,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.ka&& (this.ka=new qo);this.ka.al=a;this.w();var c=this.panel;null!==c&&(c.graduatedIntervals=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0,get:function(){return null!==this.ka?this.ka.v:0},set:function(a){var b=this.graduatedStart;G&&D(a,bh,"graduatedStart");b!==a&&(0>a?a=0:1a?a=0:1=a&&Ba(a,"> 0",bh,"maxLines"),to(this),this.ia.Pq=a,this.w(),this.g("maxLines",b,a))}},metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Tc?this.Tc:[this.Hb],arrText:null!==this.bc?this.bc:[this.Fe],maxLineWidth:this.Hb,fontHeight:this.mf}}},choices:{configurable:!0,get:function(){return this.Qm},set:function(a){var b=this.Qm;b!==a&&(G&&null!==a&&!Array.isArray(a)&&Aa(a,"Array",bh,"choices:value"),this.Qm=a,this.g("choices", b,a))}}});var xo=null,yo=null,Jo=new F(bh,"None",0),Go=new F(bh,"WrapFit",1),So=new F(bh,"WrapDesiredSize",2),Lo=new F(bh,"WrapBreakAll",3),To=new F(bh,"OverflowClip",0),Do=new F(bh,"OverflowEllipsis",1),Ao=new F(bh,"FormatTrim",0),No=new F(bh,"FormatNone",0),Mo=/[ \u200b\u00ad]/,Oo=new bb,Po=0,Qo=new bb,Ro=0,Fo="...",zo="",so=null,ro=!1;bh.className="TextBlock"; function uo(){this.pc=!1;this.Fd=null;this.fg=xg;this.mq=Ao;this.Pq=Infinity;this.fr=To;this.Jr=this.Ir=0;this.Tr="start";this.Gj=this.Vr=this.Ur=null;this.ds=jd;this.fs=So}uo.prototype.copy=function(){var a=new uo;a.Fd=this.Fd;a.fg=this.fg;a.mq=this.mq;a.Pq=this.Pq;a.fr=this.fr;a.Ir=this.Ir;a.Jr=this.Jr;a.Tr=this.Tr;a.Ur=this.Ur;a.Vr=this.Vr;a.Gj=this.Gj;a.ds=this.ds;a.fs=this.fs;return a};bh.getEllipsis=function(){return Fo};bh.setEllipsis=function(a){Fo=a;Qo=new bb;Ro=0};bh.getBaseline=function(){return xo}; bh.setBaseline=function(a){xo=a};bh.getUnderline=function(){return yo};bh.setUnderline=function(a){yo=a};bh.isValidFont=vo;bh.FormatNone=No;bh.FormatTrim=Ao;bh.None=Jo;bh.OverflowClip=To;bh.OverflowEllipsis=Do;bh.WrapBreakAll=Lo;bh.WrapDesiredSize=So;bh.WrapFit=Go;function qo(){this.al=1;this.v=0;this.j=1;this.m=this.G=null}qo.prototype.copy=function(){var a=new qo;a.al=this.al;a.v=this.v;a.j=this.j;a.G=this.G;a.m=this.m;return a};qo.className="GradElementSettings"; function qk(a,b){P.call(this);this.Mg=null;this.yo="";this.bh=pc;this.Vk=Ad;this.eh=this.Fd=null;this.Uk=Ic;this.fg=xg;this.El=null;this.yn=!1;this.Mh=!0;this.il=!1;this.Al=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Uo;na(qk,P);qk.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.yo=this.yo;a.element=this.Mg;a.bh=this.bh.M();a.Vk=this.Vk;a.fg=this.fg;a.Fd=this.Fd;a.eh=this.eh;a.Uk=this.Uk.M();a.Mh=this.Mh;a.Al=this.Al}; qk.prototype.xb=function(a){a===xg||a===zg||a===ml?this.imageStretch=a:P.prototype.xb.call(this,a)};qk.prototype.toString=function(){return"Picture("+this.source+")#"+ib(this)};function Pi(a){void 0===a&&(a="");B(a,"string",qk,"clearCache:url");""!==a?Uo[a]&&(delete Uo[a],Vo--):(Uo=new bb,Vo=0)} function Wo(a,b){b.Dy||(b.Lq=function(c){b.yq=!0;b.tn=!1;var d=b.Jg.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;e.R();var f=b.getAttribute("src")||"";var g=e.Ug.L(f);if(null!==g)for(var h=g.length,k=0;k=d.width&&(f=f+q.offsetX+(n*q.x-d.width*q.x));p>=d.height&&(g=g+q.offsetY+(p*q.y-d.height*q.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Ad:n=d.width;p=d.height;break;case zg:case ml:r===zg?(r=Math.min(d.height/p,d.width/n),n*=r,p*=r):r===ml&&(r=Math.max(d.height/p,d.width/n),n*=r,p*=r,n>=d.width&&(f=(f+q.offsetX+(n*q.x-d.width*q.x)/n)*k),p>=d.height&&(g=(g+q.offsetY+(p*q.y-d.height*q.y)/ p)*h),k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}r=this.Mf()*b.scale;var u=n*r*p*r,z=k*h/u,w=c.__goCache;r=null;var y=Xo;if(!e){if(c.yq&&void 0!==w&&4y*y)for(null===w.pi&&(Yo(w,4,l,m,c),Yo(w,16,l,m,c)),e=w.pi,l=e.length,m=0;ma)a=5;a=Math.min(a,b/3);a=Math.min(a,c/3);var d="rr"+b+","+c+","+a,e=L.Vf[d];if(void 0!==e)return e;var f=a*L.Eg;e=(new N).add((new fe(a,0,!0)).add(new je(Cd,b-a,0)).add(new je(Rd,b,a,b-f,0,b,f)).add(new je(Cd,b,c-a)).add(new je(Rd,b-a,c,b,c-f,b-f,c)).add(new je(Cd,a,c)).add(new je(Rd,0,c-a,f,c,0,c-f)).add(new je(Cd,0,a)).add((new je(Rd,a,0,0,f,f,0)).close()));1e.x&&a.y>e.y&&a.righte.x&&b.y>e.y&&b.right=c.maxSelectionCount)){this.I^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.qa();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Yb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.ac(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.I& 524288)},set:function(a){var b=0!==(this.I&524288);if(b!==a){G&&B(a,"boolean",U,"isHighlighted");this.I^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.qa(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.R();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.I&8192)},set:function(a){var b=0!==(this.I&8192);b!==a&&(G&&B(a,"boolean",U,"isShadowed"),this.I^=8192,this.g("isShadowed",b,a),this.R())}}, isAnimated:{configurable:!0,get:function(){return 0!==(this.I&262144)},set:function(a){var b=0!==(this.I&262144);b!==a&&(G&&B(a,"boolean",U,"isAnimated"),this.I^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return null!==this.S?this.S.uq:null},set:function(a){var b=this.highlightedChanged;b!==a&&(null!==a&&B(a,"function",U,"highlightedChanged"),dp(this),this.S.uq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0, enumerable:!0,get:function(){return null!==this.S?this.S.Ar:""},set:function(a){var b=this.selectionObjectName;b!==a&&(G&&B(a,"string",U,"selectionObjectName"),dp(this),this.S.Ar=a,this.Zg=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.yr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"selectionAdornmentTemplate"),dp(this),this.S.yr=a,this.g("selectionAdornmentTemplate", b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.Zg){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.lb(a),null!==a?this.Zg=a:this.Zg=this):this instanceof T?(a=this.path,null!==a?this.Zg=a:this.Zg=this):this.Zg=this}return this.Zg}},selectionChanged:{configurable:!0,get:function(){return null!==this.S?this.S.zr:null},set:function(a){var b=this.selectionChanged;b!==a&&(null!==a&&B(a,"function",U,"selectionChanged"),dp(this),this.S.zr=a,this.g("selectionChanged", b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.lr:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"resizeAdornmentTemplate"),dp(this),this.S.lr=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.nr:""},set:function(a){var b=this.resizeObjectName;b!==a&&(G&&B(a,"string",U,"resizeObjectName"),dp(this),this.S.nr=a,this.g("resizeObjectName", b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.lb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return null!==this.S?this.S.mr:Ub},set:function(a){var b=this.resizeCellSize;b.D(a)||(G&&x(a,Gb,U,"resizeCellSize"),a=a.M(),dp(this),this.S.mr=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return null!==this.S?this.S.pr:null},set:function(a){var b= this.rotateAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"rotateAdornmentTemplate"),dp(this),this.S.pr=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,get:function(){return null!==this.S?this.S.qr:""},set:function(a){var b=this.rotateObjectName;b!==a&&(G&&B(a,"string",U,"rotateObjectName"),dp(this),this.S.qr=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.lb(a),null!== a)?a:this}},rotationSpot:{configurable:!0,get:function(){return null!==this.S?this.S.sr:gd},set:function(a){var b=this.rotationSpot;b.D(a)||(G&&(x(a,Hb,U,"rotationSpot"),a===gd||a.mb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+a)),a=a.M(),dp(this),this.S.sr=a,this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.gc},set:function(a){var b=this.gc;b!==a&&(G&&B(a,"string",U,"text"),this.gc=a,this.g("text",b,a))}}, containingGroup:{configurable:!0,get:function(){return this.Gh},set:function(a){if(this.$c()){var b=this.Gh;if(b!==a){G&&null!==a&&x(a,Df,U,"containingGroup");null===a||this!==a&&!a.Sd(this)||(this===a&&v("Cannot make a Group a member of itself: "+this.toString()),v("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.F(2);var c=this.diagram;null!==b?rp(b,this):this instanceof Df&&null!==c&&c.ji.remove(this);this.Gh=a;null!==a?qp(a, this):this instanceof Df&&null!==c&&c.ji.add(this);this.F(1);if(null!==c&&c.da){var d=this.data,e=c.model;if(null!==d&&e.zi()){var f=e.Ca(null!==a?a.data:null);e.tp(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.da,c.da=!0),d(this,b,a),null!==c&&(c.da=e));if(this instanceof Df)for(c=new J,gl(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)wp(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)wp(c.value);c=this.labeledLink; null!==c&&wp(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&vi(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return null!==this.S?this.S.Rp:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(null!==a&&B(a,"function",U,"containingGroupChanged"),dp(this),this.S.Rp=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{configurable:!0,get:function(){return null!== this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{configurable:!0,get:function(){return null!==this.S?this.S.Iq:127},set:function(a){var b=this.layoutConditions;b!==a&&(G&&B(a,"number",U,"layoutConditions"),dp(this),this.S.Iq=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return null!==this.S?this.S.aq:null},set:function(a){var b=this.dragComputation;b!==a&&(null!==a&&B(a,"function",U,"dragComputation"), dp(this),this.S.aq=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return null!==this.S?this.S.Er:Bb},set:function(a){var b=this.shadowOffset;b.D(a)||(G&&x(a,K,U,"shadowOffset"),a=a.M(),dp(this),this.S.Er=a,this.R(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return null!==this.S?this.S.Dr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(G&&B(a,"string",U,"shadowColor"),dp(this),this.S.Dr=a,this.R(),this.g("shadowColor", b,a))}},shadowBlur:{configurable:!0,get:function(){return null!==this.S?this.S.$g:4},set:function(a){var b=this.shadowBlur;b!==a&&(G&&B(a,"number",U,"shadowBlur"),dp(this),this.S.$g=a,this.R(),this.g("shadowBlur",b,a))}}});U.prototype.invalidateLayout=U.prototype.F;U.prototype.findCommonContainingGroup=U.prototype.zx;U.prototype.isMemberOf=U.prototype.Sd;U.prototype.findTopLevelPart=U.prototype.Ez;U.prototype.findSubGraphLevel=U.prototype.Az;U.prototype.ensureBounds=U.prototype.$a; U.prototype.getDocumentBounds=U.prototype.wi;U.prototype.findObject=U.prototype.lb;U.prototype.moveTo=U.prototype.moveTo;U.prototype.invalidateAdornments=U.prototype.Yb;U.prototype.clearAdornments=U.prototype.Pj;U.prototype.removeAdornment=U.prototype.Sf;U.prototype.addAdornment=U.prototype.hh;U.prototype.findAdornment=U.prototype.$j;U.prototype.updateTargetBindings=U.prototype.Ra;var op=!1;U.className="Part";U.LayoutNone=0;U.LayoutAdded=1;U.LayoutRemoved=2;U.LayoutShown=4;U.LayoutHidden=8; U.LayoutNodeSized=16;U.LayoutGroupLayout=32;U.LayoutNodeReplaced=64;U.LayoutStandard=127;U.LayoutAll=16777215;function Be(a,b){void 0===a||a instanceof jm||"string"===typeof a?U.call(this,a):(U.call(this),a&&(b=a));this.I&=-257;this.Qg="Adornment";this.ze=null;this.Hw=0;this.ax=!1;this.j=this.bb=null;b&&Object.assign(this,b)}na(Be,U);Be.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Be.prototype.updateRelationshipsFromData=function(){}; Be.prototype.dm=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof T&&b instanceof Pf){b=c.path;c.dm(a);a=b.geometry;c=this.T.s;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.bf){b.bf=!0;var c=new J;c.add(this);Jp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ji);b.bf=!1}}; function Jp(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.bf){b.bf=!0;var c=new J;c.add(this);Lp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Ji);b.bf=!1}}; function Lp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Uo():a.Qd();k.next();){var l=k.value;l.isTreeLink&&(h||l.Dd||l.hb(),l=l.Zo(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.$b(!0),l.uh(),g&&e.Nj(l,f)),2e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location, a.h(b.x,b.y,0,0));return a};oa.Object.defineProperties(vg.prototype,{padding:{configurable:!0,get:function(){return this.Db},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,vg,"padding");var b=this.Db;b.D(a)||(this.Db=a=a.M(),this.g("padding",b,a),this.w())}}});vg.className="Placeholder"; function T(a){U.call(this,W.Link);this.Ua=8;this.nf=null;this.pf="";this.Df=this.pn=null;this.Ef="";this.Co=null;this.yk=lg;this.Ym=0;this.$m=lg;this.an=NaN;this.Bj=Qp;this.xo=.5;this.wd=null;this.Pb=(new I).freeze();this.Af=this.Vc=null;this.ul=new M;this.Aa=new N;this.v=this.m=this.ag=this.eg=null;this.Au=new K;this.jq=this.Tw=this.Sw=null;this.Bt=NaN;this.fa=null;this.j=[];a&&Object.assign(this,a)}na(T,U); T.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.Ua=this.Ua&-113;a.pf=this.pf;a.pn=this.pn;a.Ef=this.Ef;a.Co=this.Co;a.yk=this.yk;a.Ym=this.Ym;a.$m=this.$m;a.an=this.an;a.Bj=this.Bj;a.xo=this.xo;null!==this.fa&&(a.fa=this.fa.copy())};t=T.prototype;t.Jf=function(a){U.prototype.Jf.call(this,a);this.pf=a.pf;this.Ef=a.Ef;a.Vc=null;a.hb();a.ag=this.ag;var b=a.fromPort;null!==b&&Cp(b);a=a.toPort;null!==a&&Cp(a)}; t.xb=function(a){a.classType===T?2===(a.value&2)?this.routing=a:a===og||a===kg||a===jg?this.curve=a:a===Rp||a===Sp||a===Tp?this.adjusting=a:a!==Qp&&a!==lg&&v("Unknown Link enum value for a Link property: "+a):U.prototype.xb.call(this,a)};t.Yc=function(){null===this.fa&&(this.fa=new sl)};t.Ci=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Hj(a)||Ij(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Hj(a)||Ij(a))?!1:!0};t.Gv=function(){return!1}; t.Hv=function(){};t.$c=function(){return!1};T.prototype.computeAngle=function(a,b,c){return T.computeAngle(b,c)};T.computeAngle=function(a,b){switch(a){default:case lg:a=0;break;case vn:a=b;break;case nn:a=b+90;break;case pn:a=b-90;break;case Up:a=b+180;break;case wn:a=L.jp(b);90a&&(a-=180);break;case on:a=L.jp(b+90);90a&&(a-=180);break;case qn:a=L.jp(b-90);90a&&(a-=180);break;case rn:a=L.jp(b);if(45a||225a)return 0;90a&&(a-=180)}return L.jp(a)}; function wp(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.zx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Gh;if(c!==b){null!==c&&rp(c,a);a.Gh=b;null!==b&&qp(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.da,g.da=!0);e(a,c,b);null!==g&&(g.da=f)}!a.Dd||a.Sw!==c&&a.Tw!==c||a.hb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=T.prototype; t.uh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&U.prototype.uh.call(this)};t.Zo=function(a){G&&x(a,V,T,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.Nz=function(a){G&&x(a,P,T,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function Gp(a,b){null===a.wd&&(a.wd=new J);a.wd.add(b);a.w()} t.ap=function(a){U.prototype.ap.call(this,a);Vp(this)&&this.cp(this.actualBounds);if(!a){a=this.nf;var b=null;null!==a&&(b=this.fromPort,Ep(a,this,b));var c=this.Df;if(null!==c){var d=this.toPort;c===a&&d===b||Ep(c,this,d)}Wp(this)}};t.bp=function(a){U.prototype.bp.call(this,a);Vp(this)&&this.cp(this.actualBounds);if(!a){a=this.nf;var b=null;null!==a&&(b=this.fromPort,Fp(a,this,b));var c=this.Df;if(null!==c){var d=this.toPort;c===a&&d===b||Fp(c,this,d)}Xp(this)}}; t.Wj=function(){this.Dd=!0;if(null!==this.wd){var a=this.diagram;if(null!==a)for(var b=this.wd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};T.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; T.prototype.move=function(a,b){var c=b?this.location:this.position,d=c.x;isNaN(d)&&(d=0);var e=c.y;isNaN(e)&&(e=0);d=a.x-d;e=a.y-e;!0===b?U.prototype.move.call(this,a,!1):(a=K.allocAt(c.x+d,c.y+e),U.prototype.move.call(this,a,!1),K.free(a));qf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; T.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1};T.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRelink)return!1;a=a.diagram;return null===a||a.allowRelink?!0:!1}; T.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Cb),a;if(1===b)return a.assign(this.i(0)),a;if(2===b){var c=this.i(0),d=this.i(1);a.h((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===og))return this.Aa.$u(.5,a),a.add(this.i(0)),c=this.Aa.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===og){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);L.lx(c.x,c.y,d.x,d.y,d.x,d.y,e.x,e.y,a); return a}d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);e=this.i(c+1);var f=this.i(c+2);c=this.i(c+3);L.lx(d.x,d.y,e.x,e.y,f.x,f.y,c.x,c.y,a)}else a.assign(this.i(c));return a}var g=this.flattenedLengths;c=this.flattenedTotalLength;for(e=f=d=0;dc/2)break;d+=e;f++}b=this.i(f);f=this.i(f+1);1>Math.abs(b.x-f.x)?b.y>f.y?a.h(b.x,b.y-(c/2-d)):a.h(b.x,b.y+(c/2-d)):1>Math.abs(b.y-f.y)?b.x>f.x?a.h(b.x-(c/2-d),b.y):a.h(b.x+(c/2-d),b.y):(c=(c/2-d)/e,a.h(b.x+c*(f.x-b.x),b.y+c*(f.y- b.y)));return a}; T.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).fb(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===og))return this.Aa.Gx(.5);if(this.computeCurve()===og&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return L.Wy(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0d/2)break;e+=f;c++}b=this.i(c);d=this.i(c+1);if(1>Math.abs(b.x-d.x)&&1>Math.abs(b.y-d.y)){if(0Math.abs(b.x-d.x))return b.y>d.y?270:90;if(1>Math.abs(b.y-d.y))return b.x>d.x?180:0}return b.fb(d)};t=T.prototype;t.i=function(a){return this.Pb.s[a]}; t.dd=function(a,b){G&&(x(b,K,T,"setPoint"),b.u()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.cd(a,b)};t.P=function(a,b,c){G&&(D(b,T,"setPointAt:x"),D(c,T,"setPointAt:y"));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.cd(a,new K(b,c))}; t.Vz=function(a,b){G&&(x(b,K,T,"insertPoint"),b.u()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.Jb(a,b)};t.l=function(a,b,c){G&&(D(b,T,"insertPointAt:x"),D(c,T,"insertPointAt:y"));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.Jb(a,new K(b,c))}; t.re=function(a){G&&(x(a,K,T,"addPoint"),a.u()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.add(a)};t.Hf=function(a,b){G&&(D(a,T,"insertPointAt:x"),D(b,T,"insertPointAt:y"));G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.add(new K(a,b))}; t.yv=function(a){G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.tb(a)};t.Qj=function(){G&&null===this.Vc&&v("Call Link.startRoute before modifying the points of the route.");this.Pb.clear()}; function qf(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.offset(b,c),a.defaultToPoint&&a.defaultToPoint.offset(b,c);else{for(var d=a.Dd,e=new I,f=a.Pb.iterator;f.next();){var g=f.value;e.add((new K(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Pb;a.Pb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.Eb?a.w():(a.me.h(a.me.x+b,a.me.y+c),a.va.h(a.va.x+b,a.va.y+c),Yl(a));d?Yp(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= a.i(a.pointsCount-1)));null!==g&&g.animationManager.Eb&&(b=g.animationManager,a.Af=e,b.xl.add(a));a.g("points",f,e)}}t.Ah=function(){null===this.Vc&&(this.Vc=this.Pb,this.Pb=this.Pb.copy())}; t.If=function(){if(null!==this.Vc){for(var a=this.Vc,b=this.Pb,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;gl&&(n=-n),u= (0>k?-1:1)*n+r,z=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var w=r,y=q;L.C(k,0)?y=0k?-1:1)*n+r,y=m*(w-r)+q);this.Qj();this.re(f);this.Hf(u,z);this.Hf(w,y);this.re(p);this.dd(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.dd(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,L.C(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.re(d),this.Hf(f,h),this.re(e);else{this.re(d);this.re(e);h=M.alloc();b.wi(h);k=h.ha(e);p.wi(h);l=h.ha(d);if(k||l)g=b.pa(cq(g),new K),this.dd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.pa(cq(c),new K),this.dd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));M.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Qj();var A=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)z=this.computeEndSegmentLength(a,b,g,!0),r= this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>A&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(z+=Math.abs(A)*(m?1:2)),0===r?q=z:90===r?u=z:180===r?q=-z:270===r?u=-z:(q=z*Math.cos(r*Math.PI/180),u=z*Math.sin(r*Math.PI/180)),g.kc()&&l&&(z=b.pa(Ic,K.alloc()),w=K.allocAt(z.x+1E3*q,z.y+1E3*u),this.getLinkPointFromPoint(a,b,z,w,!0,n),K.free(z),K.free(w));z=this.getLinkPoint(d,e,c,!1,m,a,b);var C=y=w=0;if(m||!k||l){var E=this.computeEndSegmentLength(d,e, c,!1);C=this.getLinkDirection(d,e,z,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(C+=m?0:30,0>A&&(C+=180));0>C?C+=360:360<=C&&(C-=360);l&&(E+=Math.abs(A)*(m?1:2));0===C?w=E:90===C?y=E:180===C?w=-E:270===C?y=-E:(w=E*Math.cos(C*Math.PI/180),y=E*Math.sin(C*Math.PI/180));c.kc()&&l&&(c=e.pa(Ic,K.alloc()),g=K.allocAt(c.x+1E3*w,c.y+1E3*y),this.getLinkPointFromPoint(d,e,c,g,!1,z),K.free(c),K.free(g))}c=n;if(m||!h||l)c=new K(n.x+q,n.y+u);g=z;if(m||!k||l)g=new K(z.x+w,z.y+y);!p&&!m&&h&&3Math.abs(b.y-a.y)?(b.x>=a.x?b.x=a.x+9E9:b.x=a.x-9E9,b.y=a.y):(b.y>=a.y?b.y=a.y+9E9:b.y=a.y-9E9,b.x=a.x);return b} T.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new K);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));a=null;e=b.panel;null===e||e.we()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.se;e=1/(a.m11*a.m22-a.m12*a.m21);g=a.m22*e;var h=-a.m12*e,k=-a.m21*e,l=a.m11*e,m=e*(a.m21*a.dy-a.m22*a.dx),n=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*g+d.y*k+m;d=d.x*h+d.y*l+n;g=c.x*g+c.y*k+m;c=c.x*h+c.y*l+n}b.ck(e,d,g,c,f);null!== a&&f.transform(a);return f};function eq(a,b){var c=b.io;null===c&&(c=new fq,c.port=b,c.node=b.part,b.io=c);return gq(c,a)} T.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new K);if(c.mb()&&!bq(c))return b.pa(c,h),h;if(c.ad()){var k=eq(this,b);if(null!==k){h.assign(k.gp);if(e&&this.routing===hq){var l=eq(this,g);if(null!==l&&k.Ql=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Qf(Oc)||c.Qf(Sc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);K.free(k);K.free(l)}}return h}}c= b.pa(cq(c),K.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=dq(c,g.copy()))):(k=this.computeSpot(!d,g),f=K.alloc(),g=g.pa(cq(k),f),e&&(g=dq(c,g)),K.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);K.free(c);return h}; T.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.mb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?dq(k,h.copy()):c):(c=K.alloc(),h=h.pa(Ic,c),K.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>= k.x?0:180:h.y>=k.y?90:270;K.free(k);k=c}d.kc()&&g.Sd(a)&&(k+=180,360<=k&&(k-=360));if(bq(d))return k;a=b.vi();if(0===a)return k;45<=a&&135>a?k+=90:135<=a&&225>a?k+=180:225<=a&&315>a&&(k+=270);360<=k&&(k-=360);return k};T.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.ad()&&(a=eq(this,b),null!==a))return a.Su;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; T.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Ic:(b=this.fromSpot,b.Rb()&&(b=a.fromSpot),a=b===gd?zc:b)):(a=b?b:this.toPort,null===a?a=Ic:(b=this.toSpot,b.Rb()&&(b=a.toSpot),a=b===gd?zc:b));return a};function bq(a){return a===zc||.5===a.x&&.5===a.y}function cq(a){return.5===a.x&&.5===a.y?a:Ic} T.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==lg&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Ib.alloc();n.set(g); if(m instanceof W)h=m.Lf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Pf)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.lh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Ze(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var z=K.alloc(),w=K.alloc(),y=K.alloc(),A=Ib.alloc();A.set(q);A.lv(m.transform);A.bm();w.x=p;w.y=u;w.transform(A);z.x=h;z.y=u;z.transform(A);q=!1;go(m,z,w,y)?q=!0:(z.x=p,z.y=r,z.transform(A),go(m,z,w,y)?q=!0:(w.x= h,w.y=r,w.transform(A),go(m,z,w,y)?q=!0:(z.x=h,z.y=u,z.transform(A),go(m,z,w,y)&&(q=!0))));Ib.free(A);K.free(z);K.free(w);K.free(y);h=q}}else h=m.lh(h,n)}else h=wl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Ib.free(n)}}}void 0===f&&Ib.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Ib.free(g);return!1}; T.prototype.computeCurve=function(){if(null===this.eg){var a=this.fromPort,b=this.isOrthogonal;this.eg=null!==a&&a===this.toPort&&!b}return this.eg?og:this.curve};T.prototype.computeCorner=function(){if(this.curve===og)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; T.prototype.findMidLabel=function(){for(var a=this.path,b=this.T.s,c=b.length,d=0;dk?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);L.ca(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p)); l=k/l;m=p-m;this.dd(a,b);for(a+=1;ak?-Math.PI/2:Math.PI/2:(k=Math.atan(k/Math.abs(h)),0>h&&(k=Math.PI-k)),h=k+m,b*=l,this.P(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.dd(c,d)}}return!0;case Tp:f=this.i(a);n=this.i(c);if(!f.gb(b)||!n.gb(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.dd(a,b);for(a+=1;ab?b+=360:360<=b&&(b-=360);0>d?d+=360:360<=d&&(d-=360);var g=d;b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=315<=d||45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.actualBounds.copy(),k=f.actualBounds.copy();if(h.u()&&k.u()){h.Ec(kq,kq);k.Ec(kq,kq);h.gf(a);k.gf(c);var l=K.alloc(),m=K.alloc();if(0===b)if(c.x>a.x||270===d&&c.ya.x||90===d&&c.y>a.y&&k.right>a.x)l.h(c.x,a.y),m.h(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.ya.y?(l.x=a.xk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.right,m.x=l.x,m.y=c.y):0===d&&a.xk.top&&a.yh.bottom)180===d&&(k.ha(a)||h.ha(c))? l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l.h(Math.max((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y&&k.lefta.y?(l.x=a.x>k.right?this.computeMidOrthoPosition(a.x,a.y,k.right,c.y,!1):a.x>k.left&&(270===d&&a.yk.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):k.left,m.x=l.x, m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.yh.bottom)0===d&&(k.ha(a)||h.ha(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.ya.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,c.x,Math.min(c.y,k.top),!0)),m.x= c.x,m.y=l.y;if(l.y>h.top&&l.y=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l.h(Math.min((a.x+c.x)/2,a.x),a.y),m.h(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.ya.y||180===d&&c.xa.y||0===d&&c.x>a.x&&k.bottom>a.y)l.h(a.x,c.y),m.h((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.x,a.y,c.x, c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.xa.x?(l.y=a.yk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.bottom,m.x=c.x,m.y=l.y):90===d&&a.yk.left&&a.xh.right)270===d&&(k.ha(a)||h.ha(c))?l.x=this.computeMidOrthoPosition(a.x, a.y,c.x,c.y,!1):c.xa.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l.h(a.x,Math.max((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.xa.x&&k.top=a.x?(l.y=a.y>k.bottom?this.computeMidOrthoPosition(a.x,a.y,c.x,k.bottom,!0):a.y>k.top&&(180===d&&a.xk.right)?this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.xh.right)90===d&&(k.ha(a)||h.ha(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.xa.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,a.y,Math.min(c.x,k.left),c.y,!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l.h(a.x,Math.min((a.y+c.y)/2,a.y)),m.h(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x=nq&&(Bk(r),h.Ec(r.Po*r.Sx,r.Oo*r.Tx),lq(r,a,b,n,d,h,!1),k=mq(r, n.x,n.y));if(!r.abort&&kthis.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.P(2,h.x,h.y),this.l(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)L.C(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.P(2,h,a.y),this.P(3,h,g.y)):L.C(h.y,g.y)?(Math.abs(a.y-h.y)<=r.Oo/2&&(this.P(2,h.x,a.y),this.P(3,g.x,a.y)),this.l(2,h.x,a.y)):this.P(2,a.x,h.y);else if(90===b||270===b)L.C(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): Math.min(h.y,a.y),this.P(2,a.x,h),this.P(3,g.x,h)):L.C(h.x,g.x)?(Math.abs(a.x-h.x)<=r.Po/2&&(this.P(2,a.x,h.y),this.P(3,a.x,g.y)),this.l(2,a.x,h.y)):this.P(2,h.x,a.y);null!==c&&(a=this.i(1),g=this.i(2),a.x!==g.x&&a.y!==g.y?0===b||180===b?this.l(2,a.x,g.y):this.l(2,g.x,a.y):0===b||180===b?this.l(2,e.x,c.y):this.l(2,c.x,e.y));null!==q&&(0===d||180===d?this.Hf(f.x,q.y):this.Hf(q.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.re(l.copy()),this.re(m.copy()));K.free(l);K.free(m)}}; T.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).ad()||this.computeSpot(!1,this.toPort).ad()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function fk(a){if(null===a.diagram||!a.isAvoiding||!wk(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=xk(a.diagram,!0,a.containingGroup,null);for(var d=1;dpq&&mq(b,m,n)!==l-1&&(mq(b,c-h,d)===l-1?(e=180,m=c-h,n=d):mq(b,c+h,d)===l-1?(e=0,m=c+h,n=d):mq(b,c,d-k)===l-1?(e=270,m=c,n=d-k):mq(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>pq&&mq(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,--l;if(f){if(l>pq)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/ k)*k+k/2;l>pq&&(f=e,g=c,m=d,0===e?(f=90,m+=k):90===e?(f=180,g-=h):180===e?(f=270,m-=k):270===e&&(f=0,g+=h),mq(b,g,m)===l-1?oq(a,b,g,m,f,!1,f):(g=c,m=d,0===e?(f=270,m-=k):90===e?(f=0,g+=h):180===e?(f=90,m+=k):270===e&&(f=180,g-=h),mq(b,g,m)===l-1&&oq(a,b,g,m,f,!1,f)));a.Hf(c,d)} T.prototype.pz=function(a){G&&x(a,K,T,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Kb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gthis.pointsCount?this.tk=!0:this.Aa=this.makeGeometry();a=this.path;if(null!==a){a.Aa=this.Aa;for(var b=this.T.s,c=b.length,d=0;d=b&&(d=b-1),k=this.i(d),f.x=Math.min(k.x,f.x),f.y=Math.min(k.y,f.y);d=f.x;k=f.y}else{for(k=0;kz?q>r?(f.x=w-A,f.y=r-A,e.x=w+u,e.y=r+u):(f.x=w-A,f.y=r+A,e.x=w+u,e.y=r-u):q>r?(f.x=w+A,f.y=r-A,e.x=w-u,e.y=r+u):(f.x=w+A,f.y=r+A,e.x=w-u,e.y=r-u));L.ca(z,w)&&L.ca(r,q)&&(r>p?(y>w?(f.x=w-A,f.y=r-A,e.x=w+u):(f.x=w+A,f.y=r-A,e.x=w-u),e.y=r+u):(y>w?(f.x=w-A,f.y=r+A,e.x=w+u):(f.x=w+A,f.y=r+A,e.x=w-u),e.y=r-u));if(L.ca(z,w)&&L.ca(w,y)||L.ca(p,r)&&L.ca(r,q))z=.5*(z+y),p=.5*(p+q),f.x=z,f.y=p,e.x=z,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&L.ca(g.x,this.i(0).x)&& L.ca(g.y,this.i(0).y)&&(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y));Kd(h,c.x-d,c.y-k,f.x-d,f.y-k,l.x-d,l.y-k);b.set(f);c.set(e);g=l}}l=g.x;g=g.y;m=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(m=qq(this,m.copy(),!1,yb));l=.5*(l+m.x);g=.5*(g+m.y);Kd(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);K.free(b);K.free(c);K.free(f);K.free(e)}else for(c=3;c=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=qq(this,g.copy(),!1,yb)),Kd(h,f.x-d,f.y-k,e.x-d, e.y-k,g.x-d,g.y-k);else{f=K.alloc();f.assign(this.i(0));e=K.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.D(m))0!==this.computeShortLength(!1)&&(m=qq(this,m.copy(),!1,yb)),tq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?C=p.x-q:C=p.x+q;w.y>p.y?y=p.y+A:y=p.y-A;w=K.allocAt(C,E);tq(this,h,n,z,f,w,u);K.free(w);Ld(h,p.x+n,p.y+z,r+n,y+z);f.h(r,y)}else L.C(f.x,p.x)&&L.C(p.y,w.y)?(q=Math.min(g,Math.abs(p.y-e.y)/2),q=A=Math.min(q,Math.abs(w.x-p.x)/2),L.C(A,0)?(tq(this,h,n,z,f,p,u),f.assign(p)):(C=p.x,E=p.y,r=C,y=E,p.y>f.y?E=p.y-q:E=p.y+q,w.x>p.x?r=p.x+A:r=p.x-A,w=K.allocAt(C,E),tq(this,h,n,z,f,w,u),K.free(w),Ld(h,p.x+n,p.y+z,r+n,y+z),f.h(r, y))):(tq(this,h,n,z,f,p,u),f.assign(p));e.assign(m);n=l}K.free(f)}Od=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=qq(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=qq(this,h,!1,f)),a.type=N.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.tk=!0;return a}; function sq(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return L.ca(a,0)?b:L.ca(b,0)?a:Math.sqrt(a*a+b*b)} function qq(a,b,c,d){var e=a.pointsCount;if(2>e)return b;if(c){var f=a.i(1);c=f.x-d.x;f=f.y-d.y;d=sq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!0);a>e&&(a=e);e=a*(f-b.y)/d;b.x+=a*(c-b.x)/d;b.y+=e}else{f=a.i(e-2);c=f.x-d.x;f=f.y-d.y;d=sq(b.x,b.y,c,f);if(0===d)return b;e=2===e?.5*d:d;a=a.computeShortLength(!1);a>e&&(a=e);e=a*(b.y-f)/d;b.x-=a*(b.x-c)/d;b.y-=e}return b} function rq(a,b,c,d){for(var e=a.pointsCount,f=b;L.ca(b.x,f.x)&&L.ca(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!L.ca(b.x,f.x)&&!L.ca(b.y,f.y))return c-1;for(var g=f;L.ca(b.x,f.x)&&L.ca(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||L.ca(b.y,f.y)&&L.ca(f.y,g.y)&&(!d||(b.x>=f.x?f.x>=g.x:f.x<=g.x));){if(c>=e)return e-1;g=a.i(c++)}return c-2}T.prototype.computeJumpLength=function(){return 10}; function tq(a,b,c,d,e,f,g){if(!g&&Vp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=uq(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===kg?Jd(b,n,r,!1):Kd(b,p,m,n,m,n,r)}else if(L.C(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===kg?Jd(b,r,m,!1):Kd(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)} function uq(a,b,c,d){var e=a.diagram;if(null===e||b.D(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ta.s;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yq&&Math.min(g,z)n&&!L.C(g,z)){h.x=q;h.y=n;m=!0;break a}}else if(!L.C(n,r)&& L.C(g,z)&&Math.min(n,r)g&&Math.min(q,u)m&&!L.C(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}K.free(h)}function Vp(a){a=a.curve;return a===jg||a===kg}function Zp(a,b){if(b||Vp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Kh.contains(a)||0===a.ul.width&&0===a.ul.height||b.Kh.add(a,a.ul.copy())} T.prototype.cp=function(a){var b=this.layer;if(null!==b&&b.visible&&!b.isTemporary){var c=b.diagram;if(null!==c&&!c.animationManager.isTicking){var d=!1;for(c=c.layers;c.next();){var e=c.value;if(e.visible)if(e===b){d=!0;var f=!1;e=e.Ta.s;for(var g=e.length,h=0;ha&&Ba(a,">= 0",T,"fromEndSegmentLength"),this.Yc(),this.fa.ej=a,this.g("fromEndSegmentLength",b,a),this.hb())}},fromShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.fj:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(G&&B(a,"number",T,"fromShortLength"), this.Yc(),this.fa.fj=a,this.tc(),this.g("fromShortLength",b,a))}},toSpot:{configurable:!0,get:function(){return null!==this.fa?this.fa.Jj:gd},set:function(a){var b=this.toSpot;b.D(a)||(G&&x(a,Hb,T,"toSpot"),a=a.M(),this.Yc(),this.fa.Jj=a,this.g("toSpot",b,a),(b.ad()||a.ad())&&null!==this.toNode&&Cp(this.toPort),this.hb())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Hj:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&B(a, "number",T,"toEndSegmentLength"),0>a&&Ba(a,">= 0",T,"toEndSegmentLength"),this.Yc(),this.fa.Hj=a,this.g("toEndSegmentLength",b,a),this.hb())}},toShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Ij:NaN},set:function(a){var b=this.toShortLength;b!==a&&(G&&B(a,"number",T,"toShortLength"),this.Yc(),this.fa.Ij=a,this.tc(),this.g("toShortLength",b,a))}},isLabeledLink:{configurable:!0,get:function(){return null===this.wd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);L.Ml(e.x,e.y,g.x,g.y,h.x,h.y,k.x,k.y,.5,a);b=Math.min(k.x,b);c=Math.min(k.y,c);e=k}else for(e=this.i(0),f=this.i(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.h(e.x,e.y,0,0),a.gf(f),e=2;ed&&(d=-d)):L.ca(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Kf(e)); a.push(d)}}return this.jq}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.Bt;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;dthis.pointsCount)return this.tk=!0,this.Aa;this.Aa=this.makeGeometry()}return this.Aa}},firstPickIndex:{configurable:!0,get:function(){return 2>=this.pointsCount?0:this.isOrthogonal|| !bq(this.computeSpot(!0))?1:0}},lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!bq(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.yk},set:function(a){var b=this.yk;b!==a&&(G&&a!==lg&&a!==Rp&&a!==Sp&&a!==Tp&&v("Link.adjusting can only be set to Link.None, Link.End, LInk.Scale, or Link.Stretch, not: "+a),this.yk=a,this.g("adjusting",b,a))}},corner:{configurable:!0, get:function(){return this.Ym},set:function(a){var b=this.Ym;b!==a&&(G&&B(a,"number",T,"corner"),this.Ym=a,this.tc(),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.$m},set:function(a){var b=this.$m;b!==a&&(G&&a!==lg&&a!==og&&a!==kg&&a!==jg&&v("Link.curve can only be set to Link.None, Link.Bezier, LInk.JumpGap, or Link.JumpOver, not: "+a),this.$m=a,this.hb(),this.tc(),Zp(this,b===kg||b===jg||a===kg||a===jg),this.g("curve",b,a))}},curviness:{configurable:!0, enumerable:!0,get:function(){return this.an},set:function(a){var b=this.an;b!==a&&(G&&B(a,"number",T,"curviness"),this.an=a,this.hb(),this.tc(),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.Bj},set:function(a){var b=this.Bj;b!==a&&(G&&a!==Qp&&a!==yq&&a!==zq&&a!==hq&&v("Link.routing can only be set to Link.Normal, Link.Orthogonal, LInk.AvoidsNodes, not: "+a),this.Bj=a,this.eg=null,this.hb(),Zp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b, a))}},smoothness:{configurable:!0,get:function(){return this.xo},set:function(a){var b=this.xo;b!==a&&(G&&B(a,"number",T,"smoothness"),this.xo=a,this.tc(),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.Bi())return a.model.Dc(this.data)}}});T.prototype.invalidateOtherJumpOvers=T.prototype.cp;T.prototype.findClosestSegment=T.prototype.pz;T.prototype.updateRoute=T.prototype.Dg;T.prototype.invalidateRoute=T.prototype.hb; T.prototype.rollbackRoute=T.prototype.Av;T.prototype.commitRoute=T.prototype.If;T.prototype.startRoute=T.prototype.Ah;T.prototype.clearPoints=T.prototype.Qj;T.prototype.removePoint=T.prototype.yv;T.prototype.addPointAt=T.prototype.Hf;T.prototype.addPoint=T.prototype.re;T.prototype.insertPointAt=T.prototype.l;T.prototype.insertPoint=T.prototype.Vz;T.prototype.setPointAt=T.prototype.P;T.prototype.setPoint=T.prototype.dd;T.prototype.getPoint=T.prototype.i;T.prototype.getOtherPort=T.prototype.Nz; T.prototype.getOtherNode=T.prototype.Zo; var $p=null,aq=null,Qp=new F(T,"Normal",1),yq=new F(T,"Orthogonal",2),zq=new F(T,"AvoidsNodes",6),hq=new F(T,"AvoidsNodesStraight",7),lg=new F(T,"None",0),og=new F(T,"Bezier",9),kg=new F(T,"JumpGap",10),jg=new F(T,"JumpOver",11),Rp=new F(T,"End",17),Sp=new F(T,"Scale",18),Tp=new F(T,"Stretch",19),vn=new F(T,"OrientAlong",21),nn=new F(T,"OrientPlus90",22),pn=new F(T,"OrientMinus90",23),Up=new F(T,"OrientOpposite",24),wn=new F(T,"OrientUpright",25),on=new F(T,"OrientPlus90Upright",26),qn=new F(T,"OrientMinus90Upright", 27),rn=new F(T,"OrientUpright45",28),jq=16,iq=14,kq=8;T.className="Link";T.Normal=Qp;T.Orthogonal=yq;T.AvoidsNodes=zq;T.AvoidsNodesStraight=hq;T.None=lg;T.Bezier=og;T.JumpGap=kg;T.JumpOver=jg;T.End=Rp;T.Scale=Sp;T.Stretch=Tp;T.OrientAlong=vn;T.OrientPlus90=nn;T.OrientMinus90=pn;T.OrientOpposite=Up;T.OrientUpright=wn;T.OrientPlus90Upright=on;T.OrientMinus90Upright=qn;T.OrientUpright45=rn;T.EndSegmentStep=8;T.CurvinessStart=jq;T.SpacingMin=iq;T.OrthoShortCut=kq; function xq(a,b,c,d){Ya(this);this.Le=this.wq=!1;this.Js=a;this.$x=b;this.mv=c;this.ay=d;this.links=[]}xq.prototype.am=function(){if(!this.wq){var a=this.links;0=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Ld=Math.floor((a.x-this.uc)/this.uc)*this.uc;this.Md=Math.floor((b-this.vc)/this.vc)*this.vc;this.Mn=Math.ceil((c+2*this.uc)/this.uc)*this.uc;this.Nn=Math.ceil((d+2*this.vc)/this.vc)*this.vc;a=1+(Math.ceil((this.Mn-this.Ld)/this.uc)|0);b=1+(Math.ceil((this.Nn-this.Md)/this.vc)|0);if(null===this.cc||this.mi=pq&&(c[d]=Aq)} yk.prototype.gk=function(a,b,c,d){if(a>this.Mn||a+cthis.Nn||b+da&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.mi)|0;for(c=Math.min(b+e-1,this.ni)|0;a<=d;a++){e=this.cc[a];for(var f=b;f<=c;f++)if(e[f]===Dk)return!1}return!0}; function Bq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.cc[l][m];if(n>=pq&&n=a.cc[l][m]);)a.cc[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Bq(a,b,c,1,!e,f,g,h,k),Bq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Bq(a,b,c,1,!e,f,g,h,k),Bq(a,b,c,-1,!e,f,g,h, k)}}function Cq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Dk,m=pq;for(a.cc[b][c]=m;l===Dk&&b>f&&bh&&cf&&bh&&c=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=f.x;d=f.y;b=f.x+f.width;var p=f.y+f.height;n-=a.Ld;n/=a.uc;d-=a.Md;d/=a.vc;b-=a.Ld;b/=a.uc;p-=a.Md;p/=a.vc;f=Math.max(0,Math.min(a.mi,n|0));b=Math.min(a.mi,Math.max(0,b|0));n=Math.max(0,Math.min(a.ni,d|0));p=Math.min(a.ni,Math.max(0,p|0));d=a.cc;h|=0;k|=0;l|=0;m|= 0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===Dk?(Cq(a,h,k,r,c,f,b,n,p),Cq(a,h,k,1,!c,f,b,n,p),Cq(a,h,k,-1,!c,f,b,n,p)):Cq(a,h,k,r,c,h,k,h,k);d[l][m]===Dk?(Dq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),Dq(a,l,m,1,!(90===e||270===e),f,b,n,p),Dq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):Dq(a,l,m,r,c,l,m,l,m);c=Na();if(g&&Eq(a,l,m,e,h,k,c)){if(c[0]!==l||c[1]!==m)c.unshift(m),c.unshift(l);if(c[c.length-2]!==h||c[c.length-1]!==k)c.push(h),c.push(k);a=pq;e=c[c.length-2];g=c[c.length-1];d[e][g]= a++;for(f=c.length-4;0<=f;f-=2)for(e=c[f+2],g=c[f+3],b=c[f],l=c[f+1];b>e?e++:bg?g++:le)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===Fq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?pf&&(m=270,p--):90===d?ne&&(m=180,n--):180===d?pf&&(m=270,p--):ne&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==Fq){g.push(k);g.push(l);if(Eq(a,k,l, m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=Fq;if(0===d){if(k===b)return!1;k--}else if(90===d){if(l===c)return!1;l--}else if(180===d){if(k===b)return!1;k++}else{if(l===c)return!1;l++}}} oa.Object.defineProperties(yk.prototype,{bounds:{configurable:!0,get:function(){return new M(this.Ld,this.Md,this.Mn-this.Ld,this.Nn-this.Md)}},Po:{configurable:!0,get:function(){return this.uc},set:function(a){0=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case 3:return c>a&&c<=180+a?180:270;case 5:return c>180-a&&c<=360-a?270:0;case 12:return c>a&&c<=180+a?90:0;case 10:return c>180-a&&c<=360-a?180:90;case 7:return 90180+a&&c<=360-a?270:0;case 13:return 180a&&180>=c?90:0;case 14:return c> a&&c<=180-a?90:c>180-a&&270>=c?180:0;case 11:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&15!==b&&(c-=15,0>c&&(c+=360));return c>a&&c<180-a?90:c>=180-a&&c<=180+a?180:c>180+a&&c<360-a?270:0}fq.prototype.am=function(){this.te.length=0}; function gq(a,b){var c=a.te;if(0===c.length){a:if(!a.ip){c=a.ip;a.ip=!0;var d=null,e=a.node,f=e instanceof Df?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.Ax();else{if(!f.actualBounds.u()){a.ip=c;break a}d=f;g=d.Uu()}f=a.te.length=0;var h=a.port.pa(Ac,K.alloc()),k=a.port.pa(Nc,K.alloc());e=M.allocAt(h.x,h.y,0,0);e.gf(k);K.free(h);K.free(k);h=K.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.vi();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&& l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Sd(d),n=l.computeSpot(m,a.port);if(n.ad()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var r=p.findVisibleNode();null!==r&&r!==p&&(p=r,m=p.port);m=l.computeOtherPoint(p,m);p=h.fb(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=Gq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));r=a.te[f];void 0===r?(r=new Hq(l,p,n),a.te[f]=r):(r.link=l,r.angle=p,r.Qc= n);r.rv.set(m);f++}}}}K.free(h);a.te.sort(fq.prototype.j);k=a.te.length;d=-1;for(f=h=0;fMath.abs(u)?(y=Math.abs(u)/p,p=Math.abs(u)):y=1;break;case 2:r>Math.abs(A)?(y=Math.abs(A)/r,r=Math.abs(A)):y=1;break;case 1:n>Math.abs(u)?(y=Math.abs(u)/n,n=Math.abs(u)):y=1;break;default:case 4:m>Math.abs(A)?(y=Math.abs(A)/ m,m=Math.abs(A)):y=1}w=0}var H=C.gp;if(d===Np){C=C.link.computeThickness();C*=y;H.set(E);switch(q){case 8:H.x=E.x+u/2+p/2-w-C/2;break;case 2:H.y=E.y+A/2+r/2-w-C/2;break;case 1:H.x=E.x+u/2-n/2+w+C/2;break;default:case 4:H.y=E.y+A/2-m/2+w+C/2}w+=C}else{var S=.5;d===yp&&(S=(C.$o+1)/(C.Ql+1));H.x=E.x+u*S;H.y=E.y+A*S}}}K.free(h);K.free(k);K.free(g);K.free(l);E=a.te;for(f=0;fb.Qc?1:a.angleb.angle?1:0}; fq.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,zc,b.fromPort===this.port),d=a.$o;if(0>d)return c;var e=a.Ql;if(1>=e||!b.isOrthogonal)return c;b=a.rv;var f=a.gp;if(2===a.Qc||8===a.Qc)d=e-1-d;return((a=2===a.Qc||4===a.Qc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; Ei.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var b=this.arrangementOrigin.x,c=b,d=this.arrangementOrigin.y,e=0,f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value.node;if(!(null===h||h instanceof T)&&(Kq(h),this.xh(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof Df&&(h.xh=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e= 0,c=b,d+=f+20,f=0):e++}}};Ei.prototype.xh=function(a){return!a.location.u()||a instanceof Df&&a.xh?!0:!1};function Jq(a,b,c,d,e,f,g,h){for(c=c.iterator;c.next();){var k=c.value;d&&!k.isTopLevel||null!==e&&!e(k)||!k.canLayout()||(f&&k instanceof V?k.isLinkLabel||(k instanceof Df?null===k.layout?Jq(a,b,k.memberParts,!1,e,f,g,h):(Kq(k),b.add(k)):(Kq(k),b.add(k))):g&&k instanceof T?b.add(k):!h||!k.$c()||k instanceof V||(Kq(k),b.add(k)))}} function Kq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.$a()}Ei.prototype.xi=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new M),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; Ei.prototype.ox=function(a){var b=new J;a instanceof Q?(Jq(this,b,a.nodes,!0,null,!0,!0,!0),Jq(this,b,a.links,!0,null,!0,!0,!0),Jq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof Df?Jq(this,b,a.memberParts,!1,null,!0,!0,!0):Jq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Ei.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.pa(Ac),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a}; oa.Object.defineProperties(Ei.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){null!==a&&x(a,Q,Ei,"diagram");this.H=a}},group:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(null!==a&&x(a,Df,Ei,"group"),this.m=a,null!==a&&(this.H=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.An},set:function(a){this.An!==a&&(B(a,"boolean",Ei,"isOngoing"),this.An=a)}},isInitial:{configurable:!0, enumerable:!0,get:function(){return this.Oh},set:function(a){B(a,"boolean",Ei,"isInitial");this.Oh=a;a||(this.Fn=!0)}},isViewportSized:{configurable:!0,get:function(){return this.Gn},set:function(a){this.Gn!==a&&(B(a,"boolean",Ei,"isViewportSized"),(this.Gn=a)&&this.F())}},isRouting:{configurable:!0,get:function(){return this.Dn},set:function(a){this.Dn!==a&&(B(a,"boolean",Ei,"isRouting"),this.Dn=a)}},isRealtime:{configurable:!0,get:function(){return this.Cn}, set:function(a){this.Cn!==a&&(null!==a&&B(a,"boolean",Ei,"isRealtime"),this.Cn=a)}},isValidLayout:{configurable:!0,get:function(){return this.Fn},set:function(a){this.Fn!==a&&(B(a,"boolean",Ei,"isValidLayout"),this.Fn=a,a||(a=this.diagram,null!==a&&(a.Dh=!0)))}},network:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(null!==a&&x(a,Iq,Ei,"network"),this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.Om}, set:function(a){this.Om!==a&&(null!==a&&B(a,"function",Ei,"boundsComputation"),this.Om=a,this.F())}},arrangementOrigin:{configurable:!0,get:function(){return this.Km},set:function(a){x(a,K,Ei,"arrangementOrigin");this.Km.D(a)||(this.Km.assign(a),this.F())}}});Ei.prototype.collectParts=Ei.prototype.ox;Ei.prototype.getLayoutBounds=Ei.prototype.xi;Ei.prototype.invalidateLayout=Ei.prototype.F;Ei.className="Layout"; function Iq(a){Ya(this);G&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.Uc=a;this.Ff=new J;this.Ee=new J;this.Ks=new xb;this.Fs=new xb}Iq.prototype.clear=function(){if(this.Ff)for(var a=this.Ff.iterator;a.next();)a.value.clear();if(this.Ee)for(a=this.Ee.iterator;a.next();)a.value.clear();this.Ff=new J;this.Ee=new J;this.Ks=new xb;this.Fs=new xb}; Iq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.Ff.count+" edges: "+this.Ee.count;if(1b?1:0):1:null!==b?-1:0} oa.Object.defineProperties(Lq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Bg._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.ug._dataArray}},data:{configurable:!0,get:function(){return this.zb},set:function(a){this.zb=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.m.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.$h}, set:function(a){if(this.$h!==a){G&&null!==a&&x(a,V,Lq,"node");this.$h=a;a.$a();var b=this.network.layout,c=M.alloc(),d=b.xi(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.j.h(b,e,f,d);M.free(c);if(!(a instanceof Df)&&(a=a.locationObject.pa(Ic),a.u())){this.m.h(a.x-b,a.y-e);return}this.m.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.j},set:function(a){this.j.D(a)||(G&&x(a,M,Lq,"bounds"),this.j.assign(a))}},focus:{configurable:!0, get:function(){return this.m},set:function(a){this.m.D(a)||(G&&x(a,K,Lq,"focus"),this.m.assign(a))}},centerX:{configurable:!0,get:function(){return this.j.x+this.m.x},set:function(a){var b=this.j;b.x+this.m.x!==a&&(G&&D(a,Lq,"centerX"),b.qa(),b.x=a-this.m.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.j.y+this.m.y},set:function(a){var b=this.j;b.y+this.m.y!==a&&(G&&D(a,Lq,"centerY"),b.qa(),b.y=a-this.m.y,b.freeze())}},focusX:{configurable:!0, get:function(){return this.m.x},set:function(a){var b=this.m;b.x!==a&&(b.qa(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.m.y},set:function(a){var b=this.m;b.y!==a&&(b.qa(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.qa(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.qa(),b.y=a,b.freeze())}},width:{configurable:!0, enumerable:!0,get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.qa(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.qa(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.vb},set:function(a){G&&x(a,Iq,Lq,"network");this.vb=a}},sourceVertexes:{configurable:!0,get:function(){for(var a=new J,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex); return a.iterator}},destinationVertexes:{configurable:!0,get:function(){for(var a=new J,b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{configurable:!0,get:function(){for(var a=new J,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);for(b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},sourceEdges:{configurable:!0,get:function(){return this.Bg.iterator}},destinationEdges:{configurable:!0, enumerable:!0,get:function(){return this.ug.iterator}},edges:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{configurable:!0,get:function(){return this.Bg.count+this.ug.count}}});Lq.prototype.deleteDestinationEdge=Lq.prototype.Sl;Lq.prototype.addDestinationEdge=Lq.prototype.Il;Lq.prototype.deleteSourceEdge=Lq.prototype.Tl; Lq.prototype.addSourceEdge=Lq.prototype.Ll;Lq.className="LayoutVertex";Lq.standardComparer=Sq; Lq.smartComparer=function(a,b){G&&x(a,Lq,Lq,"smartComparer:m");G&&x(b,Lq,Lq,"smartComparer:n");if(null!==a){if(null!==b){a=a.$h;var c=b.$h;if(null!==a){if(null!==c){b=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);a=c.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(c=0;c=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.Ka("Layout");d=[];switch(this.alignment){case ar:var h=b,k=c,l=M.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n= m=0;nf-1|| 0g)d.push(new M(0,u,g+h,w)),z=0,q=r,u+=w,w=0;w=Math.max(w,H);switch(p){case $q:C=-C.width;break;default:C=0}A.moveTo(q+C,u);switch(p){case $q:q-=E;break;default:q+=E}z++}d.push(new M(0,u,g+h,w));M.free(l);break;case Tq:k=g;m=f;n=b;p=c;g=M.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=K.alloc();for(q=0;q=l&&(k-=l);l=A=0;E=Math.max(this.cellSize.height,1);C=f=0;H=!0;z=K.alloc();for(S=0;Sm-1||0k){d.push(new M(0,H?y-f:y,k+n,C+f+p));for(aa=0;aal&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;hb?1:0} oa.Object.defineProperties(bl.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.Ho},set:function(a){this.Ho!==a&&(B(a,"number",bl,"wrappingWidth"),0n)){var u=n+Fn(q);q.sc(u,!0);Rn(q,u,n)}}b.isModified=!0}}finally{b.da=!0}}}}};Ai.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Ra(a);for(b=this.nodes.iterator;b.next();)b.value.Ra(a);for(b=this.links.iterator;b.next();)b.value.Ra(a)}; Ai.prototype.zp=function(){for(var a=this.H.model,b=new J,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new ab;e.add("[");c&&1d)return;Ma(a.Kc,d)}Nr(a,"nodeDataArray",se,"nodeDataArray",a,b,null,d,null);a.yp(b)}t.wA=function(a){if(Ha(a))for(var b=a.length,c=0;cb&&(b=a.length);Ka(a,b,c);Nr(this,"",re,"",a,null,c,null,b)}; t.xv=function(a,b){void 0===b&&(b=-1);G&&(Ia(a,X,"removeArrayItem:arr"),D(b,X,"removeArrayItem:idx"));a===this.Kc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ma(a,b);Nr(this,"",se,"",a,c,null,b,null)};t.Xo=function(a){if(null===a)return"";var b=this.wj;if(""===b)return"";b=Sn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b)}; t.um=function(a,b){B(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.wj;if(""!==c)if(this.ib(a)){var d=Sn(a,c);void 0===d&&(d="");d!==b&&(hk(a,c,b),Nr(this,"nodeCategory",pe,c,a,d,b))}else hk(a,c,b)}};t.wm=function(a,b){this.um(b,this.Xo(a))};t.cm=function(){return!1};t.fk=function(){return!1};t.Bi=function(){return!1};t.Es=function(){return!1};t.zi=function(){return!1};function Ci(){return new X} function Ir(a,b){if("function"===typeof b){if(b.className)return b.className;if(b.name)return b.name}else if("object"===typeof b&&null!==b&&b.constructor)return Ir(a,b.constructor);return typeof b}function Lr(a){return Sr[a]?Sr[a]:void 0!==sa.go&&sa.go[a]?sa.go[a]:null}function Sn(a,b){if(!a||!b)return null;try{if("function"===typeof b)var c=b(a);else"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){G&&Fa("property get error: "+d.toString())}return c} function hk(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){G&&Fa("property set error: "+d.toString())}} oa.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.Da},set:function(a){var b=this.Da;b!==a&&(B(a,"string",X,"name"),this.Da=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.bn},set:function(a){var b=this.bn;b!==a&&(B(a,"string",X,"dataFormat"),this.bn=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.Og},set:function(a){var b=this.Og;b!==a&&(B(a,"boolean", X,"isReadOnly"),this.Og=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(B(a,"object",X,"modelData"),this.j=a,this.g("modelData",b,a),this.Ra(a))}},undoManager:{configurable:!0,get:function(){return this.m},set:function(a){var b=this.m;b!==a&&(x(a,ue,X,"undoManager"),null!==b&&b.ey(this),this.m=a,null!==a&&a.gx(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.ah}, set:function(a){B(a,"boolean",X,"skipsUndoManager");this.ah=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.ai},set:function(a){var b=this.ai;b!==a&&(Or(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===se){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Ga(a)&&"number"===typeof c&&(d=this.Dc(a),b?(this.hg.add(a),this.kd[c]!==a&&this.kd.splice(c,0,a),void 0!==d&&this.Bb.add(d,a)):(this.hg.remove(a),this.kd[c]=== a&&this.kd.splice(c,1),void 0!==d&&this.Bb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Nf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue):(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)));return}}X.prototype.changeState.call(this,a,b)}};t=Ur.prototype;t.em=function(a){if(void 0!==a){var b=this.aj;if(null!==b){var c=this.ic(a);null===c&&(c=this.copyNodeData(b),hk(c,this.nodeKeyProperty,a),this.Gf(c))}return a}}; t.Ix=function(a){return or(this,a,!0)};t.Dv=function(a,b){wr(this,a,b,!0)};t.Lx=function(a){return or(this,a,!1)};t.Iv=function(a,b){wr(this,a,b,!1)};function or(a,b,c){if(null!==b&&(a=c?a.uf:a.vf,""!==a&&(a=Sn(b,a),void 0!==a))){if(qr(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function wr(a,b,c,d){null===c&&(c=void 0);void 0===c||qr(c)||Aa(c,"number or string",Ur,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.uf:a.vf;if(""!==e)if(c=a.em(c),a.Nc(b)){var f=Sn(b,e);f!==c&&(ur(a,f,b),hk(b,e,c),null===a.ic(c)&&vr(a,c,b),Nr(a,d?"linkFromKey":"linkToKey",pe,e,b,f,c),"string"===typeof e&&a.Ra(b,e))}else hk(b,e,c)}}t.Jx=function(a){return nr(this,a,!0)};t.Ev=function(a,b){xr(this,a,b,!0)};t.Mx=function(a){return nr(this,a,!1)}; t.Jv=function(a,b){xr(this,a,b,!1)};function nr(a,b,c){if(null===b)return"";a=c?a.pj:a.qj;if(""===a)return"";b=Sn(b,a);return void 0===b?"":b}function xr(a,b,c,d){B(c,"string",Ur,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.pj:a.qj;if(""!==e)if(a.Nc(b)){var f=Sn(b,e);void 0===f&&(f="");f!==c&&(hk(b,e,c),Nr(a,d?"linkFromPortId":"linkToPortId",pe,e,b,f,c),"string"===typeof e&&a.Ra(b,e))}else hk(b,e,c)}} t.Nf=function(a){if(null===a)return Xr;var b=this.le;if(""===b)return Xr;a=Sn(a,b);return void 0===a?Xr:a};t.Rs=function(a,b){Ia(b,Ur,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.le;if(""!==c)if(this.Nc(a)){var d=Sn(a,c);void 0===d&&(d=Xr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Nc(a)&&(ur(this,b,a),Nr(this,"linkLabelKeys",se,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; t.Dc=function(a){if(null!==a){var b=this.Rh;if(""!==b&&(b=Sn(a,b),void 0!==b)){if(qr(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.Qs=function(a,b){void 0!==b&&null!==b&&qr(b)||Aa(b,"number or string",Ur,"setKeyForLinkData:key");if(null!==a){var c=this.Rh;if(""!==c)if(this.Nc(a)){var d=Sn(a,c);d!==b&&null===this.ph(b)&&(hk(a,c,b),void 0!==d&&this.Bb.remove(d),this.Bb.add(b,a),Nr(this,"linkKey",pe,c,a,d,b),"string"===typeof c&&this.Ra(a,c))}else hk(a,c,b)}}; t.ph=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&qr(a)?this.Bb.L(a):null}; t.Hs=function(a){if(null!==a){var b=this.Rh;if(""!==b){var c=this.Dc(a);if(void 0===c||this.Bb.contains(c)){var d=this.kl;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.Bb.contains(c))){hk(a,b,c);return}if("string"===typeof c){for(d=2;this.Bb.contains(c+d);)d++;hk(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.Bb.count-1;this.Bb.contains(c);)c--;hk(a,b,c)}else G&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; t.Nc=function(a){return null===a?!1:this.hg.contains(a)};t.oi=function(a){null!==a&&(mb(a),this.Nc(a)||sr(this,a,!0))};function sr(a,b,c){if(""!==a.linkKeyProperty){var d=a.Dc(b);if(void 0!==d&&a.Bb.L(d)===b)return;a.Hs(b);d=a.Dc(b);void 0===d&&v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.Bb.add(d,b)}a.hg.add(b);d=null;c&&(d=a.kd.length,a.kd.splice(d,0,b));Nr(a,"linkDataArray",re,"linkDataArray",a,null,b,null,d);Yr(a,b)} t.Py=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.kd.splice(d,1)}Nr(a,"linkDataArray",se,"linkDataArray",a,b,null,d,null);c=or(a,b,!0);ur(a,c,b);c=or(a,b,!1);ur(a,c,b);d=a.Nf(b);if(Array.isArray(d))for(var e=d.length,f=0;f=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new I;b.addAll(a.iterator);a=new I;var c=new I;var d=this.sort(b);var e,f,g=this.Qp;var h=this.arrangement;var k=this.nodeDiameterFormula; var l=this.radius;if(!isFinite(l)||0>=l)l=NaN;var m=this.aspectRatio;if(!isFinite(m)||0>=m)m=1;var n=this.startAngle;isFinite(n)||(n=0);var p=this.sweepAngle;if(!isFinite(p)||360p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===os&&k===ps?h=as:h===os&&k!==ps&&(h=this.arrangement);if((this.direction===js||this.direction===ks)&&this.sorting!==ds){for(k=0;!(k>=d.length);k+=2){a.add(d.O(k));if(k+1>=d.length)break;c.add(d.O(k+1))}this.direction===js?(this.arrangement===os&&a.reverse(),d=new I,d.addAll(a), d.addAll(c)):(this.arrangement===os&&c.reverse(),d=new I,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;rp&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===os){isNaN(b)&&(b=6);if(h!==as&&h!==os){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.rw=h;this.nc=l;this.jn=m;this.sw=n;this.bq=p;this.cj=b;this.qe=f;this.Qp=g;b=d;d=this.rw;h=this.nc;l=this.sw;m=this.bq;n=this.cj;p=this.qe;k=this.Qp;if(this.direction!==js&&this.direction!==ks||d!==os)if(this.direction===js||this.direction===ks){g=0;switch(d){case ns:g=180*us(this,h,p,l,k)/Math.PI;break;case as:k=b=0;g=a.first();null!==g&&(b=rs(g,Math.PI/2));g=c.first(); null!==g&&(k=rs(g,Math.PI/2));g=180*us(this,h,p,l,n+(b+k)/2)/Math.PI;break;case ms:g=m/b.length}if(this.direction===js){switch(d){case ns:vs(this,a,l,ls);break;case as:ws(this,a,l,ls);break;case ms:xs(this,a,m/2,l,ls)}switch(d){case ns:vs(this,c,l+g,cs);break;case as:ws(this,c,l+g,cs);break;case ms:xs(this,c,m/2,l+g,cs)}}else{switch(d){case ns:vs(this,c,l,ls);break;case as:ws(this,c,l,ls);break;case ms:xs(this,c,m/2,l,ls)}switch(d){case ns:vs(this,a,l+g,cs);break;case as:ws(this,a,l+g,cs);break;case ms:xs(this, a,m/2,l+g,cs)}}}else switch(d){case ns:vs(this,b,l,this.direction);break;case as:ws(this,b,l,this.direction);break;case ms:xs(this,b,m,l,this.direction);break;case os:ys(this,b,m,l,this.direction)}else ys(this,b,m,l-m/2,cs)}this.updateParts();this.network=null;this.isValidLayout=!0}; function xs(a,b,c,d,e){var f=a.bq,g=a.nc;a=a.qe;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===cs?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Bs(a,k,l,m,n,e,f)||Cs(a,k,l,m,n,e,f);k=f.x;l=f.y}K.free(f);a.xj++;if(!(23Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0Math.abs(p)? 0:p;k=Math.abs(f)>Math.abs(n)?0n:0a.xj?a.nc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Bs(a,k,l,n,p,e,m)||Cs(a,k,l,n,p,e,m);k=m.x;l=m.y}K.free(m);a.xj++;if(!(23a.xj?a.nc-f/(2*Math.PI):a.nc-(0h){f=b-a;if(f<-h)return g.x=f,g.y=l,!1;m=!0}}else if(f=b-a,f<-h){f=b+a;if(f>h)return g.x=f,g.y=l,!1;m=!0}l=Math.sqrt(1-Math.min(1,f*f/(h*h)))*k;0>c!==m&&(l=-l);if(Math.abs(c-l)>(d[e].height+d[e+1].height)/2)return g.x=f,g.y=l,!1;g.x=f;g.y=l;return!0} function Cs(a,b,c,d,e,f,g){var h=a.nc,k=a.qe,l=0;a=(d[e].height+d[e+1].height)/2+a.cj;d=!1;if(0<=b!==(f===cs)){if(f=c-a,f<-k){f=c+a;if(f>k){g.x=l;g.y=f;return}d=!0}}else if(f=c+a,f>k){f=c-a;if(f<-k){g.x=l;g.y=f;return}d=!0}l=Math.sqrt(1-Math.min(1,f*f/(k*k)))*h;0>b!==d&&(l=-l);g.x=l;g.y=f}$r.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; $r.prototype.commitNodes=function(){var a=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,b=a?this.group.location.copy():null,c=this.actualCenter;a?c=new K(0,0):(c.x=this.arrangementOrigin.x+this.nc,c.y=this.arrangementOrigin.y+this.qe);for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;e.x+=c.x;e.y+=c.y;e.commit()}a&&(this.group.$a(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.ve(c.ve(a)),this.group.move(b),this.fw=b.ve(a))}; $r.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function ts(a,b,c,d,e){var f=a.Fy;if(.001>Math.abs(a.jn-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;var g=0;var h=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1));for(var k=0,l=0;l<=f;l++){void 0!==d&&void 0!==e?k=d+l*e/f:k=l*Math.PI/(2*f);var m=Math.sin(k);g+=Math.sqrt(1-a*a*m*m)*h}return void 0!==d&&void 0!==e?(b>c?b:c)*g:4*(b>c?b:c)*g} function ss(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?ts(a,1,c,d,e):ts(a,1,c))}function us(a,b,c,d,e){if(.001>Math.abs(a.jn-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,g=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var h=0;;h++){var k=Math.sin(d+h*a);g+=(b>c?b:c)*Math.sqrt(1-f*f*k*k)*a;if(g>=e)return h*a}} $r.prototype.sort=function(a){switch(this.sorting){case hs:break;case is:a.reverse();break;case fs:a.sort(this.comparer);break;case gs:a.sort(this.comparer);a.reverse();break;case ds:return this.jk(Ds(a));default:v("Invalid sorting type.")}return a}; function Ds(a){for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.O(f));b[f]=-1;f=a.O(f);for(g=f.sourceEdges;g.next();)e=a.indexOf(g.value.fromVertex),0>e||0<=b[e]&&b[e]++;for(f=f.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}return c} $r.prototype.jk=function(a){for(var b=[],c=0;cb[c].indexOf(e)&&b[c].push(e);for(d=d.sourceEdges;d.next();)e=a.indexOf(d.value.fromVertex),e!==c&&0>b[c].indexOf(e)&&b[c].push(e)}f=[];for(c=0;cb[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;qc.indexOf(H)||Ec.indexOf(H)||E=u?E+1:E)),w+=E=u&&E++,A>=u&&A++,E>A&&(C=A,A=E,E=C),A-E<(c.length+2)/2===(Er||r===m||(q=r>m?r-m:m-r,n+=rg-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b=a?this.Dl=a:this.Dl=360,this.F())}},arrangement:{configurable:!0,get:function(){return this.Sb},set:function(a){this.Sb!==a&&($a(a,$r,$r,"arrangement"),a===os||a===as||a===ns||a===ms)&&(this.Sb=a,this.F())}},direction:{configurable:!0,get:function(){return this.N},set:function(a){this.N!==a&&($a(a,$r,$r,"direction"), a===cs||a===ls||a===js||a===ks)&&(this.N=a,this.F())}},sorting:{configurable:!0,get:function(){return this.ld},set:function(a){this.ld!==a&&($a(a,$r,$r,"sorting"),a===hs||a===is||a===fs||gs||a===ds)&&(this.ld=a,this.F())}},comparer:{configurable:!0,get:function(){return this.fd},set:function(a){this.fd!==a&&(B(a,"function",$r,"comparer"),this.fd=a,this.F())}},spacing:{configurable:!0,get:function(){return this.Cf},set:function(a){this.Cf!==a&&(B(a,"number", $r,"spacing"),this.Cf=a,this.F())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.Vn},set:function(a){this.Vn!==a&&($a(a,$r,$r,"nodeDiameterFormula"),a===es||a===ps)&&(this.Vn=a,this.F())}},actualXRadius:{configurable:!0,get:function(){return this.nc}},actualYRadius:{configurable:!0,get:function(){return this.qe}},actualSpacing:{configurable:!0,get:function(){return this.cj}},actualCenter:{configurable:!0,get:function(){return this.fw}}}); var as=new F($r,"ConstantSpacing",0),ns=new F($r,"ConstantDistance",1),ms=new F($r,"ConstantAngle",2),os=new F($r,"Packed",3),cs=new F($r,"Clockwise",4),ls=new F($r,"Counterclockwise",5),js=new F($r,"BidirectionalLeft",6),ks=new F($r,"BidirectionalRight",7),hs=new F($r,"Forwards",8),is=new F($r,"Reverse",9),fs=new F($r,"Ascending",10),gs=new F($r,"Descending",11),ds=new F($r,"Optimized",12),es=new F($r,"Pythagorean",13),ps=new F($r,"Circular",14);$r.className="CircularLayout";$r.ConstantSpacing=as; $r.ConstantDistance=ns;$r.ConstantAngle=ms;$r.Packed=os;$r.Clockwise=cs;$r.Counterclockwise=ls;$r.BidirectionalLeft=js;$r.BidirectionalRight=ks;$r.Forwards=hs;$r.Reverse=is;$r.Ascending=fs;$r.Descending=gs;$r.Optimized=ds;$r.Pythagorean=es;$r.Circular=ps;function bs(){this.Yl=-Infinity;this.Dm=this.vk=null} bs.prototype.compare=function(a,b){if(0this.Yl||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+ p.height/2,l[0]=new K(p.x+p.width+d.width,p.y),l[1]=new K(p.x,p.y+p.height+d.height),h=2):(k=Js(l,h,e,f,p.width,p.height,d),n=l[k],r=new K(n.x+p.width+d.width,n.y),p=new K(n.x,n.y+p.height+d.height),k+1this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().bounds,d=this.network.vertexes.iterator;d.next();){if(d.value.bounds.Zc(c)&&(a++,2a.network.vertexes.count)return!1;a.gh=a.network.vertexes.La();a=a.gh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Wd-a.Wd});for(b=a.length-1;0<=b&&1>=a[b].Wd;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mr&&(r=1);h=L.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new K(p.x+g,p.y+h)}}a.network=d;return c} function Os(a,b,c){G&&(x(b,Hs,Gs,"popNetwork:oldnet"),D(c,Gs,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.ef){var e=d.ef.O(d.Bv);d.Wd=e.Xs;var f=e.Zv,g=e.$v;d.bounds=new M(d.centerX-f,d.centerY-g,e.Ys,e.Ws);d.focus=new K(f,g);d.Bv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Ps(a,b,c){G&&(x(b,Rs,Gs,"surroundNode:oldnet"),D(c,Gs,"surroundNode:level"));var d=b.Sj;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.ef&&0=n.Wd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0>1)+l)*(0===h%2?1:-1);k.centerX=c+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function Js(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;lm.y&&a[p].x-m.xm.x&&a[p].y-m.yb+f?(c=d+e-g,a=a-b-f,L.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,L.sqrt(c*c+a*a)):a+cb+f?a-(b+f):a+c=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.centerX,e=d,f=c=c.centerY,g=1;gf-c)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerX-b.centerX}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.centerY-b.centerY});c=a.gg;var l=d=h=0;for(f= 0;fc||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=Ss(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Us),q=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):kr?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Us),h=n.random(),n=n.random(),d=(d>k?1:-1)*(1+(f.width>c.width?f.width:c.width))*h,l=(g>m?1:-1)*(1+(f.height>c.height?f.height:c.height))*n):(h=h.stiffness*(n-h.length),d=(k-d)/n*h,l=(m-g)/n*h),c.forceX+=d,c.forceY+=l,f.forceX-=d,f.forceY-=l;for(e=d=0;ea.epsilonDistance*a.epsilonDistance}Gs.prototype.moveVertex=function(a){var b=a.forceX,c=a.forceY,d=this.moveLimit;b<-d?b=-d:b>d&&(b=d);c<-d?c=-d:c>d&&(c=d);a.centerX+=b;a.centerY+=c;return b*b+c*c};Gs.prototype.moveFixedVertex=function(){};Gs.prototype.commitLayout=function(){this.Fv();this.commitNodes();this.isRouting&&this.commitLinks()}; Gs.prototype.Fv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=gd,b.toSpot=gd)}};Gs.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=M.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;M.free(c)}c=M.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}M.free(c)}; Gs.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Gs.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Pk:a};Gs.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Ok:a};Gs.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Mk:a};Gs.prototype.electricalFieldX=function(){return 0};Gs.prototype.electricalFieldY=function(){return 0}; Gs.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Nk:a};Gs.prototype.gravitationalFieldX=function(){return 0};Gs.prototype.gravitationalFieldY=function(){return 0};Gs.prototype.isFixed=function(a){return a.isFixed}; oa.Object.defineProperties(Gs.prototype,{currentIteration:{configurable:!0,get:function(){return this.In}},arrangementSpacing:{configurable:!0,get:function(){return this.be},set:function(a){x(a,Gb,Gs,"arrangementSpacing");this.be.D(a)||(this.be.assign(a),this.F())}},arrangesToOrigin:{configurable:!0,get:function(){return this.Lm},set:function(a){this.Lm!==a&&(B(a,"boolean",Gs,"arrangesToOrigin"),this.Lm=a,this.F())}},setsPortSpots:{configurable:!0, get:function(){return this.Bf},set:function(a){this.Bf!==a&&(B(a,"boolean",Gs,"setsPortSpots"),this.Bf=a,this.F())}},comments:{configurable:!0,get:function(){return this.sd},set:function(a){this.sd!==a&&(B(a,"boolean",Gs,"comments"),this.sd=a,this.F())}},maxIterations:{configurable:!0,get:function(){return this.ll},set:function(a){this.ll!==a&&(B(a,"number",Gs,"maxIterations"),0<=a&&(this.ll=a,this.F()))}},epsilonDistance:{configurable:!0,get:function(){return this.kn}, set:function(a){this.kn!==a&&(B(a,"number",Gs,"epsilonDistance"),0u&&0u&&0a[this.Kd]&&(this.Oq=a[c]-1,this.Kd=c),a[c]g)for(var m=g+1;mk;m--)n=d[m],n.near===l&&n.Oj===l.Oj||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;lu||n===u&&r>q)&&h++;zn||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;lu||n===u&&m>z)&&h++,qn||u===n&&z>m)&&h++);f[g*e+g]=h;for(k=g+1;k=c)for(h=d[g].destinationEdgesArrayAccess,A=d[k].destinationEdgesArrayAccess, l=0;l=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=0,p=h.near;null!==p&&p.layer===h.layer&&(m+=p.column-1,n++);if(null!==k)for(p=0;p=c&&(k=h.sourceEdgesArrayAccess);var l=null;0<=c&&(l=h.destinationEdgesArrayAccess);var m=0,n=[],p=h.near;null!==p&&p.layer===h.layer&&(n[m]=p.column-1,m++);h=void 0;if(null!==k)for(p=0;p>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}ft(a,b,d);return f} function nt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();){var h=g.value;var k=h.toVertex;var l=b.layer-k.layer;h=a.linkMinLength(h);l===h&&nt(a,k,c,d,e,f)}if(f)for(g=b.sourceEdges;g.next();)h=g.value,k=h.fromVertex,l=k.layer-b.layer,h=a.linkMinLength(h),l===h&&nt(a,k,c,d,e,f)}} function ot(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)ot(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)ot(a,b.value.fromVertex,c,d,e,f)}} Ws.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Lk){default:case pt:a=this.network;var b=0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.iterator;e.next();)e.value.valid=!0;for(;null!==qt(a);){for(e=rt(a);null!==e;)d[c]=e,c--,e.valid=!1,e=rt(a);for(e=st(a);null!==e;)d[b]=e,b++,e.valid=!1,e=st(a);e=null;for(var f=0,g=this.network.vertexes.iterator;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.destinationEdges;l.next();)l.value.toVertex.valid&& k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||fb.toVertex.index&&(a.rm(b),b.rev=!0);break;case Xs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.Ul=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Sn=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& tt(this,b);for(d.reset();d.next();)b=d.value,-1===b.Ul&&tt(this,b);for(a.reset();a.next();)d=a.value,d.forest||(b=d.fromVertex,c=b.finish,e=d.toVertex,f=e.finish,e.Uld){if(0>d)for(b.reset();b.next();)b.value.layer-=d;d=[];for(b.reset();b.next();)c=b.value,e=d[c.layer],void 0===e?d[c.layer]=[c]:e.push(c);for(c=b=0;cg&&nt(a,h,0,-1,!0,!1)}for(nt(a,b,1,-1,!0,!0);0!==b.component;){f=0;d=Infinity;h=0;k=null;for(g=a.network.vertexes.iterator;g.next();){var l=g.value;if(1===l.component){var m=0,n=!1,p=l.sourceEdgesArrayAccess; e=p.length;for(var r=0;rf)&&!m&&(h=g,f=l)}if(0>d){for(c.reset();c.next();)d=c.value,1===d.component&&(d.layer-=e);b.component=0}else h.component=0}}} function dt(a,b,c){return 90===a.N?c&&!b.rev||!c&&b.rev?270:90:180===a.N?c&&!b.rev||!c&&b.rev?0:180:270===a.N?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0} Ws.prototype.initializeIndices=function(){switch(this.Yk){default:case At:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.wc[c];this.wc[c]++}break;case Zs:a=this.network.vertexes.iterator;for(b=this.Oa;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Bt(this,c);break;case Ct:for(a=this.network.vertexes.iterator,b=0;b<=this.Oa;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Dt(this,c)}}; function Bt(a,b){var c=b.layer;b.index=a.wc[c];a.wc[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;df.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;cf.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c=g;d--)f=Ft(this,d,-1)||f;e=this.countCrossings();e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ft(this,d,1)||f;e=this.countCrossings();e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ft(this,d,1)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Ft(this,d,-1)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ft(this,d,0)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ft(this,d,0)||f;e>=a?it(this,b):(a=e,b=ht(this))}break;default:case $s:for(c=this.Oa,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Ft(this,d,-1)||f;e=this.countCrossings();e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ft(this,d,1)||f;e=this.countCrossings();e>=a?it(this,b): (a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ft(this,d,1)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ft(this,d,-1)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Ft(this,d,0)||f;e>=a?it(this,b):(a=e,b=ht(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Ft(this,d,0)||f;e>=a?it(this,b):(a=e,b=ht(this))}}it(this,b)}; function Et(a,b,c){G&&(D(b,Ws,"medianBarycenterCrossingReduction:unfixedLayer"),D(c,Ws,"medianBarycenterCrossingReduction:direction"));var d=et(a,b),e=a.wc[b],f=mt(a,b,c),g=lt(a,b,c);for(c=0;cf+1&&(p+=4*(y-f),r+=4*(y-(f+1)))}C=d[f].destinationEdges.iterator;for(C.reset();C.next();)if(y=C.value,A=y.toVertex,y.valid&&A.layer===b){for(y=0;d[y]!==A;)y++;y===f+1&&(r+=1)}C=d[f+1].sourceEdges.iterator;for(C.reset();C.next();)if(y=C.value,A=y.fromVertex,y.valid&&A.layer===b){for(y=0;d[y]!==A;)y++;yf+1&&(p+=4*(y-(f+1)),r+=4*(y-f))}C=d[f+1].destinationEdges.iterator; for(C.reset();C.next();)if(y=C.value,A=y.toVertex,y.valid&&A.layer===b){for(y=0;d[y]!==A;)y++;y===f&&(p+=1)}y=A=0;C=g[d[f].index];var E=h[d[f].index],H=g[d[f+1].index],S=h[d[f+1].index];-1!==C&&(A+=Math.abs(C-q),y+=Math.abs(C-w));-1!==E&&(A+=Math.abs(E-q),y+=Math.abs(E-w));-1!==H&&(A+=Math.abs(H-u),y+=Math.abs(H-z));-1!==S&&(A+=Math.abs(S-u),y+=Math.abs(S-z));if(r>1)+8*d;this.Va*=8}if(0!==(this.jg&2))for(c=!0;c;){c=!1;for(b=this.Kd+1;b<=this.Oa;b++)c= Jt(this,b,1)||c;for(b=this.Kd-1;0<=b;b--)c=Jt(this,b,-1)||c;c=Jt(this,this.Kd,0)||c}if(0!==(this.jg&4)){for(b=this.Kd+1;b<=this.Oa;b++)Kt(this,b,1);for(b=this.Kd-1;0<=b;b--)Kt(this,b,-1);Kt(this,this.Kd,0)}a&&(Lt(this,-1),Lt(this,1));if(0!==(this.jg&2))for(c=!0;c;){c=!1;c=Jt(this,this.Kd,0)||c;for(b=this.Kd+1;b<=this.Oa;b++)c=Jt(this,b,0)||c;for(b=this.Kd-1;0<=b;b--)c=Jt(this,b,0)||c}}else Mt(this)}; function Jt(a,b,c){G&&(D(b,Ws,"bendStraighten:unfixedLayer"),D(c,Ws,"bendStraighten:direction"));for(var d=!1;Nt(a,b,c);)d=!0;return d} function Nt(a,b,c){G&&(D(b,Ws,"shiftbendStraighten:unfixedLayer"),D(c,Ws,"shiftbendStraighten:direction"));var d,e=et(a,b),f=a.wc[b],g=lt(a,b,-1);if(0c)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u= 0;if(0>=c)for(var z=e[d].sourceEdges.iterator;z.next();){var w=z.value;var y=w.fromVertex;if(w.valid&&y.layer!==b){var A=gt(w);var C=w.portFromColOffset;w=w.portToColOffset;y=y.column;p+=(Math.abs(m+w-(y+C))+1)*A;q+=(Math.abs(r+w-(y+C))+1)*A;u+=(Math.abs(n+w-(y+C))+1)*A}}if(0<=c)for(z=e[d].destinationEdges.iterator;z.next();)w=z.value,y=w.toVertex,w.valid&&y.layer!==b&&(A=gt(w),C=w.portFromColOffset,w=w.portToColOffset,y=y.column,p+=(Math.abs(m+C-(y+w))+1)*A,q+=(Math.abs(r+C-(y+w))+1)*A,u+=(Math.abs(n+ C-(y+w))+1)*A);w=C=A=0;z=g[e[d].index];y=h[e[d].index];-1!==z&&(A+=Math.abs(z-m),C+=Math.abs(z-r),w+=Math.abs(z-n));-1!==y&&(A+=Math.abs(y-m),C+=Math.abs(y-r),w+=Math.abs(y-n));if(q=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}ft(a,b, d);a.normalize()}function Ot(a,b){G&&(D(b,Ws,"packAux:column"),D(1,Ws,"packAux:direction"));for(var c=!0,d=a.network.vertexes.iterator;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),g=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+g>=b){c=!1;break}}a=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(--c.column,a=!0);return a} function Pt(a,b){G&&(D(b,Ws,"tightPackAux:column"),D(1,Ws,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Oa;d++)e[d]=!1,f[d]=!1;for(var g=a.network.vertexes.iterator;g.next();){d=g.value;var h=d.column-a.nodeMinColumnSpace(d,!0),k=d.column+a.nodeMinColumnSpace(d,!1);h<=b&&k>=b&&(e[d.layer]=!0);h<=c&&k>=c&&(f[d.layer]=!0)}h=!0;c=!1;for(d=0;d<=a.Oa;d++)h=h&&!(e[d]&&f[d]);if(h)for(g.reset();g.next();)a=g.value,a.column>b&&(--a.column,c=!0);return c} function Lt(a,b){G&&D(b,Ws,"componentPack:direction");for(var c=0;c<=a.Va;c++)for(;Ot(a,c););a.normalize();for(c=0;cf?it(a,e):gb)for(c=a.Va;0<=c;c--)for(e=ht(a),f=kt(a),d=f+1;ff?it(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.ne);a.ne++;for(d.reset();d.next();)b=d.value,-1===b.component&&(ot(a,b,a.ne,-1,!0,!0),a.ne++);var f;b=[];for(f=0;fc)for(g=a.Va;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} function Mt(a){for(var b=Na(),c=a.nl.length,d=0;d<=c;d++)b[d]=[];for(d=a.network.vertexes.iterator;d.next();){var e=d.value;b[c-e.layer][e.index]=e}c=new J;Rt(b,c);var f=null,g=null,h=null,k=null,l=0!==(a.Ae&1),m=0!==(a.Ae&2),n=0!==(a.Ae&4),p=0!==(a.Ae&8);l&&(a.verticalAlignment(b,c,!0),f=St(a,b,!0,!1));b.reverse();n&&(a.verticalAlignment(b,c,!1),h=St(a,b,!1,!1));d=ca(b);for(e=d.next();!e.done;e=d.next())e.value.reverse();p&&(a.verticalAlignment(b,c,!1),k=St(a,b,!1,!0));b.reverse();m&&(a.verticalAlignment(b, c,!0),g=St(a,b,!0,!0));Pa(b);a.v(f,g,h,k);a.network.vertexes.each(function(a){var b=Na();l&&b.push(f.get(a));m&&b.push(g.get(a));n&&b.push(h.get(a));p&&b.push(k.get(a));b.sort(function(a,b){return a-b});var c=b.length;c=(b[Math.floor((c-1)/2)]+b[Math.ceil((c-1)/2)])/2;Pa(b);a.Cc=c})} function Rt(a,b){for(var c=a.length,d=1;dm)&&b.add(n);f++}e= m}}}Ws.prototype.verticalAlignment=function(a,b,c){Ut(a);a=ca(a);for(var d=a.next();!d.done;d=a.next()){var e=-1;d=ca(d.value);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=c?Tt(f):Vt(f),h=g.length;if(0=b[c].length)&&(g=b[c][0],g.rd===g)){Infinity===g.rd.shift&&(g.rd.shift=0);g=c;h=0;do{for(f=b[g][h];f.align!==f.root;)f=f.align,g++,0a&&v("Could not determine previous vertex in layer");return b[c][a-1]} Ws.prototype.v=function(a){for(var b=[],c=0;cg;g++)if(b[g]){var h=Zt(this,b[g],d,e,g);hg;f={delta:f.delta},g++)b[g]&&(f.delta=0===g||2===g?d[c]-d[g]:e[c]-e[g],0!==f.delta&&b[g].each(function(a){return function(b){b.value+=a.delta}}(f)));Pa(d);Pa(e)}; function Zt(a,b,c,d,e){if(!b||0===b.count)return c[e]=0,d[e]=0,Infinity;var f=Infinity,g=-Infinity;b.each(function(b){var c=b.key;b=b.value;c=90===a.N||270===a.N?c.width:c.height;bg&&(g=b+c)});c[e]=f;d[e]=g;return g-f}Ws.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=ct(this,!0),b=ct(this,!1),c=this.network.edges.iterator;c.next();){var d=c.value.link;null!==d&&(d.fromSpot=a,d.toSpot=b)}this.commitNodes();this.Nu();this.isRouting&&this.commitLinks()}; function ct(a,b){return 270===a.N?b?ld:od:90===a.N?b?od:ld:180===a.N?b?md:nd:b?nd:md} Ws.prototype.commitNodes=function(){this.je=[];this.Jd=[];this.Hd=[];this.Ya=[];for(var a=0;a<=this.Oa;a++)this.je[a]=0,this.Jd[a]=0,this.Hd[a]=0,this.Ya[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.je[c]=Math.max(this.je[c],this.nodeMinLayerSpace(b,!0));this.Jd[c]=Math.max(this.Jd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.ke;for(var d=0;d<=this.Oa;d++){var e=c;0>=this.je[d]+this.Jd[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+n.bounds.height,b.l(q++,C,n+H),b.l(q++,C,n),b.l(q++,C,n-A)):(b.l(q++,C,E+H),b.l(q++,C,E),b.l(q++,C,E-A)):270===this.N?E<=n.bounds.y?(n=n.bounds.y,b.l(q++,C,n-A),b.l(q++,C,n),b.l(q++,C,n+H)):(b.l(q++,C,E-A),b.l(q++,C,E),b.l(q++,C,E+H)):0===this.N&&(C>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.l(q++,n+H,E),b.l(q++,n,E),b.l(q++,n-A,E)):(b.l(q++,C+H,E),b.l(q++,C,E),b.l(q++,C-A,E)));else{b.l(q++,w,y);var S=0;if(180=== this.N||0===this.N){if(180===this.N?C>=n.bounds.right:C<=n.bounds.x)S=(0===this.N?-A:H)/2;b.l(q++,w+S,E)}else{if(270===this.N?E>=n.bounds.bottom:E<=n.bounds.y)S=(90===this.N?-A:H)/2;b.l(q++,C,y+S)}b.l(q++,C,E)}}else A=Math.max(10,this.je[z.layer]),H=Math.max(10,this.Jd[z.layer]),r?180===this.N?(b.l(q++,C-A-u,E),b.l(q++,Math.min(C-A+u/2,C),E),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,Math.max(C+H-u/2,C),E),b.l(q++,C+H+u,E)):90===this.N?(b.l(q++,C,E+H+u),b.l(q++,C,Math.max(E+H-u/2,E)),b.l(q++,C,E),b.l(q++, C,E),b.l(q++,C,Math.min(E-A+u/2,E)),b.l(q++,C,E-A-u)):270===this.N?(b.l(q++,C,E-A-u),b.l(q++,C,Math.min(E-A+u/2,E)),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,C,Math.max(E+H-u/2,E)),b.l(q++,C,E+H+u)):(b.l(q++,C+H+u,E),b.l(q++,Math.max(C+H-u/2,C),E),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,Math.min(C-A+u/2,C),E),b.l(q++,C-A-u,E)):b.l(q++,C,E)}n=z}if(null===h||l!==zc||p)if(w=b.i(q-1).x,y=b.i(q-1).y,C=b.i(q).x,E=b.i(q).y,p)u=this.Jd[m.layer],180===this.N||0===this.N?(p=y,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.N? C>=m.bounds.x:C<=m.bounds.right)&&(n=m.centerX+(180===this.N?-u:u),p=m.bounds.x&&p<=m.bounds.right&&(270===this.N?E>=m.bounds.y:E<=m.bounds.bottom)&&(n=m.centerY+(270===this.N?-u:u),p=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.P(q-2,n,y),b.P(q-1,n+H,y)):90===this.N&&E<=m.bounds.bottom?(n=m.bounds.y,b.P(q-2,w,n),b.P(q-1,w,n-A)):270===this.N&&E>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.P(q-2,w,n),b.P(q-1,w,n+H)):0===this.N&&C<=m.bounds.right&&(n=m.bounds.x,b.P(q-2,n,y),b.P(q-1,n-A,y));else{A=Math.max(10,this.je[m.layer]);H=Math.max(10,this.Jd[m.layer]);p=0;if(180===this.N||0===this.N){if(180===this.N?C<=m.bounds.x:C>=m.bounds.right)p=(0===this.N? H:-A)/2;b.l(q++,C+p,y)}else{if(270===this.N?E<=m.bounds.y:E>=m.bounds.bottom)p=(90===this.N?H:-A)/2;b.l(q++,w,E+p)}b.l(q++,C,E)}}else{for(;null!==m&&m!==n;){A=z=null;for(m=m.destinationEdges.iterator;m.next()&&(w=m.value,w.link!==c.link||(z=w.toVertex,A=w.fromVertex,null!==A.node&&(A=null),null!==z.node)););if(null===z)break;z!==n&&(w=b.i(q-1).x,y=b.i(q-1).y,C=z.centerX,E=z.centerY,p?180===this.N||0===this.N?(null!==A?A.centerY:y)!==E&&(A=this.Ya[z.layer]+this.$f.x,q===b.firstPickIndex+1&&(A=0=== this.N?Math.max(A,w):Math.min(A,w)),b.l(q++,A,y),b.l(q++,A,E)):(null!==A?A.centerX:w)!==C&&(A=this.Ya[z.layer]+this.$f.y,q===b.firstPickIndex+1&&(A=90===this.N?Math.max(A,y):Math.min(A,y)),b.l(q++,w,A),b.l(q++,C,A)):(A=Math.max(10,this.je[z.layer]),H=Math.max(10,this.Jd[z.layer]),r?180===this.N?(b.l(q++,C+H+u,E),b.l(q++,Math.max(C+H-u/2,C),E),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,Math.min(C-A+u/2,C),E),b.l(q++,C-A-u,E)):90===this.N?(b.l(q++,C,E-A-u),b.l(q++,C,Math.min(E-A+u/2,E)),b.l(q++,C,E),b.l(q++, C,E),b.l(q++,C,Math.max(E+H-u/2,E)),b.l(q++,C,E+H+u)):270===this.N?(b.l(q++,C,E+H+u),b.l(q++,C,Math.max(E+H-u/2,E)),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,C,Math.min(E-A+u/2,E)),b.l(q++,C,E-A-u)):(b.l(q++,C-A-u,E),b.l(q++,Math.min(C-A+u/2,C),E),b.l(q++,C,E),b.l(q++,C,E),b.l(q++,Math.max(C+H-u/2,C),E),b.l(q++,C+H+u,E)):180===this.N?(b.l(q++,C+H,E),b.l(q++,C-A,E)):90===this.N?(b.l(q++,C,E-A),b.l(q++,C,E+H)):270===this.N?(b.l(q++,C,E+H),b.l(q++,C,E-A)):(b.l(q++,C-A,E),b.l(q++,C+H,E))));m=z}p&&(w=b.i(q-1).x, y=b.i(q-1).y,C=b.i(q).x,E=b.i(q).y,180===this.N||0===this.N?y!==E&&(A=0===this.N?Math.min(Math.max((C+w)/2,this.Ya[n.layer]+this.$f.x),C):Math.max(Math.min((C+w)/2,this.Ya[n.layer]+this.$f.x),C),b.l(q++,A,y),b.l(q++,A,E)):w!==C&&(A=90===this.N?Math.min(Math.max((E+y)/2,this.Ya[n.layer]+this.$f.y),E):Math.max(Math.min((E+y)/2,this.Ya[n.layer]+this.$f.y),E),b.l(q++,w,A),b.l(q++,C,A)))}null!==d&&r&&(null!==g&&(l===zc&&(l=b.i(0),d=b.i(2),l.D(d)||b.P(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,zc, !0,!1,f,h),l.u()||l.set(e.actualBounds.center),b.P(0,l.x,l.y)),null!==h&&(k===zc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.D(l)||b.P(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,zc,!1,!1,e,g),e.u()||e.set(f.actualBounds.center),b.P(b.pointsCount-1,e.x,e.y)));b.If();c.commit()}}}this.avoidOrthogonalOverlaps()}; Ws.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new I,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0f.y&&(m=l.y>f.y?0:g.xf.x&&(m=l.x>f.x?0:g.yb.layer?1:a.qdb.qd?1:a.Mcb.Mc?1:0:0};t.iy=function(a,b){return a instanceof $t&&b instanceof $t&&a!==b?a.firstb.first||a.jb.j||a.qdb.qd?1:a.Mcb.Mc?1:0:0}; t.Ps=function(a,b){return a instanceof $t&&b instanceof $t&&a!==b?a.lcb.lc||a.jb.j||a.qdb.qd?1:a.Mcb.Mc?1:0:0};t.C=function(a,b){G&&(D(a,Ws,"isApprox:a"),D(b,Ws,"isApprox:b"));a-=b;return-1a}; t.Ji=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&v("not in range 0 <= from < length: "+c),2===f)d=a[c],e=a[c+1],0=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b=e)for(d=a.slice(c),d.sort(b),b=c;b=a.Oe.length){var d=[];for(var e=0;ea&&(this.jg=a,this.F()))}},alignOption:{configurable:!0,get:function(){return this.Ae},set:function(a){this.Ae!==a&&(B(a,"number",Ws,"align"),0<=a&&16>a&&(this.Ae=a,this.F()))}},setsPortSpots:{configurable:!0,get:function(){return this.Bf},set:function(a){this.Bf!==a&&(B(a,"boolean",Ws,"setsPortSpots"),this.Bf=a,this.F())}},linkSpacing:{configurable:!0, get:function(){return this.Kn},set:function(a){this.Kn!==a&&(B(a,"number",Ws,"linkSpacing"),0<=a&&(this.Kn=a,this.F()))}},maxLayer:{configurable:!0,get:function(){return this.Oa}},maxIndex:{configurable:!0,get:function(){return this.Oq}},maxColumn:{configurable:!0,get:function(){return this.Va}},minIndexLayer:{configurable:!0,get:function(){return this.Pn}},maxIndexLayer:{configurable:!0,get:function(){return this.Kd}}}); var Xs=new F(Ws,"CycleDepthFirst",0),pt=new F(Ws,"CycleGreedy",1),bt=new F(Ws,"CycleFromLayers",2),Ys=new F(Ws,"LayerOptimalLinkLength",0),ut=new F(Ws,"LayerLongestPathSink",1),wt=new F(Ws,"LayerLongestPathSource",2),Zs=new F(Ws,"InitDepthFirstOut",0),Ct=new F(Ws,"InitDepthFirstIn",1),At=new F(Ws,"InitNaive",2),Gt=new F(Ws,"AggressiveNone",0),$s=new F(Ws,"AggressiveLess",1),Ht=new F(Ws,"AggressiveMore",2),It=8;Ws.className="LayeredDigraphLayout";Ws.CycleDepthFirst=Xs;Ws.CycleGreedy=pt; Ws.CycleFromLayers=bt;Ws.LayerOptimalLinkLength=Ys;Ws.LayerLongestPathSink=ut;Ws.LayerLongestPathSource=wt;Ws.InitDepthFirstOut=Zs;Ws.InitDepthFirstIn=Ct;Ws.InitNaive=At;Ws.AggressiveNone=Gt;Ws.AggressiveLess=$s;Ws.AggressiveMore=Ht;Ws.PackNone=0;Ws.PackExpand=1;Ws.PackStraighten=2;Ws.PackMedian=4;Ws.PackAll=15;Ws.AlignNone=0;Ws.AlignUpperLeft=1;Ws.AlignUpperRight=2;Ws.AlignLowerLeft=4;Ws.AlignLowerRight=8;Ws.AlignAll=15; function $t(){this.index=this.Mc=this.qd=this.lc=this.first=this.layer=0;this.link=null;this.j=0}$t.className="SegInfo";function at(a){Iq.call(this,a)}na(at,Iq);at.prototype.createVertex=function(){return new au(this)};at.prototype.createEdge=function(){return new bu(this)};at.className="LayeredDigraphNetwork";function au(a){Lq.call(this,a);this.jo=this.lo=this.ko=this.mo=null;this.eb=this.Ig=this.nj=-1;this.v=NaN;this.G=null;this.valid=!1;this.finish=this.Ul=NaN;this.Oj=0;this.nv=this.ov=null} na(au,Lq);function cu(a,b){return a.index-b.index}function Wt(a,b){if(!a.jo){for(var c=[],d=ca(a.destinationEdgesArrayAccess),e=d.next();!e.done;e=d.next())e=e.value,e.valid&&c.push(e);a.jo=c}a=ca(a.jo);for(c=a.next();!c.done;c=a.next())if(c=c.value,c.toVertex===b)return c;v("Unable to find destination edge to given vertex")}function Tt(a){if(!a.mo){for(var b=[],c=ca(a.sourceEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.fromVertex);b.sort(cu);a.mo=b}return a.mo} function Vt(a){if(!a.ko){for(var b=[],c=ca(a.destinationEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,d.valid&&b.push(d.toVertex);b.sort(cu);a.ko=b}return a.ko}au.prototype.Ll=function(a){Lq.prototype.Ll.call(this,a);this.lo=this.mo=null};au.prototype.Tl=function(a){Lq.prototype.Tl.call(this,a);this.lo=this.mo=null};au.prototype.Il=function(a){Lq.prototype.Il.call(this,a);this.jo=this.ko=null};au.prototype.Sl=function(a){Lq.prototype.Sl.call(this,a);this.jo=this.ko=null}; oa.Object.defineProperties(au.prototype,{layer:{configurable:!0,get:function(){return this.nj},set:function(a){this.nj!==a&&(B(a,"number",au,"layer"),this.nj=a)}},column:{configurable:!0,get:function(){return this.Ig},set:function(a){this.Ig!==a&&(B(a,"number",au,"column"),this.Ig=a)}},index:{configurable:!0,get:function(){return this.eb},set:function(a){this.eb!==a&&(B(a,"number",au,"index"),this.eb=a)}},component:{configurable:!0,get:function(){return this.v}, set:function(a){this.v!==a&&(B(a,"number",au,"component"),this.v=a)}},near:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(G&&null!==a&&x(a,au,au,"near"),this.G=a)}}});au.prototype.deleteDestinationEdge=au.prototype.Sl;au.prototype.addDestinationEdge=au.prototype.Il;au.prototype.deleteSourceEdge=au.prototype.Tl;au.prototype.addSourceEdge=au.prototype.Ll;au.className="LayeredDigraphVertex"; function bu(a){Mq.call(this,a);this.j=this.ma=this.Na=!1;this.Z=this.v=NaN;this.G=this.m=0}na(bu,Mq); oa.Object.defineProperties(bu.prototype,{fromVertex:{configurable:!0,get:function(){return this.hd},set:function(a){this.hd!==a&&(G&&null!==a&&x(a,au,bu,"fromVertex"),this.hd=a)}},toVertex:{configurable:!0,get:function(){return this.od},set:function(a){this.od!==a&&(G&&null!==a&&x(a,au,bu,"toVertex"),this.od=a)}},valid:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na!==a&&(B(a,"boolean",bu,"valid"),this.Na=a)}},rev:{configurable:!0, enumerable:!0,get:function(){return this.ma},set:function(a){this.ma!==a&&(B(a,"boolean",bu,"rev"),this.ma=a)}},forest:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(B(a,"boolean",bu,"forest"),this.j=a)}},portFromPos:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(B(a,"number",bu,"portFromPos"),this.v=a)}},portToPos:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(B(a,"number", bu,"portToPos"),this.Z=a)}},portFromColOffset:{configurable:!0,get:function(){return this.m},set:function(a){this.m!==a&&(B(a,"number",bu,"portFromColOffset"),this.m=a)}},portToColOffset:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(B(a,"number",bu,"portToColOffset"),this.G=a)}}});bu.className="LayeredDigraphEdge"; function Y(a){Ei.call(this);this.Wb=new J;this.eo=du;this.ud=eu;this.Do=fu;this.Hq=gu;this.gw=[];this.sd=!0;this.Sb=hu;this.be=(new Gb(10,10)).freeze();var b=new iu(this);this.$=new ju(b);this.aa=new ju(b);this.zu=[];a&&Object.assign(this,a)}na(Y,Ei);Y.prototype.cloneProtected=function(a){Ei.prototype.cloneProtected.call(this,a);a.eo=this.eo;a.Do=this.Do;a.Hq=this.Hq;a.sd=this.sd;a.Sb=this.Sb;a.be.assign(this.be);a.$.copyInheritedPropertiesFrom(this.$);a.aa.copyInheritedPropertiesFrom(this.aa)}; Y.prototype.xb=function(a){a.classType===Y?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.arrangement=a:0===a.name.indexOf("Compaction")?this.compaction=a:0===a.name.indexOf("Path")?this.path=a:0===a.name.indexOf("Sorting")?this.sorting=a:0===a.name.indexOf("Style")?this.treeStyle=a:v("Unknown enum value: "+a):Ei.prototype.xb.call(this,a)};Y.prototype.createNetwork=function(){return new iu(this)}; Y.prototype.makeNetwork=function(a){function b(a){if(a instanceof V)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof T){var b=a.fromNode;if(null===b||b.isLinkLabel||"Comment"===b.category)return!1;a=a.toNode;return null===a||a.isLinkLabel||"Comment"===a.category?!1:!0}return!1}var c=this.createNetwork();a instanceof Q?(c.tg(a.nodes,!0,b),c.tg(a.links,!0,b)):a instanceof Df?c.tg(a.memberParts,!1,b):c.tg(a.iterator,!1,b);return c}; Y.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==ku&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof Q&&(b=a);this.path===du&&null!==b?this.ud=b.isTreePathToChildren?eu:lu:this.ud=this.path===du?eu:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0} Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){G&&x(a,ju,Y,"removeChild:p");G&&x(b,ju,Y,"removeChild:c");for(var c=a.children,d=0,e=0;ee?Su(this,a,g,fa,w,y):Tu(this,a,g,fa,w,y);fa=y.x;w=y.width;y=y.height;break;case Gu:for(C=0;Cn&&(aavb&&(Yu(a,-vb,0,la,ya-1),Zu(C,-vb,0),Zu(E,-vb,0),vb=0)}La.V.h(vb,Z);w=Math.max(w,H);y=Math.max(y,A+(0===R?0:q)+sb.height);aa=H}else{0n&&(Zvb&&(Yu(a,0,-vb,la,ya-1),Zu(C,0,-vb),Zu(E,0,-vb),vb=0);La.V.h(aa,vb);y=Math.max(y,S);w=Math.max(w,A+(0===R?0:q)+sb.width);Z=S}O++}0l&&(l=0),135u&&(u=0),k===Hu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>w&&(w=dv(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=bv(a,w,l),0>l&&(g-=l,l=0),135y&&(y=dv(k,0,z-y),g=y.x,h=y.y,y=z,u=0):y=cv(a,y,u),0>u&&(h-=u,u=0),g+=d+c);if(0< R)e=Uu(this,4),R=Uu(this,4),b?(e[2].h(0,z+c),e[3].h(e[2].x,y),R[2].h(w,e[2].y),R[3].h(R[2].x,e[3].y)):(e[2].h(d+c,0),e[3].h(w,e[2].y),R[2].h(e[2].x,y),R[3].h(e[3].x,R[2].y));else{e=Uu(this,C.length+2);R=Uu(this,E.length+2);for(k=0;ke[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(l+ d,0),R[1].h(R[0].x,z),R[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(0,u+z),R[1].h(d,R[0].y),R[2].xd?Su(a,b,e,O,A,C):Tu(a,b,e,O,A,C);O=C.x;A=C.width;C=C.height;break;case Gu:for(p=0;pp&&(Hp&&(Sn&&(n=0),135w&&(w=0));b.ra.h(n,w);b.Ja.h(A,C)}}Y.prototype.customAlignment=function(a,b,c,d,e){return[b,c,d,e]}; function Su(a,b,c,d,e,f){G&&x(b,ju,Y,"layoutBusChildrenPosDir:v");var g=c.length;if(0===g)return new M(d,0,e,f);if(1===g)return b=c[0],e=b.Ja.width,f=b.Ja.height,new M(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=90===Pu(b),m=0,n=0,p=0,r=0;rl&&(e-=l),f=Math.max(f,Math.max(r,p)+a+g.height),0>c.V.x&&(d=fv(b,c.V.x,!1,d,h))):(c.V.h(e+a,d+h/2-c.focus.y-c.ra.y),e=Math.max(e,Math.max(q,n)+a+g.width),p=d+h/2-c.focus.y-c.ra.y,f=Math.max(f,p+g.height),0>p&&(f-=p),0>c.V.y&&(d=fv(b,c.V.y,!0,d,h))));return new M(d,0,e,f)} function Tu(a,b,c,d,e,f){G&&x(b,ju,Y,"layoutBusChildrenNegDir:v");var g=c.length;if(0===g)return new M(d,0,e,f);if(1===g)return c=c[0],e=c.Ja.width,f=c.Ja.height,new M(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=270===Pu(b),m=0,n=0,p=0,r=0;rn&&(e-=n),f=Math.max(f,Math.abs(Math.min(r,p))+a+m.height),0>k.V.x&&(d=fv(b,k.V.x,!1,d,h))):(k.V.h(-e-m.width-a,d+h/2-k.focus.y-k.ra.y),e=Math.max(e,Math.abs(Math.min(q,n))+a+m.width),p=d+h/2-k.focus.y-k.ra.y,f=Math.max(f,p+m.height),0>p&&(f-=p),0>k.V.y&&(d=fv(b,k.V.y,!0,d,h))));for(b=0;bb&&(b=c+a.width),0>c&&(b-=c),b;case Qu:return a.width>b?a.width:b;case Ru:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case Fu:case vu:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case Gu:return a.width-a.focus.x+a.nodeSpacing/2+b;case Hu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function cv(a,b,c){G&&x(a,ju,Y,"calculateSubheight:v");switch(a.alignment){case av:case $u:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Qu:return a.height>b?a.height:b;case Ru:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case Fu:case vu:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case Gu:return a.height-a.focus.y+a.nodeSpacing/2+b;case Hu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function dv(a,b,c){G&&x(a,F,Y,"alignOffset:align");switch(a){case $u:b/=2;c/=2;break;case av:b/=2;c/=2;break;case Qu:c=b=0;break;case Ru:break;default:v("Unhandled alignment value "+a.toString())}return new K(b,c)}function Vu(a,b,c,d,e,f){G&&x(a,ju,Y,"shiftRelPosAlign:v");G&&x(b,F,Y,"shiftRelPosAlign:align");b=dv(b,c,d);Yu(a,b.x,b.y,e,f)}function Yu(a,b,c,d,e){G&&x(a,ju,Y,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].V;f.x+=b;f.y+=c}} function Wu(a,b,c,d){G&&(x(b,ju,Y,"recordMidPoints:v"),B(c,"number",Y,"recordMidPoints:x"),B(d,"number",Y,"recordMidPoints:y"));var e=b.parent;switch(a.ud){case eu:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case lu:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.ud.toString())}}function Zu(a,b,c){for(var d=0;dn.length||null===r||2>r.length))for(e=c= 0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=Uu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=Uu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Uu(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x, k.y);f=Uu(a,e);for(c=0;cn.length||null===r||2>r.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=Uu(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=Uu(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=Uu(a,n.length+f.length); for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=Uu(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}Y.prototype.computeLayerSpacing=function(a){G&&x(a,ju,Y,"computeLayerSpacing:v");var b=Pu(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.$.nodeIndentPastParent=a,this.F()))}},nodeSpacing:{configurable:!0,get:function(){return this.$.nodeSpacing},set:function(a){this.$.nodeSpacing!==a&&(B(a,"number",Y,"nodeSpacing"),this.$.nodeSpacing=a,this.F())}},layerSpacing:{configurable:!0,get:function(){return this.$.layerSpacing},set:function(a){this.$.layerSpacing!==a&&(B(a,"number",Y,"layerSpacing"),this.$.layerSpacing=a,this.F())}},layerSpacingParentOverlap:{configurable:!0, enumerable:!0,get:function(){return this.$.layerSpacingParentOverlap},set:function(a){this.$.layerSpacingParentOverlap!==a&&(B(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.$.layerSpacingParentOverlap=a,this.F()))}},compaction:{configurable:!0,get:function(){return this.$.compaction},set:function(a){this.$.compaction!==a&&($a(a,Y,Y,"compaction"),a===Mu||a===Ou)&&(this.$.compaction=a,this.F())}},breadthLimit:{configurable:!0,get:function(){return this.$.breadthLimit}, set:function(a){this.$.breadthLimit!==a&&(B(a,"number",Y,"breadthLimit"),0<=a&&(this.$.breadthLimit=a,this.F()))}},rowSpacing:{configurable:!0,get:function(){return this.$.rowSpacing},set:function(a){this.$.rowSpacing!==a&&(B(a,"number",Y,"rowSpacing"),this.$.rowSpacing=a,this.F())}},rowIndent:{configurable:!0,get:function(){return this.$.rowIndent},set:function(a){this.$.rowIndent!==a&&(B(a,"number",Y,"rowIndent"),0<=a&&(this.$.rowIndent=a,this.F()))}},commentSpacing:{configurable:!0, enumerable:!0,get:function(){return this.$.commentSpacing},set:function(a){this.$.commentSpacing!==a&&(B(a,"number",Y,"commentSpacing"),this.$.commentSpacing=a,this.F())}},commentMargin:{configurable:!0,get:function(){return this.$.commentMargin},set:function(a){this.$.commentMargin!==a&&(B(a,"number",Y,"commentMargin"),this.$.commentMargin=a,this.F())}},setsPortSpot:{configurable:!0,get:function(){return this.$.setsPortSpot},set:function(a){this.$.setsPortSpot!==a&&(B(a, "boolean",Y,"setsPortSpot"),this.$.setsPortSpot=a,this.F())}},portSpot:{configurable:!0,get:function(){return this.$.portSpot},set:function(a){x(a,Hb,Y,"portSpot");this.$.portSpot.D(a)||(this.$.portSpot=a,this.F())}},setsChildPortSpot:{configurable:!0,get:function(){return this.$.setsChildPortSpot},set:function(a){this.$.setsChildPortSpot!==a&&(B(a,"boolean",Y,"setsChildPortSpot"),this.$.setsChildPortSpot=a,this.F())}},childPortSpot:{configurable:!0,get:function(){return this.$.childPortSpot}, set:function(a){x(a,Hb,Y,"childPortSpot");this.$.childPortSpot.D(a)||(this.$.childPortSpot=a,this.F())}},alternateSorting:{configurable:!0,get:function(){return this.aa.sorting},set:function(a){this.aa.sorting!==a&&($a(a,Y,Y,"alternateSorting"),a===Au||a===Bu||a===Cu||Du)&&(this.aa.sorting=a,this.F())}},alternateComparer:{configurable:!0,get:function(){return this.aa.comparer},set:function(a){this.aa.comparer!==a&&(B(a,"function",Y,"alternateComparer"),this.aa.comparer= a,this.F())}},alternateAngle:{configurable:!0,get:function(){return this.aa.angle},set:function(a){this.aa.angle!==a&&(B(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.aa.angle=a,this.F())}},alternateAlignment:{configurable:!0,get:function(){return this.aa.alignment},set:function(a){this.aa.alignment!==a&&($a(a,Y,Y,"alternateAlignment"),this.aa.alignment=a,this.F())}},alternateNodeIndent:{configurable:!0,get:function(){return this.aa.nodeIndent}, set:function(a){this.aa.nodeIndent!==a&&(B(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.aa.nodeIndent=a,this.F()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.aa.nodeIndentPastParent},set:function(a){this.aa.nodeIndentPastParent!==a&&(B(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.aa.nodeIndentPastParent=a,this.F()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.aa.nodeSpacing},set:function(a){this.aa.nodeSpacing!== a&&(B(a,"number",Y,"alternateNodeSpacing"),this.aa.nodeSpacing=a,this.F())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.aa.layerSpacing},set:function(a){this.aa.layerSpacing!==a&&(B(a,"number",Y,"alternateLayerSpacing"),this.aa.layerSpacing=a,this.F())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.aa.layerSpacingParentOverlap},set:function(a){this.aa.layerSpacingParentOverlap!==a&&(B(a,"number",Y,"alternateLayerSpacingParentOverlap"), 0<=a&&1>=a&&(this.aa.layerSpacingParentOverlap=a,this.F()))}},alternateCompaction:{configurable:!0,get:function(){return this.aa.compaction},set:function(a){this.aa.compaction!==a&&($a(a,Y,Y,"alternateCompaction"),a===Mu||a===Ou)&&(this.aa.compaction=a,this.F())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.aa.breadthLimit},set:function(a){this.aa.breadthLimit!==a&&(B(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.aa.breadthLimit=a,this.F()))}}, alternateRowSpacing:{configurable:!0,get:function(){return this.aa.rowSpacing},set:function(a){this.aa.rowSpacing!==a&&(B(a,"number",Y,"alternateRowSpacing"),this.aa.rowSpacing=a,this.F())}},alternateRowIndent:{configurable:!0,get:function(){return this.aa.rowIndent},set:function(a){this.aa.rowIndent!==a&&(B(a,"number",Y,"alternateRowIndent"),0<=a&&(this.aa.rowIndent=a,this.F()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.aa.commentSpacing}, set:function(a){this.aa.commentSpacing!==a&&(B(a,"number",Y,"alternateCommentSpacing"),this.aa.commentSpacing=a,this.F())}},alternateCommentMargin:{configurable:!0,get:function(){return this.aa.commentMargin},set:function(a){this.aa.commentMargin!==a&&(B(a,"number",Y,"alternateCommentMargin"),this.aa.commentMargin=a,this.F())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.aa.setsPortSpot},set:function(a){this.aa.setsPortSpot!==a&&(B(a,"boolean",Y,"alternateSetsPortSpot"), this.aa.setsPortSpot=a,this.F())}},alternatePortSpot:{configurable:!0,get:function(){return this.aa.portSpot},set:function(a){x(a,Hb,Y,"alternatePortSpot");this.aa.portSpot.D(a)||(this.aa.portSpot=a,this.F())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.aa.setsChildPortSpot},set:function(a){this.aa.setsChildPortSpot!==a&&(B(a,"boolean",Y,"alternateSetsChildPortSpot"),this.aa.setsChildPortSpot=a,this.F())}},alternateChildPortSpot:{configurable:!0, enumerable:!0,get:function(){return this.aa.childPortSpot},set:function(a){x(a,Hb,Y,"alternateChildPortSpot");this.aa.childPortSpot.D(a)||(this.aa.childPortSpot=a,this.F())}}}); var du=new F(Y,"PathDefault",-1),eu=new F(Y,"PathDestination",0),lu=new F(Y,"PathSource",1),Au=new F(Y,"SortingForwards",10),Bu=new F(Y,"SortingReverse",11),Cu=new F(Y,"SortingAscending",12),Du=new F(Y,"SortingDescending",13),$u=new F(Y,"AlignmentCenterSubtrees",20),av=new F(Y,"AlignmentCenterChildren",21),Qu=new F(Y,"AlignmentStart",22),Ru=new F(Y,"AlignmentEnd",23),Fu=new F(Y,"AlignmentBus",24),vu=new F(Y,"AlignmentBusBranching",25),Gu=new F(Y,"AlignmentTopLeftBus",26),Hu=new F(Y,"AlignmentBottomRightBus", 27),Mu=new F(Y,"CompactionNone",30),Ou=new F(Y,"CompactionBlock",31),fu=new F(Y,"StyleLayered",40),zu=new F(Y,"StyleLastParents",41),yu=new F(Y,"StyleAlternating",42),xu=new F(Y,"StyleRootOnly",43),hu=new F(Y,"ArrangementVertical",50),hv=new F(Y,"ArrangementHorizontal",51),ku=new F(Y,"ArrangementFixedRoots",52),gu=new F(Y,"LayerIndividual",60),tu=new F(Y,"LayerSiblings",61),su=new F(Y,"LayerUniform",62);Y.className="TreeLayout";Y.PathDefault=du;Y.PathDestination=eu;Y.PathSource=lu; Y.SortingForwards=Au;Y.SortingReverse=Bu;Y.SortingAscending=Cu;Y.SortingDescending=Du;Y.AlignmentCenterSubtrees=$u;Y.AlignmentCenterChildren=av;Y.AlignmentStart=Qu;Y.AlignmentEnd=Ru;Y.AlignmentBus=Fu;Y.AlignmentBusBranching=vu;Y.AlignmentTopLeftBus=Gu;Y.AlignmentBottomRightBus=Hu;Y.CompactionNone=Mu;Y.CompactionBlock=Ou;Y.StyleLayered=fu;Y.StyleLastParents=zu;Y.StyleAlternating=yu;Y.StyleRootOnly=xu;Y.ArrangementVertical=hu;Y.ArrangementHorizontal=hv;Y.ArrangementFixedRoots=ku;Y.LayerIndividual=gu; Y.LayerSiblings=tu;Y.LayerUniform=su;function iu(a){Iq.call(this,a)}na(iu,Iq);iu.prototype.createVertex=function(){return new ju(this)};iu.prototype.createEdge=function(){return new jv(this)};iu.className="TreeNetwork"; function ju(a){Lq.call(this,a);this.Z=!1;this.ob=null;this.v=[];this.ub=this.Na=this.G=this.ma=0;this.sd=null;this.V=new K(0,0);this.Ja=new Gb(0,0);this.ra=new K(0,0);this.tm=this.sm=this.zA=!1;this.rp=this.fp=null;this.ld=Au;this.fd=Sq;this.Nb=0;this.Mb=av;this.ar=this.$q=0;this.br=20;this.ke=50;this.Gq=0;this.Op=Ou;this.Hp=0;this.ur=25;this.Np=this.tr=10;this.Mp=20;this.Cr=!0;this.jr=gd;this.Br=!0;this.Kp=gd}na(ju,Lq); ju.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.ld=a.sorting,this.fd=a.comparer,this.Nb=a.angle,this.Mb=a.alignment,this.$q=a.nodeIndent,this.ar=a.nodeIndentPastParent,this.br=a.nodeSpacing,this.ke=a.layerSpacing,this.Gq=a.layerSpacingParentOverlap,this.Op=a.compaction,this.Hp=a.breadthLimit,this.ur=a.rowSpacing,this.tr=a.rowIndent,this.Np=a.commentSpacing,this.Mp=a.commentMargin,this.Cr=a.setsPortSpot,this.jr=a.portSpot,this.Br=a.setsChildPortSpot,this.Kp=a.childPortSpot)}; oa.Object.defineProperties(ju.prototype,{initialized:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(B(a,"boolean",ju,"initialized"),this.Z=a)}},parent:{configurable:!0,get:function(){return this.ob},set:function(a){this.ob!==a&&(G&&null!==a&&x(a,ju,ju,"parent"),this.ob=a)}},children:{configurable:!0,get:function(){return this.v},set:function(a){if(this.v!==a){null===a||Array.isArray(a)||Aa(a,"Array",ju,"children:value");if(null!== a)for(var b=a.length,c=0;cr.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Qu?(f=d.top+e.y,0===e.y&&n.yr.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))):c.alignment===Qu?(f=d.left+e.x,0===e.x&&n.xr.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Qu?(f=d.top+e.y,0===e.y&&n.yr.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))): c.alignment===Qu?(f=d.left+e.x,0===e.x&&n.x