2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 8269
|
2026-07-27 11:26:19 +00:00
|
|
|
// Function ID: 66409
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useGuildEventRecurrences
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [57, 31, 5751, 566, 8270, 8148, 22, 21, 664, 8159, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 8269 (useGuildEventRecurrences)
|
2026-07-23 10:11:24 +00:00
|
|
|
import _slicedToArray from "_slicedToArray";
|
|
|
|
|
import result from "result";
|
|
|
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-07-23 10:11:24 +00:00
|
|
|
const require = arg1;
|
|
|
|
|
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/guild_scheduled_events/useGuildEventRecurrences.tsx");
|
|
|
|
|
|
|
|
|
|
export default function useGuildEventRecurrences(arg0, arg1, closure_2) {
|
|
|
|
|
const _require = arg0;
|
2026-07-20 16:05:17 +00:00
|
|
|
const importDefault = arg1;
|
2026-07-23 10:11:24 +00:00
|
|
|
const dependencyMap = closure_2;
|
|
|
|
|
let obj = _require(566);
|
|
|
|
|
let items = [first];
|
|
|
|
|
const stateFromStores = obj.useStateFromStores(items, () => first.getGuildScheduledEvent(closure_0));
|
2026-07-25 08:10:48 +00:00
|
|
|
const tmp2 = importDefault(8270)(closure_2);
|
2026-07-20 16:05:17 +00:00
|
|
|
const React = tmp2;
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != closure_2) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != stateFromStores) {
|
2026-07-25 08:10:48 +00:00
|
|
|
let obj2 = _require(8148);
|
2026-07-23 10:11:24 +00:00
|
|
|
let _Date = Date;
|
2026-07-25 08:10:48 +00:00
|
|
|
let rRule = _require(8148).getRRule(closure_2);
|
2026-07-23 10:11:24 +00:00
|
|
|
let date = new Date(stateFromStores.scheduled_start_time);
|
2026-07-20 16:05:17 +00:00
|
|
|
const nextRecurrences = obj2.generateNextRecurrences(4, rRule, date);
|
2026-07-25 08:10:48 +00:00
|
|
|
let obj3 = _require(8148);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const tmp15 = stateFromStores(tmp4([]), 2);
|
|
|
|
|
first = tmp15[0];
|
2026-07-20 16:05:17 +00:00
|
|
|
let closure_6 = tmp15[1];
|
2026-07-23 10:11:24 +00:00
|
|
|
const items1 = [closure_2, first.length, stateFromStores, tmp2];
|
2026-07-20 16:05:17 +00:00
|
|
|
const effect = React.useEffect(() => {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != result) {
|
|
|
|
|
if (null != dependencyMap) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != stateFromStores) {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (!obj3.isEqual(result, dependencyMap)) {
|
2026-07-25 08:10:48 +00:00
|
|
|
const rRule = callback(8148).getRRule(dependencyMap);
|
|
|
|
|
const obj = callback(8148);
|
2026-07-20 16:05:17 +00:00
|
|
|
const _Date = Date;
|
|
|
|
|
const date = new Date(stateFromStores.scheduled_start_time);
|
2026-07-25 08:10:48 +00:00
|
|
|
callback3(callback(8148).generateNextRecurrences(first.length, rRule, date));
|
|
|
|
|
const obj2 = callback(8148);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
obj3 = callback2(22);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, items1);
|
|
|
|
|
const items2 = [arg0, arg1, first];
|
|
|
|
|
const effect1 = React.useEffect(() => {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != callback2) {
|
2026-07-20 16:05:17 +00:00
|
|
|
const mapped = first.map((getTime) => {
|
|
|
|
|
const time = getTime.getTime();
|
2026-07-23 10:11:24 +00:00
|
|
|
const rounded = Math.floor(time / callback(664).Millis.SECOND);
|
|
|
|
|
return callback(21).fromTimestamp(rounded * callback(664).Millis.SECOND);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
2026-07-25 08:10:48 +00:00
|
|
|
const guildEventUserCounts = callback2(8159).getGuildEventUserCounts(callback2, closure_0, mapped);
|
|
|
|
|
const obj = callback2(8159);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}, items2);
|
2026-07-23 10:11:24 +00:00
|
|
|
const items3 = [closure_2, first, ];
|
2026-07-20 16:05:17 +00:00
|
|
|
let scheduled_start_time;
|
|
|
|
|
if (null != stateFromStores) {
|
|
|
|
|
scheduled_start_time = stateFromStores.scheduled_start_time;
|
|
|
|
|
}
|
|
|
|
|
items3[2] = scheduled_start_time;
|
|
|
|
|
obj = {
|
|
|
|
|
recurrenceStartTimes: first,
|
|
|
|
|
canViewMoreRecurrences: React.useMemo(() => {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != dependencyMap) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (0 !== first.length) {
|
|
|
|
|
let scheduled_start_time;
|
|
|
|
|
if (null != stateFromStores) {
|
|
|
|
|
scheduled_start_time = stateFromStores.scheduled_start_time;
|
|
|
|
|
}
|
|
|
|
|
if (null != scheduled_start_time) {
|
|
|
|
|
const _Date = Date;
|
|
|
|
|
const date = new Date();
|
|
|
|
|
const fullYear = date.getFullYear();
|
2026-07-25 08:10:48 +00:00
|
|
|
date.setFullYear(fullYear + callback(8148).MAX_YEARS_AHEAD_RECURRING_EVENT);
|
|
|
|
|
const rRule = callback(8148).getRRule(dependencyMap);
|
2026-07-23 10:11:24 +00:00
|
|
|
const afterResult = rRule.after(first[first.length - 1]);
|
2026-07-20 16:05:17 +00:00
|
|
|
return null != afterResult && afterResult <= date;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}, items3),
|
|
|
|
|
updateRecurrenceStartTimes() {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != dependencyMap) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != stateFromStores) {
|
2026-07-25 08:10:48 +00:00
|
|
|
const rRule = callback(8148).getRRule(dependencyMap);
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [];
|
|
|
|
|
let arraySpreadResult = HermesBuiltin.arraySpread(first, 0);
|
2026-07-25 08:10:48 +00:00
|
|
|
const obj2 = callback(8148);
|
2026-07-20 16:05:17 +00:00
|
|
|
arraySpreadResult = HermesBuiltin.arraySpread(obj2.generateNextRecurrences(4, rRule, tmp7, true), arraySpreadResult);
|
2026-07-23 10:11:24 +00:00
|
|
|
callback3(items);
|
2026-07-25 08:10:48 +00:00
|
|
|
const obj = callback(8148);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
};
|