@modern-js/utils 2.65.0 → 2.65.2

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.
Files changed (33) hide show
  1. package/dist/compiled/react-server-dom-webpack/LICENSE +21 -0
  2. package/dist/compiled/react-server-dom-webpack/README.md +5 -0
  3. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +2553 -0
  4. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +1637 -0
  5. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +2709 -0
  6. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +1800 -0
  7. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +2752 -0
  8. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +1849 -0
  9. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2714 -0
  10. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +1814 -0
  11. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +69 -0
  12. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +399 -0
  13. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +3782 -0
  14. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +2777 -0
  15. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +3812 -0
  16. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +2779 -0
  17. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +3869 -0
  18. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +2871 -0
  19. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +3832 -0
  20. package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +2837 -0
  21. package/dist/compiled/react-server-dom-webpack/client.browser.js +7 -0
  22. package/dist/compiled/react-server-dom-webpack/client.edge.js +7 -0
  23. package/dist/compiled/react-server-dom-webpack/client.js +3 -0
  24. package/dist/compiled/react-server-dom-webpack/client.node.js +7 -0
  25. package/dist/compiled/react-server-dom-webpack/client.node.unbundled.js +7 -0
  26. package/dist/compiled/react-server-dom-webpack/index.js +12 -0
  27. package/dist/compiled/react-server-dom-webpack/package.json +111 -0
  28. package/dist/compiled/react-server-dom-webpack/server.browser.js +17 -0
  29. package/dist/compiled/react-server-dom-webpack/server.edge.js +17 -0
  30. package/dist/compiled/react-server-dom-webpack/server.js +6 -0
  31. package/dist/compiled/react-server-dom-webpack/server.node.js +18 -0
  32. package/dist/compiled/react-server-dom-webpack/server.node.unbundled.js +18 -0
  33. package/package.json +34 -5
@@ -0,0 +1,2779 @@
1
+ /**
2
+ * @license React
3
+ * react-server-dom-webpack-server.edge.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 ReactDOM = require("react-dom"),
13
+ React = require("react");
14
+ function handleErrorInNextTick(error) {
15
+ setTimeout(function () {
16
+ throw error;
17
+ });
18
+ }
19
+ var LocalPromise = Promise,
20
+ scheduleMicrotask =
21
+ "function" === typeof queueMicrotask
22
+ ? queueMicrotask
23
+ : function (callback) {
24
+ LocalPromise.resolve(null)
25
+ .then(callback)
26
+ .catch(handleErrorInNextTick);
27
+ },
28
+ currentView = null,
29
+ writtenBytes = 0;
30
+ function writeChunkAndReturn(destination, chunk) {
31
+ if (0 !== chunk.byteLength)
32
+ if (2048 < chunk.byteLength)
33
+ 0 < writtenBytes &&
34
+ (destination.enqueue(
35
+ new Uint8Array(currentView.buffer, 0, writtenBytes)
36
+ ),
37
+ (currentView = new Uint8Array(2048)),
38
+ (writtenBytes = 0)),
39
+ destination.enqueue(chunk);
40
+ else {
41
+ var allowableBytes = currentView.length - writtenBytes;
42
+ allowableBytes < chunk.byteLength &&
43
+ (0 === allowableBytes
44
+ ? destination.enqueue(currentView)
45
+ : (currentView.set(chunk.subarray(0, allowableBytes), writtenBytes),
46
+ destination.enqueue(currentView),
47
+ (chunk = chunk.subarray(allowableBytes))),
48
+ (currentView = new Uint8Array(2048)),
49
+ (writtenBytes = 0));
50
+ currentView.set(chunk, writtenBytes);
51
+ writtenBytes += chunk.byteLength;
52
+ }
53
+ return !0;
54
+ }
55
+ var textEncoder = new TextEncoder();
56
+ function stringToChunk(content) {
57
+ return textEncoder.encode(content);
58
+ }
59
+ function byteLengthOfChunk(chunk) {
60
+ return chunk.byteLength;
61
+ }
62
+ function closeWithError(destination, error) {
63
+ "function" === typeof destination.error
64
+ ? destination.error(error)
65
+ : destination.close();
66
+ }
67
+ var CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
68
+ SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
69
+ function registerClientReferenceImpl(proxyImplementation, id, async) {
70
+ return Object.defineProperties(proxyImplementation, {
71
+ $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
72
+ $$id: { value: id },
73
+ $$async: { value: async }
74
+ });
75
+ }
76
+ var FunctionBind = Function.prototype.bind,
77
+ ArraySlice = Array.prototype.slice;
78
+ function bind() {
79
+ var newFn = FunctionBind.apply(this, arguments);
80
+ if (this.$$typeof === SERVER_REFERENCE_TAG) {
81
+ var args = ArraySlice.call(arguments, 1),
82
+ $$typeof = { value: SERVER_REFERENCE_TAG },
83
+ $$id = { value: this.$$id };
84
+ args = { value: this.$$bound ? this.$$bound.concat(args) : args };
85
+ return Object.defineProperties(newFn, {
86
+ $$typeof: $$typeof,
87
+ $$id: $$id,
88
+ $$bound: args,
89
+ bind: { value: bind, configurable: !0 }
90
+ });
91
+ }
92
+ return newFn;
93
+ }
94
+ var PROMISE_PROTOTYPE = Promise.prototype,
95
+ deepProxyHandlers = {
96
+ get: function (target, name) {
97
+ switch (name) {
98
+ case "$$typeof":
99
+ return target.$$typeof;
100
+ case "$$id":
101
+ return target.$$id;
102
+ case "$$async":
103
+ return target.$$async;
104
+ case "name":
105
+ return target.name;
106
+ case "displayName":
107
+ return;
108
+ case "defaultProps":
109
+ return;
110
+ case "toJSON":
111
+ return;
112
+ case Symbol.toPrimitive:
113
+ return Object.prototype[Symbol.toPrimitive];
114
+ case Symbol.toStringTag:
115
+ return Object.prototype[Symbol.toStringTag];
116
+ case "Provider":
117
+ throw Error(
118
+ "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
119
+ );
120
+ case "then":
121
+ throw Error(
122
+ "Cannot await or return from a thenable. You cannot await a client module from a server component."
123
+ );
124
+ }
125
+ throw Error(
126
+ "Cannot access " +
127
+ (String(target.name) + "." + String(name)) +
128
+ " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
129
+ );
130
+ },
131
+ set: function () {
132
+ throw Error("Cannot assign to a client module from a server module.");
133
+ }
134
+ };
135
+ function getReference(target, name) {
136
+ switch (name) {
137
+ case "$$typeof":
138
+ return target.$$typeof;
139
+ case "$$id":
140
+ return target.$$id;
141
+ case "$$async":
142
+ return target.$$async;
143
+ case "name":
144
+ return target.name;
145
+ case "defaultProps":
146
+ return;
147
+ case "toJSON":
148
+ return;
149
+ case Symbol.toPrimitive:
150
+ return Object.prototype[Symbol.toPrimitive];
151
+ case Symbol.toStringTag:
152
+ return Object.prototype[Symbol.toStringTag];
153
+ case "__esModule":
154
+ var moduleId = target.$$id;
155
+ target.default = registerClientReferenceImpl(
156
+ function () {
157
+ throw Error(
158
+ "Attempted to call the default export of " +
159
+ moduleId +
160
+ " from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
161
+ );
162
+ },
163
+ target.$$id + "#",
164
+ target.$$async
165
+ );
166
+ return !0;
167
+ case "then":
168
+ if (target.then) return target.then;
169
+ if (target.$$async) return;
170
+ var clientReference = registerClientReferenceImpl({}, target.$$id, !0),
171
+ proxy = new Proxy(clientReference, proxyHandlers$1);
172
+ target.status = "fulfilled";
173
+ target.value = proxy;
174
+ return (target.then = registerClientReferenceImpl(
175
+ function (resolve) {
176
+ return Promise.resolve(resolve(proxy));
177
+ },
178
+ target.$$id + "#then",
179
+ !1
180
+ ));
181
+ }
182
+ if ("symbol" === typeof name)
183
+ throw Error(
184
+ "Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
185
+ );
186
+ clientReference = target[name];
187
+ clientReference ||
188
+ ((clientReference = registerClientReferenceImpl(
189
+ function () {
190
+ throw Error(
191
+ "Attempted to call " +
192
+ String(name) +
193
+ "() from the server but " +
194
+ String(name) +
195
+ " is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
196
+ );
197
+ },
198
+ target.$$id + "#" + name,
199
+ target.$$async
200
+ )),
201
+ Object.defineProperty(clientReference, "name", { value: name }),
202
+ (clientReference = target[name] =
203
+ new Proxy(clientReference, deepProxyHandlers)));
204
+ return clientReference;
205
+ }
206
+ var proxyHandlers$1 = {
207
+ get: function (target, name) {
208
+ return getReference(target, name);
209
+ },
210
+ getOwnPropertyDescriptor: function (target, name) {
211
+ var descriptor = Object.getOwnPropertyDescriptor(target, name);
212
+ descriptor ||
213
+ ((descriptor = {
214
+ value: getReference(target, name),
215
+ writable: !1,
216
+ configurable: !1,
217
+ enumerable: !1
218
+ }),
219
+ Object.defineProperty(target, name, descriptor));
220
+ return descriptor;
221
+ },
222
+ getPrototypeOf: function () {
223
+ return PROMISE_PROTOTYPE;
224
+ },
225
+ set: function () {
226
+ throw Error("Cannot assign to a client module from a server module.");
227
+ }
228
+ },
229
+ ReactDOMSharedInternals =
230
+ ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
231
+ previousDispatcher = ReactDOMSharedInternals.d;
232
+ ReactDOMSharedInternals.d = {
233
+ f: previousDispatcher.f,
234
+ r: previousDispatcher.r,
235
+ D: prefetchDNS,
236
+ C: preconnect,
237
+ L: preload,
238
+ m: preloadModule$1,
239
+ X: preinitScript,
240
+ S: preinitStyle,
241
+ M: preinitModuleScript
242
+ };
243
+ function prefetchDNS(href) {
244
+ if ("string" === typeof href && href) {
245
+ var request = resolveRequest();
246
+ if (request) {
247
+ var hints = request.hints,
248
+ key = "D|" + href;
249
+ hints.has(key) || (hints.add(key), emitHint(request, "D", href));
250
+ } else previousDispatcher.D(href);
251
+ }
252
+ }
253
+ function preconnect(href, crossOrigin) {
254
+ if ("string" === typeof href) {
255
+ var request = resolveRequest();
256
+ if (request) {
257
+ var hints = request.hints,
258
+ key = "C|" + (null == crossOrigin ? "null" : crossOrigin) + "|" + href;
259
+ hints.has(key) ||
260
+ (hints.add(key),
261
+ "string" === typeof crossOrigin
262
+ ? emitHint(request, "C", [href, crossOrigin])
263
+ : emitHint(request, "C", href));
264
+ } else previousDispatcher.C(href, crossOrigin);
265
+ }
266
+ }
267
+ function preload(href, as, options) {
268
+ if ("string" === typeof href) {
269
+ var request = resolveRequest();
270
+ if (request) {
271
+ var hints = request.hints,
272
+ key = "L";
273
+ if ("image" === as && options) {
274
+ var imageSrcSet = options.imageSrcSet,
275
+ imageSizes = options.imageSizes,
276
+ uniquePart = "";
277
+ "string" === typeof imageSrcSet && "" !== imageSrcSet
278
+ ? ((uniquePart += "[" + imageSrcSet + "]"),
279
+ "string" === typeof imageSizes &&
280
+ (uniquePart += "[" + imageSizes + "]"))
281
+ : (uniquePart += "[][]" + href);
282
+ key += "[image]" + uniquePart;
283
+ } else key += "[" + as + "]" + href;
284
+ hints.has(key) ||
285
+ (hints.add(key),
286
+ (options = trimOptions(options))
287
+ ? emitHint(request, "L", [href, as, options])
288
+ : emitHint(request, "L", [href, as]));
289
+ } else previousDispatcher.L(href, as, options);
290
+ }
291
+ }
292
+ function preloadModule$1(href, options) {
293
+ if ("string" === typeof href) {
294
+ var request = resolveRequest();
295
+ if (request) {
296
+ var hints = request.hints,
297
+ key = "m|" + href;
298
+ if (hints.has(key)) return;
299
+ hints.add(key);
300
+ return (options = trimOptions(options))
301
+ ? emitHint(request, "m", [href, options])
302
+ : emitHint(request, "m", href);
303
+ }
304
+ previousDispatcher.m(href, options);
305
+ }
306
+ }
307
+ function preinitStyle(href, precedence, options) {
308
+ if ("string" === typeof href) {
309
+ var request = resolveRequest();
310
+ if (request) {
311
+ var hints = request.hints,
312
+ key = "S|" + href;
313
+ if (hints.has(key)) return;
314
+ hints.add(key);
315
+ return (options = trimOptions(options))
316
+ ? emitHint(request, "S", [
317
+ href,
318
+ "string" === typeof precedence ? precedence : 0,
319
+ options
320
+ ])
321
+ : "string" === typeof precedence
322
+ ? emitHint(request, "S", [href, precedence])
323
+ : emitHint(request, "S", href);
324
+ }
325
+ previousDispatcher.S(href, precedence, options);
326
+ }
327
+ }
328
+ function preinitScript(src, options) {
329
+ if ("string" === typeof src) {
330
+ var request = resolveRequest();
331
+ if (request) {
332
+ var hints = request.hints,
333
+ key = "X|" + src;
334
+ if (hints.has(key)) return;
335
+ hints.add(key);
336
+ return (options = trimOptions(options))
337
+ ? emitHint(request, "X", [src, options])
338
+ : emitHint(request, "X", src);
339
+ }
340
+ previousDispatcher.X(src, options);
341
+ }
342
+ }
343
+ function preinitModuleScript(src, options) {
344
+ if ("string" === typeof src) {
345
+ var request = resolveRequest();
346
+ if (request) {
347
+ var hints = request.hints,
348
+ key = "M|" + src;
349
+ if (hints.has(key)) return;
350
+ hints.add(key);
351
+ return (options = trimOptions(options))
352
+ ? emitHint(request, "M", [src, options])
353
+ : emitHint(request, "M", src);
354
+ }
355
+ previousDispatcher.M(src, options);
356
+ }
357
+ }
358
+ function trimOptions(options) {
359
+ if (null == options) return null;
360
+ var hasProperties = !1,
361
+ trimmed = {},
362
+ key;
363
+ for (key in options)
364
+ null != options[key] &&
365
+ ((hasProperties = !0), (trimmed[key] = options[key]));
366
+ return hasProperties ? trimmed : null;
367
+ }
368
+ var supportsRequestStorage = "function" === typeof AsyncLocalStorage,
369
+ requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null;
370
+ "object" === typeof async_hooks
371
+ ? async_hooks.createHook
372
+ : function () {
373
+ return { enable: function () {}, disable: function () {} };
374
+ };
375
+ "object" === typeof async_hooks ? async_hooks.executionAsyncId : null;
376
+ var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
377
+ proxyHandlers = {
378
+ get: function (target, name) {
379
+ switch (name) {
380
+ case "$$typeof":
381
+ return target.$$typeof;
382
+ case "name":
383
+ return;
384
+ case "displayName":
385
+ return;
386
+ case "defaultProps":
387
+ return;
388
+ case "toJSON":
389
+ return;
390
+ case Symbol.toPrimitive:
391
+ return Object.prototype[Symbol.toPrimitive];
392
+ case Symbol.toStringTag:
393
+ return Object.prototype[Symbol.toStringTag];
394
+ case "Provider":
395
+ throw Error(
396
+ "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
397
+ );
398
+ }
399
+ throw Error(
400
+ "Cannot access " +
401
+ String(name) +
402
+ " on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client."
403
+ );
404
+ },
405
+ set: function () {
406
+ throw Error(
407
+ "Cannot assign to a temporary client reference from a server module."
408
+ );
409
+ }
410
+ };
411
+ function createTemporaryReference(temporaryReferences, id) {
412
+ var reference = Object.defineProperties(
413
+ function () {
414
+ throw Error(
415
+ "Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
416
+ );
417
+ },
418
+ { $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
419
+ );
420
+ reference = new Proxy(reference, proxyHandlers);
421
+ temporaryReferences.set(reference, id);
422
+ return reference;
423
+ }
424
+ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
425
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
426
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
427
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
428
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
429
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
430
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
431
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
432
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
433
+ REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
434
+ Symbol.for("react.postpone");
435
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
436
+ function getIteratorFn(maybeIterable) {
437
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
438
+ maybeIterable =
439
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
440
+ maybeIterable["@@iterator"];
441
+ return "function" === typeof maybeIterable ? maybeIterable : null;
442
+ }
443
+ var ASYNC_ITERATOR = Symbol.asyncIterator,
444
+ SuspenseException = Error(
445
+ "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
446
+ );
447
+ function noop$1() {}
448
+ function trackUsedThenable(thenableState, thenable, index) {
449
+ index = thenableState[index];
450
+ void 0 === index
451
+ ? thenableState.push(thenable)
452
+ : index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));
453
+ switch (thenable.status) {
454
+ case "fulfilled":
455
+ return thenable.value;
456
+ case "rejected":
457
+ throw thenable.reason;
458
+ default:
459
+ "string" === typeof thenable.status
460
+ ? thenable.then(noop$1, noop$1)
461
+ : ((thenableState = thenable),
462
+ (thenableState.status = "pending"),
463
+ thenableState.then(
464
+ function (fulfilledValue) {
465
+ if ("pending" === thenable.status) {
466
+ var fulfilledThenable = thenable;
467
+ fulfilledThenable.status = "fulfilled";
468
+ fulfilledThenable.value = fulfilledValue;
469
+ }
470
+ },
471
+ function (error) {
472
+ if ("pending" === thenable.status) {
473
+ var rejectedThenable = thenable;
474
+ rejectedThenable.status = "rejected";
475
+ rejectedThenable.reason = error;
476
+ }
477
+ }
478
+ ));
479
+ switch (thenable.status) {
480
+ case "fulfilled":
481
+ return thenable.value;
482
+ case "rejected":
483
+ throw thenable.reason;
484
+ }
485
+ suspendedThenable = thenable;
486
+ throw SuspenseException;
487
+ }
488
+ }
489
+ var suspendedThenable = null;
490
+ function getSuspendedThenable() {
491
+ if (null === suspendedThenable)
492
+ throw Error(
493
+ "Expected a suspended thenable. This is a bug in React. Please file an issue."
494
+ );
495
+ var thenable = suspendedThenable;
496
+ suspendedThenable = null;
497
+ return thenable;
498
+ }
499
+ var currentRequest$1 = null,
500
+ thenableIndexCounter = 0,
501
+ thenableState = null;
502
+ function getThenableStateAfterSuspending() {
503
+ var state = thenableState || [];
504
+ thenableState = null;
505
+ return state;
506
+ }
507
+ var HooksDispatcher = {
508
+ useMemo: function (nextCreate) {
509
+ return nextCreate();
510
+ },
511
+ useCallback: function (callback) {
512
+ return callback;
513
+ },
514
+ useDebugValue: function () {},
515
+ useDeferredValue: unsupportedHook,
516
+ useTransition: unsupportedHook,
517
+ readContext: unsupportedContext,
518
+ useContext: unsupportedContext,
519
+ useReducer: unsupportedHook,
520
+ useRef: unsupportedHook,
521
+ useState: unsupportedHook,
522
+ useInsertionEffect: unsupportedHook,
523
+ useLayoutEffect: unsupportedHook,
524
+ useImperativeHandle: unsupportedHook,
525
+ useEffect: unsupportedHook,
526
+ useId: useId,
527
+ useSyncExternalStore: unsupportedHook,
528
+ useCacheRefresh: function () {
529
+ return unsupportedRefresh;
530
+ },
531
+ useMemoCache: function (size) {
532
+ for (var data = Array(size), i = 0; i < size; i++)
533
+ data[i] = REACT_MEMO_CACHE_SENTINEL;
534
+ return data;
535
+ },
536
+ use: use
537
+ };
538
+ function unsupportedHook() {
539
+ throw Error("This Hook is not supported in Server Components.");
540
+ }
541
+ function unsupportedRefresh() {
542
+ throw Error("Refreshing the cache is not supported in Server Components.");
543
+ }
544
+ function unsupportedContext() {
545
+ throw Error("Cannot read a Client Context from a Server Component.");
546
+ }
547
+ function useId() {
548
+ if (null === currentRequest$1)
549
+ throw Error("useId can only be used while React is rendering");
550
+ var id = currentRequest$1.identifierCount++;
551
+ return ":" + currentRequest$1.identifierPrefix + "S" + id.toString(32) + ":";
552
+ }
553
+ function use(usable) {
554
+ if (
555
+ (null !== usable && "object" === typeof usable) ||
556
+ "function" === typeof usable
557
+ ) {
558
+ if ("function" === typeof usable.then) {
559
+ var index = thenableIndexCounter;
560
+ thenableIndexCounter += 1;
561
+ null === thenableState && (thenableState = []);
562
+ return trackUsedThenable(thenableState, usable, index);
563
+ }
564
+ usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext();
565
+ }
566
+ if (usable.$$typeof === CLIENT_REFERENCE_TAG$1) {
567
+ if (null != usable.value && usable.value.$$typeof === REACT_CONTEXT_TYPE)
568
+ throw Error("Cannot read a Client Context from a Server Component.");
569
+ throw Error("Cannot use() an already resolved Client Reference.");
570
+ }
571
+ throw Error("An unsupported type was passed to use(): " + String(usable));
572
+ }
573
+ var DefaultAsyncDispatcher = {
574
+ getCacheForType: function (resourceType) {
575
+ var JSCompiler_inline_result = (JSCompiler_inline_result =
576
+ resolveRequest())
577
+ ? JSCompiler_inline_result.cache
578
+ : new Map();
579
+ var entry = JSCompiler_inline_result.get(resourceType);
580
+ void 0 === entry &&
581
+ ((entry = resourceType()),
582
+ JSCompiler_inline_result.set(resourceType, entry));
583
+ return entry;
584
+ }
585
+ },
586
+ ReactSharedInternalsServer =
587
+ React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
588
+ if (!ReactSharedInternalsServer)
589
+ throw Error(
590
+ 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
591
+ );
592
+ var isArrayImpl = Array.isArray,
593
+ getPrototypeOf = Object.getPrototypeOf;
594
+ function objectName(object) {
595
+ return Object.prototype.toString
596
+ .call(object)
597
+ .replace(/^\[object (.*)\]$/, function (m, p0) {
598
+ return p0;
599
+ });
600
+ }
601
+ function describeValueForErrorMessage(value) {
602
+ switch (typeof value) {
603
+ case "string":
604
+ return JSON.stringify(
605
+ 10 >= value.length ? value : value.slice(0, 10) + "..."
606
+ );
607
+ case "object":
608
+ if (isArrayImpl(value)) return "[...]";
609
+ if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)
610
+ return "client";
611
+ value = objectName(value);
612
+ return "Object" === value ? "{...}" : value;
613
+ case "function":
614
+ return value.$$typeof === CLIENT_REFERENCE_TAG
615
+ ? "client"
616
+ : (value = value.displayName || value.name)
617
+ ? "function " + value
618
+ : "function";
619
+ default:
620
+ return String(value);
621
+ }
622
+ }
623
+ function describeElementType(type) {
624
+ if ("string" === typeof type) return type;
625
+ switch (type) {
626
+ case REACT_SUSPENSE_TYPE:
627
+ return "Suspense";
628
+ case REACT_SUSPENSE_LIST_TYPE:
629
+ return "SuspenseList";
630
+ }
631
+ if ("object" === typeof type)
632
+ switch (type.$$typeof) {
633
+ case REACT_FORWARD_REF_TYPE:
634
+ return describeElementType(type.render);
635
+ case REACT_MEMO_TYPE:
636
+ return describeElementType(type.type);
637
+ case REACT_LAZY_TYPE:
638
+ var payload = type._payload;
639
+ type = type._init;
640
+ try {
641
+ return describeElementType(type(payload));
642
+ } catch (x) {}
643
+ }
644
+ return "";
645
+ }
646
+ var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
647
+ function describeObjectForErrorMessage(objectOrArray, expandedName) {
648
+ var objKind = objectName(objectOrArray);
649
+ if ("Object" !== objKind && "Array" !== objKind) return objKind;
650
+ objKind = -1;
651
+ var length = 0;
652
+ if (isArrayImpl(objectOrArray)) {
653
+ var str = "[";
654
+ for (var i = 0; i < objectOrArray.length; i++) {
655
+ 0 < i && (str += ", ");
656
+ var value = objectOrArray[i];
657
+ value =
658
+ "object" === typeof value && null !== value
659
+ ? describeObjectForErrorMessage(value)
660
+ : describeValueForErrorMessage(value);
661
+ "" + i === expandedName
662
+ ? ((objKind = str.length), (length = value.length), (str += value))
663
+ : (str =
664
+ 10 > value.length && 40 > str.length + value.length
665
+ ? str + value
666
+ : str + "...");
667
+ }
668
+ str += "]";
669
+ } else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)
670
+ str = "<" + describeElementType(objectOrArray.type) + "/>";
671
+ else {
672
+ if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client";
673
+ str = "{";
674
+ i = Object.keys(objectOrArray);
675
+ for (value = 0; value < i.length; value++) {
676
+ 0 < value && (str += ", ");
677
+ var name = i[value],
678
+ encodedKey = JSON.stringify(name);
679
+ str += ('"' + name + '"' === encodedKey ? name : encodedKey) + ": ";
680
+ encodedKey = objectOrArray[name];
681
+ encodedKey =
682
+ "object" === typeof encodedKey && null !== encodedKey
683
+ ? describeObjectForErrorMessage(encodedKey)
684
+ : describeValueForErrorMessage(encodedKey);
685
+ name === expandedName
686
+ ? ((objKind = str.length),
687
+ (length = encodedKey.length),
688
+ (str += encodedKey))
689
+ : (str =
690
+ 10 > encodedKey.length && 40 > str.length + encodedKey.length
691
+ ? str + encodedKey
692
+ : str + "...");
693
+ }
694
+ str += "}";
695
+ }
696
+ return void 0 === expandedName
697
+ ? str
698
+ : -1 < objKind && 0 < length
699
+ ? ((objectOrArray = " ".repeat(objKind) + "^".repeat(length)),
700
+ "\n " + str + "\n " + objectOrArray)
701
+ : "\n " + str;
702
+ }
703
+ var ObjectPrototype = Object.prototype,
704
+ stringify = JSON.stringify;
705
+ function defaultErrorHandler(error) {
706
+ console.error(error);
707
+ }
708
+ function defaultPostponeHandler() {}
709
+ function RequestInstance(
710
+ type,
711
+ model,
712
+ bundlerConfig,
713
+ onError,
714
+ identifierPrefix,
715
+ onPostpone,
716
+ temporaryReferences,
717
+ environmentName,
718
+ filterStackFrame,
719
+ onAllReady,
720
+ onFatalError
721
+ ) {
722
+ if (
723
+ null !== ReactSharedInternalsServer.A &&
724
+ ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
725
+ )
726
+ throw Error("Currently React only supports one RSC renderer at a time.");
727
+ ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
728
+ filterStackFrame = new Set();
729
+ environmentName = [];
730
+ var hints = new Set();
731
+ this.type = type;
732
+ this.status = 10;
733
+ this.flushScheduled = !1;
734
+ this.destination = this.fatalError = null;
735
+ this.bundlerConfig = bundlerConfig;
736
+ this.cache = new Map();
737
+ this.pendingChunks = this.nextChunkId = 0;
738
+ this.hints = hints;
739
+ this.abortListeners = new Set();
740
+ this.abortableTasks = filterStackFrame;
741
+ this.pingedTasks = environmentName;
742
+ this.completedImportChunks = [];
743
+ this.completedHintChunks = [];
744
+ this.completedRegularChunks = [];
745
+ this.completedErrorChunks = [];
746
+ this.writtenSymbols = new Map();
747
+ this.writtenClientReferences = new Map();
748
+ this.writtenServerReferences = new Map();
749
+ this.writtenObjects = new WeakMap();
750
+ this.temporaryReferences = temporaryReferences;
751
+ this.identifierPrefix = identifierPrefix || "";
752
+ this.identifierCount = 1;
753
+ this.taintCleanupQueue = [];
754
+ this.onError = void 0 === onError ? defaultErrorHandler : onError;
755
+ this.onPostpone = void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
756
+ this.onAllReady = onAllReady;
757
+ this.onFatalError = onFatalError;
758
+ type = createTask(this, model, null, !1, filterStackFrame);
759
+ environmentName.push(type);
760
+ }
761
+ function noop() {}
762
+ var currentRequest = null;
763
+ function resolveRequest() {
764
+ if (currentRequest) return currentRequest;
765
+ if (supportsRequestStorage) {
766
+ var store = requestStorage.getStore();
767
+ if (store) return store;
768
+ }
769
+ return null;
770
+ }
771
+ function serializeThenable(request, task, thenable) {
772
+ var newTask = createTask(
773
+ request,
774
+ null,
775
+ task.keyPath,
776
+ task.implicitSlot,
777
+ request.abortableTasks
778
+ );
779
+ switch (thenable.status) {
780
+ case "fulfilled":
781
+ return (
782
+ (newTask.model = thenable.value), pingTask(request, newTask), newTask.id
783
+ );
784
+ case "rejected":
785
+ return (
786
+ (task = logRecoverableError(request, thenable.reason, null)),
787
+ emitErrorChunk(request, newTask.id, task),
788
+ (newTask.status = 4),
789
+ request.abortableTasks.delete(newTask),
790
+ newTask.id
791
+ );
792
+ default:
793
+ if (12 === request.status)
794
+ return (
795
+ request.abortableTasks.delete(newTask),
796
+ (newTask.status = 3),
797
+ (task = stringify(serializeByValueID(request.fatalError))),
798
+ emitModelChunk(request, newTask.id, task),
799
+ newTask.id
800
+ );
801
+ "string" !== typeof thenable.status &&
802
+ ((thenable.status = "pending"),
803
+ thenable.then(
804
+ function (fulfilledValue) {
805
+ "pending" === thenable.status &&
806
+ ((thenable.status = "fulfilled"),
807
+ (thenable.value = fulfilledValue));
808
+ },
809
+ function (error) {
810
+ "pending" === thenable.status &&
811
+ ((thenable.status = "rejected"), (thenable.reason = error));
812
+ }
813
+ ));
814
+ }
815
+ thenable.then(
816
+ function (value) {
817
+ newTask.model = value;
818
+ pingTask(request, newTask);
819
+ },
820
+ function (reason) {
821
+ 0 === newTask.status &&
822
+ ((reason = logRecoverableError(request, reason, newTask)),
823
+ emitErrorChunk(request, newTask.id, reason),
824
+ (newTask.status = 4),
825
+ request.abortableTasks.delete(newTask),
826
+ enqueueFlush(request));
827
+ }
828
+ );
829
+ return newTask.id;
830
+ }
831
+ function serializeReadableStream(request, task, stream) {
832
+ function progress(entry) {
833
+ if (!aborted)
834
+ if (entry.done)
835
+ request.abortListeners.delete(abortStream),
836
+ (entry = streamTask.id.toString(16) + ":C\n"),
837
+ request.completedRegularChunks.push(stringToChunk(entry)),
838
+ enqueueFlush(request),
839
+ (aborted = !0);
840
+ else
841
+ try {
842
+ (streamTask.model = entry.value),
843
+ request.pendingChunks++,
844
+ emitChunk(request, streamTask, streamTask.model),
845
+ enqueueFlush(request),
846
+ reader.read().then(progress, error);
847
+ } catch (x$8) {
848
+ error(x$8);
849
+ }
850
+ }
851
+ function error(reason) {
852
+ if (!aborted) {
853
+ aborted = !0;
854
+ request.abortListeners.delete(abortStream);
855
+ var digest = logRecoverableError(request, reason, streamTask);
856
+ emitErrorChunk(request, streamTask.id, digest);
857
+ enqueueFlush(request);
858
+ reader.cancel(reason).then(error, error);
859
+ }
860
+ }
861
+ function abortStream(reason) {
862
+ if (!aborted) {
863
+ aborted = !0;
864
+ request.abortListeners.delete(abortStream);
865
+ var digest = logRecoverableError(request, reason, streamTask);
866
+ emitErrorChunk(request, streamTask.id, digest);
867
+ enqueueFlush(request);
868
+ reader.cancel(reason).then(error, error);
869
+ }
870
+ }
871
+ var supportsBYOB = stream.supportsBYOB;
872
+ if (void 0 === supportsBYOB)
873
+ try {
874
+ stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
875
+ } catch (x) {
876
+ supportsBYOB = !1;
877
+ }
878
+ var reader = stream.getReader(),
879
+ streamTask = createTask(
880
+ request,
881
+ task.model,
882
+ task.keyPath,
883
+ task.implicitSlot,
884
+ request.abortableTasks
885
+ );
886
+ request.abortableTasks.delete(streamTask);
887
+ request.pendingChunks++;
888
+ task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
889
+ request.completedRegularChunks.push(stringToChunk(task));
890
+ var aborted = !1;
891
+ request.abortListeners.add(abortStream);
892
+ reader.read().then(progress, error);
893
+ return serializeByValueID(streamTask.id);
894
+ }
895
+ function serializeAsyncIterable(request, task, iterable, iterator) {
896
+ function progress(entry) {
897
+ if (!aborted)
898
+ if (entry.done) {
899
+ request.abortListeners.delete(abortIterable);
900
+ if (void 0 === entry.value)
901
+ var endStreamRow = streamTask.id.toString(16) + ":C\n";
902
+ else
903
+ try {
904
+ var chunkId = outlineModel(request, entry.value);
905
+ endStreamRow =
906
+ streamTask.id.toString(16) +
907
+ ":C" +
908
+ stringify(serializeByValueID(chunkId)) +
909
+ "\n";
910
+ } catch (x) {
911
+ error(x);
912
+ return;
913
+ }
914
+ request.completedRegularChunks.push(stringToChunk(endStreamRow));
915
+ enqueueFlush(request);
916
+ aborted = !0;
917
+ } else
918
+ try {
919
+ (streamTask.model = entry.value),
920
+ request.pendingChunks++,
921
+ emitChunk(request, streamTask, streamTask.model),
922
+ enqueueFlush(request),
923
+ iterator.next().then(progress, error);
924
+ } catch (x$9) {
925
+ error(x$9);
926
+ }
927
+ }
928
+ function error(reason) {
929
+ if (!aborted) {
930
+ aborted = !0;
931
+ request.abortListeners.delete(abortIterable);
932
+ var digest = logRecoverableError(request, reason, streamTask);
933
+ emitErrorChunk(request, streamTask.id, digest);
934
+ enqueueFlush(request);
935
+ "function" === typeof iterator.throw &&
936
+ iterator.throw(reason).then(error, error);
937
+ }
938
+ }
939
+ function abortIterable(reason) {
940
+ if (!aborted) {
941
+ aborted = !0;
942
+ request.abortListeners.delete(abortIterable);
943
+ var digest = logRecoverableError(request, reason, streamTask);
944
+ emitErrorChunk(request, streamTask.id, digest);
945
+ enqueueFlush(request);
946
+ "function" === typeof iterator.throw &&
947
+ iterator.throw(reason).then(error, error);
948
+ }
949
+ }
950
+ iterable = iterable === iterator;
951
+ var streamTask = createTask(
952
+ request,
953
+ task.model,
954
+ task.keyPath,
955
+ task.implicitSlot,
956
+ request.abortableTasks
957
+ );
958
+ request.abortableTasks.delete(streamTask);
959
+ request.pendingChunks++;
960
+ task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
961
+ request.completedRegularChunks.push(stringToChunk(task));
962
+ var aborted = !1;
963
+ request.abortListeners.add(abortIterable);
964
+ iterator.next().then(progress, error);
965
+ return serializeByValueID(streamTask.id);
966
+ }
967
+ function emitHint(request, code, model) {
968
+ model = stringify(model);
969
+ var id = request.nextChunkId++;
970
+ code = "H" + code;
971
+ code = id.toString(16) + ":" + code;
972
+ model = stringToChunk(code + model + "\n");
973
+ request.completedHintChunks.push(model);
974
+ enqueueFlush(request);
975
+ }
976
+ function readThenable(thenable) {
977
+ if ("fulfilled" === thenable.status) return thenable.value;
978
+ if ("rejected" === thenable.status) throw thenable.reason;
979
+ throw thenable;
980
+ }
981
+ function createLazyWrapperAroundWakeable(wakeable) {
982
+ switch (wakeable.status) {
983
+ case "fulfilled":
984
+ case "rejected":
985
+ break;
986
+ default:
987
+ "string" !== typeof wakeable.status &&
988
+ ((wakeable.status = "pending"),
989
+ wakeable.then(
990
+ function (fulfilledValue) {
991
+ "pending" === wakeable.status &&
992
+ ((wakeable.status = "fulfilled"),
993
+ (wakeable.value = fulfilledValue));
994
+ },
995
+ function (error) {
996
+ "pending" === wakeable.status &&
997
+ ((wakeable.status = "rejected"), (wakeable.reason = error));
998
+ }
999
+ ));
1000
+ }
1001
+ return { $$typeof: REACT_LAZY_TYPE, _payload: wakeable, _init: readThenable };
1002
+ }
1003
+ function voidHandler() {}
1004
+ function renderFunctionComponent(request, task, key, Component, props) {
1005
+ var prevThenableState = task.thenableState;
1006
+ task.thenableState = null;
1007
+ thenableIndexCounter = 0;
1008
+ thenableState = prevThenableState;
1009
+ Component = Component(props, void 0);
1010
+ if (12 === request.status)
1011
+ throw (
1012
+ ("object" === typeof Component &&
1013
+ null !== Component &&
1014
+ "function" === typeof Component.then &&
1015
+ Component.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
1016
+ Component.then(voidHandler, voidHandler),
1017
+ null)
1018
+ );
1019
+ if (
1020
+ "object" === typeof Component &&
1021
+ null !== Component &&
1022
+ Component.$$typeof !== CLIENT_REFERENCE_TAG$1
1023
+ ) {
1024
+ if ("function" === typeof Component.then) {
1025
+ props = Component;
1026
+ if ("fulfilled" === props.status) return props.value;
1027
+ Component = createLazyWrapperAroundWakeable(Component);
1028
+ }
1029
+ var iteratorFn = getIteratorFn(Component);
1030
+ if (iteratorFn) {
1031
+ var iterableChild = Component;
1032
+ Component = {};
1033
+ Component =
1034
+ ((Component[Symbol.iterator] = function () {
1035
+ return iteratorFn.call(iterableChild);
1036
+ }),
1037
+ Component);
1038
+ } else if (
1039
+ !(
1040
+ "function" !== typeof Component[ASYNC_ITERATOR] ||
1041
+ ("function" === typeof ReadableStream &&
1042
+ Component instanceof ReadableStream)
1043
+ )
1044
+ ) {
1045
+ var iterableChild$10 = Component;
1046
+ Component = {};
1047
+ Component =
1048
+ ((Component[ASYNC_ITERATOR] = function () {
1049
+ return iterableChild$10[ASYNC_ITERATOR]();
1050
+ }),
1051
+ Component);
1052
+ }
1053
+ }
1054
+ props = task.keyPath;
1055
+ prevThenableState = task.implicitSlot;
1056
+ null !== key
1057
+ ? (task.keyPath = null === props ? key : props + "," + key)
1058
+ : null === props && (task.implicitSlot = !0);
1059
+ request = renderModelDestructive(request, task, emptyRoot, "", Component);
1060
+ task.keyPath = props;
1061
+ task.implicitSlot = prevThenableState;
1062
+ return request;
1063
+ }
1064
+ function renderFragment(request, task, children) {
1065
+ return null !== task.keyPath
1066
+ ? ((request = [
1067
+ REACT_ELEMENT_TYPE,
1068
+ REACT_FRAGMENT_TYPE,
1069
+ task.keyPath,
1070
+ { children: children }
1071
+ ]),
1072
+ task.implicitSlot ? [request] : request)
1073
+ : children;
1074
+ }
1075
+ function renderElement(request, task, type, key, ref, props) {
1076
+ if (null !== ref && void 0 !== ref)
1077
+ throw Error(
1078
+ "Refs cannot be used in Server Components, nor passed to Client Components."
1079
+ );
1080
+ if (
1081
+ "function" === typeof type &&
1082
+ type.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
1083
+ type.$$typeof !== TEMPORARY_REFERENCE_TAG
1084
+ )
1085
+ return renderFunctionComponent(request, task, key, type, props);
1086
+ if (type === REACT_FRAGMENT_TYPE && null === key)
1087
+ return (
1088
+ (type = task.implicitSlot),
1089
+ null === task.keyPath && (task.implicitSlot = !0),
1090
+ (props = renderModelDestructive(
1091
+ request,
1092
+ task,
1093
+ emptyRoot,
1094
+ "",
1095
+ props.children
1096
+ )),
1097
+ (task.implicitSlot = type),
1098
+ props
1099
+ );
1100
+ if (
1101
+ null != type &&
1102
+ "object" === typeof type &&
1103
+ type.$$typeof !== CLIENT_REFERENCE_TAG$1
1104
+ )
1105
+ switch (type.$$typeof) {
1106
+ case REACT_LAZY_TYPE:
1107
+ var init = type._init;
1108
+ type = init(type._payload);
1109
+ if (12 === request.status) throw null;
1110
+ return renderElement(request, task, type, key, ref, props);
1111
+ case REACT_FORWARD_REF_TYPE:
1112
+ return renderFunctionComponent(request, task, key, type.render, props);
1113
+ case REACT_MEMO_TYPE:
1114
+ return renderElement(request, task, type.type, key, ref, props);
1115
+ }
1116
+ request = key;
1117
+ key = task.keyPath;
1118
+ null === request
1119
+ ? (request = key)
1120
+ : null !== key && (request = key + "," + request);
1121
+ props = [REACT_ELEMENT_TYPE, type, request, props];
1122
+ task = task.implicitSlot && null !== request ? [props] : props;
1123
+ return task;
1124
+ }
1125
+ function pingTask(request, task) {
1126
+ var pingedTasks = request.pingedTasks;
1127
+ pingedTasks.push(task);
1128
+ 1 === pingedTasks.length &&
1129
+ ((request.flushScheduled = null !== request.destination),
1130
+ 21 === request.type || 10 === request.status
1131
+ ? scheduleMicrotask(function () {
1132
+ return performWork(request);
1133
+ })
1134
+ : setTimeout(function () {
1135
+ return performWork(request);
1136
+ }, 0));
1137
+ }
1138
+ function createTask(request, model, keyPath, implicitSlot, abortSet) {
1139
+ request.pendingChunks++;
1140
+ var id = request.nextChunkId++;
1141
+ "object" !== typeof model ||
1142
+ null === model ||
1143
+ null !== keyPath ||
1144
+ implicitSlot ||
1145
+ request.writtenObjects.set(model, serializeByValueID(id));
1146
+ var task = {
1147
+ id: id,
1148
+ status: 0,
1149
+ model: model,
1150
+ keyPath: keyPath,
1151
+ implicitSlot: implicitSlot,
1152
+ ping: function () {
1153
+ return pingTask(request, task);
1154
+ },
1155
+ toJSON: function (parentPropertyName, value) {
1156
+ var prevKeyPath = task.keyPath,
1157
+ prevImplicitSlot = task.implicitSlot;
1158
+ try {
1159
+ var JSCompiler_inline_result = renderModelDestructive(
1160
+ request,
1161
+ task,
1162
+ this,
1163
+ parentPropertyName,
1164
+ value
1165
+ );
1166
+ } catch (thrownValue) {
1167
+ if (
1168
+ ((parentPropertyName = task.model),
1169
+ (parentPropertyName =
1170
+ "object" === typeof parentPropertyName &&
1171
+ null !== parentPropertyName &&
1172
+ (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
1173
+ parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
1174
+ 12 === request.status)
1175
+ )
1176
+ (task.status = 3),
1177
+ (prevKeyPath = request.fatalError),
1178
+ (JSCompiler_inline_result = parentPropertyName
1179
+ ? "$L" + prevKeyPath.toString(16)
1180
+ : serializeByValueID(prevKeyPath));
1181
+ else if (
1182
+ ((value =
1183
+ thrownValue === SuspenseException
1184
+ ? getSuspendedThenable()
1185
+ : thrownValue),
1186
+ "object" === typeof value &&
1187
+ null !== value &&
1188
+ "function" === typeof value.then)
1189
+ ) {
1190
+ JSCompiler_inline_result = createTask(
1191
+ request,
1192
+ task.model,
1193
+ task.keyPath,
1194
+ task.implicitSlot,
1195
+ request.abortableTasks
1196
+ );
1197
+ var ping = JSCompiler_inline_result.ping;
1198
+ value.then(ping, ping);
1199
+ JSCompiler_inline_result.thenableState =
1200
+ getThenableStateAfterSuspending();
1201
+ task.keyPath = prevKeyPath;
1202
+ task.implicitSlot = prevImplicitSlot;
1203
+ JSCompiler_inline_result = parentPropertyName
1204
+ ? "$L" + JSCompiler_inline_result.id.toString(16)
1205
+ : serializeByValueID(JSCompiler_inline_result.id);
1206
+ } else
1207
+ (task.keyPath = prevKeyPath),
1208
+ (task.implicitSlot = prevImplicitSlot),
1209
+ request.pendingChunks++,
1210
+ (prevKeyPath = request.nextChunkId++),
1211
+ (prevImplicitSlot = logRecoverableError(request, value, task)),
1212
+ emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
1213
+ (JSCompiler_inline_result = parentPropertyName
1214
+ ? "$L" + prevKeyPath.toString(16)
1215
+ : serializeByValueID(prevKeyPath));
1216
+ }
1217
+ return JSCompiler_inline_result;
1218
+ },
1219
+ thenableState: null
1220
+ };
1221
+ abortSet.add(task);
1222
+ return task;
1223
+ }
1224
+ function serializeByValueID(id) {
1225
+ return "$" + id.toString(16);
1226
+ }
1227
+ function encodeReferenceChunk(request, id, reference) {
1228
+ request = stringify(reference);
1229
+ id = id.toString(16) + ":" + request + "\n";
1230
+ return stringToChunk(id);
1231
+ }
1232
+ function serializeClientReference(
1233
+ request,
1234
+ parent,
1235
+ parentPropertyName,
1236
+ clientReference
1237
+ ) {
1238
+ var clientReferenceKey = clientReference.$$async
1239
+ ? clientReference.$$id + "#async"
1240
+ : clientReference.$$id,
1241
+ writtenClientReferences = request.writtenClientReferences,
1242
+ existingId = writtenClientReferences.get(clientReferenceKey);
1243
+ if (void 0 !== existingId)
1244
+ return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1245
+ ? "$L" + existingId.toString(16)
1246
+ : serializeByValueID(existingId);
1247
+ try {
1248
+ var config = request.bundlerConfig,
1249
+ modulePath = clientReference.$$id;
1250
+ existingId = "";
1251
+ var resolvedModuleData = config[modulePath];
1252
+ if (resolvedModuleData) existingId = resolvedModuleData.name;
1253
+ else {
1254
+ var idx = modulePath.lastIndexOf("#");
1255
+ -1 !== idx &&
1256
+ ((existingId = modulePath.slice(idx + 1)),
1257
+ (resolvedModuleData = config[modulePath.slice(0, idx)]));
1258
+ if (!resolvedModuleData)
1259
+ throw Error(
1260
+ 'Could not find the module "' +
1261
+ modulePath +
1262
+ '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
1263
+ );
1264
+ }
1265
+ if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
1266
+ throw Error(
1267
+ 'The module "' +
1268
+ modulePath +
1269
+ '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
1270
+ );
1271
+ var JSCompiler_inline_result =
1272
+ !0 === resolvedModuleData.async || !0 === clientReference.$$async
1273
+ ? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
1274
+ : [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
1275
+ request.pendingChunks++;
1276
+ var importId = request.nextChunkId++,
1277
+ json = stringify(JSCompiler_inline_result),
1278
+ row = importId.toString(16) + ":I" + json + "\n",
1279
+ processedChunk = stringToChunk(row);
1280
+ request.completedImportChunks.push(processedChunk);
1281
+ writtenClientReferences.set(clientReferenceKey, importId);
1282
+ return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1283
+ ? "$L" + importId.toString(16)
1284
+ : serializeByValueID(importId);
1285
+ } catch (x) {
1286
+ return (
1287
+ request.pendingChunks++,
1288
+ (parent = request.nextChunkId++),
1289
+ (parentPropertyName = logRecoverableError(request, x, null)),
1290
+ emitErrorChunk(request, parent, parentPropertyName),
1291
+ serializeByValueID(parent)
1292
+ );
1293
+ }
1294
+ }
1295
+ function outlineModel(request, value) {
1296
+ value = createTask(request, value, null, !1, request.abortableTasks);
1297
+ retryTask(request, value);
1298
+ return value.id;
1299
+ }
1300
+ function serializeTypedArray(request, tag, typedArray) {
1301
+ request.pendingChunks++;
1302
+ var bufferId = request.nextChunkId++;
1303
+ emitTypedArrayChunk(request, bufferId, tag, typedArray);
1304
+ return serializeByValueID(bufferId);
1305
+ }
1306
+ function serializeBlob(request, blob) {
1307
+ function progress(entry) {
1308
+ if (!aborted)
1309
+ if (entry.done)
1310
+ request.abortListeners.delete(abortBlob),
1311
+ (aborted = !0),
1312
+ pingTask(request, newTask);
1313
+ else
1314
+ return (
1315
+ model.push(entry.value), reader.read().then(progress).catch(error)
1316
+ );
1317
+ }
1318
+ function error(reason) {
1319
+ if (!aborted) {
1320
+ aborted = !0;
1321
+ request.abortListeners.delete(abortBlob);
1322
+ var digest = logRecoverableError(request, reason, newTask);
1323
+ emitErrorChunk(request, newTask.id, digest);
1324
+ enqueueFlush(request);
1325
+ reader.cancel(reason).then(error, error);
1326
+ }
1327
+ }
1328
+ function abortBlob(reason) {
1329
+ if (!aborted) {
1330
+ aborted = !0;
1331
+ request.abortListeners.delete(abortBlob);
1332
+ var digest = logRecoverableError(request, reason, newTask);
1333
+ emitErrorChunk(request, newTask.id, digest);
1334
+ enqueueFlush(request);
1335
+ reader.cancel(reason).then(error, error);
1336
+ }
1337
+ }
1338
+ var model = [blob.type],
1339
+ newTask = createTask(request, model, null, !1, request.abortableTasks),
1340
+ reader = blob.stream().getReader(),
1341
+ aborted = !1;
1342
+ request.abortListeners.add(abortBlob);
1343
+ reader.read().then(progress).catch(error);
1344
+ return "$B" + newTask.id.toString(16);
1345
+ }
1346
+ var modelRoot = !1;
1347
+ function renderModelDestructive(
1348
+ request,
1349
+ task,
1350
+ parent,
1351
+ parentPropertyName,
1352
+ value
1353
+ ) {
1354
+ task.model = value;
1355
+ if (value === REACT_ELEMENT_TYPE) return "$";
1356
+ if (null === value) return null;
1357
+ if ("object" === typeof value) {
1358
+ switch (value.$$typeof) {
1359
+ case REACT_ELEMENT_TYPE:
1360
+ var elementReference = null,
1361
+ writtenObjects = request.writtenObjects;
1362
+ if (null === task.keyPath && !task.implicitSlot) {
1363
+ var existingReference = writtenObjects.get(value);
1364
+ if (void 0 !== existingReference)
1365
+ if (modelRoot === value) modelRoot = null;
1366
+ else return existingReference;
1367
+ else
1368
+ -1 === parentPropertyName.indexOf(":") &&
1369
+ ((parent = writtenObjects.get(parent)),
1370
+ void 0 !== parent &&
1371
+ ((elementReference = parent + ":" + parentPropertyName),
1372
+ writtenObjects.set(value, elementReference)));
1373
+ }
1374
+ parentPropertyName = value.props;
1375
+ parent = parentPropertyName.ref;
1376
+ request = renderElement(
1377
+ request,
1378
+ task,
1379
+ value.type,
1380
+ value.key,
1381
+ void 0 !== parent ? parent : null,
1382
+ parentPropertyName
1383
+ );
1384
+ "object" === typeof request &&
1385
+ null !== request &&
1386
+ null !== elementReference &&
1387
+ (writtenObjects.has(request) ||
1388
+ writtenObjects.set(request, elementReference));
1389
+ return request;
1390
+ case REACT_LAZY_TYPE:
1391
+ task.thenableState = null;
1392
+ parentPropertyName = value._init;
1393
+ value = parentPropertyName(value._payload);
1394
+ if (12 === request.status) throw null;
1395
+ return renderModelDestructive(request, task, emptyRoot, "", value);
1396
+ case REACT_LEGACY_ELEMENT_TYPE:
1397
+ throw Error(
1398
+ 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
1399
+ );
1400
+ }
1401
+ if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
1402
+ return serializeClientReference(
1403
+ request,
1404
+ parent,
1405
+ parentPropertyName,
1406
+ value
1407
+ );
1408
+ if (
1409
+ void 0 !== request.temporaryReferences &&
1410
+ ((elementReference = request.temporaryReferences.get(value)),
1411
+ void 0 !== elementReference)
1412
+ )
1413
+ return "$T" + elementReference;
1414
+ elementReference = request.writtenObjects;
1415
+ writtenObjects = elementReference.get(value);
1416
+ if ("function" === typeof value.then) {
1417
+ if (void 0 !== writtenObjects) {
1418
+ if (null !== task.keyPath || task.implicitSlot)
1419
+ return "$@" + serializeThenable(request, task, value).toString(16);
1420
+ if (modelRoot === value) modelRoot = null;
1421
+ else return writtenObjects;
1422
+ }
1423
+ request = "$@" + serializeThenable(request, task, value).toString(16);
1424
+ elementReference.set(value, request);
1425
+ return request;
1426
+ }
1427
+ if (void 0 !== writtenObjects)
1428
+ if (modelRoot === value) modelRoot = null;
1429
+ else return writtenObjects;
1430
+ else if (
1431
+ -1 === parentPropertyName.indexOf(":") &&
1432
+ ((writtenObjects = elementReference.get(parent)),
1433
+ void 0 !== writtenObjects)
1434
+ ) {
1435
+ existingReference = parentPropertyName;
1436
+ if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
1437
+ switch (parentPropertyName) {
1438
+ case "1":
1439
+ existingReference = "type";
1440
+ break;
1441
+ case "2":
1442
+ existingReference = "key";
1443
+ break;
1444
+ case "3":
1445
+ existingReference = "props";
1446
+ break;
1447
+ case "4":
1448
+ existingReference = "_owner";
1449
+ }
1450
+ elementReference.set(value, writtenObjects + ":" + existingReference);
1451
+ }
1452
+ if (isArrayImpl(value)) return renderFragment(request, task, value);
1453
+ if (value instanceof Map)
1454
+ return (
1455
+ (value = Array.from(value)),
1456
+ "$Q" + outlineModel(request, value).toString(16)
1457
+ );
1458
+ if (value instanceof Set)
1459
+ return (
1460
+ (value = Array.from(value)),
1461
+ "$W" + outlineModel(request, value).toString(16)
1462
+ );
1463
+ if ("function" === typeof FormData && value instanceof FormData)
1464
+ return (
1465
+ (value = Array.from(value.entries())),
1466
+ "$K" + outlineModel(request, value).toString(16)
1467
+ );
1468
+ if (value instanceof Error) return "$Z";
1469
+ if (value instanceof ArrayBuffer)
1470
+ return serializeTypedArray(request, "A", new Uint8Array(value));
1471
+ if (value instanceof Int8Array)
1472
+ return serializeTypedArray(request, "O", value);
1473
+ if (value instanceof Uint8Array)
1474
+ return serializeTypedArray(request, "o", value);
1475
+ if (value instanceof Uint8ClampedArray)
1476
+ return serializeTypedArray(request, "U", value);
1477
+ if (value instanceof Int16Array)
1478
+ return serializeTypedArray(request, "S", value);
1479
+ if (value instanceof Uint16Array)
1480
+ return serializeTypedArray(request, "s", value);
1481
+ if (value instanceof Int32Array)
1482
+ return serializeTypedArray(request, "L", value);
1483
+ if (value instanceof Uint32Array)
1484
+ return serializeTypedArray(request, "l", value);
1485
+ if (value instanceof Float32Array)
1486
+ return serializeTypedArray(request, "G", value);
1487
+ if (value instanceof Float64Array)
1488
+ return serializeTypedArray(request, "g", value);
1489
+ if (value instanceof BigInt64Array)
1490
+ return serializeTypedArray(request, "M", value);
1491
+ if (value instanceof BigUint64Array)
1492
+ return serializeTypedArray(request, "m", value);
1493
+ if (value instanceof DataView)
1494
+ return serializeTypedArray(request, "V", value);
1495
+ if ("function" === typeof Blob && value instanceof Blob)
1496
+ return serializeBlob(request, value);
1497
+ if ((elementReference = getIteratorFn(value)))
1498
+ return (
1499
+ (parentPropertyName = elementReference.call(value)),
1500
+ parentPropertyName === value
1501
+ ? "$i" +
1502
+ outlineModel(request, Array.from(parentPropertyName)).toString(16)
1503
+ : renderFragment(request, task, Array.from(parentPropertyName))
1504
+ );
1505
+ if ("function" === typeof ReadableStream && value instanceof ReadableStream)
1506
+ return serializeReadableStream(request, task, value);
1507
+ elementReference = value[ASYNC_ITERATOR];
1508
+ if ("function" === typeof elementReference)
1509
+ return (
1510
+ null !== task.keyPath
1511
+ ? ((request = [
1512
+ REACT_ELEMENT_TYPE,
1513
+ REACT_FRAGMENT_TYPE,
1514
+ task.keyPath,
1515
+ { children: value }
1516
+ ]),
1517
+ (request = task.implicitSlot ? [request] : request))
1518
+ : ((parentPropertyName = elementReference.call(value)),
1519
+ (request = serializeAsyncIterable(
1520
+ request,
1521
+ task,
1522
+ value,
1523
+ parentPropertyName
1524
+ ))),
1525
+ request
1526
+ );
1527
+ if (value instanceof Date) return "$D" + value.toJSON();
1528
+ request = getPrototypeOf(value);
1529
+ if (
1530
+ request !== ObjectPrototype &&
1531
+ (null === request || null !== getPrototypeOf(request))
1532
+ )
1533
+ throw Error(
1534
+ "Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." +
1535
+ describeObjectForErrorMessage(parent, parentPropertyName)
1536
+ );
1537
+ return value;
1538
+ }
1539
+ if ("string" === typeof value) {
1540
+ if (
1541
+ "Z" === value[value.length - 1] &&
1542
+ parent[parentPropertyName] instanceof Date
1543
+ )
1544
+ return "$D" + value;
1545
+ if (1024 <= value.length && null !== byteLengthOfChunk)
1546
+ return (
1547
+ request.pendingChunks++,
1548
+ (task = request.nextChunkId++),
1549
+ emitTextChunk(request, task, value),
1550
+ serializeByValueID(task)
1551
+ );
1552
+ request = "$" === value[0] ? "$" + value : value;
1553
+ return request;
1554
+ }
1555
+ if ("boolean" === typeof value) return value;
1556
+ if ("number" === typeof value)
1557
+ return Number.isFinite(value)
1558
+ ? 0 === value && -Infinity === 1 / value
1559
+ ? "$-0"
1560
+ : value
1561
+ : Infinity === value
1562
+ ? "$Infinity"
1563
+ : -Infinity === value
1564
+ ? "$-Infinity"
1565
+ : "$NaN";
1566
+ if ("undefined" === typeof value) return "$undefined";
1567
+ if ("function" === typeof value) {
1568
+ if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
1569
+ return serializeClientReference(
1570
+ request,
1571
+ parent,
1572
+ parentPropertyName,
1573
+ value
1574
+ );
1575
+ if (value.$$typeof === SERVER_REFERENCE_TAG)
1576
+ return (
1577
+ (task = request.writtenServerReferences),
1578
+ (parentPropertyName = task.get(value)),
1579
+ void 0 !== parentPropertyName
1580
+ ? (request = "$F" + parentPropertyName.toString(16))
1581
+ : ((parentPropertyName = value.$$bound),
1582
+ (parentPropertyName =
1583
+ null === parentPropertyName
1584
+ ? null
1585
+ : Promise.resolve(parentPropertyName)),
1586
+ (request = outlineModel(request, {
1587
+ id: value.$$id,
1588
+ bound: parentPropertyName
1589
+ })),
1590
+ task.set(value, request),
1591
+ (request = "$F" + request.toString(16))),
1592
+ request
1593
+ );
1594
+ if (
1595
+ void 0 !== request.temporaryReferences &&
1596
+ ((request = request.temporaryReferences.get(value)), void 0 !== request)
1597
+ )
1598
+ return "$T" + request;
1599
+ if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
1600
+ throw Error(
1601
+ "Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
1602
+ );
1603
+ if (/^on[A-Z]/.test(parentPropertyName))
1604
+ throw Error(
1605
+ "Event handlers cannot be passed to Client Component props." +
1606
+ describeObjectForErrorMessage(parent, parentPropertyName) +
1607
+ "\nIf you need interactivity, consider converting part of this to a Client Component."
1608
+ );
1609
+ throw Error(
1610
+ 'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
1611
+ describeObjectForErrorMessage(parent, parentPropertyName)
1612
+ );
1613
+ }
1614
+ if ("symbol" === typeof value) {
1615
+ task = request.writtenSymbols;
1616
+ elementReference = task.get(value);
1617
+ if (void 0 !== elementReference)
1618
+ return serializeByValueID(elementReference);
1619
+ elementReference = value.description;
1620
+ if (Symbol.for(elementReference) !== value)
1621
+ throw Error(
1622
+ "Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
1623
+ (value.description + ") cannot be found among global symbols.") +
1624
+ describeObjectForErrorMessage(parent, parentPropertyName)
1625
+ );
1626
+ request.pendingChunks++;
1627
+ parentPropertyName = request.nextChunkId++;
1628
+ parent = encodeReferenceChunk(
1629
+ request,
1630
+ parentPropertyName,
1631
+ "$S" + elementReference
1632
+ );
1633
+ request.completedImportChunks.push(parent);
1634
+ task.set(value, parentPropertyName);
1635
+ return serializeByValueID(parentPropertyName);
1636
+ }
1637
+ if ("bigint" === typeof value) return "$n" + value.toString(10);
1638
+ throw Error(
1639
+ "Type " +
1640
+ typeof value +
1641
+ " is not supported in Client Component props." +
1642
+ describeObjectForErrorMessage(parent, parentPropertyName)
1643
+ );
1644
+ }
1645
+ function logRecoverableError(request, error) {
1646
+ var prevRequest = currentRequest;
1647
+ currentRequest = null;
1648
+ try {
1649
+ var onError = request.onError;
1650
+ var errorDigest = supportsRequestStorage
1651
+ ? requestStorage.run(void 0, onError, error)
1652
+ : onError(error);
1653
+ } finally {
1654
+ currentRequest = prevRequest;
1655
+ }
1656
+ if (null != errorDigest && "string" !== typeof errorDigest)
1657
+ throw Error(
1658
+ 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' +
1659
+ typeof errorDigest +
1660
+ '" instead'
1661
+ );
1662
+ return errorDigest || "";
1663
+ }
1664
+ function fatalError(request, error) {
1665
+ var onFatalError = request.onFatalError;
1666
+ onFatalError(error);
1667
+ null !== request.destination
1668
+ ? ((request.status = 14), closeWithError(request.destination, error))
1669
+ : ((request.status = 13), (request.fatalError = error));
1670
+ }
1671
+ function emitErrorChunk(request, id, digest) {
1672
+ digest = { digest: digest };
1673
+ id = id.toString(16) + ":E" + stringify(digest) + "\n";
1674
+ id = stringToChunk(id);
1675
+ request.completedErrorChunks.push(id);
1676
+ }
1677
+ function emitModelChunk(request, id, json) {
1678
+ id = id.toString(16) + ":" + json + "\n";
1679
+ id = stringToChunk(id);
1680
+ request.completedRegularChunks.push(id);
1681
+ }
1682
+ function emitTypedArrayChunk(request, id, tag, typedArray) {
1683
+ request.pendingChunks++;
1684
+ var buffer = new Uint8Array(
1685
+ typedArray.buffer,
1686
+ typedArray.byteOffset,
1687
+ typedArray.byteLength
1688
+ );
1689
+ typedArray = 2048 < typedArray.byteLength ? buffer.slice() : buffer;
1690
+ buffer = typedArray.byteLength;
1691
+ id = id.toString(16) + ":" + tag + buffer.toString(16) + ",";
1692
+ id = stringToChunk(id);
1693
+ request.completedRegularChunks.push(id, typedArray);
1694
+ }
1695
+ function emitTextChunk(request, id, text) {
1696
+ if (null === byteLengthOfChunk)
1697
+ throw Error(
1698
+ "Existence of byteLengthOfChunk should have already been checked. This is a bug in React."
1699
+ );
1700
+ request.pendingChunks++;
1701
+ text = stringToChunk(text);
1702
+ var binaryLength = text.byteLength;
1703
+ id = id.toString(16) + ":T" + binaryLength.toString(16) + ",";
1704
+ id = stringToChunk(id);
1705
+ request.completedRegularChunks.push(id, text);
1706
+ }
1707
+ function emitChunk(request, task, value) {
1708
+ var id = task.id;
1709
+ "string" === typeof value && null !== byteLengthOfChunk
1710
+ ? emitTextChunk(request, id, value)
1711
+ : value instanceof ArrayBuffer
1712
+ ? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
1713
+ : value instanceof Int8Array
1714
+ ? emitTypedArrayChunk(request, id, "O", value)
1715
+ : value instanceof Uint8Array
1716
+ ? emitTypedArrayChunk(request, id, "o", value)
1717
+ : value instanceof Uint8ClampedArray
1718
+ ? emitTypedArrayChunk(request, id, "U", value)
1719
+ : value instanceof Int16Array
1720
+ ? emitTypedArrayChunk(request, id, "S", value)
1721
+ : value instanceof Uint16Array
1722
+ ? emitTypedArrayChunk(request, id, "s", value)
1723
+ : value instanceof Int32Array
1724
+ ? emitTypedArrayChunk(request, id, "L", value)
1725
+ : value instanceof Uint32Array
1726
+ ? emitTypedArrayChunk(request, id, "l", value)
1727
+ : value instanceof Float32Array
1728
+ ? emitTypedArrayChunk(request, id, "G", value)
1729
+ : value instanceof Float64Array
1730
+ ? emitTypedArrayChunk(request, id, "g", value)
1731
+ : value instanceof BigInt64Array
1732
+ ? emitTypedArrayChunk(request, id, "M", value)
1733
+ : value instanceof BigUint64Array
1734
+ ? emitTypedArrayChunk(request, id, "m", value)
1735
+ : value instanceof DataView
1736
+ ? emitTypedArrayChunk(request, id, "V", value)
1737
+ : ((value = stringify(value, task.toJSON)),
1738
+ emitModelChunk(request, task.id, value));
1739
+ }
1740
+ var emptyRoot = {};
1741
+ function retryTask(request, task) {
1742
+ if (0 === task.status) {
1743
+ task.status = 5;
1744
+ try {
1745
+ modelRoot = task.model;
1746
+ var resolvedModel = renderModelDestructive(
1747
+ request,
1748
+ task,
1749
+ emptyRoot,
1750
+ "",
1751
+ task.model
1752
+ );
1753
+ modelRoot = resolvedModel;
1754
+ task.keyPath = null;
1755
+ task.implicitSlot = !1;
1756
+ if ("object" === typeof resolvedModel && null !== resolvedModel)
1757
+ request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
1758
+ emitChunk(request, task, resolvedModel);
1759
+ else {
1760
+ var json = stringify(resolvedModel);
1761
+ emitModelChunk(request, task.id, json);
1762
+ }
1763
+ request.abortableTasks.delete(task);
1764
+ task.status = 1;
1765
+ } catch (thrownValue) {
1766
+ if (12 === request.status) {
1767
+ request.abortableTasks.delete(task);
1768
+ task.status = 3;
1769
+ var model = stringify(serializeByValueID(request.fatalError));
1770
+ emitModelChunk(request, task.id, model);
1771
+ } else {
1772
+ var x =
1773
+ thrownValue === SuspenseException
1774
+ ? getSuspendedThenable()
1775
+ : thrownValue;
1776
+ if (
1777
+ "object" === typeof x &&
1778
+ null !== x &&
1779
+ "function" === typeof x.then
1780
+ ) {
1781
+ task.status = 0;
1782
+ task.thenableState = getThenableStateAfterSuspending();
1783
+ var ping = task.ping;
1784
+ x.then(ping, ping);
1785
+ } else {
1786
+ request.abortableTasks.delete(task);
1787
+ task.status = 4;
1788
+ var digest = logRecoverableError(request, x, task);
1789
+ emitErrorChunk(request, task.id, digest);
1790
+ }
1791
+ }
1792
+ } finally {
1793
+ }
1794
+ }
1795
+ }
1796
+ function performWork(request) {
1797
+ var prevDispatcher = ReactSharedInternalsServer.H;
1798
+ ReactSharedInternalsServer.H = HooksDispatcher;
1799
+ var prevRequest = currentRequest;
1800
+ currentRequest$1 = currentRequest = request;
1801
+ var hadAbortableTasks = 0 < request.abortableTasks.size;
1802
+ try {
1803
+ var pingedTasks = request.pingedTasks;
1804
+ request.pingedTasks = [];
1805
+ for (var i = 0; i < pingedTasks.length; i++)
1806
+ retryTask(request, pingedTasks[i]);
1807
+ null !== request.destination &&
1808
+ flushCompletedChunks(request, request.destination);
1809
+ if (hadAbortableTasks && 0 === request.abortableTasks.size) {
1810
+ var onAllReady = request.onAllReady;
1811
+ onAllReady();
1812
+ }
1813
+ } catch (error) {
1814
+ logRecoverableError(request, error, null), fatalError(request, error);
1815
+ } finally {
1816
+ (ReactSharedInternalsServer.H = prevDispatcher),
1817
+ (currentRequest$1 = null),
1818
+ (currentRequest = prevRequest);
1819
+ }
1820
+ }
1821
+ function flushCompletedChunks(request, destination) {
1822
+ currentView = new Uint8Array(2048);
1823
+ writtenBytes = 0;
1824
+ try {
1825
+ for (
1826
+ var importsChunks = request.completedImportChunks, i = 0;
1827
+ i < importsChunks.length;
1828
+ i++
1829
+ )
1830
+ request.pendingChunks--,
1831
+ writeChunkAndReturn(destination, importsChunks[i]);
1832
+ importsChunks.splice(0, i);
1833
+ var hintChunks = request.completedHintChunks;
1834
+ for (i = 0; i < hintChunks.length; i++)
1835
+ writeChunkAndReturn(destination, hintChunks[i]);
1836
+ hintChunks.splice(0, i);
1837
+ var regularChunks = request.completedRegularChunks;
1838
+ for (i = 0; i < regularChunks.length; i++)
1839
+ request.pendingChunks--,
1840
+ writeChunkAndReturn(destination, regularChunks[i]);
1841
+ regularChunks.splice(0, i);
1842
+ var errorChunks = request.completedErrorChunks;
1843
+ for (i = 0; i < errorChunks.length; i++)
1844
+ request.pendingChunks--, writeChunkAndReturn(destination, errorChunks[i]);
1845
+ errorChunks.splice(0, i);
1846
+ } finally {
1847
+ (request.flushScheduled = !1),
1848
+ currentView &&
1849
+ 0 < writtenBytes &&
1850
+ (destination.enqueue(
1851
+ new Uint8Array(currentView.buffer, 0, writtenBytes)
1852
+ ),
1853
+ (currentView = null),
1854
+ (writtenBytes = 0));
1855
+ }
1856
+ 0 === request.pendingChunks &&
1857
+ ((request.status = 14), destination.close(), (request.destination = null));
1858
+ }
1859
+ function startWork(request) {
1860
+ request.flushScheduled = null !== request.destination;
1861
+ supportsRequestStorage
1862
+ ? scheduleMicrotask(function () {
1863
+ requestStorage.run(request, performWork, request);
1864
+ })
1865
+ : scheduleMicrotask(function () {
1866
+ return performWork(request);
1867
+ });
1868
+ setTimeout(function () {
1869
+ 10 === request.status && (request.status = 11);
1870
+ }, 0);
1871
+ }
1872
+ function enqueueFlush(request) {
1873
+ !1 === request.flushScheduled &&
1874
+ 0 === request.pingedTasks.length &&
1875
+ null !== request.destination &&
1876
+ ((request.flushScheduled = !0),
1877
+ setTimeout(function () {
1878
+ request.flushScheduled = !1;
1879
+ var destination = request.destination;
1880
+ destination && flushCompletedChunks(request, destination);
1881
+ }, 0));
1882
+ }
1883
+ function abort(request, reason) {
1884
+ try {
1885
+ 11 >= request.status && (request.status = 12);
1886
+ var abortableTasks = request.abortableTasks;
1887
+ if (0 < abortableTasks.size) {
1888
+ var error =
1889
+ void 0 === reason
1890
+ ? Error("The render was aborted by the server without a reason.")
1891
+ : "object" === typeof reason &&
1892
+ null !== reason &&
1893
+ "function" === typeof reason.then
1894
+ ? Error("The render was aborted by the server with a promise.")
1895
+ : reason,
1896
+ digest = logRecoverableError(request, error, null),
1897
+ errorId = request.nextChunkId++;
1898
+ request.fatalError = errorId;
1899
+ request.pendingChunks++;
1900
+ emitErrorChunk(request, errorId, digest, error);
1901
+ abortableTasks.forEach(function (task) {
1902
+ if (5 !== task.status) {
1903
+ task.status = 3;
1904
+ var ref = serializeByValueID(errorId);
1905
+ task = encodeReferenceChunk(request, task.id, ref);
1906
+ request.completedErrorChunks.push(task);
1907
+ }
1908
+ });
1909
+ abortableTasks.clear();
1910
+ var onAllReady = request.onAllReady;
1911
+ onAllReady();
1912
+ }
1913
+ var abortListeners = request.abortListeners;
1914
+ if (0 < abortListeners.size) {
1915
+ var error$23 =
1916
+ void 0 === reason
1917
+ ? Error("The render was aborted by the server without a reason.")
1918
+ : "object" === typeof reason &&
1919
+ null !== reason &&
1920
+ "function" === typeof reason.then
1921
+ ? Error("The render was aborted by the server with a promise.")
1922
+ : reason;
1923
+ abortListeners.forEach(function (callback) {
1924
+ return callback(error$23);
1925
+ });
1926
+ abortListeners.clear();
1927
+ }
1928
+ null !== request.destination &&
1929
+ flushCompletedChunks(request, request.destination);
1930
+ } catch (error$24) {
1931
+ logRecoverableError(request, error$24, null), fatalError(request, error$24);
1932
+ }
1933
+ }
1934
+ function resolveServerReference(bundlerConfig, id) {
1935
+ var name = "",
1936
+ resolvedModuleData = bundlerConfig[id];
1937
+ if (resolvedModuleData) name = resolvedModuleData.name;
1938
+ else {
1939
+ var idx = id.lastIndexOf("#");
1940
+ -1 !== idx &&
1941
+ ((name = id.slice(idx + 1)),
1942
+ (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));
1943
+ if (!resolvedModuleData)
1944
+ throw Error(
1945
+ 'Could not find the module "' +
1946
+ id +
1947
+ '" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'
1948
+ );
1949
+ }
1950
+ return resolvedModuleData.async
1951
+ ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
1952
+ : [resolvedModuleData.id, resolvedModuleData.chunks, name];
1953
+ }
1954
+ var chunkCache = new Map();
1955
+ function requireAsyncModule(id) {
1956
+ var promise = __webpack_require__(id);
1957
+ if ("function" !== typeof promise.then || "fulfilled" === promise.status)
1958
+ return null;
1959
+ promise.then(
1960
+ function (value) {
1961
+ promise.status = "fulfilled";
1962
+ promise.value = value;
1963
+ },
1964
+ function (reason) {
1965
+ promise.status = "rejected";
1966
+ promise.reason = reason;
1967
+ }
1968
+ );
1969
+ return promise;
1970
+ }
1971
+ function ignoreReject() {}
1972
+ function preloadModule(metadata) {
1973
+ for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {
1974
+ var chunkId = chunks[i++];
1975
+ chunks[i++];
1976
+ var entry = chunkCache.get(chunkId);
1977
+ if (void 0 === entry) {
1978
+ entry = __webpack_chunk_load__(chunkId);
1979
+ promises.push(entry);
1980
+ var resolve = chunkCache.set.bind(chunkCache, chunkId, null);
1981
+ entry.then(resolve, ignoreReject);
1982
+ chunkCache.set(chunkId, entry);
1983
+ } else null !== entry && promises.push(entry);
1984
+ }
1985
+ return 4 === metadata.length
1986
+ ? 0 === promises.length
1987
+ ? requireAsyncModule(metadata[0])
1988
+ : Promise.all(promises).then(function () {
1989
+ return requireAsyncModule(metadata[0]);
1990
+ })
1991
+ : 0 < promises.length
1992
+ ? Promise.all(promises)
1993
+ : null;
1994
+ }
1995
+ function requireModule(metadata) {
1996
+ var moduleExports = __webpack_require__(metadata[0]);
1997
+ if (4 === metadata.length && "function" === typeof moduleExports.then)
1998
+ if ("fulfilled" === moduleExports.status)
1999
+ moduleExports = moduleExports.value;
2000
+ else throw moduleExports.reason;
2001
+ return "*" === metadata[2]
2002
+ ? moduleExports
2003
+ : "" === metadata[2]
2004
+ ? moduleExports.__esModule
2005
+ ? moduleExports.default
2006
+ : moduleExports
2007
+ : moduleExports[metadata[2]];
2008
+ }
2009
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
2010
+ function Chunk(status, value, reason, response) {
2011
+ this.status = status;
2012
+ this.value = value;
2013
+ this.reason = reason;
2014
+ this._response = response;
2015
+ }
2016
+ Chunk.prototype = Object.create(Promise.prototype);
2017
+ Chunk.prototype.then = function (resolve, reject) {
2018
+ switch (this.status) {
2019
+ case "resolved_model":
2020
+ initializeModelChunk(this);
2021
+ }
2022
+ switch (this.status) {
2023
+ case "fulfilled":
2024
+ resolve(this.value);
2025
+ break;
2026
+ case "pending":
2027
+ case "blocked":
2028
+ case "cyclic":
2029
+ resolve &&
2030
+ (null === this.value && (this.value = []), this.value.push(resolve));
2031
+ reject &&
2032
+ (null === this.reason && (this.reason = []), this.reason.push(reject));
2033
+ break;
2034
+ default:
2035
+ reject(this.reason);
2036
+ }
2037
+ };
2038
+ function createPendingChunk(response) {
2039
+ return new Chunk("pending", null, null, response);
2040
+ }
2041
+ function wakeChunk(listeners, value) {
2042
+ for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
2043
+ }
2044
+ function triggerErrorOnChunk(chunk, error) {
2045
+ if ("pending" !== chunk.status && "blocked" !== chunk.status)
2046
+ chunk.reason.error(error);
2047
+ else {
2048
+ var listeners = chunk.reason;
2049
+ chunk.status = "rejected";
2050
+ chunk.reason = error;
2051
+ null !== listeners && wakeChunk(listeners, error);
2052
+ }
2053
+ }
2054
+ function resolveModelChunk(chunk, value, id) {
2055
+ if ("pending" !== chunk.status)
2056
+ (chunk = chunk.reason),
2057
+ "C" === value[0]
2058
+ ? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
2059
+ : chunk.enqueueModel(value);
2060
+ else {
2061
+ var resolveListeners = chunk.value,
2062
+ rejectListeners = chunk.reason;
2063
+ chunk.status = "resolved_model";
2064
+ chunk.value = value;
2065
+ chunk.reason = id;
2066
+ if (null !== resolveListeners)
2067
+ switch ((initializeModelChunk(chunk), chunk.status)) {
2068
+ case "fulfilled":
2069
+ wakeChunk(resolveListeners, chunk.value);
2070
+ break;
2071
+ case "pending":
2072
+ case "blocked":
2073
+ case "cyclic":
2074
+ if (chunk.value)
2075
+ for (value = 0; value < resolveListeners.length; value++)
2076
+ chunk.value.push(resolveListeners[value]);
2077
+ else chunk.value = resolveListeners;
2078
+ if (chunk.reason) {
2079
+ if (rejectListeners)
2080
+ for (value = 0; value < rejectListeners.length; value++)
2081
+ chunk.reason.push(rejectListeners[value]);
2082
+ } else chunk.reason = rejectListeners;
2083
+ break;
2084
+ case "rejected":
2085
+ rejectListeners && wakeChunk(rejectListeners, chunk.reason);
2086
+ }
2087
+ }
2088
+ }
2089
+ function createResolvedIteratorResultChunk(response, value, done) {
2090
+ return new Chunk(
2091
+ "resolved_model",
2092
+ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
2093
+ -1,
2094
+ response
2095
+ );
2096
+ }
2097
+ function resolveIteratorResultChunk(chunk, value, done) {
2098
+ resolveModelChunk(
2099
+ chunk,
2100
+ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
2101
+ -1
2102
+ );
2103
+ }
2104
+ function loadServerReference$1(
2105
+ response,
2106
+ id,
2107
+ bound,
2108
+ parentChunk,
2109
+ parentObject,
2110
+ key
2111
+ ) {
2112
+ var serverReference = resolveServerReference(response._bundlerConfig, id);
2113
+ id = preloadModule(serverReference);
2114
+ if (bound)
2115
+ bound = Promise.all([bound, id]).then(function (_ref) {
2116
+ _ref = _ref[0];
2117
+ var fn = requireModule(serverReference);
2118
+ return fn.bind.apply(fn, [null].concat(_ref));
2119
+ });
2120
+ else if (id)
2121
+ bound = Promise.resolve(id).then(function () {
2122
+ return requireModule(serverReference);
2123
+ });
2124
+ else return requireModule(serverReference);
2125
+ bound.then(
2126
+ createModelResolver(
2127
+ parentChunk,
2128
+ parentObject,
2129
+ key,
2130
+ !1,
2131
+ response,
2132
+ createModel,
2133
+ []
2134
+ ),
2135
+ createModelReject(parentChunk)
2136
+ );
2137
+ return null;
2138
+ }
2139
+ function reviveModel(response, parentObj, parentKey, value, reference) {
2140
+ if ("string" === typeof value)
2141
+ return parseModelString(response, parentObj, parentKey, value, reference);
2142
+ if ("object" === typeof value && null !== value)
2143
+ if (
2144
+ (void 0 !== reference &&
2145
+ void 0 !== response._temporaryReferences &&
2146
+ response._temporaryReferences.set(value, reference),
2147
+ Array.isArray(value))
2148
+ )
2149
+ for (var i = 0; i < value.length; i++)
2150
+ value[i] = reviveModel(
2151
+ response,
2152
+ value,
2153
+ "" + i,
2154
+ value[i],
2155
+ void 0 !== reference ? reference + ":" + i : void 0
2156
+ );
2157
+ else
2158
+ for (i in value)
2159
+ hasOwnProperty.call(value, i) &&
2160
+ ((parentObj =
2161
+ void 0 !== reference && -1 === i.indexOf(":")
2162
+ ? reference + ":" + i
2163
+ : void 0),
2164
+ (parentObj = reviveModel(response, value, i, value[i], parentObj)),
2165
+ void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);
2166
+ return value;
2167
+ }
2168
+ var initializingChunk = null,
2169
+ initializingChunkBlockedModel = null;
2170
+ function initializeModelChunk(chunk) {
2171
+ var prevChunk = initializingChunk,
2172
+ prevBlocked = initializingChunkBlockedModel;
2173
+ initializingChunk = chunk;
2174
+ initializingChunkBlockedModel = null;
2175
+ var rootReference = -1 === chunk.reason ? void 0 : chunk.reason.toString(16),
2176
+ resolvedModel = chunk.value;
2177
+ chunk.status = "cyclic";
2178
+ chunk.value = null;
2179
+ chunk.reason = null;
2180
+ try {
2181
+ var rawModel = JSON.parse(resolvedModel),
2182
+ value = reviveModel(
2183
+ chunk._response,
2184
+ { "": rawModel },
2185
+ "",
2186
+ rawModel,
2187
+ rootReference
2188
+ );
2189
+ if (
2190
+ null !== initializingChunkBlockedModel &&
2191
+ 0 < initializingChunkBlockedModel.deps
2192
+ )
2193
+ (initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
2194
+ else {
2195
+ var resolveListeners = chunk.value;
2196
+ chunk.status = "fulfilled";
2197
+ chunk.value = value;
2198
+ null !== resolveListeners && wakeChunk(resolveListeners, value);
2199
+ }
2200
+ } catch (error) {
2201
+ (chunk.status = "rejected"), (chunk.reason = error);
2202
+ } finally {
2203
+ (initializingChunk = prevChunk),
2204
+ (initializingChunkBlockedModel = prevBlocked);
2205
+ }
2206
+ }
2207
+ function reportGlobalError(response, error) {
2208
+ response._chunks.forEach(function (chunk) {
2209
+ "pending" === chunk.status && triggerErrorOnChunk(chunk, error);
2210
+ });
2211
+ }
2212
+ function getChunk(response, id) {
2213
+ var chunks = response._chunks,
2214
+ chunk = chunks.get(id);
2215
+ chunk ||
2216
+ ((chunk = response._formData.get(response._prefix + id)),
2217
+ (chunk =
2218
+ null != chunk
2219
+ ? new Chunk("resolved_model", chunk, id, response)
2220
+ : createPendingChunk(response)),
2221
+ chunks.set(id, chunk));
2222
+ return chunk;
2223
+ }
2224
+ function createModelResolver(
2225
+ chunk,
2226
+ parentObject,
2227
+ key,
2228
+ cyclic,
2229
+ response,
2230
+ map,
2231
+ path
2232
+ ) {
2233
+ if (initializingChunkBlockedModel) {
2234
+ var blocked = initializingChunkBlockedModel;
2235
+ cyclic || blocked.deps++;
2236
+ } else
2237
+ blocked = initializingChunkBlockedModel = {
2238
+ deps: cyclic ? 0 : 1,
2239
+ value: null
2240
+ };
2241
+ return function (value) {
2242
+ for (var i = 1; i < path.length; i++) value = value[path[i]];
2243
+ parentObject[key] = map(response, value);
2244
+ "" === key && null === blocked.value && (blocked.value = parentObject[key]);
2245
+ blocked.deps--;
2246
+ 0 === blocked.deps &&
2247
+ "blocked" === chunk.status &&
2248
+ ((value = chunk.value),
2249
+ (chunk.status = "fulfilled"),
2250
+ (chunk.value = blocked.value),
2251
+ null !== value && wakeChunk(value, blocked.value));
2252
+ };
2253
+ }
2254
+ function createModelReject(chunk) {
2255
+ return function (error) {
2256
+ return triggerErrorOnChunk(chunk, error);
2257
+ };
2258
+ }
2259
+ function getOutlinedModel(response, reference, parentObject, key, map) {
2260
+ reference = reference.split(":");
2261
+ var id = parseInt(reference[0], 16);
2262
+ id = getChunk(response, id);
2263
+ switch (id.status) {
2264
+ case "resolved_model":
2265
+ initializeModelChunk(id);
2266
+ }
2267
+ switch (id.status) {
2268
+ case "fulfilled":
2269
+ parentObject = id.value;
2270
+ for (key = 1; key < reference.length; key++)
2271
+ parentObject = parentObject[reference[key]];
2272
+ return map(response, parentObject);
2273
+ case "pending":
2274
+ case "blocked":
2275
+ case "cyclic":
2276
+ var parentChunk = initializingChunk;
2277
+ id.then(
2278
+ createModelResolver(
2279
+ parentChunk,
2280
+ parentObject,
2281
+ key,
2282
+ "cyclic" === id.status,
2283
+ response,
2284
+ map,
2285
+ reference
2286
+ ),
2287
+ createModelReject(parentChunk)
2288
+ );
2289
+ return null;
2290
+ default:
2291
+ throw id.reason;
2292
+ }
2293
+ }
2294
+ function createMap(response, model) {
2295
+ return new Map(model);
2296
+ }
2297
+ function createSet(response, model) {
2298
+ return new Set(model);
2299
+ }
2300
+ function extractIterator(response, model) {
2301
+ return model[Symbol.iterator]();
2302
+ }
2303
+ function createModel(response, model) {
2304
+ return model;
2305
+ }
2306
+ function parseTypedArray(
2307
+ response,
2308
+ reference,
2309
+ constructor,
2310
+ bytesPerElement,
2311
+ parentObject,
2312
+ parentKey
2313
+ ) {
2314
+ reference = parseInt(reference.slice(2), 16);
2315
+ reference = response._formData.get(response._prefix + reference);
2316
+ reference =
2317
+ constructor === ArrayBuffer
2318
+ ? reference.arrayBuffer()
2319
+ : reference.arrayBuffer().then(function (buffer) {
2320
+ return new constructor(buffer);
2321
+ });
2322
+ bytesPerElement = initializingChunk;
2323
+ reference.then(
2324
+ createModelResolver(
2325
+ bytesPerElement,
2326
+ parentObject,
2327
+ parentKey,
2328
+ !1,
2329
+ response,
2330
+ createModel,
2331
+ []
2332
+ ),
2333
+ createModelReject(bytesPerElement)
2334
+ );
2335
+ return null;
2336
+ }
2337
+ function resolveStream(response, id, stream, controller) {
2338
+ var chunks = response._chunks;
2339
+ stream = new Chunk("fulfilled", stream, controller, response);
2340
+ chunks.set(id, stream);
2341
+ response = response._formData.getAll(response._prefix + id);
2342
+ for (id = 0; id < response.length; id++)
2343
+ (chunks = response[id]),
2344
+ "C" === chunks[0]
2345
+ ? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
2346
+ : controller.enqueueModel(chunks);
2347
+ }
2348
+ function parseReadableStream(response, reference, type) {
2349
+ reference = parseInt(reference.slice(2), 16);
2350
+ var controller = null;
2351
+ type = new ReadableStream({
2352
+ type: type,
2353
+ start: function (c) {
2354
+ controller = c;
2355
+ }
2356
+ });
2357
+ var previousBlockedChunk = null;
2358
+ resolveStream(response, reference, type, {
2359
+ enqueueModel: function (json) {
2360
+ if (null === previousBlockedChunk) {
2361
+ var chunk = new Chunk("resolved_model", json, -1, response);
2362
+ initializeModelChunk(chunk);
2363
+ "fulfilled" === chunk.status
2364
+ ? controller.enqueue(chunk.value)
2365
+ : (chunk.then(
2366
+ function (v) {
2367
+ return controller.enqueue(v);
2368
+ },
2369
+ function (e) {
2370
+ return controller.error(e);
2371
+ }
2372
+ ),
2373
+ (previousBlockedChunk = chunk));
2374
+ } else {
2375
+ chunk = previousBlockedChunk;
2376
+ var chunk$27 = createPendingChunk(response);
2377
+ chunk$27.then(
2378
+ function (v) {
2379
+ return controller.enqueue(v);
2380
+ },
2381
+ function (e) {
2382
+ return controller.error(e);
2383
+ }
2384
+ );
2385
+ previousBlockedChunk = chunk$27;
2386
+ chunk.then(function () {
2387
+ previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
2388
+ resolveModelChunk(chunk$27, json, -1);
2389
+ });
2390
+ }
2391
+ },
2392
+ close: function () {
2393
+ if (null === previousBlockedChunk) controller.close();
2394
+ else {
2395
+ var blockedChunk = previousBlockedChunk;
2396
+ previousBlockedChunk = null;
2397
+ blockedChunk.then(function () {
2398
+ return controller.close();
2399
+ });
2400
+ }
2401
+ },
2402
+ error: function (error) {
2403
+ if (null === previousBlockedChunk) controller.error(error);
2404
+ else {
2405
+ var blockedChunk = previousBlockedChunk;
2406
+ previousBlockedChunk = null;
2407
+ blockedChunk.then(function () {
2408
+ return controller.error(error);
2409
+ });
2410
+ }
2411
+ }
2412
+ });
2413
+ return type;
2414
+ }
2415
+ function asyncIterator() {
2416
+ return this;
2417
+ }
2418
+ function createIterator(next) {
2419
+ next = { next: next };
2420
+ next[ASYNC_ITERATOR] = asyncIterator;
2421
+ return next;
2422
+ }
2423
+ function parseAsyncIterable(response, reference, iterator) {
2424
+ reference = parseInt(reference.slice(2), 16);
2425
+ var buffer = [],
2426
+ closed = !1,
2427
+ nextWriteIndex = 0,
2428
+ $jscomp$compprop2 = {};
2429
+ $jscomp$compprop2 =
2430
+ (($jscomp$compprop2[ASYNC_ITERATOR] = function () {
2431
+ var nextReadIndex = 0;
2432
+ return createIterator(function (arg) {
2433
+ if (void 0 !== arg)
2434
+ throw Error(
2435
+ "Values cannot be passed to next() of AsyncIterables passed to Client Components."
2436
+ );
2437
+ if (nextReadIndex === buffer.length) {
2438
+ if (closed)
2439
+ return new Chunk(
2440
+ "fulfilled",
2441
+ { done: !0, value: void 0 },
2442
+ null,
2443
+ response
2444
+ );
2445
+ buffer[nextReadIndex] = createPendingChunk(response);
2446
+ }
2447
+ return buffer[nextReadIndex++];
2448
+ });
2449
+ }),
2450
+ $jscomp$compprop2);
2451
+ iterator = iterator ? $jscomp$compprop2[ASYNC_ITERATOR]() : $jscomp$compprop2;
2452
+ resolveStream(response, reference, iterator, {
2453
+ enqueueModel: function (value) {
2454
+ nextWriteIndex === buffer.length
2455
+ ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
2456
+ response,
2457
+ value,
2458
+ !1
2459
+ ))
2460
+ : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);
2461
+ nextWriteIndex++;
2462
+ },
2463
+ close: function (value) {
2464
+ closed = !0;
2465
+ nextWriteIndex === buffer.length
2466
+ ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
2467
+ response,
2468
+ value,
2469
+ !0
2470
+ ))
2471
+ : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);
2472
+ for (nextWriteIndex++; nextWriteIndex < buffer.length; )
2473
+ resolveIteratorResultChunk(
2474
+ buffer[nextWriteIndex++],
2475
+ '"$undefined"',
2476
+ !0
2477
+ );
2478
+ },
2479
+ error: function (error) {
2480
+ closed = !0;
2481
+ for (
2482
+ nextWriteIndex === buffer.length &&
2483
+ (buffer[nextWriteIndex] = createPendingChunk(response));
2484
+ nextWriteIndex < buffer.length;
2485
+
2486
+ )
2487
+ triggerErrorOnChunk(buffer[nextWriteIndex++], error);
2488
+ }
2489
+ });
2490
+ return iterator;
2491
+ }
2492
+ function parseModelString(response, obj, key, value, reference) {
2493
+ if ("$" === value[0]) {
2494
+ switch (value[1]) {
2495
+ case "$":
2496
+ return value.slice(1);
2497
+ case "@":
2498
+ return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
2499
+ case "F":
2500
+ return (
2501
+ (value = value.slice(2)),
2502
+ (value = getOutlinedModel(response, value, obj, key, createModel)),
2503
+ loadServerReference$1(
2504
+ response,
2505
+ value.id,
2506
+ value.bound,
2507
+ initializingChunk,
2508
+ obj,
2509
+ key
2510
+ )
2511
+ );
2512
+ case "T":
2513
+ if (void 0 === reference || void 0 === response._temporaryReferences)
2514
+ throw Error(
2515
+ "Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
2516
+ );
2517
+ return createTemporaryReference(
2518
+ response._temporaryReferences,
2519
+ reference
2520
+ );
2521
+ case "Q":
2522
+ return (
2523
+ (value = value.slice(2)),
2524
+ getOutlinedModel(response, value, obj, key, createMap)
2525
+ );
2526
+ case "W":
2527
+ return (
2528
+ (value = value.slice(2)),
2529
+ getOutlinedModel(response, value, obj, key, createSet)
2530
+ );
2531
+ case "K":
2532
+ obj = value.slice(2);
2533
+ var formPrefix = response._prefix + obj + "_",
2534
+ data = new FormData();
2535
+ response._formData.forEach(function (entry, entryKey) {
2536
+ entryKey.startsWith(formPrefix) &&
2537
+ data.append(entryKey.slice(formPrefix.length), entry);
2538
+ });
2539
+ return data;
2540
+ case "i":
2541
+ return (
2542
+ (value = value.slice(2)),
2543
+ getOutlinedModel(response, value, obj, key, extractIterator)
2544
+ );
2545
+ case "I":
2546
+ return Infinity;
2547
+ case "-":
2548
+ return "$-0" === value ? -0 : -Infinity;
2549
+ case "N":
2550
+ return NaN;
2551
+ case "u":
2552
+ return;
2553
+ case "D":
2554
+ return new Date(Date.parse(value.slice(2)));
2555
+ case "n":
2556
+ return BigInt(value.slice(2));
2557
+ }
2558
+ switch (value[1]) {
2559
+ case "A":
2560
+ return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
2561
+ case "O":
2562
+ return parseTypedArray(response, value, Int8Array, 1, obj, key);
2563
+ case "o":
2564
+ return parseTypedArray(response, value, Uint8Array, 1, obj, key);
2565
+ case "U":
2566
+ return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);
2567
+ case "S":
2568
+ return parseTypedArray(response, value, Int16Array, 2, obj, key);
2569
+ case "s":
2570
+ return parseTypedArray(response, value, Uint16Array, 2, obj, key);
2571
+ case "L":
2572
+ return parseTypedArray(response, value, Int32Array, 4, obj, key);
2573
+ case "l":
2574
+ return parseTypedArray(response, value, Uint32Array, 4, obj, key);
2575
+ case "G":
2576
+ return parseTypedArray(response, value, Float32Array, 4, obj, key);
2577
+ case "g":
2578
+ return parseTypedArray(response, value, Float64Array, 8, obj, key);
2579
+ case "M":
2580
+ return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
2581
+ case "m":
2582
+ return parseTypedArray(response, value, BigUint64Array, 8, obj, key);
2583
+ case "V":
2584
+ return parseTypedArray(response, value, DataView, 1, obj, key);
2585
+ case "B":
2586
+ return (
2587
+ (obj = parseInt(value.slice(2), 16)),
2588
+ response._formData.get(response._prefix + obj)
2589
+ );
2590
+ }
2591
+ switch (value[1]) {
2592
+ case "R":
2593
+ return parseReadableStream(response, value, void 0);
2594
+ case "r":
2595
+ return parseReadableStream(response, value, "bytes");
2596
+ case "X":
2597
+ return parseAsyncIterable(response, value, !1);
2598
+ case "x":
2599
+ return parseAsyncIterable(response, value, !0);
2600
+ }
2601
+ value = value.slice(1);
2602
+ return getOutlinedModel(response, value, obj, key, createModel);
2603
+ }
2604
+ return value;
2605
+ }
2606
+ function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
2607
+ var backingFormData =
2608
+ 3 < arguments.length && void 0 !== arguments[3]
2609
+ ? arguments[3]
2610
+ : new FormData(),
2611
+ chunks = new Map();
2612
+ return {
2613
+ _bundlerConfig: bundlerConfig,
2614
+ _prefix: formFieldPrefix,
2615
+ _formData: backingFormData,
2616
+ _chunks: chunks,
2617
+ _temporaryReferences: temporaryReferences
2618
+ };
2619
+ }
2620
+ function close(response) {
2621
+ reportGlobalError(response, Error("Connection closed."));
2622
+ }
2623
+ function loadServerReference(bundlerConfig, id, bound) {
2624
+ var serverReference = resolveServerReference(bundlerConfig, id);
2625
+ bundlerConfig = preloadModule(serverReference);
2626
+ return bound
2627
+ ? Promise.all([bound, bundlerConfig]).then(function (_ref) {
2628
+ _ref = _ref[0];
2629
+ var fn = requireModule(serverReference);
2630
+ return fn.bind.apply(fn, [null].concat(_ref));
2631
+ })
2632
+ : bundlerConfig
2633
+ ? Promise.resolve(bundlerConfig).then(function () {
2634
+ return requireModule(serverReference);
2635
+ })
2636
+ : Promise.resolve(requireModule(serverReference));
2637
+ }
2638
+ function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
2639
+ body = createResponse(serverManifest, formFieldPrefix, void 0, body);
2640
+ close(body);
2641
+ body = getChunk(body, 0);
2642
+ body.then(function () {});
2643
+ if ("fulfilled" !== body.status) throw body.reason;
2644
+ return body.value;
2645
+ }
2646
+ exports.createClientModuleProxy = function (moduleId) {
2647
+ moduleId = registerClientReferenceImpl({}, moduleId, !1);
2648
+ return new Proxy(moduleId, proxyHandlers$1);
2649
+ };
2650
+ exports.createTemporaryReferenceSet = function () {
2651
+ return new WeakMap();
2652
+ };
2653
+ exports.decodeAction = function (body, serverManifest) {
2654
+ var formData = new FormData(),
2655
+ action = null;
2656
+ body.forEach(function (value, key) {
2657
+ key.startsWith("$ACTION_")
2658
+ ? key.startsWith("$ACTION_REF_")
2659
+ ? ((value = "$ACTION_" + key.slice(12) + ":"),
2660
+ (value = decodeBoundActionMetaData(body, serverManifest, value)),
2661
+ (action = loadServerReference(serverManifest, value.id, value.bound)))
2662
+ : key.startsWith("$ACTION_ID_") &&
2663
+ ((value = key.slice(11)),
2664
+ (action = loadServerReference(serverManifest, value, null)))
2665
+ : formData.append(key, value);
2666
+ });
2667
+ return null === action
2668
+ ? null
2669
+ : action.then(function (fn) {
2670
+ return fn.bind(null, formData);
2671
+ });
2672
+ };
2673
+ exports.decodeFormState = function (actionResult, body, serverManifest) {
2674
+ var keyPath = body.get("$ACTION_KEY");
2675
+ if ("string" !== typeof keyPath) return Promise.resolve(null);
2676
+ var metaData = null;
2677
+ body.forEach(function (value, key) {
2678
+ key.startsWith("$ACTION_REF_") &&
2679
+ ((value = "$ACTION_" + key.slice(12) + ":"),
2680
+ (metaData = decodeBoundActionMetaData(body, serverManifest, value)));
2681
+ });
2682
+ if (null === metaData) return Promise.resolve(null);
2683
+ var referenceId = metaData.id;
2684
+ return Promise.resolve(metaData.bound).then(function (bound) {
2685
+ return null === bound
2686
+ ? null
2687
+ : [actionResult, keyPath, referenceId, bound.length - 1];
2688
+ });
2689
+ };
2690
+ exports.decodeReply = function (body, webpackMap, options) {
2691
+ if ("string" === typeof body) {
2692
+ var form = new FormData();
2693
+ form.append("0", body);
2694
+ body = form;
2695
+ }
2696
+ body = createResponse(
2697
+ webpackMap,
2698
+ "",
2699
+ options ? options.temporaryReferences : void 0,
2700
+ body
2701
+ );
2702
+ webpackMap = getChunk(body, 0);
2703
+ close(body);
2704
+ return webpackMap;
2705
+ };
2706
+ exports.registerClientReference = function (
2707
+ proxyImplementation,
2708
+ id,
2709
+ exportName
2710
+ ) {
2711
+ return registerClientReferenceImpl(
2712
+ proxyImplementation,
2713
+ id + "#" + exportName,
2714
+ !1
2715
+ );
2716
+ };
2717
+ exports.registerServerReference = function (reference, id, exportName) {
2718
+ return Object.defineProperties(reference, {
2719
+ $$typeof: { value: SERVER_REFERENCE_TAG },
2720
+ $$id: {
2721
+ value: null === exportName ? id : id + "#" + exportName,
2722
+ configurable: !0
2723
+ },
2724
+ $$bound: { value: null, configurable: !0 },
2725
+ bind: { value: bind, configurable: !0 }
2726
+ });
2727
+ };
2728
+ exports.renderToReadableStream = function (model, webpackMap, options) {
2729
+ var request = new RequestInstance(
2730
+ 20,
2731
+ model,
2732
+ webpackMap,
2733
+ options ? options.onError : void 0,
2734
+ options ? options.identifierPrefix : void 0,
2735
+ options ? options.onPostpone : void 0,
2736
+ options ? options.temporaryReferences : void 0,
2737
+ void 0,
2738
+ void 0,
2739
+ noop,
2740
+ noop
2741
+ );
2742
+ if (options && options.signal) {
2743
+ var signal = options.signal;
2744
+ if (signal.aborted) abort(request, signal.reason);
2745
+ else {
2746
+ var listener = function () {
2747
+ abort(request, signal.reason);
2748
+ signal.removeEventListener("abort", listener);
2749
+ };
2750
+ signal.addEventListener("abort", listener);
2751
+ }
2752
+ }
2753
+ return new ReadableStream(
2754
+ {
2755
+ type: "bytes",
2756
+ start: function () {
2757
+ startWork(request);
2758
+ },
2759
+ pull: function (controller) {
2760
+ if (13 === request.status)
2761
+ (request.status = 14), closeWithError(controller, request.fatalError);
2762
+ else if (14 !== request.status && null === request.destination) {
2763
+ request.destination = controller;
2764
+ try {
2765
+ flushCompletedChunks(request, controller);
2766
+ } catch (error) {
2767
+ logRecoverableError(request, error, null),
2768
+ fatalError(request, error);
2769
+ }
2770
+ }
2771
+ },
2772
+ cancel: function (reason) {
2773
+ request.destination = null;
2774
+ abort(request, reason);
2775
+ }
2776
+ },
2777
+ { highWaterMark: 0 }
2778
+ );
2779
+ };