@byloth/core 2.0.0-rc.10 → 2.0.0-rc.11
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.js +204 -188
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +2 -2
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/models/callbacks/callable-object.ts +2 -0
- package/src/models/callbacks/publisher.ts +24 -5
- package/src/models/callbacks/switchable-callback.ts +2 -0
package/dist/core.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (i, t, e) =>
|
|
4
|
-
const
|
|
5
|
-
var O;
|
|
6
|
-
const Qe = typeof process < "u" && ((O = process.versions) == null ? void 0 : O.node);
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var Be = (i, t, e) => t in i ? We(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var a = (i, t, e) => Be(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const Ye = typeof window < "u" && typeof window.document < "u";
|
|
7
5
|
var A;
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
|
|
6
|
+
const et = typeof process < "u" && ((A = process.versions) == null ? void 0 : A.node);
|
|
7
|
+
var $;
|
|
8
|
+
const tt = typeof self == "object" && (($ = self.constructor) == null ? void 0 : $.name) === "DedicatedWorkerGlobalScope";
|
|
9
|
+
var q, N;
|
|
10
|
+
class f extends (N = Error, q = Symbol.toStringTag, N) {
|
|
11
11
|
constructor(e, n, s = "Exception") {
|
|
12
12
|
super(e);
|
|
13
|
-
a(this,
|
|
13
|
+
a(this, q, "Exception");
|
|
14
14
|
this.cause = n, this.name = s, n && (n instanceof Error ? this.stack += `
|
|
15
15
|
|
|
16
16
|
Caused by ${n.stack}` : this.stack += `
|
|
@@ -27,120 +27,120 @@ Caused by ${n}`);
|
|
|
27
27
|
return new f(`${e}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
class k extends (
|
|
30
|
+
var Y, z;
|
|
31
|
+
class k extends (z = f, Y = Symbol.toStringTag, z) {
|
|
32
32
|
constructor(e, n, s = "FatalErrorException") {
|
|
33
33
|
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.");
|
|
34
34
|
super(e, n, s);
|
|
35
|
-
a(this,
|
|
35
|
+
a(this, Y, "FatalErrorException");
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
var
|
|
39
|
-
class
|
|
38
|
+
var J, V;
|
|
39
|
+
class Ge extends (V = k, J = Symbol.toStringTag, V) {
|
|
40
40
|
constructor(e, n, s = "NotImplementedException") {
|
|
41
41
|
e === void 0 && (e = "This feature is not implemented yet. Please, try again later.");
|
|
42
42
|
super(e, n, s);
|
|
43
|
-
a(this,
|
|
43
|
+
a(this, J, "NotImplementedException");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
class
|
|
46
|
+
var W, B;
|
|
47
|
+
class ze extends (B = f, W = Symbol.toStringTag, B) {
|
|
48
48
|
constructor(e, n, s = "FileException") {
|
|
49
49
|
super(e, n, s);
|
|
50
|
-
a(this,
|
|
50
|
+
a(this, W, "FileException");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var
|
|
54
|
-
class
|
|
53
|
+
var G, K;
|
|
54
|
+
class nt extends (K = ze, G = Symbol.toStringTag, K) {
|
|
55
55
|
constructor(e, n, s = "FileExistsException") {
|
|
56
56
|
super(e, n, s);
|
|
57
|
-
a(this,
|
|
57
|
+
a(this, G, "FileExistsException");
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
class
|
|
60
|
+
var L, H;
|
|
61
|
+
class st extends (H = ze, L = Symbol.toStringTag, H) {
|
|
62
62
|
constructor(e, n, s = "FileNotFoundException") {
|
|
63
63
|
super(e, n, s);
|
|
64
|
-
a(this,
|
|
64
|
+
a(this, L, "FileNotFoundException");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
class x extends (
|
|
67
|
+
var Q, X;
|
|
68
|
+
class x extends (X = f, Q = Symbol.toStringTag, X) {
|
|
69
69
|
constructor(e, n, s = "KeyException") {
|
|
70
70
|
super(e, n, s);
|
|
71
|
-
a(this,
|
|
71
|
+
a(this, Q, "KeyException");
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
class
|
|
74
|
+
var Z, U;
|
|
75
|
+
class rt extends (U = f, Z = Symbol.toStringTag, U) {
|
|
76
76
|
constructor(e, n, s = "NetworkException") {
|
|
77
77
|
super(e, n, s);
|
|
78
|
-
a(this,
|
|
78
|
+
a(this, Z, "NetworkException");
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
var
|
|
82
|
-
class
|
|
81
|
+
var ee, te;
|
|
82
|
+
class it extends (te = f, ee = Symbol.toStringTag, te) {
|
|
83
83
|
constructor(e, n, s = "PermissionException") {
|
|
84
84
|
super(e, n, s);
|
|
85
|
-
a(this,
|
|
85
|
+
a(this, ee, "PermissionException");
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
var
|
|
89
|
-
class
|
|
88
|
+
var ne, se;
|
|
89
|
+
class I extends (se = f, ne = Symbol.toStringTag, se) {
|
|
90
90
|
constructor(e, n, s = "ReferenceException") {
|
|
91
91
|
super(e, n, s);
|
|
92
|
-
a(this,
|
|
92
|
+
a(this, ne, "ReferenceException");
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
var
|
|
96
|
-
class m extends (
|
|
95
|
+
var re, ie;
|
|
96
|
+
class m extends (ie = f, re = Symbol.toStringTag, ie) {
|
|
97
97
|
constructor(e, n, s = "RuntimeException") {
|
|
98
98
|
super(e, n, s);
|
|
99
|
-
a(this,
|
|
99
|
+
a(this, re, "RuntimeException");
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
var
|
|
103
|
-
class
|
|
102
|
+
var oe, ae;
|
|
103
|
+
class Ke extends (ae = m, oe = Symbol.toStringTag, ae) {
|
|
104
104
|
constructor(e, n, s = "EnvironmentException") {
|
|
105
105
|
super(e, n, s);
|
|
106
|
-
a(this,
|
|
106
|
+
a(this, oe, "EnvironmentException");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
var
|
|
110
|
-
class
|
|
109
|
+
var le, ue;
|
|
110
|
+
class Le extends (ue = f, le = Symbol.toStringTag, ue) {
|
|
111
111
|
constructor(e, n, s = "TimeoutException") {
|
|
112
112
|
super(e, n, s);
|
|
113
|
-
a(this,
|
|
113
|
+
a(this, le, "TimeoutException");
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
var
|
|
117
|
-
class
|
|
116
|
+
var ce, he;
|
|
117
|
+
class ot extends (he = f, ce = Symbol.toStringTag, he) {
|
|
118
118
|
constructor(e, n, s = "TypeException") {
|
|
119
119
|
super(e, n, s);
|
|
120
|
-
a(this,
|
|
120
|
+
a(this, ce, "TypeException");
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
var
|
|
124
|
-
class p extends (
|
|
123
|
+
var fe, de;
|
|
124
|
+
class p extends (de = f, fe = Symbol.toStringTag, de) {
|
|
125
125
|
constructor(e, n, s = "ValueException") {
|
|
126
126
|
super(e, n, s);
|
|
127
|
-
a(this,
|
|
127
|
+
a(this, fe, "ValueException");
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
class
|
|
130
|
+
var me, _e;
|
|
131
|
+
class Je extends (_e = p, me = Symbol.toStringTag, _e) {
|
|
132
132
|
constructor(e, n, s = "RangeException") {
|
|
133
133
|
super(e, n, s);
|
|
134
|
-
a(this,
|
|
134
|
+
a(this, me, "RangeException");
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
var
|
|
137
|
+
var we;
|
|
138
138
|
class c {
|
|
139
139
|
constructor(t) {
|
|
140
140
|
a(this, "_iterator");
|
|
141
141
|
a(this, "return");
|
|
142
142
|
a(this, "throw");
|
|
143
|
-
a(this,
|
|
143
|
+
a(this, we, "SmartIterator");
|
|
144
144
|
t instanceof Function ? this._iterator = t() : Symbol.iterator in t ? this._iterator = t[Symbol.iterator]() : this._iterator = t, this._iterator.return && (this.return = (e) => this._iterator.return(e)), this._iterator.throw && (this.throw = (e) => this._iterator.throw(e));
|
|
145
145
|
}
|
|
146
146
|
every(t) {
|
|
@@ -300,16 +300,16 @@ class c {
|
|
|
300
300
|
toArray() {
|
|
301
301
|
return Array.from(this);
|
|
302
302
|
}
|
|
303
|
-
[(
|
|
303
|
+
[(we = Symbol.toStringTag, Symbol.iterator)]() {
|
|
304
304
|
return this;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
var
|
|
308
|
-
|
|
307
|
+
var pe;
|
|
308
|
+
pe = Symbol.toStringTag;
|
|
309
309
|
const b = class b {
|
|
310
310
|
constructor(t) {
|
|
311
311
|
a(this, "_elements");
|
|
312
|
-
a(this,
|
|
312
|
+
a(this, pe, "ReducedIterator");
|
|
313
313
|
this._elements = new c(t);
|
|
314
314
|
}
|
|
315
315
|
every(t) {
|
|
@@ -424,12 +424,12 @@ const b = class b {
|
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
426
|
let d = b;
|
|
427
|
-
var
|
|
428
|
-
|
|
427
|
+
var ye;
|
|
428
|
+
ye = Symbol.toStringTag;
|
|
429
429
|
const y = class y {
|
|
430
430
|
constructor(t) {
|
|
431
431
|
a(this, "_elements");
|
|
432
|
-
a(this,
|
|
432
|
+
a(this, ye, "AggregatedAsyncIterator");
|
|
433
433
|
this._elements = new w(t);
|
|
434
434
|
}
|
|
435
435
|
async every(t) {
|
|
@@ -608,13 +608,13 @@ const y = class y {
|
|
|
608
608
|
}
|
|
609
609
|
};
|
|
610
610
|
let E = y;
|
|
611
|
-
var
|
|
611
|
+
var ge;
|
|
612
612
|
class w {
|
|
613
613
|
constructor(t) {
|
|
614
614
|
a(this, "_iterator");
|
|
615
615
|
a(this, "return");
|
|
616
616
|
a(this, "throw");
|
|
617
|
-
a(this,
|
|
617
|
+
a(this, ge, "SmartAsyncIterator");
|
|
618
618
|
if (t instanceof Function) {
|
|
619
619
|
const e = t();
|
|
620
620
|
Symbol.asyncIterator in e ? this._iterator = e : this._iterator = async function* () {
|
|
@@ -807,16 +807,16 @@ class w {
|
|
|
807
807
|
toArray() {
|
|
808
808
|
return Array.fromAsync(this);
|
|
809
809
|
}
|
|
810
|
-
[(
|
|
810
|
+
[(ge = Symbol.toStringTag, Symbol.asyncIterator)]() {
|
|
811
811
|
return this;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
var
|
|
815
|
-
|
|
814
|
+
var be;
|
|
815
|
+
be = Symbol.toStringTag;
|
|
816
816
|
const g = class g {
|
|
817
817
|
constructor(t) {
|
|
818
818
|
a(this, "_elements");
|
|
819
|
-
a(this,
|
|
819
|
+
a(this, be, "AggregatedIterator");
|
|
820
820
|
this._elements = new c(t);
|
|
821
821
|
}
|
|
822
822
|
every(t) {
|
|
@@ -998,41 +998,56 @@ const g = class g {
|
|
|
998
998
|
}
|
|
999
999
|
};
|
|
1000
1000
|
let S = g;
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1001
|
+
const He = Function;
|
|
1002
|
+
var xe, ve;
|
|
1003
|
+
class Qe extends (ve = He, xe = Symbol.toStringTag, ve) {
|
|
1003
1004
|
constructor() {
|
|
1004
1005
|
super("return this.invoke(...arguments);");
|
|
1005
|
-
|
|
1006
|
-
|
|
1006
|
+
a(this, xe, "CallableObject");
|
|
1007
|
+
const e = this.bind(this);
|
|
1008
|
+
return Object.setPrototypeOf(this, e), e;
|
|
1007
1009
|
}
|
|
1008
1010
|
}
|
|
1009
|
-
var
|
|
1010
|
-
|
|
1011
|
+
var ke;
|
|
1012
|
+
ke = Symbol.toStringTag;
|
|
1011
1013
|
class M {
|
|
1012
1014
|
constructor() {
|
|
1013
1015
|
a(this, "_subscribers");
|
|
1014
|
-
a(this,
|
|
1016
|
+
a(this, ke, "Publisher");
|
|
1015
1017
|
this._subscribers = /* @__PURE__ */ new Map();
|
|
1016
1018
|
}
|
|
1019
|
+
clear() {
|
|
1020
|
+
this._subscribers.clear();
|
|
1021
|
+
}
|
|
1022
|
+
publish(t, ...e) {
|
|
1023
|
+
const n = this._subscribers.get(t);
|
|
1024
|
+
return n ? n.slice().map((s) => s(...e)) : [];
|
|
1025
|
+
}
|
|
1017
1026
|
subscribe(t, e) {
|
|
1018
1027
|
this._subscribers.has(t) || this._subscribers.set(t, []);
|
|
1019
1028
|
const n = this._subscribers.get(t);
|
|
1020
1029
|
return n.push(e), () => {
|
|
1021
1030
|
const s = n.indexOf(e);
|
|
1022
1031
|
if (s < 0)
|
|
1023
|
-
throw new
|
|
1032
|
+
throw new I("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");
|
|
1024
1033
|
n.splice(s, 1);
|
|
1025
1034
|
};
|
|
1026
1035
|
}
|
|
1027
|
-
|
|
1036
|
+
unsubscribe(t, e) {
|
|
1028
1037
|
const n = this._subscribers.get(t);
|
|
1029
|
-
|
|
1038
|
+
if (!n)
|
|
1039
|
+
return;
|
|
1040
|
+
const s = n.indexOf(e);
|
|
1041
|
+
if (s < 0)
|
|
1042
|
+
throw new I("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed or was never subscribed.");
|
|
1043
|
+
n.splice(s, 1);
|
|
1030
1044
|
}
|
|
1031
1045
|
}
|
|
1032
|
-
|
|
1046
|
+
var Se, Te;
|
|
1047
|
+
class at extends (Te = Qe, Se = Symbol.toStringTag, Te) {
|
|
1033
1048
|
constructor() {
|
|
1034
1049
|
const e = () => {
|
|
1035
|
-
throw new
|
|
1050
|
+
throw new Ge(
|
|
1036
1051
|
"The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?"
|
|
1037
1052
|
);
|
|
1038
1053
|
};
|
|
@@ -1042,6 +1057,7 @@ class st extends Ge {
|
|
|
1042
1057
|
a(this, "_isEnabled");
|
|
1043
1058
|
a(this, "_key");
|
|
1044
1059
|
a(this, "invoke");
|
|
1060
|
+
a(this, Se, "SwitchableCallback");
|
|
1045
1061
|
this._callback = e, this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, this._key = "", this.invoke = (...n) => this._callback(...n);
|
|
1046
1062
|
}
|
|
1047
1063
|
get isEnabled() {
|
|
@@ -1083,17 +1099,17 @@ class st extends Ge {
|
|
|
1083
1099
|
this._key = e, this._isEnabled && (this._callback = this._callbacks.get(e));
|
|
1084
1100
|
}
|
|
1085
1101
|
}
|
|
1086
|
-
var
|
|
1087
|
-
|
|
1088
|
-
class
|
|
1102
|
+
var Ee;
|
|
1103
|
+
Ee = Symbol.toStringTag;
|
|
1104
|
+
class Ve {
|
|
1089
1105
|
constructor(t, e = 40) {
|
|
1090
1106
|
a(this, "_handle");
|
|
1091
1107
|
a(this, "_startTime");
|
|
1092
1108
|
a(this, "_isRunning");
|
|
1093
1109
|
a(this, "_start");
|
|
1094
1110
|
a(this, "_stop");
|
|
1095
|
-
a(this,
|
|
1096
|
-
this._startTime = 0, this._isRunning = !1,
|
|
1111
|
+
a(this, Ee, "GameLoop");
|
|
1112
|
+
this._startTime = 0, this._isRunning = !1, Ye ? (this._start = () => {
|
|
1097
1113
|
t(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
|
|
1098
1114
|
}, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(
|
|
1099
1115
|
`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`
|
|
@@ -1123,16 +1139,16 @@ class qe {
|
|
|
1123
1139
|
this._stop(), this._handle = void 0, this._isRunning = !1;
|
|
1124
1140
|
}
|
|
1125
1141
|
}
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
class
|
|
1142
|
+
var Me;
|
|
1143
|
+
Me = Symbol.toStringTag;
|
|
1144
|
+
class lt {
|
|
1129
1145
|
constructor(t = !0) {
|
|
1130
1146
|
a(this, "_preferPersistence");
|
|
1131
1147
|
a(this, "_volatile");
|
|
1132
1148
|
a(this, "_persistent");
|
|
1133
|
-
a(this,
|
|
1134
|
-
if (this._preferPersistence = t, !
|
|
1135
|
-
throw new
|
|
1149
|
+
a(this, Me, "JSONStorage");
|
|
1150
|
+
if (this._preferPersistence = t, !Ye)
|
|
1151
|
+
throw new Ke(
|
|
1136
1152
|
"The `JSONStorage` class can only be instantiated within a browser environment."
|
|
1137
1153
|
);
|
|
1138
1154
|
this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
@@ -1265,15 +1281,15 @@ class rt {
|
|
|
1265
1281
|
this._volatile.removeItem(t), this._persistent.removeItem(t);
|
|
1266
1282
|
}
|
|
1267
1283
|
}
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1284
|
+
var Fe;
|
|
1285
|
+
Fe = Symbol.toStringTag;
|
|
1270
1286
|
const R = class R {
|
|
1271
1287
|
constructor(t) {
|
|
1272
1288
|
a(this, "_isPending");
|
|
1273
1289
|
a(this, "_isFulfilled");
|
|
1274
1290
|
a(this, "_isRejected");
|
|
1275
1291
|
a(this, "_promise");
|
|
1276
|
-
a(this,
|
|
1292
|
+
a(this, Fe, "SmartPromise");
|
|
1277
1293
|
this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
|
|
1278
1294
|
const e = (s) => (this._isPending = !1, this._isFulfilled = !0, s), n = (s) => {
|
|
1279
1295
|
throw this._isPending = !1, this._isRejected = !0, s;
|
|
@@ -1303,8 +1319,8 @@ const R = class R {
|
|
|
1303
1319
|
}
|
|
1304
1320
|
};
|
|
1305
1321
|
let T = R;
|
|
1306
|
-
var
|
|
1307
|
-
class
|
|
1322
|
+
var Re, Pe;
|
|
1323
|
+
class Xe extends (Pe = T, Re = Symbol.toStringTag, Pe) {
|
|
1308
1324
|
constructor(e, n) {
|
|
1309
1325
|
let s, r;
|
|
1310
1326
|
super((o, l) => {
|
|
@@ -1312,7 +1328,7 @@ class Ke extends (Te = T, Se = Symbol.toStringTag, Te) {
|
|
|
1312
1328
|
});
|
|
1313
1329
|
a(this, "_resolve");
|
|
1314
1330
|
a(this, "_reject");
|
|
1315
|
-
a(this,
|
|
1331
|
+
a(this, Re, "DeferredPromise");
|
|
1316
1332
|
this._promise.then(e, n), this._resolve = s, this._reject = r;
|
|
1317
1333
|
}
|
|
1318
1334
|
get resolve() {
|
|
@@ -1325,17 +1341,17 @@ class Ke extends (Te = T, Se = Symbol.toStringTag, Te) {
|
|
|
1325
1341
|
return e.then(this.resolve, this.reject), this;
|
|
1326
1342
|
}
|
|
1327
1343
|
}
|
|
1328
|
-
function
|
|
1344
|
+
function ut(i) {
|
|
1329
1345
|
return new Promise((t) => setTimeout(t, i));
|
|
1330
1346
|
}
|
|
1331
|
-
function
|
|
1347
|
+
function ct() {
|
|
1332
1348
|
return new Promise((i) => requestAnimationFrame(() => i()));
|
|
1333
1349
|
}
|
|
1334
1350
|
function v() {
|
|
1335
1351
|
return new Promise((i) => setTimeout(i));
|
|
1336
1352
|
}
|
|
1337
|
-
var
|
|
1338
|
-
|
|
1353
|
+
var De;
|
|
1354
|
+
De = Symbol.toStringTag;
|
|
1339
1355
|
const P = class P {
|
|
1340
1356
|
constructor(t, e) {
|
|
1341
1357
|
a(this, "_startTime");
|
|
@@ -1348,7 +1364,7 @@ const P = class P {
|
|
|
1348
1364
|
a(this, "_hasFailed");
|
|
1349
1365
|
a(this, "_promise");
|
|
1350
1366
|
a(this, "_publisher");
|
|
1351
|
-
a(this,
|
|
1367
|
+
a(this, De, "LongRunningTask");
|
|
1352
1368
|
this._startTime = 0, this._estimatedTime = 0, this._currentStep = 0, this._percentage = 0, this._isRunning = !0, this._hasCompleted = !1, this._hasFailed = !1;
|
|
1353
1369
|
const n = (o) => (this._estimatedTime = 0, this._endTime = Date.now(), this._percentage = 100, this._isRunning = !1, this._hasCompleted = !0, o), s = (o) => {
|
|
1354
1370
|
throw this._endTime = Date.now(), this._isRunning = !1, this._hasFailed = !0, o;
|
|
@@ -1387,10 +1403,10 @@ const P = class P {
|
|
|
1387
1403
|
try {
|
|
1388
1404
|
const h = t();
|
|
1389
1405
|
for (this._startTime = Date.now(); ; ) {
|
|
1390
|
-
const { done: _, value:
|
|
1406
|
+
const { done: _, value: C } = await h.next();
|
|
1391
1407
|
if (_)
|
|
1392
|
-
return l(
|
|
1393
|
-
o(
|
|
1408
|
+
return l(C);
|
|
1409
|
+
o(C), this._publisher.publish("progress"), await v();
|
|
1394
1410
|
}
|
|
1395
1411
|
} catch (h) {
|
|
1396
1412
|
u(h);
|
|
@@ -1477,13 +1493,13 @@ const P = class P {
|
|
|
1477
1493
|
return this._publisher.subscribe("progress", t);
|
|
1478
1494
|
}
|
|
1479
1495
|
};
|
|
1480
|
-
let
|
|
1481
|
-
var
|
|
1482
|
-
|
|
1483
|
-
class
|
|
1496
|
+
let j = P;
|
|
1497
|
+
var Ce;
|
|
1498
|
+
Ce = Symbol.toStringTag;
|
|
1499
|
+
class ht {
|
|
1484
1500
|
constructor() {
|
|
1485
1501
|
a(this, "_onFulfilled");
|
|
1486
|
-
a(this,
|
|
1502
|
+
a(this, Ce, "Thenable");
|
|
1487
1503
|
this._onFulfilled = (t) => t;
|
|
1488
1504
|
}
|
|
1489
1505
|
_resolve(t) {
|
|
@@ -1532,25 +1548,25 @@ class at {
|
|
|
1532
1548
|
return this;
|
|
1533
1549
|
}
|
|
1534
1550
|
}
|
|
1535
|
-
var
|
|
1536
|
-
class
|
|
1551
|
+
var Ie, je;
|
|
1552
|
+
class ft extends (je = T, Ie = Symbol.toStringTag, je) {
|
|
1537
1553
|
constructor(e, n) {
|
|
1538
1554
|
super((s, r) => {
|
|
1539
1555
|
const o = (_) => {
|
|
1540
1556
|
clearTimeout(h), s(_);
|
|
1541
1557
|
}, l = (_) => {
|
|
1542
1558
|
clearTimeout(h), r(_);
|
|
1543
|
-
}, h = setTimeout(() => l(new
|
|
1559
|
+
}, h = setTimeout(() => l(new Le("The operation has timed out.")), n);
|
|
1544
1560
|
e(o, l);
|
|
1545
1561
|
});
|
|
1546
|
-
a(this,
|
|
1562
|
+
a(this, Ie, "TimedPromise");
|
|
1547
1563
|
}
|
|
1548
1564
|
}
|
|
1549
1565
|
var F = /* @__PURE__ */ ((i) => (i[i.Millisecond = 1] = "Millisecond", i[i.Second = 1e3] = "Second", i[i.Minute = 6e4] = "Minute", i[i.Hour = 36e5] = "Hour", i[i.Day = 864e5] = "Day", i[i.Week = 6048e5] = "Week", i[i.Month = 2592e6] = "Month", i[i.Year = 31536e6] = "Year", i))(F || {});
|
|
1550
|
-
function
|
|
1566
|
+
function dt(i, t, e = 864e5) {
|
|
1551
1567
|
return i = new Date(i), t = new Date(t), Math.floor((t.getTime() - i.getTime()) / e);
|
|
1552
1568
|
}
|
|
1553
|
-
function
|
|
1569
|
+
function mt(i, t, e = 864e5) {
|
|
1554
1570
|
return i = new Date(i), t = new Date(t), new c(function* () {
|
|
1555
1571
|
const n = t.getTime();
|
|
1556
1572
|
let s = i.getTime();
|
|
@@ -1558,15 +1574,15 @@ function ct(i, t, e = 864e5) {
|
|
|
1558
1574
|
yield new Date(s), s += e;
|
|
1559
1575
|
});
|
|
1560
1576
|
}
|
|
1561
|
-
function
|
|
1577
|
+
function _t(i, t = 864e5) {
|
|
1562
1578
|
return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
|
|
1563
1579
|
}
|
|
1564
|
-
var
|
|
1565
|
-
class
|
|
1580
|
+
var Oe, Ae;
|
|
1581
|
+
class wt extends (Ae = Ve, Oe = Symbol.toStringTag, Ae) {
|
|
1566
1582
|
constructor(e = F.Second) {
|
|
1567
1583
|
super((n) => this._publisher.publish("tick", n), e);
|
|
1568
1584
|
a(this, "_publisher");
|
|
1569
|
-
a(this,
|
|
1585
|
+
a(this, Oe, "Clock");
|
|
1570
1586
|
this._publisher = new M();
|
|
1571
1587
|
}
|
|
1572
1588
|
start(e = 0) {
|
|
@@ -1587,7 +1603,7 @@ class ft extends (De = qe, Pe = Symbol.toStringTag, De) {
|
|
|
1587
1603
|
}
|
|
1588
1604
|
onTick(e, n = 0) {
|
|
1589
1605
|
if (n < 0)
|
|
1590
|
-
throw new
|
|
1606
|
+
throw new Je("The tick step must be a non-negative number.");
|
|
1591
1607
|
if (n === 0)
|
|
1592
1608
|
return this._publisher.subscribe("tick", e);
|
|
1593
1609
|
let s = 0;
|
|
@@ -1596,8 +1612,8 @@ class ft extends (De = qe, Pe = Symbol.toStringTag, De) {
|
|
|
1596
1612
|
});
|
|
1597
1613
|
}
|
|
1598
1614
|
}
|
|
1599
|
-
var
|
|
1600
|
-
class
|
|
1615
|
+
var $e, qe;
|
|
1616
|
+
class pt extends (qe = Ve, $e = Symbol.toStringTag, qe) {
|
|
1601
1617
|
constructor(e, n = F.Second) {
|
|
1602
1618
|
super(() => {
|
|
1603
1619
|
const r = this.remainingTime;
|
|
@@ -1606,7 +1622,7 @@ class dt extends (Ce = qe, Ie = Symbol.toStringTag, Ce) {
|
|
|
1606
1622
|
a(this, "_deferrer");
|
|
1607
1623
|
a(this, "_publisher");
|
|
1608
1624
|
a(this, "_duration");
|
|
1609
|
-
a(this,
|
|
1625
|
+
a(this, $e, "Countdown");
|
|
1610
1626
|
this._publisher = new M(), this._duration = e;
|
|
1611
1627
|
}
|
|
1612
1628
|
get duration() {
|
|
@@ -1627,7 +1643,7 @@ class dt extends (Ce = qe, Ie = Symbol.toStringTag, Ce) {
|
|
|
1627
1643
|
throw new m("The countdown has already been started.");
|
|
1628
1644
|
if (this._deferrer)
|
|
1629
1645
|
throw new k();
|
|
1630
|
-
return this._deferrer = new
|
|
1646
|
+
return this._deferrer = new Xe(), super.start(this.duration - e), this._publisher.publish("start"), this._deferrer;
|
|
1631
1647
|
}
|
|
1632
1648
|
stop(e) {
|
|
1633
1649
|
this._deferrerStop(e), this._publisher.publish("stop", e);
|
|
@@ -1643,7 +1659,7 @@ class dt extends (Ce = qe, Ie = Symbol.toStringTag, Ce) {
|
|
|
1643
1659
|
}
|
|
1644
1660
|
onTick(e, n = 0) {
|
|
1645
1661
|
if (n < 0)
|
|
1646
|
-
throw new
|
|
1662
|
+
throw new Je("The tick step must be a non-negative number.");
|
|
1647
1663
|
if (n === 0)
|
|
1648
1664
|
return this._publisher.subscribe("tick", e);
|
|
1649
1665
|
let s = 0;
|
|
@@ -1652,11 +1668,11 @@ class dt extends (Ce = qe, Ie = Symbol.toStringTag, Ce) {
|
|
|
1652
1668
|
});
|
|
1653
1669
|
}
|
|
1654
1670
|
}
|
|
1655
|
-
var
|
|
1656
|
-
|
|
1671
|
+
var Ne;
|
|
1672
|
+
Ne = Symbol.toStringTag;
|
|
1657
1673
|
const D = class D {
|
|
1658
1674
|
constructor() {
|
|
1659
|
-
a(this,
|
|
1675
|
+
a(this, Ne, "Random");
|
|
1660
1676
|
}
|
|
1661
1677
|
static Boolean(t = 0.5) {
|
|
1662
1678
|
return Math.random() < t;
|
|
@@ -1676,21 +1692,21 @@ const D = class D {
|
|
|
1676
1692
|
return t[D.Index(t)];
|
|
1677
1693
|
}
|
|
1678
1694
|
};
|
|
1679
|
-
let
|
|
1680
|
-
function
|
|
1695
|
+
let O = D;
|
|
1696
|
+
function yt(i, t = "text/javascript") {
|
|
1681
1697
|
return new Promise((e, n) => {
|
|
1682
1698
|
const s = document.createElement("script");
|
|
1683
1699
|
s.async = !0, s.defer = !0, s.src = i, s.type = t, s.onload = () => e(), s.onerror = () => n(), document.body.appendChild(s);
|
|
1684
1700
|
});
|
|
1685
1701
|
}
|
|
1686
|
-
function
|
|
1702
|
+
function gt(...i) {
|
|
1687
1703
|
return new c(function* () {
|
|
1688
1704
|
for (const t of i)
|
|
1689
1705
|
for (const e of t)
|
|
1690
1706
|
yield e;
|
|
1691
1707
|
});
|
|
1692
1708
|
}
|
|
1693
|
-
function
|
|
1709
|
+
function bt(i) {
|
|
1694
1710
|
if (Array.isArray(i))
|
|
1695
1711
|
return i.length;
|
|
1696
1712
|
let t = 0;
|
|
@@ -1698,21 +1714,21 @@ function wt(i) {
|
|
|
1698
1714
|
t += 1;
|
|
1699
1715
|
return t;
|
|
1700
1716
|
}
|
|
1701
|
-
function
|
|
1717
|
+
function xt(i) {
|
|
1702
1718
|
return new c(function* () {
|
|
1703
1719
|
let t = 0;
|
|
1704
1720
|
for (const e of i)
|
|
1705
1721
|
yield [t, e], t += 1;
|
|
1706
1722
|
});
|
|
1707
1723
|
}
|
|
1708
|
-
function
|
|
1724
|
+
function vt(i, t, e = 1) {
|
|
1709
1725
|
return new c(function* () {
|
|
1710
1726
|
t === void 0 && (t = i, i = 0), i > t && (e = e ?? -1);
|
|
1711
1727
|
for (let n = i; n < t; n += e)
|
|
1712
1728
|
yield n;
|
|
1713
1729
|
});
|
|
1714
1730
|
}
|
|
1715
|
-
function
|
|
1731
|
+
function kt(i) {
|
|
1716
1732
|
const t = Array.from(i);
|
|
1717
1733
|
for (let e = t.length - 1; e > 0; e -= 1) {
|
|
1718
1734
|
const n = Math.floor(Math.random() * (e + 1));
|
|
@@ -1720,14 +1736,14 @@ function gt(i) {
|
|
|
1720
1736
|
}
|
|
1721
1737
|
return t;
|
|
1722
1738
|
}
|
|
1723
|
-
function
|
|
1739
|
+
function St(i) {
|
|
1724
1740
|
return new c(function* () {
|
|
1725
1741
|
const t = /* @__PURE__ */ new Set();
|
|
1726
1742
|
for (const e of i)
|
|
1727
1743
|
t.has(e) || (t.add(e), yield e);
|
|
1728
1744
|
});
|
|
1729
1745
|
}
|
|
1730
|
-
function
|
|
1746
|
+
function Ze(i, t) {
|
|
1731
1747
|
return new c(function* () {
|
|
1732
1748
|
const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
|
|
1733
1749
|
for (; ; ) {
|
|
@@ -1738,7 +1754,7 @@ function Le(i, t) {
|
|
|
1738
1754
|
}
|
|
1739
1755
|
});
|
|
1740
1756
|
}
|
|
1741
|
-
function
|
|
1757
|
+
function Tt(i, t) {
|
|
1742
1758
|
if (t === void 0) {
|
|
1743
1759
|
let r = 0, o = 0;
|
|
1744
1760
|
for (const l of i)
|
|
@@ -1748,7 +1764,7 @@ function xt(i, t) {
|
|
|
1748
1764
|
return r / o;
|
|
1749
1765
|
}
|
|
1750
1766
|
let e = 0, n = 0, s = 0;
|
|
1751
|
-
for (const [r, o] of
|
|
1767
|
+
for (const [r, o] of Ze(i, t)) {
|
|
1752
1768
|
if (o <= 0)
|
|
1753
1769
|
throw new p(`The weight for the value #${s} must be greater than zero.`);
|
|
1754
1770
|
e += r * o, n += o, s += 1;
|
|
@@ -1759,7 +1775,7 @@ function xt(i, t) {
|
|
|
1759
1775
|
throw new p("The sum of weights must be greater than zero.");
|
|
1760
1776
|
return e / n;
|
|
1761
1777
|
}
|
|
1762
|
-
function
|
|
1778
|
+
function Et(i) {
|
|
1763
1779
|
let t = 0;
|
|
1764
1780
|
for (let e = 0; e < i.length; e += 1) {
|
|
1765
1781
|
const n = i.charCodeAt(e);
|
|
@@ -1767,72 +1783,72 @@ function vt(i) {
|
|
|
1767
1783
|
}
|
|
1768
1784
|
return t;
|
|
1769
1785
|
}
|
|
1770
|
-
function
|
|
1786
|
+
function Mt(i) {
|
|
1771
1787
|
let t = 0;
|
|
1772
1788
|
for (const e of i)
|
|
1773
1789
|
t += e;
|
|
1774
1790
|
return t;
|
|
1775
1791
|
}
|
|
1776
|
-
function
|
|
1792
|
+
function Ft(i) {
|
|
1777
1793
|
return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
|
|
1778
1794
|
}
|
|
1779
|
-
const
|
|
1795
|
+
const Rt = "2.0.0-rc.11";
|
|
1780
1796
|
export {
|
|
1781
1797
|
E as AggregatedAsyncIterator,
|
|
1782
1798
|
S as AggregatedIterator,
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1799
|
+
Qe as CallableObject,
|
|
1800
|
+
wt as Clock,
|
|
1801
|
+
pt as Countdown,
|
|
1802
|
+
Xe as DeferredPromise,
|
|
1787
1803
|
f as Exception,
|
|
1788
1804
|
k as FatalErrorException,
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1805
|
+
ze as FileException,
|
|
1806
|
+
nt as FileExistsException,
|
|
1807
|
+
st as FileNotFoundException,
|
|
1808
|
+
Ve as GameLoop,
|
|
1809
|
+
lt as JSONStorage,
|
|
1794
1810
|
x as KeyException,
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1811
|
+
j as LongRunningTask,
|
|
1812
|
+
rt as NetworkException,
|
|
1813
|
+
Ge as NotImplementedException,
|
|
1814
|
+
it as PermissionException,
|
|
1799
1815
|
M as Publisher,
|
|
1800
|
-
|
|
1801
|
-
|
|
1816
|
+
O as Random,
|
|
1817
|
+
Je as RangeException,
|
|
1802
1818
|
d as ReducedIterator,
|
|
1803
|
-
|
|
1819
|
+
I as ReferenceException,
|
|
1804
1820
|
m as RuntimeException,
|
|
1805
1821
|
w as SmartAsyncIterator,
|
|
1806
1822
|
c as SmartIterator,
|
|
1807
1823
|
T as SmartPromise,
|
|
1808
|
-
|
|
1809
|
-
|
|
1824
|
+
at as SwitchableCallback,
|
|
1825
|
+
ht as Thenable,
|
|
1810
1826
|
F as TimeUnit,
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1827
|
+
ft as TimedPromise,
|
|
1828
|
+
Le as TimeoutException,
|
|
1829
|
+
ot as TypeException,
|
|
1830
|
+
Rt as VERSION,
|
|
1815
1831
|
p as ValueException,
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1832
|
+
Tt as average,
|
|
1833
|
+
Ft as capitalize,
|
|
1834
|
+
gt as chain,
|
|
1835
|
+
bt as count,
|
|
1836
|
+
dt as dateDifference,
|
|
1837
|
+
mt as dateRange,
|
|
1838
|
+
_t as dateRound,
|
|
1839
|
+
ut as delay,
|
|
1840
|
+
xt as enumerate,
|
|
1841
|
+
Et as hash,
|
|
1842
|
+
Ye as isBrowser,
|
|
1843
|
+
et as isNode,
|
|
1844
|
+
tt as isWebWorker,
|
|
1845
|
+
yt as loadScript,
|
|
1846
|
+
ct as nextAnimationFrame,
|
|
1847
|
+
vt as range,
|
|
1848
|
+
kt as shuffle,
|
|
1849
|
+
Mt as sum,
|
|
1850
|
+
St as unique,
|
|
1835
1851
|
v as yieldToEventLoop,
|
|
1836
|
-
|
|
1852
|
+
Ze as zip
|
|
1837
1853
|
};
|
|
1838
1854
|
//# sourceMappingURL=core.js.map
|