157 lines
7.3 KiB
TypeScript
157 lines
7.3 KiB
TypeScript
/* Metro module 4276; source: modules/skus/utils/transformSKUTenantMetadata.tsx; dependencies: [1904, 2] */
|
|
function _fun36253(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:6, offset: 0x01086b24, size: 148 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const transformCollectiblesItemAssetsFromServer = function(a0) {
|
|
if (a0 != null) {
|
|
return {staticImagePath: a0.static_image_path, animatedImagePath: a0.animated_image_path,
|
|
videoPath: a0.video_path};
|
|
}
|
|
};
|
|
const transformCollectiblesVariantMetadataFromServer = function(a0) {
|
|
if (a0 != null) {
|
|
return {role: a0.role, baseVariantSkuId: a0.base_variant_sku_id, baseVariantName: a0.base_variant_name,
|
|
value: a0.value, label: a0.label, collapseUnder: a0.collapse_under};
|
|
}
|
|
};
|
|
const transformSlayerSKUTenantMetadataFromServer = function(a0) {
|
|
var object;
|
|
if (a0 != null) {
|
|
object = {};
|
|
object.carouselItems = a0.carousel_items.map(_fun36260);
|
|
object.expiresAt = a0.expires_at != null ? new global.Date() : undefined;
|
|
object.cardImageAssetId = a0.card_image_asset_id;
|
|
object.cardBackgroundImageAssetId = a0.card_background_image_asset_id;
|
|
return object;
|
|
}
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/skus/utils/transformSKUTenantMetadata.tsx');
|
|
exports.default = transformSKUTenantMetadata;
|
|
}
|
|
|
|
function transformProfileEffectKeyFrameFromServer({src, loop, height, width, duration, start, loopDelay, position, zIndex, randomizedSources}) { // fn#36255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:215, offset: 0x01086bf6, size: 159 bytes, params: 2, frame: 15
|
|
const object2 = {};
|
|
object2.src = src;
|
|
object2.loop = loop;
|
|
object2.height = height;
|
|
object2.width = width;
|
|
const value = 0;
|
|
object2.duration = duration ?? value;
|
|
object2.start = start ?? value;
|
|
object2.loopDelay = loopDelay;
|
|
object2.position = position;
|
|
object2.zIndex = zIndex;
|
|
object2.randomizedSources = randomizedSources?.map(function({src}) {
|
|
return {src: src};
|
|
});
|
|
return object2;
|
|
}
|
|
|
|
function transformCollectiblesItemFromServer(a0) { // fn#36257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:543, offset: 0x01086ca7, size: 516 bytes, params: 2, frame: 16
|
|
var type;
|
|
var value2;
|
|
const CollectiblesItemType = (require(1904) /* metro dependency 1904: CollectiblesItemType */).CollectiblesItemType;
|
|
var object2;
|
|
var effects;
|
|
if (a0 != null) {
|
|
type = a0.type;
|
|
value2 = undefined;
|
|
if (CollectiblesItemType.AVATAR_DECORATION === type) {
|
|
object2 = {};
|
|
object2.id = a0.id;
|
|
object2.type = a0.type;
|
|
object2.asset = a0.asset;
|
|
object2.assets = transformCollectiblesItemAssetsFromServer(a0.assets);
|
|
object2.label = a0.label;
|
|
return object2;
|
|
}
|
|
if (CollectiblesItemType.NAMEPLATE === type) {
|
|
object2 = {};
|
|
object2.id = a0.id;
|
|
object2.type = a0.type;
|
|
object2.asset = a0.asset;
|
|
object2.assets = transformCollectiblesItemAssetsFromServer(a0.assets);
|
|
object2.label = a0.label;
|
|
object2.palette = a0.palette;
|
|
return object2;
|
|
}
|
|
if (CollectiblesItemType.PROFILE_EFFECT === type) {
|
|
effects = a0.effects;
|
|
return {id: a0.id, type: a0.type, title: a0.title, description: a0.description,
|
|
accessibilityLabel: a0.accessibilityLabel, animationType: a0.animationType,
|
|
staticFrameSrc: a0.staticFrameSrc,
|
|
thumbnailPreviewSrc: a0.thumbnailPreviewSrc, reducedMotionSrc: a0.reducedMotionSrc,
|
|
effects: effects == null ? value2 : effects.map(transformProfileEffectKeyFrameFromServer)};
|
|
}
|
|
if (CollectiblesItemType.PROFILE_FRAME === type) {
|
|
return {id: a0.id, type: a0.type, label: a0.label, layers: a0.layers, innerWidth: a0.inner_width,
|
|
overflowTop: a0.overflow_top, overflowBottom: a0.overflow_bottom,
|
|
overflowHorizontal: a0.overflow_horizontal};
|
|
}
|
|
return value2;
|
|
}
|
|
}
|
|
|
|
function transformSlayerSKUTenantMetadataFromServer(a0) { // fn#36259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:1819, offset: 0x01086efe, size: 125 bytes, params: 2, frame: 14
|
|
var object2;
|
|
if (a0 != null) {
|
|
object2 = {};
|
|
object2.carouselItems = a0.carousel_items.map(function(a0) {
|
|
return {thumbnailAssetId: a0.thumbnail_asset_id, assetId: a0.asset_id,
|
|
backgroundAssetId: a0.background_asset_id,
|
|
youtubeVideoId: a0.youtube_video_id, label: a0.label, labelIconAssetId: a0.label_icon_asset_id,
|
|
title: a0.title,
|
|
description: a0.description};
|
|
});
|
|
object2.expiresAt = a0.expires_at != null ? new global.Date() : undefined;
|
|
object2.cardImageAssetId = a0.card_image_asset_id;
|
|
object2.cardBackgroundImageAssetId = a0.card_background_image_asset_id;
|
|
return object2;
|
|
}
|
|
}
|
|
|
|
function transformCollectiblesSKUTenantMetadataFromServer(a0) { // fn#36261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:2320, offset: 0x01086fd8, size: 181 bytes, params: 2, frame: 16
|
|
var r3;
|
|
var object2;
|
|
var transformCollectiblesItemFromServerBinding;
|
|
var item;
|
|
var value2;
|
|
var Date;
|
|
var value3;
|
|
var date;
|
|
if (a0 != null) {
|
|
object2 = {};
|
|
object2.type = a0.type;
|
|
transformCollectiblesItemFromServerBinding = transformCollectiblesItemFromServer;
|
|
item = a0.item;
|
|
value2 = undefined;
|
|
object2.item = transformCollectiblesItemFromServerBinding(item);
|
|
object2.categorySkuId = a0.category_sku_id;
|
|
object2.premiumType = a0.premium_type;
|
|
object2.expiresSecondsAfterClaim = a0.expires_seconds_after_claim;
|
|
if (a0.expires_at != null) {
|
|
Date = global.Date;
|
|
value3 = 1000 * a0.expires_at;
|
|
date = new Date();
|
|
} else {
|
|
r3 = value2;
|
|
}
|
|
object2.expiresAt = r3;
|
|
object2.variant = transformCollectiblesVariantMetadataFromServer(a0.variant);
|
|
object2.optionSelectorDisplayValue = a0.option_selector_display_value;
|
|
return object2;
|
|
}
|
|
}
|
|
|
|
function transformSKUTenantMetadata(a0) { // fn#36262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4448:2905, offset: 0x0108708d, size: 64 bytes, params: 2, frame: 14
|
|
var object2;
|
|
if (a0 != null) {
|
|
object2 = {};
|
|
object2.socialLayer = transformSlayerSKUTenantMetadataFromServer(a0.social_layer);
|
|
object2.collectibles = transformCollectiblesSKUTenantMetadataFromServer(a0.collectibles);
|
|
return object2;
|
|
}
|
|
}
|
|
|