decord/source/modules/guild_scheduled_events/useStartEvent.tsx

214 lines
6.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8943
// Function ID: 8944
2026-07-20 16:05:17 +00:00
// Name: useStartEvent
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 8944, 8945, 4277, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 8943 (useStartEvent)
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
let closure_6 = {
onSuccess() {
},
permissionOverwrites: []
};
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_scheduled_events/useStartEvent.tsx");
2026-07-20 16:05:17 +00:00
export default function useStartEvent() {
function _startEvent() {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = closure_1_3((arg0, arg1) => {
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c7 = 0;
c8 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0, arg1) {
2026-08-12 06:57:52 +00:00
if (c8 === 2) {
c8 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-12 06:57:52 +00:00
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
} else {
try {
c8 = 2;
if (0 === c7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c8 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
c4 = tmp3;
2026-08-12 06:57:52 +00:00
let permissionOverwrites = tmp7;
let onSuccess;
permissionOverwrites = undefined;
let tmp57 = onSuccess;
if (onSuccess === undefined) {
tmp57 = c6;
}
onSuccess = tmp57.onSuccess;
if (onSuccess === undefined) {
onSuccess = c6.onSuccess;
}
permissionOverwrites = tmp57.permissionOverwrites;
if (permissionOverwrites === undefined) {
permissionOverwrites = c6.permissionOverwrites;
}
c4 = undefined;
c7 = 1;
c8 = 1;
return { value: "ct", done: true };
}
} else if (1 === tmp7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c8 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
callback(true);
c6 = 1;
c7 = 3;
c8 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = callback2(8944).preStartEventActions(callback, permissionOverwrites);
2026-08-12 06:57:52 +00:00
return obj2;
}
} else {
if (2 === tmp7) {
c6 = 0;
2026-08-24 06:08:38 +00:00
aPIError = new callback(4277).APIError(closure_5);
callback2(aPIError);
2026-08-12 06:57:52 +00:00
callback(false);
callback(false);
c8 = 3;
} else if (3 === tmp7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 0;
c8 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
2026-08-24 06:08:38 +00:00
let obj7 = callback2(8944);
2026-08-12 06:57:52 +00:00
c7 = 4;
c8 = 1;
let obj4 = { value: null, done: false };
obj4[0] = obj7.setEventAsActive(callback, callback2);
return obj4;
}
} else if (4 === tmp7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 0;
c8 = 3;
const obj5 = { value: null, done: true };
obj5[0] = arg1;
return obj5;
} else {
2026-08-24 06:08:38 +00:00
obj4 = callback(8945);
2026-08-12 06:57:52 +00:00
c7 = 5;
c8 = 1;
const obj6 = { value: null, done: false };
obj6[0] = obj4.navigateToEvent(callback, onSuccess);
return obj6;
}
} else if (5 === tmp7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 0;
c8 = 3;
obj7 = { value: null, done: true };
obj7[0] = arg1;
return obj7;
} else {
2026-08-24 06:08:38 +00:00
obj1 = callback(8945);
2026-08-12 06:57:52 +00:00
c7 = 6;
c8 = 1;
const obj8 = { value: null, done: false };
obj8[0] = obj1.postStartActions(callback, onSuccess);
return obj8;
}
} else if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 !== 2) {
callback(false);
c6 = 0;
}
c6 = 0;
c8 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
} catch (tmp60) {
2026-08-24 06:08:38 +00:00
closure_5 = tmp60;
2026-08-12 06:57:52 +00:00
if (tmp4 === c6) {
c8 = tmp2;
throw tmp60;
} else {
c7 = tmp;
}
2026-07-29 08:29:29 +00:00
}
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_2 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp = callback(React.useState(false), 2);
2026-08-24 06:08:38 +00:00
closure_0 = tmp[1];
2026-07-20 16:05:17 +00:00
const tmp2 = callback(React.useState(null), 2);
2026-08-24 06:08:38 +00:00
closure_1 = tmp2[1];
2026-07-20 16:05:17 +00:00
const items = [
function startEvent(arg0, arg1) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _startEvent.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
},
{ loading: tmp[0], error: tmp2[0] }
];
return items;
};