/* Metro module 8364; source: modules/interaction_components/native/NativeSearchableSelectActionComponentUtils.tsx; dependencies: [1379, 1938, 1867, 1878, 661, 4633, 1360, 1426, 6794, 8365, 673, 697, 8366, 6647, 2] */ function _fun66601(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8549:6, offset: 0x01c02405, size: 215 bytes, params: 8, frame: 20 let env0_0 = require; const closure = getChannelIconData; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_7 = constantsModule.ChannelTypes; const env0_8 = constantsModule.DEFAULT_ROLE_COLOR; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/interaction_components/native/NativeSearchableSelectActionComponentUtils.tsx'); exports.transformSearchableSelectOptions = function(a0, a1) { var env0_0 = a1; var env0_1 = GuildStore.getGuild(a1); return a0.map(_fun66604).filter(require(dependencyMap[6]).isNotNullish); }; exports.getChannelIconData = closure; } function getChannelIconData(a0, a1) { // fn#66602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8549:186, offset: 0x01c024dc, size: 88 bytes, params: 3, frame: 14 var r0; const type = a0.type; var value; const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY; if (type === GUILD_CATEGORY) { r0 = importDefault(8366) /* metro dependency 8366 */; } else { value = require(6647) /* metro dependency 6647: ChannelUtils */; value = value.getChannelIconWithGuild(a0, a1); r0 = value; } return r0; } function transformSearchableSelectOptions(a0, a1) { // fn#66603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8549:453, offset: 0x01c02534, size: 91 bytes, params: 3, frame: 14 const env0_0 = a1; const env0_1 = GuildStore.getGuild(a1); const value2 = a0.map(_fun66604); return value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish); } function _fun66604(a0) { // fn#66604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8549:534, offset: 0x01c0258f, size: 835 bytes, params: 2, frame: 23 var r0; var r6; var r1; var r8; var binding; var value5; var object2; var value7; var moduleValue; var customIconSrc; var unicodeEmoji; var value13; let value = a0; const type = value.type; const SelectOptionType = (require(4633) /* metro dependency 4633: InteractionComponentTypes */).SelectOptionType; const USER = SelectOptionType.USER; if (USER === type) { value13 = UserStore.getUser(value.value); if (value13 == null) { r0 = value; } else { object2 = {}; copyDataProperties(object2, value, undefined); value = require(1426) /* metro dependency 1426: AvatarUtils */; object2['iconSrc'] = value.ensureAvatarSource(value13.getAvatarSource(require, false)).uri; r0 = object2; } return r0; } const ROLE = SelectOptionType.ROLE; if (ROLE === type) { binding = env0_1; value7 = null; r6 = value7 != binding ? GuildRoleStore.getRole(binding.id, value.value) : value7; if (value7 == r6) { r0 = value; } else if (value7 == binding) { r0 = value; } else { moduleValue = require(6794) /* metro dependency 6794: RoleIconUtils */; r1 = moduleValue.canGuildUseRoleIcons(binding, r6) ? (require(6794) /* metro dependency 6794: RoleIconUtils */).getRoleIconData(r6) : value7; if (value7 == r1) { object2 = {}; copyDataProperties(object2, value, undefined); value = require(1426) /* metro dependency 1426: AvatarUtils */; object2['iconSrc'] = value.ensureAvatarSource(importDefault(8365) /* metro dependency 8365 */).uri; if (value7 != r6.colorString) { value = require(673) /* metro dependency 673: ColorUtils */; value = value.hex2int(r6.colorString); r8 = value; } else { r8 = DEFAULT_ROLE_COLOR; } object2['iconColor'] = 4278190080 | r8; r0 = object2; } else { customIconSrc = r1.customIconSrc; unicodeEmoji = r1.unicodeEmoji; if (value7 != unicodeEmoji) { object2 = {}; copyDataProperties(object2, value, undefined); object2['iconEmoji'] = {id: unicodeEmoji.id, name: unicodeEmoji.name, animated: unicodeEmoji.animated, src: unicodeEmoji.url, surrogates: unicodeEmoji.surrogates}; r0 = object2; } else if (value7 != customIconSrc) { object2 = {}; copyDataProperties(object2, value, undefined); object2['iconSrc'] = customIconSrc; r0 = object2; } else { object2 = {}; copyDataProperties(object2, value, undefined); value = require(1426) /* metro dependency 1426: AvatarUtils */; object2['iconSrc'] = value.ensureAvatarSource(importDefault(8365) /* metro dependency 8365 */).uri; if (value7 != r6.colorString) { value = require(673) /* metro dependency 673: ColorUtils */; value = value.hex2int(r6.colorString); r8 = value; } else { r8 = DEFAULT_ROLE_COLOR; } object2['iconColor'] = 4278190080 | r8; r0 = object2; } } } return r0; } const CHANNEL = SelectOptionType.CHANNEL; if (CHANNEL === type) { binding = env0_1; value5 = ChannelStore.getChannel(value.value); if (value5 == null) { r0 = value; } else { object2 = {}; copyDataProperties(object2, value, undefined); value = require(1426) /* metro dependency 1426: AvatarUtils */; object2['iconSrc'] = value.ensureAvatarSource(getChannelIconData(value5, binding)).uri; value = require(673) /* metro dependency 673: ColorUtils */; value = value.hex2int((importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_330); object2['iconColor'] = 4278190080 | value; r0 = object2; } return r0; } return null; }