@byloth/core 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.umd.cjs CHANGED
@@ -1,6 +1,6 @@
1
- (function(a,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(a=typeof globalThis<"u"?globalThis:a||self,h(a.Core={}))})(this,function(a){"use strict";var jt=Object.defineProperty;var At=(a,h,x)=>h in a?jt(a,h,{enumerable:!0,configurable:!0,writable:!0,value:x}):a[h]=x;var l=(a,h,x)=>At(a,typeof h!="symbol"?h+"":h,x);var Y,G,K,H,Q,X,Z,W,U,ee,te,ne,se,ie,re,oe,ae,le,ue,ce,he,fe,de,me,we,ye,_e,pe,be,ge,ve,xe,Se,ke,Te,Ee,Me,Re,Fe,Pe,Ce,Ie,je,Ae,Ne,Oe,ze,$e,qe,De,Ve,Be,Je,Le,Ye,Ge,Ke,He,Qe,Xe,Ze;const h=typeof window<"u"&&typeof window.document<"u",x=typeof process<"u"&&!!((Y=process.versions)!=null&&Y.node),Ue=typeof self=="object"&&((G=self.constructor)==null?void 0:G.name)==="DedicatedWorkerGlobalScope";class f extends(H=Error,K=Symbol.toStringTag,H){constructor(e,t,s="Exception"){super(e);l(this,K,"Exception");this.cause=t,this.name=s,t&&(t instanceof Error?this.stack+=`
1
+ (function(a,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(a=typeof globalThis<"u"?globalThis:a||self,h(a.Core={}))})(this,function(a){"use strict";var At=Object.defineProperty;var Nt=(a,h,x)=>h in a?At(a,h,{enumerable:!0,configurable:!0,writable:!0,value:x}):a[h]=x;var l=(a,h,x)=>Nt(a,typeof h!="symbol"?h+"":h,x);var G,K,H,Q,X,Z,W,U,ee,te,ne,se,ie,re,oe,ae,le,ce,ue,he,fe,de,me,we,ye,_e,pe,be,ge,ve,xe,Se,ke,Te,Ee,Me,Re,Fe,Ce,Pe,Ie,je,Ae,Ne,Oe,ze,qe,$e,De,Ve,Be,Je,Le,Ye,Ge,Ke,He,Qe,Xe,Ze,We;const h=typeof window<"u"&&typeof window.document<"u",x=typeof process<"u"&&!!((G=process.versions)!=null&&G.node),et=typeof self=="object"&&((K=self.constructor)==null?void 0:K.name)==="DedicatedWorkerGlobalScope";class f extends(Q=Error,H=Symbol.toStringTag,Q){constructor(e,t,s="Exception"){super(e);l(this,H,"Exception");this.cause=t,this.name=s,t&&(t instanceof Error?this.stack+=`
2
2
 
3
3
  Caused by ${t.stack}`:this.stack+=`
4
4
 
5
- Caused by ${t}`)}static FromUnknown(e){if(e instanceof f)return e;if(e instanceof Error){const t=new f(e.message);return t.stack=e.stack,t.name=e.name,t}return new f(`${e}`)}}class S extends(X=f,Q=Symbol.toStringTag,X){constructor(e,t,s="FatalErrorException"){e===void 0&&(e="The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team.");super(e,t,s);l(this,Q,"FatalErrorException")}}class z extends(W=S,Z=Symbol.toStringTag,W){constructor(e,t,s="NotImplementedException"){e===void 0&&(e="This feature isn't implemented yet. Please, try again later.");super(e,t,s);l(this,Z,"NotImplementedException")}}class P extends(ee=f,U=Symbol.toStringTag,ee){constructor(e,t,s="FileException"){super(e,t,s);l(this,U,"FileException")}}class et extends(ne=P,te=Symbol.toStringTag,ne){constructor(e,t,s="FileExistsException"){super(e,t,s);l(this,te,"FileExistsException")}}class tt extends(ie=P,se=Symbol.toStringTag,ie){constructor(e,t,s="FileNotFoundException"){super(e,t,s);l(this,se,"FileNotFoundException")}}class b extends(oe=f,re=Symbol.toStringTag,oe){constructor(e,t,s="KeyException"){super(e,t,s);l(this,re,"KeyException")}}class nt extends(le=f,ae=Symbol.toStringTag,le){constructor(e,t,s="NetworkException"){super(e,t,s);l(this,ae,"NetworkException")}}class st extends(ce=f,ue=Symbol.toStringTag,ce){constructor(e,t,s="PermissionException"){super(e,t,s);l(this,ue,"PermissionException")}}class C extends(fe=f,he=Symbol.toStringTag,fe){constructor(e,t,s="ReferenceException"){super(e,t,s);l(this,he,"ReferenceException")}}class y extends(me=f,de=Symbol.toStringTag,me){constructor(e,t,s="RuntimeException"){super(e,t,s);l(this,de,"RuntimeException")}}class $ extends(ye=y,we=Symbol.toStringTag,ye){constructor(e,t,s="EnvironmentException"){super(e,t,s);l(this,we,"EnvironmentException")}}class q extends(pe=f,_e=Symbol.toStringTag,pe){constructor(e,t,s="TimeoutException"){super(e,t,s);l(this,_e,"TimeoutException")}}class it extends(ge=f,be=Symbol.toStringTag,ge){constructor(e,t,s="TypeException"){super(e,t,s);l(this,be,"TypeException")}}class m extends(xe=f,ve=Symbol.toStringTag,xe){constructor(e,t,s="ValueException"){super(e,t,s);l(this,ve,"ValueException")}}class g extends(ke=m,Se=Symbol.toStringTag,ke){constructor(e,t,s="RangeException"){super(e,t,s);l(this,Se,"RangeException")}}class c{constructor(n){l(this,"_iterator");l(this,Te,"SmartIterator");n instanceof Function?this._iterator=n():Symbol.iterator in n?this._iterator=n[Symbol.iterator]():this._iterator=n}every(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return!0;if(!n(t.value,e))return!1;e+=1}}some(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return!1;if(n(t.value,e))return!0;e+=1}}filter(n){const e=this._iterator;return new c(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;n(s.value,t)&&(yield s.value),t+=1}})}map(n){const e=this._iterator;return new c(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;yield n(s.value,t),t+=1}})}reduce(n,e){let t=0,s=e;if(s===void 0){const i=this._iterator.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value,t+=1}for(;;){const i=this._iterator.next();if(i.done)return s;s=n(s,i.value,t),t+=1}}flatMap(n){const e=this._iterator;return new c(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;const i=n(s.value,t);if(i instanceof Array)for(const o of i)yield o;else yield i;t+=1}})}drop(n){const e=this._iterator;return new c(function*(){let t=0;for(;t<n;){if(e.next().done)return;t+=1}for(;;){const s=e.next();if(s.done)return s.value;yield s.value}})}take(n){const e=this._iterator;return new c(function*(){let t=0;for(;t<n;){const s=e.next();if(s.done)return s.value;yield s.value,t+=1}})}find(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return;if(n(t.value,e))return t.value;e+=1}}enumerate(){return this.map((n,e)=>[e,n])}unique(){const n=this._iterator;return new c(function*(){const e=new Set;for(;;){const t=n.next();if(t.done)return t.value;e.has(t.value)||(e.add(t.value),yield t.value)}})}count(){let n=0;for(;;){if(this._iterator.next().done)return n;n+=1}}forEach(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return;n(t.value,e),e+=1}}next(...n){return this._iterator.next(...n)}return(n){return this._iterator.return?this._iterator.return(n):{done:!0,value:n}}throw(n){if(this._iterator.throw)return this._iterator.throw(n);throw n}groupBy(n){return new k(this.map((e,t)=>[n(e,t),e]))}toArray(){return Array.from(this)}[(Te=Symbol.toStringTag,Symbol.iterator)](){return this}}Ee=Symbol.toStringTag;const v=class v{constructor(n){l(this,"_elements");l(this,Ee,"ReducedIterator");this._elements=new c(n)}every(n){for(const[e,[t,s]]of this._elements.enumerate())if(!n(t,s,e))return!1;return!0}some(n){for(const[e,[t,s]]of this._elements.enumerate())if(n(t,s,e))return!0;return!1}filter(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)n(s,i,t)&&(yield[s,i])})}map(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)yield[s,n(s,i,t)]})}reduce(n,e){let t=0,s=e;if(s===void 0){const i=this._elements.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value[1],t+=1}for(const[i,o]of this._elements)s=n(i,s,o,t),t+=1;return s}flatMap(n){const e=this._elements.enumerate();return new k(function*(){for(const[t,[s,i]]of e){const o=n(s,i,t);if(o instanceof Array)for(const u of o)yield[s,u];else yield[s,o]}})}drop(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)t>=n&&(yield[s,i])})}take(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e){if(t>=n)break;yield[s,i]}})}find(n){for(const[e,[t,s]]of this._elements.enumerate())if(n(t,s,e))return s}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new v(function*(){const e=new Set;for(const[t,s]of n)e.has(s)||(e.add(s),yield[t,s])})}count(){let n=0;for(const e of this._elements)n+=1;return n}forEach(n){for(const[e,[t,s]]of this._elements.enumerate())n(t,s,e)}reorganizeBy(n){const e=this._elements.enumerate();return new k(function*(){for(const[t,[s,i]]of e)yield[n(s,i,t),i]})}keys(){const n=this._elements;return new c(function*(){for(const[e]of n)yield e})}entries(){return this._elements}values(){const n=this._elements;return new c(function*(){for(const[e,t]of n)yield t})}toArray(){return Array.from(this.values())}toMap(){return new Map(this.entries())}toObject(){return Object.fromEntries(this.entries())}};let d=v;Me=Symbol.toStringTag;const _=class _{constructor(n){l(this,"_elements");l(this,Me,"AggregatedAsyncIterator");this._elements=new w(n)}async every(n){const e=new Map;for await(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!0];o&&e.set(t,[i+1,await n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}async some(n){const e=new Map;for await(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!1];o||e.set(t,[i+1,await n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}filter(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;await n(s,i,o)&&(yield[s,i]),t.set(s,o+1)}})}map(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;yield[s,await n(s,i,o)],t.set(s,o+1)}})}async reduce(n,e){const t=new Map;for await(const[s,i]of this._elements){let o,u;if(t.has(s))[o,u]=t.get(s);else if(e!==void 0)o=0,e instanceof Function?u=await e(s):u=await e;else{t.set(s,[0,i]);continue}t.set(s,[o+1,await n(s,u,i,o)])}return new d(function*(){for(const[s,[i,o]]of t)yield[s,o]})}flatMap(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0,u=await n(s,i,o);if(u instanceof Array)for(const F of u)yield[s,F];else yield[s,u];t.set(s,o+1)}})}drop(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;if(o<n){t.set(s,o+1);continue}yield[s,i]}})}take(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;o>=n||(yield[s,i],t.set(s,o+1))}})}async find(n){const e=new Map;for await(const[t,s]of this._elements){let[i,o]=e.get(t)??[0,void 0];o===void 0&&(await n(t,s,i)&&(o=s),e.set(t,[i+1,o]))}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new _(async function*(){const e=new Map;for await(const[t,s]of n){const i=e.get(t)??new Set;i.has(s)||(i.add(s),e.set(t,i),yield[t,s])}})}async count(){const n=new Map;for await(const[e]of this._elements){const t=n.get(e)??0;n.set(e,t+1)}return new d(function*(){for(const[e,t]of n)yield[e,t]})}async forEach(n){const e=new Map;for await(const[t,s]of this._elements){const i=e.get(t)??0;await n(t,s,i),e.set(t,i+1)}}reorganizeBy(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;yield[await n(s,i,o),i],t.set(s,o+1)}})}keys(){const n=this._elements;return new w(async function*(){const e=new Set;for await(const[t]of n)e.has(t)||(e.add(t),yield t)})}entries(){return this._elements}values(){const n=this._elements;return new w(async function*(){for await(const[e,t]of n)yield t})}async toArray(){const n=await this.toMap();return Array.from(n.values())}async toMap(){const n=new Map;for await(const[e,t]of this._elements){const s=n.get(e)??[];s.push(t),n.set(e,s)}return n}async toObject(){const n={};for await(const[e,t]of this._elements){const s=n[e]??[];s.push(t),n[e]=s}return n}};let M=_;class w{constructor(n){l(this,"_iterator");l(this,Re,"SmartAsyncIterator");if(n instanceof Function){const e=n();Symbol.asyncIterator in e?this._iterator=e:this._iterator=async function*(){let t=[];for(;;){const s=e.next(...t);if(s.done)return s.value;t=[yield s.value]}}()}else if(Symbol.asyncIterator in n)this._iterator=n[Symbol.asyncIterator]();else if(Symbol.iterator in n){const e=n[Symbol.iterator]();this._iterator=async function*(){for(;;){const t=e.next();if(t.done)return t.value;yield t.value}}()}else this._iterator=async function*(){let e=[];for(;;){const t=await n.next(...e);if(t.done)return t.value;e=[yield t.value]}}()}async every(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return!0;if(!await n(t.value,e))return!1;e+=1}}async some(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return!1;if(await n(t.value,e))return!0;e+=1}}filter(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;await n(s.value,t)&&(yield s.value),t+=1}})}map(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;yield await n(s.value,t),t+=1}})}async reduce(n,e){let t=0,s=e;if(s===void 0){const i=await this._iterator.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value,t+=1}for(;;){const i=await this._iterator.next();if(i.done)return s;s=await n(s,i.value,t),t+=1}}flatMap(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;const i=await n(s.value,t);if(i instanceof Array)for(const o of i)yield o;else yield i;t+=1}})}drop(n){const e=this._iterator;return new w(async function*(){let t=0;for(;t<n;){if((await e.next()).done)return;t+=1}for(;;){const s=await e.next();if(s.done)return s.value;yield s.value}})}take(n){const e=this._iterator;return new w(async function*(){let t=0;for(;t<n;){const s=await e.next();if(s.done)return s.value;yield s.value,t+=1}})}async find(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return;if(await n(t.value,e))return t.value;e+=1}}enumerate(){return this.map((n,e)=>[e,n])}unique(){const n=this._iterator;return new w(async function*(){const e=new Set;for(;;){const t=await n.next();if(t.done)return t.value;e.has(t.value)||(e.add(t.value),yield t.value)}})}async count(){let n=0;for(;;){if((await this._iterator.next()).done)return n;n+=1}}async forEach(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return;await n(t.value,e),e+=1}}next(...n){return this._iterator.next(...n)}async return(n){const e=await n;return this._iterator.return?await this._iterator.return(e):{done:!0,value:e}}throw(n){if(this._iterator.throw)return this._iterator.throw(n);throw n}groupBy(n){return new M(this.map(async(e,t)=>[await n(e,t),e]))}toArray(){return Array.fromAsync(this)}[(Re=Symbol.toStringTag,Symbol.asyncIterator)](){return this}}Fe=Symbol.toStringTag;const p=class p{constructor(n){l(this,"_elements");l(this,Fe,"AggregatedIterator");this._elements=new c(n)}every(n){const e=new Map;for(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!0];o&&e.set(t,[i+1,n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}some(n){const e=new Map;for(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!1];o||e.set(t,[i+1,n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}filter(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;n(s,i,o)&&(yield[s,i]),t.set(s,o+1)}})}map(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;yield[s,n(s,i,o)],t.set(s,o+1)}})}reduce(n,e){const t=new Map;for(const[s,i]of this._elements){let o,u;if(t.has(s))[o,u]=t.get(s);else if(e!==void 0)o=0,e instanceof Function?u=e(s):u=e;else{t.set(s,[0,i]);continue}t.set(s,[o+1,n(s,u,i,o)])}return new d(function*(){for(const[s,[i,o]]of t)yield[s,o]})}flatMap(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0,u=n(s,i,o);if(u instanceof Array)for(const F of u)yield[s,F];else yield[s,u];t.set(s,o+1)}})}drop(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;if(o<n){t.set(s,o+1);continue}yield[s,i]}})}take(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;o>=n||(yield[s,i],t.set(s,o+1))}})}find(n){const e=new Map;for(const[t,s]of this._elements){let[i,o]=e.get(t)??[0,void 0];o===void 0&&(n(t,s,i)&&(o=s),e.set(t,[i+1,o]))}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new p(function*(){const e=new Map;for(const[t,s]of n){const i=e.get(t)??new Set;i.has(s)||(i.add(s),e.set(t,i),yield[t,s])}})}count(){const n=new Map;for(const[e]of this._elements){const t=n.get(e)??0;n.set(e,t+1)}return new d(function*(){for(const[e,t]of n)yield[e,t]})}forEach(n){const e=new Map;for(const[t,s]of this._elements){const i=e.get(t)??0;n(t,s,i),e.set(t,i+1)}}reorganizeBy(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;yield[n(s,i,o),i],t.set(s,o+1)}})}keys(){const n=this._elements;return new c(function*(){const e=new Set;for(const[t]of n)e.has(t)||(e.add(t),yield t)})}entries(){return this._elements}values(){const n=this._elements;return new c(function*(){for(const[e,t]of n)yield t})}toArray(){const n=this.toMap();return Array.from(n.values())}toMap(){const n=new Map;for(const[e,t]of this._elements){const s=n.get(e)??[];s.push(t),n.set(e,s)}return n}toObject(){const n={};for(const[e,t]of this._elements){const s=n[e]??[];s.push(t),n[e]=s}return n}};let k=p;const rt=Function;class D extends(Ce=rt,Pe=Symbol.toStringTag,Ce){constructor(){super("return this._invoke(...arguments);");l(this,Pe,"CallableObject");const e=this.bind(this);return Object.setPrototypeOf(this,e),e}}Ie=Symbol.toStringTag;class T{constructor(){l(this,"_subscribers");l(this,Ie,"Publisher");this._subscribers=new Map}clear(){this._subscribers.clear()}publish(n,...e){const t=this._subscribers.get(n);return t?t.slice().map(s=>s(...e)):[]}subscribe(n,e){this._subscribers.has(n)||this._subscribers.set(n,[]);const t=this._subscribers.get(n);return t.push(e),()=>{const s=t.indexOf(e);if(s<0)throw new C("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");t.splice(s,1)}}unsubscribe(n,e){const t=this._subscribers.get(n);if(!t)return;const s=t.indexOf(e);if(s<0)throw new C("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed or was never subscribed.");t.splice(s,1)}}const ot=()=>{};class at extends(Ae=D,je=Symbol.toStringTag,Ae){constructor(e,t="default"){super();l(this,"_callback");l(this,"_callbacks");l(this,"_isEnabled");l(this,"_key");l(this,"_invoke");l(this,je,"SwitchableCallback");this._callbacks=new Map,this._isEnabled=!0,e?this._callbacks.set(t,e):(t="",e=()=>{throw new z("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?")}),this._key=t,this._callback=e,this._invoke=(...s)=>this._callback(...s)}get isEnabled(){return this._isEnabled}get key(){return this._key}enable(e){if(e===void 0){if(!this._key)throw new b("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");e=this._key}else if(e){if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`)}else throw new b("The key must be a non-empty string.");if(this._isEnabled)throw new y("The `SwitchableCallback` is already enabled.");this._callback=this._callbacks.get(e),this._isEnabled=!0}disable(){if(!this._isEnabled)throw new y("The `SwitchableCallback` is already disabled.");this._callback=ot,this._isEnabled=!1}register(e,t){if(this._callbacks.size===0)this._key=e,this._callback=t;else if(this._callbacks.has(e))throw new b(`The key '${e}' has already been used for another callback.`);this._callbacks.set(e,t)}unregister(e){if(this._key===e)throw new b("Unable to unregister the currently selected callback.");if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`);this._callbacks.delete(e)}switch(e){if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`);this._key!==e&&(this._key=e,this._isEnabled&&(this._callback=this._callbacks.get(e)))}}class lt extends(Oe=Map,Ne=Symbol.toStringTag,Oe){constructor(e){super();l(this,"_publisher");l(this,Ne,"MapView");if(this._publisher=new T,e)for(const[t,s]of e)this.set(t,s)}set(e,t){return super.set(e,t),this._publisher.publish("entry:add",e,t),this}delete(e){const t=this.get(e);return t===void 0?!1:(super.delete(e),this._publisher.publish("entry:remove",e,t),!0)}clear(){const e=this.size;super.clear(),e>0&&this._publisher.publish("collection:clear")}subscribe(e,t){return this._publisher.subscribe(e,t)}unsubscribe(e,t){this._publisher.unsubscribe(e,t)}}class ut extends($e=Set,ze=Symbol.toStringTag,$e){constructor(e){super();l(this,"_publisher");l(this,ze,"SetView");if(this._publisher=new T,e)for(const t of e)this.add(t)}add(e){return super.add(e),this._publisher.publish("entry:add",e),this}delete(e){const t=super.delete(e);return t&&this._publisher.publish("entry:remove",e),t}clear(){const e=this.size;super.clear(),e>0&&this._publisher.publish("collection:clear")}subscribe(e,t){return this._publisher.subscribe(e,t)}unsubscribe(e,t){this._publisher.unsubscribe(e,t)}}qe=Symbol.toStringTag;class ct{constructor(n=!0){l(this,"_preferPersistence");l(this,"_volatile");l(this,"_persistent");l(this,qe,"JSONStorage");if(!h)throw new $("The `JSONStorage` class can only be instantiated within a browser environment.");this._preferPersistence=n,this._volatile=window.sessionStorage,this._persistent=window.localStorage}_get(n,e,t){const s=n.getItem(e);if(s)try{return JSON.parse(s)}catch{console.warn(`The "${s}" value for "${e}" property cannot be parsed. Clearing the storage...`),n.removeItem(e)}return t}_set(n,e,t){const s=JSON.stringify(t);s?n.setItem(e,s):n.removeItem(e)}get(n,e,t=this._preferPersistence){const s=t?this._persistent:this._volatile;return this._get(s,n,e)}recall(n,e){return this._get(this._volatile,n,e)}retrieve(n,e){return this.recall(n)??this.read(n,e)}read(n,e){return this._get(this._persistent,n,e)}has(n,e){return(e?this._persistent:this._volatile).getItem(n)!==null}knows(n){return this._volatile.getItem(n)!==null}find(n){return this.knows(n)??this.exists(n)}exists(n){return this._persistent.getItem(n)!==null}set(n,e,t=this._preferPersistence){const s=t?this._persistent:this._volatile;this._set(s,n,e)}remember(n,e){this._set(this._volatile,n,e)}write(n,e){this._set(this._persistent,n,e)}delete(n,e){(e?this._persistent:this._volatile).removeItem(n)}forget(n){this._volatile.removeItem(n)}erase(n){this._persistent.removeItem(n)}clear(n){this._volatile.removeItem(n),this._persistent.removeItem(n)}}De=Symbol.toStringTag;const A=class A{constructor(n){l(this,"_isPending");l(this,"_isFulfilled");l(this,"_isRejected");l(this,"_promise");l(this,De,"SmartPromise");this._isPending=!0,this._isFulfilled=!1,this._isRejected=!1;const e=s=>(this._isPending=!1,this._isFulfilled=!0,s),t=s=>{throw this._isPending=!1,this._isRejected=!0,s};this._promise=new Promise(n).then(e,t)}static FromPromise(n){return new A((e,t)=>n.then(e,t))}get isPending(){return this._isPending}get isFulfilled(){return this._isFulfilled}get isRejected(){return this._isRejected}then(n,e){return this._promise.then(n,e)}catch(n){return this._promise.catch(n)}finally(n){return this._promise.finally(n)}};let E=A;class V extends(Be=E,Ve=Symbol.toStringTag,Be){constructor(e,t){let s,i;super((o,u)=>{s=o,i=u});l(this,"_resolve");l(this,"_reject");l(this,Ve,"DeferredPromise");this._promise=this._promise.then(e,t),this._resolve=s,this._reject=i}get resolve(){return this._resolve}get reject(){return this._reject}watch(e){return e.then(this.resolve,this.reject),this}}class ht extends(Le=E,Je=Symbol.toStringTag,Le){constructor(e,t){super((s,i)=>{const o=O=>{clearTimeout(We),s(O)},u=O=>{clearTimeout(We),i(O)},We=setTimeout(()=>u(new q("The operation has timed out.")),t);e(o,u)});l(this,Je,"TimedPromise")}}var R=(r=>(r[r.Millisecond=1]="Millisecond",r[r.Second=1e3]="Second",r[r.Minute=6e4]="Minute",r[r.Hour=36e5]="Hour",r[r.Day=864e5]="Day",r[r.Week=6048e5]="Week",r[r.Month=2592e6]="Month",r[r.Year=31536e6]="Year",r))(R||{}),B=(r=>(r[r.Sunday=0]="Sunday",r[r.Monday=1]="Monday",r[r.Tuesday=2]="Tuesday",r[r.Wednesday=3]="Wednesday",r[r.Thursday=4]="Thursday",r[r.Friday=5]="Friday",r[r.Saturday=6]="Saturday",r))(B||{});function ft(r,n,e=864e5){let t;return r=new Date(r),n=new Date(n),r<n?t=Math.floor:t=Math.ceil,t((n.getTime()-r.getTime())/e)}function dt(r,n,e=864e5){if(r=new Date(r),n=new Date(n),r>=n)throw new g("The end date must be greater than the start date.");return new c(function*(){const t=n.getTime();let s=r.getTime();for(;s<t;)yield new Date(s),s+=e})}function J(r,n=864e5){if(n<=1)throw new g("Rounding a timestamp by milliseconds or less makes no sense.Use the timestamp value directly instead.");if(n>864e5)throw new g("Rounding by more than a day leads to unexpected results. Consider using other methods to round dates by weeks, months or years.");return r=new Date(r),new Date(Math.floor(r.getTime()/n)*n)}function mt(r,n=0){r=new Date(r);const e=7-n,t=(r.getUTCDay()+e)%7,s=r.getTime()-864e5*t;return J(new Date(s))}Ye=Symbol.toStringTag;class I{constructor(n,e=40){l(this,"_handle");l(this,"_startTime");l(this,"_isRunning");l(this,"_publisher");l(this,"_start");l(this,"_stop");l(this,Ye,"GameLoop");this._startTime=0,this._isRunning=!1,h?(this._start=()=>{n(this.elapsedTime),this._handle=window.requestAnimationFrame(this._start)},this._stop=()=>window.cancelAnimationFrame(this._handle)):(console.warn(`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`),this._start=()=>{this._handle=setInterval(()=>n(this.elapsedTime),e)},this._stop=()=>clearInterval(this._handle)),this._publisher=new T}get startTime(){return this._startTime}get isRunning(){return this._isRunning}get elapsedTime(){return performance.now()-this._startTime}start(n=0){if(this._isRunning)throw new y("The game loop has already been started.");this._startTime=performance.now()-n,this._start(),this._isRunning=!0,this._publisher.publish("start")}stop(){if(!this._isRunning)throw new y("The game loop had already stopped or hadn't yet started.");if(!this._handle)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,this._publisher.publish("stop")}onStart(n){return this._publisher.subscribe("start",n)}onStop(n){return this._publisher.subscribe("stop",n)}}class wt extends(Ke=I,Ge=Symbol.toStringTag,Ke){constructor(e=R.Second){super(t=>this._publisher.publish("tick",t),e);l(this,"_publisher");l(this,Ge,"Clock");this._publisher=new T}start(e=0){if(this._isRunning)throw new y("The clock has already been started.");this._startTime=performance.now()-e,this._start(),this._isRunning=!0,this._publisher.publish("start")}stop(){if(!this._isRunning)throw new y("The clock had already stopped or hadn't yet started.");if(!this._handle)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,this._publisher.publish("stop")}onTick(e,t=0){if(t<0)throw new g("The tick step must be a non-negative number.");if(t===0)return this._publisher.subscribe("tick",e);let s=0;return this._publisher.subscribe("tick",i=>{i-s<t||(e(i),s=i)})}}class yt extends(Qe=I,He=Symbol.toStringTag,Qe){constructor(e,t=R.Second){super(()=>{const i=this.remainingTime;i<=0?(this._deferrerStop(),this._publisher.publish("tick",0),this._publisher.publish("expire")):this._publisher.publish("tick",i)},t);l(this,"_publisher");l(this,"_duration");l(this,"_deferrer");l(this,He,"Countdown");this._publisher=new T,this._duration=e}get duration(){return this._duration}get remainingTime(){return this._duration-this.elapsedTime}_deferrerStop(e){if(!this._isRunning)throw new y("The countdown hadn't yet started.");if(!this._deferrer)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,e!==void 0?this._deferrer.reject(e):this._deferrer.resolve(),this._deferrer=void 0}start(e=this.duration){if(this._isRunning)throw new y("The countdown had already stopped or hadn't yet started.");if(this._deferrer)throw new S;return this._deferrer=new V,super.start(this.duration-e),this._publisher.publish("start"),this._deferrer}stop(e){this._deferrerStop(e),this._publisher.publish("stop",e)}onExpire(e){return this._publisher.subscribe("expire",e)}onTick(e,t=0){if(t<0)throw new g("The tick step must be a non-negative number.");if(t===0)return this._publisher.subscribe("tick",e);let s=this.remainingTime;return this._publisher.subscribe("tick",i=>{s-i<t||(e(i),s=i)})}}Xe=Symbol.toStringTag;class _t{constructor(){l(this,Xe,"Curve")}static Linear(n){const e=n-1;return new c(function*(){for(let t=0;t<n;t+=1)yield t/e})}static Exponential(n,e=2){if(e<0)throw new m("The base of the exponential curve cannot be negative.");const t=n-1;return new c(function*(){for(let s=0;s<n;s+=1)yield Math.pow(s/t,e)})}}Ze=Symbol.toStringTag;const N=class N{constructor(){l(this,Ze,"Random")}static Boolean(n=.5){return Math.random()<n}static Integer(n,e){return Math.floor(e===void 0?Math.random()*n:Math.random()*(e-n)+n)}static Decimal(n,e){return n===void 0?Math.random():e===void 0?Math.random()*n:Math.random()*(e-n)+n}static Index(n){if(n.length===0)throw new m("You must provide at least one element.");return this.Integer(n.length)}static Choice(n){return n[N.Index(n)]}};let j=N;function pt(r){return new Promise(n=>setTimeout(n,r))}function bt(){return new Promise(r=>requestAnimationFrame(()=>r()))}function gt(){return new Promise(r=>setTimeout(r))}function vt(r,n="text/javascript"){return new Promise((e,t)=>{const s=document.createElement("script");s.async=!0,s.defer=!0,s.src=r,s.type=n,s.onload=i=>e(),s.onerror=i=>t(i),document.body.appendChild(s)})}function xt(...r){return new c(function*(){for(const n of r)for(const e of n)yield e})}function St(r){if(r instanceof Array)return r.length;let n=0;for(const e of r)n+=1;return n}function kt(r){return new c(function*(){let n=0;for(const e of r)yield[n,e],n+=1})}function Tt(r,n,e=1){if(e<=0)throw new g("Step must be always a positive number, even when generating numbers in reverse order.");return n===void 0&&(n=r,r=0),r>n?new c(function*(){for(let t=r;t>n;t-=e)yield t}):new c(function*(){for(let t=r;t<n;t+=e)yield t})}function Et(r){const n=Array.from(r);for(let e=n.length-1;e>0;e-=1){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}function Mt(r){return new c(function*(){const n=new Set;for(const e of r)n.has(e)||(n.add(e),yield e)})}function L(r,n){const e=r[Symbol.iterator](),t=n[Symbol.iterator]();return new c(function*(){for(;;){const s=e.next(),i=t.next();if(s.done||i.done)break;yield[s.value,i.value]}})}function Rt(r,n){if(n===void 0){let i=0,o=0;for(const u of r)i+=u,o+=1;if(o===0)throw new m("You must provide at least one value.");return i/o}let e=0,t=0,s=0;for(const[i,o]of L(r,n)){if(o<=0)throw new m(`The weight for the value #${s} must be greater than zero.`);e+=i*o,t+=o,s+=1}if(s===0)throw new m("You must provide at least one value and weight.");if(t<=0)throw new m("The sum of weights must be greater than zero.");return e/t}function Ft(r){let n=0;for(let e=0;e<r.length;e+=1){const t=r.charCodeAt(e);n=(n<<5)-n+t,n|=0}return n}function Pt(r){let n=0;for(const e of r)n+=e;return n}function Ct(r){return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}const It="2.1.2";a.AggregatedAsyncIterator=M,a.AggregatedIterator=k,a.CallableObject=D,a.Clock=wt,a.Countdown=yt,a.Curve=_t,a.DeferredPromise=V,a.EnvironmentException=$,a.Exception=f,a.FatalErrorException=S,a.FileException=P,a.FileExistsException=et,a.FileNotFoundException=tt,a.GameLoop=I,a.JSONStorage=ct,a.KeyException=b,a.MapView=lt,a.NetworkException=nt,a.NotImplementedException=z,a.PermissionException=st,a.Publisher=T,a.Random=j,a.RangeException=g,a.ReducedIterator=d,a.ReferenceException=C,a.RuntimeException=y,a.SetView=ut,a.SmartAsyncIterator=w,a.SmartIterator=c,a.SmartPromise=E,a.SwitchableCallback=at,a.TimeUnit=R,a.TimedPromise=ht,a.TimeoutException=q,a.TypeException=it,a.VERSION=It,a.ValueException=m,a.WeekDay=B,a.average=Rt,a.capitalize=Ct,a.chain=xt,a.count=St,a.dateDifference=ft,a.dateRange=dt,a.dateRound=J,a.delay=pt,a.enumerate=kt,a.getWeek=mt,a.hash=Ft,a.isBrowser=h,a.isNode=x,a.isWorker=Ue,a.loadScript=vt,a.nextAnimationFrame=bt,a.range=Tt,a.shuffle=Et,a.sum=Pt,a.unique=Mt,a.yieldToEventLoop=gt,a.zip=L,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
5
+ Caused by ${t}`)}static FromUnknown(e){if(e instanceof f)return e;if(e instanceof Error){const t=new f(e.message);return t.stack=e.stack,t.name=e.name,t}return new f(`${e}`)}}class S extends(Z=f,X=Symbol.toStringTag,Z){constructor(e,t,s="FatalErrorException"){e===void 0&&(e="The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team.");super(e,t,s);l(this,X,"FatalErrorException")}}class q extends(U=S,W=Symbol.toStringTag,U){constructor(e,t,s="NotImplementedException"){e===void 0&&(e="This feature isn't implemented yet. Please, try again later.");super(e,t,s);l(this,W,"NotImplementedException")}}class P extends(te=f,ee=Symbol.toStringTag,te){constructor(e,t,s="FileException"){super(e,t,s);l(this,ee,"FileException")}}class tt extends(se=P,ne=Symbol.toStringTag,se){constructor(e,t,s="FileExistsException"){super(e,t,s);l(this,ne,"FileExistsException")}}class nt extends(re=P,ie=Symbol.toStringTag,re){constructor(e,t,s="FileNotFoundException"){super(e,t,s);l(this,ie,"FileNotFoundException")}}class b extends(ae=f,oe=Symbol.toStringTag,ae){constructor(e,t,s="KeyException"){super(e,t,s);l(this,oe,"KeyException")}}class st extends(ce=f,le=Symbol.toStringTag,ce){constructor(e,t,s="NetworkException"){super(e,t,s);l(this,le,"NetworkException")}}class it extends(he=f,ue=Symbol.toStringTag,he){constructor(e,t,s="PermissionException"){super(e,t,s);l(this,ue,"PermissionException")}}class M extends(de=f,fe=Symbol.toStringTag,de){constructor(e,t,s="ReferenceException"){super(e,t,s);l(this,fe,"ReferenceException")}}class y extends(we=f,me=Symbol.toStringTag,we){constructor(e,t,s="RuntimeException"){super(e,t,s);l(this,me,"RuntimeException")}}class $ extends(_e=y,ye=Symbol.toStringTag,_e){constructor(e,t,s="EnvironmentException"){super(e,t,s);l(this,ye,"EnvironmentException")}}class D extends(be=f,pe=Symbol.toStringTag,be){constructor(e,t,s="TimeoutException"){super(e,t,s);l(this,pe,"TimeoutException")}}class rt extends(ve=f,ge=Symbol.toStringTag,ve){constructor(e,t,s="TypeException"){super(e,t,s);l(this,ge,"TypeException")}}class m extends(Se=f,xe=Symbol.toStringTag,Se){constructor(e,t,s="ValueException"){super(e,t,s);l(this,xe,"ValueException")}}class g extends(Te=m,ke=Symbol.toStringTag,Te){constructor(e,t,s="RangeException"){super(e,t,s);l(this,ke,"RangeException")}}class u{constructor(n){l(this,"_iterator");l(this,Ee,"SmartIterator");n instanceof Function?this._iterator=n():Symbol.iterator in n?this._iterator=n[Symbol.iterator]():this._iterator=n}every(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return!0;if(!n(t.value,e))return!1;e+=1}}some(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return!1;if(n(t.value,e))return!0;e+=1}}filter(n){const e=this._iterator;return new u(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;n(s.value,t)&&(yield s.value),t+=1}})}map(n){const e=this._iterator;return new u(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;yield n(s.value,t),t+=1}})}reduce(n,e){let t=0,s=e;if(s===void 0){const i=this._iterator.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value,t+=1}for(;;){const i=this._iterator.next();if(i.done)return s;s=n(s,i.value,t),t+=1}}flatMap(n){const e=this._iterator;return new u(function*(){let t=0;for(;;){const s=e.next();if(s.done)return s.value;const i=n(s.value,t);if(i instanceof Array)for(const o of i)yield o;else yield i;t+=1}})}drop(n){const e=this._iterator;return new u(function*(){let t=0;for(;t<n;){if(e.next().done)return;t+=1}for(;;){const s=e.next();if(s.done)return s.value;yield s.value}})}take(n){const e=this._iterator;return new u(function*(){let t=0;for(;t<n;){const s=e.next();if(s.done)return s.value;yield s.value,t+=1}})}find(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return;if(n(t.value,e))return t.value;e+=1}}enumerate(){return this.map((n,e)=>[e,n])}unique(){const n=this._iterator;return new u(function*(){const e=new Set;for(;;){const t=n.next();if(t.done)return t.value;e.has(t.value)||(e.add(t.value),yield t.value)}})}count(){let n=0;for(;;){if(this._iterator.next().done)return n;n+=1}}forEach(n){let e=0;for(;;){const t=this._iterator.next();if(t.done)return;n(t.value,e),e+=1}}next(...n){return this._iterator.next(...n)}return(n){return this._iterator.return?this._iterator.return(n):{done:!0,value:n}}throw(n){if(this._iterator.throw)return this._iterator.throw(n);throw n}groupBy(n){return new k(this.map((e,t)=>[n(e,t),e]))}toArray(){return Array.from(this)}[(Ee=Symbol.toStringTag,Symbol.iterator)](){return this}}Me=Symbol.toStringTag;const v=class v{constructor(n){l(this,"_elements");l(this,Me,"ReducedIterator");this._elements=new u(n)}every(n){for(const[e,[t,s]]of this._elements.enumerate())if(!n(t,s,e))return!1;return!0}some(n){for(const[e,[t,s]]of this._elements.enumerate())if(n(t,s,e))return!0;return!1}filter(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)n(s,i,t)&&(yield[s,i])})}map(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)yield[s,n(s,i,t)]})}reduce(n,e){let t=0,s=e;if(s===void 0){const i=this._elements.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value[1],t+=1}for(const[i,o]of this._elements)s=n(i,s,o,t),t+=1;return s}flatMap(n){const e=this._elements.enumerate();return new k(function*(){for(const[t,[s,i]]of e){const o=n(s,i,t);if(o instanceof Array)for(const c of o)yield[s,c];else yield[s,o]}})}drop(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e)t>=n&&(yield[s,i])})}take(n){const e=this._elements.enumerate();return new v(function*(){for(const[t,[s,i]]of e){if(t>=n)break;yield[s,i]}})}find(n){for(const[e,[t,s]]of this._elements.enumerate())if(n(t,s,e))return s}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new v(function*(){const e=new Set;for(const[t,s]of n)e.has(s)||(e.add(s),yield[t,s])})}count(){let n=0;for(const e of this._elements)n+=1;return n}forEach(n){for(const[e,[t,s]]of this._elements.enumerate())n(t,s,e)}reorganizeBy(n){const e=this._elements.enumerate();return new k(function*(){for(const[t,[s,i]]of e)yield[n(s,i,t),i]})}keys(){const n=this._elements;return new u(function*(){for(const[e]of n)yield e})}entries(){return this._elements}values(){const n=this._elements;return new u(function*(){for(const[e,t]of n)yield t})}toArray(){return Array.from(this.values())}toMap(){return new Map(this.entries())}toObject(){return Object.fromEntries(this.entries())}};let d=v;Re=Symbol.toStringTag;const _=class _{constructor(n){l(this,"_elements");l(this,Re,"AggregatedAsyncIterator");this._elements=new w(n)}async every(n){const e=new Map;for await(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!0];o&&e.set(t,[i+1,await n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}async some(n){const e=new Map;for await(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!1];o||e.set(t,[i+1,await n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}filter(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;await n(s,i,o)&&(yield[s,i]),t.set(s,o+1)}})}map(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;yield[s,await n(s,i,o)],t.set(s,o+1)}})}async reduce(n,e){const t=new Map;for await(const[s,i]of this._elements){let o,c;if(t.has(s))[o,c]=t.get(s);else if(e!==void 0)o=0,e instanceof Function?c=await e(s):c=await e;else{t.set(s,[0,i]);continue}t.set(s,[o+1,await n(s,c,i,o)])}return new d(function*(){for(const[s,[i,o]]of t)yield[s,o]})}flatMap(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0,c=await n(s,i,o);if(c instanceof Array)for(const C of c)yield[s,C];else yield[s,c];t.set(s,o+1)}})}drop(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;if(o<n){t.set(s,o+1);continue}yield[s,i]}})}take(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;o>=n||(yield[s,i],t.set(s,o+1))}})}async find(n){const e=new Map;for await(const[t,s]of this._elements){let[i,o]=e.get(t)??[0,void 0];o===void 0&&(await n(t,s,i)&&(o=s),e.set(t,[i+1,o]))}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new _(async function*(){const e=new Map;for await(const[t,s]of n){const i=e.get(t)??new Set;i.has(s)||(i.add(s),e.set(t,i),yield[t,s])}})}async count(){const n=new Map;for await(const[e]of this._elements){const t=n.get(e)??0;n.set(e,t+1)}return new d(function*(){for(const[e,t]of n)yield[e,t]})}async forEach(n){const e=new Map;for await(const[t,s]of this._elements){const i=e.get(t)??0;await n(t,s,i),e.set(t,i+1)}}reorganizeBy(n){const e=this._elements;return new _(async function*(){const t=new Map;for await(const[s,i]of e){const o=t.get(s)??0;yield[await n(s,i,o),i],t.set(s,o+1)}})}keys(){const n=this._elements;return new w(async function*(){const e=new Set;for await(const[t]of n)e.has(t)||(e.add(t),yield t)})}entries(){return this._elements}values(){const n=this._elements;return new w(async function*(){for await(const[e,t]of n)yield t})}async toArray(){const n=await this.toMap();return Array.from(n.values())}async toMap(){const n=new Map;for await(const[e,t]of this._elements){const s=n.get(e)??[];s.push(t),n.set(e,s)}return n}async toObject(){const n={};for await(const[e,t]of this._elements){const s=n[e]??[];s.push(t),n[e]=s}return n}};let R=_;class w{constructor(n){l(this,"_iterator");l(this,Fe,"SmartAsyncIterator");if(n instanceof Function){const e=n();Symbol.asyncIterator in e?this._iterator=e:this._iterator=async function*(){let t=[];for(;;){const s=e.next(...t);if(s.done)return s.value;t=[yield s.value]}}()}else if(Symbol.asyncIterator in n)this._iterator=n[Symbol.asyncIterator]();else if(Symbol.iterator in n){const e=n[Symbol.iterator]();this._iterator=async function*(){for(;;){const t=e.next();if(t.done)return t.value;yield t.value}}()}else this._iterator=async function*(){let e=[];for(;;){const t=await n.next(...e);if(t.done)return t.value;e=[yield t.value]}}()}async every(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return!0;if(!await n(t.value,e))return!1;e+=1}}async some(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return!1;if(await n(t.value,e))return!0;e+=1}}filter(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;await n(s.value,t)&&(yield s.value),t+=1}})}map(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;yield await n(s.value,t),t+=1}})}async reduce(n,e){let t=0,s=e;if(s===void 0){const i=await this._iterator.next();if(i.done)throw new m("Cannot reduce an empty iterator without an initial value.");s=i.value,t+=1}for(;;){const i=await this._iterator.next();if(i.done)return s;s=await n(s,i.value,t),t+=1}}flatMap(n){const e=this._iterator;return new w(async function*(){let t=0;for(;;){const s=await e.next();if(s.done)return s.value;const i=await n(s.value,t);if(i instanceof Array)for(const o of i)yield o;else yield i;t+=1}})}drop(n){const e=this._iterator;return new w(async function*(){let t=0;for(;t<n;){if((await e.next()).done)return;t+=1}for(;;){const s=await e.next();if(s.done)return s.value;yield s.value}})}take(n){const e=this._iterator;return new w(async function*(){let t=0;for(;t<n;){const s=await e.next();if(s.done)return s.value;yield s.value,t+=1}})}async find(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return;if(await n(t.value,e))return t.value;e+=1}}enumerate(){return this.map((n,e)=>[e,n])}unique(){const n=this._iterator;return new w(async function*(){const e=new Set;for(;;){const t=await n.next();if(t.done)return t.value;e.has(t.value)||(e.add(t.value),yield t.value)}})}async count(){let n=0;for(;;){if((await this._iterator.next()).done)return n;n+=1}}async forEach(n){let e=0;for(;;){const t=await this._iterator.next();if(t.done)return;await n(t.value,e),e+=1}}next(...n){return this._iterator.next(...n)}async return(n){const e=await n;return this._iterator.return?await this._iterator.return(e):{done:!0,value:e}}throw(n){if(this._iterator.throw)return this._iterator.throw(n);throw n}groupBy(n){return new R(this.map(async(e,t)=>[await n(e,t),e]))}toArray(){return Array.fromAsync(this)}[(Fe=Symbol.toStringTag,Symbol.asyncIterator)](){return this}}Ce=Symbol.toStringTag;const p=class p{constructor(n){l(this,"_elements");l(this,Ce,"AggregatedIterator");this._elements=new u(n)}every(n){const e=new Map;for(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!0];o&&e.set(t,[i+1,n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}some(n){const e=new Map;for(const[t,s]of this._elements){const[i,o]=e.get(t)??[0,!1];o||e.set(t,[i+1,n(t,s,i)])}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}filter(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;n(s,i,o)&&(yield[s,i]),t.set(s,o+1)}})}map(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;yield[s,n(s,i,o)],t.set(s,o+1)}})}reduce(n,e){const t=new Map;for(const[s,i]of this._elements){let o,c;if(t.has(s))[o,c]=t.get(s);else if(e!==void 0)o=0,e instanceof Function?c=e(s):c=e;else{t.set(s,[0,i]);continue}t.set(s,[o+1,n(s,c,i,o)])}return new d(function*(){for(const[s,[i,o]]of t)yield[s,o]})}flatMap(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0,c=n(s,i,o);if(c instanceof Array)for(const C of c)yield[s,C];else yield[s,c];t.set(s,o+1)}})}drop(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;if(o<n){t.set(s,o+1);continue}yield[s,i]}})}take(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;o>=n||(yield[s,i],t.set(s,o+1))}})}find(n){const e=new Map;for(const[t,s]of this._elements){let[i,o]=e.get(t)??[0,void 0];o===void 0&&(n(t,s,i)&&(o=s),e.set(t,[i+1,o]))}return new d(function*(){for(const[t,[s,i]]of e)yield[t,i]})}enumerate(){return this.map((n,e,t)=>[t,e])}unique(){const n=this._elements;return new p(function*(){const e=new Map;for(const[t,s]of n){const i=e.get(t)??new Set;i.has(s)||(i.add(s),e.set(t,i),yield[t,s])}})}count(){const n=new Map;for(const[e]of this._elements){const t=n.get(e)??0;n.set(e,t+1)}return new d(function*(){for(const[e,t]of n)yield[e,t]})}forEach(n){const e=new Map;for(const[t,s]of this._elements){const i=e.get(t)??0;n(t,s,i),e.set(t,i+1)}}reorganizeBy(n){const e=this._elements;return new p(function*(){const t=new Map;for(const[s,i]of e){const o=t.get(s)??0;yield[n(s,i,o),i],t.set(s,o+1)}})}keys(){const n=this._elements;return new u(function*(){const e=new Set;for(const[t]of n)e.has(t)||(e.add(t),yield t)})}entries(){return this._elements}values(){const n=this._elements;return new u(function*(){for(const[e,t]of n)yield t})}toArray(){const n=this.toMap();return Array.from(n.values())}toMap(){const n=new Map;for(const[e,t]of this._elements){const s=n.get(e)??[];s.push(t),n.set(e,s)}return n}toObject(){const n={};for(const[e,t]of this._elements){const s=n[e]??[];s.push(t),n[e]=s}return n}};let k=p;const ot=Function;class V extends(Ie=ot,Pe=Symbol.toStringTag,Ie){constructor(){super("return this._invoke(...arguments);");l(this,Pe,"CallableObject");const e=this.bind(this);return Object.setPrototypeOf(this,e),e}}je=Symbol.toStringTag;const A=class A{constructor(){l(this,"_subscribers");l(this,je,"Publisher");this._subscribers=new Map}clear(){this.publish("__internals__:clear"),this._subscribers.clear()}createScope(){const n=new A,e=(t,...s)=>{n.publish(t,...s)};return this.subscribe("__internals__:clear",()=>n.clear()),this.subscribe("*",e),n}publish(n,...e){let t,s=this._subscribers.get(n);return s?t=s.slice().map(i=>i(...e)):t=[],n.startsWith("__")||(s=this._subscribers.get("*"),s&&s.slice().forEach(i=>i(n,...e))),t}subscribe(n,e){const t=this._subscribers.get(n)??[];return t.push(e),this._subscribers.set(n,t),()=>{const s=t.indexOf(e);if(s<0)throw new M("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");t.splice(s,1)}}unsubscribe(n,e){const t=this._subscribers.get(n);if(!t)throw new M("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed or was never subscribed.");const s=t.indexOf(e);if(s<0)throw new M("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed or was never subscribed.");t.splice(s,1),t.length===0&&this._subscribers.delete(n)}};let T=A;const at=()=>{};class lt extends(Ne=V,Ae=Symbol.toStringTag,Ne){constructor(e,t="default"){super();l(this,"_callback");l(this,"_callbacks");l(this,"_isEnabled");l(this,"_key");l(this,"_invoke");l(this,Ae,"SwitchableCallback");this._callbacks=new Map,this._isEnabled=!0,e?this._callbacks.set(t,e):(t="",e=()=>{throw new q("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?")}),this._key=t,this._callback=e,this._invoke=(...s)=>this._callback(...s)}get isEnabled(){return this._isEnabled}get key(){return this._key}enable(e){if(e===void 0){if(!this._key)throw new b("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");e=this._key}else if(e){if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`)}else throw new b("The key must be a non-empty string.");if(this._isEnabled)throw new y("The `SwitchableCallback` is already enabled.");this._callback=this._callbacks.get(e),this._isEnabled=!0}disable(){if(!this._isEnabled)throw new y("The `SwitchableCallback` is already disabled.");this._callback=at,this._isEnabled=!1}register(e,t){if(this._callbacks.size===0)this._key=e,this._callback=t;else if(this._callbacks.has(e))throw new b(`The key '${e}' has already been used for another callback.`);this._callbacks.set(e,t)}unregister(e){if(this._key===e)throw new b("Unable to unregister the currently selected callback.");if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`);this._callbacks.delete(e)}switch(e){if(!this._callbacks.has(e))throw new b(`The key '${e}' doesn't yet have any associated callback.`);this._key!==e&&(this._key=e,this._isEnabled&&(this._callback=this._callbacks.get(e)))}}class ct extends(ze=Map,Oe=Symbol.toStringTag,ze){constructor(e){super();l(this,"_publisher");l(this,Oe,"MapView");if(this._publisher=new T,e)for(const[t,s]of e)this.set(t,s)}set(e,t){return super.set(e,t),this._publisher.publish("entry:add",e,t),this}delete(e){const t=this.get(e);return t===void 0?!1:(super.delete(e),this._publisher.publish("entry:remove",e,t),!0)}clear(){const e=this.size;super.clear(),e>0&&this._publisher.publish("collection:clear")}subscribe(e,t){return this._publisher.subscribe(e,t)}unsubscribe(e,t){this._publisher.unsubscribe(e,t)}}class ut extends($e=Set,qe=Symbol.toStringTag,$e){constructor(e){super();l(this,"_publisher");l(this,qe,"SetView");if(this._publisher=new T,e)for(const t of e)this.add(t)}add(e){return super.add(e),this._publisher.publish("entry:add",e),this}delete(e){const t=super.delete(e);return t&&this._publisher.publish("entry:remove",e),t}clear(){const e=this.size;super.clear(),e>0&&this._publisher.publish("collection:clear")}subscribe(e,t){return this._publisher.subscribe(e,t)}unsubscribe(e,t){this._publisher.unsubscribe(e,t)}}De=Symbol.toStringTag;class ht{constructor(n=!0){l(this,"_preferPersistence");l(this,"_volatile");l(this,"_persistent");l(this,De,"JSONStorage");if(!h)throw new $("The `JSONStorage` class can only be instantiated within a browser environment.");this._preferPersistence=n,this._volatile=window.sessionStorage,this._persistent=window.localStorage}_get(n,e,t){const s=n.getItem(e);if(s)try{return JSON.parse(s)}catch{console.warn(`The "${s}" value for "${e}" property cannot be parsed. Clearing the storage...`),n.removeItem(e)}return t}_set(n,e,t){const s=JSON.stringify(t);s?n.setItem(e,s):n.removeItem(e)}get(n,e,t=this._preferPersistence){const s=t?this._persistent:this._volatile;return this._get(s,n,e)}recall(n,e){return this._get(this._volatile,n,e)}retrieve(n,e){return this.recall(n)??this.read(n,e)}read(n,e){return this._get(this._persistent,n,e)}has(n,e){return(e?this._persistent:this._volatile).getItem(n)!==null}knows(n){return this._volatile.getItem(n)!==null}find(n){return this.knows(n)??this.exists(n)}exists(n){return this._persistent.getItem(n)!==null}set(n,e,t=this._preferPersistence){const s=t?this._persistent:this._volatile;this._set(s,n,e)}remember(n,e){this._set(this._volatile,n,e)}write(n,e){this._set(this._persistent,n,e)}delete(n,e){(e?this._persistent:this._volatile).removeItem(n)}forget(n){this._volatile.removeItem(n)}erase(n){this._persistent.removeItem(n)}clear(n){this._volatile.removeItem(n),this._persistent.removeItem(n)}}Ve=Symbol.toStringTag;const N=class N{constructor(n){l(this,"_isPending");l(this,"_isFulfilled");l(this,"_isRejected");l(this,"_promise");l(this,Ve,"SmartPromise");this._isPending=!0,this._isFulfilled=!1,this._isRejected=!1;const e=s=>(this._isPending=!1,this._isFulfilled=!0,s),t=s=>{throw this._isPending=!1,this._isRejected=!0,s};this._promise=new Promise(n).then(e,t)}static FromPromise(n){return new N((e,t)=>n.then(e,t))}get isPending(){return this._isPending}get isFulfilled(){return this._isFulfilled}get isRejected(){return this._isRejected}then(n,e){return this._promise.then(n,e)}catch(n){return this._promise.catch(n)}finally(n){return this._promise.finally(n)}};let E=N;class B extends(Je=E,Be=Symbol.toStringTag,Je){constructor(e,t){let s,i;super((o,c)=>{s=o,i=c});l(this,"_resolve");l(this,"_reject");l(this,Be,"DeferredPromise");this._promise=this._promise.then(e,t),this._resolve=s,this._reject=i}get resolve(){return this._resolve}get reject(){return this._reject}watch(e){return e.then(this.resolve,this.reject),this}}class ft extends(Ye=E,Le=Symbol.toStringTag,Ye){constructor(e,t){super((s,i)=>{const o=z=>{clearTimeout(Ue),s(z)},c=z=>{clearTimeout(Ue),i(z)},Ue=setTimeout(()=>c(new D("The operation has timed out.")),t);e(o,c)});l(this,Le,"TimedPromise")}}var F=(r=>(r[r.Millisecond=1]="Millisecond",r[r.Second=1e3]="Second",r[r.Minute=6e4]="Minute",r[r.Hour=36e5]="Hour",r[r.Day=864e5]="Day",r[r.Week=6048e5]="Week",r[r.Month=2592e6]="Month",r[r.Year=31536e6]="Year",r))(F||{}),J=(r=>(r[r.Sunday=0]="Sunday",r[r.Monday=1]="Monday",r[r.Tuesday=2]="Tuesday",r[r.Wednesday=3]="Wednesday",r[r.Thursday=4]="Thursday",r[r.Friday=5]="Friday",r[r.Saturday=6]="Saturday",r))(J||{});function dt(r,n,e=864e5){let t;return r=new Date(r),n=new Date(n),r<n?t=Math.floor:t=Math.ceil,t((n.getTime()-r.getTime())/e)}function mt(r,n,e=864e5){if(r=new Date(r),n=new Date(n),r>=n)throw new g("The end date must be greater than the start date.");return new u(function*(){const t=n.getTime();let s=r.getTime();for(;s<t;)yield new Date(s),s+=e})}function L(r,n=864e5){if(n<=1)throw new g("Rounding a timestamp by milliseconds or less makes no sense.Use the timestamp value directly instead.");if(n>864e5)throw new g("Rounding by more than a day leads to unexpected results. Consider using other methods to round dates by weeks, months or years.");return r=new Date(r),new Date(Math.floor(r.getTime()/n)*n)}function wt(r,n=0){r=new Date(r);const e=7-n,t=(r.getUTCDay()+e)%7,s=r.getTime()-864e5*t;return L(new Date(s))}Ge=Symbol.toStringTag;class I{constructor(n,e=40){l(this,"_handle");l(this,"_startTime");l(this,"_isRunning");l(this,"_publisher");l(this,"_start");l(this,"_stop");l(this,Ge,"GameLoop");this._startTime=0,this._isRunning=!1,h?(this._start=()=>{n(this.elapsedTime),this._handle=window.requestAnimationFrame(this._start)},this._stop=()=>window.cancelAnimationFrame(this._handle)):(console.warn(`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`),this._start=()=>{this._handle=setInterval(()=>n(this.elapsedTime),e)},this._stop=()=>clearInterval(this._handle)),this._publisher=new T}get startTime(){return this._startTime}get isRunning(){return this._isRunning}get elapsedTime(){return performance.now()-this._startTime}start(n=0){if(this._isRunning)throw new y("The game loop has already been started.");this._startTime=performance.now()-n,this._start(),this._isRunning=!0,this._publisher.publish("start")}stop(){if(!this._isRunning)throw new y("The game loop had already stopped or hadn't yet started.");if(!this._handle)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,this._publisher.publish("stop")}onStart(n){return this._publisher.subscribe("start",n)}onStop(n){return this._publisher.subscribe("stop",n)}}class yt extends(He=I,Ke=Symbol.toStringTag,He){constructor(e=F.Second){super(t=>this._publisher.publish("tick",t),e);l(this,Ke,"Clock")}start(e=0){if(this._isRunning)throw new y("The clock has already been started.");this._startTime=performance.now()-e,this._start(),this._isRunning=!0,this._publisher.publish("start")}stop(){if(!this._isRunning)throw new y("The clock had already stopped or hadn't yet started.");if(!this._handle)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,this._publisher.publish("stop")}onTick(e,t=0){if(t<0)throw new g("The tick step must be a non-negative number.");if(t===0)return this._publisher.subscribe("tick",e);let s=0;return this._publisher.subscribe("tick",i=>{i-s<t||(e(i),s=i)})}}class _t extends(Xe=I,Qe=Symbol.toStringTag,Xe){constructor(e,t=F.Second){super(()=>{const i=this.remainingTime;i<=0?(this._deferrerStop(),this._publisher.publish("tick",0),this._publisher.publish("expire")):this._publisher.publish("tick",i)},t);l(this,"_duration");l(this,"_deferrer");l(this,Qe,"Countdown");this._duration=e}get duration(){return this._duration}get remainingTime(){return this._duration-this.elapsedTime}_deferrerStop(e){if(!this._isRunning)throw new y("The countdown hadn't yet started.");if(!this._deferrer)throw new S;this._stop(),this._handle=void 0,this._isRunning=!1,e!==void 0?this._deferrer.reject(e):this._deferrer.resolve(),this._deferrer=void 0}start(e=this.duration){if(this._isRunning)throw new y("The countdown had already stopped or hadn't yet started.");if(this._deferrer)throw new S;return this._deferrer=new B,super.start(this.duration-e),this._publisher.publish("start"),this._deferrer}stop(e){this._deferrerStop(e),this._publisher.publish("stop",e)}onExpire(e){return this._publisher.subscribe("expire",e)}onTick(e,t=0){if(t<0)throw new g("The tick step must be a non-negative number.");if(t===0)return this._publisher.subscribe("tick",e);let s=this.remainingTime;return this._publisher.subscribe("tick",i=>{s-i<t||(e(i),s=i)})}}Ze=Symbol.toStringTag;class pt{constructor(){l(this,Ze,"Curve")}static Linear(n){const e=n-1;return new u(function*(){for(let t=0;t<n;t+=1)yield t/e})}static Exponential(n,e=2){if(e<0)throw new m("The base of the exponential curve cannot be negative.");const t=n-1;return new u(function*(){for(let s=0;s<n;s+=1)yield Math.pow(s/t,e)})}}We=Symbol.toStringTag;const O=class O{constructor(){l(this,We,"Random")}static Boolean(n=.5){return Math.random()<n}static Integer(n,e){return Math.floor(e===void 0?Math.random()*n:Math.random()*(e-n)+n)}static Decimal(n,e){return n===void 0?Math.random():e===void 0?Math.random()*n:Math.random()*(e-n)+n}static Index(n){if(n.length===0)throw new m("You must provide at least one element.");return this.Integer(n.length)}static Choice(n){return n[O.Index(n)]}};let j=O;function bt(r){return new Promise(n=>setTimeout(n,r))}function gt(){return new Promise(r=>requestAnimationFrame(()=>r()))}function vt(){return new Promise(r=>setTimeout(r))}function xt(r,n="text/javascript"){return new Promise((e,t)=>{const s=document.createElement("script");s.async=!0,s.defer=!0,s.src=r,s.type=n,s.onload=i=>e(),s.onerror=i=>t(i),document.body.appendChild(s)})}function St(...r){return new u(function*(){for(const n of r)for(const e of n)yield e})}function kt(r){if(r instanceof Array)return r.length;let n=0;for(const e of r)n+=1;return n}function Tt(r){return new u(function*(){let n=0;for(const e of r)yield[n,e],n+=1})}function Et(r,n,e=1){if(e<=0)throw new g("Step must be always a positive number, even when generating numbers in reverse order.");return n===void 0&&(n=r,r=0),r>n?new u(function*(){for(let t=r;t>n;t-=e)yield t}):new u(function*(){for(let t=r;t<n;t+=e)yield t})}function Mt(r){const n=Array.from(r);for(let e=n.length-1;e>0;e-=1){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}function Rt(r){return new u(function*(){const n=new Set;for(const e of r)n.has(e)||(n.add(e),yield e)})}function Y(r,n){const e=r[Symbol.iterator](),t=n[Symbol.iterator]();return new u(function*(){for(;;){const s=e.next(),i=t.next();if(s.done||i.done)break;yield[s.value,i.value]}})}function Ft(r,n){if(n===void 0){let i=0,o=0;for(const c of r)i+=c,o+=1;if(o===0)throw new m("You must provide at least one value.");return i/o}let e=0,t=0,s=0;for(const[i,o]of Y(r,n)){if(o<=0)throw new m(`The weight for the value #${s} must be greater than zero.`);e+=i*o,t+=o,s+=1}if(s===0)throw new m("You must provide at least one value and weight.");if(t<=0)throw new m("The sum of weights must be greater than zero.");return e/t}function Ct(r){let n=0;for(let e=0;e<r.length;e+=1){const t=r.charCodeAt(e);n=(n<<5)-n+t,n|=0}return n}function Pt(r){let n=0;for(const e of r)n+=e;return n}function It(r){return`${r.charAt(0).toUpperCase()}${r.slice(1)}`}const jt="2.1.4";a.AggregatedAsyncIterator=R,a.AggregatedIterator=k,a.CallableObject=V,a.Clock=yt,a.Countdown=_t,a.Curve=pt,a.DeferredPromise=B,a.EnvironmentException=$,a.Exception=f,a.FatalErrorException=S,a.FileException=P,a.FileExistsException=tt,a.FileNotFoundException=nt,a.GameLoop=I,a.JSONStorage=ht,a.KeyException=b,a.MapView=ct,a.NetworkException=st,a.NotImplementedException=q,a.PermissionException=it,a.Publisher=T,a.Random=j,a.RangeException=g,a.ReducedIterator=d,a.ReferenceException=M,a.RuntimeException=y,a.SetView=ut,a.SmartAsyncIterator=w,a.SmartIterator=u,a.SmartPromise=E,a.SwitchableCallback=lt,a.TimeUnit=F,a.TimedPromise=ft,a.TimeoutException=D,a.TypeException=rt,a.VERSION=jt,a.ValueException=m,a.WeekDay=J,a.average=Ft,a.capitalize=It,a.chain=St,a.count=kt,a.dateDifference=dt,a.dateRange=mt,a.dateRound=L,a.delay=bt,a.enumerate=Tt,a.getWeek=wt,a.hash=Ct,a.isBrowser=h,a.isNode=x,a.isWorker=et,a.loadScript=xt,a.nextAnimationFrame=gt,a.range=Et,a.shuffle=Mt,a.sum=Pt,a.unique=Rt,a.yieldToEventLoop=vt,a.zip=Y,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
6
6
  //# sourceMappingURL=core.umd.cjs.map