// Module ID: 15171 // Function ID: 15172 // Name: QuestCard // Dependencies: [5, 32, 19, 17, 1371, 7805, 5525, 1085, 21, 576, 4636, 4489, 4486, 4353, 5528, 7811, 11907, 11620, 1477, 11422, 15172, 9003, 7704, 7709, 7830, 504, 11427, 7826, 7801, 11432, 4571, 11180, 4338, 15199, 11623, 11329, 11330, 11334, 5532, 11633, 4603, 15201, 1896, 11908, 7655, 1114, 11900, 11650, 15205, 11413, 11429, 11430, 5063, 10247, 8809, 1363, 8962, 4632, 15206, 5688, 15245, 5668, 5068, 1093, 15231, 5672, 15212, 11903, 15246, 5054, 5056, 15249, 8202, 10309, 15232, 2] // Module 15171 (QuestCard) import nativeDefault from "native" /* 576 */; import asyncRequireImpl from "asyncRequireImpl" /* 1896 */; import design_shared from "design/shared" /* 4489 */; import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4603 */; import MonitoringAgentDefault from "MonitoringAgent" /* 7704 */; import MetricEvents from "MetricEvents" /* 7709 */; import AnalyticsTypes from "AnalyticsTypes" /* 7830 */; import AdAnalyticsInterfaceExperiment from "AdAnalyticsInterfaceExperiment" /* 11329 */; import AssetUtils from "AssetUtils" /* 11422 */; import QuestPlatformUtils from "QuestPlatformUtils" /* 11633 */; import QuestUtils from "QuestUtils" /* 11900 */; import openQuestAccessSuspendedBottomSheetDefault from "openQuestAccessSuspendedBottomSheet" /* 15199 */; import openVideoQuestModalDefault from "openVideoQuestModal" /* 15205 */; import VideoQuestModal from "VideoQuestModal" /* 15206 */; import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */; import _slicedToArray from "module_32" /* 32 */; import noop from "module_19" /* 19 */; import UserStore from "UserStore" /* 1371 */; import QuestStore from "QuestStore" /* 7805 */; const require = globalThis.__r; const ColorUtils = tmp(4486); require = fn; get_ActivityIndicator = fn(17); ({ Image: metroRequire, StyleSheet, View: closure_7 } = get_ActivityIndicator); const QuestsExperimentLocations = fn(5525).QuestsExperimentLocations; const NOOP = fn(1085).NOOP; const jsxProd = fn(21); ({ jsx: closure_12, jsxs: map1, Fragment: closure_14 } = jsxProd); let createStyles = fn(4636); let result = createStyles.experimental_createToken((theme) => { theme = theme.theme; const internal = nativeDefault.internal; const colors = nativeDefault.colors; const semanticColor = internal.resolveSemanticColor(theme, design_shared.isThemeDark(theme) ? colors.BACKGROUND_SURFACE_HIGH : colors.BLACK); const isThemeDarkResult = design_shared.isThemeDark(theme); return ColorUtils.hexOpacityToRgba(semanticColor, 0); }); createStyles = fn(4636); let result1 = createStyles.experimental_createToken((theme) => { theme = theme.theme; const isThemeDarkResult = design_shared.isThemeDark(theme); const internal = nativeDefault.internal; const colors = nativeDefault.colors; const semanticColor = internal.resolveSemanticColor(theme, isThemeDarkResult ? colors.BACKGROUND_SURFACE_HIGH : colors.BLACK); let num = 0.5; if (isThemeDarkResult) { num = 0.8; } return ColorUtils.hexOpacityToRgba(semanticColor, num); }); createStyles = fn(4636); let result2 = createStyles.experimental_createToken((theme) => { const colors = nativeDefault.colors; return design_shared.isThemeDark(theme.theme) ? colors.BACKGROUND_SURFACE_HIGH : colors.BLACK; }); const PX_16 = nativeDefault.space.PX_16; createStyles = fn(4636); let obj = { container: { position: "relative", padding: 0, borderRadius: nativeDefault.radii.sm, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH, marginBottom: nativeDefault.space.PX_16, overflow: "hidden" }, heroContainer: null, heroImg: null, heroLinearGradientOverlay: null, previewBadge: null, previewBadgeText: null, rewardImgContainer: null, heroFooterContainer: null, heroFooterLeftContainer: null, promotedByRow: null, shrinkableText: null, detailsWrapper: null, detailsContainer: null, questName: null, bodyContainer: null, subtitleRow: null, rewardSubtitleRow: null, orbWithAmountRow: null, detailsTextContainer: null, buttonContainers: null, equalWidthContainer: null }; let obj6 = { position: "relative", padding: 0, borderRadius: nativeDefault.radii.sm, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH, marginBottom: nativeDefault.space.PX_16, overflow: "hidden" }; obj.heroContainer = { display: "flex", flexDirection: "column", justifyContent: "flex-end", padding: nativeDefault.space.PX_12 }; let merged = Object.assign(StyleSheet.absoluteFillObject); obj.heroImg = { resizeMode: "cover" }; obj.heroLinearGradientOverlay = StyleSheet.absoluteFillObject; const rect = { position: "absolute", top: nativeDefault.space.PX_8, right: nativeDefault.space.PX_8, backgroundColor: nativeDefault.colors.BACKGROUND_BRAND, padding: nativeDefault.space.PX_4, borderRadius: nativeDefault.radii.sm }; let merged1 = Object.assign(nativeDefault.shadows.SHADOW_LOW); obj.previewBadge = rect; obj.previewBadgeText = { textTransform: "uppercase" }; let size = { height: 64, width: 64, marginRight: nativeDefault.space.PX_12 }; obj.rewardImgContainer = size; obj.heroFooterContainer = { display: "flex", flexDirection: "row", flexWrap: "wrap", justifyContent: "space-between", alignItems: "flex-end" }; obj.heroFooterLeftContainer = { display: "flex", flexDirection: "column", alignItems: "flex-start", flexShrink: 1 }; let obj7 = { display: "flex", flexDirection: "column", justifyContent: "flex-end", padding: nativeDefault.space.PX_12 }; let obj8 = { resizeMode: "cover" }; obj.promotedByRow = { flexDirection: "row", alignItems: "center", flexWrap: "wrap", columnGap: nativeDefault.space.PX_4, rowGap: nativeDefault.space.PX_4 }; obj.shrinkableText = { flexShrink: 1 }; let obj9 = { flexDirection: "row", alignItems: "center", flexWrap: "wrap", columnGap: nativeDefault.space.PX_4, rowGap: nativeDefault.space.PX_4 }; obj.detailsWrapper = { display: "flex", padding: nativeDefault.space.PX_12 }; obj.detailsContainer = { display: "flex", flexDirection: "row" }; let obj10 = { display: "flex", padding: nativeDefault.space.PX_12 }; obj.questName = { marginBottom: nativeDefault.space.PX_4 }; let obj11 = { marginBottom: nativeDefault.space.PX_4 }; obj.bodyContainer = { display: "flex", flexDirection: "column", gap: nativeDefault.space.PX_4 }; let obj12 = { display: "flex", flexDirection: "column", gap: nativeDefault.space.PX_4 }; obj.subtitleRow = { flexDirection: "row", alignItems: "center", rowGap: nativeDefault.space.PX_4, columnGap: nativeDefault.space.PX_8, flexWrap: "wrap" }; obj.rewardSubtitleRow = { flexDirection: "row", alignItems: "center", flexWrap: "wrap", flexShrink: 1 }; obj.orbWithAmountRow = { flexDirection: "row", alignItems: "center", flexShrink: 1 }; obj.detailsTextContainer = { flex: 1, justifyContent: "center" }; let obj13 = { flexDirection: "row", alignItems: "center", rowGap: nativeDefault.space.PX_4, columnGap: nativeDefault.space.PX_8, flexWrap: "wrap" }; obj.buttonContainers = { borderTopWidth: 1, borderTopColor: nativeDefault.colors.BORDER_SUBTLE, display: "flex", flexDirection: "row", alignItems: "center", padding: nativeDefault.space.PX_12 }; obj.equalWidthContainer = { flexBasis: 0, flexGrow: 1, flexShrink: 1 }; let closure_16 = createStyles.createStyles(obj); createStyles = fn(4636); let closure_17 = createStyles.createStyleProperties({ gradientStart: result, gradientMid: result1, gradientEnd: result2 }); let obj14 = { borderTopWidth: 1, borderTopColor: nativeDefault.colors.BORDER_SUBTLE, display: "flex", flexDirection: "row", alignItems: "center", padding: nativeDefault.space.PX_12 }; size = fn(2); let result3 = size.fileFinishedImporting("modules/quests/native/QuestCard.tsx"); export const ESTIMATED_CARD_HEIGHT = 348; export const QuestCard = noop.memo((questContent) => { function trackClick(CLAIM_REWARD) { if (obj.shouldMigrateToAdAnalyticsInterface(AdAnalyticsInterfaceExperiment.AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "quest_card")) { const obj2 = { type: tmp(11334).AdUserActionType.CLICK_INTERNAL, adCreativeType: tmp(5532).AdCreativeType.QUEST, adCreativeId: quest.id, questContentCTA: CLAIM_REWARD, surfaceId: QUEST_HOME_MOBILE, sourceQuestContent, impressionId: getQuestImpressionId() }; tmp(11330).captureAdUserAction(obj2); const tmpResult = tmp(11330); } else { const obj3 = { questId: quest.id, questContent: QUEST_HOME_MOBILE, questContentCTA: CLAIM_REWARD, sourceQuestContent }; closure_6(obj3); } } function showQuestBottomSheet() { ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(15201, dependencyMap.paths), "QuestBottomSheet", { questId: quest.id, questContentPosition, sourceQuestContent }); } const tmp = require; const tmp2 = QUEST_HOME_MOBILE; ({ onLayout: require, quest } = questContent); QUEST_HOME_MOBILE = questContent.questContent; const badgeTextVariant = require("useBadgeTextVariant").useBadgeTextVariant(); if (undefined === QUEST_HOME_MOBILE) { QUEST_HOME_MOBILE = tmp(tmp2[14]).QuestContent.QUEST_HOME_MOBILE; } ({ questContentPosition: asyncGeneratorStep, sourceQuestContent } = questContent); let obj = require("useBadgeTextVariant"); noop = tmp(tmp2[15]).getQuestLogger({ quest, location: first.QUEST_HOME_MOBILE }); let obj2 = { quest, location: first.QUEST_HOME_MOBILE }; let tmpResult = tmp(tmp2[15]); closure_6 = tmp(tmp2[16]).useTrackQuestContentClickedWithImpression(); const tmpResult44 = tmp(tmp2[16]); const questTaskDetails = tmp(tmp2[17]).useQuestTaskDetails(quest); const tmpResult45 = tmp(tmp2[17]); const userStatus = quest.userStatus; let enrolledAt; if (userStatus != null) { enrolledAt = userStatus.enrolledAt; } const tmp8 = closure_16(); const shrinkableText = tmp8; const diff = quest(tmp2[18])().width - 2 * hasWatchVideoOnMobileTasks; UserStore = diff; let result = 0.2803030303030303 * diff; QuestStore = result; let items = [quest, diff, result]; const memo = noop.useMemo(() => { const questAsset = AssetUtils.getQuestAsset(quest, AssetUtils.QuestAssetType.HERO); const obj2 = {}; const merged = Object.assign(questAsset); const obj3 = AssetUtils; if (questAsset.isAnimated) { const size = { assetUrl: questAsset.url, width: diff, height: result }; let url = obj3.getScaledFirstFrameImageUrl(size); if (url == null) { url = questAsset.url; } obj2.url = url; let tmp5 = obj2; } else { const size1 = { assetUrl: questAsset.url, width: diff, height: result }; obj2.url = obj3.getScaledImageUrl(size1); tmp5 = obj2; } return tmp5; }, items); const tmp10 = hasWatchVideoOnMobileTasks; const tmp7 = null != enrolledAt; const tmpResult46 = tmp(tmp2[17]); const questGameLogotypeAssetUrl = tmp(tmp2[20]).useQuestGameLogotypeAssetUrl(quest); const tmpResult47 = tmp(tmp2[20]); ({ gradientEnd, gradientStart, gradientMid } = product()); const tmp15 = product(); let items1 = [quest.id]; const tmp16 = sourceQuestContent(tmp(tmp2[21]).useRecyclingState(null, items1), 2); first = tmp16[0]; onPress = tmp18; let items2 = [tmp16[1]]; const callback = noop.useCallback(() => { closure_11(false); }, items2); let items3 = [first, quest.id, QUEST_HOME_MOBILE]; const effect = noop.useEffect(() => { if (false === first) { const obj2 = { name: MetricEvents.MetricEvents.QUEST_CONTENT_RENDERING_FAILURE, tags: null }; const _HermesInternal = HermesInternal; const items = ["quest_id:" + quest.id, , ]; const obj = MonitoringAgentDefault; const _HermesInternal2 = HermesInternal; items[1] = "quest_content:" + AnalyticsTypes.getQuestContentName(QUEST_HOME_MOBILE); items[2] = "reason:asset_loading_error"; obj2.tags = items; obj.increment(obj2); } }, items3); const tmpResult48 = tmp(tmp2[21]); const items4 = [UserStore]; const stateFromStores = tmp(tmp2[25]).useStateFromStores(items4, () => diff.getCurrentUser()); const tmpResult49 = tmp(tmp2[25]); const defaultRewardNameWithArticle = tmp(tmp2[26]).getDefaultRewardNameWithArticle(quest.config, stateFromStores); const tmpResult50 = tmp(tmp2[26]); const items5 = [QuestStore]; const stateFromStoresObject = tmp(tmp2[25]).useStateFromStoresObject(items5, () => ({ reward: QuestStore.getRewards(quest.id), isFetchingRewardCode: QuestStore.isFetchingRewardCode(quest.id), isClaimingReward: QuestStore.isClaimingReward(quest.id), isEnrolling: QuestStore.isEnrolling(quest.id), questEnrollmentBlockedUntil: QuestStore.questEnrollmentBlockedUntil })); ({ isFetchingRewardCode, isClaimingReward, questEnrollmentBlockedUntil } = stateFromStoresObject); const tmpResult51 = tmp(tmp2[25]); const userStatus2 = quest.userStatus; let completedAt; if (userStatus2 != null) { completedAt = userStatus2.completedAt; } const questFormattedDate = tmp(tmp2[17]).useQuestFormattedDate(completedAt, { year: "numeric", month: "long", day: "numeric" }); const tmpResult52 = tmp(tmp2[17]); const hasWatchVideoTasksResult = tmp(tmp2[27]).hasWatchVideoTasks(quest); const tmpResult53 = tmp(tmp2[27]); hasWatchVideoOnMobileTasks = tmp(tmp2[20]).useHasWatchVideoOnMobileTasks(quest.config); const userStatus3 = quest.userStatus; let enrolledAt1; if (userStatus3 != null) { enrolledAt1 = userStatus3.enrolledAt; } const userStatus4 = quest.userStatus; let completedAt1; if (userStatus4 != null) { completedAt1 = userStatus4.completedAt; } let tmp91Result10 = null != completedAt1; const userStatus5 = quest.userStatus; let claimedAt; if (userStatus5 != null) { claimedAt = userStatus5.claimedAt; } closure_16 = tmp34; const tmpResult54 = tmp(tmp2[20]); const isQuestExpiredResult = tmp(tmp2[28]).isQuestExpired(quest); const tmpResult55 = tmp(tmp2[28]); const isQuestExpiredButWithinThirtyDayLookback = tmp(tmp2[28]).getIsQuestExpiredButWithinThirtyDayLookback(quest); const tmpResult56 = tmp(tmp2[28]); const tmpResult57 = tmp(tmp2[29]); const tmp37 = quest(tmp2[30])(); const isThemeDarkResult = tmp(tmp2[11]).isThemeDark(tmp37); const tmpResult58 = tmp(tmp2[11]); const result1 = tmp(tmp2[26]).hasCollectiblesQuestReward(quest.config); const tmpResult59 = tmp(tmp2[26]); let skuId = null; if (result1) { skuId = null; if (tmp91Result10) { skuId = tmpResult57.getDefaultReward(quest.config).skuId; } } const fetchCollectiblesProduct = tmp(tmp2[31]).useFetchCollectiblesProduct(skuId); product = fetchCollectiblesProduct.product; const isFetching = fetchCollectiblesProduct.isFetching; const tmpResult60 = tmp(tmp2[31]); const items6 = [UserStore]; const currentUserHasVerifiedEmailOrPhone = tmp(tmp2[25]).useStateFromStores(items6, () => { const currentUser = diff.getCurrentUser(); result = undefined; if (currentUser != null) { result = currentUser.hasVerifiedEmailOrPhone(); } return result; }); const tmpResult61 = tmp(tmp2[25]); const items7 = [UserStore]; const currentUserHasVerifiedEmail = tmp(tmp2[25]).useStateFromStores(items7, () => { const currentUser = diff.getCurrentUser(); let verified; if (currentUser != null) { verified = currentUser.verified; } return verified; }); const tmpResult62 = tmp(tmp2[25]); const mobileActivityQuest = tmp(tmp2[20]).useMobileActivityQuest(quest); const isMobileActivityQuest = mobileActivityQuest.isMobileActivityQuest; const launchMobileActivity = mobileActivityQuest.launchMobileActivity; const tmpResult63 = tmp(tmp2[20]); const token = tmp(tmp2[32]).useToken(tmp9(tmp2[9]).colors.BACKGROUND_BASE_LOWER); const tmpResult64 = tmp(tmp2[32]); const token1 = tmp(tmp2[32]).useToken(tmp9(tmp2[9]).colors.BACKGROUND_BASE_LOW); const tmpResult65 = tmp(tmp2[32]); let tmp46 = null != questEnrollmentBlockedUntil; const token2 = tmp(tmp2[32]).useToken(tmp9(tmp2[9]).colors.BACKGROUND_BASE_LOWEST); if (tmp46) { tmp46 = !tmp30; } if (tmp46) { tmp46 = !tmp91Result10; } if (tmp46) { tmp46 = !tmp34; } const tmpResult66 = tmp(tmp2[32]); const isQuestAccessSuspended = tmp(tmp2[17]).useIsQuestAccessSuspended(); let obj3 = { disabled: true, onPressDisabled() { closure_6({ questId: quest.id, questContent: QUEST_HOME_MOBILE, questContentCTA: AnalyticsTypes.QuestContentCTA.QUEST_ACCESS_SUSPENDED, sourceQuestContent }); openQuestAccessSuspendedBottomSheetDefault(); } }; const tmpResult67 = tmp(tmp2[17]); const questFormattedDate1 = tmp(tmp2[17]).useQuestFormattedDate(quest.config.expiresAt, { month: "numeric", day: "numeric" }); const tmpResult68 = tmp(tmp2[17]); const getQuestImpressionId = tmp(tmp2[34]).useGetQuestImpressionId(); const items8 = [quest, QUEST_HOME_MOBILE, getQuestImpressionId, sourceQuestContent]; const callback1 = obj7.useCallback(() => { const obj = QuestPlatformUtils; obj.openGameLinkDirectly(quest, { content: QUEST_HOME_MOBILE, ctaContent: AnalyticsTypes.QuestContentCTA.OPEN_GAME_LINK, impressionId: getQuestImpressionId(), sourceQuestContent }); }, items8); const tmpResult69 = tmp(tmp2[34]); const primaryCtaCopy = tmp(tmp2[43]).usePrimaryCtaCopy({ quest, application: mobileActivityQuest.questApplication, shortText: true }); if (null != product) { const styles2 = product.styles; let buttonColors; if (styles2 != null) { buttonColors = styles2.buttonColors; } if (buttonColors == null) { buttonColors = []; } let obj4 = { buttonColors, confettiColors: null, backgroundColors: null }; const styles = product.styles; let confettiColors; if (styles != null) { confettiColors = styles.confettiColors; } if (confettiColors == null) { confettiColors = []; } obj4.confettiColors = confettiColors; const items9 = [tmp9(tmp2[44])(token1), tmp9(tmp2[44])(token), tmp9(tmp2[44])(token2)]; obj4.backgroundColors = items9; product.styles = obj4; } if (null != claimedAt) { let obj5 = { text: null, loading: null, onPress: null }; let intl4 = tmp(tmp2[45]).intl; obj5.text = intl4.string(tmp(tmp2[45]).t.vTgCWx); obj5.loading = isFetching; obj5.onPress = function onPress() { trackClick(AnalyticsTypes.QuestContentCTA.SHOW_REWARD); QuestUtils.viewReward({ product, quest, questContent: QUEST_HOME_MOBILE, questContentPosition, sourceQuestContent }); }; let obj12 = obj5; } else { if (tmp91Result10) { let obj6 = { text: null, loading: null, onPress: null }; let intl3 = tmp(tmp2[45]).intl; obj6.text = intl3.string(tmp(tmp2[45]).t.cfY4PE); if (!isClaimingReward) { isClaimingReward = isFetchingRewardCode; } if (!isClaimingReward) { isClaimingReward = isFetching; } obj6.loading = isClaimingReward; obj6.onPress = function onPress() { trackClick(AnalyticsTypes.QuestContentCTA.CLAIM_REWARD); result = QuestUtils.handleRewardClaimThenView({ product, quest, questContent: QUEST_HOME_MOBILE, questContentPosition, currentUserHasVerifiedEmailOrPhone, currentUserHasVerifiedEmail, sourceQuestContent }); }; let tmp69 = null; if (isQuestAccessSuspended) { tmp69 = obj3; } let merged = Object.assign(tmp69); obj12 = obj6; } if (isQuestExpiredResult) { let obj8 = { text: null, loading: null, disabled: true, variant: "secondary", onPress: null }; let intl2 = tmp(tmp2[45]).intl; let obj9 = { expiryDate: questFormattedDate1 }; obj8.text = intl2.formatToPlainString(tmp(tmp2[45]).t["6p8BZx"], obj9); let tmp67 = isClaimingReward; if (!isClaimingReward) { tmp67 = isFetchingRewardCode; } if (!tmp67) { tmp67 = isFetching; } obj8.loading = tmp67; obj8.onPress = onPress; obj12 = obj8; } else { if (tmp30) { if (hasWatchVideoTasksResult) { let obj10 = { text: tmp(tmp2[47]).getVideoQuestWatchCtaText(questTaskDetails), accessibilityLabel: null, disabled: false, onPress: null }; const tmpResult71 = tmp(tmp2[47]); obj10.accessibilityLabel = tmp(tmp2[47]).getVideoQuestWatchCtaAccessibilityLabel(questTaskDetails); obj10.onPress = function onPress() { logger.log("Navigating to video quest bottom sheet"); trackClick(AnalyticsTypes.QuestContentCTA.WATCH_VIDEO); if (hasWatchVideoOnMobileTasks) { const obj = { questId: quest.id, sourceQuestContent }; tmp5(15205)(obj); } else { const obj2 = { questId: quest.id, questContentPosition, sourceQuestContent }; tmp5(4603).openLazy(asyncRequireImpl(15201, dependencyMap.paths), "QuestBottomSheet", obj2); const tmp5Result = tmp5(4603); } }; let tmp63 = null; if (isQuestAccessSuspended) { tmp63 = obj3; } let merged1 = Object.assign(tmp63); obj12 = obj10; const tmpResult72 = tmp(tmp2[47]); } } if (tmp30) { if (isMobileActivityQuest) { let obj11 = { text: primaryCtaCopy, icon: tmp(tmp2[46]).getPrimaryCtaIcon(quest), disabled: false, onPress() { trackClick(AnalyticsTypes.QuestContentCTA.LAUNCH_MOBILE_ACTIVITY); callback3(); } }; let tmp59 = null; if (isQuestAccessSuspended) { tmp59 = obj3; } let merged2 = Object.assign(tmp59); obj12 = obj11; const tmpResult73 = tmp(tmp2[46]); } } if (tmp30) { if (!hasWatchVideoTasksResult) { if (!isMobileActivityQuest) { obj12 = { text: null, variant: "secondary", disabled: false, onPress: null }; let intl = tmp(tmp2[45]).intl; obj12.text = intl.string(tmp(tmp2[45]).t.JiosAn); obj12.onPress = function onPress() { logger.log("Navigating to console connection action sheet"); trackClick(AnalyticsTypes.QuestContentCTA.VIEW_REQUIREMENTS); ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(15201, dependencyMap.paths), "QuestBottomSheet", { questId: quest.id, questContentPosition, sourceQuestContent }); }; } } } let obj13 = { text: primaryCtaCopy, disabled: false, loading: stateFromStoresObject.isEnrolling, accessibilityLabel: null, icon: null, onPress: null }; let videoQuestWatchCtaAccessibilityLabel; if (hasWatchVideoTasksResult) { videoQuestWatchCtaAccessibilityLabel = tmp(tmp2[47]).getVideoQuestWatchCtaAccessibilityLabel(questTaskDetails); const tmpResult74 = tmp(tmp2[47]); } obj13.accessibilityLabel = videoQuestWatchCtaAccessibilityLabel; let primaryCtaIcon; if (isMobileActivityQuest) { primaryCtaIcon = tmp(tmp2[46]).getPrimaryCtaIcon(quest); const tmpResult75 = tmp(tmp2[46]); } obj13.icon = primaryCtaIcon; closure_25 = asyncGeneratorStep(async (arg0, value) => { if (dependencyMap === 2) { dependencyMap = 3; throw new TypeError("Generator functions may not be called on executing generators"); } else if (tmp4 === 3) { if (arg0 === 1) { throw value; } else if (arg0 === 2) { const obj2 = { value, done: true }; return obj2; } else { return { value: "HermesInternal", done: null }; } } else { try { dependencyMap = 2; if (0 === v1) { if (arg0 === 1) { dependencyMap = 3; throw value; } else if (arg0 === 2) { dependencyMap = 3; const obj3 = { value, done: true }; return obj3; } else { logger.log("Enrolling in quest"); tmp2(11413); let obj4 = { questContent: QUEST_HOME_MOBILE, questContentCTA: null, sourceQuestContent: null }; if (!isMobileActivityQuest) { if (!hasWatchVideoTasksResult) { let START_QUEST = tmp30(7830).QuestContentCTA.ACCEPT_QUEST; } obj4.questContentCTA = START_QUEST; obj4.sourceQuestContent = sourceQuestContent; obj4 = tmp33(tmp35, obj4); v1 = 1; dependencyMap = 1; } START_QUEST = tmp30(7830).QuestContentCTA.START_QUEST; } } else if (arg0 === 1) { dependencyMap = 3; throw value; } else if (arg0 === 2) { dependencyMap = 3; const obj5 = { value, done: true }; return obj5; } else { if (closure_128_14) { if (closure_128_15) { const obj = { questId: closure_128_1.id, sourceQuestContent: closure_128_4 }; v1(15205)(obj); dependencyMap = 3; } closure_128_32(); } if (!closure_128_20) { closure_128_24(); } } } catch (tmp21) { dependencyMap = tmp; throw tmp21; } } }); obj13.onPress = function() { const self = this; const apply = closure_25.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; }; let tmp55 = null; if (isQuestAccessSuspended) { tmp55 = obj3; } let merged3 = Object.assign(tmp55); obj12 = obj13; } } const intl5 = tmp(tmp2[45]).intl; let obj14 = { questName: quest.config.messages.questName }; const tmpResult70 = tmp(tmp2[43]); const formatToPlainStringResult = intl5.formatToPlainString(tmp(tmp2[45]).t.EAYZAr, { questName: quest.config.messages.questName }); const result2 = tmp(tmp2[26]).hasVirtualCurrencyReward(quest.config); const tmpResult76 = tmp(tmp2[26]); const questOrbMultiplierEligibility = tmp(tmp2[50]).useQuestOrbMultiplierEligibility(); const tmpResult77 = tmp(tmp2[50]); let shouldShowBonusOrbsUX = tmp(tmp2[17]).useShouldShowBonusOrbsUX(quest, questOrbMultiplierEligibility); let tmp77 = shouldShowBonusOrbsUX; if (shouldShowBonusOrbsUX) { tmp77 = questOrbMultiplierEligibility === tmp(tmp2[51]).QuestOrbMultiplierEligibilityType.NITRO; } const userStatus6 = quest.userStatus; let orbQuantityClaimed; if (userStatus6 != null) { orbQuantityClaimed = userStatus6.orbQuantityClaimed; } if (orbQuantityClaimed == null) { orbQuantityClaimed = tmp(tmp2[26]).getVirtualCurrencyRewardOrbQuantity(quest.config); const tmpResult79 = tmp(tmp2[26]); } const tmpResult78 = tmp(tmp2[17]); const questOrbRewardQuantityForUser = tmp(tmp2[26]).getQuestOrbRewardQuantityForUser(quest.config, stateFromStores); const tmpResult80 = tmp(tmp2[26]); const defaultRewardName = tmp(tmp2[26]).getDefaultRewardName(quest.config, stateFromStores); const tmpResult81 = tmp(tmp2[26]); const fontScale = tmp(tmp2[52]).useFontScale(); const tmpResult82 = tmp(tmp2[52]); const scaledTextLineHeight = tmp(tmp2[53]).useScaledTextLineHeight("text-md/semibold"); const tmpResult83 = tmp(tmp2[53]); const questDescription = tmp(tmp2[43]).useQuestDescription(quest, sourceQuestContent, tmp4.QUEST_HOME_MOBILE, tmp(tmp2[54]).GameProfileSources.QuestHome); const result3 = 16 * Math.min(fontScale, 1.3); const items10 = [null != claimedAt, result2, questOrbRewardQuantityForUser, orbQuantityClaimed, defaultRewardName, defaultRewardNameWithArticle, result3, scaledTextLineHeight, , , ]; ({ orbWithAmountRow: arr13[8], rewardSubtitleRow: arr13[9], shrinkableText: arr13[10] } = tmp8); let tmp86 = isQuestExpiredResult; const memo1 = obj7.useMemo(() => { let num = 0; if (obj.isAndroid()) { num = 16 / scaledTextLineHeight; } result = tmp / 8; const obj2 = { variant: "text-md/semibold", color: "mobile-text-heading-primary", style: shrinkableText.shrinkableText }; const size = { width: tmp, height: tmp, marginRight: result, marginTop: 0, transform: null }; const items = [{ translateY: num }]; size.transform = items; if (closure_16) { if (result2) { const obj3 = { style: tmp6.orbWithAmountRow, children: null }; const obj4 = { size: "custom", color: "mobile-text-heading-primary", style: size }; const items1 = [closure_2_12(tmp2(8962).OrbsIcon, obj4), , ]; const obj5 = { style: null }; const obj6 = { width: result }; obj5.style = obj6; items1[1] = closure_2_12(React5, obj5); const obj7 = {}; const merged = Object.assign(obj2); const intl4 = tmp2(1114).intl; let num4 = orbQuantityClaimed; if (orbQuantityClaimed == null) { num4 = 0; } const obj8 = { orbAmount: num4 }; obj7.children = intl4.format(tmp2(1114).t["nLXlh+"], obj8); items1[2] = closure_2_12(tmp2(4632).Text, obj7); obj3.children = items1; let tmp15Result = map1(React5, obj3); } return tmp15Result; } if (closure_16) { const obj9 = {}; const merged1 = Object.assign(obj2); obj9.children = defaultRewardName; tmp15Result = closure_2_12(tmp2(4632).Text, obj9); } else if (result2) { const obj10 = { style: tmp6.rewardSubtitleRow, children: null }; const obj11 = {}; const merged2 = Object.assign(obj2); const intl2 = tmp2(1114).intl; const obj12 = { rewardWithArticleHook() { return null; } }; obj11.children = intl2.format(tmp2(1114).t["0IUT4Y"], obj12); const items2 = [closure_2_12(tmp2(4632).Text, obj11), ]; const obj13 = { style: tmp6.orbWithAmountRow, children: null }; const obj14 = { size: "custom", color: "mobile-text-heading-primary", style: size }; const items3 = [closure_2_12(tmp2(8962).OrbsIcon, obj14), , ]; const obj15 = { style: null }; const obj16 = { width: result }; obj15.style = obj16; items3[1] = closure_2_12(React5, obj15); const obj17 = {}; const merged3 = Object.assign(obj2); const intl3 = tmp2(1114).intl; let num3 = questOrbRewardQuantityForUser; if (questOrbRewardQuantityForUser == null) { num3 = 0; } const obj18 = { orbAmount: num3 }; obj17.children = intl3.format(tmp2(1114).t["nLXlh+"], obj18); items3[2] = closure_2_12(tmp2(4632).Text, obj17); obj13.children = items3; items2[1] = map1(React5, obj13); obj10.children = items2; tmp15Result = tmp15(tmp16, obj10); } else { const obj19 = {}; const merged4 = Object.assign(obj2); const intl = tmp2(1114).intl; const obj20 = { rewardWithArticleHook() { return defaultRewardNameWithArticle; } }; obj19.children = intl.format(tmp2(1114).t["0IUT4Y"], obj20); tmp15Result = closure_2_12(tmp2(4632).Text, obj19); } }, items10); if (isQuestExpiredResult) { tmp86 = tmp91Result10; } if (tmp86) { tmp86 = !tmp34; } let formatToPlainStringResult1 = questDescription; if (tmp86) { const intl6 = tmp(tmp2[45]).intl; let obj15 = { date: questFormattedDate }; formatToPlainStringResult1 = intl6.formatToPlainString(tmp(tmp2[45]).t["l1jCM/"], obj15); } const tmpResult84 = tmp(tmp2[43]); const items11 = [quest.id, sourceQuestContent]; const ctaLink = tmp(tmp2[29]).getCtaLink(quest.config); const callback2 = obj7.useCallback(() => { const obj = { questId: quest.id, initialStep: VideoQuestModal.VideoQuestModalSteps.WATCH_VIDEO, sourceQuestContent }; openVideoQuestModalDefault(obj); }, items11); const items12 = [launchMobileActivity]; const callback3 = obj7.useCallback(asyncGeneratorStep(async (arg0, value) => { if (v3 === 2) { v3 = 3; throw new TypeError("Generator functions may not be called on executing generators"); } else if (tmp3 === 3) { if (arg0 === 1) { throw value; } else if (arg0 === 2) { const obj3 = { value, done: true }; return obj3; } else { return { value: "HermesInternal", done: null }; } } else { try { v3 = 2; if (0 === c1) { if (arg0 === 1) { v3 = 3; throw value; } else if (arg0 === 2) { v3 = 3; const obj4 = { value, done: true }; return obj4; } else { result = v3(QUEST_HOME_MOBILE[46]).dismissOverlayScreens(); c1 = 1; v3 = 1; const obj5 = { value: launchMobileActivity(), done: false }; return obj5; } } else if (arg0 === 1) { v3 = 3; throw value; } else if (arg0 === 2) { v3 = 3; const obj = { value, done: true }; return obj; } else { v3 = 3; return { value: "HermesInternal", done: null }; } } catch (tmp9) { v3 = tmp; throw tmp9; } } }), items12); let obj16 = { style: null, onLayout(arg0) { if (require != null) { tmp(arg0, quest.id); } }, children: null }; const items13 = [tmp8.container, { marginHorizontal: tmp10 - questContent.containerPadding }]; obj16.style = items13; let obj17 = { visible: tmp77, glow: true, children: null }; let obj18 = { style: null, children: null }; const items14 = [tmp8.heroContainer, { minHeight: result, backgroundColor: gradientEnd }]; obj18.style = items14; const tmpResult85 = tmp(tmp2[29]); const items15 = [defaultRewardNameWithArticle(quest(tmp2[61]), { source: { uri: memo.url }, style: tmp8.heroImg, onError: callback, accessible: true, accessibilityRole: "image", accessibilityLabel: quest.config.messages.questName }), , , ]; let obj20 = { style: tmp8.heroLinearGradientOverlay, start: null, end: null, colors: null }; let obj19 = { source: { uri: memo.url }, style: tmp8.heroImg, onError: callback, accessible: true, accessibilityRole: "image", accessibilityLabel: quest.config.messages.questName }; const tmp9Result = quest(tmp2[60]); obj20.start = tmp(tmp2[63]).VerticalGradient.START; obj20.end = tmp(tmp2[63]).VerticalGradient.END; const items16 = [gradientStart, gradientMid, gradientEnd]; obj20.colors = items16; items15[1] = defaultRewardNameWithArticle(quest(tmp2[62]), obj20); let preview = quest.preview; if (preview) { const obj21 = { style: tmp8.previewBadge, children: null }; const obj22 = { variant: badgeTextVariant, color: "text-overlay-light", style: tmp8.previewBadgeText, children: null }; const intl7 = tmp(tmp2[45]).intl; obj22.children = intl7.string(tmp(tmp2[45]).t.SKNnqq); obj21.children = tmp91(tmp(tmp2[57]).Text, obj22); preview = tmp91(tmp94, obj21); } items15[2] = preview; const obj23 = { style: tmp8.heroFooterContainer, children: null }; const obj24 = { style: tmp8.heroFooterLeftContainer, children: null }; const items17 = [defaultRewardNameWithArticle(quest(tmp2[64]), { assetUrl: questGameLogotypeAssetUrl, onError: callback }), ]; const obj25 = { style: tmp8.promotedByRow, children: null }; let str = "text-overlay-light"; let str2 = "text-overlay-light"; if (isThemeDarkResult) { str2 = "text-muted"; } const obj26 = { variant: "text-xs/medium", color: str2, style: tmp8.shrinkableText, children: null }; const intl8 = tmp(tmp2[45]).intl; obj26.children = intl8.string(tmp(tmp2[45]).t.VAbKhK); const items18 = [defaultRewardNameWithArticle(tmp(tmp2[57]).Text, obj26), , ]; const obj27 = { source: quest(tmp2[65]), style: { height: 16, width: 16 }, accessible: true, accessibilityRole: "image", accessibilityLabel: null }; const intl9 = tmp(tmp2[45]).intl; obj27.accessibilityLabel = intl9.string(tmp(tmp2[45]).t.OfMjx9); items18[1] = defaultRewardNameWithArticle(closure_6, obj27); items18[2] = defaultRewardNameWithArticle(tmp(tmp2[57]).Text, { variant: "text-xs/medium", color: "text-overlay-light", style: tmp8.shrinkableText, children: quest.config.messages.gamePublisher }); obj25.children = items18; items17[1] = questEnrollmentBlockedUntil(shrinkableText, obj25); obj24.children = items17; const items19 = [questEnrollmentBlockedUntil(shrinkableText, obj24), ]; let tmp91Result = !isQuestExpiredResult; if (!isQuestExpiredResult) { tmp91Result = !tmp34; } if (tmp91Result) { if (isThemeDarkResult) { str = "text-default"; } const obj29 = { variant: "text-xs/medium", color: str, style: tmp8.shrinkableText, children: null }; const intl10 = tmp(tmp2[45]).intl; const obj30 = { expiryDate: questFormattedDate1 }; obj29.children = intl10.format(tmp(tmp2[45]).t["7D8r4F"], obj30); tmp91Result = tmp91(tmp(tmp2[57]).Text, obj29); } items19[1] = tmp91Result; obj23.children = items19; items15[3] = questEnrollmentBlockedUntil(shrinkableText, obj23); obj18.children = items15; const items20 = [questEnrollmentBlockedUntil(shrinkableText, obj18), , ]; const obj31 = { style: tmp8.detailsWrapper, children: null }; const obj32 = { style: tmp8.detailsContainer, children: null }; const obj33 = { style: tmp8.rewardImgContainer, children: null }; if (tmp7) { const obj34 = { quest, progress: tmpResult46.useQuestCompletionDetails(quest).completedRatio, size: "sm" }; let tmp91Result6 = tmp91(tmp9(tmp2[66]), obj34); } else { let size = { quest, height: 64, width: 64 }; tmp91Result6 = tmp91(tmp9(tmp2[67]), size); } obj33.children = tmp91Result6; const items21 = [defaultRewardNameWithArticle(shrinkableText, obj33), ]; const obj35 = { style: tmp8.detailsTextContainer, children: null }; const items22 = [defaultRewardNameWithArticle(tmp(tmp2[57]).Text, { variant: "eyebrow", color: "text-brand", style: tmp8.questName, accessibilityRole: "header", children: formatToPlainStringResult }), ]; const obj37 = { style: tmp8.bodyContainer, children: null }; const obj38 = { style: tmp8.subtitleRow, children: null }; const items23 = [memo1, ]; if (shouldShowBonusOrbsUX) { const obj39 = { questId: quest.config.id, orbMultiplierEligibility: questOrbMultiplierEligibility }; shouldShowBonusOrbsUX = tmp91(tmp(tmp2[68]).QuestOrbMultiplierPerkPill, obj39); } items23[1] = shouldShowBonusOrbsUX; obj38.children = items23; const items24 = [questEnrollmentBlockedUntil(shrinkableText, obj38), ]; let tmp91Result7 = null != formatToPlainStringResult1; if (tmp91Result7) { const obj40 = { variant: "text-sm/medium", color: "text-muted", children: formatToPlainStringResult1 }; tmp91Result7 = tmp91(tmp(tmp2[57]).Text, obj40); } items24[1] = tmp91Result7; obj37.children = items24; items22[1] = questEnrollmentBlockedUntil(shrinkableText, obj37); obj35.children = items22; items21[1] = questEnrollmentBlockedUntil(shrinkableText, obj35); obj32.children = items21; obj31.children = questEnrollmentBlockedUntil(shrinkableText, obj32); items20[1] = defaultRewardNameWithArticle(shrinkableText, obj31); const obj41 = { direction: "horizontal", align: "center", spacing: quest(tmp2[9]).space.PX_8, style: tmp8.buttonContainers, children: null }; const obj42 = { children: null }; if (tmp46) { const obj43 = { grow: true, onPress, variant: "secondary", disabled: true, text: null }; const intl11 = tmp(tmp2[45]).intl; obj43.text = intl11.string(tmp(tmp2[45]).t.V293qn); const items25 = [tmp91(tmp(tmp2[70]).Button, obj43), ]; const obj44 = { onPress() { ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(15249, dependencyMap.paths), "QuestEnrollmentBlockedBottomSheet", { questId: quest.id, questEnrollmentBlockedUntil, sourceQuestContent }); }, variant: "tertiary", text: null }; const intl12 = tmp(tmp2[45]).intl; obj44.text = intl12.string(tmp(tmp2[45]).t.vY9GgG); items25[1] = tmp91(tmp(tmp2[70]).Button, obj44); obj42.children = items25; let tmp104 = obj42; } else { let tmp91Result8 = "" !== ctaLink && !tmp46 && !isQuestExpiredResult && !tmp34 && !tmp91Result10; if (tmp91Result8) { const obj45 = { style: tmp8.equalWidthContainer, children: null }; const obj46 = { grow: true, variant: "secondary", text: tmp(tmp2[29]).getExternalCtaLabel(quest), onPress: callback1 }; obj45.children = tmp91(tmp(tmp2[70]).Button, obj46); tmp91Result8 = tmp91(tmp94, obj45); const tmpResult86 = tmp(tmp2[29]); } const items26 = [tmp91Result8, ]; const obj47 = { style: tmp8.equalWidthContainer, children: null }; const obj48 = { grow: true }; let merged4 = Object.assign(obj12); obj47.children = tmp91(tmp(tmp2[70]).Button, obj48); items26[1] = tmp91(tmp94, obj47); obj42.children = items26; tmp104 = obj42; } const items27 = [questEnrollmentBlockedUntil(hasWatchVideoTasksResult, tmp104), , , ]; let tmp91Result9 = tmp91Result10; if (tmp91Result10) { tmp91Result9 = hasWatchVideoTasksResult; } if (tmp91Result9) { tmp91Result9 = hasWatchVideoOnMobileTasks; } if (tmp91Result9) { const obj49 = { accessibilityLabel: null, icon: null, onPress: null, variant: "secondary" }; const intl13 = tmp(tmp2[45]).intl; obj49.accessibilityLabel = intl13.string(tmp(tmp2[45]).t.YsCuyF); obj49.icon = tmp9(tmp2[73]); obj49.onPress = callback2; tmp91Result9 = tmp91(tmp(tmp2[72]).IconButton, obj49); } items27[1] = tmp91Result9; if (tmp91Result10) { tmp91Result10 = isMobileActivityQuest; } if (tmp91Result10) { const obj50 = { accessibilityLabel: null, icon: null, onPress: null, variant: "secondary" }; const intl14 = tmp(tmp2[45]).intl; obj50.accessibilityLabel = intl14.string(tmp(tmp2[45]).t.CkUzLd); obj50.icon = tmp9(tmp2[73]); obj50.onPress = callback3; tmp91Result10 = tmp91(tmp(tmp2[72]).IconButton, obj50); } items27[2] = tmp91Result10; items27[3] = defaultRewardNameWithArticle(quest(tmp2[74]), { quest, showShareLink: !isQuestExpiredResult, location: first.QUESTS_CARD, sourceQuestContent }); obj41.children = items27; items20[2] = questEnrollmentBlockedUntil(tmp(tmp2[69]).Stack, obj41); obj17.children = items20; obj16.children = questEnrollmentBlockedUntil(tmp9Result, obj17); return defaultRewardNameWithArticle(tmp(tmp2[59]).Card, obj16); });