704 lines
39 KiB
TypeScript
704 lines
39 KiB
TypeScript
/* Metro module 13514; source: modules/quests/native/QuestHome.tsx; dependencies: [57, 31, 27, 4502, 9481, 7093, 7115, 6528, 661, 33, 4501, 697, 566, 1484, 13515, 694, 9535, 9534, 13555, 4578, 1244, 5080, 7007, 9483, 9530, 4573, 5278, 13557, 4068, 13559, 9479, 1585, 7091, 9484, 7121, 3857, 8947, 683, 8742, 480, 13566, 4127, 9528, 1485, 7114, 8416, 10183, 6531, 13567, 2] */
|
|
function _fun102639(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6, offset: 0x022431ad, size: 678 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value2.View;
|
|
const env0_6 = value2.ActivityIndicator;
|
|
const StyleSheet = value2.StyleSheet;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const questHomeNavigationStore = importDefault(9481) /* metro dependency 9481: QuestHomeNavigationStore */;
|
|
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
|
|
const questUtmStore = importDefault(7115) /* metro dependency 7115: QuestUtmStore */;
|
|
const env0_11 = (require(6528) /* metro dependency 6528: QuestConstants */).QuestsExperimentLocations;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_12 = constantsModule.AnalyticEvents;
|
|
const env0_13 = constantsModule.UserSettingsSections;
|
|
const value4 = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value4.jsx;
|
|
const env0_15 = value4.jsxs;
|
|
const env0_16 = value4.Fragment;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
object2.container = {flex: 1};
|
|
const object5 = {};
|
|
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
|
|
object5['justifyContent'] = 'center';
|
|
object5['alignItems'] = 'center';
|
|
object2.loadingContainer = object5;
|
|
const object7 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object7.marginBottom = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object7.paddingHorizontal = PX_16;
|
|
object2.sectionHeader = object7;
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object2.sectionHeaderRow = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_4};
|
|
const object8 = {};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object8.marginBottom = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object8.paddingHorizontal = PX_16;
|
|
object8.backgroundColor = 'transparent';
|
|
object2.previewButton = object8;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object2.sectionHeaderWithTag = {gap: PX_4};
|
|
const env0_17 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
const env0_18 = value.memo(_fun102646);
|
|
value = value.memo(QuestHome);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestHome.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function EmptyStateNoQuestsAvailable() { // fn#102640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:813, offset: 0x02243453, size: 197 bytes, params: 1, frame: 22
|
|
const value3 = env0_4.useCallback(_fun102641,
|
|
[(require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation()]);
|
|
const QuestHomeEmptyState = importDefault(13555) /* metro dependency 13555: QuestHomeEmptyState */;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<QuestHomeEmptyState
|
|
action={<Button variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/g10LC'])} onPress={value3} />}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function EmptyStateFiltered({onClearFilters}) { // fn#102642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1048, offset: 0x0224352b, size: 251 bytes, params: 2, frame: 23
|
|
const QuestHomeEmptyState = importDefault(13555) /* metro dependency 13555: QuestHomeEmptyState */;
|
|
const object2 = {};
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
object2.action = <Button variant="secondary" text={Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t.urZl31])} onPress={onClearFilters} />;
|
|
string = intl.string;
|
|
const PBfFnx = (require(1244) /* metro dependency 1244: indexNative */).t.PBfFnx;
|
|
object2.title = Reflect.apply(string, intl, [PBfFnx]);
|
|
object2.subtitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nwdKFC);
|
|
return <QuestHomeEmptyState {...object2} />;
|
|
}
|
|
|
|
function HeaderPreviewButton() { // fn#102643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1315, offset: 0x02243626, size: 217 bytes, params: 1, frame: 22
|
|
var r0;
|
|
var Button;
|
|
var intl;
|
|
const styles = useStyles();
|
|
if ((require(9483) /* metro dependency 9483: QuestHooks */).useShouldShowPreviewToolTab()) {
|
|
var viewBindingProps = {style: styles.previewButton};
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
var buttonProps = {'grow': true, 'onPress': null, 'variant': 'primary', onPress: env0_4.useCallback(function() {
|
|
importDefault(dependencyMap[21]).popAll();
|
|
require(dependencyMap[22]).openUserSettings({screen: UserSettingsSections.QUEST_PREVIEW_TOOL_2});
|
|
}, [])};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
buttonProps.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tx5Ax5);
|
|
r0 = <View {...viewBindingProps}><Button {...buttonProps} /></View>;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function HeaderWithBounties() { // fn#102645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1652, offset: 0x02243750, size: 662 bytes, params: 1, frame: 31
|
|
var r5;
|
|
var object2;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items3;
|
|
var PressableOpacity;
|
|
var object4;
|
|
const styles = useStyles();
|
|
const BountiesStage1Experiment = (require(9530) /* metro dependency 9530: BountiesStage1Experiment */).BountiesStage1Experiment;
|
|
const useConfig = BountiesStage1Experiment.useConfig;
|
|
const QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
|
|
const verticalScrollEnabled = Reflect.apply(useConfig, BountiesStage1Experiment,
|
|
[{location: QUEST_HOME_MOBILE}]).verticalScrollEnabled;
|
|
const jsxRuntimeEnv0_16Binding = jsxRuntimeEnv0_16;
|
|
const items2 = [<HeaderPreviewButton />];
|
|
if (verticalScrollEnabled) {
|
|
r5 = !verticalScrollEnabled;
|
|
} else {
|
|
var viewProps = {style: [styles.sectionHeader, styles.sectionHeaderRow]};
|
|
string = intl.string;
|
|
items3 = [<Text variant="text-lg/bold">{Reflect.apply(string, intl, [t.qetVDw])}</Text>];
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
var pressableOpacityProps = {onPress: importDefault(13557) /* metro dependency 13557: openBountiesNuxPromoSheet */,
|
|
|
|
hitSlop: 14};
|
|
string = intl.string;
|
|
pressableOpacityProps['aria-label'] = Reflect.apply(string, intl, [t.hvVgAZ]);
|
|
pressableOpacityProps.accessibilityRole = 'button';
|
|
items3[1] = <PressableOpacity {...pressableOpacityProps}>{((CircleInformationIcon) => <CircleInformationIcon size="xs" color={(importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE} />)((require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon)}</PressableOpacity>;
|
|
r5 = <View {...viewProps}>{items3}</View>;
|
|
}
|
|
items2[1] = r5;
|
|
items2[2] = ((Component) => <Component verticalScrollEnabled={verticalScrollEnabled} />)(importDefault(13559) /* metro dependency 13559: QuestHomeBounties */);
|
|
const items4 = [styles.sectionHeader];
|
|
items4[1] = styles.sectionHeaderWithTag;
|
|
string = intl.string;
|
|
const JALI2K = (require(1244) /* metro dependency 1244: indexNative */).t.JALI2K;
|
|
items2[3] = <View style={items4}><Text variant="text-lg/semibold" color="white">{Reflect.apply(string, intl,
|
|
[JALI2K])}</Text></View>;
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun102646({shouldShowBounties, onLayout}) { // fn#102646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2451, offset: 0x022439e6, size: 72 bytes, params: 2, frame: 16
|
|
return (
|
|
<View onLayout={onLayout}>
|
|
{((Component) => <Component />)(shouldShowBounties ? HeaderWithBounties : HeaderPreviewButton)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function QuestHome({containerStyle, isNavigationComplete, scrollToQuestId, filters, sortMethod, onClearFilters}) { // fn#102647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2593, offset: 0x02243a2e, size: 1507 bytes, params: 2, frame: 38
|
|
var object4;
|
|
var r1;
|
|
var r0;
|
|
const FlashList = (require(8416) /* metro dependency 8416: flashList */).FlashList;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const isEligibleForQuests = (require(9479) /* metro dependency 9479: QuestsEligibility */).getIsEligibleForQuests();
|
|
const styles = useStyles();
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const questHooksModule = require(9483) /* metro dependency 9483: QuestHooks */;
|
|
const useFilteredQuests = questHooksModule.useFilteredQuests;
|
|
const QuestTabs = questHooksModule.QuestTabs;
|
|
let ALL = QuestTabs.ALL;
|
|
const binding = env0_4;
|
|
const useMemo = binding.useMemo;
|
|
const value4 = Reflect.apply(useFilteredQuests, questHooksModule, [ALL, Reflect.apply(useMemo, binding,
|
|
[function() {
|
|
return {filters: filters, sortMethod: sortMethod};
|
|
}, [filters, sortMethod]])]);
|
|
const quests = value4.quests;
|
|
var env0_4 = quests;
|
|
const excludedQuests = value4.excludedQuests;
|
|
const isFetchingCurrentQuests = value4.isFetchingCurrentQuests;
|
|
const hasFetched = value4.hasFetched;
|
|
env0_4.useEffect(_fun102652, [(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([QuestStore],
|
|
_fun102649, [])]);
|
|
const env0_9 = env0_4.useRef(null);
|
|
const value7 = env0_4.useMemo(_fun102653, [scrollToQuestId, quests, excludedQuests]);
|
|
env0_4.useEffect(_fun102655, [scrollToQuestId, quests, excludedQuests, hasFetched, isFetchingCurrentQuests]);
|
|
const value8 = _fun102656({scrollToIndex: value7});
|
|
const scrollViewRef = value8.scrollViewRef;
|
|
const handleListScroll = value8.handleListScroll;
|
|
const handleListLayout = value8.handleListLayout;
|
|
const handleListLoad = value8.handleListLoad;
|
|
const env0_11 = value8.handleQuestCardLayout;
|
|
const handleHeaderLayout = value8.handleHeaderLayout;
|
|
const env0_13 = value8.visibilityRef;
|
|
const value9 = QuestUtmStore(function(a0) {
|
|
return a0.getUtmCurrentContext();
|
|
});
|
|
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
|
|
object4 = {};
|
|
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
|
const QUEST_HOME = ImpressionNames.QUEST_HOME;
|
|
object4.name = QUEST_HOME;
|
|
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
|
|
const VIEW = ImpressionTypes.VIEW;
|
|
object4.type = VIEW;
|
|
ALL = QuestTabs.ALL;
|
|
object4.properties = {utm_source_current: value9.utmSourceCurrent, utm_medium_current: value9.utmMediumCurrent,
|
|
utm_campaign_current: value9.utmCampaignCurrent, utm_content_current: value9.utmContentCurrent, tab: ALL};
|
|
defaultImport(object4);
|
|
env0_4.useEffect(_fun102667, [isEligibleForQuests]);
|
|
env0_4.useEffect(function() {
|
|
if (scrollViewRef.current != null && hasFetched) {
|
|
scrollViewRef.current.scrollToOffset({'offset': 0, 'animated': false});
|
|
}
|
|
}, [filters, sortMethod, hasFetched, scrollViewRef]);
|
|
questHooksModule.useQuestHomeSortingFilteringAnalytics({selectedSortMethod: sortMethod, selectedFilters: filters,
|
|
numQuestsVisible: quests.length});
|
|
const useVirtualCurrencyMobileEnabledModule = require(4127) /* metro dependency 4127: useVirtualCurrencyMobileEnabled */;
|
|
const useVirtualCurrencyMobileEnabled = useVirtualCurrencyMobileEnabledModule.useVirtualCurrencyMobileEnabled;
|
|
const enabled = Reflect.apply(useVirtualCurrencyMobileEnabled, useVirtualCurrencyMobileEnabledModule, []).enabled;
|
|
const QuestHomeBountiesExperiment = (require(9528) /* metro dependency 9528: QuestHomeBountiesExperiment */).QuestHomeBountiesExperiment;
|
|
const useConfig = QuestHomeBountiesExperiment.useConfig;
|
|
object4 = {};
|
|
const QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
|
|
object4.location = QUEST_HOME_MOBILE;
|
|
const enabled2 = Reflect.apply(useConfig, QuestHomeBountiesExperiment, [object4]).enabled;
|
|
const moduleValue6 = require(1485) /* metro dependency 1485 */;
|
|
const useRoute = moduleValue6.useRoute;
|
|
const {isLoading,
|
|
questHomeBounties} = questHooksModule.useFetchQuestHomeBounties({previewAdCreativeIds: Reflect.apply(useRoute,
|
|
moduleValue6, []).params?.previewAdCreativeIds});
|
|
const r4 = enabled && enabled2 && (require(7114) /* metro dependency 7114: QuestUtils */).shouldShowBountiesGivenFilters(filters);
|
|
useSurveyActions({bountiesAvailable: r4 && !isLoading && questHomeBounties.length > 0});
|
|
const value13 = env0_4.useCallback(_fun102679, [r4, handleHeaderLayout]);
|
|
if (isEligibleForQuests) {
|
|
if (isNavigationComplete) {
|
|
if (r4) {
|
|
if (isLoading) {
|
|
r1 = <View style={[styles.loadingContainer, containerStyle]}><ActivityIndicator animating /></View>;
|
|
} else if (isFetchingCurrentQuests) {
|
|
if (quests.length === 0) {
|
|
r1 = <View style={[styles.loadingContainer,
|
|
containerStyle]}><ActivityIndicator animating /></View>;
|
|
} else if (quests.length === 0) {
|
|
r1 = filters.length === 0 ? <EmptyStateNoQuestsAvailable /> : <EmptyStateFiltered onClearFilters={onClearFilters} />;
|
|
} else {
|
|
object4 = {ref: scrollViewRef};
|
|
object2 = {};
|
|
object2.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingBottom = bottom;
|
|
object4.contentContainerStyle = object2;
|
|
object4.style = [styles.container, containerStyle];
|
|
object4.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
|
|
object4.data = quests;
|
|
object4.renderItem = renderItem_102680;
|
|
object4.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
|
|
object4.showsHorizontalScrollIndicator = false;
|
|
object4.ListHeaderComponent = value13;
|
|
object4.CellRendererComponent = CellRendererComponent;
|
|
object4.onLayout = handleListLayout;
|
|
object4.onScroll = handleListScroll;
|
|
object4.onLoad = handleListLoad;
|
|
object4.scrollEventThrottle = 16;
|
|
r1 = <FlashList {...object4} />;
|
|
}
|
|
} else if (quests.length === 0) {
|
|
r1 = filters.length === 0 ? <EmptyStateNoQuestsAvailable /> : <EmptyStateFiltered onClearFilters={onClearFilters} />;
|
|
} else {
|
|
object4 = {ref: scrollViewRef};
|
|
object2 = {};
|
|
object2.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingBottom = bottom;
|
|
object4.contentContainerStyle = object2;
|
|
object4.style = [styles.container, containerStyle];
|
|
object4.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
|
|
object4.data = quests;
|
|
object4.renderItem = renderItem_102680;
|
|
object4.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
|
|
object4.showsHorizontalScrollIndicator = false;
|
|
object4.ListHeaderComponent = value13;
|
|
object4.CellRendererComponent = CellRendererComponent;
|
|
object4.onLayout = handleListLayout;
|
|
object4.onScroll = handleListScroll;
|
|
object4.onLoad = handleListLoad;
|
|
object4.scrollEventThrottle = 16;
|
|
r1 = <FlashList {...object4} />;
|
|
}
|
|
} else if (isFetchingCurrentQuests) {
|
|
if (quests.length === 0) {
|
|
r1 = <View style={[styles.loadingContainer, containerStyle]}><ActivityIndicator animating /></View>;
|
|
} else if (quests.length === 0) {
|
|
r1 = filters.length === 0 ? <EmptyStateNoQuestsAvailable /> : <EmptyStateFiltered onClearFilters={onClearFilters} />;
|
|
} else {
|
|
object4 = {ref: scrollViewRef};
|
|
object2 = {};
|
|
object2.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingBottom = bottom;
|
|
object4.contentContainerStyle = object2;
|
|
object4.style = [styles.container, containerStyle];
|
|
object4.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
|
|
object4.data = quests;
|
|
object4.renderItem = renderItem_102680;
|
|
object4.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
|
|
object4.showsHorizontalScrollIndicator = false;
|
|
object4.ListHeaderComponent = value13;
|
|
object4.CellRendererComponent = CellRendererComponent;
|
|
object4.onLayout = handleListLayout;
|
|
object4.onScroll = handleListScroll;
|
|
object4.onLoad = handleListLoad;
|
|
object4.scrollEventThrottle = 16;
|
|
r1 = <FlashList {...object4} />;
|
|
}
|
|
} else if (quests.length === 0) {
|
|
r1 = filters.length === 0 ? <EmptyStateNoQuestsAvailable /> : <EmptyStateFiltered onClearFilters={onClearFilters} />;
|
|
} else {
|
|
object4 = {ref: scrollViewRef};
|
|
object2 = {};
|
|
object2.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingBottom = bottom;
|
|
object4.contentContainerStyle = object2;
|
|
object4.style = [styles.container, containerStyle];
|
|
object4.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
|
|
object4.data = quests;
|
|
object4.renderItem = renderItem_102680;
|
|
object4.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
|
|
object4.showsHorizontalScrollIndicator = false;
|
|
object4.ListHeaderComponent = value13;
|
|
object4.CellRendererComponent = CellRendererComponent;
|
|
object4.onLayout = handleListLayout;
|
|
object4.onScroll = handleListScroll;
|
|
object4.onLoad = handleListLoad;
|
|
object4.scrollEventThrottle = 16;
|
|
r1 = <FlashList {...object4} />;
|
|
}
|
|
} else {
|
|
r1 = <View style={[styles.loadingContainer, containerStyle]}><ActivityIndicator animating /></View>;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun102649() { // fn#102649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2995, offset: 0x0224402a, size: 88 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const Array = global.Array;
|
|
const from = Array.from;
|
|
let value = environment.__proto__;
|
|
const quests = QuestStore.quests;
|
|
value = Reflect.apply(from, Array, [quests.values()]);
|
|
value = value.filter(_fun102650);
|
|
value = value.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
return value.sort();
|
|
}
|
|
|
|
function _fun102652() { // fn#102652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3110, offset: 0x022440ae, size: 87 bytes, params: 1, frame: 16
|
|
var value2;
|
|
var moduleValue;
|
|
if (env0_8.length > 0) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue.markAdContentSeen((require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST,
|
|
env0_8);
|
|
}
|
|
}
|
|
|
|
function _fun102653() { // fn#102653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3228, offset: 0x02244105, size: 104 bytes, params: 1, frame: 18
|
|
const scrollToQuestIdBinding = scrollToQuestId;
|
|
const value2 = null;
|
|
if (value2 == scrollToQuestIdBinding) {
|
|
return value2;
|
|
}
|
|
const questDataUtilsModule = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
return value2 == questDataUtilsModule.findQuestOrReplacement(scrollToQuestId, quests,
|
|
excludedQuests) ? value2 : quests.findIndex(_fun102654);
|
|
}
|
|
|
|
function _fun102655() { // fn#102655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3375, offset: 0x0224416d, size: 316 bytes, params: 1, frame: 22
|
|
var value5;
|
|
var moduleValue;
|
|
var defaultImport;
|
|
var open;
|
|
var object2;
|
|
var intl;
|
|
var defaultImport2;
|
|
var track;
|
|
var QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST;
|
|
if (scrollToQuestId != null && scrollToQuestId !== '' && hasFetched && !isFetchingCurrentQuests) {
|
|
value5 = environment.__proto__;
|
|
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
if (moduleValue.findQuestOrReplacement(scrollToQuestId, quests,
|
|
excludedQuests) == null && env0_9.current !== scrollToQuestId) {
|
|
defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
|
|
open = defaultImport.open;
|
|
object2 = {key: 'QUEST_HOME_MOBILE_DEEP_LINK_QUEST_NOT_FOUND'};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sIyHuY);
|
|
object2.icon = importDefault(8947) /* metro dependency 8947 */;
|
|
object2.toastDurationMs = 5000;
|
|
Reflect.apply(open, defaultImport, [object2]);
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST = AnalyticEvents.QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST;
|
|
scrollToQuestIdBinding = scrollToQuestId;
|
|
Reflect.apply(track, defaultImport2, [QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST,
|
|
{quest_id: scrollToQuestIdBinding}]);
|
|
env0_9.current = scrollToQuestIdBinding;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun102656({scrollToIndex}) { // fn#102656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3725, offset: 0x022442a9, size: 472 bytes, params: 2, frame: 25
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const value2 = env1_4.useRef(null);
|
|
const value3 = env1_4.useRef({parent: {scrollY: 0}, children: {}});
|
|
const value4 = env1_4.useCallback(_fun102658, []);
|
|
const value5 = env1_4.useCallback(_fun102659, [value4]);
|
|
const value6 = env1_4.useCallback(_fun102660, [value4]);
|
|
const [property, env0_6] = env1_3(env1_4.useState(false), 2);
|
|
const value9 = env1_4.useCallback(_fun102661, []);
|
|
const value10 = env1_4.useCallback(_fun102662, [value4]);
|
|
const value11 = env1_4.useCallback(_fun102663, [useReducedMotion]);
|
|
const value12 = env1_4.useCallback(_fun102664, [value4]);
|
|
env1_4.useEffect(_fun102665, [property, useReducedMotion, scrollToIndex, value11]);
|
|
return {scrollViewRef: value2, handleListScroll: value5, handleListLayout: value6, handleListLoad: value9,
|
|
handleQuestCardLayout: value10, handleHeaderLayout: value12, visibilityRef: value3};
|
|
}
|
|
|
|
function _fun102667() { // fn#102667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:5381, offset: 0x022446db, size: 55 bytes, params: 1, frame: 11
|
|
if (env0_3) {
|
|
value = environment.__proto__;
|
|
(require(13566) /* metro dependency 13566: QuestHomeOpenTriggerPoint */).QuestHomeOpenTriggerPoint.trigger();
|
|
}
|
|
}
|
|
|
|
function useSurveyActions({bountiesAvailable}) { // fn#102669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6022, owner: QuestHome.useSurveyActions, offset: 0x02244750, size: 224 bytes, params: 2, frame: 17
|
|
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const env0_2 = env1_4.useRef(false);
|
|
const env0_3 = env1_4.useRef(false);
|
|
const env0_4 = env1_4.useRef(false);
|
|
env1_4.useEffect(_fun102670, [bountiesAvailable]);
|
|
env1_4.useEffect(_fun102671, []);
|
|
env1_4.useEffect(_fun102674, []);
|
|
env1_4.useEffect(_fun102677, [value2]);
|
|
}
|
|
|
|
function _fun102679() { // fn#102679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7042, offset: 0x02244a57, size: 44 bytes, params: 1, frame: 14
|
|
return ((Component) => <Component shouldShowBounties={env0_14} onLayout={handleHeaderLayout} />)(env1_18);
|
|
}
|
|
|
|
function QuestHomeRenderItem({item, index}) { // fn#102680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7493, owner: QuestHome.renderItem, offset: 0x02244a83, size: 169 bytes, params: 2, frame: 21
|
|
const QuestContentImpressionTrackerNative = (require(10183) /* metro dependency 10183: QuestContentImpressionTrackerNative */).QuestContentImpressionTrackerNative;
|
|
const object2 = {questOrQuests: item};
|
|
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
|
|
let QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
|
|
object2.questContent = QUEST_HOME_MOBILE;
|
|
object2.questContentPosition = index;
|
|
object2.trackGuildAndChannelMetadata = false;
|
|
object2.visibilityRef = visibilityRef;
|
|
QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
|
|
object2.sourceQuestContent = QUEST_HOME_MOBILE;
|
|
return (
|
|
<QuestContentImpressionTrackerNative {...object2} key={item.id}>
|
|
{children_102681}
|
|
</QuestContentImpressionTrackerNative>
|
|
);
|
|
}
|
|
|
|
function CellRendererComponent(a0) { // fn#102682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:8046, owner: QuestHome.CellRendererComponent, offset: 0x02244b98, size: 80 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const CellContainer = (require(8416) /* metro dependency 8416: flashList */).CellContainer;
|
|
return <CellContainer {...a0} {...{['onLayout']: CellRendererComponentOnLayout}} />;
|
|
}
|
|
|
|
function _fun102650(a0) { // fn#102650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3037, offset: 0x02244082, size: 44 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
return !value.isQuestExpired(a0);
|
|
}
|
|
|
|
function _fun102658(a0) { // fn#102658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3890, offset: 0x02244490, size: 141 bytes, params: 2, frame: 18
|
|
var r2;
|
|
var r4;
|
|
var r1;
|
|
var property;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var calculateVisibility;
|
|
var value8;
|
|
var value9;
|
|
const Object = global.Object;
|
|
const keys = Object.keys;
|
|
let current = env0_3.current;
|
|
let children = current.children;
|
|
const value2 = Reflect.apply(keys, Object, [children]);
|
|
let length = value2.length;
|
|
const value3 = 0;
|
|
const value4 = undefined;
|
|
if (value3 < length) {
|
|
r2 = value4;
|
|
r4 = value3;
|
|
while (true) {
|
|
property = value2[r4];
|
|
value5 = a0 != null;
|
|
if (value5) {
|
|
value6 = property !== a0;
|
|
r1 = value6;
|
|
} else {
|
|
r1 = value5;
|
|
}
|
|
if (r1) {
|
|
continue;
|
|
}
|
|
current = env0_3.current;
|
|
children = current.children;
|
|
property = children[property];
|
|
value7 = property == null;
|
|
r1 = value7;
|
|
r2 = property;
|
|
if (r1) {
|
|
continue;
|
|
}
|
|
calculateVisibility = r2.calculateVisibility;
|
|
value8 = calculateVisibility == null;
|
|
r1 = value8;
|
|
if (r1) {
|
|
continue;
|
|
}
|
|
r2.calculateVisibility();
|
|
value9 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
|
|
length = value2.length;
|
|
if (value9 < length) {
|
|
r4 = value9;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
function _fun102659({nativeEvent}) { // fn#102659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4095, offset: 0x0224451d, size: 55 bytes, params: 2, frame: 10
|
|
env0_3.current.parent.scrollY = nativeEvent.contentOffset.y;
|
|
env0_4();
|
|
}
|
|
|
|
function _fun102660({nativeEvent}) { // fn#102660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4182, offset: 0x02244554, size: 50 bytes, params: 2, frame: 10
|
|
env0_3.current.parent.layout = nativeEvent.layout;
|
|
env0_4();
|
|
}
|
|
|
|
function _fun102662({nativeEvent}, a1) { // fn#102662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4333, offset: 0x02244586, size: 84 bytes, params: 3, frame: 15
|
|
const binding = env0_3;
|
|
const children = binding.current.children;
|
|
const object2 = {};
|
|
copyDataProperties(object2, binding.current.children[a1], undefined);
|
|
object2['layout'] = nativeEvent.layout;
|
|
children[a1] = object2;
|
|
env0_4(a1);
|
|
}
|
|
|
|
function _fun102663(a0) { // fn#102663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4447, offset: 0x022445da, size: 103 bytes, params: 2, frame: 14
|
|
var scrollToIndex;
|
|
var object2;
|
|
let current = env0_2.current;
|
|
if (current != null) {
|
|
current = env0_2.current;
|
|
scrollToIndex = current.scrollToIndex;
|
|
object2 = {index: a0};
|
|
object2.animated = !useReducedMotion;
|
|
value = environment.__proto__.__proto__;
|
|
object2.viewOffset = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
Reflect.apply(scrollToIndex, current, [object2]);
|
|
}
|
|
}
|
|
|
|
function _fun102664({nativeEvent}) { // fn#102664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4570, offset: 0x02244641, size: 55 bytes, params: 2, frame: 10
|
|
env0_3.current.parent.firstItemOffset = nativeEvent.layout.height;
|
|
env0_4();
|
|
}
|
|
|
|
function _fun102665() { // fn#102665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4666, offset: 0x02244678, size: 84 bytes, params: 1, frame: 13
|
|
if (scrollToIndex != null && scrollToIndex !== -1 && env0_5) {
|
|
env0_7(scrollToIndex);
|
|
value = environment.__proto__.__proto__;
|
|
QuestHomeNavigationStore.setState({scrollToQuestId: null});
|
|
}
|
|
}
|
|
|
|
function _fun102670() { // fn#102670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6160, offset: 0x02244830, size: 26 bytes, params: 1, frame: 2
|
|
if (bountiesAvailable) {
|
|
env0_2.current = true;
|
|
}
|
|
}
|
|
|
|
function _fun102671() { // fn#102671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6203, offset: 0x0224484a, size: 65 bytes, params: 1, frame: 14
|
|
var environment;
|
|
const closure = handleBountiesModalPush;
|
|
const value = environment.__proto__.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('MODAL_PUSH', closure);
|
|
return _fun102673;
|
|
}
|
|
|
|
function _fun102674() { // fn#102674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6444, offset: 0x022448fb, size: 65 bytes, params: 1, frame: 14
|
|
var environment;
|
|
const closure = handleClaimSuccess;
|
|
const value = environment.__proto__.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('BOUNTIES_CLAIM_REWARD_SUCCESS', closure);
|
|
return _fun102676;
|
|
}
|
|
|
|
function _fun102677() { // fn#102677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6668, offset: 0x02244983, size: 34 bytes, params: 1, frame: 13
|
|
return env0_1.addListener('beforeRemove', _fun102678);
|
|
}
|
|
|
|
function renderItemChildren() { // fn#102681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7769, owner: QuestHome.renderItem.children, offset: 0x02244b2c, size: 108 bytes, params: 1, frame: 19
|
|
const QuestCard = (require(13567) /* metro dependency 13567: QuestCard */).QuestCard;
|
|
const itemBinding = item;
|
|
const indexBinding = index;
|
|
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
|
|
const QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
|
|
return (
|
|
<QuestCard
|
|
quest={itemBinding}
|
|
questContentPosition={indexBinding}
|
|
containerPadding={0}
|
|
sourceQuestContent={QUEST_HOME_MOBILE}
|
|
key={itemBinding.id}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function CellRendererComponentOnLayout(a0) { // fn#102683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:8089, owner: QuestHome.CellRendererComponent.onLayout, offset: 0x02244be8, size: 68 bytes, params: 2, frame: 14
|
|
const property = quests[env0_0.index];
|
|
if (property != null) {
|
|
handleQuestCardLayout(a0, property.id);
|
|
}
|
|
env0_0.onLayout(a0);
|
|
}
|
|
|
|
function handleBountiesModalPush({key}) { // fn#102672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6208, offset: 0x0224488b, size: 60 bytes, params: 2, frame: 12
|
|
const BOUNTIES_MODAL_KEY = (require(13515) /* metro dependency 13515: BountiesModalActionCreators */).BOUNTIES_MODAL_KEY;
|
|
if (key === BOUNTIES_MODAL_KEY) {
|
|
value = environment.__proto__;
|
|
env1_3.current = true;
|
|
}
|
|
}
|
|
|
|
function _fun102673() { // fn#102673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6360, offset: 0x022448c7, size: 52 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('MODAL_PUSH', handleBountiesModalPush);
|
|
}
|
|
|
|
function handleClaimSuccess() { // fn#102675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6449, offset: 0x0224493c, size: 19 bytes, params: 1, frame: 2
|
|
env1_4.current = true;
|
|
}
|
|
|
|
function _fun102676() { // fn#102676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6570, offset: 0x0224494f, size: 52 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('BOUNTIES_CLAIM_REWARD_SUCCESS', handleClaimSuccess);
|
|
}
|
|
|
|
function _fun102678() { // fn#102678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6702, offset: 0x022449a5, size: 178 bytes, params: 1, frame: 16
|
|
var value2;
|
|
var fireSurveyAction;
|
|
const SurveyActionTypes = (require(9534) /* metro dependency 9534: SurveyActionTypes */).SurveyActionTypes;
|
|
let value = environment.__proto__;
|
|
let current = env1_2.current;
|
|
if (current) {
|
|
current = env1_4.current;
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
if (current) {
|
|
value = require(9535) /* metro dependency 9535: QualtricsActionCreators */;
|
|
value.fireSurveyAction(SurveyActionTypes.BOUNTY_SESSION_COMPLETED);
|
|
} else {
|
|
current = env1_3.current;
|
|
value = require(9535) /* metro dependency 9535: QualtricsActionCreators */;
|
|
fireSurveyAction = value.fireSurveyAction;
|
|
if (current) {
|
|
Reflect.apply(fireSurveyAction, value, [SurveyActionTypes.BOUNTY_ABANDONED]);
|
|
} else {
|
|
Reflect.apply(fireSurveyAction, value, [SurveyActionTypes.BOUNTY_IMMEDIATE_DISMISSAL]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|