@marimo-team/islands 0.13.16-dev3 → 0.13.16-dev32
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/{ConnectedDataExplorerComponent-DaX7qzkh.js → ConnectedDataExplorerComponent-CkKEv-mL.js} +1495 -1496
- package/dist/ImageComparisonComponent-8CnnTp0r.js +248 -0
- package/dist/{VegaLite-DqttTZoC.js → VegaLite-nWSYKiIc.js} +12483 -12485
- package/dist/{_baseUniq-C7BPwQHe.js → _baseUniq-C1W_1vWq.js} +13 -13
- package/dist/{any-language-editor-DUew9Rp9.js → any-language-editor-CY5U9gX4.js} +2 -2
- package/dist/{architectureDiagram-IEHRJDOE-a3lDrXQx.js → architectureDiagram-IEHRJDOE-EWWY0mvz.js} +1800 -1800
- package/dist/asn1-jKiBa2Ya.js +10 -10
- package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-DwN_qfSx.js} +695 -702
- package/dist/assets/{worker-BGGm0KYZ.js → worker-BzMPE1Lq.js} +732 -739
- package/dist/assets/{worker-BNsqBj5w.js → worker-ISYYr8IB.js} +726 -732
- package/dist/blockDiagram-JOT3LUYC-B3C-v4PD.js +2249 -0
- package/dist/{c4Diagram-VJAJSXHY-iO9Wy6JM.js → c4Diagram-VJAJSXHY-CfClE6-Z.js} +401 -400
- package/dist/{channel-DcjC1CFM.js → channel-CFcvo1c1.js} +1 -1
- package/dist/chunk-4BMEZGHF-BZaKM3gN.js +9 -0
- package/dist/chunk-A2AXSNBT-CUxpK-9b.js +1373 -0
- package/dist/chunk-AEK57VVT-rXzaZcye.js +1416 -0
- package/dist/{chunk-D6G4REZN-Dlv_YHcf.js → chunk-D6G4REZN-CrKBlkMD.js} +2 -2
- package/dist/{chunk-RZ5BOZE2-D8w7Mlj9.js → chunk-RZ5BOZE2-BJCBpAVO.js} +8 -8
- package/dist/chunk-XZIHB7SX-2_h5_yZc.js +16 -0
- package/dist/{classDiagram-GIVACNV2-B9RHXsFh.js → classDiagram-GIVACNV2-B8GWwAcy.js} +2 -2
- package/dist/{classDiagram-v2-COTLJTTW-B9RHXsFh.js → classDiagram-v2-COTLJTTW-B8GWwAcy.js} +2 -2
- package/dist/clojure-CCKyeQKf.js +2 -2
- package/dist/{clone-D3N_odGc.js → clone-U-1lwbVJ.js} +1 -1
- package/dist/css-bIlmDBTK.js +19 -19
- package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
- package/dist/dagre-OKDRZEBW-DaOOQNhM.js +447 -0
- package/dist/{data-editor-DYnEMVel.js → data-editor-CFCrJQHi.js} +5785 -5795
- package/dist/{diagram-SSKATNLV-B7sCpaam.js → diagram-SSKATNLV-CCJ_Gb5z.js} +13 -13
- package/dist/{diagram-VNBRO52H-D5XB9Rqn.js → diagram-VNBRO52H-BzC9adn2.js} +3 -3
- package/dist/{erDiagram-Q7BY3M3F-Bc4bVsl5.js → erDiagram-Q7BY3M3F-BHHvsdDK.js} +263 -262
- package/dist/flowDiagram-4HSFHLVR-vkucTnNr.js +1623 -0
- package/dist/{ganttDiagram-APWFNJXF-DX7O4yzu.js → ganttDiagram-APWFNJXF-l2kACceV.js} +45 -45
- package/dist/gitGraphDiagram-7IBYFJ6S-BJpk0KOa.js +712 -0
- package/dist/{graph-3qoxqlMi.js → graph-BKlXf3Fq.js} +9 -9
- package/dist/{index-DMwlOrYW.js → index-BeyDjXjy.js} +9 -9
- package/dist/{index-ClcExt8M.js → index-C5przHlV.js} +99 -98
- package/dist/{index-DSv7cBZ6.js → index-CNfV_n4T.js} +4 -4
- package/dist/{index-DarPCnb9.js → index-DEOh8pcs.js} +28 -28
- package/dist/{infoDiagram-PH2N3AL5-Hpz-dZTP.js → infoDiagram-PH2N3AL5-W7PnCLHs.js} +3 -3
- package/dist/javascript-WMWNx-Vj.js +47 -47
- package/dist/{journeyDiagram-U35MCT3I-D8lBbVPX.js → journeyDiagram-U35MCT3I-DxLh-J1C.js} +18 -18
- package/dist/kanban-definition-NDS4AKOZ-DmJhnLu6.js +719 -0
- package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
- package/dist/{layout-BQ5ygFMS.js → layout-BVXmduks.js} +27 -27
- package/dist/{linear-DEKTCzK7.js → linear-B-wXkp1F.js} +2 -2
- package/dist/main-hpqNd7N8.js +169860 -0
- package/dist/main.js +1 -1
- package/dist/mermaid--jymdsmz.js +14517 -0
- package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
- package/dist/{min-BVLo0atX.js → min-CbVx2Ku0.js} +2 -2
- package/dist/{mindmap-definition-ALO5MXBD-CJrYaVvo.js → mindmap-definition-ALO5MXBD-BYUsA2jj.js} +359 -359
- package/dist/mllike-BSnXJBGA.js +7 -7
- package/dist/{pieDiagram-IB7DONF6-Dctceo_p.js → pieDiagram-IB7DONF6-D6OmjKtB.js} +34 -34
- package/dist/pug-BqUR2bBq.js +35 -35
- package/dist/python-B5QdSKoL.js +18 -18
- package/dist/quadrantDiagram-7GDLP6J5-DAi9dTpt.js +1025 -0
- package/dist/{radar-MK3ICKWK-C1HW1I3s.js → radar-MK3ICKWK-Da2nDsTZ.js} +2555 -2554
- package/dist/{react-plotly-Cb9GFlJK.js → react-plotly-Cme3jzpK.js} +6595 -6597
- package/dist/{requirementDiagram-KVF5MWMF-B1hXsRKm.js → requirementDiagram-KVF5MWMF-P8TVHwKV.js} +251 -250
- package/dist/rpm-IznJm2Xc.js +9 -9
- package/dist/{sankeyDiagram-QLVOVGJD-C4Wft0rG.js → sankeyDiagram-QLVOVGJD-DqRUa6QO.js} +339 -338
- package/dist/{sequenceDiagram-X6HHIX6F-DuI3MtaO.js → sequenceDiagram-X6HHIX6F-CMs9msE5.js} +822 -821
- package/dist/{slides-component-CtHXOtAT.js → slides-component-DTGkBZwO.js} +280 -280
- package/dist/sql-mMre1Bo3.js +9 -9
- package/dist/{stateDiagram-DGXRK772-BA90keZx.js → stateDiagram-DGXRK772-Bd3UGnt8.js} +17 -17
- package/dist/{stateDiagram-v2-YXO3MK2T-BAYgRopg.js → stateDiagram-v2-YXO3MK2T-BmhUR5pX.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{time-CSFHw3Jv.js → time-DWwlRxcL.js} +2 -2
- package/dist/{timeline-definition-BDJGKUSR-Blc0sOvC.js → timeline-definition-BDJGKUSR-D43r5g1Q.js} +261 -261
- package/dist/timer-BYwnU4DF.js +378 -378
- package/dist/ttcn-cfg-Bac_acMi.js +9 -9
- package/dist/{vega-component-BhqCtGzK.js → vega-component-DyMtGHYo.js} +82 -82
- package/dist/{xychartDiagram-VJFVF3MP-zwhLbXXB.js → xychartDiagram-VJFVF3MP-ZrwYU0MH.js} +472 -471
- package/package.json +7 -6
- package/dist/blockDiagram-JOT3LUYC-CKFyxt0d.js +0 -2248
- package/dist/chunk-4BMEZGHF-lIaJqjDq.js +0 -9
- package/dist/chunk-A2AXSNBT-Cvv8kb-T.js +0 -1372
- package/dist/chunk-AEK57VVT-B-uzYNYV.js +0 -1415
- package/dist/chunk-XZIHB7SX-eF6XymTt.js +0 -15
- package/dist/dagre-OKDRZEBW-9GOkw9EI.js +0 -447
- package/dist/flowDiagram-4HSFHLVR-O0PMfC8B.js +0 -1622
- package/dist/gitGraphDiagram-7IBYFJ6S-Bq1HYszu.js +0 -712
- package/dist/kanban-definition-NDS4AKOZ-BjHkwf3p.js +0 -719
- package/dist/main-CtGDFKVm.js +0 -156521
- package/dist/mermaid-dkwEEzHU.js +0 -11991
- package/dist/quadrantDiagram-7GDLP6J5-BCGXIJXJ.js +0 -1024
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
class
|
|
1
|
+
var _r = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
|
|
2
|
+
var ls = _r((ps, mt) => {
|
|
3
|
+
class wr {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.status = "pending", this.promise = new Promise((e, r) => {
|
|
6
6
|
this.reject = (n) => {
|
|
@@ -11,13 +11,13 @@ var us = wr((hs, gt) => {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function be(t) {
|
|
15
15
|
return t.FS;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const _e = {
|
|
18
18
|
NOOP: () => {
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, Pt = (t, e) => {
|
|
21
21
|
const r = `[${t}]`;
|
|
22
22
|
return {
|
|
23
23
|
debug: (...n) => e.debug(r, ...n),
|
|
@@ -25,10 +25,10 @@ var us = wr((hs, gt) => {
|
|
|
25
25
|
warn: (...n) => e.warn(r, ...n),
|
|
26
26
|
error: (...n) => e.error(r, ...n),
|
|
27
27
|
trace: (...n) => e.trace(r, ...n),
|
|
28
|
-
get: (n) =>
|
|
29
|
-
disabled: (n = !0) => n ?
|
|
28
|
+
get: (n) => Pt(`${t}.${n}`, e),
|
|
29
|
+
disabled: (n = !0) => n ? Ue : e
|
|
30
30
|
};
|
|
31
|
-
},
|
|
31
|
+
}, qe = {
|
|
32
32
|
debug: (...t) => {
|
|
33
33
|
console.debug(...t);
|
|
34
34
|
},
|
|
@@ -44,53 +44,53 @@ var us = wr((hs, gt) => {
|
|
|
44
44
|
trace: (...t) => {
|
|
45
45
|
console.trace(...t);
|
|
46
46
|
},
|
|
47
|
-
get: (t) =>
|
|
48
|
-
disabled: (t = !0) => t ?
|
|
49
|
-
},
|
|
50
|
-
debug: () =>
|
|
51
|
-
log: () =>
|
|
52
|
-
warn: () =>
|
|
53
|
-
error: () =>
|
|
54
|
-
trace: () =>
|
|
55
|
-
get: () =>
|
|
56
|
-
disabled: () =>
|
|
47
|
+
get: (t) => Pt(t, qe),
|
|
48
|
+
disabled: (t = !0) => t ? Ue : qe
|
|
49
|
+
}, Ue = {
|
|
50
|
+
debug: () => _e.NOOP,
|
|
51
|
+
log: () => _e.NOOP,
|
|
52
|
+
warn: () => _e.NOOP,
|
|
53
|
+
error: () => _e.NOOP,
|
|
54
|
+
trace: () => _e.NOOP,
|
|
55
|
+
get: () => Ue,
|
|
56
|
+
disabled: () => Ue
|
|
57
57
|
};
|
|
58
|
-
function
|
|
59
|
-
return typeof window < "u" && window.Logger ||
|
|
58
|
+
function kr() {
|
|
59
|
+
return typeof window < "u" && window.Logger || qe;
|
|
60
60
|
}
|
|
61
|
-
const Y =
|
|
62
|
-
NOTEBOOK_FILENAME:
|
|
63
|
-
HOME_DIR:
|
|
61
|
+
const Y = kr(), at = (t) => new TextDecoder().decode(t), we = "notebook.py", ke = "/marimo", ae = {
|
|
62
|
+
NOTEBOOK_FILENAME: we,
|
|
63
|
+
HOME_DIR: ke,
|
|
64
64
|
createHomeDir: (t) => {
|
|
65
|
-
const e =
|
|
65
|
+
const e = be(t);
|
|
66
66
|
try {
|
|
67
|
-
e.mkdirTree(
|
|
67
|
+
e.mkdirTree(ke);
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
|
-
e.chdir(
|
|
70
|
+
e.chdir(ke);
|
|
71
71
|
},
|
|
72
72
|
mountFS: (t) => {
|
|
73
|
-
|
|
73
|
+
be(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ke);
|
|
74
74
|
},
|
|
75
75
|
populateFilesToMemory: async (t) => {
|
|
76
|
-
await
|
|
76
|
+
await xt(t, !0);
|
|
77
77
|
},
|
|
78
78
|
persistFilesToRemote: async (t) => {
|
|
79
|
-
await
|
|
79
|
+
await xt(t, !1);
|
|
80
80
|
},
|
|
81
81
|
readNotebook: (t) => {
|
|
82
|
-
const e =
|
|
83
|
-
return
|
|
82
|
+
const e = be(t), r = `${ke}/${we}`;
|
|
83
|
+
return at(e.readFile(r));
|
|
84
84
|
},
|
|
85
85
|
initNotebookCode: (t) => {
|
|
86
|
-
const { pyodide: e, filename: r, code: n } = t, s =
|
|
86
|
+
const { pyodide: e, filename: r, code: n } = t, s = be(e), a = (i) => {
|
|
87
87
|
try {
|
|
88
|
-
return
|
|
88
|
+
return at(s.readFile(i));
|
|
89
89
|
} catch {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
if (r && r !==
|
|
93
|
+
if (r && r !== we) {
|
|
94
94
|
const i = a(r);
|
|
95
95
|
if (i)
|
|
96
96
|
return {
|
|
@@ -98,15 +98,15 @@ var us = wr((hs, gt) => {
|
|
|
98
98
|
filename: r
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
return s.writeFile(
|
|
101
|
+
return s.writeFile(we, n), {
|
|
102
102
|
code: n,
|
|
103
|
-
filename:
|
|
103
|
+
filename: we
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
-
function
|
|
107
|
+
function xt(t, e) {
|
|
108
108
|
return new Promise((r, n) => {
|
|
109
|
-
|
|
109
|
+
be(t).syncfs(e, (s) => {
|
|
110
110
|
if (s instanceof Error) {
|
|
111
111
|
n(s);
|
|
112
112
|
return;
|
|
@@ -115,7 +115,7 @@ var us = wr((hs, gt) => {
|
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class br {
|
|
119
119
|
constructor(e) {
|
|
120
120
|
this.onMessage = e, this.started = !1, this.push = (r) => {
|
|
121
121
|
this.started ? this.onMessage(r) : this.buffer.push(r);
|
|
@@ -160,14 +160,14 @@ var us = wr((hs, gt) => {
|
|
|
160
160
|
}
|
|
161
161
|
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
162
162
|
})(k || (k = {}));
|
|
163
|
-
var
|
|
163
|
+
var it;
|
|
164
164
|
(function(t) {
|
|
165
165
|
t.mergeShapes = (e, r) => ({
|
|
166
166
|
...e,
|
|
167
167
|
...r
|
|
168
168
|
// second overwrites first
|
|
169
169
|
});
|
|
170
|
-
})(
|
|
170
|
+
})(it || (it = {}));
|
|
171
171
|
const p = k.arrayToEnum([
|
|
172
172
|
"string",
|
|
173
173
|
"nan",
|
|
@@ -189,7 +189,7 @@ var us = wr((hs, gt) => {
|
|
|
189
189
|
"never",
|
|
190
190
|
"map",
|
|
191
191
|
"set"
|
|
192
|
-
]),
|
|
192
|
+
]), B = (t) => {
|
|
193
193
|
switch (typeof t) {
|
|
194
194
|
case "undefined":
|
|
195
195
|
return p.undefined;
|
|
@@ -227,8 +227,8 @@ var us = wr((hs, gt) => {
|
|
|
227
227
|
"invalid_intersection_types",
|
|
228
228
|
"not_multiple_of",
|
|
229
229
|
"not_finite"
|
|
230
|
-
]),
|
|
231
|
-
class
|
|
230
|
+
]), xr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
231
|
+
class C extends Error {
|
|
232
232
|
get errors() {
|
|
233
233
|
return this.issues;
|
|
234
234
|
}
|
|
@@ -265,7 +265,7 @@ var us = wr((hs, gt) => {
|
|
|
265
265
|
return s(this), n;
|
|
266
266
|
}
|
|
267
267
|
static assert(e) {
|
|
268
|
-
if (!(e instanceof
|
|
268
|
+
if (!(e instanceof C))
|
|
269
269
|
throw new Error(`Not a ZodError: ${e}`);
|
|
270
270
|
}
|
|
271
271
|
toString() {
|
|
@@ -287,8 +287,8 @@ var us = wr((hs, gt) => {
|
|
|
287
287
|
return this.flatten();
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
|
|
291
|
-
const
|
|
290
|
+
C.create = (t) => new C(t);
|
|
291
|
+
const ye = (t, e) => {
|
|
292
292
|
let r;
|
|
293
293
|
switch (t.code) {
|
|
294
294
|
case l.invalid_type:
|
|
@@ -344,14 +344,14 @@ var us = wr((hs, gt) => {
|
|
|
344
344
|
}
|
|
345
345
|
return { message: r };
|
|
346
346
|
};
|
|
347
|
-
let
|
|
348
|
-
function
|
|
349
|
-
|
|
347
|
+
let Ct = ye;
|
|
348
|
+
function Sr(t) {
|
|
349
|
+
Ct = t;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
return
|
|
351
|
+
function Be() {
|
|
352
|
+
return Ct;
|
|
353
353
|
}
|
|
354
|
-
const
|
|
354
|
+
const He = (t) => {
|
|
355
355
|
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
356
356
|
...s,
|
|
357
357
|
path: a
|
|
@@ -371,9 +371,9 @@ var us = wr((hs, gt) => {
|
|
|
371
371
|
path: a,
|
|
372
372
|
message: o
|
|
373
373
|
};
|
|
374
|
-
},
|
|
374
|
+
}, Tr = [];
|
|
375
375
|
function f(t, e) {
|
|
376
|
-
const r =
|
|
376
|
+
const r = Be(), n = He({
|
|
377
377
|
issueData: e,
|
|
378
378
|
data: t.data,
|
|
379
379
|
path: t.path,
|
|
@@ -384,13 +384,13 @@ var us = wr((hs, gt) => {
|
|
|
384
384
|
// then schema-bound map if available
|
|
385
385
|
r,
|
|
386
386
|
// then global override map
|
|
387
|
-
r ===
|
|
387
|
+
r === ye ? void 0 : ye
|
|
388
388
|
// then global default map
|
|
389
389
|
].filter((s) => !!s)
|
|
390
390
|
});
|
|
391
391
|
t.common.issues.push(n);
|
|
392
392
|
}
|
|
393
|
-
class
|
|
393
|
+
class O {
|
|
394
394
|
constructor() {
|
|
395
395
|
this.value = "valid";
|
|
396
396
|
}
|
|
@@ -418,7 +418,7 @@ var us = wr((hs, gt) => {
|
|
|
418
418
|
value: i
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
-
return
|
|
421
|
+
return O.mergeObjectSync(e, n);
|
|
422
422
|
}
|
|
423
423
|
static mergeObjectSync(e, r) {
|
|
424
424
|
const n = {};
|
|
@@ -433,21 +433,21 @@ var us = wr((hs, gt) => {
|
|
|
433
433
|
}
|
|
434
434
|
const y = Object.freeze({
|
|
435
435
|
status: "aborted"
|
|
436
|
-
}),
|
|
437
|
-
function
|
|
436
|
+
}), he = (t) => ({ status: "dirty", value: t }), A = (t) => ({ status: "valid", value: t }), ot = (t) => t.status === "aborted", ct = (t) => t.status === "dirty", oe = (t) => t.status === "valid", Te = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
437
|
+
function We(t, e, r, n) {
|
|
438
438
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
439
439
|
return e.get(t);
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function It(t, e, r, n, s) {
|
|
442
442
|
if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
443
443
|
return e.set(t, r), r;
|
|
444
444
|
}
|
|
445
445
|
var h;
|
|
446
446
|
(function(t) {
|
|
447
|
-
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e
|
|
447
|
+
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
448
448
|
})(h || (h = {}));
|
|
449
|
-
var
|
|
450
|
-
class
|
|
449
|
+
var xe, Se;
|
|
450
|
+
class D {
|
|
451
451
|
constructor(e, r, n, s) {
|
|
452
452
|
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
453
453
|
}
|
|
@@ -455,8 +455,8 @@ var us = wr((hs, gt) => {
|
|
|
455
455
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
458
|
+
const St = (t, e) => {
|
|
459
|
+
if (oe(e))
|
|
460
460
|
return { success: !0, data: e.value };
|
|
461
461
|
if (!t.common.issues.length)
|
|
462
462
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -465,7 +465,7 @@ var us = wr((hs, gt) => {
|
|
|
465
465
|
get error() {
|
|
466
466
|
if (this._error)
|
|
467
467
|
return this._error;
|
|
468
|
-
const r = new
|
|
468
|
+
const r = new C(t.common.issues);
|
|
469
469
|
return this._error = r, this._error;
|
|
470
470
|
}
|
|
471
471
|
};
|
|
@@ -487,13 +487,13 @@ var us = wr((hs, gt) => {
|
|
|
487
487
|
return this._def.description;
|
|
488
488
|
}
|
|
489
489
|
_getType(e) {
|
|
490
|
-
return
|
|
490
|
+
return B(e.data);
|
|
491
491
|
}
|
|
492
492
|
_getOrReturnCtx(e, r) {
|
|
493
493
|
return r || {
|
|
494
494
|
common: e.parent.common,
|
|
495
495
|
data: e.data,
|
|
496
|
-
parsedType:
|
|
496
|
+
parsedType: B(e.data),
|
|
497
497
|
schemaErrorMap: this._def.errorMap,
|
|
498
498
|
path: e.path,
|
|
499
499
|
parent: e.parent
|
|
@@ -501,11 +501,11 @@ var us = wr((hs, gt) => {
|
|
|
501
501
|
}
|
|
502
502
|
_processInputParams(e) {
|
|
503
503
|
return {
|
|
504
|
-
status: new
|
|
504
|
+
status: new O(),
|
|
505
505
|
ctx: {
|
|
506
506
|
common: e.parent.common,
|
|
507
507
|
data: e.data,
|
|
508
|
-
parsedType:
|
|
508
|
+
parsedType: B(e.data),
|
|
509
509
|
schemaErrorMap: this._def.errorMap,
|
|
510
510
|
path: e.path,
|
|
511
511
|
parent: e.parent
|
|
@@ -514,7 +514,7 @@ var us = wr((hs, gt) => {
|
|
|
514
514
|
}
|
|
515
515
|
_parseSync(e) {
|
|
516
516
|
const r = this._parse(e);
|
|
517
|
-
if (
|
|
517
|
+
if (Te(r))
|
|
518
518
|
throw new Error("Synchronous parse encountered promise.");
|
|
519
519
|
return r;
|
|
520
520
|
}
|
|
@@ -533,16 +533,16 @@ var us = wr((hs, gt) => {
|
|
|
533
533
|
const s = {
|
|
534
534
|
common: {
|
|
535
535
|
issues: [],
|
|
536
|
-
async: (n = r
|
|
537
|
-
contextualErrorMap: r
|
|
536
|
+
async: (n = r?.async) !== null && n !== void 0 ? n : !1,
|
|
537
|
+
contextualErrorMap: r?.errorMap
|
|
538
538
|
},
|
|
539
|
-
path:
|
|
539
|
+
path: r?.path || [],
|
|
540
540
|
schemaErrorMap: this._def.errorMap,
|
|
541
541
|
parent: null,
|
|
542
542
|
data: e,
|
|
543
|
-
parsedType:
|
|
543
|
+
parsedType: B(e)
|
|
544
544
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
545
|
-
return
|
|
545
|
+
return St(s, a);
|
|
546
546
|
}
|
|
547
547
|
"~validate"(e) {
|
|
548
548
|
var r, n;
|
|
@@ -555,23 +555,23 @@ var us = wr((hs, gt) => {
|
|
|
555
555
|
schemaErrorMap: this._def.errorMap,
|
|
556
556
|
parent: null,
|
|
557
557
|
data: e,
|
|
558
|
-
parsedType:
|
|
558
|
+
parsedType: B(e)
|
|
559
559
|
};
|
|
560
560
|
if (!this["~standard"].async)
|
|
561
561
|
try {
|
|
562
562
|
const a = this._parseSync({ data: e, path: [], parent: s });
|
|
563
|
-
return
|
|
563
|
+
return oe(a) ? {
|
|
564
564
|
value: a.value
|
|
565
565
|
} : {
|
|
566
566
|
issues: s.common.issues
|
|
567
567
|
};
|
|
568
568
|
} catch (a) {
|
|
569
|
-
!((n = (r = a
|
|
569
|
+
!((n = (r = a?.message) === null || r === void 0 ? void 0 : r.toLowerCase()) === null || n === void 0) && n.includes("encountered") && (this["~standard"].async = !0), s.common = {
|
|
570
570
|
issues: [],
|
|
571
571
|
async: !0
|
|
572
572
|
};
|
|
573
573
|
}
|
|
574
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((a) =>
|
|
574
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((a) => oe(a) ? {
|
|
575
575
|
value: a.value
|
|
576
576
|
} : {
|
|
577
577
|
issues: s.common.issues
|
|
@@ -587,16 +587,16 @@ var us = wr((hs, gt) => {
|
|
|
587
587
|
const n = {
|
|
588
588
|
common: {
|
|
589
589
|
issues: [],
|
|
590
|
-
contextualErrorMap: r
|
|
590
|
+
contextualErrorMap: r?.errorMap,
|
|
591
591
|
async: !0
|
|
592
592
|
},
|
|
593
|
-
path:
|
|
593
|
+
path: r?.path || [],
|
|
594
594
|
schemaErrorMap: this._def.errorMap,
|
|
595
595
|
parent: null,
|
|
596
596
|
data: e,
|
|
597
|
-
parsedType:
|
|
598
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
599
|
-
return
|
|
597
|
+
parsedType: B(e)
|
|
598
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Te(s) ? s : Promise.resolve(s));
|
|
599
|
+
return St(n, a);
|
|
600
600
|
}
|
|
601
601
|
refine(e, r) {
|
|
602
602
|
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
@@ -612,7 +612,7 @@ var us = wr((hs, gt) => {
|
|
|
612
612
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
|
|
613
613
|
}
|
|
614
614
|
_refinement(e) {
|
|
615
|
-
return new
|
|
615
|
+
return new $({
|
|
616
616
|
schema: this,
|
|
617
617
|
typeName: m.ZodEffects,
|
|
618
618
|
effect: { type: "refinement", refinement: e }
|
|
@@ -629,7 +629,7 @@ var us = wr((hs, gt) => {
|
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
631
|
optional() {
|
|
632
|
-
return
|
|
632
|
+
return L.create(this, this._def);
|
|
633
633
|
}
|
|
634
634
|
nullable() {
|
|
635
635
|
return Q.create(this, this._def);
|
|
@@ -638,19 +638,19 @@ var us = wr((hs, gt) => {
|
|
|
638
638
|
return this.nullable().optional();
|
|
639
639
|
}
|
|
640
640
|
array() {
|
|
641
|
-
return
|
|
641
|
+
return j.create(this);
|
|
642
642
|
}
|
|
643
643
|
promise() {
|
|
644
|
-
return
|
|
644
|
+
return ve.create(this, this._def);
|
|
645
645
|
}
|
|
646
646
|
or(e) {
|
|
647
|
-
return
|
|
647
|
+
return Re.create([this, e], this._def);
|
|
648
648
|
}
|
|
649
649
|
and(e) {
|
|
650
|
-
return
|
|
650
|
+
return Ae.create(this, e, this._def);
|
|
651
651
|
}
|
|
652
652
|
transform(e) {
|
|
653
|
-
return new
|
|
653
|
+
return new $({
|
|
654
654
|
...v(this._def),
|
|
655
655
|
schema: this,
|
|
656
656
|
typeName: m.ZodEffects,
|
|
@@ -659,7 +659,7 @@ var us = wr((hs, gt) => {
|
|
|
659
659
|
}
|
|
660
660
|
default(e) {
|
|
661
661
|
const r = typeof e == "function" ? e : () => e;
|
|
662
|
-
return new
|
|
662
|
+
return new je({
|
|
663
663
|
...v(this._def),
|
|
664
664
|
innerType: this,
|
|
665
665
|
defaultValue: r,
|
|
@@ -667,7 +667,7 @@ var us = wr((hs, gt) => {
|
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
669
|
brand() {
|
|
670
|
-
return new
|
|
670
|
+
return new yt({
|
|
671
671
|
typeName: m.ZodBranded,
|
|
672
672
|
type: this,
|
|
673
673
|
...v(this._def)
|
|
@@ -675,7 +675,7 @@ var us = wr((hs, gt) => {
|
|
|
675
675
|
}
|
|
676
676
|
catch(e) {
|
|
677
677
|
const r = typeof e == "function" ? e : () => e;
|
|
678
|
-
return new
|
|
678
|
+
return new $e({
|
|
679
679
|
...v(this._def),
|
|
680
680
|
innerType: this,
|
|
681
681
|
catchValue: r,
|
|
@@ -690,10 +690,10 @@ var us = wr((hs, gt) => {
|
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
692
|
pipe(e) {
|
|
693
|
-
return
|
|
693
|
+
return Me.create(this, e);
|
|
694
694
|
}
|
|
695
695
|
readonly() {
|
|
696
|
-
return
|
|
696
|
+
return Fe.create(this);
|
|
697
697
|
}
|
|
698
698
|
isOptional() {
|
|
699
699
|
return this.safeParse(void 0).success;
|
|
@@ -702,26 +702,26 @@ var us = wr((hs, gt) => {
|
|
|
702
702
|
return this.safeParse(null).success;
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
const
|
|
706
|
-
let
|
|
707
|
-
const
|
|
708
|
-
function
|
|
705
|
+
const Er = /^c[^\s-]{8,}$/i, Or = /^[0-9a-z]+$/, Nr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Rr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ar = /^[a-z0-9_-]{21}$/i, Pr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Cr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ir = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
706
|
+
let nt;
|
|
707
|
+
const jr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, $r = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Fr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Mr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Lr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Dr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Zt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Vr = new RegExp(`^${Zt}$`);
|
|
708
|
+
function jt(t) {
|
|
709
709
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
710
710
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
return new RegExp(`^${
|
|
712
|
+
function zr(t) {
|
|
713
|
+
return new RegExp(`^${jt(t)}$`);
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
let e = `${
|
|
715
|
+
function $t(t) {
|
|
716
|
+
let e = `${Zt}T${jt(t)}`;
|
|
717
717
|
const r = [];
|
|
718
718
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
return !!((e === "v4" || !e) &&
|
|
720
|
+
function qr(t, e) {
|
|
721
|
+
return !!((e === "v4" || !e) && jr.test(t) || (e === "v6" || !e) && Fr.test(t));
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
if (!
|
|
723
|
+
function Ur(t, e) {
|
|
724
|
+
if (!Pr.test(t))
|
|
725
725
|
return !1;
|
|
726
726
|
try {
|
|
727
727
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -730,10 +730,10 @@ var us = wr((hs, gt) => {
|
|
|
730
730
|
return !1;
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
return !!((e === "v4" || !e) &&
|
|
733
|
+
function Br(t, e) {
|
|
734
|
+
return !!((e === "v4" || !e) && $r.test(t) || (e === "v6" || !e) && Mr.test(t));
|
|
735
735
|
}
|
|
736
|
-
class
|
|
736
|
+
class Z extends _ {
|
|
737
737
|
_parse(e) {
|
|
738
738
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
|
|
739
739
|
const a = this._getOrReturnCtx(e);
|
|
@@ -743,7 +743,7 @@ var us = wr((hs, gt) => {
|
|
|
743
743
|
received: a.parsedType
|
|
744
744
|
}), y;
|
|
745
745
|
}
|
|
746
|
-
const n = new
|
|
746
|
+
const n = new O();
|
|
747
747
|
let s;
|
|
748
748
|
for (const a of this._def.checks)
|
|
749
749
|
if (a.kind === "min")
|
|
@@ -782,43 +782,43 @@ var us = wr((hs, gt) => {
|
|
|
782
782
|
message: a.message
|
|
783
783
|
}), n.dirty());
|
|
784
784
|
} else if (a.kind === "email")
|
|
785
|
-
|
|
785
|
+
Ir.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
786
786
|
validation: "email",
|
|
787
787
|
code: l.invalid_string,
|
|
788
788
|
message: a.message
|
|
789
789
|
}), n.dirty());
|
|
790
790
|
else if (a.kind === "emoji")
|
|
791
|
-
|
|
791
|
+
nt || (nt = new RegExp(Zr, "u")), nt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
792
792
|
validation: "emoji",
|
|
793
793
|
code: l.invalid_string,
|
|
794
794
|
message: a.message
|
|
795
795
|
}), n.dirty());
|
|
796
796
|
else if (a.kind === "uuid")
|
|
797
|
-
|
|
797
|
+
Rr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
798
798
|
validation: "uuid",
|
|
799
799
|
code: l.invalid_string,
|
|
800
800
|
message: a.message
|
|
801
801
|
}), n.dirty());
|
|
802
802
|
else if (a.kind === "nanoid")
|
|
803
|
-
|
|
803
|
+
Ar.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
804
804
|
validation: "nanoid",
|
|
805
805
|
code: l.invalid_string,
|
|
806
806
|
message: a.message
|
|
807
807
|
}), n.dirty());
|
|
808
808
|
else if (a.kind === "cuid")
|
|
809
|
-
|
|
809
|
+
Er.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
810
810
|
validation: "cuid",
|
|
811
811
|
code: l.invalid_string,
|
|
812
812
|
message: a.message
|
|
813
813
|
}), n.dirty());
|
|
814
814
|
else if (a.kind === "cuid2")
|
|
815
|
-
|
|
815
|
+
Or.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
816
816
|
validation: "cuid2",
|
|
817
817
|
code: l.invalid_string,
|
|
818
818
|
message: a.message
|
|
819
819
|
}), n.dirty());
|
|
820
820
|
else if (a.kind === "ulid")
|
|
821
|
-
|
|
821
|
+
Nr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
822
822
|
validation: "ulid",
|
|
823
823
|
code: l.invalid_string,
|
|
824
824
|
message: a.message
|
|
@@ -849,39 +849,39 @@ var us = wr((hs, gt) => {
|
|
|
849
849
|
code: l.invalid_string,
|
|
850
850
|
validation: { endsWith: a.value },
|
|
851
851
|
message: a.message
|
|
852
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
852
|
+
}), n.dirty()) : a.kind === "datetime" ? $t(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
853
853
|
code: l.invalid_string,
|
|
854
854
|
validation: "datetime",
|
|
855
855
|
message: a.message
|
|
856
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
856
|
+
}), n.dirty()) : a.kind === "date" ? Vr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
857
857
|
code: l.invalid_string,
|
|
858
858
|
validation: "date",
|
|
859
859
|
message: a.message
|
|
860
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
860
|
+
}), n.dirty()) : a.kind === "time" ? zr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
861
861
|
code: l.invalid_string,
|
|
862
862
|
validation: "time",
|
|
863
863
|
message: a.message
|
|
864
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
864
|
+
}), n.dirty()) : a.kind === "duration" ? Cr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
865
865
|
validation: "duration",
|
|
866
866
|
code: l.invalid_string,
|
|
867
867
|
message: a.message
|
|
868
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
868
|
+
}), n.dirty()) : a.kind === "ip" ? qr(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
869
869
|
validation: "ip",
|
|
870
870
|
code: l.invalid_string,
|
|
871
871
|
message: a.message
|
|
872
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
872
|
+
}), n.dirty()) : a.kind === "jwt" ? Ur(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
873
873
|
validation: "jwt",
|
|
874
874
|
code: l.invalid_string,
|
|
875
875
|
message: a.message
|
|
876
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
876
|
+
}), n.dirty()) : a.kind === "cidr" ? Br(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
877
877
|
validation: "cidr",
|
|
878
878
|
code: l.invalid_string,
|
|
879
879
|
message: a.message
|
|
880
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
880
|
+
}), n.dirty()) : a.kind === "base64" ? Lr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
881
881
|
validation: "base64",
|
|
882
882
|
code: l.invalid_string,
|
|
883
883
|
message: a.message
|
|
884
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
884
|
+
}), n.dirty()) : a.kind === "base64url" ? Dr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
885
885
|
validation: "base64url",
|
|
886
886
|
code: l.invalid_string,
|
|
887
887
|
message: a.message
|
|
@@ -896,7 +896,7 @@ var us = wr((hs, gt) => {
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
_addCheck(e) {
|
|
899
|
-
return new
|
|
899
|
+
return new Z({
|
|
900
900
|
...this._def,
|
|
901
901
|
checks: [...this._def.checks, e]
|
|
902
902
|
});
|
|
@@ -953,10 +953,10 @@ var us = wr((hs, gt) => {
|
|
|
953
953
|
message: e
|
|
954
954
|
}) : this._addCheck({
|
|
955
955
|
kind: "datetime",
|
|
956
|
-
precision: typeof
|
|
957
|
-
offset: (r = e
|
|
958
|
-
local: (n = e
|
|
959
|
-
...h.errToObj(e
|
|
956
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
957
|
+
offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
|
|
958
|
+
local: (n = e?.local) !== null && n !== void 0 ? n : !1,
|
|
959
|
+
...h.errToObj(e?.message)
|
|
960
960
|
});
|
|
961
961
|
}
|
|
962
962
|
date(e) {
|
|
@@ -969,8 +969,8 @@ var us = wr((hs, gt) => {
|
|
|
969
969
|
message: e
|
|
970
970
|
}) : this._addCheck({
|
|
971
971
|
kind: "time",
|
|
972
|
-
precision: typeof
|
|
973
|
-
...h.errToObj(e
|
|
972
|
+
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
973
|
+
...h.errToObj(e?.message)
|
|
974
974
|
});
|
|
975
975
|
}
|
|
976
976
|
duration(e) {
|
|
@@ -987,8 +987,8 @@ var us = wr((hs, gt) => {
|
|
|
987
987
|
return this._addCheck({
|
|
988
988
|
kind: "includes",
|
|
989
989
|
value: e,
|
|
990
|
-
position: r
|
|
991
|
-
...h.errToObj(r
|
|
990
|
+
position: r?.position,
|
|
991
|
+
...h.errToObj(r?.message)
|
|
992
992
|
});
|
|
993
993
|
}
|
|
994
994
|
startsWith(e, r) {
|
|
@@ -1033,19 +1033,19 @@ var us = wr((hs, gt) => {
|
|
|
1033
1033
|
return this.min(1, h.errToObj(e));
|
|
1034
1034
|
}
|
|
1035
1035
|
trim() {
|
|
1036
|
-
return new
|
|
1036
|
+
return new Z({
|
|
1037
1037
|
...this._def,
|
|
1038
1038
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
toLowerCase() {
|
|
1042
|
-
return new
|
|
1042
|
+
return new Z({
|
|
1043
1043
|
...this._def,
|
|
1044
1044
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
1047
|
toUpperCase() {
|
|
1048
|
-
return new
|
|
1048
|
+
return new Z({
|
|
1049
1049
|
...this._def,
|
|
1050
1050
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1051
1051
|
});
|
|
@@ -1111,16 +1111,16 @@ var us = wr((hs, gt) => {
|
|
|
1111
1111
|
return e;
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
|
|
1114
|
+
Z.create = (t) => {
|
|
1115
1115
|
var e;
|
|
1116
|
-
return new
|
|
1116
|
+
return new Z({
|
|
1117
1117
|
checks: [],
|
|
1118
1118
|
typeName: m.ZodString,
|
|
1119
|
-
coerce: (e = t
|
|
1119
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1120
1120
|
...v(t)
|
|
1121
1121
|
});
|
|
1122
1122
|
};
|
|
1123
|
-
function
|
|
1123
|
+
function Hr(t, e) {
|
|
1124
1124
|
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1125
1125
|
return a % i / Math.pow(10, s);
|
|
1126
1126
|
}
|
|
@@ -1138,7 +1138,7 @@ var us = wr((hs, gt) => {
|
|
|
1138
1138
|
}), y;
|
|
1139
1139
|
}
|
|
1140
1140
|
let n;
|
|
1141
|
-
const s = new
|
|
1141
|
+
const s = new O();
|
|
1142
1142
|
for (const a of this._def.checks)
|
|
1143
1143
|
a.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1144
1144
|
code: l.invalid_type,
|
|
@@ -1159,7 +1159,7 @@ var us = wr((hs, gt) => {
|
|
|
1159
1159
|
inclusive: a.inclusive,
|
|
1160
1160
|
exact: !1,
|
|
1161
1161
|
message: a.message
|
|
1162
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1162
|
+
}), s.dirty()) : a.kind === "multipleOf" ? Hr(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1163
1163
|
code: l.not_multiple_of,
|
|
1164
1164
|
multipleOf: a.value,
|
|
1165
1165
|
message: a.message
|
|
@@ -1293,7 +1293,7 @@ var us = wr((hs, gt) => {
|
|
|
1293
1293
|
K.create = (t) => new K({
|
|
1294
1294
|
checks: [],
|
|
1295
1295
|
typeName: m.ZodNumber,
|
|
1296
|
-
coerce:
|
|
1296
|
+
coerce: t?.coerce || !1,
|
|
1297
1297
|
...v(t)
|
|
1298
1298
|
});
|
|
1299
1299
|
class G extends _ {
|
|
@@ -1310,7 +1310,7 @@ var us = wr((hs, gt) => {
|
|
|
1310
1310
|
if (this._getType(e) !== p.bigint)
|
|
1311
1311
|
return this._getInvalidInput(e);
|
|
1312
1312
|
let n;
|
|
1313
|
-
const s = new
|
|
1313
|
+
const s = new O();
|
|
1314
1314
|
for (const a of this._def.checks)
|
|
1315
1315
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1316
1316
|
code: l.too_small,
|
|
@@ -1428,11 +1428,11 @@ var us = wr((hs, gt) => {
|
|
|
1428
1428
|
return new G({
|
|
1429
1429
|
checks: [],
|
|
1430
1430
|
typeName: m.ZodBigInt,
|
|
1431
|
-
coerce: (e = t
|
|
1431
|
+
coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
|
|
1432
1432
|
...v(t)
|
|
1433
1433
|
});
|
|
1434
1434
|
};
|
|
1435
|
-
class
|
|
1435
|
+
class Ee extends _ {
|
|
1436
1436
|
_parse(e) {
|
|
1437
1437
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
1438
1438
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1442,15 +1442,15 @@ var us = wr((hs, gt) => {
|
|
|
1442
1442
|
received: n.parsedType
|
|
1443
1443
|
}), y;
|
|
1444
1444
|
}
|
|
1445
|
-
return
|
|
1445
|
+
return A(e.data);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
|
|
1448
|
+
Ee.create = (t) => new Ee({
|
|
1449
1449
|
typeName: m.ZodBoolean,
|
|
1450
|
-
coerce:
|
|
1450
|
+
coerce: t?.coerce || !1,
|
|
1451
1451
|
...v(t)
|
|
1452
1452
|
});
|
|
1453
|
-
class
|
|
1453
|
+
class ce extends _ {
|
|
1454
1454
|
_parse(e) {
|
|
1455
1455
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
|
|
1456
1456
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1466,7 +1466,7 @@ var us = wr((hs, gt) => {
|
|
|
1466
1466
|
code: l.invalid_date
|
|
1467
1467
|
}), y;
|
|
1468
1468
|
}
|
|
1469
|
-
const n = new
|
|
1469
|
+
const n = new O();
|
|
1470
1470
|
let s;
|
|
1471
1471
|
for (const a of this._def.checks)
|
|
1472
1472
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
@@ -1490,7 +1490,7 @@ var us = wr((hs, gt) => {
|
|
|
1490
1490
|
};
|
|
1491
1491
|
}
|
|
1492
1492
|
_addCheck(e) {
|
|
1493
|
-
return new
|
|
1493
|
+
return new ce({
|
|
1494
1494
|
...this._def,
|
|
1495
1495
|
checks: [...this._def.checks, e]
|
|
1496
1496
|
});
|
|
@@ -1522,13 +1522,13 @@ var us = wr((hs, gt) => {
|
|
|
1522
1522
|
return e != null ? new Date(e) : null;
|
|
1523
1523
|
}
|
|
1524
1524
|
}
|
|
1525
|
-
|
|
1525
|
+
ce.create = (t) => new ce({
|
|
1526
1526
|
checks: [],
|
|
1527
|
-
coerce:
|
|
1527
|
+
coerce: t?.coerce || !1,
|
|
1528
1528
|
typeName: m.ZodDate,
|
|
1529
1529
|
...v(t)
|
|
1530
1530
|
});
|
|
1531
|
-
class
|
|
1531
|
+
class Je extends _ {
|
|
1532
1532
|
_parse(e) {
|
|
1533
1533
|
if (this._getType(e) !== p.symbol) {
|
|
1534
1534
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1538,14 +1538,14 @@ var us = wr((hs, gt) => {
|
|
|
1538
1538
|
received: n.parsedType
|
|
1539
1539
|
}), y;
|
|
1540
1540
|
}
|
|
1541
|
-
return
|
|
1541
|
+
return A(e.data);
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
|
|
1544
|
+
Je.create = (t) => new Je({
|
|
1545
1545
|
typeName: m.ZodSymbol,
|
|
1546
1546
|
...v(t)
|
|
1547
1547
|
});
|
|
1548
|
-
class
|
|
1548
|
+
class Oe extends _ {
|
|
1549
1549
|
_parse(e) {
|
|
1550
1550
|
if (this._getType(e) !== p.undefined) {
|
|
1551
1551
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1555,14 +1555,14 @@ var us = wr((hs, gt) => {
|
|
|
1555
1555
|
received: n.parsedType
|
|
1556
1556
|
}), y;
|
|
1557
1557
|
}
|
|
1558
|
-
return
|
|
1558
|
+
return A(e.data);
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
|
|
1561
|
+
Oe.create = (t) => new Oe({
|
|
1562
1562
|
typeName: m.ZodUndefined,
|
|
1563
1563
|
...v(t)
|
|
1564
1564
|
});
|
|
1565
|
-
class
|
|
1565
|
+
class Ne extends _ {
|
|
1566
1566
|
_parse(e) {
|
|
1567
1567
|
if (this._getType(e) !== p.null) {
|
|
1568
1568
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1572,38 +1572,38 @@ var us = wr((hs, gt) => {
|
|
|
1572
1572
|
received: n.parsedType
|
|
1573
1573
|
}), y;
|
|
1574
1574
|
}
|
|
1575
|
-
return
|
|
1575
|
+
return A(e.data);
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
|
|
1578
|
+
Ne.create = (t) => new Ne({
|
|
1579
1579
|
typeName: m.ZodNull,
|
|
1580
1580
|
...v(t)
|
|
1581
1581
|
});
|
|
1582
|
-
class
|
|
1582
|
+
class ge extends _ {
|
|
1583
1583
|
constructor() {
|
|
1584
1584
|
super(...arguments), this._any = !0;
|
|
1585
1585
|
}
|
|
1586
1586
|
_parse(e) {
|
|
1587
|
-
return
|
|
1587
|
+
return A(e.data);
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
|
-
|
|
1590
|
+
ge.create = (t) => new ge({
|
|
1591
1591
|
typeName: m.ZodAny,
|
|
1592
1592
|
...v(t)
|
|
1593
1593
|
});
|
|
1594
|
-
class
|
|
1594
|
+
class ie extends _ {
|
|
1595
1595
|
constructor() {
|
|
1596
1596
|
super(...arguments), this._unknown = !0;
|
|
1597
1597
|
}
|
|
1598
1598
|
_parse(e) {
|
|
1599
|
-
return
|
|
1599
|
+
return A(e.data);
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
|
|
1602
|
+
ie.create = (t) => new ie({
|
|
1603
1603
|
typeName: m.ZodUnknown,
|
|
1604
1604
|
...v(t)
|
|
1605
1605
|
});
|
|
1606
|
-
class
|
|
1606
|
+
class W extends _ {
|
|
1607
1607
|
_parse(e) {
|
|
1608
1608
|
const r = this._getOrReturnCtx(e);
|
|
1609
1609
|
return f(r, {
|
|
@@ -1613,11 +1613,11 @@ var us = wr((hs, gt) => {
|
|
|
1613
1613
|
}), y;
|
|
1614
1614
|
}
|
|
1615
1615
|
}
|
|
1616
|
-
|
|
1616
|
+
W.create = (t) => new W({
|
|
1617
1617
|
typeName: m.ZodNever,
|
|
1618
1618
|
...v(t)
|
|
1619
1619
|
});
|
|
1620
|
-
class
|
|
1620
|
+
class Ye extends _ {
|
|
1621
1621
|
_parse(e) {
|
|
1622
1622
|
if (this._getType(e) !== p.undefined) {
|
|
1623
1623
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1627,14 +1627,14 @@ var us = wr((hs, gt) => {
|
|
|
1627
1627
|
received: n.parsedType
|
|
1628
1628
|
}), y;
|
|
1629
1629
|
}
|
|
1630
|
-
return
|
|
1630
|
+
return A(e.data);
|
|
1631
1631
|
}
|
|
1632
1632
|
}
|
|
1633
|
-
|
|
1633
|
+
Ye.create = (t) => new Ye({
|
|
1634
1634
|
typeName: m.ZodVoid,
|
|
1635
1635
|
...v(t)
|
|
1636
1636
|
});
|
|
1637
|
-
class
|
|
1637
|
+
class j extends _ {
|
|
1638
1638
|
_parse(e) {
|
|
1639
1639
|
const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
|
|
1640
1640
|
if (r.parsedType !== p.array)
|
|
@@ -1670,27 +1670,27 @@ var us = wr((hs, gt) => {
|
|
|
1670
1670
|
exact: !1,
|
|
1671
1671
|
message: s.maxLength.message
|
|
1672
1672
|
}), n.dirty()), r.common.async)
|
|
1673
|
-
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new
|
|
1674
|
-
const a = [...r.data].map((i, o) => s.type._parseSync(new
|
|
1675
|
-
return
|
|
1673
|
+
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new D(r, i, r.path, o)))).then((i) => O.mergeArray(n, i));
|
|
1674
|
+
const a = [...r.data].map((i, o) => s.type._parseSync(new D(r, i, r.path, o)));
|
|
1675
|
+
return O.mergeArray(n, a);
|
|
1676
1676
|
}
|
|
1677
1677
|
get element() {
|
|
1678
1678
|
return this._def.type;
|
|
1679
1679
|
}
|
|
1680
1680
|
min(e, r) {
|
|
1681
|
-
return new
|
|
1681
|
+
return new j({
|
|
1682
1682
|
...this._def,
|
|
1683
1683
|
minLength: { value: e, message: h.toString(r) }
|
|
1684
1684
|
});
|
|
1685
1685
|
}
|
|
1686
1686
|
max(e, r) {
|
|
1687
|
-
return new
|
|
1687
|
+
return new j({
|
|
1688
1688
|
...this._def,
|
|
1689
1689
|
maxLength: { value: e, message: h.toString(r) }
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
1692
|
length(e, r) {
|
|
1693
|
-
return new
|
|
1693
|
+
return new j({
|
|
1694
1694
|
...this._def,
|
|
1695
1695
|
exactLength: { value: e, message: h.toString(r) }
|
|
1696
1696
|
});
|
|
@@ -1699,7 +1699,7 @@ var us = wr((hs, gt) => {
|
|
|
1699
1699
|
return this.min(1, e);
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
|
|
1702
|
+
j.create = (t, e) => new j({
|
|
1703
1703
|
type: t,
|
|
1704
1704
|
minLength: null,
|
|
1705
1705
|
maxLength: null,
|
|
@@ -1707,23 +1707,23 @@ var us = wr((hs, gt) => {
|
|
|
1707
1707
|
typeName: m.ZodArray,
|
|
1708
1708
|
...v(e)
|
|
1709
1709
|
});
|
|
1710
|
-
function
|
|
1711
|
-
if (t instanceof
|
|
1710
|
+
function le(t) {
|
|
1711
|
+
if (t instanceof T) {
|
|
1712
1712
|
const e = {};
|
|
1713
1713
|
for (const r in t.shape) {
|
|
1714
1714
|
const n = t.shape[r];
|
|
1715
|
-
e[r] =
|
|
1715
|
+
e[r] = L.create(le(n));
|
|
1716
1716
|
}
|
|
1717
|
-
return new
|
|
1717
|
+
return new T({
|
|
1718
1718
|
...t._def,
|
|
1719
1719
|
shape: () => e
|
|
1720
1720
|
});
|
|
1721
|
-
} else return t instanceof
|
|
1721
|
+
} else return t instanceof j ? new j({
|
|
1722
1722
|
...t._def,
|
|
1723
|
-
type:
|
|
1724
|
-
}) : t instanceof
|
|
1723
|
+
type: le(t.element)
|
|
1724
|
+
}) : t instanceof L ? L.create(le(t.unwrap())) : t instanceof Q ? Q.create(le(t.unwrap())) : t instanceof V ? V.create(t.items.map((e) => le(e))) : t;
|
|
1725
1725
|
}
|
|
1726
|
-
class
|
|
1726
|
+
class T extends _ {
|
|
1727
1727
|
constructor() {
|
|
1728
1728
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1729
1729
|
}
|
|
@@ -1743,7 +1743,7 @@ var us = wr((hs, gt) => {
|
|
|
1743
1743
|
}), y;
|
|
1744
1744
|
}
|
|
1745
1745
|
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1746
|
-
if (!(this._def.catchall instanceof
|
|
1746
|
+
if (!(this._def.catchall instanceof W && this._def.unknownKeys === "strip"))
|
|
1747
1747
|
for (const d in s.data)
|
|
1748
1748
|
i.includes(d) || o.push(d);
|
|
1749
1749
|
const c = [];
|
|
@@ -1751,11 +1751,11 @@ var us = wr((hs, gt) => {
|
|
|
1751
1751
|
const u = a[d], w = s.data[d];
|
|
1752
1752
|
c.push({
|
|
1753
1753
|
key: { status: "valid", value: d },
|
|
1754
|
-
value: u._parse(new
|
|
1754
|
+
value: u._parse(new D(s, w, s.path, d)),
|
|
1755
1755
|
alwaysSet: d in s.data
|
|
1756
1756
|
});
|
|
1757
1757
|
}
|
|
1758
|
-
if (this._def.catchall instanceof
|
|
1758
|
+
if (this._def.catchall instanceof W) {
|
|
1759
1759
|
const d = this._def.unknownKeys;
|
|
1760
1760
|
if (d === "passthrough")
|
|
1761
1761
|
for (const u of o)
|
|
@@ -1776,7 +1776,7 @@ var us = wr((hs, gt) => {
|
|
|
1776
1776
|
c.push({
|
|
1777
1777
|
key: { status: "valid", value: u },
|
|
1778
1778
|
value: d._parse(
|
|
1779
|
-
new
|
|
1779
|
+
new D(s, w, s.path, u)
|
|
1780
1780
|
//, ctx.child(key), value, getParsedType(value)
|
|
1781
1781
|
),
|
|
1782
1782
|
alwaysSet: u in s.data
|
|
@@ -1794,13 +1794,13 @@ var us = wr((hs, gt) => {
|
|
|
1794
1794
|
});
|
|
1795
1795
|
}
|
|
1796
1796
|
return d;
|
|
1797
|
-
}).then((d) =>
|
|
1797
|
+
}).then((d) => O.mergeObjectSync(n, d)) : O.mergeObjectSync(n, c);
|
|
1798
1798
|
}
|
|
1799
1799
|
get shape() {
|
|
1800
1800
|
return this._def.shape();
|
|
1801
1801
|
}
|
|
1802
1802
|
strict(e) {
|
|
1803
|
-
return h.errToObj, new
|
|
1803
|
+
return h.errToObj, new T({
|
|
1804
1804
|
...this._def,
|
|
1805
1805
|
unknownKeys: "strict",
|
|
1806
1806
|
...e !== void 0 ? {
|
|
@@ -1817,13 +1817,13 @@ var us = wr((hs, gt) => {
|
|
|
1817
1817
|
});
|
|
1818
1818
|
}
|
|
1819
1819
|
strip() {
|
|
1820
|
-
return new
|
|
1820
|
+
return new T({
|
|
1821
1821
|
...this._def,
|
|
1822
1822
|
unknownKeys: "strip"
|
|
1823
1823
|
});
|
|
1824
1824
|
}
|
|
1825
1825
|
passthrough() {
|
|
1826
|
-
return new
|
|
1826
|
+
return new T({
|
|
1827
1827
|
...this._def,
|
|
1828
1828
|
unknownKeys: "passthrough"
|
|
1829
1829
|
});
|
|
@@ -1846,7 +1846,7 @@ var us = wr((hs, gt) => {
|
|
|
1846
1846
|
// }) as any;
|
|
1847
1847
|
// };
|
|
1848
1848
|
extend(e) {
|
|
1849
|
-
return new
|
|
1849
|
+
return new T({
|
|
1850
1850
|
...this._def,
|
|
1851
1851
|
shape: () => ({
|
|
1852
1852
|
...this._def.shape(),
|
|
@@ -1860,7 +1860,7 @@ var us = wr((hs, gt) => {
|
|
|
1860
1860
|
* upgrade if you are experiencing issues.
|
|
1861
1861
|
*/
|
|
1862
1862
|
merge(e) {
|
|
1863
|
-
return new
|
|
1863
|
+
return new T({
|
|
1864
1864
|
unknownKeys: e._def.unknownKeys,
|
|
1865
1865
|
catchall: e._def.catchall,
|
|
1866
1866
|
shape: () => ({
|
|
@@ -1930,7 +1930,7 @@ var us = wr((hs, gt) => {
|
|
|
1930
1930
|
// return merged;
|
|
1931
1931
|
// }
|
|
1932
1932
|
catchall(e) {
|
|
1933
|
-
return new
|
|
1933
|
+
return new T({
|
|
1934
1934
|
...this._def,
|
|
1935
1935
|
catchall: e
|
|
1936
1936
|
});
|
|
@@ -1939,7 +1939,7 @@ var us = wr((hs, gt) => {
|
|
|
1939
1939
|
const r = {};
|
|
1940
1940
|
return k.objectKeys(e).forEach((n) => {
|
|
1941
1941
|
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
1942
|
-
}), new
|
|
1942
|
+
}), new T({
|
|
1943
1943
|
...this._def,
|
|
1944
1944
|
shape: () => r
|
|
1945
1945
|
});
|
|
@@ -1948,7 +1948,7 @@ var us = wr((hs, gt) => {
|
|
|
1948
1948
|
const r = {};
|
|
1949
1949
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1950
1950
|
e[n] || (r[n] = this.shape[n]);
|
|
1951
|
-
}), new
|
|
1951
|
+
}), new T({
|
|
1952
1952
|
...this._def,
|
|
1953
1953
|
shape: () => r
|
|
1954
1954
|
});
|
|
@@ -1957,14 +1957,14 @@ var us = wr((hs, gt) => {
|
|
|
1957
1957
|
* @deprecated
|
|
1958
1958
|
*/
|
|
1959
1959
|
deepPartial() {
|
|
1960
|
-
return
|
|
1960
|
+
return le(this);
|
|
1961
1961
|
}
|
|
1962
1962
|
partial(e) {
|
|
1963
1963
|
const r = {};
|
|
1964
1964
|
return k.objectKeys(this.shape).forEach((n) => {
|
|
1965
1965
|
const s = this.shape[n];
|
|
1966
1966
|
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
1967
|
-
}), new
|
|
1967
|
+
}), new T({
|
|
1968
1968
|
...this._def,
|
|
1969
1969
|
shape: () => r
|
|
1970
1970
|
});
|
|
@@ -1976,41 +1976,41 @@ var us = wr((hs, gt) => {
|
|
|
1976
1976
|
r[n] = this.shape[n];
|
|
1977
1977
|
else {
|
|
1978
1978
|
let a = this.shape[n];
|
|
1979
|
-
for (; a instanceof
|
|
1979
|
+
for (; a instanceof L; )
|
|
1980
1980
|
a = a._def.innerType;
|
|
1981
1981
|
r[n] = a;
|
|
1982
1982
|
}
|
|
1983
|
-
}), new
|
|
1983
|
+
}), new T({
|
|
1984
1984
|
...this._def,
|
|
1985
1985
|
shape: () => r
|
|
1986
1986
|
});
|
|
1987
1987
|
}
|
|
1988
1988
|
keyof() {
|
|
1989
|
-
return
|
|
1989
|
+
return Ft(k.objectKeys(this.shape));
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
|
|
1992
|
+
T.create = (t, e) => new T({
|
|
1993
1993
|
shape: () => t,
|
|
1994
1994
|
unknownKeys: "strip",
|
|
1995
|
-
catchall:
|
|
1995
|
+
catchall: W.create(),
|
|
1996
1996
|
typeName: m.ZodObject,
|
|
1997
1997
|
...v(e)
|
|
1998
1998
|
});
|
|
1999
|
-
|
|
1999
|
+
T.strictCreate = (t, e) => new T({
|
|
2000
2000
|
shape: () => t,
|
|
2001
2001
|
unknownKeys: "strict",
|
|
2002
|
-
catchall:
|
|
2002
|
+
catchall: W.create(),
|
|
2003
2003
|
typeName: m.ZodObject,
|
|
2004
2004
|
...v(e)
|
|
2005
2005
|
});
|
|
2006
|
-
|
|
2006
|
+
T.lazycreate = (t, e) => new T({
|
|
2007
2007
|
shape: t,
|
|
2008
2008
|
unknownKeys: "strip",
|
|
2009
|
-
catchall:
|
|
2009
|
+
catchall: W.create(),
|
|
2010
2010
|
typeName: m.ZodObject,
|
|
2011
2011
|
...v(e)
|
|
2012
2012
|
});
|
|
2013
|
-
class
|
|
2013
|
+
class Re extends _ {
|
|
2014
2014
|
_parse(e) {
|
|
2015
2015
|
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
2016
2016
|
function s(a) {
|
|
@@ -2020,7 +2020,7 @@ var us = wr((hs, gt) => {
|
|
|
2020
2020
|
for (const o of a)
|
|
2021
2021
|
if (o.result.status === "dirty")
|
|
2022
2022
|
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2023
|
-
const i = a.map((o) => new
|
|
2023
|
+
const i = a.map((o) => new C(o.ctx.common.issues));
|
|
2024
2024
|
return f(r, {
|
|
2025
2025
|
code: l.invalid_union,
|
|
2026
2026
|
unionErrors: i
|
|
@@ -2067,7 +2067,7 @@ var us = wr((hs, gt) => {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
if (a)
|
|
2069
2069
|
return r.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2070
|
-
const o = i.map((c) => new
|
|
2070
|
+
const o = i.map((c) => new C(c));
|
|
2071
2071
|
return f(r, {
|
|
2072
2072
|
code: l.invalid_union,
|
|
2073
2073
|
unionErrors: o
|
|
@@ -2078,13 +2078,13 @@ var us = wr((hs, gt) => {
|
|
|
2078
2078
|
return this._def.options;
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
|
-
|
|
2081
|
+
Re.create = (t, e) => new Re({
|
|
2082
2082
|
options: t,
|
|
2083
2083
|
typeName: m.ZodUnion,
|
|
2084
2084
|
...v(e)
|
|
2085
2085
|
});
|
|
2086
|
-
const
|
|
2087
|
-
class
|
|
2086
|
+
const U = (t) => t instanceof Ce ? U(t.schema) : t instanceof $ ? U(t.innerType()) : t instanceof Ie ? [t.value] : t instanceof X ? t.options : t instanceof Ze ? k.objectValues(t.enum) : t instanceof je ? U(t._def.innerType) : t instanceof Oe ? [void 0] : t instanceof Ne ? [null] : t instanceof L ? [void 0, ...U(t.unwrap())] : t instanceof Q ? [null, ...U(t.unwrap())] : t instanceof yt || t instanceof Fe ? U(t.unwrap()) : t instanceof $e ? U(t._def.innerType) : [];
|
|
2087
|
+
class et extends _ {
|
|
2088
2088
|
_parse(e) {
|
|
2089
2089
|
const { ctx: r } = this._processInputParams(e);
|
|
2090
2090
|
if (r.parsedType !== p.object)
|
|
@@ -2128,7 +2128,7 @@ var us = wr((hs, gt) => {
|
|
|
2128
2128
|
static create(e, r, n) {
|
|
2129
2129
|
const s = /* @__PURE__ */ new Map();
|
|
2130
2130
|
for (const a of r) {
|
|
2131
|
-
const i =
|
|
2131
|
+
const i = U(a.shape[e]);
|
|
2132
2132
|
if (!i.length)
|
|
2133
2133
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2134
2134
|
for (const o of i) {
|
|
@@ -2137,7 +2137,7 @@ var us = wr((hs, gt) => {
|
|
|
2137
2137
|
s.set(o, a);
|
|
2138
2138
|
}
|
|
2139
2139
|
}
|
|
2140
|
-
return new
|
|
2140
|
+
return new et({
|
|
2141
2141
|
typeName: m.ZodDiscriminatedUnion,
|
|
2142
2142
|
discriminator: e,
|
|
2143
2143
|
options: r,
|
|
@@ -2146,14 +2146,14 @@ var us = wr((hs, gt) => {
|
|
|
2146
2146
|
});
|
|
2147
2147
|
}
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2150
|
-
const r =
|
|
2149
|
+
function dt(t, e) {
|
|
2150
|
+
const r = B(t), n = B(e);
|
|
2151
2151
|
if (t === e)
|
|
2152
2152
|
return { valid: !0, data: t };
|
|
2153
2153
|
if (r === p.object && n === p.object) {
|
|
2154
2154
|
const s = k.objectKeys(e), a = k.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2155
2155
|
for (const o of a) {
|
|
2156
|
-
const c =
|
|
2156
|
+
const c = dt(t[o], e[o]);
|
|
2157
2157
|
if (!c.valid)
|
|
2158
2158
|
return { valid: !1 };
|
|
2159
2159
|
i[o] = c.data;
|
|
@@ -2164,7 +2164,7 @@ var us = wr((hs, gt) => {
|
|
|
2164
2164
|
return { valid: !1 };
|
|
2165
2165
|
const s = [];
|
|
2166
2166
|
for (let a = 0; a < t.length; a++) {
|
|
2167
|
-
const i = t[a], o = e[a], c =
|
|
2167
|
+
const i = t[a], o = e[a], c = dt(i, o);
|
|
2168
2168
|
if (!c.valid)
|
|
2169
2169
|
return { valid: !1 };
|
|
2170
2170
|
s.push(c.data);
|
|
@@ -2172,13 +2172,13 @@ var us = wr((hs, gt) => {
|
|
|
2172
2172
|
return { valid: !0, data: s };
|
|
2173
2173
|
} else return r === p.date && n === p.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2174
2174
|
}
|
|
2175
|
-
class
|
|
2175
|
+
class Ae extends _ {
|
|
2176
2176
|
_parse(e) {
|
|
2177
2177
|
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2178
|
-
if (
|
|
2178
|
+
if (ot(a) || ot(i))
|
|
2179
2179
|
return y;
|
|
2180
|
-
const o =
|
|
2181
|
-
return o.valid ? ((
|
|
2180
|
+
const o = dt(a.value, i.value);
|
|
2181
|
+
return o.valid ? ((ct(a) || ct(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2182
2182
|
code: l.invalid_intersection_types
|
|
2183
2183
|
}), y);
|
|
2184
2184
|
};
|
|
@@ -2204,13 +2204,13 @@ var us = wr((hs, gt) => {
|
|
|
2204
2204
|
}));
|
|
2205
2205
|
}
|
|
2206
2206
|
}
|
|
2207
|
-
|
|
2207
|
+
Ae.create = (t, e, r) => new Ae({
|
|
2208
2208
|
left: t,
|
|
2209
2209
|
right: e,
|
|
2210
2210
|
typeName: m.ZodIntersection,
|
|
2211
2211
|
...v(r)
|
|
2212
2212
|
});
|
|
2213
|
-
class
|
|
2213
|
+
class V extends _ {
|
|
2214
2214
|
_parse(e) {
|
|
2215
2215
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2216
2216
|
if (n.parsedType !== p.array)
|
|
@@ -2236,31 +2236,31 @@ var us = wr((hs, gt) => {
|
|
|
2236
2236
|
}), r.dirty());
|
|
2237
2237
|
const a = [...n.data].map((i, o) => {
|
|
2238
2238
|
const c = this._def.items[o] || this._def.rest;
|
|
2239
|
-
return c ? c._parse(new
|
|
2239
|
+
return c ? c._parse(new D(n, i, n.path, o)) : null;
|
|
2240
2240
|
}).filter((i) => !!i);
|
|
2241
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2241
|
+
return n.common.async ? Promise.all(a).then((i) => O.mergeArray(r, i)) : O.mergeArray(r, a);
|
|
2242
2242
|
}
|
|
2243
2243
|
get items() {
|
|
2244
2244
|
return this._def.items;
|
|
2245
2245
|
}
|
|
2246
2246
|
rest(e) {
|
|
2247
|
-
return new
|
|
2247
|
+
return new V({
|
|
2248
2248
|
...this._def,
|
|
2249
2249
|
rest: e
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
2252
|
}
|
|
2253
|
-
|
|
2253
|
+
V.create = (t, e) => {
|
|
2254
2254
|
if (!Array.isArray(t))
|
|
2255
2255
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2256
|
-
return new
|
|
2256
|
+
return new V({
|
|
2257
2257
|
items: t,
|
|
2258
2258
|
typeName: m.ZodTuple,
|
|
2259
2259
|
rest: null,
|
|
2260
2260
|
...v(e)
|
|
2261
2261
|
});
|
|
2262
2262
|
};
|
|
2263
|
-
class
|
|
2263
|
+
class Pe extends _ {
|
|
2264
2264
|
get keySchema() {
|
|
2265
2265
|
return this._def.keyType;
|
|
2266
2266
|
}
|
|
@@ -2278,30 +2278,30 @@ var us = wr((hs, gt) => {
|
|
|
2278
2278
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2279
2279
|
for (const o in n.data)
|
|
2280
2280
|
s.push({
|
|
2281
|
-
key: a._parse(new
|
|
2282
|
-
value: i._parse(new
|
|
2281
|
+
key: a._parse(new D(n, o, n.path, o)),
|
|
2282
|
+
value: i._parse(new D(n, n.data[o], n.path, o)),
|
|
2283
2283
|
alwaysSet: o in n.data
|
|
2284
2284
|
});
|
|
2285
|
-
return n.common.async ?
|
|
2285
|
+
return n.common.async ? O.mergeObjectAsync(r, s) : O.mergeObjectSync(r, s);
|
|
2286
2286
|
}
|
|
2287
2287
|
get element() {
|
|
2288
2288
|
return this._def.valueType;
|
|
2289
2289
|
}
|
|
2290
2290
|
static create(e, r, n) {
|
|
2291
|
-
return r instanceof _ ? new
|
|
2291
|
+
return r instanceof _ ? new Pe({
|
|
2292
2292
|
keyType: e,
|
|
2293
2293
|
valueType: r,
|
|
2294
2294
|
typeName: m.ZodRecord,
|
|
2295
2295
|
...v(n)
|
|
2296
|
-
}) : new
|
|
2297
|
-
keyType:
|
|
2296
|
+
}) : new Pe({
|
|
2297
|
+
keyType: Z.create(),
|
|
2298
2298
|
valueType: e,
|
|
2299
2299
|
typeName: m.ZodRecord,
|
|
2300
2300
|
...v(r)
|
|
2301
2301
|
});
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
class
|
|
2304
|
+
class Ke extends _ {
|
|
2305
2305
|
get keySchema() {
|
|
2306
2306
|
return this._def.keyType;
|
|
2307
2307
|
}
|
|
@@ -2317,8 +2317,8 @@ var us = wr((hs, gt) => {
|
|
|
2317
2317
|
received: n.parsedType
|
|
2318
2318
|
}), y;
|
|
2319
2319
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, c], d) => ({
|
|
2320
|
-
key: s._parse(new
|
|
2321
|
-
value: a._parse(new
|
|
2320
|
+
key: s._parse(new D(n, o, n.path, [d, "key"])),
|
|
2321
|
+
value: a._parse(new D(n, c, n.path, [d, "value"]))
|
|
2322
2322
|
}));
|
|
2323
2323
|
if (n.common.async) {
|
|
2324
2324
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2343,13 +2343,13 @@ var us = wr((hs, gt) => {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
|
|
2346
|
+
Ke.create = (t, e, r) => new Ke({
|
|
2347
2347
|
valueType: e,
|
|
2348
2348
|
keyType: t,
|
|
2349
2349
|
typeName: m.ZodMap,
|
|
2350
2350
|
...v(r)
|
|
2351
2351
|
});
|
|
2352
|
-
class
|
|
2352
|
+
class de extends _ {
|
|
2353
2353
|
_parse(e) {
|
|
2354
2354
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2355
2355
|
if (n.parsedType !== p.set)
|
|
@@ -2384,17 +2384,17 @@ var us = wr((hs, gt) => {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
return { status: r.value, value: d };
|
|
2386
2386
|
}
|
|
2387
|
-
const o = [...n.data.values()].map((c, d) => a._parse(new
|
|
2387
|
+
const o = [...n.data.values()].map((c, d) => a._parse(new D(n, c, n.path, d)));
|
|
2388
2388
|
return n.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2389
2389
|
}
|
|
2390
2390
|
min(e, r) {
|
|
2391
|
-
return new
|
|
2391
|
+
return new de({
|
|
2392
2392
|
...this._def,
|
|
2393
2393
|
minSize: { value: e, message: h.toString(r) }
|
|
2394
2394
|
});
|
|
2395
2395
|
}
|
|
2396
2396
|
max(e, r) {
|
|
2397
|
-
return new
|
|
2397
|
+
return new de({
|
|
2398
2398
|
...this._def,
|
|
2399
2399
|
maxSize: { value: e, message: h.toString(r) }
|
|
2400
2400
|
});
|
|
@@ -2406,14 +2406,14 @@ var us = wr((hs, gt) => {
|
|
|
2406
2406
|
return this.min(1, e);
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
2409
|
-
|
|
2409
|
+
de.create = (t, e) => new de({
|
|
2410
2410
|
valueType: t,
|
|
2411
2411
|
minSize: null,
|
|
2412
2412
|
maxSize: null,
|
|
2413
2413
|
typeName: m.ZodSet,
|
|
2414
2414
|
...v(e)
|
|
2415
2415
|
});
|
|
2416
|
-
class
|
|
2416
|
+
class me extends _ {
|
|
2417
2417
|
constructor() {
|
|
2418
2418
|
super(...arguments), this.validate = this.implement;
|
|
2419
2419
|
}
|
|
@@ -2426,14 +2426,14 @@ var us = wr((hs, gt) => {
|
|
|
2426
2426
|
received: r.parsedType
|
|
2427
2427
|
}), y;
|
|
2428
2428
|
function n(o, c) {
|
|
2429
|
-
return
|
|
2429
|
+
return He({
|
|
2430
2430
|
data: o,
|
|
2431
2431
|
path: r.path,
|
|
2432
2432
|
errorMaps: [
|
|
2433
2433
|
r.common.contextualErrorMap,
|
|
2434
2434
|
r.schemaErrorMap,
|
|
2435
|
-
|
|
2436
|
-
|
|
2435
|
+
Be(),
|
|
2436
|
+
ye
|
|
2437
2437
|
].filter((d) => !!d),
|
|
2438
2438
|
issueData: {
|
|
2439
2439
|
code: l.invalid_arguments,
|
|
@@ -2442,14 +2442,14 @@ var us = wr((hs, gt) => {
|
|
|
2442
2442
|
});
|
|
2443
2443
|
}
|
|
2444
2444
|
function s(o, c) {
|
|
2445
|
-
return
|
|
2445
|
+
return He({
|
|
2446
2446
|
data: o,
|
|
2447
2447
|
path: r.path,
|
|
2448
2448
|
errorMaps: [
|
|
2449
2449
|
r.common.contextualErrorMap,
|
|
2450
2450
|
r.schemaErrorMap,
|
|
2451
|
-
|
|
2452
|
-
|
|
2451
|
+
Be(),
|
|
2452
|
+
ye
|
|
2453
2453
|
].filter((d) => !!d),
|
|
2454
2454
|
issueData: {
|
|
2455
2455
|
code: l.invalid_return_type,
|
|
@@ -2458,25 +2458,25 @@ var us = wr((hs, gt) => {
|
|
|
2458
2458
|
});
|
|
2459
2459
|
}
|
|
2460
2460
|
const a = { errorMap: r.common.contextualErrorMap }, i = r.data;
|
|
2461
|
-
if (this._def.returns instanceof
|
|
2461
|
+
if (this._def.returns instanceof ve) {
|
|
2462
2462
|
const o = this;
|
|
2463
|
-
return
|
|
2464
|
-
const d = new
|
|
2465
|
-
throw d.addIssue(n(c,
|
|
2463
|
+
return A(async function(...c) {
|
|
2464
|
+
const d = new C([]), u = await o._def.args.parseAsync(c, a).catch((P) => {
|
|
2465
|
+
throw d.addIssue(n(c, P)), d;
|
|
2466
2466
|
}), w = await Reflect.apply(i, this, u);
|
|
2467
|
-
return await o._def.returns._def.type.parseAsync(w, a).catch((
|
|
2468
|
-
throw d.addIssue(s(w,
|
|
2467
|
+
return await o._def.returns._def.type.parseAsync(w, a).catch((P) => {
|
|
2468
|
+
throw d.addIssue(s(w, P)), d;
|
|
2469
2469
|
});
|
|
2470
2470
|
});
|
|
2471
2471
|
} else {
|
|
2472
2472
|
const o = this;
|
|
2473
|
-
return
|
|
2473
|
+
return A(function(...c) {
|
|
2474
2474
|
const d = o._def.args.safeParse(c, a);
|
|
2475
2475
|
if (!d.success)
|
|
2476
|
-
throw new
|
|
2476
|
+
throw new C([n(c, d.error)]);
|
|
2477
2477
|
const u = Reflect.apply(i, this, d.data), w = o._def.returns.safeParse(u, a);
|
|
2478
2478
|
if (!w.success)
|
|
2479
|
-
throw new
|
|
2479
|
+
throw new C([s(u, w.error)]);
|
|
2480
2480
|
return w.data;
|
|
2481
2481
|
});
|
|
2482
2482
|
}
|
|
@@ -2488,13 +2488,13 @@ var us = wr((hs, gt) => {
|
|
|
2488
2488
|
return this._def.returns;
|
|
2489
2489
|
}
|
|
2490
2490
|
args(...e) {
|
|
2491
|
-
return new
|
|
2491
|
+
return new me({
|
|
2492
2492
|
...this._def,
|
|
2493
|
-
args:
|
|
2493
|
+
args: V.create(e).rest(ie.create())
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
2496
|
returns(e) {
|
|
2497
|
-
return new
|
|
2497
|
+
return new me({
|
|
2498
2498
|
...this._def,
|
|
2499
2499
|
returns: e
|
|
2500
2500
|
});
|
|
@@ -2506,15 +2506,15 @@ var us = wr((hs, gt) => {
|
|
|
2506
2506
|
return this.parse(e);
|
|
2507
2507
|
}
|
|
2508
2508
|
static create(e, r, n) {
|
|
2509
|
-
return new
|
|
2510
|
-
args: e ||
|
|
2511
|
-
returns: r ||
|
|
2509
|
+
return new me({
|
|
2510
|
+
args: e || V.create([]).rest(ie.create()),
|
|
2511
|
+
returns: r || ie.create(),
|
|
2512
2512
|
typeName: m.ZodFunction,
|
|
2513
2513
|
...v(n)
|
|
2514
2514
|
});
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
|
-
class
|
|
2517
|
+
class Ce extends _ {
|
|
2518
2518
|
get schema() {
|
|
2519
2519
|
return this._def.getter();
|
|
2520
2520
|
}
|
|
@@ -2523,12 +2523,12 @@ var us = wr((hs, gt) => {
|
|
|
2523
2523
|
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2524
2524
|
}
|
|
2525
2525
|
}
|
|
2526
|
-
|
|
2526
|
+
Ce.create = (t, e) => new Ce({
|
|
2527
2527
|
getter: t,
|
|
2528
2528
|
typeName: m.ZodLazy,
|
|
2529
2529
|
...v(e)
|
|
2530
2530
|
});
|
|
2531
|
-
class
|
|
2531
|
+
class Ie extends _ {
|
|
2532
2532
|
_parse(e) {
|
|
2533
2533
|
if (e.data !== this._def.value) {
|
|
2534
2534
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2544,12 +2544,12 @@ var us = wr((hs, gt) => {
|
|
|
2544
2544
|
return this._def.value;
|
|
2545
2545
|
}
|
|
2546
2546
|
}
|
|
2547
|
-
|
|
2547
|
+
Ie.create = (t, e) => new Ie({
|
|
2548
2548
|
value: t,
|
|
2549
2549
|
typeName: m.ZodLiteral,
|
|
2550
2550
|
...v(e)
|
|
2551
2551
|
});
|
|
2552
|
-
function
|
|
2552
|
+
function Ft(t, e) {
|
|
2553
2553
|
return new X({
|
|
2554
2554
|
values: t,
|
|
2555
2555
|
typeName: m.ZodEnum,
|
|
@@ -2558,7 +2558,7 @@ var us = wr((hs, gt) => {
|
|
|
2558
2558
|
}
|
|
2559
2559
|
class X extends _ {
|
|
2560
2560
|
constructor() {
|
|
2561
|
-
super(...arguments),
|
|
2561
|
+
super(...arguments), xe.set(this, void 0);
|
|
2562
2562
|
}
|
|
2563
2563
|
_parse(e) {
|
|
2564
2564
|
if (typeof e.data != "string") {
|
|
@@ -2569,7 +2569,7 @@ var us = wr((hs, gt) => {
|
|
|
2569
2569
|
code: l.invalid_type
|
|
2570
2570
|
}), y;
|
|
2571
2571
|
}
|
|
2572
|
-
if (
|
|
2572
|
+
if (We(this, xe) || It(this, xe, new Set(this._def.values)), !We(this, xe).has(e.data)) {
|
|
2573
2573
|
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2574
2574
|
return f(r, {
|
|
2575
2575
|
received: r.data,
|
|
@@ -2577,7 +2577,7 @@ var us = wr((hs, gt) => {
|
|
|
2577
2577
|
options: n
|
|
2578
2578
|
}), y;
|
|
2579
2579
|
}
|
|
2580
|
-
return
|
|
2580
|
+
return A(e.data);
|
|
2581
2581
|
}
|
|
2582
2582
|
get options() {
|
|
2583
2583
|
return this._def.values;
|
|
@@ -2613,11 +2613,11 @@ var us = wr((hs, gt) => {
|
|
|
2613
2613
|
});
|
|
2614
2614
|
}
|
|
2615
2615
|
}
|
|
2616
|
-
|
|
2617
|
-
X.create =
|
|
2618
|
-
class
|
|
2616
|
+
xe = /* @__PURE__ */ new WeakMap();
|
|
2617
|
+
X.create = Ft;
|
|
2618
|
+
class Ze extends _ {
|
|
2619
2619
|
constructor() {
|
|
2620
|
-
super(...arguments),
|
|
2620
|
+
super(...arguments), Se.set(this, void 0);
|
|
2621
2621
|
}
|
|
2622
2622
|
_parse(e) {
|
|
2623
2623
|
const r = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2629,7 +2629,7 @@ var us = wr((hs, gt) => {
|
|
|
2629
2629
|
code: l.invalid_type
|
|
2630
2630
|
}), y;
|
|
2631
2631
|
}
|
|
2632
|
-
if (
|
|
2632
|
+
if (We(this, Se) || It(this, Se, new Set(k.getValidEnumValues(this._def.values))), !We(this, Se).has(e.data)) {
|
|
2633
2633
|
const s = k.objectValues(r);
|
|
2634
2634
|
return f(n, {
|
|
2635
2635
|
received: n.data,
|
|
@@ -2637,19 +2637,19 @@ var us = wr((hs, gt) => {
|
|
|
2637
2637
|
options: s
|
|
2638
2638
|
}), y;
|
|
2639
2639
|
}
|
|
2640
|
-
return
|
|
2640
|
+
return A(e.data);
|
|
2641
2641
|
}
|
|
2642
2642
|
get enum() {
|
|
2643
2643
|
return this._def.values;
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2646
|
+
Se = /* @__PURE__ */ new WeakMap();
|
|
2647
|
+
Ze.create = (t, e) => new Ze({
|
|
2648
2648
|
values: t,
|
|
2649
2649
|
typeName: m.ZodNativeEnum,
|
|
2650
2650
|
...v(e)
|
|
2651
2651
|
});
|
|
2652
|
-
class
|
|
2652
|
+
class ve extends _ {
|
|
2653
2653
|
unwrap() {
|
|
2654
2654
|
return this._def.type;
|
|
2655
2655
|
}
|
|
@@ -2662,18 +2662,18 @@ var us = wr((hs, gt) => {
|
|
|
2662
2662
|
received: r.parsedType
|
|
2663
2663
|
}), y;
|
|
2664
2664
|
const n = r.parsedType === p.promise ? r.data : Promise.resolve(r.data);
|
|
2665
|
-
return
|
|
2665
|
+
return A(n.then((s) => this._def.type.parseAsync(s, {
|
|
2666
2666
|
path: r.path,
|
|
2667
2667
|
errorMap: r.common.contextualErrorMap
|
|
2668
2668
|
})));
|
|
2669
2669
|
}
|
|
2670
2670
|
}
|
|
2671
|
-
|
|
2671
|
+
ve.create = (t, e) => new ve({
|
|
2672
2672
|
type: t,
|
|
2673
2673
|
typeName: m.ZodPromise,
|
|
2674
2674
|
...v(e)
|
|
2675
2675
|
});
|
|
2676
|
-
class
|
|
2676
|
+
class $ extends _ {
|
|
2677
2677
|
innerType() {
|
|
2678
2678
|
return this._def.schema;
|
|
2679
2679
|
}
|
|
@@ -2700,7 +2700,7 @@ var us = wr((hs, gt) => {
|
|
|
2700
2700
|
path: n.path,
|
|
2701
2701
|
parent: n
|
|
2702
2702
|
});
|
|
2703
|
-
return c.status === "aborted" ? y : c.status === "dirty" || r.value === "dirty" ?
|
|
2703
|
+
return c.status === "aborted" ? y : c.status === "dirty" || r.value === "dirty" ? he(c.value) : c;
|
|
2704
2704
|
});
|
|
2705
2705
|
{
|
|
2706
2706
|
if (r.value === "aborted")
|
|
@@ -2710,7 +2710,7 @@ var us = wr((hs, gt) => {
|
|
|
2710
2710
|
path: n.path,
|
|
2711
2711
|
parent: n
|
|
2712
2712
|
});
|
|
2713
|
-
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ?
|
|
2713
|
+
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ? he(o.value) : o;
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
if (s.type === "refinement") {
|
|
@@ -2739,45 +2739,45 @@ var us = wr((hs, gt) => {
|
|
|
2739
2739
|
path: n.path,
|
|
2740
2740
|
parent: n
|
|
2741
2741
|
});
|
|
2742
|
-
if (!
|
|
2742
|
+
if (!oe(i))
|
|
2743
2743
|
return i;
|
|
2744
2744
|
const o = s.transform(i.value, a);
|
|
2745
2745
|
if (o instanceof Promise)
|
|
2746
2746
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2747
2747
|
return { status: r.value, value: o };
|
|
2748
2748
|
} else
|
|
2749
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2749
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => oe(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: r.value, value: o })) : i);
|
|
2750
2750
|
k.assertNever(s);
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
|
-
|
|
2753
|
+
$.create = (t, e, r) => new $({
|
|
2754
2754
|
schema: t,
|
|
2755
2755
|
typeName: m.ZodEffects,
|
|
2756
2756
|
effect: e,
|
|
2757
2757
|
...v(r)
|
|
2758
2758
|
});
|
|
2759
|
-
|
|
2759
|
+
$.createWithPreprocess = (t, e, r) => new $({
|
|
2760
2760
|
schema: e,
|
|
2761
2761
|
effect: { type: "preprocess", transform: t },
|
|
2762
2762
|
typeName: m.ZodEffects,
|
|
2763
2763
|
...v(r)
|
|
2764
2764
|
});
|
|
2765
|
-
class
|
|
2765
|
+
class L extends _ {
|
|
2766
2766
|
_parse(e) {
|
|
2767
|
-
return this._getType(e) === p.undefined ?
|
|
2767
|
+
return this._getType(e) === p.undefined ? A(void 0) : this._def.innerType._parse(e);
|
|
2768
2768
|
}
|
|
2769
2769
|
unwrap() {
|
|
2770
2770
|
return this._def.innerType;
|
|
2771
2771
|
}
|
|
2772
2772
|
}
|
|
2773
|
-
|
|
2773
|
+
L.create = (t, e) => new L({
|
|
2774
2774
|
innerType: t,
|
|
2775
2775
|
typeName: m.ZodOptional,
|
|
2776
2776
|
...v(e)
|
|
2777
2777
|
});
|
|
2778
2778
|
class Q extends _ {
|
|
2779
2779
|
_parse(e) {
|
|
2780
|
-
return this._getType(e) === p.null ?
|
|
2780
|
+
return this._getType(e) === p.null ? A(null) : this._def.innerType._parse(e);
|
|
2781
2781
|
}
|
|
2782
2782
|
unwrap() {
|
|
2783
2783
|
return this._def.innerType;
|
|
@@ -2788,7 +2788,7 @@ var us = wr((hs, gt) => {
|
|
|
2788
2788
|
typeName: m.ZodNullable,
|
|
2789
2789
|
...v(e)
|
|
2790
2790
|
});
|
|
2791
|
-
class
|
|
2791
|
+
class je extends _ {
|
|
2792
2792
|
_parse(e) {
|
|
2793
2793
|
const { ctx: r } = this._processInputParams(e);
|
|
2794
2794
|
let n = r.data;
|
|
@@ -2802,13 +2802,13 @@ var us = wr((hs, gt) => {
|
|
|
2802
2802
|
return this._def.innerType;
|
|
2803
2803
|
}
|
|
2804
2804
|
}
|
|
2805
|
-
|
|
2805
|
+
je.create = (t, e) => new je({
|
|
2806
2806
|
innerType: t,
|
|
2807
2807
|
typeName: m.ZodDefault,
|
|
2808
2808
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2809
2809
|
...v(e)
|
|
2810
2810
|
});
|
|
2811
|
-
class
|
|
2811
|
+
class $e extends _ {
|
|
2812
2812
|
_parse(e) {
|
|
2813
2813
|
const { ctx: r } = this._processInputParams(e), n = {
|
|
2814
2814
|
...r,
|
|
@@ -2823,11 +2823,11 @@ var us = wr((hs, gt) => {
|
|
|
2823
2823
|
...n
|
|
2824
2824
|
}
|
|
2825
2825
|
});
|
|
2826
|
-
return
|
|
2826
|
+
return Te(s) ? s.then((a) => ({
|
|
2827
2827
|
status: "valid",
|
|
2828
2828
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2829
2829
|
get error() {
|
|
2830
|
-
return new
|
|
2830
|
+
return new C(n.common.issues);
|
|
2831
2831
|
},
|
|
2832
2832
|
input: n.data
|
|
2833
2833
|
})
|
|
@@ -2835,7 +2835,7 @@ var us = wr((hs, gt) => {
|
|
|
2835
2835
|
status: "valid",
|
|
2836
2836
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2837
2837
|
get error() {
|
|
2838
|
-
return new
|
|
2838
|
+
return new C(n.common.issues);
|
|
2839
2839
|
},
|
|
2840
2840
|
input: n.data
|
|
2841
2841
|
})
|
|
@@ -2845,13 +2845,13 @@ var us = wr((hs, gt) => {
|
|
|
2845
2845
|
return this._def.innerType;
|
|
2846
2846
|
}
|
|
2847
2847
|
}
|
|
2848
|
-
|
|
2848
|
+
$e.create = (t, e) => new $e({
|
|
2849
2849
|
innerType: t,
|
|
2850
2850
|
typeName: m.ZodCatch,
|
|
2851
2851
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2852
2852
|
...v(e)
|
|
2853
2853
|
});
|
|
2854
|
-
class
|
|
2854
|
+
class Ge extends _ {
|
|
2855
2855
|
_parse(e) {
|
|
2856
2856
|
if (this._getType(e) !== p.nan) {
|
|
2857
2857
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2864,12 +2864,12 @@ var us = wr((hs, gt) => {
|
|
|
2864
2864
|
return { status: "valid", value: e.data };
|
|
2865
2865
|
}
|
|
2866
2866
|
}
|
|
2867
|
-
|
|
2867
|
+
Ge.create = (t) => new Ge({
|
|
2868
2868
|
typeName: m.ZodNaN,
|
|
2869
2869
|
...v(t)
|
|
2870
2870
|
});
|
|
2871
|
-
const
|
|
2872
|
-
class
|
|
2871
|
+
const Wr = Symbol("zod_brand");
|
|
2872
|
+
class yt extends _ {
|
|
2873
2873
|
_parse(e) {
|
|
2874
2874
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
2875
2875
|
return this._def.type._parse({
|
|
@@ -2882,7 +2882,7 @@ var us = wr((hs, gt) => {
|
|
|
2882
2882
|
return this._def.type;
|
|
2883
2883
|
}
|
|
2884
2884
|
}
|
|
2885
|
-
class
|
|
2885
|
+
class Me extends _ {
|
|
2886
2886
|
_parse(e) {
|
|
2887
2887
|
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2888
2888
|
if (n.common.async)
|
|
@@ -2892,7 +2892,7 @@ var us = wr((hs, gt) => {
|
|
|
2892
2892
|
path: n.path,
|
|
2893
2893
|
parent: n
|
|
2894
2894
|
});
|
|
2895
|
-
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(),
|
|
2895
|
+
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(), he(a.value)) : this._def.out._parseAsync({
|
|
2896
2896
|
data: a.value,
|
|
2897
2897
|
path: n.path,
|
|
2898
2898
|
parent: n
|
|
@@ -2915,201 +2915,201 @@ var us = wr((hs, gt) => {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
}
|
|
2917
2917
|
static create(e, r) {
|
|
2918
|
-
return new
|
|
2918
|
+
return new Me({
|
|
2919
2919
|
in: e,
|
|
2920
2920
|
out: r,
|
|
2921
2921
|
typeName: m.ZodPipeline
|
|
2922
2922
|
});
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
|
-
class
|
|
2925
|
+
class Fe extends _ {
|
|
2926
2926
|
_parse(e) {
|
|
2927
|
-
const r = this._def.innerType._parse(e), n = (s) => (
|
|
2928
|
-
return
|
|
2927
|
+
const r = this._def.innerType._parse(e), n = (s) => (oe(s) && (s.value = Object.freeze(s.value)), s);
|
|
2928
|
+
return Te(r) ? r.then((s) => n(s)) : n(r);
|
|
2929
2929
|
}
|
|
2930
2930
|
unwrap() {
|
|
2931
2931
|
return this._def.innerType;
|
|
2932
2932
|
}
|
|
2933
2933
|
}
|
|
2934
|
-
|
|
2934
|
+
Fe.create = (t, e) => new Fe({
|
|
2935
2935
|
innerType: t,
|
|
2936
2936
|
typeName: m.ZodReadonly,
|
|
2937
2937
|
...v(e)
|
|
2938
2938
|
});
|
|
2939
|
-
function
|
|
2939
|
+
function Tt(t, e) {
|
|
2940
2940
|
const r = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
|
|
2941
2941
|
return typeof r == "string" ? { message: r } : r;
|
|
2942
2942
|
}
|
|
2943
|
-
function
|
|
2944
|
-
return t ?
|
|
2943
|
+
function Mt(t, e = {}, r) {
|
|
2944
|
+
return t ? ge.create().superRefine((n, s) => {
|
|
2945
2945
|
var a, i;
|
|
2946
2946
|
const o = t(n);
|
|
2947
2947
|
if (o instanceof Promise)
|
|
2948
2948
|
return o.then((c) => {
|
|
2949
2949
|
var d, u;
|
|
2950
2950
|
if (!c) {
|
|
2951
|
-
const w =
|
|
2951
|
+
const w = Tt(e, n), x = (u = (d = w.fatal) !== null && d !== void 0 ? d : r) !== null && u !== void 0 ? u : !0;
|
|
2952
2952
|
s.addIssue({ code: "custom", ...w, fatal: x });
|
|
2953
2953
|
}
|
|
2954
2954
|
});
|
|
2955
2955
|
if (!o) {
|
|
2956
|
-
const c =
|
|
2956
|
+
const c = Tt(e, n), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : r) !== null && i !== void 0 ? i : !0;
|
|
2957
2957
|
s.addIssue({ code: "custom", ...c, fatal: d });
|
|
2958
2958
|
}
|
|
2959
|
-
}) :
|
|
2959
|
+
}) : ge.create();
|
|
2960
2960
|
}
|
|
2961
|
-
const
|
|
2962
|
-
object:
|
|
2961
|
+
const Jr = {
|
|
2962
|
+
object: T.lazycreate
|
|
2963
2963
|
};
|
|
2964
2964
|
var m;
|
|
2965
2965
|
(function(t) {
|
|
2966
2966
|
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";
|
|
2967
2967
|
})(m || (m = {}));
|
|
2968
|
-
const
|
|
2968
|
+
const Yr = (t, e = {
|
|
2969
2969
|
message: `Input not instance of ${t.name}`
|
|
2970
|
-
}) =>
|
|
2971
|
-
string: (t) =>
|
|
2970
|
+
}) => Mt((r) => r instanceof t, e), Lt = Z.create, Dt = K.create, Kr = Ge.create, Gr = G.create, Vt = Ee.create, Xr = ce.create, Qr = Je.create, en = Oe.create, tn = Ne.create, rn = ge.create, nn = ie.create, sn = W.create, an = Ye.create, on = j.create, cn = T.create, dn = T.strictCreate, ln = Re.create, un = et.create, fn = Ae.create, pn = V.create, hn = Pe.create, mn = Ke.create, yn = de.create, gn = me.create, vn = Ce.create, _n = Ie.create, wn = X.create, kn = Ze.create, bn = ve.create, Et = $.create, xn = L.create, Sn = Q.create, Tn = $.createWithPreprocess, En = Me.create, On = () => Lt().optional(), Nn = () => Dt().optional(), Rn = () => Vt().optional(), An = {
|
|
2971
|
+
string: (t) => Z.create({ ...t, coerce: !0 }),
|
|
2972
2972
|
number: (t) => K.create({ ...t, coerce: !0 }),
|
|
2973
|
-
boolean: (t) =>
|
|
2973
|
+
boolean: (t) => Ee.create({
|
|
2974
2974
|
...t,
|
|
2975
2975
|
coerce: !0
|
|
2976
2976
|
}),
|
|
2977
2977
|
bigint: (t) => G.create({ ...t, coerce: !0 }),
|
|
2978
|
-
date: (t) =>
|
|
2979
|
-
},
|
|
2980
|
-
var
|
|
2978
|
+
date: (t) => ce.create({ ...t, coerce: !0 })
|
|
2979
|
+
}, Pn = y;
|
|
2980
|
+
var Xe = /* @__PURE__ */ Object.freeze({
|
|
2981
2981
|
__proto__: null,
|
|
2982
|
-
defaultErrorMap:
|
|
2983
|
-
setErrorMap:
|
|
2984
|
-
getErrorMap:
|
|
2985
|
-
makeIssue:
|
|
2986
|
-
EMPTY_PATH:
|
|
2982
|
+
defaultErrorMap: ye,
|
|
2983
|
+
setErrorMap: Sr,
|
|
2984
|
+
getErrorMap: Be,
|
|
2985
|
+
makeIssue: He,
|
|
2986
|
+
EMPTY_PATH: Tr,
|
|
2987
2987
|
addIssueToContext: f,
|
|
2988
|
-
ParseStatus:
|
|
2988
|
+
ParseStatus: O,
|
|
2989
2989
|
INVALID: y,
|
|
2990
|
-
DIRTY:
|
|
2991
|
-
OK:
|
|
2992
|
-
isAborted:
|
|
2993
|
-
isDirty:
|
|
2994
|
-
isValid:
|
|
2995
|
-
isAsync:
|
|
2990
|
+
DIRTY: he,
|
|
2991
|
+
OK: A,
|
|
2992
|
+
isAborted: ot,
|
|
2993
|
+
isDirty: ct,
|
|
2994
|
+
isValid: oe,
|
|
2995
|
+
isAsync: Te,
|
|
2996
2996
|
get util() {
|
|
2997
2997
|
return k;
|
|
2998
2998
|
},
|
|
2999
2999
|
get objectUtil() {
|
|
3000
|
-
return
|
|
3000
|
+
return it;
|
|
3001
3001
|
},
|
|
3002
3002
|
ZodParsedType: p,
|
|
3003
|
-
getParsedType:
|
|
3003
|
+
getParsedType: B,
|
|
3004
3004
|
ZodType: _,
|
|
3005
|
-
datetimeRegex:
|
|
3006
|
-
ZodString:
|
|
3005
|
+
datetimeRegex: $t,
|
|
3006
|
+
ZodString: Z,
|
|
3007
3007
|
ZodNumber: K,
|
|
3008
3008
|
ZodBigInt: G,
|
|
3009
|
-
ZodBoolean:
|
|
3010
|
-
ZodDate:
|
|
3011
|
-
ZodSymbol:
|
|
3012
|
-
ZodUndefined:
|
|
3013
|
-
ZodNull:
|
|
3014
|
-
ZodAny:
|
|
3015
|
-
ZodUnknown:
|
|
3016
|
-
ZodNever:
|
|
3017
|
-
ZodVoid:
|
|
3018
|
-
ZodArray:
|
|
3019
|
-
ZodObject:
|
|
3020
|
-
ZodUnion:
|
|
3021
|
-
ZodDiscriminatedUnion:
|
|
3022
|
-
ZodIntersection:
|
|
3023
|
-
ZodTuple:
|
|
3024
|
-
ZodRecord:
|
|
3025
|
-
ZodMap:
|
|
3026
|
-
ZodSet:
|
|
3027
|
-
ZodFunction:
|
|
3028
|
-
ZodLazy:
|
|
3029
|
-
ZodLiteral:
|
|
3009
|
+
ZodBoolean: Ee,
|
|
3010
|
+
ZodDate: ce,
|
|
3011
|
+
ZodSymbol: Je,
|
|
3012
|
+
ZodUndefined: Oe,
|
|
3013
|
+
ZodNull: Ne,
|
|
3014
|
+
ZodAny: ge,
|
|
3015
|
+
ZodUnknown: ie,
|
|
3016
|
+
ZodNever: W,
|
|
3017
|
+
ZodVoid: Ye,
|
|
3018
|
+
ZodArray: j,
|
|
3019
|
+
ZodObject: T,
|
|
3020
|
+
ZodUnion: Re,
|
|
3021
|
+
ZodDiscriminatedUnion: et,
|
|
3022
|
+
ZodIntersection: Ae,
|
|
3023
|
+
ZodTuple: V,
|
|
3024
|
+
ZodRecord: Pe,
|
|
3025
|
+
ZodMap: Ke,
|
|
3026
|
+
ZodSet: de,
|
|
3027
|
+
ZodFunction: me,
|
|
3028
|
+
ZodLazy: Ce,
|
|
3029
|
+
ZodLiteral: Ie,
|
|
3030
3030
|
ZodEnum: X,
|
|
3031
|
-
ZodNativeEnum:
|
|
3032
|
-
ZodPromise:
|
|
3033
|
-
ZodEffects:
|
|
3034
|
-
ZodTransformer:
|
|
3035
|
-
ZodOptional:
|
|
3031
|
+
ZodNativeEnum: Ze,
|
|
3032
|
+
ZodPromise: ve,
|
|
3033
|
+
ZodEffects: $,
|
|
3034
|
+
ZodTransformer: $,
|
|
3035
|
+
ZodOptional: L,
|
|
3036
3036
|
ZodNullable: Q,
|
|
3037
|
-
ZodDefault:
|
|
3038
|
-
ZodCatch:
|
|
3039
|
-
ZodNaN:
|
|
3040
|
-
BRAND:
|
|
3041
|
-
ZodBranded:
|
|
3042
|
-
ZodPipeline:
|
|
3043
|
-
ZodReadonly:
|
|
3044
|
-
custom:
|
|
3037
|
+
ZodDefault: je,
|
|
3038
|
+
ZodCatch: $e,
|
|
3039
|
+
ZodNaN: Ge,
|
|
3040
|
+
BRAND: Wr,
|
|
3041
|
+
ZodBranded: yt,
|
|
3042
|
+
ZodPipeline: Me,
|
|
3043
|
+
ZodReadonly: Fe,
|
|
3044
|
+
custom: Mt,
|
|
3045
3045
|
Schema: _,
|
|
3046
3046
|
ZodSchema: _,
|
|
3047
|
-
late:
|
|
3047
|
+
late: Jr,
|
|
3048
3048
|
get ZodFirstPartyTypeKind() {
|
|
3049
3049
|
return m;
|
|
3050
3050
|
},
|
|
3051
|
-
coerce:
|
|
3052
|
-
any:
|
|
3053
|
-
array:
|
|
3054
|
-
bigint:
|
|
3055
|
-
boolean:
|
|
3056
|
-
date:
|
|
3057
|
-
discriminatedUnion:
|
|
3058
|
-
effect:
|
|
3059
|
-
enum:
|
|
3060
|
-
function:
|
|
3061
|
-
instanceof:
|
|
3062
|
-
intersection:
|
|
3063
|
-
lazy:
|
|
3064
|
-
literal:
|
|
3065
|
-
map:
|
|
3066
|
-
nan:
|
|
3067
|
-
nativeEnum:
|
|
3068
|
-
never:
|
|
3069
|
-
null:
|
|
3070
|
-
nullable:
|
|
3071
|
-
number:
|
|
3072
|
-
object:
|
|
3073
|
-
oboolean:
|
|
3074
|
-
onumber:
|
|
3075
|
-
optional:
|
|
3076
|
-
ostring:
|
|
3077
|
-
pipeline:
|
|
3078
|
-
preprocess:
|
|
3079
|
-
promise:
|
|
3080
|
-
record:
|
|
3081
|
-
set:
|
|
3082
|
-
strictObject:
|
|
3083
|
-
string:
|
|
3084
|
-
symbol:
|
|
3085
|
-
transformer:
|
|
3086
|
-
tuple:
|
|
3087
|
-
undefined:
|
|
3088
|
-
union:
|
|
3089
|
-
unknown:
|
|
3090
|
-
void:
|
|
3091
|
-
NEVER:
|
|
3051
|
+
coerce: An,
|
|
3052
|
+
any: rn,
|
|
3053
|
+
array: on,
|
|
3054
|
+
bigint: Gr,
|
|
3055
|
+
boolean: Vt,
|
|
3056
|
+
date: Xr,
|
|
3057
|
+
discriminatedUnion: un,
|
|
3058
|
+
effect: Et,
|
|
3059
|
+
enum: wn,
|
|
3060
|
+
function: gn,
|
|
3061
|
+
instanceof: Yr,
|
|
3062
|
+
intersection: fn,
|
|
3063
|
+
lazy: vn,
|
|
3064
|
+
literal: _n,
|
|
3065
|
+
map: mn,
|
|
3066
|
+
nan: Kr,
|
|
3067
|
+
nativeEnum: kn,
|
|
3068
|
+
never: sn,
|
|
3069
|
+
null: tn,
|
|
3070
|
+
nullable: Sn,
|
|
3071
|
+
number: Dt,
|
|
3072
|
+
object: cn,
|
|
3073
|
+
oboolean: Rn,
|
|
3074
|
+
onumber: Nn,
|
|
3075
|
+
optional: xn,
|
|
3076
|
+
ostring: On,
|
|
3077
|
+
pipeline: En,
|
|
3078
|
+
preprocess: Tn,
|
|
3079
|
+
promise: bn,
|
|
3080
|
+
record: hn,
|
|
3081
|
+
set: yn,
|
|
3082
|
+
strictObject: dn,
|
|
3083
|
+
string: Lt,
|
|
3084
|
+
symbol: Qr,
|
|
3085
|
+
transformer: Et,
|
|
3086
|
+
tuple: pn,
|
|
3087
|
+
undefined: en,
|
|
3088
|
+
union: ln,
|
|
3089
|
+
unknown: nn,
|
|
3090
|
+
void: an,
|
|
3091
|
+
NEVER: Pn,
|
|
3092
3092
|
ZodIssueCode: l,
|
|
3093
|
-
quotelessJson:
|
|
3094
|
-
ZodError:
|
|
3093
|
+
quotelessJson: xr,
|
|
3094
|
+
ZodError: C
|
|
3095
3095
|
});
|
|
3096
|
-
const
|
|
3097
|
-
detail:
|
|
3098
|
-
}),
|
|
3099
|
-
error:
|
|
3096
|
+
const lt = Xe.object({
|
|
3097
|
+
detail: Xe.string()
|
|
3098
|
+
}), zt = Xe.object({
|
|
3099
|
+
error: Xe.string()
|
|
3100
3100
|
});
|
|
3101
|
-
function
|
|
3101
|
+
function qt(t) {
|
|
3102
3102
|
if (!t)
|
|
3103
3103
|
return "Unknown error";
|
|
3104
3104
|
if (t instanceof Error) {
|
|
3105
|
-
const e =
|
|
3106
|
-
return e.success ? e.data.detail :
|
|
3105
|
+
const e = lt.safeParse(t.cause);
|
|
3106
|
+
return e.success ? e.data.detail : Cn(t.message);
|
|
3107
3107
|
}
|
|
3108
3108
|
if (typeof t == "object") {
|
|
3109
|
-
const e =
|
|
3109
|
+
const e = lt.safeParse(t);
|
|
3110
3110
|
if (e.success)
|
|
3111
3111
|
return e.data.detail;
|
|
3112
|
-
const r =
|
|
3112
|
+
const r = zt.safeParse(t);
|
|
3113
3113
|
if (r.success)
|
|
3114
3114
|
return r.data.error;
|
|
3115
3115
|
}
|
|
@@ -3119,37 +3119,36 @@ var us = wr((hs, gt) => {
|
|
|
3119
3119
|
return String(t);
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
|
-
function
|
|
3123
|
-
const e =
|
|
3122
|
+
function Cn(t) {
|
|
3123
|
+
const e = In(t);
|
|
3124
3124
|
if (!e)
|
|
3125
3125
|
return t;
|
|
3126
|
-
const r =
|
|
3126
|
+
const r = lt.safeParse(e);
|
|
3127
3127
|
if (r.success)
|
|
3128
3128
|
return r.data.detail;
|
|
3129
|
-
const n =
|
|
3129
|
+
const n = zt.safeParse(e);
|
|
3130
3130
|
return n.success ? n.data.error : t;
|
|
3131
3131
|
}
|
|
3132
|
-
function
|
|
3132
|
+
function In(t) {
|
|
3133
3133
|
try {
|
|
3134
3134
|
return JSON.parse(t);
|
|
3135
3135
|
} catch {
|
|
3136
3136
|
return t;
|
|
3137
3137
|
}
|
|
3138
3138
|
}
|
|
3139
|
-
const
|
|
3140
|
-
function
|
|
3139
|
+
const Zn = 1e10, jn = 1e3;
|
|
3140
|
+
function De(t, e) {
|
|
3141
3141
|
const r = t.map((n) => `"${n}"`).join(", ");
|
|
3142
3142
|
return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
|
|
3143
3143
|
}
|
|
3144
|
-
function
|
|
3144
|
+
function $n(t = {}) {
|
|
3145
3145
|
let e = {};
|
|
3146
3146
|
function r(g) {
|
|
3147
3147
|
e = g;
|
|
3148
3148
|
}
|
|
3149
3149
|
let n = {};
|
|
3150
3150
|
function s(g) {
|
|
3151
|
-
|
|
3152
|
-
n.unregisterHandler && n.unregisterHandler(), n = g, (S = n.registerHandler) == null || S.call(n, _r);
|
|
3151
|
+
n.unregisterHandler && n.unregisterHandler(), n = g, n.registerHandler?.(vr);
|
|
3153
3152
|
}
|
|
3154
3153
|
let a;
|
|
3155
3154
|
function i(g) {
|
|
@@ -3157,120 +3156,115 @@ var us = wr((hs, gt) => {
|
|
|
3157
3156
|
a = g;
|
|
3158
3157
|
return;
|
|
3159
3158
|
}
|
|
3160
|
-
a = (S,
|
|
3161
|
-
const
|
|
3162
|
-
if (
|
|
3163
|
-
return
|
|
3164
|
-
const
|
|
3165
|
-
if (!
|
|
3159
|
+
a = (S, E) => {
|
|
3160
|
+
const N = g[S];
|
|
3161
|
+
if (N)
|
|
3162
|
+
return N(E);
|
|
3163
|
+
const F = g._;
|
|
3164
|
+
if (!F)
|
|
3166
3165
|
throw new Error(`The requested method has no handler: ${S}`);
|
|
3167
|
-
return
|
|
3166
|
+
return F(S, E);
|
|
3168
3167
|
};
|
|
3169
3168
|
}
|
|
3170
|
-
const { maxRequestTime: o =
|
|
3169
|
+
const { maxRequestTime: o = jn } = t;
|
|
3171
3170
|
t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
|
|
3172
3171
|
let c = 0;
|
|
3173
3172
|
function d() {
|
|
3174
|
-
return c <=
|
|
3173
|
+
return c <= Zn ? ++c : c = 0;
|
|
3175
3174
|
}
|
|
3176
3175
|
const u = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
3177
3176
|
function x(g, ...S) {
|
|
3178
|
-
const
|
|
3179
|
-
return new Promise((
|
|
3180
|
-
var ue;
|
|
3177
|
+
const E = S[0];
|
|
3178
|
+
return new Promise((N, F) => {
|
|
3181
3179
|
if (!n.send)
|
|
3182
|
-
throw
|
|
3183
|
-
const
|
|
3180
|
+
throw De(["send"], "make requests");
|
|
3181
|
+
const J = d(), bt = {
|
|
3184
3182
|
type: "request",
|
|
3185
|
-
id:
|
|
3183
|
+
id: J,
|
|
3186
3184
|
method: g,
|
|
3187
|
-
params:
|
|
3185
|
+
params: E
|
|
3188
3186
|
};
|
|
3189
|
-
u.set(
|
|
3190
|
-
w.delete(
|
|
3191
|
-
}, o)),
|
|
3187
|
+
u.set(J, { resolve: N, reject: F }), o !== 1 / 0 && w.set(J, setTimeout(() => {
|
|
3188
|
+
w.delete(J), F(new Error("RPC request timed out."));
|
|
3189
|
+
}, o)), e.onSend?.(bt), n.send(bt);
|
|
3192
3190
|
});
|
|
3193
3191
|
}
|
|
3194
|
-
const
|
|
3195
|
-
get: (g, S,
|
|
3196
|
-
}),
|
|
3197
|
-
function
|
|
3198
|
-
|
|
3199
|
-
const O = S[0];
|
|
3192
|
+
const P = new Proxy(x, {
|
|
3193
|
+
get: (g, S, E) => S in g ? Reflect.get(g, S, E) : (N) => x(S, N)
|
|
3194
|
+
}), q = P;
|
|
3195
|
+
function Le(g, ...S) {
|
|
3196
|
+
const E = S[0];
|
|
3200
3197
|
if (!n.send)
|
|
3201
|
-
throw
|
|
3202
|
-
const
|
|
3198
|
+
throw De(["send"], "send messages");
|
|
3199
|
+
const N = {
|
|
3203
3200
|
type: "message",
|
|
3204
3201
|
id: g,
|
|
3205
|
-
payload:
|
|
3202
|
+
payload: E
|
|
3206
3203
|
};
|
|
3207
|
-
|
|
3204
|
+
e.onSend?.(N), n.send(N);
|
|
3208
3205
|
}
|
|
3209
|
-
const
|
|
3210
|
-
get: (g, S,
|
|
3211
|
-
}),
|
|
3212
|
-
function
|
|
3213
|
-
var O;
|
|
3206
|
+
const wt = new Proxy(Le, {
|
|
3207
|
+
get: (g, S, E) => S in g ? Reflect.get(g, S, E) : (N) => Le(S, N)
|
|
3208
|
+
}), kt = wt, te = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Set();
|
|
3209
|
+
function yr(g, S) {
|
|
3214
3210
|
if (!n.registerHandler)
|
|
3215
|
-
throw
|
|
3211
|
+
throw De(["registerHandler"], "register message listeners");
|
|
3216
3212
|
if (g === "*") {
|
|
3217
|
-
|
|
3213
|
+
rt.add(S);
|
|
3218
3214
|
return;
|
|
3219
3215
|
}
|
|
3220
|
-
te.has(g) || te.set(g, /* @__PURE__ */ new Set()),
|
|
3216
|
+
te.has(g) || te.set(g, /* @__PURE__ */ new Set()), te.get(g)?.add(S);
|
|
3221
3217
|
}
|
|
3222
|
-
function
|
|
3223
|
-
var O, T;
|
|
3218
|
+
function gr(g, S) {
|
|
3224
3219
|
if (g === "*") {
|
|
3225
|
-
|
|
3220
|
+
rt.delete(S);
|
|
3226
3221
|
return;
|
|
3227
3222
|
}
|
|
3228
|
-
|
|
3223
|
+
te.get(g)?.delete(S), te.get(g)?.size === 0 && te.delete(g);
|
|
3229
3224
|
}
|
|
3230
|
-
async function
|
|
3231
|
-
|
|
3232
|
-
if ((S = e.onReceive) == null || S.call(e, g), !("type" in g))
|
|
3225
|
+
async function vr(g) {
|
|
3226
|
+
if (e.onReceive?.(g), !("type" in g))
|
|
3233
3227
|
throw new Error("Message does not contain a type.");
|
|
3234
3228
|
if (g.type === "request") {
|
|
3235
3229
|
if (!n.send || !a)
|
|
3236
|
-
throw
|
|
3237
|
-
const { id:
|
|
3238
|
-
let
|
|
3230
|
+
throw De(["send", "requestHandler"], "handle requests");
|
|
3231
|
+
const { id: S, method: E, params: N } = g;
|
|
3232
|
+
let F;
|
|
3239
3233
|
try {
|
|
3240
|
-
|
|
3234
|
+
F = {
|
|
3241
3235
|
type: "response",
|
|
3242
|
-
id:
|
|
3236
|
+
id: S,
|
|
3243
3237
|
success: !0,
|
|
3244
|
-
payload: await a(
|
|
3238
|
+
payload: await a(E, N)
|
|
3245
3239
|
};
|
|
3246
|
-
} catch (
|
|
3247
|
-
if (!(
|
|
3248
|
-
throw
|
|
3249
|
-
|
|
3240
|
+
} catch (J) {
|
|
3241
|
+
if (!(J instanceof Error))
|
|
3242
|
+
throw J;
|
|
3243
|
+
F = {
|
|
3250
3244
|
type: "response",
|
|
3251
|
-
id:
|
|
3245
|
+
id: S,
|
|
3252
3246
|
success: !1,
|
|
3253
|
-
error:
|
|
3247
|
+
error: J.message
|
|
3254
3248
|
};
|
|
3255
3249
|
}
|
|
3256
|
-
|
|
3250
|
+
e.onSend?.(F), n.send(F);
|
|
3257
3251
|
return;
|
|
3258
3252
|
}
|
|
3259
3253
|
if (g.type === "response") {
|
|
3260
|
-
const
|
|
3261
|
-
|
|
3262
|
-
const { resolve:
|
|
3263
|
-
g.success ?
|
|
3254
|
+
const S = w.get(g.id);
|
|
3255
|
+
S != null && clearTimeout(S);
|
|
3256
|
+
const { resolve: E, reject: N } = u.get(g.id) ?? {};
|
|
3257
|
+
g.success ? E?.(g.payload) : N?.(new Error(g.error));
|
|
3264
3258
|
return;
|
|
3265
3259
|
}
|
|
3266
3260
|
if (g.type === "message") {
|
|
3267
|
-
for (const
|
|
3268
|
-
|
|
3269
|
-
const
|
|
3270
|
-
if (!
|
|
3261
|
+
for (const E of rt)
|
|
3262
|
+
E(g.id, g.payload);
|
|
3263
|
+
const S = te.get(g.id);
|
|
3264
|
+
if (!S)
|
|
3271
3265
|
return;
|
|
3272
|
-
for (const
|
|
3273
|
-
|
|
3266
|
+
for (const E of S)
|
|
3267
|
+
E(g.payload);
|
|
3274
3268
|
return;
|
|
3275
3269
|
}
|
|
3276
3270
|
throw new Error(`Unexpected RPC message type: ${g.type}`);
|
|
@@ -3278,48 +3272,48 @@ var us = wr((hs, gt) => {
|
|
|
3278
3272
|
return {
|
|
3279
3273
|
setTransport: s,
|
|
3280
3274
|
setRequestHandler: i,
|
|
3281
|
-
request:
|
|
3282
|
-
requestProxy:
|
|
3283
|
-
send:
|
|
3284
|
-
sendProxy:
|
|
3285
|
-
addMessageListener:
|
|
3286
|
-
removeMessageListener:
|
|
3287
|
-
proxy: { send:
|
|
3275
|
+
request: P,
|
|
3276
|
+
requestProxy: q,
|
|
3277
|
+
send: wt,
|
|
3278
|
+
sendProxy: kt,
|
|
3279
|
+
addMessageListener: yr,
|
|
3280
|
+
removeMessageListener: gr,
|
|
3281
|
+
proxy: { send: kt, request: q },
|
|
3288
3282
|
_setDebugHooks: r
|
|
3289
3283
|
};
|
|
3290
3284
|
}
|
|
3291
|
-
function
|
|
3292
|
-
return
|
|
3285
|
+
function Fn(t) {
|
|
3286
|
+
return $n(t);
|
|
3293
3287
|
}
|
|
3294
|
-
const
|
|
3295
|
-
function
|
|
3288
|
+
const Ut = "[transport-id]";
|
|
3289
|
+
function Mn(t, e) {
|
|
3296
3290
|
const { transportId: r } = e;
|
|
3297
|
-
return r != null ? { [
|
|
3291
|
+
return r != null ? { [Ut]: r, data: t } : t;
|
|
3298
3292
|
}
|
|
3299
|
-
function
|
|
3300
|
-
const { transportId: r, filter: n } = e, s = n
|
|
3293
|
+
function Ln(t, e) {
|
|
3294
|
+
const { transportId: r, filter: n } = e, s = n?.();
|
|
3301
3295
|
if (r != null && s != null)
|
|
3302
3296
|
throw new Error("Cannot use both `transportId` and `filter` at the same time");
|
|
3303
3297
|
let a = t;
|
|
3304
3298
|
if (r) {
|
|
3305
|
-
if (t[
|
|
3299
|
+
if (t[Ut] !== r)
|
|
3306
3300
|
return [!0];
|
|
3307
3301
|
a = t.data;
|
|
3308
3302
|
}
|
|
3309
3303
|
return s === !1 ? [!0] : [!1, a];
|
|
3310
3304
|
}
|
|
3311
|
-
function
|
|
3305
|
+
function Dn(t, e = {}) {
|
|
3312
3306
|
const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
|
|
3313
3307
|
let o;
|
|
3314
3308
|
return {
|
|
3315
3309
|
send(c) {
|
|
3316
|
-
i.postMessage(
|
|
3310
|
+
i.postMessage(Mn(c, { transportId: r }));
|
|
3317
3311
|
},
|
|
3318
3312
|
registerHandler(c) {
|
|
3319
3313
|
o = (d) => {
|
|
3320
|
-
const u = d.data, [w, x] =
|
|
3314
|
+
const u = d.data, [w, x] = Ln(u, {
|
|
3321
3315
|
transportId: r,
|
|
3322
|
-
filter: () => n
|
|
3316
|
+
filter: () => n?.(d)
|
|
3323
3317
|
});
|
|
3324
3318
|
w || c(x);
|
|
3325
3319
|
}, a.addEventListener("message", o);
|
|
@@ -3329,38 +3323,38 @@ var us = wr((hs, gt) => {
|
|
|
3329
3323
|
}
|
|
3330
3324
|
};
|
|
3331
3325
|
}
|
|
3332
|
-
function
|
|
3333
|
-
return
|
|
3326
|
+
function Vn(t) {
|
|
3327
|
+
return Dn(self, t);
|
|
3334
3328
|
}
|
|
3335
|
-
const
|
|
3336
|
-
function
|
|
3329
|
+
const zn = "marimo-transport";
|
|
3330
|
+
function Bt(t, e) {
|
|
3337
3331
|
if (!t)
|
|
3338
3332
|
throw new Error(e);
|
|
3339
3333
|
}
|
|
3340
|
-
var
|
|
3334
|
+
var qn = Object.defineProperty, b = (t, e) => qn(t, "name", { value: e, configurable: !0 }), Ht = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
|
|
3341
3335
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
3342
3336
|
throw new Error('Dynamic require of "' + t + '" is not supported');
|
|
3343
3337
|
});
|
|
3344
|
-
function
|
|
3338
|
+
function Wt(t) {
|
|
3345
3339
|
return !isNaN(parseFloat(t)) && isFinite(t);
|
|
3346
3340
|
}
|
|
3347
|
-
b(
|
|
3341
|
+
b(Wt, "_isNumber");
|
|
3348
3342
|
function ee(t) {
|
|
3349
3343
|
return t.charAt(0).toUpperCase() + t.substring(1);
|
|
3350
3344
|
}
|
|
3351
3345
|
b(ee, "_capitalize");
|
|
3352
|
-
function
|
|
3346
|
+
function tt(t) {
|
|
3353
3347
|
return function() {
|
|
3354
3348
|
return this[t];
|
|
3355
3349
|
};
|
|
3356
3350
|
}
|
|
3357
|
-
b(
|
|
3358
|
-
var
|
|
3359
|
-
function
|
|
3360
|
-
if (t) for (var e = 0; e <
|
|
3351
|
+
b(tt, "_getter");
|
|
3352
|
+
var ue = ["isConstructor", "isEval", "isNative", "isToplevel"], fe = ["columnNumber", "lineNumber"], pe = ["fileName", "functionName", "source"], Un = ["args"], Bn = ["evalOrigin"], Ve = ue.concat(fe, pe, Un, Bn);
|
|
3353
|
+
function I(t) {
|
|
3354
|
+
if (t) for (var e = 0; e < Ve.length; e++) t[Ve[e]] !== void 0 && this["set" + ee(Ve[e])](t[Ve[e]]);
|
|
3361
3355
|
}
|
|
3362
|
-
b(
|
|
3363
|
-
|
|
3356
|
+
b(I, "StackFrame");
|
|
3357
|
+
I.prototype = { getArgs: function() {
|
|
3364
3358
|
return this.args;
|
|
3365
3359
|
}, setArgs: function(t) {
|
|
3366
3360
|
if (Object.prototype.toString.call(t) !== "[object Array]") throw new TypeError("Args must be an Array");
|
|
@@ -3368,38 +3362,38 @@ var us = wr((hs, gt) => {
|
|
|
3368
3362
|
}, getEvalOrigin: function() {
|
|
3369
3363
|
return this.evalOrigin;
|
|
3370
3364
|
}, setEvalOrigin: function(t) {
|
|
3371
|
-
if (t instanceof
|
|
3372
|
-
else if (t instanceof Object) this.evalOrigin = new
|
|
3365
|
+
if (t instanceof I) this.evalOrigin = t;
|
|
3366
|
+
else if (t instanceof Object) this.evalOrigin = new I(t);
|
|
3373
3367
|
else throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
3374
3368
|
}, toString: function() {
|
|
3375
3369
|
var t = this.getFileName() || "", e = this.getLineNumber() || "", r = this.getColumnNumber() || "", n = this.getFunctionName() || "";
|
|
3376
3370
|
return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
|
|
3377
3371
|
} };
|
|
3378
|
-
|
|
3372
|
+
I.fromString = b(function(t) {
|
|
3379
3373
|
var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), s = t.substring(e + 1, r).split(","), a = t.substring(r + 1);
|
|
3380
3374
|
if (a.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a, ""), o = i[1], c = i[2], d = i[3];
|
|
3381
|
-
return new
|
|
3375
|
+
return new I({ functionName: n, args: s || void 0, fileName: o, lineNumber: c || void 0, columnNumber: d || void 0 });
|
|
3382
3376
|
}, "StackFrame$$fromString");
|
|
3383
|
-
for (
|
|
3377
|
+
for (re = 0; re < ue.length; re++) I.prototype["get" + ee(ue[re])] = tt(ue[re]), I.prototype["set" + ee(ue[re])] = /* @__PURE__ */ function(t) {
|
|
3384
3378
|
return function(e) {
|
|
3385
3379
|
this[t] = !!e;
|
|
3386
3380
|
};
|
|
3387
|
-
}(
|
|
3388
|
-
var
|
|
3389
|
-
for (
|
|
3381
|
+
}(ue[re]);
|
|
3382
|
+
var re;
|
|
3383
|
+
for (ne = 0; ne < fe.length; ne++) I.prototype["get" + ee(fe[ne])] = tt(fe[ne]), I.prototype["set" + ee(fe[ne])] = /* @__PURE__ */ function(t) {
|
|
3390
3384
|
return function(e) {
|
|
3391
|
-
if (!
|
|
3385
|
+
if (!Wt(e)) throw new TypeError(t + " must be a Number");
|
|
3392
3386
|
this[t] = Number(e);
|
|
3393
3387
|
};
|
|
3394
|
-
}(
|
|
3395
|
-
var
|
|
3396
|
-
for (
|
|
3388
|
+
}(fe[ne]);
|
|
3389
|
+
var ne;
|
|
3390
|
+
for (se = 0; se < pe.length; se++) I.prototype["get" + ee(pe[se])] = tt(pe[se]), I.prototype["set" + ee(pe[se])] = /* @__PURE__ */ function(t) {
|
|
3397
3391
|
return function(e) {
|
|
3398
3392
|
this[t] = String(e);
|
|
3399
3393
|
};
|
|
3400
|
-
}(
|
|
3401
|
-
var
|
|
3402
|
-
function
|
|
3394
|
+
}(pe[se]);
|
|
3395
|
+
var se, st = I;
|
|
3396
|
+
function Jt() {
|
|
3403
3397
|
var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
|
|
3404
3398
|
return { parse: b(function(r) {
|
|
3405
3399
|
if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
|
|
@@ -3419,7 +3413,7 @@ var us = wr((hs, gt) => {
|
|
|
3419
3413
|
var a = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = a.match(/ (\(.+\)$)/);
|
|
3420
3414
|
a = i ? a.replace(i[0], "") : a;
|
|
3421
3415
|
var o = this.extractLocation(i ? i[1] : a), c = i && a || void 0, d = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
|
|
3422
|
-
return new
|
|
3416
|
+
return new st({ functionName: c, fileName: d, lineNumber: o[1], columnNumber: o[2], source: s });
|
|
3423
3417
|
}, this);
|
|
3424
3418
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: b(function(r) {
|
|
3425
3419
|
var n = r.stack.split(`
|
|
@@ -3427,58 +3421,58 @@ var us = wr((hs, gt) => {
|
|
|
3427
3421
|
return !s.match(e);
|
|
3428
3422
|
}, this);
|
|
3429
3423
|
return n.map(function(s) {
|
|
3430
|
-
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new
|
|
3424
|
+
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new st({ functionName: s });
|
|
3431
3425
|
var a = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = s.match(a), o = i && i[1] ? i[1] : void 0, c = this.extractLocation(s.replace(a, ""));
|
|
3432
|
-
return new
|
|
3426
|
+
return new st({ functionName: o, fileName: c[0], lineNumber: c[1], columnNumber: c[2], source: s });
|
|
3433
3427
|
}, this);
|
|
3434
3428
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
3435
3429
|
}
|
|
3436
|
-
b(
|
|
3437
|
-
var
|
|
3430
|
+
b(Jt, "ErrorStackParser");
|
|
3431
|
+
var Hn = new Jt(), Wn = Hn, z = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Yt = z && typeof mt < "u" && typeof mt.exports < "u" && typeof Ht < "u" && typeof __dirname < "u", Jn = z && !Yt, Yn = typeof Deno < "u", Kt = !z && !Yn, Kn = Kt && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", Gn = Kt && typeof importScripts == "function" && typeof self == "object";
|
|
3438
3432
|
typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
|
|
3439
|
-
var
|
|
3440
|
-
async function
|
|
3441
|
-
if (!
|
|
3442
|
-
let t =
|
|
3433
|
+
var Gt, ut, Xt, Ot, gt;
|
|
3434
|
+
async function vt() {
|
|
3435
|
+
if (!z || (Gt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Ot = await import("./__vite-browser-external-CPvbk0mb.js"), gt = await import("./__vite-browser-external-CPvbk0mb.js"), Xt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, ut = await import("./__vite-browser-external-CPvbk0mb.js"), _t = ut.sep, typeof Ht < "u")) return;
|
|
3436
|
+
let t = Ot, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), s = { fs: t, crypto: e, ws: r, child_process: n };
|
|
3443
3437
|
globalThis.require = function(a) {
|
|
3444
3438
|
return s[a];
|
|
3445
3439
|
};
|
|
3446
3440
|
}
|
|
3447
|
-
b(
|
|
3441
|
+
b(vt, "initNodeModules");
|
|
3442
|
+
function Qt(t, e) {
|
|
3443
|
+
return ut.resolve(e || ".", t);
|
|
3444
|
+
}
|
|
3445
|
+
b(Qt, "node_resolvePath");
|
|
3448
3446
|
function er(t, e) {
|
|
3449
|
-
return
|
|
3447
|
+
return e === void 0 && (e = location), new URL(t, e).toString();
|
|
3450
3448
|
}
|
|
3451
|
-
b(er, "
|
|
3449
|
+
b(er, "browser_resolvePath");
|
|
3450
|
+
var ft;
|
|
3451
|
+
z ? ft = Qt : ft = er;
|
|
3452
|
+
var _t;
|
|
3453
|
+
z || (_t = "/");
|
|
3452
3454
|
function tr(t, e) {
|
|
3453
|
-
return
|
|
3455
|
+
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: gt.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3454
3456
|
}
|
|
3455
|
-
b(tr, "
|
|
3456
|
-
var ht;
|
|
3457
|
-
q ? ht = er : ht = tr;
|
|
3458
|
-
var kt;
|
|
3459
|
-
q || (kt = "/");
|
|
3457
|
+
b(tr, "node_getBinaryResponse");
|
|
3460
3458
|
function rr(t, e) {
|
|
3461
|
-
return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: _t.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
|
|
3462
|
-
}
|
|
3463
|
-
b(rr, "node_getBinaryResponse");
|
|
3464
|
-
function nr(t, e) {
|
|
3465
3459
|
let r = new URL(t, location);
|
|
3466
3460
|
return { response: fetch(r, e ? { integrity: e } : {}) };
|
|
3467
3461
|
}
|
|
3468
|
-
b(
|
|
3469
|
-
var
|
|
3470
|
-
|
|
3471
|
-
async function
|
|
3472
|
-
let { response: r, binary: n } =
|
|
3462
|
+
b(rr, "browser_getBinaryResponse");
|
|
3463
|
+
var Qe;
|
|
3464
|
+
z ? Qe = tr : Qe = rr;
|
|
3465
|
+
async function nr(t, e) {
|
|
3466
|
+
let { response: r, binary: n } = Qe(t, e);
|
|
3473
3467
|
if (n) return n;
|
|
3474
3468
|
let s = await r;
|
|
3475
3469
|
if (!s.ok) throw new Error(`Failed to load '${t}': request failed.`);
|
|
3476
3470
|
return new Uint8Array(await s.arrayBuffer());
|
|
3477
3471
|
}
|
|
3478
|
-
b(
|
|
3479
|
-
var
|
|
3480
|
-
if (
|
|
3481
|
-
else if (
|
|
3472
|
+
b(nr, "loadBinaryFile");
|
|
3473
|
+
var ze;
|
|
3474
|
+
if (Kn) ze = b(async (t) => await import(t), "loadScript");
|
|
3475
|
+
else if (Gn) ze = b(async (t) => {
|
|
3482
3476
|
try {
|
|
3483
3477
|
globalThis.importScripts(t);
|
|
3484
3478
|
} catch (e) {
|
|
@@ -3486,39 +3480,39 @@ var us = wr((hs, gt) => {
|
|
|
3486
3480
|
else throw e;
|
|
3487
3481
|
}
|
|
3488
3482
|
}, "loadScript");
|
|
3489
|
-
else if (
|
|
3483
|
+
else if (z) ze = sr;
|
|
3490
3484
|
else throw new Error("Cannot determine runtime environment");
|
|
3491
|
-
async function
|
|
3492
|
-
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ?
|
|
3485
|
+
async function sr(t) {
|
|
3486
|
+
t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Xt.runInThisContext(await (await fetch(t)).text()) : await import(Gt.pathToFileURL(t).href);
|
|
3493
3487
|
}
|
|
3494
|
-
b(
|
|
3495
|
-
async function
|
|
3496
|
-
if (
|
|
3497
|
-
await
|
|
3498
|
-
let e = await
|
|
3488
|
+
b(sr, "nodeLoadScript");
|
|
3489
|
+
async function ar(t) {
|
|
3490
|
+
if (z) {
|
|
3491
|
+
await vt();
|
|
3492
|
+
let e = await gt.readFile(t, { encoding: "utf8" });
|
|
3499
3493
|
return JSON.parse(e);
|
|
3500
3494
|
} else return await (await fetch(t)).json();
|
|
3501
3495
|
}
|
|
3502
|
-
b(
|
|
3503
|
-
async function
|
|
3504
|
-
if (
|
|
3496
|
+
b(ar, "loadLockFile");
|
|
3497
|
+
async function ir() {
|
|
3498
|
+
if (Yt) return __dirname;
|
|
3505
3499
|
let t;
|
|
3506
3500
|
try {
|
|
3507
3501
|
throw new Error();
|
|
3508
3502
|
} catch (n) {
|
|
3509
3503
|
t = n;
|
|
3510
3504
|
}
|
|
3511
|
-
let e =
|
|
3512
|
-
if (
|
|
3505
|
+
let e = Wn.parse(t)[0].fileName;
|
|
3506
|
+
if (z && !e.startsWith("file://") && (e = `file://${e}`), Jn) {
|
|
3513
3507
|
let n = await import("./__vite-browser-external-CPvbk0mb.js");
|
|
3514
3508
|
return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
|
|
3515
3509
|
}
|
|
3516
|
-
let r = e.lastIndexOf(
|
|
3510
|
+
let r = e.lastIndexOf(_t);
|
|
3517
3511
|
if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
|
|
3518
3512
|
return e.slice(0, r);
|
|
3519
3513
|
}
|
|
3520
|
-
b(
|
|
3521
|
-
function
|
|
3514
|
+
b(ir, "calculateDirname");
|
|
3515
|
+
function or(t) {
|
|
3522
3516
|
let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(a) {
|
|
3523
3517
|
if (!a.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
3524
3518
|
return r.mount.apply(null, arguments);
|
|
@@ -3546,7 +3540,7 @@ var us = wr((hs, gt) => {
|
|
|
3546
3540
|
}
|
|
3547
3541
|
return { type: "local", entries: i };
|
|
3548
3542
|
}, getRemoteSet: async (a) => {
|
|
3549
|
-
let i = /* @__PURE__ */ Object.create(null), o = await
|
|
3543
|
+
let i = /* @__PURE__ */ Object.create(null), o = await Xn(a.opts.fileSystemHandle);
|
|
3550
3544
|
for (let [c, d] of o) c !== "." && (i[n.join2(a.mountpoint, c)] = { timestamp: d.kind === "file" ? new Date((await d.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: d.kind === "file" ? s.FILE_MODE : s.DIR_MODE });
|
|
3551
3545
|
return { type: "remote", entries: i, handles: o };
|
|
3552
3546
|
}, loadLocalEntry: (a) => {
|
|
@@ -3582,8 +3576,8 @@ var us = wr((hs, gt) => {
|
|
|
3582
3576
|
}, reconcile: async (a, i, o) => {
|
|
3583
3577
|
let c = 0, d = [];
|
|
3584
3578
|
Object.keys(i.entries).forEach(function(x) {
|
|
3585
|
-
let
|
|
3586
|
-
(!
|
|
3579
|
+
let P = i.entries[x], q = o.entries[x];
|
|
3580
|
+
(!q || e.isFile(P.mode) && P.timestamp.getTime() > q.timestamp.getTime()) && (d.push(x), c++);
|
|
3587
3581
|
}), d.sort();
|
|
3588
3582
|
let u = [];
|
|
3589
3583
|
if (Object.keys(o.entries).forEach(function(x) {
|
|
@@ -3591,25 +3585,25 @@ var us = wr((hs, gt) => {
|
|
|
3591
3585
|
}), u.sort().reverse(), !c) return;
|
|
3592
3586
|
let w = i.type === "remote" ? i.handles : o.handles;
|
|
3593
3587
|
for (let x of d) {
|
|
3594
|
-
let
|
|
3588
|
+
let P = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3595
3589
|
if (o.type === "local") {
|
|
3596
|
-
let
|
|
3597
|
-
s.storeLocalEntry(x,
|
|
3590
|
+
let q = w.get(P), Le = await s.loadRemoteEntry(q);
|
|
3591
|
+
s.storeLocalEntry(x, Le);
|
|
3598
3592
|
} else {
|
|
3599
|
-
let
|
|
3600
|
-
await s.storeRemoteEntry(w,
|
|
3593
|
+
let q = s.loadLocalEntry(x);
|
|
3594
|
+
await s.storeRemoteEntry(w, P, q);
|
|
3601
3595
|
}
|
|
3602
3596
|
}
|
|
3603
3597
|
for (let x of u) if (o.type === "local") s.removeLocalEntry(x);
|
|
3604
3598
|
else {
|
|
3605
|
-
let
|
|
3606
|
-
await s.removeRemoteEntry(w,
|
|
3599
|
+
let P = n.normalize(x.replace(a.mountpoint, "/")).substring(1);
|
|
3600
|
+
await s.removeRemoteEntry(w, P);
|
|
3607
3601
|
}
|
|
3608
3602
|
} };
|
|
3609
3603
|
t.FS.filesystems.NATIVEFS_ASYNC = s;
|
|
3610
3604
|
}
|
|
3611
|
-
b(
|
|
3612
|
-
var
|
|
3605
|
+
b(or, "initializeNativeFS");
|
|
3606
|
+
var Xn = b(async (t) => {
|
|
3613
3607
|
let e = [];
|
|
3614
3608
|
async function r(s) {
|
|
3615
3609
|
for await (let a of s.values()) e.push(a), a.kind === "directory" && await r(a);
|
|
@@ -3623,14 +3617,14 @@ var us = wr((hs, gt) => {
|
|
|
3623
3617
|
}
|
|
3624
3618
|
return n;
|
|
3625
3619
|
}, "getFsHandles");
|
|
3626
|
-
function
|
|
3627
|
-
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun:
|
|
3620
|
+
function cr(t) {
|
|
3621
|
+
let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: pr(t), quit(r, n) {
|
|
3628
3622
|
throw e.exited = { status: r, toThrow: n }, n;
|
|
3629
|
-
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm:
|
|
3623
|
+
}, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: hr(t.indexURL) };
|
|
3630
3624
|
return e;
|
|
3631
3625
|
}
|
|
3632
|
-
b(
|
|
3633
|
-
function
|
|
3626
|
+
b(cr, "createSettings");
|
|
3627
|
+
function dr(t) {
|
|
3634
3628
|
return function(e) {
|
|
3635
3629
|
let r = "/";
|
|
3636
3630
|
try {
|
|
@@ -3641,14 +3635,14 @@ var us = wr((hs, gt) => {
|
|
|
3641
3635
|
e.FS.chdir(t);
|
|
3642
3636
|
};
|
|
3643
3637
|
}
|
|
3644
|
-
b(
|
|
3645
|
-
function
|
|
3638
|
+
b(dr, "createHomeDirectory");
|
|
3639
|
+
function lr(t) {
|
|
3646
3640
|
return function(e) {
|
|
3647
3641
|
Object.assign(e.ENV, t);
|
|
3648
3642
|
};
|
|
3649
3643
|
}
|
|
3650
|
-
b(
|
|
3651
|
-
function
|
|
3644
|
+
b(lr, "setEnvironment");
|
|
3645
|
+
function ur(t) {
|
|
3652
3646
|
return t ? [async (e) => {
|
|
3653
3647
|
e.addRunDependency("fsInitHook");
|
|
3654
3648
|
try {
|
|
@@ -3658,9 +3652,9 @@ var us = wr((hs, gt) => {
|
|
|
3658
3652
|
}
|
|
3659
3653
|
}] : [];
|
|
3660
3654
|
}
|
|
3661
|
-
b(
|
|
3662
|
-
function
|
|
3663
|
-
let e =
|
|
3655
|
+
b(ur, "callFsInitHook");
|
|
3656
|
+
function fr(t) {
|
|
3657
|
+
let e = nr(t);
|
|
3664
3658
|
return async (r) => {
|
|
3665
3659
|
let n = r._py_version_major(), s = r._py_version_minor();
|
|
3666
3660
|
r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${s}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
|
|
@@ -3674,15 +3668,15 @@ var us = wr((hs, gt) => {
|
|
|
3674
3668
|
}
|
|
3675
3669
|
};
|
|
3676
3670
|
}
|
|
3677
|
-
b(
|
|
3678
|
-
function
|
|
3671
|
+
b(fr, "installStdlib");
|
|
3672
|
+
function pr(t) {
|
|
3679
3673
|
let e;
|
|
3680
|
-
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...
|
|
3674
|
+
return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...ur(t.fsInit), fr(e), dr(t.env.HOME), lr(t.env), or];
|
|
3681
3675
|
}
|
|
3682
|
-
b(
|
|
3683
|
-
function
|
|
3676
|
+
b(pr, "getFileSystemInitializationFuncs");
|
|
3677
|
+
function hr(t) {
|
|
3684
3678
|
if (typeof WasmOffsetConverter < "u") return;
|
|
3685
|
-
let { binary: e, response: r } =
|
|
3679
|
+
let { binary: e, response: r } = Qe(t + "pyodide.asm.wasm");
|
|
3686
3680
|
return function(n, s) {
|
|
3687
3681
|
return async function() {
|
|
3688
3682
|
try {
|
|
@@ -3696,19 +3690,19 @@ var us = wr((hs, gt) => {
|
|
|
3696
3690
|
}(), {};
|
|
3697
3691
|
};
|
|
3698
3692
|
}
|
|
3699
|
-
b(
|
|
3700
|
-
var
|
|
3701
|
-
async function
|
|
3693
|
+
b(hr, "getInstantiateWasmFunc");
|
|
3694
|
+
var pt = "0.27.5";
|
|
3695
|
+
async function ht(t = {}) {
|
|
3702
3696
|
var e, r;
|
|
3703
|
-
await
|
|
3704
|
-
let n = t.indexURL || await
|
|
3705
|
-
n =
|
|
3697
|
+
await vt();
|
|
3698
|
+
let n = t.indexURL || await ir();
|
|
3699
|
+
n = ft(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
|
|
3706
3700
|
let s = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !1, checkAPIVersion: !0, BUILD_ID: "bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4" }, a = Object.assign(s, t);
|
|
3707
3701
|
(e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
|
|
3708
|
-
let i =
|
|
3709
|
-
if (o.lockFilePromise =
|
|
3702
|
+
let i = cr(a), o = i.API;
|
|
3703
|
+
if (o.lockFilePromise = ar(a.lockFileURL), typeof _createPyodideModule != "function") {
|
|
3710
3704
|
let x = `${a.indexURL}pyodide.asm.js`;
|
|
3711
|
-
await
|
|
3705
|
+
await ze(x);
|
|
3712
3706
|
}
|
|
3713
3707
|
let c;
|
|
3714
3708
|
if (t._loadSnapshot) {
|
|
@@ -3717,7 +3711,7 @@ var us = wr((hs, gt) => {
|
|
|
3717
3711
|
}
|
|
3718
3712
|
let d = await _createPyodideModule(i);
|
|
3719
3713
|
if (i.exited) throw i.exited.toThrow;
|
|
3720
|
-
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !==
|
|
3714
|
+
if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== pt && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${pt}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
3721
3715
|
d.locateFile = (x) => {
|
|
3722
3716
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
3723
3717
|
};
|
|
@@ -3726,12 +3720,12 @@ var us = wr((hs, gt) => {
|
|
|
3726
3720
|
let w = o.finalizeBootstrap(u, t._snapshotDeserializer);
|
|
3727
3721
|
return o.sys.path.insert(0, o.config.env.HOME), w.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${w.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(a.stdin, a.stdout, a.stderr), w;
|
|
3728
3722
|
}
|
|
3729
|
-
b(
|
|
3730
|
-
const
|
|
3731
|
-
function
|
|
3732
|
-
return t.includes("dev") &&
|
|
3723
|
+
b(ht, "loadPyodide");
|
|
3724
|
+
const Qn = !1;
|
|
3725
|
+
function es(t) {
|
|
3726
|
+
return t.includes("dev") && Qn ? "dev" : `v${pt}`;
|
|
3733
3727
|
}
|
|
3734
|
-
class
|
|
3728
|
+
class ts {
|
|
3735
3729
|
constructor() {
|
|
3736
3730
|
this.spans = [];
|
|
3737
3731
|
}
|
|
@@ -3773,31 +3767,31 @@ var us = wr((hs, gt) => {
|
|
|
3773
3767
|
logSpans() {
|
|
3774
3768
|
}
|
|
3775
3769
|
}
|
|
3776
|
-
const
|
|
3777
|
-
globalThis.t =
|
|
3778
|
-
function
|
|
3770
|
+
const R = new ts();
|
|
3771
|
+
globalThis.t = R;
|
|
3772
|
+
function rs(t) {
|
|
3779
3773
|
let e, r = !1;
|
|
3780
3774
|
return function(...n) {
|
|
3781
3775
|
return r || (r = !0, e = t.apply(this, n)), e;
|
|
3782
3776
|
};
|
|
3783
3777
|
}
|
|
3784
|
-
const
|
|
3785
|
-
class
|
|
3778
|
+
const ns = !1;
|
|
3779
|
+
class ss {
|
|
3786
3780
|
constructor() {
|
|
3787
3781
|
this.pyodide = null;
|
|
3788
3782
|
}
|
|
3789
3783
|
get requirePyodide() {
|
|
3790
|
-
return
|
|
3784
|
+
return Bt(this.pyodide, "Pyodide not loaded"), this.pyodide;
|
|
3791
3785
|
}
|
|
3792
3786
|
async bootstrap(e) {
|
|
3793
3787
|
return await this.loadPyodideAndPackages(e);
|
|
3794
3788
|
}
|
|
3795
3789
|
async loadPyodideAndPackages(e) {
|
|
3796
|
-
if (!
|
|
3790
|
+
if (!ht)
|
|
3797
3791
|
throw new Error("loadPyodide is not defined");
|
|
3798
|
-
const r =
|
|
3792
|
+
const r = R.startSpan("loadPyodide");
|
|
3799
3793
|
try {
|
|
3800
|
-
const n = await
|
|
3794
|
+
const n = await ht({
|
|
3801
3795
|
// Perf: These get loaded while pyodide is being bootstrapped
|
|
3802
3796
|
packages: [
|
|
3803
3797
|
"micropip",
|
|
@@ -3807,7 +3801,7 @@ var us = wr((hs, gt) => {
|
|
|
3807
3801
|
"narwhals",
|
|
3808
3802
|
"packaging"
|
|
3809
3803
|
],
|
|
3810
|
-
_makeSnapshot:
|
|
3804
|
+
_makeSnapshot: ns,
|
|
3811
3805
|
lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
|
|
3812
3806
|
// Without this, this fails in Firefox with
|
|
3813
3807
|
// `Could not extract indexURL path from pyodide module`
|
|
@@ -3820,8 +3814,8 @@ var us = wr((hs, gt) => {
|
|
|
3820
3814
|
}
|
|
3821
3815
|
}
|
|
3822
3816
|
async mountFilesystem(e) {
|
|
3823
|
-
const r =
|
|
3824
|
-
return
|
|
3817
|
+
const r = R.startSpan("mountFilesystem");
|
|
3818
|
+
return ae.createHomeDir(this.requirePyodide), ae.mountFS(this.requirePyodide), await ae.populateFilesToMemory(this.requirePyodide), r.end("ok"), ae.initNotebookCode({
|
|
3825
3819
|
pyodide: this.requirePyodide,
|
|
3826
3820
|
code: e.code,
|
|
3827
3821
|
filename: e.filename
|
|
@@ -3832,7 +3826,7 @@ var us = wr((hs, gt) => {
|
|
|
3832
3826
|
self.messenger = {
|
|
3833
3827
|
callback: s
|
|
3834
3828
|
}, self.query_params = a, self.user_config = i;
|
|
3835
|
-
const o =
|
|
3829
|
+
const o = R.startSpan("startSession.runPython"), c = n || ae.NOTEBOOK_FILENAME, [d, u, w] = this.requirePyodide.runPython(
|
|
3836
3830
|
`
|
|
3837
3831
|
print("[py] Starting marimo...")
|
|
3838
3832
|
import asyncio
|
|
@@ -3875,11 +3869,11 @@ ${e}`, e = `import jedi
|
|
|
3875
3869
|
${e}`, e = `import pyodide_http
|
|
3876
3870
|
${e}`;
|
|
3877
3871
|
const s = [...r];
|
|
3878
|
-
let a =
|
|
3872
|
+
let a = R.startSpan("pyodide.loadPackage");
|
|
3879
3873
|
await n.loadPackagesFromImports(e, {
|
|
3880
3874
|
errorCallback: Y.error,
|
|
3881
3875
|
messageCallback: Y.log
|
|
3882
|
-
}), a.end(), a =
|
|
3876
|
+
}), a.end(), a = R.startSpan("micropip.install");
|
|
3883
3877
|
const i = s.filter(
|
|
3884
3878
|
(o) => !n.loadedPackages[o]
|
|
3885
3879
|
);
|
|
@@ -3896,86 +3890,85 @@ ${e}`;
|
|
|
3896
3890
|
}), a.end();
|
|
3897
3891
|
}
|
|
3898
3892
|
}
|
|
3899
|
-
async function
|
|
3893
|
+
async function as(t) {
|
|
3900
3894
|
try {
|
|
3901
3895
|
return await import(
|
|
3902
3896
|
/* @vite-ignore */
|
|
3903
3897
|
`/wasm/controller.js?version=${t}`
|
|
3904
3898
|
);
|
|
3905
3899
|
} catch {
|
|
3906
|
-
return new
|
|
3900
|
+
return new ss();
|
|
3907
3901
|
}
|
|
3908
3902
|
}
|
|
3909
|
-
const
|
|
3910
|
-
async function
|
|
3903
|
+
const Nt = R.startSpan("worker:init");
|
|
3904
|
+
async function is() {
|
|
3911
3905
|
try {
|
|
3912
|
-
const t =
|
|
3913
|
-
self.controller = r,
|
|
3906
|
+
const t = ds(), e = es(t), r = await R.wrapAsync(as)(t);
|
|
3907
|
+
self.controller = r, H.send.initializingMessage({
|
|
3914
3908
|
message: "Loading marimo..."
|
|
3915
|
-
}), self.pyodide = await
|
|
3909
|
+
}), self.pyodide = await R.wrapAsync(r.bootstrap.bind(r))({
|
|
3916
3910
|
version: t,
|
|
3917
3911
|
pyodideVersion: e
|
|
3918
3912
|
});
|
|
3919
3913
|
} catch (t) {
|
|
3920
|
-
Y.error("Error bootstrapping", t),
|
|
3921
|
-
error:
|
|
3914
|
+
Y.error("Error bootstrapping", t), H.send.initializedError({
|
|
3915
|
+
error: qt(t)
|
|
3922
3916
|
});
|
|
3923
3917
|
}
|
|
3924
3918
|
}
|
|
3925
|
-
const
|
|
3919
|
+
const mr = new br(
|
|
3926
3920
|
(t) => {
|
|
3927
|
-
|
|
3921
|
+
H.send.kernelMessage({ message: t });
|
|
3928
3922
|
}
|
|
3929
|
-
),
|
|
3930
|
-
let
|
|
3931
|
-
const
|
|
3923
|
+
), Rt = new wr();
|
|
3924
|
+
let At = !1;
|
|
3925
|
+
const os = {
|
|
3932
3926
|
/**
|
|
3933
3927
|
* Start the session
|
|
3934
3928
|
*/
|
|
3935
3929
|
startSession: async (t) => {
|
|
3936
|
-
|
|
3937
|
-
if (await L, Pt) {
|
|
3930
|
+
if (await M, At) {
|
|
3938
3931
|
Y.warn("Session already started");
|
|
3939
3932
|
return;
|
|
3940
3933
|
}
|
|
3941
|
-
|
|
3934
|
+
At = !0;
|
|
3942
3935
|
try {
|
|
3943
|
-
|
|
3936
|
+
Bt(self.controller, "Controller not loaded"), await self.controller.mountFilesystem?.({
|
|
3944
3937
|
code: t.code,
|
|
3945
3938
|
filename: t.filename
|
|
3946
|
-
})
|
|
3947
|
-
const
|
|
3939
|
+
});
|
|
3940
|
+
const e = R.wrapAsync(
|
|
3948
3941
|
self.controller.startSession.bind(self.controller)
|
|
3949
|
-
),
|
|
3950
|
-
|
|
3942
|
+
), r = rs(() => {
|
|
3943
|
+
H.send.initializingMessage({
|
|
3951
3944
|
message: "Initializing notebook..."
|
|
3952
|
-
}),
|
|
3945
|
+
}), H.send.initialized({});
|
|
3953
3946
|
});
|
|
3954
|
-
|
|
3947
|
+
H.send.initializingMessage({
|
|
3955
3948
|
message: "Loading notebook and dependencies..."
|
|
3956
3949
|
});
|
|
3957
|
-
const
|
|
3950
|
+
const n = await e({
|
|
3958
3951
|
code: t.code,
|
|
3959
3952
|
filename: t.filename,
|
|
3960
3953
|
queryParameters: t.queryParameters,
|
|
3961
3954
|
userConfig: t.userConfig,
|
|
3962
|
-
onMessage: (
|
|
3963
|
-
|
|
3955
|
+
onMessage: (s) => {
|
|
3956
|
+
r(), mr.push(s);
|
|
3964
3957
|
}
|
|
3965
3958
|
});
|
|
3966
|
-
|
|
3967
|
-
} catch (
|
|
3968
|
-
|
|
3969
|
-
error:
|
|
3970
|
-
}),
|
|
3959
|
+
Rt.resolve(n), Nt.end("ok");
|
|
3960
|
+
} catch (e) {
|
|
3961
|
+
H.send.initializedError({
|
|
3962
|
+
error: qt(e)
|
|
3963
|
+
}), Nt.end("error");
|
|
3971
3964
|
}
|
|
3972
3965
|
},
|
|
3973
3966
|
/**
|
|
3974
3967
|
* Load packages
|
|
3975
3968
|
*/
|
|
3976
3969
|
loadPackages: async (t) => {
|
|
3977
|
-
const e =
|
|
3978
|
-
await
|
|
3970
|
+
const e = R.startSpan("loadPackages");
|
|
3971
|
+
await M, t.includes("mo.sql") && (t = `import pandas
|
|
3979
3972
|
${t}`, t = `import duckdb
|
|
3980
3973
|
${t}`, t = `import sqlglot
|
|
3981
3974
|
${t}`, t.includes("polars") && (t = `import pyarrow
|
|
@@ -3988,19 +3981,19 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
3988
3981
|
* Read a file
|
|
3989
3982
|
*/
|
|
3990
3983
|
readFile: async (t) => {
|
|
3991
|
-
const e =
|
|
3992
|
-
await
|
|
3993
|
-
const r =
|
|
3984
|
+
const e = R.startSpan("readFile");
|
|
3985
|
+
await M;
|
|
3986
|
+
const r = at(self.pyodide.FS.readFile(t));
|
|
3994
3987
|
return e.end(), r;
|
|
3995
3988
|
},
|
|
3996
3989
|
/**
|
|
3997
3990
|
* Set the interrupt buffer
|
|
3998
3991
|
*/
|
|
3999
3992
|
setInterruptBuffer: async (t) => {
|
|
4000
|
-
await
|
|
3993
|
+
await M, self.pyodide.setInterruptBuffer(t);
|
|
4001
3994
|
},
|
|
4002
3995
|
addPackage: async (t) => {
|
|
4003
|
-
await
|
|
3996
|
+
await M;
|
|
4004
3997
|
const { package: e } = t, r = e.split(" ").map((s) => s.trim()), n = await self.pyodide.runPythonAsync(`
|
|
4005
3998
|
import micropip
|
|
4006
3999
|
import json
|
|
@@ -4015,7 +4008,7 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4015
4008
|
return JSON.parse(n);
|
|
4016
4009
|
},
|
|
4017
4010
|
removePackage: async (t) => {
|
|
4018
|
-
await
|
|
4011
|
+
await M;
|
|
4019
4012
|
const { package: e } = t, r = await self.pyodide.runPythonAsync(`
|
|
4020
4013
|
import micropip
|
|
4021
4014
|
import json
|
|
@@ -4030,8 +4023,8 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4030
4023
|
return JSON.parse(r);
|
|
4031
4024
|
},
|
|
4032
4025
|
listPackages: async () => {
|
|
4033
|
-
const t =
|
|
4034
|
-
await
|
|
4026
|
+
const t = R.startSpan("listPackages");
|
|
4027
|
+
await M;
|
|
4035
4028
|
const e = await self.pyodide.runPythonAsync(`
|
|
4036
4029
|
import json
|
|
4037
4030
|
import micropip
|
|
@@ -4051,19 +4044,19 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4051
4044
|
* Save the notebook
|
|
4052
4045
|
*/
|
|
4053
4046
|
saveNotebook: async (t) => {
|
|
4054
|
-
await
|
|
4047
|
+
await M, await self.pyodide.runPython(`
|
|
4055
4048
|
from marimo._pyodide.bootstrap import save_file
|
|
4056
4049
|
save_file
|
|
4057
|
-
`)(JSON.stringify(t),
|
|
4050
|
+
`)(JSON.stringify(t), ae.NOTEBOOK_FILENAME);
|
|
4058
4051
|
},
|
|
4059
4052
|
/**
|
|
4060
4053
|
* Call a function on the bridge
|
|
4061
4054
|
*/
|
|
4062
4055
|
bridge: async (t) => {
|
|
4063
|
-
const e =
|
|
4056
|
+
const e = R.startSpan("bridge", {
|
|
4064
4057
|
functionName: t.functionName
|
|
4065
4058
|
});
|
|
4066
|
-
await
|
|
4059
|
+
await M;
|
|
4067
4060
|
const { functionName: r, payload: n } = t;
|
|
4068
4061
|
r === "format" && await self.pyodide.runPythonAsync(`
|
|
4069
4062
|
import micropip
|
|
@@ -4080,26 +4073,26 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4080
4073
|
except ModuleNotFoundError:
|
|
4081
4074
|
await micropip.install("pyyaml")
|
|
4082
4075
|
`);
|
|
4083
|
-
const s = await
|
|
4076
|
+
const s = await Rt.promise, a = n == null ? null : typeof n == "string" ? n : JSON.stringify(n), i = a == null ? (
|
|
4084
4077
|
// @ts-expect-error ehh TypeScript
|
|
4085
4078
|
await s[r]()
|
|
4086
4079
|
) : (
|
|
4087
4080
|
// @ts-expect-error ehh TypeScript
|
|
4088
4081
|
await s[r](a)
|
|
4089
4082
|
);
|
|
4090
|
-
return
|
|
4083
|
+
return cs.has(r) && ae.persistFilesToRemote(self.pyodide), e.end(), typeof i == "string" ? JSON.parse(i) : i;
|
|
4091
4084
|
}
|
|
4092
|
-
},
|
|
4093
|
-
transport:
|
|
4094
|
-
transportId:
|
|
4085
|
+
}, H = Fn({
|
|
4086
|
+
transport: Vn({
|
|
4087
|
+
transportId: zn
|
|
4095
4088
|
}),
|
|
4096
|
-
requestHandler:
|
|
4089
|
+
requestHandler: os
|
|
4097
4090
|
});
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
await
|
|
4091
|
+
H.send("ready", {});
|
|
4092
|
+
H.addMessageListener("consumerReady", async () => {
|
|
4093
|
+
await M, mr.start();
|
|
4101
4094
|
});
|
|
4102
|
-
const
|
|
4095
|
+
const cs = /* @__PURE__ */ new Set([
|
|
4103
4096
|
"save",
|
|
4104
4097
|
"save_app_config",
|
|
4105
4098
|
"rename_file",
|
|
@@ -4108,9 +4101,9 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
|
|
|
4108
4101
|
"move_file_or_directory",
|
|
4109
4102
|
"update_file"
|
|
4110
4103
|
]);
|
|
4111
|
-
function
|
|
4104
|
+
function ds() {
|
|
4112
4105
|
return self.name;
|
|
4113
4106
|
}
|
|
4114
|
-
const
|
|
4107
|
+
const M = R.wrapAsync(is)();
|
|
4115
4108
|
});
|
|
4116
|
-
export default
|
|
4109
|
+
export default ls();
|