diff --git a/__tests__/List.ts b/__tests__/List.ts index 113afa5c60..bbd59d98d5 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -189,6 +189,14 @@ describe('List', () => { expect(list.hasIn(['str'])).toBe(false); }); + it('hasIn doesnt throw for bad key-path', () => { + let list = List.of(1, 2, 3, 4, 5); + expect(list.hasIn([1, 2, 3])).toBe(false); + + let list2 = List([{}]); + expect(list2.hasIn([0, 'bad'])).toBe(false); + }); + it('setting creates a new instance', () => { let v0 = List.of('a'); let v1 = v0.set(0, 'A'); diff --git a/dist/immutable.es.js b/dist/immutable.es.js index 5b7b1d216e..f9fa1138bb 100644 --- a/dist/immutable.es.js +++ b/dist/immutable.es.js @@ -4711,27 +4711,8 @@ mixin(Collection, { return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); }, - getIn: function getIn(searchKeyPath, notSetValue) { - var nested = this; - var keyPath = coerceKeyPath(searchKeyPath); - var i = 0; - while (i !== keyPath.length) { - if (!nested || !nested.get) { - warn( - 'Invalid keyPath: Value at [' + - keyPath.slice(0, i).map(quoteString) + - '] does not have a .get() method: ' + - nested + - '\nThis warning will throw in a future version' - ); - return notSetValue; - } - nested = nested.get(keyPath[i++], NOT_SET); - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; + getIn: function getIn$1(searchKeyPath, notSetValue) { + return getIn(this, notSetValue, searchKeyPath, true /* report bad path */); }, groupBy: function groupBy(grouper, context) { @@ -4743,7 +4724,10 @@ mixin(Collection, { }, hasIn: function hasIn(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; + return ( + getIn(this, NOT_SET, searchKeyPath, false /* report bad path */) !== + NOT_SET + ); }, isSubset: function isSubset(iter) { @@ -5172,6 +5156,30 @@ function warn(message) { /* eslint-enable no-console */ } +function getIn(value, notSetValue, searchKeyPath, reportBadKeyPath) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + if (!value || !value.get) { + if (reportBadKeyPath) { + warn( + 'Invalid keyPath: Value at [' + + keyPath.slice(0, i).map(quoteString) + + '] does not have a .get() method: ' + + value + + '\nThis warning will throw in a future version' + ); + } + return notSetValue; + } + value = value.get(keyPath[i++], NOT_SET); + if (value === NOT_SET) { + return notSetValue; + } + } + return value; +} + var OrderedSet = (function (Set$$1) { function OrderedSet(value) { return value === null || value === undefined diff --git a/dist/immutable.js b/dist/immutable.js index 39555e4239..5f707bebff 100644 --- a/dist/immutable.js +++ b/dist/immutable.js @@ -4717,27 +4717,8 @@ mixin(Collection, { return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); }, - getIn: function getIn(searchKeyPath, notSetValue) { - var nested = this; - var keyPath = coerceKeyPath(searchKeyPath); - var i = 0; - while (i !== keyPath.length) { - if (!nested || !nested.get) { - warn( - 'Invalid keyPath: Value at [' + - keyPath.slice(0, i).map(quoteString) + - '] does not have a .get() method: ' + - nested + - '\nThis warning will throw in a future version' - ); - return notSetValue; - } - nested = nested.get(keyPath[i++], NOT_SET); - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; + getIn: function getIn$1(searchKeyPath, notSetValue) { + return getIn(this, notSetValue, searchKeyPath, true /* report bad path */); }, groupBy: function groupBy(grouper, context) { @@ -4749,7 +4730,10 @@ mixin(Collection, { }, hasIn: function hasIn(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; + return ( + getIn(this, NOT_SET, searchKeyPath, false /* report bad path */) !== + NOT_SET + ); }, isSubset: function isSubset(iter) { @@ -5178,6 +5162,30 @@ function warn(message) { /* eslint-enable no-console */ } +function getIn(value, notSetValue, searchKeyPath, reportBadKeyPath) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + if (!value || !value.get) { + if (reportBadKeyPath) { + warn( + 'Invalid keyPath: Value at [' + + keyPath.slice(0, i).map(quoteString) + + '] does not have a .get() method: ' + + value + + '\nThis warning will throw in a future version' + ); + } + return notSetValue; + } + value = value.get(keyPath[i++], NOT_SET); + if (value === NOT_SET) { + return notSetValue; + } + } + return value; +} + var OrderedSet = (function (Set$$1) { function OrderedSet(value) { return value === null || value === undefined diff --git a/dist/immutable.min.js b/dist/immutable.min.js index 9a52a00dcc..05b069327c 100644 --- a/dist/immutable.min.js +++ b/dist/immutable.min.js @@ -6,34 +6,34 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.Immutable=t.Immutable||{})}(this,function(t){"use strict";function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;i>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?o(t)+e:e}function s(){return!0}function a(t,e,r){return(0===t&&!p(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function c(t,e){return f(t,e,0)}function h(t,e){return f(t,e,e)}function f(t,e,r){return void 0===t?r:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-(1/0)}function _(t){return(l(t)||m(t))&&!t.__ownerID}function l(t){return!(!t||!t[Re])}function v(t){return!(!t||!t[Ue])}function y(t){return!(!t||!t[Ke])}function d(t){return v(t)||y(t)}function g(t){return!(!t||!t[Le])}function m(t){return!(!t||!t[Te])}function w(t){return!(!t||"function"!=typeof t.equals||"function"!=typeof t.hashCode)}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 S(){return{value:void 0,done:!0}}function I(t){return!!M(t)}function b(t){return t&&"function"==typeof t.next}function O(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(He&&t[He]||t[Ye]);if("function"==typeof e)return e}function D(t){return t&&"number"==typeof t.length}function q(t){return!(!t||!t[tr])}function E(){return nr||(nr=new er([]))}function x(t){var e=Array.isArray(t)?new er(t):b(t)?new ur(t):I(t)?new or(t):void 0;if(e)return e.fromEntrySeq();if("object"==typeof t)return new rr(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function j(t){var e=A(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)} -function k(t){var e=A(t);if(e)return e;if("object"==typeof t)return new rr(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}function A(t){return D(t)?new er(t):b(t)?new ur(t):I(t)?new or(t):void 0}function R(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!!(w(t)&&w(e)&&t.equals(e))}function U(t,e){return K([],e||L,t,"",e&&e.length>2?[]:void 0,{"":t})}function K(t,e,r,n,i,o){var u=Array.isArray(r)?Ze:T(r)?Ge:null;if(u){if(~t.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");t.push(r),i&&""!==n&&i.push(n);var s=e.call(o,n,u(r).map(function(n,o){return K(t,e,n,o,i,r)}),i&&i.slice());return t.pop(),i&&i.pop(),s}return r}function L(t,e){return v(e)?e.toMap():e.toList()}function T(t){return t&&(t.constructor===Object||void 0===t.constructor)}function C(t){return t>>>1&1073741824|3221225471&t}function W(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&((t=t.valueOf())===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return C(r)}if("string"===e)return t.length>_r?B(t):J(t);if("function"==typeof t.hashCode)return C(t.hashCode());if("object"===e)return P(t);if("function"==typeof t.toString)return J(""+t);throw Error("Value type "+e+" cannot be hashed.")}function B(t){var e=yr[t];return void 0===e&&(e=J(t),vr===lr&&(vr=0,yr={}),vr++,yr[t]=e),e}function J(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function V(t){var e=ft(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.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=pt,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===Ve){var n=t.__iterator(e,r);return new Xe(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===Ne?Pe:Ne,r)},e}function H(t,e,r){var n=ft(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,je);return o===je?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(Ve,i);return new Xe(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function Y(t,e){var r=this,n=ft(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=V(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){ -return t.includes(e)},n.cacheResult=pt,n.__iterate=function(r,n){var i=this,u=0;return n&&o(t),t.__iterate(function(t,o){return r(t,e?o:n?i.size-++u:u++,i)},!n)},n.__iterator=function(n,i){var u=0;i&&o(t);var s=t.__iterator(Ve,!i);return new Xe(function(){var t=s.next();if(t.done)return t;var o=t.value;return z(n,e?o[0]:i?r.size-++u:u++,o[1],t)})},n}function Q(t,e,r,n){var i=ft(t);return n&&(i.has=function(n){var i=t.get(n,je);return i!==je&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,je);return o!==je&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){if(e.call(r,t,o,a))return s++,i(t,n?o:s-1,u)},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(Ve,o),s=0;return new Xe(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],h=a[1];if(e.call(r,h,c,t))return z(i,n?c:s++,h,o)}})},i}function X(t,e,r){var n=zr().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function F(t,e,r){var n=v(t),i=(g(t)?Wr():zr()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=ht(t);return i.map(function(e){return at(t,o(e))})}function G(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=c(e,i),s=h(r,i);if(o!==o||s!==s)return G(t.toSeq().cacheResult(),e,r,n);var f,p=s-o;p===p&&(f=p<0?0:p);var _=ft(t);return _.size=0===f?f:t.size&&f||void 0,!n&&q(t)&&f>=0&&(_.get=function(e,r){return e=u(this,e),e>=0&&ef)return S();var t=i.next() -;return n||e===Ne?t:e===Pe?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},_}function Z(t,e,r){var n=ft(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(Ve,i),s=!0;return new Xe(function(){if(!s)return S();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===Ve?t:z(n,a,c,t):(s=!1,S())})},n}function $(t,e,r,n){var i=ft(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(Ve,o),a=!0,c=0;return new Xe(function(){var t,o,h;do{if(t=s.next(),t.done)return n||i===Ne?t:i===Pe?z(i,c++,void 0,t):z(i,c++,t.value[1],t);var f=t.value;o=f[0],h=f[1],a&&(a=e.call(r,h,o,u))}while(a);return i===Ve?t:z(i,o,h,t)})},i}function tt(t,e){var r=v(t),n=[t].concat(e).map(function(t){return l(t)?r&&(t=We(t)):t=r?x(t):j(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&&v(i)||y(t)&&y(i))return i}var o=new er(n);return r?o=o.toKeyedSeq():y(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function et(t,e,r){var n=ft(t);return n.__iterateUncached=function(i,o){function u(t,c){t.__iterate(function(t,o){return(!e||c0}function st(t,e,r,n){var i=ft(t),o=new er(r).map(function(t){return t.size});return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this,i=this.__iterator(Ne,e),o=0;!(r=i.next()).done&&t(r.value,o++,n)!==!1;);return o},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=Ce(t),O(i?t.reverse():t)}),u=0,s=!1;return new Xe(function(){var r;return s||(r=o.map(function(t){return t.next()}),s=n?r.every(function(t){return t.done}):r.some(function(t){return t.done})),s?S():z(t,u++,e.apply(null,r.map(function(t){return t.value})))})},i}function at(t,e){return t===e?t:q(t)?e:t.constructor(e)}function ct(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function ht(t){return v(t)?We:y(t)?Be:Je}function ft(t){return Object.create((v(t)?Ge:y(t)?Ze:$e).prototype)}function pt(){return this._iter.cacheResult?(this._iter.cacheResult(), -this.size=this._iter.size,this):Fe.prototype.cacheResult.call(this)}function _t(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t>>r)&xe,s=(0===r?n:n>>>r)&xe;return new Or(e,1<>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Mr(t,o+1,u)}function xt(t,e,r){for(var n=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Kt(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function Lt(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;so?0:o-r,c=u-r;return c>Ee&&(c=Ee),function(){if(i===c)return Cr;var t=e?--c:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,c=i>o?0:o-i>>n,h=1+(u-i>>n);return h>Ee&&(h=Ee),function(){for(;;){if(s){var t=s();if(t!==Cr)return t;s=null}if(c===h)return Cr;var o=e?--h:c++;s=r(a&&a[o],n-qe,i+(o<=t.size||r<0)return t.withMutations(function(t){r<0?Yt(t,r).set(0,n):Yt(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(Ae);return r>=Xt(t._capacity)?i=Nt(i,t.__ownerID,0,r,n,s):o=Nt(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):Bt(t._origin,t._capacity,t._level,o,i):t}function Nt(t,e,n,i,o,u){var s=i>>>n&xe,a=t&&s0){var h=t&&t.array[s],f=Nt(h,e,n-qe,i,o,u);return f===h?t:(c=Vt(t,e),c.array[s]=f,c)}return a&&t.array[s]===o?t:(r(u),c=Vt(t,e),void 0===o&&s===c.array.length-1?c.array.pop():c.array[s]=o,c)}function Vt(t,e){return e&&t&&e===t.ownerID?t:new Lr(t?t.array.slice():[],e)}function Ht(t,e){if(e>=Xt(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&xe],n-=qe;return r}}function Yt(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:r<0?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var c=t._level,h=t._root,f=0;s+f<0;)h=new Lr(h&&h.array.length?[void 0,h]:[],i),c+=qe,f+=1<=1<p?new Lr([],i):l;if(l&&_>p&&sqe;d-=qe){var g=p>>>d&xe;y=y.array[g]=Vt(y.array[g],i)}y.array[p>>>qe&xe]=l}if(a=_)s-=_,a-=_,c=qe,h=null,v=v&&v.removeBefore(i,0,s);else if(s>o||_>>c&xe;if(m!==_>>>c&xe)break;m&&(f+=(1<o&&(h=h.removeBefore(i,c,s-f)),h&&_i&&(i=s.size),l(u)||(s=s.map(function(t){return U(t)})),n.push(s)} -return i>t.size&&(t=t.setSize(i)),At(t,e,n)}function Xt(t){return t>>qe<=Ee&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Gt(n,i)}function te(t){return!(!t||!t[Pr])}function ee(t,e,r,n){var i=Object.create(Nr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function re(){return Vr||(Vr=ee(0))}function ne(t,e){if(t===e)return!0;if(!l(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||v(t)!==v(e)||y(t)!==y(e)||g(t)!==g(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!d(t);if(g(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&R(i[1],t)&&(r||R(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){if(r?!t.has(e):i?!R(e,t.get(n,je)):!R(t.get(n,je),e))return u=!1,!1});return u&&t.size===s}function ie(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function oe(t){return!(!t||!t[Yr])}function ue(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 se(t,e){var r=Object.create(Qr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r} -function ae(){return Xr||(Xr=se(St()))}function ce(t,e,r,n,i,o){return yt(t.size),t.__iterate(function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)},o),r}function he(t,e){return e}function fe(t,e){return[e,t]}function pe(t){return t&&"function"==typeof t.toJS?t.toJS():t}function _e(t){return function(){return!t.apply(this,arguments)}}function le(t){return function(){return-t.apply(this,arguments)}}function ve(){return i(arguments)}function ye(t,e){return te?-1:0}function de(t){if(t.size===1/0)return 0;var e=g(t),r=v(t),n=e?1:0;return ge(t.__iterate(r?e?function(t,e){n=31*n+me(W(t),W(e))|0}:function(t,e){n=n+me(W(t),W(e))|0}:e?function(t){n=31*n+W(t)|0}:function(t){n=n+W(t)|0}),n)}function ge(t,e){return e=sr(e,3432918353),e=sr(e<<15|e>>>-15,461845907),e=sr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=sr(e^e>>>16,2246822507),e=sr(e^e>>>13,3266489909),e=C(e^e>>>16)}function me(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function we(t){if("object"!=typeof console||!console.warn)throw Error(t);console.warn(t)}function ze(t){return oe(t)&&g(t)}function Se(t,e){var r=Object.create(rn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ie(){return nn||(nn=Se(Zt()))}function be(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function Oe(t){return t._name||t.constructor.name||"Record"}function Me(t){return x(t._keys.map(function(e){return[e,t.get(e)]}))}function De(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){vt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}var qe=5,Ee=1<=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})},e}(Ze),sr="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t|=0,e|=0;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},ar=Object.isExtensible,cr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),hr="function"==typeof WeakMap;hr&&(ir=new WeakMap);var fr=0,pr="__immutablehash__";"function"==typeof Symbol&&(pr=Symbol(pr));var _r=16,lr=255,vr=0,yr={},dr=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Y(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=H(this,t,e);return this._useKeys||(n.valueSeq=function(){ -return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e,n){return t(e,n,r)},e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(Ge);dr.prototype[Le]=!0;var gr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&o(this),this._iter.__iterate(function(i){return t(i,e?r.size-++n:n++,r)},e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(Ne,e),i=0;return e&&o(this),new Xe(function(){var o=n.next();return o.done?o:z(t,e?r.size-++i:i++,o.value,o)})},e}(Ze),mr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(Ne,e);return new Xe(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},e}($e),wr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){ct(e);var n=l(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(Ne,e);return new Xe(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){ct(n);var i=l(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},e}(Ge);gr.prototype.cacheResult=dr.prototype.cacheResult=mr.prototype.cacheResult=wr.prototype.cacheResult=pt;var zr=function(t){function e(e){ -return null===e||void 0===e?St():gt(e)&&!g(e)?e:St().withMutations(function(r){var n=t(e);yt(n.size),n.forEach(function(t,e){return r.set(e,t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return St().withMutations(function(e){for(var r=0;r=t.length)throw Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}})},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return It(this,t,e)},e.prototype.setIn=function(t,e){return this.updateIn(t,je,function(){return e})},e.prototype.remove=function(t){return It(this,t,je)},e.prototype.deleteIn=function(t){if(t=[].concat(lt(t)),t.length){var e=t.pop();return this.updateIn(t,function(t){return t&&t.remove(e)})}},e.prototype.deleteAll=function(t){var e=Ce(t);return 0===e.size?this:this.withMutations(function(t){e.forEach(function(e){return t.remove(e)})})},e.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},e.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=Rt(this,lt(t),0,e,r);return n===je?e:n},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):St()},e.prototype.merge=function(){return xt(this,void 0,arguments)},e.prototype.mergeWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return xt(this,t,e)},e.prototype.mergeIn=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return this.updateIn(t,St(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},e.prototype.mergeDeep=function(){return xt(this,jt,arguments)},e.prototype.mergeDeepWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return xt(this,kt(t),e)},e.prototype.mergeDeepIn=function(t){ -for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return this.updateIn(t,St(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},e.prototype.sort=function(t){return Wr(it(this,t))},e.prototype.sortBy=function(t,e){return Wr(it(this,e,t))},e.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},e.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},e.prototype.asImmutable=function(){return this.__ensureOwner()},e.prototype.wasAltered=function(){return this.__altered},e.prototype.__iterator=function(t,e){return new xr(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?zt(this.size,this._root,t,this.__hash):0===this.size?St():(this.__ownerID=t,this.__altered=!1,this)},e}(We);zr.isMap=gt;var Sr="@@__IMMUTABLE_MAP__@@",Ir=zr.prototype;Ir[Sr]=!0,Ir.delete=Ir.remove,Ir.removeIn=Ir.deleteIn,Ir.removeAll=Ir.deleteAll,Ir["@@transducer/init"]=Ir.asMutable,Ir["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ir["@@transducer/result"]=function(t){return t.asImmutable()};var br=function(t,e){this.ownerID=t,this.entries=e};br.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o=jr)return Dt(t,h,o,u);var l=t&&t===this.ownerID,v=l?h:i(h);return _?c?f===p-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new br(t,v)}};var Or=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Or.prototype.get=function(t,e,r,n){void 0===e&&(e=W(r));var i=1<<((0===t?e:e>>>t)&xe),o=this.bitmap -;return 0==(o&i)?n:this.nodes[Ut(o&i-1)].get(t+qe,e,r,n)},Or.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=W(n));var s=(0===e?r:r>>>e)&xe,a=1<=kr)return Et(t,p,c,s,l);if(h&&!l&&2===p.length&&Ot(p[1^f]))return p[1^f];if(h&&l&&1===p.length&&Ot(l))return l;var v=t&&t===this.ownerID,y=h?l?c:c^a:c|a,d=h?l?Kt(p,f,l,v):Tt(p,f,v):Lt(p,f,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Or(t,y,d)};var Mr=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Mr.prototype.get=function(t,e,r,n){void 0===e&&(e=W(r));var i=(0===t?e:e>>>t)&xe,o=this.nodes[i];return o?o.get(t+qe,e,r,n):n},Mr.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=W(n));var s=(0===e?r:r>>>e)&xe,a=i===je,c=this.nodes,h=c[s];if(a&&!h)return this;var f=bt(h,t,e+qe,r,n,i,o,u);if(f===h)return this;var p=this.count;if(h){if(!f&&--p0&&i=0&&t0;)e[r]=arguments[r+1];return Qt(this,t,e)},e.prototype.mergeDeep=function(){return Qt(this,jt,arguments)},e.prototype.mergeDeepWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Qt(this,kt(t),e)},e.prototype.setSize=function(t){return Yt(this,0,t)},e.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:Yt(this,c(t,r),h(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=Wt(this,e);return new Xe(function(){var i=n();return i===Cr?S():z(t,e?--r:r++,i)})},e.prototype.__iterate=function(t,e){for(var r,n=this,i=e?this.size:0,o=Wt(this,e);(r=o())!==Cr&&t(r,e?--i:i++,n)!==!1;);return i},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Bt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?Jt():(this.__ownerID=t,this)},e}(Be);Rr.isList=Ct;var Ur="@@__IMMUTABLE_LIST__@@",Kr=Rr.prototype;Kr[Ur]=!0,Kr.delete=Kr.remove,Kr.setIn=Ir.setIn,Kr.deleteIn=Kr.removeIn=Ir.removeIn,Kr.update=Ir.update,Kr.updateIn=Ir.updateIn,Kr.mergeIn=Ir.mergeIn,Kr.mergeDeepIn=Ir.mergeDeepIn,Kr.withMutations=Ir.withMutations,Kr.asMutable=Ir.asMutable,Kr.asImmutable=Ir.asImmutable,Kr.wasAltered=Ir.wasAltered,Kr["@@transducer/init"]=Kr.asMutable,Kr["@@transducer/step"]=function(t,e){return t.push(e)}, -Kr["@@transducer/result"]=Ir["@@transducer/result"];var Lr=function(t,e){this.array=t,this.ownerID=e};Lr.prototype.removeBefore=function(t,e,r){if(r===e?1<>>e&xe;if(n>=this.array.length)return new Lr([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-qe,r))===u&&o)return this}if(o&&!i)return this;var s=Vt(this,t);if(!o)for(var a=0;a>>e&xe;if(n>=this.array.length)return this;var i;if(e>0){var o=this.array[n];if((i=o&&o.removeAfter(t,e-qe,r))===o&&n===this.array.length-1)return this}var u=Vt(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Tr,Cr={},Wr=function(t){function e(t){return null===t||void 0===t?Zt():Ft(t)?t:Zt().withMutations(function(e){var r=We(t);yt(r.size),r.forEach(function(t,r){return e.set(r,t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Zt()},e.prototype.set=function(t,e){return $t(this,t,e)},e.prototype.remove=function(t){return $t(this,t,je)},e.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Gt(e,r,t,this.__hash):0===this.size?Zt():(this.__ownerID=t,this._map=e,this._list=r,this)},e}(zr) -;Wr.isOrderedMap=Ft,Wr.prototype[Le]=!0,Wr.prototype.delete=Wr.prototype.remove;var Br,Jr=function(t){function e(t){return null===t||void 0===t?re():te(t)?t:re().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):ee(e,r)},e.prototype.pushAll=function(e){if(e=t(e),0===e.size)return this;if(0===this.size&&te(e))return e;yt(e.size);var r=this.size,n=this._head;return e.__iterate(function(t){r++,n={value:t,next:n}},!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):ee(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):re()},e.prototype.slice=function(e,r){if(a(e,r,this.size))return this;var n=c(e,this.size);if(h(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ee(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ee(this.size,this._head,t,this.__hash):0===this.size?re():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new er(this.toArray()).__iterate(function(e,n){return t(e,n,r)},e);for(var n=0,i=this._head;i&&t(i.value,n++,r)!==!1;)i=i.next;return n},e.prototype.__iterator=function(t,e){ -if(e)return new er(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new Xe(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return S()})},e}(Be);Jr.isStack=te;var Pr="@@__IMMUTABLE_STACK__@@",Nr=Jr.prototype;Nr[Pr]=!0,Nr.withMutations=Ir.withMutations,Nr.asMutable=Ir.asMutable,Nr.asImmutable=Ir.asImmutable,Nr.wasAltered=Ir.wasAltered,Nr.shift=Nr.pop,Nr.unshift=Nr.push,Nr.unshiftAll=Nr.pushAll,Nr["@@transducer/init"]=Nr.asMutable,Nr["@@transducer/step"]=function(t,e){return t.unshift(e)},Nr["@@transducer/result"]=Ir["@@transducer/result"];var Vr,Hr=function(t){function e(e){return null===e||void 0===e?ae():oe(e)&&!g(e)?e:ae().withMutations(function(r){var n=t(e);yt(n.size),n.forEach(function(t){return r.add(t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(We(t).keySeq())},e.intersect=function(t){return t=Ce(t).toArray(),t.length?Qr.intersect.apply(e(t.pop()),t):ae()},e.union=function(t){return t=Ce(t).toArray(),t.length?Qr.union.apply(e(t.pop()),t):ae()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return ue(this,this._map.set(t,!0))},e.prototype.remove=function(t){return ue(this,this._map.remove(t))},e.prototype.clear=function(){return ue(this,this._map.clear())},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return e=e.filter(function(t){return 0!==t.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(r){for(var n=0;n0;)e[r]=arguments[r+1];return this.union.apply(this,e)},e.prototype.sort=function(t){return en(it(this,t))},e.prototype.sortBy=function(t,e){return en(it(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},e.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?ae():(this.__ownerID=t,this._map=e,this)},e}(Je);Hr.isSet=oe;var Yr="@@__IMMUTABLE_SET__@@",Qr=Hr.prototype;Qr[Yr]=!0,Qr.delete=Qr.remove,Qr.mergeDeep=Qr.merge,Qr.mergeDeepWith=Qr.mergeWith,Qr.withMutations=Ir.withMutations,Qr.asMutable=Ir.asMutable,Qr.asImmutable=Ir.asImmutable,Qr["@@transducer/init"]=Qr.asMutable,Qr["@@transducer/step"]=function(t,e){return t.add(e)},Qr["@@transducer/result"]=Ir["@@transducer/result"],Qr.__empty=ae,Qr.__make=se;var Xr,Fr,Gr=function(t){function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);if(vt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r=0&&e=0&&rthis.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return(t=u(this,t))>=0&&(void 0!==this.size?this.size===1/0||t>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?o(t)+e:e}function s(){return!0}function a(t,e,r){return(0===t&&!p(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function c(t,e){return f(t,e,0)}function h(t,e){return f(t,e,e)}function f(t,e,r){return void 0===t?r:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-(1/0)}function _(t){return(l(t)||m(t))&&!t.__ownerID}function l(t){return!(!t||!t[Ue])}function v(t){return!(!t||!t[Ke])}function y(t){return!(!t||!t[Le])}function d(t){return v(t)||y(t)}function g(t){return!(!t||!t[Te])}function m(t){return!(!t||!t[Ce])}function w(t){return!(!t||"function"!=typeof t.equals||"function"!=typeof t.hashCode)}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 S(){return{value:void 0,done:!0}}function I(t){return!!M(t)}function b(t){return t&&"function"==typeof t.next}function O(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(Ye&&t[Ye]||t[Qe]);if("function"==typeof e)return e}function D(t){return t&&"number"==typeof t.length}function q(t){return!(!t||!t[er])}function E(){return ir||(ir=new rr([]))}function x(t){var e=Array.isArray(t)?new rr(t):b(t)?new sr(t):I(t)?new ur(t):void 0;if(e)return e.fromEntrySeq();if("object"==typeof t)return new nr(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function j(t){var e=A(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)} +function k(t){var e=A(t);if(e)return e;if("object"==typeof t)return new nr(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}function A(t){return D(t)?new rr(t):b(t)?new sr(t):I(t)?new ur(t):void 0}function R(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!!(w(t)&&w(e)&&t.equals(e))}function U(t,e){return K([],e||L,t,"",e&&e.length>2?[]:void 0,{"":t})}function K(t,e,r,n,i,o){var u=Array.isArray(r)?$e:T(r)?Ze:null;if(u){if(~t.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");t.push(r),i&&""!==n&&i.push(n);var s=e.call(o,n,u(r).map(function(n,o){return K(t,e,n,o,i,r)}),i&&i.slice());return t.pop(),i&&i.pop(),s}return r}function L(t,e){return v(e)?e.toMap():e.toList()}function T(t){return t&&(t.constructor===Object||void 0===t.constructor)}function C(t){return t>>>1&1073741824|3221225471&t}function W(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&((t=t.valueOf())===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return C(r)}if("string"===e)return t.length>lr?B(t):J(t);if("function"==typeof t.hashCode)return C(t.hashCode());if("object"===e)return P(t);if("function"==typeof t.toString)return J(""+t);throw Error("Value type "+e+" cannot be hashed.")}function B(t){var e=dr[t];return void 0===e&&(e=J(t),yr===vr&&(yr=0,dr={}),yr++,dr[t]=e),e}function J(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function V(t){var e=ft(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.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=pt,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===He){var n=t.__iterator(e,r);return new Fe(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===Ve?Ne:Ve,r)},e}function H(t,e,r){var n=ft(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,ke);return o===ke?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(He,i);return new Fe(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function Y(t,e){var r=this,n=ft(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=V(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){ +return t.includes(e)},n.cacheResult=pt,n.__iterate=function(r,n){var i=this,u=0;return n&&o(t),t.__iterate(function(t,o){return r(t,e?o:n?i.size-++u:u++,i)},!n)},n.__iterator=function(n,i){var u=0;i&&o(t);var s=t.__iterator(He,!i);return new Fe(function(){var t=s.next();if(t.done)return t;var o=t.value;return z(n,e?o[0]:i?r.size-++u:u++,o[1],t)})},n}function Q(t,e,r,n){var i=ft(t);return n&&(i.has=function(n){var i=t.get(n,ke);return i!==ke&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,ke);return o!==ke&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){if(e.call(r,t,o,a))return s++,i(t,n?o:s-1,u)},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(He,o),s=0;return new Fe(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],h=a[1];if(e.call(r,h,c,t))return z(i,n?c:s++,h,o)}})},i}function X(t,e,r){var n=Sr().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function F(t,e,r){var n=v(t),i=(g(t)?Br():Sr()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=ht(t);return i.map(function(e){return at(t,o(e))})}function G(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=c(e,i),s=h(r,i);if(o!==o||s!==s)return G(t.toSeq().cacheResult(),e,r,n);var f,p=s-o;p===p&&(f=p<0?0:p);var _=ft(t);return _.size=0===f?f:t.size&&f||void 0,!n&&q(t)&&f>=0&&(_.get=function(e,r){return e=u(this,e),e>=0&&ef)return S();var t=i.next() +;return n||e===Ve?t:e===Ne?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},_}function Z(t,e,r){var n=ft(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(He,i),s=!0;return new Fe(function(){if(!s)return S();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===He?t:z(n,a,c,t):(s=!1,S())})},n}function $(t,e,r,n){var i=ft(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(He,o),a=!0,c=0;return new Fe(function(){var t,o,h;do{if(t=s.next(),t.done)return n||i===Ve?t:i===Ne?z(i,c++,void 0,t):z(i,c++,t.value[1],t);var f=t.value;o=f[0],h=f[1],a&&(a=e.call(r,h,o,u))}while(a);return i===He?t:z(i,o,h,t)})},i}function tt(t,e){var r=v(t),n=[t].concat(e).map(function(t){return l(t)?r&&(t=Be(t)):t=r?x(t):j(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&&v(i)||y(t)&&y(i))return i}var o=new rr(n);return r?o=o.toKeyedSeq():y(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function et(t,e,r){var n=ft(t);return n.__iterateUncached=function(i,o){function u(t,c){t.__iterate(function(t,o){return(!e||c0}function st(t,e,r,n){var i=ft(t),o=new rr(r).map(function(t){return t.size});return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this,i=this.__iterator(Ve,e),o=0;!(r=i.next()).done&&t(r.value,o++,n)!==!1;);return o},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=We(t),O(i?t.reverse():t)}),u=0,s=!1;return new Fe(function(){var r;return s||(r=o.map(function(t){return t.next()}),s=n?r.every(function(t){return t.done}):r.some(function(t){return t.done})),s?S():z(t,u++,e.apply(null,r.map(function(t){return t.value})))})},i}function at(t,e){return t===e?t:q(t)?e:t.constructor(e)}function ct(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function ht(t){return v(t)?Be:y(t)?Je:Pe}function ft(t){return Object.create((v(t)?Ze:y(t)?$e:tr).prototype)}function pt(){return this._iter.cacheResult?(this._iter.cacheResult(), +this.size=this._iter.size,this):Ge.prototype.cacheResult.call(this)}function _t(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t>>r)&je,s=(0===r?n:n>>>r)&je;return new Mr(e,1<>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Dr(t,o+1,u)}function xt(t,e,r){for(var n=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Kt(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function Lt(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;so?0:o-r,c=u-r;return c>xe&&(c=xe),function(){if(i===c)return Wr;var t=e?--c:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,c=i>o?0:o-i>>n,h=1+(u-i>>n);return h>xe&&(h=xe),function(){for(;;){if(s){var t=s();if(t!==Wr)return t;s=null}if(c===h)return Wr;var o=e?--h:c++;s=r(a&&a[o],n-Ee,i+(o<=t.size||r<0)return t.withMutations(function(t){r<0?Yt(t,r).set(0,n):Yt(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(Re);return r>=Xt(t._capacity)?i=Nt(i,t.__ownerID,0,r,n,s):o=Nt(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):Bt(t._origin,t._capacity,t._level,o,i):t}function Nt(t,e,n,i,o,u){var s=i>>>n&je,a=t&&s0){var h=t&&t.array[s],f=Nt(h,e,n-Ee,i,o,u);return f===h?t:(c=Vt(t,e),c.array[s]=f,c)}return a&&t.array[s]===o?t:(r(u),c=Vt(t,e),void 0===o&&s===c.array.length-1?c.array.pop():c.array[s]=o,c)}function Vt(t,e){return e&&t&&e===t.ownerID?t:new Tr(t?t.array.slice():[],e)}function Ht(t,e){if(e>=Xt(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&je],n-=Ee;return r}}function Yt(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:r<0?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var c=t._level,h=t._root,f=0;s+f<0;)h=new Tr(h&&h.array.length?[void 0,h]:[],i),c+=Ee,f+=1<=1<p?new Tr([],i):l;if(l&&_>p&&sEe;d-=Ee){var g=p>>>d&je;y=y.array[g]=Vt(y.array[g],i)}y.array[p>>>Ee&je]=l}if(a=_)s-=_,a-=_,c=Ee,h=null,v=v&&v.removeBefore(i,0,s);else if(s>o||_>>c&je;if(m!==_>>>c&je)break;m&&(f+=(1<o&&(h=h.removeBefore(i,c,s-f)),h&&_i&&(i=s.size),l(u)||(s=s.map(function(t){return U(t)})),n.push(s)} +return i>t.size&&(t=t.setSize(i)),At(t,e,n)}function Xt(t){return t>>Ee<=xe&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Gt(n,i)}function te(t){return!(!t||!t[Nr])}function ee(t,e,r,n){var i=Object.create(Vr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function re(){return Hr||(Hr=ee(0))}function ne(t,e){if(t===e)return!0;if(!l(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||v(t)!==v(e)||y(t)!==y(e)||g(t)!==g(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!d(t);if(g(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&R(i[1],t)&&(r||R(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){if(r?!t.has(e):i?!R(e,t.get(n,ke)):!R(t.get(n,ke),e))return u=!1,!1});return u&&t.size===s}function ie(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function oe(t){return!(!t||!t[Qr])}function ue(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 se(t,e){var r=Object.create(Xr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r} +function ae(){return Fr||(Fr=se(St()))}function ce(t,e,r,n,i,o){return yt(t.size),t.__iterate(function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)},o),r}function he(t,e){return e}function fe(t,e){return[e,t]}function pe(t){return t&&"function"==typeof t.toJS?t.toJS():t}function _e(t){return function(){return!t.apply(this,arguments)}}function le(t){return function(){return-t.apply(this,arguments)}}function ve(){return i(arguments)}function ye(t,e){return te?-1:0}function de(t){if(t.size===1/0)return 0;var e=g(t),r=v(t),n=e?1:0;return ge(t.__iterate(r?e?function(t,e){n=31*n+me(W(t),W(e))|0}:function(t,e){n=n+me(W(t),W(e))|0}:e?function(t){n=31*n+W(t)|0}:function(t){n=n+W(t)|0}),n)}function ge(t,e){return e=ar(e,3432918353),e=ar(e<<15|e>>>-15,461845907),e=ar(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=ar(e^e>>>16,2246822507),e=ar(e^e>>>13,3266489909),e=C(e^e>>>16)}function me(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function we(t){if("object"!=typeof console||!console.warn)throw Error(t);console.warn(t)}function ze(t,e,r,n){for(var i=lt(r),o=0;o!==i.length;){if(!t||!t.get)return n&&we("Invalid keyPath: Value at ["+i.slice(0,o).map(dt)+"] does not have a .get() method: "+t+"\nThis warning will throw in a future version"),e;if((t=t.get(i[o++],ke))===ke)return e}return t}function Se(t){return oe(t)&&g(t)}function Ie(t,e){var r=Object.create(nn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function be(){return on||(on=Ie(Zt()))}function Oe(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function Me(t){return t._name||t.constructor.name||"Record"}function De(t){return x(t._keys.map(function(e){return[e,t.get(e)]}))}function qe(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){vt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}var Ee=5,xe=1<=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})},e}($e),ar="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t|=0,e|=0;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},cr=Object.isExtensible,hr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),fr="function"==typeof WeakMap;fr&&(or=new WeakMap);var pr=0,_r="__immutablehash__";"function"==typeof Symbol&&(_r=Symbol(_r));var lr=16,vr=255,yr=0,dr={},gr=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)}, +e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Y(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=H(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e,n){return t(e,n,r)},e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(Ze);gr.prototype[Te]=!0;var mr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&o(this),this._iter.__iterate(function(i){return t(i,e?r.size-++n:n++,r)},e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(Ve,e),i=0;return e&&o(this),new Fe(function(){var o=n.next();return o.done?o:z(t,e?r.size-++i:i++,o.value,o)})},e}($e),wr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(Ve,e);return new Fe(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},e}(tr),zr=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){ct(e);var n=l(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},e.prototype.__iterator=function(t,e){ +var r=this._iter.__iterator(Ve,e);return new Fe(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){ct(n);var i=l(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},e}(Ze);mr.prototype.cacheResult=gr.prototype.cacheResult=wr.prototype.cacheResult=zr.prototype.cacheResult=pt;var Sr=function(t){function e(e){return null===e||void 0===e?St():gt(e)&&!g(e)?e:St().withMutations(function(r){var n=t(e);yt(n.size),n.forEach(function(t,e){return r.set(e,t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return St().withMutations(function(e){for(var r=0;r=t.length)throw Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}})},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return It(this,t,e)},e.prototype.setIn=function(t,e){return this.updateIn(t,ke,function(){return e})},e.prototype.remove=function(t){return It(this,t,ke)},e.prototype.deleteIn=function(t){if(t=[].concat(lt(t)),t.length){var e=t.pop();return this.updateIn(t,function(t){return t&&t.remove(e)})}},e.prototype.deleteAll=function(t){var e=We(t);return 0===e.size?this:this.withMutations(function(t){e.forEach(function(e){return t.remove(e)})})},e.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},e.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=Rt(this,lt(t),0,e,r);return n===ke?e:n},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):St()},e.prototype.merge=function(){return xt(this,void 0,arguments)},e.prototype.mergeWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return xt(this,t,e)},e.prototype.mergeIn=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1] +;return this.updateIn(t,St(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},e.prototype.mergeDeep=function(){return xt(this,jt,arguments)},e.prototype.mergeDeepWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return xt(this,kt(t),e)},e.prototype.mergeDeepIn=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return this.updateIn(t,St(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},e.prototype.sort=function(t){return Br(it(this,t))},e.prototype.sortBy=function(t,e){return Br(it(this,e,t))},e.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},e.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},e.prototype.asImmutable=function(){return this.__ensureOwner()},e.prototype.wasAltered=function(){return this.__altered},e.prototype.__iterator=function(t,e){return new jr(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?zt(this.size,this._root,t,this.__hash):0===this.size?St():(this.__ownerID=t,this.__altered=!1,this)},e}(Be);Sr.isMap=gt;var Ir="@@__IMMUTABLE_MAP__@@",br=Sr.prototype;br[Ir]=!0,br.delete=br.remove,br.removeIn=br.deleteIn,br.removeAll=br.deleteAll,br["@@transducer/init"]=br.asMutable,br["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},br["@@transducer/result"]=function(t){return t.asImmutable()};var Or=function(t,e){this.ownerID=t,this.entries=e};Or.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o=kr)return Dt(t,h,o,u) +;var l=t&&t===this.ownerID,v=l?h:i(h);return _?c?f===p-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new Or(t,v)}};var Mr=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Mr.prototype.get=function(t,e,r,n){void 0===e&&(e=W(r));var i=1<<((0===t?e:e>>>t)&je),o=this.bitmap;return 0==(o&i)?n:this.nodes[Ut(o&i-1)].get(t+Ee,e,r,n)},Mr.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=W(n));var s=(0===e?r:r>>>e)&je,a=1<=Ar)return Et(t,p,c,s,l);if(h&&!l&&2===p.length&&Ot(p[1^f]))return p[1^f];if(h&&l&&1===p.length&&Ot(l))return l;var v=t&&t===this.ownerID,y=h?l?c:c^a:c|a,d=h?l?Kt(p,f,l,v):Tt(p,f,v):Lt(p,f,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Mr(t,y,d)};var Dr=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Dr.prototype.get=function(t,e,r,n){void 0===e&&(e=W(r));var i=(0===t?e:e>>>t)&je,o=this.nodes[i];return o?o.get(t+Ee,e,r,n):n},Dr.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=W(n));var s=(0===e?r:r>>>e)&je,a=i===ke,c=this.nodes,h=c[s];if(a&&!h)return this;var f=bt(h,t,e+Ee,r,n,i,o,u);if(f===h)return this;var p=this.count;if(h){if(!f&&--p0&&i=0&&t0;)e[r]=arguments[r+1];return Qt(this,t,e)},e.prototype.mergeDeep=function(){return Qt(this,jt,arguments)},e.prototype.mergeDeepWith=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Qt(this,kt(t),e)},e.prototype.setSize=function(t){return Yt(this,0,t)},e.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:Yt(this,c(t,r),h(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=Wt(this,e);return new Fe(function(){var i=n();return i===Wr?S():z(t,e?--r:r++,i)})},e.prototype.__iterate=function(t,e){for(var r,n=this,i=e?this.size:0,o=Wt(this,e);(r=o())!==Wr&&t(r,e?--i:i++,n)!==!1;);return i},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Bt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?Jt():(this.__ownerID=t,this)},e}(Je);Ur.isList=Ct;var Kr="@@__IMMUTABLE_LIST__@@",Lr=Ur.prototype;Lr[Kr]=!0,Lr.delete=Lr.remove,Lr.setIn=br.setIn,Lr.deleteIn=Lr.removeIn=br.removeIn,Lr.update=br.update,Lr.updateIn=br.updateIn,Lr.mergeIn=br.mergeIn,Lr.mergeDeepIn=br.mergeDeepIn, +Lr.withMutations=br.withMutations,Lr.asMutable=br.asMutable,Lr.asImmutable=br.asImmutable,Lr.wasAltered=br.wasAltered,Lr["@@transducer/init"]=Lr.asMutable,Lr["@@transducer/step"]=function(t,e){return t.push(e)},Lr["@@transducer/result"]=br["@@transducer/result"];var Tr=function(t,e){this.array=t,this.ownerID=e};Tr.prototype.removeBefore=function(t,e,r){if(r===e?1<>>e&je;if(n>=this.array.length)return new Tr([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-Ee,r))===u&&o)return this}if(o&&!i)return this;var s=Vt(this,t);if(!o)for(var a=0;a>>e&je;if(n>=this.array.length)return this;var i;if(e>0){var o=this.array[n];if((i=o&&o.removeAfter(t,e-Ee,r))===o&&n===this.array.length-1)return this}var u=Vt(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Cr,Wr={},Br=function(t){function e(t){return null===t||void 0===t?Zt():Ft(t)?t:Zt().withMutations(function(e){var r=Be(t);yt(r.size),r.forEach(function(t,r){return e.set(r,t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Zt()},e.prototype.set=function(t,e){return $t(this,t,e)},e.prototype.remove=function(t){return $t(this,t,ke)},e.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){ +if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Gt(e,r,t,this.__hash):0===this.size?Zt():(this.__ownerID=t,this._map=e,this._list=r,this)},e}(Sr);Br.isOrderedMap=Ft,Br.prototype[Te]=!0,Br.prototype.delete=Br.prototype.remove;var Jr,Pr=function(t){function e(t){return null===t||void 0===t?re():te(t)?t:re().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):ee(e,r)},e.prototype.pushAll=function(e){if(e=t(e),0===e.size)return this;if(0===this.size&&te(e))return e;yt(e.size);var r=this.size,n=this._head;return e.__iterate(function(t){r++,n={value:t,next:n}},!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):ee(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):re()},e.prototype.slice=function(e,r){if(a(e,r,this.size))return this;var n=c(e,this.size);if(h(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ee(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ee(this.size,this._head,t,this.__hash):0===this.size?re():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this +;if(e)return new rr(this.toArray()).__iterate(function(e,n){return t(e,n,r)},e);for(var n=0,i=this._head;i&&t(i.value,n++,r)!==!1;)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new rr(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new Fe(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return S()})},e}(Je);Pr.isStack=te;var Nr="@@__IMMUTABLE_STACK__@@",Vr=Pr.prototype;Vr[Nr]=!0,Vr.withMutations=br.withMutations,Vr.asMutable=br.asMutable,Vr.asImmutable=br.asImmutable,Vr.wasAltered=br.wasAltered,Vr.shift=Vr.pop,Vr.unshift=Vr.push,Vr.unshiftAll=Vr.pushAll,Vr["@@transducer/init"]=Vr.asMutable,Vr["@@transducer/step"]=function(t,e){return t.unshift(e)},Vr["@@transducer/result"]=br["@@transducer/result"];var Hr,Yr=function(t){function e(e){return null===e||void 0===e?ae():oe(e)&&!g(e)?e:ae().withMutations(function(r){var n=t(e);yt(n.size),n.forEach(function(t){return r.add(t)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(Be(t).keySeq())},e.intersect=function(t){return t=We(t).toArray(),t.length?Xr.intersect.apply(e(t.pop()),t):ae()},e.union=function(t){return t=We(t).toArray(),t.length?Xr.union.apply(e(t.pop()),t):ae()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return ue(this,this._map.set(t,!0))},e.prototype.remove=function(t){return ue(this,this._map.remove(t))},e.prototype.clear=function(){return ue(this,this._map.clear())},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return e=e.filter(function(t){return 0!==t.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(r){for(var n=0;n0;)e[r]=arguments[r+1];return this.union.apply(this,e)},e.prototype.sort=function(t){return rn(it(this,t))},e.prototype.sortBy=function(t,e){return rn(it(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},e.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?ae():(this.__ownerID=t,this._map=e,this)},e}(Pe);Yr.isSet=oe;var Qr="@@__IMMUTABLE_SET__@@",Xr=Yr.prototype;Xr[Qr]=!0,Xr.delete=Xr.remove,Xr.mergeDeep=Xr.merge,Xr.mergeDeepWith=Xr.mergeWith,Xr.withMutations=br.withMutations,Xr.asMutable=br.asMutable,Xr.asImmutable=br.asImmutable,Xr["@@transducer/init"]=Xr.asMutable,Xr["@@transducer/step"]=function(t,e){return t.add(e)},Xr["@@transducer/result"]=br["@@transducer/result"],Xr.__empty=ae,Xr.__make=se;var Fr,Gr,Zr=function(t){function e(t,r,n){if(!(this instanceof e))return new e(t,r,n);if(vt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r=0&&e=0&&rthis.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return(t=u(this,t))>=0&&(void 0!==this.size?this.size===1/0||t