decord/source/stores/ChannelSettingsStore.tsx

814 lines
25 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 7799
// Function ID: 7800
2026-07-29 08:29:29 +00:00
// Name: normalizeChannelPropertyForCompare
2026-08-05 07:35:12 +00:00
// Dependencies: [1376, 7655, 1882, 1372, 676, 1235, 3894, 3896, 1381, 1382, 530, 709, 12, 1411, 3837, 589, 2]
2026-07-23 10:11:24 +00:00
2026-08-05 07:35:12 +00:00
// Module 7799 (normalizeChannelPropertyForCompare)
2026-07-29 08:29:29 +00:00
import { createChannelRecordFromInvite as closure_9 } from "createChannelRecord";
import createFromServer from "createFromServer";
import createdAt from "createdAt";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
import { DEFAULT_AUTO_ARCHIVE_DURATION as closure_17 } from "AbortCodes";
import { Store } from "initialize";
2026-07-23 10:11:24 +00:00
import importDefaultResult from "apply";
2026-07-20 16:05:17 +00:00
let FormStates;
2026-07-23 10:11:24 +00:00
let closure_14;
2026-07-29 08:29:29 +00:00
let closure_15;
let map1;
function normalizeChannelPropertyForCompare(arg0, arg1, arg2) {
let str = arg1;
2026-07-20 16:05:17 +00:00
if ("topic_" === arg0) {
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return str;
2026-07-20 16:05:17 +00:00
} else if ("defaultAutoArchiveDuration" === arg0) {
2026-07-29 08:29:29 +00:00
let tmp21 = str;
if (str == null) {
tmp21 = closure_17;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp21;
2026-07-20 16:05:17 +00:00
} else if ("defaultSortOrder" === arg0) {
2026-07-29 08:29:29 +00:00
let LATEST_ACTIVITY = str;
if (str == null) {
LATEST_ACTIVITY = require(1381) /* set */.ThreadSortOrder.LATEST_ACTIVITY;
2026-07-20 16:05:17 +00:00
}
return LATEST_ACTIVITY;
} else if ("defaultForumLayout" === arg0) {
if (arg2 === constants2.GUILD_MEDIA) {
2026-07-29 08:29:29 +00:00
return require(1382) /* set */.ForumLayout.GRID;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (null == str) {
let LIST = require(1382) /* set */.ForumLayout.LIST;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
LIST = str;
2026-07-20 16:05:17 +00:00
}
return LIST;
}
} else {
if ("rateLimitPerUser_" !== arg0) {
if ("defaultThreadRateLimitPerUser" !== arg0) {
if ("defaultReactionEmoji" === arg0) {
let tmp2 = null;
2026-07-29 08:29:29 +00:00
if (null != str) {
2026-08-05 07:35:12 +00:00
let obj = require(3894) /* MAX_REACTIONS */;
2026-07-29 08:29:29 +00:00
if (obj.isCustomReactionEmojiId(str.emojiId)) {
obj = { emojiId: null };
obj[0] = str.emojiId;
2026-07-20 16:05:17 +00:00
tmp2 = obj;
} else {
2026-07-29 08:29:29 +00:00
const emojiName = str.emojiName;
2026-07-20 16:05:17 +00:00
let tmp5 = null;
if (null != emojiName) {
tmp5 = null;
if ("" !== emojiName) {
2026-07-29 08:29:29 +00:00
obj = { emojiName: null };
2026-08-05 07:35:12 +00:00
obj[0] = importDefault(3896).translateInlineEmojiToSurrogates(emojiName);
2026-07-20 16:05:17 +00:00
tmp5 = obj;
2026-08-05 07:35:12 +00:00
const obj3 = importDefault(3896);
2026-07-20 16:05:17 +00:00
}
}
tmp2 = tmp5;
}
}
return tmp2;
} else {
2026-07-29 08:29:29 +00:00
return str;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
let num = str;
if (str == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return num;
2026-07-20 16:05:17 +00:00
}
}
function _createInvite(code) {
2026-07-29 08:29:29 +00:00
const obj = { code: code.code, temporary: code.temporary, revoked: code.revoked, inviter: null, channel: null, guild: null, uses: null, maxUses: null, maxAge: null, createdAt: null, type: null, roles: null };
2026-07-20 16:05:17 +00:00
let tmp2 = null;
2026-07-29 08:29:29 +00:00
let tmp = createFromServer;
2026-07-20 16:05:17 +00:00
if (null != code.inviter) {
2026-07-29 08:29:29 +00:00
tmp2 = new createdAt(code.inviter);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp2;
obj[4] = callback(code.channel);
2026-07-20 16:05:17 +00:00
let fromInviteGuildResult = null;
if (null != code.guild) {
2026-07-29 08:29:29 +00:00
fromInviteGuildResult = require(1411) /* fromGuildPropertiesWithAdditionalFields */.fromInviteGuild(code.guild);
const obj2 = require(1411) /* fromGuildPropertiesWithAdditionalFields */;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[5] = fromInviteGuildResult;
({ uses: obj[6], max_uses: obj[7], max_age: obj[8] } = code);
2026-08-05 07:35:12 +00:00
obj[9] = importDefault(3837)(code.created_at);
2026-07-29 08:29:29 +00:00
({ type: obj[10], roles: obj[11] } = code);
2026-07-20 16:05:17 +00:00
tmp = new tmp(obj);
return tmp;
}
2026-07-23 10:11:24 +00:00
function _syncChannelUpdate(id) {
2026-07-20 16:05:17 +00:00
let flag = false;
if (null != channel1) {
flag = false;
2026-07-23 10:11:24 +00:00
if (channel1.id === id) {
2026-07-29 08:29:29 +00:00
if (channel1 === store) {
const channel = store2.getChannel(id);
2026-07-20 16:05:17 +00:00
flag = false;
if (null != channel) {
2026-07-23 10:11:24 +00:00
channel1 = channel;
2026-07-29 08:29:29 +00:00
store = channel;
let channel2 = obj2.getChannel(store.parent_id);
2026-07-20 16:05:17 +00:00
flag = true;
}
2026-07-29 08:29:29 +00:00
obj2 = store2;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
channel1 = store2.getChannel(id);
2026-07-20 16:05:17 +00:00
flag = false;
if (null != channel1) {
flag = true;
2026-07-29 08:29:29 +00:00
if (null != store) {
const result = store.set("permissionOverwrites", channel1.permissionOverwrites);
store = result.set("availableTags", channel1.availableTags);
channel2 = obj3.getChannel(store.parent_id);
2026-07-20 16:05:17 +00:00
flag = true;
}
}
2026-07-29 08:29:29 +00:00
obj3 = store2;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
let tmp10 = !flag;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
tmp10 = null == store;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag2 = !tmp10;
if (!tmp10) {
let tmp13 = null != guildId;
if (tmp13) {
tmp13 = null == store.permissionOverwrites[guildId];
2026-07-20 16:05:17 +00:00
}
flag2 = true;
2026-07-29 08:29:29 +00:00
if (tmp13) {
guildId = store.getGuildId();
2026-07-20 16:05:17 +00:00
flag2 = true;
}
}
return flag2;
}
function handleOverwriteUpdate(channelId) {
return _syncChannelUpdate(channelId.channelId);
}
2026-07-29 08:29:29 +00:00
({ ChannelSettingsSections: map1, ChannelTypes: closure_14, Endpoints: closure_15, FormStates } = ME);
2026-07-23 10:11:24 +00:00
let CLOSED = FormStates.CLOSED;
2026-07-29 08:29:29 +00:00
let closure_19 = {};
let closure_20 = {};
let c21 = false;
let c22 = false;
let c23 = null;
let closure_24 = ["name", "type", "topic_", "bitrate_", "userLimit_", "nsfw_", "flags_", "rateLimitPerUser_", "defaultThreadRateLimitPerUser", "defaultAutoArchiveDuration", "template", "defaultReactionEmoji", "rtcRegion", "videoQualityMode", "threadMetadata", "banner", "availableTags", "defaultSortOrder", "defaultForumLayout", "defaultTagSetting", "iconEmoji", "themeColor"];
let closure_26 = require("apply").debounce(() => {
if (null != store) {
if (null != closure_5) {
const toJSResult = store.toJS();
2026-07-23 10:11:24 +00:00
const require = toJSResult;
2026-07-29 08:29:29 +00:00
let closure_1 = closure_5.toJS();
2026-07-23 10:11:24 +00:00
const type = toJSResult.type;
2026-07-29 08:29:29 +00:00
let everyResult = closure_24.every((arg0) => {
const tmp = outer1_25(arg0, toJSResult[arg0], type);
const tmp2 = outer1_25(arg0, dependencyMap[arg0], type);
return dependencyMap(type[12]).isEqual(tmp, tmp2);
2026-07-20 16:05:17 +00:00
});
if (everyResult) {
2026-07-29 08:29:29 +00:00
everyResult = store !== closure_5;
2026-07-20 16:05:17 +00:00
}
if (everyResult) {
2026-07-29 08:29:29 +00:00
store = closure_5;
channelSettingsStore.emitChange();
2026-07-20 16:05:17 +00:00
}
}
}
return false;
}, 500);
2026-07-29 08:29:29 +00:00
class ChannelSettingsStore extends Store {
}
const prototype = ChannelSettingsStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(ensureGuildLoaded);
};
prototype["hasChanges"] = function hasChanges() {
return closure_6 !== closure_5;
};
prototype["isOpen"] = function isOpen() {
return c22;
};
prototype["getSection"] = function getSection() {
return closure_3;
};
prototype["getInvites"] = function getInvites() {
return { invites: closure_20, loading: c21 };
};
prototype["showNotice"] = function showNotice() {
return this.hasChanges();
};
prototype["getChannel"] = function getChannel() {
return closure_6;
};
prototype["getFormState"] = function getFormState() {
return CLOSED;
};
prototype["getCategory"] = function getCategory() {
return closure_7;
};
prototype["getProps"] = function getProps() {
return { submitting: CLOSED === FormStates.SUBMITTING, errors: closure_19, channel: closure_6, section: closure_3, subsection: closure_4, invites: closure_20, selectedOverwriteId: closure_8, hasChanges: this.hasChanges(), analyticsLocation: c23 };
};
ChannelSettingsStore.displayName = "ChannelSettingsStore";
const channelSettingsStore = new ChannelSettingsStore(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CHANNEL_SETTINGS_INIT: function handleSettingsInit(channelId) {
2026-07-29 08:29:29 +00:00
let obj = store2;
let channel = store2.getChannel(channelId.channelId);
2026-07-20 16:05:17 +00:00
if (null == channel) {
2026-07-29 08:29:29 +00:00
let c22 = false;
let OPEN = FormStates.CLOSED;
let c3 = null;
channel = null;
let store = null;
let channel2 = null;
let closure_20 = {};
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
OPEN = FormStates.OPEN;
store = channel;
2026-07-20 16:05:17 +00:00
let _location = null;
if ("location" in channelId) {
_location = null;
if (null != channelId.location) {
_location = channelId.location;
}
}
let subsection = null;
if ("subsection" in channelId) {
subsection = channelId.subsection;
}
2026-07-29 08:29:29 +00:00
let closure_4 = subsection;
if (null != store) {
store = store.set("nsfw", store.isNSFW());
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
channel2 = obj.getChannel(store.parent_id);
const guildId = store.getGuildId();
if (store.isModeratorReportChannel()) {
let OVERVIEW = tmp10.PERMISSIONS;
let tmp11 = tmp10;
} else {
OVERVIEW = tmp10.OVERVIEW;
tmp11 = tmp10;
}
let closure_19 = {};
let tmp12 = c3;
if (c3 == null) {
tmp12 = OVERVIEW;
}
c3 = tmp12;
let tmp15 = null != store;
if (tmp15) {
tmp15 = c3 === tmp11.INSTANT_INVITES;
}
if (tmp15) {
let c21 = true;
const HTTP = require(530) /* sendRequest */.HTTP;
obj = { url: null, oldFormErrors: true, rejectWithError: true };
obj[0] = closure_15.INSTANT_INVITES(store.id);
const value = HTTP.get(obj);
value.then((body) => {
let c21 = false;
let obj = callback(table[11]);
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
obj.dispatch(obj);
}, () => {
let c21 = false;
return false;
});
2026-07-20 16:05:17 +00:00
}
return true;
}
},
CHANNEL_SETTINGS_SUBMIT: function handleSettingsSubmit() {
2026-07-23 10:11:24 +00:00
const SUBMITTING = FormStates.SUBMITTING;
2026-07-29 08:29:29 +00:00
let closure_19 = {};
2026-07-20 16:05:17 +00:00
},
CHANNEL_SETTINGS_SUBMIT_SUCCESS: function handleSettingsSubmitSuccess() {
2026-07-29 08:29:29 +00:00
let closure_5 = closure_6;
2026-07-23 10:11:24 +00:00
const OPEN = FormStates.OPEN;
2026-07-20 16:05:17 +00:00
},
CHANNEL_SETTINGS_SUBMIT_FAILURE: function handleSettingsSubmitFailure(errors) {
2026-07-23 10:11:24 +00:00
let closure_0 = errors;
const OPEN = FormStates.OPEN;
2026-07-20 16:05:17 +00:00
errors = errors.errors;
2026-07-29 08:29:29 +00:00
if (errors == null) {
2026-07-20 16:05:17 +00:00
errors = {};
}
const keys = Object.keys(errors);
2026-07-29 08:29:29 +00:00
let closure_19 = keys.reduce((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
if (obj2.isArray(errors.errors[arg1])) {
2026-07-20 16:05:17 +00:00
arg0[arg1] = obj.join("\n");
} else {
arg0[arg1] = obj;
}
return arg0;
}, {});
},
2026-07-29 08:29:29 +00:00
CHANNEL_SETTINGS_CLOSE: function handleSettingsClose() {
let c22 = false;
const CLOSED = FormStates.CLOSED;
let c3 = null;
let c5 = null;
let c6 = null;
let c7 = null;
let closure_20 = {};
},
2026-07-20 16:05:17 +00:00
CHANNEL_PERMISSIONS_PUT_OVERWRITE_SUCCESS: handleOverwriteUpdate,
CHANNEL_PERMISSIONS_DELETE_OVERWRITE_SUCCESS: handleOverwriteUpdate,
CHANNEL_SETTINGS_OVERWRITE_SELECT: function handlePermissionOverwriteSelect(overwriteId) {
overwriteId = overwriteId.overwriteId;
},
CHANNEL_SETTINGS_UPDATE: function handleSettingsUpdate(arg0) {
let autoArchiveDuration;
let availableTags;
let bitrate;
let channelType;
let defaultAutoArchiveDuration;
let defaultForumLayout;
let defaultReactionEmoji;
let defaultSortOrder;
let defaultTagSetting;
let defaultThreadRateLimitPerUser;
let flags;
let iconEmoji;
let invitable;
let locked;
let name;
let nsfw;
let rateLimitPerUser;
let rtcRegion;
let template;
let themeColor;
let topic;
let userLimit;
let videoQualityMode;
({ name, channelType, topic, bitrate, userLimit, nsfw, flags, rateLimitPerUser, defaultThreadRateLimitPerUser, autoArchiveDuration, locked, invitable, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor } = arg0);
2026-07-29 08:29:29 +00:00
if (null == store) {
2026-07-20 16:05:17 +00:00
return false;
} else {
if (null != name) {
2026-07-29 08:29:29 +00:00
store = store.set("name", name);
2026-07-20 16:05:17 +00:00
}
if (null != topic) {
2026-07-29 08:29:29 +00:00
store = store.set("topic", topic);
2026-07-20 16:05:17 +00:00
}
if (null != bitrate) {
2026-07-29 08:29:29 +00:00
store = store.set("bitrate", bitrate);
2026-07-20 16:05:17 +00:00
}
if (null != userLimit) {
2026-07-29 08:29:29 +00:00
store = store.set("userLimit", userLimit);
2026-07-20 16:05:17 +00:00
}
if (null != nsfw) {
2026-07-29 08:29:29 +00:00
store = store.set("nsfw", nsfw);
2026-07-20 16:05:17 +00:00
}
if (null != flags) {
2026-07-29 08:29:29 +00:00
store = store.set("flags", flags);
2026-07-20 16:05:17 +00:00
}
if (null != rateLimitPerUser) {
2026-07-29 08:29:29 +00:00
store = store.set("rateLimitPerUser", rateLimitPerUser);
2026-07-20 16:05:17 +00:00
}
if (null != defaultThreadRateLimitPerUser) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultThreadRateLimitPerUser", defaultThreadRateLimitPerUser);
2026-07-20 16:05:17 +00:00
}
if (null != autoArchiveDuration) {
let obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(store.threadMetadata);
obj.autoArchiveDuration = autoArchiveDuration;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != locked) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(store.threadMetadata);
obj.locked = locked;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != invitable) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged2 = Object.assign(store.threadMetadata);
obj.invitable = invitable;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != defaultAutoArchiveDuration) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultAutoArchiveDuration", defaultAutoArchiveDuration);
2026-07-20 16:05:17 +00:00
}
if (null != template) {
2026-07-29 08:29:29 +00:00
store = store.set("template", template);
2026-07-20 16:05:17 +00:00
}
if (null != channelType) {
2026-07-29 08:29:29 +00:00
store = store.set("type", channelType);
2026-07-20 16:05:17 +00:00
}
if (undefined !== rtcRegion) {
2026-07-29 08:29:29 +00:00
store = store.set("rtcRegion", rtcRegion);
2026-07-20 16:05:17 +00:00
}
if (null != videoQualityMode) {
2026-07-29 08:29:29 +00:00
store = store.set("videoQualityMode", videoQualityMode);
2026-07-20 16:05:17 +00:00
}
if (undefined !== defaultReactionEmoji) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultReactionEmoji", defaultReactionEmoji);
2026-07-20 16:05:17 +00:00
}
if (null != availableTags) {
2026-07-29 08:29:29 +00:00
store = store.set("availableTags", availableTags);
2026-07-20 16:05:17 +00:00
}
if (null != defaultSortOrder) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultSortOrder", defaultSortOrder);
2026-07-20 16:05:17 +00:00
}
if (null != defaultTagSetting) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultTagSetting", defaultTagSetting);
2026-07-20 16:05:17 +00:00
}
if (null != defaultForumLayout) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultForumLayout", defaultForumLayout);
2026-07-20 16:05:17 +00:00
}
if (undefined !== iconEmoji) {
2026-07-29 08:29:29 +00:00
store = store.set("iconEmoji", iconEmoji);
2026-07-20 16:05:17 +00:00
}
if (null != themeColor) {
2026-07-29 08:29:29 +00:00
store = store.set("themeColor", themeColor);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback2();
}
},
CHANNEL_SETTINGS_SET_SECTION: function handleSetSection(arg0) {
let closure_3;
let closure_4;
({ section: closure_3, subsection: closure_4 } = arg0);
let tmp = null != store;
if (tmp) {
tmp = closure_3 === constants.INSTANT_INVITES;
}
if (tmp) {
let c21 = true;
const HTTP = require(530) /* sendRequest */.HTTP;
const obj = { url: null, oldFormErrors: true, rejectWithError: true };
obj[0] = closure_15.INSTANT_INVITES(store.id);
const value = HTTP.get(obj);
value.then((body) => {
let c21 = false;
let obj = callback(table[11]);
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
obj.dispatch(obj);
}, () => {
let c21 = false;
return false;
});
2026-07-20 16:05:17 +00:00
}
},
CHANNEL_SETTINGS_LOADED_INVITES: function handleLoadedInvites(invites) {
2026-07-29 08:29:29 +00:00
let closure_20 = {};
2026-07-20 16:05:17 +00:00
invites = invites.invites;
const item = invites.forEach((code) => {
2026-07-29 08:29:29 +00:00
closure_20[code.code] = callback(code);
2026-07-20 16:05:17 +00:00
});
},
2026-07-29 08:29:29 +00:00
CHANNEL_UPDATES: function handleChannelUpdates(channels) {
channels = channels.channels;
if (null == closure_6) {
2026-07-20 16:05:17 +00:00
return false;
} else {
let flag = false;
2026-07-29 08:29:29 +00:00
const tmp2 = channels[Symbol.iterator]();
while (tmp2 !== undefined) {
let tmp6 = _syncChannelUpdate;
let tmp7 = _syncChannelUpdate(tmp4.id) || flag;
flag = tmp7;
continue;
}
return flag;
2026-07-20 16:05:17 +00:00
}
},
THREAD_UPDATE: function handleThreadUpdate(arg0) {
2026-07-29 08:29:29 +00:00
let tmp2 = null != closure_6;
2026-07-20 16:05:17 +00:00
if (tmp2) {
tmp2 = _syncChannelUpdate(tmp.id);
}
return tmp2;
},
CHANNEL_DELETE: function handleChannelDelete(arg0) {
2026-07-29 08:29:29 +00:00
let tmp2 = null != store;
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-07-29 08:29:29 +00:00
if (store.id === tmp) {
2026-07-20 16:05:17 +00:00
const CLOSED = FormStates.CLOSED;
}
tmp2 = tmp4;
}
return tmp2;
},
INSTANT_INVITE_REVOKE_SUCCESS: function handleInviteRevoke(arg0) {
2026-07-23 10:11:24 +00:00
const obj = {};
const merged = Object.assign(obj);
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
},
INSTANT_INVITE_CREATE_SUCCESS: function handleInviteCreateSuccess(invite) {
const obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(obj);
2026-07-20 16:05:17 +00:00
obj[invite.invite.code] = _createInvite(invite.invite);
}
});
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
CHANNEL_SETTINGS_INIT: function handleSettingsInit(channelId) {
2026-07-29 08:29:29 +00:00
let obj = store2;
let channel = store2.getChannel(channelId.channelId);
2026-07-20 16:05:17 +00:00
if (null == channel) {
2026-07-29 08:29:29 +00:00
let c22 = false;
let OPEN = FormStates.CLOSED;
let c3 = null;
channel = null;
let store = null;
let channel2 = null;
let closure_20 = {};
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
OPEN = FormStates.OPEN;
store = channel;
2026-07-20 16:05:17 +00:00
let _location = null;
if ("location" in channelId) {
_location = null;
if (null != channelId.location) {
_location = channelId.location;
}
}
let subsection = null;
if ("subsection" in channelId) {
subsection = channelId.subsection;
}
2026-07-29 08:29:29 +00:00
let closure_4 = subsection;
if (null != store) {
store = store.set("nsfw", store.isNSFW());
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
channel2 = obj.getChannel(store.parent_id);
const guildId = store.getGuildId();
if (store.isModeratorReportChannel()) {
let OVERVIEW = tmp10.PERMISSIONS;
let tmp11 = tmp10;
} else {
OVERVIEW = tmp10.OVERVIEW;
tmp11 = tmp10;
}
let closure_19 = {};
let tmp12 = c3;
if (c3 == null) {
tmp12 = OVERVIEW;
}
c3 = tmp12;
let tmp15 = null != store;
if (tmp15) {
tmp15 = c3 === tmp11.INSTANT_INVITES;
}
if (tmp15) {
let c21 = true;
const HTTP = require(530) /* sendRequest */.HTTP;
obj = { url: null, oldFormErrors: true, rejectWithError: true };
obj[0] = closure_15.INSTANT_INVITES(store.id);
const value = HTTP.get(obj);
value.then((body) => {
let c21 = false;
let obj = callback(table[11]);
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
obj.dispatch(obj);
}, () => {
let c21 = false;
return false;
});
2026-07-20 16:05:17 +00:00
}
return true;
}
},
CHANNEL_SETTINGS_SUBMIT: function handleSettingsSubmit() {
2026-07-23 10:11:24 +00:00
const SUBMITTING = FormStates.SUBMITTING;
2026-07-29 08:29:29 +00:00
let closure_19 = {};
2026-07-20 16:05:17 +00:00
},
CHANNEL_SETTINGS_SUBMIT_SUCCESS: function handleSettingsSubmitSuccess() {
2026-07-29 08:29:29 +00:00
let closure_5 = closure_6;
2026-07-23 10:11:24 +00:00
const OPEN = FormStates.OPEN;
2026-07-20 16:05:17 +00:00
},
CHANNEL_SETTINGS_SUBMIT_FAILURE: function handleSettingsSubmitFailure(errors) {
2026-07-23 10:11:24 +00:00
let closure_0 = errors;
const OPEN = FormStates.OPEN;
2026-07-20 16:05:17 +00:00
errors = errors.errors;
2026-07-29 08:29:29 +00:00
if (errors == null) {
2026-07-20 16:05:17 +00:00
errors = {};
}
const keys = Object.keys(errors);
2026-07-29 08:29:29 +00:00
let closure_19 = keys.reduce((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
if (obj2.isArray(errors.errors[arg1])) {
2026-07-20 16:05:17 +00:00
arg0[arg1] = obj.join("\n");
} else {
arg0[arg1] = obj;
}
return arg0;
}, {});
},
2026-07-29 08:29:29 +00:00
CHANNEL_SETTINGS_CLOSE: function handleSettingsClose() {
let c22 = false;
const CLOSED = FormStates.CLOSED;
let c3 = null;
let c5 = null;
let c6 = null;
let c7 = null;
let closure_20 = {};
},
2026-07-20 16:05:17 +00:00
CHANNEL_PERMISSIONS_PUT_OVERWRITE_SUCCESS: handleOverwriteUpdate,
CHANNEL_PERMISSIONS_DELETE_OVERWRITE_SUCCESS: handleOverwriteUpdate,
CHANNEL_SETTINGS_OVERWRITE_SELECT: function handlePermissionOverwriteSelect(overwriteId) {
overwriteId = overwriteId.overwriteId;
},
CHANNEL_SETTINGS_UPDATE: function handleSettingsUpdate(arg0) {
let autoArchiveDuration;
let availableTags;
let bitrate;
let channelType;
let defaultAutoArchiveDuration;
let defaultForumLayout;
let defaultReactionEmoji;
let defaultSortOrder;
let defaultTagSetting;
let defaultThreadRateLimitPerUser;
let flags;
let iconEmoji;
let invitable;
let locked;
let name;
let nsfw;
let rateLimitPerUser;
let rtcRegion;
let template;
let themeColor;
let topic;
let userLimit;
let videoQualityMode;
({ name, channelType, topic, bitrate, userLimit, nsfw, flags, rateLimitPerUser, defaultThreadRateLimitPerUser, autoArchiveDuration, locked, invitable, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor } = arg0);
2026-07-29 08:29:29 +00:00
if (null == store) {
2026-07-20 16:05:17 +00:00
return false;
} else {
if (null != name) {
2026-07-29 08:29:29 +00:00
store = store.set("name", name);
2026-07-20 16:05:17 +00:00
}
if (null != topic) {
2026-07-29 08:29:29 +00:00
store = store.set("topic", topic);
2026-07-20 16:05:17 +00:00
}
if (null != bitrate) {
2026-07-29 08:29:29 +00:00
store = store.set("bitrate", bitrate);
2026-07-20 16:05:17 +00:00
}
if (null != userLimit) {
2026-07-29 08:29:29 +00:00
store = store.set("userLimit", userLimit);
2026-07-20 16:05:17 +00:00
}
if (null != nsfw) {
2026-07-29 08:29:29 +00:00
store = store.set("nsfw", nsfw);
2026-07-20 16:05:17 +00:00
}
if (null != flags) {
2026-07-29 08:29:29 +00:00
store = store.set("flags", flags);
2026-07-20 16:05:17 +00:00
}
if (null != rateLimitPerUser) {
2026-07-29 08:29:29 +00:00
store = store.set("rateLimitPerUser", rateLimitPerUser);
2026-07-20 16:05:17 +00:00
}
if (null != defaultThreadRateLimitPerUser) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultThreadRateLimitPerUser", defaultThreadRateLimitPerUser);
2026-07-20 16:05:17 +00:00
}
if (null != autoArchiveDuration) {
let obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(store.threadMetadata);
obj.autoArchiveDuration = autoArchiveDuration;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != locked) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(store.threadMetadata);
obj.locked = locked;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != invitable) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged2 = Object.assign(store.threadMetadata);
obj.invitable = invitable;
store = store.set("threadMetadata", obj);
2026-07-20 16:05:17 +00:00
}
if (null != defaultAutoArchiveDuration) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultAutoArchiveDuration", defaultAutoArchiveDuration);
2026-07-20 16:05:17 +00:00
}
if (null != template) {
2026-07-29 08:29:29 +00:00
store = store.set("template", template);
2026-07-20 16:05:17 +00:00
}
if (null != channelType) {
2026-07-29 08:29:29 +00:00
store = store.set("type", channelType);
2026-07-20 16:05:17 +00:00
}
if (undefined !== rtcRegion) {
2026-07-29 08:29:29 +00:00
store = store.set("rtcRegion", rtcRegion);
2026-07-20 16:05:17 +00:00
}
if (null != videoQualityMode) {
2026-07-29 08:29:29 +00:00
store = store.set("videoQualityMode", videoQualityMode);
2026-07-20 16:05:17 +00:00
}
if (undefined !== defaultReactionEmoji) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultReactionEmoji", defaultReactionEmoji);
2026-07-20 16:05:17 +00:00
}
if (null != availableTags) {
2026-07-29 08:29:29 +00:00
store = store.set("availableTags", availableTags);
2026-07-20 16:05:17 +00:00
}
if (null != defaultSortOrder) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultSortOrder", defaultSortOrder);
2026-07-20 16:05:17 +00:00
}
if (null != defaultTagSetting) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultTagSetting", defaultTagSetting);
2026-07-20 16:05:17 +00:00
}
if (null != defaultForumLayout) {
2026-07-29 08:29:29 +00:00
store = store.set("defaultForumLayout", defaultForumLayout);
2026-07-20 16:05:17 +00:00
}
if (undefined !== iconEmoji) {
2026-07-29 08:29:29 +00:00
store = store.set("iconEmoji", iconEmoji);
2026-07-20 16:05:17 +00:00
}
if (null != themeColor) {
2026-07-29 08:29:29 +00:00
store = store.set("themeColor", themeColor);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback2();
}
},
CHANNEL_SETTINGS_SET_SECTION: function handleSetSection(arg0) {
let closure_3;
let closure_4;
({ section: closure_3, subsection: closure_4 } = arg0);
let tmp = null != store;
if (tmp) {
tmp = closure_3 === constants.INSTANT_INVITES;
}
if (tmp) {
let c21 = true;
const HTTP = require(530) /* sendRequest */.HTTP;
const obj = { url: null, oldFormErrors: true, rejectWithError: true };
obj[0] = closure_15.INSTANT_INVITES(store.id);
const value = HTTP.get(obj);
value.then((body) => {
let c21 = false;
let obj = callback(table[11]);
obj = { type: "CHANNEL_SETTINGS_LOADED_INVITES", invites: body.body };
obj.dispatch(obj);
}, () => {
let c21 = false;
return false;
});
2026-07-20 16:05:17 +00:00
}
},
CHANNEL_SETTINGS_LOADED_INVITES: function handleLoadedInvites(invites) {
2026-07-29 08:29:29 +00:00
let closure_20 = {};
2026-07-20 16:05:17 +00:00
invites = invites.invites;
const item = invites.forEach((code) => {
2026-07-29 08:29:29 +00:00
closure_20[code.code] = callback(code);
2026-07-20 16:05:17 +00:00
});
},
2026-07-29 08:29:29 +00:00
CHANNEL_UPDATES: function handleChannelUpdates(channels) {
channels = channels.channels;
if (null == closure_6) {
2026-07-20 16:05:17 +00:00
return false;
} else {
let flag = false;
2026-07-29 08:29:29 +00:00
const tmp2 = channels[Symbol.iterator]();
while (tmp2 !== undefined) {
let tmp6 = _syncChannelUpdate;
let tmp7 = _syncChannelUpdate(tmp4.id) || flag;
flag = tmp7;
continue;
}
return flag;
2026-07-20 16:05:17 +00:00
}
},
THREAD_UPDATE: function handleThreadUpdate(arg0) {
2026-07-29 08:29:29 +00:00
let tmp2 = null != closure_6;
2026-07-20 16:05:17 +00:00
if (tmp2) {
tmp2 = _syncChannelUpdate(tmp.id);
}
return tmp2;
},
CHANNEL_DELETE: function handleChannelDelete(arg0) {
2026-07-29 08:29:29 +00:00
let tmp2 = null != store;
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-07-29 08:29:29 +00:00
if (store.id === tmp) {
2026-07-20 16:05:17 +00:00
const CLOSED = FormStates.CLOSED;
}
tmp2 = tmp4;
}
return tmp2;
},
INSTANT_INVITE_REVOKE_SUCCESS: function handleInviteRevoke(arg0) {
2026-07-23 10:11:24 +00:00
const obj = {};
const merged = Object.assign(obj);
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
},
INSTANT_INVITE_CREATE_SUCCESS: function handleInviteCreateSuccess(invite) {
const obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(obj);
2026-07-20 16:05:17 +00:00
obj[invite.invite.code] = _createInvite(invite.invite);
}
};
2026-07-29 08:29:29 +00:00
let result = require("createdAt").fileFinishedImporting("stores/ChannelSettingsStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelSettingsStore;