MCPcopy
hub / github.com/leeoniya/uFuzzy / constructor

Method constructor

demos/lib/search-index.js:2–2  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

1/*! For license information please see search-index-4.0.0.js.LICENSE.txt */
2var SearchIndex;(()=>{var t={9464:(t,e,n)=>{"use strict";const{fromCallback:r}=n(6957),i=n(4473),{getCallback:s,getOptions:o}=n(2520),a=Symbol("promise"),c=Symbol("status"),h=Symbol("operations"),u=Symbol("finishClose"),l=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[h]=[],this[l]=[],this[c]="open",this[u]=this[u].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[h].length}put(t,e,n){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t)||this.db._checkValue(e);if(r)throw r;const s=n&&null!=n.sublevel?n.sublevel:this.db,o=n,a=s.keyEncoding(n&&n.keyEncoding),u=s.valueEncoding(n&&n.valueEncoding),l=a.format;n={...n,keyEncoding:l,valueEncoding:u.format},s!==this.db&&(n.sublevel=null);const f=s.prefixKey(a.encode(t),l),d=u.encode(e);return this._put(f,d,n),this[h].push({...o,type:"put",key:t,value:e}),this}_put(t,e,n){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t);if(n)throw n;const r=e&&null!=e.sublevel?e.sublevel:this.db,s=e,o=r.keyEncoding(e&&e.keyEncoding),a=o.format;return e={...e,keyEncoding:a},r!==this.db&&(e.sublevel=null),this._del(r.prefixKey(o.encode(t),a),e),this[h].push({...s,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[h]=[],this}_clear(){}write(t,e){return e=s(t,e),e=r(e,a),t=o(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[l].push((()=>e(t))),t||this.db.emit("batch",this[h]),this._close(this[u])}))),e[a]}_write(t,e){}close(t){return t=r(t,a),"closing"===this[c]?this[l].push(t):"closed"===this[c]?this.nextTick(t):(this[l].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[u]))),t[a]}_close(t){this.nextTick(t)}[u](){this[c]="closed",this.db.detachResource(this);const t=this[l];this[l]=[];for(const e of t)e()}}},3961:(t,e,n)=>{"use strict";const{fromCallback:r}=n(6957),i=n(4473),{getOptions:s,getCallback:o}=n(2520),a=Symbol("promise"),c=Symbol("callback"),h=Symbol("working"),u=Symbol("handleOne"),l=Symbol("handleMany"),f=Symbol("autoClose"),d=Symbol("finishWork"),p=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),b=Symbol("closed"),E=Symbol("closeCallbacks"),m=Symbol("keyEncoding"),v=Symbol("valueEncoding"),w=Symbol("abortOnClose"),_=Symbol("legacy"),T=Symbol("keys"),S=Symbol("values"),L=Symbol("limit"),O=Symbol("count"),A=Object.freeze({}),k=()=>{};let x=!1;class R{constructor(t,e,n){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[b]=!1,this[E]=[],this[h]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[u]=this[u].bind(this),this[l]=this[l].bind(this),this[g]=this[g].bind(this),this[m]=e[m],this[v]=e[v],this[_]=n,this[L]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[O]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[O]}get limit(){return this[L]}next(t){let e;if(void 0===t)e=new Promise(((e,n)=>{t=(t,r,i)=>{t?n(t):this[_]?void 0===r&&void 0===i?e():e([r,i]):e(r)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[h]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[h]=!0,this[c]=t,this[O]>=this[L]?this.nextTick(this[u],null):this._next(this[u])),e}_next(t){this.nextTick(t)}nextv(t,e,n){return n=o(e,n),n=r(n,a),e=s(e,A),Number.isInteger(t)?(this[y]?this.nextTick(n,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[h]?this.nextTick(n,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[L]<1/0&&(t=Math.min(t,this[L]-this[O])),this[h]=!0,this[c]=n,t<=0?this.nextTick(this[l],null,[]):this._nextv(t,e,this[l])),n[a]):(this.nextTick(n,new TypeError("The first argument 'size' must be an integer")),n[a])}_nextv(t,e,n){const r=[],i=(e,s,o)=>e?n(e):(this[_]?void 0===s&&void 0===o:void 0===s)?n(null,r):(r.push(this[_]?[s,o]:s),void(r.length===t?n(null,r):this._next(i)));this._next(i)}all(t,e){return e=o(t,e),e=r(e,a),t=s(t,A),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[h]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[h]=!0,this[c]=e,this[f]=!0,this[O]>=this[L]?this.nextTick(this[l],null,[]):this._all(t,this[l])),e[a]}_all(t,e){let n=this[O];const r=[],i=()=>{const t=this[L]<1/0?Math.min(1e3,this[L]-n):1e3;t<=0?this.nextTick(e,null,r):this._nextv(t,A,s)},s=(t,s)=>{t?e(t):0===s.length?e(null,r):(r.push.apply(r,s),n+=s.length,i())};i()}[d](){const t=this[c];return this[w]&&null===t?k:(this[h]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[p](t,e,n){this[f]?this.close(t.bind(null,e,n)):t(e,n)}seek(t,e){if(e=s(e,A),this[y]);else{if(this[h])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const n=this.db.keyEncoding(e.keyEncoding||this[m]),r=n.format;e.keyEncoding!==r&&(e={...e,keyEncoding:r});const i=this.db.prefixKey(n.encode(t),r);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=r(t,a),this[b]?this.nextTick(t):this[y]?this[E].push(t):(this[y]=!0,this[E].push(t),this[h]?this[w]&&this[d]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[b]=!0,this.db.detachResource(this);const t=this[E];this[E]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[b]||await this.close()}}}class I extends R{constructor(t,e){super(t,e,!0),this[T]=!1!==e.keys,this[S]=!1!==e.values}[u](t,e,n){const r=this[d]();if(t)return r(t);try{e=this[T]&&void 0!==e?this[m].decode(e):void 0,n=this[S]&&void 0!==n?this[v].decode(n):void 0}catch(t){return r(new C("entry",t))}void 0===e&&void 0===n||this[O]++,r(null,e,n)}[l](t,e){const n=this[d]();if(t)return this[p](n,t);try{for(const t of e){const e=t[0],n=t[1];t[0]=this[T]&&void 0!==e?this[m].decode(e):void 0,t[1]=this[S]&&void 0!==n?this[v].decode(n):void 0}}catch(t){return this[p](n,new C("entries",t))}this[O]+=e.length,this[p](n,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(I.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});I.keyEncoding=m,I.valueEncoding=v,e.AbstractIterator=I,e.AbstractKeyIterator=class extends R{constructor(t,e){super(t,e,!1)}[u](t,e){const n=this[d]();if(t)return n(t);try{e=void 0!==e?this[m].decode(e):void 0}catch(t){return n(new C("key",t))}void 0!==e&&this[O]++,n(null,e)}[l](t,e){const n=this[d]();if(t)return this[p](n,t);try{for(let t=0;t<e.length;t++){const n=e[t];e[t]=void 0!==n?this[m].decode(n):void 0}}catch(t){return this[p](n,new C("keys",t))}this[O]+=e.length,this[p](n,null,e)}},e.AbstractValueIterator=class extends R{constructor(t,e){super(t,e,!1)}[u](t,e){const n=this[d]();if(t)return n(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return n(new C("value",t))}void 0!==e&&this[O]++,n(null,e)}[l](t,e){const n=this[d]();if(t)return this[p](n,t);try{for(let t=0;t<e.length;t++){const n=e[t];e[t]=void 0!==n?this[v].decode(n):void 0}}catch(t){return this[p](n,new C("values",t))}this[O]+=e.length,this[p](n,null,e)}}},9071:(t,e,n)=>{"use strict";const{supports:r}=n(3658),{Transcoder:i}=n(8499),{EventEmitter:s}=n(7187),{fromCallback:o}=n(6957),a=n(4473),{AbstractIterator:c}=n(3961),{DefaultKeyIterator:h,DefaultValueIterator:u}=n(5429),{DeferredIterator:l,DeferredKeyIterator:f,DeferredValueIterator:d}=n(593),{DefaultChainedBatch:p}=n(4765),{getCallback:y,getOptions:g}=n(2520),b=n(56),E=Symbol("promise"),m=Symbol("landed"),v=Symbol("resources"),w=Symbol("closeResources"),_=Symbol("operations"),T=Symbol("undefer"),S=Symbol("deferOpen"),L=Symbol("options"),O=Symbol("status"),A=Symbol("defaultOptions"),k=Symbol("transcoder"),x=Symbol("keyEncoding"),R=Symbol("valueEncoding"),I=()=>{};class C extends s{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:n,valueEncoding:s,passive:o,...a}=e;this[v]=new Set,this[_]=[],this[S]=!0,this[L]=a,this[O]="opening",this.supports=r(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[k]=new i(U(this)),this[x]=this[k].encoding(n||"utf8"),this[R]=this[k].encoding(s||"utf8");for(const t of this[k].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[A]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[R].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},I)}))}get status(){return this[O]}keyEncoding(t){return this[k].encoding(null!=t?t:this[x])}valueEncoding(t){return this[k].encoding(null!=t?t:this[R])}open(t,e){e=y(t,e),e=o(e,E),(t={...this[L],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const n=t=>{"closing"===this[O]||"opening"===this[O]?this.once(m,t?()=>n(t):n):"open"!==this[O]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[O]?this.once(m,n):this.nextTick(n):"closed"===this[O]||this[S]?(this[S]=!1,this[O]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[O]="closed",this[w]((()=>{this.emit(m),n(t)})),void this[T]();this[O]="open",this[T](),this.emit(m),"open"===this[O]&&this.emit("open"),"open"===this[O]&&this.emit("ready"),n()}))):"open"===this[O]?this.nextTick(n):this.once(m,(()=>this.open(t,e))),e[E]}_open(t,e){this.nextTick(e)}close(t){t=o(t,E);const e=n=>{"opening"===this[O]||"closing"===this[O]?this.once(m,n?e(n):e):"closed"!==this[O]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:n})):t()};if("open"===this[O]){this[O]="closing",this.emit("closing");const t=t=>{this[O]="open",this[T](),this.emit(m),e(t)};this[w]((()=>{this._close((n=>{if(n)return t(n);this[O]="closed",this[T](),this.emit(m),"closed"===this[O]&&this.emit("closed"),e()}))}))}else"closed"===this[O]?this.nextTick(e):this.once(m,(()=>this.close(t)));return t[E]}[w](t){if(0===this[v].size)return this.nextTick(t);let e=this[v].size,n=!0;const r=()=>{0==--e&&(n?this.nextTick(t):t())};for(const t of this[v])t.close(r);n=!1,this[v].clear()}_close(t){this.nextTick(t)}get(t,e,n){if(n=y(e,n),n=o(n,E),e=g(e,this[A].entry),"opening"===this[O])return this.defer((()=>this.get(t,e,n))),n[E];if(D(this,n))return n[E];const r=this._checkKey(t);if(r)return this.nextTick(n,r),n[E];const i=this.keyEncoding(e.keyEncoding),s=this.valueEncoding(e.valueEncoding),c=i.format,h=s.format;return e.keyEncoding===c&&e.valueEncoding===h||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:h})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),n(t);try{e=s.decode(e)}catch(t){return n(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}n(null,e)})),n[E]}_get(t,e,n){this.nextTick(n,new Error("NotFound"))}getMany(t,e,n){if(n=y(e,n),n=o(n,E),e=g(e,this[A].entry),"opening"===this[O])return this.defer((()=>this.getMany(t,e,n))),n[E];if(D(this,n))return n[E];if(!Array.isArray(t))return this.nextTick(n,new TypeError("The first argument 'keys' must be an array")),n[E];if(0===t.length)return this.nextTick(n,null,[]),n[E];const r=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),s=r.format,c=i.format;e.keyEncoding===s&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:s,valueEncoding:c}));const h=new Array(t.length);for(let e=0;e<t.length;e++){const i=t[e],o=this._checkKey(i);if(o)return this.nextTick(n,o),n[E];h[e]=this.prefixKey(r.encode(i),s)}return this._getMany(h,e,((t,e)=>{if(t)return n(t);try{for(let t=0;t<e.length;t++)void 0!==e[t]&&(e[t]=i.decode(e[t]))}catch(t){return n(new a(`Could not decode one or more of ${e.length} value(s)`,{code:"LEVEL_DECODE_ERROR",cause:t}))}n(null,e)})),n[E]}_getMany(t,e,n){this.nextTick(n,null,new Array(t.length).fill(void 0))}put(t,e,n,r){if(r=y(n,r),r=o(r,E),n=g(n,this[A].entry),"opening"===this[O])return this.defer((()=>this.put(t,e,n,r))),r[E];if(D(this,r))return r[E];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(r,i),r[E];const s=this.keyEncoding(n.keyEncoding),a=this.valueEncoding(n.valueEncoding),c=s.format,h=a.format;n.keyEncoding===c&&n.valueEncoding===h||(n=Object.assign({},n,{keyEncoding:c,valueEncoding:h}));const u=this.prefixKey(s.encode(t),c),l=a.encode(e);return this._put(u,l,n,(n=>{if(n)return r(n);this.emit("put",t,e),r()})),r[E]}_put(t,e,n,r){this.nextTick(r)}del(t,e,n){if(n=y(e,n),n=o(n,E),e=g(e,this[A].key),"opening"===this[O])return this.defer((()=>this.del(t,e,n))),n[E];if(D(this,n))return n[E];const r=this._checkKey(t);if(r)return this.nextTick(n,r),n[E];const i=this.keyEncoding(e.keyEncoding),s=i.format;return e.keyEncoding!==s&&(e=Object.assign({},e,{keyEncoding:s})),this._del(this.prefixKey(i.encode(t),s),e,(e=>{if(e)return n(e);this.emit("del",t),n()})),n[E]}_del(t,e,n){this.nextTick(n)}batch(t,e,n){if(!arguments.length){if("opening"===this[O])return new p(this);if("open"!==this[O])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(n="function"==typeof t?t:y(e,n),n=o(n,E),e=g(e,this[A].empty),"opening"===this[O])return this.defer((()=>this.batch(t,e,n))),n[E];if(D(this,n))return n[E];if(!Array.isArray(t))return this.nextTick(n,new TypeError("The first argument 'operations' must be an array")),n[E];if(0===t.length)return this.nextTick(n),n[E];const r=new Array(t.length),{keyEncoding:i,valueEncoding:s,...c}=e;for(let e=0;e<t.length;e++){if("object"!=typeof t[e]||null===t[e])return this.nextTick(n,new TypeError("A batch operation must be an object")),n[E];const o=Object.assign({},t[e]);if("put"!==o.type&&"del"!==o.type)return this.nextTick(n,new TypeError("A batch operation must have a type property that is 'put' or 'del'")),n[E];const a=this._checkKey(o.key);if(a)return this.nextTick(n,a),n[E];const c=null!=o.sublevel?o.sublevel:this,h=c.keyEncoding(o.keyEncoding||i),u=h.format;if(o.key=c.prefixKey(h.encode(o.key),u),o.keyEncoding=u,"put"===o.type){const t=this._checkValue(o.value);if(t)return this.nextTick(n,t),n[E];const e=c.valueEncoding(o.valueEncoding||s);o.value=e.encode(o.value),o.valueEncoding=e.format}c!==this&&(o.sublevel=null),r[e]=o}return this._batch(r,c,(e=>{if(e)return n(e);this.emit("batch",t),n()})),n[E]}_batch(t,e,n){this.nextTick(n)}sublevel(t,e){return this._sublevel(t,N.defaults(e))}_sublevel(t,e){return new N(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=o(e,E),t=g(t,this[A].empty),"opening"===this[O])return this.defer((()=>this.clear(t,e))),e[E];if(D(this,e))return e[E];const n=t,r=this.keyEncoding(t.keyEncoding);return(t=b(t,r)).keyEncoding=r.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",n),e()})),e[E]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),n=this.valueEncoding(t&&t.valueEncoding);if((t=b(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=n,t.keyEncoding=e.format,t.valueEncoding=n.format,"opening"===this[O])return new l(this,t);if("open"!==this[O])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),n=this.valueEncoding(t&&t.valueEncoding);if((t=b(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=n,t.keyEncoding=e.format,t.valueEncoding=n.format,"opening"===this[O])return new f(this,t);if("open"!==this[O])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new h(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),n=this.valueEncoding(t&&t.valueEncoding);if((t=b(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=n,t.keyEncoding=e.format,t.valueEncoding=n.format,"opening"===this[O])return new d(this,t);if("open"!==this[O])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new u(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[_].push(t)}[T](){if(0===this[_].length)return;const t=this[_];this[_]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[v].add(t)}detachResource(t){this[v].delete(t)}_chainedBatch(){return new p(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=n(6909);const{AbstractSublevel:N}=n(9650)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=N;const D=function(t,e){return"open"!==t[O]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},U=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},875:(t,e,n)=>{"use strict";e.AbstractLevel=n(9071).AbstractLevel,e.AbstractSublevel=n(9071).AbstractSublevel,e.AbstractIterator=n(3961).AbstractIterator,e.AbstractKeyIterator=n(3961).AbstractKeyIterator,e.AbstractValueIterator=n(3961).AbstractValueIterator,e.AbstractChainedBatch=n(9464).AbstractChainedBatch},2970:(t,e,n)=>{"use strict";const{AbstractIterator:r,AbstractKeyIterator:i,AbstractValueIterator:s}=n(3961),o=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),h=Symbol("handleMany"),u=Symbol("callback");class l extends r{constructor(t,e,n,r){super(t,e),this[a]=n,this[o]=r,this[c]=this[c].bind(this),this[h]=this[h].bind(this),this[u]=null}[c](t,e,n){const r=this[u];if(t)return r(t);void 0!==e&&(e=this[o](e)),r(t,e,n)}[h](t,e){const n=this[u];if(t)return n(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[o](e))}n(t,e)}}class f extends i{constructor(t,e,n,r){super(t,e),this[a]=n,this[o]=r,this[c]=this[c].bind(this),this[h]=this[h].bind(this),this[u]=null}[c](t,e){const n=this[u];if(t)return n(t);void 0!==e&&(e=this[o](e)),n(t,e)}[h](t,e){const n=this[u];if(t)return n(t);for(let t=0;t<e.length;t++){const n=e[t];void 0!==n&&(e[t]=this[o](n))}n(t,e)}}class d extends s{constructor(t,e,n){super(t,e),this[a]=n}}for(const t of[l,f])t.prototype._next=function(t){this[u]=t,this[a].next(this[c])},t.prototype._nextv=function(t,e,n){this[u]=n,this[a].nextv(t,e,this[h])},t.prototype._all=function(t,e){this[u]=e,this[a].all(t,this[h])};for(const t of[d])t.prototype._next=function(t){this[a].next(t)},t.prototype._nextv=function(t,e,n){this[a].nextv(t,e,n)},t.prototype._all=function(t,e){this[a].all(t,e)};for(const t of[l,f,d])t.prototype._seek=function(t,e){this[a].seek(t,e)},t.prototype._close=function(t){this[a].close(t)};e.AbstractSublevelIterator=l,e.AbstractSublevelKeyIterator=f,e.AbstractSublevelValueIterator=d},9650:(t,e,n)=>{"use strict";const r=n(4473),{Buffer:i}=n(8764)||{},{AbstractSublevelIterator:s,AbstractSublevelKeyIterator:o,AbstractSublevelValueIterator:a}=n(2970),c=Symbol("prefix"),h=Symbol("upperBound"),u=Symbol("prefixRange"),l=Symbol("parent"),f=Symbol("unfix"),d=new TextEncoder,p={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new r("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new r("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?p:t.separator?t:{...t,separator:"!"}}constructor(t,n,i){const{separator:s,manifest:o,...a}=e.defaults(i);n=m(n,s);const u=s.charCodeAt(0)+1,p=t[l]||t;if(!d.encode(n).every((t=>t>u&&t<127)))throw new r(`Prefix must use bytes > ${u} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(p,o),a);const g=(t.prefix||"")+s+n+s,v=g.slice(0,-1)+String.fromCharCode(u);this[l]=p,this[c]=new b(g),this[h]=new b(v),this[f]=new E,this.nextTick=p.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[u](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[h][e]}get prefix(){return this[c].utf8}get db(){return this[l]}_open(t,e){this[l].open({passive:!0},e)}_put(t,e,n,r){this[l].put(t,e,n,r)}_get(t,e,n){this[l].get(t,e,n)}_getMany(t,e,n){this[l].getMany(t,e,n)}_del(t,e,n){this[l].del(t,e,n)}_batch(t,e,n){this[l].batch(t,e,n)}_clear(t,e){this[u](t,t.keyEncoding),this[l].clear(t,e)}_iterator(t){this[u](t,t.keyEncoding);const e=this[l].iterator(t),n=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,n)}_keys(t){this[u](t,t.keyEncoding);const e=this[l].keys(t),n=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,n)}_values(t){this[u](t,t.keyEncoding);const e=this[l].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class b{constructor(t){this.utf8=t,this.view=d.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class E{constructor(){this.cache=new Map}get(t,e){let n=this.cache.get(e);return void 0===n&&(n="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,n)),n}}const m=function(t,e){let n=0,r=t.length;for(;n<r&&t[n]===e;)n++;for(;r>n&&t[r-1]===e;)r--;return t.slice(n,r)}},2520:(t,e)=>{"use strict";e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4765:(t,e,n)=>{"use strict";const{AbstractChainedBatch:r}=n(9464),i=n(4473),s=Symbol("encoded");e.DefaultChainedBatch=class extends r{constructor(t){super(t),this[s]=[]}_put(t,e,n){this[s].push({...n,type:"put",key:t,value:e})}_del(t,e){this[s].push({...e,type:"del",key:t})}_clear(){this[s]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[s].length?this.nextTick(e):this.db._batch(this[s],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5429:(t,e,n)=>{"use strict";const{AbstractKeyIterator:r,AbstractValueIterator:i}=n(3961),s=Symbol("iterator"),o=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class h extends r{constructor(t,e){super(t,e),this[s]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class u extends i{constructor(t,e){super(t,e),this[s]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[h,u]){const e=t===h,n=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[o]=t,this[s].next(this[a])},t.prototype[a]=function(t,n,r){const i=this[o];t?i(t):i(null,e?n:r)},t.prototype._nextv=function(t,e,n){this[o]=n,this[s].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[o]=e,this[s].all(t,this[c])},t.prototype[c]=function(t,e){const r=this[o];t?r(t):r(null,e.map(n))},t.prototype._seek=function(t,e){this[s].seek(t,e)},t.prototype._close=function(t){this[s].close(t)}}e.DefaultKeyIterator=h,e.DefaultValueIterator=u},593:(t,e,n)=>{"use strict";const{AbstractIterator:r,AbstractKeyIterator:i,AbstractValueIterator:s}=n(3961),o=n(4473),a=Symbol("nut"),c=Symbol("undefer"),h=Symbol("factory");class u extends r{constructor(t,e){super(t,e),this[a]=null,this[h]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class l extends i{constructor(t,e){super(t,e),this[a]=null,this[h]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends s{constructor(t,e){super(t,e),this[a]=null,this[h]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[u,l,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[h]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new o("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,n){null!==this[a]?this[a].nextv(t,e,n):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,n))):this.nextTick(n,new o("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new o("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=u,e.DeferredKeyIterator=l,e.DeferredValueIterator=f},6909:(t,e,n)=>{"use strict";const r=n(4375);t.exports=function(t,...e){0===e.length?r(t):r((()=>t(...e)))}},56:(t,e,n)=>{"use strict";const r=n(4473),i=Object.prototype.hasOwnProperty,s=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const n={};for(const o in t)if(i.call(t,o)&&"keyEncoding"!==o&&"valueEncoding"!==o){if("start"===o||"end"===o)throw new r(`The legacy range option '${o}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===o)throw new r("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});s.has(o)?n[o]=e.encode(t[o]):n[o]=t[o]}return n.reverse=!!n.reverse,n.limit=Number.isInteger(n.limit)&&n.limit>=0?n.limit:-1,n}},3658:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,s=a(t),o=s[0],c=s[1],h=new i(function(t,e,n){return 3*(e+n)/4-n}(0,o,c)),u=0,l=c>0?o-4:o;for(n=0;n<l;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],h[u++]=e>>16&255,h[u++]=e>>8&255,h[u++]=255&e;return 2===c&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,h[u++]=255&e),1===c&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=16383,a=0,h=r-i;a<h;a+=o)s.push(c(t,a,a+o>h?h:a+o));return 1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,r){for(var i,s,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},1708:(t,e,n)=>{"use strict";const{AbstractLevel:r}=n(875),i=n(4473),s=n(9967),{fromCallback:o}=n(6957),{Iterator:a}=n(8212),c=n(9687),h=n(9968),u=n(1217),l="level-js-",f=Symbol("idb"),d=Symbol("namePrefix"),p=Symbol("location"),y=Symbol("version"),g=Symbol("store"),b=Symbol("onComplete"),E=Symbol("promise");class m extends r{constructor(t,e,n){if("function"==typeof e||"function"==typeof n)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:r,version:s,...o}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},o),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[p]=t,this[d]=null==r?l:r,this[y]=parseInt(s||1,10),this[f]=null}get location(){return this[p]}get namePrefix(){return this[d]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const n=indexedDB.open(this[d]+this[p],this[y]);n.onerror=function(){e(n.error||new Error("unknown error"))},n.onsuccess=()=>{this[f]=n.result,e()},n.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[p])||e.createObjectStore(this[p])}}[g](t){return this[f].transaction([this[p]],t).objectStore(this[p])}[b](t,e){const n=t.transaction;n.onabort=function(){e(n.error||new Error("aborted by user"))},n.oncomplete=function(){e(null,t.result)}}_get(t,e,n){const r=this[g]("readonly");let s;try{s=r.get(t)}catch(t){return this.nextTick(n,t)}this[b](s,(function(t,e){return t?n(t):void 0===e?n(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void n(null,c(e))}))}_getMany(t,e,n){const r=this[g]("readonly"),i=t.map((t=>e=>{let n;try{n=r.get(t)}catch(t){return e(t)}n.onsuccess=()=>{const t=n.result;e(null,void 0===t?t:c(t))},n.onerror=t=>{t.stopPropagation(),e(n.error)}}));s(i,16,n)}_del(t,e,n){const r=this[g]("readwrite");let i;try{i=r.delete(t)}catch(t){return this.nextTick(n,t)}this[b](i,n)}_put(t,e,n,r){const i=this[g]("readwrite");let s;try{s=i.put(e,t)}catch(t){return this.nextTick(r,t)}this[b](s,r)}_iterator(t){return new a(this,this[p],t)}_batch(t,e,n){const r=this[g]("readwrite"),i=r.transaction;let s,o=0;i.onabort=function(){n(s||i.error||new Error("aborted by user"))},i.oncomplete=function(){n()},function e(){const n=t[o++],a=n.key;let c;try{c="del"===n.type?r.delete(a):r.put(n.value,a)}catch(t){return s=t,void i.abort()}o<t.length?c.onsuccess=e:"function"==typeof i.commit&&i.commit()}()}_clear(t,e){let n,r;try{n=u(t)}catch(t){return this.nextTick(e)}if(t.limit>=0)return h(this,this[p],n,t,e);try{const t=this[g]("readwrite");r=n?t.delete(n):t.clear()}catch(t){return this.nextTick(e,t)}this[b](r,e)}_close(t){this[f].close(),this.nextTick(t)}}m.destroy=function(t,e,n){"function"==typeof e&&(n=e,e=l),n=o(n,E);const r=indexedDB.deleteDatabase(e+t);return r.onsuccess=function(){n()},r.onerror=function(t){n(t)},n[E]},e.BrowserLevel=m},8212:(t,e,n)=>{"use strict";const{AbstractIterator:r}=n(875),i=n(1217),s=n(9687),o=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),h=Symbol("currentOptions"),u=Symbol("position"),l=Symbol("location"),f=Symbol("first"),d={};function p(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends r{constructor(t,e,n){super(t,n),this[o]=[],this[a]=0===this.limit,this[c]=n,this[h]={...n},this[u]=void 0,this[l]=e,this[f]=!0}_nextv(t,e,n){if(this[f]=!1,this[a])return this.nextTick(n,null,[]);if(this[o].length>0)return t=Math.min(t,this[o].length),this.nextTick(n,null,this[o].splice(0,t));let r;void 0!==this[u]&&(this[c].reverse?(this[h].lt=this[u],this[h].lte=void 0):(this[h].gt=this[u],this[h].gte=void 0));try{r=i(this[h])}catch(t){return this[a]=!0,this.nextTick(n,null,[])}const d=this.db.db.transaction([this[l]],"readonly"),y=d.objectStore(this[l]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](r,"prev").onsuccess=e=>{const n=e.target.result;if(n){const{key:e,value:r}=n;this[u]=e,g.push([this[c].keys&&void 0!==e?s(e):void 0,this[c].values&&void 0!==r?s(r):void 0]),g.length<t?n.continue():p(d)}else this[a]=!0};else{let e,n;const i=()=>{if(void 0===e||void 0===n)return;const r=Math.max(e.length,n.length);0===r||t===1/0?this[a]=!0:this[u]=e[r-1],g.length=r;for(let t=0;t<r;t++){const r=e[t],i=n[t];g[t]=[this[c].keys&&void 0!==r?s(r):void 0,this[c].values&&void 0!==i?s(i):void 0]}p(d)};this[c].keys||t<1/0?y.getAllKeys(r,t<1/0?t:void 0).onsuccess=t=>{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(r,t<1/0?t:void 0).onsuccess=t=>{n=t.target.result,i()}:(n=[],this.nextTick(i))}d.onabort=()=>{n(d.error||new Error("aborted by user")),n=null},d.oncomplete=()=>{n(null,g),n=null}}_next(t){if(this[o].length>0){const[e,n]=this[o].shift();this.nextTick(t,null,e,n)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,d,((e,n)=>{if(e)return t(e);this[o]=n,this._next(t)}))}}_all(t,e){this[f]=!1;const n=this[o].splice(0,this[o].length),r=this.limit-this.count-n.length;if(r<=0)return this.nextTick(e,null,n);this._nextv(r,d,((t,r)=>{if(t)return e(t);n.length>0&&(r=n.concat(r)),e(null,r)}))}_seek(t,e){let n;this[f]=!0,this[o]=[],this[a]=!1,this[u]=void 0,this[h]={...this[c]};try{n=i(this[c])}catch(t){return void(this[a]=!0)}null===n||n.includes(t)?this[c].reverse?this[h].lte=t:this[h].gte=t:this[a]=!0}}},9968:t=>{"use strict";t.exports=function(t,e,n,r,i){if(0===r.limit)return t.nextTick(i);const s=t.db.transaction([e],"readwrite"),o=s.objectStore(e);let a=0;s.oncomplete=function(){i()},s.onabort=function(){i(s.error||new Error("aborted by user"))};const c=o.openKeyCursor?"openKeyCursor":"openCursor",h=r.reverse?"prev":"next";o[c](n,h).onsuccess=function(t){const e=t.target.result;e&&(o.delete(e.key).onsuccess=function(){(r.limit<=0||++a<r.limit)&&e.continue()})}}},9687:t=>{"use strict";const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},1217:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,n=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,r=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==n?IDBKeyRange.bound(e,n,r,i):void 0!==e?IDBKeyRange.lowerBound(e,r):void 0!==n?IDBKeyRange.upperBound(n,i):null}},8764:(t,e,n)=>{"use strict";const r=n(9742),i=n(645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return h(t,e,n)}function h(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|y(t,e);let r=a(n);const i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,n);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||J(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return u(t),a(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),n=a(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function d(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,c.prototype),r}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(i)return r?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return x(this,e,n);case"base64":return L(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function E(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,r,i){let s,o=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,n/=2}function h(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let r=-1;for(s=n;s<a;s++)if(h(t,s)===h(e,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===c)return r*o}else-1!==r&&(s-=s-r),r=-1}else for(n+c>a&&(n=a-c),s=n;s>=0;s--){let n=!0;for(let r=0;r<c;r++)if(h(t,s+r)!==h(e,r)){n=!1;break}if(n)return s}return-1}function v(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=e.length;let o;for(r>s/2&&(r=s/2),o=0;o<r;++o){const r=parseInt(e.substr(2*o,2),16);if(J(r))return o;t[n+o]=r}return o}function w(t,e,n,r){return H(q(e,t.length-n),t,n,r)}function _(t,e,n,r){return H(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function T(t,e,n,r){return H($(e),t,n,r)}function S(t,e,n,r){return H(function(t,e){let n,r,i;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function L(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=n){let n,r,a,c;switch(o){case 1:e<128&&(s=e);break;case 2:n=t[i+1],128==(192&n)&&(c=(31&e)<<6|63&n,c>127&&(s=c));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(c=(15&e)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=A));return n}(r)}e.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,n){return h(t,e,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,n){return function(t,e,n){return u(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},c.allocUnsafe=function(t){return l(t)},c.allocUnsafeSlow=function(t){return l(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=c.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(Y(e,Uint8Array))i+e.length>r.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(t,e,n,r,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0);const a=Math.min(s,o),h=this.slice(r,i),u=t.slice(e,n);for(let t=0;t<a;++t)if(h[t]!==u[t]){s=h[t],o=u[t];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return E(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return E(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":case"latin1":case"binary":return _(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function k(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function x(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function R(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=X[t[r]];return i}function I(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i){z(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,n}function U(t,e,n,r,i){z(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n+7]=s,s>>=8,t[n+6]=s,s>>=8,t[n+5]=s,s>>=8,t[n+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=o,o>>=8,t[n+2]=o,o>>=8,t[n+1]=o,o>>=8,t[n]=o,n+8}function P(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(t,e,n,r,s){return e=+e,n>>>=0,s||P(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,s){return e=+e,n>>>=0,s||P(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);let r=this[t],i=1,s=0;for(;++s<e&&(i*=256);)r+=this[t+s]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||W(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Q((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||W(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);let r=this[t],i=1,s=0;for(;++s<e&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||C(t,e,this.length);let r=e,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||W(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=Q((function(t){G(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||W(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||N(this,t,e,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||N(this,t,e,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}let i=0,s=1,o=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,t,e,n,r-1,-r)}let i=n-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,n){return M(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return M(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const s=c.isBuffer(t)?t:c.from(t,r),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=s[i%o]}return this};const j={};function F(t,e,n){j[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function V(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function z(t,e,n,r,i,s){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=s>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||W(e,t.length-(n+1))}(r,i,s)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,n){if(Math.floor(t)!==t)throw G(t,n),new j.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=V(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let n;e=e||1/0;const r=t.length;let i=null;const s=[];for(let o=0;o<r;++o){if(n=t.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function $(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},6957:(t,e,n)=>{"use strict";var r=n(886);e.fromCallback=function(t,e){if(void 0===t){var n=new Promise((function(e,n){t=function(t,r){t?n(t):e(r)}}));t[void 0!==e?e:"promise"]=n}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){r((()=>e(null,t)))})).catch((function(t){r((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function n(t){for(var e="",n=0;n<t.length;n++){var r=t[n];isNaN(Number(r))||" "===r?"-"!==r&&(e+=r):e+=String(9-Number(r))}return e}e.encode=function(t){if(isNaN(t))return"DaN";if(0===t)return"FE 0M0";if(t===1/0)return"FF";if(t===-1/0)return"DD";var e,r=t.toExponential().split("e"),i=Number(r[1])+500,s=r[0]+(-1===r[0].indexOf(".")?".":"")+"0".repeat(20),o="E"+(e=String(i)," ".repeat(3-e.length).substr(0,3)+e+"M")+String(s);return t>0?"F"+o:"D"+n(o)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],r=(e?n(t):t).slice(2).split("M");return Number((e?"-":"")+r[1]+"e"+String(Number(r[0])-500))}},2833:(t,e)=>{var n={"?":"?@","!":"??",'"':"?%"},r={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var n,i=e.split('"'),s=[[]],o=0,a=i.length,c=0;c<a;c++){for(var h=i[c],u=h.length,l=0;"K"==h[l];)l++;for(var f=0;"!"==h[u-f-1];)f++;for(var d=h.slice(l,u-f),p=o+l,y=o;y<p;y++)s[y+1]=[],s[y].push(s[y+1]),n=s[o=p];for(0!==d.length&&n.push(t.decode(/\?[%\?@]/.test(g=d)?g.replace(/\?[%\?@]/g,(function(t){return r[t]})):g)),y=p=o-f;y<o;y++)s[y+1]=[],n=s[o=p]}var g;return s[0][0]}};function e(t){if(null===t)return"A";if(!Array.isArray(t))throw new Error("can only encode arrays");var e=t.length;if(0==e)return"K!";for(var n=i(t[0]),r=1;r<e;r++)n+='"'+i(t[r]);return"K"+n+"!"}function i(r){return"object"==typeof r?e(r):(i=t.encode(r),/[!"]/.test(i)?i.replace(/[\?!"]/g,(function(t){return n[t]})):i);var i}}},2483:(t,e,n)=>{var r=n(8840),i=n(2833);e.flip=function(t){var e=t.toString(),n="";for(var r in e)n+="."==e[r]?".":9-+e[r];return n},e.number=r,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!s[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return s[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var s={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},6729:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,r,s,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||t,o),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++)o[i]=r[i].fn;return o},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,i,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var c,h,u=this._events[a],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,s),!0;case 6:return u.fn.call(u.context,e,r,i,s,o),!0}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c)}else{var f,d=u.length;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,r);break;case 4:u[h].fn.call(u[h].context,e,r,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];u[h].fn.apply(u[h].context,c)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,i){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||o(this,s);else{for(var c=0,h=[],u=a.length;c<u;c++)(a[c].fn!==e||i&&!a[c].once||r&&a[c].context!==r)&&h.push(a[c]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a},7187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,s),r(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}y(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,s,o,h;if(a(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,h=u,console&&console.warn&&console.warn(h)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function f(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function y(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(s){r.once&&t.removeEventListener(e,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[t];if(void 0===c)return!1;if("function"==typeof c)r(c,this,e);else{var h=c.length,u=p(c,h);for(n=0;n<h;++n)r(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,s,o;if(a(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9203:(t,e,n)=>{const r=n(7270),{BrowserLevel:i}=n(1708);t.exports=({name:t="fii",...e})=>r({db:new i(t),...e})},7270:(t,e,n)=>{const r=n(9563),i=n(8936),s=n(1387),o=t=>void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELD<e.FIELD?-1:t.FIELD>e.FIELD?1:t.VALUE<e.VALUE?-1:t.VALUE>e.VALUE?1:t.SCORE<e.SCORE?-1:t.SCORE>e.SCORE?1:0)),t))),a=t=>{const e=r(t),n=i(t);return n.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,n)=>e.INTERSECTION(t,n).then(o),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:n.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,n)=>e.GET(t,n).then(o),IMPORT:n.IMPORT,LAST_UPDATED:e.LAST_UPDATED,LEVEL_OPTIONS:s,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(o),OBJECT:e.OBJECT,OR:(t,n)=>e.UNION(t,n).then((t=>t.union)).then(o),PUT:n.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:n.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,n)=>{const r=(t=Object.assign({caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t)).db;r.open((i=>i?n(i):e(Object.assign(t,{_db:r}))))})))(t).then(a)},1387:(t,e,n)=>{const r=n(2483);t.exports={keyEncoding:r,valueEncoding:"json"}},6782:t=>{const e=null,n=void 0;t.exports=(t,r)=>new Promise(((i,s)=>{if(Array.isArray(t))return s(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:r,VALUE:{GTE:t,LTE:t}});const[e,...n]=t.split(":");return i({FIELD:[e],VALUE:{GTE:n.join(":"),LTE:n.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:e,LTE:n}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=n),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:r})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,n)=>{const r=n(6782),i=n(2483),{EntryStream:s}=n(6741),o=n(1387);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,n=async t=>r(t,await l()),a=async(e,r=(t=>new Promise((e=>e(t)))))=>new Promise((async(i,s)=>{const o=t=>void 0===t?i(void 0):t instanceof Promise?i(t):void 0;try{o(e),e=await n(e),e=await(e=>{const n=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(n),VALUE:{GTE:n(e.VALUE.GTE),LTE:n(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),o(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?c(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),o(e=await r(e))}catch(t){return s(t)}return Array.isArray(e)?i(e):i(u(e))})),c=async(t,e)=>Promise.all(t.map((t=>a(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),h=(t,e,n)=>{const r=[];return void 0===e&&"number"!=typeof e||r.push(e),n&&r.push(i.HI),["IDX",t,r]},u=e=>new Promise((n=>{if(void 0===e)return n(void 0);const r=new Map;return Promise.all(e.FIELD.map((n=>new Promise((i=>new s(t._db,{gte:h(n,e.VALUE.GTE),lte:h(n,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE,...o}).on("data",(t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>n(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),l=()=>new Promise((e=>{const n=[];new s(t._db,{gte:["FIELD",i.LO],lte:["FIELD",i.HI],...o}).on("data",(t=>n.push(t.value))).on("end",(()=>e(n)))})),f=(t,e)=>e&&0!==e.length?(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]})))):t,d=async t=>n(t).then((t=>a(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),p=e=>new Promise(((n,r)=>{const i=[];new s(t._db,{...e,...o}).on("data",(t=>{i.push(t)})).on("end",(()=>n(i)))})),y=(t,e)=>n(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),g=t=>n(t).then((t=>Promise.all(t.FIELD.map((e=>{let n=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(n+="○");let r=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(r+=" "),p({gte:h(e,r),lte:h(e,n,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),b=t=>n(t).then((t=>Promise.all(t.FIELD.map((e=>p({gte:h(e,t.VALUE.GTE),lte:h(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))))).then((t=>t.flat())),E=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:n})=>Promise.all([t,e,n]).then((([t=[],e=[],n=[]])=>({BUCKETS:f(t.flat(),n),FACETS:f(e.flat(),n),RESULT:n}))),AGGREGATION_FILTER:f,BUCKET:d,BUCKETS:(...t)=>Promise.all(t.map(d)),CREATED:()=>t._db.get(["~CREATED"],o),DISTINCT:(...t)=>Promise.all(t.length?t.map(g):[g({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t._db.get([t.docExistsSpace,e],o).catch((t=>null))))).then((t=>t.reduce(((t,n,r)=>(null!=n&&t.push(e[r]),t)),[]))),EXPORT:p,FACETS:(...t)=>Promise.all(t.length?t.map(b):[b({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:l,GET:a,INTERSECTION:(t,e)=>c(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"],o),MAX:t=>y(t,!0),MIN:y,OBJECT:e=>Promise.all(e.map((e=>t._db.get(["DOC",e._id],o).catch((t=>null))))).then((t=>e.map(((e,n)=>(e._object=t[n],e))))),SET_SUBTRACTION:(t,n)=>Promise.all([e(t)?a(t):t,e(n)?a(n):n]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>E.compare(t._id,e._id)))))),UNION:c,parseToken:n}}},8936:(t,e,n)=>{const r=n(3692),i=n(9563),s=n(1387);t.exports=t=>{let e=0;const n=(e,n)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return r(e._object).forEach((function(e){const r=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==r&&!n.doNotIndexField.filter((t=>r.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([r,[this.node].flat(1/0)]);i.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((n=>{t[n]=t[n]||[],t[n].push(e._id)})),t),a=(r,a,c,h,u)=>new Promise((l=>{r=r.map((t=>{var n;return t._id=void 0===(n=t._id)?++e:"string"==typeof n||"number"==typeof n?n:void 0,t._object&&(t._object._id=t._id),t})),u=Object.assign(t,u),i(t).EXIST(...r.map((t=>t._id))).then((t=>((t,e,n)=>{const r=Object.keys(t);return Promise.all(r.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((n,r)=>e.get(t,s).then(n).catch((t=>n([])))))))).then((e=>e.map(((e,i)=>{const s=new Set(e),o=new Set(t[r[i]]);if("put"===n)return{key:["IDX",...JSON.parse(r[i])],type:n,value:[...new Set([...s,...o])].sort()};if("del"===n){const t=[...new Set([...s].filter((t=>!o.has(t))))];return{key:["IDX",...JSON.parse(r[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>n(t,e))).reduce(o,{}))(r,u),a,c).then((e=>a.batch(e.concat(u.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(r,c):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),s,(e=>l(r.map((e=>{let n;return"put"===c?n=t.includes(e._id)?"UPDATED":"CREATED":"del"===c&&(n=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:h,status:n}})))))))))})),c=e=>t._db.put(["~LAST_UPDATED"],Date.now(),s).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>a(e,t._db,"del","DELETE",{}))).then(c),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"}))),s))),PUT:(e,n={})=>a(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",n).then(c),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"],s).then().catch((e=>t._db.put(["~CREATED"],Date.now(),s).then(c))),TIMESTAMP_LAST_UPDATED:c}}},645:(t,e)=>{e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,c=(1<<a)-1,h=c>>1,u=-7,l=n?i-1:0,f=n?-1:1,d=t[e+l];for(l+=f,s=d&(1<<-u)-1,d>>=-u,u+=a;u>0;s=256*s+t[e+l],l+=f,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=r;u>0;o=256*o+t[e+l],l+=f,u-=8);if(0===s)s=1-h;else{if(s===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),s-=h}return(d?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,c,h=8*s-i-1,u=(1<<h)-1,l=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(a=0,o=u):o+l>=1?(a=(e*c-1)*Math.pow(2,i),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[n+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,h+=i;h>0;t[n+d]=255&o,d+=p,o/=256,h-=8);t[n+d-p]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},6741:(t,e,n)=>{"use strict";const{Readable:r}=n(8473),i=Symbol("iterator"),s=Symbol("nextv");class o extends r{constructor(t,e,n){const{highWaterMark:r,...o}=n||{};super({objectMode:!0,highWaterMark:r||1e3}),this[i]=t[e](o),this[s]=this[s].bind(this),this.once("end",this.destroy.bind(this,null,null))}get db(){return this[i].db}_read(t){this.destroyed||this[i].nextv(t,this[s])}[s](t,e){if(!this.destroyed){if(t)return this.destroy(t);if(0===e.length)this.push(null);else for(const t of e)this.push(t)}}_destroy(t,e){this[i].close((function(n){e(t||n)}))}}e.EntryStream=class extends o{constructor(t,e){super(t,"iterator",{...e,keys:!0,values:!0})}[s](t,e){if(!this.destroyed){if(t)return this.destroy(t);if(0===e.length)this.push(null);else for(const[t,n]of e)this.push({key:t,value:n})}}},e.KeyStream=class extends o{constructor(t,e){super(t,"keys",e)}},e.ValueStream=class extends o{constructor(t,e){super(t,"values",e)}}},8499:(t,e,n)=>{"use strict";const r=n(4473),i=n(8002),{Encoding:s}=n(8266),{BufferFormat:o,ViewFormat:a,UTF8Format:c}=n(2376),h=Symbol("formats"),u=Symbol("encodings"),l=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>l.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[u]=new Map,this[h]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[u].values()))}encoding(t){let e=this[u].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=d[t],!e)throw new r(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof s)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,n=t.name||e||"anonymous-"+p++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:n});case"utf8":return new c({...t,name:n});case"buffer":return new o({...t,name:n});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:n,format:i}=e;if(!this[h].has(i))if(this[h].has("view"))e=e.createViewTranscoder();else if(this[h].has("buffer"))e=e.createBufferTranscoder();else{if(!this[h].has("utf8"))throw new r(`Encoding '${n}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const r of[t,n,e.name,e.commonName])this[u].set(r,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},d={...i,...f};let p=0},8266:(t,e,n)=>{"use strict";const r=n(4473),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new r(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new r(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new r(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},8002:(t,e,n)=>{"use strict";const{Buffer:r}=n(8764)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:s}=n(4005)(),{BufferFormat:o,ViewFormat:a,UTF8Format:c}=n(2376),h=t=>t;e.utf8=new c({encode:function(t){return r.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?s.decode(t):String(t)},decode:h,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return s.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new o({encode:function(t){return r.isBuffer(t)?t:ArrayBuffer.isView(t)?r.from(t.buffer,t.byteOffset,t.byteLength):r.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new o({encode:function(t){return r.isBuffer(t)?t:ArrayBuffer.isView(t)?r.from(t.buffer,t.byteOffset,t.byteLength):r.from(String(t),"utf8")},decode:h,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:r.from(String(t),"utf8")},decode:function(t){return r.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:h,name:"view",createBufferTranscoder(){return new o({encode:function(t){return r.isBuffer(t)?t:ArrayBuffer.isView(t)?r.from(t.buffer,t.byteOffset,t.byteLength):r.from(String(t),"utf8")},decode:h,name:`${this.name}+buffer`})}}),e.hex=new o({encode:function(t){return r.isBuffer(t)?t:r.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new o({encode:function(t){return r.isBuffer(t)?t:r.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},2376:(t,e,n)=>{"use strict";const{Buffer:r}=n(8764)||{},{Encoding:i}=n(8266),s=n(4005);class o extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(r.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new o({encode:t=>{const e=this.encode(t);return r.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=o,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new o({encode:t=>r.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=s();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},4005:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},4473:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},6349:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((n,r)=>t.slice(r,r+e)))};t.ngraminator=function(t,n){return n.reduce(((n,r)=>[...e(t,r),...n]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},4155:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var a,c=[],h=!1,u=-1;function l(){h&&a&&(h=!1,a.length?c=a.concat(c):u=-1,c.length&&f())}function f(){if(!h){var t=o(l);h=!0;for(var e=c.length;e;){for(a=c,c=[];++u<e;)a&&a[u].run();u=-1,e=c.length}a=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||h||o(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},4375:(t,e,n)=>{let r;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:n.g):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{"use strict";var e={};function n(t,n,r){r||(r=Error);var i=function(t){var e,r;function i(e,r,i){return t.call(this,function(t,e,r){return"string"==typeof n?n:n(t,e,r)}(e,r,i))||this}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=t,e[t]=i}function r(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,s,o,a,c;if("string"==typeof e&&(s="not ",e.substr(0,4)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-9,n)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(r(e,"type"));else{var h=("number"!=typeof c&&(c=0),c+1>(a=t).length||-1===a.indexOf(".",c)?"argument":"property");o='The "'.concat(t,'" ').concat(h," ").concat(i," ").concat(r(e,"type"))}return o+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,n)=>{"use strict";var r=n(4155),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=u;var s=n(9481),o=n(4229);n(5717)(u,s);for(var a=i(o.prototype),c=0;c<a.length;c++){var h=a[c];u.prototype[h]||(u.prototype[h]=o.prototype[h])}function u(t){if(!(this instanceof u))return new u(t);s.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||r.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},2725:(t,e,n)=>{"use strict";t.exports=i;var r=n(4605);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(5717)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},9481:(t,e,n)=>{"use strict";var r,i=n(4155);t.exports=L,L.ReadableState=S,n(7187).EventEmitter;var s,o=function(t,e){return t.listeners(e).length},a=n(2503),c=n(8764).Buffer,h=n.g.Uint8Array||function(){},u=n(4616);s=u&&u.debuglog?u.debuglog("stream"):function(){};var l,f,d,p=n(7327),y=n(1195),g=n(2457).getHighWaterMark,b=n(4281).q,E=b.ERR_INVALID_ARG_TYPE,m=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(5717)(L,a);var _=y.errorOrDestroy,T=["error","close","destroy","pause","resume"];function S(t,e,i){r=r||n(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=n(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function L(t){if(r=r||n(6753),!(this instanceof L))return new L(t);var e=this instanceof r;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,n,r,i){s("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(s("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(o=function(t,e){var n,r;return r=e,c.isBuffer(r)||r instanceof h||"string"==typeof e||void 0===e||t.objectMode||(n=new E("chunk",["string","Buffer","Uint8Array"],e)),n}(a,e)),o)_(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r)a.endEmitted?_(t,new w):A(t,a,e,!0);else if(a.ended)_(t,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):C(t,a)):A(t,a,e,!1)}else r||(a.reading=!1,C(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),C(t,e)}Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),L.prototype.destroy=y.destroy,L.prototype._undestroy=y.undestroy,L.prototype._destroy=function(t,e){e(t)},L.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=c.from(t,e),e=""),n=!0),O(this,t,e,!1,n)},L.prototype.unshift=function(t){return O(this,t,null,!0,!1)},L.prototype.isPaused=function(){return!1===this._readableState.flowing},L.prototype.setEncoding=function(t){l||(l=n(2553).s);var e=new l(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function x(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;s("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(s("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,M(t)}function C(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(N,t,e))}function N(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(s("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function D(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){s("readable nexttick read 0"),t.read(0)}function P(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),M(t),e.flowing&&!e.reading&&t.read(0)}function M(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function j(t){var e=t._readableState;s("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function V(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}L.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):R(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&j(this),null;var r,i=e.needReadable;return s("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",i=!0),e.ended||e.reading?s("reading or ended",i=!1):i&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=x(n,e))),null===(r=t>0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&j(this)),null!==r&&this.emit("data",r),r},L.prototype._read=function(t){_(this,new v("_read()"))},L.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,s("pipe count=%d opts=%j",r.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:c;function c(){s("onend"),t.end()}r.endEmitted?i.nextTick(a):n.once("end",a),t.on("unpipe",(function e(i,o){s("onunpipe"),i===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,s("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",h),t.removeListener("error",f),t.removeListener("unpipe",e),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",l),u=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}));var h=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,M(t))}}(n);t.on("drain",h);var u=!1;function l(e){s("ondata");var i=t.write(e);s("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==V(r.pipes,t))&&!u&&(s("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(e){s("onerror",e),y(),t.removeListener("error",f),0===o(t,"error")&&_(t,e)}function d(){t.removeListener("finish",p),y()}function p(){s("onfinish"),t.removeListener("close",d),y()}function y(){s("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),r.flowing||(s("pipe resume"),n.resume()),t},L.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=V(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},L.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e),r=this._readableState;return"data"===t?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,s("on readable",r.length,r.reading),r.length?R(this):r.reading||i.nextTick(U,this))),n},L.prototype.addListener=L.prototype.on,L.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(D,this),n},L.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(D,this),e},L.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(P,t,e))}(this,t)),t.paused=!1,this},L.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},L.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(s("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){s("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<T.length;o++)t.on(T[o],this.emit.bind(this,T[o]));return this._read=function(e){s("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(L.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=n(5850)),f(this)}),Object.defineProperty(L.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(L.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(L.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),L._fromList=B,Object.defineProperty(L.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(L.from=function(t,e){return void 0===d&&(d=n(5167)),d(L,t,e)})},4605:(t,e,n)=>{"use strict";t.exports=u;var r=n(4281).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(6753);function h(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new s);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);c.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,n){f(t,e,n)}))}function f(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}n(5717)(u,c),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},4229:(t,e,n)=>{"use strict";var r,i=n(4155);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=L,L.WritableState=S;var o,a={deprecate:n(4927)},c=n(2503),h=n(8764).Buffer,u=n.g.Uint8Array||function(){},l=n(1195),f=n(2457).getHighWaterMark,d=n(4281).q,p=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,E=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function T(){}function S(t,e,o){r=r||n(6753),t=t||{},"boolean"!=typeof o&&(o=e instanceof r),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,s=n.writecb;if("function"!=typeof s)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,s){--e.pendingcb,n?(i.nextTick(s,r),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,r)):(s(r),t._writableState.errorEmitted=!0,_(t,r),I(t,e))}(t,n,r,e,s);else{var o=x(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||k(t,n),r?i.nextTick(A,t,n,o,s):A(t,n,o,s)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function L(t){var e=this instanceof(r=r||n(6753));if(!e&&!o.call(L,this))return new L(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function O(t,e,n,r,i,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new E("write")):n?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function A(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var a=0,c=!0;n;)i[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;i.allBuffers=c,O(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;n;){var h=n.chunk,u=n.encoding,l=n.callback;if(O(t,e,!1,e.objectMode?1:h.length,h,u,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(n){e.pendingcb--,n&&_(t,n),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var n=x(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}n(5717)(L,c),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===L&&t&&t._writableState instanceof S}})):o=function(t){return t instanceof this},L.prototype.pipe=function(){_(this,new b)},L.prototype.write=function(t,e,n){var r,s=this._writableState,o=!1,a=!s.objectMode&&(r=t,h.isBuffer(r)||r instanceof u);return a&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof n&&(n=T),s.ending?function(t,e){var n=new v;_(t,n),i.nextTick(e,n)}(this,n):(a||function(t,e,n,r){var s;return null===n?s=new m:"string"==typeof n||e.objectMode||(s=new p("chunk",["string","Buffer"],n)),!s||(_(t,s),i.nextTick(r,s),!1)}(this,s,t,n))&&(s.pendingcb++,o=function(t,e,n,r,i,s){if(!n){var o=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n)),e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var a=e.objectMode?1:r.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else O(t,e,!1,a,r,i,s);return c}(this,s,a,t,e,n)),o},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},L.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),L.prototype._write=function(t,e,n){n(new y("_write()"))},L.prototype._writev=null,L.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,I(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,r,n),this},Object.defineProperty(L.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),L.prototype.destroy=l.destroy,L.prototype._undestroy=l.undestroy,L.prototype._destroy=function(t,e){e(t)}},5850:(t,e,n)=>{"use strict";var r,i=n(4155);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=n(8610),a=Symbol("lastResolve"),c=Symbol("lastReject"),h=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var n=t[d].read();null!==n&&(t[l]=null,t[a]=null,t[c]=null,e(p(n,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),E=Object.setPrototypeOf((s(r={get stream(){return this[d]},next:function(){var t=this,e=this[h];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,n){i.nextTick((function(){t[h]?n(t[h]):e(p(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(t,e){return function(n,r){t.then((function(){e[u]?n(p(void 0,!0)):e[f](n,r)}),r)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),s(r,"return",(function(){var t=this;return new Promise((function(e,n){t[d].destroy(null,(function(t){t?n(t):e(p(void 0,!0))}))}))})),r),b);t.exports=function(t){var e,n=Object.create(E,(s(e={},d,{value:t,writable:!0}),s(e,a,{value:null,writable:!0}),s(e,c,{value:null,writable:!0}),s(e,h,{value:null,writable:!0}),s(e,u,{value:t._readableState.endEmitted,writable:!0}),s(e,f,{value:function(t,e){var r=n[d].read();r?(n[l]=null,n[a]=null,n[c]=null,t(p(r,!1))):(n[a]=t,n[c]=e)},writable:!0}),e));return n[l]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[c];return null!==e&&(n[l]=null,n[a]=null,n[c]=null,e(t)),void(n[h]=t)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[c]=null,r(p(void 0,!0))),n[u]=!0})),t.on("readable",g.bind(null,n)),n}},7327:(t,e,n)=>{"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(8764).Buffer,a=n(2361).inspect,c=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,n;return e=t,n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,n,r,i=o.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=i,r=a,o.prototype.copy.call(e,n,r),a+=s.data.length,s=s.next;return i}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?r+=i:r+=i.slice(0,t),0==(t-=s)){s===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,s=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,s),0==(t-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,e}},{key:c,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],n&&s(e.prototype,n),t}()},1195:(t,e,n)=>{"use strict";var r=n(4155);function i(t,e){o(t,e),s(t)}function s(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(o,this,t)):r.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?n._writableState?n._writableState.errorEmitted?r.nextTick(s,n):(n._writableState.errorEmitted=!0,r.nextTick(i,n,t)):r.nextTick(i,n,t):e?(r.nextTick(s,n),e(t)):r.nextTick(s,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,n)=>{"use strict";var r=n(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,s){if("function"==typeof n)return t(e,null,n);n||(n={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(s||i);var o=n.readable||!1!==n.readable&&e.readable,a=n.writable||!1!==n.writable&&e.writable,c=function(){e.writable||u()},h=e._writableState&&e._writableState.finished,u=function(){a=!1,h=!0,o||s.call(e)},l=e._readableState&&e._readableState.endEmitted,f=function(){o=!1,l=!0,a||s.call(e)},d=function(t){s.call(e,t)},p=function(){var t;return o&&!l?(e._readableState&&e._readableState.ended||(t=new r),s.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new r),s.call(e,t)):void 0},y=function(){e.req.on("finish",u)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",u),e.on("abort",p),e.req?y():e.on("request",y)):a&&!e._writableState&&(e.on("end",c),e.on("close",c)),e.on("end",f),e.on("finish",u),!1!==n.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",u),e.removeListener("abort",p),e.removeListener("request",y),e.req&&e.req.removeListener("finish",u),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",u),e.removeListener("end",f),e.removeListener("error",d),e.removeListener("close",p)}}},5167:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,n)=>{"use strict";var r,i=n(4281).q,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function c(t){t()}function h(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var u,l=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var f=e.map((function(t,i){var s=i<e.length-1;return function(t,e,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;t.on("close",(function(){a=!0})),void 0===r&&(r=n(8610)),r(t,{readable:e,writable:i},(function(t){if(t)return s(t);a=!0,s()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new o("pipe"))}}(t,s,i>0,(function(t){u||(u=t),t&&f.forEach(c),s||(f.forEach(c),l(u))}))}));return e.reduce(h)}},2457:(t,e,n)=>{"use strict";var r=n(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},2503:(t,e,n)=>{t.exports=n(7187).EventEmitter},8473:(t,e,n)=>{(e=t.exports=n(9481)).Stream=e,e.Readable=e,e.Writable=n(4229),e.Duplex=n(6753),e.Transform=n(4605),e.PassThrough=n(2725),e.finished=n(8610),e.pipeline=n(9946)},9967:(t,e,n)=>{t.exports=function(t,e,n){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,s,o,a,c,h,u=!0;function l(t){function e(){n&&n(t,i),n=null}u?r(e):e()}function f(e,n,r){if(i[e]=r,n&&(c=!0),0==--o||n)l(n);else if(!c&&h<s){let e;a?(e=a[h],h+=1,t[e]((function(t,n){f(e,t,n)}))):(e=h,h+=1,t[e]((function(t,n){f(e,t,n)})))}}Array.isArray(t)?(i=[],o=s=t.length):(a=Object.keys(t),i={},o=s=a.length),h=e,o?a?a.some((function(n,r){return t[n]((function(t,e){f(n,t,e)})),r===e-1})):t.some((function(t,n){return t((function(t,e){f(n,t,e)})),n===e-1})):l(null),u=!1};const r=n(4375)},2553:(t,e,n)=>{"use strict";var r=n(396).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=u,this.end=l,e=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=s,s.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=o(e[r]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(e[r]))>=0?(i>0&&(t.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(e[r]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,n)=>{var r=n(8764),i=r.Buffer;function s(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(s(r,e),e.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const n=t.reduce(((t,n,r,i)=>(e.ngramLengths.forEach((e=>{var s=i.slice(r,r+e);s.length===e&&(n=JSON.stringify(s),t[n]=t[n]||[],t[n].push(r))})),t)),{});return Object.keys(n).map((t=>({term:JSON.parse(t),positions:n[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},3692:t=>{"use strict";function e(t){return Object.prototype.toString.call(t)}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function r(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)}var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=Object.prototype.hasOwnProperty||function(t,e){return e in t};function o(t){if("object"==typeof t&&null!==t){var s;if(n(t))s=[];else if("[object Date]"===e(t))s=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))s=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))s={message:t.message};else if(function(t){return"[object Boolean]"===e(t)}(t)||function(t){return"[object Number]"===e(t)}(t)||function(t){return"[object String]"===e(t)}(t))s=Object(t);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)s={};else{var o=t.constructor&&t.constructor.prototype||t.__proto__||{},a=function(){};a.prototype=o,s=new a}return r(i(t),(function(e){s[e]=t[e]})),s}return t}function a(t,e,a){var c=[],h=[],u=!0;return function t(l){var f=a?o(l):l,d={},p=!0,y={node:f,node_:l,path:[].concat(c),parent:h[h.length-1],parents:h,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(p=!1)},delete:function(t){delete y.parent.node[y.key],t&&(p=!1)},remove:function(t){n(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(p=!1)},keys:null,before:function(t){d.before=t},after:function(t){d.after=t},pre:function(t){d.pre=t},post:function(t){d.post=t},stop:function(){u=!1},block:function(){p=!1}};if(!u)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=i(y.node)),y.isLeaf=0===y.keys.length;for(var t=0;t<h.length;t++)if(h[t].node_===l){y.circular=h[t];break}}else y.isLeaf=!0,y.keys=null;y.notLeaf=!y.isLeaf,y.notRoot=!y.isRoot}g();var b=e.call(y,y.node);return void 0!==b&&y.update&&y.update(b),d.before&&d.before.call(y,y.node),p?("object"!=typeof y.node||null===y.node||y.circular||(h.push(y),g(),r(y.keys,(function(e,n){c.push(e),d.pre&&d.pre.call(y,y.node[e],e);var r=t(y.node[e]);a&&s.call(y.node,e)&&(y.node[e]=r.node),r.isLast=n===y.keys.length-1,r.isFirst=0===n,d.post&&d.post.call(y,r),c.pop()})),h.pop()),d.after&&d.after.call(y,y.node),y):y}(t).node}function c(t){this.value=t}function h(t){return new c(t)}c.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!s.call(e,r))return;e=e[r]}return e},c.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!s.call(e,r))return!1;e=e[r]}return!0},c.prototype.set=function(t,e){for(var n=this.value,r=0;r<t.length-1;r++){var i=t[r];s.call(n,i)||(n[i]={}),n=n[i]}return n[t[r]]=e,e},c.prototype.map=function(t){return a(this.value,t,!0)},c.prototype.forEach=function(t){return this.value=a(this.value,t,!1),this.value},c.prototype.reduce=function(t,e){var n=1===arguments.length,r=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(r=t.call(this,r,e))})),r},c.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},c.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},c.prototype.clone=function(){var t=[],e=[];return function n(s){for(var a=0;a<t.length;a++)if(t[a]===s)return e[a];if("object"==typeof s&&null!==s){var c=o(s);return t.push(s),e.push(c),r(i(s),(function(t){c[t]=n(s[t])})),t.pop(),e.pop(),c}return s}(this.value)},r(i(c.prototype),(function(t){h[t]=function(e){var n=[].slice.call(arguments,1),r=new c(e);return r[t].apply(r,n)}})),t.exports=h},4927:(t,e,n)=>{function r(t){try{if(!n.g.localStorage)return!1}catch(t){return!1}var e=n.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,n=(r,i)=>new Promise((async s=>{return null===r?s([null,"1.00"]):(o=r)&&0===Object.keys(o).length&&Object.getPrototypeOf(o)===Object.prototype?s([[],"1.00"]):Number.isInteger(r)?s([r,r]):e(r)?s(t.tokenizer(r,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(r)?s((a=r,new Promise((async e=>{const r={};for(const e in a)r[e]=await n(a[e],e,t);return e(r)})))):(t=>Array.isArray(t))(r)?s((c=r,Promise.all(c.map(n)))):s(r);var o,a,c})),r=async r=>new Promise((async i=>{e(r)&&(r={body:r}),Object.prototype.hasOwnProperty.call(r,"_id")||(r._id=t.idGenerator.next().value);const s={};for(const t in r)s[t]="_id"!==t?await n(r[t],t):r[t];return i(s)}));return{processDocuments:t=>Promise.all(t.map(r))}}},2225:(t,e,n)=>{const r=n(9203),i=n(7155),{LRUCache:s}=n(4456),o=n(6291),a=n(6761),c=n(4147),h=t=>new Promise((async e=>{const r=new s({max:1e3}),c=new((await Promise.resolve().then(n.bind(n,5613))).default)({concurrency:1}),h=a(t,r,c),u=o(t,r);return h._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:r,_PAGE:u.PAGE,_SCORE:u.SCORE,_SEARCH:u.SEARCH,_SORT:u.SORT,DELETE:h.DELETE,FLUSH:h.FLUSH,IMPORT:h.IMPORT,PUT:h.PUT,PUT_RAW:h.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:u.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:u.DICTIONARY,DISTINCT:u.DISTINCT,DOCUMENTS:u.DOCUMENTS,DOCUMENT_COUNT:u.DOCUMENT_COUNT,DOCUMENT_VECTORS:u.DOCUMENT_VECTORS,EXPORT:t.fii.EXPORT,FACETS:u.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:u.QUERY,SEARCH:u.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,n)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t)),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),r(t).then((n=>e(Object.assign({fii:n},t))))))))(t).then(h).then((t=>(t=>new Promise(((e,n)=>{const r=["CREATED_WITH"],i="search-index@"+c.version;return t.INDEX.STORE.get(r,t.INDEX.LEVEL_OPTIONS).then((t=>i===t?e():n(new Error("This index was created with "+t+", you are running "+i)))).catch((n=>t.INDEX.STORE.put(r,i,t.INDEX.LEVEL_OPTIONS).then(e)))})))(t).then((()=>t))))},6291:(t,e,n)=>{const{EntryStream:r}=n(6741);t.exports=(t,e)=>{const n=e=>new Promise(((n,i)=>{const s=[];new r(t.fii.STORE,{gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e,...t.fii.LEVEL_OPTIONS}).on("data",(t=>s.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>n(s)))})),i=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e],t.fii.LEVEL_OPTIONS).catch((t=>null))))):n(),s=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),a=(t,e)=>{const n=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,r=n+e.SIZE||void 0;return t.slice(n,r)},c=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const n=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),r=t=>(t||[]).filter(n);return new Promise((i=>i("TFIDF"===e.TYPE?u().then((e=>t.map(((t,r,i)=>{const s=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(n).reduce(((t,e)=>t+s*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+r(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:r(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+r(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:r(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))},h=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._id<e._id?-1:t._id>e._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._score<e._score?1:t._score>e._score?-1:0,ASCENDING:(t,e)=>t._score<e._score?-1:t._score>e._score?1:0}}[e.TYPE][e.DIRECTION])),u=()=>t.fii.STORE.get(["DOCUMENT_COUNT"],t.fii.LEVEL_OPTIONS),l=(e,r={})=>{const s=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,r.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(s),r.PIPELINE):e.GET?t.fii.GET(e.GET,r.PIPELINE):e.NOT?t.fii.NOT(s(e.NOT.INCLUDE),s(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(s),r.PIPELINE):e.ALL_DOCUMENTS?n(e.ALL_DOCUMENTS):void 0;return s(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>r.BUCKETS?t.fii.BUCKETS(...r.BUCKETS).then((n=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(n,e.RESULT)}))):e)).then((n=>r.FACETS?n.RESULT.length?e.ALL_DOCUMENTS?o(...r.FACETS).then((t=>Object.assign(n,{FACETS:t}))):o(...r.FACETS).then((e=>Object.assign(n,{FACETS:t.fii.AGGREGATION_FILTER(e,n.RESULT)}))):Object.assign(n,{FACETS:[]}):n)).then((t=>{return r.WEIGHT?Object.assign({RESULT:(e=t.RESULT,n=r.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(n.forEach((e=>{let n=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(n=!0):e.FIELD?e.FIELD===t.FIELD&&(n=!0):e.VALUE&&e.VALUE===t.VALUE&&(n=!0),n&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t))))},t):t;var e,n})).then((t=>r.SCORE?c(t.RESULT,r.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,r.SORT?{RESULT:h(t.RESULT,r.SORT)}:{}))).then((t=>Object.assign(t,r.PAGE?{RESULT:a(t.RESULT,r.PAGE)}:{}))).then((t=>r.DOCUMENTS?i(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,n)=>Object.assign(t,{_doc:e[n]})))}))):t))},f=(t,n)=>new Promise((r=>(n=JSON.stringify(n),e.has(n)?r(e.get(n)):t.then((t=>e.set(n,t))).then((()=>r(e.get(n)))))));return{ALL_DOCUMENTS:n,DICTIONARY:t=>f((t=>s(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:s,DOCUMENTS:(...t)=>f(i(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:u,DOCUMENT_VECTORS:(...e)=>Promise.all(e.map((e=>t.fii.STORE.get(["DOC",e],t.fii.LEVEL_OPTIONS).catch((t=>null))))),FACETS:o,PAGE:a,QUERY:(t,e)=>f(l(t,e),{QUERY:[t,e]}),SCORE:c,SEARCH:(t,e)=>f(((t,e)=>l({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:h}}},7155:(t,e,n)=>{const r=n(971),{ngraminator:i}=n(6349),s=([t,e,n])=>Promise.resolve([t.match(n.tokenSplitRegex)||[],e,n]),o=([t,e,n])=>[n.skipFields.includes(e)?[]:t,e,n],a=([t,e,n])=>Promise.resolve([t.map((t=>n.caseSensitive?t:t.toLowerCase())),e,n]),c=([t,e,n])=>{const{fields:r,values:i}=n.replace,s=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?r?r.includes(e)?Promise.resolve([s(),e,n]):Promise.resolve([t,e,n]):Promise.resolve([s(),e,n]):Promise.resolve([t,e,n])},h=([t,e,n])=>{let{fields:r,lengths:s,join:o=" "}=n.ngrams;return r||(r=[e]),s&&r.includes(e)?[i(t.filter((t=>null!==t)),s).map((t=>t.join(o))),e,n]:Promise.resolve([t,e,n])},u=([t,e,n])=>[t.filter((t=>!n.stopwords.includes(t.toLowerCase()))),e,n],l=([t,e,n])=>{const i=r(t),s=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/s).toFixed(2)])).sort(),e,n])};e.SPY=([t,e,n])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,n])),e.tokenizer=(t,e,n)=>s([t,e,n]).then(o).then(a).then(c).then(h).then(u).then(l).then((([t,e,n])=>t)),e.SPLIT=s,e.SKIP=o,e.LOWACASE=a,e.REPLACE=c,e.NGRAMS=h,e.STOPWORDS=u,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,n)=>{const r=n(1861);t.exports=(t,e,n)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"],t.fii.LEVEL_OPTIONS).then((n=>t.fii.STORE.put(["DOCUMENT_COUNT"],+n+e,t.fii.LEVEL_OPTIONS))).catch((n=>t.fii.STORE.put(["DOCUMENT_COUNT"],e,t.fii.LEVEL_OPTIONS))),s=(n,r,i)=>(e.clear(),Promise.all(n.map(((e,n)=>t.fii.STORE.put(["DOC_RAW",r[n]],i?{}:e,t.fii.LEVEL_OPTIONS)))).then((t=>n.map(((t,e)=>({_id:r[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...n)=>{return r=n,t.fii.DELETE(r,t.fii.LEVEL_OPTIONS).then((n=>{e.clear();const r=n.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(r.map((e=>t.fii.STORE.del(["DOC_RAW",e._id],t.fii.LEVEL_OPTIONS)))),(i=r.length,t.fii.STORE.get(["DOCUMENT_COUNT"],t.fii.LEVEL_OPTIONS).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i,t.fii.LEVEL_OPTIONS))))]).then((()=>n));var i}));var r},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.clear();const n=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:n},{type:"put",key:["~LAST_UPDATED"],value:n},{type:"put",key:["DOCUMENT_COUNT"],value:0}],t.fii.LEVEL_OPTIONS)})).then((()=>!0)),IMPORT:n=>(e.clear(),Promise.resolve(t.fii.IMPORT(n))),PUT:(o,a)=>n.add((()=>((n,o)=>(e.clear(),o=Object.assign(t,o),r(t).processDocuments(n).then((e=>t.fii.PUT(e,o,t.fii.LEVEL_OPTIONS).then((e=>Promise.all([s(n,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(o,a))),PUT_RAW:s,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},4456:(t,e,n)=>{"use strict";var r=n(4155);Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,o="object"==typeof r&&r?r:{},a=(t,e,n,r)=>{"function"==typeof o.emitWarning?o.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)};let c=globalThis.AbortController,h=globalThis.AbortSignal;if(void 0===c){h=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},c=class{constructor(){e()}signal=new h;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==o.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,a("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const u=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),l=t=>u(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(t){super(t),this.fill(0)}}class d{heap;length;static#t=!1;static create(t){const e=l(t);if(!e)return[];d.#t=!0;const n=new d(t,e);return d.#t=!1,n}constructor(t,e){if(!d.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class p{#e;#n;#r;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#a;#c;#h;#u;#l;#f;#d;#p;#y;#g;#b;#E;#m;#v;#w;#_;static unsafeExposeInternals(t){return{starts:t.#E,ttls:t.#m,sizes:t.#b,keyMap:t.#c,keyList:t.#h,valList:t.#u,next:t.#l,prev:t.#f,get head(){return t.#d},get tail(){return t.#p},free:t.#y,isBackgroundFetch:e=>t.#T(e),backgroundFetch:(e,n,r,i)=>t.#S(e,n,r,i),moveToTail:e=>t.#L(e),indexes:e=>t.#O(e),rindexes:e=>t.#A(e),isStale:e=>t.#k(e)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#a}get size(){return this.#o}get fetchMethod(){return this.#s}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(t){const{max:e=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:h,dispose:f,disposeAfter:y,noDisposeOnSet:g,noUpdateTTL:b,maxSize:E=0,maxEntrySize:m=0,sizeCalculation:v,fetchMethod:w,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:L,ignoreFetchAbort:O}=t;if(0!==e&&!u(e))throw new TypeError("max option must be a nonnegative integer");const A=e?l(e):Array;if(!A)throw new Error("invalid max value: "+e);if(this.#e=e,this.#n=E,this.maxEntrySize=m||this.#n,this.sizeCalculation=v,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=w,this.#w=!!w,this.#c=new Map,this.#h=new Array(e).fill(void 0),this.#u=new Array(e).fill(void 0),this.#l=new A(e),this.#f=new A(e),this.#d=0,this.#p=0,this.#y=d.create(e),this.#o=0,this.#a=0,"function"==typeof f&&(this.#r=f),"function"==typeof y?(this.#i=y,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#v=!!this.#r,this.#_=!!this.#i,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#n&&!u(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#x()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=u(r)||0===r?r:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#e&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){const t="LRU_CACHE_UNBOUNDED";(t=>!s.has(t))(t)&&(s.add(t),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,p))}}getRemainingTTL(t){return this.#c.has(t)?1/0:0}#R(){const t=new f(this.#e),e=new f(this.#e);this.#m=t,this.#E=e,this.#I=(n,r,s=i.now())=>{if(e[n]=0!==r?s:0,t[n]=r,0!==r&&this.ttlAutopurge){const t=setTimeout((()=>{this.#k(n)&&this.delete(this.#h[n])}),r+1);t.unref&&t.unref()}},this.#C=n=>{e[n]=0!==t[n]?i.now():0},this.#N=(i,s)=>{if(t[s]){const o=t[s],a=e[s];i.ttl=o,i.start=a,i.now=n||r();const c=i.now-a;i.remainingTTL=o-c}};let n=0;const r=()=>{const t=i.now();if(this.ttlResolution>0){n=t;const e=setTimeout((()=>n=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const s=this.#c.get(i);if(void 0===s)return 0;const o=t[s],a=e[s];return 0===o||0===a?1/0:o-((n||r())-a)},this.#k=i=>0!==t[i]&&0!==e[i]&&(n||r())-e[i]>t[i]}#C=()=>{};#N=()=>{};#I=()=>{};#k=()=>!1;#x(){const t=new f(this.#e);this.#a=0,this.#b=t,this.#D=e=>{this.#a-=t[e],t[e]=0},this.#U=(t,e,n,r)=>{if(this.#T(e))return 0;if(!u(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(e,t),!u(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#P=(e,n,r)=>{if(t[e]=n,this.#n){const n=this.#n-t[e];for(;this.#a>n;)this.#M(!0)}this.#a+=t[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.#a)}}#D=t=>{};#P=(t,e,n)=>{};#U=(t,e,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#p;this.#B(e)&&(!t&&this.#k(e)||(yield e),e!==this.#d);)e=this.#f[e]}*#A({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#d;this.#B(e)&&(!t&&this.#k(e)||(yield e),e!==this.#p);)e=this.#l[e]}#B(t){return void 0!==t&&this.#c.get(this.#h[t])===t}*entries(){for(const t of this.#O())void 0===this.#u[t]||void 0===this.#h[t]||this.#T(this.#u[t])||(yield[this.#h[t],this.#u[t]])}*rentries(){for(const t of this.#A())void 0===this.#u[t]||void 0===this.#h[t]||this.#T(this.#u[t])||(yield[this.#h[t],this.#u[t]])}*keys(){for(const t of this.#O()){const e=this.#h[t];void 0===e||this.#T(this.#u[t])||(yield e)}}*rkeys(){for(const t of this.#A()){const e=this.#h[t];void 0===e||this.#T(this.#u[t])||(yield e)}}*values(){for(const t of this.#O())void 0===this.#u[t]||this.#T(this.#u[t])||(yield this.#u[t])}*rvalues(){for(const t of this.#A())void 0===this.#u[t]||this.#T(this.#u[t])||(yield this.#u[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const n of this.#O()){const r=this.#u[n],i=this.#T(r)?r.__staleWhileFetching:r;if(void 0!==i&&t(i,this.#h[n],this))return this.get(this.#h[n],e)}}forEach(t,e=this){for(const n of this.#O()){const r=this.#u[n],i=this.#T(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#h[n],this)}}rforEach(t,e=this){for(const n of this.#A()){const r=this.#u[n],i=this.#T(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#h[n],this)}}purgeStale(){let t=!1;for(const e of this.#A({allowStale:!0}))this.#k(e)&&(this.delete(this.#h[e]),t=!0);return t}dump(){const t=[];for(const e of this.#O({allowStale:!0})){const n=this.#h[e],r=this.#u[e],s=this.#T(r)?r.__staleWhileFetching:r;if(void 0===s||void 0===n)continue;const o={value:s};if(this.#m&&this.#E){o.ttl=this.#m[e];const t=i.now()-this.#E[e];o.start=Math.floor(Date.now()-t)}this.#b&&(o.size=this.#b[e]),t.unshift([n,o])}return t}load(t){this.clear();for(const[e,n]of t){if(n.start){const t=Date.now()-n.start;n.start=i.now()-t}this.set(e,n.value,n)}}set(t,e,n={}){if(void 0===e)return this.delete(t),this;const{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const h=this.#U(t,e,n.size||0,o);if(this.maxEntrySize&&h>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let u=0===this.#o?void 0:this.#c.get(t);if(void 0===u)u=0===this.#o?this.#p:0!==this.#y.length?this.#y.pop():this.#o===this.#e?this.#M(!1):this.#o,this.#h[u]=t,this.#u[u]=e,this.#c.set(t,u),this.#l[this.#p]=u,this.#f[u]=this.#p,this.#p=u,this.#o++,this.#P(u,h,a),a&&(a.set="add"),c=!1;else{this.#L(u);const n=this.#u[u];if(e!==n){if(this.#w&&this.#T(n)?n.__abortController.abort(new Error("replaced")):s||(this.#v&&this.#r?.(n,t,"set"),this.#_&&this.#g?.push([n,t,"set"])),this.#D(u),this.#P(u,h,a),this.#u[u]=e,a){a.set="replace";const t=n&&this.#T(n)?n.__staleWhileFetching:n;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===r||this.#m||this.#R(),this.#m&&(c||this.#I(u,r,i),a&&this.#N(a,u)),!s&&this.#_&&this.#g){const t=this.#g;let e;for(;e=t?.shift();)this.#i?.(...e)}return this}pop(){try{for(;this.#o;){const t=this.#u[this.#d];if(this.#M(!0),this.#T(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#_&&this.#g){const t=this.#g;let e;for(;e=t?.shift();)this.#i?.(...e)}}}#M(t){const e=this.#d,n=this.#h[e],r=this.#u[e];return this.#w&&this.#T(r)?r.__abortController.abort(new Error("evicted")):(this.#v||this.#_)&&(this.#v&&this.#r?.(r,n,"evict"),this.#_&&this.#g?.push([r,n,"evict"])),this.#D(e),t&&(this.#h[e]=void 0,this.#u[e]=void 0,this.#y.push(e)),1===this.#o?(this.#d=this.#p=0,this.#y.length=0):this.#d=this.#l[e],this.#c.delete(n),this.#o--,e}has(t,e={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=e,i=this.#c.get(t);if(void 0!==i){const t=this.#u[i];if(this.#T(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#k(i))return n&&this.#C(i),r&&(r.has="hit",this.#N(r,i)),!0;r&&(r.has="stale",this.#N(r,i))}else r&&(r.has="miss");return!1}peek(t,e={}){const{allowStale:n=this.allowStale}=e,r=this.#c.get(t);if(void 0!==r&&(n||!this.#k(r))){const t=this.#u[r];return this.#T(t)?t.__staleWhileFetching:t}}#S(t,e,n,r){const i=void 0===e?void 0:this.#u[e];if(this.#T(i))return i;const s=new c,{signal:o}=n;o?.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:r},h=(r,i=!1)=>{const{aborted:o}=s.signal,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(s.signal.reason);const h=l;return this.#u[e]===l&&(void 0===r?h.__staleWhileFetching?this.#u[e]=h.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,r,a.options))),r},u=r=>{const{aborted:i}=s.signal,o=i&&n.allowStaleOnFetchAbort,a=o||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,h=l;if(this.#u[e]===l&&(c&&void 0!==h.__staleWhileFetching?o||(this.#u[e]=h.__staleWhileFetching):this.delete(t)),a)return n.status&&void 0!==h.__staleWhileFetching&&(n.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw r};n.status&&(n.status.fetchDispatched=!0);const l=new Promise(((e,r)=>{const o=this.#s?.(t,i,a);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),r),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(e(void 0),n.allowStaleOnFetchAbort&&(e=t=>h(t,!0)))}))})).then(h,(t=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=t),u(t)))),f=Object.assign(l,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,f,{...a.options,status:void 0}),e=this.#c.get(t)):this.#u[e]=f,f}#T(t){if(!this.#w)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof c}async fetch(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:y=!1,status:g,signal:b}=e;if(!this.#w)return g&&(g.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});const E={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:g,signal:b};let m=this.#c.get(t);if(void 0===m){g&&(g.fetch="miss");const e=this.#S(t,m,E,p);return e.__returned=e}{const e=this.#u[m];if(this.#T(e)){const t=n&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#k(m);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(m),r&&this.#C(m),g&&this.#N(g,m),e;const s=this.#S(t,m,E,p),o=void 0!==s.__staleWhileFetching&&n;return g&&(g.fetch=i?"stale":"refresh",o&&i&&(g.returnedStale=!0)),o?s.__staleWhileFetching:s.__returned=s}}get(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}=e,o=this.#c.get(t);if(void 0!==o){const e=this.#u[o],a=this.#T(e);return s&&this.#N(s,o),this.#k(o)?(s&&(s.get="stale"),a?(s&&n&&void 0!==e.__staleWhileFetching&&(s.returnedStale=!0),n?e.__staleWhileFetching:void 0):(i||this.delete(t),s&&n&&(s.returnedStale=!0),n?e:void 0)):(s&&(s.get="hit"),a?e.__staleWhileFetching:(this.#L(o),r&&this.#C(o),e))}s&&(s.get="miss")}#j(t,e){this.#f[e]=t,this.#l[t]=e}#L(t){t!==this.#p&&(t===this.#d?this.#d=this.#l[t]:this.#j(this.#f[t],this.#l[t]),this.#j(this.#p,t),this.#p=t)}delete(t){let e=!1;if(0!==this.#o){const n=this.#c.get(t);if(void 0!==n)if(e=!0,1===this.#o)this.clear();else{this.#D(n);const e=this.#u[n];this.#T(e)?e.__abortController.abort(new Error("deleted")):(this.#v||this.#_)&&(this.#v&&this.#r?.(e,t,"delete"),this.#_&&this.#g?.push([e,t,"delete"])),this.#c.delete(t),this.#h[n]=void 0,this.#u[n]=void 0,n===this.#p?this.#p=this.#f[n]:n===this.#d?this.#d=this.#l[n]:(this.#l[this.#f[n]]=this.#l[n],this.#f[this.#l[n]]=this.#f[n]),this.#o--,this.#y.push(n)}}if(this.#_&&this.#g?.length){const t=this.#g;let e;for(;e=t?.shift();)this.#i?.(...e)}return e}clear(){for(const t of this.#A({allowStale:!0})){const e=this.#u[t];if(this.#T(e))e.__abortController.abort(new Error("deleted"));else{const n=this.#h[t];this.#v&&this.#r?.(e,n,"delete"),this.#_&&this.#g?.push([e,n,"delete"])}}if(this.#c.clear(),this.#u.fill(void 0),this.#h.fill(void 0),this.#m&&this.#E&&(this.#m.fill(0),this.#E.fill(0)),this.#b&&this.#b.fill(0),this.#d=0,this.#p=0,this.#y.length=0,this.#a=0,this.#o=0,this.#_&&this.#g){const t=this.#g;let e;for(;e=t?.shift();)this.#i?.(...e)}}}e.LRUCache=p},5613:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AbortError:()=>j,default:()=>F});var r=n(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class s extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const o=t=>void 0===globalThis.DOMException?new s(t):new DOMException(t),a=t=>{const e=void 0===t.reason?o("This operation was aborted."):t.reason;return e instanceof Error?e:o(e)};var c,h=function(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)};class u{constructor(){c.set(this,[])}enqueue(t,e){const n={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&h(this,c,"f")[this.size-1].priority>=e.priority)return void h(this,c,"f").push(n);const r=function(t,e,n){let r=0,i=t.length;for(;i>0;){const n=Math.trunc(i/2);let o=r+n;s=t[o],e.priority-s.priority<=0?(r=++o,i-=n+1):i=n}var s;return r}(h(this,c,"f"),n);h(this,c,"f").splice(r,0,n)}dequeue(){const t=h(this,c,"f").shift();return null==t?void 0:t.run}filter(t){return h(this,c,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return h(this,c,"f").length}}c=new WeakMap;var l,f,d,p,y,g,b,E,m,v,w,_,T,S,L,O,A,k,x,R,I,C,N,D,U,P,M=function(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},B=function(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)};class j extends Error{}class F extends r{constructor(t){var e,n,r,i;if(super(),l.add(this),f.set(this,void 0),d.set(this,void 0),p.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),E.set(this,void 0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),_.set(this,0),T.set(this,void 0),S.set(this,void 0),L.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:u,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(n=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==n?n:""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(i=null===(r=t.interval)||void 0===r?void 0:r.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);M(this,f,t.carryoverConcurrencyCount,"f"),M(this,d,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),M(this,y,t.intervalCap,"f"),M(this,g,t.interval,"f"),M(this,v,new t.queueClass,"f"),M(this,w,t.queueClass,"f"),this.concurrency=t.concurrency,this.timeout=t.timeout,M(this,L,!0===t.throwOnTimeout,"f"),M(this,S,!1===t.autoStart,"f")}get concurrency(){return B(this,T,"f")}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);M(this,T,t,"f"),B(this,l,"m",D).call(this)}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:B(this,L,"f"),...e},new Promise(((n,r)=>{B(this,v,"f").enqueue((async()=>{var s,o,c;M(this,_,(o=B(this,_,"f"),++o),"f"),M(this,p,(c=B(this,p,"f"),++c),"f");try{if(null===(s=e.signal)||void 0===s?void 0:s.aborted)throw new j("The task was aborted.");let r=t({signal:e.signal});e.timeout&&(r=function(t,e,n,r){let s;const o=new Promise(((o,c)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((r={customTimers:{setTimeout,clearTimeout},...r}).signal){const{signal:t}=r;t.aborted&&c(a(t)),t.addEventListener("abort",(()=>{c(a(t))}))}s=r.customTimers.setTimeout.call(void 0,(()=>{const r=n instanceof Error?n:new i(`Promise timed out after ${e} milliseconds`);"function"==typeof t.cancel&&t.cancel(),c(r)}),e),(async()=>{try{o(await t)}catch(t){c(t)}finally{r.customTimers.clearTimeout.call(void 0,s)}})()}else o(t)}));return o.clear=()=>{clearTimeout(s),s=void 0},o}(Promise.resolve(r),e.timeout)),e.signal&&(r=Promise.race([r,B(this,l,"m",U).call(this,e.signal)]));const o=await r;n(o),this.emit("completed",o)}catch(t){if(t instanceof i&&!e.throwOnTimeout)return void n();r(t),this.emit("error",t)}finally{B(this,l,"m",k).call(this)}}),e),this.emit("add"),B(this,l,"m",I).call(this)}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return B(this,S,"f")?(M(this,S,!1,"f"),B(this,l,"m",D).call(this),this):this}pause(){M(this,S,!0,"f")}clear(){M(this,v,new(B(this,w,"f")),"f")}async onEmpty(){0!==B(this,v,"f").size&&await B(this,l,"m",P).call(this,"empty")}async onSizeLessThan(t){B(this,v,"f").size<t||await B(this,l,"m",P).call(this,"next",(()=>B(this,v,"f").size<t))}async onIdle(){0===B(this,_,"f")&&0===B(this,v,"f").size||await B(this,l,"m",P).call(this,"idle")}get size(){return B(this,v,"f").size}sizeBy(t){return B(this,v,"f").filter(t).length}get pending(){return B(this,_,"f")}get isPaused(){return B(this,S,"f")}}f=new WeakMap,d=new WeakMap,p=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,E=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,_=new WeakMap,T=new WeakMap,S=new WeakMap,L=new WeakMap,l=new WeakSet,O=function(){return B(this,d,"f")||B(this,p,"f")<B(this,y,"f")},A=function(){return B(this,_,"f")<B(this,T,"f")},k=function(){var t;M(this,_,(t=B(this,_,"f"),--t),"f"),B(this,l,"m",I).call(this),this.emit("next")},x=function(){B(this,l,"m",N).call(this),B(this,l,"m",C).call(this),M(this,m,void 0,"f")},R=function(){const t=Date.now();if(void 0===B(this,E,"f")){const e=B(this,b,"f")-t;if(!(e<0))return void 0===B(this,m,"f")&&M(this,m,setTimeout((()=>{B(this,l,"m",x).call(this)}),e),"f"),!0;M(this,p,B(this,f,"f")?B(this,_,"f"):0,"f")}return!1},I=function(){if(0===B(this,v,"f").size)return B(this,E,"f")&&clearInterval(B(this,E,"f")),M(this,E,void 0,"f"),this.emit("empty"),0===B(this,_,"f")&&this.emit("idle"),!1;if(!B(this,S,"f")){const t=!B(this,l,"a",R);if(B(this,l,"a",O)&&B(this,l,"a",A)){const e=B(this,v,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&B(this,l,"m",C).call(this),!0)}}return!1},C=function(){B(this,d,"f")||void 0!==B(this,E,"f")||(M(this,E,setInterval((()=>{B(this,l,"m",N).call(this)}),B(this,g,"f")),"f"),M(this,b,Date.now()+B(this,g,"f"),"f"))},N=function(){0===B(this,p,"f")&&0===B(this,_,"f")&&B(this,E,"f")&&(clearInterval(B(this,E,"f")),M(this,E,void 0,"f")),M(this,p,B(this,f,"f")?B(this,_,"f"):0,"f"),B(this,l,"m",D).call(this)},D=function(){for(;B(this,l,"m",I).call(this););},U=async function(t){return new Promise(((e,n)=>{t.addEventListener("abort",(()=>{n(new j("The task was aborted."))}),{once:!0})}))},P=async function(t,e){return new Promise((n=>{const r=()=>{e&&!e()||(this.off(t,r),n())};this.on(t,r)}))}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"4.0.0","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","classic-level":"^1.3.0","doctoc":"2.2.1","fuzzyset":"1.0.5","http-server":"14.1.1","level-out":"^1.0.1","memory-level":"^1.0.0","open-cli":"7.2.0","os-browserify":"^0.3.0","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"17.1.0","stemmer":"1.0.5","stopword":"2.0.8","stream-browserify":"^3.0.0","tape":"5.6.3","tape-run":"^10.0.0","webpack":"5.87.0","webpack-cli":"5.1.4","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"12.0.0","browser-level":"^1.0.1","charwise":"^3.0.1","level-read-stream":"^1.1.0","lru-cache":"10.0.0","memory-level":"^1.0.0","ngraminator":"3.0.2","p-queue":"7.3.4","term-vector":"^1.0.0"}}')}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r=n(2225);SearchIndex=r})();

Callers

nothing calls this directly

Calls 8

#xMethod · 0.95
#RMethod · 0.95
createMethod · 0.80
hasMethod · 0.80
uFunction · 0.70
lFunction · 0.70
aFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected