decord/source/utils/ChannelSortingUtils.tsx

894 lines
29 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15472
// Function ID: 15473
2026-07-29 08:29:29 +00:00
// Name: getFirstChannelOfType
2026-08-24 06:08:38 +00:00
// Dependencies: [1395, 676, 11637, 5284, 2]
2026-07-29 08:29:29 +00:00
// Exports: areTypesInSameSection, getDnDUpdates, getDropData
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 15472 (getFirstChannelOfType)
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
import getFlattenedChannelListDefault from "getFlattenedChannelList" /* 5284 */;
import createChannelRecord from "createChannelRecord" /* 1395 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
function getFirstChannelOfType(arg0, arg1, arg2, arr) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
c1 = -1;
2026-07-20 16:05:17 +00:00
const found = arr.find((channel) => {
2026-07-23 10:11:24 +00:00
let flag = channel.channel.id === closure_0;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
});
2026-07-23 10:11:24 +00:00
if (c1 < 0) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-07-29 08:29:29 +00:00
let tmp12 = c1;
2026-07-23 10:11:24 +00:00
if (c1 >= 0) {
2026-07-29 08:29:29 +00:00
if (tmp12 < arr.length) {
while (true) {
let type = arr[tmp12].channel.type;
let tmp4 = null != type;
let tmp5 = tmp12;
if (tmp4) {
tmp4 = null != arg2;
}
if (tmp4) {
let tmp6 = type === arg2;
if (!tmp6) {
let tmp7 = callback;
let tmp8 = callback(type) && tmp7(arg2);
tmp6 = tmp8;
}
if (!tmp6) {
let tmp9 = callback2;
let tmp10 = callback2(type) && tmp9(arg2);
tmp6 = tmp10;
}
tmp4 = tmp6;
}
if (tmp4) {
break;
} else {
let sum = tmp12 + arg0;
if (sum >= 0) {
tmp12 = sum;
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
}
}
return null;
}
}
2026-07-29 08:29:29 +00:00
({ isGuildSelectableChannelType: obj1, isGuildVocalChannelType: c3 } = createChannelRecord);
2026-08-24 06:08:38 +00:00
let ChannelTypes = ME.ChannelTypes;
const result = set.fileFinishedImporting("utils/ChannelSortingUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const areTypesInSameSection = function areTypesInSameSection(arg0, arg1) {
let tmp = null != arg0 && null != arg1;
if (tmp) {
let tmp2 = arg0 === arg1;
if (!tmp2) {
tmp2 = callback(arg0) && callback(arg1);
const tmp3 = callback;
const tmp4 = callback(arg0) && callback(arg1);
}
if (!tmp2) {
tmp2 = callback2(arg0) && callback2(arg1);
const tmp5 = callback2;
const tmp6 = callback2(arg0) && callback2(arg1);
}
tmp = tmp2;
}
return tmp;
};
2026-07-20 16:05:17 +00:00
export const getDropData = function getDropData(localChannel, arg1, localChannel2, index, channelList) {
if (null != localChannel) {
2026-07-29 08:29:29 +00:00
parent_id3 = localChannel2;
2026-07-20 16:05:17 +00:00
if (null != localChannel2) {
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (localChannel.type === GUILD_CATEGORY) {
if (index !== arg1) {
if (index >= arg1) {
2026-07-29 08:29:29 +00:00
let tmp47 = null;
2026-07-20 16:05:17 +00:00
if (index > arg1) {
2026-08-24 06:08:38 +00:00
c1 = true;
2026-07-29 08:29:29 +00:00
let callback;
let num17 = 0;
if (null != parent_id3) {
callback = null;
const found = channelList.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found1 = found.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num17 = callback;
}
if (num17 == null) {
num17 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp52 = getFirstChannelOfType(-1, parent_id3.id, localChannel.type, channelList);
let tmp53 = null;
if (null != tmp52) {
tmp53 = null;
if (tmp52.channel.id !== localChannel.id) {
if (null == tmp49) {
let obj = { referenceId: null, parentId: null };
obj[0] = tmp52.channel.id;
let tmp54 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp54 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp53 = tmp54;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp47 = tmp53;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
obj = { referenceId: null, parentId: null };
({ id: obj13[0], parent_id: parent_id3 } = parent_id3);
obj[1] = parent_id3;
tmp47 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const type3 = localChannel.type;
const type4 = parent_id3.type;
let tmp = null != type3 && null != type4;
if (tmp) {
let tmp2 = type3 === type4;
if (!tmp2) {
tmp2 = callback(type3) && callback(type4);
const tmp3 = callback;
const tmp4 = callback(type3) && callback(type4);
}
if (!tmp2) {
tmp2 = callback2(type3) && callback2(type4);
const tmp5 = callback2;
const tmp6 = callback2(type3) && callback2(type4);
}
tmp = tmp2;
}
if (tmp) {
({ id: obj11[0], parent_id: obj11[1] } = parent_id3);
let tmp12 = { referenceId: null, parentId: null };
2026-08-24 06:08:38 +00:00
obj1 = { referenceId: null, parentId: null };
2026-07-20 16:05:17 +00:00
} else if (index < arg1) {
2026-07-29 08:29:29 +00:00
if (parent_id3.type !== GUILD_CATEGORY) {
c1 = true;
let num9 = 0;
if (null != parent_id3) {
callback = null;
const found2 = channelList.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found3 = found2.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num9 = callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num9 == null) {
num9 = 0;
}
const tmp30 = getFirstChannelOfType(1, parent_id3.id, localChannel.type, channelList);
if (null == channelList[num9 - 1]) {
2026-07-20 16:05:17 +00:00
if (!localChannel.isGuildVocal()) {
let id = null;
2026-07-29 08:29:29 +00:00
if (null != tmp30) {
id = tmp30.channel.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj2 = { referenceId: null, parentId: null };
obj2[0] = id;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp33 = null;
2026-07-20 16:05:17 +00:00
if (callback(localChannel.type)) {
2026-07-29 08:29:29 +00:00
tmp33 = null;
if (null != tmp30) {
if (tmp32(tmp27.channel.type)) {
const obj3 = { referenceId: null, parentId: null };
obj3[0] = tmp30.channel.id;
obj3[1] = parent_id3.parent_id;
tmp33 = obj3;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const channel5 = tmp27.channel;
tmp33 = null;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
obj2 = tmp33;
tmp32 = callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c1 = true;
let num13 = 0;
if (null != parent_id3) {
callback = null;
const found4 = channelList.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found5 = found4.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num13 = callback;
}
if (num13 == null) {
num13 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let parent_id2 = channelList[num13 - 1];
let id2 = getFirstChannelOfType(1, parent_id3.id, localChannel.type, channelList);
2026-07-20 16:05:17 +00:00
if (null == parent_id2) {
2026-07-29 08:29:29 +00:00
let obj4 = { referenceId: null, parentId: null };
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj4 = null;
2026-07-20 16:05:17 +00:00
if (null != id2) {
2026-07-29 08:29:29 +00:00
const type = parent_id2.channel.type;
const type2 = localChannel.type;
let tmp37 = null != type && null != type2;
if (tmp37) {
let tmp38 = type === type2;
if (!tmp38) {
tmp38 = callback(type) && callback(type2);
const tmp39 = callback;
const tmp40 = callback(type) && callback(type2);
}
if (!tmp38) {
tmp38 = callback2(type) && callback2(type2);
const tmp41 = callback2;
const tmp42 = callback2(type) && callback2(type2);
}
tmp37 = tmp38;
}
if (!tmp37) {
2026-07-20 16:05:17 +00:00
if (!localChannel.isGuildVocal()) {
const channel6 = parent_id2.channel;
2026-07-29 08:29:29 +00:00
obj4 = null;
2026-07-20 16:05:17 +00:00
if (channel6.isCategory()) {
2026-07-29 08:29:29 +00:00
const obj5 = { referenceId: null, parentId: null };
obj5[0] = id2.channel.id;
obj5[1] = parent_id2.channel.id;
obj4 = obj5;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
const obj6 = { referenceId: null, parentId: null };
2026-07-20 16:05:17 +00:00
id2 = id2.channel.id;
2026-07-29 08:29:29 +00:00
obj6[0] = id2;
2026-07-20 16:05:17 +00:00
parent_id2 = parent_id2.channel.parent_id;
2026-07-29 08:29:29 +00:00
obj6[1] = parent_id2;
obj4 = obj6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if (parent_id3.type === GUILD_CATEGORY) {
c1 = true;
let num5 = 0;
if (null != parent_id3) {
callback = null;
const found6 = channelList.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found7 = found6.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num5 = callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num5 == null) {
num5 = 0;
}
let parent_id = channelList[num5 + 1];
id = getFirstChannelOfType(-1, parent_id3.id, localChannel.type, channelList);
let tmp17 = null;
2026-07-20 16:05:17 +00:00
if (null != id) {
if (null == parent_id) {
2026-07-29 08:29:29 +00:00
const obj7 = { referenceId: null, parentId: null };
obj7[0] = id.channel.id;
id = parent_id3.id;
obj7[1] = id;
tmp17 = obj7;
} else {
const type5 = parent_id.channel.type;
const type6 = localChannel.type;
let tmp18 = null != type5 && null != type6;
if (tmp18) {
let tmp19 = type5 === type6;
if (!tmp19) {
tmp19 = callback(type5) && callback(type6);
const tmp20 = callback;
const tmp21 = callback(type5) && callback(type6);
}
if (!tmp19) {
tmp19 = callback2(type5) && callback2(type6);
const tmp22 = callback2;
const tmp23 = callback2(type5) && callback2(type6);
}
tmp18 = tmp19;
}
if (!tmp18) {
if (!callback(localChannel.type)) {
const channel4 = parent_id.channel;
tmp17 = null;
if (channel4.isCategory()) {
const obj8 = { referenceId: null, parentId: null };
obj8[0] = id.channel.id;
obj8[1] = parent_id3.id;
tmp17 = obj8;
}
} else {
const channel3 = parent_id.channel;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
const obj9 = { referenceId: null, parentId: null };
obj9[0] = id.channel.id;
2026-07-20 16:05:17 +00:00
parent_id = parent_id.channel.parent_id;
2026-07-29 08:29:29 +00:00
obj9[1] = parent_id;
tmp17 = obj9;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
c1 = true;
2026-07-20 16:05:17 +00:00
let num = 0;
2026-07-29 08:29:29 +00:00
if (null != parent_id3) {
callback = null;
const found8 = channelList.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found9 = found8.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num = callback;
}
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp11 = getFirstChannelOfType(-1, parent_id3.id, localChannel.type, channelList);
tmp12 = null;
if (null != tmp11) {
2026-07-20 16:05:17 +00:00
if (!localChannel.isGuildVocal()) {
2026-07-29 08:29:29 +00:00
let tmp13 = null;
2026-07-20 16:05:17 +00:00
if (localChannel.isCategory()) {
2026-07-29 08:29:29 +00:00
if (null == tmp8) {
obj = { referenceId: null, parentId: null };
obj[0] = tmp11.channel.id;
tmp13 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const channel2 = tmp8.channel;
tmp13 = null;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp12 = tmp13;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (null != tmp8) {
const channel7 = tmp8.channel;
2026-07-20 16:05:17 +00:00
if (!channel7.isCategory()) {
2026-07-29 08:29:29 +00:00
const channel = tmp8.channel;
2026-07-20 16:05:17 +00:00
if (channel.isGuildVocal()) {
2026-07-29 08:29:29 +00:00
const obj10 = { referenceId: null, parentId: null };
obj10[0] = tmp11.channel.id;
obj10[1] = tmp8.channel.parent_id;
tmp12 = obj10;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
const obj11 = { referenceId: null, parentId: null };
obj11[0] = tmp11.channel.id;
obj11[1] = parent_id3.parent_id;
tmp12 = obj11;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
return tmp12;
2026-07-20 16:05:17 +00:00
}
}
}
return null;
};
export const getDnDUpdates = function getDnDUpdates(localChannel, localChannel2, parentId, channels) {
2026-08-24 06:08:38 +00:00
importDefault = localChannel;
dependencyMap = parentId;
2026-07-20 16:05:17 +00:00
function generateUpdates(substr) {
2026-07-29 08:29:29 +00:00
if (null != c2) {
if (null != num11) {
let tmp4 = null != tmp;
if (tmp4) {
tmp4 = null != tmp2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
tmp4 = null != substr[tmp];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
tmp4 = substr[tmp].channel === localChannel2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
tmp4 = null != substr[tmp2];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
2026-08-24 06:08:38 +00:00
let obj = localChannel2(11637);
2026-07-29 08:29:29 +00:00
let moveItemFromToResult = obj.moveItemFromTo(substr, tmp, tmp2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { oldOrdering: null, newOrdering: null, idGetter: null, existingPositionGetter: null };
obj[0] = substr;
obj[1] = moveItemFromToResult;
obj[2] = function idGetter(channel) {
return channel.channel.id;
};
obj[3] = function existingPositionGetter(channel) {
return channel.channel.position;
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
closure_4 = closure_4.concat(localChannel2(11637).calculatePositionDeltas(obj));
2026-07-20 16:05:17 +00:00
return moveItemFromToResult;
}
}
moveItemFromToResult = [...substr];
}
2026-08-24 06:08:38 +00:00
ChannelTypes = [];
2026-07-20 16:05:17 +00:00
let items = [];
let _categories = channels._categories;
if (localChannel.isCategory()) {
const items1 = [];
HermesBuiltin.arraySpread(_categories, 0);
const substr = items1.slice(1);
2026-07-29 08:29:29 +00:00
importDefault = localChannel;
dependencyMap = false;
let callback;
let num4 = 0;
if (null != localChannel) {
callback = null;
const found = substr.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found1 = found.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num4 = callback;
}
callback = num4;
importDefault = localChannel2;
dependencyMap = false;
callback = undefined;
let num5 = 0;
if (null != localChannel2) {
callback = null;
const found2 = substr.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found3 = found2.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num5 = callback;
}
let num11 = num5;
2026-07-20 16:05:17 +00:00
const updates = generateUpdates(substr);
2026-07-23 10:11:24 +00:00
updates.unshift(_categories[0]);
2026-07-20 16:05:17 +00:00
items = updates;
}
if (callback(localChannel.type)) {
2026-07-29 08:29:29 +00:00
let tmp11 = _categories;
2026-07-20 16:05:17 +00:00
if (items.length > 0) {
2026-07-29 08:29:29 +00:00
tmp11 = items;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp10Result = getFlattenedChannelListDefault(tmp11, channels, (channel) => _null(channel.channel.type));
2026-07-29 08:29:29 +00:00
importDefault = localChannel;
dependencyMap = false;
callback = undefined;
let num7 = 0;
if (null != localChannel) {
callback = null;
const found4 = tmp10Result.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found5 = found4.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num7 = callback;
}
callback = num7;
importDefault = localChannel2;
dependencyMap = false;
callback = undefined;
let num8 = 0;
if (null != localChannel2) {
callback = null;
const found6 = tmp10Result.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found7 = found6.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num8 = callback;
}
num11 = num8;
const updates1 = generateUpdates(tmp10Result);
2026-08-24 06:08:38 +00:00
const tmp10 = getFlattenedChannelListDefault;
2026-07-20 16:05:17 +00:00
}
if (localChannel.isGuildVocal()) {
if (items.length > 0) {
_categories = items;
}
2026-08-24 06:08:38 +00:00
const tmp18Result = getFlattenedChannelListDefault(_categories, channels, (channel) => {
2026-07-20 16:05:17 +00:00
channel = channel.channel;
return channel.isGuildVocal();
});
2026-07-29 08:29:29 +00:00
importDefault = localChannel;
dependencyMap = false;
callback = undefined;
let num10 = 0;
if (null != localChannel) {
callback = null;
const found8 = tmp18Result.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found9 = found8.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num10 = callback;
}
callback = num10;
importDefault = localChannel2;
dependencyMap = false;
callback = undefined;
num11 = 0;
if (null != localChannel2) {
callback = null;
const found10 = tmp18Result.filter((channel) => {
const type = channel.channel.type;
let tmp2 = null != closure_0;
if (tmp2) {
let tmp3 = c1;
if (!c1) {
const type2 = tmp.type;
let tmp4 = null != type2 && null != type;
if (tmp4) {
let tmp5 = type2 === type;
if (!tmp5) {
tmp5 = _null(type2) && _null(type);
const tmp6 = _null;
const tmp7 = _null(type2) && _null(type);
}
if (!tmp5) {
tmp5 = num11(type2) && num11(type);
const tmp8 = num11;
const tmp9 = num11(type2) && num11(type);
}
tmp4 = tmp5;
}
tmp3 = tmp4;
}
tmp2 = tmp3;
}
return tmp2;
});
const found11 = found10.find((arg0, arg1) => {
let flag = null != localChannel2 && tmp === localChannel2.id;
if (flag) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
2026-07-29 08:29:29 +00:00
flag = true;
}
return flag;
});
num11 = callback;
}
const updates2 = generateUpdates(tmp18Result);
2026-08-24 06:08:38 +00:00
const tmp18 = getFlattenedChannelListDefault;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp23 = localChannel.parent_id !== parentId;
if (tmp23) {
tmp23 = null == ChannelTypes.find((id) => {
let flag = id.id === localChannel2.id;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
id.parent_id = c1;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
});
}
2026-07-29 08:29:29 +00:00
if (tmp23) {
let obj = { id: null, parent_id: null };
obj[0] = localChannel.id;
obj[1] = parentId;
2026-07-23 10:11:24 +00:00
ChannelTypes.push(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return ChannelTypes;
2026-07-20 16:05:17 +00:00
};