@blackglory/structures 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/es2015/index.min.mjs +1 -1
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +194 -104
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +194 -104
- 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 +194 -104
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +194 -104
- 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/finite-state-machine.d.ts +1 -0
- package/lib/es2015/finite-state-machine.js +4 -1
- package/lib/es2015/finite-state-machine.js.map +1 -1
- package/lib/es2018/finite-state-machine.d.ts +1 -0
- package/lib/es2018/finite-state-machine.js +4 -1
- package/lib/es2018/finite-state-machine.js.map +1 -1
- package/package.json +11 -11
|
@@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
var t,e,n,r,i,o=function(t,e){return(o=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 s(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(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 c(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 u(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function l(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function f(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}class d{constructor(e){t.set(this,void 0),f(this,t,e,"f")}set(e){f(this,t,e,"f")}get(){return l(this,t,"f")}}function h([t,e]){return null===e?[t]:[t,...h(e)]}function y([t,...e]){return[t,e.length?y(e):null]}t=new WeakMap;class p{constructor(){e.set(this,new Map)}get[(e=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(t,n){l(this,e,"f").has(t)||l(this,e,"f").set(t,new Set);l(this,e,"f").get(t).add(n)}off(t,n){if(!l(this,e,"f").has(t))return;const r=l(this,e,"f").get(t);r.delete(n),0===r.size&&l(this,e,"f").delete(t)}emit(t,n){if(!l(this,e,"f").has(t))return;l(this,e,"f").get(t).forEach((t=>t(n)))}}class v{constructor(t){this.hash=t,n.set(this,new Map)}get[(n=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,n,"f").size}set(t,e){return l(this,n,"f").set(this.hash(t),e),this}has(t){return l(this,n,"f").has(this.hash(t))}get(t){return l(this,n,"f").get(this.hash(t))}delete(t){return l(this,n,"f").delete(this.hash(t))}clear(){l(this,n,"f").clear()}}class m{constructor(t){this.hash=t,r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,r,"f").size}[Symbol.iterator](){return l(this,r,"f").values()}add(t){return l(this,r,"f").set(this.hash(t),t),this}delete(t){return l(this,r,"f").delete(this.hash(t))}has(t){return l(this,r,"f").has(this.hash(t))}clear(){l(this,r,"f").clear()}values(){return l(this,r,"f").values()}}class b{constructor(){i.set(this,[])}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,i,"f").length}empty(){l(this,i,"f").length=0}enqueue(...t){l(this,i,"f").push(...t)}dequeue(){return l(this,i,"f").shift()}remove(t){let e;for(;(e=l(this,i,"f").indexOf(t))>=0;)l(this,i,"f").splice(e,1)}}var g,w,S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},T={},A={},E={},x={},I={},_={},O={};O.go=void 0,O.go=function(t){return t()},g=_,w=S&&S.__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]}),(S&&S.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||w(e,t,n)})(O,g);var M={},j={CustomError:void 0};class B extends Error{get name(){return this.constructor.name}}j.CustomError=B;var k={ExpectedError:void 0};const N=j;class P extends N.CustomError{}k.ExpectedError=P;var C={AssertionError:void 0};const z=j;class R extends z.CustomError{}C.AssertionError=R;var q={};q.normalize=void 0,q.normalize=function(t){var e;return{name:t.name,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var D={refute:void 0};const U=k;D.refute=function(t,e){if(t)throw new U.ExpectedError(e)};var J={assert:void 0};const W=C;J.assert=function(t,e){if(!t)throw new W.AssertionError(e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(j,t),n(k,t),n(C,t),n(q,t),n(D,t),n(J,t)}(M),I.chunkAsync=void 0;const F=_,L=M;I.chunkAsync=function(t,e){return(0,L.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,L.assert)(e>0,"The parameter size must be greater than 0"),(0,F.go)((async function*(){let n=[];for await(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var K={},H={},V={};function Y(t){return Array.isArray(t)}V.isntEmptyArray=V.isEmptyArray=V.isntArray=V.isArray=void 0,V.isArray=Y,V.isntArray=function(t){return!Y(t)},V.isEmptyArray=function(t){return 0===t.length},V.isntEmptyArray=function(t){return 0!==t.length};var $={},G={};function Q(t){return null===t}G.isntNull=G.isNull=void 0,G.isNull=Q,G.isntNull=function(t){return!Q(t)};var X={};function Z(t){return void 0===t}X.isntUndefined=X.isUndefined=void 0,X.isUndefined=Z,X.isntUndefined=function(t){return!Z(t)},$.isntAsyncIterable=$.isAsyncIterable=void 0;const tt=G,et=X;function nt(t){return(0,tt.isntNull)(t)&&(0,et.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}$.isAsyncIterable=nt,$.isntAsyncIterable=function(t){return!nt(t)};var rt={};function it(t){return"bigint"==typeof t}rt.isntBigInt=rt.isBigInt=void 0,rt.isBigInt=it,rt.isntBigInt=function(t){return!it(t)};var ot={};function st(t){return"boolean"==typeof t}ot.isntBoolean=ot.isBoolean=void 0,ot.isBoolean=st,ot.isntBoolean=function(t){return!st(t)};var at={},ct={};function ut(t){return"string"==typeof t}ct.isntString=ct.isString=void 0,ct.isString=ut,ct.isntString=function(t){return!ut(t)},at.isntChar=at.isChar=void 0;const lt=ct;function ft(t){return(0,lt.isString)(t)&&1===t.length}at.isChar=ft,at.isntChar=function(t){return!ft(t)};var dt={};function ht(t){return t instanceof Date}dt.isntDate=dt.isDate=void 0,dt.isDate=ht,dt.isntDate=function(t){return!ht(t)};var yt={};yt.inEnum=void 0,yt.inEnum=function(t,e){return Object.values(e).includes(t)};var pt={};function vt(t){return t instanceof Error}pt.isntError=pt.isError=void 0,pt.isError=vt,pt.isntError=function(t){return!vt(t)};var mt={};function bt(t){return!t}mt.isntFalsy=mt.isFalsy=void 0,mt.isFalsy=bt,mt.isntFalsy=function(t){return!bt(t)};var gt={};function wt(t){return"function"==typeof t}gt.isntFunction=gt.isFunction=void 0,gt.isFunction=wt,gt.isntFunction=function(t){return!wt(t)};var St={};St.isntIterable=St.isIterable=void 0;const Tt=G,At=X;function Et(t){return(0,Tt.isntNull)(t)&&(0,At.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}St.isIterable=Et,St.isntIterable=function(t){return!Et(t)};var xt={},It={};var _t=Function.prototype,Ot=Object.prototype,Mt=_t.toString,jt=Ot.hasOwnProperty,Bt=Mt.call(Object),kt=Ot.toString,Nt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var Pt=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=kt.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=Nt(t);if(null===e)return!0;var n=jt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Mt.call(n)==Bt},Ct=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};It.isntEmptyObject=It.isEmptyObject=It.isntPlainObject=It.isPlainObject=It.isntObject=It.isObject=void 0;const zt=Ct(Pt);function Rt(t){return null!==t&&"object"==typeof t}function qt(t){return(0,zt.default)(t)}It.isObject=Rt,It.isntObject=function(t){return!Rt(t)},It.isPlainObject=qt,It.isntPlainObject=function(t){return!qt(t)},It.isEmptyObject=function(t){return 0===Object.keys(t).length},It.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Dt={};function Ut(t){return"number"==typeof t}Dt.isntNumber=Dt.isNumber=void 0,Dt.isNumber=Ut,Dt.isntNumber=function(t){return!Ut(t)},xt.isntJsonRpcError=xt.isJsonRpcError=xt.isntJsonRpcSuccess=xt.isJsonRpcSuccess=xt.isntJsonRpcRequest=xt.isJsonRpcRequest=xt.isntJsonRpcNotification=xt.isJsonRpcNotification=void 0;const Jt=V,Wt=It,Ft=ct,Lt=Dt,Kt=X;function Ht(t){return(0,Ft.isString)(t)||(0,Lt.isNumber)(t)}function Vt(t){return(0,Jt.isArray)(t)||(0,Wt.isObject)(t)}function Yt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.method)&&(0,Kt.isUndefined)(t.id)&&Vt(t.params)}function $t(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.method)&&Ht(t.id)&&Vt(t.params)}function Gt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.id)&&"result"in t}function Qt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&Ht(t.id)&&function(t){return(0,Wt.isPlainObject)(t)&&(0,Lt.isNumber)(t.code)&&(0,Ft.isString)(t.message)&&((0,Kt.isUndefined)(t.data)||(0,Wt.isObject)(t.data))}(t.error)}xt.isJsonRpcNotification=Yt,xt.isntJsonRpcNotification=function(t){return!Yt(t)},xt.isJsonRpcRequest=$t,xt.isntJsonRpcRequest=function(t){return!$t(t)},xt.isJsonRpcSuccess=Gt,xt.isntJsonRpcSuccess=function(t){return!Gt(t)},xt.isJsonRpcError=Qt,xt.isntJsonRpcError=function(t){return!Qt(t)};var Xt={};Xt.isntJson=Xt.isJson=void 0,Xt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Xt.isntJson=function t(e){return!t()};var Zt={};Zt.isAbsoluteURL=void 0,Zt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(V,t),n($,t),n(rt,t),n(ot,t),n(at,t),n(dt,t),n(yt,t),n(pt,t),n(mt,t),n(gt,t),n(St,t),n(xt,t),n(Xt,t),n(G,t),n(Dt,t),n(It,t),n(ct,t),n(X,t),n(Zt,t)}(H),K.chunkByAsync=void 0;const te=H;K.chunkByAsync=function(t,e){return(0,te.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t):async function*(t){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t)};var ee={};ee.chunkBy=void 0,ee.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var ne={chunk:void 0};const re=_,ie=M;ne.chunk=function(t,e){return(0,ie.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,ie.assert)(e>0,"The parameter size must be greater than 0"),(0,re.go)((function*(){let n=[];for(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var oe={concatAsync:void 0};const se=H,ae=_;oe.concatAsync=function(t,...e){return(0,ae.go)((async function*(){for(const n of[t,...e])if((0,se.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var ce={concat:void 0};const ue=_;ce.concat=function(t,...e){return(0,ue.go)((function*(){for(const n of[t,...e])yield*n}))};var le={},fe={};fe.copyIterable=fe.copyAsyncIterable=void 0,fe.copyAsyncIterable=async function*(t){for await(const e of t)yield e},fe.copyIterable=function*(t){for(const e of t)yield e},le.dropAsync=void 0;const de=_,he=fe,ye=M;le.dropAsync=function(t,e){return(0,ye.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,ye.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,he.copyAsyncIterable)(t):(0,de.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{let t;for(;!(({value:t,done:i}=await r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var pe={dropRightAsync:void 0};const ve=_,me=fe,be=M;pe.dropRightAsync=function(t,e){return(0,be.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,be.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,me.copyAsyncIterable)(t):(0,ve.go)((async function*(){const n=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(t)).slice(0,-e);for(const t of n)yield t}))};var ge={dropRight:void 0};const we=_,Se=fe,Te=M;ge.dropRight=function(t,e){return(0,Te.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Te.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Se.copyIterable)(t):(0,we.go)((function*(){const n=Array.from(t);yield*n.slice(0,-e)}))};var Ae={dropUntilAsync:void 0};const Ee=H;Ae.dropUntilAsync=function(t,e){return(0,Ee.isAsyncIterable)(t)?async function*(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t):async function*(t){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t)};var xe={};xe.dropUntil=void 0,xe.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var Ie={drop:void 0};const _e=_,Oe=fe,Me=M;Ie.drop=function(t,e){return(0,Me.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Me.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Oe.copyIterable)(t):(0,_e.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{let t;for(;!(({value:t,done:i}=r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var je={filterAsync:void 0};const Be=H;je.filterAsync=function(t,e){return(0,Be.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t)};var ke={};ke.filter=void 0,ke.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Ne={},Pe={},Ce={flattenByAsync:void 0};const ze=H;function Re(t){return(0,ze.isIterable)(t)&&(0,ze.isntChar)(t)}Ce.flattenByAsync=function(t,e){return(0,ze.isAsyncIterable)(t)?async function*(t){const r=1;for await(const i of t)Re(i)&&await e(i,r)?yield*n(i,r+1):yield i}(t):function(t){return n(t,1)}(t);async function*n(t,r){for(const i of t)Re(i)&&await e(i,r)?yield*n(i,r+1):yield i}},Pe.flattenDeepAsync=void 0;const qe=Ce,De=M;Pe.flattenDeepAsync=function(t,e=1/0){return(0,De.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,De.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,qe.flattenByAsync)(t,((t,n)=>n<=e))},Ne.flattenAsync=void 0;const Ue=Pe;Ne.flattenAsync=function(t){return(0,Ue.flattenDeepAsync)(t,1)};var Je={flattenBy:void 0};const We=H;Je.flattenBy=function(t,e){return function*t(n,r){for(const o of n)i=o,(0,We.isIterable)(i)&&(0,We.isntChar)(i)&&e(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var Fe={flattenDeep:void 0};const Le=Je,Ke=M;Fe.flattenDeep=function(t,e=1/0){return(0,Ke.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Ke.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Le.flattenBy)(t,((t,n)=>n<=e))};var He={flatten:void 0};const Ve=Fe;He.flatten=function(t){return(0,Ve.flattenDeep)(t,1)};var Ye={mapAsync:void 0};const $e=H;Ye.mapAsync=function(t,e){return(0,$e.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)yield await e(r,n),n++}(t):async function*(t){let n=0;for(const r of t)yield await e(r,n),n++}(t)};var Ge={};Ge.map=void 0,Ge.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var Qe={repeatAsync:void 0};const Xe=_,Ze=M;Qe.repeatAsync=function(t,e){return(0,Ze.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ze.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,Xe.go)((async function*(){const n=[];if(e>0){for await(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var tn={repeat:void 0};const en=_,nn=M;tn.repeat=function(t,e){return(0,nn.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,nn.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,en.go)((function*(){const n=[];if(e>0){for(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var rn={sliceAsync:void 0};const on=_,sn=M;rn.sliceAsync=function(t,e,n=1/0){return(0,sn.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,sn.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,sn.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,sn.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,on.go)((async function*(){let r=0;for await(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var an={slice:void 0};const cn=_,un=M;an.slice=function(t,e,n=1/0){return(0,un.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,un.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,un.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,un.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,cn.go)((function*(){let r=0;for(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var ln={};ln.splitAsync=void 0,ln.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var fn={splitByAsync:void 0};const dn=H;fn.splitByAsync=function(t,e){return(0,dn.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t):async function*(t){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t)};var hn={};hn.splitBy=void 0,hn.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var yn={};yn.split=void 0,yn.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var pn={takeAsync:void 0};const vn=_,mn=M;pn.takeAsync=function(t,e){return(0,mn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,mn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,vn.go)((async function*(){if(0!==e)for await(const n of t)if(yield n,0===--e)break}))};var bn={takeRightAsync:void 0};const gn=_,wn=M;bn.takeRightAsync=function(t,e){return(0,wn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,wn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,gn.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=await r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var Sn={takeRight:void 0};const Tn=_,An=M;Sn.takeRight=function(t,e){return(0,An.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,An.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,Tn.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var En={takeUntilAsync:void 0};const xn=H;En.takeUntilAsync=function(t,e){return(0,xn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t):async function*(t){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t)};var In={};In.takeUntil=void 0,In.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var _n={take:void 0};const On=_,Mn=M;_n.take=function(t,e){return(0,Mn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Mn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,On.go)((function*(){if(0!==e)for(const n of t)if(yield n,0===--e)break}))};var jn={tapAsync:void 0};const Bn=H;jn.tapAsync=function(t,e){return(0,Bn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n),yield r,n++}(t)};var kn={};kn.tap=void 0,kn.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var Nn={};Nn.toAsyncIterable=void 0,Nn.toAsyncIterable=async function*(t){for(const e of t)yield e};var Pn={};Pn.transformAsync=void 0,Pn.transformAsync=async function*(t,e){yield*e(t)};var Cn={};Cn.transform=void 0,Cn.transform=function*(t,e){yield*e(t)};var zn={};zn.uniqAsync=void 0,zn.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var Rn={uniqByAsync:void 0};const qn=H;Rn.uniqByAsync=function(t,e){return(0,qn.isAsyncIterable)(t)?async function*(t){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t):async function*(t){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t)};var Dn={};Dn.uniqBy=void 0,Dn.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var Un={};Un.uniq=void 0,Un.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var Jn={zipAsync:void 0};const Wn=H;var Fn;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Fn||(Fn={})),Jn.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,Wn.isAsyncIterable)(t)?[Fn.Async,t[Symbol.asyncIterator]()]:[Fn.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=s[e];let i;if(i=n===Fn.Async?await r.next():r.next(),i.done)return void(a[e]=!0);t[e]=i.value}yield t}}finally{const t=s.filter(((t,e)=>!a[e]));for(const[o,s]of t)o===Fn.Async?await(null===(n=(e=s).return)||void 0===n?void 0:n.call(e)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...e)};var Ln={};Ln.zip=void 0,Ln.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(I,t),n(K,t),n(ee,t),n(ne,t),n(oe,t),n(ce,t),n(le,t),n(pe,t),n(ge,t),n(Ae,t),n(xe,t),n(Ie,t),n(je,t),n(ke,t),n(Ne,t),n(Ce,t),n(Je,t),n(Pe,t),n(Fe,t),n(He,t),n(Ye,t),n(Ge,t),n(Qe,t),n(tn,t),n(rn,t),n(an,t),n(ln,t),n(fn,t),n(hn,t),n(yn,t),n(pn,t),n(bn,t),n(Sn,t),n(En,t),n(In,t),n(_n,t),n(jn,t),n(kn,t),n(Nn,t),n(Pn,t),n(Cn,t),n(zn,t),n(Rn,t),n(Dn,t),n(Un,t),n(Jn,t),n(Ln,t)}(x);var Kn={},Hn={};Hn.consume=void 0,Hn.consume=function(t,e){return e(t)};var Vn={eachAsync:void 0};const Yn=H;Vn.eachAsync=function(t,e){return(0,Yn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t)await e(r,n),n++}(t):async function(t){let n=0;for(const r of t)await e(r,n),n++}(t)};var $n={};$n.each=void 0,$n.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Gn={everyAsync:void 0};const Qn=H;Gn.everyAsync=function(t,e){return(0,Qn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t):async function(t){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t)};var Xn={};Xn.every=void 0,Xn.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var Zn={findAsync:void 0};const tr=H;Zn.findAsync=function(t,e){return(0,tr.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t)};var er={};er.find=void 0,er.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var nr={};nr.firstAsync=void 0,nr.firstAsync=async function(t){for await(const e of t)return e};var rr={};rr.first=void 0,rr.first=function(t){for(const e of t)return e};var ir={};ir.includesAsync=void 0,ir.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var or={};or.includes=void 0,or.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var sr={};sr.matchAsync=void 0,sr.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var ar={};ar.match=void 0,ar.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var cr={reduceAsync:void 0};const ur=H;cr.reduceAsync=function(t,e,n){return(0,ur.isUndefined)(n)?function(t,e){return(0,ur.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,s=await o(r),a=1;for(;({value:t,done:i}=await r.next()),!i;)s=await e(s,t,a++);return s}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=await e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,ur.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var lr={reduce:void 0};const fr=H;lr.reduce=function(t,e,n){return(0,fr.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var dr={someAsync:void 0};const hr=H;dr.someAsync=function(t,e){return(0,hr.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t)};var yr={};yr.some=void 0,yr.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var pr={};pr.lastAsync=void 0,pr.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var vr={};vr.last=void 0,vr.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var mr={toArrayAsync:void 0};const br=Hn;mr.toArrayAsync=function(t){return(0,br.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var gr={toArray:void 0};const wr=Hn;gr.toArray=function(t){return(0,wr.consume)(t,(t=>Array.from(t)))};var Sr={toSetAsync:void 0};const Tr=Hn;Sr.toSetAsync=function(t){return(0,Tr.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var Ar={toSet:void 0};const Er=Hn;Ar.toSet=function(t){return(0,Er.consume)(t,(t=>new Set(t)))},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Hn,t),n(Vn,t),n($n,t),n(Gn,t),n(Xn,t),n(Zn,t),n(er,t),n(nr,t),n(rr,t),n(ir,t),n(or,t),n(sr,t),n(ar,t),n(cr,t),n(lr,t),n(dr,t),n(yr,t),n(pr,t),n(vr,t),n(mr,t),n(gr,t),n(Sr,t),n(Ar,t)}(Kn),function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(x,t),n(Kn,t)}(E);var xr={},Ir={};Ir.traverseErrorPrototypeChain=void 0,Ir.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},xr.getErrorNames=void 0;const _r=H,Or=Ir;xr.getErrorNames=function*(t){var e;if((0,_r.isError)(t))for(const n of(0,Or.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var Mr={isSerializableError:void 0};const jr=H;Mr.isSerializableError=function(t){return(0,jr.isObject)(t)&&(0,jr.isString)(t.name)&&(0,jr.isString)(t.message)&&((0,jr.isString)(t.stack)||(0,jr.isNull)(t.stack))&&(0,jr.isArray)(t.ancestors)&&t.ancestors.every(jr.isString)},A.CustomError=void 0;const Br=E,kr=xr,Nr=H,Pr=Mr;class Cr extends Error{get name(){var t,e;return null!==(e=null!==(t=(0,Br.first)((0,kr.getErrorNames)(this)))&&void 0!==t?t:Cr.name)&&void 0!==e?e:"CustomError"}static[Symbol.hasInstance](t){var e;if((0,Nr.isError)(t)||(0,Pr.isSerializableError)(t)){const n=[null!==(e=this.prototype.constructor.name)&&void 0!==e?e:this.name,...(0,kr.getErrorNames)(this.prototype)].reverse(),r=(0,Br.toArray)((0,kr.getErrorNames)(t)).reverse();return n.every(((t,e)=>t===r[e]))}return!1}}A.CustomError=Cr;var zr={AssertionError:void 0};const Rr=A;class qr extends Rr.CustomError{}zr.AssertionError=qr;var Dr={normalize:void 0};const Ur=xr,Jr=E;Dr.normalize=function(t){var e;const[n,...r]=(0,Jr.toArray)((0,Ur.getErrorNames)(t));return{name:n,ancestors:r,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var Wr={assert:void 0};const Fr=zr;var Lr,Kr;Wr.assert=function(t,e){if(!t)throw new Fr.AssertionError(e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(A,t),n(zr,t),n(Mr,t),n(Dr,t),n(Wr,t),n(xr,t),n(Ir,t)}(T);class Hr{constructor(t){Lr.set(this,void 0),Kr.set(this,new Map),T.assert(Number.isInteger(t),"The parameter limit must be an integer"),T.assert(t>0,"The parameter limit must be a positive value"),f(this,Lr,t,"f")}get[(Lr=new WeakMap,Kr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,Kr,"f").size}set(t,e){return l(this,Kr,"f").has(t)?this.updateItem(t,e):(l(this,Kr,"f").size===l(this,Lr,"f")&&l(this,Kr,"f").delete(this.getColdestKey()),l(this,Kr,"f").set(t,e)),this}has(t){return l(this,Kr,"f").has(t)}get(t){if(!this.has(t))return;const e=l(this,Kr,"f").get(t);return this.updateItem(t,e),e}delete(t){return l(this,Kr,"f").delete(t)}clear(){l(this,Kr,"f").clear()}updateItem(t,e){l(this,Kr,"f").delete(t),l(this,Kr,"f").set(t,e)}getColdestKey(){return E.first(l(this,Kr,"f").keys())}}var Vr={},Yr={},$r={},Gr={};Gr.random=void 0,Gr.random=function(t,e){return Math.random()*(e-t)+t};var Qr={};Qr.randomInt=void 0,Qr.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var Xr={};Xr.randomIntInclusive=void 0,Xr.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Gr,t),n(Qr,t),n(Xr,t)}($r),Yr.calculateExponentialBackoffTimeout=void 0;const Zr=$r;Yr.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,Zr.randomIntInclusive)(0,o):o};var ti={};ti.setTimeout=void 0,ti.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ei={setSchedule:void 0};const ni=ti;ei.setSchedule=function(t,e){const n=t-Date.now();return(0,ni.setTimeout)(n,e)};var ri={};ri.setInterval=void 0,ri.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var ii={setImmediate:void 0};const oi=ti;ii.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,oi.setTimeout)(0,t)};var si={setTimeoutLoop:void 0};const ai=ti;si.setTimeoutLoop=function(t,e){let n=!1,r=(0,ai.setTimeout)(t,(async function i(){await e(),n||(r=(0,ai.setTimeout)(t,i))}));return()=>{n=!0,r()}};var ci={setDynamicTimeoutLoop:void 0};const ui=ti;var li,fi,di,hi,yi,pi,vi;ci.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,ui.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,ui.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Yr,t),n(ti,t),n(ei,t),n(ri,t),n(ii,t),n(si,t),n(ci,t)}(Vr);class mi{constructor(){li.set(this,new Map),fi.set(this,void 0),this.itemMetadataSortedByExpirationTime=[]}get[(li=new WeakMap,fi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,li,"f").size}set(t,e,n){return l(this,li,"f").set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return l(this,li,"f").has(t)}get(t){return l(this,li,"f").get(t)}delete(t){const e=l(this,li,"f").delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;l(this,li,"f").clear(),null===(t=l(this,fi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>l(this,li,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,fi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Vr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,fi,(()=>{e(),f(this,fi,void 0,"f")}),"f")}}}}class bi{constructor(t){di.set(this,void 0),hi.set(this,new Map),yi.set(this,void 0),this.itemMetadataSortedByExpirationTime=[],T.assert(Number.isInteger(t),"The parameter limit must be an integer"),T.assert(t>0,"The parameter limit must be a positive value"),f(this,di,t,"f")}get[(di=new WeakMap,hi=new WeakMap,yi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,hi,"f").size}set(t,e,n){return l(this,hi,"f").has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(l(this,hi,"f").size===l(this,di,"f")&&l(this,hi,"f").delete(this.getColdestKey()),l(this,hi,"f").set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return l(this,hi,"f").has(t)}get(t){if(this.has(t)){const e=l(this,hi,"f").get(t);return this.updateItem(t,e),e}}delete(t){const e=l(this,hi,"f").delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;l(this,hi,"f").clear(),null===(t=l(this,yi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){l(this,hi,"f").delete(t),l(this,hi,"f").set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>l(this,hi,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,yi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Vr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,yi,(()=>{e(),f(this,yi,void 0,"f")}),"f")}}}getColdestKey(){return E.first(l(this,hi,"f").keys())}}class gi{constructor(t){this.value=t,this.children=new Map}}class wi{constructor(){pi.set(this,new gi)}get[(pi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(t,e){let n=l(this,pi,"f");for(const e of t)n.children.has(e)||n.children.set(e,new gi),n=n.children.get(e);return n.value=e,this}has(t){let e=l(this,pi,"f");for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=l(this,pi,"f");for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=l(this,pi,"f");for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of E.toArray(E.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class Si{constructor(t,e){this.schema=t,vi.set(this,void 0),f(this,vi,e,"f")}get state(){return l(this,vi,"f")}matches(t){return l(this,vi,"f")===t}send(t){if(!(t in this.schema[this.state]))throw new Ti(this.state,t);f(this,vi,this.schema[this.state][t],"f")}}vi=new WeakMap;class Ti extends T.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}function Ai(t){return"function"==typeof t}function Ei(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 xi=Ei((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 Ii(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var _i=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=a(o),l=s.next();!l.done;l=s.next()){l.value.remove(this)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(Ai(f))try{f()}catch(t){i=t instanceof xi?t.errors:[t]}var d=this._teardowns;if(d){this._teardowns=null;try{for(var h=a(d),y=h.next();!y.done;y=h.next()){var p=y.value;try{ji(p)}catch(t){i=null!=i?i:[],t instanceof xi?i=u(u([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{y&&!y.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new xi(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ji(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)&&Ii(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Ii(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Oi=_i.EMPTY;function Mi(t){return t instanceof _i||t&&"closed"in t&&Ai(t.remove)&&Ai(t.add)&&Ai(t.unsubscribe)}function ji(t){Ai(t)?t():t.unsubscribe()}var Bi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ki={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ki.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,u([],c(t)))},clearTimeout:function(t){var e=ki.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ni(t){ki.setTimeout((function(){throw t}))}function Pi(){}var Ci=null;function zi(t){if(Bi.useDeprecatedSynchronousErrorHandling){var e=!Ci;if(e&&(Ci={errorThrown:!1,error:null}),t(),e){var n=Ci,r=n.errorThrown,i=n.error;if(Ci=null,r)throw i}}else t()}var Ri=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Mi(e)&&e.add(n)):n.destination=Ji,n}return s(e,t),e.create=function(t,e,n){return new qi(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}(_i),qi=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(Ai(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&Bi.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?Di(i):Pi,error:Di(null!=n?n:Ui),complete:r?Di(r):Pi},o}return s(e,t),e}(Ri);function Di(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,u([],c(e)))}catch(t){Ni(t)}}}function Ui(t){throw t}var Ji={closed:!0,next:Pi,error:Ui,complete:Pi},Wi="function"==typeof Symbol&&Symbol.observable||"@@observable";function Fi(t){return t}function Li(t){return 0===t.length?Fi:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ki=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 Ri||function(t){return t&&Ai(t.next)&&Ai(t.error)&&Ai(t.complete)}(r)&&Mi(r)?t:new qi(t,e,n);return zi((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=Hi(e))((function(e,r){var i=new qi({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Wi]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Li(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Hi(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 Hi(t){var e;return null!==(e=null!=t?t:Bi.Promise)&&void 0!==e?e:Promise}var Vi=Ei((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Yi=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 s(e,t),e.prototype.lift=function(t){var e=new $i(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;zi((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=a(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;zi((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;zi((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?Oi:(i.push(t),new _i((function(){return Ii(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 Ki;return t.source=this,t},e.create=function(t,e){return new $i(t,e)},e}(Ki),$i=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return s(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:Oi},e}(Yi);class Gi extends Si{constructor(){super(...arguments),this.stateChanges=new Yi}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}),H.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}export{Ti as BadEventError,d as Box,p as Emitter,mi as ExpirableMap,Si as FiniteStateMachine,v as HashMap,m as HashSet,Hr as LRUMap,Gi as ObservableFiniteStateMachine,b as Queue,bi as TLRUMap,wi as TrieMap,y as convertArrayToCons,h as convertConsToArray};
|
|
15
|
+
var t,e,n,r,i,o=function(t,e){return(o=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 a(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(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 c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.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 a}function u(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function l(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function f(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}class d{constructor(e){t.set(this,void 0),f(this,t,e,"f")}set(e){f(this,t,e,"f")}get(){return l(this,t,"f")}}function h([t,e]){return null===e?[t]:[t,...h(e)]}function y([t,...e]){return[t,e.length?y(e):null]}t=new WeakMap;class p{constructor(){e.set(this,new Map)}get[(e=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(t,n){l(this,e,"f").has(t)||l(this,e,"f").set(t,new Set);l(this,e,"f").get(t).add(n)}off(t,n){if(!l(this,e,"f").has(t))return;const r=l(this,e,"f").get(t);r.delete(n),0===r.size&&l(this,e,"f").delete(t)}emit(t,n){if(!l(this,e,"f").has(t))return;l(this,e,"f").get(t).forEach((t=>t(n)))}}class v{constructor(t){this.hash=t,n.set(this,new Map)}get[(n=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,n,"f").size}set(t,e){return l(this,n,"f").set(this.hash(t),e),this}has(t){return l(this,n,"f").has(this.hash(t))}get(t){return l(this,n,"f").get(this.hash(t))}delete(t){return l(this,n,"f").delete(this.hash(t))}clear(){l(this,n,"f").clear()}}class m{constructor(t){this.hash=t,r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,r,"f").size}[Symbol.iterator](){return l(this,r,"f").values()}add(t){return l(this,r,"f").set(this.hash(t),t),this}delete(t){return l(this,r,"f").delete(this.hash(t))}has(t){return l(this,r,"f").has(this.hash(t))}clear(){l(this,r,"f").clear()}values(){return l(this,r,"f").values()}}class b{constructor(){i.set(this,[])}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,i,"f").length}empty(){l(this,i,"f").length=0}enqueue(...t){l(this,i,"f").push(...t)}dequeue(){return l(this,i,"f").shift()}remove(t){let e;for(;(e=l(this,i,"f").indexOf(t))>=0;)l(this,i,"f").splice(e,1)}}var g,w,S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},T={},A={},x={},E={},I={},_={},O={};O.go=void 0,O.go=function(t){return t()},g=_,w=S&&S.__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]}),(S&&S.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||w(e,t,n)})(O,g);var j={},M={CustomError:void 0};class B extends Error{get name(){return this.constructor.name}}M.CustomError=B;var k={ExpectedError:void 0};const P=M;class N extends P.CustomError{}k.ExpectedError=N;var C={AssertionError:void 0};const z=M;class R extends z.CustomError{}C.AssertionError=R;var q={};q.normalize=void 0,q.normalize=function(t){var e;return{name:t.name,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var D={refute:void 0};const U=k;D.refute=function(t,e){if(t)throw new U.ExpectedError(e)};var J={assert:void 0};const W=C;J.assert=function(t,e){if(!t)throw new W.AssertionError(e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(M,t),n(k,t),n(C,t),n(q,t),n(D,t),n(J,t)}(j),I.chunkAsync=void 0;const F=_,L=j;I.chunkAsync=function(t,e){return(0,L.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,L.assert)(e>0,"The parameter size must be greater than 0"),(0,F.go)((async function*(){let n=[];for await(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var K={},H={},V={};function Y(t){return Array.isArray(t)}V.isntEmptyArray=V.isEmptyArray=V.isntArray=V.isArray=void 0,V.isArray=Y,V.isntArray=function(t){return!Y(t)},V.isEmptyArray=function(t){return 0===t.length},V.isntEmptyArray=function(t){return 0!==t.length};var $={},G={};function Q(t){return null===t}G.isntNull=G.isNull=void 0,G.isNull=Q,G.isntNull=function(t){return!Q(t)};var X={};function Z(t){return void 0===t}X.isntUndefined=X.isUndefined=void 0,X.isUndefined=Z,X.isntUndefined=function(t){return!Z(t)},$.isntAsyncIterable=$.isAsyncIterable=void 0;const tt=G,et=X;function nt(t){return(0,tt.isntNull)(t)&&(0,et.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}$.isAsyncIterable=nt,$.isntAsyncIterable=function(t){return!nt(t)};var rt={};function it(t){return"bigint"==typeof t}rt.isntBigInt=rt.isBigInt=void 0,rt.isBigInt=it,rt.isntBigInt=function(t){return!it(t)};var ot={};function at(t){return"boolean"==typeof t}ot.isntBoolean=ot.isBoolean=void 0,ot.isBoolean=at,ot.isntBoolean=function(t){return!at(t)};var st={},ct={};function ut(t){return"string"==typeof t}ct.isntString=ct.isString=void 0,ct.isString=ut,ct.isntString=function(t){return!ut(t)},st.isntChar=st.isChar=void 0;const lt=ct;function ft(t){return(0,lt.isString)(t)&&1===t.length}st.isChar=ft,st.isntChar=function(t){return!ft(t)};var dt={};function ht(t){return t instanceof Date}dt.isntDate=dt.isDate=void 0,dt.isDate=ht,dt.isntDate=function(t){return!ht(t)};var yt={};yt.inEnum=void 0,yt.inEnum=function(t,e){return Object.values(e).includes(t)};var pt={};function vt(t){return t instanceof Error}pt.isntError=pt.isError=void 0,pt.isError=vt,pt.isntError=function(t){return!vt(t)};var mt={};function bt(t){return!t}mt.isntFalsy=mt.isFalsy=void 0,mt.isFalsy=bt,mt.isntFalsy=function(t){return!bt(t)};var gt={};function wt(t){return"function"==typeof t}gt.isntFunction=gt.isFunction=void 0,gt.isFunction=wt,gt.isntFunction=function(t){return!wt(t)};var St={};St.isntIterable=St.isIterable=void 0;const Tt=G,At=X;function xt(t){return(0,Tt.isntNull)(t)&&(0,At.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}St.isIterable=xt,St.isntIterable=function(t){return!xt(t)};var Et={},It={};var _t=Function.prototype,Ot=Object.prototype,jt=_t.toString,Mt=Ot.hasOwnProperty,Bt=jt.call(Object),kt=Ot.toString,Pt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var Nt=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=kt.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=Pt(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&jt.call(n)==Bt},Ct=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};It.isntEmptyObject=It.isEmptyObject=It.isntPlainObject=It.isPlainObject=It.isntObject=It.isObject=void 0;const zt=Ct(Nt);function Rt(t){return null!==t&&"object"==typeof t}function qt(t){return(0,zt.default)(t)}It.isObject=Rt,It.isntObject=function(t){return!Rt(t)},It.isPlainObject=qt,It.isntPlainObject=function(t){return!qt(t)},It.isEmptyObject=function(t){return 0===Object.keys(t).length},It.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Dt={};function Ut(t){return"number"==typeof t}Dt.isntNumber=Dt.isNumber=void 0,Dt.isNumber=Ut,Dt.isntNumber=function(t){return!Ut(t)},Et.isntJsonRpcError=Et.isJsonRpcError=Et.isntJsonRpcSuccess=Et.isJsonRpcSuccess=Et.isntJsonRpcRequest=Et.isJsonRpcRequest=Et.isntJsonRpcNotification=Et.isJsonRpcNotification=void 0;const Jt=V,Wt=It,Ft=ct,Lt=Dt,Kt=X;function Ht(t){return(0,Ft.isString)(t)||(0,Lt.isNumber)(t)}function Vt(t){return(0,Jt.isArray)(t)||(0,Wt.isObject)(t)}function Yt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.method)&&(0,Kt.isUndefined)(t.id)&&Vt(t.params)}function $t(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.method)&&Ht(t.id)&&Vt(t.params)}function Gt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&(0,Ft.isString)(t.id)&&"result"in t}function Qt(t){return(0,Wt.isPlainObject)(t)&&(0,Ft.isString)(t.jsonrpc)&&Ht(t.id)&&function(t){return(0,Wt.isPlainObject)(t)&&(0,Lt.isNumber)(t.code)&&(0,Ft.isString)(t.message)&&((0,Kt.isUndefined)(t.data)||(0,Wt.isObject)(t.data))}(t.error)}Et.isJsonRpcNotification=Yt,Et.isntJsonRpcNotification=function(t){return!Yt(t)},Et.isJsonRpcRequest=$t,Et.isntJsonRpcRequest=function(t){return!$t(t)},Et.isJsonRpcSuccess=Gt,Et.isntJsonRpcSuccess=function(t){return!Gt(t)},Et.isJsonRpcError=Qt,Et.isntJsonRpcError=function(t){return!Qt(t)};var Xt={};Xt.isntJson=Xt.isJson=void 0,Xt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Xt.isntJson=function t(e){return!t()};var Zt={};Zt.isAbsoluteURL=void 0,Zt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(V,t),n($,t),n(rt,t),n(ot,t),n(st,t),n(dt,t),n(yt,t),n(pt,t),n(mt,t),n(gt,t),n(St,t),n(Et,t),n(Xt,t),n(G,t),n(Dt,t),n(It,t),n(ct,t),n(X,t),n(Zt,t)}(H),K.chunkByAsync=void 0;const te=H;K.chunkByAsync=function(t,e){return(0,te.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t):async function*(t){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t)};var ee={};ee.chunkBy=void 0,ee.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var ne={chunk:void 0};const re=_,ie=j;ne.chunk=function(t,e){return(0,ie.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,ie.assert)(e>0,"The parameter size must be greater than 0"),(0,re.go)((function*(){let n=[];for(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var oe={concatAsync:void 0};const ae=H,se=_;oe.concatAsync=function(t,...e){return(0,se.go)((async function*(){for(const n of[t,...e])if((0,ae.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var ce={concat:void 0};const ue=_;ce.concat=function(t,...e){return(0,ue.go)((function*(){for(const n of[t,...e])yield*n}))};var le={},fe={};fe.copyIterable=fe.copyAsyncIterable=void 0,fe.copyAsyncIterable=async function*(t){for await(const e of t)yield e},fe.copyIterable=function*(t){for(const e of t)yield e},le.dropAsync=void 0;const de=_,he=fe,ye=j;le.dropAsync=function(t,e){return(0,ye.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,ye.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,he.copyAsyncIterable)(t):(0,de.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{let t;for(;!(({value:t,done:i}=await r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var pe={dropRightAsync:void 0};const ve=_,me=fe,be=j;pe.dropRightAsync=function(t,e){return(0,be.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,be.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,me.copyAsyncIterable)(t):(0,ve.go)((async function*(){const n=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(t)).slice(0,-e);for(const t of n)yield t}))};var ge={dropRight:void 0};const we=_,Se=fe,Te=j;ge.dropRight=function(t,e){return(0,Te.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Te.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Se.copyIterable)(t):(0,we.go)((function*(){const n=Array.from(t);yield*n.slice(0,-e)}))};var Ae={dropUntilAsync:void 0};const xe=H;Ae.dropUntilAsync=function(t,e){return(0,xe.isAsyncIterable)(t)?async function*(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t):async function*(t){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t)};var Ee={};Ee.dropUntil=void 0,Ee.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var Ie={drop:void 0};const _e=_,Oe=fe,je=j;Ie.drop=function(t,e){return(0,je.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,je.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Oe.copyIterable)(t):(0,_e.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{let t;for(;!(({value:t,done:i}=r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var Me={filterAsync:void 0};const Be=H;Me.filterAsync=function(t,e){return(0,Be.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t)};var ke={};ke.filter=void 0,ke.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Pe={},Ne={},Ce={flattenByAsync:void 0};const ze=H;function Re(t){return(0,ze.isIterable)(t)&&(0,ze.isntChar)(t)}Ce.flattenByAsync=function(t,e){return(0,ze.isAsyncIterable)(t)?async function*(t){const r=1;for await(const i of t)Re(i)&&await e(i,r)?yield*n(i,r+1):yield i}(t):function(t){return n(t,1)}(t);async function*n(t,r){for(const i of t)Re(i)&&await e(i,r)?yield*n(i,r+1):yield i}},Ne.flattenDeepAsync=void 0;const qe=Ce,De=j;Ne.flattenDeepAsync=function(t,e=1/0){return(0,De.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,De.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,qe.flattenByAsync)(t,((t,n)=>n<=e))},Pe.flattenAsync=void 0;const Ue=Ne;Pe.flattenAsync=function(t){return(0,Ue.flattenDeepAsync)(t,1)};var Je={flattenBy:void 0};const We=H;Je.flattenBy=function(t,e){return function*t(n,r){for(const o of n)i=o,(0,We.isIterable)(i)&&(0,We.isntChar)(i)&&e(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var Fe={flattenDeep:void 0};const Le=Je,Ke=j;Fe.flattenDeep=function(t,e=1/0){return(0,Ke.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Ke.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Le.flattenBy)(t,((t,n)=>n<=e))};var He={flatten:void 0};const Ve=Fe;He.flatten=function(t){return(0,Ve.flattenDeep)(t,1)};var Ye={mapAsync:void 0};const $e=H;Ye.mapAsync=function(t,e){return(0,$e.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)yield await e(r,n),n++}(t):async function*(t){let n=0;for(const r of t)yield await e(r,n),n++}(t)};var Ge={};Ge.map=void 0,Ge.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var Qe={repeatAsync:void 0};const Xe=_,Ze=j;Qe.repeatAsync=function(t,e){return(0,Ze.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ze.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,Xe.go)((async function*(){const n=[];if(e>0){for await(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var tn={repeat:void 0};const en=_,nn=j;tn.repeat=function(t,e){return(0,nn.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,nn.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,en.go)((function*(){const n=[];if(e>0){for(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var rn={sliceAsync:void 0};const on=_,an=j;rn.sliceAsync=function(t,e,n=1/0){return(0,an.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,an.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,an.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,an.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,on.go)((async function*(){let r=0;for await(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var sn={slice:void 0};const cn=_,un=j;sn.slice=function(t,e,n=1/0){return(0,un.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,un.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,un.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,un.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,cn.go)((function*(){let r=0;for(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var ln={};ln.splitAsync=void 0,ln.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var fn={splitByAsync:void 0};const dn=H;fn.splitByAsync=function(t,e){return(0,dn.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t):async function*(t){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t)};var hn={};hn.splitBy=void 0,hn.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var yn={};yn.split=void 0,yn.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var pn={takeAsync:void 0};const vn=_,mn=j;pn.takeAsync=function(t,e){return(0,mn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,mn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,vn.go)((async function*(){if(0!==e)for await(const n of t)if(yield n,0===--e)break}))};var bn={takeRightAsync:void 0};const gn=_,wn=j;bn.takeRightAsync=function(t,e){return(0,wn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,wn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,gn.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=await r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var Sn={takeRight:void 0};const Tn=_,An=j;Sn.takeRight=function(t,e){return(0,An.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,An.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,Tn.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var xn={takeUntilAsync:void 0};const En=H;xn.takeUntilAsync=function(t,e){return(0,En.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t):async function*(t){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t)};var In={};In.takeUntil=void 0,In.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var _n={take:void 0};const On=_,jn=j;_n.take=function(t,e){return(0,jn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,jn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,On.go)((function*(){if(0!==e)for(const n of t)if(yield n,0===--e)break}))};var Mn={tapAsync:void 0};const Bn=H;Mn.tapAsync=function(t,e){return(0,Bn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n),yield r,n++}(t)};var kn={};kn.tap=void 0,kn.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var Pn={};Pn.toAsyncIterable=void 0,Pn.toAsyncIterable=async function*(t){for(const e of t)yield e};var Nn={};Nn.transformAsync=void 0,Nn.transformAsync=async function*(t,e){yield*e(t)};var Cn={};Cn.transform=void 0,Cn.transform=function*(t,e){yield*e(t)};var zn={};zn.uniqAsync=void 0,zn.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var Rn={uniqByAsync:void 0};const qn=H;Rn.uniqByAsync=function(t,e){return(0,qn.isAsyncIterable)(t)?async function*(t){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t):async function*(t){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t)};var Dn={};Dn.uniqBy=void 0,Dn.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var Un={};Un.uniq=void 0,Un.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var Jn={zipAsync:void 0};const Wn=H;var Fn;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Fn||(Fn={})),Jn.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,a=t.map((t=>(0,Wn.isAsyncIterable)(t)?[Fn.Async,t[Symbol.asyncIterator]()]:[Fn.Sync,t[Symbol.iterator]()])),s=a.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=a[e];let i;if(i=n===Fn.Async?await r.next():r.next(),i.done)return void(s[e]=!0);t[e]=i.value}yield t}}finally{const t=a.filter(((t,e)=>!s[e]));for(const[o,a]of t)o===Fn.Async?await(null===(n=(e=a).return)||void 0===n?void 0:n.call(e)):null===(i=(r=a).return)||void 0===i||i.call(r)}}(t,...e)};var Ln={};Ln.zip=void 0,Ln.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(I,t),n(K,t),n(ee,t),n(ne,t),n(oe,t),n(ce,t),n(le,t),n(pe,t),n(ge,t),n(Ae,t),n(Ee,t),n(Ie,t),n(Me,t),n(ke,t),n(Pe,t),n(Ce,t),n(Je,t),n(Ne,t),n(Fe,t),n(He,t),n(Ye,t),n(Ge,t),n(Qe,t),n(tn,t),n(rn,t),n(sn,t),n(ln,t),n(fn,t),n(hn,t),n(yn,t),n(pn,t),n(bn,t),n(Sn,t),n(xn,t),n(In,t),n(_n,t),n(Mn,t),n(kn,t),n(Pn,t),n(Nn,t),n(Cn,t),n(zn,t),n(Rn,t),n(Dn,t),n(Un,t),n(Jn,t),n(Ln,t)}(E);var Kn={},Hn={};Hn.consume=void 0,Hn.consume=function(t,e){return e(t)};var Vn={eachAsync:void 0};const Yn=H;Vn.eachAsync=function(t,e){return(0,Yn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t)await e(r,n),n++}(t):async function(t){let n=0;for(const r of t)await e(r,n),n++}(t)};var $n={};$n.each=void 0,$n.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Gn={everyAsync:void 0};const Qn=H;Gn.everyAsync=function(t,e){return(0,Qn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t):async function(t){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t)};var Xn={};Xn.every=void 0,Xn.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var Zn={findAsync:void 0};const tr=H;Zn.findAsync=function(t,e){return(0,tr.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t)};var er={};er.find=void 0,er.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var nr={};nr.firstAsync=void 0,nr.firstAsync=async function(t){for await(const e of t)return e};var rr={};rr.first=void 0,rr.first=function(t){for(const e of t)return e};var ir={};ir.includesAsync=void 0,ir.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var or={};or.includes=void 0,or.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var ar={};ar.matchAsync=void 0,ar.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var sr={};sr.match=void 0,sr.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var cr={reduceAsync:void 0};const ur=H;cr.reduceAsync=function(t,e,n){return(0,ur.isUndefined)(n)?function(t,e){return(0,ur.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,a=await o(r),s=1;for(;({value:t,done:i}=await r.next()),!i;)a=await e(a,t,s++);return a}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,a=o(r),s=1;for(;({value:t,done:i}=r.next()),!i;)a=await e(a,t,s++);return a}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,ur.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var lr={reduce:void 0};const fr=H;lr.reduce=function(t,e,n){return(0,fr.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,a=o(r),s=1;for(;({value:t,done:i}=r.next()),!i;)a=e(a,t,s++);return a}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var dr={someAsync:void 0};const hr=H;dr.someAsync=function(t,e){return(0,hr.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t)};var yr={};yr.some=void 0,yr.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var pr={};pr.lastAsync=void 0,pr.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var vr={};vr.last=void 0,vr.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var mr={toArrayAsync:void 0};const br=Hn;mr.toArrayAsync=function(t){return(0,br.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var gr={toArray:void 0};const wr=Hn;gr.toArray=function(t){return(0,wr.consume)(t,(t=>Array.from(t)))};var Sr={toSetAsync:void 0};const Tr=Hn;Sr.toSetAsync=function(t){return(0,Tr.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var Ar={toSet:void 0};const xr=Hn;Ar.toSet=function(t){return(0,xr.consume)(t,(t=>new Set(t)))},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Hn,t),n(Vn,t),n($n,t),n(Gn,t),n(Xn,t),n(Zn,t),n(er,t),n(nr,t),n(rr,t),n(ir,t),n(or,t),n(ar,t),n(sr,t),n(cr,t),n(lr,t),n(dr,t),n(yr,t),n(pr,t),n(vr,t),n(mr,t),n(gr,t),n(Sr,t),n(Ar,t)}(Kn),function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(E,t),n(Kn,t)}(x);var Er={},Ir={};Ir.traverseErrorPrototypeChain=void 0,Ir.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},Er.getErrorNames=void 0;const _r=H,Or=Ir;Er.getErrorNames=function*(t){var e;if((0,_r.isError)(t))for(const n of(0,Or.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var jr={isSerializableError:void 0};const Mr=H;jr.isSerializableError=function(t){return(0,Mr.isObject)(t)&&(0,Mr.isString)(t.name)&&(0,Mr.isString)(t.message)&&((0,Mr.isString)(t.stack)||(0,Mr.isNull)(t.stack))&&(0,Mr.isArray)(t.ancestors)&&t.ancestors.every(Mr.isString)},A.CustomError=void 0;const Br=x,kr=Er,Pr=H,Nr=jr;class Cr extends Error{get name(){var t,e;return null!==(e=null!==(t=(0,Br.first)((0,kr.getErrorNames)(this)))&&void 0!==t?t:Cr.name)&&void 0!==e?e:"CustomError"}static[Symbol.hasInstance](t){var e;if((0,Pr.isError)(t)||(0,Nr.isSerializableError)(t)){const n=[null!==(e=this.prototype.constructor.name)&&void 0!==e?e:this.name,...(0,kr.getErrorNames)(this.prototype)].reverse(),r=(0,Br.toArray)((0,kr.getErrorNames)(t)).reverse();return n.every(((t,e)=>t===r[e]))}return!1}}A.CustomError=Cr;var zr={AssertionError:void 0};const Rr=A;class qr extends Rr.CustomError{}zr.AssertionError=qr;var Dr={normalize:void 0};const Ur=Er,Jr=x;Dr.normalize=function(t){var e;const[n,...r]=(0,Jr.toArray)((0,Ur.getErrorNames)(t));return{name:n,ancestors:r,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var Wr={},Fr={},Lr={};Lr.pass=void 0,Lr.pass=function(){},function(t){var e=S&&S.__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]});(S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(Lr,t)}(Fr),Wr.hydrate=void 0;const Kr=Fr;function Hr(t,e){const n=function(){(0,Kr.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}Wr.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=Hr(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var Vr={assert:void 0};const Yr=zr;var $r,Gr;Vr.assert=function(t,e){if(!t)throw new Yr.AssertionError(e)},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(A,t),n(zr,t),n(jr,t),n(Dr,t),n(Wr,t),n(Vr,t),n(Er,t),n(Ir,t)}(T);class Qr{constructor(t){$r.set(this,void 0),Gr.set(this,new Map),T.assert(Number.isInteger(t),"The parameter limit must be an integer"),T.assert(t>0,"The parameter limit must be a positive value"),f(this,$r,t,"f")}get[($r=new WeakMap,Gr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,Gr,"f").size}set(t,e){return l(this,Gr,"f").has(t)?this.updateItem(t,e):(l(this,Gr,"f").size===l(this,$r,"f")&&l(this,Gr,"f").delete(this.getColdestKey()),l(this,Gr,"f").set(t,e)),this}has(t){return l(this,Gr,"f").has(t)}get(t){if(!this.has(t))return;const e=l(this,Gr,"f").get(t);return this.updateItem(t,e),e}delete(t){return l(this,Gr,"f").delete(t)}clear(){l(this,Gr,"f").clear()}updateItem(t,e){l(this,Gr,"f").delete(t),l(this,Gr,"f").set(t,e)}getColdestKey(){return x.first(l(this,Gr,"f").keys())}}var Xr={},Zr={},ti={},ei={};ei.random=void 0,ei.random=function(t,e){return Math.random()*(e-t)+t};var ni={};ni.randomInt=void 0,ni.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var ri={};ri.randomIntInclusive=void 0,ri.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(ei,t),n(ni,t),n(ri,t)}(ti),Zr.calculateExponentialBackoffTimeout=void 0;const ii=ti;Zr.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,ii.randomIntInclusive)(0,o):o};var oi={};oi.setTimeout=void 0,oi.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ai={setSchedule:void 0};const si=oi;ai.setSchedule=function(t,e){const n=t-Date.now();return(0,si.setTimeout)(n,e)};var ci={};ci.setInterval=void 0,ci.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var ui={setImmediate:void 0};const li=oi;ui.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,li.setTimeout)(0,t)};var fi={setTimeoutLoop:void 0};const di=oi;fi.setTimeoutLoop=function(t,e){let n=!1,r=(0,di.setTimeout)(t,(async function i(){await e(),n||(r=(0,di.setTimeout)(t,i))}));return()=>{n=!0,r()}};var hi={setDynamicTimeoutLoop:void 0};const yi=oi;var pi,vi,mi,bi,gi,wi,Si;hi.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,yi.setTimeout)(t,(async function i(){const o=Date.now();await e();const a=Date.now()-o;n||(r=(0,yi.setTimeout)(Math.max(t-a,0),i))}));return()=>{n=!0,r()}},function(t){var e=S&&S.__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=S&&S.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Zr,t),n(oi,t),n(ai,t),n(ci,t),n(ui,t),n(fi,t),n(hi,t)}(Xr);class Ti{constructor(){pi.set(this,new Map),vi.set(this,void 0),this.itemMetadataSortedByExpirationTime=[]}get[(pi=new WeakMap,vi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,pi,"f").size}set(t,e,n){return l(this,pi,"f").set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return l(this,pi,"f").has(t)}get(t){return l(this,pi,"f").get(t)}delete(t){const e=l(this,pi,"f").delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;l(this,pi,"f").clear(),null===(t=l(this,vi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>l(this,pi,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,vi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Xr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,vi,(()=>{e(),f(this,vi,void 0,"f")}),"f")}}}}class Ai{constructor(t){mi.set(this,void 0),bi.set(this,new Map),gi.set(this,void 0),this.itemMetadataSortedByExpirationTime=[],T.assert(Number.isInteger(t),"The parameter limit must be an integer"),T.assert(t>0,"The parameter limit must be a positive value"),f(this,mi,t,"f")}get[(mi=new WeakMap,bi=new WeakMap,gi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,bi,"f").size}set(t,e,n){return l(this,bi,"f").has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(l(this,bi,"f").size===l(this,mi,"f")&&l(this,bi,"f").delete(this.getColdestKey()),l(this,bi,"f").set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return l(this,bi,"f").has(t)}get(t){if(this.has(t)){const e=l(this,bi,"f").get(t);return this.updateItem(t,e),e}}delete(t){const e=l(this,bi,"f").delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;l(this,bi,"f").clear(),null===(t=l(this,gi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){l(this,bi,"f").delete(t),l(this,bi,"f").set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>l(this,bi,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,gi,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Xr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,gi,(()=>{e(),f(this,gi,void 0,"f")}),"f")}}}getColdestKey(){return x.first(l(this,bi,"f").keys())}}class xi{constructor(t){this.value=t,this.children=new Map}}class Ei{constructor(){wi.set(this,new xi)}get[(wi=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(t,e){let n=l(this,wi,"f");for(const e of t)n.children.has(e)||n.children.set(e,new xi),n=n.children.get(e);return n.value=e,this}has(t){let e=l(this,wi,"f");for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=l(this,wi,"f");for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=l(this,wi,"f");for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of x.toArray(x.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class Ii{constructor(t,e){this.schema=t,Si.set(this,void 0),f(this,Si,e,"f")}get state(){return l(this,Si,"f")}matches(t){return l(this,Si,"f")===t}can(t){return t in this.schema[this.state]}send(t){if(!this.can(t))throw new _i(this.state,t);f(this,Si,this.schema[this.state][t],"f")}}Si=new WeakMap;class _i extends T.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}function Oi(t){return"function"==typeof t}function ji(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 Mi=ji((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 Bi(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var ki=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 a=s(o),l=a.next();!l.done;l=a.next()){l.value.remove(this)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(Oi(f))try{f()}catch(t){i=t instanceof Mi?t.errors:[t]}var d=this._teardowns;if(d){this._teardowns=null;try{for(var h=s(d),y=h.next();!y.done;y=h.next()){var p=y.value;try{Ci(p)}catch(t){i=null!=i?i:[],t instanceof Mi?i=u(u([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{y&&!y.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new Mi(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ci(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)&&Bi(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&Bi(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Pi=ki.EMPTY;function Ni(t){return t instanceof ki||t&&"closed"in t&&Oi(t.remove)&&Oi(t.add)&&Oi(t.unsubscribe)}function Ci(t){Oi(t)?t():t.unsubscribe()}var zi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ri={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ri.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,u([],c(t)))},clearTimeout:function(t){var e=Ri.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function qi(){}var Di=null;function Ui(t){if(zi.useDeprecatedSynchronousErrorHandling){var e=!Di;if(e&&(Di={errorThrown:!1,error:null}),t(),e){var n=Di,r=n.errorThrown,i=n.error;if(Di=null,r)throw i}}else t()}var Ji=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Ni(e)&&e.add(n)):n.destination=Vi,n}return a(e,t),e.create=function(t,e,n){return new Ki(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}(ki),Wi=Function.prototype.bind;function Fi(t,e){return Wi.call(t,e)}var Li=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Hi(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Hi(t)}else Hi(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Hi(t)}},t}(),Ki=function(t){function e(e,n,r){var i,o,a=t.call(this)||this;Oi(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&zi.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},i={next:e.next&&Fi(e.next,o),error:e.error&&Fi(e.error,o),complete:e.complete&&Fi(e.complete,o)}):i=e;return a.destination=new Li(i),a}return a(e,t),e}(Ji);function Hi(t){var e;e=t,Ri.setTimeout((function(){throw e}))}var Vi={closed:!0,next:qi,error:function(t){throw t},complete:qi},Yi="function"==typeof Symbol&&Symbol.observable||"@@observable";function $i(t){return t}function Gi(t){return 0===t.length?$i:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Qi=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 Ji||function(t){return t&&Oi(t.next)&&Oi(t.error)&&Oi(t.complete)}(r)&&Ni(r)?t:new Ki(t,e,n);return Ui((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=Xi(e))((function(e,r){var i=new Ki({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Yi]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Gi(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Xi(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 Xi(t){var e;return null!==(e=null!=t?t:zi.Promise)&&void 0!==e?e:Promise}var Zi=ji((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),to=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 a(e,t),e.prototype.lift=function(t){var e=new eo(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Zi},e.prototype.next=function(t){var e=this;Ui((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=s(i),a=o.next();!a.done;a=o.next()){a.value.next(t)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ui((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;Ui((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?Pi:(i.push(t),new ki((function(){return Bi(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 Qi;return t.source=this,t},e.create=function(t,e){return new eo(t,e)},e}(Qi),eo=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return a(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:Pi},e}(to);class no extends Ii{constructor(){super(...arguments),this.stateChanges=new to}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}),H.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}export{_i as BadEventError,d as Box,p as Emitter,Ti as ExpirableMap,Ii as FiniteStateMachine,v as HashMap,m as HashSet,Qr as LRUMap,no as ObservableFiniteStateMachine,b as Queue,Ai as TLRUMap,Ei as TrieMap,y as convertArrayToCons,h as convertConsToArray};
|
|
16
16
|
//# sourceMappingURL=index.min.mjs.map
|