UNPKG

gojs

Version:

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

123 lines 863 kB
/* * GoJS v2.0.0-beta8 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-beta8/license.html. */ (function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ca(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ha; if("function"==typeof Object.setPrototypeOf)ha=Object.setPrototypeOf;else{var ia;a:{var ja={a:!0},ka={};try{ka.__proto__=ja;ia=ka.a;break a}catch(a){}ia=!1}ha=ia?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ma=ha; function na(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ma)ma(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.Yz=b.prototype}var oa="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,pa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)}; function ra(a){if(a){for(var b=oa,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&&pa(b,c,{writable:!0,value:a})}}ra(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 w="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===w.requestAnimationFrame&&(w.requestAnimationFrame=setImmediate);function sa(){}function ta(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&w.clearTimeout(c);c=va(function(){c=-1;a.apply(d,e)},b)}}function va(a,b){return w.setTimeout(a,b)}function wa(a){return w.document.createElement(a)} function A(a){throw Error(a);}function za(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);A(a)}function Aa(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);A(c+" is not in the range "+b+": "+a)}function Ba(a){w.console&&w.console.log(a)} function Da(){w.console&&w.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 Ea(a){return"object"===typeof a&&null!==a}function Ga(a){return Array.isArray(a)||w.NodeList&&a instanceof w.NodeList||w.HTMLCollection&&a instanceof w.HTMLCollection}function Ha(a){return Array.prototype.slice.call(a)} function Ia(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):A("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function Ka(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):A("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function La(){var a=Ma.pop();return void 0===a?[]:a}function Na(a){a.length=0;Ma.push(a)} function Oa(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(Ea(a)&&a.constructor)return Oa(a.constructor);return typeof a} function Qa(a){var b=a;Ea(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.Oz;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ta(a,b,c){Object.defineProperty(Va.prototype,a,{get:b,set:c})}function Wa(){var a=Ya;if(0===a.length)for(var b=w.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.F&&a.push(e.parentElement.F)}return a} function $a(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 ab=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("MSIE 9.0"),bb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("MSIE 10.0"),eb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("Trident/7"),fb=void 0!==w.navigator&&0<w.navigator.userAgent.indexOf("Edge/"),ib=void 0!==w.navigator&&void 0!==w.navigator.platform&&0<=w.navigator.platform.toUpperCase().indexOf("MAC"),jb=void 0!==w.navigator&&void 0!==w.navigator.platform&&null!==w.navigator.platform.match(/(iPhone|iPod|iPad)/i), lb=!1,pb=null,rb=null,Ma=[];Object.freeze([]);var Ya=[];sa.className="Util";sa.Dx="32ab5ff3b26f42dc0ed90f224c2913b5";sa.adym="gojs.net";sa.vfo="28e646fdb37b1981578a07";sa.className="Util";function D(a,b,c){sb(this);this.l=a;this.Ta=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Ta};function tb(a,b){return void 0===b||null===b||""===b?null:a[b]} oa.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Ta}},value:{get:function(){return this.u}}});D.className="EnumValue";function vb(){this.kw=[]}vb.prototype.toString=function(){return this.kw.join("")};vb.prototype.add=function(a){""!==a&&this.kw.push(a)};vb.className="StringBuilder";function wb(){}wb.className="PropertyCollection"; function xb(){}xb.prototype.reset=function(){};xb.prototype.next=function(){return!1};xb.prototype.fd=function(){return!1};xb.prototype.first=function(){return null};xb.prototype.any=function(){return!1};xb.prototype.all=function(){return!0};xb.prototype.each=function(){return this};xb.prototype.map=function(){return this};xb.prototype.filter=function(){return this};xb.prototype.zd=function(){};xb.prototype.toString=function(){return"EmptyIterator"}; oa.Object.defineProperties(xb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});xb.prototype.first=xb.prototype.first;xb.prototype.hasNext=xb.prototype.fd;xb.prototype.next=xb.prototype.next;xb.prototype.reset=xb.prototype.reset;var yb=null;xb.className="EmptyIterator";yb=new xb;function zb(a){this.key=-1;this.value=a}zb.prototype.reset=function(){this.key=-1}; zb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};zb.prototype.fd=function(){return this.next()};zb.prototype.first=function(){this.key=0;return this.value};zb.prototype.any=function(a){this.key=-1;return a(this.value)};zb.prototype.all=function(a){this.key=-1;return a(this.value)};zb.prototype.each=function(a){this.key=-1;a(this.value);return this};zb.prototype.map=function(a){return new zb(a(this.value))}; zb.prototype.filter=function(a){return a(this.value)?new zb(this.value):yb};zb.prototype.zd=function(){this.value=null};zb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};oa.Object.defineProperties(zb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});zb.prototype.first=zb.prototype.first;zb.prototype.hasNext=zb.prototype.fd;zb.prototype.next=zb.prototype.next; zb.prototype.reset=zb.prototype.reset;zb.className="SingletonIterator";function Ab(a){this.tb=a;this.Xe=null;a.Ja=null;this.ma=a.Ba;this.Qa=-1}Ab.prototype.reset=function(){var a=this.tb;a.Ja=null;this.ma=a.Ba;this.Qa=-1};Ab.prototype.next=function(){var a=this.tb;if(a.Ba!==this.ma&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Qa,d=this.Xe;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Qa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.zd()}return!1}; Ab.prototype.fd=function(){return this.next()};Ab.prototype.first=function(){var a=this.tb;this.ma=a.Ba;this.Qa=0;a=a.j;var b=a.length,c=this.Xe;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Qa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};Ab.prototype.any=function(a){var b=this.tb;b.Ja=null;this.Qa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1}; Ab.prototype.all=function(a){var b=this.tb;b.Ja=null;this.Qa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};Ab.prototype.each=function(a){var b=this.tb;b.Ja=null;this.Qa=-1;b=b.j;for(var c=b.length,d=this.Xe,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this}; Ab.prototype.map=function(a){var b=this.tb;b.Ja=null;this.Qa=-1;var c=[];b=b.j;for(var d=b.length,e=this.Xe,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.nb();return a.iterator};Ab.prototype.filter=function(a){var b=this.tb;b.Ja=null;this.Qa=-1;var c=[];b=b.j;for(var d=b.length,e=this.Xe,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&a(g)&&c.push(g)}a=new E;a.j=c;a.nb();return a.iterator}; Ab.prototype.zd=function(){this.key=-1;this.value=null;this.ma=-1;this.Xe=null;this.tb.Ja=this};Ab.prototype.toString=function(){return"ListIterator@"+this.Qa+"/"+this.tb.count}; oa.Object.defineProperties(Ab.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.Xe},set:function(a){this.Xe=a}},count:{get:function(){var a=this.Xe;if(null!==a){for(var b=0,c=this.tb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.tb.j.length}}});Ab.prototype.first=Ab.prototype.first;Ab.prototype.hasNext=Ab.prototype.fd;Ab.prototype.next=Ab.prototype.next; Ab.prototype.reset=Ab.prototype.reset;Ab.className="ListIterator";function Bb(a){this.tb=a;a.Pg=null;this.ma=a.Ba;this.Qa=a.j.length}Bb.prototype.reset=function(){var a=this.tb;a.Pg=null;this.ma=a.Ba;this.Qa=a.j.length};Bb.prototype.next=function(){var a=this.tb;if(a.Ba!==this.ma&&0>this.key)return!1;var b=--this.Qa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.zd();return!1};Bb.prototype.fd=function(){return this.next()}; Bb.prototype.first=function(){var a=this.tb;this.ma=a.Ba;var b=a.j;this.Qa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Bb.prototype.any=function(a){var b=this.tb;b.Pg=null;b=b.j;var c=b.length;this.Qa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};Bb.prototype.all=function(a){var b=this.tb;b.Pg=null;b=b.j;var c=b.length;this.Qa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0}; Bb.prototype.each=function(a){var b=this.tb;b.Pg=null;b=b.j;var c=b.length;this.Qa=c;for(--c;0<=c;c--)a(b[c]);return this};Bb.prototype.map=function(a){var b=this.tb;b.Pg=null;var c=[];b=b.j;var d=b.length;this.Qa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.nb();return a.iterator};Bb.prototype.filter=function(a){var b=this.tb;b.Pg=null;var c=[];b=b.j;var d=b.length;this.Qa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.nb();return a.iterator}; Bb.prototype.zd=function(){this.key=-1;this.value=null;this.ma=-1;this.tb.Pg=this};Bb.prototype.toString=function(){return"ListIteratorBackwards("+this.Qa+"/"+this.tb.count+")"};oa.Object.defineProperties(Bb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.tb.j.length}}});Bb.prototype.first=Bb.prototype.first;Bb.prototype.hasNext=Bb.prototype.fd;Bb.prototype.next=Bb.prototype.next;Bb.prototype.reset=Bb.prototype.reset; Bb.className="ListIteratorBackwards";function E(a){sb(this);this.v=!1;this.j=[];this.Ba=0;this.Pg=this.Ja=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Da():this.addAll(a))}t=E.prototype;t.nb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"List()#"+Eb(this)};t.add=function(a){if(null===a)return this;this.v&&za(this,a);this.j.push(a);this.nb();return this}; t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&za(this);var b=this.j;if(Ga(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.nb();return this};t.clear=function(){this.v&&za(this);this.j.length=0;this.nb()};t.contains=function(a){return null===a?!1:-1!==this.j.indexOf(a)};t.has=function(a){return this.contains(a)};t.indexOf=function(a){return null===a?-1:this.j.indexOf(a)}; t.N=function(a){var b=this.j;(0>a||a>=b.length)&&Aa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.N(a)};t.kd=function(a,b){var c=this.j;(0>a||a>=c.length)&&Aa(a,"0 <= i < length",E,"setElt:i");this.v&&za(this,a);c[a]=b};t.set=function(a,b){this.kd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.cc=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.v&&za(this);var a=this.j;return 0<a.length?a.pop():null}; E.prototype.any=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(a(b[d]))return!0;return!1};E.prototype.all=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)if(!a(b[d]))return!1;return!0};E.prototype.each=function(a){for(var b=this.j,c=b.length,d=0;d<c;d++)a(b[d]);return this};E.prototype.map=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++)c.push(a(d[f]));b.j=c;b.nb();return b}; E.prototype.filter=function(a){for(var b=new E,c=[],d=this.j,e=d.length,f=0;f<e;f++){var g=d[f];a(g)&&c.push(g)}b.j=c;b.nb();return b};t=E.prototype;t.Mb=function(a,b){0>a&&Aa(a,">= 0",E,"insertAt:i");this.v&&za(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.nb()};t.remove=function(a){if(null===a)return!1;this.v&&za(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.nb();return!0};t.delete=function(a){return this.remove(a)}; t.pb=function(a){var b=this.j;(0>a||a>=b.length)&&Aa(a,"0 <= i < length",E,"removeAt:i");this.v&&za(this,a);a===b.length-1?b.pop():b.splice(a,1);this.nb()};t.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.v&&za(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.nb();return this};E.prototype.copy=function(){var a=new E,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a}; t=E.prototype;t.Ma=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.Nv=function(){for(var a=new F,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.v&&za(this);this.j.sort(a);this.nb();return this}; t.Ni=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&za(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&Aa(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.nb()),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.nb();return this}; t.reverse=function(){this.v&&za(this);this.j.reverse();this.nb();return this}; oa.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 yb;var a=this.Ja;return null!==a?(a.reset(),a):new Ab(this)}},iteratorBackwards:{ get:function(){if(0>=this.j.length)return yb;var a=this.Pg;return null!==a?(a.reset(),a):new Bb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.Ni;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Nv;E.prototype.toArray=E.prototype.Ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.pb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.Mb; E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.cc;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.kd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.N;E.prototype.indexOf=E.prototype.indexOf;E.prototype.has=E.prototype.has;E.prototype.contains=E.prototype.contains;E.prototype.clear=E.prototype.clear;E.prototype.addAll=E.prototype.addAll;E.prototype.push=E.prototype.push;E.prototype.add=E.prototype.add;E.prototype.thaw=E.prototype.ha; E.prototype.freeze=E.prototype.freeze;E.className="List";function Fb(a){this.eg=a;a.Ja=null;this.ma=a.Ba;this.na=null}Fb.prototype.reset=function(){var a=this.eg;a.Ja=null;this.ma=a.Ba;this.na=null};Fb.prototype.next=function(){var a=this.eg;if(a.Ba!==this.ma&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.zd();return!1};Fb.prototype.fd=function(){return this.next()}; Fb.prototype.first=function(){var a=this.eg;this.ma=a.Ba;a=a.fa;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null};Fb.prototype.any=function(a){var b=this.eg;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};Fb.prototype.all=function(a){var b=this.eg;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};Fb.prototype.each=function(a){var b=this.eg;this.na=b.Ja=null;for(b=b.fa;null!==b;)a(b.value),b=b.oa;return this}; Fb.prototype.map=function(a){var b=this.eg;b.Ja=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};Fb.prototype.filter=function(a){var b=this.eg;b.Ja=null;var c=new E;for(b=b.fa;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};Fb.prototype.zd=function(){this.value=this.key=null;this.ma=-1;this.eg.Ja=this};Fb.prototype.toString=function(){return null!==this.na?"SetIterator@"+this.na.value:"SetIterator"}; oa.Object.defineProperties(Fb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Fb}}});Fb.prototype.first=Fb.prototype.first;Fb.prototype.hasNext=Fb.prototype.fd;Fb.prototype.next=Fb.prototype.next;Fb.prototype.reset=Fb.prototype.reset;Fb.className="SetIterator"; function F(a){sb(this);this.v=!1;this.Gb={};this.Fb=0;this.Ja=null;this.Ba=0;this.Se=this.fa=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Da():this.addAll(a))}t=F.prototype;t.nb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+Eb(this)}; t.add=function(a){if(null===a)return this;this.v&&za(this,a);var b=a;Ea(a)&&(b=Hb(a));void 0===this.Gb[b]&&(this.Fb++,a=new Ib(a,a),this.Gb[b]=a,b=this.Se,null===b?this.fa=a:(a.nl=b,b.oa=a),this.Se=a,this.nb());return this};t.addAll=function(a){if(null===a)return this;this.v&&za(this);if(Ga(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}; t.contains=function(a){if(null===a)return!1;var b=a;return Ea(a)&&(b=Eb(a),void 0===b)?!1:void 0!==this.Gb[b]};t.has=function(a){return this.contains(a)};t.qy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.sy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.fa;return null===a?null:a.value}; F.prototype.any=function(a){for(var b=this.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};F.prototype.all=function(a){for(var b=this.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};F.prototype.each=function(a){for(var b=this.fa;null!==b;)a(b.value),b=b.oa;return this};F.prototype.map=function(a){for(var b=new F,c=this.fa;null!==c;)b.add(a(c.value)),c=c.oa;return b};F.prototype.filter=function(a){for(var b=new F,c=this.fa;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.oa}return b};t=F.prototype; t.remove=function(a){if(null===a)return!1;this.v&&za(this,a);var b=a;if(Ea(a)&&(b=Eb(a),void 0===b))return!1;a=this.Gb[b];if(void 0===a)return!1;var c=a.oa,d=a.nl;null!==c&&(c.nl=d);null!==d&&(d.oa=c);this.fa===a&&(this.fa=c);this.Se===a&&(this.Se=d);delete this.Gb[b];this.Fb--;this.nb();return!0};t.delete=function(a){return this.remove(a)}; t.cq=function(a){if(null===a)return this;this.v&&za(this);if(Ga(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};t.Bz=function(a){if(null===a||0===this.count)return this;this.v&&za(this);var b=new F;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.cq(a);return this};t.clear=function(){this.v&&za(this);this.Gb={};this.Fb=0;null!==this.Ja&&this.Ja.reset();this.Se=this.fa=null;this.nb()}; F.prototype.copy=function(){var a=new F,b=this.Gb,c;for(c in b)a.add(b[c].value);return a};F.prototype.Ma=function(){var a=Array(this.Fb),b=this.Gb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.Mv=function(){var a=new E,b=this.Gb,c;for(c in b)a.add(b[c].value);return a};function sb(a){a.__gohashid=Jb++}function Hb(a){var b=a.__gohashid;void 0===b&&(b=Jb++,a.__gohashid=b);return b}function Eb(a){return a.__gohashid} oa.Object.defineProperties(F.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.Fb)return yb;var a=this.Ja;return null!==a?(a.reset(),a):new Fb(this)}}});F.prototype.toList=F.prototype.Mv;F.prototype.toArray=F.prototype.Ma;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.Bz;F.prototype.removeAll=F.prototype.cq; F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.sy;F.prototype.containsAll=F.prototype.qy;F.prototype.has=F.prototype.has;F.prototype.contains=F.prototype.contains;F.prototype.addAll=F.prototype.addAll;F.prototype.add=F.prototype.add;F.prototype.thaw=F.prototype.ha;F.prototype.freeze=F.prototype.freeze;var Jb=1;F.className="Set";F.uniqueHash=sb;F.hashIdUnique=Hb;F.hashId=Eb; function Kb(a){this.ja=a;this.ma=a.Ba;this.na=null}Kb.prototype.reset=function(){this.ma=this.ja.Ba;this.na=null};Kb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.ma&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=this.key=a=b.key,!0;this.zd();return!1};Kb.prototype.fd=function(){return this.next()};Kb.prototype.first=function(){var a=this.ja;this.ma=a.Ba;a=a.fa;return null!==a?(this.na=a,this.value=this.key=a=a.key):null}; Kb.prototype.any=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};Kb.prototype.all=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};Kb.prototype.each=function(a){var b=this.ja;this.na=null;for(b=b.fa;null!==b;)a(b.key),b=b.oa;return this};Kb.prototype.map=function(a){var b=this.ja;this.na=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator}; Kb.prototype.filter=function(a){var b=this.ja;this.na=null;var c=new E;for(b=b.fa;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};Kb.prototype.zd=function(){this.value=this.key=null;this.ma=-1};Kb.prototype.toString=function(){return null!==this.na?"MapKeySetIterator@"+this.na.value:"MapKeySetIterator"};oa.Object.defineProperties(Kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Fb}}}); Kb.prototype.first=Kb.prototype.first;Kb.prototype.hasNext=Kb.prototype.fd;Kb.prototype.next=Kb.prototype.next;Kb.prototype.reset=Kb.prototype.reset;Kb.className="MapKeySetIterator";function Lb(a){F.call(this);sb(this);this.v=!0;this.ja=a}na(Lb,F);t=Lb.prototype;t.freeze=function(){return this};t.ha=function(){return this};t.toString=function(){return"MapKeySet("+this.ja.toString()+")"};t.add=function(){A("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.ja.contains(a)}; t.has=function(a){return this.contains(a)};t.remove=function(){A("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){A("This Set is read-only: "+this.toString())};t.first=function(){var a=this.ja.fa;return null!==a?a.key:null};Lb.prototype.any=function(a){for(var b=this.ja.fa;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};Lb.prototype.all=function(a){for(var b=this.ja.fa;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0}; Lb.prototype.each=function(a){for(var b=this.ja.fa;null!==b;)a(b.key),b=b.oa;return this};Lb.prototype.map=function(a){for(var b=new F,c=this.ja.fa;null!==c;)b.add(a(c.key)),c=c.oa;return b};Lb.prototype.filter=function(a){for(var b=new F,c=this.ja.fa;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};Lb.prototype.copy=function(){return new Lb(this.ja)};Lb.prototype.Nv=function(){var a=new F,b=this.ja.Gb,c;for(c in b)a.add(b[c].key);return a}; Lb.prototype.Ma=function(){var a=this.ja.Gb,b=Array(this.ja.Fb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};Lb.prototype.Mv=function(){var a=new E,b=this.ja.Gb,c;for(c in b)a.add(b[c].key);return a};oa.Object.defineProperties(Lb.prototype,{count:{get:function(){return this.ja.Fb}},size:{get:function(){return this.ja.Fb}},iterator:{get:function(){return 0>=this.ja.Fb?yb:new Kb(this.ja)}}}); Lb.prototype.toList=Lb.prototype.Mv;Lb.prototype.toArray=Lb.prototype.Ma;Lb.prototype.toSet=Lb.prototype.Nv;Lb.prototype.first=Lb.prototype.first;Lb.prototype.clear=Lb.prototype.clear;Lb.prototype["delete"]=Lb.prototype.delete;Lb.prototype.remove=Lb.prototype.remove;Lb.prototype.has=Lb.prototype.has;Lb.prototype.contains=Lb.prototype.contains;Lb.prototype.add=Lb.prototype.add;Lb.prototype.thaw=Lb.prototype.ha;Lb.prototype.freeze=Lb.prototype.freeze;Lb.className="MapKeySet"; function Mb(a){this.ja=a;a.Re=null;this.ma=a.Ba;this.na=null}Mb.prototype.reset=function(){var a=this.ja;a.Re=null;this.ma=a.Ba;this.na=null};Mb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.ma&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.value=b.value,this.key=b.key,!0;this.zd();return!1};Mb.prototype.fd=function(){return this.next()}; Mb.prototype.first=function(){var a=this.ja;this.ma=a.Ba;a=a.fa;if(null!==a){this.na=a;var b=a.value;this.key=a.key;return this.value=b}return null};Mb.prototype.any=function(a){var b=this.ja;this.na=b.Re=null;for(b=b.fa;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};Mb.prototype.all=function(a){var b=this.ja;this.na=b.Re=null;for(b=b.fa;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};Mb.prototype.each=function(a){var b=this.ja;this.na=b.Re=null;for(b=b.fa;null!==b;)a(b.value),b=b.oa;return this}; Mb.prototype.map=function(a){var b=this.ja;this.na=b.Re=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};Mb.prototype.filter=function(a){var b=this.ja;this.na=b.Re=null;var c=new E;for(b=b.fa;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};Mb.prototype.zd=function(){this.value=this.key=null;this.ma=-1;this.ja.Re=this};Mb.prototype.toString=function(){return null!==this.na?"MapValueSetIterator@"+this.na.value:"MapValueSetIterator"}; oa.Object.defineProperties(Mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Fb}}});Mb.prototype.first=Mb.prototype.first;Mb.prototype.hasNext=Mb.prototype.fd;Mb.prototype.next=Mb.prototype.next;Mb.prototype.reset=Mb.prototype.reset;Mb.className="MapValueSetIterator";function Ib(a,b){this.key=a;this.value=b;this.nl=this.oa=null}Ib.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"}; Ib.className="KeyValuePair";function Qb(a){this.ja=a;a.Ja=null;this.ma=a.Ba;this.na=null}Qb.prototype.reset=function(){var a=this.ja;a.Ja=null;this.ma=a.Ba;this.na=null};Qb.prototype.next=function(){var a=this.ja;if(a.Ba!==this.ma&&null===this.key)return!1;var b=this.na;b=null===b?a.fa:b.oa;if(null!==b)return this.na=b,this.key=b.key,this.value=b.value,!0;this.zd();return!1};Qb.prototype.fd=function(){return this.next()}; Qb.prototype.first=function(){var a=this.ja;this.ma=a.Ba;a=a.fa;return null!==a?(this.na=a,this.key=a.key,this.value=a.value,a):null};Qb.prototype.any=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(a(b))return!0;b=b.oa}return!1};Qb.prototype.all=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;){if(!a(b))return!1;b=b.oa}return!0};Qb.prototype.each=function(a){var b=this.ja;this.na=b.Ja=null;for(b=b.fa;null!==b;)a(b),b=b.oa;return this}; Qb.prototype.map=function(a){var b=this.ja;this.na=b.Ja=null;var c=new E;for(b=b.fa;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};Qb.prototype.filter=function(a){var b=this.ja;this.na=b.Ja=null;var c=new E;for(b=b.fa;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};Qb.prototype.zd=function(){this.value=this.key=null;this.ma=-1;this.ja.Ja=this};Qb.prototype.toString=function(){return null!==this.na?"MapIterator@"+this.na:"MapIterator"}; oa.Object.defineProperties(Qb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ja.Fb}}});Qb.prototype.first=Qb.prototype.first;Qb.prototype.hasNext=Qb.prototype.fd;Qb.prototype.next=Qb.prototype.next;Qb.prototype.reset=Qb.prototype.reset;Qb.className="MapIterator"; function Rb(a){sb(this);this.v=!1;this.Gb={};this.Fb=0;this.Re=this.Ja=null;this.Ba=0;this.Se=this.fa=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Da():this.addAll(a))}t=Rb.prototype;t.nb=function(){var a=this.Ba;a++;999999999<a&&(a=0);this.Ba=a};t.freeze=function(){this.v=!0;return this};t.ha=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+Eb(this)}; t.add=function(a,b){this.v&&za(this,a);var c=a;Ea(a)&&(c=Hb(a));var d=this.Gb[c];void 0===d?(this.Fb++,a=new Ib(a,b),this.Gb[c]=a,c=this.Se,null===c?this.fa=a:(a.nl=c,c.oa=a),this.Se=a,this.nb()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)};t.addAll=function(a){if(null===a)return this;if(Ga(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};t.first=function(){return this.fa}; Rb.prototype.any=function(a){for(var b=this.fa;null!==b;){if(a(b))return!0;b=b.oa}return!1};Rb.prototype.all=function(a){for(var b=this.fa;null!==b;){if(!a(b))return!1;b=b.oa}return!0};Rb.prototype.each=function(a){for(var b=this.fa;null!==b;)a(b),b=b.oa;return this};Rb.prototype.map=function(a){for(var b=new Rb,c=this.fa;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};Rb.prototype.filter=function(a){for(var b=new Rb,c=this.fa;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=Rb.prototype; t.contains=function(a){var b=a;return Ea(a)&&(b=Eb(a),void 0===b)?!1:void 0!==this.Gb[b]};t.has=function(a){return this.contains(a)};t.J=function(a){var b=a;if(Ea(a)&&(b=Eb(a),void 0===b))return null;a=this.Gb[b];return void 0===a?null:a.value};t.get=function(a){return this.J(a)}; t.remove=function(a){if(null===a)return!1;this.v&&za(this,a);var b=a;if(Ea(a)&&(b=Eb(a),void 0===b))return!1;a=this.Gb[b];if(void 0===a)return!1;var c=a.oa,d=a.nl;null!==c&&(c.nl=d);null!==d&&(d.oa=c);this.fa===a&&(this.fa=c);this.Se===a&&(this.Se=d);delete this.Gb[b];this.Fb--;this.nb();return!0};t.delete=function(a){return this.remove(a)};t.clear=function(){this.v&&za(this);this.Gb={};this.Fb=0;null!==this.Ja&&this.Ja.reset();null!==this.Re&&this.Re.reset();this.Se=this.fa=null;this.nb()}; Rb.prototype.copy=function(){var a=new Rb,b=this.Gb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};Rb.prototype.Ma=function(){var a=this.Gb,b=Array(this.Fb),c=0,d;for(d in a){var e=a[d];b[c]=new Ib(e.key,e.value);c++}return b};Rb.prototype.$d=function(){return new Lb(this)}; oa.Object.defineProperties(Rb.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.count)return yb;var a=this.Ja;return null!==a?(a.reset(),a):new Qb(this)}},iteratorKeys:{get:function(){return 0>=this.count?yb:new Kb(this)}},iteratorValues:{get:function(){if(0>=this.count)return yb; var a=this.Re;return null!==a?(a.reset(),a):new Mb(this)}}});Rb.prototype.toKeySet=Rb.prototype.$d;Rb.prototype.toArray=Rb.prototype.Ma;Rb.prototype.clear=Rb.prototype.clear;Rb.prototype["delete"]=Rb.prototype.delete;Rb.prototype.remove=Rb.prototype.remove;Rb.prototype.get=Rb.prototype.get;Rb.prototype.getValue=Rb.prototype.J;Rb.prototype.has=Rb.prototype.has;Rb.prototype.contains=Rb.prototype.contains;Rb.prototype.first=Rb.prototype.first;Rb.prototype.addAll=Rb.prototype.addAll; Rb.prototype.set=Rb.prototype.set;Rb.prototype.add=Rb.prototype.add;Rb.prototype.thaw=Rb.prototype.ha;Rb.prototype.freeze=Rb.prototype.freeze;Rb.className="Map";function G(a,b){void 0===a?this.D=this.C=0:"number"===typeof a&&"number"===typeof b?(this.C=a,this.D=b):A("Invalid arguments to Point constructor: "+a+", "+b);this.v=!1}G.prototype.assign=function(a){this.C=a.C;this.D=a.D;return this};G.prototype.h=function(a,b){this.C=a;this.D=b;return this}; G.prototype.sg=function(a,b){this.C=a;this.D=b;return this};G.prototype.set=function(a){this.C=a.C;this.D=a.D;return this};G.prototype.copy=function(){var a=new G;a.C=this.C;a.D=this.D;return a};t=G.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function Sb(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 G(c,e)}return new G}function Tb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof G?this.C===a.x&&this.D===a.y:!1};t.Ai=function(a,b){return this.C===a&&this.D===b};t.Oa=function(a){return H.w(this.C,a.x)&&H.w(this.D,a.y)}; t.add=function(a){this.C+=a.x;this.D+=a.y;return this};t.Zd=function(a){this.C-=a.x;this.D-=a.y;return this};t.offset=function(a,b){this.C+=a;this.D+=b;return this};G.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};t=G.prototype; t.scale=function(a,b){this.C*=a;this.D*=b;return this};t.Ce=function(a){var b=a.x-this.C;a=a.y-this.D;return b*b+a*a};t.ed=function(a,b){a-=this.C;b-=this.D;return a*a+b*b};t.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};t.Va=function(a){return Ub(a.x-this.C,a.y-this.D)};t.direction=function(a,b){return Ub(a-this.C,b-this.D)}; function Ub(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}t.wz=function(a,b,c,d){H.Ji(a,b,c,d,this.C,this.D,this);return this};t.xz=function(a,b){H.Ji(a.x,a.y,b.x,b.y,this.C,this.D,this);return this};t.Gz=function(a,b,c,d){H.Np(this.C,this.D,a,b,c,d,this);return this};t.Hz=function(a,b){H.Np(this.C,this.D,a.x,a.y,b.width,b.height,this);return this}; t.Mi=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};t.jk=function(a,b,c,d,e){this.C=a+e.x*c+e.offsetX;this.D=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ta(this);return this};function Yb(a,b){b.Wd(a);return a}function Zb(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 $b(a,b,c,d){a=c-a;b=d-b;return a*a+b*b} function ac(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}t.o=function(){return isFinite(this.x)&&isFinite(this.y)};G.alloc=function(){var a=bc.pop();return void 0===a?new G:a};G.allocAt=function(a,b){var c=bc.pop();if(void 0===c)return new G(a,b);c.x=a;c.y=b;return c};G.free=function(a){bc.push(a)}; oa.Object.defineProperties(G.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}}});G.prototype.isReal=G.prototype.o;G.prototype.setSpot=G.prototype.jk;G.prototype.setRectSpot=G.prototype.Mi;G.prototype.snapToGridPoint=G.prototype.Hz;G.prototype.snapToGrid=G.prototype.Gz;G.prototype.projectOntoLineSegmentPoint=G.prototype.xz;G.prototype.projectOntoLineSegment=G.prototype.wz; G.prototype.direction=G.prototype.direction;G.prototype.directionPoint=G.prototype.Va;G.prototype.normalize=G.prototype.normalize;G.prototype.distanceSquared=G.prototype.ed;G.prototype.distanceSquaredPoint=G.prototype.Ce;G.prototype.scale=G.prototype.scale;G.prototype.rotate=G.prototype.rotate;G.prototype.offset=G.prototype.offset;G.prototype.subtract=G.prototype.Zd;G.prototype.add=G.prototype.add;G.prototype.equalsApprox=G.prototype.Oa;G.prototype.equalTo=G.prototype.Ai;G.prototype.equals=G.prototype.A; G.prototype.set=G.prototype.set;G.prototype.setTo=G.prototype.sg;var cc=null,dc=null,ec=null,fc=null,gc=null,bc=[];G.className="Point";G.parse=Sb;G.stringify=Tb;G.distanceLineSegmentSquared=Zb;G.distanceSquared=$b;G.direction=ac;G.Origin=cc=(new G(0,0)).ga();G.InfiniteTopLeft=dc=(new G(-Infinity,-Infinity)).ga();G.InfiniteBottomRight=ec=(new G(Infinity,Infinity)).ga();G.SixPoint=fc=(new G(6,6)).ga();G.NoPoint=gc=(new G(NaN,NaN)).ga();G.parse=Sb;G.stringify=Tb;G.distanceLineSegmentSquared=Zb; G.distanceSquared=$b;G.direction=ac;function L(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):A("Invalid arguments to Size constructor: "+a+", "+b);this.v=!1}var lc,mc,nc,oc,pc,qc,rc;L.prototype.assign=function(a){this.$=a.$;this.Y=a.Y;return this};L.prototype.h=function(a,b){this.$=a;this.Y=b;return this};L.prototype.sg=function(a,b){this.$=a;this.Y=b;return this};L.prototype.set=function(a){this.$=a.$;this.Y=a.Y;return this}; L.prototype.copy=function(){var a=new L;a.$=this.$;a.Y=this.Y;return a};t=L.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function xc(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 L(c,e)}return new L}function yc(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof L?this.$===a.width&&this.Y===a.height:!1};t.Ai=function(a,b){return this.$===a&&this.Y===b}; t.Oa=function(a){return H.w(this.$,a.width)&&H.w(this.Y,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};L.alloc=function(){var a=zc.pop();return void 0===a?new L:a};L.free=function(a){zc.push(a)}; oa.Object.defineProperties(L.prototype,{width:{get:function(){return this.$},set:function(a){0>a&&Aa(a,">= 0",L,"width");this.$=a}},height:{get:function(){return this.Y},set:function(a){0>a&&Aa(a,">= 0",L,"height");this.Y=a}}});L.prototype.isReal=L.prototype.o;L.prototype.equalsApprox=L.prototype.Oa;L.prototype.equalTo=L.prototype.Ai;L.prototype.equals=L.prototype.A;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.sg; var zc=[];L.className="Size";L.parse=xc;L.stringify=yc;L.ZeroSize=lc=(new L(0,0)).ga();L.OneSize=mc=(new L(1,1)).ga();L.SixSize=nc=(new L(6,6)).ga();L.EightSize=oc=(new L(8,8)).ga();L.TenSize=pc=(new L(10,10)).ga();L.InfiniteSize=qc=(new L(Infinity,Infinity)).ga();L.NoSize=rc=(new L(NaN,NaN)).ga();L.parse=xc;L.stringify=yc; function M(a,b,c,d){void 0===a?this.Y=this.$=this.D=this.C=0:a instanceof G?b instanceof G?(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 L?(this.C=a.C,this.D=a.D,this.$=b.$,this.Y=b.Y):A("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):A("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this.v=!1}t=M.prototype;t.assign=function(a){this.C=a.C;this.D=a.D;this.$=a.$;this.Y=a.Y;return this};t.h=function(a,b,c,d){this.C=a;this.D=b;this.$=c;this.Y=d;return this};function Ac(a,b,c){a.$=b;a.Y=c}t.sg=function(a,b,c,d){this.C=a;this.D=b;this.$=c;this.Y=d;return this};t.set=function(a){this.C=a.C;this.D=a.D;this.$=a.$;this.Y=a.Y;return this};t.md=function(a){this.C=a.C;this.D=a.D;return this};t.Ez=function(a){this.$=a.$;this.Y=a.Y;return this}; M.prototype.copy=function(){var a=new M;a.C=this.C;a.D=this.D;a.$=this.$;a.Y=this.Y;return a};t=M.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function Dc(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 Ec(a){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.A=function(a){return a instanceof M?this.C===a.x&&this.D===a.y&&this.$===a.width&&this.Y===a.height:!1};t.Ai=function(a,b,c,d){return this.C===a&&this.D===b&&this.$===c&&this.Y===d};t.Oa=function(a){return H.w(this.C,a.x)&&H.w(this.D,a.y)&&H.w(this.$,a.width)&&H.w(this.Y,a.height)};function Fc(a,b){return H.ba(a.C,b.x)&&H.ba(a.D,b.y)&&H.ba(a.$,b.width)&&H.ba(a.Y,b.height)} t.ea=function(a){return this.C<=a.x&&this.C+this.$>=a.x&&this.D<=a.y&&this.D+this.Y>=a.y};t.lf=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};t.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};t.reset=function(){this.Y=this.$=this.D=this.C=0};t.offset=function(a,b){this.C+=a;this.D+=b;return this};t.gd=function(a,b){return Gc(this,b,a,b,a)}; t.Fp=function(a){return Gc(this,a.top,a.right,a.bottom,a.left)};t.Lv=function(a){return Gc(this,-a.top,-a.right,-a.bottom,-a.left)};t.fz=function(a,b,c,d){return Gc(this,a,b,c,d)};function Gc(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}t.jz=function(a){return Hc(this,a.x,a.y,a.width,a.height)};t.Yu=function(a,b,c,d){return Hc(this,a,b,c,d)}; function Hc(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}t.Kc=function(a){return this.Zu(a.x,a.y,a.width,a.height)};t.Zu=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}; function Ic(a,b,c){var d=a.$,e=a.C,f=b.x-c;if(e>b.width+c+c+f||f>d+e)return!1;d=a.Y;a=a.D;e=b.y-c;return a>b.height+c+c+e||e>d+a?!1:!0}t.Ke=function(a){return Jc(this,a.x,a.y,0,0)};t.Wc=function(a){return Jc(this,a.C,a.D,a.$,a.Y)};t.Sv=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return Jc(this,a,b,c,d)};function Jc(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} t.jk=function(a,b,c){this.C=a-c.offsetX-c.x*this.$;this.D=b-c.offsetY-c.y*this.Y;return this};function Lc(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 Mc(a,b,c,d,e,f,g,h){return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.o=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.lz=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:{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&&Aa(a,">= 0",M,"width");this.$=a}},height:{get:function(){return this.Y},set:function(a){0>a&&Aa(a,">= 0",M,"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:function(a){this.D+=a-(this.D+this.Y)}},position:{get:function(){return new G(this.C,this.D)},set:function(a){this.C=a.x;this.D= a.y}},size:{get:function(){return new L(this.$,this.Y)},set:function(a){this.$=a.width;this.Y=a.height}},center:{get:function(){return new G(this.C+this.$/2,this.D+this.Y/2)},set:function(a){this.C=a.x-this.$/2;this.D=a.y-this.Y/2}},centerX:{get:function(){return this.C+this.$/2},set:function(a){this.C=a-this.$/2}},centerY:{get:function(){return this.D+this.Y/2},set:function(a){this.D= a-this.Y/2}}});M.prototype.isEmpty=M.prototype.lz;M.prototype.isReal=M.prototype.o;M.prototype.setSpot=M.prototype.jk;M.prototype.union=M.prototype.Sv;M.prototype.unionRect=M.prototype.Wc;M.prototype.unionPoint=M.prototype.Ke;M.prototype.intersects=M.prototype.Zu;M.prototype.intersectsRect=M.prototype.Kc;M.prototype.intersect=M.prototype.Yu;M.prototype.intersectRect=M.prototype.jz;M.prototype.grow=M.prototype.fz;M.prototype.subtractMargin=M.prototype.Lv;M.prototype.addMargin=M.prototype.Fp; M.prototype.inflate=M.prototype.gd;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains;M.prototype.containsRect=M.prototype.lf;M.prototype.containsPoint=M.prototype.ea;M.prototype.equalsApprox=M.prototype.Oa;M.prototype.equalTo=M.prototype.Ai;M.prototype.equals=M.prototype.A;M.prototype.setSize=M.prototype.Ez;M.prototype.setPoint=M.prototype.md;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.sg;var Oc=null,Pc=null,Nc=[];M.className="Rect";M.parse=Dc; M.stringify=Ec;M.contains=Lc;M.intersects=Mc;M.ZeroRect=Oc=(new M(0,0,0,0)).ga();M.NoRect=Pc=(new M(NaN,NaN,NaN,NaN)).ga();M.parse=Dc;M.stringify=Ec;M.contains=Lc;M.intersects=Mc; function Qc(a,b,c,d){void 0===a?this.le=this.be=this.te=this.we=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):A("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.v=!1}Qc.prototype.assign=function(a){this.we=a.we;this.te=a.te;this.be=a.be;this.le=a.le;return this};Qc.prototype.sg=function(a,b,c,d){this.we=a;this.te=b;this.be=c;this.le=d;return this}; Qc.prototype.set=function(a){this.we=a.we;this.te=a.te;this.be=a.be;this.le=a.le;return this};Qc.prototype.copy=function(){var a=new Qc;a.we=this.we;a.te=this.te;a.be=this.be;a.le=this.le;return a};t=Qc.prototype;t.ga=function(){this.v=!0;Object.freeze(this);return this};t.I=function(){return Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ha=function(){Object.isFrozen(this)&&A("cannot thaw constant: "+this);this.v=!1;return this}; function Uc(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 Qc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Qc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new Qc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new Qc(c,e):new Qc(c,e,f,g)}return new Qc} function Vc(a){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.A=function(a){return a instanceof Qc?this.we===a.top&&this.te===a.right&&this.be===a.bottom&&this.le===a.left:!1};t.Ai=function(a,b,c,d){return this.we===a&&this.te===b&&this.be===c&&this.le===d}; t.Oa=function(a){return H.w(this.we,a.top)&&H.w(this.te,a.right)&&H.w(this.be,a.bottom)&&H.w(this.le,a.left)};t.o=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFin