decord/source/modules/interaction_components/InteractionModalStore.tsx

169 lines
5.2 KiB
TypeScript
Raw Normal View History

// Module ID: 14474
// Function ID: 14475
// Name: InteractionModalStore
// Dependencies: [1894, 38, 8180, 1090, 7508, 504, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 14474 (InteractionModalStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7508 */;
import InteractionActionCreators from "InteractionActionCreators" /* 8180 */;
2026-07-23 10:11:24 +00:00
require = fn;
const InteractionModalState = { IN_FLIGHT: 0, [0]: "IN_FLIGHT", ERRORED: 1, [1]: "ERRORED", SUCCEEDED: 2, [2]: "SUCCEEDED" };
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class InteractionModalStore extends Store {
}
InteractionModalStore.prototype["getModalState"] = function getModalState(arg0) {
2026-07-29 08:29:29 +00:00
let tmp = null;
if (arg0 === c3) {
tmp = ERRORED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
InteractionModalStore.displayName = "InteractionModalStore";
const interactionModalStore = new InteractionModalStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
LOGOUT: function handleInit() {
2026-08-24 06:08:38 +00:00
c3 = null;
ERRORED = null;
2026-08-24 06:08:38 +00:00
c5 = null;
c6 = null;
c7 = null;
2026-07-20 16:05:17 +00:00
return true;
},
INTERACTION_MODAL_CREATE: function handleInteractionModalCreate(nonce) {
2026-07-29 08:29:29 +00:00
if (nonce.nonce === c7) {
MessageActionCreatorsDefault.deleteMessage(c6, c5, true);
2026-07-29 08:29:29 +00:00
c5 = null;
c6 = null;
c7 = null;
2026-07-20 16:05:17 +00:00
}
return false;
},
INTERACTION_IFRAME_MODAL_CREATE: function handleInteractionIframeModalCreate(nonce) {
2026-07-29 08:29:29 +00:00
if (nonce.nonce === c7) {
MessageActionCreatorsDefault.deleteMessage(c6, c5, true);
2026-07-29 08:29:29 +00:00
c5 = null;
c6 = null;
c7 = null;
2026-07-20 16:05:17 +00:00
}
return false;
},
INTERACTION_QUEUE: function handleInteractionQueue(nonce) {
nonce = nonce.nonce;
({ data, preflight } = nonce);
2026-07-23 10:11:24 +00:00
let startTimeout;
2026-07-20 16:05:17 +00:00
const interactionType = data.interactionType;
if (nonce(1894).InteractionTypes.APPLICATION_COMMAND === interactionType) {
2026-07-20 16:05:17 +00:00
const messageId = nonce.messageId;
const channelId = data.channelId;
return false;
} else if (tmp(1894).InteractionTypes.MODAL_SUBMIT === interactionType) {
2026-07-29 08:29:29 +00:00
let tmp7 = null == nonce;
if (!tmp7) {
tmp7 = IN_FLIGHT === obj.ERRORED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp7) {
tmp7 = IN_FLIGHT === obj.SUCCEEDED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
startTimeout(38)(tmp7, "cannot submit multiple modals at once");
2026-07-23 10:11:24 +00:00
IN_FLIGHT = obj.IN_FLIGHT;
startTimeout = function startTimeout(dependencyMap) {
2026-07-29 08:29:29 +00:00
2026-07-23 10:11:24 +00:00
};
2026-07-20 16:05:17 +00:00
if (null != preflight) {
2026-07-29 08:29:29 +00:00
const _setTimeout2 = setTimeout;
let timerId = setTimeout(() => {
let tmp2 = nonce === closure_1_0;
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = IN_FLIGHT === constants.IN_FLIGHT;
2026-07-29 08:29:29 +00:00
}
if (tmp2) {
nonce(dependencyMap[2]).setFailed(closure_1_0);
const obj = nonce(dependencyMap[2]);
2026-07-29 08:29:29 +00:00
}
}, 2 * tmp3(1090).Millis.MINUTE);
2026-07-29 08:29:29 +00:00
preflight.then(() => {
if (typeof startTimeout === "function") {
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
let tmp2 = nonce === closure_1_0;
if (tmp2) {
tmp2 = IN_FLIGHT === constants.IN_FLIGHT;
}
if (tmp2) {
nonce(dependencyMap[2]).setFailed(closure_1_0);
const obj = nonce(dependencyMap[2]);
}
}, tmp);
} else {
throw new TypeError("Trying to call a non-function");
2026-07-29 08:29:29 +00:00
}
}).catch(() => InteractionActionCreators.setFailed(nonce));
2026-07-29 08:29:29 +00:00
const nextPromise = preflight.then(() => {
if (typeof startTimeout === "function") {
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
let tmp2 = nonce === closure_1_0;
if (tmp2) {
tmp2 = IN_FLIGHT === constants.IN_FLIGHT;
}
if (tmp2) {
nonce(dependencyMap[2]).setFailed(closure_1_0);
const obj = nonce(dependencyMap[2]);
}
}, tmp);
} else {
throw new TypeError("Trying to call a non-function");
2026-07-29 08:29:29 +00:00
}
});
2026-07-20 16:05:17 +00:00
} else {
let _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
const timerId1 = setTimeout(() => {
let tmp2 = nonce === closure_1_0;
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = IN_FLIGHT === constants.IN_FLIGHT;
2026-07-29 08:29:29 +00:00
}
if (tmp2) {
nonce(dependencyMap[2]).setFailed(closure_1_0);
const obj = nonce(dependencyMap[2]);
2026-07-29 08:29:29 +00:00
}
}, 10 * tmp3(1090).Millis.SECOND);
2026-07-20 16:05:17 +00:00
}
return true;
} else {
return false;
}
2026-07-29 08:29:29 +00:00
tmp = nonce;
2026-07-20 16:05:17 +00:00
},
INTERACTION_SUCCESS: function handleInteractionSuccess(nonce) {
nonce = nonce.nonce;
let flag = null != nonce;
if (flag) {
flag = nonce === c3;
2026-07-20 16:05:17 +00:00
}
if (flag) {
ERRORED = obj.SUCCEEDED;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
INTERACTION_FAILURE: function handleInteractionFailure(nonce) {
nonce = nonce.nonce;
let flag = null != nonce;
if (flag) {
flag = nonce === c3;
2026-07-20 16:05:17 +00:00
}
if (flag) {
ERRORED = obj.ERRORED;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/interaction_components/InteractionModalStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default interactionModalStore;
export { InteractionModalState };