Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,151 @@
/* Metro module 8906; source: modules/video_backgrounds/VideoBackgroundUtils.tsx; dependencies: [1379, 4294, 7617, 661, 1423, 4863, 683, 2] */
function _fun69474(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:6, offset: 0x01c746fe, size: 341 bytes, params: 8, frame: 24
const env0_0 = require;
const closure = isCustomBackgroundOption;
const closure2 = isDefaultBackgroundOption;
const closure3 = isAnimatedBackgroundOption;
const closure4 = function(a0) {
return a0 != null ? 'Video Background' : 'None';
};
const closure5 = getEffectDetailAnalyticsName;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const videoBackgroundConstantsModule = require(7617) /* metro dependency 7617: VideoBackgroundConstants */;
const env0_5 = videoBackgroundConstantsModule.DefaultVideoBackground;
const env0_6 = videoBackgroundConstantsModule.VideoFilterType;
const env0_7 = videoBackgroundConstantsModule.ANIMATED_DEFAULT_VIDEO_BACKGROUNDS;
const env0_8 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/video_backgrounds/VideoBackgroundUtils.tsx');
exports.isCustomBackgroundOption = closure;
exports.isDefaultBackgroundOption = closure2;
exports.isAnimatedBackgroundOption = closure3;
exports.getEffectAnalyticsType = closure4;
exports.getEffectDetailAnalyticsName = closure5;
exports.trackBackgroundOptionUpdated = trackBackgroundOptionUpdated;
exports.trackBackgroundOptionAdded = function(a0, a1, a2) {
var defaultImport = importDefault(dependencyMap[6]);
var VIDEO_BACKGROUND_ADDED = AnalyticEvents.VIDEO_BACKGROUND_ADDED;
var object = {};
object.is_animated = isAnimatedBackgroundOption(a0);
object.is_video = a1;
object.is_from_tenor = a2;
defaultImport.track(VIDEO_BACKGROUND_ADDED, object);
};
exports.trackBackgroundOptionDeleted = function(a0) {
var defaultImport = importDefault(dependencyMap[6]);
var VIDEO_BACKGROUND_DELETED = AnalyticEvents.VIDEO_BACKGROUND_DELETED;
var object = {};
object.is_animated = isAnimatedBackgroundOption(a0);
defaultImport.track(VIDEO_BACKGROUND_DELETED, object);
};
exports.getVideoBackgroundProtoFromOption = getVideoBackgroundProtoFromOption;
exports.getVideoBackgroundOptionFromProto = getVideoBackgroundOptionFromProto;
}
function isCustomBackgroundOption(a0) { // fn#69475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:237, offset: 0x01c74853, size: 61 bytes, params: 2, frame: 4
return a0 != null && typeof a0 === 'object' && 'id' in a0 && a0.type === VideoFilterType.BACKGROUND;
}
function isDefaultBackgroundOption(a0) { // fn#69476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:342, offset: 0x01c74890, size: 30 bytes, params: 2, frame: 3
return typeof a0 === 'number' && a0 in DefaultVideoBackground;
}
function isAnimatedBackgroundOption(a0) { // fn#69477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:413, offset: 0x01c748ae, size: 133 bytes, params: 2, frame: 16
var r2;
var r0;
var isCustomBackgroundOption2;
var moduleValue;
var isAnimatedIconHash2;
var value;
if (isDefaultBackgroundOption(a0)) {
r0 = ANIMATED_DEFAULT_VIDEO_BACKGROUNDS.includes(a0);
} else {
isCustomBackgroundOption2 = isCustomBackgroundOption(a0);
if (isCustomBackgroundOption2) {
moduleValue = require(1423) /* metro dependency 1423: AvatarUtils */;
isAnimatedIconHash2 = moduleValue.isAnimatedIconHash(a0.asset);
if (isAnimatedIconHash2) {
r2 = isAnimatedIconHash2;
} else {
value = require(1423) /* metro dependency 1423: AvatarUtils */;
value = value.isVideoAssetHash(a0.asset);
r2 = value;
}
r0 = r2;
} else {
r0 = !!isCustomBackgroundOption2;
}
}
return r0;
}
function getEffectDetailAnalyticsName(a0) { // fn#69479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:682, offset: 0x01c7494b, size: 260 bytes, params: 2, frame: 17
return a0 == null ? 'None' : isCustomBackgroundOption(a0) ? 'Custom' : a0 === 'blur' ? 'Blur' : 'Preset - ' + (DefaultVideoBackground.OPTION_1 === a0 ? 'Cybercity' : DefaultVideoBackground.OPTION_2 === a0 ? 'Discord the Movie' : DefaultVideoBackground.OPTION_3 === a0 ? 'Wumpus Vacation' : DefaultVideoBackground.OPTION_4 === a0 ? 'Vaporwave' : DefaultVideoBackground.OPTION_7 === a0 ? 'Capernite Day' : DefaultVideoBackground.OPTION_8 === a0 ? 'Capernite Night' : DefaultVideoBackground.OPTION_9 === a0 ? 'Hacker Den' : DefaultVideoBackground.OPTION_10 !== a0 ? undefined : 'Wumpice');
}
function trackBackgroundOptionUpdated(a0, a1, a2) { // fn#69480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:1556, offset: 0x01c74a4f, size: 270 bytes, params: 4, frame: 22
const guildId = RTCConnectionStore.getGuildId();
const channelId = RTCConnectionStore.getChannelId();
const channel = ChannelStore.getChannel(channelId);
const value5 = undefined;
const voiceStateMetadata = (require(4863) /* metro dependency 4863: AppAnalyticsUtils */).getVoiceStateMetadata(guildId,
channelId, true);
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const VIDEO_EFFECT_UPDATED = AnalyticEvents.VIDEO_EFFECT_UPDATED;
const object2 = {location: a1};
object2.effect_type = getEffectAnalyticsType(a0);
object2.effect_detail = getEffectDetailAnalyticsName(a0);
object2.effect_state = a2;
object2.channel_id = channelId;
object2.channel_type = channel == null ? value5 : channel.type;
object2.guild_id = guildId;
object2.voice_state_count = voiceStateMetadata.voice_state_count;
object2.video_stream_count = voiceStateMetadata.video_stream_count;
object2.media_session_id = RTCConnectionStore.getMediaSessionId();
object2.rtc_connection_id = RTCConnectionStore.getRTCConnectionId();
object2.is_animated = isAnimatedBackgroundOption(a0);
Reflect.apply(track, defaultImport, [VIDEO_EFFECT_UPDATED, object2]);
return value5;
}
function getVideoBackgroundProtoFromOption(a0) { // fn#69483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:2488, offset: 0x01c74bf7, size: 135 bytes, params: 2, frame: 13
return a0 == null ? {oneofKind: undefined} : isCustomBackgroundOption(a0) ? {oneofKind: 'customAsset',
customAsset: {id: a0.id, assetHash: a0.asset}} : a0 === 'blur' ? {oneofKind: 'blur',
blur: {useBlur: true}} : {oneofKind: 'presetOption', presetOption: a0};
}
function getVideoBackgroundOptionFromProto(a0, a1) { // fn#69484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9091:2789, offset: 0x01c74c7e, size: 152 bytes, params: 3, frame: 6
var object2;
var customAsset;
let value = null;
if (value == a0) {
return value;
}
let oneofKind = a0.oneofKind;
if (oneofKind === undefined) {
return value;
}
oneofKind = a0.oneofKind;
if (oneofKind === 'customAsset') {
object2 = {};
value = environment;
object2.type = VideoFilterType.BACKGROUND;
customAsset = a0.customAsset;
object2.id = customAsset.id;
object2.user_id = a1;
customAsset = a0.customAsset;
object2.asset = customAsset.assetHash;
return object2;
}
const value2 = 'blur';
if (value2 === oneofKind) {
return a0.blur.useBlur ? value2 : value;
}
if (oneofKind === 'presetOption') {
return a0.presetOption;
}
}