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

323 lines
16 KiB
TypeScript

/* Metro module 5200; source: modules/games/GameRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 4235, 1909, 1423, 5201, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Record from '../../lib/Record.tsx'; /* Metro dependency 1886 */
import ApplicationRecord from '../../records/ApplicationRecord.tsx'; /* Metro dependency 4235 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ServerModule from '../../flow/Server.tsx'; /* Metro dependency 1909 */
import * as ApplicationRecordModule from '../../records/ApplicationRecord.tsx'; /* Metro dependency 4235 */
function _fun45915(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:6, offset: 0x0119aef1, size: 241 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = Record;
value = _fun45919(value);
(FileImportTrackerModule).fileFinishedImporting('modules/games/GameRecord.tsx');
exports.default = value;
function _isNativeReflectConstruct_45916() { // fn#45916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:195, offset: 0x0119afe2, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_45916_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun45919(a0) { // fn#45919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:394, offset: 0x0119b040, size: 185 bytes, params: 2, frame: 16
const GameRecord2 = GameRecord;
Inherits(GameRecord2, a0);
return CreateClass(GameRecord2, [{key: 'applicationId', get: function() {
return this.id;
}}, {key: 'getOfficialApplicationId', value: function() {
var r0;
var value2;
var property = this.linkedApplications;
var value = undefined;
if (property == null) {
r0 = value;
} else {
value2 = property.find(_fun45923);
r0 = value2 == null ? value : value2.id;
}
return r0;
}}, {key: 'getIconURL', value: value_45924}, {key: 'getCoverURL', value: value_45925}, {key: 'getArtworkURLs',
value: value_45926}, {key: 'getCompanyByRole', value: function(a0) {
var r0;
var env0_0 = a0;
r0 = this.companies?.filter(_fun45928);
r0 = r0 ?? [];
return r0;
}}]);
function GameRecord({id, name, description, aliases, executables, overlay, overlay_warn, overlay_compatibility_hook, hook, overlay_methods, third_party_skus, themes, linked_applications, genres, platforms, websites, companies, icon_hash, cover_image_hash, banner_hash, screenshot_hashes, screenshot_urls, trailers, l30_rank, summary_localized, media, first_release_date, shop_collection_ids, steam_release_status, reviews, opencritic_url, game_flags, content_classification}) { // fn#45920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:406, offset: 0x0119b0f9, size: 933 bytes, params: 2, frame: 21
var r3;
var opencritic;
var r6;
var r5;
var object;
var object2;
var object3;
const value = environment.__proto__;
env1_3(this, GameRecord);
const value4 = env1_6(GameRecord);
const value7 = env1_5(this, _isNativeReflectConstruct_45916() ? global.Reflect.construct(value4, [],
env1_6(this).constructor) : value4.apply(this, undefined));
value7.id = id;
value7.name = name;
value7.description = description;
value7.aliases = aliases ?? [];
const r7 = executables ?? [];
value7.executables = r7.map(createExecutable);
value7.overlay = overlay != null && overlay;
value7.overlayWarn = overlay_warn != null && overlay_warn;
value7.overlayCompatibilityHook = overlay_compatibility_hook != null && overlay_compatibility_hook;
value7.hook = hook == null || hook;
value7.supportsOutOfProcessOverlay = ApplicationRecord.supportsOutOfProcessOverlay(overlay_methods);
value7.thirdPartySkus = third_party_skus ?? [];
value7.themes = themes ?? [];
value7.linkedApplications = linked_applications;
value7.genres = genres ?? [];
value7.platforms = platforms ?? [];
value7.websites = websites ?? [];
value7.companies = companies;
value7.iconHash = icon_hash;
value7.coverImageHash = cover_image_hash;
value7.bannerHash = banner_hash;
value7.screenshotHashes = screenshot_hashes;
value7.screenshotUrls = screenshot_urls;
value7.trailers = trailers;
value7.l30Rank = l30_rank;
value7.summaryLocalized = summary_localized;
value7.media = media;
value7.firstReleaseDate = first_release_date;
value7.shopCollectionIds = shop_collection_ids;
value7.steamReleaseStatus = steam_release_status;
let steam = reviews?.steam;
if (steam != null) {
object = {};
steam = reviews.steam;
if (steam != null) {
object2 = {};
steam = reviews.steam;
object2.rating = steam.rating;
steam = reviews.steam;
object2.ratingCount = steam.rating_count;
steam = reviews.steam;
object2.recentRating = steam.recent_rating;
steam = reviews.steam;
object2.recentRatingCount = steam.recent_rating_count;
steam = reviews.steam;
object2.localizedRating = steam.localized_rating;
steam = reviews.steam;
object2.localizedRatingCount = steam.localized_rating_count;
r6 = object2;
} else {
r6 = undefined;
}
object.steam = r6;
opencritic = reviews.opencritic;
if (opencritic != null) {
object3 = {};
opencritic = reviews.opencritic;
object3.topCriticRating = opencritic.top_critic_rating;
opencritic = reviews.opencritic;
object3.topCriticRatingCount = opencritic.top_critic_rating_count;
opencritic = reviews.opencritic;
object3.tier = opencritic.tier;
r5 = object3;
} else {
r5 = undefined;
}
object.opencritic = r5;
r3 = object;
} else {
opencritic = reviews?.opencritic;
if (opencritic != null) {
object = {};
steam = reviews.steam;
if (steam != null) {
object2 = {};
steam = reviews.steam;
object2.rating = steam.rating;
steam = reviews.steam;
object2.ratingCount = steam.rating_count;
steam = reviews.steam;
object2.recentRating = steam.recent_rating;
steam = reviews.steam;
object2.recentRatingCount = steam.recent_rating_count;
steam = reviews.steam;
object2.localizedRating = steam.localized_rating;
steam = reviews.steam;
object2.localizedRatingCount = steam.localized_rating_count;
r6 = object2;
} else {
r6 = undefined;
}
object.steam = r6;
opencritic = reviews.opencritic;
if (opencritic != null) {
object3 = {};
opencritic = reviews.opencritic;
object3.topCriticRating = opencritic.top_critic_rating;
opencritic = reviews.opencritic;
object3.topCriticRatingCount = opencritic.top_critic_rating_count;
opencritic = reviews.opencritic;
object3.tier = opencritic.tier;
r5 = object3;
} else {
r5 = undefined;
}
object.opencritic = r5;
r3 = object;
} else {
r3 = undefined;
}
}
value7.reviews = r3;
value7.opencriticUrl = opencritic_url;
value7.gameFlags = game_flags ?? 0;
value7.contentClassification = content_classification;
return value7;
}
function value_45922() { // fn#45922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:2473, offset: 0x0119b49e, size: 54 bytes, params: 1, frame: 14
var id;
var value2;
const linkedApplications = this.linkedApplications;
const value = undefined;
if (linkedApplications == null) {
id = value;
} else {
value2 = linkedApplications.find(function({type}) {
return type === require(dependencyMap[7]).GameLinkTypes.OFFICIAL;
});
id = value2 == null ? value : value2.id;
}
return id;
function _fun45923({type}) { // fn#45923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:2549, offset: 0x0119b4d4, size: 51 bytes, params: 2, frame: 12
const GameLinkTypes = (ServerModule).GameLinkTypes;
const OFFICIAL = GameLinkTypes.OFFICIAL;
return type === OFFICIAL;
}
}
function value_45924(a0, a1) { // fn#45924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:2633, offset: 0x0119b507, size: 124 bytes, params: 3, frame: 15
var r0;
var value2;
var gameAssetURL;
const iconHash = this.iconHash;
const value = null;
if (value == iconHash) {
r0 = value;
} else if (this.iconHash === '') {
r0 = value;
} else {
value2 = environment.__proto__;
gameAssetURL = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGameAssetURL({id: this.id,
hash: this.iconHash, size: a0, format: a1});
r0 = value != gameAssetURL ? gameAssetURL : value;
}
return r0;
}
function value_45925(a0) { // fn#45925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:2822, offset: 0x0119b583, size: 203 bytes, params: 2, frame: 20
var r1;
var r0;
var cover_url;
var value2;
var defaultImport;
var getGameAssetURL;
var object;
var value5;
const media = this.media;
const value = null;
if (value == media) {
r0 = value;
} else {
if (value != this.media.cover_hash) {
value2 = environment.__proto__;
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getGameAssetURL = defaultImport.getGameAssetURL;
object = {};
object.id = this.id;
object.hash = this.media.cover_hash;
object.keepAspectRatio = true;
object.format = (require(1423) /* metro dependency 1423: AvatarUtils */).SUPPORTS_WEBP ? 'webp' : 'png';
object.size = a0;
value5 = Reflect.apply(getGameAssetURL, defaultImport, [object]);
r1 = value != value5 ? value5 : value;
} else {
cover_url = this.media.cover_url;
r1 = value != cover_url ? cover_url : value;
}
r0 = r1;
}
return r0;
}
function value_45926() { // fn#45926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:3117, offset: 0x0119b64e, size: 90 bytes, params: 1, frame: 15
var r0;
var value;
var getArtworkUrls;
var id;
var artwork_hashes;
let media = this.media;
if (media == null) {
r0 = [];
} else {
value = environment.__proto__;
value = require(5201) /* metro dependency 5201: useGameArtworkUrls */;
getArtworkUrls = value.getArtworkUrls;
id = this.id;
media = this.media;
artwork_hashes = media.artwork_hashes;
media = this.media;
value = Reflect.apply(getArtworkUrls, value, [id, artwork_hashes, media.artwork_urls]);
r0 = value;
}
return r0;
}
function value_45927(a0) { // fn#45927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:3269, offset: 0x0119b6a8, size: 54 bytes, params: 2, frame: 13
const env0_0 = a0;
let r0 = this.companies?.filter(_fun45928);
r0 = r0 ?? [];
return r0;
function _fun45928({roles}) { // fn#45928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5378:3347, offset: 0x0119b6de, size: 28 bytes, params: 2, frame: 11
return roles.includes(env0_0);
}
}
}
}
global.__d(_fun45915, 5200, [6, 7, 15, 17, 18, 1886, 4235, 1909, 1423, 5201,
2]) /* metro module 5200, dependencies: [6, 7, 15, 17, 18, 1886, 4235, 1909, 1423, 5201, 2] */;