Files
2026-07-28 01:06:53 +03:00

174 lines
8.4 KiB
TypeScript

/* Metro module 1422; source: records/GuildRecord.tsx; dependencies: [1419, 661, 1423, 1861, 21, 1865, 2] */
import SnowflakeUtils from '../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PlainRecordModule from '../lib/PlainRecord.tsx'; /* Metro dependency 1419 */
import * as StringUtilsModule from '../utils/StringUtils.tsx'; /* Metro dependency 1861 */
function _fun16591(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:6, offset: 0x00e54685, size: 660 bytes, params: 8, frame: 28
const env0_0 = require;
const closure = function(a0, a1) {
var value = a1;
return a0.ownerId === (typeof value === 'string' ? value : value != null ? value.id : null);
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = PlainRecordModule;
let set = value.set;
value.TypeTag;
value = require(661) /* metro dependency 661: Constants */;
const BoostedGuildTiers = value.BoostedGuildTiers;
const GuildExplicitContentFilterTypes = value.GuildExplicitContentFilterTypes;
const GuildNSFWContentLevel = value.GuildNSFWContentLevel;
const MFALevels = value.MFALevels;
const UserNotificationSettings = value.UserNotificationSettings;
const VerificationLevels = value.VerificationLevels;
let Set = global.Set;
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
set = new Set([EXPLICIT, AGE_RESTRICTED]);
Object = global.Object;
const freeze = Object.freeze;
object = {'mfaLevel': null, 'preferredLocale': 'en-US', 'afkTimeout': 0};
let NONE = MFALevels.NONE;
object.mfaLevel = NONE;
const ALL_MESSAGES = UserNotificationSettings.ALL_MESSAGES;
object.defaultMessageNotifications = ALL_MESSAGES;
NONE = VerificationLevels.NONE;
object.verificationLevel = NONE;
const DISABLED = GuildExplicitContentFilterTypes.DISABLED;
object.explicitContentFilter = DISABLED;
object.premiumProgressBarEnabled = false;
object.premiumProgressBarEnabledUserUpdatedAt = null;
object.systemChannelFlags = 0;
object.maxStageVideoChannelUsers = -1;
object.maxVideoChannelUsers = -1;
object.maxMembers = -1;
NONE = BoostedGuildTiers.NONE;
object.premiumTier = NONE;
const DEFAULT = GuildNSFWContentLevel.DEFAULT;
object.nsfwLevel = DEFAULT;
object.premiumSubscriberCount = 0;
Set = global.Set;
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set();
object.features = set instanceof Object ? set : value2;
object.description = null;
object.icon = null;
object.ownerId = null;
object.systemChannelId = null;
object.joinedAt = null;
object.discoverySplash = null;
object.splash = null;
object.banner = null;
object.homeHeader = null;
object.afkChannelId = null;
object.application_id = null;
object.vanityURLCode = null;
object.rulesChannelId = null;
object.safetyAlertsChannelId = null;
object.publicUpdatesChannelId = null;
object.ownerConfiguredContentLevel = null;
object.hubType = null;
object.latestOnboardingQuestionId = null;
object.profile = null;
object.guildTheme = null;
object.premiumFeatures = null;
object.moderatorReporting = null;
object.verificationRoleId = null;
object.gameApplicationIds = null;
object.officialMessageColor = null;
const value4 = Reflect.apply(freeze, Object, [object]);
(FileImportTrackerModule).fileFinishedImporting('records/GuildRecord.tsx');
exports.GuildRecordTypeTag = 'Guild';
exports.RESTRICTED_CONTENT_LEVELS = set;
exports.GUILD_DEFAULT_PROPERTY_VALUES = value4;
exports.getGuildIconURL = getGuildIconURL;
exports.getGuildIconSource = getGuildIconSource;
exports.getGuildAcronym = getGuildAcronym;
exports.isGuildOwner = closure;
exports.isGuildOwnerWithRequiredMfaLevel = isGuildOwnerWithRequiredMfaLevel;
exports.isGuildLurker = function(a0) {
return a0.joinedAt == null;
};
exports.getGuildEveryoneRoleId = getGuildEveryoneRoleId;
exports.updateJoinedAt = function(a0, a1) {
var r3;
var value = a1;
var setBinding = set;
if (typeof value !== 'string') {
r3 = value;
} else {
value = new global.Date(value);
r3 = value;
}
return setBinding(a0, 'joinedAt', r3);
};
exports.updateGameApplications = function(a0, a1) {
return set(a0, 'gameApplicationIds', a1);
};
exports.isGuildNSFW = isGuildNSFW;
function getGuildIconURL({id, icon}, a1) { // fn#16593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:1497, offset: 0x00e5494a, size: 96 bytes, params: 3, frame: 15
const value = a2;
const value2 = a3;
return (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: id, size: a1, icon: icon,
canAnimate: value !== undefined ? value : false, lossless: value2 !== undefined ? value2 : false});
}
function getGuildIconSource(a0, a1) { // fn#16594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:1644, offset: 0x00e549aa, size: 69 bytes, params: 3, frame: 15
const value = a2;
const env0_0 = a0;
const env0_1 = a1;
return (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getAnimatableSourceWithFallback(value !== undefined ? value : false,
_fun16595);
function _fun16595(a0) { // fn#16595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:1732, offset: 0x00e549ef, size: 81 bytes, params: 2, frame: 14
let value = environment.__proto__;
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
const getGuildIconSource = value.getGuildIconSource;
const binding = env0_0;
return Reflect.apply(getGuildIconSource, value, [{id: binding.id, size: require, icon: binding.icon,
canAnimate: a0}]);
}
}
function getGuildAcronym({name}) { // fn#16596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:1826, offset: 0x00e54a40, size: 46 bytes, params: 2, frame: 11
return (StringUtilsModule).getAcronym(name);
}
function isGuildOwnerWithRequiredMfaLevel(a0, a1) { // fn#16597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:1952, offset: 0x00e54a6e, size: 64 bytes, params: 3, frame: 14
return !(!a1.mfaEnabled && a0.mfaLevel === MFALevels.ELEVATED) && isGuildOwner(a0, a1);
}
function getGuildEveryoneRoleId({id}) { // fn#16599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:2159, offset: 0x00e54abf, size: 46 bytes, params: 2, frame: 11
return (SnowflakeUtils).castGuildIdAsEveryoneGuildRoleId(id);
}
function isGuildNSFW(a0) { // fn#16602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1549:2464, offset: 0x00e54b52, size: 109 bytes, params: 2, frame: 15
var r1;
var r0;
var isServerNSFWLevelEnabled2;
var binding;
var has;
const value = a0 != null;
if (value) {
isServerNSFWLevelEnabled2 = (require(1865) /* metro dependency 1865: ServerNSFWLevelExperiment */).isServerNSFWLevelEnabled('guild_record');
binding = env0_6;
has = binding.has;
if (isServerNSFWLevelEnabled2) {
r1 = Reflect.apply(has, binding, [a0.nsfwLevel]);
} else {
r1 = a0.ownerConfiguredContentLevel ?? GuildNSFWContentLevel.DEFAULT;
r1 = Reflect.apply(has, binding, [r1]);
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
}
global.__d(_fun16591, 1422, [1419, 661, 1423, 1861, 21, 1865,
2]) /* metro module 1422, dependencies: [1419, 661, 1423, 1861, 21, 1865, 2] */;