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

325 lines
20 KiB
TypeScript

/* Metro module 13630; source: modules/quests/native/QuestBottomSheet/QuestBottomSheetProgressCard.tsx; dependencies: [31, 27, 1878, 33, 4501, 697, 9483, 9520, 566, 9500, 7114, 1244, 4573, 6535, 6239, 13620, 9495, 13594, 9480, 5278, 9543, 4589, 5475, 13631, 9376, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import QuestDockBlurredContentBackground from '../QuestDock/QuestDockBlurredContentBackground.tsx'; /* Metro dependency 13631 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as CardNativeModule from '../../../../design/components/Card/native/Card.native.tsx'; /* Metro dependency 6239 */
import * as FirstPartyQuestTaskTypesModule from '../../../../external/discord_common/js/shared/shared-constants/FirstPartyQuestTaskTypes.tsx'; /* Metro dependency 6535 */
import * as QuestUtilsModule from '../../utils/QuestUtils.tsx'; /* Metro dependency 7114 */
import * as PlayIconModule from '../../../../design/components/Icon/native/redesign/generated/PlayIcon.tsx'; /* Metro dependency 9376 */
import * as QuestHooksModule from '../../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
import * as QuestRewardUtilsModule from '../../utils/QuestRewardUtils.tsx'; /* Metro dependency 9500 */
import * as QuestPlatformUtilsModule from '../../utils/QuestPlatformUtils.tsx'; /* Metro dependency 9520 */
import * as QuestBottomSheetHooksModule from './QuestBottomSheetHooks.tsx'; /* Metro dependency 13594 */
function _fun104088(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:6, offset: 0x02284837, size: 676 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_4 = value.View;
const StyleSheet = value.StyleSheet;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
object.card = {padding: 0};
object.cardWatchTask = {'justifyContent': 'flex-end', 'height': 210};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.content = {padding: PX_16};
object.contentWatchTask = {alignItems: 'flex-end'};
const object5 = {'padding': 12, 'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'center',
'alignItems': 'center'};
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
object5.backgroundColor = BACKGROUND_MOD_MUTED;
let CARD_DEFAULT_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CARD_DEFAULT_RADIUS;
object5.borderBottomLeftRadius = CARD_DEFAULT_RADIUS;
CARD_DEFAULT_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CARD_DEFAULT_RADIUS;
object5.borderBottomRightRadius = CARD_DEFAULT_RADIUS;
object5.borderWidth = 1;
const BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object5.borderColor = BORDER_MUTED;
object.footer = object5;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.instructionsText = {marginTop: PX_12, textAlign: 'center'};
const object7 = {};
copyDataProperties(object7, StyleSheet.absoluteFillObject, undefined);
CARD_DEFAULT_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CARD_DEFAULT_RADIUS;
object7['borderRadius'] = CARD_DEFAULT_RADIUS;
object7['overflow'] = 'hidden';
object.videoPreviewWrapper = object7;
const object8 = {};
copyDataProperties(object8, StyleSheet.absoluteFillObject, undefined);
object.videoPreview = object8;
const object9 = {'alignItems': 'center', 'justifyContent': 'center', 'borderRadius': null, 'position': 'absolute',
'left': '50%', 'overflow': 'hidden', 'top': '50%', 'width': 60, 'height': 60};
object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object9.transform = [{translateX: -30}, {translateY: -30}];
object.playVideoIconWrapper = object9;
const env0_9 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestBottomSheet/QuestBottomSheetProgressCard.tsx');
exports.QuestBottomSheetProgressCardPlayStreamTask = QuestBottomSheetProgressCardPlayStreamTask;
exports.QuestBottomSheetProgressCardWatchTask = QuestBottomSheetProgressCardWatchTask;
exports.QuestBottomSheetProgressCardInGameTask = QuestBottomSheetProgressCardInGameTask;
function QuestBottomSheetProgressCardPlayStreamTask({quest}) { // fn#104089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:1292, offset: 0x02284adb, size: 846 bytes, params: 2, frame: 30
var r5;
const Text = (TextModule).Text;
var intl;
const styles = useStyles();
const value3 = (QuestHooksModule).useQuestTaskDetails(quest);
const value4 = (QuestHooksModule).useIsQuestProgressing(quest);
let userStatus = quest.userStatus;
const value5 = userStatus?.completedAt != null;
userStatus = quest.userStatus;
const value6 = userStatus?.claimedAt != null;
const env0_3 = value6;
const value7 = (QuestPlatformUtilsModule).supportedTaskPlatforms(quest);
const value8 = (QuestHooksModule).useQuestFormattedDate(quest.config.rewardsConfig.rewardsExpireAt);
const gameTitle = quest.config.messages.gameTitle;
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value10 = env0_3.useMemo(_fun104091, [value3, value5, value6, gameTitle,
(QuestRewardUtilsModule).getDefaultRewardName(quest.config, currentUser),
value4, value7, value8, (QuestUtilsModule).isSponsoredPlayQuest(quest)]);
const Card = (CardNativeModule).Card;
const view = (
<View style={styles.content}>
{((Component) => <Component quest={quest} size="lg" progress={value3.percentComplete} loading={!(value5 || value4)} hasConfetti />)(importDefault(13620) /* metro dependency 13620: QuestProgressIndicator */)}
{value10 != null && <Text style={styles.instructionsText} variant="text-sm/semibold" color="text-subtle">{value10}</Text>}
</View>
);
if (value4) {
var viewBindingProps = {style: styles.footer};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r5 = (
<View {...viewBindingProps}>
<Text color="text-feedback-positive" variant="text-sm/semibold">
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.lIFg6I,
{gameName: quest.config.messages.gameTitle})}
</Text>
</View>
);
} else {
r5 = value4;
}
return (
<Card style={styles.card} border="subtle">
{view}
{r5}
</Card>
);
function _fun104091() { // fn#104091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:1831, offset: 0x02284e29, size: 789 bytes, params: 1, frame: 19
var environment;
var r1;
var value2;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const FirstPartyQuestTaskTypes = (FirstPartyQuestTaskTypesModule).FirstPartyQuestTaskTypes;
const FirstPartyQuestTaskTypesSets = (FirstPartyQuestTaskTypesModule).FirstPartyQuestTaskTypesSets;
var binding;
var value7;
var value;
if (env0_2) {
if (env0_3) {
if (env0_1) {
binding = env0_0;
value = binding.targetSeconds - binding.progressSeconds;
value = global.Math.ceil(value / 60);
value7 = environment.__proto__;
return intl.format(t.aFaRso, {minutesLeft: value, minutesHook: minutesHook});
}
if (env0_8) {
value = environment.__proto__;
value = intl.string(t['04ateG']);
r1 = value;
} else {
r1 = env0_4.length > 1 ? intl.formatToPlainString(t.E2R8VX,
{gameName: gameTitle}) : env0_0.taskType === FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP ? intl.formatToPlainString(t.boMftC,
{gameName: gameTitle}) : env0_0.taskType === FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP ? intl.formatToPlainString(t['9Peldf'],
{gameName: gameTitle}) : FirstPartyQuestTaskTypesSets.CONSOLE.has(env0_0.taskType) ? intl.formatToPlainString(t['+8JB6Y'],
{gameTitle: gameTitle}) : null;
}
return r1;
}
value2 = environment.__proto__;
return intl.format(t.e3OlfB, {rewardHook: rewardHook, date: env0_5});
}
if (env0_1) {
binding = env0_0;
value = binding.targetSeconds - binding.progressSeconds;
value = global.Math.ceil(value / 60);
value7 = environment.__proto__;
return intl.format(t.aFaRso, {minutesLeft: value, minutesHook: minutesHook});
}
if (env0_8) {
value = environment.__proto__;
value = intl.string(t['04ateG']);
r1 = value;
} else {
r1 = env0_4.length > 1 ? intl.formatToPlainString(t.E2R8VX,
{gameName: gameTitle}) : env0_0.taskType === FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP ? intl.formatToPlainString(t.boMftC,
{gameName: gameTitle}) : env0_0.taskType === FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP ? intl.formatToPlainString(t['9Peldf'],
{gameName: gameTitle}) : FirstPartyQuestTaskTypesSets.CONSOLE.has(env0_0.taskType) ? intl.formatToPlainString(t['+8JB6Y'],
{gameTitle: gameTitle}) : null;
}
return r1;
function rewardHook() { // fn#104092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:1903, offset: 0x0228513e, size: 67 bytes, params: 1, frame: 14
const Text = (TextModule).Text;
return (
<Text variant="text-sm/semibold" color="text-strong">
{env1_7}
</Text>
);
}
function minutesHook(a0) { // fn#104093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:2130, offset: 0x02285181, size: 63 bytes, params: 2, frame: 14
const Text = (TextModule).Text;
return (
<Text variant="text-sm/semibold" color="text-strong">
{a0}
</Text>
);
}
}
}
function QuestBottomSheetProgressCardWatchTask({quest, sourceQuestContent}) { // fn#104094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:3305, offset: 0x022851c0, size: 1165 bytes, params: 2, frame: 34
var url;
var VideoComponent;
const styles = useStyles();
const value3 = (QuestHooksModule).useQuestTaskDetails(quest);
const value4 = ReactModule.useMemo(_fun104095, [quest]);
const value5 = ReactModule.useMemo(_fun104096, [quest]);
const value6 = ReactModule.useMemo(_fun104097, [quest]);
const value7 = (QuestBottomSheetHooksModule).useWatchTaskPressHandler({questId: quest.id,
sourceQuestContent: sourceQuestContent});
let r8 = value4 != null && (require(9480) /* metro dependency 9480: QuestUtilsNative */).isHeroVideoSupported(value4);
const userStatus = quest.userStatus;
let r10 = userStatus?.completedAt != null ? (require(1244) /* metro dependency 1244: indexNative */).t.YsCuyF : (require(1244) /* metro dependency 1244: indexNative */).t['74KqrR'];
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {onPress: value7, accessibilityRole: 'button',
accessibilityLabel: (require(1244) /* metro dependency 1244: indexNative */).intl.string(r10)};
const Card = (CardNativeModule).Card;
const items2 = [styles.card];
items2[1] = styles.cardWatchTask;
if (r8) {
var viewBindingProps = {style: styles.videoPreviewWrapper};
VideoComponent = (require(9543) /* metro dependency 9543: Video */).VideoComponent;
var videoProps = {'style': null, 'poster': null, 'posterResizeMode': 'cover', 'source': null,
'resizeMode': 'cover',
'muted': true, 'disableFocus': true, 'preventsDisplaySleepDuringVideoPlayback': false,
style: styles.videoPreview};
url = value5?.url;
videoProps.poster = url;
url = value4.url;
videoProps.source = {uri: url};
r10 = (
<View {...viewBindingProps}>
<VideoComponent {...videoProps} />
{((Component) => <Component start={{'x': 0.5, 'y': 0.5}} end={{'x': 1,
'y': 1}} style={StyleSheet.absoluteFill} colors={['rgba(0, 0, 0, 0)',
'rgba(0, 0, 0, 1)']} />)(importDefault(4589) /* metro dependency 4589 */)}
</View>
);
} else {
r10 = r8;
}
const items3 = [r10];
r8 = !r8 && value6 != null && <View style={styles.videoPreviewWrapper}>{((Component) => <Component style={styles.videoPreview} source={{uri: value6.url}} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */)}{((Component) => <Component start={{'x': 0.5,
'y': 0.5}} end={{'x': 1, 'y': 1}} style={StyleSheet.absoluteFill} colors={['rgba(0, 0, 0, 0)',
'rgba(0, 0, 0, 1)']} />)(importDefault(4589) /* metro dependency 4589 */)}</View>;
items3[1] = r8;
const value15 = ((Component) => <Component blurTheme="light" />)(QuestDockBlurredContentBackground);
const PlayIcon = (PlayIconModule).PlayIcon;
const WHITE = (Native).colors.WHITE;
items3[2] = (
<View style={styles.playVideoIconWrapper}>
{value15}
<PlayIcon color={WHITE} />
</View>
);
items3[3] = (
<View style={[styles.content, styles.contentWatchTask]}>
{((Component) => <Component quest={quest} size="x-sm" progress={value3.percentComplete} hasConfetti />)(importDefault(13620) /* metro dependency 13620: QuestProgressIndicator */)}
</View>
);
return (
<PressableOpacity {...pressableOpacityProps}>
<Card style={items2} border="subtle">
{items3}
</Card>
</PressableOpacity>
);
function _fun104095() { // fn#104095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:3442, offset: 0x0228564d, size: 67 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = require(9495) /* metro dependency 9495: AssetUtils */;
const getQuestAsset = value.getQuestAsset;
const questBinding = quest;
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
const QUEST_BAR_HERO_VIDEO = QuestAssetType.QUEST_BAR_HERO_VIDEO;
return Reflect.apply(getQuestAsset, value, [questBinding, QUEST_BAR_HERO_VIDEO]);
}
function _fun104096() { // fn#104096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:3536, offset: 0x02285690, size: 75 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = require(9495) /* metro dependency 9495: AssetUtils */;
const getQuestAsset = value.getQuestAsset;
const questBinding = quest;
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
const VIDEO_PLAYER_THUMBNAIL = QuestAssetType.VIDEO_PLAYER_THUMBNAIL;
return Reflect.apply(getQuestAsset, value, [questBinding, VIDEO_PLAYER_THUMBNAIL, undefined, true]);
}
function _fun104097() { // fn#104097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:3642, offset: 0x022856db, size: 67 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = require(9495) /* metro dependency 9495: AssetUtils */;
const getQuestAsset = value.getQuestAsset;
const questBinding = quest;
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
const QUEST_BAR_HERO_IMAGE = QuestAssetType.QUEST_BAR_HERO_IMAGE;
return Reflect.apply(getQuestAsset, value, [questBinding, QUEST_BAR_HERO_IMAGE]);
}
}
function QuestBottomSheetProgressCardInGameTask({quest}) { // fn#104098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13827:5055, offset: 0x0228571e, size: 213 bytes, params: 2, frame: 21
const styles = useStyles();
const value3 = (QuestHooksModule).useThirdPartyTaskDetails(quest);
const Card = (CardNativeModule).Card;
return (
<Card style={styles.card} border="subtle">
<View style={styles.content}>
{((Component) => <Component quest={quest} size="lg" progress={value3?.percentComplete ?? 0} hasConfetti />)(importDefault(13620) /* metro dependency 13620: QuestProgressIndicator */)}
</View>
</Card>
);
}
}
global.__d(_fun104088, 13630, [31, 27, 1878, 33, 4501, 697, 9483, 9520, 566, 9500, 7114, 1244, 4573, 6535, 6239,
13620, 9495, 13594, 9480, 5278, 9543, 4589, 5475, 13631, 9376,
2]) /* metro module 13630, dependencies: [31, 27, 1878, 33, 4501, 697, 9483, 9520, 566, 9500, 7114, 1244, 4573, 6535, 6239, 13620, 9495, 13594, 9480, 5278, 9543, 4589, 5475, 13631, 9376, 2] */;