| [a762898] | 1 | /**
|
|---|
| 2 | * @license React
|
|---|
| 3 | * react-dom-server.bun.production.js
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) Meta Platforms, Inc. and affiliates.
|
|---|
| 6 | *
|
|---|
| 7 | * This source code is licensed under the MIT license found in the
|
|---|
| 8 | * LICENSE file in the root directory of this source tree.
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | "use strict";
|
|---|
| 12 | var React = require("react"),
|
|---|
| 13 | ReactDOM = require("react-dom"),
|
|---|
| 14 | REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|---|
| 15 | REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|---|
| 16 | REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|---|
| 17 | REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|---|
| 18 | REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|---|
| 19 | REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|---|
| 20 | REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|---|
| 21 | REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|---|
| 22 | REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|---|
| 23 | REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|---|
| 24 | REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|---|
| 25 | REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|---|
| 26 | REACT_SCOPE_TYPE = Symbol.for("react.scope"),
|
|---|
| 27 | REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|---|
| 28 | REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
|
|---|
| 29 | REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
|
|---|
| 30 | REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
|
|---|
| 31 | MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|---|
| 32 | function getIteratorFn(maybeIterable) {
|
|---|
| 33 | if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|---|
| 34 | maybeIterable =
|
|---|
| 35 | (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|---|
| 36 | maybeIterable["@@iterator"];
|
|---|
| 37 | return "function" === typeof maybeIterable ? maybeIterable : null;
|
|---|
| 38 | }
|
|---|
| 39 | var isArrayImpl = Array.isArray,
|
|---|
| 40 | scheduleMicrotask = queueMicrotask;
|
|---|
| 41 | function flushBuffered(destination) {
|
|---|
| 42 | "function" === typeof destination.flush && destination.flush();
|
|---|
| 43 | }
|
|---|
| 44 | function writeChunk(destination, chunk) {
|
|---|
| 45 | 0 !== chunk.length && destination.write(chunk);
|
|---|
| 46 | }
|
|---|
| 47 | function byteLengthOfChunk(chunk) {
|
|---|
| 48 | return Buffer.byteLength(chunk, "utf8");
|
|---|
| 49 | }
|
|---|
| 50 | function closeWithError(destination, error) {
|
|---|
| 51 | "function" === typeof destination.error
|
|---|
| 52 | ? destination.error(error)
|
|---|
| 53 | : destination.close();
|
|---|
| 54 | }
|
|---|
| 55 | var assign = Object.assign,
|
|---|
| 56 | hasOwnProperty = Object.prototype.hasOwnProperty,
|
|---|
| 57 | VALID_ATTRIBUTE_NAME_REGEX = RegExp(
|
|---|
| 58 | "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
|
|---|
| 59 | ),
|
|---|
| 60 | illegalAttributeNameCache = {},
|
|---|
| 61 | validatedAttributeNameCache = {};
|
|---|
| 62 | function isAttributeNameSafe(attributeName) {
|
|---|
| 63 | if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
|
|---|
| 64 | return !0;
|
|---|
| 65 | if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;
|
|---|
| 66 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
|
|---|
| 67 | return (validatedAttributeNameCache[attributeName] = !0);
|
|---|
| 68 | illegalAttributeNameCache[attributeName] = !0;
|
|---|
| 69 | return !1;
|
|---|
| 70 | }
|
|---|
| 71 | var unitlessNumbers = new Set(
|
|---|
| 72 | "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
|
|---|
| 73 | " "
|
|---|
| 74 | )
|
|---|
| 75 | ),
|
|---|
| 76 | aliases = new Map([
|
|---|
| 77 | ["acceptCharset", "accept-charset"],
|
|---|
| 78 | ["htmlFor", "for"],
|
|---|
| 79 | ["httpEquiv", "http-equiv"],
|
|---|
| 80 | ["crossOrigin", "crossorigin"],
|
|---|
| 81 | ["accentHeight", "accent-height"],
|
|---|
| 82 | ["alignmentBaseline", "alignment-baseline"],
|
|---|
| 83 | ["arabicForm", "arabic-form"],
|
|---|
| 84 | ["baselineShift", "baseline-shift"],
|
|---|
| 85 | ["capHeight", "cap-height"],
|
|---|
| 86 | ["clipPath", "clip-path"],
|
|---|
| 87 | ["clipRule", "clip-rule"],
|
|---|
| 88 | ["colorInterpolation", "color-interpolation"],
|
|---|
| 89 | ["colorInterpolationFilters", "color-interpolation-filters"],
|
|---|
| 90 | ["colorProfile", "color-profile"],
|
|---|
| 91 | ["colorRendering", "color-rendering"],
|
|---|
| 92 | ["dominantBaseline", "dominant-baseline"],
|
|---|
| 93 | ["enableBackground", "enable-background"],
|
|---|
| 94 | ["fillOpacity", "fill-opacity"],
|
|---|
| 95 | ["fillRule", "fill-rule"],
|
|---|
| 96 | ["floodColor", "flood-color"],
|
|---|
| 97 | ["floodOpacity", "flood-opacity"],
|
|---|
| 98 | ["fontFamily", "font-family"],
|
|---|
| 99 | ["fontSize", "font-size"],
|
|---|
| 100 | ["fontSizeAdjust", "font-size-adjust"],
|
|---|
| 101 | ["fontStretch", "font-stretch"],
|
|---|
| 102 | ["fontStyle", "font-style"],
|
|---|
| 103 | ["fontVariant", "font-variant"],
|
|---|
| 104 | ["fontWeight", "font-weight"],
|
|---|
| 105 | ["glyphName", "glyph-name"],
|
|---|
| 106 | ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
|
|---|
| 107 | ["glyphOrientationVertical", "glyph-orientation-vertical"],
|
|---|
| 108 | ["horizAdvX", "horiz-adv-x"],
|
|---|
| 109 | ["horizOriginX", "horiz-origin-x"],
|
|---|
| 110 | ["imageRendering", "image-rendering"],
|
|---|
| 111 | ["letterSpacing", "letter-spacing"],
|
|---|
| 112 | ["lightingColor", "lighting-color"],
|
|---|
| 113 | ["markerEnd", "marker-end"],
|
|---|
| 114 | ["markerMid", "marker-mid"],
|
|---|
| 115 | ["markerStart", "marker-start"],
|
|---|
| 116 | ["overlinePosition", "overline-position"],
|
|---|
| 117 | ["overlineThickness", "overline-thickness"],
|
|---|
| 118 | ["paintOrder", "paint-order"],
|
|---|
| 119 | ["panose-1", "panose-1"],
|
|---|
| 120 | ["pointerEvents", "pointer-events"],
|
|---|
| 121 | ["renderingIntent", "rendering-intent"],
|
|---|
| 122 | ["shapeRendering", "shape-rendering"],
|
|---|
| 123 | ["stopColor", "stop-color"],
|
|---|
| 124 | ["stopOpacity", "stop-opacity"],
|
|---|
| 125 | ["strikethroughPosition", "strikethrough-position"],
|
|---|
| 126 | ["strikethroughThickness", "strikethrough-thickness"],
|
|---|
| 127 | ["strokeDasharray", "stroke-dasharray"],
|
|---|
| 128 | ["strokeDashoffset", "stroke-dashoffset"],
|
|---|
| 129 | ["strokeLinecap", "stroke-linecap"],
|
|---|
| 130 | ["strokeLinejoin", "stroke-linejoin"],
|
|---|
| 131 | ["strokeMiterlimit", "stroke-miterlimit"],
|
|---|
| 132 | ["strokeOpacity", "stroke-opacity"],
|
|---|
| 133 | ["strokeWidth", "stroke-width"],
|
|---|
| 134 | ["textAnchor", "text-anchor"],
|
|---|
| 135 | ["textDecoration", "text-decoration"],
|
|---|
| 136 | ["textRendering", "text-rendering"],
|
|---|
| 137 | ["transformOrigin", "transform-origin"],
|
|---|
| 138 | ["underlinePosition", "underline-position"],
|
|---|
| 139 | ["underlineThickness", "underline-thickness"],
|
|---|
| 140 | ["unicodeBidi", "unicode-bidi"],
|
|---|
| 141 | ["unicodeRange", "unicode-range"],
|
|---|
| 142 | ["unitsPerEm", "units-per-em"],
|
|---|
| 143 | ["vAlphabetic", "v-alphabetic"],
|
|---|
| 144 | ["vHanging", "v-hanging"],
|
|---|
| 145 | ["vIdeographic", "v-ideographic"],
|
|---|
| 146 | ["vMathematical", "v-mathematical"],
|
|---|
| 147 | ["vectorEffect", "vector-effect"],
|
|---|
| 148 | ["vertAdvY", "vert-adv-y"],
|
|---|
| 149 | ["vertOriginX", "vert-origin-x"],
|
|---|
| 150 | ["vertOriginY", "vert-origin-y"],
|
|---|
| 151 | ["wordSpacing", "word-spacing"],
|
|---|
| 152 | ["writingMode", "writing-mode"],
|
|---|
| 153 | ["xmlnsXlink", "xmlns:xlink"],
|
|---|
| 154 | ["xHeight", "x-height"]
|
|---|
| 155 | ]),
|
|---|
| 156 | matchHtmlRegExp = /["'&<>]/;
|
|---|
| 157 | function escapeTextForBrowser(text) {
|
|---|
| 158 | if (
|
|---|
| 159 | "boolean" === typeof text ||
|
|---|
| 160 | "number" === typeof text ||
|
|---|
| 161 | "bigint" === typeof text
|
|---|
| 162 | )
|
|---|
| 163 | return "" + text;
|
|---|
| 164 | text = "" + text;
|
|---|
| 165 | var match = matchHtmlRegExp.exec(text);
|
|---|
| 166 | if (match) {
|
|---|
| 167 | var html = "",
|
|---|
| 168 | index,
|
|---|
| 169 | lastIndex = 0;
|
|---|
| 170 | for (index = match.index; index < text.length; index++) {
|
|---|
| 171 | switch (text.charCodeAt(index)) {
|
|---|
| 172 | case 34:
|
|---|
| 173 | match = """;
|
|---|
| 174 | break;
|
|---|
| 175 | case 38:
|
|---|
| 176 | match = "&";
|
|---|
| 177 | break;
|
|---|
| 178 | case 39:
|
|---|
| 179 | match = "'";
|
|---|
| 180 | break;
|
|---|
| 181 | case 60:
|
|---|
| 182 | match = "<";
|
|---|
| 183 | break;
|
|---|
| 184 | case 62:
|
|---|
| 185 | match = ">";
|
|---|
| 186 | break;
|
|---|
| 187 | default:
|
|---|
| 188 | continue;
|
|---|
| 189 | }
|
|---|
| 190 | lastIndex !== index && (html += text.slice(lastIndex, index));
|
|---|
| 191 | lastIndex = index + 1;
|
|---|
| 192 | html += match;
|
|---|
| 193 | }
|
|---|
| 194 | text = lastIndex !== index ? html + text.slice(lastIndex, index) : html;
|
|---|
| 195 | }
|
|---|
| 196 | return text;
|
|---|
| 197 | }
|
|---|
| 198 | var uppercasePattern = /([A-Z])/g,
|
|---|
| 199 | msPattern = /^ms-/,
|
|---|
| 200 | isJavaScriptProtocol =
|
|---|
| 201 | /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
|
|---|
| 202 | function sanitizeURL(url) {
|
|---|
| 203 | return isJavaScriptProtocol.test("" + url)
|
|---|
| 204 | ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
|
|---|
| 205 | : url;
|
|---|
| 206 | }
|
|---|
| 207 | var ReactSharedInternals =
|
|---|
| 208 | React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|---|
| 209 | ReactDOMSharedInternals =
|
|---|
| 210 | ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|---|
| 211 | sharedNotPendingObject = {
|
|---|
| 212 | pending: !1,
|
|---|
| 213 | data: null,
|
|---|
| 214 | method: null,
|
|---|
| 215 | action: null
|
|---|
| 216 | },
|
|---|
| 217 | previousDispatcher = ReactDOMSharedInternals.d;
|
|---|
| 218 | ReactDOMSharedInternals.d = {
|
|---|
| 219 | f: previousDispatcher.f,
|
|---|
| 220 | r: previousDispatcher.r,
|
|---|
| 221 | D: prefetchDNS,
|
|---|
| 222 | C: preconnect,
|
|---|
| 223 | L: preload,
|
|---|
| 224 | m: preloadModule,
|
|---|
| 225 | X: preinitScript,
|
|---|
| 226 | S: preinitStyle,
|
|---|
| 227 | M: preinitModuleScript
|
|---|
| 228 | };
|
|---|
| 229 | var PRELOAD_NO_CREDS = [],
|
|---|
| 230 | currentlyFlushingRenderState = null,
|
|---|
| 231 | scriptRegex = /(<\/|<)(s)(cript)/gi;
|
|---|
| 232 | function scriptReplacer(match, prefix, s, suffix) {
|
|---|
| 233 | return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
|
|---|
| 234 | }
|
|---|
| 235 | function createRenderState(
|
|---|
| 236 | resumableState,
|
|---|
| 237 | nonce,
|
|---|
| 238 | externalRuntimeConfig,
|
|---|
| 239 | importMap,
|
|---|
| 240 | onHeaders,
|
|---|
| 241 | maxHeadersLength
|
|---|
| 242 | ) {
|
|---|
| 243 | externalRuntimeConfig =
|
|---|
| 244 | "string" === typeof nonce ? nonce : nonce && nonce.script;
|
|---|
| 245 | var inlineScriptWithNonce =
|
|---|
| 246 | void 0 === externalRuntimeConfig
|
|---|
| 247 | ? "<script"
|
|---|
| 248 | : '<script nonce="' + escapeTextForBrowser(externalRuntimeConfig) + '"',
|
|---|
| 249 | nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
|
|---|
| 250 | inlineStyleWithNonce =
|
|---|
| 251 | void 0 === nonceStyle
|
|---|
| 252 | ? "<style"
|
|---|
| 253 | : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
|
|---|
| 254 | idPrefix = resumableState.idPrefix,
|
|---|
| 255 | bootstrapChunks = [],
|
|---|
| 256 | bootstrapScriptContent = resumableState.bootstrapScriptContent,
|
|---|
| 257 | bootstrapScripts = resumableState.bootstrapScripts,
|
|---|
| 258 | bootstrapModules = resumableState.bootstrapModules;
|
|---|
| 259 | void 0 !== bootstrapScriptContent &&
|
|---|
| 260 | (bootstrapChunks.push(inlineScriptWithNonce),
|
|---|
| 261 | pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
|
|---|
| 262 | bootstrapChunks.push(
|
|---|
| 263 | ">",
|
|---|
| 264 | ("" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer),
|
|---|
| 265 | "\x3c/script>"
|
|---|
| 266 | ));
|
|---|
| 267 | bootstrapScriptContent = [];
|
|---|
| 268 | void 0 !== importMap &&
|
|---|
| 269 | (bootstrapScriptContent.push('<script type="importmap">'),
|
|---|
| 270 | bootstrapScriptContent.push(
|
|---|
| 271 | ("" + JSON.stringify(importMap)).replace(scriptRegex, scriptReplacer)
|
|---|
| 272 | ),
|
|---|
| 273 | bootstrapScriptContent.push("\x3c/script>"));
|
|---|
| 274 | importMap = onHeaders
|
|---|
| 275 | ? {
|
|---|
| 276 | preconnects: "",
|
|---|
| 277 | fontPreloads: "",
|
|---|
| 278 | highImagePreloads: "",
|
|---|
| 279 | remainingCapacity:
|
|---|
| 280 | 2 + ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
|
|---|
| 281 | }
|
|---|
| 282 | : null;
|
|---|
| 283 | onHeaders = {
|
|---|
| 284 | placeholderPrefix: idPrefix + "P:",
|
|---|
| 285 | segmentPrefix: idPrefix + "S:",
|
|---|
| 286 | boundaryPrefix: idPrefix + "B:",
|
|---|
| 287 | startInlineScript: inlineScriptWithNonce,
|
|---|
| 288 | startInlineStyle: inlineStyleWithNonce,
|
|---|
| 289 | preamble: createPreambleState(),
|
|---|
| 290 | externalRuntimeScript: null,
|
|---|
| 291 | bootstrapChunks: bootstrapChunks,
|
|---|
| 292 | importMapChunks: bootstrapScriptContent,
|
|---|
| 293 | onHeaders: onHeaders,
|
|---|
| 294 | headers: importMap,
|
|---|
| 295 | resets: {
|
|---|
| 296 | font: {},
|
|---|
| 297 | dns: {},
|
|---|
| 298 | connect: { default: {}, anonymous: {}, credentials: {} },
|
|---|
| 299 | image: {},
|
|---|
| 300 | style: {}
|
|---|
| 301 | },
|
|---|
| 302 | charsetChunks: [],
|
|---|
| 303 | viewportChunks: [],
|
|---|
| 304 | hoistableChunks: [],
|
|---|
| 305 | preconnects: new Set(),
|
|---|
| 306 | fontPreloads: new Set(),
|
|---|
| 307 | highImagePreloads: new Set(),
|
|---|
| 308 | styles: new Map(),
|
|---|
| 309 | bootstrapScripts: new Set(),
|
|---|
| 310 | scripts: new Set(),
|
|---|
| 311 | bulkPreloads: new Set(),
|
|---|
| 312 | preloads: {
|
|---|
| 313 | images: new Map(),
|
|---|
| 314 | stylesheets: new Map(),
|
|---|
| 315 | scripts: new Map(),
|
|---|
| 316 | moduleScripts: new Map()
|
|---|
| 317 | },
|
|---|
| 318 | nonce: { script: externalRuntimeConfig, style: nonceStyle },
|
|---|
| 319 | hoistableState: null,
|
|---|
| 320 | stylesToHoist: !1
|
|---|
| 321 | };
|
|---|
| 322 | if (void 0 !== bootstrapScripts)
|
|---|
| 323 | for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
|
|---|
| 324 | (idPrefix = bootstrapScripts[importMap]),
|
|---|
| 325 | (nonceStyle = inlineScriptWithNonce = void 0),
|
|---|
| 326 | (inlineStyleWithNonce = {
|
|---|
| 327 | rel: "preload",
|
|---|
| 328 | as: "script",
|
|---|
| 329 | fetchPriority: "low",
|
|---|
| 330 | nonce: nonce
|
|---|
| 331 | }),
|
|---|
| 332 | "string" === typeof idPrefix
|
|---|
| 333 | ? (inlineStyleWithNonce.href = maxHeadersLength = idPrefix)
|
|---|
| 334 | : ((inlineStyleWithNonce.href = maxHeadersLength = idPrefix.src),
|
|---|
| 335 | (inlineStyleWithNonce.integrity = nonceStyle =
|
|---|
| 336 | "string" === typeof idPrefix.integrity
|
|---|
| 337 | ? idPrefix.integrity
|
|---|
| 338 | : void 0),
|
|---|
| 339 | (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
|
|---|
| 340 | "string" === typeof idPrefix || null == idPrefix.crossOrigin
|
|---|
| 341 | ? void 0
|
|---|
| 342 | : "use-credentials" === idPrefix.crossOrigin
|
|---|
| 343 | ? "use-credentials"
|
|---|
| 344 | : "")),
|
|---|
| 345 | (idPrefix = resumableState),
|
|---|
| 346 | (bootstrapScriptContent = maxHeadersLength),
|
|---|
| 347 | (idPrefix.scriptResources[bootstrapScriptContent] = null),
|
|---|
| 348 | (idPrefix.moduleScriptResources[bootstrapScriptContent] = null),
|
|---|
| 349 | (idPrefix = []),
|
|---|
| 350 | pushLinkImpl(idPrefix, inlineStyleWithNonce),
|
|---|
| 351 | onHeaders.bootstrapScripts.add(idPrefix),
|
|---|
| 352 | bootstrapChunks.push(
|
|---|
| 353 | '<script src="',
|
|---|
| 354 | escapeTextForBrowser(maxHeadersLength),
|
|---|
| 355 | '"'
|
|---|
| 356 | ),
|
|---|
| 357 | externalRuntimeConfig &&
|
|---|
| 358 | bootstrapChunks.push(
|
|---|
| 359 | ' nonce="',
|
|---|
| 360 | escapeTextForBrowser(externalRuntimeConfig),
|
|---|
| 361 | '"'
|
|---|
| 362 | ),
|
|---|
| 363 | "string" === typeof nonceStyle &&
|
|---|
| 364 | bootstrapChunks.push(
|
|---|
| 365 | ' integrity="',
|
|---|
| 366 | escapeTextForBrowser(nonceStyle),
|
|---|
| 367 | '"'
|
|---|
| 368 | ),
|
|---|
| 369 | "string" === typeof inlineScriptWithNonce &&
|
|---|
| 370 | bootstrapChunks.push(
|
|---|
| 371 | ' crossorigin="',
|
|---|
| 372 | escapeTextForBrowser(inlineScriptWithNonce),
|
|---|
| 373 | '"'
|
|---|
| 374 | ),
|
|---|
| 375 | pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
|
|---|
| 376 | bootstrapChunks.push(' async="">\x3c/script>');
|
|---|
| 377 | if (void 0 !== bootstrapModules)
|
|---|
| 378 | for (nonce = 0; nonce < bootstrapModules.length; nonce++)
|
|---|
| 379 | (nonceStyle = bootstrapModules[nonce]),
|
|---|
| 380 | (maxHeadersLength = importMap = void 0),
|
|---|
| 381 | (inlineScriptWithNonce = {
|
|---|
| 382 | rel: "modulepreload",
|
|---|
| 383 | fetchPriority: "low",
|
|---|
| 384 | nonce: externalRuntimeConfig
|
|---|
| 385 | }),
|
|---|
| 386 | "string" === typeof nonceStyle
|
|---|
| 387 | ? (inlineScriptWithNonce.href = bootstrapScripts = nonceStyle)
|
|---|
| 388 | : ((inlineScriptWithNonce.href = bootstrapScripts = nonceStyle.src),
|
|---|
| 389 | (inlineScriptWithNonce.integrity = maxHeadersLength =
|
|---|
| 390 | "string" === typeof nonceStyle.integrity
|
|---|
| 391 | ? nonceStyle.integrity
|
|---|
| 392 | : void 0),
|
|---|
| 393 | (inlineScriptWithNonce.crossOrigin = importMap =
|
|---|
| 394 | "string" === typeof nonceStyle || null == nonceStyle.crossOrigin
|
|---|
| 395 | ? void 0
|
|---|
| 396 | : "use-credentials" === nonceStyle.crossOrigin
|
|---|
| 397 | ? "use-credentials"
|
|---|
| 398 | : "")),
|
|---|
| 399 | (nonceStyle = resumableState),
|
|---|
| 400 | (inlineStyleWithNonce = bootstrapScripts),
|
|---|
| 401 | (nonceStyle.scriptResources[inlineStyleWithNonce] = null),
|
|---|
| 402 | (nonceStyle.moduleScriptResources[inlineStyleWithNonce] = null),
|
|---|
| 403 | (nonceStyle = []),
|
|---|
| 404 | pushLinkImpl(nonceStyle, inlineScriptWithNonce),
|
|---|
| 405 | onHeaders.bootstrapScripts.add(nonceStyle),
|
|---|
| 406 | bootstrapChunks.push(
|
|---|
| 407 | '<script type="module" src="',
|
|---|
| 408 | escapeTextForBrowser(bootstrapScripts),
|
|---|
| 409 | '"'
|
|---|
| 410 | ),
|
|---|
| 411 | externalRuntimeConfig &&
|
|---|
| 412 | bootstrapChunks.push(
|
|---|
| 413 | ' nonce="',
|
|---|
| 414 | escapeTextForBrowser(externalRuntimeConfig),
|
|---|
| 415 | '"'
|
|---|
| 416 | ),
|
|---|
| 417 | "string" === typeof maxHeadersLength &&
|
|---|
| 418 | bootstrapChunks.push(
|
|---|
| 419 | ' integrity="',
|
|---|
| 420 | escapeTextForBrowser(maxHeadersLength),
|
|---|
| 421 | '"'
|
|---|
| 422 | ),
|
|---|
| 423 | "string" === typeof importMap &&
|
|---|
| 424 | bootstrapChunks.push(
|
|---|
| 425 | ' crossorigin="',
|
|---|
| 426 | escapeTextForBrowser(importMap),
|
|---|
| 427 | '"'
|
|---|
| 428 | ),
|
|---|
| 429 | pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
|
|---|
| 430 | bootstrapChunks.push(' async="">\x3c/script>');
|
|---|
| 431 | return onHeaders;
|
|---|
| 432 | }
|
|---|
| 433 | function createResumableState(
|
|---|
| 434 | identifierPrefix,
|
|---|
| 435 | externalRuntimeConfig,
|
|---|
| 436 | bootstrapScriptContent,
|
|---|
| 437 | bootstrapScripts,
|
|---|
| 438 | bootstrapModules
|
|---|
| 439 | ) {
|
|---|
| 440 | return {
|
|---|
| 441 | idPrefix: void 0 === identifierPrefix ? "" : identifierPrefix,
|
|---|
| 442 | nextFormID: 0,
|
|---|
| 443 | streamingFormat: 0,
|
|---|
| 444 | bootstrapScriptContent: bootstrapScriptContent,
|
|---|
| 445 | bootstrapScripts: bootstrapScripts,
|
|---|
| 446 | bootstrapModules: bootstrapModules,
|
|---|
| 447 | instructions: 0,
|
|---|
| 448 | hasBody: !1,
|
|---|
| 449 | hasHtml: !1,
|
|---|
| 450 | unknownResources: {},
|
|---|
| 451 | dnsResources: {},
|
|---|
| 452 | connectResources: { default: {}, anonymous: {}, credentials: {} },
|
|---|
| 453 | imageResources: {},
|
|---|
| 454 | styleResources: {},
|
|---|
| 455 | scriptResources: {},
|
|---|
| 456 | moduleUnknownResources: {},
|
|---|
| 457 | moduleScriptResources: {}
|
|---|
| 458 | };
|
|---|
| 459 | }
|
|---|
| 460 | function createPreambleState() {
|
|---|
| 461 | return { htmlChunks: null, headChunks: null, bodyChunks: null };
|
|---|
| 462 | }
|
|---|
| 463 | function createFormatContext(
|
|---|
| 464 | insertionMode,
|
|---|
| 465 | selectedValue,
|
|---|
| 466 | tagScope,
|
|---|
| 467 | viewTransition
|
|---|
| 468 | ) {
|
|---|
| 469 | return {
|
|---|
| 470 | insertionMode: insertionMode,
|
|---|
| 471 | selectedValue: selectedValue,
|
|---|
| 472 | tagScope: tagScope,
|
|---|
| 473 | viewTransition: viewTransition
|
|---|
| 474 | };
|
|---|
| 475 | }
|
|---|
| 476 | function createRootFormatContext(namespaceURI) {
|
|---|
| 477 | return createFormatContext(
|
|---|
| 478 | "http://www.w3.org/2000/svg" === namespaceURI
|
|---|
| 479 | ? 4
|
|---|
| 480 | : "http://www.w3.org/1998/Math/MathML" === namespaceURI
|
|---|
| 481 | ? 5
|
|---|
| 482 | : 0,
|
|---|
| 483 | null,
|
|---|
| 484 | 0,
|
|---|
| 485 | null
|
|---|
| 486 | );
|
|---|
| 487 | }
|
|---|
| 488 | function getChildFormatContext(parentContext, type, props) {
|
|---|
| 489 | var subtreeScope = parentContext.tagScope & -25;
|
|---|
| 490 | switch (type) {
|
|---|
| 491 | case "noscript":
|
|---|
| 492 | return createFormatContext(2, null, subtreeScope | 1, null);
|
|---|
| 493 | case "select":
|
|---|
| 494 | return createFormatContext(
|
|---|
| 495 | 2,
|
|---|
| 496 | null != props.value ? props.value : props.defaultValue,
|
|---|
| 497 | subtreeScope,
|
|---|
| 498 | null
|
|---|
| 499 | );
|
|---|
| 500 | case "svg":
|
|---|
| 501 | return createFormatContext(4, null, subtreeScope, null);
|
|---|
| 502 | case "picture":
|
|---|
| 503 | return createFormatContext(2, null, subtreeScope | 2, null);
|
|---|
| 504 | case "math":
|
|---|
| 505 | return createFormatContext(5, null, subtreeScope, null);
|
|---|
| 506 | case "foreignObject":
|
|---|
| 507 | return createFormatContext(2, null, subtreeScope, null);
|
|---|
| 508 | case "table":
|
|---|
| 509 | return createFormatContext(6, null, subtreeScope, null);
|
|---|
| 510 | case "thead":
|
|---|
| 511 | case "tbody":
|
|---|
| 512 | case "tfoot":
|
|---|
| 513 | return createFormatContext(7, null, subtreeScope, null);
|
|---|
| 514 | case "colgroup":
|
|---|
| 515 | return createFormatContext(9, null, subtreeScope, null);
|
|---|
| 516 | case "tr":
|
|---|
| 517 | return createFormatContext(8, null, subtreeScope, null);
|
|---|
| 518 | case "head":
|
|---|
| 519 | if (2 > parentContext.insertionMode)
|
|---|
| 520 | return createFormatContext(3, null, subtreeScope, null);
|
|---|
| 521 | break;
|
|---|
| 522 | case "html":
|
|---|
| 523 | if (0 === parentContext.insertionMode)
|
|---|
| 524 | return createFormatContext(1, null, subtreeScope, null);
|
|---|
| 525 | }
|
|---|
| 526 | return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
|
|---|
| 527 | ? createFormatContext(2, null, subtreeScope, null)
|
|---|
| 528 | : parentContext.tagScope !== subtreeScope
|
|---|
| 529 | ? createFormatContext(
|
|---|
| 530 | parentContext.insertionMode,
|
|---|
| 531 | parentContext.selectedValue,
|
|---|
| 532 | subtreeScope,
|
|---|
| 533 | null
|
|---|
| 534 | )
|
|---|
| 535 | : parentContext;
|
|---|
| 536 | }
|
|---|
| 537 | function getSuspenseViewTransition(parentViewTransition) {
|
|---|
| 538 | return null === parentViewTransition
|
|---|
| 539 | ? null
|
|---|
| 540 | : {
|
|---|
| 541 | update: parentViewTransition.update,
|
|---|
| 542 | enter: "none",
|
|---|
| 543 | exit: "none",
|
|---|
| 544 | share: parentViewTransition.update,
|
|---|
| 545 | name: parentViewTransition.autoName,
|
|---|
| 546 | autoName: parentViewTransition.autoName,
|
|---|
| 547 | nameIdx: 0
|
|---|
| 548 | };
|
|---|
| 549 | }
|
|---|
| 550 | function getSuspenseFallbackFormatContext(resumableState, parentContext) {
|
|---|
| 551 | parentContext.tagScope & 32 && (resumableState.instructions |= 128);
|
|---|
| 552 | return createFormatContext(
|
|---|
| 553 | parentContext.insertionMode,
|
|---|
| 554 | parentContext.selectedValue,
|
|---|
| 555 | parentContext.tagScope | 12,
|
|---|
| 556 | getSuspenseViewTransition(parentContext.viewTransition)
|
|---|
| 557 | );
|
|---|
| 558 | }
|
|---|
| 559 | function getSuspenseContentFormatContext(resumableState, parentContext) {
|
|---|
| 560 | resumableState = getSuspenseViewTransition(parentContext.viewTransition);
|
|---|
| 561 | var subtreeScope = parentContext.tagScope | 16;
|
|---|
| 562 | null !== resumableState &&
|
|---|
| 563 | "none" !== resumableState.share &&
|
|---|
| 564 | (subtreeScope |= 64);
|
|---|
| 565 | return createFormatContext(
|
|---|
| 566 | parentContext.insertionMode,
|
|---|
| 567 | parentContext.selectedValue,
|
|---|
| 568 | subtreeScope,
|
|---|
| 569 | resumableState
|
|---|
| 570 | );
|
|---|
| 571 | }
|
|---|
| 572 | function pushTextInstance(target, text, renderState, textEmbedded) {
|
|---|
| 573 | if ("" === text) return textEmbedded;
|
|---|
| 574 | textEmbedded && target.push("\x3c!-- --\x3e");
|
|---|
| 575 | target.push(escapeTextForBrowser(text));
|
|---|
| 576 | return !0;
|
|---|
| 577 | }
|
|---|
| 578 | function pushSegmentFinale(target, renderState, lastPushedText, textEmbedded) {
|
|---|
| 579 | lastPushedText && textEmbedded && target.push("\x3c!-- --\x3e");
|
|---|
| 580 | }
|
|---|
| 581 | var styleNameCache = new Map();
|
|---|
| 582 | function pushStyleAttribute(target, style) {
|
|---|
| 583 | if ("object" !== typeof style)
|
|---|
| 584 | throw Error(
|
|---|
| 585 | "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
|
|---|
| 586 | );
|
|---|
| 587 | var isFirst = !0,
|
|---|
| 588 | styleName;
|
|---|
| 589 | for (styleName in style)
|
|---|
| 590 | if (hasOwnProperty.call(style, styleName)) {
|
|---|
| 591 | var styleValue = style[styleName];
|
|---|
| 592 | if (
|
|---|
| 593 | null != styleValue &&
|
|---|
| 594 | "boolean" !== typeof styleValue &&
|
|---|
| 595 | "" !== styleValue
|
|---|
| 596 | ) {
|
|---|
| 597 | if (0 === styleName.indexOf("--")) {
|
|---|
| 598 | var nameChunk = escapeTextForBrowser(styleName);
|
|---|
| 599 | styleValue = escapeTextForBrowser(("" + styleValue).trim());
|
|---|
| 600 | } else
|
|---|
| 601 | (nameChunk = styleNameCache.get(styleName)),
|
|---|
| 602 | void 0 === nameChunk &&
|
|---|
| 603 | ((nameChunk = escapeTextForBrowser(
|
|---|
| 604 | styleName
|
|---|
| 605 | .replace(uppercasePattern, "-$1")
|
|---|
| 606 | .toLowerCase()
|
|---|
| 607 | .replace(msPattern, "-ms-")
|
|---|
| 608 | )),
|
|---|
| 609 | styleNameCache.set(styleName, nameChunk)),
|
|---|
| 610 | (styleValue =
|
|---|
| 611 | "number" === typeof styleValue
|
|---|
| 612 | ? 0 === styleValue || unitlessNumbers.has(styleName)
|
|---|
| 613 | ? "" + styleValue
|
|---|
| 614 | : styleValue + "px"
|
|---|
| 615 | : escapeTextForBrowser(("" + styleValue).trim()));
|
|---|
| 616 | isFirst
|
|---|
| 617 | ? ((isFirst = !1),
|
|---|
| 618 | target.push(' style="', nameChunk, ":", styleValue))
|
|---|
| 619 | : target.push(";", nameChunk, ":", styleValue);
|
|---|
| 620 | }
|
|---|
| 621 | }
|
|---|
| 622 | isFirst || target.push('"');
|
|---|
| 623 | }
|
|---|
| 624 | function pushBooleanAttribute(target, name, value) {
|
|---|
| 625 | value &&
|
|---|
| 626 | "function" !== typeof value &&
|
|---|
| 627 | "symbol" !== typeof value &&
|
|---|
| 628 | target.push(" ", name, '=""');
|
|---|
| 629 | }
|
|---|
| 630 | function pushStringAttribute(target, name, value) {
|
|---|
| 631 | "function" !== typeof value &&
|
|---|
| 632 | "symbol" !== typeof value &&
|
|---|
| 633 | "boolean" !== typeof value &&
|
|---|
| 634 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 635 | }
|
|---|
| 636 | var actionJavaScriptURL = escapeTextForBrowser(
|
|---|
| 637 | "javascript:throw new Error('React form unexpectedly submitted.')"
|
|---|
| 638 | );
|
|---|
| 639 | function pushAdditionalFormField(value, key) {
|
|---|
| 640 | this.push('<input type="hidden"');
|
|---|
| 641 | validateAdditionalFormField(value);
|
|---|
| 642 | pushStringAttribute(this, "name", key);
|
|---|
| 643 | pushStringAttribute(this, "value", value);
|
|---|
| 644 | this.push("/>");
|
|---|
| 645 | }
|
|---|
| 646 | function validateAdditionalFormField(value) {
|
|---|
| 647 | if ("string" !== typeof value)
|
|---|
| 648 | throw Error(
|
|---|
| 649 | "File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
|
|---|
| 650 | );
|
|---|
| 651 | }
|
|---|
| 652 | function getCustomFormFields(resumableState, formAction) {
|
|---|
| 653 | if ("function" === typeof formAction.$$FORM_ACTION) {
|
|---|
| 654 | var id = resumableState.nextFormID++;
|
|---|
| 655 | resumableState = resumableState.idPrefix + id;
|
|---|
| 656 | try {
|
|---|
| 657 | var customFields = formAction.$$FORM_ACTION(resumableState);
|
|---|
| 658 | if (customFields) {
|
|---|
| 659 | var formData = customFields.data;
|
|---|
| 660 | null != formData && formData.forEach(validateAdditionalFormField);
|
|---|
| 661 | }
|
|---|
| 662 | return customFields;
|
|---|
| 663 | } catch (x) {
|
|---|
| 664 | if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
|---|
| 665 | throw x;
|
|---|
| 666 | }
|
|---|
| 667 | }
|
|---|
| 668 | return null;
|
|---|
| 669 | }
|
|---|
| 670 | function pushFormActionAttribute(
|
|---|
| 671 | target,
|
|---|
| 672 | resumableState,
|
|---|
| 673 | renderState,
|
|---|
| 674 | formAction,
|
|---|
| 675 | formEncType,
|
|---|
| 676 | formMethod,
|
|---|
| 677 | formTarget,
|
|---|
| 678 | name
|
|---|
| 679 | ) {
|
|---|
| 680 | var formData = null;
|
|---|
| 681 | if ("function" === typeof formAction) {
|
|---|
| 682 | var customFields = getCustomFormFields(resumableState, formAction);
|
|---|
| 683 | null !== customFields
|
|---|
| 684 | ? ((name = customFields.name),
|
|---|
| 685 | (formAction = customFields.action || ""),
|
|---|
| 686 | (formEncType = customFields.encType),
|
|---|
| 687 | (formMethod = customFields.method),
|
|---|
| 688 | (formTarget = customFields.target),
|
|---|
| 689 | (formData = customFields.data))
|
|---|
| 690 | : (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'),
|
|---|
| 691 | (formTarget = formMethod = formEncType = formAction = name = null),
|
|---|
| 692 | injectFormReplayingRuntime(resumableState, renderState));
|
|---|
| 693 | }
|
|---|
| 694 | null != name && pushAttribute(target, "name", name);
|
|---|
| 695 | null != formAction && pushAttribute(target, "formAction", formAction);
|
|---|
| 696 | null != formEncType && pushAttribute(target, "formEncType", formEncType);
|
|---|
| 697 | null != formMethod && pushAttribute(target, "formMethod", formMethod);
|
|---|
| 698 | null != formTarget && pushAttribute(target, "formTarget", formTarget);
|
|---|
| 699 | return formData;
|
|---|
| 700 | }
|
|---|
| 701 | function pushAttribute(target, name, value) {
|
|---|
| 702 | switch (name) {
|
|---|
| 703 | case "className":
|
|---|
| 704 | pushStringAttribute(target, "class", value);
|
|---|
| 705 | break;
|
|---|
| 706 | case "tabIndex":
|
|---|
| 707 | pushStringAttribute(target, "tabindex", value);
|
|---|
| 708 | break;
|
|---|
| 709 | case "dir":
|
|---|
| 710 | case "role":
|
|---|
| 711 | case "viewBox":
|
|---|
| 712 | case "width":
|
|---|
| 713 | case "height":
|
|---|
| 714 | pushStringAttribute(target, name, value);
|
|---|
| 715 | break;
|
|---|
| 716 | case "style":
|
|---|
| 717 | pushStyleAttribute(target, value);
|
|---|
| 718 | break;
|
|---|
| 719 | case "src":
|
|---|
| 720 | case "href":
|
|---|
| 721 | if ("" === value) break;
|
|---|
| 722 | case "action":
|
|---|
| 723 | case "formAction":
|
|---|
| 724 | if (
|
|---|
| 725 | null == value ||
|
|---|
| 726 | "function" === typeof value ||
|
|---|
| 727 | "symbol" === typeof value ||
|
|---|
| 728 | "boolean" === typeof value
|
|---|
| 729 | )
|
|---|
| 730 | break;
|
|---|
| 731 | value = sanitizeURL("" + value);
|
|---|
| 732 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 733 | break;
|
|---|
| 734 | case "defaultValue":
|
|---|
| 735 | case "defaultChecked":
|
|---|
| 736 | case "innerHTML":
|
|---|
| 737 | case "suppressContentEditableWarning":
|
|---|
| 738 | case "suppressHydrationWarning":
|
|---|
| 739 | case "ref":
|
|---|
| 740 | break;
|
|---|
| 741 | case "autoFocus":
|
|---|
| 742 | case "multiple":
|
|---|
| 743 | case "muted":
|
|---|
| 744 | pushBooleanAttribute(target, name.toLowerCase(), value);
|
|---|
| 745 | break;
|
|---|
| 746 | case "xlinkHref":
|
|---|
| 747 | if (
|
|---|
| 748 | "function" === typeof value ||
|
|---|
| 749 | "symbol" === typeof value ||
|
|---|
| 750 | "boolean" === typeof value
|
|---|
| 751 | )
|
|---|
| 752 | break;
|
|---|
| 753 | value = sanitizeURL("" + value);
|
|---|
| 754 | target.push(" ", "xlink:href", '="', escapeTextForBrowser(value), '"');
|
|---|
| 755 | break;
|
|---|
| 756 | case "contentEditable":
|
|---|
| 757 | case "spellCheck":
|
|---|
| 758 | case "draggable":
|
|---|
| 759 | case "value":
|
|---|
| 760 | case "autoReverse":
|
|---|
| 761 | case "externalResourcesRequired":
|
|---|
| 762 | case "focusable":
|
|---|
| 763 | case "preserveAlpha":
|
|---|
| 764 | "function" !== typeof value &&
|
|---|
| 765 | "symbol" !== typeof value &&
|
|---|
| 766 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 767 | break;
|
|---|
| 768 | case "inert":
|
|---|
| 769 | case "allowFullScreen":
|
|---|
| 770 | case "async":
|
|---|
| 771 | case "autoPlay":
|
|---|
| 772 | case "controls":
|
|---|
| 773 | case "default":
|
|---|
| 774 | case "defer":
|
|---|
| 775 | case "disabled":
|
|---|
| 776 | case "disablePictureInPicture":
|
|---|
| 777 | case "disableRemotePlayback":
|
|---|
| 778 | case "formNoValidate":
|
|---|
| 779 | case "hidden":
|
|---|
| 780 | case "loop":
|
|---|
| 781 | case "noModule":
|
|---|
| 782 | case "noValidate":
|
|---|
| 783 | case "open":
|
|---|
| 784 | case "playsInline":
|
|---|
| 785 | case "readOnly":
|
|---|
| 786 | case "required":
|
|---|
| 787 | case "reversed":
|
|---|
| 788 | case "scoped":
|
|---|
| 789 | case "seamless":
|
|---|
| 790 | case "itemScope":
|
|---|
| 791 | value &&
|
|---|
| 792 | "function" !== typeof value &&
|
|---|
| 793 | "symbol" !== typeof value &&
|
|---|
| 794 | target.push(" ", name, '=""');
|
|---|
| 795 | break;
|
|---|
| 796 | case "capture":
|
|---|
| 797 | case "download":
|
|---|
| 798 | !0 === value
|
|---|
| 799 | ? target.push(" ", name, '=""')
|
|---|
| 800 | : !1 !== value &&
|
|---|
| 801 | "function" !== typeof value &&
|
|---|
| 802 | "symbol" !== typeof value &&
|
|---|
| 803 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 804 | break;
|
|---|
| 805 | case "cols":
|
|---|
| 806 | case "rows":
|
|---|
| 807 | case "size":
|
|---|
| 808 | case "span":
|
|---|
| 809 | "function" !== typeof value &&
|
|---|
| 810 | "symbol" !== typeof value &&
|
|---|
| 811 | !isNaN(value) &&
|
|---|
| 812 | 1 <= value &&
|
|---|
| 813 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 814 | break;
|
|---|
| 815 | case "rowSpan":
|
|---|
| 816 | case "start":
|
|---|
| 817 | "function" === typeof value ||
|
|---|
| 818 | "symbol" === typeof value ||
|
|---|
| 819 | isNaN(value) ||
|
|---|
| 820 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 821 | break;
|
|---|
| 822 | case "xlinkActuate":
|
|---|
| 823 | pushStringAttribute(target, "xlink:actuate", value);
|
|---|
| 824 | break;
|
|---|
| 825 | case "xlinkArcrole":
|
|---|
| 826 | pushStringAttribute(target, "xlink:arcrole", value);
|
|---|
| 827 | break;
|
|---|
| 828 | case "xlinkRole":
|
|---|
| 829 | pushStringAttribute(target, "xlink:role", value);
|
|---|
| 830 | break;
|
|---|
| 831 | case "xlinkShow":
|
|---|
| 832 | pushStringAttribute(target, "xlink:show", value);
|
|---|
| 833 | break;
|
|---|
| 834 | case "xlinkTitle":
|
|---|
| 835 | pushStringAttribute(target, "xlink:title", value);
|
|---|
| 836 | break;
|
|---|
| 837 | case "xlinkType":
|
|---|
| 838 | pushStringAttribute(target, "xlink:type", value);
|
|---|
| 839 | break;
|
|---|
| 840 | case "xmlBase":
|
|---|
| 841 | pushStringAttribute(target, "xml:base", value);
|
|---|
| 842 | break;
|
|---|
| 843 | case "xmlLang":
|
|---|
| 844 | pushStringAttribute(target, "xml:lang", value);
|
|---|
| 845 | break;
|
|---|
| 846 | case "xmlSpace":
|
|---|
| 847 | pushStringAttribute(target, "xml:space", value);
|
|---|
| 848 | break;
|
|---|
| 849 | default:
|
|---|
| 850 | if (
|
|---|
| 851 | !(2 < name.length) ||
|
|---|
| 852 | ("o" !== name[0] && "O" !== name[0]) ||
|
|---|
| 853 | ("n" !== name[1] && "N" !== name[1])
|
|---|
| 854 | )
|
|---|
| 855 | if (((name = aliases.get(name) || name), isAttributeNameSafe(name))) {
|
|---|
| 856 | switch (typeof value) {
|
|---|
| 857 | case "function":
|
|---|
| 858 | case "symbol":
|
|---|
| 859 | return;
|
|---|
| 860 | case "boolean":
|
|---|
| 861 | var prefix$8 = name.toLowerCase().slice(0, 5);
|
|---|
| 862 | if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
|
|---|
| 863 | }
|
|---|
| 864 | target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
|---|
| 865 | }
|
|---|
| 866 | }
|
|---|
| 867 | }
|
|---|
| 868 | function pushInnerHTML(target, innerHTML, children) {
|
|---|
| 869 | if (null != innerHTML) {
|
|---|
| 870 | if (null != children)
|
|---|
| 871 | throw Error(
|
|---|
| 872 | "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
|
|---|
| 873 | );
|
|---|
| 874 | if ("object" !== typeof innerHTML || !("__html" in innerHTML))
|
|---|
| 875 | throw Error(
|
|---|
| 876 | "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
|
|---|
| 877 | );
|
|---|
| 878 | innerHTML = innerHTML.__html;
|
|---|
| 879 | null !== innerHTML && void 0 !== innerHTML && target.push("" + innerHTML);
|
|---|
| 880 | }
|
|---|
| 881 | }
|
|---|
| 882 | function flattenOptionChildren(children) {
|
|---|
| 883 | var content = "";
|
|---|
| 884 | React.Children.forEach(children, function (child) {
|
|---|
| 885 | null != child && (content += child);
|
|---|
| 886 | });
|
|---|
| 887 | return content;
|
|---|
| 888 | }
|
|---|
| 889 | function injectFormReplayingRuntime(resumableState, renderState) {
|
|---|
| 890 | if (0 === (resumableState.instructions & 16)) {
|
|---|
| 891 | resumableState.instructions |= 16;
|
|---|
| 892 | var preamble = renderState.preamble,
|
|---|
| 893 | bootstrapChunks = renderState.bootstrapChunks;
|
|---|
| 894 | (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length
|
|---|
| 895 | ? (bootstrapChunks.push(renderState.startInlineScript),
|
|---|
| 896 | pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
|
|---|
| 897 | bootstrapChunks.push(
|
|---|
| 898 | ">",
|
|---|
| 899 | '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))}});',
|
|---|
| 900 | "\x3c/script>"
|
|---|
| 901 | ))
|
|---|
| 902 | : bootstrapChunks.unshift(
|
|---|
| 903 | renderState.startInlineScript,
|
|---|
| 904 | ">",
|
|---|
| 905 | '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))}});',
|
|---|
| 906 | "\x3c/script>"
|
|---|
| 907 | );
|
|---|
| 908 | }
|
|---|
| 909 | }
|
|---|
| 910 | function pushLinkImpl(target, props) {
|
|---|
| 911 | target.push(startChunkForTag("link"));
|
|---|
| 912 | for (var propKey in props)
|
|---|
| 913 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 914 | var propValue = props[propKey];
|
|---|
| 915 | if (null != propValue)
|
|---|
| 916 | switch (propKey) {
|
|---|
| 917 | case "children":
|
|---|
| 918 | case "dangerouslySetInnerHTML":
|
|---|
| 919 | throw Error(
|
|---|
| 920 | "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|---|
| 921 | );
|
|---|
| 922 | default:
|
|---|
| 923 | pushAttribute(target, propKey, propValue);
|
|---|
| 924 | }
|
|---|
| 925 | }
|
|---|
| 926 | target.push("/>");
|
|---|
| 927 | return null;
|
|---|
| 928 | }
|
|---|
| 929 | var styleRegex = /(<\/|<)(s)(tyle)/gi;
|
|---|
| 930 | function styleReplacer(match, prefix, s, suffix) {
|
|---|
| 931 | return "" + prefix + ("s" === s ? "\\73 " : "\\53 ") + suffix;
|
|---|
| 932 | }
|
|---|
| 933 | function pushSelfClosing(target, props, tag) {
|
|---|
| 934 | target.push(startChunkForTag(tag));
|
|---|
| 935 | for (var propKey in props)
|
|---|
| 936 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 937 | var propValue = props[propKey];
|
|---|
| 938 | if (null != propValue)
|
|---|
| 939 | switch (propKey) {
|
|---|
| 940 | case "children":
|
|---|
| 941 | case "dangerouslySetInnerHTML":
|
|---|
| 942 | throw Error(
|
|---|
| 943 | tag +
|
|---|
| 944 | " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|---|
| 945 | );
|
|---|
| 946 | default:
|
|---|
| 947 | pushAttribute(target, propKey, propValue);
|
|---|
| 948 | }
|
|---|
| 949 | }
|
|---|
| 950 | target.push("/>");
|
|---|
| 951 | return null;
|
|---|
| 952 | }
|
|---|
| 953 | function pushTitleImpl(target, props) {
|
|---|
| 954 | target.push(startChunkForTag("title"));
|
|---|
| 955 | var children = null,
|
|---|
| 956 | innerHTML = null,
|
|---|
| 957 | propKey;
|
|---|
| 958 | for (propKey in props)
|
|---|
| 959 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 960 | var propValue = props[propKey];
|
|---|
| 961 | if (null != propValue)
|
|---|
| 962 | switch (propKey) {
|
|---|
| 963 | case "children":
|
|---|
| 964 | children = propValue;
|
|---|
| 965 | break;
|
|---|
| 966 | case "dangerouslySetInnerHTML":
|
|---|
| 967 | innerHTML = propValue;
|
|---|
| 968 | break;
|
|---|
| 969 | default:
|
|---|
| 970 | pushAttribute(target, propKey, propValue);
|
|---|
| 971 | }
|
|---|
| 972 | }
|
|---|
| 973 | target.push(">");
|
|---|
| 974 | props = Array.isArray(children)
|
|---|
| 975 | ? 2 > children.length
|
|---|
| 976 | ? children[0]
|
|---|
| 977 | : null
|
|---|
| 978 | : children;
|
|---|
| 979 | "function" !== typeof props &&
|
|---|
| 980 | "symbol" !== typeof props &&
|
|---|
| 981 | null !== props &&
|
|---|
| 982 | void 0 !== props &&
|
|---|
| 983 | target.push(escapeTextForBrowser("" + props));
|
|---|
| 984 | pushInnerHTML(target, innerHTML, children);
|
|---|
| 985 | target.push(endChunkForTag("title"));
|
|---|
| 986 | return null;
|
|---|
| 987 | }
|
|---|
| 988 | function pushScriptImpl(target, props) {
|
|---|
| 989 | target.push(startChunkForTag("script"));
|
|---|
| 990 | var children = null,
|
|---|
| 991 | innerHTML = null,
|
|---|
| 992 | propKey;
|
|---|
| 993 | for (propKey in props)
|
|---|
| 994 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 995 | var propValue = props[propKey];
|
|---|
| 996 | if (null != propValue)
|
|---|
| 997 | switch (propKey) {
|
|---|
| 998 | case "children":
|
|---|
| 999 | children = propValue;
|
|---|
| 1000 | break;
|
|---|
| 1001 | case "dangerouslySetInnerHTML":
|
|---|
| 1002 | innerHTML = propValue;
|
|---|
| 1003 | break;
|
|---|
| 1004 | default:
|
|---|
| 1005 | pushAttribute(target, propKey, propValue);
|
|---|
| 1006 | }
|
|---|
| 1007 | }
|
|---|
| 1008 | target.push(">");
|
|---|
| 1009 | pushInnerHTML(target, innerHTML, children);
|
|---|
| 1010 | "string" === typeof children &&
|
|---|
| 1011 | target.push(("" + children).replace(scriptRegex, scriptReplacer));
|
|---|
| 1012 | target.push(endChunkForTag("script"));
|
|---|
| 1013 | return null;
|
|---|
| 1014 | }
|
|---|
| 1015 | function pushStartSingletonElement(target, props, tag) {
|
|---|
| 1016 | target.push(startChunkForTag(tag));
|
|---|
| 1017 | var innerHTML = (tag = null),
|
|---|
| 1018 | propKey;
|
|---|
| 1019 | for (propKey in props)
|
|---|
| 1020 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 1021 | var propValue = props[propKey];
|
|---|
| 1022 | if (null != propValue)
|
|---|
| 1023 | switch (propKey) {
|
|---|
| 1024 | case "children":
|
|---|
| 1025 | tag = propValue;
|
|---|
| 1026 | break;
|
|---|
| 1027 | case "dangerouslySetInnerHTML":
|
|---|
| 1028 | innerHTML = propValue;
|
|---|
| 1029 | break;
|
|---|
| 1030 | default:
|
|---|
| 1031 | pushAttribute(target, propKey, propValue);
|
|---|
| 1032 | }
|
|---|
| 1033 | }
|
|---|
| 1034 | target.push(">");
|
|---|
| 1035 | pushInnerHTML(target, innerHTML, tag);
|
|---|
| 1036 | return tag;
|
|---|
| 1037 | }
|
|---|
| 1038 | function pushStartGenericElement(target, props, tag) {
|
|---|
| 1039 | target.push(startChunkForTag(tag));
|
|---|
| 1040 | var innerHTML = (tag = null),
|
|---|
| 1041 | propKey;
|
|---|
| 1042 | for (propKey in props)
|
|---|
| 1043 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 1044 | var propValue = props[propKey];
|
|---|
| 1045 | if (null != propValue)
|
|---|
| 1046 | switch (propKey) {
|
|---|
| 1047 | case "children":
|
|---|
| 1048 | tag = propValue;
|
|---|
| 1049 | break;
|
|---|
| 1050 | case "dangerouslySetInnerHTML":
|
|---|
| 1051 | innerHTML = propValue;
|
|---|
| 1052 | break;
|
|---|
| 1053 | default:
|
|---|
| 1054 | pushAttribute(target, propKey, propValue);
|
|---|
| 1055 | }
|
|---|
| 1056 | }
|
|---|
| 1057 | target.push(">");
|
|---|
| 1058 | pushInnerHTML(target, innerHTML, tag);
|
|---|
| 1059 | return "string" === typeof tag
|
|---|
| 1060 | ? (target.push(escapeTextForBrowser(tag)), null)
|
|---|
| 1061 | : tag;
|
|---|
| 1062 | }
|
|---|
| 1063 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,
|
|---|
| 1064 | validatedTagCache = new Map();
|
|---|
| 1065 | function startChunkForTag(tag) {
|
|---|
| 1066 | var tagStartChunk = validatedTagCache.get(tag);
|
|---|
| 1067 | if (void 0 === tagStartChunk) {
|
|---|
| 1068 | if (!VALID_TAG_REGEX.test(tag)) throw Error("Invalid tag: " + tag);
|
|---|
| 1069 | tagStartChunk = "<" + tag;
|
|---|
| 1070 | validatedTagCache.set(tag, tagStartChunk);
|
|---|
| 1071 | }
|
|---|
| 1072 | return tagStartChunk;
|
|---|
| 1073 | }
|
|---|
| 1074 | function pushStartInstance(
|
|---|
| 1075 | target$jscomp$0,
|
|---|
| 1076 | type,
|
|---|
| 1077 | props,
|
|---|
| 1078 | resumableState,
|
|---|
| 1079 | renderState,
|
|---|
| 1080 | preambleState,
|
|---|
| 1081 | hoistableState,
|
|---|
| 1082 | formatContext,
|
|---|
| 1083 | textEmbedded
|
|---|
| 1084 | ) {
|
|---|
| 1085 | switch (type) {
|
|---|
| 1086 | case "div":
|
|---|
| 1087 | case "span":
|
|---|
| 1088 | case "svg":
|
|---|
| 1089 | case "path":
|
|---|
| 1090 | break;
|
|---|
| 1091 | case "a":
|
|---|
| 1092 | target$jscomp$0.push(startChunkForTag("a"));
|
|---|
| 1093 | var children = null,
|
|---|
| 1094 | innerHTML = null,
|
|---|
| 1095 | propKey;
|
|---|
| 1096 | for (propKey in props)
|
|---|
| 1097 | if (hasOwnProperty.call(props, propKey)) {
|
|---|
| 1098 | var propValue = props[propKey];
|
|---|
| 1099 | if (null != propValue)
|
|---|
| 1100 | switch (propKey) {
|
|---|
| 1101 | case "children":
|
|---|
| 1102 | children = propValue;
|
|---|
| 1103 | break;
|
|---|
| 1104 | case "dangerouslySetInnerHTML":
|
|---|
| 1105 | innerHTML = propValue;
|
|---|
| 1106 | break;
|
|---|
| 1107 | case "href":
|
|---|
| 1108 | "" === propValue
|
|---|
| 1109 | ? pushStringAttribute(target$jscomp$0, "href", "")
|
|---|
| 1110 | : pushAttribute(target$jscomp$0, propKey, propValue);
|
|---|
| 1111 | break;
|
|---|
| 1112 | default:
|
|---|
| 1113 | pushAttribute(target$jscomp$0, propKey, propValue);
|
|---|
| 1114 | }
|
|---|
| 1115 | }
|
|---|
| 1116 | target$jscomp$0.push(">");
|
|---|
| 1117 | pushInnerHTML(target$jscomp$0, innerHTML, children);
|
|---|
| 1118 | if ("string" === typeof children) {
|
|---|
| 1119 | target$jscomp$0.push(escapeTextForBrowser(children));
|
|---|
| 1120 | var JSCompiler_inline_result = null;
|
|---|
| 1121 | } else JSCompiler_inline_result = children;
|
|---|
| 1122 | return JSCompiler_inline_result;
|
|---|
| 1123 | case "g":
|
|---|
| 1124 | case "p":
|
|---|
| 1125 | case "li":
|
|---|
| 1126 | break;
|
|---|
| 1127 | case "select":
|
|---|
| 1128 | target$jscomp$0.push(startChunkForTag("select"));
|
|---|
| 1129 | var children$jscomp$0 = null,
|
|---|
| 1130 | innerHTML$jscomp$0 = null,
|
|---|
| 1131 | propKey$jscomp$0;
|
|---|
| 1132 | for (propKey$jscomp$0 in props)
|
|---|
| 1133 | if (hasOwnProperty.call(props, propKey$jscomp$0)) {
|
|---|
| 1134 | var propValue$jscomp$0 = props[propKey$jscomp$0];
|
|---|
| 1135 | if (null != propValue$jscomp$0)
|
|---|
| 1136 | switch (propKey$jscomp$0) {
|
|---|
| 1137 | case "children":
|
|---|
| 1138 | children$jscomp$0 = propValue$jscomp$0;
|
|---|
| 1139 | break;
|
|---|
| 1140 | case "dangerouslySetInnerHTML":
|
|---|
| 1141 | innerHTML$jscomp$0 = propValue$jscomp$0;
|
|---|
| 1142 | break;
|
|---|
| 1143 | case "defaultValue":
|
|---|
| 1144 | case "value":
|
|---|
| 1145 | break;
|
|---|
| 1146 | default:
|
|---|
| 1147 | pushAttribute(
|
|---|
| 1148 | target$jscomp$0,
|
|---|
| 1149 | propKey$jscomp$0,
|
|---|
| 1150 | propValue$jscomp$0
|
|---|
| 1151 | );
|
|---|
| 1152 | }
|
|---|
| 1153 | }
|
|---|
| 1154 | target$jscomp$0.push(">");
|
|---|
| 1155 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0);
|
|---|
| 1156 | return children$jscomp$0;
|
|---|
| 1157 | case "option":
|
|---|
| 1158 | var selectedValue = formatContext.selectedValue;
|
|---|
| 1159 | target$jscomp$0.push(startChunkForTag("option"));
|
|---|
| 1160 | var children$jscomp$1 = null,
|
|---|
| 1161 | value = null,
|
|---|
| 1162 | selected = null,
|
|---|
| 1163 | innerHTML$jscomp$1 = null,
|
|---|
| 1164 | propKey$jscomp$1;
|
|---|
| 1165 | for (propKey$jscomp$1 in props)
|
|---|
| 1166 | if (hasOwnProperty.call(props, propKey$jscomp$1)) {
|
|---|
| 1167 | var propValue$jscomp$1 = props[propKey$jscomp$1];
|
|---|
| 1168 | if (null != propValue$jscomp$1)
|
|---|
| 1169 | switch (propKey$jscomp$1) {
|
|---|
| 1170 | case "children":
|
|---|
| 1171 | children$jscomp$1 = propValue$jscomp$1;
|
|---|
| 1172 | break;
|
|---|
| 1173 | case "selected":
|
|---|
| 1174 | selected = propValue$jscomp$1;
|
|---|
| 1175 | break;
|
|---|
| 1176 | case "dangerouslySetInnerHTML":
|
|---|
| 1177 | innerHTML$jscomp$1 = propValue$jscomp$1;
|
|---|
| 1178 | break;
|
|---|
| 1179 | case "value":
|
|---|
| 1180 | value = propValue$jscomp$1;
|
|---|
| 1181 | default:
|
|---|
| 1182 | pushAttribute(
|
|---|
| 1183 | target$jscomp$0,
|
|---|
| 1184 | propKey$jscomp$1,
|
|---|
| 1185 | propValue$jscomp$1
|
|---|
| 1186 | );
|
|---|
| 1187 | }
|
|---|
| 1188 | }
|
|---|
| 1189 | if (null != selectedValue) {
|
|---|
| 1190 | var stringValue =
|
|---|
| 1191 | null !== value
|
|---|
| 1192 | ? "" + value
|
|---|
| 1193 | : flattenOptionChildren(children$jscomp$1);
|
|---|
| 1194 | if (isArrayImpl(selectedValue))
|
|---|
| 1195 | for (var i = 0; i < selectedValue.length; i++) {
|
|---|
| 1196 | if ("" + selectedValue[i] === stringValue) {
|
|---|
| 1197 | target$jscomp$0.push(' selected=""');
|
|---|
| 1198 | break;
|
|---|
| 1199 | }
|
|---|
| 1200 | }
|
|---|
| 1201 | else
|
|---|
| 1202 | "" + selectedValue === stringValue &&
|
|---|
| 1203 | target$jscomp$0.push(' selected=""');
|
|---|
| 1204 | } else selected && target$jscomp$0.push(' selected=""');
|
|---|
| 1205 | target$jscomp$0.push(">");
|
|---|
| 1206 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1);
|
|---|
| 1207 | return children$jscomp$1;
|
|---|
| 1208 | case "textarea":
|
|---|
| 1209 | target$jscomp$0.push(startChunkForTag("textarea"));
|
|---|
| 1210 | var value$jscomp$0 = null,
|
|---|
| 1211 | defaultValue = null,
|
|---|
| 1212 | children$jscomp$2 = null,
|
|---|
| 1213 | propKey$jscomp$2;
|
|---|
| 1214 | for (propKey$jscomp$2 in props)
|
|---|
| 1215 | if (hasOwnProperty.call(props, propKey$jscomp$2)) {
|
|---|
| 1216 | var propValue$jscomp$2 = props[propKey$jscomp$2];
|
|---|
| 1217 | if (null != propValue$jscomp$2)
|
|---|
| 1218 | switch (propKey$jscomp$2) {
|
|---|
| 1219 | case "children":
|
|---|
| 1220 | children$jscomp$2 = propValue$jscomp$2;
|
|---|
| 1221 | break;
|
|---|
| 1222 | case "value":
|
|---|
| 1223 | value$jscomp$0 = propValue$jscomp$2;
|
|---|
| 1224 | break;
|
|---|
| 1225 | case "defaultValue":
|
|---|
| 1226 | defaultValue = propValue$jscomp$2;
|
|---|
| 1227 | break;
|
|---|
| 1228 | case "dangerouslySetInnerHTML":
|
|---|
| 1229 | throw Error(
|
|---|
| 1230 | "`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
|---|
| 1231 | );
|
|---|
| 1232 | default:
|
|---|
| 1233 | pushAttribute(
|
|---|
| 1234 | target$jscomp$0,
|
|---|
| 1235 | propKey$jscomp$2,
|
|---|
| 1236 | propValue$jscomp$2
|
|---|
| 1237 | );
|
|---|
| 1238 | }
|
|---|
| 1239 | }
|
|---|
| 1240 | null === value$jscomp$0 &&
|
|---|
| 1241 | null !== defaultValue &&
|
|---|
| 1242 | (value$jscomp$0 = defaultValue);
|
|---|
| 1243 | target$jscomp$0.push(">");
|
|---|
| 1244 | if (null != children$jscomp$2) {
|
|---|
| 1245 | if (null != value$jscomp$0)
|
|---|
| 1246 | throw Error(
|
|---|
| 1247 | "If you supply `defaultValue` on a <textarea>, do not pass children."
|
|---|
| 1248 | );
|
|---|
| 1249 | if (isArrayImpl(children$jscomp$2)) {
|
|---|
| 1250 | if (1 < children$jscomp$2.length)
|
|---|
| 1251 | throw Error("<textarea> can only have at most one child.");
|
|---|
| 1252 | value$jscomp$0 = "" + children$jscomp$2[0];
|
|---|
| 1253 | }
|
|---|
| 1254 | value$jscomp$0 = "" + children$jscomp$2;
|
|---|
| 1255 | }
|
|---|
| 1256 | "string" === typeof value$jscomp$0 &&
|
|---|
| 1257 | "\n" === value$jscomp$0[0] &&
|
|---|
| 1258 | target$jscomp$0.push("\n");
|
|---|
| 1259 | null !== value$jscomp$0 &&
|
|---|
| 1260 | target$jscomp$0.push(escapeTextForBrowser("" + value$jscomp$0));
|
|---|
| 1261 | return null;
|
|---|
| 1262 | case "input":
|
|---|
| 1263 | target$jscomp$0.push(startChunkForTag("input"));
|
|---|
| 1264 | var name = null,
|
|---|
| 1265 | formAction = null,
|
|---|
| 1266 | formEncType = null,
|
|---|
| 1267 | formMethod = null,
|
|---|
| 1268 | formTarget = null,
|
|---|
| 1269 | value$jscomp$1 = null,
|
|---|
| 1270 | defaultValue$jscomp$0 = null,
|
|---|
| 1271 | checked = null,
|
|---|
| 1272 | defaultChecked = null,
|
|---|
| 1273 | propKey$jscomp$3;
|
|---|
| 1274 | for (propKey$jscomp$3 in props)
|
|---|
| 1275 | if (hasOwnProperty.call(props, propKey$jscomp$3)) {
|
|---|
| 1276 | var propValue$jscomp$3 = props[propKey$jscomp$3];
|
|---|
| 1277 | if (null != propValue$jscomp$3)
|
|---|
| 1278 | switch (propKey$jscomp$3) {
|
|---|
| 1279 | case "children":
|
|---|
| 1280 | case "dangerouslySetInnerHTML":
|
|---|
| 1281 | throw Error(
|
|---|
| 1282 | "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|---|
| 1283 | );
|
|---|
| 1284 | case "name":
|
|---|
| 1285 | name = propValue$jscomp$3;
|
|---|
| 1286 | break;
|
|---|
| 1287 | case "formAction":
|
|---|
| 1288 | formAction = propValue$jscomp$3;
|
|---|
| 1289 | break;
|
|---|
| 1290 | case "formEncType":
|
|---|
| 1291 | formEncType = propValue$jscomp$3;
|
|---|
| 1292 | break;
|
|---|
| 1293 | case "formMethod":
|
|---|
| 1294 | formMethod = propValue$jscomp$3;
|
|---|
| 1295 | break;
|
|---|
| 1296 | case "formTarget":
|
|---|
| 1297 | formTarget = propValue$jscomp$3;
|
|---|
| 1298 | break;
|
|---|
| 1299 | case "defaultChecked":
|
|---|
| 1300 | defaultChecked = propValue$jscomp$3;
|
|---|
| 1301 | break;
|
|---|
| 1302 | case "defaultValue":
|
|---|
| 1303 | defaultValue$jscomp$0 = propValue$jscomp$3;
|
|---|
| 1304 | break;
|
|---|
| 1305 | case "checked":
|
|---|
| 1306 | checked = propValue$jscomp$3;
|
|---|
| 1307 | break;
|
|---|
| 1308 | case "value":
|
|---|
| 1309 | value$jscomp$1 = propValue$jscomp$3;
|
|---|
| 1310 | break;
|
|---|
| 1311 | default:
|
|---|
| 1312 | pushAttribute(
|
|---|
| 1313 | target$jscomp$0,
|
|---|
| 1314 | propKey$jscomp$3,
|
|---|
| 1315 | propValue$jscomp$3
|
|---|
| 1316 | );
|
|---|
| 1317 | }
|
|---|
| 1318 | }
|
|---|
| 1319 | var formData = pushFormActionAttribute(
|
|---|
| 1320 | target$jscomp$0,
|
|---|
| 1321 | resumableState,
|
|---|
| 1322 | renderState,
|
|---|
| 1323 | formAction,
|
|---|
| 1324 | formEncType,
|
|---|
| 1325 | formMethod,
|
|---|
| 1326 | formTarget,
|
|---|
| 1327 | name
|
|---|
| 1328 | );
|
|---|
| 1329 | null !== checked
|
|---|
| 1330 | ? pushBooleanAttribute(target$jscomp$0, "checked", checked)
|
|---|
| 1331 | : null !== defaultChecked &&
|
|---|
| 1332 | pushBooleanAttribute(target$jscomp$0, "checked", defaultChecked);
|
|---|
| 1333 | null !== value$jscomp$1
|
|---|
| 1334 | ? pushAttribute(target$jscomp$0, "value", value$jscomp$1)
|
|---|
| 1335 | : null !== defaultValue$jscomp$0 &&
|
|---|
| 1336 | pushAttribute(target$jscomp$0, "value", defaultValue$jscomp$0);
|
|---|
| 1337 | target$jscomp$0.push("/>");
|
|---|
| 1338 | null != formData &&
|
|---|
| 1339 | formData.forEach(pushAdditionalFormField, target$jscomp$0);
|
|---|
| 1340 | return null;
|
|---|
| 1341 | case "button":
|
|---|
| 1342 | target$jscomp$0.push(startChunkForTag("button"));
|
|---|
| 1343 | var children$jscomp$3 = null,
|
|---|
| 1344 | innerHTML$jscomp$2 = null,
|
|---|
| 1345 | name$jscomp$0 = null,
|
|---|
| 1346 | formAction$jscomp$0 = null,
|
|---|
| 1347 | formEncType$jscomp$0 = null,
|
|---|
| 1348 | formMethod$jscomp$0 = null,
|
|---|
| 1349 | formTarget$jscomp$0 = null,
|
|---|
| 1350 | propKey$jscomp$4;
|
|---|
| 1351 | for (propKey$jscomp$4 in props)
|
|---|
| 1352 | if (hasOwnProperty.call(props, propKey$jscomp$4)) {
|
|---|
| 1353 | var propValue$jscomp$4 = props[propKey$jscomp$4];
|
|---|
| 1354 | if (null != propValue$jscomp$4)
|
|---|
| 1355 | switch (propKey$jscomp$4) {
|
|---|
| 1356 | case "children":
|
|---|
| 1357 | children$jscomp$3 = propValue$jscomp$4;
|
|---|
| 1358 | break;
|
|---|
| 1359 | case "dangerouslySetInnerHTML":
|
|---|
| 1360 | innerHTML$jscomp$2 = propValue$jscomp$4;
|
|---|
| 1361 | break;
|
|---|
| 1362 | case "name":
|
|---|
| 1363 | name$jscomp$0 = propValue$jscomp$4;
|
|---|
| 1364 | break;
|
|---|
| 1365 | case "formAction":
|
|---|
| 1366 | formAction$jscomp$0 = propValue$jscomp$4;
|
|---|
| 1367 | break;
|
|---|
| 1368 | case "formEncType":
|
|---|
| 1369 | formEncType$jscomp$0 = propValue$jscomp$4;
|
|---|
| 1370 | break;
|
|---|
| 1371 | case "formMethod":
|
|---|
| 1372 | formMethod$jscomp$0 = propValue$jscomp$4;
|
|---|
| 1373 | break;
|
|---|
| 1374 | case "formTarget":
|
|---|
| 1375 | formTarget$jscomp$0 = propValue$jscomp$4;
|
|---|
| 1376 | break;
|
|---|
| 1377 | default:
|
|---|
| 1378 | pushAttribute(
|
|---|
| 1379 | target$jscomp$0,
|
|---|
| 1380 | propKey$jscomp$4,
|
|---|
| 1381 | propValue$jscomp$4
|
|---|
| 1382 | );
|
|---|
| 1383 | }
|
|---|
| 1384 | }
|
|---|
| 1385 | var formData$jscomp$0 = pushFormActionAttribute(
|
|---|
| 1386 | target$jscomp$0,
|
|---|
| 1387 | resumableState,
|
|---|
| 1388 | renderState,
|
|---|
| 1389 | formAction$jscomp$0,
|
|---|
| 1390 | formEncType$jscomp$0,
|
|---|
| 1391 | formMethod$jscomp$0,
|
|---|
| 1392 | formTarget$jscomp$0,
|
|---|
| 1393 | name$jscomp$0
|
|---|
| 1394 | );
|
|---|
| 1395 | target$jscomp$0.push(">");
|
|---|
| 1396 | null != formData$jscomp$0 &&
|
|---|
| 1397 | formData$jscomp$0.forEach(pushAdditionalFormField, target$jscomp$0);
|
|---|
| 1398 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);
|
|---|
| 1399 | if ("string" === typeof children$jscomp$3) {
|
|---|
| 1400 | target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));
|
|---|
| 1401 | var JSCompiler_inline_result$jscomp$0 = null;
|
|---|
| 1402 | } else JSCompiler_inline_result$jscomp$0 = children$jscomp$3;
|
|---|
| 1403 | return JSCompiler_inline_result$jscomp$0;
|
|---|
| 1404 | case "form":
|
|---|
| 1405 | target$jscomp$0.push(startChunkForTag("form"));
|
|---|
| 1406 | var children$jscomp$4 = null,
|
|---|
| 1407 | innerHTML$jscomp$3 = null,
|
|---|
| 1408 | formAction$jscomp$1 = null,
|
|---|
| 1409 | formEncType$jscomp$1 = null,
|
|---|
| 1410 | formMethod$jscomp$1 = null,
|
|---|
| 1411 | formTarget$jscomp$1 = null,
|
|---|
| 1412 | propKey$jscomp$5;
|
|---|
| 1413 | for (propKey$jscomp$5 in props)
|
|---|
| 1414 | if (hasOwnProperty.call(props, propKey$jscomp$5)) {
|
|---|
| 1415 | var propValue$jscomp$5 = props[propKey$jscomp$5];
|
|---|
| 1416 | if (null != propValue$jscomp$5)
|
|---|
| 1417 | switch (propKey$jscomp$5) {
|
|---|
| 1418 | case "children":
|
|---|
| 1419 | children$jscomp$4 = propValue$jscomp$5;
|
|---|
| 1420 | break;
|
|---|
| 1421 | case "dangerouslySetInnerHTML":
|
|---|
| 1422 | innerHTML$jscomp$3 = propValue$jscomp$5;
|
|---|
| 1423 | break;
|
|---|
| 1424 | case "action":
|
|---|
| 1425 | formAction$jscomp$1 = propValue$jscomp$5;
|
|---|
| 1426 | break;
|
|---|
| 1427 | case "encType":
|
|---|
| 1428 | formEncType$jscomp$1 = propValue$jscomp$5;
|
|---|
| 1429 | break;
|
|---|
| 1430 | case "method":
|
|---|
| 1431 | formMethod$jscomp$1 = propValue$jscomp$5;
|
|---|
| 1432 | break;
|
|---|
| 1433 | case "target":
|
|---|
| 1434 | formTarget$jscomp$1 = propValue$jscomp$5;
|
|---|
| 1435 | break;
|
|---|
| 1436 | default:
|
|---|
| 1437 | pushAttribute(
|
|---|
| 1438 | target$jscomp$0,
|
|---|
| 1439 | propKey$jscomp$5,
|
|---|
| 1440 | propValue$jscomp$5
|
|---|
| 1441 | );
|
|---|
| 1442 | }
|
|---|
| 1443 | }
|
|---|
| 1444 | var formData$jscomp$1 = null,
|
|---|
| 1445 | formActionName = null;
|
|---|
| 1446 | if ("function" === typeof formAction$jscomp$1) {
|
|---|
| 1447 | var customFields = getCustomFormFields(
|
|---|
| 1448 | resumableState,
|
|---|
| 1449 | formAction$jscomp$1
|
|---|
| 1450 | );
|
|---|
| 1451 | null !== customFields
|
|---|
| 1452 | ? ((formAction$jscomp$1 = customFields.action || ""),
|
|---|
| 1453 | (formEncType$jscomp$1 = customFields.encType),
|
|---|
| 1454 | (formMethod$jscomp$1 = customFields.method),
|
|---|
| 1455 | (formTarget$jscomp$1 = customFields.target),
|
|---|
| 1456 | (formData$jscomp$1 = customFields.data),
|
|---|
| 1457 | (formActionName = customFields.name))
|
|---|
| 1458 | : (target$jscomp$0.push(
|
|---|
| 1459 | " ",
|
|---|
| 1460 | "action",
|
|---|
| 1461 | '="',
|
|---|
| 1462 | actionJavaScriptURL,
|
|---|
| 1463 | '"'
|
|---|
| 1464 | ),
|
|---|
| 1465 | (formTarget$jscomp$1 =
|
|---|
| 1466 | formMethod$jscomp$1 =
|
|---|
| 1467 | formEncType$jscomp$1 =
|
|---|
| 1468 | formAction$jscomp$1 =
|
|---|
| 1469 | null),
|
|---|
| 1470 | injectFormReplayingRuntime(resumableState, renderState));
|
|---|
| 1471 | }
|
|---|
| 1472 | null != formAction$jscomp$1 &&
|
|---|
| 1473 | pushAttribute(target$jscomp$0, "action", formAction$jscomp$1);
|
|---|
| 1474 | null != formEncType$jscomp$1 &&
|
|---|
| 1475 | pushAttribute(target$jscomp$0, "encType", formEncType$jscomp$1);
|
|---|
| 1476 | null != formMethod$jscomp$1 &&
|
|---|
| 1477 | pushAttribute(target$jscomp$0, "method", formMethod$jscomp$1);
|
|---|
| 1478 | null != formTarget$jscomp$1 &&
|
|---|
| 1479 | pushAttribute(target$jscomp$0, "target", formTarget$jscomp$1);
|
|---|
| 1480 | target$jscomp$0.push(">");
|
|---|
| 1481 | null !== formActionName &&
|
|---|
| 1482 | (target$jscomp$0.push('<input type="hidden"'),
|
|---|
| 1483 | pushStringAttribute(target$jscomp$0, "name", formActionName),
|
|---|
| 1484 | target$jscomp$0.push("/>"),
|
|---|
| 1485 | null != formData$jscomp$1 &&
|
|---|
| 1486 | formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));
|
|---|
| 1487 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$3, children$jscomp$4);
|
|---|
| 1488 | if ("string" === typeof children$jscomp$4) {
|
|---|
| 1489 | target$jscomp$0.push(escapeTextForBrowser(children$jscomp$4));
|
|---|
| 1490 | var JSCompiler_inline_result$jscomp$1 = null;
|
|---|
| 1491 | } else JSCompiler_inline_result$jscomp$1 = children$jscomp$4;
|
|---|
| 1492 | return JSCompiler_inline_result$jscomp$1;
|
|---|
| 1493 | case "menuitem":
|
|---|
| 1494 | target$jscomp$0.push(startChunkForTag("menuitem"));
|
|---|
| 1495 | for (var propKey$jscomp$6 in props)
|
|---|
| 1496 | if (hasOwnProperty.call(props, propKey$jscomp$6)) {
|
|---|
| 1497 | var propValue$jscomp$6 = props[propKey$jscomp$6];
|
|---|
| 1498 | if (null != propValue$jscomp$6)
|
|---|
| 1499 | switch (propKey$jscomp$6) {
|
|---|
| 1500 | case "children":
|
|---|
| 1501 | case "dangerouslySetInnerHTML":
|
|---|
| 1502 | throw Error(
|
|---|
| 1503 | "menuitems cannot have `children` nor `dangerouslySetInnerHTML`."
|
|---|
| 1504 | );
|
|---|
| 1505 | default:
|
|---|
| 1506 | pushAttribute(
|
|---|
| 1507 | target$jscomp$0,
|
|---|
| 1508 | propKey$jscomp$6,
|
|---|
| 1509 | propValue$jscomp$6
|
|---|
| 1510 | );
|
|---|
| 1511 | }
|
|---|
| 1512 | }
|
|---|
| 1513 | target$jscomp$0.push(">");
|
|---|
| 1514 | return null;
|
|---|
| 1515 | case "object":
|
|---|
| 1516 | target$jscomp$0.push(startChunkForTag("object"));
|
|---|
| 1517 | var children$jscomp$5 = null,
|
|---|
| 1518 | innerHTML$jscomp$4 = null,
|
|---|
| 1519 | propKey$jscomp$7;
|
|---|
| 1520 | for (propKey$jscomp$7 in props)
|
|---|
| 1521 | if (hasOwnProperty.call(props, propKey$jscomp$7)) {
|
|---|
| 1522 | var propValue$jscomp$7 = props[propKey$jscomp$7];
|
|---|
| 1523 | if (null != propValue$jscomp$7)
|
|---|
| 1524 | switch (propKey$jscomp$7) {
|
|---|
| 1525 | case "children":
|
|---|
| 1526 | children$jscomp$5 = propValue$jscomp$7;
|
|---|
| 1527 | break;
|
|---|
| 1528 | case "dangerouslySetInnerHTML":
|
|---|
| 1529 | innerHTML$jscomp$4 = propValue$jscomp$7;
|
|---|
| 1530 | break;
|
|---|
| 1531 | case "data":
|
|---|
| 1532 | var sanitizedValue = sanitizeURL("" + propValue$jscomp$7);
|
|---|
| 1533 | if ("" === sanitizedValue) break;
|
|---|
| 1534 | target$jscomp$0.push(
|
|---|
| 1535 | " ",
|
|---|
| 1536 | "data",
|
|---|
| 1537 | '="',
|
|---|
| 1538 | escapeTextForBrowser(sanitizedValue),
|
|---|
| 1539 | '"'
|
|---|
| 1540 | );
|
|---|
| 1541 | break;
|
|---|
| 1542 | default:
|
|---|
| 1543 | pushAttribute(
|
|---|
| 1544 | target$jscomp$0,
|
|---|
| 1545 | propKey$jscomp$7,
|
|---|
| 1546 | propValue$jscomp$7
|
|---|
| 1547 | );
|
|---|
| 1548 | }
|
|---|
| 1549 | }
|
|---|
| 1550 | target$jscomp$0.push(">");
|
|---|
| 1551 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$4, children$jscomp$5);
|
|---|
| 1552 | if ("string" === typeof children$jscomp$5) {
|
|---|
| 1553 | target$jscomp$0.push(escapeTextForBrowser(children$jscomp$5));
|
|---|
| 1554 | var JSCompiler_inline_result$jscomp$2 = null;
|
|---|
| 1555 | } else JSCompiler_inline_result$jscomp$2 = children$jscomp$5;
|
|---|
| 1556 | return JSCompiler_inline_result$jscomp$2;
|
|---|
| 1557 | case "title":
|
|---|
| 1558 | var noscriptTagInScope = formatContext.tagScope & 1,
|
|---|
| 1559 | isFallback = formatContext.tagScope & 4;
|
|---|
| 1560 | if (
|
|---|
| 1561 | 4 === formatContext.insertionMode ||
|
|---|
| 1562 | noscriptTagInScope ||
|
|---|
| 1563 | null != props.itemProp
|
|---|
| 1564 | )
|
|---|
| 1565 | var JSCompiler_inline_result$jscomp$3 = pushTitleImpl(
|
|---|
| 1566 | target$jscomp$0,
|
|---|
| 1567 | props
|
|---|
| 1568 | );
|
|---|
| 1569 | else
|
|---|
| 1570 | isFallback
|
|---|
| 1571 | ? (JSCompiler_inline_result$jscomp$3 = null)
|
|---|
| 1572 | : (pushTitleImpl(renderState.hoistableChunks, props),
|
|---|
| 1573 | (JSCompiler_inline_result$jscomp$3 = void 0));
|
|---|
| 1574 | return JSCompiler_inline_result$jscomp$3;
|
|---|
| 1575 | case "link":
|
|---|
| 1576 | var noscriptTagInScope$jscomp$0 = formatContext.tagScope & 1,
|
|---|
| 1577 | isFallback$jscomp$0 = formatContext.tagScope & 4,
|
|---|
| 1578 | rel = props.rel,
|
|---|
| 1579 | href = props.href,
|
|---|
| 1580 | precedence = props.precedence;
|
|---|
| 1581 | if (
|
|---|
| 1582 | 4 === formatContext.insertionMode ||
|
|---|
| 1583 | noscriptTagInScope$jscomp$0 ||
|
|---|
| 1584 | null != props.itemProp ||
|
|---|
| 1585 | "string" !== typeof rel ||
|
|---|
| 1586 | "string" !== typeof href ||
|
|---|
| 1587 | "" === href
|
|---|
| 1588 | ) {
|
|---|
| 1589 | pushLinkImpl(target$jscomp$0, props);
|
|---|
| 1590 | var JSCompiler_inline_result$jscomp$4 = null;
|
|---|
| 1591 | } else if ("stylesheet" === props.rel)
|
|---|
| 1592 | if (
|
|---|
| 1593 | "string" !== typeof precedence ||
|
|---|
| 1594 | null != props.disabled ||
|
|---|
| 1595 | props.onLoad ||
|
|---|
| 1596 | props.onError
|
|---|
| 1597 | )
|
|---|
| 1598 | JSCompiler_inline_result$jscomp$4 = pushLinkImpl(
|
|---|
| 1599 | target$jscomp$0,
|
|---|
| 1600 | props
|
|---|
| 1601 | );
|
|---|
| 1602 | else {
|
|---|
| 1603 | var styleQueue = renderState.styles.get(precedence),
|
|---|
| 1604 | resourceState = resumableState.styleResources.hasOwnProperty(href)
|
|---|
| 1605 | ? resumableState.styleResources[href]
|
|---|
| 1606 | : void 0;
|
|---|
| 1607 | if (null !== resourceState) {
|
|---|
| 1608 | resumableState.styleResources[href] = null;
|
|---|
| 1609 | styleQueue ||
|
|---|
| 1610 | ((styleQueue = {
|
|---|
| 1611 | precedence: escapeTextForBrowser(precedence),
|
|---|
| 1612 | rules: [],
|
|---|
| 1613 | hrefs: [],
|
|---|
| 1614 | sheets: new Map()
|
|---|
| 1615 | }),
|
|---|
| 1616 | renderState.styles.set(precedence, styleQueue));
|
|---|
| 1617 | var resource = {
|
|---|
| 1618 | state: 0,
|
|---|
| 1619 | props: assign({}, props, {
|
|---|
| 1620 | "data-precedence": props.precedence,
|
|---|
| 1621 | precedence: null
|
|---|
| 1622 | })
|
|---|
| 1623 | };
|
|---|
| 1624 | if (resourceState) {
|
|---|
| 1625 | 2 === resourceState.length &&
|
|---|
| 1626 | adoptPreloadCredentials(resource.props, resourceState);
|
|---|
| 1627 | var preloadResource = renderState.preloads.stylesheets.get(href);
|
|---|
| 1628 | preloadResource && 0 < preloadResource.length
|
|---|
| 1629 | ? (preloadResource.length = 0)
|
|---|
| 1630 | : (resource.state = 1);
|
|---|
| 1631 | }
|
|---|
| 1632 | styleQueue.sheets.set(href, resource);
|
|---|
| 1633 | hoistableState && hoistableState.stylesheets.add(resource);
|
|---|
| 1634 | } else if (styleQueue) {
|
|---|
| 1635 | var resource$9 = styleQueue.sheets.get(href);
|
|---|
| 1636 | resource$9 &&
|
|---|
| 1637 | hoistableState &&
|
|---|
| 1638 | hoistableState.stylesheets.add(resource$9);
|
|---|
| 1639 | }
|
|---|
| 1640 | textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
|---|
| 1641 | JSCompiler_inline_result$jscomp$4 = null;
|
|---|
| 1642 | }
|
|---|
| 1643 | else
|
|---|
| 1644 | props.onLoad || props.onError
|
|---|
| 1645 | ? (JSCompiler_inline_result$jscomp$4 = pushLinkImpl(
|
|---|
| 1646 | target$jscomp$0,
|
|---|
| 1647 | props
|
|---|
| 1648 | ))
|
|---|
| 1649 | : (textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e"),
|
|---|
| 1650 | (JSCompiler_inline_result$jscomp$4 = isFallback$jscomp$0
|
|---|
| 1651 | ? null
|
|---|
| 1652 | : pushLinkImpl(renderState.hoistableChunks, props)));
|
|---|
| 1653 | return JSCompiler_inline_result$jscomp$4;
|
|---|
| 1654 | case "script":
|
|---|
| 1655 | var noscriptTagInScope$jscomp$1 = formatContext.tagScope & 1,
|
|---|
| 1656 | asyncProp = props.async;
|
|---|
| 1657 | if (
|
|---|
| 1658 | "string" !== typeof props.src ||
|
|---|
| 1659 | !props.src ||
|
|---|
| 1660 | !asyncProp ||
|
|---|
| 1661 | "function" === typeof asyncProp ||
|
|---|
| 1662 | "symbol" === typeof asyncProp ||
|
|---|
| 1663 | props.onLoad ||
|
|---|
| 1664 | props.onError ||
|
|---|
| 1665 | 4 === formatContext.insertionMode ||
|
|---|
| 1666 | noscriptTagInScope$jscomp$1 ||
|
|---|
| 1667 | null != props.itemProp
|
|---|
| 1668 | )
|
|---|
| 1669 | var JSCompiler_inline_result$jscomp$5 = pushScriptImpl(
|
|---|
| 1670 | target$jscomp$0,
|
|---|
| 1671 | props
|
|---|
| 1672 | );
|
|---|
| 1673 | else {
|
|---|
| 1674 | var key = props.src;
|
|---|
| 1675 | if ("module" === props.type) {
|
|---|
| 1676 | var resources = resumableState.moduleScriptResources;
|
|---|
| 1677 | var preloads = renderState.preloads.moduleScripts;
|
|---|
| 1678 | } else
|
|---|
| 1679 | (resources = resumableState.scriptResources),
|
|---|
| 1680 | (preloads = renderState.preloads.scripts);
|
|---|
| 1681 | var resourceState$jscomp$0 = resources.hasOwnProperty(key)
|
|---|
| 1682 | ? resources[key]
|
|---|
| 1683 | : void 0;
|
|---|
| 1684 | if (null !== resourceState$jscomp$0) {
|
|---|
| 1685 | resources[key] = null;
|
|---|
| 1686 | var scriptProps = props;
|
|---|
| 1687 | if (resourceState$jscomp$0) {
|
|---|
| 1688 | 2 === resourceState$jscomp$0.length &&
|
|---|
| 1689 | ((scriptProps = assign({}, props)),
|
|---|
| 1690 | adoptPreloadCredentials(scriptProps, resourceState$jscomp$0));
|
|---|
| 1691 | var preloadResource$jscomp$0 = preloads.get(key);
|
|---|
| 1692 | preloadResource$jscomp$0 && (preloadResource$jscomp$0.length = 0);
|
|---|
| 1693 | }
|
|---|
| 1694 | var resource$jscomp$0 = [];
|
|---|
| 1695 | renderState.scripts.add(resource$jscomp$0);
|
|---|
| 1696 | pushScriptImpl(resource$jscomp$0, scriptProps);
|
|---|
| 1697 | }
|
|---|
| 1698 | textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
|---|
| 1699 | JSCompiler_inline_result$jscomp$5 = null;
|
|---|
| 1700 | }
|
|---|
| 1701 | return JSCompiler_inline_result$jscomp$5;
|
|---|
| 1702 | case "style":
|
|---|
| 1703 | var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
|
|---|
| 1704 | precedence$jscomp$0 = props.precedence,
|
|---|
| 1705 | href$jscomp$0 = props.href,
|
|---|
| 1706 | nonce = props.nonce;
|
|---|
| 1707 | if (
|
|---|
| 1708 | 4 === formatContext.insertionMode ||
|
|---|
| 1709 | noscriptTagInScope$jscomp$2 ||
|
|---|
| 1710 | null != props.itemProp ||
|
|---|
| 1711 | "string" !== typeof precedence$jscomp$0 ||
|
|---|
| 1712 | "string" !== typeof href$jscomp$0 ||
|
|---|
| 1713 | "" === href$jscomp$0
|
|---|
| 1714 | ) {
|
|---|
| 1715 | target$jscomp$0.push(startChunkForTag("style"));
|
|---|
| 1716 | var children$jscomp$6 = null,
|
|---|
| 1717 | innerHTML$jscomp$5 = null,
|
|---|
| 1718 | propKey$jscomp$8;
|
|---|
| 1719 | for (propKey$jscomp$8 in props)
|
|---|
| 1720 | if (hasOwnProperty.call(props, propKey$jscomp$8)) {
|
|---|
| 1721 | var propValue$jscomp$8 = props[propKey$jscomp$8];
|
|---|
| 1722 | if (null != propValue$jscomp$8)
|
|---|
| 1723 | switch (propKey$jscomp$8) {
|
|---|
| 1724 | case "children":
|
|---|
| 1725 | children$jscomp$6 = propValue$jscomp$8;
|
|---|
| 1726 | break;
|
|---|
| 1727 | case "dangerouslySetInnerHTML":
|
|---|
| 1728 | innerHTML$jscomp$5 = propValue$jscomp$8;
|
|---|
| 1729 | break;
|
|---|
| 1730 | default:
|
|---|
| 1731 | pushAttribute(
|
|---|
| 1732 | target$jscomp$0,
|
|---|
| 1733 | propKey$jscomp$8,
|
|---|
| 1734 | propValue$jscomp$8
|
|---|
| 1735 | );
|
|---|
| 1736 | }
|
|---|
| 1737 | }
|
|---|
| 1738 | target$jscomp$0.push(">");
|
|---|
| 1739 | var child = Array.isArray(children$jscomp$6)
|
|---|
| 1740 | ? 2 > children$jscomp$6.length
|
|---|
| 1741 | ? children$jscomp$6[0]
|
|---|
| 1742 | : null
|
|---|
| 1743 | : children$jscomp$6;
|
|---|
| 1744 | "function" !== typeof child &&
|
|---|
| 1745 | "symbol" !== typeof child &&
|
|---|
| 1746 | null !== child &&
|
|---|
| 1747 | void 0 !== child &&
|
|---|
| 1748 | target$jscomp$0.push(("" + child).replace(styleRegex, styleReplacer));
|
|---|
| 1749 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$5, children$jscomp$6);
|
|---|
| 1750 | target$jscomp$0.push(endChunkForTag("style"));
|
|---|
| 1751 | var JSCompiler_inline_result$jscomp$6 = null;
|
|---|
| 1752 | } else {
|
|---|
| 1753 | var styleQueue$jscomp$0 = renderState.styles.get(precedence$jscomp$0);
|
|---|
| 1754 | if (
|
|---|
| 1755 | null !==
|
|---|
| 1756 | (resumableState.styleResources.hasOwnProperty(href$jscomp$0)
|
|---|
| 1757 | ? resumableState.styleResources[href$jscomp$0]
|
|---|
| 1758 | : void 0)
|
|---|
| 1759 | ) {
|
|---|
| 1760 | resumableState.styleResources[href$jscomp$0] = null;
|
|---|
| 1761 | styleQueue$jscomp$0 ||
|
|---|
| 1762 | ((styleQueue$jscomp$0 = {
|
|---|
| 1763 | precedence: escapeTextForBrowser(precedence$jscomp$0),
|
|---|
| 1764 | rules: [],
|
|---|
| 1765 | hrefs: [],
|
|---|
| 1766 | sheets: new Map()
|
|---|
| 1767 | }),
|
|---|
| 1768 | renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
|
|---|
| 1769 | var nonceStyle = renderState.nonce.style;
|
|---|
| 1770 | if (!nonceStyle || nonceStyle === nonce) {
|
|---|
| 1771 | styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
|
|---|
| 1772 | var target = styleQueue$jscomp$0.rules,
|
|---|
| 1773 | children$jscomp$7 = null,
|
|---|
| 1774 | innerHTML$jscomp$6 = null,
|
|---|
| 1775 | propKey$jscomp$9;
|
|---|
| 1776 | for (propKey$jscomp$9 in props)
|
|---|
| 1777 | if (hasOwnProperty.call(props, propKey$jscomp$9)) {
|
|---|
| 1778 | var propValue$jscomp$9 = props[propKey$jscomp$9];
|
|---|
| 1779 | if (null != propValue$jscomp$9)
|
|---|
| 1780 | switch (propKey$jscomp$9) {
|
|---|
| 1781 | case "children":
|
|---|
| 1782 | children$jscomp$7 = propValue$jscomp$9;
|
|---|
| 1783 | break;
|
|---|
| 1784 | case "dangerouslySetInnerHTML":
|
|---|
| 1785 | innerHTML$jscomp$6 = propValue$jscomp$9;
|
|---|
| 1786 | }
|
|---|
| 1787 | }
|
|---|
| 1788 | var child$jscomp$0 = Array.isArray(children$jscomp$7)
|
|---|
| 1789 | ? 2 > children$jscomp$7.length
|
|---|
| 1790 | ? children$jscomp$7[0]
|
|---|
| 1791 | : null
|
|---|
| 1792 | : children$jscomp$7;
|
|---|
| 1793 | "function" !== typeof child$jscomp$0 &&
|
|---|
| 1794 | "symbol" !== typeof child$jscomp$0 &&
|
|---|
| 1795 | null !== child$jscomp$0 &&
|
|---|
| 1796 | void 0 !== child$jscomp$0 &&
|
|---|
| 1797 | target.push(
|
|---|
| 1798 | ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
|
|---|
| 1799 | );
|
|---|
| 1800 | pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
|
|---|
| 1801 | }
|
|---|
| 1802 | }
|
|---|
| 1803 | styleQueue$jscomp$0 &&
|
|---|
| 1804 | hoistableState &&
|
|---|
| 1805 | hoistableState.styles.add(styleQueue$jscomp$0);
|
|---|
| 1806 | textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
|---|
| 1807 | JSCompiler_inline_result$jscomp$6 = void 0;
|
|---|
| 1808 | }
|
|---|
| 1809 | return JSCompiler_inline_result$jscomp$6;
|
|---|
| 1810 | case "meta":
|
|---|
| 1811 | var noscriptTagInScope$jscomp$3 = formatContext.tagScope & 1,
|
|---|
| 1812 | isFallback$jscomp$1 = formatContext.tagScope & 4;
|
|---|
| 1813 | if (
|
|---|
| 1814 | 4 === formatContext.insertionMode ||
|
|---|
| 1815 | noscriptTagInScope$jscomp$3 ||
|
|---|
| 1816 | null != props.itemProp
|
|---|
| 1817 | )
|
|---|
| 1818 | var JSCompiler_inline_result$jscomp$7 = pushSelfClosing(
|
|---|
| 1819 | target$jscomp$0,
|
|---|
| 1820 | props,
|
|---|
| 1821 | "meta"
|
|---|
| 1822 | );
|
|---|
| 1823 | else
|
|---|
| 1824 | textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e"),
|
|---|
| 1825 | (JSCompiler_inline_result$jscomp$7 = isFallback$jscomp$1
|
|---|
| 1826 | ? null
|
|---|
| 1827 | : "string" === typeof props.charSet
|
|---|
| 1828 | ? pushSelfClosing(renderState.charsetChunks, props, "meta")
|
|---|
| 1829 | : "viewport" === props.name
|
|---|
| 1830 | ? pushSelfClosing(renderState.viewportChunks, props, "meta")
|
|---|
| 1831 | : pushSelfClosing(renderState.hoistableChunks, props, "meta"));
|
|---|
| 1832 | return JSCompiler_inline_result$jscomp$7;
|
|---|
| 1833 | case "listing":
|
|---|
| 1834 | case "pre":
|
|---|
| 1835 | target$jscomp$0.push(startChunkForTag(type));
|
|---|
| 1836 | var children$jscomp$8 = null,
|
|---|
| 1837 | innerHTML$jscomp$7 = null,
|
|---|
| 1838 | propKey$jscomp$10;
|
|---|
| 1839 | for (propKey$jscomp$10 in props)
|
|---|
| 1840 | if (hasOwnProperty.call(props, propKey$jscomp$10)) {
|
|---|
| 1841 | var propValue$jscomp$10 = props[propKey$jscomp$10];
|
|---|
| 1842 | if (null != propValue$jscomp$10)
|
|---|
| 1843 | switch (propKey$jscomp$10) {
|
|---|
| 1844 | case "children":
|
|---|
| 1845 | children$jscomp$8 = propValue$jscomp$10;
|
|---|
| 1846 | break;
|
|---|
| 1847 | case "dangerouslySetInnerHTML":
|
|---|
| 1848 | innerHTML$jscomp$7 = propValue$jscomp$10;
|
|---|
| 1849 | break;
|
|---|
| 1850 | default:
|
|---|
| 1851 | pushAttribute(
|
|---|
| 1852 | target$jscomp$0,
|
|---|
| 1853 | propKey$jscomp$10,
|
|---|
| 1854 | propValue$jscomp$10
|
|---|
| 1855 | );
|
|---|
| 1856 | }
|
|---|
| 1857 | }
|
|---|
| 1858 | target$jscomp$0.push(">");
|
|---|
| 1859 | if (null != innerHTML$jscomp$7) {
|
|---|
| 1860 | if (null != children$jscomp$8)
|
|---|
| 1861 | throw Error(
|
|---|
| 1862 | "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
|
|---|
| 1863 | );
|
|---|
| 1864 | if (
|
|---|
| 1865 | "object" !== typeof innerHTML$jscomp$7 ||
|
|---|
| 1866 | !("__html" in innerHTML$jscomp$7)
|
|---|
| 1867 | )
|
|---|
| 1868 | throw Error(
|
|---|
| 1869 | "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
|
|---|
| 1870 | );
|
|---|
| 1871 | var html = innerHTML$jscomp$7.__html;
|
|---|
| 1872 | null !== html &&
|
|---|
| 1873 | void 0 !== html &&
|
|---|
| 1874 | ("string" === typeof html && 0 < html.length && "\n" === html[0]
|
|---|
| 1875 | ? target$jscomp$0.push("\n", html)
|
|---|
| 1876 | : target$jscomp$0.push("" + html));
|
|---|
| 1877 | }
|
|---|
| 1878 | "string" === typeof children$jscomp$8 &&
|
|---|
| 1879 | "\n" === children$jscomp$8[0] &&
|
|---|
| 1880 | target$jscomp$0.push("\n");
|
|---|
| 1881 | return children$jscomp$8;
|
|---|
| 1882 | case "img":
|
|---|
| 1883 | var pictureOrNoScriptTagInScope = formatContext.tagScope & 3,
|
|---|
| 1884 | src = props.src,
|
|---|
| 1885 | srcSet = props.srcSet;
|
|---|
| 1886 | if (
|
|---|
| 1887 | !(
|
|---|
| 1888 | "lazy" === props.loading ||
|
|---|
| 1889 | (!src && !srcSet) ||
|
|---|
| 1890 | ("string" !== typeof src && null != src) ||
|
|---|
| 1891 | ("string" !== typeof srcSet && null != srcSet) ||
|
|---|
| 1892 | "low" === props.fetchPriority ||
|
|---|
| 1893 | pictureOrNoScriptTagInScope
|
|---|
| 1894 | ) &&
|
|---|
| 1895 | ("string" !== typeof src ||
|
|---|
| 1896 | ":" !== src[4] ||
|
|---|
| 1897 | ("d" !== src[0] && "D" !== src[0]) ||
|
|---|
| 1898 | ("a" !== src[1] && "A" !== src[1]) ||
|
|---|
| 1899 | ("t" !== src[2] && "T" !== src[2]) ||
|
|---|
| 1900 | ("a" !== src[3] && "A" !== src[3])) &&
|
|---|
| 1901 | ("string" !== typeof srcSet ||
|
|---|
| 1902 | ":" !== srcSet[4] ||
|
|---|
| 1903 | ("d" !== srcSet[0] && "D" !== srcSet[0]) ||
|
|---|
| 1904 | ("a" !== srcSet[1] && "A" !== srcSet[1]) ||
|
|---|
| 1905 | ("t" !== srcSet[2] && "T" !== srcSet[2]) ||
|
|---|
| 1906 | ("a" !== srcSet[3] && "A" !== srcSet[3]))
|
|---|
| 1907 | ) {
|
|---|
| 1908 | null !== hoistableState &&
|
|---|
| 1909 | formatContext.tagScope & 64 &&
|
|---|
| 1910 | (hoistableState.suspenseyImages = !0);
|
|---|
| 1911 | var sizes = "string" === typeof props.sizes ? props.sizes : void 0,
|
|---|
| 1912 | key$jscomp$0 = srcSet ? srcSet + "\n" + (sizes || "") : src,
|
|---|
| 1913 | promotablePreloads = renderState.preloads.images,
|
|---|
| 1914 | resource$jscomp$1 = promotablePreloads.get(key$jscomp$0);
|
|---|
| 1915 | if (resource$jscomp$1) {
|
|---|
| 1916 | if (
|
|---|
| 1917 | "high" === props.fetchPriority ||
|
|---|
| 1918 | 10 > renderState.highImagePreloads.size
|
|---|
| 1919 | )
|
|---|
| 1920 | promotablePreloads.delete(key$jscomp$0),
|
|---|
| 1921 | renderState.highImagePreloads.add(resource$jscomp$1);
|
|---|
| 1922 | } else if (
|
|---|
| 1923 | !resumableState.imageResources.hasOwnProperty(key$jscomp$0)
|
|---|
| 1924 | ) {
|
|---|
| 1925 | resumableState.imageResources[key$jscomp$0] = PRELOAD_NO_CREDS;
|
|---|
| 1926 | var input = props.crossOrigin;
|
|---|
| 1927 | var JSCompiler_inline_result$jscomp$8 =
|
|---|
| 1928 | "string" === typeof input
|
|---|
| 1929 | ? "use-credentials" === input
|
|---|
| 1930 | ? input
|
|---|
| 1931 | : ""
|
|---|
| 1932 | : void 0;
|
|---|
| 1933 | var headers = renderState.headers,
|
|---|
| 1934 | header;
|
|---|
| 1935 | headers &&
|
|---|
| 1936 | 0 < headers.remainingCapacity &&
|
|---|
| 1937 | "string" !== typeof props.srcSet &&
|
|---|
| 1938 | ("high" === props.fetchPriority ||
|
|---|
| 1939 | 500 > headers.highImagePreloads.length) &&
|
|---|
| 1940 | ((header = getPreloadAsHeader(src, "image", {
|
|---|
| 1941 | imageSrcSet: props.srcSet,
|
|---|
| 1942 | imageSizes: props.sizes,
|
|---|
| 1943 | crossOrigin: JSCompiler_inline_result$jscomp$8,
|
|---|
| 1944 | integrity: props.integrity,
|
|---|
| 1945 | nonce: props.nonce,
|
|---|
| 1946 | type: props.type,
|
|---|
| 1947 | fetchPriority: props.fetchPriority,
|
|---|
| 1948 | referrerPolicy: props.refererPolicy
|
|---|
| 1949 | })),
|
|---|
| 1950 | 0 <= (headers.remainingCapacity -= header.length + 2))
|
|---|
| 1951 | ? ((renderState.resets.image[key$jscomp$0] = PRELOAD_NO_CREDS),
|
|---|
| 1952 | headers.highImagePreloads && (headers.highImagePreloads += ", "),
|
|---|
| 1953 | (headers.highImagePreloads += header))
|
|---|
| 1954 | : ((resource$jscomp$1 = []),
|
|---|
| 1955 | pushLinkImpl(resource$jscomp$1, {
|
|---|
| 1956 | rel: "preload",
|
|---|
| 1957 | as: "image",
|
|---|
| 1958 | href: srcSet ? void 0 : src,
|
|---|
| 1959 | imageSrcSet: srcSet,
|
|---|
| 1960 | imageSizes: sizes,
|
|---|
| 1961 | crossOrigin: JSCompiler_inline_result$jscomp$8,
|
|---|
| 1962 | integrity: props.integrity,
|
|---|
| 1963 | type: props.type,
|
|---|
| 1964 | fetchPriority: props.fetchPriority,
|
|---|
| 1965 | referrerPolicy: props.referrerPolicy
|
|---|
| 1966 | }),
|
|---|
| 1967 | "high" === props.fetchPriority ||
|
|---|
| 1968 | 10 > renderState.highImagePreloads.size
|
|---|
| 1969 | ? renderState.highImagePreloads.add(resource$jscomp$1)
|
|---|
| 1970 | : (renderState.bulkPreloads.add(resource$jscomp$1),
|
|---|
| 1971 | promotablePreloads.set(key$jscomp$0, resource$jscomp$1)));
|
|---|
| 1972 | }
|
|---|
| 1973 | }
|
|---|
| 1974 | return pushSelfClosing(target$jscomp$0, props, "img");
|
|---|
| 1975 | case "base":
|
|---|
| 1976 | case "area":
|
|---|
| 1977 | case "br":
|
|---|
| 1978 | case "col":
|
|---|
| 1979 | case "embed":
|
|---|
| 1980 | case "hr":
|
|---|
| 1981 | case "keygen":
|
|---|
| 1982 | case "param":
|
|---|
| 1983 | case "source":
|
|---|
| 1984 | case "track":
|
|---|
| 1985 | case "wbr":
|
|---|
| 1986 | return pushSelfClosing(target$jscomp$0, props, type);
|
|---|
| 1987 | case "annotation-xml":
|
|---|
| 1988 | case "color-profile":
|
|---|
| 1989 | case "font-face":
|
|---|
| 1990 | case "font-face-src":
|
|---|
| 1991 | case "font-face-uri":
|
|---|
| 1992 | case "font-face-format":
|
|---|
| 1993 | case "font-face-name":
|
|---|
| 1994 | case "missing-glyph":
|
|---|
| 1995 | break;
|
|---|
| 1996 | case "head":
|
|---|
| 1997 | if (2 > formatContext.insertionMode) {
|
|---|
| 1998 | var preamble = preambleState || renderState.preamble;
|
|---|
| 1999 | if (preamble.headChunks)
|
|---|
| 2000 | throw Error("The `<head>` tag may only be rendered once.");
|
|---|
| 2001 | null !== preambleState && target$jscomp$0.push("\x3c!--head--\x3e");
|
|---|
| 2002 | preamble.headChunks = [];
|
|---|
| 2003 | var JSCompiler_inline_result$jscomp$9 = pushStartSingletonElement(
|
|---|
| 2004 | preamble.headChunks,
|
|---|
| 2005 | props,
|
|---|
| 2006 | "head"
|
|---|
| 2007 | );
|
|---|
| 2008 | } else
|
|---|
| 2009 | JSCompiler_inline_result$jscomp$9 = pushStartGenericElement(
|
|---|
| 2010 | target$jscomp$0,
|
|---|
| 2011 | props,
|
|---|
| 2012 | "head"
|
|---|
| 2013 | );
|
|---|
| 2014 | return JSCompiler_inline_result$jscomp$9;
|
|---|
| 2015 | case "body":
|
|---|
| 2016 | if (2 > formatContext.insertionMode) {
|
|---|
| 2017 | var preamble$jscomp$0 = preambleState || renderState.preamble;
|
|---|
| 2018 | if (preamble$jscomp$0.bodyChunks)
|
|---|
| 2019 | throw Error("The `<body>` tag may only be rendered once.");
|
|---|
| 2020 | null !== preambleState && target$jscomp$0.push("\x3c!--body--\x3e");
|
|---|
| 2021 | preamble$jscomp$0.bodyChunks = [];
|
|---|
| 2022 | var JSCompiler_inline_result$jscomp$10 = pushStartSingletonElement(
|
|---|
| 2023 | preamble$jscomp$0.bodyChunks,
|
|---|
| 2024 | props,
|
|---|
| 2025 | "body"
|
|---|
| 2026 | );
|
|---|
| 2027 | } else
|
|---|
| 2028 | JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
|
|---|
| 2029 | target$jscomp$0,
|
|---|
| 2030 | props,
|
|---|
| 2031 | "body"
|
|---|
| 2032 | );
|
|---|
| 2033 | return JSCompiler_inline_result$jscomp$10;
|
|---|
| 2034 | case "html":
|
|---|
| 2035 | if (0 === formatContext.insertionMode) {
|
|---|
| 2036 | var preamble$jscomp$1 = preambleState || renderState.preamble;
|
|---|
| 2037 | if (preamble$jscomp$1.htmlChunks)
|
|---|
| 2038 | throw Error("The `<html>` tag may only be rendered once.");
|
|---|
| 2039 | null !== preambleState && target$jscomp$0.push("\x3c!--html--\x3e");
|
|---|
| 2040 | preamble$jscomp$1.htmlChunks = ["<!DOCTYPE html>"];
|
|---|
| 2041 | var JSCompiler_inline_result$jscomp$11 = pushStartSingletonElement(
|
|---|
| 2042 | preamble$jscomp$1.htmlChunks,
|
|---|
| 2043 | props,
|
|---|
| 2044 | "html"
|
|---|
| 2045 | );
|
|---|
| 2046 | } else
|
|---|
| 2047 | JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
|
|---|
| 2048 | target$jscomp$0,
|
|---|
| 2049 | props,
|
|---|
| 2050 | "html"
|
|---|
| 2051 | );
|
|---|
| 2052 | return JSCompiler_inline_result$jscomp$11;
|
|---|
| 2053 | default:
|
|---|
| 2054 | if (-1 !== type.indexOf("-")) {
|
|---|
| 2055 | target$jscomp$0.push(startChunkForTag(type));
|
|---|
| 2056 | var children$jscomp$9 = null,
|
|---|
| 2057 | innerHTML$jscomp$8 = null,
|
|---|
| 2058 | propKey$jscomp$11;
|
|---|
| 2059 | for (propKey$jscomp$11 in props)
|
|---|
| 2060 | if (hasOwnProperty.call(props, propKey$jscomp$11)) {
|
|---|
| 2061 | var propValue$jscomp$11 = props[propKey$jscomp$11];
|
|---|
| 2062 | if (null != propValue$jscomp$11) {
|
|---|
| 2063 | var attributeName = propKey$jscomp$11;
|
|---|
| 2064 | switch (propKey$jscomp$11) {
|
|---|
| 2065 | case "children":
|
|---|
| 2066 | children$jscomp$9 = propValue$jscomp$11;
|
|---|
| 2067 | break;
|
|---|
| 2068 | case "dangerouslySetInnerHTML":
|
|---|
| 2069 | innerHTML$jscomp$8 = propValue$jscomp$11;
|
|---|
| 2070 | break;
|
|---|
| 2071 | case "style":
|
|---|
| 2072 | pushStyleAttribute(target$jscomp$0, propValue$jscomp$11);
|
|---|
| 2073 | break;
|
|---|
| 2074 | case "suppressContentEditableWarning":
|
|---|
| 2075 | case "suppressHydrationWarning":
|
|---|
| 2076 | case "ref":
|
|---|
| 2077 | break;
|
|---|
| 2078 | case "className":
|
|---|
| 2079 | attributeName = "class";
|
|---|
| 2080 | default:
|
|---|
| 2081 | if (
|
|---|
| 2082 | isAttributeNameSafe(propKey$jscomp$11) &&
|
|---|
| 2083 | "function" !== typeof propValue$jscomp$11 &&
|
|---|
| 2084 | "symbol" !== typeof propValue$jscomp$11 &&
|
|---|
| 2085 | !1 !== propValue$jscomp$11
|
|---|
| 2086 | ) {
|
|---|
| 2087 | if (!0 === propValue$jscomp$11) propValue$jscomp$11 = "";
|
|---|
| 2088 | else if ("object" === typeof propValue$jscomp$11) continue;
|
|---|
| 2089 | target$jscomp$0.push(
|
|---|
| 2090 | " ",
|
|---|
| 2091 | attributeName,
|
|---|
| 2092 | '="',
|
|---|
| 2093 | escapeTextForBrowser(propValue$jscomp$11),
|
|---|
| 2094 | '"'
|
|---|
| 2095 | );
|
|---|
| 2096 | }
|
|---|
| 2097 | }
|
|---|
| 2098 | }
|
|---|
| 2099 | }
|
|---|
| 2100 | target$jscomp$0.push(">");
|
|---|
| 2101 | pushInnerHTML(target$jscomp$0, innerHTML$jscomp$8, children$jscomp$9);
|
|---|
| 2102 | return children$jscomp$9;
|
|---|
| 2103 | }
|
|---|
| 2104 | }
|
|---|
| 2105 | return pushStartGenericElement(target$jscomp$0, props, type);
|
|---|
| 2106 | }
|
|---|
| 2107 | var endTagCache = new Map();
|
|---|
| 2108 | function endChunkForTag(tag) {
|
|---|
| 2109 | var chunk = endTagCache.get(tag);
|
|---|
| 2110 | void 0 === chunk && ((chunk = "</" + tag + ">"), endTagCache.set(tag, chunk));
|
|---|
| 2111 | return chunk;
|
|---|
| 2112 | }
|
|---|
| 2113 | function hoistPreambleState(renderState, preambleState) {
|
|---|
| 2114 | renderState = renderState.preamble;
|
|---|
| 2115 | null === renderState.htmlChunks &&
|
|---|
| 2116 | preambleState.htmlChunks &&
|
|---|
| 2117 | (renderState.htmlChunks = preambleState.htmlChunks);
|
|---|
| 2118 | null === renderState.headChunks &&
|
|---|
| 2119 | preambleState.headChunks &&
|
|---|
| 2120 | (renderState.headChunks = preambleState.headChunks);
|
|---|
| 2121 | null === renderState.bodyChunks &&
|
|---|
| 2122 | preambleState.bodyChunks &&
|
|---|
| 2123 | (renderState.bodyChunks = preambleState.bodyChunks);
|
|---|
| 2124 | }
|
|---|
| 2125 | function writeBootstrap(destination, renderState) {
|
|---|
| 2126 | renderState = renderState.bootstrapChunks;
|
|---|
| 2127 | for (var i = 0; i < renderState.length - 1; i++)
|
|---|
| 2128 | writeChunk(destination, renderState[i]);
|
|---|
| 2129 | return i < renderState.length
|
|---|
| 2130 | ? ((i = renderState[i]), (renderState.length = 0), !!destination.write(i))
|
|---|
| 2131 | : !0;
|
|---|
| 2132 | }
|
|---|
| 2133 | function writeStartPendingSuspenseBoundary(destination, renderState, id) {
|
|---|
| 2134 | writeChunk(destination, '\x3c!--$?--\x3e<template id="');
|
|---|
| 2135 | if (null === id)
|
|---|
| 2136 | throw Error(
|
|---|
| 2137 | "An ID must have been assigned before we can complete the boundary."
|
|---|
| 2138 | );
|
|---|
| 2139 | writeChunk(destination, renderState.boundaryPrefix);
|
|---|
| 2140 | writeChunk(destination, id.toString(16));
|
|---|
| 2141 | return !!destination.write('"></template>');
|
|---|
| 2142 | }
|
|---|
| 2143 | function writeStartSegment(destination, renderState, formatContext, id) {
|
|---|
| 2144 | switch (formatContext.insertionMode) {
|
|---|
| 2145 | case 0:
|
|---|
| 2146 | case 1:
|
|---|
| 2147 | case 3:
|
|---|
| 2148 | case 2:
|
|---|
| 2149 | return (
|
|---|
| 2150 | writeChunk(destination, '<div hidden id="'),
|
|---|
| 2151 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2152 | writeChunk(destination, id.toString(16)),
|
|---|
| 2153 | !!destination.write('">')
|
|---|
| 2154 | );
|
|---|
| 2155 | case 4:
|
|---|
| 2156 | return (
|
|---|
| 2157 | writeChunk(
|
|---|
| 2158 | destination,
|
|---|
| 2159 | '<svg aria-hidden="true" style="display:none" id="'
|
|---|
| 2160 | ),
|
|---|
| 2161 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2162 | writeChunk(destination, id.toString(16)),
|
|---|
| 2163 | !!destination.write('">')
|
|---|
| 2164 | );
|
|---|
| 2165 | case 5:
|
|---|
| 2166 | return (
|
|---|
| 2167 | writeChunk(
|
|---|
| 2168 | destination,
|
|---|
| 2169 | '<math aria-hidden="true" style="display:none" id="'
|
|---|
| 2170 | ),
|
|---|
| 2171 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2172 | writeChunk(destination, id.toString(16)),
|
|---|
| 2173 | !!destination.write('">')
|
|---|
| 2174 | );
|
|---|
| 2175 | case 6:
|
|---|
| 2176 | return (
|
|---|
| 2177 | writeChunk(destination, '<table hidden id="'),
|
|---|
| 2178 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2179 | writeChunk(destination, id.toString(16)),
|
|---|
| 2180 | !!destination.write('">')
|
|---|
| 2181 | );
|
|---|
| 2182 | case 7:
|
|---|
| 2183 | return (
|
|---|
| 2184 | writeChunk(destination, '<table hidden><tbody id="'),
|
|---|
| 2185 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2186 | writeChunk(destination, id.toString(16)),
|
|---|
| 2187 | !!destination.write('">')
|
|---|
| 2188 | );
|
|---|
| 2189 | case 8:
|
|---|
| 2190 | return (
|
|---|
| 2191 | writeChunk(destination, '<table hidden><tr id="'),
|
|---|
| 2192 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2193 | writeChunk(destination, id.toString(16)),
|
|---|
| 2194 | !!destination.write('">')
|
|---|
| 2195 | );
|
|---|
| 2196 | case 9:
|
|---|
| 2197 | return (
|
|---|
| 2198 | writeChunk(destination, '<table hidden><colgroup id="'),
|
|---|
| 2199 | writeChunk(destination, renderState.segmentPrefix),
|
|---|
| 2200 | writeChunk(destination, id.toString(16)),
|
|---|
| 2201 | !!destination.write('">')
|
|---|
| 2202 | );
|
|---|
| 2203 | default:
|
|---|
| 2204 | throw Error("Unknown insertion mode. This is a bug in React.");
|
|---|
| 2205 | }
|
|---|
| 2206 | }
|
|---|
| 2207 | function writeEndSegment(destination, formatContext) {
|
|---|
| 2208 | switch (formatContext.insertionMode) {
|
|---|
| 2209 | case 0:
|
|---|
| 2210 | case 1:
|
|---|
| 2211 | case 3:
|
|---|
| 2212 | case 2:
|
|---|
| 2213 | return !!destination.write("</div>");
|
|---|
| 2214 | case 4:
|
|---|
| 2215 | return !!destination.write("</svg>");
|
|---|
| 2216 | case 5:
|
|---|
| 2217 | return !!destination.write("</math>");
|
|---|
| 2218 | case 6:
|
|---|
| 2219 | return !!destination.write("</table>");
|
|---|
| 2220 | case 7:
|
|---|
| 2221 | return !!destination.write("</tbody></table>");
|
|---|
| 2222 | case 8:
|
|---|
| 2223 | return !!destination.write("</tr></table>");
|
|---|
| 2224 | case 9:
|
|---|
| 2225 | return !!destination.write("</colgroup></table>");
|
|---|
| 2226 | default:
|
|---|
| 2227 | throw Error("Unknown insertion mode. This is a bug in React.");
|
|---|
| 2228 | }
|
|---|
| 2229 | }
|
|---|
| 2230 | var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g;
|
|---|
| 2231 | function escapeJSStringsForInstructionScripts(input) {
|
|---|
| 2232 | return JSON.stringify(input).replace(
|
|---|
| 2233 | regexForJSStringsInInstructionScripts,
|
|---|
| 2234 | function (match) {
|
|---|
| 2235 | switch (match) {
|
|---|
| 2236 | case "<":
|
|---|
| 2237 | return "\\u003c";
|
|---|
| 2238 | case "\u2028":
|
|---|
| 2239 | return "\\u2028";
|
|---|
| 2240 | case "\u2029":
|
|---|
| 2241 | return "\\u2029";
|
|---|
| 2242 | default:
|
|---|
| 2243 | throw Error(
|
|---|
| 2244 | "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
|
|---|
| 2245 | );
|
|---|
| 2246 | }
|
|---|
| 2247 | }
|
|---|
| 2248 | );
|
|---|
| 2249 | }
|
|---|
| 2250 | var regexForJSStringsInScripts = /[&><\u2028\u2029]/g;
|
|---|
| 2251 | function escapeJSObjectForInstructionScripts(input) {
|
|---|
| 2252 | return JSON.stringify(input).replace(
|
|---|
| 2253 | regexForJSStringsInScripts,
|
|---|
| 2254 | function (match) {
|
|---|
| 2255 | switch (match) {
|
|---|
| 2256 | case "&":
|
|---|
| 2257 | return "\\u0026";
|
|---|
| 2258 | case ">":
|
|---|
| 2259 | return "\\u003e";
|
|---|
| 2260 | case "<":
|
|---|
| 2261 | return "\\u003c";
|
|---|
| 2262 | case "\u2028":
|
|---|
| 2263 | return "\\u2028";
|
|---|
| 2264 | case "\u2029":
|
|---|
| 2265 | return "\\u2029";
|
|---|
| 2266 | default:
|
|---|
| 2267 | throw Error(
|
|---|
| 2268 | "escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
|
|---|
| 2269 | );
|
|---|
| 2270 | }
|
|---|
| 2271 | }
|
|---|
| 2272 | );
|
|---|
| 2273 | }
|
|---|
| 2274 | var currentlyRenderingBoundaryHasStylesToHoist = !1,
|
|---|
| 2275 | destinationHasCapacity = !0;
|
|---|
| 2276 | function flushStyleTagsLateForBoundary(styleQueue) {
|
|---|
| 2277 | var rules = styleQueue.rules,
|
|---|
| 2278 | hrefs = styleQueue.hrefs,
|
|---|
| 2279 | i = 0;
|
|---|
| 2280 | if (hrefs.length) {
|
|---|
| 2281 | writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
|
|---|
| 2282 | writeChunk(this, ' media="not all" data-precedence="');
|
|---|
| 2283 | writeChunk(this, styleQueue.precedence);
|
|---|
| 2284 | for (writeChunk(this, '" data-href="'); i < hrefs.length - 1; i++)
|
|---|
| 2285 | writeChunk(this, hrefs[i]), writeChunk(this, " ");
|
|---|
| 2286 | writeChunk(this, hrefs[i]);
|
|---|
| 2287 | writeChunk(this, '">');
|
|---|
| 2288 | for (i = 0; i < rules.length; i++) writeChunk(this, rules[i]);
|
|---|
| 2289 | destinationHasCapacity = !!this.write("</style>");
|
|---|
| 2290 | currentlyRenderingBoundaryHasStylesToHoist = !0;
|
|---|
| 2291 | rules.length = 0;
|
|---|
| 2292 | hrefs.length = 0;
|
|---|
| 2293 | }
|
|---|
| 2294 | }
|
|---|
| 2295 | function hasStylesToHoist(stylesheet) {
|
|---|
| 2296 | return 2 !== stylesheet.state
|
|---|
| 2297 | ? (currentlyRenderingBoundaryHasStylesToHoist = !0)
|
|---|
| 2298 | : !1;
|
|---|
| 2299 | }
|
|---|
| 2300 | function writeHoistablesForBoundary(destination, hoistableState, renderState) {
|
|---|
| 2301 | currentlyRenderingBoundaryHasStylesToHoist = !1;
|
|---|
| 2302 | destinationHasCapacity = !0;
|
|---|
| 2303 | currentlyFlushingRenderState = renderState;
|
|---|
| 2304 | hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
|
|---|
| 2305 | currentlyFlushingRenderState = null;
|
|---|
| 2306 | hoistableState.stylesheets.forEach(hasStylesToHoist);
|
|---|
| 2307 | currentlyRenderingBoundaryHasStylesToHoist &&
|
|---|
| 2308 | (renderState.stylesToHoist = !0);
|
|---|
| 2309 | return destinationHasCapacity;
|
|---|
| 2310 | }
|
|---|
| 2311 | function flushResource(resource) {
|
|---|
| 2312 | for (var i = 0; i < resource.length; i++) writeChunk(this, resource[i]);
|
|---|
| 2313 | resource.length = 0;
|
|---|
| 2314 | }
|
|---|
| 2315 | var stylesheetFlushingQueue = [];
|
|---|
| 2316 | function flushStyleInPreamble(stylesheet) {
|
|---|
| 2317 | pushLinkImpl(stylesheetFlushingQueue, stylesheet.props);
|
|---|
| 2318 | for (var i = 0; i < stylesheetFlushingQueue.length; i++)
|
|---|
| 2319 | writeChunk(this, stylesheetFlushingQueue[i]);
|
|---|
| 2320 | stylesheetFlushingQueue.length = 0;
|
|---|
| 2321 | stylesheet.state = 2;
|
|---|
| 2322 | }
|
|---|
| 2323 | function flushStylesInPreamble(styleQueue) {
|
|---|
| 2324 | var hasStylesheets = 0 < styleQueue.sheets.size;
|
|---|
| 2325 | styleQueue.sheets.forEach(flushStyleInPreamble, this);
|
|---|
| 2326 | styleQueue.sheets.clear();
|
|---|
| 2327 | var rules = styleQueue.rules,
|
|---|
| 2328 | hrefs = styleQueue.hrefs;
|
|---|
| 2329 | if (!hasStylesheets || hrefs.length) {
|
|---|
| 2330 | writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
|
|---|
| 2331 | writeChunk(this, ' data-precedence="');
|
|---|
| 2332 | writeChunk(this, styleQueue.precedence);
|
|---|
| 2333 | styleQueue = 0;
|
|---|
| 2334 | if (hrefs.length) {
|
|---|
| 2335 | for (
|
|---|
| 2336 | writeChunk(this, '" data-href="');
|
|---|
| 2337 | styleQueue < hrefs.length - 1;
|
|---|
| 2338 | styleQueue++
|
|---|
| 2339 | )
|
|---|
| 2340 | writeChunk(this, hrefs[styleQueue]), writeChunk(this, " ");
|
|---|
| 2341 | writeChunk(this, hrefs[styleQueue]);
|
|---|
| 2342 | }
|
|---|
| 2343 | writeChunk(this, '">');
|
|---|
| 2344 | for (styleQueue = 0; styleQueue < rules.length; styleQueue++)
|
|---|
| 2345 | writeChunk(this, rules[styleQueue]);
|
|---|
| 2346 | writeChunk(this, "</style>");
|
|---|
| 2347 | rules.length = 0;
|
|---|
| 2348 | hrefs.length = 0;
|
|---|
| 2349 | }
|
|---|
| 2350 | }
|
|---|
| 2351 | function preloadLateStyle(stylesheet) {
|
|---|
| 2352 | if (0 === stylesheet.state) {
|
|---|
| 2353 | stylesheet.state = 1;
|
|---|
| 2354 | var props = stylesheet.props;
|
|---|
| 2355 | pushLinkImpl(stylesheetFlushingQueue, {
|
|---|
| 2356 | rel: "preload",
|
|---|
| 2357 | as: "style",
|
|---|
| 2358 | href: stylesheet.props.href,
|
|---|
| 2359 | crossOrigin: props.crossOrigin,
|
|---|
| 2360 | fetchPriority: props.fetchPriority,
|
|---|
| 2361 | integrity: props.integrity,
|
|---|
| 2362 | media: props.media,
|
|---|
| 2363 | hrefLang: props.hrefLang,
|
|---|
| 2364 | referrerPolicy: props.referrerPolicy
|
|---|
| 2365 | });
|
|---|
| 2366 | for (
|
|---|
| 2367 | stylesheet = 0;
|
|---|
| 2368 | stylesheet < stylesheetFlushingQueue.length;
|
|---|
| 2369 | stylesheet++
|
|---|
| 2370 | )
|
|---|
| 2371 | writeChunk(this, stylesheetFlushingQueue[stylesheet]);
|
|---|
| 2372 | stylesheetFlushingQueue.length = 0;
|
|---|
| 2373 | }
|
|---|
| 2374 | }
|
|---|
| 2375 | function preloadLateStyles(styleQueue) {
|
|---|
| 2376 | styleQueue.sheets.forEach(preloadLateStyle, this);
|
|---|
| 2377 | styleQueue.sheets.clear();
|
|---|
| 2378 | }
|
|---|
| 2379 | function pushCompletedShellIdAttribute(target, resumableState) {
|
|---|
| 2380 | 0 === (resumableState.instructions & 32) &&
|
|---|
| 2381 | ((resumableState.instructions |= 32),
|
|---|
| 2382 | target.push(
|
|---|
| 2383 | ' id="',
|
|---|
| 2384 | escapeTextForBrowser("_" + resumableState.idPrefix + "R_"),
|
|---|
| 2385 | '"'
|
|---|
| 2386 | ));
|
|---|
| 2387 | }
|
|---|
| 2388 | function writeStyleResourceDependenciesInJS(destination, hoistableState) {
|
|---|
| 2389 | writeChunk(destination, "[");
|
|---|
| 2390 | var nextArrayOpenBrackChunk = "[";
|
|---|
| 2391 | hoistableState.stylesheets.forEach(function (resource) {
|
|---|
| 2392 | if (2 !== resource.state)
|
|---|
| 2393 | if (3 === resource.state)
|
|---|
| 2394 | writeChunk(destination, nextArrayOpenBrackChunk),
|
|---|
| 2395 | writeChunk(
|
|---|
| 2396 | destination,
|
|---|
| 2397 | escapeJSObjectForInstructionScripts("" + resource.props.href)
|
|---|
| 2398 | ),
|
|---|
| 2399 | writeChunk(destination, "]"),
|
|---|
| 2400 | (nextArrayOpenBrackChunk = ",[");
|
|---|
| 2401 | else {
|
|---|
| 2402 | writeChunk(destination, nextArrayOpenBrackChunk);
|
|---|
| 2403 | var precedence = resource.props["data-precedence"],
|
|---|
| 2404 | props = resource.props,
|
|---|
| 2405 | coercedHref = sanitizeURL("" + resource.props.href);
|
|---|
| 2406 | writeChunk(
|
|---|
| 2407 | destination,
|
|---|
| 2408 | escapeJSObjectForInstructionScripts(coercedHref)
|
|---|
| 2409 | );
|
|---|
| 2410 | precedence = "" + precedence;
|
|---|
| 2411 | writeChunk(destination, ",");
|
|---|
| 2412 | writeChunk(
|
|---|
| 2413 | destination,
|
|---|
| 2414 | escapeJSObjectForInstructionScripts(precedence)
|
|---|
| 2415 | );
|
|---|
| 2416 | for (var propKey in props)
|
|---|
| 2417 | if (
|
|---|
| 2418 | hasOwnProperty.call(props, propKey) &&
|
|---|
| 2419 | ((precedence = props[propKey]), null != precedence)
|
|---|
| 2420 | )
|
|---|
| 2421 | switch (propKey) {
|
|---|
| 2422 | case "href":
|
|---|
| 2423 | case "rel":
|
|---|
| 2424 | case "precedence":
|
|---|
| 2425 | case "data-precedence":
|
|---|
| 2426 | break;
|
|---|
| 2427 | case "children":
|
|---|
| 2428 | case "dangerouslySetInnerHTML":
|
|---|
| 2429 | throw Error(
|
|---|
| 2430 | "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
|
|---|
| 2431 | );
|
|---|
| 2432 | default:
|
|---|
| 2433 | writeStyleResourceAttributeInJS(
|
|---|
| 2434 | destination,
|
|---|
| 2435 | propKey,
|
|---|
| 2436 | precedence
|
|---|
| 2437 | );
|
|---|
| 2438 | }
|
|---|
| 2439 | writeChunk(destination, "]");
|
|---|
| 2440 | nextArrayOpenBrackChunk = ",[";
|
|---|
| 2441 | resource.state = 3;
|
|---|
| 2442 | }
|
|---|
| 2443 | });
|
|---|
| 2444 | writeChunk(destination, "]");
|
|---|
| 2445 | }
|
|---|
| 2446 | function writeStyleResourceAttributeInJS(destination, name, value) {
|
|---|
| 2447 | var attributeName = name.toLowerCase();
|
|---|
| 2448 | switch (typeof value) {
|
|---|
| 2449 | case "function":
|
|---|
| 2450 | case "symbol":
|
|---|
| 2451 | return;
|
|---|
| 2452 | }
|
|---|
| 2453 | switch (name) {
|
|---|
| 2454 | case "innerHTML":
|
|---|
| 2455 | case "dangerouslySetInnerHTML":
|
|---|
| 2456 | case "suppressContentEditableWarning":
|
|---|
| 2457 | case "suppressHydrationWarning":
|
|---|
| 2458 | case "style":
|
|---|
| 2459 | case "ref":
|
|---|
| 2460 | return;
|
|---|
| 2461 | case "className":
|
|---|
| 2462 | attributeName = "class";
|
|---|
| 2463 | name = "" + value;
|
|---|
| 2464 | break;
|
|---|
| 2465 | case "hidden":
|
|---|
| 2466 | if (!1 === value) return;
|
|---|
| 2467 | name = "";
|
|---|
| 2468 | break;
|
|---|
| 2469 | case "src":
|
|---|
| 2470 | case "href":
|
|---|
| 2471 | value = sanitizeURL(value);
|
|---|
| 2472 | name = "" + value;
|
|---|
| 2473 | break;
|
|---|
| 2474 | default:
|
|---|
| 2475 | if (
|
|---|
| 2476 | (2 < name.length &&
|
|---|
| 2477 | ("o" === name[0] || "O" === name[0]) &&
|
|---|
| 2478 | ("n" === name[1] || "N" === name[1])) ||
|
|---|
| 2479 | !isAttributeNameSafe(name)
|
|---|
| 2480 | )
|
|---|
| 2481 | return;
|
|---|
| 2482 | name = "" + value;
|
|---|
| 2483 | }
|
|---|
| 2484 | writeChunk(destination, ",");
|
|---|
| 2485 | writeChunk(destination, escapeJSObjectForInstructionScripts(attributeName));
|
|---|
| 2486 | writeChunk(destination, ",");
|
|---|
| 2487 | writeChunk(destination, escapeJSObjectForInstructionScripts(name));
|
|---|
| 2488 | }
|
|---|
| 2489 | function createHoistableState() {
|
|---|
| 2490 | return { styles: new Set(), stylesheets: new Set(), suspenseyImages: !1 };
|
|---|
| 2491 | }
|
|---|
| 2492 | function prefetchDNS(href) {
|
|---|
| 2493 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2494 | if (request) {
|
|---|
| 2495 | var resumableState = request.resumableState,
|
|---|
| 2496 | renderState = request.renderState;
|
|---|
| 2497 | if ("string" === typeof href && href) {
|
|---|
| 2498 | if (!resumableState.dnsResources.hasOwnProperty(href)) {
|
|---|
| 2499 | resumableState.dnsResources[href] = null;
|
|---|
| 2500 | resumableState = renderState.headers;
|
|---|
| 2501 | var header, JSCompiler_temp;
|
|---|
| 2502 | if (
|
|---|
| 2503 | (JSCompiler_temp =
|
|---|
| 2504 | resumableState && 0 < resumableState.remainingCapacity)
|
|---|
| 2505 | )
|
|---|
| 2506 | JSCompiler_temp =
|
|---|
| 2507 | ((header =
|
|---|
| 2508 | "<" +
|
|---|
| 2509 | ("" + href).replace(
|
|---|
| 2510 | regexForHrefInLinkHeaderURLContext,
|
|---|
| 2511 | escapeHrefForLinkHeaderURLContextReplacer
|
|---|
| 2512 | ) +
|
|---|
| 2513 | ">; rel=dns-prefetch"),
|
|---|
| 2514 | 0 <= (resumableState.remainingCapacity -= header.length + 2));
|
|---|
| 2515 | JSCompiler_temp
|
|---|
| 2516 | ? ((renderState.resets.dns[href] = null),
|
|---|
| 2517 | resumableState.preconnects && (resumableState.preconnects += ", "),
|
|---|
| 2518 | (resumableState.preconnects += header))
|
|---|
| 2519 | : ((header = []),
|
|---|
| 2520 | pushLinkImpl(header, { href: href, rel: "dns-prefetch" }),
|
|---|
| 2521 | renderState.preconnects.add(header));
|
|---|
| 2522 | }
|
|---|
| 2523 | enqueueFlush(request);
|
|---|
| 2524 | }
|
|---|
| 2525 | } else previousDispatcher.D(href);
|
|---|
| 2526 | }
|
|---|
| 2527 | function preconnect(href, crossOrigin) {
|
|---|
| 2528 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2529 | if (request) {
|
|---|
| 2530 | var resumableState = request.resumableState,
|
|---|
| 2531 | renderState = request.renderState;
|
|---|
| 2532 | if ("string" === typeof href && href) {
|
|---|
| 2533 | var bucket =
|
|---|
| 2534 | "use-credentials" === crossOrigin
|
|---|
| 2535 | ? "credentials"
|
|---|
| 2536 | : "string" === typeof crossOrigin
|
|---|
| 2537 | ? "anonymous"
|
|---|
| 2538 | : "default";
|
|---|
| 2539 | if (!resumableState.connectResources[bucket].hasOwnProperty(href)) {
|
|---|
| 2540 | resumableState.connectResources[bucket][href] = null;
|
|---|
| 2541 | resumableState = renderState.headers;
|
|---|
| 2542 | var header, JSCompiler_temp;
|
|---|
| 2543 | if (
|
|---|
| 2544 | (JSCompiler_temp =
|
|---|
| 2545 | resumableState && 0 < resumableState.remainingCapacity)
|
|---|
| 2546 | ) {
|
|---|
| 2547 | JSCompiler_temp =
|
|---|
| 2548 | "<" +
|
|---|
| 2549 | ("" + href).replace(
|
|---|
| 2550 | regexForHrefInLinkHeaderURLContext,
|
|---|
| 2551 | escapeHrefForLinkHeaderURLContextReplacer
|
|---|
| 2552 | ) +
|
|---|
| 2553 | ">; rel=preconnect";
|
|---|
| 2554 | if ("string" === typeof crossOrigin) {
|
|---|
| 2555 | var escapedCrossOrigin = ("" + crossOrigin).replace(
|
|---|
| 2556 | regexForLinkHeaderQuotedParamValueContext,
|
|---|
| 2557 | escapeStringForLinkHeaderQuotedParamValueContextReplacer
|
|---|
| 2558 | );
|
|---|
| 2559 | JSCompiler_temp += '; crossorigin="' + escapedCrossOrigin + '"';
|
|---|
| 2560 | }
|
|---|
| 2561 | JSCompiler_temp =
|
|---|
| 2562 | ((header = JSCompiler_temp),
|
|---|
| 2563 | 0 <= (resumableState.remainingCapacity -= header.length + 2));
|
|---|
| 2564 | }
|
|---|
| 2565 | JSCompiler_temp
|
|---|
| 2566 | ? ((renderState.resets.connect[bucket][href] = null),
|
|---|
| 2567 | resumableState.preconnects && (resumableState.preconnects += ", "),
|
|---|
| 2568 | (resumableState.preconnects += header))
|
|---|
| 2569 | : ((bucket = []),
|
|---|
| 2570 | pushLinkImpl(bucket, {
|
|---|
| 2571 | rel: "preconnect",
|
|---|
| 2572 | href: href,
|
|---|
| 2573 | crossOrigin: crossOrigin
|
|---|
| 2574 | }),
|
|---|
| 2575 | renderState.preconnects.add(bucket));
|
|---|
| 2576 | }
|
|---|
| 2577 | enqueueFlush(request);
|
|---|
| 2578 | }
|
|---|
| 2579 | } else previousDispatcher.C(href, crossOrigin);
|
|---|
| 2580 | }
|
|---|
| 2581 | function preload(href, as, options) {
|
|---|
| 2582 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2583 | if (request) {
|
|---|
| 2584 | var resumableState = request.resumableState,
|
|---|
| 2585 | renderState = request.renderState;
|
|---|
| 2586 | if (as && href) {
|
|---|
| 2587 | switch (as) {
|
|---|
| 2588 | case "image":
|
|---|
| 2589 | if (options) {
|
|---|
| 2590 | var imageSrcSet = options.imageSrcSet;
|
|---|
| 2591 | var imageSizes = options.imageSizes;
|
|---|
| 2592 | var fetchPriority = options.fetchPriority;
|
|---|
| 2593 | }
|
|---|
| 2594 | var key = imageSrcSet
|
|---|
| 2595 | ? imageSrcSet + "\n" + (imageSizes || "")
|
|---|
| 2596 | : href;
|
|---|
| 2597 | if (resumableState.imageResources.hasOwnProperty(key)) return;
|
|---|
| 2598 | resumableState.imageResources[key] = PRELOAD_NO_CREDS;
|
|---|
| 2599 | resumableState = renderState.headers;
|
|---|
| 2600 | var header;
|
|---|
| 2601 | resumableState &&
|
|---|
| 2602 | 0 < resumableState.remainingCapacity &&
|
|---|
| 2603 | "string" !== typeof imageSrcSet &&
|
|---|
| 2604 | "high" === fetchPriority &&
|
|---|
| 2605 | ((header = getPreloadAsHeader(href, as, options)),
|
|---|
| 2606 | 0 <= (resumableState.remainingCapacity -= header.length + 2))
|
|---|
| 2607 | ? ((renderState.resets.image[key] = PRELOAD_NO_CREDS),
|
|---|
| 2608 | resumableState.highImagePreloads &&
|
|---|
| 2609 | (resumableState.highImagePreloads += ", "),
|
|---|
| 2610 | (resumableState.highImagePreloads += header))
|
|---|
| 2611 | : ((resumableState = []),
|
|---|
| 2612 | pushLinkImpl(
|
|---|
| 2613 | resumableState,
|
|---|
| 2614 | assign(
|
|---|
| 2615 | { rel: "preload", href: imageSrcSet ? void 0 : href, as: as },
|
|---|
| 2616 | options
|
|---|
| 2617 | )
|
|---|
| 2618 | ),
|
|---|
| 2619 | "high" === fetchPriority
|
|---|
| 2620 | ? renderState.highImagePreloads.add(resumableState)
|
|---|
| 2621 | : (renderState.bulkPreloads.add(resumableState),
|
|---|
| 2622 | renderState.preloads.images.set(key, resumableState)));
|
|---|
| 2623 | break;
|
|---|
| 2624 | case "style":
|
|---|
| 2625 | if (resumableState.styleResources.hasOwnProperty(href)) return;
|
|---|
| 2626 | imageSrcSet = [];
|
|---|
| 2627 | pushLinkImpl(
|
|---|
| 2628 | imageSrcSet,
|
|---|
| 2629 | assign({ rel: "preload", href: href, as: as }, options)
|
|---|
| 2630 | );
|
|---|
| 2631 | resumableState.styleResources[href] =
|
|---|
| 2632 | !options ||
|
|---|
| 2633 | ("string" !== typeof options.crossOrigin &&
|
|---|
| 2634 | "string" !== typeof options.integrity)
|
|---|
| 2635 | ? PRELOAD_NO_CREDS
|
|---|
| 2636 | : [options.crossOrigin, options.integrity];
|
|---|
| 2637 | renderState.preloads.stylesheets.set(href, imageSrcSet);
|
|---|
| 2638 | renderState.bulkPreloads.add(imageSrcSet);
|
|---|
| 2639 | break;
|
|---|
| 2640 | case "script":
|
|---|
| 2641 | if (resumableState.scriptResources.hasOwnProperty(href)) return;
|
|---|
| 2642 | imageSrcSet = [];
|
|---|
| 2643 | renderState.preloads.scripts.set(href, imageSrcSet);
|
|---|
| 2644 | renderState.bulkPreloads.add(imageSrcSet);
|
|---|
| 2645 | pushLinkImpl(
|
|---|
| 2646 | imageSrcSet,
|
|---|
| 2647 | assign({ rel: "preload", href: href, as: as }, options)
|
|---|
| 2648 | );
|
|---|
| 2649 | resumableState.scriptResources[href] =
|
|---|
| 2650 | !options ||
|
|---|
| 2651 | ("string" !== typeof options.crossOrigin &&
|
|---|
| 2652 | "string" !== typeof options.integrity)
|
|---|
| 2653 | ? PRELOAD_NO_CREDS
|
|---|
| 2654 | : [options.crossOrigin, options.integrity];
|
|---|
| 2655 | break;
|
|---|
| 2656 | default:
|
|---|
| 2657 | if (resumableState.unknownResources.hasOwnProperty(as)) {
|
|---|
| 2658 | if (
|
|---|
| 2659 | ((imageSrcSet = resumableState.unknownResources[as]),
|
|---|
| 2660 | imageSrcSet.hasOwnProperty(href))
|
|---|
| 2661 | )
|
|---|
| 2662 | return;
|
|---|
| 2663 | } else
|
|---|
| 2664 | (imageSrcSet = {}),
|
|---|
| 2665 | (resumableState.unknownResources[as] = imageSrcSet);
|
|---|
| 2666 | imageSrcSet[href] = PRELOAD_NO_CREDS;
|
|---|
| 2667 | if (
|
|---|
| 2668 | (resumableState = renderState.headers) &&
|
|---|
| 2669 | 0 < resumableState.remainingCapacity &&
|
|---|
| 2670 | "font" === as &&
|
|---|
| 2671 | ((key = getPreloadAsHeader(href, as, options)),
|
|---|
| 2672 | 0 <= (resumableState.remainingCapacity -= key.length + 2))
|
|---|
| 2673 | )
|
|---|
| 2674 | (renderState.resets.font[href] = PRELOAD_NO_CREDS),
|
|---|
| 2675 | resumableState.fontPreloads &&
|
|---|
| 2676 | (resumableState.fontPreloads += ", "),
|
|---|
| 2677 | (resumableState.fontPreloads += key);
|
|---|
| 2678 | else
|
|---|
| 2679 | switch (
|
|---|
| 2680 | ((resumableState = []),
|
|---|
| 2681 | (href = assign({ rel: "preload", href: href, as: as }, options)),
|
|---|
| 2682 | pushLinkImpl(resumableState, href),
|
|---|
| 2683 | as)
|
|---|
| 2684 | ) {
|
|---|
| 2685 | case "font":
|
|---|
| 2686 | renderState.fontPreloads.add(resumableState);
|
|---|
| 2687 | break;
|
|---|
| 2688 | default:
|
|---|
| 2689 | renderState.bulkPreloads.add(resumableState);
|
|---|
| 2690 | }
|
|---|
| 2691 | }
|
|---|
| 2692 | enqueueFlush(request);
|
|---|
| 2693 | }
|
|---|
| 2694 | } else previousDispatcher.L(href, as, options);
|
|---|
| 2695 | }
|
|---|
| 2696 | function preloadModule(href, options) {
|
|---|
| 2697 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2698 | if (request) {
|
|---|
| 2699 | var resumableState = request.resumableState,
|
|---|
| 2700 | renderState = request.renderState;
|
|---|
| 2701 | if (href) {
|
|---|
| 2702 | var as =
|
|---|
| 2703 | options && "string" === typeof options.as ? options.as : "script";
|
|---|
| 2704 | switch (as) {
|
|---|
| 2705 | case "script":
|
|---|
| 2706 | if (resumableState.moduleScriptResources.hasOwnProperty(href)) return;
|
|---|
| 2707 | as = [];
|
|---|
| 2708 | resumableState.moduleScriptResources[href] =
|
|---|
| 2709 | !options ||
|
|---|
| 2710 | ("string" !== typeof options.crossOrigin &&
|
|---|
| 2711 | "string" !== typeof options.integrity)
|
|---|
| 2712 | ? PRELOAD_NO_CREDS
|
|---|
| 2713 | : [options.crossOrigin, options.integrity];
|
|---|
| 2714 | renderState.preloads.moduleScripts.set(href, as);
|
|---|
| 2715 | break;
|
|---|
| 2716 | default:
|
|---|
| 2717 | if (resumableState.moduleUnknownResources.hasOwnProperty(as)) {
|
|---|
| 2718 | var resources = resumableState.unknownResources[as];
|
|---|
| 2719 | if (resources.hasOwnProperty(href)) return;
|
|---|
| 2720 | } else
|
|---|
| 2721 | (resources = {}),
|
|---|
| 2722 | (resumableState.moduleUnknownResources[as] = resources);
|
|---|
| 2723 | as = [];
|
|---|
| 2724 | resources[href] = PRELOAD_NO_CREDS;
|
|---|
| 2725 | }
|
|---|
| 2726 | pushLinkImpl(as, assign({ rel: "modulepreload", href: href }, options));
|
|---|
| 2727 | renderState.bulkPreloads.add(as);
|
|---|
| 2728 | enqueueFlush(request);
|
|---|
| 2729 | }
|
|---|
| 2730 | } else previousDispatcher.m(href, options);
|
|---|
| 2731 | }
|
|---|
| 2732 | function preinitStyle(href, precedence, options) {
|
|---|
| 2733 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2734 | if (request) {
|
|---|
| 2735 | var resumableState = request.resumableState,
|
|---|
| 2736 | renderState = request.renderState;
|
|---|
| 2737 | if (href) {
|
|---|
| 2738 | precedence = precedence || "default";
|
|---|
| 2739 | var styleQueue = renderState.styles.get(precedence),
|
|---|
| 2740 | resourceState = resumableState.styleResources.hasOwnProperty(href)
|
|---|
| 2741 | ? resumableState.styleResources[href]
|
|---|
| 2742 | : void 0;
|
|---|
| 2743 | null !== resourceState &&
|
|---|
| 2744 | ((resumableState.styleResources[href] = null),
|
|---|
| 2745 | styleQueue ||
|
|---|
| 2746 | ((styleQueue = {
|
|---|
| 2747 | precedence: escapeTextForBrowser(precedence),
|
|---|
| 2748 | rules: [],
|
|---|
| 2749 | hrefs: [],
|
|---|
| 2750 | sheets: new Map()
|
|---|
| 2751 | }),
|
|---|
| 2752 | renderState.styles.set(precedence, styleQueue)),
|
|---|
| 2753 | (precedence = {
|
|---|
| 2754 | state: 0,
|
|---|
| 2755 | props: assign(
|
|---|
| 2756 | { rel: "stylesheet", href: href, "data-precedence": precedence },
|
|---|
| 2757 | options
|
|---|
| 2758 | )
|
|---|
| 2759 | }),
|
|---|
| 2760 | resourceState &&
|
|---|
| 2761 | (2 === resourceState.length &&
|
|---|
| 2762 | adoptPreloadCredentials(precedence.props, resourceState),
|
|---|
| 2763 | (renderState = renderState.preloads.stylesheets.get(href)) &&
|
|---|
| 2764 | 0 < renderState.length
|
|---|
| 2765 | ? (renderState.length = 0)
|
|---|
| 2766 | : (precedence.state = 1)),
|
|---|
| 2767 | styleQueue.sheets.set(href, precedence),
|
|---|
| 2768 | enqueueFlush(request));
|
|---|
| 2769 | }
|
|---|
| 2770 | } else previousDispatcher.S(href, precedence, options);
|
|---|
| 2771 | }
|
|---|
| 2772 | function preinitScript(src, options) {
|
|---|
| 2773 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2774 | if (request) {
|
|---|
| 2775 | var resumableState = request.resumableState,
|
|---|
| 2776 | renderState = request.renderState;
|
|---|
| 2777 | if (src) {
|
|---|
| 2778 | var resourceState = resumableState.scriptResources.hasOwnProperty(src)
|
|---|
| 2779 | ? resumableState.scriptResources[src]
|
|---|
| 2780 | : void 0;
|
|---|
| 2781 | null !== resourceState &&
|
|---|
| 2782 | ((resumableState.scriptResources[src] = null),
|
|---|
| 2783 | (options = assign({ src: src, async: !0 }, options)),
|
|---|
| 2784 | resourceState &&
|
|---|
| 2785 | (2 === resourceState.length &&
|
|---|
| 2786 | adoptPreloadCredentials(options, resourceState),
|
|---|
| 2787 | (src = renderState.preloads.scripts.get(src))) &&
|
|---|
| 2788 | (src.length = 0),
|
|---|
| 2789 | (src = []),
|
|---|
| 2790 | renderState.scripts.add(src),
|
|---|
| 2791 | pushScriptImpl(src, options),
|
|---|
| 2792 | enqueueFlush(request));
|
|---|
| 2793 | }
|
|---|
| 2794 | } else previousDispatcher.X(src, options);
|
|---|
| 2795 | }
|
|---|
| 2796 | function preinitModuleScript(src, options) {
|
|---|
| 2797 | var request = currentRequest ? currentRequest : null;
|
|---|
| 2798 | if (request) {
|
|---|
| 2799 | var resumableState = request.resumableState,
|
|---|
| 2800 | renderState = request.renderState;
|
|---|
| 2801 | if (src) {
|
|---|
| 2802 | var resourceState = resumableState.moduleScriptResources.hasOwnProperty(
|
|---|
| 2803 | src
|
|---|
| 2804 | )
|
|---|
| 2805 | ? resumableState.moduleScriptResources[src]
|
|---|
| 2806 | : void 0;
|
|---|
| 2807 | null !== resourceState &&
|
|---|
| 2808 | ((resumableState.moduleScriptResources[src] = null),
|
|---|
| 2809 | (options = assign({ src: src, type: "module", async: !0 }, options)),
|
|---|
| 2810 | resourceState &&
|
|---|
| 2811 | (2 === resourceState.length &&
|
|---|
| 2812 | adoptPreloadCredentials(options, resourceState),
|
|---|
| 2813 | (src = renderState.preloads.moduleScripts.get(src))) &&
|
|---|
| 2814 | (src.length = 0),
|
|---|
| 2815 | (src = []),
|
|---|
| 2816 | renderState.scripts.add(src),
|
|---|
| 2817 | pushScriptImpl(src, options),
|
|---|
| 2818 | enqueueFlush(request));
|
|---|
| 2819 | }
|
|---|
| 2820 | } else previousDispatcher.M(src, options);
|
|---|
| 2821 | }
|
|---|
| 2822 | function adoptPreloadCredentials(target, preloadState) {
|
|---|
| 2823 | null == target.crossOrigin && (target.crossOrigin = preloadState[0]);
|
|---|
| 2824 | null == target.integrity && (target.integrity = preloadState[1]);
|
|---|
| 2825 | }
|
|---|
| 2826 | function getPreloadAsHeader(href, as, params) {
|
|---|
| 2827 | href = ("" + href).replace(
|
|---|
| 2828 | regexForHrefInLinkHeaderURLContext,
|
|---|
| 2829 | escapeHrefForLinkHeaderURLContextReplacer
|
|---|
| 2830 | );
|
|---|
| 2831 | as = ("" + as).replace(
|
|---|
| 2832 | regexForLinkHeaderQuotedParamValueContext,
|
|---|
| 2833 | escapeStringForLinkHeaderQuotedParamValueContextReplacer
|
|---|
| 2834 | );
|
|---|
| 2835 | as = "<" + href + '>; rel=preload; as="' + as + '"';
|
|---|
| 2836 | for (var paramName in params)
|
|---|
| 2837 | hasOwnProperty.call(params, paramName) &&
|
|---|
| 2838 | ((href = params[paramName]),
|
|---|
| 2839 | "string" === typeof href &&
|
|---|
| 2840 | (as +=
|
|---|
| 2841 | "; " +
|
|---|
| 2842 | paramName.toLowerCase() +
|
|---|
| 2843 | '="' +
|
|---|
| 2844 | ("" + href).replace(
|
|---|
| 2845 | regexForLinkHeaderQuotedParamValueContext,
|
|---|
| 2846 | escapeStringForLinkHeaderQuotedParamValueContextReplacer
|
|---|
| 2847 | ) +
|
|---|
| 2848 | '"'));
|
|---|
| 2849 | return as;
|
|---|
| 2850 | }
|
|---|
| 2851 | var regexForHrefInLinkHeaderURLContext = /[<>\r\n]/g;
|
|---|
| 2852 | function escapeHrefForLinkHeaderURLContextReplacer(match) {
|
|---|
| 2853 | switch (match) {
|
|---|
| 2854 | case "<":
|
|---|
| 2855 | return "%3C";
|
|---|
| 2856 | case ">":
|
|---|
| 2857 | return "%3E";
|
|---|
| 2858 | case "\n":
|
|---|
| 2859 | return "%0A";
|
|---|
| 2860 | case "\r":
|
|---|
| 2861 | return "%0D";
|
|---|
| 2862 | default:
|
|---|
| 2863 | throw Error(
|
|---|
| 2864 | "escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
|
|---|
| 2865 | );
|
|---|
| 2866 | }
|
|---|
| 2867 | }
|
|---|
| 2868 | var regexForLinkHeaderQuotedParamValueContext = /["';,\r\n]/g;
|
|---|
| 2869 | function escapeStringForLinkHeaderQuotedParamValueContextReplacer(match) {
|
|---|
| 2870 | switch (match) {
|
|---|
| 2871 | case '"':
|
|---|
| 2872 | return "%22";
|
|---|
| 2873 | case "'":
|
|---|
| 2874 | return "%27";
|
|---|
| 2875 | case ";":
|
|---|
| 2876 | return "%3B";
|
|---|
| 2877 | case ",":
|
|---|
| 2878 | return "%2C";
|
|---|
| 2879 | case "\n":
|
|---|
| 2880 | return "%0A";
|
|---|
| 2881 | case "\r":
|
|---|
| 2882 | return "%0D";
|
|---|
| 2883 | default:
|
|---|
| 2884 | throw Error(
|
|---|
| 2885 | "escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
|
|---|
| 2886 | );
|
|---|
| 2887 | }
|
|---|
| 2888 | }
|
|---|
| 2889 | function hoistStyleQueueDependency(styleQueue) {
|
|---|
| 2890 | this.styles.add(styleQueue);
|
|---|
| 2891 | }
|
|---|
| 2892 | function hoistStylesheetDependency(stylesheet) {
|
|---|
| 2893 | this.stylesheets.add(stylesheet);
|
|---|
| 2894 | }
|
|---|
| 2895 | function hoistHoistables(parentState, childState) {
|
|---|
| 2896 | childState.styles.forEach(hoistStyleQueueDependency, parentState);
|
|---|
| 2897 | childState.stylesheets.forEach(hoistStylesheetDependency, parentState);
|
|---|
| 2898 | childState.suspenseyImages && (parentState.suspenseyImages = !0);
|
|---|
| 2899 | }
|
|---|
| 2900 | function hasSuspenseyContent(hoistableState) {
|
|---|
| 2901 | return 0 < hoistableState.stylesheets.size || hoistableState.suspenseyImages;
|
|---|
| 2902 | }
|
|---|
| 2903 | var bind = Function.prototype.bind,
|
|---|
| 2904 | REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|---|
| 2905 | function getComponentNameFromType(type) {
|
|---|
| 2906 | if (null == type) return null;
|
|---|
| 2907 | if ("function" === typeof type)
|
|---|
| 2908 | return type.$$typeof === REACT_CLIENT_REFERENCE
|
|---|
| 2909 | ? null
|
|---|
| 2910 | : type.displayName || type.name || null;
|
|---|
| 2911 | if ("string" === typeof type) return type;
|
|---|
| 2912 | switch (type) {
|
|---|
| 2913 | case REACT_FRAGMENT_TYPE:
|
|---|
| 2914 | return "Fragment";
|
|---|
| 2915 | case REACT_PROFILER_TYPE:
|
|---|
| 2916 | return "Profiler";
|
|---|
| 2917 | case REACT_STRICT_MODE_TYPE:
|
|---|
| 2918 | return "StrictMode";
|
|---|
| 2919 | case REACT_SUSPENSE_TYPE:
|
|---|
| 2920 | return "Suspense";
|
|---|
| 2921 | case REACT_SUSPENSE_LIST_TYPE:
|
|---|
| 2922 | return "SuspenseList";
|
|---|
| 2923 | case REACT_ACTIVITY_TYPE:
|
|---|
| 2924 | return "Activity";
|
|---|
| 2925 | }
|
|---|
| 2926 | if ("object" === typeof type)
|
|---|
| 2927 | switch (type.$$typeof) {
|
|---|
| 2928 | case REACT_PORTAL_TYPE:
|
|---|
| 2929 | return "Portal";
|
|---|
| 2930 | case REACT_CONTEXT_TYPE:
|
|---|
| 2931 | return type.displayName || "Context";
|
|---|
| 2932 | case REACT_CONSUMER_TYPE:
|
|---|
| 2933 | return (type._context.displayName || "Context") + ".Consumer";
|
|---|
| 2934 | case REACT_FORWARD_REF_TYPE:
|
|---|
| 2935 | var innerType = type.render;
|
|---|
| 2936 | type = type.displayName;
|
|---|
| 2937 | type ||
|
|---|
| 2938 | ((type = innerType.displayName || innerType.name || ""),
|
|---|
| 2939 | (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|---|
| 2940 | return type;
|
|---|
| 2941 | case REACT_MEMO_TYPE:
|
|---|
| 2942 | return (
|
|---|
| 2943 | (innerType = type.displayName || null),
|
|---|
| 2944 | null !== innerType
|
|---|
| 2945 | ? innerType
|
|---|
| 2946 | : getComponentNameFromType(type.type) || "Memo"
|
|---|
| 2947 | );
|
|---|
| 2948 | case REACT_LAZY_TYPE:
|
|---|
| 2949 | innerType = type._payload;
|
|---|
| 2950 | type = type._init;
|
|---|
| 2951 | try {
|
|---|
| 2952 | return getComponentNameFromType(type(innerType));
|
|---|
| 2953 | } catch (x) {}
|
|---|
| 2954 | }
|
|---|
| 2955 | return null;
|
|---|
| 2956 | }
|
|---|
| 2957 | var emptyContextObject = {},
|
|---|
| 2958 | currentActiveSnapshot = null;
|
|---|
| 2959 | function popToNearestCommonAncestor(prev, next) {
|
|---|
| 2960 | if (prev !== next) {
|
|---|
| 2961 | prev.context._currentValue = prev.parentValue;
|
|---|
| 2962 | prev = prev.parent;
|
|---|
| 2963 | var parentNext = next.parent;
|
|---|
| 2964 | if (null === prev) {
|
|---|
| 2965 | if (null !== parentNext)
|
|---|
| 2966 | throw Error(
|
|---|
| 2967 | "The stacks must reach the root at the same time. This is a bug in React."
|
|---|
| 2968 | );
|
|---|
| 2969 | } else {
|
|---|
| 2970 | if (null === parentNext)
|
|---|
| 2971 | throw Error(
|
|---|
| 2972 | "The stacks must reach the root at the same time. This is a bug in React."
|
|---|
| 2973 | );
|
|---|
| 2974 | popToNearestCommonAncestor(prev, parentNext);
|
|---|
| 2975 | }
|
|---|
| 2976 | next.context._currentValue = next.value;
|
|---|
| 2977 | }
|
|---|
| 2978 | }
|
|---|
| 2979 | function popAllPrevious(prev) {
|
|---|
| 2980 | prev.context._currentValue = prev.parentValue;
|
|---|
| 2981 | prev = prev.parent;
|
|---|
| 2982 | null !== prev && popAllPrevious(prev);
|
|---|
| 2983 | }
|
|---|
| 2984 | function pushAllNext(next) {
|
|---|
| 2985 | var parentNext = next.parent;
|
|---|
| 2986 | null !== parentNext && pushAllNext(parentNext);
|
|---|
| 2987 | next.context._currentValue = next.value;
|
|---|
| 2988 | }
|
|---|
| 2989 | function popPreviousToCommonLevel(prev, next) {
|
|---|
| 2990 | prev.context._currentValue = prev.parentValue;
|
|---|
| 2991 | prev = prev.parent;
|
|---|
| 2992 | if (null === prev)
|
|---|
| 2993 | throw Error(
|
|---|
| 2994 | "The depth must equal at least at zero before reaching the root. This is a bug in React."
|
|---|
| 2995 | );
|
|---|
| 2996 | prev.depth === next.depth
|
|---|
| 2997 | ? popToNearestCommonAncestor(prev, next)
|
|---|
| 2998 | : popPreviousToCommonLevel(prev, next);
|
|---|
| 2999 | }
|
|---|
| 3000 | function popNextToCommonLevel(prev, next) {
|
|---|
| 3001 | var parentNext = next.parent;
|
|---|
| 3002 | if (null === parentNext)
|
|---|
| 3003 | throw Error(
|
|---|
| 3004 | "The depth must equal at least at zero before reaching the root. This is a bug in React."
|
|---|
| 3005 | );
|
|---|
| 3006 | prev.depth === parentNext.depth
|
|---|
| 3007 | ? popToNearestCommonAncestor(prev, parentNext)
|
|---|
| 3008 | : popNextToCommonLevel(prev, parentNext);
|
|---|
| 3009 | next.context._currentValue = next.value;
|
|---|
| 3010 | }
|
|---|
| 3011 | function switchContext(newSnapshot) {
|
|---|
| 3012 | var prev = currentActiveSnapshot;
|
|---|
| 3013 | prev !== newSnapshot &&
|
|---|
| 3014 | (null === prev
|
|---|
| 3015 | ? pushAllNext(newSnapshot)
|
|---|
| 3016 | : null === newSnapshot
|
|---|
| 3017 | ? popAllPrevious(prev)
|
|---|
| 3018 | : prev.depth === newSnapshot.depth
|
|---|
| 3019 | ? popToNearestCommonAncestor(prev, newSnapshot)
|
|---|
| 3020 | : prev.depth > newSnapshot.depth
|
|---|
| 3021 | ? popPreviousToCommonLevel(prev, newSnapshot)
|
|---|
| 3022 | : popNextToCommonLevel(prev, newSnapshot),
|
|---|
| 3023 | (currentActiveSnapshot = newSnapshot));
|
|---|
| 3024 | }
|
|---|
| 3025 | var classComponentUpdater = {
|
|---|
| 3026 | enqueueSetState: function (inst, payload) {
|
|---|
| 3027 | inst = inst._reactInternals;
|
|---|
| 3028 | null !== inst.queue && inst.queue.push(payload);
|
|---|
| 3029 | },
|
|---|
| 3030 | enqueueReplaceState: function (inst, payload) {
|
|---|
| 3031 | inst = inst._reactInternals;
|
|---|
| 3032 | inst.replace = !0;
|
|---|
| 3033 | inst.queue = [payload];
|
|---|
| 3034 | },
|
|---|
| 3035 | enqueueForceUpdate: function () {}
|
|---|
| 3036 | },
|
|---|
| 3037 | emptyTreeContext = { id: 1, overflow: "" };
|
|---|
| 3038 | function pushTreeContext(baseContext, totalChildren, index) {
|
|---|
| 3039 | var baseIdWithLeadingBit = baseContext.id;
|
|---|
| 3040 | baseContext = baseContext.overflow;
|
|---|
| 3041 | var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
|
|---|
| 3042 | baseIdWithLeadingBit &= ~(1 << baseLength);
|
|---|
| 3043 | index += 1;
|
|---|
| 3044 | var length = 32 - clz32(totalChildren) + baseLength;
|
|---|
| 3045 | if (30 < length) {
|
|---|
| 3046 | var numberOfOverflowBits = baseLength - (baseLength % 5);
|
|---|
| 3047 | length = (
|
|---|
| 3048 | baseIdWithLeadingBit &
|
|---|
| 3049 | ((1 << numberOfOverflowBits) - 1)
|
|---|
| 3050 | ).toString(32);
|
|---|
| 3051 | baseIdWithLeadingBit >>= numberOfOverflowBits;
|
|---|
| 3052 | baseLength -= numberOfOverflowBits;
|
|---|
| 3053 | return {
|
|---|
| 3054 | id:
|
|---|
| 3055 | (1 << (32 - clz32(totalChildren) + baseLength)) |
|
|---|
| 3056 | (index << baseLength) |
|
|---|
| 3057 | baseIdWithLeadingBit,
|
|---|
| 3058 | overflow: length + baseContext
|
|---|
| 3059 | };
|
|---|
| 3060 | }
|
|---|
| 3061 | return {
|
|---|
| 3062 | id: (1 << length) | (index << baseLength) | baseIdWithLeadingBit,
|
|---|
| 3063 | overflow: baseContext
|
|---|
| 3064 | };
|
|---|
| 3065 | }
|
|---|
| 3066 | var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,
|
|---|
| 3067 | log = Math.log,
|
|---|
| 3068 | LN2 = Math.LN2;
|
|---|
| 3069 | function clz32Fallback(x) {
|
|---|
| 3070 | x >>>= 0;
|
|---|
| 3071 | return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
|
|---|
| 3072 | }
|
|---|
| 3073 | function noop() {}
|
|---|
| 3074 | var SuspenseException = Error(
|
|---|
| 3075 | "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`."
|
|---|
| 3076 | );
|
|---|
| 3077 | function trackUsedThenable(thenableState, thenable, index) {
|
|---|
| 3078 | index = thenableState[index];
|
|---|
| 3079 | void 0 === index
|
|---|
| 3080 | ? thenableState.push(thenable)
|
|---|
| 3081 | : index !== thenable && (thenable.then(noop, noop), (thenable = index));
|
|---|
| 3082 | switch (thenable.status) {
|
|---|
| 3083 | case "fulfilled":
|
|---|
| 3084 | return thenable.value;
|
|---|
| 3085 | case "rejected":
|
|---|
| 3086 | throw thenable.reason;
|
|---|
| 3087 | default:
|
|---|
| 3088 | "string" === typeof thenable.status
|
|---|
| 3089 | ? thenable.then(noop, noop)
|
|---|
| 3090 | : ((thenableState = thenable),
|
|---|
| 3091 | (thenableState.status = "pending"),
|
|---|
| 3092 | thenableState.then(
|
|---|
| 3093 | function (fulfilledValue) {
|
|---|
| 3094 | if ("pending" === thenable.status) {
|
|---|
| 3095 | var fulfilledThenable = thenable;
|
|---|
| 3096 | fulfilledThenable.status = "fulfilled";
|
|---|
| 3097 | fulfilledThenable.value = fulfilledValue;
|
|---|
| 3098 | }
|
|---|
| 3099 | },
|
|---|
| 3100 | function (error) {
|
|---|
| 3101 | if ("pending" === thenable.status) {
|
|---|
| 3102 | var rejectedThenable = thenable;
|
|---|
| 3103 | rejectedThenable.status = "rejected";
|
|---|
| 3104 | rejectedThenable.reason = error;
|
|---|
| 3105 | }
|
|---|
| 3106 | }
|
|---|
| 3107 | ));
|
|---|
| 3108 | switch (thenable.status) {
|
|---|
| 3109 | case "fulfilled":
|
|---|
| 3110 | return thenable.value;
|
|---|
| 3111 | case "rejected":
|
|---|
| 3112 | throw thenable.reason;
|
|---|
| 3113 | }
|
|---|
| 3114 | suspendedThenable = thenable;
|
|---|
| 3115 | throw SuspenseException;
|
|---|
| 3116 | }
|
|---|
| 3117 | }
|
|---|
| 3118 | var suspendedThenable = null;
|
|---|
| 3119 | function getSuspendedThenable() {
|
|---|
| 3120 | if (null === suspendedThenable)
|
|---|
| 3121 | throw Error(
|
|---|
| 3122 | "Expected a suspended thenable. This is a bug in React. Please file an issue."
|
|---|
| 3123 | );
|
|---|
| 3124 | var thenable = suspendedThenable;
|
|---|
| 3125 | suspendedThenable = null;
|
|---|
| 3126 | return thenable;
|
|---|
| 3127 | }
|
|---|
| 3128 | function is(x, y) {
|
|---|
| 3129 | return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|---|
| 3130 | }
|
|---|
| 3131 | var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|---|
| 3132 | currentlyRenderingComponent = null,
|
|---|
| 3133 | currentlyRenderingTask = null,
|
|---|
| 3134 | currentlyRenderingRequest = null,
|
|---|
| 3135 | currentlyRenderingKeyPath = null,
|
|---|
| 3136 | firstWorkInProgressHook = null,
|
|---|
| 3137 | workInProgressHook = null,
|
|---|
| 3138 | isReRender = !1,
|
|---|
| 3139 | didScheduleRenderPhaseUpdate = !1,
|
|---|
| 3140 | localIdCounter = 0,
|
|---|
| 3141 | actionStateCounter = 0,
|
|---|
| 3142 | actionStateMatchingIndex = -1,
|
|---|
| 3143 | thenableIndexCounter = 0,
|
|---|
| 3144 | thenableState = null,
|
|---|
| 3145 | renderPhaseUpdates = null,
|
|---|
| 3146 | numberOfReRenders = 0;
|
|---|
| 3147 | function resolveCurrentlyRenderingComponent() {
|
|---|
| 3148 | if (null === currentlyRenderingComponent)
|
|---|
| 3149 | throw Error(
|
|---|
| 3150 | "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|---|
| 3151 | );
|
|---|
| 3152 | return currentlyRenderingComponent;
|
|---|
| 3153 | }
|
|---|
| 3154 | function createHook() {
|
|---|
| 3155 | if (0 < numberOfReRenders)
|
|---|
| 3156 | throw Error("Rendered more hooks than during the previous render");
|
|---|
| 3157 | return { memoizedState: null, queue: null, next: null };
|
|---|
| 3158 | }
|
|---|
| 3159 | function createWorkInProgressHook() {
|
|---|
| 3160 | null === workInProgressHook
|
|---|
| 3161 | ? null === firstWorkInProgressHook
|
|---|
| 3162 | ? ((isReRender = !1),
|
|---|
| 3163 | (firstWorkInProgressHook = workInProgressHook = createHook()))
|
|---|
| 3164 | : ((isReRender = !0), (workInProgressHook = firstWorkInProgressHook))
|
|---|
| 3165 | : null === workInProgressHook.next
|
|---|
| 3166 | ? ((isReRender = !1),
|
|---|
| 3167 | (workInProgressHook = workInProgressHook.next = createHook()))
|
|---|
| 3168 | : ((isReRender = !0), (workInProgressHook = workInProgressHook.next));
|
|---|
| 3169 | return workInProgressHook;
|
|---|
| 3170 | }
|
|---|
| 3171 | function getThenableStateAfterSuspending() {
|
|---|
| 3172 | var state = thenableState;
|
|---|
| 3173 | thenableState = null;
|
|---|
| 3174 | return state;
|
|---|
| 3175 | }
|
|---|
| 3176 | function resetHooksState() {
|
|---|
| 3177 | currentlyRenderingKeyPath =
|
|---|
| 3178 | currentlyRenderingRequest =
|
|---|
| 3179 | currentlyRenderingTask =
|
|---|
| 3180 | currentlyRenderingComponent =
|
|---|
| 3181 | null;
|
|---|
| 3182 | didScheduleRenderPhaseUpdate = !1;
|
|---|
| 3183 | firstWorkInProgressHook = null;
|
|---|
| 3184 | numberOfReRenders = 0;
|
|---|
| 3185 | workInProgressHook = renderPhaseUpdates = null;
|
|---|
| 3186 | }
|
|---|
| 3187 | function basicStateReducer(state, action) {
|
|---|
| 3188 | return "function" === typeof action ? action(state) : action;
|
|---|
| 3189 | }
|
|---|
| 3190 | function useReducer(reducer, initialArg, init) {
|
|---|
| 3191 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
|---|
| 3192 | workInProgressHook = createWorkInProgressHook();
|
|---|
| 3193 | if (isReRender) {
|
|---|
| 3194 | var queue = workInProgressHook.queue;
|
|---|
| 3195 | initialArg = queue.dispatch;
|
|---|
| 3196 | if (
|
|---|
| 3197 | null !== renderPhaseUpdates &&
|
|---|
| 3198 | ((init = renderPhaseUpdates.get(queue)), void 0 !== init)
|
|---|
| 3199 | ) {
|
|---|
| 3200 | renderPhaseUpdates.delete(queue);
|
|---|
| 3201 | queue = workInProgressHook.memoizedState;
|
|---|
| 3202 | do (queue = reducer(queue, init.action)), (init = init.next);
|
|---|
| 3203 | while (null !== init);
|
|---|
| 3204 | workInProgressHook.memoizedState = queue;
|
|---|
| 3205 | return [queue, initialArg];
|
|---|
| 3206 | }
|
|---|
| 3207 | return [workInProgressHook.memoizedState, initialArg];
|
|---|
| 3208 | }
|
|---|
| 3209 | reducer =
|
|---|
| 3210 | reducer === basicStateReducer
|
|---|
| 3211 | ? "function" === typeof initialArg
|
|---|
| 3212 | ? initialArg()
|
|---|
| 3213 | : initialArg
|
|---|
| 3214 | : void 0 !== init
|
|---|
| 3215 | ? init(initialArg)
|
|---|
| 3216 | : initialArg;
|
|---|
| 3217 | workInProgressHook.memoizedState = reducer;
|
|---|
| 3218 | reducer = workInProgressHook.queue = { last: null, dispatch: null };
|
|---|
| 3219 | reducer = reducer.dispatch = dispatchAction.bind(
|
|---|
| 3220 | null,
|
|---|
| 3221 | currentlyRenderingComponent,
|
|---|
| 3222 | reducer
|
|---|
| 3223 | );
|
|---|
| 3224 | return [workInProgressHook.memoizedState, reducer];
|
|---|
| 3225 | }
|
|---|
| 3226 | function useMemo(nextCreate, deps) {
|
|---|
| 3227 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
|---|
| 3228 | workInProgressHook = createWorkInProgressHook();
|
|---|
| 3229 | deps = void 0 === deps ? null : deps;
|
|---|
| 3230 | if (null !== workInProgressHook) {
|
|---|
| 3231 | var prevState = workInProgressHook.memoizedState;
|
|---|
| 3232 | if (null !== prevState && null !== deps) {
|
|---|
| 3233 | var prevDeps = prevState[1];
|
|---|
| 3234 | a: if (null === prevDeps) prevDeps = !1;
|
|---|
| 3235 | else {
|
|---|
| 3236 | for (var i = 0; i < prevDeps.length && i < deps.length; i++)
|
|---|
| 3237 | if (!objectIs(deps[i], prevDeps[i])) {
|
|---|
| 3238 | prevDeps = !1;
|
|---|
| 3239 | break a;
|
|---|
| 3240 | }
|
|---|
| 3241 | prevDeps = !0;
|
|---|
| 3242 | }
|
|---|
| 3243 | if (prevDeps) return prevState[0];
|
|---|
| 3244 | }
|
|---|
| 3245 | }
|
|---|
| 3246 | nextCreate = nextCreate();
|
|---|
| 3247 | workInProgressHook.memoizedState = [nextCreate, deps];
|
|---|
| 3248 | return nextCreate;
|
|---|
| 3249 | }
|
|---|
| 3250 | function dispatchAction(componentIdentity, queue, action) {
|
|---|
| 3251 | if (25 <= numberOfReRenders)
|
|---|
| 3252 | throw Error(
|
|---|
| 3253 | "Too many re-renders. React limits the number of renders to prevent an infinite loop."
|
|---|
| 3254 | );
|
|---|
| 3255 | if (componentIdentity === currentlyRenderingComponent)
|
|---|
| 3256 | if (
|
|---|
| 3257 | ((didScheduleRenderPhaseUpdate = !0),
|
|---|
| 3258 | (componentIdentity = { action: action, next: null }),
|
|---|
| 3259 | null === renderPhaseUpdates && (renderPhaseUpdates = new Map()),
|
|---|
| 3260 | (action = renderPhaseUpdates.get(queue)),
|
|---|
| 3261 | void 0 === action)
|
|---|
| 3262 | )
|
|---|
| 3263 | renderPhaseUpdates.set(queue, componentIdentity);
|
|---|
| 3264 | else {
|
|---|
| 3265 | for (queue = action; null !== queue.next; ) queue = queue.next;
|
|---|
| 3266 | queue.next = componentIdentity;
|
|---|
| 3267 | }
|
|---|
| 3268 | }
|
|---|
| 3269 | function throwOnUseEffectEventCall() {
|
|---|
| 3270 | throw Error(
|
|---|
| 3271 | "A function wrapped in useEffectEvent can't be called during rendering."
|
|---|
| 3272 | );
|
|---|
| 3273 | }
|
|---|
| 3274 | function unsupportedStartTransition() {
|
|---|
| 3275 | throw Error("startTransition cannot be called during server rendering.");
|
|---|
| 3276 | }
|
|---|
| 3277 | function unsupportedSetOptimisticState() {
|
|---|
| 3278 | throw Error("Cannot update optimistic state while rendering.");
|
|---|
| 3279 | }
|
|---|
| 3280 | function useActionState(action, initialState, permalink) {
|
|---|
| 3281 | resolveCurrentlyRenderingComponent();
|
|---|
| 3282 | var actionStateHookIndex = actionStateCounter++,
|
|---|
| 3283 | request = currentlyRenderingRequest;
|
|---|
| 3284 | if ("function" === typeof action.$$FORM_ACTION) {
|
|---|
| 3285 | var nextPostbackStateKey = null,
|
|---|
| 3286 | componentKeyPath = currentlyRenderingKeyPath;
|
|---|
| 3287 | request = request.formState;
|
|---|
| 3288 | var isSignatureEqual = action.$$IS_SIGNATURE_EQUAL;
|
|---|
| 3289 | if (null !== request && "function" === typeof isSignatureEqual) {
|
|---|
| 3290 | var postbackKey = request[1];
|
|---|
| 3291 | isSignatureEqual.call(action, request[2], request[3]) &&
|
|---|
| 3292 | ((nextPostbackStateKey =
|
|---|
| 3293 | void 0 !== permalink
|
|---|
| 3294 | ? "p" + permalink
|
|---|
| 3295 | : "k" +
|
|---|
| 3296 | Bun.hash(
|
|---|
| 3297 | JSON.stringify([componentKeyPath, null, actionStateHookIndex])
|
|---|
| 3298 | )),
|
|---|
| 3299 | postbackKey === nextPostbackStateKey &&
|
|---|
| 3300 | ((actionStateMatchingIndex = actionStateHookIndex),
|
|---|
| 3301 | (initialState = request[0])));
|
|---|
| 3302 | }
|
|---|
| 3303 | var boundAction = action.bind(null, initialState);
|
|---|
| 3304 | action = function (payload) {
|
|---|
| 3305 | boundAction(payload);
|
|---|
| 3306 | };
|
|---|
| 3307 | "function" === typeof boundAction.$$FORM_ACTION &&
|
|---|
| 3308 | (action.$$FORM_ACTION = function (prefix) {
|
|---|
| 3309 | prefix = boundAction.$$FORM_ACTION(prefix);
|
|---|
| 3310 | void 0 !== permalink &&
|
|---|
| 3311 | ((permalink += ""), (prefix.action = permalink));
|
|---|
| 3312 | var formData = prefix.data;
|
|---|
| 3313 | formData &&
|
|---|
| 3314 | (null === nextPostbackStateKey &&
|
|---|
| 3315 | (nextPostbackStateKey =
|
|---|
| 3316 | void 0 !== permalink
|
|---|
| 3317 | ? "p" + permalink
|
|---|
| 3318 | : "k" +
|
|---|
| 3319 | Bun.hash(
|
|---|
| 3320 | JSON.stringify([
|
|---|
| 3321 | componentKeyPath,
|
|---|
| 3322 | null,
|
|---|
| 3323 | actionStateHookIndex
|
|---|
| 3324 | ])
|
|---|
| 3325 | )),
|
|---|
| 3326 | formData.append("$ACTION_KEY", nextPostbackStateKey));
|
|---|
| 3327 | return prefix;
|
|---|
| 3328 | });
|
|---|
| 3329 | return [initialState, action, !1];
|
|---|
| 3330 | }
|
|---|
| 3331 | var boundAction$22 = action.bind(null, initialState);
|
|---|
| 3332 | return [
|
|---|
| 3333 | initialState,
|
|---|
| 3334 | function (payload) {
|
|---|
| 3335 | boundAction$22(payload);
|
|---|
| 3336 | },
|
|---|
| 3337 | !1
|
|---|
| 3338 | ];
|
|---|
| 3339 | }
|
|---|
| 3340 | function unwrapThenable(thenable) {
|
|---|
| 3341 | var index = thenableIndexCounter;
|
|---|
| 3342 | thenableIndexCounter += 1;
|
|---|
| 3343 | null === thenableState && (thenableState = []);
|
|---|
| 3344 | return trackUsedThenable(thenableState, thenable, index);
|
|---|
| 3345 | }
|
|---|
| 3346 | function unsupportedRefresh() {
|
|---|
| 3347 | throw Error("Cache cannot be refreshed during server rendering.");
|
|---|
| 3348 | }
|
|---|
| 3349 | var HooksDispatcher = {
|
|---|
| 3350 | readContext: function (context) {
|
|---|
| 3351 | return context._currentValue;
|
|---|
| 3352 | },
|
|---|
| 3353 | use: function (usable) {
|
|---|
| 3354 | if (null !== usable && "object" === typeof usable) {
|
|---|
| 3355 | if ("function" === typeof usable.then) return unwrapThenable(usable);
|
|---|
| 3356 | if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue;
|
|---|
| 3357 | }
|
|---|
| 3358 | throw Error("An unsupported type was passed to use(): " + String(usable));
|
|---|
| 3359 | },
|
|---|
| 3360 | useContext: function (context) {
|
|---|
| 3361 | resolveCurrentlyRenderingComponent();
|
|---|
| 3362 | return context._currentValue;
|
|---|
| 3363 | },
|
|---|
| 3364 | useMemo: useMemo,
|
|---|
| 3365 | useReducer: useReducer,
|
|---|
| 3366 | useRef: function (initialValue) {
|
|---|
| 3367 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
|---|
| 3368 | workInProgressHook = createWorkInProgressHook();
|
|---|
| 3369 | var previousRef = workInProgressHook.memoizedState;
|
|---|
| 3370 | return null === previousRef
|
|---|
| 3371 | ? ((initialValue = { current: initialValue }),
|
|---|
| 3372 | (workInProgressHook.memoizedState = initialValue))
|
|---|
| 3373 | : previousRef;
|
|---|
| 3374 | },
|
|---|
| 3375 | useState: function (initialState) {
|
|---|
| 3376 | return useReducer(basicStateReducer, initialState);
|
|---|
| 3377 | },
|
|---|
| 3378 | useInsertionEffect: noop,
|
|---|
| 3379 | useLayoutEffect: noop,
|
|---|
| 3380 | useCallback: function (callback, deps) {
|
|---|
| 3381 | return useMemo(function () {
|
|---|
| 3382 | return callback;
|
|---|
| 3383 | }, deps);
|
|---|
| 3384 | },
|
|---|
| 3385 | useImperativeHandle: noop,
|
|---|
| 3386 | useEffect: noop,
|
|---|
| 3387 | useDebugValue: noop,
|
|---|
| 3388 | useDeferredValue: function (value, initialValue) {
|
|---|
| 3389 | resolveCurrentlyRenderingComponent();
|
|---|
| 3390 | return void 0 !== initialValue ? initialValue : value;
|
|---|
| 3391 | },
|
|---|
| 3392 | useTransition: function () {
|
|---|
| 3393 | resolveCurrentlyRenderingComponent();
|
|---|
| 3394 | return [!1, unsupportedStartTransition];
|
|---|
| 3395 | },
|
|---|
| 3396 | useId: function () {
|
|---|
| 3397 | var JSCompiler_inline_result = currentlyRenderingTask.treeContext;
|
|---|
| 3398 | var overflow = JSCompiler_inline_result.overflow;
|
|---|
| 3399 | JSCompiler_inline_result = JSCompiler_inline_result.id;
|
|---|
| 3400 | JSCompiler_inline_result =
|
|---|
| 3401 | (
|
|---|
| 3402 | JSCompiler_inline_result &
|
|---|
| 3403 | ~(1 << (32 - clz32(JSCompiler_inline_result) - 1))
|
|---|
| 3404 | ).toString(32) + overflow;
|
|---|
| 3405 | var resumableState = currentResumableState;
|
|---|
| 3406 | if (null === resumableState)
|
|---|
| 3407 | throw Error(
|
|---|
| 3408 | "Invalid hook call. Hooks can only be called inside of the body of a function component."
|
|---|
| 3409 | );
|
|---|
| 3410 | overflow = localIdCounter++;
|
|---|
| 3411 | JSCompiler_inline_result =
|
|---|
| 3412 | "_" + resumableState.idPrefix + "R_" + JSCompiler_inline_result;
|
|---|
| 3413 | 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32));
|
|---|
| 3414 | return JSCompiler_inline_result + "_";
|
|---|
| 3415 | },
|
|---|
| 3416 | useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
|
|---|
| 3417 | if (void 0 === getServerSnapshot)
|
|---|
| 3418 | throw Error(
|
|---|
| 3419 | "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
|
|---|
| 3420 | );
|
|---|
| 3421 | return getServerSnapshot();
|
|---|
| 3422 | },
|
|---|
| 3423 | useOptimistic: function (passthrough) {
|
|---|
| 3424 | resolveCurrentlyRenderingComponent();
|
|---|
| 3425 | return [passthrough, unsupportedSetOptimisticState];
|
|---|
| 3426 | },
|
|---|
| 3427 | useActionState: useActionState,
|
|---|
| 3428 | useFormState: useActionState,
|
|---|
| 3429 | useHostTransitionStatus: function () {
|
|---|
| 3430 | resolveCurrentlyRenderingComponent();
|
|---|
| 3431 | return sharedNotPendingObject;
|
|---|
| 3432 | },
|
|---|
| 3433 | useMemoCache: function (size) {
|
|---|
| 3434 | for (var data = Array(size), i = 0; i < size; i++)
|
|---|
| 3435 | data[i] = REACT_MEMO_CACHE_SENTINEL;
|
|---|
| 3436 | return data;
|
|---|
| 3437 | },
|
|---|
| 3438 | useCacheRefresh: function () {
|
|---|
| 3439 | return unsupportedRefresh;
|
|---|
| 3440 | },
|
|---|
| 3441 | useEffectEvent: function () {
|
|---|
| 3442 | return throwOnUseEffectEventCall;
|
|---|
| 3443 | }
|
|---|
| 3444 | },
|
|---|
| 3445 | currentResumableState = null,
|
|---|
| 3446 | DefaultAsyncDispatcher = {
|
|---|
| 3447 | getCacheForType: function () {
|
|---|
| 3448 | throw Error("Not implemented.");
|
|---|
| 3449 | },
|
|---|
| 3450 | cacheSignal: function () {
|
|---|
| 3451 | throw Error("Not implemented.");
|
|---|
| 3452 | }
|
|---|
| 3453 | },
|
|---|
| 3454 | prefix,
|
|---|
| 3455 | suffix;
|
|---|
| 3456 | function describeBuiltInComponentFrame(name) {
|
|---|
| 3457 | if (void 0 === prefix)
|
|---|
| 3458 | try {
|
|---|
| 3459 | throw Error();
|
|---|
| 3460 | } catch (x) {
|
|---|
| 3461 | var match = x.stack.trim().match(/\n( *(at )?)/);
|
|---|
| 3462 | prefix = (match && match[1]) || "";
|
|---|
| 3463 | suffix =
|
|---|
| 3464 | -1 < x.stack.indexOf("\n at")
|
|---|
| 3465 | ? " (<anonymous>)"
|
|---|
| 3466 | : -1 < x.stack.indexOf("@")
|
|---|
| 3467 | ? "@unknown:0:0"
|
|---|
| 3468 | : "";
|
|---|
| 3469 | }
|
|---|
| 3470 | return "\n" + prefix + name + suffix;
|
|---|
| 3471 | }
|
|---|
| 3472 | var reentry = !1;
|
|---|
| 3473 | function describeNativeComponentFrame(fn, construct) {
|
|---|
| 3474 | if (!fn || reentry) return "";
|
|---|
| 3475 | reentry = !0;
|
|---|
| 3476 | var previousPrepareStackTrace = Error.prepareStackTrace;
|
|---|
| 3477 | Error.prepareStackTrace = void 0;
|
|---|
| 3478 | try {
|
|---|
| 3479 | var RunInRootFrame = {
|
|---|
| 3480 | DetermineComponentFrameRoot: function () {
|
|---|
| 3481 | try {
|
|---|
| 3482 | if (construct) {
|
|---|
| 3483 | var Fake = function () {
|
|---|
| 3484 | throw Error();
|
|---|
| 3485 | };
|
|---|
| 3486 | Object.defineProperty(Fake.prototype, "props", {
|
|---|
| 3487 | set: function () {
|
|---|
| 3488 | throw Error();
|
|---|
| 3489 | }
|
|---|
| 3490 | });
|
|---|
| 3491 | if ("object" === typeof Reflect && Reflect.construct) {
|
|---|
| 3492 | try {
|
|---|
| 3493 | Reflect.construct(Fake, []);
|
|---|
| 3494 | } catch (x) {
|
|---|
| 3495 | var control = x;
|
|---|
| 3496 | }
|
|---|
| 3497 | Reflect.construct(fn, [], Fake);
|
|---|
| 3498 | } else {
|
|---|
| 3499 | try {
|
|---|
| 3500 | Fake.call();
|
|---|
| 3501 | } catch (x$24) {
|
|---|
| 3502 | control = x$24;
|
|---|
| 3503 | }
|
|---|
| 3504 | fn.call(Fake.prototype);
|
|---|
| 3505 | }
|
|---|
| 3506 | } else {
|
|---|
| 3507 | try {
|
|---|
| 3508 | throw Error();
|
|---|
| 3509 | } catch (x$25) {
|
|---|
| 3510 | control = x$25;
|
|---|
| 3511 | }
|
|---|
| 3512 | (Fake = fn()) &&
|
|---|
| 3513 | "function" === typeof Fake.catch &&
|
|---|
| 3514 | Fake.catch(function () {});
|
|---|
| 3515 | }
|
|---|
| 3516 | } catch (sample) {
|
|---|
| 3517 | if (sample && control && "string" === typeof sample.stack)
|
|---|
| 3518 | return [sample.stack, control.stack];
|
|---|
| 3519 | }
|
|---|
| 3520 | return [null, null];
|
|---|
| 3521 | }
|
|---|
| 3522 | };
|
|---|
| 3523 | RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
|---|
| 3524 | "DetermineComponentFrameRoot";
|
|---|
| 3525 | var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|---|
| 3526 | RunInRootFrame.DetermineComponentFrameRoot,
|
|---|
| 3527 | "name"
|
|---|
| 3528 | );
|
|---|
| 3529 | namePropDescriptor &&
|
|---|
| 3530 | namePropDescriptor.configurable &&
|
|---|
| 3531 | Object.defineProperty(
|
|---|
| 3532 | RunInRootFrame.DetermineComponentFrameRoot,
|
|---|
| 3533 | "name",
|
|---|
| 3534 | { value: "DetermineComponentFrameRoot" }
|
|---|
| 3535 | );
|
|---|
| 3536 | var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
|
|---|
| 3537 | sampleStack = _RunInRootFrame$Deter[0],
|
|---|
| 3538 | controlStack = _RunInRootFrame$Deter[1];
|
|---|
| 3539 | if (sampleStack && controlStack) {
|
|---|
| 3540 | var sampleLines = sampleStack.split("\n"),
|
|---|
| 3541 | controlLines = controlStack.split("\n");
|
|---|
| 3542 | for (
|
|---|
| 3543 | namePropDescriptor = RunInRootFrame = 0;
|
|---|
| 3544 | RunInRootFrame < sampleLines.length &&
|
|---|
| 3545 | !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot");
|
|---|
| 3546 |
|
|---|
| 3547 | )
|
|---|
| 3548 | RunInRootFrame++;
|
|---|
| 3549 | for (
|
|---|
| 3550 | ;
|
|---|
| 3551 | namePropDescriptor < controlLines.length &&
|
|---|
| 3552 | !controlLines[namePropDescriptor].includes(
|
|---|
| 3553 | "DetermineComponentFrameRoot"
|
|---|
| 3554 | );
|
|---|
| 3555 |
|
|---|
| 3556 | )
|
|---|
| 3557 | namePropDescriptor++;
|
|---|
| 3558 | if (
|
|---|
| 3559 | RunInRootFrame === sampleLines.length ||
|
|---|
| 3560 | namePropDescriptor === controlLines.length
|
|---|
| 3561 | )
|
|---|
| 3562 | for (
|
|---|
| 3563 | RunInRootFrame = sampleLines.length - 1,
|
|---|
| 3564 | namePropDescriptor = controlLines.length - 1;
|
|---|
| 3565 | 1 <= RunInRootFrame &&
|
|---|
| 3566 | 0 <= namePropDescriptor &&
|
|---|
| 3567 | sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];
|
|---|
| 3568 |
|
|---|
| 3569 | )
|
|---|
| 3570 | namePropDescriptor--;
|
|---|
| 3571 | for (
|
|---|
| 3572 | ;
|
|---|
| 3573 | 1 <= RunInRootFrame && 0 <= namePropDescriptor;
|
|---|
| 3574 | RunInRootFrame--, namePropDescriptor--
|
|---|
| 3575 | )
|
|---|
| 3576 | if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
|
|---|
| 3577 | if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
|
|---|
| 3578 | do
|
|---|
| 3579 | if (
|
|---|
| 3580 | (RunInRootFrame--,
|
|---|
| 3581 | namePropDescriptor--,
|
|---|
| 3582 | 0 > namePropDescriptor ||
|
|---|
| 3583 | sampleLines[RunInRootFrame] !==
|
|---|
| 3584 | controlLines[namePropDescriptor])
|
|---|
| 3585 | ) {
|
|---|
| 3586 | var frame =
|
|---|
| 3587 | "\n" +
|
|---|
| 3588 | sampleLines[RunInRootFrame].replace(" at new ", " at ");
|
|---|
| 3589 | fn.displayName &&
|
|---|
| 3590 | frame.includes("<anonymous>") &&
|
|---|
| 3591 | (frame = frame.replace("<anonymous>", fn.displayName));
|
|---|
| 3592 | return frame;
|
|---|
| 3593 | }
|
|---|
| 3594 | while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
|
|---|
| 3595 | }
|
|---|
| 3596 | break;
|
|---|
| 3597 | }
|
|---|
| 3598 | }
|
|---|
| 3599 | } finally {
|
|---|
| 3600 | (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace);
|
|---|
| 3601 | }
|
|---|
| 3602 | return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "")
|
|---|
| 3603 | ? describeBuiltInComponentFrame(previousPrepareStackTrace)
|
|---|
| 3604 | : "";
|
|---|
| 3605 | }
|
|---|
| 3606 | function describeComponentStackByType(type) {
|
|---|
| 3607 | if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
|---|
| 3608 | if ("function" === typeof type)
|
|---|
| 3609 | return type.prototype && type.prototype.isReactComponent
|
|---|
| 3610 | ? describeNativeComponentFrame(type, !0)
|
|---|
| 3611 | : describeNativeComponentFrame(type, !1);
|
|---|
| 3612 | if ("object" === typeof type && null !== type) {
|
|---|
| 3613 | switch (type.$$typeof) {
|
|---|
| 3614 | case REACT_FORWARD_REF_TYPE:
|
|---|
| 3615 | return describeNativeComponentFrame(type.render, !1);
|
|---|
| 3616 | case REACT_MEMO_TYPE:
|
|---|
| 3617 | return describeNativeComponentFrame(type.type, !1);
|
|---|
| 3618 | case REACT_LAZY_TYPE:
|
|---|
| 3619 | var lazyComponent = type,
|
|---|
| 3620 | payload = lazyComponent._payload;
|
|---|
| 3621 | lazyComponent = lazyComponent._init;
|
|---|
| 3622 | try {
|
|---|
| 3623 | type = lazyComponent(payload);
|
|---|
| 3624 | } catch (x) {
|
|---|
| 3625 | return describeBuiltInComponentFrame("Lazy");
|
|---|
| 3626 | }
|
|---|
| 3627 | return describeComponentStackByType(type);
|
|---|
| 3628 | }
|
|---|
| 3629 | if ("string" === typeof type.name) {
|
|---|
| 3630 | a: {
|
|---|
| 3631 | payload = type.name;
|
|---|
| 3632 | lazyComponent = type.env;
|
|---|
| 3633 | var location = type.debugLocation;
|
|---|
| 3634 | if (
|
|---|
| 3635 | null != location &&
|
|---|
| 3636 | ((type = Error.prepareStackTrace),
|
|---|
| 3637 | (Error.prepareStackTrace = void 0),
|
|---|
| 3638 | (location = location.stack),
|
|---|
| 3639 | (Error.prepareStackTrace = type),
|
|---|
| 3640 | location.startsWith("Error: react-stack-top-frame\n") &&
|
|---|
| 3641 | (location = location.slice(29)),
|
|---|
| 3642 | (type = location.indexOf("\n")),
|
|---|
| 3643 | -1 !== type && (location = location.slice(type + 1)),
|
|---|
| 3644 | (type = location.indexOf("react_stack_bottom_frame")),
|
|---|
| 3645 | -1 !== type && (type = location.lastIndexOf("\n", type)),
|
|---|
| 3646 | (type = -1 !== type ? (location = location.slice(0, type)) : ""),
|
|---|
| 3647 | (location = type.lastIndexOf("\n")),
|
|---|
| 3648 | (type = -1 === location ? type : type.slice(location + 1)),
|
|---|
| 3649 | -1 !== type.indexOf(payload))
|
|---|
| 3650 | ) {
|
|---|
| 3651 | payload = "\n" + type;
|
|---|
| 3652 | break a;
|
|---|
| 3653 | }
|
|---|
| 3654 | payload = describeBuiltInComponentFrame(
|
|---|
| 3655 | payload + (lazyComponent ? " [" + lazyComponent + "]" : "")
|
|---|
| 3656 | );
|
|---|
| 3657 | }
|
|---|
| 3658 | return payload;
|
|---|
| 3659 | }
|
|---|
| 3660 | }
|
|---|
| 3661 | switch (type) {
|
|---|
| 3662 | case REACT_SUSPENSE_LIST_TYPE:
|
|---|
| 3663 | return describeBuiltInComponentFrame("SuspenseList");
|
|---|
| 3664 | case REACT_SUSPENSE_TYPE:
|
|---|
| 3665 | return describeBuiltInComponentFrame("Suspense");
|
|---|
| 3666 | }
|
|---|
| 3667 | return "";
|
|---|
| 3668 | }
|
|---|
| 3669 | function isEligibleForOutlining(request, boundary) {
|
|---|
| 3670 | return (
|
|---|
| 3671 | (500 < boundary.byteSize || hasSuspenseyContent(boundary.contentState)) &&
|
|---|
| 3672 | null === boundary.contentPreamble
|
|---|
| 3673 | );
|
|---|
| 3674 | }
|
|---|
| 3675 | function defaultErrorHandler(error) {
|
|---|
| 3676 | if (
|
|---|
| 3677 | "object" === typeof error &&
|
|---|
| 3678 | null !== error &&
|
|---|
| 3679 | "string" === typeof error.environmentName
|
|---|
| 3680 | ) {
|
|---|
| 3681 | var JSCompiler_inline_result = error.environmentName;
|
|---|
| 3682 | error = [error].slice(0);
|
|---|
| 3683 | "string" === typeof error[0]
|
|---|
| 3684 | ? error.splice(
|
|---|
| 3685 | 0,
|
|---|
| 3686 | 1,
|
|---|
| 3687 | "%c%s%c " + error[0],
|
|---|
| 3688 | "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",
|
|---|
| 3689 | " " + JSCompiler_inline_result + " ",
|
|---|
| 3690 | ""
|
|---|
| 3691 | )
|
|---|
| 3692 | : error.splice(
|
|---|
| 3693 | 0,
|
|---|
| 3694 | 0,
|
|---|
| 3695 | "%c%s%c",
|
|---|
| 3696 | "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",
|
|---|
| 3697 | " " + JSCompiler_inline_result + " ",
|
|---|
| 3698 | ""
|
|---|
| 3699 | );
|
|---|
| 3700 | error.unshift(console);
|
|---|
| 3701 | JSCompiler_inline_result = bind.apply(console.error, error);
|
|---|
| 3702 | JSCompiler_inline_result();
|
|---|
| 3703 | } else console.error(error);
|
|---|
| 3704 | return null;
|
|---|
| 3705 | }
|
|---|
| 3706 | function RequestInstance(
|
|---|
| 3707 | resumableState,
|
|---|
| 3708 | renderState,
|
|---|
| 3709 | rootFormatContext,
|
|---|
| 3710 | progressiveChunkSize,
|
|---|
| 3711 | onError,
|
|---|
| 3712 | onAllReady,
|
|---|
| 3713 | onShellReady,
|
|---|
| 3714 | onShellError,
|
|---|
| 3715 | onFatalError,
|
|---|
| 3716 | onPostpone,
|
|---|
| 3717 | formState
|
|---|
| 3718 | ) {
|
|---|
| 3719 | var abortSet = new Set();
|
|---|
| 3720 | this.destination = null;
|
|---|
| 3721 | this.flushScheduled = !1;
|
|---|
| 3722 | this.resumableState = resumableState;
|
|---|
| 3723 | this.renderState = renderState;
|
|---|
| 3724 | this.rootFormatContext = rootFormatContext;
|
|---|
| 3725 | this.progressiveChunkSize =
|
|---|
| 3726 | void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize;
|
|---|
| 3727 | this.status = 10;
|
|---|
| 3728 | this.fatalError = null;
|
|---|
| 3729 | this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
|
|---|
| 3730 | this.completedPreambleSegments = this.completedRootSegment = null;
|
|---|
| 3731 | this.byteSize = 0;
|
|---|
| 3732 | this.abortableTasks = abortSet;
|
|---|
| 3733 | this.pingedTasks = [];
|
|---|
| 3734 | this.clientRenderedBoundaries = [];
|
|---|
| 3735 | this.completedBoundaries = [];
|
|---|
| 3736 | this.partialBoundaries = [];
|
|---|
| 3737 | this.trackedPostpones = null;
|
|---|
| 3738 | this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
|---|
| 3739 | this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
|
|---|
| 3740 | this.onAllReady = void 0 === onAllReady ? noop : onAllReady;
|
|---|
| 3741 | this.onShellReady = void 0 === onShellReady ? noop : onShellReady;
|
|---|
| 3742 | this.onShellError = void 0 === onShellError ? noop : onShellError;
|
|---|
| 3743 | this.onFatalError = void 0 === onFatalError ? noop : onFatalError;
|
|---|
| 3744 | this.formState = void 0 === formState ? null : formState;
|
|---|
| 3745 | }
|
|---|
| 3746 | function createRequest(
|
|---|
| 3747 | children,
|
|---|
| 3748 | resumableState,
|
|---|
| 3749 | renderState,
|
|---|
| 3750 | rootFormatContext,
|
|---|
| 3751 | progressiveChunkSize,
|
|---|
| 3752 | onError,
|
|---|
| 3753 | onAllReady,
|
|---|
| 3754 | onShellReady,
|
|---|
| 3755 | onShellError,
|
|---|
| 3756 | onFatalError,
|
|---|
| 3757 | onPostpone,
|
|---|
| 3758 | formState
|
|---|
| 3759 | ) {
|
|---|
| 3760 | resumableState = new RequestInstance(
|
|---|
| 3761 | resumableState,
|
|---|
| 3762 | renderState,
|
|---|
| 3763 | rootFormatContext,
|
|---|
| 3764 | progressiveChunkSize,
|
|---|
| 3765 | onError,
|
|---|
| 3766 | onAllReady,
|
|---|
| 3767 | onShellReady,
|
|---|
| 3768 | onShellError,
|
|---|
| 3769 | onFatalError,
|
|---|
| 3770 | onPostpone,
|
|---|
| 3771 | formState
|
|---|
| 3772 | );
|
|---|
| 3773 | renderState = createPendingSegment(
|
|---|
| 3774 | resumableState,
|
|---|
| 3775 | 0,
|
|---|
| 3776 | null,
|
|---|
| 3777 | rootFormatContext,
|
|---|
| 3778 | !1,
|
|---|
| 3779 | !1
|
|---|
| 3780 | );
|
|---|
| 3781 | renderState.parentFlushed = !0;
|
|---|
| 3782 | children = createRenderTask(
|
|---|
| 3783 | resumableState,
|
|---|
| 3784 | null,
|
|---|
| 3785 | children,
|
|---|
| 3786 | -1,
|
|---|
| 3787 | null,
|
|---|
| 3788 | renderState,
|
|---|
| 3789 | null,
|
|---|
| 3790 | null,
|
|---|
| 3791 | resumableState.abortableTasks,
|
|---|
| 3792 | null,
|
|---|
| 3793 | rootFormatContext,
|
|---|
| 3794 | null,
|
|---|
| 3795 | emptyTreeContext,
|
|---|
| 3796 | null,
|
|---|
| 3797 | null
|
|---|
| 3798 | );
|
|---|
| 3799 | pushComponentStack(children);
|
|---|
| 3800 | resumableState.pingedTasks.push(children);
|
|---|
| 3801 | return resumableState;
|
|---|
| 3802 | }
|
|---|
| 3803 | var currentRequest = null;
|
|---|
| 3804 | function pingTask(request, task) {
|
|---|
| 3805 | request.pingedTasks.push(task);
|
|---|
| 3806 | 1 === request.pingedTasks.length &&
|
|---|
| 3807 | ((request.flushScheduled = null !== request.destination),
|
|---|
| 3808 | null !== request.trackedPostpones || 10 === request.status
|
|---|
| 3809 | ? scheduleMicrotask(function () {
|
|---|
| 3810 | return performWork(request);
|
|---|
| 3811 | })
|
|---|
| 3812 | : setTimeout(function () {
|
|---|
| 3813 | return performWork(request);
|
|---|
| 3814 | }, 0));
|
|---|
| 3815 | }
|
|---|
| 3816 | function createSuspenseBoundary(
|
|---|
| 3817 | request,
|
|---|
| 3818 | row,
|
|---|
| 3819 | fallbackAbortableTasks,
|
|---|
| 3820 | contentPreamble,
|
|---|
| 3821 | fallbackPreamble
|
|---|
| 3822 | ) {
|
|---|
| 3823 | fallbackAbortableTasks = {
|
|---|
| 3824 | status: 0,
|
|---|
| 3825 | rootSegmentID: -1,
|
|---|
| 3826 | parentFlushed: !1,
|
|---|
| 3827 | pendingTasks: 0,
|
|---|
| 3828 | row: row,
|
|---|
| 3829 | completedSegments: [],
|
|---|
| 3830 | byteSize: 0,
|
|---|
| 3831 | fallbackAbortableTasks: fallbackAbortableTasks,
|
|---|
| 3832 | errorDigest: null,
|
|---|
| 3833 | contentState: createHoistableState(),
|
|---|
| 3834 | fallbackState: createHoistableState(),
|
|---|
| 3835 | contentPreamble: contentPreamble,
|
|---|
| 3836 | fallbackPreamble: fallbackPreamble,
|
|---|
| 3837 | trackedContentKeyPath: null,
|
|---|
| 3838 | trackedFallbackNode: null
|
|---|
| 3839 | };
|
|---|
| 3840 | null !== row &&
|
|---|
| 3841 | (row.pendingTasks++,
|
|---|
| 3842 | (contentPreamble = row.boundaries),
|
|---|
| 3843 | null !== contentPreamble &&
|
|---|
| 3844 | (request.allPendingTasks++,
|
|---|
| 3845 | fallbackAbortableTasks.pendingTasks++,
|
|---|
| 3846 | contentPreamble.push(fallbackAbortableTasks)),
|
|---|
| 3847 | (request = row.inheritedHoistables),
|
|---|
| 3848 | null !== request &&
|
|---|
| 3849 | hoistHoistables(fallbackAbortableTasks.contentState, request));
|
|---|
| 3850 | return fallbackAbortableTasks;
|
|---|
| 3851 | }
|
|---|
| 3852 | function createRenderTask(
|
|---|
| 3853 | request,
|
|---|
| 3854 | thenableState,
|
|---|
| 3855 | node,
|
|---|
| 3856 | childIndex,
|
|---|
| 3857 | blockedBoundary,
|
|---|
| 3858 | blockedSegment,
|
|---|
| 3859 | blockedPreamble,
|
|---|
| 3860 | hoistableState,
|
|---|
| 3861 | abortSet,
|
|---|
| 3862 | keyPath,
|
|---|
| 3863 | formatContext,
|
|---|
| 3864 | context,
|
|---|
| 3865 | treeContext,
|
|---|
| 3866 | row,
|
|---|
| 3867 | componentStack
|
|---|
| 3868 | ) {
|
|---|
| 3869 | request.allPendingTasks++;
|
|---|
| 3870 | null === blockedBoundary
|
|---|
| 3871 | ? request.pendingRootTasks++
|
|---|
| 3872 | : blockedBoundary.pendingTasks++;
|
|---|
| 3873 | null !== row && row.pendingTasks++;
|
|---|
| 3874 | var task = {
|
|---|
| 3875 | replay: null,
|
|---|
| 3876 | node: node,
|
|---|
| 3877 | childIndex: childIndex,
|
|---|
| 3878 | ping: function () {
|
|---|
| 3879 | return pingTask(request, task);
|
|---|
| 3880 | },
|
|---|
| 3881 | blockedBoundary: blockedBoundary,
|
|---|
| 3882 | blockedSegment: blockedSegment,
|
|---|
| 3883 | blockedPreamble: blockedPreamble,
|
|---|
| 3884 | hoistableState: hoistableState,
|
|---|
| 3885 | abortSet: abortSet,
|
|---|
| 3886 | keyPath: keyPath,
|
|---|
| 3887 | formatContext: formatContext,
|
|---|
| 3888 | context: context,
|
|---|
| 3889 | treeContext: treeContext,
|
|---|
| 3890 | row: row,
|
|---|
| 3891 | componentStack: componentStack,
|
|---|
| 3892 | thenableState: thenableState
|
|---|
| 3893 | };
|
|---|
| 3894 | abortSet.add(task);
|
|---|
| 3895 | return task;
|
|---|
| 3896 | }
|
|---|
| 3897 | function createReplayTask(
|
|---|
| 3898 | request,
|
|---|
| 3899 | thenableState,
|
|---|
| 3900 | replay,
|
|---|
| 3901 | node,
|
|---|
| 3902 | childIndex,
|
|---|
| 3903 | blockedBoundary,
|
|---|
| 3904 | hoistableState,
|
|---|
| 3905 | abortSet,
|
|---|
| 3906 | keyPath,
|
|---|
| 3907 | formatContext,
|
|---|
| 3908 | context,
|
|---|
| 3909 | treeContext,
|
|---|
| 3910 | row,
|
|---|
| 3911 | componentStack
|
|---|
| 3912 | ) {
|
|---|
| 3913 | request.allPendingTasks++;
|
|---|
| 3914 | null === blockedBoundary
|
|---|
| 3915 | ? request.pendingRootTasks++
|
|---|
| 3916 | : blockedBoundary.pendingTasks++;
|
|---|
| 3917 | null !== row && row.pendingTasks++;
|
|---|
| 3918 | replay.pendingTasks++;
|
|---|
| 3919 | var task = {
|
|---|
| 3920 | replay: replay,
|
|---|
| 3921 | node: node,
|
|---|
| 3922 | childIndex: childIndex,
|
|---|
| 3923 | ping: function () {
|
|---|
| 3924 | return pingTask(request, task);
|
|---|
| 3925 | },
|
|---|
| 3926 | blockedBoundary: blockedBoundary,
|
|---|
| 3927 | blockedSegment: null,
|
|---|
| 3928 | blockedPreamble: null,
|
|---|
| 3929 | hoistableState: hoistableState,
|
|---|
| 3930 | abortSet: abortSet,
|
|---|
| 3931 | keyPath: keyPath,
|
|---|
| 3932 | formatContext: formatContext,
|
|---|
| 3933 | context: context,
|
|---|
| 3934 | treeContext: treeContext,
|
|---|
| 3935 | row: row,
|
|---|
| 3936 | componentStack: componentStack,
|
|---|
| 3937 | thenableState: thenableState
|
|---|
| 3938 | };
|
|---|
| 3939 | abortSet.add(task);
|
|---|
| 3940 | return task;
|
|---|
| 3941 | }
|
|---|
| 3942 | function createPendingSegment(
|
|---|
| 3943 | request,
|
|---|
| 3944 | index,
|
|---|
| 3945 | boundary,
|
|---|
| 3946 | parentFormatContext,
|
|---|
| 3947 | lastPushedText,
|
|---|
| 3948 | textEmbedded
|
|---|
| 3949 | ) {
|
|---|
| 3950 | return {
|
|---|
| 3951 | status: 0,
|
|---|
| 3952 | parentFlushed: !1,
|
|---|
| 3953 | id: -1,
|
|---|
| 3954 | index: index,
|
|---|
| 3955 | chunks: [],
|
|---|
| 3956 | children: [],
|
|---|
| 3957 | preambleChildren: [],
|
|---|
| 3958 | parentFormatContext: parentFormatContext,
|
|---|
| 3959 | boundary: boundary,
|
|---|
| 3960 | lastPushedText: lastPushedText,
|
|---|
| 3961 | textEmbedded: textEmbedded
|
|---|
| 3962 | };
|
|---|
| 3963 | }
|
|---|
| 3964 | function pushComponentStack(task) {
|
|---|
| 3965 | var node = task.node;
|
|---|
| 3966 | if ("object" === typeof node && null !== node)
|
|---|
| 3967 | switch (node.$$typeof) {
|
|---|
| 3968 | case REACT_ELEMENT_TYPE:
|
|---|
| 3969 | task.componentStack = { parent: task.componentStack, type: node.type };
|
|---|
| 3970 | }
|
|---|
| 3971 | }
|
|---|
| 3972 | function replaceSuspenseComponentStackWithSuspenseFallbackStack(
|
|---|
| 3973 | componentStack
|
|---|
| 3974 | ) {
|
|---|
| 3975 | return null === componentStack
|
|---|
| 3976 | ? null
|
|---|
| 3977 | : { parent: componentStack.parent, type: "Suspense Fallback" };
|
|---|
| 3978 | }
|
|---|
| 3979 | function getThrownInfo(node$jscomp$0) {
|
|---|
| 3980 | var errorInfo = {};
|
|---|
| 3981 | node$jscomp$0 &&
|
|---|
| 3982 | Object.defineProperty(errorInfo, "componentStack", {
|
|---|
| 3983 | configurable: !0,
|
|---|
| 3984 | enumerable: !0,
|
|---|
| 3985 | get: function () {
|
|---|
| 3986 | try {
|
|---|
| 3987 | var info = "",
|
|---|
| 3988 | node = node$jscomp$0;
|
|---|
| 3989 | do
|
|---|
| 3990 | (info += describeComponentStackByType(node.type)),
|
|---|
| 3991 | (node = node.parent);
|
|---|
| 3992 | while (node);
|
|---|
| 3993 | var JSCompiler_inline_result = info;
|
|---|
| 3994 | } catch (x) {
|
|---|
| 3995 | JSCompiler_inline_result =
|
|---|
| 3996 | "\nError generating stack: " + x.message + "\n" + x.stack;
|
|---|
| 3997 | }
|
|---|
| 3998 | Object.defineProperty(errorInfo, "componentStack", {
|
|---|
| 3999 | value: JSCompiler_inline_result
|
|---|
| 4000 | });
|
|---|
| 4001 | return JSCompiler_inline_result;
|
|---|
| 4002 | }
|
|---|
| 4003 | });
|
|---|
| 4004 | return errorInfo;
|
|---|
| 4005 | }
|
|---|
| 4006 | function logRecoverableError(request, error, errorInfo) {
|
|---|
| 4007 | request = request.onError;
|
|---|
| 4008 | error = request(error, errorInfo);
|
|---|
| 4009 | if (null == error || "string" === typeof error) return error;
|
|---|
| 4010 | }
|
|---|
| 4011 | function fatalError(request, error) {
|
|---|
| 4012 | var onShellError = request.onShellError,
|
|---|
| 4013 | onFatalError = request.onFatalError;
|
|---|
| 4014 | onShellError(error);
|
|---|
| 4015 | onFatalError(error);
|
|---|
| 4016 | null !== request.destination
|
|---|
| 4017 | ? ((request.status = 14), closeWithError(request.destination, error))
|
|---|
| 4018 | : ((request.status = 13), (request.fatalError = error));
|
|---|
| 4019 | }
|
|---|
| 4020 | function finishSuspenseListRow(request, row) {
|
|---|
| 4021 | unblockSuspenseListRow(request, row.next, row.hoistables);
|
|---|
| 4022 | }
|
|---|
| 4023 | function unblockSuspenseListRow(request, unblockedRow, inheritedHoistables) {
|
|---|
| 4024 | for (; null !== unblockedRow; ) {
|
|---|
| 4025 | null !== inheritedHoistables &&
|
|---|
| 4026 | (hoistHoistables(unblockedRow.hoistables, inheritedHoistables),
|
|---|
| 4027 | (unblockedRow.inheritedHoistables = inheritedHoistables));
|
|---|
| 4028 | var unblockedBoundaries = unblockedRow.boundaries;
|
|---|
| 4029 | if (null !== unblockedBoundaries) {
|
|---|
| 4030 | unblockedRow.boundaries = null;
|
|---|
| 4031 | for (var i = 0; i < unblockedBoundaries.length; i++) {
|
|---|
| 4032 | var unblockedBoundary = unblockedBoundaries[i];
|
|---|
| 4033 | null !== inheritedHoistables &&
|
|---|
| 4034 | hoistHoistables(unblockedBoundary.contentState, inheritedHoistables);
|
|---|
| 4035 | finishedTask(request, unblockedBoundary, null, null);
|
|---|
| 4036 | }
|
|---|
| 4037 | }
|
|---|
| 4038 | unblockedRow.pendingTasks--;
|
|---|
| 4039 | if (0 < unblockedRow.pendingTasks) break;
|
|---|
| 4040 | inheritedHoistables = unblockedRow.hoistables;
|
|---|
| 4041 | unblockedRow = unblockedRow.next;
|
|---|
| 4042 | }
|
|---|
| 4043 | }
|
|---|
| 4044 | function tryToResolveTogetherRow(request, togetherRow) {
|
|---|
| 4045 | var boundaries = togetherRow.boundaries;
|
|---|
| 4046 | if (null !== boundaries && togetherRow.pendingTasks === boundaries.length) {
|
|---|
| 4047 | for (var allCompleteAndInlinable = !0, i = 0; i < boundaries.length; i++) {
|
|---|
| 4048 | var rowBoundary = boundaries[i];
|
|---|
| 4049 | if (
|
|---|
| 4050 | 1 !== rowBoundary.pendingTasks ||
|
|---|
| 4051 | rowBoundary.parentFlushed ||
|
|---|
| 4052 | isEligibleForOutlining(request, rowBoundary)
|
|---|
| 4053 | ) {
|
|---|
| 4054 | allCompleteAndInlinable = !1;
|
|---|
| 4055 | break;
|
|---|
| 4056 | }
|
|---|
| 4057 | }
|
|---|
| 4058 | allCompleteAndInlinable &&
|
|---|
| 4059 | unblockSuspenseListRow(request, togetherRow, togetherRow.hoistables);
|
|---|
| 4060 | }
|
|---|
| 4061 | }
|
|---|
| 4062 | function createSuspenseListRow(previousRow) {
|
|---|
| 4063 | var newRow = {
|
|---|
| 4064 | pendingTasks: 1,
|
|---|
| 4065 | boundaries: null,
|
|---|
| 4066 | hoistables: createHoistableState(),
|
|---|
| 4067 | inheritedHoistables: null,
|
|---|
| 4068 | together: !1,
|
|---|
| 4069 | next: null
|
|---|
| 4070 | };
|
|---|
| 4071 | null !== previousRow &&
|
|---|
| 4072 | 0 < previousRow.pendingTasks &&
|
|---|
| 4073 | (newRow.pendingTasks++,
|
|---|
| 4074 | (newRow.boundaries = []),
|
|---|
| 4075 | (previousRow.next = newRow));
|
|---|
| 4076 | return newRow;
|
|---|
| 4077 | }
|
|---|
| 4078 | function renderSuspenseListRows(request, task, keyPath, rows, revealOrder) {
|
|---|
| 4079 | var prevKeyPath = task.keyPath,
|
|---|
| 4080 | prevTreeContext = task.treeContext,
|
|---|
| 4081 | prevRow = task.row;
|
|---|
| 4082 | task.keyPath = keyPath;
|
|---|
| 4083 | keyPath = rows.length;
|
|---|
| 4084 | var previousSuspenseListRow = null;
|
|---|
| 4085 | if (null !== task.replay) {
|
|---|
| 4086 | var resumeSlots = task.replay.slots;
|
|---|
| 4087 | if (null !== resumeSlots && "object" === typeof resumeSlots)
|
|---|
| 4088 | for (var n = 0; n < keyPath; n++) {
|
|---|
| 4089 | var i =
|
|---|
| 4090 | "backwards" !== revealOrder &&
|
|---|
| 4091 | "unstable_legacy-backwards" !== revealOrder
|
|---|
| 4092 | ? n
|
|---|
| 4093 | : keyPath - 1 - n,
|
|---|
| 4094 | node = rows[i];
|
|---|
| 4095 | task.row = previousSuspenseListRow = createSuspenseListRow(
|
|---|
| 4096 | previousSuspenseListRow
|
|---|
| 4097 | );
|
|---|
| 4098 | task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
|
|---|
| 4099 | var resumeSegmentID = resumeSlots[i];
|
|---|
| 4100 | "number" === typeof resumeSegmentID
|
|---|
| 4101 | ? (resumeNode(request, task, resumeSegmentID, node, i),
|
|---|
| 4102 | delete resumeSlots[i])
|
|---|
| 4103 | : renderNode(request, task, node, i);
|
|---|
| 4104 | 0 === --previousSuspenseListRow.pendingTasks &&
|
|---|
| 4105 | finishSuspenseListRow(request, previousSuspenseListRow);
|
|---|
| 4106 | }
|
|---|
| 4107 | else
|
|---|
| 4108 | for (resumeSlots = 0; resumeSlots < keyPath; resumeSlots++)
|
|---|
| 4109 | (n =
|
|---|
| 4110 | "backwards" !== revealOrder &&
|
|---|
| 4111 | "unstable_legacy-backwards" !== revealOrder
|
|---|
| 4112 | ? resumeSlots
|
|---|
| 4113 | : keyPath - 1 - resumeSlots),
|
|---|
| 4114 | (i = rows[n]),
|
|---|
| 4115 | (task.row = previousSuspenseListRow =
|
|---|
| 4116 | createSuspenseListRow(previousSuspenseListRow)),
|
|---|
| 4117 | (task.treeContext = pushTreeContext(prevTreeContext, keyPath, n)),
|
|---|
| 4118 | renderNode(request, task, i, n),
|
|---|
| 4119 | 0 === --previousSuspenseListRow.pendingTasks &&
|
|---|
| 4120 | finishSuspenseListRow(request, previousSuspenseListRow);
|
|---|
| 4121 | } else if (
|
|---|
| 4122 | "backwards" !== revealOrder &&
|
|---|
| 4123 | "unstable_legacy-backwards" !== revealOrder
|
|---|
| 4124 | )
|
|---|
| 4125 | for (revealOrder = 0; revealOrder < keyPath; revealOrder++)
|
|---|
| 4126 | (resumeSlots = rows[revealOrder]),
|
|---|
| 4127 | (task.row = previousSuspenseListRow =
|
|---|
| 4128 | createSuspenseListRow(previousSuspenseListRow)),
|
|---|
| 4129 | (task.treeContext = pushTreeContext(
|
|---|
| 4130 | prevTreeContext,
|
|---|
| 4131 | keyPath,
|
|---|
| 4132 | revealOrder
|
|---|
| 4133 | )),
|
|---|
| 4134 | renderNode(request, task, resumeSlots, revealOrder),
|
|---|
| 4135 | 0 === --previousSuspenseListRow.pendingTasks &&
|
|---|
| 4136 | finishSuspenseListRow(request, previousSuspenseListRow);
|
|---|
| 4137 | else {
|
|---|
| 4138 | revealOrder = task.blockedSegment;
|
|---|
| 4139 | resumeSlots = revealOrder.children.length;
|
|---|
| 4140 | n = revealOrder.chunks.length;
|
|---|
| 4141 | for (i = keyPath - 1; 0 <= i; i--) {
|
|---|
| 4142 | node = rows[i];
|
|---|
| 4143 | task.row = previousSuspenseListRow = createSuspenseListRow(
|
|---|
| 4144 | previousSuspenseListRow
|
|---|
| 4145 | );
|
|---|
| 4146 | task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);
|
|---|
| 4147 | resumeSegmentID = createPendingSegment(
|
|---|
| 4148 | request,
|
|---|
| 4149 | n,
|
|---|
| 4150 | null,
|
|---|
| 4151 | task.formatContext,
|
|---|
| 4152 | 0 === i ? revealOrder.lastPushedText : !0,
|
|---|
| 4153 | !0
|
|---|
| 4154 | );
|
|---|
| 4155 | revealOrder.children.splice(resumeSlots, 0, resumeSegmentID);
|
|---|
| 4156 | task.blockedSegment = resumeSegmentID;
|
|---|
| 4157 | try {
|
|---|
| 4158 | renderNode(request, task, node, i),
|
|---|
| 4159 | pushSegmentFinale(
|
|---|
| 4160 | resumeSegmentID.chunks,
|
|---|
| 4161 | request.renderState,
|
|---|
| 4162 | resumeSegmentID.lastPushedText,
|
|---|
| 4163 | resumeSegmentID.textEmbedded
|
|---|
| 4164 | ),
|
|---|
| 4165 | (resumeSegmentID.status = 1),
|
|---|
| 4166 | finishedSegment(request, task.blockedBoundary, resumeSegmentID),
|
|---|
| 4167 | 0 === --previousSuspenseListRow.pendingTasks &&
|
|---|
| 4168 | finishSuspenseListRow(request, previousSuspenseListRow);
|
|---|
| 4169 | } catch (thrownValue) {
|
|---|
| 4170 | throw (
|
|---|
| 4171 | ((resumeSegmentID.status = 12 === request.status ? 3 : 4),
|
|---|
| 4172 | thrownValue)
|
|---|
| 4173 | );
|
|---|
| 4174 | }
|
|---|
| 4175 | }
|
|---|
| 4176 | task.blockedSegment = revealOrder;
|
|---|
| 4177 | revealOrder.lastPushedText = !1;
|
|---|
| 4178 | }
|
|---|
| 4179 | null !== prevRow &&
|
|---|
| 4180 | null !== previousSuspenseListRow &&
|
|---|
| 4181 | 0 < previousSuspenseListRow.pendingTasks &&
|
|---|
| 4182 | (prevRow.pendingTasks++, (previousSuspenseListRow.next = prevRow));
|
|---|
| 4183 | task.treeContext = prevTreeContext;
|
|---|
| 4184 | task.row = prevRow;
|
|---|
| 4185 | task.keyPath = prevKeyPath;
|
|---|
| 4186 | }
|
|---|
| 4187 | function renderWithHooks(request, task, keyPath, Component, props, secondArg) {
|
|---|
| 4188 | var prevThenableState = task.thenableState;
|
|---|
| 4189 | task.thenableState = null;
|
|---|
| 4190 | currentlyRenderingComponent = {};
|
|---|
| 4191 | currentlyRenderingTask = task;
|
|---|
| 4192 | currentlyRenderingRequest = request;
|
|---|
| 4193 | currentlyRenderingKeyPath = keyPath;
|
|---|
| 4194 | actionStateCounter = localIdCounter = 0;
|
|---|
| 4195 | actionStateMatchingIndex = -1;
|
|---|
| 4196 | thenableIndexCounter = 0;
|
|---|
| 4197 | thenableState = prevThenableState;
|
|---|
| 4198 | for (request = Component(props, secondArg); didScheduleRenderPhaseUpdate; )
|
|---|
| 4199 | (didScheduleRenderPhaseUpdate = !1),
|
|---|
| 4200 | (actionStateCounter = localIdCounter = 0),
|
|---|
| 4201 | (actionStateMatchingIndex = -1),
|
|---|
| 4202 | (thenableIndexCounter = 0),
|
|---|
| 4203 | (numberOfReRenders += 1),
|
|---|
| 4204 | (workInProgressHook = null),
|
|---|
| 4205 | (request = Component(props, secondArg));
|
|---|
| 4206 | resetHooksState();
|
|---|
| 4207 | return request;
|
|---|
| 4208 | }
|
|---|
| 4209 | function finishFunctionComponent(
|
|---|
| 4210 | request,
|
|---|
| 4211 | task,
|
|---|
| 4212 | keyPath,
|
|---|
| 4213 | children,
|
|---|
| 4214 | hasId,
|
|---|
| 4215 | actionStateCount,
|
|---|
| 4216 | actionStateMatchingIndex
|
|---|
| 4217 | ) {
|
|---|
| 4218 | var didEmitActionStateMarkers = !1;
|
|---|
| 4219 | if (0 !== actionStateCount && null !== request.formState) {
|
|---|
| 4220 | var segment = task.blockedSegment;
|
|---|
| 4221 | if (null !== segment) {
|
|---|
| 4222 | didEmitActionStateMarkers = !0;
|
|---|
| 4223 | segment = segment.chunks;
|
|---|
| 4224 | for (var i = 0; i < actionStateCount; i++)
|
|---|
| 4225 | i === actionStateMatchingIndex
|
|---|
| 4226 | ? segment.push("\x3c!--F!--\x3e")
|
|---|
| 4227 | : segment.push("\x3c!--F--\x3e");
|
|---|
| 4228 | }
|
|---|
| 4229 | }
|
|---|
| 4230 | actionStateCount = task.keyPath;
|
|---|
| 4231 | task.keyPath = keyPath;
|
|---|
| 4232 | hasId
|
|---|
| 4233 | ? ((keyPath = task.treeContext),
|
|---|
| 4234 | (task.treeContext = pushTreeContext(keyPath, 1, 0)),
|
|---|
| 4235 | renderNode(request, task, children, -1),
|
|---|
| 4236 | (task.treeContext = keyPath))
|
|---|
| 4237 | : didEmitActionStateMarkers
|
|---|
| 4238 | ? renderNode(request, task, children, -1)
|
|---|
| 4239 | : renderNodeDestructive(request, task, children, -1);
|
|---|
| 4240 | task.keyPath = actionStateCount;
|
|---|
| 4241 | }
|
|---|
| 4242 | function renderElement(request, task, keyPath, type, props, ref) {
|
|---|
| 4243 | if ("function" === typeof type)
|
|---|
| 4244 | if (type.prototype && type.prototype.isReactComponent) {
|
|---|
| 4245 | var newProps = props;
|
|---|
| 4246 | if ("ref" in props) {
|
|---|
| 4247 | newProps = {};
|
|---|
| 4248 | for (var propName in props)
|
|---|
| 4249 | "ref" !== propName && (newProps[propName] = props[propName]);
|
|---|
| 4250 | }
|
|---|
| 4251 | var defaultProps = type.defaultProps;
|
|---|
| 4252 | if (defaultProps) {
|
|---|
| 4253 | newProps === props && (newProps = assign({}, newProps, props));
|
|---|
| 4254 | for (var propName$43 in defaultProps)
|
|---|
| 4255 | void 0 === newProps[propName$43] &&
|
|---|
| 4256 | (newProps[propName$43] = defaultProps[propName$43]);
|
|---|
| 4257 | }
|
|---|
| 4258 | props = newProps;
|
|---|
| 4259 | newProps = emptyContextObject;
|
|---|
| 4260 | defaultProps = type.contextType;
|
|---|
| 4261 | "object" === typeof defaultProps &&
|
|---|
| 4262 | null !== defaultProps &&
|
|---|
| 4263 | (newProps = defaultProps._currentValue);
|
|---|
| 4264 | newProps = new type(props, newProps);
|
|---|
| 4265 | var initialState = void 0 !== newProps.state ? newProps.state : null;
|
|---|
| 4266 | newProps.updater = classComponentUpdater;
|
|---|
| 4267 | newProps.props = props;
|
|---|
| 4268 | newProps.state = initialState;
|
|---|
| 4269 | defaultProps = { queue: [], replace: !1 };
|
|---|
| 4270 | newProps._reactInternals = defaultProps;
|
|---|
| 4271 | ref = type.contextType;
|
|---|
| 4272 | newProps.context =
|
|---|
| 4273 | "object" === typeof ref && null !== ref
|
|---|
| 4274 | ? ref._currentValue
|
|---|
| 4275 | : emptyContextObject;
|
|---|
| 4276 | ref = type.getDerivedStateFromProps;
|
|---|
| 4277 | "function" === typeof ref &&
|
|---|
| 4278 | ((ref = ref(props, initialState)),
|
|---|
| 4279 | (initialState =
|
|---|
| 4280 | null === ref || void 0 === ref
|
|---|
| 4281 | ? initialState
|
|---|
| 4282 | : assign({}, initialState, ref)),
|
|---|
| 4283 | (newProps.state = initialState));
|
|---|
| 4284 | if (
|
|---|
| 4285 | "function" !== typeof type.getDerivedStateFromProps &&
|
|---|
| 4286 | "function" !== typeof newProps.getSnapshotBeforeUpdate &&
|
|---|
| 4287 | ("function" === typeof newProps.UNSAFE_componentWillMount ||
|
|---|
| 4288 | "function" === typeof newProps.componentWillMount)
|
|---|
| 4289 | )
|
|---|
| 4290 | if (
|
|---|
| 4291 | ((type = newProps.state),
|
|---|
| 4292 | "function" === typeof newProps.componentWillMount &&
|
|---|
| 4293 | newProps.componentWillMount(),
|
|---|
| 4294 | "function" === typeof newProps.UNSAFE_componentWillMount &&
|
|---|
| 4295 | newProps.UNSAFE_componentWillMount(),
|
|---|
| 4296 | type !== newProps.state &&
|
|---|
| 4297 | classComponentUpdater.enqueueReplaceState(
|
|---|
| 4298 | newProps,
|
|---|
| 4299 | newProps.state,
|
|---|
| 4300 | null
|
|---|
| 4301 | ),
|
|---|
| 4302 | null !== defaultProps.queue && 0 < defaultProps.queue.length)
|
|---|
| 4303 | )
|
|---|
| 4304 | if (
|
|---|
| 4305 | ((type = defaultProps.queue),
|
|---|
| 4306 | (ref = defaultProps.replace),
|
|---|
| 4307 | (defaultProps.queue = null),
|
|---|
| 4308 | (defaultProps.replace = !1),
|
|---|
| 4309 | ref && 1 === type.length)
|
|---|
| 4310 | )
|
|---|
| 4311 | newProps.state = type[0];
|
|---|
| 4312 | else {
|
|---|
| 4313 | defaultProps = ref ? type[0] : newProps.state;
|
|---|
| 4314 | initialState = !0;
|
|---|
| 4315 | for (ref = ref ? 1 : 0; ref < type.length; ref++)
|
|---|
| 4316 | (propName$43 = type[ref]),
|
|---|
| 4317 | (propName$43 =
|
|---|
| 4318 | "function" === typeof propName$43
|
|---|
| 4319 | ? propName$43.call(newProps, defaultProps, props, void 0)
|
|---|
| 4320 | : propName$43),
|
|---|
| 4321 | null != propName$43 &&
|
|---|
| 4322 | (initialState
|
|---|
| 4323 | ? ((initialState = !1),
|
|---|
| 4324 | (defaultProps = assign({}, defaultProps, propName$43)))
|
|---|
| 4325 | : assign(defaultProps, propName$43));
|
|---|
| 4326 | newProps.state = defaultProps;
|
|---|
| 4327 | }
|
|---|
| 4328 | else defaultProps.queue = null;
|
|---|
| 4329 | type = newProps.render();
|
|---|
| 4330 | if (12 === request.status) throw null;
|
|---|
| 4331 | props = task.keyPath;
|
|---|
| 4332 | task.keyPath = keyPath;
|
|---|
| 4333 | renderNodeDestructive(request, task, type, -1);
|
|---|
| 4334 | task.keyPath = props;
|
|---|
| 4335 | } else {
|
|---|
| 4336 | type = renderWithHooks(request, task, keyPath, type, props, void 0);
|
|---|
| 4337 | if (12 === request.status) throw null;
|
|---|
| 4338 | finishFunctionComponent(
|
|---|
| 4339 | request,
|
|---|
| 4340 | task,
|
|---|
| 4341 | keyPath,
|
|---|
| 4342 | type,
|
|---|
| 4343 | 0 !== localIdCounter,
|
|---|
| 4344 | actionStateCounter,
|
|---|
| 4345 | actionStateMatchingIndex
|
|---|
| 4346 | );
|
|---|
| 4347 | }
|
|---|
| 4348 | else if ("string" === typeof type)
|
|---|
| 4349 | if (((newProps = task.blockedSegment), null === newProps))
|
|---|
| 4350 | (newProps = props.children),
|
|---|
| 4351 | (defaultProps = task.formatContext),
|
|---|
| 4352 | (initialState = task.keyPath),
|
|---|
| 4353 | (task.formatContext = getChildFormatContext(defaultProps, type, props)),
|
|---|
| 4354 | (task.keyPath = keyPath),
|
|---|
| 4355 | renderNode(request, task, newProps, -1),
|
|---|
| 4356 | (task.formatContext = defaultProps),
|
|---|
| 4357 | (task.keyPath = initialState);
|
|---|
| 4358 | else {
|
|---|
| 4359 | initialState = pushStartInstance(
|
|---|
| 4360 | newProps.chunks,
|
|---|
| 4361 | type,
|
|---|
| 4362 | props,
|
|---|
| 4363 | request.resumableState,
|
|---|
| 4364 | request.renderState,
|
|---|
| 4365 | task.blockedPreamble,
|
|---|
| 4366 | task.hoistableState,
|
|---|
| 4367 | task.formatContext,
|
|---|
| 4368 | newProps.lastPushedText
|
|---|
| 4369 | );
|
|---|
| 4370 | newProps.lastPushedText = !1;
|
|---|
| 4371 | defaultProps = task.formatContext;
|
|---|
| 4372 | ref = task.keyPath;
|
|---|
| 4373 | task.keyPath = keyPath;
|
|---|
| 4374 | if (
|
|---|
| 4375 | 3 ===
|
|---|
| 4376 | (task.formatContext = getChildFormatContext(defaultProps, type, props))
|
|---|
| 4377 | .insertionMode
|
|---|
| 4378 | ) {
|
|---|
| 4379 | keyPath = createPendingSegment(
|
|---|
| 4380 | request,
|
|---|
| 4381 | 0,
|
|---|
| 4382 | null,
|
|---|
| 4383 | task.formatContext,
|
|---|
| 4384 | !1,
|
|---|
| 4385 | !1
|
|---|
| 4386 | );
|
|---|
| 4387 | newProps.preambleChildren.push(keyPath);
|
|---|
| 4388 | task.blockedSegment = keyPath;
|
|---|
| 4389 | try {
|
|---|
| 4390 | (keyPath.status = 6),
|
|---|
| 4391 | renderNode(request, task, initialState, -1),
|
|---|
| 4392 | pushSegmentFinale(
|
|---|
| 4393 | keyPath.chunks,
|
|---|
| 4394 | request.renderState,
|
|---|
| 4395 | keyPath.lastPushedText,
|
|---|
| 4396 | keyPath.textEmbedded
|
|---|
| 4397 | ),
|
|---|
| 4398 | (keyPath.status = 1),
|
|---|
| 4399 | finishedSegment(request, task.blockedBoundary, keyPath);
|
|---|
| 4400 | } finally {
|
|---|
| 4401 | task.blockedSegment = newProps;
|
|---|
| 4402 | }
|
|---|
| 4403 | } else renderNode(request, task, initialState, -1);
|
|---|
| 4404 | task.formatContext = defaultProps;
|
|---|
| 4405 | task.keyPath = ref;
|
|---|
| 4406 | a: {
|
|---|
| 4407 | task = newProps.chunks;
|
|---|
| 4408 | request = request.resumableState;
|
|---|
| 4409 | switch (type) {
|
|---|
| 4410 | case "title":
|
|---|
| 4411 | case "style":
|
|---|
| 4412 | case "script":
|
|---|
| 4413 | case "area":
|
|---|
| 4414 | case "base":
|
|---|
| 4415 | case "br":
|
|---|
| 4416 | case "col":
|
|---|
| 4417 | case "embed":
|
|---|
| 4418 | case "hr":
|
|---|
| 4419 | case "img":
|
|---|
| 4420 | case "input":
|
|---|
| 4421 | case "keygen":
|
|---|
| 4422 | case "link":
|
|---|
| 4423 | case "meta":
|
|---|
| 4424 | case "param":
|
|---|
| 4425 | case "source":
|
|---|
| 4426 | case "track":
|
|---|
| 4427 | case "wbr":
|
|---|
| 4428 | break a;
|
|---|
| 4429 | case "body":
|
|---|
| 4430 | if (1 >= defaultProps.insertionMode) {
|
|---|
| 4431 | request.hasBody = !0;
|
|---|
| 4432 | break a;
|
|---|
| 4433 | }
|
|---|
| 4434 | break;
|
|---|
| 4435 | case "html":
|
|---|
| 4436 | if (0 === defaultProps.insertionMode) {
|
|---|
| 4437 | request.hasHtml = !0;
|
|---|
| 4438 | break a;
|
|---|
| 4439 | }
|
|---|
| 4440 | break;
|
|---|
| 4441 | case "head":
|
|---|
| 4442 | if (1 >= defaultProps.insertionMode) break a;
|
|---|
| 4443 | }
|
|---|
| 4444 | task.push(endChunkForTag(type));
|
|---|
| 4445 | }
|
|---|
| 4446 | newProps.lastPushedText = !1;
|
|---|
| 4447 | }
|
|---|
| 4448 | else {
|
|---|
| 4449 | switch (type) {
|
|---|
| 4450 | case REACT_LEGACY_HIDDEN_TYPE:
|
|---|
| 4451 | case REACT_STRICT_MODE_TYPE:
|
|---|
| 4452 | case REACT_PROFILER_TYPE:
|
|---|
| 4453 | case REACT_FRAGMENT_TYPE:
|
|---|
| 4454 | type = task.keyPath;
|
|---|
| 4455 | task.keyPath = keyPath;
|
|---|
| 4456 | renderNodeDestructive(request, task, props.children, -1);
|
|---|
| 4457 | task.keyPath = type;
|
|---|
| 4458 | return;
|
|---|
| 4459 | case REACT_ACTIVITY_TYPE:
|
|---|
| 4460 | type = task.blockedSegment;
|
|---|
| 4461 | null === type
|
|---|
| 4462 | ? "hidden" !== props.mode &&
|
|---|
| 4463 | ((type = task.keyPath),
|
|---|
| 4464 | (task.keyPath = keyPath),
|
|---|
| 4465 | renderNode(request, task, props.children, -1),
|
|---|
| 4466 | (task.keyPath = type))
|
|---|
| 4467 | : "hidden" !== props.mode &&
|
|---|
| 4468 | (type.chunks.push("\x3c!--&--\x3e"),
|
|---|
| 4469 | (type.lastPushedText = !1),
|
|---|
| 4470 | (newProps = task.keyPath),
|
|---|
| 4471 | (task.keyPath = keyPath),
|
|---|
| 4472 | renderNode(request, task, props.children, -1),
|
|---|
| 4473 | (task.keyPath = newProps),
|
|---|
| 4474 | type.chunks.push("\x3c!--/&--\x3e"),
|
|---|
| 4475 | (type.lastPushedText = !1));
|
|---|
| 4476 | return;
|
|---|
| 4477 | case REACT_SUSPENSE_LIST_TYPE:
|
|---|
| 4478 | a: {
|
|---|
| 4479 | type = props.children;
|
|---|
| 4480 | props = props.revealOrder;
|
|---|
| 4481 | if (
|
|---|
| 4482 | "forwards" === props ||
|
|---|
| 4483 | "backwards" === props ||
|
|---|
| 4484 | "unstable_legacy-backwards" === props
|
|---|
| 4485 | ) {
|
|---|
| 4486 | if (isArrayImpl(type)) {
|
|---|
| 4487 | renderSuspenseListRows(request, task, keyPath, type, props);
|
|---|
| 4488 | break a;
|
|---|
| 4489 | }
|
|---|
| 4490 | if ((newProps = getIteratorFn(type)))
|
|---|
| 4491 | if ((newProps = newProps.call(type))) {
|
|---|
| 4492 | defaultProps = newProps.next();
|
|---|
| 4493 | if (!defaultProps.done) {
|
|---|
| 4494 | do defaultProps = newProps.next();
|
|---|
| 4495 | while (!defaultProps.done);
|
|---|
| 4496 | renderSuspenseListRows(request, task, keyPath, type, props);
|
|---|
| 4497 | }
|
|---|
| 4498 | break a;
|
|---|
| 4499 | }
|
|---|
| 4500 | }
|
|---|
| 4501 | "together" === props
|
|---|
| 4502 | ? ((props = task.keyPath),
|
|---|
| 4503 | (newProps = task.row),
|
|---|
| 4504 | (defaultProps = task.row = createSuspenseListRow(null)),
|
|---|
| 4505 | (defaultProps.boundaries = []),
|
|---|
| 4506 | (defaultProps.together = !0),
|
|---|
| 4507 | (task.keyPath = keyPath),
|
|---|
| 4508 | renderNodeDestructive(request, task, type, -1),
|
|---|
| 4509 | 0 === --defaultProps.pendingTasks &&
|
|---|
| 4510 | finishSuspenseListRow(request, defaultProps),
|
|---|
| 4511 | (task.keyPath = props),
|
|---|
| 4512 | (task.row = newProps),
|
|---|
| 4513 | null !== newProps &&
|
|---|
| 4514 | 0 < defaultProps.pendingTasks &&
|
|---|
| 4515 | (newProps.pendingTasks++, (defaultProps.next = newProps)))
|
|---|
| 4516 | : ((props = task.keyPath),
|
|---|
| 4517 | (task.keyPath = keyPath),
|
|---|
| 4518 | renderNodeDestructive(request, task, type, -1),
|
|---|
| 4519 | (task.keyPath = props));
|
|---|
| 4520 | }
|
|---|
| 4521 | return;
|
|---|
| 4522 | case REACT_VIEW_TRANSITION_TYPE:
|
|---|
| 4523 | case REACT_SCOPE_TYPE:
|
|---|
| 4524 | throw Error("ReactDOMServer does not yet support scope components.");
|
|---|
| 4525 | case REACT_SUSPENSE_TYPE:
|
|---|
| 4526 | a: if (null !== task.replay) {
|
|---|
| 4527 | type = task.keyPath;
|
|---|
| 4528 | newProps = task.formatContext;
|
|---|
| 4529 | defaultProps = task.row;
|
|---|
| 4530 | task.keyPath = keyPath;
|
|---|
| 4531 | task.formatContext = getSuspenseContentFormatContext(
|
|---|
| 4532 | request.resumableState,
|
|---|
| 4533 | newProps
|
|---|
| 4534 | );
|
|---|
| 4535 | task.row = null;
|
|---|
| 4536 | keyPath = props.children;
|
|---|
| 4537 | try {
|
|---|
| 4538 | renderNode(request, task, keyPath, -1);
|
|---|
| 4539 | } finally {
|
|---|
| 4540 | (task.keyPath = type),
|
|---|
| 4541 | (task.formatContext = newProps),
|
|---|
| 4542 | (task.row = defaultProps);
|
|---|
| 4543 | }
|
|---|
| 4544 | } else {
|
|---|
| 4545 | type = task.keyPath;
|
|---|
| 4546 | ref = task.formatContext;
|
|---|
| 4547 | var prevRow = task.row;
|
|---|
| 4548 | propName$43 = task.blockedBoundary;
|
|---|
| 4549 | propName = task.blockedPreamble;
|
|---|
| 4550 | var parentHoistableState = task.hoistableState,
|
|---|
| 4551 | parentSegment = task.blockedSegment,
|
|---|
| 4552 | fallback = props.fallback;
|
|---|
| 4553 | props = props.children;
|
|---|
| 4554 | var fallbackAbortSet = new Set();
|
|---|
| 4555 | var newBoundary =
|
|---|
| 4556 | 2 > task.formatContext.insertionMode
|
|---|
| 4557 | ? createSuspenseBoundary(
|
|---|
| 4558 | request,
|
|---|
| 4559 | task.row,
|
|---|
| 4560 | fallbackAbortSet,
|
|---|
| 4561 | createPreambleState(),
|
|---|
| 4562 | createPreambleState()
|
|---|
| 4563 | )
|
|---|
| 4564 | : createSuspenseBoundary(
|
|---|
| 4565 | request,
|
|---|
| 4566 | task.row,
|
|---|
| 4567 | fallbackAbortSet,
|
|---|
| 4568 | null,
|
|---|
| 4569 | null
|
|---|
| 4570 | );
|
|---|
| 4571 | null !== request.trackedPostpones &&
|
|---|
| 4572 | (newBoundary.trackedContentKeyPath = keyPath);
|
|---|
| 4573 | var boundarySegment = createPendingSegment(
|
|---|
| 4574 | request,
|
|---|
| 4575 | parentSegment.chunks.length,
|
|---|
| 4576 | newBoundary,
|
|---|
| 4577 | task.formatContext,
|
|---|
| 4578 | !1,
|
|---|
| 4579 | !1
|
|---|
| 4580 | );
|
|---|
| 4581 | parentSegment.children.push(boundarySegment);
|
|---|
| 4582 | parentSegment.lastPushedText = !1;
|
|---|
| 4583 | var contentRootSegment = createPendingSegment(
|
|---|
| 4584 | request,
|
|---|
| 4585 | 0,
|
|---|
| 4586 | null,
|
|---|
| 4587 | task.formatContext,
|
|---|
| 4588 | !1,
|
|---|
| 4589 | !1
|
|---|
| 4590 | );
|
|---|
| 4591 | contentRootSegment.parentFlushed = !0;
|
|---|
| 4592 | if (null !== request.trackedPostpones) {
|
|---|
| 4593 | newProps = task.componentStack;
|
|---|
| 4594 | defaultProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
|
|---|
| 4595 | initialState = [defaultProps[1], defaultProps[2], [], null];
|
|---|
| 4596 | request.trackedPostpones.workingMap.set(defaultProps, initialState);
|
|---|
| 4597 | newBoundary.trackedFallbackNode = initialState;
|
|---|
| 4598 | task.blockedSegment = boundarySegment;
|
|---|
| 4599 | task.blockedPreamble = newBoundary.fallbackPreamble;
|
|---|
| 4600 | task.keyPath = defaultProps;
|
|---|
| 4601 | task.formatContext = getSuspenseFallbackFormatContext(
|
|---|
| 4602 | request.resumableState,
|
|---|
| 4603 | ref
|
|---|
| 4604 | );
|
|---|
| 4605 | task.componentStack =
|
|---|
| 4606 | replaceSuspenseComponentStackWithSuspenseFallbackStack(newProps);
|
|---|
| 4607 | boundarySegment.status = 6;
|
|---|
| 4608 | try {
|
|---|
| 4609 | renderNode(request, task, fallback, -1),
|
|---|
| 4610 | pushSegmentFinale(
|
|---|
| 4611 | boundarySegment.chunks,
|
|---|
| 4612 | request.renderState,
|
|---|
| 4613 | boundarySegment.lastPushedText,
|
|---|
| 4614 | boundarySegment.textEmbedded
|
|---|
| 4615 | ),
|
|---|
| 4616 | (boundarySegment.status = 1),
|
|---|
| 4617 | finishedSegment(request, propName$43, boundarySegment);
|
|---|
| 4618 | } catch (thrownValue) {
|
|---|
| 4619 | throw (
|
|---|
| 4620 | ((boundarySegment.status = 12 === request.status ? 3 : 4),
|
|---|
| 4621 | thrownValue)
|
|---|
| 4622 | );
|
|---|
| 4623 | } finally {
|
|---|
| 4624 | (task.blockedSegment = parentSegment),
|
|---|
| 4625 | (task.blockedPreamble = propName),
|
|---|
| 4626 | (task.keyPath = type),
|
|---|
| 4627 | (task.formatContext = ref);
|
|---|
| 4628 | }
|
|---|
| 4629 | task = createRenderTask(
|
|---|
| 4630 | request,
|
|---|
| 4631 | null,
|
|---|
| 4632 | props,
|
|---|
| 4633 | -1,
|
|---|
| 4634 | newBoundary,
|
|---|
| 4635 | contentRootSegment,
|
|---|
| 4636 | newBoundary.contentPreamble,
|
|---|
| 4637 | newBoundary.contentState,
|
|---|
| 4638 | task.abortSet,
|
|---|
| 4639 | keyPath,
|
|---|
| 4640 | getSuspenseContentFormatContext(
|
|---|
| 4641 | request.resumableState,
|
|---|
| 4642 | task.formatContext
|
|---|
| 4643 | ),
|
|---|
| 4644 | task.context,
|
|---|
| 4645 | task.treeContext,
|
|---|
| 4646 | null,
|
|---|
| 4647 | newProps
|
|---|
| 4648 | );
|
|---|
| 4649 | pushComponentStack(task);
|
|---|
| 4650 | request.pingedTasks.push(task);
|
|---|
| 4651 | } else {
|
|---|
| 4652 | task.blockedBoundary = newBoundary;
|
|---|
| 4653 | task.blockedPreamble = newBoundary.contentPreamble;
|
|---|
| 4654 | task.hoistableState = newBoundary.contentState;
|
|---|
| 4655 | task.blockedSegment = contentRootSegment;
|
|---|
| 4656 | task.keyPath = keyPath;
|
|---|
| 4657 | task.formatContext = getSuspenseContentFormatContext(
|
|---|
| 4658 | request.resumableState,
|
|---|
| 4659 | ref
|
|---|
| 4660 | );
|
|---|
| 4661 | task.row = null;
|
|---|
| 4662 | contentRootSegment.status = 6;
|
|---|
| 4663 | try {
|
|---|
| 4664 | if (
|
|---|
| 4665 | (renderNode(request, task, props, -1),
|
|---|
| 4666 | pushSegmentFinale(
|
|---|
| 4667 | contentRootSegment.chunks,
|
|---|
| 4668 | request.renderState,
|
|---|
| 4669 | contentRootSegment.lastPushedText,
|
|---|
| 4670 | contentRootSegment.textEmbedded
|
|---|
| 4671 | ),
|
|---|
| 4672 | (contentRootSegment.status = 1),
|
|---|
| 4673 | finishedSegment(request, newBoundary, contentRootSegment),
|
|---|
| 4674 | queueCompletedSegment(newBoundary, contentRootSegment),
|
|---|
| 4675 | 0 === newBoundary.pendingTasks && 0 === newBoundary.status)
|
|---|
| 4676 | ) {
|
|---|
| 4677 | if (
|
|---|
| 4678 | ((newBoundary.status = 1),
|
|---|
| 4679 | !isEligibleForOutlining(request, newBoundary))
|
|---|
| 4680 | ) {
|
|---|
| 4681 | null !== prevRow &&
|
|---|
| 4682 | 0 === --prevRow.pendingTasks &&
|
|---|
| 4683 | finishSuspenseListRow(request, prevRow);
|
|---|
| 4684 | 0 === request.pendingRootTasks &&
|
|---|
| 4685 | task.blockedPreamble &&
|
|---|
| 4686 | preparePreamble(request);
|
|---|
| 4687 | break a;
|
|---|
| 4688 | }
|
|---|
| 4689 | } else
|
|---|
| 4690 | null !== prevRow &&
|
|---|
| 4691 | prevRow.together &&
|
|---|
| 4692 | tryToResolveTogetherRow(request, prevRow);
|
|---|
| 4693 | } catch (thrownValue$30) {
|
|---|
| 4694 | (newBoundary.status = 4),
|
|---|
| 4695 | 12 === request.status
|
|---|
| 4696 | ? ((contentRootSegment.status = 3),
|
|---|
| 4697 | (newProps = request.fatalError))
|
|---|
| 4698 | : ((contentRootSegment.status = 4),
|
|---|
| 4699 | (newProps = thrownValue$30)),
|
|---|
| 4700 | (defaultProps = getThrownInfo(task.componentStack)),
|
|---|
| 4701 | (initialState = logRecoverableError(
|
|---|
| 4702 | request,
|
|---|
| 4703 | newProps,
|
|---|
| 4704 | defaultProps
|
|---|
| 4705 | )),
|
|---|
| 4706 | (newBoundary.errorDigest = initialState),
|
|---|
| 4707 | untrackBoundary(request, newBoundary);
|
|---|
| 4708 | } finally {
|
|---|
| 4709 | (task.blockedBoundary = propName$43),
|
|---|
| 4710 | (task.blockedPreamble = propName),
|
|---|
| 4711 | (task.hoistableState = parentHoistableState),
|
|---|
| 4712 | (task.blockedSegment = parentSegment),
|
|---|
| 4713 | (task.keyPath = type),
|
|---|
| 4714 | (task.formatContext = ref),
|
|---|
| 4715 | (task.row = prevRow);
|
|---|
| 4716 | }
|
|---|
| 4717 | task = createRenderTask(
|
|---|
| 4718 | request,
|
|---|
| 4719 | null,
|
|---|
| 4720 | fallback,
|
|---|
| 4721 | -1,
|
|---|
| 4722 | propName$43,
|
|---|
| 4723 | boundarySegment,
|
|---|
| 4724 | newBoundary.fallbackPreamble,
|
|---|
| 4725 | newBoundary.fallbackState,
|
|---|
| 4726 | fallbackAbortSet,
|
|---|
| 4727 | [keyPath[0], "Suspense Fallback", keyPath[2]],
|
|---|
| 4728 | getSuspenseFallbackFormatContext(
|
|---|
| 4729 | request.resumableState,
|
|---|
| 4730 | task.formatContext
|
|---|
| 4731 | ),
|
|---|
| 4732 | task.context,
|
|---|
| 4733 | task.treeContext,
|
|---|
| 4734 | task.row,
|
|---|
| 4735 | replaceSuspenseComponentStackWithSuspenseFallbackStack(
|
|---|
| 4736 | task.componentStack
|
|---|
| 4737 | )
|
|---|
| 4738 | );
|
|---|
| 4739 | pushComponentStack(task);
|
|---|
| 4740 | request.pingedTasks.push(task);
|
|---|
| 4741 | }
|
|---|
| 4742 | }
|
|---|
| 4743 | return;
|
|---|
| 4744 | }
|
|---|
| 4745 | if ("object" === typeof type && null !== type)
|
|---|
| 4746 | switch (type.$$typeof) {
|
|---|
| 4747 | case REACT_FORWARD_REF_TYPE:
|
|---|
| 4748 | if ("ref" in props)
|
|---|
| 4749 | for (parentSegment in ((newProps = {}), props))
|
|---|
| 4750 | "ref" !== parentSegment &&
|
|---|
| 4751 | (newProps[parentSegment] = props[parentSegment]);
|
|---|
| 4752 | else newProps = props;
|
|---|
| 4753 | type = renderWithHooks(
|
|---|
| 4754 | request,
|
|---|
| 4755 | task,
|
|---|
| 4756 | keyPath,
|
|---|
| 4757 | type.render,
|
|---|
| 4758 | newProps,
|
|---|
| 4759 | ref
|
|---|
| 4760 | );
|
|---|
| 4761 | finishFunctionComponent(
|
|---|
| 4762 | request,
|
|---|
| 4763 | task,
|
|---|
| 4764 | keyPath,
|
|---|
| 4765 | type,
|
|---|
| 4766 | 0 !== localIdCounter,
|
|---|
| 4767 | actionStateCounter,
|
|---|
| 4768 | actionStateMatchingIndex
|
|---|
| 4769 | );
|
|---|
| 4770 | return;
|
|---|
| 4771 | case REACT_MEMO_TYPE:
|
|---|
| 4772 | renderElement(request, task, keyPath, type.type, props, ref);
|
|---|
| 4773 | return;
|
|---|
| 4774 | case REACT_CONTEXT_TYPE:
|
|---|
| 4775 | defaultProps = props.children;
|
|---|
| 4776 | newProps = task.keyPath;
|
|---|
| 4777 | props = props.value;
|
|---|
| 4778 | initialState = type._currentValue;
|
|---|
| 4779 | type._currentValue = props;
|
|---|
| 4780 | ref = currentActiveSnapshot;
|
|---|
| 4781 | currentActiveSnapshot = type = {
|
|---|
| 4782 | parent: ref,
|
|---|
| 4783 | depth: null === ref ? 0 : ref.depth + 1,
|
|---|
| 4784 | context: type,
|
|---|
| 4785 | parentValue: initialState,
|
|---|
| 4786 | value: props
|
|---|
| 4787 | };
|
|---|
| 4788 | task.context = type;
|
|---|
| 4789 | task.keyPath = keyPath;
|
|---|
| 4790 | renderNodeDestructive(request, task, defaultProps, -1);
|
|---|
| 4791 | request = currentActiveSnapshot;
|
|---|
| 4792 | if (null === request)
|
|---|
| 4793 | throw Error(
|
|---|
| 4794 | "Tried to pop a Context at the root of the app. This is a bug in React."
|
|---|
| 4795 | );
|
|---|
| 4796 | request.context._currentValue = request.parentValue;
|
|---|
| 4797 | request = currentActiveSnapshot = request.parent;
|
|---|
| 4798 | task.context = request;
|
|---|
| 4799 | task.keyPath = newProps;
|
|---|
| 4800 | return;
|
|---|
| 4801 | case REACT_CONSUMER_TYPE:
|
|---|
| 4802 | props = props.children;
|
|---|
| 4803 | type = props(type._context._currentValue);
|
|---|
| 4804 | props = task.keyPath;
|
|---|
| 4805 | task.keyPath = keyPath;
|
|---|
| 4806 | renderNodeDestructive(request, task, type, -1);
|
|---|
| 4807 | task.keyPath = props;
|
|---|
| 4808 | return;
|
|---|
| 4809 | case REACT_LAZY_TYPE:
|
|---|
| 4810 | newProps = type._init;
|
|---|
| 4811 | type = newProps(type._payload);
|
|---|
| 4812 | if (12 === request.status) throw null;
|
|---|
| 4813 | renderElement(request, task, keyPath, type, props, ref);
|
|---|
| 4814 | return;
|
|---|
| 4815 | }
|
|---|
| 4816 | throw Error(
|
|---|
| 4817 | "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
|
|---|
| 4818 | ((null == type ? type : typeof type) + ".")
|
|---|
| 4819 | );
|
|---|
| 4820 | }
|
|---|
| 4821 | }
|
|---|
| 4822 | function resumeNode(request, task, segmentId, node, childIndex) {
|
|---|
| 4823 | var prevReplay = task.replay,
|
|---|
| 4824 | blockedBoundary = task.blockedBoundary,
|
|---|
| 4825 | resumedSegment = createPendingSegment(
|
|---|
| 4826 | request,
|
|---|
| 4827 | 0,
|
|---|
| 4828 | null,
|
|---|
| 4829 | task.formatContext,
|
|---|
| 4830 | !1,
|
|---|
| 4831 | !1
|
|---|
| 4832 | );
|
|---|
| 4833 | resumedSegment.id = segmentId;
|
|---|
| 4834 | resumedSegment.parentFlushed = !0;
|
|---|
| 4835 | try {
|
|---|
| 4836 | (task.replay = null),
|
|---|
| 4837 | (task.blockedSegment = resumedSegment),
|
|---|
| 4838 | renderNode(request, task, node, childIndex),
|
|---|
| 4839 | (resumedSegment.status = 1),
|
|---|
| 4840 | finishedSegment(request, blockedBoundary, resumedSegment),
|
|---|
| 4841 | null === blockedBoundary
|
|---|
| 4842 | ? (request.completedRootSegment = resumedSegment)
|
|---|
| 4843 | : (queueCompletedSegment(blockedBoundary, resumedSegment),
|
|---|
| 4844 | blockedBoundary.parentFlushed &&
|
|---|
| 4845 | request.partialBoundaries.push(blockedBoundary));
|
|---|
| 4846 | } finally {
|
|---|
| 4847 | (task.replay = prevReplay), (task.blockedSegment = null);
|
|---|
| 4848 | }
|
|---|
| 4849 | }
|
|---|
| 4850 | function renderNodeDestructive(request, task, node, childIndex) {
|
|---|
| 4851 | null !== task.replay && "number" === typeof task.replay.slots
|
|---|
| 4852 | ? resumeNode(request, task, task.replay.slots, node, childIndex)
|
|---|
| 4853 | : ((task.node = node),
|
|---|
| 4854 | (task.childIndex = childIndex),
|
|---|
| 4855 | (node = task.componentStack),
|
|---|
| 4856 | pushComponentStack(task),
|
|---|
| 4857 | retryNode(request, task),
|
|---|
| 4858 | (task.componentStack = node));
|
|---|
| 4859 | }
|
|---|
| 4860 | function retryNode(request, task) {
|
|---|
| 4861 | var node = task.node,
|
|---|
| 4862 | childIndex = task.childIndex;
|
|---|
| 4863 | if (null !== node) {
|
|---|
| 4864 | if ("object" === typeof node) {
|
|---|
| 4865 | switch (node.$$typeof) {
|
|---|
| 4866 | case REACT_ELEMENT_TYPE:
|
|---|
| 4867 | var type = node.type,
|
|---|
| 4868 | key = node.key,
|
|---|
| 4869 | props = node.props;
|
|---|
| 4870 | node = props.ref;
|
|---|
| 4871 | var ref = void 0 !== node ? node : null,
|
|---|
| 4872 | name = getComponentNameFromType(type),
|
|---|
| 4873 | keyOrIndex =
|
|---|
| 4874 | null == key ? (-1 === childIndex ? 0 : childIndex) : key;
|
|---|
| 4875 | key = [task.keyPath, name, keyOrIndex];
|
|---|
| 4876 | if (null !== task.replay)
|
|---|
| 4877 | a: {
|
|---|
| 4878 | var replay = task.replay;
|
|---|
| 4879 | childIndex = replay.nodes;
|
|---|
| 4880 | for (node = 0; node < childIndex.length; node++) {
|
|---|
| 4881 | var node$jscomp$0 = childIndex[node];
|
|---|
| 4882 | if (keyOrIndex === node$jscomp$0[1]) {
|
|---|
| 4883 | if (4 === node$jscomp$0.length) {
|
|---|
| 4884 | if (null !== name && name !== node$jscomp$0[0])
|
|---|
| 4885 | throw Error(
|
|---|
| 4886 | "Expected the resume to render <" +
|
|---|
| 4887 | node$jscomp$0[0] +
|
|---|
| 4888 | "> in this slot but instead it rendered <" +
|
|---|
| 4889 | name +
|
|---|
| 4890 | ">. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 4891 | );
|
|---|
| 4892 | var childNodes = node$jscomp$0[2];
|
|---|
| 4893 | name = node$jscomp$0[3];
|
|---|
| 4894 | keyOrIndex = task.node;
|
|---|
| 4895 | task.replay = {
|
|---|
| 4896 | nodes: childNodes,
|
|---|
| 4897 | slots: name,
|
|---|
| 4898 | pendingTasks: 1
|
|---|
| 4899 | };
|
|---|
| 4900 | try {
|
|---|
| 4901 | renderElement(request, task, key, type, props, ref);
|
|---|
| 4902 | if (
|
|---|
| 4903 | 1 === task.replay.pendingTasks &&
|
|---|
| 4904 | 0 < task.replay.nodes.length
|
|---|
| 4905 | )
|
|---|
| 4906 | throw Error(
|
|---|
| 4907 | "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 4908 | );
|
|---|
| 4909 | task.replay.pendingTasks--;
|
|---|
| 4910 | } catch (x) {
|
|---|
| 4911 | if (
|
|---|
| 4912 | "object" === typeof x &&
|
|---|
| 4913 | null !== x &&
|
|---|
| 4914 | (x === SuspenseException ||
|
|---|
| 4915 | "function" === typeof x.then)
|
|---|
| 4916 | )
|
|---|
| 4917 | throw (
|
|---|
| 4918 | (task.node === keyOrIndex
|
|---|
| 4919 | ? (task.replay = replay)
|
|---|
| 4920 | : childIndex.splice(node, 1),
|
|---|
| 4921 | x)
|
|---|
| 4922 | );
|
|---|
| 4923 | task.replay.pendingTasks--;
|
|---|
| 4924 | props = getThrownInfo(task.componentStack);
|
|---|
| 4925 | key = request;
|
|---|
| 4926 | request = task.blockedBoundary;
|
|---|
| 4927 | type = x;
|
|---|
| 4928 | props = logRecoverableError(key, type, props);
|
|---|
| 4929 | abortRemainingReplayNodes(
|
|---|
| 4930 | key,
|
|---|
| 4931 | request,
|
|---|
| 4932 | childNodes,
|
|---|
| 4933 | name,
|
|---|
| 4934 | type,
|
|---|
| 4935 | props
|
|---|
| 4936 | );
|
|---|
| 4937 | }
|
|---|
| 4938 | task.replay = replay;
|
|---|
| 4939 | } else {
|
|---|
| 4940 | if (type !== REACT_SUSPENSE_TYPE)
|
|---|
| 4941 | throw Error(
|
|---|
| 4942 | "Expected the resume to render <Suspense> in this slot but instead it rendered <" +
|
|---|
| 4943 | (getComponentNameFromType(type) || "Unknown") +
|
|---|
| 4944 | ">. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 4945 | );
|
|---|
| 4946 | b: {
|
|---|
| 4947 | replay = void 0;
|
|---|
| 4948 | type = node$jscomp$0[5];
|
|---|
| 4949 | ref = node$jscomp$0[2];
|
|---|
| 4950 | name = node$jscomp$0[3];
|
|---|
| 4951 | keyOrIndex =
|
|---|
| 4952 | null === node$jscomp$0[4] ? [] : node$jscomp$0[4][2];
|
|---|
| 4953 | node$jscomp$0 =
|
|---|
| 4954 | null === node$jscomp$0[4] ? null : node$jscomp$0[4][3];
|
|---|
| 4955 | var prevKeyPath = task.keyPath,
|
|---|
| 4956 | prevContext = task.formatContext,
|
|---|
| 4957 | prevRow = task.row,
|
|---|
| 4958 | previousReplaySet = task.replay,
|
|---|
| 4959 | parentBoundary = task.blockedBoundary,
|
|---|
| 4960 | parentHoistableState = task.hoistableState,
|
|---|
| 4961 | content = props.children,
|
|---|
| 4962 | fallback = props.fallback,
|
|---|
| 4963 | fallbackAbortSet = new Set();
|
|---|
| 4964 | props =
|
|---|
| 4965 | 2 > task.formatContext.insertionMode
|
|---|
| 4966 | ? createSuspenseBoundary(
|
|---|
| 4967 | request,
|
|---|
| 4968 | task.row,
|
|---|
| 4969 | fallbackAbortSet,
|
|---|
| 4970 | createPreambleState(),
|
|---|
| 4971 | createPreambleState()
|
|---|
| 4972 | )
|
|---|
| 4973 | : createSuspenseBoundary(
|
|---|
| 4974 | request,
|
|---|
| 4975 | task.row,
|
|---|
| 4976 | fallbackAbortSet,
|
|---|
| 4977 | null,
|
|---|
| 4978 | null
|
|---|
| 4979 | );
|
|---|
| 4980 | props.parentFlushed = !0;
|
|---|
| 4981 | props.rootSegmentID = type;
|
|---|
| 4982 | task.blockedBoundary = props;
|
|---|
| 4983 | task.hoistableState = props.contentState;
|
|---|
| 4984 | task.keyPath = key;
|
|---|
| 4985 | task.formatContext = getSuspenseContentFormatContext(
|
|---|
| 4986 | request.resumableState,
|
|---|
| 4987 | prevContext
|
|---|
| 4988 | );
|
|---|
| 4989 | task.row = null;
|
|---|
| 4990 | task.replay = {
|
|---|
| 4991 | nodes: ref,
|
|---|
| 4992 | slots: name,
|
|---|
| 4993 | pendingTasks: 1
|
|---|
| 4994 | };
|
|---|
| 4995 | try {
|
|---|
| 4996 | renderNode(request, task, content, -1);
|
|---|
| 4997 | if (
|
|---|
| 4998 | 1 === task.replay.pendingTasks &&
|
|---|
| 4999 | 0 < task.replay.nodes.length
|
|---|
| 5000 | )
|
|---|
| 5001 | throw Error(
|
|---|
| 5002 | "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 5003 | );
|
|---|
| 5004 | task.replay.pendingTasks--;
|
|---|
| 5005 | if (0 === props.pendingTasks && 0 === props.status) {
|
|---|
| 5006 | props.status = 1;
|
|---|
| 5007 | request.completedBoundaries.push(props);
|
|---|
| 5008 | break b;
|
|---|
| 5009 | }
|
|---|
| 5010 | } catch (error) {
|
|---|
| 5011 | (props.status = 4),
|
|---|
| 5012 | (childNodes = getThrownInfo(task.componentStack)),
|
|---|
| 5013 | (replay = logRecoverableError(
|
|---|
| 5014 | request,
|
|---|
| 5015 | error,
|
|---|
| 5016 | childNodes
|
|---|
| 5017 | )),
|
|---|
| 5018 | (props.errorDigest = replay),
|
|---|
| 5019 | task.replay.pendingTasks--,
|
|---|
| 5020 | request.clientRenderedBoundaries.push(props);
|
|---|
| 5021 | } finally {
|
|---|
| 5022 | (task.blockedBoundary = parentBoundary),
|
|---|
| 5023 | (task.hoistableState = parentHoistableState),
|
|---|
| 5024 | (task.replay = previousReplaySet),
|
|---|
| 5025 | (task.keyPath = prevKeyPath),
|
|---|
| 5026 | (task.formatContext = prevContext),
|
|---|
| 5027 | (task.row = prevRow);
|
|---|
| 5028 | }
|
|---|
| 5029 | childNodes = createReplayTask(
|
|---|
| 5030 | request,
|
|---|
| 5031 | null,
|
|---|
| 5032 | {
|
|---|
| 5033 | nodes: keyOrIndex,
|
|---|
| 5034 | slots: node$jscomp$0,
|
|---|
| 5035 | pendingTasks: 0
|
|---|
| 5036 | },
|
|---|
| 5037 | fallback,
|
|---|
| 5038 | -1,
|
|---|
| 5039 | parentBoundary,
|
|---|
| 5040 | props.fallbackState,
|
|---|
| 5041 | fallbackAbortSet,
|
|---|
| 5042 | [key[0], "Suspense Fallback", key[2]],
|
|---|
| 5043 | getSuspenseFallbackFormatContext(
|
|---|
| 5044 | request.resumableState,
|
|---|
| 5045 | task.formatContext
|
|---|
| 5046 | ),
|
|---|
| 5047 | task.context,
|
|---|
| 5048 | task.treeContext,
|
|---|
| 5049 | task.row,
|
|---|
| 5050 | replaceSuspenseComponentStackWithSuspenseFallbackStack(
|
|---|
| 5051 | task.componentStack
|
|---|
| 5052 | )
|
|---|
| 5053 | );
|
|---|
| 5054 | pushComponentStack(childNodes);
|
|---|
| 5055 | request.pingedTasks.push(childNodes);
|
|---|
| 5056 | }
|
|---|
| 5057 | }
|
|---|
| 5058 | childIndex.splice(node, 1);
|
|---|
| 5059 | break a;
|
|---|
| 5060 | }
|
|---|
| 5061 | }
|
|---|
| 5062 | }
|
|---|
| 5063 | else renderElement(request, task, key, type, props, ref);
|
|---|
| 5064 | return;
|
|---|
| 5065 | case REACT_PORTAL_TYPE:
|
|---|
| 5066 | throw Error(
|
|---|
| 5067 | "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render."
|
|---|
| 5068 | );
|
|---|
| 5069 | case REACT_LAZY_TYPE:
|
|---|
| 5070 | childNodes = node._init;
|
|---|
| 5071 | node = childNodes(node._payload);
|
|---|
| 5072 | if (12 === request.status) throw null;
|
|---|
| 5073 | renderNodeDestructive(request, task, node, childIndex);
|
|---|
| 5074 | return;
|
|---|
| 5075 | }
|
|---|
| 5076 | if (isArrayImpl(node)) {
|
|---|
| 5077 | renderChildrenArray(request, task, node, childIndex);
|
|---|
| 5078 | return;
|
|---|
| 5079 | }
|
|---|
| 5080 | if ((childNodes = getIteratorFn(node)))
|
|---|
| 5081 | if ((childNodes = childNodes.call(node))) {
|
|---|
| 5082 | node = childNodes.next();
|
|---|
| 5083 | if (!node.done) {
|
|---|
| 5084 | props = [];
|
|---|
| 5085 | do props.push(node.value), (node = childNodes.next());
|
|---|
| 5086 | while (!node.done);
|
|---|
| 5087 | renderChildrenArray(request, task, props, childIndex);
|
|---|
| 5088 | }
|
|---|
| 5089 | return;
|
|---|
| 5090 | }
|
|---|
| 5091 | if ("function" === typeof node.then)
|
|---|
| 5092 | return (
|
|---|
| 5093 | (task.thenableState = null),
|
|---|
| 5094 | renderNodeDestructive(request, task, unwrapThenable(node), childIndex)
|
|---|
| 5095 | );
|
|---|
| 5096 | if (node.$$typeof === REACT_CONTEXT_TYPE)
|
|---|
| 5097 | return renderNodeDestructive(
|
|---|
| 5098 | request,
|
|---|
| 5099 | task,
|
|---|
| 5100 | node._currentValue,
|
|---|
| 5101 | childIndex
|
|---|
| 5102 | );
|
|---|
| 5103 | childIndex = Object.prototype.toString.call(node);
|
|---|
| 5104 | throw Error(
|
|---|
| 5105 | "Objects are not valid as a React child (found: " +
|
|---|
| 5106 | ("[object Object]" === childIndex
|
|---|
| 5107 | ? "object with keys {" + Object.keys(node).join(", ") + "}"
|
|---|
| 5108 | : childIndex) +
|
|---|
| 5109 | "). If you meant to render a collection of children, use an array instead."
|
|---|
| 5110 | );
|
|---|
| 5111 | }
|
|---|
| 5112 | if ("string" === typeof node)
|
|---|
| 5113 | (childIndex = task.blockedSegment),
|
|---|
| 5114 | null !== childIndex &&
|
|---|
| 5115 | (childIndex.lastPushedText = pushTextInstance(
|
|---|
| 5116 | childIndex.chunks,
|
|---|
| 5117 | node,
|
|---|
| 5118 | request.renderState,
|
|---|
| 5119 | childIndex.lastPushedText
|
|---|
| 5120 | ));
|
|---|
| 5121 | else if ("number" === typeof node || "bigint" === typeof node)
|
|---|
| 5122 | (childIndex = task.blockedSegment),
|
|---|
| 5123 | null !== childIndex &&
|
|---|
| 5124 | (childIndex.lastPushedText = pushTextInstance(
|
|---|
| 5125 | childIndex.chunks,
|
|---|
| 5126 | "" + node,
|
|---|
| 5127 | request.renderState,
|
|---|
| 5128 | childIndex.lastPushedText
|
|---|
| 5129 | ));
|
|---|
| 5130 | }
|
|---|
| 5131 | }
|
|---|
| 5132 | function renderChildrenArray(request, task, children, childIndex) {
|
|---|
| 5133 | var prevKeyPath = task.keyPath;
|
|---|
| 5134 | if (
|
|---|
| 5135 | -1 !== childIndex &&
|
|---|
| 5136 | ((task.keyPath = [task.keyPath, "Fragment", childIndex]),
|
|---|
| 5137 | null !== task.replay)
|
|---|
| 5138 | ) {
|
|---|
| 5139 | for (
|
|---|
| 5140 | var replay = task.replay, replayNodes = replay.nodes, j = 0;
|
|---|
| 5141 | j < replayNodes.length;
|
|---|
| 5142 | j++
|
|---|
| 5143 | ) {
|
|---|
| 5144 | var node = replayNodes[j];
|
|---|
| 5145 | if (node[1] === childIndex) {
|
|---|
| 5146 | childIndex = node[2];
|
|---|
| 5147 | node = node[3];
|
|---|
| 5148 | task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 };
|
|---|
| 5149 | try {
|
|---|
| 5150 | renderChildrenArray(request, task, children, -1);
|
|---|
| 5151 | if (1 === task.replay.pendingTasks && 0 < task.replay.nodes.length)
|
|---|
| 5152 | throw Error(
|
|---|
| 5153 | "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 5154 | );
|
|---|
| 5155 | task.replay.pendingTasks--;
|
|---|
| 5156 | } catch (x) {
|
|---|
| 5157 | if (
|
|---|
| 5158 | "object" === typeof x &&
|
|---|
| 5159 | null !== x &&
|
|---|
| 5160 | (x === SuspenseException || "function" === typeof x.then)
|
|---|
| 5161 | )
|
|---|
| 5162 | throw x;
|
|---|
| 5163 | task.replay.pendingTasks--;
|
|---|
| 5164 | children = getThrownInfo(task.componentStack);
|
|---|
| 5165 | var boundary = task.blockedBoundary,
|
|---|
| 5166 | error = x;
|
|---|
| 5167 | children = logRecoverableError(request, error, children);
|
|---|
| 5168 | abortRemainingReplayNodes(
|
|---|
| 5169 | request,
|
|---|
| 5170 | boundary,
|
|---|
| 5171 | childIndex,
|
|---|
| 5172 | node,
|
|---|
| 5173 | error,
|
|---|
| 5174 | children
|
|---|
| 5175 | );
|
|---|
| 5176 | }
|
|---|
| 5177 | task.replay = replay;
|
|---|
| 5178 | replayNodes.splice(j, 1);
|
|---|
| 5179 | break;
|
|---|
| 5180 | }
|
|---|
| 5181 | }
|
|---|
| 5182 | task.keyPath = prevKeyPath;
|
|---|
| 5183 | return;
|
|---|
| 5184 | }
|
|---|
| 5185 | replay = task.treeContext;
|
|---|
| 5186 | replayNodes = children.length;
|
|---|
| 5187 | if (
|
|---|
| 5188 | null !== task.replay &&
|
|---|
| 5189 | ((j = task.replay.slots), null !== j && "object" === typeof j)
|
|---|
| 5190 | ) {
|
|---|
| 5191 | for (childIndex = 0; childIndex < replayNodes; childIndex++)
|
|---|
| 5192 | (node = children[childIndex]),
|
|---|
| 5193 | (task.treeContext = pushTreeContext(replay, replayNodes, childIndex)),
|
|---|
| 5194 | (boundary = j[childIndex]),
|
|---|
| 5195 | "number" === typeof boundary
|
|---|
| 5196 | ? (resumeNode(request, task, boundary, node, childIndex),
|
|---|
| 5197 | delete j[childIndex])
|
|---|
| 5198 | : renderNode(request, task, node, childIndex);
|
|---|
| 5199 | task.treeContext = replay;
|
|---|
| 5200 | task.keyPath = prevKeyPath;
|
|---|
| 5201 | return;
|
|---|
| 5202 | }
|
|---|
| 5203 | for (j = 0; j < replayNodes; j++)
|
|---|
| 5204 | (childIndex = children[j]),
|
|---|
| 5205 | (task.treeContext = pushTreeContext(replay, replayNodes, j)),
|
|---|
| 5206 | renderNode(request, task, childIndex, j);
|
|---|
| 5207 | task.treeContext = replay;
|
|---|
| 5208 | task.keyPath = prevKeyPath;
|
|---|
| 5209 | }
|
|---|
| 5210 | function trackPostponedBoundary(request, trackedPostpones, boundary) {
|
|---|
| 5211 | boundary.status = 5;
|
|---|
| 5212 | boundary.rootSegmentID = request.nextSegmentId++;
|
|---|
| 5213 | request = boundary.trackedContentKeyPath;
|
|---|
| 5214 | if (null === request)
|
|---|
| 5215 | throw Error(
|
|---|
| 5216 | "It should not be possible to postpone at the root. This is a bug in React."
|
|---|
| 5217 | );
|
|---|
| 5218 | var fallbackReplayNode = boundary.trackedFallbackNode,
|
|---|
| 5219 | children = [],
|
|---|
| 5220 | boundaryNode = trackedPostpones.workingMap.get(request);
|
|---|
| 5221 | if (void 0 === boundaryNode)
|
|---|
| 5222 | return (
|
|---|
| 5223 | (boundary = [
|
|---|
| 5224 | request[1],
|
|---|
| 5225 | request[2],
|
|---|
| 5226 | children,
|
|---|
| 5227 | null,
|
|---|
| 5228 | fallbackReplayNode,
|
|---|
| 5229 | boundary.rootSegmentID
|
|---|
| 5230 | ]),
|
|---|
| 5231 | trackedPostpones.workingMap.set(request, boundary),
|
|---|
| 5232 | addToReplayParent(boundary, request[0], trackedPostpones),
|
|---|
| 5233 | boundary
|
|---|
| 5234 | );
|
|---|
| 5235 | boundaryNode[4] = fallbackReplayNode;
|
|---|
| 5236 | boundaryNode[5] = boundary.rootSegmentID;
|
|---|
| 5237 | return boundaryNode;
|
|---|
| 5238 | }
|
|---|
| 5239 | function trackPostpone(request, trackedPostpones, task, segment) {
|
|---|
| 5240 | segment.status = 5;
|
|---|
| 5241 | var keyPath = task.keyPath,
|
|---|
| 5242 | boundary = task.blockedBoundary;
|
|---|
| 5243 | if (null === boundary)
|
|---|
| 5244 | (segment.id = request.nextSegmentId++),
|
|---|
| 5245 | (trackedPostpones.rootSlots = segment.id),
|
|---|
| 5246 | null !== request.completedRootSegment &&
|
|---|
| 5247 | (request.completedRootSegment.status = 5);
|
|---|
| 5248 | else {
|
|---|
| 5249 | if (null !== boundary && 0 === boundary.status) {
|
|---|
| 5250 | var boundaryNode = trackPostponedBoundary(
|
|---|
| 5251 | request,
|
|---|
| 5252 | trackedPostpones,
|
|---|
| 5253 | boundary
|
|---|
| 5254 | );
|
|---|
| 5255 | if (
|
|---|
| 5256 | boundary.trackedContentKeyPath === keyPath &&
|
|---|
| 5257 | -1 === task.childIndex
|
|---|
| 5258 | ) {
|
|---|
| 5259 | -1 === segment.id &&
|
|---|
| 5260 | (segment.id = segment.parentFlushed
|
|---|
| 5261 | ? boundary.rootSegmentID
|
|---|
| 5262 | : request.nextSegmentId++);
|
|---|
| 5263 | boundaryNode[3] = segment.id;
|
|---|
| 5264 | return;
|
|---|
| 5265 | }
|
|---|
| 5266 | }
|
|---|
| 5267 | -1 === segment.id &&
|
|---|
| 5268 | (segment.id =
|
|---|
| 5269 | segment.parentFlushed && null !== boundary
|
|---|
| 5270 | ? boundary.rootSegmentID
|
|---|
| 5271 | : request.nextSegmentId++);
|
|---|
| 5272 | if (-1 === task.childIndex)
|
|---|
| 5273 | null === keyPath
|
|---|
| 5274 | ? (trackedPostpones.rootSlots = segment.id)
|
|---|
| 5275 | : ((task = trackedPostpones.workingMap.get(keyPath)),
|
|---|
| 5276 | void 0 === task
|
|---|
| 5277 | ? ((task = [keyPath[1], keyPath[2], [], segment.id]),
|
|---|
| 5278 | addToReplayParent(task, keyPath[0], trackedPostpones))
|
|---|
| 5279 | : (task[3] = segment.id));
|
|---|
| 5280 | else {
|
|---|
| 5281 | if (null === keyPath)
|
|---|
| 5282 | if (((request = trackedPostpones.rootSlots), null === request))
|
|---|
| 5283 | request = trackedPostpones.rootSlots = {};
|
|---|
| 5284 | else {
|
|---|
| 5285 | if ("number" === typeof request)
|
|---|
| 5286 | throw Error(
|
|---|
| 5287 | "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."
|
|---|
| 5288 | );
|
|---|
| 5289 | }
|
|---|
| 5290 | else if (
|
|---|
| 5291 | ((boundary = trackedPostpones.workingMap),
|
|---|
| 5292 | (boundaryNode = boundary.get(keyPath)),
|
|---|
| 5293 | void 0 === boundaryNode)
|
|---|
| 5294 | )
|
|---|
| 5295 | (request = {}),
|
|---|
| 5296 | (boundaryNode = [keyPath[1], keyPath[2], [], request]),
|
|---|
| 5297 | boundary.set(keyPath, boundaryNode),
|
|---|
| 5298 | addToReplayParent(boundaryNode, keyPath[0], trackedPostpones);
|
|---|
| 5299 | else if (((request = boundaryNode[3]), null === request))
|
|---|
| 5300 | request = boundaryNode[3] = {};
|
|---|
| 5301 | else if ("number" === typeof request)
|
|---|
| 5302 | throw Error(
|
|---|
| 5303 | "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."
|
|---|
| 5304 | );
|
|---|
| 5305 | request[task.childIndex] = segment.id;
|
|---|
| 5306 | }
|
|---|
| 5307 | }
|
|---|
| 5308 | }
|
|---|
| 5309 | function untrackBoundary(request, boundary) {
|
|---|
| 5310 | request = request.trackedPostpones;
|
|---|
| 5311 | null !== request &&
|
|---|
| 5312 | ((boundary = boundary.trackedContentKeyPath),
|
|---|
| 5313 | null !== boundary &&
|
|---|
| 5314 | ((boundary = request.workingMap.get(boundary)),
|
|---|
| 5315 | void 0 !== boundary &&
|
|---|
| 5316 | ((boundary.length = 4), (boundary[2] = []), (boundary[3] = null))));
|
|---|
| 5317 | }
|
|---|
| 5318 | function spawnNewSuspendedReplayTask(request, task, thenableState) {
|
|---|
| 5319 | return createReplayTask(
|
|---|
| 5320 | request,
|
|---|
| 5321 | thenableState,
|
|---|
| 5322 | task.replay,
|
|---|
| 5323 | task.node,
|
|---|
| 5324 | task.childIndex,
|
|---|
| 5325 | task.blockedBoundary,
|
|---|
| 5326 | task.hoistableState,
|
|---|
| 5327 | task.abortSet,
|
|---|
| 5328 | task.keyPath,
|
|---|
| 5329 | task.formatContext,
|
|---|
| 5330 | task.context,
|
|---|
| 5331 | task.treeContext,
|
|---|
| 5332 | task.row,
|
|---|
| 5333 | task.componentStack
|
|---|
| 5334 | );
|
|---|
| 5335 | }
|
|---|
| 5336 | function spawnNewSuspendedRenderTask(request, task, thenableState) {
|
|---|
| 5337 | var segment = task.blockedSegment,
|
|---|
| 5338 | newSegment = createPendingSegment(
|
|---|
| 5339 | request,
|
|---|
| 5340 | segment.chunks.length,
|
|---|
| 5341 | null,
|
|---|
| 5342 | task.formatContext,
|
|---|
| 5343 | segment.lastPushedText,
|
|---|
| 5344 | !0
|
|---|
| 5345 | );
|
|---|
| 5346 | segment.children.push(newSegment);
|
|---|
| 5347 | segment.lastPushedText = !1;
|
|---|
| 5348 | return createRenderTask(
|
|---|
| 5349 | request,
|
|---|
| 5350 | thenableState,
|
|---|
| 5351 | task.node,
|
|---|
| 5352 | task.childIndex,
|
|---|
| 5353 | task.blockedBoundary,
|
|---|
| 5354 | newSegment,
|
|---|
| 5355 | task.blockedPreamble,
|
|---|
| 5356 | task.hoistableState,
|
|---|
| 5357 | task.abortSet,
|
|---|
| 5358 | task.keyPath,
|
|---|
| 5359 | task.formatContext,
|
|---|
| 5360 | task.context,
|
|---|
| 5361 | task.treeContext,
|
|---|
| 5362 | task.row,
|
|---|
| 5363 | task.componentStack
|
|---|
| 5364 | );
|
|---|
| 5365 | }
|
|---|
| 5366 | function renderNode(request, task, node, childIndex) {
|
|---|
| 5367 | var previousFormatContext = task.formatContext,
|
|---|
| 5368 | previousContext = task.context,
|
|---|
| 5369 | previousKeyPath = task.keyPath,
|
|---|
| 5370 | previousTreeContext = task.treeContext,
|
|---|
| 5371 | previousComponentStack = task.componentStack,
|
|---|
| 5372 | segment = task.blockedSegment;
|
|---|
| 5373 | if (null === segment) {
|
|---|
| 5374 | segment = task.replay;
|
|---|
| 5375 | try {
|
|---|
| 5376 | return renderNodeDestructive(request, task, node, childIndex);
|
|---|
| 5377 | } catch (thrownValue) {
|
|---|
| 5378 | if (
|
|---|
| 5379 | (resetHooksState(),
|
|---|
| 5380 | (node =
|
|---|
| 5381 | thrownValue === SuspenseException
|
|---|
| 5382 | ? getSuspendedThenable()
|
|---|
| 5383 | : thrownValue),
|
|---|
| 5384 | 12 !== request.status && "object" === typeof node && null !== node)
|
|---|
| 5385 | ) {
|
|---|
| 5386 | if ("function" === typeof node.then) {
|
|---|
| 5387 | childIndex =
|
|---|
| 5388 | thrownValue === SuspenseException
|
|---|
| 5389 | ? getThenableStateAfterSuspending()
|
|---|
| 5390 | : null;
|
|---|
| 5391 | request = spawnNewSuspendedReplayTask(request, task, childIndex).ping;
|
|---|
| 5392 | node.then(request, request);
|
|---|
| 5393 | task.formatContext = previousFormatContext;
|
|---|
| 5394 | task.context = previousContext;
|
|---|
| 5395 | task.keyPath = previousKeyPath;
|
|---|
| 5396 | task.treeContext = previousTreeContext;
|
|---|
| 5397 | task.componentStack = previousComponentStack;
|
|---|
| 5398 | task.replay = segment;
|
|---|
| 5399 | switchContext(previousContext);
|
|---|
| 5400 | return;
|
|---|
| 5401 | }
|
|---|
| 5402 | if ("Maximum call stack size exceeded" === node.message) {
|
|---|
| 5403 | node =
|
|---|
| 5404 | thrownValue === SuspenseException
|
|---|
| 5405 | ? getThenableStateAfterSuspending()
|
|---|
| 5406 | : null;
|
|---|
| 5407 | node = spawnNewSuspendedReplayTask(request, task, node);
|
|---|
| 5408 | request.pingedTasks.push(node);
|
|---|
| 5409 | task.formatContext = previousFormatContext;
|
|---|
| 5410 | task.context = previousContext;
|
|---|
| 5411 | task.keyPath = previousKeyPath;
|
|---|
| 5412 | task.treeContext = previousTreeContext;
|
|---|
| 5413 | task.componentStack = previousComponentStack;
|
|---|
| 5414 | task.replay = segment;
|
|---|
| 5415 | switchContext(previousContext);
|
|---|
| 5416 | return;
|
|---|
| 5417 | }
|
|---|
| 5418 | }
|
|---|
| 5419 | }
|
|---|
| 5420 | } else {
|
|---|
| 5421 | var childrenLength = segment.children.length,
|
|---|
| 5422 | chunkLength = segment.chunks.length;
|
|---|
| 5423 | try {
|
|---|
| 5424 | return renderNodeDestructive(request, task, node, childIndex);
|
|---|
| 5425 | } catch (thrownValue$62) {
|
|---|
| 5426 | if (
|
|---|
| 5427 | (resetHooksState(),
|
|---|
| 5428 | (segment.children.length = childrenLength),
|
|---|
| 5429 | (segment.chunks.length = chunkLength),
|
|---|
| 5430 | (node =
|
|---|
| 5431 | thrownValue$62 === SuspenseException
|
|---|
| 5432 | ? getSuspendedThenable()
|
|---|
| 5433 | : thrownValue$62),
|
|---|
| 5434 | 12 !== request.status && "object" === typeof node && null !== node)
|
|---|
| 5435 | ) {
|
|---|
| 5436 | if ("function" === typeof node.then) {
|
|---|
| 5437 | segment = node;
|
|---|
| 5438 | node =
|
|---|
| 5439 | thrownValue$62 === SuspenseException
|
|---|
| 5440 | ? getThenableStateAfterSuspending()
|
|---|
| 5441 | : null;
|
|---|
| 5442 | request = spawnNewSuspendedRenderTask(request, task, node).ping;
|
|---|
| 5443 | segment.then(request, request);
|
|---|
| 5444 | task.formatContext = previousFormatContext;
|
|---|
| 5445 | task.context = previousContext;
|
|---|
| 5446 | task.keyPath = previousKeyPath;
|
|---|
| 5447 | task.treeContext = previousTreeContext;
|
|---|
| 5448 | task.componentStack = previousComponentStack;
|
|---|
| 5449 | switchContext(previousContext);
|
|---|
| 5450 | return;
|
|---|
| 5451 | }
|
|---|
| 5452 | if ("Maximum call stack size exceeded" === node.message) {
|
|---|
| 5453 | segment =
|
|---|
| 5454 | thrownValue$62 === SuspenseException
|
|---|
| 5455 | ? getThenableStateAfterSuspending()
|
|---|
| 5456 | : null;
|
|---|
| 5457 | segment = spawnNewSuspendedRenderTask(request, task, segment);
|
|---|
| 5458 | request.pingedTasks.push(segment);
|
|---|
| 5459 | task.formatContext = previousFormatContext;
|
|---|
| 5460 | task.context = previousContext;
|
|---|
| 5461 | task.keyPath = previousKeyPath;
|
|---|
| 5462 | task.treeContext = previousTreeContext;
|
|---|
| 5463 | task.componentStack = previousComponentStack;
|
|---|
| 5464 | switchContext(previousContext);
|
|---|
| 5465 | return;
|
|---|
| 5466 | }
|
|---|
| 5467 | }
|
|---|
| 5468 | }
|
|---|
| 5469 | }
|
|---|
| 5470 | task.formatContext = previousFormatContext;
|
|---|
| 5471 | task.context = previousContext;
|
|---|
| 5472 | task.keyPath = previousKeyPath;
|
|---|
| 5473 | task.treeContext = previousTreeContext;
|
|---|
| 5474 | switchContext(previousContext);
|
|---|
| 5475 | throw node;
|
|---|
| 5476 | }
|
|---|
| 5477 | function abortTaskSoft(task) {
|
|---|
| 5478 | var boundary = task.blockedBoundary,
|
|---|
| 5479 | segment = task.blockedSegment;
|
|---|
| 5480 | null !== segment &&
|
|---|
| 5481 | ((segment.status = 3), finishedTask(this, boundary, task.row, segment));
|
|---|
| 5482 | }
|
|---|
| 5483 | function abortRemainingReplayNodes(
|
|---|
| 5484 | request$jscomp$0,
|
|---|
| 5485 | boundary,
|
|---|
| 5486 | nodes,
|
|---|
| 5487 | slots,
|
|---|
| 5488 | error,
|
|---|
| 5489 | errorDigest$jscomp$0
|
|---|
| 5490 | ) {
|
|---|
| 5491 | for (var i = 0; i < nodes.length; i++) {
|
|---|
| 5492 | var node = nodes[i];
|
|---|
| 5493 | if (4 === node.length)
|
|---|
| 5494 | abortRemainingReplayNodes(
|
|---|
| 5495 | request$jscomp$0,
|
|---|
| 5496 | boundary,
|
|---|
| 5497 | node[2],
|
|---|
| 5498 | node[3],
|
|---|
| 5499 | error,
|
|---|
| 5500 | errorDigest$jscomp$0
|
|---|
| 5501 | );
|
|---|
| 5502 | else {
|
|---|
| 5503 | node = node[5];
|
|---|
| 5504 | var request = request$jscomp$0,
|
|---|
| 5505 | errorDigest = errorDigest$jscomp$0,
|
|---|
| 5506 | resumedBoundary = createSuspenseBoundary(
|
|---|
| 5507 | request,
|
|---|
| 5508 | null,
|
|---|
| 5509 | new Set(),
|
|---|
| 5510 | null,
|
|---|
| 5511 | null
|
|---|
| 5512 | );
|
|---|
| 5513 | resumedBoundary.parentFlushed = !0;
|
|---|
| 5514 | resumedBoundary.rootSegmentID = node;
|
|---|
| 5515 | resumedBoundary.status = 4;
|
|---|
| 5516 | resumedBoundary.errorDigest = errorDigest;
|
|---|
| 5517 | resumedBoundary.parentFlushed &&
|
|---|
| 5518 | request.clientRenderedBoundaries.push(resumedBoundary);
|
|---|
| 5519 | }
|
|---|
| 5520 | }
|
|---|
| 5521 | nodes.length = 0;
|
|---|
| 5522 | if (null !== slots) {
|
|---|
| 5523 | if (null === boundary)
|
|---|
| 5524 | throw Error(
|
|---|
| 5525 | "We should not have any resumable nodes in the shell. This is a bug in React."
|
|---|
| 5526 | );
|
|---|
| 5527 | 4 !== boundary.status &&
|
|---|
| 5528 | ((boundary.status = 4),
|
|---|
| 5529 | (boundary.errorDigest = errorDigest$jscomp$0),
|
|---|
| 5530 | boundary.parentFlushed &&
|
|---|
| 5531 | request$jscomp$0.clientRenderedBoundaries.push(boundary));
|
|---|
| 5532 | if ("object" === typeof slots) for (var index in slots) delete slots[index];
|
|---|
| 5533 | }
|
|---|
| 5534 | }
|
|---|
| 5535 | function abortTask(task, request, error) {
|
|---|
| 5536 | var boundary = task.blockedBoundary,
|
|---|
| 5537 | segment = task.blockedSegment;
|
|---|
| 5538 | if (null !== segment) {
|
|---|
| 5539 | if (6 === segment.status) return;
|
|---|
| 5540 | segment.status = 3;
|
|---|
| 5541 | }
|
|---|
| 5542 | var errorInfo = getThrownInfo(task.componentStack);
|
|---|
| 5543 | if (null === boundary) {
|
|---|
| 5544 | if (13 !== request.status && 14 !== request.status) {
|
|---|
| 5545 | boundary = task.replay;
|
|---|
| 5546 | if (null === boundary) {
|
|---|
| 5547 | null !== request.trackedPostpones && null !== segment
|
|---|
| 5548 | ? ((boundary = request.trackedPostpones),
|
|---|
| 5549 | logRecoverableError(request, error, errorInfo),
|
|---|
| 5550 | trackPostpone(request, boundary, task, segment),
|
|---|
| 5551 | finishedTask(request, null, task.row, segment))
|
|---|
| 5552 | : (logRecoverableError(request, error, errorInfo),
|
|---|
| 5553 | fatalError(request, error));
|
|---|
| 5554 | return;
|
|---|
| 5555 | }
|
|---|
| 5556 | boundary.pendingTasks--;
|
|---|
| 5557 | 0 === boundary.pendingTasks &&
|
|---|
| 5558 | 0 < boundary.nodes.length &&
|
|---|
| 5559 | ((segment = logRecoverableError(request, error, errorInfo)),
|
|---|
| 5560 | abortRemainingReplayNodes(
|
|---|
| 5561 | request,
|
|---|
| 5562 | null,
|
|---|
| 5563 | boundary.nodes,
|
|---|
| 5564 | boundary.slots,
|
|---|
| 5565 | error,
|
|---|
| 5566 | segment
|
|---|
| 5567 | ));
|
|---|
| 5568 | request.pendingRootTasks--;
|
|---|
| 5569 | 0 === request.pendingRootTasks && completeShell(request);
|
|---|
| 5570 | }
|
|---|
| 5571 | } else {
|
|---|
| 5572 | var trackedPostpones$63 = request.trackedPostpones;
|
|---|
| 5573 | if (4 !== boundary.status) {
|
|---|
| 5574 | if (null !== trackedPostpones$63 && null !== segment)
|
|---|
| 5575 | return (
|
|---|
| 5576 | logRecoverableError(request, error, errorInfo),
|
|---|
| 5577 | trackPostpone(request, trackedPostpones$63, task, segment),
|
|---|
| 5578 | boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
|
|---|
| 5579 | return abortTask(fallbackTask, request, error);
|
|---|
| 5580 | }),
|
|---|
| 5581 | boundary.fallbackAbortableTasks.clear(),
|
|---|
| 5582 | finishedTask(request, boundary, task.row, segment)
|
|---|
| 5583 | );
|
|---|
| 5584 | boundary.status = 4;
|
|---|
| 5585 | segment = logRecoverableError(request, error, errorInfo);
|
|---|
| 5586 | boundary.status = 4;
|
|---|
| 5587 | boundary.errorDigest = segment;
|
|---|
| 5588 | untrackBoundary(request, boundary);
|
|---|
| 5589 | boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary);
|
|---|
| 5590 | }
|
|---|
| 5591 | boundary.pendingTasks--;
|
|---|
| 5592 | segment = boundary.row;
|
|---|
| 5593 | null !== segment &&
|
|---|
| 5594 | 0 === --segment.pendingTasks &&
|
|---|
| 5595 | finishSuspenseListRow(request, segment);
|
|---|
| 5596 | boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {
|
|---|
| 5597 | return abortTask(fallbackTask, request, error);
|
|---|
| 5598 | });
|
|---|
| 5599 | boundary.fallbackAbortableTasks.clear();
|
|---|
| 5600 | }
|
|---|
| 5601 | task = task.row;
|
|---|
| 5602 | null !== task &&
|
|---|
| 5603 | 0 === --task.pendingTasks &&
|
|---|
| 5604 | finishSuspenseListRow(request, task);
|
|---|
| 5605 | request.allPendingTasks--;
|
|---|
| 5606 | 0 === request.allPendingTasks && completeAll(request);
|
|---|
| 5607 | }
|
|---|
| 5608 | function safelyEmitEarlyPreloads(request, shellComplete) {
|
|---|
| 5609 | try {
|
|---|
| 5610 | var renderState = request.renderState,
|
|---|
| 5611 | onHeaders = renderState.onHeaders;
|
|---|
| 5612 | if (onHeaders) {
|
|---|
| 5613 | var headers = renderState.headers;
|
|---|
| 5614 | if (headers) {
|
|---|
| 5615 | renderState.headers = null;
|
|---|
| 5616 | var linkHeader = headers.preconnects;
|
|---|
| 5617 | headers.fontPreloads &&
|
|---|
| 5618 | (linkHeader && (linkHeader += ", "),
|
|---|
| 5619 | (linkHeader += headers.fontPreloads));
|
|---|
| 5620 | headers.highImagePreloads &&
|
|---|
| 5621 | (linkHeader && (linkHeader += ", "),
|
|---|
| 5622 | (linkHeader += headers.highImagePreloads));
|
|---|
| 5623 | if (!shellComplete) {
|
|---|
| 5624 | var queueIter = renderState.styles.values(),
|
|---|
| 5625 | queueStep = queueIter.next();
|
|---|
| 5626 | b: for (
|
|---|
| 5627 | ;
|
|---|
| 5628 | 0 < headers.remainingCapacity && !queueStep.done;
|
|---|
| 5629 | queueStep = queueIter.next()
|
|---|
| 5630 | )
|
|---|
| 5631 | for (
|
|---|
| 5632 | var sheetIter = queueStep.value.sheets.values(),
|
|---|
| 5633 | sheetStep = sheetIter.next();
|
|---|
| 5634 | 0 < headers.remainingCapacity && !sheetStep.done;
|
|---|
| 5635 | sheetStep = sheetIter.next()
|
|---|
| 5636 | ) {
|
|---|
| 5637 | var sheet = sheetStep.value,
|
|---|
| 5638 | props = sheet.props,
|
|---|
| 5639 | key = props.href,
|
|---|
| 5640 | props$jscomp$0 = sheet.props,
|
|---|
| 5641 | header = getPreloadAsHeader(props$jscomp$0.href, "style", {
|
|---|
| 5642 | crossOrigin: props$jscomp$0.crossOrigin,
|
|---|
| 5643 | integrity: props$jscomp$0.integrity,
|
|---|
| 5644 | nonce: props$jscomp$0.nonce,
|
|---|
| 5645 | type: props$jscomp$0.type,
|
|---|
| 5646 | fetchPriority: props$jscomp$0.fetchPriority,
|
|---|
| 5647 | referrerPolicy: props$jscomp$0.referrerPolicy,
|
|---|
| 5648 | media: props$jscomp$0.media
|
|---|
| 5649 | });
|
|---|
| 5650 | if (0 <= (headers.remainingCapacity -= header.length + 2))
|
|---|
| 5651 | (renderState.resets.style[key] = PRELOAD_NO_CREDS),
|
|---|
| 5652 | linkHeader && (linkHeader += ", "),
|
|---|
| 5653 | (linkHeader += header),
|
|---|
| 5654 | (renderState.resets.style[key] =
|
|---|
| 5655 | "string" === typeof props.crossOrigin ||
|
|---|
| 5656 | "string" === typeof props.integrity
|
|---|
| 5657 | ? [props.crossOrigin, props.integrity]
|
|---|
| 5658 | : PRELOAD_NO_CREDS);
|
|---|
| 5659 | else break b;
|
|---|
| 5660 | }
|
|---|
| 5661 | }
|
|---|
| 5662 | linkHeader ? onHeaders({ Link: linkHeader }) : onHeaders({});
|
|---|
| 5663 | }
|
|---|
| 5664 | }
|
|---|
| 5665 | } catch (error) {
|
|---|
| 5666 | logRecoverableError(request, error, {});
|
|---|
| 5667 | }
|
|---|
| 5668 | }
|
|---|
| 5669 | function completeShell(request) {
|
|---|
| 5670 | null === request.trackedPostpones && safelyEmitEarlyPreloads(request, !0);
|
|---|
| 5671 | null === request.trackedPostpones && preparePreamble(request);
|
|---|
| 5672 | request.onShellError = noop;
|
|---|
| 5673 | request = request.onShellReady;
|
|---|
| 5674 | request();
|
|---|
| 5675 | }
|
|---|
| 5676 | function completeAll(request) {
|
|---|
| 5677 | safelyEmitEarlyPreloads(
|
|---|
| 5678 | request,
|
|---|
| 5679 | null === request.trackedPostpones
|
|---|
| 5680 | ? !0
|
|---|
| 5681 | : null === request.completedRootSegment ||
|
|---|
| 5682 | 5 !== request.completedRootSegment.status
|
|---|
| 5683 | );
|
|---|
| 5684 | preparePreamble(request);
|
|---|
| 5685 | request = request.onAllReady;
|
|---|
| 5686 | request();
|
|---|
| 5687 | }
|
|---|
| 5688 | function queueCompletedSegment(boundary, segment) {
|
|---|
| 5689 | if (
|
|---|
| 5690 | 0 === segment.chunks.length &&
|
|---|
| 5691 | 1 === segment.children.length &&
|
|---|
| 5692 | null === segment.children[0].boundary &&
|
|---|
| 5693 | -1 === segment.children[0].id
|
|---|
| 5694 | ) {
|
|---|
| 5695 | var childSegment = segment.children[0];
|
|---|
| 5696 | childSegment.id = segment.id;
|
|---|
| 5697 | childSegment.parentFlushed = !0;
|
|---|
| 5698 | (1 !== childSegment.status &&
|
|---|
| 5699 | 3 !== childSegment.status &&
|
|---|
| 5700 | 4 !== childSegment.status) ||
|
|---|
| 5701 | queueCompletedSegment(boundary, childSegment);
|
|---|
| 5702 | } else boundary.completedSegments.push(segment);
|
|---|
| 5703 | }
|
|---|
| 5704 | function finishedSegment(request, boundary, segment) {
|
|---|
| 5705 | if (null !== byteLengthOfChunk) {
|
|---|
| 5706 | segment = segment.chunks;
|
|---|
| 5707 | for (var segmentByteSize = 0, i = 0; i < segment.length; i++)
|
|---|
| 5708 | segmentByteSize += byteLengthOfChunk(segment[i]);
|
|---|
| 5709 | null === boundary
|
|---|
| 5710 | ? (request.byteSize += segmentByteSize)
|
|---|
| 5711 | : (boundary.byteSize += segmentByteSize);
|
|---|
| 5712 | }
|
|---|
| 5713 | }
|
|---|
| 5714 | function finishedTask(request, boundary, row, segment) {
|
|---|
| 5715 | null !== row &&
|
|---|
| 5716 | (0 === --row.pendingTasks
|
|---|
| 5717 | ? finishSuspenseListRow(request, row)
|
|---|
| 5718 | : row.together && tryToResolveTogetherRow(request, row));
|
|---|
| 5719 | request.allPendingTasks--;
|
|---|
| 5720 | if (null === boundary) {
|
|---|
| 5721 | if (null !== segment && segment.parentFlushed) {
|
|---|
| 5722 | if (null !== request.completedRootSegment)
|
|---|
| 5723 | throw Error(
|
|---|
| 5724 | "There can only be one root segment. This is a bug in React."
|
|---|
| 5725 | );
|
|---|
| 5726 | request.completedRootSegment = segment;
|
|---|
| 5727 | }
|
|---|
| 5728 | request.pendingRootTasks--;
|
|---|
| 5729 | 0 === request.pendingRootTasks && completeShell(request);
|
|---|
| 5730 | } else if ((boundary.pendingTasks--, 4 !== boundary.status))
|
|---|
| 5731 | if (0 === boundary.pendingTasks)
|
|---|
| 5732 | if (
|
|---|
| 5733 | (0 === boundary.status && (boundary.status = 1),
|
|---|
| 5734 | null !== segment &&
|
|---|
| 5735 | segment.parentFlushed &&
|
|---|
| 5736 | (1 === segment.status || 3 === segment.status) &&
|
|---|
| 5737 | queueCompletedSegment(boundary, segment),
|
|---|
| 5738 | boundary.parentFlushed && request.completedBoundaries.push(boundary),
|
|---|
| 5739 | 1 === boundary.status)
|
|---|
| 5740 | )
|
|---|
| 5741 | (row = boundary.row),
|
|---|
| 5742 | null !== row &&
|
|---|
| 5743 | hoistHoistables(row.hoistables, boundary.contentState),
|
|---|
| 5744 | isEligibleForOutlining(request, boundary) ||
|
|---|
| 5745 | (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
|
|---|
| 5746 | boundary.fallbackAbortableTasks.clear(),
|
|---|
| 5747 | null !== row &&
|
|---|
| 5748 | 0 === --row.pendingTasks &&
|
|---|
| 5749 | finishSuspenseListRow(request, row)),
|
|---|
| 5750 | 0 === request.pendingRootTasks &&
|
|---|
| 5751 | null === request.trackedPostpones &&
|
|---|
| 5752 | null !== boundary.contentPreamble &&
|
|---|
| 5753 | preparePreamble(request);
|
|---|
| 5754 | else {
|
|---|
| 5755 | if (
|
|---|
| 5756 | 5 === boundary.status &&
|
|---|
| 5757 | ((boundary = boundary.row), null !== boundary)
|
|---|
| 5758 | ) {
|
|---|
| 5759 | if (null !== request.trackedPostpones) {
|
|---|
| 5760 | row = request.trackedPostpones;
|
|---|
| 5761 | var postponedRow = boundary.next;
|
|---|
| 5762 | if (
|
|---|
| 5763 | null !== postponedRow &&
|
|---|
| 5764 | ((segment = postponedRow.boundaries), null !== segment)
|
|---|
| 5765 | )
|
|---|
| 5766 | for (
|
|---|
| 5767 | postponedRow.boundaries = null, postponedRow = 0;
|
|---|
| 5768 | postponedRow < segment.length;
|
|---|
| 5769 | postponedRow++
|
|---|
| 5770 | ) {
|
|---|
| 5771 | var postponedBoundary = segment[postponedRow];
|
|---|
| 5772 | trackPostponedBoundary(request, row, postponedBoundary);
|
|---|
| 5773 | finishedTask(request, postponedBoundary, null, null);
|
|---|
| 5774 | }
|
|---|
| 5775 | }
|
|---|
| 5776 | 0 === --boundary.pendingTasks &&
|
|---|
| 5777 | finishSuspenseListRow(request, boundary);
|
|---|
| 5778 | }
|
|---|
| 5779 | }
|
|---|
| 5780 | else
|
|---|
| 5781 | null === segment ||
|
|---|
| 5782 | !segment.parentFlushed ||
|
|---|
| 5783 | (1 !== segment.status && 3 !== segment.status) ||
|
|---|
| 5784 | (queueCompletedSegment(boundary, segment),
|
|---|
| 5785 | 1 === boundary.completedSegments.length &&
|
|---|
| 5786 | boundary.parentFlushed &&
|
|---|
| 5787 | request.partialBoundaries.push(boundary)),
|
|---|
| 5788 | (boundary = boundary.row),
|
|---|
| 5789 | null !== boundary &&
|
|---|
| 5790 | boundary.together &&
|
|---|
| 5791 | tryToResolveTogetherRow(request, boundary);
|
|---|
| 5792 | 0 === request.allPendingTasks && completeAll(request);
|
|---|
| 5793 | }
|
|---|
| 5794 | function performWork(request$jscomp$2) {
|
|---|
| 5795 | if (14 !== request$jscomp$2.status && 13 !== request$jscomp$2.status) {
|
|---|
| 5796 | var prevContext = currentActiveSnapshot,
|
|---|
| 5797 | prevDispatcher = ReactSharedInternals.H;
|
|---|
| 5798 | ReactSharedInternals.H = HooksDispatcher;
|
|---|
| 5799 | var prevAsyncDispatcher = ReactSharedInternals.A;
|
|---|
| 5800 | ReactSharedInternals.A = DefaultAsyncDispatcher;
|
|---|
| 5801 | var prevRequest = currentRequest;
|
|---|
| 5802 | currentRequest = request$jscomp$2;
|
|---|
| 5803 | var prevResumableState = currentResumableState;
|
|---|
| 5804 | currentResumableState = request$jscomp$2.resumableState;
|
|---|
| 5805 | try {
|
|---|
| 5806 | var pingedTasks = request$jscomp$2.pingedTasks,
|
|---|
| 5807 | i;
|
|---|
| 5808 | for (i = 0; i < pingedTasks.length; i++) {
|
|---|
| 5809 | var task = pingedTasks[i],
|
|---|
| 5810 | request = request$jscomp$2,
|
|---|
| 5811 | segment = task.blockedSegment;
|
|---|
| 5812 | if (null === segment) {
|
|---|
| 5813 | var request$jscomp$0 = request;
|
|---|
| 5814 | if (0 !== task.replay.pendingTasks) {
|
|---|
| 5815 | switchContext(task.context);
|
|---|
| 5816 | try {
|
|---|
| 5817 | "number" === typeof task.replay.slots
|
|---|
| 5818 | ? resumeNode(
|
|---|
| 5819 | request$jscomp$0,
|
|---|
| 5820 | task,
|
|---|
| 5821 | task.replay.slots,
|
|---|
| 5822 | task.node,
|
|---|
| 5823 | task.childIndex
|
|---|
| 5824 | )
|
|---|
| 5825 | : retryNode(request$jscomp$0, task);
|
|---|
| 5826 | if (
|
|---|
| 5827 | 1 === task.replay.pendingTasks &&
|
|---|
| 5828 | 0 < task.replay.nodes.length
|
|---|
| 5829 | )
|
|---|
| 5830 | throw Error(
|
|---|
| 5831 | "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
|
|---|
| 5832 | );
|
|---|
| 5833 | task.replay.pendingTasks--;
|
|---|
| 5834 | task.abortSet.delete(task);
|
|---|
| 5835 | finishedTask(
|
|---|
| 5836 | request$jscomp$0,
|
|---|
| 5837 | task.blockedBoundary,
|
|---|
| 5838 | task.row,
|
|---|
| 5839 | null
|
|---|
| 5840 | );
|
|---|
| 5841 | } catch (thrownValue) {
|
|---|
| 5842 | resetHooksState();
|
|---|
| 5843 | var x =
|
|---|
| 5844 | thrownValue === SuspenseException
|
|---|
| 5845 | ? getSuspendedThenable()
|
|---|
| 5846 | : thrownValue;
|
|---|
| 5847 | if (
|
|---|
| 5848 | "object" === typeof x &&
|
|---|
| 5849 | null !== x &&
|
|---|
| 5850 | "function" === typeof x.then
|
|---|
| 5851 | ) {
|
|---|
| 5852 | var ping = task.ping;
|
|---|
| 5853 | x.then(ping, ping);
|
|---|
| 5854 | task.thenableState =
|
|---|
| 5855 | thrownValue === SuspenseException
|
|---|
| 5856 | ? getThenableStateAfterSuspending()
|
|---|
| 5857 | : null;
|
|---|
| 5858 | } else {
|
|---|
| 5859 | task.replay.pendingTasks--;
|
|---|
| 5860 | task.abortSet.delete(task);
|
|---|
| 5861 | var errorInfo = getThrownInfo(task.componentStack);
|
|---|
| 5862 | request = void 0;
|
|---|
| 5863 | var request$jscomp$1 = request$jscomp$0,
|
|---|
| 5864 | boundary = task.blockedBoundary,
|
|---|
| 5865 | error$jscomp$0 =
|
|---|
| 5866 | 12 === request$jscomp$0.status
|
|---|
| 5867 | ? request$jscomp$0.fatalError
|
|---|
| 5868 | : x,
|
|---|
| 5869 | replayNodes = task.replay.nodes,
|
|---|
| 5870 | resumeSlots = task.replay.slots;
|
|---|
| 5871 | request = logRecoverableError(
|
|---|
| 5872 | request$jscomp$1,
|
|---|
| 5873 | error$jscomp$0,
|
|---|
| 5874 | errorInfo
|
|---|
| 5875 | );
|
|---|
| 5876 | abortRemainingReplayNodes(
|
|---|
| 5877 | request$jscomp$1,
|
|---|
| 5878 | boundary,
|
|---|
| 5879 | replayNodes,
|
|---|
| 5880 | resumeSlots,
|
|---|
| 5881 | error$jscomp$0,
|
|---|
| 5882 | request
|
|---|
| 5883 | );
|
|---|
| 5884 | request$jscomp$0.pendingRootTasks--;
|
|---|
| 5885 | 0 === request$jscomp$0.pendingRootTasks &&
|
|---|
| 5886 | completeShell(request$jscomp$0);
|
|---|
| 5887 | request$jscomp$0.allPendingTasks--;
|
|---|
| 5888 | 0 === request$jscomp$0.allPendingTasks &&
|
|---|
| 5889 | completeAll(request$jscomp$0);
|
|---|
| 5890 | }
|
|---|
| 5891 | } finally {
|
|---|
| 5892 | }
|
|---|
| 5893 | }
|
|---|
| 5894 | } else if (
|
|---|
| 5895 | ((request$jscomp$0 = void 0),
|
|---|
| 5896 | (request$jscomp$1 = segment),
|
|---|
| 5897 | 0 === request$jscomp$1.status)
|
|---|
| 5898 | ) {
|
|---|
| 5899 | request$jscomp$1.status = 6;
|
|---|
| 5900 | switchContext(task.context);
|
|---|
| 5901 | var childrenLength = request$jscomp$1.children.length,
|
|---|
| 5902 | chunkLength = request$jscomp$1.chunks.length;
|
|---|
| 5903 | try {
|
|---|
| 5904 | retryNode(request, task),
|
|---|
| 5905 | pushSegmentFinale(
|
|---|
| 5906 | request$jscomp$1.chunks,
|
|---|
| 5907 | request.renderState,
|
|---|
| 5908 | request$jscomp$1.lastPushedText,
|
|---|
| 5909 | request$jscomp$1.textEmbedded
|
|---|
| 5910 | ),
|
|---|
| 5911 | task.abortSet.delete(task),
|
|---|
| 5912 | (request$jscomp$1.status = 1),
|
|---|
| 5913 | finishedSegment(request, task.blockedBoundary, request$jscomp$1),
|
|---|
| 5914 | finishedTask(
|
|---|
| 5915 | request,
|
|---|
| 5916 | task.blockedBoundary,
|
|---|
| 5917 | task.row,
|
|---|
| 5918 | request$jscomp$1
|
|---|
| 5919 | );
|
|---|
| 5920 | } catch (thrownValue) {
|
|---|
| 5921 | resetHooksState();
|
|---|
| 5922 | request$jscomp$1.children.length = childrenLength;
|
|---|
| 5923 | request$jscomp$1.chunks.length = chunkLength;
|
|---|
| 5924 | var x$jscomp$0 =
|
|---|
| 5925 | thrownValue === SuspenseException
|
|---|
| 5926 | ? getSuspendedThenable()
|
|---|
| 5927 | : 12 === request.status
|
|---|
| 5928 | ? request.fatalError
|
|---|
| 5929 | : thrownValue;
|
|---|
| 5930 | if (12 === request.status && null !== request.trackedPostpones) {
|
|---|
| 5931 | var trackedPostpones = request.trackedPostpones,
|
|---|
| 5932 | thrownInfo = getThrownInfo(task.componentStack);
|
|---|
| 5933 | task.abortSet.delete(task);
|
|---|
| 5934 | logRecoverableError(request, x$jscomp$0, thrownInfo);
|
|---|
| 5935 | trackPostpone(request, trackedPostpones, task, request$jscomp$1);
|
|---|
| 5936 | finishedTask(
|
|---|
| 5937 | request,
|
|---|
| 5938 | task.blockedBoundary,
|
|---|
| 5939 | task.row,
|
|---|
| 5940 | request$jscomp$1
|
|---|
| 5941 | );
|
|---|
| 5942 | } else if (
|
|---|
| 5943 | "object" === typeof x$jscomp$0 &&
|
|---|
| 5944 | null !== x$jscomp$0 &&
|
|---|
| 5945 | "function" === typeof x$jscomp$0.then
|
|---|
| 5946 | ) {
|
|---|
| 5947 | request$jscomp$1.status = 0;
|
|---|
| 5948 | task.thenableState =
|
|---|
| 5949 | thrownValue === SuspenseException
|
|---|
| 5950 | ? getThenableStateAfterSuspending()
|
|---|
| 5951 | : null;
|
|---|
| 5952 | var ping$jscomp$0 = task.ping;
|
|---|
| 5953 | x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0);
|
|---|
| 5954 | } else {
|
|---|
| 5955 | var errorInfo$jscomp$0 = getThrownInfo(task.componentStack);
|
|---|
| 5956 | task.abortSet.delete(task);
|
|---|
| 5957 | request$jscomp$1.status = 4;
|
|---|
| 5958 | var boundary$jscomp$0 = task.blockedBoundary,
|
|---|
| 5959 | row = task.row;
|
|---|
| 5960 | null !== row &&
|
|---|
| 5961 | 0 === --row.pendingTasks &&
|
|---|
| 5962 | finishSuspenseListRow(request, row);
|
|---|
| 5963 | request.allPendingTasks--;
|
|---|
| 5964 | request$jscomp$0 = logRecoverableError(
|
|---|
| 5965 | request,
|
|---|
| 5966 | x$jscomp$0,
|
|---|
| 5967 | errorInfo$jscomp$0
|
|---|
| 5968 | );
|
|---|
| 5969 | if (null === boundary$jscomp$0) fatalError(request, x$jscomp$0);
|
|---|
| 5970 | else if (
|
|---|
| 5971 | (boundary$jscomp$0.pendingTasks--,
|
|---|
| 5972 | 4 !== boundary$jscomp$0.status)
|
|---|
| 5973 | ) {
|
|---|
| 5974 | boundary$jscomp$0.status = 4;
|
|---|
| 5975 | boundary$jscomp$0.errorDigest = request$jscomp$0;
|
|---|
| 5976 | untrackBoundary(request, boundary$jscomp$0);
|
|---|
| 5977 | var boundaryRow = boundary$jscomp$0.row;
|
|---|
| 5978 | null !== boundaryRow &&
|
|---|
| 5979 | 0 === --boundaryRow.pendingTasks &&
|
|---|
| 5980 | finishSuspenseListRow(request, boundaryRow);
|
|---|
| 5981 | boundary$jscomp$0.parentFlushed &&
|
|---|
| 5982 | request.clientRenderedBoundaries.push(boundary$jscomp$0);
|
|---|
| 5983 | 0 === request.pendingRootTasks &&
|
|---|
| 5984 | null === request.trackedPostpones &&
|
|---|
| 5985 | null !== boundary$jscomp$0.contentPreamble &&
|
|---|
| 5986 | preparePreamble(request);
|
|---|
| 5987 | }
|
|---|
| 5988 | 0 === request.allPendingTasks && completeAll(request);
|
|---|
| 5989 | }
|
|---|
| 5990 | } finally {
|
|---|
| 5991 | }
|
|---|
| 5992 | }
|
|---|
| 5993 | }
|
|---|
| 5994 | pingedTasks.splice(0, i);
|
|---|
| 5995 | null !== request$jscomp$2.destination &&
|
|---|
| 5996 | flushCompletedQueues(request$jscomp$2, request$jscomp$2.destination);
|
|---|
| 5997 | } catch (error) {
|
|---|
| 5998 | logRecoverableError(request$jscomp$2, error, {}),
|
|---|
| 5999 | fatalError(request$jscomp$2, error);
|
|---|
| 6000 | } finally {
|
|---|
| 6001 | (currentResumableState = prevResumableState),
|
|---|
| 6002 | (ReactSharedInternals.H = prevDispatcher),
|
|---|
| 6003 | (ReactSharedInternals.A = prevAsyncDispatcher),
|
|---|
| 6004 | prevDispatcher === HooksDispatcher && switchContext(prevContext),
|
|---|
| 6005 | (currentRequest = prevRequest);
|
|---|
| 6006 | }
|
|---|
| 6007 | }
|
|---|
| 6008 | }
|
|---|
| 6009 | function preparePreambleFromSubtree(
|
|---|
| 6010 | request,
|
|---|
| 6011 | segment,
|
|---|
| 6012 | collectedPreambleSegments
|
|---|
| 6013 | ) {
|
|---|
| 6014 | segment.preambleChildren.length &&
|
|---|
| 6015 | collectedPreambleSegments.push(segment.preambleChildren);
|
|---|
| 6016 | for (var pendingPreambles = !1, i = 0; i < segment.children.length; i++)
|
|---|
| 6017 | pendingPreambles =
|
|---|
| 6018 | preparePreambleFromSegment(
|
|---|
| 6019 | request,
|
|---|
| 6020 | segment.children[i],
|
|---|
| 6021 | collectedPreambleSegments
|
|---|
| 6022 | ) || pendingPreambles;
|
|---|
| 6023 | return pendingPreambles;
|
|---|
| 6024 | }
|
|---|
| 6025 | function preparePreambleFromSegment(
|
|---|
| 6026 | request,
|
|---|
| 6027 | segment,
|
|---|
| 6028 | collectedPreambleSegments
|
|---|
| 6029 | ) {
|
|---|
| 6030 | var boundary = segment.boundary;
|
|---|
| 6031 | if (null === boundary)
|
|---|
| 6032 | return preparePreambleFromSubtree(
|
|---|
| 6033 | request,
|
|---|
| 6034 | segment,
|
|---|
| 6035 | collectedPreambleSegments
|
|---|
| 6036 | );
|
|---|
| 6037 | var preamble = boundary.contentPreamble,
|
|---|
| 6038 | fallbackPreamble = boundary.fallbackPreamble;
|
|---|
| 6039 | if (null === preamble || null === fallbackPreamble) return !1;
|
|---|
| 6040 | switch (boundary.status) {
|
|---|
| 6041 | case 1:
|
|---|
| 6042 | hoistPreambleState(request.renderState, preamble);
|
|---|
| 6043 | request.byteSize += boundary.byteSize;
|
|---|
| 6044 | segment = boundary.completedSegments[0];
|
|---|
| 6045 | if (!segment)
|
|---|
| 6046 | throw Error(
|
|---|
| 6047 | "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
|
|---|
| 6048 | );
|
|---|
| 6049 | return preparePreambleFromSubtree(
|
|---|
| 6050 | request,
|
|---|
| 6051 | segment,
|
|---|
| 6052 | collectedPreambleSegments
|
|---|
| 6053 | );
|
|---|
| 6054 | case 5:
|
|---|
| 6055 | if (null !== request.trackedPostpones) return !0;
|
|---|
| 6056 | case 4:
|
|---|
| 6057 | if (1 === segment.status)
|
|---|
| 6058 | return (
|
|---|
| 6059 | hoistPreambleState(request.renderState, fallbackPreamble),
|
|---|
| 6060 | preparePreambleFromSubtree(
|
|---|
| 6061 | request,
|
|---|
| 6062 | segment,
|
|---|
| 6063 | collectedPreambleSegments
|
|---|
| 6064 | )
|
|---|
| 6065 | );
|
|---|
| 6066 | default:
|
|---|
| 6067 | return !0;
|
|---|
| 6068 | }
|
|---|
| 6069 | }
|
|---|
| 6070 | function preparePreamble(request) {
|
|---|
| 6071 | if (
|
|---|
| 6072 | request.completedRootSegment &&
|
|---|
| 6073 | null === request.completedPreambleSegments
|
|---|
| 6074 | ) {
|
|---|
| 6075 | var collectedPreambleSegments = [],
|
|---|
| 6076 | originalRequestByteSize = request.byteSize,
|
|---|
| 6077 | hasPendingPreambles = preparePreambleFromSegment(
|
|---|
| 6078 | request,
|
|---|
| 6079 | request.completedRootSegment,
|
|---|
| 6080 | collectedPreambleSegments
|
|---|
| 6081 | ),
|
|---|
| 6082 | preamble = request.renderState.preamble;
|
|---|
| 6083 | !1 === hasPendingPreambles || (preamble.headChunks && preamble.bodyChunks)
|
|---|
| 6084 | ? (request.completedPreambleSegments = collectedPreambleSegments)
|
|---|
| 6085 | : (request.byteSize = originalRequestByteSize);
|
|---|
| 6086 | }
|
|---|
| 6087 | }
|
|---|
| 6088 | function flushSubtree(request, destination, segment, hoistableState) {
|
|---|
| 6089 | segment.parentFlushed = !0;
|
|---|
| 6090 | switch (segment.status) {
|
|---|
| 6091 | case 0:
|
|---|
| 6092 | segment.id = request.nextSegmentId++;
|
|---|
| 6093 | case 5:
|
|---|
| 6094 | return (
|
|---|
| 6095 | (hoistableState = segment.id),
|
|---|
| 6096 | (segment.lastPushedText = !1),
|
|---|
| 6097 | (segment.textEmbedded = !1),
|
|---|
| 6098 | (request = request.renderState),
|
|---|
| 6099 | writeChunk(destination, '<template id="'),
|
|---|
| 6100 | writeChunk(destination, request.placeholderPrefix),
|
|---|
| 6101 | (request = hoistableState.toString(16)),
|
|---|
| 6102 | writeChunk(destination, request),
|
|---|
| 6103 | !!destination.write('"></template>')
|
|---|
| 6104 | );
|
|---|
| 6105 | case 1:
|
|---|
| 6106 | segment.status = 2;
|
|---|
| 6107 | var r = !0,
|
|---|
| 6108 | chunks = segment.chunks,
|
|---|
| 6109 | chunkIdx = 0;
|
|---|
| 6110 | segment = segment.children;
|
|---|
| 6111 | for (var childIdx = 0; childIdx < segment.length; childIdx++) {
|
|---|
| 6112 | for (r = segment[childIdx]; chunkIdx < r.index; chunkIdx++)
|
|---|
| 6113 | writeChunk(destination, chunks[chunkIdx]);
|
|---|
| 6114 | r = flushSegment(request, destination, r, hoistableState);
|
|---|
| 6115 | }
|
|---|
| 6116 | for (; chunkIdx < chunks.length - 1; chunkIdx++)
|
|---|
| 6117 | writeChunk(destination, chunks[chunkIdx]);
|
|---|
| 6118 | chunkIdx < chunks.length && (r = !!destination.write(chunks[chunkIdx]));
|
|---|
| 6119 | return r;
|
|---|
| 6120 | case 3:
|
|---|
| 6121 | return !0;
|
|---|
| 6122 | default:
|
|---|
| 6123 | throw Error(
|
|---|
| 6124 | "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React."
|
|---|
| 6125 | );
|
|---|
| 6126 | }
|
|---|
| 6127 | }
|
|---|
| 6128 | var flushedByteSize = 0;
|
|---|
| 6129 | function flushSegment(request, destination, segment, hoistableState) {
|
|---|
| 6130 | var boundary = segment.boundary;
|
|---|
| 6131 | if (null === boundary)
|
|---|
| 6132 | return flushSubtree(request, destination, segment, hoistableState);
|
|---|
| 6133 | boundary.parentFlushed = !0;
|
|---|
| 6134 | if (4 === boundary.status) {
|
|---|
| 6135 | var row = boundary.row;
|
|---|
| 6136 | null !== row &&
|
|---|
| 6137 | 0 === --row.pendingTasks &&
|
|---|
| 6138 | finishSuspenseListRow(request, row);
|
|---|
| 6139 | boundary = boundary.errorDigest;
|
|---|
| 6140 | destination.write("\x3c!--$!--\x3e");
|
|---|
| 6141 | writeChunk(destination, "<template");
|
|---|
| 6142 | boundary &&
|
|---|
| 6143 | (writeChunk(destination, ' data-dgst="'),
|
|---|
| 6144 | writeChunk(destination, escapeTextForBrowser(boundary)),
|
|---|
| 6145 | writeChunk(destination, '"'));
|
|---|
| 6146 | destination.write("></template>");
|
|---|
| 6147 | flushSubtree(request, destination, segment, hoistableState);
|
|---|
| 6148 | } else if (1 !== boundary.status)
|
|---|
| 6149 | 0 === boundary.status && (boundary.rootSegmentID = request.nextSegmentId++),
|
|---|
| 6150 | 0 < boundary.completedSegments.length &&
|
|---|
| 6151 | request.partialBoundaries.push(boundary),
|
|---|
| 6152 | writeStartPendingSuspenseBoundary(
|
|---|
| 6153 | destination,
|
|---|
| 6154 | request.renderState,
|
|---|
| 6155 | boundary.rootSegmentID
|
|---|
| 6156 | ),
|
|---|
| 6157 | hoistableState && hoistHoistables(hoistableState, boundary.fallbackState),
|
|---|
| 6158 | flushSubtree(request, destination, segment, hoistableState);
|
|---|
| 6159 | else if (
|
|---|
| 6160 | !flushingPartialBoundaries &&
|
|---|
| 6161 | isEligibleForOutlining(request, boundary) &&
|
|---|
| 6162 | (flushedByteSize + boundary.byteSize > request.progressiveChunkSize ||
|
|---|
| 6163 | hasSuspenseyContent(boundary.contentState))
|
|---|
| 6164 | )
|
|---|
| 6165 | (boundary.rootSegmentID = request.nextSegmentId++),
|
|---|
| 6166 | request.completedBoundaries.push(boundary),
|
|---|
| 6167 | writeStartPendingSuspenseBoundary(
|
|---|
| 6168 | destination,
|
|---|
| 6169 | request.renderState,
|
|---|
| 6170 | boundary.rootSegmentID
|
|---|
| 6171 | ),
|
|---|
| 6172 | flushSubtree(request, destination, segment, hoistableState);
|
|---|
| 6173 | else {
|
|---|
| 6174 | flushedByteSize += boundary.byteSize;
|
|---|
| 6175 | hoistableState && hoistHoistables(hoistableState, boundary.contentState);
|
|---|
| 6176 | segment = boundary.row;
|
|---|
| 6177 | null !== segment &&
|
|---|
| 6178 | isEligibleForOutlining(request, boundary) &&
|
|---|
| 6179 | 0 === --segment.pendingTasks &&
|
|---|
| 6180 | finishSuspenseListRow(request, segment);
|
|---|
| 6181 | destination.write("\x3c!--$--\x3e");
|
|---|
| 6182 | segment = boundary.completedSegments;
|
|---|
| 6183 | if (1 !== segment.length)
|
|---|
| 6184 | throw Error(
|
|---|
| 6185 | "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
|
|---|
| 6186 | );
|
|---|
| 6187 | flushSegment(request, destination, segment[0], hoistableState);
|
|---|
| 6188 | }
|
|---|
| 6189 | return !!destination.write("\x3c!--/$--\x3e");
|
|---|
| 6190 | }
|
|---|
| 6191 | function flushSegmentContainer(request, destination, segment, hoistableState) {
|
|---|
| 6192 | writeStartSegment(
|
|---|
| 6193 | destination,
|
|---|
| 6194 | request.renderState,
|
|---|
| 6195 | segment.parentFormatContext,
|
|---|
| 6196 | segment.id
|
|---|
| 6197 | );
|
|---|
| 6198 | flushSegment(request, destination, segment, hoistableState);
|
|---|
| 6199 | return writeEndSegment(destination, segment.parentFormatContext);
|
|---|
| 6200 | }
|
|---|
| 6201 | function flushCompletedBoundary(request, destination, boundary) {
|
|---|
| 6202 | flushedByteSize = boundary.byteSize;
|
|---|
| 6203 | for (
|
|---|
| 6204 | var completedSegments = boundary.completedSegments, i = 0;
|
|---|
| 6205 | i < completedSegments.length;
|
|---|
| 6206 | i++
|
|---|
| 6207 | )
|
|---|
| 6208 | flushPartiallyCompletedSegment(
|
|---|
| 6209 | request,
|
|---|
| 6210 | destination,
|
|---|
| 6211 | boundary,
|
|---|
| 6212 | completedSegments[i]
|
|---|
| 6213 | );
|
|---|
| 6214 | completedSegments.length = 0;
|
|---|
| 6215 | completedSegments = boundary.row;
|
|---|
| 6216 | null !== completedSegments &&
|
|---|
| 6217 | isEligibleForOutlining(request, boundary) &&
|
|---|
| 6218 | 0 === --completedSegments.pendingTasks &&
|
|---|
| 6219 | finishSuspenseListRow(request, completedSegments);
|
|---|
| 6220 | writeHoistablesForBoundary(
|
|---|
| 6221 | destination,
|
|---|
| 6222 | boundary.contentState,
|
|---|
| 6223 | request.renderState
|
|---|
| 6224 | );
|
|---|
| 6225 | completedSegments = request.resumableState;
|
|---|
| 6226 | request = request.renderState;
|
|---|
| 6227 | i = boundary.rootSegmentID;
|
|---|
| 6228 | boundary = boundary.contentState;
|
|---|
| 6229 | var requiresStyleInsertion = request.stylesToHoist;
|
|---|
| 6230 | request.stylesToHoist = !1;
|
|---|
| 6231 | writeChunk(destination, request.startInlineScript);
|
|---|
| 6232 | writeChunk(destination, ">");
|
|---|
| 6233 | requiresStyleInsertion
|
|---|
| 6234 | ? (0 === (completedSegments.instructions & 4) &&
|
|---|
| 6235 | ((completedSegments.instructions |= 4),
|
|---|
| 6236 | writeChunk(
|
|---|
| 6237 | destination,
|
|---|
| 6238 | '$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())};'
|
|---|
| 6239 | )),
|
|---|
| 6240 | 0 === (completedSegments.instructions & 2) &&
|
|---|
| 6241 | ((completedSegments.instructions |= 2),
|
|---|
| 6242 | writeChunk(
|
|---|
| 6243 | destination,
|
|---|
| 6244 | '$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)};'
|
|---|
| 6245 | )),
|
|---|
| 6246 | 0 === (completedSegments.instructions & 8)
|
|---|
| 6247 | ? ((completedSegments.instructions |= 8),
|
|---|
| 6248 | writeChunk(
|
|---|
| 6249 | destination,
|
|---|
| 6250 | '$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("'
|
|---|
| 6251 | ))
|
|---|
| 6252 | : writeChunk(destination, '$RR("'))
|
|---|
| 6253 | : (0 === (completedSegments.instructions & 2) &&
|
|---|
| 6254 | ((completedSegments.instructions |= 2),
|
|---|
| 6255 | writeChunk(
|
|---|
| 6256 | destination,
|
|---|
| 6257 | '$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)};'
|
|---|
| 6258 | )),
|
|---|
| 6259 | writeChunk(destination, '$RC("'));
|
|---|
| 6260 | completedSegments = i.toString(16);
|
|---|
| 6261 | writeChunk(destination, request.boundaryPrefix);
|
|---|
| 6262 | writeChunk(destination, completedSegments);
|
|---|
| 6263 | writeChunk(destination, '","');
|
|---|
| 6264 | writeChunk(destination, request.segmentPrefix);
|
|---|
| 6265 | writeChunk(destination, completedSegments);
|
|---|
| 6266 | requiresStyleInsertion
|
|---|
| 6267 | ? (writeChunk(destination, '",'),
|
|---|
| 6268 | writeStyleResourceDependenciesInJS(destination, boundary))
|
|---|
| 6269 | : writeChunk(destination, '"');
|
|---|
| 6270 | boundary = !!destination.write(")\x3c/script>");
|
|---|
| 6271 | return writeBootstrap(destination, request) && boundary;
|
|---|
| 6272 | }
|
|---|
| 6273 | function flushPartiallyCompletedSegment(
|
|---|
| 6274 | request,
|
|---|
| 6275 | destination,
|
|---|
| 6276 | boundary,
|
|---|
| 6277 | segment
|
|---|
| 6278 | ) {
|
|---|
| 6279 | if (2 === segment.status) return !0;
|
|---|
| 6280 | var hoistableState = boundary.contentState,
|
|---|
| 6281 | segmentID = segment.id;
|
|---|
| 6282 | if (-1 === segmentID) {
|
|---|
| 6283 | if (-1 === (segment.id = boundary.rootSegmentID))
|
|---|
| 6284 | throw Error(
|
|---|
| 6285 | "A root segment ID must have been assigned by now. This is a bug in React."
|
|---|
| 6286 | );
|
|---|
| 6287 | return flushSegmentContainer(request, destination, segment, hoistableState);
|
|---|
| 6288 | }
|
|---|
| 6289 | if (segmentID === boundary.rootSegmentID)
|
|---|
| 6290 | return flushSegmentContainer(request, destination, segment, hoistableState);
|
|---|
| 6291 | flushSegmentContainer(request, destination, segment, hoistableState);
|
|---|
| 6292 | boundary = request.resumableState;
|
|---|
| 6293 | request = request.renderState;
|
|---|
| 6294 | writeChunk(destination, request.startInlineScript);
|
|---|
| 6295 | writeChunk(destination, ">");
|
|---|
| 6296 | 0 === (boundary.instructions & 1)
|
|---|
| 6297 | ? ((boundary.instructions |= 1),
|
|---|
| 6298 | writeChunk(
|
|---|
| 6299 | destination,
|
|---|
| 6300 | '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'
|
|---|
| 6301 | ))
|
|---|
| 6302 | : writeChunk(destination, '$RS("');
|
|---|
| 6303 | writeChunk(destination, request.segmentPrefix);
|
|---|
| 6304 | segmentID = segmentID.toString(16);
|
|---|
| 6305 | writeChunk(destination, segmentID);
|
|---|
| 6306 | writeChunk(destination, '","');
|
|---|
| 6307 | writeChunk(destination, request.placeholderPrefix);
|
|---|
| 6308 | writeChunk(destination, segmentID);
|
|---|
| 6309 | destination = !!destination.write('")\x3c/script>');
|
|---|
| 6310 | return destination;
|
|---|
| 6311 | }
|
|---|
| 6312 | var flushingPartialBoundaries = !1;
|
|---|
| 6313 | function flushCompletedQueues(request, destination) {
|
|---|
| 6314 | try {
|
|---|
| 6315 | if (!(0 < request.pendingRootTasks)) {
|
|---|
| 6316 | var i,
|
|---|
| 6317 | completedRootSegment = request.completedRootSegment;
|
|---|
| 6318 | if (null !== completedRootSegment) {
|
|---|
| 6319 | if (5 === completedRootSegment.status) return;
|
|---|
| 6320 | var completedPreambleSegments = request.completedPreambleSegments;
|
|---|
| 6321 | if (null === completedPreambleSegments) return;
|
|---|
| 6322 | flushedByteSize = request.byteSize;
|
|---|
| 6323 | var resumableState = request.resumableState,
|
|---|
| 6324 | renderState = request.renderState,
|
|---|
| 6325 | preamble = renderState.preamble,
|
|---|
| 6326 | htmlChunks = preamble.htmlChunks,
|
|---|
| 6327 | headChunks = preamble.headChunks,
|
|---|
| 6328 | i$jscomp$0;
|
|---|
| 6329 | if (htmlChunks) {
|
|---|
| 6330 | for (i$jscomp$0 = 0; i$jscomp$0 < htmlChunks.length; i$jscomp$0++)
|
|---|
| 6331 | writeChunk(destination, htmlChunks[i$jscomp$0]);
|
|---|
| 6332 | if (headChunks)
|
|---|
| 6333 | for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)
|
|---|
| 6334 | writeChunk(destination, headChunks[i$jscomp$0]);
|
|---|
| 6335 | else
|
|---|
| 6336 | writeChunk(destination, startChunkForTag("head")),
|
|---|
| 6337 | writeChunk(destination, ">");
|
|---|
| 6338 | } else if (headChunks)
|
|---|
| 6339 | for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)
|
|---|
| 6340 | writeChunk(destination, headChunks[i$jscomp$0]);
|
|---|
| 6341 | var charsetChunks = renderState.charsetChunks;
|
|---|
| 6342 | for (i$jscomp$0 = 0; i$jscomp$0 < charsetChunks.length; i$jscomp$0++)
|
|---|
| 6343 | writeChunk(destination, charsetChunks[i$jscomp$0]);
|
|---|
| 6344 | charsetChunks.length = 0;
|
|---|
| 6345 | renderState.preconnects.forEach(flushResource, destination);
|
|---|
| 6346 | renderState.preconnects.clear();
|
|---|
| 6347 | var viewportChunks = renderState.viewportChunks;
|
|---|
| 6348 | for (i$jscomp$0 = 0; i$jscomp$0 < viewportChunks.length; i$jscomp$0++)
|
|---|
| 6349 | writeChunk(destination, viewportChunks[i$jscomp$0]);
|
|---|
| 6350 | viewportChunks.length = 0;
|
|---|
| 6351 | renderState.fontPreloads.forEach(flushResource, destination);
|
|---|
| 6352 | renderState.fontPreloads.clear();
|
|---|
| 6353 | renderState.highImagePreloads.forEach(flushResource, destination);
|
|---|
| 6354 | renderState.highImagePreloads.clear();
|
|---|
| 6355 | currentlyFlushingRenderState = renderState;
|
|---|
| 6356 | renderState.styles.forEach(flushStylesInPreamble, destination);
|
|---|
| 6357 | currentlyFlushingRenderState = null;
|
|---|
| 6358 | var importMapChunks = renderState.importMapChunks;
|
|---|
| 6359 | for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
|
|---|
| 6360 | writeChunk(destination, importMapChunks[i$jscomp$0]);
|
|---|
| 6361 | importMapChunks.length = 0;
|
|---|
| 6362 | renderState.bootstrapScripts.forEach(flushResource, destination);
|
|---|
| 6363 | renderState.scripts.forEach(flushResource, destination);
|
|---|
| 6364 | renderState.scripts.clear();
|
|---|
| 6365 | renderState.bulkPreloads.forEach(flushResource, destination);
|
|---|
| 6366 | renderState.bulkPreloads.clear();
|
|---|
| 6367 | htmlChunks || headChunks || (resumableState.instructions |= 32);
|
|---|
| 6368 | var hoistableChunks = renderState.hoistableChunks;
|
|---|
| 6369 | for (i$jscomp$0 = 0; i$jscomp$0 < hoistableChunks.length; i$jscomp$0++)
|
|---|
| 6370 | writeChunk(destination, hoistableChunks[i$jscomp$0]);
|
|---|
| 6371 | for (
|
|---|
| 6372 | resumableState = hoistableChunks.length = 0;
|
|---|
| 6373 | resumableState < completedPreambleSegments.length;
|
|---|
| 6374 | resumableState++
|
|---|
| 6375 | ) {
|
|---|
| 6376 | var segments = completedPreambleSegments[resumableState];
|
|---|
| 6377 | for (renderState = 0; renderState < segments.length; renderState++)
|
|---|
| 6378 | flushSegment(request, destination, segments[renderState], null);
|
|---|
| 6379 | }
|
|---|
| 6380 | var preamble$jscomp$0 = request.renderState.preamble,
|
|---|
| 6381 | headChunks$jscomp$0 = preamble$jscomp$0.headChunks;
|
|---|
| 6382 | (preamble$jscomp$0.htmlChunks || headChunks$jscomp$0) &&
|
|---|
| 6383 | writeChunk(destination, endChunkForTag("head"));
|
|---|
| 6384 | var bodyChunks = preamble$jscomp$0.bodyChunks;
|
|---|
| 6385 | if (bodyChunks)
|
|---|
| 6386 | for (
|
|---|
| 6387 | completedPreambleSegments = 0;
|
|---|
| 6388 | completedPreambleSegments < bodyChunks.length;
|
|---|
| 6389 | completedPreambleSegments++
|
|---|
| 6390 | )
|
|---|
| 6391 | writeChunk(destination, bodyChunks[completedPreambleSegments]);
|
|---|
| 6392 | flushSegment(request, destination, completedRootSegment, null);
|
|---|
| 6393 | request.completedRootSegment = null;
|
|---|
| 6394 | var renderState$jscomp$0 = request.renderState;
|
|---|
| 6395 | if (
|
|---|
| 6396 | 0 !== request.allPendingTasks ||
|
|---|
| 6397 | 0 !== request.clientRenderedBoundaries.length ||
|
|---|
| 6398 | 0 !== request.completedBoundaries.length ||
|
|---|
| 6399 | (null !== request.trackedPostpones &&
|
|---|
| 6400 | (0 !== request.trackedPostpones.rootNodes.length ||
|
|---|
| 6401 | null !== request.trackedPostpones.rootSlots))
|
|---|
| 6402 | ) {
|
|---|
| 6403 | var resumableState$jscomp$0 = request.resumableState;
|
|---|
| 6404 | if (0 === (resumableState$jscomp$0.instructions & 64)) {
|
|---|
| 6405 | resumableState$jscomp$0.instructions |= 64;
|
|---|
| 6406 | writeChunk(destination, renderState$jscomp$0.startInlineScript);
|
|---|
| 6407 | if (0 === (resumableState$jscomp$0.instructions & 32)) {
|
|---|
| 6408 | resumableState$jscomp$0.instructions |= 32;
|
|---|
| 6409 | var shellId = "_" + resumableState$jscomp$0.idPrefix + "R_";
|
|---|
| 6410 | writeChunk(destination, ' id="');
|
|---|
| 6411 | writeChunk(destination, escapeTextForBrowser(shellId));
|
|---|
| 6412 | writeChunk(destination, '"');
|
|---|
| 6413 | }
|
|---|
| 6414 | writeChunk(destination, ">");
|
|---|
| 6415 | writeChunk(
|
|---|
| 6416 | destination,
|
|---|
| 6417 | "requestAnimationFrame(function(){$RT=performance.now()});"
|
|---|
| 6418 | );
|
|---|
| 6419 | destination.write("\x3c/script>");
|
|---|
| 6420 | }
|
|---|
| 6421 | }
|
|---|
| 6422 | writeBootstrap(destination, renderState$jscomp$0);
|
|---|
| 6423 | }
|
|---|
| 6424 | var renderState$jscomp$1 = request.renderState;
|
|---|
| 6425 | completedRootSegment = 0;
|
|---|
| 6426 | var viewportChunks$jscomp$0 = renderState$jscomp$1.viewportChunks;
|
|---|
| 6427 | for (
|
|---|
| 6428 | completedRootSegment = 0;
|
|---|
| 6429 | completedRootSegment < viewportChunks$jscomp$0.length;
|
|---|
| 6430 | completedRootSegment++
|
|---|
| 6431 | )
|
|---|
| 6432 | writeChunk(destination, viewportChunks$jscomp$0[completedRootSegment]);
|
|---|
| 6433 | viewportChunks$jscomp$0.length = 0;
|
|---|
| 6434 | renderState$jscomp$1.preconnects.forEach(flushResource, destination);
|
|---|
| 6435 | renderState$jscomp$1.preconnects.clear();
|
|---|
| 6436 | renderState$jscomp$1.fontPreloads.forEach(flushResource, destination);
|
|---|
| 6437 | renderState$jscomp$1.fontPreloads.clear();
|
|---|
| 6438 | renderState$jscomp$1.highImagePreloads.forEach(
|
|---|
| 6439 | flushResource,
|
|---|
| 6440 | destination
|
|---|
| 6441 | );
|
|---|
| 6442 | renderState$jscomp$1.highImagePreloads.clear();
|
|---|
| 6443 | renderState$jscomp$1.styles.forEach(preloadLateStyles, destination);
|
|---|
| 6444 | renderState$jscomp$1.scripts.forEach(flushResource, destination);
|
|---|
| 6445 | renderState$jscomp$1.scripts.clear();
|
|---|
| 6446 | renderState$jscomp$1.bulkPreloads.forEach(flushResource, destination);
|
|---|
| 6447 | renderState$jscomp$1.bulkPreloads.clear();
|
|---|
| 6448 | var hoistableChunks$jscomp$0 = renderState$jscomp$1.hoistableChunks;
|
|---|
| 6449 | for (
|
|---|
| 6450 | completedRootSegment = 0;
|
|---|
| 6451 | completedRootSegment < hoistableChunks$jscomp$0.length;
|
|---|
| 6452 | completedRootSegment++
|
|---|
| 6453 | )
|
|---|
| 6454 | writeChunk(destination, hoistableChunks$jscomp$0[completedRootSegment]);
|
|---|
| 6455 | hoistableChunks$jscomp$0.length = 0;
|
|---|
| 6456 | var clientRenderedBoundaries = request.clientRenderedBoundaries;
|
|---|
| 6457 | for (i = 0; i < clientRenderedBoundaries.length; i++) {
|
|---|
| 6458 | var boundary = clientRenderedBoundaries[i];
|
|---|
| 6459 | renderState$jscomp$1 = destination;
|
|---|
| 6460 | var resumableState$jscomp$1 = request.resumableState,
|
|---|
| 6461 | renderState$jscomp$2 = request.renderState,
|
|---|
| 6462 | id = boundary.rootSegmentID,
|
|---|
| 6463 | errorDigest = boundary.errorDigest;
|
|---|
| 6464 | writeChunk(
|
|---|
| 6465 | renderState$jscomp$1,
|
|---|
| 6466 | renderState$jscomp$2.startInlineScript
|
|---|
| 6467 | );
|
|---|
| 6468 | writeChunk(renderState$jscomp$1, ">");
|
|---|
| 6469 | 0 === (resumableState$jscomp$1.instructions & 4)
|
|---|
| 6470 | ? ((resumableState$jscomp$1.instructions |= 4),
|
|---|
| 6471 | writeChunk(
|
|---|
| 6472 | renderState$jscomp$1,
|
|---|
| 6473 | '$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("'
|
|---|
| 6474 | ))
|
|---|
| 6475 | : writeChunk(renderState$jscomp$1, '$RX("');
|
|---|
| 6476 | writeChunk(renderState$jscomp$1, renderState$jscomp$2.boundaryPrefix);
|
|---|
| 6477 | writeChunk(renderState$jscomp$1, id.toString(16));
|
|---|
| 6478 | writeChunk(renderState$jscomp$1, '"');
|
|---|
| 6479 | errorDigest &&
|
|---|
| 6480 | (writeChunk(renderState$jscomp$1, ","),
|
|---|
| 6481 | writeChunk(
|
|---|
| 6482 | renderState$jscomp$1,
|
|---|
| 6483 | escapeJSStringsForInstructionScripts(errorDigest || "")
|
|---|
| 6484 | ));
|
|---|
| 6485 | var JSCompiler_inline_result =
|
|---|
| 6486 | !!renderState$jscomp$1.write(")\x3c/script>");
|
|---|
| 6487 | if (!JSCompiler_inline_result) {
|
|---|
| 6488 | request.destination = null;
|
|---|
| 6489 | i++;
|
|---|
| 6490 | clientRenderedBoundaries.splice(0, i);
|
|---|
| 6491 | return;
|
|---|
| 6492 | }
|
|---|
| 6493 | }
|
|---|
| 6494 | clientRenderedBoundaries.splice(0, i);
|
|---|
| 6495 | var completedBoundaries = request.completedBoundaries;
|
|---|
| 6496 | for (i = 0; i < completedBoundaries.length; i++)
|
|---|
| 6497 | if (
|
|---|
| 6498 | !flushCompletedBoundary(request, destination, completedBoundaries[i])
|
|---|
| 6499 | ) {
|
|---|
| 6500 | request.destination = null;
|
|---|
| 6501 | i++;
|
|---|
| 6502 | completedBoundaries.splice(0, i);
|
|---|
| 6503 | return;
|
|---|
| 6504 | }
|
|---|
| 6505 | completedBoundaries.splice(0, i);
|
|---|
| 6506 | flushingPartialBoundaries = !0;
|
|---|
| 6507 | var partialBoundaries = request.partialBoundaries;
|
|---|
| 6508 | for (i = 0; i < partialBoundaries.length; i++) {
|
|---|
| 6509 | var boundary$69 = partialBoundaries[i];
|
|---|
| 6510 | a: {
|
|---|
| 6511 | clientRenderedBoundaries = request;
|
|---|
| 6512 | boundary = destination;
|
|---|
| 6513 | flushedByteSize = boundary$69.byteSize;
|
|---|
| 6514 | var completedSegments = boundary$69.completedSegments;
|
|---|
| 6515 | for (
|
|---|
| 6516 | JSCompiler_inline_result = 0;
|
|---|
| 6517 | JSCompiler_inline_result < completedSegments.length;
|
|---|
| 6518 | JSCompiler_inline_result++
|
|---|
| 6519 | )
|
|---|
| 6520 | if (
|
|---|
| 6521 | !flushPartiallyCompletedSegment(
|
|---|
| 6522 | clientRenderedBoundaries,
|
|---|
| 6523 | boundary,
|
|---|
| 6524 | boundary$69,
|
|---|
| 6525 | completedSegments[JSCompiler_inline_result]
|
|---|
| 6526 | )
|
|---|
| 6527 | ) {
|
|---|
| 6528 | JSCompiler_inline_result++;
|
|---|
| 6529 | completedSegments.splice(0, JSCompiler_inline_result);
|
|---|
| 6530 | var JSCompiler_inline_result$jscomp$0 = !1;
|
|---|
| 6531 | break a;
|
|---|
| 6532 | }
|
|---|
| 6533 | completedSegments.splice(0, JSCompiler_inline_result);
|
|---|
| 6534 | var row = boundary$69.row;
|
|---|
| 6535 | null !== row &&
|
|---|
| 6536 | row.together &&
|
|---|
| 6537 | 1 === boundary$69.pendingTasks &&
|
|---|
| 6538 | (1 === row.pendingTasks
|
|---|
| 6539 | ? unblockSuspenseListRow(
|
|---|
| 6540 | clientRenderedBoundaries,
|
|---|
| 6541 | row,
|
|---|
| 6542 | row.hoistables
|
|---|
| 6543 | )
|
|---|
| 6544 | : row.pendingTasks--);
|
|---|
| 6545 | JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
|
|---|
| 6546 | boundary,
|
|---|
| 6547 | boundary$69.contentState,
|
|---|
| 6548 | clientRenderedBoundaries.renderState
|
|---|
| 6549 | );
|
|---|
| 6550 | }
|
|---|
| 6551 | if (!JSCompiler_inline_result$jscomp$0) {
|
|---|
| 6552 | request.destination = null;
|
|---|
| 6553 | i++;
|
|---|
| 6554 | partialBoundaries.splice(0, i);
|
|---|
| 6555 | return;
|
|---|
| 6556 | }
|
|---|
| 6557 | }
|
|---|
| 6558 | partialBoundaries.splice(0, i);
|
|---|
| 6559 | flushingPartialBoundaries = !1;
|
|---|
| 6560 | var largeBoundaries = request.completedBoundaries;
|
|---|
| 6561 | for (i = 0; i < largeBoundaries.length; i++)
|
|---|
| 6562 | if (!flushCompletedBoundary(request, destination, largeBoundaries[i])) {
|
|---|
| 6563 | request.destination = null;
|
|---|
| 6564 | i++;
|
|---|
| 6565 | largeBoundaries.splice(0, i);
|
|---|
| 6566 | return;
|
|---|
| 6567 | }
|
|---|
| 6568 | largeBoundaries.splice(0, i);
|
|---|
| 6569 | }
|
|---|
| 6570 | } finally {
|
|---|
| 6571 | (flushingPartialBoundaries = !1),
|
|---|
| 6572 | 0 === request.allPendingTasks &&
|
|---|
| 6573 | 0 === request.clientRenderedBoundaries.length &&
|
|---|
| 6574 | 0 === request.completedBoundaries.length
|
|---|
| 6575 | ? ((request.flushScheduled = !1),
|
|---|
| 6576 | (i = request.resumableState),
|
|---|
| 6577 | i.hasBody && writeChunk(destination, endChunkForTag("body")),
|
|---|
| 6578 | i.hasHtml && writeChunk(destination, endChunkForTag("html")),
|
|---|
| 6579 | flushBuffered(destination),
|
|---|
| 6580 | (request.status = 14),
|
|---|
| 6581 | destination.end(),
|
|---|
| 6582 | (request.destination = null))
|
|---|
| 6583 | : flushBuffered(destination);
|
|---|
| 6584 | }
|
|---|
| 6585 | }
|
|---|
| 6586 | function startWork(request) {
|
|---|
| 6587 | request.flushScheduled = null !== request.destination;
|
|---|
| 6588 | scheduleMicrotask(function () {
|
|---|
| 6589 | return performWork(request);
|
|---|
| 6590 | });
|
|---|
| 6591 | setTimeout(function () {
|
|---|
| 6592 | 10 === request.status && (request.status = 11);
|
|---|
| 6593 | null === request.trackedPostpones &&
|
|---|
| 6594 | safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);
|
|---|
| 6595 | }, 0);
|
|---|
| 6596 | }
|
|---|
| 6597 | function enqueueFlush(request) {
|
|---|
| 6598 | !1 === request.flushScheduled &&
|
|---|
| 6599 | 0 === request.pingedTasks.length &&
|
|---|
| 6600 | null !== request.destination &&
|
|---|
| 6601 | ((request.flushScheduled = !0),
|
|---|
| 6602 | setTimeout(function () {
|
|---|
| 6603 | var destination = request.destination;
|
|---|
| 6604 | destination
|
|---|
| 6605 | ? flushCompletedQueues(request, destination)
|
|---|
| 6606 | : (request.flushScheduled = !1);
|
|---|
| 6607 | }, 0));
|
|---|
| 6608 | }
|
|---|
| 6609 | function abort(request, reason) {
|
|---|
| 6610 | if (11 === request.status || 10 === request.status) request.status = 12;
|
|---|
| 6611 | try {
|
|---|
| 6612 | var abortableTasks = request.abortableTasks;
|
|---|
| 6613 | if (0 < abortableTasks.size) {
|
|---|
| 6614 | var error =
|
|---|
| 6615 | void 0 === reason
|
|---|
| 6616 | ? Error("The render was aborted by the server without a reason.")
|
|---|
| 6617 | : "object" === typeof reason &&
|
|---|
| 6618 | null !== reason &&
|
|---|
| 6619 | "function" === typeof reason.then
|
|---|
| 6620 | ? Error("The render was aborted by the server with a promise.")
|
|---|
| 6621 | : reason;
|
|---|
| 6622 | request.fatalError = error;
|
|---|
| 6623 | abortableTasks.forEach(function (task) {
|
|---|
| 6624 | return abortTask(task, request, error);
|
|---|
| 6625 | });
|
|---|
| 6626 | abortableTasks.clear();
|
|---|
| 6627 | }
|
|---|
| 6628 | null !== request.destination &&
|
|---|
| 6629 | flushCompletedQueues(request, request.destination);
|
|---|
| 6630 | } catch (error$71) {
|
|---|
| 6631 | logRecoverableError(request, error$71, {}), fatalError(request, error$71);
|
|---|
| 6632 | }
|
|---|
| 6633 | }
|
|---|
| 6634 | function addToReplayParent(node, parentKeyPath, trackedPostpones) {
|
|---|
| 6635 | if (null === parentKeyPath) trackedPostpones.rootNodes.push(node);
|
|---|
| 6636 | else {
|
|---|
| 6637 | var workingMap = trackedPostpones.workingMap,
|
|---|
| 6638 | parentNode = workingMap.get(parentKeyPath);
|
|---|
| 6639 | void 0 === parentNode &&
|
|---|
| 6640 | ((parentNode = [parentKeyPath[1], parentKeyPath[2], [], null]),
|
|---|
| 6641 | workingMap.set(parentKeyPath, parentNode),
|
|---|
| 6642 | addToReplayParent(parentNode, parentKeyPath[0], trackedPostpones));
|
|---|
| 6643 | parentNode[2].push(node);
|
|---|
| 6644 | }
|
|---|
| 6645 | }
|
|---|
| 6646 | var isomorphicReactPackageVersion$jscomp$inline_821 = React.version;
|
|---|
| 6647 | if (
|
|---|
| 6648 | "19.2.3" !==
|
|---|
| 6649 | isomorphicReactPackageVersion$jscomp$inline_821
|
|---|
| 6650 | )
|
|---|
| 6651 | throw Error(
|
|---|
| 6652 | 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
|
|---|
| 6653 | (isomorphicReactPackageVersion$jscomp$inline_821 +
|
|---|
| 6654 | "\n - react-dom: 19.2.3\nLearn more: https://react.dev/warnings/version-mismatch")
|
|---|
| 6655 | );
|
|---|
| 6656 | exports.renderToReadableStream = function (children, options) {
|
|---|
| 6657 | return new Promise(function (resolve, reject) {
|
|---|
| 6658 | var onFatalError,
|
|---|
| 6659 | onAllReady,
|
|---|
| 6660 | allReady = new Promise(function (res, rej) {
|
|---|
| 6661 | onAllReady = res;
|
|---|
| 6662 | onFatalError = rej;
|
|---|
| 6663 | }),
|
|---|
| 6664 | onHeaders = options ? options.onHeaders : void 0,
|
|---|
| 6665 | onHeadersImpl;
|
|---|
| 6666 | onHeaders &&
|
|---|
| 6667 | (onHeadersImpl = function (headersDescriptor) {
|
|---|
| 6668 | onHeaders(new Headers(headersDescriptor));
|
|---|
| 6669 | });
|
|---|
| 6670 | var resumableState = createResumableState(
|
|---|
| 6671 | options ? options.identifierPrefix : void 0,
|
|---|
| 6672 | options ? options.unstable_externalRuntimeSrc : void 0,
|
|---|
| 6673 | options ? options.bootstrapScriptContent : void 0,
|
|---|
| 6674 | options ? options.bootstrapScripts : void 0,
|
|---|
| 6675 | options ? options.bootstrapModules : void 0
|
|---|
| 6676 | ),
|
|---|
| 6677 | request = createRequest(
|
|---|
| 6678 | children,
|
|---|
| 6679 | resumableState,
|
|---|
| 6680 | createRenderState(
|
|---|
| 6681 | resumableState,
|
|---|
| 6682 | options ? options.nonce : void 0,
|
|---|
| 6683 | options ? options.unstable_externalRuntimeSrc : void 0,
|
|---|
| 6684 | options ? options.importMap : void 0,
|
|---|
| 6685 | onHeadersImpl,
|
|---|
| 6686 | options ? options.maxHeadersLength : void 0
|
|---|
| 6687 | ),
|
|---|
| 6688 | createRootFormatContext(options ? options.namespaceURI : void 0),
|
|---|
| 6689 | options ? options.progressiveChunkSize : void 0,
|
|---|
| 6690 | options ? options.onError : void 0,
|
|---|
| 6691 | onAllReady,
|
|---|
| 6692 | function () {
|
|---|
| 6693 | var stream = new ReadableStream(
|
|---|
| 6694 | {
|
|---|
| 6695 | type: "direct",
|
|---|
| 6696 | pull: function (controller) {
|
|---|
| 6697 | if (13 === request.status)
|
|---|
| 6698 | (request.status = 14),
|
|---|
| 6699 | closeWithError(controller, request.fatalError);
|
|---|
| 6700 | else if (
|
|---|
| 6701 | 14 !== request.status &&
|
|---|
| 6702 | null === request.destination
|
|---|
| 6703 | ) {
|
|---|
| 6704 | request.destination = controller;
|
|---|
| 6705 | try {
|
|---|
| 6706 | flushCompletedQueues(request, controller);
|
|---|
| 6707 | } catch (error) {
|
|---|
| 6708 | logRecoverableError(request, error, {}),
|
|---|
| 6709 | fatalError(request, error);
|
|---|
| 6710 | }
|
|---|
| 6711 | }
|
|---|
| 6712 | },
|
|---|
| 6713 | cancel: function (reason) {
|
|---|
| 6714 | request.destination = null;
|
|---|
| 6715 | abort(request, reason);
|
|---|
| 6716 | }
|
|---|
| 6717 | },
|
|---|
| 6718 | { highWaterMark: 2048 }
|
|---|
| 6719 | );
|
|---|
| 6720 | stream.allReady = allReady;
|
|---|
| 6721 | resolve(stream);
|
|---|
| 6722 | },
|
|---|
| 6723 | function (error) {
|
|---|
| 6724 | allReady.catch(function () {});
|
|---|
| 6725 | reject(error);
|
|---|
| 6726 | },
|
|---|
| 6727 | onFatalError,
|
|---|
| 6728 | options ? options.onPostpone : void 0,
|
|---|
| 6729 | options ? options.formState : void 0
|
|---|
| 6730 | );
|
|---|
| 6731 | if (options && options.signal) {
|
|---|
| 6732 | var signal = options.signal;
|
|---|
| 6733 | if (signal.aborted) abort(request, signal.reason);
|
|---|
| 6734 | else {
|
|---|
| 6735 | var listener = function () {
|
|---|
| 6736 | abort(request, signal.reason);
|
|---|
| 6737 | signal.removeEventListener("abort", listener);
|
|---|
| 6738 | };
|
|---|
| 6739 | signal.addEventListener("abort", listener);
|
|---|
| 6740 | }
|
|---|
| 6741 | }
|
|---|
| 6742 | startWork(request);
|
|---|
| 6743 | });
|
|---|
| 6744 | };
|
|---|
| 6745 | exports.version = "19.2.3";
|
|---|