immutable
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -259,4 +259,30 @@ ///<reference path='../../../resources/jest.d.ts'/> | ||
expect(c1).toBe(1); | ||
}) | ||
}); | ||
it('can update deeply', () => { | ||
var onChange = jest.genMockFunction(); | ||
var data = Immutable.fromJS({a:{b:{c:1}}}); | ||
var c = Cursor.from(data, ['a'], onChange); | ||
var c1 = c.updateIn(['b', 'c'], x => x * 10); | ||
expect(c1.getIn(['b', 'c'])).toBe(10); | ||
expect(onChange).lastCalledWith( | ||
Immutable.fromJS({a:{b:{c:10}}}), | ||
data, | ||
['a', 'b', 'c'] | ||
); | ||
}); | ||
it('can set deeply', () => { | ||
var onChange = jest.genMockFunction(); | ||
var data = Immutable.fromJS({a:{b:{c:1}}}); | ||
var c = Cursor.from(data, ['a'], onChange); | ||
var c1 = c.setIn(['b', 'c'], 10); | ||
expect(c1.getIn(['b', 'c'])).toBe(10); | ||
expect(onChange).lastCalledWith( | ||
Immutable.fromJS({a:{b:{c:10}}}), | ||
data, | ||
['a', 'b', 'c'] | ||
); | ||
}); | ||
}); |
@@ -102,6 +102,6 @@ /** | ||
* Note: `delete` cannot be safely used in IE8 | ||
* @alias delete | ||
* @alias remove | ||
*/ | ||
delete(key: any): Cursor; | ||
remove(key: any): Cursor; | ||
delete(key: any): Cursor; | ||
@@ -124,2 +124,134 @@ /** | ||
/** | ||
* @see `Map#merge` | ||
*/ | ||
merge(...iterables: Immutable.Iterable<any, any>[]): Cursor; | ||
merge(...iterables: {[key: string]: any}[]): Cursor; | ||
/** | ||
* @see `Map#mergeWith` | ||
*/ | ||
mergeWith( | ||
merger: (previous?: any, next?: any) => any, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeWith( | ||
merger: (previous?: any, next?: any) => any, | ||
...iterables: {[key: string]: any}[] | ||
): Cursor; | ||
/** | ||
* @see `Map#mergeDeep` | ||
*/ | ||
mergeDeep(...iterables: Immutable.Iterable<any, any>[]): Cursor; | ||
mergeDeep(...iterables: {[key: string]: any}[]): Cursor; | ||
/** | ||
* @see `Map#mergeDeepWith` | ||
*/ | ||
mergeDeepWith( | ||
merger: (previous?: any, next?: any) => any, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeDeepWith( | ||
merger: (previous?: any, next?: any) => any, | ||
...iterables: {[key: string]: any}[] | ||
): Cursor; | ||
// Deep persistent changes | ||
/** | ||
* Returns a new Cursor having set `value` at this `keyPath`. If any keys in | ||
* `keyPath` do not exist, a new immutable Map will be created at that key. | ||
*/ | ||
setIn(keyPath: Array<any>, value: any): Cursor; | ||
setIn(keyPath: Immutable.Iterable<any, any>, value: any): Cursor; | ||
/** | ||
* Returns a new Cursor having removed the value at this `keyPath`. | ||
* | ||
* @alias removeIn | ||
*/ | ||
deleteIn(keyPath: Array<any>): Cursor; | ||
deleteIn(keyPath: Immutable.Iterable<any, any>): Cursor; | ||
removeIn(keyPath: Array<any>): Cursor; | ||
removeIn(keyPath: Immutable.Iterable<any, any>): Cursor; | ||
/** | ||
* Returns a new Cursor having applied the `updater` to the value found at | ||
* the keyPath. | ||
* | ||
* If any keys in `keyPath` do not exist, new Immutable `Map`s will | ||
* be created at those keys. If the `keyPath` does not already contain a | ||
* value, the `updater` function will be called with `notSetValue`, if | ||
* provided, otherwise `undefined`. | ||
* | ||
* If the `updater` function returns the same value it was called with, then | ||
* no change will occur. This is still true if `notSetValue` is provided. | ||
*/ | ||
updateIn( | ||
keyPath: Array<any>, | ||
updater: (value: any) => any | ||
): Cursor; | ||
updateIn( | ||
keyPath: Array<any>, | ||
notSetValue: any, | ||
updater: (value: any) => any | ||
): Cursor; | ||
updateIn( | ||
keyPath: Immutable.Iterable<any, any>, | ||
updater: (value: any) => any | ||
): Cursor; | ||
updateIn( | ||
keyPath: Immutable.Iterable<any, any>, | ||
notSetValue: any, | ||
updater: (value: any) => any | ||
): Cursor; | ||
/** | ||
* A combination of `updateIn` and `merge`, returning a new Cursor, but | ||
* performing the merge at a point arrived at by following the keyPath. | ||
* In other words, these two lines are equivalent: | ||
* | ||
* x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); | ||
* x.mergeIn(['a', 'b', 'c'], y); | ||
* | ||
*/ | ||
mergeIn( | ||
keyPath: Immutable.Iterable<any, any>, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeIn( | ||
keyPath: Array<any>, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeIn( | ||
keyPath: Array<any>, | ||
...iterables: {[key: string]: any}[] | ||
): Cursor; | ||
/** | ||
* A combination of `updateIn` and `mergeDeep`, returning a new Cursor, but | ||
* performing the deep merge at a point arrived at by following the keyPath. | ||
* In other words, these two lines are equivalent: | ||
* | ||
* x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); | ||
* x.mergeDeepIn(['a', 'b', 'c'], y); | ||
* | ||
*/ | ||
mergeDeepIn( | ||
keyPath: Immutable.Iterable<any, any>, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeDeepIn( | ||
keyPath: Array<any>, | ||
...iterables: Immutable.Iterable<any, any>[] | ||
): Cursor; | ||
mergeDeepIn( | ||
keyPath: Array<any>, | ||
...iterables: {[key: string]: any}[] | ||
): Cursor; | ||
// Transient changes | ||
/** | ||
* Every time you call one of the above functions, a new immutable value is | ||
@@ -126,0 +258,0 @@ * created and the callback is triggered. If you need to apply a series of |
@@ -84,3 +84,3 @@ /** | ||
} | ||
var value = this._rootData.getIn(this._keyPath.concat(key), NOT_SET); | ||
var value = this._rootData.getIn(newKeyPath(this._keyPath, key), NOT_SET); | ||
return value === NOT_SET ? notSetValue : wrappedValue(this, key, value); | ||
@@ -94,2 +94,5 @@ } | ||
IndexedCursorPrototype.setIn = | ||
KeyedCursorPrototype.setIn = Map.prototype.setIn; | ||
KeyedCursorPrototype.remove = | ||
@@ -102,2 +105,7 @@ KeyedCursorPrototype['delete'] = | ||
IndexedCursorPrototype.removeIn = | ||
IndexedCursorPrototype.deleteIn = | ||
KeyedCursorPrototype.removeIn = | ||
KeyedCursorPrototype.deleteIn = Map.prototype.deleteIn; | ||
KeyedCursorPrototype.clear = | ||
@@ -112,7 +120,50 @@ IndexedCursorPrototype.clear = function() { | ||
updateCursor(this, keyOrFn) : | ||
updateCursor(this, function (map) { | ||
return map.update(keyOrFn, notSetValue, updater); | ||
}, keyOrFn); | ||
this.updateIn([keyOrFn], notSetValue, updater); | ||
} | ||
IndexedCursorPrototype.updateIn = | ||
KeyedCursorPrototype.updateIn = function(keyPath, notSetValue, updater) { | ||
return updateCursor(this, function (m) { | ||
return m.updateIn(keyPath, notSetValue, updater); | ||
}, keyPath); | ||
} | ||
IndexedCursorPrototype.merge = | ||
KeyedCursorPrototype.merge = function(/*...iters*/) { | ||
var args = arguments; | ||
return updateCursor(this, function (m) { | ||
return m.merge.apply(m, args); | ||
}); | ||
} | ||
IndexedCursorPrototype.mergeWith = | ||
KeyedCursorPrototype.mergeWith = function(merger/*, ...iters*/) { | ||
var args = arguments; | ||
return updateCursor(this, function (m) { | ||
return m.mergeWith.apply(m, args); | ||
}); | ||
} | ||
IndexedCursorPrototype.mergeIn = | ||
KeyedCursorPrototype.mergeIn = Map.prototype.mergeIn; | ||
IndexedCursorPrototype.mergeDeep = | ||
KeyedCursorPrototype.mergeDeep = function(/*...iters*/) { | ||
var args = arguments; | ||
return updateCursor(this, function (m) { | ||
return m.mergeDeep.apply(m, args); | ||
}); | ||
} | ||
IndexedCursorPrototype.mergeDeepWith = | ||
KeyedCursorPrototype.mergeDeepWith = function(merger/*, ...iters*/) { | ||
var args = arguments; | ||
return updateCursor(this, function (m) { | ||
return m.mergeDeepWith.apply(m, args); | ||
}); | ||
} | ||
IndexedCursorPrototype.mergeDeepIn = | ||
KeyedCursorPrototype.mergeDeepIn = Map.prototype.mergeDeepIn; | ||
KeyedCursorPrototype.withMutations = | ||
@@ -193,3 +244,3 @@ IndexedCursorPrototype.withMutations = function(fn) { | ||
cursor._rootData, | ||
cursor._keyPath.concat(key), | ||
newKeyPath(cursor._keyPath, key), | ||
cursor._onChange, | ||
@@ -211,3 +262,3 @@ value | ||
cursor._rootData, | ||
changeKey ? keyPath.concat(changeKey) : keyPath | ||
newKeyPath(keyPath, changeKey) | ||
); | ||
@@ -220,3 +271,6 @@ if (result !== undefined) { | ||
function newKeyPath(head, tail) { | ||
return tail ? Seq(head).concat(tail).toArray() : head; | ||
} | ||
exports.from = cursorFrom; |
@@ -9,28 +9,28 @@ /** | ||
*/ | ||
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Immutable=e()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function h(t,e){return f(t,e,0)}function c(t,e){return f(t,e,e)}function f(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:x(t)}function p(t){return d(t)?t:E(t)}function v(t){return m(t)?t:k(t)}function l(t){return y(t)&&!g(t)?t:A(t)}function y(t){return!(!t||!t[pn])}function d(t){return!(!t||!t[vn])}function m(t){return!(!t||!t[ln])}function g(t){return d(t)||m(t)}function w(t){return!(!t||!t[yn])}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(wn&&t[wn]||t[Sn]);return"function"==typeof e?e:void 0}function O(t){return t&&"number"==typeof t.length}function x(t){return null===t||void 0===t?T():y(t)?t.toSeq():C(t)}function E(t){return null===t||void 0===t?T().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():W(t)}function k(t){return null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():B(t)}function A(t){return(null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t:B(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function K(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function R(t){this._iterable=t,this.size=t.length||t.size}function U(t){this._iterator=t,this._iteratorCache=[] | ||
}function L(t){return!(!t||!t[In])}function T(){return bn||(bn=new j([]))}function W(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new U(t).fromEntrySeq():b(t)?new R(t).fromEntrySeq():"object"==typeof t?new K(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function B(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new K(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return O(t)?new j(t):q(t)?new U(t):b(t)?new R(t):void 0}function P(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function H(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function N(){throw TypeError("Abstract")}function V(){}function Y(){}function Q(){}function X(t,e){return t===e||t!==t&&e!==e?!0:t&&e?("function"==typeof t.valueOf&&"function"==typeof e.valueOf&&(t=t.valueOf(),e=e.valueOf()),"function"==typeof t.equals&&"function"==typeof e.equals?t.equals(e):t===e||t!==t&&e!==e):!1}function F(t,e){return e?G(e,t,"",{"":t}):Z(t)}function G(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return G(t,r,n,e)})):$(e)?t.call(n,r,E(e).map(function(r,n){return G(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?k(t).map(Z).toList():$(t)?E(t).map(Z).toMap():t}function $(t){return t&&t.constructor===Object}function te(t){return t>>>1&1073741824|3221225471&t}function ee(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return te(r)}return"string"===e?t.length>En?re(t):ne(t):"function"==typeof t.hashCode?t.hashCode():ie(t) | ||
}function re(t){var e=jn[t];return void 0===e&&(e=ne(t),An===kn&&(An=0,jn={}),An++,jn[t]=e),e}function ne(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)|0;return te(e)}function ie(t){var e=Mn&&Mn.get(t);if(e)return e;if(e=t[xn])return e;if(!Dn){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[xn])return e;if(e=oe(t))return e}if(Object.isExtensible&&!Object.isExtensible(t))throw Error("Non-extensible objects are not allowed as keys.");if(e=++On,1073741824&On&&(On=0),Mn)Mn.set(t,e);else if(Dn)Object.defineProperty(t,xn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[xn]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[xn]=e}return e}function oe(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ue(t,e){if(!t)throw Error(e)}function se(t){ue(1/0!==t,"Cannot perform this action with an infinite size.")}function ae(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function he(t){this._iter=t,this.size=t.size}function ce(t){this._iter=t,this.size=t.size}function fe(t){this._iter=t,this.size=t.size}function _e(t){var e=je(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.cacheResult=Ke,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===gn){var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===mn?dn:mn,r)},e}function pe(t,e,r){var n=je(t);return n.size=t.size,n.has=function(e){return t.has(e) | ||
},n.get=function(n,i){var o=t.get(n,cn);return o===cn?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(gn,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function ve(t,e){var r=je(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_e(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=Ke,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function le(t,e,r,n){var i=je(t);return n&&(i.has=function(n){var i=t.get(n,cn);return i!==cn&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,cn);return o!==cn&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(gn,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],c=a[1];if(e.call(r,c,h,t))return z(i,n?h:s++,c,o)}})},i}function ye(t,e,r){var n=Le().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function de(t,e,r){var n=d(t),i=(w(t)?Ir():Le()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=Ae(t);return i.map(function(e){return xe(t,o(e))})}function me(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=h(e,i),s=c(r,i);if(o!==o||s!==s)return me(t.toSeq().cacheResult(),e,r,n);var f=s-o;0>f&&(f=0);var _=je(t);return _.size=0===f?f:t.size&&f||void 0,!n&&L(t)&&f>=0&&(_.get=function(e,r){return e=u(this,e),e>=0&&f>e?t.get(e+o,r):r}),_.__iterateUncached=function(e,r){var i=this; | ||
if(0===f)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++<o)?void 0:(a++,e(t,n?r:a-1,i)!==!1&&a!==f)}),a},_.__iteratorUncached=function(e,r){if(f&&r)return this.cacheResult().__iterator(e,r);var i=f&&t.__iterator(e,r),u=0,s=0;return new S(function(){for(;u++!==o;)i.next();if(++s>f)return I();var t=i.next();return n||e===mn?t:e===dn?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},_}function ge(t,e,r){var n=je(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(gn,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===gn?t:z(n,a,h,t):(s=!1,I())})},n}function we(t,e,r,n){var i=je(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(gn,o),a=!0,h=0;return new S(function(){var t,o,c;do{if(t=s.next(),t.done)return n||i===mn?t:i===dn?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var f=t.value;o=f[0],c=f[1],a&&(a=e.call(r,c,o,u))}while(a);return i===gn?t:z(i,o,c,t)})},i}function Se(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?W(t):B(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||m(t)&&m(i))return i}var o=new j(n);return r?o=o.toKeyedSeq():m(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function ze(t,e,r){var n=je(t);return n.__iterateUncached=function(n,i){function o(t,a){var h=this; | ||
t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,h)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new S(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===gn&&(a=a[1]),e&&!(e>u.length)||!y(a))return r?t:z(n,s++,a,t);u.push(o),o=a.__iterator(n,i)}else o=u.pop()}return I()})},n}function Ie(t,e,r){var n=Ae(t);return t.toSeq().map(function(i,o){return n(e.call(r,i,o,t))}).flatten(!0)}function be(t,e){var r=je(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate(function(t){return(!o||r(e,o++,i)!==!1)&&r(t,o++,i)!==!1},n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(mn,n),u=0;return new S(function(){return(!i||u%2)&&(i=o.next(),i.done)?i:u%2?z(r,u++,e):z(r,u++,i.value,i)})},r}function qe(t,e,r){e||(e=Re);var n=d(t),i=0,o=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return o.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?E(o):m(t)?k(o):A(o)}function De(t,e,r){if(e||(e=Re),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return Me(e,t[1],r[1])?r:t});return n&&n[0]}return t.reduce(function(t,r){return Me(e,t,r)?r:t})}function Me(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(void 0===r||null===r||r!==r)||n>0}function Oe(t,e,r){var n=je(t);return n.size=new j(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(mn,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),D(n?t.reverse():t)}),o=0,u=!1;return new S(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?I():z(t,o++,e.apply(null,r.map(function(t){return t.value})))})},n}function xe(t,e){return L(t)?e:t.constructor(e)}function Ee(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t) | ||
}function ke(t){return se(t.size),o(t)}function Ae(t){return d(t)?p:m(t)?v:l}function je(t){return Object.create((d(t)?E:m(t)?k:A).prototype)}function Ke(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):x.prototype.cacheResult.call(this)}function Re(t,e){return t>e?1:e>t?-1:0}function Ue(t){var e=D(t);if(!e){if(!O(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(t))}return e}function Le(t){return null===t||void 0===t?Qe():Te(t)?t:Qe().withMutations(function(e){var r=p(t);se(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Te(t){return!(!t||!t[Kn])}function We(t,e){this.ownerID=t,this.entries=e}function Be(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Ce(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Je(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Pe(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function He(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ve(t._root)}function Ne(t,e){return z(t,e[0],e[1])}function Ve(t,e){return{node:t,index:0,__prev:e}}function Ye(t,e,r,n){var i=Object.create(Rn);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qe(){return Un||(Un=Ye(0))}function Xe(t,r,n){var i,o;if(t._root){var u=e(fn),s=e(_n);if(i=Fe(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===cn?-1:1:0)}else{if(n===cn)return t;o=1,i=new We(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Ye(o,i):Qe()}function Fe(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===cn?t:(r(a),r(s),new Pe(e,i,[o,u]))}function Ge(t){return t.constructor===Pe||t.constructor===Je}function Ze(t,e,r,n,i){if(t.keyHash===n)return new Je(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&hn,s=(0===r?n:n>>>r)&hn,a=u===s?[Ze(t,e,r+sn,n,i)]:(o=new Pe(e,n,i),s>u?[t,o]:[o,t]);return new Be(e,1<<u|1<<s,a)}function $e(t,e,r,i){t||(t=new n);for(var o=new Pe(t,ee(r),[r,i]),u=0;e.length>u;u++){var s=e[u];o=o.update(t,0,void 0,s[0],s[1]) | ||
}return o}function tr(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,h=e.length;h>s;s++,a<<=1){var c=e[s];void 0!==c&&s!==n&&(i|=a,u[o++]=c)}return new Be(t,i,u)}function er(t,e,r,n,i){for(var o=0,u=Array(an),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Ce(t,o+1,u)}function rr(t,e,r){for(var n=[],i=0;r.length>i;i++){var o=r[i],u=p(o);y(o)||(u=u.map(function(t){return F(t)})),n.push(u)}return ir(t,e,n)}function nr(t){return function(e,r){return e&&e.mergeDeepWith&&y(r)?e.mergeDeepWith(t,r):t?t(e,r):r}}function ir(t,e,r){return r=r.filter(function(t){return 0!==t.size}),0===r.length?t:0===t.size&&1===r.length?t.constructor(r[0]):t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,cn,function(t){return t===cn?r:e(t,r)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function or(t,e,r,n){var i=t===cn,o=e.next();if(o.done){var u=i?r:t,s=n(u);return s===u?t:s}ue(i||t&&t.set,"invalid keyPath");var a=o.value,h=i?cn:t.get(a,cn),c=or(h,e,r,n);return c===h?t:c===cn?t.remove(a):(i?Qe():t).set(a,c)}function ur(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function sr(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ar(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function hr(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function cr(t){var e=lr();if(null===t||void 0===t)return e;if(fr(t))return t;var r=v(t),n=r.size;return 0===n?e:(se(n),n>0&&an>n?vr(0,n,sn,null,new _r(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function fr(t){return!(!t||!t[Bn])}function _r(t,e){this.array=t,this.ownerID=e}function pr(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r;return h>an&&(h=an),function(){if(i===h)return Pn;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,c=(u-i>>n)+1; | ||
return c>an&&(c=an),function(){for(;;){if(s){var t=s();if(t!==Pn)return t;s=null}if(h===c)return Pn;var o=e?--c:h++;s=r(a&&a[o],n-sn,i+(o<<n))}}}var o=t._origin,u=t._capacity,s=zr(u),a=t._tail;return r(t._root,t._level,0)}function vr(t,e,r,n,i,o,u){var s=Object.create(Cn);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function lr(){return Jn||(Jn=vr(0,0,sn))}function yr(t,r,n){if(r=u(t,r),r>=t.size||0>r)return t.withMutations(function(t){0>r?wr(t,r).set(0,n):wr(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(_n);return r>=zr(t._capacity)?i=dr(i,t.__ownerID,0,r,n,s):o=dr(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):vr(t._origin,t._capacity,t._level,o,i):t}function dr(t,e,n,i,o,u){var s=i>>>n&hn,a=t&&t.array.length>s;if(!a&&void 0===o)return t;var h;if(n>0){var c=t&&t.array[s],f=dr(c,e,n-sn,i,o,u);return f===c?t:(h=mr(t,e),h.array[s]=f,h)}return a&&t.array[s]===o?t:(r(u),h=mr(t,e),void 0===o&&s===h.array.length-1?h.array.pop():h.array[s]=o,h)}function mr(t,e){return e&&t&&e===t.ownerID?t:new _r(t?t.array.slice():[],e)}function gr(t,e){if(e>=zr(t._capacity))return t._tail;if(1<<t._level+sn>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&hn],n-=sn;return r}}function wr(t,e,r){var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new _r(c&&c.array.length?[void 0,c]:[],i),h+=sn,f+=1<<h;f&&(s+=f,o+=f,a+=f,u+=f);for(var _=zr(u),p=zr(a);p>=1<<h+sn;)c=new _r(c&&c.array.length?[c]:[],i),h+=sn;var v=t._tail,l=_>p?gr(t,a-1):p>_?new _r([],i):v;if(v&&p>_&&u>s&&v.array.length){c=mr(c,i);for(var y=c,d=h;d>sn;d-=sn){var m=_>>>d&hn;y=y.array[m]=mr(y.array[m],i)}y.array[_>>>sn&hn]=v}if(u>a&&(l=l&&l.removeAfter(i,0,a)),s>=p)s-=p,a-=p,h=sn,c=null,l=l&&l.removeBefore(i,0,s);else if(s>o||_>p){for(f=0;c;){var g=s>>>h&hn;if(g!==p>>>h&hn)break;g&&(f+=(1<<h)*g),h-=sn,c=c.array[g] | ||
}c&&s>o&&(c=c.removeBefore(i,h,s-f)),c&&_>p&&(c=c.removeAfter(i,h,p-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=c,t._tail=l,t.__hash=void 0,t.__altered=!0,t):vr(s,a,h,c,l)}function Sr(t,e,r){for(var n=[],i=0,o=0;r.length>o;o++){var u=r[o],s=v(u);s.size>i&&(i=s.size),y(u)||(s=s.map(function(t){return F(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ir(t,e,n)}function zr(t){return an>t?0:t-1>>>sn<<sn}function Ir(t){return null===t||void 0===t?Dr():br(t)?t:Dr().withMutations(function(e){var r=p(t);se(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function br(t){return Te(t)&&w(t)}function qr(t,e,r,n){var i=Object.create(Ir.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function Dr(){return Hn||(Hn=qr(Qe(),lr()))}function Mr(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===cn){if(!a)return t;u.size>=an&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):qr(n,i)}function Or(t){return null===t||void 0===t?kr():xr(t)?t:kr().unshiftAll(t)}function xr(t){return!(!t||!t[Nn])}function Er(t,e,r,n){var i=Object.create(Vn);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function kr(){return Yn||(Yn=Er(0))}function Ar(t){return null===t||void 0===t?Ur():jr(t)?t:Ur().withMutations(function(e){var r=l(t);se(r.size),r.forEach(function(t){return e.add(t)})})}function jr(t){return!(!t||!t[Qn])}function Kr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Rr(t,e){var r=Object.create(Xn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ur(){return Fn||(Fn=Rr(Qe()))}function Lr(t){return null===t||void 0===t?Br():Tr(t)?t:Br().withMutations(function(e){var r=l(t); | ||
se(r.size),r.forEach(function(t){return e.add(t)})})}function Tr(t){return jr(t)&&w(t)}function Wr(t,e){var r=Object.create(Gn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Br(){return Zn||(Zn=Wr(Dr()))}function Cr(t,e){var r=function(t){return this instanceof r?void(this._map=Le(t)):new r(t)},n=Object.keys(t),i=r.prototype=Object.create($n);i.constructor=r,e&&(i._name=e),i._defaultValues=t,i._keys=n,i.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){ue(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(o){}return r}function Jr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Pr(t){return t._name||t.constructor.name}function Hr(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||m(t)!==m(e)||w(t)!==w(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!g(t);if(w(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,cn)):X(t.get(n,cn),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Nr(t,e,r){if(!(this instanceof Nr))return new Nr(t,e,r);if(ue(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(ti)return ti;ti=this}}function Vr(t,e){if(!(this instanceof Vr))return new Vr(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(ei)return ei;ei=this}}function Yr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Qr(t,e){return e}function Xr(t,e){return[e,t] | ||
}function Fr(t){return function(){return!t.apply(this,arguments)}}function Gr(t){return function(){return-t.apply(this,arguments)}}function Zr(t){return"string"==typeof t?JSON.stringify(t):t}function $r(){return i(arguments)}function tn(t,e){return e>t?1:t>e?-1:0}function en(t){if(1/0===t.size)return 0;var e=w(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+nn(ee(t),ee(e))|0}:function(t,e){n=n+nn(ee(t),ee(e))|0}:e?function(t){n=31*n+ee(t)|0}:function(t){n=n+ee(t)|0});return rn(i,n)}function rn(t,e){return e=qn(e,3432918353),e=qn(e<<15|e>>>-15,461845907),e=qn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=qn(e^e>>>16,2246822507),e=qn(e^e>>>13,3266489909),e=te(e^e>>>16)}function nn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var on=Array.prototype.slice,un="delete",sn=5,an=1<<sn,hn=an-1,cn={},fn={value:!1},_n={value:!1};t(p,_),t(v,_),t(l,_),_.isIterable=y,_.isKeyed=d,_.isIndexed=m,_.isAssociative=g,_.isOrdered=w,_.Keyed=p,_.Indexed=v,_.Set=l;var pn="@@__IMMUTABLE_ITERABLE__@@",vn="@@__IMMUTABLE_KEYED__@@",ln="@@__IMMUTABLE_INDEXED__@@",yn="@@__IMMUTABLE_ORDERED__@@",dn=0,mn=1,gn=2,wn="function"==typeof Symbol&&Symbol.iterator,Sn="@@iterator",zn=wn||Sn;S.prototype.toString=function(){return"[Iterator]"},S.KEYS=dn,S.VALUES=mn,S.ENTRIES=gn,S.prototype.inspect=S.prototype.toSource=function(){return""+this},S.prototype[zn]=function(){return this},t(x,_),x.of=function(){return x(arguments)},x.prototype.toSeq=function(){return this},x.prototype.toString=function(){return this.__toString("Seq {","}")},x.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},x.prototype.__iterate=function(t,e){return P(this,t,e,!0)},x.prototype.__iterator=function(t,e){return H(this,t,e,!0)},t(E,x),E.of=function(){return E(arguments)},E.prototype.toKeyedSeq=function(){return this},E.prototype.toSeq=function(){return this},t(k,x),k.of=function(){return k(arguments)},k.prototype.toIndexedSeq=function(){return this},k.prototype.toString=function(){return this.__toString("Seq [","]") | ||
},k.prototype.__iterate=function(t,e){return P(this,t,e,!1)},k.prototype.__iterator=function(t,e){return H(this,t,e,!1)},t(A,x),A.of=function(){return A(arguments)},A.prototype.toSetSeq=function(){return this},x.isSeq=L,x.Keyed=E,x.Set=A,x.Indexed=k;var In="@@__IMMUTABLE_SEQ__@@";x.prototype[In]=!0,t(j,k),j.prototype.get=function(t,e){return this.has(t)?this._array[u(this,t)]:e},j.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(K,E),K.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},K.prototype.has=function(t){return this._object.hasOwnProperty(t)},K.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},K.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},K.prototype[yn]=!0,t(R,k),R.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},R.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var o;!(o=r.next()).done;){var u=o.value;if(n[i]=u,t(u,i++,this)===!1)break}return i},U.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new S(function(){if(i>=n.length){var e=r.next(); | ||
if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var bn;t(N,_),t(V,N),t(Y,N),t(Q,N),N.Keyed=V,N.Indexed=Y,N.Set=Q;var qn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Dn=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Mn="function"==typeof WeakMap&&new WeakMap,On=0,xn="__immutablehash__";"function"==typeof Symbol&&(xn=Symbol(xn));var En=16,kn=255,An=0,jn={};t(ae,E),ae.prototype.get=function(t,e){return this._iter.get(t,e)},ae.prototype.has=function(t){return this._iter.has(t)},ae.prototype.valueSeq=function(){return this._iter.valueSeq()},ae.prototype.reverse=function(){var t=this,e=ve(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},ae.prototype.map=function(t,e){var r=this,n=pe(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},ae.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?ke(this):0,function(i){return t(i,e?--r:r++,n)}),e)},ae.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(mn,e),n=e?ke(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},ae.prototype[yn]=!0,t(he,k),he.prototype.contains=function(t){return this._iter.contains(t)},he.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},he.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e),n=0;return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})},t(ce,A),ce.prototype.has=function(t){return this._iter.contains(t)},ce.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},ce.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e);return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e) | ||
})},t(fe,E),fe.prototype.entrySeq=function(){return this._iter.toSeq()},fe.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(Ee(e),t(e[1],e[0],r)):void 0},e)},fe.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return Ee(n),t===gn?e:z(t,n[0],n[1],e)}})},he.prototype.cacheResult=ae.prototype.cacheResult=ce.prototype.cacheResult=fe.prototype.cacheResult=Ke,t(Le,V),Le.prototype.toString=function(){return this.__toString("Map {","}")},Le.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Le.prototype.set=function(t,e){return Xe(this,t,e)},Le.prototype.setIn=function(t,e){return this.updateIn(t,cn,function(){return e})},Le.prototype.remove=function(t){return Xe(this,t,cn)},Le.prototype.deleteIn=function(t){return this.updateIn(t,function(){return cn})},Le.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Le.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=or(this,Ue(t),e,r);return n===cn?void 0:n},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},Le.prototype.merge=function(){return rr(this,void 0,arguments)},Le.prototype.mergeWith=function(t){var e=on.call(arguments,1);return rr(this,t,e)},Le.prototype.mergeIn=function(t){var e=on.call(arguments,1);return this.updateIn(t,Qe(),function(t){return t.merge.apply(t,e)})},Le.prototype.mergeDeep=function(){return rr(this,nr(void 0),arguments)},Le.prototype.mergeDeepWith=function(t){var e=on.call(arguments,1);return rr(this,nr(t),e)},Le.prototype.mergeDeepIn=function(t){var e=on.call(arguments,1);return this.updateIn(t,Qe(),function(t){return t.mergeDeep.apply(t,e)})},Le.prototype.sort=function(t){return Ir(qe(this,t))},Le.prototype.sortBy=function(t,e){return Ir(qe(this,e,t))},Le.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this | ||
},Le.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Le.prototype.asImmutable=function(){return this.__ensureOwner()},Le.prototype.wasAltered=function(){return this.__altered},Le.prototype.__iterator=function(t,e){return new He(this,t,e)},Le.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Le.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ye(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Le.isMap=Te;var Kn="@@__IMMUTABLE_MAP__@@",Rn=Le.prototype;Rn[Kn]=!0,Rn[un]=Rn.remove,Rn.removeIn=Rn.deleteIn,We.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},We.prototype.update=function(t,e,n,o,u,s,a){for(var h=u===cn,c=this.entries,f=0,_=c.length;_>f&&!X(o,c[f][0]);f++);var p=_>f;if(p?c[f][1]===u:h)return this;if(r(a),(h||!p)&&r(s),!h||1!==c.length){if(!p&&!h&&c.length>=Ln)return $e(t,c,o,u);var v=t&&t===this.ownerID,l=v?c:i(c);return p?h?f===_-1?l.pop():l[f]=l.pop():l[f]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new We(t,l)}},Be.prototype.get=function(t,e,r,n){void 0===e&&(e=ee(r));var i=1<<((0===t?e:e>>>t)&hn),o=this.bitmap;return 0===(o&i)?n:this.nodes[ur(o&i-1)].get(t+sn,e,r,n)},Be.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ee(n));var s=(0===e?r:r>>>e)&hn,a=1<<s,h=this.bitmap,c=0!==(h&a);if(!c&&i===cn)return this;var f=ur(h&a-1),_=this.nodes,p=c?_[f]:void 0,v=Fe(p,t,e+sn,r,n,i,o,u);if(v===p)return this;if(!c&&v&&_.length>=Tn)return er(t,_,h,s,v);if(c&&!v&&2===_.length&&Ge(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&Ge(v))return v;var l=t&&t===this.ownerID,y=c?v?h:h^a:h|a,d=c?v?sr(_,f,v,l):hr(_,f,l):ar(_,f,v,l);return l?(this.bitmap=y,this.nodes=d,this):new Be(t,y,d)},Ce.prototype.get=function(t,e,r,n){void 0===e&&(e=ee(r));var i=(0===t?e:e>>>t)&hn,o=this.nodes[i];return o?o.get(t+sn,e,r,n):n},Ce.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ee(n));var s=(0===e?r:r>>>e)&hn,a=i===cn,h=this.nodes,c=h[s]; | ||
if(a&&!c)return this;var f=Fe(c,t,e+sn,r,n,i,o,u);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Wn>_))return tr(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=sr(h,s,f,p);return p?(this.count=_,this.nodes=v,this):new Ce(t,_,v)},Je.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Je.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=ee(o));var h=u===cn;if(n!==this.keyHash)return h?this:(r(a),r(s),Ze(this,t,e,n,[o,u]));for(var c=this.entries,f=0,_=c.length;_>f&&!X(o,c[f][0]);f++);var p=_>f;if(p?c[f][1]===u:h)return this;if(r(a),(h||!p)&&r(s),h&&2===_)return new Pe(t,this.keyHash,c[1^f]);var v=t&&t===this.ownerID,l=v?c:i(c);return p?h?f===_-1?l.pop():l[f]=l.pop():l[f]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Je(t,this.keyHash,l)},Pe.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Pe.prototype.update=function(t,e,n,i,o,u,s){var a=o===cn,h=X(i,this.entry[0]);return(h?o===this.entry[1]:a)?this:(r(s),a?void r(u):h?t&&t===this.ownerID?(this.entry[1]=o,this):new Pe(t,this.keyHash,[i,o]):(r(u),Ze(this,t,e,ee(i),[i,o])))},We.prototype.iterate=Je.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Be.prototype.iterate=Ce.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Pe.prototype.iterate=function(t){return t(this.entry)},t(He,S),He.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Ne(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Ne(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Ne(t,o.entry);e=this._stack=Ve(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Un,Ln=an/4,Tn=an/2,Wn=an/4;t(cr,Y),cr.of=function(){return this(arguments)},cr.prototype.toString=function(){return this.__toString("List [","]") | ||
},cr.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=gr(this,t);return r&&r.array[t&hn]},cr.prototype.set=function(t,e){return yr(this,t,e)},cr.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},cr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=sn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):lr()},cr.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){wr(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},cr.prototype.pop=function(){return wr(this,0,-1)},cr.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){wr(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},cr.prototype.shift=function(){return wr(this,1)},cr.prototype.merge=function(){return Sr(this,void 0,arguments)},cr.prototype.mergeWith=function(t){var e=on.call(arguments,1);return Sr(this,t,e)},cr.prototype.mergeDeep=function(){return Sr(this,nr(void 0),arguments)},cr.prototype.mergeDeepWith=function(t){var e=on.call(arguments,1);return Sr(this,nr(t),e)},cr.prototype.setSize=function(t){return wr(this,0,t)},cr.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:wr(this,h(t,r),c(e,r))},cr.prototype.__iterator=function(t,e){var r=0,n=pr(this,e);return new S(function(){var e=n();return e===Pn?I():z(t,r++,e)})},cr.prototype.__iterate=function(t,e){for(var r,n=0,i=pr(this,e);(r=i())!==Pn&&t(r,n++,this)!==!1;);return n},cr.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?vr(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},cr.isList=fr;var Bn="@@__IMMUTABLE_LIST__@@",Cn=cr.prototype;Cn[Bn]=!0,Cn[un]=Cn.remove,Cn.setIn=Rn.setIn,Cn.deleteIn=Cn.removeIn=Rn.removeIn,Cn.update=Rn.update,Cn.updateIn=Rn.updateIn,Cn.mergeIn=Rn.mergeIn,Cn.mergeDeepIn=Rn.mergeDeepIn,Cn.withMutations=Rn.withMutations,Cn.asMutable=Rn.asMutable,Cn.asImmutable=Rn.asImmutable,Cn.wasAltered=Rn.wasAltered,_r.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this; | ||
var n=r>>>e&hn;if(n>=this.array.length)return new _r([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-sn,r),i===u&&o)return this}if(o&&!i)return this;var s=mr(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_r.prototype.removeAfter=function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&hn;if(n>=this.array.length)return this;var i,o=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-sn,r),i===u&&o)return this}if(o&&!i)return this;var s=mr(this,t);return o||s.array.pop(),i&&(s.array[n]=i),s};var Jn,Pn={};t(Ir,Le),Ir.of=function(){return this(arguments)},Ir.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ir.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ir.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Dr()},Ir.prototype.set=function(t,e){return Mr(this,t,e)},Ir.prototype.remove=function(t){return Mr(this,t,cn)},Ir.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ir.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ir.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ir.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?qr(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ir.isOrderedMap=br,Ir.prototype[yn]=!0,Ir.prototype[un]=Ir.prototype.remove;var Hn;t(Or,Y),Or.of=function(){return this(arguments)},Or.prototype.toString=function(){return this.__toString("Stack [","]")},Or.prototype.get=function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},Or.prototype.peek=function(){return this._head&&this._head.value},Or.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e}; | ||
return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Er(t,e)},Or.prototype.pushAll=function(t){if(t=v(t),0===t.size)return this;se(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Er(e,r)},Or.prototype.pop=function(){return this.slice(1)},Or.prototype.unshift=function(){return this.push.apply(this,arguments)},Or.prototype.unshiftAll=function(t){return this.pushAll(t)},Or.prototype.shift=function(){return this.pop.apply(this,arguments)},Or.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):kr()},Or.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=h(t,this.size),n=c(e,this.size);if(n!==this.size)return Y.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Er(i,o)},Or.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Er(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Or.prototype.__iterate=function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Or.prototype.__iterator=function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Or.isStack=xr;var Nn="@@__IMMUTABLE_STACK__@@",Vn=Or.prototype;Vn[Nn]=!0,Vn.withMutations=Rn.withMutations,Vn.asMutable=Rn.asMutable,Vn.asImmutable=Rn.asImmutable,Vn.wasAltered=Rn.wasAltered;var Yn;t(Ar,Q),Ar.of=function(){return this(arguments)},Ar.fromKeys=function(t){return this(p(t).keySeq())},Ar.prototype.toString=function(){return this.__toString("Set {","}")},Ar.prototype.has=function(t){return this._map.has(t)},Ar.prototype.add=function(t){return Kr(this,this._map.set(t,!0)) | ||
},Ar.prototype.remove=function(t){return Kr(this,this._map.remove(t))},Ar.prototype.clear=function(){return Kr(this,this._map.clear())},Ar.prototype.union=function(){var t=on.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var r=0;t.length>r;r++)l(t[r]).forEach(function(t){return e.add(t)})})},Ar.prototype.intersect=function(){var t=on.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.every(function(t){return t.contains(e)})||r.remove(e)})})},Ar.prototype.subtract=function(){var t=on.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.some(function(t){return t.contains(e)})&&r.remove(e)})})},Ar.prototype.merge=function(){return this.union.apply(this,arguments)},Ar.prototype.mergeWith=function(){var t=on.call(arguments,1);return this.union.apply(this,t)},Ar.prototype.sort=function(t){return Lr(qe(this,t))},Ar.prototype.sortBy=function(t,e){return Lr(qe(this,e,t))},Ar.prototype.wasAltered=function(){return this._map.wasAltered()},Ar.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},Ar.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Ar.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Ar.isSet=jr;var Qn="@@__IMMUTABLE_SET__@@",Xn=Ar.prototype;Xn[Qn]=!0,Xn[un]=Xn.remove,Xn.mergeDeep=Xn.merge,Xn.mergeDeepWith=Xn.mergeWith,Xn.withMutations=Rn.withMutations,Xn.asMutable=Rn.asMutable,Xn.asImmutable=Rn.asImmutable,Xn.__empty=Ur,Xn.__make=Rr;var Fn;t(Lr,Ar),Lr.of=function(){return this(arguments)},Lr.fromKeys=function(t){return this(p(t).keySeq())},Lr.prototype.toString=function(){return this.__toString("OrderedSet {","}") | ||
},Lr.isOrderedSet=Tr;var Gn=Lr.prototype;Gn[yn]=!0,Gn.__empty=Br,Gn.__make=Wr;var Zn;t(Cr,V),Cr.prototype.toString=function(){return this.__toString(Pr(this)+" {","}")},Cr.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Cr.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},Cr.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=Jr(this,Qe()))},Cr.prototype.set=function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+Pr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:Jr(this,r)},Cr.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Jr(this,e)},Cr.prototype.wasAltered=function(){return this._map.wasAltered()},Cr.prototype.__iterator=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Cr.prototype.__iterate=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Cr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Jr(this,e,t):(this.__ownerID=t,this._map=e,this)};var $n=Cr.prototype;$n[un]=$n.remove,$n.deleteIn=$n.removeIn=Rn.removeIn,$n.merge=Rn.merge,$n.mergeWith=Rn.mergeWith,$n.mergeIn=Rn.mergeIn,$n.mergeDeep=Rn.mergeDeep,$n.mergeDeepWith=Rn.mergeDeepWith,$n.mergeDeepIn=Rn.mergeDeepIn,$n.setIn=Rn.setIn,$n.update=Rn.update,$n.updateIn=Rn.updateIn,$n.withMutations=Rn.withMutations,$n.asMutable=Rn.asMutable,$n.asImmutable=Rn.asImmutable,t(Nr,k),Nr.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Nr.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Nr.prototype.contains=function(t){var e=(t-this._start)/this._step; | ||
return e>=0&&this.size>e&&e===Math.floor(e)},Nr.prototype.slice=function(t,e){return a(t,e,this.size)?this:(t=h(t,this.size),e=c(e,this.size),t>=e?new Nr(0,0):new Nr(this.get(t,this._end),this.get(e,this._end),this._step))},Nr.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},Nr.prototype.lastIndexOf=function(t){return this.indexOf(t)},Nr.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;r>=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Nr.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},Nr.prototype.equals=function(t){return t instanceof Nr?this._start===t._start&&this._end===t._end&&this._step===t._step:Hr(this,t)};var ti;t(Vr,k),Vr.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Vr.prototype.get=function(t,e){return this.has(t)?this._value:e},Vr.prototype.contains=function(t){return X(this._value,t)},Vr.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Vr(this._value,c(e,r)-h(t,r))},Vr.prototype.reverse=function(){return this},Vr.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Vr.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Vr.prototype.__iterate=function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},Vr.prototype.__iterator=function(t){var e=this,r=0;return new S(function(){return e.size>r?z(t,r++,e._value):I()})},Vr.prototype.equals=function(t){return t instanceof Vr?X(this._value,t._value):Hr(t)};var ei;_.Iterator=S,Yr(_,{toArray:function(){se(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new he(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS() | ||
},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new ae(this,!0)},toMap:function(){return Le(this.toKeyedSeq())},toObject:function(){se(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Ir(this.toKeyedSeq())},toOrderedSet:function(){return Lr(d(this)?this.valueSeq():this)},toSet:function(){return Ar(d(this)?this.valueSeq():this)},toSetSeq:function(){return new ce(this)},toSeq:function(){return m(this)?this.toIndexedSeq():d(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Or(d(this)?this.valueSeq():this)},toList:function(){return cr(d(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=on.call(arguments,0);return xe(this,Se(this,t))},contains:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(gn)},every:function(t,e){se(this.size);var r=!0;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?void 0:(r=!1,!1)}),r},filter:function(t,e){return xe(this,le(this,t,e,!0))},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,o){return t.call(e,r,i,o)?(n=r,!1):void 0}),n},forEach:function(t,e){return se(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){se(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(dn)},map:function(t,e){return xe(this,pe(this,t,e))},reduce:function(t,e,r){se(this.size);var n,i;return arguments.length<2?i=!0:n=e,this.__iterate(function(e,o,u){i?(i=!1,n=e):n=t.call(r,n,e,o,u)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return xe(this,ve(this,!0))},slice:function(t,e){return xe(this,me(this,t,e,!0))},some:function(t,e){return!this.every(Fr(t),e) | ||
},sort:function(t){return xe(this,qe(this,t))},values:function(){return this.__iterator(mn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return o(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return ye(this,t,e)},equals:function(t){return Hr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new j(t._cache);var e=t.toSeq().map(Xr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Fr(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(s)},flatMap:function(t,e){return xe(this,Ie(this,t,e))},flatten:function(t){return xe(this,ze(this,t,!0))},fromEntrySeq:function(){return new fe(this)},get:function(t,e){return this.find(function(e,r){return X(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,i=Ue(t);!(r=i.next()).done;){var o=r.value;if(n=n&&n.get?n.get(o,cn):cn,n===cn)return e}return n},groupBy:function(t,e){return de(this,t,e)},has:function(t){return this.get(t,cn)!==cn},hasIn:function(t){return this.getIn(t,cn)!==cn},isSubset:function(t){return t="function"==typeof t.contains?t:_(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(Qr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return De(this,t)},maxBy:function(t,e){return De(this,e,t)},min:function(t){return De(this,t?Gr(t):tn)},minBy:function(t,e){return De(this,e?Gr(e):tn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return xe(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return xe(this,we(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Fr(t),e)},sortBy:function(t,e){return xe(this,qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return xe(this,this.toSeq().reverse().take(t).reverse()) | ||
},takeWhile:function(t,e){return xe(this,ge(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Fr(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=en(this))}});var ri=_.prototype;ri[pn]=!0,ri[zn]=ri.values,ri.__toJS=ri.toArray,ri.__toStringMapper=Zr,ri.inspect=ri.toSource=function(){return""+this},ri.chain=ri.flatMap,function(){try{Object.defineProperty(ri,"length",{get:function(){if(!_.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),Yr(p,{flip:function(){return xe(this,_e(this))},findKey:function(t,e){var r;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?(r=i,!1):void 0}),r},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},lastKeyOf:function(t){return this.toSeq().reverse().keyOf(t)},mapEntries:function(t,e){var r=this,n=0;return xe(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return xe(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}});var ni=p.prototype;ni[vn]=!0,ni[zn]=ri.entries,ni.__toJS=ri.toObject,ni.__toStringMapper=function(t,e){return e+": "+Zr(t)},Yr(v,{toKeyedSeq:function(){return new ae(this,!1)},filter:function(t,e){return xe(this,le(this,t,e,!1))},findIndex:function(t,e){var r=this.toKeyedSeq().findKey(t,e);return void 0===r?-1:r},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return xe(this,ve(this,!1))},slice:function(t,e){return xe(this,me(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=h(t,this.size); | ||
var n=this.slice(0,t);return xe(this,1===r?n:n.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return xe(this,ze(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return xe(this,be(this,t))},interleave:function(){var t=[this].concat(i(arguments)),e=Oe(this.toSeq(),k.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),xe(this,r)},last:function(){return this.get(-1)},skipWhile:function(t,e){return xe(this,we(this,t,e,!1))},zip:function(){var t=[this].concat(i(arguments));return xe(this,Oe(this,$r,t))},zipWith:function(t){var e=i(arguments);return e[0]=this,xe(this,Oe(this,t,e))}}),v.prototype[ln]=!0,v.prototype[yn]=!0,Yr(l,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),l.prototype.has=ri.contains,Yr(E,p.prototype),Yr(k,v.prototype),Yr(A,l.prototype),Yr(V,p.prototype),Yr(Y,v.prototype),Yr(Q,l.prototype);var ii={Iterable:_,Seq:x,Collection:N,Map:Le,OrderedMap:Ir,List:cr,Stack:Or,Set:Ar,OrderedSet:Lr,Record:Cr,Range:Nr,Repeat:Vr,is:X,fromJS:F};return ii}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Immutable=e()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function h(t,e){return c(t,e,0)}function f(t,e){return c(t,e,e)}function c(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:O(t)}function p(t){return d(t)?t:x(t)}function v(t){return m(t)?t:k(t)}function l(t){return y(t)&&!g(t)?t:A(t)}function y(t){return!(!t||!t[pn])}function d(t){return!(!t||!t[vn])}function m(t){return!(!t||!t[ln])}function g(t){return d(t)||m(t)}function w(t){return!(!t||!t[yn])}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(wn&&t[wn]||t[Sn]);return"function"==typeof e?e:void 0}function E(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?T():y(t)?t.toSeq():C(t)}function x(t){return null===t||void 0===t?T().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():W(t)}function k(t){return null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():B(t)}function A(t){return(null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t:B(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function U(t){this._iterable=t,this.size=t.length||t.size | ||
}function K(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[In])}function T(){return bn||(bn=new j([]))}function W(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new K(t).fromEntrySeq():b(t)?new U(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function B(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return E(t)?new j(t):q(t)?new K(t):b(t)?new U(t):void 0}function P(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function H(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function N(){throw TypeError("Abstract")}function V(){}function Y(){}function Q(){}function X(t,e){return t===e||t!==t&&e!==e?!0:t&&e?("function"==typeof t.valueOf&&"function"==typeof e.valueOf&&(t=t.valueOf(),e=e.valueOf()),"function"==typeof t.equals&&"function"==typeof e.equals?t.equals(e):t===e||t!==t&&e!==e):!1}function F(t,e){return e?G(e,t,"",{"":t}):Z(t)}function G(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return G(t,r,n,e)})):$(e)?t.call(n,r,x(e).map(function(r,n){return G(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?k(t).map(Z).toList():$(t)?x(t).map(Z).toMap():t}function $(t){return t&&t.constructor===Object}function te(t){return t>>>1&1073741824|3221225471&t}function ee(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t; | ||
return te(r)}return"string"===e?t.length>xn?re(t):ne(t):"function"==typeof t.hashCode?t.hashCode():ie(t)}function re(t){var e=jn[t];return void 0===e&&(e=ne(t),An===kn&&(An=0,jn={}),An++,jn[t]=e),e}function ne(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)|0;return te(e)}function ie(t){var e=Mn&&Mn.get(t);if(e)return e;if(e=t[On])return e;if(!Dn){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[On])return e;if(e=oe(t))return e}if(Object.isExtensible&&!Object.isExtensible(t))throw Error("Non-extensible objects are not allowed as keys.");if(e=++En,1073741824&En&&(En=0),Mn)Mn.set(t,e);else if(Dn)Object.defineProperty(t,On,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[On]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[On]=e}return e}function oe(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ue(t,e){if(!t)throw Error(e)}function se(t){ue(1/0!==t,"Cannot perform this action with an infinite size.")}function ae(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function he(t){this._iter=t,this.size=t.size}function fe(t){this._iter=t,this.size=t.size}function ce(t){this._iter=t,this.size=t.size}function _e(t){var e=je(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.cacheResult=Re,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===gn){var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e | ||
}return t})}return t.__iterator(e===mn?dn:mn,r)},e}function pe(t,e,r){var n=je(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,fn);return o===fn?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(gn,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function ve(t,e){var r=je(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_e(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=Re,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function le(t,e,r,n){var i=je(t);return n&&(i.has=function(n){var i=t.get(n,fn);return i!==fn&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,fn);return o!==fn&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(gn,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(e.call(r,f,h,t))return z(i,n?h:s++,f,o)}})},i}function ye(t,e,r){var n=Le().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function de(t,e,r){var n=d(t),i=(w(t)?Ir():Le()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=Ae(t);return i.map(function(e){return Oe(t,o(e))})}function me(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=h(e,i),s=f(r,i);if(o!==o||s!==s)return me(t.toSeq().cacheResult(),e,r,n);var c=s-o;0>c&&(c=0);var _=je(t); | ||
return _.size=0===c?c:t.size&&c||void 0,!n&&L(t)&&c>=0&&(_.get=function(e,r){return e=u(this,e),e>=0&&c>e?t.get(e+o,r):r}),_.__iterateUncached=function(e,r){var i=this;if(0===c)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++<o)?void 0:(a++,e(t,n?r:a-1,i)!==!1&&a!==c)}),a},_.__iteratorUncached=function(e,r){if(c&&r)return this.cacheResult().__iterator(e,r);var i=c&&t.__iterator(e,r),u=0,s=0;return new S(function(){for(;u++!==o;)i.next();if(++s>c)return I();var t=i.next();return n||e===mn?t:e===dn?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},_}function ge(t,e,r){var n=je(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(gn,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===gn?t:z(n,a,h,t):(s=!1,I())})},n}function we(t,e,r,n){var i=je(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(gn,o),a=!0,h=0;return new S(function(){var t,o,f;do{if(t=s.next(),t.done)return n||i===mn?t:i===dn?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var c=t.value;o=c[0],f=c[1],a&&(a=e.call(r,f,o,u))}while(a);return i===gn?t:z(i,o,f,t)})},i}function Se(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?W(t):B(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||m(t)&&m(i))return i}var o=new j(n);return r?o=o.toKeyedSeq():m(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size; | ||
if(void 0!==r)return t+r}},0),o}function ze(t,e,r){var n=je(t);return n.__iterateUncached=function(n,i){function o(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,h)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new S(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===gn&&(a=a[1]),e&&!(e>u.length)||!y(a))return r?t:z(n,s++,a,t);u.push(o),o=a.__iterator(n,i)}else o=u.pop()}return I()})},n}function Ie(t,e,r){var n=Ae(t);return t.toSeq().map(function(i,o){return n(e.call(r,i,o,t))}).flatten(!0)}function be(t,e){var r=je(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate(function(t){return(!o||r(e,o++,i)!==!1)&&r(t,o++,i)!==!1},n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(mn,n),u=0;return new S(function(){return(!i||u%2)&&(i=o.next(),i.done)?i:u%2?z(r,u++,e):z(r,u++,i.value,i)})},r}function qe(t,e,r){e||(e=Ue);var n=d(t),i=0,o=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return o.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?x(o):m(t)?k(o):A(o)}function De(t,e,r){if(e||(e=Ue),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return Me(e,t[1],r[1])?r:t});return n&&n[0]}return t.reduce(function(t,r){return Me(e,t,r)?r:t})}function Me(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(void 0===r||null===r||r!==r)||n>0}function Ee(t,e,r){var n=je(t);return n.size=new j(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(mn,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),D(n?t.reverse():t)}),o=0,u=!1;return new S(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?I():z(t,o++,e.apply(null,r.map(function(t){return t.value}))) | ||
})},n}function Oe(t,e){return L(t)?e:t.constructor(e)}function xe(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function ke(t){return se(t.size),o(t)}function Ae(t){return d(t)?p:m(t)?v:l}function je(t){return Object.create((d(t)?x:m(t)?k:A).prototype)}function Re(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Ue(t,e){return t>e?1:e>t?-1:0}function Ke(t){var e=D(t);if(!e){if(!E(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(t))}return e}function Le(t){return null===t||void 0===t?Qe():Te(t)?t:Qe().withMutations(function(e){var r=p(t);se(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Te(t){return!(!t||!t[Rn])}function We(t,e){this.ownerID=t,this.entries=e}function Be(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Ce(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Je(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Pe(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function He(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ve(t._root)}function Ne(t,e){return z(t,e[0],e[1])}function Ve(t,e){return{node:t,index:0,__prev:e}}function Ye(t,e,r,n){var i=Object.create(Un);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qe(){return Kn||(Kn=Ye(0))}function Xe(t,r,n){var i,o;if(t._root){var u=e(cn),s=e(_n);if(i=Fe(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===fn?-1:1:0)}else{if(n===fn)return t;o=1,i=new We(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Ye(o,i):Qe()}function Fe(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===fn?t:(r(a),r(s),new Pe(e,i,[o,u]))}function Ge(t){return t.constructor===Pe||t.constructor===Je}function Ze(t,e,r,n,i){if(t.keyHash===n)return new Je(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&hn,s=(0===r?n:n>>>r)&hn,a=u===s?[Ze(t,e,r+sn,n,i)]:(o=new Pe(e,n,i),s>u?[t,o]:[o,t]);return new Be(e,1<<u|1<<s,a) | ||
}function $e(t,e,r,i){t||(t=new n);for(var o=new Pe(t,ee(r),[r,i]),u=0;e.length>u;u++){var s=e[u];o=o.update(t,0,void 0,s[0],s[1])}return o}function tr(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,h=e.length;h>s;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Be(t,i,u)}function er(t,e,r,n,i){for(var o=0,u=Array(an),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Ce(t,o+1,u)}function rr(t,e,r){for(var n=[],i=0;r.length>i;i++){var o=r[i],u=p(o);y(o)||(u=u.map(function(t){return F(t)})),n.push(u)}return ir(t,e,n)}function nr(t){return function(e,r){return e&&e.mergeDeepWith&&y(r)?e.mergeDeepWith(t,r):t?t(e,r):r}}function ir(t,e,r){return r=r.filter(function(t){return 0!==t.size}),0===r.length?t:0===t.size&&1===r.length?t.constructor(r[0]):t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,fn,function(t){return t===fn?r:e(t,r)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function or(t,e,r,n){var i=t===fn,o=e.next();if(o.done){var u=i?r:t,s=n(u);return s===u?t:s}ue(i||t&&t.set,"invalid keyPath");var a=o.value,h=i?fn:t.get(a,fn),f=or(h,e,r,n);return f===h?t:f===fn?t.remove(a):(i?Qe():t).set(a,f)}function ur(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function sr(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ar(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function hr(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function fr(t){var e=lr();if(null===t||void 0===t)return e;if(cr(t))return t;var r=v(t),n=r.size;return 0===n?e:(se(n),n>0&&an>n?vr(0,n,sn,null,new _r(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function cr(t){return!(!t||!t[Bn])}function _r(t,e){this.array=t,this.ownerID=e}function pr(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r; | ||
return h>an&&(h=an),function(){if(i===h)return Pn;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,f=(u-i>>n)+1;return f>an&&(f=an),function(){for(;;){if(s){var t=s();if(t!==Pn)return t;s=null}if(h===f)return Pn;var o=e?--f:h++;s=r(a&&a[o],n-sn,i+(o<<n))}}}var o=t._origin,u=t._capacity,s=zr(u),a=t._tail;return r(t._root,t._level,0)}function vr(t,e,r,n,i,o,u){var s=Object.create(Cn);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function lr(){return Jn||(Jn=vr(0,0,sn))}function yr(t,r,n){if(r=u(t,r),r>=t.size||0>r)return t.withMutations(function(t){0>r?wr(t,r).set(0,n):wr(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(_n);return r>=zr(t._capacity)?i=dr(i,t.__ownerID,0,r,n,s):o=dr(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):vr(t._origin,t._capacity,t._level,o,i):t}function dr(t,e,n,i,o,u){var s=i>>>n&hn,a=t&&t.array.length>s;if(!a&&void 0===o)return t;var h;if(n>0){var f=t&&t.array[s],c=dr(f,e,n-sn,i,o,u);return c===f?t:(h=mr(t,e),h.array[s]=c,h)}return a&&t.array[s]===o?t:(r(u),h=mr(t,e),void 0===o&&s===h.array.length-1?h.array.pop():h.array[s]=o,h)}function mr(t,e){return e&&t&&e===t.ownerID?t:new _r(t?t.array.slice():[],e)}function gr(t,e){if(e>=zr(t._capacity))return t._tail;if(1<<t._level+sn>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&hn],n-=sn;return r}}function wr(t,e,r){var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,f=t._root,c=0;0>s+c;)f=new _r(f&&f.array.length?[void 0,f]:[],i),h+=sn,c+=1<<h;c&&(s+=c,o+=c,a+=c,u+=c);for(var _=zr(u),p=zr(a);p>=1<<h+sn;)f=new _r(f&&f.array.length?[f]:[],i),h+=sn;var v=t._tail,l=_>p?gr(t,a-1):p>_?new _r([],i):v;if(v&&p>_&&u>s&&v.array.length){f=mr(f,i);for(var y=f,d=h;d>sn;d-=sn){var m=_>>>d&hn;y=y.array[m]=mr(y.array[m],i)}y.array[_>>>sn&hn]=v}if(u>a&&(l=l&&l.removeAfter(i,0,a)),s>=p)s-=p,a-=p,h=sn,f=null,l=l&&l.removeBefore(i,0,s); | ||
else if(s>o||_>p){for(c=0;f;){var g=s>>>h&hn;if(g!==p>>>h&hn)break;g&&(c+=(1<<h)*g),h-=sn,f=f.array[g]}f&&s>o&&(f=f.removeBefore(i,h,s-c)),f&&_>p&&(f=f.removeAfter(i,h,p-c)),c&&(s-=c,a-=c)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=f,t._tail=l,t.__hash=void 0,t.__altered=!0,t):vr(s,a,h,f,l)}function Sr(t,e,r){for(var n=[],i=0,o=0;r.length>o;o++){var u=r[o],s=v(u);s.size>i&&(i=s.size),y(u)||(s=s.map(function(t){return F(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ir(t,e,n)}function zr(t){return an>t?0:t-1>>>sn<<sn}function Ir(t){return null===t||void 0===t?Dr():br(t)?t:Dr().withMutations(function(e){var r=p(t);se(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function br(t){return Te(t)&&w(t)}function qr(t,e,r,n){var i=Object.create(Ir.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function Dr(){return Hn||(Hn=qr(Qe(),lr()))}function Mr(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===fn){if(!a)return t;u.size>=an&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):qr(n,i)}function Er(t){return null===t||void 0===t?kr():Or(t)?t:kr().unshiftAll(t)}function Or(t){return!(!t||!t[Nn])}function xr(t,e,r,n){var i=Object.create(Vn);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function kr(){return Yn||(Yn=xr(0))}function Ar(t){return null===t||void 0===t?Kr():jr(t)?t:Kr().withMutations(function(e){var r=l(t);se(r.size),r.forEach(function(t){return e.add(t)})})}function jr(t){return!(!t||!t[Qn])}function Rr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ur(t,e){var r=Object.create(Xn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r | ||
}function Kr(){return Fn||(Fn=Ur(Qe()))}function Lr(t){return null===t||void 0===t?Br():Tr(t)?t:Br().withMutations(function(e){var r=l(t);se(r.size),r.forEach(function(t){return e.add(t)})})}function Tr(t){return jr(t)&&w(t)}function Wr(t,e){var r=Object.create(Gn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Br(){return Zn||(Zn=Wr(Dr()))}function Cr(t,e){var r=function(t){return this instanceof r?void(this._map=Le(t)):new r(t)},n=Object.keys(t),i=r.prototype=Object.create($n);i.constructor=r,e&&(i._name=e),i._defaultValues=t,i._keys=n,i.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){ue(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(o){}return r}function Jr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Pr(t){return t._name||t.constructor.name}function Hr(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||m(t)!==m(e)||w(t)!==w(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!g(t);if(w(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,fn)):X(t.get(n,fn),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Nr(t,e,r){if(!(this instanceof Nr))return new Nr(t,e,r);if(ue(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(ti)return ti;ti=this}}function Vr(t,e){if(!(this instanceof Vr))return new Vr(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(ei)return ei;ei=this}}function Yr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t | ||
}function Qr(t,e){return e}function Xr(t,e){return[e,t]}function Fr(t){return function(){return!t.apply(this,arguments)}}function Gr(t){return function(){return-t.apply(this,arguments)}}function Zr(t){return"string"==typeof t?JSON.stringify(t):t}function $r(){return i(arguments)}function tn(t,e){return e>t?1:t>e?-1:0}function en(t){if(1/0===t.size)return 0;var e=w(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+nn(ee(t),ee(e))|0}:function(t,e){n=n+nn(ee(t),ee(e))|0}:e?function(t){n=31*n+ee(t)|0}:function(t){n=n+ee(t)|0});return rn(i,n)}function rn(t,e){return e=qn(e,3432918353),e=qn(e<<15|e>>>-15,461845907),e=qn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=qn(e^e>>>16,2246822507),e=qn(e^e>>>13,3266489909),e=te(e^e>>>16)}function nn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var on=Array.prototype.slice,un="delete",sn=5,an=1<<sn,hn=an-1,fn={},cn={value:!1},_n={value:!1};t(p,_),t(v,_),t(l,_),_.isIterable=y,_.isKeyed=d,_.isIndexed=m,_.isAssociative=g,_.isOrdered=w,_.Keyed=p,_.Indexed=v,_.Set=l;var pn="@@__IMMUTABLE_ITERABLE__@@",vn="@@__IMMUTABLE_KEYED__@@",ln="@@__IMMUTABLE_INDEXED__@@",yn="@@__IMMUTABLE_ORDERED__@@",dn=0,mn=1,gn=2,wn="function"==typeof Symbol&&Symbol.iterator,Sn="@@iterator",zn=wn||Sn;S.prototype.toString=function(){return"[Iterator]"},S.KEYS=dn,S.VALUES=mn,S.ENTRIES=gn,S.prototype.inspect=S.prototype.toSource=function(){return""+this},S.prototype[zn]=function(){return this},t(O,_),O.of=function(){return O(arguments)},O.prototype.toSeq=function(){return this},O.prototype.toString=function(){return this.__toString("Seq {","}")},O.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},O.prototype.__iterate=function(t,e){return P(this,t,e,!0)},O.prototype.__iterator=function(t,e){return H(this,t,e,!0)},t(x,O),x.of=function(){return x(arguments)},x.prototype.toKeyedSeq=function(){return this},x.prototype.toSeq=function(){return this},t(k,O),k.of=function(){return k(arguments)},k.prototype.toIndexedSeq=function(){return this | ||
},k.prototype.toString=function(){return this.__toString("Seq [","]")},k.prototype.__iterate=function(t,e){return P(this,t,e,!1)},k.prototype.__iterator=function(t,e){return H(this,t,e,!1)},t(A,O),A.of=function(){return A(arguments)},A.prototype.toSetSeq=function(){return this},O.isSeq=L,O.Keyed=x,O.Set=A,O.Indexed=k;var In="@@__IMMUTABLE_SEQ__@@";O.prototype[In]=!0,t(j,k),j.prototype.get=function(t,e){return this.has(t)?this._array[u(this,t)]:e},j.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(R,x),R.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},R.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},R.prototype[yn]=!0,t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},U.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(K,k),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var o;!(o=r.next()).done;){var u=o.value;if(n[i]=u,t(u,i++,this)===!1)break}return i},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0; | ||
return new S(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var bn;t(N,_),t(V,N),t(Y,N),t(Q,N),N.Keyed=V,N.Indexed=Y,N.Set=Q;var qn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Dn=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Mn="function"==typeof WeakMap&&new WeakMap,En=0,On="__immutablehash__";"function"==typeof Symbol&&(On=Symbol(On));var xn=16,kn=255,An=0,jn={};t(ae,x),ae.prototype.get=function(t,e){return this._iter.get(t,e)},ae.prototype.has=function(t){return this._iter.has(t)},ae.prototype.valueSeq=function(){return this._iter.valueSeq()},ae.prototype.reverse=function(){var t=this,e=ve(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},ae.prototype.map=function(t,e){var r=this,n=pe(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},ae.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?ke(this):0,function(i){return t(i,e?--r:r++,n)}),e)},ae.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(mn,e),n=e?ke(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},ae.prototype[yn]=!0,t(he,k),he.prototype.contains=function(t){return this._iter.contains(t)},he.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},he.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e),n=0;return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})},t(fe,A),fe.prototype.has=function(t){return this._iter.contains(t)},fe.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},fe.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e); | ||
return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},t(ce,x),ce.prototype.entrySeq=function(){return this._iter.toSeq()},ce.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(xe(e),t(e[1],e[0],r)):void 0},e)},ce.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mn,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return xe(n),t===gn?e:z(t,n[0],n[1],e)}})},he.prototype.cacheResult=ae.prototype.cacheResult=fe.prototype.cacheResult=ce.prototype.cacheResult=Re,t(Le,V),Le.prototype.toString=function(){return this.__toString("Map {","}")},Le.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Le.prototype.set=function(t,e){return Xe(this,t,e)},Le.prototype.setIn=function(t,e){return this.updateIn(t,fn,function(){return e})},Le.prototype.remove=function(t){return Xe(this,t,fn)},Le.prototype.deleteIn=function(t){return this.updateIn(t,function(){return fn})},Le.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Le.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=or(this,Ke(t),e,r);return n===fn?void 0:n},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe()},Le.prototype.merge=function(){return rr(this,void 0,arguments)},Le.prototype.mergeWith=function(t){var e=on.call(arguments,1);return rr(this,t,e)},Le.prototype.mergeIn=function(t){var e=on.call(arguments,1);return this.updateIn(t,Qe(),function(t){return t.merge.apply(t,e)})},Le.prototype.mergeDeep=function(){return rr(this,nr(void 0),arguments)},Le.prototype.mergeDeepWith=function(t){var e=on.call(arguments,1);return rr(this,nr(t),e)},Le.prototype.mergeDeepIn=function(t){var e=on.call(arguments,1);return this.updateIn(t,Qe(),function(t){return t.mergeDeep.apply(t,e)})},Le.prototype.sort=function(t){return Ir(qe(this,t))},Le.prototype.sortBy=function(t,e){return Ir(qe(this,e,t))},Le.prototype.withMutations=function(t){var e=this.asMutable(); | ||
return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Le.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Le.prototype.asImmutable=function(){return this.__ensureOwner()},Le.prototype.wasAltered=function(){return this.__altered},Le.prototype.__iterator=function(t,e){return new He(this,t,e)},Le.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Le.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ye(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Le.isMap=Te;var Rn="@@__IMMUTABLE_MAP__@@",Un=Le.prototype;Un[Rn]=!0,Un[un]=Un.remove,Un.removeIn=Un.deleteIn,We.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},We.prototype.update=function(t,e,n,o,u,s,a){for(var h=u===fn,f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),!h||1!==f.length){if(!p&&!h&&f.length>=Ln)return $e(t,f,o,u);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new We(t,l)}},Be.prototype.get=function(t,e,r,n){void 0===e&&(e=ee(r));var i=1<<((0===t?e:e>>>t)&hn),o=this.bitmap;return 0===(o&i)?n:this.nodes[ur(o&i-1)].get(t+sn,e,r,n)},Be.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ee(n));var s=(0===e?r:r>>>e)&hn,a=1<<s,h=this.bitmap,f=0!==(h&a);if(!f&&i===fn)return this;var c=ur(h&a-1),_=this.nodes,p=f?_[c]:void 0,v=Fe(p,t,e+sn,r,n,i,o,u);if(v===p)return this;if(!f&&v&&_.length>=Tn)return er(t,_,h,s,v);if(f&&!v&&2===_.length&&Ge(_[1^c]))return _[1^c];if(f&&v&&1===_.length&&Ge(v))return v;var l=t&&t===this.ownerID,y=f?v?h:h^a:h|a,d=f?v?sr(_,c,v,l):hr(_,c,l):ar(_,c,v,l);return l?(this.bitmap=y,this.nodes=d,this):new Be(t,y,d)},Ce.prototype.get=function(t,e,r,n){void 0===e&&(e=ee(r));var i=(0===t?e:e>>>t)&hn,o=this.nodes[i];return o?o.get(t+sn,e,r,n):n},Ce.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ee(n)); | ||
var s=(0===e?r:r>>>e)&hn,a=i===fn,h=this.nodes,f=h[s];if(a&&!f)return this;var c=Fe(f,t,e+sn,r,n,i,o,u);if(c===f)return this;var _=this.count;if(f){if(!c&&(_--,Wn>_))return tr(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=sr(h,s,c,p);return p?(this.count=_,this.nodes=v,this):new Ce(t,_,v)},Je.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Je.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=ee(o));var h=u===fn;if(n!==this.keyHash)return h?this:(r(a),r(s),Ze(this,t,e,n,[o,u]));for(var f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),h&&2===_)return new Pe(t,this.keyHash,f[1^c]);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Je(t,this.keyHash,l)},Pe.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Pe.prototype.update=function(t,e,n,i,o,u,s){var a=o===fn,h=X(i,this.entry[0]);return(h?o===this.entry[1]:a)?this:(r(s),a?void r(u):h?t&&t===this.ownerID?(this.entry[1]=o,this):new Pe(t,this.keyHash,[i,o]):(r(u),Ze(this,t,e,ee(i),[i,o])))},We.prototype.iterate=Je.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Be.prototype.iterate=Ce.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Pe.prototype.iterate=function(t){return t(this.entry)},t(He,S),He.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Ne(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Ne(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Ne(t,o.entry);e=this._stack=Ve(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Kn,Ln=an/4,Tn=an/2,Wn=an/4;t(fr,Y),fr.of=function(){return this(arguments)},fr.prototype.toString=function(){return this.__toString("List [","]") | ||
},fr.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=gr(this,t);return r&&r.array[t&hn]},fr.prototype.set=function(t,e){return yr(this,t,e)},fr.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},fr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=sn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):lr()},fr.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){wr(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},fr.prototype.pop=function(){return wr(this,0,-1)},fr.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){wr(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},fr.prototype.shift=function(){return wr(this,1)},fr.prototype.merge=function(){return Sr(this,void 0,arguments)},fr.prototype.mergeWith=function(t){var e=on.call(arguments,1);return Sr(this,t,e)},fr.prototype.mergeDeep=function(){return Sr(this,nr(void 0),arguments)},fr.prototype.mergeDeepWith=function(t){var e=on.call(arguments,1);return Sr(this,nr(t),e)},fr.prototype.setSize=function(t){return wr(this,0,t)},fr.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:wr(this,h(t,r),f(e,r))},fr.prototype.__iterator=function(t,e){var r=0,n=pr(this,e);return new S(function(){var e=n();return e===Pn?I():z(t,r++,e)})},fr.prototype.__iterate=function(t,e){for(var r,n=0,i=pr(this,e);(r=i())!==Pn&&t(r,n++,this)!==!1;);return n},fr.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?vr(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},fr.isList=cr;var Bn="@@__IMMUTABLE_LIST__@@",Cn=fr.prototype;Cn[Bn]=!0,Cn[un]=Cn.remove,Cn.setIn=Un.setIn,Cn.deleteIn=Cn.removeIn=Un.removeIn,Cn.update=Un.update,Cn.updateIn=Un.updateIn,Cn.mergeIn=Un.mergeIn,Cn.mergeDeepIn=Un.mergeDeepIn,Cn.withMutations=Un.withMutations,Cn.asMutable=Un.asMutable,Cn.asImmutable=Un.asImmutable,Cn.wasAltered=Un.wasAltered,_r.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this; | ||
var n=r>>>e&hn;if(n>=this.array.length)return new _r([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-sn,r),i===u&&o)return this}if(o&&!i)return this;var s=mr(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_r.prototype.removeAfter=function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&hn;if(n>=this.array.length)return this;var i,o=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-sn,r),i===u&&o)return this}if(o&&!i)return this;var s=mr(this,t);return o||s.array.pop(),i&&(s.array[n]=i),s};var Jn,Pn={};t(Ir,Le),Ir.of=function(){return this(arguments)},Ir.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ir.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ir.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Dr()},Ir.prototype.set=function(t,e){return Mr(this,t,e)},Ir.prototype.remove=function(t){return Mr(this,t,fn)},Ir.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ir.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ir.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ir.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?qr(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ir.isOrderedMap=br,Ir.prototype[yn]=!0,Ir.prototype[un]=Ir.prototype.remove;var Hn;t(Er,Y),Er.of=function(){return this(arguments)},Er.prototype.toString=function(){return this.__toString("Stack [","]")},Er.prototype.get=function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},Er.prototype.peek=function(){return this._head&&this._head.value},Er.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e}; | ||
return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):xr(t,e)},Er.prototype.pushAll=function(t){if(t=v(t),0===t.size)return this;se(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):xr(e,r)},Er.prototype.pop=function(){return this.slice(1)},Er.prototype.unshift=function(){return this.push.apply(this,arguments)},Er.prototype.unshiftAll=function(t){return this.pushAll(t)},Er.prototype.shift=function(){return this.pop.apply(this,arguments)},Er.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):kr()},Er.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=h(t,this.size),n=f(e,this.size);if(n!==this.size)return Y.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):xr(i,o)},Er.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?xr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Er.prototype.__iterate=function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Er.prototype.__iterator=function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Er.isStack=Or;var Nn="@@__IMMUTABLE_STACK__@@",Vn=Er.prototype;Vn[Nn]=!0,Vn.withMutations=Un.withMutations,Vn.asMutable=Un.asMutable,Vn.asImmutable=Un.asImmutable,Vn.wasAltered=Un.wasAltered;var Yn;t(Ar,Q),Ar.of=function(){return this(arguments)},Ar.fromKeys=function(t){return this(p(t).keySeq())},Ar.prototype.toString=function(){return this.__toString("Set {","}")},Ar.prototype.has=function(t){return this._map.has(t)},Ar.prototype.add=function(t){return Rr(this,this._map.set(t,!0)) | ||
},Ar.prototype.remove=function(t){return Rr(this,this._map.remove(t))},Ar.prototype.clear=function(){return Rr(this,this._map.clear())},Ar.prototype.union=function(){var t=on.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var r=0;t.length>r;r++)l(t[r]).forEach(function(t){return e.add(t)})})},Ar.prototype.intersect=function(){var t=on.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.every(function(t){return t.contains(e)})||r.remove(e)})})},Ar.prototype.subtract=function(){var t=on.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.some(function(t){return t.contains(e)})&&r.remove(e)})})},Ar.prototype.merge=function(){return this.union.apply(this,arguments)},Ar.prototype.mergeWith=function(){var t=on.call(arguments,1);return this.union.apply(this,t)},Ar.prototype.sort=function(t){return Lr(qe(this,t))},Ar.prototype.sortBy=function(t,e){return Lr(qe(this,e,t))},Ar.prototype.wasAltered=function(){return this._map.wasAltered()},Ar.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},Ar.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Ar.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Ar.isSet=jr;var Qn="@@__IMMUTABLE_SET__@@",Xn=Ar.prototype;Xn[Qn]=!0,Xn[un]=Xn.remove,Xn.mergeDeep=Xn.merge,Xn.mergeDeepWith=Xn.mergeWith,Xn.withMutations=Un.withMutations,Xn.asMutable=Un.asMutable,Xn.asImmutable=Un.asImmutable,Xn.__empty=Kr,Xn.__make=Ur;var Fn;t(Lr,Ar),Lr.of=function(){return this(arguments)},Lr.fromKeys=function(t){return this(p(t).keySeq())},Lr.prototype.toString=function(){return this.__toString("OrderedSet {","}") | ||
},Lr.isOrderedSet=Tr;var Gn=Lr.prototype;Gn[yn]=!0,Gn.__empty=Br,Gn.__make=Wr;var Zn;t(Cr,V),Cr.prototype.toString=function(){return this.__toString(Pr(this)+" {","}")},Cr.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Cr.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},Cr.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=Jr(this,Qe()))},Cr.prototype.set=function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+Pr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:Jr(this,r)},Cr.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Jr(this,e)},Cr.prototype.wasAltered=function(){return this._map.wasAltered()},Cr.prototype.__iterator=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Cr.prototype.__iterate=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Cr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Jr(this,e,t):(this.__ownerID=t,this._map=e,this)};var $n=Cr.prototype;$n[un]=$n.remove,$n.deleteIn=$n.removeIn=Un.removeIn,$n.merge=Un.merge,$n.mergeWith=Un.mergeWith,$n.mergeIn=Un.mergeIn,$n.mergeDeep=Un.mergeDeep,$n.mergeDeepWith=Un.mergeDeepWith,$n.mergeDeepIn=Un.mergeDeepIn,$n.setIn=Un.setIn,$n.update=Un.update,$n.updateIn=Un.updateIn,$n.withMutations=Un.withMutations,$n.asMutable=Un.asMutable,$n.asImmutable=Un.asImmutable,t(Nr,k),Nr.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Nr.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Nr.prototype.contains=function(t){var e=(t-this._start)/this._step; | ||
return e>=0&&this.size>e&&e===Math.floor(e)},Nr.prototype.slice=function(t,e){return a(t,e,this.size)?this:(t=h(t,this.size),e=f(e,this.size),t>=e?new Nr(0,0):new Nr(this.get(t,this._end),this.get(e,this._end),this._step))},Nr.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},Nr.prototype.lastIndexOf=function(t){return this.indexOf(t)},Nr.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;r>=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Nr.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},Nr.prototype.equals=function(t){return t instanceof Nr?this._start===t._start&&this._end===t._end&&this._step===t._step:Hr(this,t)};var ti;t(Vr,k),Vr.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Vr.prototype.get=function(t,e){return this.has(t)?this._value:e},Vr.prototype.contains=function(t){return X(this._value,t)},Vr.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Vr(this._value,f(e,r)-h(t,r))},Vr.prototype.reverse=function(){return this},Vr.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Vr.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Vr.prototype.__iterate=function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},Vr.prototype.__iterator=function(t){var e=this,r=0;return new S(function(){return e.size>r?z(t,r++,e._value):I()})},Vr.prototype.equals=function(t){return t instanceof Vr?X(this._value,t._value):Hr(t)};var ei;_.Iterator=S,Yr(_,{toArray:function(){se(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new he(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS() | ||
},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new ae(this,!0)},toMap:function(){return Le(this.toKeyedSeq())},toObject:function(){se(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Ir(this.toKeyedSeq())},toOrderedSet:function(){return Lr(d(this)?this.valueSeq():this)},toSet:function(){return Ar(d(this)?this.valueSeq():this)},toSetSeq:function(){return new fe(this)},toSeq:function(){return m(this)?this.toIndexedSeq():d(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Er(d(this)?this.valueSeq():this)},toList:function(){return fr(d(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=on.call(arguments,0);return Oe(this,Se(this,t))},contains:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(gn)},every:function(t,e){se(this.size);var r=!0;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Oe(this,le(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},findEntry:function(t,e){var r;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?(r=[i,n],!1):void 0}),r},findLastEntry:function(t,e){return this.toSeq().reverse().findEntry(t,e)},forEach:function(t,e){return se(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){se(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(dn)},map:function(t,e){return Oe(this,pe(this,t,e))},reduce:function(t,e,r){se(this.size);var n,i;return arguments.length<2?i=!0:n=e,this.__iterate(function(e,o,u){i?(i=!1,n=e):n=t.call(r,n,e,o,u)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments) | ||
},reverse:function(){return Oe(this,ve(this,!0))},slice:function(t,e){return Oe(this,me(this,t,e,!0))},some:function(t,e){return!this.every(Fr(t),e)},sort:function(t){return Oe(this,qe(this,t))},values:function(){return this.__iterator(mn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return o(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return ye(this,t,e)},equals:function(t){return Hr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new j(t._cache);var e=t.toSeq().map(Xr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Fr(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(s)},flatMap:function(t,e){return Oe(this,Ie(this,t,e))},flatten:function(t){return Oe(this,ze(this,t,!0))},fromEntrySeq:function(){return new ce(this)},get:function(t,e){return this.find(function(e,r){return X(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,i=Ke(t);!(r=i.next()).done;){var o=r.value;if(n=n&&n.get?n.get(o,fn):fn,n===fn)return e}return n},groupBy:function(t,e){return de(this,t,e)},has:function(t){return this.get(t,fn)!==fn},hasIn:function(t){return this.getIn(t,fn)!==fn},isSubset:function(t){return t="function"==typeof t.contains?t:_(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(Qr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return De(this,t)},maxBy:function(t,e){return De(this,e,t)},min:function(t){return De(this,t?Gr(t):tn)},minBy:function(t,e){return De(this,e?Gr(e):tn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Oe(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Oe(this,we(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Fr(t),e) | ||
},sortBy:function(t,e){return Oe(this,qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Oe(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Oe(this,ge(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Fr(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=en(this))}});var ri=_.prototype;ri[pn]=!0,ri[zn]=ri.values,ri.__toJS=ri.toArray,ri.__toStringMapper=Zr,ri.inspect=ri.toSource=function(){return""+this},ri.chain=ri.flatMap,function(){try{Object.defineProperty(ri,"length",{get:function(){if(!_.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),Yr(p,{flip:function(){return Oe(this,_e(this))},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},lastKeyOf:function(t){return this.findLastKey(function(e){return X(e,t)})},mapEntries:function(t,e){var r=this,n=0;return Oe(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Oe(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}});var ni=p.prototype;ni[vn]=!0,ni[zn]=ri.entries,ni.__toJS=ri.toObject,ni.__toStringMapper=function(t,e){return e+": "+Zr(t)},Yr(v,{toKeyedSeq:function(){return new ae(this,!1)},filter:function(t,e){return Oe(this,le(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){return this.toSeq().reverse().indexOf(t)},reverse:function(){return Oe(this,ve(this,!1))},slice:function(t,e){return Oe(this,me(this,t,e,!1)) | ||
},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=h(t,this.size);var n=this.slice(0,t);return Oe(this,1===r?n:n.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Oe(this,ze(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return Oe(this,be(this,t))},interleave:function(){var t=[this].concat(i(arguments)),e=Ee(this.toSeq(),k.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Oe(this,r)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Oe(this,we(this,t,e,!1))},zip:function(){var t=[this].concat(i(arguments));return Oe(this,Ee(this,$r,t))},zipWith:function(t){var e=i(arguments);return e[0]=this,Oe(this,Ee(this,t,e))}}),v.prototype[ln]=!0,v.prototype[yn]=!0,Yr(l,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),l.prototype.has=ri.contains,Yr(x,p.prototype),Yr(k,v.prototype),Yr(A,l.prototype),Yr(V,p.prototype),Yr(Y,v.prototype),Yr(Q,l.prototype);var ii={Iterable:_,Seq:O,Collection:N,Map:Le,OrderedMap:Ir,List:fr,Stack:Er,Set:Ar,OrderedSet:Lr,Record:Cr,Range:Nr,Repeat:Vr,is:X,fromJS:F};return ii}); |
{ | ||
"name": "immutable", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"description": "Immutable Data Collections", | ||
@@ -31,3 +31,3 @@ "homepage": "https://github.com/facebook/immutable-js", | ||
"acorn": "^0.11.0", | ||
"esperanto": "^0.5.8", | ||
"esperanto": "^0.6.0", | ||
"estraverse": "^1.9.1", | ||
@@ -34,0 +34,0 @@ "grunt": "^0.4.5", |
@@ -41,3 +41,6 @@ Immutable collections for JavaScript | ||
var Immutable = require('immutable'); | ||
var map = Immutable.Map({a:1, b:2, c:3}); | ||
var map1 = Immutable.Map({a:1, b:2, c:3}); | ||
var map2 = map1.set('b', 50); | ||
map1.get('b'); // 2 | ||
map2.get('b'); // 50 | ||
``` | ||
@@ -56,5 +59,6 @@ | ||
<script> | ||
var map = Immutable.Map({a:1, b:2, c:3}); | ||
map = map.set('b', 20); | ||
map.get('b'); // 20 | ||
var map1 = Immutable.Map({a:1, b:2, c:3}); | ||
var map2 = map1.set('b', 50); | ||
map1.get('b'); // 2 | ||
map2.get('b'); // 50 | ||
</script> | ||
@@ -67,5 +71,6 @@ ``` | ||
require(['./immutable.min.js'], function (Immutable) { | ||
var map = Immutable.Map({a:1, b:2, c:3}); | ||
map = map.set('b', 20); | ||
map.get('b'); // 20 | ||
var map1 = Immutable.Map({a:1, b:2, c:3}); | ||
var map2 = map1.set('b', 50); | ||
map1.get('b'); // 2 | ||
map2.get('b'); // 50 | ||
}); | ||
@@ -89,6 +94,7 @@ ``` | ||
import Immutable = require('immutable'); | ||
var map: Immutable.Map<string, number>; | ||
map = Immutable.Map({a:1, b:2, c:3}); | ||
map = map.set('b', 20); | ||
map.get('b'); // 20 | ||
var map1: Immutable.Map<string, number>; | ||
map1 = Immutable.Map({a:1, b:2, c:3}); | ||
var map2 = map1.set('b', 20); | ||
map1.get('b'); // 2 | ||
map2.get('b'); // 50 | ||
``` | ||
@@ -125,2 +131,4 @@ | ||
assert(map1 === map2); | ||
var map3 = map1.set('b', 50); | ||
assert(map1 !== map3); | ||
``` | ||
@@ -127,0 +135,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
317970
7142
425