Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

immutable

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immutable - npm Package Compare versions

Comparing version 2.1.0 to 2.2.1

170

dist/Immutable.d.ts

@@ -241,2 +241,25 @@ /**

/**
* Returns a new Sequence identical to this one, but does not behave as
* indexed. Instead the indices are treated as keys. This is useful if you
* want to operate on an IndexedSequence and preserve the index, value
* pairs.
*
* This is the generalized (and lazy) form of converting a Vector to Map.
*
* The returned Sequence will have identical iteration order as
* this Sequence.
*
* For already Keyed sequences, simply returns itself.
*
* Example:
*
* var indexedSeq = Immutable.Sequence('A', 'B', 'C');
* indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ]
* var keyedSeq = indexedSeq.toKeyedSeq();
* keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' }
*
*/
toKeyedSeq(): Sequence<K, V>;
/**
* True if this and the other sequence have value equality, as defined

@@ -290,3 +313,3 @@ * by `Immutable.is()`.

* `false`, the iteration will stop. Returns the length of the sequence which
* was iterated.
* was iterated (including the last iteration which returned false).
*/

@@ -456,2 +479,16 @@ forEach(

/**
* Returns a new sequence with entries ([key, value] tuples) passed through
* a `mapper` function.
*
* Sequence({ a: 1, b: 2 })
* .mapEntries(([k, v]) => [k.toUpperCase(), v * 2])
* // { A: 2, B: 4 }
*
*/
mapEntries<KM, VM>(
mapper: (entry?: /*(K, V)*/Array<any>, index?: number, seq?: Sequence<K, V>) => /*(KM, VM)*/Array<any>,
thisArg?: any
): Sequence<KM, VM>;
/**
* Returns a new sequence with only the entries for which the `predicate`

@@ -567,6 +604,6 @@ * function returns true.

/**
* Returns a `Map` of counts, grouped by the return value of the
* Returns a `Sequence` of counts, grouped by the return value of the
* `grouper` function.
*
* Note: Because this returns a Map, this method is not lazy.
* Note: This is not a lazy operation.
*/

@@ -576,9 +613,9 @@ countBy<G>(

thisArg?: any
): Map<G, number>;
): Sequence<G, number>;
/**
* Returns a `Map` of sequences, grouped by the return value of the
* Returns a `Sequence` of `Sequences`, grouped by the return value of the
* `grouper` function.
*
* Note: Because this returns a Map, this method is not lazy.
* Note: This is not a lazy operation.
*/

@@ -588,3 +625,3 @@ groupBy<G>(

thisArg?: any
): Map<G, Sequence<K, V>>;
): Sequence<G, Sequence<K, V>>;

@@ -628,4 +665,10 @@ sort(comparator?: (valueA: V, valueB: V) => number): Sequence<K, V>;

*
* Like JavaScript arrays, `IndexedSequence`s may be sparse, skipping over some
* indices and may have a length larger than the highest index.
* Unlike JavaScript arrays, `IndexedSequence`s are always dense. "Unset"
* indices and `undefined` indices are indistinguishable, and all indices from
* 0 to `length` are visited when iterated.
*
* All IndexedSequence methods return re-indexed Sequences. In other words,
* indices always start at 0 and increment until length. If you wish to
* preserve indices, using them as keys, use `toKeyedSeq()`.
*
*/

@@ -686,16 +729,2 @@

/**
* When IndexedSequence is converted to an array, the index keys are
* maintained. This differs from the behavior of Sequence which
* simply makes a dense array of all values.
* @override
*/
toArray(): Array<T>;
/**
* This has the same altered behavior as `toArray`.
* @override
*/
toVector(): Vector<T>;
/**
* Returns the value associated with the provided index, or notSetValue if

@@ -717,14 +746,10 @@ * the index is beyond the bounds of the sequence.

/**
* This new behavior will not only iterate through the sequence in reverse,
* but it will also reverse the indices so the last value will report being
* at index 0. If you wish to preserve the original indices, set
* maintainIndices to true.
* Returns a new IndexedSequence with this sequences values in the
* reversed order.
* @override
*/
reverse(maintainIndices?: boolean): IndexedSequence<T>;
reverse(): IndexedSequence<T>;
/**
* Indexed sequences have a different `filter` behavior, where the filtered
* values have new indicies incrementing from 0. If you want to preserve the
* original indicies, set maintainIndices to true.
* Returns IndexedSequence.
* @override

@@ -734,11 +759,10 @@ */

predicate: (value?: T, index?: number, seq?: IndexedSequence<T>) => boolean,
thisArg?: any,
maintainIndices?: boolean
thisArg?: any
): IndexedSequence<T>;
/**
* Adds the ability to maintain original indices.
* Returns IndexedSequence.
* @override
*/
slice(start: number, end?: number, maintainIndices?: boolean): IndexedSequence<T>;
slice(begin?: number, end?: number): IndexedSequence<T>;

@@ -767,9 +791,9 @@

/**
* Has the same altered behavior as `takeWhile`.
* Returns IndexedSequence
* @override
*/
takeLast(amount: number, maintainIndices?: boolean): IndexedSequence<T>;
takeLast(amount: number): IndexedSequence<T>;
/**
* Has the same altered behavior as `takeWhile`.
* Returns IndexedSequence
* @override

@@ -779,22 +803,19 @@ */

predicate: (value?: T, index?: number, seq?: IndexedSequence<T>) => boolean,
thisArg?: any,
maintainIndices?: boolean
thisArg?: any
): IndexedSequence<T>;
/**
* Has the same altered behavior as `skipWhile`.
* Returns IndexedSequence
* @override
*/
skip(amount: number, maintainIndices?: boolean): IndexedSequence<T>;
skip(amount: number): IndexedSequence<T>;
/**
* Has the same altered behavior as `skipWhile`.
* Returns IndexedSequence
* @override
*/
skipLast(amount: number, maintainIndices?: boolean): IndexedSequence<T>;
skipLast(amount: number): IndexedSequence<T>;
/**
* Indexed sequences have a different `skipWhile` behavior. The first
* non-skipped value will have an index of 0. If you want to preserve the
* original indicies, set maintainIndices to true.
* Returns IndexedSequence
* @override

@@ -804,8 +825,7 @@ */

predicate: (value?: T, index?: number, seq?: IndexedSequence<T>) => boolean,
thisArg?: any,
maintainIndices?: boolean
thisArg?: any
): IndexedSequence<T>;
/**
* Has the same altered behavior as `skipWhile`.
* Returns IndexedSequence
* @override

@@ -815,10 +835,7 @@ */

predicate: (value?: T, index?: number, seq?: IndexedSequence<T>) => boolean,
thisArg?: any,
maintainIndices?: boolean
thisArg?: any
): IndexedSequence<T>;
/**
* Indexed sequences have a different `groupBy` behavior. Each group will be
* a new indexed sequence starting with an index of 0. If you want to preserve
* the original indicies, set maintainIndices to true.
* Returns Sequence<G, IndexedSequence<T>>
* @override

@@ -828,19 +845,22 @@ */

grouper: (value?: T, index?: number, seq?: IndexedSequence<T>) => G,
thisArg?: any,
maintainIndices?: boolean
): Map<G, any/*IndexedSequence<T>*/>; // Bug: exposing this causes the type checker to implode.
thisArg?: any
): Sequence<G, any/*IndexedSequence<T>*/>; // Bug: exposing this causes the type checker to implode.
/**
* Returns an IndexedSequence
* @override
*/
sort(
comparator?: (valueA: T, valueB: T) => number,
maintainIndices?: boolean
comparator?: (valueA: T, valueB: T) => number
): IndexedSequence<T>;
/**
* Returns an IndexedSequence
* @override
*/
sortBy<S>(
sortValueMapper: (value?: T, index?: number, seq?: IndexedSequence<T>) => S,
comparator?: (valueA: S, valueB: S) => number,
maintainIndices?: boolean
comparator?: (valueA: S, valueB: S) => number
): IndexedSequence<T>;
/**

@@ -1371,8 +1391,6 @@ * Returns an IndexedSequence

*
* Vectors are like a Map with numeric keys which always iterate in the order
* of their keys. They may be sparse: if an index has not been set, it will not
* be iterated over. Also, via `setBounds` (or `fromArray` with a sparse array),
* a Vector may have a length higher than the highest index.
*
* @see: [MDN: Array relationship between length and numeric properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Relationship_between_length_and_numerical_properties_2).
* Vectors are ordered indexed dense collections, much like a JavaScript
* Array. Unlike a JavaScript Array, there is no distinction between an
* "unset" index and an index set to `undefined`. `Vector#forEach` visits all
* indices from 0 to length, regardless of if they are defined.
*/

@@ -1423,3 +1441,3 @@

* Returns a new Vector which excludes this `index`. It will not affect the
* length of the Vector, instead leaving a sparse hole.
* length of the Vector, instead leaving an undefined value.
*

@@ -1443,3 +1461,3 @@ * `index` may be a negative number, which indexes back from the end of the

*/
keys(sparse?: boolean): Iterator<number>;
keys(): Iterator<number>;

@@ -1449,10 +1467,8 @@ /**

*/
values(sparse?: boolean): Iterator<T>;
values(): Iterator<T>;
/**
* An iterator of this Vector's entries as [key, value] tuples.
*
* `sparse` defaults to true for entries.
*/
entries(sparse?: boolean): Iterator</*[number, T]*/Array<any>>;
entries(): Iterator</*[number, T]*/Array<any>>;

@@ -1575,3 +1591,3 @@ /**

* If `length` is greater than this Vector's length, the new Vector will have
* unset sparse holes for the newly available indices.
* undefined values for the newly available indices.
*/

@@ -1578,0 +1594,0 @@ setLength(length: number): Vector<T>;

@@ -9,21 +9,21 @@ /**

*/
function t(){function t(t,e,n,r){var i;if(r){var u=r.prototype;i=me.create(u)}else i=t.prototype;return me.keys(e).forEach(function(t){i[t]=e[t]}),me.keys(n).forEach(function(e){t[e]=n[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,n,r){return me.getPrototypeOf(e)[n].apply(t,r)}function n(t,n,r){e(t,n,"constructor",r)}function r(t){return t.value=!1,t}function i(t){t&&(t.value=!0)}function u(){}function s(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function a(t){return be.value=t,be.done=!1,be}function h(){return be.value=void 0,be.done=!0,be}function o(t,e){if(!t)throw Error(e)}function c(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Oe;t=""+t,e="string"}return"string"===e?t.length>Ee?f(t):l(t):t.hashCode?c("function"==typeof t.hashCode?t.hashCode():t.hashCode):_(t)}function f(t){var e=Ue[t];return null==e&&(e=l(t),Re===je&&(Re=0,Ue={}),Re++,Ue[t]=e),e}function l(t){for(var e=0,n=0;t.length>n;n++)e=31*e+t.charCodeAt(n)&Oe;return e}function _(t){if(t[xe])return t[xe];var e=++Ae&Oe;if(!Ce)try{return Object.defineProperty(t,xe,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}catch(n){Ce=!0}return t[xe]=e,e}function v(){return Object.create(Je)}function g(t){var e=Object.create(Le);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function p(t,e,n,r){var i=t.get?t.get(e[r],Ie):Ie;return i===Ie?n:++r===e.length?i:p(i,e,n,r)}function m(t,e,n){return(0===t||null!=n&&-n>=t)&&(null==e||null!=n&&e>=n)}function d(t,e){return w(t,e,0)}function y(t,e){return w(t,e,e)}function w(t,e,n){return null==t?n:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function S(t){return t}function I(t,e){return[e,t]}function k(){return!0}function M(){return this}function b(t){return(t||0)+1}function D(t,e,n,r,i){var u=t.__makeSequence();return u.__iterateUncached=function(u,s,a){var h=this,o=0,c=t.__iterate(function(t,i,s){if(e.call(n,t,i,s)){if(u(t,r?i:o,h)===!1)return!1;o++}},s,a);return i?c:o},u}function q(t){return function(){return!t.apply(this,arguments)
}}function O(t){return"string"==typeof t?JSON.stringify(t):t}function A(t,e){return t>e?1:e>t?-1:0}function x(t,e){return 0>e?(null==t.length&&t.cacheResult(),t.length+e):e}function C(t){o(1/0!==t,"Cannot perform this action with an infinite sequence.")}function E(t,e){var n=new Ne;return n.next=function(){var n=t.next();return n.done?n:(n.value=e(n.value),n)},n}function j(t,e,n){return n instanceof We?R(t,e,n):n}function R(t,e,n){return new Ge(t._rootData,t._keyPath.concat(e),t._onChange,n)}function U(t,e,n){var r=t._rootData.updateIn(t._keyPath,n?He.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,r,t._rootData,n?i.concat(n):i),new Ge(r,t._keyPath,t._onChange)}function W(t,e){return t instanceof Ge&&(t=t.deref()),e instanceof Ge&&(e=e.deref()),t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof We?t.equals(e):!1}function P(t,e){return a(0===t||1===t?e[t]:[e[0],e[1]])}function J(t,e){return{node:t,index:0,__prev:e}}function z(t,e,n,r){var i=Object.create(Te);return i.length=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function B(t,e,n){var i=r(ke),u=r(Me),s=L(t._root,t.__ownerID,0,c(e),e,n,i,u);if(!u.value)return t;var a=t.length+(i.value?n===Ie?-1:1:0);return t.__ownerID?(t.length=a,t._root=s,t.__hash=void 0,t.__altered=!0,t):s?z(a,s):He.empty()}function L(t,e,n,r,u,s,a,h){return t?t.update(e,n,r,u,s,a,h):s===Ie?t:(i(h),i(a),new nn(e,r,[u,s]))}function V(t){return t.constructor===nn||t.constructor===tn}function K(t,e,n,r,i){if(t.hash===r)return new tn(e,r,[t.entry,i]);var u,s=(0===n?t.hash:t.hash>>>n)&Se,a=(0===n?r:r>>>n)&Se,h=s===a?[K(t,e,n+ye,r,i)]:(u=new nn(e,r,i),a>s?[t,u]:[u,t]);return new Xe(e,1<<s|1<<a,h)}function N(t,e,n,r){for(var i=0,u=0,s=Array(n),a=0,h=1,o=e.length;o>a;a++,h<<=1){var c=e[a];null!=c&&a!==r&&(i|=h,s[u++]=c)}return new Xe(t,i,s)}function F(t,e,n,r,i){for(var u=0,s=Array(we),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[u++]:null;return s[r]=i,new Ze(t,u+1,s)}function G(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Array.isArray(u)?We(u).fromEntrySeq():We(u))
}return Q(t,e,r)}function H(t){return function(e,n){return e&&e.mergeDeepWith?e.mergeDeepWith(t,n):t?t(e,n):n}}function Q(t,e,n){return 0===n.length?t:t.withMutations(function(t){for(var r=e?function(n,r){var i=t.get(r,Ie);t.set(r,i===Ie?n:e(i,n))}:function(e,n){t.set(n,e)},i=0;n.length>i;i++)n[i].forEach(r)})}function T(t,e,n,r,i){var u=e.length;if(i===u)return r(t);o(t.set,"updateIn with invalid keyPath");var s=i===u-1?n:He.empty(),a=e[i],h=t.get(a,s),c=T(h,e,n,r,i+1);return c===h?t:t.set(a,c)}function X(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 Y(t,e,n,r){var i=r?t:s(t);return i[e]=n,i}function Z(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var u=Array(i),s=0,a=0;i>a;a++)a===e?(u[a]=n,s=-1):u[a]=t[a+s];return u}function $(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=Array(r),u=0,s=0;r>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function te(t,e,n,r,i,u){var s,a=t&&t.array;if(0===e){var h=0>n?0:n,o=n+we;for(o>r&&(o=r),s=h;o>s;s++){var c=u?h+o-1-s:s;if(i(a&&a[c-n],c)===!1)return!1}}else{var f=1<<e,l=e-ye;for(s=0;Se>=s;s++){var _=u?Se-s:s,v=n+(_<<e);if(r>v&&v+f>0){var g=a&&a[_];if(!te(g,l,v,r,i,u))return!1}}}return!0}function ee(t,e,n,r,i){return{array:t,level:e,offset:n,max:r,rawMax:r-n>>e,index:0,__prev:i}}function ne(t,e,n,r,i,u,s){var a=Object.create(fn);return a.length=e-t,a._origin=t,a._size=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=u,a.__hash=s,a.__altered=!1,a}function re(t,e,n){if(e=x(t,e),e>=t.length||0>e)return n===Ie?t:t.withMutations(function(t){0>e?ae(t,e).set(0,n):ae(t,0,e+1).set(e,n)});e+=t._origin;var i=t._tail,u=t._root,s=r(Me);return e>=oe(t._size)?i=ie(i,t.__ownerID,0,e,n,s):u=ie(u,t.__ownerID,t._level,e,n,s),s.value?t.__ownerID?(t._root=u,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ne(t._origin,t._size,t._level,u,i):t}function ie(t,e,n,r,u,s){var a,h=u===Ie,o=r>>>n&Se,c=t&&t.array.length>o;if(h&&!c)return t;if(n>0){var f=t&&t.array[o],l=ie(f,e,n-ye,r,u,s);return l===f?t:(a=ue(t,e),a.array[o]=l,a)
}return!h&&c&&t.array[o]===u?t:(i(s),a=ue(t,e),h&&o===a.array.length-1?a.array.pop():a.array[o]=h?void 0:u,a)}function ue(t,e){return e&&t&&e===t.ownerID?t:new ln(t?t.array.slice():[],e)}function se(t,e){if(e>=oe(t._size))return t._tail;if(1<<t._level+ye>e){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&Se],r-=ye;return n}}function ae(t,e,n){var r=t.__ownerID||new u,i=t._origin,s=t._size,a=i+e,h=null==n?s:0>n?s+n:i+n;if(a===i&&h===s)return t;if(a>=h)return t.clear();for(var o=t._level,c=t._root,f=0;0>a+f;)c=new ln(c&&c.array.length?[null,c]:[],r),o+=ye,f+=1<<o;f&&(a+=f,i+=f,h+=f,s+=f);for(var l=oe(s),_=oe(h);_>=1<<o+ye;)c=new ln(c&&c.array.length?[c]:[],r),o+=ye;var v=t._tail,g=l>_?se(t,h-1):_>l?new ln([],r):v;if(v&&_>l&&s>a&&v.array.length){c=ue(c,r);for(var p=c,m=o;m>ye;m-=ye){var d=l>>>m&Se;p=p.array[d]=ue(p.array[d],r)}p.array[l>>>ye&Se]=v}if(s>h&&(g=g&&g.removeAfter(r,0,h)),a>=_)a-=_,h-=_,o=ye,c=null,g=g&&g.removeBefore(r,0,a);else if(a>i||l>_){var y,w;f=0;do y=a>>>o&Se,w=_-1>>>o&Se,y===w&&(y&&(f+=(1<<o)*y),o-=ye,c=c&&c.array[y]);while(c&&y===w);c&&a>i&&(c=c&&c.removeBefore(r,o,a-f)),c&&l>_&&(c=c&&c.removeAfter(r,o,_-f)),f&&(a-=f,h-=f)}return t.__ownerID?(t.length=h-a,t._origin=a,t._size=h,t._level=o,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):ne(a,h,o,c,g)}function he(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(We(u))}var s=Math.max.apply(null,r.map(function(t){return t.length||0}));return s>t.length&&(t=t.setLength(s)),Q(t,e,r)}function oe(t){return we>t?0:t-1>>>ye<<ye}function ce(t,e){var n=Object.create(dn);return n.length=t?t.length:0,n._map=t,n.__ownerID=e,n}function fe(t,e,n,r){var i=Object.create(wn.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=n,i.__hash=r,i}function le(t,e,n){var r=t._map,i=t._vector,u=r.get(e),s=void 0!==u,a=n===Ie;if(!s&&a||s&&n===i.get(u)[1])return t;s||(u=i.length);var h=a?r.remove(e):s?r:r.set(e,u),o=a?i.remove(u):i.set(u,[e,n]);return t.__ownerID?(t.length=h.length,t._map=h,t._vector=o,t.__hash=void 0,t):fe(h,o)}function _e(t,e,n){var r=Object.create(Object.getPrototypeOf(t));
return r._map=e,r.__ownerID=n,r}function ve(t,e){return e?ge(e,t,"",{"":t}):pe(t)}function ge(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,We(e).map(function(n,r){return ge(t,n,r,e)})):e}function pe(t){if(t){if(Array.isArray(t))return We(t).map(pe).toVector();if(t.constructor===Object)return We(t).map(pe).toMap()}return t}var me=Object,de={};de.createClass=t,de.superCall=e,de.defaultSuperCall=n;var ye=5,we=1<<ye,Se=we-1,Ie={},ke={value:!1},Me={value:!1},be={value:void 0,done:!1},De="delete",qe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Oe=2147483647,Ae=0,xe="__immutablehash__";"undefined"!=typeof Symbol&&(xe=Symbol(xe));var Ce=!1,Ee=16,je=255,Re=0,Ue={},We=function(t){return Pe.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},Pe=We;de.createClass(We,{toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e},__toStringMapper:function(t,e){return e+": "+O(t)},toJS:function(){return this.map(function(t){return t instanceof Pe?t.toJS():t}).__toJS()},toArray:function(){C(this.length);var t=Array(this.length||0);return this.valueSeq().forEach(function(e,n){t[n]=e}),t},toObject:function(){C(this.length);var t={};return this.forEach(function(e,n){t[n]=e}),t},toVector:function(){return C(this.length),on.from(this)},toMap:function(){return C(this.length),He.from(this)},toOrderedMap:function(){return C(this.length),wn.from(this)},toSet:function(){return C(this.length),pn.from(this)},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,n){return t+(c(e)^(e===n?0:c(n)))&Oe},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof Pe))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return null!=this.__hash&&null!=t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t)},__deepEquals:function(t){var e=this.cacheResult().entrySeq().toArray(),n=0;
return t.every(function(t,r){var i=e[n++];return W(r,i[0])&&W(t,i[1])})},join:function(t){t=void 0!==t?""+t:",";var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=null!=r?r:""):e+=t+(null!=r?r:"")}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(k)),this.length)},countBy:function(t){var e=this;return wn.empty().withMutations(function(n){e.forEach(function(e,r,i){n.update(t(e,r,i),b)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return Pe(t)})),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e){for(var r,i=0,u=n.length-1,s=0;u>=s&&!r;s++){var a=n[e?u-s:s];i+=a.__iterate(function(e,n,i){return t(e,n,i)===!1?(r=!0,!1):void 0},e)}return i},r},reverse:function(){var t=this,e=t.__makeSequence();return e.length=t.length,e.__iterateUncached=function(e,n){return t.__iterate(e,!n)},e.reverse=function(){return t},e},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var t=this,e=g(t);return e.length=t.length,e.valueSeq=M,e.__iterateUncached=function(e,n,r){if(r&&null==this.length)return this.cacheResult().__iterate(e,n,r);var i,u=0;return r?(u=this.length-1,i=function(t,n,r){return e(t,u--,r)!==!1}):i=function(t,n,r){return e(t,u++,r)!==!1},t.__iterate(i,n),r?this.length:u},e},entrySeq:function(){var t=this;if(t._cache)return Pe(t._cache);var e=t.map(I).valueSeq();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,n){var r,i;return 2>arguments.length?i=!0:r=e,this.forEach(function(e,u,s){i?(i=!1,r=e):r=t.call(n,r,e,u,s)}),r},reduceRight:function(){var t=this.reverse(!0);return t.reduce.apply(t,arguments)},every:function(t,e){var n=!0;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?void 0:(n=!1,!1)}),n},some:function(t,e){return!this.every(q(t),e)},first:function(){return this.find(k)},last:function(){return this.findLast(k)
},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,Ie)!==Ie},get:function(t,e){return this.find(function(e,n){return W(n,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?p(this,t,e,0):this},contains:function(t){return this.find(function(e){return W(e,t)},null,Ie)!==Ie},find:function(t,e,n){var r=n;return this.forEach(function(n,i,u){return t.call(e,n,i,u)?(r=n,!1):void 0}),r},findKey:function(t,e){var n;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?(n=i,!1):void 0}),n},findLast:function(t,e,n){return this.reverse(!0).find(t,e,n)},findLastKey:function(t,e){return this.reverse(!0).findKey(t,e)},flip:function(){var t=this,e=v();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e},map:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){var u=this;return n.__iterate(function(n,i,s){return r(t.call(e,n,i,s),i,u)!==!1},i)},r},mapKeys:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){var u=this;return n.__iterate(function(n,i,s){return r(n,t.call(e,i,n,s),u)!==!1},i)},r},filter:function(t,e){return D(this,t,e,!0,!1)},slice:function(t,e){if(m(t,e,this.length))return this;var n=d(t,this.length),r=y(e,this.length);if(n!==n||r!==r)return this.entrySeq().slice(t,e).fromEntrySeq();var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(t){var e=this;if(t>e.length)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=0;return e.__iterate(function(e,r){return t>s&&n(e,r,u)!==!1?void s++:!1},r,i),s},n.length=this.length&&Math.min(this.length,t),n},takeLast:function(t,e){return this.reverse(e).take(t).reverse(e)},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;
if(i)return this.cacheResult().__iterate(r,i,u);var a=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&r(n,i,s)!==!1?void a++:!1},i,u),a},r},takeUntil:function(t,e,n){return this.takeWhile(q(t),e,n)},skip:function(t){var e=this;if(0===t)return e;var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=!0,a=0,h=0;return e.__iterate(function(e,r){if(!s||!(s=h++<t)){if(n(e,r,u)===!1)return!1;a++}},r,i),a},n.length=this.length&&Math.max(0,this.length-t),n},skipLast:function(t,e){return this.reverse(e).skip(t).reverse(e)},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=!0,h=0;return n.__iterate(function(n,i,u){if(!a||!(a=t.call(e,n,i,u))){if(r(n,i,s)===!1)return!1;h++}},i,u),h},r},skipUntil:function(t,e,n){return this.skipWhile(q(t),e,n)},groupBy:function(t){var e=this,n=wn.empty().withMutations(function(n){e.forEach(function(e,r,i){var u=t(e,r,i),s=n.get(u,Ie);s===Ie&&(s=[],n.set(u,s)),s.push([r,e])})});return n.map(function(t){return Pe(t).fromEntrySeq()})},sort:function(t,e){return this.sortBy(S,t,e)},sortBy:function(t,e){e=e||A;var n=this;return Pe(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(C(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e,n){if(!this._cache)return this.__iterateUncached(t,e,n);var r=this.length-1,i=this._cache,u=this;if(e)for(var s=i.length-1;s>=0;s--){var a=i[s];if(t(a[1],n?a[0]:r-a[0],u)===!1)break}else i.every(n?function(e){return t(e[1],r-e[0],u)!==!1}:function(e){return t(e[1],e[0],u)!==!1});return this.length},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Pe)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ve(t);
t=[t]}return new Ke(t)}});var Je=We.prototype;Je.toJSON=Je.toJS,Je.__toJS=Je.toObject,Je.inspect=Je.toSource=function(){return""+this};var ze=function(){de.defaultSuperCall(this,Be.prototype,arguments)},Be=ze;de.createClass(ze,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){C(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,n){t[n]=e}),t},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n,r){var i=this;return t.__iterate(function(t){return t&&e(t[1],t[0],i)},n,r)},e},join:function(t){t=void 0!==t?""+t:",";var e="";return this.forEach(function(n,r){e+=(r?t:"")+(null!=n?n:"")}),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t).map(function(t){return We(t)}),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e,r){var i=this;if(r&&!this.length)return this.cacheResult().__iterate(t,e,r);for(var u,s=0,a=r&&this.length-1,h=n.length-1,o=0;h>=o&&!u;o++){var c=n[e?h-o:o];c instanceof Be||(c=c.valueSeq()),s+=c.__iterate(function(e,n){return n+=s,t(e,r?a-n:n,i)===!1?(u=!0,!1):void 0},e)}return s},r},reverse:function(t){var e=this,n=e.__makeSequence();return n.length=e.length,n.__reversedIndices=!!(t^e.__reversedIndices),n.__iterateUncached=function(n,r,i){return e.__iterate(n,!r,i^t)},n.reverse=function(n){return t===n?e:Le.reverse.call(this,n)},n},filter:function(t,e,n){var r=D(this,t,e,n,n);return n&&(r.length=this.length),r},get:function(t,e){return t=x(this,t),this.find(function(e,n){return n===t},null,e)},indexOf:function(t){return this.findIndex(function(e){return W(e,t)})},lastIndexOf:function(t){return this.reverse(!0).indexOf(t)},findIndex:function(t,e){var n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.reverse(!0).findIndex(t,e)},slice:function(t,e,n){var r=this;if(m(t,e,r.length))return r;var i=r.__makeSequence(),u=d(t,r.length),s=y(e,r.length);
return i.length=r.length&&(n?r.length:s-u),i.__reversedIndices=r.__reversedIndices,i.__iterateUncached=function(i,a,h){var o=this;if(a)return this.cacheResult().__iterate(i,a,h);var c=this.__reversedIndices^h;if(u!==u||s!==s||c&&null==r.length){var f=r.count();u=d(t,f),s=y(e,f)}var l=c?r.length-s:u,_=c?r.length-u:s,v=r.__iterate(function(t,e){return c?null!=_&&e>=_||e>=l&&i(t,n?e:e-l,o)!==!1:l>e||(null==_||_>e)&&i(t,n?e:e-l,o)!==!1},a,h);return null!=this.length?this.length:n?v:Math.max(0,v-l)},i},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=d(t,this.length);var r=this.slice(0,t);return 1===n?r:r.concat(s(arguments,2),this.slice(t+e))},flatten:function(){var t=this,e=t.__makeSequence();return e.__iterateUncached=function(e,n,r){var i=this;if(r)return this.cacheResult().__iterate(e,n,r);var u=0;return t.__iterate(function(t){u+=We(t).__iterate(function(t,n){return e(t,u+n,i)!==!1},n,r)},n,r),u},e},flatMap:function(t,e){return this.map(t,e).flatten()},skip:function(t,e){var n=this;if(0===t)return n;var r=n.__makeSequence();return e&&(r.length=this.length),r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=n.__reversedIndices^u,h=!0,o=0,c=0,f=n.__iterate(function(n,i){return h&&(h=c++<t,h||(o=i)),h||r(n,u||e?i:i-o,s)!==!1},i,u);return e?f:a?o+1:f-o},r.length=this.length&&Math.max(0,this.length-t),r},skipWhile:function(t,e,n){var r=this,i=r.__makeSequence();return n&&(i.length=this.length),i.__iterateUncached=function(i,u,s){var a=this;if(u)return this.cacheResult().__iterate(i,u,s);var h=r.__reversedIndices^s,o=!0,c=0,f=r.__iterate(function(r,u,h){return o&&(o=t.call(e,r,u,h),o||(c=u)),o||i(r,s||n?u:u-c,a)!==!1},u,s);return n?f:h?c+1:f-c},i},groupBy:function(t,e,n){var r=this,i=wn.empty().withMutations(function(e){r.forEach(function(i,u,s){var a=t(i,u,s),h=e.get(a,Ie);h===Ie&&(h=Array(n?r.length:0),e.set(a,h)),n?h[u]=i:h.push(i)})});return i.map(function(t){return We(t)})},sortBy:function(t,e,n){var r=de.superCall(this,Be.prototype,"sortBy",[t,e]);
return n||(r=r.valueSeq()),r.length=this.length,r},__makeSequence:function(){return g(this)}},{},We);var Le=ze.prototype;Le.__toJS=Le.toArray,Le.__toStringMapper=O,Le.chain=Le.flatMap;var Ve=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};de.createClass(Ve,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},We);var Ke=function(t){this._array=t,this.length=t.length};de.createClass(Ke,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[x(this,t)]:e},has:function(t){return t=x(this,t),t>=0&&this.length>t},__iterate:function(t,e,n){var r,i,u=this._array,s=u.length-1,a=e^n;for(r=0;s>=r;r++)if(i=s-r,t(u[e?i:r],n?i:r,u)===!1)return a?e?i:r:u.length;return u.length}},{},ze);var Ne=function(){};de.createClass(Ne,{toString:function(){return"[Iterator]"}},{});var Fe=Ne.prototype;Fe[qe]=M,Fe.inspect=Fe.toSource=function(){return""+this};var Ge=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof We?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};de.createClass(Ge,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),Ie);return n===Ie?e:j(this,t,n)},set:function(t,e){return U(this,function(n){return n.set(t,e)},t)},remove:function(t){return U(this,function(e){return e.remove(t)},t)},clear:function(){return U(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?U(this,t):U(this,function(r){return r.update(t,e,n)},t)},withMutations:function(t){return U(this,function(e){return(e||He.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:R(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();
return i&&i.__iterate?i.__iterate(function(e,n,i){return t(j(r,n,e),n,i)},e,n):0}},{},We),Ge.prototype[De]=Ge.prototype.remove,Ge.prototype.getIn=Ge.prototype.get;var He=function(t){var e=Qe.empty();return t?t.constructor===Qe?t:e.merge(t):e},Qe=He;de.createClass(He,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return B(this,t,e)},remove:function(t){return B(this,t,Ie)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),T(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe.empty()},merge:function(){return G(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return G(this,t,e)},mergeDeep:function(){return G(this,H(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return G(this,H(t),e)},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Ge(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new un(this,0)},values:function(){return new un(this,1)},entries:function(){return new un(this,2)},__iterator:function(t){return new un(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEquals:function(t){var e=this;return t.every(function(t,n){return W(e.get(n,Ie),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?z(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)
}},{empty:function(){return sn||(sn=z(0))}},We);var Te=He.prototype;Te[De]=Te.remove,Te[qe]=function(){return this.entries()},He.from=He;var Xe=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},Ye=Xe;de.createClass(Xe,{get:function(t,e,n,r){var i=1<<((0===t?e:e>>>t)&Se),u=this.bitmap;return 0===(u&i)?r:this.nodes[X(u&i-1)].get(t+ye,e,n,r)},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Se,h=1<<a,o=this.bitmap,c=0!==(o&h);if(!c&&i===Ie)return this;var f=X(o&h-1),l=this.nodes,_=c?l[f]:null,v=L(_,t,e+ye,n,r,i,u,s);if(v===_)return this;if(!c&&v&&l.length>=an)return F(t,l,o,a,v);if(c&&!v&&2===l.length&&V(l[1^f]))return l[1^f];if(c&&v&&1===l.length&&V(v))return v;var g=t&&t===this.ownerID,p=c?v?o:o^h:o|h,m=c?v?Y(l,f,v,g):$(l,f,g):Z(l,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new Ye(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var Ze=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},$e=Ze;de.createClass(Ze,{get:function(t,e,n,r){var i=(0===t?e:e>>>t)&Se,u=this.nodes[i];return u?u.get(t+ye,e,n,r):r},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&Se,h=i===Ie,o=this.nodes,c=o[a];if(h&&!c)return this;var f=L(c,t,e+ye,n,r,i,u,s);if(f===c)return this;var l=this.count;if(c){if(!f&&(l--,hn>l))return N(t,o,l,a)}else l++;var _=t&&t===this.ownerID,v=Y(o,a,f,_);return _?(this.count=l,this.nodes=v,this):new $e(t,l,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];if(u&&u.iterate(t,e)===!1)return!1}}},{});var tn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},en=tn;de.createClass(tn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(W(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,h){var o=u===Ie;if(n!==this.hash)return o?this:(i(h),i(a),K(this,t,e,n,[r,u]));for(var c=this.entries,f=0,l=c.length;l>f&&!W(r,c[f][0]);f++);var _=l>f;if(o&&!_)return this;if(i(h),(o||!_)&&i(a),o&&2===l)return new nn(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);
return _?o?f===l-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new en(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1}},{});var nn=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},rn=nn;de.createClass(nn,{get:function(t,e,n,r){return W(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var h=u===Ie,o=W(r,this.entry[0]);return(o?u===this.entry[1]:h)?this:(i(a),h?(i(s),null):o?t&&t===this.ownerID?(this.entry[1]=u,this):new rn(t,n,[r,u]):(i(s),K(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var un=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&J(t._root)};de.createClass(un,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return P(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return P(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return P(t,u.entry);e=this._stack=J(u,e)}continue}e=this._stack=this._stack.__prev}return h()}},{},Ne);var sn,an=we/2,hn=we/4,on=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return cn.from(t)},cn=on;de.createClass(on,{toString:function(){return this.__toString("Vector [","]")},has:function(t){return t=x(this,t),t>=0&&this.length>t},get:function(t,e){if(t=x(this,t),0>t||t>=this.length)return e;t+=this._origin;var n=se(this,t);return n&&n.array[t&Se]},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){return re(this,t,e)},remove:function(t){return re(this,t,Ie)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=ye,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):cn.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){ae(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return ae(this,0,-1)
},unshift:function(){var t=arguments;return this.withMutations(function(e){ae(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return ae(this,1)},merge:function(){return he(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return he(this,t,e)},mergeDeep:function(){return he(this,H(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return he(this,H(t),e)},setLength:function(t){return ae(this,0,t)},slice:function(t,e,n){var r=de.superCall(this,cn.prototype,"slice",[t,e,n]);if(!n&&r!==this){var i=this,u=i.length;r.toVector=function(){return ae(i,0>t?Math.max(0,u+t):u?Math.min(u,t):t,null==e?u:0>e?Math.max(0,u+e):u?Math.min(u,e):e)}}return r},keys:function(){return new vn(this,0)},values:function(){return new vn(this,1)},entries:function(){return new vn(this,2)},__iterator:function(t,e){return new vn(this,2,t,e)},__iterate:function(t,e,n){var r=this,i=0,u=r.length-1;n^=e;var s,a=function(e,s){return t(e,n?u-s:s,r)===!1?!1:(i=s,!0)},h=oe(this._size);return s=e?te(this._tail,0,h-this._origin,this._size-this._origin,a,e)&&te(this._root,this._level,-this._origin,h-this._origin,a,e):te(this._root,this._level,-this._origin,h-this._origin,a,e)&&te(this._tail,0,h-this._origin,this._size-this._origin,a,e),(s?u:e?u-i:i)+1},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&W(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?ne(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return gn||(gn=ne(0,0,ye))},from:function(t){if(!t||0===t.length)return cn.empty();if(t.constructor===cn)return t;var e=Array.isArray(t);return t.length>0&&we>t.length?ne(0,t.length,ye,null,new ln(e?s(t):We(t).toArray())):(e||(t=We(t),t instanceof ze||(t=t.valueSeq())),cn.empty().merge(t))}},ze);var fn=on.prototype;fn[De]=fn.remove,fn[qe]=fn.values,fn.update=Te.update,fn.updateIn=Te.updateIn,fn.cursor=Te.cursor,fn.withMutations=Te.withMutations,fn.asMutable=Te.asMutable,fn.asImmutable=Te.asImmutable,fn.wasAltered=Te.wasAltered;
var ln=function(t,e){this.array=t,this.ownerID=e},_n=ln;de.createClass(ln,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n>>>e&Se;if(r>=this.array.length)return new _n([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-ye,n),i===s&&u)return this}if(u&&!i)return this;var a=ue(this,t);if(!u)for(var h=0;r>h;h++)a.array[h]=void 0;return i&&(a.array[r]=i),a},removeAfter:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n-1>>>e&Se;if(r>=this.array.length)return this;var i,u=r===this.array.length-1;if(e>0){var s=this.array[r];if(i=s&&s.removeAfter(t,e-ye,n),i===s&&u)return this}if(u&&!i)return this;var a=ue(this,t);return u||a.array.pop(),i&&(a.array[r]=i),a}},{});var vn=function(t,e,n,r){this._type=e,this._reverse=!!n,this._flipIndices=!!(r^n),this._maxIndex=t.length-1;var i=oe(t._size),u=ee(t._root&&t._root.array,t._level,-t._origin,i-t._origin-1),s=ee(t._tail&&t._tail.array,0,i-t._origin,t._size-t._origin-1);this._stack=n?s:u,this._stack.__prev=n?u:s};de.createClass(vn,{next:function(){for(var t=this._stack;t;){var e=t.array,n=t.index++;if(this._reverse&&(n=Se-n,n>t.rawMax&&(n=t.rawMax,t.index=we-n)),n>=0&&we>n&&t.rawMax>=n){var r=e&&e[n];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(n<<t.level),this._flipIndices&&(i=this._maxIndex-i)),a(0===u?i:1===u?r:[i,r])}this._stack=t=ee(r&&r.array,t.level-ye,t.offset+(n<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return h()}},{},Ne);var gn,pn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return mn.from(t)},mn=pn;de.createClass(pn,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},get:function(t,e){return this.has(t)?t:e},add:function(t){var e=this._map.set(t,null);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:ce(e)},remove:function(t){var e=this._map.remove(t);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:0===e.length?mn.empty():ce(e)
},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):mn.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var n=0;t.length>n;n++)We(t[n]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return We(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(t){return t.contains(n)})||e.remove(n)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return We(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(t){return t.contains(n)})&&e.remove(n)})})},isSubset:function(t){return t=We(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=We(t),t.every(function(t){return e.contains(t)})},wasAltered:function(){return this._map.wasAltered()},values:function(){return this._map.keys()},entries:function(){return E(this.values(),function(t){return[t,t]})},hashCode:function(){return this._map.hashCode()},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__deepEquals:function(t){return this.isSuperset(t)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?ce(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return yn||(yn=ce(He.empty()))},from:function(t){var e=mn.empty();return t?t.constructor===mn?t:e.union(t):e},fromKeys:function(t){return mn.from(We(t).flip())}},We);var dn=pn.prototype;dn[De]=dn.remove,dn[qe]=dn.keys=dn.values,dn.contains=dn.has,dn.mergeDeep=dn.merge=dn.union,dn.mergeDeepWith=dn.mergeWith=function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.merge.apply(this,t)},dn.withMutations=Te.withMutations,dn.asMutable=Te.asMutable,dn.asImmutable=Te.asImmutable,dn.__toJS=Le.__toJS,dn.__toStringMapper=Le.__toStringMapper;
var yn,wn=function(t){var e=Sn.empty();return t?t.constructor===Sn?t:e.merge(t):e},Sn=wn;de.createClass(wn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var n=this._map.get(t);return null!=n?this._vector.get(n)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):Sn.empty()},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,Ie)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return E(this.entries(),function(t){return t[0]})},values:function(){return E(this.entries(),function(t){return t[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(t,e){return this._vector.fromEntrySeq().__iterate(t,e)},__deepEquals:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&W(r[0],n)&&W(r[1],t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._vector.__ensureOwner(t);return t?fe(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=n,this)}},{empty:function(){return In||(In=fe(He.empty(),on.empty()))}},He),wn.from=wn,wn.prototype[De]=wn.prototype.remove;var In,kn=function(t,e){var n=function(t){return this instanceof n?void(this._map=He(t)):new n(t)};t=We(t);var r=n.prototype=Object.create(bn);r.constructor=n,r._name=e,r._defaultValues=t;var i=Object.keys(t);return n.prototype.length=i.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(n.prototype,e,{get:function(){return this.get(e)},set:function(t){o(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}),n},Mn=kn;de.createClass(kn,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(t){return this._defaultValues.has(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues.get(t)):e},clear:function(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;
return Mn._empty||(Mn._empty=_e(this,He.empty()))},set:function(t,e){if(null==t||!this.has(t))return this;var n=this._map.set(t,e);return this.__ownerID||n===this._map?this:_e(this,n)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:_e(this,e)},keys:function(){return this._map.keys()},values:function(){return this._map.values()},entries:function(){return this._map.entries()},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var n=this;return this._defaultValues.map(function(t,e){return n.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?_e(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},We);var bn=kn.prototype;bn[De]=bn.remove,bn[qe]=Te[qe],bn.merge=Te.merge,bn.mergeWith=Te.mergeWith,bn.mergeDeep=Te.mergeDeep,bn.mergeDeepWith=Te.mergeDeepWith,bn.update=Te.update,bn.updateIn=Te.updateIn,bn.cursor=Te.cursor,bn.withMutations=Te.withMutations,bn.asMutable=Te.asMutable,bn.asImmutable=Te.asImmutable,bn.__deepEquals=Te.__deepEquals;var Dn=function(t,e,n){return this instanceof qn?(o(0!==n,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&An?An:(n=null==n?1:Math.abs(n),t>e&&(n=-n),this._start=t,this._end=e,this._step=n,void(this.length=Math.max(0,Math.ceil((e-t)/n-1)+1)))):new qn(t,e,n)},qn=Dn;de.createClass(Dn,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return t=x(this,t),t>=0&&(1/0===this.length||this.length>t)},get:function(t,e){return t=x(this,t),this.has(t)?this._start+t*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e,n){return m(t,e,this.length)?this:n?de.superCall(this,qn.prototype,"slice",[t,e,n]):(t=d(t,this.length),e=y(e,this.length),t>=e?An:new qn(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;
if(e%this._step===0){var n=e/this._step;if(n>=0&&this.length>n)return n}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,t)},skip:function(t,e){return e?de.superCall(this,qn.prototype,"skip",[t]):this.slice(t)},__iterate:function(t,e,n){for(var r=this.length-1,i=this._step,u=e?this._start+r*i:this._start,s=0;r>=s&&t(u,n?r-s:s,this)!==!1;s++)u+=e?-i:i;return n?this.length:s},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step}},{},ze);var On=Dn.prototype;On.__toJS=On.toArray,On.first=fn.first,On.last=fn.last;var An=Dn(0,0),xn=function(t,e){return 0===e&&jn?jn:this instanceof Cn?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new Cn(t,e)},Cn=xn;de.createClass(xn,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return this.has(t)?this._value:e},first:function(){return this._value},contains:function(t){return W(this._value,t)},slice:function(t,e,n){if(n)return de.superCall(this,Cn.prototype,"slice",[t,e,n]);var r=this.length;return t=0>t?Math.max(0,r+t):Math.min(r,t),e=null==e?r:e>0?Math.min(r,e):Math.max(0,r+e),e>t?new Cn(this._value,e-t):jn},reverse:function(t){return t?de.superCall(this,Cn.prototype,"reverse",[t]):this},indexOf:function(t){return W(this._value,t)?0:-1},lastIndexOf:function(t){return W(this._value,t)?this.length:-1},__iterate:function(t,e,n){var r=e^n;o(!r||1/0>this.length,"Cannot access end of infinite range.");for(var i=this.length-1,u=0;i>=u&&t(this._value,r?i-u:u,this)!==!1;u++);return r?this.length:u},__deepEquals:function(t){return W(this._value,t._value)}},{},ze);var En=xn.prototype;En.last=En.first,En.has=On.has,En.take=On.take,En.skip=On.skip,En.__toJS=On.__toJS;var jn=new xn(void 0,0),Rn={Sequence:We,Map:He,Vector:on,Set:pn,OrderedMap:wn,Record:kn,Range:Dn,Repeat:xn,is:W,fromJS:ve};return Rn}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
function t(){function t(t,e,n,r){var i;if(r){var u=r.prototype;i=de.create(u)}else i=t.prototype;return de.keys(e).forEach(function(t){i[t]=e[t]}),de.keys(n).forEach(function(e){t[e]=n[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,n,r){return de.getPrototypeOf(e)[n].apply(t,r)}function n(t,n,r){e(t,n,"constructor",r)}function r(t){return t.value=!1,t}function i(t){t&&(t.value=!0)}function u(){}function s(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function a(t){return De.value=t,De.done=!1,De}function o(){return De.value=void 0,De.done=!0,De}function h(t,e){if(!t)throw Error(e)}function c(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Ae;t=""+t,e="string"}return"string"===e?t.length>Re?f(t):_(t):t.hashCode?c("function"==typeof t.hashCode?t.hashCode():t.hashCode):l(t)}function f(t){var e=We[t];return null==e&&(e=_(t),Pe===Ue&&(Pe=0,We={}),Pe++,We[t]=e),e}function _(t){for(var e=0,n=0;t.length>n;n++)e=31*e+t.charCodeAt(n)&Ae;return e}function l(t){if(t[Ee])return t[Ee];var e=++Ce&Ae;if(!je)try{return Object.defineProperty(t,Ee,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}catch(n){je=!0}return t[Ee]=e,e}function v(){return Object.create(ze)}function g(){return Object.create(Ve)}function p(t,e,n,r){var i=t.get?t.get(e[r],be):be;return i===be?n:++r===e.length?i:p(i,e,n,r)}function m(t,e,n){return(0===t||null!=n&&-n>=t)&&(null==e||null!=n&&e>=n)}function y(t,e){return w(t,e,0)}function d(t,e){return w(t,e,e)}function w(t,e,n){return null==t?n:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function S(t){return t}function I(t,e){return[e,t]}function k(){return!0}function b(){return this}function q(t,e,n,r){var i=t.__makeSequence();return i.__iterateUncached=function(i,u){var s=this,a=0;return t.__iterate(function(t,u,o){return e.call(n,t,u,o)?(a++,i(t,r?u:a-1,s)):void 0},u),a},i}function M(t,e,n,r){var i={},u=[];return t.forEach(function(s,a){var o=e.call(n,s,a,t),h=c(o),f=r?[a,s]:s;i.hasOwnProperty(h)?u[i[h]][1].push(f):(i[h]=u.length,u.push([o,[f]]))
}),Je(u).fromEntrySeq().map(r?function(t){return Je(t).fromEntrySeq()}:function(t){return Je(t)})}function D(t,e,n){if(0>=e)return t;var r=t.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=0,o=!0,h=0;return t.__iterate(function(t,i){return o&&(o=a++<e)?void 0:(h++,r(t,n?i:h-1,s))}),h},r.length=t.length&&Math.max(0,t.length-e),r}function O(t,e,n,r){var i=t.__makeSequence();return i.__iterateUncached=function(i,u,s){var a=this;if(u)return this.cacheResult().__iterate(i,u,s);var o=!0,h=0;return t.__iterate(function(t,u,s){return o&&(o=e.call(n,t,u,s))?void 0:(h++,i(t,r?u:h-1,a))}),h},i}function x(t){return function(){return!t.apply(this,arguments)}}function A(t){return"string"==typeof t?JSON.stringify(t):t}function C(t,e){return t>e?1:e>t?-1:0}function E(t,e){return 0>e?(null==t.length&&t.cacheResult(),t.length+e):e}function j(t){h(1/0!==t,"Cannot perform this action with an infinite sequence.")}function R(t,e){var n=new He;return n.next=function(){var n=t.next();return n.done?n:(n.value=e(n.value),n)},n}function U(t,e,n){return n instanceof Je?P(t,e,n):n}function P(t,e,n){return new Te(t._rootData,t._keyPath.concat(e),t._onChange,n)}function W(t,e,n){var r=t._rootData.updateIn(t._keyPath,n?Xe.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,r,t._rootData,n?i.concat(n):i),new Te(r,t._keyPath,t._onChange)}function J(t,e){return t instanceof Te&&(t=t.deref()),e instanceof Te&&(e=e.deref()),t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof Je?t.equals(e):!1}function K(t,e){return a(0===t||1===t?e[t]:[e[0],e[1]])}function z(t,e){return{node:t,index:0,__prev:e}}function B(t,e,n,r){var i=Object.create(Ze);return i.length=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function L(t,e,n){var i=r(qe),u=r(Me),s=V(t._root,t.__ownerID,0,c(e),e,n,i,u);if(!u.value)return t;var a=t.length+(i.value?n===be?-1:1:0);return t.__ownerID?(t.length=a,t._root=s,t.__hash=void 0,t.__altered=!0,t):s?B(a,s):Xe.empty()}function V(t,e,n,r,u,s,a,o){return t?t.update(e,n,r,u,s,a,o):s===be?t:(i(o),i(a),new sn(e,r,[u,s]))
}function N(t){return t.constructor===sn||t.constructor===rn}function F(t,e,n,r,i){if(t.hash===r)return new rn(e,r,[t.entry,i]);var u,s=(0===n?t.hash:t.hash>>>n)&ke,a=(0===n?r:r>>>n)&ke,o=s===a?[F(t,e,n+Se,r,i)]:(u=new sn(e,r,i),a>s?[t,u]:[u,t]);return new $e(e,1<<s|1<<a,o)}function G(t,e,n,r){for(var i=0,u=0,s=Array(n),a=0,o=1,h=e.length;h>a;a++,o<<=1){var c=e[a];null!=c&&a!==r&&(i|=o,s[u++]=c)}return new $e(t,i,s)}function H(t,e,n,r,i){for(var u=0,s=Array(Ie),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[u++]:null;return s[r]=i,new en(t,u+1,s)}function Q(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Array.isArray(u)?Je(u).fromEntrySeq():Je(u))}return X(t,e,r)}function T(t){return function(e,n){return e&&e.mergeDeepWith?e.mergeDeepWith(t,n):t?t(e,n):n}}function X(t,e,n){return 0===n.length?t:t.withMutations(function(t){for(var r=e?function(n,r){var i=t.get(r,be);t.set(r,i===be?n:e(i,n))}:function(e,n){t.set(n,e)},i=0;n.length>i;i++)n[i].forEach(r)})}function Y(t,e,n,r,i){var u=e.length;if(i===u)return r(t);h(t.set,"updateIn with invalid keyPath");var s=i===u-1?n:Xe.empty(),a=e[i],o=t.get(a,s),c=Y(o,e,n,r,i+1);return c===o?t:t.set(a,c)}function Z(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 $(t,e,n,r){var i=r?t:s(t);return i[e]=n,i}function te(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var u=Array(i),s=0,a=0;i>a;a++)a===e?(u[a]=n,s=-1):u[a]=t[a+s];return u}function ee(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=Array(r),u=0,s=0;r>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function ne(t,e,n,r,i,u){var s,a=t&&t.array;if(0===e){var o=0>n?0:n,h=n+Ie;for(h>r&&(h=r),s=o;h>s;s++){var c=u?o+h-1-s:s;if(i(a&&a[c-n],c)===!1)return!1}}else{var f=1<<e,_=e-Se;for(s=0;ke>=s;s++){var l=u?ke-s:s,v=n+(l<<e);if(r>v&&v+f>0){var g=a&&a[l];if(!ne(g,_,v,r,i,u))return!1}}}return!0}function re(t,e,n,r,i){return{array:t,level:e,offset:n,max:r,rawMax:r-n>>e,index:0,__prev:i}}function ie(t,e,n,r,i,u,s){var a=Object.create(vn);return a.length=e-t,a._origin=t,a._size=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=u,a.__hash=s,a.__altered=!1,a
}function ue(t,e,n){if(e=E(t,e),e>=t.length||0>e)return n===be?t:t.withMutations(function(t){0>e?he(t,e).set(0,n):he(t,0,e+1).set(e,n)});e+=t._origin;var i=t._tail,u=t._root,s=r(Me);return e>=fe(t._size)?i=se(i,t.__ownerID,0,e,n,s):u=se(u,t.__ownerID,t._level,e,n,s),s.value?t.__ownerID?(t._root=u,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ie(t._origin,t._size,t._level,u,i):t}function se(t,e,n,r,u,s){var a,o=u===be,h=r>>>n&ke,c=t&&t.array.length>h;if(o&&!c)return t;if(n>0){var f=t&&t.array[h],_=se(f,e,n-Se,r,u,s);return _===f?t:(a=ae(t,e),a.array[h]=_,a)}return!o&&c&&t.array[h]===u?t:(i(s),a=ae(t,e),o&&h===a.array.length-1?a.array.pop():a.array[h]=o?void 0:u,a)}function ae(t,e){return e&&t&&e===t.ownerID?t:new gn(t?t.array.slice():[],e)}function oe(t,e){if(e>=fe(t._size))return t._tail;if(1<<t._level+Se>e){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&ke],r-=Se;return n}}function he(t,e,n){var r=t.__ownerID||new u,i=t._origin,s=t._size,a=i+e,o=null==n?s:0>n?s+n:i+n;if(a===i&&o===s)return t;if(a>=o)return t.clear();for(var h=t._level,c=t._root,f=0;0>a+f;)c=new gn(c&&c.array.length?[null,c]:[],r),h+=Se,f+=1<<h;f&&(a+=f,i+=f,o+=f,s+=f);for(var _=fe(s),l=fe(o);l>=1<<h+Se;)c=new gn(c&&c.array.length?[c]:[],r),h+=Se;var v=t._tail,g=_>l?oe(t,o-1):l>_?new gn([],r):v;if(v&&l>_&&s>a&&v.array.length){c=ae(c,r);for(var p=c,m=h;m>Se;m-=Se){var y=_>>>m&ke;p=p.array[y]=ae(p.array[y],r)}p.array[_>>>Se&ke]=v}if(s>o&&(g=g&&g.removeAfter(r,0,o)),a>=l)a-=l,o-=l,h=Se,c=null,g=g&&g.removeBefore(r,0,a);else if(a>i||_>l){var d,w;f=0;do d=a>>>h&ke,w=l-1>>>h&ke,d===w&&(d&&(f+=(1<<h)*d),h-=Se,c=c&&c.array[d]);while(c&&d===w);c&&a>i&&(c=c&&c.removeBefore(r,h,a-f)),c&&_>l&&(c=c&&c.removeAfter(r,h,l-f)),f&&(a-=f,o-=f)}return t.__ownerID?(t.length=o-a,t._origin=a,t._size=o,t._level=h,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):ie(a,o,h,c,g)}function ce(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Je(u))}var s=Math.max.apply(null,r.map(function(t){return t.length||0}));return s>t.length&&(t=t.setLength(s)),X(t,e,r)
}function fe(t){return Ie>t?0:t-1>>>Se<<Se}function _e(t,e){var n=Object.create(Sn);return n.length=t?t.length:0,n._map=t,n.__ownerID=e,n}function le(t,e,n,r){var i=Object.create(kn.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=n,i.__hash=r,i}function ve(t,e,n){var r=t._map,i=t._vector,u=r.get(e),s=void 0!==u,a=n===be;if(!s&&a||s&&n===i.get(u)[1])return t;s||(u=i.length);var o=a?r.remove(e):s?r:r.set(e,u),h=a?i.remove(u):i.set(u,[e,n]);return t.__ownerID?(t.length=o.length,t._map=o,t._vector=h,t.__hash=void 0,t):le(o,h)}function ge(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function pe(t,e){return e?me(e,t,"",{"":t}):ye(t)}function me(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,Je(e).map(function(n,r){return me(t,n,r,e)})):e}function ye(t){if(t){if(Array.isArray(t))return Je(t).map(ye).toVector();if(t.constructor===Object)return Je(t).map(ye).toMap()}return t}var de=Object,we={};we.createClass=t,we.superCall=e,we.defaultSuperCall=n;var Se=5,Ie=1<<Se,ke=Ie-1,be={},qe={value:!1},Me={value:!1},De={value:void 0,done:!1},Oe="delete",xe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Ae=2147483647,Ce=0,Ee="__immutablehash__";"undefined"!=typeof Symbol&&(Ee=Symbol(Ee));var je=!1,Re=16,Ue=255,Pe=0,We={},Je=function(t){return Ke.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},Ke=Je;we.createClass(Je,{toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e},__toStringMapper:function(t,e){return e+": "+A(t)},toJS:function(){return this.map(function(t){return t instanceof Ke?t.toJS():t}).__toJS()},toArray:function(){j(this.length);var t=Array(this.length||0);return this.valueSeq().forEach(function(e,n){t[n]=e}),t},toObject:function(){j(this.length);var t={};return this.forEach(function(e,n){t[n]=e}),t},toVector:function(){return j(this.length),_n.from(this)},toMap:function(){return j(this.length),Xe.from(this)
},toOrderedMap:function(){return j(this.length),kn.from(this)},toSet:function(){return j(this.length),dn.from(this)},toKeyedSeq:function(){return this},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,n){return t+(c(e)^(e===n?0:c(n)))&Ae},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof Ke))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return null!=this.__hash&&null!=t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t)},__deepEquals:function(t){var e=this.cacheResult().entrySeq().toArray(),n=0;return t.every(function(t,r){var i=e[n++];return J(r,i[0])&&J(t,i[1])})},join:function(t){t=void 0!==t?""+t:",";var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=null!=r?r:""):e+=t+(null!=r?r:"")}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(k)),this.length)},countBy:function(t,e){var n=this,r={},i=[];return this.forEach(function(u,s){var a=t.call(e,u,s,n),o=c(a);r.hasOwnProperty(o)?i[r[o]][1]++:(r[o]=i.length,i.push([a,1]))}),Ke(i).fromEntrySeq()},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return Ke(t)})),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e){for(var r,i=0,u=n.length-1,s=0;u>=s&&!r;s++){var a=n[e?u-s:s];i+=a.__iterate(function(e,n,i){return t(e,n,i)===!1?(r=!0,!1):void 0},e)}return i},r},reverse:function(){var t=this,e=t.__makeSequence();return e.reverse=function(){return t},e.length=t.length,e.__iterateUncached=function(e,n){return t.__iterate(e,!n)},e},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var t=this,e=g(t);return e.length=t.length,e.__iterateUncached=function(e,n,r){var i,u=this,s=0;if(r){var a=this.length-1;i=function(t){return e(t,a-s++,u)!==!1}}else i=function(t){return e(t,s++,u)!==!1};return t.__iterate(i,n),s
},e},entrySeq:function(){var t=this;if(t._cache)return Ke(t._cache);var e=t.map(I).valueSeq();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,n){var r,i;return 2>arguments.length?i=!0:r=e,this.forEach(function(e,u,s){i?(i=!1,r=e):r=t.call(n,r,e,u,s)}),r},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},every:function(t,e){var n=!0;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?void 0:(n=!1,!1)}),n},some:function(t,e){return!this.every(x(t),e)},first:function(){return this.find(k)},last:function(){return this.findLast(k)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,be)!==be},get:function(t,e){return this.find(function(e,n){return J(n,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?p(this,t,e,0):this},contains:function(t){return this.find(function(e){return J(e,t)},null,be)!==be},find:function(t,e,n){var r=n;return this.forEach(function(n,i,u){return t.call(e,n,i,u)?(r=n,!1):void 0}),r},findKey:function(t,e){var n;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?(n=i,!1):void 0}),n},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},flip:function(){var t=this.toKeyedSeq(),e=t.__makeSequence();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e},map:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){var u=this;return n.__iterate(function(n,i,s){return r(t.call(e,n,i,s),i,u)!==!1},i)},r},mapKeys:function(t,e){return this.flip().map(t,e).flip()},mapEntries:function(t,e){return this.entrySeq().map(t,e).fromEntrySeq()},filter:function(t,e){return q(this,t,e,!0)},slice:function(t,e){if(m(t,e,this.length))return this;var n=y(t,this.length),r=d(e,this.length);
if(n!==n||r!==r)return this.cacheResult().slice(t,e);var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(t){var e=this;if(t>e.length)return e;0>t&&(t=0);var n=e.__makeSequence();return n.__iterateUncached=function(n,r,i){var u=this;if(r)return this.cacheResult().__iterate(n,r,i);var s=0;return e.__iterate(function(e,r){return t>s&&++s&&n(e,r,u)}),s},n.length=this.length&&Math.min(this.length,t),n},takeLast:function(t){return this.reverse().take(t).reverse()},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){var s=this;if(i)return this.cacheResult().__iterate(r,i,u);var a=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&++a&&r(n,i,s)}),a},r},takeUntil:function(t,e){return this.takeWhile(x(t),e)},skip:function(t){return D(this,t,!0)},skipLast:function(t){return this.reverse().skip(t).reverse()},skipWhile:function(t,e){return O(this,t,e,!0)},skipUntil:function(t,e){return this.skipWhile(x(t),e)},groupBy:function(t,e){return M(this,t,e,!0)},sort:function(t){return this.sortBy(S,t)},sortBy:function(t,e){e=e||C;var n=this;return Ke(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(j(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e){var n=this._cache;if(n){for(var r=n.length-1,i=0;r>=i;i++){var u=n[e?r-i:i];if(t(u[1],u[0],this)===!1)break}return i}return this.__iterateUncached(t,e)},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Ke)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Fe(t);t=[t]}return new Ge(t)}});var ze=Je.prototype;ze.toJSON=ze.toJS,ze.__toJS=ze.toObject,ze.inspect=ze.toSource=function(){return""+this};var Be=function(){we.defaultSuperCall(this,Le.prototype,arguments)},Le=Be;we.createClass(Be,{toString:function(){return this.__toString("Seq [","]")
},toKeyedSeq:function(){return new Ne(this)},valueSeq:function(){return this},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t){return t&&e(t[1],t[0],r)},n)},e},join:function(t){t=void 0!==t?""+t:",";var e="";return this.forEach(function(n,r){e+=(r?t:"")+(null!=n?n:"")}),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t),r=Je(n).flatten();return r.length=n.reduce(function(t,e){if(void 0!==t){var n=Je(e).length;if(null!=n)return t+n}},0),r},reverse:function(){var t=this,e=t.__makeSequence();return e.reverse=function(){return t},e.length=t.length,e.__iterateUncached=function(e,n,r){var i=this,u=r?this.length:0;return t.__iterate(function(t){return e(t,r?--u:u++,i)!==!1},!n)},e},filter:function(t,e){return q(this,t,e,!1)},get:function(t,e){return t=E(this,t),this.find(function(e,n){return n===t},null,e)},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},indexOf:function(t){return this.findIndex(function(e){return J(e,t)})},lastIndexOf:function(t){return this.toKeyedSeq().reverse().indexOf(t)},findIndex:function(t,e){var n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.toKeyedSeq().reverse().findIndex(t,e)},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=y(t,this.length);var r=this.slice(0,t);return 1===n?r:r.concat(s(arguments,2),this.slice(t+e))},flatten:function(){var t=this,e=this.__makeSequence();return e.__iterateUncached=function(e,n,r){var i=this,u=0,s=this.length-1;return t.__iterate(function(t){var a=!1;return Je(t).__iterate(function(t){return e(t,r?s-u++:u++,i)===!1?(a=!0,!1):void 0},n),!a},n),u},e},flatMap:function(t,e){return this.map(t,e).flatten()},skip:function(t){return D(this,t,!1)},skipWhile:function(t,e){return O(this,t,e,!1)},groupBy:function(t,e){return M(this,t,e,!1)},sortBy:function(t,e){e=e||C;
var n=this;return Je(this.entrySeq().toArray().sort(function(r,i){return e(t(r[1],r[0],n),t(i[1],i[0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq()},__iterate:function(t,e,n){var r=this._cache;if(r){n^=e;for(var i=r.length-1,u=0;i>=u;u++){var s=r[e?i-u:u],a=s[0];if(t(s[1],n?i-a:a,this)===!1)break}return u}return n&&!this.length?this.cacheResult().__iterate(t,e,n):this.__iterateUncached(t,e,n)},__makeSequence:function(){return g(this)}},{},Je);var Ve=Be.prototype;Ve.__toJS=Ve.toArray,Ve.__toStringMapper=A,Ve.chain=Ve.flatMap;var Ne=function(t){this._seq=t,this.length=t.length};we.createClass(Ne,{get:function(t,e){return this._seq.get(t,e)},has:function(t){return this._seq.has(t)},__iterate:function(t,e){return this._seq.__iterate(t,e,e)}},{},Je);var Fe=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};we.createClass(Fe,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},Je);var Ge=function(t){this._array=t,this.length=t.length};we.createClass(Ge,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[E(this,t)]:e},has:function(t){return t=E(this,t),t>=0&&this.length>t},__iterate:function(t,e,n){var r,i,u=this._array,s=u.length-1,a=e^n;for(r=0;s>=r;r++)if(i=s-r,t(u[e?i:r],n?i:r,u)===!1)return a?e?i:r:u.length;return u.length}},{},Be);var He=function(){};we.createClass(He,{toString:function(){return"[Iterator]"}},{});var Qe=He.prototype;Qe[xe]=b,Qe.inspect=Qe.toSource=function(){return""+this};var Te=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Je?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};we.createClass(Te,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),be);
return n===be?e:U(this,t,n)},set:function(t,e){return W(this,function(n){return n.set(t,e)},t)},remove:function(t){return W(this,function(e){return e.remove(t)},t)},clear:function(){return W(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?W(this,t):W(this,function(r){return r.update(t,e,n)},t)},withMutations:function(t){return W(this,function(e){return(e||Xe.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:P(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(e,n,i){return t(U(r,n,e),n,i)},e,n):0}},{},Je),Te.prototype[Oe]=Te.prototype.remove,Te.prototype.getIn=Te.prototype.get;var Xe=function(t){var e=Ye.empty();return t?t.constructor===Ye?t:e.merge(t):e},Ye=Xe;we.createClass(Xe,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return L(this,t,e)},remove:function(t){return L(this,t,be)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),Y(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ye.empty()},merge:function(){return Q(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return Q(this,t,e)},mergeDeep:function(){return Q(this,T(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return Q(this,T(t),e)},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Te(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered
},keys:function(){return new on(this,0)},values:function(){return new on(this,1)},entries:function(){return new on(this,2)},__iterator:function(t){return new on(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEquals:function(t){var e=this;return t.every(function(t,n){return J(e.get(n,be),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?B(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return hn||(hn=B(0))}},Je);var Ze=Xe.prototype;Ze[Oe]=Ze.remove,Ze[xe]=function(){return this.entries()},Xe.from=Xe;var $e=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},tn=$e;we.createClass($e,{get:function(t,e,n,r){var i=1<<((0===t?e:e>>>t)&ke),u=this.bitmap;return 0===(u&i)?r:this.nodes[Z(u&i-1)].get(t+Se,e,n,r)},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&ke,o=1<<a,h=this.bitmap,c=0!==(h&o);if(!c&&i===be)return this;var f=Z(h&o-1),_=this.nodes,l=c?_[f]:null,v=V(l,t,e+Se,n,r,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=cn)return H(t,_,h,a,v);if(c&&!v&&2===_.length&&N(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&N(v))return v;var g=t&&t===this.ownerID,p=c?v?h:h^o:h|o,m=c?v?$(_,f,v,g):ee(_,f,g):te(_,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new tn(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var en=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},nn=en;we.createClass(en,{get:function(t,e,n,r){var i=(0===t?e:e>>>t)&ke,u=this.nodes[i];return u?u.get(t+Se,e,n,r):r},update:function(t,e,n,r,i,u,s){var a=(0===e?n:n>>>e)&ke,o=i===be,h=this.nodes,c=h[a];if(o&&!c)return this;var f=V(c,t,e+Se,n,r,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,fn>_))return G(t,h,_,a)}else _++;var l=t&&t===this.ownerID,v=$(h,a,f,l);return l?(this.count=_,this.nodes=v,this):new nn(t,_,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];
if(u&&u.iterate(t,e)===!1)return!1}}},{});var rn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},un=rn;we.createClass(rn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(J(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,o){var h=u===be;if(n!==this.hash)return h?this:(i(o),i(a),F(this,t,e,n,[r,u]));for(var c=this.entries,f=0,_=c.length;_>f&&!J(r,c[f][0]);f++);var l=_>f;if(h&&!l)return this;if(i(o),(h||!l)&&i(a),h&&2===_)return new sn(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return l?h?f===_-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new un(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1}},{});var sn=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},an=sn;we.createClass(sn,{get:function(t,e,n,r){return J(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var o=u===be,h=J(r,this.entry[0]);return(h?u===this.entry[1]:o)?this:(i(a),o?(i(s),null):h?t&&t===this.ownerID?(this.entry[1]=u,this):new an(t,n,[r,u]):(i(s),F(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var on=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&z(t._root)};we.createClass(on,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return K(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return K(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return K(t,u.entry);e=this._stack=z(u,e)}continue}e=this._stack=this._stack.__prev}return o()}},{},He);var hn,cn=Ie/2,fn=Ie/4,_n=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return ln.from(t)},ln=_n;we.createClass(_n,{toString:function(){return this.__toString("Vector [","]")},has:function(t){return t=E(this,t),t>=0&&this.length>t},get:function(t,e){if(t=E(this,t),0>t||t>=this.length)return e;t+=this._origin;var n=oe(this,t);return n&&n.array[t&ke]
},set:function(t,e){return ue(this,t,e)},remove:function(t){return ue(this,t,be)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=Se,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ln.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){he(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return he(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){he(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return he(this,1)},merge:function(){return ce(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ce(this,t,e)},mergeDeep:function(){return ce(this,T(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ce(this,T(t),e)},setLength:function(t){return he(this,0,t)},slice:function(t,e){var n=we.superCall(this,ln.prototype,"slice",[t,e]);if(n!==this){var r=this,i=r.length;n.toVector=function(){return he(r,0>t?Math.max(0,i+t):i?Math.min(i,t):t,null==e?i:0>e?Math.max(0,i+e):i?Math.min(i,e):e)}}return n},keys:function(){return new mn(this,0)},values:function(){return new mn(this,1)},entries:function(){return new mn(this,2)},__iterator:function(t,e){return new mn(this,2,t,e)},__iterate:function(t,e,n){var r,i=this,u=0,s=i.length-1,a=e&&!n,o=function(e,n){return t(e,a?s-n:n,i)===!1?!1:(u=n,!0)},h=fe(this._size);return r=e?ne(this._tail,0,h-this._origin,this._size-this._origin,o,e)&&ne(this._root,this._level,-this._origin,h-this._origin,o,e):ne(this._root,this._level,-this._origin,h-this._origin,o,e)&&ne(this._tail,0,h-this._origin,this._size-this._origin,o,e),(r?s:e?s-u:u)+1},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&J(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?ie(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)
}},{empty:function(){return yn||(yn=ie(0,0,Se))},from:function(t){if(!t||0===t.length)return ln.empty();if(t.constructor===ln)return t;var e=Array.isArray(t);return t.length>0&&Ie>t.length?ie(0,t.length,Se,null,new gn(e?s(t):Je(t).toArray())):(e||(t=Je(t).valueSeq()),ln.empty().merge(t))}},Be);var vn=_n.prototype;vn[Oe]=vn.remove,vn[xe]=vn.values,vn.update=Ze.update,vn.updateIn=Ze.updateIn,vn.cursor=Ze.cursor,vn.withMutations=Ze.withMutations,vn.asMutable=Ze.asMutable,vn.asImmutable=Ze.asImmutable,vn.wasAltered=Ze.wasAltered;var gn=function(t,e){this.array=t,this.ownerID=e},pn=gn;we.createClass(gn,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n>>>e&ke;if(r>=this.array.length)return new pn([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-Se,n),i===s&&u)return this}if(u&&!i)return this;var a=ae(this,t);if(!u)for(var o=0;r>o;o++)a.array[o]=void 0;return i&&(a.array[r]=i),a},removeAfter:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n-1>>>e&ke;if(r>=this.array.length)return this;var i,u=r===this.array.length-1;if(e>0){var s=this.array[r];if(i=s&&s.removeAfter(t,e-Se,n),i===s&&u)return this}if(u&&!i)return this;var a=ae(this,t);return u||a.array.pop(),i&&(a.array[r]=i),a}},{});var mn=function(t,e,n,r){this._type=e,this._reverse=!!n,this._reverseIndices=!!(r^n),this._maxIndex=t.length-1;var i=fe(t._size),u=re(t._root&&t._root.array,t._level,-t._origin,i-t._origin-1),s=re(t._tail&&t._tail.array,0,i-t._origin,t._size-t._origin-1);this._stack=n?s:u,this._stack.__prev=n?u:s};we.createClass(mn,{next:function(){for(var t=this._stack;t;){var e=t.array,n=t.index++;if(this._reverse&&(n=ke-n,n>t.rawMax&&(n=t.rawMax,t.index=Ie-n)),n>=0&&Ie>n&&t.rawMax>=n){var r=e&&e[n];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(n<<t.level),this._reverseIndices&&(i=this._maxIndex-i)),a(0===u?i:1===u?r:[i,r])}this._stack=t=re(r&&r.array,t.level-Se,t.offset+(n<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return o()}},{},He);var yn,dn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];
return wn.from(t)},wn=dn;we.createClass(dn,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},get:function(t,e){return this.has(t)?t:e},add:function(t){var e=this._map.set(t,null);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:_e(e)},remove:function(t){var e=this._map.remove(t);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:0===e.length?wn.empty():_e(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):wn.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var n=0;t.length>n;n++)Je(t[n]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Je(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(t){return t.contains(n)})||e.remove(n)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Je(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(t){return t.contains(n)})&&e.remove(n)})})},isSubset:function(t){return t=Je(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=Je(t),t.every(function(t){return e.contains(t)})},wasAltered:function(){return this._map.wasAltered()},values:function(){return this._map.keys()},entries:function(){return R(this.values(),function(t){return[t,t]})},hashCode:function(){return this._map.hashCode()},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__deepEquals:function(t){return this.isSuperset(t)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?_e(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return In||(In=_e(Xe.empty()))},from:function(t){var e=wn.empty();
return t?t.constructor===wn?t:e.union(t):e},fromKeys:function(t){return wn.from(Je(t).flip())}},Je);var Sn=dn.prototype;Sn[Oe]=Sn.remove,Sn[xe]=Sn.keys=Sn.values,Sn.contains=Sn.has,Sn.mergeDeep=Sn.merge=Sn.union,Sn.mergeDeepWith=Sn.mergeWith=function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.merge.apply(this,t)},Sn.withMutations=Ze.withMutations,Sn.asMutable=Ze.asMutable,Sn.asImmutable=Ze.asImmutable,Sn.__toJS=Ve.__toJS,Sn.__toStringMapper=Ve.__toStringMapper;var In,kn=function(t){var e=bn.empty();return t?t.constructor===bn?t:e.merge(t):e},bn=kn;we.createClass(kn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var n=this._map.get(t);return null!=n?this._vector.get(n)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):bn.empty()},set:function(t,e){return ve(this,t,e)},remove:function(t){return ve(this,t,be)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return R(this.entries(),function(t){return t[0]})},values:function(){return R(this.entries(),function(t){return t[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(t,e){return this._vector.fromEntrySeq().__iterate(t,e)},__deepEquals:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&J(r[0],n)&&J(r[1],t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._vector.__ensureOwner(t);return t?le(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=n,this)}},{empty:function(){return qn||(qn=le(Xe.empty(),_n.empty()))}},Xe),kn.from=kn,kn.prototype[Oe]=kn.prototype.remove;var qn,Mn=function(t,e){var n=function(t){return this instanceof n?void(this._map=Xe(t)):new n(t)};t=Je(t);var r=n.prototype=Object.create(On);r.constructor=n,r._name=e,r._defaultValues=t;var i=Object.keys(t);return n.prototype.length=i.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(n.prototype,e,{get:function(){return this.get(e)
},set:function(t){h(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}),n},Dn=Mn;we.createClass(Mn,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(t){return this._defaultValues.has(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues.get(t)):e},clear:function(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;return Dn._empty||(Dn._empty=ge(this,Xe.empty()))},set:function(t,e){if(null==t||!this.has(t))return this;var n=this._map.set(t,e);return this.__ownerID||n===this._map?this:ge(this,n)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:ge(this,e)},keys:function(){return this._map.keys()},values:function(){return this._map.values()},entries:function(){return this._map.entries()},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var n=this;return this._defaultValues.map(function(t,e){return n.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?ge(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},Je);var On=Mn.prototype;On[Oe]=On.remove,On[xe]=Ze[xe],On.merge=Ze.merge,On.mergeWith=Ze.mergeWith,On.mergeDeep=Ze.mergeDeep,On.mergeDeepWith=Ze.mergeDeepWith,On.update=Ze.update,On.updateIn=Ze.updateIn,On.cursor=Ze.cursor,On.withMutations=Ze.withMutations,On.asMutable=Ze.asMutable,On.asImmutable=Ze.asImmutable,On.__deepEquals=Ze.__deepEquals;var xn=function(t,e,n){return this instanceof An?(h(0!==n,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&En?En:(n=null==n?1:Math.abs(n),t>e&&(n=-n),this._start=t,this._end=e,this._step=n,void(this.length=Math.max(0,Math.ceil((e-t)/n-1)+1)))):new An(t,e,n)},An=xn;we.createClass(xn,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return t=E(this,t),t>=0&&(1/0===this.length||this.length>t)
},get:function(t,e){return t=E(this,t),this.has(t)?this._start+t*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e){return m(t,e,this.length)?this:(t=y(t,this.length),e=d(e,this.length),t>=e?En:new An(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var n=e/this._step;if(n>=0&&this.length>n)return n}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,Math.max(0,t))},skip:function(t){return this.slice(Math.max(0,t))},__iterate:function(t,e,n){for(var r=this.length-1,i=this._step,u=e?this._start+r*i:this._start,s=0;r>=s&&t(u,n?r-s:s,this)!==!1;s++)u+=e?-i:i;return s},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step}},{},Be);var Cn=xn.prototype;Cn.__toJS=Cn.toArray,Cn.first=vn.first,Cn.last=vn.last;var En=xn(0,0),jn=function(t,e){return 0===e&&Pn?Pn:this instanceof Rn?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new Rn(t,e)},Rn=jn;we.createClass(jn,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return J(this._value,t)},slice:function(t,e){var n=this.length;return t=0>t?Math.max(0,n+t):Math.min(n,t),e=null==e?n:e>0?Math.min(n,e):Math.max(0,n+e),e>t?new Rn(this._value,e-t):Pn},reverse:function(){return this},indexOf:function(t){return J(this._value,t)?0:-1},lastIndexOf:function(t){return J(this._value,t)?this.length:-1},__iterate:function(t,e,n){h(!n||1/0>this.length,"Cannot access end of infinite range.");for(var r=this.length-1,i=0;r>=i&&t(this._value,n?r-i:i,this)!==!1;i++);return i},__deepEquals:function(t){return J(this._value,t._value)}},{},Be);var Un=jn.prototype;Un.last=Un.first,Un.has=Cn.has,Un.take=Cn.take,Un.skip=Cn.skip,Un.__toJS=Cn.__toJS;var Pn=new jn(void 0,0),Wn={Sequence:Je,Map:Xe,Vector:_n,Set:dn,OrderedMap:kn,Record:Mn,Range:xn,Repeat:jn,is:J,fromJS:pe};
return Wn}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
{
"name": "immutable",
"version": "2.1.0",
"version": "2.2.1",
"description": "Immutable Data Collections",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/facebook/immutable-js",

@@ -11,3 +11,3 @@ Immutable Data Collections

`immutable` provides `Sequence`, `Range`, `Repeat`, `Map`, `OrderedMap`, `Set`
and a sparse `Vector` by using lazy sequences and [hash maps tries](http://en.wikipedia.org/wiki/Hash_array_mapped_trie).
and `Vector` by using lazy sequences and [hash maps tries](http://en.wikipedia.org/wiki/Hash_array_mapped_trie).
They achieve efficiency by using structural sharing and minimizing the need to

@@ -14,0 +14,0 @@ copy or cache data.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc