171 lines
11 KiB
TypeScript
171 lines
11 KiB
TypeScript
/* Metro module 13592; source: modules/quests/native/QuestBottomSheet/QuestBottomSheetHeader.tsx; dependencies: [57, 31, 27, 1878, 33, 4501, 697, 9483, 7116, 13568, 566, 9500, 7114, 1244, 13591, 6531, 13569, 4559, 4570, 4573, 5278, 8638, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseIsScreenReaderEnabledNativeModule from '../../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
|
|
import * as QuestTaskUtilsModule from '../../utils/QuestTaskUtils.tsx'; /* Metro dependency 7116 */
|
|
import * as QuestHooksModule from '../../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
|
|
import * as QuestRewardUtilsModule from '../../utils/QuestRewardUtils.tsx'; /* Metro dependency 9500 */
|
|
import * as QuestHooksNativeModule from '../QuestHooks.native.tsx'; /* Metro dependency 13568 */
|
|
import * as QuestDockHooksModule from '../QuestDock/QuestDockHooks.tsx'; /* Metro dependency 13569 */
|
|
import * as QuestBottomSheetModule from './QuestBottomSheet.tsx'; /* Metro dependency 13591 */
|
|
|
|
function _fun103287(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:6, offset: 0x0225ffd8, size: 390 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'display': 'flex', 'gap': 6};
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingHorizontal = PX_16;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.paddingTop = PX_8;
|
|
object.container = object2;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.containerWithActionSheet = {'alignItems': 'center', 'flexDirection': 'row', paddingHorizontal: PX_8};
|
|
object.title = {textAlign: 'center'};
|
|
object.titleWithActionSheet = {'textAlign': 'left', 'flex': 1};
|
|
object.actionSheetButton = {'flexGrow': 0, 'flexShrink': 0};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestBottomSheet/QuestBottomSheetHeader.tsx');
|
|
exports.default = QuestBottomSheetHeader;
|
|
function QuestBottomSheetHeader({quest, step, withActionSheet, location}) { // fn#103288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:627, offset: 0x0226015e, size: 530 bytes, params: 2, frame: 26
|
|
var r5;
|
|
var PressableOpacity;
|
|
var intl;
|
|
withActionSheet = !(withActionSheet === undefined) && withActionSheet;
|
|
const styles = useStyles();
|
|
const value2 = (QuestDockHooksModule).useActionSheetPressHandler(quest);
|
|
const value3 = useHeaderCopy({quest: quest, step: step, location: location});
|
|
const value4 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
|
|
const value5 = ReactModule.useRef(null);
|
|
ReactModule.useEffect(_fun103293, [value4]);
|
|
const items2 = [styles.container];
|
|
items2[1] = withActionSheet && styles.containerWithActionSheet;
|
|
const r6 = value3 != null && ((Text) => <Text ref={value5} variant="redesign/heading-18/bold" color="mobile-text-heading-primary" accessibilityRole="header" style={[styles.title,
|
|
withActionSheet && styles.titleWithActionSheet]}>{value3}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
|
|
if (withActionSheet) {
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r5 = (
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['UKOtz+'])}
|
|
onPress={value2}
|
|
style={styles.actionSheetButton}
|
|
>
|
|
{((MoreHorizontalIcon) => <MoreHorizontalIcon color={(importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT} />)((require(8638) /* metro dependency 8638: MoreHorizontalIcon */).MoreHorizontalIcon)}
|
|
</PressableOpacity>
|
|
);
|
|
} else {
|
|
r5 = withActionSheet;
|
|
}
|
|
return (
|
|
<View style={items2}>
|
|
{r6}
|
|
{r5}
|
|
</View>
|
|
);
|
|
function useHeaderCopy({quest, step}) { // fn#103289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:762, owner: QuestBottomSheetHeader.useHeaderCopy, offset: 0x02260370, size: 507 bytes, params: 2, frame: 28
|
|
let value = undefined;
|
|
const userStatus = quest.userStatus;
|
|
const value2 = (userStatus == null ? value : userStatus.completedAt) != null;
|
|
const gameTitle = quest.config.messages.gameTitle;
|
|
const value4 = (QuestHooksModule).useQuestTaskDetails(quest);
|
|
const hasWatchVideoTasks2 = (QuestTaskUtilsModule).hasWatchVideoTasks(quest);
|
|
const isInGameQuest2 = (QuestTaskUtilsModule).isInGameQuest(quest);
|
|
const property = env1_3((QuestHooksModule).useTaskPlatformScreen(quest,
|
|
value4), 1)[0];
|
|
const targetMinutes = value4.targetMinutes;
|
|
const binding = env1_4;
|
|
const value7 = binding.useMemo(_fun103290, [quest]);
|
|
const value8 = (QuestHooksNativeModule).useHasWatchVideoOnMobileTasks(quest.config);
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const defaultRewardNameWithArticle = (QuestRewardUtilsModule).getDefaultRewardNameWithArticle(quest.config,
|
|
currentUser);
|
|
value = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
value = value.isSponsoredPlayQuest(quest);
|
|
return binding.useMemo(_fun103292, [value2, hasWatchVideoTasks2, step, property, value7, gameTitle,
|
|
defaultRewardNameWithArticle, targetMinutes, value8, isInGameQuest2, value, quest.config]);
|
|
function _fun103290() { // fn#103290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:1065, offset: 0x0226056b, size: 52 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestTaskUtilsModule).hasStreamOnDesktopTask({quest: quest});
|
|
}
|
|
|
|
function _fun103292() { // fn#103292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:1335, offset: 0x0226059f, size: 788 bytes, params: 1, frame: 19
|
|
var value2;
|
|
var moduleValue;
|
|
var value3;
|
|
var stepBinding;
|
|
var value4;
|
|
var binding;
|
|
const intl = (IndexNativeModule).intl;
|
|
var formatToPlainString;
|
|
const t = (IndexNativeModule).t;
|
|
var value5;
|
|
var value;
|
|
if (env0_2) {
|
|
value = environment.__proto__.__proto__;
|
|
return intl.string(t['ij5E/5']);
|
|
}
|
|
if (ReactModule) {
|
|
binding = env0_9;
|
|
value5 = environment.__proto__.__proto__;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return binding ? Reflect.apply(formatToPlainString, intl, [t.ttFsLj,
|
|
{reward: env0_10}]) : Reflect.apply(formatToPlainString, intl, [t.IpoqqA, {questReward: env0_10}]);
|
|
}
|
|
if (ReactNativeModule.View) {
|
|
value2 = environment.__proto__.__proto__;
|
|
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
value3 = moduleValue.getDefaultInGameTask(quest.config);
|
|
if (value3 != null) {
|
|
return value3.messages.taskDescription;
|
|
}
|
|
stepBinding = step;
|
|
value4 = environment.__proto__.__proto__;
|
|
} else {
|
|
stepBinding = step;
|
|
}
|
|
const QuestBottomSheetStep = (QuestBottomSheetModule).QuestBottomSheetStep;
|
|
const TASK_SELECT = QuestBottomSheetStep.TASK_SELECT;
|
|
return stepBinding === TASK_SELECT ? intl.string(t.drVw4T) : step === QuestBottomSheetStep.CONSOLE_CONNECT ? intl.string(t.svdwbA) : env0_11 ? intl.formatToPlainString(t['2GJLK2'],
|
|
{targetMinutes: targetMinutes,
|
|
rewardNameWithArticle: env0_10}) : env0_6 !== (require(6531) /* metro dependency 6531: QuestTypes */).TaskPlatformScreen.DESKTOP ? intl.formatToPlainString(t.NIimTt,
|
|
{gameTitle: gameTitle, rewardNameWithArticle: env0_10,
|
|
targetMinutes: targetMinutes}) : env0_8 ? intl.formatToPlainString(t['hkJ+Gs'], {gameTitle: gameTitle,
|
|
questReward: env0_10, streamingDurationRequirement: targetMinutes}) : intl.formatToPlainString(t.NIimTt,
|
|
{gameTitle: gameTitle, rewardNameWithArticle: env0_10, targetMinutes: targetMinutes});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103293() { // fn#103293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13782:2327, offset: 0x022608b3, size: 86 bytes, params: 1, frame: 12
|
|
var value3;
|
|
var moduleValue;
|
|
if (env0_0 && env0_1.current != null) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */;
|
|
moduleValue.setAccessibilityFocus({ref: env0_1, delay: 100});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103287, 13592, [57, 31, 27, 1878, 33, 4501, 697, 9483, 7116, 13568, 566, 9500, 7114, 1244, 13591,
|
|
6531, 13569, 4559, 4570, 4573, 5278, 8638,
|
|
2]) /* metro module 13592, dependencies: [57, 31, 27, 1878, 33, 4501, 697, 9483, 7116, 13568, 566, 9500, 7114, 1244, 13591, 6531, 13569, 4559, 4570, 4573, 5278, 8638, 2] */;
|