@drfed/web 0.0.0-stage → 0.1.0-dev.561
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/.output/nitro.json +17 -0
- package/.output/public/.vite/manifest.json +483 -0
- package/.output/public/_build/assets/ActorDetailQuery.graphql-D96mwq1k.js +60 -0
- package/.output/public/_build/assets/ActorDetailQuery.graphql-DrxSNh1X.js +60 -0
- package/.output/public/_build/assets/CompleteLoginChallenge.graphql-C5Zq3wNh.js +10 -0
- package/.output/public/_build/assets/CopyButton-B2l484wE.js +1 -0
- package/.output/public/_build/assets/CopyButton-Bi-ZR8x9.css +1 -0
- package/.output/public/_build/assets/CreateInstanceMutation.graphql-B4CRy6cl.js +19 -0
- package/.output/public/_build/assets/CreateObjectMutation.graphql-B4A01dgV.js +23 -0
- package/.output/public/_build/assets/GenerateActorsMutation.graphql-mlHJNIbe.js +23 -0
- package/.output/public/_build/assets/GetHostQuery.graphql-CuzDdOdW.js +17 -0
- package/.output/public/_build/assets/GetHostQuery.graphql-o9K0Qkg0.js +17 -0
- package/.output/public/_build/assets/HomeViewerQuery.graphql-B903WWKs.js +8 -0
- package/.output/public/_build/assets/HttpStatusCode-bgaVzuLy.js +1 -0
- package/.output/public/_build/assets/InstanceActorListQuery.graphql-DmNwiEhM.js +24 -0
- package/.output/public/_build/assets/InstanceActorListQuery.graphql-paa7teUO.js +24 -0
- package/.output/public/_build/assets/InstanceDetailQuery.graphql-B52nR132.js +66 -0
- package/.output/public/_build/assets/InstanceDetailQuery.graphql-DSA2BcAV.js +66 -0
- package/.output/public/_build/assets/JNCCF6MP-CNMywyiC.js +1 -0
- package/.output/public/_build/assets/LP6E37CW-Cwv6G3n1.js +1 -0
- package/.output/public/_build/assets/SignInMutation.graphql-BalZYNFu.js +9 -0
- package/.output/public/_build/assets/TSB6MOZK-CpiH97G1.js +1 -0
- package/.output/public/_build/assets/Toast-3-eXCAKc.css +1 -0
- package/.output/public/_build/assets/Toast-C1zr9crB.js +1 -0
- package/.output/public/_build/assets/WorkspaceQuery.graphql-UoI7QDs4.js +23 -0
- package/.output/public/_build/assets/_...404_-WZ8kAljY.js +1 -0
- package/.output/public/_build/assets/_challengeId_-Dk-0l7zl.js +1 -0
- package/.output/public/_build/assets/_id_-YcZZShAv.css +1 -0
- package/.output/public/_build/assets/_id_-bpxdclBj.js +1 -0
- package/.output/public/_build/assets/_slug_-CyTA2aW7.css +1 -0
- package/.output/public/_build/assets/_slug_-DXfRknzJ.js +200 -0
- package/.output/public/_build/assets/about-DIrbzRsi.js +1 -0
- package/.output/public/_build/assets/actors-HfZh_afh.js +24 -0
- package/.output/public/_build/assets/client-CGFoRcqH.js +3 -0
- package/.output/public/_build/assets/components-5MVu7IcD.js +1 -0
- package/.output/public/_build/assets/dist-BrJ_B8nU.js +1 -0
- package/.output/public/_build/assets/dist-DVo0HS5G.js +1 -0
- package/.output/public/_build/assets/dist-WrlGlK67.js +1 -0
- package/.output/public/_build/assets/entry-client-BurSTYr9.css +1 -0
- package/.output/public/_build/assets/entry-client-Do7ocrsL.js +8 -0
- package/.output/public/_build/assets/form-BxigYd7J.css +1 -0
- package/.output/public/_build/assets/form.module-BecmEfV_.js +1 -0
- package/.output/public/_build/assets/index-BHn6sAgH.js +23 -0
- package/.output/public/_build/assets/index-BSLqnqN7.js +8 -0
- package/.output/public/_build/assets/index-B_xLBDOo.css +1 -0
- package/.output/public/_build/assets/instance-tpMrvJNZ.js +35 -0
- package/.output/public/_build/assets/label-Mv8GZ4jc.js +1 -0
- package/.output/public/_build/assets/objects-DPb8DI8A.css +1 -0
- package/.output/public/_build/assets/objects-DR9TfL-V.js +25 -0
- package/.output/public/_build/assets/relay-runtime-BX3uubtA.js +7 -0
- package/.output/public/_build/assets/routing-DMN2NHu6.js +1 -0
- package/.output/public/_build/assets/sign-in-B67sv7z8.js +10 -0
- package/.output/public/_build/assets/web-DB_Nkq2D.js +1 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/icon-192.png +0 -0
- package/.output/public/icon-512.png +0 -0
- package/.output/public/icon-mask.png +0 -0
- package/.output/public/icon.svg +395 -0
- package/.output/public/manifest.webmanifest +13 -0
- package/.output/server/_...404_-DDEH5apf.mjs +16 -0
- package/.output/server/_challengeId_-C_n_Bww9.mjs +100 -0
- package/.output/server/_chunks/ssr-renderer.mjs +26 -0
- package/.output/server/_id_-DqytvZEf.mjs +505 -0
- package/.output/server/_libs/@shikijs/core+[...].mjs +7173 -0
- package/.output/server/_libs/@shikijs/engine-javascript+[...].mjs +3110 -0
- package/.output/server/_libs/babel__runtime.mjs +243 -0
- package/.output/server/_libs/dequal.mjs +25 -0
- package/.output/server/_libs/faker-js__faker.mjs +13150 -0
- package/.output/server/_libs/fbjs.mjs +115 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +650 -0
- package/.output/server/_libs/hookable.mjs +41 -0
- package/.output/server/_libs/invariant.mjs +36 -0
- package/.output/server/_libs/relay-runtime.mjs +9704 -0
- package/.output/server/_libs/seroval-plugins.mjs +563 -0
- package/.output/server/_libs/seroval.mjs +2956 -0
- package/.output/server/_libs/shikijs__langs.mjs +3 -0
- package/.output/server/_libs/shikijs__themes.mjs +7 -0
- package/.output/server/_libs/solid-js.mjs +1248 -0
- package/.output/server/_libs/solid-relay+tiny-invariant.mjs +1029 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_libs/valibot.mjs +711 -0
- package/.output/server/_runtime.mjs +33 -0
- package/.output/server/_slug_-CBOaSqoF.mjs +978 -0
- package/.output/server/_ssr/ActorDetailQuery.graphql-C1mWRP1B.mjs +283 -0
- package/.output/server/_ssr/CompleteLoginChallenge.graphql-CM7o_Md1.mjs +78 -0
- package/.output/server/_ssr/CopyButton-CQNR5D1y.mjs +43 -0
- package/.output/server/_ssr/CreateInstanceMutation.graphql-C-h2lGxz.mjs +116 -0
- package/.output/server/_ssr/CreateObjectMutation.graphql-C393Hp7q.mjs +166 -0
- package/.output/server/_ssr/GenerateActorsMutation.graphql-D2ADtn1j.mjs +163 -0
- package/.output/server/_ssr/GetHostQuery.graphql-C45XQo1i.mjs +127 -0
- package/.output/server/_ssr/HomeViewerQuery.graphql-Dote4Pkz.mjs +81 -0
- package/.output/server/_ssr/InstanceActorListQuery.graphql-DgItgN5t.mjs +167 -0
- package/.output/server/_ssr/InstanceDetailQuery.graphql-DP5wWWjX.mjs +367 -0
- package/.output/server/_ssr/JNCCF6MP-BAZlBnvx.mjs +419 -0
- package/.output/server/_ssr/LP6E37CW-D2Ih_b_K.mjs +163 -0
- package/.output/server/_ssr/SignInMutation.graphql-BBXmiay6.mjs +72 -0
- package/.output/server/_ssr/TSB6MOZK-D06WZb6o.mjs +166 -0
- package/.output/server/_ssr/Toast-Bb1gcxED.mjs +947 -0
- package/.output/server/_ssr/WorkspaceQuery.graphql-DnCO8t-4.mjs +153 -0
- package/.output/server/_ssr/about-CD3QIgf_.mjs +14 -0
- package/.output/server/_ssr/actors-CMWf-xQU.mjs +1160 -0
- package/.output/server/_ssr/dist-D6rgyh-L.mjs +81 -0
- package/.output/server/_ssr/dist-I7KRMRbA.mjs +432 -0
- package/.output/server/_ssr/form.module-CTvIl1lm.mjs +192 -0
- package/.output/server/_ssr/index-C4crD6q-.mjs +347 -0
- package/.output/server/_ssr/index-yuhuc6-X.mjs +111 -0
- package/.output/server/_ssr/instance-ZYWGeWd3.mjs +280 -0
- package/.output/server/_ssr/label-DAXzanI9.mjs +9 -0
- package/.output/server/_ssr/objects-D5MVukzB.mjs +4316 -0
- package/.output/server/_ssr/routing-DKTLkkbY.mjs +620 -0
- package/.output/server/_ssr/sign-in-CNHZb_zL.mjs +264 -0
- package/.output/server/_ssr/ssr.mjs +6121 -0
- package/.output/server/index.mjs +684 -0
- package/LICENSE +661 -0
- package/README.md +143 -2
- package/dist/bridge.d.mts +39 -0
- package/dist/bridge.mjs +104 -0
- package/dist/bridge.mjs.map +1 -0
- package/dist/request-policy.d.mts +8 -0
- package/dist/request-policy.mjs +94 -0
- package/dist/request-policy.mjs.map +1 -0
- package/dist/runtime.d.mts +14 -0
- package/dist/runtime.mjs +44 -0
- package/dist/runtime.mjs.map +1 -0
- package/package.json +123 -3
|
@@ -0,0 +1,2956 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/seroval@1.5.4/node_modules/seroval/dist/esm/production/index.mjs
|
|
2
|
+
var M = ((i) => (i[i.AggregateError = 1] = "AggregateError", i[i.ArrowFunction = 2] = "ArrowFunction", i[i.ErrorPrototypeStack = 4] = "ErrorPrototypeStack", i[i.ObjectAssign = 8] = "ObjectAssign", i[i.BigIntTypedArray = 16] = "BigIntTypedArray", i[i.RegExp = 32] = "RegExp", i))(M || {});
|
|
3
|
+
var v = Symbol.asyncIterator;
|
|
4
|
+
var pr = Symbol.hasInstance;
|
|
5
|
+
var R = Symbol.isConcatSpreadable;
|
|
6
|
+
var C = Symbol.iterator;
|
|
7
|
+
var dr = Symbol.match;
|
|
8
|
+
var gr = Symbol.matchAll;
|
|
9
|
+
var yr = Symbol.replace;
|
|
10
|
+
var Nr = Symbol.search;
|
|
11
|
+
var br = Symbol.species;
|
|
12
|
+
var vr = Symbol.split;
|
|
13
|
+
var Cr = Symbol.toPrimitive;
|
|
14
|
+
var P = Symbol.toStringTag;
|
|
15
|
+
var Ar = Symbol.unscopables;
|
|
16
|
+
var tt = {
|
|
17
|
+
0: "Symbol.asyncIterator",
|
|
18
|
+
1: "Symbol.hasInstance",
|
|
19
|
+
2: "Symbol.isConcatSpreadable",
|
|
20
|
+
3: "Symbol.iterator",
|
|
21
|
+
4: "Symbol.match",
|
|
22
|
+
5: "Symbol.matchAll",
|
|
23
|
+
6: "Symbol.replace",
|
|
24
|
+
7: "Symbol.search",
|
|
25
|
+
8: "Symbol.species",
|
|
26
|
+
9: "Symbol.split",
|
|
27
|
+
10: "Symbol.toPrimitive",
|
|
28
|
+
11: "Symbol.toStringTag",
|
|
29
|
+
12: "Symbol.unscopables"
|
|
30
|
+
};
|
|
31
|
+
var ve = {
|
|
32
|
+
[v]: 0,
|
|
33
|
+
[pr]: 1,
|
|
34
|
+
[R]: 2,
|
|
35
|
+
[C]: 3,
|
|
36
|
+
[dr]: 4,
|
|
37
|
+
[gr]: 5,
|
|
38
|
+
[yr]: 6,
|
|
39
|
+
[Nr]: 7,
|
|
40
|
+
[br]: 8,
|
|
41
|
+
[vr]: 9,
|
|
42
|
+
[Cr]: 10,
|
|
43
|
+
[P]: 11,
|
|
44
|
+
[Ar]: 12
|
|
45
|
+
};
|
|
46
|
+
var ot = {
|
|
47
|
+
2: "!0",
|
|
48
|
+
3: "!1",
|
|
49
|
+
1: "void 0",
|
|
50
|
+
0: "null",
|
|
51
|
+
4: "-0",
|
|
52
|
+
5: "1/0",
|
|
53
|
+
6: "-1/0",
|
|
54
|
+
7: "0/0"
|
|
55
|
+
};
|
|
56
|
+
var o = void 0;
|
|
57
|
+
Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY;
|
|
58
|
+
var Ce = {
|
|
59
|
+
0: "Error",
|
|
60
|
+
1: "EvalError",
|
|
61
|
+
2: "RangeError",
|
|
62
|
+
3: "ReferenceError",
|
|
63
|
+
4: "SyntaxError",
|
|
64
|
+
5: "TypeError",
|
|
65
|
+
6: "URIError"
|
|
66
|
+
};
|
|
67
|
+
function c(e, r, t, n, a, s, i, u, l, g, S, d) {
|
|
68
|
+
return {
|
|
69
|
+
t: e,
|
|
70
|
+
i: r,
|
|
71
|
+
s: t,
|
|
72
|
+
c: n,
|
|
73
|
+
m: a,
|
|
74
|
+
p: s,
|
|
75
|
+
e: i,
|
|
76
|
+
a: u,
|
|
77
|
+
f: l,
|
|
78
|
+
b: g,
|
|
79
|
+
o: S,
|
|
80
|
+
l: d
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function B(e) {
|
|
84
|
+
return c(2, o, e, o, o, o, o, o, o, o, o, o);
|
|
85
|
+
}
|
|
86
|
+
var H = B(2);
|
|
87
|
+
var J = B(3);
|
|
88
|
+
var Ae = B(1);
|
|
89
|
+
var Ee = B(0);
|
|
90
|
+
var it = B(4);
|
|
91
|
+
var ut = B(5);
|
|
92
|
+
var lt = B(6);
|
|
93
|
+
var ct = B(7);
|
|
94
|
+
function mn(e) {
|
|
95
|
+
switch (e) {
|
|
96
|
+
case "\"": return "\\\"";
|
|
97
|
+
case "\\": return "\\\\";
|
|
98
|
+
case `
|
|
99
|
+
`: return "\\n";
|
|
100
|
+
case "\r": return "\\r";
|
|
101
|
+
case "\b": return "\\b";
|
|
102
|
+
case " ": return "\\t";
|
|
103
|
+
case "\f": return "\\f";
|
|
104
|
+
case "<": return "\\x3C";
|
|
105
|
+
case "\u2028": return "\\u2028";
|
|
106
|
+
case "\u2029": return "\\u2029";
|
|
107
|
+
default: return o;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function y(e) {
|
|
111
|
+
let r = "", t = 0, n;
|
|
112
|
+
for (let a = 0, s = e.length; a < s; a++) n = mn(e[a]), n && (r += e.slice(t, a) + n, t = a + 1);
|
|
113
|
+
return t === 0 ? r = e : r += e.slice(t), r;
|
|
114
|
+
}
|
|
115
|
+
var L = "__SEROVAL_REFS__";
|
|
116
|
+
var le = "$R";
|
|
117
|
+
var Ie = `self.${le}`;
|
|
118
|
+
function dn(e) {
|
|
119
|
+
return e == null ? `${Ie}=${Ie}||[]` : `(${Ie}=${Ie}||{})["${y(e)}"]=[]`;
|
|
120
|
+
}
|
|
121
|
+
var Er = /* @__PURE__ */ new Map();
|
|
122
|
+
var U = /* @__PURE__ */ new Map();
|
|
123
|
+
function Ir(e) {
|
|
124
|
+
return Er.has(e);
|
|
125
|
+
}
|
|
126
|
+
function ft(e) {
|
|
127
|
+
if (Ir(e)) return Er.get(e);
|
|
128
|
+
throw new Re(e);
|
|
129
|
+
}
|
|
130
|
+
typeof globalThis != "undefined" ? Object.defineProperty(globalThis, L, {
|
|
131
|
+
value: U,
|
|
132
|
+
configurable: !0,
|
|
133
|
+
writable: !1,
|
|
134
|
+
enumerable: !1
|
|
135
|
+
}) : typeof window != "undefined" ? Object.defineProperty(window, L, {
|
|
136
|
+
value: U,
|
|
137
|
+
configurable: !0,
|
|
138
|
+
writable: !1,
|
|
139
|
+
enumerable: !1
|
|
140
|
+
}) : typeof self != "undefined" ? Object.defineProperty(self, L, {
|
|
141
|
+
value: U,
|
|
142
|
+
configurable: !0,
|
|
143
|
+
writable: !1,
|
|
144
|
+
enumerable: !1
|
|
145
|
+
}) : typeof global != "undefined" && Object.defineProperty(global, L, {
|
|
146
|
+
value: U,
|
|
147
|
+
configurable: !0,
|
|
148
|
+
writable: !1,
|
|
149
|
+
enumerable: !1
|
|
150
|
+
});
|
|
151
|
+
function xe(e) {
|
|
152
|
+
return e instanceof EvalError ? 1 : e instanceof RangeError ? 2 : e instanceof ReferenceError ? 3 : e instanceof SyntaxError ? 4 : e instanceof TypeError ? 5 : e instanceof URIError ? 6 : 0;
|
|
153
|
+
}
|
|
154
|
+
function Nn(e) {
|
|
155
|
+
let r = Ce[xe(e)];
|
|
156
|
+
return e.name !== r ? { name: e.name } : e.constructor.name !== r ? { name: e.constructor.name } : {};
|
|
157
|
+
}
|
|
158
|
+
function Z(e, r) {
|
|
159
|
+
let t = Nn(e), n = Object.getOwnPropertyNames(e);
|
|
160
|
+
for (let a = 0, s = n.length, i; a < s; a++) i = n[a], i !== "name" && i !== "message" && (i === "stack" ? r & 4 && (t = t || {}, t[i] = e[i]) : (t = t || {}, t[i] = e[i]));
|
|
161
|
+
return t;
|
|
162
|
+
}
|
|
163
|
+
function Te(e) {
|
|
164
|
+
return Object.isFrozen(e) ? 3 : Object.isSealed(e) ? 2 : Object.isExtensible(e) ? 0 : 1;
|
|
165
|
+
}
|
|
166
|
+
function Oe(e) {
|
|
167
|
+
switch (e) {
|
|
168
|
+
case Number.POSITIVE_INFINITY: return ut;
|
|
169
|
+
case Number.NEGATIVE_INFINITY: return lt;
|
|
170
|
+
}
|
|
171
|
+
return e !== e ? ct : Object.is(e, -0) ? it : c(0, o, e, o, o, o, o, o, o, o, o, o);
|
|
172
|
+
}
|
|
173
|
+
function $(e) {
|
|
174
|
+
return c(1, o, y(e), o, o, o, o, o, o, o, o, o);
|
|
175
|
+
}
|
|
176
|
+
function we(e) {
|
|
177
|
+
return c(3, o, "" + e, o, o, o, o, o, o, o, o, o);
|
|
178
|
+
}
|
|
179
|
+
function pt(e) {
|
|
180
|
+
return c(4, e, o, o, o, o, o, o, o, o, o, o);
|
|
181
|
+
}
|
|
182
|
+
function he(e, r) {
|
|
183
|
+
let t = r.valueOf();
|
|
184
|
+
return c(5, e, t !== t ? "" : r.toISOString(), o, o, o, o, o, o, o, o, o);
|
|
185
|
+
}
|
|
186
|
+
function ze(e, r) {
|
|
187
|
+
return c(6, e, o, y(r.source), r.flags, o, o, o, o, o, o, o);
|
|
188
|
+
}
|
|
189
|
+
function dt(e, r) {
|
|
190
|
+
return c(17, e, ve[r], o, o, o, o, o, o, o, o, o);
|
|
191
|
+
}
|
|
192
|
+
function gt(e, r) {
|
|
193
|
+
return c(18, e, y(ft(r)), o, o, o, o, o, o, o, o, o);
|
|
194
|
+
}
|
|
195
|
+
function ce(e, r, t) {
|
|
196
|
+
return c(25, e, t, y(r), o, o, o, o, o, o, o, o);
|
|
197
|
+
}
|
|
198
|
+
function _e(e, r, t) {
|
|
199
|
+
return c(9, e, o, o, o, o, o, t, o, o, Te(r), o);
|
|
200
|
+
}
|
|
201
|
+
function ke(e, r) {
|
|
202
|
+
return c(21, e, o, o, o, o, o, o, r, o, o, o);
|
|
203
|
+
}
|
|
204
|
+
function De(e, r, t) {
|
|
205
|
+
return c(15, e, o, r.constructor.name, o, o, o, o, t, r.byteOffset, o, r.length);
|
|
206
|
+
}
|
|
207
|
+
function Fe(e, r, t) {
|
|
208
|
+
return c(16, e, o, r.constructor.name, o, o, o, o, t, r.byteOffset, o, r.byteLength);
|
|
209
|
+
}
|
|
210
|
+
function Be(e, r, t) {
|
|
211
|
+
return c(20, e, o, o, o, o, o, o, t, r.byteOffset, o, r.byteLength);
|
|
212
|
+
}
|
|
213
|
+
function Ve(e, r, t) {
|
|
214
|
+
return c(13, e, xe(r), o, y(r.message), t, o, o, o, o, o, o);
|
|
215
|
+
}
|
|
216
|
+
function Me(e, r, t) {
|
|
217
|
+
return c(14, e, xe(r), o, y(r.message), t, o, o, o, o, o, o);
|
|
218
|
+
}
|
|
219
|
+
function Le(e, r) {
|
|
220
|
+
return c(7, e, o, o, o, o, o, r, o, o, o, o);
|
|
221
|
+
}
|
|
222
|
+
function Ue(e, r) {
|
|
223
|
+
return c(28, o, o, o, o, o, o, [e, r], o, o, o, o);
|
|
224
|
+
}
|
|
225
|
+
function je(e, r) {
|
|
226
|
+
return c(30, o, o, o, o, o, o, [e, r], o, o, o, o);
|
|
227
|
+
}
|
|
228
|
+
function Ye(e, r, t) {
|
|
229
|
+
return c(31, e, o, o, o, o, o, t, r, o, o, o);
|
|
230
|
+
}
|
|
231
|
+
function qe(e, r) {
|
|
232
|
+
return c(32, e, o, o, o, o, o, o, r, o, o, o);
|
|
233
|
+
}
|
|
234
|
+
function We(e, r) {
|
|
235
|
+
return c(33, e, o, o, o, o, o, o, r, o, o, o);
|
|
236
|
+
}
|
|
237
|
+
function Ge(e, r) {
|
|
238
|
+
return c(34, e, o, o, o, o, o, o, r, o, o, o);
|
|
239
|
+
}
|
|
240
|
+
function Ke(e, r, t, n) {
|
|
241
|
+
return c(35, e, t, o, o, o, o, r, o, o, o, n);
|
|
242
|
+
}
|
|
243
|
+
var { toString: bs } = Object.prototype;
|
|
244
|
+
var bn = {
|
|
245
|
+
parsing: 1,
|
|
246
|
+
serialization: 2,
|
|
247
|
+
deserialization: 3
|
|
248
|
+
};
|
|
249
|
+
function vn(e) {
|
|
250
|
+
return `Seroval Error (step: ${bn[e]})`;
|
|
251
|
+
}
|
|
252
|
+
var Cn = (e, r) => vn(e);
|
|
253
|
+
var fe = class extends Error {
|
|
254
|
+
constructor(t, n) {
|
|
255
|
+
super(Cn(t, n));
|
|
256
|
+
this.cause = n;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var z = class extends fe {
|
|
260
|
+
constructor(r) {
|
|
261
|
+
super("parsing", r);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
function _(e) {
|
|
265
|
+
return `Seroval Error (specific: ${e})`;
|
|
266
|
+
}
|
|
267
|
+
var x = class extends Error {
|
|
268
|
+
constructor(t) {
|
|
269
|
+
super(_(1));
|
|
270
|
+
this.value = t;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
var h = class extends Error {
|
|
274
|
+
constructor(r) {
|
|
275
|
+
super(_(2));
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
var X = class extends Error {
|
|
279
|
+
constructor(r) {
|
|
280
|
+
super(_(3));
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
var Re = class extends Error {
|
|
284
|
+
constructor(t) {
|
|
285
|
+
super(_(5));
|
|
286
|
+
this.value = t;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var Q = class extends Error {
|
|
290
|
+
constructor(r) {
|
|
291
|
+
super(_(9));
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
var j = class {
|
|
295
|
+
constructor(r, t) {
|
|
296
|
+
this.value = r;
|
|
297
|
+
this.replacement = t;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
var ee = () => {
|
|
301
|
+
let e = {
|
|
302
|
+
p: 0,
|
|
303
|
+
s: 0,
|
|
304
|
+
f: 0
|
|
305
|
+
};
|
|
306
|
+
return e.p = new Promise((r, t) => {
|
|
307
|
+
e.s = r, e.f = t;
|
|
308
|
+
}), e;
|
|
309
|
+
};
|
|
310
|
+
var An = (e, r) => {
|
|
311
|
+
e.s(r), e.p.s = 1, e.p.v = r;
|
|
312
|
+
};
|
|
313
|
+
var En = (e, r) => {
|
|
314
|
+
e.f(r), e.p.s = 2, e.p.v = r;
|
|
315
|
+
};
|
|
316
|
+
var Nt = ee.toString();
|
|
317
|
+
var bt = An.toString();
|
|
318
|
+
var vt = En.toString();
|
|
319
|
+
var Pr = () => {
|
|
320
|
+
let e = [], r = [], t = !0, n = !1, a = 0, s = (l, g, S) => {
|
|
321
|
+
for (S = 0; S < a; S++) r[S] && r[S][g](l);
|
|
322
|
+
}, i = (l, g, S, d) => {
|
|
323
|
+
for (g = 0, S = e.length; g < S; g++) d = e[g], !t && g === S - 1 ? l[n ? "return" : "throw"](d) : l.next(d);
|
|
324
|
+
}, u = (l, g) => (t && (g = a++, r[g] = l), i(l), () => {
|
|
325
|
+
t && (r[g] = r[a], r[a--] = void 0);
|
|
326
|
+
});
|
|
327
|
+
return {
|
|
328
|
+
__SEROVAL_STREAM__: !0,
|
|
329
|
+
on: (l) => u(l),
|
|
330
|
+
next: (l) => {
|
|
331
|
+
t && (e.push(l), s(l, "next"));
|
|
332
|
+
},
|
|
333
|
+
throw: (l) => {
|
|
334
|
+
t && (e.push(l), s(l, "throw"), t = !1, n = !1, r.length = 0);
|
|
335
|
+
},
|
|
336
|
+
return: (l) => {
|
|
337
|
+
t && (e.push(l), s(l, "return"), t = !1, n = !0, r.length = 0);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
var Ct = Pr.toString();
|
|
342
|
+
var xr = (e) => (r) => () => {
|
|
343
|
+
let t = 0, n = {
|
|
344
|
+
[e]: () => n,
|
|
345
|
+
next: () => {
|
|
346
|
+
if (t > r.d) return {
|
|
347
|
+
done: !0,
|
|
348
|
+
value: void 0
|
|
349
|
+
};
|
|
350
|
+
let a = t++, s = r.v[a];
|
|
351
|
+
if (a === r.t) throw s;
|
|
352
|
+
return {
|
|
353
|
+
done: a === r.d,
|
|
354
|
+
value: s
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
return n;
|
|
359
|
+
};
|
|
360
|
+
var At = xr.toString();
|
|
361
|
+
var Tr = (e, r) => (t) => () => {
|
|
362
|
+
let n = 0, a = -1, s = !1, i = [], u = [], l = (S = 0, d = u.length) => {
|
|
363
|
+
for (; S < d; S++) u[S].s({
|
|
364
|
+
done: !0,
|
|
365
|
+
value: void 0
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
t.on({
|
|
369
|
+
next: (S) => {
|
|
370
|
+
let d = u.shift();
|
|
371
|
+
d && d.s({
|
|
372
|
+
done: !1,
|
|
373
|
+
value: S
|
|
374
|
+
}), i.push(S);
|
|
375
|
+
},
|
|
376
|
+
throw: (S) => {
|
|
377
|
+
let d = u.shift();
|
|
378
|
+
d && d.f(S), l(), a = i.length, s = !0, i.push(S);
|
|
379
|
+
},
|
|
380
|
+
return: (S) => {
|
|
381
|
+
let d = u.shift();
|
|
382
|
+
d && d.s({
|
|
383
|
+
done: !0,
|
|
384
|
+
value: S
|
|
385
|
+
}), l(), a = i.length, i.push(S);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
let g = {
|
|
389
|
+
[e]: () => g,
|
|
390
|
+
next: () => {
|
|
391
|
+
if (a === -1) {
|
|
392
|
+
let G = n++;
|
|
393
|
+
if (G >= i.length) {
|
|
394
|
+
let rt = r();
|
|
395
|
+
return u.push(rt), rt.p;
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
done: !1,
|
|
399
|
+
value: i[G]
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
if (n > a) return {
|
|
403
|
+
done: !0,
|
|
404
|
+
value: void 0
|
|
405
|
+
};
|
|
406
|
+
let S = n++, d = i[S];
|
|
407
|
+
if (S !== a) return {
|
|
408
|
+
done: !1,
|
|
409
|
+
value: d
|
|
410
|
+
};
|
|
411
|
+
if (s) throw d;
|
|
412
|
+
return {
|
|
413
|
+
done: !0,
|
|
414
|
+
value: d
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
return g;
|
|
419
|
+
};
|
|
420
|
+
var Et = Tr.toString();
|
|
421
|
+
var Or = (e) => {
|
|
422
|
+
let r = atob(e), t = r.length, n = new Uint8Array(t);
|
|
423
|
+
for (let a = 0; a < t; a++) n[a] = r.charCodeAt(a);
|
|
424
|
+
return n.buffer;
|
|
425
|
+
};
|
|
426
|
+
var It = Or.toString();
|
|
427
|
+
function Ze(e) {
|
|
428
|
+
return "__SEROVAL_SEQUENCE__" in e;
|
|
429
|
+
}
|
|
430
|
+
function wr(e, r, t) {
|
|
431
|
+
return {
|
|
432
|
+
__SEROVAL_SEQUENCE__: !0,
|
|
433
|
+
v: e,
|
|
434
|
+
t: r,
|
|
435
|
+
d: t
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function $e(e) {
|
|
439
|
+
let r = [], t = -1, n = -1, a = e[C]();
|
|
440
|
+
for (;;) try {
|
|
441
|
+
let s = a.next();
|
|
442
|
+
if (r.push(s.value), s.done) {
|
|
443
|
+
n = r.length - 1;
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
} catch (s) {
|
|
447
|
+
t = r.length, r.push(s);
|
|
448
|
+
}
|
|
449
|
+
return wr(r, t, n);
|
|
450
|
+
}
|
|
451
|
+
var Pt = {};
|
|
452
|
+
var xt = {};
|
|
453
|
+
var Tt = {
|
|
454
|
+
0: {},
|
|
455
|
+
1: {},
|
|
456
|
+
2: {},
|
|
457
|
+
3: {},
|
|
458
|
+
4: {},
|
|
459
|
+
5: {}
|
|
460
|
+
};
|
|
461
|
+
var Ot = {
|
|
462
|
+
0: "[]",
|
|
463
|
+
1: Nt,
|
|
464
|
+
2: bt,
|
|
465
|
+
3: vt,
|
|
466
|
+
4: Ct,
|
|
467
|
+
5: It
|
|
468
|
+
};
|
|
469
|
+
function Xe(e) {
|
|
470
|
+
return "__SEROVAL_STREAM__" in e;
|
|
471
|
+
}
|
|
472
|
+
function re() {
|
|
473
|
+
return Pr();
|
|
474
|
+
}
|
|
475
|
+
function Qe(e) {
|
|
476
|
+
let r = re(), t = e[v]();
|
|
477
|
+
async function n() {
|
|
478
|
+
try {
|
|
479
|
+
let a = await t.next();
|
|
480
|
+
a.done ? r.return(a.value) : (r.next(a.value), await n());
|
|
481
|
+
} catch (a) {
|
|
482
|
+
r.throw(a);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return n().catch(() => {}), r;
|
|
486
|
+
}
|
|
487
|
+
function me(e, r) {
|
|
488
|
+
return {
|
|
489
|
+
plugins: r.plugins,
|
|
490
|
+
mode: e,
|
|
491
|
+
marked: /* @__PURE__ */ new Set(),
|
|
492
|
+
features: 63 ^ (r.disabledFeatures || 0),
|
|
493
|
+
refs: r.refs || /* @__PURE__ */ new Map(),
|
|
494
|
+
depthLimit: r.depthLimit || 1e3
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
function pe(e, r) {
|
|
498
|
+
e.marked.add(r);
|
|
499
|
+
}
|
|
500
|
+
function zr(e, r) {
|
|
501
|
+
let t = e.refs.size;
|
|
502
|
+
return e.refs.set(r, t), t;
|
|
503
|
+
}
|
|
504
|
+
function er(e, r) {
|
|
505
|
+
let t = e.refs.get(r);
|
|
506
|
+
return t != null ? (pe(e, t), {
|
|
507
|
+
type: 1,
|
|
508
|
+
value: pt(t)
|
|
509
|
+
}) : {
|
|
510
|
+
type: 0,
|
|
511
|
+
value: zr(e, r)
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function Y(e, r) {
|
|
515
|
+
let t = er(e, r);
|
|
516
|
+
return t.type === 1 ? t : Ir(r) ? {
|
|
517
|
+
type: 2,
|
|
518
|
+
value: gt(t.value, r)
|
|
519
|
+
} : t;
|
|
520
|
+
}
|
|
521
|
+
function I(e, r) {
|
|
522
|
+
let t = Y(e, r);
|
|
523
|
+
if (t.type !== 0) return t.value;
|
|
524
|
+
if (r in ve) return dt(t.value, r);
|
|
525
|
+
throw new x(r);
|
|
526
|
+
}
|
|
527
|
+
function k(e, r) {
|
|
528
|
+
let t = er(e, Tt[r]);
|
|
529
|
+
return t.type === 1 ? t.value : c(26, t.value, r, o, o, o, o, o, o, o, o, o);
|
|
530
|
+
}
|
|
531
|
+
function rr(e) {
|
|
532
|
+
let r = er(e, Pt);
|
|
533
|
+
return r.type === 1 ? r.value : c(27, r.value, o, o, o, o, o, o, I(e, C), o, o, o);
|
|
534
|
+
}
|
|
535
|
+
function tr(e) {
|
|
536
|
+
let r = er(e, xt);
|
|
537
|
+
return r.type === 1 ? r.value : c(29, r.value, o, o, o, o, o, [k(e, 1), I(e, v)], o, o, o, o);
|
|
538
|
+
}
|
|
539
|
+
function nr(e, r, t, n) {
|
|
540
|
+
return c(t ? 11 : 10, e, o, o, o, n, o, o, o, o, Te(r), o);
|
|
541
|
+
}
|
|
542
|
+
function or(e, r, t, n) {
|
|
543
|
+
return c(8, r, o, o, o, o, {
|
|
544
|
+
k: t,
|
|
545
|
+
v: n
|
|
546
|
+
}, o, k(e, 0), o, o, o);
|
|
547
|
+
}
|
|
548
|
+
function zt(e, r, t) {
|
|
549
|
+
return c(22, r, t, o, o, o, o, o, k(e, 1), o, o, o);
|
|
550
|
+
}
|
|
551
|
+
function ar(e, r, t) {
|
|
552
|
+
let n = new Uint8Array(t), a = "";
|
|
553
|
+
for (let s = 0, i = n.length; s < i; s++) a += String.fromCharCode(n[s]);
|
|
554
|
+
return c(19, r, y(btoa(a)), o, o, o, o, o, k(e, 5), o, o, o);
|
|
555
|
+
}
|
|
556
|
+
var oe = ((t) => (t[t.Vanilla = 1] = "Vanilla", t[t.Cross = 2] = "Cross", t))(oe || {});
|
|
557
|
+
function ai(e) {
|
|
558
|
+
return e;
|
|
559
|
+
}
|
|
560
|
+
function Dt(e, r) {
|
|
561
|
+
for (let t = 0, n = r.length; t < n; t++) {
|
|
562
|
+
let a = r[t];
|
|
563
|
+
e.has(a) || (e.add(a), a.extends && Dt(e, a.extends));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
function A(e) {
|
|
567
|
+
if (e) {
|
|
568
|
+
let r = /* @__PURE__ */ new Set();
|
|
569
|
+
return Dt(r, e), [...r];
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
var Ro = () => T;
|
|
573
|
+
var Po = Ro.toString();
|
|
574
|
+
var Gt = /=>/.test(Po);
|
|
575
|
+
function ir(e, r) {
|
|
576
|
+
return Gt ? (e.length === 1 ? e[0] : "(" + e.join(",") + ")") + "=>" + (r.startsWith("{") ? "(" + r + ")" : r) : "function(" + e.join(",") + "){return " + r + "}";
|
|
577
|
+
}
|
|
578
|
+
function Kt(e, r) {
|
|
579
|
+
return Gt ? (e.length === 1 ? e[0] : "(" + e.join(",") + ")") + "=>{" + r + "}" : "function(" + e.join(",") + "){" + r + "}";
|
|
580
|
+
}
|
|
581
|
+
var Zt = "hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_";
|
|
582
|
+
var Ht = Zt.length;
|
|
583
|
+
var $t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_";
|
|
584
|
+
var Jt = $t.length;
|
|
585
|
+
function Vr(e) {
|
|
586
|
+
let r = e % Ht, t = Zt[r];
|
|
587
|
+
for (e = (e - r) / Ht; e > 0;) r = e % Jt, t += $t[r], e = (e - r) / Jt;
|
|
588
|
+
return t;
|
|
589
|
+
}
|
|
590
|
+
var xo = /^[$A-Z_][0-9A-Z_$]*$/i;
|
|
591
|
+
function Mr(e) {
|
|
592
|
+
let r = e[0];
|
|
593
|
+
return (r === "$" || r === "_" || r >= "A" && r <= "Z" || r >= "a" && r <= "z") && xo.test(e);
|
|
594
|
+
}
|
|
595
|
+
function ye(e) {
|
|
596
|
+
switch (e.t) {
|
|
597
|
+
case 0: return e.s + "=" + e.v;
|
|
598
|
+
case 2: return e.s + ".set(" + e.k + "," + e.v + ")";
|
|
599
|
+
case 1: return e.s + ".add(" + e.v + ")";
|
|
600
|
+
case 3: return e.s + ".delete(" + e.k + ")";
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function To(e) {
|
|
604
|
+
let r = [], t = e[0];
|
|
605
|
+
for (let n = 1, a = e.length, s, i = t; n < a; n++) s = e[n], s.t === 0 && s.v === i.v ? t = {
|
|
606
|
+
t: 0,
|
|
607
|
+
s: s.s,
|
|
608
|
+
k: o,
|
|
609
|
+
v: ye(t)
|
|
610
|
+
} : s.t === 2 && s.s === i.s ? t = {
|
|
611
|
+
t: 2,
|
|
612
|
+
s: ye(t),
|
|
613
|
+
k: s.k,
|
|
614
|
+
v: s.v
|
|
615
|
+
} : s.t === 1 && s.s === i.s ? t = {
|
|
616
|
+
t: 1,
|
|
617
|
+
s: ye(t),
|
|
618
|
+
k: o,
|
|
619
|
+
v: s.v
|
|
620
|
+
} : s.t === 3 && s.s === i.s ? t = {
|
|
621
|
+
t: 3,
|
|
622
|
+
s: ye(t),
|
|
623
|
+
k: s.k,
|
|
624
|
+
v: o
|
|
625
|
+
} : (r.push(t), t = s), i = s;
|
|
626
|
+
return r.push(t), r;
|
|
627
|
+
}
|
|
628
|
+
function on(e) {
|
|
629
|
+
if (e.length) {
|
|
630
|
+
let r = "", t = To(e);
|
|
631
|
+
for (let n = 0, a = t.length; n < a; n++) r += ye(t[n]) + ",";
|
|
632
|
+
return r;
|
|
633
|
+
}
|
|
634
|
+
return o;
|
|
635
|
+
}
|
|
636
|
+
var Oo = "Object.create(null)";
|
|
637
|
+
var wo = "new Set";
|
|
638
|
+
var ho = "new Map";
|
|
639
|
+
var zo = "Promise.resolve";
|
|
640
|
+
var _o = "Promise.reject";
|
|
641
|
+
var ko = {
|
|
642
|
+
3: "Object.freeze",
|
|
643
|
+
2: "Object.seal",
|
|
644
|
+
1: "Object.preventExtensions",
|
|
645
|
+
0: o
|
|
646
|
+
};
|
|
647
|
+
function an(e, r) {
|
|
648
|
+
return {
|
|
649
|
+
mode: e,
|
|
650
|
+
plugins: r.plugins,
|
|
651
|
+
features: r.features,
|
|
652
|
+
marked: new Set(r.markedRefs),
|
|
653
|
+
stack: [],
|
|
654
|
+
flags: [],
|
|
655
|
+
assignments: []
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function lr(e) {
|
|
659
|
+
return {
|
|
660
|
+
mode: 2,
|
|
661
|
+
base: an(2, e),
|
|
662
|
+
state: e,
|
|
663
|
+
child: o
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
var Lr = class {
|
|
667
|
+
constructor(r) {
|
|
668
|
+
this._p = r;
|
|
669
|
+
}
|
|
670
|
+
serialize(r) {
|
|
671
|
+
return f(this._p, r);
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
function Fo(e, r) {
|
|
675
|
+
let t = e.valid.get(r);
|
|
676
|
+
t ?? (t = e.valid.size, e.valid.set(r, t));
|
|
677
|
+
let n = e.vars[t];
|
|
678
|
+
return n ?? (n = Vr(t), e.vars[t] = n), n;
|
|
679
|
+
}
|
|
680
|
+
function Bo(e) {
|
|
681
|
+
return le + "[" + e + "]";
|
|
682
|
+
}
|
|
683
|
+
function m(e, r) {
|
|
684
|
+
return e.mode === 1 ? Fo(e.state, r) : Bo(r);
|
|
685
|
+
}
|
|
686
|
+
function w(e, r) {
|
|
687
|
+
e.marked.add(r);
|
|
688
|
+
}
|
|
689
|
+
function Ur(e, r) {
|
|
690
|
+
return e.marked.has(r);
|
|
691
|
+
}
|
|
692
|
+
function Yr(e, r, t) {
|
|
693
|
+
r !== 0 && (w(e.base, t), e.base.flags.push({
|
|
694
|
+
type: r,
|
|
695
|
+
value: m(e, t)
|
|
696
|
+
}));
|
|
697
|
+
}
|
|
698
|
+
function Vo(e) {
|
|
699
|
+
let r = "";
|
|
700
|
+
for (let t = 0, n = e.flags, a = n.length; t < a; t++) {
|
|
701
|
+
let s = n[t];
|
|
702
|
+
r += ko[s.type] + "(" + s.value + "),";
|
|
703
|
+
}
|
|
704
|
+
return r;
|
|
705
|
+
}
|
|
706
|
+
function sn(e) {
|
|
707
|
+
let r = on(e.assignments), t = Vo(e);
|
|
708
|
+
return r ? t ? r + t : r : t;
|
|
709
|
+
}
|
|
710
|
+
function qr(e, r, t) {
|
|
711
|
+
e.assignments.push({
|
|
712
|
+
t: 0,
|
|
713
|
+
s: r,
|
|
714
|
+
k: o,
|
|
715
|
+
v: t
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
function Mo(e, r, t) {
|
|
719
|
+
e.base.assignments.push({
|
|
720
|
+
t: 1,
|
|
721
|
+
s: m(e, r),
|
|
722
|
+
k: o,
|
|
723
|
+
v: t
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
function ge(e, r, t, n) {
|
|
727
|
+
e.base.assignments.push({
|
|
728
|
+
t: 2,
|
|
729
|
+
s: m(e, r),
|
|
730
|
+
k: t,
|
|
731
|
+
v: n
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
function Xt(e, r, t) {
|
|
735
|
+
e.base.assignments.push({
|
|
736
|
+
t: 3,
|
|
737
|
+
s: m(e, r),
|
|
738
|
+
k: t,
|
|
739
|
+
v: o
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
function Ne(e, r, t, n) {
|
|
743
|
+
qr(e.base, m(e, r) + "[" + t + "]", n);
|
|
744
|
+
}
|
|
745
|
+
function jr(e, r, t, n) {
|
|
746
|
+
qr(e.base, m(e, r) + "." + t, n);
|
|
747
|
+
}
|
|
748
|
+
function Lo(e, r, t, n) {
|
|
749
|
+
qr(e.base, m(e, r) + ".v[" + t + "]", n);
|
|
750
|
+
}
|
|
751
|
+
function F(e, r) {
|
|
752
|
+
return r.t === 4 && e.stack.includes(r.i);
|
|
753
|
+
}
|
|
754
|
+
function ae(e, r, t) {
|
|
755
|
+
return e.mode === 1 && !Ur(e.base, r) ? t : m(e, r) + "=" + t;
|
|
756
|
+
}
|
|
757
|
+
function Uo(e) {
|
|
758
|
+
return L + ".get(\"" + e.s + "\")";
|
|
759
|
+
}
|
|
760
|
+
function Qt(e, r, t, n) {
|
|
761
|
+
return t ? F(e.base, t) ? (w(e.base, r), Ne(e, r, n, m(e, t.i)), "") : f(e, t) : "";
|
|
762
|
+
}
|
|
763
|
+
function jo(e, r) {
|
|
764
|
+
let t = r.i, n = r.a, a = n.length;
|
|
765
|
+
if (a > 0) {
|
|
766
|
+
e.base.stack.push(t);
|
|
767
|
+
let s = Qt(e, t, n[0], 0), i = s === "";
|
|
768
|
+
for (let u = 1, l; u < a; u++) l = Qt(e, t, n[u], u), s += "," + l, i = l === "";
|
|
769
|
+
return e.base.stack.pop(), Yr(e, r.o, r.i), "[" + s + (i ? ",]" : "]");
|
|
770
|
+
}
|
|
771
|
+
return "[]";
|
|
772
|
+
}
|
|
773
|
+
function en(e, r, t, n) {
|
|
774
|
+
if (typeof t == "string") {
|
|
775
|
+
let a = Number(t), s = a >= 0 && a.toString() === t || Mr(t);
|
|
776
|
+
if (F(e.base, n)) {
|
|
777
|
+
let i = m(e, n.i);
|
|
778
|
+
return w(e.base, r.i), s && a !== a ? jr(e, r.i, t, i) : Ne(e, r.i, s ? t : "\"" + t + "\"", i), "";
|
|
779
|
+
}
|
|
780
|
+
return (s ? t : "\"" + t + "\"") + ":" + f(e, n);
|
|
781
|
+
}
|
|
782
|
+
return "[" + f(e, t) + "]:" + f(e, n);
|
|
783
|
+
}
|
|
784
|
+
function un(e, r, t) {
|
|
785
|
+
let n = t.k, a = n.length;
|
|
786
|
+
if (a > 0) {
|
|
787
|
+
let s = t.v;
|
|
788
|
+
e.base.stack.push(r.i);
|
|
789
|
+
let i = en(e, r, n[0], s[0]);
|
|
790
|
+
for (let u = 1, l = i; u < a; u++) l = en(e, r, n[u], s[u]), i += (l && i && ",") + l;
|
|
791
|
+
return e.base.stack.pop(), "{" + i + "}";
|
|
792
|
+
}
|
|
793
|
+
return "{}";
|
|
794
|
+
}
|
|
795
|
+
function Yo(e, r) {
|
|
796
|
+
return Yr(e, r.o, r.i), un(e, r, r.p);
|
|
797
|
+
}
|
|
798
|
+
function qo(e, r, t, n) {
|
|
799
|
+
let a = un(e, r, t);
|
|
800
|
+
return a !== "{}" ? "Object.assign(" + n + "," + a + ")" : n;
|
|
801
|
+
}
|
|
802
|
+
function Wo(e, r, t, n, a) {
|
|
803
|
+
let s = e.base, i = f(e, a), u = Number(n), l = u >= 0 && u.toString() === n || Mr(n);
|
|
804
|
+
if (F(s, a)) l && u !== u ? jr(e, r.i, n, i) : Ne(e, r.i, l ? n : "\"" + n + "\"", i);
|
|
805
|
+
else {
|
|
806
|
+
let g = s.assignments;
|
|
807
|
+
s.assignments = t, l && u !== u ? jr(e, r.i, n, i) : Ne(e, r.i, l ? n : "\"" + n + "\"", i), s.assignments = g;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
function Go(e, r, t, n, a) {
|
|
811
|
+
if (typeof n == "string") Wo(e, r, t, n, a);
|
|
812
|
+
else {
|
|
813
|
+
let s = e.base, i = s.stack;
|
|
814
|
+
s.stack = [];
|
|
815
|
+
let u = f(e, a);
|
|
816
|
+
s.stack = i;
|
|
817
|
+
let l = s.assignments;
|
|
818
|
+
s.assignments = t, Ne(e, r.i, f(e, n), u), s.assignments = l;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
function Ko(e, r, t) {
|
|
822
|
+
let n = t.k, a = n.length;
|
|
823
|
+
if (a > 0) {
|
|
824
|
+
let s = [], i = t.v;
|
|
825
|
+
e.base.stack.push(r.i);
|
|
826
|
+
for (let u = 0; u < a; u++) Go(e, r, s, n[u], i[u]);
|
|
827
|
+
return e.base.stack.pop(), on(s);
|
|
828
|
+
}
|
|
829
|
+
return o;
|
|
830
|
+
}
|
|
831
|
+
function Wr(e, r, t) {
|
|
832
|
+
if (r.p) {
|
|
833
|
+
let n = e.base;
|
|
834
|
+
if (n.features & 8) t = qo(e, r, r.p, t);
|
|
835
|
+
else {
|
|
836
|
+
w(n, r.i);
|
|
837
|
+
let a = Ko(e, r, r.p);
|
|
838
|
+
if (a) return "(" + ae(e, r.i, t) + "," + a + m(e, r.i) + ")";
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return t;
|
|
842
|
+
}
|
|
843
|
+
function Ho(e, r) {
|
|
844
|
+
return Yr(e, r.o, r.i), Wr(e, r, Oo);
|
|
845
|
+
}
|
|
846
|
+
function Jo(e) {
|
|
847
|
+
return "new Date(\"" + e.s + "\")";
|
|
848
|
+
}
|
|
849
|
+
function Zo(e, r) {
|
|
850
|
+
if (e.base.features & 32) return "/" + r.c + "/" + r.m;
|
|
851
|
+
throw new h(r);
|
|
852
|
+
}
|
|
853
|
+
function rn(e, r, t) {
|
|
854
|
+
let n = e.base;
|
|
855
|
+
return F(n, t) ? (w(n, r), Mo(e, r, m(e, t.i)), "") : f(e, t);
|
|
856
|
+
}
|
|
857
|
+
function $o(e, r) {
|
|
858
|
+
let t = wo, n = r.a, a = n.length, s = r.i;
|
|
859
|
+
if (a > 0) {
|
|
860
|
+
e.base.stack.push(s);
|
|
861
|
+
let i = rn(e, s, n[0]);
|
|
862
|
+
for (let u = 1, l = i; u < a; u++) l = rn(e, s, n[u]), i += (l && i && ",") + l;
|
|
863
|
+
e.base.stack.pop(), i && (t += "([" + i + "])");
|
|
864
|
+
}
|
|
865
|
+
return t;
|
|
866
|
+
}
|
|
867
|
+
function tn(e, r, t, n, a) {
|
|
868
|
+
let s = e.base;
|
|
869
|
+
if (F(s, t)) {
|
|
870
|
+
let i = m(e, t.i);
|
|
871
|
+
if (w(s, r), F(s, n)) return ge(e, r, i, m(e, n.i)), "";
|
|
872
|
+
if (n.t !== 4 && n.i != null && Ur(s, n.i)) {
|
|
873
|
+
let l = "(" + f(e, n) + ",[" + a + "," + a + "])";
|
|
874
|
+
return ge(e, r, i, m(e, n.i)), Xt(e, r, a), l;
|
|
875
|
+
}
|
|
876
|
+
let u = s.stack;
|
|
877
|
+
return s.stack = [], ge(e, r, i, f(e, n)), s.stack = u, "";
|
|
878
|
+
}
|
|
879
|
+
if (F(s, n)) {
|
|
880
|
+
let i = m(e, n.i);
|
|
881
|
+
if (w(s, r), t.t !== 4 && t.i != null && Ur(s, t.i)) {
|
|
882
|
+
let l = "(" + f(e, t) + ",[" + a + "," + a + "])";
|
|
883
|
+
return ge(e, r, m(e, t.i), i), Xt(e, r, a), l;
|
|
884
|
+
}
|
|
885
|
+
let u = s.stack;
|
|
886
|
+
return s.stack = [], ge(e, r, f(e, t), i), s.stack = u, "";
|
|
887
|
+
}
|
|
888
|
+
return "[" + f(e, t) + "," + f(e, n) + "]";
|
|
889
|
+
}
|
|
890
|
+
function Xo(e, r) {
|
|
891
|
+
let t = ho, n = r.e.k, a = n.length, s = r.i, i = r.f, u = m(e, i.i), l = e.base;
|
|
892
|
+
if (a > 0) {
|
|
893
|
+
let g = r.e.v;
|
|
894
|
+
l.stack.push(s);
|
|
895
|
+
let S = tn(e, s, n[0], g[0], u);
|
|
896
|
+
for (let d = 1, G = S; d < a; d++) G = tn(e, s, n[d], g[d], u), S += (G && S && ",") + G;
|
|
897
|
+
l.stack.pop(), S && (t += "([" + S + "])");
|
|
898
|
+
}
|
|
899
|
+
return i.t === 26 && (w(l, i.i), t = "(" + f(e, i) + "," + t + ")"), t;
|
|
900
|
+
}
|
|
901
|
+
function Qo(e, r) {
|
|
902
|
+
return q(e, r.f) + "(\"" + r.s + "\")";
|
|
903
|
+
}
|
|
904
|
+
function ea(e, r) {
|
|
905
|
+
return "new " + r.c + "(" + f(e, r.f) + "," + r.b + "," + r.l + ")";
|
|
906
|
+
}
|
|
907
|
+
function ra(e, r) {
|
|
908
|
+
return "new DataView(" + f(e, r.f) + "," + r.b + "," + r.l + ")";
|
|
909
|
+
}
|
|
910
|
+
function ta(e, r) {
|
|
911
|
+
let t = r.i;
|
|
912
|
+
e.base.stack.push(t);
|
|
913
|
+
let n = Wr(e, r, "new AggregateError([],\"" + r.m + "\")");
|
|
914
|
+
return e.base.stack.pop(), n;
|
|
915
|
+
}
|
|
916
|
+
function na(e, r) {
|
|
917
|
+
return Wr(e, r, "new " + Ce[r.s] + "(\"" + r.m + "\")");
|
|
918
|
+
}
|
|
919
|
+
function oa(e, r) {
|
|
920
|
+
let t, n = r.f, a = r.i, s = r.s ? zo : _o, i = e.base;
|
|
921
|
+
if (F(i, n)) {
|
|
922
|
+
let u = m(e, n.i);
|
|
923
|
+
t = s + (r.s ? "().then(" + ir([], u) + ")" : "().catch(" + Kt([], "throw " + u) + ")");
|
|
924
|
+
} else {
|
|
925
|
+
i.stack.push(a);
|
|
926
|
+
let u = f(e, n);
|
|
927
|
+
i.stack.pop(), t = s + "(" + u + ")";
|
|
928
|
+
}
|
|
929
|
+
return t;
|
|
930
|
+
}
|
|
931
|
+
function aa(e, r) {
|
|
932
|
+
return "Object(" + f(e, r.f) + ")";
|
|
933
|
+
}
|
|
934
|
+
function q(e, r) {
|
|
935
|
+
let t = f(e, r);
|
|
936
|
+
return r.t === 4 ? t : "(" + t + ")";
|
|
937
|
+
}
|
|
938
|
+
function sa(e, r) {
|
|
939
|
+
if (e.mode === 1) throw new h(r);
|
|
940
|
+
return "(" + ae(e, r.s, q(e, r.f) + "()") + ").p";
|
|
941
|
+
}
|
|
942
|
+
function ia(e, r) {
|
|
943
|
+
if (e.mode === 1) throw new h(r);
|
|
944
|
+
return q(e, r.a[0]) + "(" + m(e, r.i) + "," + f(e, r.a[1]) + ")";
|
|
945
|
+
}
|
|
946
|
+
function ua(e, r) {
|
|
947
|
+
if (e.mode === 1) throw new h(r);
|
|
948
|
+
return q(e, r.a[0]) + "(" + m(e, r.i) + "," + f(e, r.a[1]) + ")";
|
|
949
|
+
}
|
|
950
|
+
function la(e, r) {
|
|
951
|
+
let t = e.base.plugins;
|
|
952
|
+
if (t) for (let n = 0, a = t.length; n < a; n++) {
|
|
953
|
+
let s = t[n];
|
|
954
|
+
if (s.tag === r.c) return e.child ??= new Lr(e), s.serialize(r.s, e.child, { id: r.i });
|
|
955
|
+
}
|
|
956
|
+
throw new X(r.c);
|
|
957
|
+
}
|
|
958
|
+
function ca(e, r) {
|
|
959
|
+
let t = "", n = !1;
|
|
960
|
+
return r.f.t !== 4 && (w(e.base, r.f.i), t = "(" + f(e, r.f) + ",", n = !0), t += ae(e, r.i, "(" + At + ")(" + m(e, r.f.i) + ")"), n && (t += ")"), t;
|
|
961
|
+
}
|
|
962
|
+
function fa(e, r) {
|
|
963
|
+
return q(e, r.a[0]) + "(" + f(e, r.a[1]) + ")";
|
|
964
|
+
}
|
|
965
|
+
function Sa(e, r) {
|
|
966
|
+
let t = r.a[0], n = r.a[1], a = e.base, s = "";
|
|
967
|
+
t.t !== 4 && (w(a, t.i), s += "(" + f(e, t)), n.t !== 4 && (w(a, n.i), s += (s ? "," : "(") + f(e, n)), s && (s += ",");
|
|
968
|
+
let i = ae(e, r.i, "(" + Et + ")(" + m(e, n.i) + "," + m(e, t.i) + ")");
|
|
969
|
+
return s ? s + i + ")" : i;
|
|
970
|
+
}
|
|
971
|
+
function ma(e, r) {
|
|
972
|
+
return q(e, r.a[0]) + "(" + f(e, r.a[1]) + ")";
|
|
973
|
+
}
|
|
974
|
+
function pa(e, r) {
|
|
975
|
+
let t = ae(e, r.i, q(e, r.f) + "()"), n = r.a.length;
|
|
976
|
+
if (n) {
|
|
977
|
+
let a = f(e, r.a[0]);
|
|
978
|
+
for (let s = 1; s < n; s++) a += "," + f(e, r.a[s]);
|
|
979
|
+
return "(" + t + "," + a + "," + m(e, r.i) + ")";
|
|
980
|
+
}
|
|
981
|
+
return t;
|
|
982
|
+
}
|
|
983
|
+
function da(e, r) {
|
|
984
|
+
return m(e, r.i) + ".next(" + f(e, r.f) + ")";
|
|
985
|
+
}
|
|
986
|
+
function ga(e, r) {
|
|
987
|
+
return m(e, r.i) + ".throw(" + f(e, r.f) + ")";
|
|
988
|
+
}
|
|
989
|
+
function ya(e, r) {
|
|
990
|
+
return m(e, r.i) + ".return(" + f(e, r.f) + ")";
|
|
991
|
+
}
|
|
992
|
+
function nn(e, r, t, n) {
|
|
993
|
+
let a = e.base;
|
|
994
|
+
return F(a, n) ? (w(a, r), Lo(e, r, t, m(e, n.i)), "") : f(e, n);
|
|
995
|
+
}
|
|
996
|
+
function Na(e, r) {
|
|
997
|
+
let t = r.a, n = t.length, a = r.i;
|
|
998
|
+
if (n > 0) {
|
|
999
|
+
e.base.stack.push(a);
|
|
1000
|
+
let s = nn(e, a, 0, t[0]);
|
|
1001
|
+
for (let i = 1, u = s; i < n; i++) u = nn(e, a, i, t[i]), s += (u && s && ",") + u;
|
|
1002
|
+
if (e.base.stack.pop(), s) return "{__SEROVAL_SEQUENCE__:!0,v:[" + s + "],t:" + r.s + ",d:" + r.l + "}";
|
|
1003
|
+
}
|
|
1004
|
+
return "{__SEROVAL_SEQUENCE__:!0,v:[],t:-1,d:0}";
|
|
1005
|
+
}
|
|
1006
|
+
function ba(e, r) {
|
|
1007
|
+
switch (r.t) {
|
|
1008
|
+
case 17: return tt[r.s];
|
|
1009
|
+
case 18: return Uo(r);
|
|
1010
|
+
case 9: return jo(e, r);
|
|
1011
|
+
case 10: return Yo(e, r);
|
|
1012
|
+
case 11: return Ho(e, r);
|
|
1013
|
+
case 5: return Jo(r);
|
|
1014
|
+
case 6: return Zo(e, r);
|
|
1015
|
+
case 7: return $o(e, r);
|
|
1016
|
+
case 8: return Xo(e, r);
|
|
1017
|
+
case 19: return Qo(e, r);
|
|
1018
|
+
case 16:
|
|
1019
|
+
case 15: return ea(e, r);
|
|
1020
|
+
case 20: return ra(e, r);
|
|
1021
|
+
case 14: return ta(e, r);
|
|
1022
|
+
case 13: return na(e, r);
|
|
1023
|
+
case 12: return oa(e, r);
|
|
1024
|
+
case 21: return aa(e, r);
|
|
1025
|
+
case 22: return sa(e, r);
|
|
1026
|
+
case 25: return la(e, r);
|
|
1027
|
+
case 26: return Ot[r.s];
|
|
1028
|
+
case 35: return Na(e, r);
|
|
1029
|
+
default: throw new h(r);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
function f(e, r) {
|
|
1033
|
+
switch (r.t) {
|
|
1034
|
+
case 2: return ot[r.s];
|
|
1035
|
+
case 0: return "" + r.s;
|
|
1036
|
+
case 1: return "\"" + r.s + "\"";
|
|
1037
|
+
case 3: return r.s + "n";
|
|
1038
|
+
case 4: return m(e, r.i);
|
|
1039
|
+
case 23: return ia(e, r);
|
|
1040
|
+
case 24: return ua(e, r);
|
|
1041
|
+
case 27: return ca(e, r);
|
|
1042
|
+
case 28: return fa(e, r);
|
|
1043
|
+
case 29: return Sa(e, r);
|
|
1044
|
+
case 30: return ma(e, r);
|
|
1045
|
+
case 31: return pa(e, r);
|
|
1046
|
+
case 32: return da(e, r);
|
|
1047
|
+
case 33: return ga(e, r);
|
|
1048
|
+
case 34: return ya(e, r);
|
|
1049
|
+
default: return ae(e, r.i, ba(e, r));
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
function fr(e, r) {
|
|
1053
|
+
let t = f(e, r), n = r.i;
|
|
1054
|
+
if (n == null) return t;
|
|
1055
|
+
let a = sn(e.base), s = m(e, n), i = e.state.scopeId, u = i == null ? "" : le, l = a ? "(" + t + "," + a + s + ")" : t;
|
|
1056
|
+
if (u === "") return r.t === 10 && !a ? "(" + l + ")" : l;
|
|
1057
|
+
let g = i == null ? "()" : "(" + le + "[\"" + y(i) + "\"])";
|
|
1058
|
+
return "(" + ir([u], l) + ")" + g;
|
|
1059
|
+
}
|
|
1060
|
+
var Kr = class {
|
|
1061
|
+
constructor(r, t) {
|
|
1062
|
+
this._p = r;
|
|
1063
|
+
this.depth = t;
|
|
1064
|
+
}
|
|
1065
|
+
parse(r) {
|
|
1066
|
+
return E(this._p, this.depth, r);
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
var Hr = class {
|
|
1070
|
+
constructor(r, t) {
|
|
1071
|
+
this._p = r;
|
|
1072
|
+
this.depth = t;
|
|
1073
|
+
}
|
|
1074
|
+
parse(r) {
|
|
1075
|
+
return E(this._p, this.depth, r);
|
|
1076
|
+
}
|
|
1077
|
+
parseWithError(r) {
|
|
1078
|
+
return W(this._p, this.depth, r);
|
|
1079
|
+
}
|
|
1080
|
+
isAlive() {
|
|
1081
|
+
return this._p.state.alive;
|
|
1082
|
+
}
|
|
1083
|
+
pushPendingState() {
|
|
1084
|
+
Qr(this._p);
|
|
1085
|
+
}
|
|
1086
|
+
popPendingState() {
|
|
1087
|
+
be(this._p);
|
|
1088
|
+
}
|
|
1089
|
+
onParse(r) {
|
|
1090
|
+
se(this._p, r);
|
|
1091
|
+
}
|
|
1092
|
+
onError(r) {
|
|
1093
|
+
$r(this._p, r);
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1096
|
+
function va(e) {
|
|
1097
|
+
return {
|
|
1098
|
+
alive: !0,
|
|
1099
|
+
pending: 0,
|
|
1100
|
+
initial: !0,
|
|
1101
|
+
buffer: [],
|
|
1102
|
+
onParse: e.onParse,
|
|
1103
|
+
onError: e.onError,
|
|
1104
|
+
onDone: e.onDone
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
function Jr(e) {
|
|
1108
|
+
return {
|
|
1109
|
+
type: 2,
|
|
1110
|
+
base: me(2, e),
|
|
1111
|
+
state: va(e)
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
function Ca(e, r, t) {
|
|
1115
|
+
let n = [];
|
|
1116
|
+
for (let a = 0, s = t.length; a < s; a++) a in t ? n[a] = E(e, r, t[a]) : n[a] = 0;
|
|
1117
|
+
return n;
|
|
1118
|
+
}
|
|
1119
|
+
function Aa(e, r, t, n) {
|
|
1120
|
+
return _e(t, n, Ca(e, r, n));
|
|
1121
|
+
}
|
|
1122
|
+
function Zr(e, r, t) {
|
|
1123
|
+
let n = Object.entries(t), a = [], s = [];
|
|
1124
|
+
for (let i = 0, u = n.length; i < u; i++) a.push(y(n[i][0])), s.push(E(e, r, n[i][1]));
|
|
1125
|
+
return C in t && (a.push(I(e.base, C)), s.push(Ue(rr(e.base), E(e, r, $e(t))))), v in t && (a.push(I(e.base, v)), s.push(je(tr(e.base), E(e, r, e.type === 1 ? re() : Qe(t))))), P in t && (a.push(I(e.base, P)), s.push($(t[P]))), R in t && (a.push(I(e.base, R)), s.push(t[R] ? H : J)), {
|
|
1126
|
+
k: a,
|
|
1127
|
+
v: s
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
function Gr(e, r, t, n, a) {
|
|
1131
|
+
return nr(t, n, a, Zr(e, r, n));
|
|
1132
|
+
}
|
|
1133
|
+
function Ea(e, r, t, n) {
|
|
1134
|
+
return ke(t, E(e, r, n.valueOf()));
|
|
1135
|
+
}
|
|
1136
|
+
function Ia(e, r, t, n) {
|
|
1137
|
+
return De(t, n, E(e, r, n.buffer));
|
|
1138
|
+
}
|
|
1139
|
+
function Ra(e, r, t, n) {
|
|
1140
|
+
return Fe(t, n, E(e, r, n.buffer));
|
|
1141
|
+
}
|
|
1142
|
+
function Pa(e, r, t, n) {
|
|
1143
|
+
return Be(t, n, E(e, r, n.buffer));
|
|
1144
|
+
}
|
|
1145
|
+
function ln(e, r, t, n) {
|
|
1146
|
+
let a = Z(n, e.base.features);
|
|
1147
|
+
return Ve(t, n, a ? Zr(e, r, a) : o);
|
|
1148
|
+
}
|
|
1149
|
+
function xa(e, r, t, n) {
|
|
1150
|
+
let a = Z(n, e.base.features);
|
|
1151
|
+
return Me(t, n, a ? Zr(e, r, a) : o);
|
|
1152
|
+
}
|
|
1153
|
+
function Ta(e, r, t, n) {
|
|
1154
|
+
let a = [], s = [];
|
|
1155
|
+
for (let [i, u] of n.entries()) a.push(E(e, r, i)), s.push(E(e, r, u));
|
|
1156
|
+
return or(e.base, t, a, s);
|
|
1157
|
+
}
|
|
1158
|
+
function Oa(e, r, t, n) {
|
|
1159
|
+
let a = [];
|
|
1160
|
+
for (let s of n.keys()) a.push(E(e, r, s));
|
|
1161
|
+
return Le(t, a);
|
|
1162
|
+
}
|
|
1163
|
+
function wa(e, r, t, n) {
|
|
1164
|
+
let a = Ye(t, k(e.base, 4), []);
|
|
1165
|
+
return e.type === 1 || (Qr(e), n.on({
|
|
1166
|
+
next: (s) => {
|
|
1167
|
+
if (e.state.alive) {
|
|
1168
|
+
let i = W(e, r, s);
|
|
1169
|
+
i && se(e, qe(t, i));
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
throw: (s) => {
|
|
1173
|
+
if (e.state.alive) {
|
|
1174
|
+
let i = W(e, r, s);
|
|
1175
|
+
i && se(e, We(t, i));
|
|
1176
|
+
}
|
|
1177
|
+
be(e);
|
|
1178
|
+
},
|
|
1179
|
+
return: (s) => {
|
|
1180
|
+
if (e.state.alive) {
|
|
1181
|
+
let i = W(e, r, s);
|
|
1182
|
+
i && se(e, Ge(t, i));
|
|
1183
|
+
}
|
|
1184
|
+
be(e);
|
|
1185
|
+
}
|
|
1186
|
+
})), a;
|
|
1187
|
+
}
|
|
1188
|
+
function ha(e, r, t) {
|
|
1189
|
+
if (this.state.alive) {
|
|
1190
|
+
let n = W(this, r, t);
|
|
1191
|
+
n && se(this, c(23, e, o, o, o, o, o, [k(this.base, 2), n], o, o, o, o)), be(this);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
function za(e, r, t) {
|
|
1195
|
+
if (this.state.alive) {
|
|
1196
|
+
let n = W(this, r, t);
|
|
1197
|
+
n && se(this, c(24, e, o, o, o, o, o, [k(this.base, 3), n], o, o, o, o));
|
|
1198
|
+
}
|
|
1199
|
+
be(this);
|
|
1200
|
+
}
|
|
1201
|
+
function _a(e, r, t, n) {
|
|
1202
|
+
let a = zr(e.base, {});
|
|
1203
|
+
return e.type === 2 && (Qr(e), n.then(ha.bind(e, a, r), za.bind(e, a, r))), zt(e.base, t, a);
|
|
1204
|
+
}
|
|
1205
|
+
function ka(e, r, t, n, a) {
|
|
1206
|
+
for (let s = 0, i = a.length; s < i; s++) {
|
|
1207
|
+
let u = a[s];
|
|
1208
|
+
if (u.parse.sync && u.test(n)) return ce(t, u.tag, u.parse.sync(n, new Kr(e, r), { id: t }));
|
|
1209
|
+
}
|
|
1210
|
+
return o;
|
|
1211
|
+
}
|
|
1212
|
+
function Da(e, r, t, n, a) {
|
|
1213
|
+
for (let s = 0, i = a.length; s < i; s++) {
|
|
1214
|
+
let u = a[s];
|
|
1215
|
+
if (u.parse.stream && u.test(n)) return ce(t, u.tag, u.parse.stream(n, new Hr(e, r), { id: t }));
|
|
1216
|
+
}
|
|
1217
|
+
return o;
|
|
1218
|
+
}
|
|
1219
|
+
function cn(e, r, t, n) {
|
|
1220
|
+
let a = e.base.plugins;
|
|
1221
|
+
return a ? e.type === 1 ? ka(e, r, t, n, a) : Da(e, r, t, n, a) : o;
|
|
1222
|
+
}
|
|
1223
|
+
function Fa(e, r, t, n) {
|
|
1224
|
+
let a = [];
|
|
1225
|
+
for (let s = 0, i = n.v.length; s < i; s++) a[s] = E(e, r, n.v[s]);
|
|
1226
|
+
return Ke(t, a, n.t, n.d);
|
|
1227
|
+
}
|
|
1228
|
+
function Ba(e, r, t, n, a) {
|
|
1229
|
+
switch (a) {
|
|
1230
|
+
case Object: return Gr(e, r, t, n, !1);
|
|
1231
|
+
case o: return Gr(e, r, t, n, !0);
|
|
1232
|
+
case Date: return he(t, n);
|
|
1233
|
+
case Error:
|
|
1234
|
+
case EvalError:
|
|
1235
|
+
case RangeError:
|
|
1236
|
+
case ReferenceError:
|
|
1237
|
+
case SyntaxError:
|
|
1238
|
+
case TypeError:
|
|
1239
|
+
case URIError: return ln(e, r, t, n);
|
|
1240
|
+
case Number:
|
|
1241
|
+
case Boolean:
|
|
1242
|
+
case String:
|
|
1243
|
+
case BigInt: return Ea(e, r, t, n);
|
|
1244
|
+
case ArrayBuffer: return ar(e.base, t, n);
|
|
1245
|
+
case Int8Array:
|
|
1246
|
+
case Int16Array:
|
|
1247
|
+
case Int32Array:
|
|
1248
|
+
case Uint8Array:
|
|
1249
|
+
case Uint16Array:
|
|
1250
|
+
case Uint32Array:
|
|
1251
|
+
case Uint8ClampedArray:
|
|
1252
|
+
case Float32Array:
|
|
1253
|
+
case Float64Array: return Ia(e, r, t, n);
|
|
1254
|
+
case DataView: return Pa(e, r, t, n);
|
|
1255
|
+
case Map: return Ta(e, r, t, n);
|
|
1256
|
+
case Set: return Oa(e, r, t, n);
|
|
1257
|
+
default: break;
|
|
1258
|
+
}
|
|
1259
|
+
if (a === Promise || n instanceof Promise) return _a(e, r, t, n);
|
|
1260
|
+
let s = e.base.features;
|
|
1261
|
+
if (s & 32 && a === RegExp) return ze(t, n);
|
|
1262
|
+
if (s & 16) switch (a) {
|
|
1263
|
+
case BigInt64Array:
|
|
1264
|
+
case BigUint64Array: return Ra(e, r, t, n);
|
|
1265
|
+
default: break;
|
|
1266
|
+
}
|
|
1267
|
+
if (s & 1 && typeof AggregateError != "undefined" && (a === AggregateError || n instanceof AggregateError)) return xa(e, r, t, n);
|
|
1268
|
+
if (n instanceof Error) return ln(e, r, t, n);
|
|
1269
|
+
if (C in n || v in n) return Gr(e, r, t, n, !!a);
|
|
1270
|
+
throw new x(n);
|
|
1271
|
+
}
|
|
1272
|
+
function Va(e, r, t, n) {
|
|
1273
|
+
if (Array.isArray(n)) return Aa(e, r, t, n);
|
|
1274
|
+
if (Xe(n)) return wa(e, r, t, n);
|
|
1275
|
+
if (Ze(n)) return Fa(e, r, t, n);
|
|
1276
|
+
let a = n.constructor;
|
|
1277
|
+
if (a === j) return E(e, r, n.replacement);
|
|
1278
|
+
return cn(e, r, t, n) || Ba(e, r, t, n, a);
|
|
1279
|
+
}
|
|
1280
|
+
function Ma(e, r, t) {
|
|
1281
|
+
let n = Y(e.base, t);
|
|
1282
|
+
if (n.type !== 0) return n.value;
|
|
1283
|
+
let a = cn(e, r, n.value, t);
|
|
1284
|
+
if (a) return a;
|
|
1285
|
+
throw new x(t);
|
|
1286
|
+
}
|
|
1287
|
+
function E(e, r, t) {
|
|
1288
|
+
if (r >= e.base.depthLimit) throw new Q(e.base.depthLimit);
|
|
1289
|
+
switch (typeof t) {
|
|
1290
|
+
case "boolean": return t ? H : J;
|
|
1291
|
+
case "undefined": return Ae;
|
|
1292
|
+
case "string": return $(t);
|
|
1293
|
+
case "number": return Oe(t);
|
|
1294
|
+
case "bigint": return we(t);
|
|
1295
|
+
case "object":
|
|
1296
|
+
if (t) {
|
|
1297
|
+
let n = Y(e.base, t);
|
|
1298
|
+
return n.type === 0 ? Va(e, r + 1, n.value, t) : n.value;
|
|
1299
|
+
}
|
|
1300
|
+
return Ee;
|
|
1301
|
+
case "symbol": return I(e.base, t);
|
|
1302
|
+
case "function": return Ma(e, r, t);
|
|
1303
|
+
default: throw new x(t);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
function se(e, r) {
|
|
1307
|
+
e.state.initial ? e.state.buffer.push(r) : Xr(e, r, !1);
|
|
1308
|
+
}
|
|
1309
|
+
function $r(e, r) {
|
|
1310
|
+
if (e.state.onError) e.state.onError(r);
|
|
1311
|
+
else throw r instanceof z ? r : new z(r);
|
|
1312
|
+
}
|
|
1313
|
+
function fn(e) {
|
|
1314
|
+
e.state.onDone && e.state.onDone();
|
|
1315
|
+
}
|
|
1316
|
+
function Xr(e, r, t) {
|
|
1317
|
+
try {
|
|
1318
|
+
e.state.onParse(r, t);
|
|
1319
|
+
} catch (n) {
|
|
1320
|
+
$r(e, n);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
function Qr(e) {
|
|
1324
|
+
e.state.pending++;
|
|
1325
|
+
}
|
|
1326
|
+
function be(e) {
|
|
1327
|
+
--e.state.pending <= 0 && fn(e);
|
|
1328
|
+
}
|
|
1329
|
+
function W(e, r, t) {
|
|
1330
|
+
try {
|
|
1331
|
+
return E(e, r, t);
|
|
1332
|
+
} catch (n) {
|
|
1333
|
+
return $r(e, n), o;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
function et(e, r) {
|
|
1337
|
+
let t = W(e, 0, r);
|
|
1338
|
+
t && (Xr(e, t, !0), e.state.initial = !1, La(e, e.state), e.state.pending <= 0 && Sr(e));
|
|
1339
|
+
}
|
|
1340
|
+
function La(e, r) {
|
|
1341
|
+
for (let t = 0, n = r.buffer.length; t < n; t++) Xr(e, r.buffer[t], !1);
|
|
1342
|
+
}
|
|
1343
|
+
function Sr(e) {
|
|
1344
|
+
e.state.alive && (fn(e), e.state.alive = !1);
|
|
1345
|
+
}
|
|
1346
|
+
function Sn(e, r) {
|
|
1347
|
+
let t = A(r.plugins), n = Jr({
|
|
1348
|
+
plugins: t,
|
|
1349
|
+
refs: r.refs,
|
|
1350
|
+
disabledFeatures: r.disabledFeatures,
|
|
1351
|
+
onParse(a, s) {
|
|
1352
|
+
let i = lr({
|
|
1353
|
+
plugins: t,
|
|
1354
|
+
features: n.base.features,
|
|
1355
|
+
scopeId: r.scopeId,
|
|
1356
|
+
markedRefs: n.base.marked
|
|
1357
|
+
}), u;
|
|
1358
|
+
try {
|
|
1359
|
+
u = fr(i, a);
|
|
1360
|
+
} catch (l) {
|
|
1361
|
+
r.onError && r.onError(l);
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
r.onSerialize(u, s);
|
|
1365
|
+
},
|
|
1366
|
+
onError: r.onError,
|
|
1367
|
+
onDone: r.onDone
|
|
1368
|
+
});
|
|
1369
|
+
return et(n, e), Sr.bind(null, n);
|
|
1370
|
+
}
|
|
1371
|
+
var mr = class {
|
|
1372
|
+
constructor(r) {
|
|
1373
|
+
this.options = r;
|
|
1374
|
+
this.alive = !0;
|
|
1375
|
+
this.flushed = !1;
|
|
1376
|
+
this.done = !1;
|
|
1377
|
+
this.pending = 0;
|
|
1378
|
+
this.cleanups = [];
|
|
1379
|
+
this.refs = /* @__PURE__ */ new Map();
|
|
1380
|
+
this.keys = /* @__PURE__ */ new Set();
|
|
1381
|
+
this.ids = 0;
|
|
1382
|
+
this.plugins = A(r.plugins);
|
|
1383
|
+
}
|
|
1384
|
+
write(r, t) {
|
|
1385
|
+
this.alive && !this.flushed && (this.pending++, this.keys.add(r), this.cleanups.push(Sn(t, {
|
|
1386
|
+
plugins: this.plugins,
|
|
1387
|
+
scopeId: this.options.scopeId,
|
|
1388
|
+
refs: this.refs,
|
|
1389
|
+
disabledFeatures: this.options.disabledFeatures,
|
|
1390
|
+
onError: this.options.onError,
|
|
1391
|
+
onSerialize: (n, a) => {
|
|
1392
|
+
this.alive && this.options.onData(a ? this.options.globalIdentifier + "[\"" + y(r) + "\"]=" + n : n);
|
|
1393
|
+
},
|
|
1394
|
+
onDone: () => {
|
|
1395
|
+
this.alive && (this.pending--, this.pending <= 0 && this.flushed && !this.done && this.options.onDone && (this.options.onDone(), this.done = !0));
|
|
1396
|
+
}
|
|
1397
|
+
})));
|
|
1398
|
+
}
|
|
1399
|
+
getNextID() {
|
|
1400
|
+
for (; this.keys.has("" + this.ids);) this.ids++;
|
|
1401
|
+
return "" + this.ids;
|
|
1402
|
+
}
|
|
1403
|
+
push(r) {
|
|
1404
|
+
let t = this.getNextID();
|
|
1405
|
+
return this.write(t, r), t;
|
|
1406
|
+
}
|
|
1407
|
+
flush() {
|
|
1408
|
+
this.alive && (this.flushed = !0, this.pending <= 0 && !this.done && this.options.onDone && (this.options.onDone(), this.done = !0));
|
|
1409
|
+
}
|
|
1410
|
+
close() {
|
|
1411
|
+
if (this.alive) {
|
|
1412
|
+
for (let r = 0, t = this.cleanups.length; r < t; r++) this.cleanups[r]();
|
|
1413
|
+
!this.done && this.options.onDone && (this.options.onDone(), this.done = !0), this.alive = !1;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
//#endregion
|
|
1418
|
+
//#region ../../node_modules/.pnpm/seroval@1.6.3/node_modules/seroval/dist/index.js
|
|
1419
|
+
/**
|
|
1420
|
+
* References
|
|
1421
|
+
* - https://compat-table.github.io/compat-table/es6/
|
|
1422
|
+
* - MDN
|
|
1423
|
+
*/
|
|
1424
|
+
var Feature = /* @__PURE__ */ function(Feature) {
|
|
1425
|
+
Feature[Feature["AggregateError"] = 1] = "AggregateError";
|
|
1426
|
+
Feature[Feature["ArrowFunction"] = 2] = "ArrowFunction";
|
|
1427
|
+
Feature[Feature["ErrorPrototypeStack"] = 4] = "ErrorPrototypeStack";
|
|
1428
|
+
Feature[Feature["ObjectAssign"] = 8] = "ObjectAssign";
|
|
1429
|
+
Feature[Feature["BigIntTypedArray"] = 16] = "BigIntTypedArray";
|
|
1430
|
+
Feature[Feature["RegExp"] = 32] = "RegExp";
|
|
1431
|
+
Feature[Feature["Temporal"] = 64] = "Temporal";
|
|
1432
|
+
return Feature;
|
|
1433
|
+
}({});
|
|
1434
|
+
var SYM_ASYNC_ITERATOR = Symbol.asyncIterator;
|
|
1435
|
+
var SYM_HAS_INSTANCE = Symbol.hasInstance;
|
|
1436
|
+
var SYM_IS_CONCAT_SPREADABLE = Symbol.isConcatSpreadable;
|
|
1437
|
+
var SYM_ITERATOR = Symbol.iterator;
|
|
1438
|
+
var SYM_MATCH = Symbol.match;
|
|
1439
|
+
var SYM_MATCH_ALL = Symbol.matchAll;
|
|
1440
|
+
var SYM_REPLACE = Symbol.replace;
|
|
1441
|
+
var SYM_SEARCH = Symbol.search;
|
|
1442
|
+
var SYM_SPECIES = Symbol.species;
|
|
1443
|
+
var SYM_SPLIT = Symbol.split;
|
|
1444
|
+
var SYM_TO_PRIMITIVE = Symbol.toPrimitive;
|
|
1445
|
+
var SYM_TO_STRING_TAG = Symbol.toStringTag;
|
|
1446
|
+
var SYM_UNSCOPABLES = Symbol.unscopables;
|
|
1447
|
+
var INV_SYMBOL_REF = {
|
|
1448
|
+
[SYM_ASYNC_ITERATOR]: 0,
|
|
1449
|
+
[SYM_HAS_INSTANCE]: 1,
|
|
1450
|
+
[SYM_IS_CONCAT_SPREADABLE]: 2,
|
|
1451
|
+
[SYM_ITERATOR]: 3,
|
|
1452
|
+
[SYM_MATCH]: 4,
|
|
1453
|
+
[SYM_MATCH_ALL]: 5,
|
|
1454
|
+
[SYM_REPLACE]: 6,
|
|
1455
|
+
[SYM_SEARCH]: 7,
|
|
1456
|
+
[SYM_SPECIES]: 8,
|
|
1457
|
+
[SYM_SPLIT]: 9,
|
|
1458
|
+
[SYM_TO_PRIMITIVE]: 10,
|
|
1459
|
+
[SYM_TO_STRING_TAG]: 11,
|
|
1460
|
+
[SYM_UNSCOPABLES]: 12
|
|
1461
|
+
};
|
|
1462
|
+
var SYMBOL_REF = {
|
|
1463
|
+
[0]: SYM_ASYNC_ITERATOR,
|
|
1464
|
+
[1]: SYM_HAS_INSTANCE,
|
|
1465
|
+
[2]: SYM_IS_CONCAT_SPREADABLE,
|
|
1466
|
+
[3]: SYM_ITERATOR,
|
|
1467
|
+
[4]: SYM_MATCH,
|
|
1468
|
+
[5]: SYM_MATCH_ALL,
|
|
1469
|
+
[6]: SYM_REPLACE,
|
|
1470
|
+
[7]: SYM_SEARCH,
|
|
1471
|
+
[8]: SYM_SPECIES,
|
|
1472
|
+
[9]: SYM_SPLIT,
|
|
1473
|
+
[10]: SYM_TO_PRIMITIVE,
|
|
1474
|
+
[11]: SYM_TO_STRING_TAG,
|
|
1475
|
+
[12]: SYM_UNSCOPABLES
|
|
1476
|
+
};
|
|
1477
|
+
var CONSTANT_VAL = {
|
|
1478
|
+
[2]: true,
|
|
1479
|
+
[3]: false,
|
|
1480
|
+
[1]: void 0,
|
|
1481
|
+
[0]: null,
|
|
1482
|
+
[4]: -0,
|
|
1483
|
+
[5]: Number.POSITIVE_INFINITY,
|
|
1484
|
+
[6]: Number.NEGATIVE_INFINITY,
|
|
1485
|
+
[7]: NaN
|
|
1486
|
+
};
|
|
1487
|
+
var ERROR_CONSTRUCTOR_STRING = {
|
|
1488
|
+
[0]: "Error",
|
|
1489
|
+
[1]: "EvalError",
|
|
1490
|
+
[2]: "RangeError",
|
|
1491
|
+
[3]: "ReferenceError",
|
|
1492
|
+
[4]: "SyntaxError",
|
|
1493
|
+
[5]: "TypeError",
|
|
1494
|
+
[6]: "URIError"
|
|
1495
|
+
};
|
|
1496
|
+
var ERROR_CONSTRUCTOR = {
|
|
1497
|
+
[0]: Error,
|
|
1498
|
+
[1]: EvalError,
|
|
1499
|
+
[2]: RangeError,
|
|
1500
|
+
[3]: ReferenceError,
|
|
1501
|
+
[4]: SyntaxError,
|
|
1502
|
+
[5]: TypeError,
|
|
1503
|
+
[6]: URIError
|
|
1504
|
+
};
|
|
1505
|
+
function createSerovalNode(t, i, s, c, m, p, e, a, f, b, o, l) {
|
|
1506
|
+
return {
|
|
1507
|
+
t,
|
|
1508
|
+
i,
|
|
1509
|
+
s,
|
|
1510
|
+
c,
|
|
1511
|
+
m,
|
|
1512
|
+
p,
|
|
1513
|
+
e,
|
|
1514
|
+
a,
|
|
1515
|
+
f,
|
|
1516
|
+
b,
|
|
1517
|
+
o,
|
|
1518
|
+
l
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
function createConstantNode(value) {
|
|
1522
|
+
return createSerovalNode(2, void 0, value, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1523
|
+
}
|
|
1524
|
+
var TRUE_NODE = /* @__PURE__ */ createConstantNode(2);
|
|
1525
|
+
var FALSE_NODE = /* @__PURE__ */ createConstantNode(3);
|
|
1526
|
+
var UNDEFINED_NODE = /* @__PURE__ */ createConstantNode(1);
|
|
1527
|
+
var NULL_NODE = /* @__PURE__ */ createConstantNode(0);
|
|
1528
|
+
var NEG_ZERO_NODE = /* @__PURE__ */ createConstantNode(4);
|
|
1529
|
+
var INFINITY_NODE = /* @__PURE__ */ createConstantNode(5);
|
|
1530
|
+
var NEG_INFINITY_NODE = /* @__PURE__ */ createConstantNode(6);
|
|
1531
|
+
var NAN_NODE = /* @__PURE__ */ createConstantNode(7);
|
|
1532
|
+
function serializeChar(str) {
|
|
1533
|
+
switch (str) {
|
|
1534
|
+
case "\"": return "\\\"";
|
|
1535
|
+
case "\\": return "\\\\";
|
|
1536
|
+
case "\n": return "\\n";
|
|
1537
|
+
case "\r": return "\\r";
|
|
1538
|
+
case "\b": return "\\b";
|
|
1539
|
+
case " ": return "\\t";
|
|
1540
|
+
case "\f": return "\\f";
|
|
1541
|
+
case "<": return "\\x3C";
|
|
1542
|
+
case "\u2028": return "\\u2028";
|
|
1543
|
+
case "\u2029": return "\\u2029";
|
|
1544
|
+
default: return;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
function serializeString(str) {
|
|
1548
|
+
let result = "";
|
|
1549
|
+
let lastPos = 0;
|
|
1550
|
+
let replacement;
|
|
1551
|
+
for (let i = 0, len = str.length; i < len; i++) {
|
|
1552
|
+
replacement = serializeChar(str[i]);
|
|
1553
|
+
if (replacement) {
|
|
1554
|
+
result += str.slice(lastPos, i) + replacement;
|
|
1555
|
+
lastPos = i + 1;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
if (lastPos === 0) result = str;
|
|
1559
|
+
else result += str.slice(lastPos);
|
|
1560
|
+
return result;
|
|
1561
|
+
}
|
|
1562
|
+
function deserializeReplacer(str) {
|
|
1563
|
+
switch (str) {
|
|
1564
|
+
case "\\\\": return "\\";
|
|
1565
|
+
case "\\\"": return "\"";
|
|
1566
|
+
case "\\n": return "\n";
|
|
1567
|
+
case "\\r": return "\r";
|
|
1568
|
+
case "\\b": return "\b";
|
|
1569
|
+
case "\\t": return " ";
|
|
1570
|
+
case "\\f": return "\f";
|
|
1571
|
+
case "\\x3C": return "<";
|
|
1572
|
+
case "\\u2028": return "\u2028";
|
|
1573
|
+
case "\\u2029": return "\u2029";
|
|
1574
|
+
default: return str;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
function deserializeString(str) {
|
|
1578
|
+
return str.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g, deserializeReplacer);
|
|
1579
|
+
}
|
|
1580
|
+
var { toString: objectToString } = Object.prototype;
|
|
1581
|
+
var STEP_ERROR_CODES = {
|
|
1582
|
+
parsing: 1,
|
|
1583
|
+
serialization: 2,
|
|
1584
|
+
deserialization: 3
|
|
1585
|
+
};
|
|
1586
|
+
function getErrorMessageProd(type) {
|
|
1587
|
+
return `Seroval Error (step: ${STEP_ERROR_CODES[type]})`;
|
|
1588
|
+
}
|
|
1589
|
+
var getErrorMessage = (type, cause) => getErrorMessageProd(type);
|
|
1590
|
+
var SerovalError = class extends Error {
|
|
1591
|
+
constructor(type, cause) {
|
|
1592
|
+
super(getErrorMessage(type, cause));
|
|
1593
|
+
this.cause = cause;
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1596
|
+
var SerovalParserError = class extends SerovalError {
|
|
1597
|
+
constructor(cause) {
|
|
1598
|
+
super("parsing", cause);
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
var SerovalDeserializationError = class extends SerovalError {
|
|
1602
|
+
constructor(cause) {
|
|
1603
|
+
super("deserialization", cause);
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
function getSpecificErrorMessage(code) {
|
|
1607
|
+
return `Seroval Error (specific: ${code})`;
|
|
1608
|
+
}
|
|
1609
|
+
var SerovalUnsupportedTypeError = class extends Error {
|
|
1610
|
+
constructor(value) {
|
|
1611
|
+
super(getSpecificErrorMessage(1));
|
|
1612
|
+
this.value = value;
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
var SerovalUnsupportedNodeError = class extends Error {
|
|
1616
|
+
constructor(node) {
|
|
1617
|
+
super(getSpecificErrorMessage(2));
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
var SerovalMissingPluginError = class extends Error {
|
|
1621
|
+
constructor(tag) {
|
|
1622
|
+
super(getSpecificErrorMessage(3));
|
|
1623
|
+
}
|
|
1624
|
+
};
|
|
1625
|
+
var SerovalMissingInstanceError = class extends Error {
|
|
1626
|
+
constructor(tag) {
|
|
1627
|
+
super(getSpecificErrorMessage(4));
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
var SerovalMissingReferenceError = class extends Error {
|
|
1631
|
+
constructor(value) {
|
|
1632
|
+
super(getSpecificErrorMessage(5));
|
|
1633
|
+
this.value = value;
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
var SerovalMissingReferenceForIdError = class extends Error {
|
|
1637
|
+
constructor(id) {
|
|
1638
|
+
super(getSpecificErrorMessage(6));
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
var SerovalUnknownTypedArrayError = class extends Error {
|
|
1642
|
+
constructor(name) {
|
|
1643
|
+
super(getSpecificErrorMessage(7));
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
var SerovalMalformedNodeError = class extends Error {
|
|
1647
|
+
constructor(node) {
|
|
1648
|
+
super(getSpecificErrorMessage(8));
|
|
1649
|
+
}
|
|
1650
|
+
};
|
|
1651
|
+
var SerovalDepthLimitError = class extends Error {
|
|
1652
|
+
constructor(limit) {
|
|
1653
|
+
super(getSpecificErrorMessage(9));
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
var REFERENCES_KEY = "__SEROVAL_REFS__";
|
|
1657
|
+
var REFERENCE = /* @__PURE__ */ new Map();
|
|
1658
|
+
var INV_REFERENCE = /* @__PURE__ */ new Map();
|
|
1659
|
+
function hasReferenceID(value) {
|
|
1660
|
+
return REFERENCE.has(value);
|
|
1661
|
+
}
|
|
1662
|
+
function hasReference(id) {
|
|
1663
|
+
return INV_REFERENCE.has(id);
|
|
1664
|
+
}
|
|
1665
|
+
function getReferenceID(value) {
|
|
1666
|
+
if (hasReferenceID(value)) return REFERENCE.get(value);
|
|
1667
|
+
throw new SerovalMissingReferenceError(value);
|
|
1668
|
+
}
|
|
1669
|
+
function getReference(id) {
|
|
1670
|
+
if (hasReference(id)) return INV_REFERENCE.get(id);
|
|
1671
|
+
throw new SerovalMissingReferenceForIdError(id);
|
|
1672
|
+
}
|
|
1673
|
+
if (typeof globalThis !== "undefined") Object.defineProperty(globalThis, REFERENCES_KEY, {
|
|
1674
|
+
value: INV_REFERENCE,
|
|
1675
|
+
configurable: true,
|
|
1676
|
+
writable: false,
|
|
1677
|
+
enumerable: false
|
|
1678
|
+
});
|
|
1679
|
+
else if (typeof window !== "undefined") Object.defineProperty(window, REFERENCES_KEY, {
|
|
1680
|
+
value: INV_REFERENCE,
|
|
1681
|
+
configurable: true,
|
|
1682
|
+
writable: false,
|
|
1683
|
+
enumerable: false
|
|
1684
|
+
});
|
|
1685
|
+
else if (typeof self !== "undefined") Object.defineProperty(self, REFERENCES_KEY, {
|
|
1686
|
+
value: INV_REFERENCE,
|
|
1687
|
+
configurable: true,
|
|
1688
|
+
writable: false,
|
|
1689
|
+
enumerable: false
|
|
1690
|
+
});
|
|
1691
|
+
else if (typeof global !== "undefined") Object.defineProperty(global, REFERENCES_KEY, {
|
|
1692
|
+
value: INV_REFERENCE,
|
|
1693
|
+
configurable: true,
|
|
1694
|
+
writable: false,
|
|
1695
|
+
enumerable: false
|
|
1696
|
+
});
|
|
1697
|
+
function getErrorConstructor(error) {
|
|
1698
|
+
if (error instanceof EvalError) return 1;
|
|
1699
|
+
if (error instanceof RangeError) return 2;
|
|
1700
|
+
if (error instanceof ReferenceError) return 3;
|
|
1701
|
+
if (error instanceof SyntaxError) return 4;
|
|
1702
|
+
if (error instanceof TypeError) return 5;
|
|
1703
|
+
if (error instanceof URIError) return 6;
|
|
1704
|
+
return 0;
|
|
1705
|
+
}
|
|
1706
|
+
function getInitialErrorOptions(error) {
|
|
1707
|
+
const construct = ERROR_CONSTRUCTOR_STRING[getErrorConstructor(error)];
|
|
1708
|
+
if (error.name !== construct) return { name: error.name };
|
|
1709
|
+
if (error.constructor.name !== construct) return { name: error.constructor.name };
|
|
1710
|
+
return {};
|
|
1711
|
+
}
|
|
1712
|
+
function getErrorOptions(error, features) {
|
|
1713
|
+
let options = getInitialErrorOptions(error);
|
|
1714
|
+
const names = Object.getOwnPropertyNames(error);
|
|
1715
|
+
for (let i = 0, len = names.length, name; i < len; i++) {
|
|
1716
|
+
name = names[i];
|
|
1717
|
+
if (name !== "name" && name !== "message") if (name === "stack") {
|
|
1718
|
+
if (features & 4) {
|
|
1719
|
+
options = options || {};
|
|
1720
|
+
options[name] = error[name];
|
|
1721
|
+
}
|
|
1722
|
+
} else {
|
|
1723
|
+
options = options || {};
|
|
1724
|
+
options[name] = error[name];
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return options;
|
|
1728
|
+
}
|
|
1729
|
+
function getObjectFlag(obj) {
|
|
1730
|
+
if (Object.isFrozen(obj)) return 3;
|
|
1731
|
+
if (Object.isSealed(obj)) return 2;
|
|
1732
|
+
if (Object.isExtensible(obj)) return 0;
|
|
1733
|
+
return 1;
|
|
1734
|
+
}
|
|
1735
|
+
function createNumberNode(value) {
|
|
1736
|
+
switch (value) {
|
|
1737
|
+
case Number.POSITIVE_INFINITY: return INFINITY_NODE;
|
|
1738
|
+
case Number.NEGATIVE_INFINITY: return NEG_INFINITY_NODE;
|
|
1739
|
+
}
|
|
1740
|
+
if (value !== value) return NAN_NODE;
|
|
1741
|
+
if (Object.is(value, -0)) return NEG_ZERO_NODE;
|
|
1742
|
+
return createSerovalNode(0, void 0, value, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1743
|
+
}
|
|
1744
|
+
function createStringNode(value) {
|
|
1745
|
+
return createSerovalNode(1, void 0, serializeString(value), void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1746
|
+
}
|
|
1747
|
+
function createBigIntNode(current) {
|
|
1748
|
+
return createSerovalNode(3, void 0, "" + current, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1749
|
+
}
|
|
1750
|
+
function createIndexedValueNode(id) {
|
|
1751
|
+
return createSerovalNode(4, id, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1752
|
+
}
|
|
1753
|
+
function createDateNode(id, current) {
|
|
1754
|
+
const timestamp = current.valueOf();
|
|
1755
|
+
return createSerovalNode(5, id, timestamp !== timestamp ? "" : current.toISOString(), void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1756
|
+
}
|
|
1757
|
+
function createTemporalNode(id, type, current) {
|
|
1758
|
+
return createSerovalNode(36, id, current.toString(), type, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1759
|
+
}
|
|
1760
|
+
function createRegExpNode(id, current) {
|
|
1761
|
+
return createSerovalNode(6, id, void 0, serializeString(current.source), current.flags, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1762
|
+
}
|
|
1763
|
+
function createWKSymbolNode(id, current) {
|
|
1764
|
+
return createSerovalNode(17, id, INV_SYMBOL_REF[current], void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1765
|
+
}
|
|
1766
|
+
function createReferenceNode(id, ref) {
|
|
1767
|
+
return createSerovalNode(18, id, serializeString(getReferenceID(ref)), void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1768
|
+
}
|
|
1769
|
+
function createPluginNode(id, tag, value) {
|
|
1770
|
+
return createSerovalNode(25, id, value, serializeString(tag), void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1771
|
+
}
|
|
1772
|
+
function createArrayNode(id, current, parsedItems) {
|
|
1773
|
+
return createSerovalNode(9, id, void 0, void 0, void 0, void 0, void 0, parsedItems, void 0, void 0, getObjectFlag(current), void 0);
|
|
1774
|
+
}
|
|
1775
|
+
function createBoxedNode(id, boxed) {
|
|
1776
|
+
return createSerovalNode(21, id, void 0, void 0, void 0, void 0, void 0, void 0, boxed, void 0, void 0, void 0);
|
|
1777
|
+
}
|
|
1778
|
+
var MAX_TYPED_ARRAY_LENGTH = 1e6;
|
|
1779
|
+
function createTypedArrayNode(id, current, buffer) {
|
|
1780
|
+
if (current.length > MAX_TYPED_ARRAY_LENGTH) throw new SerovalUnsupportedTypeError(current);
|
|
1781
|
+
return createSerovalNode(15, id, void 0, current.constructor.name, void 0, void 0, void 0, void 0, buffer, current.byteOffset, void 0, current.length);
|
|
1782
|
+
}
|
|
1783
|
+
function createBigIntTypedArrayNode(id, current, buffer) {
|
|
1784
|
+
if (current.length > MAX_TYPED_ARRAY_LENGTH) throw new SerovalUnsupportedTypeError(current);
|
|
1785
|
+
return createSerovalNode(16, id, void 0, current.constructor.name, void 0, void 0, void 0, void 0, buffer, current.byteOffset, void 0, current.length);
|
|
1786
|
+
}
|
|
1787
|
+
function createDataViewNode(id, current, buffer) {
|
|
1788
|
+
if (current.byteLength > MAX_TYPED_ARRAY_LENGTH) throw new SerovalUnsupportedTypeError(current);
|
|
1789
|
+
return createSerovalNode(20, id, void 0, void 0, void 0, void 0, void 0, void 0, buffer, current.byteOffset, void 0, current.byteLength);
|
|
1790
|
+
}
|
|
1791
|
+
function createErrorNode(id, current, options) {
|
|
1792
|
+
return createSerovalNode(13, id, getErrorConstructor(current), void 0, serializeString(current.message), options, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1793
|
+
}
|
|
1794
|
+
function createAggregateErrorNode(id, current, options) {
|
|
1795
|
+
return createSerovalNode(14, id, getErrorConstructor(current), void 0, serializeString(current.message), options, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
1796
|
+
}
|
|
1797
|
+
function createSetNode(id, items) {
|
|
1798
|
+
return createSerovalNode(7, id, void 0, void 0, void 0, void 0, void 0, items, void 0, void 0, void 0, void 0);
|
|
1799
|
+
}
|
|
1800
|
+
function createIteratorFactoryInstanceNode(factory, items) {
|
|
1801
|
+
return createSerovalNode(28, void 0, void 0, void 0, void 0, void 0, void 0, [factory, items], void 0, void 0, void 0, void 0);
|
|
1802
|
+
}
|
|
1803
|
+
function createAsyncIteratorFactoryInstanceNode(factory, items) {
|
|
1804
|
+
return createSerovalNode(30, void 0, void 0, void 0, void 0, void 0, void 0, [factory, items], void 0, void 0, void 0, void 0);
|
|
1805
|
+
}
|
|
1806
|
+
function createStreamConstructorNode(id, factory, sequence) {
|
|
1807
|
+
return createSerovalNode(31, id, void 0, void 0, void 0, void 0, void 0, sequence, factory, void 0, void 0, void 0);
|
|
1808
|
+
}
|
|
1809
|
+
function createStreamNextNode(id, parsed) {
|
|
1810
|
+
return createSerovalNode(32, id, void 0, void 0, void 0, void 0, void 0, void 0, parsed, void 0, void 0, void 0);
|
|
1811
|
+
}
|
|
1812
|
+
function createStreamThrowNode(id, parsed) {
|
|
1813
|
+
return createSerovalNode(33, id, void 0, void 0, void 0, void 0, void 0, void 0, parsed, void 0, void 0, void 0);
|
|
1814
|
+
}
|
|
1815
|
+
function createStreamReturnNode(id, parsed) {
|
|
1816
|
+
return createSerovalNode(34, id, void 0, void 0, void 0, void 0, void 0, void 0, parsed, void 0, void 0, void 0);
|
|
1817
|
+
}
|
|
1818
|
+
function createSequenceNode(id, sequence, throwAt, doneAt) {
|
|
1819
|
+
return createSerovalNode(35, id, throwAt, void 0, void 0, void 0, void 0, sequence, void 0, void 0, void 0, doneAt);
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* An opaque reference allows hiding values from the serializer.
|
|
1823
|
+
*/
|
|
1824
|
+
var OpaqueReference = class {
|
|
1825
|
+
constructor(value, replacement) {
|
|
1826
|
+
this.value = value;
|
|
1827
|
+
this.replacement = replacement;
|
|
1828
|
+
}
|
|
1829
|
+
};
|
|
1830
|
+
var PROMISE_CONSTRUCTOR = () => {
|
|
1831
|
+
const resolver = {
|
|
1832
|
+
p: 0,
|
|
1833
|
+
s: 0,
|
|
1834
|
+
f: 0
|
|
1835
|
+
};
|
|
1836
|
+
resolver.p = new Promise((resolve, reject) => {
|
|
1837
|
+
resolver.s = resolve;
|
|
1838
|
+
resolver.f = reject;
|
|
1839
|
+
});
|
|
1840
|
+
return resolver;
|
|
1841
|
+
};
|
|
1842
|
+
var STREAM_CONSTRUCTOR = () => {
|
|
1843
|
+
const buffer = [];
|
|
1844
|
+
const listeners = [];
|
|
1845
|
+
let alive = true;
|
|
1846
|
+
let success = false;
|
|
1847
|
+
let count = 0;
|
|
1848
|
+
const internal = {
|
|
1849
|
+
flush(value, mode, x) {
|
|
1850
|
+
for (x = 0; x < count; x++) if (listeners[x]) listeners[x][mode](value);
|
|
1851
|
+
},
|
|
1852
|
+
up(listener, x, z, current) {
|
|
1853
|
+
for (x = 0, z = buffer.length; x < z; x++) {
|
|
1854
|
+
current = buffer[x];
|
|
1855
|
+
if (!alive && x === z - 1) listener[success ? "return" : "throw"](current);
|
|
1856
|
+
else listener.next(current);
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
on(listener, temp) {
|
|
1860
|
+
if (alive) {
|
|
1861
|
+
temp = count++;
|
|
1862
|
+
listeners[temp] = listener;
|
|
1863
|
+
}
|
|
1864
|
+
internal.up(listener);
|
|
1865
|
+
return () => {
|
|
1866
|
+
if (alive) {
|
|
1867
|
+
listeners[temp] = listeners[count];
|
|
1868
|
+
listeners[count--] = void 0;
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
return {
|
|
1874
|
+
__SEROVAL_STREAM__: true,
|
|
1875
|
+
on(listener) {
|
|
1876
|
+
return internal.on(listener);
|
|
1877
|
+
},
|
|
1878
|
+
next(value) {
|
|
1879
|
+
if (alive) {
|
|
1880
|
+
buffer.push(value);
|
|
1881
|
+
internal.flush(value, "next");
|
|
1882
|
+
}
|
|
1883
|
+
},
|
|
1884
|
+
throw(value) {
|
|
1885
|
+
if (alive) {
|
|
1886
|
+
buffer.push(value);
|
|
1887
|
+
internal.flush(value, "throw");
|
|
1888
|
+
alive = false;
|
|
1889
|
+
success = false;
|
|
1890
|
+
listeners.length = 0;
|
|
1891
|
+
}
|
|
1892
|
+
},
|
|
1893
|
+
return(value) {
|
|
1894
|
+
if (alive) {
|
|
1895
|
+
buffer.push(value);
|
|
1896
|
+
internal.flush(value, "return");
|
|
1897
|
+
alive = false;
|
|
1898
|
+
success = true;
|
|
1899
|
+
listeners.length = 0;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
};
|
|
1904
|
+
var ITERATOR_CONSTRUCTOR = (symbol) => (sequence) => () => {
|
|
1905
|
+
let index = 0;
|
|
1906
|
+
const instance = {
|
|
1907
|
+
[symbol]() {
|
|
1908
|
+
return instance;
|
|
1909
|
+
},
|
|
1910
|
+
next() {
|
|
1911
|
+
if (index > sequence.d) return {
|
|
1912
|
+
done: true,
|
|
1913
|
+
value: void 0
|
|
1914
|
+
};
|
|
1915
|
+
const currentIndex = index++;
|
|
1916
|
+
const data = sequence.v[currentIndex];
|
|
1917
|
+
if (currentIndex === sequence.t) throw data;
|
|
1918
|
+
return {
|
|
1919
|
+
done: currentIndex === sequence.d,
|
|
1920
|
+
value: data
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
};
|
|
1924
|
+
return instance;
|
|
1925
|
+
};
|
|
1926
|
+
var ASYNC_ITERATOR_CONSTRUCTOR = (symbol, createPromise) => (stream) => () => {
|
|
1927
|
+
let count = 0;
|
|
1928
|
+
let doneAt = -1;
|
|
1929
|
+
let isThrow = false;
|
|
1930
|
+
const buffer = [];
|
|
1931
|
+
const pending = [];
|
|
1932
|
+
const internal = { finalize(i = 0, len = pending.length) {
|
|
1933
|
+
for (; i < len; i++) pending[i].s({
|
|
1934
|
+
done: true,
|
|
1935
|
+
value: void 0
|
|
1936
|
+
});
|
|
1937
|
+
} };
|
|
1938
|
+
stream.on({
|
|
1939
|
+
next(value) {
|
|
1940
|
+
const temp = pending.shift();
|
|
1941
|
+
if (temp) temp.s({
|
|
1942
|
+
done: false,
|
|
1943
|
+
value
|
|
1944
|
+
});
|
|
1945
|
+
buffer.push(value);
|
|
1946
|
+
},
|
|
1947
|
+
throw(value) {
|
|
1948
|
+
const temp = pending.shift();
|
|
1949
|
+
if (temp) temp.f(value);
|
|
1950
|
+
internal.finalize();
|
|
1951
|
+
doneAt = buffer.length;
|
|
1952
|
+
isThrow = true;
|
|
1953
|
+
buffer.push(value);
|
|
1954
|
+
},
|
|
1955
|
+
return(value) {
|
|
1956
|
+
const temp = pending.shift();
|
|
1957
|
+
if (temp) temp.s({
|
|
1958
|
+
done: true,
|
|
1959
|
+
value
|
|
1960
|
+
});
|
|
1961
|
+
internal.finalize();
|
|
1962
|
+
doneAt = buffer.length;
|
|
1963
|
+
buffer.push(value);
|
|
1964
|
+
}
|
|
1965
|
+
});
|
|
1966
|
+
const instance = {
|
|
1967
|
+
[symbol]() {
|
|
1968
|
+
return instance;
|
|
1969
|
+
},
|
|
1970
|
+
next() {
|
|
1971
|
+
if (doneAt === -1) {
|
|
1972
|
+
const index = count++;
|
|
1973
|
+
if (index >= buffer.length) {
|
|
1974
|
+
const temp = createPromise();
|
|
1975
|
+
pending.push(temp);
|
|
1976
|
+
return temp.p;
|
|
1977
|
+
}
|
|
1978
|
+
return {
|
|
1979
|
+
done: false,
|
|
1980
|
+
value: buffer[index]
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
if (count > doneAt) return {
|
|
1984
|
+
done: true,
|
|
1985
|
+
value: void 0
|
|
1986
|
+
};
|
|
1987
|
+
const index = count++;
|
|
1988
|
+
const value = buffer[index];
|
|
1989
|
+
if (index !== doneAt) return {
|
|
1990
|
+
done: false,
|
|
1991
|
+
value
|
|
1992
|
+
};
|
|
1993
|
+
if (isThrow) throw value;
|
|
1994
|
+
return {
|
|
1995
|
+
done: true,
|
|
1996
|
+
value
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
};
|
|
2000
|
+
return instance;
|
|
2001
|
+
};
|
|
2002
|
+
var ARRAY_BUFFER_CONSTRUCTOR = (b64) => {
|
|
2003
|
+
const decoded = atob(b64);
|
|
2004
|
+
const length = decoded.length;
|
|
2005
|
+
const arr = new Uint8Array(length);
|
|
2006
|
+
for (let i = 0; i < length; i++) arr[i] = decoded.charCodeAt(i);
|
|
2007
|
+
return arr.buffer;
|
|
2008
|
+
};
|
|
2009
|
+
function isSequence(value) {
|
|
2010
|
+
return "__SEROVAL_SEQUENCE__" in value;
|
|
2011
|
+
}
|
|
2012
|
+
function createSequence(values, throwAt, doneAt) {
|
|
2013
|
+
return {
|
|
2014
|
+
__SEROVAL_SEQUENCE__: true,
|
|
2015
|
+
v: values,
|
|
2016
|
+
t: throwAt,
|
|
2017
|
+
d: doneAt
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
function createSequenceFromIterable(source) {
|
|
2021
|
+
const values = [];
|
|
2022
|
+
let throwsAt = -1;
|
|
2023
|
+
let doneAt = -1;
|
|
2024
|
+
const iterator = source[SYM_ITERATOR]();
|
|
2025
|
+
while (true) try {
|
|
2026
|
+
const value = iterator.next();
|
|
2027
|
+
values.push(value.value);
|
|
2028
|
+
if (value.done) {
|
|
2029
|
+
doneAt = values.length - 1;
|
|
2030
|
+
break;
|
|
2031
|
+
}
|
|
2032
|
+
} catch (error) {
|
|
2033
|
+
throwsAt = values.length;
|
|
2034
|
+
values.push(error);
|
|
2035
|
+
}
|
|
2036
|
+
return createSequence(values, throwsAt, doneAt);
|
|
2037
|
+
}
|
|
2038
|
+
var createIterator = ITERATOR_CONSTRUCTOR(SYM_ITERATOR);
|
|
2039
|
+
function sequenceToIterator(sequence) {
|
|
2040
|
+
return createIterator(sequence);
|
|
2041
|
+
}
|
|
2042
|
+
var ITERATOR = {};
|
|
2043
|
+
var ASYNC_ITERATOR = {};
|
|
2044
|
+
/**
|
|
2045
|
+
* Placeholder references
|
|
2046
|
+
*/
|
|
2047
|
+
var SPECIAL_REFS = {
|
|
2048
|
+
[0]: {},
|
|
2049
|
+
[1]: {},
|
|
2050
|
+
[2]: {},
|
|
2051
|
+
[3]: {},
|
|
2052
|
+
[4]: {},
|
|
2053
|
+
[5]: {}
|
|
2054
|
+
};
|
|
2055
|
+
function isStream(value) {
|
|
2056
|
+
return "__SEROVAL_STREAM__" in value;
|
|
2057
|
+
}
|
|
2058
|
+
function createStream() {
|
|
2059
|
+
return STREAM_CONSTRUCTOR();
|
|
2060
|
+
}
|
|
2061
|
+
function createStreamFromAsyncIterable(iterable) {
|
|
2062
|
+
const stream = createStream();
|
|
2063
|
+
const iterator = iterable[SYM_ASYNC_ITERATOR]();
|
|
2064
|
+
async function push() {
|
|
2065
|
+
try {
|
|
2066
|
+
const value = await iterator.next();
|
|
2067
|
+
if (value.done) stream.return(value.value);
|
|
2068
|
+
else {
|
|
2069
|
+
stream.next(value.value);
|
|
2070
|
+
await push();
|
|
2071
|
+
}
|
|
2072
|
+
} catch (error) {
|
|
2073
|
+
stream.throw(error);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
push().catch(() => {});
|
|
2077
|
+
return stream;
|
|
2078
|
+
}
|
|
2079
|
+
var createAsyncIterable = ASYNC_ITERATOR_CONSTRUCTOR(SYM_ASYNC_ITERATOR, PROMISE_CONSTRUCTOR);
|
|
2080
|
+
function streamToAsyncIterable(stream) {
|
|
2081
|
+
return createAsyncIterable(stream);
|
|
2082
|
+
}
|
|
2083
|
+
function createBaseParserContext(mode, options) {
|
|
2084
|
+
return {
|
|
2085
|
+
plugins: options.plugins,
|
|
2086
|
+
mode,
|
|
2087
|
+
marked: /* @__PURE__ */ new Set(),
|
|
2088
|
+
features: 127 ^ (options.disabledFeatures || 0),
|
|
2089
|
+
refs: options.refs || /* @__PURE__ */ new Map(),
|
|
2090
|
+
depthLimit: options.depthLimit || 1e3
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Ensures that the value (based on an identifier) has been visited by the parser.
|
|
2095
|
+
* @param ctx
|
|
2096
|
+
* @param id
|
|
2097
|
+
*/
|
|
2098
|
+
function markParserRef(ctx, id) {
|
|
2099
|
+
ctx.marked.add(id);
|
|
2100
|
+
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Creates an identifier for a value
|
|
2103
|
+
* @param ctx
|
|
2104
|
+
* @param current
|
|
2105
|
+
*/
|
|
2106
|
+
function createIndexForValue(ctx, current) {
|
|
2107
|
+
const id = ctx.refs.size;
|
|
2108
|
+
ctx.refs.set(current, id);
|
|
2109
|
+
return id;
|
|
2110
|
+
}
|
|
2111
|
+
function getNodeForIndexedValue(ctx, current) {
|
|
2112
|
+
const registeredId = ctx.refs.get(current);
|
|
2113
|
+
if (registeredId != null) {
|
|
2114
|
+
markParserRef(ctx, registeredId);
|
|
2115
|
+
return {
|
|
2116
|
+
type: 1,
|
|
2117
|
+
value: createIndexedValueNode(registeredId)
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
return {
|
|
2121
|
+
type: 0,
|
|
2122
|
+
value: createIndexForValue(ctx, current)
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
function getReferenceNode(ctx, current) {
|
|
2126
|
+
const indexed = getNodeForIndexedValue(ctx, current);
|
|
2127
|
+
if (indexed.type === 1) return indexed;
|
|
2128
|
+
if (hasReferenceID(current)) return {
|
|
2129
|
+
type: 2,
|
|
2130
|
+
value: createReferenceNode(indexed.value, current)
|
|
2131
|
+
};
|
|
2132
|
+
return indexed;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Parsing methods
|
|
2136
|
+
*/
|
|
2137
|
+
function parseWellKnownSymbol(ctx, current) {
|
|
2138
|
+
const ref = getReferenceNode(ctx, current);
|
|
2139
|
+
if (ref.type !== 0) return ref.value;
|
|
2140
|
+
if (current in INV_SYMBOL_REF) return createWKSymbolNode(ref.value, current);
|
|
2141
|
+
throw new SerovalUnsupportedTypeError(current);
|
|
2142
|
+
}
|
|
2143
|
+
function parseSpecialReference(ctx, ref) {
|
|
2144
|
+
const result = getNodeForIndexedValue(ctx, SPECIAL_REFS[ref]);
|
|
2145
|
+
if (result.type === 1) return result.value;
|
|
2146
|
+
return createSerovalNode(26, result.value, ref, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0);
|
|
2147
|
+
}
|
|
2148
|
+
function parseIteratorFactory(ctx) {
|
|
2149
|
+
const result = getNodeForIndexedValue(ctx, ITERATOR);
|
|
2150
|
+
if (result.type === 1) return result.value;
|
|
2151
|
+
return createSerovalNode(27, result.value, void 0, void 0, void 0, void 0, void 0, void 0, parseWellKnownSymbol(ctx, SYM_ITERATOR), void 0, void 0, void 0);
|
|
2152
|
+
}
|
|
2153
|
+
function parseAsyncIteratorFactory(ctx) {
|
|
2154
|
+
const result = getNodeForIndexedValue(ctx, ASYNC_ITERATOR);
|
|
2155
|
+
if (result.type === 1) return result.value;
|
|
2156
|
+
return createSerovalNode(29, result.value, void 0, void 0, void 0, void 0, void 0, [parseSpecialReference(ctx, 1), parseWellKnownSymbol(ctx, SYM_ASYNC_ITERATOR)], void 0, void 0, void 0, void 0);
|
|
2157
|
+
}
|
|
2158
|
+
function createObjectNode(id, current, empty, record) {
|
|
2159
|
+
return createSerovalNode(empty ? 11 : 10, id, void 0, void 0, void 0, record, void 0, void 0, void 0, void 0, getObjectFlag(current), void 0);
|
|
2160
|
+
}
|
|
2161
|
+
function createMapNode(ctx, id, k, v) {
|
|
2162
|
+
return createSerovalNode(8, id, void 0, void 0, void 0, void 0, {
|
|
2163
|
+
k,
|
|
2164
|
+
v
|
|
2165
|
+
}, void 0, parseSpecialReference(ctx, 0), void 0, void 0, void 0);
|
|
2166
|
+
}
|
|
2167
|
+
function createPromiseConstructorNode(ctx, id, resolver) {
|
|
2168
|
+
return createSerovalNode(22, id, resolver, void 0, void 0, void 0, void 0, void 0, parseSpecialReference(ctx, 1), void 0, void 0, void 0);
|
|
2169
|
+
}
|
|
2170
|
+
function createArrayBufferNode(ctx, id, current) {
|
|
2171
|
+
const bytes = new Uint8Array(current);
|
|
2172
|
+
let result = "";
|
|
2173
|
+
for (let i = 0, len = bytes.length; i < len; i++) result += String.fromCharCode(bytes[i]);
|
|
2174
|
+
return createSerovalNode(19, id, serializeString(btoa(result)), void 0, void 0, void 0, void 0, void 0, parseSpecialReference(ctx, 5), void 0, void 0, void 0);
|
|
2175
|
+
}
|
|
2176
|
+
function createPlugin(plugin) {
|
|
2177
|
+
return plugin;
|
|
2178
|
+
}
|
|
2179
|
+
function dedupePlugins(deduped, plugins) {
|
|
2180
|
+
for (let i = 0, len = plugins.length; i < len; i++) {
|
|
2181
|
+
const current = plugins[i];
|
|
2182
|
+
if (!deduped.has(current)) {
|
|
2183
|
+
deduped.add(current);
|
|
2184
|
+
if (current.extends) dedupePlugins(deduped, current.extends);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function resolvePlugins(plugins) {
|
|
2189
|
+
if (plugins) {
|
|
2190
|
+
const deduped = /* @__PURE__ */ new Set();
|
|
2191
|
+
dedupePlugins(deduped, plugins);
|
|
2192
|
+
return [...deduped];
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
function getTypedArrayConstructor(name) {
|
|
2196
|
+
switch (name) {
|
|
2197
|
+
case "Int8Array": return Int8Array;
|
|
2198
|
+
case "Int16Array": return Int16Array;
|
|
2199
|
+
case "Int32Array": return Int32Array;
|
|
2200
|
+
case "Uint8Array": return Uint8Array;
|
|
2201
|
+
case "Uint16Array": return Uint16Array;
|
|
2202
|
+
case "Uint32Array": return Uint32Array;
|
|
2203
|
+
case "Uint8ClampedArray": return Uint8ClampedArray;
|
|
2204
|
+
case "Float32Array": return Float32Array;
|
|
2205
|
+
case "Float64Array": return Float64Array;
|
|
2206
|
+
case "BigInt64Array": return BigInt64Array;
|
|
2207
|
+
case "BigUint64Array": return BigUint64Array;
|
|
2208
|
+
default: throw new SerovalUnknownTypedArrayError(name);
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
function isValidKey(key) {
|
|
2212
|
+
switch (key) {
|
|
2213
|
+
case "constructor":
|
|
2214
|
+
case "__proto__":
|
|
2215
|
+
case "prototype":
|
|
2216
|
+
case "__defineGetter__":
|
|
2217
|
+
case "__defineSetter__":
|
|
2218
|
+
case "__lookupGetter__":
|
|
2219
|
+
case "__lookupSetter__": return false;
|
|
2220
|
+
default: return true;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
function isValidSymbol(symbol) {
|
|
2224
|
+
switch (symbol) {
|
|
2225
|
+
case SYM_ASYNC_ITERATOR:
|
|
2226
|
+
case SYM_IS_CONCAT_SPREADABLE:
|
|
2227
|
+
case SYM_TO_STRING_TAG:
|
|
2228
|
+
case SYM_ITERATOR: return true;
|
|
2229
|
+
default: return false;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
var MAX_BASE64_LENGTH = 1e6;
|
|
2233
|
+
var MAX_BIGINT_LENGTH = 1e4;
|
|
2234
|
+
var MAX_REGEXP_SOURCE_LENGTH = 2e4;
|
|
2235
|
+
function applyObjectFlag(obj, flag) {
|
|
2236
|
+
switch (flag) {
|
|
2237
|
+
case 3: return Object.freeze(obj);
|
|
2238
|
+
case 1: return Object.preventExtensions(obj);
|
|
2239
|
+
case 2: return Object.seal(obj);
|
|
2240
|
+
default: return obj;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
var DEFAULT_DEPTH_LIMIT = 1e3;
|
|
2244
|
+
function createBaseDeserializerContext(mode, options) {
|
|
2245
|
+
var _options$features;
|
|
2246
|
+
const refs = options.refs || /* @__PURE__ */ new Map();
|
|
2247
|
+
if (!("types" in refs)) Object.assign(refs, { types: /* @__PURE__ */ new Map() });
|
|
2248
|
+
return {
|
|
2249
|
+
mode,
|
|
2250
|
+
plugins: options.plugins,
|
|
2251
|
+
refs,
|
|
2252
|
+
features: (_options$features = options.features) !== null && _options$features !== void 0 ? _options$features : 127 ^ (options.disabledFeatures || 0),
|
|
2253
|
+
depthLimit: options.depthLimit || DEFAULT_DEPTH_LIMIT
|
|
2254
|
+
};
|
|
2255
|
+
}
|
|
2256
|
+
function createCrossDeserializerContext(options) {
|
|
2257
|
+
return {
|
|
2258
|
+
mode: 2,
|
|
2259
|
+
base: createBaseDeserializerContext(2, options),
|
|
2260
|
+
child: void 0
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
var DeserializePluginContext = class {
|
|
2264
|
+
constructor(_p, depth) {
|
|
2265
|
+
this._p = _p;
|
|
2266
|
+
this.depth = depth;
|
|
2267
|
+
}
|
|
2268
|
+
deserialize(node) {
|
|
2269
|
+
return deserialize$1(this._p, this.depth, node);
|
|
2270
|
+
}
|
|
2271
|
+
};
|
|
2272
|
+
function guardIndexedValue(ctx, id) {
|
|
2273
|
+
if (id < 0 || !Number.isFinite(id) || !Number.isInteger(id)) throw new SerovalMalformedNodeError({
|
|
2274
|
+
t: 4,
|
|
2275
|
+
i: id
|
|
2276
|
+
});
|
|
2277
|
+
if (ctx.refs.has(id)) throw new Error("Conflicted ref id: " + id);
|
|
2278
|
+
}
|
|
2279
|
+
function isThennable(value) {
|
|
2280
|
+
return !!value && typeof value === "object" && "then" in value && typeof value.then === "function";
|
|
2281
|
+
}
|
|
2282
|
+
function assignIndexedValueVanilla(ctx, id, value) {
|
|
2283
|
+
guardIndexedValue(ctx.base, id);
|
|
2284
|
+
if (ctx.state.marked.has(id)) ctx.base.refs.set(id, value);
|
|
2285
|
+
return value;
|
|
2286
|
+
}
|
|
2287
|
+
function assignIndexedValueCross(ctx, id, value) {
|
|
2288
|
+
guardIndexedValue(ctx.base, id);
|
|
2289
|
+
ctx.base.refs.set(id, value);
|
|
2290
|
+
return value;
|
|
2291
|
+
}
|
|
2292
|
+
function assignIndexedValue$1(ctx, id, value) {
|
|
2293
|
+
return ctx.mode === 1 ? assignIndexedValueVanilla(ctx, id, value) : assignIndexedValueCross(ctx, id, value);
|
|
2294
|
+
}
|
|
2295
|
+
function deserializeKnownValue(node, record, key) {
|
|
2296
|
+
if (Object.hasOwn(record, key)) return record[key];
|
|
2297
|
+
throw new SerovalMalformedNodeError(node);
|
|
2298
|
+
}
|
|
2299
|
+
function deserializeReference(ctx, node) {
|
|
2300
|
+
return assignIndexedValue$1(ctx, node.i, getReference(deserializeString(node.s)));
|
|
2301
|
+
}
|
|
2302
|
+
function deserializeArray(ctx, depth, node) {
|
|
2303
|
+
const items = node.a;
|
|
2304
|
+
const len = items.length;
|
|
2305
|
+
const result = assignIndexedValue$1(ctx, node.i, new Array(len));
|
|
2306
|
+
for (let i = 0, item; i < len; i++) {
|
|
2307
|
+
item = items[i];
|
|
2308
|
+
if (item) result[i] = deserialize$1(ctx, depth, item);
|
|
2309
|
+
}
|
|
2310
|
+
applyObjectFlag(result, node.o);
|
|
2311
|
+
return result;
|
|
2312
|
+
}
|
|
2313
|
+
function assignStringProperty(object, key, value) {
|
|
2314
|
+
if (isValidKey(key)) object[key] = value;
|
|
2315
|
+
else Object.defineProperty(object, key, {
|
|
2316
|
+
value,
|
|
2317
|
+
configurable: true,
|
|
2318
|
+
enumerable: true,
|
|
2319
|
+
writable: true
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
function assignProperty(ctx, depth, object, key, value) {
|
|
2323
|
+
if (typeof key === "string") assignStringProperty(object, deserializeString(key), deserialize$1(ctx, depth, value));
|
|
2324
|
+
else {
|
|
2325
|
+
const actual = deserialize$1(ctx, depth, key);
|
|
2326
|
+
switch (typeof actual) {
|
|
2327
|
+
case "string":
|
|
2328
|
+
assignStringProperty(object, actual, deserialize$1(ctx, depth, value));
|
|
2329
|
+
break;
|
|
2330
|
+
case "symbol":
|
|
2331
|
+
if (isValidSymbol(actual)) object[actual] = deserialize$1(ctx, depth, value);
|
|
2332
|
+
break;
|
|
2333
|
+
default: throw new SerovalMalformedNodeError(key);
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
function assignNodeType(ctx, id, type) {
|
|
2338
|
+
ctx.base.refs.types.set(id, type);
|
|
2339
|
+
}
|
|
2340
|
+
function validateNodeType(ctx, node, id, type) {
|
|
2341
|
+
if (ctx.base.refs.types.get(id) !== type) throw new SerovalMalformedNodeError(node);
|
|
2342
|
+
}
|
|
2343
|
+
function deserializeProperties(ctx, depth, node, result) {
|
|
2344
|
+
const keys = node.k;
|
|
2345
|
+
if (keys.length > 0) for (let i = 0, vals = node.v, len = keys.length; i < len; i++) assignProperty(ctx, depth, result, keys[i], vals[i]);
|
|
2346
|
+
return result;
|
|
2347
|
+
}
|
|
2348
|
+
function deserializeObject(ctx, depth, node) {
|
|
2349
|
+
const result = assignIndexedValue$1(ctx, node.i, node.t === 10 ? {} : Object.create(null));
|
|
2350
|
+
deserializeProperties(ctx, depth, node.p, result);
|
|
2351
|
+
applyObjectFlag(result, node.o);
|
|
2352
|
+
return result;
|
|
2353
|
+
}
|
|
2354
|
+
function deserializeDate(ctx, node) {
|
|
2355
|
+
return assignIndexedValue$1(ctx, node.i, new Date(node.s));
|
|
2356
|
+
}
|
|
2357
|
+
function deserializeTemporal(ctx, node) {
|
|
2358
|
+
if (!(ctx.base.features & 64)) throw new SerovalUnsupportedNodeError(node);
|
|
2359
|
+
let value;
|
|
2360
|
+
switch (node.c) {
|
|
2361
|
+
case 0:
|
|
2362
|
+
value = Temporal.Instant.from(node.s);
|
|
2363
|
+
break;
|
|
2364
|
+
case 1:
|
|
2365
|
+
value = Temporal.Duration.from(node.s);
|
|
2366
|
+
break;
|
|
2367
|
+
case 2:
|
|
2368
|
+
value = Temporal.PlainDate.from(node.s);
|
|
2369
|
+
break;
|
|
2370
|
+
case 3:
|
|
2371
|
+
value = Temporal.PlainDateTime.from(node.s);
|
|
2372
|
+
break;
|
|
2373
|
+
case 4:
|
|
2374
|
+
value = Temporal.PlainMonthDay.from(node.s);
|
|
2375
|
+
break;
|
|
2376
|
+
case 5:
|
|
2377
|
+
value = Temporal.PlainTime.from(node.s);
|
|
2378
|
+
break;
|
|
2379
|
+
case 6:
|
|
2380
|
+
value = Temporal.PlainYearMonth.from(node.s);
|
|
2381
|
+
break;
|
|
2382
|
+
case 7:
|
|
2383
|
+
value = Temporal.ZonedDateTime.from(node.s);
|
|
2384
|
+
break;
|
|
2385
|
+
default: throw new SerovalMalformedNodeError(node);
|
|
2386
|
+
}
|
|
2387
|
+
return assignIndexedValue$1(ctx, node.i, value);
|
|
2388
|
+
}
|
|
2389
|
+
function deserializeRegExp(ctx, node) {
|
|
2390
|
+
if (ctx.base.features & 32) {
|
|
2391
|
+
const source = deserializeString(node.c);
|
|
2392
|
+
if (source.length > MAX_REGEXP_SOURCE_LENGTH) throw new SerovalMalformedNodeError(node);
|
|
2393
|
+
return assignIndexedValue$1(ctx, node.i, new RegExp(source, node.m));
|
|
2394
|
+
}
|
|
2395
|
+
throw new SerovalUnsupportedNodeError(node);
|
|
2396
|
+
}
|
|
2397
|
+
function deserializeSet(ctx, depth, node) {
|
|
2398
|
+
const result = assignIndexedValue$1(ctx, node.i, /* @__PURE__ */ new Set());
|
|
2399
|
+
for (let i = 0, items = node.a, len = items.length; i < len; i++) result.add(deserialize$1(ctx, depth, items[i]));
|
|
2400
|
+
return result;
|
|
2401
|
+
}
|
|
2402
|
+
function deserializeMap(ctx, depth, node) {
|
|
2403
|
+
const result = assignIndexedValue$1(ctx, node.i, /* @__PURE__ */ new Map());
|
|
2404
|
+
for (let i = 0, keys = node.e.k, vals = node.e.v, len = keys.length; i < len; i++) result.set(deserialize$1(ctx, depth, keys[i]), deserialize$1(ctx, depth, vals[i]));
|
|
2405
|
+
return result;
|
|
2406
|
+
}
|
|
2407
|
+
function deserializeArrayBuffer(ctx, node) {
|
|
2408
|
+
if (node.s.length > MAX_BASE64_LENGTH) throw new SerovalMalformedNodeError(node);
|
|
2409
|
+
return assignIndexedValue$1(ctx, node.i, ARRAY_BUFFER_CONSTRUCTOR(deserializeString(node.s)));
|
|
2410
|
+
}
|
|
2411
|
+
function deserializeTypedArray(ctx, depth, node) {
|
|
2412
|
+
var _node$b;
|
|
2413
|
+
const construct = getTypedArrayConstructor(node.c);
|
|
2414
|
+
const source = deserialize$1(ctx, depth, node.f);
|
|
2415
|
+
const offset = (_node$b = node.b) !== null && _node$b !== void 0 ? _node$b : 0;
|
|
2416
|
+
if (offset < 0 || offset > source.byteLength || node.l > MAX_BASE64_LENGTH) throw new SerovalMalformedNodeError(node);
|
|
2417
|
+
return assignIndexedValue$1(ctx, node.i, new construct(source, offset, node.l));
|
|
2418
|
+
}
|
|
2419
|
+
function deserializeDataView(ctx, depth, node) {
|
|
2420
|
+
var _node$b2;
|
|
2421
|
+
const source = deserialize$1(ctx, depth, node.f);
|
|
2422
|
+
const offset = (_node$b2 = node.b) !== null && _node$b2 !== void 0 ? _node$b2 : 0;
|
|
2423
|
+
if (offset < 0 || offset > source.byteLength || node.l > MAX_BASE64_LENGTH) throw new SerovalMalformedNodeError(node);
|
|
2424
|
+
return assignIndexedValue$1(ctx, node.i, new DataView(source, offset, node.l));
|
|
2425
|
+
}
|
|
2426
|
+
function deserializeDictionary(ctx, depth, node, result) {
|
|
2427
|
+
if (node.p) {
|
|
2428
|
+
const fields = deserializeProperties(ctx, depth, node.p, {});
|
|
2429
|
+
Object.defineProperties(result, Object.getOwnPropertyDescriptors(fields));
|
|
2430
|
+
}
|
|
2431
|
+
return result;
|
|
2432
|
+
}
|
|
2433
|
+
function deserializeAggregateError(ctx, depth, node) {
|
|
2434
|
+
return deserializeDictionary(ctx, depth, node, assignIndexedValue$1(ctx, node.i, new AggregateError([], deserializeString(node.m))));
|
|
2435
|
+
}
|
|
2436
|
+
function deserializeError(ctx, depth, node) {
|
|
2437
|
+
const construct = deserializeKnownValue(node, ERROR_CONSTRUCTOR, node.s);
|
|
2438
|
+
return deserializeDictionary(ctx, depth, node, assignIndexedValue$1(ctx, node.i, new construct(deserializeString(node.m))));
|
|
2439
|
+
}
|
|
2440
|
+
function deserializePromise(ctx, depth, node) {
|
|
2441
|
+
const deferred = PROMISE_CONSTRUCTOR();
|
|
2442
|
+
const result = assignIndexedValue$1(ctx, node.i, deferred.p);
|
|
2443
|
+
const deserialized = deserialize$1(ctx, depth, node.f);
|
|
2444
|
+
if (isThennable(deserialized)) throw new SerovalMalformedNodeError(node.f);
|
|
2445
|
+
if (node.s) deferred.s(deserialized);
|
|
2446
|
+
else deferred.f(deserialized);
|
|
2447
|
+
return result;
|
|
2448
|
+
}
|
|
2449
|
+
function deserializeBoxed(ctx, depth, node) {
|
|
2450
|
+
return assignIndexedValue$1(ctx, node.i, Object(deserialize$1(ctx, depth, node.f)));
|
|
2451
|
+
}
|
|
2452
|
+
function deserializePlugin(ctx, depth, node) {
|
|
2453
|
+
const currentPlugins = ctx.base.plugins;
|
|
2454
|
+
if (currentPlugins) {
|
|
2455
|
+
const tag = deserializeString(node.c);
|
|
2456
|
+
for (let i = 0, len = currentPlugins.length; i < len; i++) {
|
|
2457
|
+
const plugin = currentPlugins[i];
|
|
2458
|
+
if (plugin.tag === tag) return assignIndexedValue$1(ctx, node.i, plugin.deserialize(node.s, new DeserializePluginContext(ctx, depth), { id: node.i }));
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
throw new SerovalMissingPluginError(node.c);
|
|
2462
|
+
}
|
|
2463
|
+
function deserializePromiseConstructor(ctx, node) {
|
|
2464
|
+
const value = assignIndexedValue$1(ctx, node.i, assignIndexedValue$1(ctx, node.s, PROMISE_CONSTRUCTOR()).p);
|
|
2465
|
+
assignNodeType(ctx, node.s, 22);
|
|
2466
|
+
return value;
|
|
2467
|
+
}
|
|
2468
|
+
function deserializePromiseFulfill(ctx, depth, node) {
|
|
2469
|
+
const deferred = ctx.base.refs.get(node.i);
|
|
2470
|
+
if (deferred) {
|
|
2471
|
+
validateNodeType(ctx, node, node.i, 22);
|
|
2472
|
+
const deserialized = deserialize$1(ctx, depth, node.a[1]);
|
|
2473
|
+
if (isThennable(deserialized)) throw new SerovalMalformedNodeError(node.a[1]);
|
|
2474
|
+
if (node.t === 23) deferred.s(deserialized);
|
|
2475
|
+
else deferred.f(deserialized);
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
throw new SerovalMissingInstanceError("Promise");
|
|
2479
|
+
}
|
|
2480
|
+
function deserializeIteratorFactoryInstance(ctx, depth, node) {
|
|
2481
|
+
deserialize$1(ctx, depth, node.a[0]);
|
|
2482
|
+
return sequenceToIterator(deserialize$1(ctx, depth, node.a[1]));
|
|
2483
|
+
}
|
|
2484
|
+
function deserializeAsyncIteratorFactoryInstance(ctx, depth, node) {
|
|
2485
|
+
deserialize$1(ctx, depth, node.a[0]);
|
|
2486
|
+
return streamToAsyncIterable(deserialize$1(ctx, depth, node.a[1]));
|
|
2487
|
+
}
|
|
2488
|
+
function deserializeStreamConstructor(ctx, depth, node) {
|
|
2489
|
+
const result = assignIndexedValue$1(ctx, node.i, createStream());
|
|
2490
|
+
assignNodeType(ctx, node.i, 31);
|
|
2491
|
+
const items = node.a;
|
|
2492
|
+
const len = items.length;
|
|
2493
|
+
if (len) for (let i = 0; i < len; i++) deserialize$1(ctx, depth, items[i]);
|
|
2494
|
+
return result;
|
|
2495
|
+
}
|
|
2496
|
+
function deserializeStreamNext(ctx, depth, node) {
|
|
2497
|
+
const deferred = ctx.base.refs.get(node.i);
|
|
2498
|
+
if (deferred) {
|
|
2499
|
+
validateNodeType(ctx, node, node.i, 31);
|
|
2500
|
+
deferred.next(deserialize$1(ctx, depth, node.f));
|
|
2501
|
+
return;
|
|
2502
|
+
}
|
|
2503
|
+
throw new SerovalMissingInstanceError("Stream");
|
|
2504
|
+
}
|
|
2505
|
+
function deserializeStreamThrow(ctx, depth, node) {
|
|
2506
|
+
const deferred = ctx.base.refs.get(node.i);
|
|
2507
|
+
if (deferred) {
|
|
2508
|
+
validateNodeType(ctx, node, node.i, 31);
|
|
2509
|
+
deferred.throw(deserialize$1(ctx, depth, node.f));
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
throw new SerovalMissingInstanceError("Stream");
|
|
2513
|
+
}
|
|
2514
|
+
function deserializeStreamReturn(ctx, depth, node) {
|
|
2515
|
+
const deferred = ctx.base.refs.get(node.i);
|
|
2516
|
+
if (deferred) {
|
|
2517
|
+
validateNodeType(ctx, node, node.i, 31);
|
|
2518
|
+
deferred.return(deserialize$1(ctx, depth, node.f));
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
throw new SerovalMissingInstanceError("Stream");
|
|
2522
|
+
}
|
|
2523
|
+
function deserializeIteratorFactory(ctx, depth, node) {
|
|
2524
|
+
deserialize$1(ctx, depth, node.f);
|
|
2525
|
+
}
|
|
2526
|
+
function deserializeAsyncIteratorFactory(ctx, depth, node) {
|
|
2527
|
+
deserialize$1(ctx, depth, node.a[1]);
|
|
2528
|
+
}
|
|
2529
|
+
function deserializeSequence(ctx, depth, node) {
|
|
2530
|
+
const result = assignIndexedValue$1(ctx, node.i, createSequence([], node.s, node.l));
|
|
2531
|
+
for (let i = 0, len = node.a.length; i < len; i++) result.v[i] = deserialize$1(ctx, depth, node.a[i]);
|
|
2532
|
+
return result;
|
|
2533
|
+
}
|
|
2534
|
+
function deserialize$1(ctx, depth, node) {
|
|
2535
|
+
if (depth > ctx.base.depthLimit) throw new SerovalDepthLimitError(ctx.base.depthLimit);
|
|
2536
|
+
depth += 1;
|
|
2537
|
+
switch (node.t) {
|
|
2538
|
+
case 2: return deserializeKnownValue(node, CONSTANT_VAL, node.s);
|
|
2539
|
+
case 0: return Number(node.s);
|
|
2540
|
+
case 1: return deserializeString(String(node.s));
|
|
2541
|
+
case 3:
|
|
2542
|
+
if (String(node.s).length > MAX_BIGINT_LENGTH) throw new SerovalMalformedNodeError(node);
|
|
2543
|
+
return BigInt(node.s);
|
|
2544
|
+
case 4: return ctx.base.refs.get(node.i);
|
|
2545
|
+
case 18: return deserializeReference(ctx, node);
|
|
2546
|
+
case 9: return deserializeArray(ctx, depth, node);
|
|
2547
|
+
case 10:
|
|
2548
|
+
case 11: return deserializeObject(ctx, depth, node);
|
|
2549
|
+
case 5: return deserializeDate(ctx, node);
|
|
2550
|
+
case 6: return deserializeRegExp(ctx, node);
|
|
2551
|
+
case 7: return deserializeSet(ctx, depth, node);
|
|
2552
|
+
case 8: return deserializeMap(ctx, depth, node);
|
|
2553
|
+
case 19: return deserializeArrayBuffer(ctx, node);
|
|
2554
|
+
case 16:
|
|
2555
|
+
case 15: return deserializeTypedArray(ctx, depth, node);
|
|
2556
|
+
case 20: return deserializeDataView(ctx, depth, node);
|
|
2557
|
+
case 14: return deserializeAggregateError(ctx, depth, node);
|
|
2558
|
+
case 13: return deserializeError(ctx, depth, node);
|
|
2559
|
+
case 12: return deserializePromise(ctx, depth, node);
|
|
2560
|
+
case 17: return deserializeKnownValue(node, SYMBOL_REF, node.s);
|
|
2561
|
+
case 21: return deserializeBoxed(ctx, depth, node);
|
|
2562
|
+
case 25: return deserializePlugin(ctx, depth, node);
|
|
2563
|
+
case 22: return deserializePromiseConstructor(ctx, node);
|
|
2564
|
+
case 23:
|
|
2565
|
+
case 24: return deserializePromiseFulfill(ctx, depth, node);
|
|
2566
|
+
case 28: return deserializeIteratorFactoryInstance(ctx, depth, node);
|
|
2567
|
+
case 30: return deserializeAsyncIteratorFactoryInstance(ctx, depth, node);
|
|
2568
|
+
case 31: return deserializeStreamConstructor(ctx, depth, node);
|
|
2569
|
+
case 32: return deserializeStreamNext(ctx, depth, node);
|
|
2570
|
+
case 33: return deserializeStreamThrow(ctx, depth, node);
|
|
2571
|
+
case 34: return deserializeStreamReturn(ctx, depth, node);
|
|
2572
|
+
case 27: return deserializeIteratorFactory(ctx, depth, node);
|
|
2573
|
+
case 29: return deserializeAsyncIteratorFactory(ctx, depth, node);
|
|
2574
|
+
case 35: return deserializeSequence(ctx, depth, node);
|
|
2575
|
+
case 36: return deserializeTemporal(ctx, node);
|
|
2576
|
+
default: throw new SerovalUnsupportedNodeError(node);
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
function deserializeTop(ctx, node) {
|
|
2580
|
+
try {
|
|
2581
|
+
return deserialize$1(ctx, 0, node);
|
|
2582
|
+
} catch (error) {
|
|
2583
|
+
throw new SerovalDeserializationError(error);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
var SyncParsePluginContext = class {
|
|
2587
|
+
constructor(_p, depth) {
|
|
2588
|
+
this._p = _p;
|
|
2589
|
+
this.depth = depth;
|
|
2590
|
+
}
|
|
2591
|
+
parse(current) {
|
|
2592
|
+
return parseSOS(this._p, this.depth, current);
|
|
2593
|
+
}
|
|
2594
|
+
};
|
|
2595
|
+
var StreamParsePluginContext = class {
|
|
2596
|
+
constructor(_p, depth) {
|
|
2597
|
+
this._p = _p;
|
|
2598
|
+
this.depth = depth;
|
|
2599
|
+
}
|
|
2600
|
+
parse(current) {
|
|
2601
|
+
return parseSOS(this._p, this.depth, current);
|
|
2602
|
+
}
|
|
2603
|
+
parseWithError(current) {
|
|
2604
|
+
return parseWithError(this._p, this.depth, current);
|
|
2605
|
+
}
|
|
2606
|
+
isAlive() {
|
|
2607
|
+
return this._p.state.alive;
|
|
2608
|
+
}
|
|
2609
|
+
pushPendingState() {
|
|
2610
|
+
pushPendingState(this._p);
|
|
2611
|
+
}
|
|
2612
|
+
popPendingState() {
|
|
2613
|
+
popPendingState(this._p);
|
|
2614
|
+
}
|
|
2615
|
+
onParse(node) {
|
|
2616
|
+
onParse(this._p, node);
|
|
2617
|
+
}
|
|
2618
|
+
onError(error) {
|
|
2619
|
+
onError(this._p, error);
|
|
2620
|
+
}
|
|
2621
|
+
addCleanup(callback) {
|
|
2622
|
+
this._p.state.cleanups.push(callback);
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
function createStreamParserState(options) {
|
|
2626
|
+
return {
|
|
2627
|
+
alive: true,
|
|
2628
|
+
pending: 0,
|
|
2629
|
+
initial: true,
|
|
2630
|
+
buffer: [],
|
|
2631
|
+
onParse: options.onParse,
|
|
2632
|
+
onError: options.onError,
|
|
2633
|
+
onDone: options.onDone,
|
|
2634
|
+
cleanups: []
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
function createStreamParserContext(options) {
|
|
2638
|
+
return {
|
|
2639
|
+
type: 2,
|
|
2640
|
+
base: createBaseParserContext(2, options),
|
|
2641
|
+
state: createStreamParserState(options)
|
|
2642
|
+
};
|
|
2643
|
+
}
|
|
2644
|
+
function parseItems(ctx, depth, current) {
|
|
2645
|
+
const nodes = [];
|
|
2646
|
+
for (let i = 0, len = current.length; i < len; i++) if (i in current) nodes[i] = parseSOS(ctx, depth, current[i]);
|
|
2647
|
+
else nodes[i] = 0;
|
|
2648
|
+
return nodes;
|
|
2649
|
+
}
|
|
2650
|
+
function parseArray(ctx, depth, id, current) {
|
|
2651
|
+
return createArrayNode(id, current, parseItems(ctx, depth, current));
|
|
2652
|
+
}
|
|
2653
|
+
function parseProperties(ctx, depth, properties) {
|
|
2654
|
+
const entries = Object.entries(properties);
|
|
2655
|
+
const keyNodes = [];
|
|
2656
|
+
const valueNodes = [];
|
|
2657
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2658
|
+
keyNodes.push(serializeString(entries[i][0]));
|
|
2659
|
+
valueNodes.push(parseSOS(ctx, depth, entries[i][1]));
|
|
2660
|
+
}
|
|
2661
|
+
if (SYM_ITERATOR in properties) {
|
|
2662
|
+
keyNodes.push(parseWellKnownSymbol(ctx.base, SYM_ITERATOR));
|
|
2663
|
+
valueNodes.push(createIteratorFactoryInstanceNode(parseIteratorFactory(ctx.base), parseSOS(ctx, depth, createSequenceFromIterable(properties))));
|
|
2664
|
+
}
|
|
2665
|
+
if (SYM_ASYNC_ITERATOR in properties) {
|
|
2666
|
+
keyNodes.push(parseWellKnownSymbol(ctx.base, SYM_ASYNC_ITERATOR));
|
|
2667
|
+
valueNodes.push(createAsyncIteratorFactoryInstanceNode(parseAsyncIteratorFactory(ctx.base), parseSOS(ctx, depth, ctx.type === 1 ? createStream() : createStreamFromAsyncIterable(properties))));
|
|
2668
|
+
}
|
|
2669
|
+
if (SYM_TO_STRING_TAG in properties) {
|
|
2670
|
+
keyNodes.push(parseWellKnownSymbol(ctx.base, SYM_TO_STRING_TAG));
|
|
2671
|
+
valueNodes.push(createStringNode(properties[SYM_TO_STRING_TAG]));
|
|
2672
|
+
}
|
|
2673
|
+
if (SYM_IS_CONCAT_SPREADABLE in properties) {
|
|
2674
|
+
keyNodes.push(parseWellKnownSymbol(ctx.base, SYM_IS_CONCAT_SPREADABLE));
|
|
2675
|
+
valueNodes.push(properties[SYM_IS_CONCAT_SPREADABLE] ? TRUE_NODE : FALSE_NODE);
|
|
2676
|
+
}
|
|
2677
|
+
return {
|
|
2678
|
+
k: keyNodes,
|
|
2679
|
+
v: valueNodes
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
function parsePlainObject(ctx, depth, id, current, empty) {
|
|
2683
|
+
return createObjectNode(id, current, empty, parseProperties(ctx, depth, current));
|
|
2684
|
+
}
|
|
2685
|
+
function parseBoxed(ctx, depth, id, current) {
|
|
2686
|
+
return createBoxedNode(id, parseSOS(ctx, depth, current.valueOf()));
|
|
2687
|
+
}
|
|
2688
|
+
function parseTypedArray(ctx, depth, id, current) {
|
|
2689
|
+
return createTypedArrayNode(id, current, parseSOS(ctx, depth, current.buffer));
|
|
2690
|
+
}
|
|
2691
|
+
function parseBigIntTypedArray(ctx, depth, id, current) {
|
|
2692
|
+
return createBigIntTypedArrayNode(id, current, parseSOS(ctx, depth, current.buffer));
|
|
2693
|
+
}
|
|
2694
|
+
function parseDataView(ctx, depth, id, current) {
|
|
2695
|
+
return createDataViewNode(id, current, parseSOS(ctx, depth, current.buffer));
|
|
2696
|
+
}
|
|
2697
|
+
function parseError(ctx, depth, id, current) {
|
|
2698
|
+
const options = getErrorOptions(current, ctx.base.features);
|
|
2699
|
+
return createErrorNode(id, current, options ? parseProperties(ctx, depth, options) : void 0);
|
|
2700
|
+
}
|
|
2701
|
+
function parseAggregateError(ctx, depth, id, current) {
|
|
2702
|
+
const options = getErrorOptions(current, ctx.base.features);
|
|
2703
|
+
return createAggregateErrorNode(id, current, options ? parseProperties(ctx, depth, options) : void 0);
|
|
2704
|
+
}
|
|
2705
|
+
function parseMap(ctx, depth, id, current) {
|
|
2706
|
+
const keyNodes = [];
|
|
2707
|
+
const valueNodes = [];
|
|
2708
|
+
for (const [key, value] of current.entries()) {
|
|
2709
|
+
keyNodes.push(parseSOS(ctx, depth, key));
|
|
2710
|
+
valueNodes.push(parseSOS(ctx, depth, value));
|
|
2711
|
+
}
|
|
2712
|
+
return createMapNode(ctx.base, id, keyNodes, valueNodes);
|
|
2713
|
+
}
|
|
2714
|
+
function parseSet(ctx, depth, id, current) {
|
|
2715
|
+
const items = [];
|
|
2716
|
+
for (const item of current.keys()) items.push(parseSOS(ctx, depth, item));
|
|
2717
|
+
return createSetNode(id, items);
|
|
2718
|
+
}
|
|
2719
|
+
function parseStream(ctx, depth, id, current) {
|
|
2720
|
+
const result = createStreamConstructorNode(id, parseSpecialReference(ctx.base, 4), []);
|
|
2721
|
+
if (ctx.type === 1) return result;
|
|
2722
|
+
pushPendingState(ctx);
|
|
2723
|
+
current.on({
|
|
2724
|
+
next: (value) => {
|
|
2725
|
+
if (ctx.state.alive) {
|
|
2726
|
+
const parsed = parseWithError(ctx, depth, value);
|
|
2727
|
+
if (parsed) onParse(ctx, createStreamNextNode(id, parsed));
|
|
2728
|
+
}
|
|
2729
|
+
},
|
|
2730
|
+
throw: (value) => {
|
|
2731
|
+
if (ctx.state.alive) {
|
|
2732
|
+
const parsed = parseWithError(ctx, depth, value);
|
|
2733
|
+
if (parsed) onParse(ctx, createStreamThrowNode(id, parsed));
|
|
2734
|
+
}
|
|
2735
|
+
popPendingState(ctx);
|
|
2736
|
+
},
|
|
2737
|
+
return: (value) => {
|
|
2738
|
+
if (ctx.state.alive) {
|
|
2739
|
+
const parsed = parseWithError(ctx, depth, value);
|
|
2740
|
+
if (parsed) onParse(ctx, createStreamReturnNode(id, parsed));
|
|
2741
|
+
}
|
|
2742
|
+
popPendingState(ctx);
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2745
|
+
return result;
|
|
2746
|
+
}
|
|
2747
|
+
function handlePromiseSuccess(id, depth, data) {
|
|
2748
|
+
if (this.state.alive) {
|
|
2749
|
+
const parsed = parseWithError(this, depth, data);
|
|
2750
|
+
if (parsed) onParse(this, createSerovalNode(23, id, void 0, void 0, void 0, void 0, void 0, [parseSpecialReference(this.base, 2), parsed], void 0, void 0, void 0, void 0));
|
|
2751
|
+
popPendingState(this);
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
function handlePromiseFailure(id, depth, data) {
|
|
2755
|
+
if (this.state.alive) {
|
|
2756
|
+
const parsed = parseWithError(this, depth, data);
|
|
2757
|
+
if (parsed) onParse(this, createSerovalNode(24, id, void 0, void 0, void 0, void 0, void 0, [parseSpecialReference(this.base, 3), parsed], void 0, void 0, void 0, void 0));
|
|
2758
|
+
}
|
|
2759
|
+
popPendingState(this);
|
|
2760
|
+
}
|
|
2761
|
+
function parsePromise(ctx, depth, id, current) {
|
|
2762
|
+
const resolver = createIndexForValue(ctx.base, {});
|
|
2763
|
+
if (ctx.type === 2) {
|
|
2764
|
+
pushPendingState(ctx);
|
|
2765
|
+
current.then(handlePromiseSuccess.bind(ctx, resolver, depth), handlePromiseFailure.bind(ctx, resolver, depth));
|
|
2766
|
+
}
|
|
2767
|
+
return createPromiseConstructorNode(ctx.base, id, resolver);
|
|
2768
|
+
}
|
|
2769
|
+
function parsePluginSync(ctx, depth, id, current, currentPlugins) {
|
|
2770
|
+
for (let i = 0, len = currentPlugins.length; i < len; i++) {
|
|
2771
|
+
const plugin = currentPlugins[i];
|
|
2772
|
+
if (plugin.parse.sync && plugin.test(current)) return createPluginNode(id, plugin.tag, plugin.parse.sync(current, new SyncParsePluginContext(ctx, depth), { id }));
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
function parsePluginStream(ctx, depth, id, current, currentPlugins) {
|
|
2776
|
+
for (let i = 0, len = currentPlugins.length; i < len; i++) {
|
|
2777
|
+
const plugin = currentPlugins[i];
|
|
2778
|
+
if (plugin.parse.stream && plugin.test(current)) return createPluginNode(id, plugin.tag, plugin.parse.stream(current, new StreamParsePluginContext(ctx, depth), { id }));
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
function parsePlugin(ctx, depth, id, current) {
|
|
2782
|
+
const currentPlugins = ctx.base.plugins;
|
|
2783
|
+
if (currentPlugins) return ctx.type === 1 ? parsePluginSync(ctx, depth, id, current, currentPlugins) : parsePluginStream(ctx, depth, id, current, currentPlugins);
|
|
2784
|
+
}
|
|
2785
|
+
function parseSequence(ctx, depth, id, current) {
|
|
2786
|
+
const nodes = [];
|
|
2787
|
+
for (let i = 0, len = current.v.length; i < len; i++) nodes[i] = parseSOS(ctx, depth, current.v[i]);
|
|
2788
|
+
return createSequenceNode(id, nodes, current.t, current.d);
|
|
2789
|
+
}
|
|
2790
|
+
function parseObjectPhase2(ctx, depth, id, current, currentClass) {
|
|
2791
|
+
switch (currentClass) {
|
|
2792
|
+
case Object: return parsePlainObject(ctx, depth, id, current, false);
|
|
2793
|
+
case void 0: return parsePlainObject(ctx, depth, id, current, true);
|
|
2794
|
+
case Date: return createDateNode(id, current);
|
|
2795
|
+
case Error:
|
|
2796
|
+
case EvalError:
|
|
2797
|
+
case RangeError:
|
|
2798
|
+
case ReferenceError:
|
|
2799
|
+
case SyntaxError:
|
|
2800
|
+
case TypeError:
|
|
2801
|
+
case URIError: return parseError(ctx, depth, id, current);
|
|
2802
|
+
case Number:
|
|
2803
|
+
case Boolean:
|
|
2804
|
+
case String:
|
|
2805
|
+
case BigInt: return parseBoxed(ctx, depth, id, current);
|
|
2806
|
+
case ArrayBuffer: return createArrayBufferNode(ctx.base, id, current);
|
|
2807
|
+
case Int8Array:
|
|
2808
|
+
case Int16Array:
|
|
2809
|
+
case Int32Array:
|
|
2810
|
+
case Uint8Array:
|
|
2811
|
+
case Uint16Array:
|
|
2812
|
+
case Uint32Array:
|
|
2813
|
+
case Uint8ClampedArray:
|
|
2814
|
+
case Float32Array:
|
|
2815
|
+
case Float64Array: return parseTypedArray(ctx, depth, id, current);
|
|
2816
|
+
case DataView: return parseDataView(ctx, depth, id, current);
|
|
2817
|
+
case Map: return parseMap(ctx, depth, id, current);
|
|
2818
|
+
case Set: return parseSet(ctx, depth, id, current);
|
|
2819
|
+
}
|
|
2820
|
+
if (currentClass === Promise || current instanceof Promise) return parsePromise(ctx, depth, id, current);
|
|
2821
|
+
const currentFeatures = ctx.base.features;
|
|
2822
|
+
if (currentFeatures & 32 && currentClass === RegExp) return createRegExpNode(id, current);
|
|
2823
|
+
if (currentFeatures & 16) switch (currentClass) {
|
|
2824
|
+
case BigInt64Array:
|
|
2825
|
+
case BigUint64Array: return parseBigIntTypedArray(ctx, depth, id, current);
|
|
2826
|
+
}
|
|
2827
|
+
if (currentFeatures & 1 && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) return parseAggregateError(ctx, depth, id, current);
|
|
2828
|
+
if (currentFeatures & 64 && typeof Temporal !== "undefined") switch (currentClass) {
|
|
2829
|
+
case Temporal.Instant: return createTemporalNode(id, 0, current);
|
|
2830
|
+
case Temporal.Duration: return createTemporalNode(id, 1, current);
|
|
2831
|
+
case Temporal.PlainDate: return createTemporalNode(id, 2, current);
|
|
2832
|
+
case Temporal.PlainDateTime: return createTemporalNode(id, 3, current);
|
|
2833
|
+
case Temporal.PlainMonthDay: return createTemporalNode(id, 4, current);
|
|
2834
|
+
case Temporal.PlainTime: return createTemporalNode(id, 5, current);
|
|
2835
|
+
case Temporal.PlainYearMonth: return createTemporalNode(id, 6, current);
|
|
2836
|
+
case Temporal.ZonedDateTime: return createTemporalNode(id, 7, current);
|
|
2837
|
+
}
|
|
2838
|
+
if (current instanceof Error) return parseError(ctx, depth, id, current);
|
|
2839
|
+
if (SYM_ITERATOR in current || SYM_ASYNC_ITERATOR in current) return parsePlainObject(ctx, depth, id, current, !!currentClass);
|
|
2840
|
+
throw new SerovalUnsupportedTypeError(current);
|
|
2841
|
+
}
|
|
2842
|
+
function parseObject(ctx, depth, id, current) {
|
|
2843
|
+
if (Array.isArray(current)) return parseArray(ctx, depth, id, current);
|
|
2844
|
+
if (isStream(current)) return parseStream(ctx, depth, id, current);
|
|
2845
|
+
if (isSequence(current)) return parseSequence(ctx, depth, id, current);
|
|
2846
|
+
let currentClass = current.constructor;
|
|
2847
|
+
if (currentClass !== void 0 && typeof currentClass !== "function") {
|
|
2848
|
+
const proto = Object.getPrototypeOf(current);
|
|
2849
|
+
currentClass = proto === null ? void 0 : proto.constructor;
|
|
2850
|
+
}
|
|
2851
|
+
if (currentClass === OpaqueReference) return parseSOS(ctx, depth, current.replacement);
|
|
2852
|
+
const parsed = parsePlugin(ctx, depth, id, current);
|
|
2853
|
+
if (parsed) return parsed;
|
|
2854
|
+
return parseObjectPhase2(ctx, depth, id, current, currentClass);
|
|
2855
|
+
}
|
|
2856
|
+
function parseFunction(ctx, depth, current) {
|
|
2857
|
+
const ref = getReferenceNode(ctx.base, current);
|
|
2858
|
+
if (ref.type !== 0) return ref.value;
|
|
2859
|
+
const plugin = parsePlugin(ctx, depth, ref.value, current);
|
|
2860
|
+
if (plugin) return plugin;
|
|
2861
|
+
throw new SerovalUnsupportedTypeError(current);
|
|
2862
|
+
}
|
|
2863
|
+
function parseSOS(ctx, depth, current) {
|
|
2864
|
+
if (depth >= ctx.base.depthLimit) throw new SerovalDepthLimitError(ctx.base.depthLimit);
|
|
2865
|
+
switch (typeof current) {
|
|
2866
|
+
case "boolean": return current ? TRUE_NODE : FALSE_NODE;
|
|
2867
|
+
case "undefined": return UNDEFINED_NODE;
|
|
2868
|
+
case "string": return createStringNode(current);
|
|
2869
|
+
case "number": return createNumberNode(current);
|
|
2870
|
+
case "bigint": return createBigIntNode(current);
|
|
2871
|
+
case "object":
|
|
2872
|
+
if (current) {
|
|
2873
|
+
const ref = getReferenceNode(ctx.base, current);
|
|
2874
|
+
return ref.type === 0 ? parseObject(ctx, depth + 1, ref.value, current) : ref.value;
|
|
2875
|
+
}
|
|
2876
|
+
return NULL_NODE;
|
|
2877
|
+
case "symbol": return parseWellKnownSymbol(ctx.base, current);
|
|
2878
|
+
case "function": return parseFunction(ctx, depth, current);
|
|
2879
|
+
default: throw new SerovalUnsupportedTypeError(current);
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
function onParse(ctx, node) {
|
|
2883
|
+
if (ctx.state.initial) ctx.state.buffer.push(node);
|
|
2884
|
+
else onParseInternal(ctx, node, false);
|
|
2885
|
+
}
|
|
2886
|
+
function onError(ctx, error) {
|
|
2887
|
+
if (ctx.state.onError) ctx.state.onError(error);
|
|
2888
|
+
else throw error instanceof SerovalParserError ? error : new SerovalParserError(error);
|
|
2889
|
+
}
|
|
2890
|
+
function onDone(ctx) {
|
|
2891
|
+
if (ctx.state.onDone) ctx.state.onDone();
|
|
2892
|
+
for (let i = 0, len = ctx.state.cleanups.length; i < len; i++) ctx.state.cleanups[i]();
|
|
2893
|
+
}
|
|
2894
|
+
function onParseInternal(ctx, node, initial) {
|
|
2895
|
+
try {
|
|
2896
|
+
ctx.state.onParse(node, initial);
|
|
2897
|
+
} catch (error) {
|
|
2898
|
+
onError(ctx, error);
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
function pushPendingState(ctx) {
|
|
2902
|
+
ctx.state.pending++;
|
|
2903
|
+
}
|
|
2904
|
+
function popPendingState(ctx) {
|
|
2905
|
+
if (--ctx.state.pending <= 0) onDone(ctx);
|
|
2906
|
+
}
|
|
2907
|
+
function parseWithError(ctx, depth, current) {
|
|
2908
|
+
try {
|
|
2909
|
+
return parseSOS(ctx, depth, current);
|
|
2910
|
+
} catch (err) {
|
|
2911
|
+
onError(ctx, err);
|
|
2912
|
+
return;
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
function startStreamParse(ctx, current) {
|
|
2916
|
+
const parsed = parseWithError(ctx, 0, current);
|
|
2917
|
+
if (parsed) {
|
|
2918
|
+
onParseInternal(ctx, parsed, true);
|
|
2919
|
+
ctx.state.initial = false;
|
|
2920
|
+
flushStreamParse(ctx, ctx.state);
|
|
2921
|
+
if (ctx.state.pending <= 0) destroyStreamParse(ctx);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
function flushStreamParse(ctx, state) {
|
|
2925
|
+
for (let i = 0, len = state.buffer.length; i < len; i++) onParseInternal(ctx, state.buffer[i], false);
|
|
2926
|
+
}
|
|
2927
|
+
function destroyStreamParse(ctx) {
|
|
2928
|
+
if (ctx.state.alive) {
|
|
2929
|
+
onDone(ctx);
|
|
2930
|
+
ctx.state.alive = false;
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
function toCrossJSONStream(source, options) {
|
|
2934
|
+
const ctx = createStreamParserContext({
|
|
2935
|
+
plugins: resolvePlugins(options.plugins),
|
|
2936
|
+
refs: options.refs,
|
|
2937
|
+
disabledFeatures: options.disabledFeatures,
|
|
2938
|
+
depthLimit: options.depthLimit,
|
|
2939
|
+
onParse: options.onParse,
|
|
2940
|
+
onError: options.onError,
|
|
2941
|
+
onDone: options.onDone
|
|
2942
|
+
});
|
|
2943
|
+
startStreamParse(ctx, source);
|
|
2944
|
+
return destroyStreamParse.bind(null, ctx);
|
|
2945
|
+
}
|
|
2946
|
+
function fromCrossJSON(source, options) {
|
|
2947
|
+
return deserializeTop(createCrossDeserializerContext({
|
|
2948
|
+
plugins: resolvePlugins(options.plugins),
|
|
2949
|
+
refs: options.refs,
|
|
2950
|
+
features: options.features,
|
|
2951
|
+
disabledFeatures: options.disabledFeatures,
|
|
2952
|
+
depthLimit: options.depthLimit
|
|
2953
|
+
}), source);
|
|
2954
|
+
}
|
|
2955
|
+
//#endregion
|
|
2956
|
+
export { fromCrossJSON as a, ai as c, re as d, createStream as i, dn as l, OpaqueReference as n, toCrossJSONStream as o, createPlugin as r, M as s, Feature as t, mr as u };
|