react-dom 19.1.0 → 19.2.4

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.
@@ -40,7 +40,6 @@ var React = require("react"),
40
40
  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
41
41
  REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
42
42
  REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
43
- REACT_PROVIDER_TYPE = Symbol.for("react.provider"),
44
43
  REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
45
44
  REACT_CONTEXT_TYPE = Symbol.for("react.context"),
46
45
  REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
@@ -53,8 +52,15 @@ var React = require("react"),
53
52
  REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
54
53
  REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
55
54
  REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
56
- MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
57
- isArrayImpl = Array.isArray;
55
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
56
+ function getIteratorFn(maybeIterable) {
57
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
58
+ maybeIterable =
59
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
60
+ maybeIterable["@@iterator"];
61
+ return "function" === typeof maybeIterable ? maybeIterable : null;
62
+ }
63
+ var isArrayImpl = Array.isArray;
58
64
  function murmurhash3_32_gc(key, seed) {
59
65
  var remainder = key.length & 3;
60
66
  var bytes = key.length - remainder;
@@ -166,6 +172,9 @@ function stringToChunk(content) {
166
172
  function stringToPrecomputedChunk(content) {
167
173
  return textEncoder.encode(content);
168
174
  }
175
+ function byteLengthOfChunk(chunk) {
176
+ return chunk.byteLength;
177
+ }
169
178
  function closeWithError(destination, error) {
170
179
  "function" === typeof destination.error
171
180
  ? destination.error(error)
@@ -345,16 +354,18 @@ ReactDOMSharedInternals.d = {
345
354
  S: preinitStyle,
346
355
  M: preinitModuleScript
347
356
  };
348
- var PRELOAD_NO_CREDS = [];
357
+ var PRELOAD_NO_CREDS = [],
358
+ currentlyFlushingRenderState = null;
349
359
  stringToPrecomputedChunk('"></template>');
350
- var startInlineScript = stringToPrecomputedChunk("<script>"),
360
+ var startInlineScript = stringToPrecomputedChunk("<script"),
351
361
  endInlineScript = stringToPrecomputedChunk("\x3c/script>"),
352
362
  startScriptSrc = stringToPrecomputedChunk('<script src="'),
353
363
  startModuleSrc = stringToPrecomputedChunk('<script type="module" src="'),
354
- scriptNonce = stringToPrecomputedChunk('" nonce="'),
355
- scriptIntegirty = stringToPrecomputedChunk('" integrity="'),
356
- scriptCrossOrigin = stringToPrecomputedChunk('" crossorigin="'),
357
- endAsyncScript = stringToPrecomputedChunk('" async="">\x3c/script>'),
364
+ scriptNonce = stringToPrecomputedChunk(' nonce="'),
365
+ scriptIntegirty = stringToPrecomputedChunk(' integrity="'),
366
+ scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin="'),
367
+ endAsyncScript = stringToPrecomputedChunk(' async="">\x3c/script>'),
368
+ startInlineStyle = stringToPrecomputedChunk("<style"),
358
369
  scriptRegex = /(<\/|<)(s)(cript)/gi;
359
370
  function scriptReplacer(match, prefix, s, suffix) {
360
371
  return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
@@ -371,25 +382,38 @@ function createRenderState(
371
382
  onHeaders,
372
383
  maxHeadersLength
373
384
  ) {
385
+ externalRuntimeConfig =
386
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
374
387
  var inlineScriptWithNonce =
375
- void 0 === nonce
388
+ void 0 === externalRuntimeConfig
376
389
  ? startInlineScript
377
390
  : stringToPrecomputedChunk(
378
- '<script nonce="' + escapeTextForBrowser(nonce) + '">'
391
+ '<script nonce="' +
392
+ escapeTextForBrowser(externalRuntimeConfig) +
393
+ '"'
394
+ ),
395
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
396
+ inlineStyleWithNonce =
397
+ void 0 === nonceStyle
398
+ ? startInlineStyle
399
+ : stringToPrecomputedChunk(
400
+ '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"'
379
401
  ),
380
- idPrefix = resumableState.idPrefix;
381
- externalRuntimeConfig = [];
382
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
402
+ idPrefix = resumableState.idPrefix,
403
+ bootstrapChunks = [],
404
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
383
405
  bootstrapScripts = resumableState.bootstrapScripts,
384
406
  bootstrapModules = resumableState.bootstrapModules;
385
407
  void 0 !== bootstrapScriptContent &&
386
- externalRuntimeConfig.push(
387
- inlineScriptWithNonce,
408
+ (bootstrapChunks.push(inlineScriptWithNonce),
409
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
410
+ bootstrapChunks.push(
411
+ endOfStartTag,
388
412
  stringToChunk(
389
413
  ("" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer)
390
414
  ),
391
415
  endInlineScript
392
- );
416
+ ));
393
417
  bootstrapScriptContent = [];
394
418
  void 0 !== importMap &&
395
419
  (bootstrapScriptContent.push(importMapScriptStart),
@@ -413,9 +437,10 @@ function createRenderState(
413
437
  segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"),
414
438
  boundaryPrefix: stringToPrecomputedChunk(idPrefix + "B:"),
415
439
  startInlineScript: inlineScriptWithNonce,
440
+ startInlineStyle: inlineStyleWithNonce,
416
441
  preamble: createPreambleState(),
417
442
  externalRuntimeScript: null,
418
- bootstrapChunks: externalRuntimeConfig,
443
+ bootstrapChunks: bootstrapChunks,
419
444
  importMapChunks: bootstrapScriptContent,
420
445
  onHeaders: onHeaders,
421
446
  headers: importMap,
@@ -442,115 +467,119 @@ function createRenderState(
442
467
  scripts: new Map(),
443
468
  moduleScripts: new Map()
444
469
  },
445
- nonce: nonce,
470
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
446
471
  hoistableState: null,
447
472
  stylesToHoist: !1
448
473
  };
449
474
  if (void 0 !== bootstrapScripts)
450
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
451
- var scriptConfig = bootstrapScripts[importMap];
452
- idPrefix = inlineScriptWithNonce = void 0;
453
- bootstrapScriptContent = {
454
- rel: "preload",
455
- as: "script",
456
- fetchPriority: "low",
457
- nonce: nonce
458
- };
459
- "string" === typeof scriptConfig
460
- ? (bootstrapScriptContent.href = maxHeadersLength = scriptConfig)
461
- : ((bootstrapScriptContent.href = maxHeadersLength = scriptConfig.src),
462
- (bootstrapScriptContent.integrity = idPrefix =
463
- "string" === typeof scriptConfig.integrity
464
- ? scriptConfig.integrity
465
- : void 0),
466
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
467
- "string" === typeof scriptConfig || null == scriptConfig.crossOrigin
468
- ? void 0
469
- : "use-credentials" === scriptConfig.crossOrigin
470
- ? "use-credentials"
471
- : ""));
472
- scriptConfig = resumableState;
473
- var href = maxHeadersLength;
474
- scriptConfig.scriptResources[href] = null;
475
- scriptConfig.moduleScriptResources[href] = null;
476
- scriptConfig = [];
477
- pushLinkImpl(scriptConfig, bootstrapScriptContent);
478
- onHeaders.bootstrapScripts.add(scriptConfig);
479
- externalRuntimeConfig.push(
480
- startScriptSrc,
481
- stringToChunk(escapeTextForBrowser(maxHeadersLength))
482
- );
483
- nonce &&
484
- externalRuntimeConfig.push(
485
- scriptNonce,
486
- stringToChunk(escapeTextForBrowser(nonce))
487
- );
488
- "string" === typeof idPrefix &&
489
- externalRuntimeConfig.push(
490
- scriptIntegirty,
491
- stringToChunk(escapeTextForBrowser(idPrefix))
492
- );
493
- "string" === typeof inlineScriptWithNonce &&
494
- externalRuntimeConfig.push(
495
- scriptCrossOrigin,
496
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce))
497
- );
498
- externalRuntimeConfig.push(endAsyncScript);
499
- }
475
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
476
+ (idPrefix = bootstrapScripts[importMap]),
477
+ (nonceStyle = inlineScriptWithNonce = void 0),
478
+ (inlineStyleWithNonce = {
479
+ rel: "preload",
480
+ as: "script",
481
+ fetchPriority: "low",
482
+ nonce: nonce
483
+ }),
484
+ "string" === typeof idPrefix
485
+ ? (inlineStyleWithNonce.href = maxHeadersLength = idPrefix)
486
+ : ((inlineStyleWithNonce.href = maxHeadersLength = idPrefix.src),
487
+ (inlineStyleWithNonce.integrity = nonceStyle =
488
+ "string" === typeof idPrefix.integrity
489
+ ? idPrefix.integrity
490
+ : void 0),
491
+ (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
492
+ "string" === typeof idPrefix || null == idPrefix.crossOrigin
493
+ ? void 0
494
+ : "use-credentials" === idPrefix.crossOrigin
495
+ ? "use-credentials"
496
+ : "")),
497
+ (idPrefix = resumableState),
498
+ (bootstrapScriptContent = maxHeadersLength),
499
+ (idPrefix.scriptResources[bootstrapScriptContent] = null),
500
+ (idPrefix.moduleScriptResources[bootstrapScriptContent] = null),
501
+ (idPrefix = []),
502
+ pushLinkImpl(idPrefix, inlineStyleWithNonce),
503
+ onHeaders.bootstrapScripts.add(idPrefix),
504
+ bootstrapChunks.push(
505
+ startScriptSrc,
506
+ stringToChunk(escapeTextForBrowser(maxHeadersLength)),
507
+ attributeEnd
508
+ ),
509
+ externalRuntimeConfig &&
510
+ bootstrapChunks.push(
511
+ scriptNonce,
512
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
513
+ attributeEnd
514
+ ),
515
+ "string" === typeof nonceStyle &&
516
+ bootstrapChunks.push(
517
+ scriptIntegirty,
518
+ stringToChunk(escapeTextForBrowser(nonceStyle)),
519
+ attributeEnd
520
+ ),
521
+ "string" === typeof inlineScriptWithNonce &&
522
+ bootstrapChunks.push(
523
+ scriptCrossOrigin,
524
+ stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
525
+ attributeEnd
526
+ ),
527
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
528
+ bootstrapChunks.push(endAsyncScript);
500
529
  if (void 0 !== bootstrapModules)
501
- for (
502
- bootstrapScripts = 0;
503
- bootstrapScripts < bootstrapModules.length;
504
- bootstrapScripts++
505
- )
506
- (bootstrapScriptContent = bootstrapModules[bootstrapScripts]),
507
- (inlineScriptWithNonce = maxHeadersLength = void 0),
508
- (idPrefix = {
530
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
531
+ (nonceStyle = bootstrapModules[nonce]),
532
+ (maxHeadersLength = importMap = void 0),
533
+ (inlineScriptWithNonce = {
509
534
  rel: "modulepreload",
510
535
  fetchPriority: "low",
511
- nonce: nonce
536
+ nonce: externalRuntimeConfig
512
537
  }),
513
- "string" === typeof bootstrapScriptContent
514
- ? (idPrefix.href = importMap = bootstrapScriptContent)
515
- : ((idPrefix.href = importMap = bootstrapScriptContent.src),
516
- (idPrefix.integrity = inlineScriptWithNonce =
517
- "string" === typeof bootstrapScriptContent.integrity
518
- ? bootstrapScriptContent.integrity
538
+ "string" === typeof nonceStyle
539
+ ? (inlineScriptWithNonce.href = bootstrapScripts = nonceStyle)
540
+ : ((inlineScriptWithNonce.href = bootstrapScripts = nonceStyle.src),
541
+ (inlineScriptWithNonce.integrity = maxHeadersLength =
542
+ "string" === typeof nonceStyle.integrity
543
+ ? nonceStyle.integrity
519
544
  : void 0),
520
- (idPrefix.crossOrigin = maxHeadersLength =
521
- "string" === typeof bootstrapScriptContent ||
522
- null == bootstrapScriptContent.crossOrigin
545
+ (inlineScriptWithNonce.crossOrigin = importMap =
546
+ "string" === typeof nonceStyle || null == nonceStyle.crossOrigin
523
547
  ? void 0
524
- : "use-credentials" === bootstrapScriptContent.crossOrigin
548
+ : "use-credentials" === nonceStyle.crossOrigin
525
549
  ? "use-credentials"
526
550
  : "")),
527
- (bootstrapScriptContent = resumableState),
528
- (scriptConfig = importMap),
529
- (bootstrapScriptContent.scriptResources[scriptConfig] = null),
530
- (bootstrapScriptContent.moduleScriptResources[scriptConfig] = null),
531
- (bootstrapScriptContent = []),
532
- pushLinkImpl(bootstrapScriptContent, idPrefix),
533
- onHeaders.bootstrapScripts.add(bootstrapScriptContent),
534
- externalRuntimeConfig.push(
551
+ (nonceStyle = resumableState),
552
+ (inlineStyleWithNonce = bootstrapScripts),
553
+ (nonceStyle.scriptResources[inlineStyleWithNonce] = null),
554
+ (nonceStyle.moduleScriptResources[inlineStyleWithNonce] = null),
555
+ (nonceStyle = []),
556
+ pushLinkImpl(nonceStyle, inlineScriptWithNonce),
557
+ onHeaders.bootstrapScripts.add(nonceStyle),
558
+ bootstrapChunks.push(
535
559
  startModuleSrc,
536
- stringToChunk(escapeTextForBrowser(importMap))
560
+ stringToChunk(escapeTextForBrowser(bootstrapScripts)),
561
+ attributeEnd
537
562
  ),
538
- nonce &&
539
- externalRuntimeConfig.push(
563
+ externalRuntimeConfig &&
564
+ bootstrapChunks.push(
540
565
  scriptNonce,
541
- stringToChunk(escapeTextForBrowser(nonce))
566
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
567
+ attributeEnd
542
568
  ),
543
- "string" === typeof inlineScriptWithNonce &&
544
- externalRuntimeConfig.push(
569
+ "string" === typeof maxHeadersLength &&
570
+ bootstrapChunks.push(
545
571
  scriptIntegirty,
546
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce))
572
+ stringToChunk(escapeTextForBrowser(maxHeadersLength)),
573
+ attributeEnd
547
574
  ),
548
- "string" === typeof maxHeadersLength &&
549
- externalRuntimeConfig.push(
575
+ "string" === typeof importMap &&
576
+ bootstrapChunks.push(
550
577
  scriptCrossOrigin,
551
- stringToChunk(escapeTextForBrowser(maxHeadersLength))
578
+ stringToChunk(escapeTextForBrowser(importMap)),
579
+ attributeEnd
552
580
  ),
553
- externalRuntimeConfig.push(endAsyncScript);
581
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
582
+ bootstrapChunks.push(endAsyncScript);
554
583
  return onHeaders;
555
584
  }
556
585
  function createResumableState(
@@ -581,18 +610,19 @@ function createResumableState(
581
610
  };
582
611
  }
583
612
  function createPreambleState() {
584
- return {
585
- htmlChunks: null,
586
- headChunks: null,
587
- bodyChunks: null,
588
- contribution: 0
589
- };
613
+ return { htmlChunks: null, headChunks: null, bodyChunks: null };
590
614
  }
591
- function createFormatContext(insertionMode, selectedValue, tagScope) {
615
+ function createFormatContext(
616
+ insertionMode,
617
+ selectedValue,
618
+ tagScope,
619
+ viewTransition
620
+ ) {
592
621
  return {
593
622
  insertionMode: insertionMode,
594
623
  selectedValue: selectedValue,
595
- tagScope: tagScope
624
+ tagScope: tagScope,
625
+ viewTransition: viewTransition
596
626
  };
597
627
  }
598
628
  function createRootFormatContext(namespaceURI) {
@@ -603,48 +633,93 @@ function createRootFormatContext(namespaceURI) {
603
633
  ? 5
604
634
  : 0,
605
635
  null,
606
- 0
636
+ 0,
637
+ null
607
638
  );
608
639
  }
609
640
  function getChildFormatContext(parentContext, type, props) {
641
+ var subtreeScope = parentContext.tagScope & -25;
610
642
  switch (type) {
611
643
  case "noscript":
612
- return createFormatContext(2, null, parentContext.tagScope | 1);
644
+ return createFormatContext(2, null, subtreeScope | 1, null);
613
645
  case "select":
614
646
  return createFormatContext(
615
647
  2,
616
648
  null != props.value ? props.value : props.defaultValue,
617
- parentContext.tagScope
649
+ subtreeScope,
650
+ null
618
651
  );
619
652
  case "svg":
620
- return createFormatContext(4, null, parentContext.tagScope);
653
+ return createFormatContext(4, null, subtreeScope, null);
621
654
  case "picture":
622
- return createFormatContext(2, null, parentContext.tagScope | 2);
655
+ return createFormatContext(2, null, subtreeScope | 2, null);
623
656
  case "math":
624
- return createFormatContext(5, null, parentContext.tagScope);
657
+ return createFormatContext(5, null, subtreeScope, null);
625
658
  case "foreignObject":
626
- return createFormatContext(2, null, parentContext.tagScope);
659
+ return createFormatContext(2, null, subtreeScope, null);
627
660
  case "table":
628
- return createFormatContext(6, null, parentContext.tagScope);
661
+ return createFormatContext(6, null, subtreeScope, null);
629
662
  case "thead":
630
663
  case "tbody":
631
664
  case "tfoot":
632
- return createFormatContext(7, null, parentContext.tagScope);
665
+ return createFormatContext(7, null, subtreeScope, null);
633
666
  case "colgroup":
634
- return createFormatContext(9, null, parentContext.tagScope);
667
+ return createFormatContext(9, null, subtreeScope, null);
635
668
  case "tr":
636
- return createFormatContext(8, null, parentContext.tagScope);
669
+ return createFormatContext(8, null, subtreeScope, null);
637
670
  case "head":
638
671
  if (2 > parentContext.insertionMode)
639
- return createFormatContext(3, null, parentContext.tagScope);
672
+ return createFormatContext(3, null, subtreeScope, null);
640
673
  break;
641
674
  case "html":
642
675
  if (0 === parentContext.insertionMode)
643
- return createFormatContext(1, null, parentContext.tagScope);
676
+ return createFormatContext(1, null, subtreeScope, null);
644
677
  }
645
678
  return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
646
- ? createFormatContext(2, null, parentContext.tagScope)
647
- : parentContext;
679
+ ? createFormatContext(2, null, subtreeScope, null)
680
+ : parentContext.tagScope !== subtreeScope
681
+ ? createFormatContext(
682
+ parentContext.insertionMode,
683
+ parentContext.selectedValue,
684
+ subtreeScope,
685
+ null
686
+ )
687
+ : parentContext;
688
+ }
689
+ function getSuspenseViewTransition(parentViewTransition) {
690
+ return null === parentViewTransition
691
+ ? null
692
+ : {
693
+ update: parentViewTransition.update,
694
+ enter: "none",
695
+ exit: "none",
696
+ share: parentViewTransition.update,
697
+ name: parentViewTransition.autoName,
698
+ autoName: parentViewTransition.autoName,
699
+ nameIdx: 0
700
+ };
701
+ }
702
+ function getSuspenseFallbackFormatContext(resumableState, parentContext) {
703
+ parentContext.tagScope & 32 && (resumableState.instructions |= 128);
704
+ return createFormatContext(
705
+ parentContext.insertionMode,
706
+ parentContext.selectedValue,
707
+ parentContext.tagScope | 12,
708
+ getSuspenseViewTransition(parentContext.viewTransition)
709
+ );
710
+ }
711
+ function getSuspenseContentFormatContext(resumableState, parentContext) {
712
+ resumableState = getSuspenseViewTransition(parentContext.viewTransition);
713
+ var subtreeScope = parentContext.tagScope | 16;
714
+ null !== resumableState &&
715
+ "none" !== resumableState.share &&
716
+ (subtreeScope |= 64);
717
+ return createFormatContext(
718
+ parentContext.insertionMode,
719
+ parentContext.selectedValue,
720
+ subtreeScope,
721
+ resumableState
722
+ );
648
723
  }
649
724
  var textSeparator = stringToPrecomputedChunk("\x3c!-- --\x3e");
650
725
  function pushTextInstance(target, text, renderState, textEmbedded) {
@@ -1053,13 +1128,25 @@ var selectedMarkerAttribute = stringToPrecomputedChunk(' selected=""'),
1053
1128
  'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'
1054
1129
  );
1055
1130
  function injectFormReplayingRuntime(resumableState, renderState) {
1056
- 0 === (resumableState.instructions & 16) &&
1057
- ((resumableState.instructions |= 16),
1058
- renderState.bootstrapChunks.unshift(
1059
- renderState.startInlineScript,
1060
- formReplayingRuntimeScript,
1061
- endInlineScript
1062
- ));
1131
+ if (0 === (resumableState.instructions & 16)) {
1132
+ resumableState.instructions |= 16;
1133
+ var preamble = renderState.preamble,
1134
+ bootstrapChunks = renderState.bootstrapChunks;
1135
+ (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length
1136
+ ? (bootstrapChunks.push(renderState.startInlineScript),
1137
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1138
+ bootstrapChunks.push(
1139
+ endOfStartTag,
1140
+ formReplayingRuntimeScript,
1141
+ endInlineScript
1142
+ ))
1143
+ : bootstrapChunks.unshift(
1144
+ renderState.startInlineScript,
1145
+ endOfStartTag,
1146
+ formReplayingRuntimeScript,
1147
+ endInlineScript
1148
+ );
1149
+ }
1063
1150
  }
1064
1151
  var formStateMarkerIsMatching = stringToPrecomputedChunk("\x3c!--F!--\x3e"),
1065
1152
  formStateMarkerIsNotMatching = stringToPrecomputedChunk("\x3c!--F--\x3e");
@@ -1141,6 +1228,10 @@ function pushTitleImpl(target, props) {
1141
1228
  target.push(endChunkForTag("title"));
1142
1229
  return null;
1143
1230
  }
1231
+ var headPreambleContributionChunk =
1232
+ stringToPrecomputedChunk("\x3c!--head--\x3e"),
1233
+ bodyPreambleContributionChunk = stringToPrecomputedChunk("\x3c!--body--\x3e"),
1234
+ htmlPreambleContributionChunk = stringToPrecomputedChunk("\x3c!--html--\x3e");
1144
1235
  function pushScriptImpl(target, props) {
1145
1236
  target.push(startChunkForTag("script"));
1146
1237
  var children = null,
@@ -1240,8 +1331,7 @@ function pushStartInstance(
1240
1331
  preambleState,
1241
1332
  hoistableState,
1242
1333
  formatContext,
1243
- textEmbedded,
1244
- isFallback
1334
+ textEmbedded
1245
1335
  ) {
1246
1336
  switch (type) {
1247
1337
  case "div":
@@ -1724,9 +1814,11 @@ function pushStartInstance(
1724
1814
  } else JSCompiler_inline_result$jscomp$2 = children$jscomp$5;
1725
1815
  return JSCompiler_inline_result$jscomp$2;
1726
1816
  case "title":
1817
+ var noscriptTagInScope = formatContext.tagScope & 1,
1818
+ isFallback = formatContext.tagScope & 4;
1727
1819
  if (
1728
1820
  4 === formatContext.insertionMode ||
1729
- formatContext.tagScope & 1 ||
1821
+ noscriptTagInScope ||
1730
1822
  null != props.itemProp
1731
1823
  )
1732
1824
  var JSCompiler_inline_result$jscomp$3 = pushTitleImpl(
@@ -1740,12 +1832,14 @@ function pushStartInstance(
1740
1832
  (JSCompiler_inline_result$jscomp$3 = void 0));
1741
1833
  return JSCompiler_inline_result$jscomp$3;
1742
1834
  case "link":
1743
- var rel = props.rel,
1835
+ var noscriptTagInScope$jscomp$0 = formatContext.tagScope & 1,
1836
+ isFallback$jscomp$0 = formatContext.tagScope & 4,
1837
+ rel = props.rel,
1744
1838
  href = props.href,
1745
1839
  precedence = props.precedence;
1746
1840
  if (
1747
1841
  4 === formatContext.insertionMode ||
1748
- formatContext.tagScope & 1 ||
1842
+ noscriptTagInScope$jscomp$0 ||
1749
1843
  null != props.itemProp ||
1750
1844
  "string" !== typeof rel ||
1751
1845
  "string" !== typeof href ||
@@ -1812,12 +1906,13 @@ function pushStartInstance(
1812
1906
  props
1813
1907
  ))
1814
1908
  : (textEmbedded && target$jscomp$0.push(textSeparator),
1815
- (JSCompiler_inline_result$jscomp$4 = isFallback
1909
+ (JSCompiler_inline_result$jscomp$4 = isFallback$jscomp$0
1816
1910
  ? null
1817
1911
  : pushLinkImpl(renderState.hoistableChunks, props)));
1818
1912
  return JSCompiler_inline_result$jscomp$4;
1819
1913
  case "script":
1820
- var asyncProp = props.async;
1914
+ var noscriptTagInScope$jscomp$1 = formatContext.tagScope & 1,
1915
+ asyncProp = props.async;
1821
1916
  if (
1822
1917
  "string" !== typeof props.src ||
1823
1918
  !props.src ||
@@ -1827,7 +1922,7 @@ function pushStartInstance(
1827
1922
  props.onLoad ||
1828
1923
  props.onError ||
1829
1924
  4 === formatContext.insertionMode ||
1830
- formatContext.tagScope & 1 ||
1925
+ noscriptTagInScope$jscomp$1 ||
1831
1926
  null != props.itemProp
1832
1927
  )
1833
1928
  var JSCompiler_inline_result$jscomp$5 = pushScriptImpl(
@@ -1864,11 +1959,13 @@ function pushStartInstance(
1864
1959
  }
1865
1960
  return JSCompiler_inline_result$jscomp$5;
1866
1961
  case "style":
1867
- var precedence$jscomp$0 = props.precedence,
1868
- href$jscomp$0 = props.href;
1962
+ var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
1963
+ precedence$jscomp$0 = props.precedence,
1964
+ href$jscomp$0 = props.href,
1965
+ nonce = props.nonce;
1869
1966
  if (
1870
1967
  4 === formatContext.insertionMode ||
1871
- formatContext.tagScope & 1 ||
1968
+ noscriptTagInScope$jscomp$2 ||
1872
1969
  null != props.itemProp ||
1873
1970
  "string" !== typeof precedence$jscomp$0 ||
1874
1971
  "string" !== typeof href$jscomp$0 ||
@@ -1922,50 +2019,53 @@ function pushStartInstance(
1922
2019
  : void 0)
1923
2020
  ) {
1924
2021
  resumableState.styleResources[href$jscomp$0] = null;
1925
- styleQueue$jscomp$0
1926
- ? styleQueue$jscomp$0.hrefs.push(
1927
- stringToChunk(escapeTextForBrowser(href$jscomp$0))
1928
- )
1929
- : ((styleQueue$jscomp$0 = {
1930
- precedence: stringToChunk(
1931
- escapeTextForBrowser(precedence$jscomp$0)
1932
- ),
1933
- rules: [],
1934
- hrefs: [stringToChunk(escapeTextForBrowser(href$jscomp$0))],
1935
- sheets: new Map()
1936
- }),
1937
- renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
1938
- var target = styleQueue$jscomp$0.rules,
1939
- children$jscomp$7 = null,
1940
- innerHTML$jscomp$6 = null,
1941
- propKey$jscomp$9;
1942
- for (propKey$jscomp$9 in props)
1943
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
1944
- var propValue$jscomp$9 = props[propKey$jscomp$9];
1945
- if (null != propValue$jscomp$9)
1946
- switch (propKey$jscomp$9) {
1947
- case "children":
1948
- children$jscomp$7 = propValue$jscomp$9;
1949
- break;
1950
- case "dangerouslySetInnerHTML":
1951
- innerHTML$jscomp$6 = propValue$jscomp$9;
1952
- }
1953
- }
1954
- var child$jscomp$0 = Array.isArray(children$jscomp$7)
1955
- ? 2 > children$jscomp$7.length
1956
- ? children$jscomp$7[0]
1957
- : null
1958
- : children$jscomp$7;
1959
- "function" !== typeof child$jscomp$0 &&
1960
- "symbol" !== typeof child$jscomp$0 &&
1961
- null !== child$jscomp$0 &&
1962
- void 0 !== child$jscomp$0 &&
1963
- target.push(
1964
- stringToChunk(
1965
- ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
1966
- )
2022
+ styleQueue$jscomp$0 ||
2023
+ ((styleQueue$jscomp$0 = {
2024
+ precedence: stringToChunk(
2025
+ escapeTextForBrowser(precedence$jscomp$0)
2026
+ ),
2027
+ rules: [],
2028
+ hrefs: [],
2029
+ sheets: new Map()
2030
+ }),
2031
+ renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
2032
+ var nonceStyle = renderState.nonce.style;
2033
+ if (!nonceStyle || nonceStyle === nonce) {
2034
+ styleQueue$jscomp$0.hrefs.push(
2035
+ stringToChunk(escapeTextForBrowser(href$jscomp$0))
1967
2036
  );
1968
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
2037
+ var target = styleQueue$jscomp$0.rules,
2038
+ children$jscomp$7 = null,
2039
+ innerHTML$jscomp$6 = null,
2040
+ propKey$jscomp$9;
2041
+ for (propKey$jscomp$9 in props)
2042
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2043
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
2044
+ if (null != propValue$jscomp$9)
2045
+ switch (propKey$jscomp$9) {
2046
+ case "children":
2047
+ children$jscomp$7 = propValue$jscomp$9;
2048
+ break;
2049
+ case "dangerouslySetInnerHTML":
2050
+ innerHTML$jscomp$6 = propValue$jscomp$9;
2051
+ }
2052
+ }
2053
+ var child$jscomp$0 = Array.isArray(children$jscomp$7)
2054
+ ? 2 > children$jscomp$7.length
2055
+ ? children$jscomp$7[0]
2056
+ : null
2057
+ : children$jscomp$7;
2058
+ "function" !== typeof child$jscomp$0 &&
2059
+ "symbol" !== typeof child$jscomp$0 &&
2060
+ null !== child$jscomp$0 &&
2061
+ void 0 !== child$jscomp$0 &&
2062
+ target.push(
2063
+ stringToChunk(
2064
+ ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
2065
+ )
2066
+ );
2067
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
2068
+ }
1969
2069
  }
1970
2070
  styleQueue$jscomp$0 &&
1971
2071
  hoistableState &&
@@ -1975,9 +2075,11 @@ function pushStartInstance(
1975
2075
  }
1976
2076
  return JSCompiler_inline_result$jscomp$6;
1977
2077
  case "meta":
2078
+ var noscriptTagInScope$jscomp$3 = formatContext.tagScope & 1,
2079
+ isFallback$jscomp$1 = formatContext.tagScope & 4;
1978
2080
  if (
1979
2081
  4 === formatContext.insertionMode ||
1980
- formatContext.tagScope & 1 ||
2082
+ noscriptTagInScope$jscomp$3 ||
1981
2083
  null != props.itemProp
1982
2084
  )
1983
2085
  var JSCompiler_inline_result$jscomp$7 = pushSelfClosing(
@@ -1987,7 +2089,7 @@ function pushStartInstance(
1987
2089
  );
1988
2090
  else
1989
2091
  textEmbedded && target$jscomp$0.push(textSeparator),
1990
- (JSCompiler_inline_result$jscomp$7 = isFallback
2092
+ (JSCompiler_inline_result$jscomp$7 = isFallback$jscomp$1
1991
2093
  ? null
1992
2094
  : "string" === typeof props.charSet
1993
2095
  ? pushSelfClosing(renderState.charsetChunks, props, "meta")
@@ -2045,17 +2147,18 @@ function pushStartInstance(
2045
2147
  target$jscomp$0.push(leadingNewline);
2046
2148
  return children$jscomp$8;
2047
2149
  case "img":
2048
- var src = props.src,
2150
+ var pictureOrNoScriptTagInScope = formatContext.tagScope & 3,
2151
+ src = props.src,
2049
2152
  srcSet = props.srcSet;
2050
2153
  if (
2051
2154
  !(
2052
2155
  "lazy" === props.loading ||
2053
2156
  (!src && !srcSet) ||
2054
2157
  ("string" !== typeof src && null != src) ||
2055
- ("string" !== typeof srcSet && null != srcSet)
2158
+ ("string" !== typeof srcSet && null != srcSet) ||
2159
+ "low" === props.fetchPriority ||
2160
+ pictureOrNoScriptTagInScope
2056
2161
  ) &&
2057
- "low" !== props.fetchPriority &&
2058
- !1 === !!(formatContext.tagScope & 3) &&
2059
2162
  ("string" !== typeof src ||
2060
2163
  ":" !== src[4] ||
2061
2164
  ("d" !== src[0] && "D" !== src[0]) ||
@@ -2069,6 +2172,9 @@ function pushStartInstance(
2069
2172
  ("t" !== srcSet[2] && "T" !== srcSet[2]) ||
2070
2173
  ("a" !== srcSet[3] && "A" !== srcSet[3]))
2071
2174
  ) {
2175
+ null !== hoistableState &&
2176
+ formatContext.tagScope & 64 &&
2177
+ (hoistableState.suspenseyImages = !0);
2072
2178
  var sizes = "string" === typeof props.sizes ? props.sizes : void 0,
2073
2179
  key$jscomp$0 = srcSet ? srcSet + "\n" + (sizes || "") : src,
2074
2180
  promotablePreloads = renderState.preloads.images,
@@ -2159,6 +2265,8 @@ function pushStartInstance(
2159
2265
  var preamble = preambleState || renderState.preamble;
2160
2266
  if (preamble.headChunks)
2161
2267
  throw Error("The `<head>` tag may only be rendered once.");
2268
+ null !== preambleState &&
2269
+ target$jscomp$0.push(headPreambleContributionChunk);
2162
2270
  preamble.headChunks = [];
2163
2271
  var JSCompiler_inline_result$jscomp$9 = pushStartSingletonElement(
2164
2272
  preamble.headChunks,
@@ -2177,6 +2285,8 @@ function pushStartInstance(
2177
2285
  var preamble$jscomp$0 = preambleState || renderState.preamble;
2178
2286
  if (preamble$jscomp$0.bodyChunks)
2179
2287
  throw Error("The `<body>` tag may only be rendered once.");
2288
+ null !== preambleState &&
2289
+ target$jscomp$0.push(bodyPreambleContributionChunk);
2180
2290
  preamble$jscomp$0.bodyChunks = [];
2181
2291
  var JSCompiler_inline_result$jscomp$10 = pushStartSingletonElement(
2182
2292
  preamble$jscomp$0.bodyChunks,
@@ -2195,6 +2305,8 @@ function pushStartInstance(
2195
2305
  var preamble$jscomp$1 = preambleState || renderState.preamble;
2196
2306
  if (preamble$jscomp$1.htmlChunks)
2197
2307
  throw Error("The `<html>` tag may only be rendered once.");
2308
+ null !== preambleState &&
2309
+ target$jscomp$0.push(htmlPreambleContributionChunk);
2198
2310
  preamble$jscomp$1.htmlChunks = [doctypeChunk];
2199
2311
  var JSCompiler_inline_result$jscomp$11 = pushStartSingletonElement(
2200
2312
  preamble$jscomp$1.htmlChunks,
@@ -2274,16 +2386,13 @@ function hoistPreambleState(renderState, preambleState) {
2274
2386
  renderState = renderState.preamble;
2275
2387
  null === renderState.htmlChunks &&
2276
2388
  preambleState.htmlChunks &&
2277
- ((renderState.htmlChunks = preambleState.htmlChunks),
2278
- (preambleState.contribution |= 1));
2389
+ (renderState.htmlChunks = preambleState.htmlChunks);
2279
2390
  null === renderState.headChunks &&
2280
2391
  preambleState.headChunks &&
2281
- ((renderState.headChunks = preambleState.headChunks),
2282
- (preambleState.contribution |= 4));
2392
+ (renderState.headChunks = preambleState.headChunks);
2283
2393
  null === renderState.bodyChunks &&
2284
2394
  preambleState.bodyChunks &&
2285
- ((renderState.bodyChunks = preambleState.bodyChunks),
2286
- (preambleState.contribution |= 2));
2395
+ (renderState.bodyChunks = preambleState.bodyChunks);
2287
2396
  }
2288
2397
  function writeBootstrap(destination, renderState) {
2289
2398
  renderState = renderState.bootstrapChunks;
@@ -2295,8 +2404,13 @@ function writeBootstrap(destination, renderState) {
2295
2404
  writeChunkAndReturn(destination, i))
2296
2405
  : !0;
2297
2406
  }
2298
- var placeholder1 = stringToPrecomputedChunk('<template id="'),
2407
+ var shellTimeRuntimeScript = stringToPrecomputedChunk(
2408
+ "requestAnimationFrame(function(){$RT=performance.now()});"
2409
+ ),
2410
+ placeholder1 = stringToPrecomputedChunk('<template id="'),
2299
2411
  placeholder2 = stringToPrecomputedChunk('"></template>'),
2412
+ startActivityBoundary = stringToPrecomputedChunk("\x3c!--&--\x3e"),
2413
+ endActivityBoundary = stringToPrecomputedChunk("\x3c!--/&--\x3e"),
2300
2414
  startCompletedSuspenseBoundary = stringToPrecomputedChunk("\x3c!--$--\x3e"),
2301
2415
  startPendingSuspenseBoundary1 = stringToPrecomputedChunk(
2302
2416
  '\x3c!--$?--\x3e<template id="'
@@ -2325,16 +2439,6 @@ function writeStartPendingSuspenseBoundary(destination, renderState, id) {
2325
2439
  writeChunk(destination, stringToChunk(id.toString(16)));
2326
2440
  return writeChunkAndReturn(destination, startPendingSuspenseBoundary2);
2327
2441
  }
2328
- var boundaryPreambleContributionChunkStart =
2329
- stringToPrecomputedChunk("\x3c!--"),
2330
- boundaryPreambleContributionChunkEnd = stringToPrecomputedChunk("--\x3e");
2331
- function writePreambleContribution(destination, preambleState) {
2332
- preambleState = preambleState.contribution;
2333
- 0 !== preambleState &&
2334
- (writeChunk(destination, boundaryPreambleContributionChunkStart),
2335
- writeChunk(destination, stringToChunk("" + preambleState)),
2336
- writeChunk(destination, boundaryPreambleContributionChunkEnd));
2337
- }
2338
2442
  var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="'),
2339
2443
  startSegmentHTML2 = stringToPrecomputedChunk('">'),
2340
2444
  endSegmentHTML = stringToPrecomputedChunk("</div>"),
@@ -2451,15 +2555,15 @@ var completeSegmentScript1Full = stringToPrecomputedChunk(
2451
2555
  completeSegmentScriptEnd = stringToPrecomputedChunk('")\x3c/script>');
2452
2556
  stringToPrecomputedChunk('<template data-rsi="" data-sid="');
2453
2557
  stringToPrecomputedChunk('" data-pid="');
2454
- var completeBoundaryScript1Full = stringToPrecomputedChunk(
2455
- '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RC("'
2456
- ),
2457
- completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'),
2458
- completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk(
2459
- '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'
2460
- ),
2558
+ var completeBoundaryScriptFunctionOnly = stringToPrecomputedChunk(
2559
+ '$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};'
2560
+ );
2561
+ stringToChunk(
2562
+ '$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),"auto"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute("vt-name"))||(a="_T_"+K++ +"_"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll("[vt-share]"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute("vt-name"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if("/$"===r)if(0===f)break;else f--;else"$"!==r&&"$?"!==r&&"$~"!==r&&"$!"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute("vt-name"),y=m.get(D);k(d,y?"vt-share":"vt-exit");y&&(k(y,"vt-share"),m.set(D,null));var E=d.querySelectorAll("[vt-share]");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute("vt-name"),\nH=m.get(G);H&&(k(F,"vt-share"),k(H,"vt-share"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute("vt-name"))&&k(t,"vt-enter"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute("vt-update");J&&"none"!==J&&!l.includes(n)&&k(n,"vt-update");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&"none"!==c.getAttribute("vt-update"));u.push.apply(u,I.querySelectorAll(\'img[src]:not([loading="lazy"])\'))}}}if(B){var z=\ndocument.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener("load",q);w.g.addEventListener("error",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=\nperformance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];""===b.getAttribute("style")&&b.removeAttribute("style")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);'
2563
+ );
2564
+ var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("'),
2461
2565
  completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(
2462
- '$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'
2566
+ '$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=e[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&$RM.set(b.getAttribute("href"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement("link");a.href=d;a.rel=\n"stylesheet";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute("media");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=\n"$~";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,"CSS failed to load"))};$RR("'
2463
2567
  ),
2464
2568
  completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("'),
2465
2569
  completeBoundaryScript2 = stringToPrecomputedChunk('","'),
@@ -2470,7 +2574,10 @@ stringToPrecomputedChunk('<template data-rci="" data-bid="');
2470
2574
  stringToPrecomputedChunk('<template data-rri="" data-bid="');
2471
2575
  stringToPrecomputedChunk('" data-sid="');
2472
2576
  stringToPrecomputedChunk('" data-sty="');
2473
- var clientRenderScript1Full = stringToPrecomputedChunk(
2577
+ var clientRenderScriptFunctionOnly = stringToPrecomputedChunk(
2578
+ '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'
2579
+ ),
2580
+ clientRenderScript1Full = stringToPrecomputedChunk(
2474
2581
  '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'
2475
2582
  ),
2476
2583
  clientRenderScript1Partial = stringToPrecomputedChunk('$RX("'),
@@ -2527,7 +2634,7 @@ function escapeJSObjectForInstructionScripts(input) {
2527
2634
  );
2528
2635
  }
2529
2636
  var lateStyleTagResourceOpen1 = stringToPrecomputedChunk(
2530
- '<style media="not all" data-precedence="'
2637
+ ' media="not all" data-precedence="'
2531
2638
  ),
2532
2639
  lateStyleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
2533
2640
  lateStyleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -2539,6 +2646,7 @@ function flushStyleTagsLateForBoundary(styleQueue) {
2539
2646
  hrefs = styleQueue.hrefs,
2540
2647
  i = 0;
2541
2648
  if (hrefs.length) {
2649
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
2542
2650
  writeChunk(this, lateStyleTagResourceOpen1);
2543
2651
  writeChunk(this, styleQueue.precedence);
2544
2652
  for (writeChunk(this, lateStyleTagResourceOpen2); i < hrefs.length - 1; i++)
@@ -2563,7 +2671,9 @@ function hasStylesToHoist(stylesheet) {
2563
2671
  function writeHoistablesForBoundary(destination, hoistableState, renderState) {
2564
2672
  currentlyRenderingBoundaryHasStylesToHoist = !1;
2565
2673
  destinationHasCapacity = !0;
2674
+ currentlyFlushingRenderState = renderState;
2566
2675
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
2676
+ currentlyFlushingRenderState = null;
2567
2677
  hoistableState.stylesheets.forEach(hasStylesToHoist);
2568
2678
  currentlyRenderingBoundaryHasStylesToHoist &&
2569
2679
  (renderState.stylesToHoist = !0);
@@ -2581,9 +2691,7 @@ function flushStyleInPreamble(stylesheet) {
2581
2691
  stylesheetFlushingQueue.length = 0;
2582
2692
  stylesheet.state = 2;
2583
2693
  }
2584
- var styleTagResourceOpen1 = stringToPrecomputedChunk(
2585
- '<style data-precedence="'
2586
- ),
2694
+ var styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence="'),
2587
2695
  styleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
2588
2696
  spaceSeparator = stringToPrecomputedChunk(" "),
2589
2697
  styleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -2595,6 +2703,7 @@ function flushStylesInPreamble(styleQueue) {
2595
2703
  var rules = styleQueue.rules,
2596
2704
  hrefs = styleQueue.hrefs;
2597
2705
  if (!hasStylesheets || hrefs.length) {
2706
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
2598
2707
  writeChunk(this, styleTagResourceOpen1);
2599
2708
  writeChunk(this, styleQueue.precedence);
2600
2709
  styleQueue = 0;
@@ -2643,6 +2752,18 @@ function preloadLateStyles(styleQueue) {
2643
2752
  styleQueue.sheets.forEach(preloadLateStyle, this);
2644
2753
  styleQueue.sheets.clear();
2645
2754
  }
2755
+ stringToPrecomputedChunk('<link rel="expect" href="#');
2756
+ stringToPrecomputedChunk('" blocking="render"/>');
2757
+ var completedShellIdAttributeStart = stringToPrecomputedChunk(' id="');
2758
+ function pushCompletedShellIdAttribute(target, resumableState) {
2759
+ 0 === (resumableState.instructions & 32) &&
2760
+ ((resumableState.instructions |= 32),
2761
+ target.push(
2762
+ completedShellIdAttributeStart,
2763
+ stringToChunk(escapeTextForBrowser("_" + resumableState.idPrefix + "R_")),
2764
+ attributeEnd
2765
+ ));
2766
+ }
2646
2767
  var arrayFirstOpenBracket = stringToPrecomputedChunk("["),
2647
2768
  arraySubsequentOpenBracket = stringToPrecomputedChunk(",["),
2648
2769
  arrayInterstitial = stringToPrecomputedChunk(","),
@@ -2757,7 +2878,7 @@ function writeStyleResourceAttributeInJS(destination, name, value) {
2757
2878
  );
2758
2879
  }
2759
2880
  function createHoistableState() {
2760
- return { styles: new Set(), stylesheets: new Set() };
2881
+ return { styles: new Set(), stylesheets: new Set(), suspenseyImages: !1 };
2761
2882
  }
2762
2883
  function prefetchDNS(href) {
2763
2884
  var request = resolveRequest();
@@ -3162,6 +3283,14 @@ function hoistStyleQueueDependency(styleQueue) {
3162
3283
  function hoistStylesheetDependency(stylesheet) {
3163
3284
  this.stylesheets.add(stylesheet);
3164
3285
  }
3286
+ function hoistHoistables(parentState, childState) {
3287
+ childState.styles.forEach(hoistStyleQueueDependency, parentState);
3288
+ childState.stylesheets.forEach(hoistStylesheetDependency, parentState);
3289
+ childState.suspenseyImages && (parentState.suspenseyImages = !0);
3290
+ }
3291
+ function hasSuspenseyContent(hoistableState) {
3292
+ return 0 < hoistableState.stylesheets.size || hoistableState.suspenseyImages;
3293
+ }
3165
3294
  var bind = Function.prototype.bind,
3166
3295
  supportsRequestStorage = "function" === typeof AsyncLocalStorage,
3167
3296
  requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null,
@@ -3192,7 +3321,7 @@ function getComponentNameFromType(type) {
3192
3321
  case REACT_PORTAL_TYPE:
3193
3322
  return "Portal";
3194
3323
  case REACT_CONTEXT_TYPE:
3195
- return (type.displayName || "Context") + ".Provider";
3324
+ return type.displayName || "Context";
3196
3325
  case REACT_CONSUMER_TYPE:
3197
3326
  return (type._context.displayName || "Context") + ".Consumer";
3198
3327
  case REACT_FORWARD_REF_TYPE:
@@ -3334,15 +3463,15 @@ function clz32Fallback(x) {
3334
3463
  x >>>= 0;
3335
3464
  return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
3336
3465
  }
3466
+ function noop() {}
3337
3467
  var SuspenseException = Error(
3338
3468
  "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`."
3339
3469
  );
3340
- function noop$2() {}
3341
3470
  function trackUsedThenable(thenableState, thenable, index) {
3342
3471
  index = thenableState[index];
3343
3472
  void 0 === index
3344
3473
  ? thenableState.push(thenable)
3345
- : index !== thenable && (thenable.then(noop$2, noop$2), (thenable = index));
3474
+ : index !== thenable && (thenable.then(noop, noop), (thenable = index));
3346
3475
  switch (thenable.status) {
3347
3476
  case "fulfilled":
3348
3477
  return thenable.value;
@@ -3350,7 +3479,7 @@ function trackUsedThenable(thenableState, thenable, index) {
3350
3479
  throw thenable.reason;
3351
3480
  default:
3352
3481
  "string" === typeof thenable.status
3353
- ? thenable.then(noop$2, noop$2)
3482
+ ? thenable.then(noop, noop)
3354
3483
  : ((thenableState = thenable),
3355
3484
  (thenableState.status = "pending"),
3356
3485
  thenableState.then(
@@ -3530,6 +3659,11 @@ function dispatchAction(componentIdentity, queue, action) {
3530
3659
  queue.next = componentIdentity;
3531
3660
  }
3532
3661
  }
3662
+ function throwOnUseEffectEventCall() {
3663
+ throw Error(
3664
+ "A function wrapped in useEffectEvent can't be called during rendering."
3665
+ );
3666
+ }
3533
3667
  function unsupportedStartTransition() {
3534
3668
  throw Error("startTransition cannot be called during server rendering.");
3535
3669
  }
@@ -3607,7 +3741,6 @@ function unwrapThenable(thenable) {
3607
3741
  function unsupportedRefresh() {
3608
3742
  throw Error("Cache cannot be refreshed during server rendering.");
3609
3743
  }
3610
- function noop$1() {}
3611
3744
  var HooksDispatcher = {
3612
3745
  readContext: function (context) {
3613
3746
  return context._currentValue;
@@ -3637,16 +3770,16 @@ var HooksDispatcher = {
3637
3770
  useState: function (initialState) {
3638
3771
  return useReducer(basicStateReducer, initialState);
3639
3772
  },
3640
- useInsertionEffect: noop$1,
3641
- useLayoutEffect: noop$1,
3773
+ useInsertionEffect: noop,
3774
+ useLayoutEffect: noop,
3642
3775
  useCallback: function (callback, deps) {
3643
3776
  return useMemo(function () {
3644
3777
  return callback;
3645
3778
  }, deps);
3646
3779
  },
3647
- useImperativeHandle: noop$1,
3648
- useEffect: noop$1,
3649
- useDebugValue: noop$1,
3780
+ useImperativeHandle: noop,
3781
+ useEffect: noop,
3782
+ useDebugValue: noop,
3650
3783
  useDeferredValue: function (value, initialValue) {
3651
3784
  resolveCurrentlyRenderingComponent();
3652
3785
  return void 0 !== initialValue ? initialValue : value;
@@ -3671,9 +3804,9 @@ var HooksDispatcher = {
3671
3804
  );
3672
3805
  overflow = localIdCounter++;
3673
3806
  JSCompiler_inline_result =
3674
- "\u00ab" + resumableState.idPrefix + "R" + JSCompiler_inline_result;
3807
+ "_" + resumableState.idPrefix + "R_" + JSCompiler_inline_result;
3675
3808
  0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32));
3676
- return JSCompiler_inline_result + "\u00bb";
3809
+ return JSCompiler_inline_result + "_";
3677
3810
  },
3678
3811
  useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
3679
3812
  if (void 0 === getServerSnapshot)
@@ -3699,12 +3832,18 @@ var HooksDispatcher = {
3699
3832
  },
3700
3833
  useCacheRefresh: function () {
3701
3834
  return unsupportedRefresh;
3835
+ },
3836
+ useEffectEvent: function () {
3837
+ return throwOnUseEffectEventCall;
3702
3838
  }
3703
3839
  },
3704
3840
  currentResumableState = null,
3705
3841
  DefaultAsyncDispatcher = {
3706
3842
  getCacheForType: function () {
3707
3843
  throw Error("Not implemented.");
3844
+ },
3845
+ cacheSignal: function () {
3846
+ throw Error("Not implemented.");
3708
3847
  }
3709
3848
  };
3710
3849
  function prepareStackTrace(error, structuredStackTrace) {
@@ -3887,13 +4026,37 @@ function describeComponentStackByType(type) {
3887
4026
  }
3888
4027
  return describeComponentStackByType(type);
3889
4028
  }
3890
- if ("string" === typeof type.name)
3891
- return (
3892
- (payload = type.env),
3893
- describeBuiltInComponentFrame(
3894
- type.name + (payload ? " [" + payload + "]" : "")
3895
- )
3896
- );
4029
+ if ("string" === typeof type.name) {
4030
+ a: {
4031
+ payload = type.name;
4032
+ lazyComponent = type.env;
4033
+ var location = type.debugLocation;
4034
+ if (
4035
+ null != location &&
4036
+ ((type = Error.prepareStackTrace),
4037
+ (Error.prepareStackTrace = prepareStackTrace),
4038
+ (location = location.stack),
4039
+ (Error.prepareStackTrace = type),
4040
+ location.startsWith("Error: react-stack-top-frame\n") &&
4041
+ (location = location.slice(29)),
4042
+ (type = location.indexOf("\n")),
4043
+ -1 !== type && (location = location.slice(type + 1)),
4044
+ (type = location.indexOf("react_stack_bottom_frame")),
4045
+ -1 !== type && (type = location.lastIndexOf("\n", type)),
4046
+ (type = -1 !== type ? (location = location.slice(0, type)) : ""),
4047
+ (location = type.lastIndexOf("\n")),
4048
+ (type = -1 === location ? type : type.slice(location + 1)),
4049
+ -1 !== type.indexOf(payload))
4050
+ ) {
4051
+ payload = "\n" + type;
4052
+ break a;
4053
+ }
4054
+ payload = describeBuiltInComponentFrame(
4055
+ payload + (lazyComponent ? " [" + lazyComponent + "]" : "")
4056
+ );
4057
+ }
4058
+ return payload;
4059
+ }
3897
4060
  }
3898
4061
  switch (type) {
3899
4062
  case REACT_SUSPENSE_LIST_TYPE:
@@ -3903,6 +4066,12 @@ function describeComponentStackByType(type) {
3903
4066
  }
3904
4067
  return "";
3905
4068
  }
4069
+ function isEligibleForOutlining(request, boundary) {
4070
+ return (
4071
+ (500 < boundary.byteSize || hasSuspenseyContent(boundary.contentState)) &&
4072
+ null === boundary.contentPreamble
4073
+ );
4074
+ }
3906
4075
  function defaultErrorHandler(error) {
3907
4076
  if (
3908
4077
  "object" === typeof error &&
@@ -3923,7 +4092,7 @@ function defaultErrorHandler(error) {
3923
4092
  : error.splice(
3924
4093
  0,
3925
4094
  0,
3926
- "\u001b[0m\u001b[7m%c%s\u001b[0m%c ",
4095
+ "\u001b[0m\u001b[7m%c%s\u001b[0m%c",
3927
4096
  "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",
3928
4097
  " " + JSCompiler_inline_result + " ",
3929
4098
  ""
@@ -3934,7 +4103,6 @@ function defaultErrorHandler(error) {
3934
4103
  } else console.error(error);
3935
4104
  return null;
3936
4105
  }
3937
- function noop() {}
3938
4106
  function RequestInstance(
3939
4107
  resumableState,
3940
4108
  renderState,
@@ -3960,6 +4128,7 @@ function RequestInstance(
3960
4128
  this.fatalError = null;
3961
4129
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
3962
4130
  this.completedPreambleSegments = this.completedRootSegment = null;
4131
+ this.byteSize = 0;
3963
4132
  this.abortableTasks = abortSet;
3964
4133
  this.pingedTasks = [];
3965
4134
  this.clientRenderedBoundaries = [];
@@ -4025,7 +4194,7 @@ function createRequest(
4025
4194
  null,
4026
4195
  emptyTreeContext,
4027
4196
  null,
4028
- !1
4197
+ null
4029
4198
  );
4030
4199
  pushComponentStack(children);
4031
4200
  resumableState.pingedTasks.push(children);
@@ -4065,6 +4234,116 @@ function createPrerenderRequest(
4065
4234
  };
4066
4235
  return children;
4067
4236
  }
4237
+ function resumeRequest(
4238
+ children,
4239
+ postponedState,
4240
+ renderState,
4241
+ onError,
4242
+ onAllReady,
4243
+ onShellReady,
4244
+ onShellError,
4245
+ onFatalError,
4246
+ onPostpone
4247
+ ) {
4248
+ renderState = new RequestInstance(
4249
+ postponedState.resumableState,
4250
+ renderState,
4251
+ postponedState.rootFormatContext,
4252
+ postponedState.progressiveChunkSize,
4253
+ onError,
4254
+ onAllReady,
4255
+ onShellReady,
4256
+ onShellError,
4257
+ onFatalError,
4258
+ onPostpone,
4259
+ null
4260
+ );
4261
+ renderState.nextSegmentId = postponedState.nextSegmentId;
4262
+ if ("number" === typeof postponedState.replaySlots)
4263
+ return (
4264
+ (onError = createPendingSegment(
4265
+ renderState,
4266
+ 0,
4267
+ null,
4268
+ postponedState.rootFormatContext,
4269
+ !1,
4270
+ !1
4271
+ )),
4272
+ (onError.parentFlushed = !0),
4273
+ (children = createRenderTask(
4274
+ renderState,
4275
+ null,
4276
+ children,
4277
+ -1,
4278
+ null,
4279
+ onError,
4280
+ null,
4281
+ null,
4282
+ renderState.abortableTasks,
4283
+ null,
4284
+ postponedState.rootFormatContext,
4285
+ null,
4286
+ emptyTreeContext,
4287
+ null,
4288
+ null
4289
+ )),
4290
+ pushComponentStack(children),
4291
+ renderState.pingedTasks.push(children),
4292
+ renderState
4293
+ );
4294
+ children = createReplayTask(
4295
+ renderState,
4296
+ null,
4297
+ {
4298
+ nodes: postponedState.replayNodes,
4299
+ slots: postponedState.replaySlots,
4300
+ pendingTasks: 0
4301
+ },
4302
+ children,
4303
+ -1,
4304
+ null,
4305
+ null,
4306
+ renderState.abortableTasks,
4307
+ null,
4308
+ postponedState.rootFormatContext,
4309
+ null,
4310
+ emptyTreeContext,
4311
+ null,
4312
+ null
4313
+ );
4314
+ pushComponentStack(children);
4315
+ renderState.pingedTasks.push(children);
4316
+ return renderState;
4317
+ }
4318
+ function resumeAndPrerenderRequest(
4319
+ children,
4320
+ postponedState,
4321
+ renderState,
4322
+ onError,
4323
+ onAllReady,
4324
+ onShellReady,
4325
+ onShellError,
4326
+ onFatalError,
4327
+ onPostpone
4328
+ ) {
4329
+ children = resumeRequest(
4330
+ children,
4331
+ postponedState,
4332
+ renderState,
4333
+ onError,
4334
+ onAllReady,
4335
+ onShellReady,
4336
+ onShellError,
4337
+ onFatalError,
4338
+ onPostpone
4339
+ );
4340
+ children.trackedPostpones = {
4341
+ workingMap: new Map(),
4342
+ rootNodes: [],
4343
+ rootSlots: null
4344
+ };
4345
+ return children;
4346
+ }
4068
4347
  var currentRequest = null;
4069
4348
  function resolveRequest() {
4070
4349
  if (currentRequest) return currentRequest;
@@ -4088,15 +4367,17 @@ function pingTask(request, task) {
4088
4367
  }
4089
4368
  function createSuspenseBoundary(
4090
4369
  request,
4370
+ row,
4091
4371
  fallbackAbortableTasks,
4092
4372
  contentPreamble,
4093
4373
  fallbackPreamble
4094
4374
  ) {
4095
- return {
4375
+ fallbackAbortableTasks = {
4096
4376
  status: 0,
4097
4377
  rootSegmentID: -1,
4098
4378
  parentFlushed: !1,
4099
4379
  pendingTasks: 0,
4380
+ row: row,
4100
4381
  completedSegments: [],
4101
4382
  byteSize: 0,
4102
4383
  fallbackAbortableTasks: fallbackAbortableTasks,
@@ -4108,6 +4389,17 @@ function createSuspenseBoundary(
4108
4389
  trackedContentKeyPath: null,
4109
4390
  trackedFallbackNode: null
4110
4391
  };
4392
+ null !== row &&
4393
+ (row.pendingTasks++,
4394
+ (contentPreamble = row.boundaries),
4395
+ null !== contentPreamble &&
4396
+ (request.allPendingTasks++,
4397
+ fallbackAbortableTasks.pendingTasks++,
4398
+ contentPreamble.push(fallbackAbortableTasks)),
4399
+ (request = row.inheritedHoistables),
4400
+ null !== request &&
4401
+ hoistHoistables(fallbackAbortableTasks.contentState, request));
4402
+ return fallbackAbortableTasks;
4111
4403
  }
4112
4404
  function createRenderTask(
4113
4405
  request,
@@ -4123,13 +4415,14 @@ function createRenderTask(
4123
4415
  formatContext,
4124
4416
  context,
4125
4417
  treeContext,
4126
- componentStack,
4127
- isFallback
4418
+ row,
4419
+ componentStack
4128
4420
  ) {
4129
4421
  request.allPendingTasks++;
4130
4422
  null === blockedBoundary
4131
4423
  ? request.pendingRootTasks++
4132
4424
  : blockedBoundary.pendingTasks++;
4425
+ null !== row && row.pendingTasks++;
4133
4426
  var task = {
4134
4427
  replay: null,
4135
4428
  node: node,
@@ -4146,9 +4439,9 @@ function createRenderTask(
4146
4439
  formatContext: formatContext,
4147
4440
  context: context,
4148
4441
  treeContext: treeContext,
4442
+ row: row,
4149
4443
  componentStack: componentStack,
4150
- thenableState: thenableState,
4151
- isFallback: isFallback
4444
+ thenableState: thenableState
4152
4445
  };
4153
4446
  abortSet.add(task);
4154
4447
  return task;
@@ -4166,13 +4459,14 @@ function createReplayTask(
4166
4459
  formatContext,
4167
4460
  context,
4168
4461
  treeContext,
4169
- componentStack,
4170
- isFallback
4462
+ row,
4463
+ componentStack
4171
4464
  ) {
4172
4465
  request.allPendingTasks++;
4173
4466
  null === blockedBoundary
4174
4467
  ? request.pendingRootTasks++
4175
4468
  : blockedBoundary.pendingTasks++;
4469
+ null !== row && row.pendingTasks++;
4176
4470
  replay.pendingTasks++;
4177
4471
  var task = {
4178
4472
  replay: replay,
@@ -4190,9 +4484,9 @@ function createReplayTask(
4190
4484
  formatContext: formatContext,
4191
4485
  context: context,
4192
4486
  treeContext: treeContext,
4487
+ row: row,
4193
4488
  componentStack: componentStack,
4194
- thenableState: thenableState,
4195
- isFallback: isFallback
4489
+ thenableState: thenableState
4196
4490
  };
4197
4491
  abortSet.add(task);
4198
4492
  return task;
@@ -4227,6 +4521,13 @@ function pushComponentStack(task) {
4227
4521
  task.componentStack = { parent: task.componentStack, type: node.type };
4228
4522
  }
4229
4523
  }
4524
+ function replaceSuspenseComponentStackWithSuspenseFallbackStack(
4525
+ componentStack
4526
+ ) {
4527
+ return null === componentStack
4528
+ ? null
4529
+ : { parent: componentStack.parent, type: "Suspense Fallback" };
4530
+ }
4230
4531
  function getThrownInfo(node$jscomp$0) {
4231
4532
  var errorInfo = {};
4232
4533
  node$jscomp$0 &&
@@ -4268,6 +4569,170 @@ function fatalError(request, error) {
4268
4569
  ? ((request.status = 14), closeWithError(request.destination, error))
4269
4570
  : ((request.status = 13), (request.fatalError = error));
4270
4571
  }
4572
+ function finishSuspenseListRow(request, row) {
4573
+ unblockSuspenseListRow(request, row.next, row.hoistables);
4574
+ }
4575
+ function unblockSuspenseListRow(request, unblockedRow, inheritedHoistables) {
4576
+ for (; null !== unblockedRow; ) {
4577
+ null !== inheritedHoistables &&
4578
+ (hoistHoistables(unblockedRow.hoistables, inheritedHoistables),
4579
+ (unblockedRow.inheritedHoistables = inheritedHoistables));
4580
+ var unblockedBoundaries = unblockedRow.boundaries;
4581
+ if (null !== unblockedBoundaries) {
4582
+ unblockedRow.boundaries = null;
4583
+ for (var i = 0; i < unblockedBoundaries.length; i++) {
4584
+ var unblockedBoundary = unblockedBoundaries[i];
4585
+ null !== inheritedHoistables &&
4586
+ hoistHoistables(unblockedBoundary.contentState, inheritedHoistables);
4587
+ finishedTask(request, unblockedBoundary, null, null);
4588
+ }
4589
+ }
4590
+ unblockedRow.pendingTasks--;
4591
+ if (0 < unblockedRow.pendingTasks) break;
4592
+ inheritedHoistables = unblockedRow.hoistables;
4593
+ unblockedRow = unblockedRow.next;
4594
+ }
4595
+ }
4596
+ function tryToResolveTogetherRow(request, togetherRow) {
4597
+ var boundaries = togetherRow.boundaries;
4598
+ if (null !== boundaries && togetherRow.pendingTasks === boundaries.length) {
4599
+ for (var allCompleteAndInlinable = !0, i = 0; i < boundaries.length; i++) {
4600
+ var rowBoundary = boundaries[i];
4601
+ if (
4602
+ 1 !== rowBoundary.pendingTasks ||
4603
+ rowBoundary.parentFlushed ||
4604
+ isEligibleForOutlining(request, rowBoundary)
4605
+ ) {
4606
+ allCompleteAndInlinable = !1;
4607
+ break;
4608
+ }
4609
+ }
4610
+ allCompleteAndInlinable &&
4611
+ unblockSuspenseListRow(request, togetherRow, togetherRow.hoistables);
4612
+ }
4613
+ }
4614
+ function createSuspenseListRow(previousRow) {
4615
+ var newRow = {
4616
+ pendingTasks: 1,
4617
+ boundaries: null,
4618
+ hoistables: createHoistableState(),
4619
+ inheritedHoistables: null,
4620
+ together: !1,
4621
+ next: null
4622
+ };
4623
+ null !== previousRow &&
4624
+ 0 < previousRow.pendingTasks &&
4625
+ (newRow.pendingTasks++,
4626
+ (newRow.boundaries = []),
4627
+ (previousRow.next = newRow));
4628
+ return newRow;
4629
+ }
4630
+ function renderSuspenseListRows(request, task, keyPath, rows, revealOrder) {
4631
+ var prevKeyPath = task.keyPath,
4632
+ prevTreeContext = task.treeContext,
4633
+ prevRow = task.row;
4634
+ task.keyPath = keyPath;
4635
+ keyPath = rows.length;
4636
+ var previousSuspenseListRow = null;
4637
+ if (null !== task.replay) {
4638
+ var resumeSlots = task.replay.slots;
4639
+ if (null !== resumeSlots && "object" === typeof resumeSlots)
4640
+ for (var n = 0; n < keyPath; n++) {
4641
+ var i =
4642
+ "backwards" !== revealOrder &&
4643
+ "unstable_legacy-backwards" !== revealOrder
4644
+ ? n
4645
+ : keyPath - 1 - n,
4646
+ node = rows[i];
4647
+ task.row = previousSuspenseListRow = createSuspenseListRow(
4648
+ previousSuspenseListRow
4649
+ );
4650
+ task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
4651
+ var resumeSegmentID = resumeSlots[i];
4652
+ "number" === typeof resumeSegmentID
4653
+ ? (resumeNode(request, task, resumeSegmentID, node, i),
4654
+ delete resumeSlots[i])
4655
+ : renderNode(request, task, node, i);
4656
+ 0 === --previousSuspenseListRow.pendingTasks &&
4657
+ finishSuspenseListRow(request, previousSuspenseListRow);
4658
+ }
4659
+ else
4660
+ for (resumeSlots = 0; resumeSlots < keyPath; resumeSlots++)
4661
+ (n =
4662
+ "backwards" !== revealOrder &&
4663
+ "unstable_legacy-backwards" !== revealOrder
4664
+ ? resumeSlots
4665
+ : keyPath - 1 - resumeSlots),
4666
+ (i = rows[n]),
4667
+ (task.row = previousSuspenseListRow =
4668
+ createSuspenseListRow(previousSuspenseListRow)),
4669
+ (task.treeContext = pushTreeContext(prevTreeContext, keyPath, n)),
4670
+ renderNode(request, task, i, n),
4671
+ 0 === --previousSuspenseListRow.pendingTasks &&
4672
+ finishSuspenseListRow(request, previousSuspenseListRow);
4673
+ } else if (
4674
+ "backwards" !== revealOrder &&
4675
+ "unstable_legacy-backwards" !== revealOrder
4676
+ )
4677
+ for (revealOrder = 0; revealOrder < keyPath; revealOrder++)
4678
+ (resumeSlots = rows[revealOrder]),
4679
+ (task.row = previousSuspenseListRow =
4680
+ createSuspenseListRow(previousSuspenseListRow)),
4681
+ (task.treeContext = pushTreeContext(
4682
+ prevTreeContext,
4683
+ keyPath,
4684
+ revealOrder
4685
+ )),
4686
+ renderNode(request, task, resumeSlots, revealOrder),
4687
+ 0 === --previousSuspenseListRow.pendingTasks &&
4688
+ finishSuspenseListRow(request, previousSuspenseListRow);
4689
+ else {
4690
+ revealOrder = task.blockedSegment;
4691
+ resumeSlots = revealOrder.children.length;
4692
+ n = revealOrder.chunks.length;
4693
+ for (i = keyPath - 1; 0 <= i; i--) {
4694
+ node = rows[i];
4695
+ task.row = previousSuspenseListRow = createSuspenseListRow(
4696
+ previousSuspenseListRow
4697
+ );
4698
+ task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
4699
+ resumeSegmentID = createPendingSegment(
4700
+ request,
4701
+ n,
4702
+ null,
4703
+ task.formatContext,
4704
+ 0 === i ? revealOrder.lastPushedText : !0,
4705
+ !0
4706
+ );
4707
+ revealOrder.children.splice(resumeSlots, 0, resumeSegmentID);
4708
+ task.blockedSegment = resumeSegmentID;
4709
+ try {
4710
+ renderNode(request, task, node, i),
4711
+ resumeSegmentID.lastPushedText &&
4712
+ resumeSegmentID.textEmbedded &&
4713
+ resumeSegmentID.chunks.push(textSeparator),
4714
+ (resumeSegmentID.status = 1),
4715
+ finishedSegment(request, task.blockedBoundary, resumeSegmentID),
4716
+ 0 === --previousSuspenseListRow.pendingTasks &&
4717
+ finishSuspenseListRow(request, previousSuspenseListRow);
4718
+ } catch (thrownValue) {
4719
+ throw (
4720
+ ((resumeSegmentID.status = 12 === request.status ? 3 : 4),
4721
+ thrownValue)
4722
+ );
4723
+ }
4724
+ }
4725
+ task.blockedSegment = revealOrder;
4726
+ revealOrder.lastPushedText = !1;
4727
+ }
4728
+ null !== prevRow &&
4729
+ null !== previousSuspenseListRow &&
4730
+ 0 < previousSuspenseListRow.pendingTasks &&
4731
+ (prevRow.pendingTasks++, (previousSuspenseListRow.next = prevRow));
4732
+ task.treeContext = prevTreeContext;
4733
+ task.row = prevRow;
4734
+ task.keyPath = prevKeyPath;
4735
+ }
4271
4736
  function renderWithHooks(request, task, keyPath, Component, props, secondArg) {
4272
4737
  var prevThenableState = task.thenableState;
4273
4738
  task.thenableState = null;
@@ -4335,9 +4800,9 @@ function renderElement(request, task, keyPath, type, props, ref) {
4335
4800
  var defaultProps = type.defaultProps;
4336
4801
  if (defaultProps) {
4337
4802
  newProps === props && (newProps = assign({}, newProps, props));
4338
- for (var propName$33 in defaultProps)
4339
- void 0 === newProps[propName$33] &&
4340
- (newProps[propName$33] = defaultProps[propName$33]);
4803
+ for (var propName$44 in defaultProps)
4804
+ void 0 === newProps[propName$44] &&
4805
+ (newProps[propName$44] = defaultProps[propName$44]);
4341
4806
  }
4342
4807
  props = newProps;
4343
4808
  newProps = emptyContextObject;
@@ -4397,16 +4862,16 @@ function renderElement(request, task, keyPath, type, props, ref) {
4397
4862
  defaultProps = ref ? type[0] : newProps.state;
4398
4863
  initialState = !0;
4399
4864
  for (ref = ref ? 1 : 0; ref < type.length; ref++)
4400
- (propName$33 = type[ref]),
4401
- (propName$33 =
4402
- "function" === typeof propName$33
4403
- ? propName$33.call(newProps, defaultProps, props, void 0)
4404
- : propName$33),
4405
- null != propName$33 &&
4865
+ (propName$44 = type[ref]),
4866
+ (propName$44 =
4867
+ "function" === typeof propName$44
4868
+ ? propName$44.call(newProps, defaultProps, props, void 0)
4869
+ : propName$44),
4870
+ null != propName$44 &&
4406
4871
  (initialState
4407
4872
  ? ((initialState = !1),
4408
- (defaultProps = assign({}, defaultProps, propName$33)))
4409
- : assign(defaultProps, propName$33));
4873
+ (defaultProps = assign({}, defaultProps, propName$44)))
4874
+ : assign(defaultProps, propName$44));
4410
4875
  newProps.state = defaultProps;
4411
4876
  }
4412
4877
  else defaultProps.queue = null;
@@ -4440,7 +4905,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
4440
4905
  (task.formatContext = defaultProps),
4441
4906
  (task.keyPath = initialState);
4442
4907
  else {
4443
- ref = pushStartInstance(
4908
+ initialState = pushStartInstance(
4444
4909
  newProps.chunks,
4445
4910
  type,
4446
4911
  props,
@@ -4449,47 +4914,41 @@ function renderElement(request, task, keyPath, type, props, ref) {
4449
4914
  task.blockedPreamble,
4450
4915
  task.hoistableState,
4451
4916
  task.formatContext,
4452
- newProps.lastPushedText,
4453
- task.isFallback
4917
+ newProps.lastPushedText
4454
4918
  );
4455
4919
  newProps.lastPushedText = !1;
4456
4920
  defaultProps = task.formatContext;
4457
- initialState = task.keyPath;
4921
+ ref = task.keyPath;
4458
4922
  task.keyPath = keyPath;
4459
- 3 ===
4460
- (task.formatContext = getChildFormatContext(defaultProps, type, props))
4461
- .insertionMode
4462
- ? ((keyPath = createPendingSegment(
4463
- request,
4464
- 0,
4465
- null,
4466
- task.formatContext,
4467
- !1,
4468
- !1
4469
- )),
4470
- newProps.preambleChildren.push(keyPath),
4471
- (keyPath = createRenderTask(
4472
- request,
4473
- null,
4474
- ref,
4475
- -1,
4476
- task.blockedBoundary,
4477
- keyPath,
4478
- task.blockedPreamble,
4479
- task.hoistableState,
4480
- request.abortableTasks,
4481
- task.keyPath,
4482
- task.formatContext,
4483
- task.context,
4484
- task.treeContext,
4485
- task.componentStack,
4486
- task.isFallback
4487
- )),
4488
- pushComponentStack(keyPath),
4489
- request.pingedTasks.push(keyPath))
4490
- : renderNode(request, task, ref, -1);
4923
+ if (
4924
+ 3 ===
4925
+ (task.formatContext = getChildFormatContext(defaultProps, type, props))
4926
+ .insertionMode
4927
+ ) {
4928
+ keyPath = createPendingSegment(
4929
+ request,
4930
+ 0,
4931
+ null,
4932
+ task.formatContext,
4933
+ !1,
4934
+ !1
4935
+ );
4936
+ newProps.preambleChildren.push(keyPath);
4937
+ task.blockedSegment = keyPath;
4938
+ try {
4939
+ (keyPath.status = 6),
4940
+ renderNode(request, task, initialState, -1),
4941
+ keyPath.lastPushedText &&
4942
+ keyPath.textEmbedded &&
4943
+ keyPath.chunks.push(textSeparator),
4944
+ (keyPath.status = 1),
4945
+ finishedSegment(request, task.blockedBoundary, keyPath);
4946
+ } finally {
4947
+ task.blockedSegment = newProps;
4948
+ }
4949
+ } else renderNode(request, task, initialState, -1);
4491
4950
  task.formatContext = defaultProps;
4492
- task.keyPath = initialState;
4951
+ task.keyPath = ref;
4493
4952
  a: {
4494
4953
  task = newProps.chunks;
4495
4954
  request = request.resumableState;
@@ -4544,17 +5003,67 @@ function renderElement(request, task, keyPath, type, props, ref) {
4544
5003
  task.keyPath = type;
4545
5004
  return;
4546
5005
  case REACT_ACTIVITY_TYPE:
4547
- "hidden" !== props.mode &&
4548
- ((type = task.keyPath),
4549
- (task.keyPath = keyPath),
4550
- renderNodeDestructive(request, task, props.children, -1),
4551
- (task.keyPath = type));
5006
+ type = task.blockedSegment;
5007
+ null === type
5008
+ ? "hidden" !== props.mode &&
5009
+ ((type = task.keyPath),
5010
+ (task.keyPath = keyPath),
5011
+ renderNode(request, task, props.children, -1),
5012
+ (task.keyPath = type))
5013
+ : "hidden" !== props.mode &&
5014
+ (type.chunks.push(startActivityBoundary),
5015
+ (type.lastPushedText = !1),
5016
+ (newProps = task.keyPath),
5017
+ (task.keyPath = keyPath),
5018
+ renderNode(request, task, props.children, -1),
5019
+ (task.keyPath = newProps),
5020
+ type.chunks.push(endActivityBoundary),
5021
+ (type.lastPushedText = !1));
4552
5022
  return;
4553
5023
  case REACT_SUSPENSE_LIST_TYPE:
4554
- type = task.keyPath;
4555
- task.keyPath = keyPath;
4556
- renderNodeDestructive(request, task, props.children, -1);
4557
- task.keyPath = type;
5024
+ a: {
5025
+ type = props.children;
5026
+ props = props.revealOrder;
5027
+ if (
5028
+ "forwards" === props ||
5029
+ "backwards" === props ||
5030
+ "unstable_legacy-backwards" === props
5031
+ ) {
5032
+ if (isArrayImpl(type)) {
5033
+ renderSuspenseListRows(request, task, keyPath, type, props);
5034
+ break a;
5035
+ }
5036
+ if ((newProps = getIteratorFn(type)))
5037
+ if ((newProps = newProps.call(type))) {
5038
+ defaultProps = newProps.next();
5039
+ if (!defaultProps.done) {
5040
+ do defaultProps = newProps.next();
5041
+ while (!defaultProps.done);
5042
+ renderSuspenseListRows(request, task, keyPath, type, props);
5043
+ }
5044
+ break a;
5045
+ }
5046
+ }
5047
+ "together" === props
5048
+ ? ((props = task.keyPath),
5049
+ (newProps = task.row),
5050
+ (defaultProps = task.row = createSuspenseListRow(null)),
5051
+ (defaultProps.boundaries = []),
5052
+ (defaultProps.together = !0),
5053
+ (task.keyPath = keyPath),
5054
+ renderNodeDestructive(request, task, type, -1),
5055
+ 0 === --defaultProps.pendingTasks &&
5056
+ finishSuspenseListRow(request, defaultProps),
5057
+ (task.keyPath = props),
5058
+ (task.row = newProps),
5059
+ null !== newProps &&
5060
+ 0 < defaultProps.pendingTasks &&
5061
+ (newProps.pendingTasks++, (defaultProps.next = newProps)))
5062
+ : ((props = task.keyPath),
5063
+ (task.keyPath = keyPath),
5064
+ renderNodeDestructive(request, task, type, -1),
5065
+ (task.keyPath = props));
5066
+ }
4558
5067
  return;
4559
5068
  case REACT_VIEW_TRANSITION_TYPE:
4560
5069
  case REACT_SCOPE_TYPE:
@@ -4562,43 +5071,61 @@ function renderElement(request, task, keyPath, type, props, ref) {
4562
5071
  case REACT_SUSPENSE_TYPE:
4563
5072
  a: if (null !== task.replay) {
4564
5073
  type = task.keyPath;
5074
+ newProps = task.formatContext;
5075
+ defaultProps = task.row;
4565
5076
  task.keyPath = keyPath;
5077
+ task.formatContext = getSuspenseContentFormatContext(
5078
+ request.resumableState,
5079
+ newProps
5080
+ );
5081
+ task.row = null;
4566
5082
  keyPath = props.children;
4567
5083
  try {
4568
5084
  renderNode(request, task, keyPath, -1);
4569
5085
  } finally {
4570
- task.keyPath = type;
5086
+ (task.keyPath = type),
5087
+ (task.formatContext = newProps),
5088
+ (task.row = defaultProps);
4571
5089
  }
4572
5090
  } else {
4573
5091
  type = task.keyPath;
4574
- var parentBoundary = task.blockedBoundary;
4575
- ref = task.blockedPreamble;
4576
- var parentHoistableState = task.hoistableState;
4577
- propName$33 = task.blockedSegment;
4578
- propName = props.fallback;
5092
+ ref = task.formatContext;
5093
+ var prevRow = task.row;
5094
+ propName$44 = task.blockedBoundary;
5095
+ propName = task.blockedPreamble;
5096
+ var parentHoistableState = task.hoistableState,
5097
+ parentSegment = task.blockedSegment,
5098
+ fallback = props.fallback;
4579
5099
  props = props.children;
4580
5100
  var fallbackAbortSet = new Set();
4581
5101
  var newBoundary =
4582
5102
  2 > task.formatContext.insertionMode
4583
5103
  ? createSuspenseBoundary(
4584
5104
  request,
5105
+ task.row,
4585
5106
  fallbackAbortSet,
4586
5107
  createPreambleState(),
4587
5108
  createPreambleState()
4588
5109
  )
4589
- : createSuspenseBoundary(request, fallbackAbortSet, null, null);
5110
+ : createSuspenseBoundary(
5111
+ request,
5112
+ task.row,
5113
+ fallbackAbortSet,
5114
+ null,
5115
+ null
5116
+ );
4590
5117
  null !== request.trackedPostpones &&
4591
5118
  (newBoundary.trackedContentKeyPath = keyPath);
4592
5119
  var boundarySegment = createPendingSegment(
4593
5120
  request,
4594
- propName$33.chunks.length,
5121
+ parentSegment.chunks.length,
4595
5122
  newBoundary,
4596
5123
  task.formatContext,
4597
5124
  !1,
4598
5125
  !1
4599
5126
  );
4600
- propName$33.children.push(boundarySegment);
4601
- propName$33.lastPushedText = !1;
5127
+ parentSegment.children.push(boundarySegment);
5128
+ parentSegment.lastPushedText = !1;
4602
5129
  var contentRootSegment = createPendingSegment(
4603
5130
  request,
4604
5131
  0,
@@ -4609,29 +5136,38 @@ function renderElement(request, task, keyPath, type, props, ref) {
4609
5136
  );
4610
5137
  contentRootSegment.parentFlushed = !0;
4611
5138
  if (null !== request.trackedPostpones) {
4612
- newProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
4613
- defaultProps = [newProps[1], newProps[2], [], null];
4614
- request.trackedPostpones.workingMap.set(newProps, defaultProps);
4615
- newBoundary.trackedFallbackNode = defaultProps;
5139
+ newProps = task.componentStack;
5140
+ defaultProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
5141
+ initialState = [defaultProps[1], defaultProps[2], [], null];
5142
+ request.trackedPostpones.workingMap.set(defaultProps, initialState);
5143
+ newBoundary.trackedFallbackNode = initialState;
4616
5144
  task.blockedSegment = boundarySegment;
4617
5145
  task.blockedPreamble = newBoundary.fallbackPreamble;
4618
- task.keyPath = newProps;
5146
+ task.keyPath = defaultProps;
5147
+ task.formatContext = getSuspenseFallbackFormatContext(
5148
+ request.resumableState,
5149
+ ref
5150
+ );
5151
+ task.componentStack =
5152
+ replaceSuspenseComponentStackWithSuspenseFallbackStack(newProps);
4619
5153
  boundarySegment.status = 6;
4620
5154
  try {
4621
- renderNode(request, task, propName, -1),
5155
+ renderNode(request, task, fallback, -1),
4622
5156
  boundarySegment.lastPushedText &&
4623
5157
  boundarySegment.textEmbedded &&
4624
5158
  boundarySegment.chunks.push(textSeparator),
4625
- (boundarySegment.status = 1);
5159
+ (boundarySegment.status = 1),
5160
+ finishedSegment(request, propName$44, boundarySegment);
4626
5161
  } catch (thrownValue) {
4627
5162
  throw (
4628
5163
  ((boundarySegment.status = 12 === request.status ? 3 : 4),
4629
5164
  thrownValue)
4630
5165
  );
4631
5166
  } finally {
4632
- (task.blockedSegment = propName$33),
4633
- (task.blockedPreamble = ref),
4634
- (task.keyPath = type);
5167
+ (task.blockedSegment = parentSegment),
5168
+ (task.blockedPreamble = propName),
5169
+ (task.keyPath = type),
5170
+ (task.formatContext = ref);
4635
5171
  }
4636
5172
  task = createRenderTask(
4637
5173
  request,
@@ -4644,11 +5180,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
4644
5180
  newBoundary.contentState,
4645
5181
  task.abortSet,
4646
5182
  keyPath,
4647
- task.formatContext,
5183
+ getSuspenseContentFormatContext(
5184
+ request.resumableState,
5185
+ task.formatContext
5186
+ ),
4648
5187
  task.context,
4649
5188
  task.treeContext,
4650
- task.componentStack,
4651
- task.isFallback
5189
+ null,
5190
+ newProps
4652
5191
  );
4653
5192
  pushComponentStack(task);
4654
5193
  request.pingedTasks.push(task);
@@ -4658,6 +5197,11 @@ function renderElement(request, task, keyPath, type, props, ref) {
4658
5197
  task.hoistableState = newBoundary.contentState;
4659
5198
  task.blockedSegment = contentRootSegment;
4660
5199
  task.keyPath = keyPath;
5200
+ task.formatContext = getSuspenseContentFormatContext(
5201
+ request.resumableState,
5202
+ ref
5203
+ );
5204
+ task.row = null;
4661
5205
  contentRootSegment.status = 6;
4662
5206
  try {
4663
5207
  if (
@@ -4666,22 +5210,33 @@ function renderElement(request, task, keyPath, type, props, ref) {
4666
5210
  contentRootSegment.textEmbedded &&
4667
5211
  contentRootSegment.chunks.push(textSeparator),
4668
5212
  (contentRootSegment.status = 1),
5213
+ finishedSegment(request, newBoundary, contentRootSegment),
4669
5214
  queueCompletedSegment(newBoundary, contentRootSegment),
4670
5215
  0 === newBoundary.pendingTasks && 0 === newBoundary.status)
4671
5216
  ) {
4672
- newBoundary.status = 1;
4673
- 0 === request.pendingRootTasks &&
4674
- task.blockedPreamble &&
4675
- preparePreamble(request);
4676
- break a;
4677
- }
4678
- } catch (thrownValue$28) {
5217
+ if (
5218
+ ((newBoundary.status = 1),
5219
+ !isEligibleForOutlining(request, newBoundary))
5220
+ ) {
5221
+ null !== prevRow &&
5222
+ 0 === --prevRow.pendingTasks &&
5223
+ finishSuspenseListRow(request, prevRow);
5224
+ 0 === request.pendingRootTasks &&
5225
+ task.blockedPreamble &&
5226
+ preparePreamble(request);
5227
+ break a;
5228
+ }
5229
+ } else
5230
+ null !== prevRow &&
5231
+ prevRow.together &&
5232
+ tryToResolveTogetherRow(request, prevRow);
5233
+ } catch (thrownValue$31) {
4679
5234
  (newBoundary.status = 4),
4680
5235
  12 === request.status
4681
5236
  ? ((contentRootSegment.status = 3),
4682
5237
  (newProps = request.fatalError))
4683
5238
  : ((contentRootSegment.status = 4),
4684
- (newProps = thrownValue$28)),
5239
+ (newProps = thrownValue$31)),
4685
5240
  (defaultProps = getThrownInfo(task.componentStack)),
4686
5241
  (initialState = logRecoverableError(
4687
5242
  request,
@@ -4691,28 +5246,35 @@ function renderElement(request, task, keyPath, type, props, ref) {
4691
5246
  (newBoundary.errorDigest = initialState),
4692
5247
  untrackBoundary(request, newBoundary);
4693
5248
  } finally {
4694
- (task.blockedBoundary = parentBoundary),
4695
- (task.blockedPreamble = ref),
5249
+ (task.blockedBoundary = propName$44),
5250
+ (task.blockedPreamble = propName),
4696
5251
  (task.hoistableState = parentHoistableState),
4697
- (task.blockedSegment = propName$33),
4698
- (task.keyPath = type);
5252
+ (task.blockedSegment = parentSegment),
5253
+ (task.keyPath = type),
5254
+ (task.formatContext = ref),
5255
+ (task.row = prevRow);
4699
5256
  }
4700
5257
  task = createRenderTask(
4701
5258
  request,
4702
5259
  null,
4703
- propName,
5260
+ fallback,
4704
5261
  -1,
4705
- parentBoundary,
5262
+ propName$44,
4706
5263
  boundarySegment,
4707
5264
  newBoundary.fallbackPreamble,
4708
5265
  newBoundary.fallbackState,
4709
5266
  fallbackAbortSet,
4710
5267
  [keyPath[0], "Suspense Fallback", keyPath[2]],
4711
- task.formatContext,
5268
+ getSuspenseFallbackFormatContext(
5269
+ request.resumableState,
5270
+ task.formatContext
5271
+ ),
4712
5272
  task.context,
4713
5273
  task.treeContext,
4714
- task.componentStack,
4715
- !0
5274
+ task.row,
5275
+ replaceSuspenseComponentStackWithSuspenseFallbackStack(
5276
+ task.componentStack
5277
+ )
4716
5278
  );
4717
5279
  pushComponentStack(task);
4718
5280
  request.pingedTasks.push(task);
@@ -4724,9 +5286,9 @@ function renderElement(request, task, keyPath, type, props, ref) {
4724
5286
  switch (type.$$typeof) {
4725
5287
  case REACT_FORWARD_REF_TYPE:
4726
5288
  if ("ref" in props)
4727
- for (newBoundary in ((newProps = {}), props))
4728
- "ref" !== newBoundary &&
4729
- (newProps[newBoundary] = props[newBoundary]);
5289
+ for (parentSegment in ((newProps = {}), props))
5290
+ "ref" !== parentSegment &&
5291
+ (newProps[parentSegment] = props[parentSegment]);
4730
5292
  else newProps = props;
4731
5293
  type = renderWithHooks(
4732
5294
  request,
@@ -4749,7 +5311,6 @@ function renderElement(request, task, keyPath, type, props, ref) {
4749
5311
  case REACT_MEMO_TYPE:
4750
5312
  renderElement(request, task, keyPath, type.type, props, ref);
4751
5313
  return;
4752
- case REACT_PROVIDER_TYPE:
4753
5314
  case REACT_CONTEXT_TYPE:
4754
5315
  defaultProps = props.children;
4755
5316
  newProps = task.keyPath;
@@ -4816,6 +5377,7 @@ function resumeNode(request, task, segmentId, node, childIndex) {
4816
5377
  (task.blockedSegment = resumedSegment),
4817
5378
  renderNode(request, task, node, childIndex),
4818
5379
  (resumedSegment.status = 1),
5380
+ finishedSegment(request, blockedBoundary, resumedSegment),
4819
5381
  null === blockedBoundary
4820
5382
  ? (request.completedRootSegment = resumedSegment)
4821
5383
  : (queueCompletedSegment(blockedBoundary, resumedSegment),
@@ -4893,17 +5455,20 @@ function retryNode(request, task) {
4893
5455
  "function" === typeof x.then)
4894
5456
  )
4895
5457
  throw (
4896
- (task.node === keyOrIndex && (task.replay = replay),
5458
+ (task.node === keyOrIndex
5459
+ ? (task.replay = replay)
5460
+ : childIndex.splice(node, 1),
4897
5461
  x)
4898
5462
  );
4899
5463
  task.replay.pendingTasks--;
4900
5464
  props = getThrownInfo(task.componentStack);
4901
- key = task.blockedBoundary;
5465
+ key = request;
5466
+ request = task.blockedBoundary;
4902
5467
  type = x;
4903
- props = logRecoverableError(request, type, props);
5468
+ props = logRecoverableError(key, type, props);
4904
5469
  abortRemainingReplayNodes(
4905
- request,
4906
5470
  key,
5471
+ request,
4907
5472
  childNodes,
4908
5473
  name,
4909
5474
  type,
@@ -4928,6 +5493,8 @@ function retryNode(request, task) {
4928
5493
  node$jscomp$0 =
4929
5494
  null === node$jscomp$0[4] ? null : node$jscomp$0[4][3];
4930
5495
  var prevKeyPath = task.keyPath,
5496
+ prevContext = task.formatContext,
5497
+ prevRow = task.row,
4931
5498
  previousReplaySet = task.replay,
4932
5499
  parentBoundary = task.blockedBoundary,
4933
5500
  parentHoistableState = task.hoistableState,
@@ -4938,12 +5505,14 @@ function retryNode(request, task) {
4938
5505
  2 > task.formatContext.insertionMode
4939
5506
  ? createSuspenseBoundary(
4940
5507
  request,
5508
+ task.row,
4941
5509
  fallbackAbortSet,
4942
5510
  createPreambleState(),
4943
5511
  createPreambleState()
4944
5512
  )
4945
5513
  : createSuspenseBoundary(
4946
5514
  request,
5515
+ task.row,
4947
5516
  fallbackAbortSet,
4948
5517
  null,
4949
5518
  null
@@ -4953,6 +5522,11 @@ function retryNode(request, task) {
4953
5522
  task.blockedBoundary = props;
4954
5523
  task.hoistableState = props.contentState;
4955
5524
  task.keyPath = key;
5525
+ task.formatContext = getSuspenseContentFormatContext(
5526
+ request.resumableState,
5527
+ prevContext
5528
+ );
5529
+ task.row = null;
4956
5530
  task.replay = {
4957
5531
  nodes: ref,
4958
5532
  slots: name,
@@ -4988,9 +5562,11 @@ function retryNode(request, task) {
4988
5562
  (task.blockedBoundary = parentBoundary),
4989
5563
  (task.hoistableState = parentHoistableState),
4990
5564
  (task.replay = previousReplaySet),
4991
- (task.keyPath = prevKeyPath);
5565
+ (task.keyPath = prevKeyPath),
5566
+ (task.formatContext = prevContext),
5567
+ (task.row = prevRow);
4992
5568
  }
4993
- task = createReplayTask(
5569
+ childNodes = createReplayTask(
4994
5570
  request,
4995
5571
  null,
4996
5572
  {
@@ -5004,14 +5580,19 @@ function retryNode(request, task) {
5004
5580
  props.fallbackState,
5005
5581
  fallbackAbortSet,
5006
5582
  [key[0], "Suspense Fallback", key[2]],
5007
- task.formatContext,
5583
+ getSuspenseFallbackFormatContext(
5584
+ request.resumableState,
5585
+ task.formatContext
5586
+ ),
5008
5587
  task.context,
5009
5588
  task.treeContext,
5010
- task.componentStack,
5011
- !0
5589
+ task.row,
5590
+ replaceSuspenseComponentStackWithSuspenseFallbackStack(
5591
+ task.componentStack
5592
+ )
5012
5593
  );
5013
- pushComponentStack(task);
5014
- request.pingedTasks.push(task);
5594
+ pushComponentStack(childNodes);
5595
+ request.pingedTasks.push(childNodes);
5015
5596
  }
5016
5597
  }
5017
5598
  childIndex.splice(node, 1);
@@ -5036,22 +5617,17 @@ function retryNode(request, task) {
5036
5617
  renderChildrenArray(request, task, node, childIndex);
5037
5618
  return;
5038
5619
  }
5039
- null === node || "object" !== typeof node
5040
- ? (childNodes = null)
5041
- : ((childNodes =
5042
- (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
5043
- node["@@iterator"]),
5044
- (childNodes = "function" === typeof childNodes ? childNodes : null));
5045
- if (childNodes && (childNodes = childNodes.call(node))) {
5046
- node = childNodes.next();
5047
- if (!node.done) {
5048
- props = [];
5049
- do props.push(node.value), (node = childNodes.next());
5050
- while (!node.done);
5051
- renderChildrenArray(request, task, props, childIndex);
5620
+ if ((childNodes = getIteratorFn(node)))
5621
+ if ((childNodes = childNodes.call(node))) {
5622
+ node = childNodes.next();
5623
+ if (!node.done) {
5624
+ props = [];
5625
+ do props.push(node.value), (node = childNodes.next());
5626
+ while (!node.done);
5627
+ renderChildrenArray(request, task, props, childIndex);
5628
+ }
5629
+ return;
5052
5630
  }
5053
- return;
5054
- }
5055
5631
  if ("function" === typeof node.then)
5056
5632
  return (
5057
5633
  (task.thenableState = null),
@@ -5171,6 +5747,105 @@ function renderChildrenArray(request, task, children, childIndex) {
5171
5747
  task.treeContext = replay;
5172
5748
  task.keyPath = prevKeyPath;
5173
5749
  }
5750
+ function trackPostponedBoundary(request, trackedPostpones, boundary) {
5751
+ boundary.status = 5;
5752
+ boundary.rootSegmentID = request.nextSegmentId++;
5753
+ request = boundary.trackedContentKeyPath;
5754
+ if (null === request)
5755
+ throw Error(
5756
+ "It should not be possible to postpone at the root. This is a bug in React."
5757
+ );
5758
+ var fallbackReplayNode = boundary.trackedFallbackNode,
5759
+ children = [],
5760
+ boundaryNode = trackedPostpones.workingMap.get(request);
5761
+ if (void 0 === boundaryNode)
5762
+ return (
5763
+ (boundary = [
5764
+ request[1],
5765
+ request[2],
5766
+ children,
5767
+ null,
5768
+ fallbackReplayNode,
5769
+ boundary.rootSegmentID
5770
+ ]),
5771
+ trackedPostpones.workingMap.set(request, boundary),
5772
+ addToReplayParent(boundary, request[0], trackedPostpones),
5773
+ boundary
5774
+ );
5775
+ boundaryNode[4] = fallbackReplayNode;
5776
+ boundaryNode[5] = boundary.rootSegmentID;
5777
+ return boundaryNode;
5778
+ }
5779
+ function trackPostpone(request, trackedPostpones, task, segment) {
5780
+ segment.status = 5;
5781
+ var keyPath = task.keyPath,
5782
+ boundary = task.blockedBoundary;
5783
+ if (null === boundary)
5784
+ (segment.id = request.nextSegmentId++),
5785
+ (trackedPostpones.rootSlots = segment.id),
5786
+ null !== request.completedRootSegment &&
5787
+ (request.completedRootSegment.status = 5);
5788
+ else {
5789
+ if (null !== boundary && 0 === boundary.status) {
5790
+ var boundaryNode = trackPostponedBoundary(
5791
+ request,
5792
+ trackedPostpones,
5793
+ boundary
5794
+ );
5795
+ if (
5796
+ boundary.trackedContentKeyPath === keyPath &&
5797
+ -1 === task.childIndex
5798
+ ) {
5799
+ -1 === segment.id &&
5800
+ (segment.id = segment.parentFlushed
5801
+ ? boundary.rootSegmentID
5802
+ : request.nextSegmentId++);
5803
+ boundaryNode[3] = segment.id;
5804
+ return;
5805
+ }
5806
+ }
5807
+ -1 === segment.id &&
5808
+ (segment.id =
5809
+ segment.parentFlushed && null !== boundary
5810
+ ? boundary.rootSegmentID
5811
+ : request.nextSegmentId++);
5812
+ if (-1 === task.childIndex)
5813
+ null === keyPath
5814
+ ? (trackedPostpones.rootSlots = segment.id)
5815
+ : ((task = trackedPostpones.workingMap.get(keyPath)),
5816
+ void 0 === task
5817
+ ? ((task = [keyPath[1], keyPath[2], [], segment.id]),
5818
+ addToReplayParent(task, keyPath[0], trackedPostpones))
5819
+ : (task[3] = segment.id));
5820
+ else {
5821
+ if (null === keyPath)
5822
+ if (((request = trackedPostpones.rootSlots), null === request))
5823
+ request = trackedPostpones.rootSlots = {};
5824
+ else {
5825
+ if ("number" === typeof request)
5826
+ throw Error(
5827
+ "It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React."
5828
+ );
5829
+ }
5830
+ else if (
5831
+ ((boundary = trackedPostpones.workingMap),
5832
+ (boundaryNode = boundary.get(keyPath)),
5833
+ void 0 === boundaryNode)
5834
+ )
5835
+ (request = {}),
5836
+ (boundaryNode = [keyPath[1], keyPath[2], [], request]),
5837
+ boundary.set(keyPath, boundaryNode),
5838
+ addToReplayParent(boundaryNode, keyPath[0], trackedPostpones);
5839
+ else if (((request = boundaryNode[3]), null === request))
5840
+ request = boundaryNode[3] = {};
5841
+ else if ("number" === typeof request)
5842
+ throw Error(
5843
+ "It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React."
5844
+ );
5845
+ request[task.childIndex] = segment.id;
5846
+ }
5847
+ }
5848
+ }
5174
5849
  function untrackBoundary(request, boundary) {
5175
5850
  request = request.trackedPostpones;
5176
5851
  null !== request &&
@@ -5194,8 +5869,8 @@ function spawnNewSuspendedReplayTask(request, task, thenableState) {
5194
5869
  task.formatContext,
5195
5870
  task.context,
5196
5871
  task.treeContext,
5197
- task.componentStack,
5198
- task.isFallback
5872
+ task.row,
5873
+ task.componentStack
5199
5874
  );
5200
5875
  }
5201
5876
  function spawnNewSuspendedRenderTask(request, task, thenableState) {
@@ -5224,8 +5899,8 @@ function spawnNewSuspendedRenderTask(request, task, thenableState) {
5224
5899
  task.formatContext,
5225
5900
  task.context,
5226
5901
  task.treeContext,
5227
- task.componentStack,
5228
- task.isFallback
5902
+ task.row,
5903
+ task.componentStack
5229
5904
  );
5230
5905
  }
5231
5906
  function renderNode(request, task, node, childIndex) {
@@ -5235,7 +5910,8 @@ function renderNode(request, task, node, childIndex) {
5235
5910
  previousTreeContext = task.treeContext,
5236
5911
  previousComponentStack = task.componentStack,
5237
5912
  segment = task.blockedSegment;
5238
- if (null === segment)
5913
+ if (null === segment) {
5914
+ segment = task.replay;
5239
5915
  try {
5240
5916
  return renderNodeDestructive(request, task, node, childIndex);
5241
5917
  } catch (thrownValue) {
@@ -5245,10 +5921,13 @@ function renderNode(request, task, node, childIndex) {
5245
5921
  thrownValue === SuspenseException
5246
5922
  ? getSuspendedThenable()
5247
5923
  : thrownValue),
5248
- "object" === typeof node && null !== node)
5924
+ 12 !== request.status && "object" === typeof node && null !== node)
5249
5925
  ) {
5250
5926
  if ("function" === typeof node.then) {
5251
- childIndex = getThenableStateAfterSuspending();
5927
+ childIndex =
5928
+ thrownValue === SuspenseException
5929
+ ? getThenableStateAfterSuspending()
5930
+ : null;
5252
5931
  request = spawnNewSuspendedReplayTask(request, task, childIndex).ping;
5253
5932
  node.then(request, request);
5254
5933
  task.formatContext = previousFormatContext;
@@ -5256,11 +5935,15 @@ function renderNode(request, task, node, childIndex) {
5256
5935
  task.keyPath = previousKeyPath;
5257
5936
  task.treeContext = previousTreeContext;
5258
5937
  task.componentStack = previousComponentStack;
5938
+ task.replay = segment;
5259
5939
  switchContext(previousContext);
5260
5940
  return;
5261
5941
  }
5262
5942
  if ("Maximum call stack size exceeded" === node.message) {
5263
- node = getThenableStateAfterSuspending();
5943
+ node =
5944
+ thrownValue === SuspenseException
5945
+ ? getThenableStateAfterSuspending()
5946
+ : null;
5264
5947
  node = spawnNewSuspendedReplayTask(request, task, node);
5265
5948
  request.pingedTasks.push(node);
5266
5949
  task.formatContext = previousFormatContext;
@@ -5268,31 +5951,36 @@ function renderNode(request, task, node, childIndex) {
5268
5951
  task.keyPath = previousKeyPath;
5269
5952
  task.treeContext = previousTreeContext;
5270
5953
  task.componentStack = previousComponentStack;
5954
+ task.replay = segment;
5271
5955
  switchContext(previousContext);
5272
5956
  return;
5273
5957
  }
5274
5958
  }
5275
5959
  }
5276
- else {
5960
+ } else {
5277
5961
  var childrenLength = segment.children.length,
5278
5962
  chunkLength = segment.chunks.length;
5279
5963
  try {
5280
5964
  return renderNodeDestructive(request, task, node, childIndex);
5281
- } catch (thrownValue$48) {
5965
+ } catch (thrownValue$63) {
5282
5966
  if (
5283
5967
  (resetHooksState(),
5284
5968
  (segment.children.length = childrenLength),
5285
5969
  (segment.chunks.length = chunkLength),
5286
5970
  (node =
5287
- thrownValue$48 === SuspenseException
5971
+ thrownValue$63 === SuspenseException
5288
5972
  ? getSuspendedThenable()
5289
- : thrownValue$48),
5290
- "object" === typeof node && null !== node)
5973
+ : thrownValue$63),
5974
+ 12 !== request.status && "object" === typeof node && null !== node)
5291
5975
  ) {
5292
5976
  if ("function" === typeof node.then) {
5293
- childIndex = getThenableStateAfterSuspending();
5294
- request = spawnNewSuspendedRenderTask(request, task, childIndex).ping;
5295
- node.then(request, request);
5977
+ segment = node;
5978
+ node =
5979
+ thrownValue$63 === SuspenseException
5980
+ ? getThenableStateAfterSuspending()
5981
+ : null;
5982
+ request = spawnNewSuspendedRenderTask(request, task, node).ping;
5983
+ segment.then(request, request);
5296
5984
  task.formatContext = previousFormatContext;
5297
5985
  task.context = previousContext;
5298
5986
  task.keyPath = previousKeyPath;
@@ -5302,9 +5990,12 @@ function renderNode(request, task, node, childIndex) {
5302
5990
  return;
5303
5991
  }
5304
5992
  if ("Maximum call stack size exceeded" === node.message) {
5305
- node = getThenableStateAfterSuspending();
5306
- node = spawnNewSuspendedRenderTask(request, task, node);
5307
- request.pingedTasks.push(node);
5993
+ segment =
5994
+ thrownValue$63 === SuspenseException
5995
+ ? getThenableStateAfterSuspending()
5996
+ : null;
5997
+ segment = spawnNewSuspendedRenderTask(request, task, segment);
5998
+ request.pingedTasks.push(segment);
5308
5999
  task.formatContext = previousFormatContext;
5309
6000
  task.context = previousContext;
5310
6001
  task.keyPath = previousKeyPath;
@@ -5324,9 +6015,10 @@ function renderNode(request, task, node, childIndex) {
5324
6015
  throw node;
5325
6016
  }
5326
6017
  function abortTaskSoft(task) {
5327
- var boundary = task.blockedBoundary;
5328
- task = task.blockedSegment;
5329
- null !== task && ((task.status = 3), finishedTask(this, boundary, task));
6018
+ var boundary = task.blockedBoundary,
6019
+ segment = task.blockedSegment;
6020
+ null !== segment &&
6021
+ ((segment.status = 3), finishedTask(this, boundary, task.row, segment));
5330
6022
  }
5331
6023
  function abortRemainingReplayNodes(
5332
6024
  request$jscomp$0,
@@ -5353,6 +6045,7 @@ function abortRemainingReplayNodes(
5353
6045
  errorDigest = errorDigest$jscomp$0,
5354
6046
  resumedBoundary = createSuspenseBoundary(
5355
6047
  request,
6048
+ null,
5356
6049
  new Set(),
5357
6050
  null,
5358
6051
  null
@@ -5386,44 +6079,69 @@ function abortTask(task, request, error) {
5386
6079
  if (6 === segment.status) return;
5387
6080
  segment.status = 3;
5388
6081
  }
5389
- segment = getThrownInfo(task.componentStack);
6082
+ var errorInfo = getThrownInfo(task.componentStack);
5390
6083
  if (null === boundary) {
5391
6084
  if (13 !== request.status && 14 !== request.status) {
5392
6085
  boundary = task.replay;
5393
6086
  if (null === boundary) {
5394
- logRecoverableError(request, error, segment);
5395
- fatalError(request, error);
6087
+ null !== request.trackedPostpones && null !== segment
6088
+ ? ((boundary = request.trackedPostpones),
6089
+ logRecoverableError(request, error, errorInfo),
6090
+ trackPostpone(request, boundary, task, segment),
6091
+ finishedTask(request, null, task.row, segment))
6092
+ : (logRecoverableError(request, error, errorInfo),
6093
+ fatalError(request, error));
5396
6094
  return;
5397
6095
  }
5398
6096
  boundary.pendingTasks--;
5399
6097
  0 === boundary.pendingTasks &&
5400
6098
  0 < boundary.nodes.length &&
5401
- ((task = logRecoverableError(request, error, segment)),
6099
+ ((segment = logRecoverableError(request, error, errorInfo)),
5402
6100
  abortRemainingReplayNodes(
5403
6101
  request,
5404
6102
  null,
5405
6103
  boundary.nodes,
5406
6104
  boundary.slots,
5407
6105
  error,
5408
- task
6106
+ segment
5409
6107
  ));
5410
6108
  request.pendingRootTasks--;
5411
6109
  0 === request.pendingRootTasks && completeShell(request);
5412
6110
  }
5413
- } else
5414
- boundary.pendingTasks--,
5415
- 4 !== boundary.status &&
5416
- ((boundary.status = 4),
5417
- (task = logRecoverableError(request, error, segment)),
5418
- (boundary.status = 4),
5419
- (boundary.errorDigest = task),
5420
- untrackBoundary(request, boundary),
5421
- boundary.parentFlushed &&
5422
- request.clientRenderedBoundaries.push(boundary)),
5423
- boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
5424
- return abortTask(fallbackTask, request, error);
5425
- }),
5426
- boundary.fallbackAbortableTasks.clear();
6111
+ } else {
6112
+ var trackedPostpones$64 = request.trackedPostpones;
6113
+ if (4 !== boundary.status) {
6114
+ if (null !== trackedPostpones$64 && null !== segment)
6115
+ return (
6116
+ logRecoverableError(request, error, errorInfo),
6117
+ trackPostpone(request, trackedPostpones$64, task, segment),
6118
+ boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
6119
+ return abortTask(fallbackTask, request, error);
6120
+ }),
6121
+ boundary.fallbackAbortableTasks.clear(),
6122
+ finishedTask(request, boundary, task.row, segment)
6123
+ );
6124
+ boundary.status = 4;
6125
+ segment = logRecoverableError(request, error, errorInfo);
6126
+ boundary.status = 4;
6127
+ boundary.errorDigest = segment;
6128
+ untrackBoundary(request, boundary);
6129
+ boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary);
6130
+ }
6131
+ boundary.pendingTasks--;
6132
+ segment = boundary.row;
6133
+ null !== segment &&
6134
+ 0 === --segment.pendingTasks &&
6135
+ finishSuspenseListRow(request, segment);
6136
+ boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
6137
+ return abortTask(fallbackTask, request, error);
6138
+ });
6139
+ boundary.fallbackAbortableTasks.clear();
6140
+ }
6141
+ task = task.row;
6142
+ null !== task &&
6143
+ 0 === --task.pendingTasks &&
6144
+ finishSuspenseListRow(request, task);
5427
6145
  request.allPendingTasks--;
5428
6146
  0 === request.allPendingTasks && completeAll(request);
5429
6147
  }
@@ -5517,10 +6235,28 @@ function queueCompletedSegment(boundary, segment) {
5517
6235
  var childSegment = segment.children[0];
5518
6236
  childSegment.id = segment.id;
5519
6237
  childSegment.parentFlushed = !0;
5520
- 1 === childSegment.status && queueCompletedSegment(boundary, childSegment);
6238
+ (1 !== childSegment.status &&
6239
+ 3 !== childSegment.status &&
6240
+ 4 !== childSegment.status) ||
6241
+ queueCompletedSegment(boundary, childSegment);
5521
6242
  } else boundary.completedSegments.push(segment);
5522
6243
  }
5523
- function finishedTask(request, boundary, segment) {
6244
+ function finishedSegment(request, boundary, segment) {
6245
+ if (null !== byteLengthOfChunk) {
6246
+ segment = segment.chunks;
6247
+ for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
6248
+ segmentByteSize += segment[i].byteLength;
6249
+ null === boundary
6250
+ ? (request.byteSize += segmentByteSize)
6251
+ : (boundary.byteSize += segmentByteSize);
6252
+ }
6253
+ }
6254
+ function finishedTask(request, boundary, row, segment) {
6255
+ null !== row &&
6256
+ (0 === --row.pendingTasks
6257
+ ? finishSuspenseListRow(request, row)
6258
+ : row.together && tryToResolveTogetherRow(request, row));
6259
+ request.allPendingTasks--;
5524
6260
  if (null === boundary) {
5525
6261
  if (null !== segment && segment.parentFlushed) {
5526
6262
  if (null !== request.completedRootSegment)
@@ -5531,32 +6267,68 @@ function finishedTask(request, boundary, segment) {
5531
6267
  }
5532
6268
  request.pendingRootTasks--;
5533
6269
  0 === request.pendingRootTasks && completeShell(request);
5534
- } else
5535
- boundary.pendingTasks--,
5536
- 4 !== boundary.status &&
5537
- (0 === boundary.pendingTasks
5538
- ? (0 === boundary.status && (boundary.status = 1),
5539
- null !== segment &&
5540
- segment.parentFlushed &&
5541
- 1 === segment.status &&
5542
- queueCompletedSegment(boundary, segment),
5543
- boundary.parentFlushed &&
5544
- request.completedBoundaries.push(boundary),
5545
- 1 === boundary.status &&
5546
- (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
5547
- boundary.fallbackAbortableTasks.clear(),
5548
- 0 === request.pendingRootTasks &&
5549
- null === request.trackedPostpones &&
5550
- null !== boundary.contentPreamble &&
5551
- preparePreamble(request)))
5552
- : null !== segment &&
5553
- segment.parentFlushed &&
5554
- 1 === segment.status &&
5555
- (queueCompletedSegment(boundary, segment),
5556
- 1 === boundary.completedSegments.length &&
5557
- boundary.parentFlushed &&
5558
- request.partialBoundaries.push(boundary)));
5559
- request.allPendingTasks--;
6270
+ } else if ((boundary.pendingTasks--, 4 !== boundary.status))
6271
+ if (0 === boundary.pendingTasks)
6272
+ if (
6273
+ (0 === boundary.status && (boundary.status = 1),
6274
+ null !== segment &&
6275
+ segment.parentFlushed &&
6276
+ (1 === segment.status || 3 === segment.status) &&
6277
+ queueCompletedSegment(boundary, segment),
6278
+ boundary.parentFlushed && request.completedBoundaries.push(boundary),
6279
+ 1 === boundary.status)
6280
+ )
6281
+ (row = boundary.row),
6282
+ null !== row &&
6283
+ hoistHoistables(row.hoistables, boundary.contentState),
6284
+ isEligibleForOutlining(request, boundary) ||
6285
+ (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
6286
+ boundary.fallbackAbortableTasks.clear(),
6287
+ null !== row &&
6288
+ 0 === --row.pendingTasks &&
6289
+ finishSuspenseListRow(request, row)),
6290
+ 0 === request.pendingRootTasks &&
6291
+ null === request.trackedPostpones &&
6292
+ null !== boundary.contentPreamble &&
6293
+ preparePreamble(request);
6294
+ else {
6295
+ if (
6296
+ 5 === boundary.status &&
6297
+ ((boundary = boundary.row), null !== boundary)
6298
+ ) {
6299
+ if (null !== request.trackedPostpones) {
6300
+ row = request.trackedPostpones;
6301
+ var postponedRow = boundary.next;
6302
+ if (
6303
+ null !== postponedRow &&
6304
+ ((segment = postponedRow.boundaries), null !== segment)
6305
+ )
6306
+ for (
6307
+ postponedRow.boundaries = null, postponedRow = 0;
6308
+ postponedRow < segment.length;
6309
+ postponedRow++
6310
+ ) {
6311
+ var postponedBoundary = segment[postponedRow];
6312
+ trackPostponedBoundary(request, row, postponedBoundary);
6313
+ finishedTask(request, postponedBoundary, null, null);
6314
+ }
6315
+ }
6316
+ 0 === --boundary.pendingTasks &&
6317
+ finishSuspenseListRow(request, boundary);
6318
+ }
6319
+ }
6320
+ else
6321
+ null === segment ||
6322
+ !segment.parentFlushed ||
6323
+ (1 !== segment.status && 3 !== segment.status) ||
6324
+ (queueCompletedSegment(boundary, segment),
6325
+ 1 === boundary.completedSegments.length &&
6326
+ boundary.parentFlushed &&
6327
+ request.partialBoundaries.push(boundary)),
6328
+ (boundary = boundary.row),
6329
+ null !== boundary &&
6330
+ boundary.together &&
6331
+ tryToResolveTogetherRow(request, boundary);
5560
6332
  0 === request.allPendingTasks && completeAll(request);
5561
6333
  }
5562
6334
  function performWork(request$jscomp$2) {
@@ -5600,7 +6372,12 @@ function performWork(request$jscomp$2) {
5600
6372
  );
5601
6373
  task.replay.pendingTasks--;
5602
6374
  task.abortSet.delete(task);
5603
- finishedTask(request$jscomp$0, task.blockedBoundary, null);
6375
+ finishedTask(
6376
+ request$jscomp$0,
6377
+ task.blockedBoundary,
6378
+ task.row,
6379
+ null
6380
+ );
5604
6381
  } catch (thrownValue) {
5605
6382
  resetHooksState();
5606
6383
  var x =
@@ -5614,7 +6391,10 @@ function performWork(request$jscomp$2) {
5614
6391
  ) {
5615
6392
  var ping = task.ping;
5616
6393
  x.then(ping, ping);
5617
- task.thenableState = getThenableStateAfterSuspending();
6394
+ task.thenableState =
6395
+ thrownValue === SuspenseException
6396
+ ? getThenableStateAfterSuspending()
6397
+ : null;
5618
6398
  } else {
5619
6399
  task.replay.pendingTasks--;
5620
6400
  task.abortSet.delete(task);
@@ -5667,7 +6447,13 @@ function performWork(request$jscomp$2) {
5667
6447
  request$jscomp$1.chunks.push(textSeparator),
5668
6448
  task.abortSet.delete(task),
5669
6449
  (request$jscomp$1.status = 1),
5670
- finishedTask(request, task.blockedBoundary, request$jscomp$1);
6450
+ finishedSegment(request, task.blockedBoundary, request$jscomp$1),
6451
+ finishedTask(
6452
+ request,
6453
+ task.blockedBoundary,
6454
+ task.row,
6455
+ request$jscomp$1
6456
+ );
5671
6457
  } catch (thrownValue) {
5672
6458
  resetHooksState();
5673
6459
  request$jscomp$1.children.length = childrenLength;
@@ -5678,39 +6464,64 @@ function performWork(request$jscomp$2) {
5678
6464
  : 12 === request.status
5679
6465
  ? request.fatalError
5680
6466
  : thrownValue;
5681
- if (
6467
+ if (12 === request.status && null !== request.trackedPostpones) {
6468
+ var trackedPostpones = request.trackedPostpones,
6469
+ thrownInfo = getThrownInfo(task.componentStack);
6470
+ task.abortSet.delete(task);
6471
+ logRecoverableError(request, x$jscomp$0, thrownInfo);
6472
+ trackPostpone(request, trackedPostpones, task, request$jscomp$1);
6473
+ finishedTask(
6474
+ request,
6475
+ task.blockedBoundary,
6476
+ task.row,
6477
+ request$jscomp$1
6478
+ );
6479
+ } else if (
5682
6480
  "object" === typeof x$jscomp$0 &&
5683
6481
  null !== x$jscomp$0 &&
5684
6482
  "function" === typeof x$jscomp$0.then
5685
6483
  ) {
5686
6484
  request$jscomp$1.status = 0;
5687
- task.thenableState = getThenableStateAfterSuspending();
6485
+ task.thenableState =
6486
+ thrownValue === SuspenseException
6487
+ ? getThenableStateAfterSuspending()
6488
+ : null;
5688
6489
  var ping$jscomp$0 = task.ping;
5689
6490
  x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0);
5690
6491
  } else {
5691
6492
  var errorInfo$jscomp$0 = getThrownInfo(task.componentStack);
5692
6493
  task.abortSet.delete(task);
5693
6494
  request$jscomp$1.status = 4;
5694
- var boundary$jscomp$0 = task.blockedBoundary;
6495
+ var boundary$jscomp$0 = task.blockedBoundary,
6496
+ row = task.row;
6497
+ null !== row &&
6498
+ 0 === --row.pendingTasks &&
6499
+ finishSuspenseListRow(request, row);
6500
+ request.allPendingTasks--;
5695
6501
  request$jscomp$0 = logRecoverableError(
5696
6502
  request,
5697
6503
  x$jscomp$0,
5698
6504
  errorInfo$jscomp$0
5699
6505
  );
5700
- null === boundary$jscomp$0
5701
- ? fatalError(request, x$jscomp$0)
5702
- : (boundary$jscomp$0.pendingTasks--,
5703
- 4 !== boundary$jscomp$0.status &&
5704
- ((boundary$jscomp$0.status = 4),
5705
- (boundary$jscomp$0.errorDigest = request$jscomp$0),
5706
- untrackBoundary(request, boundary$jscomp$0),
5707
- boundary$jscomp$0.parentFlushed &&
5708
- request.clientRenderedBoundaries.push(boundary$jscomp$0),
5709
- 0 === request.pendingRootTasks &&
5710
- null === request.trackedPostpones &&
5711
- null !== boundary$jscomp$0.contentPreamble &&
5712
- preparePreamble(request)));
5713
- request.allPendingTasks--;
6506
+ if (null === boundary$jscomp$0) fatalError(request, x$jscomp$0);
6507
+ else if (
6508
+ (boundary$jscomp$0.pendingTasks--,
6509
+ 4 !== boundary$jscomp$0.status)
6510
+ ) {
6511
+ boundary$jscomp$0.status = 4;
6512
+ boundary$jscomp$0.errorDigest = request$jscomp$0;
6513
+ untrackBoundary(request, boundary$jscomp$0);
6514
+ var boundaryRow = boundary$jscomp$0.row;
6515
+ null !== boundaryRow &&
6516
+ 0 === --boundaryRow.pendingTasks &&
6517
+ finishSuspenseListRow(request, boundaryRow);
6518
+ boundary$jscomp$0.parentFlushed &&
6519
+ request.clientRenderedBoundaries.push(boundary$jscomp$0);
6520
+ 0 === request.pendingRootTasks &&
6521
+ null === request.trackedPostpones &&
6522
+ null !== boundary$jscomp$0.contentPreamble &&
6523
+ preparePreamble(request);
6524
+ }
5714
6525
  0 === request.allPendingTasks && completeAll(request);
5715
6526
  }
5716
6527
  } finally {
@@ -5766,6 +6577,7 @@ function preparePreambleFromSegment(
5766
6577
  switch (boundary.status) {
5767
6578
  case 1:
5768
6579
  hoistPreambleState(request.renderState, preamble);
6580
+ request.byteSize += boundary.byteSize;
5769
6581
  segment = boundary.completedSegments[0];
5770
6582
  if (!segment)
5771
6583
  throw Error(
@@ -5798,17 +6610,16 @@ function preparePreamble(request) {
5798
6610
  null === request.completedPreambleSegments
5799
6611
  ) {
5800
6612
  var collectedPreambleSegments = [],
6613
+ originalRequestByteSize = request.byteSize,
5801
6614
  hasPendingPreambles = preparePreambleFromSegment(
5802
6615
  request,
5803
6616
  request.completedRootSegment,
5804
6617
  collectedPreambleSegments
5805
6618
  ),
5806
6619
  preamble = request.renderState.preamble;
5807
- if (
5808
- !1 === hasPendingPreambles ||
5809
- (preamble.headChunks && preamble.bodyChunks)
5810
- )
5811
- request.completedPreambleSegments = collectedPreambleSegments;
6620
+ !1 === hasPendingPreambles || (preamble.headChunks && preamble.bodyChunks)
6621
+ ? (request.completedPreambleSegments = collectedPreambleSegments)
6622
+ : (request.byteSize = originalRequestByteSize);
5812
6623
  }
5813
6624
  }
5814
6625
  function flushSubtree(request, destination, segment, hoistableState) {
@@ -5844,38 +6655,39 @@ function flushSubtree(request, destination, segment, hoistableState) {
5844
6655
  chunkIdx < chunks.length &&
5845
6656
  (r = writeChunkAndReturn(destination, chunks[chunkIdx]));
5846
6657
  return r;
6658
+ case 3:
6659
+ return !0;
5847
6660
  default:
5848
6661
  throw Error(
5849
6662
  "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React."
5850
6663
  );
5851
6664
  }
5852
6665
  }
6666
+ var flushedByteSize = 0;
5853
6667
  function flushSegment(request, destination, segment, hoistableState) {
5854
6668
  var boundary = segment.boundary;
5855
6669
  if (null === boundary)
5856
6670
  return flushSubtree(request, destination, segment, hoistableState);
5857
6671
  boundary.parentFlushed = !0;
5858
6672
  if (4 === boundary.status) {
5859
- var errorDigest = boundary.errorDigest;
6673
+ var row = boundary.row;
6674
+ null !== row &&
6675
+ 0 === --row.pendingTasks &&
6676
+ finishSuspenseListRow(request, row);
6677
+ boundary = boundary.errorDigest;
5860
6678
  writeChunkAndReturn(destination, startClientRenderedSuspenseBoundary);
5861
6679
  writeChunk(destination, clientRenderedSuspenseBoundaryError1);
5862
- errorDigest &&
6680
+ boundary &&
5863
6681
  (writeChunk(destination, clientRenderedSuspenseBoundaryError1A),
5864
- writeChunk(destination, stringToChunk(escapeTextForBrowser(errorDigest))),
6682
+ writeChunk(destination, stringToChunk(escapeTextForBrowser(boundary))),
5865
6683
  writeChunk(
5866
6684
  destination,
5867
6685
  clientRenderedSuspenseBoundaryErrorAttrInterstitial
5868
6686
  ));
5869
6687
  writeChunkAndReturn(destination, clientRenderedSuspenseBoundaryError2);
5870
6688
  flushSubtree(request, destination, segment, hoistableState);
5871
- (request = boundary.fallbackPreamble) &&
5872
- writePreambleContribution(destination, request);
5873
- return writeChunkAndReturn(destination, endSuspenseBoundary);
5874
- }
5875
- if (1 !== boundary.status)
5876
- return (
5877
- 0 === boundary.status &&
5878
- (boundary.rootSegmentID = request.nextSegmentId++),
6689
+ } else if (1 !== boundary.status)
6690
+ 0 === boundary.status && (boundary.rootSegmentID = request.nextSegmentId++),
5879
6691
  0 < boundary.completedSegments.length &&
5880
6692
  request.partialBoundaries.push(boundary),
5881
6693
  writeStartPendingSuspenseBoundary(
@@ -5883,41 +6695,38 @@ function flushSegment(request, destination, segment, hoistableState) {
5883
6695
  request.renderState,
5884
6696
  boundary.rootSegmentID
5885
6697
  ),
5886
- hoistableState &&
5887
- ((boundary = boundary.fallbackState),
5888
- boundary.styles.forEach(hoistStyleQueueDependency, hoistableState),
5889
- boundary.stylesheets.forEach(
5890
- hoistStylesheetDependency,
5891
- hoistableState
5892
- )),
5893
- flushSubtree(request, destination, segment, hoistableState),
5894
- writeChunkAndReturn(destination, endSuspenseBoundary)
5895
- );
5896
- if (boundary.byteSize > request.progressiveChunkSize)
5897
- return (
5898
- (boundary.rootSegmentID = request.nextSegmentId++),
6698
+ hoistableState && hoistHoistables(hoistableState, boundary.fallbackState),
6699
+ flushSubtree(request, destination, segment, hoistableState);
6700
+ else if (
6701
+ !flushingPartialBoundaries &&
6702
+ isEligibleForOutlining(request, boundary) &&
6703
+ (flushedByteSize + boundary.byteSize > request.progressiveChunkSize ||
6704
+ hasSuspenseyContent(boundary.contentState))
6705
+ )
6706
+ (boundary.rootSegmentID = request.nextSegmentId++),
5899
6707
  request.completedBoundaries.push(boundary),
5900
6708
  writeStartPendingSuspenseBoundary(
5901
6709
  destination,
5902
6710
  request.renderState,
5903
6711
  boundary.rootSegmentID
5904
6712
  ),
5905
- flushSubtree(request, destination, segment, hoistableState),
5906
- writeChunkAndReturn(destination, endSuspenseBoundary)
5907
- );
5908
- hoistableState &&
5909
- ((segment = boundary.contentState),
5910
- segment.styles.forEach(hoistStyleQueueDependency, hoistableState),
5911
- segment.stylesheets.forEach(hoistStylesheetDependency, hoistableState));
5912
- writeChunkAndReturn(destination, startCompletedSuspenseBoundary);
5913
- segment = boundary.completedSegments;
5914
- if (1 !== segment.length)
5915
- throw Error(
5916
- "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
5917
- );
5918
- flushSegment(request, destination, segment[0], hoistableState);
5919
- (request = boundary.contentPreamble) &&
5920
- writePreambleContribution(destination, request);
6713
+ flushSubtree(request, destination, segment, hoistableState);
6714
+ else {
6715
+ flushedByteSize += boundary.byteSize;
6716
+ hoistableState && hoistHoistables(hoistableState, boundary.contentState);
6717
+ segment = boundary.row;
6718
+ null !== segment &&
6719
+ isEligibleForOutlining(request, boundary) &&
6720
+ 0 === --segment.pendingTasks &&
6721
+ finishSuspenseListRow(request, segment);
6722
+ writeChunkAndReturn(destination, startCompletedSuspenseBoundary);
6723
+ segment = boundary.completedSegments;
6724
+ if (1 !== segment.length)
6725
+ throw Error(
6726
+ "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
6727
+ );
6728
+ flushSegment(request, destination, segment[0], hoistableState);
6729
+ }
5921
6730
  return writeChunkAndReturn(destination, endSuspenseBoundary);
5922
6731
  }
5923
6732
  function flushSegmentContainer(request, destination, segment, hoistableState) {
@@ -5931,6 +6740,7 @@ function flushSegmentContainer(request, destination, segment, hoistableState) {
5931
6740
  return writeEndSegment(destination, segment.parentFormatContext);
5932
6741
  }
5933
6742
  function flushCompletedBoundary(request, destination, boundary) {
6743
+ flushedByteSize = boundary.byteSize;
5934
6744
  for (
5935
6745
  var completedSegments = boundary.completedSegments, i = 0;
5936
6746
  i < completedSegments.length;
@@ -5943,6 +6753,11 @@ function flushCompletedBoundary(request, destination, boundary) {
5943
6753
  completedSegments[i]
5944
6754
  );
5945
6755
  completedSegments.length = 0;
6756
+ completedSegments = boundary.row;
6757
+ null !== completedSegments &&
6758
+ isEligibleForOutlining(request, boundary) &&
6759
+ 0 === --completedSegments.pendingTasks &&
6760
+ finishSuspenseListRow(request, completedSegments);
5946
6761
  writeHoistablesForBoundary(
5947
6762
  destination,
5948
6763
  boundary.contentState,
@@ -5955,18 +6770,22 @@ function flushCompletedBoundary(request, destination, boundary) {
5955
6770
  var requiresStyleInsertion = request.stylesToHoist;
5956
6771
  request.stylesToHoist = !1;
5957
6772
  writeChunk(destination, request.startInlineScript);
6773
+ writeChunk(destination, endOfStartTag);
5958
6774
  requiresStyleInsertion
5959
- ? 0 === (completedSegments.instructions & 2)
5960
- ? ((completedSegments.instructions |= 10),
5961
- writeChunk(destination, completeBoundaryWithStylesScript1FullBoth))
5962
- : 0 === (completedSegments.instructions & 8)
6775
+ ? (0 === (completedSegments.instructions & 4) &&
6776
+ ((completedSegments.instructions |= 4),
6777
+ writeChunk(destination, clientRenderScriptFunctionOnly)),
6778
+ 0 === (completedSegments.instructions & 2) &&
6779
+ ((completedSegments.instructions |= 2),
6780
+ writeChunk(destination, completeBoundaryScriptFunctionOnly)),
6781
+ 0 === (completedSegments.instructions & 8)
5963
6782
  ? ((completedSegments.instructions |= 8),
5964
6783
  writeChunk(destination, completeBoundaryWithStylesScript1FullPartial))
5965
- : writeChunk(destination, completeBoundaryWithStylesScript1Partial)
5966
- : 0 === (completedSegments.instructions & 2)
5967
- ? ((completedSegments.instructions |= 2),
5968
- writeChunk(destination, completeBoundaryScript1Full))
5969
- : writeChunk(destination, completeBoundaryScript1Partial);
6784
+ : writeChunk(destination, completeBoundaryWithStylesScript1Partial))
6785
+ : (0 === (completedSegments.instructions & 2) &&
6786
+ ((completedSegments.instructions |= 2),
6787
+ writeChunk(destination, completeBoundaryScriptFunctionOnly)),
6788
+ writeChunk(destination, completeBoundaryScript1Partial));
5970
6789
  completedSegments = stringToChunk(i.toString(16));
5971
6790
  writeChunk(destination, request.boundaryPrefix);
5972
6791
  writeChunk(destination, completedSegments);
@@ -6002,6 +6821,7 @@ function flushPartiallyCompletedSegment(
6002
6821
  boundary = request.resumableState;
6003
6822
  request = request.renderState;
6004
6823
  writeChunk(destination, request.startInlineScript);
6824
+ writeChunk(destination, endOfStartTag);
6005
6825
  0 === (boundary.instructions & 1)
6006
6826
  ? ((boundary.instructions |= 1),
6007
6827
  writeChunk(destination, completeSegmentScript1Full))
@@ -6015,6 +6835,7 @@ function flushPartiallyCompletedSegment(
6015
6835
  destination = writeChunkAndReturn(destination, completeSegmentScriptEnd);
6016
6836
  return destination;
6017
6837
  }
6838
+ var flushingPartialBoundaries = !1;
6018
6839
  function flushCompletedQueues(request, destination) {
6019
6840
  currentView = new Uint8Array(2048);
6020
6841
  writtenBytes = 0;
@@ -6026,7 +6847,9 @@ function flushCompletedQueues(request, destination) {
6026
6847
  if (5 === completedRootSegment.status) return;
6027
6848
  var completedPreambleSegments = request.completedPreambleSegments;
6028
6849
  if (null === completedPreambleSegments) return;
6029
- var renderState = request.renderState,
6850
+ flushedByteSize = request.byteSize;
6851
+ var resumableState = request.resumableState,
6852
+ renderState = request.renderState,
6030
6853
  preamble = renderState.preamble,
6031
6854
  htmlChunks = preamble.htmlChunks,
6032
6855
  headChunks = preamble.headChunks,
@@ -6057,7 +6880,9 @@ function flushCompletedQueues(request, destination) {
6057
6880
  renderState.fontPreloads.clear();
6058
6881
  renderState.highImagePreloads.forEach(flushResource, destination);
6059
6882
  renderState.highImagePreloads.clear();
6883
+ currentlyFlushingRenderState = renderState;
6060
6884
  renderState.styles.forEach(flushStylesInPreamble, destination);
6885
+ currentlyFlushingRenderState = null;
6061
6886
  var importMapChunks = renderState.importMapChunks;
6062
6887
  for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
6063
6888
  writeChunk(destination, importMapChunks[i$jscomp$0]);
@@ -6067,17 +6892,18 @@ function flushCompletedQueues(request, destination) {
6067
6892
  renderState.scripts.clear();
6068
6893
  renderState.bulkPreloads.forEach(flushResource, destination);
6069
6894
  renderState.bulkPreloads.clear();
6895
+ htmlChunks || headChunks || (resumableState.instructions |= 32);
6070
6896
  var hoistableChunks = renderState.hoistableChunks;
6071
6897
  for (i$jscomp$0 = 0; i$jscomp$0 < hoistableChunks.length; i$jscomp$0++)
6072
6898
  writeChunk(destination, hoistableChunks[i$jscomp$0]);
6073
6899
  for (
6074
- renderState = hoistableChunks.length = 0;
6075
- renderState < completedPreambleSegments.length;
6076
- renderState++
6900
+ resumableState = hoistableChunks.length = 0;
6901
+ resumableState < completedPreambleSegments.length;
6902
+ resumableState++
6077
6903
  ) {
6078
- var segments = completedPreambleSegments[renderState];
6079
- for (preamble = 0; preamble < segments.length; preamble++)
6080
- flushSegment(request, destination, segments[preamble], null);
6904
+ var segments = completedPreambleSegments[resumableState];
6905
+ for (renderState = 0; renderState < segments.length; renderState++)
6906
+ flushSegment(request, destination, segments[renderState], null);
6081
6907
  }
6082
6908
  var preamble$jscomp$0 = request.renderState.preamble,
6083
6909
  headChunks$jscomp$0 = preamble$jscomp$0.headChunks;
@@ -6093,11 +6919,39 @@ function flushCompletedQueues(request, destination) {
6093
6919
  writeChunk(destination, bodyChunks[completedPreambleSegments]);
6094
6920
  flushSegment(request, destination, completedRootSegment, null);
6095
6921
  request.completedRootSegment = null;
6096
- writeBootstrap(destination, request.renderState);
6922
+ var renderState$jscomp$0 = request.renderState;
6923
+ if (
6924
+ 0 !== request.allPendingTasks ||
6925
+ 0 !== request.clientRenderedBoundaries.length ||
6926
+ 0 !== request.completedBoundaries.length ||
6927
+ (null !== request.trackedPostpones &&
6928
+ (0 !== request.trackedPostpones.rootNodes.length ||
6929
+ null !== request.trackedPostpones.rootSlots))
6930
+ ) {
6931
+ var resumableState$jscomp$0 = request.resumableState;
6932
+ if (0 === (resumableState$jscomp$0.instructions & 64)) {
6933
+ resumableState$jscomp$0.instructions |= 64;
6934
+ writeChunk(destination, renderState$jscomp$0.startInlineScript);
6935
+ if (0 === (resumableState$jscomp$0.instructions & 32)) {
6936
+ resumableState$jscomp$0.instructions |= 32;
6937
+ var shellId = "_" + resumableState$jscomp$0.idPrefix + "R_";
6938
+ writeChunk(destination, completedShellIdAttributeStart);
6939
+ writeChunk(
6940
+ destination,
6941
+ stringToChunk(escapeTextForBrowser(shellId))
6942
+ );
6943
+ writeChunk(destination, attributeEnd);
6944
+ }
6945
+ writeChunk(destination, endOfStartTag);
6946
+ writeChunk(destination, shellTimeRuntimeScript);
6947
+ writeChunkAndReturn(destination, endInlineScript);
6948
+ }
6949
+ }
6950
+ writeBootstrap(destination, renderState$jscomp$0);
6097
6951
  }
6098
- var renderState$jscomp$0 = request.renderState;
6952
+ var renderState$jscomp$1 = request.renderState;
6099
6953
  completedRootSegment = 0;
6100
- var viewportChunks$jscomp$0 = renderState$jscomp$0.viewportChunks;
6954
+ var viewportChunks$jscomp$0 = renderState$jscomp$1.viewportChunks;
6101
6955
  for (
6102
6956
  completedRootSegment = 0;
6103
6957
  completedRootSegment < viewportChunks$jscomp$0.length;
@@ -6105,21 +6959,21 @@ function flushCompletedQueues(request, destination) {
6105
6959
  )
6106
6960
  writeChunk(destination, viewportChunks$jscomp$0[completedRootSegment]);
6107
6961
  viewportChunks$jscomp$0.length = 0;
6108
- renderState$jscomp$0.preconnects.forEach(flushResource, destination);
6109
- renderState$jscomp$0.preconnects.clear();
6110
- renderState$jscomp$0.fontPreloads.forEach(flushResource, destination);
6111
- renderState$jscomp$0.fontPreloads.clear();
6112
- renderState$jscomp$0.highImagePreloads.forEach(
6962
+ renderState$jscomp$1.preconnects.forEach(flushResource, destination);
6963
+ renderState$jscomp$1.preconnects.clear();
6964
+ renderState$jscomp$1.fontPreloads.forEach(flushResource, destination);
6965
+ renderState$jscomp$1.fontPreloads.clear();
6966
+ renderState$jscomp$1.highImagePreloads.forEach(
6113
6967
  flushResource,
6114
6968
  destination
6115
6969
  );
6116
- renderState$jscomp$0.highImagePreloads.clear();
6117
- renderState$jscomp$0.styles.forEach(preloadLateStyles, destination);
6118
- renderState$jscomp$0.scripts.forEach(flushResource, destination);
6119
- renderState$jscomp$0.scripts.clear();
6120
- renderState$jscomp$0.bulkPreloads.forEach(flushResource, destination);
6121
- renderState$jscomp$0.bulkPreloads.clear();
6122
- var hoistableChunks$jscomp$0 = renderState$jscomp$0.hoistableChunks;
6970
+ renderState$jscomp$1.highImagePreloads.clear();
6971
+ renderState$jscomp$1.styles.forEach(preloadLateStyles, destination);
6972
+ renderState$jscomp$1.scripts.forEach(flushResource, destination);
6973
+ renderState$jscomp$1.scripts.clear();
6974
+ renderState$jscomp$1.bulkPreloads.forEach(flushResource, destination);
6975
+ renderState$jscomp$1.bulkPreloads.clear();
6976
+ var hoistableChunks$jscomp$0 = renderState$jscomp$1.hoistableChunks;
6123
6977
  for (
6124
6978
  completedRootSegment = 0;
6125
6979
  completedRootSegment < hoistableChunks$jscomp$0.length;
@@ -6130,35 +6984,36 @@ function flushCompletedQueues(request, destination) {
6130
6984
  var clientRenderedBoundaries = request.clientRenderedBoundaries;
6131
6985
  for (i = 0; i < clientRenderedBoundaries.length; i++) {
6132
6986
  var boundary = clientRenderedBoundaries[i];
6133
- renderState$jscomp$0 = destination;
6134
- var resumableState = request.resumableState,
6135
- renderState$jscomp$1 = request.renderState,
6987
+ renderState$jscomp$1 = destination;
6988
+ var resumableState$jscomp$1 = request.resumableState,
6989
+ renderState$jscomp$2 = request.renderState,
6136
6990
  id = boundary.rootSegmentID,
6137
6991
  errorDigest = boundary.errorDigest;
6138
6992
  writeChunk(
6139
- renderState$jscomp$0,
6140
- renderState$jscomp$1.startInlineScript
6993
+ renderState$jscomp$1,
6994
+ renderState$jscomp$2.startInlineScript
6141
6995
  );
6142
- 0 === (resumableState.instructions & 4)
6143
- ? ((resumableState.instructions |= 4),
6144
- writeChunk(renderState$jscomp$0, clientRenderScript1Full))
6145
- : writeChunk(renderState$jscomp$0, clientRenderScript1Partial);
6146
- writeChunk(renderState$jscomp$0, renderState$jscomp$1.boundaryPrefix);
6147
- writeChunk(renderState$jscomp$0, stringToChunk(id.toString(16)));
6148
- writeChunk(renderState$jscomp$0, clientRenderScript1A);
6996
+ writeChunk(renderState$jscomp$1, endOfStartTag);
6997
+ 0 === (resumableState$jscomp$1.instructions & 4)
6998
+ ? ((resumableState$jscomp$1.instructions |= 4),
6999
+ writeChunk(renderState$jscomp$1, clientRenderScript1Full))
7000
+ : writeChunk(renderState$jscomp$1, clientRenderScript1Partial);
7001
+ writeChunk(renderState$jscomp$1, renderState$jscomp$2.boundaryPrefix);
7002
+ writeChunk(renderState$jscomp$1, stringToChunk(id.toString(16)));
7003
+ writeChunk(renderState$jscomp$1, clientRenderScript1A);
6149
7004
  errorDigest &&
6150
7005
  (writeChunk(
6151
- renderState$jscomp$0,
7006
+ renderState$jscomp$1,
6152
7007
  clientRenderErrorScriptArgInterstitial
6153
7008
  ),
6154
7009
  writeChunk(
6155
- renderState$jscomp$0,
7010
+ renderState$jscomp$1,
6156
7011
  stringToChunk(
6157
7012
  escapeJSStringsForInstructionScripts(errorDigest || "")
6158
7013
  )
6159
7014
  ));
6160
7015
  var JSCompiler_inline_result = writeChunkAndReturn(
6161
- renderState$jscomp$0,
7016
+ renderState$jscomp$1,
6162
7017
  clientRenderScriptEnd
6163
7018
  );
6164
7019
  if (!JSCompiler_inline_result) {
@@ -6183,13 +7038,15 @@ function flushCompletedQueues(request, destination) {
6183
7038
  completeWriting(destination);
6184
7039
  currentView = new Uint8Array(2048);
6185
7040
  writtenBytes = 0;
7041
+ flushingPartialBoundaries = !0;
6186
7042
  var partialBoundaries = request.partialBoundaries;
6187
7043
  for (i = 0; i < partialBoundaries.length; i++) {
6188
- var boundary$51 = partialBoundaries[i];
7044
+ var boundary$70 = partialBoundaries[i];
6189
7045
  a: {
6190
7046
  clientRenderedBoundaries = request;
6191
7047
  boundary = destination;
6192
- var completedSegments = boundary$51.completedSegments;
7048
+ flushedByteSize = boundary$70.byteSize;
7049
+ var completedSegments = boundary$70.completedSegments;
6193
7050
  for (
6194
7051
  JSCompiler_inline_result = 0;
6195
7052
  JSCompiler_inline_result < completedSegments.length;
@@ -6199,7 +7056,7 @@ function flushCompletedQueues(request, destination) {
6199
7056
  !flushPartiallyCompletedSegment(
6200
7057
  clientRenderedBoundaries,
6201
7058
  boundary,
6202
- boundary$51,
7059
+ boundary$70,
6203
7060
  completedSegments[JSCompiler_inline_result]
6204
7061
  )
6205
7062
  ) {
@@ -6209,9 +7066,20 @@ function flushCompletedQueues(request, destination) {
6209
7066
  break a;
6210
7067
  }
6211
7068
  completedSegments.splice(0, JSCompiler_inline_result);
7069
+ var row = boundary$70.row;
7070
+ null !== row &&
7071
+ row.together &&
7072
+ 1 === boundary$70.pendingTasks &&
7073
+ (1 === row.pendingTasks
7074
+ ? unblockSuspenseListRow(
7075
+ clientRenderedBoundaries,
7076
+ row,
7077
+ row.hoistables
7078
+ )
7079
+ : row.pendingTasks--);
6212
7080
  JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
6213
7081
  boundary,
6214
- boundary$51.contentState,
7082
+ boundary$70.contentState,
6215
7083
  clientRenderedBoundaries.renderState
6216
7084
  );
6217
7085
  }
@@ -6223,6 +7091,7 @@ function flushCompletedQueues(request, destination) {
6223
7091
  }
6224
7092
  }
6225
7093
  partialBoundaries.splice(0, i);
7094
+ flushingPartialBoundaries = !1;
6226
7095
  var largeBoundaries = request.completedBoundaries;
6227
7096
  for (i = 0; i < largeBoundaries.length; i++)
6228
7097
  if (!flushCompletedBoundary(request, destination, largeBoundaries[i])) {
@@ -6234,19 +7103,19 @@ function flushCompletedQueues(request, destination) {
6234
7103
  largeBoundaries.splice(0, i);
6235
7104
  }
6236
7105
  } finally {
6237
- 0 === request.allPendingTasks &&
6238
- 0 === request.pingedTasks.length &&
6239
- 0 === request.clientRenderedBoundaries.length &&
6240
- 0 === request.completedBoundaries.length
6241
- ? ((request.flushScheduled = !1),
6242
- (i = request.resumableState),
6243
- i.hasBody && writeChunk(destination, endChunkForTag("body")),
6244
- i.hasHtml && writeChunk(destination, endChunkForTag("html")),
6245
- completeWriting(destination),
6246
- (request.status = 14),
6247
- destination.close(),
6248
- (request.destination = null))
6249
- : completeWriting(destination);
7106
+ (flushingPartialBoundaries = !1),
7107
+ 0 === request.allPendingTasks &&
7108
+ 0 === request.clientRenderedBoundaries.length &&
7109
+ 0 === request.completedBoundaries.length
7110
+ ? ((request.flushScheduled = !1),
7111
+ (i = request.resumableState),
7112
+ i.hasBody && writeChunk(destination, endChunkForTag("body")),
7113
+ i.hasHtml && writeChunk(destination, endChunkForTag("html")),
7114
+ completeWriting(destination),
7115
+ (request.status = 14),
7116
+ destination.close(),
7117
+ (request.destination = null))
7118
+ : completeWriting(destination);
6250
7119
  }
6251
7120
  }
6252
7121
  function startWork(request) {
@@ -6318,17 +7187,75 @@ function abort(request, reason) {
6318
7187
  }
6319
7188
  null !== request.destination &&
6320
7189
  flushCompletedQueues(request, request.destination);
6321
- } catch (error$53) {
6322
- logRecoverableError(request, error$53, {}), fatalError(request, error$53);
7190
+ } catch (error$72) {
7191
+ logRecoverableError(request, error$72, {}), fatalError(request, error$72);
6323
7192
  }
6324
7193
  }
7194
+ function addToReplayParent(node, parentKeyPath, trackedPostpones) {
7195
+ if (null === parentKeyPath) trackedPostpones.rootNodes.push(node);
7196
+ else {
7197
+ var workingMap = trackedPostpones.workingMap,
7198
+ parentNode = workingMap.get(parentKeyPath);
7199
+ void 0 === parentNode &&
7200
+ ((parentNode = [parentKeyPath[1], parentKeyPath[2], [], null]),
7201
+ workingMap.set(parentKeyPath, parentNode),
7202
+ addToReplayParent(parentNode, parentKeyPath[0], trackedPostpones));
7203
+ parentNode[2].push(node);
7204
+ }
7205
+ }
7206
+ function getPostponedState(request) {
7207
+ var trackedPostpones = request.trackedPostpones;
7208
+ if (
7209
+ null === trackedPostpones ||
7210
+ (0 === trackedPostpones.rootNodes.length &&
7211
+ null === trackedPostpones.rootSlots)
7212
+ )
7213
+ return (request.trackedPostpones = null);
7214
+ if (
7215
+ null === request.completedRootSegment ||
7216
+ (5 !== request.completedRootSegment.status &&
7217
+ null !== request.completedPreambleSegments)
7218
+ ) {
7219
+ var nextSegmentId = request.nextSegmentId;
7220
+ var replaySlots = trackedPostpones.rootSlots;
7221
+ var resumableState = request.resumableState;
7222
+ resumableState.bootstrapScriptContent = void 0;
7223
+ resumableState.bootstrapScripts = void 0;
7224
+ resumableState.bootstrapModules = void 0;
7225
+ } else {
7226
+ nextSegmentId = 0;
7227
+ replaySlots = -1;
7228
+ resumableState = request.resumableState;
7229
+ var renderState = request.renderState;
7230
+ resumableState.nextFormID = 0;
7231
+ resumableState.hasBody = !1;
7232
+ resumableState.hasHtml = !1;
7233
+ resumableState.unknownResources = { font: renderState.resets.font };
7234
+ resumableState.dnsResources = renderState.resets.dns;
7235
+ resumableState.connectResources = renderState.resets.connect;
7236
+ resumableState.imageResources = renderState.resets.image;
7237
+ resumableState.styleResources = renderState.resets.style;
7238
+ resumableState.scriptResources = {};
7239
+ resumableState.moduleUnknownResources = {};
7240
+ resumableState.moduleScriptResources = {};
7241
+ resumableState.instructions = 0;
7242
+ }
7243
+ return {
7244
+ nextSegmentId: nextSegmentId,
7245
+ rootFormatContext: request.rootFormatContext,
7246
+ progressiveChunkSize: request.progressiveChunkSize,
7247
+ resumableState: request.resumableState,
7248
+ replayNodes: trackedPostpones.rootNodes,
7249
+ replaySlots: replaySlots
7250
+ };
7251
+ }
6325
7252
  function ensureCorrectIsomorphicReactVersion() {
6326
7253
  var isomorphicReactPackageVersion = React.version;
6327
- if ("19.1.0" !== isomorphicReactPackageVersion)
7254
+ if ("19.2.4" !== isomorphicReactPackageVersion)
6328
7255
  throw Error(
6329
7256
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
6330
7257
  (isomorphicReactPackageVersion +
6331
- "\n - react-dom: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
7258
+ "\n - react-dom: 19.2.4\nLearn more: https://react.dev/warnings/version-mismatch")
6332
7259
  );
6333
7260
  }
6334
7261
  ensureCorrectIsomorphicReactVersion();
@@ -6363,22 +7290,21 @@ exports.prerender = function (children, options) {
6363
7290
  options ? options.progressiveChunkSize : void 0,
6364
7291
  options ? options.onError : void 0,
6365
7292
  function () {
6366
- var result = {
6367
- prelude: new ReadableStream(
6368
- {
6369
- type: "bytes",
6370
- pull: function (controller) {
6371
- startFlowing(request, controller);
6372
- },
6373
- cancel: function (reason) {
6374
- request.destination = null;
6375
- abort(request, reason);
6376
- }
7293
+ var stream = new ReadableStream(
7294
+ {
7295
+ type: "bytes",
7296
+ pull: function (controller) {
7297
+ startFlowing(request, controller);
6377
7298
  },
6378
- { highWaterMark: 0 }
6379
- )
6380
- };
6381
- resolve(result);
7299
+ cancel: function (reason) {
7300
+ request.destination = null;
7301
+ abort(request, reason);
7302
+ }
7303
+ },
7304
+ { highWaterMark: 0 }
7305
+ );
7306
+ stream = { postponed: getPostponedState(request), prelude: stream };
7307
+ resolve(stream);
6382
7308
  },
6383
7309
  void 0,
6384
7310
  void 0,
@@ -6474,4 +7400,113 @@ exports.renderToReadableStream = function (children, options) {
6474
7400
  startWork(request);
6475
7401
  });
6476
7402
  };
6477
- exports.version = "19.1.0";
7403
+ exports.resume = function (children, postponedState, options) {
7404
+ return new Promise(function (resolve, reject) {
7405
+ var onFatalError,
7406
+ onAllReady,
7407
+ allReady = new Promise(function (res, rej) {
7408
+ onAllReady = res;
7409
+ onFatalError = rej;
7410
+ }),
7411
+ request = resumeRequest(
7412
+ children,
7413
+ postponedState,
7414
+ createRenderState(
7415
+ postponedState.resumableState,
7416
+ options ? options.nonce : void 0,
7417
+ void 0,
7418
+ void 0,
7419
+ void 0,
7420
+ void 0
7421
+ ),
7422
+ options ? options.onError : void 0,
7423
+ onAllReady,
7424
+ function () {
7425
+ var stream = new ReadableStream(
7426
+ {
7427
+ type: "bytes",
7428
+ pull: function (controller) {
7429
+ startFlowing(request, controller);
7430
+ },
7431
+ cancel: function (reason) {
7432
+ request.destination = null;
7433
+ abort(request, reason);
7434
+ }
7435
+ },
7436
+ { highWaterMark: 0 }
7437
+ );
7438
+ stream.allReady = allReady;
7439
+ resolve(stream);
7440
+ },
7441
+ function (error) {
7442
+ allReady.catch(function () {});
7443
+ reject(error);
7444
+ },
7445
+ onFatalError,
7446
+ options ? options.onPostpone : void 0
7447
+ );
7448
+ if (options && options.signal) {
7449
+ var signal = options.signal;
7450
+ if (signal.aborted) abort(request, signal.reason);
7451
+ else {
7452
+ var listener = function () {
7453
+ abort(request, signal.reason);
7454
+ signal.removeEventListener("abort", listener);
7455
+ };
7456
+ signal.addEventListener("abort", listener);
7457
+ }
7458
+ }
7459
+ startWork(request);
7460
+ });
7461
+ };
7462
+ exports.resumeAndPrerender = function (children, postponedState, options) {
7463
+ return new Promise(function (resolve, reject) {
7464
+ var request = resumeAndPrerenderRequest(
7465
+ children,
7466
+ postponedState,
7467
+ createRenderState(
7468
+ postponedState.resumableState,
7469
+ void 0,
7470
+ void 0,
7471
+ void 0,
7472
+ void 0,
7473
+ void 0
7474
+ ),
7475
+ options ? options.onError : void 0,
7476
+ function () {
7477
+ var stream = new ReadableStream(
7478
+ {
7479
+ type: "bytes",
7480
+ pull: function (controller) {
7481
+ startFlowing(request, controller);
7482
+ },
7483
+ cancel: function (reason) {
7484
+ request.destination = null;
7485
+ abort(request, reason);
7486
+ }
7487
+ },
7488
+ { highWaterMark: 0 }
7489
+ );
7490
+ stream = { postponed: getPostponedState(request), prelude: stream };
7491
+ resolve(stream);
7492
+ },
7493
+ void 0,
7494
+ void 0,
7495
+ reject,
7496
+ options ? options.onPostpone : void 0
7497
+ );
7498
+ if (options && options.signal) {
7499
+ var signal = options.signal;
7500
+ if (signal.aborted) abort(request, signal.reason);
7501
+ else {
7502
+ var listener = function () {
7503
+ abort(request, signal.reason);
7504
+ signal.removeEventListener("abort", listener);
7505
+ };
7506
+ signal.addEventListener("abort", listener);
7507
+ }
7508
+ }
7509
+ startWork(request);
7510
+ });
7511
+ };
7512
+ exports.version = "19.2.4";