UNPKG

next

Version:

The React Framework

1,350 lines (1,347 loc) • 107 kB
/** * @license React * react-server-dom-webpack-client.node.development.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"; "production" !== process.env.NODE_ENV && (function () { function _defineProperty(obj, key, value) { key in obj ? Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }) : (obj[key] = value); return obj; } function resolveClientReference(bundlerConfig, metadata) { if (bundlerConfig) { var moduleExports = bundlerConfig[metadata[0]]; if ((bundlerConfig = moduleExports && moduleExports[metadata[2]])) moduleExports = bundlerConfig.name; else { bundlerConfig = moduleExports && moduleExports["*"]; if (!bundlerConfig) throw Error( 'Could not find the module "' + metadata[0] + '" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.' ); moduleExports = metadata[2]; } return 4 === metadata.length ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1] : [bundlerConfig.id, bundlerConfig.chunks, moduleExports]; } return metadata; } function resolveServerReference(bundlerConfig, id) { var name = "", resolvedModuleData = bundlerConfig[id]; if (resolvedModuleData) name = resolvedModuleData.name; else { var idx = id.lastIndexOf("#"); -1 !== idx && ((name = id.slice(idx + 1)), (resolvedModuleData = bundlerConfig[id.slice(0, idx)])); if (!resolvedModuleData) throw Error( 'Could not find the module "' + id + '" in the React Server Manifest. This is probably a bug in the React Server Components bundler.' ); } return resolvedModuleData.async ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1] : [resolvedModuleData.id, resolvedModuleData.chunks, name]; } function requireAsyncModule(id) { var promise = globalThis.__next_require__(id); if ("function" !== typeof promise.then || "fulfilled" === promise.status) return null; promise.then( function (value) { promise.status = "fulfilled"; promise.value = value; }, function (reason) { promise.status = "rejected"; promise.reason = reason; } ); return promise; } function ignoreReject() {} function preloadModule(metadata) { for ( var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) { var chunkId = chunks[i++]; chunks[i++]; var entry = chunkCache.get(chunkId); if (void 0 === entry) { entry = __webpack_chunk_load__(chunkId); promises.push(entry); var resolve = chunkCache.set.bind(chunkCache, chunkId, null); entry.then(resolve, ignoreReject); chunkCache.set(chunkId, entry); } else null !== entry && promises.push(entry); } return 4 === metadata.length ? 0 === promises.length ? requireAsyncModule(metadata[0]) : Promise.all(promises).then(function () { return requireAsyncModule(metadata[0]); }) : 0 < promises.length ? Promise.all(promises) : null; } function requireModule(metadata) { var moduleExports = globalThis.__next_require__(metadata[0]); if (4 === metadata.length && "function" === typeof moduleExports.then) if ("fulfilled" === moduleExports.status) moduleExports = moduleExports.value; else throw moduleExports.reason; return "*" === metadata[2] ? moduleExports : "" === metadata[2] ? moduleExports.__esModule ? moduleExports.default : moduleExports : moduleExports[metadata[2]]; } function prepareDestinationWithChunks( moduleLoading, chunks, nonce$jscomp$0 ) { if (null !== moduleLoading) for (var i = 1; i < chunks.length; i += 2) { var nonce = nonce$jscomp$0, JSCompiler_temp_const = ReactDOMSharedInternals.d, JSCompiler_temp_const$jscomp$0 = JSCompiler_temp_const.X, JSCompiler_temp_const$jscomp$1 = moduleLoading.prefix + chunks[i]; var JSCompiler_inline_result = moduleLoading.crossOrigin; JSCompiler_inline_result = "string" === typeof JSCompiler_inline_result ? "use-credentials" === JSCompiler_inline_result ? JSCompiler_inline_result : "" : void 0; JSCompiler_temp_const$jscomp$0.call( JSCompiler_temp_const, JSCompiler_temp_const$jscomp$1, { crossOrigin: JSCompiler_inline_result, nonce: nonce } ); } } 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; } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; if (object === ObjectPrototype) return !0; if (getPrototypeOf(object)) return !1; object = Object.getOwnPropertyNames(object); for (var i = 0; i < object.length; i++) if (!(object[i] in ObjectPrototype)) return !1; return !0; } function isSimpleObject(object) { if (!isObjectPrototype(getPrototypeOf(object))) return !1; for ( var names = Object.getOwnPropertyNames(object), i = 0; i < names.length; i++ ) { var descriptor = Object.getOwnPropertyDescriptor(object, names[i]); if ( !descriptor || (!descriptor.enumerable && (("key" !== names[i] && "ref" !== names[i]) || "function" !== typeof descriptor.get)) ) return !1; } return !0; } function objectName(object) { return Object.prototype.toString .call(object) .replace(/^\[object (.*)\]$/, function (m, p0) { return p0; }); } function describeKeyForErrorMessage(key) { var encodedKey = JSON.stringify(key); return '"' + key + '"' === encodedKey ? key : encodedKey; } function describeValueForErrorMessage(value) { switch (typeof value) { case "string": return JSON.stringify( 10 >= value.length ? value : value.slice(0, 10) + "..." ); case "object": if (isArrayImpl(value)) return "[...]"; if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG) return "client"; value = objectName(value); return "Object" === value ? "{...}" : value; case "function": return value.$$typeof === CLIENT_REFERENCE_TAG ? "client" : (value = value.displayName || value.name) ? "function " + value : "function"; default: return String(value); } } function describeElementType(type) { if ("string" === typeof type) return type; switch (type) { case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if ("object" === typeof type) switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeElementType(type.render); case REACT_MEMO_TYPE: return describeElementType(type.type); case REACT_LAZY_TYPE: var payload = type._payload; type = type._init; try { return describeElementType(type(payload)); } catch (x) {} } return ""; } function describeObjectForErrorMessage(objectOrArray, expandedName) { var objKind = objectName(objectOrArray); if ("Object" !== objKind && "Array" !== objKind) return objKind; var start = -1, length = 0; if (isArrayImpl(objectOrArray)) if (jsxChildrenParents.has(objectOrArray)) { var type = jsxChildrenParents.get(objectOrArray); objKind = "<" + describeElementType(type) + ">"; for (var i = 0; i < objectOrArray.length; i++) { var value = objectOrArray[i]; value = "string" === typeof value ? value : "object" === typeof value && null !== value ? "{" + describeObjectForErrorMessage(value) + "}" : "{" + describeValueForErrorMessage(value) + "}"; "" + i === expandedName ? ((start = objKind.length), (length = value.length), (objKind += value)) : (objKind = 15 > value.length && 40 > objKind.length + value.length ? objKind + value : objKind + "{...}"); } objKind += "</" + describeElementType(type) + ">"; } else { objKind = "["; for (type = 0; type < objectOrArray.length; type++) 0 < type && (objKind += ", "), (i = objectOrArray[type]), (i = "object" === typeof i && null !== i ? describeObjectForErrorMessage(i) : describeValueForErrorMessage(i)), "" + type === expandedName ? ((start = objKind.length), (length = i.length), (objKind += i)) : (objKind = 10 > i.length && 40 > objKind.length + i.length ? objKind + i : objKind + "..."); objKind += "]"; } else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) objKind = "<" + describeElementType(objectOrArray.type) + "/>"; else { if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client"; if (jsxPropsParents.has(objectOrArray)) { objKind = jsxPropsParents.get(objectOrArray); objKind = "<" + (describeElementType(objKind) || "..."); type = Object.keys(objectOrArray); for (i = 0; i < type.length; i++) { objKind += " "; value = type[i]; objKind += describeKeyForErrorMessage(value) + "="; var _value2 = objectOrArray[value]; var _substr2 = value === expandedName && "object" === typeof _value2 && null !== _value2 ? describeObjectForErrorMessage(_value2) : describeValueForErrorMessage(_value2); "string" !== typeof _value2 && (_substr2 = "{" + _substr2 + "}"); value === expandedName ? ((start = objKind.length), (length = _substr2.length), (objKind += _substr2)) : (objKind = 10 > _substr2.length && 40 > objKind.length + _substr2.length ? objKind + _substr2 : objKind + "..."); } objKind += ">"; } else { objKind = "{"; type = Object.keys(objectOrArray); for (i = 0; i < type.length; i++) 0 < i && (objKind += ", "), (value = type[i]), (objKind += describeKeyForErrorMessage(value) + ": "), (_value2 = objectOrArray[value]), (_value2 = "object" === typeof _value2 && null !== _value2 ? describeObjectForErrorMessage(_value2) : describeValueForErrorMessage(_value2)), value === expandedName ? ((start = objKind.length), (length = _value2.length), (objKind += _value2)) : (objKind = 10 > _value2.length && 40 > objKind.length + _value2.length ? objKind + _value2 : objKind + "..."); objKind += "}"; } } return void 0 === expandedName ? objKind : -1 < start && 0 < length ? ((objectOrArray = " ".repeat(start) + "^".repeat(length)), "\n " + objKind + "\n " + objectOrArray) : "\n " + objKind; } function serializeNumber(number) { return Number.isFinite(number) ? 0 === number && -Infinity === 1 / number ? "$-0" : number : Infinity === number ? "$Infinity" : -Infinity === number ? "$-Infinity" : "$NaN"; } function processReply( root, formFieldPrefix, temporaryReferences, resolve, reject ) { function serializeTypedArray(tag, typedArray) { typedArray = new Blob([ new Uint8Array( typedArray.buffer, typedArray.byteOffset, typedArray.byteLength ) ]); var blobId = nextPartId++; null === formData && (formData = new FormData()); formData.append(formFieldPrefix + blobId, typedArray); return "$" + tag + blobId.toString(16); } function serializeBinaryReader(reader) { function progress(entry) { entry.done ? ((entry = nextPartId++), data.append(formFieldPrefix + entry, new Blob(buffer)), data.append( formFieldPrefix + streamId, '"$o' + entry.toString(16) + '"' ), data.append(formFieldPrefix + streamId, "C"), pendingParts--, 0 === pendingParts && resolve(data)) : (buffer.push(entry.value), reader.read(new Uint8Array(1024)).then(progress, reject)); } null === formData && (formData = new FormData()); var data = formData; pendingParts++; var streamId = nextPartId++, buffer = []; reader.read(new Uint8Array(1024)).then(progress, reject); return "$r" + streamId.toString(16); } function serializeReader(reader) { function progress(entry) { if (entry.done) data.append(formFieldPrefix + streamId, "C"), pendingParts--, 0 === pendingParts && resolve(data); else try { var partJSON = JSON.stringify(entry.value, resolveToJSON); data.append(formFieldPrefix + streamId, partJSON); reader.read().then(progress, reject); } catch (x) { reject(x); } } null === formData && (formData = new FormData()); var data = formData; pendingParts++; var streamId = nextPartId++; reader.read().then(progress, reject); return "$R" + streamId.toString(16); } function serializeReadableStream(stream) { try { var binaryReader = stream.getReader({ mode: "byob" }); } catch (x) { return serializeReader(stream.getReader()); } return serializeBinaryReader(binaryReader); } function serializeAsyncIterable(iterable, iterator) { function progress(entry) { if (entry.done) { if (void 0 === entry.value) data.append(formFieldPrefix + streamId, "C"); else try { var partJSON = JSON.stringify(entry.value, resolveToJSON); data.append(formFieldPrefix + streamId, "C" + partJSON); } catch (x) { reject(x); return; } pendingParts--; 0 === pendingParts && resolve(data); } else try { var _partJSON = JSON.stringify(entry.value, resolveToJSON); data.append(formFieldPrefix + streamId, _partJSON); iterator.next().then(progress, reject); } catch (x$0) { reject(x$0); } } null === formData && (formData = new FormData()); var data = formData; pendingParts++; var streamId = nextPartId++; iterable = iterable === iterator; iterator.next().then(progress, reject); return "$" + (iterable ? "x" : "X") + streamId.toString(16); } function resolveToJSON(key, value) { var originalValue = this[key]; "object" !== typeof originalValue || originalValue === value || originalValue instanceof Date || ("Object" !== objectName(originalValue) ? console.error( "Only plain objects can be passed to Server Functions from the Client. %s objects are not supported.%s", objectName(originalValue), describeObjectForErrorMessage(this, key) ) : console.error( "Only plain objects can be passed to Server Functions from the Client. Objects with toJSON methods are not supported. Convert it manually to a simple value before passing it to props.%s", describeObjectForErrorMessage(this, key) )); if (null === value) return null; if ("object" === typeof value) { switch (value.$$typeof) { case REACT_ELEMENT_TYPE: if (void 0 !== temporaryReferences && -1 === key.indexOf(":")) { var parentReference = writtenObjects.get(this); if (void 0 !== parentReference) return ( temporaryReferences.set(parentReference + ":" + key, value), "$T" ); } throw Error( "React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options." + describeObjectForErrorMessage(this, key) ); case REACT_LAZY_TYPE: originalValue = value._payload; var init = value._init; null === formData && (formData = new FormData()); pendingParts++; try { parentReference = init(originalValue); var lazyId = nextPartId++, partJSON = serializeModel(parentReference, lazyId); formData.append(formFieldPrefix + lazyId, partJSON); return "$" + lazyId.toString(16); } catch (x) { if ( "object" === typeof x && null !== x && "function" === typeof x.then ) { pendingParts++; var _lazyId = nextPartId++; parentReference = function () { try { var _partJSON2 = serializeModel(value, _lazyId), _data = formData; _data.append(formFieldPrefix + _lazyId, _partJSON2); pendingParts--; 0 === pendingParts && resolve(_data); } catch (reason) { reject(reason); } }; x.then(parentReference, parentReference); return "$" + _lazyId.toString(16); } reject(x); return null; } finally { pendingParts--; } } if ("function" === typeof value.then) { null === formData && (formData = new FormData()); pendingParts++; var promiseId = nextPartId++; value.then(function (partValue) { try { var _partJSON3 = serializeModel(partValue, promiseId); partValue = formData; partValue.append(formFieldPrefix + promiseId, _partJSON3); pendingParts--; 0 === pendingParts && resolve(partValue); } catch (reason) { reject(reason); } }, reject); return "$@" + promiseId.toString(16); } parentReference = writtenObjects.get(value); if (void 0 !== parentReference) if (modelRoot === value) modelRoot = null; else return parentReference; else -1 === key.indexOf(":") && ((parentReference = writtenObjects.get(this)), void 0 !== parentReference && ((parentReference = parentReference + ":" + key), writtenObjects.set(value, parentReference), void 0 !== temporaryReferences && temporaryReferences.set(parentReference, value))); if (isArrayImpl(value)) return value; if (value instanceof FormData) { null === formData && (formData = new FormData()); var _data3 = formData; key = nextPartId++; var prefix = formFieldPrefix + key + "_"; value.forEach(function (originalValue, originalKey) { _data3.append(prefix + originalKey, originalValue); }); return "$K" + key.toString(16); } if (value instanceof Map) return ( (key = nextPartId++), (parentReference = serializeModel(Array.from(value), key)), null === formData && (formData = new FormData()), formData.append(formFieldPrefix + key, parentReference), "$Q" + key.toString(16) ); if (value instanceof Set) return ( (key = nextPartId++), (parentReference = serializeModel(Array.from(value), key)), null === formData && (formData = new FormData()), formData.append(formFieldPrefix + key, parentReference), "$W" + key.toString(16) ); if (value instanceof ArrayBuffer) return ( (key = new Blob([value])), (parentReference = nextPartId++), null === formData && (formData = new FormData()), formData.append(formFieldPrefix + parentReference, key), "$A" + parentReference.toString(16) ); if (value instanceof Int8Array) return serializeTypedArray("O", value); if (value instanceof Uint8Array) return serializeTypedArray("o", value); if (value instanceof Uint8ClampedArray) return serializeTypedArray("U", value); if (value instanceof Int16Array) return serializeTypedArray("S", value); if (value instanceof Uint16Array) return serializeTypedArray("s", value); if (value instanceof Int32Array) return serializeTypedArray("L", value); if (value instanceof Uint32Array) return serializeTypedArray("l", value); if (value instanceof Float32Array) return serializeTypedArray("G", value); if (value instanceof Float64Array) return serializeTypedArray("g", value); if (value instanceof BigInt64Array) return serializeTypedArray("M", value); if (value instanceof BigUint64Array) return serializeTypedArray("m", value); if (value instanceof DataView) return serializeTypedArray("V", value); if ("function" === typeof Blob && value instanceof Blob) return ( null === formData && (formData = new FormData()), (key = nextPartId++), formData.append(formFieldPrefix + key, value), "$B" + key.toString(16) ); if ((parentReference = getIteratorFn(value))) return ( (parentReference = parentReference.call(value)), parentReference === value ? ((key = nextPartId++), (parentReference = serializeModel( Array.from(parentReference), key )), null === formData && (formData = new FormData()), formData.append(formFieldPrefix + key, parentReference), "$i" + key.toString(16)) : Array.from(parentReference) ); if ( "function" === typeof ReadableStream && value instanceof ReadableStream ) return serializeReadableStream(value); parentReference = value[ASYNC_ITERATOR]; if ("function" === typeof parentReference) return serializeAsyncIterable(value, parentReference.call(value)); parentReference = getPrototypeOf(value); if ( parentReference !== ObjectPrototype && (null === parentReference || null !== getPrototypeOf(parentReference)) ) { if (void 0 === temporaryReferences) throw Error( "Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported." + describeObjectForErrorMessage(this, key) ); return "$T"; } value.$$typeof === REACT_CONTEXT_TYPE ? console.error( "React Context Providers cannot be passed to Server Functions from the Client.%s", describeObjectForErrorMessage(this, key) ) : "Object" !== objectName(value) ? console.error( "Only plain objects can be passed to Server Functions from the Client. %s objects are not supported.%s", objectName(value), describeObjectForErrorMessage(this, key) ) : isSimpleObject(value) ? Object.getOwnPropertySymbols && ((parentReference = Object.getOwnPropertySymbols(value)), 0 < parentReference.length && console.error( "Only plain objects can be passed to Server Functions from the Client. Objects with symbol properties like %s are not supported.%s", parentReference[0].description, describeObjectForErrorMessage(this, key) )) : console.error( "Only plain objects can be passed to Server Functions from the Client. Classes or other objects with methods are not supported.%s", describeObjectForErrorMessage(this, key) ); return value; } if ("string" === typeof value) { if ("Z" === value[value.length - 1] && this[key] instanceof Date) return "$D" + value; key = "$" === value[0] ? "$" + value : value; return key; } if ("boolean" === typeof value) return value; if ("number" === typeof value) return serializeNumber(value); if ("undefined" === typeof value) return "$undefined"; if ("function" === typeof value) { parentReference = knownServerReferences.get(value); if (void 0 !== parentReference) return ( (key = JSON.stringify(parentReference, resolveToJSON)), null === formData && (formData = new FormData()), (parentReference = nextPartId++), formData.set(formFieldPrefix + parentReference, key), "$F" + parentReference.toString(16) ); if ( void 0 !== temporaryReferences && -1 === key.indexOf(":") && ((parentReference = writtenObjects.get(this)), void 0 !== parentReference) ) return ( temporaryReferences.set(parentReference + ":" + key, value), "$T" ); throw Error( "Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again." ); } if ("symbol" === typeof value) { if ( void 0 !== temporaryReferences && -1 === key.indexOf(":") && ((parentReference = writtenObjects.get(this)), void 0 !== parentReference) ) return ( temporaryReferences.set(parentReference + ":" + key, value), "$T" ); throw Error( "Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options." + describeObjectForErrorMessage(this, key) ); } if ("bigint" === typeof value) return "$n" + value.toString(10); throw Error( "Type " + typeof value + " is not supported as an argument to a Server Function." ); } function serializeModel(model, id) { "object" === typeof model && null !== model && ((id = "$" + id.toString(16)), writtenObjects.set(model, id), void 0 !== temporaryReferences && temporaryReferences.set(id, model)); modelRoot = model; return JSON.stringify(model, resolveToJSON); } var nextPartId = 1, pendingParts = 0, formData = null, writtenObjects = new WeakMap(), modelRoot = root, json = serializeModel(root, 0); null === formData ? resolve(json) : (formData.set(formFieldPrefix + "0", json), 0 === pendingParts && resolve(formData)); return function () { 0 < pendingParts && ((pendingParts = 0), null === formData ? resolve(json) : resolve(formData)); }; } function encodeFormData(reference) { var resolve, reject, thenable = new Promise(function (res, rej) { resolve = res; reject = rej; }); processReply( reference, "", void 0, function (body) { if ("string" === typeof body) { var data = new FormData(); data.append("0", body); body = data; } thenable.status = "fulfilled"; thenable.value = body; resolve(body); }, function (e) { thenable.status = "rejected"; thenable.reason = e; reject(e); } ); return thenable; } function defaultEncodeFormAction(identifierPrefix) { var reference = knownServerReferences.get(this); if (!reference) throw Error( "Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React." ); var data = null; if (null !== reference.bound) { data = boundCache.get(reference); data || ((data = encodeFormData(reference)), boundCache.set(reference, data)); if ("rejected" === data.status) throw data.reason; if ("fulfilled" !== data.status) throw data; reference = data.value; var prefixedData = new FormData(); reference.forEach(function (value, key) { prefixedData.append("$ACTION_" + identifierPrefix + ":" + key, value); }); data = prefixedData; reference = "$ACTION_REF_" + identifierPrefix; } else reference = "$ACTION_ID_" + reference.id; return { name: reference, method: "POST", encType: "multipart/form-data", data: data }; } function isSignatureEqual(referenceId, numberOfBoundArgs) { var reference = knownServerReferences.get(this); if (!reference) throw Error( "Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React." ); if (reference.id !== referenceId) return !1; var boundPromise = reference.bound; if (null === boundPromise) return 0 === numberOfBoundArgs; switch (boundPromise.status) { case "fulfilled": return boundPromise.value.length === numberOfBoundArgs; case "pending": throw boundPromise; case "rejected": throw boundPromise.reason; default: throw ( ("string" !== typeof boundPromise.status && ((boundPromise.status = "pending"), boundPromise.then( function (boundArgs) { boundPromise.status = "fulfilled"; boundPromise.value = boundArgs; }, function (error) { boundPromise.status = "rejected"; boundPromise.reason = error; } )), boundPromise) ); } } function createFakeServerFunction( name, filename, sourceMap, line, col, environmentName, innerFunction ) { name || (name = "<anonymous>"); var encodedName = JSON.stringify(name); 1 >= line ? ((line = encodedName.length + 7), (col = "s=>({" + encodedName + " ".repeat(col < line ? 0 : col - line) + ":(...args) => s(...args)})\n/* This module is a proxy to a Server Action. Turn on Source Maps to see the server source. */")) : (col = "/* This module is a proxy to a Server Action. Turn on Source Maps to see the server source. */" + "\n".repeat(line - 2) + "server=>({" + encodedName + ":\n" + " ".repeat(1 > col ? 0 : col - 1) + "(...args) => server(...args)})"); filename.startsWith("/") && (filename = "file://" + filename); sourceMap ? ((col += "\n//# sourceURL=rsc://React/" + encodeURIComponent(environmentName) + "/" + filename + "?s" + fakeServerFunctionIdx++), (col += "\n//# sourceMappingURL=" + sourceMap)) : filename && (col += "\n//# sourceURL=" + filename); try { return (0, eval)(col)(innerFunction)[name]; } catch (x) { return innerFunction; } } function registerBoundServerReference( reference$jscomp$0, id, bound, encodeFormAction ) { Object.defineProperties(reference$jscomp$0, { $$FORM_ACTION: { value: void 0 === encodeFormAction ? defaultEncodeFormAction : function () { var reference = knownServerReferences.get(this); if (!reference) throw Error( "Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React." ); var boundPromise = reference.bound; null === boundPromise && (boundPromise = Promise.resolve([])); return encodeFormAction(reference.id, boundPromise); } }, $$IS_SIGNATURE_EQUAL: { value: isSignatureEqual }, bind: { value: bind } }); knownServerReferences.set(reference$jscomp$0, { id: id, bound: bound }); } function bind() { var newFn = FunctionBind.apply(this, arguments), reference = knownServerReferences.get(this); if (reference) { null != arguments[0] && console.error( 'Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().' ); var args = ArraySlice.call(arguments, 1), boundPromise = null; boundPromise = null !== reference.bound ? Promise.resolve(reference.bound).then(function (boundArgs) { return boundArgs.concat(args); }) : Promise.resolve(args); Object.defineProperties(newFn, { $$FORM_ACTION: { value: this.$$FORM_ACTION }, $$IS_SIGNATURE_EQUAL: { value: isSignatureEqual }, bind: { value: bind } }); knownServerReferences.set(newFn, { id: reference.id, bound: boundPromise }); } return newFn; } function createBoundServerReference( metaData, callServer, encodeFormAction, findSourceMapURL ) { function action() { var args = Array.prototype.slice.call(arguments); return bound ? "fulfilled" === bound.status ? callServer(id, bound.value.concat(args)) : Promise.resolve(bound).then(function (boundArgs) { return callServer(id, boundArgs.concat(args)); }) : callServer(id, args); } var id = metaData.id, bound = metaData.bound, location = metaData.location; if (location) { var functionName = metaData.name || "", filename = location[1], line = location[2]; location = location[3]; metaData = metaData.env || "Server"; findSourceMapURL = null == findSourceMapURL ? null : findSourceMapURL(filename, metaData); action = createFakeServerFunction( functionName, filename, findSourceMapURL, line, location, metaData, action ); } registerBoundServerReference(action, id, bound, encodeFormAction); return action; } function parseStackLocation(error) { error = error.stack; error.startsWith("Error: react-stack-top-frame\n") && (error = error.slice(29)); var endOfFirst = error.indexOf("\n"); if (-1 !== endOfFirst) { var endOfSecond = error.indexOf("\n", endOfFirst + 1); endOfFirst = -1 === endOfSecond ? error.slice(endOfFirst + 1) : error.slice(endOfFirst + 1, endOfSecond); } else endOfFirst = error; error = v8FrameRegExp.exec(endOfFirst); if ( !error && ((error = jscSpiderMonkeyFrameRegExp.exec(endOfFirst)), !error) ) return null; endOfFirst = error[1] || ""; "<anonymous>" === endOfFirst && (endOfFirst = ""); endOfSecond = error[2] || error[5] || ""; "<anonymous>" === endOfSecond && (endOfSecond = ""); return [ endOfFirst, endOfSecond, +(error[3] || error[6]), +(error[4] || error[7]) ]; } function createServerReference$1( id, callServer, encodeFormAction, findSourceMapURL, functionName ) { function action() { var args = Array.prototype.slice.call(arguments); return callServer(id, args); } var location = parseStackLocation(Error("react-stack-top-frame")); if (null !== location) { var filename = location[1], line = location[2]; location = location[3]; findSourceMapURL = null == findSourceMapURL ? null : findSourceMapURL(filename, "Client"); action = createFakeServerFunction( functionName || "", filename, findSourceMapURL, line, location, "Client", action ); } registerBoundServerReference(action, id, null, encodeFormAction); return action; } function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if ("object" === typeof type) switch ( ("number" === typeof type.tag && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), type.$$typeof) ) { case REACT_CONTEXT_TYPE: return (type.displayName || "Context") + ".Provider"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: var innerType = type.render; type = type.displayName; type || ((type = innerType.displayName || innerType.name || ""), (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); return type; case REACT_MEMO_TYPE: return ( (innerType = type.displayName || null), null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo" ); case REACT_LAZY_TYPE: innerType = type._payload; type = type._init; try { return getComponentNameFromType(type(innerType)); } catch (x) {} } return null; } function prepareStackTrace(error, structuredStackTrace) { error = (error.name || "Error") + ": " + (error.message || ""); for (var i = 0; i < structuredStackTrace.length; i++) error += "\n at " + structuredStackTrace[i].toString(); return error; } function ReactPromise(status, value, reason, response) { this.status = status; this.value = value; this.reason = reason; this._response = response; this._debugInfo = null; } function readChunk(chunk) { switch (chunk.status) { case "resolved_model": initializeModelChunk(chunk); break; case "resolved_module": initializeModuleChunk(chunk); } switch (chunk.status) { case "fulfilled": return chunk.value; case "pending": case "blocked": throw chunk; default: throw chunk.reason; } } function createPendingChunk(response) { return new ReactPromise("pending", null, null, response); } function wakeChunk(listeners, value) { for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value); } function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) { switch (chunk.status) { case "fulfilled": wakeChunk(resolveListeners, chunk.value); break; case "pending": case "blocked": if (chunk.value) for (var i = 0; i < resolveListeners.length; i++) chunk.value.push(resolveListeners[i]); else chunk.value = resolveListeners; if (chunk.reason) { if (rejectListeners) for ( resolveListeners = 0; resolveListeners < rejectListeners.length; resolveListeners++ ) chunk.reason.push(rejectListeners[resolveListeners]); } else chunk.reason = rejectListeners; break; case "rejected": rejectListeners && wakeChunk(rejectListeners, chunk.reason); } } function triggerErrorOnChunk(chunk, error) { if ("pending" !== chunk.status && "blocked" !== chunk.status) chunk.reason.error(error); else { var listeners = chunk.reason; chunk.status = "rejected"; chunk.reason = error; null !== listeners && wakeChunk(listeners, error); } } function createResolvedIteratorResultChunk(response, value, done) { return new ReactPromise( "resolved_model", (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}", null, response ); } function resolveIteratorResultChunk(chunk, value, done) { resolveModelChunk( chunk, (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}" ); } function resolveModelChunk(chunk, value) { if ("pending" !== chunk.status) chunk.reason.enqueueModel(value); else { var resolveListeners = chunk.value, rejectListeners = chunk.reason; chunk.status = "resolved_model"; chunk.value = value; null !== resolveListeners && (initializeModelChunk(chunk), wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners)); } } function resolveModuleChunk(chunk, value) { if ("pending" === chunk.status || "blocked" === chunk.status) { var resolveListeners = chunk.value, rejectListeners = chunk.reason; chunk.status = "resolved_module"; chunk.value = value; null !== resolveListeners && (initializeModuleChunk(chunk), wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners)); } } function initializeModelChunk(chunk) { var prevHandler = initializingHandler; initializingHandler = null; var resolvedModel = chunk.value; chunk.status = "blocked"; chunk.value = null; chunk.reason = null; try { var value = JSON.parse(resolvedModel, chunk._response._fromJSON), resolveListeners = chunk.value; null !== resolveListeners && ((chunk.value = null), (chunk.reason = null), wakeChunk(resolveListeners, value)); if (null !== initializingHandler) { if (initializingHandler.errored) throw initializingHandler.value; if (0 < initializingHandler.deps) { initializingHandler.value = value; initializingHandler.chunk = chunk; return; } } chunk.status = "fulfilled"; chunk.value = value; } catch (error) { (chunk.status = "rejected"), (chunk.reason = error); } finally { initializingHandler = prevHandler; } } function initializeModuleChunk(chunk) { try { var value = requireModule(chunk.value); chunk.status = "fulfilled"; chunk.value = value; } catch (error) { (chunk.status = "rejected"), (chunk.reason = error); } } function reportGlobalError(response, error) { response._closed = !0; response._closedReason = error; response._chunks.forEach(function (chunk) { "pending" === chunk.status && triggerErrorOnChunk(chunk, error); }); } function nullRefGetter() { return null; } function getTaskName(type) { if (type === REACT_FRAGMENT_TYPE) return "<>"; if ("function" === typeof type) return '"use client"'; if ( "object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE ) return type._init === readChunk ? '"use client"' : "<...>"; try { var name = getComponentNameFromType(type); return name ? "<" + name + ">" : "<...>"; } catch (x) { return "<...>"; } } function createLazyChunkWrapper(chunk) { var lazyType = { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk }; chunk = chunk._debugInfo || (chunk._debugInfo = []); lazyType._debugInfo = chunk; return lazyType; } function getChunk(response, id) { var chunks = response._chunks, chunk = chunks.get(id); chunk || ((chunk = response._closed ? new ReactPromise("rejected", null, response._closedReason, response) : createPendingChunk(response)), chunks.set(id, chunk)); return chunk; } function waitForReference( referencedChunk, parentObject, key, response, map, path ) { function fulfill(value) { for (var i = 1; i < path.length; i++) { for (; value.$$typeof === REACT_LAZY_TYPE; ) if (((value = value._payload), value === handler.chunk)) value = handler.value; else if ("fulfilled" === value.status) value = value.value; else { path.splice(0, i - 1); value.then(fulfill, reject); return; } value = value[path[i]]; } i = map(response, value, parentObject, key); parentObject[key] = i; "" === key && null === handler.value && (handler.value = i); if ( parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && handler.value.$$typeof === REACT_ELEMENT_TYPE ) switch (((value = handler.value), key)) { case "3": value.props = i; break; case "4": value._owner = i;