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 3.2.1 to 3.3.0

7

contrib/cursor/__tests__/Cursor.ts

@@ -45,2 +45,9 @@ ///<reference path='../../../resources/jest.d.ts'/>

it('gets return new cursors using List', () => {
var data = Immutable.fromJS(json);
var cursor = Cursor.from(data);
var deepCursor = cursor.getIn(Immutable.fromJS(['a', 'b']));
expect(deepCursor.deref()).toBe(data.getIn(Immutable.fromJS(['a', 'b'])));
});
it('can be treated as a value', () => {

@@ -47,0 +54,0 @@ var data = Immutable.fromJS(json);

1

contrib/cursor/index.d.ts

@@ -89,2 +89,3 @@ /**

getIn(keyPath: Array<any>, notSetValue?: any): any;
getIn(keyPath: Immutable.Iterable<any, any>, notSetValue?: any): any;

@@ -91,0 +92,0 @@ /**

10

contrib/cursor/index.js

@@ -78,6 +78,12 @@ /**

KeyedCursorPrototype.get =
IndexedCursorPrototype.get = function(key, notSetValue) {
return this.getIn([key], notSetValue);
}
KeyedCursorPrototype.getIn =
IndexedCursorPrototype.get =
IndexedCursorPrototype.getIn = function(key, notSetValue) {
if (Array.isArray(key) && key.length === 0) {
if (!Array.isArray(key)) {
key = Immutable.Iterable(key).toArray();
}
if (key.length === 0) {
return this;

@@ -84,0 +90,0 @@ }

@@ -9,27 +9,28 @@ /**

*/
function t(){function t(t,e,r,n){var i;if(n){var u=n.prototype;i=yr.create(u)}else i=t.prototype;return yr.keys(e).forEach(function(t){i[t]=e[t]}),yr.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return yr.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t&&"function"==typeof t.equals?t.equals(e):!1}function i(t,e){if(!t)throw Error(e)}function u(t){return t.value=!1,t}function s(t){t&&(t.value=!0)}function o(){}function a(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function h(t){i(1/0!==t,"Cannot perform this action with an infinite size.")}function c(t){return void 0===t.size&&(t.size=t.__iterate(_)),t.size}function f(t,e){return e>=0?+e:c(t)+ +e}function _(){return!0}function l(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function v(t,e){return d(t,e,0)}function p(t,e){return d(t,e,e)}function d(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function y(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&kr;t=""+t,e="string"}return"string"===e?t.length>Or?g(t):m(t):t.hashCode?y("function"==typeof t.hashCode?t.hashCode():t.hashCode):w(t)}function g(t){var e=jr[t];return void 0===e&&(e=m(t),Cr===Ar&&(Cr=0,jr={}),Cr++,jr[t]=e),e}function m(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)&kr;return e}function w(t){var e=Mr&&Mr.get(t);if(e)return e;if(e=t[Er])return e;if(!xr){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Er])return e;if(e=S(t))return e}if(Object.isExtensible&&!Object.isExtensible(t))throw Error("Non-extensible objects are not allowed as keys.");if(e=++Dr&kr,Mr)Mr.set(t,e);else if(xr)Object.defineProperty(t,Er,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)
},t.propertyIsEnumerable[Er]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Er]=e}return e}function S(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function x(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(Tr&&t[Tr]||t[Lr]);return"function"==typeof e?e:void 0}function k(t){return!(!t||!t[Vr])}function D(t){return!(!t||!t[Nr])}function E(t){return!(!t||!t[Yr])}function O(t){return D(t)||E(t)}function A(t){return!(!t||!t[Qr])}function C(t,e){return e}function j(t,e){return[e,t]}function R(t){return function(){return!t.apply(this,arguments)}}function K(t){return function(){return-t.apply(this,arguments)}}function U(t){return"string"==typeof t?JSON.stringify(t):t}function L(t,e){return t>e?-1:e>t?1:0}function T(t,e){var r=!O(t)&&!O(e);if(A(t)){if(!A(e))return!1;var i=t.entries();return e.every(function(t,e){var u=i.next().value;return u&&n(u[1],t)&&(r||n(u[0],e))})&&i.next().done}var u=!1;if(void 0===t.size)if(void 0===e.size)t.cacheResult();else{u=!0;var s=t;t=e,e=s}var o=!0,a=e.__iterate(function(e,i){return(r?t.has(e):u?n(e,t.get(i,Ir)):n(t.get(i,Ir),e))?void 0:(o=!1,!1)});return o&&t.size===a}function B(t,e){var r=t.prototype,n=function(t){r[t]=e[t]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function W(t){return!(!t||!t[hn])}function J(){return vn||(vn=new cn([]))}function P(t){var e=Array.isArray(t)?new cn(t).fromEntrySeq():q(t)?new ln(t).fromEntrySeq():b(t)?new _n(t).fromEntrySeq():"object"==typeof t?new fn(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function H(t){var e=N(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);
return e}function V(t){var e=N(t)||"object"==typeof t&&new fn(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function N(t){return Y(t)?new cn(t):q(t)?new ln(t):b(t)?new _n(t):void 0}function Y(t){return t&&"number"==typeof t.length}function Q(t,e,r,n){h(t.size);var i=t._cache;if(i){for(var u=i.length-1,s=0;u>=s;s++){var o=i[r?u-s:s];if(e(o[1],n?o[0]:s,t)===!1)return s+1}return s}return t.__iterateUncached(e,r)}function X(t,e,r,n){var i=t._cache;if(i){var u=i.length-1,s=0;return new Wr(function(){var t=i[r?u-s:s];return s++>u?I():z(e,n?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,r)}function F(t,e){return e?G(e,t,"",{"":t}):Z(t)}function G(t,e,r,n){return Array.isArray(e)?t.call(n,r,un(e).map(function(r,n){return G(t,r,n,e)})):$(e)?t.call(n,r,rn(e).map(function(r,n){return G(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?un(t).map(Z).toList():$(t)?rn(t).map(Z).toMap():t}function $(t){return t&&t.constructor===Object}function te(t){return!(!t||!t[In])}function ee(t,e){return z(t,e[0],e[1])}function re(t,e){return{node:t,index:0,__prev:e}}function ne(t,e,r,n){var i=Object.create(bn);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ie(){return Kn||(Kn=ne(0))}function ue(t,e,r){var n,i;if(t._root){var s=u(br),o=u(qr);if(n=se(t._root,t.__ownerID,0,void 0,e,r,s,o),!o.value)return t;i=t.size+(s.value?r===Ir?-1:1:0)}else{if(r===Ir)return t;i=1,n=new qn(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?ne(i,n):ie()}function se(t,e,r,n,i,u,o,a){return t?t.update(e,r,n,i,u,o,a):u===Ir?t:(s(a),s(o),new Cn(e,n,[i,u]))}function oe(t){return t.constructor===Cn||t.constructor===On}function ae(t,e,r,n,i){if(t.keyHash===n)return new On(e,n,[t.entry,i]);var u,s=(0===r?t.keyHash:t.keyHash>>>r)&zr,o=(0===r?n:n>>>r)&zr,a=s===o?[ae(t,e,r+wr,n,i)]:(u=new Cn(e,n,i),o>s?[t,u]:[u,t]);return new Mn(e,1<<s|1<<o,a)}function he(t,e,r,n){t||(t=new o);for(var i=new Cn(t,y(r),[r,n]),u=0;e.length>u;u++){var s=e[u];
i=i.update(t,0,void 0,s[0],s[1])}return i}function ce(t,e,r,n){for(var i=0,u=0,s=Array(r),o=0,a=1,h=e.length;h>o;o++,a<<=1){var c=e[o];void 0!==c&&o!==n&&(i|=a,s[u++]=c)}return new Mn(t,i,s)}function fe(t,e,r,n,i){for(var u=0,s=Array(Sr),o=0;0!==r;o++,r>>>=1)s[o]=1&r?e[u++]:void 0;return s[n]=i,new Dn(t,u+1,s)}function _e(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i],s=Fr(u);k(u)||(s=s.map(function(t){return F(t)})),n.push(s)}return ve(t,e,n)}function le(t){return function(e,r){return e&&e.mergeDeepWith&&k(r)?e.mergeDeepWith(t,r):t?t(e,r):r}}function ve(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,Ir,function(t){return t===Ir?r:e(t,r)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function pe(t,e,r,n,u){i(!t||t.set,"updateIn with invalid keyPath");var s=e[u],o=t?t.get(s,Ir):Ir,a=o===Ir?void 0:o,h=u===e.length-1?n(o===Ir?r:o):pe(a,e,r,n,u+1);return h===a?t:h===Ir?t&&t.remove(s):(t||ie()).set(s,h)}function de(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 ye(t,e,r,n){var i=n?t:a(t);return i[e]=r,i}function ge(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var u=Array(i),s=0,o=0;i>o;o++)o===e?(u[o]=r,s=-1):u[o]=t[o+s];return u}function me(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),u=0,s=0;n>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function we(t){var e=Be(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.cacheResult=We,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Ur){var n=t.__iterator(e,r);return new Wr(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Kr?Rr:Kr,r)},e}function Se(t,e,r){var n=Be(t);
return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,Ir);return u===Ir?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var u=this;return t.__iterate(function(t,i,s){return n(e.call(r,t,i,s),i,u)!==!1},i)},n.__iteratorUncached=function(n,i){var u=t.__iterator(Ur,i);return new Wr(function(){var i=u.next();if(i.done)return i;var s=i.value,o=s[0];return z(n,o,e.call(r,s[1],o,t),i)})},n}function ze(t,e){var r=Be(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=we(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=We,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function Ie(t,e,r,n){var i=Be(t);return n&&(i.has=function(n){var i=t.get(n,Ir);return i!==Ir&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,Ir);return u!==Ir&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,u){var s=this,o=0;return t.__iterate(function(t,u,a){return e.call(r,t,u,a)?(o++,i(t,n?u:o-1,s)):void 0},u),o},i.__iteratorUncached=function(i,u){var s=t.__iterator(Ur,u),o=0;return new Wr(function(){for(;;){var u=s.next();if(u.done)return u;var a=u.value,h=a[0],c=a[1];if(e.call(r,c,h,t))return z(i,n?h:o++,c,u)}})},i}function be(t,e,r){var n=zn().asMutable();return t.__iterate(function(i,u){n.update(e.call(r,i,u,t),0,function(t){return t+1})}),n.asImmutable()}function qe(t,e,r){var n=D(t),i=zn().asMutable();t.__iterate(function(u,s){i.update(e.call(r,u,s,t),[],function(t){return t.push(n?[s,u]:u),t})});var u=Te(t);return i.map(function(e){return Ke(t,u(e))})}function xe(t,e){if(e>t.size)return t;0>e&&(e=0);var r=Be(t);return r.size=t.size&&Math.min(t.size,e),r.__iterateUncached=function(r,n){var i=this;if(0===e)return 0;if(n)return this.cacheResult().__iterate(r,n);var u=0;return t.__iterate(function(t,n){return++u&&r(t,n,i)!==!1&&e>u
}),u},r.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=e&&t.__iterator(r,n),u=0;return new Wr(function(){return u++>e?I():i.next()})},r}function Me(t,e,r){var n=Be(t);return n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0;return t.__iterate(function(t,i,o){return e.call(r,t,i,o)&&++s&&n(t,i,u)}),s},n.__iteratorUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterator(n,i);var s=t.__iterator(Ur,i),o=!0;return new Wr(function(){if(!o)return I();var t=s.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,u)?n===Ur?t:z(n,a,h,t):(o=!1,I())})},n}function ke(t,e,r){if(0>=e)return t;var n=Be(t);return n.size=t.size&&Math.max(0,t.size-e),n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0,o=!0,a=0;return t.__iterate(function(t,i){return o&&(o=s++<e)?void 0:(a++,n(t,r?i:a-1,u))}),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var u=e&&t.__iterator(n,i),s=0,o=0;return new Wr(function(){for(;e>s;)s++,u.next();var t=u.next();return r||n===Kr?t:n===Rr?z(n,o++,void 0,t):z(n,o++,t.value[1],t)})},n}function De(t,e,r,n){var i=Be(t);return i.__iterateUncached=function(i,u){var s=this;if(u)return this.cacheResult().__iterate(i,u);var o=!0,a=0;return t.__iterate(function(t,u,h){return o&&(o=e.call(r,t,u,h))?void 0:(a++,i(t,n?u:a-1,s))}),a},i.__iteratorUncached=function(i,u){var s=this;if(u)return this.cacheResult().__iterator(i,u);var o=t.__iterator(Ur,u),a=!0,h=0;return new Wr(function(){var t,u,c;do{if(t=o.next(),t.done)return n||i===Kr?t:i===Rr?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var f=t.value;u=f[0],c=f[1],a&&(a=e.call(r,c,u,s))}while(a);return i===Ur?t:z(i,u,c,t)})},i}function Ee(t,e){var r=D(t),n=new cn([t].concat(e)).map(function(t){return k(t)?r&&(t=Fr(t)):t=r?P(t):H(Array.isArray(t)?t:[t]),t});r?n=n.toKeyedSeq():E(t)||(n=n.toSetSeq());var i=n.flatten(!0);return i.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;
if(void 0!==r)return t+r}},0),i}function Oe(t,e,r){var n=Be(t);return n.__iterateUncached=function(n,i){function u(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&k(t)?u(t,a+1):n(t,r?i:s++,h)===!1&&(o=!0),!o},i)}var s=0,o=!1;return u(t,0),s},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),s=[],o=0;return new Wr(function(){for(;u;){var t=u.next();if(t.done===!1){var a=t.value;if(n===Ur&&(a=a[1]),e&&!(e>s.length)||!k(a))return r?t:z(n,o++,a,t);s.push(u),u=a.__iterator(n,i)}else u=s.pop()}return I()})},n}function Ae(t,e,r){var n=Te(t);return t.toSeq().map(function(i,u){return n(e.call(r,i,u,t))}).flatten(!0)}function Ce(t,e){var r=Be(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,u=0;return t.__iterate(function(t){return(!u||r(e,u++,i)!==!1)&&r(t,u++,i)!==!1},n),u},r.__iteratorUncached=function(r,n){var i,u=t.__iterator(Kr,n),s=0;return new Wr(function(){return(!i||s%2)&&(i=u.next(),i.done)?i:s%2?z(r,s++,e):z(r,s++,i.value,i)})},r}function je(t,e,r){e||(e=Je);var n=D(t),i=0,u=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return u.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),n?rn(u):E(t)?un(u):on(u)}function Re(t,e,r){if(e||(e=Je),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return e(r[1],t[1])>0?r:t});return n&&n[0]}return t.reduce(function(t,r){return e(r,t)>0?r:t})}function Ke(t,e){return W(t)?e:t.constructor(e)}function Ue(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Le(t){return h(t.size),c(t)}function Te(t){return D(t)?Fr:E(t)?Zr:$r}function Be(t){return Object.create((D(t)?rn:E(t)?un:on).prototype)}function We(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):tn.prototype.cacheResult.call(this)}function Je(t,e){return t>e?1:e>t?-1:0}function Pe(t){return!(!t||!t[Vn])}function He(t,e,r,n,i,u){var s,o=t&&t.array;if(0===e){var a=0>r?-r:0,h=n-r;for(h>Sr&&(h=Sr),s=a;h>s;s++)if(i(o&&o[u?a+h-1-s:s])===!1)return!1
}else{var c=1<<e,f=e-wr;for(s=0;zr>=s;s++){var _=u?zr-s:s,l=r+(_<<e);if(n>l&&l+c>0){var v=o&&o[_];if(!He(v,f,l,n,i,u))return!1}}}return!0}function Ve(t,e,r,n,i){return{array:t,level:e,offset:r,max:n,rawMax:n-r>>e,index:0,__prev:i}}function Ne(t,e,r,n,i,u,s){var o=Object.create(Nn);return o.size=e-t,o._origin=t,o._capacity=e,o._level=r,o._root=n,o._tail=i,o.__ownerID=u,o.__hash=s,o.__altered=!1,o}function Ye(){return Fn||(Fn=Ne(0,0,wr))}function Qe(t,e,r){if(e=f(t,e),e>=t.size||0>e)return t.withMutations(function(t){0>e?Ze(t,e).set(0,r):Ze(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,s=u(qr);return e>=tr(t._capacity)?n=Xe(n,t.__ownerID,0,e,r,s):i=Xe(i,t.__ownerID,t._level,e,r,s),s.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Ne(t._origin,t._capacity,t._level,i,n):t}function Xe(t,e,r,n,i,u){var o=n>>>r&zr,a=t&&t.array.length>o;if(!a&&void 0===i)return t;var h;if(r>0){var c=t&&t.array[o],f=Xe(c,e,r-wr,n,i,u);return f===c?t:(h=Fe(t,e),h.array[o]=f,h)}return a&&t.array[o]===i?t:(s(u),h=Fe(t,e),void 0===i&&o===h.array.length-1?h.array.pop():h.array[o]=i,h)}function Fe(t,e){return e&&t&&e===t.ownerID?t:new Yn(t?t.array.slice():[],e)}function Ge(t,e){if(e>=tr(t._capacity))return t._tail;if(1<<t._level+wr>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&zr],n-=wr;return r}}function Ze(t,e,r){var n=t.__ownerID||new o,i=t._origin,u=t._capacity,s=i+e,a=void 0===r?u:0>r?u+r:i+r;if(s===i&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Yn(c&&c.array.length?[void 0,c]:[],n),h+=wr,f+=1<<h;f&&(s+=f,i+=f,a+=f,u+=f);for(var _=tr(u),l=tr(a);l>=1<<h+wr;)c=new Yn(c&&c.array.length?[c]:[],n),h+=wr;var v=t._tail,p=_>l?Ge(t,a-1):l>_?new Yn([],n):v;if(v&&l>_&&u>s&&v.array.length){c=Fe(c,n);for(var d=c,y=h;y>wr;y-=wr){var g=_>>>y&zr;d=d.array[g]=Fe(d.array[g],n)}d.array[_>>>wr&zr]=v}if(u>a&&(p=p&&p.removeAfter(n,0,a)),s>=l)s-=l,a-=l,h=wr,c=null,p=p&&p.removeBefore(n,0,s);else if(s>i||_>l){for(f=0;c;){var m=s>>>h&zr;if(m!==l>>>h&zr)break;m&&(f+=(1<<h)*m),h-=wr,c=c.array[m]
}c&&s>i&&(c=c.removeBefore(n,h,s-f)),c&&_>l&&(c=c.removeAfter(n,h,l-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=c,t._tail=p,t.__hash=void 0,t.__altered=!0,t):Ne(s,a,h,c,p)}function $e(t,e,r){for(var n=[],i=0,u=0;r.length>u;u++){var s=r[u],o=Zr(s);o.size>i&&(i=o.size),k(s)||(o=o.map(function(t){return F(t)})),n.push(o)}return i>t.size&&(t=t.setSize(i)),ve(t,e,n)}function tr(t){return Sr>t?0:t-1>>>wr<<wr}function er(t){return te(t)&&A(t)}function rr(t,e,r,n){var i=Object.create(Gn.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function nr(){return Zn||(Zn=rr(ie(),Ye()))}function ir(t,e,r){var n,i,u=t._map,s=t._list,o=u.get(e),a=void 0!==o;if(r===Ir){if(!a)return t;s.size>=Sr&&s.size>=2*u.size?(i=s.filter(function(t,e){return void 0!==t&&o!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=u.remove(e),i=o===s.size-1?s.pop():s.set(o,void 0))}else if(a){if(r===s.get(o)[1])return t;n=u,i=s.set(o,[e,r])}else n=u.set(e,s.size),i=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):rr(n,i)}function ur(t){return!(!t||!t[ei])}function sr(t,e,r,n){var i=Object.create(ri);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function or(){return ni||(ni=sr(0))}function ar(t){return!(!t||!t[ui])}function hr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function cr(t,e){var r=Object.create(si);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function fr(){return oi||(oi=cr(ie()))}function _r(t){return ar(t)&&A(t)}function lr(t,e){var r=Object.create(hi);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function vr(){return ci||(ci=lr(nr()))}function pr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function dr(t){return t._name||t.constructor.name}var yr=Object,gr={};gr.createClass=t,gr.superCall=e,gr.defaultSuperCall=r;var mr="delete",wr=5,Sr=1<<wr,zr=Sr-1,Ir={},br={value:!1},qr={value:!1},xr=function(){try{return Object.defineProperty({},"x",{}),!0
}catch(t){return!1}}(),Mr="function"==typeof WeakMap&&new WeakMap,kr=2147483647,Dr=0,Er="__immutablehash__";"function"==typeof Symbol&&(Er=Symbol(Er));var Or=16,Ar=255,Cr=0,jr={},Rr=0,Kr=1,Ur=2,Lr="@@iterator",Tr="function"==typeof Symbol&&Symbol.iterator,Br=Tr||Lr,Wr=function(t){this.next=t};gr.createClass(Wr,{toString:function(){return"[Iterator]"}},{}),Wr.KEYS=Rr,Wr.VALUES=Kr,Wr.ENTRIES=Ur;var Jr=Wr.prototype;Jr.inspect=Jr.toSource=function(){return""+this},Jr[Br]=function(){return this};var Pr=function(t){return k(t)?t:tn(t)},Hr=Pr;gr.createClass(Pr,{toArray:function(){h(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new Wn(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toKeyedSeq:function(){return new Bn(this,!0)},toMap:function(){return h(this.size),zn(this.toKeyedSeq())},toObject:function(){h(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return h(this.size),Gn(this.toKeyedSeq())},toOrderedSet:function(){return h(this.size),ai(D(this)?this.valueSeq():this)},toSet:function(){return h(this.size),ii(D(this)?this.valueSeq():this)},toSetSeq:function(){return new Jn(this)},toSeq:function(){return E(this)?this.toIndexedSeq():D(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return h(this.size),$n(D(this)?this.valueSeq():this)},toList:function(){return h(this.size),Hn(D(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Ke(this,Ee(this,t))},contains:function(t){return this.some(function(e){return n(e,t)})},entries:function(){return this.__iterator(Ur)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Ke(this,Ie(this,t,e,!0))
},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(Rr)},map:function(t,e){return Ke(this,Se(this,t,e))},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,s){i?(i=!1,n=e):n=t.call(r,n,e,u,s)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return Ke(this,ze(this,!0))},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(r!==r||n!==n)return this.toSeq().cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return Ke(this,void 0===n||n===this.size?i:i.take(n-r))},some:function(t,e){return!this.every(R(t),e)},sort:function(t){return Ke(this,je(this,t))},values:function(){return this.__iterator(Kr)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return be(this,t,e)},equals:function(t){if(this===t)return!0;if(!t||"function"!=typeof t.equals)return!1;if(void 0!==this.size&&void 0!==t.size){if(this.size!==t.size)return!1;if(0===this.size&&0===t.size)return!0}return void 0!==this.__hash&&void 0!==t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t)},__deepEquals:function(t){return T(this,t)},entrySeq:function(){var t=this;if(t._cache)return new cn(t._cache);var e=t.toSeq().map(j).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(R(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(_)},flatMap:function(t,e){return Ke(this,Ae(this,t,e))},flatten:function(t){return Ke(this,Oe(this,t,!0))},fromEntrySeq:function(){return new Pn(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)
},void 0,e)},getIn:function(t,e){var r=this;if(t)for(var n=0;t.length>n;n++)if(r=r&&r.get?r.get(t[n],Ir):Ir,r===Ir)return e;return r},groupBy:function(t,e){return qe(this,t,e)},has:function(t){return this.get(t,Ir)!==Ir},isSubset:function(t){return t="function"==typeof t.contains?t:Hr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(C).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Re(this,t)},maxBy:function(t,e){return Re(this,e,t)},min:function(t){return Re(this,t?K(t):L)},minBy:function(t,e){return Re(this,e?K(e):L,t)},rest:function(){return this.slice(1)},skip:function(t){return Ke(this,ke(this,t,!0))},skipLast:function(t){return Ke(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Ke(this,De(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(R(t),e)},sortBy:function(t,e){return Ke(this,je(this,e,t))},take:function(t){return Ke(this,xe(this,t))},takeLast:function(t){return Ke(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Ke(this,Me(this,t,e))},takeUntil:function(t,e){return this.takeWhile(R(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=1/0===this.size?0:this.reduce(function(t,e,r){return t+(y(e)^(e===r?0:y(r)))&kr},0))}},{});var Vr="@@__IMMUTABLE_ITERABLE__@@",Nr="@@__IMMUTABLE_KEYED__@@",Yr="@@__IMMUTABLE_INDEXED__@@",Qr="@@__IMMUTABLE_ORDERED__@@",Xr=Pr.prototype;Xr[Vr]=!0,Xr[Br]=Xr.values,Xr.toJSON=Xr.toJS,Xr.__toJS=Xr.toArray,Xr.__toStringMapper=U,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,function(){try{Object.defineProperty(Xr,"length",{get:function(){if(!Pr.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size
}}})}catch(t){}}();var Fr=function(t){return D(t)?t:rn(t)};gr.createClass(Fr,{flip:function(){return Ke(this,we(this))},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0}),r},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return n(e,t)})},lastKeyOf:function(t){return this.toSeq().reverse().keyOf(t)},mapEntries:function(t,e){var r=this,n=0;return Ke(this,this.toSeq().map(function(i,u){return t.call(e,[u,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Ke(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}},{},Pr);var Gr=Fr.prototype;Gr[Nr]=!0,Gr[Br]=Xr.entries,Gr.__toJS=Xr.toObject,Gr.__toStringMapper=function(t,e){return e+": "+U(t)};var Zr=function(t){return E(t)?t:un(t)};gr.createClass(Zr,{toKeyedSeq:function(){return new Bn(this,!1)},filter:function(t,e){return Ke(this,Ie(this,t,e,!1))},findIndex:function(t,e){var r=this.toKeyedSeq().findKey(t,e);return void 0===r?-1:r},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Ke(this,ze(this,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=v(t,this.size);var n=this.slice(0,t);return Ke(this,1===r?n:n.concat(a(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Ke(this,Oe(this,t,!1))},get:function(t,e){return t=f(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=f(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return Ke(this,Ce(this,t))},last:function(){return this.get(-1)},skip:function(t){var e=this,r=ke(e,t,!1);return W(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0?e.get(r+t,n):n
}),Ke(this,r)},skipWhile:function(t,e){return Ke(this,De(this,t,e,!1))},take:function(t){var e=this,r=xe(e,t);return W(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0&&t>r?e.get(r,n):n}),Ke(this,r)}},{},Pr),Zr.prototype[Yr]=!0,Zr.prototype[Qr]=!0;var $r=function(t){return k(t)&&!O(t)?t:on(t)};gr.createClass($r,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}},{},Pr),$r.prototype.has=Xr.contains,Pr.isIterable=k,Pr.isKeyed=D,Pr.isIndexed=E,Pr.isAssociative=O,Pr.isOrdered=A,Pr.Keyed=Fr,Pr.Indexed=Zr,Pr.Set=$r,Pr.Iterator=Wr;var tn=function(t){return null===t||void 0===t?J():k(t)?t.toSeq():V(t)},en=tn;gr.createClass(tn,{toSeq:function(){return this},toString:function(){return this.__toString("Seq {","}")},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},__iterate:function(t,e){return Q(this,t,e,!0)},__iterator:function(t,e){return X(this,t,e,!0)}},{of:function(){return en(arguments)}},Pr);var rn=function(t){return null===t||void 0===t?J().toKeyedSeq():k(t)?D(t)?t.toSeq():t.fromEntrySeq():P(t)},nn=rn;gr.createClass(rn,{toKeyedSeq:function(){return this},toSeq:function(){return this}},{of:function(){return nn(arguments)}},tn),B(rn,Fr.prototype);var un=function(t){return null===t||void 0===t?J():k(t)?D(t)?t.entrySeq():t.toIndexedSeq():H(t)},sn=un;gr.createClass(un,{toIndexedSeq:function(){return this},toString:function(){return this.__toString("Seq [","]")},__iterate:function(t,e){return Q(this,t,e,!1)},__iterator:function(t,e){return X(this,t,e,!1)}},{of:function(){return sn(arguments)}},tn),B(un,Zr.prototype);var on=function(t){return(null===t||void 0===t?J():k(t)?D(t)?t.entrySeq():t:H(t)).toSetSeq()},an=on;gr.createClass(on,{toSetSeq:function(){return this}},{of:function(){return an(arguments)}},tn),B(on,$r.prototype),tn.isSeq=W,tn.Keyed=rn,tn.Set=on,tn.Indexed=un;var hn="@@__IMMUTABLE_SEQ__@@";tn.prototype[hn]=!0;var cn=function(t){this._array=t,this.size=t.length
};gr.createClass(cn,{get:function(t,e){return this.has(t)?this._array[f(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;return new Wr(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})}},{},un);var fn=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length};gr.createClass(fn,{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 r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var s=n[e?i-u:u];if(t(r[s],s,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new Wr(function(){var s=n[e?i-u:u];return u++>i?I():z(t,s,r[s])})}},{},rn),fn.prototype[Qr]=!0;var _n=function(t){this._iterable=t,this.size=t.length||t.size};gr.createClass(_n,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=x(r),i=0;if(q(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=x(r);if(!q(n))return new Wr(I);var i=0;return new Wr(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})}},{},un);var ln=function(t){this._iterator=t,this._iteratorCache=[]};gr.createClass(ln,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var s=u.value;if(n[i]=s,t(s,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Wr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})}},{},un);var vn,pn=function(){throw TypeError("Abstract")};gr.createClass(pn,{},{},Pr);
var dn=function(){gr.defaultSuperCall(this,yn.prototype,arguments)},yn=dn;gr.createClass(dn,{},{},pn),B(dn,Fr.prototype);var gn=function(){gr.defaultSuperCall(this,mn.prototype,arguments)},mn=gn;gr.createClass(gn,{},{},pn),B(gn,Zr.prototype);var wn=function(){gr.defaultSuperCall(this,Sn.prototype,arguments)},Sn=wn;gr.createClass(wn,{},{},pn),B(wn,$r.prototype),pn.Keyed=dn,pn.Indexed=gn,pn.Set=wn;var zn=function(t){return null===t||void 0===t?ie():te(t)?t:ie().merge(Fr(t))};gr.createClass(zn,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,void 0,t,e):e},set:function(t,e){return ue(this,t,e)},setIn:function(t,e){return i(t.length>0,"Requires non-empty key path."),this.updateIn(t,function(){return e})},remove:function(t){return ue(this,t,Ir)},removeIn:function(t){return i(t.length>0,"Requires non-empty key path."),this.updateIn(t,function(){return Ir})},update:function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},updateIn:function(t,e,r){return r||(r=e,e=void 0),0===t.length?r(this):pe(this,t,e,r,0)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ie()},merge:function(){return _e(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return _e(this,t,e)},mergeDeep:function(){return _e(this,le(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return _e(this,le(t),e)},sort:function(t){return Gn(je(this,t))},sortBy:function(t,e){return Gn(je(this,e,t))},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 o)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new Rn(this,t,e)},__iterate:function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)
},e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?ne(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{},dn),zn.isMap=te;var In="@@__IMMUTABLE_MAP__@@",bn=zn.prototype;bn[In]=!0,bn[mr]=bn.remove;var qn=function(t,e){this.ownerID=t,this.entries=e},xn=qn;gr.createClass(qn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){for(var c=u===Ir,f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),!c||1!==f.length){if(!v&&!c&&f.length>=Un)return he(t,f,i,u);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new xn(t,d)}}},{});var Mn=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},kn=Mn;gr.createClass(Mn,{get:function(t,e,r,n){void 0===e&&(e=y(r));var i=1<<((0===t?e:e>>>t)&zr),u=this.bitmap;return 0===(u&i)?n:this.nodes[de(u&i-1)].get(t+wr,e,r,n)},update:function(t,e,r,n,i,u,s){void 0===r&&(r=y(n));var o=(0===e?r:r>>>e)&zr,a=1<<o,h=this.bitmap,c=0!==(h&a);if(!c&&i===Ir)return this;var f=de(h&a-1),_=this.nodes,l=c?_[f]:void 0,v=se(l,t,e+wr,r,n,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=Ln)return fe(t,_,h,o,v);if(c&&!v&&2===_.length&&oe(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&oe(v))return v;var p=t&&t===this.ownerID,d=c?v?h:h^a:h|a,g=c?v?ye(_,f,v,p):me(_,f,p):ge(_,f,v,p);return p?(this.bitmap=d,this.nodes=g,this):new kn(t,d,g)}},{});var Dn=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},En=Dn;gr.createClass(Dn,{get:function(t,e,r,n){void 0===e&&(e=y(r));var i=(0===t?e:e>>>t)&zr,u=this.nodes[i];return u?u.get(t+wr,e,r,n):n},update:function(t,e,r,n,i,u,s){void 0===r&&(r=y(n));var o=(0===e?r:r>>>e)&zr,a=i===Ir,h=this.nodes,c=h[o];if(a&&!c)return this;var f=se(c,t,e+wr,r,n,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Tn>_))return ce(t,h,_,o)}else _++;var l=t&&t===this.ownerID,v=ye(h,o,f,l);return l?(this.count=_,this.nodes=v,this):new En(t,_,v)
}},{});var On=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r},An=On;gr.createClass(On,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){void 0===r&&(r=y(i));var c=u===Ir;if(r!==this.keyHash)return c?this:(s(h),s(o),ae(this,t,e,r,[i,u]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),c&&2===l)return new Cn(t,this.keyHash,f[1^_]);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new An(t,this.keyHash,d)}},{});var Cn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r},jn=Cn;gr.createClass(Cn,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,u,o,a){var h=u===Ir,c=n(i,this.entry[0]);return(c?u===this.entry[1]:h)?this:(s(a),h?void s(o):c?t&&t===this.ownerID?(this.entry[1]=u,this):new jn(t,this.keyHash,[i,u]):(s(o),ae(this,t,e,y(i),[i,u])))}},{}),qn.prototype.iterate=On.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Mn.prototype.iterate=Dn.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}},Cn.prototype.iterate=function(t){return t(this.entry)};var Rn=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&re(t._root)};gr.createClass(Rn,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return ee(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return ee(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return ee(t,u.entry);e=this._stack=re(u,e)}continue}e=this._stack=this._stack.__prev}return I()}},{},Wr);var Kn,Un=Sr/4,Ln=Sr/2,Tn=Sr/4,Bn=function(t,e){this._iter=t,this._useKeys=e,this.size=t.size};gr.createClass(Bn,{get:function(t,e){return this._iter.get(t,e)
},has:function(t){return this._iter.has(t)},valueSeq:function(){return this._iter.valueSeq()},reverse:function(){var t=this,e=ze(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},map:function(t,e){var r=this,n=Se(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},__iterate:function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?Le(this):0,function(i){return t(i,e?--r:r++,n)}),e)},__iterator:function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(Kr,e),n=e?Le(this):0;return new Wr(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})}},{},rn),Bn.prototype[Qr]=!0;var Wn=function(t){this._iter=t,this.size=t.size};gr.createClass(Wn,{contains:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Kr,e),n=0;return new Wr(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})}},{},un);var Jn=function(t){this._iter=t,this.size=t.size};gr.createClass(Jn,{has:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Kr,e);return new Wr(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})}},{},on);var Pn=function(t){this._iter=t,this.size=t.size};gr.createClass(Pn,{entrySeq:function(){return this._iter.toSeq()},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(Ue(e),t(e[1],e[0],r)):void 0},e)},__iterator:function(t,e){var r=this._iter.__iterator(Kr,e);return new Wr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return Ue(n),t===Ur?e:z(t,n[0],n[1],e)}})}},{},rn),Wn.prototype.cacheResult=Bn.prototype.cacheResult=Jn.prototype.cacheResult=Pn.prototype.cacheResult=We;var Hn=function(t){var e=Ye();
if(null===t||void 0===t)return e;if(Pe(t))return t;t=Zr(t);var r=t.size;return 0===r?e:r>0&&Sr>r?Ne(0,r,wr,null,new Yn(t.toArray())):e.merge(t)};gr.createClass(Hn,{toString:function(){return this.__toString("List [","]")},get:function(t,e){if(t=f(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=Ge(this,t);return r&&r.array[t&zr]},set:function(t,e){return Qe(this,t,e)},remove:function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=wr,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ye()},push:function(){var t=arguments,e=this.size;return this.withMutations(function(r){Ze(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return Ze(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){Ze(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return Ze(this,1)},merge:function(){return $e(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return $e(this,t,e)},mergeDeep:function(){return $e(this,le(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return $e(this,le(t),e)},setSize:function(t){return Ze(this,0,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:Ze(this,v(t,r),p(e,r))},__iterator:function(t,e){return new Xn(this,t,e)},__iterate:function(t,e){var r=this,n=0,i=function(e){return t(e,n++,r)},u=tr(this._capacity);return e?He(this._tail,0,u-this._origin,this._capacity-this._origin,i,e)&&He(this._root,this._level,-this._origin,u-this._origin,i,e):He(this._root,this._level,-this._origin,u-this._origin,i,e)&&He(this._tail,0,u-this._origin,this._capacity-this._origin,i,e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?Ne(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{of:function(){return this(arguments)
}},gn),Hn.isList=Pe;var Vn="@@__IMMUTABLE_LIST__@@",Nn=Hn.prototype;Nn[Vn]=!0,Nn[mr]=Nn.remove,Nn.setIn=bn.setIn,Nn.removeIn=bn.removeIn,Nn.update=bn.update,Nn.updateIn=bn.updateIn,Nn.withMutations=bn.withMutations,Nn.asMutable=bn.asMutable,Nn.asImmutable=bn.asImmutable,Nn.wasAltered=bn.wasAltered;var Yn=function(t,e){this.array=t,this.ownerID=e},Qn=Yn;gr.createClass(Yn,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&zr;if(n>=this.array.length)return new Qn([],t);var i,u=0===n;if(e>0){var s=this.array[n];if(i=s&&s.removeBefore(t,e-wr,r),i===s&&u)return this}if(u&&!i)return this;var o=Fe(this,t);if(!u)for(var a=0;n>a;a++)o.array[a]=void 0;return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&zr;if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var s=this.array[n];if(i=s&&s.removeAfter(t,e-wr,r),i===s&&u)return this}if(u&&!i)return this;var o=Fe(this,t);return u||o.array.pop(),i&&(o.array[n]=i),o}},{});var Xn=function(t,e,r){this._type=e,this._reverse=!!r,this._maxIndex=t.size-1;var n=tr(t._capacity),i=Ve(t._root&&t._root.array,t._level,-t._origin,n-t._origin-1),u=Ve(t._tail&&t._tail.array,0,n-t._origin,t._capacity-t._origin-1);this._stack=r?u:i,this._stack.__prev=r?i:u};gr.createClass(Xn,{next:function(){for(var t=this._stack;t;){var e=t.array,r=t.index++;if(this._reverse&&(r=zr-r,r>t.rawMax&&(r=t.rawMax,t.index=Sr-r)),r>=0&&Sr>r&&t.rawMax>=r){var n=e&&e[r];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(r<<t.level),this._reverse&&(i=this._maxIndex-i)),z(u,i,n)}this._stack=t=Ve(n&&n.array,t.level-wr,t.offset+(r<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return I()}},{},Wr);var Fn,Gn=function(t){return null===t||void 0===t?nr():er(t)?t:nr().merge(Fr(t))};gr.createClass(Gn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):nr()
},set:function(t,e){return ir(this,t,e)},remove:function(t){return ir(this,t,Ir)},wasAltered:function(){return this._map.wasAltered()||this._list.wasAltered()},__iterate:function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?rr(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)}},{of:function(){return this(arguments)}},zn),Gn.isOrderedMap=er,Gn.prototype[Qr]=!0,Gn.prototype[mr]=Gn.prototype.remove;var Zn,$n=function(t){return null===t||void 0===t?or():ur(t)?t:or().unshiftAll(t)},ti=$n;gr.createClass($n,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):sr(t,e)},pushAll:function(t){if(t=Zr(t),0===t.size)return this;var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):sr(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):or()},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(n!==this.size)return gr.superCall(this,ti.prototype,"slice",[t,e]);for(var i=this.size-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.size=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):sr(i,u)
},__ensureOwner:function(t){return t===this.__ownerID?this:t?sr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterate:function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iterator:function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new Wr(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})}},{of:function(){return this(arguments)}},gn),$n.isStack=ur;var ei="@@__IMMUTABLE_STACK__@@",ri=$n.prototype;ri[ei]=!0,ri.withMutations=bn.withMutations,ri.asMutable=bn.asMutable,ri.asImmutable=bn.asImmutable,ri.wasAltered=bn.wasAltered;var ni,ii=function(t){return null===t||void 0===t?fr():ar(t)?t:fr().union($r(t))};gr.createClass(ii,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},add:function(t){return hr(this,this._map.set(t,!0))},remove:function(t){return hr(this,this._map.remove(t))},clear:function(){return hr(this,this._map.clear())},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++)$r(t[r]).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 $r(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},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 $r(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},sort:function(t){return ai(je(this,t))},sortBy:function(t,e){return ai(je(this,e,t))},wasAltered:function(){return this._map.wasAltered()
},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)}},{of:function(){return this(arguments)},fromKeys:function(t){return this(Fr(t).keySeq())}},wn),ii.isSet=ar;var ui="@@__IMMUTABLE_SET__@@",si=ii.prototype;si[ui]=!0,si[mr]=si.remove,si.mergeDeep=si.merge,si.mergeDeepWith=si.mergeWith,si.withMutations=bn.withMutations,si.asMutable=bn.asMutable,si.asImmutable=bn.asImmutable,si.__empty=fr,si.__make=cr;var oi,ai=function(t){return null===t||void 0===t?vr():_r(t)?t:vr().union($r(t))};gr.createClass(ai,{toString:function(){return this.__toString("OrderedSet {","}")}},{of:function(){return this(arguments)},fromKeys:function(t){return this(Fr(t).keySeq())}},ii),ai.isOrderedSet=_r;var hi=ai.prototype;hi[Qr]=!0,hi.__empty=vr,hi.__make=lr;var ci,fi=function(t,e){var r=function(t){return this instanceof r?void(this._map=zn(t)):new r(t)},n=Object.keys(t),u=r.prototype=Object.create(_i);u.constructor=r,e&&(u._name=e),u._defaultValues=t,u._keys=n,u.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){i(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(s){}return r};gr.createClass(fi,{toString:function(){return this.__toString(dr(this)+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},clear:function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=pr(this,ie()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+dr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:pr(this,r)
},remove:function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:pr(this,e)},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){var r=this;return Fr(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},__iterate:function(t,e){var r=this;return Fr(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?pr(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},dn);var _i=fi.prototype;_i[mr]=_i.remove,_i.merge=bn.merge,_i.mergeWith=bn.mergeWith,_i.mergeDeep=bn.mergeDeep,_i.mergeDeepWith=bn.mergeDeepWith,_i.update=bn.update,_i.updateIn=bn.updateIn,_i.withMutations=bn.withMutations,_i.asMutable=bn.asMutable,_i.asImmutable=bn.asImmutable;var li=function(t,e,r){return this instanceof vi?(i(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),t===e&&di?di:(r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.size=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new vi(t,e,r)},vi=li;gr.createClass(li,{toString:function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+f(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e)},slice:function(t,e){return l(t,e,this.size)?this:(t=v(t,this.size),e=p(e,this.size),t>=e?di:new vi(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 r=e/this._step;if(r>=0&&this.size>r)return r}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){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n
}return u},__iterator:function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new Wr(function(){var s=i;return i+=e?-n:n,u>r?I():z(t,u++,s)})},__deepEquals:function(t){return t instanceof vi?this._start===t._start&&this._end===t._end&&this._step===t._step:T(this,t)}},{},un);var pi=li.prototype;pi.__toJS=pi.toArray,pi.first=Nn.first,pi.last=Nn.last;var di=li(0,0),yi=function(t,e){return 0>=e&&wi?wi:this instanceof gi?(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),void(0===this.size&&(wi=this))):new gi(t,e)},gi=yi;gr.createClass(yi,{toString:function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:new gi(this._value,p(e,r)-v(t,r))},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.size:-1},__iterate:function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;return new Wr(function(){return e.size>r?z(t,r++,e._value):I()})},__deepEquals:function(t){return t instanceof gi?n(this._value,t._value):T(t)}},{},un);var mi=yi.prototype;mi.last=mi.first,mi.has=pi.has,mi.take=pi.take,mi.skip=pi.skip,mi.__toJS=pi.__toJS;var wi,Si={Iterable:Pr,Seq:tn,Collection:pn,Map:zn,OrderedMap:Gn,List:Hn,Stack:$n,Set:ii,OrderedSet:ai,Record:fi,Range:li,Repeat:yi,is:n,fromJS:F};return Si}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
function t(){function t(t,e,r,n){var i;if(n){var u=n.prototype;i=Sr.create(u)}else i=t.prototype;return Sr.keys(e).forEach(function(t){i[t]=e[t]}),Sr.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return Sr.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t&&"function"==typeof t.equals?t.equals(e):!1}function i(t,e){if(!t)throw Error(e)}function u(t){return t.value=!1,t}function s(t){t&&(t.value=!0)}function o(){}function a(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function h(t){i(1/0!==t,"Cannot perform this action with an infinite size.")}function c(t){return void 0===t.size&&(t.size=t.__iterate(_)),t.size}function f(t,e){return e>=0?+e:c(t)+ +e}function _(){return!0}function l(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function v(t,e){return d(t,e,0)}function p(t,e){return d(t,e,e)}function d(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function y(t){return t>>>1&1073741824|3221225471&t}function g(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){for(var r=0|t;t>4294967295;)t/=4294967295,r^=t;return y(r)}return"string"===e?t.length>Kr?m(t):w(t):t.hashCode?g("function"==typeof t.hashCode?t.hashCode():t.hashCode):S(t)}function m(t){var e=Lr[t];return void 0===e&&(e=w(t),Ur===Rr&&(Ur=0,Lr={}),Ur++,Lr[t]=e),e}function w(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)|0;return y(e)}function S(t){var e=Ar&&Ar.get(t);if(e)return e;if(e=t[jr])return e;if(!Or){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[jr])return e;if(e=z(t))return e}if(Object.isExtensible&&!Object.isExtensible(t))throw Error("Non-extensible objects are not allowed as keys.");if(e=++Cr,1073741824&Cr&&(Cr=0),Ar)Ar.set(t,e);else if(Or)Object.defineProperty(t,jr,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)
},t.propertyIsEnumerable[jr]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[jr]=e}return e}function z(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function I(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function b(){return{value:void 0,done:!0}}function q(t){return!!D(t)}function M(t){return t&&"function"==typeof t.next}function x(t){var e=D(t);return e&&e.call(t)}function D(t){var e=t&&(Pr&&t[Pr]||t[Jr]);return"function"==typeof e?e:void 0}function k(t){return!(!t||!t[Xr])}function E(t){return!(!t||!t[Fr])}function O(t){return!(!t||!t[Gr])}function A(t){return E(t)||O(t)}function C(t){return!(!t||!t[Zr])}function j(t,e){return e}function K(t,e){return[e,t]}function R(t){return function(){return!t.apply(this,arguments)}}function U(t){return function(){return-t.apply(this,arguments)}}function L(t){return"string"==typeof t?JSON.stringify(t):t}function T(t,e){return t>e?-1:e>t?1:0}function B(t,e){if(t===e)return!0;if(!k(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||E(t)!==E(e)||O(t)!==O(e)||C(t)!==C(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!A(t);if(C(t)){var i=t.entries();return e.every(function(t,e){var u=i.next().value;return u&&n(u[1],t)&&(r||n(u[0],e))})&&i.next().done}var u=!1;if(void 0===t.size)if(void 0===e.size)t.cacheResult();else{u=!0;var s=t;t=e,e=s}var o=!0,a=e.__iterate(function(e,i){return(r?t.has(e):u?n(e,t.get(i,xr)):n(t.get(i,xr),e))?void 0:(o=!1,!1)});return o&&t.size===a}function W(t){if(1/0===t.size)return 0;var e=C(t),r=E(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+P(g(t),g(e))|0}:function(t,e){n=n+P(g(t),g(e))|0}:e?function(t){n=31*n+g(t)|0}:function(t){n=n+g(t)|0});return J(i,n)}function J(t,e){return e=Er(e,3432918353),e=Er(e<<15|e>>>-15,461845907),e=Er(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Er(e^e>>>16,2246822507),e=Er(e^e>>>13,3266489909),e=y(e^e>>>16)
}function P(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function H(t,e){var r=t.prototype,n=function(t){r[t]=e[t]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function V(t){return!(!t||!t[ln])}function N(){return gn||(gn=new vn([]))}function Y(t){var e=Array.isArray(t)?new vn(t).fromEntrySeq():M(t)?new yn(t).fromEntrySeq():q(t)?new dn(t).fromEntrySeq():"object"==typeof t?new pn(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function Q(t){var e=F(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function X(t){var e=F(t)||"object"==typeof t&&new pn(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function F(t){return G(t)?new vn(t):M(t)?new yn(t):q(t)?new dn(t):void 0}function G(t){return t&&"number"==typeof t.length}function Z(t,e,r,n){h(t.size);var i=t._cache;if(i){for(var u=i.length-1,s=0;u>=s;s++){var o=i[r?u-s:s];if(e(o[1],n?o[0]:s,t)===!1)return s+1}return s}return t.__iterateUncached(e,r)}function $(t,e,r,n){var i=t._cache;if(i){var u=i.length-1,s=0;return new Vr(function(){var t=i[r?u-s:s];return s++>u?b():I(e,n?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,r)}function te(t,e){return e?ee(e,t,"",{"":t}):re(t)}function ee(t,e,r,n){return Array.isArray(e)?t.call(n,r,hn(e).map(function(r,n){return ee(t,r,n,e)})):ne(e)?t.call(n,r,on(e).map(function(r,n){return ee(t,r,n,e)})):e}function re(t){return Array.isArray(t)?hn(t).map(re).toList():ne(t)?on(t).map(re).toMap():t}function ne(t){return t&&t.constructor===Object}function ie(t){return!(!t||!t[xn])}function ue(t,e){return I(t,e[0],e[1])}function se(t,e){return{node:t,index:0,__prev:e}}function oe(t,e,r,n){var i=Object.create(Dn);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ae(){return Bn||(Bn=oe(0))}function he(t,e,r){var n,i;if(t._root){var s=u(Dr),o=u(kr);if(n=ce(t._root,t.__ownerID,0,void 0,e,r,s,o),!o.value)return t;
i=t.size+(s.value?r===xr?-1:1:0)}else{if(r===xr)return t;i=1,n=new kn(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?oe(i,n):ae()}function ce(t,e,r,n,i,u,o,a){return t?t.update(e,r,n,i,u,o,a):u===xr?t:(s(a),s(o),new Un(e,n,[i,u]))}function fe(t){return t.constructor===Un||t.constructor===Kn}function _e(t,e,r,n,i){if(t.keyHash===n)return new Kn(e,n,[t.entry,i]);var u,s=(0===r?t.keyHash:t.keyHash>>>r)&Mr,o=(0===r?n:n>>>r)&Mr,a=s===o?[_e(t,e,r+br,n,i)]:(u=new Un(e,n,i),o>s?[t,u]:[u,t]);return new On(e,1<<s|1<<o,a)}function le(t,e,r,n){t||(t=new o);for(var i=new Un(t,g(r),[r,n]),u=0;e.length>u;u++){var s=e[u];i=i.update(t,0,void 0,s[0],s[1])}return i}function ve(t,e,r,n){for(var i=0,u=0,s=Array(r),o=0,a=1,h=e.length;h>o;o++,a<<=1){var c=e[o];void 0!==c&&o!==n&&(i|=a,s[u++]=c)}return new On(t,i,s)}function pe(t,e,r,n,i){for(var u=0,s=Array(qr),o=0;0!==r;o++,r>>>=1)s[o]=1&r?e[u++]:void 0;return s[n]=i,new Cn(t,u+1,s)}function de(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i],s=tn(u);k(u)||(s=s.map(function(t){return te(t)})),n.push(s)}return ge(t,e,n)}function ye(t){return function(e,r){return e&&e.mergeDeepWith&&k(r)?e.mergeDeepWith(t,r):t?t(e,r):r}}function ge(t,e,r){return r=r.filter(function(t){return 0!==t.size}),0===r.length?t:0===t.size&&1===r.length?t.constructor(r[0]):t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,xr,function(t){return t===xr?r:e(t,r)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function me(t,e,r,n){var u=t===xr,s=e.next();if(s.done){var o=u?r:t,a=n(o);return a===o?t:a}i(u||t&&t.set,"invalid keyPath");var h=s.value,c=u?xr:t.get(h,xr),f=me(c,e,r,n);return f===c?t:f===xr?t.remove(h):(u?ae():t).set(h,f)}function we(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 Se(t,e,r,n){var i=n?t:a(t);return i[e]=r,i}function ze(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var u=Array(i),s=0,o=0;i>o;o++)o===e?(u[o]=r,s=-1):u[o]=t[o+s];return u
}function Ie(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),u=0,s=0;n>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function be(t){var e=He(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.cacheResult=Ve,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Wr){var n=t.__iterator(e,r);return new Vr(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Br?Tr:Br,r)},e}function qe(t,e,r){var n=He(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,xr);return u===xr?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var u=this;return t.__iterate(function(t,i,s){return n(e.call(r,t,i,s),i,u)!==!1},i)},n.__iteratorUncached=function(n,i){var u=t.__iterator(Wr,i);return new Vr(function(){var i=u.next();if(i.done)return i;var s=i.value,o=s[0];return I(n,o,e.call(r,s[1],o,t),i)})},n}function Me(t,e){var r=He(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=be(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=Ve,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function xe(t,e,r,n){var i=He(t);return n&&(i.has=function(n){var i=t.get(n,xr);return i!==xr&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,xr);return u!==xr&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,u){var s=this,o=0;return t.__iterate(function(t,u,a){return e.call(r,t,u,a)?(o++,i(t,n?u:o-1,s)):void 0},u),o},i.__iteratorUncached=function(i,u){var s=t.__iterator(Wr,u),o=0;
return new Vr(function(){for(;;){var u=s.next();if(u.done)return u;var a=u.value,h=a[0],c=a[1];if(e.call(r,c,h,t))return I(i,n?h:o++,c,u)}})},i}function De(t,e,r){var n=Mn().asMutable();return t.__iterate(function(i,u){n.update(e.call(r,i,u,t),0,function(t){return t+1})}),n.asImmutable()}function ke(t,e,r){var n=E(t),i=Mn().asMutable();t.__iterate(function(u,s){i.update(e.call(r,u,s,t),function(t){return t=t||[],t.push(n?[s,u]:u),t})});var u=Pe(t);return i.map(function(e){return Be(t,u(e))})}function Ee(t,e){if(e>t.size)return t;0>e&&(e=0);var r=He(t);return r.size=t.size&&Math.min(t.size,e),r.__iterateUncached=function(r,n){var i=this;if(0===e)return 0;if(n)return this.cacheResult().__iterate(r,n);var u=0;return t.__iterate(function(t,n){return++u&&r(t,n,i)!==!1&&e>u}),u},r.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=e&&t.__iterator(r,n),u=0;return new Vr(function(){return u++>e?b():i.next()})},r}function Oe(t,e,r){var n=He(t);return n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0;return t.__iterate(function(t,i,o){return e.call(r,t,i,o)&&++s&&n(t,i,u)}),s},n.__iteratorUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterator(n,i);var s=t.__iterator(Wr,i),o=!0;return new Vr(function(){if(!o)return b();var t=s.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,u)?n===Wr?t:I(n,a,h,t):(o=!1,b())})},n}function Ae(t,e,r){if(0>=e)return t;var n=He(t);return n.size=t.size&&Math.max(0,t.size-e),n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0,o=!0,a=0;return t.__iterate(function(t,i){return o&&(o=s++<e)?void 0:(a++,n(t,r?i:a-1,u))}),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var u=e&&t.__iterator(n,i),s=0,o=0;return new Vr(function(){for(;e>s;)s++,u.next();var t=u.next();return r||n===Br?t:n===Tr?I(n,o++,void 0,t):I(n,o++,t.value[1],t)})},n}function Ce(t,e,r,n){var i=He(t);return i.__iterateUncached=function(i,u){var s=this;
if(u)return this.cacheResult().__iterate(i,u);var o=!0,a=0;return t.__iterate(function(t,u,h){return o&&(o=e.call(r,t,u,h))?void 0:(a++,i(t,n?u:a-1,s))}),a},i.__iteratorUncached=function(i,u){var s=this;if(u)return this.cacheResult().__iterator(i,u);var o=t.__iterator(Wr,u),a=!0,h=0;return new Vr(function(){var t,u,c;do{if(t=o.next(),t.done)return n||i===Br?t:i===Tr?I(i,h++,void 0,t):I(i,h++,t.value[1],t);var f=t.value;u=f[0],c=f[1],a&&(a=e.call(r,c,u,s))}while(a);return i===Wr?t:I(i,u,c,t)})},i}function je(t,e){var r=E(t),n=[t].concat(e).map(function(t){return k(t)?r&&(t=tn(t)):t=r?Y(t):Q(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&E(i)||O(t)&&O(i))return i}var u=new vn(n);return r?u=u.toKeyedSeq():O(t)||(u=u.toSetSeq()),u=u.flatten(!0),u.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),u}function Ke(t,e,r){var n=He(t);return n.__iterateUncached=function(n,i){function u(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&k(t)?u(t,a+1):n(t,r?i:s++,h)===!1&&(o=!0),!o},i)}var s=0,o=!1;return u(t,0),s},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),s=[],o=0;return new Vr(function(){for(;u;){var t=u.next();if(t.done===!1){var a=t.value;if(n===Wr&&(a=a[1]),e&&!(e>s.length)||!k(a))return r?t:I(n,o++,a,t);s.push(u),u=a.__iterator(n,i)}else u=s.pop()}return b()})},n}function Re(t,e,r){var n=Pe(t);return t.toSeq().map(function(i,u){return n(e.call(r,i,u,t))}).flatten(!0)}function Ue(t,e){var r=He(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,u=0;return t.__iterate(function(t){return(!u||r(e,u++,i)!==!1)&&r(t,u++,i)!==!1},n),u},r.__iteratorUncached=function(r,n){var i,u=t.__iterator(Br,n),s=0;return new Vr(function(){return(!i||s%2)&&(i=u.next(),i.done)?i:s%2?I(r,s++,e):I(r,s++,i.value,i)})},r}function Le(t,e,r){e||(e=Ne);var n=E(t),i=0,u=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return u.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]
}).forEach(n?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),n?on(u):O(t)?hn(u):fn(u)}function Te(t,e,r){if(e||(e=Ne),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return e(r[1],t[1])>0?r:t});return n&&n[0]}return t.reduce(function(t,r){return e(r,t)>0?r:t})}function Be(t,e){return V(t)?e:t.constructor(e)}function We(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Je(t){return h(t.size),c(t)}function Pe(t){return E(t)?tn:O(t)?rn:nn}function He(t){return Object.create((E(t)?on:O(t)?hn:fn).prototype)}function Ve(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):un.prototype.cacheResult.call(this)}function Ne(t,e){return t>e?1:e>t?-1:0}function Ye(t){return!(!t||!t[Xn])}function Qe(t,e,r,n,i,u){var s,o=t&&t.array;if(0===e){var a=0>r?-r:0,h=n-r;for(h>qr&&(h=qr),s=a;h>s;s++)if(i(o&&o[u?a+h-1-s:s])===!1)return!1}else{var c=1<<e,f=e-br;for(s=0;Mr>=s;s++){var _=u?Mr-s:s,l=r+(_<<e);if(n>l&&l+c>0){var v=o&&o[_];if(!Qe(v,f,l,n,i,u))return!1}}}return!0}function Xe(t,e,r,n,i){return{array:t,level:e,offset:r,max:n,rawMax:n-r>>e,index:0,__prev:i}}function Fe(t,e,r,n,i,u,s){var o=Object.create(Fn);return o.size=e-t,o._origin=t,o._capacity=e,o._level=r,o._root=n,o._tail=i,o.__ownerID=u,o.__hash=s,o.__altered=!1,o}function Ge(){return ti||(ti=Fe(0,0,br))}function Ze(t,e,r){if(e=f(t,e),e>=t.size||0>e)return t.withMutations(function(t){0>e?rr(t,e).set(0,r):rr(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,s=u(kr);return e>=ir(t._capacity)?n=$e(n,t.__ownerID,0,e,r,s):i=$e(i,t.__ownerID,t._level,e,r,s),s.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Fe(t._origin,t._capacity,t._level,i,n):t}function $e(t,e,r,n,i,u){var o=n>>>r&Mr,a=t&&t.array.length>o;if(!a&&void 0===i)return t;var h;if(r>0){var c=t&&t.array[o],f=$e(c,e,r-br,n,i,u);return f===c?t:(h=tr(t,e),h.array[o]=f,h)}return a&&t.array[o]===i?t:(s(u),h=tr(t,e),void 0===i&&o===h.array.length-1?h.array.pop():h.array[o]=i,h)}function tr(t,e){return e&&t&&e===t.ownerID?t:new Gn(t?t.array.slice():[],e)
}function er(t,e){if(e>=ir(t._capacity))return t._tail;if(1<<t._level+br>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&Mr],n-=br;return r}}function rr(t,e,r){var n=t.__ownerID||new o,i=t._origin,u=t._capacity,s=i+e,a=void 0===r?u:0>r?u+r:i+r;if(s===i&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Gn(c&&c.array.length?[void 0,c]:[],n),h+=br,f+=1<<h;f&&(s+=f,i+=f,a+=f,u+=f);for(var _=ir(u),l=ir(a);l>=1<<h+br;)c=new Gn(c&&c.array.length?[c]:[],n),h+=br;var v=t._tail,p=_>l?er(t,a-1):l>_?new Gn([],n):v;if(v&&l>_&&u>s&&v.array.length){c=tr(c,n);for(var d=c,y=h;y>br;y-=br){var g=_>>>y&Mr;d=d.array[g]=tr(d.array[g],n)}d.array[_>>>br&Mr]=v}if(u>a&&(p=p&&p.removeAfter(n,0,a)),s>=l)s-=l,a-=l,h=br,c=null,p=p&&p.removeBefore(n,0,s);else if(s>i||_>l){for(f=0;c;){var m=s>>>h&Mr;if(m!==l>>>h&Mr)break;m&&(f+=(1<<h)*m),h-=br,c=c.array[m]}c&&s>i&&(c=c.removeBefore(n,h,s-f)),c&&_>l&&(c=c.removeAfter(n,h,l-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=c,t._tail=p,t.__hash=void 0,t.__altered=!0,t):Fe(s,a,h,c,p)}function nr(t,e,r){for(var n=[],i=0,u=0;r.length>u;u++){var s=r[u],o=rn(s);o.size>i&&(i=o.size),k(s)||(o=o.map(function(t){return te(t)})),n.push(o)}return i>t.size&&(t=t.setSize(i)),ge(t,e,n)}function ir(t){return qr>t?0:t-1>>>br<<br}function ur(t){return ie(t)&&C(t)}function sr(t,e,r,n){var i=Object.create(ei.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function or(){return ri||(ri=sr(ae(),Ge()))}function ar(t,e,r){var n,i,u=t._map,s=t._list,o=u.get(e),a=void 0!==o;if(r===xr){if(!a)return t;s.size>=qr&&s.size>=2*u.size?(i=s.filter(function(t,e){return void 0!==t&&o!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=u.remove(e),i=o===s.size-1?s.pop():s.set(o,void 0))}else if(a){if(r===s.get(o)[1])return t;n=u,i=s.set(o,[e,r])}else n=u.set(e,s.size),i=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):sr(n,i)
}function hr(t){return!(!t||!t[ui])}function cr(t,e,r,n){var i=Object.create(si);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function fr(){return oi||(oi=cr(0))}function _r(t){return!(!t||!t[hi])}function lr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function vr(t,e){var r=Object.create(ci);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function pr(){return fi||(fi=vr(ae()))}function dr(t){return _r(t)&&C(t)}function yr(t,e){var r=Object.create(li);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function gr(){return vi||(vi=yr(or()))}function mr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function wr(t){return t._name||t.constructor.name}var Sr=Object,zr={};zr.createClass=t,zr.superCall=e,zr.defaultSuperCall=r;var Ir="delete",br=5,qr=1<<br,Mr=qr-1,xr={},Dr={value:!1},kr={value:!1},Er="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Or=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Ar="function"==typeof WeakMap&&new WeakMap,Cr=0,jr="__immutablehash__";"function"==typeof Symbol&&(jr=Symbol(jr));var Kr=16,Rr=255,Ur=0,Lr={},Tr=0,Br=1,Wr=2,Jr="@@iterator",Pr="function"==typeof Symbol&&Symbol.iterator,Hr=Pr||Jr,Vr=function(t){this.next=t};zr.createClass(Vr,{toString:function(){return"[Iterator]"}},{}),Vr.KEYS=Tr,Vr.VALUES=Br,Vr.ENTRIES=Wr;var Nr=Vr.prototype;Nr.inspect=Nr.toSource=function(){return""+this},Nr[Hr]=function(){return this};var Yr=function(t){return k(t)?t:un(t)},Qr=Yr;zr.createClass(Yr,{toArray:function(){h(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new Vn(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toKeyedSeq:function(){return new Hn(this,!0)},toMap:function(){return h(this.size),Mn(this.toKeyedSeq())
},toObject:function(){h(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return h(this.size),ei(this.toKeyedSeq())},toOrderedSet:function(){return h(this.size),_i(E(this)?this.valueSeq():this)},toSet:function(){return h(this.size),ai(E(this)?this.valueSeq():this)},toSetSeq:function(){return new Nn(this)},toSeq:function(){return O(this)?this.toIndexedSeq():E(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return h(this.size),ni(E(this)?this.valueSeq():this)},toList:function(){return h(this.size),Qn(E(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Be(this,je(this,t))},contains:function(t){return this.some(function(e){return n(e,t)})},entries:function(){return this.__iterator(Wr)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Be(this,xe(this,t,e,!0))},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(Tr)},map:function(t,e){return Be(this,qe(this,t,e))},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,s){i?(i=!1,n=e):n=t.call(r,n,e,u,s)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return Be(this,Me(this,!0))},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(r!==r||n!==n)return this.toSeq().cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return Be(this,void 0===n||n===this.size?i:i.take(n-r))},some:function(t,e){return!this.every(R(t),e)
},sort:function(t){return Be(this,Le(this,t))},values:function(){return this.__iterator(Br)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return De(this,t,e)},equals:function(t){return B(this,t)},entrySeq:function(){var t=this;if(t._cache)return new vn(t._cache);var e=t.toSeq().map(K).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(R(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(_)},flatMap:function(t,e){return Be(this,Re(this,t,e))},flatten:function(t){return Be(this,Ke(this,t,!0))},fromEntrySeq:function(){return new Yn(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},void 0,e)},getIn:function(t,e){var r=this;if(t)for(var n,i=x(t)||x(Qr(t));!(n=i.next()).done;){var u=n.value;if(r=r&&r.get?r.get(u,xr):xr,r===xr)return e}return r},groupBy:function(t,e){return ke(this,t,e)},has:function(t){return this.get(t,xr)!==xr},isSubset:function(t){return t="function"==typeof t.contains?t:Qr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(j).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Te(this,t)},maxBy:function(t,e){return Te(this,e,t)},min:function(t){return Te(this,t?U(t):T)},minBy:function(t,e){return Te(this,e?U(e):T,t)},rest:function(){return this.slice(1)},skip:function(t){return Be(this,Ae(this,t,!0))},skipLast:function(t){return Be(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Be(this,Ce(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(R(t),e)},sortBy:function(t,e){return Be(this,Le(this,e,t))},take:function(t){return Be(this,Ee(this,t))},takeLast:function(t){return Be(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Be(this,Oe(this,t,e))},takeUntil:function(t,e){return this.takeWhile(R(t),e)
},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=W(this))}},{});var Xr="@@__IMMUTABLE_ITERABLE__@@",Fr="@@__IMMUTABLE_KEYED__@@",Gr="@@__IMMUTABLE_INDEXED__@@",Zr="@@__IMMUTABLE_ORDERED__@@",$r=Yr.prototype;$r[Xr]=!0,$r[Hr]=$r.values,$r.toJSON=$r.toJS,$r.__toJS=$r.toArray,$r.__toStringMapper=L,$r.inspect=$r.toSource=function(){return""+this},$r.chain=$r.flatMap,function(){try{Object.defineProperty($r,"length",{get:function(){if(!Yr.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}();var tn=function(t){return E(t)?t:on(t)};zr.createClass(tn,{flip:function(){return Be(this,be(this))},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0}),r},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return n(e,t)})},lastKeyOf:function(t){return this.toSeq().reverse().keyOf(t)},mapEntries:function(t,e){var r=this,n=0;return Be(this,this.toSeq().map(function(i,u){return t.call(e,[u,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Be(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}},{},Yr);var en=tn.prototype;en[Fr]=!0,en[Hr]=$r.entries,en.__toJS=$r.toObject,en.__toStringMapper=function(t,e){return e+": "+L(t)};var rn=function(t){return O(t)?t:hn(t)};zr.createClass(rn,{toKeyedSeq:function(){return new Hn(this,!1)},filter:function(t,e){return Be(this,xe(this,t,e,!1))},findIndex:function(t,e){var r=this.toKeyedSeq().findKey(t,e);return void 0===r?-1:r},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Be(this,Me(this,!1))},splice:function(t,e){var r=arguments.length;
if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=v(t,this.size);var n=this.slice(0,t);return Be(this,1===r?n:n.concat(a(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Be(this,Ke(this,t,!1))},get:function(t,e){return t=f(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=f(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return Be(this,Ue(this,t))},last:function(){return this.get(-1)},skip:function(t){var e=this,r=Ae(e,t,!1);return V(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0?e.get(r+t,n):n}),Be(this,r)},skipWhile:function(t,e){return Be(this,Ce(this,t,e,!1))},take:function(t){var e=this,r=Ee(e,t);return V(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0&&t>r?e.get(r,n):n}),Be(this,r)}},{},Yr),rn.prototype[Gr]=!0,rn.prototype[Zr]=!0;var nn=function(t){return k(t)&&!A(t)?t:fn(t)};zr.createClass(nn,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}},{},Yr),nn.prototype.has=$r.contains,Yr.isIterable=k,Yr.isKeyed=E,Yr.isIndexed=O,Yr.isAssociative=A,Yr.isOrdered=C,Yr.Keyed=tn,Yr.Indexed=rn,Yr.Set=nn,Yr.Iterator=Vr;var un=function(t){return null===t||void 0===t?N():k(t)?t.toSeq():X(t)},sn=un;zr.createClass(un,{toSeq:function(){return this},toString:function(){return this.__toString("Seq {","}")},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},__iterate:function(t,e){return Z(this,t,e,!0)},__iterator:function(t,e){return $(this,t,e,!0)}},{of:function(){return sn(arguments)}},Yr);var on=function(t){return null===t||void 0===t?N().toKeyedSeq():k(t)?E(t)?t.toSeq():t.fromEntrySeq():Y(t)},an=on;zr.createClass(on,{toKeyedSeq:function(){return this},toSeq:function(){return this
}},{of:function(){return an(arguments)}},un),H(on,tn.prototype);var hn=function(t){return null===t||void 0===t?N():k(t)?E(t)?t.entrySeq():t.toIndexedSeq():Q(t)},cn=hn;zr.createClass(hn,{toIndexedSeq:function(){return this},toString:function(){return this.__toString("Seq [","]")},__iterate:function(t,e){return Z(this,t,e,!1)},__iterator:function(t,e){return $(this,t,e,!1)}},{of:function(){return cn(arguments)}},un),H(hn,rn.prototype);var fn=function(t){return(null===t||void 0===t?N():k(t)?E(t)?t.entrySeq():t:Q(t)).toSetSeq()},_n=fn;zr.createClass(fn,{toSetSeq:function(){return this}},{of:function(){return _n(arguments)}},un),H(fn,nn.prototype),un.isSeq=V,un.Keyed=on,un.Set=fn,un.Indexed=hn;var ln="@@__IMMUTABLE_SEQ__@@";un.prototype[ln]=!0;var vn=function(t){this._array=t,this.size=t.length};zr.createClass(vn,{get:function(t,e){return this.has(t)?this._array[f(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;return new Vr(function(){return i>n?b():I(t,i,r[e?n-i++:i++])})}},{},hn);var pn=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length};zr.createClass(pn,{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 r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var s=n[e?i-u:u];if(t(r[s],s,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new Vr(function(){var s=n[e?i-u:u];return u++>i?b():I(t,s,r[s])})}},{},on),pn.prototype[Zr]=!0;var dn=function(t){this._iterable=t,this.size=t.length||t.size};zr.createClass(dn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=x(r),i=0;if(M(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=x(r);
if(!M(n))return new Vr(b);var i=0;return new Vr(function(){var e=n.next();return e.done?e:I(t,i++,e.value)})}},{},hn);var yn=function(t){this._iterator=t,this._iteratorCache=[]};zr.createClass(yn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var s=u.value;if(n[i]=s,t(s,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Vr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return I(t,i,n[i++])})}},{},hn);var gn,mn=function(){throw TypeError("Abstract")};zr.createClass(mn,{},{},Yr);var wn=function(){zr.defaultSuperCall(this,Sn.prototype,arguments)},Sn=wn;zr.createClass(wn,{},{},mn),H(wn,tn.prototype);var zn=function(){zr.defaultSuperCall(this,In.prototype,arguments)},In=zn;zr.createClass(zn,{},{},mn),H(zn,rn.prototype);var bn=function(){zr.defaultSuperCall(this,qn.prototype,arguments)},qn=bn;zr.createClass(bn,{},{},mn),H(bn,nn.prototype),mn.Keyed=wn,mn.Indexed=zn,mn.Set=bn;var Mn=function(t){return null===t||void 0===t?ae():ie(t)?t:ae().withMutations(function(e){tn(t).forEach(function(t,r){return e.set(r,t)})})};zr.createClass(Mn,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,void 0,t,e):e},set:function(t,e){return he(this,t,e)},setIn:function(t,e){return this.updateIn(t,function(){return e})},remove:function(t){return he(this,t,xr)},removeIn:function(t){return this.updateIn(t,function(){return xr})},update:function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},updateIn:function(t,e,r){r||(r=e,e=void 0);var n=me(this,x(t)||x(Yr(t)),e,r);return n===xr?void 0:n},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ae()},merge:function(){return de(this,void 0,arguments)
},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,t,e)},mergeIn:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return this.updateIn(t,ae(),function(t){return t.merge.apply(t,e)})},mergeDeep:function(){return de(this,ye(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,ye(t),e)},mergeDeepIn:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return this.updateIn(t,ae(),function(t){return t.mergeDeep.apply(t,e)})},sort:function(t){return ei(Le(this,t))},sortBy:function(t,e){return ei(Le(this,e,t))},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 o)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new Tn(this,t,e)},__iterate:function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?oe(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{},wn),Mn.isMap=ie;var xn="@@__IMMUTABLE_MAP__@@",Dn=Mn.prototype;Dn[xn]=!0,Dn[Ir]=Dn.remove;var kn=function(t,e){this.ownerID=t,this.entries=e},En=kn;zr.createClass(kn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){for(var c=u===xr,f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),!c||1!==f.length){if(!v&&!c&&f.length>=Wn)return le(t,f,i,u);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new En(t,d)}}},{});var On=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},An=On;zr.createClass(On,{get:function(t,e,r,n){void 0===e&&(e=g(r));
var i=1<<((0===t?e:e>>>t)&Mr),u=this.bitmap;return 0===(u&i)?n:this.nodes[we(u&i-1)].get(t+br,e,r,n)},update:function(t,e,r,n,i,u,s){void 0===r&&(r=g(n));var o=(0===e?r:r>>>e)&Mr,a=1<<o,h=this.bitmap,c=0!==(h&a);if(!c&&i===xr)return this;var f=we(h&a-1),_=this.nodes,l=c?_[f]:void 0,v=ce(l,t,e+br,r,n,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=Jn)return pe(t,_,h,o,v);if(c&&!v&&2===_.length&&fe(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&fe(v))return v;var p=t&&t===this.ownerID,d=c?v?h:h^a:h|a,y=c?v?Se(_,f,v,p):Ie(_,f,p):ze(_,f,v,p);return p?(this.bitmap=d,this.nodes=y,this):new An(t,d,y)}},{});var Cn=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},jn=Cn;zr.createClass(Cn,{get:function(t,e,r,n){void 0===e&&(e=g(r));var i=(0===t?e:e>>>t)&Mr,u=this.nodes[i];return u?u.get(t+br,e,r,n):n},update:function(t,e,r,n,i,u,s){void 0===r&&(r=g(n));var o=(0===e?r:r>>>e)&Mr,a=i===xr,h=this.nodes,c=h[o];if(a&&!c)return this;var f=ce(c,t,e+br,r,n,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Pn>_))return ve(t,h,_,o)}else _++;var l=t&&t===this.ownerID,v=Se(h,o,f,l);return l?(this.count=_,this.nodes=v,this):new jn(t,_,v)}},{});var Kn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r},Rn=Kn;zr.createClass(Kn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){void 0===r&&(r=g(i));var c=u===xr;if(r!==this.keyHash)return c?this:(s(h),s(o),_e(this,t,e,r,[i,u]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),c&&2===l)return new Un(t,this.keyHash,f[1^_]);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new Rn(t,this.keyHash,d)}},{});var Un=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r},Ln=Un;zr.createClass(Un,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,u,o,a){var h=u===xr,c=n(i,this.entry[0]);return(c?u===this.entry[1]:h)?this:(s(a),h?void s(o):c?t&&t===this.ownerID?(this.entry[1]=u,this):new Ln(t,this.keyHash,[i,u]):(s(o),_e(this,t,e,g(i),[i,u])))
}},{}),kn.prototype.iterate=Kn.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},On.prototype.iterate=Cn.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}},Un.prototype.iterate=function(t){return t(this.entry)};var Tn=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&se(t._root)};zr.createClass(Tn,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return ue(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return ue(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return ue(t,u.entry);e=this._stack=se(u,e)}continue}e=this._stack=this._stack.__prev}return b()}},{},Vr);var Bn,Wn=qr/4,Jn=qr/2,Pn=qr/4,Hn=function(t,e){this._iter=t,this._useKeys=e,this.size=t.size};zr.createClass(Hn,{get:function(t,e){return this._iter.get(t,e)},has:function(t){return this._iter.has(t)},valueSeq:function(){return this._iter.valueSeq()},reverse:function(){var t=this,e=Me(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},map:function(t,e){var r=this,n=qe(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},__iterate:function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?Je(this):0,function(i){return t(i,e?--r:r++,n)}),e)},__iterator:function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(Br,e),n=e?Je(this):0;return new Vr(function(){var i=r.next();return i.done?i:I(t,e?--n:n++,i.value,i)})}},{},on),Hn.prototype[Zr]=!0;var Vn=function(t){this._iter=t,this.size=t.size};zr.createClass(Vn,{contains:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Br,e),n=0;
return new Vr(function(){var e=r.next();return e.done?e:I(t,n++,e.value,e)})}},{},hn);var Nn=function(t){this._iter=t,this.size=t.size};zr.createClass(Nn,{has:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(Br,e);return new Vr(function(){var e=r.next();return e.done?e:I(t,e.value,e.value,e)})}},{},fn);var Yn=function(t){this._iter=t,this.size=t.size};zr.createClass(Yn,{entrySeq:function(){return this._iter.toSeq()},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(We(e),t(e[1],e[0],r)):void 0},e)},__iterator:function(t,e){var r=this._iter.__iterator(Br,e);return new Vr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return We(n),t===Wr?e:I(t,n[0],n[1],e)}})}},{},on),Vn.prototype.cacheResult=Hn.prototype.cacheResult=Nn.prototype.cacheResult=Yn.prototype.cacheResult=Ve;var Qn=function(t){var e=Ge();if(null===t||void 0===t)return e;if(Ye(t))return t;t=rn(t);var r=t.size;return 0===r?e:r>0&&qr>r?Fe(0,r,br,null,new Gn(t.toArray())):e.withMutations(function(e){e.setSize(r),t.forEach(function(t,r){return e.set(r,t)})})};zr.createClass(Qn,{toString:function(){return this.__toString("List [","]")},get:function(t,e){if(t=f(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=er(this,t);return r&&r.array[t&Mr]},set:function(t,e){return Ze(this,t,e)},remove:function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=br,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ge()},push:function(){var t=arguments,e=this.size;return this.withMutations(function(r){rr(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return rr(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){rr(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])
})},shift:function(){return rr(this,1)},merge:function(){return nr(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return nr(this,t,e)},mergeDeep:function(){return nr(this,ye(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return nr(this,ye(t),e)},setSize:function(t){return rr(this,0,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:rr(this,v(t,r),p(e,r))},__iterator:function(t,e){return new $n(this,t,e)},__iterate:function(t,e){var r=this,n=0,i=function(e){return t(e,n++,r)},u=ir(this._capacity);return e?Qe(this._tail,0,u-this._origin,this._capacity-this._origin,i,e)&&Qe(this._root,this._level,-this._origin,u-this._origin,i,e):Qe(this._root,this._level,-this._origin,u-this._origin,i,e)&&Qe(this._tail,0,u-this._origin,this._capacity-this._origin,i,e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?Fe(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{of:function(){return this(arguments)}},zn),Qn.isList=Ye;var Xn="@@__IMMUTABLE_LIST__@@",Fn=Qn.prototype;Fn[Xn]=!0,Fn[Ir]=Fn.remove,Fn.setIn=Dn.setIn,Fn.removeIn=Dn.removeIn,Fn.update=Dn.update,Fn.updateIn=Dn.updateIn,Fn.mergeIn=Dn.mergeIn,Fn.mergeDeepIn=Dn.mergeDeepIn,Fn.withMutations=Dn.withMutations,Fn.asMutable=Dn.asMutable,Fn.asImmutable=Dn.asImmutable,Fn.wasAltered=Dn.wasAltered;var Gn=function(t,e){this.array=t,this.ownerID=e},Zn=Gn;zr.createClass(Gn,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&Mr;if(n>=this.array.length)return new Zn([],t);var i,u=0===n;if(e>0){var s=this.array[n];if(i=s&&s.removeBefore(t,e-br,r),i===s&&u)return this}if(u&&!i)return this;var o=tr(this,t);if(!u)for(var a=0;n>a;a++)o.array[a]=void 0;return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&Mr;if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var s=this.array[n];
if(i=s&&s.removeAfter(t,e-br,r),i===s&&u)return this}if(u&&!i)return this;var o=tr(this,t);return u||o.array.pop(),i&&(o.array[n]=i),o}},{});var $n=function(t,e,r){this._type=e,this._reverse=!!r,this._maxIndex=t.size-1;var n=ir(t._capacity),i=Xe(t._root&&t._root.array,t._level,-t._origin,n-t._origin-1),u=Xe(t._tail&&t._tail.array,0,n-t._origin,t._capacity-t._origin-1);this._stack=r?u:i,this._stack.__prev=r?i:u};zr.createClass($n,{next:function(){for(var t=this._stack;t;){var e=t.array,r=t.index++;if(this._reverse&&(r=Mr-r,r>t.rawMax&&(r=t.rawMax,t.index=qr-r)),r>=0&&qr>r&&t.rawMax>=r){var n=e&&e[r];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(r<<t.level),this._reverse&&(i=this._maxIndex-i)),I(u,i,n)}this._stack=t=Xe(n&&n.array,t.level-br,t.offset+(r<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return b()}},{},Vr);var ti,ei=function(t){return null===t||void 0===t?or():ur(t)?t:or().withMutations(function(e){tn(t).forEach(function(t,r){return e.set(r,t)})})};zr.createClass(ei,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):or()},set:function(t,e){return ar(this,t,e)},remove:function(t){return ar(this,t,xr)},wasAltered:function(){return this._map.wasAltered()||this._list.wasAltered()},__iterate:function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?sr(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)}},{of:function(){return this(arguments)}},Mn),ei.isOrderedMap=ur,ei.prototype[Zr]=!0,ei.prototype[Ir]=ei.prototype.remove;var ri,ni=function(t){return null===t||void 0===t?fr():hr(t)?t:fr().unshiftAll(t)},ii=ni;zr.createClass(ni,{toString:function(){return this.__toString("Stack [","]")
},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):cr(t,e)},pushAll:function(t){if(t=rn(t),0===t.size)return this;var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):cr(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):fr()},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(n!==this.size)return zr.superCall(this,ii.prototype,"slice",[t,e]);for(var i=this.size-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.size=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):cr(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?cr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterate:function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iterator:function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new Vr(function(){if(n){var e=n.value;return n=n.next,I(t,r++,e)}return b()})}},{of:function(){return this(arguments)}},zn),ni.isStack=hr;var ui="@@__IMMUTABLE_STACK__@@",si=ni.prototype;si[ui]=!0,si.withMutations=Dn.withMutations,si.asMutable=Dn.asMutable,si.asImmutable=Dn.asImmutable,si.wasAltered=Dn.wasAltered;var oi,ai=function(t){return null===t||void 0===t?pr():_r(t)?t:pr().withMutations(function(e){nn(t).forEach(function(t){return e.add(t)
})})};zr.createClass(ai,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},add:function(t){return lr(this,this._map.set(t,!0))},remove:function(t){return lr(this,this._map.remove(t))},clear:function(){return lr(this,this._map.clear())},union:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0===this.size&&1===t.length?this.constructor(t[0]):this.withMutations(function(e){for(var r=0;t.length>r;r++)nn(t[r]).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 nn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},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 nn(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},sort:function(t){return _i(Le(this,t))},sortBy:function(t,e){return _i(Le(this,e,t))},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)}},{of:function(){return this(arguments)},fromKeys:function(t){return this(tn(t).keySeq())}},bn),ai.isSet=_r;var hi="@@__IMMUTABLE_SET__@@",ci=ai.prototype;ci[hi]=!0,ci[Ir]=ci.remove,ci.mergeDeep=ci.merge,ci.mergeDeepWith=ci.mergeWith,ci.withMutations=Dn.withMutations,ci.asMutable=Dn.asMutable,ci.asImmutable=Dn.asImmutable,ci.__empty=pr,ci.__make=vr;
var fi,_i=function(t){return null===t||void 0===t?gr():dr(t)?t:gr().withMutations(function(e){nn(t).forEach(function(t){return e.add(t)})})};zr.createClass(_i,{toString:function(){return this.__toString("OrderedSet {","}")}},{of:function(){return this(arguments)},fromKeys:function(t){return this(tn(t).keySeq())}},ai),_i.isOrderedSet=dr;var li=_i.prototype;li[Zr]=!0,li.__empty=gr,li.__make=yr;var vi,pi=function(t,e){var r=function(t){return this instanceof r?void(this._map=Mn(t)):new r(t)},n=Object.keys(t),u=r.prototype=Object.create(di);u.constructor=r,e&&(u._name=e),u._defaultValues=t,u._keys=n,u.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){i(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(s){}return r};zr.createClass(pi,{toString:function(){return this.__toString(wr(this)+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},clear:function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=mr(this,ae()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+wr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:mr(this,r)},remove:function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:mr(this,e)},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){var r=this;return tn(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},__iterate:function(t,e){var r=this;return tn(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?mr(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},wn);var di=pi.prototype;
di[Ir]=di.remove,di.merge=Dn.merge,di.mergeWith=Dn.mergeWith,di.mergeIn=Dn.mergeIn,di.mergeDeep=Dn.mergeDeep,di.mergeDeepWith=Dn.mergeDeepWith,di.mergeDeepIn=Dn.mergeDeepIn,di.setIn=Dn.setIn,di.update=Dn.update,di.updateIn=Dn.updateIn,di.withMutations=Dn.withMutations,di.asMutable=Dn.asMutable,di.asImmutable=Dn.asImmutable;var yi=function(t,e,r){return this instanceof gi?(i(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),t===e&&wi?wi:(r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.size=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new gi(t,e,r)},gi=yi;zr.createClass(yi,{toString:function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+f(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e)},slice:function(t,e){return l(t,e,this.size)?this:(t=v(t,this.size),e=p(e,this.size),t>=e?wi:new gi(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 r=e/this._step;if(r>=0&&this.size>r)return r}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){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n}return u},__iterator:function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new Vr(function(){var s=i;return i+=e?-n:n,u>r?b():I(t,u++,s)})},equals:function(t){return t instanceof gi?this._start===t._start&&this._end===t._end&&this._step===t._step:B(this,t)}},{},hn);var mi=yi.prototype;mi.__toJS=mi.toArray,mi.first=Fn.first,mi.last=Fn.last;var wi=yi(0,0),Si=function(t,e){return 0>=e&&bi?bi:this instanceof zi?(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),void(0===this.size&&(bi=this))):new zi(t,e)},zi=Si;
zr.createClass(Si,{toString:function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:new zi(this._value,p(e,r)-v(t,r))},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.size:-1},__iterate:function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;return new Vr(function(){return e.size>r?I(t,r++,e._value):b()})},equals:function(t){return t instanceof zi?n(this._value,t._value):B(t)}},{},hn);var Ii=Si.prototype;Ii.last=Ii.first,Ii.has=mi.has,Ii.take=mi.take,Ii.skip=mi.skip,Ii.__toJS=mi.__toJS;var bi,qi={Iterable:Yr,Seq:un,Collection:mn,Map:Mn,OrderedMap:ei,List:Qn,Stack:ni,Set:ai,OrderedSet:_i,Record:pi,Range:yi,Repeat:Si,is:n,fromJS:te};return qi}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
{
"name": "immutable",
"version": "3.2.1",
"version": "3.3.0",
"description": "Immutable Data Collections",

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

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

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