gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
122 lines • 895 kB
JavaScript
/*
* GoJS v2.1.18 JavaScript Library for HTML Diagrams, https://gojs.net
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com.
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.18/license.html.
* DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE.
*/
(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 da(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},fa;
if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ka=fa;
function la(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(ka)ka(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.MA=b.prototype}var ma="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,na="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function oa(a){if(a){for(var b=ma,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&&na(b,c,{writable:!0,value:a})}}oa(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 x="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===x.requestAnimationFrame&&(x.requestAnimationFrame=x.setImmediate);function qa(){}function ra(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=sa(function(){c=-1;a.apply(d,e)},b)}}function sa(a,b){return x.setTimeout(a,b)}function ta(a){return x.document.createElement(a)}
function B(a){throw Error(a);}function ua(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 va(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 wa(a){x.console&&x.console.log(a)}
function ya(){x.console&&x.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 za(a){return"object"===typeof a&&null!==a}function Aa(a){return Array.isArray(a)||x.NodeList&&a instanceof x.NodeList||x.HTMLCollection&&a instanceof x.HTMLCollection}function Ba(a){return Array.prototype.slice.call(a)}
function Ca(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 Da(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 Fa(){var a=Ga.pop();return void 0===a?[]:a}function Ha(a){a.length=0;Ga.push(a)}
function Ia(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(za(a)&&a.constructor)return Ia(a.constructor);return typeof a}
function Ja(a){var b=a;za(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 Ka(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.GA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function La(a,b,c){Object.defineProperty(Oa.prototype,a,{get:b,set:c})}function Pa(){var a=Qa;if(0===a.length)for(var b=x.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.B&&a.push(e.parentElement.B)}return a}
function Ra(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 Sa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Va=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Wa=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Xa=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i),
Ga=[];Object.freeze([]);var Qa=[];qa.className="Util";qa.Dx="32ab5ff3b26f42dc0ed90f21442913b5";qa.adym="gojs.net";qa.vfo="28e647fdb26e";qa.className="Util";function D(a,b,c){Ya(this);this.l=a;this.Qa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Qa};function Za(a,b){return void 0===b||null===b||""===b?null:a[b]}
ma.Object.defineProperties(D.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.Qa}},value:{get:function(){return this.u}}});D.className="EnumValue";function cb(){this.Qw=[]}cb.prototype.toString=function(){return this.Qw.join("")};cb.prototype.add=function(a){""!==a&&this.Qw.push(a)};cb.className="StringBuilder";function db(){}db.className="PropertyCollection";
function eb(){}eb.prototype.reset=function(){};eb.prototype.next=function(){return!1};eb.prototype.ed=function(){return!1};eb.prototype.first=function(){return null};eb.prototype.any=function(){return!1};eb.prototype.all=function(){return!0};eb.prototype.each=function(){return this};eb.prototype.map=function(){return this};eb.prototype.filter=function(){return this};eb.prototype.Dd=function(){};eb.prototype.toString=function(){return"EmptyIterator"};
ma.Object.defineProperties(eb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});eb.prototype.first=eb.prototype.first;eb.prototype.hasNext=eb.prototype.ed;eb.prototype.next=eb.prototype.next;eb.prototype.reset=eb.prototype.reset;var fb=null;eb.className="EmptyIterator";fb=new eb;function gb(a){this.key=-1;this.value=a}gb.prototype.reset=function(){this.key=-1};
gb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};gb.prototype.ed=function(){return this.next()};gb.prototype.first=function(){this.key=0;return this.value};gb.prototype.any=function(a){this.key=-1;return a(this.value)};gb.prototype.all=function(a){this.key=-1;return a(this.value)};gb.prototype.each=function(a){this.key=-1;a(this.value);return this};gb.prototype.map=function(a){return new gb(a(this.value))};
gb.prototype.filter=function(a){return a(this.value)?new gb(this.value):fb};gb.prototype.Dd=function(){this.value=null};gb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};ma.Object.defineProperties(gb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});gb.prototype.first=gb.prototype.first;gb.prototype.hasNext=gb.prototype.ed;gb.prototype.next=gb.prototype.next;
gb.prototype.reset=gb.prototype.reset;gb.className="SingletonIterator";function jb(a){this.pb=a;this.$e=null;a.Fa=null;this.ia=a.Aa;this.Oa=-1}jb.prototype.reset=function(){var a=this.pb;a.Fa=null;this.ia=a.Aa;this.Oa=-1};jb.prototype.next=function(){var a=this.pb;if(a.Aa!==this.ia&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Oa,d=this.$e;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Oa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Dd()}return!1};
jb.prototype.ed=function(){return this.next()};jb.prototype.first=function(){var a=this.pb;this.ia=a.Aa;this.Oa=0;a=a.j;var b=a.length,c=this.$e;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Oa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};jb.prototype.any=function(a){var b=this.pb;b.Fa=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
jb.prototype.all=function(a){var b=this.pb;b.Fa=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};jb.prototype.each=function(a){var b=this.pb;b.Fa=null;this.Oa=-1;b=b.j;for(var c=b.length,d=this.$e,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
jb.prototype.map=function(a){var b=this.pb;b.Fa=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.$e,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.kb();return a.iterator};jb.prototype.filter=function(a){var b=this.pb;b.Fa=null;this.Oa=-1;var c=[];b=b.j;for(var d=b.length,e=this.$e,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.kb();return a.iterator};
jb.prototype.Dd=function(){this.key=-1;this.value=null;this.ia=-1;this.$e=null;this.pb.Fa=this};jb.prototype.toString=function(){return"ListIterator@"+this.Oa+"/"+this.pb.count};
ma.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.$e},set:function(a){this.$e=a}},count:{get:function(){var a=this.$e;if(null!==a){for(var b=0,c=this.pb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.pb.j.length}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.ed;jb.prototype.next=jb.prototype.next;
jb.prototype.reset=jb.prototype.reset;jb.className="ListIterator";function kb(a){this.pb=a;a.Zg=null;this.ia=a.Aa;this.Oa=a.j.length}kb.prototype.reset=function(){var a=this.pb;a.Zg=null;this.ia=a.Aa;this.Oa=a.j.length};kb.prototype.next=function(){var a=this.pb;if(a.Aa!==this.ia&&0>this.key)return!1;var b=--this.Oa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Dd();return!1};kb.prototype.ed=function(){return this.next()};
kb.prototype.first=function(){var a=this.pb;this.ia=a.Aa;var b=a.j;this.Oa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};kb.prototype.any=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};kb.prototype.all=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
kb.prototype.each=function(a){var b=this.pb;b.Zg=null;b=b.j;var c=b.length;this.Oa=c;for(--c;0<=c;c--)a(b[c]);return this};kb.prototype.map=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.kb();return a.iterator};kb.prototype.filter=function(a){var b=this.pb;b.Zg=null;var c=[];b=b.j;var d=b.length;this.Oa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.kb();return a.iterator};
kb.prototype.Dd=function(){this.key=-1;this.value=null;this.ia=-1;this.pb.Zg=this};kb.prototype.toString=function(){return"ListIteratorBackwards("+this.Oa+"/"+this.pb.count+")"};ma.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.pb.j.length}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.ed;kb.prototype.next=kb.prototype.next;kb.prototype.reset=kb.prototype.reset;
kb.className="ListIteratorBackwards";function E(a){Ya(this);this.s=!1;this.j=[];this.Aa=0;this.Zg=this.Fa=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=E.prototype;t.kb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"List()#"+lb(this)};t.add=function(a){if(null===a)return this;this.s&&ua(this,a);this.j.push(a);this.kb();return this};
t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);var b=this.j;if(Aa(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.kb();return this};t.clear=function(){this.s&&ua(this);this.j.length=0;this.kb()};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.L=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.L(a)};t.hd=function(a,b){var c=this.j;(0>a||a>=c.length)&&va(a,"0 <= i < length",E,"setElt:i");this.s&&ua(this,a);c[a]=b};t.set=function(a,b){this.hd(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.Xb=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};t.pop=function(){this.s&&ua(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.kb();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.kb();return b};t=E.prototype;t.tb=function(a,b){0>a&&va(a,">= 0",E,"insertAt:i");this.s&&ua(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.kb()};t.remove=function(a){if(null===a)return!1;this.s&&ua(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.kb();return!0};t.delete=function(a){return this.remove(a)};
t.$a=function(a){var b=this.j;(0>a||a>=b.length)&&va(a,"0 <= i < length",E,"removeAt:i");this.s&&ua(this,a);a===b.length-1?b.pop():b.splice(a,1);this.kb()};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.s&&ua(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.kb();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.na=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};t.pw=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.s&&ua(this);this.j.sort(a);this.kb();return this};
t.ej=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.s&&ua(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&va(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.kb()),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.kb();return this};
t.reverse=function(){this.s&&ua(this);this.j.reverse();this.kb();return this};
ma.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 fb;var a=this.Fa;return null!==a?(a.reset(),a):new jb(this)}},iteratorBackwards:{
get:function(){if(0>=this.j.length)return fb;var a=this.Zg;return null!==a?(a.reset(),a):new kb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.ej;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.pw;E.prototype.toArray=E.prototype.na;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.$a;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.tb;
E.prototype.pop=E.prototype.pop;E.prototype.last=E.prototype.Xb;E.prototype.first=E.prototype.first;E.prototype.set=E.prototype.set;E.prototype.setElt=E.prototype.hd;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.L;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.ea;
E.prototype.freeze=E.prototype.freeze;E.className="List";function mb(a){this.og=a;a.Fa=null;this.ia=a.Aa;this.la=null}mb.prototype.reset=function(){var a=this.og;a.Fa=null;this.ia=a.Aa;this.la=null};mb.prototype.next=function(){var a=this.og;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Dd();return!1};mb.prototype.ed=function(){return this.next()};
mb.prototype.first=function(){var a=this.og;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};mb.prototype.any=function(a){var b=this.og;this.la=b.Fa=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};mb.prototype.all=function(a){var b=this.og;this.la=b.Fa=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};mb.prototype.each=function(a){var b=this.og;this.la=b.Fa=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
mb.prototype.map=function(a){var b=this.og;b.Fa=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};mb.prototype.filter=function(a){var b=this.og;b.Fa=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};mb.prototype.Dd=function(){this.value=this.key=null;this.ia=-1;this.og.Fa=this};mb.prototype.toString=function(){return null!==this.la?"SetIterator@"+this.la.value:"SetIterator"};
ma.Object.defineProperties(mb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.og.Db}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.ed;mb.prototype.next=mb.prototype.next;mb.prototype.reset=mb.prototype.reset;mb.className="SetIterator";
function F(a){Ya(this);this.s=!1;this.Fb={};this.Db=0;this.Fa=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=F.prototype;t.kb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Set()#"+lb(this)};
t.add=function(a){if(null===a)return this;this.s&&ua(this,a);var b=a;za(a)&&(b=nb(a));void 0===this.Fb[b]&&(this.Db++,a=new ob(a,a),this.Fb[b]=a,b=this.Ue,null===b?this.ba=a:(a.Cl=b,b.oa=a),this.Ue=a,this.kb());return this};t.addAll=function(a){if(null===a)return this;this.s&&ua(this);if(Aa(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 za(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Fb[b]};t.has=function(a){return this.contains(a)};t.Wy=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Xy=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.ba;return null===a?null:a.value};
F.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};F.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};F.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.oa;return this};F.prototype.map=function(a){for(var b=new F,c=this.ba;null!==c;)b.add(a(c.value)),c=c.oa;return b};F.prototype.filter=function(a){for(var b=new F,c=this.ba;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.s&&ua(this,a);var b=a;if(za(a)&&(b=lb(a),void 0===b))return!1;a=this.Fb[b];if(void 0===a)return!1;var c=a.oa,d=a.Cl;null!==c&&(c.Cl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.Ue===a&&(this.Ue=d);delete this.Fb[b];this.Db--;this.kb();return!0};t.delete=function(a){return this.remove(a)};
t.Gq=function(a){if(null===a)return this;this.s&&ua(this);if(Aa(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.rA=function(a){if(null===a||0===this.count)return this;this.s&&ua(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.Gq(a);return this};t.clear=function(){this.s&&ua(this);this.Fb={};this.Db=0;null!==this.Fa&&this.Fa.reset();this.Ue=this.ba=null;this.kb()};
F.prototype.copy=function(){var a=new F,b=this.Fb,c;for(c in b)a.add(b[c].value);return a};F.prototype.na=function(){var a=Array(this.Db),b=this.Fb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};F.prototype.ow=function(){var a=new E,b=this.Fb,c;for(c in b)a.add(b[c].value);return a};function Ya(a){a.__gohashid=pb++}function nb(a){var b=a.__gohashid;void 0===b&&(b=pb++,a.__gohashid=b);return b}function lb(a){return a.__gohashid}
ma.Object.defineProperties(F.prototype,{count:{get:function(){return this.Db}},size:{get:function(){return this.Db}},iterator:{get:function(){if(0>=this.Db)return fb;var a=this.Fa;return null!==a?(a.reset(),a):new mb(this)}}});F.prototype.toList=F.prototype.ow;F.prototype.toArray=F.prototype.na;F.prototype.clear=F.prototype.clear;F.prototype.retainAll=F.prototype.rA;F.prototype.removeAll=F.prototype.Gq;
F.prototype["delete"]=F.prototype.delete;F.prototype.remove=F.prototype.remove;F.prototype.first=F.prototype.first;F.prototype.containsAny=F.prototype.Xy;F.prototype.containsAll=F.prototype.Wy;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.ea;F.prototype.freeze=F.prototype.freeze;var pb=1;F.className="Set";F.uniqueHash=Ya;F.hashIdUnique=nb;F.hashId=lb;
function qb(a){this.fa=a;this.ia=a.Aa;this.la=null}qb.prototype.reset=function(){this.ia=this.fa.Aa;this.la=null};qb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=this.key=a=b.key,!0;this.Dd();return!1};qb.prototype.ed=function(){return this.next()};qb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.value=this.key=a=a.key):null};
qb.prototype.any=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};qb.prototype.all=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};qb.prototype.each=function(a){var b=this.fa;this.la=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};qb.prototype.map=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator};
qb.prototype.filter=function(a){var b=this.fa;this.la=null;var c=new E;for(b=b.ba;null!==b;){var d=b.key;a(d)&&c.add(d);b=b.oa}return c.iterator};qb.prototype.Dd=function(){this.value=this.key=null;this.ia=-1};qb.prototype.toString=function(){return null!==this.la?"MapKeySetIterator@"+this.la.value:"MapKeySetIterator"};ma.Object.defineProperties(qb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});
qb.prototype.first=qb.prototype.first;qb.prototype.hasNext=qb.prototype.ed;qb.prototype.next=qb.prototype.next;qb.prototype.reset=qb.prototype.reset;qb.className="MapKeySetIterator";function rb(a){F.call(this);Ya(this);this.s=!0;this.fa=a}la(rb,F);t=rb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.fa.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.fa.contains(a)};
t.has=function(a){return this.contains(a)};t.remove=function(){B("This Set is read-only: "+this.toString());return!1};t.delete=function(a){return this.remove(a)};t.clear=function(){B("This Set is read-only: "+this.toString())};t.first=function(){var a=this.fa.ba;return null!==a?a.key:null};rb.prototype.any=function(a){for(var b=this.fa.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};rb.prototype.all=function(a){for(var b=this.fa.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};
rb.prototype.each=function(a){for(var b=this.fa.ba;null!==b;)a(b.key),b=b.oa;return this};rb.prototype.map=function(a){for(var b=new F,c=this.fa.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};rb.prototype.filter=function(a){for(var b=new F,c=this.fa.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};rb.prototype.copy=function(){return new rb(this.fa)};rb.prototype.pw=function(){var a=new F,b=this.fa.Fb,c;for(c in b)a.add(b[c].key);return a};
rb.prototype.na=function(){var a=this.fa.Fb,b=Array(this.fa.Db),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};rb.prototype.ow=function(){var a=new E,b=this.fa.Fb,c;for(c in b)a.add(b[c].key);return a};ma.Object.defineProperties(rb.prototype,{count:{get:function(){return this.fa.Db}},size:{get:function(){return this.fa.Db}},iterator:{get:function(){return 0>=this.fa.Db?fb:new qb(this.fa)}}});
rb.prototype.toList=rb.prototype.ow;rb.prototype.toArray=rb.prototype.na;rb.prototype.toSet=rb.prototype.pw;rb.prototype.first=rb.prototype.first;rb.prototype.clear=rb.prototype.clear;rb.prototype["delete"]=rb.prototype.delete;rb.prototype.remove=rb.prototype.remove;rb.prototype.has=rb.prototype.has;rb.prototype.contains=rb.prototype.contains;rb.prototype.add=rb.prototype.add;rb.prototype.thaw=rb.prototype.ea;rb.prototype.freeze=rb.prototype.freeze;rb.className="MapKeySet";
function sb(a){this.fa=a;a.Te=null;this.ia=a.Aa;this.la=null}sb.prototype.reset=function(){var a=this.fa;a.Te=null;this.ia=a.Aa;this.la=null};sb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.value=b.value,this.key=b.key,!0;this.Dd();return!1};sb.prototype.ed=function(){return this.next()};
sb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;if(null!==a){this.la=a;var b=a.value;this.key=a.key;return this.value=b}return null};sb.prototype.any=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};sb.prototype.all=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};sb.prototype.each=function(a){var b=this.fa;this.la=b.Te=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
sb.prototype.map=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};sb.prototype.filter=function(a){var b=this.fa;this.la=b.Te=null;var c=new E;for(b=b.ba;null!==b;){var d=b.value;a(d)&&c.add(d);b=b.oa}return c.iterator};sb.prototype.Dd=function(){this.value=this.key=null;this.ia=-1;this.fa.Te=this};sb.prototype.toString=function(){return null!==this.la?"MapValueSetIterator@"+this.la.value:"MapValueSetIterator"};
ma.Object.defineProperties(sb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});sb.prototype.first=sb.prototype.first;sb.prototype.hasNext=sb.prototype.ed;sb.prototype.next=sb.prototype.next;sb.prototype.reset=sb.prototype.reset;sb.className="MapValueSetIterator";function ob(a,b){this.key=a;this.value=b;this.Cl=this.oa=null}ob.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
ob.className="KeyValuePair";function tb(a){this.fa=a;a.Fa=null;this.ia=a.Aa;this.la=null}tb.prototype.reset=function(){var a=this.fa;a.Fa=null;this.ia=a.Aa;this.la=null};tb.prototype.next=function(){var a=this.fa;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.la;b=null===b?a.ba:b.oa;if(null!==b)return this.la=b,this.key=b.key,this.value=b.value,!0;this.Dd();return!1};tb.prototype.ed=function(){return this.next()};
tb.prototype.first=function(){var a=this.fa;this.ia=a.Aa;a=a.ba;return null!==a?(this.la=a,this.key=a.key,this.value=a.value,a):null};tb.prototype.any=function(a){var b=this.fa;this.la=b.Fa=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};tb.prototype.all=function(a){var b=this.fa;this.la=b.Fa=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};tb.prototype.each=function(a){var b=this.fa;this.la=b.Fa=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this};
tb.prototype.map=function(a){var b=this.fa;this.la=b.Fa=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};tb.prototype.filter=function(a){var b=this.fa;this.la=b.Fa=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};tb.prototype.Dd=function(){this.value=this.key=null;this.ia=-1;this.fa.Fa=this};tb.prototype.toString=function(){return null!==this.la?"MapIterator@"+this.la:"MapIterator"};
ma.Object.defineProperties(tb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.fa.Db}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.ed;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset;tb.className="MapIterator";
function G(a){Ya(this);this.s=!1;this.Fb={};this.Db=0;this.Te=this.Fa=null;this.Aa=0;this.Ue=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=G.prototype;t.kb=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.s=!0;return this};t.ea=function(){this.s=!1;return this};t.toString=function(){return"Map()#"+lb(this)};
t.add=function(a,b){this.s&&ua(this,a);var c=a;za(a)&&(c=nb(a));var d=this.Fb[c];void 0===d?(this.Db++,a=new ob(a,b),this.Fb[c]=a,c=this.Ue,null===c?this.ba=a:(a.Cl=c,c.oa=a),this.Ue=a,this.kb()):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(Aa(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else if(a instanceof G)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.ba};G.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};
G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.oa;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=G.prototype;t.contains=function(a){var b=a;return za(a)&&(b=lb(a),void 0===b)?!1:void 0!==this.Fb[b]};t.has=function(a){return this.contains(a)};
t.H=function(a){var b=a;if(za(a)&&(b=lb(a),void 0===b))return null;a=this.Fb[b];return void 0===a?null:a.value};t.get=function(a){return this.H(a)};t.remove=function(a){if(null===a)return!1;this.s&&ua(this,a);var b=a;if(za(a)&&(b=lb(a),void 0===b))return!1;a=this.Fb[b];if(void 0===a)return!1;var c=a.oa,d=a.Cl;null!==c&&(c.Cl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.Ue===a&&(this.Ue=d);delete this.Fb[b];this.Db--;this.kb();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this.s&&ua(this);this.Fb={};this.Db=0;null!==this.Fa&&this.Fa.reset();null!==this.Te&&this.Te.reset();this.Ue=this.ba=null;this.kb()};G.prototype.copy=function(){var a=new G,b=this.Fb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};G.prototype.na=function(){var a=this.Fb,b=Array(this.Db),c=0,d;for(d in a){var e=a[d];b[c]=new ob(e.key,e.value);c++}return b};G.prototype.Cf=function(){return new rb(this)};
ma.Object.defineProperties(G.prototype,{count:{get:function(){return this.Db}},size:{get:function(){return this.Db}},iterator:{get:function(){if(0>=this.count)return fb;var a=this.Fa;return null!==a?(a.reset(),a):new tb(this)}},iteratorKeys:{get:function(){return 0>=this.count?fb:new qb(this)}},iteratorValues:{get:function(){if(0>=this.count)return fb;
var a=this.Te;return null!==a?(a.reset(),a):new sb(this)}}});G.prototype.toKeySet=G.prototype.Cf;G.prototype.toArray=G.prototype.na;G.prototype.clear=G.prototype.clear;G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.get=G.prototype.get;G.prototype.getValue=G.prototype.H;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.first=G.prototype.first;G.prototype.addAll=G.prototype.addAll;G.prototype.set=G.prototype.set;
G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;G.className="Map";function I(a,b){void 0===a?this.y=this.x=0:"number"===typeof a&&"number"===typeof b?(this.x=a,this.y=b):B("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}I.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.h=function(a,b){this.x=a;this.y=b;return this};I.prototype.Cg=function(a,b){this.x=a;this.y=b;return this};
I.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};I.prototype.copy=function(){var a=new I;a.x=this.x;a.y=this.y;return a};t=I.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};
function ub(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 vb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.w=function(a){return a instanceof I?this.x===a.x&&this.y===a.y:!1};t.Ri=function(a,b){return this.x===a&&this.y===b};t.Ma=function(a){return J.A(this.x,a.x)&&J.A(this.y,a.y)};
t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ae=function(a){this.x-=a.x;this.y-=a.y;return this};t.offset=function(a,b){this.x+=a;this.y+=b;return this};I.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;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.x=a*b-d*c;this.y=d*b+a*c;return this};t=I.prototype;
t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.Ce=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.dd=function(a,b){a-=this.x;b-=this.y;return a*a+b*b};t.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};t.Sa=function(a){return zb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return zb(a-this.x,b-this.y)};
function zb(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.kA=function(a,b,c,d){J.Ih(a,b,c,d,this.x,this.y,this);return this};t.lA=function(a,b){J.Ih(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.xA=function(a,b,c,d){J.nq(this.x,this.y,a,b,c,d,this);return this};t.yA=function(a,b){J.nq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};
t.dj=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};t.xk=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};t.transform=function(a){a.ra(this);return this};function Ab(a,b){b.Wd(a);return a}function Bb(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 Cb(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}
function Db(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.v=function(){return isFinite(this.x)&&isFinite(this.y)};I.alloc=function(){var a=Eb.pop();return void 0===a?new I:a};I.allocAt=function(a,b){var c=Eb.pop();if(void 0===c)return new I(a,b);c.x=a;c.y=b;return c};I.free=function(a){Eb.push(a)};I.prototype.isReal=I.prototype.v;
I.prototype.setSpot=I.prototype.xk;I.prototype.setRectSpot=I.prototype.dj;I.prototype.snapToGridPoint=I.prototype.yA;I.prototype.snapToGrid=I.prototype.xA;I.prototype.projectOntoLineSegmentPoint=I.prototype.lA;I.prototype.projectOntoLineSegment=I.prototype.kA;I.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return J.tq(a,b,c,d,e,f,g,h)};I.prototype.direction=I.prototype.direction;I.prototype.directionPoint=I.prototype.Sa;I.prototype.normalize=I.prototype.normalize;
I.prototype.distanceSquared=I.prototype.dd;I.prototype.distanceSquaredPoint=I.prototype.Ce;I.prototype.scale=I.prototype.scale;I.prototype.rotate=I.prototype.rotate;I.prototype.offset=I.prototype.offset;I.prototype.subtract=I.prototype.ae;I.prototype.add=I.prototype.add;I.prototype.equalsApprox=I.prototype.Ma;I.prototype.equalTo=I.prototype.Ri;I.prototype.equals=I.prototype.w;I.prototype.set=I.prototype.set;I.prototype.setTo=I.prototype.Cg;var Gb=null,Hb=null,Ib=null,Jb=null,Kb=null,Eb=[];
I.className="Point";I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db;I.Origin=Gb=(new I(0,0)).ca();I.InfiniteTopLeft=Hb=(new I(-Infinity,-Infinity)).ca();I.InfiniteBottomRight=Ib=(new I(Infinity,Infinity)).ca();I.SixPoint=Jb=(new I(6,6)).ca();I.NoPoint=Kb=(new I(NaN,NaN)).ca();I.parse=ub;I.stringify=vb;I.distanceLineSegmentSquared=Bb;I.distanceSquared=Cb;I.direction=Db;
function M(a,b){void 0===a?this.height=this.width=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.width=a,this.height=b):B("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Lb,Mb,Nb,Ob,Pb,Qb,Rb;M.prototype.assign=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.h=function(a,b){this.width=a;this.height=b;return this};M.prototype.Cg=function(a,b){this.width=a;this.height=b;return this};
M.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};M.prototype.copy=function(){var a=new M;a.width=this.width;a.height=this.height;return a};t=M.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!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 M(c,e)}return new M}function Tb(a){return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.w=function(a){return a instanceof M?this.width===a.width&&this.height===a.height:!1};t.Ri=function(a,b){return this.width===a&&this.height===b};
t.Ma=function(a){return J.A(this.width,a.width)&&J.A(this.height,a.height)};t.v=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Ub.pop();return void 0===a?new M:a};M.free=function(a){Ub.push(a)};M.prototype.isReal=M.prototype.v;M.prototype.equalsApprox=M.prototype.Ma;M.prototype.equalTo=M.prototype.Ri;M.prototype.equals=M.prototype.w;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Cg;var Ub=[];M.className="Size";M.parse=Sb;M.stringify=Tb;
M.ZeroSize=Lb=(new M(0,0)).ca();M.OneSize=Mb=(new M(1,1)).ca();M.SixSize=Nb=(new M(6,6)).ca();M.EightSize=Ob=(new M(8,8)).ca();M.TenSize=Pb=(new M(10,10)).ca();M.InfiniteSize=Qb=(new M(Infinity,Infinity)).ca();M.NoSize=Rb=(new M(NaN,NaN)).ca();M.parse=Sb;M.stringify=Tb;
function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof I?(c=a.x,a=a.y,b instanceof I?(d=b.x,b=b.y,this.x=Math.min(c,d),this.y=Math.min(a,b),this.width=Math.abs(c-d),this.height=Math.abs(a-b)):b instanceof M?(this.x=c,this.y=a,this.width=b.width,this.height=b.height):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.x=a,this.y=b,this.width=c,
this.height=d):B("Invalid arguments to Rect constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}t=N.prototype;t.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};t.h=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};function Vb(a,b,c){a.width=b;a.height=c}t.Cg=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};t.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};
t.jd=function(a){this.x=a.x;this.y=a.y;return this};t.vA=function(a){this.width=a.width;this.height=a.height;return this};N.prototype.copy=function(){var a=new N;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};t=N.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};
t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!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));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 N(c,e,f,g)}return new N}
function Zb(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.w=function(a){return a instanceof N?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};t.Ri=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Ma=function(a){return J.A(this.x,a.x)&&J.A(this.y,a.y)&&J.A(this.width,a.width)&&J.A(this.height,a.height)};
function $b(a,b){return J.$(a.x,b.x)&&J.$(a.y,b.y)&&J.$(a.width,b.width)&&J.$(a.height,b.height)}t.aa=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Be=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};t.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};t.offset=function(a,b){this.x+=a;this.y+=b;return this};
t.Wc=function(a,b){return ac(this,b,a,b,a)};t.eq=function(a){return ac(this,a.top,a.right,a.bottom,a.left)};t.nw=function(a){return ac(this,-a.top,-a.right,-a.bottom,-a.left)};t.Oz=function(a,b,c,d){return ac(this,a,b,c,d)};function ac(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}t.Sz=function(a){return bc(this,a.x,a.y,a.width,a.height)};t.Hv=function(a,b,c,d){return bc(this,a,b,c,d)};
function bc(a,b,c,d,e){var f=Math.max(a.x,b),g=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=g;a.width=Math.max(0,b-f);a.height=Math.max(0,c-g);return a}t.Gc=function(a){return this.Iv(a.x,a.y,a.width,a.height)};t.Iv=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
function dc(a,b){var c=a.width,d=a.x,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.height;a=a.y;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.Ie=function(a){return ec(this,a.x,a.y,0,0)};t.Hc=function(a){return ec(this,a.x,a.y,a.width,a.height)};t.uw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ec(this,a,b,c,d)};
function ec(a,b,c,d,e){var f=Math.min(a.x,b),g=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=g;a.width=b-f;a.height=c-g;return a}t.xk=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};function fc(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 gc(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.v=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.Uz=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=hc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=hc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){hc.push(a)};
ma.Object.defineProperties(N.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{
get:function(){return new I(this.x,this.y)},set:function(a){this.x=a.x;this.y=a.y}},size:{get:function(){return new M(this.width,this.height)},set:function(a){this.width=a.width;this.height=a.height}},center:{get:function(){return new I(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},
set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}});N.prototype.isEmpty=N.prototype.Uz;N.prototype.isReal=N.prototype.v;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return J.Tx(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.xk;N.prototype.union=N.prototype.uw;N.prototype.unionRect=N.prototype.Hc;N.prototype.unionPoint=N.prototype.Ie;N.prototype.intersects=N.prototype.Iv;
N.prototype.intersectsRect=N.prototype.Gc;N.prototype.intersect=N.prototype.Hv;N.prototype.intersectRect=N.prototype.Sz;N.prototype.grow=N.prototype.Oz;N.prototype.subtractMargin=N.prototype.nw;N.prototype.addMargin=N.prototype.eq;N.prototype.inflate=N.prototype.Wc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Be;N.prototype.containsPoint=N.prototype.aa;N.prototype.equalsApprox=N.prototype.Ma;N.prototype.equalTo=N.prototype.Ri;
N.prototype.equals=N.prototype.w;N.prototype.setSize=N.prototype.vA;N.prototype.setPoint=N.prototype.jd;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Cg;var ic=null,nc=null,hc=[];N.className="Rect";N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc;N.ZeroRect=ic=(new N(0,0,0,0)).ca();N.NoRect=nc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Wb;N.stringify=Zb;N.contains=fc;N.intersects=gc;
function oc(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=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):B("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.s=!1}oc.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};
oc.prototype.Cg=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};oc.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};oc.prototype.copy=function(){var a=new oc;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};t=oc.prototype;t.ca=function(){this.s=!0;Object.freeze(this);return this};t.G=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};
t.freeze=function(){this.s=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.s=!1;return this};
function pc(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 oc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new oc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new oc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new oc(c,e):new oc(c,e,f,g)}return new oc}
function qc(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.w=function(a){return a instanceof oc?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};t.Ri=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};
t.Ma=function(a){return J.A(this.top,a.top)&&J.A(this.right,a.right)&&J.A(this