UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

121 lines 871 kB
/* * GoJS v2.0.0-alpha2 JavaScript Library for HTML Diagrams * Northwoods Software, https://www.nwoods.com/ * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation. * Copyright (C) 1998-2018 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.0.0-alpha2/doc/license.html. */ (function(self) { var u,aa="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,ba="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ca;if("function"==typeof Object.setPrototypeOf)ca=Object.setPrototypeOf;else{var da;a:{var ea={a:!0},ha={};try{ha.__proto__=ea;da=ha.a;break a}catch(a){}da=!1}ca=da?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ia=ca; function ka(a,b){a.prototype=ba(b.prototype);a.prototype.constructor=a;if(ia)ia(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.qy=b.prototype}var ma="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function na(){na=function(){};aa.Symbol||(aa.Symbol=oa)} var oa=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}();function pa(){na();var a=aa.Symbol.iterator;a||(a=aa.Symbol.iterator=aa.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&ma(Array.prototype,a,{writable:!0,value:function(){return qa(this)}});pa=function(){}}function qa(a){var b=0;return ra(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ra(a){pa();a={next:a};a[aa.Symbol.iterator]=function(){return this};return a} function ta(a){pa();var b=a[Symbol.iterator];return b?b.call(a):qa(a)}function ua(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}function va(a){if(a){for(var b=aa,c=["Array","prototype","fill"],d=0;d<c.length-1;d++){var e=c[d];e in b||(b[e]={});b=b[e]}c=c[c.length-1];d=b[c];a=a(d);a!=d&&null!=a&&ma(b,c,{writable:!0,value:a})}} va(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<d;c++)this[c]=a;return this}});var z="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.l===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===z.requestAnimationFrame&&(z.requestAnimationFrame=setImmediate);function xa(){}function ya(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&z.clearTimeout(c);c=za(function(){c=-1;a.apply(d,e)},b)}}function za(a,b){return z.setTimeout(a,b)}function Ca(a){return z.document.createElement(a)} function B(a){throw Error(a);}function Da(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);B(a)}function Ea(a,b,c,d){c=null===c?"*":"string"===typeof c?c:"function"===typeof c&&"string"===typeof c.className?c.className:"";void 0!==d&&(c+="."+d);B(c+" is not in the range "+b+": "+a)} function Ga(a){B("Collection was modified during iteration: "+a.toString()+"\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.")}function Ia(a){z.console&&z.console.log(a)}function Ja(){z.console&&z.console.log("Warning: List/Map/Set constructors no longer take an argument that enforces type.Instead they take an optional collection of Values to add to the collection. See 2.0 changelog for details.")} function Ka(a){return"object"===typeof a&&null!==a}function La(a){return Array.isArray(a)||z.NodeList&&a instanceof z.NodeList||z.HTMLCollection&&a instanceof z.HTMLCollection}function Na(a){return Array.prototype.slice.call(a)}function Oa(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):B("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)} function Pa(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):B("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Qa(){var a=Sa.pop();return void 0===a?[]:a}function Ua(a){a.length=0;Sa.push(a)}function Va(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(Ka(a)&&a.constructor)return Va(a.constructor);return typeof a} function Wa(a){var b=a;Ka(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 Xa(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.ky;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function $a(a,b,c){Object.defineProperty(ab.prototype,a,{get:b,set:c})} function bb(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;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;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;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f} var cb=!1,eb=void 0!==z.document,fb=void 0!==z.navigator&&0<z.navigator.userAgent.indexOf("MSIE 9.0"),ib=void 0!==z.navigator&&0<z.navigator.userAgent.indexOf("MSIE 10.0"),jb=void 0!==z.navigator&&0<z.navigator.userAgent.indexOf("Trident/7"),mb=void 0!==z.navigator&&0<z.navigator.userAgent.indexOf("Edge/"),pb=void 0!==z.navigator&&void 0!==z.navigator.platform&&0<=z.navigator.platform.toUpperCase().indexOf("MAC"),qb=void 0!==z.navigator&&void 0!==z.navigator.platform&&null!==z.navigator.platform.match(/(iPhone|iPod|iPad)/i), tb=!1,ub=null,wb=null,Sa=[];Object.freeze([]);xa.className="Util";xa.adym="gojs.net";xa.vfo="28e646fdb37b1a8853835e21";xa.className="Util";function D(a,b,c){xb(this);this.l=a;this.Pa=b;this.s=c}D.prototype.toString=function(){return"EnumValue."+this.Pa};function yb(a,b){return void 0===b||null===b||""===b?null:a[b]} aa.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Pa}},value:{get:function(){return this.s}}});D.className="EnumValue";function Ab(){this.Xu=[]}Ab.prototype.toString=function(){return this.Xu.join("")};Ab.prototype.add=function(a){""!==a&&this.Xu.push(a)};Ab.className="StringBuilder";function Bb(){}Bb.className="PropertyCollection";cb=!0; function Cb(){}Cb.prototype.reset=function(){};Cb.prototype.reset=Cb.prototype.reset;Cb.prototype.next=function(){return!1};Cb.prototype.next=Cb.prototype.next;Cb.prototype.Qc=function(){return!1};Cb.prototype.hasNext=Cb.prototype.Qc;Cb.prototype.first=function(){return null};Cb.prototype.first=Cb.prototype.first;Cb.prototype.any=function(){return!1};Cb.prototype.all=function(){return!0};Cb.prototype.each=function(){return this};Cb.prototype.map=function(){return this};Cb.prototype.filter=function(){return this}; Cb.prototype.jd=function(){};Cb.prototype.toString=function(){return"EmptyIterator"};aa.Object.defineProperties(Cb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});var Db=null;Cb.className="EmptyIterator";Db=new Cb;function Eb(a){this.key=-1;this.value=a}Eb.prototype.reset=function(){this.key=-1};Eb.prototype.reset=Eb.prototype.reset;Eb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1}; Eb.prototype.next=Eb.prototype.next;Eb.prototype.Qc=function(){return this.next()};Eb.prototype.hasNext=Eb.prototype.Qc;Eb.prototype.first=function(){this.key=0;return this.value};Eb.prototype.first=Eb.prototype.first;Eb.prototype.any=function(a){this.key=-1;return a(this.value)};Eb.prototype.all=function(a){this.key=-1;return a(this.value)};Eb.prototype.each=function(a){this.key=-1;a(this.value);return this};Eb.prototype.map=function(a){return new Eb(a(this.value))}; Eb.prototype.filter=function(a){return a(this.value)?new Eb(this.value):Db};Eb.prototype.jd=function(){this.value=null};Eb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};aa.Object.defineProperties(Eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});Eb.className="SingletonIterator";function Fb(a){this.ob=a;this.De=null;a.Ga=null;this.la=a.o;this._index=-1} Fb.prototype.reset=function(){var a=this.ob;a.Ga=null;this.la=a.o;this._index=-1};Fb.prototype.reset=Fb.prototype.reset;Fb.prototype.next=function(){var a=this.ob;if(a.o!==this.la){if(0>this.key)return!1;Ga(a)}a=a.j;var b=a.length,c=++this._index,d=this.De;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this._index=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.jd()}return!1};Fb.prototype.next=Fb.prototype.next;Fb.prototype.Qc=function(){return this.next()}; Fb.prototype.hasNext=Fb.prototype.Qc;Fb.prototype.first=function(){var a=this.ob;this.la=a.o;this._index=0;a=a.j;var b=a.length,c=this.De;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this._index=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};Fb.prototype.first=Fb.prototype.first; Fb.prototype.any=function(a){var b=this.ob;b.Ga=null;var c=b.o;this._index=-1;for(var d=b.j,e=d.length,f=this.De,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(a(h))return!0;b.o!==c&&Ga(b)}}return!1};Fb.prototype.all=function(a){var b=this.ob;b.Ga=null;var c=b.o;this._index=-1;for(var d=b.j,e=d.length,f=this.De,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(!a(h))return!1;b.o!==c&&Ga(b)}}return!0}; Fb.prototype.each=function(a){var b=this.ob;b.Ga=null;var c=b.o;this._index=-1;for(var d=b.j,e=d.length,f=this.De,g=0;g<e;g++){var h=d[g];if(null===f||f(h))a(h),b.o!==c&&Ga(b)}return this};Fb.prototype.map=function(a){var b=this.ob;b.Ga=null;var c=b.o;this._index=-1;for(var d=[],e=b.j,f=e.length,g=this.De,h=0;h<f;h++){var k=e[h];if(null===g||g(k))d.push(a(k)),b.o!==c&&Ga(b)}a=new E;a.j=d;a.hb();return a.iterator}; Fb.prototype.filter=function(a){var b=this.ob;b.Ga=null;var c=b.o;this._index=-1;for(var d=[],e=b.j,f=e.length,g=this.De,h=0;h<f;h++){var k=e[h];if(null===g||g(k))a(k)&&d.push(k),b.o!==c&&Ga(b)}a=new E;a.j=d;a.hb();return a.iterator};Fb.prototype.jd=function(){this.key=-1;this.value=null;this.la=-1;this.De=null;this.ob.Ga=this};Fb.prototype.toString=function(){return"ListIterator@"+this._index+"/"+this.ob.count}; aa.Object.defineProperties(Fb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.De},set:function(a){this.De=a}},count:{get:function(){var a=this.De;if(null!==a){for(var b=0,c=this.ob.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.ob.j.length}}});Fb.className="ListIterator";function Gb(a){this.ob=a;a.pg=null;this.la=a.o;this._index=a.j.length} Gb.prototype.reset=function(){var a=this.ob;a.pg=null;this.la=a.o;this._index=a.j.length};Gb.prototype.reset=Gb.prototype.reset;Gb.prototype.next=function(){var a=this.ob;if(a.o!==this.la){if(0>this.key)return!1;Ga(a)}var b=--this._index;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.jd();return!1};Gb.prototype.next=Gb.prototype.next;Gb.prototype.Qc=function(){return this.next()};Gb.prototype.hasNext=Gb.prototype.Qc; Gb.prototype.first=function(){var a=this.ob;this.la=a.o;var b=a.j;this._index=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Gb.prototype.first=Gb.prototype.first;Gb.prototype.any=function(a){var b=this.ob;b.pg=null;var c=b.o,d=b.j,e=d.length;this._index=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.o!==c&&Ga(b)}return!1};Gb.prototype.all=function(a){var b=this.ob;b.pg=null;var c=b.o,d=b.j,e=d.length;this._index=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.o!==c&&Ga(b)}return!0}; Gb.prototype.each=function(a){var b=this.ob;b.pg=null;var c=b.o,d=b.j,e=d.length;this._index=e;for(--e;0<=e;e--)a(d[e]),b.o!==c&&Ga(b);return this};Gb.prototype.map=function(a){var b=this.ob;b.pg=null;var c=b.o,d=[],e=b.j,f=e.length;this._index=f;for(--f;0<=f;f--)d.push(a(e[f])),b.o!==c&&Ga(b);a=new E;a.j=d;a.hb();return a.iterator}; Gb.prototype.filter=function(a){var b=this.ob;b.pg=null;var c=b.o,d=[],e=b.j,f=e.length;this._index=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.o!==c&&Ga(b)}a=new E;a.j=d;a.hb();return a.iterator};Gb.prototype.jd=function(){this.key=-1;this.value=null;this.la=-1;this.ob.pg=this};Gb.prototype.toString=function(){return"ListIteratorBackwards("+this._index+"/"+this.ob.count+")"}; aa.Object.defineProperties(Gb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ob.j.length}}});Gb.className="ListIteratorBackwards";function E(a){xb(this);this.w=!1;this.j=[];this.o=0;this.pg=this.Ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ja():this.addAll(a))}E.prototype.hb=function(){var a=this.o;a++;999999999<a&&(a=0);this.o=a};E.prototype.freeze=function(){this.w=!0;return this}; E.prototype.freeze=E.prototype.freeze;E.prototype.fa=function(){this.w=!1;return this};E.prototype.thaw=E.prototype.fa;E.prototype.toString=function(){return"List()#"+Hb(this)};E.prototype.add=function(a){if(null===a)return this;this.w&&Da(this,a);this.j.push(a);this.hb();return this};E.prototype.add=E.prototype.add;E.prototype.push=function(a){this.add(a)};E.prototype.push=E.prototype.push; E.prototype.addAll=function(a){if(null===a)return this;this.w&&Da(this);var b=this.j;if(La(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.hb();return this};E.prototype.addAll=E.prototype.addAll;E.prototype.clear=function(){this.w&&Da(this);this.j.length=0;this.hb()};E.prototype.clear=E.prototype.clear;E.prototype.contains=function(a){return null===a?!1:-1!==this.j.indexOf(a)};E.prototype.contains=E.prototype.contains;E.prototype.has=function(a){return this.contains(a)}; E.prototype.has=E.prototype.has;E.prototype.indexOf=function(a){return null===a?-1:this.j.indexOf(a)};E.prototype.indexOf=E.prototype.indexOf;E.prototype.M=function(a){var b=this.j;(0>a||a>=b.length)&&Ea(a,"0 <= i < length",E,"elt:i");return b[a]};E.prototype.elt=E.prototype.M;E.prototype.get=function(a){return this.M(a)};E.prototype.get=E.prototype.get;E.prototype.Uc=function(a,b){var c=this.j;(0>a||a>=c.length)&&Ea(a,"0 <= i < length",E,"setElt:i");this.w&&Da(this,a);c[a]=b}; E.prototype.setElt=E.prototype.Uc;E.prototype.set=function(a,b){this.Uc(a,b)};E.prototype.set=E.prototype.set;E.prototype.first=function(){var a=this.j;return 0===a.length?null:a[0]};E.prototype.first=E.prototype.first;E.prototype.Wb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};E.prototype.last=E.prototype.Wb;E.prototype.pop=function(){this.w&&Da(this);var a=this.j;return 0<a.length?a.pop():null};E.prototype.pop=E.prototype.pop; E.prototype.any=function(a){for(var b=this.j,c=this.o,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.o!==c&&Ga(this)}return!1};E.prototype.all=function(a){for(var b=this.j,c=this.o,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.o!==c&&Ga(this)}return!0};E.prototype.each=function(a){for(var b=this.j,c=this.o,d=b.length,e=0;e<d;e++)a(b[e]),this.o!==c&&Ga(this);return this}; E.prototype.map=function(a){for(var b=new E,c=[],d=this.j,e=this.o,f=d.length,g=0;g<f;g++)c.push(a(d[g])),this.o!==e&&Ga(this);b.j=c;b.hb();return b};E.prototype.filter=function(a){for(var b=new E,c=[],d=this.j,e=this.o,f=d.length,g=0;g<f;g++){var h=d[g];a(h)&&c.push(h);this.o!==e&&Ga(this)}b.j=c;b.hb();return b};E.prototype.Hb=function(a,b){0>a&&Ea(a,">= 0",E,"insertAt:i");this.w&&Da(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.hb()};E.prototype.insertAt=E.prototype.Hb; E.prototype.remove=function(a){if(null===a)return!1;this.w&&Da(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.hb();return!0};E.prototype.remove=E.prototype.remove;E.prototype.delete=function(a){return this.remove(a)};E.prototype["delete"]=E.prototype.delete;E.prototype.kb=function(a){var b=this.j;(0>a||a>=b.length)&&Ea(a,"0 <= i < length",E,"removeAt:i");this.w&&Da(this,a);a===b.length-1?b.pop():b.splice(a,1);this.hb()};E.prototype.removeAt=E.prototype.kb; E.prototype.removeRange=function(a,b){var c=this.j,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.w&&Da(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.hb();return this};E.prototype.removeRange=E.prototype.removeRange;E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a};E.prototype.Ia=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}; E.prototype.toArray=E.prototype.Ia;E.prototype.zu=function(){for(var a=new G,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};E.prototype.toSet=E.prototype.zu;E.prototype.sort=function(a){this.w&&Da(this);this.j.sort(a);this.hb();return this};E.prototype.sort=E.prototype.sort; E.prototype.ki=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.w&&Da(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&Ea(b,"0 <= from < length",E,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.hb()),this;if(0===b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]=c[a-b];else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.hb();return this}; E.prototype.sortRange=E.prototype.ki;E.prototype.reverse=function(){this.w&&Da(this);this.j.reverse();this.hb();return this};E.prototype.reverse=E.prototype.reverse; aa.Object.defineProperties(E.prototype,{_dataArray:{get:function(){return this.j}},count:{get:function(){return this.j.length}},size:{get:function(){return this.j.length}},length:{get:function(){return this.j.length}},iterator:{get:function(){if(0>=this.j.length)return Db;var a=this.Ga;return null!==a?(a.reset(),a):new Fb(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return Db;var a=this.pg;return null!==a?(a.reset(),a):new Gb(this)}}});E.className="List";function Kb(a){this.Jf=a;a.Ga=null;this.la=a.o;this.na=null}Kb.prototype.reset=function(){var a=this.Jf;a.Ga=null;this.la=a.o;this.na=null};Kb.prototype.reset=Kb.prototype.reset; Kb.prototype.next=function(){var a=this.Jf;if(a.o!==this.la){if(null===this.key)return!1;Ga(a)}var b=this.na;b=null===b?a.da:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.jd();return!1};Kb.prototype.next=Kb.prototype.next;Kb.prototype.Qc=function(){return this.next()};Kb.prototype.hasNext=Kb.prototype.Qc;Kb.prototype.first=function(){var a=this.Jf;this.la=a.o;a=a.da;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Kb.prototype.first=Kb.prototype.first;Kb.prototype.any=function(a){var b=this.Jf;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(a(d.value))return!0;b.o!==c&&Ga(b);d=d.oa}return!1};Kb.prototype.all=function(a){var b=this.Jf;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(!a(d.value))return!1;b.o!==c&&Ga(b);d=d.oa}return!0};Kb.prototype.each=function(a){var b=this.Jf;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;)a(d.value),b.o!==c&&Ga(b),d=d.oa;return this}; Kb.prototype.map=function(a){var b=this.Jf;b.Ga=null;for(var c=new E,d=b.o,e=b.da;null!==e;)c.add(a(e.value)),b.o!==d&&Ga(b),e=e.oa;return c.iterator};Kb.prototype.filter=function(a){var b=this.Jf;b.Ga=null;for(var c=new E,d=b.o,e=b.da;null!==e;){var f=e.value;a(f)&&c.add(f);b.o!==d&&Ga(b);e=e.oa}return c.iterator};Kb.prototype.jd=function(){this.value=this.key=null;this.la=-1;this.Jf.Ga=this};Kb.prototype.toString=function(){return null!==this.na?"SetIterator@"+this.na.value:"SetIterator"}; aa.Object.defineProperties(Kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Jf.Ab}}});Kb.className="SetIterator";function G(a){xb(this);this.w=!1;this.Bb={};this.Ab=0;this.Ga=null;this.o=0;this.ye=this.da=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ja():this.addAll(a))}G.prototype.hb=function(){var a=this.o;a++;999999999<a&&(a=0);this.o=a};G.prototype.freeze=function(){this.w=!0;return this}; G.prototype.freeze=G.prototype.freeze;G.prototype.fa=function(){this.w=!1;return this};G.prototype.thaw=G.prototype.fa;G.prototype.toString=function(){return"Set()#"+Hb(this)};G.prototype.add=function(a){if(null===a)return this;this.w&&Da(this,a);var b=a;Ka(a)&&(b=Lb(a));void 0===this.Bb[b]&&(this.Ab++,a=new Nb(a,a),this.Bb[b]=a,b=this.ye,null===b?this.da=a:(a.Kk=b,b.oa=a),this.ye=a,this.hb());return this};G.prototype.add=G.prototype.add; G.prototype.addAll=function(a){if(null===a)return this;this.w&&Da(this);if(La(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this};G.prototype.addAll=G.prototype.addAll;G.prototype.contains=function(a){if(null===a)return!1;var b=a;return Ka(a)&&(b=Hb(a),void 0===b)?!1:void 0!==this.Bb[b]};G.prototype.contains=G.prototype.contains;G.prototype.has=function(a){return this.contains(a)};G.prototype.has=G.prototype.has; G.prototype.Mw=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};G.prototype.containsAll=G.prototype.Mw;G.prototype.Nw=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};G.prototype.containsAny=G.prototype.Nw;G.prototype.first=function(){var a=this.da;return null===a?null:a.value};G.prototype.first=G.prototype.first; G.prototype.any=function(a){for(var b=this.o,c=this.da;null!==c;){if(a(c.value))return!0;this.o!==b&&Ga(this);c=c.oa}return!1};G.prototype.all=function(a){for(var b=this.o,c=this.da;null!==c;){if(!a(c.value))return!1;this.o!==b&&Ga(this);c=c.oa}return!0};G.prototype.each=function(a){for(var b=this.o,c=this.da;null!==c;)a(c.value),this.o!==b&&Ga(this),c=c.oa;return this};G.prototype.map=function(a){for(var b=new G,c=this.o,d=this.da;null!==d;)b.add(a(d.value)),this.o!==c&&Ga(this),d=d.oa;return b}; G.prototype.filter=function(a){for(var b=new G,c=this.o,d=this.da;null!==d;){var e=d.value;a(e)&&b.add(e);this.o!==c&&Ga(this);d=d.oa}return b};G.prototype.remove=function(a){if(null===a)return!1;this.w&&Da(this,a);var b=a;if(Ka(a)&&(b=Hb(a),void 0===b))return!1;a=this.Bb[b];if(void 0===a)return!1;var c=a.oa,d=a.Kk;null!==c&&(c.Kk=d);null!==d&&(d.oa=c);this.da===a&&(this.da=c);this.ye===a&&(this.ye=d);delete this.Bb[b];this.Ab--;this.hb();return!0};G.prototype.remove=G.prototype.remove; G.prototype.delete=function(a){return this.remove(a)};G.prototype["delete"]=G.prototype.delete;G.prototype.ip=function(a){if(null===a)return this;this.w&&Da(this);if(La(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};G.prototype.removeAll=G.prototype.ip; G.prototype.Wx=function(a){if(null===a||0===this.count)return this;this.w&&Da(this);var b=new G;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.ip(a);return this};G.prototype.retainAll=G.prototype.Wx;G.prototype.clear=function(){this.w&&Da(this);this.Bb={};this.Ab=0;null!==this.Ga&&this.Ga.reset();this.ye=this.da=null;this.hb()};G.prototype.clear=G.prototype.clear;G.prototype.copy=function(){var a=new G,b=this.Bb,c;for(c in b)a.add(b[c].value);return a}; G.prototype.Ia=function(){var a=Array(this.Ab),b=this.Bb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.toArray=G.prototype.Ia;G.prototype.yu=function(){var a=new E,b=this.Bb,c;for(c in b)a.add(b[c].value);return a};G.prototype.toList=G.prototype.yu;function xb(a){a.__gohashid=Ob++}function Lb(a){var b=a.__gohashid;void 0===b&&(b=Ob++,a.__gohashid=b);return b}function Hb(a){return a.__gohashid} aa.Object.defineProperties(G.prototype,{count:{get:function(){return this.Ab}},size:{get:function(){return this.Ab}},iterator:{get:function(){if(0>=this.Ab)return Db;var a=this.Ga;return null!==a?(a.reset(),a):new Kb(this)}}});var Ob=1;G.className="Set";G.uniqueHash=xb;G.hashIdUnique=Lb;G.hashId=Hb;function Pb(a){this.ia=a;this.la=a.o;this.na=null}Pb.prototype.reset=function(){this.la=this.ia.o;this.na=null}; Pb.prototype.reset=Pb.prototype.reset;Pb.prototype.next=function(){var a=this.ia;if(a.o!==this.la){if(null===this.key)return!1;Ga(a)}var b=this.na;b=null===b?a.da:b.oa;if(null!==b)return this.na=b,this.value=this.key=a=b.key,!0;this.jd();return!1};Pb.prototype.next=Pb.prototype.next;Pb.prototype.Qc=function(){return this.next()};Pb.prototype.hasNext=Pb.prototype.Qc;Pb.prototype.first=function(){var a=this.ia;this.la=a.o;a=a.da;return null!==a?(this.na=a,this.value=this.key=a=a.key):null}; Pb.prototype.first=Pb.prototype.first;Pb.prototype.any=function(a){var b=this.ia,c=b.o;this.na=null;for(var d=b.da;null!==d;){if(a(d.key))return!0;b.o!==c&&Ga(b);d=d.oa}return!1};Pb.prototype.all=function(a){var b=this.ia,c=b.o;this.na=null;for(var d=b.da;null!==d;){if(!a(d.key))return!1;b.o!==c&&Ga(b);d=d.oa}return!0};Pb.prototype.each=function(a){var b=this.ia,c=b.o;this.na=null;for(var d=b.da;null!==d;)a(d.key),b.o!==c&&Ga(b),d=d.oa;return this}; Pb.prototype.map=function(a){var b=this.ia,c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;)d.add(a(e.key)),b.o!==c&&Ga(b),e=e.oa;return d.iterator};Pb.prototype.filter=function(a){var b=this.ia,c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;){var f=e.key;a(f)&&d.add(f);b.o!==c&&Ga(b);e=e.oa}return d.iterator};Pb.prototype.jd=function(){this.value=this.key=null;this.la=-1};Pb.prototype.toString=function(){return null!==this.na?"MapKeySetIterator@"+this.na.value:"MapKeySetIterator"}; aa.Object.defineProperties(Pb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ia.Ab}}});Pb.className="MapKeySetIterator";function Qb(a){G.call(this);xb(this);this.w=!0;this.ia=a}ka(Qb,G);Qb.prototype.freeze=function(){return this};Qb.prototype.freeze=Qb.prototype.freeze;Qb.prototype.fa=function(){return this};Qb.prototype.thaw=Qb.prototype.fa; Qb.prototype.toString=function(){return"MapKeySet("+this.ia.toString()+")"};Qb.prototype.add=function(){B("This Set is read-only: "+this.toString());return this};Qb.prototype.add=Qb.prototype.add;Qb.prototype.contains=function(a){return this.ia.contains(a)};Qb.prototype.contains=Qb.prototype.contains;Qb.prototype.has=function(a){return this.contains(a)};Qb.prototype.has=Qb.prototype.has;Qb.prototype.remove=function(){B("This Set is read-only: "+this.toString());return!1};Qb.prototype.remove=Qb.prototype.remove; Qb.prototype.delete=function(a){return this.remove(a)};Qb.prototype["delete"]=Qb.prototype.delete;Qb.prototype.clear=function(){B("This Set is read-only: "+this.toString())};Qb.prototype.clear=Qb.prototype.clear;Qb.prototype.first=function(){var a=this.ia.da;return null!==a?a.key:null};Qb.prototype.first=Qb.prototype.first;Qb.prototype.any=function(a){for(var b=this.ia.da;null!==b;){if(a(b.key))return!0;b=b.oa}return!1}; Qb.prototype.all=function(a){for(var b=this.ia.da;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};Qb.prototype.each=function(a){for(var b=this.ia.da;null!==b;)a(b.key),b=b.oa;return this};Qb.prototype.map=function(a){for(var b=new G,c=this.ia.da;null!==c;)b.add(a(c.key)),c=c.oa;return b};Qb.prototype.filter=function(a){for(var b=new G,c=this.ia.da;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};Qb.prototype.copy=function(){return new Qb(this.ia)}; Qb.prototype.zu=function(){var a=new G,b=this.ia.Bb,c;for(c in b)a.add(b[c].key);return a};Qb.prototype.toSet=Qb.prototype.zu;Qb.prototype.Ia=function(){var a=this.ia.Bb,b=Array(this.ia.Ab),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Qb.prototype.toArray=Qb.prototype.Ia;Qb.prototype.yu=function(){var a=new E,b=this.ia.Bb,c;for(c in b)a.add(b[c].key);return a};Qb.prototype.toList=Qb.prototype.yu; aa.Object.defineProperties(Qb.prototype,{count:{get:function(){return this.ia.Ab}},size:{get:function(){return this.ia.Ab}},iterator:{get:function(){return 0>=this.ia.Ab?Db:new Pb(this.ia)}}});Qb.className="MapKeySet";function Rb(a){this.ia=a;a.xe=null;this.la=a.o;this.na=null}Rb.prototype.reset=function(){var a=this.ia;a.xe=null;this.la=a.o;this.na=null};Rb.prototype.reset=Rb.prototype.reset; Rb.prototype.next=function(){var a=this.ia;if(a.o!==this.la){if(null===this.key)return!1;Ga(a)}var b=this.na;b=null===b?a.da:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.jd();return!1};Rb.prototype.next=Rb.prototype.next;Rb.prototype.Qc=function(){return this.next()};Rb.prototype.hasNext=Rb.prototype.Qc;Rb.prototype.first=function(){var a=this.ia;this.la=a.o;a=a.da;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null}; Rb.prototype.first=Rb.prototype.first;Rb.prototype.any=function(a){var b=this.ia;b.xe=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(a(d.value))return!0;b.o!==c&&Ga(b);d=d.oa}return!1};Rb.prototype.all=function(a){var b=this.ia;b.xe=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(!a(d.value))return!1;b.o!==c&&Ga(b);d=d.oa}return!0};Rb.prototype.each=function(a){var b=this.ia;b.xe=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;)a(d.value),b.o!==c&&Ga(b),d=d.oa;return this}; Rb.prototype.map=function(a){var b=this.ia;b.xe=null;var c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;)d.add(a(e.value)),b.o!==c&&Ga(b),e=e.oa;return d.iterator};Rb.prototype.filter=function(a){var b=this.ia;b.xe=null;var c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;){var f=e.value;a(f)&&d.add(f);b.o!==c&&Ga(b);e=e.oa}return d.iterator};Rb.prototype.jd=function(){this.value=this.key=null;this.la=-1;this.ia.xe=this}; Rb.prototype.toString=function(){return null!==this.na?"MapValueSetIterator@"+this.na.value:"MapValueSetIterator"};aa.Object.defineProperties(Rb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ia.Ab}}});Rb.className="MapValueSetIterator";function Nb(a,b){this.key=a;this.value=b;this.Kk=this.oa=null}Nb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};Nb.className="KeyValuePair"; function Vb(a){this.ia=a;a.Ga=null;this.la=a.o;this.na=null}Vb.prototype.reset=function(){var a=this.ia;a.Ga=null;this.la=a.o;this.na=null};Vb.prototype.reset=Vb.prototype.reset;Vb.prototype.next=function(){var a=this.ia;if(a.o!==this.la){if(null===this.key)return!1;Ga(a)}var b=this.na;b=null===b?a.da:b.oa;if(null!==b)return this.na=b,this.key=b.key,this.value=b.value,!0;this.jd();return!1};Vb.prototype.next=Vb.prototype.next;Vb.prototype.Qc=function(){return this.next()};Vb.prototype.hasNext=Vb.prototype.Qc; Vb.prototype.first=function(){var a=this.ia;this.la=a.o;a=a.da;return null!==a?(this.na=a,this.key=a.key,this.value=a.value,a):null};Vb.prototype.first=Vb.prototype.first;Vb.prototype.any=function(a){var b=this.ia;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(a(d))return!0;b.o!==c&&Ga(b);d=d.oa}return!1};Vb.prototype.all=function(a){var b=this.ia;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;){if(!a(d))return!1;b.o!==c&&Ga(b);d=d.oa}return!0}; Vb.prototype.each=function(a){var b=this.ia;b.Ga=null;var c=b.o;this.na=null;for(var d=b.da;null!==d;)a(d),b.o!==c&&Ga(b),d=d.oa;return this};Vb.prototype.map=function(a){var b=this.ia;b.Ga=null;var c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;)d.add(a(e)),b.o!==c&&Ga(b),e=e.oa;return d.iterator};Vb.prototype.filter=function(a){var b=this.ia;b.Ga=null;var c=b.o;this.na=null;for(var d=new E,e=b.da;null!==e;)a(e)&&d.add(e),b.o!==c&&Ga(b),e=e.oa;return d.iterator}; Vb.prototype.jd=function(){this.value=this.key=null;this.la=-1;this.ia.Ga=this};Vb.prototype.toString=function(){return null!==this.na?"MapIterator@"+this.na:"MapIterator"};aa.Object.defineProperties(Vb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ia.Ab}}});Vb.className="MapIterator"; function H(a){xb(this);this.w=!1;this.Bb={};this.Ab=0;this.xe=this.Ga=null;this.o=0;this.ye=this.da=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Ja():this.addAll(a))}H.prototype.hb=function(){var a=this.o;a++;999999999<a&&(a=0);this.o=a};H.prototype.freeze=function(){this.w=!0;return this};H.prototype.freeze=H.prototype.freeze;H.prototype.fa=function(){this.w=!1;return this};H.prototype.thaw=H.prototype.fa;H.prototype.toString=function(){return"Map()#"+Hb(this)}; H.prototype.add=function(a,b){this.w&&Da(this,a);var c=a;Ka(a)&&(c=Lb(a));var d=this.Bb[c];void 0===d?(this.Ab++,a=new Nb(a,b),this.Bb[c]=a,c=this.ye,null===c?this.da=a:(a.Kk=c,c.oa=a),this.ye=a,this.hb()):d.value=b;return this};H.prototype.add=H.prototype.add;H.prototype.set=function(a,b){return this.add(a,b)};H.prototype.set=H.prototype.set; H.prototype.addAll=function(a){if(null===a)return this;if(La(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};H.prototype.addAll=H.prototype.addAll;H.prototype.first=function(){return this.da};H.prototype.first=H.prototype.first;H.prototype.any=function(a){for(var b=this.o,c=this.da;null!==c;){if(a(c))return!0;this.o!==b&&Ga(this);c=c.oa}return!1}; H.prototype.all=function(a){for(var b=this.o,c=this.da;null!==c;){if(!a(c))return!1;this.o!==b&&Ga(this);c=c.oa}return!0};H.prototype.each=function(a){for(var b=this.o,c=this.da;null!==c;)a(c),this.o!==b&&Ga(this),c=c.oa;return this};H.prototype.map=function(a){for(var b=new H,c=this.o,d=this.da;null!==d;)b.add(d.key,a(d)),this.o!==c&&Ga(this),d=d.oa;return b};H.prototype.filter=function(a){for(var b=new H,c=this.o,d=this.da;null!==d;)a(d)&&b.add(d.key,d.value),this.o!==c&&Ga(this),d=d.oa;return b}; H.prototype.contains=function(a){var b=a;return Ka(a)&&(b=Hb(a),void 0===b)?!1:void 0!==this.Bb[b]};H.prototype.contains=H.prototype.contains;H.prototype.has=function(a){return this.contains(a)};H.prototype.has=H.prototype.has;H.prototype.J=function(a){var b=a;if(Ka(a)&&(b=Hb(a),void 0===b))return null;a=this.Bb[b];return void 0===a?null:a.value};H.prototype.getValue=H.prototype.J;H.prototype.get=function(a){return this.J(a)};H.prototype.get=H.prototype.get; H.prototype.remove=function(a){if(null===a)return!1;this.w&&Da(this,a);var b=a;if(Ka(a)&&(b=Hb(a),void 0===b))return!1;a=this.Bb[b];if(void 0===a)return!1;var c=a.oa,d=a.Kk;null!==c&&(c.Kk=d);null!==d&&(d.oa=c);this.da===a&&(this.da=c);this.ye===a&&(this.ye=d);delete this.Bb[b];this.Ab--;this.hb();return!0};H.prototype.remove=H.prototype.remove;H.prototype.delete=function(a){return this.remove(a)};H.prototype["delete"]=H.prototype.delete; H.prototype.clear=function(){this.w&&Da(this);this.Bb={};this.Ab=0;null!==this.Ga&&this.Ga.reset();null!==this.xe&&this.xe.reset();this.ye=this.da=null;this.hb()};H.prototype.clear=H.prototype.clear;H.prototype.copy=function(){var a=new H,b=this.Bb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};H.prototype.Ia=function(){var a=this.Bb,b=Array(this.Ab),c=0,d;for(d in a){var e=a[d];b[c]=new Nb(e.key,e.value);c++}return b};H.prototype.toArray=H.prototype.Ia;H.prototype.Ld=function(){return new Qb(this)}; H.prototype.toKeySet=H.prototype.Ld; aa.Object.defineProperties(H.prototype,{count:{get:function(){return this.Ab}},size:{get:function(){return this.Ab}},iterator:{get:function(){if(0>=this.count)return Db;var a=this.Ga;return null!==a?(a.reset(),a):new Vb(this)}},iteratorKeys:{get:function(){return 0>=this.count?Db:new Pb(this)}},iteratorValues:{get:function(){if(0>=this.count)return Db; var a=this.xe;return null!==a?(a.reset(),a):new Rb(this)}}});H.className="Map";function I(a,b){void 0===a?this.D=this.C=0:"number"===typeof a&&"number"===typeof b?(this.C=a,this.D=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.w=!1}I.prototype.assign=function(a){this.C=a.C;this.D=a.D;return this};I.prototype.h=function(a,b){this.C=a;this.D=b;return this};I.prototype.Vf=function(a,b){this.C=a;this.D=b;return this};I.prototype.setTo=I.prototype.Vf; I.prototype.set=function(a){this.C=a.C;this.D=a.D;return this};I.prototype.set=I.prototype.set;I.prototype.copy=function(){var a=new I;a.C=this.C;a.D=this.D;return a};u=I.prototype;u.ga=function(){this.w=!0;Object.freeze(this);return this};u.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};u.freeze=function(){this.w=!0;return this};u.fa=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.w=!1;return this}; function Wb(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 I(c,e)}return new I}function Xb(a){return a.x.toString()+" "+a.y.toString()}u.toString=function(){return"Point("+this.x+","+this.y+")"};u.A=function(a){return a instanceof I?this.C===a.x&&this.D===a.y:!1};I.prototype.equals=I.prototype.A;I.prototype.Yh=function(a,b){return this.C===a&&this.D===b}; I.prototype.equalTo=I.prototype.Yh;I.prototype.Na=function(a){return J(this.C,a.x)&&J(this.D,a.y)};I.prototype.equalsApprox=I.prototype.Na;I.prototype.add=function(a){this.C+=a.x;this.D+=a.y;return this};I.prototype.add=I.prototype.add;I.prototype.qe=function(a){this.C-=a.x;this.D-=a.y;return this};I.prototype.subtract=I.prototype.qe;I.prototype.offset=function(a,b){this.C+=a;this.D+=b;return this};I.prototype.offset=I.prototype.offset; I.prototype.rotate=function(a){if(0===a)return this;var b=this.C,c=this.D;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.C=a*b-d*c;this.D=d*b+a*c;return this};I.prototype.rotate=I.prototype.rotate;I.prototype.scale=function(a,b){this.C*=a;this.D*=b;return this};I.prototype.scale=I.prototype.scale;I.prototype.me=function(a){var b=a.x-this.C;a=a.y-this.D;return b*b+a*a}; I.prototype.distanceSquaredPoint=I.prototype.me;I.prototype.rj=function(a,b){a-=this.C;b-=this.D;return a*a+b*b};I.prototype.distanceSquared=I.prototype.rj;I.prototype.normalize=function(){var a=this.C,b=this.D,c=Math.sqrt(a*a+b*b);0<c&&(this.C=a/c,this.D=b/c);return this};I.prototype.normalize=I.prototype.normalize;I.prototype.Ma=function(a){return Yb(a.x-this.C,a.y-this.D)};I.prototype.directionPoint=I.prototype.Ma;I.prototype.direction=function(a,b){return Yb(a-this.C,b-this.D)}; I.prototype.direction=I.prototype.direction;function Yb(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}I.prototype.Rx=function(a,b,c,d){bc(a,b,c,d,this.C,this.D,this);return this};I.prototype.projectOntoLineSegment=I.prototype.Rx;I.prototype.Sx=function(a,b){bc(a.x,a.y,b.x,b.y,this.C,this.D,this);return this};I.prototype.projectOntoLineSegmentPoint=I.prototype.Sx; I.prototype.ay=function(a,b,c,d){cc(this.C,this.D,a,b,c,d,this);return this};I.prototype.snapToGrid=I.prototype.ay;I.prototype.by=function(a,b){cc(this.C,this.D,a.x,a.y,b.width,b.height,this);return this};I.prototype.snapToGridPoint=I.prototype.by;I.prototype.ji=function(a,b){this.C=a.x+b.x*a.width+b.offsetX;this.D=a.y+b.y*a.height+b.offsetY;return this};I.prototype.setRectSpot=I.prototype.ji;I.prototype.Ij=function(a,b,c,d,e){this.C=a+e.x*c+e.offsetX;this.D=b+e.y*d+e.offsetY;return this}; I.prototype.setSpot=I.prototype.Ij;I.prototype.transform=function(a){a.qa(this);return this};function dc(a,b){b.Hd(a);return a}function ec(a,b,c,d,e,f){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 fc(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function gc(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}I.prototype.u=function(){return isFinite(this.x)&&isFinite(this.y)};I.prototype.isReal=I.prototype.u;I.alloc=function(){var a=hc.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=hc.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){hc.push(a)}; aa.Object.defineProperties(I.prototype,{x:{get:function(){return this.C},set:function(a){this.C=a}},y:{get:function(){return this.D},set:function(a){this.D=a}}});var ic=null,jc=null,kc=null,lc=null,qc=null,hc=[];I.className="Point";I.parse=Wb;I.stringify=Xb;I.distanceLineSegmentSquared=ec;I.distanceSquared=fc;I.direction=gc;I.Origin=ic=(new I(0,0)).ga();I.InfiniteTopLeft=jc=(new I(-Infinity,-Infinity)).ga(); I.InfiniteBottomRight=kc=(new I(Infinity,Infinity)).ga();I.SixPoint=lc=(new I(6,6)).ga();I.NoPoint=qc=(new I(NaN,NaN)).ga();I.parse=Wb;I.stringify=Xb;I.distanceLineSegmentSquared=ec;I.distanceSquared=fc;I.direction=gc;function rc(a,b){void 0===a?this.Y=this.$=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.$=a,this.Y=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.w=!1}var sc,tc,uc,vc,Bc,Cc,Dc; rc.prototype.assign=function(a){this.$=a.$;this.Y=a.Y;return this};rc.prototype.h=function(a,b){this.$=a;this.Y=b;return this};rc.prototype.Vf=function(a,b){this.$=a;this.Y=b;return this};rc.prototype.setTo=rc.prototype.Vf;rc.prototype.set=function(a){this.$=a.$;this.Y=a.Y;return this};rc.prototype.set=rc.prototype.set;rc.prototype.copy=function(){var a=new rc;a.$=this.$;a.Y=this.Y;return a};u=rc.prototype;u.ga=function(){this.w=!0;Object.freeze(this);return this}; u.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};u.freeze=function(){this.w=!0;return this};u.fa=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.w=!1;return this};function Ec(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 rc(c,e)}return new rc}function Hc(a){return a.width.toString()+" "+a.height.toString()} u.toString=function(){return"Size("+this.width+","+this.height+")"};u.A=function(a){return a instanceof rc?this.$===a.width&&this.Y===a.height:!1};rc.prototype.equals=rc.prototype.A;rc.prototype.Yh=function(a,b){return this.$===a&&this.Y===b};rc.prototype.equalTo=rc.prototype.Yh;rc.prototype.Na=function(a){return J(this.$,a.width)&&J(this.Y,a.height)};rc.prototype.equalsApprox=rc.prototype.Na;rc.prototype.u=function(){return isFinite(this.width)&&isFinite(this.height)};rc.prototype.isReal=rc.prototype.u; rc.alloc=function(){var a=Ic.pop();return void 0===a?new rc:a};rc.free=function(a){Ic.push(a)};aa.Object.defineProperties(rc.prototype,{width:{get:function(){return this.$},set:function(a){0>a&&Ea(a,">= 0",rc,"width");this.$=a}},height:{get:function(){return this.Y},set:function(a){0>a&&Ea(a,">= 0",rc,"height");this.Y=a}}});var Ic=[];rc.className="Size";rc.parse=Ec;rc.stringify=Hc;rc.ZeroSize=sc=(new rc(0,0)).ga(); rc.OneSize=tc=(new rc(1,1)).ga();rc.SixSize=uc=(new rc(6,6)).ga();rc.EightSize=vc=(new rc(8,8)).ga();rc.TenSize=Bc=(new rc(10,10)).ga();rc.InfiniteSize=Cc=(new rc(Infinity,Infinity)).ga();rc.NoSize=Dc=(new rc(NaN,NaN)).ga();rc.parse=Ec;rc.stringify=Hc; function K(a,b,c,d){void 0===a?this.Y=this.$=this.D=this.C=0:a instanceof I?b instanceof I?(this.C=Math.min(a.C,b.C),this.D=Math.min(a.D,b.D),this.$=Math.abs(a.C-b.C),this.Y=Math.abs(a.D-b.D)):b instanceof rc?(this.C=a.C,this.D=a.D,this.$=b.$,this.Y=b.Y):B("Incorrect arguments supplied to Rect constructor"):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.C=a,this.D=b,this.$=c,this.Y=d):B("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this.w=!1}K.prototype.assign=function(a){this.C=a.C;this.D=a.D;this.$=a.$;this.Y=a.Y;return this};K.prototype.h=function(a,b,c,d){this.C=a;this.D=b;this.$=c;this.Y=d;return this};function Jc(a,b,c){a.$=b;a.Y=c}K.prototype.Vf=function(a,b,c,d){this.C=a;this.D=b;this.$=c;this.Y=d;return this};K.prototype.setTo=K.prototype.Vf;K.prototype.set=function(a){this.C=a.C;this.D=a.D;this.$=a.$;this.Y=a.Y;return this};K.prototype.set=K.prototype.set; K.prototype.Wc=function(a){this.C=a.C;this.D=a.D;return this};K.prototype.setPoint=K.prototype.Wc;K.prototype.Zx=function(a){this.$=a.$;this.Y=a.Y;return this};K.prototype.setSize=K.prototype.Zx;K.prototype.copy=function(){var a=new K;a.C=this.C;a.D=this.D;a.$=this.$;a.Y=this.Y;return a};u=K.prototype;u.ga=function(){this.w=!0;Object.freeze(this);return this};u.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};u.freeze=function(){this.w=!0;return this}; u.fa=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.w=!1;return this};function Kc(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 K(c,e,f,g)}return new K} function Lc(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}u.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};u.A=function(a){return a instanceof K?this.C===a.x&&this.D===a.y&&this.$===a.width&&this.Y===a.height:!1};K.prototype.equals=K.prototype.A;K.prototype.Yh=function(a,b,c,d){return this.C===a&&this.D===b&&this.$===c&&this.Y===d};K.prototype.equalTo=K.prototype.Yh; K.prototype.Na=function(a){return J(this.C,a.x)&&J(this.D,a.y)&&J(this.$,a.width)&&J(this.Y,a.height)};K.prototype.equalsApprox=K.prototype.Na;function Mc(a,b){return Oc(a.C,b.x)&&Oc(a.D,b.y)&&Oc(a.$,b.width)&&Oc(a.Y,b.height)}K.prototype.ca=function(a){return this.C<=a.x&&this.C+this.$>=a.x&&this.D<=a.y&&this.D+this.Y>=a.y};K.prototype.containsPoint=K.prototype.ca;K.prototype.Qe=function(a){return this.C<=a.x&&a.x+a.width<=this.C+this.$&&this.D<=a.y&&a.y+a.height<=this.D+this.Y}; K.prototype.containsRect=K.prototype.Qe;K.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.C<=a&&a+c<=this.C+this.$&&this.D<=b&&b+d<=this.D+this.Y};K.prototype.contains=K.prototype.contains;K.prototype.reset=function(){this.Y=this.$=this.D=this.C=0};K.prototype.offset=function(a,b){this.C+=a;this.D+=b;return this};K.prototype.offset=K.prototype.offset;K.prototype.Rc=function(a,b){return Pc(this,b,a,b,a)};K.prototype.inflate=K.prototype.Rc; K.prototype.Po=function(a){return Pc(this,a.top,a.right,a.bottom,a.left)};K.prototype.addMargin=K.prototype.Po;K.prototype.xu=function(a){return Pc(this,-a.top,-a.right,-a.bottom,-a.left)};K.prototype.subtractMargin=K.prototype.xu;K.prototype.Bx=function(a,b,c,d){return Pc(this,a,b,c,d)};K.prototype.grow=K.prototype.Bx;function Pc(a,b,c,d,e){var f=a.$;c+e<=-f?(a.C+=f/2,a.$=0):(a.C-=e,a.$+=c+e);c=a.Y;b+d<=-c?(a.D+=c/2,a.Y=0):(a.D-=b,a.Y+=b+d);return a} K.prototype.Fx=function(a){return Qc(this,a.x,a.y,a.width,a.height)};K.prototype.intersectRect=K.prototype.Fx;K.prototype.Nt=function(a,b,c,d){return Qc(this,a,b,c,d)};K.prototype.intersect=K.prototype.Nt;function Qc(a,b,c,d,e){var f=Math.max(a.C,b),g=Math.max(a.D,c);b=Math.min(a.C+a.$,b+d);c=Math.min(a.D+a.Y,c+e);a.C=f;a.D=g;a.$=Math.max(0,b-f);a.Y=Math.max(0,c-g);return a}K.prototype.Cc=function(a){return this.Ot(a.x,a.y,a.width,a.height)};K.prototype.intersectsRect=K.prototype.Cc; K.prototype.Ot=function(a,b,c,d){var e=this.$,f=this.C;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.Y;c=this.D;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};K.prototype.intersects=K.prototype.Ot;function Rc(a,b){var c=a.$,d=a.C,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.Y;a=a.D;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}K.prototype.re=function(a){return Sc(this,a.x,a.y,0,0)};K.prototype.unionPoint=K.prototype.re; K.prototype.Nd=function(a){return Sc(this,a.C,a.D,a.$,a.Y)};K.prototype.unionRect=K.prototype.Nd;K.prototype.Eu=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Sc(this,a,b,c,d)};K.prototype.union=K.prototype.Eu;function Sc(a,b,c,d,e){var f=Math.min(a.C,b),g=Math.min(a.D,c);b=Math.max(a.C+a.$,b+d);c=Math.max(a.D+a.Y,c+e);a.C=f;a.D=g;a.$=b-f;a.Y=c-g;return a}K.prototype.Ij=function(a,b,c){this.C=a-c.offsetX-c.x*this.$;this.D=b-c.offsetY-c.y*this.Y;return this};K.prototype.setSpot=K.prototype.Ij; function Wc(a,b,c,d,e,f,g,h){void 0===g&&(g=0);void 0===h&&(h=0);return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d}function Xc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}K.prototype.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};K.prototype.isReal=K.prototype.u;K.prototype.Hx=function(){return 0===this.width&&0===this.height};K.prototype.isEmpty=K.prototype.Hx;K.alloc=function(){var a=Yc.pop();return void 0===a?new K:a}; K.allocAt=function(a,b,c,d){var e=Yc.pop();return void 0===e?new K(a,b,c,d):e.h(a,b,c,d)};K.free=function(a){Yc.push(a)}; aa.Object.defineProperties(K.prototype,{x:{get:function(){return this.C},set:function(a){this.C=a}},y:{get:function(){return this.D},set:function(a){this.D=a}},width:{get:function(){return this.$},set:function(a){0>a&&Ea(a,">= 0",K,"width");this.$=a}},height:{get:function(){return this.Y},set:function(a){0>a&&Ea(a,">= 0",K,"height");this.Y=a}},left:{ get:function(){return this.C},set:function(a){this.C=a}},top:{get:function(){return this.D},set:function(a){this.D=a}},right:{get:function(){return this.C+this.$},set:function(a){this.C+=a-(this.C+this.$)}},bottom:{get:function(){return this.D+this.Y},set