Files
discord-decomp/sources/modules/interaction_components/LocalInteractionComponentStateStore.tsx
2026-07-28 01:06:53 +03:00

213 lines
10 KiB
TypeScript

/* Metro module 8358; source: modules/interaction_components/LocalInteractionComponentStateStore.tsx; dependencies: [6, 7, 15, 17, 18, 8359, 566, 694, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun66556(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:6, offset: 0x01c00a99, size: 498 bytes, params: 8, frame: 20
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(8359) /* metro dependency 8359: LimitedMap */;
value = new value(196606);
value = importDefault(8359) /* metro dependency 8359: LimitedMap */;
value = new value(196606);
value = importDefault(8359) /* metro dependency 8359: LimitedMap */;
value = new value(196606);
const Store = (Flux).Store;
_fun66562(Store).displayName = 'LocalInteractionComponentStateStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {LOGOUT: LOGOUT_66567,
QUEUE_INTERACTION_COMPONENT_STATE: QUEUE_INTERACTION_COMPONENT_STATE,
SET_INTERACTION_COMPONENT_STATE: function({rootContainerId, componentId, state}) {
setComponentState(rootContainerId, componentId, state);
}, MESSAGE_DELETE: MESSAGE_DELETE_66570, MESSAGE_UPDATE: MESSAGE_UPDATE_66571,
INTERACTION_SUCCESS: INTERACTION_SUCCESS_66572, INTERACTION_FAILURE: INTERACTION_FAILURE_66573,
CLEAR_INTERACTION_MODAL_STATE: CLEAR_INTERACTION_MODAL_STATE});
(FileImportTrackerModule).fileFinishedImporting('modules/interaction_components/LocalInteractionComponentStateStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_66557() { // fn#66557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:148, offset: 0x01c00c8b, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_66557_isNativeReflectConstruct = function() {
return !!result;
})();
}
function setComponentState(a0, a1, a2) { // fn#66560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:412, offset: 0x01c00ced, size: 101 bytes, params: 4, frame: 15
var r3;
var map;
let binding = env0_5;
const value2 = binding.get(a0);
if (value2 != null) {
r3 = value2;
} else {
map = new global.Map();
}
r3.set(a1, a2);
env0_5.set(a0, r3);
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
function deleteStatesForMessageId(a0) { // fn#66561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:509, offset: 0x01c00d52, size: 83 bytes, params: 2, frame: 13
let binding = env0_7;
const value2 = binding.get(a0);
if (value2 != null) {
env0_8.delete(value2);
}
env0_7.delete(a0);
env0_5.delete(a0);
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
function _fun66562(a0) { // fn#66562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:616, offset: 0x01c00da5, size: 126 bytes, params: 2, frame: 16
const LocalInteractionComponentStateStore2 = LocalInteractionComponentStateStore;
Inherits(LocalInteractionComponentStateStore2, a0);
return CreateClass(LocalInteractionComponentStateStore2, [{key: 'getInteractionComponentStates', value: value_66564},
{key: 'getInteractionComponentStateVersion', value: value_66565}, {key: 'getInteractionComponentState',
value: value_66566}]);
function LocalInteractionComponentStateStore() { // fn#66563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:628, offset: 0x00fbdfd6, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_0(this, LocalInteractionComponentStateStore);
const value3 = env1_3(LocalInteractionComponentStateStore);
return env1_2(this, _isNativeReflectConstruct_66557() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function value_66564() { // fn#66564, offset: 0x00e40571, size: 9 bytes, params: 1, frame: 1
return env1_5;
}
function value_66565() { // fn#66565, offset: 0x00c82288, size: 9 bytes, params: 1, frame: 1
return env1_6;
}
function value_66566(a0, a1) { // fn#66566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1175, offset: 0x01c00e23, size: 61 bytes, params: 3, frame: 13
var r0;
let value = environment.__proto__;
value = env1_5.get(a0);
const value2 = null;
if (value2 == value) {
r0 = value2;
} else {
value = value.get(a1);
r0 = value2 != value ? value : value2;
}
return r0;
}
}
function LOGOUT_66567() { // fn#66567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1352, offset: 0x01c00e60, size: 60 bytes, params: 1, frame: 10
let binding = env0_5;
binding.clear();
env0_7.clear();
env0_8.clear();
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
function QUEUE_INTERACTION_COMPONENT_STATE({messageId, nonce, componentId, state}) { // fn#66568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1443, offset: 0x01c00e9c, size: 84 bytes, params: 2, frame: 19
let binding = env0_7;
binding.set(messageId, nonce);
binding = env0_8;
binding.set(nonce, {messageId: messageId, componentId: componentId});
setComponentState(messageId, componentId, state);
}
function MESSAGE_DELETE_66570({id}) { // fn#66570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1763, offset: 0x01c00f16, size: 45 bytes, params: 2, frame: 12
const binding = env0_5;
if (binding.has(id)) {
deleteStatesForMessageId(id);
return undefined;
}
return false;
}
function MESSAGE_UPDATE_66571({message}) { // fn#66571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1866, offset: 0x01c00f43, size: 66 bytes, params: 2, frame: 13
if (message.id != null) {
var binding = env0_5;
if (binding.has(message.id)) {
deleteStatesForMessageId(message.id);
return undefined;
}
}
return false;
}
function INTERACTION_SUCCESS_66572({nonce}) { // fn#66572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:1997, offset: 0x01c00f85, size: 92 bytes, params: 2, frame: 13
if (nonce == null) {
return false;
}
let binding = env0_8;
const value2 = binding.get(nonce);
if (value2 == null) {
return false;
}
env0_7.delete(value2.messageId);
env0_8.delete(nonce);
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
function INTERACTION_FAILURE_66573({nonce}) { // fn#66573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:2156, offset: 0x01c00fe1, size: 136 bytes, params: 2, frame: 14
if (nonce == null) {
return false;
}
let binding = env0_8;
const value2 = binding.get(nonce);
if (value2 == null) {
return false;
}
const componentId = value2.componentId;
const messageId = value2.messageId;
const value3 = env0_5.get(messageId);
if (value3 != null) {
if (value3.has(componentId)) {
value3.delete(componentId);
if (value3.size === 0) {
env0_5.delete(messageId);
}
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
}
}
function CLEAR_INTERACTION_MODAL_STATE({customId}) { // fn#66574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8543:2448, offset: 0x01c01069, size: 41 bytes, params: 2, frame: 12
let binding = env0_5;
binding.delete(customId);
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
}
global.__d(_fun66556, 8358, [6, 7, 15, 17, 18, 8359, 566, 694,
2]) /* metro module 8358, dependencies: [6, 7, 15, 17, 18, 8359, 566, 694, 2] */;