@opfr/services 0.34.7 → 0.35.1
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/index.es.js +117 -100
- package/dist/index.umd.js +3 -3
- package/dist/services/shop/definition/schema.d.ts.map +1 -1
- package/dist/services/shop/types.d.ts +2 -1
- package/dist/services/shop/types.d.ts.map +1 -1
- package/dist/shop/items/background.d.ts +3 -2
- package/dist/shop/items/background.d.ts.map +1 -1
- package/dist/shop/items/boostXp.d.ts +3 -2
- package/dist/shop/items/boostXp.d.ts.map +1 -1
- package/dist/shop/items/chest.d.ts +3 -2
- package/dist/shop/items/chest.d.ts.map +1 -1
- package/dist/shop/items/craft.d.ts +3 -2
- package/dist/shop/items/craft.d.ts.map +1 -1
- package/dist/shop/items/default.d.ts +2 -1
- package/dist/shop/items/default.d.ts.map +1 -1
- package/dist/shop/items/repair.d.ts +3 -2
- package/dist/shop/items/repair.d.ts.map +1 -1
- package/dist/shop/items/store.d.ts +3 -2
- package/dist/shop/items/store.d.ts.map +1 -1
- package/dist/shop/items/title.d.ts +3 -2
- package/dist/shop/items/title.d.ts.map +1 -1
- package/dist/shop/types.d.ts +4 -2
- package/dist/shop/types.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/index.es.js
CHANGED
|
@@ -93,7 +93,7 @@ function Hi(t) {
|
|
|
93
93
|
function te(t) {
|
|
94
94
|
return t instanceof Array || Object.prototype.toString.call(t) === "[object Array]";
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Fe(t) {
|
|
97
97
|
return t != null && Object.prototype.toString.call(t) === "[object Object]";
|
|
98
98
|
}
|
|
99
99
|
function x(t, a) {
|
|
@@ -238,9 +238,9 @@ function qi(t) {
|
|
|
238
238
|
function la(t, a) {
|
|
239
239
|
var s = Ce({}, t), n;
|
|
240
240
|
for (n in a)
|
|
241
|
-
x(a, n) && (
|
|
241
|
+
x(a, n) && (Fe(t[n]) && Fe(a[n]) ? (s[n] = {}, Ce(s[n], t[n]), Ce(s[n], a[n])) : a[n] != null ? s[n] = a[n] : delete s[n]);
|
|
242
242
|
for (n in t)
|
|
243
|
-
x(t, n) && !x(a, n) &&
|
|
243
|
+
x(t, n) && !x(a, n) && Fe(t[n]) && (s[n] = Ce({}, s[n]));
|
|
244
244
|
return s;
|
|
245
245
|
}
|
|
246
246
|
function Ua(t) {
|
|
@@ -494,7 +494,7 @@ function pl(t, a, s) {
|
|
|
494
494
|
function Nt(t) {
|
|
495
495
|
return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0;
|
|
496
496
|
}
|
|
497
|
-
var L = 0, pe = 1, ne = 2, N = 3, ee = 4, me = 5,
|
|
497
|
+
var L = 0, pe = 1, ne = 2, N = 3, ee = 4, me = 5, Te = 6, ml = 7, hl = 8;
|
|
498
498
|
g("Y", 0, 0, function() {
|
|
499
499
|
var t = this.year();
|
|
500
500
|
return t <= 9999 ? re(t, 4) : "+" + t;
|
|
@@ -1088,7 +1088,7 @@ function uo() {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
function Ea(t) {
|
|
1090
1090
|
var a, s = t._a;
|
|
1091
|
-
return s && w(t).overflow === -2 && (a = s[pe] < 0 || s[pe] > 11 ? pe : s[ne] < 1 || s[ne] > $a(s[L], s[pe]) ? ne : s[N] < 0 || s[N] > 24 || s[N] === 24 && (s[ee] !== 0 || s[me] !== 0 || s[
|
|
1091
|
+
return s && w(t).overflow === -2 && (a = s[pe] < 0 || s[pe] > 11 ? pe : s[ne] < 1 || s[ne] > $a(s[L], s[pe]) ? ne : s[N] < 0 || s[N] > 24 || s[N] === 24 && (s[ee] !== 0 || s[me] !== 0 || s[Te] !== 0) ? N : s[ee] < 0 || s[ee] > 59 ? ee : s[me] < 0 || s[me] > 59 ? me : s[Te] < 0 || s[Te] > 999 ? Te : -1, w(t)._overflowDayOfYear && (a < L || a > ne) && (a = ne), w(t)._overflowWeeks && a === -1 && (a = ml), w(t)._overflowWeekday && a === -1 && (a = hl), w(t).overflow = a), t;
|
|
1092
1092
|
}
|
|
1093
1093
|
var fo = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, po = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, mo = /Z|[+-]\d\d(?::?\d\d)?/, bt = [
|
|
1094
1094
|
["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
|
|
@@ -1257,7 +1257,7 @@ function Ya(t) {
|
|
|
1257
1257
|
t._a[a] = n[a] = r[a];
|
|
1258
1258
|
for (; a < 7; a++)
|
|
1259
1259
|
t._a[a] = n[a] = t._a[a] == null ? a === 2 ? 1 : 0 : t._a[a];
|
|
1260
|
-
t._a[N] === 24 && t._a[ee] === 0 && t._a[me] === 0 && t._a[
|
|
1260
|
+
t._a[N] === 24 && t._a[ee] === 0 && t._a[me] === 0 && t._a[Te] === 0 && (t._nextDay = !0, t._a[N] = 0), t._d = (t._useUTC ? tt : Bl).apply(
|
|
1261
1261
|
null,
|
|
1262
1262
|
n
|
|
1263
1263
|
), i = t._useUTC ? t._d.getUTCDay() : t._d.getDay(), t._tzm != null && t._d.setUTCMinutes(t._d.getUTCMinutes() - t._tzm), t._nextDay && (t._a[N] = 24), t._w && typeof t._w.d < "u" && t._w.d !== i && (w(t).weekdayMismatch = !0);
|
|
@@ -1333,11 +1333,11 @@ function Bo(t) {
|
|
|
1333
1333
|
var a = t._i;
|
|
1334
1334
|
q(a) ? t._d = new Date(m.now()) : ot(a) ? t._d = new Date(a.valueOf()) : typeof a == "string" ? ko(t) : te(a) ? (t._a = ln(a.slice(0), function(s) {
|
|
1335
1335
|
return parseInt(s, 10);
|
|
1336
|
-
}), Ya(t)) :
|
|
1336
|
+
}), Ya(t)) : Fe(a) ? Do(t) : _e(a) ? t._d = new Date(a) : m.createFromInputFallback(t);
|
|
1337
1337
|
}
|
|
1338
1338
|
function Bn(t, a, s, n, r) {
|
|
1339
1339
|
var i = {};
|
|
1340
|
-
return (a === !0 || a === !1) && (n = a, a = void 0), (s === !0 || s === !1) && (n = s, s = void 0), (
|
|
1340
|
+
return (a === !0 || a === !1) && (n = a, a = void 0), (s === !0 || s === !1) && (n = s, s = void 0), (Fe(t) && Ma(t) || te(t) && t.length === 0) && (t = void 0), i._isAMomentObject = !0, i._useUTC = i._isUTC = r, i._l = s, i._i = t, i._f = a, i._strict = n, Oo(i);
|
|
1341
1341
|
}
|
|
1342
1342
|
function O(t, a, s, n) {
|
|
1343
1343
|
return Bn(t, a, s, n, !1);
|
|
@@ -1518,16 +1518,16 @@ function se(t, a) {
|
|
|
1518
1518
|
h: v(n[N]) * r,
|
|
1519
1519
|
m: v(n[ee]) * r,
|
|
1520
1520
|
s: v(n[me]) * r,
|
|
1521
|
-
ms: v(ca(n[
|
|
1521
|
+
ms: v(ca(n[Te] * 1e3)) * r
|
|
1522
1522
|
// the millisecond decimal point is included in the match
|
|
1523
1523
|
}) : (n = Jo.exec(t)) ? (r = n[1] === "-" ? -1 : 1, s = {
|
|
1524
|
-
y:
|
|
1525
|
-
M:
|
|
1526
|
-
w:
|
|
1527
|
-
d:
|
|
1528
|
-
h:
|
|
1529
|
-
m:
|
|
1530
|
-
s:
|
|
1524
|
+
y: Re(n[2], r),
|
|
1525
|
+
M: Re(n[3], r),
|
|
1526
|
+
w: Re(n[4], r),
|
|
1527
|
+
d: Re(n[5], r),
|
|
1528
|
+
h: Re(n[6], r),
|
|
1529
|
+
m: Re(n[7], r),
|
|
1530
|
+
s: Re(n[8], r)
|
|
1531
1531
|
}) : s == null ? s = {} : typeof s == "object" && ("from" in s || "to" in s) && (d = Ko(
|
|
1532
1532
|
O(s.from),
|
|
1533
1533
|
O(s.to)
|
|
@@ -1535,7 +1535,7 @@ function se(t, a) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
se.fn = Pt.prototype;
|
|
1537
1537
|
se.invalid = No;
|
|
1538
|
-
function
|
|
1538
|
+
function Re(t, a) {
|
|
1539
1539
|
var s = t && parseFloat(t.replace(",", "."));
|
|
1540
1540
|
return (isNaN(s) ? 0 : s) * a;
|
|
1541
1541
|
}
|
|
@@ -1568,7 +1568,7 @@ function ad(t) {
|
|
|
1568
1568
|
return ae(t) || ot(t) || En(t) || _e(t) || nd(t) || sd(t) || t === null || t === void 0;
|
|
1569
1569
|
}
|
|
1570
1570
|
function sd(t) {
|
|
1571
|
-
var a =
|
|
1571
|
+
var a = Fe(t) && !Ma(t), s = !1, n = [
|
|
1572
1572
|
"years",
|
|
1573
1573
|
"year",
|
|
1574
1574
|
"y",
|
|
@@ -1605,7 +1605,7 @@ function nd(t) {
|
|
|
1605
1605
|
}).length === 0), a && s;
|
|
1606
1606
|
}
|
|
1607
1607
|
function rd(t) {
|
|
1608
|
-
var a =
|
|
1608
|
+
var a = Fe(t) && !Ma(t), s = !1, n = [
|
|
1609
1609
|
"sameDay",
|
|
1610
1610
|
"nextDay",
|
|
1611
1611
|
"lastDay",
|
|
@@ -2194,7 +2194,7 @@ var Se, Gn;
|
|
|
2194
2194
|
for (Se = "SSSS"; Se.length <= 9; Se += "S")
|
|
2195
2195
|
h(Se, Ge);
|
|
2196
2196
|
function ic(t, a) {
|
|
2197
|
-
a[
|
|
2197
|
+
a[Te] = v(("0." + t) * 1e3);
|
|
2198
2198
|
}
|
|
2199
2199
|
for (Se = "S"; Se.length <= 9; Se += "S")
|
|
2200
2200
|
D(Se, ic);
|
|
@@ -2866,6 +2866,7 @@ class Me {
|
|
|
2866
2866
|
e(this, "name");
|
|
2867
2867
|
e(this, "price");
|
|
2868
2868
|
e(this, "size");
|
|
2869
|
+
e(this, "currency");
|
|
2869
2870
|
e(this, "data");
|
|
2870
2871
|
if (this.constructor === Me)
|
|
2871
2872
|
throw new Error("Abstract classes can't be instantiated.");
|
|
@@ -2875,13 +2876,18 @@ class Me {
|
|
|
2875
2876
|
name: this.name,
|
|
2876
2877
|
price: this.price,
|
|
2877
2878
|
size: this.size,
|
|
2878
|
-
itemId: this.data.id
|
|
2879
|
+
itemId: this.data.id,
|
|
2880
|
+
currency: this.currency
|
|
2879
2881
|
};
|
|
2880
2882
|
}
|
|
2881
2883
|
async onBuy(a, s) {
|
|
2882
|
-
await Cr(a, -1 * this.price * s), await kr(
|
|
2884
|
+
this.currency === "berry" ? (await Cr(a, -1 * this.price * s), await kr(
|
|
2883
2885
|
a,
|
|
2884
2886
|
this.price * s
|
|
2887
|
+
)) : await Oe(
|
|
2888
|
+
a,
|
|
2889
|
+
this.currency,
|
|
2890
|
+
this.price * s
|
|
2885
2891
|
);
|
|
2886
2892
|
}
|
|
2887
2893
|
isBackground() {
|
|
@@ -2911,9 +2917,10 @@ class uu extends Me {
|
|
|
2911
2917
|
name: a,
|
|
2912
2918
|
price: s,
|
|
2913
2919
|
item: n,
|
|
2914
|
-
size: r
|
|
2920
|
+
size: r,
|
|
2921
|
+
currency: i
|
|
2915
2922
|
}) {
|
|
2916
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
2923
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2917
2924
|
}
|
|
2918
2925
|
async onBuy(a, s) {
|
|
2919
2926
|
await super.onBuy(a, s), await Qr(a, this.data.background.id);
|
|
@@ -2927,9 +2934,10 @@ class fu extends Me {
|
|
|
2927
2934
|
name: a,
|
|
2928
2935
|
price: s,
|
|
2929
2936
|
item: n,
|
|
2930
|
-
size: r
|
|
2937
|
+
size: r,
|
|
2938
|
+
currency: i
|
|
2931
2939
|
}) {
|
|
2932
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
2940
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2933
2941
|
}
|
|
2934
2942
|
async onBuy(a, s) {
|
|
2935
2943
|
await super.onBuy(a, s), await xe(a, this.data.id, s);
|
|
@@ -2943,9 +2951,10 @@ class pu extends Me {
|
|
|
2943
2951
|
name: a,
|
|
2944
2952
|
price: s,
|
|
2945
2953
|
item: n,
|
|
2946
|
-
size: r
|
|
2954
|
+
size: r,
|
|
2955
|
+
currency: i
|
|
2947
2956
|
}) {
|
|
2948
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
2957
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2949
2958
|
}
|
|
2950
2959
|
async onBuy(a, s) {
|
|
2951
2960
|
await super.onBuy(a, s), await xe(a, this.data.id, s);
|
|
@@ -2959,9 +2968,10 @@ class mu extends Me {
|
|
|
2959
2968
|
name: a,
|
|
2960
2969
|
price: s,
|
|
2961
2970
|
item: n,
|
|
2962
|
-
size: r
|
|
2971
|
+
size: r,
|
|
2972
|
+
currency: i
|
|
2963
2973
|
}) {
|
|
2964
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
2974
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2965
2975
|
}
|
|
2966
2976
|
async onBuy(a, s) {
|
|
2967
2977
|
await super.onBuy(a, s), await xe(a, this.data.id, s);
|
|
@@ -2975,9 +2985,10 @@ class hu extends Me {
|
|
|
2975
2985
|
name: a,
|
|
2976
2986
|
price: s,
|
|
2977
2987
|
item: n,
|
|
2978
|
-
size: r
|
|
2988
|
+
size: r,
|
|
2989
|
+
currency: i
|
|
2979
2990
|
}) {
|
|
2980
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
2991
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2981
2992
|
}
|
|
2982
2993
|
async onBuy(a, s) {
|
|
2983
2994
|
await super.onBuy(a, s), await xe(a, this.data.id, s);
|
|
@@ -2991,9 +3002,10 @@ class yu extends Me {
|
|
|
2991
3002
|
name: a,
|
|
2992
3003
|
price: s,
|
|
2993
3004
|
item: n,
|
|
2994
|
-
size: r
|
|
3005
|
+
size: r,
|
|
3006
|
+
currency: i
|
|
2995
3007
|
}) {
|
|
2996
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
3008
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
2997
3009
|
}
|
|
2998
3010
|
async onBuy(a, s) {
|
|
2999
3011
|
await super.onBuy(a, s), await xe(a, this.data.id, s);
|
|
@@ -3007,9 +3019,10 @@ class _u extends Me {
|
|
|
3007
3019
|
name: a,
|
|
3008
3020
|
price: s,
|
|
3009
3021
|
item: n,
|
|
3010
|
-
size: r
|
|
3022
|
+
size: r,
|
|
3023
|
+
currency: i
|
|
3011
3024
|
}) {
|
|
3012
|
-
super(), this.name = a, this.data = n, this.price = s, this.size = r;
|
|
3025
|
+
super(), this.name = a, this.data = n, this.price = s, this.size = r, this.currency = i;
|
|
3013
3026
|
}
|
|
3014
3027
|
async onBuy(a, s) {
|
|
3015
3028
|
await super.onBuy(a, s), await us(a, this.data.title.name);
|
|
@@ -3021,21 +3034,21 @@ class _u extends Me {
|
|
|
3021
3034
|
const Jn = (t, a) => {
|
|
3022
3035
|
const s = t.items.find((n) => n.itemId === a);
|
|
3023
3036
|
if (s) {
|
|
3024
|
-
const { name: n, price: r, size: i } = s,
|
|
3025
|
-
if (Mi(
|
|
3026
|
-
return new uu({ name: n, price: r, item:
|
|
3027
|
-
if (ki(
|
|
3028
|
-
return new _u({ name: n, price: r, item:
|
|
3029
|
-
if (xi(
|
|
3030
|
-
return new pu({ name: n, price: r, item:
|
|
3031
|
-
if (Ui(
|
|
3032
|
-
return new fu({ name: n, price: r, item:
|
|
3033
|
-
if (Ci(
|
|
3034
|
-
return new hu({ name: n, price: r, item:
|
|
3035
|
-
if (Si(
|
|
3036
|
-
return new yu({ name: n, price: r, item:
|
|
3037
|
-
if (Di(
|
|
3038
|
-
return new mu({ name: n, price: r, item:
|
|
3037
|
+
const { name: n, price: r, size: i, currency: d } = s, c = vi(s.itemId);
|
|
3038
|
+
if (Mi(c))
|
|
3039
|
+
return new uu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3040
|
+
if (ki(c))
|
|
3041
|
+
return new _u({ name: n, price: r, item: c, size: i, currency: d });
|
|
3042
|
+
if (xi(c))
|
|
3043
|
+
return new pu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3044
|
+
if (Ui(c))
|
|
3045
|
+
return new fu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3046
|
+
if (Ci(c))
|
|
3047
|
+
return new hu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3048
|
+
if (Si(c))
|
|
3049
|
+
return new yu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3050
|
+
if (Di(c))
|
|
3051
|
+
return new mu({ name: n, price: r, item: c, size: i, currency: d });
|
|
3039
3052
|
}
|
|
3040
3053
|
}, gu = (t) => {
|
|
3041
3054
|
const a = [];
|
|
@@ -3048,30 +3061,34 @@ const Jn = (t, a) => {
|
|
|
3048
3061
|
__proto__: null,
|
|
3049
3062
|
getShopItem: Jn,
|
|
3050
3063
|
getShopItemList: gu
|
|
3051
|
-
}, Symbol.toStringTag, { value: "Module" })), Kn = new b(
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3064
|
+
}, Symbol.toStringTag, { value: "Module" })), Kn = new b(
|
|
3065
|
+
{
|
|
3066
|
+
shopType: { type: String, required: !0, unique: !0 },
|
|
3067
|
+
publishedAt: { type: Date, default: /* @__PURE__ */ new Date() },
|
|
3068
|
+
duration: { type: Number, default: null },
|
|
3069
|
+
closeAt: { type: Date, default: null },
|
|
3070
|
+
items: {
|
|
3071
|
+
type: [
|
|
3072
|
+
{
|
|
3073
|
+
name: String,
|
|
3074
|
+
price: Number,
|
|
3075
|
+
size: { type: Number, default: null },
|
|
3076
|
+
itemId: String,
|
|
3077
|
+
currency: String
|
|
3078
|
+
}
|
|
3079
|
+
],
|
|
3080
|
+
default: []
|
|
3081
|
+
},
|
|
3082
|
+
stats: {
|
|
3083
|
+
berrySpent: { type: Number, default: 0 },
|
|
3084
|
+
itemBought: { type: Number, default: 0 },
|
|
3085
|
+
chestBought: { type: Number, default: 0 },
|
|
3086
|
+
boostTimeBought: { type: Number, default: 0 },
|
|
3087
|
+
percentBought: { type: Number, default: 0 }
|
|
3088
|
+
}
|
|
3066
3089
|
},
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
itemBought: { type: Number, default: 0 },
|
|
3070
|
-
chestBought: { type: Number, default: 0 },
|
|
3071
|
-
boostTimeBought: { type: Number, default: 0 },
|
|
3072
|
-
percentBought: { type: Number, default: 0 }
|
|
3073
|
-
}
|
|
3074
|
-
});
|
|
3090
|
+
{ minimize: !1 }
|
|
3091
|
+
);
|
|
3075
3092
|
Kn.index({ shopType: 1 });
|
|
3076
3093
|
var Ts;
|
|
3077
3094
|
const Wa = ((Ts = T) == null ? void 0 : Ts.Shop) || F("Shop", Kn), wu = async (t, a) => {
|
|
@@ -8242,7 +8259,7 @@ const es = ((Es = T) == null ? void 0 : Es.UserEncyclopedia) || F("UserEncyclope
|
|
|
8242
8259
|
R(t.xp.amount) >= 30 && !nt(a, "training") && (await rt(a.user._id, "training"), Ot("raidUnlock", t.user._id, "training")), (((n = (s = a.obtainedRewards.training) == null ? void 0 : s.filter((r) => r.startsWith("end_"))) == null ? void 0 : n.length) ?? 0) >= 4 && !nt(a, "resources") && (await rt(a.user._id, "resources"), Ot("raidUnlock", t.user._id, "resources"));
|
|
8243
8260
|
}, yh = async (t) => {
|
|
8244
8261
|
const a = await ni(t.user._id);
|
|
8245
|
-
va(t.equipmentList, (s) => s.id).map((s) => Bi(s)).filter((s) => s.panoply === "adventurer").length === 6 && !nt(a, "pirate_cave") && (await rt(a.user._id, "pirate_cave"), Ot("raidUnlock", t.user._id, "pirate_cave")), (t.itemList.get("map_fragment") ?? 0) >= 5 && !nt(a, "mysterious_island") && (await rt(a.user._id, "mysterious_island"), await
|
|
8262
|
+
va(t.equipmentList, (s) => s.id).map((s) => Bi(s)).filter((s) => s.panoply === "adventurer").length === 6 && !nt(a, "pirate_cave") && (await rt(a.user._id, "pirate_cave"), Ot("raidUnlock", t.user._id, "pirate_cave")), (t.itemList.get("map_fragment") ?? 0) >= 5 && !nt(a, "mysterious_island") && (await rt(a.user._id, "mysterious_island"), await Oe(
|
|
8246
8263
|
t.user._id,
|
|
8247
8264
|
"map_fragment",
|
|
8248
8265
|
5
|
|
@@ -8799,7 +8816,7 @@ const Ye = ((Ns = T) == null ? void 0 : Ns.UserMeta) || F("UserMeta", ft), Ur =
|
|
|
8799
8816
|
userMeta: s,
|
|
8800
8817
|
userInventory: n
|
|
8801
8818
|
}) => {
|
|
8802
|
-
const r = s ?? await Gt(t, { buffs: 0, xp: 0 }), i = n ?? await ns(t, { itemList: 0, equipmentList: 0 }), c = await
|
|
8819
|
+
const r = s ?? await Gt(t, { buffs: 0, xp: 0 }), i = n ?? await ns(t, { itemList: 0, equipmentList: 0 }), c = await Be(t, r, i) - r.hp;
|
|
8803
8820
|
await I(t, {
|
|
8804
8821
|
$set: { hp: r.hp + Math.floor(Math.min(a, c)) }
|
|
8805
8822
|
});
|
|
@@ -8810,7 +8827,7 @@ const Ye = ((Ns = T) == null ? void 0 : Ns.UserMeta) || F("UserMeta", ft), Ur =
|
|
|
8810
8827
|
}
|
|
8811
8828
|
]);
|
|
8812
8829
|
}, ze = async (t, a) => {
|
|
8813
|
-
const s = await
|
|
8830
|
+
const s = await Be(t);
|
|
8814
8831
|
await I(t, [
|
|
8815
8832
|
{
|
|
8816
8833
|
$set: {
|
|
@@ -8826,21 +8843,21 @@ const Ye = ((Ns = T) == null ? void 0 : Ns.UserMeta) || F("UserMeta", ft), Ur =
|
|
|
8826
8843
|
}
|
|
8827
8844
|
]);
|
|
8828
8845
|
}, ay = async (t, a) => {
|
|
8829
|
-
const s = await
|
|
8846
|
+
const s = await Be(t), n = Object.fromEntries(
|
|
8830
8847
|
Object.entries(a).filter(([, r]) => r !== 0).map(([r, i]) => [`characteristics.${r}`, i])
|
|
8831
8848
|
);
|
|
8832
8849
|
await I(t, {
|
|
8833
8850
|
$inc: n
|
|
8834
8851
|
}), ze(t, s);
|
|
8835
8852
|
}, sy = async (t, a) => {
|
|
8836
|
-
const s = await
|
|
8853
|
+
const s = await Be(t), n = Object.fromEntries(
|
|
8837
8854
|
Object.entries(a).filter(([, r]) => r !== 0).map(([r, i]) => [`scrolls.${r}`, i])
|
|
8838
8855
|
);
|
|
8839
8856
|
await I(t, {
|
|
8840
8857
|
$inc: n
|
|
8841
8858
|
}), ze(t, s);
|
|
8842
8859
|
}, ny = async (t, a, s) => {
|
|
8843
|
-
const n = await
|
|
8860
|
+
const n = await Be(t, s), r = {
|
|
8844
8861
|
vitality: 0,
|
|
8845
8862
|
strength: 0,
|
|
8846
8863
|
agility: 0,
|
|
@@ -8953,7 +8970,7 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
8953
8970
|
t,
|
|
8954
8971
|
Ga(a).filter(([, s]) => s > 0).map(([s]) => s)
|
|
8955
8972
|
);
|
|
8956
|
-
},
|
|
8973
|
+
}, Oe = async (t, a, s) => {
|
|
8957
8974
|
s !== 0 && await ke(t, [
|
|
8958
8975
|
{
|
|
8959
8976
|
$set: {
|
|
@@ -8973,7 +8990,7 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
8973
8990
|
}
|
|
8974
8991
|
});
|
|
8975
8992
|
}, Or = async (t, a, s, n) => {
|
|
8976
|
-
s !== 0 && (ya(a) ? await Dr(t, a, n) : await
|
|
8993
|
+
s !== 0 && (ya(a) ? await Dr(t, a, n) : await Oe(t, a, s));
|
|
8977
8994
|
}, fy = async (t, a) => {
|
|
8978
8995
|
await ke(t, { $set: { [`itemList.${a}`]: 0 } });
|
|
8979
8996
|
}, Br = async (t, a) => {
|
|
@@ -8982,14 +8999,14 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
8982
8999
|
a.map((s) => s.id)
|
|
8983
9000
|
);
|
|
8984
9001
|
}, py = async (t, a, s) => {
|
|
8985
|
-
const n = await
|
|
9002
|
+
const n = await Be(t);
|
|
8986
9003
|
await ke(t, {
|
|
8987
9004
|
$set: {
|
|
8988
9005
|
[`equippedItems.${a}`]: s
|
|
8989
9006
|
}
|
|
8990
9007
|
}), await ze(t, n);
|
|
8991
9008
|
}, my = async (t, a) => {
|
|
8992
|
-
const s = await
|
|
9009
|
+
const s = await Be(t);
|
|
8993
9010
|
await ke(t, {
|
|
8994
9011
|
$set: {
|
|
8995
9012
|
[`equippedItems.${a}`]: null
|
|
@@ -8997,16 +9014,16 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
8997
9014
|
}), await ze(t, s);
|
|
8998
9015
|
}, hy = async (t, a, s, n, r) => {
|
|
8999
9016
|
for (const { itemId: c, size: f } of a)
|
|
9000
|
-
await
|
|
9017
|
+
await Oe(t, c, f * n);
|
|
9001
9018
|
const { itemId: i, size: d } = s;
|
|
9002
9019
|
ya(i) ? await Br(t, [{ id: i, seed: r }]) : await xe(t, i, d * n);
|
|
9003
9020
|
}, yy = async (t, a, s, n, r) => {
|
|
9004
9021
|
await Or(t, a.id, n, r);
|
|
9005
9022
|
for (const { entityId: i, quantity: d } of s)
|
|
9006
9023
|
ya(i) || await xe(t, i, n * d);
|
|
9007
|
-
await
|
|
9024
|
+
await Oe(t, "tools", 1);
|
|
9008
9025
|
}, _y = async (t, a, s, n) => {
|
|
9009
|
-
await
|
|
9026
|
+
await Oe(t, a, n * 4), await Oe(t, "enchanted_stone", n), await xe(t, s, n);
|
|
9010
9027
|
}, gy = async (t, a) => {
|
|
9011
9028
|
await ke(t, { $addToSet: { recipes: a } });
|
|
9012
9029
|
}, Pg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -9021,7 +9038,7 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
9021
9038
|
removeAllItemInventory: fy,
|
|
9022
9039
|
removeEquipment: Dr,
|
|
9023
9040
|
removeInventoryEntity: Or,
|
|
9024
|
-
removeInventoryItem:
|
|
9041
|
+
removeInventoryItem: Oe,
|
|
9025
9042
|
unequip: my,
|
|
9026
9043
|
unlockRecipe: gy
|
|
9027
9044
|
}, Symbol.toStringTag, { value: "Module" })), $r = async (t) => await qt.create({
|
|
@@ -9061,7 +9078,7 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
9061
9078
|
), Cy = (t) => t.buffs.cooldown.casino.reduce(
|
|
9062
9079
|
(a, { expireAt: s, startAt: n, multiplier: r }) => a + (/* @__PURE__ */ new Date() >= (n ?? /* @__PURE__ */ new Date()) && (!s || !Ee(s)) ? r : 0),
|
|
9063
9080
|
1
|
|
9064
|
-
),
|
|
9081
|
+
), Be = async (t, a, s) => {
|
|
9065
9082
|
const n = a ?? await Gt(t, { buffs: 0, xp: 0 }), r = s ?? await ns(t, { itemList: 0, equipmentList: 0 });
|
|
9066
9083
|
return ((rs(n).vitality ?? 0) + Ka(r).vitality) * Ei + Yi;
|
|
9067
9084
|
}, Sy = async (t, a, s, n) => {
|
|
@@ -9129,7 +9146,7 @@ const qt = ((Is = T) == null ? void 0 : Is.UserInventory) || F("UserInventory",
|
|
|
9129
9146
|
calcXpBoost: is,
|
|
9130
9147
|
getBerryRank: Oy,
|
|
9131
9148
|
getGlobalRank: Dy,
|
|
9132
|
-
getMaxHp:
|
|
9149
|
+
getMaxHp: Be,
|
|
9133
9150
|
getTotalCharacteristics: rs,
|
|
9134
9151
|
hasCharacteristicRequirement: Sy,
|
|
9135
9152
|
hasMalusBuff: By,
|
|
@@ -9595,15 +9612,15 @@ const Zt = ((Gs = T) == null ? void 0 : Gs.UserQuest) || F("UserQuest", ms), Bt
|
|
|
9595
9612
|
);
|
|
9596
9613
|
ai.index({ user: 1 });
|
|
9597
9614
|
var qs;
|
|
9598
|
-
const Jt = ((qs = T) == null ? void 0 : qs.UserRaid) || F("UserRaid", ai),
|
|
9615
|
+
const Jt = ((qs = T) == null ? void 0 : qs.UserRaid) || F("UserRaid", ai), $e = async (t, a) => {
|
|
9599
9616
|
await Jt.updateOne({ user: t }, a, {
|
|
9600
9617
|
upsert: !0
|
|
9601
9618
|
});
|
|
9602
9619
|
}, rt = async (t, a) => {
|
|
9603
|
-
await
|
|
9620
|
+
await $e(t, { $set: { [`unlocked.${a}`]: !0 } });
|
|
9604
9621
|
}, zy = async (t, a, s, n, r, i) => {
|
|
9605
9622
|
const d = Date.now();
|
|
9606
|
-
return await
|
|
9623
|
+
return await $e(t, {
|
|
9607
9624
|
$set: {
|
|
9608
9625
|
currentRaid: {
|
|
9609
9626
|
raidId: a,
|
|
@@ -9615,31 +9632,31 @@ const Jt = ((qs = T) == null ? void 0 : qs.UserRaid) || F("UserRaid", ai), Be =
|
|
|
9615
9632
|
}
|
|
9616
9633
|
}), await Fr(t, n, r, i), d;
|
|
9617
9634
|
}, Xy = async (t) => {
|
|
9618
|
-
await
|
|
9635
|
+
await $e(t, {
|
|
9619
9636
|
$unset: {
|
|
9620
9637
|
currentRaid: ""
|
|
9621
9638
|
}
|
|
9622
9639
|
});
|
|
9623
9640
|
}, Zy = async (t) => {
|
|
9624
|
-
await
|
|
9641
|
+
await $e(t, {
|
|
9625
9642
|
$set: {
|
|
9626
9643
|
"currentRaid.progression": []
|
|
9627
9644
|
}
|
|
9628
9645
|
});
|
|
9629
9646
|
}, Jy = async (t, a) => {
|
|
9630
|
-
await
|
|
9647
|
+
await $e(t, {
|
|
9631
9648
|
$push: {
|
|
9632
9649
|
"currentRaid.progression": a
|
|
9633
9650
|
}
|
|
9634
9651
|
});
|
|
9635
9652
|
}, Ky = async (t, a, s) => {
|
|
9636
|
-
await
|
|
9653
|
+
await $e(t, {
|
|
9637
9654
|
$addToSet: {
|
|
9638
9655
|
[`obtainedRewards.${a}`]: s
|
|
9639
9656
|
}
|
|
9640
9657
|
});
|
|
9641
9658
|
}, e_ = async (t, a) => {
|
|
9642
|
-
await
|
|
9659
|
+
await $e(t, {
|
|
9643
9660
|
$inc: Object.fromEntries(
|
|
9644
9661
|
Ga(a).filter(([s]) => s !== "title" && s !== "condition").map(([s, n]) => [`currentRaid.rewards.${s}`, n])
|
|
9645
9662
|
),
|
|
@@ -9650,7 +9667,7 @@ const Jt = ((qs = T) == null ? void 0 : qs.UserRaid) || F("UserRaid", ai), Be =
|
|
|
9650
9667
|
} : {}
|
|
9651
9668
|
});
|
|
9652
9669
|
}, t_ = async (t, a, s) => {
|
|
9653
|
-
await
|
|
9670
|
+
await $e(t, {
|
|
9654
9671
|
$addToSet: {
|
|
9655
9672
|
[`obtainedConditions.${a}`]: s
|
|
9656
9673
|
}
|
|
@@ -10603,7 +10620,7 @@ export {
|
|
|
10603
10620
|
ie as updateUserOrnaments,
|
|
10604
10621
|
Bt as updateUserQuest,
|
|
10605
10622
|
k as updateUserQuestMeta,
|
|
10606
|
-
|
|
10623
|
+
$e as updateUserRaid,
|
|
10607
10624
|
n_ as updateUserShop,
|
|
10608
10625
|
hg as userChristmasGetters,
|
|
10609
10626
|
Lt as userChristmasModel,
|