decord/source/modules/applications/useGuildApplication.tsx

121 lines
3.5 KiB
TypeScript
Raw Normal View History

// Module ID: 17682
// Function ID: 17683
2026-07-20 16:05:17 +00:00
// Name: useGuildApplication
// Dependencies: [5, 32, 19, 4788, 504, 7163, 4461, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17682 (useGuildApplication)
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import closure_6 from "addApplication" /* 4788 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/applications/useGuildApplication.tsx");
2026-07-20 16:05:17 +00:00
export default function useGuildApplication(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [closure_6];
2026-07-23 10:11:24 +00:00
application = _require(application[4]).useStateFromStores(items, () => guildApplication.getGuildApplication(closure_0, closure_1));
2026-07-29 08:29:29 +00:00
let obj = _require(application[4]);
2026-08-24 06:08:38 +00:00
[tmp3, closure_3] = callback2(first.useState(null == application), 2);
error = callback2(first.useState(), 2);
2026-07-23 10:11:24 +00:00
callback2 = error[1];
2026-07-29 08:29:29 +00:00
const tmp5 = callback2(first.useState(false), 2);
first = tmp5[0];
2026-08-24 06:08:38 +00:00
closure_6 = tmp5[1];
2026-07-20 16:05:17 +00:00
const items1 = [application, arg1, arg0];
2026-07-29 08:29:29 +00:00
callback = first.useCallback(callback(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2;
if (0 === v02) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp4;
closure_0 = tmp8;
if (null == closure_1_2) {
if (null != closure_1_0) {
closure_1_6(true);
2026-07-29 08:29:29 +00:00
v0(true);
v0 = 2;
2026-08-24 06:08:38 +00:00
obj1 = closure_1_1(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
obj1 = { type: null, includeTeam: true };
2026-08-24 06:08:38 +00:00
obj1[0] = closure_1_1;
2026-07-29 08:29:29 +00:00
v02 = 3;
c5 = 1;
const obj2 = { value: null, done: false };
obj2[0] = obj1.getApplicationsForGuild(tmp33, obj1);
return obj2;
}
}
c5 = 3;
}
} else if (1 !== tmp8) {
if (2 === tmp8) {
v0 = 1;
closure_0 = closure_2;
2026-08-24 06:08:38 +00:00
const aPIError = new closure_1_0(closure_1_2[6]).APIError(closure_0);
2026-07-29 08:29:29 +00:00
v02(aPIError);
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 0;
v0(false);
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
v0 = 1;
}
v0 = 0;
v0(false);
}
v0 = 0;
v0(false);
throw closure_2;
} catch (tmp41) {
closure_2 = tmp41;
if (tmp5 === v0) {
c5 = tmp3;
throw tmp41;
} else if (tmp2 === tmp43) {
v02 = tmp2;
} else {
v02 = tmp;
}
}
}
}), items1);
2026-07-20 16:05:17 +00:00
const items2 = [first, callback];
2026-07-23 10:11:24 +00:00
const effect = first.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!first) {
callback();
}
}, items2);
return { application, error: error[0], loading };
};