decord/source/modules/rpc/RPCServer.tsx

597 lines
20 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 13513
// Function ID: 103900
2026-07-20 16:05:17 +00:00
// Name: RPCServer
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 6, 7, 4034, 653, 22, 10559, 10553, 13491, 675, 44, 664, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 13513 (RPCServer)
2026-07-23 10:11:24 +00:00
import apply from "apply";
import transformUser from "transformUser";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { TransportTypes } from "RPC_SCOPE_CONFIG";
import ME from "ME";
let closure_10;
let closure_6;
let closure_7;
let closure_8;
let closure_9;
({ AnalyticEvents: closure_6, RPCCloseCodes: closure_7, RPCCommands: closure_8, RPCErrors: closure_9, RPCEvents: closure_10 } = ME);
2026-07-20 16:05:17 +00:00
let closure_11 = [];
2026-07-23 10:11:24 +00:00
let tmp3 = (() => {
2026-07-20 16:05:17 +00:00
class RPCServer {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, RPCServer);
2026-07-20 16:05:17 +00:00
this.getCurrentUser = () => null;
this.onConnect = () => {
};
this.onDisconnect = () => {
};
this.events = {};
this.commands = {};
set = new Set();
this.sockets = set;
this.subscriptions = [];
set1 = new Set();
this.isSubscribedListeners = set1;
this.getJoi = arg0;
return;
}
}
let obj = {
key: "registerTransport",
value(on) {
2026-07-23 10:11:24 +00:00
const self = this;
2026-07-20 16:05:17 +00:00
on.on("connect", (arg0) => self.handleConnect(arg0));
on.on("request", (arg0, arg1) => self.handleRequest(arg0, arg1));
on.on("disconnect", (arg0, arg1) => self.handleDisconnect(arg0, arg1));
}
};
const items = [obj, , , , , , , , , , , , , , , , , , ];
obj = {
key: "handleConnect",
value(v) {
const self = this;
const sockets = this.sockets;
sockets.add(v);
this.onConnect(v);
2026-07-23 10:11:24 +00:00
obj = { v: v.version, config: obj };
2026-07-20 16:05:17 +00:00
obj = { cdn_host: window.GLOBAL_ENV.CDN_HOST, api_endpoint: window.GLOBAL_ENV.API_ENDPOINT, environment: "production" };
2026-07-23 10:11:24 +00:00
if (v.transport === outer1_5.IPC) {
2026-07-20 16:05:17 +00:00
const currentUser = self.getCurrentUser();
if (null == currentUser) {
2026-07-23 10:11:24 +00:00
v.close(outer1_7.CLOSE_NORMAL, "User logged out");
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
obj.user = RPCServer(outer1_1[6])(currentUser);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
self.dispatch(v, null, outer1_8.DISPATCH, outer1_10.READY, obj);
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "handleDisconnect",
value(abortController) {
abortController = abortController.abortController;
abortController.abort("DISCONNECTED");
this.removeSubscriptions(abortController);
const sockets = this.sockets;
sockets.delete(abortController);
this.onDisconnect(abortController, arg1);
}
};
items[2] = obj;
items[3] = {
key: "handleRequest",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let self = this;
let closure_1 = arg0;
let apply = arg1;
self = this;
const promise = new Promise((arg0) => {
if (null != apply.nonce) {
if ("" !== apply.nonce) {
const cmd = apply.cmd;
2026-07-20 16:05:17 +00:00
if (null == self.commands[cmd]) {
2026-07-23 10:11:24 +00:00
let tmp16 = RPCServer(outer2_1[7]);
let obj = { errorCode: outer2_9.INVALID_COMMAND };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
const prototype2 = tmp16.prototype;
2026-07-23 10:11:24 +00:00
tmp16 = new tmp16(obj, "Invalid command: " + apply.cmd);
2026-07-20 16:05:17 +00:00
throw tmp16;
2026-07-23 10:11:24 +00:00
} else if (RPCServer(outer2_1[8])(closure_1.authorization.scopes, tmp30.scope)) {
2026-07-20 16:05:17 +00:00
obj = { command: cmd };
if ("object" === typeof tmp30.scope) {
const _JSON = JSON;
let scope = JSON.stringify(tmp30.scope);
} else {
scope = tmp30.scope;
}
obj.scope = scope;
2026-07-23 10:11:24 +00:00
obj.application_id = closure_1.application.id;
obj.socket_scope = closure_1.authorization.scopes.toString();
tmp34(tmp35[9]).track(outer2_6.RPC_COMMAND_SENT, obj);
arg0(tmp30);
2026-07-20 16:05:17 +00:00
} else {
let tmp = tmp34(tmp35[7]);
2026-07-23 10:11:24 +00:00
obj = { errorCode: outer2_9.INVALID_PERMISSIONS };
2026-07-20 16:05:17 +00:00
const prototype = tmp.prototype;
tmp = new tmp(obj, "Not authenticated or invalid scope");
throw tmp;
}
}
}
2026-07-23 10:11:24 +00:00
let tmp25 = RPCServer(outer2_1[7]);
tmp25 = new tmp25({ errorCode: outer2_9.INVALID_PAYLOAD }, "Payload requires a nonce");
2026-07-20 16:05:17 +00:00
throw tmp25;
});
2026-07-23 10:11:24 +00:00
const nextPromise = new Promise((arg0) => {
if (null != apply.nonce) {
if ("" !== apply.nonce) {
const cmd = apply.cmd;
2026-07-20 16:05:17 +00:00
if (null == self.commands[cmd]) {
2026-07-23 10:11:24 +00:00
let tmp16 = RPCServer(outer2_1[7]);
let obj = { errorCode: outer2_9.INVALID_COMMAND };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
const prototype2 = tmp16.prototype;
2026-07-23 10:11:24 +00:00
tmp16 = new tmp16(obj, "Invalid command: " + apply.cmd);
2026-07-20 16:05:17 +00:00
throw tmp16;
2026-07-23 10:11:24 +00:00
} else if (RPCServer(outer2_1[8])(closure_1.authorization.scopes, tmp30.scope)) {
2026-07-20 16:05:17 +00:00
obj = { command: cmd };
if ("object" === typeof tmp30.scope) {
const _JSON = JSON;
let scope = JSON.stringify(tmp30.scope);
} else {
scope = tmp30.scope;
}
obj.scope = scope;
2026-07-23 10:11:24 +00:00
obj.application_id = closure_1.application.id;
obj.socket_scope = closure_1.authorization.scopes.toString();
tmp34(tmp35[9]).track(outer2_6.RPC_COMMAND_SENT, obj);
arg0(tmp30);
2026-07-20 16:05:17 +00:00
} else {
let tmp = tmp34(tmp35[7]);
2026-07-23 10:11:24 +00:00
obj = { errorCode: outer2_9.INVALID_PERMISSIONS };
2026-07-20 16:05:17 +00:00
const prototype = tmp.prototype;
tmp = new tmp(obj, "Not authenticated or invalid scope");
throw tmp;
}
}
}
2026-07-23 10:11:24 +00:00
let tmp25 = RPCServer(outer2_1[7]);
tmp25 = new tmp25({ errorCode: outer2_9.INVALID_PAYLOAD }, "Payload requires a nonce");
2026-07-20 16:05:17 +00:00
throw tmp25;
}).then((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
return new Promise((() => {
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
2026-07-23 10:11:24 +00:00
let closure_0 = outer3_2(tmp);
2026-07-20 16:05:17 +00:00
return function() {
return callback(...arguments);
};
2026-07-23 10:11:24 +00:00
})());
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const nextPromise1 = new Promise((arg0) => {
if (null != apply.nonce) {
if ("" !== apply.nonce) {
const cmd = apply.cmd;
2026-07-20 16:05:17 +00:00
if (null == self.commands[cmd]) {
2026-07-23 10:11:24 +00:00
let tmp16 = RPCServer(outer2_1[7]);
let obj = { errorCode: outer2_9.INVALID_COMMAND };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
const prototype2 = tmp16.prototype;
2026-07-23 10:11:24 +00:00
tmp16 = new tmp16(obj, "Invalid command: " + apply.cmd);
2026-07-20 16:05:17 +00:00
throw tmp16;
2026-07-23 10:11:24 +00:00
} else if (RPCServer(outer2_1[8])(closure_1.authorization.scopes, tmp30.scope)) {
2026-07-20 16:05:17 +00:00
obj = { command: cmd };
if ("object" === typeof tmp30.scope) {
const _JSON = JSON;
let scope = JSON.stringify(tmp30.scope);
} else {
scope = tmp30.scope;
}
obj.scope = scope;
2026-07-23 10:11:24 +00:00
obj.application_id = closure_1.application.id;
obj.socket_scope = closure_1.authorization.scopes.toString();
tmp34(tmp35[9]).track(outer2_6.RPC_COMMAND_SENT, obj);
arg0(tmp30);
2026-07-20 16:05:17 +00:00
} else {
let tmp = tmp34(tmp35[7]);
2026-07-23 10:11:24 +00:00
obj = { errorCode: outer2_9.INVALID_PERMISSIONS };
2026-07-20 16:05:17 +00:00
const prototype = tmp.prototype;
tmp = new tmp(obj, "Not authenticated or invalid scope");
throw tmp;
}
}
}
2026-07-23 10:11:24 +00:00
let tmp25 = RPCServer(outer2_1[7]);
tmp25 = new tmp25({ errorCode: outer2_9.INVALID_PAYLOAD }, "Payload requires a nonce");
2026-07-20 16:05:17 +00:00
throw tmp25;
}).then((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
return new Promise((() => {
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
2026-07-23 10:11:24 +00:00
let closure_0 = outer3_2(tmp);
2026-07-20 16:05:17 +00:00
return function() {
return callback(...arguments);
};
2026-07-23 10:11:24 +00:00
})());
}).then((handler) => {
const obj = { socket: closure_1, server: self, cmd: apply.cmd, evt: apply.evt, nonce: apply.nonce };
let args = apply.args;
2026-07-20 16:05:17 +00:00
if (null == args) {
args = {};
}
obj.args = args;
obj.isSocketConnected = function isSocketConnected() {
2026-07-23 10:11:24 +00:00
const sockets = outer1_0.sockets;
return sockets.has(outer1_1);
2026-07-20 16:05:17 +00:00
};
2026-07-23 10:11:24 +00:00
obj.signal = closure_1.abortController.signal;
2026-07-20 16:05:17 +00:00
return handler.handler(obj);
});
2026-07-23 10:11:24 +00:00
new Promise((arg0) => {
if (null != apply.nonce) {
if ("" !== apply.nonce) {
const cmd = apply.cmd;
2026-07-20 16:05:17 +00:00
if (null == self.commands[cmd]) {
2026-07-23 10:11:24 +00:00
let tmp16 = RPCServer(outer2_1[7]);
let obj = { errorCode: outer2_9.INVALID_COMMAND };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
const prototype2 = tmp16.prototype;
2026-07-23 10:11:24 +00:00
tmp16 = new tmp16(obj, "Invalid command: " + apply.cmd);
2026-07-20 16:05:17 +00:00
throw tmp16;
2026-07-23 10:11:24 +00:00
} else if (RPCServer(outer2_1[8])(closure_1.authorization.scopes, tmp30.scope)) {
2026-07-20 16:05:17 +00:00
obj = { command: cmd };
if ("object" === typeof tmp30.scope) {
const _JSON = JSON;
let scope = JSON.stringify(tmp30.scope);
} else {
scope = tmp30.scope;
}
obj.scope = scope;
2026-07-23 10:11:24 +00:00
obj.application_id = closure_1.application.id;
obj.socket_scope = closure_1.authorization.scopes.toString();
tmp34(tmp35[9]).track(outer2_6.RPC_COMMAND_SENT, obj);
arg0(tmp30);
2026-07-20 16:05:17 +00:00
} else {
let tmp = tmp34(tmp35[7]);
2026-07-23 10:11:24 +00:00
obj = { errorCode: outer2_9.INVALID_PERMISSIONS };
2026-07-20 16:05:17 +00:00
const prototype = tmp.prototype;
tmp = new tmp(obj, "Not authenticated or invalid scope");
throw tmp;
}
}
}
2026-07-23 10:11:24 +00:00
let tmp25 = RPCServer(outer2_1[7]);
tmp25 = new tmp25({ errorCode: outer2_9.INVALID_PAYLOAD }, "Payload requires a nonce");
2026-07-20 16:05:17 +00:00
throw tmp25;
}).then((arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
return new Promise((() => {
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
2026-07-23 10:11:24 +00:00
let closure_0 = outer3_2(tmp);
2026-07-20 16:05:17 +00:00
return function() {
return callback(...arguments);
};
2026-07-23 10:11:24 +00:00
})());
}).then((handler) => {
const obj = { socket: closure_1, server: self, cmd: apply.cmd, evt: apply.evt, nonce: apply.nonce };
let args = apply.args;
2026-07-20 16:05:17 +00:00
if (null == args) {
args = {};
}
obj.args = args;
obj.isSocketConnected = function isSocketConnected() {
2026-07-23 10:11:24 +00:00
const sockets = outer1_0.sockets;
return sockets.has(outer1_1);
2026-07-20 16:05:17 +00:00
};
2026-07-23 10:11:24 +00:00
obj.signal = closure_1.abortController.signal;
2026-07-20 16:05:17 +00:00
return handler.handler(obj);
2026-07-23 10:11:24 +00:00
}).then((arg0) => self.dispatch(closure_1, apply.nonce, apply.cmd, null, arg0)).catch((code) => self.error(closure_1, apply.nonce, apply.cmd, code.code, code.message));
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "setCommandHandler",
value(arg0, arg1) {
this.commands[arg0] = arg1;
}
};
items[5] = {
key: "setEventHandler",
value(arg0, arg1) {
this.events[arg0] = arg1;
}
};
items[6] = {
key: "dispatch",
value(send) {
let tmp = arg1;
let DISPATCH = arg2;
let tmp2 = arg3;
let tmp3 = arg4;
if (arg1 === undefined) {
tmp = null;
}
if (DISPATCH === undefined) {
2026-07-23 10:11:24 +00:00
DISPATCH = outer1_8.DISPATCH;
2026-07-20 16:05:17 +00:00
}
if (tmp2 === undefined) {
tmp2 = null;
}
if (tmp3 === undefined) {
tmp3 = null;
}
const obj = { cmd: DISPATCH, data: tmp3, evt: tmp2, nonce: tmp };
send.send(obj);
}
};
items[7] = {
key: "error",
value(arg0) {
let tmp = arg1;
let DISPATCH = arg2;
let UNKNOWN_ERROR = arg3;
let str = arg4;
const self = this;
if (arg1 === undefined) {
tmp = null;
}
if (DISPATCH === undefined) {
2026-07-23 10:11:24 +00:00
DISPATCH = outer1_8.DISPATCH;
2026-07-20 16:05:17 +00:00
}
if (UNKNOWN_ERROR === undefined) {
2026-07-23 10:11:24 +00:00
UNKNOWN_ERROR = outer1_9.UNKNOWN_ERROR;
2026-07-20 16:05:17 +00:00
}
if (str === undefined) {
str = "Unknown Error";
}
2026-07-23 10:11:24 +00:00
let obj = RPCServer(outer1_1[9]);
2026-07-20 16:05:17 +00:00
obj = { command: DISPATCH, code: UNKNOWN_ERROR, message: str };
2026-07-23 10:11:24 +00:00
obj.track(outer1_6.RPC_SERVER_ERROR_CAUGHT, obj);
2026-07-20 16:05:17 +00:00
obj = { code: UNKNOWN_ERROR, message: str };
2026-07-23 10:11:24 +00:00
self.dispatch(arg0, tmp, DISPATCH, outer1_10.ERROR, obj);
2026-07-20 16:05:17 +00:00
}
};
items[8] = {
key: "listenIsSubscribed",
value(arg0) {
2026-07-23 10:11:24 +00:00
const self = this;
let closure_1 = arg0;
let isSubscribedListeners = this.isSubscribedListeners;
2026-07-20 16:05:17 +00:00
isSubscribedListeners.add(arg0);
return () => {
const isSubscribedListeners = self.isSubscribedListeners;
2026-07-23 10:11:24 +00:00
isSubscribedListeners.delete(closure_1);
2026-07-20 16:05:17 +00:00
};
}
};
items[9] = {
key: "dispatchIsSubscribedUpdate",
value() {
const prop = this.isSubscribedListeners;
const item = prop.forEach((arg0) => arg0());
}
};
items[10] = {
key: "isSubscribed",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const subscriptions = this.subscriptions;
return undefined !== subscriptions.find((socket) => {
2026-07-23 10:11:24 +00:00
let tmp = socket.socket.application.id === closure_0;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = socket.evt === closure_1;
2026-07-20 16:05:17 +00:00
}
return tmp;
});
}
};
items[11] = {
key: "isChildSubscribed",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
let tmp = null != arg0;
if (tmp) {
const self = this;
const subscriptions = this.subscriptions;
tmp = undefined !== subscriptions.find((socket) => {
2026-07-23 10:11:24 +00:00
let tmp = socket.socket.application.parentId === closure_0;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = socket.evt === closure_1;
2026-07-20 16:05:17 +00:00
}
return tmp;
});
}
return tmp;
}
};
items[12] = {
key: "getSubscription",
value(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
let apply = arg2;
2026-07-20 16:05:17 +00:00
const subscriptions = this.subscriptions;
return subscriptions.find((socket) => {
2026-07-23 10:11:24 +00:00
let isEqualResult = socket.socket === closure_0;
2026-07-20 16:05:17 +00:00
if (isEqualResult) {
2026-07-23 10:11:24 +00:00
isEqualResult = socket.evt === closure_1;
2026-07-20 16:05:17 +00:00
}
if (isEqualResult) {
2026-07-23 10:11:24 +00:00
isEqualResult = RPCServer(outer2_1[5]).isEqual(socket.args, apply);
const obj = RPCServer(outer2_1[5]);
2026-07-20 16:05:17 +00:00
}
return isEqualResult;
});
}
};
items[13] = {
key: "addSubscription",
value(socket, evt, args) {
let tmp = arg3;
const self = this;
if (arg3 === undefined) {
tmp = null;
}
const dispatch = self.dispatch;
2026-07-23 10:11:24 +00:00
const bindResult = dispatch.bind(self, socket, null, outer1_8.DISPATCH, evt);
2026-07-20 16:05:17 +00:00
if (null == self.getSubscription(socket, evt, args)) {
const subscriptions = self.subscriptions;
let obj = { update: tmp, dispatch: bindResult };
let tmpResult = null;
if (tmp) {
obj = { prevState: null, dispatch: bindResult };
tmpResult = tmp(obj);
}
obj.prevState = tmpResult;
obj.socket = socket;
obj.evt = evt;
obj.args = args;
subscriptions.push(obj);
const result = self.dispatchIsSubscribedUpdate();
}
}
};
items[14] = {
key: "removeSubscription",
value(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
let apply = arg2;
RPCServer(outer1_1[5]).remove(this.subscriptions, (socket) => {
let isEqualResult = socket.socket === closure_0;
2026-07-20 16:05:17 +00:00
if (isEqualResult) {
2026-07-23 10:11:24 +00:00
isEqualResult = socket.evt === closure_1;
2026-07-20 16:05:17 +00:00
}
if (isEqualResult) {
2026-07-23 10:11:24 +00:00
isEqualResult = RPCServer(outer2_1[5]).isEqual(socket.args, apply);
const obj = RPCServer(outer2_1[5]);
2026-07-20 16:05:17 +00:00
}
return isEqualResult;
});
const result = this.dispatchIsSubscribedUpdate();
}
};
items[15] = {
key: "removeSubscriptions",
value(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
RPCServer(outer1_1[5]).remove(this.subscriptions, (socket) => socket.socket === closure_0);
2026-07-20 16:05:17 +00:00
const result = this.dispatchIsSubscribedUpdate();
}
};
items[16] = {
key: "dispatchToSubscriptions",
value(arg0, arg1, arg2, arg3) {
2026-07-23 10:11:24 +00:00
const self = this;
let closure_1 = arg0;
let apply = arg1;
let transformUser = arg2;
2026-07-20 16:05:17 +00:00
let tmp = null != arg3;
if (tmp) {
tmp = "" !== arg3;
}
if (tmp) {
2026-07-23 10:11:24 +00:00
const tmp3 = !outer1_11.includes(arg3);
2026-07-20 16:05:17 +00:00
let flag = !tmp3;
if (tmp3) {
2026-07-23 10:11:24 +00:00
outer1_11.unshift(arg3);
outer1_11.splice(50);
2026-07-20 16:05:17 +00:00
flag = false;
}
tmp = flag;
}
if (!tmp) {
const subscriptions = this.subscriptions;
const item = subscriptions.forEach((evt) => {
2026-07-23 10:11:24 +00:00
if (evt.evt === closure_1) {
let tmp2 = "function" === typeof callback;
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = !callback(evt);
2026-07-20 16:05:17 +00:00
}
if (!tmp2) {
2026-07-23 10:11:24 +00:00
let tmp4 = "object" === typeof callback;
2026-07-20 16:05:17 +00:00
if (tmp4) {
let args = evt.args;
if (null == args) {
args = {};
}
2026-07-23 10:11:24 +00:00
const obj2 = RPCServer(outer2_1[5]);
2026-07-20 16:05:17 +00:00
const _Object = Object;
2026-07-23 10:11:24 +00:00
tmp4 = !obj2.isEqual(tmp5, RPCServer(outer2_1[5]).pick(args, Object.keys(tmp5)));
const obj3 = RPCServer(outer2_1[5]);
2026-07-20 16:05:17 +00:00
}
tmp2 = tmp4;
}
if (!tmp2) {
2026-07-23 10:11:24 +00:00
if ("function" === typeof callback2) {
callback2 = callback2(evt);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
self.dispatch(evt.socket, null, outer2_8.DISPATCH, evt.evt, callback2);
2026-07-20 16:05:17 +00:00
}
}
});
}
}
};
items[17] = {
key: "updateSubscriptions",
value() {
const subscriptions = this.subscriptions;
const item = subscriptions.forEach((update) => {
if (update.update) {
update.prevState = update.update(update);
}
});
}
};
items[18] = {
key: "storeWait",
value(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const self = this;
let closure_1 = arg0;
let apply = arg1;
let transformUser = arg2;
let tmp = arg1();
2026-07-20 16:05:17 +00:00
if (!tmp) {
if (0 !== arg2) {
2026-07-23 10:11:24 +00:00
let _isNativeReflectConstruct = RPCServer(outer1_1[5]).uniqueId();
function removeSubscription(closure_1, RPC_STORE_WAIT, arg2) {
return self.removeSubscription(closure_1, "RPC_STORE_WAIT", { uniqueId: _isNativeReflectConstruct });
2026-07-20 16:05:17 +00:00
}
const promise = new Promise((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
const _self = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const timeout = setTimeout(() => {
2026-07-23 10:11:24 +00:00
outer1_5();
2026-07-20 16:05:17 +00:00
const error = new Error("timeout");
2026-07-23 10:11:24 +00:00
callback2(error);
}, transformUser * RPCServer(outer2_1[11]).Millis.SECOND);
_self.addSubscription(closure_1, "RPC_STORE_WAIT", { uniqueId: _isNativeReflectConstruct }, () => {
const tmp = callback3();
2026-07-20 16:05:17 +00:00
if (tmp) {
const _clearTimeout = clearTimeout;
2026-07-23 10:11:24 +00:00
clearTimeout(callback3);
callback(tmp);
2026-07-20 16:05:17 +00:00
}
});
});
return promise.then((arg0) => {
removeSubscription();
return arg0;
});
}
}
return Promise.resolve(tmp);
}
};
return callback(RPCServer, items);
2026-07-23 10:11:24 +00:00
})();
let result = require("_defineProperties").fileFinishedImporting("modules/rpc/RPCServer.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;