201 lines
10 KiB
TypeScript
201 lines
10 KiB
TypeScript
/* Metro module 8493; source: modules/user_profile/DisplayProfile.tsx; dependencies: [6, 7, 1880, 5191, 3802, 1423, 8402, 2] */
|
|
function _fun67366(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:6, offset: 0x01c20434, size: 171 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _getStringFieldDefault = function(a0, a1) {
|
|
var value = a0;
|
|
var value2 = a1;
|
|
return value2 == null ? value : value2 !== '' ? value2 : value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
|
let value = _fun67368();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/DisplayProfile.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _fun67368() { // fn#67368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:209, offset: 0x01c204f8, size: 623 bytes, params: 1, frame: 15
|
|
return env0_4(DisplayProfile, [{key: 'premiumSince', get: function() {
|
|
return this._userProfile.premiumSince;
|
|
}}, {key: 'premiumGuildSince', get: function() {
|
|
return this._userProfile.premiumGuildSince;
|
|
}}, {key: 'premiumType', get: function() {
|
|
return this._userProfile.premiumType;
|
|
}}, {key: 'private', get: function() {
|
|
return this._userProfile.private;
|
|
}}, {key: 'widgets', get: function() {
|
|
return this._userProfile.widgets;
|
|
}}, {key: 'gameWidgets', get: function() {
|
|
return this._userProfile.widgets?.filter(require(dependencyMap[3]).isGameWidget);
|
|
}}, {key: 'primaryColor', get: function() {
|
|
var r0;
|
|
r0 = this.themeColors?.[0];
|
|
r0 = r0 ?? this.accentColor;
|
|
return r0;
|
|
}}, {key: 'canUsePremiumProfileCustomization', get: function() {
|
|
return importDefault(dependencyMap[4]).isPremiumAtLeast(this.premiumType, PremiumTypes.TIER_2);
|
|
}}, {key: 'canEditThemes', get: function() {
|
|
return this.canUsePremiumProfileCustomization;
|
|
}}, {key: 'application', get: function() {
|
|
return this._userProfile.application;
|
|
}}, {key: 'isLoaded', get: function() {
|
|
return this._userProfile !== undefined && (this.guildId == null || this._guildMemberProfile !== undefined);
|
|
}}, {key: 'hasThemeColors', value: function() {
|
|
var property = this.themeColors;
|
|
var value = undefined;
|
|
return (property == null ? value : property[0]) != null || (this.themeColors == null ? value : this.themeColors[1]) != null;
|
|
}}, {key: 'hasPremiumCustomization', value: function() {
|
|
var r0;
|
|
r0 = this.isUsingGuildMemberBanner() || this.isUsingGuildMemberBio();
|
|
r0 = !r0 ? this.banner != null : r0;
|
|
r0 = !r0 ? this.hasThemeColors() : r0;
|
|
r0 = !r0 ? this.popoutAnimationParticleType != null : r0;
|
|
return r0;
|
|
}}, {key: 'isUsingGuildMemberBanner', value: function() {
|
|
return this._guildMemberProfile?.banner != null;
|
|
}}, {key: 'isUsingGuildMemberBio', value: function() {
|
|
var property = this._guildMemberProfile;
|
|
var value = undefined;
|
|
return (property == null ? value : property.bio) != null && (this._guildMemberProfile == null ? value : this._guildMemberProfile.bio) !== '';
|
|
}}, {key: 'isUsingGuildMemberPronouns', value: function() {
|
|
var property = this._guildMemberProfile;
|
|
var value = undefined;
|
|
return (property == null ? value : property.pronouns) != null && (this._guildMemberProfile == null ? value : this._guildMemberProfile.pronouns) !== '';
|
|
}}, {key: 'getBannerURL', value: value_67386}, {key: 'getPreviewBanner', value: value_67387}, {key: 'getPreviewBio',
|
|
value: value_67388}, {key: 'getPreviewPronouns', value: value_67389}, {key: 'getPreviewThemeColors',
|
|
value: function(a0) {
|
|
var r0;
|
|
var value = a0;
|
|
var value2 = undefined;
|
|
r0 = value == null ? value2 : value[0];
|
|
r0 = r0 == null ? value2 !== value ? this._userProfile.themeColors : this.themeColors : (value == null ? value2 : value[1]) != null ? value : value2 !== value ? this._userProfile.themeColors : this.themeColors;
|
|
return r0;
|
|
}}, {key: 'getBadges', value: function() {
|
|
var r5;
|
|
var r4;
|
|
var r1;
|
|
var items;
|
|
var property = this._userProfile.badges;
|
|
r4 = property ?? [];
|
|
items = [];
|
|
var value = arraySpread(items, r4, 0, r5);
|
|
var value2 = this._guildMemberProfile == null;
|
|
r1 = value2 ? undefined : property.badges;
|
|
r1 = r1 ?? [];
|
|
arraySpread(items, r1, value, value2);
|
|
return items;
|
|
}}, {key: 'getLegacyUsername', value: function() {
|
|
return this._userProfile.legacyUsername;
|
|
}}]);
|
|
}
|
|
|
|
function DisplayProfile(a0, a1) { // fn#67369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:230, offset: 0x01c20767, size: 343 bytes, params: 3, frame: 19
|
|
const binding = env1_3;
|
|
const value3 = undefined;
|
|
binding(this, DisplayProfile);
|
|
const userId = a0.userId;
|
|
this.userId = userId;
|
|
this.guildId = a1 == null ? value3 : a1.guildId;
|
|
let banner = a1 == null ? value3 : a1.banner;
|
|
banner = banner ?? a0.banner;
|
|
this.banner = banner;
|
|
this.bio = _getStringFieldDefault(a0.bio, a1 == null ? value3 : a1.bio);
|
|
this.pronouns = _getStringFieldDefault(a0.pronouns, a1 == null ? value3 : a1.pronouns);
|
|
this.accentColor = a0.accentColor;
|
|
let themeColors = a1 == null ? value3 : a1.themeColors;
|
|
themeColors = themeColors ?? a0.themeColors;
|
|
this.themeColors = themeColors;
|
|
let profileEffect = a1 == null ? value3 : a1.profileEffect;
|
|
profileEffect = profileEffect ?? a0.profileEffect;
|
|
this.profileEffect = profileEffect;
|
|
let profileFrame = a1 == null ? value3 : a1.profileFrame;
|
|
profileFrame = profileFrame ?? a0.profileFrame;
|
|
this.profileFrame = profileFrame;
|
|
let popoutAnimationParticleType = a1 == null ? value3 : a1.popoutAnimationParticleType;
|
|
popoutAnimationParticleType = popoutAnimationParticleType ?? a0.popoutAnimationParticleType;
|
|
this.popoutAnimationParticleType = popoutAnimationParticleType;
|
|
this.fetchStartedAt = a0.fetchStartedAt;
|
|
this.fetchEndedAt = a0.fetchEndedAt;
|
|
this._userProfile = a0;
|
|
this._guildMemberProfile = a1;
|
|
return value3;
|
|
}
|
|
|
|
function value_67386({canAnimate, size}) { // fn#67386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:2913, offset: 0x01c20b26, size: 188 bytes, params: 2, frame: 16
|
|
var r0;
|
|
var value;
|
|
if (this.guildId == null) {
|
|
value = environment.__proto__;
|
|
value = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
value = value.getUserBannerURL({id: this.userId, banner: this.banner, canAnimate: canAnimate, size: size});
|
|
r0 = value;
|
|
} else if (this.isUsingGuildMemberBanner()) {
|
|
value = environment.__proto__;
|
|
value = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
value = value.getGuildMemberBannerURL({id: this.userId, guildId: this.guildId, banner: this.banner,
|
|
canAnimate: canAnimate, size: size});
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
value = value.getUserBannerURL({id: this.userId, banner: this.banner, canAnimate: canAnimate, size: size});
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_67387(a0, a1) { // fn#67387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:3228, offset: 0x01c20be2, size: 155 bytes, params: 3, frame: 18
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
let value = a0;
|
|
const value2 = a2;
|
|
const r6 = value2 !== undefined ? value2 : 480;
|
|
const value4 = null;
|
|
if (value4 != value) {
|
|
r0 = value;
|
|
} else {
|
|
if (value4 === value) {
|
|
if (this.isUsingGuildMemberBanner()) {
|
|
value = environment.__proto__;
|
|
value = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
value = value.getUserBannerURL({id: this.userId, banner: this._userProfile.banner, canAnimate: a1,
|
|
size: r6});
|
|
r2 = value;
|
|
} else {
|
|
r2 = value4;
|
|
}
|
|
r1 = r2;
|
|
} else {
|
|
r1 = this.getBannerURL({canAnimate: a1, size: r6});
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_67388(a0) { // fn#67388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:3476, offset: 0x01c20c7d, size: 103 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
const profileCustomizationUtilsModule = require(8402) /* metro dependency 8402: ProfileCustomizationUtils */;
|
|
const getProfilePreviewValue = profileCustomizationUtilsModule.getProfilePreviewValue;
|
|
const _guildMemberProfile = this._guildMemberProfile;
|
|
return Reflect.apply(getProfilePreviewValue, profileCustomizationUtilsModule, [{pendingValue: a0,
|
|
userValue: this._userProfile.bio, guildValue: _guildMemberProfile == null ? value : _guildMemberProfile.bio,
|
|
guildId: this.guildId}]);
|
|
}
|
|
|
|
function value_67389(a0) { // fn#67389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8678:3696, offset: 0x01c20ce4, size: 103 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
const profileCustomizationUtilsModule = require(8402) /* metro dependency 8402: ProfileCustomizationUtils */;
|
|
const getProfilePreviewValue = profileCustomizationUtilsModule.getProfilePreviewValue;
|
|
const _guildMemberProfile = this._guildMemberProfile;
|
|
return Reflect.apply(getProfilePreviewValue, profileCustomizationUtilsModule, [{pendingValue: a0,
|
|
userValue: this._userProfile.pronouns,
|
|
guildValue: _guildMemberProfile == null ? value : _guildMemberProfile.pronouns, guildId: this.guildId}]);
|
|
}
|
|
|