Files
discord-decomp/node_modules/react/index.js
T
2026-11-01 12:12:55 +02:00

652 lines
17 KiB
JavaScript

// Metro module 20 (f21).
function $mk65120($env) {
return function(a0) {
const r6 = $env;
const r3 = r6[0];
const r2 = r6[1];
const r7 = +r6[2];
r6[2] = r7 + 1;
return r3.call(r2, a0, r7);
};
}
function $mk100905($env) {
return function(a0) {
return $env[0][a0];
};
}
let _typeof, c39_1, _typeof2, _typeof3, _typeof4, _typeof5, _typeof6, iterator, updater, assign, refs, isArray, noop, c39_13, hasOwnProperty, c39_15, mapIntoArray, lazyInitializer, reportError2;
export function Component(a0, a1, a2) {
let updater2 = a2;
this.props = a0;
this.context = a1;
this.refs = refs;
if (!a2) {
updater2 = updater;
}
this.updater = updater2;
}
const ComponentDummy = function ComponentDummy() {};
export function PureComponent(a0, a1, a2) {
let updater2 = a2;
this.props = a0;
this.context = a1;
this.refs = refs;
if (!a2) {
updater2 = updater;
}
this.updater = updater2;
}
noop = function noop() {};
mapIntoArray = function mapIntoArray(a0, a1, a2, a3, a4) {
let r10, r38, r56, r109, r138, r161, r180, done2, length, value;
const r14 = (typeof a0 !== "undefined" ? typeof a0 !== "boolean" : typeof a0 !== "undefined") ? a0 : null;
L14: {
r10 = r14 === null;
r38 = true;
if (!r10) {
const r19 = typeof a0;
if (r19 !== "bigint" && r19 !== "string" && r19 !== "number") {
r38 = false;
if (r19 !== "object") {
break L14;
}
const r42 = r14.$$typeof;
r38 = true;
if (_typeof === r42) {
break L14;
}
r38 = true;
if (c39_1 === r42) {
break L14;
}
r38 = false;
if (_typeof6 !== r42) {
break L14;
}
return mapIntoArray((0, r14._init)(r14._payload), a1, a2, a3, a4);
}
r38 = true;
}
}
if (r38) {
const r155 = a4(r14);
let r156 = a3;
if (a3 === "") {
if (typeof r14 === "object" && (r14 !== null && r14.key != null)) {
let env12112;
const r163 = "" + r14.key;
const r164 = env12112 = {};
env12112[0] = {
"=": "=0",
":": "=2"
};
r161 = "$" + r163.replace(/[=:]/g, $mk100905(r164));
} else {
r161 = (0, (0).toString)(36);
}
r156 = "." + r161;
}
if (isArray(r155)) {
mapIntoArray(r155, a1, r156.replace(c39_15, "$&/") + "/", "", function(a0) {
return a0;
});
} else if (r155 != null) {
const r174 = (typeof r155 === "object" ? r155 !== null : typeof r155 === "object") && r155.$$typeof === _typeof;
let r177 = r155;
if (r174) {
L83: {
const r179 = r155.key == null;
r180 = "";
if (!r179) {
if (r14) {
const key = r14.key;
const key2 = r155.key;
r180 = "";
if (key === key2) {
break L83;
}
}
r180 = ("" + r155.key).replace(c39_15, "$&/") + "/";
}
}
const key3 = HermesInternal.concat.call(a2, r180, r156);
const { type, props } = r155;
const ref = props.ref;
r177 = {
$$typeof: _typeof,
type,
key: key3,
ref: ref !== void 0 ? ref : null,
props
};
}
a1.push(r177);
}
return 1;
}
const r49 = a3 !== "" ? a3 + ":" : ".";
if (isArray(r14)) {
const r126 = 0 < r14.length;
let r130 = 0;
let r131 = 0;
r56 = 0;
if (r126) {
do {
const r133 = r14[r130];
const r134 = r130;
const r135 = r131;
if (typeof r133 === "object" && (r133 !== null && r133.key != null)) {
let env12111;
const r140 = "" + r133.key;
const r141 = env12111 = {};
env12111[0] = {
"=": "=0",
":": "=2"
};
r138 = "$" + r140.replace(/[=:]/g, $mk100905(r141));
} else {
r138 = r134.toString(36);
}
r131 = r135 + mapIntoArray(r133, a1, a2, r49 + r138, a4);
r130 = r134 + 1;
length = r14.length;
r56 = r131;
} while (r130 < length);
}
} else {
let r54 = null;
if (!r10) {
r54 = null;
if (typeof r14 === "object") {
const r25 = (iterator ? r14[iterator] : iterator) || r14["@@iterator"];
r54 = typeof r25 === "function" ? r25 : null;
}
}
if (typeof r54 === "function") {
const r99 = r54.call(r14);
let r101 = r99.next();
const done = r101.done;
let r1 = 0;
let r104 = 0;
r56 = 0;
if (!done) {
do {
const value2 = r101.value;
const r2 = r1;
const r3 = r104;
if (typeof value2 === "object" && (value2 !== null && value2.key != null)) {
let env12110;
const r31 = "" + value2.key;
const r111 = env12110 = {};
env12110[0] = {
"=": "=0",
":": "=2"
};
r109 = "$" + r31.replace(/[=:]/g, $mk100905(r111));
} else {
r109 = r2.toString(36);
}
r1 = r2 + 1;
r104 = r3 + mapIntoArray(value2, a1, a2, r49 + r109, a4);
const r123 = r99.next();
done2 = r123.done;
r101 = r123;
r56 = r104;
} while (!done2);
}
} else {
r56 = 0;
if (typeof a0 === "object") {
if (typeof r14.then === "function") {
let c12109_0 = r14;
const status = r14.status;
if (status === "fulfilled") {
value = r14.value;
} else {
if (status === "rejected") {
throw r14.reason;
}
if (typeof r14.status === "string") {
r14.then(noop, noop);
} else {
r14.status = "pending";
r14.then(function(result) {
if (c12109_0.status === "pending") {
c12109_0.status = "fulfilled";
c12109_0.value = result;
}
}, function(a0) {
if (c12109_0.status === "pending") {
c12109_0.status = "rejected";
c12109_0.reason = a0;
}
});
}
const status2 = r14.status;
if (status2 !== "fulfilled") {
if (status2 === "rejected") {
throw r14.reason;
}
throw r14;
}
value = r14.value;
}
return mapIntoArray(value, a1, a2, a3, a4);
}
let r60 = String(r14);
const r61 = Error;
if (r60 === "[object Object]") {
r60 = "object with keys {" + Object.keys(r14).join(", ") + "}";
}
throw r61("Objects are not valid as a React child (found: " + r60 + "). If you meant to render a collection of children, use an array instead.");
}
}
}
return r56;
};
lazyInitializer = function lazyInitializer(a0) {
let c12114_0 = a0;
if (a0._status === -1) {
const _result = (0, a0._result)();
_result.then(function(result) {
if (!(c12114_0._status !== 0 && c12114_0._status !== -1)) {
c12114_0._status = 1;
c12114_0._result = result;
}
}, function(a0) {
if (!(c12114_0._status !== 0 && c12114_0._status !== -1)) {
c12114_0._status = 2;
c12114_0._result = a0;
}
});
if (a0._status === -1) {
a0._status = 0;
a0._result = _result;
}
}
if (a0._status === 1) {
return a0._result.default;
}
throw a0._result;
};
_typeof = Symbol.for("react.transitional.element");
c39_1 = Symbol.for("react.portal");
const r10 = Symbol.for("react.fragment");
const r29 = Symbol.for("react.strict_mode");
const r32 = Symbol.for("react.profiler");
_typeof2 = Symbol.for("react.consumer");
_typeof3 = Symbol.for("react.context");
_typeof4 = Symbol.for("react.forward_ref");
const r47 = Symbol.for("react.suspense");
_typeof5 = Symbol.for("react.memo");
_typeof6 = Symbol.for("react.lazy");
const r58 = Symbol.for("react.activity");
iterator = Symbol.iterator;
updater = {
isMounted: function isMounted() {
return false;
},
enqueueForceUpdate: function enqueueForceUpdate() {},
enqueueReplaceState: function enqueueReplaceState() {},
enqueueSetState: function enqueueSetState() {}
};
assign = Object.assign;
refs = {};
Component.prototype.isReactComponent = {};
Component.prototype.setState = function(a0, a1) {
if (typeof a0 !== "object" && typeof a0 !== "function" && a0 != null) {
throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
}
this.updater.enqueueSetState(this, a0, a1, "setState");
};
Component.prototype.forceUpdate = function(a0) {
this.updater.enqueueForceUpdate(this, a0, "forceUpdate");
};
ComponentDummy.prototype = Component.prototype;
const prototype = {
__proto__: ComponentDummy.prototype
};
PureComponent.prototype = prototype;
prototype.constructor = PureComponent;
assign(prototype, Component.prototype);
prototype.isPureReactComponent = true;
isArray = Array.isArray;
c39_13 = {
H: null,
A: null,
T: null,
S: null
};
hasOwnProperty = Object.prototype.hasOwnProperty;
c39_15 = /\/+/g;
const r87 = typeof globalThis.reportError === "function" ? reportError : function(a0) {
L12: {
if (typeof globalThis.window === "object" && typeof window.ErrorEvent === "function") {
if (window.dispatchEvent(new window.ErrorEvent("error", {
bubbles: true,
cancelable: true,
message: typeof a0 === "object" && (a0 !== null && typeof a0.message === "string") ? String(a0.message) : String(a0),
error: a0
}))) {
break L12;
}
return void 0;
}
if (typeof globalThis.process === "object" && typeof globalThis.process.emit === "function") {
globalThis.process.emit("uncaughtException", a0);
return void 0;
}
}
console.error(a0);
};
export function isValidElement(a0) {
return (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && a0.$$typeof === _typeof;
}
const mapChildren = function mapChildren(a0, a1, a2) {
let env12113;
const r4 = env12113 = {};
env12113[0] = a1;
env12113[1] = a2;
if (a0 == null) {
return a0;
}
const r14 = [];
env12113[2] = 0;
mapIntoArray(a0, r14, "", "", $mk65120(r4));
return r14;
};
reportError2 = r87;
const r91 = {
map: mapChildren,
forEach: function forEach(a0, c12115_0, a2) {
let env12116;
const r13 = env12116 = {};
env12116[0] = function() {
c12115_0.apply(this, arguments);
};
env12116[1] = a2;
if (a0 != null) {
env12116[2] = 0;
mapIntoArray(a0, [], "", "", $mk65120(r13));
}
},
count: function count(a0) {
let env12118;
let c12117_0 = 0;
const r3 = env12118 = {};
env12118[0] = function() {
c12117_0 = c12117_0 + 1;
};
if (a0 != null) {
env12118[2] = 0;
mapIntoArray(a0, [], "", "", $mk65120(r3));
}
return c12117_0;
},
toArray: function toArray(a0) {
let env12119;
const r4 = env12119 = {};
env12119[0] = function(a0) {
return a0;
};
let r15 = a0;
if (a0 != null) {
const r3 = [];
env12119[2] = 0;
mapIntoArray(a0, r3, "", "", $mk65120(r4));
r15 = r3;
}
if (!r15) {
r15 = [];
}
return r15;
},
only: function only(a0) {
if ((typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && a0.$$typeof === _typeof) {
return a0;
}
throw Error("React.Children.only expected to receive a single React element child.");
}
};
export { r58 as Activity };
export { r91 as Children };
export { r10 as Fragment };
export { r32 as Profiler };
export { r29 as StrictMode };
export { r47 as Suspense };
export { c39_13 as __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE };
export const __COMPILER_RUNTIME = {
__proto__: null,
c: function c(a0) {
return c39_13.H.useMemoCache(a0);
}
};
export const cache = function(c12120_0) {
return function() {
return c12120_0.apply(null, arguments);
};
};
export const cacheSignal = function() {
return null;
};
export const cloneElement = function(a0, a1, a2) {
if (a0 == null) {
throw Error("The argument must be a React element, but you passed " + a0 + ".");
}
const props = assign({}, a0.props);
let key2 = a0.key;
let key3 = key2;
if (a1 != null) {
if (a1.key !== void 0) {
key2 = "" + a1.key;
}
key3 = key2;
for (const key in a1) {
key3 = key2;
const call = hasOwnProperty.call;
const r32 = hasOwnProperty.call(a1, key);
if (!((r32 ? key === "key" : !r32) || key === "__self" || key === "__source" || key === "ref" && a1.ref === void 0)) {
props[key] = a1[key];
}
}
key3 = key2;
}
const r4 = arguments.length - 2;
if (r4 === 1) {
props.children = a2;
} else if (1 < r4) {
const children = Array(r4);
let r41 = 0;
while (r41 < r4) {
children[r41] = arguments[r41 + 2];
r41 = r41 + 1;
}
props.children = children;
}
const type = a0.type;
const ref = props.ref;
return {
$$typeof: _typeof,
type,
key: key3,
ref: ref !== void 0 ? ref : null,
props
};
};
export const createContext = function(a0) {
const Provider = {
$$typeof: _typeof3,
_currentValue: a0,
_currentValue2: a0,
_threadCount: 0,
Provider: null,
Consumer: null
};
Provider.Provider = Provider;
Provider.Consumer = {
$$typeof: _typeof2,
_context: Provider
};
return Provider;
};
export const createElement = function(a0, a1, a2) {
const props = {};
const r6 = a1 != null;
let key3 = null;
if (r6) {
key3 = a1.key !== void 0 ? "" + a1.key : null;
for (const key in a1) {
key3 = key3;
const call = hasOwnProperty.call;
if (hasOwnProperty.call(a1, key) && key !== "key" && key !== "__self" && key !== "__source") {
props[key] = a1[key];
}
}
key3 = key3;
}
const r4 = arguments.length - 2;
if (r4 === 1) {
props.children = a2;
} else if (1 < r4) {
const children = Array(r4);
let r33 = 0;
while (r33 < r4) {
children[r33] = arguments[r33 + 2];
r33 = r33 + 1;
}
props.children = children;
}
if (a0 && a0.defaultProps) {
const defaultProps = a0.defaultProps;
for (const key2 in defaultProps) {
if (props[key2] === void 0) {
props[key2] = defaultProps[key2];
}
}
}
const ref = props.ref;
return {
$$typeof: _typeof,
type: a0,
key: key3,
ref: ref !== void 0 ? ref : null,
props
};
};
export const createRef = function() {
return {
current: null
};
};
export const forwardRef = function(a0) {
return {
$$typeof: _typeof4,
render: a0
};
};
export const lazy = function(a0) {
return {
$$typeof: _typeof6,
_payload: {
_status: -1,
_result: a0
},
_init: lazyInitializer
};
};
export const memo = function(a0, a1) {
return {
$$typeof: _typeof5,
type: a0,
compare: a1 !== void 0 ? a1 : null
};
};
export const startTransition = function(a0) {
const r1 = c39_13.T;
const r3 = {};
c39_13.T = r3;
try {
try {
const r9 = a0();
const r10 = c39_13.S;
if (r10 !== null) {
r10(r3, r9);
}
if ((typeof r9 === "object" ? r9 !== null : typeof r9 === "object") && typeof r9.then === "function") {
r9.then(noop, reportError2);
}
} catch ($e) {
reportError2($e);
}
} catch (r32) {
if (r1 !== null && r3.types !== null) {
r1.types = r3.types;
}
c39_13.T = r1;
throw r32;
}
if (r1 !== null && r3.types !== null) {
r1.types = r3.types;
}
c39_13.T = r1;
};
export const unstable_useCacheRefresh = function() {
return c39_13.H.useCacheRefresh();
};
export const use = function(a0) {
return c39_13.H.use(a0);
};
export const useActionState = function(a0, a1, a2) {
return c39_13.H.useActionState(a0, a1, a2);
};
export const useCallback = function(a0, a1) {
return c39_13.H.useCallback(a0, a1);
};
export const useContext = function(a0) {
return c39_13.H.useContext(a0);
};
export const useDebugValue = function() {};
export const useDeferredValue = function(a0, a1) {
return c39_13.H.useDeferredValue(a0, a1);
};
export const useEffect = function(a0, a1) {
return c39_13.H.useEffect(a0, a1);
};
export const useEffectEvent = function(a0) {
return c39_13.H.useEffectEvent(a0);
};
export const useId = function() {
return c39_13.H.useId();
};
export const useImperativeHandle = function(a0, a1, a2) {
return c39_13.H.useImperativeHandle(a0, a1, a2);
};
export const useInsertionEffect = function(a0, a1) {
return c39_13.H.useInsertionEffect(a0, a1);
};
export const useLayoutEffect = function(a0, a1) {
return c39_13.H.useLayoutEffect(a0, a1);
};
export const useMemo = function(a0, a1) {
return c39_13.H.useMemo(a0, a1);
};
export const useOptimistic = function(a0, a1) {
return c39_13.H.useOptimistic(a0, a1);
};
export const useReducer = function(a0, a1, a2) {
return c39_13.H.useReducer(a0, a1, a2);
};
export const useRef = function(a0) {
return c39_13.H.useRef(a0);
};
export const useState = function(a0) {
return c39_13.H.useState(a0);
};
export const useSyncExternalStore = function(a0, a1, a2) {
return c39_13.H.useSyncExternalStore(a0, a1, a2);
};
export const useTransition = function() {
return c39_13.H.useTransition();
};
export const version = "19.2.3";