@blackglory/structures 0.2.3 → 0.2.7

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +41 -11
  3. package/dist/es2015/index.min.mjs +2 -2
  4. package/dist/es2015/index.min.mjs.map +1 -1
  5. package/dist/es2015/index.mjs +673 -273
  6. package/dist/es2015/index.mjs.map +1 -1
  7. package/dist/es2015/index.umd.js +677 -274
  8. package/dist/es2015/index.umd.js.map +1 -1
  9. package/dist/es2015/index.umd.min.js +2 -3
  10. package/dist/es2015/index.umd.min.js.map +1 -1
  11. package/dist/es2018/index.min.mjs +2 -2
  12. package/dist/es2018/index.min.mjs.map +1 -1
  13. package/dist/es2018/index.mjs +673 -273
  14. package/dist/es2018/index.mjs.map +1 -1
  15. package/dist/es2018/index.umd.js +677 -274
  16. package/dist/es2018/index.umd.js.map +1 -1
  17. package/dist/es2018/index.umd.min.js +2 -3
  18. package/dist/es2018/index.umd.min.js.map +1 -1
  19. package/lib/es2015/box.d.ts +6 -0
  20. package/lib/es2015/box.js +30 -0
  21. package/lib/es2015/box.js.map +1 -0
  22. package/lib/es2015/expirable-map.d.ts +18 -0
  23. package/lib/es2015/expirable-map.js +109 -0
  24. package/lib/es2015/expirable-map.js.map +1 -0
  25. package/lib/es2015/index.d.ts +3 -0
  26. package/lib/es2015/index.js +3 -0
  27. package/lib/es2015/index.js.map +1 -1
  28. package/lib/es2015/lru-map.js +4 -3
  29. package/lib/es2015/lru-map.js.map +1 -1
  30. package/lib/es2015/tlru-map.d.ts +21 -0
  31. package/lib/es2015/tlru-map.js +138 -0
  32. package/lib/es2015/tlru-map.js.map +1 -0
  33. package/lib/es2015/trie-map.js +1 -1
  34. package/lib/es2015/trie-map.js.map +1 -1
  35. package/lib/es2018/box.d.ts +6 -0
  36. package/lib/es2018/box.js +30 -0
  37. package/lib/es2018/box.js.map +1 -0
  38. package/lib/es2018/expirable-map.d.ts +18 -0
  39. package/lib/es2018/expirable-map.js +109 -0
  40. package/lib/es2018/expirable-map.js.map +1 -0
  41. package/lib/es2018/index.d.ts +3 -0
  42. package/lib/es2018/index.js +3 -0
  43. package/lib/es2018/index.js.map +1 -1
  44. package/lib/es2018/lru-map.js +4 -3
  45. package/lib/es2018/lru-map.js.map +1 -1
  46. package/lib/es2018/tlru-map.d.ts +21 -0
  47. package/lib/es2018/tlru-map.js +138 -0
  48. package/lib/es2018/tlru-map.js.map +1 -0
  49. package/lib/es2018/trie-map.js +1 -1
  50. package/lib/es2018/trie-map.js.map +1 -1
  51. package/package.json +25 -23
@@ -1,4 +1,3 @@
1
- function t([n,e]){return null===e?[n]:[n,...t(e)]}function n([t,...e]){return[t,e.length?n(e):null]}
2
1
  /*! *****************************************************************************
3
2
  Copyright (c) Microsoft Corporation.
4
3
 
@@ -12,5 +11,6 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
13
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function e(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)}var r,i,o,s;class a{constructor(){r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(t,n){e(this,r,"f").has(t)||e(this,r,"f").set(t,new Set);e(this,r,"f").get(t).add(n)}off(t,n){if(!e(this,r,"f").has(t))return;const i=e(this,r,"f").get(t);i.delete(n),0===i.size&&e(this,r,"f").delete(t)}emit(t,n){if(!e(this,r,"f").has(t))return;e(this,r,"f").get(t).forEach((t=>t(n)))}}class c{constructor(t){this.hash=t,i.set(this,new Map)}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return e(this,i,"f").size}set(t,n){return e(this,i,"f").set(this.hash(t),n),this}has(t){return e(this,i,"f").has(this.hash(t))}get(t){return e(this,i,"f").get(this.hash(t))}delete(t){return e(this,i,"f").delete(this.hash(t))}clear(){e(this,i,"f").clear()}}class u{constructor(t){this.hash=t,o.set(this,new Map)}get[(o=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return e(this,o,"f").size}[Symbol.iterator](){return e(this,o,"f").values()}add(t){return e(this,o,"f").set(this.hash(t),t),this}delete(t){return e(this,o,"f").delete(this.hash(t))}has(t){return e(this,o,"f").has(this.hash(t))}clear(){e(this,o,"f").clear()}values(){return e(this,o,"f").values()}}class f{constructor(){s.set(this,[])}get[(s=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return e(this,s,"f").length}empty(){e(this,s,"f").length=0}enqueue(...t){e(this,s,"f").push(...t)}dequeue(){return e(this,s,"f").shift()}remove(t){let n;for(;(n=e(this,s,"f").indexOf(t))>=0;)e(this,s,"f").splice(n,1)}}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d={},y={CustomError:void 0};class v extends Error{get name(){return this.constructor.name}}y.CustomError=v;var h={ExpectedError:void 0};const p=y;class m extends p.CustomError{}h.ExpectedError=m;var b={AssertionError:void 0};const g=y;class w extends g.CustomError{}b.AssertionError=w;var A={};A.normalize=void 0,A.normalize=function(t){var n;return{name:t.name,message:t.message,stack:null!==(n=t.stack)&&void 0!==n?n:null}};var S={refute:void 0};const I=h;S.refute=function(t,n){if(t)throw new I.ExpectedError(n)};var O={assert:void 0};const T=b;var j,E,R,k,N;O.assert=function(t,n){if(!t)throw new T.AssertionError(n)},j=d,E=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),(R=l&&l.__exportStar||function(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||E(n,t,e)})(y,j),R(h,j),R(b,j),R(A,j),R(S,j),R(O,j);class x{constructor(t){k.set(this,void 0),N.set(this,new Map),d.assert(Number.isInteger(t),"The parameter limit must be an integer"),d.assert(t>0,"The parameter limit must be a positive value"),function(t,n,e,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 n?t!==n||!i:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(t,e):i?i.value=e:n.set(t,e)}(this,k,t,"f")}get[(k=new WeakMap,N=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return e(this,N,"f").size}set(t,n){return e(this,N,"f").has(t)?this.updateItem(t,n):(e(this,N,"f").size===e(this,k,"f")&&e(this,N,"f").delete(this.getColdestKey()),e(this,N,"f").set(t,n)),this}has(t){return e(this,N,"f").has(t)}get(t){if(!this.has(t))return;const n=e(this,N,"f").get(t);return this.updateItem(t,n),n}delete(t){return e(this,N,"f").delete(t)}clear(){e(this,N,"f").clear()}updateItem(t,n){e(this,N,"f").delete(t),e(this,N,"f").set(t,n)}getColdestKey(){return e(this,N,"f").keys().next().value}}var B={},q={},_={},P={},z={};z.go=void 0,z.go=function(t){return t()},function(t){var n=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]});(l&&l.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)})(z,t)}(P),_.chunkAsync=void 0;const C=P,U=d;_.chunkAsync=function(t,n){return U.assert(Number.isInteger(n),"The parameter size must be an integer"),U.assert(n>0,"The parameter size must be greater than 0"),C.go((async function*(){let e=[];for await(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var J={},D={},M={};function W(t){return Array.isArray(t)}M.isntEmptyArray=M.isEmptyArray=M.isntArray=M.isArray=void 0,M.isArray=W,M.isntArray=function(t){return!W(t)},M.isEmptyArray=function(t){return 0===t.length},M.isntEmptyArray=function(t){return 0!==t.length};var F={},L={};function K(t){return null===t}L.isntNull=L.isNull=void 0,L.isNull=K,L.isntNull=function(t){return!K(t)};var V={};function G(t){return void 0===t}V.isntUndefined=V.isUndefined=void 0,V.isUndefined=G,V.isntUndefined=function(t){return!G(t)},F.isntAsyncIterable=F.isAsyncIterable=void 0;const H=L,Q=V;function X(t){return H.isntNull(t)&&Q.isntUndefined(t)&&"function"==typeof t[Symbol.asyncIterator]}F.isAsyncIterable=X,F.isntAsyncIterable=function(t){return!X(t)};var Y={};function Z(t){return"bigint"==typeof t}Y.isntBigInt=Y.isBigInt=void 0,Y.isBigInt=Z,Y.isntBigInt=function(t){return!Z(t)};var $={};function tt(t){return"boolean"==typeof t}$.isntBoolean=$.isBoolean=void 0,$.isBoolean=tt,$.isntBoolean=function(t){return!tt(t)};var nt={},et={};function rt(t){return it(t)||ot(t)}function it(t){return"string"==typeof t}function ot(t){return"object"==typeof t&&t instanceof String}et.isntStringObject=et.isStringObject=et.isntStringPrimitive=et.isStringPrimitive=et.isntString=et.isString=void 0,et.isString=rt,et.isntString=function(t){return!rt(t)},et.isStringPrimitive=it,et.isntStringPrimitive=function(t){return!it(t)},et.isStringObject=ot,et.isntStringObject=function(t){return!ot(t)},nt.isntCharObject=nt.isCharObject=nt.isntCharPrimitive=nt.isCharPrimitive=nt.isntChar=nt.isChar=void 0;const st=et;function at(t){return(st.isString(t)||st.isStringObject(t))&&1===t.length}function ct(t){return st.isString(t)&&1===t.length}function ut(t){return st.isStringObject(t)&&1===t.length}nt.isChar=at,nt.isntChar=function(t){return!at(t)},nt.isCharPrimitive=ct,nt.isntCharPrimitive=function(t){return!ct(t)},nt.isCharObject=ut,nt.isntCharObject=function(t){return!ut(t)};var ft={};function lt(t){return t instanceof Date}ft.isntDate=ft.isDate=void 0,ft.isDate=lt,ft.isntDate=function(t){return!lt(t)};var dt={};dt.inEnum=void 0,dt.inEnum=function(t,n){return Object.values(n).includes(t)};var yt={};function vt(t){return!t}yt.isntFalsy=yt.isFalsy=void 0,yt.isFalsy=vt,yt.isntFalsy=function(t){return!vt(t)};var ht={};function pt(t){return"function"==typeof t}ht.isntFunction=ht.isFunction=void 0,ht.isFunction=pt,ht.isntFunction=function(t){return!pt(t)};var mt={};mt.isntIterable=mt.isIterable=void 0;const bt=L,gt=V;function wt(t){return bt.isntNull(t)&&gt.isntUndefined(t)&&"function"==typeof t[Symbol.iterator]}mt.isIterable=wt,mt.isntIterable=function(t){return!wt(t)};var At={},St={};function It(t){return null!==t&&"object"==typeof t}St.isntEmptyObject=St.isEmptyObject=St.isRecord=St.isntObject=St.isObject=void 0,St.isObject=It,St.isntObject=function(t){return!It(t)},St.isRecord=function(t){return It(t)},St.isEmptyObject=function(t){return 0===Object.keys(t).length},St.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Ot={};function Tt(t){return"number"==typeof t}Ot.isntNumber=Ot.isNumber=void 0,Ot.isNumber=Tt,Ot.isntNumber=function(t){return!Tt(t)},At.isntJsonRpcError=At.isJsonRpcError=At.isntJsonRpcSuccess=At.isJsonRpcSuccess=At.isntJsonRpcRequest=At.isJsonRpcRequest=At.isntJsonRpcNotification=At.isJsonRpcNotification=void 0;const jt=M,Et=St,Rt=et,kt=Ot,Nt=V;function xt(t){return Rt.isString(t)||kt.isNumber(t)}function Bt(t){return jt.isArray(t)||Et.isObject(t)}function qt(t){return Et.isRecord(t)&&Rt.isString(t.jsonrpc)&&Rt.isString(t.method)&&Nt.isUndefined(t.id)&&Bt(t.params)}function _t(t){return Et.isRecord(t)&&Rt.isString(t.jsonrpc)&&Rt.isString(t.method)&&xt(t.id)&&Bt(t.params)}function Pt(t){return Et.isRecord(t)&&Rt.isString(t.jsonrpc)&&Rt.isString(t.id)&&Nt.isntUndefined(t.result)}function zt(t){return Et.isRecord(t)&&Rt.isString(t.jsonrpc)&&xt(t.id)&&function(t){return Et.isRecord(t)&&kt.isNumber(t.code)&&Rt.isString(t.message)&&(Nt.isUndefined(t.data)||Et.isObject(t.data))}(t.error)}At.isJsonRpcNotification=qt,At.isntJsonRpcNotification=function(t){return!qt(t)},At.isJsonRpcRequest=_t,At.isntJsonRpcRequest=function(t){return!_t(t)},At.isJsonRpcSuccess=Pt,At.isntJsonRpcSuccess=function(t){return!Pt(t)},At.isJsonRpcError=zt,At.isntJsonRpcError=function(t){return!zt(t)};var Ct={};Ct.isntJson=Ct.isJson=void 0,Ct.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Ct.isntJson=function t(n){return!t()};var Ut={};Ut.isAbsoluteURL=void 0,Ut.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var n=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),e=l&&l.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e(M,t),e(F,t),e(Y,t),e($,t),e(nt,t),e(ft,t),e(dt,t),e(yt,t),e(ht,t),e(mt,t),e(At,t),e(Ct,t),e(L,t),e(Ot,t),e(St,t),e(et,t),e(V,t),e(Ut,t)}(D),J.chunkByAsync=void 0;const Jt=D;J.chunkByAsync=function(t,n){return Jt.isAsyncIterable(t)?async function*(t){let e=[],r=0;for await(const i of t)e.push(i),await n(i,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t):async function*(t){let e=[],r=0;for(const i of t)e.push(i),await n(i,r)&&(yield e,e=[]),r++;e.length&&(yield e)}(t)};var Dt={};Dt.chunkBy=void 0,Dt.chunkBy=function*(t,n){let e=[],r=0;for(const i of t)e.push(i),n(i,r)&&(yield e,e=[]),r++;e.length&&(yield e)};var Mt={chunk:void 0};const Wt=P,Ft=d;Mt.chunk=function(t,n){return Ft.assert(Number.isInteger(n),"The parameter size must be an integer"),Ft.assert(n>0,"The parameter size must be greater than 0"),Wt.go((function*(){let e=[];for(const r of t)e.push(r),e.length>=n&&(yield e,e=[]);e.length&&(yield e)}))};var Lt={concatAsync:void 0};const Kt=D,Vt=P;Lt.concatAsync=function(t,...n){return Vt.go((async function*(){for(const e of[t,...n])if(Kt.isAsyncIterable(e))for await(const t of e)yield t;else for(const t of e)yield t}))};var Gt={concat:void 0};const Ht=P;Gt.concat=function(t,...n){return Ht.go((function*(){for(const e of[t,...n])yield*e}))};var Qt={},Xt={};Xt.copyIterable=Xt.copyAsyncIterable=void 0,Xt.copyAsyncIterable=async function*(t){for await(const n of t)yield n},Xt.copyIterable=function*(t){for(const n of t)yield n},Qt.dropAsync=void 0;const Yt=P,Zt=Xt,$t=d;Qt.dropAsync=function(t,n){return $t.assert(Number.isInteger(n),"The parameter count must be an integer"),$t.assert(n>=0,"The parameter count must be greater than or equal to 0"),0===n?Zt.copyAsyncIterable(t):Yt.go((async function*(){var e;const r=t[Symbol.asyncIterator]();let i;try{let t;for(;!(({value:t,done:i}=await r.next()),i||n<=0);)n--;for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var tn={dropRightAsync:void 0};const nn=P,en=Xt,rn=d;tn.dropRightAsync=function(t,n){return rn.assert(Number.isInteger(n),"The parameter count must be an integer"),rn.assert(n>=0,"The parameter count must be greater than or equal to 0"),0===n?en.copyAsyncIterable(t):nn.go((async function*(){const e=(await async function(t){const n=[];for await(const e of t)n.push(e);return n}(t)).slice(0,-n);for(const t of e)yield t}))};var on={dropRight:void 0};const sn=P,an=Xt,cn=d;on.dropRight=function(t,n){return cn.assert(Number.isInteger(n),"The parameter count must be an integer"),cn.assert(n>=0,"The parameter count must be greater than or equal to 0"),0===n?an.copyIterable(t):sn.go((function*(){const e=Array.from(t);yield*e.slice(0,-n)}))};var un={dropUntilAsync:void 0};const fn=D;un.dropUntilAsync=function(t,n){return fn.isAsyncIterable(t)?async function*(t){var e;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await n(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}(t):async function*(t){var e;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await n(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(e=r.return)||void 0===e||e.call(r)}}(t)};var ln={};ln.dropUntil=void 0,ln.dropUntil=function*(t,n){var e;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||n(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(e=r.return)||void 0===e||e.call(r)}};var dn={drop:void 0};const yn=P,vn=Xt,hn=d;dn.drop=function(t,n){return hn.assert(Number.isInteger(n),"The parameter count must be an integer"),hn.assert(n>=0,"The parameter count must be greater than or equal to 0"),0===n?vn.copyIterable(t):yn.go((function*(){var e;const r=t[Symbol.iterator]();let i;try{let t;for(;!(({value:t,done:i}=r.next()),i||n<=0);)n--;for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(e=r.return)||void 0===e||e.call(r)}}))};var pn={filterAsync:void 0};const mn=D;pn.filterAsync=function(t,n){return mn.isAsyncIterable(t)?async function*(t){let e=0;for await(const r of t)await n(r,e)&&(yield r),e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e)&&(yield r),e++}(t)};var bn={};bn.filter=void 0,bn.filter=function*(t,n){let e=0;for(const r of t)n(r,e)&&(yield r),e++};var gn={},wn={},An={flattenByAsync:void 0};const Sn=D;function In(t){return Sn.isIterable(t)&&Sn.isntChar(t)}An.flattenByAsync=function(t,n){return Sn.isAsyncIterable(t)?async function*(t){const r=1;for await(const i of t)In(i)&&await n(i,r)?yield*e(i,r+1):yield i}(t):function(t){return e(t,1)}(t);async function*e(t,r){for(const i of t)In(i)&&await n(i,r)?yield*e(i,r+1):yield i}},wn.flattenDeepAsync=void 0;const On=An,Tn=d;wn.flattenDeepAsync=function(t,n=1/0){return Tn.assert(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),Tn.assert(n>=0,"The parameter depth must be greater than or equal to 0"),On.flattenByAsync(t,((t,e)=>e<=n))},gn.flattenAsync=void 0;const jn=wn;gn.flattenAsync=function(t){return jn.flattenDeepAsync(t,1)};var En={flattenBy:void 0};const Rn=D;En.flattenBy=function(t,n){return function*t(e,r){for(const o of e)i=o,Rn.isIterable(i)&&Rn.isntChar(i)&&n(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var kn={flattenDeep:void 0};const Nn=En,xn=d;kn.flattenDeep=function(t,n=1/0){return xn.assert(n===1/0||Number.isInteger(n),"The parameter depth must be an integer"),xn.assert(n>=0,"The parameter depth must be greater than or equal to 0"),Nn.flattenBy(t,((t,e)=>e<=n))};var Bn={flatten:void 0};const qn=kn;Bn.flatten=function(t){return qn.flattenDeep(t,1)};var _n={mapAsync:void 0};const Pn=D;_n.mapAsync=function(t,n){return Pn.isAsyncIterable(t)?async function*(t){let e=0;for await(const r of t)yield await n(r,e),e++}(t):async function*(t){let e=0;for(const r of t)yield await n(r,e),e++}(t)};var zn={};zn.map=void 0,zn.map=function*(t,n){let e=0;for(const r of t)yield n(r,e),e++};var Cn={repeatAsync:void 0};const Un=P,Jn=d;Cn.repeatAsync=function(t,n){return Jn.assert(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),Jn.assert(n>=0,"The parameter times must be greater than or equal to 0"),n===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")}(),Un.go((async function*(){const e=[];if(n>0){for await(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Dn={repeat:void 0};const Mn=P,Wn=d;Dn.repeat=function(t,n){return Wn.assert(n===1/0||Number.isInteger(n),"The parameter times must be an integer"),Wn.assert(n>=0,"The parameter times must be greater than or equal to 0"),n===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")}(),Mn.go((function*(){const e=[];if(n>0){for(const n of t)yield n,e.push(n);n--}for(;n>0;)yield*e,n--}))};var Fn={sliceAsync:void 0};const Ln=P,Kn=d;Fn.sliceAsync=function(t,n,e=1/0){return Kn.assert(Number.isInteger(n),"The parameter start must be an integer"),Kn.assert(n>=0,"The parameter start must be greater than or equal to 0"),Kn.assert(Number.isInteger(e),"The parameter end must be an integer"),Kn.assert(e>=n,"The parameter end must be greater than or equal to start"),Ln.go((async function*(){let r=0;for await(const i of t){if(r>=e)break;r>=n&&(yield i),r++}}))};var Vn={slice:void 0};const Gn=P,Hn=d;Vn.slice=function(t,n,e=1/0){return Hn.assert(Number.isInteger(n),"The parameter start must be an integer"),Hn.assert(n>=0,"The parameter start must be greater than or equal to 0"),Hn.assert(Number.isInteger(e),"The parameter end must be an integer"),Hn.assert(e>=n,"The parameter end must be greater than or equal to start"),Gn.go((function*(){let r=0;for(const i of t){if(r>=e)break;r>=n&&(yield i),r++}}))};var Qn={};Qn.splitAsync=void 0,Qn.splitAsync=async function*(t,n){let e=[];for await(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var Xn={splitByAsync:void 0};const Yn=D;Xn.splitByAsync=function(t,n){return Yn.isAsyncIterable(t)?async function*(t){let e=[],r=0;for await(const i of t)await n(i,r)?(yield e,e=[]):e.push(i),r++;yield e}(t):async function*(t){let e=[],r=0;for(const i of t)await n(i,r)?(yield e,e=[]):e.push(i),r++;yield e}(t)};var Zn={};Zn.splitBy=void 0,Zn.splitBy=function*(t,n){let e=[],r=0;for(const i of t)n(i,r)?(yield e,e=[]):e.push(i),r++;yield e};var $n={};$n.split=void 0,$n.split=function*(t,n){let e=[];for(const r of t)r===n?(yield e,e=[]):e.push(r);yield e};var te={takeAsync:void 0};const ne=P,ee=d;te.takeAsync=function(t,n){return ee.assert(Number.isInteger(n),"The parameter count must be an integer"),ee.assert(n>=0,"The parameter count must be greater than or equal to 0"),ne.go((async function*(){if(0!==n)for await(const e of t)if(yield e,0===--n)break}))};var re={takeRightAsync:void 0};const ie=P,oe=d;re.takeRightAsync=function(t,n){return oe.assert(Number.isInteger(n),"The parameter count must be an integer"),oe.assert(n>=0,"The parameter count must be greater than or equal to 0"),ie.go((async function*(){var e;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>n&&t.shift();yield*t}finally{i||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}}))};var se={takeRight:void 0};const ae=P,ce=d;se.takeRight=function(t,n){return ce.assert(Number.isInteger(n),"The parameter count must be an integer"),ce.assert(n>=0,"The parameter count must be greater than or equal to 0"),ae.go((function*(){var e;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>n&&t.shift();yield*t}finally{i||null===(e=r.return)||void 0===e||e.call(r)}}))};var ue={takeUntilAsync:void 0};const fe=D;ue.takeUntilAsync=function(t,n){return fe.isAsyncIterable(t)?async function*(t){let e=0;for await(const r of t){if(await n(r,e))break;yield r,e++}}(t):async function*(t){let e=0;for(const r of t){if(await n(r,e))break;yield r,e++}}(t)};var le={};le.takeUntil=void 0,le.takeUntil=function*(t,n){let e=0;for(const r of t){if(n(r,e))break;yield r,e++}};var de={take:void 0};const ye=P,ve=d;de.take=function(t,n){return ve.assert(Number.isInteger(n),"The parameter count must be an integer"),ve.assert(n>=0,"The parameter count must be greater than or equal to 0"),ye.go((function*(){if(0!==n)for(const e of t)if(yield e,0===--n)break}))};var he={tapAsync:void 0};const pe=D;he.tapAsync=function(t,n){return pe.isAsyncIterable(t)?async function*(t){let e=0;for await(const r of t)await n(r,e),yield r,e++}(t):async function*(t){let e=0;for(const r of t)await n(r,e),yield r,e++}(t)};var me={};me.tap=void 0,me.tap=function*(t,n){let e=0;for(const r of t)n(r,e),yield r,e++};var be={};be.toAsyncIterable=void 0,be.toAsyncIterable=async function*(t){for(const n of t)yield n};var ge={};ge.transformAsync=void 0,ge.transformAsync=async function*(t,n){yield*n(t)};var we={};we.transform=void 0,we.transform=function*(t,n){yield*n(t)};var Ae={};Ae.uniqAsync=void 0,Ae.uniqAsync=async function*(t){const n=new Set;for await(const e of t)n.has(e)||(yield e,n.add(e))};var Se={uniqByAsync:void 0};const Ie=D;Se.uniqByAsync=function(t,n){return Ie.isAsyncIterable(t)?async function*(t){const e=new Set;let r=0;for await(const i of t){const t=await n(i,r);e.has(t)||(yield i,e.add(t)),r++}}(t):async function*(t){const e=new Set;let r=0;for(const i of t){const t=await n(i,r);e.has(t)||(yield i,e.add(t)),r++}}(t)};var Oe={};Oe.uniqBy=void 0,Oe.uniqBy=function*(t,n){const e=new Set;let r=0;for(const i of t){const t=n(i,r);e.has(t)||(yield i,e.add(t)),r++}};var Te={};Te.uniq=void 0,Te.uniq=function*(t){const n=new Set;for(const e of t)n.has(e)||(yield e,n.add(e))};var je={zipAsync:void 0};const Ee=D;var Re;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Re||(Re={})),je.zipAsync=function(t,...n){return async function*(...t){var n,e,r,i;const o=t.length,s=t.map((t=>Ee.isAsyncIterable(t)?[Re.Async,t[Symbol.asyncIterator]()]:[Re.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let n=0;n<o;n++){const[e,r]=s[n];let i;if(i=e===Re.Async?await r.next():r.next(),i.done)return void(a[n]=!0);t[n]=i.value}yield t}}finally{const t=s.filter(((t,n)=>!a[n]));for(const[o,s]of t)o===Re.Async?await(null===(e=(n=s).return)||void 0===e?void 0:e.call(n)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...n)};var ke={};ke.zip=void 0,ke.zip=function(t,...n){return function*(...t){const n=t.length,e=t.map((t=>t[Symbol.iterator]())),r=e.map((()=>!1));try{for(;;){const t=new Array(n);for(let i=0;i<n;i++){const{value:n,done:o}=e[i].next();if(o)return void(r[i]=!0);t[i]=n}yield t}}finally{e.filter(((t,n)=>!r[n])).forEach((t=>{var n;return null===(n=t.return)||void 0===n?void 0:n.call(t)}))}}(t,...n)},function(t){var n=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),e=l&&l.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e(_,t),e(J,t),e(Dt,t),e(Mt,t),e(Lt,t),e(Gt,t),e(Qt,t),e(tn,t),e(on,t),e(un,t),e(ln,t),e(dn,t),e(pn,t),e(bn,t),e(gn,t),e(An,t),e(En,t),e(wn,t),e(kn,t),e(Bn,t),e(_n,t),e(zn,t),e(Cn,t),e(Dn,t),e(Fn,t),e(Vn,t),e(Qn,t),e(Xn,t),e(Zn,t),e($n,t),e(te,t),e(re,t),e(se,t),e(ue,t),e(le,t),e(de,t),e(he,t),e(me,t),e(be,t),e(ge,t),e(we,t),e(Ae,t),e(Se,t),e(Oe,t),e(Te,t),e(je,t),e(ke,t)}(q);var Ne={},xe={};xe.consume=void 0,xe.consume=function(t,n){return n(t)};var Be={eachAsync:void 0};const qe=D;Be.eachAsync=function(t,n){return qe.isAsyncIterable(t)?async function(t){let e=0;for await(const r of t)await n(r,e),e++}(t):async function(t){let e=0;for(const r of t)await n(r,e),e++}(t)};var _e={};_e.each=void 0,_e.each=function(t,n){let e=0;for(const r of t)n(r,e),e++};var Pe={everyAsync:void 0};const ze=D;Pe.everyAsync=function(t,n){return ze.isAsyncIterable(t)?async function(t){let e=0;for await(const r of t){if(!await n(r,e))return!1;e++}return!0}(t):async function(t){let e=0;for(const r of t){if(!await n(r,e))return!1;e++}return!0}(t)};var Ce={};Ce.every=void 0,Ce.every=function(t,n){let e=0;for(const r of t){if(!n(r,e))return!1;e++}return!0};var Ue={findAsync:void 0};const Je=D;Ue.findAsync=function(t,n){return Je.isAsyncIterable(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return r;e++}return}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return r;e++}return}(t)};var De={};De.find=void 0,De.find=function(t,n){let e=0;for(const r of t){if(n(r,e))return r;e++}};var Me={};Me.firstAsync=void 0,Me.firstAsync=async function(t){for await(const n of t)return n};var We={};We.first=void 0,We.first=function(t){for(const n of t)return n};var Fe={};Fe.includesAsync=void 0,Fe.includesAsync=async function(t,n){for await(const e of t)if(e===n)return!0;return!1};var Le={};Le.includes=void 0,Le.includes=function(t,n){for(const e of t)if(e===n)return!0;return!1};var Ke={};Ke.matchAsync=void 0,Ke.matchAsync=async function(t,n){const e=n.length;let r=0;for await(const i of t)if(i===n[r]&&r++,r===e)return!0;return!1};var Ve={};Ve.match=void 0,Ve.match=function(t,n){const e=n.length;let r=0;for(const i of t)if(i===n[r]&&r++,r===e)return!0;return!1};var Ge={reduceAsync:void 0};const He=D;Ge.reduceAsync=function(t,n,e){return He.isUndefined(e)?function(t,n){return He.isAsyncIterable(t)?e(t):r(t);async function e(t){var e;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 n(s,t,a++);return s}finally{i||await(null===(e=r.return)||void 0===e?void 0:e.call(r))}async function o(t){const n=await t.next();if(n.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}async function r(t){var e;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 n(s,t,a++);return s}finally{i||null===(e=r.return)||void 0===e||e.call(r)}function o(t){const n=t.next();if(n.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}}(t,n):function(t,n,e){return He.isAsyncIterable(t)?i(t):r(t);async function r(t){let r=e,i=0;for(const e of t)r=await n(r,e,i++);return r}async function i(t){let r=e,i=0;for await(const e of t)r=await n(r,e,i++);return r}}(t,n,e)};var Qe={reduce:void 0};const Xe=D;Qe.reduce=function(t,n,e){return Xe.isUndefined(e)?function(t,n){var e;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=n(s,t,a++);return s}finally{i||null===(e=r.return)||void 0===e||e.call(r)}function o(t){const n=t.next();if(n.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return n.value}}(t,n):function(t,n,e){let r=e,i=0;for(const e of t)r=n(r,e,i++);return r}(t,n,e)};var Ye={someAsync:void 0};const Ze=D;Ye.someAsync=function(t,n){return Ze.isAsyncIterable(t)?async function(t){let e=0;for await(const r of t){if(await n(r,e))return!0;e++}return!1}(t):async function(t){let e=0;for(const r of t){if(await n(r,e))return!0;e++}return!1}(t)};var $e={};$e.some=void 0,$e.some=function(t,n){let e=0;for(const r of t){if(n(r,e))return!0;e++}return!1};var tr={};tr.lastAsync=void 0,tr.lastAsync=async function(t){var n;const e=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await e.next()),!r;)i=t;return i}finally{r||await(null===(n=e.return)||void 0===n?void 0:n.call(e))}};var nr={};nr.last=void 0,nr.last=function(t){var n;const e=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=e.next()),!r;)i=t;return i}finally{r||null===(n=e.return)||void 0===n||n.call(e)}};var er={toArrayAsync:void 0};const rr=xe;er.toArrayAsync=function(t){return rr.consume(t,(async t=>{const n=[];for await(const e of t)n.push(e);return n}))};var ir={toArray:void 0};const or=xe;ir.toArray=function(t){return or.consume(t,(t=>Array.from(t)))};var sr={toSetAsync:void 0};const ar=xe;sr.toSetAsync=function(t){return ar.consume(t,(async t=>{const n=new Set;for await(const e of t)n.add(e);return n}))};var cr={toSet:void 0};const ur=xe;var fr;cr.toSet=function(t){return ur.consume(t,(t=>new Set(t)))},function(t){var n=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),e=l&&l.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e(xe,t),e(Be,t),e(_e,t),e(Pe,t),e(Ce,t),e(Ue,t),e(De,t),e(Me,t),e(We,t),e(Fe,t),e(Le,t),e(Ke,t),e(Ve,t),e(Ge,t),e(Qe,t),e(Ye,t),e($e,t),e(tr,t),e(nr,t),e(er,t),e(ir,t),e(sr,t),e(cr,t)}(Ne),function(t){var n=l&&l.__createBinding||(Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]}),e=l&&l.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e(q,t),e(Ne,t)}(B);class lr{constructor(t){this.value=t,this.children=new Map}}class dr{constructor(){fr.set(this,new lr)}get[(fr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(t,n){let r=e(this,fr,"f");for(const n of t)r.children.has(n)||r.children.set(n,new lr),r=r.children.get(n);return r.value=n,this}has(t){let n=e(this,fr,"f");for(const e of t){if(!n.children.has(e))return!1;n=n.children.get(e)}return void 0!==n.value}get(t){let n=e(this,fr,"f");for(const e of t){if(!n.children.has(e))return;n=n.children.get(e)}return n.value}delete(t){const n=[];let r=e(this,fr,"f");for(const e of t){if(!r.children.has(e))return!1;n.push(r),r=r.children.get(e)}if(delete r.value,0===r.children.size)for(const[e,r]of B.toArray(B.zip(t,n)).reverse())if(r.children.delete(e),0!==r.children.size)break;return!0}}export{a as Emitter,c as HashMap,u as HashSet,x as LRUMap,f as Queue,dr as TrieMap,n as convertArrayToCons,t as convertConsToArray};
14
+ ***************************************************************************** */
15
+ function t(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 e(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}var n,r,i,o,a;class s{constructor(t){n.set(this,void 0),e(this,n,t,"f")}set(t){e(this,n,t,"f")}get(){return t(this,n,"f")}}function c([t,e]){return null===e?[t]:[t,...c(e)]}function u([t,...e]){return[t,e.length?u(e):null]}n=new WeakMap;class f{constructor(){r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(e,n){t(this,r,"f").has(e)||t(this,r,"f").set(e,new Set);t(this,r,"f").get(e).add(n)}off(e,n){if(!t(this,r,"f").has(e))return;const i=t(this,r,"f").get(e);i.delete(n),0===i.size&&t(this,r,"f").delete(e)}emit(e,n){if(!t(this,r,"f").has(e))return;t(this,r,"f").get(e).forEach((t=>t(n)))}}class l{constructor(t){this.hash=t,i.set(this,new Map)}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,i,"f").size}set(e,n){return t(this,i,"f").set(this.hash(e),n),this}has(e){return t(this,i,"f").has(this.hash(e))}get(e){return t(this,i,"f").get(this.hash(e))}delete(e){return t(this,i,"f").delete(this.hash(e))}clear(){t(this,i,"f").clear()}}class d{constructor(t){this.hash=t,o.set(this,new Map)}get[(o=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,o,"f").size}[Symbol.iterator](){return t(this,o,"f").values()}add(e){return t(this,o,"f").set(this.hash(e),e),this}delete(e){return t(this,o,"f").delete(this.hash(e))}has(e){return t(this,o,"f").has(this.hash(e))}clear(){t(this,o,"f").clear()}values(){return t(this,o,"f").values()}}class y{constructor(){a.set(this,[])}get[(a=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,a,"f").length}empty(){t(this,a,"f").length=0}enqueue(...e){t(this,a,"f").push(...e)}dequeue(){return t(this,a,"f").shift()}remove(e){let n;for(;(n=t(this,a,"f").indexOf(e))>=0;)t(this,a,"f").splice(n,1)}}var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m={},v={CustomError:void 0};class p extends Error{get name(){return this.constructor.name}}v.CustomError=p;var g={ExpectedError:void 0};const b=v;class w extends b.CustomError{}g.ExpectedError=w;var T={AssertionError:void 0};const A=v;class S extends A.CustomError{}T.AssertionError=S;var I={};I.normalize=void 0,I.normalize=function(t){var e;return{name:t.name,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var x={refute:void 0};const E=g;x.refute=function(t,e){if(t)throw new E.ExpectedError(e)};var M={assert:void 0};const B=T;var k,O,j;M.assert=function(t,e){if(!t)throw new B.AssertionError(e)},k=m,O=h&&h.__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]}),(j=h&&h.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||O(e,t,n)})(v,k),j(g,k),j(T,k),j(I,k),j(x,k),j(M,k);var N={},R={},_={},q={},C={};C.go=void 0,C.go=function(t){return t()},function(t){var e=h&&h.__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]});(h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(C,t)}(q),_.chunkAsync=void 0;const z=q,D=m;_.chunkAsync=function(t,e){return(0,D.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,D.assert)(e>0,"The parameter size must be greater than 0"),(0,z.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 U={},J={},P={};function W(t){return Array.isArray(t)}P.isntEmptyArray=P.isEmptyArray=P.isntArray=P.isArray=void 0,P.isArray=W,P.isntArray=function(t){return!W(t)},P.isEmptyArray=function(t){return 0===t.length},P.isntEmptyArray=function(t){return 0!==t.length};var F={},L={};function K(t){return null===t}L.isntNull=L.isNull=void 0,L.isNull=K,L.isntNull=function(t){return!K(t)};var V={};function G(t){return void 0===t}V.isntUndefined=V.isUndefined=void 0,V.isUndefined=G,V.isntUndefined=function(t){return!G(t)},F.isntAsyncIterable=F.isAsyncIterable=void 0;const H=L,Q=V;function X(t){return(0,H.isntNull)(t)&&(0,Q.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}F.isAsyncIterable=X,F.isntAsyncIterable=function(t){return!X(t)};var Y={};function Z(t){return"bigint"==typeof t}Y.isntBigInt=Y.isBigInt=void 0,Y.isBigInt=Z,Y.isntBigInt=function(t){return!Z(t)};var $={};function tt(t){return"boolean"==typeof t}$.isntBoolean=$.isBoolean=void 0,$.isBoolean=tt,$.isntBoolean=function(t){return!tt(t)};var et={},nt={};function rt(t){return"string"==typeof t}nt.isntString=nt.isString=void 0,nt.isString=rt,nt.isntString=function(t){return!rt(t)},et.isntChar=et.isChar=void 0;const it=nt;function ot(t){return(0,it.isString)(t)&&1===t.length}et.isChar=ot,et.isntChar=function(t){return!ot(t)};var at={};function st(t){return t instanceof Date}at.isntDate=at.isDate=void 0,at.isDate=st,at.isntDate=function(t){return!st(t)};var ct={};ct.inEnum=void 0,ct.inEnum=function(t,e){return Object.values(e).includes(t)};var ut={};function ft(t){return t instanceof Error}ut.isntError=ut.isError=void 0,ut.isError=ft,ut.isntError=function(t){return!ft(t)};var lt={};function dt(t){return!t}lt.isntFalsy=lt.isFalsy=void 0,lt.isFalsy=dt,lt.isntFalsy=function(t){return!dt(t)};var yt={};function ht(t){return"function"==typeof t}yt.isntFunction=yt.isFunction=void 0,yt.isFunction=ht,yt.isntFunction=function(t){return!ht(t)};var mt={};mt.isntIterable=mt.isIterable=void 0;const vt=L,pt=V;function gt(t){return(0,vt.isntNull)(t)&&(0,pt.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}mt.isIterable=gt,mt.isntIterable=function(t){return!gt(t)};var bt={},wt={};function Tt(t){return null!==t&&"object"==typeof t}wt.isntEmptyObject=wt.isEmptyObject=wt.isRecord=wt.isntObject=wt.isObject=void 0,wt.isObject=Tt,wt.isntObject=function(t){return!Tt(t)},wt.isRecord=function(t){return Tt(t)},wt.isEmptyObject=function(t){return 0===Object.keys(t).length},wt.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var At={};function St(t){return"number"==typeof t}At.isntNumber=At.isNumber=void 0,At.isNumber=St,At.isntNumber=function(t){return!St(t)},bt.isntJsonRpcError=bt.isJsonRpcError=bt.isntJsonRpcSuccess=bt.isJsonRpcSuccess=bt.isntJsonRpcRequest=bt.isJsonRpcRequest=bt.isntJsonRpcNotification=bt.isJsonRpcNotification=void 0;const It=P,xt=wt,Et=nt,Mt=At,Bt=V;function kt(t){return(0,Et.isString)(t)||(0,Mt.isNumber)(t)}function Ot(t){return(0,It.isArray)(t)||(0,xt.isObject)(t)}function jt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.method)&&(0,Bt.isUndefined)(t.id)&&Ot(t.params)}function Nt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.method)&&kt(t.id)&&Ot(t.params)}function Rt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.id)&&(0,Bt.isntUndefined)(t.result)}function _t(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&kt(t.id)&&function(t){return(0,xt.isRecord)(t)&&(0,Mt.isNumber)(t.code)&&(0,Et.isString)(t.message)&&((0,Bt.isUndefined)(t.data)||(0,xt.isObject)(t.data))}(t.error)}bt.isJsonRpcNotification=jt,bt.isntJsonRpcNotification=function(t){return!jt(t)},bt.isJsonRpcRequest=Nt,bt.isntJsonRpcRequest=function(t){return!Nt(t)},bt.isJsonRpcSuccess=Rt,bt.isntJsonRpcSuccess=function(t){return!Rt(t)},bt.isJsonRpcError=_t,bt.isntJsonRpcError=function(t){return!_t(t)};var qt={};qt.isntJson=qt.isJson=void 0,qt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},qt.isntJson=function t(e){return!t()};var Ct={};Ct.isAbsoluteURL=void 0,Ct.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(P,t),n(F,t),n(Y,t),n($,t),n(et,t),n(at,t),n(ct,t),n(ut,t),n(lt,t),n(yt,t),n(mt,t),n(bt,t),n(qt,t),n(L,t),n(At,t),n(wt,t),n(nt,t),n(V,t),n(Ct,t)}(J),U.chunkByAsync=void 0;const zt=J;U.chunkByAsync=function(t,e){return(0,zt.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 Dt={};Dt.chunkBy=void 0,Dt.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 Ut={chunk:void 0};const Jt=q,Pt=m;Ut.chunk=function(t,e){return(0,Pt.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,Pt.assert)(e>0,"The parameter size must be greater than 0"),(0,Jt.go)((function*(){let n=[];for(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var Wt={concatAsync:void 0};const Ft=J,Lt=q;Wt.concatAsync=function(t,...e){return(0,Lt.go)((async function*(){for(const n of[t,...e])if((0,Ft.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Kt={concat:void 0};const Vt=q;Kt.concat=function(t,...e){return(0,Vt.go)((function*(){for(const n of[t,...e])yield*n}))};var Gt={},Ht={};Ht.copyIterable=Ht.copyAsyncIterable=void 0,Ht.copyAsyncIterable=async function*(t){for await(const e of t)yield e},Ht.copyIterable=function*(t){for(const e of t)yield e},Gt.dropAsync=void 0;const Qt=q,Xt=Ht,Yt=m;Gt.dropAsync=function(t,e){return(0,Yt.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Yt.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Xt.copyAsyncIterable)(t):(0,Qt.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 Zt={dropRightAsync:void 0};const $t=q,te=Ht,ee=m;Zt.dropRightAsync=function(t,e){return(0,ee.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,ee.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,te.copyAsyncIterable)(t):(0,$t.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 ne={dropRight:void 0};const re=q,ie=Ht,oe=m;ne.dropRight=function(t,e){return(0,oe.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,oe.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,ie.copyIterable)(t):(0,re.go)((function*(){const n=Array.from(t);yield*n.slice(0,-e)}))};var ae={dropUntilAsync:void 0};const se=J;ae.dropUntilAsync=function(t,e){return(0,se.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 ce={};ce.dropUntil=void 0,ce.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 ue={drop:void 0};const fe=q,le=Ht,de=m;ue.drop=function(t,e){return(0,de.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,de.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,le.copyIterable)(t):(0,fe.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 ye={filterAsync:void 0};const he=J;ye.filterAsync=function(t,e){return(0,he.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 me={};me.filter=void 0,me.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var ve={},pe={},ge={flattenByAsync:void 0};const be=J;function we(t){return(0,be.isIterable)(t)&&(0,be.isntChar)(t)}ge.flattenByAsync=function(t,e){return(0,be.isAsyncIterable)(t)?async function*(t){const r=1;for await(const i of t)we(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)we(i)&&await e(i,r)?yield*n(i,r+1):yield i}},pe.flattenDeepAsync=void 0;const Te=ge,Ae=m;pe.flattenDeepAsync=function(t,e=1/0){return(0,Ae.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Ae.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Te.flattenByAsync)(t,((t,n)=>n<=e))},ve.flattenAsync=void 0;const Se=pe;ve.flattenAsync=function(t){return(0,Se.flattenDeepAsync)(t,1)};var Ie={flattenBy:void 0};const xe=J;Ie.flattenBy=function(t,e){return function*t(n,r){for(const o of n)(0,xe.isIterable)(i=o)&&(0,xe.isntChar)(i)&&e(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var Ee={flattenDeep:void 0};const Me=Ie,Be=m;Ee.flattenDeep=function(t,e=1/0){return(0,Be.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Be.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Me.flattenBy)(t,((t,n)=>n<=e))};var ke={flatten:void 0};const Oe=Ee;ke.flatten=function(t){return(0,Oe.flattenDeep)(t,1)};var je={mapAsync:void 0};const Ne=J;je.mapAsync=function(t,e){return(0,Ne.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 Re={};Re.map=void 0,Re.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var _e={repeatAsync:void 0};const qe=q,Ce=m;_e.repeatAsync=function(t,e){return(0,Ce.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ce.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,qe.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 ze={repeat:void 0};const De=q,Ue=m;ze.repeat=function(t,e){return(0,Ue.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ue.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,De.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 Je={sliceAsync:void 0};const Pe=q,We=m;Je.sliceAsync=function(t,e,n=1/0){return(0,We.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,We.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,We.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,We.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,Pe.go)((async function*(){let r=0;for await(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Fe={slice:void 0};const Le=q,Ke=m;Fe.slice=function(t,e,n=1/0){return(0,Ke.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,Ke.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,Ke.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,Ke.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,Le.go)((function*(){let r=0;for(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Ve={};Ve.splitAsync=void 0,Ve.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Ge={splitByAsync:void 0};const He=J;Ge.splitByAsync=function(t,e){return(0,He.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 Qe={};Qe.splitBy=void 0,Qe.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 Xe={};Xe.split=void 0,Xe.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Ye={takeAsync:void 0};const Ze=q,$e=m;Ye.takeAsync=function(t,e){return(0,$e.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,$e.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,Ze.go)((async function*(){if(0!==e)for await(const n of t)if(yield n,0===--e)break}))};var tn={takeRightAsync:void 0};const en=q,nn=m;tn.takeRightAsync=function(t,e){return(0,nn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,nn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,en.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 rn={takeRight:void 0};const on=q,an=m;rn.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,on.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 sn={takeUntilAsync:void 0};const cn=J;sn.takeUntilAsync=function(t,e){return(0,cn.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 un={};un.takeUntil=void 0,un.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var fn={take:void 0};const ln=q,dn=m;fn.take=function(t,e){return(0,dn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,dn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,ln.go)((function*(){if(0!==e)for(const n of t)if(yield n,0===--e)break}))};var yn={tapAsync:void 0};const hn=J;yn.tapAsync=function(t,e){return(0,hn.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 mn={};mn.tap=void 0,mn.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var vn={};vn.toAsyncIterable=void 0,vn.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 gn={};gn.transform=void 0,gn.transform=function*(t,e){yield*e(t)};var bn={};bn.uniqAsync=void 0,bn.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var wn={uniqByAsync:void 0};const Tn=J;wn.uniqByAsync=function(t,e){return(0,Tn.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 An={};An.uniqBy=void 0,An.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 Sn={};Sn.uniq=void 0,Sn.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var In={zipAsync:void 0};const xn=J;var En;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(En||(En={})),In.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,a=t.map((t=>(0,xn.isAsyncIterable)(t)?[En.Async,t[Symbol.asyncIterator]()]:[En.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===En.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===En.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 Mn={};Mn.zip=void 0,Mn.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=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(_,t),n(U,t),n(Dt,t),n(Ut,t),n(Wt,t),n(Kt,t),n(Gt,t),n(Zt,t),n(ne,t),n(ae,t),n(ce,t),n(ue,t),n(ye,t),n(me,t),n(ve,t),n(ge,t),n(Ie,t),n(pe,t),n(Ee,t),n(ke,t),n(je,t),n(Re,t),n(_e,t),n(ze,t),n(Je,t),n(Fe,t),n(Ve,t),n(Ge,t),n(Qe,t),n(Xe,t),n(Ye,t),n(tn,t),n(rn,t),n(sn,t),n(un,t),n(fn,t),n(yn,t),n(mn,t),n(vn,t),n(pn,t),n(gn,t),n(bn,t),n(wn,t),n(An,t),n(Sn,t),n(In,t),n(Mn,t)}(R);var Bn={},kn={};kn.consume=void 0,kn.consume=function(t,e){return e(t)};var On={eachAsync:void 0};const jn=J;On.eachAsync=function(t,e){return(0,jn.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 Nn={};Nn.each=void 0,Nn.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Rn={everyAsync:void 0};const _n=J;Rn.everyAsync=function(t,e){return(0,_n.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 qn={};qn.every=void 0,qn.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var Cn={findAsync:void 0};const zn=J;Cn.findAsync=function(t,e){return(0,zn.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 Dn={};Dn.find=void 0,Dn.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var Un={};Un.firstAsync=void 0,Un.firstAsync=async function(t){for await(const e of t)return e};var Jn={};Jn.first=void 0,Jn.first=function(t){for(const e of t)return e};var Pn={};Pn.includesAsync=void 0,Pn.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var Wn={};Wn.includes=void 0,Wn.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var Fn={};Fn.matchAsync=void 0,Fn.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 Ln={};Ln.match=void 0,Ln.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 Kn={reduceAsync:void 0};const Vn=J;Kn.reduceAsync=function(t,e,n){return(0,Vn.isUndefined)(n)?function(t,e){return(0,Vn.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,Vn.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 Gn={reduce:void 0};const Hn=J;Gn.reduce=function(t,e,n){return(0,Hn.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 Qn={someAsync:void 0};const Xn=J;Qn.someAsync=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))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 Yn={};Yn.some=void 0,Yn.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var Zn={};Zn.lastAsync=void 0,Zn.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 $n={};$n.last=void 0,$n.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 tr={toArrayAsync:void 0};const er=kn;tr.toArrayAsync=function(t){return(0,er.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var nr={toArray:void 0};const rr=kn;nr.toArray=function(t){return(0,rr.consume)(t,(t=>Array.from(t)))};var ir={toSetAsync:void 0};const or=kn;ir.toSetAsync=function(t){return(0,or.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 sr=kn;var cr,ur;ar.toSet=function(t){return(0,sr.consume)(t,(t=>new Set(t)))},function(t){var e=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(kn,t),n(On,t),n(Nn,t),n(Rn,t),n(qn,t),n(Cn,t),n(Dn,t),n(Un,t),n(Jn,t),n(Pn,t),n(Wn,t),n(Fn,t),n(Ln,t),n(Kn,t),n(Gn,t),n(Qn,t),n(Yn,t),n(Zn,t),n($n,t),n(tr,t),n(nr,t),n(ir,t),n(ar,t)}(Bn),function(t){var e=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(R,t),n(Bn,t)}(N);class fr{constructor(t){cr.set(this,void 0),ur.set(this,new Map),m.assert(Number.isInteger(t),"The parameter limit must be an integer"),m.assert(t>0,"The parameter limit must be a positive value"),e(this,cr,t,"f")}get[(cr=new WeakMap,ur=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,ur,"f").size}set(e,n){return t(this,ur,"f").has(e)?this.updateItem(e,n):(t(this,ur,"f").size===t(this,cr,"f")&&t(this,ur,"f").delete(this.getColdestKey()),t(this,ur,"f").set(e,n)),this}has(e){return t(this,ur,"f").has(e)}get(e){if(!this.has(e))return;const n=t(this,ur,"f").get(e);return this.updateItem(e,n),n}delete(e){return t(this,ur,"f").delete(e)}clear(){t(this,ur,"f").clear()}updateItem(e,n){t(this,ur,"f").delete(e),t(this,ur,"f").set(e,n)}getColdestKey(){return N.first(t(this,ur,"f").keys())}}var lr={},dr={},yr={},hr={};hr.random=void 0,hr.random=function(t,e){return Math.random()*(e-t)+t};var mr={};mr.randomInt=void 0,mr.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var vr={};vr.randomIntInclusive=void 0,vr.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=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(hr,t),n(mr,t),n(vr,t)}(yr),dr.calculateExponentialBackoffTimeout=void 0;const pr=yr;dr.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,pr.randomIntInclusive)(0,o):o};var gr={};gr.setTimeout=void 0,gr.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var br={setSchedule:void 0};const wr=gr;br.setSchedule=function(t,e){const n=t-Date.now();return(0,wr.setTimeout)(n,e)};var Tr={};Tr.setInterval=void 0,Tr.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var Ar={setImmediate:void 0};const Sr=gr;Ar.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,Sr.setTimeout)(0,t)};var Ir={setTimeoutLoop:void 0};const xr=gr;Ir.setTimeoutLoop=function(t,e){let n=!1,r=(0,xr.setTimeout)(t,(async function i(){await e(),n||(r=(0,xr.setTimeout)(t,i))}));return()=>{n=!0,r()}};var Er={setDynamicTimeoutLoop:void 0};const Mr=gr;var Br,kr,Or,jr,Nr,Rr;Er.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,Mr.setTimeout)(t,(async function i(){const o=Date.now();await e();const a=Date.now()-o;n||(r=(0,Mr.setTimeout)(Math.max(t-a,0),i))}));return()=>{n=!0,r()}},function(t){var e=h&&h.__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=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(dr,t),n(gr,t),n(br,t),n(Tr,t),n(Ar,t),n(Ir,t),n(Er,t)}(lr);class _r{constructor(){Br.set(this,new Map),kr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[]}get[(Br=new WeakMap,kr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,Br,"f").size}set(e,n,r){return t(this,Br,"f").set(e,n),this.removeItemMetadata(e),this.addItemMetadata(e,Date.now()+r),this}has(e){return t(this,Br,"f").has(e)}get(e){return t(this,Br,"f").get(e)}delete(e){const n=t(this,Br,"f").delete(e);if(n){const t=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.key===e));this.itemMetadataSortedByExpirationTime.splice(t,1),0===t&&this.rescheduleClearTimeout()}return n}clear(){var e;t(this,Br,"f").clear(),null===(e=t(this,kr,"f"))||void 0===e||e.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(e){const n=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.expirationTime>e));(n>=0?this.itemMetadataSortedByExpirationTime.splice(0,n):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((e=>t(this,Br,"f").delete(e.key)))}rescheduleClearTimeout(){var n;if(null===(n=t(this,kr,"f"))||void 0===n||n.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const n=lr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));e(this,kr,(()=>{n(),e(this,kr,void 0,"f")}),"f")}}}}class qr{constructor(t){Or.set(this,void 0),jr.set(this,new Map),Nr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[],m.assert(Number.isInteger(t),"The parameter limit must be an integer"),m.assert(t>0,"The parameter limit must be a positive value"),e(this,Or,t,"f")}get[(Or=new WeakMap,jr=new WeakMap,Nr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,jr,"f").size}set(e,n,r){return t(this,jr,"f").has(e)?(this.updateItem(e,n),this.removeItemMetadata(e),this.addItemMetadata(e,Date.now()+r)):(t(this,jr,"f").size===t(this,Or,"f")&&t(this,jr,"f").delete(this.getColdestKey()),t(this,jr,"f").set(e,n),this.addItemMetadata(e,Date.now()+r)),this}has(e){return t(this,jr,"f").has(e)}get(e){if(this.has(e)){const n=t(this,jr,"f").get(e);return this.updateItem(e,n),n}}delete(e){const n=t(this,jr,"f").delete(e);if(n){const t=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.key===e));this.itemMetadataSortedByExpirationTime.splice(t,1),0===t&&this.rescheduleClearTimeout()}return n}clear(){var e;t(this,jr,"f").clear(),null===(e=t(this,Nr,"f"))||void 0===e||e.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(e,n){t(this,jr,"f").delete(e),t(this,jr,"f").set(e,n)}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(e){const n=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.expirationTime>e));(n>=0?this.itemMetadataSortedByExpirationTime.splice(0,n):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((e=>t(this,jr,"f").delete(e.key)))}rescheduleClearTimeout(){var n;if(null===(n=t(this,Nr,"f"))||void 0===n||n.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const n=lr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));e(this,Nr,(()=>{n(),e(this,Nr,void 0,"f")}),"f")}}}getColdestKey(){return N.first(t(this,jr,"f").keys())}}class Cr{constructor(t){this.value=t,this.children=new Map}}class zr{constructor(){Rr.set(this,new Cr)}get[(Rr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(e,n){let r=t(this,Rr,"f");for(const t of e)r.children.has(t)||r.children.set(t,new Cr),r=r.children.get(t);return r.value=n,this}has(e){let n=t(this,Rr,"f");for(const t of e){if(!n.children.has(t))return!1;n=n.children.get(t)}return void 0!==n.value}get(e){let n=t(this,Rr,"f");for(const t of e){if(!n.children.has(t))return;n=n.children.get(t)}return n.value}delete(e){const n=[];let r=t(this,Rr,"f");for(const t of e){if(!r.children.has(t))return!1;n.push(r),r=r.children.get(t)}if(delete r.value,0===r.children.size)for(const[t,r]of N.toArray(N.zip(e,n)).reverse())if(r.children.delete(t),0!==r.children.size)break;return!0}}export{s as Box,f as Emitter,_r as ExpirableMap,l as HashMap,d as HashSet,fr as LRUMap,y as Queue,qr as TLRUMap,zr as TrieMap,u as convertArrayToCons,c as convertConsToArray};
16
16
  //# sourceMappingURL=index.min.mjs.map