@stoker-platform/web-client 0.5.85 → 0.5.86
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/bundle.js +569 -562
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -2,13 +2,13 @@ import { getApp as it, registerVersion as Pm, initializeApp as Gn, setLogLevel a
|
|
|
2
2
|
import { isSupported as qm, initializeAnalytics as Lm, setConsent as $m } from "firebase/analytics";
|
|
3
3
|
import { getAuth as hr, validatePassword as Od, initializeAuth as Ec, indexedDBLocalPersistence as jm, browserLocalPersistence as Vm, browserSessionPersistence as Sc, inMemoryPersistence as Tc, beforeAuthStateChanged as Um, connectAuthEmulator as Wm, onAuthStateChanged as Hn, getIdTokenResult as zm, signOut as Ed, signInWithEmailAndPassword as Bm, getMultiFactorResolver as Zm, TotpMultiFactorGenerator as to, signInWithCustomToken as Gm, multiFactor as Rc } from "firebase/auth";
|
|
4
4
|
import { getDatabase as Sd, onValue as Hm, ref as Km, connectDatabaseEmulator as Ym } from "firebase/database";
|
|
5
|
-
import { where as ye, query as he, collection as Lr, and as en, or as Cc, onSnapshot as mr, doc as
|
|
5
|
+
import { where as ye, query as he, collection as Lr, and as en, or as Cc, onSnapshot as mr, doc as Ae, Timestamp as zt, setDoc as Jm, getDoc as Td, orderBy as rt, limit as er, startAfter as ro, endBefore as no, limitToLast as Dr, getDocsFromCache as Rd, getDocsFromServer as Qm, getDocs as Xm, getCountFromServer as Cd, getDocFromCache as ep, getDocFromServer as tp, writeBatch as Io, serverTimestamp as $r, deleteField as In, arrayRemove as xo, arrayUnion as No, collectionGroup as rp, getFirestore as Ac, initializeFirestore as tn, connectFirestoreEmulator as kc, persistentLocalCache as Ic, persistentSingleTabManager as xc, persistentMultipleTabManager as Nc, memoryEagerGarbageCollector as np, memoryLruGarbageCollector as sp, memoryLocalCache as ip, getPersistentCacheIndexManager as ap, enablePersistentCacheIndexAutoCreation as op, terminate as cp, clearIndexedDbPersistence as Fc, waitForPendingWrites as lp, onSnapshotsInSync as Ad, startAt as up, endAt as fp, addDoc as kd } from "firebase/firestore";
|
|
6
6
|
import { connectStorageEmulator as dp, getStorage as hp } from "firebase/storage";
|
|
7
|
-
import { getFunctions as
|
|
7
|
+
import { getFunctions as Ue, httpsCallable as Je, connectFunctionsEmulator as mp } from "firebase/functions";
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as pp, initializeAppCheck as Kn, onTokenChanged as Yn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as gp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as yp, fetchAndActivate as _p } from "firebase/remote-config";
|
|
11
|
-
const vp = "0.5.
|
|
11
|
+
const vp = "0.5.86", wp = (t) => !!t.auth, ct = (t, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(t);
|
|
14
14
|
}, xn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0], ve = (t) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(t.type), Id = (t, e) => {
|
|
@@ -2484,7 +2484,7 @@ function j(t, e) {
|
|
|
2484
2484
|
});
|
|
2485
2485
|
t.common.issues.push(n);
|
|
2486
2486
|
}
|
|
2487
|
-
class
|
|
2487
|
+
class qe {
|
|
2488
2488
|
constructor() {
|
|
2489
2489
|
this.value = "valid";
|
|
2490
2490
|
}
|
|
@@ -2512,7 +2512,7 @@ class Me {
|
|
|
2512
2512
|
value: a
|
|
2513
2513
|
});
|
|
2514
2514
|
}
|
|
2515
|
-
return
|
|
2515
|
+
return qe.mergeObjectSync(e, n);
|
|
2516
2516
|
}
|
|
2517
2517
|
static mergeObjectSync(e, r) {
|
|
2518
2518
|
const n = {};
|
|
@@ -2527,11 +2527,11 @@ class Me {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
const ee = Object.freeze({
|
|
2529
2529
|
status: "aborted"
|
|
2530
|
-
}), Ar = (t) => ({ status: "dirty", value: t }),
|
|
2531
|
-
var
|
|
2530
|
+
}), Ar = (t) => ({ status: "dirty", value: t }), Qe = (t) => ({ status: "valid", value: t }), lf = (t) => t.status === "aborted", uf = (t) => t.status === "dirty", or = (t) => t.status === "valid", pn = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
2531
|
+
var B;
|
|
2532
2532
|
(function(t) {
|
|
2533
2533
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2534
|
-
})(
|
|
2534
|
+
})(B || (B = {}));
|
|
2535
2535
|
class lt {
|
|
2536
2536
|
constructor(e, r, n, s) {
|
|
2537
2537
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
@@ -2585,7 +2585,7 @@ class ce {
|
|
|
2585
2585
|
}
|
|
2586
2586
|
_processInputParams(e) {
|
|
2587
2587
|
return {
|
|
2588
|
-
status: new
|
|
2588
|
+
status: new qe(),
|
|
2589
2589
|
ctx: {
|
|
2590
2590
|
common: e.parent.common,
|
|
2591
2591
|
data: e.data,
|
|
@@ -2696,7 +2696,7 @@ class ce {
|
|
|
2696
2696
|
_refinement(e) {
|
|
2697
2697
|
return new ur({
|
|
2698
2698
|
schema: this,
|
|
2699
|
-
typeName:
|
|
2699
|
+
typeName: Q.ZodEffects,
|
|
2700
2700
|
effect: { type: "refinement", refinement: e }
|
|
2701
2701
|
});
|
|
2702
2702
|
}
|
|
@@ -2735,7 +2735,7 @@ class ce {
|
|
|
2735
2735
|
return new ur({
|
|
2736
2736
|
...se(this._def),
|
|
2737
2737
|
schema: this,
|
|
2738
|
-
typeName:
|
|
2738
|
+
typeName: Q.ZodEffects,
|
|
2739
2739
|
effect: { type: "transform", transform: e }
|
|
2740
2740
|
});
|
|
2741
2741
|
}
|
|
@@ -2745,12 +2745,12 @@ class ce {
|
|
|
2745
2745
|
...se(this._def),
|
|
2746
2746
|
innerType: this,
|
|
2747
2747
|
defaultValue: r,
|
|
2748
|
-
typeName:
|
|
2748
|
+
typeName: Q.ZodDefault
|
|
2749
2749
|
});
|
|
2750
2750
|
}
|
|
2751
2751
|
brand() {
|
|
2752
2752
|
return new Wy({
|
|
2753
|
-
typeName:
|
|
2753
|
+
typeName: Q.ZodBranded,
|
|
2754
2754
|
type: this,
|
|
2755
2755
|
...se(this._def)
|
|
2756
2756
|
});
|
|
@@ -2761,7 +2761,7 @@ class ce {
|
|
|
2761
2761
|
...se(this._def),
|
|
2762
2762
|
innerType: this,
|
|
2763
2763
|
catchValue: r,
|
|
2764
|
-
typeName:
|
|
2764
|
+
typeName: Q.ZodCatch
|
|
2765
2765
|
});
|
|
2766
2766
|
}
|
|
2767
2767
|
describe(e) {
|
|
@@ -2830,7 +2830,7 @@ class gt extends ce {
|
|
|
2830
2830
|
received: i.parsedType
|
|
2831
2831
|
}), ee;
|
|
2832
2832
|
}
|
|
2833
|
-
const n = new
|
|
2833
|
+
const n = new qe();
|
|
2834
2834
|
let s;
|
|
2835
2835
|
for (const i of this._def.checks)
|
|
2836
2836
|
if (i.kind === "min")
|
|
@@ -2979,7 +2979,7 @@ class gt extends ce {
|
|
|
2979
2979
|
return this.refinement((s) => e.test(s), {
|
|
2980
2980
|
validation: r,
|
|
2981
2981
|
code: P.invalid_string,
|
|
2982
|
-
...
|
|
2982
|
+
...B.errToObj(n)
|
|
2983
2983
|
});
|
|
2984
2984
|
}
|
|
2985
2985
|
_addCheck(e) {
|
|
@@ -2989,46 +2989,46 @@ class gt extends ce {
|
|
|
2989
2989
|
});
|
|
2990
2990
|
}
|
|
2991
2991
|
email(e) {
|
|
2992
|
-
return this._addCheck({ kind: "email", ...
|
|
2992
|
+
return this._addCheck({ kind: "email", ...B.errToObj(e) });
|
|
2993
2993
|
}
|
|
2994
2994
|
url(e) {
|
|
2995
|
-
return this._addCheck({ kind: "url", ...
|
|
2995
|
+
return this._addCheck({ kind: "url", ...B.errToObj(e) });
|
|
2996
2996
|
}
|
|
2997
2997
|
emoji(e) {
|
|
2998
|
-
return this._addCheck({ kind: "emoji", ...
|
|
2998
|
+
return this._addCheck({ kind: "emoji", ...B.errToObj(e) });
|
|
2999
2999
|
}
|
|
3000
3000
|
uuid(e) {
|
|
3001
|
-
return this._addCheck({ kind: "uuid", ...
|
|
3001
|
+
return this._addCheck({ kind: "uuid", ...B.errToObj(e) });
|
|
3002
3002
|
}
|
|
3003
3003
|
nanoid(e) {
|
|
3004
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
3004
|
+
return this._addCheck({ kind: "nanoid", ...B.errToObj(e) });
|
|
3005
3005
|
}
|
|
3006
3006
|
cuid(e) {
|
|
3007
|
-
return this._addCheck({ kind: "cuid", ...
|
|
3007
|
+
return this._addCheck({ kind: "cuid", ...B.errToObj(e) });
|
|
3008
3008
|
}
|
|
3009
3009
|
cuid2(e) {
|
|
3010
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
3010
|
+
return this._addCheck({ kind: "cuid2", ...B.errToObj(e) });
|
|
3011
3011
|
}
|
|
3012
3012
|
ulid(e) {
|
|
3013
|
-
return this._addCheck({ kind: "ulid", ...
|
|
3013
|
+
return this._addCheck({ kind: "ulid", ...B.errToObj(e) });
|
|
3014
3014
|
}
|
|
3015
3015
|
base64(e) {
|
|
3016
|
-
return this._addCheck({ kind: "base64", ...
|
|
3016
|
+
return this._addCheck({ kind: "base64", ...B.errToObj(e) });
|
|
3017
3017
|
}
|
|
3018
3018
|
base64url(e) {
|
|
3019
3019
|
return this._addCheck({
|
|
3020
3020
|
kind: "base64url",
|
|
3021
|
-
...
|
|
3021
|
+
...B.errToObj(e)
|
|
3022
3022
|
});
|
|
3023
3023
|
}
|
|
3024
3024
|
jwt(e) {
|
|
3025
|
-
return this._addCheck({ kind: "jwt", ...
|
|
3025
|
+
return this._addCheck({ kind: "jwt", ...B.errToObj(e) });
|
|
3026
3026
|
}
|
|
3027
3027
|
ip(e) {
|
|
3028
|
-
return this._addCheck({ kind: "ip", ...
|
|
3028
|
+
return this._addCheck({ kind: "ip", ...B.errToObj(e) });
|
|
3029
3029
|
}
|
|
3030
3030
|
cidr(e) {
|
|
3031
|
-
return this._addCheck({ kind: "cidr", ...
|
|
3031
|
+
return this._addCheck({ kind: "cidr", ...B.errToObj(e) });
|
|
3032
3032
|
}
|
|
3033
3033
|
datetime(e) {
|
|
3034
3034
|
return typeof e == "string" ? this._addCheck({
|
|
@@ -3042,7 +3042,7 @@ class gt extends ce {
|
|
|
3042
3042
|
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
3043
3043
|
offset: e?.offset ?? !1,
|
|
3044
3044
|
local: e?.local ?? !1,
|
|
3045
|
-
...
|
|
3045
|
+
...B.errToObj(e?.message)
|
|
3046
3046
|
});
|
|
3047
3047
|
}
|
|
3048
3048
|
date(e) {
|
|
@@ -3056,17 +3056,17 @@ class gt extends ce {
|
|
|
3056
3056
|
}) : this._addCheck({
|
|
3057
3057
|
kind: "time",
|
|
3058
3058
|
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
3059
|
-
...
|
|
3059
|
+
...B.errToObj(e?.message)
|
|
3060
3060
|
});
|
|
3061
3061
|
}
|
|
3062
3062
|
duration(e) {
|
|
3063
|
-
return this._addCheck({ kind: "duration", ...
|
|
3063
|
+
return this._addCheck({ kind: "duration", ...B.errToObj(e) });
|
|
3064
3064
|
}
|
|
3065
3065
|
regex(e, r) {
|
|
3066
3066
|
return this._addCheck({
|
|
3067
3067
|
kind: "regex",
|
|
3068
3068
|
regex: e,
|
|
3069
|
-
...
|
|
3069
|
+
...B.errToObj(r)
|
|
3070
3070
|
});
|
|
3071
3071
|
}
|
|
3072
3072
|
includes(e, r) {
|
|
@@ -3074,49 +3074,49 @@ class gt extends ce {
|
|
|
3074
3074
|
kind: "includes",
|
|
3075
3075
|
value: e,
|
|
3076
3076
|
position: r?.position,
|
|
3077
|
-
...
|
|
3077
|
+
...B.errToObj(r?.message)
|
|
3078
3078
|
});
|
|
3079
3079
|
}
|
|
3080
3080
|
startsWith(e, r) {
|
|
3081
3081
|
return this._addCheck({
|
|
3082
3082
|
kind: "startsWith",
|
|
3083
3083
|
value: e,
|
|
3084
|
-
...
|
|
3084
|
+
...B.errToObj(r)
|
|
3085
3085
|
});
|
|
3086
3086
|
}
|
|
3087
3087
|
endsWith(e, r) {
|
|
3088
3088
|
return this._addCheck({
|
|
3089
3089
|
kind: "endsWith",
|
|
3090
3090
|
value: e,
|
|
3091
|
-
...
|
|
3091
|
+
...B.errToObj(r)
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
3094
3094
|
min(e, r) {
|
|
3095
3095
|
return this._addCheck({
|
|
3096
3096
|
kind: "min",
|
|
3097
3097
|
value: e,
|
|
3098
|
-
...
|
|
3098
|
+
...B.errToObj(r)
|
|
3099
3099
|
});
|
|
3100
3100
|
}
|
|
3101
3101
|
max(e, r) {
|
|
3102
3102
|
return this._addCheck({
|
|
3103
3103
|
kind: "max",
|
|
3104
3104
|
value: e,
|
|
3105
|
-
...
|
|
3105
|
+
...B.errToObj(r)
|
|
3106
3106
|
});
|
|
3107
3107
|
}
|
|
3108
3108
|
length(e, r) {
|
|
3109
3109
|
return this._addCheck({
|
|
3110
3110
|
kind: "length",
|
|
3111
3111
|
value: e,
|
|
3112
|
-
...
|
|
3112
|
+
...B.errToObj(r)
|
|
3113
3113
|
});
|
|
3114
3114
|
}
|
|
3115
3115
|
/**
|
|
3116
3116
|
* Equivalent to `.min(1)`
|
|
3117
3117
|
*/
|
|
3118
3118
|
nonempty(e) {
|
|
3119
|
-
return this.min(1,
|
|
3119
|
+
return this.min(1, B.errToObj(e));
|
|
3120
3120
|
}
|
|
3121
3121
|
trim() {
|
|
3122
3122
|
return new gt({
|
|
@@ -3199,7 +3199,7 @@ class gt extends ce {
|
|
|
3199
3199
|
}
|
|
3200
3200
|
gt.create = (t) => new gt({
|
|
3201
3201
|
checks: [],
|
|
3202
|
-
typeName:
|
|
3202
|
+
typeName: Q.ZodString,
|
|
3203
3203
|
coerce: t?.coerce ?? !1,
|
|
3204
3204
|
...se(t)
|
|
3205
3205
|
});
|
|
@@ -3221,7 +3221,7 @@ class cr extends ce {
|
|
|
3221
3221
|
}), ee;
|
|
3222
3222
|
}
|
|
3223
3223
|
let n;
|
|
3224
|
-
const s = new
|
|
3224
|
+
const s = new qe();
|
|
3225
3225
|
for (const i of this._def.checks)
|
|
3226
3226
|
i.kind === "int" ? fe.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
|
|
3227
3227
|
code: P.invalid_type,
|
|
@@ -3253,16 +3253,16 @@ class cr extends ce {
|
|
|
3253
3253
|
return { status: s.value, value: e.data };
|
|
3254
3254
|
}
|
|
3255
3255
|
gte(e, r) {
|
|
3256
|
-
return this.setLimit("min", e, !0,
|
|
3256
|
+
return this.setLimit("min", e, !0, B.toString(r));
|
|
3257
3257
|
}
|
|
3258
3258
|
gt(e, r) {
|
|
3259
|
-
return this.setLimit("min", e, !1,
|
|
3259
|
+
return this.setLimit("min", e, !1, B.toString(r));
|
|
3260
3260
|
}
|
|
3261
3261
|
lte(e, r) {
|
|
3262
|
-
return this.setLimit("max", e, !0,
|
|
3262
|
+
return this.setLimit("max", e, !0, B.toString(r));
|
|
3263
3263
|
}
|
|
3264
3264
|
lt(e, r) {
|
|
3265
|
-
return this.setLimit("max", e, !1,
|
|
3265
|
+
return this.setLimit("max", e, !1, B.toString(r));
|
|
3266
3266
|
}
|
|
3267
3267
|
setLimit(e, r, n, s) {
|
|
3268
3268
|
return new cr({
|
|
@@ -3273,7 +3273,7 @@ class cr extends ce {
|
|
|
3273
3273
|
kind: e,
|
|
3274
3274
|
value: r,
|
|
3275
3275
|
inclusive: n,
|
|
3276
|
-
message:
|
|
3276
|
+
message: B.toString(s)
|
|
3277
3277
|
}
|
|
3278
3278
|
]
|
|
3279
3279
|
});
|
|
@@ -3287,7 +3287,7 @@ class cr extends ce {
|
|
|
3287
3287
|
int(e) {
|
|
3288
3288
|
return this._addCheck({
|
|
3289
3289
|
kind: "int",
|
|
3290
|
-
message:
|
|
3290
|
+
message: B.toString(e)
|
|
3291
3291
|
});
|
|
3292
3292
|
}
|
|
3293
3293
|
positive(e) {
|
|
@@ -3295,7 +3295,7 @@ class cr extends ce {
|
|
|
3295
3295
|
kind: "min",
|
|
3296
3296
|
value: 0,
|
|
3297
3297
|
inclusive: !1,
|
|
3298
|
-
message:
|
|
3298
|
+
message: B.toString(e)
|
|
3299
3299
|
});
|
|
3300
3300
|
}
|
|
3301
3301
|
negative(e) {
|
|
@@ -3303,7 +3303,7 @@ class cr extends ce {
|
|
|
3303
3303
|
kind: "max",
|
|
3304
3304
|
value: 0,
|
|
3305
3305
|
inclusive: !1,
|
|
3306
|
-
message:
|
|
3306
|
+
message: B.toString(e)
|
|
3307
3307
|
});
|
|
3308
3308
|
}
|
|
3309
3309
|
nonpositive(e) {
|
|
@@ -3311,7 +3311,7 @@ class cr extends ce {
|
|
|
3311
3311
|
kind: "max",
|
|
3312
3312
|
value: 0,
|
|
3313
3313
|
inclusive: !0,
|
|
3314
|
-
message:
|
|
3314
|
+
message: B.toString(e)
|
|
3315
3315
|
});
|
|
3316
3316
|
}
|
|
3317
3317
|
nonnegative(e) {
|
|
@@ -3319,20 +3319,20 @@ class cr extends ce {
|
|
|
3319
3319
|
kind: "min",
|
|
3320
3320
|
value: 0,
|
|
3321
3321
|
inclusive: !0,
|
|
3322
|
-
message:
|
|
3322
|
+
message: B.toString(e)
|
|
3323
3323
|
});
|
|
3324
3324
|
}
|
|
3325
3325
|
multipleOf(e, r) {
|
|
3326
3326
|
return this._addCheck({
|
|
3327
3327
|
kind: "multipleOf",
|
|
3328
3328
|
value: e,
|
|
3329
|
-
message:
|
|
3329
|
+
message: B.toString(r)
|
|
3330
3330
|
});
|
|
3331
3331
|
}
|
|
3332
3332
|
finite(e) {
|
|
3333
3333
|
return this._addCheck({
|
|
3334
3334
|
kind: "finite",
|
|
3335
|
-
message:
|
|
3335
|
+
message: B.toString(e)
|
|
3336
3336
|
});
|
|
3337
3337
|
}
|
|
3338
3338
|
safe(e) {
|
|
@@ -3340,12 +3340,12 @@ class cr extends ce {
|
|
|
3340
3340
|
kind: "min",
|
|
3341
3341
|
inclusive: !0,
|
|
3342
3342
|
value: Number.MIN_SAFE_INTEGER,
|
|
3343
|
-
message:
|
|
3343
|
+
message: B.toString(e)
|
|
3344
3344
|
})._addCheck({
|
|
3345
3345
|
kind: "max",
|
|
3346
3346
|
inclusive: !0,
|
|
3347
3347
|
value: Number.MAX_SAFE_INTEGER,
|
|
3348
|
-
message:
|
|
3348
|
+
message: B.toString(e)
|
|
3349
3349
|
});
|
|
3350
3350
|
}
|
|
3351
3351
|
get minValue() {
|
|
@@ -3375,7 +3375,7 @@ class cr extends ce {
|
|
|
3375
3375
|
}
|
|
3376
3376
|
cr.create = (t) => new cr({
|
|
3377
3377
|
checks: [],
|
|
3378
|
-
typeName:
|
|
3378
|
+
typeName: Q.ZodNumber,
|
|
3379
3379
|
coerce: t?.coerce || !1,
|
|
3380
3380
|
...se(t)
|
|
3381
3381
|
});
|
|
@@ -3393,7 +3393,7 @@ class jr extends ce {
|
|
|
3393
3393
|
if (this._getType(e) !== W.bigint)
|
|
3394
3394
|
return this._getInvalidInput(e);
|
|
3395
3395
|
let n;
|
|
3396
|
-
const s = new
|
|
3396
|
+
const s = new qe();
|
|
3397
3397
|
for (const i of this._def.checks)
|
|
3398
3398
|
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), j(n, {
|
|
3399
3399
|
code: P.too_small,
|
|
@@ -3423,16 +3423,16 @@ class jr extends ce {
|
|
|
3423
3423
|
}), ee;
|
|
3424
3424
|
}
|
|
3425
3425
|
gte(e, r) {
|
|
3426
|
-
return this.setLimit("min", e, !0,
|
|
3426
|
+
return this.setLimit("min", e, !0, B.toString(r));
|
|
3427
3427
|
}
|
|
3428
3428
|
gt(e, r) {
|
|
3429
|
-
return this.setLimit("min", e, !1,
|
|
3429
|
+
return this.setLimit("min", e, !1, B.toString(r));
|
|
3430
3430
|
}
|
|
3431
3431
|
lte(e, r) {
|
|
3432
|
-
return this.setLimit("max", e, !0,
|
|
3432
|
+
return this.setLimit("max", e, !0, B.toString(r));
|
|
3433
3433
|
}
|
|
3434
3434
|
lt(e, r) {
|
|
3435
|
-
return this.setLimit("max", e, !1,
|
|
3435
|
+
return this.setLimit("max", e, !1, B.toString(r));
|
|
3436
3436
|
}
|
|
3437
3437
|
setLimit(e, r, n, s) {
|
|
3438
3438
|
return new jr({
|
|
@@ -3443,7 +3443,7 @@ class jr extends ce {
|
|
|
3443
3443
|
kind: e,
|
|
3444
3444
|
value: r,
|
|
3445
3445
|
inclusive: n,
|
|
3446
|
-
message:
|
|
3446
|
+
message: B.toString(s)
|
|
3447
3447
|
}
|
|
3448
3448
|
]
|
|
3449
3449
|
});
|
|
@@ -3459,7 +3459,7 @@ class jr extends ce {
|
|
|
3459
3459
|
kind: "min",
|
|
3460
3460
|
value: BigInt(0),
|
|
3461
3461
|
inclusive: !1,
|
|
3462
|
-
message:
|
|
3462
|
+
message: B.toString(e)
|
|
3463
3463
|
});
|
|
3464
3464
|
}
|
|
3465
3465
|
negative(e) {
|
|
@@ -3467,7 +3467,7 @@ class jr extends ce {
|
|
|
3467
3467
|
kind: "max",
|
|
3468
3468
|
value: BigInt(0),
|
|
3469
3469
|
inclusive: !1,
|
|
3470
|
-
message:
|
|
3470
|
+
message: B.toString(e)
|
|
3471
3471
|
});
|
|
3472
3472
|
}
|
|
3473
3473
|
nonpositive(e) {
|
|
@@ -3475,7 +3475,7 @@ class jr extends ce {
|
|
|
3475
3475
|
kind: "max",
|
|
3476
3476
|
value: BigInt(0),
|
|
3477
3477
|
inclusive: !0,
|
|
3478
|
-
message:
|
|
3478
|
+
message: B.toString(e)
|
|
3479
3479
|
});
|
|
3480
3480
|
}
|
|
3481
3481
|
nonnegative(e) {
|
|
@@ -3483,14 +3483,14 @@ class jr extends ce {
|
|
|
3483
3483
|
kind: "min",
|
|
3484
3484
|
value: BigInt(0),
|
|
3485
3485
|
inclusive: !0,
|
|
3486
|
-
message:
|
|
3486
|
+
message: B.toString(e)
|
|
3487
3487
|
});
|
|
3488
3488
|
}
|
|
3489
3489
|
multipleOf(e, r) {
|
|
3490
3490
|
return this._addCheck({
|
|
3491
3491
|
kind: "multipleOf",
|
|
3492
3492
|
value: e,
|
|
3493
|
-
message:
|
|
3493
|
+
message: B.toString(r)
|
|
3494
3494
|
});
|
|
3495
3495
|
}
|
|
3496
3496
|
get minValue() {
|
|
@@ -3508,7 +3508,7 @@ class jr extends ce {
|
|
|
3508
3508
|
}
|
|
3509
3509
|
jr.create = (t) => new jr({
|
|
3510
3510
|
checks: [],
|
|
3511
|
-
typeName:
|
|
3511
|
+
typeName: Q.ZodBigInt,
|
|
3512
3512
|
coerce: t?.coerce ?? !1,
|
|
3513
3513
|
...se(t)
|
|
3514
3514
|
});
|
|
@@ -3522,11 +3522,11 @@ class io extends ce {
|
|
|
3522
3522
|
received: n.parsedType
|
|
3523
3523
|
}), ee;
|
|
3524
3524
|
}
|
|
3525
|
-
return
|
|
3525
|
+
return Qe(e.data);
|
|
3526
3526
|
}
|
|
3527
3527
|
}
|
|
3528
3528
|
io.create = (t) => new io({
|
|
3529
|
-
typeName:
|
|
3529
|
+
typeName: Q.ZodBoolean,
|
|
3530
3530
|
coerce: t?.coerce || !1,
|
|
3531
3531
|
...se(t)
|
|
3532
3532
|
});
|
|
@@ -3546,7 +3546,7 @@ class gn extends ce {
|
|
|
3546
3546
|
code: P.invalid_date
|
|
3547
3547
|
}), ee;
|
|
3548
3548
|
}
|
|
3549
|
-
const n = new
|
|
3549
|
+
const n = new qe();
|
|
3550
3550
|
let s;
|
|
3551
3551
|
for (const i of this._def.checks)
|
|
3552
3552
|
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), j(s, {
|
|
@@ -3579,14 +3579,14 @@ class gn extends ce {
|
|
|
3579
3579
|
return this._addCheck({
|
|
3580
3580
|
kind: "min",
|
|
3581
3581
|
value: e.getTime(),
|
|
3582
|
-
message:
|
|
3582
|
+
message: B.toString(r)
|
|
3583
3583
|
});
|
|
3584
3584
|
}
|
|
3585
3585
|
max(e, r) {
|
|
3586
3586
|
return this._addCheck({
|
|
3587
3587
|
kind: "max",
|
|
3588
3588
|
value: e.getTime(),
|
|
3589
|
-
message:
|
|
3589
|
+
message: B.toString(r)
|
|
3590
3590
|
});
|
|
3591
3591
|
}
|
|
3592
3592
|
get minDate() {
|
|
@@ -3605,7 +3605,7 @@ class gn extends ce {
|
|
|
3605
3605
|
gn.create = (t) => new gn({
|
|
3606
3606
|
checks: [],
|
|
3607
3607
|
coerce: t?.coerce || !1,
|
|
3608
|
-
typeName:
|
|
3608
|
+
typeName: Q.ZodDate,
|
|
3609
3609
|
...se(t)
|
|
3610
3610
|
});
|
|
3611
3611
|
class df extends ce {
|
|
@@ -3618,11 +3618,11 @@ class df extends ce {
|
|
|
3618
3618
|
received: n.parsedType
|
|
3619
3619
|
}), ee;
|
|
3620
3620
|
}
|
|
3621
|
-
return
|
|
3621
|
+
return Qe(e.data);
|
|
3622
3622
|
}
|
|
3623
3623
|
}
|
|
3624
3624
|
df.create = (t) => new df({
|
|
3625
|
-
typeName:
|
|
3625
|
+
typeName: Q.ZodSymbol,
|
|
3626
3626
|
...se(t)
|
|
3627
3627
|
});
|
|
3628
3628
|
class hf extends ce {
|
|
@@ -3635,11 +3635,11 @@ class hf extends ce {
|
|
|
3635
3635
|
received: n.parsedType
|
|
3636
3636
|
}), ee;
|
|
3637
3637
|
}
|
|
3638
|
-
return
|
|
3638
|
+
return Qe(e.data);
|
|
3639
3639
|
}
|
|
3640
3640
|
}
|
|
3641
3641
|
hf.create = (t) => new hf({
|
|
3642
|
-
typeName:
|
|
3642
|
+
typeName: Q.ZodUndefined,
|
|
3643
3643
|
...se(t)
|
|
3644
3644
|
});
|
|
3645
3645
|
class mf extends ce {
|
|
@@ -3652,11 +3652,11 @@ class mf extends ce {
|
|
|
3652
3652
|
received: n.parsedType
|
|
3653
3653
|
}), ee;
|
|
3654
3654
|
}
|
|
3655
|
-
return
|
|
3655
|
+
return Qe(e.data);
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
3658
|
mf.create = (t) => new mf({
|
|
3659
|
-
typeName:
|
|
3659
|
+
typeName: Q.ZodNull,
|
|
3660
3660
|
...se(t)
|
|
3661
3661
|
});
|
|
3662
3662
|
class ao extends ce {
|
|
@@ -3664,11 +3664,11 @@ class ao extends ce {
|
|
|
3664
3664
|
super(...arguments), this._any = !0;
|
|
3665
3665
|
}
|
|
3666
3666
|
_parse(e) {
|
|
3667
|
-
return
|
|
3667
|
+
return Qe(e.data);
|
|
3668
3668
|
}
|
|
3669
3669
|
}
|
|
3670
3670
|
ao.create = (t) => new ao({
|
|
3671
|
-
typeName:
|
|
3671
|
+
typeName: Q.ZodAny,
|
|
3672
3672
|
...se(t)
|
|
3673
3673
|
});
|
|
3674
3674
|
class pf extends ce {
|
|
@@ -3676,11 +3676,11 @@ class pf extends ce {
|
|
|
3676
3676
|
super(...arguments), this._unknown = !0;
|
|
3677
3677
|
}
|
|
3678
3678
|
_parse(e) {
|
|
3679
|
-
return
|
|
3679
|
+
return Qe(e.data);
|
|
3680
3680
|
}
|
|
3681
3681
|
}
|
|
3682
3682
|
pf.create = (t) => new pf({
|
|
3683
|
-
typeName:
|
|
3683
|
+
typeName: Q.ZodUnknown,
|
|
3684
3684
|
...se(t)
|
|
3685
3685
|
});
|
|
3686
3686
|
class Nt extends ce {
|
|
@@ -3694,7 +3694,7 @@ class Nt extends ce {
|
|
|
3694
3694
|
}
|
|
3695
3695
|
}
|
|
3696
3696
|
Nt.create = (t) => new Nt({
|
|
3697
|
-
typeName:
|
|
3697
|
+
typeName: Q.ZodNever,
|
|
3698
3698
|
...se(t)
|
|
3699
3699
|
});
|
|
3700
3700
|
class gf extends ce {
|
|
@@ -3707,11 +3707,11 @@ class gf extends ce {
|
|
|
3707
3707
|
received: n.parsedType
|
|
3708
3708
|
}), ee;
|
|
3709
3709
|
}
|
|
3710
|
-
return
|
|
3710
|
+
return Qe(e.data);
|
|
3711
3711
|
}
|
|
3712
3712
|
}
|
|
3713
3713
|
gf.create = (t) => new gf({
|
|
3714
|
-
typeName:
|
|
3714
|
+
typeName: Q.ZodVoid,
|
|
3715
3715
|
...se(t)
|
|
3716
3716
|
});
|
|
3717
3717
|
class ot extends ce {
|
|
@@ -3750,9 +3750,9 @@ class ot extends ce {
|
|
|
3750
3750
|
exact: !1,
|
|
3751
3751
|
message: s.maxLength.message
|
|
3752
3752
|
}), n.dirty()), r.common.async)
|
|
3753
|
-
return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) =>
|
|
3753
|
+
return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) => qe.mergeArray(n, a));
|
|
3754
3754
|
const i = [...r.data].map((a, o) => s.type._parseSync(new lt(r, a, r.path, o)));
|
|
3755
|
-
return
|
|
3755
|
+
return qe.mergeArray(n, i);
|
|
3756
3756
|
}
|
|
3757
3757
|
get element() {
|
|
3758
3758
|
return this._def.type;
|
|
@@ -3760,19 +3760,19 @@ class ot extends ce {
|
|
|
3760
3760
|
min(e, r) {
|
|
3761
3761
|
return new ot({
|
|
3762
3762
|
...this._def,
|
|
3763
|
-
minLength: { value: e, message:
|
|
3763
|
+
minLength: { value: e, message: B.toString(r) }
|
|
3764
3764
|
});
|
|
3765
3765
|
}
|
|
3766
3766
|
max(e, r) {
|
|
3767
3767
|
return new ot({
|
|
3768
3768
|
...this._def,
|
|
3769
|
-
maxLength: { value: e, message:
|
|
3769
|
+
maxLength: { value: e, message: B.toString(r) }
|
|
3770
3770
|
});
|
|
3771
3771
|
}
|
|
3772
3772
|
length(e, r) {
|
|
3773
3773
|
return new ot({
|
|
3774
3774
|
...this._def,
|
|
3775
|
-
exactLength: { value: e, message:
|
|
3775
|
+
exactLength: { value: e, message: B.toString(r) }
|
|
3776
3776
|
});
|
|
3777
3777
|
}
|
|
3778
3778
|
nonempty(e) {
|
|
@@ -3784,17 +3784,17 @@ ot.create = (t, e) => new ot({
|
|
|
3784
3784
|
minLength: null,
|
|
3785
3785
|
maxLength: null,
|
|
3786
3786
|
exactLength: null,
|
|
3787
|
-
typeName:
|
|
3787
|
+
typeName: Q.ZodArray,
|
|
3788
3788
|
...se(e)
|
|
3789
3789
|
});
|
|
3790
3790
|
function Xt(t) {
|
|
3791
|
-
if (t instanceof
|
|
3791
|
+
if (t instanceof Re) {
|
|
3792
3792
|
const e = {};
|
|
3793
3793
|
for (const r in t.shape) {
|
|
3794
3794
|
const n = t.shape[r];
|
|
3795
3795
|
e[r] = kt.create(Xt(n));
|
|
3796
3796
|
}
|
|
3797
|
-
return new
|
|
3797
|
+
return new Re({
|
|
3798
3798
|
...t._def,
|
|
3799
3799
|
shape: () => e
|
|
3800
3800
|
});
|
|
@@ -3803,7 +3803,7 @@ function Xt(t) {
|
|
|
3803
3803
|
type: Xt(t.element)
|
|
3804
3804
|
}) : t instanceof kt ? kt.create(Xt(t.unwrap())) : t instanceof fr ? fr.create(Xt(t.unwrap())) : t instanceof Ut ? Ut.create(t.items.map((e) => Xt(e))) : t;
|
|
3805
3805
|
}
|
|
3806
|
-
class
|
|
3806
|
+
class Re extends ce {
|
|
3807
3807
|
constructor() {
|
|
3808
3808
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
3809
3809
|
}
|
|
@@ -3874,20 +3874,20 @@ class Te extends ce {
|
|
|
3874
3874
|
});
|
|
3875
3875
|
}
|
|
3876
3876
|
return l;
|
|
3877
|
-
}).then((l) =>
|
|
3877
|
+
}).then((l) => qe.mergeObjectSync(n, l)) : qe.mergeObjectSync(n, c);
|
|
3878
3878
|
}
|
|
3879
3879
|
get shape() {
|
|
3880
3880
|
return this._def.shape();
|
|
3881
3881
|
}
|
|
3882
3882
|
strict(e) {
|
|
3883
|
-
return
|
|
3883
|
+
return B.errToObj, new Re({
|
|
3884
3884
|
...this._def,
|
|
3885
3885
|
unknownKeys: "strict",
|
|
3886
3886
|
...e !== void 0 ? {
|
|
3887
3887
|
errorMap: (r, n) => {
|
|
3888
3888
|
const s = this._def.errorMap?.(r, n).message ?? n.defaultError;
|
|
3889
3889
|
return r.code === "unrecognized_keys" ? {
|
|
3890
|
-
message:
|
|
3890
|
+
message: B.errToObj(e).message ?? s
|
|
3891
3891
|
} : {
|
|
3892
3892
|
message: s
|
|
3893
3893
|
};
|
|
@@ -3896,13 +3896,13 @@ class Te extends ce {
|
|
|
3896
3896
|
});
|
|
3897
3897
|
}
|
|
3898
3898
|
strip() {
|
|
3899
|
-
return new
|
|
3899
|
+
return new Re({
|
|
3900
3900
|
...this._def,
|
|
3901
3901
|
unknownKeys: "strip"
|
|
3902
3902
|
});
|
|
3903
3903
|
}
|
|
3904
3904
|
passthrough() {
|
|
3905
|
-
return new
|
|
3905
|
+
return new Re({
|
|
3906
3906
|
...this._def,
|
|
3907
3907
|
unknownKeys: "passthrough"
|
|
3908
3908
|
});
|
|
@@ -3925,7 +3925,7 @@ class Te extends ce {
|
|
|
3925
3925
|
// }) as any;
|
|
3926
3926
|
// };
|
|
3927
3927
|
extend(e) {
|
|
3928
|
-
return new
|
|
3928
|
+
return new Re({
|
|
3929
3929
|
...this._def,
|
|
3930
3930
|
shape: () => ({
|
|
3931
3931
|
...this._def.shape(),
|
|
@@ -3939,14 +3939,14 @@ class Te extends ce {
|
|
|
3939
3939
|
* upgrade if you are experiencing issues.
|
|
3940
3940
|
*/
|
|
3941
3941
|
merge(e) {
|
|
3942
|
-
return new
|
|
3942
|
+
return new Re({
|
|
3943
3943
|
unknownKeys: e._def.unknownKeys,
|
|
3944
3944
|
catchall: e._def.catchall,
|
|
3945
3945
|
shape: () => ({
|
|
3946
3946
|
...this._def.shape(),
|
|
3947
3947
|
...e._def.shape()
|
|
3948
3948
|
}),
|
|
3949
|
-
typeName:
|
|
3949
|
+
typeName: Q.ZodObject
|
|
3950
3950
|
});
|
|
3951
3951
|
}
|
|
3952
3952
|
// merge<
|
|
@@ -4009,7 +4009,7 @@ class Te extends ce {
|
|
|
4009
4009
|
// return merged;
|
|
4010
4010
|
// }
|
|
4011
4011
|
catchall(e) {
|
|
4012
|
-
return new
|
|
4012
|
+
return new Re({
|
|
4013
4013
|
...this._def,
|
|
4014
4014
|
catchall: e
|
|
4015
4015
|
});
|
|
@@ -4018,7 +4018,7 @@ class Te extends ce {
|
|
|
4018
4018
|
const r = {};
|
|
4019
4019
|
for (const n of fe.objectKeys(e))
|
|
4020
4020
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
4021
|
-
return new
|
|
4021
|
+
return new Re({
|
|
4022
4022
|
...this._def,
|
|
4023
4023
|
shape: () => r
|
|
4024
4024
|
});
|
|
@@ -4027,7 +4027,7 @@ class Te extends ce {
|
|
|
4027
4027
|
const r = {};
|
|
4028
4028
|
for (const n of fe.objectKeys(this.shape))
|
|
4029
4029
|
e[n] || (r[n] = this.shape[n]);
|
|
4030
|
-
return new
|
|
4030
|
+
return new Re({
|
|
4031
4031
|
...this._def,
|
|
4032
4032
|
shape: () => r
|
|
4033
4033
|
});
|
|
@@ -4044,7 +4044,7 @@ class Te extends ce {
|
|
|
4044
4044
|
const s = this.shape[n];
|
|
4045
4045
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
4046
4046
|
}
|
|
4047
|
-
return new
|
|
4047
|
+
return new Re({
|
|
4048
4048
|
...this._def,
|
|
4049
4049
|
shape: () => r
|
|
4050
4050
|
});
|
|
@@ -4060,7 +4060,7 @@ class Te extends ce {
|
|
|
4060
4060
|
i = i._def.innerType;
|
|
4061
4061
|
r[n] = i;
|
|
4062
4062
|
}
|
|
4063
|
-
return new
|
|
4063
|
+
return new Re({
|
|
4064
4064
|
...this._def,
|
|
4065
4065
|
shape: () => r
|
|
4066
4066
|
});
|
|
@@ -4069,25 +4069,25 @@ class Te extends ce {
|
|
|
4069
4069
|
return oh(fe.objectKeys(this.shape));
|
|
4070
4070
|
}
|
|
4071
4071
|
}
|
|
4072
|
-
|
|
4072
|
+
Re.create = (t, e) => new Re({
|
|
4073
4073
|
shape: () => t,
|
|
4074
4074
|
unknownKeys: "strip",
|
|
4075
4075
|
catchall: Nt.create(),
|
|
4076
|
-
typeName:
|
|
4076
|
+
typeName: Q.ZodObject,
|
|
4077
4077
|
...se(e)
|
|
4078
4078
|
});
|
|
4079
|
-
|
|
4079
|
+
Re.strictCreate = (t, e) => new Re({
|
|
4080
4080
|
shape: () => t,
|
|
4081
4081
|
unknownKeys: "strict",
|
|
4082
4082
|
catchall: Nt.create(),
|
|
4083
|
-
typeName:
|
|
4083
|
+
typeName: Q.ZodObject,
|
|
4084
4084
|
...se(e)
|
|
4085
4085
|
});
|
|
4086
|
-
|
|
4086
|
+
Re.lazycreate = (t, e) => new Re({
|
|
4087
4087
|
shape: t,
|
|
4088
4088
|
unknownKeys: "strip",
|
|
4089
4089
|
catchall: Nt.create(),
|
|
4090
|
-
typeName:
|
|
4090
|
+
typeName: Q.ZodObject,
|
|
4091
4091
|
...se(e)
|
|
4092
4092
|
});
|
|
4093
4093
|
class yn extends ce {
|
|
@@ -4160,7 +4160,7 @@ class yn extends ce {
|
|
|
4160
4160
|
}
|
|
4161
4161
|
yn.create = (t, e) => new yn({
|
|
4162
4162
|
options: t,
|
|
4163
|
-
typeName:
|
|
4163
|
+
typeName: Q.ZodUnion,
|
|
4164
4164
|
...se(e)
|
|
4165
4165
|
});
|
|
4166
4166
|
function oo(t, e) {
|
|
@@ -4224,7 +4224,7 @@ class _n extends ce {
|
|
|
4224
4224
|
_n.create = (t, e, r) => new _n({
|
|
4225
4225
|
left: t,
|
|
4226
4226
|
right: e,
|
|
4227
|
-
typeName:
|
|
4227
|
+
typeName: Q.ZodIntersection,
|
|
4228
4228
|
...se(r)
|
|
4229
4229
|
});
|
|
4230
4230
|
class Ut extends ce {
|
|
@@ -4255,7 +4255,7 @@ class Ut extends ce {
|
|
|
4255
4255
|
const c = this._def.items[o] || this._def.rest;
|
|
4256
4256
|
return c ? c._parse(new lt(n, a, n.path, o)) : null;
|
|
4257
4257
|
}).filter((a) => !!a);
|
|
4258
|
-
return n.common.async ? Promise.all(i).then((a) =>
|
|
4258
|
+
return n.common.async ? Promise.all(i).then((a) => qe.mergeArray(r, a)) : qe.mergeArray(r, i);
|
|
4259
4259
|
}
|
|
4260
4260
|
get items() {
|
|
4261
4261
|
return this._def.items;
|
|
@@ -4272,7 +4272,7 @@ Ut.create = (t, e) => {
|
|
|
4272
4272
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4273
4273
|
return new Ut({
|
|
4274
4274
|
items: t,
|
|
4275
|
-
typeName:
|
|
4275
|
+
typeName: Q.ZodTuple,
|
|
4276
4276
|
rest: null,
|
|
4277
4277
|
...se(e)
|
|
4278
4278
|
});
|
|
@@ -4299,7 +4299,7 @@ class vn extends ce {
|
|
|
4299
4299
|
value: a._parse(new lt(n, n.data[o], n.path, o)),
|
|
4300
4300
|
alwaysSet: o in n.data
|
|
4301
4301
|
});
|
|
4302
|
-
return n.common.async ?
|
|
4302
|
+
return n.common.async ? qe.mergeObjectAsync(r, s) : qe.mergeObjectSync(r, s);
|
|
4303
4303
|
}
|
|
4304
4304
|
get element() {
|
|
4305
4305
|
return this._def.valueType;
|
|
@@ -4308,12 +4308,12 @@ class vn extends ce {
|
|
|
4308
4308
|
return r instanceof ce ? new vn({
|
|
4309
4309
|
keyType: e,
|
|
4310
4310
|
valueType: r,
|
|
4311
|
-
typeName:
|
|
4311
|
+
typeName: Q.ZodRecord,
|
|
4312
4312
|
...se(n)
|
|
4313
4313
|
}) : new vn({
|
|
4314
4314
|
keyType: gt.create(),
|
|
4315
4315
|
valueType: e,
|
|
4316
|
-
typeName:
|
|
4316
|
+
typeName: Q.ZodRecord,
|
|
4317
4317
|
...se(r)
|
|
4318
4318
|
});
|
|
4319
4319
|
}
|
|
@@ -4363,7 +4363,7 @@ class yf extends ce {
|
|
|
4363
4363
|
yf.create = (t, e, r) => new yf({
|
|
4364
4364
|
valueType: e,
|
|
4365
4365
|
keyType: t,
|
|
4366
|
-
typeName:
|
|
4366
|
+
typeName: Q.ZodMap,
|
|
4367
4367
|
...se(r)
|
|
4368
4368
|
});
|
|
4369
4369
|
class Vr extends ce {
|
|
@@ -4407,13 +4407,13 @@ class Vr extends ce {
|
|
|
4407
4407
|
min(e, r) {
|
|
4408
4408
|
return new Vr({
|
|
4409
4409
|
...this._def,
|
|
4410
|
-
minSize: { value: e, message:
|
|
4410
|
+
minSize: { value: e, message: B.toString(r) }
|
|
4411
4411
|
});
|
|
4412
4412
|
}
|
|
4413
4413
|
max(e, r) {
|
|
4414
4414
|
return new Vr({
|
|
4415
4415
|
...this._def,
|
|
4416
|
-
maxSize: { value: e, message:
|
|
4416
|
+
maxSize: { value: e, message: B.toString(r) }
|
|
4417
4417
|
});
|
|
4418
4418
|
}
|
|
4419
4419
|
size(e, r) {
|
|
@@ -4427,7 +4427,7 @@ Vr.create = (t, e) => new Vr({
|
|
|
4427
4427
|
valueType: t,
|
|
4428
4428
|
minSize: null,
|
|
4429
4429
|
maxSize: null,
|
|
4430
|
-
typeName:
|
|
4430
|
+
typeName: Q.ZodSet,
|
|
4431
4431
|
...se(e)
|
|
4432
4432
|
});
|
|
4433
4433
|
class _f extends ce {
|
|
@@ -4441,7 +4441,7 @@ class _f extends ce {
|
|
|
4441
4441
|
}
|
|
4442
4442
|
_f.create = (t, e) => new _f({
|
|
4443
4443
|
getter: t,
|
|
4444
|
-
typeName:
|
|
4444
|
+
typeName: Q.ZodLazy,
|
|
4445
4445
|
...se(e)
|
|
4446
4446
|
});
|
|
4447
4447
|
class co extends ce {
|
|
@@ -4462,13 +4462,13 @@ class co extends ce {
|
|
|
4462
4462
|
}
|
|
4463
4463
|
co.create = (t, e) => new co({
|
|
4464
4464
|
value: t,
|
|
4465
|
-
typeName:
|
|
4465
|
+
typeName: Q.ZodLiteral,
|
|
4466
4466
|
...se(e)
|
|
4467
4467
|
});
|
|
4468
4468
|
function oh(t, e) {
|
|
4469
4469
|
return new lr({
|
|
4470
4470
|
values: t,
|
|
4471
|
-
typeName:
|
|
4471
|
+
typeName: Q.ZodEnum,
|
|
4472
4472
|
...se(e)
|
|
4473
4473
|
});
|
|
4474
4474
|
}
|
|
@@ -4490,7 +4490,7 @@ class lr extends ce {
|
|
|
4490
4490
|
options: n
|
|
4491
4491
|
}), ee;
|
|
4492
4492
|
}
|
|
4493
|
-
return
|
|
4493
|
+
return Qe(e.data);
|
|
4494
4494
|
}
|
|
4495
4495
|
get options() {
|
|
4496
4496
|
return this._def.values;
|
|
@@ -4546,7 +4546,7 @@ class vf extends ce {
|
|
|
4546
4546
|
options: s
|
|
4547
4547
|
}), ee;
|
|
4548
4548
|
}
|
|
4549
|
-
return
|
|
4549
|
+
return Qe(e.data);
|
|
4550
4550
|
}
|
|
4551
4551
|
get enum() {
|
|
4552
4552
|
return this._def.values;
|
|
@@ -4554,7 +4554,7 @@ class vf extends ce {
|
|
|
4554
4554
|
}
|
|
4555
4555
|
vf.create = (t, e) => new vf({
|
|
4556
4556
|
values: t,
|
|
4557
|
-
typeName:
|
|
4557
|
+
typeName: Q.ZodNativeEnum,
|
|
4558
4558
|
...se(e)
|
|
4559
4559
|
});
|
|
4560
4560
|
class wn extends ce {
|
|
@@ -4570,7 +4570,7 @@ class wn extends ce {
|
|
|
4570
4570
|
received: r.parsedType
|
|
4571
4571
|
}), ee;
|
|
4572
4572
|
const n = r.parsedType === W.promise ? r.data : Promise.resolve(r.data);
|
|
4573
|
-
return
|
|
4573
|
+
return Qe(n.then((s) => this._def.type.parseAsync(s, {
|
|
4574
4574
|
path: r.path,
|
|
4575
4575
|
errorMap: r.common.contextualErrorMap
|
|
4576
4576
|
})));
|
|
@@ -4578,7 +4578,7 @@ class wn extends ce {
|
|
|
4578
4578
|
}
|
|
4579
4579
|
wn.create = (t, e) => new wn({
|
|
4580
4580
|
type: t,
|
|
4581
|
-
typeName:
|
|
4581
|
+
typeName: Q.ZodPromise,
|
|
4582
4582
|
...se(e)
|
|
4583
4583
|
});
|
|
4584
4584
|
class ur extends ce {
|
|
@@ -4586,7 +4586,7 @@ class ur extends ce {
|
|
|
4586
4586
|
return this._def.schema;
|
|
4587
4587
|
}
|
|
4588
4588
|
sourceType() {
|
|
4589
|
-
return this._def.schema._def.typeName ===
|
|
4589
|
+
return this._def.schema._def.typeName === Q.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
4590
4590
|
}
|
|
4591
4591
|
_parse(e) {
|
|
4592
4592
|
const { status: r, ctx: n } = this._processInputParams(e), s = this._def.effect || null, i = {
|
|
@@ -4663,19 +4663,19 @@ class ur extends ce {
|
|
|
4663
4663
|
}
|
|
4664
4664
|
ur.create = (t, e, r) => new ur({
|
|
4665
4665
|
schema: t,
|
|
4666
|
-
typeName:
|
|
4666
|
+
typeName: Q.ZodEffects,
|
|
4667
4667
|
effect: e,
|
|
4668
4668
|
...se(r)
|
|
4669
4669
|
});
|
|
4670
4670
|
ur.createWithPreprocess = (t, e, r) => new ur({
|
|
4671
4671
|
schema: e,
|
|
4672
4672
|
effect: { type: "preprocess", transform: t },
|
|
4673
|
-
typeName:
|
|
4673
|
+
typeName: Q.ZodEffects,
|
|
4674
4674
|
...se(r)
|
|
4675
4675
|
});
|
|
4676
4676
|
class kt extends ce {
|
|
4677
4677
|
_parse(e) {
|
|
4678
|
-
return this._getType(e) === W.undefined ?
|
|
4678
|
+
return this._getType(e) === W.undefined ? Qe(void 0) : this._def.innerType._parse(e);
|
|
4679
4679
|
}
|
|
4680
4680
|
unwrap() {
|
|
4681
4681
|
return this._def.innerType;
|
|
@@ -4683,12 +4683,12 @@ class kt extends ce {
|
|
|
4683
4683
|
}
|
|
4684
4684
|
kt.create = (t, e) => new kt({
|
|
4685
4685
|
innerType: t,
|
|
4686
|
-
typeName:
|
|
4686
|
+
typeName: Q.ZodOptional,
|
|
4687
4687
|
...se(e)
|
|
4688
4688
|
});
|
|
4689
4689
|
class fr extends ce {
|
|
4690
4690
|
_parse(e) {
|
|
4691
|
-
return this._getType(e) === W.null ?
|
|
4691
|
+
return this._getType(e) === W.null ? Qe(null) : this._def.innerType._parse(e);
|
|
4692
4692
|
}
|
|
4693
4693
|
unwrap() {
|
|
4694
4694
|
return this._def.innerType;
|
|
@@ -4696,7 +4696,7 @@ class fr extends ce {
|
|
|
4696
4696
|
}
|
|
4697
4697
|
fr.create = (t, e) => new fr({
|
|
4698
4698
|
innerType: t,
|
|
4699
|
-
typeName:
|
|
4699
|
+
typeName: Q.ZodNullable,
|
|
4700
4700
|
...se(e)
|
|
4701
4701
|
});
|
|
4702
4702
|
class lo extends ce {
|
|
@@ -4715,7 +4715,7 @@ class lo extends ce {
|
|
|
4715
4715
|
}
|
|
4716
4716
|
lo.create = (t, e) => new lo({
|
|
4717
4717
|
innerType: t,
|
|
4718
|
-
typeName:
|
|
4718
|
+
typeName: Q.ZodDefault,
|
|
4719
4719
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4720
4720
|
...se(e)
|
|
4721
4721
|
});
|
|
@@ -4758,7 +4758,7 @@ class uo extends ce {
|
|
|
4758
4758
|
}
|
|
4759
4759
|
uo.create = (t, e) => new uo({
|
|
4760
4760
|
innerType: t,
|
|
4761
|
-
typeName:
|
|
4761
|
+
typeName: Q.ZodCatch,
|
|
4762
4762
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4763
4763
|
...se(e)
|
|
4764
4764
|
});
|
|
@@ -4776,7 +4776,7 @@ class wf extends ce {
|
|
|
4776
4776
|
}
|
|
4777
4777
|
}
|
|
4778
4778
|
wf.create = (t) => new wf({
|
|
4779
|
-
typeName:
|
|
4779
|
+
typeName: Q.ZodNaN,
|
|
4780
4780
|
...se(t)
|
|
4781
4781
|
});
|
|
4782
4782
|
class Wy extends ce {
|
|
@@ -4828,7 +4828,7 @@ class Qo extends ce {
|
|
|
4828
4828
|
return new Qo({
|
|
4829
4829
|
in: e,
|
|
4830
4830
|
out: r,
|
|
4831
|
-
typeName:
|
|
4831
|
+
typeName: Q.ZodPipeline
|
|
4832
4832
|
});
|
|
4833
4833
|
}
|
|
4834
4834
|
}
|
|
@@ -4843,16 +4843,16 @@ class fo extends ce {
|
|
|
4843
4843
|
}
|
|
4844
4844
|
fo.create = (t, e) => new fo({
|
|
4845
4845
|
innerType: t,
|
|
4846
|
-
typeName:
|
|
4846
|
+
typeName: Q.ZodReadonly,
|
|
4847
4847
|
...se(e)
|
|
4848
4848
|
});
|
|
4849
|
-
var
|
|
4849
|
+
var Q;
|
|
4850
4850
|
(function(t) {
|
|
4851
4851
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
4852
|
-
})(
|
|
4852
|
+
})(Q || (Q = {}));
|
|
4853
4853
|
const at = gt.create, ho = cr.create, zy = io.create, jt = ao.create;
|
|
4854
4854
|
Nt.create;
|
|
4855
|
-
const Vn = ot.create, ch =
|
|
4855
|
+
const Vn = ot.create, ch = Re.create, bn = yn.create;
|
|
4856
4856
|
_n.create;
|
|
4857
4857
|
Ut.create;
|
|
4858
4858
|
const Xo = vn.create, mo = co.create, po = lr.create;
|
|
@@ -4989,14 +4989,14 @@ class uh extends Zt {
|
|
|
4989
4989
|
super(`Invalid unit ${e}`);
|
|
4990
4990
|
}
|
|
4991
4991
|
}
|
|
4992
|
-
class
|
|
4992
|
+
class Fe extends Zt {
|
|
4993
4993
|
}
|
|
4994
4994
|
class Et extends Zt {
|
|
4995
4995
|
constructor() {
|
|
4996
4996
|
super("Zone is an abstract class");
|
|
4997
4997
|
}
|
|
4998
4998
|
}
|
|
4999
|
-
const $ = "numeric", st = "short",
|
|
4999
|
+
const $ = "numeric", st = "short", Ve = "long", En = {
|
|
5000
5000
|
year: $,
|
|
5001
5001
|
month: $,
|
|
5002
5002
|
day: $
|
|
@@ -5011,13 +5011,13 @@ const $ = "numeric", st = "short", je = "long", En = {
|
|
|
5011
5011
|
weekday: st
|
|
5012
5012
|
}, dh = {
|
|
5013
5013
|
year: $,
|
|
5014
|
-
month:
|
|
5014
|
+
month: Ve,
|
|
5015
5015
|
day: $
|
|
5016
5016
|
}, hh = {
|
|
5017
5017
|
year: $,
|
|
5018
|
-
month:
|
|
5018
|
+
month: Ve,
|
|
5019
5019
|
day: $,
|
|
5020
|
-
weekday:
|
|
5020
|
+
weekday: Ve
|
|
5021
5021
|
}, mh = {
|
|
5022
5022
|
hour: $,
|
|
5023
5023
|
minute: $
|
|
@@ -5034,7 +5034,7 @@ const $ = "numeric", st = "short", je = "long", En = {
|
|
|
5034
5034
|
hour: $,
|
|
5035
5035
|
minute: $,
|
|
5036
5036
|
second: $,
|
|
5037
|
-
timeZoneName:
|
|
5037
|
+
timeZoneName: Ve
|
|
5038
5038
|
}, _h = {
|
|
5039
5039
|
hour: $,
|
|
5040
5040
|
minute: $,
|
|
@@ -5055,7 +5055,7 @@ const $ = "numeric", st = "short", je = "long", En = {
|
|
|
5055
5055
|
minute: $,
|
|
5056
5056
|
second: $,
|
|
5057
5057
|
hourCycle: "h23",
|
|
5058
|
-
timeZoneName:
|
|
5058
|
+
timeZoneName: Ve
|
|
5059
5059
|
}, Oh = {
|
|
5060
5060
|
year: $,
|
|
5061
5061
|
month: $,
|
|
@@ -5091,14 +5091,14 @@ const $ = "numeric", st = "short", je = "long", En = {
|
|
|
5091
5091
|
minute: $
|
|
5092
5092
|
}, Rh = {
|
|
5093
5093
|
year: $,
|
|
5094
|
-
month:
|
|
5094
|
+
month: Ve,
|
|
5095
5095
|
day: $,
|
|
5096
5096
|
hour: $,
|
|
5097
5097
|
minute: $,
|
|
5098
5098
|
timeZoneName: st
|
|
5099
5099
|
}, Ch = {
|
|
5100
5100
|
year: $,
|
|
5101
|
-
month:
|
|
5101
|
+
month: Ve,
|
|
5102
5102
|
day: $,
|
|
5103
5103
|
hour: $,
|
|
5104
5104
|
minute: $,
|
|
@@ -5106,21 +5106,21 @@ const $ = "numeric", st = "short", je = "long", En = {
|
|
|
5106
5106
|
timeZoneName: st
|
|
5107
5107
|
}, Ah = {
|
|
5108
5108
|
year: $,
|
|
5109
|
-
month:
|
|
5109
|
+
month: Ve,
|
|
5110
5110
|
day: $,
|
|
5111
|
-
weekday:
|
|
5111
|
+
weekday: Ve,
|
|
5112
5112
|
hour: $,
|
|
5113
5113
|
minute: $,
|
|
5114
|
-
timeZoneName:
|
|
5114
|
+
timeZoneName: Ve
|
|
5115
5115
|
}, kh = {
|
|
5116
5116
|
year: $,
|
|
5117
|
-
month:
|
|
5117
|
+
month: Ve,
|
|
5118
5118
|
day: $,
|
|
5119
|
-
weekday:
|
|
5119
|
+
weekday: Ve,
|
|
5120
5120
|
hour: $,
|
|
5121
5121
|
minute: $,
|
|
5122
5122
|
second: $,
|
|
5123
|
-
timeZoneName:
|
|
5123
|
+
timeZoneName: Ve
|
|
5124
5124
|
};
|
|
5125
5125
|
class Hr {
|
|
5126
5126
|
/**
|
|
@@ -5280,7 +5280,7 @@ function r_(t, e) {
|
|
|
5280
5280
|
const r = t.formatToParts(e), n = [];
|
|
5281
5281
|
for (let s = 0; s < r.length; s++) {
|
|
5282
5282
|
const { type: i, value: a } = r[s], o = e_[i];
|
|
5283
|
-
i === "era" ? n[o] = a :
|
|
5283
|
+
i === "era" ? n[o] = a : J(o) || (n[o] = parseInt(a, 10));
|
|
5284
5284
|
}
|
|
5285
5285
|
return n;
|
|
5286
5286
|
}
|
|
@@ -5525,7 +5525,7 @@ class h_ {
|
|
|
5525
5525
|
return this.inf.format(r);
|
|
5526
5526
|
} else {
|
|
5527
5527
|
const r = this.floor ? Math.floor(e) : sc(e, 3);
|
|
5528
|
-
return
|
|
5528
|
+
return Ce(r, this.padTo);
|
|
5529
5529
|
}
|
|
5530
5530
|
}
|
|
5531
5531
|
}
|
|
@@ -5710,13 +5710,13 @@ class me {
|
|
|
5710
5710
|
}
|
|
5711
5711
|
}
|
|
5712
5712
|
let Ta = null;
|
|
5713
|
-
class
|
|
5713
|
+
class Me extends Hr {
|
|
5714
5714
|
/**
|
|
5715
5715
|
* Get a singleton instance of UTC
|
|
5716
5716
|
* @return {FixedOffsetZone}
|
|
5717
5717
|
*/
|
|
5718
5718
|
static get utcInstance() {
|
|
5719
|
-
return Ta === null && (Ta = new
|
|
5719
|
+
return Ta === null && (Ta = new Me(0)), Ta;
|
|
5720
5720
|
}
|
|
5721
5721
|
/**
|
|
5722
5722
|
* Get an instance with a specified offset
|
|
@@ -5724,7 +5724,7 @@ class Pe extends Hr {
|
|
|
5724
5724
|
* @return {FixedOffsetZone}
|
|
5725
5725
|
*/
|
|
5726
5726
|
static instance(e) {
|
|
5727
|
-
return e === 0 ?
|
|
5727
|
+
return e === 0 ? Me.utcInstance : new Me(e);
|
|
5728
5728
|
}
|
|
5729
5729
|
/**
|
|
5730
5730
|
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
|
|
@@ -5738,7 +5738,7 @@ class Pe extends Hr {
|
|
|
5738
5738
|
if (e) {
|
|
5739
5739
|
const r = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
5740
5740
|
if (r)
|
|
5741
|
-
return new
|
|
5741
|
+
return new Me(Bn(r[1], r[2]));
|
|
5742
5742
|
}
|
|
5743
5743
|
return null;
|
|
5744
5744
|
}
|
|
@@ -5867,14 +5867,14 @@ class g_ extends Hr {
|
|
|
5867
5867
|
}
|
|
5868
5868
|
}
|
|
5869
5869
|
function At(t, e) {
|
|
5870
|
-
if (
|
|
5870
|
+
if (J(t) || t === null)
|
|
5871
5871
|
return e;
|
|
5872
5872
|
if (t instanceof Hr)
|
|
5873
5873
|
return t;
|
|
5874
5874
|
if (O_(t)) {
|
|
5875
5875
|
const r = t.toLowerCase();
|
|
5876
|
-
return r === "default" ? e : r === "local" || r === "system" ? Un.instance : r === "utc" || r === "gmt" ?
|
|
5877
|
-
} else return It(t) ?
|
|
5876
|
+
return r === "default" ? e : r === "local" || r === "system" ? Un.instance : r === "utc" || r === "gmt" ? Me.utcInstance : Me.parseSpecifier(r) || _t.create(t);
|
|
5877
|
+
} else return It(t) ? Me.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new g_(t);
|
|
5878
5878
|
}
|
|
5879
5879
|
const ec = {
|
|
5880
5880
|
arab: "[٠-٩]",
|
|
@@ -6097,7 +6097,7 @@ class nt {
|
|
|
6097
6097
|
}
|
|
6098
6098
|
}
|
|
6099
6099
|
const Nh = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Fh = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
6100
|
-
function
|
|
6100
|
+
function He(t, e) {
|
|
6101
6101
|
return new nt(
|
|
6102
6102
|
"unit out of range",
|
|
6103
6103
|
`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`
|
|
@@ -6140,12 +6140,12 @@ function Ff(t) {
|
|
|
6140
6140
|
return { year: e, month: n, day: s, ...Zn(t) };
|
|
6141
6141
|
}
|
|
6142
6142
|
function Df(t, e) {
|
|
6143
|
-
if (!
|
|
6144
|
-
if (!
|
|
6143
|
+
if (!J(t.localWeekday) || !J(t.localWeekNumber) || !J(t.localWeekYear)) {
|
|
6144
|
+
if (!J(t.weekday) || !J(t.weekNumber) || !J(t.weekYear))
|
|
6145
6145
|
throw new tr(
|
|
6146
6146
|
"Cannot mix locale-based week fields with ISO-based week fields"
|
|
6147
6147
|
);
|
|
6148
|
-
return
|
|
6148
|
+
return J(t.localWeekday) || (t.weekday = t.localWeekday), J(t.localWeekNumber) || (t.weekNumber = t.localWeekNumber), J(t.localWeekYear) || (t.weekYear = t.localWeekYear), delete t.localWeekday, delete t.localWeekNumber, delete t.localWeekYear, {
|
|
6149
6149
|
minDaysInFirstWeek: e.getMinDaysInFirstWeek(),
|
|
6150
6150
|
startOfWeek: e.getStartOfWeek()
|
|
6151
6151
|
};
|
|
@@ -6153,26 +6153,26 @@ function Df(t, e) {
|
|
|
6153
6153
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
6154
6154
|
}
|
|
6155
6155
|
function w_(t, e = 4, r = 1) {
|
|
6156
|
-
const n = Wn(t.weekYear), s =
|
|
6156
|
+
const n = Wn(t.weekYear), s = Ke(
|
|
6157
6157
|
t.weekNumber,
|
|
6158
6158
|
1,
|
|
6159
6159
|
Ur(t.weekYear, e, r)
|
|
6160
|
-
), i =
|
|
6161
|
-
return n ? s ? i ? !1 :
|
|
6160
|
+
), i = Ke(t.weekday, 1, 7);
|
|
6161
|
+
return n ? s ? i ? !1 : He("weekday", t.weekday) : He("week", t.weekNumber) : He("weekYear", t.weekYear);
|
|
6162
6162
|
}
|
|
6163
6163
|
function b_(t) {
|
|
6164
|
-
const e = Wn(t.year), r =
|
|
6165
|
-
return e ? r ? !1 :
|
|
6164
|
+
const e = Wn(t.year), r = Ke(t.ordinal, 1, nr(t.year));
|
|
6165
|
+
return e ? r ? !1 : He("ordinal", t.ordinal) : He("year", t.year);
|
|
6166
6166
|
}
|
|
6167
6167
|
function Mh(t) {
|
|
6168
|
-
const e = Wn(t.year), r =
|
|
6169
|
-
return e ? r ? n ? !1 :
|
|
6168
|
+
const e = Wn(t.year), r = Ke(t.month, 1, 12), n = Ke(t.day, 1, Tn(t.year, t.month));
|
|
6169
|
+
return e ? r ? n ? !1 : He("day", t.day) : He("month", t.month) : He("year", t.year);
|
|
6170
6170
|
}
|
|
6171
6171
|
function qh(t) {
|
|
6172
|
-
const { hour: e, minute: r, second: n, millisecond: s } = t, i =
|
|
6173
|
-
return i ? a ? o ? c ? !1 :
|
|
6172
|
+
const { hour: e, minute: r, second: n, millisecond: s } = t, i = Ke(e, 0, 23) || e === 24 && r === 0 && n === 0 && s === 0, a = Ke(r, 0, 59), o = Ke(n, 0, 59), c = Ke(s, 0, 999);
|
|
6173
|
+
return i ? a ? o ? c ? !1 : He("millisecond", s) : He("second", n) : He("minute", r) : He("hour", e);
|
|
6174
6174
|
}
|
|
6175
|
-
function
|
|
6175
|
+
function J(t) {
|
|
6176
6176
|
return typeof t > "u";
|
|
6177
6177
|
}
|
|
6178
6178
|
function It(t) {
|
|
@@ -6221,36 +6221,36 @@ function So(t) {
|
|
|
6221
6221
|
if (t == null)
|
|
6222
6222
|
return null;
|
|
6223
6223
|
if (typeof t != "object")
|
|
6224
|
-
throw new
|
|
6225
|
-
if (!
|
|
6226
|
-
throw new
|
|
6224
|
+
throw new Fe("Week settings must be an object");
|
|
6225
|
+
if (!Ke(t.firstDay, 1, 7) || !Ke(t.minimalDays, 1, 7) || !Array.isArray(t.weekend) || t.weekend.some((e) => !Ke(e, 1, 7)))
|
|
6226
|
+
throw new Fe("Invalid week settings");
|
|
6227
6227
|
return {
|
|
6228
6228
|
firstDay: t.firstDay,
|
|
6229
6229
|
minimalDays: t.minimalDays,
|
|
6230
6230
|
weekend: Array.from(t.weekend)
|
|
6231
6231
|
};
|
|
6232
6232
|
}
|
|
6233
|
-
function
|
|
6233
|
+
function Ke(t, e, r) {
|
|
6234
6234
|
return Wn(t) && t >= e && t <= r;
|
|
6235
6235
|
}
|
|
6236
6236
|
function R_(t, e) {
|
|
6237
6237
|
return t - e * Math.floor(t / e);
|
|
6238
6238
|
}
|
|
6239
|
-
function
|
|
6239
|
+
function Ce(t, e = 2) {
|
|
6240
6240
|
const r = t < 0;
|
|
6241
6241
|
let n;
|
|
6242
6242
|
return r ? n = "-" + ("" + -t).padStart(e, "0") : n = ("" + t).padStart(e, "0"), n;
|
|
6243
6243
|
}
|
|
6244
6244
|
function Rt(t) {
|
|
6245
|
-
if (!(
|
|
6245
|
+
if (!(J(t) || t === null || t === ""))
|
|
6246
6246
|
return parseInt(t, 10);
|
|
6247
6247
|
}
|
|
6248
6248
|
function Mt(t) {
|
|
6249
|
-
if (!(
|
|
6249
|
+
if (!(J(t) || t === null || t === ""))
|
|
6250
6250
|
return parseFloat(t);
|
|
6251
6251
|
}
|
|
6252
6252
|
function nc(t) {
|
|
6253
|
-
if (!(
|
|
6253
|
+
if (!(J(t) || t === null || t === "")) {
|
|
6254
6254
|
const e = parseFloat("0." + t) * 1e3;
|
|
6255
6255
|
return Math.floor(e);
|
|
6256
6256
|
}
|
|
@@ -6326,7 +6326,7 @@ function Bn(t, e) {
|
|
|
6326
6326
|
function Vh(t) {
|
|
6327
6327
|
const e = Number(t);
|
|
6328
6328
|
if (typeof t == "boolean" || t === "" || !Number.isFinite(e))
|
|
6329
|
-
throw new
|
|
6329
|
+
throw new Fe(`Invalid unit value ${t}`);
|
|
6330
6330
|
return e;
|
|
6331
6331
|
}
|
|
6332
6332
|
function Rn(t, e) {
|
|
@@ -6343,11 +6343,11 @@ function Mr(t, e) {
|
|
|
6343
6343
|
const r = Math.trunc(Math.abs(t / 60)), n = Math.trunc(Math.abs(t % 60)), s = t >= 0 ? "+" : "-";
|
|
6344
6344
|
switch (e) {
|
|
6345
6345
|
case "short":
|
|
6346
|
-
return `${s}${
|
|
6346
|
+
return `${s}${Ce(r, 2)}:${Ce(n, 2)}`;
|
|
6347
6347
|
case "narrow":
|
|
6348
6348
|
return `${s}${r}${n > 0 ? `:${n}` : ""}`;
|
|
6349
6349
|
case "techie":
|
|
6350
|
-
return `${s}${
|
|
6350
|
+
return `${s}${Ce(r, 2)}${Ce(n, 2)}`;
|
|
6351
6351
|
default:
|
|
6352
6352
|
throw new RangeError(`Value format ${e} is out of range for property format`);
|
|
6353
6353
|
}
|
|
@@ -6499,9 +6499,9 @@ const L_ = {
|
|
|
6499
6499
|
FFF: Ch,
|
|
6500
6500
|
FFFF: kh
|
|
6501
6501
|
};
|
|
6502
|
-
class
|
|
6502
|
+
class De {
|
|
6503
6503
|
static create(e, r = {}) {
|
|
6504
|
-
return new
|
|
6504
|
+
return new De(e, r);
|
|
6505
6505
|
}
|
|
6506
6506
|
static parseFormat(e) {
|
|
6507
6507
|
let r = null, n = "", s = !1;
|
|
@@ -6541,7 +6541,7 @@ class Fe {
|
|
|
6541
6541
|
}
|
|
6542
6542
|
num(e, r = 0, n = void 0) {
|
|
6543
6543
|
if (this.opts.forceSimple)
|
|
6544
|
-
return
|
|
6544
|
+
return Ce(e, r);
|
|
6545
6545
|
const s = { ...this.opts };
|
|
6546
6546
|
return r > 0 && (s.padTo = r), n && (s.signDisplay = n), this.loc.numberFormatter(s).format(e);
|
|
6547
6547
|
}
|
|
@@ -6550,7 +6550,7 @@ class Fe {
|
|
|
6550
6550
|
p ? { weekday: h } : { weekday: h, month: "long", day: "numeric" },
|
|
6551
6551
|
"weekday"
|
|
6552
6552
|
), u = (h) => {
|
|
6553
|
-
const p =
|
|
6553
|
+
const p = De.macroTokenToFormatOpts(h);
|
|
6554
6554
|
return p ? this.formatWithSystemDefault(e, p) : h;
|
|
6555
6555
|
}, f = (h) => n ? M_(e, h) : i({ era: h }, "era"), d = (h) => {
|
|
6556
6556
|
switch (h) {
|
|
@@ -6695,7 +6695,7 @@ class Fe {
|
|
|
6695
6695
|
return u(h);
|
|
6696
6696
|
}
|
|
6697
6697
|
};
|
|
6698
|
-
return qf(
|
|
6698
|
+
return qf(De.parseFormat(r), d);
|
|
6699
6699
|
}
|
|
6700
6700
|
formatDurationFromString(e, r) {
|
|
6701
6701
|
const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, s = (u) => {
|
|
@@ -6727,7 +6727,7 @@ class Fe {
|
|
|
6727
6727
|
return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? b = "never" : this.opts.signMode === "all" ? b = "always" : b = "auto", this.num(u.get(h) * p, d.length, b);
|
|
6728
6728
|
} else
|
|
6729
6729
|
return d;
|
|
6730
|
-
}, a =
|
|
6730
|
+
}, a = De.parseFormat(r), o = a.reduce(
|
|
6731
6731
|
(u, { literal: f, val: d }) => f ? u : u.concat(d),
|
|
6732
6732
|
[]
|
|
6733
6733
|
), c = e.shiftTo(...o.map(s).filter((u) => u)), l = {
|
|
@@ -6777,7 +6777,7 @@ const Jh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, $_ = `(?:${Jh.source}?(?:\\[(${
|
|
|
6777
6777
|
), Z_ = RegExp(`(?: ${Xh.source})?`);
|
|
6778
6778
|
function sr(t, e, r) {
|
|
6779
6779
|
const n = t[e];
|
|
6780
|
-
return
|
|
6780
|
+
return J(n) ? r : Rt(n);
|
|
6781
6781
|
}
|
|
6782
6782
|
function G_(t, e) {
|
|
6783
6783
|
return [{
|
|
@@ -6795,7 +6795,7 @@ function vr(t, e) {
|
|
|
6795
6795
|
}, null, e + 4];
|
|
6796
6796
|
}
|
|
6797
6797
|
function Yr(t, e) {
|
|
6798
|
-
const r = !t[e] && !t[e + 1], n = Bn(t[e + 1], t[e + 2]), s = r ? null :
|
|
6798
|
+
const r = !t[e] && !t[e + 1], n = Bn(t[e + 1], t[e + 2]), s = r ? null : Me.instance(n);
|
|
6799
6799
|
return [{}, s, e + 3];
|
|
6800
6800
|
}
|
|
6801
6801
|
function Jr(t, e) {
|
|
@@ -6856,7 +6856,7 @@ function X_(t) {
|
|
|
6856
6856
|
f
|
|
6857
6857
|
] = t, d = oc(e, s, n, r, i, a, o);
|
|
6858
6858
|
let h;
|
|
6859
|
-
return c ? h = J_[c] : l ? h = 0 : h = Bn(u, f), [d, new
|
|
6859
|
+
return c ? h = J_[c] : l ? h = 0 : h = Bn(u, f), [d, new Me(h)];
|
|
6860
6860
|
}
|
|
6861
6861
|
function ev(t) {
|
|
6862
6862
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -6864,11 +6864,11 @@ function ev(t) {
|
|
|
6864
6864
|
const tv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, rv = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, nv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
6865
6865
|
function Lf(t) {
|
|
6866
6866
|
const [, e, r, n, s, i, a, o] = t;
|
|
6867
|
-
return [oc(e, s, n, r, i, a, o),
|
|
6867
|
+
return [oc(e, s, n, r, i, a, o), Me.utcInstance];
|
|
6868
6868
|
}
|
|
6869
6869
|
function sv(t) {
|
|
6870
6870
|
const [, e, r, n, s, i, a, o] = t;
|
|
6871
|
-
return [oc(e, o, r, n, s, i, a),
|
|
6871
|
+
return [oc(e, o, r, n, s, i, a), Me.utcInstance];
|
|
6872
6872
|
}
|
|
6873
6873
|
const iv = gr(j_, ac), av = gr(V_, ac), ov = gr(U_, ac), cv = gr(Qh), em = yr(
|
|
6874
6874
|
G_,
|
|
@@ -6975,25 +6975,25 @@ const $f = "Invalid Duration", tm = {
|
|
|
6975
6975
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
6976
6976
|
},
|
|
6977
6977
|
...tm
|
|
6978
|
-
},
|
|
6978
|
+
}, Ze = 146097 / 400, Yt = 146097 / 4800, Ev = {
|
|
6979
6979
|
years: {
|
|
6980
6980
|
quarters: 4,
|
|
6981
6981
|
months: 12,
|
|
6982
|
-
weeks:
|
|
6983
|
-
days:
|
|
6984
|
-
hours:
|
|
6985
|
-
minutes:
|
|
6986
|
-
seconds:
|
|
6987
|
-
milliseconds:
|
|
6982
|
+
weeks: Ze / 7,
|
|
6983
|
+
days: Ze,
|
|
6984
|
+
hours: Ze * 24,
|
|
6985
|
+
minutes: Ze * 24 * 60,
|
|
6986
|
+
seconds: Ze * 24 * 60 * 60,
|
|
6987
|
+
milliseconds: Ze * 24 * 60 * 60 * 1e3
|
|
6988
6988
|
},
|
|
6989
6989
|
quarters: {
|
|
6990
6990
|
months: 3,
|
|
6991
|
-
weeks:
|
|
6992
|
-
days:
|
|
6993
|
-
hours:
|
|
6994
|
-
minutes:
|
|
6995
|
-
seconds:
|
|
6996
|
-
milliseconds:
|
|
6991
|
+
weeks: Ze / 28,
|
|
6992
|
+
days: Ze / 4,
|
|
6993
|
+
hours: Ze * 24 / 4,
|
|
6994
|
+
minutes: Ze * 24 * 60 / 4,
|
|
6995
|
+
seconds: Ze * 24 * 60 * 60 / 4,
|
|
6996
|
+
milliseconds: Ze * 24 * 60 * 60 * 1e3 / 4
|
|
6997
6997
|
},
|
|
6998
6998
|
months: {
|
|
6999
6999
|
weeks: Yt / 7,
|
|
@@ -7033,7 +7033,7 @@ function rm(t, e) {
|
|
|
7033
7033
|
function jf(t, e) {
|
|
7034
7034
|
const r = rm(t, e) < 0 ? -1 : 1;
|
|
7035
7035
|
Vt.reduceRight((n, s) => {
|
|
7036
|
-
if (
|
|
7036
|
+
if (J(e[s]))
|
|
7037
7037
|
return n;
|
|
7038
7038
|
if (n) {
|
|
7039
7039
|
const i = e[n] * r, a = t[s][n], o = Math.floor(i / a);
|
|
@@ -7041,7 +7041,7 @@ function jf(t, e) {
|
|
|
7041
7041
|
}
|
|
7042
7042
|
return s;
|
|
7043
7043
|
}, null), Vt.reduce((n, s) => {
|
|
7044
|
-
if (
|
|
7044
|
+
if (J(e[s]))
|
|
7045
7045
|
return n;
|
|
7046
7046
|
if (n) {
|
|
7047
7047
|
const i = e[n] % 1;
|
|
@@ -7099,7 +7099,7 @@ class le {
|
|
|
7099
7099
|
*/
|
|
7100
7100
|
static fromObject(e, r = {}) {
|
|
7101
7101
|
if (e == null || typeof e != "object")
|
|
7102
|
-
throw new
|
|
7102
|
+
throw new Fe(
|
|
7103
7103
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
7104
7104
|
);
|
|
7105
7105
|
return new le({
|
|
@@ -7126,7 +7126,7 @@ class le {
|
|
|
7126
7126
|
return e;
|
|
7127
7127
|
if (typeof e == "object")
|
|
7128
7128
|
return le.fromObject(e);
|
|
7129
|
-
throw new
|
|
7129
|
+
throw new Fe(
|
|
7130
7130
|
`Unknown duration argument ${e} of type ${typeof e}`
|
|
7131
7131
|
);
|
|
7132
7132
|
}
|
|
@@ -7176,7 +7176,7 @@ class le {
|
|
|
7176
7176
|
*/
|
|
7177
7177
|
static invalid(e, r = null) {
|
|
7178
7178
|
if (!e)
|
|
7179
|
-
throw new
|
|
7179
|
+
throw new Fe("need to specify a reason the Duration is invalid");
|
|
7180
7180
|
const n = e instanceof nt ? e : new nt(e, r);
|
|
7181
7181
|
if (Se.throwOnInvalid)
|
|
7182
7182
|
throw new Yy(n);
|
|
@@ -7263,7 +7263,7 @@ class le {
|
|
|
7263
7263
|
...r,
|
|
7264
7264
|
floor: r.round !== !1 && r.floor !== !1
|
|
7265
7265
|
};
|
|
7266
|
-
return this.isValid ?
|
|
7266
|
+
return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) : $f;
|
|
7267
7267
|
}
|
|
7268
7268
|
/**
|
|
7269
7269
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -7285,7 +7285,7 @@ class le {
|
|
|
7285
7285
|
if (!this.isValid) return $f;
|
|
7286
7286
|
const r = e.showZeros !== !1, n = Vt.map((s) => {
|
|
7287
7287
|
const i = this.values[s];
|
|
7288
|
-
return
|
|
7288
|
+
return J(i) || i === 0 && !r ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
|
|
7289
7289
|
}).filter((s) => s);
|
|
7290
7290
|
return this.loc.listFormatter({ type: "conjunction", style: e.listStyle || "narrow", ...e }).format(n);
|
|
7291
7291
|
}
|
|
@@ -7674,7 +7674,7 @@ class Ee {
|
|
|
7674
7674
|
*/
|
|
7675
7675
|
static invalid(e, r = null) {
|
|
7676
7676
|
if (!e)
|
|
7677
|
-
throw new
|
|
7677
|
+
throw new Fe("need to specify a reason the Interval is invalid");
|
|
7678
7678
|
const n = e instanceof nt ? e : new nt(e, r);
|
|
7679
7679
|
if (Se.throwOnInvalid)
|
|
7680
7680
|
throw new Ky(n);
|
|
@@ -8049,7 +8049,7 @@ class Ee {
|
|
|
8049
8049
|
* @return {string}
|
|
8050
8050
|
*/
|
|
8051
8051
|
toLocaleString(e = En, r = {}) {
|
|
8052
|
-
return this.isValid ?
|
|
8052
|
+
return this.isValid ? De.create(this.s.loc.clone(r), e).formatInterval(this) : Jt;
|
|
8053
8053
|
}
|
|
8054
8054
|
/**
|
|
8055
8055
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -8587,7 +8587,7 @@ function qv(t) {
|
|
|
8587
8587
|
}
|
|
8588
8588
|
};
|
|
8589
8589
|
let r = null, n;
|
|
8590
|
-
return
|
|
8590
|
+
return J(t.z) || (r = _t.create(t.z)), J(t.Z) || (r || (r = new Me(t.Z)), n = t.Z), J(t.q) || (t.M = (t.q - 1) * 3 + 1), J(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), J(t.u) || (t.S = nc(t.u)), [Object.keys(t).reduce((i, a) => {
|
|
8591
8591
|
const o = e(a);
|
|
8592
8592
|
return o && (i[o] = t[a]), i;
|
|
8593
8593
|
}, {}), r, n];
|
|
@@ -8599,7 +8599,7 @@ function Lv() {
|
|
|
8599
8599
|
function $v(t, e) {
|
|
8600
8600
|
if (t.literal)
|
|
8601
8601
|
return t;
|
|
8602
|
-
const r =
|
|
8602
|
+
const r = De.macroTokenToFormatOpts(t.val), n = cm(r, e);
|
|
8603
8603
|
return n == null || n.includes(void 0) ? t : n;
|
|
8604
8604
|
}
|
|
8605
8605
|
function im(t, e) {
|
|
@@ -8607,7 +8607,7 @@ function im(t, e) {
|
|
|
8607
8607
|
}
|
|
8608
8608
|
class am {
|
|
8609
8609
|
constructor(e, r) {
|
|
8610
|
-
if (this.locale = e, this.format = r, this.tokens = im(
|
|
8610
|
+
if (this.locale = e, this.format = r, this.tokens = im(De.parseFormat(r), e), this.units = this.tokens.map((n) => Nv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
8611
8611
|
const [n, s] = Pv(this.units);
|
|
8612
8612
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
8613
8613
|
}
|
|
@@ -8649,7 +8649,7 @@ function jv(t, e, r) {
|
|
|
8649
8649
|
function cm(t, e) {
|
|
8650
8650
|
if (!t)
|
|
8651
8651
|
return null;
|
|
8652
|
-
const n =
|
|
8652
|
+
const n = De.create(e, t).dtFormatter(Lv()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
8653
8653
|
return s.map((a) => Dv(a, t, i));
|
|
8654
8654
|
}
|
|
8655
8655
|
const Aa = "Invalid DateTime", Bf = 864e13;
|
|
@@ -8737,7 +8737,7 @@ function Qt(t, e, r, n, s, i) {
|
|
|
8737
8737
|
);
|
|
8738
8738
|
}
|
|
8739
8739
|
function cn(t, e, r = !0) {
|
|
8740
|
-
return t.isValid ?
|
|
8740
|
+
return t.isValid ? De.create(me.create("en-US"), {
|
|
8741
8741
|
allowZ: r,
|
|
8742
8742
|
forceSimple: !0
|
|
8743
8743
|
}).formatDateTimeFromString(t, e) : null;
|
|
@@ -8745,12 +8745,12 @@ function cn(t, e, r = !0) {
|
|
|
8745
8745
|
function xa(t, e, r) {
|
|
8746
8746
|
const n = t.c.year > 9999 || t.c.year < 0;
|
|
8747
8747
|
let s = "";
|
|
8748
|
-
if (n && t.c.year >= 0 && (s += "+"), s +=
|
|
8748
|
+
if (n && t.c.year >= 0 && (s += "+"), s += Ce(t.c.year, n ? 6 : 4), r === "year") return s;
|
|
8749
8749
|
if (e) {
|
|
8750
|
-
if (s += "-", s +=
|
|
8750
|
+
if (s += "-", s += Ce(t.c.month), r === "month") return s;
|
|
8751
8751
|
s += "-";
|
|
8752
|
-
} else if (s +=
|
|
8753
|
-
return s +=
|
|
8752
|
+
} else if (s += Ce(t.c.month), r === "month") return s;
|
|
8753
|
+
return s += Ce(t.c.day), s;
|
|
8754
8754
|
}
|
|
8755
8755
|
function Gf(t, e, r, n, s, i, a) {
|
|
8756
8756
|
let o = !r || t.c.millisecond !== 0 || t.c.second !== 0, c = "";
|
|
@@ -8760,18 +8760,18 @@ function Gf(t, e, r, n, s, i, a) {
|
|
|
8760
8760
|
case "year":
|
|
8761
8761
|
break;
|
|
8762
8762
|
default:
|
|
8763
|
-
if (c +=
|
|
8763
|
+
if (c += Ce(t.c.hour), a === "hour") break;
|
|
8764
8764
|
if (e) {
|
|
8765
|
-
if (c += ":", c +=
|
|
8766
|
-
o && (c += ":", c +=
|
|
8765
|
+
if (c += ":", c += Ce(t.c.minute), a === "minute") break;
|
|
8766
|
+
o && (c += ":", c += Ce(t.c.second));
|
|
8767
8767
|
} else {
|
|
8768
|
-
if (c +=
|
|
8769
|
-
o && (c +=
|
|
8768
|
+
if (c += Ce(t.c.minute), a === "minute") break;
|
|
8769
|
+
o && (c += Ce(t.c.second));
|
|
8770
8770
|
}
|
|
8771
8771
|
if (a === "second") break;
|
|
8772
|
-
o && (!n || t.c.millisecond !== 0) && (c += ".", c +=
|
|
8772
|
+
o && (!n || t.c.millisecond !== 0) && (c += ".", c += Ce(t.c.millisecond, 3));
|
|
8773
8773
|
}
|
|
8774
|
-
return s && (t.isOffsetFixed && t.offset === 0 && !i ? c += "Z" : t.o < 0 ? (c += "-", c +=
|
|
8774
|
+
return s && (t.isOffsetFixed && t.offset === 0 && !i ? c += "Z" : t.o < 0 ? (c += "-", c += Ce(Math.trunc(-t.o / 60)), c += ":", c += Ce(Math.trunc(-t.o % 60))) : (c += "+", c += Ce(Math.trunc(t.o / 60)), c += ":", c += Ce(Math.trunc(t.o % 60)))), i && (c += "[" + t.zone.ianaName + "]"), c;
|
|
8775
8775
|
}
|
|
8776
8776
|
const um = {
|
|
8777
8777
|
month: 1,
|
|
@@ -8860,11 +8860,11 @@ function Kf(t, e) {
|
|
|
8860
8860
|
return G.invalid(Ir(r));
|
|
8861
8861
|
const n = me.fromObject(e);
|
|
8862
8862
|
let s, i;
|
|
8863
|
-
if (
|
|
8863
|
+
if (J(t.year))
|
|
8864
8864
|
s = Se.now();
|
|
8865
8865
|
else {
|
|
8866
8866
|
for (const c of fn)
|
|
8867
|
-
|
|
8867
|
+
J(t[c]) && (t[c] = um[c]);
|
|
8868
8868
|
const a = Mh(t) || qh(t);
|
|
8869
8869
|
if (a)
|
|
8870
8870
|
return G.invalid(a);
|
|
@@ -8874,7 +8874,7 @@ function Kf(t, e) {
|
|
|
8874
8874
|
return new G({ ts: s, zone: r, loc: n, o: i });
|
|
8875
8875
|
}
|
|
8876
8876
|
function Yf(t, e, r) {
|
|
8877
|
-
const n =
|
|
8877
|
+
const n = J(r.round) ? !0 : r.round, s = J(r.rounding) ? "trunc" : r.rounding, i = (o, c) => (o = sc(o, n || r.calendary ? 0 : 2, r.calendary ? "round" : s), e.loc.clone(r).relFormatter(r).format(o, c)), a = (o) => r.calendary ? e.hasSame(t, o) ? 0 : e.startOf(o).diff(t.startOf(o), o).get(o) : e.diff(t, o).get(o);
|
|
8878
8878
|
if (r.unit)
|
|
8879
8879
|
return i(a(r.unit), r.unit);
|
|
8880
8880
|
for (const o of r.units) {
|
|
@@ -8897,7 +8897,7 @@ class G {
|
|
|
8897
8897
|
constructor(e) {
|
|
8898
8898
|
const r = e.zone || Se.defaultZone;
|
|
8899
8899
|
let n = e.invalid || (Number.isNaN(e.ts) ? new nt("invalid input") : null) || (r.isValid ? null : Ir(r));
|
|
8900
|
-
this.ts =
|
|
8900
|
+
this.ts = J(e.ts) ? Se.now() : e.ts;
|
|
8901
8901
|
let s = null, i = null;
|
|
8902
8902
|
if (!n)
|
|
8903
8903
|
if (e.old && e.old.ts === this.ts && e.old.zone.equals(r))
|
|
@@ -8971,7 +8971,7 @@ class G {
|
|
|
8971
8971
|
*/
|
|
8972
8972
|
static utc() {
|
|
8973
8973
|
const [e, r] = Jf(arguments), [n, s, i, a, o, c, l] = r;
|
|
8974
|
-
return e.zone =
|
|
8974
|
+
return e.zone = Me.utcInstance, Kf({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
|
|
8975
8975
|
}
|
|
8976
8976
|
/**
|
|
8977
8977
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -9009,7 +9009,7 @@ class G {
|
|
|
9009
9009
|
zone: At(r.zone, Se.defaultZone),
|
|
9010
9010
|
loc: me.fromObject(r)
|
|
9011
9011
|
});
|
|
9012
|
-
throw new
|
|
9012
|
+
throw new Fe(
|
|
9013
9013
|
`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
|
|
9014
9014
|
);
|
|
9015
9015
|
}
|
|
@@ -9031,7 +9031,7 @@ class G {
|
|
|
9031
9031
|
zone: At(r.zone, Se.defaultZone),
|
|
9032
9032
|
loc: me.fromObject(r)
|
|
9033
9033
|
});
|
|
9034
|
-
throw new
|
|
9034
|
+
throw new Fe("fromSeconds requires a numerical input");
|
|
9035
9035
|
}
|
|
9036
9036
|
/**
|
|
9037
9037
|
* Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
|
|
@@ -9071,7 +9071,7 @@ class G {
|
|
|
9071
9071
|
const n = At(r.zone, Se.defaultZone);
|
|
9072
9072
|
if (!n.isValid)
|
|
9073
9073
|
return G.invalid(Ir(n));
|
|
9074
|
-
const s = me.fromObject(r), i = Rn(e, Hf), { minDaysInFirstWeek: a, startOfWeek: o } = Df(i, s), c = Se.now(), l =
|
|
9074
|
+
const s = me.fromObject(r), i = Rn(e, Hf), { minDaysInFirstWeek: a, startOfWeek: o } = Df(i, s), c = Se.now(), l = J(r.specificOffset) ? n.offset(c) : r.specificOffset, u = !J(i.ordinal), f = !J(i.year), d = !J(i.month) || !J(i.day), h = f || d, p = i.weekYear || i.weekNumber;
|
|
9075
9075
|
if ((h || u) && p)
|
|
9076
9076
|
throw new tr(
|
|
9077
9077
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -9084,7 +9084,7 @@ class G {
|
|
|
9084
9084
|
let C = !1;
|
|
9085
9085
|
for (const v of g) {
|
|
9086
9086
|
const w = i[v];
|
|
9087
|
-
|
|
9087
|
+
J(w) ? C ? i[v] = O[v] : i[v] = S[v] : C = !0;
|
|
9088
9088
|
}
|
|
9089
9089
|
const x = b ? w_(i, a, o) : u ? b_(i) : Mh(i), y = x || qh(i);
|
|
9090
9090
|
if (y)
|
|
@@ -9175,8 +9175,8 @@ class G {
|
|
|
9175
9175
|
* @return {DateTime}
|
|
9176
9176
|
*/
|
|
9177
9177
|
static fromFormat(e, r, n = {}) {
|
|
9178
|
-
if (
|
|
9179
|
-
throw new
|
|
9178
|
+
if (J(e) || J(r))
|
|
9179
|
+
throw new Fe("fromFormat requires an input string and a format");
|
|
9180
9180
|
const { locale: s = null, numberingSystem: i = null } = n, a = me.fromOpts({
|
|
9181
9181
|
locale: s,
|
|
9182
9182
|
numberingSystem: i,
|
|
@@ -9223,7 +9223,7 @@ class G {
|
|
|
9223
9223
|
*/
|
|
9224
9224
|
static invalid(e, r = null) {
|
|
9225
9225
|
if (!e)
|
|
9226
|
-
throw new
|
|
9226
|
+
throw new Fe("need to specify a reason the DateTime is invalid");
|
|
9227
9227
|
const n = e instanceof nt ? e : new nt(e, r);
|
|
9228
9228
|
if (Se.throwOnInvalid)
|
|
9229
9229
|
throw new Hy(n);
|
|
@@ -9255,7 +9255,7 @@ class G {
|
|
|
9255
9255
|
* @returns {string}
|
|
9256
9256
|
*/
|
|
9257
9257
|
static expandFormat(e, r = {}) {
|
|
9258
|
-
return im(
|
|
9258
|
+
return im(De.parseFormat(e), me.fromObject(r)).map((s) => s.val).join("");
|
|
9259
9259
|
}
|
|
9260
9260
|
static resetCache() {
|
|
9261
9261
|
xr = void 0, Ro.clear();
|
|
@@ -9619,7 +9619,7 @@ class G {
|
|
|
9619
9619
|
* @return {Object}
|
|
9620
9620
|
*/
|
|
9621
9621
|
resolvedLocaleOptions(e = {}) {
|
|
9622
|
-
const { locale: r, numberingSystem: n, calendar: s } =
|
|
9622
|
+
const { locale: r, numberingSystem: n, calendar: s } = De.create(
|
|
9623
9623
|
this.loc.clone(e),
|
|
9624
9624
|
e
|
|
9625
9625
|
).resolvedOptions(this);
|
|
@@ -9635,7 +9635,7 @@ class G {
|
|
|
9635
9635
|
* @return {DateTime}
|
|
9636
9636
|
*/
|
|
9637
9637
|
toUTC(e = 0, r = {}) {
|
|
9638
|
-
return this.setZone(
|
|
9638
|
+
return this.setZone(Me.instance(e), r);
|
|
9639
9639
|
}
|
|
9640
9640
|
/**
|
|
9641
9641
|
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
|
|
@@ -9702,7 +9702,7 @@ class G {
|
|
|
9702
9702
|
*/
|
|
9703
9703
|
set(e) {
|
|
9704
9704
|
if (!this.isValid) return this;
|
|
9705
|
-
const r = Rn(e, Hf), { minDaysInFirstWeek: n, startOfWeek: s } = Df(r, this.loc), i = !
|
|
9705
|
+
const r = Rn(e, Hf), { minDaysInFirstWeek: n, startOfWeek: s } = Df(r, this.loc), i = !J(r.weekYear) || !J(r.weekNumber) || !J(r.weekday), a = !J(r.ordinal), o = !J(r.year), c = !J(r.month) || !J(r.day), l = o || c, u = r.weekYear || r.weekNumber;
|
|
9706
9706
|
if ((l || a) && u)
|
|
9707
9707
|
throw new tr(
|
|
9708
9708
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -9714,7 +9714,7 @@ class G {
|
|
|
9714
9714
|
{ ...Sn(this.c, n, s), ...r },
|
|
9715
9715
|
n,
|
|
9716
9716
|
s
|
|
9717
|
-
) :
|
|
9717
|
+
) : J(r.ordinal) ? (f = { ...this.toObject(), ...r }, J(r.day) && (f.day = Math.min(Tn(f.year, f.month), f.day))) : f = Ff({ ...Ra(this.c), ...r });
|
|
9718
9718
|
const [d, h] = un(f, this.o, this.zone);
|
|
9719
9719
|
return qt(this, { ts: d, o: h });
|
|
9720
9720
|
}
|
|
@@ -9825,7 +9825,7 @@ class G {
|
|
|
9825
9825
|
* @return {string}
|
|
9826
9826
|
*/
|
|
9827
9827
|
toFormat(e, r = {}) {
|
|
9828
|
-
return this.isValid ?
|
|
9828
|
+
return this.isValid ? De.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this, e) : Aa;
|
|
9829
9829
|
}
|
|
9830
9830
|
/**
|
|
9831
9831
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -9847,7 +9847,7 @@ class G {
|
|
|
9847
9847
|
* @return {string}
|
|
9848
9848
|
*/
|
|
9849
9849
|
toLocaleString(e = En, r = {}) {
|
|
9850
|
-
return this.isValid ?
|
|
9850
|
+
return this.isValid ? De.create(this.loc.clone(r), e).formatDateTime(this) : Aa;
|
|
9851
9851
|
}
|
|
9852
9852
|
/**
|
|
9853
9853
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -9863,7 +9863,7 @@ class G {
|
|
|
9863
9863
|
* //=> ]
|
|
9864
9864
|
*/
|
|
9865
9865
|
toLocaleParts(e = {}) {
|
|
9866
|
-
return this.isValid ?
|
|
9866
|
+
return this.isValid ? De.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
|
|
9867
9867
|
}
|
|
9868
9868
|
/**
|
|
9869
9869
|
* Returns an ISO 8601-compliant string representation of this DateTime
|
|
@@ -10221,7 +10221,7 @@ class G {
|
|
|
10221
10221
|
*/
|
|
10222
10222
|
static min(...e) {
|
|
10223
10223
|
if (!e.every(G.isDateTime))
|
|
10224
|
-
throw new
|
|
10224
|
+
throw new Fe("min requires all arguments be DateTimes");
|
|
10225
10225
|
return Pf(e, (r) => r.valueOf(), Math.min);
|
|
10226
10226
|
}
|
|
10227
10227
|
/**
|
|
@@ -10231,7 +10231,7 @@ class G {
|
|
|
10231
10231
|
*/
|
|
10232
10232
|
static max(...e) {
|
|
10233
10233
|
if (!e.every(G.isDateTime))
|
|
10234
|
-
throw new
|
|
10234
|
+
throw new Fe("max requires all arguments be DateTimes");
|
|
10235
10235
|
return Pf(e, (r) => r.valueOf(), Math.max);
|
|
10236
10236
|
}
|
|
10237
10237
|
// MISC
|
|
@@ -10287,8 +10287,8 @@ class G {
|
|
|
10287
10287
|
* @returns {DateTime}
|
|
10288
10288
|
*/
|
|
10289
10289
|
static fromFormatParser(e, r, n = {}) {
|
|
10290
|
-
if (
|
|
10291
|
-
throw new
|
|
10290
|
+
if (J(e) || J(r))
|
|
10291
|
+
throw new Fe(
|
|
10292
10292
|
"fromFormatParser requires an input string and a format parser"
|
|
10293
10293
|
);
|
|
10294
10294
|
const { locale: s = null, numberingSystem: i = null } = n, a = me.fromOpts({
|
|
@@ -10297,7 +10297,7 @@ class G {
|
|
|
10297
10297
|
defaultToEN: !0
|
|
10298
10298
|
});
|
|
10299
10299
|
if (!a.equals(r.locale))
|
|
10300
|
-
throw new
|
|
10300
|
+
throw new Fe(
|
|
10301
10301
|
`fromFormatParser called with a locale of ${a}, but the format parser was created for ${r.locale}`
|
|
10302
10302
|
);
|
|
10303
10303
|
const { result: o, zone: c, specificOffset: l, invalidReason: u } = r.explainFromTokens(e);
|
|
@@ -10473,7 +10473,7 @@ function Er(t) {
|
|
|
10473
10473
|
return G.fromJSDate(t);
|
|
10474
10474
|
if (t && typeof t == "object")
|
|
10475
10475
|
return G.fromObject(t);
|
|
10476
|
-
throw new
|
|
10476
|
+
throw new Fe(
|
|
10477
10477
|
`Unknown datetime argument: ${t}, of type ${typeof t}`
|
|
10478
10478
|
);
|
|
10479
10479
|
}
|
|
@@ -10715,11 +10715,11 @@ var Ha, pd;
|
|
|
10715
10715
|
function ow() {
|
|
10716
10716
|
if (pd) return Ha;
|
|
10717
10717
|
pd = 1;
|
|
10718
|
-
var t = qo(), e = Zv(), r = Ho(), n = Gv(), s = Hv(), i = Hd(), a = Yd(), o = Kv(), c = Yv(), l = zd(), u = Jv(), f = jn(), d = Qv(), h = rw(), p = Jd(), b = Ft(), g = Ln(), O = sw(), S = vt(), C = aw(), x = zo(), y = Zr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", v = "[object Array]", w = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]",
|
|
10719
|
-
D[N] = D[v] = D[
|
|
10720
|
-
function ue(X, pe, _e, ae,
|
|
10721
|
-
var ke, Gt = pe & E, Or = pe & R,
|
|
10722
|
-
if (_e && (ke =
|
|
10718
|
+
var t = qo(), e = Zv(), r = Ho(), n = Gv(), s = Hv(), i = Hd(), a = Yd(), o = Kv(), c = Yv(), l = zd(), u = Jv(), f = jn(), d = Qv(), h = rw(), p = Jd(), b = Ft(), g = Ln(), O = sw(), S = vt(), C = aw(), x = zo(), y = Zr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", v = "[object Array]", w = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]", z = "[object WeakMap]", V = "[object ArrayBuffer]", K = "[object DataView]", xe = "[object Float32Array]", Te = "[object Float64Array]", Xe = "[object Int8Array]", bt = "[object Int16Array]", br = "[object Int32Array]", q = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", U = "[object Uint16Array]", H = "[object Uint32Array]", D = {};
|
|
10719
|
+
D[N] = D[v] = D[V] = D[K] = D[w] = D[I] = D[xe] = D[Te] = D[Xe] = D[bt] = D[br] = D[L] = D[k] = D[M] = D[F] = D[Z] = D[re] = D[oe] = D[q] = D[Y] = D[U] = D[H] = !0, D[m] = D[T] = D[z] = !1;
|
|
10720
|
+
function ue(X, pe, _e, ae, Le, $e) {
|
|
10721
|
+
var ke, Gt = pe & E, Or = pe & R, Ne = pe & _;
|
|
10722
|
+
if (_e && (ke = Le ? _e(X, ae, Le, $e) : _e(X)), ke !== void 0)
|
|
10723
10723
|
return ke;
|
|
10724
10724
|
if (!S(X))
|
|
10725
10725
|
return X;
|
|
@@ -10731,27 +10731,27 @@ function ow() {
|
|
|
10731
10731
|
var Kt = f(X), wc = Kt == T || Kt == A;
|
|
10732
10732
|
if (g(X))
|
|
10733
10733
|
return i(X, Gt);
|
|
10734
|
-
if (Kt == M || Kt == N || wc && !
|
|
10734
|
+
if (Kt == M || Kt == N || wc && !Le) {
|
|
10735
10735
|
if (ke = Or || wc ? {} : p(X), !Gt)
|
|
10736
10736
|
return Or ? c(X, s(ke, X)) : o(X, n(ke, X));
|
|
10737
10737
|
} else {
|
|
10738
10738
|
if (!D[Kt])
|
|
10739
|
-
return
|
|
10739
|
+
return Le ? X : {};
|
|
10740
10740
|
ke = h(X, Kt, Gt);
|
|
10741
10741
|
}
|
|
10742
10742
|
}
|
|
10743
|
-
|
|
10744
|
-
var bc =
|
|
10743
|
+
$e || ($e = new t());
|
|
10744
|
+
var bc = $e.get(X);
|
|
10745
10745
|
if (bc)
|
|
10746
10746
|
return bc;
|
|
10747
|
-
|
|
10748
|
-
ke.add(ue(Ot, pe, _e, Ot, X,
|
|
10747
|
+
$e.set(X, ke), C(X) ? X.forEach(function(Ot) {
|
|
10748
|
+
ke.add(ue(Ot, pe, _e, Ot, X, $e));
|
|
10749
10749
|
}) : O(X) && X.forEach(function(Ot, Pt) {
|
|
10750
|
-
ke.set(Pt, ue(Ot, pe, _e, Pt, X,
|
|
10750
|
+
ke.set(Pt, ue(Ot, pe, _e, Pt, X, $e));
|
|
10751
10751
|
});
|
|
10752
|
-
var Dm =
|
|
10752
|
+
var Dm = Ne ? Or ? u : l : Or ? y : x, Oc = Ht ? void 0 : Dm(X);
|
|
10753
10753
|
return e(Oc || X, function(Ot, Pt) {
|
|
10754
|
-
Oc && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X,
|
|
10754
|
+
Oc && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X, $e));
|
|
10755
10755
|
}), ke;
|
|
10756
10756
|
}
|
|
10757
10757
|
return Ha = ue, Ha;
|
|
@@ -10853,7 +10853,7 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
10853
10853
|
throw new Error("Email body is too long");
|
|
10854
10854
|
return e;
|
|
10855
10855
|
}, hw = (t = "enterprise", e) => t === "enterprise" ? e : "(default)", lc = (t, e) => {
|
|
10856
|
-
const r =
|
|
10856
|
+
const r = ze(), n = Dt(), s = We(), i = Pe(), a = t.at(-1);
|
|
10857
10857
|
if (!a)
|
|
10858
10858
|
throw new Error("EMPTY_PATH");
|
|
10859
10859
|
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = ft(a), d = i.collections?.[c.collection];
|
|
@@ -10984,8 +10984,8 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
10984
10984
|
if (F) {
|
|
10985
10985
|
const re = A.singleQuery ? A.singleQuery : R;
|
|
10986
10986
|
for (let oe = 0; oe < F.length; oe += re) {
|
|
10987
|
-
const
|
|
10988
|
-
Z.push(
|
|
10987
|
+
const z = F.slice(oe, oe + re);
|
|
10988
|
+
Z.push(z);
|
|
10989
10989
|
}
|
|
10990
10990
|
if (!A.singleQuery)
|
|
10991
10991
|
Z.forEach((oe) => {
|
|
@@ -11035,13 +11035,13 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
11035
11035
|
Object.entries(F).forEach(([Z, re]) => {
|
|
11036
11036
|
if (re.length > 0) {
|
|
11037
11037
|
const oe = [];
|
|
11038
|
-
for (let
|
|
11039
|
-
const
|
|
11040
|
-
oe.push(
|
|
11038
|
+
for (let z = 0; z < re.length; z += R) {
|
|
11039
|
+
const V = re.slice(z, z + R);
|
|
11040
|
+
oe.push(V);
|
|
11041
11041
|
}
|
|
11042
|
-
oe.forEach((
|
|
11042
|
+
oe.forEach((z) => {
|
|
11043
11043
|
w.push(...S(_.concat([
|
|
11044
|
-
ye(`${L.name}_Array`, "array-contains-any",
|
|
11044
|
+
ye(`${L.name}_Array`, "array-contains-any", z),
|
|
11045
11045
|
ye(k.name, "==", Z)
|
|
11046
11046
|
])));
|
|
11047
11047
|
});
|
|
@@ -11068,7 +11068,7 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
11068
11068
|
n.includes(s) || r.includes(s) || await ir(s, t?.[s].constraints, t?.[s].range, t?.[s].orQueries, t);
|
|
11069
11069
|
return Nr;
|
|
11070
11070
|
}, Co = () => pm, mw = () => Nr, pw = async (t, e, r, n, s) => {
|
|
11071
|
-
const { labels: i, preloadCache: a } = t, c = Qr()[i.collection], l = Ie(), u = ft(i.collection), f =
|
|
11071
|
+
const { labels: i, preloadCache: a } = t, c = Qr()[i.collection], l = Ie(), u = ft(i.collection), f = Pe();
|
|
11072
11072
|
if (!f?.Role)
|
|
11073
11073
|
throw new Error("PERMISSION_DENIED");
|
|
11074
11074
|
if (!a?.roles.includes(f.Role))
|
|
@@ -11109,7 +11109,7 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
11109
11109
|
});
|
|
11110
11110
|
});
|
|
11111
11111
|
}, ir = async (t, e, r, n, s, i) => {
|
|
11112
|
-
const a =
|
|
11112
|
+
const a = We(), o = Pe();
|
|
11113
11113
|
if (!o?.Role)
|
|
11114
11114
|
throw new Error("PERMISSION_DENIED");
|
|
11115
11115
|
const c = a.collections[t], { labels: l, preloadCache: u } = c, f = Co();
|
|
@@ -11146,12 +11146,12 @@ const Oe = /* @__PURE__ */ Fn(lw), xt = (t) => {
|
|
|
11146
11146
|
};
|
|
11147
11147
|
let Lt = null;
|
|
11148
11148
|
const gw = async (t, e) => {
|
|
11149
|
-
const r = [], n = Dt(), s =
|
|
11149
|
+
const r = [], n = Dt(), s = ze(), i = Ie(), a = We();
|
|
11150
11150
|
if (!e.claims.doc)
|
|
11151
11151
|
throw new Error("User document ID not found in claims");
|
|
11152
11152
|
let o = !1, c = null;
|
|
11153
11153
|
return await new Promise((u, f) => {
|
|
11154
|
-
const d = mr(
|
|
11154
|
+
const d = mr(Ae(s, "tenants", n, "system_user_permissions", t.uid), (h) => {
|
|
11155
11155
|
if (h.exists()) {
|
|
11156
11156
|
if (Lt = h.data(), Lt.User_ID = h.id, !Lt.Role)
|
|
11157
11157
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11179,13 +11179,13 @@ const gw = async (t, e) => {
|
|
|
11179
11179
|
});
|
|
11180
11180
|
r.push(d);
|
|
11181
11181
|
}), r;
|
|
11182
|
-
},
|
|
11182
|
+
}, Pe = () => Lt, yw = () => {
|
|
11183
11183
|
Lt = null;
|
|
11184
11184
|
}, uc = (t) => {
|
|
11185
11185
|
if (typeof t == "object")
|
|
11186
11186
|
for (const e in t)
|
|
11187
11187
|
Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? t[e] = "_DELETE_FIELD" : uc(t[e]));
|
|
11188
|
-
},
|
|
11188
|
+
}, Ye = async (t, e, r, n, s, i, a, o, c) => {
|
|
11189
11189
|
const l = Dt(), { labels: u } = i, f = Ie(), d = vc(), h = await ne(f, ["global", "firebase", "writeLogTTL"]), p = {
|
|
11190
11190
|
operation: t,
|
|
11191
11191
|
collection: u.collection,
|
|
@@ -11206,12 +11206,12 @@ const gw = async (t, e) => {
|
|
|
11206
11206
|
}
|
|
11207
11207
|
const b = Oe(r);
|
|
11208
11208
|
t !== "delete" && (p.data.data = b, e === "written" && uc(p.data.data)), t !== "delete" && e !== "written" && rr(b), t === "update" && (p.data.originalRecord = Oe(c)), t !== "delete" && ["started", "written"].includes(e) && (delete p.data.data.Saved_At, delete p.data.data.Last_Save_At), e === "failed" && (p.data.error = JSON.stringify(o));
|
|
11209
|
-
const g = r.Last_Write_At, O =
|
|
11209
|
+
const g = r.Last_Write_At, O = Ae(d, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
|
|
11210
11210
|
Jm(O, p).catch((S) => {
|
|
11211
11211
|
console.error(`Error saving "${e}" ${t} log entry for record ${s} in ${u.collection} collection.`, { cause: S });
|
|
11212
11212
|
});
|
|
11213
11213
|
}, fc = async (t, e, r, n, s) => {
|
|
11214
|
-
const i = Dt(), a =
|
|
11214
|
+
const i = Dt(), a = ze(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
|
|
11215
11215
|
if (!s.Role)
|
|
11216
11216
|
throw new Error("No role found in permissions");
|
|
11217
11217
|
if (await Promise.all(c.map(async (u) => {
|
|
@@ -11222,7 +11222,7 @@ const gw = async (t, e) => {
|
|
|
11222
11222
|
if (!fw(f))
|
|
11223
11223
|
l.push(`${u.name} "${r[u.name]}" is invalid`);
|
|
11224
11224
|
else {
|
|
11225
|
-
const d = await Td(
|
|
11225
|
+
const d = await Td(Ae(a, "tenants", i, "system_unique", o, `Unique-${o}-${u.name}`, f)).catch(() => {
|
|
11226
11226
|
});
|
|
11227
11227
|
d?.exists() && !(t === "update" && d.data().id === e) && l.push(`${u.name} "${r[u.name]}" already exists`);
|
|
11228
11228
|
}
|
|
@@ -11230,7 +11230,7 @@ const gw = async (t, e) => {
|
|
|
11230
11230
|
})), l.length > 0)
|
|
11231
11231
|
throw new Error(l.join(", "));
|
|
11232
11232
|
}, gm = (t, e, r) => {
|
|
11233
|
-
const n =
|
|
11233
|
+
const n = ze(), s = Dt(), i = We(), a = Pe(), o = t.at(-1);
|
|
11234
11234
|
if (!o)
|
|
11235
11235
|
throw new Error("EMPTY_PATH");
|
|
11236
11236
|
const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
|
|
@@ -11238,10 +11238,10 @@ const gw = async (t, e) => {
|
|
|
11238
11238
|
throw new Error("PERMISSION_DENIED");
|
|
11239
11239
|
const f = u && ct("Read", u), d = Nn(c, i, a), h = [];
|
|
11240
11240
|
if (f)
|
|
11241
|
-
h.push(
|
|
11241
|
+
h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${r.key}`, e));
|
|
11242
11242
|
else if (d)
|
|
11243
11243
|
for (const p of d)
|
|
11244
|
-
h.push(
|
|
11244
|
+
h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${p.field}`, e));
|
|
11245
11245
|
return h;
|
|
11246
11246
|
}, _d = (t) => t !== null && typeof t == "object" && !Array.isArray(t), ym = (t) => {
|
|
11247
11247
|
const e = (r) => {
|
|
@@ -11251,7 +11251,7 @@ const gw = async (t, e) => {
|
|
|
11251
11251
|
};
|
|
11252
11252
|
e(t);
|
|
11253
11253
|
}, _w = async (t, e, r) => {
|
|
11254
|
-
const n = it(), s =
|
|
11254
|
+
const n = it(), s = Be(), i = Ue(n, s.STOKER_FB_FUNCTIONS_REGION), a = e?.map((u) => u[2] instanceof Date ? [u[0], u[1], u[2].toISOString()] : u), o = Je(i, "stoker-readapi");
|
|
11255
11255
|
let c;
|
|
11256
11256
|
if (!r?.pagination)
|
|
11257
11257
|
c = await o({
|
|
@@ -11276,7 +11276,7 @@ const gw = async (t, e) => {
|
|
|
11276
11276
|
ym(u);
|
|
11277
11277
|
return l?.result;
|
|
11278
11278
|
}, _m = async (t, e, r, n, s, i, a) => {
|
|
11279
|
-
const o =
|
|
11279
|
+
const o = Pe();
|
|
11280
11280
|
if (!o)
|
|
11281
11281
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11282
11282
|
const c = e.at(-2), l = Nd(n.collections[c], n, o).map((d) => d.labels.collection);
|
|
@@ -11303,7 +11303,7 @@ const gw = async (t, e) => {
|
|
|
11303
11303
|
});
|
|
11304
11304
|
await Promise.all(f);
|
|
11305
11305
|
}, dc = async (t, e, r, n, s, i) => {
|
|
11306
|
-
if (!
|
|
11306
|
+
if (!Pe())
|
|
11307
11307
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11308
11308
|
const o = e.at(-2);
|
|
11309
11309
|
r.fields ||= n.collections[o].fields.filter((u) => ve(u));
|
|
@@ -11349,14 +11349,14 @@ const gw = async (t, e) => {
|
|
|
11349
11349
|
const r = e?.constraints, n = t.at(-1);
|
|
11350
11350
|
if (!n)
|
|
11351
11351
|
throw new Error("EMPTY_PATH");
|
|
11352
|
-
const s =
|
|
11352
|
+
const s = We(!0), a = Qr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = Ie(), h = Object.keys(s.collections).includes(n), p = d.disabledCollections?.includes(n);
|
|
11353
11353
|
if (!h || p)
|
|
11354
11354
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11355
11355
|
const b = await ft(c.collection), g = await ne(d, [
|
|
11356
11356
|
"global",
|
|
11357
11357
|
"firebase",
|
|
11358
11358
|
"serverTimestampOptions"
|
|
11359
|
-
]), O =
|
|
11359
|
+
]), O = Pe();
|
|
11360
11360
|
if (!O?.Role)
|
|
11361
11361
|
throw new Error("PERMISSIONS_DENIED");
|
|
11362
11362
|
if (f?.includes(O.Role))
|
|
@@ -11445,14 +11445,14 @@ const gw = async (t, e) => {
|
|
|
11445
11445
|
}
|
|
11446
11446
|
return { cursor: x, pages: w, records: Array.from(_.values()) };
|
|
11447
11447
|
}, vw = async (t, e, r) => {
|
|
11448
|
-
const n = it(), s =
|
|
11448
|
+
const n = it(), s = Be(), i = Ue(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Je(i, "stoker-readapi")({
|
|
11449
11449
|
path: t,
|
|
11450
11450
|
id: e,
|
|
11451
11451
|
options: r
|
|
11452
11452
|
})).data.result;
|
|
11453
11453
|
return ym(l), l;
|
|
11454
11454
|
}, wm = async (t, e, r, n, s, i) => {
|
|
11455
|
-
const a =
|
|
11455
|
+
const a = Pe();
|
|
11456
11456
|
if (!a)
|
|
11457
11457
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11458
11458
|
const o = e.at(-2), c = Nd(n.collections[o], n, a).map((f) => f.labels.collection);
|
|
@@ -11478,7 +11478,7 @@ const gw = async (t, e) => {
|
|
|
11478
11478
|
});
|
|
11479
11479
|
await Promise.all(u);
|
|
11480
11480
|
}, bm = async (t, e, r, n, s, i, a) => {
|
|
11481
|
-
if (!
|
|
11481
|
+
if (!Pe())
|
|
11482
11482
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11483
11483
|
const c = e.at(-2);
|
|
11484
11484
|
r.fields ||= n.collections[c].fields.filter((f) => ve(f));
|
|
@@ -11523,14 +11523,14 @@ const gw = async (t, e) => {
|
|
|
11523
11523
|
const n = t.at(-1);
|
|
11524
11524
|
if (!n)
|
|
11525
11525
|
throw new Error("EMPTY_PATH");
|
|
11526
|
-
const s =
|
|
11526
|
+
const s = We(!0), a = Qr()[n], o = Ie(), c = Object.keys(s.collections).includes(n), l = o.disabledCollections?.includes(n);
|
|
11527
11527
|
if (!c || l)
|
|
11528
11528
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11529
11529
|
const u = await ne(o, [
|
|
11530
11530
|
"global",
|
|
11531
11531
|
"firebase",
|
|
11532
11532
|
"serverTimestampOptions"
|
|
11533
|
-
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, b = ft(d.collection), g =
|
|
11533
|
+
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, b = ft(d.collection), g = Pe();
|
|
11534
11534
|
if (!g?.Role)
|
|
11535
11535
|
throw new Error("PERMISSIONS_DENIED");
|
|
11536
11536
|
if (p?.includes(g.Role))
|
|
@@ -11576,7 +11576,7 @@ const gw = async (t, e) => {
|
|
|
11576
11576
|
};
|
|
11577
11577
|
e(t);
|
|
11578
11578
|
}, bw = async (t, e, r, n) => {
|
|
11579
|
-
const s = it(), i =
|
|
11579
|
+
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11580
11580
|
return Om(r), uc(r), (await o({
|
|
11581
11581
|
operation: "update",
|
|
11582
11582
|
path: t,
|
|
@@ -11585,7 +11585,7 @@ const gw = async (t, e) => {
|
|
|
11585
11585
|
user: n
|
|
11586
11586
|
})).data?.result;
|
|
11587
11587
|
}, hc = async (t, e, r, n) => {
|
|
11588
|
-
const s = n?.user, i = Dt(), a =
|
|
11588
|
+
const s = n?.user, i = Dt(), a = We(), o = We(!0), c = _c(), l = Ie(), u = hr(), f = ze(), d = Pe();
|
|
11589
11589
|
if (t.length === 0)
|
|
11590
11590
|
throw new Error("EMPTY_PATH");
|
|
11591
11591
|
const h = t.at(-1), p = Object.keys(a.collections).includes(h), b = l.disabledCollections?.includes(h);
|
|
@@ -11599,9 +11599,9 @@ const gw = async (t, e) => {
|
|
|
11599
11599
|
if (Tm(e))
|
|
11600
11600
|
throw new Error("RECORD_BUSY");
|
|
11601
11601
|
const v = _?.originalRecord || n?.originalRecord || await wr(t, e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11602
|
-
for (const
|
|
11603
|
-
|
|
11604
|
-
const w = Io(f), I = { collection: O.collection }, m = g.fields.filter((
|
|
11602
|
+
for (const V of o.collections[h].fields)
|
|
11603
|
+
V.type === "Computed" && (delete r[V.name], delete v[V.name]);
|
|
11604
|
+
const w = Io(f), I = { collection: O.collection }, m = g.fields.filter((V) => V.saveToAuthToken), T = g.auth && s?.operation === "create", A = g.auth && s?.operation === "delete", L = g.auth && !T && !A && (s?.operation === "update" || r.Role || r.Enabled !== void 0 || r.Name || r.Email || r.Photo_URL || m.some((V) => r[V.name] !== void 0)), k = await ne(E, [
|
|
11605
11605
|
"collections",
|
|
11606
11606
|
O.collection,
|
|
11607
11607
|
"custom",
|
|
@@ -11621,29 +11621,29 @@ const gw = async (t, e) => {
|
|
|
11621
11621
|
if (!await ne(l, ["global", "firebase", "enableEmulators"])) {
|
|
11622
11622
|
M();
|
|
11623
11623
|
try {
|
|
11624
|
-
const { isValid:
|
|
11625
|
-
if (!
|
|
11624
|
+
const { isValid: Te } = await Od(u, s.password);
|
|
11625
|
+
if (!Te)
|
|
11626
11626
|
throw new Error("Please create a stronger password");
|
|
11627
|
-
} catch (
|
|
11628
|
-
throw new Error(`VALIDATION_ERROR: ${
|
|
11627
|
+
} catch (Te) {
|
|
11628
|
+
throw new Error(`VALIDATION_ERROR: ${Te.message}`);
|
|
11629
11629
|
}
|
|
11630
11630
|
}
|
|
11631
11631
|
}
|
|
11632
|
-
const
|
|
11632
|
+
const V = {
|
|
11633
11633
|
operation: "update",
|
|
11634
11634
|
record: { ...v, ...r },
|
|
11635
11635
|
context: I,
|
|
11636
11636
|
batch: w,
|
|
11637
11637
|
originalRecord: Oe(v)
|
|
11638
11638
|
};
|
|
11639
|
-
return await ie("preValidate", l, E,
|
|
11639
|
+
return await ie("preValidate", l, E, V), await bw(t, e, r, s ? { operation: s.operation, permissions: s.permissions, password: s.password } : void 0);
|
|
11640
11640
|
}
|
|
11641
11641
|
delete r.id;
|
|
11642
11642
|
const F = Jo("update", t, r, a, R, Wt(), N.uid, zt.now(), $r(), !!_);
|
|
11643
|
-
for (const
|
|
11644
|
-
!ve(
|
|
11645
|
-
if (xt(F), xt(v), !_ && x &&
|
|
11646
|
-
const
|
|
11643
|
+
for (const V of C)
|
|
11644
|
+
!ve(V) && ar(F[V.name]) && V.nullable && (F[V.name] = null);
|
|
11645
|
+
if (xt(F), xt(v), !_ && x && Ye("update", "started", F, t, e, g, N.uid, void 0, v), !_) {
|
|
11646
|
+
const V = {
|
|
11647
11647
|
operation: "update",
|
|
11648
11648
|
data: F,
|
|
11649
11649
|
recordId: e,
|
|
@@ -11651,8 +11651,8 @@ const gw = async (t, e) => {
|
|
|
11651
11651
|
batch: w,
|
|
11652
11652
|
originalRecord: Oe(v)
|
|
11653
11653
|
};
|
|
11654
|
-
await ie("preOperation", l, E,
|
|
11655
|
-
const
|
|
11654
|
+
await ie("preOperation", l, E, V);
|
|
11655
|
+
const K = {
|
|
11656
11656
|
operation: "update",
|
|
11657
11657
|
data: F,
|
|
11658
11658
|
recordId: e,
|
|
@@ -11660,20 +11660,20 @@ const gw = async (t, e) => {
|
|
|
11660
11660
|
batch: w,
|
|
11661
11661
|
originalRecord: Oe(v)
|
|
11662
11662
|
};
|
|
11663
|
-
await ie("preWrite", l, E,
|
|
11663
|
+
await ie("preWrite", l, E, K);
|
|
11664
11664
|
}
|
|
11665
11665
|
if (nh(g, F, a), sh(g, F), !_)
|
|
11666
11666
|
try {
|
|
11667
|
-
const
|
|
11668
|
-
rr(
|
|
11669
|
-
} catch (
|
|
11670
|
-
throw new Error(`VALIDATION_ERROR: ${
|
|
11667
|
+
const V = { ...v, ...F };
|
|
11668
|
+
rr(V), await fm("update", V, g, E, { operation: "update", record: V, context: I, batch: w, originalRecord: Oe(v) }, a), k && (M(), await fc("update", e, F, g, d));
|
|
11669
|
+
} catch (V) {
|
|
11670
|
+
throw new Error(`VALIDATION_ERROR: ${V.message}`);
|
|
11671
11671
|
}
|
|
11672
|
-
if (Rg(F, v, e, g, a, N.uid, d), xt(F), cc("update", w, t, e, F, a, g, n, c, No, xo, In, (
|
|
11673
|
-
const
|
|
11674
|
-
return rr(
|
|
11672
|
+
if (Rg(F, v, e, g, a, N.uid, d), xt(F), cc("update", w, t, e, F, a, g, n, c, No, xo, In, (V) => Ae(f, "tenants", i, "system_fields", O.collection, `${O.collection}-${V.name}`, e), (V, K) => Ae(f, "tenants", i, "system_unique", O.collection, `Unique-${O.collection}-${V.name}`, K), (V) => Ae(f, "tenants", i, "system_fields", O.collection, `${O.collection}-${V}`, e)), w.update(Ae(f, "tenants", i, t.join("/"), e), F), !_ && x && Ye("update", "written", F, t, e, g, N.uid, void 0, v), await mc("update", t, e, F, I, g, E, w, N.uid, x || !1, d, !!_, v), _?.type === "unique") {
|
|
11673
|
+
const V = { ...v, ...F };
|
|
11674
|
+
return rr(V), { id: e, ...V };
|
|
11675
11675
|
}
|
|
11676
|
-
x &&
|
|
11676
|
+
x && Ye("update", "success", F, t, e, g, N.uid, void 0, v);
|
|
11677
11677
|
const Z = {
|
|
11678
11678
|
operation: "update",
|
|
11679
11679
|
data: F,
|
|
@@ -11686,7 +11686,7 @@ const gw = async (t, e) => {
|
|
|
11686
11686
|
const oe = { ...v, ...F };
|
|
11687
11687
|
return rr(oe), { id: e, ...oe };
|
|
11688
11688
|
}, mc = async (t, e, r, n, s, i, a, o, c, l, u, f, d) => {
|
|
11689
|
-
const h =
|
|
11689
|
+
const h = We(), p = Ie(), { labels: b } = i;
|
|
11690
11690
|
let g = 0;
|
|
11691
11691
|
const O = async () => {
|
|
11692
11692
|
try {
|
|
@@ -11753,7 +11753,7 @@ const gw = async (t, e) => {
|
|
|
11753
11753
|
g++, await O();
|
|
11754
11754
|
return;
|
|
11755
11755
|
} else
|
|
11756
|
-
l &&
|
|
11756
|
+
l && Ye(
|
|
11757
11757
|
t,
|
|
11758
11758
|
"failed",
|
|
11759
11759
|
n,
|
|
@@ -11770,7 +11770,7 @@ const gw = async (t, e) => {
|
|
|
11770
11770
|
};
|
|
11771
11771
|
await O();
|
|
11772
11772
|
}, Ow = async (t, e, r, n) => {
|
|
11773
|
-
const s = it(), i =
|
|
11773
|
+
const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11774
11774
|
return Om(e), (await o({
|
|
11775
11775
|
operation: "create",
|
|
11776
11776
|
path: t,
|
|
@@ -11779,7 +11779,7 @@ const gw = async (t, e) => {
|
|
|
11779
11779
|
id: n
|
|
11780
11780
|
})).data?.result;
|
|
11781
11781
|
}, Em = async (t, e, r) => {
|
|
11782
|
-
const n = r?.user, s = Dt(), i =
|
|
11782
|
+
const n = r?.user, s = Dt(), i = We(), a = _c(), o = Ie(), c = hr(), l = ze(), u = Pe();
|
|
11783
11783
|
if (t.length === 0)
|
|
11784
11784
|
throw new Error("EMPTY_PATH");
|
|
11785
11785
|
const f = t.at(-1), d = Object.keys(i.collections).includes(f), h = o.disabledCollections?.includes(f);
|
|
@@ -11800,7 +11800,7 @@ const gw = async (t, e) => {
|
|
|
11800
11800
|
throw new Error("CLIENT_OFFLINE");
|
|
11801
11801
|
};
|
|
11802
11802
|
N();
|
|
11803
|
-
const v = Io(l), w = E?.docId || r?.id ||
|
|
11803
|
+
const v = Io(l), w = E?.docId || r?.id || Ae(Lr(l, "tenants", s, b.collection)).id, I = { collection: b.collection };
|
|
11804
11804
|
if (C || p.auth && n) {
|
|
11805
11805
|
if (N(), p.auth && n) {
|
|
11806
11806
|
if (!n.password)
|
|
@@ -11829,7 +11829,7 @@ const gw = async (t, e) => {
|
|
|
11829
11829
|
}
|
|
11830
11830
|
e.id = w;
|
|
11831
11831
|
const m = Jo("create", t, e, i, y, Wt(), R.uid, zt.now(), $r(), !!E);
|
|
11832
|
-
if (S && (m[S.archivedField] = !1), xt(m), !E && O &&
|
|
11832
|
+
if (S && (m[S.archivedField] = !1), xt(m), !E && O && Ye("create", "started", m, t, w, p, R.uid), E || (await ie("preOperation", o, x, {
|
|
11833
11833
|
operation: "create",
|
|
11834
11834
|
data: m,
|
|
11835
11835
|
recordId: w,
|
|
@@ -11847,9 +11847,9 @@ const gw = async (t, e) => {
|
|
|
11847
11847
|
} catch (k) {
|
|
11848
11848
|
throw new Error(`VALIDATION_ERROR: ${k.message}`);
|
|
11849
11849
|
}
|
|
11850
|
-
if (r?.onValid && r.onValid(), xt(m), Tg(m, w, p, i, R.uid, u), cc("create", v, t, w, m, i, p, r, a, No, xo, In, (k) =>
|
|
11850
|
+
if (r?.onValid && r.onValid(), xt(m), Tg(m, w, p, i, R.uid, u), cc("create", v, t, w, m, i, p, r, a, No, xo, In, (k) => Ae(l, "tenants", s, "system_fields", b.collection, `${b.collection}-${k.name}`, w), (k, M) => Ae(l, "tenants", s, "system_unique", b.collection, `Unique-${b.collection}-${k.name}`, M), (k) => Ae(l, "tenants", s, "system_fields", b.collection, `${b.collection}-${k}`, w)), v.set(Ae(l, "tenants", s, t.join("/"), w), m), !E && O && Ye("create", "written", m, t, w, p, R.uid), await mc("create", t, w, m, I, p, x, v, R.uid, O || !1, u, !!E), E?.type === "unique")
|
|
11851
11851
|
return { id: w, ...m };
|
|
11852
|
-
O &&
|
|
11852
|
+
O && Ye("create", "success", m, t, w, p, R.uid);
|
|
11853
11853
|
const T = {
|
|
11854
11854
|
operation: "create",
|
|
11855
11855
|
data: m,
|
|
@@ -11859,14 +11859,14 @@ const gw = async (t, e) => {
|
|
|
11859
11859
|
}, A = { ...T };
|
|
11860
11860
|
return await ie("postWrite", o, x, T), await ie("postOperation", o, x, A), { id: w, ...m };
|
|
11861
11861
|
}, Ew = async (t, e) => {
|
|
11862
|
-
const r = it(), n =
|
|
11863
|
-
return (await
|
|
11862
|
+
const r = it(), n = Be(), s = Ue(r, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11863
|
+
return (await Je(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
|
|
11864
11864
|
operation: "delete",
|
|
11865
11865
|
path: t,
|
|
11866
11866
|
id: e
|
|
11867
11867
|
})).data?.result;
|
|
11868
11868
|
}, Sw = async (t, e, r) => {
|
|
11869
|
-
const n = Dt(), s =
|
|
11869
|
+
const n = Dt(), s = We(), i = _c(), a = hr(), o = ze(), c = Ie(), l = Pe();
|
|
11870
11870
|
if (t.length === 0)
|
|
11871
11871
|
throw new Error("EMPTY_PATH");
|
|
11872
11872
|
const u = t.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
|
|
@@ -11897,13 +11897,13 @@ const gw = async (t, e) => {
|
|
|
11897
11897
|
try {
|
|
11898
11898
|
N = await wr(t, e);
|
|
11899
11899
|
} catch (k) {
|
|
11900
|
-
throw g && y?.record && k.message.indexOf("NOT_FOUND") !== -1 && await
|
|
11900
|
+
throw g && y?.record && k.message.indexOf("NOT_FOUND") !== -1 && await Ye("delete", "failed", y?.record, t, e, h, E.uid, k), k;
|
|
11901
11901
|
}
|
|
11902
11902
|
if (S || h.auth && N.User_ID)
|
|
11903
11903
|
return await Ew(t, e);
|
|
11904
11904
|
delete N.id;
|
|
11905
11905
|
const v = Io(o), w = { collection: p.collection }, I = Jo("delete", t, N, s, x, Wt(), E.uid, zt.now(), $r(), !!y);
|
|
11906
|
-
xt(I), !y && g &&
|
|
11906
|
+
xt(I), !y && g && Ye("delete", "started", I, t, e, h, E.uid), y || (await ie("preOperation", c, C, {
|
|
11907
11907
|
operation: "delete",
|
|
11908
11908
|
data: I,
|
|
11909
11909
|
recordId: e,
|
|
@@ -11915,7 +11915,7 @@ const gw = async (t, e) => {
|
|
|
11915
11915
|
recordId: e,
|
|
11916
11916
|
context: w,
|
|
11917
11917
|
batch: v
|
|
11918
|
-
})), xt(I), Cg(I, e, h, s, E.uid, l), cc("delete", v, t, e, I, s, h, r, i, No, xo, In, (k) =>
|
|
11918
|
+
})), xt(I), Cg(I, e, h, s, E.uid, l), cc("delete", v, t, e, I, s, h, r, i, No, xo, In, (k) => Ae(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${k.name}`, e), (k, M) => Ae(o, "tenants", n, "system_unique", p.collection, `Unique-${p.collection}-${k.name}`, M), (k) => Ae(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${k}`, e)), v.delete(Ae(o, "tenants", n, t.join("/"), e)), !y && g && Ye("delete", "written", I, t, e, h, E.uid), await mc("delete", t, e, I, w, h, C, v, E.uid, g || !1, l, !!y), g && Ye("delete", "success", { ...I, ...y?.record || {} }, t, e, h, E.uid);
|
|
11919
11919
|
const T = {
|
|
11920
11920
|
operation: "delete",
|
|
11921
11921
|
data: I,
|
|
@@ -11929,8 +11929,8 @@ const gw = async (t, e) => {
|
|
|
11929
11929
|
for (const e in t)
|
|
11930
11930
|
Object.prototype.hasOwnProperty.call(t, e) && (t[e] === "_DELETE_FIELD" ? t[e] = In() : Sm(t[e]));
|
|
11931
11931
|
}, Tw = async (t, e) => {
|
|
11932
|
-
const r = it(), n =
|
|
11933
|
-
return (await
|
|
11932
|
+
const r = it(), n = Be(), s = Ue(r, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11933
|
+
return (await Je(s, t)(e)).data;
|
|
11934
11934
|
};
|
|
11935
11935
|
let pt = {};
|
|
11936
11936
|
const Rw = async (t, e) => {
|
|
@@ -11955,7 +11955,7 @@ const Rw = async (t, e) => {
|
|
|
11955
11955
|
if (s?.uid !== e.uid)
|
|
11956
11956
|
return;
|
|
11957
11957
|
if (a.force && p !== a.version) {
|
|
11958
|
-
|
|
11958
|
+
Ye(
|
|
11959
11959
|
u,
|
|
11960
11960
|
"failed",
|
|
11961
11961
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -12012,7 +12012,7 @@ const Rw = async (t, e) => {
|
|
|
12012
12012
|
let hn, Ja = 0;
|
|
12013
12013
|
const Aw = async () => {
|
|
12014
12014
|
const t = Nm(), e = Ie();
|
|
12015
|
-
return mr(
|
|
12015
|
+
return mr(Ae(t, "system_deployment", "latest_deploy"), (n) => {
|
|
12016
12016
|
n.exists() ? (hn = n.data(), Ja++, Ja > 1 && (hn.refresh ? window.location.reload() : we(e.onVersionUpdate, [hn, Ja]))) : console.error("Version info not found");
|
|
12017
12017
|
}, (n) => {
|
|
12018
12018
|
console.error("Error getting version info", { cause: n.message });
|
|
@@ -12021,7 +12021,7 @@ const Aw = async () => {
|
|
|
12021
12021
|
let Ao;
|
|
12022
12022
|
const kw = async () => {
|
|
12023
12023
|
const t = Ie(), e = Nm();
|
|
12024
|
-
mr(
|
|
12024
|
+
mr(Ae(e, "system_deployment", "maintenance_mode"), (r) => {
|
|
12025
12025
|
r.exists() ? (Ao = r.data(), we(t.onMaintenanceUpdate, [Ao.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
12026
12026
|
}, (r) => {
|
|
12027
12027
|
console.error("Error getting maintenance status", { cause: r.message });
|
|
@@ -12073,19 +12073,19 @@ let An;
|
|
|
12073
12073
|
const Dw = (t, e) => {
|
|
12074
12074
|
const r = hw(t, e);
|
|
12075
12075
|
An = r === "(default)" ? void 0 : r;
|
|
12076
|
-
}, Pw = () => An,
|
|
12076
|
+
}, Pw = () => An, ze = () => An ? Ac(An) : Ac(), vd = () => {
|
|
12077
12077
|
if (typeof navigator > "u")
|
|
12078
12078
|
return {};
|
|
12079
12079
|
const t = navigator.userAgent;
|
|
12080
12080
|
return /iPad|iPhone|iPod/.test(t) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 ? { experimentalForceLongPolling: !0 } : /Safari/i.test(t) && !/Chrome|Chromium|CriOS|EdgiOS|Edg\/|OPR|FxiOS/i.test(t) ? { experimentalForceLongPolling: !0 } : {};
|
|
12081
12081
|
};
|
|
12082
|
-
let ht, pc, St, Am, ge, km, qr, gc, yc,
|
|
12082
|
+
let ht, pc, St, Am, ge, km, qr, gc, yc, je, Im, kn = [], be;
|
|
12083
12083
|
const Qa = {
|
|
12084
12084
|
firestoreWriteApp: {}
|
|
12085
12085
|
}, mt = {
|
|
12086
12086
|
main: {},
|
|
12087
12087
|
firestoreWrite: {}
|
|
12088
|
-
},
|
|
12088
|
+
}, Ge = {
|
|
12089
12089
|
main: {},
|
|
12090
12090
|
firestoreWrite: {},
|
|
12091
12091
|
maintenance: {}
|
|
@@ -12136,7 +12136,7 @@ const Qa = {
|
|
|
12136
12136
|
},
|
|
12137
12137
|
getVersionInfo: Rm,
|
|
12138
12138
|
getMaintenanceInfo: Iw,
|
|
12139
|
-
getCurrentUserPermissions:
|
|
12139
|
+
getCurrentUserPermissions: Pe,
|
|
12140
12140
|
getLoadingState: Co,
|
|
12141
12141
|
getAppCheck() {
|
|
12142
12142
|
return Ct.main;
|
|
@@ -12147,15 +12147,15 @@ const Qa = {
|
|
|
12147
12147
|
getFirestoreWriteAuth() {
|
|
12148
12148
|
return mt.firestoreWrite;
|
|
12149
12149
|
},
|
|
12150
|
-
getStokerFirestore:
|
|
12150
|
+
getStokerFirestore: ze,
|
|
12151
12151
|
getFirestoreWrite() {
|
|
12152
|
-
return
|
|
12152
|
+
return Ge.firestoreWrite;
|
|
12153
12153
|
},
|
|
12154
12154
|
getFirestoreMaintenance() {
|
|
12155
|
-
return
|
|
12155
|
+
return Ge.maintenance;
|
|
12156
12156
|
}
|
|
12157
12157
|
}, Mw = () => {
|
|
12158
|
-
pc = "", qr = {}, gc = {}, yc = {},
|
|
12158
|
+
pc = "", qr = {}, gc = {}, yc = {}, je = {}, fy(), yw(), Cw();
|
|
12159
12159
|
}, qw = () => kn, Lw = () => {
|
|
12160
12160
|
kn = [];
|
|
12161
12161
|
};
|
|
@@ -12176,7 +12176,7 @@ const eb = async (t, e, r, n) => {
|
|
|
12176
12176
|
for (const w of c)
|
|
12177
12177
|
Qa[`${w}App`] = Gn(s, w);
|
|
12178
12178
|
const { firestoreWriteApp: l } = Qa, u = Gn(s, "maintenance");
|
|
12179
|
-
|
|
12179
|
+
Ge.maintenance = tn(u, vd(), i);
|
|
12180
12180
|
const f = yp();
|
|
12181
12181
|
if (f.settings.minimumFetchIntervalMillis = 36e5, await _p(f), be.STOKER_FB_ENABLE_APP_CHECK === "true" && be.STOKER_FB_APP_CHECK_KEY) {
|
|
12182
12182
|
(St === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
@@ -12263,7 +12263,7 @@ const eb = async (t, e, r, n) => {
|
|
|
12263
12263
|
}
|
|
12264
12264
|
if (!_?.includes("Firestore")) {
|
|
12265
12265
|
const w = be.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(be.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12266
|
-
kc(
|
|
12266
|
+
kc(Ge.maintenance, "localhost", w);
|
|
12267
12267
|
}
|
|
12268
12268
|
if (!_?.includes("Storage")) {
|
|
12269
12269
|
const w = be.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(be.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
@@ -12271,7 +12271,7 @@ const eb = async (t, e, r, n) => {
|
|
|
12271
12271
|
}
|
|
12272
12272
|
if (!_?.includes("Functions")) {
|
|
12273
12273
|
const w = be.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(be.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12274
|
-
mp(
|
|
12274
|
+
mp(Ue(ht, be.STOKER_FB_FUNCTIONS_REGION), "localhost", w);
|
|
12275
12275
|
}
|
|
12276
12276
|
}
|
|
12277
12277
|
if (Aw(), kw(), xw(), St === "development" && (O ? Xr(O) : Xr("debug")), St === "production" && (S ? Xr(S) : Xr("error")), g) {
|
|
@@ -12295,28 +12295,28 @@ const eb = async (t, e, r, n) => {
|
|
|
12295
12295
|
return Hn(R, async (w) => {
|
|
12296
12296
|
const I = ++bd, m = () => I !== bd;
|
|
12297
12297
|
if (w) {
|
|
12298
|
-
|
|
12299
|
-
const T = await zm(
|
|
12298
|
+
je = w;
|
|
12299
|
+
const T = await zm(je);
|
|
12300
12300
|
if (m())
|
|
12301
12301
|
return;
|
|
12302
12302
|
const { claims: A } = T;
|
|
12303
12303
|
pc = A.tenant, Im = {
|
|
12304
|
-
|
|
12304
|
+
...je,
|
|
12305
12305
|
token: {
|
|
12306
12306
|
claims: A
|
|
12307
12307
|
}
|
|
12308
12308
|
};
|
|
12309
12309
|
const L = [];
|
|
12310
12310
|
for (const q of Object.values(mt))
|
|
12311
|
-
L.push(new Promise((
|
|
12312
|
-
const
|
|
12313
|
-
H && (
|
|
12311
|
+
L.push(new Promise((Y) => {
|
|
12312
|
+
const U = Hn(q, async (H) => {
|
|
12313
|
+
H && (U(), Y({}));
|
|
12314
12314
|
});
|
|
12315
12315
|
}));
|
|
12316
12316
|
if (await Promise.all(L), m())
|
|
12317
12317
|
return;
|
|
12318
|
-
wd || (Fw(ge), wd = !0), v = await ne(ge, ["global", "auth", "offlinePersistenceType"], [
|
|
12319
|
-
const k = await ne(ge, ["global", "auth", "tabManager"], [
|
|
12318
|
+
wd || (Fw(ge), wd = !0), v = await ne(ge, ["global", "auth", "offlinePersistenceType"], [je, A]);
|
|
12319
|
+
const k = await ne(ge, ["global", "auth", "tabManager"], [je, A]), M = await ne(ge, ["global", "auth", "garbageCollectionStrategy"], [je, A]), F = await ne(ge, ["global", "auth", "maxCacheSize"], [je, A]) || -1, Z = await ne(ge, ["global", "auth", "maxWriteCacheSize"], [je, A]);
|
|
12320
12320
|
if (m())
|
|
12321
12321
|
return;
|
|
12322
12322
|
let re;
|
|
@@ -12325,51 +12325,51 @@ const eb = async (t, e, r, n) => {
|
|
|
12325
12325
|
tabManager: k === "SINGLE" ? xc({ forceOwnership: !1 }) : Nc(),
|
|
12326
12326
|
cacheSizeBytes: F
|
|
12327
12327
|
})
|
|
12328
|
-
},
|
|
12328
|
+
}, z = {
|
|
12329
12329
|
localCache: Ic({
|
|
12330
12330
|
tabManager: k === "SINGLE" ? xc({ forceOwnership: !1 }) : Nc(),
|
|
12331
12331
|
cacheSizeBytes: Z || F
|
|
12332
12332
|
})
|
|
12333
12333
|
};
|
|
12334
|
-
let
|
|
12335
|
-
M === "EAGER" ?
|
|
12334
|
+
let V;
|
|
12335
|
+
M === "EAGER" ? V = np() : V = sp({ cacheSizeBytes: F }), v === "ALL" ? re = oe : re = {
|
|
12336
12336
|
localCache: ip({
|
|
12337
|
-
garbageCollector:
|
|
12337
|
+
garbageCollector: V
|
|
12338
12338
|
})
|
|
12339
12339
|
};
|
|
12340
|
-
const
|
|
12341
|
-
if (
|
|
12340
|
+
const K = vd();
|
|
12341
|
+
if (Ge.main = tn(ht, {
|
|
12342
12342
|
...re,
|
|
12343
|
-
...
|
|
12344
|
-
}, i), ["ALL", "WRITE"].includes(v) ?
|
|
12345
|
-
...
|
|
12346
|
-
...
|
|
12347
|
-
}, i) :
|
|
12343
|
+
...K
|
|
12344
|
+
}, i), ["ALL", "WRITE"].includes(v) ? Ge.firestoreWrite = tn(l, {
|
|
12345
|
+
...z,
|
|
12346
|
+
...K
|
|
12347
|
+
}, i) : Ge.firestoreWrite = tn(l, {
|
|
12348
12348
|
...re,
|
|
12349
|
-
...
|
|
12349
|
+
...K
|
|
12350
12350
|
}, i), St === "development" && b && !_?.includes("Firestore")) {
|
|
12351
12351
|
const q = be.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(be.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12352
|
-
for (const [
|
|
12353
|
-
|
|
12352
|
+
for (const [Y, U] of Object.entries(Ge))
|
|
12353
|
+
Y !== "maintenance" && kc(U, "localhost", q);
|
|
12354
12354
|
}
|
|
12355
12355
|
if (v === "ALL") {
|
|
12356
|
-
const q = ap(
|
|
12356
|
+
const q = ap(Ge.main);
|
|
12357
12357
|
q && op(q);
|
|
12358
12358
|
}
|
|
12359
|
-
const
|
|
12359
|
+
const Te = await Je(Ue(ht, be.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((q) => {
|
|
12360
12360
|
throw new Error("Error fetching schema.", { cause: q });
|
|
12361
12361
|
});
|
|
12362
12362
|
if (m())
|
|
12363
12363
|
return;
|
|
12364
|
-
qr =
|
|
12365
|
-
const Xe = Object.entries(
|
|
12366
|
-
gc = Object.fromEntries(Xe), yc =
|
|
12367
|
-
const bt = await gw(
|
|
12368
|
-
if (m() || (kn.push(...bt), v === "WRITE" && Rw(qr,
|
|
12364
|
+
qr = Te.data.schema;
|
|
12365
|
+
const Xe = Object.entries(Te.data.allRoleGroups).map(([q, Y]) => [q, new Set(Y)]);
|
|
12366
|
+
gc = Object.fromEntries(Xe), yc = Te.data.currentUserRoleGroups, km = Ag(Object.keys(qr.collections), e, "web", ko, n);
|
|
12367
|
+
const bt = await gw(je, T);
|
|
12368
|
+
if (m() || (kn.push(...bt), v === "WRITE" && Rw(qr, je), await we(ge.postLogin, [je]), m()))
|
|
12369
12369
|
return;
|
|
12370
12370
|
const br = new Event("stoker:ready");
|
|
12371
12371
|
document.dispatchEvent(br);
|
|
12372
|
-
} else if (
|
|
12372
|
+
} else if (je) {
|
|
12373
12373
|
Mw(), qw().forEach((M) => {
|
|
12374
12374
|
M();
|
|
12375
12375
|
}), Lw();
|
|
@@ -12384,7 +12384,7 @@ const eb = async (t, e, r, n) => {
|
|
|
12384
12384
|
error: F
|
|
12385
12385
|
}), console.error(`Error signing out of ${M.app.name}.`);
|
|
12386
12386
|
});
|
|
12387
|
-
})), await Promise.all(Object.entries(
|
|
12387
|
+
})), await Promise.all(Object.entries(Ge).map(async ([M, F]) => {
|
|
12388
12388
|
M !== "maintenance" && Object.keys(F).length !== 0 && await cp(F).catch((Z) => {
|
|
12389
12389
|
console.error(`Error terminating ${F.app.name}.`), L.error = !0, L.instances.push({
|
|
12390
12390
|
instance: F.app.name,
|
|
@@ -12396,14 +12396,14 @@ const eb = async (t, e, r, n) => {
|
|
|
12396
12396
|
"global",
|
|
12397
12397
|
"auth",
|
|
12398
12398
|
"clearPersistenceOnSignOut"
|
|
12399
|
-
]) ?? !0) && (v === "ALL" && await Fc(
|
|
12399
|
+
]) ?? !0) && (v === "ALL" && await Fc(Ge.main).catch((M) => {
|
|
12400
12400
|
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), L.error = !0, L.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: M });
|
|
12401
|
-
}), ["ALL", "WRITE"].includes(v) && await Fc(
|
|
12401
|
+
}), ["ALL", "WRITE"].includes(v) && await Fc(Ge.firestoreWrite).catch((M) => {
|
|
12402
12402
|
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), L.error = !0, L.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: M });
|
|
12403
12403
|
})), L.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await we(ge.postLogout, [L]);
|
|
12404
12404
|
}
|
|
12405
12405
|
}), N ? !1 : R.currentUser ? (g && console.info(`${R.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12406
|
-
}, { getTenant: Dt, getEnv:
|
|
12406
|
+
}, { getTenant: Dt, getEnv: Be, getTimezone: xm, getSchema: We, getCurrentUser: tb, getCurrentUserRoleGroups: Qr, getAllRoleGroups: _c, getGlobalConfigModule: Ie, getCollectionConfigModule: ft, getAppCheck: rb, getAppCheckFirestoreWrite: nb, getFirestoreWriteAuth: $w, getFirestoreWrite: vc, getFirestoreMaintenance: Nm } = ko, sb = async (t, e, r) => {
|
|
12407
12407
|
const [n, s] = [hr(), $w()], i = Ie();
|
|
12408
12408
|
if (!t || !e)
|
|
12409
12409
|
throw new Error("Email and password are required.");
|
|
@@ -12426,7 +12426,7 @@ const eb = async (t, e, r, n) => {
|
|
|
12426
12426
|
throw c;
|
|
12427
12427
|
}
|
|
12428
12428
|
if (!s.currentUser) {
|
|
12429
|
-
const c = it(), l =
|
|
12429
|
+
const c = it(), l = Be(), u = Ue(c, l.STOKER_FB_FUNCTIONS_REGION), f = Je(u, "stoker-customtoken");
|
|
12430
12430
|
try {
|
|
12431
12431
|
const h = (await f()).data.customToken;
|
|
12432
12432
|
if (!h)
|
|
@@ -12470,15 +12470,15 @@ const eb = async (t, e, r, n) => {
|
|
|
12470
12470
|
} else
|
|
12471
12471
|
throw new Error("User must have an email address to enroll in multi-factor authentication.");
|
|
12472
12472
|
}, lb = async (t, e, r) => {
|
|
12473
|
-
const n = it(), s =
|
|
12474
|
-
await
|
|
12473
|
+
const n = it(), s = Be(), i = Ue(n, s.STOKER_FB_FUNCTIONS_REGION);
|
|
12474
|
+
await Je(i, "stoker-deletefolder")({
|
|
12475
12475
|
path: t || "",
|
|
12476
12476
|
id: e.id,
|
|
12477
12477
|
collectionPath: e.Collection_Path,
|
|
12478
12478
|
folderName: r
|
|
12479
12479
|
});
|
|
12480
12480
|
}, ub = async () => {
|
|
12481
|
-
const t = [
|
|
12481
|
+
const t = [ze(), vc()];
|
|
12482
12482
|
for (const e of Object.values(t))
|
|
12483
12483
|
await lp(e).catch((r) => {
|
|
12484
12484
|
throw new Error(`Error waiting for pending writes in ${e.app.name}.`, { cause: r });
|
|
@@ -12487,10 +12487,10 @@ const eb = async (t, e, r, n) => {
|
|
|
12487
12487
|
const i = t.at(-1);
|
|
12488
12488
|
if (!i)
|
|
12489
12489
|
throw new Error("EMPTY_PATH");
|
|
12490
|
-
const a =
|
|
12490
|
+
const a = Pe();
|
|
12491
12491
|
if (!a?.Role)
|
|
12492
12492
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
12493
|
-
const o =
|
|
12493
|
+
const o = We(!0), l = Qr()[i], u = ze(), f = o.collections[i];
|
|
12494
12494
|
if (!f)
|
|
12495
12495
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12496
12496
|
const { labels: d, preloadCache: h } = f, p = Ie(), b = Object.keys(o.collections).includes(i), g = p.disabledCollections?.includes(i);
|
|
@@ -12540,47 +12540,47 @@ const eb = async (t, e, r, n) => {
|
|
|
12540
12540
|
return;
|
|
12541
12541
|
}
|
|
12542
12542
|
const F = Oe(s.relations), Z = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), oe = A(F);
|
|
12543
|
-
for (const
|
|
12544
|
-
for (const
|
|
12545
|
-
|
|
12546
|
-
!v[
|
|
12547
|
-
for (const
|
|
12548
|
-
if ("collection" in
|
|
12549
|
-
const
|
|
12550
|
-
if (!
|
|
12543
|
+
for (const z of oe)
|
|
12544
|
+
for (const V of T.values())
|
|
12545
|
+
V.type === z.type && V.field === z.name && // eslint-disable-next-line security/detect-object-injection
|
|
12546
|
+
!v[z.name][V.id] && (V.listener(), m.delete(`${z.name}_${V.id}`));
|
|
12547
|
+
for (const z of oe)
|
|
12548
|
+
if ("collection" in z) {
|
|
12549
|
+
const V = v[z.name];
|
|
12550
|
+
if (!V)
|
|
12551
12551
|
continue;
|
|
12552
|
-
for (const
|
|
12553
|
-
|
|
12552
|
+
for (const K of Object.keys(V))
|
|
12553
|
+
V?.[K].id || (Z.set(`${z.name}_${K}`, !1), m.has(`${z.name}_${K}`) ? re.set(`${z.name}_${K}`, !0) : m.set(`${z.name}_${K}`, !0));
|
|
12554
12554
|
}
|
|
12555
12555
|
if (Z.size === 0)
|
|
12556
12556
|
M({});
|
|
12557
12557
|
else
|
|
12558
|
-
for (const
|
|
12559
|
-
if ("collection" in
|
|
12560
|
-
const
|
|
12561
|
-
if (!
|
|
12558
|
+
for (const z of oe)
|
|
12559
|
+
if ("collection" in z) {
|
|
12560
|
+
const V = v[z.name];
|
|
12561
|
+
if (!V)
|
|
12562
12562
|
continue;
|
|
12563
|
-
for (const [
|
|
12564
|
-
if (re.has(`${
|
|
12565
|
-
const
|
|
12566
|
-
|
|
12563
|
+
for (const [K, xe] of Object.entries(V))
|
|
12564
|
+
if (re.has(`${z.name}_${K}`)) {
|
|
12565
|
+
const Te = async () => {
|
|
12566
|
+
V[K].id ? (Z.set(`${z.name}_${K}`, !0), Array.from(Z.values()).every((Xe) => Xe) && (M({}), I())) : setTimeout(Te, 100);
|
|
12567
12567
|
};
|
|
12568
|
-
|
|
12568
|
+
Te();
|
|
12569
12569
|
} else {
|
|
12570
|
-
const
|
|
12571
|
-
bt?.includes(a.Role) ? wr([...
|
|
12570
|
+
const Te = o.collections[z.collection], { access: Xe } = Te, { serverReadOnly: bt } = Xe;
|
|
12571
|
+
bt?.includes(a.Role) ? wr([...xe.Collection_Path], K, {
|
|
12572
12572
|
noComputedFields: s?.noComputedFields,
|
|
12573
12573
|
noEmbeddingFields: s?.noEmbeddingFields
|
|
12574
12574
|
}).then((q) => {
|
|
12575
12575
|
if (!q) {
|
|
12576
|
-
delete
|
|
12576
|
+
delete V[K];
|
|
12577
12577
|
return;
|
|
12578
12578
|
}
|
|
12579
|
-
if (!
|
|
12580
|
-
Z.set(`${
|
|
12579
|
+
if (!V?.[K]) {
|
|
12580
|
+
Z.set(`${z.name}_${K}`, !0), m.delete(`${z.name}_${K}`);
|
|
12581
12581
|
return;
|
|
12582
12582
|
}
|
|
12583
|
-
|
|
12583
|
+
V[K] = q, Z.set(`${z.name}_${K}`, !0), Array.from(Z.values()).every((Y) => Y) && (M({}), I(), k.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12584
12584
|
operation: "read",
|
|
12585
12585
|
data: v,
|
|
12586
12586
|
recordId: e,
|
|
@@ -12592,22 +12592,22 @@ const eb = async (t, e, r, n) => {
|
|
|
12592
12592
|
listener: !0
|
|
12593
12593
|
})));
|
|
12594
12594
|
}).catch((q) => {
|
|
12595
|
-
delete
|
|
12595
|
+
delete V[K], q.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${z.collection} with ID ${e} at location ${xe.Collection_Path?.join("/")}`, {
|
|
12596
12596
|
cause: q
|
|
12597
12597
|
}));
|
|
12598
12598
|
}) : Fm(
|
|
12599
|
-
[...
|
|
12600
|
-
|
|
12599
|
+
[...xe.Collection_Path],
|
|
12600
|
+
K,
|
|
12601
12601
|
(q) => {
|
|
12602
12602
|
if (!q) {
|
|
12603
|
-
delete
|
|
12603
|
+
delete V[K];
|
|
12604
12604
|
return;
|
|
12605
12605
|
}
|
|
12606
|
-
if (!
|
|
12607
|
-
T.get(`${
|
|
12606
|
+
if (!V?.[K]) {
|
|
12607
|
+
T.get(`${z.name}_${K}`) && T.get(`${z.name}_${K}`).listener(), Z.set(`${z.name}_${K}`, !0), m.delete(`${z.name}_${K}`);
|
|
12608
12608
|
return;
|
|
12609
12609
|
}
|
|
12610
|
-
|
|
12610
|
+
V[K] = q, Z.set(`${z.name}_${K}`, !0), Array.from(Z.values()).every((Y) => Y) && (M({}), I(), k.fromCache === !1 && (ie("postOperation", p, O, {
|
|
12611
12611
|
operation: "read",
|
|
12612
12612
|
data: v,
|
|
12613
12613
|
recordId: e,
|
|
@@ -12621,20 +12621,20 @@ const eb = async (t, e, r, n) => {
|
|
|
12621
12621
|
},
|
|
12622
12622
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12623
12623
|
(q) => {
|
|
12624
|
-
delete
|
|
12624
|
+
delete V[K], q.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${z.collection} with ID ${e} at location ${xe.Collection_Path?.join("/")}`, {
|
|
12625
12625
|
cause: q
|
|
12626
12626
|
}));
|
|
12627
12627
|
},
|
|
12628
12628
|
{ ...s, relations: !1 }
|
|
12629
12629
|
).then((q) => {
|
|
12630
|
-
if (!
|
|
12631
|
-
q(), m.delete(`${
|
|
12630
|
+
if (!V?.[K]) {
|
|
12631
|
+
q(), m.delete(`${z.name}_${K}`);
|
|
12632
12632
|
return;
|
|
12633
12633
|
}
|
|
12634
|
-
N.push(q), T.set(`${
|
|
12635
|
-
id:
|
|
12636
|
-
type:
|
|
12637
|
-
field:
|
|
12634
|
+
N.push(q), T.set(`${z.name}_${K}`, {
|
|
12635
|
+
id: K,
|
|
12636
|
+
type: z.type,
|
|
12637
|
+
field: z.name,
|
|
12638
12638
|
listener: q
|
|
12639
12639
|
});
|
|
12640
12640
|
});
|
|
@@ -12647,8 +12647,15 @@ const eb = async (t, e, r, n) => {
|
|
|
12647
12647
|
const Z = F.data({ serverTimestamps: S || "none" });
|
|
12648
12648
|
if (_.has(k.path) && s?.relations) {
|
|
12649
12649
|
const oe = A(s?.relations);
|
|
12650
|
-
for (const
|
|
12651
|
-
"collection" in
|
|
12650
|
+
for (const z of oe)
|
|
12651
|
+
if ("collection" in z && Z[z.name]) {
|
|
12652
|
+
const V = v?.[z.name] || {}, K = Z[z.name];
|
|
12653
|
+
for (const xe of Object.keys(V))
|
|
12654
|
+
xe in K || delete V[xe];
|
|
12655
|
+
for (const [xe, Te] of Object.entries(K))
|
|
12656
|
+
V[xe]?.id || (V[xe] = Te);
|
|
12657
|
+
Z[z.name] = V;
|
|
12658
|
+
}
|
|
12652
12659
|
}
|
|
12653
12660
|
_.set(k.path, !0), v ||= {}, v.id ||= F.id, v = { ...v, ...Z }, delete v.Collection_Path_String;
|
|
12654
12661
|
const re = w.get(k) || /* @__PURE__ */ new Set();
|
|
@@ -12698,10 +12705,10 @@ const eb = async (t, e, r, n) => {
|
|
|
12698
12705
|
const s = n?.constraints, i = t.at(-1);
|
|
12699
12706
|
if (!i)
|
|
12700
12707
|
throw new Error("EMPTY_PATH");
|
|
12701
|
-
const a =
|
|
12708
|
+
const a = Pe();
|
|
12702
12709
|
if (!a?.Role)
|
|
12703
12710
|
throw new Error("PERMISSION_DENIED");
|
|
12704
|
-
const o =
|
|
12711
|
+
const o = We(!0), l = Qr()[i], u = ze(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: b } = p, g = Ie(), O = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
|
|
12705
12712
|
if (!O || S)
|
|
12706
12713
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12707
12714
|
const C = ft(d.collection), x = await ne(g, [
|
|
@@ -12726,47 +12733,47 @@ const eb = async (t, e, r, n) => {
|
|
|
12726
12733
|
if (n?.pagination) {
|
|
12727
12734
|
if (n.pagination.startAfter && n.pagination.endBefore || n.pagination.startAfter && n.pagination.endAt || n.pagination.startAfter && n.pagination.startAt || n.pagination.startAt && n.pagination.endBefore || n.pagination.startAt && n.pagination.endAt || n.pagination.endBefore && n.pagination.endAt)
|
|
12728
12735
|
throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
|
|
12729
|
-
const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt,
|
|
12730
|
-
if (q &&
|
|
12731
|
-
throw new Error("INPUT_ERROR: Pagination is not allowed when using " +
|
|
12732
|
-
n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt ? n.pagination.startAfter ? (eo(n.pagination.startAfter), R = R.map((
|
|
12736
|
+
const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt, Y = Bd(a.Role, f, o);
|
|
12737
|
+
if (q && Y !== !0)
|
|
12738
|
+
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + Y);
|
|
12739
|
+
n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt ? n.pagination.startAfter ? (eo(n.pagination.startAfter), R = R.map((U, H) => {
|
|
12733
12740
|
if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
|
|
12734
12741
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAfter");
|
|
12735
|
-
let D = he(
|
|
12742
|
+
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), ro(N.last.get(H)));
|
|
12736
12743
|
return n.pagination.number && (D = he(D, er(n.pagination.number))), D;
|
|
12737
|
-
})) : n.pagination.endBefore ? (Xa(n.pagination.endBefore), R = R.map((
|
|
12744
|
+
})) : n.pagination.endBefore ? (Xa(n.pagination.endBefore), R = R.map((U, H) => {
|
|
12738
12745
|
if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
|
|
12739
12746
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endBefore");
|
|
12740
|
-
let D = he(
|
|
12747
|
+
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), no(N.first.get(H)));
|
|
12741
12748
|
return n.pagination.number && (D = he(D, Dr(n.pagination.number))), D;
|
|
12742
|
-
})) : n.pagination.startAt ? (Xa(n.pagination.startAt), R = R.map((
|
|
12749
|
+
})) : n.pagination.startAt ? (Xa(n.pagination.startAt), R = R.map((U, H) => {
|
|
12743
12750
|
if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
|
|
12744
12751
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
|
|
12745
|
-
let D = he(
|
|
12752
|
+
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), up(N.first.get(H)));
|
|
12746
12753
|
return n.pagination.number && (D = he(D, Dr(n.pagination.number))), D;
|
|
12747
|
-
})) : n.pagination.endAt && (eo(n.pagination.endAt), R = R.map((
|
|
12754
|
+
})) : n.pagination.endAt && (eo(n.pagination.endAt), R = R.map((U, H) => {
|
|
12748
12755
|
if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
|
|
12749
12756
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12750
|
-
let D = he(
|
|
12757
|
+
let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), fp(N.last.get(H)));
|
|
12751
12758
|
return n.pagination.number && (D = he(D, Dr(n.pagination.number))), D;
|
|
12752
|
-
})) : R = R.map((
|
|
12753
|
-
let H = he(
|
|
12754
|
-
return n.pagination?.orderByField && n.pagination.orderByDirection && (H = he(
|
|
12759
|
+
})) : R = R.map((U) => {
|
|
12760
|
+
let H = he(U);
|
|
12761
|
+
return n.pagination?.orderByField && n.pagination.orderByDirection && (H = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection))), n.pagination.number && (H = he(H, er(n.pagination.number))), H;
|
|
12755
12762
|
});
|
|
12756
12763
|
}
|
|
12757
12764
|
const v = { collection: d.collection };
|
|
12758
12765
|
await ie("preOperation", g, C, { operation: "read", context: v }), await ie("preRead", g, C, { context: v, refs: R, multiple: !0, listener: !0 });
|
|
12759
12766
|
let m = !0;
|
|
12760
|
-
const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), L = [], k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Z = (q,
|
|
12767
|
+
const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), L = [], k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Z = (q, Y, U) => {
|
|
12761
12768
|
const H = [];
|
|
12762
12769
|
k.forEach((D) => {
|
|
12763
12770
|
mm(D, M.get(D.id));
|
|
12764
12771
|
for (const ue of f.fields)
|
|
12765
|
-
ue.type === "Computed" && !n?.noComputedFields && H.push(we(ue.formula, [D,
|
|
12772
|
+
ue.type === "Computed" && !n?.noComputedFields && H.push(we(ue.formula, [D, U]).then((X) => {
|
|
12766
12773
|
D[ue.name] = X;
|
|
12767
12774
|
})), n?.noEmbeddingFields && ue.type === "Embedding" && delete D[ue.name];
|
|
12768
12775
|
}), Promise.all(H).then(() => {
|
|
12769
|
-
e(Array.from(k.values()), q,
|
|
12776
|
+
e(Array.from(k.values()), q, Y), (Te || Y?.fromCache === !1) && k.forEach((D) => {
|
|
12770
12777
|
const ue = {
|
|
12771
12778
|
operation: "read",
|
|
12772
12779
|
data: D,
|
|
@@ -12776,41 +12783,41 @@ const eb = async (t, e, r, n) => {
|
|
|
12776
12783
|
ie("postOperation", g, C, ue), ie("postRead", g, C, { context: v, refs: E, record: D, listener: !0 });
|
|
12777
12784
|
});
|
|
12778
12785
|
});
|
|
12779
|
-
}, re = (q,
|
|
12780
|
-
let
|
|
12786
|
+
}, re = (q, Y) => {
|
|
12787
|
+
let U = !0;
|
|
12781
12788
|
if (n?.relations && k.forEach((H) => {
|
|
12782
12789
|
const D = A.get(H.id);
|
|
12783
|
-
D === "loaded" || D === "deleted" || (
|
|
12784
|
-
}), T.size === _.length &&
|
|
12790
|
+
D === "loaded" || D === "deleted" || (U = !1);
|
|
12791
|
+
}), T.size === _.length && U) {
|
|
12785
12792
|
m = !1;
|
|
12786
12793
|
const H = Ad(u, () => {
|
|
12787
12794
|
H(), !n?.noComputedFields && C?.admin?.retriever ? we(C.admin.retriever).then((D) => {
|
|
12788
|
-
Z(q,
|
|
12789
|
-
}) : Z(q,
|
|
12795
|
+
Z(q, Y, D);
|
|
12796
|
+
}) : Z(q, Y);
|
|
12790
12797
|
});
|
|
12791
12798
|
}
|
|
12792
12799
|
};
|
|
12793
12800
|
typeof n?.relations == "object" && (n.relations.fields = n.relations.fields.map((q) => {
|
|
12794
12801
|
if (typeof q == "string") {
|
|
12795
|
-
const
|
|
12796
|
-
if (
|
|
12797
|
-
return
|
|
12802
|
+
const Y = f.fields.find((U) => U.name === q);
|
|
12803
|
+
if (Y)
|
|
12804
|
+
return Y;
|
|
12798
12805
|
throw new Error(`SCHEMA_ERROR: Field ${q} not found in collection ${i}`);
|
|
12799
12806
|
}
|
|
12800
12807
|
return q;
|
|
12801
12808
|
}));
|
|
12802
|
-
const oe = {},
|
|
12809
|
+
const oe = {}, z = {}, V = (q, Y) => {
|
|
12803
12810
|
if (!q)
|
|
12804
12811
|
return;
|
|
12805
|
-
const
|
|
12806
|
-
A.set(
|
|
12812
|
+
const U = q.id;
|
|
12813
|
+
A.set(U, "loading"), z[U] ||= /* @__PURE__ */ new Map();
|
|
12807
12814
|
const H = Oe(n?.relations), D = typeof H == "object" ? H.fields.filter((pe) => typeof pe == "object" && ve(pe) && $t(f, o, a).includes(pe.collection)) : f.fields.filter((pe) => ve(pe) && $t(f, o, a).includes(pe.collection)), ue = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
12808
|
-
oe[
|
|
12815
|
+
oe[U] ||= /* @__PURE__ */ new Map();
|
|
12809
12816
|
for (const pe of D)
|
|
12810
|
-
for (const _e of
|
|
12811
|
-
const [ae,
|
|
12812
|
-
|
|
12813
|
-
!q[pe.name][ae]) && (
|
|
12817
|
+
for (const _e of z[U].entries()) {
|
|
12818
|
+
const [ae, Le] = _e;
|
|
12819
|
+
Le.doc === U && Le.type === pe.type && Le.field === pe.name && (!k.has(U) || // eslint-disable-next-line security/detect-object-injection
|
|
12820
|
+
!q[pe.name][ae]) && (Le.listener(), oe[U].delete(ae));
|
|
12814
12821
|
}
|
|
12815
12822
|
for (const pe of D)
|
|
12816
12823
|
if ("collection" in pe) {
|
|
@@ -12818,138 +12825,138 @@ const eb = async (t, e, r, n) => {
|
|
|
12818
12825
|
if (!_e)
|
|
12819
12826
|
continue;
|
|
12820
12827
|
for (const ae of Object.keys(_e))
|
|
12821
|
-
!_e?.[ae].id && !oe[
|
|
12828
|
+
!_e?.[ae].id && !oe[U].has(ae) && (ue.set(ae, !1), oe[U].has(ae) ? X.set(ae, !0) : oe[U].set(ae, !0));
|
|
12822
12829
|
}
|
|
12823
12830
|
if (ue.size === 0)
|
|
12824
|
-
A.set(
|
|
12831
|
+
A.set(U, "loaded"), re(Y);
|
|
12825
12832
|
else
|
|
12826
12833
|
for (const pe of D)
|
|
12827
12834
|
if ("collection" in pe) {
|
|
12828
12835
|
const _e = q[pe.name];
|
|
12829
12836
|
if (!_e)
|
|
12830
12837
|
continue;
|
|
12831
|
-
for (const [ae,
|
|
12838
|
+
for (const [ae, Le] of Object.entries(_e))
|
|
12832
12839
|
if (X.has(ae)) {
|
|
12833
|
-
const
|
|
12834
|
-
_e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(
|
|
12840
|
+
const $e = async () => {
|
|
12841
|
+
_e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(U, "loaded")) : setTimeout($e, 100);
|
|
12835
12842
|
};
|
|
12836
|
-
|
|
12843
|
+
$e();
|
|
12837
12844
|
} else {
|
|
12838
|
-
const
|
|
12839
|
-
Gt?.includes(a.Role) ? wr([...
|
|
12840
|
-
if (!
|
|
12845
|
+
const $e = o.collections[pe.collection], { access: ke } = $e, { serverReadOnly: Gt } = ke;
|
|
12846
|
+
Gt?.includes(a.Role) ? wr([...Le.Collection_Path], ae).then((Ne) => {
|
|
12847
|
+
if (!Ne) {
|
|
12841
12848
|
delete _e[ae];
|
|
12842
12849
|
return;
|
|
12843
12850
|
}
|
|
12844
|
-
if (!k.has(
|
|
12845
|
-
ue.set(ae, !0), oe[
|
|
12851
|
+
if (!k.has(U) || !_e?.[ae]) {
|
|
12852
|
+
ue.set(ae, !0), oe[U].delete(ae);
|
|
12846
12853
|
return;
|
|
12847
12854
|
}
|
|
12848
|
-
_e[ae] =
|
|
12849
|
-
}).catch((
|
|
12850
|
-
delete _e[ae],
|
|
12851
|
-
cause:
|
|
12855
|
+
_e[ae] = Ne, ue.set(ae, !0), Array.from(ue.values()).every((Ht) => Ht) && (A.set(U, "loaded"), re(Y));
|
|
12856
|
+
}).catch((Ne) => {
|
|
12857
|
+
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${Le.Collection_Path?.join("/")}`, {
|
|
12858
|
+
cause: Ne
|
|
12852
12859
|
}));
|
|
12853
12860
|
}) : Fm(
|
|
12854
|
-
[...
|
|
12861
|
+
[...Le.Collection_Path],
|
|
12855
12862
|
ae,
|
|
12856
|
-
(
|
|
12857
|
-
if (!
|
|
12863
|
+
(Ne) => {
|
|
12864
|
+
if (!Ne) {
|
|
12858
12865
|
delete _e[ae];
|
|
12859
12866
|
return;
|
|
12860
12867
|
}
|
|
12861
|
-
if (!k.has(
|
|
12862
|
-
|
|
12868
|
+
if (!k.has(U) || !_e?.[ae]) {
|
|
12869
|
+
z[U].has(ae) && z[U].get(ae)?.listener(), ue.set(ae, !0), oe[U].delete(ae);
|
|
12863
12870
|
return;
|
|
12864
12871
|
}
|
|
12865
|
-
_e[ae] =
|
|
12872
|
+
_e[ae] = Ne, ue.set(ae, !0), Array.from(ue.values()).every((Ht) => Ht) && (A.set(U, "loaded"), re(Y));
|
|
12866
12873
|
},
|
|
12867
12874
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12868
|
-
(
|
|
12869
|
-
delete _e[ae],
|
|
12870
|
-
cause:
|
|
12875
|
+
(Ne) => {
|
|
12876
|
+
delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${Le.Collection_Path?.join("/")}`, {
|
|
12877
|
+
cause: Ne
|
|
12871
12878
|
}));
|
|
12872
12879
|
},
|
|
12873
12880
|
{ ...n, relations: !1 }
|
|
12874
|
-
).then((
|
|
12875
|
-
if (!k.has(
|
|
12876
|
-
|
|
12881
|
+
).then((Ne) => {
|
|
12882
|
+
if (!k.has(U) || !_e?.[ae]) {
|
|
12883
|
+
Ne(), oe[U].delete(ae);
|
|
12877
12884
|
return;
|
|
12878
12885
|
}
|
|
12879
|
-
L.push(
|
|
12880
|
-
doc:
|
|
12886
|
+
L.push(Ne), z[U].set(ae, {
|
|
12887
|
+
doc: U,
|
|
12881
12888
|
type: pe.type,
|
|
12882
12889
|
field: pe.name,
|
|
12883
|
-
listener:
|
|
12890
|
+
listener: Ne
|
|
12884
12891
|
});
|
|
12885
12892
|
});
|
|
12886
12893
|
}
|
|
12887
12894
|
}
|
|
12888
|
-
},
|
|
12889
|
-
const
|
|
12890
|
-
for (const H of
|
|
12891
|
-
if (
|
|
12892
|
-
for (const D of
|
|
12895
|
+
}, K = (q) => {
|
|
12896
|
+
const Y = Oe(n?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" && ve(H) && $t(f, o, a).includes(H.collection)) : f.fields.filter((H) => ve(H) && $t(f, o, a).includes(H.collection));
|
|
12897
|
+
for (const H of U)
|
|
12898
|
+
if (z[q])
|
|
12899
|
+
for (const D of z[q].entries()) {
|
|
12893
12900
|
const [ue, X] = D;
|
|
12894
12901
|
X.doc === q && X.type === H.type && X.field === H.name && (X.listener(), oe[q].delete(ue));
|
|
12895
12902
|
}
|
|
12896
|
-
},
|
|
12897
|
-
const H =
|
|
12903
|
+
}, xe = (q, Y, U) => {
|
|
12904
|
+
const H = U.data({
|
|
12898
12905
|
serverTimestamps: x || "none"
|
|
12899
12906
|
});
|
|
12900
|
-
|
|
12901
|
-
const D = M.get(
|
|
12902
|
-
hm(H, ue), D.set(q, ue), M.set(
|
|
12903
|
-
},
|
|
12907
|
+
Y.id ||= U.id, Y = { ...Y, ...H }, delete Y.Collection_Path_String;
|
|
12908
|
+
const D = M.get(U.id) || /* @__PURE__ */ new Map(), ue = D.get(q) || /* @__PURE__ */ new Set();
|
|
12909
|
+
hm(H, ue), D.set(q, ue), M.set(U.id, D), k.set(U.id, Y);
|
|
12910
|
+
}, Te = n?.only === "cache" || y && n?.only !== "default";
|
|
12904
12911
|
if (y && n?.tempCache && await ir(d.collection, n.tempCache?.constraints, void 0, void 0, void 0, n.tempCache?.label), n?.multipleQueries) {
|
|
12905
12912
|
const q = [];
|
|
12906
|
-
for (const
|
|
12907
|
-
q.push(he(R[0], ...
|
|
12913
|
+
for (const Y of n.multipleQueries)
|
|
12914
|
+
q.push(he(R[0], ...Y));
|
|
12908
12915
|
_ = q;
|
|
12909
12916
|
} else
|
|
12910
12917
|
_ = R;
|
|
12911
12918
|
for (const q of _) {
|
|
12912
|
-
let
|
|
12913
|
-
const
|
|
12914
|
-
(
|
|
12919
|
+
let Y = !0;
|
|
12920
|
+
const U = mr(q, { source: Te ? "cache" : "default", includeMetadataChanges: !0 }, (H) => {
|
|
12921
|
+
(Te || H.metadata.fromCache === !1) && (T.set(q, !0), N.first.set(_.indexOf(q), H.docs[0]), N.last.set(_.indexOf(q), H.docs.at(-1) || H.docs[0]), m && n?.relations || re(N, H.metadata)), T.get(q) === !0 && (Y ? (H.docs.forEach((D) => {
|
|
12915
12922
|
const ue = k.get(D.id) || {}, X = F.get(D.id) || 0;
|
|
12916
|
-
F.set(D.id, X + 1),
|
|
12917
|
-
}),
|
|
12923
|
+
F.set(D.id, X + 1), xe(q, ue, D);
|
|
12924
|
+
}), Y = !1) : H.docChanges().forEach((D) => {
|
|
12918
12925
|
const ue = k.get(D.doc.id) || {}, X = F.get(D.doc.id) || 0;
|
|
12919
|
-
D.type === "added" && F.set(D.doc.id, X + 1), D.type === "added" || D.type === "modified" ?
|
|
12926
|
+
D.type === "added" && F.set(D.doc.id, X + 1), D.type === "added" || D.type === "modified" ? xe(q, ue, D.doc) : D.type === "removed" && (F.set(D.doc.id, X - 1), F.get(D.doc.id) === 0 && (k.delete(D.doc.id), T.size === _.length && n?.relations && (A.set(D.doc.id, "deleted"), K(D.doc.id))));
|
|
12920
12927
|
}), T.size === _.length && n?.relations && (k.size === 0 && re(N, H.metadata), k.forEach((D) => {
|
|
12921
|
-
|
|
12928
|
+
V(D, N);
|
|
12922
12929
|
})));
|
|
12923
12930
|
}, (H) => {
|
|
12924
12931
|
r && r(new Error(`Error fetching documents at location ${t.join("/")}`, { cause: H })), L.forEach((D) => D());
|
|
12925
12932
|
});
|
|
12926
|
-
L.push(
|
|
12933
|
+
L.push(U);
|
|
12927
12934
|
}
|
|
12928
12935
|
let Xe, bt;
|
|
12929
12936
|
if (n?.pagination && !h?.roles.includes(a.Role) && !b?.includes(a.Role)) {
|
|
12930
12937
|
let q = he(E[0], ...s || []);
|
|
12931
12938
|
n.pagination.orderByField && n.pagination.orderByDirection && (q = he(q, rt(n.pagination.orderByField, n.pagination.orderByDirection)));
|
|
12932
|
-
const
|
|
12939
|
+
const Y = await Cd(q).catch(() => {
|
|
12933
12940
|
});
|
|
12934
|
-
if (
|
|
12935
|
-
Xe =
|
|
12936
|
-
const
|
|
12937
|
-
bt =
|
|
12941
|
+
if (Y) {
|
|
12942
|
+
Xe = Y.data().count;
|
|
12943
|
+
const U = n.pagination.number;
|
|
12944
|
+
bt = U && U > 0 ? Math.ceil(Xe / U) : 1;
|
|
12938
12945
|
}
|
|
12939
12946
|
}
|
|
12940
12947
|
return { pages: bt, count: Xe, unsubscribe: (q) => {
|
|
12941
|
-
q === "first" && Xa(N), q === "last" && eo(N), L.forEach((
|
|
12948
|
+
q === "first" && Xa(N), q === "last" && eo(N), L.forEach((Y) => Y());
|
|
12942
12949
|
} };
|
|
12943
12950
|
}, db = async (t, e) => {
|
|
12944
|
-
const r = it(), n =
|
|
12945
|
-
return (await
|
|
12951
|
+
const r = it(), n = Be(), s = Ue(r, n.STOKER_FB_FUNCTIONS_REGION);
|
|
12952
|
+
return (await Je(s, "stoker-getfiles")({
|
|
12946
12953
|
collectionPath: e.Collection_Path,
|
|
12947
12954
|
id: e.id,
|
|
12948
12955
|
path: t
|
|
12949
12956
|
})).data.result;
|
|
12950
12957
|
}, jw = async (t, e, r, n, s, i) => {
|
|
12951
|
-
const a = it(), o =
|
|
12952
|
-
await
|
|
12958
|
+
const a = it(), o = Be(), c = Ue(a, o.STOKER_FB_FUNCTIONS_REGION);
|
|
12959
|
+
await Je(c, "stoker-adminemail")({
|
|
12953
12960
|
subject: t,
|
|
12954
12961
|
text: e,
|
|
12955
12962
|
html: r,
|
|
@@ -12958,14 +12965,14 @@ const eb = async (t, e, r, n) => {
|
|
|
12958
12965
|
replyTo: i
|
|
12959
12966
|
});
|
|
12960
12967
|
}, hb = async (t, e, r, n, s, i, a, o, c) => {
|
|
12961
|
-
if (
|
|
12968
|
+
if (Be().MODE === "development") {
|
|
12962
12969
|
await jw(e, r, n, s, i, a);
|
|
12963
12970
|
return;
|
|
12964
12971
|
}
|
|
12965
12972
|
const f = Ya(t), d = dw(e), h = r ? yd(r) : void 0, p = n ? yd(n) : void 0, b = s ? Ya(s) : void 0, g = i ? Ya(i) : void 0, O = a ? Cn(a) : void 0, S = c ? Cn(c) : void 0, C = Array.isArray(f) ? f : [f];
|
|
12966
12973
|
if (C.length === 0 || C.length === 1 && !C[0])
|
|
12967
12974
|
throw new Error("No valid email addresses provided");
|
|
12968
|
-
const x =
|
|
12975
|
+
const x = ze(), y = { to: f, message: { subject: d } };
|
|
12969
12976
|
if (h && (y.message.text = h), p && (y.message.html = p), b) {
|
|
12970
12977
|
const E = Array.isArray(b) ? b : [b];
|
|
12971
12978
|
E.length > 0 && E[0] && (y.cc = b);
|
|
@@ -12976,16 +12983,16 @@ const eb = async (t, e, r, n) => {
|
|
|
12976
12983
|
}
|
|
12977
12984
|
O && (y.replyTo = O), o && (y.message.attachments = o), S && (y.from = S), await kd(Lr(x, "system_mail"), y);
|
|
12978
12985
|
}, Vw = async (t) => {
|
|
12979
|
-
const e = it(), r =
|
|
12980
|
-
await
|
|
12986
|
+
const e = it(), r = Be(), n = Ue(e, r.STOKER_FB_FUNCTIONS_REGION);
|
|
12987
|
+
await Je(n, "stoker-adminsms")({
|
|
12981
12988
|
body: t
|
|
12982
12989
|
});
|
|
12983
12990
|
}, mb = async (t, e) => {
|
|
12984
|
-
if (
|
|
12991
|
+
if (Be().MODE === "development") {
|
|
12985
12992
|
await Vw(e);
|
|
12986
12993
|
return;
|
|
12987
12994
|
}
|
|
12988
|
-
const s =
|
|
12995
|
+
const s = ze(), i = { to: t, body: e };
|
|
12989
12996
|
await kd(Lr(s, "system_messages"), i);
|
|
12990
12997
|
}, pb = (t) => {
|
|
12991
12998
|
const e = xm();
|
|
@@ -13021,10 +13028,10 @@ export {
|
|
|
13021
13028
|
lc as getCollectionRefs,
|
|
13022
13029
|
Wt as getConnectionStatus,
|
|
13023
13030
|
tb as getCurrentUser,
|
|
13024
|
-
|
|
13031
|
+
Pe as getCurrentUserPermissions,
|
|
13025
13032
|
Qr as getCurrentUserRoleGroups,
|
|
13026
13033
|
gm as getDocumentRefs,
|
|
13027
|
-
|
|
13034
|
+
Be as getEnv,
|
|
13028
13035
|
db as getFiles,
|
|
13029
13036
|
Nm as getFirestoreMaintenance,
|
|
13030
13037
|
vc as getFirestoreWrite,
|
|
@@ -13036,10 +13043,10 @@ export {
|
|
|
13036
13043
|
wr as getOne,
|
|
13037
13044
|
vw as getOneServer,
|
|
13038
13045
|
mw as getPreloadListeners,
|
|
13039
|
-
|
|
13046
|
+
We as getSchema,
|
|
13040
13047
|
vm as getSome,
|
|
13041
13048
|
_w as getSomeServer,
|
|
13042
|
-
|
|
13049
|
+
ze as getStokerFirestore,
|
|
13043
13050
|
Dt as getTenant,
|
|
13044
13051
|
xm as getTimezone,
|
|
13045
13052
|
qw as getUnsubscribes,
|