netlify-cms-widget-async-select
Version:
An async select widget for netlify-cms which can populate entries from a valid endpoint. Allows for sending custom headers, data/value fields and transformations.
1 lines • 684 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AsyncSelectWidget=t():e.AsyncSelectWidget=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=61)}([function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){e.exports=n(63)()},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"flush",function(){return u}),n.d(t,"hydrate",function(){return a}),n.d(t,"cx",function(){return l}),n.d(t,"merge",function(){return s}),n.d(t,"getRegisteredStyles",function(){return c}),n.d(t,"injectGlobal",function(){return f}),n.d(t,"keyframes",function(){return p}),n.d(t,"css",function(){return d}),n.d(t,"sheet",function(){return h}),n.d(t,"caches",function(){return v});var r=n(60),i=void 0!==e?e:{},o=Object(r.a)(i),u=o.flush,a=o.hydrate,l=o.cx,s=o.merge,c=o.getRegisteredStyles,f=o.injectGlobal,p=o.keyframes,d=o.css,h=o.sheet,v=o.caches}.call(this,n(8))},function(e,t,n){var r=n(42),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return u(e)?e:K(e)}function r(e){return a(e)?e:Z(e)}function i(e){return l(e)?e:$(e)}function o(e){return u(e)&&!s(e)?e:Q(e)}function u(e){return!(!e||!e[f])}function a(e){return!(!e||!e[p])}function l(e){return!(!e||!e[d])}function s(e){return a(e)||l(e)}function c(e){return!(!e||!e[h])}t(r,n),t(i,n),t(o,n),n.isIterable=u,n.isKeyed=a,n.isIndexed=l,n.isAssociative=s,n.isOrdered=c,n.Keyed=r,n.Indexed=i,n.Set=o;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",d="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",v=5,m=1<<v,y=m-1,g={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function x(e){e&&(e.value=!0)}function C(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function E(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?E(e)+t:t}function O(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function L(e,t){return P(e,t,0)}function M(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,j=1,A=2,D="function"==typeof Symbol&&Symbol.iterator,z="@@iterator",N=D||z;function F(e){this.next=e}function R(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function U(){return{value:void 0,done:!0}}function B(e){return!!q(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=q(e);return t&&t.call(e)}function q(e){var t=e&&(D&&e[D]||e[z]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function K(e){return null==e?oe():u(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function Z(e){return null==e?oe().toKeyedSeq():u(e)?a(e)?e.toSeq():e.fromEntrySeq():ue(e)}function $(e){return null==e?oe():u(e)?a(e)?e.entrySeq():e.toIndexedSeq():ae(e)}function Q(e){return(null==e?oe():u(e)?a(e)?e.entrySeq():e:ae(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=I,F.VALUES=j,F.ENTRIES=A,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[N]=function(){return this},t(K,n),K.of=function(){return K(arguments)},K.prototype.toSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq {","}")},K.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},K.prototype.__iterate=function(e,t){return se(this,e,t,!0)},K.prototype.__iterator=function(e,t){return ce(this,e,t,!0)},t(Z,K),Z.prototype.toKeyedSeq=function(){return this},t($,K),$.of=function(){return $(arguments)},$.prototype.toIndexedSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq [","]")},$.prototype.__iterate=function(e,t){return se(this,e,t,!1)},$.prototype.__iterator=function(e,t){return ce(this,e,t,!1)},t(Q,K),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},K.isSeq=ie,K.Keyed=Z,K.Set=Q,K.Indexed=$;var Y,G,X,J="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[J])}function oe(){return Y||(Y=new ee([]))}function ue(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():V(e)?new re(e).fromEntrySeq():B(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ae(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return H(e)?new ee(e):V(e)?new re(e):B(e)?new ne(e):void 0}function se(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var a=i[n?o-u:u];if(!1===t(a[1],r?a[0]:u,e))return u+1}return u}return e.__iterateUncached(t,n)}function ce(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,u=0;return new F(function(){var e=i[n?o-u:u];return u++>o?{value:void 0,done:!0}:R(t,r?e[0]:u-1,e[1])})}return e.__iteratorUncached(t,n)}function fe(e,t){return t?function e(t,n,r,i){return Array.isArray(n)?t.call(i,r,$(n).map(function(r,i){return e(t,r,i,n)})):de(n)?t.call(i,r,Z(n).map(function(r,i){return e(t,r,i,n)})):n}(t,e,"",{"":e}):pe(e)}function pe(e){return Array.isArray(e)?$(e).map(pe).toList():de(e)?Z(e).map(pe).toMap():e}function de(e){return e&&(e.constructor===Object||void 0===e.constructor)}function he(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ve(e,t){if(e===t)return!0;if(!u(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||l(e)!==l(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!s(e);if(c(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&he(i[1],e)&&(n||he(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var f=!0,p=t.__iterate(function(t,r){if(n?!e.has(t):i?!he(t,e.get(r,g)):!he(e.get(r,g),t))return f=!1,!1});return f&&e.size===p}function me(e,t){if(!(this instanceof me))return new me(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(G)return G;G=this}}function ye(e,t){if(!e)throw new Error(t)}function ge(e,t,n){if(!(this instanceof ge))return new ge(e,t,n);if(ye(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(X)return X;X=this}}function be(){throw TypeError("Abstract")}function _e(){}function we(){}function xe(){}K.prototype[J]=!0,t(ee,$),ee.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===e(n[t?r-i:i],i,this))return i+1;return i},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,i=0;return new F(function(){return i>r?{value:void 0,done:!0}:R(e,i,n[t?r-i++:i++])})},t(te,Z),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var u=r[t?i-o:o];if(!1===e(n[u],u,this))return o+1}return o},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new F(function(){var u=r[t?i-o:o];return o++>i?{value:void 0,done:!0}:R(e,u,n[u])})},te.prototype[h]=!0,t(ne,$),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=W(n),i=0;if(V(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=W(n);if(!V(r))return new F(U);var i=0;return new F(function(){var t=r.next();return t.done?t:R(e,i++,t.value)})},t(re,$),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===e(i[o],o++,this))return o;for(;!(n=r.next()).done;){var u=n.value;if(i[o]=u,!1===e(u,o++,this))break}return o},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new F(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return R(e,i,r[i++])})},t(me,$),me.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},me.prototype.get=function(e,t){return this.has(e)?this._value:t},me.prototype.includes=function(e){return he(this._value,e)},me.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new me(this._value,M(t,n)-L(e,n))},me.prototype.reverse=function(){return this},me.prototype.indexOf=function(e){return he(this._value,e)?0:-1},me.prototype.lastIndexOf=function(e){return he(this._value,e)?this.size:-1},me.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},me.prototype.__iterator=function(e,t){var n=this,r=0;return new F(function(){return r<n.size?R(e,r++,n._value):{value:void 0,done:!0}})},me.prototype.equals=function(e){return e instanceof me?he(this._value,e._value):ve(e)},t(ge,$),ge.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ge.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ge.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ge.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=L(e,this.size),(t=M(t,this.size))<=e?new ge(0,0):new ge(this.get(e,this._end),this.get(t,this._end),this._step))},ge.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ge.prototype.lastIndexOf=function(e){return this.indexOf(e)},ge.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===e(i,o,this))return o+1;i+=t?-r:r}return o},ge.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;return new F(function(){var u=i;return i+=t?-r:r,o>n?{value:void 0,done:!0}:R(e,o++,u)})},ge.prototype.equals=function(e){return e instanceof ge?this._start===e._start&&this._end===e._end&&this._step===e._step:ve(this,e)},t(be,n),t(_e,be),t(we,be),t(xe,be),be.Keyed=_e,be.Indexed=we,be.Set=xe;var Ce="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ee(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t,n,r=typeof e;if("number"===r){if(e!=e||e===1/0)return 0;var i=0|e;for(i!==e&&(i^=4294967295*e);e>4294967295;)i^=e/=4294967295;return Se(i)}if("string"===r)return e.length>je?(void 0===(n=ze[t=e])&&(n=ke(t),De===Ae&&(De=0,ze={}),De++,ze[t]=n),n):ke(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===r)return function(e){var t;if(Me&&void 0!==(t=Oe.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Le){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Pe,1073741824&Pe&&(Pe=0),Me)Oe.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Le)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return ke(e.toString());throw new Error("Value type "+r+" cannot be hashed.")}function ke(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Se(t)}var Oe,Te=Object.isExtensible,Le=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),Me="function"==typeof WeakMap;Me&&(Oe=new WeakMap);var Pe=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var je=16,Ae=255,De=0,ze={};function Ne(e){ye(e!==1/0,"Cannot perform this action with an infinite size.")}function Fe(e){return null==e?Xe():Re(e)&&!c(e)?e:Xe().withMutations(function(t){var n=r(e);Ne(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function Re(e){return!(!e||!e[Be])}t(Fe,_e),Fe.of=function(){var t=e.call(arguments,0);return Xe().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Fe.prototype.toString=function(){return this.__toString("Map {","}")},Fe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Fe.prototype.set=function(e,t){return Je(this,e,t)},Fe.prototype.setIn=function(e,t){return this.updateIn(e,g,function(){return t})},Fe.prototype.remove=function(e){return Je(this,e,g)},Fe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return g})},Fe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Fe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,i){var o=t===g,u=n.next();if(u.done){var a=o?r:t,l=i(a);return l===a?t:l}ye(o||t&&t.set,"invalid keyPath");var s=u.value,c=o?g:t.get(s,g),f=e(c,n,r,i);return f===c?t:f===g?t.remove(s):(o?Xe():t).set(s,f)}(this,nn(e),t,n);return r===g?void 0:r},Fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Fe.prototype.merge=function(){return rt(this,void 0,arguments)},Fe.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},Fe.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Fe.prototype.mergeDeep=function(){return rt(this,it,arguments)},Fe.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,ot(t),n)},Fe.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Fe.prototype.sort=function(e){return Lt(Ht(this,e))},Fe.prototype.sortBy=function(e,t){return Lt(Ht(this,t,e))},Fe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Fe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new C)},Fe.prototype.asImmutable=function(){return this.__ensureOwner()},Fe.prototype.wasAltered=function(){return this.__altered},Fe.prototype.__iterator=function(e,t){return new $e(this,e,t)},Fe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Fe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ge(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Fe.isMap=Re;var Ue,Be="@@__IMMUTABLE_MAP__@@",Ve=Fe.prototype;function We(e,t){this.ownerID=e,this.entries=t}function qe(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function He(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ke(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ze(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function $e(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Ye(e._root)}function Qe(e,t){return R(e,t[0],t[1])}function Ye(e,t){return{node:e,index:0,__prev:t}}function Ge(e,t,n,r){var i=Object.create(Ve);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xe(){return Ue||(Ue=Ge(0))}function Je(e,t,n){var r,i;if(e._root){var o=w(b),u=w(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,o,u),!u.value)return e;i=e.size+(o.value?n===g?-1:1:0)}else{if(n===g)return e;i=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ge(i,r):Xe()}function et(e,t,n,r,i,o,u,a){return e?e.update(t,n,r,i,o,u,a):o===g?e:(x(a),x(u),new Ze(t,r,[i,o]))}function tt(e){return e.constructor===Ze||e.constructor===Ke}function nt(e,t,n,r,i){if(e.keyHash===r)return new Ke(t,r,[e.entry,i]);var o,u=(0===n?e.keyHash:e.keyHash>>>n)&y,a=(0===n?r:r>>>n)&y,l=u===a?[nt(e,t,n+v,r,i)]:(o=new Ze(t,r,i),u<a?[e,o]:[o,e]);return new qe(t,1<<u|1<<a,l)}function rt(e,t,n){for(var i=[],o=0;o<n.length;o++){var a=n[o],l=r(a);u(a)||(l=l.map(function(e){return fe(e)})),i.push(l)}return ut(e,t,i)}function it(e,t,n){return e&&e.mergeDeep&&u(t)?e.mergeDeep(t):he(e,t)?e:t}function ot(e){return function(t,n,r){if(t&&t.mergeDeepWith&&u(n))return t.mergeDeepWith(e,n);var i=e(t,n,r);return he(t,i)?t:i}}function ut(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,g,function(e){return e===g?n:t(e,n,r)})}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)}):e.constructor(n[0])}function at(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function lt(e,t,n,r){var i=r?e:S(e);return i[t]=n,i}Ve[Be]=!0,Ve.delete=Ve.remove,Ve.removeIn=Ve.deleteIn,We.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(he(n,i[o][0]))return i[o][1];return r},We.prototype.update=function(e,t,n,r,i,o,u){for(var a=i===g,l=this.entries,s=0,c=l.length;s<c&&!he(r,l[s][0]);s++);var f=s<c;if(f?l[s][1]===i:a)return this;if(x(u),(a||!f)&&x(o),!a||1!==l.length){if(!f&&!a&&l.length>=st)return function(e,t,n,r){e||(e=new C);for(var i=new Ze(e,Ee(n),[n,r]),o=0;o<t.length;o++){var u=t[o];i=i.update(e,0,void 0,u[0],u[1])}return i}(e,l,r,i);var p=e&&e===this.ownerID,d=p?l:S(l);return f?a?s===c-1?d.pop():d[s]=d.pop():d[s]=[r,i]:d.push([r,i]),p?(this.entries=d,this):new We(e,d)}},qe.prototype.get=function(e,t,n,r){void 0===t&&(t=Ee(n));var i=1<<((0===e?t:t>>>e)&y),o=this.bitmap;return 0==(o&i)?r:this.nodes[at(o&i-1)].get(e+v,t,n,r)},qe.prototype.update=function(e,t,n,r,i,o,u){void 0===n&&(n=Ee(r));var a=(0===t?n:n>>>t)&y,l=1<<a,s=this.bitmap,c=0!=(s&l);if(!c&&i===g)return this;var f=at(s&l-1),p=this.nodes,d=c?p[f]:void 0,h=et(d,e,t+v,n,r,i,o,u);if(h===d)return this;if(!c&&h&&p.length>=ct)return function(e,t,n,r,i){for(var o=0,u=new Array(m),a=0;0!==n;a++,n>>>=1)u[a]=1&n?t[o++]:void 0;return u[r]=i,new He(e,o+1,u)}(e,p,s,a,h);if(c&&!h&&2===p.length&&tt(p[1^f]))return p[1^f];if(c&&h&&1===p.length&&tt(h))return h;var b=e&&e===this.ownerID,_=c?h?s:s^l:s|l,w=c?h?lt(p,f,h,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,u=0;u<r;u++)u===t&&(o=1),i[u]=e[u+o];return i}(p,f,b):function(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),u=0,a=0;a<i;a++)a===t?(o[a]=n,u=-1):o[a]=e[a+u];return o}(p,f,h,b);return b?(this.bitmap=_,this.nodes=w,this):new qe(e,_,w)},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Ee(n));var i=(0===e?t:t>>>e)&y,o=this.nodes[i];return o?o.get(e+v,t,n,r):r},He.prototype.update=function(e,t,n,r,i,o,u){void 0===n&&(n=Ee(r));var a=(0===t?n:n>>>t)&y,l=i===g,s=this.nodes,c=s[a];if(l&&!c)return this;var f=et(c,e,t+v,n,r,i,o,u);if(f===c)return this;var p=this.count;if(c){if(!f&&--p<ft)return function(e,t,n,r){for(var i=0,o=0,u=new Array(n),a=0,l=1,s=t.length;a<s;a++,l<<=1){var c=t[a];void 0!==c&&a!==r&&(i|=l,u[o++]=c)}return new qe(e,i,u)}(e,s,p,a)}else p++;var d=e&&e===this.ownerID,h=lt(s,a,f,d);return d?(this.count=p,this.nodes=h,this):new He(e,p,h)},Ke.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(he(n,i[o][0]))return i[o][1];return r},Ke.prototype.update=function(e,t,n,r,i,o,u){void 0===n&&(n=Ee(r));var a=i===g;if(n!==this.keyHash)return a?this:(x(u),x(o),nt(this,e,t,n,[r,i]));for(var l=this.entries,s=0,c=l.length;s<c&&!he(r,l[s][0]);s++);var f=s<c;if(f?l[s][1]===i:a)return this;if(x(u),(a||!f)&&x(o),a&&2===c)return new Ze(e,this.keyHash,l[1^s]);var p=e&&e===this.ownerID,d=p?l:S(l);return f?a?s===c-1?d.pop():d[s]=d.pop():d[s]=[r,i]:d.push([r,i]),p?(this.entries=d,this):new Ke(e,this.keyHash,d)},Ze.prototype.get=function(e,t,n,r){return he(n,this.entry[0])?this.entry[1]:r},Ze.prototype.update=function(e,t,n,r,i,o,u){var a=i===g,l=he(r,this.entry[0]);return(l?i===this.entry[1]:a)?this:(x(u),a?void x(o):l?e&&e===this.ownerID?(this.entry[1]=i,this):new Ze(e,this.keyHash,[r,i]):(x(o),nt(this,e,t,Ee(r),[r,i])))},We.prototype.iterate=Ke.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===e(n[t?i-r:r]))return!1},qe.prototype.iterate=He.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&!1===o.iterate(e,t))return!1}},Ze.prototype.iterate=function(e,t){return e(this.entry)},t($e,F),$e.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,i=t.index++;if(r.entry){if(0===i)return Qe(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return Qe(e,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Qe(e,o.entry);t=this._stack=Ye(o,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var st=m/4,ct=m/2,ft=m/4;function pt(e){var t=xt();if(null==e)return t;if(dt(e))return e;var n=i(e),r=n.size;return 0===r?t:(Ne(r),r>0&&r<m?wt(0,r,v,null,new mt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function dt(e){return!(!e||!e[ht])}t(pt,we),pt.of=function(){return this(arguments)},pt.prototype.toString=function(){return this.__toString("List [","]")},pt.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Et(this,e+=this._origin);return n&&n.array[e&y]}return t},pt.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?kt(e,t).set(0,n):kt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=w(_);return t>=Tt(e._capacity)?r=Ct(r,e.__ownerID,0,t,n,o):i=Ct(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):wt(e._origin,e._capacity,e._level,i,r):e}(this,e,t)},pt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},pt.prototype.insert=function(e,t){return this.splice(e,0,t)},pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=v,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):xt()},pt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){kt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},pt.prototype.pop=function(){return kt(this,0,-1)},pt.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){kt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},pt.prototype.shift=function(){return kt(this,1)},pt.prototype.merge=function(){return Ot(this,void 0,arguments)},pt.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ot(this,t,n)},pt.prototype.mergeDeep=function(){return Ot(this,it,arguments)},pt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ot(this,ot(t),n)},pt.prototype.setSize=function(e){return kt(this,0,e)},pt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:kt(this,L(e,n),M(t,n))},pt.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new F(function(){var t=r();return t===bt?{value:void 0,done:!0}:R(e,n++,t)})},pt.prototype.__iterate=function(e,t){for(var n,r=0,i=_t(this,t);(n=i())!==bt&&!1!==e(n,r++,this););return r},pt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},pt.isList=dt;var ht="@@__IMMUTABLE_LIST__@@",vt=pt.prototype;function mt(e,t){this.array=e,this.ownerID=t}vt[ht]=!0,vt.delete=vt.remove,vt.setIn=Ve.setIn,vt.deleteIn=vt.removeIn=Ve.removeIn,vt.update=Ve.update,vt.updateIn=Ve.updateIn,vt.mergeIn=Ve.mergeIn,vt.mergeDeepIn=Ve.mergeDeepIn,vt.withMutations=Ve.withMutations,vt.asMutable=Ve.asMutable,vt.asImmutable=Ve.asImmutable,vt.wasAltered=Ve.wasAltered,mt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&y;if(r>=this.array.length)return new mt([],e);var i,o=0===r;if(t>0){var u=this.array[r];if((i=u&&u.removeBefore(e,t-v,n))===u&&o)return this}if(o&&!i)return this;var a=St(this,e);if(!o)for(var l=0;l<r;l++)a.array[l]=void 0;return i&&(a.array[r]=i),a},mt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,i=n-1>>>t&y;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-v,n))===o&&i===this.array.length-1)return this}var u=St(this,e);return u.array.splice(i+1),r&&(u.array[i]=r),u};var yt,gt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,i=Tt(r),o=e._tail;return u(e._root,e._level,0);function u(e,a,l){return 0===a?function(e,u){var a=u===i?o&&o.array:e&&e.array,l=u>n?0:n-u,s=r-u;return s>m&&(s=m),function(){if(l===s)return bt;var e=t?--s:l++;return a&&a[e]}}(e,l):function(e,i,o){var a,l=e&&e.array,s=o>n?0:n-o>>i,c=1+(r-o>>i);return c>m&&(c=m),function(){for(;;){if(a){var e=a();if(e!==bt)return e;a=null}if(s===c)return bt;var n=t?--c:s++;a=u(l&&l[n],i-v,o+(n<<i))}}}(e,a,l)}}function wt(e,t,n,r,i,o,u){var a=Object.create(vt);return a.size=t-e,a._origin=e,a._capacity=t,a._level=n,a._root=r,a._tail=i,a.__ownerID=o,a.__hash=u,a.__altered=!1,a}function xt(){return yt||(yt=wt(0,0,v))}function Ct(e,t,n,r,i,o){var u,a=r>>>n&y,l=e&&a<e.array.length;if(!l&&void 0===i)return e;if(n>0){var s=e&&e.array[a],c=Ct(s,t,n-v,r,i,o);return c===s?e:((u=St(e,t)).array[a]=c,u)}return l&&e.array[a]===i?e:(x(o),u=St(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function St(e,t){return t&&e&&t===e.ownerID?e:new mt(e?e.array.slice():[],t)}function Et(e,t){if(t>=Tt(e._capacity))return e._tail;if(t<1<<e._level+v){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&y],r-=v;return n}}function kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new C,i=e._origin,o=e._capacity,u=i+t,a=void 0===n?o:n<0?o+n:i+n;if(u===i&&a===o)return e;if(u>=a)return e.clear();for(var l=e._level,s=e._root,c=0;u+c<0;)s=new mt(s&&s.array.length?[void 0,s]:[],r),c+=1<<(l+=v);c&&(u+=c,i+=c,a+=c,o+=c);for(var f=Tt(o),p=Tt(a);p>=1<<l+v;)s=new mt(s&&s.array.length?[s]:[],r),l+=v;var d=e._tail,h=p<f?Et(e,a-1):p>f?new mt([],r):d;if(d&&p>f&&u<o&&d.array.length){for(var m=s=St(s,r),g=l;g>v;g-=v){var b=f>>>g&y;m=m.array[b]=St(m.array[b],r)}m.array[f>>>v&y]=d}if(a<o&&(h=h&&h.removeAfter(r,0,a)),u>=p)u-=p,a-=p,l=v,s=null,h=h&&h.removeBefore(r,0,u);else if(u>i||p<f){for(c=0;s;){var _=u>>>l&y;if(_!==p>>>l&y)break;_&&(c+=(1<<l)*_),l-=v,s=s.array[_]}s&&u>i&&(s=s.removeBefore(r,l,u-c)),s&&p<f&&(s=s.removeAfter(r,l,p-c)),c&&(u-=c,a-=c)}return e.__ownerID?(e.size=a-u,e._origin=u,e._capacity=a,e._level=l,e._root=s,e._tail=h,e.__hash=void 0,e.__altered=!0,e):wt(u,a,l,s,h)}function Ot(e,t,n){for(var r=[],o=0,a=0;a<n.length;a++){var l=n[a],s=i(l);s.size>o&&(o=s.size),u(l)||(s=s.map(function(e){return fe(e)})),r.push(s)}return o>e.size&&(e=e.setSize(o)),ut(e,t,r)}function Tt(e){return e<m?0:e-1>>>v<<v}function Lt(e){return null==e?It():Mt(e)?e:It().withMutations(function(t){var n=r(e);Ne(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function Mt(e){return Re(e)&&c(e)}function Pt(e,t,n,r){var i=Object.create(Lt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function It(){return gt||(gt=Pt(Xe(),xt()))}function jt(e,t,n){var r,i,o=e._map,u=e._list,a=o.get(t),l=void 0!==a;if(n===g){if(!l)return e;u.size>=m&&u.size>=2*o.size?(i=u.filter(function(e,t){return void 0!==e&&a!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(l){if(n===u.get(a)[1])return e;r=o,i=u.set(a,[t,n])}else r=o.set(t,u.size),i=u.set(u.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Pt(r,i)}function At(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Dt(e){this._iter=e,this.size=e.size}function zt(e){this._iter=e,this.size=e.size}function Nt(e){this._iter=e,this.size=e.size}function Ft(e){var t=Jt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=en,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===A){var r=e.__iterator(t,n);return new F(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===j?I:j,n)},t}function Rt(e,t,n){var r=Jt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,g);return o===g?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,u){return!1!==r(t.call(n,e,i,u),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(A,i);return new F(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return R(r,a,t.call(n,u[1],a,e),i)})},r}function Ut(e,t){var n=Jt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ft(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=en,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Bt(e,t,n,r){var i=Jt(e);return r&&(i.has=function(r){var i=e.get(r,g);return i!==g&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,g);return o!==g&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return e.__iterate(function(e,o,l){if(t.call(n,e,o,l))return a++,i(e,r?o:a-1,u)},o),a},i.__iteratorUncached=function(i,o){var u=e.__iterator(A,o),a=0;return new F(function(){for(;;){var o=u.next();if(o.done)return o;var l=o.value,s=l[0],c=l[1];if(t.call(n,c,s,e))return R(i,r?s:a++,c,o)}})},i}function Vt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),T(t,n,i))return e;var o=L(t,i),u=M(n,i);if(o!=o||u!=u)return Vt(e.toSeq().cacheResult(),t,n,r);var a,l=u-o;l==l&&(a=l<0?0:l);var s=Jt(e);return s.size=0===a?a:e.size&&a||void 0,!r&&ie(e)&&a>=0&&(s.get=function(t,n){return(t=k(this,t))>=0&&t<a?e.get(t+o,n):n}),s.__iterateUncached=function(t,n){var i=this;if(0===a)return 0;if(n)return this.cacheResult().__iterate(t,n);var u=0,l=!0,s=0;return e.__iterate(function(e,n){if(!l||!(l=u++<o))return s++,!1!==t(e,r?n:s-1,i)&&s!==a}),s},s.__iteratorUncached=function(t,n){if(0!==a&&n)return this.cacheResult().__iterator(t,n);var i=0!==a&&e.__iterator(t,n),u=0,l=0;return new F(function(){for(;u++<o;)i.next();if(++l>a)return{value:void 0,done:!0};var e=i.next();return r||t===j?e:R(t,l-1,t===I?void 0:e.value[1],e)})},s}function Wt(e,t,n,r){var i=Jt(e);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,l=0;return e.__iterate(function(e,o,s){if(!a||!(a=t.call(n,e,o,s)))return l++,i(e,r?o:l-1,u)}),l},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(A,o),l=!0,s=0;return new F(function(){var e,o,c;do{if((e=a.next()).done)return r||i===j?e:R(i,s++,i===I?void 0:e.value[1],e);var f=e.value;o=f[0],c=f[1],l&&(l=t.call(n,c,o,u))}while(l);return i===A?e:R(i,o,c,e)})},i}function qt(e,t,n){var r=Jt(e);return r.__iterateUncached=function(r,i){var o=0,a=!1;return function e(l,s){var c=this;l.__iterate(function(i,l){return(!t||s<t)&&u(i)?e(i,s+1):!1===r(i,n?l:o++,c)&&(a=!0),!a},i)}(e,0),o},r.__iteratorUncached=function(r,i){var o=e.__iterator(r,i),a=[],l=0;return new F(function(){for(;o;){var e=o.next();if(!1===e.done){var s=e.value;if(r===A&&(s=s[1]),t&&!(a.length<t)||!u(s))return n?e:R(r,l++,s,e);a.push(o),o=s.__iterator(r,i)}else o=a.pop()}return{value:void 0,done:!0}})},r}function Ht(e,t,n){t||(t=tn);var r=a(e),i=0,o=e.toSeq().map(function(t,r){return[r,t,i++,n?n(t,r,e):t]}).toArray();return o.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),r?Z(o):l(e)?$(o):Q(o)}function Kt(e,t,n){if(t||(t=tn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Zt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Zt(t,e,n)?n:e})}function Zt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function $t(e,t,r){var i=Jt(e);return i.size=new ee(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(j,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=n(e),W(i?e.reverse():e)}),u=0,a=!1;return new F(function(){var n;return a||(n=o.map(function(e){return e.next()}),a=n.some(function(e){return e.done})),a?{value:void 0,done:!0}:R(e,u++,t.apply(null,n.map(function(e){return e.value})))})},i}function Qt(e,t){return ie(e)?t:e.constructor(t)}function Yt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Gt(e){return Ne(e.size),E(e)}function Xt(e){return a(e)?r:l(e)?i:o}function Jt(e){return Object.create((a(e)?Z:l(e)?$:Q).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function tn(e,t){return e>t?1:e<t?-1:0}function nn(e){var t=W(e);if(!t){if(!H(e))throw new TypeError("Expected iterable or array-like: "+e);t=W(n(e))}return t}function rn(e,t){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ye(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(i,u),i.size=u.length,i._name=t,i._keys=u,i._defaultValues=e}this._map=Fe(o)},i=r.prototype=Object.create(on);return i.constructor=r,r}t(Lt,Fe),Lt.of=function(){return this(arguments)},Lt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Lt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Lt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Lt.prototype.set=function(e,t){return jt(this,e,t)},Lt.prototype.remove=function(e){return jt(this,e,g)},Lt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Lt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Lt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Lt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Pt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Lt.isOrderedMap=Mt,Lt.prototype[h]=!0,Lt.prototype.delete=Lt.prototype.remove,t(At,Z),At.prototype.get=function(e,t){return this._iter.get(e,t)},At.prototype.has=function(e){return this._iter.has(e)},At.prototype.valueSeq=function(){return this._iter.valueSeq()},At.prototype.reverse=function(){var e=this,t=Ut(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},At.prototype.map=function(e,t){var n=this,r=Rt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},At.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Gt(this):0,function(i){return e(i,t?--n:n++,r)}),t)},At.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(j,t),r=t?Gt(this):0;return new F(function(){var i=n.next();return i.done?i:R(e,t?--r:r++,i.value,i)})},At.prototype[h]=!0,t(Dt,$),Dt.prototype.includes=function(e){return this._iter.includes(e)},Dt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Dt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t),r=0;return new F(function(){var t=n.next();return t.done?t:R(e,r++,t.value,t)})},t(zt,Q),zt.prototype.has=function(e){return this._iter.includes(e)},zt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},zt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t);return new F(function(){var t=n.next();return t.done?t:R(e,t.value,t.value,t)})},t(Nt,Z),Nt.prototype.entrySeq=function(){return this._iter.toSeq()},Nt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){Yt(t);var r=u(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Nt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(j,t);return new F(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Yt(r);var i=u(r);return R(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},Dt.prototype.cacheResult=At.prototype.cacheResult=zt.prototype.cacheResult=Nt.prototype.cacheResult=en,t(rn,_e),rn.prototype.toString=function(){return this.__toString(an(this)+" {","}")},rn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},rn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},rn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=un(this,Xe()))},rn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+an(this));if(this._map&&!this._map.has(e)){var n=this._defaultValues[e];if(t===n)return this}var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:un(this,r)},rn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:un(this,t)},rn.prototype.wasAltered=function(){return this._map.wasAltered()},rn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},rn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},rn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?un(this,t,e):(this.__ownerID=e,this._map=t,this)};var on=rn.prototype;function un(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function an(e){return e._name||e.constructor.name||"Record"}function ln(e){return null==e?vn():sn(e)&&!c(e)?e:vn().withMutations(function(t){var n=o(e);Ne(n.size),n.forEach(function(e){return t.add(e)})})}function sn(e){return!(!e||!e[fn])}on.delete=on.remove,on.deleteIn=on.removeIn=Ve.removeIn,on.merge=Ve.merge,on.mergeWith=Ve.mergeWith,on.mergeIn=Ve.mergeIn,on.mergeDeep=Ve.mergeDeep,on.mergeDeepWith=Ve.mergeDeepWith,on.mergeDeepIn=Ve.mergeDeepIn,on.setIn=Ve.setIn,on.update=Ve.update,on.updateIn=Ve.updateIn,on.withMutations=Ve.withMutations,on.asMutable=Ve.asMutable,on.asImmutable=Ve.asImmutable,t(ln,xe),ln.of=function(){return this(arguments)},ln.fromKeys=function(e){return this(r(e).keySeq())},ln.prototype.toString=function(){return this.__toString("Set {","}")},ln.prototype.has=function(e){return this._map.has(e)},ln.prototype.add=function(e){return dn(this,this._map.set(e,!0))},ln.prototype.remove=function(e){return dn(this,this._map.remove(e))},ln.prototype.clear=function(){return dn(this,this._map.clear())},ln.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)o(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},ln.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return o(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},ln.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return o(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},ln.prototype.merge=function(){return this.union.apply(this,arguments)},ln.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},ln.prototype.sort=function(e){return mn(Ht(this,e))},ln.prototype.sortBy=function(e,t){return mn(Ht(this,t,e))},ln.prototype.wasAltered=function(){return this._map.wasAltered()},ln.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},ln.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},ln.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},ln.isSet=sn;var cn,fn="@@__IMMUTABLE_SET__@@",pn=ln.prototype;function dn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function hn(e,t){var n=Object.create(pn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function vn(){return cn||(cn=hn(Xe()))}function mn(e){return null==e?wn():yn(e)?e:wn().withMutations(function(t){var n=o(e);Ne(n.size),n.forEach(function(e){return t.add(e)})})}function yn(e){return sn(e)&&c(e)}pn[fn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Ve.withMutations,pn.asMutable=Ve.asMutable,pn.asImmutable=Ve.asImmutable,pn.__empty=vn,pn.__make=hn,t(mn,ln),mn.of=function(){return this(arguments)},mn.fromKeys=function(e){return this(r(e).keySeq())},mn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},mn.isOrderedSet=yn;var gn,bn=mn.prototype;function _n(e,t){var n=Object.create(bn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function wn(){return gn||(gn=_n(It()))}function xn(e){return null==e?Tn():Cn(e)?e:Tn().unshiftAll(e)}function Cn(e){return!(!e||!e[En])}bn[h]=!0,bn.__empty=wn,bn.__make=_n,t(xn,we),xn.of=function(){return this(arguments)},xn.prototype.toString=function(){return this.__toString("Stack [","]")},xn.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},xn.prototype.peek=function(){return this._head&&this._head.value},xn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):On(e,t)},xn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Ne(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):On(t,n)},xn.prototype.pop=function(){return this.slice(1)},xn.prototype.unshift=function(){return this.push.apply(this,arguments)},xn.prototype.unshiftAll=function(e){return this.pushAll(e)},xn.prototype.shift=function(){return this.pop.apply(this,arguments)},xn.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):Tn()},xn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=L(e,this.size),r=M(t,this.size);if(r!==this.size)return we.prototype.slice.call(this,e,t);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):On(i,o)},xn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?On(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},xn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},xn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F(function(){if(r){var t=r.value;return r=r.next,R(e,n++,t)}return{value:void 0,done:!0}})},xn.isStack=Cn;var Sn,En="@@__IMMUTABLE_STACK__@@",kn=xn.prototype;function On(e,t,n,r){var i=Object.create(kn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Tn(){return Sn||(Sn=On(0))}function Ln(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}kn[En]=!0,kn.withMutations=Ve.withMutations,kn.asMutable=Ve.asMutable,kn.asImmutable=Ve.asImmutable,kn.wasAltered=Ve.wasAltered,n.Iterator=F,Ln(n,{toArray:function(){Ne(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Dt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new At(this,!0)},toMap:function(){return Fe(this.toKeyedSeq())},toObject:function(){Ne(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Lt(this.toKeyedSeq())},toOrderedSet:function(){return mn(a(this)?this.valueSeq():this)},toSet:function(){return ln(a(this)?this.valueSeq():this)},toSetSeq:function(){return new zt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return xn(a(this)?this.valueSeq():this)},toList:function(){return pt(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Qt(this,function(e,t){var n=a(e),i=[e].concat(t).map(function(e){return u(e)?n&&(e=r(e)):e=n?ue(e):ae(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&a(o)||l(e)&&l(o))return o}var s=new ee(i);return n?s=s.toKeyedSeq():l(e)||(s=s.toSetSeq()),(s=s.flatten(!0)).size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),s}(this,t))},includes:function(e){return this.some(function(t){return he(t,e)})},entries:function(){return this.__iterator(A)},every:function(e,t){Ne(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Qt(this,Bt(this,e,t,!0))},find