@blackglory/structures 0.10.20 → 0.10.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -371,7 +371,7 @@ class BitSet {
371
371
  get size(): number
372
372
  [Symbol.iterator](): IterableIterator<number>
373
373
 
374
- constructor(bitsPerElement: number = 8) {}
374
+ constructor(bitsPerElement: number = 8)
375
375
 
376
376
  values(): IterableIterator<number>
377
377
 
@@ -12,5 +12,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var Eo=function(t,e){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Oo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Eo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Po(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function jo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ko(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function No(t){return"function"==typeof t}function Mo(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Bo=Mo((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Co(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Po(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(No(u))try{u()}catch(t){i=t instanceof Bo?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=Po(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{Vo(f)}catch(t){i=null!=i?i:[],t instanceof Bo?i=ko(ko([],jo(i)),jo(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new Bo(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Vo(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Co(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Co(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Fo=zo.EMPTY;function qo(t){return t instanceof zo||t&&"closed"in t&&No(t.remove)&&No(t.add)&&No(t.unsubscribe)}function Vo(t){No(t)?t():t.unsubscribe()}var Do={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Uo=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ko([t,e],jo(n)))};function Ro(){}function Ko(t){t()}var Lo=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,qo(e)&&e.add(n)):n.destination=Xo,n}return Oo(e,t),e.create=function(t,e,n){return new $o(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(zo),Jo=Function.prototype.bind;function Wo(t,e){return Jo.call(t,e)}var Yo=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ho(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ho(t)}else Ho(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ho(t)}},t}(),$o=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;No(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Do.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Wo(e.next,o),error:e.error&&Wo(e.error,o),complete:e.complete&&Wo(e.complete,o)}):i=e;return s.destination=new Yo(i),s}return Oo(e,t),e}(Lo);function Ho(t){var e;e=t,Uo((function(){throw e}))}var Xo={closed:!0,next:Ro,error:function(t){throw t},complete:Ro},Go="function"==typeof Symbol&&Symbol.observable||"@@observable";function Qo(t){return t}function Zo(t){return 0===t.length?Qo:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ts=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lo||function(t){return t&&No(t.next)&&No(t.error)&&No(t.complete)}(r)&&qo(r)?t:new $o(t,e,n);return Ko((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=es(e))((function(e,r){var i=new $o({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Go]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zo(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=es(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function es(t){var e;return null!==(e=null!=t?t:Do.Promise)&&void 0!==e?e:Promise}function ns(t){return No(null==t?void 0:t.lift)}function rs(t,e,n,r,i){return new is(t,e,n,r,i)}var is=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Oo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Lo);function os(){return t=function(t,e){var n=null;t._refCount++;var r=rs(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(ns(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,ns(e)&&(r.lift=e.lift),r}Oo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new zo;var n=this.getSubject();e.add(this.source.subscribe(rs(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=zo.EMPTY)}return e},e.prototype.refCount=function(){return os()(this)}}(ts);var ss,as,us={now:function(){return(us.delegate||performance).now()},delegate:void 0},cs={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new zo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=cs.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,ko([],jo(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,ko([],jo(t)))},delegate:void 0};as=cs.schedule,new ts((function(t){var e=new zo,n=ss||us,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:ss?s:o,elapsed:s-r}),t.closed||e.add(as(i))};return e.add(as(i)),e}));var ls=Mo((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),hs=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Oo(e,t),e.prototype.lift=function(t){var e=new fs(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new ls},e.prototype.next=function(t){var e=this;Ko((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Po(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ko((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ko((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Fo:(this.currentObservers=null,o.push(t),new zo((function(){e.currentObservers=null,Co(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new ts;return t.source=this,t},e.create=function(t,e){return new fs(t,e)},e}(ts),fs=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Oo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Fo},e}(hs);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}Oo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(hs);var ds={now:function(){return(ds.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=ds);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}Oo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(hs),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Oo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(hs);var ys,ps=function(t){function e(e,n){return t.call(this)||this}return Oo(e,t),e.prototype.schedule=function(t,e){return this},e}(zo),vs=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ko([t,e],jo(n)))},ms=function(t){return clearInterval(t)},bs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Oo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),vs(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;ms(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Co(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ps),gs=1,ws={};function xs(t){return t in ws&&(delete ws[t],!0)}var Ts=function(t){var e=gs++;return ws[e]=!0,ys||(ys=Promise.resolve()),ys.then((function(){return xs(e)&&t()})),e},_s=function(t){xs(t)},Ss={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ss.delegate;return((null==n?void 0:n.setImmediate)||Ts).apply(void 0,ko([],jo(t)))},clearImmediate:function(t){return _s(t)},delegate:void 0},As=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ss.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Ss.clearImmediate(n),e._scheduled=void 0)},e}(bs),Is=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=ds.now,t}(),Es=function(t){function e(e,n){void 0===n&&(n=Is.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return Oo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(Is);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(As),new Es(bs);var Os=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e}(Es))(Os);var Ps=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=cs.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(cs.cancelAnimationFrame(n),e._scheduled=void 0)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(Ps),function(t){function e(e,n){void 0===e&&(e=ks),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Oo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(Es);var js,ks=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return Oo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return zo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(bs);new ts((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(js||(js={})),Mo((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Mo((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Mo((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Mo((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Mo((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new ts(Ro);class Ns extends Ao{constructor(){super(...arguments),this.stateChanges=new hs}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const r=this.state;this.stateChanges.next({event:t,oldState:e,newState:r}),n.isEmptyObject(this.schema[r])&&this.stateChanges.complete()}}class Ms{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class Bs{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Cs{constructor(t){this.keyToIndex=[],this.indexToKey=[],bo.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class zs{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Fs{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,bo.assert(Number.isInteger(e),"capacity must be an integer"),bo.assert(e>=0,"capacity must be greater than or equal to 0"),bo.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get BYTES_PER_ELEMENT(){return this.typedArrayConstructor.BYTES_PER_ELEMENT}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=qs(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=qs(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=qs(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function qs(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class Vs{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class Ds{constructor(t){this.compare=t,this.head=new Vs(null),this.tail=new Vs(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&n.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return n.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&n.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let r=new Vs(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new Vs(null),e=new Vs(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const n=new Vs(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e,n.down=r,r.up=n,r=n,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class Us{constructor(t){this.skipList=new Ds(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return go.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}class Rs{constructor(t=32){this.bitsPerElement=t,this.array=[],this.length=0,this._size=0,bo.assert(Number.isInteger(t),"The parameter bitsPerElement must be an integer"),bo.assert(t>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(t<=32,"The mask of bitsPerElement must be less than or equal to 32")}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){let e=this.array[t];for(let n=0;n<this.bitsPerElement;n++)1&e&&(yield t*this.bitsPerElement+n),e>>=1}let r=this.array[t-1];for(let t=0;t<e;t++)1&r&&(yield n*this.bitsPerElement+t),r>>=1}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i|r;(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i&~r;const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}class Ks{constructor(t){this.array=t,this.length=0,this._size=0;const e=8*t.BYTES_PER_ELEMENT;bo.assert(Number.isInteger(e),"The parameter bitsPerElement must be an integer"),bo.assert(e>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(e<=32,"The mask of bitsPerElement must be less than or equal to 32"),this.bitsPerElement=e}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){let e=this.array.internalTypedArray[t];for(let n=0;n<this.bitsPerElement;n++)1&e&&(yield t*this.bitsPerElement+n),e>>=1}let r=this.array.internalTypedArray[t-1];for(let t=0;t<e;t++)1&r&&(yield n*this.bitsPerElement+t),r>>=1}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i|r);(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i&~r);const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}export{Io as BadEventError,Rs as BitSet,t as Box,Fs as DynamicTypedArray,Rt as Emitter,xo as ExpirableMap,Ao as FiniteStateMachine,Kt as HashMap,Lt as HashSet,wo as LRUMap,Ns as ObservableFiniteStateMachine,Jt as Queue,Us as SortedSet,Bs as SparseMap,Ms as SparseSet,To as TLRUMap,So as TrieMap,Ks as TypedBitSet,Cs as TypedSparseMap,zs as TypedSparseSet,Ft as convertArrayToCons,zt as convertConsToArray,qt as sliceArrayLeft,Vt as sliceArrayRight,Dt as truncateArrayLeft,Ut as truncateArrayRight};
15
+ ***************************************************************************** */var Eo=function(t,e){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Oo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Eo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Po(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function jo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ko(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function No(t){return"function"==typeof t}function Mo(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Bo=Mo((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Co(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Po(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(No(u))try{u()}catch(t){i=t instanceof Bo?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=Po(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{Vo(f)}catch(t){i=null!=i?i:[],t instanceof Bo?i=ko(ko([],jo(i)),jo(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new Bo(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Vo(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Co(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Co(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Fo=zo.EMPTY;function qo(t){return t instanceof zo||t&&"closed"in t&&No(t.remove)&&No(t.add)&&No(t.unsubscribe)}function Vo(t){No(t)?t():t.unsubscribe()}var Do={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Uo=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ko([t,e],jo(n)))};function Ro(){}function Ko(t){t()}var Lo=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,qo(e)&&e.add(n)):n.destination=Xo,n}return Oo(e,t),e.create=function(t,e,n){return new $o(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(zo),Jo=Function.prototype.bind;function Wo(t,e){return Jo.call(t,e)}var Yo=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ho(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ho(t)}else Ho(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ho(t)}},t}(),$o=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;No(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Do.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Wo(e.next,o),error:e.error&&Wo(e.error,o),complete:e.complete&&Wo(e.complete,o)}):i=e;return s.destination=new Yo(i),s}return Oo(e,t),e}(Lo);function Ho(t){var e;e=t,Uo((function(){throw e}))}var Xo={closed:!0,next:Ro,error:function(t){throw t},complete:Ro},Go="function"==typeof Symbol&&Symbol.observable||"@@observable";function Qo(t){return t}function Zo(t){return 0===t.length?Qo:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ts=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lo||function(t){return t&&No(t.next)&&No(t.error)&&No(t.complete)}(r)&&qo(r)?t:new $o(t,e,n);return Ko((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=es(e))((function(e,r){var i=new $o({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Go]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zo(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=es(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function es(t){var e;return null!==(e=null!=t?t:Do.Promise)&&void 0!==e?e:Promise}function ns(t){return No(null==t?void 0:t.lift)}function rs(t,e,n,r,i){return new is(t,e,n,r,i)}var is=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Oo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Lo);function os(){return t=function(t,e){var n=null;t._refCount++;var r=rs(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(ns(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,ns(e)&&(r.lift=e.lift),r}Oo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new zo;var n=this.getSubject();e.add(this.source.subscribe(rs(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=zo.EMPTY)}return e},e.prototype.refCount=function(){return os()(this)}}(ts);var ss,as,us={now:function(){return(us.delegate||performance).now()},delegate:void 0},cs={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new zo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=cs.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,ko([],jo(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,ko([],jo(t)))},delegate:void 0};as=cs.schedule,new ts((function(t){var e=new zo,n=ss||us,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:ss?s:o,elapsed:s-r}),t.closed||e.add(as(i))};return e.add(as(i)),e}));var ls=Mo((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),hs=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Oo(e,t),e.prototype.lift=function(t){var e=new fs(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new ls},e.prototype.next=function(t){var e=this;Ko((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Po(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ko((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ko((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Fo:(this.currentObservers=null,o.push(t),new zo((function(){e.currentObservers=null,Co(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new ts;return t.source=this,t},e.create=function(t,e){return new fs(t,e)},e}(ts),fs=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Oo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Fo},e}(hs);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}Oo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(hs);var ds={now:function(){return(ds.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=ds);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}Oo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(hs),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Oo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(hs);var ys,ps=function(t){function e(e,n){return t.call(this)||this}return Oo(e,t),e.prototype.schedule=function(t,e){return this},e}(zo),vs=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ko([t,e],jo(n)))},ms=function(t){return clearInterval(t)},bs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Oo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),vs(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;ms(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Co(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ps),gs=1,ws={};function xs(t){return t in ws&&(delete ws[t],!0)}var Ts=function(t){var e=gs++;return ws[e]=!0,ys||(ys=Promise.resolve()),ys.then((function(){return xs(e)&&t()})),e},_s=function(t){xs(t)},Ss={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ss.delegate;return((null==n?void 0:n.setImmediate)||Ts).apply(void 0,ko([],jo(t)))},clearImmediate:function(t){return _s(t)},delegate:void 0},As=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ss.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Ss.clearImmediate(n),e._scheduled=void 0)},e}(bs),Is=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=ds.now,t}(),Es=function(t){function e(e,n){void 0===n&&(n=Is.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return Oo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(Is);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(As),new Es(bs);var Os=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e}(Es))(Os);var Ps=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=cs.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(cs.cancelAnimationFrame(n),e._scheduled=void 0)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(Ps),function(t){function e(e,n){void 0===e&&(e=ks),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Oo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(Es);var js,ks=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return Oo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return zo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(bs);new ts((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(js||(js={})),Mo((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Mo((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Mo((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Mo((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Mo((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new ts(Ro);class Ns extends Ao{constructor(){super(...arguments),this.stateChanges=new hs}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const r=this.state;this.stateChanges.next({event:t,oldState:e,newState:r}),n.isEmptyObject(this.schema[r])&&this.stateChanges.complete()}}class Ms{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class Bs{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Cs{constructor(t){this.keyToIndex=[],this.indexToKey=[],bo.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class zs{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Fs{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,bo.assert(Number.isInteger(e),"capacity must be an integer"),bo.assert(e>=0,"capacity must be greater than or equal to 0"),bo.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get BYTES_PER_ELEMENT(){return this.typedArrayConstructor.BYTES_PER_ELEMENT}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=qs(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=qs(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=qs(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function qs(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class Vs{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class Ds{constructor(t){this.compare=t,this.head=new Vs(null),this.tail=new Vs(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&n.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return n.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&n.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let r=new Vs(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new Vs(null),e=new Vs(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const n=new Vs(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e,n.down=r,r.up=n,r=n,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class Us{constructor(t){this.skipList=new Ds(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return go.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}const Rs=[32,0,1,26,2,23,27,0,3,16,24,30,28,11,0,13,4,7,17,0,25,22,31,15,29,10,12,6,0,21,14,9,5,20,8,19,18];function Ks(t){return Rs[(-t&t)%37]}class Ls{constructor(t=8){this.bitsPerElement=t,this.array=[],this.length=0,this._size=0,bo.assert(Number.isInteger(t),"The parameter bitsPerElement must be an integer"),bo.assert(t>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(t<=31,"The mask of bitsPerElement must be less than or equal to 31")}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=1+~~(this.length/this.bitsPerElement);for(let e=0;e<t;e++){let t,n=this.array[e],r=0;for(;32!==(t=Ks(n));)yield e*this.bitsPerElement+r+t,r+=t+1,n>>=t+1}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i|r;(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i&~r;const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}class Js{constructor(t){this.array=t,this.length=0,this._size=0;const e=8*t.BYTES_PER_ELEMENT;bo.assert(Number.isInteger(e),"The parameter bitsPerElement must be an integer"),bo.assert(e>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(e<=31,"The mask of bitsPerElement must be less than or equal to 31"),this.bitsPerElement=e}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=1+~~(this.length/this.bitsPerElement);for(let e=0;e<t;e++){let t,n=this.array.internalTypedArray[e],r=0;for(;32!==(t=Ks(n));)yield e*this.bitsPerElement+r+t,r+=t+1,n>>=t+1}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i|r);(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i&~r);const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}export{Io as BadEventError,Ls as BitSet,t as Box,Fs as DynamicTypedArray,Rt as Emitter,xo as ExpirableMap,Ao as FiniteStateMachine,Kt as HashMap,Lt as HashSet,wo as LRUMap,Ns as ObservableFiniteStateMachine,Jt as Queue,Us as SortedSet,Bs as SparseMap,Ms as SparseSet,To as TLRUMap,So as TrieMap,Js as TypedBitSet,Cs as TypedSparseMap,zs as TypedSparseSet,Ft as convertArrayToCons,zt as convertConsToArray,qt as sliceArrayLeft,Vt as sliceArrayRight,Dt as truncateArrayLeft,Ut as truncateArrayRight};
16
16
  //# sourceMappingURL=index.min.mjs.map