sgojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
120 lines • 923 kB
JavaScript
/*
* GoJS v2.1.47 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-2021 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.47/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 ca(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},ka={};try{ka.__proto__=ia;ha=ka.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 la=fa;
function ma(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(la)la(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.AB=b.prototype}var na="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,oa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
function pa(a){if(a){for(var b=na,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&&oa(b,c,{writable:!0,value:a})}}pa(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&&(void 0===x.setImmediate?x.requestAnimationFrame=function(a){x.setTimeout(a,0)}:x.requestAnimationFrame=x.setImmediate);function ra(){}function sa(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&x.clearTimeout(c);c=ta(function(){c=-1;a.apply(d,e)},b)}}
function ta(a,b){return x.setTimeout(a,b)}function ua(a){return x.document.createElement(a)}function B(a){throw Error(a);}function va(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 wa(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 xa(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 Ea(){var a=Fa.pop();return void 0===a?[]:a}function Ia(a){a.length=0;Fa.push(a)}
function Ja(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 Ja(a.constructor);return typeof a}
function Ka(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 La(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.lB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
function Na(a,b,c){Object.defineProperty(Pa.prototype,a,{get:b,set:c})}function Qa(){var a=Ra;if(void 0===x.document)return a;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 Sa(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 Ta=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 9.0"),Ua=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("MSIE 10.0"),Va=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Trident/7"),Wa=void 0!==x.navigator&&0<x.navigator.userAgent.indexOf("Edge/"),Xa=void 0!==x.navigator&&void 0!==x.navigator.platform&&0<=x.navigator.platform.toUpperCase().indexOf("MAC"),Ya=void 0!==x.navigator&&void 0!==x.navigator.platform&&null!==x.navigator.platform.match(/(iPhone|iPod|iPad)/i),
Fa=[];Object.freeze([]);var Ra=[];ra.className="Util";ra.Dx="32ab5ff3b26f42dc0ed90f21452913b5";ra.adym="gojs.net";ra.vfo="28e647fdb761";ra.className="Util";function D(a,b,c){Za(this);this.l=a;this.Qa=b;this.u=c}D.prototype.toString=function(){return"EnumValue."+this.Qa};function $a(a,b){return void 0===b||null===b||""===b?null:a[b]}
na.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 bb(){this.sx=[]}bb.prototype.toString=function(){return this.sx.join("")};bb.prototype.add=function(a){""!==a&&this.sx.push(a)};bb.className="StringBuilder";function cb(){}cb.className="PropertyCollection";
var db={nB:!1,sB:!1,pB:!1,rB:!1,xB:!1,vB:!1,my:!1,oB:null,trace:function(a){x.console&&x.console.log(a)},qB:function(a,b,c,d){a.strokeStyle="red";a.fillStyle="red";a.font="8px sans-serif";a.beginPath();a.moveTo(-10,0);a.lineTo(10,0);a.moveTo(0,-10);a.lineTo(0,10);a.stroke();a.setTransform(1,0,0,1,0,0);a.scale(c,c);a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);a.lineWidth=2;a.beginPath();a.moveTo(d.left,d.top+20);a.lineTo(d.left,d.top);a.lineTo(d.left+20,d.top);a.moveTo(d.right,d.bottom-20);a.lineTo(d.right,
d.bottom);a.lineTo(d.right-20,d.bottom);a.stroke();a.fillText("DB: "+Math.round(d.x)+", "+Math.round(d.y)+", "+Math.round(d.width)+", "+Math.round(d.height),d.left,d.top-5)},mB:function(a){var b={},c;for(c in a){b.x=c;if("licenseKey"!==b.x){var d=a[b.x];if(void 0!==d.prototype){b.Im=Object.getOwnPropertyNames(d.prototype);for(var e={Ak:0};e.Ak<b.Im.length;e={Ak:e.Ak},e.Ak++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.Im[e.Ak]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
b.Im[e.Ak],{set:function(a,b){return function(){throw Error("Property "+a.Im[b.Ak]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={Im:b.Im,x:b.x}}}};function hb(){}hb.prototype.reset=function(){};hb.prototype.next=function(){return!1};hb.prototype.sd=function(){return!1};hb.prototype.first=function(){return null};hb.prototype.any=function(){return!1};hb.prototype.all=function(){return!0};hb.prototype.each=function(){return this};hb.prototype.map=function(){return this};hb.prototype.filter=function(){return this};
hb.prototype.Td=function(){};hb.prototype.toString=function(){return"EmptyIterator"};na.Object.defineProperties(hb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.sd;hb.prototype.next=hb.prototype.next;hb.prototype.reset=hb.prototype.reset;var ib=null;hb.className="EmptyIterator";ib=new hb;function jb(a){this.key=-1;this.value=a}
jb.prototype.reset=function(){this.key=-1};jb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};jb.prototype.sd=function(){return this.next()};jb.prototype.first=function(){this.key=0;return this.value};jb.prototype.any=function(a){this.key=-1;return a(this.value)};jb.prototype.all=function(a){this.key=-1;return a(this.value)};jb.prototype.each=function(a){this.key=-1;a(this.value);return this};jb.prototype.map=function(a){return new jb(a(this.value))};
jb.prototype.filter=function(a){return a(this.value)?new jb(this.value):ib};jb.prototype.Td=function(){this.value=null};jb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};na.Object.defineProperties(jb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.sd;jb.prototype.next=jb.prototype.next;
jb.prototype.reset=jb.prototype.reset;jb.className="SingletonIterator";function kb(a){this.tb=a;this.gf=null;a.Ha=null;this.ia=a.Aa;this.Pa=-1}kb.prototype.reset=function(){var a=this.tb;a.Ha=null;this.ia=a.Aa;this.Pa=-1};kb.prototype.next=function(){var a=this.tb;if(a.Aa!==this.ia&&0>this.key)return!1;a=a.j;var b=a.length,c=++this.Pa,d=this.gf;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Pa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Td()}return!1};
kb.prototype.sd=function(){return this.next()};kb.prototype.first=function(){var a=this.tb;this.ia=a.Aa;this.Pa=0;a=a.j;var b=a.length,c=this.gf;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Pa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};kb.prototype.any=function(a){var b=this.tb;b.Ha=null;this.Pa=-1;b=b.j;for(var c=b.length,d=this.gf,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&a(f))return!0}return!1};
kb.prototype.all=function(a){var b=this.tb;b.Ha=null;this.Pa=-1;b=b.j;for(var c=b.length,d=this.gf,e=0;e<c;e++){var f=b[e];if((null===d||d(f))&&!a(f))return!1}return!0};kb.prototype.each=function(a){var b=this.tb;b.Ha=null;this.Pa=-1;b=b.j;for(var c=b.length,d=this.gf,e=0;e<c;e++){var f=b[e];(null===d||d(f))&&a(f)}return this};
kb.prototype.map=function(a){var b=this.tb;b.Ha=null;this.Pa=-1;var c=[];b=b.j;for(var d=b.length,e=this.gf,f=0;f<d;f++){var g=b[f];(null===e||e(g))&&c.push(a(g))}a=new E;a.j=c;a.ob();return a.iterator};kb.prototype.filter=function(a){var b=this.tb;b.Ha=null;this.Pa=-1;var c=[];b=b.j;for(var d=b.length,e=this.gf,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.ob();return a.iterator};
kb.prototype.Td=function(){this.key=-1;this.value=null;this.ia=-1;this.gf=null;this.tb.Ha=this};kb.prototype.toString=function(){return"ListIterator@"+this.Pa+"/"+this.tb.count};
na.Object.defineProperties(kb.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.gf},set:function(a){this.gf=a}},count:{get:function(){var a=this.gf;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}}});kb.prototype.first=kb.prototype.first;kb.prototype.hasNext=kb.prototype.sd;kb.prototype.next=kb.prototype.next;
kb.prototype.reset=kb.prototype.reset;kb.className="ListIterator";function lb(a){this.tb=a;a.gh=null;this.ia=a.Aa;this.Pa=a.j.length}lb.prototype.reset=function(){var a=this.tb;a.gh=null;this.ia=a.Aa;this.Pa=a.j.length};lb.prototype.next=function(){var a=this.tb;if(a.Aa!==this.ia&&0>this.key)return!1;var b=--this.Pa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Td();return!1};lb.prototype.sd=function(){return this.next()};
lb.prototype.first=function(){var a=this.tb;this.ia=a.Aa;var b=a.j;this.Pa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};lb.prototype.any=function(a){var b=this.tb;b.gh=null;b=b.j;var c=b.length;this.Pa=c;for(--c;0<=c;c--)if(a(b[c]))return!0;return!1};lb.prototype.all=function(a){var b=this.tb;b.gh=null;b=b.j;var c=b.length;this.Pa=c;for(--c;0<=c;c--)if(!a(b[c]))return!1;return!0};
lb.prototype.each=function(a){var b=this.tb;b.gh=null;b=b.j;var c=b.length;this.Pa=c;for(--c;0<=c;c--)a(b[c]);return this};lb.prototype.map=function(a){var b=this.tb;b.gh=null;var c=[];b=b.j;var d=b.length;this.Pa=d;for(--d;0<=d;d--)c.push(a(b[d]));a=new E;a.j=c;a.ob();return a.iterator};lb.prototype.filter=function(a){var b=this.tb;b.gh=null;var c=[];b=b.j;var d=b.length;this.Pa=d;for(--d;0<=d;d--){var e=b[d];a(e)&&c.push(e)}a=new E;a.j=c;a.ob();return a.iterator};
lb.prototype.Td=function(){this.key=-1;this.value=null;this.ia=-1;this.tb.gh=this};lb.prototype.toString=function(){return"ListIteratorBackwards("+this.Pa+"/"+this.tb.count+")"};na.Object.defineProperties(lb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.tb.j.length}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.sd;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset;
lb.className="ListIteratorBackwards";function E(a){Za(this);this.v=!1;this.j=[];this.Aa=0;this.gh=this.Ha=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=E.prototype;t.ob=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"List()#"+mb(this)};t.add=function(a){if(null===a)return this;this.v&&va(this,a);this.j.push(a);this.ob();return this};
t.push=function(a){this.add(a)};t.addAll=function(a){if(null===a)return this;this.v&&va(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.ob();return this};t.clear=function(){this.v&&va(this);this.j.length=0;this.ob()};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.J=function(a){var b=this.j;(0>a||a>=b.length)&&wa(a,"0 <= i < length",E,"elt:i");return b[a]};t.get=function(a){return this.J(a)};t.Rc=function(a,b){var c=this.j;(0>a||a>=c.length)&&wa(a,"0 <= i < length",E,"setElt:i");this.v&&va(this,a);c[a]=b};t.set=function(a,b){this.Rc(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.v&&va(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.ob();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.ob();return b};t=E.prototype;t.wb=function(a,b){0>a&&wa(a,">= 0",E,"insertAt:i");this.v&&va(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.ob()};t.remove=function(a){if(null===a)return!1;this.v&&va(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.ob();return!0};t.delete=function(a){return this.remove(a)};
t.cb=function(a){var b=this.j;(0>a||a>=b.length)&&wa(a,"0 <= i < length",E,"removeAt:i");this.v&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.ob()};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&&va(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.ob();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.Mw=function(){for(var a=new G,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){this.v&&va(this);this.j.sort(a);this.ob();return this};
t.uj=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.v&&va(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&wa(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.ob()),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.ob();return this};
t.reverse=function(){this.v&&va(this);this.j.reverse();this.ob();return this};
na.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 ib;var a=this.Ha;return null!==a?(a.reset(),a):new kb(this)}},iteratorBackwards:{
get:function(){if(0>=this.j.length)return ib;var a=this.gh;return null!==a?(a.reset(),a):new lb(this)}}});E.prototype.reverse=E.prototype.reverse;E.prototype.sortRange=E.prototype.uj;E.prototype.sort=E.prototype.sort;E.prototype.toSet=E.prototype.Mw;E.prototype.toArray=E.prototype.ma;E.prototype.removeRange=E.prototype.removeRange;E.prototype.removeAt=E.prototype.cb;E.prototype["delete"]=E.prototype.delete;E.prototype.remove=E.prototype.remove;E.prototype.insertAt=E.prototype.wb;
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.Rc;E.prototype.get=E.prototype.get;E.prototype.elt=E.prototype.J;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 nb(a){this.vg=a;a.Ha=null;this.ia=a.Aa;this.ka=null}nb.prototype.reset=function(){var a=this.vg;a.Ha=null;this.ia=a.Aa;this.ka=null};nb.prototype.next=function(){var a=this.vg;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};nb.prototype.sd=function(){return this.next()};
nb.prototype.first=function(){var a=this.vg;this.ia=a.Aa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};nb.prototype.any=function(a){var b=this.vg;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};nb.prototype.all=function(a){var b=this.vg;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};nb.prototype.each=function(a){var b=this.vg;this.ka=b.Ha=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
nb.prototype.map=function(a){var b=this.vg;b.Ha=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};nb.prototype.filter=function(a){var b=this.vg;b.Ha=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};nb.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.vg.Ha=this};nb.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"};
na.Object.defineProperties(nb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.vg.Gb}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.sd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="SetIterator";
function G(a){Za(this);this.v=!1;this.Ib={};this.Gb=0;this.Ha=null;this.Aa=0;this.af=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=G.prototype;t.ob=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Set()#"+mb(this)};
t.add=function(a){if(null===a)return this;this.v&&va(this,a);var b=a;za(a)&&(b=ob(a));void 0===this.Ib[b]&&(this.Gb++,a=new pb(a,a),this.Ib[b]=a,b=this.af,null===b?this.ba=a:(a.Yl=b,b.oa=a),this.af=a,this.ob());return this};t.addAll=function(a){if(null===a)return this;this.v&&va(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=mb(a),void 0===b)?!1:void 0!==this.Ib[b]};t.has=function(a){return this.contains(a)};t.Ez=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Fz=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};
G.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};G.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};G.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b.value),b=b.oa;return this};G.prototype.map=function(a){for(var b=new G,c=this.ba;null!==c;)b.add(a(c.value)),c=c.oa;return b};G.prototype.filter=function(a){for(var b=new G,c=this.ba;null!==c;){var d=c.value;a(d)&&b.add(d);c=c.oa}return b};t=G.prototype;
t.remove=function(a){if(null===a)return!1;this.v&&va(this,a);var b=a;if(za(a)&&(b=mb(a),void 0===b))return!1;a=this.Ib[b];if(void 0===a)return!1;var c=a.oa,d=a.Yl;null!==c&&(c.Yl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.af===a&&(this.af=d);delete this.Ib[b];this.Gb--;this.ob();return!0};t.delete=function(a){return this.remove(a)};
t.Zq=function(a){if(null===a)return this;this.v&&va(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.WA=function(a){if(null===a||0===this.count)return this;this.v&&va(this);var b=new G;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Zq(a);return this};t.clear=function(){this.v&&va(this);this.Ib={};this.Gb=0;null!==this.Ha&&this.Ha.reset();this.af=this.ba=null;this.ob()};
G.prototype.copy=function(){var a=new G,b=this.Ib,c;for(c in b)a.add(b[c].value);return a};G.prototype.ma=function(){var a=Array(this.Gb),b=this.Ib,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};G.prototype.Lw=function(){var a=new E,b=this.Ib,c;for(c in b)a.add(b[c].value);return a};function Za(a){a.__gohashid=qb++}function ob(a){var b=a.__gohashid;void 0===b&&(b=qb++,a.__gohashid=b);return b}function mb(a){return a.__gohashid}
na.Object.defineProperties(G.prototype,{count:{get:function(){return this.Gb}},size:{get:function(){return this.Gb}},iterator:{get:function(){if(0>=this.Gb)return ib;var a=this.Ha;return null!==a?(a.reset(),a):new nb(this)}}});G.prototype.toList=G.prototype.Lw;G.prototype.toArray=G.prototype.ma;G.prototype.clear=G.prototype.clear;G.prototype.retainAll=G.prototype.WA;G.prototype.removeAll=G.prototype.Zq;
G.prototype["delete"]=G.prototype.delete;G.prototype.remove=G.prototype.remove;G.prototype.first=G.prototype.first;G.prototype.containsAny=G.prototype.Fz;G.prototype.containsAll=G.prototype.Ez;G.prototype.has=G.prototype.has;G.prototype.contains=G.prototype.contains;G.prototype.addAll=G.prototype.addAll;G.prototype.add=G.prototype.add;G.prototype.thaw=G.prototype.ea;G.prototype.freeze=G.prototype.freeze;var qb=1;G.className="Set";G.uniqueHash=Za;G.hashIdUnique=ob;G.hashId=mb;
function rb(a){this.ga=a;this.ia=a.Aa;this.ka=null}rb.prototype.reset=function(){this.ia=this.ga.Aa;this.ka=null};rb.prototype.next=function(){var a=this.ga;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=this.key=a=b.key,!0;this.Td();return!1};rb.prototype.sd=function(){return this.next()};rb.prototype.first=function(){var a=this.ga;this.ia=a.Aa;a=a.ba;return null!==a?(this.ka=a,this.value=this.key=a=a.key):null};
rb.prototype.any=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};rb.prototype.all=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};rb.prototype.each=function(a){var b=this.ga;this.ka=null;for(b=b.ba;null!==b;)a(b.key),b=b.oa;return this};rb.prototype.map=function(a){var b=this.ga;this.ka=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.key)),b=b.oa;return c.iterator};
rb.prototype.filter=function(a){var b=this.ga;this.ka=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};rb.prototype.Td=function(){this.value=this.key=null;this.ia=-1};rb.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"};na.Object.defineProperties(rb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Gb}}});
rb.prototype.first=rb.prototype.first;rb.prototype.hasNext=rb.prototype.sd;rb.prototype.next=rb.prototype.next;rb.prototype.reset=rb.prototype.reset;rb.className="MapKeySetIterator";function sb(a){G.call(this);Za(this);this.v=!0;this.ga=a}ma(sb,G);t=sb.prototype;t.freeze=function(){return this};t.ea=function(){return this};t.toString=function(){return"MapKeySet("+this.ga.toString()+")"};t.add=function(){B("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.ga.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.ga.ba;return null!==a?a.key:null};sb.prototype.any=function(a){for(var b=this.ga.ba;null!==b;){if(a(b.key))return!0;b=b.oa}return!1};sb.prototype.all=function(a){for(var b=this.ga.ba;null!==b;){if(!a(b.key))return!1;b=b.oa}return!0};
sb.prototype.each=function(a){for(var b=this.ga.ba;null!==b;)a(b.key),b=b.oa;return this};sb.prototype.map=function(a){for(var b=new G,c=this.ga.ba;null!==c;)b.add(a(c.key)),c=c.oa;return b};sb.prototype.filter=function(a){for(var b=new G,c=this.ga.ba;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.oa}return b};sb.prototype.copy=function(){return new sb(this.ga)};sb.prototype.Mw=function(){var a=new G,b=this.ga.Ib,c;for(c in b)a.add(b[c].key);return a};
sb.prototype.ma=function(){var a=this.ga.Ib,b=Array(this.ga.Gb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};sb.prototype.Lw=function(){var a=new E,b=this.ga.Ib,c;for(c in b)a.add(b[c].key);return a};na.Object.defineProperties(sb.prototype,{count:{get:function(){return this.ga.Gb}},size:{get:function(){return this.ga.Gb}},iterator:{get:function(){return 0>=this.ga.Gb?ib:new rb(this.ga)}}});
sb.prototype.toList=sb.prototype.Lw;sb.prototype.toArray=sb.prototype.ma;sb.prototype.toSet=sb.prototype.Mw;sb.prototype.first=sb.prototype.first;sb.prototype.clear=sb.prototype.clear;sb.prototype["delete"]=sb.prototype.delete;sb.prototype.remove=sb.prototype.remove;sb.prototype.has=sb.prototype.has;sb.prototype.contains=sb.prototype.contains;sb.prototype.add=sb.prototype.add;sb.prototype.thaw=sb.prototype.ea;sb.prototype.freeze=sb.prototype.freeze;sb.className="MapKeySet";
function tb(a){this.ga=a;a.$e=null;this.ia=a.Aa;this.ka=null}tb.prototype.reset=function(){var a=this.ga;a.$e=null;this.ia=a.Aa;this.ka=null};tb.prototype.next=function(){var a=this.ga;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.value=b.value,this.key=b.key,!0;this.Td();return!1};tb.prototype.sd=function(){return this.next()};
tb.prototype.first=function(){var a=this.ga;this.ia=a.Aa;a=a.ba;if(null!==a){this.ka=a;var b=a.value;this.key=a.key;return this.value=b}return null};tb.prototype.any=function(a){var b=this.ga;this.ka=b.$e=null;for(b=b.ba;null!==b;){if(a(b.value))return!0;b=b.oa}return!1};tb.prototype.all=function(a){var b=this.ga;this.ka=b.$e=null;for(b=b.ba;null!==b;){if(!a(b.value))return!1;b=b.oa}return!0};tb.prototype.each=function(a){var b=this.ga;this.ka=b.$e=null;for(b=b.ba;null!==b;)a(b.value),b=b.oa;return this};
tb.prototype.map=function(a){var b=this.ga;this.ka=b.$e=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b.value)),b=b.oa;return c.iterator};tb.prototype.filter=function(a){var b=this.ga;this.ka=b.$e=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};tb.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.ga.$e=this};tb.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"};
na.Object.defineProperties(tb.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Gb}}});tb.prototype.first=tb.prototype.first;tb.prototype.hasNext=tb.prototype.sd;tb.prototype.next=tb.prototype.next;tb.prototype.reset=tb.prototype.reset;tb.className="MapValueSetIterator";function pb(a,b){this.key=a;this.value=b;this.Yl=this.oa=null}pb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
pb.className="KeyValuePair";function ub(a){this.ga=a;a.Ha=null;this.ia=a.Aa;this.ka=null}ub.prototype.reset=function(){var a=this.ga;a.Ha=null;this.ia=a.Aa;this.ka=null};ub.prototype.next=function(){var a=this.ga;if(a.Aa!==this.ia&&null===this.key)return!1;var b=this.ka;b=null===b?a.ba:b.oa;if(null!==b)return this.ka=b,this.key=b.key,this.value=b.value,!0;this.Td();return!1};ub.prototype.sd=function(){return this.next()};
ub.prototype.first=function(){var a=this.ga;this.ia=a.Aa;a=a.ba;return null!==a?(this.ka=a,this.key=a.key,this.value=a.value,a):null};ub.prototype.any=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};ub.prototype.all=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};ub.prototype.each=function(a){var b=this.ga;this.ka=b.Ha=null;for(b=b.ba;null!==b;)a(b),b=b.oa;return this};
ub.prototype.map=function(a){var b=this.ga;this.ka=b.Ha=null;var c=new E;for(b=b.ba;null!==b;)c.add(a(b)),b=b.oa;return c.iterator};ub.prototype.filter=function(a){var b=this.ga;this.ka=b.Ha=null;var c=new E;for(b=b.ba;null!==b;)a(b)&&c.add(b),b=b.oa;return c.iterator};ub.prototype.Td=function(){this.value=this.key=null;this.ia=-1;this.ga.Ha=this};ub.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"};
na.Object.defineProperties(ub.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Gb}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.sd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapIterator";
function H(a){Za(this);this.v=!1;this.Ib={};this.Gb=0;this.$e=this.Ha=null;this.Aa=0;this.af=this.ba=null;void 0!==a&&("function"===typeof a||"string"===typeof a?ya():this.addAll(a))}t=H.prototype;t.ob=function(){var a=this.Aa;a++;999999999<a&&(a=0);this.Aa=a};t.freeze=function(){this.v=!0;return this};t.ea=function(){this.v=!1;return this};t.toString=function(){return"Map()#"+mb(this)};
t.add=function(a,b){this.v&&va(this,a);var c=a;za(a)&&(c=ob(a));var d=this.Ib[c];void 0===d?(this.Gb++,a=new pb(a,b),this.Ib[c]=a,c=this.af,null===c?this.ba=a:(a.Yl=c,c.oa=a),this.af=a,this.ob()):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 H)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};H.prototype.any=function(a){for(var b=this.ba;null!==b;){if(a(b))return!0;b=b.oa}return!1};H.prototype.all=function(a){for(var b=this.ba;null!==b;){if(!a(b))return!1;b=b.oa}return!0};
H.prototype.each=function(a){for(var b=this.ba;null!==b;)a(b),b=b.oa;return this};H.prototype.map=function(a){for(var b=new H,c=this.ba;null!==c;)b.add(c.key,a(c)),c=c.oa;return b};H.prototype.filter=function(a){for(var b=new H,c=this.ba;null!==c;)a(c)&&b.add(c.key,c.value),c=c.oa;return b};t=H.prototype;t.contains=function(a){var b=a;return za(a)&&(b=mb(a),void 0===b)?!1:void 0!==this.Ib[b]};t.has=function(a){return this.contains(a)};
t.G=function(a){var b=a;if(za(a)&&(b=mb(a),void 0===b))return null;a=this.Ib[b];return void 0===a?null:a.value};t.get=function(a){return this.G(a)};t.remove=function(a){if(null===a)return!1;this.v&&va(this,a);var b=a;if(za(a)&&(b=mb(a),void 0===b))return!1;a=this.Ib[b];if(void 0===a)return!1;var c=a.oa,d=a.Yl;null!==c&&(c.Yl=d);null!==d&&(d.oa=c);this.ba===a&&(this.ba=c);this.af===a&&(this.af=d);delete this.Ib[b];this.Gb--;this.ob();return!0};t.delete=function(a){return this.remove(a)};
t.clear=function(){this.v&&va(this);this.Ib={};this.Gb=0;null!==this.Ha&&this.Ha.reset();null!==this.$e&&this.$e.reset();this.af=this.ba=null;this.ob()};H.prototype.copy=function(){var a=new H,b=this.Ib,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};H.prototype.ma=function(){var a=this.Ib,b=Array(this.Gb),c=0,d;for(d in a){var e=a[d];b[c]=new pb(e.key,e.value);c++}return b};H.prototype.Mf=function(){return new sb(this)};
na.Object.defineProperties(H.prototype,{count:{get:function(){return this.Gb}},size:{get:function(){return this.Gb}},iterator:{get:function(){if(0>=this.count)return ib;var a=this.Ha;return null!==a?(a.reset(),a):new ub(this)}},iteratorKeys:{get:function(){return 0>=this.count?ib:new rb(this)}},iteratorValues:{get:function(){if(0>=this.count)return ib;
var a=this.$e;return null!==a?(a.reset(),a):new tb(this)}}});H.prototype.toKeySet=H.prototype.Mf;H.prototype.toArray=H.prototype.ma;H.prototype.clear=H.prototype.clear;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.get=H.prototype.get;H.prototype.getValue=H.prototype.G;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.first=H.prototype.first;H.prototype.addAll=H.prototype.addAll;H.prototype.set=H.prototype.set;
H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ea;H.prototype.freeze=H.prototype.freeze;H.className="Map";function J(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.v=!1}J.prototype.assign=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.h=function(a,b){this.x=a;this.y=b;return this};J.prototype.Jg=function(a,b){this.x=a;this.y=b;return this};
J.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};J.prototype.copy=function(){var a=new J;a.x=this.x;a.y=this.y;return a};t=J.prototype;t.ca=function(){this.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};
function vb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new J(c,e)}return new J}function wb(a){return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.w=function(a){return a instanceof J?this.x===a.x&&this.y===a.y:!1};t.fj=function(a,b){return this.x===a&&this.y===b};t.Na=function(a){return L.A(this.x,a.x)&&L.A(this.y,a.y)};
t.add=function(a){this.x+=a.x;this.y+=a.y;return this};t.ie=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};J.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=J.prototype;
t.scale=function(a,b){this.x*=a;this.y*=b;return this};t.Je=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};t.rd=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 xb(a.x-this.x,a.y-this.y)};t.direction=function(a,b){return xb(a-this.x,b-this.y)};
function xb(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.OA=function(a,b,c,d){L.Ph(a,b,c,d,this.x,this.y,this);return this};t.PA=function(a,b){L.Ph(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};t.aB=function(a,b,c,d){L.Dq(this.x,this.y,a,b,c,d,this);return this};t.bB=function(a,b){L.Dq(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};
t.tj=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.Uk=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.sa(this);return this};function yb(a,b){b.Kd(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 Ab(a,b,c,d){a=c-a;b=d-b;return a*a+b*b}
function Bb(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)};J.alloc=function(){var a=Cb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Cb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Cb.push(a)};J.prototype.isReal=J.prototype.o;
J.prototype.setSpot=J.prototype.Uk;J.prototype.setRectSpot=J.prototype.tj;J.prototype.snapToGridPoint=J.prototype.bB;J.prototype.snapToGrid=J.prototype.aB;J.prototype.projectOntoLineSegmentPoint=J.prototype.PA;J.prototype.projectOntoLineSegment=J.prototype.OA;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){return L.Lq(a,b,c,d,e,f,g,h)};J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Sa;J.prototype.normalize=J.prototype.normalize;
J.prototype.distanceSquared=J.prototype.rd;J.prototype.distanceSquaredPoint=J.prototype.Je;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.ie;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Na;J.prototype.equalTo=J.prototype.fj;J.prototype.equals=J.prototype.w;J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.Jg;var Fb=null,Gb=null,Hb=null,Ib=null,Jb=null,Cb=[];
J.className="Point";J.parse=vb;J.stringify=wb;J.distanceLineSegmentSquared=zb;J.distanceSquared=Ab;J.direction=Bb;J.Origin=Fb=(new J(0,0)).ca();J.InfiniteTopLeft=Gb=(new J(-Infinity,-Infinity)).ca();J.InfiniteBottomRight=Hb=(new J(Infinity,Infinity)).ca();J.SixPoint=Ib=(new J(6,6)).ca();J.NoPoint=Jb=(new J(NaN,NaN)).ca();J.parse=vb;J.stringify=wb;J.distanceLineSegmentSquared=zb;J.distanceSquared=Ab;J.direction=Bb;
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.v=!1}var Kb,Lb,Mb,Nb,Ob,Pb,Qb;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.Jg=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.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};
function Rb(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 Sb(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.fj=function(a,b){return this.width===a&&this.height===b};
t.Na=function(a){return L.A(this.width,a.width)&&L.A(this.height,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};M.alloc=function(){var a=Tb.pop();return void 0===a?new M:a};M.free=function(a){Tb.push(a)};M.prototype.isReal=M.prototype.o;M.prototype.equalsApprox=M.prototype.Na;M.prototype.equalTo=M.prototype.fj;M.prototype.equals=M.prototype.w;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Jg;var Tb=[];M.className="Size";M.parse=Rb;M.stringify=Sb;
M.ZeroSize=Kb=(new M(0,0)).ca();M.OneSize=Lb=(new M(1,1)).ca();M.SixSize=Mb=(new M(6,6)).ca();M.EightSize=Nb=(new M(8,8)).ca();M.TenSize=Ob=(new M(10,10)).ca();M.InfiniteSize=Pb=(new M(Infinity,Infinity)).ca();M.NoSize=Qb=(new M(NaN,NaN)).ca();M.parse=Rb;M.stringify=Sb;
function N(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof J?(c=a.x,a=a.y,b instanceof J?(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.v=!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 Ub(a,b,c){a.width=b;a.height=c}t.Jg=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.Sc=function(a){this.x=a.x;this.y=a.y;return this};t.$A=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.v=!0;Object.freeze(this);return this};t.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.v=!0;return this};
t.ea=function(){Object.isFrozen(this)&&B("cannot thaw constant: "+this);this.v=!1;return this};function Vb(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));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 Wb(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.fj=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};t.Na=function(a){return L.A(this.x,a.x)&&L.A(this.y,a.y)&&L.A(this.width,a.width)&&L.A(this.height,a.height)};
function $b(a,b){return L.aa(a.x,b.x)&&L.aa(a.y,b.y)&&L.aa(a.width,b.width)&&L.aa(a.height,b.height)}t.$=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};t.Ie=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.Lc=function(a,b){return ac(this,b,a,b,a)};t.rq=function(a){return ac(this,a.top,a.right,a.bottom,a.left)};t.Kw=function(a){return ac(this,-a.top,-a.right,-a.bottom,-a.left)};t.sA=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.Dy=function(a){return bc(this,a.x,a.y,a.width,a.height)};
t.aw=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.Oc=function(a){return this.bw(a.x,a.y,a.width,a.height)};
t.bw=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 cc(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.Pe=function(a){return gc(this,a.x,a.y,0,0)};t.Tc=function(a){return gc(this,a.x,a.y,a.width,a.height)};
t.Sw=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return gc(this,a,b,c,d)};function gc(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.Uk=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 hc(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 ic(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.yA=function(){return 0===this.width&&0===this.height};N.alloc=function(){var a=jc.pop();return void 0===a?new N:a};N.allocAt=function(a,b,c,d){var e=jc.pop();return void 0===e?new N(a,b,c,d):e.h(a,b,c,d)};N.free=function(a){jc.push(a)};
na.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 J(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 J(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.yA;N.prototype.isReal=N.prototype.o;N.intersectsLineSegment=function(a,b,c,d,e,f,g,h){return L.Ey(a,b,c,d,e,f,g,h)};N.prototype.setSpot=N.prototype.Uk;N.prototype.union=N.prototype.Sw;N.prototype.unionRect=N.prototype.Tc;N.prototype.unionPoint=N.prototype.Pe;N.prototype.intersects=N.prototype.bw;
N.prototype.intersectsRect=N.prototype.Oc;N.prototype.intersect=N.prototype.aw;N.prototype.intersectRect=N.prototype.Dy;N.prototype.grow=N.prototype.sA;N.prototype.subtractMargin=N.prototype.Kw;N.prototype.addMargin=N.prototype.rq;N.prototype.inflate=N.prototype.Lc;N.prototype.offset=N.prototype.offset;N.prototype.contains=N.prototype.contains;N.prototype.containsRect=N.prototype.Ie;N.prototype.containsPoint=N.prototype.$;N.prototype.equalsApprox=N.prototype.Na;N.prototype.equalTo=N.prototype.fj;
N.prototype.equals=N.prototype.w;N.prototype.setSize=N.prototype.$A;N.prototype.setPoint=N.prototype.Sc;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Jg;var kc=null,lc=null,jc=[];N.className="Rect";N.parse=Vb;N.stringify=Wb;N.contains=hc;N.intersects=ic;N.ZeroRect=kc=(new N(0,0,0,0)).ca();N.NoRect=lc=(new N(NaN,NaN,NaN,NaN)).ca();N.parse=Vb;N.stringify=Wb;N.contains=hc;N.intersects=ic;
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.v=!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.Jg=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.botto