/** * @license * MIT License * * Copyright (c) 2014-present, Lee Byron and other contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,(function(t){"use strict";var e="delete",r=5,n=1<>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?a(t)+e:e}function f(){return!0}function h(t,e,r){return(0===t&&!v(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function p(t,e){return l(t,e,0)}function _(t,e){return l(t,e,e)}function l(t,e,r){return void 0===t?r:v(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function v(t){return t<0||0===t&&1/t==-1/0}var y="@@__IMMUTABLE_ITERABLE__@@";function d(t){return Boolean(t&&t[y])}var g="@@__IMMUTABLE_KEYED__@@";function w(t){return Boolean(t&&t[g])}var m="@@__IMMUTABLE_INDEXED__@@";function z(t){return Boolean(t&&t[m])}function S(t){return w(t)||z(t)}var b=function(t){return d(t)?t:X(t)},I=function(t){function e(t){return w(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),O=function(t){function e(t){return z(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),E=function(t){function e(t){return d(t)&&!S(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b);b.Keyed=I,b.Indexed=O,b.Set=E;var q="@@__IMMUTABLE_SEQ__@@";function j(t){return Boolean(t&&t[q])}var M="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[M])}function x(t){return d(t)||D(t)}var A="@@__IMMUTABLE_ORDERED__@@";function k(t){return Boolean(t&&t[A])}var R=0,U=1,T=2,B="function"==typeof Symbol&&Symbol.iterator,K="@@iterator",L=B||K,C=function(t){this.next=t};function P(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 W(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!V(t)}function H(t){return t&&"function"==typeof t.next}function J(t){var e=V(t);return e&&e.call(t)}function V(t){var e=t&&(B&&t[B]||t[K]);if("function"==typeof e)return e}C.prototype.toString=function(){return"[Iterator]"},C.KEYS=R,C.VALUES=U,C.ENTRIES=T,C.prototype.inspect=C.prototype.toSource=function(){return this.toString()},C.prototype[L]=function(){return this};var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():x(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=V(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=V(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return P(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(b),F=function(t){function e(t){return null==t?nt().toKeyedSeq():d(t)?w(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(X),G=function(t){function e(t){return null==t?nt():d(t)?w(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(X),Z=function(t){function e(t){return(d(t)&&!S(t)?t:G(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(X);X.isSeq=j,X.Keyed=F,X.Set=Z,X.Indexed=G,X.prototype[q]=!0;var $=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return P(t,o,r[o])}))},e}(G),tt=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Y.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new C((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return P(t,u,r[u])}))},e}(F);tt.prototype[A]=!0;var et,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=J(this._collection),n=0;if(H(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=J(this._collection);if(!H(r))return new C(W);var n=0;return new C((function(){var e=r.next();return e.done?e:P(t,n++,e.value)}))},e}(G);function nt(){return et||(et=new $([]))}function it(t){var e=ut(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ot(t){var e=ut(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ut(t){return Q(t)?new $(t):N(t)?new rt(t):void 0}var st="@@__IMMUTABLE_MAP__@@";function at(t){return Boolean(t&&t[st])}function ct(t){return at(t)&&k(t)}function ft(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ht(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!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ft(t)&&ft(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function _t(t){return t>>>1&1073741824|3221225471&t}var lt=Object.prototype.valueOf;function vt(t){if(null==t)return yt(t);if("function"==typeof t.hashCode)return _t(t.hashCode(t));var e,r=(e=t).valueOf!==lt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return yt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return _t(e)}(r);case"string":return r.length>Et?function(t){var e=Mt[t];void 0===e&&(e=dt(t),jt===qt&&(jt=0,Mt={}),jt++,Mt[t]=e);return e}(r):dt(r);case"object":case"function":return function(t){var e;if(St&&void 0!==(e=zt.get(t)))return e;if(e=t[Ot],void 0!==e)return e;if(!wt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ot]))return e;if(void 0!==(e=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 e}if(e=mt(),St)zt.set(t,e);else{if(void 0!==gt&&!1===gt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(wt)Object.defineProperty(t,Ot,{enumerable:!1,configurable:!1,writable:!1,value:e});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[Ot]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Ot]=e}}return e}(r);case"symbol":return function(t){var e=bt[t];if(void 0!==e)return e;return e=mt(),bt[t]=e,e}(r);default:if("function"==typeof r.toString)return dt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function yt(t){return null===t?1108378658:1108378659}function dt(t){for(var e=0,r=0;r=0&&(a.get=function(e,r){return(e=c(this,e))>=0&&eo)return{value:void 0,done:!0};var t=i.next();return n||e===U||t.done?t:P(e,a-1,e===R?void 0:t.value[1],t)}))},a}function Lt(t,e,r,n){var i=Qt(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(T,o),a=!0,c=0;return new C((function(){var t,o,f;do{if((t=s.next()).done)return n||i===U?t:P(i,c++,i===R?void 0:t.value[1],t);var h=t.value;o=h[0],f=h[1],a&&(a=e.call(r,f,o,u))}while(a);return i===T?t:P(i,o,f,t)}))},i}function Ct(t,e,r){var n=Qt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,s=!1;return function t(a,c){a.__iterate((function(o,a){return(!e||c0}function Ht(t,e,r,n){var i=Qt(t),o=new $(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.__iterator(U,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=b(t),J(i?t.reverse():t)})),u=0,s=!1;return new C((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?{value:void 0,done:!0}:P(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Jt(t,e){return t===e?t:j(t)?e:t.constructor(e)}function Vt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Yt(t){return w(t)?I:z(t)?O:E}function Qt(t){return Object.create((w(t)?F:z(t)?G:Z).prototype)}function Xt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function Ft(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return ze(this,e,t)}function ze(t,e,r){for(var n=[],i=0;i0;)e[r]=arguments[r+1];return Se(this,e,t)}function Ee(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return be(t,e)}))}function qe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return Se(t,e)}))}function je(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Me(){return this.__ownerID?this:this.__ensureOwner(new s)}function De(){return this.__ensureOwner()}function xe(){return this.__altered}var Ae=function(t){function e(e){return null==e?He():at(e)&&!k(e)?e:He().withMutations((function(r){var n=t(e);$t(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.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 Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,o)},e.prototype.deleteAll=function(t){var e=b(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},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):He()},e.prototype.sort=function(t){return vr(Pt(this,t))},e.prototype.sortBy=function(t,e){return vr(Pt(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new Ce(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?Ne(this.size,this._root,t,this.__hash):0===this.size?He():(this.__ownerID=t,this.__altered=!1,this)},e}(I);Ae.isMap=at;var ke=Ae.prototype;ke[st]=!0,ke[e]=ke.remove,ke.removeAll=ke.deleteAll,ke.setIn=_e,ke.removeIn=ke.deleteIn=ve,ke.update=de,ke.updateIn=ge,ke.merge=ke.concat=we,ke.mergeWith=me,ke.mergeDeep=Ie,ke.mergeDeepWith=Oe,ke.mergeIn=Ee,ke.mergeDeepIn=qe,ke.withMutations=je,ke.wasAltered=xe,ke.asImmutable=De,ke["@@transducer/init"]=ke.asMutable=Me,ke["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},ke["@@transducer/result"]=function(t){return t.asImmutable()};var Re=function(t,e){this.ownerID=t,this.entries=e};Re.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o=Ge)return function(t,e,r,n){t||(t=new s);for(var i=new Ke(t,vt(r),[r,n]),o=0;o>>t)&i),s=this.bitmap;return 0==(s&u)?o:this.nodes[Xe(s&u-1)].get(t+r,e,n,o)},Ue.prototype.update=function(t,e,u,s,a,c,f){void 0===u&&(u=vt(s));var h=(0===e?u:u>>>e)&i,p=1<=Ze)return function(t,e,r,i,o){for(var u=0,s=new Array(n),a=0;0!==r;a++,r>>>=1)s[a]=1&r?e[u++]:void 0;return s[i]=o,new Te(t,u+1,s)}(t,y,_,h,g);if(l&&!g&&2===y.length&&Ye(y[1^v]))return y[1^v];if(l&&g&&1===y.length&&Ye(g))return g;var w=t&&t===this.ownerID,m=l?g?_:_^p:_|p,z=l?g?Fe(y,v,g,w):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u>>t)&i,s=this.nodes[u];return s?s.get(t+r,e,n,o):o},Te.prototype.update=function(t,e,n,u,s,a,c){void 0===n&&(n=vt(u));var f=(0===e?n:n>>>e)&i,h=s===o,p=this.nodes,_=p[f];if(h&&!_)return this;var l=Ve(_,t,e+r,n,u,s,a,c);if(l===_)return this;var v=this.count;if(_){if(!l&&--v<$e)return function(t,e,r,n){for(var i=0,o=0,u=new Array(r),s=0,a=1,c=e.length;s>>n)&i,c=(0===n?o:o>>>n)&i,f=a===c?[Qe(t,e,n+r,o,u)]:(s=new Ke(e,o,u),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Fe(t,e,r,n){var i=n?t:Gt(t);return i[e]=r,i}var Ge=n/4,Ze=n/2,$e=n/4,tr="@@__IMMUTABLE_LIST__@@";function er(t){return Boolean(t&&t[tr])}var rr=function(t){function e(e){var i=ar();if(null==e)return i;if(er(e))return e;var o=t(e),u=o.size;return 0===u?i:($t(u),u>0&&u=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?pr(t,e).set(0,r):pr(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=_r(t._capacity)?n=cr(n,t.__ownerID,0,e,r,o):i=cr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return sr(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ar()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){pr(r,0,e+t.length);for(var n=0;n>>e&i;if(o>=this.array.length)return new ir([],t);var u,s=0===o;if(e>0){var a=this.array[o];if((u=a&&a.removeBefore(t,e-r,n))===a&&s)return this}if(s&&!u)return this;var c=fr(this,t);if(!s)for(var f=0;f>>e&i;if(s>=this.array.length)return this;if(e>0){var a=this.array[s];if((u=a&&a.removeAfter(t,e-r,o))===a&&s===this.array.length-1)return this}var c=fr(this,t);return c.array.splice(s+1),u&&(c.array[s]=u),c};var or={};function ur(t,e){var i=t._origin,o=t._capacity,u=_r(o),s=t._tail;return a(t._root,t._level,0);function a(t,c,f){return 0===c?function(t,r){var a=r===u?s&&s.array:t&&t.array,c=r>i?0:i-r,f=o-r;f>n&&(f=n);return function(){if(c===f)return or;var t=e?--f:c++;return a&&a[t]}}(t,f):function(t,u,s){var c,f=t&&t.array,h=s>i?0:i-s>>u,p=1+(o-s>>u);p>n&&(p=n);return function(){for(;;){if(c){var t=c();if(t!==or)return t;c=null}if(h===p)return or;var n=e?--p:h++;c=a(f&&f[n],u-r,s+(n<>>n&i,h=t&&f0){var p=t&&t.array[f],_=cr(p,e,n-r,o,s,a);return _===p?t:((c=fr(t,e)).array[f]=_,c)}return h&&t.array[f]===s?t:(a&&u(a),c=fr(t,e),void 0===s&&f===c.array.length-1?c.array.pop():c.array[f]=s,c)}function fr(t,e){return e&&t&&e===t.ownerID?t:new ir(t?t.array.slice():[],e)}function hr(t,e){if(e>=_r(t._capacity))return t._tail;if(e<1<0;)n=n.array[e>>>o&i],o-=r;return n}}function pr(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var o=t.__ownerID||new s,u=t._origin,a=t._capacity,c=u+e,f=void 0===n?a:n<0?a+n:u+n;if(c===u&&f===a)return t;if(c>=f)return t.clear();for(var h=t._level,p=t._root,_=0;c+_<0;)p=new ir(p&&p.array.length?[void 0,p]:[],o),_+=1<<(h+=r);_&&(c+=_,u+=_,f+=_,a+=_);for(var l=_r(a),v=_r(f);v>=1<l?new ir([],o):y;if(y&&v>l&&cr;w-=r){var m=l>>>w&i;g=g.array[m]=fr(g.array[m],o)}g.array[l>>>r&i]=y}if(f=v)c-=v,f-=v,h=r,p=null,d=d&&d.removeBefore(o,0,c);else if(c>u||v>>h&i;if(z!==v>>>h&i)break;z&&(_+=(1<u&&(p=p.removeBefore(o,h,c-_)),p&&v>>r<=n&&a.size>=2*s.size?(i=(u=a.filter((function(t,e){return void 0!==t&&c!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(i.__ownerID=u.__ownerID=t.__ownerID)):(i=s.remove(e),u=c===a.size-1?a.pop():a.set(c,void 0))}else if(f){if(r===a.get(c)[1])return t;i=s,u=a.set(c,[e,r])}else i=s.set(e,a.size),u=a.set(a.size,[e,r]);return t.__ownerID?(t.size=i.size,t._map=i,t._list=u,t.__hash=void 0,t.__altered=!0,t):yr(i,u)}vr.isOrderedMap=ct,vr.prototype[A]=!0,vr.prototype[e]=vr.prototype.remove;var wr="@@__IMMUTABLE_STACK__@@";function mr(t){return Boolean(t&&t[wr])}var zr=function(t){function e(t){return null==t?Or():mr(t)?t:Or().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=c(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):Ir(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&mr(e))return e;$t(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):Ir(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):Or()},e.prototype.slice=function(e,r){if(h(e,r,this.size))return this;var n=p(e,this.size);if(_(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):Ir(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ir(this.size,this._head,t,this.__hash):0===this.size?Or():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new $(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new $(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new C((function(){if(n){var e=n.value;return n=n.next,P(t,r++,e)}return{value:void 0,done:!0}}))},e}(O);zr.isStack=mr;var Sr,br=zr.prototype;function Ir(t,e,r,n){var i=Object.create(br);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Or(){return Sr||(Sr=Ir(0))}br[wr]=!0,br.shift=br.pop,br.unshift=br.push,br.unshiftAll=br.pushAll,br.withMutations=je,br.wasAltered=xe,br.asImmutable=De,br["@@transducer/init"]=br.asMutable=Me,br["@@transducer/step"]=function(t,e){return t.unshift(e)},br["@@transducer/result"]=function(t){return t.asImmutable()};var Er="@@__IMMUTABLE_SET__@@";function qr(t){return Boolean(t&&t[Er])}function jr(t){return qr(t)&&k(t)}function Mr(t,e){if(t===e)return!0;if(!d(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||w(t)!==w(e)||z(t)!==z(e)||k(t)!==k(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!S(t);if(k(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&ht(i[1],t)&&(r||ht(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 u=t;t=e,e=u}var s=!0,a=e.__iterate((function(e,n){if(r?!t.has(e):i?!ht(e,t.get(n,o)):!ht(t.get(n,o),e))return s=!1,!1}));return s&&t.size===a}function Dr(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 xr(t){if(!t||"object"!=typeof t)return t;if(!d(t)){if(!ne(t))return t;t=X(t)}if(w(t)){var e={};return t.__iterate((function(t,r){e[r]=xr(t)})),e}var r=[];return t.__iterate((function(t){r.push(xr(t))})),r}var Ar=function(t){function e(e){return null==e?Br():qr(e)&&!k(e)?e:Br().withMutations((function(r){var n=t(e);$t(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(I(t).keySeq())},e.intersect=function(t){return(t=b(t).toArray()).length?Rr.intersect.apply(e(t.pop()),t):Br()},e.union=function(t){return(t=b(t).toArray()).length?Rr.union.apply(e(t.pop()),t):Br()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Ur(this,this._map.set(t,t))},e.prototype.remove=function(t){return Ur(this,this._map.remove(t))},e.prototype.clear=function(){return Ur(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=Ur(this,this._map.mapEntries((function(i){var o=i[1],u=t.call(e,o,o,r);return u!==o&&(n=!0),[u,u]}),e));return n?i:this},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(r){for(var n=0;n=0&&e=0&&r>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=_t((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.size,n)}(this))}});var Hr=b.prototype;Hr[y]=!0,Hr[L]=Hr.values,Hr.toJSON=Hr.toArray,Hr.__toStringMapper=ie,Hr.inspect=Hr.toSource=function(){return this.toString()},Hr.chain=Hr.flatMap,Hr.contains=Hr.includes,Dr(I,{flip:function(){return Jt(this,Rt(this))},mapEntries:function(t,e){var r=this,n=0;return Jt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Jt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Jr=I.prototype;Jr[g]=!0,Jr[L]=Hr.entries,Jr.toJSON=Nr,Jr.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},Dr(O,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Jt(this,Bt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Jt(this,Tt(this,!1))},slice:function(t,e){return Jt(this,Kt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=p(t,t<0?this.count():this.size);var n=this.slice(0,t);return Jt(this,1===r?n:n.concat(Gt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Jt(this,Ct(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function en(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Yr.has=Hr.includes,Yr.contains=Yr.includes,Yr.keys=Yr.values,Dr(F,Jr),Dr(G,Vr),Dr(Z,Yr);var rn=function(t){function e(t){return null==t?sn():jr(t)?t:sn().withMutations((function(e){var r=E(t);$t(r.size),r.forEach((function(t){return e.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(I(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ar);rn.isOrderedSet=jr;var nn,on=rn.prototype;function un(t,e){var r=Object.create(on);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function sn(){return nn||(nn=un(dr()))}on[A]=!0,on.zip=Vr.zip,on.zipWith=Vr.zipWith,on.zipAll=Vr.zipAll,on.__empty=sn,on.__make=un;var an=function(t,e){var r;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(x(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var u=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(t),a=i._indices={};i._name=e,i._keys=s,i._defaultValues=t;for(var c=0;c2?[]:void 0,{"":t})},t.get=ue,t.getIn=Cr,t.has=oe,t.hasIn=Wr,t.hash=vt,t.is=ht,t.isAssociative=S,t.isCollection=d,t.isImmutable=x,t.isIndexed=z,t.isKeyed=w,t.isList=er,t.isMap=at,t.isOrdered=k,t.isOrderedMap=ct,t.isOrderedSet=jr,t.isPlainObject=re,t.isRecord=D,t.isSeq=j,t.isSet=qr,t.isStack=mr,t.isValueObject=ft,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return be(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Se(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Se(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return be(e,r,t)},t.remove=ae,t.removeIn=le,t.set=ce,t.setIn=pe,t.update=ye,t.updateIn=fe,t.version="5.0.3"}));