@blackglory/structures 0.2.8 → 0.3.0
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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/es2015/index.min.mjs +1 -1
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +5 -5
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +5 -5
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +1 -1
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +1 -1
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +5 -5
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +5 -5
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +1 -1
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/observable-finite-state-machine.d.ts +2 -2
- package/lib/es2015/observable-finite-state-machine.js +5 -5
- package/lib/es2015/observable-finite-state-machine.js.map +1 -1
- package/lib/es2018/observable-finite-state-machine.d.ts +2 -2
- package/lib/es2018/observable-finite-state-machine.js +5 -5
- package/lib/es2018/observable-finite-state-machine.js.map +1 -1
- package/package.json +1 -1
|
@@ -26,5 +26,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
26
26
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
27
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
28
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */var zr=function(t,e){return(zr=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 Fr(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}zr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Wr(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 Lr(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 Kr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function Hr(t){return"function"==typeof t}function Vr(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 Yr=Vr((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 $r(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gr=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=Wr(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(Hr(c))try{c()}catch(t){i=t instanceof Yr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Wr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Zr(d)}catch(t){i=null!=i?i:[],t instanceof Yr?i=Kr(Kr([],Lr(i)),Lr(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 Yr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Zr(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)&&$r(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&$r(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Qr=Gr.EMPTY;function Xr(t){return t instanceof Gr||t&&"closed"in t&&Hr(t.remove)&&Hr(t.add)&&Hr(t.unsubscribe)}function Zr(t){Hr(t)?t():t.unsubscribe()}var ti={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ei={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ei.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Kr([],Lr(t)))},clearTimeout:function(t){var e=ei.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ni(t){ei.setTimeout((function(){throw t}))}function ri(){}var ii=null;function oi(t){if(ti.useDeprecatedSynchronousErrorHandling){var e=!ii;if(e&&(ii={errorThrown:!1,error:null}),t(),e){var n=ii,r=n.errorThrown,i=n.error;if(ii=null,r)throw i}}else t()}var si=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Xr(e)&&e.add(n)):n.destination=fi,n}return Fr(e,t),e.create=function(t,e,n){return new ai(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}(Gr),ai=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(Hr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&ti.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?ci(i):ri,error:ci(null!=n?n:ui),complete:r?ci(r):ri},o}return Fr(e,t),e}(si);function ci(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Kr([],Lr(e)))}catch(t){ni(t)}}}function ui(t){throw t}var fi={closed:!0,next:ri,error:ui,complete:ri},li="function"==typeof Symbol&&Symbol.observable||"@@observable";function di(t){return t}function hi(t){return 0===t.length?di:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var yi=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 si||function(t){return t&&Hr(t.next)&&Hr(t.error)&&Hr(t.complete)}(r)&&Xr(r)?t:new ai(t,e,n);return oi((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=pi(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[li]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return hi(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=pi(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 pi(t){var e;return null!==(e=null!=t?t:ti.Promise)&&void 0!==e?e:Promise}var vi=Vr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),mi=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 Fr(e,t),e.prototype.lift=function(t){var e=new bi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new vi},e.prototype.next=function(t){var e=this;oi((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Wr(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;oi((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;oi((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?Qr:(i.push(t),new Gr((function(){return $r(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 yi;return t.source=this,t},e.create=function(t,e){return new bi(t,e)},e}(yi),bi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Fr(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:Qr},e}(mi),gi={},wi={};function Si(t){return Array.isArray(t)}wi.isntEmptyArray=wi.isEmptyArray=wi.isntArray=wi.isArray=void 0,wi.isArray=Si,wi.isntArray=function(t){return!Si(t)},wi.isEmptyArray=function(t){return 0===t.length},wi.isntEmptyArray=function(t){return 0!==t.length};var Ai={},Ti={};function Ii(t){return null===t}Ti.isntNull=Ti.isNull=void 0,Ti.isNull=Ii,Ti.isntNull=function(t){return!Ii(t)};var Ei={};function xi(t){return void 0===t}Ei.isntUndefined=Ei.isUndefined=void 0,Ei.isUndefined=xi,Ei.isntUndefined=function(t){return!xi(t)},Ai.isntAsyncIterable=Ai.isAsyncIterable=void 0;const _i=Ti,Oi=Ei;function Bi(t){return(0,_i.isntNull)(t)&&(0,Oi.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Ai.isAsyncIterable=Bi,Ai.isntAsyncIterable=function(t){return!Bi(t)};var ji={};function Mi(t){return"bigint"==typeof t}ji.isntBigInt=ji.isBigInt=void 0,ji.isBigInt=Mi,ji.isntBigInt=function(t){return!Mi(t)};var Ri={};function ki(t){return"boolean"==typeof t}Ri.isntBoolean=Ri.isBoolean=void 0,Ri.isBoolean=ki,Ri.isntBoolean=function(t){return!ki(t)};var Ni={},Ci={};function Ji(t){return"string"==typeof t}Ci.isntString=Ci.isString=void 0,Ci.isString=Ji,Ci.isntString=function(t){return!Ji(t)},Ni.isntChar=Ni.isChar=void 0;const Pi=Ci;function Ui(t){return(0,Pi.isString)(t)&&1===t.length}Ni.isChar=Ui,Ni.isntChar=function(t){return!Ui(t)};var qi={};function Di(t){return t instanceof Date}qi.isntDate=qi.isDate=void 0,qi.isDate=Di,qi.isntDate=function(t){return!Di(t)};var zi={};zi.inEnum=void 0,zi.inEnum=function(t,e){return Object.values(e).includes(t)};var Fi={};function Wi(t){return t instanceof Error}Fi.isntError=Fi.isError=void 0,Fi.isError=Wi,Fi.isntError=function(t){return!Wi(t)};var Li={};function Ki(t){return!t}Li.isntFalsy=Li.isFalsy=void 0,Li.isFalsy=Ki,Li.isntFalsy=function(t){return!Ki(t)};var Hi={};function Vi(t){return"function"==typeof t}Hi.isntFunction=Hi.isFunction=void 0,Hi.isFunction=Vi,Hi.isntFunction=function(t){return!Vi(t)};var Yi={};Yi.isntIterable=Yi.isIterable=void 0;const $i=Ti,Gi=Ei;function Qi(t){return(0,$i.isntNull)(t)&&(0,Gi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Yi.isIterable=Qi,Yi.isntIterable=function(t){return!Qi(t)};var Xi={},Zi={};function to(t){return null!==t&&"object"==typeof t}Zi.isntEmptyObject=Zi.isEmptyObject=Zi.isRecord=Zi.isntObject=Zi.isObject=void 0,Zi.isObject=to,Zi.isntObject=function(t){return!to(t)},Zi.isRecord=function(t){return to(t)},Zi.isEmptyObject=function(t){return 0===Object.keys(t).length},Zi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var eo={};function no(t){return"number"==typeof t}eo.isntNumber=eo.isNumber=void 0,eo.isNumber=no,eo.isntNumber=function(t){return!no(t)},Xi.isntJsonRpcError=Xi.isJsonRpcError=Xi.isntJsonRpcSuccess=Xi.isJsonRpcSuccess=Xi.isntJsonRpcRequest=Xi.isJsonRpcRequest=Xi.isntJsonRpcNotification=Xi.isJsonRpcNotification=void 0;const ro=wi,io=Zi,oo=Ci,so=eo,ao=Ei;function co(t){return(0,oo.isString)(t)||(0,so.isNumber)(t)}function uo(t){return(0,ro.isArray)(t)||(0,io.isObject)(t)}function fo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.method)&&(0,ao.isUndefined)(t.id)&&uo(t.params)}function lo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.method)&&co(t.id)&&uo(t.params)}function ho(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.id)&&"result"in t}function yo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&co(t.id)&&function(t){return(0,io.isRecord)(t)&&(0,so.isNumber)(t.code)&&(0,oo.isString)(t.message)&&((0,ao.isUndefined)(t.data)||(0,io.isObject)(t.data))}(t.error)}Xi.isJsonRpcNotification=fo,Xi.isntJsonRpcNotification=function(t){return!fo(t)},Xi.isJsonRpcRequest=lo,Xi.isntJsonRpcRequest=function(t){return!lo(t)},Xi.isJsonRpcSuccess=ho,Xi.isntJsonRpcSuccess=function(t){return!ho(t)},Xi.isJsonRpcError=yo,Xi.isntJsonRpcError=function(t){return!yo(t)};var po={};po.isntJson=po.isJson=void 0,po.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},po.isntJson=function t(e){return!t()};var vo={};vo.isAbsoluteURL=void 0,vo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=y&&y.__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=y&&y.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(wi,t),n(Ai,t),n(ji,t),n(Ri,t),n(Ni,t),n(qi,t),n(zi,t),n(Fi,t),n(Li,t),n(Hi,t),n(Yi,t),n(Xi,t),n(po,t),n(Ti,t),n(eo,t),n(Zi,t),n(Ci,t),n(Ei,t),n(vo,t)}(gi);class mo extends qr{constructor(){super(...arguments),this.stateChanged=new mi}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}),gi.isEmptyObject(this.schema[n])&&this.stateChanged.complete()}}export{Dr as BadEventError,a as Box,f as Emitter,Cr as ExpirableMap,qr as FiniteStateMachine,l as HashMap,d as HashSet,fr as LRUMap,mo as ObservableFiniteStateMachine,h as Queue,Jr as TLRUMap,Ur as TrieMap,u as convertArrayToCons,c as convertConsToArray};
|
|
29
|
+
***************************************************************************** */var zr=function(t,e){return(zr=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 Fr(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}zr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Wr(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 Lr(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 Kr(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function Hr(t){return"function"==typeof t}function Vr(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 Yr=Vr((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 $r(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gr=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=Wr(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(Hr(c))try{c()}catch(t){i=t instanceof Yr?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var f=Wr(u),l=f.next();!l.done;l=f.next()){var d=l.value;try{Zr(d)}catch(t){i=null!=i?i:[],t instanceof Yr?i=Kr(Kr([],Lr(i)),Lr(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 Yr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Zr(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)&&$r(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&$r(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Qr=Gr.EMPTY;function Xr(t){return t instanceof Gr||t&&"closed"in t&&Hr(t.remove)&&Hr(t.add)&&Hr(t.unsubscribe)}function Zr(t){Hr(t)?t():t.unsubscribe()}var ti={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ei={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ei.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,Kr([],Lr(t)))},clearTimeout:function(t){var e=ei.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ni(t){ei.setTimeout((function(){throw t}))}function ri(){}var ii=null;function oi(t){if(ti.useDeprecatedSynchronousErrorHandling){var e=!ii;if(e&&(ii={errorThrown:!1,error:null}),t(),e){var n=ii,r=n.errorThrown,i=n.error;if(ii=null,r)throw i}}else t()}var si=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Xr(e)&&e.add(n)):n.destination=fi,n}return Fr(e,t),e.create=function(t,e,n){return new ai(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}(Gr),ai=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(Hr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&ti.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?ci(i):ri,error:ci(null!=n?n:ui),complete:r?ci(r):ri},o}return Fr(e,t),e}(si);function ci(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,Kr([],Lr(e)))}catch(t){ni(t)}}}function ui(t){throw t}var fi={closed:!0,next:ri,error:ui,complete:ri},li="function"==typeof Symbol&&Symbol.observable||"@@observable";function di(t){return t}function hi(t){return 0===t.length?di:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var yi=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 si||function(t){return t&&Hr(t.next)&&Hr(t.error)&&Hr(t.complete)}(r)&&Xr(r)?t:new ai(t,e,n);return oi((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=pi(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[li]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return hi(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=pi(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 pi(t){var e;return null!==(e=null!=t?t:ti.Promise)&&void 0!==e?e:Promise}var vi=Vr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),mi=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 Fr(e,t),e.prototype.lift=function(t){var e=new bi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new vi},e.prototype.next=function(t){var e=this;oi((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=Wr(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;oi((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;oi((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?Qr:(i.push(t),new Gr((function(){return $r(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 yi;return t.source=this,t},e.create=function(t,e){return new bi(t,e)},e}(yi),bi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Fr(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:Qr},e}(mi),gi={},wi={};function Si(t){return Array.isArray(t)}wi.isntEmptyArray=wi.isEmptyArray=wi.isntArray=wi.isArray=void 0,wi.isArray=Si,wi.isntArray=function(t){return!Si(t)},wi.isEmptyArray=function(t){return 0===t.length},wi.isntEmptyArray=function(t){return 0!==t.length};var Ai={},Ti={};function Ii(t){return null===t}Ti.isntNull=Ti.isNull=void 0,Ti.isNull=Ii,Ti.isntNull=function(t){return!Ii(t)};var Ei={};function xi(t){return void 0===t}Ei.isntUndefined=Ei.isUndefined=void 0,Ei.isUndefined=xi,Ei.isntUndefined=function(t){return!xi(t)},Ai.isntAsyncIterable=Ai.isAsyncIterable=void 0;const _i=Ti,Oi=Ei;function Bi(t){return(0,_i.isntNull)(t)&&(0,Oi.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Ai.isAsyncIterable=Bi,Ai.isntAsyncIterable=function(t){return!Bi(t)};var ji={};function Mi(t){return"bigint"==typeof t}ji.isntBigInt=ji.isBigInt=void 0,ji.isBigInt=Mi,ji.isntBigInt=function(t){return!Mi(t)};var Ri={};function ki(t){return"boolean"==typeof t}Ri.isntBoolean=Ri.isBoolean=void 0,Ri.isBoolean=ki,Ri.isntBoolean=function(t){return!ki(t)};var Ni={},Ci={};function Ji(t){return"string"==typeof t}Ci.isntString=Ci.isString=void 0,Ci.isString=Ji,Ci.isntString=function(t){return!Ji(t)},Ni.isntChar=Ni.isChar=void 0;const Pi=Ci;function Ui(t){return(0,Pi.isString)(t)&&1===t.length}Ni.isChar=Ui,Ni.isntChar=function(t){return!Ui(t)};var qi={};function Di(t){return t instanceof Date}qi.isntDate=qi.isDate=void 0,qi.isDate=Di,qi.isntDate=function(t){return!Di(t)};var zi={};zi.inEnum=void 0,zi.inEnum=function(t,e){return Object.values(e).includes(t)};var Fi={};function Wi(t){return t instanceof Error}Fi.isntError=Fi.isError=void 0,Fi.isError=Wi,Fi.isntError=function(t){return!Wi(t)};var Li={};function Ki(t){return!t}Li.isntFalsy=Li.isFalsy=void 0,Li.isFalsy=Ki,Li.isntFalsy=function(t){return!Ki(t)};var Hi={};function Vi(t){return"function"==typeof t}Hi.isntFunction=Hi.isFunction=void 0,Hi.isFunction=Vi,Hi.isntFunction=function(t){return!Vi(t)};var Yi={};Yi.isntIterable=Yi.isIterable=void 0;const $i=Ti,Gi=Ei;function Qi(t){return(0,$i.isntNull)(t)&&(0,Gi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Yi.isIterable=Qi,Yi.isntIterable=function(t){return!Qi(t)};var Xi={},Zi={};function to(t){return null!==t&&"object"==typeof t}Zi.isntEmptyObject=Zi.isEmptyObject=Zi.isRecord=Zi.isntObject=Zi.isObject=void 0,Zi.isObject=to,Zi.isntObject=function(t){return!to(t)},Zi.isRecord=function(t){return to(t)},Zi.isEmptyObject=function(t){return 0===Object.keys(t).length},Zi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var eo={};function no(t){return"number"==typeof t}eo.isntNumber=eo.isNumber=void 0,eo.isNumber=no,eo.isntNumber=function(t){return!no(t)},Xi.isntJsonRpcError=Xi.isJsonRpcError=Xi.isntJsonRpcSuccess=Xi.isJsonRpcSuccess=Xi.isntJsonRpcRequest=Xi.isJsonRpcRequest=Xi.isntJsonRpcNotification=Xi.isJsonRpcNotification=void 0;const ro=wi,io=Zi,oo=Ci,so=eo,ao=Ei;function co(t){return(0,oo.isString)(t)||(0,so.isNumber)(t)}function uo(t){return(0,ro.isArray)(t)||(0,io.isObject)(t)}function fo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.method)&&(0,ao.isUndefined)(t.id)&&uo(t.params)}function lo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.method)&&co(t.id)&&uo(t.params)}function ho(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&(0,oo.isString)(t.id)&&"result"in t}function yo(t){return(0,io.isRecord)(t)&&(0,oo.isString)(t.jsonrpc)&&co(t.id)&&function(t){return(0,io.isRecord)(t)&&(0,so.isNumber)(t.code)&&(0,oo.isString)(t.message)&&((0,ao.isUndefined)(t.data)||(0,io.isObject)(t.data))}(t.error)}Xi.isJsonRpcNotification=fo,Xi.isntJsonRpcNotification=function(t){return!fo(t)},Xi.isJsonRpcRequest=lo,Xi.isntJsonRpcRequest=function(t){return!lo(t)},Xi.isJsonRpcSuccess=ho,Xi.isntJsonRpcSuccess=function(t){return!ho(t)},Xi.isJsonRpcError=yo,Xi.isntJsonRpcError=function(t){return!yo(t)};var po={};po.isntJson=po.isJson=void 0,po.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},po.isntJson=function t(e){return!t()};var vo={};vo.isAbsoluteURL=void 0,vo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=y&&y.__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=y&&y.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(wi,t),n(Ai,t),n(ji,t),n(Ri,t),n(Ni,t),n(qi,t),n(zi,t),n(Fi,t),n(Li,t),n(Hi,t),n(Yi,t),n(Xi,t),n(po,t),n(Ti,t),n(eo,t),n(Zi,t),n(Ci,t),n(Ei,t),n(vo,t)}(gi);class mo extends qr{constructor(){super(...arguments),this.stateChanges=new mi}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}),gi.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}export{Dr as BadEventError,a as Box,f as Emitter,Cr as ExpirableMap,qr as FiniteStateMachine,l as HashMap,d as HashSet,fr as LRUMap,mo as ObservableFiniteStateMachine,h as Queue,Jr as TLRUMap,Ur as TrieMap,u as convertArrayToCons,c as convertConsToArray};
|
|
30
30
|
//# sourceMappingURL=index.min.mjs.map
|