UNPKG

gojs

Version:

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

8 lines 1.01 MB
/* * GoJS v3.0.21 JavaScript Library for HTML Diagrams, https://gojs.net * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://nwoods.com. * Copyright 1998-2025 by Northwoods Software Corporation. All Rights Reserved. * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/3.0.21/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() {const root=typeof globalThis=="object"&&globalThis||typeof global=="object"&&global.global===global&&global||typeof self=="object"&&self.self===self&&self||{};root.requestAnimationFrame===void 0&&(root.setImmediate===void 0?root.requestAnimationFrame=w=>root.setTimeout(w,0):root.requestAnimationFrame=root.setImmediate);class U{static _o=root.navigator!==void 0&&root.navigator.platform!==void 0&&root.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null;static Fk(t,i,e){let s=-1;return function(){const n=this,o=arguments;s!==-1&&U.Tg(s),s=U.tr(()=>{s=-1,e||t.apply(n,o)},i),e&&!s&&t.apply(n,o)}}static tr(t,i){return root.setTimeout(t,i)}static Tg(t){root.clearTimeout(t)}static hs(t){return root.document.createElement(t)}static o(t){throw new Error(t)}static L(t,i){let e="The object is frozen, so its properties cannot be set: "+t.toString();i!==void 0&&(e+=" to value: "+i),U.o(e)}static uE(t,i,e,s){}static s(t,i,e,s){}static dE(t,i,e){}static ec(t,i,e){if(t===null||typeof t!="object"){let s=U.fC(i);e!==void 0&&(s+="."+e),U.Zi(t,"object",s)}}static k(t,i,e){U.s(t,"function",i,e)}static gE(t,i,e){}static Zi(t,i,e,s){}static W(t,i,e,s){let n=U.fC(e);s!==void 0&&(n+="."+s),U.o(n+" is not in the range "+i+": "+t)}static Re(t){}static ir(t,i){}static ni(t){root.console&&root.console.log(t)}static K(t){return t!==null&&typeof t=="object"}static it(t){return typeof t=="function"}static Rk=[];static et(){const t=U.Rk.pop();return t===void 0?[]:t}static J(t){t.length=0,U.Rk.push(t)}static mE=Object.freeze([]);static fC(t){return t===null?"*":typeof t=="string"?t:U.it(t)?t.name:""}static Dn(t){return U.it(t)?t.className?t.className:t.name:U.K(t)&&t.constructor?U.Dn(t.constructor):typeof t}static Eh(t,i){return i==null||i===""?null:U.K(t)&&i in t||t[i]?t[i]:null}static toString(t){let i=t;return U.K(t)&&(t.text?i=t.text:t.name?i=t.name:t.key!==void 0?i=t.key:t.id!==void 0?i=t.id:t.constructor===Object&&(t.Text?i=t.Text:t.Name?i=t.Name:t.Key!==void 0?i=t.Key:t.Id!==void 0?i=t.Id:t.ID!==void 0&&(i=t.ID))),i===void 0?"undefined":i===null?"null":i.toString()}static uw(t,i){if(t.hasOwnProperty(i))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Function;){if(e.hasOwnProperty(i))return!0;const s=e.pE;if(s&&s[i])return!0;e=Object.getPrototypeOf(e)}return!1}static qD(t){const i=[];let e=0;for(e=0;e<256;e++)i[e]=e;let s=0,n=0;for(e=0;e<256;e++)s=(s+i[e]+119)%256,n=i[e],i[e]=i[s],i[s]=n;e=0,s=0;let o="";for(let r=0;r<t.length;r++)e=(e+1)%256,s=(s+i[e])%256,n=i[e],i[e]=i[s],i[s]=n,o+=String.fromCharCode(t.charCodeAt(r)^i[(i[e]+i[s])%256]);return o}static WD(t){const i="0123456789abcdef",e=[];for(let r=0;r<256;r++)e[i.charAt(r>>4)+i.charAt(r&15)]=String.fromCharCode(r);t.length%2&&(t="0"+t);const s=[];let n=0;for(let r=0;r<t.length;r+=2)s[n++]=e[t.substring(r,r+2)];const o=s.join("");return o===""?"0":o}static Ts(t){return U.qD(U.WD(t))}static color1="@COLOR1";static color2="@COLOR2";static dw="32ab5ff3b26f42dc0ed90f21412913b5"}U.vfo="29e646fdb167";class StringBuilder{vk;constructor(){this.vk=[]}toString(){return this.vk.join("")}add(t){t!==""&&this.vk.push(t)}}class PropertyCollection{}class EmptyIterator{g;constructor(){this.g=[]}[Symbol.iterator](){return this.g.values()}key;value;get iterator(){return this}reset(){}next(){return!1}hasNext(){return!1}first(){return null}any(){return!1}all(){return!0}each(){return this}map(t){return this}filter(){return this}get count(){return 0}fl(){}toString(){return"EmptyIterator"}static instance=new EmptyIterator}class SingletonIterator{constructor(t){this.key=-1,this.value=t}[Symbol.iterator](){return[this.value].values()}key;value;get iterator(){return this}reset(){this.key=-1}next(){return this.key===-1?(this.key=0,!0):!1}hasNext(){return this.next()}first(){return this.key=0,this.value}any(t){return this.key=-1,t(this.value)}all(t){return this.key=-1,t(this.value)}each(t){return this.key=-1,t(this.value),this}map(t){return new SingletonIterator(t(this.value))}filter(t){return t(this.value)?new SingletonIterator(this.value):EmptyIterator.instance}get count(){return 1}fl(){this.value=null}toString(){return"SingletonIterator("+this.value+")"}}class ListIterator{qt;Ds;Kt;At;constructor(t){this.qt=t,this.Ds=null,t.er=null,this.Kt=t.nt,this.At=-1}[Symbol.iterator](){return this.Ds===null?this.qt.r.values():this.qt.r.filter(this.Ds).values()}key;value;get iterator(){return this}get predicate(){return this.Ds}set predicate(t){this.Ds=t}reset(){const t=this.qt;t.er=null,this.Kt=t.nt,this.At=-1}next(){const t=this.qt;if(t.nt!==this.Kt){if(this.key<0)return!1;U.Re(t)}const i=t.r,e=i.length;let s=++this.At;const n=this.Ds;if(n!==null)for(;s<e;){const o=i[s];if(n(o))return this.At=s,this.key=s,this.value=o,!0;s++}else{if(s<e)return this.key=s,this.value=i[s],!0;this.fl()}return!1}hasNext(){return this.next()}first(){const t=this.qt;this.Kt=t.nt,this.At=0;const i=t.r,e=i.length,s=this.Ds;if(s!==null){let n=0;for(;n<e;){const o=i[n];if(s(o))return this.At=n,this.key=n,this.value=o,o;n++}return null}else if(e>0){const n=i[0];return this.key=0,this.value=n,n}else return null}any(t){const i=this.qt;i.er=null;const e=i.nt;this.At=-1;const s=i.r,n=s.length,o=this.Ds;for(let r=0;r<n;r++){const l=s[r];if(!(o!==null&&!o(l))){if(t(l))return!0;i.nt!==e&&U.Re(i)}}return!1}all(t){const i=this.qt;i.er=null;const e=i.nt;this.At=-1;const s=i.r,n=s.length,o=this.Ds;for(let r=0;r<n;r++){const l=s[r];if(!(o!==null&&!o(l))){if(!t(l))return!1;i.nt!==e&&U.Re(i)}}return!0}each(t){const i=this.qt;i.er=null;const e=i.nt;this.At=-1;const s=i.r,n=s.length,o=this.Ds;for(let r=0;r<n;r++){const l=s[r];o!==null&&!o(l)||(t(l),i.nt!==e&&U.Re(i))}return this}map(t){const i=this.qt;i.er=null;const e=i.nt;this.At=-1;const s=[],n=i.r,o=n.length,r=this.Ds;for(let h=0;h<o;h++){const c=n[h];r!==null&&!r(c)||(s.push(t(c)),i.nt!==e&&U.Re(i))}const l=new List;return l.r=s,l.ve(),l.iterator}filter(t){const i=this.qt;i.er=null;const e=i.nt;this.At=-1;const s=[],n=i.r,o=n.length,r=this.Ds;for(let h=0;h<o;h++){const c=n[h];r!==null&&!r(c)||(t(c)&&s.push(c),i.nt!==e&&U.Re(i))}const l=new List;return l.r=s,l.ve(),l.iterator}get count(){const t=this.Ds;if(t!==null){let i=0;const e=this.qt.r,s=e.length;for(let n=0;n<s;n++)t(e[n])&&i++;return i}else return this.qt.r.length}fl(){this.key=-1,this.value=null,this.Kt=-1,this.Ds=null,this.qt.er=this}toString(){return"ListIterator@"+this.At+"/"+this.qt.count}}class ListIteratorBackwards{qt;Kt;At;constructor(t){this.qt=t,t.sr=null,this.Kt=t.nt,this.At=t.r.length}[Symbol.iterator](){return this.qt.r.reverse().values()}key;value;get iterator(){return this}reset(){const t=this.qt;t.sr=null,this.Kt=t.nt,this.At=t.r.length}next(){const t=this.qt;if(t.nt!==this.Kt){if(this.key<0)return!1;U.Re(t)}const i=--this.At;return i>=0?(this.key=i,this.value=t.r[i],!0):(this.fl(),!1)}hasNext(){return this.next()}first(){const t=this.qt;this.Kt=t.nt;const i=t.r,e=i.length-1;if(this.At=e,e>=0){const s=i[e];return this.key=e,this.value=s,s}else return null}any(t){const i=this.qt;i.sr=null;const e=i.nt,s=i.r,n=s.length;this.At=n;for(let o=n-1;o>=0;o--){const r=s[o];if(t(r))return!0;i.nt!==e&&U.Re(i)}return!1}all(t){const i=this.qt;i.sr=null;const e=i.nt,s=i.r,n=s.length;this.At=n;for(let o=n-1;o>=0;o--){const r=s[o];if(!t(r))return!1;i.nt!==e&&U.Re(i)}return!0}each(t){const i=this.qt;i.sr=null;const e=i.nt,s=i.r,n=s.length;this.At=n;for(let o=n-1;o>=0;o--){const r=s[o];t(r),i.nt!==e&&U.Re(i)}return this}map(t){const i=this.qt;i.sr=null;const e=i.nt,s=[],n=i.r,o=n.length;this.At=o;for(let l=o-1;l>=0;l--){const h=n[l];s.push(t(h)),i.nt!==e&&U.Re(i)}const r=new List;return r.r=s,r.ve(),r.iterator}filter(t){const i=this.qt;i.sr=null;const e=i.nt,s=[],n=i.r,o=n.length;this.At=o;for(let l=o-1;l>=0;l--){const h=n[l];t(h)&&s.push(h),i.nt!==e&&U.Re(i)}const r=new List;return r.r=s,r.ve(),r.iterator}get count(){return this.qt.r.length}fl(){this.key=-1,this.value=null,this.Kt=-1,this.qt.sr=this}toString(){return"ListIteratorBackwards("+this.At+"/"+this.qt.count+")"}}class List{h;r;nt;er;sr;constructor(t){GSet.Gi(this),this.h=!1,this.r=[],this.nt=0,this.er=null,this.sr=null,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.r.values()}ve(){let t=this.nt;t++,t>999999999&&(t=0),this.nt=t}u(){return this.h=!0,this}Nt(){return this.h=!1,this}toString(){return"List()#"+GSet.as(this)}add(t){return this.h&&U.L(this,t),this.r.push(t),this.ve(),this}push(t){this.add(t)}addAll(t){if(t===null)return this;this.h&&U.L(this);const i=this.r;if(Array.isArray(t)){const e=t.length;for(let s=0;s<e;s++){const n=t[s];i.push(n)}}else{const e=t.iterator;for(;e.next();){const s=e.value;i.push(s)}}return this.ve(),this}clear(){this.h&&U.L(this),this.r.length=0,this.ve()}contains(t){return this.has(t)}has(t){return t===null?!1:this.r.indexOf(t)!==-1}indexOf(t){return t===null?-1:this.r.indexOf(t)}elt(t){const i=this.r;return(t<0||t>=i.length)&&U.W(t,"0 <= i < length",List,"elt:i"),i[t]}get(t){return this.elt(t)}setElt(t,i){const e=this.r;(t<0||t>=e.length)&&U.W(t,"0 <= i < length",List,"setElt:i"),this.h&&U.L(this,t),e[t]=i}set(t,i){this.setElt(t,i)}first(){const t=this.r;return t.length===0?null:t[0]}last(){const t=this.r,i=t.length;return i>0?t[i-1]:null}pop(){this.h&&U.L(this);const t=this.r;return t.length>0?t.pop():null}any(t){const i=this.r,e=this.nt,s=i.length;for(let n=0;n<s;n++){if(t(i[n]))return!0;this.nt!==e&&U.Re(this)}return!1}all(t){const i=this.r,e=this.nt,s=i.length;for(let n=0;n<s;n++){if(!t(i[n]))return!1;this.nt!==e&&U.Re(this)}return!0}each(t){const i=this.r,e=this.nt,s=i.length;for(let n=0;n<s;n++)t(i[n]),this.nt!==e&&U.Re(this);return this}map(t){const i=new List,e=[],s=this.r,n=this.nt,o=s.length;for(let r=0;r<o;r++)e.push(t(s[r])),this.nt!==n&&U.Re(this);return i.r=e,i.ve(),i}filter(t){const i=new List,e=[],s=this.r,n=this.nt,o=s.length;for(let r=0;r<o;r++){const l=s[r];t(l)&&e.push(l),this.nt!==n&&U.Re(this)}return i.r=e,i.ve(),i}insertAt(t,i){t<0&&U.W(t,">= 0",List,"insertAt:i"),this.h&&U.L(this,t);const e=this.r;t>=e.length?e.push(i):e.splice(t,0,i),this.ve()}remove(t){return this.delete(t)}delete(t){if(t===null)return!1;this.h&&U.L(this,t);const i=this.r,e=i.indexOf(t);return e===-1?!1:(e===i.length-1?i.pop():i.splice(e,1),this.ve(),!0)}removeAt(t){const i=this.r;(t<0||t>=i.length)&&U.W(t,"0 <= i < length",List,"removeAt:i"),this.h&&U.L(this,t),t===i.length-1?i.pop():i.splice(t,1),this.ve()}removeRange(t,i){const e=this.r,s=e.length;if(t<0)t=0;else if(t>=s)return this;if(i<0)return this;if(i>=s&&(i=s-1),t>i)return this;this.h&&U.L(this);let n=t,o=i+1;for(;o<s;)e[n++]=e[o++];return e.length=s-(i-t+1),this.ve(),this}copy(){const t=new List,i=this.r;return i.length>0&&(t.r=Array.prototype.slice.call(i)),t}toArray(){const t=this.r,i=this.count,e=new Array(i);for(let s=0;s<i;s++)e[s]=t[s];return e}get uC(){return this.r}toSet(){const t=new GSet,i=this.r,e=this.count;for(let s=0;s<e;s++)t.add(i[s]);return t}sort(t){return this.h&&U.L(this),this.r.sort(t),this.ve(),this}sortRange(t,i,e){const s=this.r,n=s.length;i===void 0&&(i=0),e===void 0&&(e=n),this.h&&U.L(this);const o=e-i;if(o<=1)return this;if((i<0||i>=n-1)&&U.W(i,"0 <= from < length",List,"sortRange:from"),o===2){const r=s[i],l=s[i+1];return t(r,l)>0&&(s[i]=l,s[i+1]=r,this.ve()),this}if(i===0)if(e>=n)s.sort(t);else{const r=s.slice(0,e);r.sort(t);for(let l=0;l<e;l++)s[l]=r[l]}else if(e>=n){const r=s.slice(i);r.sort(t);for(let l=i;l<n;l++)s[l]=r[l-i]}else{const r=s.slice(i,e);r.sort(t);for(let l=i;l<e;l++)s[l]=r[l-i]}return this.ve(),this}reverse(){return this.h&&U.L(this),this.r.reverse(),this.ve(),this}get count(){return this.r.length}get size(){return this.r.length}get length(){return this.r.length}get iterator(){if(this.r.length<=0)return EmptyIterator.instance;const t=this.er;return t!==null?(t.reset(),t):new ListIterator(this)}get iteratorBackwards(){if(this.r.length<=0)return EmptyIterator.instance;const t=this.sr;return t!==null?(t.reset(),t):new ListIteratorBackwards(this)}}class SetIterator{yo;ii;constructor(t){this.yo=t,this.ii=t.g.values()}[Symbol.iterator](){return this.yo.g.values()}key;value;get iterator(){return this}reset(){const t=this.yo;this.ii=t.g.values()}next(){const t=this.ii.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.yo.g.size===0?null:(this.ii=this.yo.g.values(),this.ii.next().value)}any(t){return this.yo.any(t)}all(t){return this.yo.all(t)}each(t){return this.yo.each(t),this}map(t){const i=new List;return this.yo.g.forEach(e=>i.add(t(e))),i.iterator}filter(t){const i=new List;return this.yo.g.forEach(e=>{t(e)&&i.add(e)}),i.iterator}get count(){return this.yo.count}fl(){this.key=null,this.value=null,this.ii=null}toString(){return"SetIterator"}}class GSet{h;g;constructor(t){this.h=!1,this.g=new Set,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.values()}values(){return this.g.values()}u(){return this.h=!0,this}Nt(){return this.h=!1,this}toString(){return"Set()#"+GSet.as(this)}add(t){return t===null?this:(this.g.add(t),this)}addAll(t){if(t===null)return this;if(Array.isArray(t)){const i=t.length;for(let e=0;e<i;e++){const s=t[e];s!==null&&this.g.add(s)}}else{const i=t.iterator;for(;i.next();){const e=i.value;e!==null&&this.g.add(e)}}return this}has(t){return this.g.has(t)}contains(t){return this.has(t)}containsAll(t){if(t===null)return!0;const i=t.iterator;for(;i.next();)if(!this.has(i.value))return!1;return!0}containsAny(t){if(t===null)return!0;const i=t.iterator;for(;i.next();)if(this.has(i.value))return!0;return!1}first(){return this.g.size===0?null:this.g.values().next().value}any(t){for(const i of this.g)if(t(i))return!0;return!1}all(t){for(const i of this.g)if(!t(i))return!1;return!0}each(t){for(const i of this.g)t(i);return this}map(t){const i=new GSet;for(const e of this.g)i.add(t(e));return i}filter(t){const i=new GSet;for(const e of this.g)t(e)&&i.add(e);return i}delete(t){return this.h&&U.L(this),this.g.delete(t)}remove(t){return this.delete(t)}removeAll(t){if(t===null)return this;if(this.h&&U.L(this),Array.isArray(t)){const i=t.length;for(let e=0;e<i;e++)this.delete(t[e])}else{const i=t.iterator;for(;i.next();)this.delete(i.value)}return this}retainAll(t){if(t===null)return this;if(this.count===0)return this;this.h&&U.L(this);const i=new GSet;i.addAll(t);const e=[],s=this.iterator;for(;s.next();){const n=s.value;i.has(n)||e.push(n)}return this.removeAll(e),this}clear(){this.h&&U.L(this),this.g.clear()}copy(){const t=new GSet;return this.g.forEach(i=>t.add(i)),t}toArray(){return Array.from(this.g)}toList(){const t=new List;return this.g.forEach(i=>t.add(i)),t}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?EmptyIterator.instance:new SetIterator(this)}entries(){return this.g.entries()}keys(){return this.g.keys()}forEach(t,i){return this.g.forEach(t,i)}static gw=1;static Gi(t){t.__gohashid=GSet.gw++}static as(t){return t.__gohashid}}class MapKeySetIterator{q;ii;constructor(t){this.q=t,this.ii=t.g.keys()}[Symbol.iterator](){return this.q.g.keys()}key;value;get iterator(){return this}reset(){const t=this.q;this.ii=t.g.keys()}next(){const t=this.ii.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.q.g.size===0?null:(this.ii=this.q.g.keys(),this.ii.next().value)}any(t){for(const i of this.q.g)if(t(i[0]))return!0;return!1}all(t){for(const i of this.q.g)if(!t(i[0]))return!1;return!0}each(t){for(const i of this.q.g)t(i[0]);return this}map(t){const i=this.q,e=new List;for(const s of i.g)e.add(t(s[0]));return e.iterator}filter(t){const i=this.q,e=new List;for(const s of i.g){const n=s[0];t(n)&&e.add(n)}return e.iterator}get count(){return this.q.size}fl(){this.key=null,this.value=null,this.ii=null}toString(){return"MapKeySetIterator"}}class MapKeySet extends GSet{q;constructor(t){super(),GSet.Gi(this),this.h=!0,this.q=t}[Symbol.iterator](){return this.g.keys()}values(){return this.g.keys()}u(){return this}Nt(){return this}toString(){return"MapKeySet("+this.q.toString()+")"}add(t){U.o("This Set is read-only: "+this.toString())}has(t){return this.q.has(t)}contains(t){return this.has(t)}delete(t){U.o("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){U.o("This Set is read-only: "+this.toString())}first(){return this.q.g.size===0?null:this.q.g.keys().next().value}any(t){for(const i of this.q.g)if(t(i[0]))return!0;return!1}all(t){for(const i of this.q.g)if(!t(i[0]))return!1;return!0}each(t){for(const i of this.q.g)t(i[0]);return this}map(t){const i=new GSet;for(const e of this.q.g)i.add(t(e[0]));return i}filter(t){const i=new GSet;for(const e of this.q.g){const s=e[0];t(s)&&i.add(s)}return i}copy(){return new MapKeySet(this.q)}toSet(){const t=new GSet,i=this.q.g;for(const e of i)t.add(e[0]);return t}toArray(){const t=this.q.g,i=new Array(t.size);let e=0;for(const s of t)i[e]=s[0],e++;return i}toList(){const t=new List,i=this.q.g;for(const e of i)t.add(e[0]);return t}get count(){return this.q.size}get size(){return this.q.size}get iterator(){return this.q.size<=0?EmptyIterator.instance:new MapKeySetIterator(this.q)}}class MapValueSetIterator{q;ii;constructor(t){this.q=t,this.ii=t.g.values()}[Symbol.iterator](){return this.q.g.values()}key;value;get iterator(){return this}reset(){const t=this.q;this.ii=t.g.values()}next(){const t=this.ii.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return this.q.g.size===0?null:(this.ii=this.q.g.values(),this.ii.next().value)}any(t){for(const i of this.q.g)if(t(i[1]))return!0;return!1}all(t){for(const i of this.q.g)if(!t(i[1]))return!1;return!0}each(t){for(const i of this.q.g)t(i[1]);return this}map(t){const i=this.q,e=new List;for(const s of i.g)e.add(t(s[1]));return e.iterator}filter(t){const i=this.q,e=new List;for(const s of i.g){const n=s[1];t(n)&&e.add(n)}return e.iterator}get count(){return this.q.size}fl(){this.key=null,this.value=null,this.ii=null}toString(){return"MapValueSetIterator"}}class KeyValuePair{constructor(t,i){this.key=t,this.value=i}toString(){return"{"+this.key+":"+this.value+"}"}key;value}class MapIterator{q;ii;constructor(t){this.q=t,this.ii=t.g.entries()}[Symbol.iterator](){return this.q.g.entries()}key;value;get iterator(){return this}reset(){const t=this.q;this.ii=t.g.entries()}next(){const t=this.ii.next();return t.done?(this.key=null,this.value=null,!1):(this.key=t.value[0],this.value=t.value[1],!0)}hasNext(){return this.next()}first(){if(this.q.g.size===0)return null;this.ii=this.q.g.entries();const t=this.ii.next().value;return this.key=t[0],this.value=t[1],new KeyValuePair(t[0],t[1])}any(t){return this.q.any(t)}all(t){return this.q.all(t)}each(t){return this.q.each(t),this}map(t){const i=new List;let e=null;return this.q.g.forEach((s,n)=>{e===null?e=new KeyValuePair(n,s):(e.key=n,e.value=s),i.add(t(e))}),i.iterator}filter(t){const i=new List;let e=null;return this.q.g.forEach((s,n)=>{e===null?e=new KeyValuePair(n,s):(e.key=n,e.value=s),t(e)&&(i.add(e),e=null)}),i.iterator}get count(){return this.q.size}fl(){this.key=null,this.value=null,this.ii=null}toString(){return"MapIterator"}}class GMap{h;g;constructor(t){GSet.Gi(this),this.h=!1,this.g=new Map,t!==void 0&&this.addAll(t)}[Symbol.iterator](){return this.g.entries()}entries(){return this.g.entries()}u(){return this.h=!0,this}Nt(){return this.h=!1,this}toString(){return"Map()#"+GSet.as(this)}set(t,i){return this.h&&U.L(this,t),this.g.set(t,i),this}add(t,i){return this.set(t,i)}addAll(t){if(t===null)return this;if(this.h&&U.L(this),Array.isArray(t)){const i=t.length;for(let e=0;e<i;e++){const s=t[e];this.set(s.key,s.value)}}else if(t instanceof GMap){const i=t.iterator;for(;i.next();)this.set(i.key,i.value)}else{const i=t.iterator;for(;i.next();){const e=i.value;this.set(e.key,e.value)}}return this}first(){if(this.g.size===0)return null;const t=this.g.entries().next().value;return new KeyValuePair(t[0],t[1])}any(t){let i=null;for(const[e,s]of this.g)if(i===null?i=new KeyValuePair(e,s):(i.key=e,i.value=s),t(i))return!0;return!1}all(t){let i=null;for(const[e,s]of this.g)if(i===null?i=new KeyValuePair(e,s):(i.key=e,i.value=s),!t(i))return!1;return!0}each(t){let i=null;for(const[e,s]of this.g)i===null?i=new KeyValuePair(e,s):(i.key=e,i.value=s),t(i);return this}map(t){const i=new GMap;let e=null;for(const[s,n]of this.g)e===null?e=new KeyValuePair(s,n):(e.key=s,e.value=n),i.set(s,t(e));return i}filter(t){const i=new GMap;let e=null;for(const[s,n]of this.g)e===null?e=new KeyValuePair(s,n):(e.key=s,e.value=n),t(e)&&i.set(s,n);return i}has(t){return this.g.has(t)}contains(t){return this.has(t)}get(t){const i=this.g.get(t);return i===void 0?null:i}getValue(t){return this.get(t)}delete(t){return t===null?!1:(this.h&&U.L(this,t),this.g.delete(t))}remove(t){return this.delete(t)}clear(){this.h&&U.L(this),this.g.clear()}copy(){const t=new GMap;return t.g=new Map(this.g),t}toArray(){const t=this.g,i=new Array(t.size);let e=0;for(const s of t)i[e]=new KeyValuePair(s[0],s[1]),e++;return i}toKeySet(){return new MapKeySet(this)}get count(){return this.g.size}get size(){return this.g.size}get iterator(){return this.g.size<=0?EmptyIterator.instance:new MapIterator(this)}get iteratorKeys(){return this.count<=0?EmptyIterator.instance:new MapKeySetIterator(this)}keys(){return this.g.keys()}get iteratorValues(){return this.count<=0?EmptyIterator.instance:new MapValueSetIterator(this)}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}}class Point{px;py;h;constructor(t,i){t===void 0?(this.px=0,this.py=0):typeof t=="number"&&typeof i=="number"?(this.px=t,this.py=i):U.o("Invalid arguments to Point constructor: "+t+", "+i),this.h=!1}a(t){return this.px=t.px,this.py=t.py,this}i(t,i){return this.px=t,this.py=i,this}setTo(t,i){return this.px=t,this.py=i,this}set(t){return this.px=t.px,this.py=t.py,this}copy(){const t=new Point;return t.px=this.px,t.py=this.py,t}$(){return this.h=!0,Object.freeze(this),this}P(){return this.h||Object.isFrozen(this)?this:this.copy().u()}u(){return this.h||(this.h=!0),this}Nt(){return this.h&&(Object.isFrozen(this)&&U.o("cannot thaw constant: "+this),this.h=!1),this}mw(t){}static parse(t){if(typeof t=="string"){const i=t.split(" ");let e=0,s=0;for(;i[e]==="";)e++;let n=i[e++];n&&(s=parseFloat(n));let o=0;for(;i[e]==="";)e++;return n=i[e++],n&&(o=parseFloat(n)),new Point(s,o)}else return new Point}static stringify(t){return t.x.toString()+" "+t.y.toString()}static stringifyFixed(t){return U.s(t,"number",Point,"stringifyFixed:digits"),i=>i.x.toFixed(t)+" "+i.y.toFixed(t)}toString(){return"Point("+this.x+","+this.y+")"}equals(t){return t instanceof Point?this.px===t.x&&this.py===t.y:!1}equalTo(t,i){return this.px===t&&this.py===i}equalsApprox(t){return Geo.f(this.px,t.x)&&Geo.f(this.py,t.y)}add(t){return this.px+=t.x,this.py+=t.y,this}subtract(t){return this.px-=t.x,this.py-=t.y,this}offset(t,i){return this.px+=t,this.py+=i,this}rotate(t){if(t===0)return this;const i=this.px,e=this.py;if(i===0&&e===0)return this;let s=0,n=0;if(t>=360?t-=360:t<0&&(t+=360),t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{const o=t*Math.PI/180;s=Math.cos(o),n=Math.sin(o)}return this.px=s*i-n*e,this.py=n*i+s*e,this}scale(t,i){return this.px*=t,this.py*=i,this}distanceSquaredPoint(t){const i=t.x-this.px,e=t.y-this.py;return i*i+e*e}distanceSquared(t,i){const e=t-this.px,s=i-this.py;return e*e+s*s}normalize(){const t=this.px,i=this.py,e=Math.sqrt(t*t+i*i);return e>0&&(this.px=t/e,this.py=i/e),this}directionPoint(t){return this.dC(t.x-this.px,t.y-this.py)}direction(t,i){return this.dC(t-this.px,i-this.py)}dC(t,i){if(t===0)return i>0?90:i<0?270:0;if(i===0)return t>0?0:180;{if(isNaN(t)||isNaN(i))return 0;let e=Math.atan(Math.abs(i/t))*180/Math.PI;return t<0?i<0?e+=180:e=180-e:i<0&&(e=360-e),e}}static compareWithLineSegment(t,i,e,s,n,o){return Geo.eu(t,i,e,s,n,o)}compareWithLineSegmentPoint(t,i){return Geo.eu(t.x,t.y,i.x,i.y,this.x,this.y)}static intersectingLineSegments(t,i,e,s,n,o,r,l){return Geo.su(t,i,e,s,n,o,r,l)}projectOntoLineSegment(t,i,e,s){return Geo.ul(t,i,e,s,this.px,this.py,this),this}projectOntoLineSegmentPoint(t,i){return Geo.ul(t.x,t.y,i.x,i.y,this.px,this.py,this),this}snapToGrid(t,i,e,s){return Geo.Dg(this.px,this.py,t,i,e,s,this),this}snapToGridPoint(t,i){return Geo.Dg(this.px,this.py,t.x,t.y,i.width,i.height,this),this}setRectSpot(t,i){return this.px=t.x+i.x*t.width+i.offsetX,this.py=t.y+i.y*t.height+i.offsetY,this}setSpot(t,i,e,s,n){return this.px=t+n.x*e+n.offsetX,this.py=i+n.y*s+n.offsetY,this}T(t){return t.gt(this),this}Oe(t){return t.$e(this),this}static distanceLineSegmentSquared(t,i,e,s,n,o){let r=n-e,l=o-s;const h=r*r+l*l,c=e-t,a=s-i,f=-c*r-a*l;if(f<=0||f>=h)return r=n-t,l=o-i,Math.min(c*c+a*a,r*r+l*l);{const u=r*a-l*c;return u*u/h}}static distanceSquared(t,i,e,s){const n=e-t,o=s-i;return n*n+o*o}static direction(t,i,e,s){const n=e-t,o=s-i;if(n===0)return o>0?90:o<0?270:0;if(o===0)return n>0?0:180;{if(isNaN(n)||isNaN(o))return 0;let r=Math.atan(Math.abs(o/n))*180/Math.PI;return n<0?o<0?r+=180:r=180-r:o<0&&(r=360-r),r}}get x(){return this.px}set x(t){this.px=t}get y(){return this.py}set y(t){this.py=t}isReal(){return isFinite(this.x)&&isFinite(this.y)}static wo=new Point(0,0).$();static gC=new Point(-1/0,-1/0).$();static mC=new Point(1/0,1/0).$();static pC=new Point(6,6).$();static Ok=new Point(NaN,NaN).$();static Ik=[];static l(){const t=Point.Ik.pop();return t===void 0?new Point:t}static V(t,i){const e=Point.Ik.pop();return e===void 0?new Point(t,i):(e.x=t,e.y=i,e)}static e(t){Point.Ik.push(t)}}class Size{sw;sh;h;constructor(t,i){t===void 0?(this.sw=0,this.sh=0):typeof t=="number"&&(t>=0||isNaN(t))&&typeof i=="number"&&(i>=0||isNaN(i))?(this.sw=t,this.sh=i):U.o("Invalid arguments to Size constructor: "+t+", "+i),this.h=!1}a(t){return this.sw=t.sw,this.sh=t.sh,this}i(t,i){return this.sw=t,this.sh=i,this}setTo(t,i){return this.sw=t,this.sh=i,this}set(t){return this.sw=t.sw,this.sh=t.sh,this}copy(){const t=new Size;return t.sw=this.sw,t.sh=this.sh,t}$(){return this.h=!0,Object.freeze(this),this}P(){return this.h||Object.isFrozen(this)?this:this.copy().u()}u(){return this.h||(this.h=!0),this}Nt(){return this.h&&(Object.isFrozen(this)&&U.o("cannot thaw constant: "+this),this.h=!1),this}mw(t){}static parse(t){if(typeof t=="string"){const i=t.split(" ");let e=0,s=0;for(;i[e]==="";)e++;let n=i[e++];n&&(s=parseFloat(n));let o=0;for(;i[e]==="";)e++;return n=i[e++],n&&(o=parseFloat(n)),new Size(s,o)}else return new Size}static stringify(t){return t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return U.s(t,"number",Size,"stringifyFixed:digits"),i=>i.width.toFixed(t)+" "+i.height.toFixed(t)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof Size?this.sw===t.width&&this.sh===t.height:!1}equalTo(t,i){return this.sw===t&&this.sh===i}equalsApprox(t){return Geo.f(this.sw,t.width)&&Geo.f(this.sh,t.height)}inflate(t,i){const e=this.width+t;this.sw=e>=0?e:0;const s=this.height+i;return this.sh=s>=0?s:0,this}get width(){return this.sw}set width(t){t<0&&U.W(t,">= 0",Size,"width"),this.sw=t}get height(){return this.sh}set height(t){t<0&&U.W(t,">= 0",Size,"height"),this.sh=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static sc=new Size(0,0).$();static Ek=new Size(1,1).$();static yC=new Size(6,6).$();static nu=new Size(8,8).$();static wC=new Size(10,10).$();static Bk=new Size(1/0,1/0).$();static pw=new Size(NaN,NaN).$();static xC=[];static l(){const t=Size.xC.pop();return t===void 0?new Size:t}static e(t){Size.xC.push(t)}}class Rect{rx;ry;rw;rh;h;constructor(t,i,e,s){if(t===void 0)this.rx=0,this.ry=0,this.rw=0,this.rh=0;else if(typeof t=="number"&&typeof i=="number"&&typeof e=="number"&&(e>=0||isNaN(e))&&typeof s=="number"&&(s>=0||isNaN(s)))this.rx=t,this.ry=i,this.rw=e,this.rh=s;else if(t instanceof Point){const n=t.x,o=t.y;if(i instanceof Point){const r=i.x,l=i.y;this.rx=Math.min(n,r),this.ry=Math.min(o,l),this.rw=Math.abs(n-r),this.rh=Math.abs(o-l)}else i instanceof Size?(this.rx=n,this.ry=o,this.rw=i.width,this.rh=i.height):U.o("Incorrect second argument supplied to Rect constructor "+i)}else U.o("Invalid arguments to Rect constructor: "+t+", "+i+", "+e+", "+s);this.h=!1}a(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}i(t,i,e,s){return this.rx=t,this.ry=i,this.rw=e,this.rh=s,this}Fn(t,i){return this.rw=t,this.rh=i,this}setTo(t,i,e,s){return this.rx=t,this.ry=i,this.rw=e,this.rh=s,this}set(t){return this.rx=t.rx,this.ry=t.ry,this.rw=t.rw,this.rh=t.rh,this}setPoint(t){return this.rx=t.x,this.ry=t.y,this}setSize(t){return this.rw=t.width,this.rh=t.height,this}copy(){const t=new Rect;return t.rx=this.rx,t.ry=this.ry,t.rw=this.rw,t.rh=this.rh,t}$(){return this.h=!0,Object.freeze(this),this}P(){return this.h||Object.isFrozen(this)?this:this.copy().u()}u(){return this.h||(this.h=!0),this}Nt(){return this.h&&(Object.isFrozen(this)&&U.o("cannot thaw constant: "+this),this.h=!1),this}mw(t){}static parse(t){if(typeof t=="string"){const i=t.split(" ");let e=0,s=0;for(;i[e]==="";)e++;let n=i[e++];n&&(s=parseFloat(n));let o=0;for(;i[e]==="";)e++;n=i[e++],n&&(o=parseFloat(n));let r=0;for(;i[e]==="";)e++;n=i[e++],n&&(r=parseFloat(n));let l=0;for(;i[e]==="";)e++;return n=i[e++],n&&(l=parseFloat(n)),new Rect(s,o,r,l)}else return new Rect}static stringify(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(t){return U.s(t,"number",Rect,"stringifyFixed:digits"),i=>i.x.toFixed(t)+" "+i.y.toFixed(t)+" "+i.width.toFixed(t)+" "+i.height.toFixed(t)}toString(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"}equals(t){return t instanceof Rect?this.rx===t.x&&this.ry===t.y&&this.rw===t.width&&this.rh===t.height:!1}equalTo(t,i,e,s){return this.rx===t&&this.ry===i&&this.rw===e&&this.rh===s}equalsApprox(t){return Geo.f(this.rx,t.x)&&Geo.f(this.ry,t.y)&&Geo.f(this.rw,t.width)&&Geo.f(this.rh,t.height)}equalsApproxTo(t,i,e,s){return Geo.f(this.rx,t)&&Geo.f(this.ry,i)&&Geo.f(this.rw,e)&&Geo.f(this.rh,s)}equalsApproxClose(t){return Geo.z(this.rx,t.x)&&Geo.z(this.ry,t.y)&&Geo.z(this.rw,t.width)&&Geo.z(this.rh,t.height)}containsPoint(t){return this.rx<=t.x&&this.rx+this.rw>=t.x&&this.ry<=t.y&&this.ry+this.rh>=t.y}containsRect(t){return this.rx<=t.x&&t.x+t.width<=this.rx+this.rw&&this.ry<=t.y&&t.y+t.height<=this.ry+this.rh}contains(t,i,e,s){return e===void 0&&(e=0),s===void 0&&(s=0),this.rx<=t&&t+e<=this.rx+this.rw&&this.ry<=i&&i+s<=this.ry+this.rh}offset(t,i){return this.rx+=t,this.ry+=i,this}inflate(t,i){return this.yw(i,t,i,t)}addMargin(t){return this.yw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return this.yw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,i,e,s){return this.yw(t,i,e,s)}yw(t,i,e,s){const n=this.rw;i+s<=-n?(this.rx+=n/2,this.rw=0):(this.rx-=s,this.rw+=i+s);const o=this.rh;return t+e<=-o?(this.ry+=o/2,this.rh=0):(this.ry-=t,this.rh+=t+e),this}intersectRect(t){return this.bC(t.x,t.y,t.width,t.height)}intersect(t,i,e,s){return this.bC(t,i,e,s)}bC(t,i,e,s){const n=Math.max(this.rx,t),o=Math.max(this.ry,i),r=Math.min(this.rx+this.rw,t+e),l=Math.min(this.ry+this.rh,i+s);return this.rx=n,this.ry=o,this.rw=Math.max(0,r-n),this.rh=Math.max(0,l-o),this}intersectsRect(t){return this.intersects(t.x,t.y,t.width,t.height)}intersects(t,i,e,s){let n=this.rw;const o=this.rx;if(n!==1/0&&e!==1/0&&(n+=o,e+=t,isNaN(e)||isNaN(n)||o>e||t>n))return!1;let r=this.rh;const l=this.ry;return!(r!==1/0&&s!==1/0&&(r+=l,s+=i,isNaN(s)||isNaN(r)||l>s||i>r))}intersectsRectPlus(t,i){let e=this.rw,s=t.width+i+i;const n=this.rx,o=t.x-i;if(e+=n,s+=o,n>s||o>e)return!1;let r=this.rh,l=t.height+i+i;const h=this.ry,c=t.y-i;return r+=h,l+=c,!(h>l||c>r)}unionPoint(t){return this.unionNoCheck(t.x,t.y,0,0)}unionRect(t){return this.unionNoCheck(t.rx,t.ry,t.rw,t.rh)}union(t,i,e,s){return e===void 0&&(e=0),s===void 0&&(s=0),this.unionNoCheck(t,i,e,s)}unionNoCheck(t,i,e,s){const n=Math.min(this.rx,t),o=Math.min(this.ry,i),r=Math.max(this.rx+this.rw,t+e),l=Math.max(this.ry+this.rh,i+s);return this.rx=n,this.ry=o,this.rw=r-n,this.rh=l-o,this}setSpot(t,i,e){return this.rx=t-e.offsetX-e.x*this.rw,this.ry=i-e.offsetY-e.y*this.rh,this}static contains(t,i,e,s,n,o,r,l){return r===void 0&&(r=0),l===void 0&&(l=0),t<=n&&n+r<=t+e&&i<=o&&o+l<=i+s}static intersects(t,i,e,s,n,o,r,l){let h=e,c=r;const a=t,f=n;if(h+=a,c+=f,a>c||f>h)return!1;let u=s,d=l;const m=i,g=o;return u+=m,d+=g,!(m>d||g>u)}static intersectsLineSegment(t,i,e,s,n,o,r,l){return Geo.kC(t,i,e,s,n,o,r,l)}get x(){return this.rx}set x(t){this.rx=t}get y(){return this.ry}set y(t){this.ry=t}get width(){return this.rw}set width(t){t<0&&U.W(t,">= 0",Rect,"width"),this.rw=t}get height(){return this.rh}set height(t){t<0&&U.W(t,">= 0",Rect,"height"),this.rh=t}get left(){return this.rx}set left(t){this.rx=t}get top(){return this.ry}set top(t){this.ry=t}get right(){return this.rx+this.rw}set right(t){this.rx+=t-(this.rx+this.rw)}get bottom(){return this.ry+this.rh}set bottom(t){this.ry+=t-(this.ry+this.rh)}get position(){return new Point(this.rx,this.ry)}set position(t){this.rx=t.x,this.ry=t.y}get size(){return new Size(this.rw,this.rh)}set size(t){this.rw=t.width,this.rh=t.height}get center(){return new Point(this.rx+this.rw/2,this.ry+this.rh/2)}set center(t){this.rx=t.x-this.rw/2,this.ry=t.y-this.rh/2}get centerX(){return this.rx+this.rw/2}set centerX(t){this.rx=t-this.rw/2}get centerY(){return this.ry+this.rh/2}set centerY(t){this.ry=t-this.rh/2}isReal(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}isEmpty(){return this.width===0&&this.height===0}static Fg=new Rect(0,0,0,0).$();static JD=new Rect(NaN,NaN,NaN,NaN).$();static Uk=[];static l(){const t=Rect.Uk.pop();return t===void 0?new Rect:t}static V(t,i,e,s){const n=Rect.Uk.pop();return n===void 0?new Rect(t,i,e,s):n.i(t,i,e,s)}static e(t){Rect.Uk.push(t)}}class Margin{mt;mr;mb;ml;h;constructor(t,i,e,s){t===void 0?(this.mt=0,this.mr=0,this.mb=0,this.ml=0):i===void 0?(i=t,e=t,s=t,this.mt=t,this.mr=i,this.mb=e,this.ml=s):e===void 0?(e=t,s=i,this.mt=t,this.mr=i,this.mb=e,this.ml=s):s!==void 0?(this.mt=t,this.mr=i,this.mb=e,this.ml=s):U.o("Invalid arguments to Margin constructor: "+t+", "+i+", "+e+", "+s),this.h=!1}a(t){return this.mt=t.mt,this.mr=t.mr,this.mb=t.mb,this.ml=t.ml,this}setTo(t,i,e,s){return this.mt=t,this.mr=i,this.mb=e,this.ml=s,this}set(t){return this.mt=t.mt,this.mr=t.mr,this.mb=t.mb,this.ml=t.ml,this}copy(){const t=new Margin;return t.mt=this.mt,t.mr=this.mr,t.mb=this.mb,t.ml=this.ml,t}$(){return this.h=!0,Object.freeze(this),this}P(){return this.h||Object.isFrozen(this)?this:this.copy().u()}u(){return this.h||(this.h=!0),this}Nt(){return this.h&&(Object.isFrozen(this)&&U.o("cannot thaw constant: "+this),this.h=!1),this}mw(t){}static parse(t){if(typeof t=="string"){const i=t.split(" ");let e=0,s=NaN;for(;i[e]==="";)e++;let n=i[e++];if(n&&(s=parseFloat(n)),isNaN(s))return new Margin;let o=NaN;for(;i[e]==="";)e++;if(n=i[e++],n&&(o=parseFloat(n)),isNaN(o))return new Margin(s);let r=NaN;for(;i[e]==="";)e++;if(n=i[e++],n&&(r=parseFloat(n)),isNaN(r))return new Margin(s,o);let l=NaN;for(;i[e]==="";)e++;return n=i[e++],n&&(l=parseFloat(n)),isNaN(l)?new Margin(s,o):new Margin(s,o,r,l)}else return new Margin}static stringify(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(t){return U.s(t,"number",Margin,"stringifyFixed:digits"),i=>i.top.toFixed(t)+" "+i.right.toFixed(t)+" "+i.bottom.toFixed(t)+" "+i.left.toFixed(t)}toString(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"}equals(t){return t instanceof Margin?this.mt===t.top&&this.mr===t.right&&this.mb===t.bottom&&this.ml===t.left:!1}equalTo(t,i,e,s){return this.mt===t&&this.mr===i&&this.mb===e&&this.ml===s}equalsApprox(t){return Geo.f(this.mt,t.top)&&Geo.f(this.mr,t.right)&&Geo.f(this.mb,t.bottom)&&Geo.f(this.ml,t.left)}get top(){return this.mt}set top(t){this.mt=t}get right(){return this.mr}set right(t){this.mr=t}get bottom(){return this.mb}set bottom(t){this.mb=t}get left(){return this.ml}set left(t){this.ml=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static Rg=new Margin(0,0,0,0).$();static PC=new Margin(2,2,2,2).$();static SC=[];static l(){const t=Margin.SC.pop();return t===void 0?new Margin:t}static e(t){Margin.SC.push(t)}}class Spot{sx;sy;ox;oy;h;constructor(t,i,e,s){t===void 0?(this.sx=0,this.sy=0,this.ox=0,this.oy=0):(i===void 0&&(i=0),e===void 0&&(e=0),s===void 0&&(s=0),this.sx=t,this.sy=i,this.ox=e,this.oy=s),this.h=!1}a(t){return this.sx=t.sx,this.sy=t.sy,this.ox=t.ox,this.oy=t.oy,this}setTo(t,i,e,s){return this.sx=t,this.sy=i,this.ox=e,this.oy=s,this}set(t){return this.sx=t.sx,this.sy=t.sy,this.ox=t.ox,this.oy=t.oy,this}copy(){const t=new Spot;return t.sx=this.sx,t.sy=this.sy,t.ox=this.ox,t.oy=this.oy,t}$(){return this.h=!0,Object.freeze(this),this}P(){return this.h||Object.isFrozen(this)?this:this.copy().u()}u(){return this.h||(this.h=!0),this}Nt(){return this.h&&(Object.isFrozen(this)&&U.o("cannot thaw constant: "+this),this.h=!1),this}mw(t){}Ie(t){return this.sx=NaN,this.sy=NaN,this.ox=t,this}yE(t,i){(isNaN(t)||t>1||t<0)&&U.W(t,"0 <= "+i+" <= 1",Spot,i)}wE(t,i){(isNaN(t)||t===1/0||t===-1/0)&&U.W(t,"real number, not NaN or Infinity",Spot,i)}static parse(t){if(typeof t=="string"){if(t=t.trim(),t==="None")return Spot.None;if(t==="TopLeft")return Spot.TopLeft;if(t==="Top"||t==="TopCenter"||t==="MiddleTop")return Spot.TopCenter;if(t==="TopRight")return Spot.TopRight;if(t==="Left"||t==="LeftCenter"||t==="MiddleLeft")return Spot.LeftCenter;if(t==="Center")return Spot.Center;if(t==="Right"||t==="RightCenter"||t==="MiddleRight")return Spot.RightCenter;if(t==="BottomLeft")return Spot.BottomLeft;if(t==="Bottom"||t==="BottomCenter"||t==="MiddleBottom")return Spot.BottomCenter;if(t==="BottomRight")return Spot.BottomRight;if(t==="TopSide")return Spot.TopSide;if(t==="LeftSide")return Spot.LeftSide;if(t==="RightSide")return Spot.RightSide;if(t==="BottomSide")return Spot.BottomSide;if(t==="TopBottomSides")return Spot.TopBottomSides;if(t==="LeftRightSides")return Spot.LeftRightSides;if(t==="TopLeftSides")return Spot.TopLeftSides;if(t==="TopRightSides")return Spot.TopRightSides;if(t==="BottomLeftSides")return Spot.BottomLeftSides;if(t==="BottomRightSides")return Spot.BottomRightSides;if(t==="NotTopSide")return Spot.NotTopSide;if(t==="NotLeftSide")return Spot.NotLeftSide;if(t==="NotRightSide")return Spot.NotRightSide;if(t==="NotBottomSide")return Spot.NotBottomSide;if(t==="AllSides")return Spot.AllSides;if(t==="Default")return Spot.Default;const i=t.split(" ");let e=0,s=0;for(;i[e]==="";)e++;let n=i[e++];n!==void 0&&n.length>0&&(s=parseFloat(n));let o=0;for(;i[e]==="";)e++;n=i[e++],n!==void 0&&n.length>0&&(o=parseFloat(n));let r=0;for(;i[e]==="";)e++;n=i[e++],n!==void 0&&n.length>0&&(r=parseFloat(n));let l=0;for(;i[e]==="";)e++;return n=i[e++],n!==void 0&&n.length>0&&(l=parseFloat(n)),new Spot(s,o,r,l)}else return new Spot}static stringify(t){return t.isSpot()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}static stringifyFixed(t){return U.s(t,"number",Spot,"stringifyFixed:digits"),i=>i.x.toFixed(t)+" "+i.y.toFixed(t)+" "+i.offsetX.toFixed(t)+" "+i.offsetY.toFixed(t)}toString(){return this.isSpot()?this.ox===0&&this.oy===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.equals(Spot.None)?"None":this.equals(Spot.TopLeft)?"TopLeft":this.equals(Spot.TopCenter)?"Top":this.equals(Spot.TopRight)?"TopRight":this.equals(Spot.LeftCenter)?"Left":this.equals(Spot.Center)?"Center":this.equals(Spot.RightCenter)?"Right":this.equals(Spot.BottomLeft)?"BottomLeft":this.equals(Spot.BottomCenter)?"Bottom":this.equals(Spot.BottomRight)?"BottomRight":this.equals(Spot.TopSide)?"TopSide":this.equals(Spot.LeftSide)?"LeftSide":this.equals(Spot.RightSide)?"RightSide":this.equals(Spot.BottomSide)?"BottomSide":this.equals(Spot.TopBottomSides)?"TopBottomSides":this.equals(Spot.LeftRightSides)?"LeftRightSides":this.equals(Spot.TopLeftSides)?"TopLeftSides":this.equals(Spot.TopRightSides)?"TopRightSides":this.equals(Spot.BottomLeftSides)?"BottomLeftSides":this.equals(Spot.BottomRightSides)?"BottomRightSides":this.equals(Spot.NotTopSide)?"NotTopSide":this.equals(Spot.NotLeftSide)?"NotLeftSide":this.equals(Spot.NotRightSide)?"NotRightSide":this.equals(Spot.NotBottomSide)?"NotBottomSide":this.equals(Spot.AllSides)?"AllSides":this.equals(Spot.Default)?"Default":"None"}equals(t){return t instanceof Spot?(this.sx===t.x||isNaN(this.sx)&&isNaN(t.x))&&(this.sy===t.y||isNaN(this.sy)&&isNaN(t.y))&&this.ox===t.offsetX&&this.oy===t.offsetY:!1}opposite(){return new Spot(.5-(this.sx-.5),.5-(this.sy-.5),-this.ox,-this.oy)}includesSide(t){if(!this.isSide())return!1;if(!t.isSide())if(t.equals(Spot.Left))t=Spot.LeftSide;else if(t.equals(Spot.Right))t=Spot.RightSide;else if(t.equals(Spot.Top))t=Spot.TopSide;else if(t.equals(Spot.Bottom))t=Spot.BottomSide;else return!1;const i=this.oy,e=t.offsetY;return(i&e)===e}get x(){return this.sx}set x(t){this.sx=t}get y(){return this.sy}set y(t){this.sy=t}get offsetX(){return this.ox}set offsetX(t){this.ox=t}get offsetY(){return this.oy}set offsetY(t){this.oy=t}isSpot(){return!isNaN(this.x)&&!isNaN(this.y)}isNoSpot(){return isNaN(this.x)||isNaN(this.y)}isSide(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0}isNone(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0}isDefault(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0}static None=new Spot(0,0,0,0).Ie(0).$();static Default=new Spot(0,0,-1,0).Ie(-1).$();static TopLeft=new Spot(0,0,0,0).$();static TopCenter=new Spot(.5,0,0,0).$();static TopRight=new Spot(1,0,0,0).$();static LeftCenter=new Spot(0,.5,0,0).$();static Center=new Spot(.5,.5,0,0).$();static RightCenter=new Spot(1,.5,0,0).$();static BottomLeft=new Spot(0,1,0,0).$();static BottomCenter=new Spot(.5,1,0,0).$();static BottomRight=new Spot(1,1,0,0).$();static MiddleTop=Spot.TopCenter;static MiddleLeft=Spot.LeftCenter;static MiddleRight=Spot.RightCenter;static MiddleBottom=Spot.BottomCenter;static Top=Spot.TopCenter;static Left=Spot.LeftCenter;static Right=Spot.RightCenter;static Bottom=Spot.BottomCenter;static TopSide=new Spot(0,0,1,1).Ie(1).$();static LeftSide=new Spot(0,0,1,2).Ie(1).$();static RightSide=new Spot(0,0,1,4).Ie(1).$();static BottomSide=new Spot(0,0,1,8).Ie(1).$();static TopBottomSides=new Spot(0,0,1,9).Ie(1).$();static LeftRightSides=new Spot(0,0,1,6).Ie(1).$();static TopLeftSides=new Spot(0,0,1,3).Ie(1).$();static TopRightSides=new Spot(0,0,1,5).Ie(1).$();static BottomLeftSides=new Spot(0,0,1,10).Ie(1).$();static BottomRightSides=new Spot(0,0,1,12).Ie(1).$();static NotTopSide=new Spot(0,0,1,14).Ie(1).$();static NotLeftSide=new Spot(0,0,1,13).Ie(1).$();static NotRightSide=new Spot(0,0,1,11).Ie(1).$();static NotBottomSide=new Spot(0,0,1,7).Ie(1).$();static AllSides=new Spot(0,0,1,15).Ie(1).$();static Vk=new Spot(.156,.156).$();static zk=new Spot(.844,.844).$();static MC=[];static l(){const t=Spot.MC.pop();return t===void 0?new Spot:t}static e(t){Spot.MC.push(t)}}class Transform{m11;m12;m21;m22;dx;dy;constructor(){this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0}set(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this}setTo(t,i,e,s,n,o){return this.m11=t,this.m12=i,this.m21=e,this.m22=s,this.dx=n,this.dy=o,this}copy(){const t=new Transform;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t}toString(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}equals(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy}Xk(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1}Ri(){return this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0,this}nc(t){const i=this.m11*t.m11+this.m21*t.m12,e=this.m12*t.m11+this.m22*t.m12,s=this.m11*t.m21+this.m21*t.m22,n=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=i,this.m12=e,this.m21=s,this.m22=n,this}NC(t){const i=1/(t.m11*t.m22-t.m12*t.m21),e=t.m22*i,s=-t.m12*i,n=-t.m21*i,o=t.m11*i,r=i*(t.m21*t.dy-t.m22*t.dx),l=i*(t.m12*t.dx-t.m11*t.dy),h=this.m11*e+this.m21*s,c=this.m12*e+this.m22*s,a=this.m11*n+this.m21*o,f=this.m12*n+this.m22*o;return this.dx=this.m11*r+this.m21*l+this.dx,this.dy=this.m12*r+this.m22*l+this.dy,this.m11=h,this.m12=c,this.m21=a,this.m22=f,this}ww(){const t=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*t,e=-this.m12*t,s=-this.m21*t,n=this.m11*t,o=t*(this.m21*this.dy-this.m22*this.dx),r=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=i,this.m12=e,this.m21=s,this.m22=n,this.dx=o,this.dy=r,this}cs(t,i,e){if(t>=360?t-=360:t<0&&(t+=360),t===0)return this;this.Fs(i,e);let s=0,n=0;if(t===90)s=0,n=1;else if(t===180)s=-1,n=0;else if(t===270)s=0,n=-1;else{const c=t*Math.PI/180;s=Math.cos(c),n=Math.sin(c)}const o=this.m11*s+this.m21*n,r=this.m12*s+this.m22*n,l=this.m11*-n+this.m21*s,h=this.m12*-n+this.m22*s;return this.m11=o,this.m12=r,this.m21=l,this.m22=h,this.Fs(-i,-e),this}Fs(t,i){return this.dx+=this.m11*t+this.m21*i,this.dy+=this.m12*t+this.m22*i,this}tt(t,i){return i===void 0&&(i=t),this.m11*=t,this.m12*=t,this.m21*=i,this.m22*=i,this}$D(){if(this.m11===1&&this.m12===0)return 0;let t=Math.atan2(this.m12,this.m11)*180/Math.PI;return t<0&&(t+=360),t}gt(t){const i=t.x,e=t.y;return t.i(i*this.m11+e*this.m21+this.dx,i*this.m12+e*this.m22+this.dy)}$e(t){const i=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*i,s=-this.m12*i,n=-this.m21*i,o=this.m11*i,r=t.x-this.dx,l=t.y-this.dy;return t.i(r*e+l*n,r*s+l*o)}xw(t){const i=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*i,s=-this.m12*i,n=-this.m21*i,o=this.m11*i,r=i*(this.m21*this.dy-this.m22*this.dx),l=i*(this.m12*this.dx-this.m11*this.dy),h=t.x*1.25,c=t.y*1.2;return t.i(h*e+c*n+r,h*s+c*o+l)}vg(t){const i=t.x,e=t.y,s=i+t.width,n=e+t.height,o=this.m11,r=this.m12,l=this.m21,h=this.m22,c=this.dx,a=this.dy,f=i*o+e*l+c,u=i*r+e*h+a,d=s*o+e*l+c,m=s*r+e*h+a,g=i*o+n*l+c,p=i*r+n*h+a,y=s*o+n*l+c,x=s*r+n*h+a;let k=f,b=f,P=u,S=u;return k=Math.min(k,d),b=Math.max(b,d),P=Math.min(P,m),S=Math.max(S,m),k=Math.min(k,g),b=Math.max(b,g),P=Math.min(P,p),S=Math.max(S,p),k=Math.min(k,y),b=Math.max(b,y),P=Math.min(P,x),S=Math.max(S,x),t.i(k,P,b-k,S-P),t}static CC=[];static l(){const t=Transform.CC.pop();return t===void 0?new Transform:t}static e(t){Transform.CC.push(t)}static Yk="54a702f3e53909c447824c6706603faf4c"}const Geo={ZD:"7da71ca0ad381e90",Rn:4*((Math.sqrt(2)-1)/3),LC:null,bw:w=>{if(w<=0)return 0;let t=Geo.LC;if(t===null){t=[];for(let i=0;i<=2e3;i++)t[i]=Math.sqrt(i);Geo.LC=t}if(w<1){const i=1/w;return i<=2e3?1/t[i|0]:Math.sqrt(w)}else return w<=2e3?t[w|0]:Math.sqrt(w)},f:(w,t)=>{const i=w-t;return i<.5&&i>-.5},z:(w,t)=>{const i=w-t;return i<5e-8&&i>-5e-8},vi:(w,t,i,e,s,n,o)=>{s<=0&&(s=1e-6);let r=0,l=0,h=0,c=0;if(w<i?(l=w,r=i):(l=i,r=w),t<e?(c=t,h=e):(c=e,h=t),w===i)return c<=o&&o<=h&&w-s<=n&&n<=w+s;if(t===e)return l<=n&&n<=r&&t-s<=o&&o<=t+s;const a=r+s,f=l-s;if(f<=n&&n<=a){const u=h+s,d=c-s;if(d<=o&&o<=u)if(a-f>u-d)if(w-i>s||i-w>s){const g=(e-t)/(i-w)*(n-w)+t;if(g-s<=o&&o<=g+s)return!0}else return!0;else if(t-e>s||e-t>s){const g=(i-w)/(e-t)*(o-t)+w;if(g-s<=n&&n<=g+s)return!0}else return!0}return!1},kw:(w,t,i,e,s,n,o,r,l,h,c,a)=>{if(!Geo.vi(w,t,o,r,a,i,e)||!Geo.vi(w,t,o,r,a,s,n)){const f=(w+i)/2,u=(t+e)/2,d=(i+s)/2,m=(e+n)/2,g=(s+o)/2,p=(n+r)/2,y=(f+d)/2,x=(u+m)/2,k=(d+g)/2,b=(m+p)/2,P=(y+k)/2,S=(x+b)/2;return Geo.kw(w,t,f,u,y,x,P,S,l,h,c,a)||Geo.kw(P,S,k,b,g,p,o,r,l,h,c,a)}else return Geo.vi(w,t,o,r,a,h,c)},AC:(w,t,i,e,s,n,o,r,l)=>{const h=(w+i)/2,c=(t+e)/2,a=(i+s)/2,f=(e+n)/2,u=(s+o)/2,d=(n+r)/2,m=(h+a)/2,g=(c+f)/2,p=(a+u)/2,y=(f+d)/2;return l.i((m+p)/2,(g+y)/2),l},QD:(w,t,i,e,s,n,o,r)=>{const l=(w+i)/2,h=(t+e)/2,c=(i+s)/2,a=(e+n)/2,f=(s+o)/2,u=(n+r)/2,d=(l+c)/2,m=(h+a)/2,g=(c+f)/2,p=(a+u)/2;return Point.direction(d,m,g,p)},ou:(w,t,i,e,s,n,o,r,l,h)=>{if(!Geo.vi(w,t,o,r,l,i,e)||!Geo.vi(w,t,o,r,l,s,n)){const c=(w+i)/2,a=(t+e)/2,f=(i+s)/2,u=(e+n)/2,d=(s+o)/2,m=(n+r)/2,g=(c+f)/2,p=(a+u)/2,y=(f+d)/2,x=(u+m)/2,k=(g+y)/2,b=(p+x)/2;Geo.ou(w,t,c,a,g,p,k,b,l,h),Geo.ou(k,b,y,x,d,m,o,r,l,h)}else h.unionNoCheck(w,t,0,0),h.unionNoCheck(o,r,0,0);return h},vn:(w,t,i,e,s,n,o,r,l,h)=>{if(!Geo.vi(w,t,o,r,l,i,e)||!Geo.vi(w,t,o,r,l,s,n)){const c=(w+i)/2,a=(t+e)/2,f=(i+s)/2,u=(e+n)/2,d=(s+o)/2,m=(n+r)/2,g=(c+f)/2,p=(a+u)/2,y=(f+d)/2,x=(u+m)/2,k=(g+y)/2,b=(p+x)/2;Geo.vn(w,t,c,a,g,p,k,b,l,h),Geo.vn(k,b,y,x,d,m,o,r,l,h)}else h.length===0&&(h.push(w),h.push(t)),h.push(o),h.push(r);return h},Kk:(w,t,i,e,s,n,o,r,l,h)=>{if(Geo.vi(w,t,s,n,h,i,e))return Geo.vi(w,t,s,n,h,r,l);{const c=(w+i)/2,a=(t+e)/2,f=(i+s)/2,u=(e+n)/2,d=(c+f)/2,m=(a+u)/2;return Geo.Kk(w,t,c,a,d,m,o,r,l,h)||Geo.Kk(d,m,f,u,s,n,o,r,l,h)}},xE:(w,t,i,e,s,n,o)=>{const r=(w+i)/2,l=(t+e)/2,h=(i+s)/2,c=(e+n)/2;return o.i((r+h)/2,(l+c)/2),o},Gk:(w,t,i,e,s,n,o,r)=>{if(Geo.vi(w,t,s,n,o,i,e))r.unionNoCheck(w,t,0,0),r.unionNoCheck(s,n,0,0);else{const l=(w+i)/2,h=(t+e)/2,c=(i+s)/2,a=(e+n)/2,f=(l+c)/2,u=(h+a)/2;Geo.Gk(w,t,l,h,f,u,o,r),Geo.Gk(f,u,c,a,s,n,o,r)}return r},Og:(w,t,i,e,s,n,o,r)=>{if(Geo.vi(w,t,s,n,o,i,e))r.length===0&&(r.push(w),r.push(t)),r.push