next
Version:
The React Framework
1,431 lines (1,430 loc) • 276 kB
JavaScript
/**
* @license React
* react-dom-server.bun.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("next/dist/compiled/react-experimental"),
ReactDOM = require("next/dist/compiled/react-dom-experimental"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_SCOPE_TYPE = Symbol.for("react.scope"),
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
REACT_POSTPONE_TYPE = Symbol.for("react.postpone"),
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
function getIteratorFn(maybeIterable) {
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
maybeIterable =
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
maybeIterable["@@iterator"];
return "function" === typeof maybeIterable ? maybeIterable : null;
}
var ASYNC_ITERATOR = Symbol.asyncIterator,
isArrayImpl = Array.isArray,
scheduleMicrotask = queueMicrotask;
function flushBuffered(destination) {
"function" === typeof destination.flush && destination.flush();
}
function writeChunk(destination, chunk) {
0 !== chunk.length && destination.write(chunk);
}
function byteLengthOfChunk(chunk) {
return Buffer.byteLength(chunk, "utf8");
}
function closeWithError(destination, error) {
"function" === typeof destination.error
? destination.error(error)
: destination.close();
}
function readAsDataURL(blob) {
return blob.arrayBuffer().then(function (arrayBuffer) {
arrayBuffer = Buffer.from(arrayBuffer).toString("base64");
return (
"data:" +
(blob.type || "application/octet-stream") +
";base64," +
arrayBuffer
);
});
}
var assign = Object.assign,
hasOwnProperty = Object.prototype.hasOwnProperty,
VALID_ATTRIBUTE_NAME_REGEX = RegExp(
"^[: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]*$"
),
illegalAttributeNameCache = {},
validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
return !0;
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
return (validatedAttributeNameCache[attributeName] = !0);
illegalAttributeNameCache[attributeName] = !0;
return !1;
}
var unitlessNumbers = new Set(
"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(
" "
)
),
aliases = new Map([
["acceptCharset", "accept-charset"],
["htmlFor", "for"],
["httpEquiv", "http-equiv"],
["crossOrigin", "crossorigin"],
["accentHeight", "accent-height"],
["alignmentBaseline", "alignment-baseline"],
["arabicForm", "arabic-form"],
["baselineShift", "baseline-shift"],
["capHeight", "cap-height"],
["clipPath", "clip-path"],
["clipRule", "clip-rule"],
["colorInterpolation", "color-interpolation"],
["colorInterpolationFilters", "color-interpolation-filters"],
["colorProfile", "color-profile"],
["colorRendering", "color-rendering"],
["dominantBaseline", "dominant-baseline"],
["enableBackground", "enable-background"],
["fillOpacity", "fill-opacity"],
["fillRule", "fill-rule"],
["floodColor", "flood-color"],
["floodOpacity", "flood-opacity"],
["fontFamily", "font-family"],
["fontSize", "font-size"],
["fontSizeAdjust", "font-size-adjust"],
["fontStretch", "font-stretch"],
["fontStyle", "font-style"],
["fontVariant", "font-variant"],
["fontWeight", "font-weight"],
["glyphName", "glyph-name"],
["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
["glyphOrientationVertical", "glyph-orientation-vertical"],
["horizAdvX", "horiz-adv-x"],
["horizOriginX", "horiz-origin-x"],
["imageRendering", "image-rendering"],
["letterSpacing", "letter-spacing"],
["lightingColor", "lighting-color"],
["markerEnd", "marker-end"],
["markerMid", "marker-mid"],
["markerStart", "marker-start"],
["overlinePosition", "overline-position"],
["overlineThickness", "overline-thickness"],
["paintOrder", "paint-order"],
["panose-1", "panose-1"],
["pointerEvents", "pointer-events"],
["renderingIntent", "rendering-intent"],
["shapeRendering", "shape-rendering"],
["stopColor", "stop-color"],
["stopOpacity", "stop-opacity"],
["strikethroughPosition", "strikethrough-position"],
["strikethroughThickness", "strikethrough-thickness"],
["strokeDasharray", "stroke-dasharray"],
["strokeDashoffset", "stroke-dashoffset"],
["strokeLinecap", "stroke-linecap"],
["strokeLinejoin", "stroke-linejoin"],
["strokeMiterlimit", "stroke-miterlimit"],
["strokeOpacity", "stroke-opacity"],
["strokeWidth", "stroke-width"],
["textAnchor", "text-anchor"],
["textDecoration", "text-decoration"],
["textRendering", "text-rendering"],
["transformOrigin", "transform-origin"],
["underlinePosition", "underline-position"],
["underlineThickness", "underline-thickness"],
["unicodeBidi", "unicode-bidi"],
["unicodeRange", "unicode-range"],
["unitsPerEm", "units-per-em"],
["vAlphabetic", "v-alphabetic"],
["vHanging", "v-hanging"],
["vIdeographic", "v-ideographic"],
["vMathematical", "v-mathematical"],
["vectorEffect", "vector-effect"],
["vertAdvY", "vert-adv-y"],
["vertOriginX", "vert-origin-x"],
["vertOriginY", "vert-origin-y"],
["wordSpacing", "word-spacing"],
["writingMode", "writing-mode"],
["xmlnsXlink", "xmlns:xlink"],
["xHeight", "x-height"]
]),
matchHtmlRegExp = /["'&<>]/;
function escapeTextForBrowser(text) {
if (
"boolean" === typeof text ||
"number" === typeof text ||
"bigint" === typeof text
)
return "" + text;
text = "" + text;
var match = matchHtmlRegExp.exec(text);
if (match) {
var html = "",
index,
lastIndex = 0;
for (index = match.index; index < text.length; index++) {
switch (text.charCodeAt(index)) {
case 34:
match = """;
break;
case 38:
match = "&";
break;
case 39:
match = "'";
break;
case 60:
match = "<";
break;
case 62:
match = ">";
break;
default:
continue;
}
lastIndex !== index && (html += text.slice(lastIndex, index));
lastIndex = index + 1;
html += match;
}
text = lastIndex !== index ? html + text.slice(lastIndex, index) : html;
}
return text;
}
var uppercasePattern = /([A-Z])/g,
msPattern = /^ms-/,
isJavaScriptProtocol =
/^[\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;
function sanitizeURL(url) {
return isJavaScriptProtocol.test("" + url)
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
: url;
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
sharedNotPendingObject = {
pending: !1,
data: null,
method: null,
action: null
},
previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
f: previousDispatcher.f,
r: previousDispatcher.r,
D: prefetchDNS,
C: preconnect,
L: preload,
m: preloadModule,
X: preinitScript,
S: preinitStyle,
M: preinitModuleScript
};
var PRELOAD_NO_CREDS = [],
currentlyFlushingRenderState = null,
scriptRegex = /(<\/|<)(s)(cript)/gi;
function scriptReplacer(match, prefix, s, suffix) {
return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
}
function createRenderState(
resumableState,
nonce,
externalRuntimeConfig,
importMap,
onHeaders,
maxHeadersLength
) {
var nonceScript = "string" === typeof nonce ? nonce : nonce && nonce.script,
inlineScriptWithNonce =
void 0 === nonceScript
? "<script"
: '<script nonce="' + escapeTextForBrowser(nonceScript) + '"',
nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
inlineStyleWithNonce =
void 0 === nonceStyle
? "<style"
: '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
idPrefix = resumableState.idPrefix,
bootstrapChunks = [],
externalRuntimeScript = null,
bootstrapScriptContent = resumableState.bootstrapScriptContent,
bootstrapScripts = resumableState.bootstrapScripts,
bootstrapModules = resumableState.bootstrapModules;
void 0 !== bootstrapScriptContent &&
(bootstrapChunks.push(inlineScriptWithNonce),
pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
bootstrapChunks.push(
">",
("" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer),
"\x3c/script>"
));
void 0 !== externalRuntimeConfig &&
("string" === typeof externalRuntimeConfig
? ((externalRuntimeScript = { src: externalRuntimeConfig, chunks: [] }),
pushScriptImpl(externalRuntimeScript.chunks, {
src: externalRuntimeConfig,
async: !0,
integrity: void 0,
nonce: nonceScript
}))
: ((externalRuntimeScript = {
src: externalRuntimeConfig.src,
chunks: []
}),
pushScriptImpl(externalRuntimeScript.chunks, {
src: externalRuntimeConfig.src,
async: !0,
integrity: externalRuntimeConfig.integrity,
nonce: nonceScript
})));
externalRuntimeConfig = [];
void 0 !== importMap &&
(externalRuntimeConfig.push('<script type="importmap">'),
externalRuntimeConfig.push(
("" + JSON.stringify(importMap)).replace(scriptRegex, scriptReplacer)
),
externalRuntimeConfig.push("\x3c/script>"));
importMap = onHeaders
? {
preconnects: "",
fontPreloads: "",
highImagePreloads: "",
remainingCapacity:
2 + ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
}
: null;
onHeaders = {
placeholderPrefix: idPrefix + "P:",
segmentPrefix: idPrefix + "S:",
boundaryPrefix: idPrefix + "B:",
startInlineScript: inlineScriptWithNonce,
startInlineStyle: inlineStyleWithNonce,
preamble: createPreambleState(),
externalRuntimeScript: externalRuntimeScript,
bootstrapChunks: bootstrapChunks,
importMapChunks: externalRuntimeConfig,
onHeaders: onHeaders,
headers: importMap,
resets: {
font: {},
dns: {},
connect: { default: {}, anonymous: {}, credentials: {} },
image: {},
style: {}
},
charsetChunks: [],
viewportChunks: [],
hoistableChunks: [],
preconnects: new Set(),
fontPreloads: new Set(),
highImagePreloads: new Set(),
styles: new Map(),
bootstrapScripts: new Set(),
scripts: new Set(),
bulkPreloads: new Set(),
preloads: {
images: new Map(),
stylesheets: new Map(),
scripts: new Map(),
moduleScripts: new Map()
},
nonce: { script: nonceScript, style: nonceStyle },
hoistableState: null,
stylesToHoist: !1
};
if (void 0 !== bootstrapScripts)
for (
inlineScriptWithNonce = 0;
inlineScriptWithNonce < bootstrapScripts.length;
inlineScriptWithNonce++
)
(importMap = bootstrapScripts[inlineScriptWithNonce]),
(idPrefix = inlineStyleWithNonce = void 0),
(externalRuntimeScript = {
rel: "preload",
as: "script",
fetchPriority: "low",
nonce: nonce
}),
"string" === typeof importMap
? (externalRuntimeScript.href = nonceStyle = importMap)
: ((externalRuntimeScript.href = nonceStyle = importMap.src),
(externalRuntimeScript.integrity = idPrefix =
"string" === typeof importMap.integrity
? importMap.integrity
: void 0),
(externalRuntimeScript.crossOrigin = inlineStyleWithNonce =
"string" === typeof importMap || null == importMap.crossOrigin
? void 0
: "use-credentials" === importMap.crossOrigin
? "use-credentials"
: "")),
(importMap = resumableState),
(maxHeadersLength = nonceStyle),
(importMap.scriptResources[maxHeadersLength] = null),
(importMap.moduleScriptResources[maxHeadersLength] = null),
(importMap = []),
pushLinkImpl(importMap, externalRuntimeScript),
onHeaders.bootstrapScripts.add(importMap),
bootstrapChunks.push(
'<script src="',
escapeTextForBrowser(nonceStyle),
'"'
),
nonceScript &&
bootstrapChunks.push(
' nonce="',
escapeTextForBrowser(nonceScript),
'"'
),
"string" === typeof idPrefix &&
bootstrapChunks.push(
' integrity="',
escapeTextForBrowser(idPrefix),
'"'
),
"string" === typeof inlineStyleWithNonce &&
bootstrapChunks.push(
' crossorigin="',
escapeTextForBrowser(inlineStyleWithNonce),
'"'
),
pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
bootstrapChunks.push(' async="">\x3c/script>');
if (void 0 !== bootstrapModules)
for (nonce = 0; nonce < bootstrapModules.length; nonce++)
(idPrefix = bootstrapModules[nonce]),
(nonceStyle = inlineScriptWithNonce = void 0),
(inlineStyleWithNonce = {
rel: "modulepreload",
fetchPriority: "low",
nonce: nonceScript
}),
"string" === typeof idPrefix
? (inlineStyleWithNonce.href = bootstrapScripts = idPrefix)
: ((inlineStyleWithNonce.href = bootstrapScripts = idPrefix.src),
(inlineStyleWithNonce.integrity = nonceStyle =
"string" === typeof idPrefix.integrity
? idPrefix.integrity
: void 0),
(inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
"string" === typeof idPrefix || null == idPrefix.crossOrigin
? void 0
: "use-credentials" === idPrefix.crossOrigin
? "use-credentials"
: "")),
(idPrefix = resumableState),
(externalRuntimeScript = bootstrapScripts),
(idPrefix.scriptResources[externalRuntimeScript] = null),
(idPrefix.moduleScriptResources[externalRuntimeScript] = null),
(idPrefix = []),
pushLinkImpl(idPrefix, inlineStyleWithNonce),
onHeaders.bootstrapScripts.add(idPrefix),
bootstrapChunks.push(
'<script type="module" src="',
escapeTextForBrowser(bootstrapScripts),
'"'
),
nonceScript &&
bootstrapChunks.push(
' nonce="',
escapeTextForBrowser(nonceScript),
'"'
),
"string" === typeof nonceStyle &&
bootstrapChunks.push(
' integrity="',
escapeTextForBrowser(nonceStyle),
'"'
),
"string" === typeof inlineScriptWithNonce &&
bootstrapChunks.push(
' crossorigin="',
escapeTextForBrowser(inlineScriptWithNonce),
'"'
),
pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
bootstrapChunks.push(' async="">\x3c/script>');
return onHeaders;
}
function createResumableState(
identifierPrefix,
externalRuntimeConfig,
bootstrapScriptContent,
bootstrapScripts,
bootstrapModules
) {
var streamingFormat = 0;
void 0 !== externalRuntimeConfig && (streamingFormat = 1);
return {
idPrefix: void 0 === identifierPrefix ? "" : identifierPrefix,
nextFormID: 0,
streamingFormat: streamingFormat,
bootstrapScriptContent: bootstrapScriptContent,
bootstrapScripts: bootstrapScripts,
bootstrapModules: bootstrapModules,
instructions: 0,
hasBody: !1,
hasHtml: !1,
unknownResources: {},
dnsResources: {},
connectResources: { default: {}, anonymous: {}, credentials: {} },
imageResources: {},
styleResources: {},
scriptResources: {},
moduleUnknownResources: {},
moduleScriptResources: {}
};
}
function createPreambleState() {
return { htmlChunks: null, headChunks: null, bodyChunks: null };
}
function createFormatContext(
insertionMode,
selectedValue,
tagScope,
viewTransition
) {
return {
insertionMode: insertionMode,
selectedValue: selectedValue,
tagScope: tagScope,
viewTransition: viewTransition
};
}
function createRootFormatContext(namespaceURI) {
return createFormatContext(
"http://www.w3.org/2000/svg" === namespaceURI
? 4
: "http://www.w3.org/1998/Math/MathML" === namespaceURI
? 5
: 0,
null,
0,
null
);
}
function getChildFormatContext(parentContext, type, props) {
var subtreeScope = parentContext.tagScope & -25;
switch (type) {
case "noscript":
return createFormatContext(2, null, subtreeScope | 1, null);
case "select":
return createFormatContext(
2,
null != props.value ? props.value : props.defaultValue,
subtreeScope,
null
);
case "svg":
return createFormatContext(4, null, subtreeScope, null);
case "picture":
return createFormatContext(2, null, subtreeScope | 2, null);
case "math":
return createFormatContext(5, null, subtreeScope, null);
case "foreignObject":
return createFormatContext(2, null, subtreeScope, null);
case "table":
return createFormatContext(6, null, subtreeScope, null);
case "thead":
case "tbody":
case "tfoot":
return createFormatContext(7, null, subtreeScope, null);
case "colgroup":
return createFormatContext(9, null, subtreeScope, null);
case "tr":
return createFormatContext(8, null, subtreeScope, null);
case "head":
if (2 > parentContext.insertionMode)
return createFormatContext(3, null, subtreeScope, null);
break;
case "html":
if (0 === parentContext.insertionMode)
return createFormatContext(1, null, subtreeScope, null);
}
return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
? createFormatContext(2, null, subtreeScope, null)
: null !== parentContext.viewTransition ||
parentContext.tagScope !== subtreeScope
? createFormatContext(
parentContext.insertionMode,
parentContext.selectedValue,
subtreeScope,
null
)
: parentContext;
}
function getSuspenseViewTransition(parentViewTransition) {
return null === parentViewTransition
? null
: {
update: parentViewTransition.update,
enter: "none",
exit: "none",
share: parentViewTransition.update,
name: parentViewTransition.autoName,
autoName: parentViewTransition.autoName,
nameIdx: 0
};
}
function getSuspenseFallbackFormatContext(resumableState, parentContext) {
parentContext.tagScope & 32 && (resumableState.instructions |= 128);
return createFormatContext(
parentContext.insertionMode,
parentContext.selectedValue,
parentContext.tagScope | 12,
getSuspenseViewTransition(parentContext.viewTransition)
);
}
function getSuspenseContentFormatContext(resumableState, parentContext) {
return createFormatContext(
parentContext.insertionMode,
parentContext.selectedValue,
parentContext.tagScope | 16,
getSuspenseViewTransition(parentContext.viewTransition)
);
}
function makeId(resumableState, treeId, localId) {
resumableState = "_" + resumableState.idPrefix + "R_" + treeId;
0 < localId && (resumableState += "H" + localId.toString(32));
return resumableState + "_";
}
function pushTextInstance(target, text, renderState, textEmbedded) {
if ("" === text) return textEmbedded;
textEmbedded && target.push("\x3c!-- --\x3e");
target.push(escapeTextForBrowser(text));
return !0;
}
function pushSegmentFinale(target, renderState, lastPushedText, textEmbedded) {
lastPushedText && textEmbedded && target.push("\x3c!-- --\x3e");
}
function pushViewTransitionAttributes(target, formatContext) {
formatContext = formatContext.viewTransition;
null !== formatContext &&
("auto" !== formatContext.name &&
(pushStringAttribute(
target,
"vt-name",
0 === formatContext.nameIdx
? formatContext.name
: formatContext.name + "_" + formatContext.nameIdx
),
formatContext.nameIdx++),
pushStringAttribute(target, "vt-update", formatContext.update),
"none" !== formatContext.enter &&
pushStringAttribute(target, "vt-enter", formatContext.enter),
"none" !== formatContext.exit &&
pushStringAttribute(target, "vt-exit", formatContext.exit),
"none" !== formatContext.share &&
pushStringAttribute(target, "vt-share", formatContext.share));
}
var styleNameCache = new Map();
function pushStyleAttribute(target, style) {
if ("object" !== typeof style)
throw Error(
"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
);
var isFirst = !0,
styleName;
for (styleName in style)
if (hasOwnProperty.call(style, styleName)) {
var styleValue = style[styleName];
if (
null != styleValue &&
"boolean" !== typeof styleValue &&
"" !== styleValue
) {
if (0 === styleName.indexOf("--")) {
var nameChunk = escapeTextForBrowser(styleName);
styleValue = escapeTextForBrowser(("" + styleValue).trim());
} else
(nameChunk = styleNameCache.get(styleName)),
void 0 === nameChunk &&
((nameChunk = escapeTextForBrowser(
styleName
.replace(uppercasePattern, "-$1")
.toLowerCase()
.replace(msPattern, "-ms-")
)),
styleNameCache.set(styleName, nameChunk)),
(styleValue =
"number" === typeof styleValue
? 0 === styleValue || unitlessNumbers.has(styleName)
? "" + styleValue
: styleValue + "px"
: escapeTextForBrowser(("" + styleValue).trim()));
isFirst
? ((isFirst = !1),
target.push(' style="', nameChunk, ":", styleValue))
: target.push(";", nameChunk, ":", styleValue);
}
}
isFirst || target.push('"');
}
function pushBooleanAttribute(target, name, value) {
value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '=""');
}
function pushStringAttribute(target, name, value) {
"function" !== typeof value &&
"symbol" !== typeof value &&
"boolean" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
}
var actionJavaScriptURL = escapeTextForBrowser(
"javascript:throw new Error('React form unexpectedly submitted.')"
);
function pushAdditionalFormField(value, key) {
this.push('<input type="hidden"');
validateAdditionalFormField(value);
pushStringAttribute(this, "name", key);
pushStringAttribute(this, "value", value);
this.push("/>");
}
function validateAdditionalFormField(value) {
if ("string" !== typeof value)
throw Error(
"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."
);
}
function getCustomFormFields(resumableState, formAction) {
if ("function" === typeof formAction.$$FORM_ACTION) {
var id = resumableState.nextFormID++;
resumableState = resumableState.idPrefix + id;
try {
var customFields = formAction.$$FORM_ACTION(resumableState);
if (customFields) {
var formData = customFields.data;
null != formData && formData.forEach(validateAdditionalFormField);
}
return customFields;
} catch (x) {
if ("object" === typeof x && null !== x && "function" === typeof x.then)
throw x;
}
}
return null;
}
function pushFormActionAttribute(
target,
resumableState,
renderState,
formAction,
formEncType,
formMethod,
formTarget,
name
) {
var formData = null;
if ("function" === typeof formAction) {
var customFields = getCustomFormFields(resumableState, formAction);
null !== customFields
? ((name = customFields.name),
(formAction = customFields.action || ""),
(formEncType = customFields.encType),
(formMethod = customFields.method),
(formTarget = customFields.target),
(formData = customFields.data))
: (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'),
(formTarget = formMethod = formEncType = formAction = name = null),
injectFormReplayingRuntime(resumableState, renderState));
}
null != name && pushAttribute(target, "name", name);
null != formAction && pushAttribute(target, "formAction", formAction);
null != formEncType && pushAttribute(target, "formEncType", formEncType);
null != formMethod && pushAttribute(target, "formMethod", formMethod);
null != formTarget && pushAttribute(target, "formTarget", formTarget);
return formData;
}
var blobCache = null;
function pushSrcObjectAttribute(target, blob) {
null === blobCache && (blobCache = new WeakMap());
var suspenseCache = blobCache,
thenable = suspenseCache.get(blob);
void 0 === thenable &&
((thenable = readAsDataURL(blob)),
thenable.then(
function (result) {
thenable.status = "fulfilled";
thenable.value = result;
},
function (error) {
thenable.status = "rejected";
thenable.reason = error;
}
),
suspenseCache.set(blob, thenable));
if ("rejected" === thenable.status) throw thenable.reason;
if ("fulfilled" !== thenable.status) throw thenable;
target.push(" ", "src", '="', escapeTextForBrowser(thenable.value), '"');
}
function pushAttribute(target, name, value) {
switch (name) {
case "className":
pushStringAttribute(target, "class", value);
break;
case "tabIndex":
pushStringAttribute(target, "tabindex", value);
break;
case "dir":
case "role":
case "viewBox":
case "width":
case "height":
pushStringAttribute(target, name, value);
break;
case "style":
pushStyleAttribute(target, value);
break;
case "src":
if (
"object" === typeof value &&
null !== value &&
"function" === typeof Blob &&
value instanceof Blob
) {
pushSrcObjectAttribute(target, value);
break;
}
case "href":
if ("" === value) break;
case "action":
case "formAction":
if (
null == value ||
"function" === typeof value ||
"symbol" === typeof value ||
"boolean" === typeof value
)
break;
value = sanitizeURL("" + value);
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "defaultValue":
case "defaultChecked":
case "innerHTML":
case "suppressContentEditableWarning":
case "suppressHydrationWarning":
case "ref":
break;
case "autoFocus":
case "multiple":
case "muted":
pushBooleanAttribute(target, name.toLowerCase(), value);
break;
case "xlinkHref":
if (
"function" === typeof value ||
"symbol" === typeof value ||
"boolean" === typeof value
)
break;
value = sanitizeURL("" + value);
target.push(" ", "xlink:href", '="', escapeTextForBrowser(value), '"');
break;
case "contentEditable":
case "spellCheck":
case "draggable":
case "value":
case "autoReverse":
case "externalResourcesRequired":
case "focusable":
case "preserveAlpha":
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "inert":
case "allowFullScreen":
case "async":
case "autoPlay":
case "controls":
case "default":
case "defer":
case "disabled":
case "disablePictureInPicture":
case "disableRemotePlayback":
case "formNoValidate":
case "hidden":
case "loop":
case "noModule":
case "noValidate":
case "open":
case "playsInline":
case "readOnly":
case "required":
case "reversed":
case "scoped":
case "seamless":
case "itemScope":
value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '=""');
break;
case "capture":
case "download":
!0 === value
? target.push(" ", name, '=""')
: !1 !== value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "cols":
case "rows":
case "size":
case "span":
"function" !== typeof value &&
"symbol" !== typeof value &&
!isNaN(value) &&
1 <= value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "rowSpan":
case "start":
"function" === typeof value ||
"symbol" === typeof value ||
isNaN(value) ||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "xlinkActuate":
pushStringAttribute(target, "xlink:actuate", value);
break;
case "xlinkArcrole":
pushStringAttribute(target, "xlink:arcrole", value);
break;
case "xlinkRole":
pushStringAttribute(target, "xlink:role", value);
break;
case "xlinkShow":
pushStringAttribute(target, "xlink:show", value);
break;
case "xlinkTitle":
pushStringAttribute(target, "xlink:title", value);
break;
case "xlinkType":
pushStringAttribute(target, "xlink:type", value);
break;
case "xmlBase":
pushStringAttribute(target, "xml:base", value);
break;
case "xmlLang":
pushStringAttribute(target, "xml:lang", value);
break;
case "xmlSpace":
pushStringAttribute(target, "xml:space", value);
break;
default:
if (
!(2 < name.length) ||
("o" !== name[0] && "O" !== name[0]) ||
("n" !== name[1] && "N" !== name[1])
)
if (((name = aliases.get(name) || name), isAttributeNameSafe(name))) {
switch (typeof value) {
case "function":
case "symbol":
return;
case "boolean":
var prefix$8 = name.toLowerCase().slice(0, 5);
if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
}
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
}
}
}
function pushInnerHTML(target, innerHTML, children) {
if (null != innerHTML) {
if (null != children)
throw Error(
"Can only set one of `children` or `props.dangerouslySetInnerHTML`."
);
if ("object" !== typeof innerHTML || !("__html" in innerHTML))
throw Error(
"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."
);
innerHTML = innerHTML.__html;
null !== innerHTML && void 0 !== innerHTML && target.push("" + innerHTML);
}
}
function flattenOptionChildren(children) {
var content = "";
React.Children.forEach(children, function (child) {
null != child && (content += child);
});
return content;
}
function injectFormReplayingRuntime(resumableState, renderState) {
if (
0 === (resumableState.instructions & 16) &&
!renderState.externalRuntimeScript
) {
resumableState.instructions |= 16;
var preamble = renderState.preamble,
bootstrapChunks = renderState.bootstrapChunks;
(preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length
? (bootstrapChunks.push(renderState.startInlineScript),
pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
bootstrapChunks.push(
">",
'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))}});',
"\x3c/script>"
))
: bootstrapChunks.unshift(
renderState.startInlineScript,
">",
'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))}});',
"\x3c/script>"
);
}
}
function pushLinkImpl(target, props) {
target.push(startChunkForTag("link"));
for (var propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
case "dangerouslySetInnerHTML":
throw Error(
"link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
);
default:
pushAttribute(target, propKey, propValue);
}
}
target.push("/>");
return null;
}
var styleRegex = /(<\/|<)(s)(tyle)/gi;
function styleReplacer(match, prefix, s, suffix) {
return "" + prefix + ("s" === s ? "\\73 " : "\\53 ") + suffix;
}
function pushSelfClosing(target, props, tag, formatContext) {
target.push(startChunkForTag(tag));
for (var propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
case "dangerouslySetInnerHTML":
throw Error(
tag +
" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
);
default:
pushAttribute(target, propKey, propValue);
}
}
pushViewTransitionAttributes(target, formatContext);
target.push("/>");
return null;
}
function pushTitleImpl(target, props) {
target.push(startChunkForTag("title"));
var children = null,
innerHTML = null,
propKey;
for (propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
children = propValue;
break;
case "dangerouslySetInnerHTML":
innerHTML = propValue;
break;
default:
pushAttribute(target, propKey, propValue);
}
}
target.push(">");
props = Array.isArray(children)
? 2 > children.length
? children[0]
: null
: children;
"function" !== typeof props &&
"symbol" !== typeof props &&
null !== props &&
void 0 !== props &&
target.push(escapeTextForBrowser("" + props));
pushInnerHTML(target, innerHTML, children);
target.push(endChunkForTag("title"));
return null;
}
function pushScriptImpl(target, props) {
target.push(startChunkForTag("script"));
var children = null,
innerHTML = null,
propKey;
for (propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
children = propValue;
break;
case "dangerouslySetInnerHTML":
innerHTML = propValue;
break;
default:
pushAttribute(target, propKey, propValue);
}
}
target.push(">");
pushInnerHTML(target, innerHTML, children);
"string" === typeof children &&
target.push(("" + children).replace(scriptRegex, scriptReplacer));
target.push(endChunkForTag("script"));
return null;
}
function pushStartSingletonElement(target, props, tag, formatContext) {
target.push(startChunkForTag(tag));
var innerHTML = (tag = null),
propKey;
for (propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
tag = propValue;
break;
case "dangerouslySetInnerHTML":
innerHTML = propValue;
break;
default:
pushAttribute(target, propKey, propValue);
}
}
pushViewTransitionAttributes(target, formatContext);
target.push(">");
pushInnerHTML(target, innerHTML, tag);
return tag;
}
function pushStartGenericElement(target, props, tag, formatContext) {
target.push(startChunkForTag(tag));
var innerHTML = (tag = null),
propKey;
for (propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
tag = propValue;
break;
case "dangerouslySetInnerHTML":
innerHTML = propValue;
break;
default:
pushAttribute(target, propKey, propValue);
}
}
pushViewTransitionAttributes(target, formatContext);
target.push(">");
pushInnerHTML(target, innerHTML, tag);
return "string" === typeof tag
? (target.push(escapeTextForBrowser(tag)), null)
: tag;
}
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,
validatedTagCache = new Map();
function startChunkForTag(tag) {
var tagStartChunk = validatedTagCache.get(tag);
if (void 0 === tagStartChunk) {
if (!VALID_TAG_REGEX.test(tag)) throw Error("Invalid tag: " + tag);
tagStartChunk = "<" + tag;
validatedTagCache.set(tag, tagStartChunk);
}
return tagStartChunk;
}
function pushStartInstance(
target$jscomp$0,
type,
props,
resumableState,
renderState,
preambleState,
hoistableState,
formatContext,
textEmbedded
) {
switch (type) {
case "div":
case "span":
case "svg":
case "path":
break;
case "a":
target$jscomp$0.push(startChunkForTag("a"));
var children = null,
innerHTML = null,
propKey;
for (propKey in props)
if (hasOwnProperty.call(props, propKey)) {
var propValue = props[propKey];
if (null != propValue)
switch (propKey) {
case "children":
children = propValue;
break;
case "dangerouslySetInnerHTML":
innerHTML = propValue;
break;
case "href":
"" === propValue
? pushStringAttribute(target$jscomp$0, "href", "")
: pushAttribute(target$jscomp$0, propKey, propValue);
break;
default:
pushAttribute(target$jscomp$0, propKey, propValue);
}
}
pushViewTransitionAttributes(target$jscomp$0, formatContext);
target$jscomp$0.push(">");
pushInnerHTML(target$jscomp$0, innerHTML, children);
if ("string" === typeof children) {
target$jscomp$0.push(escapeTextForBrowser(children));
var JSCompiler_inline_result = null;
} else JSCompiler_inline_result = children;
return JSCompiler_inline_result;
case "g":
case "p":
case "li":
break;
case "select":
target$jscomp$0.push(startChunkForTag("select"));
var children$jscomp$0 = null,
innerHTML$jscomp$0 = null,
propKey$jscomp$0;
for (propKey$jscomp$0 in props)
if (hasOwnProperty.call(props, propKey$jscomp$0)) {
var propValue$jscomp$0 = props[propKey$jscomp$0];
if (null != propValue$jscomp$0)
switch (propKey$jscomp$0) {
case "children":
children$jscomp$0 = propValue$jscomp$0;
break;
case "dangerouslySetInnerHTML":
innerHTML$jscomp$0 = propValue$jscomp$0;
break;
case "defaultValue":
case "value":
break;
default:
pushAttribute(
target$jscomp$0,
propKey$jscomp$0,
propValue$jscomp$0
);
}
}
pushViewTransitionAttributes(target$jscomp$0, formatContext);
target$jscomp$0.push(">");
pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0);
return children$jscomp$0;
case "option":
var selectedValue = formatContext.selectedValue;
target$jscomp$0.push(startChunkForTag("option"));
var children$jscomp$1 = null,
value = null,
selected = null,
innerHTML$jscomp$1 = null,
propKey$jscomp$1;
for (propKey$jscomp$1 in props)
if (hasOwnProperty.call(props, propKey$jscomp$1)) {
var propValue$jscomp$1 = props[propKey$jscomp$1];
if (null != propValue$jscomp$1)
switch (propKey$jscomp$1) {
case "children":
children$jscomp$1 = propValue$jscomp$1;
break;
case "selected":
selected = propValue$jscomp$1;
break;
case "dangerouslySetInnerHTML":
innerHTML$jscomp$1 = propValue$jscomp$1;
break;
case "value":
value = propValue$jscomp$1;
default:
pushAttribute(
target$jscomp$0,
propKey$jscomp$1,
propValue$jscomp$1
);
}
}
if (null != selectedValue) {
var stringValue =
null !== value
? "" + value
: flattenOptionChildren(children$jscomp$1);
if (isArrayImpl(selectedValue))
for (var i = 0; i < selectedValue.length; i++) {
if ("" + selectedValue[i] === stringValue) {
target$jscomp$0.push(' selected=""');
break;
}
}
else
"" + selectedValue === stringValue &&
target$jscomp$0.push(' selected=""');
} else selected && target$jscomp$0.push(' selected=""');
target$jscomp$0.push(">");
pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1);
return children$jscomp$1;
case "textarea":
target$jscomp$0.push(startChunkForTag("textarea"));
var value$jscomp$0 = null,
defaultValue = null,
children$jscomp$2 = null,
propKey$jscomp$2;
for (propKey$jscomp$2 in props)
if (hasOwnProperty.call(props, propKey$jscomp$2)) {
var propValue$jscomp$2 = props[propKey$jscomp$2];
if (null != propValue$jscomp$2)
switch (propKey$jscomp$2) {
case "children":
children$jscomp$2 = propValue$jscomp$2;
break;
case "value":
value$jscomp$0 = propValue$jscomp$2;
break;
case "defaultValue":
defaultValue = propValue$jscomp$2;
break;
case "dangerouslySetInnerHTML":
throw Error(
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
);
default:
pushAttribute(
target$jscomp$0,
propKey$jscomp$2,
propValue$jscomp$2
);
}
}
null === value$jscomp$0 &&
null !== defaultValue &&
(value$jscomp$0 = defaultValue);
pushViewTransitionAttributes(target$jscomp$0, formatContext);
target$jscomp$0.push(">");
if (null != children$jscomp$2) {
if (null != value$jscomp$0)
throw Error(
"If you supply `defaultValue` on a <textarea>, do not pass children."
);
if (isArrayImpl(children$jscomp$2)) {
if (1 < children$jscomp$2.length)
throw Error("<textarea> can only have at most one child.");
value$jscomp$0 = "" + children$jscomp$2[0];
}
value$jscomp$0 = "" + children$jscomp$2;
}
"string" === typeof value$jscomp$0 &&
"\n" === value$jscomp$0[0] &&
target$jscomp$0.push("\n");
null !== value$jscomp$0 &&
target$jscomp$0.push(escapeTextForBrowser("" + value$jscomp$0));
return null;
case "input":
target$jscomp$0.push(startChunkForTag("input"));
var name = null,
formAction = null,
formEncType = null,
formMethod = null,
formTarget = null,
value$jscomp$1 = null,
defaultValue$jscomp$0 = null,
checked = null,
defaultChecked = null,
propKey$jscomp$3;
for (propKey$jscomp$3 in props)
if (hasOwnProperty.call(props, propKey$jscomp$3)) {
var propValue$jscomp$3 = props[propKey$jscomp$3];
if (null != propValue$jscomp$3)
switch (propKey$jscomp$3) {
case "children":
case "dangerouslySetInnerHTML":
throw Error(
"input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
);
case "name":
name = propValue$jscomp$3;
break;
case "formAction":
formAction = propValue$jscomp$3;
break;
case "formEncType":
formEncType = propValue$jscomp$3;
break;
case "formMethod":
formMethod = propValue$jscomp$3;
break;
case "formTarget":
formTarget = propValue$jscomp$3;
break;
case "defaultChecked":
defaultChecked = propValue$jscomp$3;
break;
case "defaultValue":
defaultValue$jscomp$0 = propValue$jscomp$3;
break;
case "checked":
checked = propValue$jscomp$3;
break;
case "value":
value$jscomp$1 = propValue$jscomp$3;
break;
default:
pushAttribute(
target$jscomp$0,
propKey$jscomp$3,
propValue$jscomp$3
);
}
}
var formData = pushFormActionAttribute(
target$jscomp$0,
resumableState,
renderState,
formAction,
formEncType,
formMethod,
formTarget,
name
);
null !== checked
? pushBooleanAttribute(target$jscomp$0, "checked", checked)
: null !== defaultChecked &&
pushBooleanAtt