Socket
Socket
Sign inDemoInstall

@blackglory/structures

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackglory/structures - npm Package Compare versions

Comparing version 0.2.8 to 0.3.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Changelog

## [0.3.0](https://github.com/BlackGlory/structures/compare/v0.2.8...v0.3.0) (2021-12-13)
### ⚠ BREAKING CHANGES
* Replace `ObervableFiniteStateMachine.stateChangedObservable` with
`observeStateChanges()`
* replace stateChangedObservable with observeStateChanges ([9708384](https://github.com/BlackGlory/structures/commit/970838452b2ef3b6299379b393eb45fbbc488e55))
### [0.2.8](https://github.com/BlackGlory/structures/compare/v0.2.7...v0.2.8) (2021-12-13)

@@ -7,0 +17,0 @@

2

dist/es2015/index.umd.min.js

@@ -29,3 +29,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Structures={})}(this,(function(t){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Jr=function(t,e){return(Jr=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 Ur(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}Jr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Pr(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 qr(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 Dr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function zr(t){return"function"==typeof t}function Fr(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 Wr=Fr((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 Lr(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Hr=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=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=Pr(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 c=this.initialTeardown;if(zr(c))try{c()}catch(t){i=t instanceof Wr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Pr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Yr(d)}catch(t){i=null!=i?i:[],t instanceof Wr?i=Dr(Dr([],qr(i)),qr(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(i)throw new Wr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Yr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&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)&&Lr(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Lr(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Kr=Hr.EMPTY;function Vr(t){return t instanceof Hr||t&&"closed"in t&&zr(t.remove)&&zr(t.add)&&zr(t.unsubscribe)}function Yr(t){zr(t)?t():t.unsubscribe()}var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qr={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qr.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Dr([],qr(t)))},clearTimeout:function(t){var e=Qr.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Gr(t){Qr.setTimeout((function(){throw t}))}function Xr(){}var Zr=null;function ti(t){if($r.useDeprecatedSynchronousErrorHandling){var e=!Zr;if(e&&(Zr={errorThrown:!1,error:null}),t(),e){var n=Zr,r=n.errorThrown,i=n.error;if(Zr=null,r)throw i}}else t()}var ei=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Vr(e)&&e.add(n)):n.destination=oi,n}return Ur(e,t),e.create=function(t,e,n){return new ni(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}(Hr),ni=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(zr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&$r.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?ri(i):Xr,error:ri(null!=n?n:ii),complete:r?ri(r):Xr},o}return Ur(e,t),e}(ei);function ri(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Dr([],qr(e)))}catch(t){Gr(t)}}}function ii(t){throw t}var oi={closed:!0,next:Xr,error:ii,complete:Xr},si="function"==typeof Symbol&&Symbol.observable||"@@observable";function ai(t){return t}function ci(t){return 0===t.length?ai:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ui=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 ei||function(t){return t&&zr(t.next)&&zr(t.error)&&zr(t.complete)}(r)&&Vr(r)?t:new ni(t,e,n);return ti((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=fi(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[si]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ci(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=fi(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 fi(t){var e;return null!==(e=null!=t?t:$r.Promise)&&void 0!==e?e:Promise}var li=Fr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),di=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Ur(e,t),e.prototype.lift=function(t){var e=new hi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new li},e.prototype.next=function(t){var e=this;ti((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Pr(i),s=o.next();!s.done;s=o.next()){s.value.next(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ti((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;ti((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=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=e.hasError,r=e.isStopped,i=e.observers;return n||r?Kr:(i.push(t),new Hr((function(){return Lr(i,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 ui;return t.source=this,t},e.create=function(t,e){return new hi(t,e)},e}(ui),hi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Ur(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:Kr},e}(di),yi={},pi={};function vi(t){return Array.isArray(t)}pi.isntEmptyArray=pi.isEmptyArray=pi.isntArray=pi.isArray=void 0,pi.isArray=vi,pi.isntArray=function(t){return!vi(t)},pi.isEmptyArray=function(t){return 0===t.length},pi.isntEmptyArray=function(t){return 0!==t.length};var mi={},bi={};function gi(t){return null===t}bi.isntNull=bi.isNull=void 0,bi.isNull=gi,bi.isntNull=function(t){return!gi(t)};var wi={};function Si(t){return void 0===t}wi.isntUndefined=wi.isUndefined=void 0,wi.isUndefined=Si,wi.isntUndefined=function(t){return!Si(t)},mi.isntAsyncIterable=mi.isAsyncIterable=void 0;const Ti=bi,Ai=wi;function Ei(t){return(0,Ti.isntNull)(t)&&(0,Ai.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}mi.isAsyncIterable=Ei,mi.isntAsyncIterable=function(t){return!Ei(t)};var xi={};function Ii(t){return"bigint"==typeof t}xi.isntBigInt=xi.isBigInt=void 0,xi.isBigInt=Ii,xi.isntBigInt=function(t){return!Ii(t)};var _i={};function Mi(t){return"boolean"==typeof t}_i.isntBoolean=_i.isBoolean=void 0,_i.isBoolean=Mi,_i.isntBoolean=function(t){return!Mi(t)};var Oi={},Bi={};function ji(t){return"string"==typeof t}Bi.isntString=Bi.isString=void 0,Bi.isString=ji,Bi.isntString=function(t){return!ji(t)},Oi.isntChar=Oi.isChar=void 0;const Ri=Bi;function ki(t){return(0,Ri.isString)(t)&&1===t.length}Oi.isChar=ki,Oi.isntChar=function(t){return!ki(t)};var Ni={};function Ci(t){return t instanceof Date}Ni.isntDate=Ni.isDate=void 0,Ni.isDate=Ci,Ni.isntDate=function(t){return!Ci(t)};var Ji={};Ji.inEnum=void 0,Ji.inEnum=function(t,e){return Object.values(e).includes(t)};var Ui={};function Pi(t){return t instanceof Error}Ui.isntError=Ui.isError=void 0,Ui.isError=Pi,Ui.isntError=function(t){return!Pi(t)};var qi={};function Di(t){return!t}qi.isntFalsy=qi.isFalsy=void 0,qi.isFalsy=Di,qi.isntFalsy=function(t){return!Di(t)};var zi={};function Fi(t){return"function"==typeof t}zi.isntFunction=zi.isFunction=void 0,zi.isFunction=Fi,zi.isntFunction=function(t){return!Fi(t)};var Wi={};Wi.isntIterable=Wi.isIterable=void 0;const Li=bi,Hi=wi;function Ki(t){return(0,Li.isntNull)(t)&&(0,Hi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Wi.isIterable=Ki,Wi.isntIterable=function(t){return!Ki(t)};var Vi={},Yi={};function $i(t){return null!==t&&"object"==typeof t}Yi.isntEmptyObject=Yi.isEmptyObject=Yi.isRecord=Yi.isntObject=Yi.isObject=void 0,Yi.isObject=$i,Yi.isntObject=function(t){return!$i(t)},Yi.isRecord=function(t){return $i(t)},Yi.isEmptyObject=function(t){return 0===Object.keys(t).length},Yi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Qi={};function Gi(t){return"number"==typeof t}Qi.isntNumber=Qi.isNumber=void 0,Qi.isNumber=Gi,Qi.isntNumber=function(t){return!Gi(t)},Vi.isntJsonRpcError=Vi.isJsonRpcError=Vi.isntJsonRpcSuccess=Vi.isJsonRpcSuccess=Vi.isntJsonRpcRequest=Vi.isJsonRpcRequest=Vi.isntJsonRpcNotification=Vi.isJsonRpcNotification=void 0;const Xi=pi,Zi=Yi,to=Bi,eo=Qi,no=wi;function ro(t){return(0,to.isString)(t)||(0,eo.isNumber)(t)}function io(t){return(0,Xi.isArray)(t)||(0,Zi.isObject)(t)}function oo(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&(0,no.isUndefined)(t.id)&&io(t.params)}function so(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&ro(t.id)&&io(t.params)}function ao(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.id)&&"result"in t}function co(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&ro(t.id)&&function(t){return(0,Zi.isRecord)(t)&&(0,eo.isNumber)(t.code)&&(0,to.isString)(t.message)&&((0,no.isUndefined)(t.data)||(0,Zi.isObject)(t.data))}(t.error)}Vi.isJsonRpcNotification=oo,Vi.isntJsonRpcNotification=function(t){return!oo(t)},Vi.isJsonRpcRequest=so,Vi.isntJsonRpcRequest=function(t){return!so(t)},Vi.isJsonRpcSuccess=ao,Vi.isntJsonRpcSuccess=function(t){return!ao(t)},Vi.isJsonRpcError=co,Vi.isntJsonRpcError=function(t){return!co(t)};var uo={};uo.isntJson=uo.isJson=void 0,uo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},uo.isntJson=function t(e){return!t()};var fo={};fo.isAbsoluteURL=void 0,fo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=d&&d.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),n=d&&d.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(pi,t),n(mi,t),n(xi,t),n(_i,t),n(Oi,t),n(Ni,t),n(Ji,t),n(Ui,t),n(qi,t),n(zi,t),n(Wi,t),n(Vi,t),n(uo,t),n(bi,t),n(Qi,t),n(Yi,t),n(Bi,t),n(wi,t),n(fo,t)}(yi);t.BadEventError=Cr,t.Box=class{constructor(t){r.set(this,void 0),n(this,r,t,"f")}set(t){n(this,r,t,"f")}get(){return e(this,r,"f")}},t.Emitter=c,t.ExpirableMap=Br,t.FiniteStateMachine=Nr,t.HashMap=u,t.HashSet=f,t.LRUMap=or,t.ObservableFiniteStateMachine=class extends Nr{constructor(){super(...arguments),this.stateChanged=new di}get stateChangedObservable(){return this.stateChanged}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanged.next({event:t,oldState:e,newState:n}),yi.isEmptyObject(this.schema[n])&&this.stateChanged.complete()}},t.Queue=l,t.TLRUMap=jr,t.TrieMap=kr,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var Jr=function(t,e){return(Jr=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 Ur(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}Jr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Pr(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 qr(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 Dr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function zr(t){return"function"==typeof t}function Fr(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 Wr=Fr((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 Lr(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Hr=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=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=Pr(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 c=this.initialTeardown;if(zr(c))try{c()}catch(t){i=t instanceof Wr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Pr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Yr(d)}catch(t){i=null!=i?i:[],t instanceof Wr?i=Dr(Dr([],qr(i)),qr(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(i)throw new Wr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Yr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&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)&&Lr(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Lr(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Kr=Hr.EMPTY;function Vr(t){return t instanceof Hr||t&&"closed"in t&&zr(t.remove)&&zr(t.add)&&zr(t.unsubscribe)}function Yr(t){zr(t)?t():t.unsubscribe()}var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qr={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qr.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Dr([],qr(t)))},clearTimeout:function(t){var e=Qr.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Gr(t){Qr.setTimeout((function(){throw t}))}function Xr(){}var Zr=null;function ti(t){if($r.useDeprecatedSynchronousErrorHandling){var e=!Zr;if(e&&(Zr={errorThrown:!1,error:null}),t(),e){var n=Zr,r=n.errorThrown,i=n.error;if(Zr=null,r)throw i}}else t()}var ei=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Vr(e)&&e.add(n)):n.destination=oi,n}return Ur(e,t),e.create=function(t,e,n){return new ni(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}(Hr),ni=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(zr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&$r.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?ri(i):Xr,error:ri(null!=n?n:ii),complete:r?ri(r):Xr},o}return Ur(e,t),e}(ei);function ri(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Dr([],qr(e)))}catch(t){Gr(t)}}}function ii(t){throw t}var oi={closed:!0,next:Xr,error:ii,complete:Xr},si="function"==typeof Symbol&&Symbol.observable||"@@observable";function ai(t){return t}function ci(t){return 0===t.length?ai:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ui=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 ei||function(t){return t&&zr(t.next)&&zr(t.error)&&zr(t.complete)}(r)&&Vr(r)?t:new ni(t,e,n);return ti((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=fi(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[si]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ci(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=fi(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 fi(t){var e;return null!==(e=null!=t?t:$r.Promise)&&void 0!==e?e:Promise}var li=Fr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),di=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Ur(e,t),e.prototype.lift=function(t){var e=new hi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new li},e.prototype.next=function(t){var e=this;ti((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Pr(i),s=o.next();!s.done;s=o.next()){s.value.next(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ti((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;ti((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=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=e.hasError,r=e.isStopped,i=e.observers;return n||r?Kr:(i.push(t),new Hr((function(){return Lr(i,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 ui;return t.source=this,t},e.create=function(t,e){return new hi(t,e)},e}(ui),hi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Ur(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:Kr},e}(di),yi={},pi={};function vi(t){return Array.isArray(t)}pi.isntEmptyArray=pi.isEmptyArray=pi.isntArray=pi.isArray=void 0,pi.isArray=vi,pi.isntArray=function(t){return!vi(t)},pi.isEmptyArray=function(t){return 0===t.length},pi.isntEmptyArray=function(t){return 0!==t.length};var mi={},bi={};function gi(t){return null===t}bi.isntNull=bi.isNull=void 0,bi.isNull=gi,bi.isntNull=function(t){return!gi(t)};var wi={};function Si(t){return void 0===t}wi.isntUndefined=wi.isUndefined=void 0,wi.isUndefined=Si,wi.isntUndefined=function(t){return!Si(t)},mi.isntAsyncIterable=mi.isAsyncIterable=void 0;const Ti=bi,Ai=wi;function Ei(t){return(0,Ti.isntNull)(t)&&(0,Ai.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}mi.isAsyncIterable=Ei,mi.isntAsyncIterable=function(t){return!Ei(t)};var xi={};function Ii(t){return"bigint"==typeof t}xi.isntBigInt=xi.isBigInt=void 0,xi.isBigInt=Ii,xi.isntBigInt=function(t){return!Ii(t)};var _i={};function Mi(t){return"boolean"==typeof t}_i.isntBoolean=_i.isBoolean=void 0,_i.isBoolean=Mi,_i.isntBoolean=function(t){return!Mi(t)};var Oi={},Bi={};function ji(t){return"string"==typeof t}Bi.isntString=Bi.isString=void 0,Bi.isString=ji,Bi.isntString=function(t){return!ji(t)},Oi.isntChar=Oi.isChar=void 0;const Ri=Bi;function ki(t){return(0,Ri.isString)(t)&&1===t.length}Oi.isChar=ki,Oi.isntChar=function(t){return!ki(t)};var Ni={};function Ci(t){return t instanceof Date}Ni.isntDate=Ni.isDate=void 0,Ni.isDate=Ci,Ni.isntDate=function(t){return!Ci(t)};var Ji={};Ji.inEnum=void 0,Ji.inEnum=function(t,e){return Object.values(e).includes(t)};var Ui={};function Pi(t){return t instanceof Error}Ui.isntError=Ui.isError=void 0,Ui.isError=Pi,Ui.isntError=function(t){return!Pi(t)};var qi={};function Di(t){return!t}qi.isntFalsy=qi.isFalsy=void 0,qi.isFalsy=Di,qi.isntFalsy=function(t){return!Di(t)};var zi={};function Fi(t){return"function"==typeof t}zi.isntFunction=zi.isFunction=void 0,zi.isFunction=Fi,zi.isntFunction=function(t){return!Fi(t)};var Wi={};Wi.isntIterable=Wi.isIterable=void 0;const Li=bi,Hi=wi;function Ki(t){return(0,Li.isntNull)(t)&&(0,Hi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Wi.isIterable=Ki,Wi.isntIterable=function(t){return!Ki(t)};var Vi={},Yi={};function $i(t){return null!==t&&"object"==typeof t}Yi.isntEmptyObject=Yi.isEmptyObject=Yi.isRecord=Yi.isntObject=Yi.isObject=void 0,Yi.isObject=$i,Yi.isntObject=function(t){return!$i(t)},Yi.isRecord=function(t){return $i(t)},Yi.isEmptyObject=function(t){return 0===Object.keys(t).length},Yi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Qi={};function Gi(t){return"number"==typeof t}Qi.isntNumber=Qi.isNumber=void 0,Qi.isNumber=Gi,Qi.isntNumber=function(t){return!Gi(t)},Vi.isntJsonRpcError=Vi.isJsonRpcError=Vi.isntJsonRpcSuccess=Vi.isJsonRpcSuccess=Vi.isntJsonRpcRequest=Vi.isJsonRpcRequest=Vi.isntJsonRpcNotification=Vi.isJsonRpcNotification=void 0;const Xi=pi,Zi=Yi,to=Bi,eo=Qi,no=wi;function ro(t){return(0,to.isString)(t)||(0,eo.isNumber)(t)}function io(t){return(0,Xi.isArray)(t)||(0,Zi.isObject)(t)}function oo(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&(0,no.isUndefined)(t.id)&&io(t.params)}function so(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&ro(t.id)&&io(t.params)}function ao(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.id)&&"result"in t}function co(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&ro(t.id)&&function(t){return(0,Zi.isRecord)(t)&&(0,eo.isNumber)(t.code)&&(0,to.isString)(t.message)&&((0,no.isUndefined)(t.data)||(0,Zi.isObject)(t.data))}(t.error)}Vi.isJsonRpcNotification=oo,Vi.isntJsonRpcNotification=function(t){return!oo(t)},Vi.isJsonRpcRequest=so,Vi.isntJsonRpcRequest=function(t){return!so(t)},Vi.isJsonRpcSuccess=ao,Vi.isntJsonRpcSuccess=function(t){return!ao(t)},Vi.isJsonRpcError=co,Vi.isntJsonRpcError=function(t){return!co(t)};var uo={};uo.isntJson=uo.isJson=void 0,uo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},uo.isntJson=function t(e){return!t()};var fo={};fo.isAbsoluteURL=void 0,fo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=d&&d.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),n=d&&d.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(pi,t),n(mi,t),n(xi,t),n(_i,t),n(Oi,t),n(Ni,t),n(Ji,t),n(Ui,t),n(qi,t),n(zi,t),n(Wi,t),n(Vi,t),n(uo,t),n(bi,t),n(Qi,t),n(Yi,t),n(Bi,t),n(wi,t),n(fo,t)}(yi);t.BadEventError=Cr,t.Box=class{constructor(t){r.set(this,void 0),n(this,r,t,"f")}set(t){n(this,r,t,"f")}get(){return e(this,r,"f")}},t.Emitter=c,t.ExpirableMap=Br,t.FiniteStateMachine=Nr,t.HashMap=u,t.HashSet=f,t.LRUMap=or,t.ObservableFiniteStateMachine=class extends Nr{constructor(){super(...arguments),this.stateChanges=new di}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),yi.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}},t.Queue=l,t.TLRUMap=jr,t.TrieMap=kr,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map

@@ -29,3 +29,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Structures={})}(this,(function(t){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Jr=function(t,e){return(Jr=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 Ur(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}Jr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Pr(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 qr(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 Dr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function zr(t){return"function"==typeof t}function Fr(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 Wr=Fr((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 Lr(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Hr=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=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=Pr(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 c=this.initialTeardown;if(zr(c))try{c()}catch(t){i=t instanceof Wr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Pr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Yr(d)}catch(t){i=null!=i?i:[],t instanceof Wr?i=Dr(Dr([],qr(i)),qr(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(i)throw new Wr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Yr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&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)&&Lr(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Lr(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Kr=Hr.EMPTY;function Vr(t){return t instanceof Hr||t&&"closed"in t&&zr(t.remove)&&zr(t.add)&&zr(t.unsubscribe)}function Yr(t){zr(t)?t():t.unsubscribe()}var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qr={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qr.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Dr([],qr(t)))},clearTimeout:function(t){var e=Qr.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Gr(t){Qr.setTimeout((function(){throw t}))}function Xr(){}var Zr=null;function ti(t){if($r.useDeprecatedSynchronousErrorHandling){var e=!Zr;if(e&&(Zr={errorThrown:!1,error:null}),t(),e){var n=Zr,r=n.errorThrown,i=n.error;if(Zr=null,r)throw i}}else t()}var ei=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Vr(e)&&e.add(n)):n.destination=oi,n}return Ur(e,t),e.create=function(t,e,n){return new ni(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}(Hr),ni=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(zr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&$r.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?ri(i):Xr,error:ri(null!=n?n:ii),complete:r?ri(r):Xr},o}return Ur(e,t),e}(ei);function ri(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Dr([],qr(e)))}catch(t){Gr(t)}}}function ii(t){throw t}var oi={closed:!0,next:Xr,error:ii,complete:Xr},si="function"==typeof Symbol&&Symbol.observable||"@@observable";function ai(t){return t}function ci(t){return 0===t.length?ai:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ui=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 ei||function(t){return t&&zr(t.next)&&zr(t.error)&&zr(t.complete)}(r)&&Vr(r)?t:new ni(t,e,n);return ti((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=fi(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[si]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ci(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=fi(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 fi(t){var e;return null!==(e=null!=t?t:$r.Promise)&&void 0!==e?e:Promise}var li=Fr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),di=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Ur(e,t),e.prototype.lift=function(t){var e=new hi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new li},e.prototype.next=function(t){var e=this;ti((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Pr(i),s=o.next();!s.done;s=o.next()){s.value.next(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ti((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;ti((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=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=e.hasError,r=e.isStopped,i=e.observers;return n||r?Kr:(i.push(t),new Hr((function(){return Lr(i,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 ui;return t.source=this,t},e.create=function(t,e){return new hi(t,e)},e}(ui),hi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Ur(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:Kr},e}(di),yi={},pi={};function vi(t){return Array.isArray(t)}pi.isntEmptyArray=pi.isEmptyArray=pi.isntArray=pi.isArray=void 0,pi.isArray=vi,pi.isntArray=function(t){return!vi(t)},pi.isEmptyArray=function(t){return 0===t.length},pi.isntEmptyArray=function(t){return 0!==t.length};var mi={},bi={};function gi(t){return null===t}bi.isntNull=bi.isNull=void 0,bi.isNull=gi,bi.isntNull=function(t){return!gi(t)};var wi={};function Si(t){return void 0===t}wi.isntUndefined=wi.isUndefined=void 0,wi.isUndefined=Si,wi.isntUndefined=function(t){return!Si(t)},mi.isntAsyncIterable=mi.isAsyncIterable=void 0;const Ti=bi,Ai=wi;function Ei(t){return(0,Ti.isntNull)(t)&&(0,Ai.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}mi.isAsyncIterable=Ei,mi.isntAsyncIterable=function(t){return!Ei(t)};var xi={};function Ii(t){return"bigint"==typeof t}xi.isntBigInt=xi.isBigInt=void 0,xi.isBigInt=Ii,xi.isntBigInt=function(t){return!Ii(t)};var _i={};function Mi(t){return"boolean"==typeof t}_i.isntBoolean=_i.isBoolean=void 0,_i.isBoolean=Mi,_i.isntBoolean=function(t){return!Mi(t)};var Oi={},Bi={};function ji(t){return"string"==typeof t}Bi.isntString=Bi.isString=void 0,Bi.isString=ji,Bi.isntString=function(t){return!ji(t)},Oi.isntChar=Oi.isChar=void 0;const Ri=Bi;function ki(t){return(0,Ri.isString)(t)&&1===t.length}Oi.isChar=ki,Oi.isntChar=function(t){return!ki(t)};var Ni={};function Ci(t){return t instanceof Date}Ni.isntDate=Ni.isDate=void 0,Ni.isDate=Ci,Ni.isntDate=function(t){return!Ci(t)};var Ji={};Ji.inEnum=void 0,Ji.inEnum=function(t,e){return Object.values(e).includes(t)};var Ui={};function Pi(t){return t instanceof Error}Ui.isntError=Ui.isError=void 0,Ui.isError=Pi,Ui.isntError=function(t){return!Pi(t)};var qi={};function Di(t){return!t}qi.isntFalsy=qi.isFalsy=void 0,qi.isFalsy=Di,qi.isntFalsy=function(t){return!Di(t)};var zi={};function Fi(t){return"function"==typeof t}zi.isntFunction=zi.isFunction=void 0,zi.isFunction=Fi,zi.isntFunction=function(t){return!Fi(t)};var Wi={};Wi.isntIterable=Wi.isIterable=void 0;const Li=bi,Hi=wi;function Ki(t){return(0,Li.isntNull)(t)&&(0,Hi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Wi.isIterable=Ki,Wi.isntIterable=function(t){return!Ki(t)};var Vi={},Yi={};function $i(t){return null!==t&&"object"==typeof t}Yi.isntEmptyObject=Yi.isEmptyObject=Yi.isRecord=Yi.isntObject=Yi.isObject=void 0,Yi.isObject=$i,Yi.isntObject=function(t){return!$i(t)},Yi.isRecord=function(t){return $i(t)},Yi.isEmptyObject=function(t){return 0===Object.keys(t).length},Yi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Qi={};function Gi(t){return"number"==typeof t}Qi.isntNumber=Qi.isNumber=void 0,Qi.isNumber=Gi,Qi.isntNumber=function(t){return!Gi(t)},Vi.isntJsonRpcError=Vi.isJsonRpcError=Vi.isntJsonRpcSuccess=Vi.isJsonRpcSuccess=Vi.isntJsonRpcRequest=Vi.isJsonRpcRequest=Vi.isntJsonRpcNotification=Vi.isJsonRpcNotification=void 0;const Xi=pi,Zi=Yi,to=Bi,eo=Qi,no=wi;function ro(t){return(0,to.isString)(t)||(0,eo.isNumber)(t)}function io(t){return(0,Xi.isArray)(t)||(0,Zi.isObject)(t)}function oo(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&(0,no.isUndefined)(t.id)&&io(t.params)}function so(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&ro(t.id)&&io(t.params)}function ao(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.id)&&"result"in t}function co(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&ro(t.id)&&function(t){return(0,Zi.isRecord)(t)&&(0,eo.isNumber)(t.code)&&(0,to.isString)(t.message)&&((0,no.isUndefined)(t.data)||(0,Zi.isObject)(t.data))}(t.error)}Vi.isJsonRpcNotification=oo,Vi.isntJsonRpcNotification=function(t){return!oo(t)},Vi.isJsonRpcRequest=so,Vi.isntJsonRpcRequest=function(t){return!so(t)},Vi.isJsonRpcSuccess=ao,Vi.isntJsonRpcSuccess=function(t){return!ao(t)},Vi.isJsonRpcError=co,Vi.isntJsonRpcError=function(t){return!co(t)};var uo={};uo.isntJson=uo.isJson=void 0,uo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},uo.isntJson=function t(e){return!t()};var fo={};fo.isAbsoluteURL=void 0,fo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=d&&d.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),n=d&&d.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(pi,t),n(mi,t),n(xi,t),n(_i,t),n(Oi,t),n(Ni,t),n(Ji,t),n(Ui,t),n(qi,t),n(zi,t),n(Wi,t),n(Vi,t),n(uo,t),n(bi,t),n(Qi,t),n(Yi,t),n(Bi,t),n(wi,t),n(fo,t)}(yi);t.BadEventError=Cr,t.Box=class{constructor(t){r.set(this,void 0),n(this,r,t,"f")}set(t){n(this,r,t,"f")}get(){return e(this,r,"f")}},t.Emitter=c,t.ExpirableMap=Br,t.FiniteStateMachine=Nr,t.HashMap=u,t.HashSet=f,t.LRUMap=or,t.ObservableFiniteStateMachine=class extends Nr{constructor(){super(...arguments),this.stateChanged=new di}get stateChangedObservable(){return this.stateChanged}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanged.next({event:t,oldState:e,newState:n}),yi.isEmptyObject(this.schema[n])&&this.stateChanged.complete()}},t.Queue=l,t.TLRUMap=jr,t.TrieMap=kr,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var Jr=function(t,e){return(Jr=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 Ur(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}Jr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Pr(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 qr(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 Dr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function zr(t){return"function"==typeof t}function Fr(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 Wr=Fr((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 Lr(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Hr=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=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=Pr(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 c=this.initialTeardown;if(zr(c))try{c()}catch(t){i=t instanceof Wr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Pr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Yr(d)}catch(t){i=null!=i?i:[],t instanceof Wr?i=Dr(Dr([],qr(i)),qr(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(i)throw new Wr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Yr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&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)&&Lr(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Lr(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Kr=Hr.EMPTY;function Vr(t){return t instanceof Hr||t&&"closed"in t&&zr(t.remove)&&zr(t.add)&&zr(t.unsubscribe)}function Yr(t){zr(t)?t():t.unsubscribe()}var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qr={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qr.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Dr([],qr(t)))},clearTimeout:function(t){var e=Qr.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Gr(t){Qr.setTimeout((function(){throw t}))}function Xr(){}var Zr=null;function ti(t){if($r.useDeprecatedSynchronousErrorHandling){var e=!Zr;if(e&&(Zr={errorThrown:!1,error:null}),t(),e){var n=Zr,r=n.errorThrown,i=n.error;if(Zr=null,r)throw i}}else t()}var ei=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Vr(e)&&e.add(n)):n.destination=oi,n}return Ur(e,t),e.create=function(t,e,n){return new ni(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}(Hr),ni=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(zr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&$r.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?ri(i):Xr,error:ri(null!=n?n:ii),complete:r?ri(r):Xr},o}return Ur(e,t),e}(ei);function ri(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Dr([],qr(e)))}catch(t){Gr(t)}}}function ii(t){throw t}var oi={closed:!0,next:Xr,error:ii,complete:Xr},si="function"==typeof Symbol&&Symbol.observable||"@@observable";function ai(t){return t}function ci(t){return 0===t.length?ai:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ui=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 ei||function(t){return t&&zr(t.next)&&zr(t.error)&&zr(t.complete)}(r)&&Vr(r)?t:new ni(t,e,n);return ti((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=fi(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[si]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ci(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=fi(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 fi(t){var e;return null!==(e=null!=t?t:$r.Promise)&&void 0!==e?e:Promise}var li=Fr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),di=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Ur(e,t),e.prototype.lift=function(t){var e=new hi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new li},e.prototype.next=function(t){var e=this;ti((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Pr(i),s=o.next();!s.done;s=o.next()){s.value.next(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ti((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;ti((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=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=e.hasError,r=e.isStopped,i=e.observers;return n||r?Kr:(i.push(t),new Hr((function(){return Lr(i,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 ui;return t.source=this,t},e.create=function(t,e){return new hi(t,e)},e}(ui),hi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Ur(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:Kr},e}(di),yi={},pi={};function vi(t){return Array.isArray(t)}pi.isntEmptyArray=pi.isEmptyArray=pi.isntArray=pi.isArray=void 0,pi.isArray=vi,pi.isntArray=function(t){return!vi(t)},pi.isEmptyArray=function(t){return 0===t.length},pi.isntEmptyArray=function(t){return 0!==t.length};var mi={},bi={};function gi(t){return null===t}bi.isntNull=bi.isNull=void 0,bi.isNull=gi,bi.isntNull=function(t){return!gi(t)};var wi={};function Si(t){return void 0===t}wi.isntUndefined=wi.isUndefined=void 0,wi.isUndefined=Si,wi.isntUndefined=function(t){return!Si(t)},mi.isntAsyncIterable=mi.isAsyncIterable=void 0;const Ti=bi,Ai=wi;function Ei(t){return(0,Ti.isntNull)(t)&&(0,Ai.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}mi.isAsyncIterable=Ei,mi.isntAsyncIterable=function(t){return!Ei(t)};var xi={};function Ii(t){return"bigint"==typeof t}xi.isntBigInt=xi.isBigInt=void 0,xi.isBigInt=Ii,xi.isntBigInt=function(t){return!Ii(t)};var _i={};function Mi(t){return"boolean"==typeof t}_i.isntBoolean=_i.isBoolean=void 0,_i.isBoolean=Mi,_i.isntBoolean=function(t){return!Mi(t)};var Oi={},Bi={};function ji(t){return"string"==typeof t}Bi.isntString=Bi.isString=void 0,Bi.isString=ji,Bi.isntString=function(t){return!ji(t)},Oi.isntChar=Oi.isChar=void 0;const Ri=Bi;function ki(t){return(0,Ri.isString)(t)&&1===t.length}Oi.isChar=ki,Oi.isntChar=function(t){return!ki(t)};var Ni={};function Ci(t){return t instanceof Date}Ni.isntDate=Ni.isDate=void 0,Ni.isDate=Ci,Ni.isntDate=function(t){return!Ci(t)};var Ji={};Ji.inEnum=void 0,Ji.inEnum=function(t,e){return Object.values(e).includes(t)};var Ui={};function Pi(t){return t instanceof Error}Ui.isntError=Ui.isError=void 0,Ui.isError=Pi,Ui.isntError=function(t){return!Pi(t)};var qi={};function Di(t){return!t}qi.isntFalsy=qi.isFalsy=void 0,qi.isFalsy=Di,qi.isntFalsy=function(t){return!Di(t)};var zi={};function Fi(t){return"function"==typeof t}zi.isntFunction=zi.isFunction=void 0,zi.isFunction=Fi,zi.isntFunction=function(t){return!Fi(t)};var Wi={};Wi.isntIterable=Wi.isIterable=void 0;const Li=bi,Hi=wi;function Ki(t){return(0,Li.isntNull)(t)&&(0,Hi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Wi.isIterable=Ki,Wi.isntIterable=function(t){return!Ki(t)};var Vi={},Yi={};function $i(t){return null!==t&&"object"==typeof t}Yi.isntEmptyObject=Yi.isEmptyObject=Yi.isRecord=Yi.isntObject=Yi.isObject=void 0,Yi.isObject=$i,Yi.isntObject=function(t){return!$i(t)},Yi.isRecord=function(t){return $i(t)},Yi.isEmptyObject=function(t){return 0===Object.keys(t).length},Yi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Qi={};function Gi(t){return"number"==typeof t}Qi.isntNumber=Qi.isNumber=void 0,Qi.isNumber=Gi,Qi.isntNumber=function(t){return!Gi(t)},Vi.isntJsonRpcError=Vi.isJsonRpcError=Vi.isntJsonRpcSuccess=Vi.isJsonRpcSuccess=Vi.isntJsonRpcRequest=Vi.isJsonRpcRequest=Vi.isntJsonRpcNotification=Vi.isJsonRpcNotification=void 0;const Xi=pi,Zi=Yi,to=Bi,eo=Qi,no=wi;function ro(t){return(0,to.isString)(t)||(0,eo.isNumber)(t)}function io(t){return(0,Xi.isArray)(t)||(0,Zi.isObject)(t)}function oo(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&(0,no.isUndefined)(t.id)&&io(t.params)}function so(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.method)&&ro(t.id)&&io(t.params)}function ao(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&(0,to.isString)(t.id)&&"result"in t}function co(t){return(0,Zi.isRecord)(t)&&(0,to.isString)(t.jsonrpc)&&ro(t.id)&&function(t){return(0,Zi.isRecord)(t)&&(0,eo.isNumber)(t.code)&&(0,to.isString)(t.message)&&((0,no.isUndefined)(t.data)||(0,Zi.isObject)(t.data))}(t.error)}Vi.isJsonRpcNotification=oo,Vi.isntJsonRpcNotification=function(t){return!oo(t)},Vi.isJsonRpcRequest=so,Vi.isntJsonRpcRequest=function(t){return!so(t)},Vi.isJsonRpcSuccess=ao,Vi.isntJsonRpcSuccess=function(t){return!ao(t)},Vi.isJsonRpcError=co,Vi.isntJsonRpcError=function(t){return!co(t)};var uo={};uo.isntJson=uo.isJson=void 0,uo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},uo.isntJson=function t(e){return!t()};var fo={};fo.isAbsoluteURL=void 0,fo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=d&&d.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),n=d&&d.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(pi,t),n(mi,t),n(xi,t),n(_i,t),n(Oi,t),n(Ni,t),n(Ji,t),n(Ui,t),n(qi,t),n(zi,t),n(Wi,t),n(Vi,t),n(uo,t),n(bi,t),n(Qi,t),n(Yi,t),n(Bi,t),n(wi,t),n(fo,t)}(yi);t.BadEventError=Cr,t.Box=class{constructor(t){r.set(this,void 0),n(this,r,t,"f")}set(t){n(this,r,t,"f")}get(){return e(this,r,"f")}},t.Emitter=c,t.ExpirableMap=Br,t.FiniteStateMachine=Nr,t.HashMap=u,t.HashSet=f,t.LRUMap=or,t.ObservableFiniteStateMachine=class extends Nr{constructor(){super(...arguments),this.stateChanges=new di}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),yi.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}},t.Queue=l,t.TLRUMap=jr,t.TrieMap=kr,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map

@@ -9,6 +9,6 @@ import { FiniteStateMachine } from './finite-state-machine';

export declare class ObservableFiniteStateMachine<State extends string, Event extends string> extends FiniteStateMachine<State, Event> {
private stateChanged;
get stateChangedObservable(): Observable<IFiniteStateMachineStateChange<State, Event>>;
private stateChanges;
observeStateChanges(): Observable<IFiniteStateMachineStateChange<State, Event>>;
send(event: Event): void;
}
export { BadEventError } from './finite-state-machine';

@@ -10,6 +10,6 @@ "use strict";

super(...arguments);
this.stateChanged = new rxjs_1.Subject();
this.stateChanges = new rxjs_1.Subject();
}
get stateChangedObservable() {
return this.stateChanged;
observeStateChanges() {
return this.stateChanges;
}

@@ -20,5 +20,5 @@ send(event) {

const newState = this.state;
this.stateChanged.next({ event, oldState, newState });
this.stateChanges.next({ event, oldState, newState });
if ((0, types_1.isEmptyObject)(this.schema[newState])) {
this.stateChanged.complete();
this.stateChanges.complete();
}

@@ -25,0 +25,0 @@ }

@@ -9,6 +9,6 @@ import { FiniteStateMachine } from './finite-state-machine';

export declare class ObservableFiniteStateMachine<State extends string, Event extends string> extends FiniteStateMachine<State, Event> {
private stateChanged;
get stateChangedObservable(): Observable<IFiniteStateMachineStateChange<State, Event>>;
private stateChanges;
observeStateChanges(): Observable<IFiniteStateMachineStateChange<State, Event>>;
send(event: Event): void;
}
export { BadEventError } from './finite-state-machine';

@@ -10,6 +10,6 @@ "use strict";

super(...arguments);
this.stateChanged = new rxjs_1.Subject();
this.stateChanges = new rxjs_1.Subject();
}
get stateChangedObservable() {
return this.stateChanged;
observeStateChanges() {
return this.stateChanges;
}

@@ -20,5 +20,5 @@ send(event) {

const newState = this.state;
this.stateChanged.next({ event, oldState, newState });
this.stateChanges.next({ event, oldState, newState });
if ((0, types_1.isEmptyObject)(this.schema[newState])) {
this.stateChanged.complete();
this.stateChanges.complete();
}

@@ -25,0 +25,0 @@ }

{
"name": "@blackglory/structures",
"version": "0.2.8",
"version": "0.3.0",
"description": "",

@@ -5,0 +5,0 @@ "files": [

@@ -189,4 +189,4 @@ # structures

> extends FiniteStateMachine<State, Event> {
get stateChangedObservable(): Observable<IFiniteStateMachineStateChanged<State, Event>>
observeStateChanges(): Observable<IFiniteStateMachineStateChange<State, Event>>
}
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc