react-server-dom-webpack 18.3.0-next-fa4314841-20230502 → 19.0.0-beta-4508873393-20240430
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/cjs/react-server-dom-webpack-client.browser.development.js +1893 -1200
- package/cjs/react-server-dom-webpack-client.browser.production.js +931 -0
- package/cjs/react-server-dom-webpack-client.edge.development.js +1888 -241
- package/cjs/react-server-dom-webpack-client.edge.production.js +1093 -0
- package/cjs/react-server-dom-webpack-client.node.development.js +1876 -259
- package/cjs/react-server-dom-webpack-client.node.production.js +1070 -0
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1833 -212
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +1049 -0
- package/cjs/react-server-dom-webpack-node-register.js +59 -10
- package/cjs/react-server-dom-webpack-plugin.js +389 -11
- package/cjs/react-server-dom-webpack-server.browser.development.js +2187 -937
- package/cjs/react-server-dom-webpack-server.browser.production.js +1935 -0
- package/cjs/react-server-dom-webpack-server.edge.development.js +2183 -941
- package/cjs/react-server-dom-webpack-server.edge.production.js +1956 -0
- package/cjs/react-server-dom-webpack-server.node.development.js +2169 -929
- package/cjs/react-server-dom-webpack-server.node.production.js +2083 -0
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +2116 -881
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +2051 -0
- package/client.browser.js +1 -1
- package/client.edge.js +1 -1
- package/client.node.js +1 -1
- package/client.node.unbundled.js +1 -1
- package/esm/{react-server-dom-webpack-node-loader.production.min.js → react-server-dom-webpack-node-loader.production.js} +20 -13
- package/package.json +8 -15
- package/server.browser.js +1 -1
- package/server.edge.js +1 -1
- package/server.node.js +1 -1
- package/server.node.unbundled.js +1 -1
- package/cjs/react-server-dom-webpack-client.browser.production.min.js +0 -34
- package/cjs/react-server-dom-webpack-client.edge.production.min.js +0 -28
- package/cjs/react-server-dom-webpack-client.node.production.min.js +0 -28
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +0 -26
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +0 -62
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +0 -62
- package/cjs/react-server-dom-webpack-server.node.production.min.js +0 -67
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +0 -65
- package/umd/react-server-dom-webpack-client.browser.development.js +0 -1731
- package/umd/react-server-dom-webpack-client.browser.production.min.js +0 -29
- package/umd/react-server-dom-webpack-server.browser.development.js +0 -2904
- package/umd/react-server-dom-webpack-server.browser.production.min.js +0 -51
@@ -0,0 +1,1049 @@
|
|
1
|
+
/**
|
2
|
+
* @license React
|
3
|
+
* react-server-dom-webpack-client.node.unbundled.production.js
|
4
|
+
*
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
"use strict";
|
12
|
+
var util = require("util"),
|
13
|
+
ReactDOM = require("react-dom"),
|
14
|
+
decoderOptions = { stream: !0 };
|
15
|
+
function resolveClientReference(bundlerConfig, metadata) {
|
16
|
+
var moduleExports = bundlerConfig[metadata[0]];
|
17
|
+
if ((bundlerConfig = moduleExports[metadata[2]]))
|
18
|
+
moduleExports = bundlerConfig.name;
|
19
|
+
else {
|
20
|
+
bundlerConfig = moduleExports["*"];
|
21
|
+
if (!bundlerConfig)
|
22
|
+
throw Error(
|
23
|
+
'Could not find the module "' +
|
24
|
+
metadata[0] +
|
25
|
+
'" in the React SSR Manifest. This is probably a bug in the React Server Components bundler.'
|
26
|
+
);
|
27
|
+
moduleExports = metadata[2];
|
28
|
+
}
|
29
|
+
return {
|
30
|
+
specifier: bundlerConfig.specifier,
|
31
|
+
name: moduleExports,
|
32
|
+
async: 4 === metadata.length
|
33
|
+
};
|
34
|
+
}
|
35
|
+
var asyncModuleCache = new Map();
|
36
|
+
function preloadModule(metadata) {
|
37
|
+
var existingPromise = asyncModuleCache.get(metadata.specifier);
|
38
|
+
if (existingPromise)
|
39
|
+
return "fulfilled" === existingPromise.status ? null : existingPromise;
|
40
|
+
var modulePromise = import(metadata.specifier);
|
41
|
+
metadata.async &&
|
42
|
+
(modulePromise = modulePromise.then(function (value) {
|
43
|
+
return value.default;
|
44
|
+
}));
|
45
|
+
modulePromise.then(
|
46
|
+
function (value) {
|
47
|
+
var fulfilledThenable = modulePromise;
|
48
|
+
fulfilledThenable.status = "fulfilled";
|
49
|
+
fulfilledThenable.value = value;
|
50
|
+
},
|
51
|
+
function (reason) {
|
52
|
+
var rejectedThenable = modulePromise;
|
53
|
+
rejectedThenable.status = "rejected";
|
54
|
+
rejectedThenable.reason = reason;
|
55
|
+
}
|
56
|
+
);
|
57
|
+
asyncModuleCache.set(metadata.specifier, modulePromise);
|
58
|
+
return modulePromise;
|
59
|
+
}
|
60
|
+
function prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) {
|
61
|
+
if (null !== moduleLoading)
|
62
|
+
for (var i = 1; i < chunks.length; i += 2) {
|
63
|
+
var nonce = nonce$jscomp$0,
|
64
|
+
JSCompiler_temp_const = ReactDOMSharedInternals.d,
|
65
|
+
JSCompiler_temp_const$jscomp$0 = JSCompiler_temp_const.X,
|
66
|
+
JSCompiler_temp_const$jscomp$1 = moduleLoading.prefix + chunks[i];
|
67
|
+
var JSCompiler_inline_result = moduleLoading.crossOrigin;
|
68
|
+
JSCompiler_inline_result =
|
69
|
+
"string" === typeof JSCompiler_inline_result
|
70
|
+
? "use-credentials" === JSCompiler_inline_result
|
71
|
+
? JSCompiler_inline_result
|
72
|
+
: ""
|
73
|
+
: void 0;
|
74
|
+
JSCompiler_temp_const$jscomp$0.call(
|
75
|
+
JSCompiler_temp_const,
|
76
|
+
JSCompiler_temp_const$jscomp$1,
|
77
|
+
{ crossOrigin: JSCompiler_inline_result, nonce: nonce }
|
78
|
+
);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
var ReactDOMSharedInternals =
|
82
|
+
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
83
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
84
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
85
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
86
|
+
function getIteratorFn(maybeIterable) {
|
87
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
88
|
+
maybeIterable =
|
89
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
90
|
+
maybeIterable["@@iterator"];
|
91
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
92
|
+
}
|
93
|
+
var isArrayImpl = Array.isArray,
|
94
|
+
getPrototypeOf = Object.getPrototypeOf;
|
95
|
+
function writeTemporaryReference(set, object) {
|
96
|
+
var newId = set.length;
|
97
|
+
set.push(object);
|
98
|
+
return newId;
|
99
|
+
}
|
100
|
+
var ObjectPrototype = Object.prototype,
|
101
|
+
knownServerReferences = new WeakMap();
|
102
|
+
function serializeNumber(number) {
|
103
|
+
return Number.isFinite(number)
|
104
|
+
? 0 === number && -Infinity === 1 / number
|
105
|
+
? "$-0"
|
106
|
+
: number
|
107
|
+
: Infinity === number
|
108
|
+
? "$Infinity"
|
109
|
+
: -Infinity === number
|
110
|
+
? "$-Infinity"
|
111
|
+
: "$NaN";
|
112
|
+
}
|
113
|
+
function processReply(
|
114
|
+
root,
|
115
|
+
formFieldPrefix,
|
116
|
+
temporaryReferences,
|
117
|
+
resolve,
|
118
|
+
reject
|
119
|
+
) {
|
120
|
+
function resolveToJSON(key, value) {
|
121
|
+
if (null === value) return null;
|
122
|
+
if ("object" === typeof value) {
|
123
|
+
switch (value.$$typeof) {
|
124
|
+
case REACT_ELEMENT_TYPE:
|
125
|
+
if (void 0 === temporaryReferences)
|
126
|
+
throw Error(
|
127
|
+
"React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options."
|
128
|
+
);
|
129
|
+
return (
|
130
|
+
"$T" +
|
131
|
+
writeTemporaryReference(temporaryReferences, value).toString(16)
|
132
|
+
);
|
133
|
+
case REACT_LAZY_TYPE:
|
134
|
+
key = value._payload;
|
135
|
+
var init = value._init;
|
136
|
+
null === formData && (formData = new FormData());
|
137
|
+
pendingParts++;
|
138
|
+
try {
|
139
|
+
var resolvedModel = init(key),
|
140
|
+
lazyId = nextPartId++,
|
141
|
+
partJSON = JSON.stringify(resolvedModel, resolveToJSON);
|
142
|
+
formData.append(formFieldPrefix + lazyId, partJSON);
|
143
|
+
return "$" + lazyId.toString(16);
|
144
|
+
} catch (x) {
|
145
|
+
if (
|
146
|
+
"object" === typeof x &&
|
147
|
+
null !== x &&
|
148
|
+
"function" === typeof x.then
|
149
|
+
) {
|
150
|
+
pendingParts++;
|
151
|
+
var lazyId$21 = nextPartId++;
|
152
|
+
resolvedModel = function () {
|
153
|
+
try {
|
154
|
+
var partJSON$22 = JSON.stringify(value, resolveToJSON),
|
155
|
+
data$23 = formData;
|
156
|
+
data$23.append(formFieldPrefix + lazyId$21, partJSON$22);
|
157
|
+
pendingParts--;
|
158
|
+
0 === pendingParts && resolve(data$23);
|
159
|
+
} catch (reason) {
|
160
|
+
reject(reason);
|
161
|
+
}
|
162
|
+
};
|
163
|
+
x.then(resolvedModel, resolvedModel);
|
164
|
+
return "$" + lazyId$21.toString(16);
|
165
|
+
}
|
166
|
+
reject(x);
|
167
|
+
return null;
|
168
|
+
} finally {
|
169
|
+
pendingParts--;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
if ("function" === typeof value.then) {
|
173
|
+
null === formData && (formData = new FormData());
|
174
|
+
pendingParts++;
|
175
|
+
var promiseId = nextPartId++;
|
176
|
+
value.then(
|
177
|
+
function (partValue) {
|
178
|
+
try {
|
179
|
+
var partJSON$25 = JSON.stringify(partValue, resolveToJSON);
|
180
|
+
partValue = formData;
|
181
|
+
partValue.append(formFieldPrefix + promiseId, partJSON$25);
|
182
|
+
pendingParts--;
|
183
|
+
0 === pendingParts && resolve(partValue);
|
184
|
+
} catch (reason) {
|
185
|
+
reject(reason);
|
186
|
+
}
|
187
|
+
},
|
188
|
+
function (reason) {
|
189
|
+
reject(reason);
|
190
|
+
}
|
191
|
+
);
|
192
|
+
return "$@" + promiseId.toString(16);
|
193
|
+
}
|
194
|
+
if (isArrayImpl(value)) return value;
|
195
|
+
if (value instanceof FormData) {
|
196
|
+
null === formData && (formData = new FormData());
|
197
|
+
var data$27 = formData;
|
198
|
+
resolvedModel = nextPartId++;
|
199
|
+
var prefix = formFieldPrefix + resolvedModel + "_";
|
200
|
+
value.forEach(function (originalValue, originalKey) {
|
201
|
+
data$27.append(prefix + originalKey, originalValue);
|
202
|
+
});
|
203
|
+
return "$K" + resolvedModel.toString(16);
|
204
|
+
}
|
205
|
+
if (value instanceof Map)
|
206
|
+
return (
|
207
|
+
(resolvedModel = JSON.stringify(Array.from(value), resolveToJSON)),
|
208
|
+
null === formData && (formData = new FormData()),
|
209
|
+
(lazyId = nextPartId++),
|
210
|
+
formData.append(formFieldPrefix + lazyId, resolvedModel),
|
211
|
+
"$Q" + lazyId.toString(16)
|
212
|
+
);
|
213
|
+
if (value instanceof Set)
|
214
|
+
return (
|
215
|
+
(resolvedModel = JSON.stringify(Array.from(value), resolveToJSON)),
|
216
|
+
null === formData && (formData = new FormData()),
|
217
|
+
(lazyId = nextPartId++),
|
218
|
+
formData.append(formFieldPrefix + lazyId, resolvedModel),
|
219
|
+
"$W" + lazyId.toString(16)
|
220
|
+
);
|
221
|
+
if ((resolvedModel = getIteratorFn(value)))
|
222
|
+
return (
|
223
|
+
(resolvedModel = resolvedModel.call(value)),
|
224
|
+
resolvedModel === value
|
225
|
+
? ((resolvedModel = JSON.stringify(
|
226
|
+
Array.from(resolvedModel),
|
227
|
+
resolveToJSON
|
228
|
+
)),
|
229
|
+
null === formData && (formData = new FormData()),
|
230
|
+
(lazyId = nextPartId++),
|
231
|
+
formData.append(formFieldPrefix + lazyId, resolvedModel),
|
232
|
+
"$i" + lazyId.toString(16))
|
233
|
+
: Array.from(resolvedModel)
|
234
|
+
);
|
235
|
+
resolvedModel = getPrototypeOf(value);
|
236
|
+
if (
|
237
|
+
resolvedModel !== ObjectPrototype &&
|
238
|
+
(null === resolvedModel || null !== getPrototypeOf(resolvedModel))
|
239
|
+
) {
|
240
|
+
if (void 0 === temporaryReferences)
|
241
|
+
throw Error(
|
242
|
+
"Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported."
|
243
|
+
);
|
244
|
+
return (
|
245
|
+
"$T" +
|
246
|
+
writeTemporaryReference(temporaryReferences, value).toString(16)
|
247
|
+
);
|
248
|
+
}
|
249
|
+
return value;
|
250
|
+
}
|
251
|
+
if ("string" === typeof value) {
|
252
|
+
if ("Z" === value[value.length - 1] && this[key] instanceof Date)
|
253
|
+
return "$D" + value;
|
254
|
+
resolvedModel = "$" === value[0] ? "$" + value : value;
|
255
|
+
return resolvedModel;
|
256
|
+
}
|
257
|
+
if ("boolean" === typeof value) return value;
|
258
|
+
if ("number" === typeof value) return serializeNumber(value);
|
259
|
+
if ("undefined" === typeof value) return "$undefined";
|
260
|
+
if ("function" === typeof value) {
|
261
|
+
resolvedModel = knownServerReferences.get(value);
|
262
|
+
if (void 0 !== resolvedModel)
|
263
|
+
return (
|
264
|
+
(resolvedModel = JSON.stringify(resolvedModel, resolveToJSON)),
|
265
|
+
null === formData && (formData = new FormData()),
|
266
|
+
(lazyId = nextPartId++),
|
267
|
+
formData.set(formFieldPrefix + lazyId, resolvedModel),
|
268
|
+
"$F" + lazyId.toString(16)
|
269
|
+
);
|
270
|
+
if (void 0 === temporaryReferences)
|
271
|
+
throw Error(
|
272
|
+
"Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again."
|
273
|
+
);
|
274
|
+
return (
|
275
|
+
"$T" + writeTemporaryReference(temporaryReferences, value).toString(16)
|
276
|
+
);
|
277
|
+
}
|
278
|
+
if ("symbol" === typeof value) {
|
279
|
+
if (void 0 === temporaryReferences)
|
280
|
+
throw Error(
|
281
|
+
"Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options."
|
282
|
+
);
|
283
|
+
return (
|
284
|
+
"$T" + writeTemporaryReference(temporaryReferences, value).toString(16)
|
285
|
+
);
|
286
|
+
}
|
287
|
+
if ("bigint" === typeof value) return "$n" + value.toString(10);
|
288
|
+
throw Error(
|
289
|
+
"Type " +
|
290
|
+
typeof value +
|
291
|
+
" is not supported as an argument to a Server Function."
|
292
|
+
);
|
293
|
+
}
|
294
|
+
var nextPartId = 1,
|
295
|
+
pendingParts = 0,
|
296
|
+
formData = null;
|
297
|
+
root = JSON.stringify(root, resolveToJSON);
|
298
|
+
null === formData
|
299
|
+
? resolve(root)
|
300
|
+
: (formData.set(formFieldPrefix + "0", root),
|
301
|
+
0 === pendingParts && resolve(formData));
|
302
|
+
}
|
303
|
+
var boundCache = new WeakMap();
|
304
|
+
function encodeFormData(reference) {
|
305
|
+
var resolve,
|
306
|
+
reject,
|
307
|
+
thenable = new Promise(function (res, rej) {
|
308
|
+
resolve = res;
|
309
|
+
reject = rej;
|
310
|
+
});
|
311
|
+
processReply(
|
312
|
+
reference,
|
313
|
+
"",
|
314
|
+
void 0,
|
315
|
+
function (body) {
|
316
|
+
if ("string" === typeof body) {
|
317
|
+
var data = new FormData();
|
318
|
+
data.append("0", body);
|
319
|
+
body = data;
|
320
|
+
}
|
321
|
+
thenable.status = "fulfilled";
|
322
|
+
thenable.value = body;
|
323
|
+
resolve(body);
|
324
|
+
},
|
325
|
+
function (e) {
|
326
|
+
thenable.status = "rejected";
|
327
|
+
thenable.reason = e;
|
328
|
+
reject(e);
|
329
|
+
}
|
330
|
+
);
|
331
|
+
return thenable;
|
332
|
+
}
|
333
|
+
function defaultEncodeFormAction(identifierPrefix) {
|
334
|
+
var reference = knownServerReferences.get(this);
|
335
|
+
if (!reference)
|
336
|
+
throw Error(
|
337
|
+
"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."
|
338
|
+
);
|
339
|
+
var data = null;
|
340
|
+
if (null !== reference.bound) {
|
341
|
+
data = boundCache.get(reference);
|
342
|
+
data ||
|
343
|
+
((data = encodeFormData(reference)), boundCache.set(reference, data));
|
344
|
+
if ("rejected" === data.status) throw data.reason;
|
345
|
+
if ("fulfilled" !== data.status) throw data;
|
346
|
+
reference = data.value;
|
347
|
+
var prefixedData = new FormData();
|
348
|
+
reference.forEach(function (value, key) {
|
349
|
+
prefixedData.append("$ACTION_" + identifierPrefix + ":" + key, value);
|
350
|
+
});
|
351
|
+
data = prefixedData;
|
352
|
+
reference = "$ACTION_REF_" + identifierPrefix;
|
353
|
+
} else reference = "$ACTION_ID_" + reference.id;
|
354
|
+
return {
|
355
|
+
name: reference,
|
356
|
+
method: "POST",
|
357
|
+
encType: "multipart/form-data",
|
358
|
+
data: data
|
359
|
+
};
|
360
|
+
}
|
361
|
+
function isSignatureEqual(referenceId, numberOfBoundArgs) {
|
362
|
+
var reference = knownServerReferences.get(this);
|
363
|
+
if (!reference)
|
364
|
+
throw Error(
|
365
|
+
"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."
|
366
|
+
);
|
367
|
+
if (reference.id !== referenceId) return !1;
|
368
|
+
var boundPromise = reference.bound;
|
369
|
+
if (null === boundPromise) return 0 === numberOfBoundArgs;
|
370
|
+
switch (boundPromise.status) {
|
371
|
+
case "fulfilled":
|
372
|
+
return boundPromise.value.length === numberOfBoundArgs;
|
373
|
+
case "pending":
|
374
|
+
throw boundPromise;
|
375
|
+
case "rejected":
|
376
|
+
throw boundPromise.reason;
|
377
|
+
default:
|
378
|
+
throw (
|
379
|
+
("string" !== typeof boundPromise.status &&
|
380
|
+
((boundPromise.status = "pending"),
|
381
|
+
boundPromise.then(
|
382
|
+
function (boundArgs) {
|
383
|
+
boundPromise.status = "fulfilled";
|
384
|
+
boundPromise.value = boundArgs;
|
385
|
+
},
|
386
|
+
function (error) {
|
387
|
+
boundPromise.status = "rejected";
|
388
|
+
boundPromise.reason = error;
|
389
|
+
}
|
390
|
+
)),
|
391
|
+
boundPromise)
|
392
|
+
);
|
393
|
+
}
|
394
|
+
}
|
395
|
+
function registerServerReference(proxy, reference$jscomp$0, encodeFormAction) {
|
396
|
+
Object.defineProperties(proxy, {
|
397
|
+
$$FORM_ACTION: {
|
398
|
+
value:
|
399
|
+
void 0 === encodeFormAction
|
400
|
+
? defaultEncodeFormAction
|
401
|
+
: function () {
|
402
|
+
var reference = knownServerReferences.get(this);
|
403
|
+
if (!reference)
|
404
|
+
throw Error(
|
405
|
+
"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React."
|
406
|
+
);
|
407
|
+
var boundPromise = reference.bound;
|
408
|
+
null === boundPromise && (boundPromise = Promise.resolve([]));
|
409
|
+
return encodeFormAction(reference.id, boundPromise);
|
410
|
+
}
|
411
|
+
},
|
412
|
+
$$IS_SIGNATURE_EQUAL: { value: isSignatureEqual },
|
413
|
+
bind: { value: bind }
|
414
|
+
});
|
415
|
+
knownServerReferences.set(proxy, reference$jscomp$0);
|
416
|
+
}
|
417
|
+
var FunctionBind = Function.prototype.bind,
|
418
|
+
ArraySlice = Array.prototype.slice;
|
419
|
+
function bind() {
|
420
|
+
var newFn = FunctionBind.apply(this, arguments),
|
421
|
+
reference = knownServerReferences.get(this);
|
422
|
+
if (reference) {
|
423
|
+
var args = ArraySlice.call(arguments, 1),
|
424
|
+
boundPromise = null;
|
425
|
+
boundPromise =
|
426
|
+
null !== reference.bound
|
427
|
+
? Promise.resolve(reference.bound).then(function (boundArgs) {
|
428
|
+
return boundArgs.concat(args);
|
429
|
+
})
|
430
|
+
: Promise.resolve(args);
|
431
|
+
Object.defineProperties(newFn, {
|
432
|
+
$$FORM_ACTION: { value: this.$$FORM_ACTION },
|
433
|
+
$$IS_SIGNATURE_EQUAL: { value: isSignatureEqual },
|
434
|
+
bind: { value: bind }
|
435
|
+
});
|
436
|
+
knownServerReferences.set(newFn, { id: reference.id, bound: boundPromise });
|
437
|
+
}
|
438
|
+
return newFn;
|
439
|
+
}
|
440
|
+
function createServerReference$1(id, callServer, encodeFormAction) {
|
441
|
+
function proxy() {
|
442
|
+
var args = Array.prototype.slice.call(arguments);
|
443
|
+
return callServer(id, args);
|
444
|
+
}
|
445
|
+
registerServerReference(proxy, { id: id, bound: null }, encodeFormAction);
|
446
|
+
return proxy;
|
447
|
+
}
|
448
|
+
function Chunk(status, value, reason, response) {
|
449
|
+
this.status = status;
|
450
|
+
this.value = value;
|
451
|
+
this.reason = reason;
|
452
|
+
this._response = response;
|
453
|
+
}
|
454
|
+
Chunk.prototype = Object.create(Promise.prototype);
|
455
|
+
Chunk.prototype.then = function (resolve, reject) {
|
456
|
+
switch (this.status) {
|
457
|
+
case "resolved_model":
|
458
|
+
initializeModelChunk(this);
|
459
|
+
break;
|
460
|
+
case "resolved_module":
|
461
|
+
initializeModuleChunk(this);
|
462
|
+
}
|
463
|
+
switch (this.status) {
|
464
|
+
case "fulfilled":
|
465
|
+
resolve(this.value);
|
466
|
+
break;
|
467
|
+
case "pending":
|
468
|
+
case "blocked":
|
469
|
+
case "cyclic":
|
470
|
+
resolve &&
|
471
|
+
(null === this.value && (this.value = []), this.value.push(resolve));
|
472
|
+
reject &&
|
473
|
+
(null === this.reason && (this.reason = []), this.reason.push(reject));
|
474
|
+
break;
|
475
|
+
default:
|
476
|
+
reject && reject(this.reason);
|
477
|
+
}
|
478
|
+
};
|
479
|
+
function readChunk(chunk) {
|
480
|
+
switch (chunk.status) {
|
481
|
+
case "resolved_model":
|
482
|
+
initializeModelChunk(chunk);
|
483
|
+
break;
|
484
|
+
case "resolved_module":
|
485
|
+
initializeModuleChunk(chunk);
|
486
|
+
}
|
487
|
+
switch (chunk.status) {
|
488
|
+
case "fulfilled":
|
489
|
+
return chunk.value;
|
490
|
+
case "pending":
|
491
|
+
case "blocked":
|
492
|
+
case "cyclic":
|
493
|
+
throw chunk;
|
494
|
+
default:
|
495
|
+
throw chunk.reason;
|
496
|
+
}
|
497
|
+
}
|
498
|
+
function wakeChunk(listeners, value) {
|
499
|
+
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
|
500
|
+
}
|
501
|
+
function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
|
502
|
+
switch (chunk.status) {
|
503
|
+
case "fulfilled":
|
504
|
+
wakeChunk(resolveListeners, chunk.value);
|
505
|
+
break;
|
506
|
+
case "pending":
|
507
|
+
case "blocked":
|
508
|
+
case "cyclic":
|
509
|
+
chunk.value = resolveListeners;
|
510
|
+
chunk.reason = rejectListeners;
|
511
|
+
break;
|
512
|
+
case "rejected":
|
513
|
+
rejectListeners && wakeChunk(rejectListeners, chunk.reason);
|
514
|
+
}
|
515
|
+
}
|
516
|
+
function triggerErrorOnChunk(chunk, error) {
|
517
|
+
if ("pending" === chunk.status || "blocked" === chunk.status) {
|
518
|
+
var listeners = chunk.reason;
|
519
|
+
chunk.status = "rejected";
|
520
|
+
chunk.reason = error;
|
521
|
+
null !== listeners && wakeChunk(listeners, error);
|
522
|
+
}
|
523
|
+
}
|
524
|
+
function resolveModuleChunk(chunk, value) {
|
525
|
+
if ("pending" === chunk.status || "blocked" === chunk.status) {
|
526
|
+
var resolveListeners = chunk.value,
|
527
|
+
rejectListeners = chunk.reason;
|
528
|
+
chunk.status = "resolved_module";
|
529
|
+
chunk.value = value;
|
530
|
+
null !== resolveListeners &&
|
531
|
+
(initializeModuleChunk(chunk),
|
532
|
+
wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
|
533
|
+
}
|
534
|
+
}
|
535
|
+
var initializingChunk = null,
|
536
|
+
initializingChunkBlockedModel = null;
|
537
|
+
function initializeModelChunk(chunk) {
|
538
|
+
var prevChunk = initializingChunk,
|
539
|
+
prevBlocked = initializingChunkBlockedModel;
|
540
|
+
initializingChunk = chunk;
|
541
|
+
initializingChunkBlockedModel = null;
|
542
|
+
var resolvedModel = chunk.value;
|
543
|
+
chunk.status = "cyclic";
|
544
|
+
chunk.value = null;
|
545
|
+
chunk.reason = null;
|
546
|
+
try {
|
547
|
+
var value = JSON.parse(resolvedModel, chunk._response._fromJSON);
|
548
|
+
if (
|
549
|
+
null !== initializingChunkBlockedModel &&
|
550
|
+
0 < initializingChunkBlockedModel.deps
|
551
|
+
)
|
552
|
+
(initializingChunkBlockedModel.value = value),
|
553
|
+
(chunk.status = "blocked"),
|
554
|
+
(chunk.value = null),
|
555
|
+
(chunk.reason = null);
|
556
|
+
else {
|
557
|
+
var resolveListeners = chunk.value;
|
558
|
+
chunk.status = "fulfilled";
|
559
|
+
chunk.value = value;
|
560
|
+
null !== resolveListeners && wakeChunk(resolveListeners, value);
|
561
|
+
}
|
562
|
+
} catch (error) {
|
563
|
+
(chunk.status = "rejected"), (chunk.reason = error);
|
564
|
+
} finally {
|
565
|
+
(initializingChunk = prevChunk),
|
566
|
+
(initializingChunkBlockedModel = prevBlocked);
|
567
|
+
}
|
568
|
+
}
|
569
|
+
function initializeModuleChunk(chunk) {
|
570
|
+
try {
|
571
|
+
var metadata = chunk.value,
|
572
|
+
promise = asyncModuleCache.get(metadata.specifier);
|
573
|
+
if ("fulfilled" === promise.status) var moduleExports = promise.value;
|
574
|
+
else throw promise.reason;
|
575
|
+
var JSCompiler_inline_result =
|
576
|
+
"*" === metadata.name
|
577
|
+
? moduleExports
|
578
|
+
: "" === metadata.name
|
579
|
+
? moduleExports.default
|
580
|
+
: moduleExports[metadata.name];
|
581
|
+
chunk.status = "fulfilled";
|
582
|
+
chunk.value = JSCompiler_inline_result;
|
583
|
+
} catch (error) {
|
584
|
+
(chunk.status = "rejected"), (chunk.reason = error);
|
585
|
+
}
|
586
|
+
}
|
587
|
+
function reportGlobalError(response, error) {
|
588
|
+
response._chunks.forEach(function (chunk) {
|
589
|
+
"pending" === chunk.status && triggerErrorOnChunk(chunk, error);
|
590
|
+
});
|
591
|
+
}
|
592
|
+
function getChunk(response, id) {
|
593
|
+
var chunks = response._chunks,
|
594
|
+
chunk = chunks.get(id);
|
595
|
+
chunk ||
|
596
|
+
((chunk = new Chunk("pending", null, null, response)),
|
597
|
+
chunks.set(id, chunk));
|
598
|
+
return chunk;
|
599
|
+
}
|
600
|
+
function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
|
601
|
+
if (initializingChunkBlockedModel) {
|
602
|
+
var blocked = initializingChunkBlockedModel;
|
603
|
+
cyclic || blocked.deps++;
|
604
|
+
} else
|
605
|
+
blocked = initializingChunkBlockedModel = {
|
606
|
+
deps: cyclic ? 0 : 1,
|
607
|
+
value: null
|
608
|
+
};
|
609
|
+
return function (value) {
|
610
|
+
parentObject[key] = map(response, value);
|
611
|
+
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
|
612
|
+
blocked.deps--;
|
613
|
+
0 === blocked.deps &&
|
614
|
+
"blocked" === chunk.status &&
|
615
|
+
((value = chunk.value),
|
616
|
+
(chunk.status = "fulfilled"),
|
617
|
+
(chunk.value = blocked.value),
|
618
|
+
null !== value && wakeChunk(value, blocked.value));
|
619
|
+
};
|
620
|
+
}
|
621
|
+
function createModelReject(chunk) {
|
622
|
+
return function (error) {
|
623
|
+
return triggerErrorOnChunk(chunk, error);
|
624
|
+
};
|
625
|
+
}
|
626
|
+
function createServerReferenceProxy(response, metaData) {
|
627
|
+
function proxy() {
|
628
|
+
var args = Array.prototype.slice.call(arguments),
|
629
|
+
p = metaData.bound;
|
630
|
+
return p
|
631
|
+
? "fulfilled" === p.status
|
632
|
+
? callServer(metaData.id, p.value.concat(args))
|
633
|
+
: Promise.resolve(p).then(function (bound) {
|
634
|
+
return callServer(metaData.id, bound.concat(args));
|
635
|
+
})
|
636
|
+
: callServer(metaData.id, args);
|
637
|
+
}
|
638
|
+
var callServer = response._callServer;
|
639
|
+
registerServerReference(proxy, metaData, response._encodeFormAction);
|
640
|
+
return proxy;
|
641
|
+
}
|
642
|
+
function getOutlinedModel(response, id, parentObject, key, map) {
|
643
|
+
id = getChunk(response, id);
|
644
|
+
switch (id.status) {
|
645
|
+
case "resolved_model":
|
646
|
+
initializeModelChunk(id);
|
647
|
+
break;
|
648
|
+
case "resolved_module":
|
649
|
+
initializeModuleChunk(id);
|
650
|
+
}
|
651
|
+
switch (id.status) {
|
652
|
+
case "fulfilled":
|
653
|
+
return map(response, id.value);
|
654
|
+
case "pending":
|
655
|
+
case "blocked":
|
656
|
+
case "cyclic":
|
657
|
+
var parentChunk = initializingChunk;
|
658
|
+
id.then(
|
659
|
+
createModelResolver(
|
660
|
+
parentChunk,
|
661
|
+
parentObject,
|
662
|
+
key,
|
663
|
+
"cyclic" === id.status,
|
664
|
+
response,
|
665
|
+
map
|
666
|
+
),
|
667
|
+
createModelReject(parentChunk)
|
668
|
+
);
|
669
|
+
return null;
|
670
|
+
default:
|
671
|
+
throw id.reason;
|
672
|
+
}
|
673
|
+
}
|
674
|
+
function createMap(response, model) {
|
675
|
+
return new Map(model);
|
676
|
+
}
|
677
|
+
function createSet(response, model) {
|
678
|
+
return new Set(model);
|
679
|
+
}
|
680
|
+
function createFormData(response, model) {
|
681
|
+
response = new FormData();
|
682
|
+
for (var i = 0; i < model.length; i++)
|
683
|
+
response.append(model[i][0], model[i][1]);
|
684
|
+
return response;
|
685
|
+
}
|
686
|
+
function extractIterator(response, model) {
|
687
|
+
return model[Symbol.iterator]();
|
688
|
+
}
|
689
|
+
function createModel(response, model) {
|
690
|
+
return model;
|
691
|
+
}
|
692
|
+
function parseModelString(response, parentObject, key, value) {
|
693
|
+
if ("$" === value[0]) {
|
694
|
+
if ("$" === value) return REACT_ELEMENT_TYPE;
|
695
|
+
switch (value[1]) {
|
696
|
+
case "$":
|
697
|
+
return value.slice(1);
|
698
|
+
case "L":
|
699
|
+
return (
|
700
|
+
(parentObject = parseInt(value.slice(2), 16)),
|
701
|
+
(response = getChunk(response, parentObject)),
|
702
|
+
{ $$typeof: REACT_LAZY_TYPE, _payload: response, _init: readChunk }
|
703
|
+
);
|
704
|
+
case "@":
|
705
|
+
if (2 === value.length) return new Promise(function () {});
|
706
|
+
parentObject = parseInt(value.slice(2), 16);
|
707
|
+
return getChunk(response, parentObject);
|
708
|
+
case "S":
|
709
|
+
return Symbol.for(value.slice(2));
|
710
|
+
case "F":
|
711
|
+
return (
|
712
|
+
(value = parseInt(value.slice(2), 16)),
|
713
|
+
getOutlinedModel(
|
714
|
+
response,
|
715
|
+
value,
|
716
|
+
parentObject,
|
717
|
+
key,
|
718
|
+
createServerReferenceProxy
|
719
|
+
)
|
720
|
+
);
|
721
|
+
case "T":
|
722
|
+
parentObject = parseInt(value.slice(2), 16);
|
723
|
+
response = response._tempRefs;
|
724
|
+
if (null == response)
|
725
|
+
throw Error(
|
726
|
+
"Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply."
|
727
|
+
);
|
728
|
+
if (0 > parentObject || parentObject >= response.length)
|
729
|
+
throw Error(
|
730
|
+
"The RSC response contained a reference that doesn't exist in the temporary reference set. Always pass the matching set that was used to create the reply when parsing its response."
|
731
|
+
);
|
732
|
+
return response[parentObject];
|
733
|
+
case "Q":
|
734
|
+
return (
|
735
|
+
(value = parseInt(value.slice(2), 16)),
|
736
|
+
getOutlinedModel(response, value, parentObject, key, createMap)
|
737
|
+
);
|
738
|
+
case "W":
|
739
|
+
return (
|
740
|
+
(value = parseInt(value.slice(2), 16)),
|
741
|
+
getOutlinedModel(response, value, parentObject, key, createSet)
|
742
|
+
);
|
743
|
+
case "B":
|
744
|
+
return;
|
745
|
+
case "K":
|
746
|
+
return (
|
747
|
+
(value = parseInt(value.slice(2), 16)),
|
748
|
+
getOutlinedModel(response, value, parentObject, key, createFormData)
|
749
|
+
);
|
750
|
+
case "i":
|
751
|
+
return (
|
752
|
+
(value = parseInt(value.slice(2), 16)),
|
753
|
+
getOutlinedModel(response, value, parentObject, key, extractIterator)
|
754
|
+
);
|
755
|
+
case "I":
|
756
|
+
return Infinity;
|
757
|
+
case "-":
|
758
|
+
return "$-0" === value ? -0 : -Infinity;
|
759
|
+
case "N":
|
760
|
+
return NaN;
|
761
|
+
case "u":
|
762
|
+
return;
|
763
|
+
case "D":
|
764
|
+
return new Date(Date.parse(value.slice(2)));
|
765
|
+
case "n":
|
766
|
+
return BigInt(value.slice(2));
|
767
|
+
default:
|
768
|
+
return (
|
769
|
+
(value = parseInt(value.slice(1), 16)),
|
770
|
+
getOutlinedModel(response, value, parentObject, key, createModel)
|
771
|
+
);
|
772
|
+
}
|
773
|
+
}
|
774
|
+
return value;
|
775
|
+
}
|
776
|
+
function missingCall() {
|
777
|
+
throw Error(
|
778
|
+
'Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.'
|
779
|
+
);
|
780
|
+
}
|
781
|
+
function createResponse(
|
782
|
+
bundlerConfig,
|
783
|
+
moduleLoading,
|
784
|
+
callServer,
|
785
|
+
encodeFormAction,
|
786
|
+
nonce,
|
787
|
+
temporaryReferences
|
788
|
+
) {
|
789
|
+
var chunks = new Map();
|
790
|
+
bundlerConfig = {
|
791
|
+
_bundlerConfig: bundlerConfig,
|
792
|
+
_moduleLoading: moduleLoading,
|
793
|
+
_callServer: void 0 !== callServer ? callServer : missingCall,
|
794
|
+
_encodeFormAction: encodeFormAction,
|
795
|
+
_nonce: nonce,
|
796
|
+
_chunks: chunks,
|
797
|
+
_stringDecoder: new util.TextDecoder(),
|
798
|
+
_fromJSON: null,
|
799
|
+
_rowState: 0,
|
800
|
+
_rowID: 0,
|
801
|
+
_rowTag: 0,
|
802
|
+
_rowLength: 0,
|
803
|
+
_buffer: [],
|
804
|
+
_tempRefs: temporaryReferences
|
805
|
+
};
|
806
|
+
bundlerConfig._fromJSON = createFromJSONCallback(bundlerConfig);
|
807
|
+
return bundlerConfig;
|
808
|
+
}
|
809
|
+
function resolveModule(response, id, model) {
|
810
|
+
var chunks = response._chunks,
|
811
|
+
chunk = chunks.get(id);
|
812
|
+
model = JSON.parse(model, response._fromJSON);
|
813
|
+
var clientReference = resolveClientReference(response._bundlerConfig, model);
|
814
|
+
prepareDestinationWithChunks(
|
815
|
+
response._moduleLoading,
|
816
|
+
model[1],
|
817
|
+
response._nonce
|
818
|
+
);
|
819
|
+
if ((model = preloadModule(clientReference))) {
|
820
|
+
if (chunk) {
|
821
|
+
var blockedChunk = chunk;
|
822
|
+
blockedChunk.status = "blocked";
|
823
|
+
} else
|
824
|
+
(blockedChunk = new Chunk("blocked", null, null, response)),
|
825
|
+
chunks.set(id, blockedChunk);
|
826
|
+
model.then(
|
827
|
+
function () {
|
828
|
+
return resolveModuleChunk(blockedChunk, clientReference);
|
829
|
+
},
|
830
|
+
function (error) {
|
831
|
+
return triggerErrorOnChunk(blockedChunk, error);
|
832
|
+
}
|
833
|
+
);
|
834
|
+
} else
|
835
|
+
chunk
|
836
|
+
? resolveModuleChunk(chunk, clientReference)
|
837
|
+
: chunks.set(
|
838
|
+
id,
|
839
|
+
new Chunk("resolved_module", clientReference, null, response)
|
840
|
+
);
|
841
|
+
}
|
842
|
+
function createFromJSONCallback(response) {
|
843
|
+
return function (key, value) {
|
844
|
+
return "string" === typeof value
|
845
|
+
? parseModelString(response, this, key, value)
|
846
|
+
: "object" === typeof value && null !== value
|
847
|
+
? ((key =
|
848
|
+
value[0] === REACT_ELEMENT_TYPE
|
849
|
+
? {
|
850
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
851
|
+
type: value[1],
|
852
|
+
key: value[2],
|
853
|
+
ref: null,
|
854
|
+
props: value[3]
|
855
|
+
}
|
856
|
+
: value),
|
857
|
+
key)
|
858
|
+
: value;
|
859
|
+
};
|
860
|
+
}
|
861
|
+
function noServerCall() {
|
862
|
+
throw Error(
|
863
|
+
"Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead."
|
864
|
+
);
|
865
|
+
}
|
866
|
+
exports.createFromNodeStream = function (stream, ssrManifest, options) {
|
867
|
+
var response = createResponse(
|
868
|
+
ssrManifest.moduleMap,
|
869
|
+
ssrManifest.moduleLoading,
|
870
|
+
noServerCall,
|
871
|
+
options ? options.encodeFormAction : void 0,
|
872
|
+
options && "string" === typeof options.nonce ? options.nonce : void 0,
|
873
|
+
void 0
|
874
|
+
);
|
875
|
+
stream.on("data", function (chunk) {
|
876
|
+
for (
|
877
|
+
var i = 0,
|
878
|
+
rowState = response._rowState,
|
879
|
+
rowID = response._rowID,
|
880
|
+
rowTag = response._rowTag,
|
881
|
+
rowLength = response._rowLength,
|
882
|
+
buffer = response._buffer,
|
883
|
+
chunkLength = chunk.length;
|
884
|
+
i < chunkLength;
|
885
|
+
|
886
|
+
) {
|
887
|
+
var lastIdx = -1;
|
888
|
+
switch (rowState) {
|
889
|
+
case 0:
|
890
|
+
lastIdx = chunk[i++];
|
891
|
+
58 === lastIdx
|
892
|
+
? (rowState = 1)
|
893
|
+
: (rowID =
|
894
|
+
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
895
|
+
continue;
|
896
|
+
case 1:
|
897
|
+
rowState = chunk[i];
|
898
|
+
84 === rowState
|
899
|
+
? ((rowTag = rowState), (rowState = 2), i++)
|
900
|
+
: (64 < rowState && 91 > rowState) ||
|
901
|
+
114 === rowState ||
|
902
|
+
120 === rowState
|
903
|
+
? ((rowTag = rowState), (rowState = 3), i++)
|
904
|
+
: ((rowTag = 0), (rowState = 3));
|
905
|
+
continue;
|
906
|
+
case 2:
|
907
|
+
lastIdx = chunk[i++];
|
908
|
+
44 === lastIdx
|
909
|
+
? (rowState = 4)
|
910
|
+
: (rowLength =
|
911
|
+
(rowLength << 4) |
|
912
|
+
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
913
|
+
continue;
|
914
|
+
case 3:
|
915
|
+
lastIdx = chunk.indexOf(10, i);
|
916
|
+
break;
|
917
|
+
case 4:
|
918
|
+
(lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
|
919
|
+
}
|
920
|
+
var offset = chunk.byteOffset + i;
|
921
|
+
if (-1 < lastIdx) {
|
922
|
+
rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i);
|
923
|
+
i = rowTag;
|
924
|
+
offset = response._stringDecoder;
|
925
|
+
rowTag = "";
|
926
|
+
for (var i$jscomp$0 = 0; i$jscomp$0 < buffer.length; i$jscomp$0++)
|
927
|
+
rowTag += offset.decode(buffer[i$jscomp$0], decoderOptions);
|
928
|
+
rowTag += offset.decode(rowLength);
|
929
|
+
switch (i) {
|
930
|
+
case 73:
|
931
|
+
resolveModule(response, rowID, rowTag);
|
932
|
+
break;
|
933
|
+
case 72:
|
934
|
+
rowID = rowTag[0];
|
935
|
+
rowTag = rowTag.slice(1);
|
936
|
+
rowTag = JSON.parse(rowTag, response._fromJSON);
|
937
|
+
rowLength = ReactDOMSharedInternals.d;
|
938
|
+
switch (rowID) {
|
939
|
+
case "D":
|
940
|
+
rowLength.D(rowTag);
|
941
|
+
break;
|
942
|
+
case "C":
|
943
|
+
"string" === typeof rowTag
|
944
|
+
? rowLength.C(rowTag)
|
945
|
+
: rowLength.C(rowTag[0], rowTag[1]);
|
946
|
+
break;
|
947
|
+
case "L":
|
948
|
+
rowID = rowTag[0];
|
949
|
+
i = rowTag[1];
|
950
|
+
3 === rowTag.length
|
951
|
+
? rowLength.L(rowID, i, rowTag[2])
|
952
|
+
: rowLength.L(rowID, i);
|
953
|
+
break;
|
954
|
+
case "m":
|
955
|
+
"string" === typeof rowTag
|
956
|
+
? rowLength.m(rowTag)
|
957
|
+
: rowLength.m(rowTag[0], rowTag[1]);
|
958
|
+
break;
|
959
|
+
case "X":
|
960
|
+
"string" === typeof rowTag
|
961
|
+
? rowLength.X(rowTag)
|
962
|
+
: rowLength.X(rowTag[0], rowTag[1]);
|
963
|
+
break;
|
964
|
+
case "S":
|
965
|
+
"string" === typeof rowTag
|
966
|
+
? rowLength.S(rowTag)
|
967
|
+
: rowLength.S(
|
968
|
+
rowTag[0],
|
969
|
+
0 === rowTag[1] ? void 0 : rowTag[1],
|
970
|
+
3 === rowTag.length ? rowTag[2] : void 0
|
971
|
+
);
|
972
|
+
break;
|
973
|
+
case "M":
|
974
|
+
"string" === typeof rowTag
|
975
|
+
? rowLength.M(rowTag)
|
976
|
+
: rowLength.M(rowTag[0], rowTag[1]);
|
977
|
+
}
|
978
|
+
break;
|
979
|
+
case 69:
|
980
|
+
rowTag = JSON.parse(rowTag);
|
981
|
+
rowLength = rowTag.digest;
|
982
|
+
rowTag = Error(
|
983
|
+
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error."
|
984
|
+
);
|
985
|
+
rowTag.stack = "Error: " + rowTag.message;
|
986
|
+
rowTag.digest = rowLength;
|
987
|
+
rowLength = response._chunks;
|
988
|
+
(i = rowLength.get(rowID))
|
989
|
+
? triggerErrorOnChunk(i, rowTag)
|
990
|
+
: rowLength.set(
|
991
|
+
rowID,
|
992
|
+
new Chunk("rejected", null, rowTag, response)
|
993
|
+
);
|
994
|
+
break;
|
995
|
+
case 84:
|
996
|
+
response._chunks.set(
|
997
|
+
rowID,
|
998
|
+
new Chunk("fulfilled", rowTag, null, response)
|
999
|
+
);
|
1000
|
+
break;
|
1001
|
+
case 68:
|
1002
|
+
case 87:
|
1003
|
+
throw Error(
|
1004
|
+
"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client."
|
1005
|
+
);
|
1006
|
+
default:
|
1007
|
+
(rowLength = response._chunks),
|
1008
|
+
(i = rowLength.get(rowID))
|
1009
|
+
? ((rowID = i),
|
1010
|
+
"pending" === rowID.status &&
|
1011
|
+
((rowLength = rowID.value),
|
1012
|
+
(i = rowID.reason),
|
1013
|
+
(rowID.status = "resolved_model"),
|
1014
|
+
(rowID.value = rowTag),
|
1015
|
+
null !== rowLength &&
|
1016
|
+
(initializeModelChunk(rowID),
|
1017
|
+
wakeChunkIfInitialized(rowID, rowLength, i))))
|
1018
|
+
: rowLength.set(
|
1019
|
+
rowID,
|
1020
|
+
new Chunk("resolved_model", rowTag, null, response)
|
1021
|
+
);
|
1022
|
+
}
|
1023
|
+
i = lastIdx;
|
1024
|
+
3 === rowState && i++;
|
1025
|
+
rowLength = rowID = rowTag = rowState = 0;
|
1026
|
+
buffer.length = 0;
|
1027
|
+
} else {
|
1028
|
+
chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
|
1029
|
+
buffer.push(chunk);
|
1030
|
+
rowLength -= chunk.byteLength;
|
1031
|
+
break;
|
1032
|
+
}
|
1033
|
+
}
|
1034
|
+
response._rowState = rowState;
|
1035
|
+
response._rowID = rowID;
|
1036
|
+
response._rowTag = rowTag;
|
1037
|
+
response._rowLength = rowLength;
|
1038
|
+
});
|
1039
|
+
stream.on("error", function (error) {
|
1040
|
+
reportGlobalError(response, error);
|
1041
|
+
});
|
1042
|
+
stream.on("end", function () {
|
1043
|
+
reportGlobalError(response, Error("Connection closed."));
|
1044
|
+
});
|
1045
|
+
return getChunk(response, 0);
|
1046
|
+
};
|
1047
|
+
exports.createServerReference = function (id) {
|
1048
|
+
return createServerReference$1(id, noServerCall);
|
1049
|
+
};
|