-
Notifications
You must be signed in to change notification settings - Fork 1
/
Immutable.min.js
28 lines (28 loc) · 40.2 KB
/
Immutable.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
function t(){function t(t,e,n,r){var i;if(r){var u=r.prototype;i=ye.create(u)}else i=t.prototype;return ye.keys(e).forEach(function(t){i[t]=e[t]}),ye.keys(n).forEach(function(e){t[e]=n[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,n,r){return ye.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&xe;t=""+t,e="string"}return"string"===e?t.length>je?f(t):l(t):t.hashCode?c("function"==typeof t.hashCode?t.hashCode():t.hashCode):_(t)}function f(t){var e=Re[t];return null==e&&(e=l(t),We===Pe&&(We=0,Re={}),We++,Re[t]=e),e}function l(t){for(var e=0,n=0;t.length>n;n++)e=31*e+t.charCodeAt(n)&xe;return e}function _(t){if(t[Ce])return t[Ce];var e=++Ae&xe;if(!Ee)try{return Object.defineProperty(t,Ce,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}catch(n){Ee=!0}return t[Ce]=e,e}function v(){return Object.create(Je)}function g(t){var e=Object.create(Ve);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function p(t,e,n,r){var i=t.get?t.get(e[r],ke):ke;return i===ke?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 M(t){return(t||0)+1}function D(t,e,n,r,i){var u=t.__makeSequence();return u.__iterateUncached=function(u,s,a){var o=0,h=t.__iterate(function(t,i,s){if(e.call(n,t,i,s)){if(u(t,r?i:o,s)===!1)return!1;o++}},s,a);return i?h:o},u}function q(t){return function(){return!t.apply(this,arguments)
}}function O(t){return"string"==typeof t?JSON.stringify(t):t}function x(t,e){for(var n="";e;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n}function A(t,e){return t>e?1:e>t?-1:0}function C(t){h(1/0!==t,"Cannot perform this action with an infinite sequence.")}function E(t,e){var n=new Fe;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 Ue?P(t,e,n):n}function P(t,e,n){return new He(t._rootData,t._keyPath.concat(e),t._onChange,n)}function W(t,e,n){var r=t._rootData.updateIn(t._keyPath,n?Qe.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,r,t._rootData,n?i.concat(n):i),new He(r,t._keyPath,t._onChange)}function R(t,e){return t instanceof He&&(t=t.deref()),e instanceof He&&(e=e.deref()),t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof Ue?t.equals(e):!1}function U(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 J(t,e,n,r){var i=Object.create(Xe);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(be),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===ke?-1:1:0);return t.__ownerID?(t.length=a,t._root=s,t.__hash=void 0,t.__altered=!0,t):s?J(a,s):Qe.empty()}function L(t,e,n,r,u,s,a,o){return t?t.update(e,n,r,u,s,a,o):s===ke?t:(i(o),i(a),new rn(e,r,[u,s]))}function V(t){return t.constructor===rn||t.constructor===en}function K(t,e,n,r,i){if(t.hash===r)return new en(e,r,[t.entry,i]);var u,s=t.hash>>>n&Ie,a=r>>>n&Ie,o=s===a?[K(t,e,n+we,r,i)]:(u=new rn(e,r,i),a>s?[t,u]:[u,t]);return new Ye(e,1<<s|1<<a,o)}function N(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 Ye(t,i,s)}function F(t,e,n,r,i){for(var u=0,s=Array(Se),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[u++]:null;return s[r]=i,new $e(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)?Ue(u).fromEntrySeq():Ue(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,ke);t.set(r,i===ke?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);h(t.set,"updateIn with invalid keyPath");var s=i===u-1?n:Qe.empty(),a=e[i],o=t.get(a,s),c=T(o,e,n,r,i+1);return c===o?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){if(t){var s,a=t.array,o=a.length-1;if(0===e)for(s=0;o>=s;s++){var h=u?o-s:s;if(a.hasOwnProperty(h)){var c=h+n;if(c>=0&&r>c&&i(a[h],c)===!1)return!1}}else{var f=1<<e,l=e-we;for(s=0;o>=s;s++){var _=u?o-s:s,v=n+_*f;if(r>v&&v+f>0){var g=a[_];if(g&&!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(ln);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>=t.length)return n===ke?t:t.withMutations(function(t){ae(t,0,e+1).set(e,n)});e=he(e,t._origin);var i=t._tail,u=t._root,s=r(Me);return e>=ce(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,o=u===ke,h=r>>>n&Ie,c=t&&t.array.length>h&&t.array.hasOwnProperty(h);if(o&&!c)return t;if(n>0){var f=t&&t.array[h],l=ie(f,e,n-we,r,u,s);return l===f?t:(a=ue(t,e),a.array[h]=l,a)
}return!o&&c&&t.array[h]===u?t:(i(s),a=ue(t,e),o?delete a.array[h]:a.array[h]=u,a)}function ue(t,e){return e&&t&&e===t.ownerID?t:new _n(t?t.array.slice():[],e)}function se(t,e){if(e>=ce(t._size))return t._tail;if(1<<t._level+we>e){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&Ie],r-=we;return n}}function ae(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 _n(c&&c.array.length?[null,c]:[],r),h+=we,f+=1<<h;f&&(a+=f,i+=f,o+=f,s+=f);for(var l=ce(s),_=ce(o);_>=1<<h+we;)c=new _n(c&&c.array.length?[c]:[],r),h+=we;var v=t._tail,g=l>_?se(t,o-1):_>l?new _n([],r):v;if(v&&_>l&&s>a&&v.array.length){c=ue(c,r);for(var p=c,m=h;m>we;m-=we){var y=l>>>m&Ie;p=p.array[y]=ue(p.array[y],r)}p.array[l>>>we&Ie]=v}if(s>o&&(g=g&&g.removeAfter(r,0,o)),a>=_)a-=_,o-=_,h=we,c=null,g=g&&g.removeBefore(r,0,a);else if(a>i||l>_){var d,w;f=0;do d=a>>>h&Ie,w=_-1>>>h&Ie,d===w&&(d&&(f+=(1<<h)*d),h-=we,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,_-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):ne(a,o,h,c,g)}function oe(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Ue(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 he(t,e){return h(t>=0,"Index out of bounds"),t+e}function ce(t){return Se>t?0:t-1>>>we<<we}function fe(t,e){var n=Object.create(dn);return n.length=t?t.length:0,n._map=t,n.__ownerID=e,n}function le(t,e,n,r){var i=Object.create(Sn.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=n,i.__hash=r,i}function _e(t,e,n){var r=t._map,i=t._vector,u=r.get(e),s=void 0!==u,a=n===ke;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 ve(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function ge(t,e){return e?pe(e,t,"",{"":t}):me(t)}function pe(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,Ue(e).map(function(n,r){return pe(t,n,r,e)})):e}function me(t){if(t){if(Array.isArray(t))return Ue(t).map(me).toVector();if(t.constructor===Object)return Ue(t).map(me).toMap()}return t}var ye=Object,de={};de.createClass=t,de.superCall=e,de.defaultSuperCall=n;var we=5,Se=1<<we,Ie=Se-1,ke={},be={value:!1},Me={value:!1},De={value:void 0,done:!1},qe="delete",Oe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",xe=2147483647,Ae=0,Ce="__immutablehash__";"undefined"!=typeof Symbol&&(Ce=Symbol(Ce));var Ee=!1,je=16,Pe=255,We=0,Re={},Ue=function(t){return ze.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},ze=Ue;de.createClass(Ue,{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 ze?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),cn.from(this)},toMap:function(){return C(this.length),Qe.from(this)},toOrderedMap:function(){return C(this.length),Sn.from(this)},toSet:function(){return C(this.length),mn.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)))&xe},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof ze))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 R(r,i[0])&&R(t,i[1])})},join:function(t){t=t||",";var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=r):e+=t+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 Sn.empty().withMutations(function(n){e.forEach(function(e,r,i){n.update(t(e,r,i),M)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return ze(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=b,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 ze(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=e;return this.forEach(function(e,i,u){r=t.call(n,r,e,i,u)}),r},reduceRight:function(t,e,n){return this.reverse(!0).reduce(t,e,n)},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,ke)!==ke},get:function(t,e){return this.find(function(e,n){return R(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 R(e,t)},null,ke)!==ke},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){return t.__iterate(function(t,n,r){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){return n.__iterate(function(n,i,u){return r(t.call(e,n,i,u),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){return n.__iterate(function(n,i,u){return r(n,t.call(e,i,n,u),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=y(t,this.length),r=d(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=0,n=this.takeWhile(function(){return e++<t});return 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){if(i)return this.cacheResult().__iterate(r,i,u);var s=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&r(n,i,u)!==!1?void s++:!1},i,u),s},r},takeUntil:function(t,e,n){return this.takeWhile(q(t),e,n)},skip:function(t,e){if(0===t)return this;var n=0,r=this.skipWhile(function(){return n++<t},null,e);
return r.length=this.length&&Math.max(0,this.length-t),r},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){if(i)return this.cacheResult().__iterate(r,i,u);var s=!0,a=0;return n.__iterate(function(n,i,u){if(!s||!(s=t.call(e,n,i,u))){if(r(n,i,u)===!1)return!1;a++}},i,u),a},r},skipUntil:function(t,e,n){return this.skipWhile(q(t),e,n)},groupBy:function(t){var e=this,n=Sn.empty().withMutations(function(n){e.forEach(function(e,r,i){var u=t(e,r,i),s=n.get(u,ke);s===ke&&(s=[],n.set(u,s)),s.push([r,e])})});return n.map(function(t){return ze(t).fromEntrySeq()})},sort:function(t,e){return this.sortBy(S,t,e)},sortBy:function(t,e){e=e||A;var n=this;return ze(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 ze)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ke(t);t=[t]}return new Ne(t)}});var Je=Ue.prototype;Je.toJSON=Je.toJS,Je.__toJS=Je.toObject,Je.inspect=Je.toSource=function(){return""+this};var Be=function(){de.defaultSuperCall(this,Le.prototype,arguments)},Le=Be;de.createClass(Be,{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){return t.__iterate(function(t,n,r){return e(t[1],t[0],r)},n,r)},e},join:function(t){t=t||",";var e="",n=0;return this.forEach(function(r,i){var u=i-n;n=i,e+=(1===u?t:x(t,u))+r}),this.length&&this.length-1>n&&(e+=x(t,this.length-1-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 Ue(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){if(r&&!this.length)return this.cacheResult().__iterate(t,e,r);for(var i,u=0,s=r&&this.length-1,a=n.length-1,o=0;a>=o&&!i;o++){var h=n[e?a-o:o];h instanceof Le||(h=h.valueSeq()),u+=h.__iterate(function(e,n,a){return n+=u,t(e,r?s-n:n,a)===!1?(i=!0,!1):void 0},e)}return u},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:Ve.reverse.call(this,n)},n},valueSeq:function(){var t=de.superCall(this,Le.prototype,"valueSeq",[]);return t.length=void 0,t},filter:function(t,e,n){var r=D(this,t,e,n,n);return n&&(r.length=this.length),r},indexOf:function(t){return this.findIndex(function(e){return R(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=y(t,r.length),s=d(e,r.length);return i.length=r.length&&(n?r.length:s-u),i.__reversedIndices=r.__reversedIndices,i.__iterateUncached=function(i,a,o){if(a)return this.cacheResult().__iterate(i,a,o);var h=this.__reversedIndices^o;if(u!==u||s!==s||h&&null==r.length){var c=r.count();u=y(t,c),s=d(e,c)}var f=h?r.length-s:u,l=h?r.length-u:s,_=r.__iterate(function(t,e,r){return h?null!=l&&e>=l||e>=f&&i(t,n?e:e-f,r)!==!1:f>e||(null==l||l>e)&&i(t,n?e:e-f,r)!==!1
},a,o);return null!=this.length?this.length:n?_:Math.max(0,_-f)},i},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))},takeWhile:function(t,e,n){var r=this,i=r.__makeSequence();return i.__iterateUncached=function(u,s,a){if(s)return this.cacheResult().__iterate(u,s,a);var o=0,h=!0,c=r.__iterate(function(n,r,i){return t.call(e,n,r,i)&&u(n,r,i)!==!1?void(o=r):(h=!1,!1)},s,a);return n?i.length:h?c:o+1},n&&(i.length=this.length),i},skipWhile:function(t,e,n){var r=this,i=r.__makeSequence();return n&&(i.length=this.length),i.__iterateUncached=function(i,u,s){if(u)return this.cacheResult().__iterate(i,u,s);var a=r.__reversedIndices^s,o=!0,h=0,c=r.__iterate(function(r,u,a){return o&&(o=t.call(e,r,u,a),o||(h=u)),o||i(r,s||n?u:u-h,a)!==!1},u,s);return n?c:a?h+1:c-h},i},groupBy:function(t,e,n){var r=this,i=Sn.empty().withMutations(function(e){r.forEach(function(i,u,s){var a=t(i,u,s),o=e.get(a,ke);o===ke&&(o=Array(n?r.length:0),e.set(a,o)),n?o[u]=i:o.push(i)})});return i.map(function(t){return Ue(t)})},sortBy:function(t,e,n){var r=de.superCall(this,Le.prototype,"sortBy",[t,e]);return n||(r=r.valueSeq()),r.length=this.length,r},__makeSequence:function(){return g(this)}},{},Ue);var Ve=Be.prototype;Ve.__toJS=Ve.toArray,Ve.__toStringMapper=O;var Ke=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};de.createClass(Ke,{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}},{},Ue);var Ne=function(t){this._array=t,this.length=t.length};de.createClass(Ne,{toArray:function(){return this._array},__iterate:function(t,e,n){var r=this._array,i=r.length-1,u=-1;if(e){for(var s=i;s>=0;s--){if(r.hasOwnProperty(s)&&t(r[s],n?s:i-s,r)===!1)return u+1;
u=s}return r.length}var a=r.every(function(e,s){return t(e,n?i-s:s,r)===!1?!1:(u=s,!0)});return a?r.length:u+1}},{},Be),Ne.prototype.get=Ke.prototype.get,Ne.prototype.has=Ke.prototype.has;var Fe=function(){};de.createClass(Fe,{toString:function(){return"[Iterator]"}},{});var Ge=Fe.prototype;Ge[Oe]=b,Ge.inspect=Ge.toSource=function(){return""+this};var He=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Ue?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};de.createClass(He,{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),ke);return n===ke?e:j(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||Qe.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(j(r,n,e),n,i)},e,n):0}},{},Ue),He.prototype[qe]=He.prototype.remove,He.prototype.getIn=He.prototype.get;var Qe=function(t){var e=Te.empty();return t?t.constructor===Te?t:e.merge(t):e},Te=Qe;de.createClass(Qe,{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,ke)},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):Te.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 He(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 sn(this,0)},values:function(){return new sn(this,1)},entries:function(){return new sn(this,2)},__iterator:function(t){return new sn(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},__deepEqual:function(t){var e=this;return t.every(function(t,n){return R(e.get(n,ke),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?J(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return an||(an=J(0))}},Ue);var Xe=Qe.prototype;Xe[qe]=Xe.remove,Xe[Oe]=function(){return this.entries()},Qe.from=Qe;var Ye=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},Ze=Ye;de.createClass(Ye,{get:function(t,e,n,r){var i=1<<(e>>>t&Ie),u=this.bitmap;return 0===(u&i)?r:this.nodes[X(u&i-1)].get(t+we,e,n,r)},update:function(t,e,n,r,i,u,s){var a=n>>>e&Ie,o=1<<a,h=this.bitmap,c=0!==(h&o);if(!c&&i===ke)return this;var f=X(h&o-1),l=this.nodes,_=c?l[f]:null,v=L(_,t,e+we,n,r,i,u,s);if(v===_)return this;if(!c&&v&&l.length>=on)return F(t,l,h,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?h:h^o:h|o,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 Ze(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 $e=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},tn=$e;de.createClass($e,{get:function(t,e,n,r){var i=e>>>t&Ie,u=this.nodes[i];return u?u.get(t+we,e,n,r):r},update:function(t,e,n,r,i,u,s){var a=n>>>e&Ie,o=i===ke,h=this.nodes,c=h[a];if(o&&!c)return this;var f=L(c,t,e+we,n,r,i,u,s);if(f===c)return this;var l=this.count;if(c){if(!f&&(l--,hn>l))return N(t,h,l,a)}else l++;var _=t&&t===this.ownerID,v=Y(h,a,f,_);return _?(this.count=l,this.nodes=v,this):new tn(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 en=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},nn=en;de.createClass(en,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(R(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,o){var h=u===ke;if(n!==this.hash)return h?this:(i(o),i(a),K(this,t,e,n,[r,u]));for(var c=this.entries,f=0,l=c.length;l>f&&!R(r,c[f][0]);f++);var _=l>f;if(h&&!_)return this;if(i(o),(h||!_)&&i(a),h&&2===l)return new rn(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return _?h?f===l-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new nn(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 rn=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},un=rn;de.createClass(rn,{get:function(t,e,n,r){return R(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var o=u===ke,h=R(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 un(t,n,[r,u]):(i(s),K(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var sn=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&z(t._root)};de.createClass(sn,{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 U(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return U(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 U(t,u.entry);e=this._stack=z(u,e)}continue}e=this._stack=this._stack.__prev}return o()}},{},Fe);var an,on=Se/2,hn=Se/4,cn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return fn.from(t)},fn=cn;de.createClass(cn,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=he(t,this._origin),t>=this._size)return e;var n=se(this,t),r=t&Ie;return n&&(void 0===e||n.array.hasOwnProperty(r))?n.array[r]:e},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,ke)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=we,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):fn.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 oe(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return oe(this,t,e)},mergeDeep:function(){return oe(this,H(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return oe(this,H(t),e)},setLength:function(t){return ae(this,0,t)},slice:function(t,e,n){var r=de.superCall(this,fn.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(t){return new gn(this,0,t)},values:function(t){return new gn(this,1,t)},entries:function(t){return new gn(this,2,t)},__iterator:function(t,e,n){return new gn(this,2,n,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)},o=ce(this._size);return s=e?te(this._tail,0,o-this._origin,this._size-this._origin,a,e)&&te(this._root,this._level,-this._origin,o-this._origin,a,e):te(this._root,this._level,-this._origin,o-this._origin,a,e)&&te(this._tail,0,o-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&&R(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 pn||(pn=ne(0,0,we))},from:function(t){if(!t||0===t.length)return fn.empty();if(t.constructor===fn)return t;var e=Array.isArray(t);return t.length>0&&Se>t.length?ne(0,t.length,we,null,new _n(e?s(t):Ue(t).toArray())):(e||(t=Ue(t),t instanceof Be||(t=t.valueSeq())),fn.empty().merge(t))}},Be);var ln=cn.prototype;ln[qe]=ln.remove,ln[Oe]=ln.values,ln.update=Xe.update,ln.updateIn=Xe.updateIn,ln.cursor=Xe.cursor,ln.withMutations=Xe.withMutations,ln.asMutable=Xe.asMutable,ln.asImmutable=Xe.asImmutable,ln.wasAltered=Xe.wasAltered;var _n=function(t,e){this.array=t,this.ownerID=e},vn=_n;de.createClass(_n,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n>>>e&Ie;if(r>=this.array.length)return new vn([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-we,n),i===s&&u)return this}if(u&&!i)return this;var a=ue(this,t);if(!u)for(var o=0;r>o;o++)delete a.array[o];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&Ie;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-we,n),i===s&&u)return this}if(u&&!i)return this;var a=ue(this,t);return u||(a.array.length=r+1),i&&(a.array[r]=i),a}},{});var gn=function(t,e,n,r,i){this._type=e,this._sparse=!!n,this._reverse=!!r,this._flipIndices=!!(i^r),this._maxIndex=t.length-1;
var u=ce(t._size),s=ee(t._root&&t._root.array,t._level,-t._origin,u-t._origin-1),a=ee(t._tail&&t._tail.array,0,u-t._origin,t._size-t._origin-1);this._stack=r?a:s,this._stack.__prev=r?s:a};de.createClass(gn,{next:function(){for(var t=this._sparse,e=this._stack;e;){var n=e.array,r=e.index++;if(this._reverse&&(r=Ie-r,r>e.rawMax&&(r=e.rawMax,e.index=Se-r)),r>=0&&Se>r&&e.rawMax>=r){var i=n&&n[r];if(0===e.level){if(!t||null!=i||n&&n.length>r&&n.hasOwnProperty(r)){var u,s=this._type;return 1!==s&&(u=e.offset+(r<<e.level),this._flipIndices&&(u=this._maxIndex-u)),a(0===s?u:1===s?i:[u,i])}}else t&&null==i||(this._stack=e=ee(i&&i.array,e.level-we,e.offset+(r<<e.level),e.max,e))}else e=this._stack=this._stack.__prev}return o()}},{},Fe);var pn,mn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return yn.from(t)},yn=mn;de.createClass(mn,{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:fe(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?yn.empty():fe(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):yn.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var n=0;t.length>n;n++)Ue(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 Ue(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 Ue(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=Ue(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=Ue(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()},equals:function(t){return this._map.equals(t._map)},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?fe(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return wn||(wn=fe(Qe.empty()))},from:function(t){var e=yn.empty();return t?t.constructor===yn?t:e.union(t):e},fromKeys:function(t){return yn.from(Ue(t).flip())}},Ue);var dn=mn.prototype;dn[qe]=dn.remove,dn[Oe]=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=Xe.withMutations,dn.asMutable=Xe.asMutable,dn.asImmutable=Xe.asImmutable,dn.__toJS=Ve.__toJS,dn.__toStringMapper=Ve.__toStringMapper;var wn,Sn=function(t){var e=In.empty();return t?t.constructor===In?t:e.merge(t):e},In=Sn;de.createClass(Sn,{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):In.empty()},set:function(t,e){return _e(this,t,e)},remove:function(t){return _e(this,t,ke)},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)
},__deepEqual:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&R(r[0],n)&&R(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 kn||(kn=le(Qe.empty(),cn.empty()))}},Qe),Sn.from=Sn,Sn.prototype[qe]=Sn.prototype.remove;var kn,bn=function(t,e){var n=function(t){return this instanceof n?void(this._map=Qe(t)):new n(t)};t=Ue(t);var r=n.prototype=Object.create(Dn);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},Mn=bn;de.createClass(bn,{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=ve(this,Qe.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:ve(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:ve(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?ve(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},Ue);
var Dn=bn.prototype;Dn[qe]=Dn.remove,Dn[Oe]=Xe[Oe],Dn.merge=Xe.merge,Dn.mergeWith=Xe.mergeWith,Dn.mergeDeep=Xe.mergeDeep,Dn.mergeDeepWith=Xe.mergeDeepWith,Dn.update=Xe.update,Dn.updateIn=Xe.updateIn,Dn.cursor=Xe.cursor,Dn.withMutations=Xe.withMutations,Dn.asMutable=Xe.asMutable,Dn.asImmutable=Xe.asImmutable,Dn.__deepEqual=Xe.__deepEqual;var qn=function(t,e,n){return this instanceof On?(h(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 On(t,e,n)},On=qn;de.createClass(qn,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return h(t>=0,"Index out of bounds"),this.length>t},get:function(t,e){return h(t>=0,"Index out of bounds"),1/0===this.length||this.length>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,On.prototype,"slice",[t,e,n]):(t=y(t,this.length),e=d(e,this.length),t>=e?An:new On(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,On.prototype,"skip",[t]):this.slice(t)},__iterate:function(t,e,n){for(var r=e^n,i=this.length-1,u=this._step,s=e?this._start+i*u:this._start,a=0;i>=a&&t(s,r?i-a:a,this)!==!1;a++)s+=e?-u:u;return r?this.length:a},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step}},{},Be);var xn=qn.prototype;xn.__toJS=xn.toArray,xn.first=ln.first,xn.last=ln.last;var An=qn(0,0),Cn=function(t,e){return 0===e&&Pn?Pn:this instanceof En?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new En(t,e)
},En=Cn;de.createClass(Cn,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return h(t>=0,"Index out of bounds"),1/0===this.length||this.length>t?this._value:e},first:function(){return this._value},contains:function(t){return R(this._value,t)},slice:function(t,e,n){if(n)return de.superCall(this,En.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 En(this._value,e-t):Pn},reverse:function(t){return t?de.superCall(this,En.prototype,"reverse",[t]):this},indexOf:function(t){return R(this._value,t)?0:-1},lastIndexOf:function(t){return R(this._value,t)?this.length:-1},__iterate:function(t,e,n){var r=e^n;h(!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 R(this._value,t._value)}},{},Be);var jn=Cn.prototype;jn.last=jn.first,jn.has=xn.has,jn.take=xn.take,jn.skip=xn.skip,jn.__toJS=xn.__toJS;var Pn=new Cn(void 0,0),Wn={Sequence:Ue,Map:Qe,Vector:cn,Set:mn,OrderedMap:Sn,Record:bn,Range:qn,Repeat:Cn,is:R,fromJS:ge};return Wn}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();