/
collections.min.js
114 lines (114 loc) · 57.2 KB
/
collections.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
(function(m){function n(){throw Error("Can't construct. GenericCollection is a mixin.");}function R(){throw Error("Can't construct. GenericSet is a mixin.");}function la(){}function h(){throw Error("This is an abstract interface. Mix it. Don't construct it");}function H(){throw Error("Can't construct. RangeChanges is a mixin.");}function ta(){throw Error("Can't construct. GenericOrder is a mixin.");}function g(a){if(!(this instanceof g))return new g(a);if(Array.isArray(a)||"string"===typeof a)return g.iterate(a);
a=w(a);if(a instanceof g)return a;if(a.next)this.next=function(){return a.next()};else if(a.iterate){var b=a.iterate();this.next=function(){return b.next()}}else if("[object Function]"===w.prototype.toString.call(a))this.next=a;else throw new TypeError("Cannot iterate");}function ua(a,b,c){this.array=a;this.start=null==b?0:b;this.end=c}function l(a,b,c){if(!(this instanceof l))return new l(a,b,c);var d=this.head=new this.Node;d.next=d;d.prev=d;this.contentEquals=b||Object.equals;this.content=c||Function.noop;
this.length=0;this.addEach(a)}function Ea(a){this.head=a;this.at=a.next}function ma(a){this.value=a;this.next=this.prev=null}function I(){throw Error("Can't construct. MapChanges is a mixin.");}function s(){throw Error("Can't construct. GenericMap is a mixin.");}function u(a,b){if(!(this instanceof u))return new u(a,b);this.content=b||Function.noop;this.store={};this.length=0;this.addEach(a)}function p(a,b,c,d){if(!(this instanceof p))return new p(a,b,c);b=b||Object.equals;c=c||Object.hash;d=d||Function.noop;
this.contentEquals=b;this.contentHash=c;this.content=d;this.buckets=new this.Buckets(null,this.Bucket);this.length=0;this.addEach(a)}function B(a,b,c,d){if(!(this instanceof B))return new B(a,b,c);b=b||Object.equals;c=c||Object.hash;d=d||Function.noop;this.contentEquals=b;this.contentHash=c;this.content=d;this.store=new Pa(void 0,function(a,c){return b(a.key,c.key)},function(a){return c(a.key)});this.length=0;this.addEach(a)}function o(a,b,c,d){if(!(this instanceof o))return new o(a,b,c);b=b||Object.equals;
c=c||Object.hash;d=d||Function.noop;this.contentEquals=b;this.contentHash=c;this.content=d;this.order=new this.Order(void 0,b);this.store=new this.Store(void 0,function(a,c){return b(a.value,c.value)},function(a){return c(a.value)});this.length=0;this.addEach(a)}function t(a,b,c,d,e){if(!(this instanceof t))return new t(a,b,c,d);b=b||Infinity;c=c||Object.equals;d=d||Object.hash;e=e||Function.noop;this.store=new Qa(void 0,c,d);this.contentEquals=c;this.contentHash=d;this.content=e;this.maxLength=b;
this.length=0;this.addEach(a)}function C(a,b,c,d,e){if(!(this instanceof C))return new C(a,b,c,d);c=c||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentEquals=c;this.contentHash=d;this.content=e;this.store=new Ra(void 0,b,function(a,b){return c(a.key,b.key)},function(a){return d(a.key)});this.length=0;this.addEach(a)}function D(a,b,c,d){if(!(this instanceof D))return new D(a,b,c);b=b||Object.equals;c=c||Object.hash;d=d||Function.noop;this.contentEquals=b;this.contentHash=c;this.content=
d;this.store=new Sa(void 0,function(a,c){return b(a.key,c.key)},function(a){return c(a.key)});this.length=0;this.addEach(a)}function E(a,b,c,d){if(!(this instanceof E))return new E(a,b,c,d);this.bucket=b||this.bucket;va.call(this,a,c,d,function(a){var b=this.bucket();va.prototype.set.call(this,a,b);return b})}function j(a,b,c,d){if(!(this instanceof j))return new j(a,b,c,d);Array.isArray(a)?(this.array=a,a=a.splice(0,a.length)):this.array=[];this.contentEquals=b||Object.equals;this.contentCompare=
c||Object.compare;this.content=d||Function.noop;this.length=0;this.addEach(a)}function na(a,b,c){for(var d=0,e=a.length-1;d<=e;){var f=d+e>>1,k=c(b,a[f]);if(0<k)d=f+1;else if(0>k)e=f-1;else return f}return-(d+1)}function oa(a,b,c,d){c=na(a,b,c);if(0>c)return-1;for(;0<c&&d(b,a[c-1]);)c--;return d(b,a[c])?c:-1}function Fa(a,b,c,d){c=na(a,b,c);if(0>c)return-1;for(;c<a.length-1&&d(b,a[c+1]);)c++;return d(b,a[c])?c:-1}function x(a,b,c,d){if(!(this instanceof x))return new x(a,b,c,d);wa.call(this,a,b,c,
d)}function L(a,b,c,d){if(!(this instanceof L))return new L(a,b,c,d);b=b||Object.equals;c=c||Object.compare;d=d||Function.noop;this.contentEquals=b;this.contentCompare=c;this.content=d;this.store=new Ta(null,function(a,c){return b(a.key,c.key)},function(a,b){return c(a.key,b.key)});this.length=0;this.addEach(a)}function i(a,b,c,d){if(!(this instanceof i))return new i(a,b,c,d);this.contentEquals=b||Object.equals;this.contentCompare=c||Object.compare;this.content=d||Function.noop;this.root=null;this.length=
0;this.addEach(a)}function y(a){this.value=a;this.right=this.left=null;this.length=1}function Ga(a,b,c){this.set=a;this.prev=null;this.end=c;if(b&&(a=this.set.findLeastGreaterThanOrEqual(b)))this.set.splay(a.value),this.prev=a.getPrevious()}function z(a,b,c,d){if(!(this instanceof z))return new z(a,b,c,d);b=b||Object.equals;c=c||Object.compare;d=d||Function.noop;this.contentEquals=b;this.contentCompare=c;this.content=d;this.store=new Ua(null,function(a,c){return b(a.key,c.key)},function(a,b){return c(a.key,
b.key)});this.length=0;this.addEach(a)}var q={};q.module$exports=n;n.prototype.addEach=function(a){if(a&&Object(a)===a)if("function"===typeof a.forEach)a.forEach(this.add,this);else if("number"===typeof a.length)for(var b=0;b<a.length;b++)this.add(a[b],b);else Object.keys(a).forEach(function(b){this.add(a[b],b)},this)};n.prototype.deleteEach=function(a){a.forEach(function(a){this["delete"](a)},this)};n.prototype.forEach=function(a,b){return this.reduce(function(c,d,e,f,k){a.call(b,d,e,f,k)},void 0)};
n.prototype.map=function(a,b){var c=[];this.reduce(function(d,e,f,k,g){c.push(a.call(b,e,f,k,g))},void 0);return c};n.prototype.toArray=function(){return this.map(Function.identity)};n.prototype.toObject=function(){var a={};this.reduce(function(b,c,d){a[d]=c},void 0);return a};n.prototype.filter=function(a,b){var c=this.constructClone();this.reduce(function(d,e,f,k,g){a.call(b,e,f,k,g)&&c.add(e)},void 0);return c};n.prototype.every=function(a,b){return this.reduce(function(c,d,e,f,k){return c&&a.call(b,
d,e,f,k)},!0)};n.prototype.some=function(a,b){return this.reduce(function(c,d,e,f,k){return c||a.call(b,d,e,f,k)},!1)};n.prototype.all=function(){return this.every(Boolean)};n.prototype.any=function(){return this.some(Boolean)};n.prototype.min=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,c){return 0>a(c,b)?c:b},Infinity)};n.prototype.max=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,c){return 0<a(c,b)?c:b},-Infinity)};n.prototype.sum=
function(a){return this.reduce(function(a,c){return a+c},void 0===a?0:a)};n.prototype.average=function(a){var b=void 0===a?0:a,c=void 0===a?0:a;this.reduce(function(a,e){b+=e;c+=1},void 0);return b/c};n.prototype.concat=function(){for(var a=this.constructClone(this),b=0;b<arguments.length;b++)a.addEach(arguments[b]);return a};n.prototype.flatten=function(){var a=this;return this.reduce(function(b,c){c.forEach(function(a){this.push(a)},b,a);return b},[])};n.prototype.zip=function(){var a=Array.prototype.slice.call(arguments);
a.unshift(this);for(var b=[],c=Infinity,d=0;d<a.length;d++){var e=a[d];a[d]=e.toArray();e.length<c&&(c=e.length)}for(d=0;d<a.length;d++)for(var e=a[d],f=0;f<e.length;f++)f<c&&f in e&&(b[f]=b[f]||[],b[f][d]=e[f]);return b};n.prototype.sorted=function(a,b,c){a=a||this.contentCompare||Object.compare;a.by?(b=a.by,a=a.compare||this.contentCompare||Object.compare):b=b||Function.identity;void 0===c&&(c=1);return this.map(function(a){return{by:b(a),value:a}}).sort(function(b,e){return a(b.by,e.by)*c}).map(function(a){return a.value})};
n.prototype.reversed=function(){return this.constructClone(this).reverse()};n.prototype.clone=function(a,b){if(void 0===a)a=Infinity;else if(0===a)return this;var c=this.constructClone();this.forEach(function(d,e){c.add(Object.clone(d,a-1,b),e)},this);return c};n.prototype.only=function(){if(0===this.length)throw Error("Can't get only value in empty collection.");if(1<this.length)throw Error("Can't get only value in collection with multiple values.");return this.one()};q.module$exports&&(q=q.module$exports);
var F={};F.module$exports=R;R.prototype.union=function(a){var b=this.constructClone(this);b.addEach(a);return b};R.prototype.intersection=function(a){return this.constructClone(this.filter(function(b){return a.has(b)}))};R.prototype.difference=function(a){var b=this.constructClone(this);b.deleteEach(a);return b};R.prototype.symmetricDifference=function(a){var b=this.union(a),a=this.intersection(a);return b.difference(a)};R.prototype.equals=function(a,b){var c=this;return Object.can(a,"reduce")&&this.length===
a.length&&a.reduce(function(a,e){return a&&c.has(e,b)},!0)};F.module$exports&&(F=F.module$exports);var aa=q,xa=Object.prototype.toString;Array.isArray||(Array.isArray=function(a){return"[object Array]"==xa.call(a)});Array.prototype.forEach||(Array.prototype.forEach=aa.forEach);Array.prototype.map||(Array.prototype.map=aa.map);Array.prototype.filter||(Array.prototype.filter=aa.filter);Array.prototype.every||(Array.prototype.every=aa.every);Array.prototype.some||(Array.prototype.some=aa.some);Array.prototype.reduce||
(Array.prototype.reduce=function(a){var b=toObject(this),c=b.length>>>0;if("[object Function]"!=xa.call(a))throw new TypeError(a+" is not a function");if(!c&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var d=0,e;if(2<=arguments.length)e=arguments[1];else{do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError("reduce of empty array with no initial value");}while(1)}for(;d<c;d++)d in b&&(e=a.call(void 0,e,b[d],d,b));return e});Array.prototype.reduceRight||
(Array.prototype.reduceRight=function(a){var b=toObject(this),c=b.length>>>0;if("[object Function]"!=xa.call(a))throw new TypeError(a+" is not a function");if(!c&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var d,c=c-1;if(2<=arguments.length)d=arguments[1];else{do{if(c in b){d=b[c--];break}if(0>--c)throw new TypeError("reduceRight of empty array with no initial value");}while(1)}do c in this&&(d=a.call(void 0,d,b[c],c,b));while(c--);return d});Array.prototype.indexOf||
(Array.prototype.indexOf=function(a){var b=toObject(this),c=b.length>>>0;if(!c)return-1;var d=0;1<arguments.length&&(d=toInteger(arguments[1]));for(d=0<=d?d:Math.max(0,c+d);d<c;d++)if(d in b&&b[d]===a)return d;return-1});Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(a){var b=toObject(this),c=b.length>>>0;if(!c)return-1;var d=c-1;1<arguments.length&&(d=Math.min(d,toInteger(arguments[1])));for(d=0<=d?d:c-Math.abs(d);0<=d;d--)if(d in b&&a===b[d])return d;return-1});var pa={};pa.module$exports=
Function;Function.noop=function(){};Function.identity=function(a){return a};Function.by=function(a,b){var b=b||Object.compare,a=a||Function.identity,c=function(c,e){return b(a(c),a(e))};c.compare=b;c.by=a;return c};pa.module$exports&&(pa=pa.module$exports);var S={};S.module$exports=la;la.ascii={intersection:"+",through:"-",branchUp:"+",branchDown:"+",fromBelow:".",fromAbove:"'",fromBoth:"+",strafe:"|"};la.unicodeRound={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u256d",
fromAbove:"\u2570",fromBoth:"\u2523",strafe:"\u2503"};la.unicodeSharp={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u250f",fromAbove:"\u2517",fromBoth:"\u2523",strafe:"\u2503"};S.module$exports&&(S=S.module$exports);var G={},Va=G,ya;if("undefined"!==typeof WeakMap)ya=WeakMap;else{var qa=function(a){a.prototype=null;return Object.freeze(a)},Ha=Object.getOwnPropertyNames,T=Object.defineProperty,za={};Ha(Object).forEach(function(a){za[a]=Object[a]});var ba=
"ident:"+Math.random()+"___";if("undefined"!==typeof crypto&&"function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array){var ra=new ArrayBuffer(25),ra=new Uint8Array(ra);crypto.getRandomValues(ra);ba="rand:"+Array.prototype.map.call(ra,function(a){return(a%36).toString(36)}).join("")+"___"}T(Object,"getOwnPropertyNames",{value:function(a){return Ha(a).filter(function(a){return a!==ba})}});"getPropertyNames"in Object&&T(Object,"getPropertyNames",{value:function(a){return za.getPropertyNames(a).filter(function(a){return a!==
ba})}});var M=function(a){if(a!==Object(a))throw new TypeError("Not an object: "+a);var b=a[ba];if(b&&b.key===a)return b;if(za.isExtensible(a))return b={key:a,gets:[],vals:[]},T(a,ba,{value:b,writable:!1,enumerable:!1,configurable:!1}),b},Wa=Object.freeze;T(Object,"freeze",{value:function(a){M(a);return Wa(a)}});var Xa=Object.seal;T(Object,"seal",{value:function(a){M(a);return Xa(a)}});var Ya=Object.preventExtensions;T(Object,"preventExtensions",{value:function(a){M(a);return Ya(a)}});var Aa=function(){function a(d,
e){var f=M(d),k;f?(k=f.gets.indexOf(a),f=f.vals):(k=b.indexOf(d),f=c);return 0<=k?f[k]:e}var b=[],c=[];return Object.create(Aa.prototype,{get___:{value:qa(a)},has___:{value:qa(function(c){var e=M(c);return 0<=(e?e.gets.indexOf(a):b.indexOf(c))})},set___:{value:qa(function(d,e){var f=M(d),k;f?(k=f.gets.indexOf(a),0<=k?f.vals[k]=e:(f.gets.push(a),f.vals.push(e))):(k=b.indexOf(d),0<=k?c[k]=e:(b.push(d),c.push(e)))})},delete___:{value:qa(function(d){var e=M(d);e?(d=e.gets.indexOf(a),0<=d&&(e.gets.splice(d,
1),e.vals.splice(d,1))):(d=b.indexOf(d),0<=d&&(b.splice(d,1),c.splice(d,1)));return!0})}})};Aa.prototype=Object.create(Object.prototype,{get:{value:function(a,b){return this.get___(a,b)},writable:!0,configurable:!0},has:{value:function(a){return this.has___(a)},writable:!0,configurable:!0},set:{value:function(a,b){this.set___(a,b)},writable:!0,configurable:!0},"delete":{value:function(a){return this.delete___(a)},writable:!0,configurable:!0}});ya=Aa}Va.module$exports=ya;G.module$exports&&(G=G.module$exports);
var r={},Ia=G,Ba=Object.prototype.hasOwnProperty,ca=new Ia,da=new Ia;r.module$exports=h;h.prototype.getOwnPropertyChangeDescriptor=function(a){ca.has(this)||ca.set(this,{});var b=ca.get(this);Ba.call(b,a)||(b[a]={willChangeListeners:[],changeListeners:[]});return b[a]};h.prototype.hasOwnPropertyChangeDescriptor=function(a){if(!ca.has(this))return!1;if(!a)return!0;var b=ca.get(this);return!Ba.call(b,a)?!1:!0};h.prototype.addOwnPropertyChangeListener=function(a,b,c){this.makeObservable&&!this.isObservable&&
this.makeObservable();var d=h.getOwnPropertyChangeDescriptor(this,a),c=c?d.willChangeListeners:d.changeListeners;h.makePropertyObservable(this,a);c.push(b)};h.prototype.addBeforeOwnPropertyChangeListener=function(a,b){return h.addOwnPropertyChangeListener(this,a,b,!0)};h.prototype.removeOwnPropertyChangeListener=function(a,b,c){var d=h.getOwnPropertyChangeDescriptor(this,a),c=c?d.willChangeListeners:d.changeListeners,b=c.lastIndexOf(b);if(-1===b)throw Error("Can't remove listener: does not exist.");
c.splice(b,1);0===d.changeListeners.length+d.willChangeListeners.length&&h.makePropertyUnobservable(this,a)};h.prototype.removeBeforeOwnPropertyChangeListener=function(a,b){return h.removeOwnPropertyChangeListener(this,a,b,!0)};h.prototype.dispatchOwnPropertyChange=function(a,b,c){var d=h.getOwnPropertyChangeDescriptor(this,a),d=c?d.willChangeListeners:d.changeListeners,c=(c?"Will":"")+"Change",e="handleProperty"+c,f=String(a),f=f&&f[0].toUpperCase()+f.slice(1),k="handle"+f+c;d.forEach(function(c){var d=
c,c=c[k]||c[e]||c;c.call&&c.call(d,b,a,this)},this)};h.prototype.dispatchBeforeOwnPropertyChange=function(a,b){return h.dispatchOwnPropertyChange(this,a,b,!0)};h.prototype.makePropertyObservable=function(a){if(!Array.isArray(this)){da.has(this)||(b={},da.set(this,b));var b=da.get(this);if(!Ba.call(b,a)){var c,d=this;Object.getOwnPropertyDescriptor(d,a);do{if(c=Object.getOwnPropertyDescriptor(d,a))break;d=Object.getPrototypeOf(d)}while(d);c=c||{value:void 0,enumerable:!0,writable:!0,configurable:!0};
if(!c.configurable)throw Error("Can't observe non-configurable properties");b[a]=c;if(c.writable||c.set)Object.defineProperty(this,a,"value"in c?{get:function(){return c.value},set:function(b){if(b===c.value)return b;h.dispatchBeforeOwnPropertyChange(this,a,c.value);c.value=b;h.dispatchOwnPropertyChange(this,a,b);return b},enumerable:c.enumerable,configurable:!0}:{get:function(){if(c.get)return c.get.apply(this,arguments)},set:function(b){var d;c.get&&(d=c.get.apply(this,arguments));if(b===d)return b;
h.dispatchBeforeOwnPropertyChange(this,a,d);c.set&&c.set.apply(this,arguments);c.get&&(b=c.get.apply(this,arguments));h.dispatchOwnPropertyChange(this,a,b);return b},enumerable:c.enumerable,configurable:!0})}}};h.prototype.makePropertyUnobservable=function(a){if(!Array.isArray(this)){if(!da.has(this))throw Error("Can't uninstall observer on property");var b=da.get(this);if(!b[a])throw Error("Can't uninstall observer on property");var c=b[a];delete b[a];Object.defineProperty(this,a,c)}};h.getOwnPropertyChangeDescriptor=
function(a,b){return a.getOwnPropertyChangeDescriptor?a.getOwnPropertyChangeDescriptor(b):h.prototype.getOwnPropertyChangeDescriptor.call(a,b)};h.hasOwnPropertyChangeDescriptor=function(a,b){return a.hasOwnPropertyChangeDescriptor?a.hasOwnPropertyChangeDescriptor(b):h.prototype.hasOwnPropertyChangeDescriptor.call(a,b)};h.addOwnPropertyChangeListener=function(a,b,c,d){return a.addOwnPropertyChangeListener?a.addOwnPropertyChangeListener(b,c,d):h.prototype.addOwnPropertyChangeListener.call(a,b,c,d)};
h.removeOwnPropertyChangeListener=function(a,b,c,d){return a.removeOwnPropertyChangeListener?a.removeOwnPropertyChangeListener(b,c,d):h.prototype.removeOwnPropertyChangeListener.call(a,b,c,d)};h.dispatchOwnPropertyChange=function(a,b,c,d){return a.dispatchOwnPropertyChange?a.dispatchOwnPropertyChange(b,c,d):h.prototype.dispatchOwnPropertyChange.call(a,b,c,d)};h.addBeforeOwnPropertyChangeListener=function(a,b,c){return h.addOwnPropertyChangeListener(a,b,c,!0)};h.removeBeforeOwnPropertyChangeListener=
function(a,b,c){return h.removeOwnPropertyChangeListener(a,b,c,!0)};h.dispatchBeforeOwnPropertyChange=function(a,b,c){return h.dispatchOwnPropertyChange(a,b,c,!0)};h.makePropertyObservable=function(a,b){return a.makePropertyObservable?a.makePropertyObservable(b):h.prototype.makePropertyObservable.call(a,b)};h.makePropertyUnobservable=function(a,b){return a.makePropertyUnobservable?a.makePropertyUnobservable(b):h.prototype.makePropertyUnobservable.call(a,b)};r.module$exports&&(r=r.module$exports);
var N={},Ca=new G;N.module$exports=H;H.prototype.getRangeChangeDescriptor=function(){Ca.has(this)||Ca.set(this,{isActive:!1,changeListeners:[],willChangeListeners:[]});return Ca.get(this)};H.prototype.addRangeChangeListener=function(a,b){!this.isObservable&&this.makeObservable&&this.makeObservable();var c=this.getRangeChangeDescriptor();(b?c.willChangeListeners:c.changeListeners).push(a);this.dispatchesRangeChanges=!!(c.willChangeListeners.length+c.changeListeners.length)};H.prototype.removeRangeChangeListener=
function(a,b){var c=this.getRangeChangeDescriptor(),d;d=b?c.willChangeListeners:c.changeListeners;var e=d.lastIndexOf(a);if(-1===e)throw Error("Can't remove listener: does not exist.");d.splice(e,1);this.dispatchesRangeChanges=!!(c.willChangeListeners.length+c.changeListeners.length)};H.prototype.dispatchRangeChange=function(a,b,c,d){var e=this.getRangeChangeDescriptor();if(!e.isActive){e.isActive=!0;var f;f=d?e.willChangeListeners:e.changeListeners;try{f.forEach(function(e){e.handleEvent?e.handleEvent({phase:d?
"before":"after",currentTarget:this,target:this,plus:a,minus:b,index:c}):(e=d?e.handleRangeWillChange||e:e.handleRangeChange||e,e.call&&e.call(this,a,b,c,d))},this)}finally{e.isActive=!1}}};H.prototype.addBeforeRangeChangeListener=function(a){return this.addRangeChangeListener(a,!0)};H.prototype.removeBeforeRangeChangeListener=function(a){return this.removeRangeChangeListener(a,!0)};H.prototype.dispatchBeforeRangeChange=function(a,b,c){return this.dispatchRangeChange(a,b,c,!0)};N.module$exports&&
(N=N.module$exports);var O={},Ja=G;O.module$exports=Object;Object.empty=Object.freeze(Object.create(null));Object.isObject=function(a){return Object(a)===a};Object.getValueOf=function(a){Object.can(a,"valueOf")&&(a=a.valueOf());return a};var Da=new Ja;Object.hash=function(a){return Object.can(a,"hash")?""+a.hash():Object(a)===a?(Da.has(a)||Da.set(a,Math.random().toString(36).slice(2)),Da.get(a)):""+a};var Ka=Object.prototype.hasOwnProperty;Object.owns=function(a,b){return Ka.call(a,b)};Object.can=
function(a,b){return null!=a&&"function"===typeof a[b]&&!Ka.call(a,b)};Object.has=function(a,b){if("object"!==typeof a)throw Error("Object.has can't accept non-object: "+typeof a);if(Object.can(a,"has"))return a.has(b);if("string"===typeof b)return b in a&&a[b]!==Object.prototype[b];throw Error("Key must be a string for Object.has on plain objects");};Object.get=function(a,b,c){if("object"!==typeof a)throw Error("Object.get can't accept non-object: "+typeof a);return Object.can(a,"get")?a.get(b,c):
Object.has(a,b)?a[b]:c};Object.set=function(a,b,c){Object.can(a,"set")?a.set(b,c):a[b]=c};Object.addEach=function(a,b){Object.can(b,"forEach")?"function"===typeof b.keys?b.forEach(function(b,d){a[d]=b}):b.forEach(function(b){a[b[0]]=b[1]}):Object.keys(b).forEach(function(c){a[c]=b[c]})};Object.forEach=function(a,b,c){Object.keys(a).forEach(function(d){b.call(c,a[d],d,a)})};Object.map=function(a,b,c){return Object.keys(a).map(function(d){return b.call(c,a[d],d,a)})};Object.values=function(a){return Object.map(a,
Function.identity)};Object.is=function(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b};Object.equals=function(a,b,c){c=c||Object.equals;a=Object.getValueOf(a);b=Object.getValueOf(b);if(a===b)return 0!==a||1/a===1/b;if(Object.can(a,"equals"))return a.equals(b,c);if(Object.can(b,"equals"))return b.equals(a,c);if("object"===typeof a&&"object"===typeof b){var d=Object.getPrototypeOf(a),e=Object.getPrototypeOf(b);if(d===e&&(d===Object.prototype||null===d)){for(var f in a)if(!c(a[f],b[f]))return!1;for(f in b)if(!c(a[f],
b[f]))return!1;return!0}}return a!==a&&b!==b};Object.compare=function(a,b){var a=Object.getValueOf(a),b=Object.getValueOf(b),c=typeof a;return a===b||c!==typeof b?0:"number"===c?a-b:"string"===c?a<b?-1:1:Object.can(a,"compare")?a.compare(b):Object.can(b,"compare")?-b.compare(a):0};Object.clone=function(a,b,c){a=Object.getValueOf(a);c=c||new Ja;if(void 0===b)b=Infinity;else if(0===b)return a;if(Object.isObject(a)){if(!c.has(a))if(Object.can(a,"clone"))c.set(a,a.clone(b,c));else{var d=Object.getPrototypeOf(a);
if(null===d||d===Object.prototype){d=Object.create(d);c.set(a,d);for(var e in a)d[e]=Object.clone(a[e],b-1,c)}else throw Error("Can't clone "+a);}return c.get(a)}return a};Object.clear=function(a){if(Object.can(a,"clear"))a.clear();else for(var b=Object.keys(a),c=b.length;c;)c--,delete a[b[c]];return a};O.module$exports&&(O=O.module$exports);var U={},La=O;U.module$exports=ta;ta.prototype.equals=function(a,b){b=b||this.contentEquals||La.equals;return this===a?!0:!a?!1:this.length===a.length&&this.zip(a).every(function(a){return b(a[0],
a[1])})};ta.prototype.compare=function(a,b){b=b||this.contentCompare||La.compare;if(this===a)return 0;if(!a)return 1;var c=Math.min(this.length,a.length),d=this.zip(a).reduce(function(a,d,k){return 0===a?k>=c?a:b(d[0],d[1]):a},0);return 0===d?this.length-a.length:d};U.module$exports&&(U=U.module$exports);var ea={};ea.module$exports=g;var w=O;w.addEach(g.prototype,q.prototype);g.prototype.constructClone=function(a){var b=[];Reducible.addEach.call(b,a);return b};g.prototype.mapIterator=function(a,b){var c=
g(this),d=0;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;return new c.constructor(function(){return a.call(b,c.next(),d++,c)})};g.prototype.filterIterator=function(a,b){var c=g(this),d=0;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;return new c.constructor(function(){for(var e;;)if(e=c.next(),a.call(b,e,d++,c))return e})};g.prototype.reduce=function(a){var b=g(this),c=arguments[1],d=arguments[2],e=0,f;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;
try{f=b.next(),c=1<arguments.length?a.call(d,c,f,e,b):f,e++}catch(k){if(isStopIteration(k)){if(1<arguments.length)return arguments[1];throw TypeError("cannot reduce a value from an empty iterator with no initial value");}throw k;}try{for(;;)f=b.next(),c=a.call(d,c,f,e,b),e++}catch(h){if(isStopIteration(h))return c;throw h;}};g.prototype.every=function(a){var b=g(this),c=!0;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(!a)throw c=
!1,StopIteration;});return c};g.prototype.some=function(a){var b=g(this),c=!1;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(a)throw c=!0,StopIteration;});return c};g.prototype.concat=function(){return g.concat(Array.prototype.concat.apply(this,arguments))};g.prototype.dropWhile=function(a,b){var c=g(this),d=!1,e;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;c.forEach(function(f,k){if(!a.call(b,
f,k,c))throw d=!0,e=f,StopIteration;});return d?c.constructor([e]).concat(c):c.constructor([])};g.prototype.takeWhile=function(a,b){var c=g(this);if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;return c.mapIterator(function(d,e){if(!a.call(b,d,e,c))throw StopIteration;return d})};g.prototype.filterIterator=function(a,b){var c=g(this),d=0;if("[object Function]"!=w.prototype.toString.call(a))throw new TypeError;return new c.constructor(function(){for(var e;;)if(e=c.next(),a.call(b,
e,d++,c))return e})};g.prototype.zip=function(){return g.transpose(Array.prototype.concat.apply(this,arguments))};g.prototype.enumerate=function(a){return g.count(a).zip(this)};g.iterate=function(a){var b;b=0;return new g(function(){if("object"===typeof a)for(;!(b in a);){if(b>=a.length)throw StopIteration;b+=1}else if(b>=a.length)throw StopIteration;var c=a[b];b+=1;return c})};g.cycle=function(a,b){2>arguments.length&&(b=Infinity);var c=function(){throw StopIteration;};return new g(function(){var d;
try{return c()}catch(e){if(isStopIteration(e)){if(0>=b)throw e;b--;d=g.iterate(a);c=d.next.bind(d);return c()}throw e;}})};g.concat=function(a){var a=g(a),b=function(){throw StopIteration;};return new g(function(){var c;try{return b()}catch(d){if(isStopIteration(d))return c=g(a.next()),b=c.next.bind(c),b();throw d;}})};g.transpose=function(a){a=g(a).map(g);return 1>a.length?new g([]):new g(function(){var b,c=a.map(function(a){try{return a.next()}catch(c){if(isStopIteration(c))b=!0;else throw c;}});
if(b)throw StopIteration;return c})};g.zip=function(){return g.transpose(Array.prototype.slice.call(arguments))};g.chain=function(){return g.concat(Array.prototype.slice.call(arguments))};g.range=function(a,b,c){3>arguments.length&&(c=1);2>arguments.length&&(b=a,a=0);a=a||0;return new g(function(){if(a>=b)throw StopIteration;if(isNaN(a))throw"";var d=a;a+=c;return d})};g.count=function(a,b){return g.range(a,Infinity,b||1)};g.repeat=function(a,b){2>arguments.length&&(b=Infinity);return(new g.range(+b)).mapIterator(function(){return a})};
"undefined"===typeof isStopIteration&&(m.isStopIteration=function(a){return"[object StopIteration]"===w.prototype.toString.call(a)});if("undefined"===typeof StopIteration){m.StopIteration={};var Za=w.prototype.toString;w.prototype.toString=function(){return this===m.StopIteration||this instanceof m.ReturnValue?"[object StopIteration]":Za.call(this,arguments)}}"undefined"===typeof ReturnValue&&(m.ReturnValue=function(a){if(!(this instanceof m.ReturnValue))return new m.ReturnValue(a);this.value=a});
ea.module$exports&&(ea=ea.module$exports);var sa={},v=q,Ma=U,$a=G;sa.module$exports=Array;Array.empty=[];Object.freeze&&Object.freeze(Array.empty);Array.from=function(a){var b=[];b.addEach(a);return b};Array.prototype.addEach=v.prototype.addEach;Array.prototype.deleteEach=v.prototype.deleteEach;Array.prototype.toArray=v.prototype.toArray;Array.prototype.toObject=v.prototype.toObject;Array.prototype.all=v.prototype.all;Array.prototype.any=v.prototype.any;Array.prototype.min=v.prototype.min;Array.prototype.max=
v.prototype.max;Array.prototype.sum=v.prototype.sum;Array.prototype.average=v.prototype.average;Array.prototype.only=v.prototype.only;Array.prototype.flatten=v.prototype.flatten;Array.prototype.zip=v.prototype.zip;Array.prototype.sorted=v.prototype.sorted;Array.prototype.reversed=v.prototype.reversed;Array.prototype.constructClone=function(a){var b=new this.constructor;b.addEach(a);return b};Array.prototype.has=function(a,b){return-1!==this.find(a,b)};Array.prototype.get=function(a){if(+a!==a)throw Error("Indicies must be numbers");
return this[a]};Array.prototype.set=function(a,b){this.splice(a,1,b);return!0};Array.prototype.add=function(a){this.push(a);return!0};Array.prototype["delete"]=function(a,b){var c=this.find(a,b);return-1!==c?(this.splice(c,1),!0):!1};Array.prototype.find=function(a,b){for(var b=b||this.contentEquals||Object.equals,c=0;c<this.length;c++)if(c in this&&b(this[c],a))return c;return-1};Array.prototype.findLast=function(a,b){var b=b||this.contentEquals||Object.equals,c=this.length;do if(c--,c in this&&
b(this[c],a))return c;while(0<c);return-1};Array.prototype.swap=function(a,b,c){var d=Array.prototype.slice.call(arguments,0,2);c&&d.push.apply(d,c);return this.splice.apply(this,d)};Array.prototype.one=function(){if(0===this.length)throw Error("Can't get one element from empty array.");for(var a in this)if(Object.owns(this,a))return this[a]};Array.prototype.clear=function(){this.length=0;return this};Array.prototype.compare=function(a,b){var b=b||Object.compare,c,d,e,f;if(this===a)return 0;if(!a||
!Array.isArray(a))return Ma.prototype.compare.call(this,a,b);d=Math.min(this.length,a.length);for(c=0;c<d;c++)if(c in this)if(c in a){if(e=this[c],f=a[c],e=b(e,f))return e}else return-1;else if(c in a)return 1;return this.length-a.length};Array.prototype.equals=function(a){var b=b||Object.equals,c=0,d=this.length,e,f;if(this===a)return!0;if(!a||!Array.isArray(a))return Ma.prototype.equals.call(this,a);if(d!==a.length)return!1;for(;c<d;++c)if(c in this){if(e=this[c],f=a[c],e!==f&&e&&f&&!b(e,f))return!1}else if(c in
a)return!1;return!0};Array.prototype.clone=function(a,b){if(void 0===a)a=Infinity;else if(0===a)return this;var b=b||new $a,c=[],d;for(d in this)Object.owns(this,d)&&(c[d]=Object.clone(this[d],a-1,b));return c};Array.prototype.iterate=function(a,b){return new ua(this,a,b)};Array.prototype.Iterator=ua;ua.prototype.next=function(){if(this.start===(null==this.end?this.array.length:this.end))throw StopIteration;return this.array[this.start++]};sa.module$exports&&(sa=sa.module$exports);var J={};J.module$exports=
l;var ab=U,bb=r;Object.addEach(l.prototype,q.prototype);Object.addEach(l.prototype,ab.prototype);Object.addEach(l.prototype,bb.prototype);l.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.content)};l.prototype.find=function(a,b){for(var b=b||this.contentEquals,c=this.head,d=c.next;d!==c;){if(b(d.value,a))return d;d=d.next}};l.prototype.findLast=function(a,b){for(var b=b||this.contentEquals,c=this.head,d=c.prev;d!==c;){if(b(d.value,a))return d;d=d.prev}};
l.prototype.has=function(a,b){return!!this.find(a,b)};l.prototype.get=function(a,b){var c=this.find(a,b);return c?c.value:this.content()};l.prototype["delete"]=function(a,b){var c=this.findLast(a,b);return c?(c["delete"](),this.length--,!0):!1};l.prototype.clear=function(){this.head.next=this.head.prev=this.head;this.length=0};l.prototype.add=function(a){this.head.addBefore(new this.Node(a));this.length++;return!0};l.prototype.push=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=
new this.Node(arguments[b]);a.addBefore(c);this.length++}};l.prototype.unshift=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=new this.Node(arguments[b]);a.addAfter(c);this.length++;a=c}};l.prototype.pop=function(){var a,b=this.head;b.prev!==b&&(a=b.prev.value,b.prev["delete"](),this.length--);return a};l.prototype.shift=function(){var a,b=this.head;b.prev!==b&&(a=b.next.value,b.next["delete"](),this.length--);return a};l.prototype.scan=function(a,b){var c=this.head;if("number"===
typeof a){var d=a;if(0<=d)for(a=c.next;d&&!(d--,a=a.next,a==c););else for(a=c;0>d&&!(d++,a=a.prev,a==c););return a}return a||b};l.prototype.slice=function(a,b){for(var c=[],d=this.head,a=this.scan(a,d.next),b=this.scan(b,d);a!==b&&a!==d;)c.push(a.value),a=a.next;return c};l.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,2))};l.prototype.swap=function(a,b,c){var d=[],e=a,a=this.scan(a,this.head);for(void 0===b&&(b=Infinity);b--&&0<=b&&a!==this.head;)d.push(a.value),
a["delete"](),a=a.next,this.length--;if(c){null===e&&a===this.head&&(a=this.head.next);for(b=0;b<c.length;b++)e=new this.Node(c[b]),a.addBefore(e);this.length+=c.length}return d};l.prototype.reverse=function(){var a=this.head;do{var b=a.next;a.next=a.prev;a.prev=b;a=a.next}while(a!==this.head);return this};l.prototype.reduce=function(a,b,c){for(var d=this.head,e=d.next;e!==d;)b=a.call(c,b,e.value,e,this),e=e.next;return b};l.prototype.reduceRight=function(a,b,c){for(var d=this.head,e=d.prev;e!==d;)b=
a.call(c,b,e.value,e,this),e=e.prev;return b};l.prototype.one=function(){if(this.head===this.head.next)throw Error("Can't get one value from empty list");return this.head.next.value};l.prototype.iterate=function(){return new Ea(this.head)};Ea.prototype.next=function(){if(this.at===this.head)throw StopIteration;var a=this.at.value;this.at=this.at.next;return a};l.prototype.Node=ma;ma.prototype["delete"]=function(){this.prev.next=this.next;this.next.prev=this.prev};ma.prototype.addBefore=function(a){var b=
this.prev;this.prev=a;a.prev=b;b.next=a;a.next=this};ma.prototype.addAfter=function(a){var b=this.next;this.next=a;a.next=b;b.prev=a;a.prev=this};J.module$exports&&(J=J.module$exports);var fa={},Na=J;fa.module$exports=I;I.prototype.getMapChangeDescriptor=function(){this.mapChangeDescriptor||(this.mapChangeDescriptor={willChangeListeners:new Na,changeListeners:new Na});return this.mapChangeDescriptor};I.prototype.addMapChangeListener=function(a,b){this.makeObservable&&!this.dispatchMapChanges&&this.makeObservable();
var c=this.getMapChangeDescriptor();(b?c.willChangeListeners:c.changeListeners).push(a);this.dispatchesMapChanges=!0};I.prototype.removeMapChangeListener=function(a,b){var c=this.getMapChangeDescriptor(),c=(b?c.willChangeListeners:c.changeListeners).findLast(a);if(!c)throw Error("Can't remove listener: does not exist.");c["delete"]()};I.prototype.dispatchMapChange=function(a,b,c){var d=this.getMapChangeDescriptor(),e="handleMap"+((c?"Will":"")+"Change");(c?d.willChangeListeners:d.changeListeners).forEach(function(c){var d=
c,c=c[e]||c;c.call&&c.call(d,b,a,this)},this)};I.prototype.addBeforeMapChangeListener=function(a){return this.addMapChangeListener(a,!0)};I.prototype.removeBeforeMapChangeListener=function(a){return this.removeMapChangeListener(a,!0)};I.prototype.dispatchBeforeMapChange=function(a,b){return this.dispatchMapChange(a,b,!0)};fa.module$exports&&(fa=fa.module$exports);var A={},K=O,cb=fa,db=r;A.module$exports=s;K.addEach(s.prototype,cb.prototype);K.addEach(s.prototype,db.prototype);s.prototype.addEach=
function(a){a&&K(a)===a&&("function"===typeof a.forEach?"function"===typeof a.keys?a.forEach(function(a,c){this.set(c,a)},this):a.forEach(function(a){this.set(a[0],a[1])},this):K.keys(a).forEach(function(b){this.set(b,a[b])},this))};s.prototype.get=function(a,b){var c=this.store.get(new this.Item(a));return c?c.value:1<arguments.length?b:this.content(a)};s.prototype.set=function(a,b){var c=new this.Item(a,b),d=this.store.get(c),e=!1;d?(this.dispatchesMapChanges&&this.dispatchBeforeMapChange(a,d.value),
d.value=b):(this.dispatchesMapChanges&&this.dispatchBeforeMapChange(a,void 0),this.store.add(c)&&(this.length++,e=!0));this.dispatchesMapChanges&&this.dispatchMapChange(a,b);return e};s.prototype.add=function(a,b){return this.set(b,a)};s.prototype.has=function(a){return this.store.has(new this.Item(a))};s.prototype["delete"]=function(a){var b=new this.Item(a);if(this.store.has(b)){var c=this.store.get(b).value;this.dispatchesMapChanges&&this.dispatchBeforeMapChange(a,c);this.store["delete"](b);this.length--;
this.dispatchesMapChanges&&this.dispatchMapChange(a,void 0);return!0}return!1};s.prototype.clear=function(){this.store.clear();this.length=0};s.prototype.reduce=function(a,b,c){return this.store.reduce(function(b,e){return a.call(c,b,e.value,e.key,this)},b,this)};s.prototype.reduceRight=function(a,b,c){return this.store.reduceRight(function(b,e){return a.call(c,b,e.value,e.key,this)},b,this)};s.prototype.keys=function(){return this.map(function(a,b){return b})};s.prototype.values=function(){return this.map(Function.identity)};
s.prototype.items=function(){return this.map(function(a,b){return[b,a]})};s.prototype.equals=function(a,b){b=b||K.equals;return this===a?!0:K.can(a,"every")?a.length===this.length&&a.every(function(a,d){return b(this.get(d),a)},this):K.keys(a).length===this.length&&K.keys(a).every(function(c){return b(this.get(c),a[c])},this)};s.prototype.Item=function(a,b){this.key=a;this.value=b};A.module$exports&&(A=A.module$exports);var V={},eb=q,fb=A,gb=r;V.module$exports=u;Object.addEach(u.prototype,eb.prototype);
Object.addEach(u.prototype,fb.prototype);Object.addEach(u.prototype,gb.prototype);u.prototype.constructClone=function(a){return new this.constructor(a,this.mangle,this.content)};u.prototype.assertString=function(a){if("string"!==typeof a)throw new TypeError("key must be a string.");};u.prototype.get=function(a,b){this.assertString(a);var c="~"+a;return c in this.store?this.store[c]:1<arguments.length?b:this.content()};u.prototype.set=function(a,b){this.assertString(a);var c="~"+a;if(c in this.store)return this.store[c]=
b,!1;this.length++;this.store[c]=b;return!0};u.prototype.has=function(a){this.assertString(a);return"~"+a in this.store};u.prototype["delete"]=function(a){this.assertString(a);return"~"+a in this.store?(delete this.store["~"+a],this.length--,!0):!1};u.prototype.clear=function(){for(var a in this.store)delete this.store[a];this.length=0};u.prototype.reduce=function(a,b,c){for(var d in this.store)b=a.call(c,b,this.store[d],d.slice(1),this);return b};u.prototype.one=function(){for(var a in this.store)return this.store[a];
throw Error("Can't get one value from empty dictionary.");};V.module$exports&&(V=V.module$exports);var P={},hb=V,ib=J,jb=q,kb=F,lb=S,mb=r;P.module$exports=p;Object.addEach(p.prototype,jb.prototype);Object.addEach(p.prototype,kb.prototype);Object.addEach(p.prototype,mb.prototype);p.prototype.Buckets=hb;p.prototype.Bucket=ib;p.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};p.prototype.has=function(a){var b=this.contentHash(a);return this.buckets.get(b).has(a)};
p.prototype.get=function(a){var b=this.contentHash(a),c=this.buckets;return c.has(b)?c.get(b).get(a):this.content(a)};p.prototype["delete"]=function(a){var b=this.contentHash(a),c=this.buckets;if(c.has(b)){var d=c.get(b);if(d["delete"](a)){this.length--;if(0===d.length)c["delete"](b);return!0}}return!1};p.prototype.clear=function(){this.buckets.clear();this.length=0};p.prototype.add=function(a){var b=this.contentHash(a),c=this.buckets;c.has(b)||c.set(b,new this.Bucket(null,this.contentEquals));return!c.get(b).has(a)?
(c.get(b).add(a),this.length++,!0):!1};p.prototype.reduce=function(a,b,c){return this.buckets.reduce(function(b,e){return e.reduce(function(b,d){return a.call(c,b,d,d,this)},b,this)},b,this)};p.prototype.one=function(){if(0===this.length)throw Error("Can't get one value from empty set.");return this.buckets.one().one()};p.prototype.iterate=function(){return this.buckets.values().flatten().iterate()};p.prototype.log=function(a,b,c,d){a=a||lb.unicodeSharp;b=b||this.logNode;c||(c=console.log,d=console);
var c=c.bind(d),e=this.buckets,f=e.keys();f.forEach(function(g,h){var i,j;h===f.length-1?(i=a.fromAbove,j=" "):(i=0===h?a.branchDown:a.fromBoth,j=a.strafe);var l=e.get(g);c.call(d,i+a.through+a.branchDown+" "+g);l.forEach(function(e,f){var g,k;if(f===l.head.prev){g=a.fromAbove;k=" "}else{g=a.fromBoth;k=a.strafe}var h;b(f,function(b){if(h)c.call(d,j+" "+k+" "+b);else{c.call(d,j+" "+g+a.through+a.through+b);h=true}},function(b){c.call(d,j+" "+a.strafe+" "+b)})})})};p.prototype.logNode=function(a,
b){var c=a.value;Object(c)===c?JSON.stringify(c,null,4).split("\n").forEach(function(a){b(" "+a)}):b(" "+c)};P.module$exports&&(P=P.module$exports);var ga={},Pa=P,nb=q,ob=A,pb=r;ga.module$exports=B;Object.addEach(B.prototype,nb.prototype);Object.addEach(B.prototype,ob.prototype);Object.addEach(B.prototype,pb.prototype);B.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};B.prototype.log=function(a,b){b=b||this.stringify;this.store.log(a,
b)};B.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};ga.module$exports&&(ga=ga.module$exports);var Q={},qb=J,rb=P,sb=q,tb=F,ub=r,vb=N;Q.module$exports=o;Object.addEach(o.prototype,sb.prototype);Object.addEach(o.prototype,tb.prototype);Object.addEach(o.prototype,ub.prototype);Object.addEach(o.prototype,vb.prototype);o.prototype.Order=qb;o.prototype.Store=rb;o.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,
this.content)};o.prototype.has=function(a){a=new this.order.Node(a);return this.store.has(a)};o.prototype.get=function(a){var b=new this.order.Node(a);return(b=this.store.get(b))?b.value:this.content(a)};o.prototype.add=function(a){var b=new this.order.Node(a);return!this.store.has(b)?(this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([a],[],0),this.order.add(a),b=this.order.head.prev,this.store.add(b),this.length++,this.dispatchesRangeChanges&&this.dispatchRangeChange([a],[],0),!0):!1};
o.prototype["delete"]=function(a){var b=new this.order.Node(a);return this.store.has(b)?(this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([],[a],0),b=this.store.get(b),this.store["delete"](b),b["delete"](),this.length--,this.dispatchesRangeChanges&&this.dispatchRangeChange([],[a],0),!0):!1};o.prototype.one=function(){if(0===this.length)throw Error("Can't get one value from empty set.");return this.store.one().value};o.prototype.clear=function(){this.store.clear();this.order.clear();this.length=
0};o.prototype.reduce=function(a,b,c){return this.order.reduce(function(b,e){return a.call(c,b,e,e,this)},b,this)};o.prototype.reduceRight=function(a,b,c){return this.order.reduceRight(function(b,e){return a.call(c,b,e,e,this)},b,this)};o.prototype.iterate=function(){return this.order.iterate()};o.prototype.log=function(){var a=this.store;return a.log.apply(a,arguments)};Q.module$exports&&(Q=Q.module$exports);var W={},Qa=Q,wb=q,xb=F,yb=r;W.module$exports=t;Object.addEach(t.prototype,wb.prototype);
Object.addEach(t.prototype,xb.prototype);Object.addEach(t.prototype,yb.prototype);t.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};t.prototype.has=function(a){return this.store.has(a)};t.prototype.get=function(a){a=this.store.get(a);void 0!==a?(this.store["delete"](a),this.store.add(a)):a=this.content();return a};t.prototype.add=function(a){this.store.has(a)&&(this.store["delete"](a),this.length--);this.store.add(a);
this.length++;return this.store.length>this.maxLength?(this.store["delete"](this.store.order.head.next.value),this.length--,!1):!0};t.prototype["delete"]=function(a){return this.store["delete"](a)?(this.length--,!0):!1};t.prototype.one=function(){if(0===this.length)throw Error("Can't get one value from empty collection.");return this.store.one()};t.prototype.clear=function(){this.store.clear();this.length=0};t.prototype.reduce=function(a,b,c){return this.store.reduce(function(b,e){return a.call(c,
b,e,e,this)},b,this)};t.prototype.reduceRight=function(a,b,c){return this.store.reduceRight(function(a,b){return callback.call(c,a,b,b,this)},basis,this)};t.prototype.iterate=function(){return this.store.iterate()};W.module$exports&&(W=W.module$exports);var ha={},Ra=W,zb=q,Ab=A,Bb=r;ha.module$exports=C;Object.addEach(C.prototype,zb.prototype);Object.addEach(C.prototype,Ab.prototype);Object.addEach(C.prototype,Bb.prototype);C.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,
this.contentEquals,this.contentHash,this.content)};C.prototype.log=function(a,b){b=b||this.stringify;this.store.log(a,b)};C.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};ha.module$exports&&(ha=ha.module$exports);var X={},Sa=Q,Cb=q,Db=A,Eb=r;X.module$exports=D;Object.addEach(D.prototype,Cb.prototype);Object.addEach(D.prototype,Db.prototype);Object.addEach(D.prototype,Eb.prototype);D.prototype.constructClone=function(a){return new this.constructor(a,
this.contentEquals,this.contentHash,this.content)};D.prototype.log=function(a,b){b=b||this.stringify;this.store.log(a,b)};D.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};X.module$exports&&(X=X.module$exports);var ia={},va=X;ia.module$exports=E;E.prototype=Object.create(va.prototype);E.prototype.constructor=E;E.prototype.constructClone=function(a){return new this.constructor(a,this.bucket,this.contentEquals,this.contentHash)};E.prototype.set=function(a,
b){var c=this.get(a);c.swap(0,c.length,b)};E.prototype.bucket=function(){return[]};ia.module$exports&&(ia=ia.module$exports);var Y={};Y.module$exports=j;var Fb=r,Gb=N;Object.addEach(j.prototype,q.prototype);Object.addEach(j.prototype,Fb.prototype);Object.addEach(j.prototype,Gb.prototype);j.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};j.prototype.has=function(a){var b=na(this.array,a,this.contentCompare);return 0<=b&&this.contentEquals(this.array[b],
a)};j.prototype.get=function(a){var b=oa(this.array,a,this.contentCompare,this.contentEquals);return-1!==b?this.array[b]:this.content(a)};j.prototype.add=function(a){var b;b=this.array;var c=this.contentCompare,d=na(b,a,c);if(0>d)b=-d-1;else{for(var e=b.length-1;d<e&&0===c(a,b[d+1]);)d++;b=d}this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([a],[],b);this.array.splice(b,0,a);this.length++;this.dispatchesRangeChanges&&this.dispatchRangeChange([a],[],b);return!0};j.prototype["delete"]=function(a){var b=
oa(this.array,a,this.contentCompare,this.contentEquals);return-1!==b?(this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([],[a],b),this.array.splice(b,1),this.length--,this.dispatchesRangeChanges&&this.dispatchRangeChange([],[a],b),!0):!1};j.prototype.indexOf=function(a){return oa(this.array,a,this.contentCompare,this.contentEquals)};j.prototype.lastIndexOf=function(a){return Fa(this.array,a,this.contentCompare,this.contentEquals)};j.prototype.find=function(a){return oa(this.array,a,this.contentCompare,
this.contentEquals)};j.prototype.findLast=function(a){return Fa(this.array,a,this.contentCompare,this.contentEquals)};j.prototype.push=function(){this.addEach(arguments)};j.prototype.unshift=function(){this.addEach(arguments)};j.prototype.pop=function(){return this.array.pop()};j.prototype.shift=function(){return this.array.shift()};j.prototype.slice=function(){return this.array.slice.apply(this.array,arguments)};j.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,
2))};j.prototype.swap=function(a,b,c){if(void 0===a&&void 0===b)return[];a=a||0;0>a&&(a+=this.length);void 0===b&&(b=Infinity);var d=this.slice(a,a+b);this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange(c,d,a);this.array.splice(a,b);this.addEach(c);this.dispatchesRangeChanges&&this.dispatchRangeChange(c,d,a);return d};j.prototype.reduce=function(a,b,c){return this.array.reduce(function(b,e,f){return a.call(c,b,e,f,this)},b,this)};j.prototype.reduceRight=function(a,b,c){return this.array.reduceRight(function(a,
b,f){return callback.call(c,a,b,f,this)},basis,this)};j.prototype.min=function(){if(this.length)return this.array[0]};j.prototype.max=function(){if(this.length)return this.array[this.length-1]};j.prototype.one=function(){return this.array.one()};j.prototype.clear=function(){var a;this.dispatchesRangeChanges&&(a=this.array.slice(),this.dispatchBeforeRangeChange([],a,0));this.length=0;this.array.clear();this.dispatchesRangeChanges&&this.dispatchRangeChange([],a,0)};j.prototype.equals=function(a,b){return this.array.equals(a,
b)};j.prototype.compare=function(a,b){return this.array.compare(a,b)};j.prototype.iterate=function(a,b){return new this.Iterator(this.array,a,b)};j.prototype.Iterator=Array.prototype.Iterator;Y.module$exports&&(Y=Y.module$exports);var Z={};Z.module$exports=x;var wa=Y,Hb=F,Ib=r;x.prototype=Object.create(wa.prototype);x.prototype.constructor=x;Object.addEach(x.prototype,Hb.prototype);Object.addEach(x.prototype,Ib.prototype);x.prototype.add=function(a){if(this.has(a))return!1;wa.prototype.add.call(this,
a);return!0};x.prototype.reduce=function(a,b,c){var d=this;return this.array.reduce(function(b,f,g){return a.call(c,b,f,f,d,g)},b)};x.prototype.reduceRight=function(a,b,c){var d=this;return this.array.reduceRight(function(b,f,g){return a.call(c,b,f,f,d,g)},b)};Z.module$exports&&(Z=Z.module$exports);var ja={},Ta=Z,Jb=q,Kb=A,Lb=r;ja.module$exports=L;Object.addEach(L.prototype,Jb.prototype);Object.addEach(L.prototype,Kb.prototype);Object.addEach(L.prototype,Lb.prototype);L.prototype.constructClone=function(a){return new this.constructor(a,
this.contentEquals,this.contentCompare,this.content)};ja.module$exports&&(ja=ja.module$exports);var $={};$.module$exports=i;var Mb=F,Nb=r,Ob=N,Oa=S;Object.addEach(i.prototype,q.prototype);Object.addEach(i.prototype,Mb.prototype);Object.addEach(i.prototype,Nb.prototype);Object.addEach(i.prototype,Ob.prototype);i.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};i.prototype.has=function(a){return this.root?(this.splay(a),this.contentEquals(a,
this.root.value)):!1};i.prototype.get=function(a){return this.root&&(this.splay(a),this.contentEquals(a,this.root.value))?this.root.value:this.content(a)};i.prototype.add=function(a){var b=new this.Node(a);if(this.root){if(this.splay(a),!this.contentEquals(a,this.root.value))return this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([a],[],this.root.index),0>this.contentCompare(a,this.root.value)?(b.right=this.root,b.left=this.root.left,this.root.left=null):(b.left=this.root,b.right=this.root.right,
this.root.right=null),this.root.touch(),b.touch(),this.root=b,this.length++,this.dispatchesRangeChanges&&this.dispatchRangeChange([a],[],this.root.index),!0}else return this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([a],[],0),this.root=b,this.length++,this.dispatchesRangeChanges&&this.dispatchRangeChange([a],[],0),!0;return!1};i.prototype["delete"]=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value))){var b=this.root.index;this.dispatchesRangeChanges&&this.dispatchBeforeRangeChange([],
[a],b);if(this.root.left){var c=this.root.right;this.root=this.root.left;this.splay(a);this.root.right=c}else this.root=this.root.right;this.length--;this.root&&this.root.touch();this.dispatchesRangeChanges&&this.dispatchRangeChange([],[a],b);return!0}return!1};i.prototype.indexOf=function(a){return this.root&&(this.splay(a),this.contentEquals(a,this.root.value))?this.root.index:-1};i.prototype.find=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value)))return this.root};
i.prototype.findGreatest=function(a){if(this.root){for(a=a||this.root;a.right;)a=a.right;return a}};i.prototype.findLeast=function(a){if(this.root){for(a=a||this.root;a.left;)a=a.left;return a}};i.prototype.findGreatestLessThanOrEqual=function(a){if(this.root)return this.splay(a),this.root};i.prototype.findGreatestLessThan=function(a){if(this.root)return this.splay(a),this.root.getPrevious()};i.prototype.findLeastGreaterThanOrEqual=function(a){if(this.root)return this.splay(a),0===this.contentCompare(a,
this.root.value)?this.root:this.root.getNext()};i.prototype.findLeastGreaterThan=function(a){if(this.root)return this.splay(a),this.contentCompare(a,this.root.value),this.root.getNext()};i.prototype.pop=function(){if(this.root){var a=this.findGreatest();this["delete"](a.value);return a.value}};i.prototype.shift=function(){if(this.root){var a=this.findLeast();this["delete"](a.value);return a.value}};i.prototype.push=function(){this.addEach(arguments)};i.prototype.unshift=function(){this.addEach(arguments)};
i.prototype.slice=function(a,b){a=a||0;b=b||this.length;0>a&&(a+=this.length);0>b&&(b+=this.length);var c=[];if(this.root)for(this.splayIndex(a);this.root.index<b;){c.push(this.root.value);if(!this.root.right)break;this.splay(this.root.getNext().value)}return c};i.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,2))};i.prototype.swap=function(a,b,c){if(void 0===a&&void 0===b)return[];a=a||0;0>a&&(a+=this.length);void 0===b&&(b=Infinity);var d=[];if(this.root){this.splayIndex(a);
for(a=0;a<b;a++){d.push(this.root.value);var e=this.root.getNext();this["delete"](this.root.value);if(!e)break;this.splay(e.value)}}this.addEach(c);return d};i.prototype.splay=function(a){var b,c,d,e,f,g;if(this.root){b=c=d=new this.Node;g=new this.Node;for(f=this.root;;)if(e=this.contentCompare(a,f.value),0>e)if(f.left){if(0>this.contentCompare(a,f.left.value)&&(e=f.left,f.left=e.right,f.touch(),e.right=f,e.touch(),f=e,!f.left))break;e=new y;e.right=f;e.left=g.left;g.left=e;d.left=f;d.touch();d=
f;f=f.left}else break;else if(0<e)if(f.right){if(0<this.contentCompare(a,f.right.value)&&(e=f.right,f.right=e.left,f.touch(),e.left=f,e.touch(),f=e,!f.right))break;e=new y;e.left=f;e.right=g.right;g.right=e;c.right=f;c.touch();c=f;f=f.right}else break;else break;c.right=f.left;c.touch();d.left=f.right;d.touch();f.left=b.right;for(f.right=b.left;g.left;)g.left.right.touch(),g.left=g.left.left;for(;g.right;)g.right.left.touch(),g.right=g.right.right;f.touch();this.root=f}};i.prototype.splayIndex=function(a){if(this.root){for(var b=
this.root,c=this.root.index;c!==a;)if(c>a&&b.left)b=b.left,c-=1+(b.right?b.right.length:0);else if(c<a&&b.right)b=b.right,c+=1+(b.left?b.left.length:0);else break;this.splay(b.value);return this.root.index===a}return!1};i.prototype.reduce=function(a,b,c){this.root&&(b=this.root.reduce(a,b,c,this));return b};i.prototype.reduceRight=function(a,b,c){this.root&&(b=this.root.reduceRight(a,b,c,this));return b};i.prototype.min=function(a){if(a=this.findLeast(a))return a.value};i.prototype.max=function(a){if(a=
this.findGreatest(a))return a.value};i.prototype.one=function(){if(!this.root)throw Error("Can't get one value from empty set");return this.root.value};i.prototype.clear=function(){var a;this.dispatchesRangeChanges&&(a=this.toArray(),this.dispatchBeforeRangeChange([],a,0));this.root=null;this.length=0;this.dispatchesRangeChanges&&this.dispatchRangeChange([],a,0)};i.prototype.iterate=function(a,b){return new this.Iterator(this,a,b)};i.prototype.Iterator=Ga;i.prototype.summary=function(){return this.root?
this.root.summary():"()"};i.prototype.log=function(a,b,c,d){a=a||Oa.unicodeRound;b=b||this.logNode;c||(c=console.log,d=console);c=c.bind(d);this.root&&this.root.log(a,b,c,c)};i.prototype.logNode=function(a,b){b(" "+a.value)};i.logCharsets=Oa;i.prototype.Node=y;y.prototype.reduce=function(a,b,c,d,e){e=e||0;this.left&&(b=this.left.reduce(a,b,c,d,e+1));b=a.call(c,b,this.value,this.value,d,this,e);this.right&&(b=this.right.reduce(a,b,c,d,e+1));return b};y.prototype.reduceRight=function(a,b,c,d,e){e=e||
0;this.right&&(b=this.right.reduce(a,b,c,d,e+1));b=a.call(c,b,this.value,this.value,d,this,e);this.left&&(b=this.left.reduce(a,b,c,d,e+1));return b};y.prototype.touch=function(){this.length=1+(this.left?this.left.length:0)+(this.right?this.right.length:0);this.index=this.left?this.left.length:0};y.prototype.checkIntegrity=function(){var a;a=1+(this.left?this.left.checkIntegrity():0);a+=this.right?this.right.checkIntegrity():0;if(this.length!==a)throw Error("Integrity check failed: "+this.summary());
return a};y.prototype.getNext=function(){var a=this;if(a.right){for(a=a.right;a.left;)a=a.left;return a}};y.prototype.getPrevious=function(){var a=this;if(a.left){for(a=a.left;a.right;)a=a.right;return a}};y.prototype.summary=function(){var a=this.value||"-",a=a+(" <"+this.length);return!this.left&&!this.right?"("+a+")":"("+a+" "+(this.left?this.left.summary():"()")+", "+(this.right?this.right.summary():"()")+")"};y.prototype.log=function(a,b,c,d){var e=this,f;f=this.left&&this.right?a.intersection:
this.left?a.branchUp:this.right?a.branchDown:a.through;var g;this.left&&this.left.log(a,b,function(b){g?d(a.strafe+" "+b):(g=!0,d(a.fromBelow+a.through+b))},function(a){d(" "+a)});var h;b(this,function(b){h?c((e.right?a.strafe:" ")+b):(h=!0,c(f+b))},function(b){d((e.left?a.strafe:" ")+b)});var i;this.right&&this.right.log(a,b,function(b){i?c(" "+b):(i=!0,c(a.fromAbove+a.through+b))},function(b){c(a.strafe+" "+b)})};Ga.prototype.next=function(){var a;a=this.prev?this.set.findLeastGreaterThan(this.prev.value):
this.set.findLeast();if(!a)throw StopIteration;if(void 0!==this.end&&0<=this.set.contentCompare(a.value,this.end))throw StopIteration;this.prev=a;return a.value};$.module$exports&&($=$.module$exports);var ka={},Ua=$,Pb=q,Qb=A,Rb=r;ka.module$exports=z;Object.addEach(z.prototype,Pb.prototype);Object.addEach(z.prototype,Qb.prototype);Object.addEach(z.prototype,Rb.prototype);z.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};z.prototype.log=
function(a,b){b=b||this.stringify;this.store.log(a,b)};z.prototype.report=function(a,b,c,d){d=d||this.stringify;this.store.report(a,b,c,d)};z.prototype.stringify=function(a,b,c,d){a.call(b,d+" "+c.value.key+": "+c.value.value)};ka.module$exports&&(ka=ka.module$exports);m.List=J;m.Set=Q;m.Map=X;m.MultiMap=ia;m.WeakMap=G;m.SortedSet=$;m.SortedMap=ka;m.LruSet=W;m.LruMap=ha;m.SortedArray=Y;m.SortedArraySet=Z;m.SortedArrayMap=ja;m.FastSet=P;m.FastMap=ga;m.Dict=V;m.Iterator=ea})(this);