UNPKG

flowfield

Version:

This library provides a pathfinding mechanism based on vectors field.

1 lines 110 kB
module.exports=function(t){function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}var e={};return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=3)}([function(t,r){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,r,e){!function(r,e){t.exports=e()}(0,function(){"use strict";function t(t,r){r&&(t.prototype=Object.create(r.prototype)),t.prototype.constructor=t}function r(t){return o(t)?t:E(t)}function e(t){return u(t)?t:k(t)}function n(t){return a(t)?t:x(t)}function i(t){return o(t)&&!c(t)?t:D(t)}function o(t){return!(!t||!t[Cr])}function u(t){return!(!t||!t[Fr])}function a(t){return!(!t||!t[Jr])}function c(t){return u(t)||a(t)}function s(t){return!(!t||!t[Nr])}function f(t){return t.value=!1,t}function h(t){t&&(t.value=!0)}function l(){}function p(t,r){r=r||0;for(var e=Math.max(0,t.length-r),n=new Array(e),i=0;i<e;i++)n[i]=t[i+r];return n}function _(t){return void 0===t.size&&(t.size=t.__iterate(y)),t.size}function v(t,r){if("number"!=typeof r){var e=r>>>0;if(""+e!==r||4294967295===e)return NaN;r=e}return r<0?_(t)+r:r}function y(){return!0}function d(t,r,e){return(0===t||void 0!==e&&t<=-e)&&(void 0===r||void 0!==e&&r>=e)}function g(t,r){return m(t,r,0)}function b(t,r){return m(t,r,r)}function m(t,r,e){return void 0===t?e:t<0?Math.max(0,r+t):void 0===r?t:Math.min(r,t)}function w(t){this.next=t}function j(t,r,e,n){var i=0===t?r:1===t?e:[r,e];return n?n.value=i:n={value:i,done:!1},n}function S(){return{value:void 0,done:!0}}function I(t){return!!A(t)}function O(t){return t&&"function"==typeof t.next}function z(t){var r=A(t);return r&&r.call(t)}function A(t){var r=t&&(ee&&t[ee]||t[ne]);if("function"==typeof r)return r}function M(t){return t&&"number"==typeof t.length}function E(t){return null===t||void 0===t?P():o(t)?t.toSeq():function(t){var r=W(t)||"object"==typeof t&&new R(t);if(!r)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return r}(t)}function k(t){return null===t||void 0===t?P().toKeyedSeq():o(t)?u(t)?t.toSeq():t.fromEntrySeq():B(t)}function x(t){return null===t||void 0===t?P():o(t)?u(t)?t.entrySeq():t.toIndexedSeq():$(t)}function D(t){return(null===t||void 0===t?P():o(t)?u(t)?t.entrySeq():t:$(t)).toSetSeq()}function q(t){this._array=t,this.size=t.length}function R(t){var r=Object.keys(t);this._object=t,this._keys=r,this.size=r.length}function U(t){this._iterable=t,this.size=t.length||t.size}function T(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[oe])}function P(){return ue||(ue=new q([]))}function B(t){var r=Array.isArray(t)?new q(t).fromEntrySeq():O(t)?new T(t).fromEntrySeq():I(t)?new U(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!r)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return r}function $(t){var r=W(t);if(!r)throw new TypeError("Expected Array or iterable object of values: "+t);return r}function W(t){return M(t)?new q(t):O(t)?new T(t):I(t)?new U(t):void 0}function K(t,r,e,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var a=i[e?o-u:u];if(!1===r(a[1],n?a[0]:u,t))return u+1}return u}return t.__iterateUncached(r,e)}function C(t,r,e,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new w(function(){var t=i[e?o-u:u];return u++>o?{value:void 0,done:!0}:j(r,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(r,e)}function F(t,r){return r?J(r,t,"",{"":t}):N(t)}function J(t,r,e,n){return Array.isArray(r)?t.call(n,e,x(r).map(function(e,n){return J(t,e,n,r)})):V(r)?t.call(n,e,k(r).map(function(e,n){return J(t,e,n,r)})):r}function N(t){return Array.isArray(t)?x(t).map(N).toList():V(t)?k(t).map(N).toMap():t}function V(t){return t&&(t.constructor===Object||void 0===t.constructor)}function H(t,r){if(t===r||t!=t&&r!=r)return!0;if(!t||!r)return!1;if("function"==typeof t.valueOf&&"function"==typeof r.valueOf){if(t=t.valueOf(),r=r.valueOf(),t===r||t!=t&&r!=r)return!0;if(!t||!r)return!1}return!("function"!=typeof t.equals||"function"!=typeof r.equals||!t.equals(r))}function G(t,r){if(t===r)return!0;if(!o(r)||void 0!==t.size&&void 0!==r.size&&t.size!==r.size||void 0!==t.__hash&&void 0!==r.__hash&&t.__hash!==r.__hash||u(t)!==u(r)||a(t)!==a(r)||s(t)!==s(r))return!1;if(0===t.size&&0===r.size)return!0;var e=!c(t);if(s(t)){var n=t.entries();return r.every(function(t,r){var i=n.next().value;return i&&H(i[1],t)&&(e||H(i[0],r))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===r.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var f=t;t=r,r=f}var h=!0,l=r.__iterate(function(r,n){if(e?!t.has(r):i?!H(r,t.get(n,Yr)):!H(t.get(n,Yr),r))return h=!1,!1});return h&&t.size===l}function Y(t,r){if(!(this instanceof Y))return new Y(t,r);if(this._value=t,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(ae)return ae;ae=this}}function Q(t,r){if(!t)throw new Error(r)}function X(t,r,e){if(!(this instanceof X))return new X(t,r,e);if(Q(0!==e,"Cannot step a Range by 0"),t=t||0,void 0===r&&(r=1/0),e=void 0===e?1:Math.abs(e),r<t&&(e=-e),this._start=t,this._end=r,this._step=e,this.size=Math.max(0,Math.ceil((r-t)/e-1)+1),0===this.size){if(ce)return ce;ce=this}}function Z(){throw TypeError("Abstract")}function tt(){}function rt(){}function et(){}function nt(t){return t>>>1&1073741824|3221225471&t}function it(t){if(!1===t||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var r=typeof t;if("number"===r){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return nt(e)}if("string"===r)return t.length>ye?function(t){var r=be[t];void 0===r&&(r=ot(t),ge===de&&(ge=0,be={}),ge++,be[t]=r);return r}(t):ot(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===r)return function(t){var r;if(pe&&void 0!==(r=se.get(t)))return r;if(void 0!==(r=t[ve]))return r;if(!le){if(void 0!==(r=t.propertyIsEnumerable&&t.propertyIsEnumerable[ve]))return r;if(void 0!==(r=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return r}r=++_e,1073741824&_e&&(_e=0);if(pe)se.set(t,r);else{if(void 0!==he&&!1===he(t))throw new Error("Non-extensible objects are not allowed as keys.");if(le)Object.defineProperty(t,ve,{enumerable:!1,configurable:!1,writable:!1,value:r});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[ve]=r;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[ve]=r}}return r}(t);if("function"==typeof t.toString)return ot(t.toString());throw new Error("Value type "+r+" cannot be hashed.")}function ot(t){for(var r=0,e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)|0;return nt(r)}function ut(t){Q(t!==1/0,"Cannot perform this action with an infinite size.")}function at(t){return null===t||void 0===t?gt():ct(t)&&!s(t)?t:gt().withMutations(function(r){var n=e(t);ut(n.size),n.forEach(function(t,e){return r.set(e,t)})})}function ct(t){return!(!t||!t[me])}function st(t,r){this.ownerID=t,this.entries=r}function ft(t,r,e){this.ownerID=t,this.bitmap=r,this.nodes=e}function ht(t,r,e){this.ownerID=t,this.count=r,this.nodes=e}function lt(t,r,e){this.ownerID=t,this.keyHash=r,this.entries=e}function pt(t,r,e){this.ownerID=t,this.keyHash=r,this.entry=e}function _t(t,r,e){this._type=r,this._reverse=e,this._stack=t._root&&yt(t._root)}function vt(t,r){return j(t,r[0],r[1])}function yt(t,r){return{node:t,index:0,__prev:r}}function dt(t,r,e,n){var i=Object.create(we);return i.size=t,i._root=r,i.__ownerID=e,i.__hash=n,i.__altered=!1,i}function gt(){return je||(je=dt(0))}function bt(t,r,e){var n,i;if(t._root){var o=f(Qr),u=f(Xr);if(n=mt(t._root,t.__ownerID,0,void 0,r,e,o,u),!u.value)return t;i=t.size+(o.value?e===Yr?-1:1:0)}else{if(e===Yr)return t;i=1,n=new st(t.__ownerID,[[r,e]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?dt(i,n):gt()}function mt(t,r,e,n,i,o,u,a){return t?t.update(r,e,n,i,o,u,a):o===Yr?t:(h(a),h(u),new pt(r,n,[i,o]))}function wt(t){return t.constructor===pt||t.constructor===lt}function jt(t,r,e,n,i){if(t.keyHash===n)return new lt(r,n,[t.entry,i]);var o,u=(0===e?t.keyHash:t.keyHash>>>e)&Gr,a=(0===e?n:n>>>e)&Gr;return new ft(r,1<<u|1<<a,u===a?[jt(t,r,e+Vr,n,i)]:(o=new pt(r,n,i),u<a?[t,o]:[o,t]))}function St(t,r,n){for(var i=[],u=0;u<n.length;u++){var a=n[u],c=e(a);o(a)||(c=c.map(function(t){return F(t)})),i.push(c)}return zt(t,r,i)}function It(t,r,e){return t&&t.mergeDeep&&o(r)?t.mergeDeep(r):H(t,r)?t:r}function Ot(t){return function(r,e,n){if(r&&r.mergeDeepWith&&o(e))return r.mergeDeepWith(t,e);var i=t(r,e,n);return H(r,i)?r:i}}function zt(t,r,e){return 0===(e=e.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==e.length?t.withMutations(function(t){for(var n=r?function(e,n){t.update(n,Yr,function(t){return t===Yr?e:r(t,e,n)})}:function(r,e){t.set(e,r)},i=0;i<e.length;i++)e[i].forEach(n)}):t.constructor(e[0])}function At(t,r,e,n){var i=t===Yr,o=r.next();if(o.done){var u=i?e:t,a=n(u);return a===u?t:a}Q(i||t&&t.set,"invalid keyPath");var c=o.value,s=i?Yr:t.get(c,Yr),f=At(s,r,e,n);return f===s?t:f===Yr?t.remove(c):(i?gt():t).set(c,f)}function Mt(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Et(t,r,e,n){var i=n?t:p(t);return i[r]=e,i}function kt(t){var r=Ut();if(null===t||void 0===t)return r;if(xt(t))return t;var e=n(t),i=e.size;return 0===i?r:(ut(i),i>0&&i<Hr?Rt(0,i,Vr,null,new Dt(e.toArray())):r.withMutations(function(t){t.setSize(i),e.forEach(function(r,e){return t.set(e,r)})}))}function xt(t){return!(!t||!t[ze])}function Dt(t,r){this.array=t,this.ownerID=r}function qt(t,r){function e(t,a,c){return 0===a?function(t,e){var a=e===o?u&&u.array:t&&t.array,c=e>n?0:n-e,s=i-e;s>Hr&&(s=Hr);return function(){if(c===s)return Ee;var t=r?--s:c++;return a&&a[t]}}(t,c):function(t,o,u){var a,c=t&&t.array,s=u>n?0:n-u>>o,f=1+(i-u>>o);f>Hr&&(f=Hr);return function(){for(;;){if(a){var t=a();if(t!==Ee)return t;a=null}if(s===f)return Ee;var n=r?--f:s++;a=e(c&&c[n],o-Vr,u+(n<<o))}}}(t,a,c)}var n=t._origin,i=t._capacity,o=Wt(i),u=t._tail;return e(t._root,t._level,0)}function Rt(t,r,e,n,i,o,u){var a=Object.create(Ae);return a.size=r-t,a._origin=t,a._capacity=r,a._level=e,a._root=n,a._tail=i,a.__ownerID=o,a.__hash=u,a.__altered=!1,a}function Ut(){return Me||(Me=Rt(0,0,Vr))}function Tt(t,r,e,n,i,o){var u=n>>>e&Gr,a=t&&u<t.array.length;if(!a&&void 0===i)return t;var c;if(e>0){var s=t&&t.array[u],f=Tt(s,r,e-Vr,n,i,o);return f===s?t:(c=Lt(t,r),c.array[u]=f,c)}return a&&t.array[u]===i?t:(h(o),c=Lt(t,r),void 0===i&&u===c.array.length-1?c.array.pop():c.array[u]=i,c)}function Lt(t,r){return r&&t&&r===t.ownerID?t:new Dt(t?t.array.slice():[],r)}function Pt(t,r){if(r>=Wt(t._capacity))return t._tail;if(r<1<<t._level+Vr){for(var e=t._root,n=t._level;e&&n>0;)e=e.array[r>>>n&Gr],n-=Vr;return e}}function Bt(t,r,e){void 0!==r&&(r|=0),void 0!==e&&(e|=0);var n=t.__ownerID||new l,i=t._origin,o=t._capacity,u=i+r,a=void 0===e?o:e<0?o+e:i+e;if(u===i&&a===o)return t;if(u>=a)return t.clear();for(var c=t._level,s=t._root,f=0;u+f<0;)s=new Dt(s&&s.array.length?[void 0,s]:[],n),f+=1<<(c+=Vr);f&&(u+=f,i+=f,a+=f,o+=f);for(var h=Wt(o),p=Wt(a);p>=1<<c+Vr;)s=new Dt(s&&s.array.length?[s]:[],n),c+=Vr;var _=t._tail,v=p<h?Pt(t,a-1):p>h?new Dt([],n):_;if(_&&p>h&&u<o&&_.array.length){for(var y=s=Lt(s,n),d=c;d>Vr;d-=Vr){var g=h>>>d&Gr;y=y.array[g]=Lt(y.array[g],n)}y.array[h>>>Vr&Gr]=_}if(a<o&&(v=v&&v.removeAfter(n,0,a)),u>=p)u-=p,a-=p,c=Vr,s=null,v=v&&v.removeBefore(n,0,u);else if(u>i||p<h){for(f=0;s;){var b=u>>>c&Gr;if(b!==p>>>c&Gr)break;b&&(f+=(1<<c)*b),c-=Vr,s=s.array[b]}s&&u>i&&(s=s.removeBefore(n,c,u-f)),s&&p<h&&(s=s.removeAfter(n,c,p-f)),f&&(u-=f,a-=f)}return t.__ownerID?(t.size=a-u,t._origin=u,t._capacity=a,t._level=c,t._root=s,t._tail=v,t.__hash=void 0,t.__altered=!0,t):Rt(u,a,c,s,v)}function $t(t,r,e){for(var i=[],u=0,a=0;a<e.length;a++){var c=e[a],s=n(c);s.size>u&&(u=s.size),o(c)||(s=s.map(function(t){return F(t)})),i.push(s)}return u>t.size&&(t=t.setSize(u)),zt(t,r,i)}function Wt(t){return t<Hr?0:t-1>>>Vr<<Vr}function Kt(t){return null===t||void 0===t?Jt():Ct(t)?t:Jt().withMutations(function(r){var n=e(t);ut(n.size),n.forEach(function(t,e){return r.set(e,t)})})}function Ct(t){return ct(t)&&s(t)}function Ft(t,r,e,n){var i=Object.create(Kt.prototype);return i.size=t?t.size:0,i._map=t,i._list=r,i.__ownerID=e,i.__hash=n,i}function Jt(){return ke||(ke=Ft(gt(),Ut()))}function Nt(t,r,e){var n,i,o=t._map,u=t._list,a=o.get(r),c=void 0!==a;if(e===Yr){if(!c)return t;u.size>=Hr&&u.size>=2*o.size?(n=(i=u.filter(function(t,r){return void 0!==t&&a!==r})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(r),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(c){if(e===u.get(a)[1])return t;n=o,i=u.set(a,[r,e])}else n=o.set(r,u.size),i=u.set(u.size,[r,e]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Ft(n,i)}function Vt(t,r){this._iter=t,this._useKeys=r,this.size=t.size}function Ht(t){this._iter=t,this.size=t.size}function Gt(t){this._iter=t,this.size=t.size}function Yt(t){this._iter=t,this.size=t.size}function Qt(t){var r=lr(t);return r._iter=t,r.size=t.size,r.flip=function(){return t},r.reverse=function(){var r=t.reverse.apply(this);return r.flip=function(){return t.reverse()},r},r.has=function(r){return t.includes(r)},r.includes=function(r){return t.has(r)},r.cacheResult=pr,r.__iterateUncached=function(r,e){var n=this;return t.__iterate(function(t,e){return!1!==r(e,t,n)},e)},r.__iteratorUncached=function(r,e){if(r===re){var n=t.__iterator(r,e);return new w(function(){var t=n.next();if(!t.done){var r=t.value[0];t.value[0]=t.value[1],t.value[1]=r}return t})}return t.__iterator(r===te?Zr:te,e)},r}function Xt(t,r,e){var n=lr(t);return n.size=t.size,n.has=function(r){return t.has(r)},n.get=function(n,i){var o=t.get(n,Yr);return o===Yr?i:r.call(e,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return!1!==n(r.call(e,t,i,u),i,o)},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(re,i);return new w(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return j(n,a,r.call(e,u[1],a,t),i)})},n}function Zt(t,r){var e=lr(t);return e._iter=t,e.size=t.size,e.reverse=function(){return t},t.flip&&(e.flip=function(){var r=Qt(t);return r.reverse=function(){return t.flip()},r}),e.get=function(e,n){return t.get(r?e:-1-e,n)},e.has=function(e){return t.has(r?e:-1-e)},e.includes=function(r){return t.includes(r)},e.cacheResult=pr,e.__iterate=function(r,e){var n=this;return t.__iterate(function(t,e){return r(t,e,n)},!e)},e.__iterator=function(r,e){return t.__iterator(r,!e)},e}function tr(t,r,e,n){var i=lr(t);return n&&(i.has=function(n){var i=t.get(n,Yr);return i!==Yr&&!!r.call(e,i,n,t)},i.get=function(n,i){var o=t.get(n,Yr);return o!==Yr&&r.call(e,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return t.__iterate(function(t,o,c){if(r.call(e,t,o,c))return a++,i(t,n?o:a-1,u)},o),a},i.__iteratorUncached=function(i,o){var u=t.__iterator(re,o),a=0;return new w(function(){for(;;){var o=u.next();if(o.done)return o;var c=o.value,s=c[0],f=c[1];if(r.call(e,f,s,t))return j(i,n?s:a++,f,o)}})},i}function rr(t,r,e,n){var i=t.size;if(void 0!==r&&(r|=0),void 0!==e&&(e===1/0?e=i:e|=0),d(r,e,i))return t;var o=g(r,i),u=b(e,i);if(o!=o||u!=u)return rr(t.toSeq().cacheResult(),r,e,n);var a,c=u-o;c==c&&(a=c<0?0:c);var s=lr(t);return s.size=0===a?a:t.size&&a||void 0,!n&&L(t)&&a>=0&&(s.get=function(r,e){return(r=v(this,r))>=0&&r<a?t.get(r+o,e):e}),s.__iterateUncached=function(r,e){var i=this;if(0===a)return 0;if(e)return this.cacheResult().__iterate(r,e);var u=0,c=!0,s=0;return t.__iterate(function(t,e){if(!c||!(c=u++<o))return s++,!1!==r(t,n?e:s-1,i)&&s!==a}),s},s.__iteratorUncached=function(r,e){if(0!==a&&e)return this.cacheResult().__iterator(r,e);var i=0!==a&&t.__iterator(r,e),u=0,c=0;return new w(function(){for(;u++<o;)i.next();if(++c>a)return{value:void 0,done:!0};var t=i.next();return n||r===te?t:r===Zr?j(r,c-1,void 0,t):j(r,c-1,t.value[1],t)})},s}function er(t,r,e,n){var i=lr(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,c=0;return t.__iterate(function(t,o,s){if(!a||!(a=r.call(e,t,o,s)))return c++,i(t,n?o:c-1,u)}),c},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(re,o),c=!0,s=0;return new w(function(){var t,o,f;do{if((t=a.next()).done)return n||i===te?t:i===Zr?j(i,s++,void 0,t):j(i,s++,t.value[1],t);var h=t.value;o=h[0],f=h[1],c&&(c=r.call(e,f,o,u))}while(c);return i===re?t:j(i,o,f,t)})},i}function nr(t,r,e){var n=lr(t);return n.__iterateUncached=function(n,i){function u(t,s){var f=this;t.__iterate(function(t,i){return(!r||s<r)&&o(t)?u(t,s+1):!1===n(t,e?i:a++,f)&&(c=!0),!c},i)}var a=0,c=!1;return u(t,0),a},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),a=[],c=0;return new w(function(){for(;u;){var t=u.next();if(!1===t.done){var s=t.value;if(n===re&&(s=s[1]),r&&!(a.length<r)||!o(s))return e?t:j(n,c++,s,t);a.push(u),u=s.__iterator(n,i)}else u=a.pop()}return{value:void 0,done:!0}})},n}function ir(t,r,e){r||(r=_r);var n=u(t),i=0,o=t.toSeq().map(function(r,n){return[n,r,i++,e?e(r,n,t):r]}).toArray();return o.sort(function(t,e){return r(t[3],e[3])||t[2]-e[2]}).forEach(n?function(t,r){o[r].length=2}:function(t,r){o[r]=t[1]}),n?k(o):a(t)?x(o):D(o)}function or(t,r,e){if(r||(r=_r),e){var n=t.toSeq().map(function(r,n){return[r,e(r,n,t)]}).reduce(function(t,e){return ur(r,t[1],e[1])?e:t});return n&&n[0]}return t.reduce(function(t,e){return ur(r,t,e)?e:t})}function ur(t,r,e){var n=t(e,r);return 0===n&&e!==r&&(void 0===e||null===e||e!=e)||n>0}function ar(t,e,n){var i=lr(t);return i.size=new q(n).map(function(t){return t.size}).min(),i.__iterate=function(t,r){for(var e,n=this.__iterator(te,r),i=0;!(e=n.next()).done&&!1!==t(e.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=n.map(function(t){return t=r(t),z(i?t.reverse():t)}),u=0,a=!1;return new w(function(){var r;return a||(r=o.map(function(t){return t.next()}),a=r.some(function(t){return t.done})),a?{value:void 0,done:!0}:j(t,u++,e.apply(null,r.map(function(t){return t.value})))})},i}function cr(t,r){return L(t)?r:t.constructor(r)}function sr(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function fr(t){return ut(t.size),_(t)}function hr(t){return u(t)?e:a(t)?n:i}function lr(t){return Object.create((u(t)?k:a(t)?x:D).prototype)}function pr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):E.prototype.cacheResult.call(this)}function _r(t,r){return t>r?1:t<r?-1:0}function vr(t){var e=z(t);if(!e){if(!M(t))throw new TypeError("Expected iterable or array-like: "+t);e=z(r(t))}return e}function yr(t,r){var e,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!e){e=!0;var u=Object.keys(t);!function(t,r){try{r.forEach(function(t,r){Object.defineProperty(t,r,{get:function(){return this.get(r)},set:function(t){Q(this.__ownerID,"Cannot set on an immutable record."),this.set(r,t)}})}.bind(void 0,t))}catch(t){}}(i,u),i.size=u.length,i._name=r,i._keys=u,i._defaultValues=t}this._map=at(o)},i=n.prototype=Object.create(xe);return i.constructor=n,n}function dr(t,r,e){var n=Object.create(Object.getPrototypeOf(t));return n._map=r,n.__ownerID=e,n}function gr(t){return t._name||t.constructor.name||"Record"}function br(t){return null===t||void 0===t?Sr():mr(t)&&!s(t)?t:Sr().withMutations(function(r){var e=i(t);ut(e.size),e.forEach(function(t){return r.add(t)})})}function mr(t){return!(!t||!t[De])}function wr(t,r){return t.__ownerID?(t.size=r.size,t._map=r,t):r===t._map?t:0===r.size?t.__empty():t.__make(r)}function jr(t,r){var e=Object.create(qe);return e.size=t?t.size:0,e._map=t,e.__ownerID=r,e}function Sr(){return Re||(Re=jr(gt()))}function Ir(t){return null===t||void 0===t?Ar():Or(t)?t:Ar().withMutations(function(r){var e=i(t);ut(e.size),e.forEach(function(t){return r.add(t)})})}function Or(t){return mr(t)&&s(t)}function zr(t,r){var e=Object.create(Ue);return e.size=t?t.size:0,e._map=t,e.__ownerID=r,e}function Ar(){return Te||(Te=zr(Jt()))}function Mr(t){return null===t||void 0===t?xr():Er(t)?t:xr().unshiftAll(t)}function Er(t){return!(!t||!t[Le])}function kr(t,r,e,n){var i=Object.create(Pe);return i.size=t,i._head=r,i.__ownerID=e,i.__hash=n,i.__altered=!1,i}function xr(){return Be||(Be=kr(0))}function Dr(t,r){var e=function(e){t.prototype[e]=r[e]};return Object.keys(r).forEach(e),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(r).forEach(e),t}function qr(t,r){return r}function Rr(t,r){return[r,t]}function Ur(t){return function(){return!t.apply(this,arguments)}}function Tr(t){return function(){return-t.apply(this,arguments)}}function Lr(t){return"string"==typeof t?JSON.stringify(t):String(t)}function Pr(){return p(arguments)}function Br(t,r){return t<r?1:t>r?-1:0}function $r(t){if(t.size===1/0)return 0;var r=s(t),e=u(t),n=r?1:0;return function(t,r){return r=fe(r,3432918353),r=fe(r<<15|r>>>-15,461845907),r=fe(r<<13|r>>>-13,5),r=(r+3864292196|0)^t,r=fe(r^r>>>16,2246822507),r=fe(r^r>>>13,3266489909),r=nt(r^r>>>16)}(t.__iterate(e?r?function(t,r){n=31*n+Wr(it(t),it(r))|0}:function(t,r){n=n+Wr(it(t),it(r))|0}:r?function(t){n=31*n+it(t)|0}:function(t){n=n+it(t)|0}),n)}function Wr(t,r){return t^r+2654435769+(t<<6)+(t>>2)|0}var Kr=Array.prototype.slice;t(e,r),t(n,r),t(i,r),r.isIterable=o,r.isKeyed=u,r.isIndexed=a,r.isAssociative=c,r.isOrdered=s,r.Keyed=e,r.Indexed=n,r.Set=i;var Cr="@@__IMMUTABLE_ITERABLE__@@",Fr="@@__IMMUTABLE_KEYED__@@",Jr="@@__IMMUTABLE_INDEXED__@@",Nr="@@__IMMUTABLE_ORDERED__@@",Vr=5,Hr=1<<Vr,Gr=Hr-1,Yr={},Qr={value:!1},Xr={value:!1},Zr=0,te=1,re=2,ee="function"==typeof Symbol&&Symbol.iterator,ne="@@iterator",ie=ee||ne;w.prototype.toString=function(){return"[Iterator]"},w.KEYS=Zr,w.VALUES=te,w.ENTRIES=re,w.prototype.inspect=w.prototype.toSource=function(){return this.toString()},w.prototype[ie]=function(){return this},t(E,r),E.of=function(){return E(arguments)},E.prototype.toSeq=function(){return this},E.prototype.toString=function(){return this.__toString("Seq {","}")},E.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},E.prototype.__iterate=function(t,r){return K(this,t,r,!0)},E.prototype.__iterator=function(t,r){return C(this,t,r,!0)},t(k,E),k.prototype.toKeyedSeq=function(){return this},t(x,E),x.of=function(){return x(arguments)},x.prototype.toIndexedSeq=function(){return this},x.prototype.toString=function(){return this.__toString("Seq [","]")},x.prototype.__iterate=function(t,r){return K(this,t,r,!1)},x.prototype.__iterator=function(t,r){return C(this,t,r,!1)},t(D,E),D.of=function(){return D(arguments)},D.prototype.toSetSeq=function(){return this},E.isSeq=L,E.Keyed=k,E.Set=D,E.Indexed=x;var oe="@@__IMMUTABLE_SEQ__@@";E.prototype[oe]=!0,t(q,x),q.prototype.get=function(t,r){return this.has(t)?this._array[v(this,t)]:r},q.prototype.__iterate=function(t,r){for(var e=this._array,n=e.length-1,i=0;i<=n;i++)if(!1===t(e[r?n-i:i],i,this))return i+1;return i},q.prototype.__iterator=function(t,r){var e=this._array,n=e.length-1,i=0;return new w(function(){return i>n?{value:void 0,done:!0}:j(t,i,e[r?n-i++:i++])})},t(R,k),R.prototype.get=function(t,r){return void 0===r||this.has(t)?this._object[t]:r},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,r){for(var e=this._object,n=this._keys,i=n.length-1,o=0;o<=i;o++){var u=n[r?i-o:o];if(!1===t(e[u],u,this))return o+1}return o},R.prototype.__iterator=function(t,r){var e=this._object,n=this._keys,i=n.length-1,o=0;return new w(function(){var u=n[r?i-o:o];return o++>i?{value:void 0,done:!0}:j(t,u,e[u])})},R.prototype[Nr]=!0,t(U,x),U.prototype.__iterateUncached=function(t,r){if(r)return this.cacheResult().__iterate(t,r);var e=z(this._iterable),n=0;if(O(e))for(var i;!(i=e.next()).done&&!1!==t(i.value,n++,this););return n},U.prototype.__iteratorUncached=function(t,r){if(r)return this.cacheResult().__iterator(t,r);var e=z(this._iterable);if(!O(e))return new w(S);var n=0;return new w(function(){var r=e.next();return r.done?r:j(t,n++,r.value)})},t(T,x),T.prototype.__iterateUncached=function(t,r){if(r)return this.cacheResult().__iterate(t,r);for(var e=this._iterator,n=this._iteratorCache,i=0;i<n.length;)if(!1===t(n[i],i++,this))return i;for(var o;!(o=e.next()).done;){var u=o.value;if(n[i]=u,!1===t(u,i++,this))break}return i},T.prototype.__iteratorUncached=function(t,r){if(r)return this.cacheResult().__iterator(t,r);var e=this._iterator,n=this._iteratorCache,i=0;return new w(function(){if(i>=n.length){var r=e.next();if(r.done)return r;n[i]=r.value}return j(t,i,n[i++])})};var ue;t(Y,x),Y.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Y.prototype.get=function(t,r){return this.has(t)?this._value:r},Y.prototype.includes=function(t){return H(this._value,t)},Y.prototype.slice=function(t,r){var e=this.size;return d(t,r,e)?this:new Y(this._value,b(r,e)-g(t,e))},Y.prototype.reverse=function(){return this},Y.prototype.indexOf=function(t){return H(this._value,t)?0:-1},Y.prototype.lastIndexOf=function(t){return H(this._value,t)?this.size:-1},Y.prototype.__iterate=function(t,r){for(var e=0;e<this.size;e++)if(!1===t(this._value,e,this))return e+1;return e},Y.prototype.__iterator=function(t,r){var e=this,n=0;return new w(function(){return n<e.size?j(t,n++,e._value):{value:void 0,done:!0}})},Y.prototype.equals=function(t){return t instanceof Y?H(this._value,t._value):G(t)};var ae;t(X,x),X.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},X.prototype.get=function(t,r){return this.has(t)?this._start+v(this,t)*this._step:r},X.prototype.includes=function(t){var r=(t-this._start)/this._step;return r>=0&&r<this.size&&r===Math.floor(r)},X.prototype.slice=function(t,r){return d(t,r,this.size)?this:(t=g(t,this.size),(r=b(r,this.size))<=t?new X(0,0):new X(this.get(t,this._end),this.get(r,this._end),this._step))},X.prototype.indexOf=function(t){var r=t-this._start;if(r%this._step==0){var e=r/this._step;if(e>=0&&e<this.size)return e}return-1},X.prototype.lastIndexOf=function(t){return this.indexOf(t)},X.prototype.__iterate=function(t,r){for(var e=this.size-1,n=this._step,i=r?this._start+e*n:this._start,o=0;o<=e;o++){if(!1===t(i,o,this))return o+1;i+=r?-n:n}return o},X.prototype.__iterator=function(t,r){var e=this.size-1,n=this._step,i=r?this._start+e*n:this._start,o=0;return new w(function(){var u=i;return i+=r?-n:n,o>e?{value:void 0,done:!0}:j(t,o++,u)})},X.prototype.equals=function(t){return t instanceof X?this._start===t._start&&this._end===t._end&&this._step===t._step:G(this,t)};var ce;t(Z,r),t(tt,Z),t(rt,Z),t(et,Z),Z.Keyed=tt,Z.Indexed=rt,Z.Set=et;var se,fe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,r){var e=65535&(t|=0),n=65535&(r|=0);return e*n+((t>>>16)*n+e*(r>>>16)<<16>>>0)|0},he=Object.isExtensible,le=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),pe="function"==typeof WeakMap;pe&&(se=new WeakMap);var _e=0,ve="__immutablehash__";"function"==typeof Symbol&&(ve=Symbol(ve));var ye=16,de=255,ge=0,be={};t(at,tt),at.of=function(){var t=Kr.call(arguments,0);return gt().withMutations(function(r){for(var e=0;e<t.length;e+=2){if(e+1>=t.length)throw new Error("Missing value for key: "+t[e]);r.set(t[e],t[e+1])}})},at.prototype.toString=function(){return this.__toString("Map {","}")},at.prototype.get=function(t,r){return this._root?this._root.get(0,void 0,t,r):r},at.prototype.set=function(t,r){return bt(this,t,r)},at.prototype.setIn=function(t,r){return this.updateIn(t,Yr,function(){return r})},at.prototype.remove=function(t){return bt(this,t,Yr)},at.prototype.deleteIn=function(t){return this.updateIn(t,function(){return Yr})},at.prototype.update=function(t,r,e){return 1===arguments.length?t(this):this.updateIn([t],r,e)},at.prototype.updateIn=function(t,r,e){e||(e=r,r=void 0);var n=At(this,vr(t),r,e);return n===Yr?void 0:n},at.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):gt()},at.prototype.merge=function(){return St(this,void 0,arguments)},at.prototype.mergeWith=function(t){return St(this,t,Kr.call(arguments,1))},at.prototype.mergeIn=function(t){var r=Kr.call(arguments,1);return this.updateIn(t,gt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,r):r[r.length-1]})},at.prototype.mergeDeep=function(){return St(this,It,arguments)},at.prototype.mergeDeepWith=function(t){var r=Kr.call(arguments,1);return St(this,Ot(t),r)},at.prototype.mergeDeepIn=function(t){var r=Kr.call(arguments,1);return this.updateIn(t,gt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,r):r[r.length-1]})},at.prototype.sort=function(t){return Kt(ir(this,t))},at.prototype.sortBy=function(t,r){return Kt(ir(this,r,t))},at.prototype.withMutations=function(t){var r=this.asMutable();return t(r),r.wasAltered()?r.__ensureOwner(this.__ownerID):this},at.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new l)},at.prototype.asImmutable=function(){return this.__ensureOwner()},at.prototype.wasAltered=function(){return this.__altered},at.prototype.__iterator=function(t,r){return new _t(this,t,r)},at.prototype.__iterate=function(t,r){var e=this,n=0;return this._root&&this._root.iterate(function(r){return n++,t(r[1],r[0],e)},r),n},at.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?dt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},at.isMap=ct;var me="@@__IMMUTABLE_MAP__@@",we=at.prototype;we[me]=!0,we.delete=we.remove,we.removeIn=we.deleteIn,st.prototype.get=function(t,r,e,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(H(e,i[o][0]))return i[o][1];return n},st.prototype.update=function(t,r,e,n,i,o,u){for(var a=i===Yr,c=this.entries,s=0,f=c.length;s<f&&!H(n,c[s][0]);s++);var _=s<f;if(_?c[s][1]===i:a)return this;if(h(u),(a||!_)&&h(o),!a||1!==c.length){if(!_&&!a&&c.length>=Se)return function(t,r,e,n){t||(t=new l);for(var i=new pt(t,it(e),[e,n]),o=0;o<r.length;o++){var u=r[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,c,n,i);var v=t&&t===this.ownerID,y=v?c:p(c);return _?a?s===f-1?y.pop():y[s]=y.pop():y[s]=[n,i]:y.push([n,i]),v?(this.entries=y,this):new st(t,y)}},ft.prototype.get=function(t,r,e,n){void 0===r&&(r=it(e));var i=1<<((0===t?r:r>>>t)&Gr),o=this.bitmap;return 0==(o&i)?n:this.nodes[Mt(o&i-1)].get(t+Vr,r,e,n)},ft.prototype.update=function(t,r,e,n,i,o,u){void 0===e&&(e=it(n));var a=(0===r?e:e>>>r)&Gr,c=1<<a,s=this.bitmap,f=0!=(s&c);if(!f&&i===Yr)return this;var h=Mt(s&c-1),l=this.nodes,p=f?l[h]:void 0,_=mt(p,t,r+Vr,e,n,i,o,u);if(_===p)return this;if(!f&&_&&l.length>=Ie)return function(t,r,e,n,i){for(var o=0,u=new Array(Hr),a=0;0!==e;a++,e>>>=1)u[a]=1&e?r[o++]:void 0;return u[n]=i,new ht(t,o+1,u)}(t,l,s,a,_);if(f&&!_&&2===l.length&&wt(l[1^h]))return l[1^h];if(f&&_&&1===l.length&&wt(_))return _;var v=t&&t===this.ownerID,y=f?_?s:s^c:s|c,d=f?_?Et(l,h,_,v):function(t,r,e){var n=t.length-1;if(e&&r===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u<n;u++)u===r&&(o=1),i[u]=t[u+o];return i}(l,h,v):function(t,r,e,n){var i=t.length+1;if(n&&r+1===i)return t[r]=e,t;for(var o=new Array(i),u=0,a=0;a<i;a++)a===r?(o[a]=e,u=-1):o[a]=t[a+u];return o}(l,h,_,v);return v?(this.bitmap=y,this.nodes=d,this):new ft(t,y,d)},ht.prototype.get=function(t,r,e,n){void 0===r&&(r=it(e));var i=(0===t?r:r>>>t)&Gr,o=this.nodes[i];return o?o.get(t+Vr,r,e,n):n},ht.prototype.update=function(t,r,e,n,i,o,u){void 0===e&&(e=it(n));var a=(0===r?e:e>>>r)&Gr,c=i===Yr,s=this.nodes,f=s[a];if(c&&!f)return this;var h=mt(f,t,r+Vr,e,n,i,o,u);if(h===f)return this;var l=this.count;if(f){if(!h&&--l<Oe)return function(t,r,e,n){for(var i=0,o=0,u=new Array(e),a=0,c=1,s=r.length;a<s;a++,c<<=1){var f=r[a];void 0!==f&&a!==n&&(i|=c,u[o++]=f)}return new ft(t,i,u)}(t,s,l,a)}else l++;var p=t&&t===this.ownerID,_=Et(s,a,h,p);return p?(this.count=l,this.nodes=_,this):new ht(t,l,_)},lt.prototype.get=function(t,r,e,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(H(e,i[o][0]))return i[o][1];return n},lt.prototype.update=function(t,r,e,n,i,o,u){void 0===e&&(e=it(n));var a=i===Yr;if(e!==this.keyHash)return a?this:(h(u),h(o),jt(this,t,r,e,[n,i]));for(var c=this.entries,s=0,f=c.length;s<f&&!H(n,c[s][0]);s++);var l=s<f;if(l?c[s][1]===i:a)return this;if(h(u),(a||!l)&&h(o),a&&2===f)return new pt(t,this.keyHash,c[1^s]);var _=t&&t===this.ownerID,v=_?c:p(c);return l?a?s===f-1?v.pop():v[s]=v.pop():v[s]=[n,i]:v.push([n,i]),_?(this.entries=v,this):new lt(t,this.keyHash,v)},pt.prototype.get=function(t,r,e,n){return H(e,this.entry[0])?this.entry[1]:n},pt.prototype.update=function(t,r,e,n,i,o,u){var a=i===Yr,c=H(n,this.entry[0]);return(c?i===this.entry[1]:a)?this:(h(u),a?void h(o):c?t&&t===this.ownerID?(this.entry[1]=i,this):new pt(t,this.keyHash,[n,i]):(h(o),jt(this,t,r,it(n),[n,i])))},st.prototype.iterate=lt.prototype.iterate=function(t,r){for(var e=this.entries,n=0,i=e.length-1;n<=i;n++)if(!1===t(e[r?i-n:n]))return!1},ft.prototype.iterate=ht.prototype.iterate=function(t,r){for(var e=this.nodes,n=0,i=e.length-1;n<=i;n++){var o=e[r?i-n:n];if(o&&!1===o.iterate(t,r))return!1}},pt.prototype.iterate=function(t,r){return t(this.entry)},t(_t,w),_t.prototype.next=function(){for(var t=this._type,r=this._stack;r;){var e,n=r.node,i=r.index++;if(n.entry){if(0===i)return vt(t,n.entry)}else if(n.entries){if(e=n.entries.length-1,i<=e)return vt(t,n.entries[this._reverse?e-i:i])}else if(e=n.nodes.length-1,i<=e){var o=n.nodes[this._reverse?e-i:i];if(o){if(o.entry)return vt(t,o.entry);r=this._stack=yt(o,r)}continue}r=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var je,Se=Hr/4,Ie=Hr/2,Oe=Hr/4;t(kt,rt),kt.of=function(){return this(arguments)},kt.prototype.toString=function(){return this.__toString("List [","]")},kt.prototype.get=function(t,r){if((t=v(this,t))>=0&&t<this.size){var e=Pt(this,t+=this._origin);return e&&e.array[t&Gr]}return r},kt.prototype.set=function(t,r){return function(t,r,e){if((r=v(t,r))!=r)return t;if(r>=t.size||r<0)return t.withMutations(function(t){r<0?Bt(t,r).set(0,e):Bt(t,0,r+1).set(r,e)});r+=t._origin;var n=t._tail,i=t._root,o=f(Xr);return r>=Wt(t._capacity)?n=Tt(n,t.__ownerID,0,r,e,o):i=Tt(i,t.__ownerID,t._level,r,e,o),o.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Rt(t._origin,t._capacity,t._level,i,n):t}(this,t,r)},kt.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},kt.prototype.insert=function(t,r){return this.splice(t,0,r)},kt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Vr,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ut()},kt.prototype.push=function(){var t=arguments,r=this.size;return this.withMutations(function(e){Bt(e,0,r+t.length);for(var n=0;n<t.length;n++)e.set(r+n,t[n])})},kt.prototype.pop=function(){return Bt(this,0,-1)},kt.prototype.unshift=function(){var t=arguments;return this.withMutations(function(r){Bt(r,-t.length);for(var e=0;e<t.length;e++)r.set(e,t[e])})},kt.prototype.shift=function(){return Bt(this,1)},kt.prototype.merge=function(){return $t(this,void 0,arguments)},kt.prototype.mergeWith=function(t){return $t(this,t,Kr.call(arguments,1))},kt.prototype.mergeDeep=function(){return $t(this,It,arguments)},kt.prototype.mergeDeepWith=function(t){var r=Kr.call(arguments,1);return $t(this,Ot(t),r)},kt.prototype.setSize=function(t){return Bt(this,0,t)},kt.prototype.slice=function(t,r){var e=this.size;return d(t,r,e)?this:Bt(this,g(t,e),b(r,e))},kt.prototype.__iterator=function(t,r){var e=0,n=qt(this,r);return new w(function(){var r=n();return r===Ee?{value:void 0,done:!0}:j(t,e++,r)})},kt.prototype.__iterate=function(t,r){for(var e,n=0,i=qt(this,r);(e=i())!==Ee&&!1!==t(e,n++,this););return n},kt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Rt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},kt.isList=xt;var ze="@@__IMMUTABLE_LIST__@@",Ae=kt.prototype;Ae[ze]=!0,Ae.delete=Ae.remove,Ae.setIn=we.setIn,Ae.deleteIn=Ae.removeIn=we.removeIn,Ae.update=we.update,Ae.updateIn=we.updateIn,Ae.mergeIn=we.mergeIn,Ae.mergeDeepIn=we.mergeDeepIn,Ae.withMutations=we.withMutations,Ae.asMutable=we.asMutable,Ae.asImmutable=we.asImmutable,Ae.wasAltered=we.wasAltered,Dt.prototype.removeBefore=function(t,r,e){if(e===r?1<<r:0===this.array.length)return this;var n=e>>>r&Gr;if(n>=this.array.length)return new Dt([],t);var i,o=0===n;if(r>0){var u=this.array[n];if((i=u&&u.removeBefore(t,r-Vr,e))===u&&o)return this}if(o&&!i)return this;var a=Lt(this,t);if(!o)for(var c=0;c<n;c++)a.array[c]=void 0;return i&&(a.array[n]=i),a},Dt.prototype.removeAfter=function(t,r,e){if(e===(r?1<<r:0)||0===this.array.length)return this;var n=e-1>>>r&Gr;if(n>=this.array.length)return this;var i;if(r>0){var o=this.array[n];if((i=o&&o.removeAfter(t,r-Vr,e))===o&&n===this.array.length-1)return this}var u=Lt(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Me,Ee={};t(Kt,at),Kt.of=function(){return this(arguments)},Kt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Kt.prototype.get=function(t,r){var e=this._map.get(t);return void 0!==e?this._list.get(e)[1]:r},Kt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Jt()},Kt.prototype.set=function(t,r){return Nt(this,t,r)},Kt.prototype.remove=function(t){return Nt(this,t,Yr)},Kt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Kt.prototype.__iterate=function(t,r){var e=this;return this._list.__iterate(function(r){return r&&t(r[1],r[0],e)},r)},Kt.prototype.__iterator=function(t,r){return this._list.fromEntrySeq().__iterator(t,r)},Kt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._map.__ensureOwner(t),e=this._list.__ensureOwner(t);return t?Ft(r,e,t,this.__hash):(this.__ownerID=t,this._map=r,this._list=e,this)},Kt.isOrderedMap=Ct,Kt.prototype[Nr]=!0,Kt.prototype.delete=Kt.prototype.remove;var ke;t(Vt,k),Vt.prototype.get=function(t,r){return this._iter.get(t,r)},Vt.prototype.has=function(t){return this._iter.has(t)},Vt.prototype.valueSeq=function(){return this._iter.valueSeq()},Vt.prototype.reverse=function(){var t=this,r=Zt(this,!0);return this._useKeys||(r.valueSeq=function(){return t._iter.toSeq().reverse()}),r},Vt.prototype.map=function(t,r){var e=this,n=Xt(this,t,r);return this._useKeys||(n.valueSeq=function(){return e._iter.toSeq().map(t,r)}),n},Vt.prototype.__iterate=function(t,r){var e,n=this;return this._iter.__iterate(this._useKeys?function(r,e){return t(r,e,n)}:(e=r?fr(this):0,function(i){return t(i,r?--e:e++,n)}),r)},Vt.prototype.__iterator=function(t,r){if(this._useKeys)return this._iter.__iterator(t,r);var e=this._iter.__iterator(te,r),n=r?fr(this):0;return new w(function(){var i=e.next();return i.done?i:j(t,r?--n:n++,i.value,i)})},Vt.prototype[Nr]=!0,t(Ht,x),Ht.prototype.includes=function(t){return this._iter.includes(t)},Ht.prototype.__iterate=function(t,r){var e=this,n=0;return this._iter.__iterate(function(r){return t(r,n++,e)},r)},Ht.prototype.__iterator=function(t,r){var e=this._iter.__iterator(te,r),n=0;return new w(function(){var r=e.next();return r.done?r:j(t,n++,r.value,r)})},t(Gt,D),Gt.prototype.has=function(t){return this._iter.includes(t)},Gt.prototype.__iterate=function(t,r){var e=this;return this._iter.__iterate(function(r){return t(r,r,e)},r)},Gt.prototype.__iterator=function(t,r){var e=this._iter.__iterator(te,r);return new w(function(){var r=e.next();return r.done?r:j(t,r.value,r.value,r)})},t(Yt,k),Yt.prototype.entrySeq=function(){return this._iter.toSeq()},Yt.prototype.__iterate=function(t,r){var e=this;return this._iter.__iterate(function(r){if(r){sr(r);var n=o(r);return t(n?r.get(1):r[1],n?r.get(0):r[0],e)}},r)},Yt.prototype.__iterator=function(t,r){var e=this._iter.__iterator(te,r);return new w(function(){for(;;){var r=e.next();if(r.done)return r;var n=r.value;if(n){sr(n);var i=o(n);return j(t,i?n.get(0):n[0],i?n.get(1):n[1],r)}}})},Ht.prototype.cacheResult=Vt.prototype.cacheResult=Gt.prototype.cacheResult=Yt.prototype.cacheResult=pr,t(yr,tt),yr.prototype.toString=function(){return this.__toString(gr(this)+" {","}")},yr.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},yr.prototype.get=function(t,r){if(!this.has(t))return r;var e=this._defaultValues[t];return this._map?this._map.get(t,e):e},yr.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=dr(this,gt()))},yr.prototype.set=function(t,r){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+gr(this));if(this._map&&!this._map.has(t)){if(r===this._defaultValues[t])return this}var e=this._map&&this._map.set(t,r);return this.__ownerID||e===this._map?this:dr(this,e)},yr.prototype.remove=function(t){if(!this.has(t))return this;var r=this._map&&this._map.remove(t);return this.__ownerID||r===this._map?this:dr(this,r)},yr.prototype.wasAltered=function(){return this._map.wasAltered()},yr.prototype.__iterator=function(t,r){var n=this;return e(this._defaultValues).map(function(t,r){return n.get(r)}).__iterator(t,r)},yr.prototype.__iterate=function(t,r){var n=this;return e(this._defaultValues).map(function(t,r){return n.get(r)}).__iterate(t,r)},yr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._map&&this._map.__ensureOwner(t);return t?dr(this,r,t):(this.__ownerID=t,this._map=r,this)};var xe=yr.prototype;xe.delete=xe.remove,xe.deleteIn=xe.removeIn=we.removeIn,xe.merge=we.merge,xe.mergeWith=we.mergeWith,xe.mergeIn=we.mergeIn,xe.mergeDeep=we.mergeDeep,xe.mergeDeepWith=we.mergeDeepWith,xe.mergeDeepIn=we.mergeDeepIn,xe.setIn=we.setIn,xe.update=we.update,xe.updateIn=we.updateIn,xe.withMutations=we.withMutations,xe.asMutable=we.asMutable,xe.asImmutable=we.asImmutable,t(br,et),br.of=function(){return this(arguments)},br.fromKeys=function(t){return this(e(t).keySeq())},br.prototype.toString=function(){return this.__toString("Set {","}")},br.prototype.has=function(t){return this._map.has(t)},br.prototype.add=function(t){return wr(this,this._map.set(t,!0))},br.prototype.remove=function(t){return wr(this,this._map.remove(t))},br.prototype.clear=function(){return wr(this,this._map.clear())},br.prototype.union=function(){var t=Kr.call(arguments,0);return 0===(t=t.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(r){for(var e=0;e<t.length;e++)i(t[e]).forEach(function(t){return r.add(t)})}):this.constructor(t[0])},br.prototype.intersect=function(){var t=Kr.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.includes(r)})||e.remove(r)})})},br.prototype.subtract=function(){var t=Kr.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.includes(r)})&&e.remove(r)})})},br.prototype.merge=function(){return this.union.apply(this,arguments)},br.prototype.mergeWith=function(t){var r=Kr.call(arguments,1);return this.union.apply(this,r)},br.prototype.sort=function(t){return Ir(ir(this,t))},br.prototype.sortBy=function(t,r){return Ir(ir(this,r,t))},br.prototype.wasAltered=function(){return this._map.wasAltered()},br.prototype.__iterate=function(t,r){var e=this;return this._map.__iterate(function(r,n){return t(n,n,e)},r)},br.prototype.__iterator=function(t,r){return this._map.map(function(t,r){return r}).__iterator(t,r)},br.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._map.__ensureOwner(t);return t?this.__make(r,t):(this.__ownerID=t,this._map=r,this)},br.isSet=mr;var De="@@__IMMUTABLE_SET__@@",qe=br.prototype;qe[De]=!0,qe.delete=qe.remove,qe.mergeDeep=qe.merge,qe.mergeDeepWith=qe.mergeWith,qe.withMutations=we.withMutations,qe.asMutable=we.asMutable,qe.asImmutable=we.asImmutable,qe.__empty=Sr,qe.__make=jr;var Re;t(Ir,br),Ir.of=function(){return this(arguments)},Ir.fromKeys=function(t){return this(e(t).keySeq())},Ir.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ir.isOrderedSet=Or;var Ue=Ir.prototype;Ue[Nr]=!0,Ue.__empty=Ar,Ue.__make=zr;var Te;t(Mr,rt),Mr.of=function(){return this(arguments)},Mr.prototype.toString=function(){return this.__toString("Stack [","]")},Mr.prototype.get=function(t,r){var e=this._head;for(t=v(this,t);e&&t--;)e=e.next;return e?e.value:r},Mr.prototype.peek=function(){return this._head&&this._head.value},Mr.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,e=arguments.length-1;e>=0;e--)r={value:arguments[e],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):kr(t,r)},Mr.prototype.pushAll=function(t){if(0===(t=n(t)).size)return this;ut(t.size);var r=this.size,e=this._head;return t.reverse().forEach(function(t){r++,e={value:t,next:e}}),this.__ownerID?(this.size=r,this._head=e,this.__hash=void 0,this.__altered=!0,this):kr(r,e)},Mr.prototype.pop=function(){return this.slice(1)},Mr.prototype.unshift=function(){return this.push.apply(this,arguments)},Mr.prototype.unshiftAll=function(t){return this.pushAll(t)},Mr.prototype.shift=function(){return this.pop.apply(this,arguments)},Mr.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):xr()},Mr.prototype.slice=function(t,r){if(d(t,r,this.size))return this;var e=g(t,this.size);if(b(r,this.size)!==this.size)return rt.prototype.slice.call(this,t,r);for(var n=this.size-e,i=this._head;e--;)i=i.next;return this.__ownerID?(this.size=n,this._head=i,this.__hash=void 0,this.__altered=!0,this):kr(n,i)},Mr.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?kr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Mr.prototype.__iterate=function(t,r){if(r)return this.reverse().__iterate(t);for(var e=0,n=this._head;n&&!1!==t(n.value,e++,this);)n=n.next;return e},Mr.prototype.__iterator=function(t,r){if(r)return this.reverse().__iterator(t);var e=0,n=this._head;return new w(function(){if(n){var r=n.value;return n=n.next,j(t,e++,r)}return{value:void 0,done:!0}})},Mr.isStack=Er;var Le="@@__IMMUTABLE_STACK__@@",Pe=Mr.prototype;Pe[Le]=!0,Pe.withMutations=we.withMutations,Pe.asMutable=we.asMutable,Pe.asImmutable=we.asImmutable,Pe.wasAltered=we.wasAltered;var Be;r.Iterator=w,Dr(r,{toArray:function(){ut(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(r,e){t[e]=r}),t},toIndexedSeq:function(){return new Ht(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new Vt(this,!0)},toMap:function(){return at(this.toKeyedSeq())},toObject:function(){ut(this.size);var t={};return this.__iterate(function(r,e){t[e]=r}),t},toOrderedMap:function(){return Kt(this.toKeyedSeq())},toOrderedSet:function(){return Ir(u(this)?this.valueSeq():this)},toSet:function(){return br(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Gt(this)},toSeq:function(){return a(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Mr(u(this)?this.valueSeq():this)},toList:function(){return kt(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,r){return 0===this.size?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){return cr(this,function(t,r){var n=u(t),i=[t].concat(r).map(function(t){return o(t)?n&&(t=e(t)):t=n?B(t):$(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var c=i[0];if(c===t||n&&u(c)||a(t)&&a(c))return c}var s=new q(i);return n?s=s.toKeyedSeq():a(t)||(s=s.toSetSeq()),s=s.flatten(!0),s.size=i.reduce(function(t,r){if(void 0!==t){var e=r.size;if(void 0!==e)return t+e}},0),s}(this,Kr.call(arguments,0)))},includes:function(t){return this.some(function(r){return H(r,t)})},entries:function(){return this.__iterator(re)},every:function(t,r){ut(this.size);var e=!0;return this.__iterate(function(n,i,o){if(!t.call(r,n,i,o))return e=!1,!1}),e},filter:function(t,r){return cr(this,tr(this,t,r,!0))},find:function(t,