Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More collection coverage

Consolidate object, operators, and hash into the object shims.

Fix an issue with WeakMap shim in Safari.

Fix a bug with observing before list content changes.
  • Loading branch information...
commit c213453b2bfaf21f28668364efa2904877b7525b 1 parent 17086b4
@kriskowal authored
Showing with 666 additions and 347 deletions.
  1. +17 −28 README.md
  2. +9 −4 array.js
  3. +157 −0 collections.cat.js
  4. +14 −13 collections.js
  5. +92 −89 collections.min.js
  6. +0 −1  demo/all.js
  7. +0 −11 demo/hash-demo.js
  8. +2 −2 dict.js
  9. +4 −4 fast-map.js
  10. +4 −4 fast-set.js
  11. +0 −17 hash.js
  12. +0 −2  iterator.js
  13. +20 −4 list.js
  14. +4 −4 lru-map.js
  15. +5 −4 lru-set.js
  16. +4 −4 map.js
  17. +5 −5 minify
  18. +0 −1  multi-map.js
  19. +44 −48 object.js
  20. +0 −57 operators.js
  21. +6 −6 reducible.js
  22. +4 −4 set.js
  23. +4 −4 sorted-map.js
  24. +4 −4 sorted-set.js
  25. +5 −0 spec/array-spec.js
  26. +83 −0 spec/collection.js
  27. +10 −0 spec/dict-spec.js
  28. +1 −1  spec/dict.js
  29. +2 −0  spec/fast-map-spec.js
  30. +10 −0 spec/fast-set-spec.js
  31. +11 −0 spec/list-spec.js
  32. +2 −0  spec/lru-map-spec.js
  33. +18 −0 spec/lru-set-spec.js
  34. +3 −0  spec/map-spec.js
  35. +54 −0 spec/map.js
  36. +17 −0 spec/set-spec.js
  37. +39 −0 spec/sorted-set-spec.js
  38. +12 −26 weak-map.js
View
45 README.md
@@ -86,52 +86,41 @@ in a map collection, the the values are taken, but the keys are ignored.
The `map` argument is an optional collection to copy shallowly into the
new mapping. The `map` may be an object literal. If `map` implements
-`forEach`, the values for each key are copied. So, `map` may be an
-array, where each index is accepted as the key.
+`keys`, it is treated as a mapping itself and copied. Otherwise, if
+`map` implements `forEach`, it may be any collection of `[key, value]`
+pairs.
`equals(x, y)`, `compare(x, y)`, and `hash(value)` are all optional
arguments overriding the meaning of equality, comparability, and
consistent hashing for the purposes of the collection. `equals` must
return a boolean. `compare` must return an integer with the same
-relationship to zero as x to y. `hash` should consistently return the same
-string for any given object.
+relationship to zero as x to y. `hash` should consistently return the
+same string for any given object.
The default `equals` operator is implemented in terms of `===`, but
treats `NaN` as equal to itself and `-0` as distinct from `+0`. It also
delegates to an `equals` method of either the left or right argument if
-one exists. The default can be overridden by shimming `Object.equals`.
+one exists. The default equality operator is shimmed as
+`Object.equals`.
The default `compare` operator is implemented in terms of `<` and `>`.
It delegates to the `compare` method of either the left or right
argument if one exists. It inverts the result if it uses the falls to
-the right argument. The default can be overridden by shimming
+the right argument. The default comparator is shimmed as
`Object.compare`.
-The default `hash` operator is implemented in terms of `toString`, but
-defers to the value's own `hash` member function if it provides one. If
-the hash changes, corresponding values will not be retrievable within
-sets or maps that use it. The default `hash` operator can be overridden
-by shimming `Object.hash`.
-
-Consistent hashing is tricky in JavaScript since the language
-deliberately avoids providing unique values for each object. However,
-in conjunction with `WeakMap`, it is relatively easy to add a [Unique
-Label][] to objects.
+THe default `hash` operator uses `toString` for values and provides a
+[Unique Label][] for arbitrary objects. The default hash is shimmed as
+`Object.hash`.
[Unique Label]: (http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps#unique_labeler)
-The `hash` module provides such an implementation. Since it entrains
-all the weight of the the `weap-map` module, you must opt in by
-requiring the module. If loaded, all new `Map` instances benefit from
-fewer hash collisions without the need for per-key-type implementations
-of `hash`.
-
-The default `content` function returns `undefined`. The content
-function is used when you `get` a nonexistant value from any collection.
-The `content` function becomes a member of the collection object.
-`content` is called with the collection as `this`, so you can also use
-it to guarantee that default values in a collection are retained, as in
-`MultiMap`.
+The default `content` function is `Function.noop`, which returns
+`undefined`. The content function is used when you `get` a nonexistant
+value from any collection. The `content` function becomes a member of
+the collection object, so `content` is called with the collection as
+`this`, so you can also use it to guarantee that default values in a
+collection are retained, as in `MultiMap`.
## Collection Methods
View
13 array.js
@@ -8,8 +8,10 @@
*/
require("./array-shim");
+require("./object");
var Reducible = require("./reducible");
-var Operators = require("./operators");
+
+module.exports = Array;
Array.empty = [];
if (Object.freeze) {
@@ -40,22 +42,25 @@ Array.prototype.get = function (index) {
Array.prototype.set = function (index, value) {
this.splice(index, 1, value);
- return this;
+ return true;
};
Array.prototype.add = function (value) {
this.push(value);
+ return true;
};
Array.prototype['delete'] = function (value, equals) {
var index = this.find(value, equals);
if (index !== -1) {
this.splice(index, 1);
+ return true;
}
+ return false;
};
Array.prototype.find = function (value, equals) {
- equals = equals || this.contentEquals || Object.equals || Operators.equals;
+ equals = equals || this.contentEquals || Object.equals;
for (var index = 0; index < this.length; index++) {
if (index in this && equals(this[index], value)) {
return index;
@@ -65,7 +70,7 @@ Array.prototype.find = function (value, equals) {
};
Array.prototype.findLast = function (value, equals) {
- equals = equals || this.contentEquals || Object.equals || Operators.equals;
+ equals = equals || this.contentEquals || Object.equals;
var index = this.length;
do {
index--;
View
157 collections.cat.js
@@ -0,0 +1,157 @@
+(function (global) {
+var module$abstract_map={},AbstractMap$$module$abstract_map=module$abstract_map.module$exports={};AbstractMap$$module$abstract_map.addEach=function(a){a&&Object(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):Object.keys(a).forEach(function(b){this.set(b,a[b])},this))};
+AbstractMap$$module$abstract_map.get=function(a,b){var c=this.contentSet.get(new this.Item(a));return c?c.value:1<arguments.length?b:this.content(a)};AbstractMap$$module$abstract_map.set=function(a,b){var c=new this.Item(a,b),d=this.contentSet.get(c);if(d)d.value=b;else if(this.contentSet.add(c))return this.length++,!0;return!1};AbstractMap$$module$abstract_map.has=function(a){return this.contentSet.has(new this.Item(a))};
+AbstractMap$$module$abstract_map["delete"]=function(a){return this.contentSet["delete"](new this.Item(a))?(this.length--,!0):!1};AbstractMap$$module$abstract_map.clear=function(){this.contentSet.clear();this.length=0};AbstractMap$$module$abstract_map.reduce=function(a,b,c){return this.contentSet.reduce(function(b,e){return a.call(c,b,e.value,e.key,this)},b,this)};
+AbstractMap$$module$abstract_map.reduceRight=function(a,b,c){return this.contentSet.reduceRight(function(b,e){return a.call(c,b,e.value,e.key,this)},b,this)};AbstractMap$$module$abstract_map.keys=function(){return this.map(getKey$$module$abstract_map)};function getKey$$module$abstract_map(a,b){return b}AbstractMap$$module$abstract_map.values=function(){return this.map(getValue$$module$abstract_map)};function getValue$$module$abstract_map(a){return a}AbstractMap$$module$abstract_map.items=function(){return this.map(getItem$$module$abstract_map)};
+function getItem$$module$abstract_map(a,b){return[b,a]}AbstractMap$$module$abstract_map.Item=Item$$module$abstract_map;function Item$$module$abstract_map(a,b){this.key=a;this.value=b}module$abstract_map.module$exports&&(module$abstract_map=module$abstract_map.module$exports);var module$tree_log={};module$tree_log.module$exports=TreeLog$$module$tree_log;function TreeLog$$module$tree_log(){}TreeLog$$module$tree_log.ascii={intersection:"+",through:"-",branchUp:"+",branchDown:"+",fromBelow:".",fromAbove:"'",fromBoth:"+",strafe:"|"};TreeLog$$module$tree_log.unicodeRound={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u256d",fromAbove:"\u2570",fromBoth:"\u2523",strafe:"\u2503"};
+TreeLog$$module$tree_log.unicodeSharp={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u250f",fromAbove:"\u2517",fromBoth:"\u2523",strafe:"\u2503"};module$tree_log.module$exports&&(module$tree_log=module$tree_log.module$exports);var module$weak_map={};
+module$weak_map.module$exports="undefined"!==typeof WeakMap?WeakMap:function(){function a(a){a.prototype=null;return Object.freeze(a)}var b=Object.getOwnPropertyNames,c=Object.defineProperty,d={};b(Object).forEach(function(a){d[a]=Object[a]});var e="ident:"+Math.random()+"___";if("undefined"!==typeof crypto&&"function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array){var f=new ArrayBuffer(25),f=new Uint8Array(f);crypto.getRandomValues(f);e="rand:"+
+Array.prototype.map.call(f,function(a){return(a%36).toString(36)}).join("")+"___"}c(Object,"getOwnPropertyNames",{value:function(a){return b(a).filter(function(a){return a!==e})}});"getPropertyNames"in Object&&c(Object,"getPropertyNames",{value:function(a){return d.getPropertyNames(a).filter(function(a){return a!==e})}});var g=function(a){if(a!==Object(a))throw new TypeError("Not an object: "+a);var b=a[e];if(b&&b.key===a)return b;if(d.isExtensible(a))return b={key:a,gets:[],vals:[]},c(a,e,{value:b,
+writable:!1,enumerable:!1,configurable:!1}),b},h=Object.freeze;c(Object,"freeze",{value:function(a){g(a);return h(a)}});var i=Object.seal;c(Object,"seal",{value:function(a){g(a);return i(a)}});var k=Object.preventExtensions;c(Object,"preventExtensions",{value:function(a){g(a);return k(a)}});var j=function(){function b(a,e){var f=g(a),h;f?(h=f.gets.indexOf(b),f=f.vals):(h=c.indexOf(a),f=d);return 0<=h?f[h]:e}var c=[],d=[];return Object.create(j.prototype,{get___:{value:a(b)},has___:{value:a(function(a){var d=
+g(a);return 0<=(d?d.gets.indexOf(b):c.indexOf(a))})},set___:{value:a(function(a,e){var f=g(a),h;f?(h=f.gets.indexOf(b),0<=h?f.vals[h]=e:(f.gets.push(b),f.vals.push(e))):(h=c.indexOf(a),0<=h?d[h]=e:(c.push(a),d.push(e)))})},delete___:{value:a(function(a){var e=g(a);e?(a=e.gets.indexOf(b),0<=a&&(e.gets.splice(a,1),e.vals.splice(a,1))):(a=c.indexOf(a),0<=a&&(c.splice(a,1),d.splice(a,1)));return!0})}})};j.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}});return j}();module$weak_map.module$exports&&(module$weak_map=module$weak_map.module$exports);var module$object={},WeakMap$$module$object=module$weak_map;module$object.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 hashMap$$module$object=new WeakMap$$module$object;
+Object.hash=function(a){return Object.can(a,"hash")?""+a.hash():Object(a)===a?(hashMap$$module$object.has(a)||hashMap$$module$object.set(a,Math.random().toString(36).slice(2)),hashMap$$module$object.get(a)):""+a};var owns$$module$object=Object.prototype.hasOwnProperty;Object.owns=function(a,b){return owns$$module$object.call(a,b)};Object.can=function(a,b){return null!=a&&"function"===typeof a[b]&&!owns$$module$object.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.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){a=Object.getValueOf(a);b=Object.getValueOf(b);return a===b?0!==a||1/a===1/b:Object.can(a,"equals")?a.equals(b):Object.can(b,"equals")?b.equals(a):a!==a&&b!==b};Object.compare=function(a,b){a=Object.getValueOf(a);b=Object.getValueOf(b);return a===b?0:"number"===typeof a&&"number"===typeof b?a-b:"string"===typeof a?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);if(void 0===b)b=Infinity;else if(0===b)return a;return c&&Object.isObject(a)&&Object.can(a,"clone")?(c.has(a)||c.set(a,a.clone(b,c)),c.get(a)):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};Function.noop=function(){};Function.identity=function(a){return a};module$object.module$exports&&(module$object=module$object.module$exports);var module$observable={},WeakMap$$module$observable=module$weak_map,contentChangeDescriptors$$module$observable=new WeakMap$$module$observable,Observable$$module$observable=module$observable;Observable$$module$observable.getContentChangeDescriptor=function(){contentChangeDescriptors$$module$observable.has(this)||contentChangeDescriptors$$module$observable.set(this,{isActive:!1,changeListeners:[],willChangeListeners:[]});return contentChangeDescriptors$$module$observable.get(this)};
+Observable$$module$observable.addContentChangeListener=function(a,b){!this.isObservable&&this.makeObservable&&this.makeObservable();var c=this.getContentChangeDescriptor(),c=b?c.willChangeListeners:c.changeListeners;c.push(a);this.isObserved=!!c.length};
+Observable$$module$observable.removeContentChangeListener=function(a,b){var c=this.getContentChangeDescriptor(),c=b?c.willChangeListeners:c.changeListeners,d=c.find(a);if(!d)throw Error("Can't remove listener: does not exist.");c.splice(d,1);this.isObserved=!!c.length};
+Observable$$module$observable.dispatchContentChange=function(a,b,c,d){var e=this.getContentChangeDescriptor();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.handleContentWillChange||e:e.handleContentChange||e,e.call&&e.call(this,a,b,c,d))},this)}finally{e.isActive=!1}}};
+Observable$$module$observable.addBeforeContentChangeListener=function(a){return this.addContentChangeListener(a,!0)};Observable$$module$observable.removeBeforeContentChangeListener=function(a){return this.removeContentChangeListener(a,!0)};Observable$$module$observable.dispatchBeforeContentChange=function(a,b,c){return this.dispatchContentChange(a,b,c,!0)};var module$reducible={};module$object;var Reducible$$module$reducible=module$reducible;Reducible$$module$reducible.addEach=function(a){a&&Object(a)===a&&("function"===typeof a.forEach?a.forEach(this.add,this):Object.keys(a).forEach(function(b){this.add(a[b],b)},this))};Reducible$$module$reducible.forEach=function(a,b){return this.reduce(function(c,d,e,f,g){a.call(b,d,e,f,g)},void 0)};
+Reducible$$module$reducible.map=function(a,b){var c=[];this.reduce(function(d,e,f,g,h){c.push(a.call(b,e,f,g,h))},void 0);return c};Reducible$$module$reducible.toArray=function(){return this.map(identity$$module$reducible)};Reducible$$module$reducible.toObject=function(){var a={};this.reduce(function(b,c,d){a[d]=c},void 0);return a};Reducible$$module$reducible.filter=function(a,b){var c=this.constructClone();this.reduce(c,function(d,e,f,g,h){a.call(b,e,f,g,h)&&c.push(e)},void 0);return c};
+Reducible$$module$reducible.every=function(a,b){return this.reduce(function(c,d,e,f,g){return c&&a.call(b,d,e,f,g)},!0)};Reducible$$module$reducible.some=function(a,b){return this.reduce(function(c,d,e,f,g){return c||a.call(b,d,e,f,g)},!1)};Reducible$$module$reducible.all=function(){return this.every(Boolean)};Reducible$$module$reducible.any=function(){return this.some(Boolean)};
+Reducible$$module$reducible.min=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,c){return 0>a(c,b)?c:b},Infinity)};Reducible$$module$reducible.max=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,c){return 0<a(c,b)?c:b},-Infinity)};Reducible$$module$reducible.sum=function(a){return this.reduce(add$$module$reducible,void 0===a?0:a)};function add$$module$reducible(a,b){return a+b}
+Reducible$$module$reducible.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};Reducible$$module$reducible.concat=function(){for(var a=this.constructClone(this),b=0;b<arguments.length;b++)a.addEach(arguments[b]);return a};Reducible$$module$reducible.flatten=function(){return this.reduce(flattenReducer$$module$reducible,this.constructClone())};
+function flattenReducer$$module$reducible(a,b){b.forEach(thisPush$$module$reducible,a);return a}function thisPush$$module$reducible(a){this.push(a)}Reducible$$module$reducible.zip=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this);return transpose$$module$reducible(a)};
+function transpose$$module$reducible(a){for(var b=[],c=Infinity,d=0;d<a.length;d++){var e=a[d];e.length<c&&(c=e.length)}for(d=0;d<a.length;d++){var f=0;a[d].reduce(function(a,e){f<c&&(b[f]=b[f]||[],b[f][d]=e);f++},void 0)}return b}
+Reducible$$module$reducible.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||identity$$module$reducible;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})};Reducible$$module$reducible.reversed=function(){return this.constructClone(this).reverse()};
+Reducible$$module$reducible.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){Object.clone&&(d=Object.clone(d,a-1,b));c.set(e,d)},this);return c};function identity$$module$reducible(a){return a};var module$array_shim={},Reducible$$module$array_shim=module$reducible,object_toString$$module$array_shim=Object.prototype.toString;Array.isArray||(Array.isArray=function(a){return"[object Array]"==object_toString$$module$array_shim.call(a)});Array.prototype.forEach||(Array.prototype.forEach=Reducible$$module$array_shim.forEach);Array.prototype.map||(Array.prototype.map=Reducible$$module$array_shim.map);Array.prototype.filter||(Array.prototype.filter=Reducible$$module$array_shim.filter);
+Array.prototype.every||(Array.prototype.every=Reducible$$module$array_shim.every);Array.prototype.some||(Array.prototype.some=Reducible$$module$array_shim.some);
+Array.prototype.reduce||(Array.prototype.reduce=function(a){var b=toObject(this),c=b.length>>>0;if(object_toString$$module$array_shim.call(a)!="[object Function]")throw new TypeError(a+" is not a function");if(!c&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var d=0,e;if(arguments.length>=2)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_toString$$module$array_shim.call(a)!="[object Function]")throw new TypeError(a+" is not a function");if(!c&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var d,c=c-1;if(arguments.length>=2)d=arguments[1];else{do{if(c in b){d=b[c--];break}if(--c<0)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;arguments.length>1&&(d=toInteger(arguments[1]));for(d=d>=0?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;arguments.length>1&&(d=Math.min(d,toInteger(arguments[1])));for(d=d>=0?d:c-Math.abs(d);d>=0;d--)if(d in b&&a===b[d])return d;return-1});var module$array={};module$array_shim;module$object;var Reducible$$module$array=module$reducible;module$array.module$exports=Array;Array.empty=[];Object.freeze&&Object.freeze(Array.empty);Array.from=function(a){var b=[];b.addEach(a);return b};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.toArray=Reducible$$module$array.toArray;Array.prototype.toObject=Reducible$$module$array.toArray;Array.prototype.addEach=Reducible$$module$array.addEach;Array.prototype.equals=Reducible$$module$array.equals;
+Array.prototype.compare=Reducible$$module$array.compare;Array.prototype.any=Reducible$$module$array.any;Array.prototype.all=Reducible$$module$array.all;Array.prototype.min=Reducible$$module$array.min;Array.prototype.max=Reducible$$module$array.max;Array.prototype.sum=Reducible$$module$array.sum;Array.prototype.average=Reducible$$module$array.average;Array.prototype.unique=Reducible$$module$array.unique;Array.prototype.flatten=Reducible$$module$array.flatten;Array.prototype.sorted=Reducible$$module$array.sorted;
+Array.prototype.reversed=Reducible$$module$array.reversed;Array.prototype.clone=Reducible$$module$array.clone;Array.prototype.one=function(){if(0===this.length)throw Error("Can't get one element from empty array");return this[0]};Array.prototype.only=function(){if(1!==this.length)throw Error("Can't get only element of array with "+this.length+" elements.");return this[0]};Array.prototype.clear=function(){this.length=0;return this};
+Array.prototype.iterate=function(a,b){return new ArrayIterator$$module$array(this,a,b)};function ArrayIterator$$module$array(a,b,c){this.array=a;this.start=null==b?0:b;this.end=c}ArrayIterator$$module$array.prototype.next=function(){if(this.start===(null==this.end?this.array.length:this.end))throw StopIteration;return this.array[this.start++]};module$array.module$exports&&(module$array=module$array.module$exports);var module$dict={};module$object;var Reducible$$module$dict=module$reducible,AbstractMap$$module$dict=module$abstract_map;module$dict.module$exports=Dict$$module$dict;function Dict$$module$dict(a,b){if(!(this instanceof Dict$$module$dict))return new Dict$$module$dict(a,b);this.content=b=b||Function.noop;this.store={};this.length=0;this.addEach(a)}function mangle$$module$dict(a){return"~"+a}function unmangle$$module$dict(a){return a.slice(1)}
+Dict$$module$dict.prototype.constructClone=function(a){return new this.constructor(a,this.mangle,this.content)};Dict$$module$dict.prototype.assertString=function(a){if("string"!==typeof a)throw new TypeError("key must be a string.");};Dict$$module$dict.prototype.get=function(a,b){this.assertString(a);var c=mangle$$module$dict(a);return c in this.store?this.store[c]:1<arguments.length?b:this.content()};
+Dict$$module$dict.prototype.set=function(a,b){this.assertString(a);var c=mangle$$module$dict(a);if(c in this.store)return this.store[c]=b,!1;this.length++;this.store[c]=b;return!0};Dict$$module$dict.prototype.has=function(a){this.assertString(a);return mangle$$module$dict(a)in this.store};Dict$$module$dict.prototype["delete"]=function(a){this.assertString(a);return mangle$$module$dict(a)in this.store?(delete this.store[mangle$$module$dict(a)],this.length--,!0):!1};
+Dict$$module$dict.prototype.clear=function(){for(var a in this.store)delete this.store[a];this.length=0};Dict$$module$dict.prototype.reduce=function(a,b,c){for(var d in this.store)b=a.call(c,b,this.store[d],unmangle$$module$dict(d),this);return b};Dict$$module$dict.prototype.addEach=AbstractMap$$module$dict.addEach;Dict$$module$dict.prototype.keys=AbstractMap$$module$dict.keys;Dict$$module$dict.prototype.values=AbstractMap$$module$dict.values;Dict$$module$dict.prototype.items=AbstractMap$$module$dict.items;
+Dict$$module$dict.prototype.forEach=Reducible$$module$dict.forEach;Dict$$module$dict.prototype.map=Reducible$$module$dict.map;Dict$$module$dict.prototype.toArray=Reducible$$module$dict.toArray;Dict$$module$dict.prototype.toObject=Reducible$$module$dict.toObject;Dict$$module$dict.prototype.filter=Reducible$$module$dict.filter;Dict$$module$dict.prototype.every=Reducible$$module$dict.every;Dict$$module$dict.prototype.some=Reducible$$module$dict.some;Dict$$module$dict.prototype.all=Reducible$$module$dict.all;
+Dict$$module$dict.prototype.any=Reducible$$module$dict.any;Dict$$module$dict.prototype.min=Reducible$$module$dict.min;Dict$$module$dict.prototype.max=Reducible$$module$dict.max;Dict$$module$dict.prototype.sum=Reducible$$module$dict.sum;Dict$$module$dict.prototype.average=Reducible$$module$dict.average;Dict$$module$dict.prototype.concat=Reducible$$module$dict.concat;Dict$$module$dict.prototype.flatten=Reducible$$module$dict.flatten;Dict$$module$dict.prototype.sorted=Reducible$$module$dict.sorted;
+Dict$$module$dict.prototype.zip=Reducible$$module$dict.zip;Dict$$module$dict.prototype.clone=Reducible$$module$dict.clone;module$dict.module$exports&&(module$dict=module$dict.module$exports);var module$iterator={};module$iterator.module$exports=Iterator$$module$iterator;var Reducible$$module$iterator=module$reducible;
+function Iterator$$module$iterator(a){if(!(this instanceof Iterator$$module$iterator))return new Iterator$$module$iterator(a);if(Array.isArray(a)||"string"===typeof a)return Iterator$$module$iterator.iterate(a);a=Object(a);if(a instanceof Iterator$$module$iterator)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]"===Object.prototype.toString.call(a))this.next=a;else throw new TypeError("Cannot iterate");
+}Iterator$$module$iterator.prototype.constructClone=function(a){var b=[];Reducible$$module$iterator.addEach.call(b,a);return b};Iterator$$module$iterator.prototype.mapIterator=function(a,b){var c=Iterator$$module$iterator(this),d=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new c.constructor(function(){return a.call(b,c.next(),d++,c)})};
+Iterator$$module$iterator.prototype.filterIterator=function(a,b){var c=Iterator$$module$iterator(this),d=0;if("[object Function]"!=Object.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})};
+Iterator$$module$iterator.prototype.reduce=function(a){var b=Iterator$$module$iterator(this),c=arguments[1],d=arguments[2],e=0,f;if("[object Function]"!=Object.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(g){if(isStopIteration(g)){if(1<arguments.length)return arguments[1];throw TypeError("cannot reduce a value from an empty iterator with no initial value");}throw g;}try{for(;;)f=b.next(),c=a.call(d,c,f,e,b),e++}catch(h){if(isStopIteration(h))return c;
+throw h;}};Iterator$$module$iterator.prototype.forEach=Reducible$$module$iterator.forEach;Iterator$$module$iterator.prototype.map=Reducible$$module$iterator.map;Iterator$$module$iterator.prototype.toArray=Reducible$$module$iterator.toArray;Iterator$$module$iterator.prototype.toObject=Reducible$$module$iterator.toObject;Iterator$$module$iterator.prototype.filter=Reducible$$module$iterator.filter;Iterator$$module$iterator.prototype.all=Reducible$$module$iterator.all;
+Iterator$$module$iterator.prototype.any=Reducible$$module$iterator.any;Iterator$$module$iterator.prototype.min=Reducible$$module$iterator.min;Iterator$$module$iterator.prototype.max=Reducible$$module$iterator.max;Iterator$$module$iterator.prototype.sum=Reducible$$module$iterator.sum;Iterator$$module$iterator.prototype.average=Reducible$$module$iterator.average;Iterator$$module$iterator.prototype.flatten=Reducible$$module$iterator.flatten;
+Iterator$$module$iterator.prototype.every=function(a){var b=Iterator$$module$iterator(this),c=!0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(!a)throw c=!1,StopIteration;});return c};
+Iterator$$module$iterator.prototype.some=function(a){var b=Iterator$$module$iterator(this),c=!1;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(a)throw c=!0,StopIteration;});return c};Iterator$$module$iterator.prototype.concat=function(){return Iterator$$module$iterator.concat(Array.prototype.concat.apply(this,arguments))};
+Iterator$$module$iterator.prototype.dropWhile=function(a,b){var c=Iterator$$module$iterator(this),d=!1,e;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;c.forEach(function(f,g){if(!a.call(b,f,g,c))throw d=!0,e=f,StopIteration;});return d?c.constructor([e]).concat(c):c.constructor([])};
+Iterator$$module$iterator.prototype.takeWhile=function(a,b){var c=Iterator$$module$iterator(this);if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return c.mapIterator(function(d,e){if(!a.call(b,d,e,c))throw StopIteration;return d})};
+Iterator$$module$iterator.prototype.filterIterator=function(a,b){var c=Iterator$$module$iterator(this),d=0;if("[object Function]"!=Object.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})};Iterator$$module$iterator.prototype.zip=function(){return Iterator$$module$iterator.transpose(Array.prototype.concat.apply(this,arguments))};Iterator$$module$iterator.prototype.enumerate=function(a){return Iterator$$module$iterator.count(a).zip(this)};
+Iterator$$module$iterator.iterate=function(a){var b;b=0;return new Iterator$$module$iterator(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})};
+Iterator$$module$iterator.cycle=function(a,b){2>arguments.length&&(b=Infinity);var c=function(){throw StopIteration;};return new Iterator$$module$iterator(function(){var d;try{return c()}catch(e){if(isStopIteration(e)){if(0>=b)throw e;b--;d=Iterator$$module$iterator.iterate(a);c=d.next.bind(d);return c()}throw e;}})};
+Iterator$$module$iterator.concat=function(a){var a=Iterator$$module$iterator(a),b=function(){throw StopIteration;};return new Iterator$$module$iterator(function(){var c;try{return b()}catch(d){if(isStopIteration(d))return c=Iterator$$module$iterator(a.next()),b=c.next.bind(c),b();throw d;}})};
+Iterator$$module$iterator.transpose=function(a){a=Iterator$$module$iterator(a).map(Iterator$$module$iterator);return 1>a.length?new Iterator$$module$iterator([]):new Iterator$$module$iterator(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})};Iterator$$module$iterator.zip=function(){return Iterator$$module$iterator.transpose(Array.prototype.slice.call(arguments))};Iterator$$module$iterator.chain=function(){return Iterator$$module$iterator.concat(Array.prototype.slice.call(arguments))};
+Iterator$$module$iterator.range=function(a,b,c){3>arguments.length&&(c=1);2>arguments.length&&(b=a,a=0);a=a||0;return new Iterator$$module$iterator(function(){if(a>=b)throw StopIteration;if(isNaN(a))throw"";var d=a;a=a+c;return d})};Iterator$$module$iterator.count=function(a,b){return Iterator$$module$iterator.range(a,Infinity,b||1)};Iterator$$module$iterator.repeat=function(a,b){2>arguments.length&&(b=Infinity);return(new Iterator$$module$iterator.range(+b)).mapIterator(function(){return a})};
+"undefined"===typeof isStopIteration&&(global.isStopIteration=function(a){return"[object StopIteration]"===Object.prototype.toString.call(a)});"undefined"===typeof StopIteration&&(global.StopIteration={},Object.prototype.toString=function(a){return function(){return this===global.StopIteration||this instanceof global.ReturnValue?"[object StopIteration]":a.call(this,arguments)}}(Object.prototype.toString));
+"undefined"===typeof ReturnValue&&(global.ReturnValue=function(a){if(!(this instanceof global.ReturnValue))return new global.ReturnValue(a);this.value=a});module$iterator.module$exports&&(module$iterator=module$iterator.module$exports);var module$list={};module$list.module$exports=List$$module$list;module$object;var Reducible$$module$list=module$reducible,Observable$$module$list=module$observable;function List$$module$list(a,b,c){if(!(this instanceof List$$module$list))return new List$$module$list(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)}
+List$$module$list.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.content)};List$$module$list.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}};List$$module$list.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}};List$$module$list.prototype.has=function(a,b){return!!this.find(a,b)};
+List$$module$list.prototype.get=function(a,b){var c=this.find(a,b);return c?c.value:this.content()};List$$module$list.prototype["delete"]=function(a,b){var c=this.findLast(a,b);return c?(this.isObserved&&this.dispatchBeforeContentChange([],[a]),c["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]),!0):!1};List$$module$list.prototype.clear=function(){this.head.next=this.head.prev=this.head};
+List$$module$list.prototype.add=function(a){this.isObserved&&this.dispatchBeforeContentChange([a],[]);this.head.addBefore(new this.Node(a));this.length++;this.isObserved&&this.dispatchContentChange([a],[]);return!0};List$$module$list.prototype.push=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b];this.isObserved&&this.dispatchBeforeContentChange([c],[]);var d=new this.Node(c);a.addBefore(d);this.length++;this.isObserved&&this.dispatchContentChange([c],[])}};
+List$$module$list.prototype.unshift=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b],d=new this.Node(c);a.addAfter(d);this.length++;this.isObserved&&this.dispatchContentChange([c],[]);a=d}};List$$module$list.prototype.pop=function(){var a,b=this.head;b.prev!==b&&(a=b.prev.value,this.isObserved&&this.dispatchBeforeContentChange([],[a]),b.prev["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]));return a};
+List$$module$list.prototype.shift=function(){var a,b=this.head;b.prev!==b&&(a=b.next.value,this.isObserved&&this.dispatchBeforeContentChange([],[a]),b.next["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]));return a};List$$module$list.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};
+List$$module$list.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};List$$module$list.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,2))};
+List$$module$list.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};List$$module$list.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};
+List$$module$list.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};List$$module$list.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};List$$module$list.prototype.addEach=Reducible$$module$list.addEach;List$$module$list.prototype.forEach=Reducible$$module$list.forEach;List$$module$list.prototype.map=Reducible$$module$list.map;
+List$$module$list.prototype.toArray=Reducible$$module$list.toArray;List$$module$list.prototype.filter=Reducible$$module$list.filter;List$$module$list.prototype.every=Reducible$$module$list.every;List$$module$list.prototype.some=Reducible$$module$list.some;List$$module$list.prototype.all=Reducible$$module$list.all;List$$module$list.prototype.any=Reducible$$module$list.any;List$$module$list.prototype.min=Reducible$$module$list.min;List$$module$list.prototype.max=Reducible$$module$list.max;
+List$$module$list.prototype.sum=Reducible$$module$list.sum;List$$module$list.prototype.average=Reducible$$module$list.average;List$$module$list.prototype.concat=Reducible$$module$list.concat;List$$module$list.prototype.flatten=Reducible$$module$list.flatten;List$$module$list.prototype.zip=Reducible$$module$list.zip;List$$module$list.prototype.equals=Reducible$$module$list.equals;List$$module$list.prototype.compare=Reducible$$module$list.compare;List$$module$list.prototype.sorted=Reducible$$module$list.sorted;
+List$$module$list.prototype.reversed=Reducible$$module$list.reversed;List$$module$list.prototype.clone=Reducible$$module$list.clone;List$$module$list.prototype.getContentChangeDescriptor=Observable$$module$list.getContentChangeDescriptor;List$$module$list.prototype.addContentChangeListener=Observable$$module$list.addContentChangeListener;List$$module$list.prototype.removeContentChangeListener=Observable$$module$list.removeContentChangeListener;List$$module$list.prototype.dispatchContentChange=Observable$$module$list.dispatchContentChange;
+List$$module$list.prototype.addBeforeContentChangeListener=Observable$$module$list.addBeforeContentChangeListener;List$$module$list.prototype.removeBeforeContentChangeListener=Observable$$module$list.removeBeforeContentChangeListener;List$$module$list.prototype.dispatchBeforeContentChange=Observable$$module$list.dispatchBeforeContentChange;
+List$$module$list.prototype.equals=function(a,b){b=b||this.contentEquals||Object.equals;return this===a?!0:this.length===a.length&&this.zip(a).every(function(a){return b(a[0],a[1])})};List$$module$list.prototype.one=function(){if(this.head===this.head.next)throw Error("Can't get one value from empty list");return this.head.next.value};
+List$$module$list.prototype.only=function(){if(this.head===this.head.next)throw Error("Can't get only value in empty list");if(this.head.prev!==this.head.next)throw Error("Can't get only value in list with multiple values");return this.head.next.value};List$$module$list.prototype.iterate=function(){return new ListIterator$$module$list(this.head)};function ListIterator$$module$list(a){this.head=a;this.at=a.next}
+ListIterator$$module$list.prototype.next=function(){if(this.at===this.head)throw StopIteration;var a=this.at.value;this.at=this.at.next;return a};List$$module$list.prototype.Node=Node$$module$list;function Node$$module$list(a){this.value=a;this.next=this.prev=null}Node$$module$list.prototype["delete"]=function(){this.prev.next=this.next;this.next.prev=this.prev};Node$$module$list.prototype.addBefore=function(a){var b=this.prev;this.prev=a;a.prev=b;b.next=a;a.next=this};
+Node$$module$list.prototype.addAfter=function(a){var b=this.next;this.next=a;a.next=b;b.prev=a;a.prev=this};module$list.module$exports&&(module$list=module$list.module$exports);var module$fast_set={};module$object;var Dict$$module$fast_set=module$dict,List$$module$fast_set=module$list,Reducible$$module$fast_set=module$reducible,Observable$$module$fast_set=module$observable,TreeLog$$module$fast_set=module$tree_log,Iterator$$module$fast_set=module$iterator,object_has$$module$fast_set=Object.prototype.hasOwnProperty;module$fast_set.module$exports=FastSet$$module$fast_set;
+function FastSet$$module$fast_set(a,b,c,d){if(!(this instanceof FastSet$$module$fast_set))return new FastSet$$module$fast_set(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)}FastSet$$module$fast_set.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};
+FastSet$$module$fast_set.prototype.Buckets=Dict$$module$fast_set;FastSet$$module$fast_set.prototype.Bucket=List$$module$fast_set;FastSet$$module$fast_set.prototype.has=function(a){var b=this.contentHash(a);return this.buckets.get(b).has(a)};FastSet$$module$fast_set.prototype.get=function(a){var b=this.contentHash(a),c=this.buckets;return c.has(b)?c.get(b).get(a):this.content(a)};
+FastSet$$module$fast_set.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.isObserved&&this.dispatchBeforeContentChange([],[a]);this.length--;if(0===d.length)c["delete"](b);this.isObserved&&this.dispatchContentChange([],[a]);return!0}}return!1};FastSet$$module$fast_set.prototype.clear=function(){this.buckets.clear();this.length=0};
+FastSet$$module$fast_set.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)?(this.isObserved&&this.dispatchBeforeContentChange([a],[]),c.get(b).add(a),this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0):!1};FastSet$$module$fast_set.prototype.reduce=function(a,b,c){return this.buckets.reduce(function(b,e){return e.reduce(a,b,c)},b)};FastSet$$module$fast_set.prototype.addEach=Reducible$$module$fast_set.addEach;
+FastSet$$module$fast_set.prototype.forEach=Reducible$$module$fast_set.forEach;FastSet$$module$fast_set.prototype.map=Reducible$$module$fast_set.map;FastSet$$module$fast_set.prototype.toArray=Reducible$$module$fast_set.toArray;FastSet$$module$fast_set.prototype.filter=Reducible$$module$fast_set.filter;FastSet$$module$fast_set.prototype.every=Reducible$$module$fast_set.every;FastSet$$module$fast_set.prototype.some=Reducible$$module$fast_set.some;FastSet$$module$fast_set.prototype.all=Reducible$$module$fast_set.all;
+FastSet$$module$fast_set.prototype.any=Reducible$$module$fast_set.any;FastSet$$module$fast_set.prototype.min=Reducible$$module$fast_set.min;FastSet$$module$fast_set.prototype.max=Reducible$$module$fast_set.max;FastSet$$module$fast_set.prototype.sum=Reducible$$module$fast_set.sum;FastSet$$module$fast_set.prototype.average=Reducible$$module$fast_set.average;FastSet$$module$fast_set.prototype.concat=Reducible$$module$fast_set.concat;FastSet$$module$fast_set.prototype.flatten=Reducible$$module$fast_set.flatten;
+FastSet$$module$fast_set.prototype.zip=Reducible$$module$fast_set.zip;FastSet$$module$fast_set.prototype.sorted=Reducible$$module$fast_set.sorted;FastSet$$module$fast_set.prototype.clone=Reducible$$module$fast_set.clone;FastSet$$module$fast_set.prototype.getContentChangeDescriptor=Observable$$module$fast_set.getContentChangeDescriptor;FastSet$$module$fast_set.prototype.addContentChangeListener=Observable$$module$fast_set.addContentChangeListener;
+FastSet$$module$fast_set.prototype.removeContentChangeListener=Observable$$module$fast_set.removeContentChangeListener;FastSet$$module$fast_set.prototype.dispatchContentChange=Observable$$module$fast_set.dispatchContentChange;FastSet$$module$fast_set.prototype.addBeforeContentChangeListener=Observable$$module$fast_set.addBeforeContentChangeListener;FastSet$$module$fast_set.prototype.removeBeforeContentChangeListener=Observable$$module$fast_set.removeBeforeContentChangeListener;
+FastSet$$module$fast_set.prototype.dispatchBeforeContentChange=Observable$$module$fast_set.dispatchBeforeContentChange;FastSet$$module$fast_set.prototype.equals=function(a){var b=this;return Object(a)===a&&"function"===typeof a.reduce&&"number"===typeof a.length&&this.length===a.length&&a.reduce(function(a,d){return a&&b.has(d)},!0)};FastSet$$module$fast_set.prototype.iterate=function(){var a=this.buckets,b=a.keys();return Iterator$$module$fast_set.concat(b.map(function(b){return a.get(b).iterate()}))};
+FastSet$$module$fast_set.prototype.log=function(a,b){var a=a||TreeLog$$module$fast_set.unicodeSharp,b=b||this.stringify,c=this.buckets,d=c.keys();d.forEach(function(e,f){var g,h;f===d.length-1?(g=a.fromAbove,h=" "):(g=a.fromBoth,h=a.strafe);var i=c.get(e);console.log(g+a.through+a.branchDown+" "+e);i.forEach(function(c,d){console.log(b(c,h+" "+(d===i.head.prev?a.fromAbove:a.fromBoth)+a.through+a.through+" ",h+" "))})})};
+FastSet$$module$fast_set.prototype.stringify=function(a,b){return Object(a)===a?b+JSON.stringify(a):b+a};module$fast_set.module$exports&&(module$fast_set=module$fast_set.module$exports);var module$fast_map={};module$object;var Set$$module$fast_map=module$fast_set,Reducible$$module$fast_map=module$reducible,AbstractMap$$module$fast_map=module$abstract_map;module$fast_map.module$exports=FastMap$$module$fast_map;
+function FastMap$$module$fast_map(a,b,c,d){if(!(this instanceof FastMap$$module$fast_map))return new FastMap$$module$fast_map(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.contentSet=new Set$$module$fast_map(void 0,function(a,c){return b(a.key,c.key)},function(a){return c(a.key)});this.length=0;this.addEach(a)}
+FastMap$$module$fast_map.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};FastMap$$module$fast_map.prototype.addEach=AbstractMap$$module$fast_map.addEach;FastMap$$module$fast_map.prototype.has=AbstractMap$$module$fast_map.has;FastMap$$module$fast_map.prototype.get=AbstractMap$$module$fast_map.get;FastMap$$module$fast_map.prototype.set=AbstractMap$$module$fast_map.set;FastMap$$module$fast_map.prototype["delete"]=AbstractMap$$module$fast_map["delete"];
+FastMap$$module$fast_map.prototype.clear=AbstractMap$$module$fast_map.clear;FastMap$$module$fast_map.prototype.reduce=AbstractMap$$module$fast_map.reduce;FastMap$$module$fast_map.prototype.keys=AbstractMap$$module$fast_map.keys;FastMap$$module$fast_map.prototype.values=AbstractMap$$module$fast_map.values;FastMap$$module$fast_map.prototype.items=AbstractMap$$module$fast_map.items;FastMap$$module$fast_map.prototype.Item=AbstractMap$$module$fast_map.Item;FastMap$$module$fast_map.prototype.forEach=Reducible$$module$fast_map.forEach;
+FastMap$$module$fast_map.prototype.map=Reducible$$module$fast_map.map;FastMap$$module$fast_map.prototype.toArray=Reducible$$module$fast_map.toArray;FastMap$$module$fast_map.prototype.toObject=Reducible$$module$fast_map.toObject;FastMap$$module$fast_map.prototype.filter=Reducible$$module$fast_map.filter;FastMap$$module$fast_map.prototype.every=Reducible$$module$fast_map.every;FastMap$$module$fast_map.prototype.some=Reducible$$module$fast_map.some;FastMap$$module$fast_map.prototype.all=Reducible$$module$fast_map.all;
+FastMap$$module$fast_map.prototype.any=Reducible$$module$fast_map.any;FastMap$$module$fast_map.prototype.min=Reducible$$module$fast_map.min;FastMap$$module$fast_map.prototype.max=Reducible$$module$fast_map.max;FastMap$$module$fast_map.prototype.sum=Reducible$$module$fast_map.sum;FastMap$$module$fast_map.prototype.average=Reducible$$module$fast_map.average;FastMap$$module$fast_map.prototype.concat=Reducible$$module$fast_map.concat;FastMap$$module$fast_map.prototype.flatten=Reducible$$module$fast_map.flatten;
+FastMap$$module$fast_map.prototype.sorted=Reducible$$module$fast_map.sorted;FastMap$$module$fast_map.prototype.zip=Reducible$$module$fast_map.zip;FastMap$$module$fast_map.prototype.clone=Reducible$$module$fast_map.clone;FastMap$$module$fast_map.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};FastMap$$module$fast_map.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};module$fast_map.module$exports&&(module$fast_map=module$fast_map.module$exports);var module$set={};module$object;var List$$module$set=module$list,FastSet$$module$set=module$fast_set,Reducible$$module$set=module$reducible,Observable$$module$set=module$observable;module$set.module$exports=Set$$module$set;
+function Set$$module$set(a,b,c,d){if(!(this instanceof Set$$module$set))return new Set$$module$set(a,b,c);b=b||Object.equals;c=c||Object.hash;d=d||Function.noop;this.contentEquals=b;this.contentHash=c;this.contentList=new List$$module$set(void 0,b);this.content=d;this.contentSet=new FastSet$$module$set(void 0,function(a,c){return b(a.value,c.value)},function(a){return c(a.value)});this.length=0;this.addEach(a)}
+Set$$module$set.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};Set$$module$set.prototype.has=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)};Set$$module$set.prototype.get=function(a){var b=new this.contentList.Node(a);return(b=this.contentSet.get(b))?b.value:this.content(a)};
+Set$$module$set.prototype.add=function(a){var b=new this.contentList.Node(a);return!this.contentSet.has(b)?(this.contentList.add(a),b=this.contentList.head.prev,this.contentSet.add(b),this.length++,!0):!1};Set$$module$set.prototype["delete"]=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)?(a=this.contentSet.get(a),this.contentSet["delete"](a),a["delete"](),this.length--,!0):!1};Set$$module$set.prototype.clear=function(){this.contentSet.clear();this.contentList.clear()};
+Set$$module$set.prototype.reduce=function(){var a=this.contentList;return a.reduce.apply(a,arguments)};Set$$module$set.prototype.reduceRight=function(){var a=this.contentList;return a.reduceRight.apply(a,arguments)};Set$$module$set.prototype.addEach=Reducible$$module$set.addEach;Set$$module$set.prototype.forEach=Reducible$$module$set.forEach;Set$$module$set.prototype.map=Reducible$$module$set.map;Set$$module$set.prototype.toArray=Reducible$$module$set.toArray;Set$$module$set.prototype.filter=Reducible$$module$set.filter;
+Set$$module$set.prototype.every=Reducible$$module$set.every;Set$$module$set.prototype.some=Reducible$$module$set.some;Set$$module$set.prototype.all=Reducible$$module$set.all;Set$$module$set.prototype.any=Reducible$$module$set.any;Set$$module$set.prototype.min=Reducible$$module$set.min;Set$$module$set.prototype.max=Reducible$$module$set.max;Set$$module$set.prototype.sum=Reducible$$module$set.sum;Set$$module$set.prototype.average=Reducible$$module$set.average;Set$$module$set.prototype.concat=Reducible$$module$set.concat;
+Set$$module$set.prototype.flatten=Reducible$$module$set.flatten;Set$$module$set.prototype.zip=Reducible$$module$set.zip;Set$$module$set.prototype.sorted=Reducible$$module$set.sorted;Set$$module$set.prototype.clone=Reducible$$module$set.clone;
+Set$$module$set.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,arguments)});this.isObservable=!0};Set$$module$set.prototype.getContentChangeDescriptor=Observable$$module$set.getContentChangeDescriptor;Set$$module$set.prototype.addContentChangeListener=Observable$$module$set.addContentChangeListener;
+Set$$module$set.prototype.removeContentChangeListener=Observable$$module$set.removeContentChangeListener;Set$$module$set.prototype.dispatchContentChange=Observable$$module$set.dispatchContentChange;Set$$module$set.prototype.addBeforeContentChangeListener=Observable$$module$set.addBeforeContentChangeListener;Set$$module$set.prototype.removeBeforeContentChangeListener=Observable$$module$set.removeBeforeContentChangeListener;Set$$module$set.prototype.dispatchBeforeContentChange=Observable$$module$set.dispatchBeforeContentChange;
+Set$$module$set.prototype.equals=function(a){return this.contentSet.equals(a)};Set$$module$set.prototype.iterate=function(){return this.contentList.iterate()};Set$$module$set.prototype.log=function(){var a=this.contentSet;return a.log.apply(a,arguments)};module$set.module$exports&&(module$set=module$set.module$exports);var module$lru_set={};module$object;var Set$$module$lru_set=module$set,Reducible$$module$lru_set=module$reducible,Observable$$module$lru_set=module$observable;module$lru_set.module$exports=LruSet$$module$lru_set;
+function LruSet$$module$lru_set(a,b,c,d,e){if(!(this instanceof LruSet$$module$lru_set))return new LruSet$$module$lru_set(a,b,c,d);b=b||Infinity;c=c||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentSet=new Set$$module$lru_set(void 0,c,d);this.contentEquals=c;this.contentHash=d;this.content=e;this.maxLength=b;this.length=0;this.addEach(a)}LruSet$$module$lru_set.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};
+LruSet$$module$lru_set.prototype.has=function(a){return this.contentSet.has(a)};LruSet$$module$lru_set.prototype.get=function(a){a=this.contentSet.get(a);void 0!==a?(this.contentSet["delete"](a),this.contentSet.add(a)):a=this.content();return a};
+LruSet$$module$lru_set.prototype.add=function(a){this.contentSet.has(a)&&(this.contentSet["delete"](a),this.length--);this.contentSet.add(a);this.length++;return this.contentSet.length>this.maxLength?(this.contentSet["delete"](this.contentSet.contentList.head.next.value),this.length--,!1):!0};LruSet$$module$lru_set.prototype["delete"]=function(a){return this.contentSet["delete"](a)?(this.length--,!0):!1};LruSet$$module$lru_set.prototype.clear=function(){this.contentSet.clear();this.length=0};
+LruSet$$module$lru_set.prototype.reduce=function(){var a=this.contentSet;return a.reduce.apply(a,arguments)};LruSet$$module$lru_set.prototype.reduceRight=function(){var a=this.contentSet;return a.reduceRight.apply(a,arguments)};LruSet$$module$lru_set.prototype.addEach=Reducible$$module$lru_set.addEach;LruSet$$module$lru_set.prototype.forEach=Reducible$$module$lru_set.forEach;LruSet$$module$lru_set.prototype.map=Reducible$$module$lru_set.map;LruSet$$module$lru_set.prototype.toArray=Reducible$$module$lru_set.toArray;
+LruSet$$module$lru_set.prototype.filter=Reducible$$module$lru_set.filter;LruSet$$module$lru_set.prototype.every=Reducible$$module$lru_set.every;LruSet$$module$lru_set.prototype.some=Reducible$$module$lru_set.some;LruSet$$module$lru_set.prototype.all=Reducible$$module$lru_set.all;LruSet$$module$lru_set.prototype.any=Reducible$$module$lru_set.any;LruSet$$module$lru_set.prototype.min=Reducible$$module$lru_set.min;LruSet$$module$lru_set.prototype.max=Reducible$$module$lru_set.max;
+LruSet$$module$lru_set.prototype.sum=Reducible$$module$lru_set.sum;LruSet$$module$lru_set.prototype.average=Reducible$$module$lru_set.average;LruSet$$module$lru_set.prototype.concat=Reducible$$module$lru_set.concat;LruSet$$module$lru_set.prototype.flatten=Reducible$$module$lru_set.flatten;LruSet$$module$lru_set.prototype.zip=Reducible$$module$lru_set.zip;LruSet$$module$lru_set.prototype.sorted=Reducible$$module$lru_set.sorted;LruSet$$module$lru_set.prototype.clone=Reducible$$module$lru_set.clone;
+LruSet$$module$lru_set.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,arguments)});this.isObservable=!0};LruSet$$module$lru_set.prototype.getContentChangeDescriptor=Observable$$module$lru_set.getContentChangeDescriptor;LruSet$$module$lru_set.prototype.addContentChangeListener=Observable$$module$lru_set.addContentChangeListener;
+LruSet$$module$lru_set.prototype.removeContentChangeListener=Observable$$module$lru_set.removeContentChangeListener;LruSet$$module$lru_set.prototype.dispatchContentChange=Observable$$module$lru_set.dispatchContentChange;LruSet$$module$lru_set.prototype.addBeforeContentChangeListener=Observable$$module$lru_set.addBeforeContentChangeListener;LruSet$$module$lru_set.prototype.removeBeforeContentChangeListener=Observable$$module$lru_set.removeBeforeContentChangeListener;
+LruSet$$module$lru_set.prototype.dispatchBeforeContentChange=Observable$$module$lru_set.dispatchBeforeContentChange;LruSet$$module$lru_set.prototype.equals=function(a){return this.contentSet.equals(a)};LruSet$$module$lru_set.prototype.iterate=function(){return this.contentSet.iterate()};module$lru_set.module$exports&&(module$lru_set=module$lru_set.module$exports);var module$lru_map={};module$object;var LruSet$$module$lru_map=module$lru_set,Reducible$$module$lru_map=module$reducible,AbstractMap$$module$lru_map=module$abstract_map;module$lru_map.module$exports=LruMap$$module$lru_map;
+function LruMap$$module$lru_map(a,b,c,d,e){if(!(this instanceof LruMap$$module$lru_map))return new LruMap$$module$lru_map(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.contentSet=new LruSet$$module$lru_map(void 0,b,function(a,b){return c(a.key,b.key)},function(a){return d(a.key)});this.length=0;this.addEach(a)}
+LruMap$$module$lru_map.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};LruMap$$module$lru_map.prototype.addEach=AbstractMap$$module$lru_map.addEach;LruMap$$module$lru_map.prototype.has=AbstractMap$$module$lru_map.has;LruMap$$module$lru_map.prototype.get=AbstractMap$$module$lru_map.get;LruMap$$module$lru_map.prototype.set=AbstractMap$$module$lru_map.set;LruMap$$module$lru_map.prototype["delete"]=AbstractMap$$module$lru_map["delete"];
+LruMap$$module$lru_map.prototype.clear=AbstractMap$$module$lru_map.clear;LruMap$$module$lru_map.prototype.reduce=AbstractMap$$module$lru_map.reduce;LruMap$$module$lru_map.prototype.keys=AbstractMap$$module$lru_map.keys;LruMap$$module$lru_map.prototype.values=AbstractMap$$module$lru_map.values;LruMap$$module$lru_map.prototype.items=AbstractMap$$module$lru_map.items;LruMap$$module$lru_map.prototype.Item=AbstractMap$$module$lru_map.Item;LruMap$$module$lru_map.prototype.forEach=Reducible$$module$lru_map.forEach;
+LruMap$$module$lru_map.prototype.map=Reducible$$module$lru_map.map;LruMap$$module$lru_map.prototype.toArray=Reducible$$module$lru_map.toArray;LruMap$$module$lru_map.prototype.toObject=Reducible$$module$lru_map.toObject;LruMap$$module$lru_map.prototype.filter=Reducible$$module$lru_map.filter;LruMap$$module$lru_map.prototype.every=Reducible$$module$lru_map.every;LruMap$$module$lru_map.prototype.some=Reducible$$module$lru_map.some;LruMap$$module$lru_map.prototype.all=Reducible$$module$lru_map.all;
+LruMap$$module$lru_map.prototype.any=Reducible$$module$lru_map.any;LruMap$$module$lru_map.prototype.min=Reducible$$module$lru_map.min;LruMap$$module$lru_map.prototype.max=Reducible$$module$lru_map.max;LruMap$$module$lru_map.prototype.sum=Reducible$$module$lru_map.sum;LruMap$$module$lru_map.prototype.average=Reducible$$module$lru_map.average;LruMap$$module$lru_map.prototype.concat=Reducible$$module$lru_map.concat;LruMap$$module$lru_map.prototype.flatten=Reducible$$module$lru_map.flatten;
+LruMap$$module$lru_map.prototype.sorted=Reducible$$module$lru_map.sorted;LruMap$$module$lru_map.prototype.zip=Reducible$$module$lru_map.zip;LruMap$$module$lru_map.prototype.clone=Reducible$$module$lru_map.clone;LruMap$$module$lru_map.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};LruMap$$module$lru_map.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};module$lru_map.module$exports&&(module$lru_map=module$lru_map.module$exports);var module$map={};module$object;var Set$$module$map=module$set,Reducible$$module$map=module$reducible,AbstractMap$$module$map=module$abstract_map;module$map.module$exports=Map$$module$map;
+function Map$$module$map(a,b,c,d){if(!(this instanceof Map$$module$map))return new Map$$module$map(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.contentSet=new Set$$module$map(void 0,function(a,c){return b(a.key,c.key)},function(a){return c(a.key)});this.length=0;this.addEach(a)}Map$$module$map.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};
+Map$$module$map.prototype.addEach=AbstractMap$$module$map.addEach;Map$$module$map.prototype.has=AbstractMap$$module$map.has;Map$$module$map.prototype.get=AbstractMap$$module$map.get;Map$$module$map.prototype.set=AbstractMap$$module$map.set;Map$$module$map.prototype["delete"]=AbstractMap$$module$map["delete"];Map$$module$map.prototype.clear=AbstractMap$$module$map.clear;Map$$module$map.prototype.reduce=AbstractMap$$module$map.reduce;Map$$module$map.prototype.keys=AbstractMap$$module$map.keys;
+Map$$module$map.prototype.values=AbstractMap$$module$map.values;Map$$module$map.prototype.items=AbstractMap$$module$map.items;Map$$module$map.prototype.Item=AbstractMap$$module$map.Item;Map$$module$map.prototype.forEach=Reducible$$module$map.forEach;Map$$module$map.prototype.map=Reducible$$module$map.map;Map$$module$map.prototype.toArray=Reducible$$module$map.toArray;Map$$module$map.prototype.toObject=Reducible$$module$map.toObject;Map$$module$map.prototype.filter=Reducible$$module$map.filter;
+Map$$module$map.prototype.every=Reducible$$module$map.every;Map$$module$map.prototype.some=Reducible$$module$map.some;Map$$module$map.prototype.all=Reducible$$module$map.all;Map$$module$map.prototype.any=Reducible$$module$map.any;Map$$module$map.prototype.min=Reducible$$module$map.min;Map$$module$map.prototype.max=Reducible$$module$map.max;Map$$module$map.prototype.sum=Reducible$$module$map.sum;Map$$module$map.prototype.average=Reducible$$module$map.average;Map$$module$map.prototype.concat=Reducible$$module$map.concat;
+Map$$module$map.prototype.flatten=Reducible$$module$map.flatten;Map$$module$map.prototype.sorted=Reducible$$module$map.sorted;Map$$module$map.prototype.zip=Reducible$$module$map.zip;Map$$module$map.prototype.clone=Reducible$$module$map.clone;Map$$module$map.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};Map$$module$map.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};module$map.module$exports&&(module$map=module$map.module$exports);var module$multi_map={},Map$$module$multi_map=module$map,AbstractMap$$module$multi_map=module$abstract_map,Reducible$$module$multi_map=module$reducible;module$multi_map.module$exports=MultiMap$$module$multi_map;
+function MultiMap$$module$multi_map(a,b,c,d){if(!(this instanceof MultiMap$$module$multi_map))return new MultiMap$$module$multi_map(a,b,c,d);this.bucket=b||this.bucket;Map$$module$multi_map.call(this,a,c,d,function(a){var b=this.bucket();Map$$module$multi_map.prototype.set.call(this,a,b);return b})}MultiMap$$module$multi_map.prototype=Object.create(Map$$module$multi_map.prototype);
+MultiMap$$module$multi_map.prototype.constructClone=function(a){return new this.constructor(a,this.bucket,this.contentEquals,this.contentHash)};MultiMap$$module$multi_map.prototype.set=function(a,b){var c=this.get(a);c.swap(0,c.length,b)};MultiMap$$module$multi_map.prototype.bucket=function(){return[]};module$multi_map.module$exports&&(module$multi_map=module$multi_map.module$exports);var module$sorted_set={};module$sorted_set.module$exports=SortedSet$$module$sorted_set;module$object;var Reducible$$module$sorted_set=module$reducible,Observable$$module$sorted_set=module$observable,TreeLog$$module$sorted_set=module$tree_log;
+function SortedSet$$module$sorted_set(a,b,c,d){if(!(this instanceof SortedSet$$module$sorted_set))return new SortedSet$$module$sorted_set(a,b,c);this.contentEquals=b||Object.equals;this.contentCompare=c||Object.compare;this.content=d||Function.noop;this.root=null;this.length=0;this.addEach(a)}SortedSet$$module$sorted_set.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};
+SortedSet$$module$sorted_set.prototype.has=function(a){return this.root?(this.splay(a),this.contentEquals(a,this.root.value)):!1};SortedSet$$module$sorted_set.prototype.get=function(a){return this.root&&(this.splay(a),this.contentEquals(a,this.root.value))?this.root.value:this.content(a)};
+SortedSet$$module$sorted_set.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.isObserved&&this.dispatchBeforeContentChange([a],[]),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=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0}else return this.isObserved&&this.dispatchBeforeContentChange([a],
+[]),this.root=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0;return!1};SortedSet$$module$sorted_set.prototype["delete"]=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value))){if(this.root.left){var b=this.root.right;this.root=this.root.left;this.splay(a);this.root.right=b}else this.root=this.root.right;this.length--;this.isObserved&&this.dispatchContentChange([],[a]);return!0}return!1};
+SortedSet$$module$sorted_set.prototype.find=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value)))return this.root};SortedSet$$module$sorted_set.prototype.findGreatest=function(a){if(this.root){for(a=a||this.root;a.right;)a=a.right;return a}};SortedSet$$module$sorted_set.prototype.findLeast=function(a){if(this.root){for(a=a||this.root;a.left;)a=a.left;return a}};
+SortedSet$$module$sorted_set.prototype.findGreatestLessThanOrEqual=function(a){if(this.root)return this.splay(a),this.root};SortedSet$$module$sorted_set.prototype.findGreatestLessThan=function(a){if(this.root)return this.splay(a),this.root.getPrevious()};SortedSet$$module$sorted_set.prototype.findLeastGreaterThanOrEqual=function(a){if(this.root)return this.splay(a),0===this.contentCompare(a,this.root.value)?this.root:this.root.getNext()};
+SortedSet$$module$sorted_set.prototype.findLeastGreaterThan=function(a){if(this.root)return this.splay(a),this.contentCompare(a,this.root.value),this.root.getNext()};
+SortedSet$$module$sorted_set.prototype.splay=function(a){var b,c,d,e,f;if(this.root){b=c=d=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,e.right=f,f=e,!f.left))break;d=d.left=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,e.left=f,f=e,!f.right))break;c=c.right=f;f=f.right}else break;else break;c.right=f.left;d.left=f.right;f.left=
+b.right;f.right=b.left;this.root=f}};SortedSet$$module$sorted_set.prototype.reduce=function(a,b,c){this.root&&(b=this.root.reduce(a,b,c,this));return b};SortedSet$$module$sorted_set.prototype.reduceRight=function(a,b,c){this.root&&(b=this.root.reduceRight(a,b,c,this));return b};SortedSet$$module$sorted_set.prototype.addEach=Reducible$$module$sorted_set.addEach;SortedSet$$module$sorted_set.prototype.forEach=Reducible$$module$sorted_set.forEach;SortedSet$$module$sorted_set.prototype.map=Reducible$$module$sorted_set.map;
+SortedSet$$module$sorted_set.prototype.toArray=Reducible$$module$sorted_set.toArray;SortedSet$$module$sorted_set.prototype.filter=Reducible$$module$sorted_set.filter;SortedSet$$module$sorted_set.prototype.every=Reducible$$module$sorted_set.every;SortedSet$$module$sorted_set.prototype.some=Reducible$$module$sorted_set.some;SortedSet$$module$sorted_set.prototype.all=Reducible$$module$sorted_set.all;SortedSet$$module$sorted_set.prototype.any=Reducible$$module$sorted_set.any;
+SortedSet$$module$sorted_set.prototype.sum=Reducible$$module$sorted_set.sum;SortedSet$$module$sorted_set.prototype.average=Reducible$$module$sorted_set.average;SortedSet$$module$sorted_set.prototype.flatten=Reducible$$module$sorted_set.flatten;SortedSet$$module$sorted_set.prototype.zip=Reducible$$module$sorted_set.flatten;SortedSet$$module$sorted_set.prototype.sorted=Reducible$$module$sorted_set.sorted;SortedSet$$module$sorted_set.prototype.clone=Reducible$$module$sorted_set.clone;
+SortedSet$$module$sorted_set.prototype.getContentChangeDescriptor=Observable$$module$sorted_set.getContentChangeDescriptor;SortedSet$$module$sorted_set.prototype.addContentChangeListener=Observable$$module$sorted_set.addContentChangeListener;SortedSet$$module$sorted_set.prototype.removeContentChangeListener=Observable$$module$sorted_set.removeContentChangeListener;SortedSet$$module$sorted_set.prototype.dispatchContentChange=Observable$$module$sorted_set.dispatchContentChange;
+SortedSet$$module$sorted_set.prototype.addBeforeContentChangeListener=Observable$$module$sorted_set.addBeforeContentChangeListener;SortedSet$$module$sorted_set.prototype.removeBeforeContentChangeListener=Observable$$module$sorted_set.removeBeforeContentChangeListener;SortedSet$$module$sorted_set.prototype.dispatchBeforeContentChange=Observable$$module$sorted_set.dispatchBeforeContentChange;SortedSet$$module$sorted_set.prototype.min=function(a){if(a=this.findLeast(a))return a.value};
+SortedSet$$module$sorted_set.prototype.max=function(a){if(a=this.findGreatest(a))return a.value};SortedSet$$module$sorted_set.prototype.one=function(){if(!this.root)throw Error("Can't get one value from empty set");return this.root.value};SortedSet$$module$sorted_set.prototype.only=function(){if(!this.root)throw Error("Can't get only value in empty set");if(this.root.left||this.root.right)throw Error("Can't get only value in set with multiple values");return this.root.value};
+SortedSet$$module$sorted_set.prototype.clear=function(){this.root=null};SortedSet$$module$sorted_set.prototype.iterate=function(a,b){return new this.Iterator(this,a,b)};SortedSet$$module$sorted_set.prototype.Iterator=Iterator$$module$sorted_set;SortedSet$$module$sorted_set.prototype.log=function(a,b){this.report(console.log,console,a,b)};
+SortedSet$$module$sorted_set.prototype.report=function(a,b,c,d){c=c||SortedSet$$module$sorted_set.unicodeRound;d=d||this.stringify;this.root&&this.root.report(a,b,c,d)};SortedSet$$module$sorted_set.prototype.stringify=function(a,b,c,d){a.call(b,d+" "+c.value)};SortedSet$$module$sorted_set.unicodeRound=TreeLog$$module$sorted_set.unicodeRound;SortedSet$$module$sorted_set.unicodeSharp=TreeLog$$module$sorted_set.unicodeSharp;SortedSet$$module$sorted_set.ascii=TreeLog$$module$sorted_set.ascii;
+SortedSet$$module$sorted_set.prototype.Node=Node$$module$sorted_set;function Node$$module$sorted_set(a){this.value=a;this.right=this.left=null}Node$$module$sorted_set.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,d,e);this.right&&(b=this.right.reduce(a,b,c,d,e+1));return b};
+Node$$module$sorted_set.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,d,e);this.left&&(b=this.left.reduce(a,b,c,d,e+1));return b};Node$$module$sorted_set.prototype.getNext=function(){var a=this;if(a.right){for(a=a.right;a.left;)a=a.left;return a}};Node$$module$sorted_set.prototype.getPrevious=function(){var a=this;if(a.left){for(a=a.left;a.right;)a=a.right;return a}};
+Node$$module$sorted_set.prototype.report=function(a,b,c,d,e,f,g){var e=e||"",f=f||"",g=g||"",h;h=this.left&&this.right?c.intersection:this.left?c.branchUp:this.right?c.branchDown:c.through;this.left&&this.left.report(a,b,c,d,f+c.fromBelow+c.through,f+" ",f+c.strafe+" ");d(a,b,this,e+h,g+(this.right?c.strafe:" "),f+(this.left?c.strafe:" "));this.right&&this.right.report(a,b,c,d,g+c.fromAbove+c.through,g+c.strafe+" ",g+" ")};
+function Iterator$$module$sorted_set(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()}Iterator$$module$sorted_set.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$sorted_set.module$exports&&(module$sorted_set=module$sorted_set.module$exports);var module$sorted_map={};module$object;var SortedSet$$module$sorted_map=module$sorted_set,Reducible$$module$sorted_map=module$reducible,AbstractMap$$module$sorted_map=module$abstract_map;module$sorted_map.module$exports=SortedMap$$module$sorted_map;
+function SortedMap$$module$sorted_map(a,b,c,d){if(!(this instanceof SortedMap$$module$sorted_map))return new SortedMap$$module$sorted_map(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.contentSet=new SortedSet$$module$sorted_map(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)}
+SortedMap$$module$sorted_map.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};SortedMap$$module$sorted_map.prototype.addEach=AbstractMap$$module$sorted_map.addEach;SortedMap$$module$sorted_map.prototype.has=AbstractMap$$module$sorted_map.has;SortedMap$$module$sorted_map.prototype.get=AbstractMap$$module$sorted_map.get;SortedMap$$module$sorted_map.prototype.set=AbstractMap$$module$sorted_map.set;
+SortedMap$$module$sorted_map.prototype["delete"]=AbstractMap$$module$sorted_map["delete"];SortedMap$$module$sorted_map.prototype.clear=AbstractMap$$module$sorted_map.clear;SortedMap$$module$sorted_map.prototype.reduce=AbstractMap$$module$sorted_map.reduce;SortedMap$$module$sorted_map.prototype.keys=AbstractMap$$module$sorted_map.keys;SortedMap$$module$sorted_map.prototype.values=AbstractMap$$module$sorted_map.values;SortedMap$$module$sorted_map.prototype.items=AbstractMap$$module$sorted_map.items;
+SortedMap$$module$sorted_map.prototype.Item=AbstractMap$$module$sorted_map.Item;SortedMap$$module$sorted_map.prototype.forEach=Reducible$$module$sorted_map.forEach;SortedMap$$module$sorted_map.prototype.map=Reducible$$module$sorted_map.map;SortedMap$$module$sorted_map.prototype.toArray=Reducible$$module$sorted_map.toArray;SortedMap$$module$sorted_map.prototype.filter=Reducible$$module$sorted_map.filter;SortedMap$$module$sorted_map.prototype.every=Reducible$$module$sorted_map.every;
+SortedMap$$module$sorted_map.prototype.some=Reducible$$module$sorted_map.some;SortedMap$$module$sorted_map.prototype.all=Reducible$$module$sorted_map.all;SortedMap$$module$sorted_map.prototype.any=Reducible$$module$sorted_map.any;SortedMap$$module$sorted_map.prototype.min=Reducible$$module$sorted_map.min;SortedMap$$module$sorted_map.prototype.max=Reducible$$module$sorted_map.max;SortedMap$$module$sorted_map.prototype.sum=Reducible$$module$sorted_map.sum;
+SortedMap$$module$sorted_map.prototype.average=Reducible$$module$sorted_map.average;SortedMap$$module$sorted_map.prototype.flatten=Reducible$$module$sorted_map.flatten;SortedMap$$module$sorted_map.prototype.zip=Reducible$$module$sorted_map.zip;SortedMap$$module$sorted_map.prototype.clone=Reducible$$module$sorted_map.clone;SortedMap$$module$sorted_map.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};
+SortedMap$$module$sorted_map.prototype.report=function(a,b,c,d){d=d||this.stringify;this.contentSet.report(a,b,c,d)};SortedMap$$module$sorted_map.prototype.stringify=function(a,b,c,d){a.call(b,d+" "+c.value.key+": "+c.value.value)};module$sorted_map.module$exports&&(module$sorted_map=module$sorted_map.module$exports);var module$collections={};module$array_shim;module$array;global.List=module$list;global.Set=module$set;global.Map=module$map;global.MultiMap=module$multi_map;global.SortedSet=module$sorted_set;global.SortedMap=module$sorted_map;global.LruSet=module$lru_set;global.LruMap=module$lru_map;global.FastSet=module$fast_set;global.FastMap=module$fast_map;global.WeakMap=module$weak_map;global.Iterator=module$iterator;
+})(this);
View
27 collections.js
@@ -1,18 +1,19 @@
-"use strict";
+
+// used exclusively to generate collections.min.js for browsers
require("./array-shim");
require("./array");
-window.List = require("./list");
-window.Set = require("./set");
-window.Map = require("./map");
-window.MultiMap = require("./multi-map");
-window.SortedSet = require("./sorted-set");
-window.SortedMap = require("./sorted-map");
-window.LruSet = require("./lru-set");
-window.LruMap = require("./lru-map");
-window.FastSet = require("./fast-set");
-window.FastMap = require("./fast-map");
-window.WeakMap = require("./weak-map");
-window.Iterator = require("./iterator");
+global.List = require("./list");
+global.Set = require("./set");
+global.Map = require("./map");
+global.MultiMap = require("./multi-map");
+global.SortedSet = require("./sorted-set");
+global.SortedMap = require("./sorted-map");
+global.LruSet = require("./lru-set");
+global.LruMap = require("./lru-map");
+global.FastSet = require("./fast-set");
+global.FastMap = require("./fast-map");
+global.WeakMap = require("./weak-map");
+global.Iterator = require("./iterator");
View
181 collections.min.js
@@ -1,89 +1,92 @@
-(function(){function ra(a,b){return b}function sa(a){return a}function ta(a,b){return[b,a]}function U(a){Object(a)===a&&"function"===typeof a.valueOf&&(a=a.valueOf());return a}function ua(a){return a+1}function va(a,b){return a+b}function wa(a,b){b.forEach(xa,a);return a}function xa(a){this.push(a)}function ma(a){return a}function na(a,b,d){this.array=a;this.start=null==b?0:b;this.end=d}function q(){this.store={};this.length=0}function Y(a){return a.slice(1)}function f(a){if(!(this instanceof f))return new f(a);
-if(Array.isArray(a)||"string"===typeof a)return f.iterate(a);a=Object(a);if(a instanceof f)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]"===Object.prototype.toString.call(a))this.next=a;else throw new TypeError("Cannot iterate");}function V(){}function h(a,b,d){if(!(this instanceof h))return new h(a,b,d);var e=this.head=new this.Node;e.next=e;e.prev=e;this.contentEquals=b||Object.equals||
-Z.equals;this.content=d||Z.getUndefined;this.length=0;this.addEach(a)}function oa(a){this.head=a;this.at=a.next}function W(a){this.value=a;this.next=this.prev=null}function j(a,b,d,e){if(!(this instanceof j))return new j(a,b,d);b=b||Object.equals||$.equals;d=d||Object.hash||$.hash;e=e||$.getUndefined;this.contentEquals=b;this.contentHash=d;this.content=e;this.buckets=new this.Buckets(null,this.Bucket);this.length=0;this.addEach(a)}function m(a,b,d,e){if(!(this instanceof m))return new m(a,b,d);b=
-b||Object.equals||aa.equals;d=d||Object.hash||aa.hash;e=e||aa.getUndefined;this.contentEquals=b;this.contentHash=d;this.content=e;this.contentSet=new ya(void 0,function(a,d){return b(a.key,d.key)},function(a){return d(a.key)});this.addEach(a)}function k(a,b,d,e){if(!(this instanceof k))return new k(a,b,d);b=b||Object.equals||ba.equals;d=d||Object.hash||ba.hash;e=e||ba.getUndefined;this.contentEquals=b;this.contentHash=d;this.contentList=new za(void 0,b);this.content=e;this.contentSet=new Aa(void 0,
-function(a,d){return b(a.value,d.value)},function(a){return d(a.value)});this.length=0;this.addEach(a)}function l(a,b,d,e,c){if(!(this instanceof l))return new l(a,b,d,e);b=b||Infinity;d=d||Object.equals||ca.equals;e=e||Object.hash||ca.hash;c=c||ca.getUndefined;this.contentSet=new Ba(void 0,d,e);this.contentEquals=d;this.contentHash=e;this.content=c;this.maxLength=b;this.addEach(a)}function n(a,b,d,e,c){if(!(this instanceof n))return new n(a,b,d,e);d=d||Object.equals||da.equals;e=e||Object.hash||
-da.hash;c=c||da.getUndefined;this.contentEquals=d;this.contentHash=e;this.content=c;this.contentSet=new Ca(void 0,b,function(a,b){return d(a.key,b.key)},function(a){return e(a.key)});this.addEach(a)}function o(a,b,d,e){if(!(this instanceof o))return new o(a,b,d);b=b||Object.equals||ea.equals;d=d||Object.hash||ea.hash;e=e||ea.getUndefined;this.contentEquals=b;this.contentHash=d;this.content=e;this.contentSet=new Da(void 0,function(a,d){return b(a.key,d.key)},function(a){return d(a.key)});this.addEach(a)}
-function B(a,b,d,e){if(!(this instanceof B))return new B(a,b,d,e);this.bucket=b||this.bucket;fa.call(this,a,d,e,function(a){var b=this.bucket();fa.prototype.set.call(this,a,b);return b})}function i(a,b,d,e){if(!(this instanceof i))return new i(a,b,d);this.contentEquals=b||Object.equals||ga.equals;this.contentCompare=d||Object.compare||ga.compare;this.content=e||ga.getUndefined;this.root=null;this.length=0;this.addEach(a)}function G(a){this.value=a;this.right=this.left=null}function pa(a,b,d){this.set=
-a;this.prev=null;this.end=d;if(b&&(a=this.set.findLeastGreaterThanOrEqual(b)))this.set.splay(a.value),this.prev=a.getPrevious()}function p(a,b,d,e){if(!(this instanceof p))return new p(a,b,d,e);b=b||Object.equals||ha.equals;d=d||Object.compare||ha.compare;e=e||ha.getUndefined;this.contentEquals=b;this.contentCompare=d;this.content=e;this.contentSet=new Ea(null,function(a,d){return b(a.key,d.key)},function(a,b){return d(a.key,b.key)});this.addEach(a)}var s={},w=s.module$exports={};w.addEach=function(a){a&&
-Object(a)===a&&("function"===typeof a.forEach?"function"===typeof a.keys?a.forEach(function(a,d){this.set(d,a)},this):a.forEach(function(a){this.set(a[0],a[1])},this):Object.keys(a).forEach(function(b){this.set(b,a[b])},this))};w.get=function(a,b){var d=this.contentSet.get(new this.Item(a));return d?d.value:1<arguments.length?b:this.content(a)};w.set=function(a,b){var d=new this.Item(a,b),e=this.contentSet.get(d);e?e.value=b:this.contentSet.add(d)};w.value=function(a,b){this.set(b,a)};w.has=function(a){return this.contentSet.has(new this.Item(a))};
-w["delete"]=function(a){this.contentSet["delete"](new this.Item(a))};w.wipe=function(){this.contentSet.wipe()};w.reduce=function(a,b,d){return this.contentSet.reduce(function(b,c){return a.call(d,b,c.value,c.key,this)},b,this)};w.reduceRight=function(a,b,d){return this.contentSet.reduceRight(function(b,c){return a.call(d,b,c.value,c.key,this)},b,this)};w.keys=function(){return this.map(ra)};w.values=function(){return this.map(sa)};w.items=function(){return this.map(ta)};w.Item=function(a,b){this.key=
-a;this.value=b};s.module$exports&&(s=s.module$exports);var x={equals:function(a,b){a=U(a);b=U(b);return a===b?0!==a||1/a===1/b:Object(a)===a&&"function"===typeof a.equals?a.equals(b):Object(b)===b&&"function"===typeof b.equals?b.equals(a):a!==a&&b!==b},compare:function(a,b){a=U(a);b=U(b);return Object(a)===a&&"function"===typeof a.compare?a.compare(b):Object(b)===b&&"function"===typeof b.compare?-b.compare(a):typeof a!==typeof b?0:a>b?1:a<b?-1:0},hash:function(a){return Object(a)===a&&"function"===
-typeof a.hash?""+a.hash():""+a},getUndefined:function(){}},c={addEach:function(a){a&&Object(a)===a&&("function"===typeof a.forEach?a.forEach(this.add,this):Object.keys(a).forEach(function(b){this.add(a[b],b)},this))},forEach:function(a,b){return this.reduce(function(d,e,c,r,f){a.call(b,e,c,r,f)},void 0)},map:function(a,b){var d=[];this.reduce(function(e,c,r,f,h){d.push(a.call(b,c,r,f,h))},void 0);return d},toArray:function(){return this.map(ma)},toObject:function(){var a={};this.reduce(function(b,
-d,e){a[e]=d},void 0);return a},filter:function(a,b){var d=this.constructClone();this.reduce(d,function(e,c,r,f,h){a.call(b,c,r,f,h)&&d.push(c)},void 0);return d},every:function(a,b){return this.reduce(function(d,e,c,r,f){return d&&a.call(b,e,c,r,f)},!0)},some:function(a,b){return this.reduce(function(d,e,c,r,f){return d||a.call(b,e,c,r,f)},!1)},all:function(){return this.every(Boolean)},any:function(){return this.some(Boolean)},min:function(a){a=this.contentCompare||Object.compare||x.compare;return this.reduce(function(b,
-d){return 0>a(d,b)?d:b},Infinity)},max:function(a){a=this.contentCompare||Object.compare||x.compare;return this.reduce(function(b,d){return 0<a(d,b)?d:b},-Infinity)},count:function(a){return this.reduce(ua,void 0===a?0:a)},sum:function(a){return this.reduce(va,void 0===a?0:a)},average:function(a){var b=void 0===a?0:a,d=void 0===a?0:a;this.reduce(function(a,c){b+=c;d+=1},void 0);return b/d},concat:function(){for(var a=this.constructClone(this),b=0;b<arguments.length;b++)a.addEach(arguments[b]);return a},
-flatten:function(){return this.reduce(wa,this.constructClone())},zip:function(){var a=Array.prototype.slice.call(arguments);a.unshift(this);for(var b=[],d=Infinity,e=0;e<a.length;e++){var c=a[e];c.length<d&&(d=c.length)}for(e=0;e<a.length;e++){var r=0;a[e].reduce(function(a,c){r<d&&(b[r]=b[r]||[],b[r][e]=c);r++},void 0)}return b},sorted:function(a,b,d){a=a||this.contentCompare||Object.compare||x.compare;a.by?(b=a.by,a=a.compare||this.contentCompare||Object.compare||x.compare):b=b||ma;void 0===d&&
-(d=1);return this.map(function(a){return{by:b(a),value:a}}).sort(function(b,c){return a(b.by,c.by)*d}).map(function(a){return a.value})},reversed:function(){return this.constructClone(this).reverse()},clone:function(a,b){if(void 0===a)a=Infinity;else if(0===a)return this;var d=this.constructClone();this.forEach(function(c,g){Object.clone&&(c=Object.clone(c,a-1,b));d.set(g,c)},this);return d}},w={},ia=Object.prototype.toString;Array.isArray||(Array.isArray=function(a){return"[object Array]"==ia.call(a)});
-Array.prototype.forEach||(Array.prototype.forEach=c.forEach);Array.prototype.map||(Array.prototype.map=c.map);Array.prototype.filter||(Array.prototype.filter=c.filter);Array.prototype.every||(Array.prototype.every=c.every);Array.prototype.some||(Array.prototype.some=c.some);Array.prototype.reduce||(Array.prototype.reduce=function(a){var b=toObject(this),d=b.length>>>0;if("[object Function]"!=ia.call(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");
-var c=0,g;if(2<=arguments.length)g=arguments[1];else{do{if(c in b){g=b[c++];break}if(++c>=d)throw new TypeError("reduce of empty array with no initial value");}while(1)}for(;c<d;c++)c in b&&(g=a.call(void 0,g,b[c],c,b));return g});Array.prototype.reduceRight||(Array.prototype.reduceRight=function(a){var b=toObject(this),d=b.length>>>0;if("[object Function]"!=ia.call(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");
-var c,d=d-1;if(2<=arguments.length)c=arguments[1];else{do{if(d in b){c=b[d--];break}if(0>--d)throw new TypeError("reduceRight of empty array with no initial value");}while(1)}do d in this&&(c=a.call(void 0,c,b[d],d,b));while(d--);return c});Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=toObject(this),d=b.length>>>0;if(!d)return-1;var c=0;1<arguments.length&&(c=toInteger(arguments[1]));for(c=0<=c?c:Math.max(0,d+c);c<d;c++)if(c in b&&b[c]===a)return c;return-1});Array.prototype.lastIndexOf||
-(Array.prototype.lastIndexOf=function(a){var b=toObject(this),d=b.length>>>0;if(!d)return-1;var c=d-1;1<arguments.length&&(c=Math.min(c,toInteger(arguments[1])));for(c=0<=c?c:d-Math.abs(c);0<=c;c--)if(c in b&&a===b[c])return c;return-1});w;Array.empty=[];Object.freeze&&Object.freeze(Array.empty);Array.from=function(a){var b=[];b.addEach(a);return b};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 this};Array.prototype.add=function(a){this.push(a)};Array.prototype["delete"]=function(a,b){var d=this.find(a,b);-1!==d&&this.splice(d,1)};Array.prototype.find=function(a,b){for(var b=b||this.contentEquals||Object.equals||x.equals,d=0;d<this.length;d++)if(d in this&&b(this[d],a))return d;return-1};Array.prototype.findLast=function(a,b){var b=
-b||this.contentEquals||Object.equals||x.equals,d=this.length;do if(d--,d in this&&b(this[d],a))return d;while(0<d);return-1};Array.prototype.swap=function(a,b,d){var c=Array.prototype.slice.call(arguments,0,2);d&&c.push.apply(c,d);return this.splice.apply(this,c)};Array.prototype.toArray=c.toArray;Array.prototype.toObject=c.toArray;Array.prototype.addEach=c.addEach;Array.prototype.equals=c.equals;Array.prototype.compare=c.compare;Array.prototype.any=c.any;Array.prototype.all=c.all;Array.prototype.min=
-c.min;Array.prototype.max=c.max;Array.prototype.sum=c.sum;Array.prototype.average=c.average;Array.prototype.unique=c.unique;Array.prototype.flatten=c.flatten;Array.prototype.sorted=c.sorted;Array.prototype.reversed=c.reversed;Array.prototype.clone=c.clone;Array.prototype.count=function(){return this.length};Array.prototype.one=function(){if(0===this.length)throw Error("Can't get one element from empty array");return this[0]};Array.prototype.only=function(){if(1!==this.length)throw Error("Can't get only element of array with "+
-this.length+" elements.");return this[0]};Array.prototype.wipe=function(){this.length=0;return this};Array.prototype.iterate=function(a,b){return new na(this,a,b)};na.prototype.next=function(){if(this.start===(null==this.end?this.array.length:this.end))throw StopIteration;return this.array[this.start++]};var A={};A.module$exports=q;q.prototype.constructClone=function(a){return new this.constructor(a,this.mangle,this.content)};q.prototype.assertString=function(a){if("string"!==typeof a)throw new TypeError("key must be a string.");
-};q.prototype.get=function(a,b){this.assertString(a);var d="~"+a;return d in this.store?this.store[d]:1<arguments.length?b:this.content()};q.prototype.set=function(a,b){this.assertString(a);var d="~"+a;d in this.store||this.length++;this.store[d]=b};q.prototype.has=function(a){this.assertString(a);return"~"+a in this.store};q.prototype["delete"]=function(a){this.assertString(a);"~"+a in store&&this.length--;delete store["~"+a]};q.prototype.wipe=function(){for(var a in this.store)delete this.store[a];
-this.length=0};q.prototype.reduce=function(a,b,d){for(var c in this.store)b=a.call(d,b,this.store[c],Y(c),this);return b};q.prototype.keys=function(){return Object.keys(this.store).map(Y)};q.prototype.values=function(){var a=[],b;for(b in this.store)a.push(this.store[b]);return a};q.prototype.items=function(){var a=[],b;for(b in this.store)a.push([Y(b),this.store[b]]);return a};q.prototype.addEach=s.addEach;q.prototype.forEach=c.forEach;q.prototype.map=c.map;q.prototype.toArray=c.toArray;q.prototype.toObject=
-c.toObject;q.prototype.filter=c.filter;q.prototype.every=c.every;q.prototype.some=c.some;q.prototype.all=c.all;q.prototype.any=c.any;q.prototype.min=c.min;q.prototype.max=c.max;q.prototype.count=c.count;q.prototype.sum=c.sum;q.prototype.average=c.average;q.prototype.concat=c.concat;q.prototype.flatten=c.flatten;q.prototype.sorted=c.sorted;q.prototype.zip=c.zip;q.prototype.clone=c.clone;A.module$exports&&(A=A.module$exports);var H={};H.module$exports=f;var C=Function("return this")();f.prototype.constructClone=
-function(a){var b=[];c.addEach.call(b,a);return b};f.prototype.mapIterator=function(a,b){var d=f(this),c=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new d.constructor(function(){return a.call(b,d.next(),c++,d)})};f.prototype.filterIterator=function(a,b){var d=f(this),c=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new d.constructor(function(){for(var g;;)if(g=d.next(),a.call(b,g,c++,d))return g})};f.prototype.reduce=
-function(a){var b=f(this),d=arguments[1],c=arguments[2],g=0,r;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;try{r=b.next(),d=1<arguments.length?a.call(c,d,r,g,b):r,g++}catch(h){if(isStopIteration(h)){if(1<arguments.length)return arguments[1];throw TypeError("cannot reduce a value from an empty iterator with no initial value");}throw h;}try{for(;;)r=b.next(),d=a.call(c,d,r,g,b),g++}catch(i){if(isStopIteration(i))return d;throw i;}};f.prototype.forEach=c.forEach;f.prototype.map=
-c.map;f.prototype.toArray=c.toArray;f.prototype.toObject=c.toObject;f.prototype.filter=c.filter;f.prototype.all=c.all;f.prototype.any=c.any;f.prototype.min=c.min;f.prototype.max=c.max;f.prototype.sum=c.sum;f.prototype.average=c.average;f.prototype.flatten=c.flatten;f.prototype.every=function(a){var b=f(this),d=!0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(!a)throw d=!1,StopIteration;});return d};f.prototype.some=
-function(a){var b=f(this),d=!1;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(a)throw d=!0,StopIteration;});return d};f.prototype.concat=function(){return f.concat(Array.prototype.concat.apply(this,arguments))};f.prototype.dropWhile=function(a,b){var d=f(this),c=!1,g;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;d.forEach(function(r,f){if(!a.call(b,r,f,d))throw c=!0,g=r,StopIteration;
-});return c?d.constructor([g]).concat(d):d.constructor([])};f.prototype.takeWhile=function(a,b){var d=f(this);if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return d.mapIterator(function(c,g){if(!a.call(b,c,g,d))throw StopIteration;return c})};f.prototype.filterIterator=function(a,b){var d=f(this),c=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new d.constructor(function(){for(var g;;)if(g=d.next(),a.call(b,g,c++,d))return g})};
-f.prototype.zip=function(){return f.transpose(Array.prototype.concat.apply(this,arguments))};f.prototype.enumerate=function(a){return f.count(a).zip(this)};f.iterate=function(a){var b;b=0;return new f(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 d=a[b];b+=1;return d})};f.cycle=function(a,b){2>arguments.length&&(b=Infinity);var d=function(){throw StopIteration;};return new f(function(){var c;try{return d()}catch(g){if(isStopIteration(g)){if(0>=
-b)throw g;b--;c=f.iterate(a);d=c.next.bind(c);return d()}throw g;}})};f.concat=function(a){var a=f(a),b=function(){throw StopIteration;};return new f(function(){var d;try{return b()}catch(c){if(isStopIteration(c))return d=f(a.next()),b=d.next.bind(d),b();throw c;}})};f.transpose=function(a){a=f(a).map(f);return 1>a.length?new f([]):new f(function(){var b,d=a.map(function(a){try{return a.next()}catch(d){if(isStopIteration(d))b=!0;else throw d;}});if(b)throw StopIteration;return d})};f.zip=function(){return f.transpose(Array.prototype.slice.call(arguments))};
-f.chain=function(){return f.concat(Array.prototype.slice.call(arguments))};f.range=function(a,b,d){3>arguments.length&&(d=1);2>arguments.length&&(b=a,a=0);a=a||0;return new f(function(){if(a>=b)throw StopIteration;if(isNaN(a))throw"";var c=a;a+=d;return c})};f.count=function(a,b){return f.range(a,Infinity,b||1)};f.repeat=function(a,b){2>arguments.length&&(b=Infinity);return(new f.range(+b)).mapIterator(function(){return a})};"undefined"===typeof isStopIteration&&(C.isStopIteration=function(a){return"[object StopIteration]"===
-Object.prototype.toString.call(a)});if("undefined"===typeof StopIteration){C.StopIteration={};var Fa=Object.prototype.toString;Object.prototype.toString=function(){return this===C.StopIteration||this instanceof C.ReturnValue?"[object StopIteration]":Fa.call(this,arguments)}}"undefined"===typeof ReturnValue&&(C.ReturnValue=function(a){if(!(this instanceof C.ReturnValue))return new C.ReturnValue(a);this.value=a});H.module$exports&&(H=H.module$exports);var y={};y.module$exports=V;V.ascii={intersection:"+",
-through:"-",branchUp:"+",branchDown:"+",fromBelow:".",fromAbove:"'",fromBoth:"+",strafe:"|"};V.unicodeRound={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u256d",fromAbove:"\u2570",fromBoth:"\u2523",strafe:"\u2503"};V.unicodeSharp={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u250f",fromAbove:"\u2517",fromBoth:"\u2523",strafe:"\u2503"};y.module$exports&&(y=y.module$exports);var D={},E=function(a){if(a!==Object(a))throw new TypeError("Not an object: "+
-a);var b=a[S];if(b&&b.key===a)return b;if(ja.isExtensible(a))return b={key:a,gets:[],vals:[]},I(a,S,{value:b,writable:!1,enumerable:!1,configurable:!1}),b},X=function(a){a.prototype=null;return Object.freeze(a)};if(!("undefined"!==typeof ses&&ses.ok&&!ses.ok()))if("function"===typeof WeakMap)D.module$exports=WeakMap;else{var qa=Object.getOwnPropertyNames,I=Object.defineProperty,ja={};qa(Object).forEach(function(a){ja[a]=Object[a]});var S="ident:"+Math.random()+"___";if("undefined"!==typeof crypto&&
-"function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array){var z=new ArrayBuffer(25),z=new Uint8Array(z);crypto.getRandomValues(z);S="rand:"+Array.prototype.map.call(z,function(a){return(a%36).toString(36)}).join("")+"___"}I(Object,"getOwnPropertyNames",{value:function(a){return qa(a).filter(function(a){return a!==S})}});"getPropertyNames"in Object&&I(Object,"getPropertyNames",{value:function(a){return ja.getPropertyNames(a).filter(function(a){return a!==
-S})}});var Ga=Object.freeze;I(Object,"freeze",{value:function(a){E(a);return Ga(a)}});var Ha=Object.seal;I(Object,"seal",{value:function(a){E(a);return Ha(a)}});var Ia=Object.preventExtensions;I(Object,"preventExtensions",{value:function(a){E(a);return Ia(a)}});var ka=function(){function a(c,g){var r=E(c),f;r?(f=r.gets.indexOf(a),r=r.vals):(f=b.indexOf(c),r=d);return 0<=f?r[f]:g}var b=[],d=[];return Object.create(ka.prototype,{get___:{value:X(a)},has___:{value:X(function(d){var c=E(d);return 0<=(c?
-c.gets.indexOf(a):b.indexOf(d))})},set___:{value:X(function(c,g){var f=E(c),h;f?(h=f.gets.indexOf(a),0<=h?f.vals[h]=g:(f.gets.push(a),f.vals.push(g))):(h=b.indexOf(c),0<=h?d[h]=g:(b.push(c),d.push(g)))})},delete___:{value:X(function(c){var g=E(c);g?(c=g.gets.indexOf(a),0<=c&&(g.gets.splice(c,1),g.vals.splice(c,1))):(c=b.indexOf(c),0<=c&&(b.splice(c,1),d.splice(c,1)));return!0})}})};ka.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}});"undefined"!==typeof module&&(D.module$exports=ka)}D.module$exports&&(D=D.module$exports);var J,K,L,M,N,O,P,la=new D;J=function(){la.has(this)||la.set(this,{isActive:!1,changeListeners:[],willChangeListeners:[]});return la.get(this)};K=function(a,b){!this.isObservable&&
-this.makeObservable&&this.makeObservable();var c=this.getContentChangeDescriptor(),c=b?c.willChangeListeners:c.changeListeners;c.push(a);this.isObserved=!!c.length};L=function(a,b){var c=this.getContentChangeDescriptor(),c=b?c.willChangeListeners:c.changeListeners,e=c.find(a);if(!e)throw Error("Can't remove listener: does not exist.");c.splice(e,1);this.isObserved=!!c.length};M=function(a,b,c,e){var g=this.getContentChangeDescriptor();if(!g.isActive){g.isActive=!0;var f;f=e?g.willChangeListeners:
-g.changeListeners;try{f.forEach(function(g){g.handleEvent?g.handleEvent({phase:e?"before":"after",currentTarget:this,target:this,plus:a,minus:b,index:c}):(g=e?g.handleContentWillChange||g:g.handleContentChange||g,g.call&&g.call(this,a,b,c,e))},this)}finally{g.isActive=!1}}};N=function(a){return this.addContentChangeListener(a,!0)};O=function(a){return this.removeContentChangeListener(a,!0)};P=function(a,b,c){return this.dispatchContentChange(a,b,c,!0)};z={};z.module$exports=h;var Z=x;h.prototype.constructClone=
-function(a){return new this.constructor(a,this.contentEquals,this.content)};h.prototype.find=function(a,b){for(var b=b||this.contentEquals,c=this.head,e=c.next;e!==c;){if(b(e.value,a))return e;e=e.next}};h.prototype.findLast=function(a,b){for(var b=b||this.contentEquals,c=this.head,e=c.prev;e!==c;){if(b(e.value,a))return e;e=e.prev}};h.prototype.has=function(a,b){return!!this.find(a,b)};h.prototype.get=function(a,b){var c=this.find(a,b);return c?c.value:this.content()};h.prototype["delete"]=function(a,
-b){var c=this.findLast(a,b);return c?(c["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]),!0):!1};h.prototype.wipe=function(){this.head.next=this.head.prev=this.head};h.prototype.add=function(a){this.head.addBefore(new this.Node(a));this.length++;this.isObserved&&this.dispatchContentChange([a],[])};h.prototype.push=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b],e=new this.Node(c);a.addBefore(e);this.length++;this.isObserved&&this.dispatchContentChange([c],
-[])}};h.prototype.unshift=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b],e=new this.Node(c);a.addAfter(e);this.length++;this.isObserved&&this.dispatchContentChange([c],[]);a=e}};h.prototype.pop=function(){var a,b=this.head;b.prev!==b&&(a=b.prev.value,b.prev["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]));return a};h.prototype.shift=function(){var a,b=this.head;b.prev!==b&&(a=b.next.value,b.next["delete"](),this.length--,this.isObserved&&
-this.dispatchContentChange([],[a]));return a};h.prototype.scan=function(a,b){var c=this.head;if("number"===typeof a){var e=a;if(0<=e)for(a=c.next;e&&!(e--,a=a.next,a==c););else for(a=c;0>e&&!(e++,a=a.prev,a==c););return a}return a||b};h.prototype.slice=function(a,b){for(var c=[],e=this.head,a=this.scan(a,e.next),b=this.scan(b,e);a!==b&&a!==e;)c.push(a.value),a=a.next;return c};h.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,2))};h.prototype.swap=function(a,
-b,c){var e=[],g=a,a=this.scan(a,this.head);for(void 0===b&&(b=Infinity);b--&&0<=b&&a!==this.head;)e.push(a.value),a["delete"](),a=a.next,this.length--;if(c){null===g&&a===this.head&&(a=this.head.next);for(b=0;b<c.length;b++)g=new this.Node(c[b]),a.addBefore(g);this.length+=c.length}return e};h.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};h.prototype.reduce=function(a,b,c){for(var e=this.head,g=e.next;g!==e;)b=a.call(c,
-b,g.value,g,this),g=g.next;return b};h.prototype.reduceRight=function(a,b,c){for(var e=this.head,g=e.prev;g!==e;)b=a.call(c,b,g.value,g,this),g=g.prev;return b};h.prototype.addEach=c.addEach;h.prototype.forEach=c.forEach;h.prototype.map=c.map;h.prototype.toArray=c.toArray;h.prototype.filter=c.filter;h.prototype.every=c.every;h.prototype.some=c.some;h.prototype.all=c.all;h.prototype.any=c.any;h.prototype.min=c.min;h.prototype.max=c.max;h.prototype.count=c.count;h.prototype.sum=c.sum;h.prototype.average=
-c.average;h.prototype.concat=c.concat;h.prototype.flatten=c.flatten;h.prototype.zip=c.zip;h.prototype.equals=c.equals;h.prototype.compare=c.compare;h.prototype.sorted=c.sorted;h.prototype.reversed=c.reversed;h.prototype.clone=c.clone;h.prototype.getContentChangeDescriptor=J;h.prototype.addContentChangeListener=K;h.prototype.removeContentChangeListener=L;h.prototype.dispatchContentChange=M;h.prototype.addBeforeContentChangeListener=N;h.prototype.removeBeforeContentChangeListener=O;h.prototype.dispatchBeforeContentChange=
-P;h.prototype.equals=function(a,b){b=b||this.contentEquals||Object.equals||Z.equals;return this===a?!0:this.length===a.length&&this.zip(a).every(function(a){return b(a[0],a[1])})};h.prototype.one=function(){if(this.head===this.head.next)throw Error("Can't get one value from empty list");return this.head.next.value};h.prototype.only=function(){if(this.head===this.head.next)throw Error("Can't get only value in empty list");if(this.head.prev!==this.head.next)throw Error("Can't get only value in list with multiple values");
-return this.head.next.value};h.prototype.iterate=function(){return new oa(this.head)};oa.prototype.next=function(){if(this.at===this.head)throw StopIteration;var a=this.at.value;this.at=this.at.next;return a};h.prototype.Node=W;W.prototype["delete"]=function(){this.prev.next=this.next;this.next.prev=this.prev};W.prototype.addBefore=function(a){var b=this.prev;this.prev=a;a.prev=b;b.next=a;a.next=this};W.prototype.addAfter=function(a){var b=this.next;this.next=a;a.next=b;b.prev=a;a.prev=this};z.module$exports&&
-(z=z.module$exports);var F={},$=x,Ja=y,Ka=H;F.module$exports=j;j.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};j.prototype.Buckets=A;j.prototype.Bucket=z;j.prototype.has=function(a){var b=this.contentHash(a);return this.buckets.get(b).has(a)};j.prototype.get=function(a){var b=this.contentHash(a),c=this.buckets;return c.has(b)?c.get(b).get(a):this.content(a)};j.prototype["delete"]=function(a){var b=this.contentHash(a),c=this.buckets;
-if(c.has(b)){var e=c.get(b);if(e["delete"](a))return this.isObserved&&this.dispatchBeforeContentChange([],[a]),this.length--,0===e.length&&delete c[b],this.isObserved&&this.dispatchContentChange([],[a]),!0}return!1};j.prototype.wipe=function(){this.buckets.wipe();this.length=0};j.prototype.add=function(a){var b=this.contentHash(a),c=this.buckets;c.has(b)||c.set(b,new this.Bucket(null,this.contentEquals));c.get(b).has(a)||(this.isObserved&&this.dispatchBeforeContentChange([a],[]),c.get(b).add(a),this.length++,
-this.isObserved&&this.dispatchContentChange([a],[]))};j.prototype.reduce=function(a,b,c){return this.buckets.reduce(function(b,g){return g.reduce(a,b,c)},b)};j.prototype.addEach=c.addEach;j.prototype.forEach=c.forEach;j.prototype.map=c.map;j.prototype.toArray=c.toArray;j.prototype.filter=c.filter;j.prototype.every=c.every;j.prototype.some=c.some;j.prototype.all=c.all;j.prototype.any=c.any;j.prototype.min=c.min;j.prototype.max=c.max;j.prototype.count=c.count;j.prototype.sum=c.sum;j.prototype.average=
-c.average;j.prototype.concat=c.concat;j.prototype.flatten=c.flatten;j.prototype.zip=c.zip;j.prototype.sorted=c.sorted;j.prototype.clone=c.clone;j.prototype.getContentChangeDescriptor=J;j.prototype.addContentChangeListener=K;j.prototype.removeContentChangeListener=L;j.prototype.dispatchContentChange=M;j.prototype.addBeforeContentChangeListener=N;j.prototype.removeBeforeContentChangeListener=O;j.prototype.dispatchBeforeContentChange=P;j.prototype.equals=function(a){var b=this;return Object(a)===a&&
-"function"===typeof a.reduce&&"number"===typeof a.length&&this.length===a.length&&a.reduce(function(a,c){return a&&b.has(c)},!0)};j.prototype.iterate=function(){var a=this.buckets,b=a.keys();return Ka.concat(b.map(function(b){return a.get(b).iterate()}))};j.prototype.log=function(a,b){var a=a||Ja.unicodeSharp,b=b||this.stringify,c=this.buckets,e=c.keys();e.forEach(function(g,f){var h,i;f===e.length-1?(h=a.fromAbove,i=" "):(h=a.fromBoth,i=a.strafe);var j=c[g];console.log(h+a.through+a.branchDown+" "+
-g);j.forEach(function(c,d){console.log(b(c,i+" "+(d===j.head.prev?a.fromAbove:a.fromBoth)+a.through+a.through+" ",i+" "))})})};j.prototype.stringify=function(a,b){return Object(a)===a?b+JSON.stringify(a):b+a};F.module$exports&&(F=F.module$exports);var A={},ya=F,aa=x,t=s;A.module$exports=m;m.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};m.prototype.addEach=t.addEach;m.prototype.has=t.has;m.prototype.get=t.get;m.prototype.set=
-t.set;m.prototype["delete"]=t["delete"];m.prototype.wipe=t.wipe;m.prototype.reduce=t.reduce;m.prototype.keys=t.keys;m.prototype.values=t.values;m.prototype.items=t.items;m.prototype.Item=t.Item;m.prototype.forEach=c.forEach;m.prototype.map=c.map;m.prototype.toArray=c.toArray;m.prototype.toObject=c.toObject;m.prototype.filter=c.filter;m.prototype.every=c.every;m.prototype.some=c.some;m.prototype.all=c.all;m.prototype.any=c.any;m.prototype.min=c.min;m.prototype.max=c.max;m.prototype.count=c.count;m.prototype.sum=
-c.sum;m.prototype.average=c.average;m.prototype.concat=c.concat;m.prototype.flatten=c.flatten;m.prototype.sorted=c.sorted;m.prototype.zip=c.zip;m.prototype.clone=c.clone;m.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};m.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};A.module$exports&&(A=A.module$exports);var t={},za=z,Aa=F,ba=x;t.module$exports=k;k.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,
-this.contentHash,this.content)};k.prototype.has=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)};k.prototype.get=function(a){var b=new this.contentList.Node(a);return(b=this.contentSet.get(b))?b.value:this.content(a)};k.prototype.add=function(a){var b=new this.contentList.Node(a);this.contentSet.has(b)||(this.contentList.add(a),b=this.contentList.head.prev,this.contentSet.add(b),this.length++)};k.prototype["delete"]=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)?
-(a=this.contentSet.get(a),this.contentSet["delete"](a),a["delete"](),this.length--,!0):!1};k.prototype.wipe=function(){this.contentSet.wipe();this.contentList.wipe()};k.prototype.reduce=function(){var a=this.contentList;return a.reduce.apply(a,arguments)};k.prototype.reduceRight=function(){var a=this.contentList;return a.reduceRight.apply(a,arguments)};k.prototype.addEach=c.addEach;k.prototype.forEach=c.forEach;k.prototype.map=c.map;k.prototype.toArray=c.toArray;k.prototype.filter=c.filter;k.prototype.every=
-c.every;k.prototype.some=c.some;k.prototype.all=c.all;k.prototype.any=c.any;k.prototype.min=c.min;k.prototype.max=c.max;k.prototype.count=c.count;k.prototype.sum=c.sum;k.prototype.average=c.average;k.prototype.concat=c.concat;k.prototype.flatten=c.flatten;k.prototype.zip=c.zip;k.prototype.sorted=c.sorted;k.prototype.clone=c.clone;k.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,
-arguments)});this.isObservable=!0};k.prototype.getContentChangeDescriptor=J;k.prototype.addContentChangeListener=K;k.prototype.removeContentChangeListener=L;k.prototype.dispatchContentChange=M;k.prototype.addBeforeContentChangeListener=N;k.prototype.removeBeforeContentChangeListener=O;k.prototype.dispatchBeforeContentChange=P;k.prototype.equals=function(a){return this.contentSet.equals(a)};k.prototype.iterate=function(){return this.contentList.iterate()};k.prototype.log=function(){var a=this.contentSet;
-return a.log.apply(a,arguments)};t.module$exports&&(t=t.module$exports);var Q={},Ba=t,ca=x;Q.module$exports=l;l.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};l.prototype.has=function(a){return this.contentSet.has(a)};l.prototype.get=function(a){a=this.contentSet.get(a);void 0!==a?(this.contentSet["delete"](a),this.contentSet.add(a)):a=this.content();return a};l.prototype.add=function(a){if(this.contentSet.has(a))this.contentSet["delete"](a);
-this.contentSet.add(a);if(this.contentSet.length>this.maxLength)this.contentSet["delete"](this.contentSet.contentList.head.next.value)};l.prototype["delete"]=function(a){this.contentSet["delete"](a)};l.prototype.wipe=function(){this.contentSet.wipe()};l.prototype.reduce=function(){var a=this.contentSet;return a.reduce.apply(a,arguments)};l.prototype.reduceRight=function(){var a=this.contentSet;return a.reduceRight.apply(a,arguments)};l.prototype.addEach=c.addEach;l.prototype.forEach=c.forEach;l.prototype.map=
-c.map;l.prototype.toArray=c.toArray;l.prototype.filter=c.filter;l.prototype.every=c.every;l.prototype.some=c.some;l.prototype.all=c.all;l.prototype.any=c.any;l.prototype.min=c.min;l.prototype.max=c.max;l.prototype.count=c.count;l.prototype.sum=c.sum;l.prototype.average=c.average;l.prototype.concat=c.concat;l.prototype.flatten=c.flatten;l.prototype.zip=c.zip;l.prototype.sorted=c.sorted;l.prototype.clone=c.clone;l.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,
-arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,arguments)});this.isObservable=!0};l.prototype.getContentChangeDescriptor=J;l.prototype.addContentChangeListener=K;l.prototype.removeContentChangeListener=L;l.prototype.dispatchContentChange=M;l.prototype.addBeforeContentChangeListener=N;l.prototype.removeBeforeContentChangeListener=O;l.prototype.dispatchBeforeContentChange=P;l.prototype.equals=function(a){return this.contentSet.equals(a)};l.prototype.iterate=
-function(){return this.contentSet.iterate()};Q.module$exports&&(Q=Q.module$exports);var T={},Ca=Q,da=x,u=s;T.module$exports=n;n.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};n.prototype.addEach=u.addEach;n.prototype.has=u.has;n.prototype.get=u.get;n.prototype.set=u.set;n.prototype["delete"]=u["delete"];n.prototype.wipe=u.wipe;n.prototype.reduce=u.reduce;n.prototype.keys=u.keys;n.prototype.values=u.values;n.prototype.items=
-u.items;n.prototype.Item=u.Item;n.prototype.forEach=c.forEach;n.prototype.map=c.map;n.prototype.toArray=c.toArray;n.prototype.toObject=c.toObject;n.prototype.filter=c.filter;n.prototype.every=c.every;n.prototype.some=c.some;n.prototype.all=c.all;n.prototype.any=c.any;n.prototype.min=c.min;n.prototype.max=c.max;n.prototype.count=c.count;n.prototype.sum=c.sum;n.prototype.average=c.average;n.prototype.concat=c.concat;n.prototype.flatten=c.flatten;n.prototype.sorted=c.sorted;n.prototype.zip=c.zip;n.prototype.clone=
-c.clone;n.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};n.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};T.module$exports&&(T=T.module$exports);var u={},Da=t,ea=x,v=s;u.module$exports=o;o.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};o.prototype.addEach=v.addEach;o.prototype.has=v.has;o.prototype.get=v.get;o.prototype.set=v.set;o.prototype["delete"]=v["delete"];
-o.prototype.wipe=v.wipe;o.prototype.reduce=v.reduce;o.prototype.keys=v.keys;o.prototype.values=v.values;o.prototype.items=v.items;o.prototype.Item=v.Item;o.prototype.forEach=c.forEach;o.prototype.map=c.map;o.prototype.toArray=c.toArray;o.prototype.toObject=c.toObject;o.prototype.filter=c.filter;o.prototype.every=c.every;o.prototype.some=c.some;o.prototype.all=c.all;o.prototype.any=c.any;o.prototype.min=c.min;o.prototype.max=c.max;o.prototype.count=c.count;o.prototype.sum=c.sum;o.prototype.average=
-c.average;o.prototype.concat=c.concat;o.prototype.flatten=c.flatten;o.prototype.sorted=c.sorted;o.prototype.zip=c.zip;o.prototype.clone=c.clone;o.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};o.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};u.module$exports&&(u=u.module$exports);var v={},fa=u;v.module$exports=B;B.prototype=Object.create(fa.prototype);B.prototype.constructClone=function(a){return new this.constructor(a,this.bucket,
-this.contentEquals,this.contentHash)};B.prototype.set=function(a,b){var c=this.get(a);c.swap(0,c.length,b)};B.prototype.bucket=function(){return[]};v.module$exports&&(v=v.module$exports);var R={};R.module$exports=i;var ga=x;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);this.root?(this.splay(a),this.contentEquals(a,this.root.value)||(this.isObserved&&this.dispatchBeforeContentChange([a],[]),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=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]))):(this.isObserved&&
-this.dispatchBeforeContentChange([a],[]),this.root=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]))};i.prototype["delete"]=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value))){if(this.root.left){var b=this.root.right;this.root=this.root.left;this.splay(a);this.root.right=b}else this.root=this.root.right;this.length--;this.isObserved&&this.dispatchContentChange([],[a])}};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.splay=function(a){var b,c,e,g,f;if(this.root){b=c=e=new this.Node;for(f=this.root;;)if(g=this.contentCompare(a,f.value),0>g)if(f.left){if(0>this.contentCompare(a,f.left.value)&&(g=f.left,f.left=g.right,g.right=f,f=g,!f.left))break;e=e.left=f;f=f.left}else break;else if(0<g)if(f.right){if(0<this.contentCompare(a,
-f.right.value)&&(g=f.right,f.right=g.left,g.left=f,f=g,!f.right))break;c=c.right=f;f=f.right}else break;else break;c.right=f.left;e.left=f.right;f.left=b.right;f.right=b.left;this.root=f}};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.addEach=c.addEach;i.prototype.forEach=c.forEach;i.prototype.map=c.map;i.prototype.toArray=c.toArray;i.prototype.filter=
-c.filter;i.prototype.every=c.every;i.prototype.some=c.some;i.prototype.all=c.all;i.prototype.any=c.any;i.prototype.count=c.count;i.prototype.sum=c.sum;i.prototype.average=c.average;i.prototype.flatten=c.flatten;i.prototype.zip=c.flatten;i.prototype.sorted=c.sorted;i.prototype.clone=c.clone;i.prototype.getContentChangeDescriptor=J;i.prototype.addContentChangeListener=K;i.prototype.removeContentChangeListener=L;i.prototype.dispatchContentChange=M;i.prototype.addBeforeContentChangeListener=N;i.prototype.removeBeforeContentChangeListener=
-O;i.prototype.dispatchBeforeContentChange=P;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.only=function(){if(!this.root)throw Error("Can't get only value in empty set");if(this.root.left||this.root.right)throw Error("Can't get only value in set with multiple values");return this.root.value};
-i.prototype.wipe=function(){this.root=null};i.prototype.iterate=function(a,b){return new this.Iterator(this,a,b)};i.prototype.Iterator=pa;i.prototype.log=function(a,b){this.report(console.log,console,a,b)};i.prototype.report=function(a,b,c,e){c=c||i.unicodeRound;e=e||this.stringify;this.root&&this.root.report(a,b,c,e)};i.prototype.stringify=function(a,b,c,e){a.call(b,e+" "+c.value)};i.unicodeRound=y.unicodeRound;i.unicodeSharp=y.unicodeSharp;i.ascii=y.ascii;i.prototype.Node=G;G.prototype.reduce=function(a,
-b,c,e,f){f=f||0;this.left&&(b=this.left.reduce(a,b,c,e,f+1));b=a.call(c,b,this.value,this,e,f);this.right&&(b=this.right.reduce(a,b,c,e,f+1));return b};G.prototype.reduceRight=function(a,b,c,e,f){f=f||0;this.right&&(b=this.right.reduce(a,b,c,e,f+1));b=a.call(c,b,this.value,this,e,f);this.left&&(b=this.left.reduce(a,b,c,e,f+1));return b};G.prototype.getNext=function(){var a=this;if(a.right){for(a=a.right;a.left;)a=a.left;return a}};G.prototype.getPrevious=function(){var a=this;if(a.left){for(a=a.left;a.right;)a=
-a.right;return a}};G.prototype.report=function(a,b,c,e,f,h,i){var f=f||"",h=h||"",i=i||"",j;j=this.left&&this.right?c.intersection:this.left?c.branchUp:this.right?c.branchDown:c.through;this.left&&this.left.report(a,b,c,e,h+c.fromBelow+c.through,h+" ",h+c.strafe+" ");e(a,b,this,f+j,i+(this.right?c.strafe:" "),h+(this.left?c.strafe:" "));this.right&&this.right.report(a,b,c,e,i+c.fromAbove+c.through,i+c.strafe+" ",i+" ")};pa.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};R.module$exports&&(R=R.module$exports);var y={},Ea=R,ha=x;y.module$exports=p;p.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};p.prototype.addEach=s.addEach;p.prototype.has=s.has;p.prototype.get=s.get;p.prototype.set=s.set;p.prototype["delete"]=s["delete"];p.prototype.wipe=
-s.wipe;p.prototype.reduce=s.reduce;p.prototype.keys=s.keys;p.prototype.values=s.values;p.prototype.items=s.items;p.prototype.Item=s.Item;p.prototype.forEach=c.forEach;p.prototype.map=c.map;p.prototype.toArray=c.toArray;p.prototype.filter=c.filter;p.prototype.every=c.every;p.prototype.some=c.some;p.prototype.all=c.all;p.prototype.any=c.any;p.prototype.min=c.min;p.prototype.max=c.max;p.prototype.count=c.count;p.prototype.sum=c.sum;p.prototype.average=c.average;p.prototype.flatten=c.flatten;p.prototype.zip=
-c.zip;p.prototype.clone=c.clone;p.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};p.prototype.report=function(a,b,c,e){e=e||this.stringify;this.contentSet.report(a,b,c,e)};p.prototype.stringify=function(a,b,c,e){a.call(b,e+" "+c.value.key+": "+c.value.value)};y.module$exports&&(y=y.module$exports);w;({});window.List=z;window.Set=t;window.Map=u;window.MultiMap=v;window.SortedSet=R;window.SortedMap=y;window.LruSet=Q;window.LruMap=T;window.FastSet=F;window.FastMap=A;window.WeakMap=
-D;window.Iterator=H})();
+(function(r){function ja(a,b){return b}function ka(a){return a}function la(a,b){return[b,a]}function V(){}function ma(a,b){return a+b}function na(a,b){b.forEach(oa,a);return a}function oa(a){this.push(a)}function da(a){return a}function ea(a,b,d){this.array=a;this.start=null==b?0:b;this.end=d}function p(a,b){if(!(this instanceof p))return new p(a,b);this.content=b||Function.noop;this.store={};this.length=0;this.addEach(a)}function f(a){if(!(this instanceof f))return new f(a);if(Array.isArray(a)||
+"string"===typeof a)return f.iterate(a);a=Object(a);if(a instanceof f)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]"===Object.prototype.toString.call(a))this.next=a;else throw new TypeError("Cannot iterate");}function h(a,b,d){if(!(this instanceof h))return new h(a,b,d);var e=this.head=new this.Node;e.next=e;e.prev=e;this.contentEquals=b||Object.equals;this.content=d||Function.noop;this.length=
+0;this.addEach(a)}function fa(a){this.head=a;this.at=a.next}function W(a){this.value=a;this.next=this.prev=null}function j(a,b,d,e){if(!(this instanceof j))return new j(a,b,d);b=b||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentEquals=b;this.contentHash=d;this.content=e;this.buckets=new this.Buckets(null,this.Bucket);this.length=0;this.addEach(a)}function m(a,b,d,e){if(!(this instanceof m))return new m(a,b,d);b=b||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentEquals=
+b;this.contentHash=d;this.content=e;this.contentSet=new pa(void 0,function(a,d){return b(a.key,d.key)},function(a){return d(a.key)});this.length=0;this.addEach(a)}function k(a,b,d,e){if(!(this instanceof k))return new k(a,b,d);b=b||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentEquals=b;this.contentHash=d;this.contentList=new qa(void 0,b);this.content=e;this.contentSet=new ra(void 0,function(a,d){return b(a.value,d.value)},function(a){return d(a.value)});this.length=0;this.addEach(a)}
+function l(a,b,d,e,c){if(!(this instanceof l))return new l(a,b,d,e);b=b||Infinity;d=d||Object.equals;e=e||Object.hash;c=c||Function.noop;this.contentSet=new sa(void 0,d,e);this.contentEquals=d;this.contentHash=e;this.content=c;this.maxLength=b;this.length=0;this.addEach(a)}function n(a,b,d,e,c){if(!(this instanceof n))return new n(a,b,d,e);d=d||Object.equals;e=e||Object.hash;c=c||Function.noop;this.contentEquals=d;this.contentHash=e;this.content=c;this.contentSet=new ta(void 0,b,function(a,b){return d(a.key,
+b.key)},function(a){return e(a.key)});this.length=0;this.addEach(a)}function o(a,b,d,e){if(!(this instanceof o))return new o(a,b,d);b=b||Object.equals;d=d||Object.hash;e=e||Function.noop;this.contentEquals=b;this.contentHash=d;this.content=e;this.contentSet=new ua(void 0,function(a,d){return b(a.key,d.key)},function(a){return d(a.key)});this.length=0;this.addEach(a)}function D(a,b,d,e){if(!(this instanceof D))return new D(a,b,d,e);this.bucket=b||this.bucket;Y.call(this,a,d,e,function(a){var b=this.bucket();
+Y.prototype.set.call(this,a,b);return b})}function i(a,b,d,e){if(!(this instanceof i))return new i(a,b,d);this.contentEquals=b||Object.equals;this.contentCompare=d||Object.compare;this.content=e||Function.noop;this.root=null;this.length=0;this.addEach(a)}function H(a){this.value=a;this.right=this.left=null}function ga(a,b,d){this.set=a;this.prev=null;this.end=d;if(b&&(a=this.set.findLeastGreaterThanOrEqual(b)))this.set.splay(a.value),this.prev=a.getPrevious()}function q(a,b,d,e){if(!(this instanceof
+q))return new q(a,b,d,e);b=b||Object.equals;d=d||Object.compare;e=e||Function.noop;this.contentEquals=b;this.contentCompare=d;this.content=e;this.contentSet=new va(null,function(a,d){return b(a.key,d.key)},function(a,b){return d(a.key,b.key)});this.length=0;this.addEach(a)}var s={},t=s.module$exports={};t.addEach=function(a){a&&Object(a)===a&&("function"===typeof a.forEach?"function"===typeof a.keys?a.forEach(function(a,d){this.set(d,a)},this):a.forEach(function(a){this.set(a[0],a[1])},this):Object.keys(a).forEach(function(b){this.set(b,
+a[b])},this))};t.get=function(a,b){var d=this.contentSet.get(new this.Item(a));return d?d.value:1<arguments.length?b:this.content(a)};t.set=function(a,b){var d=new this.Item(a,b),e=this.contentSet.get(d);if(e)e.value=b;else if(this.contentSet.add(d))return this.length++,!0;return!1};t.has=function(a){return this.contentSet.has(new this.Item(a))};t["delete"]=function(a){return this.contentSet["delete"](new this.Item(a))?(this.length--,!0):!1};t.clear=function(){this.contentSet.clear();this.length=
+0};t.reduce=function(a,b,d){return this.contentSet.reduce(function(b,c){return a.call(d,b,c.value,c.key,this)},b,this)};t.reduceRight=function(a,b,d){return this.contentSet.reduceRight(function(b,c){return a.call(d,b,c.value,c.key,this)},b,this)};t.keys=function(){return this.map(ja)};t.values=function(){return this.map(ka)};t.items=function(){return this.map(la)};t.Item=function(a,b){this.key=a;this.value=b};s.module$exports&&(s=s.module$exports);var z={};z.module$exports=V;V.ascii={intersection:"+",
+through:"-",branchUp:"+",branchDown:"+",fromBelow:".",fromAbove:"'",fromBoth:"+",strafe:"|"};V.unicodeRound={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u256d",fromAbove:"\u2570",fromBoth:"\u2523",strafe:"\u2503"};V.unicodeSharp={intersection:"\u254b",through:"\u2501",branchUp:"\u253b",branchDown:"\u2533",fromBelow:"\u250f",fromAbove:"\u2517",fromBoth:"\u2523",strafe:"\u2503"};z.module$exports&&(z=z.module$exports);var v=t={},A;if("undefined"!==typeof WeakMap)A=
+WeakMap;else{var X=function(a){a.prototype=null;return Object.freeze(a)},ha=Object.getOwnPropertyNames,I=Object.defineProperty,Z={};ha(Object).forEach(function(a){Z[a]=Object[a]});var S="ident:"+Math.random()+"___";"undefined"!==typeof crypto&&("function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array)&&(A=new ArrayBuffer(25),A=new Uint8Array(A),crypto.getRandomValues(A),S="rand:"+Array.prototype.map.call(A,function(a){return(a%36).toString(36)}).join("")+
+"___");I(Object,"getOwnPropertyNames",{value:function(a){return ha(a).filter(function(a){return a!==S})}});"getPropertyNames"in Object&&I(Object,"getPropertyNames",{value:function(a){return Z.getPropertyNames(a).filter(function(a){return a!==S})}});var E=function(a){if(a!==Object(a))throw new TypeError("Not an object: "+a);var b=a[S];if(b&&b.key===a)return b;if(Z.isExtensible(a))return b={key:a,gets:[],vals:[]},I(a,S,{value:b,writable:false,enumerable:false,configurable:false}),b},wa=Object.freeze;
+I(Object,"freeze",{value:function(a){E(a);return wa(a)}});var xa=Object.seal;I(Object,"seal",{value:function(a){E(a);return xa(a)}});var ya=Object.preventExtensions;I(Object,"preventExtensions",{value:function(a){E(a);return ya(a)}});var $=function(){function a(e,c){var x=E(e),f;x?(f=x.gets.indexOf(a),x=x.vals):(f=b.indexOf(e),x=d);return 0<=f?x[f]:c}var b=[],d=[];return Object.create($.prototype,{get___:{value:X(a)},has___:{value:X(function(d){var c=E(d);return 0<=(c?c.gets.indexOf(a):b.indexOf(d))})},
+set___:{value:X(function(e,c){var x=E(e),f;x?(f=x.gets.indexOf(a),0<=f?x.vals[f]=c:(x.gets.push(a),x.vals.push(c))):(f=b.indexOf(e),0<=f?d[f]=c:(b.push(e),d.push(c)))})},delete___:{value:X(function(e){var c=E(e);c?(e=c.gets.indexOf(a),0<=e&&(c.gets.splice(e,1),c.vals.splice(e,1))):(e=b.indexOf(e),0<=e&&(b.splice(e,1),d.splice(e,1)));return true})}})};$.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}});A=$}v.module$exports=A;t.module$exports&&(t=t.module$exports);v={};A=t;v.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 aa=new A;Object.hash=function(a){return Object.can(a,
+"hash")?""+a.hash():Object(a)===a?(aa.has(a)||aa.set(a,Math.random().toString(36).slice(2)),aa.get(a)):""+a};var ia=Object.prototype.hasOwnProperty;Object.owns=function(a,b){return ia.call(a,b)};Object.can=function(a,b){return null!=a&&"function"===typeof a[b]&&!ia.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,d){if("object"!==typeof a)throw Error("Object.get can't accept non-object: "+typeof a);return Object.can(a,"get")?a.get(b,d):Object.has(a,b)?a[b]:d};Object.set=function(a,b,d){Object.can(a,"set")?a.set(b,d):a[b]=d};Object.forEach=function(a,b,d){Object.keys(a).forEach(function(c){b.call(d,a[c],c,a)})};Object.map=function(a,b,d){return Object.keys(a).map(function(c){return b.call(d,a[c],c,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){a=Object.getValueOf(a);b=Object.getValueOf(b);return a===b?0!==a||1/a===1/b:Object.can(a,"equals")?a.equals(b):Object.can(b,"equals")?b.equals(a):a!==a&&b!==b};Object.compare=function(a,b){a=Object.getValueOf(a);b=Object.getValueOf(b);return a===b?0:"number"===typeof a&&"number"===typeof b?a-b:"string"===typeof a?a<b?-1:1:Object.can(a,"compare")?a.compare(b):Object.can(b,"compare")?-b.compare(a):0};Object.clone=function(a,
+b,d){a=Object.getValueOf(a);if(void 0===b)b=Infinity;else if(0===b)return a;return d&&Object.isObject(a)&&Object.can(a,"clone")?(d.has(a)||d.set(a,a.clone(b,d)),d.get(a)):a};Object.clear=function(a){if(Object.can(a,"clear"))a.clear();else for(var b=Object.keys(a),d=b.length;d;)d--,delete a[b[d]];return a};Function.noop=function(){};Function.identity=function(a){return a};v.module$exports&&(v=v.module$exports);var J,K,L,M,N,O,P,ba=new t;J=function(){ba.has(this)||ba.set(this,{isActive:!1,changeListeners:[],
+willChangeListeners:[]});return ba.get(this)};K=function(a,b){!this.isObservable&&this.makeObservable&&this.makeObservable();var d=this.getContentChangeDescriptor(),d=b?d.willChangeListeners:d.changeListeners;d.push(a);this.isObserved=!!d.length};L=function(a,b){var d=this.getContentChangeDescriptor(),d=b?d.willChangeListeners:d.changeListeners,c=d.find(a);if(!c)throw Error("Can't remove listener: does not exist.");d.splice(c,1);this.isObserved=!!d.length};M=function(a,b,d,c){var g=this.getContentChangeDescriptor();
+if(!g.isActive){g.isActive=!0;var x;x=c?g.willChangeListeners:g.changeListeners;try{x.forEach(function(g){g.handleEvent?g.handleEvent({phase:c?"before":"after",currentTarget:this,target:this,plus:a,minus:b,index:d}):(g=c?g.handleContentWillChange||g:g.handleContentChange||g,g.call&&g.call(this,a,b,d,c))},this)}finally{g.isActive=!1}}};N=function(a){return this.addContentChangeListener(a,!0)};O=function(a){return this.removeContentChangeListener(a,!0)};P=function(a,b,d){return this.dispatchContentChange(a,
+b,d,!0)};var c={};v;c.addEach=function(a){a&&Object(a)===a&&("function"===typeof a.forEach?a.forEach(this.add,this):Object.keys(a).forEach(function(b){this.add(a[b],b)},this))};c.forEach=function(a,b){return this.reduce(function(d,c,g,x,f){a.call(b,c,g,x,f)},void 0)};c.map=function(a,b){var d=[];this.reduce(function(c,g,f,h,i){d.push(a.call(b,g,f,h,i))},void 0);return d};c.toArray=function(){return this.map(da)};c.toObject=function(){var a={};this.reduce(function(b,d,c){a[c]=d},void 0);return a};
+c.filter=function(a,b){var d=this.constructClone();this.reduce(d,function(c,g,f,h,i){a.call(b,g,f,h,i)&&d.push(g)},void 0);return d};c.every=function(a,b){return this.reduce(function(d,c,g,f,h){return d&&a.call(b,c,g,f,h)},!0)};c.some=function(a,b){return this.reduce(function(d,c,g,f,h){return d||a.call(b,c,g,f,h)},!1)};c.all=function(){return this.every(Boolean)};c.any=function(){return this.some(Boolean)};c.min=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,d){return 0>
+a(d,b)?d:b},Infinity)};c.max=function(a){a=this.contentCompare||Object.compare;return this.reduce(function(b,d){return 0<a(d,b)?d:b},-Infinity)};c.sum=function(a){return this.reduce(ma,void 0===a?0:a)};c.average=function(a){var b=void 0===a?0:a,d=void 0===a?0:a;this.reduce(function(a,c){b+=c;d+=1},void 0);return b/d};c.concat=function(){for(var a=this.constructClone(this),b=0;b<arguments.length;b++)a.addEach(arguments[b]);return a};c.flatten=function(){return this.reduce(na,this.constructClone())};
+c.zip=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this);for(var b=[],d=Infinity,c=0;c<a.length;c++){var g=a[c];g.length<d&&(d=g.length)}for(c=0;c<a.length;c++){var f=0;a[c].reduce(function(a,g){f<d&&(b[f]=b[f]||[],b[f][c]=g);f++},void 0)}return b};c.sorted=function(a,b,d){a=a||this.contentCompare||Object.compare;a.by?(b=a.by,a=a.compare||this.contentCompare||Object.compare):b=b||da;void 0===d&&(d=1);return this.map(function(a){return{by:b(a),value:a}}).sort(function(b,c){return a(b.by,
+c.by)*d}).map(function(a){return a.value})};c.reversed=function(){return this.constructClone(this).reverse()};c.clone=function(a,b){if(void 0===a)a=Infinity;else if(0===a)return this;var d=this.constructClone();this.forEach(function(c,g){Object.clone&&(c=Object.clone(c,a-1,b));d.set(g,c)},this);return d};A={};var ca=Object.prototype.toString;Array.isArray||(Array.isArray=function(a){return"[object Array]"==ca.call(a)});Array.prototype.forEach||(Array.prototype.forEach=c.forEach);Array.prototype.map||
+(Array.prototype.map=c.map);Array.prototype.filter||(Array.prototype.filter=c.filter);Array.prototype.every||(Array.prototype.every=c.every);Array.prototype.some||(Array.prototype.some=c.some);Array.prototype.reduce||(Array.prototype.reduce=function(a){var b=toObject(this),d=b.length>>>0;if("[object Function]"!=ca.call(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var c=0,g;if(2<=arguments.length)g=arguments[1];
+else{do{if(c in b){g=b[c++];break}if(++c>=d)throw new TypeError("reduce of empty array with no initial value");}while(1)}for(;c<d;c++)c in b&&(g=a.call(void 0,g,b[c],c,b));return g});Array.prototype.reduceRight||(Array.prototype.reduceRight=function(a){var b=toObject(this),d=b.length>>>0;if("[object Function]"!=ca.call(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var c,d=d-1;if(2<=arguments.length)c=
+arguments[1];else{do{if(d in b){c=b[d--];break}if(0>--d)throw new TypeError("reduceRight of empty array with no initial value");}while(1)}do d in this&&(c=a.call(void 0,c,b[d],d,b));while(d--);return c});Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=toObject(this),d=b.length>>>0;if(!d)return-1;var c=0;1<arguments.length&&(c=toInteger(arguments[1]));for(c=0<=c?c:Math.max(0,d+c);c<d;c++)if(c in b&&b[c]===a)return c;return-1});Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=
+function(a){var b=toObject(this),d=b.length>>>0;if(!d)return-1;var c=d-1;1<arguments.length&&(c=Math.min(c,toInteger(arguments[1])));for(c=0<=c?c:d-Math.abs(c);0<=c;c--)if(c in b&&a===b[c])return c;return-1});var T={};A;v;T.module$exports=Array;Array.empty=[];Object.freeze&&Object.freeze(Array.empty);Array.from=function(a){var b=[];b.addEach(a);return b};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 d=this.find(a,b);return-1!==d?(this.splice(d,1),!0):!1};Array.prototype.find=function(a,b){for(var b=b||this.contentEquals||Object.equals,d=0;d<this.length;d++)if(d in this&&b(this[d],a))return d;return-1};Array.prototype.findLast=function(a,
+b){var b=b||this.contentEquals||Object.equals,d=this.length;do if(d--,d in this&&b(this[d],a))return d;while(0<d);return-1};Array.prototype.swap=function(a,b,d){var c=Array.prototype.slice.call(arguments,0,2);d&&c.push.apply(c,d);return this.splice.apply(this,c)};Array.prototype.toArray=c.toArray;Array.prototype.toObject=c.toArray;Array.prototype.addEach=c.addEach;Array.prototype.equals=c.equals;Array.prototype.compare=c.compare;Array.prototype.any=c.any;Array.prototype.all=c.all;Array.prototype.min=
+c.min;Array.prototype.max=c.max;Array.prototype.sum=c.sum;Array.prototype.average=c.average;Array.prototype.unique=c.unique;Array.prototype.flatten=c.flatten;Array.prototype.sorted=c.sorted;Array.prototype.reversed=c.reversed;Array.prototype.clone=c.clone;Array.prototype.one=function(){if(0===this.length)throw Error("Can't get one element from empty array");return this[0]};Array.prototype.only=function(){if(1!==this.length)throw Error("Can't get only element of array with "+this.length+" elements.");
+return this[0]};Array.prototype.clear=function(){this.length=0;return this};Array.prototype.iterate=function(a,b){return new ea(this,a,b)};ea.prototype.next=function(){if(this.start===(null==this.end?this.array.length:this.end))throw StopIteration;return this.array[this.start++]};T.module$exports&&(T=T.module$exports);var B={};v;var C=s;B.module$exports=p;p.prototype.constructClone=function(a){return new this.constructor(a,this.mangle,this.content)};p.prototype.assertString=function(a){if("string"!==
+typeof a)throw new TypeError("key must be a string.");};p.prototype.get=function(a,b){this.assertString(a);var d="~"+a;return d in this.store?this.store[d]:1<arguments.length?b:this.content()};p.prototype.set=function(a,b){this.assertString(a);var d="~"+a;if(d in this.store)return this.store[d]=b,!1;this.length++;this.store[d]=b;return!0};p.prototype.has=function(a){this.assertString(a);return"~"+a in this.store};p.prototype["delete"]=function(a){this.assertString(a);return"~"+a in this.store?(delete this.store["~"+
+a],this.length--,!0):!1};p.prototype.clear=function(){for(var a in this.store)delete this.store[a];this.length=0};p.prototype.reduce=function(a,b,d){for(var c in this.store)b=a.call(d,b,this.store[c],c.slice(1),this);return b};p.prototype.addEach=C.addEach;p.prototype.keys=C.keys;p.prototype.values=C.values;p.prototype.items=C.items;p.prototype.forEach=c.forEach;p.prototype.map=c.map;p.prototype.toArray=c.toArray;p.prototype.toObject=c.toObject;p.prototype.filter=c.filter;p.prototype.every=c.every;
+p.prototype.some=c.some;p.prototype.all=c.all;p.prototype.any=c.any;p.prototype.min=c.min;p.prototype.max=c.max;p.prototype.sum=c.sum;p.prototype.average=c.average;p.prototype.concat=c.concat;p.prototype.flatten=c.flatten;p.prototype.sorted=c.sorted;p.prototype.zip=c.zip;p.prototype.clone=c.clone;B.module$exports&&(B=B.module$exports);C={};C.module$exports=f;f.prototype.constructClone=function(a){var b=[];c.addEach.call(b,a);return b};f.prototype.mapIterator=function(a,b){var d=f(this),c=0;if("[object Function]"!=
+Object.prototype.toString.call(a))throw new TypeError;return new d.constructor(function(){return a.call(b,d.next(),c++,d)})};f.prototype.filterIterator=function(a,b){var d=f(this),c=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new d.constructor(function(){for(var g;;)if(g=d.next(),a.call(b,g,c++,d))return g})};f.prototype.reduce=function(a){var b=f(this),d=arguments[1],c=arguments[2],g=0,h;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;
+try{h=b.next(),d=1<arguments.length?a.call(c,d,h,g,b):h,g++}catch(i){if(isStopIteration(i)){if(1<arguments.length)return arguments[1];throw TypeError("cannot reduce a value from an empty iterator with no initial value");}throw i;}try{for(;;)h=b.next(),d=a.call(c,d,h,g,b),g++}catch(j){if(isStopIteration(j))return d;throw j;}};f.prototype.forEach=c.forEach;f.prototype.map=c.map;f.prototype.toArray=c.toArray;f.prototype.toObject=c.toObject;f.prototype.filter=c.filter;f.prototype.all=c.all;f.prototype.any=
+c.any;f.prototype.min=c.min;f.prototype.max=c.max;f.prototype.sum=c.sum;f.prototype.average=c.average;f.prototype.flatten=c.flatten;f.prototype.every=function(a){var b=f(this),d=!0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,arguments).forEach(function(a){if(!a)throw d=!1,StopIteration;});return d};f.prototype.some=function(a){var b=f(this),d=!1;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;b.mapIterator.apply(b,
+arguments).forEach(function(a){if(a)throw d=!0,StopIteration;});return d};f.prototype.concat=function(){return f.concat(Array.prototype.concat.apply(this,arguments))};f.prototype.dropWhile=function(a,b){var d=f(this),c=!1,g;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;d.forEach(function(f,h){if(!a.call(b,f,h,d))throw c=!0,g=f,StopIteration;});return c?d.constructor([g]).concat(d):d.constructor([])};f.prototype.takeWhile=function(a,b){var d=f(this);if("[object Function]"!=
+Object.prototype.toString.call(a))throw new TypeError;return d.mapIterator(function(c,g){if(!a.call(b,c,g,d))throw StopIteration;return c})};f.prototype.filterIterator=function(a,b){var c=f(this),e=0;if("[object Function]"!=Object.prototype.toString.call(a))throw new TypeError;return new c.constructor(function(){for(var g;;)if(g=c.next(),a.call(b,g,e++,c))return g})};f.prototype.zip=function(){return f.transpose(Array.prototype.concat.apply(this,arguments))};f.prototype.enumerate=function(a){return f.count(a).zip(this)};
+f.iterate=function(a){var b;b=0;return new f(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})};f.cycle=function(a,b){2>arguments.length&&(b=Infinity);var c=function(){throw StopIteration;};return new f(function(){var e;try{return c()}catch(g){if(isStopIteration(g)){if(0>=b)throw g;b--;e=f.iterate(a);c=e.next.bind(e);return c()}throw g;}})};f.concat=function(a){var a=f(a),b=function(){throw StopIteration;
+};return new f(function(){var c;try{return b()}catch(e){if(isStopIteration(e))return c=f(a.next()),b=c.next.bind(c),b();throw e;}})};f.transpose=function(a){a=f(a).map(f);return 1>a.length?new f([]):new f(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})};f.zip=function(){return f.transpose(Array.prototype.slice.call(arguments))};f.chain=function(){return f.concat(Array.prototype.slice.call(arguments))};
+f.range=function(a,b,c){3>arguments.length&&(c=1);2>arguments.length&&(b=a,a=0);a=a||0;return new f(function(){if(a>=b)throw StopIteration;if(isNaN(a))throw"";var e=a;a+=c;return e})};f.count=function(a,b){return f.range(a,Infinity,b||1)};f.repeat=function(a,b){2>arguments.length&&(b=Infinity);return(new f.range(+b)).mapIterator(function(){return a})};"undefined"===typeof isStopIteration&&(r.isStopIteration=function(a){return"[object StopIteration]"===Object.prototype.toString.call(a)});if("undefined"===
+typeof StopIteration){r.StopIteration={};var za=Object.prototype.toString;Object.prototype.toString=function(){return this===r.StopIteration||this instanceof r.ReturnValue?"[object StopIteration]":za.call(this,arguments)}}"undefined"===typeof ReturnValue&&(r.ReturnValue=function(a){if(!(this instanceof r.ReturnValue))return new r.ReturnValue(a);this.value=a});C.module$exports&&(C=C.module$exports);var F={};F.module$exports=h;v;h.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,
+this.content)};h.prototype.find=function(a,b){for(var b=b||this.contentEquals,c=this.head,e=c.next;e!==c;){if(b(e.value,a))return e;e=e.next}};h.prototype.findLast=function(a,b){for(var b=b||this.contentEquals,c=this.head,e=c.prev;e!==c;){if(b(e.value,a))return e;e=e.prev}};h.prototype.has=function(a,b){return!!this.find(a,b)};h.prototype.get=function(a,b){var c=this.find(a,b);return c?c.value:this.content()};h.prototype["delete"]=function(a,b){var c=this.findLast(a,b);return c?(this.isObserved&&
+this.dispatchBeforeContentChange([],[a]),c["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]),!0):!1};h.prototype.clear=function(){this.head.next=this.head.prev=this.head};h.prototype.add=function(a){this.isObserved&&this.dispatchBeforeContentChange([a],[]);this.head.addBefore(new this.Node(a));this.length++;this.isObserved&&this.dispatchContentChange([a],[]);return!0};h.prototype.push=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b];this.isObserved&&
+this.dispatchBeforeContentChange([c],[]);var e=new this.Node(c);a.addBefore(e);this.length++;this.isObserved&&this.dispatchContentChange([c],[])}};h.prototype.unshift=function(){for(var a=this.head,b=0;b<arguments.length;b++){var c=arguments[b],e=new this.Node(c);a.addAfter(e);this.length++;this.isObserved&&this.dispatchContentChange([c],[]);a=e}};h.prototype.pop=function(){var a,b=this.head;b.prev!==b&&(a=b.prev.value,this.isObserved&&this.dispatchBeforeContentChange([],[a]),b.prev["delete"](),this.length--,
+this.isObserved&&this.dispatchContentChange([],[a]));return a};h.prototype.shift=function(){var a,b=this.head;b.prev!==b&&(a=b.next.value,this.isObserved&&this.dispatchBeforeContentChange([],[a]),b.next["delete"](),this.length--,this.isObserved&&this.dispatchContentChange([],[a]));return a};h.prototype.scan=function(a,b){var c=this.head;if("number"===typeof a){var e=a;if(0<=e)for(a=c.next;e&&!(e--,a=a.next,a==c););else for(a=c;0>e&&!(e++,a=a.prev,a==c););return a}return a||b};h.prototype.slice=function(a,
+b){for(var c=[],e=this.head,a=this.scan(a,e.next),b=this.scan(b,e);a!==b&&a!==e;)c.push(a.value),a=a.next;return c};h.prototype.splice=function(a,b){return this.swap(a,b,Array.prototype.slice.call(arguments,2))};h.prototype.swap=function(a,b,c){var e=[],g=a,a=this.scan(a,this.head);for(void 0===b&&(b=Infinity);b--&&0<=b&&a!==this.head;)e.push(a.value),a["delete"](),a=a.next,this.length--;if(c){null===g&&a===this.head&&(a=this.head.next);for(b=0;b<c.length;b++)g=new this.Node(c[b]),a.addBefore(g);
+this.length+=c.length}return e};h.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};h.prototype.reduce=function(a,b,c){for(var e=this.head,g=e.next;g!==e;)b=a.call(c,b,g.value,g,this),g=g.next;return b};h.prototype.reduceRight=function(a,b,c){for(var e=this.head,g=e.prev;g!==e;)b=a.call(c,b,g.value,g,this),g=g.prev;return b};h.prototype.addEach=c.addEach;h.prototype.forEach=c.forEach;h.prototype.map=c.map;h.prototype.toArray=
+c.toArray;h.prototype.filter=c.filter;h.prototype.every=c.every;h.prototype.some=c.some;h.prototype.all=c.all;h.prototype.any=c.any;h.prototype.min=c.min;h.prototype.max=c.max;h.prototype.sum=c.sum;h.prototype.average=c.average;h.prototype.concat=c.concat;h.prototype.flatten=c.flatten;h.prototype.zip=c.zip;h.prototype.equals=c.equals;h.prototype.compare=c.compare;h.prototype.sorted=c.sorted;h.prototype.reversed=c.reversed;h.prototype.clone=c.clone;h.prototype.getContentChangeDescriptor=J;h.prototype.addContentChangeListener=
+K;h.prototype.removeContentChangeListener=L;h.prototype.dispatchContentChange=M;h.prototype.addBeforeContentChangeListener=N;h.prototype.removeBeforeContentChangeListener=O;h.prototype.dispatchBeforeContentChange=P;h.prototype.equals=function(a,b){b=b||this.contentEquals||Object.equals;return this===a?!0:this.length===a.length&&this.zip(a).every(function(a){return b(a[0],a[1])})};h.prototype.one=function(){if(this.head===this.head.next)throw Error("Can't get one value from empty list");return this.head.next.value};
+h.prototype.only=function(){if(this.head===this.head.next)throw Error("Can't get only value in empty list");if(this.head.prev!==this.head.next)throw Error("Can't get only value in list with multiple values");return this.head.next.value};h.prototype.iterate=function(){return new fa(this.head)};fa.prototype.next=function(){if(this.at===this.head)throw StopIteration;var a=this.at.value;this.at=this.at.next;return a};h.prototype.Node=W;W.prototype["delete"]=function(){this.prev.next=this.next;this.next.prev=
+this.prev};W.prototype.addBefore=function(a){var b=this.prev;this.prev=a;a.prev=b;b.next=a;a.next=this};W.prototype.addAfter=function(a){var b=this.next;this.next=a;a.next=b;b.prev=a;a.prev=this};F.module$exports&&(F=F.module$exports);var G={};v;var Aa=z,Ba=C;G.module$exports=j;j.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};j.prototype.Buckets=B;j.prototype.Bucket=F;j.prototype.has=function(a){var b=this.contentHash(a);return this.buckets.get(b).has(a)};
+j.prototype.get=function(a){var b=this.contentHash(a),c=this.buckets;return c.has(b)?c.get(b).get(a):this.content(a)};j.prototype["delete"]=function(a){var b=this.contentHash(a),c=this.buckets;if(c.has(b)){var e=c.get(b);if(e["delete"](a)){this.isObserved&&this.dispatchBeforeContentChange([],[a]);this.length--;if(0===e.length)c["delete"](b);this.isObserved&&this.dispatchContentChange([],[a]);return!0}}return!1};j.prototype.clear=function(){this.buckets.clear();this.length=0};j.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)?(this.isObserved&&this.dispatchBeforeContentChange([a],[]),c.get(b).add(a),this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0):!1};j.prototype.reduce=function(a,b,c){return this.buckets.reduce(function(b,g){return g.reduce(a,b,c)},b)};j.prototype.addEach=c.addEach;j.prototype.forEach=c.forEach;j.prototype.map=c.map;j.prototype.toArray=c.toArray;j.prototype.filter=
+c.filter;j.prototype.every=c.every;j.prototype.some=c.some;j.prototype.all=c.all;j.prototype.any=c.any;j.prototype.min=c.min;j.prototype.max=c.max;j.prototype.sum=c.sum;j.prototype.average=c.average;j.prototype.concat=c.concat;j.prototype.flatten=c.flatten;j.prototype.zip=c.zip;j.prototype.sorted=c.sorted;j.prototype.clone=c.clone;j.prototype.getContentChangeDescriptor=J;j.prototype.addContentChangeListener=K;j.prototype.removeContentChangeListener=L;j.prototype.dispatchContentChange=M;j.prototype.addBeforeContentChangeListener=
+N;j.prototype.removeBeforeContentChangeListener=O;j.prototype.dispatchBeforeContentChange=P;j.prototype.equals=function(a){var b=this;return Object(a)===a&&"function"===typeof a.reduce&&"number"===typeof a.length&&this.length===a.length&&a.reduce(function(a,c){return a&&b.has(c)},!0)};j.prototype.iterate=function(){var a=this.buckets,b=a.keys();return Ba.concat(b.map(function(b){return a.get(b).iterate()}))};j.prototype.log=function(a,b){var a=a||Aa.unicodeSharp,b=b||this.stringify,c=this.buckets,
+e=c.keys();e.forEach(function(g,f){var h,i;f===e.length-1?(h=a.fromAbove,i=" "):(h=a.fromBoth,i=a.strafe);var j=c.get(g);console.log(h+a.through+a.branchDown+" "+g);j.forEach(function(c,d){console.log(b(c,i+" "+(d===j.head.prev?a.fromAbove:a.fromBoth)+a.through+a.through+" ",i+" "))})})};j.prototype.stringify=function(a,b){return Object(a)===a?b+JSON.stringify(a):b+a};G.module$exports&&(G=G.module$exports);B={};v;var pa=G,u=s;B.module$exports=m;m.prototype.constructClone=function(a){return new this.constructor(a,
+this.contentEquals,this.contentHash,this.content)};m.prototype.addEach=u.addEach;m.prototype.has=u.has;m.prototype.get=u.get;m.prototype.set=u.set;m.prototype["delete"]=u["delete"];m.prototype.clear=u.clear;m.prototype.reduce=u.reduce;m.prototype.keys=u.keys;m.prototype.values=u.values;m.prototype.items=u.items;m.prototype.Item=u.Item;m.prototype.forEach=c.forEach;m.prototype.map=c.map;m.prototype.toArray=c.toArray;m.prototype.toObject=c.toObject;m.prototype.filter=c.filter;m.prototype.every=c.every;
+m.prototype.some=c.some;m.prototype.all=c.all;m.prototype.any=c.any;m.prototype.min=c.min;m.prototype.max=c.max;m.prototype.sum=c.sum;m.prototype.average=c.average;m.prototype.concat=c.concat;m.prototype.flatten=c.flatten;m.prototype.sorted=c.sorted;m.prototype.zip=c.zip;m.prototype.clone=c.clone;m.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};m.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};B.module$exports&&(B=B.module$exports);
+u={};v;var qa=F,ra=G;u.module$exports=k;k.prototype.constructClone=function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};k.prototype.has=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)};k.prototype.get=function(a){var b=new this.contentList.Node(a);return(b=this.contentSet.get(b))?b.value:this.content(a)};k.prototype.add=function(a){var b=new this.contentList.Node(a);return!this.contentSet.has(b)?(this.contentList.add(a),b=this.contentList.head.prev,
+this.contentSet.add(b),this.length++,!0):!1};k.prototype["delete"]=function(a){a=new this.contentList.Node(a);return this.contentSet.has(a)?(a=this.contentSet.get(a),this.contentSet["delete"](a),a["delete"](),this.length--,!0):!1};k.prototype.clear=function(){this.contentSet.clear();this.contentList.clear()};k.prototype.reduce=function(){var a=this.contentList;return a.reduce.apply(a,arguments)};k.prototype.reduceRight=function(){var a=this.contentList;return a.reduceRight.apply(a,arguments)};k.prototype.addEach=
+c.addEach;k.prototype.forEach=c.forEach;k.prototype.map=c.map;k.prototype.toArray=c.toArray;k.prototype.filter=c.filter;k.prototype.every=c.every;k.prototype.some=c.some;k.prototype.all=c.all;k.prototype.any=c.any;k.prototype.min=c.min;k.prototype.max=c.max;k.prototype.sum=c.sum;k.prototype.average=c.average;k.prototype.concat=c.concat;k.prototype.flatten=c.flatten;k.prototype.zip=c.zip;k.prototype.sorted=c.sorted;k.prototype.clone=c.clone;k.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,
+arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,arguments)});this.isObservable=!0};k.prototype.getContentChangeDescriptor=J;k.prototype.addContentChangeListener=K;k.prototype.removeContentChangeListener=L;k.prototype.dispatchContentChange=M;k.prototype.addBeforeContentChangeListener=N;k.prototype.removeBeforeContentChangeListener=O;k.prototype.dispatchBeforeContentChange=P;k.prototype.equals=function(a){return this.contentSet.equals(a)};k.prototype.iterate=
+function(){return this.contentList.iterate()};k.prototype.log=function(){var a=this.contentSet;return a.log.apply(a,arguments)};u.module$exports&&(u=u.module$exports);var Q={};v;var sa=u;Q.module$exports=l;l.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};l.prototype.has=function(a){return this.contentSet.has(a)};l.prototype.get=function(a){a=this.contentSet.get(a);void 0!==a?(this.contentSet["delete"](a),this.contentSet.add(a)):
+a=this.content();return a};l.prototype.add=function(a){this.contentSet.has(a)&&(this.contentSet["delete"](a),this.length--);this.contentSet.add(a);this.length++;return this.contentSet.length>this.maxLength?(this.contentSet["delete"](this.contentSet.contentList.head.next.value),this.length--,!1):!0};l.prototype["delete"]=function(a){return this.contentSet["delete"](a)?(this.length--,!0):!1};l.prototype.clear=function(){this.contentSet.clear();this.length=0};l.prototype.reduce=function(){var a=this.contentSet;
+return a.reduce.apply(a,arguments)};l.prototype.reduceRight=function(){var a=this.contentSet;return a.reduceRight.apply(a,arguments)};l.prototype.addEach=c.addEach;l.prototype.forEach=c.forEach;l.prototype.map=c.map;l.prototype.toArray=c.toArray;l.prototype.filter=c.filter;l.prototype.every=c.every;l.prototype.some=c.some;l.prototype.all=c.all;l.prototype.any=c.any;l.prototype.min=c.min;l.prototype.max=c.max;l.prototype.sum=c.sum;l.prototype.average=c.average;l.prototype.concat=c.concat;l.prototype.flatten=
+c.flatten;l.prototype.zip=c.zip;l.prototype.sorted=c.sorted;l.prototype.clone=c.clone;l.prototype.makeObservable=function(){var a=this;this.contentSet.addBeforeContentChangeListener(function(){a.dispatchBeforeContentChange.apply(a,arguments)});this.contentSet.addContentChangeListener(function(){a.dispatchContentChange.apply(a,arguments)});this.isObservable=!0};l.prototype.getContentChangeDescriptor=J;l.prototype.addContentChangeListener=K;l.prototype.removeContentChangeListener=L;l.prototype.dispatchContentChange=
+M;l.prototype.addBeforeContentChangeListener=N;l.prototype.removeBeforeContentChangeListener=O;l.prototype.dispatchBeforeContentChange=P;l.prototype.equals=function(a){return this.contentSet.equals(a)};l.prototype.iterate=function(){return this.contentSet.iterate()};Q.module$exports&&(Q=Q.module$exports);var U={};v;var ta=Q,w=s;U.module$exports=n;n.prototype.constructClone=function(a){return new this.constructor(a,this.maxLength,this.contentEquals,this.contentHash,this.content)};n.prototype.addEach=
+w.addEach;n.prototype.has=w.has;n.prototype.get=w.get;n.prototype.set=w.set;n.prototype["delete"]=w["delete"];n.prototype.clear=w.clear;n.prototype.reduce=w.reduce;n.prototype.keys=w.keys;n.prototype.values=w.values;n.prototype.items=w.items;n.prototype.Item=w.Item;n.prototype.forEach=c.forEach;n.prototype.map=c.map;n.prototype.toArray=c.toArray;n.prototype.toObject=c.toObject;n.prototype.filter=c.filter;n.prototype.every=c.every;n.prototype.some=c.some;n.prototype.all=c.all;n.prototype.any=c.any;
+n.prototype.min=c.min;n.prototype.max=c.max;n.prototype.sum=c.sum;n.prototype.average=c.average;n.prototype.concat=c.concat;n.prototype.flatten=c.flatten;n.prototype.sorted=c.sorted;n.prototype.zip=c.zip;n.prototype.clone=c.clone;n.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};n.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};U.module$exports&&(U=U.module$exports);w={};v;var ua=u,y=s;w.module$exports=o;o.prototype.constructClone=
+function(a){return new this.constructor(a,this.contentEquals,this.contentHash,this.content)};o.prototype.addEach=y.addEach;o.prototype.has=y.has;o.prototype.get=y.get;o.prototype.set=y.set;o.prototype["delete"]=y["delete"];o.prototype.clear=y.clear;o.prototype.reduce=y.reduce;o.prototype.keys=y.keys;o.prototype.values=y.values;o.prototype.items=y.items;o.prototype.Item=y.Item;o.prototype.forEach=c.forEach;o.prototype.map=c.map;o.prototype.toArray=c.toArray;o.prototype.toObject=c.toObject;o.prototype.filter=
+c.filter;o.prototype.every=c.every;o.prototype.some=c.some;o.prototype.all=c.all;o.prototype.any=c.any;o.prototype.min=c.min;o.prototype.max=c.max;o.prototype.sum=c.sum;o.prototype.average=c.average;o.prototype.concat=c.concat;o.prototype.flatten=c.flatten;o.prototype.sorted=c.sorted;o.prototype.zip=c.zip;o.prototype.clone=c.clone;o.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};o.prototype.stringify=function(a,b){return b+JSON.stringify(a.key)+": "+JSON.stringify(a.value)};
+w.module$exports&&(w=w.module$exports);var y={},Y=w;y.module$exports=D;D.prototype=Object.create(Y.prototype);D.prototype.constructClone=function(a){return new this.constructor(a,this.bucket,this.contentEquals,this.contentHash)};D.prototype.set=function(a,b){var c=this.get(a);c.swap(0,c.length,b)};D.prototype.bucket=function(){return[]};y.module$exports&&(y=y.module$exports);var R={};R.module$exports=i;v;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.isObserved&&this.dispatchBeforeContentChange([a],[]),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=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0}else return this.isObserved&&this.dispatchBeforeContentChange([a],[]),this.root=b,this.length++,this.isObserved&&this.dispatchContentChange([a],[]),!0;return!1};i.prototype["delete"]=function(a){if(this.root&&(this.splay(a),this.contentEquals(a,this.root.value))){if(this.root.left){var b=this.root.right;this.root=this.root.left;
+this.splay(a);this.root.right=b}else this.root=this.root.right;this.length--;this.isObserved&&this.dispatchContentChange([],[a]);return!0}return!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.splay=function(a){var b,c,e,g,f;if(this.root){b=c=e=new this.Node;for(f=this.root;;)if(g=
+this.contentCompare(a,f.value),0>g)if(f.left){if(0>this.contentCompare(a,f.left.value)&&(g=f.left,f.left=g.right,g.right=f,f=g,!f.left))break;e=e.left=f;f=f.left}else break;else if(0<g)if(f.right){if(0<this.contentCompare(a,f.right.value)&&(g=f.right,f.right=g.left,g.left=f,f=g,!f.right))break;c=c.right=f;f=f.right}else break;else break;c.right=f.left;e.left=f.right;f.left=b.right;f.right=b.left;this.root=f}};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.addEach=c.addEach;i.prototype.forEach=c.forEach;i.prototype.map=c.map;i.prototype.toArray=c.toArray;i.prototype.filter=c.filter;i.prototype.every=c.every;i.prototype.some=c.some;i.prototype.all=c.all;i.prototype.any=c.any;i.prototype.sum=c.sum;i.prototype.average=c.average;i.prototype.flatten=c.flatten;i.prototype.zip=c.flatten;i.prototype.sorted=c.sorted;i.prototype.clone=c.clone;i.prototype.getContentChangeDescriptor=
+J;i.prototype.addContentChangeListener=K;i.prototype.removeContentChangeListener=L;i.prototype.dispatchContentChange=M;i.prototype.addBeforeContentChangeListener=N;i.prototype.removeBeforeContentChangeListener=O;i.prototype.dispatchBeforeContentChange=P;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.only=function(){if(!this.root)throw Error("Can't get only value in empty set");if(this.root.left||this.root.right)throw Error("Can't get only value in set with multiple values");return this.root.value};i.prototype.clear=function(){this.root=null};i.prototype.iterate=function(a,b){return new this.Iterator(this,a,b)};i.prototype.Iterator=ga;i.prototype.log=function(a,b){this.report(console.log,console,a,b)};i.prototype.report=function(a,b,c,e){c=c||i.unicodeRound;e=e||this.stringify;this.root&&
+this.root.report(a,b,c,e)};i.prototype.stringify=function(a,b,c,e){a.call(b,e+" "+c.value)};i.unicodeRound=z.unicodeRound;i.unicodeSharp=z.unicodeSharp;i.ascii=z.ascii;i.prototype.Node=H;H.prototype.reduce=function(a,b,c,e,f){f=f||0;this.left&&(b=this.left.reduce(a,b,c,e,f+1));b=a.call(c,b,this.value,this,e,f);this.right&&(b=this.right.reduce(a,b,c,e,f+1));return b};H.prototype.reduceRight=function(a,b,c,e,f){f=f||0;this.right&&(b=this.right.reduce(a,b,c,e,f+1));b=a.call(c,b,this.value,this,e,f);
+this.left&&(b=this.left.reduce(a,b,c,e,f+1));return b};H.prototype.getNext=function(){var a=this;if(a.right){for(a=a.right;a.left;)a=a.left;return a}};H.prototype.getPrevious=function(){var a=this;if(a.left){for(a=a.left;a.right;)a=a.right;return a}};H.prototype.report=function(a,b,c,e,f,h,i){var f=f||"",h=h||"",i=i||"",j;j=this.left&&this.right?c.intersection:this.left?c.branchUp:this.right?c.branchDown:c.through;this.left&&this.left.report(a,b,c,e,h+c.fromBelow+c.through,h+" ",h+c.strafe+" ");
+e(a,b,this,f+j,i+(this.right?c.strafe:" "),h+(this.left?c.strafe:" "));this.right&&this.right.report(a,b,c,e,i+c.fromAbove+c.through,i+c.strafe+" ",i+" ")};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};R.module$exports&&(R=R.module$exports);z={};v;var va=R;z.module$exports=q;q.prototype.constructClone=
+function(a){return new this.constructor(a,this.contentEquals,this.contentCompare,this.content)};q.prototype.addEach=s.addEach;q.prototype.has=s.has;q.prototype.get=s.get;q.prototype.set=s.set;q.prototype["delete"]=s["delete"];q.prototype.clear=s.clear;q.prototype.reduce=s.reduce;q.prototype.keys=s.keys;q.prototype.values=s.values;q.prototype.items=s.items;q.prototype.Item=s.Item;q.prototype.forEach=c.forEach;q.prototype.map=c.map;q.prototype.toArray=c.toArray;q.prototype.filter=c.filter;q.prototype.every=
+c.every;q.prototype.some=c.some;q.prototype.all=c.all;q.prototype.any=c.any;q.prototype.min=c.min;q.prototype.max=c.max;q.prototype.sum=c.sum;q.prototype.average=c.average;q.prototype.flatten=c.flatten;q.prototype.zip=c.zip;q.prototype.clone=c.clone;q.prototype.log=function(a,b){b=b||this.stringify;this.contentSet.log(a,b)};q.prototype.report=function(a,b,c,e){e=e||this.stringify;this.contentSet.report(a,b,c,e)};q.prototype.stringify=function(a,b,c,e){a.call(b,e+" "+c.value.key+": "+c.value.value)};
+z.module$exports&&(z=z.module$exports);A;T;r.List=F;r.Set=u;r.Map=w;r.MultiMap=y;r.SortedSet=R;r.SortedMap=z;r.LruSet=Q;r.LruMap=U;r.FastSet=G;r.FastMap=B;r.WeakMap=t;r.Iterator=C})(this);
View
1  demo/all.js
@@ -6,4 +6,3 @@ require("./set-demo");
require("./sorted-map-demo");
require("./sorted-set-demo");
require("./iterator-demo");
-require("./hash-demo");
View
11 demo/hash-demo.js
@@ -1,11 +0,0 @@
-
-require("../hash");
-var Map = require("../map");
-
-var map = new Map();
-var a = {}, b = {}, c = {};
-map.set(a, 10);
-map.set(b, 20);
-map.set(c, 30);
-map.log();
-
View
4 dict.js
@@ -1,7 +1,7 @@
"use strict";
+require("./object");
var Reducible = require("./reducible");
-var Operators = require("./operators");
var AbstractMap = require("./abstract-map");
// Burgled from https://github.com/domenic/dict
@@ -11,7 +11,7 @@ function Dict(values, content) {
if (!(this instanceof Dict)) {
return new Dict(values, content);
}
- content = content || Operators.getUndefined;
+ content = content || Function.noop;
this.content = content;
this.store = {};
this.length = 0;
View
8 fast-map.js
@@ -1,8 +1,8 @@
"use strict";
+require("./object");
var Set = require("./fast-set");
var Reducible = require("./reducible");
-var Operators = require("./operators");
var AbstractMap = require("./abstract-map");
module.exports = FastMap;
@@ -11,9 +11,9 @@ function FastMap(values, equals, hash, content) {
if (!(this instanceof FastMap)) {
return new FastMap(values, equals, hash);
}
- equals = equals || Object.equals || Operators.equals;
- hash = hash || Object.hash || Operators.hash;
- content = content || Operators.getUndefined;
+ equals = equals || Object.equals;
+ hash = hash || Object.hash;
+ content = content || Function.noop;
this.contentEquals = equals;
this.contentHash = hash;
this.content = content;
View
8 fast-set.js
@@ -1,10 +1,10 @@
"use strict";
+require("./object");
var Dict = require("./dict");
var List = require("./list");
var Reducible = require("./reducible");
var Observable = require("./observable");
-var Operators = require("./operators");
var TreeLog = require("./tree-log");
var Iterator = require("./iterator");
@@ -16,9 +16,9 @@ function FastSet(values, equals, hash, content) {
if (!(this instanceof FastSet)) {
return new FastSet(values, equals, hash);
}
- equals = equals || Object.equals || Operators.equals;
- hash = hash || Object.hash || Operators.hash;
- content = content || Operators.getUndefined;
+ equals = equals || Object.equals;
+ hash = hash || Object.hash;
+ content = content || Function.noop;
this.contentEquals = equals;
this.contentHash = hash;
this.content = content;
View
17 hash.js
@@ -1,17 +0,0 @@
-"use strict";
-
-var WeakMap = require("./weak-map");
-
-var map = new WeakMap();
-
-Object.hash = function (object) {
- if (Object(object) === object) {
- if (!map.has(object)) {
- map.set(object, Math.random().toString(36).slice(2));
- }
- return map.get(object);
- } else {
- return "" + object;
- }