304 lines
17 KiB
TypeScript
304 lines
17 KiB
TypeScript
/* Metro module 13560; source: modules/quests/native/BountyCard.tsx; dependencies: [57, 31, 27, 4502, 7092, 33, 4501, 697, 478, 566, 9495, 3860, 6239, 8011, 5475, 8707, 4573, 1244, 4578, 4073, 2] */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import BountyStore from '../BountyStore.tsx'; /* Metro dependency 7092 */
|
|
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 PlatformUtilsModule from '../../../external/discord_common/js/shared/utils/PlatformUtils.tsx'; /* Metro dependency 478 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as CircleCheckIconModule from '../../../design/components/Icon/native/redesign/generated/CircleCheckIcon.tsx'; /* Metro dependency 4073 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as CardNativeModule from '../../../design/components/Card/native/Card.native.tsx'; /* Metro dependency 6239 */
|
|
|
|
function _fun103013(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:6, offset: 0x02253ab2, size: 370 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = 0;
|
|
const env0_3 = importDefault(dependencyMap[value]);
|
|
const env0_12 = (CreateStylesModule).createStyles(_fun103014);
|
|
const env0_13 = PlatformUtilsModule.isAndroid() ? 150 : value;
|
|
const env0_14 = PlatformUtilsModule.isAndroid();
|
|
const env0_15 = PlatformUtilsModule.isAndroid();
|
|
value = ReactModule.memo(_fun103015);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/BountyCard.tsx');
|
|
exports.default = value;
|
|
exports.CARD_WIDTH = 188;
|
|
function _fun103014() { // fn#103014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:240, offset: 0x02253c24, size: 557 bytes, params: 1, frame: 17
|
|
const object = {};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.tile = {gap: PX_12};
|
|
object.card = {'width': 188, 'height': 313, 'overflow': 'hidden', 'padding': 0};
|
|
const object3 = {};
|
|
const value = copyDataProperties(object3, StyleSheet.absoluteFillObject, PX_12);
|
|
object.cardImage = object3;
|
|
const object4 = {};
|
|
copyDataProperties(object4, StyleSheet.absoluteFillObject, value);
|
|
object.previewVideo = object4;
|
|
const object5 = {position: 'absolute'};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.top = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.left = PX_12;
|
|
const CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object5.backgroundColor = CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.paddingHorizontal = PX_8;
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object5.paddingVertical = PX_4;
|
|
let CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
|
|
object5.color = CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
|
|
object.badge = object5;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.badgeContent = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_4};
|
|
CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
|
|
object.badgeText = {textTransform: 'uppercase', color: CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT};
|
|
const object8 = {position: 'absolute'};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.bottom = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.left = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.right = PX_8;
|
|
object.startButton = object8;
|
|
object.cardFooter = {'flexDirection': 'column', 'alignItems': 'flex-start', 'maxWidth': 188};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.advertiserRow = {'flexDirection': 'row', 'gap': null, 'alignItems': 'center', gap: PX_4};
|
|
object.advertiserName = {flexShrink: 1};
|
|
object.advertiserIcon = {'flexShrink': 0, 'opacity': 0.7};
|
|
return object;
|
|
}
|
|
|
|
function _fun103015({bounty, index, isActive, isModalVisible, onPress}) { // fn#103015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:1310, offset: 0x02253e51, size: 1995 bytes, params: 2, frame: 39
|
|
const onPress2 = onPress;
|
|
let env0_4 = undefined;
|
|
const styles = useStyles();
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([BountyStore], function() {
|
|
return BountyStore.isBountyCompleted(bounty.id);
|
|
});
|
|
let binding = env0_4;
|
|
const value4 = binding.useCallback(function() {
|
|
onPress(bounty, index);
|
|
}, [onPress, bounty, index]);
|
|
const videoPreview = bounty.videoPreview;
|
|
let r12 = bounty.imagePreview != null ? (require(9495) /* metro dependency 9495: AssetUtils */).getScaledImageUrl({'assetUrl': null,
|
|
'width': 188, 'height': 313, assetUrl: bounty.imagePreview}) : null;
|
|
r12 = r12 == null && videoPreview != null ? (require(9495) /* metro dependency 9495: AssetUtils */).getScaledFirstFrameImageUrl({'assetUrl': null,
|
|
'width': 188, 'height': 313, assetUrl: videoPreview}) : r12;
|
|
binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value10 = Reflect.apply(useState, binding, [false]);
|
|
const binding2 = onPress2;
|
|
const value11 = binding2(value10, 2);
|
|
const property = value11[0];
|
|
env0_4 = value11[1];
|
|
const value12 = binding.useCallback(_fun103018, []);
|
|
useState = binding.useState;
|
|
const value13 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value13[0];
|
|
const property3 = value13[1];
|
|
useState = binding.useState;
|
|
const value14 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property4 = value14[0];
|
|
const property5 = value14[1];
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const useToken = UseTokenModule.useToken;
|
|
const BOUNTY_TILE_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.BOUNTY_TILE_BORDER_RADIUS;
|
|
const value15 = Reflect.apply(useToken, UseTokenModule, [BOUNTY_TILE_BORDER_RADIUS]);
|
|
const env0_8 = binding.useRef(null);
|
|
const value16 = binding.useCallback(_fun103020, []);
|
|
useState = binding.useState;
|
|
const value17 = binding2(Reflect.apply(useState, binding, [isActive]), 2);
|
|
if (isActive !== value17[0]) {
|
|
value17[1](isActive);
|
|
if (isActive) {
|
|
if (property2 && !property4) {
|
|
property3(false);
|
|
}
|
|
if (property4) {
|
|
property5(false);
|
|
}
|
|
} else if (env0_14) {
|
|
property5(true);
|
|
}
|
|
}
|
|
binding = env0_4;
|
|
const env0_9 = binding.useRef(null);
|
|
binding.useEffect(_fun103022, [property4]);
|
|
binding.useEffect(_fun103025, [isActive]);
|
|
binding.useEffect(function() {
|
|
return _fun103027;
|
|
}, []);
|
|
useState = binding.useState;
|
|
const value20 = onPress2(Reflect.apply(useState, binding, [AppState.currentState === 'active']), 2);
|
|
const property8 = value20[0];
|
|
const env0_10 = value20[1];
|
|
binding.useEffect(function() {
|
|
var env0_0 = AppState.addEventListener('change', _fun103029);
|
|
return _fun103030;
|
|
}, []);
|
|
let r7 = (isActive || property4) && videoPreview != null && property;
|
|
let r5 = env0_15 && isModalVisible;
|
|
r5 = !r5 && !(property4 && !isActive) && r7 && property2;
|
|
const value25 = env0_4.useMemo(_fun103031, [r5]);
|
|
const Card = (CardNativeModule).Card;
|
|
r7 = r7 && ((Component) => <Component accessible={false} importantForAccessibility="no-hide-descendants" accessibilityRole="none" onReadyForDisplay={value16} source={{uri: videoPreview}} style={styles.previewVideo} resizeMode="cover" repeat muted disableFocus paused={property8 ? useReducedMotion : !property8} />)(importDefault(8011) /* metro dependency 8011 */);
|
|
const items2 = [r7];
|
|
items2[1] = ((Component) => <Component style={[styles.cardImage,
|
|
value25]} onLoad={value12} source={{uri: r12 ?? undefined}} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
const r9 = value3 && ((CheckmarkSmallBoldIcon) => <CheckmarkSmallBoldIcon size="xxs" color={(importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT} />)((require(8707) /* metro dependency 8707: CheckmarkSmallBoldIcon */).CheckmarkSmallBoldIcon);
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
items2[2] = (
|
|
<View style={styles.badge}>
|
|
<View style={styles.badgeContent}>
|
|
{r9}
|
|
<Text variant="text-xs/bold" style={styles.badgeText}>
|
|
{Reflect.apply(string, intl, [value3 ? t.vlGTLf : t['fFIJ/9']])}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
string = intl.string;
|
|
items2[3] = (
|
|
<View style={styles.startButton}>
|
|
<Button
|
|
variant="secondary-overlay"
|
|
text={value3 ? Reflect.apply(string, intl, [t['9UtZAY']]) : Reflect.apply(string, intl, [t.LhlgY9])}
|
|
onPress={value4}
|
|
/>
|
|
</View>
|
|
);
|
|
const card = (
|
|
<Card
|
|
style={styles.card}
|
|
radius={value15}
|
|
onPress={value4}
|
|
android_ripple={{color: 'transparent'}}
|
|
>
|
|
{items2}
|
|
</Card>
|
|
);
|
|
const text = (
|
|
<Text
|
|
variant="text-sm/medium"
|
|
color="text-subtle"
|
|
lineClamp={1}
|
|
style={styles.advertiserName}
|
|
>
|
|
{bounty.advertiserName ?? ''}
|
|
</Text>
|
|
);
|
|
const CircleCheckIcon = (CircleCheckIconModule).CircleCheckIcon;
|
|
const ICON_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE;
|
|
return (
|
|
<View style={styles.tile}>
|
|
{card}
|
|
<View style={styles.cardFooter}>
|
|
<View style={styles.advertiserRow}>
|
|
{text}
|
|
<CircleCheckIcon
|
|
size="xxs"
|
|
style={styles.advertiserIcon}
|
|
color={ICON_SUBTLE}
|
|
/>
|
|
</View>
|
|
<Text variant="text-sm/medium" color="text-muted">
|
|
{intl.string((IndexNativeModule).t.o6FLcF)}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
function _fun103018() { // fn#103018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:1766, offset: 0x0225463c, size: 18 bytes, params: 1, frame: 11
|
|
env0_4(true);
|
|
}
|
|
|
|
function _fun103020() { // fn#103020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2026, offset: 0x0225464e, size: 86 bytes, params: 1, frame: 14
|
|
if (env0_8.current != null) {
|
|
global.clearTimeout(env0_8.current);
|
|
}
|
|
env0_8.current = global.setTimeout(_fun103021, env1_13);
|
|
function _fun103021() { // fn#103021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2094, offset: 0x0202da0c, size: 18 bytes, params: 1, frame: 11
|
|
env1_5(true);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103022() { // fn#103022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2238, offset: 0x022546a4, size: 57 bytes, params: 1, frame: 15
|
|
if (ReactNativeModule.StyleSheet) {
|
|
env0_9.current = global.setTimeout(_fun103023, 150);
|
|
}
|
|
return _fun103024;
|
|
function _fun103023() { // fn#103023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2269, offset: 0x022546dd, size: 39 bytes, params: 1, frame: 12
|
|
env1_7(false);
|
|
env1_5(false);
|
|
env1_9.current = null;
|
|
}
|
|
|
|
function _fun103024() { // fn#103024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2309, offset: 0x02254704, size: 56 bytes, params: 1, frame: 13
|
|
if (env1_9.current != null) {
|
|
global.clearTimeout(env1_9.current);
|
|
env1_9.current = null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103025() { // fn#103025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2393, offset: 0x0225473c, size: 129 bytes, params: 1, frame: 12
|
|
if (isActive && env0_9.current != null) {
|
|
global.clearTimeout(env0_9.current);
|
|
env0_9.current = null;
|
|
}
|
|
if (!(isActive || env0_8.current == null)) {
|
|
global.clearTimeout(env0_8.current);
|
|
env0_8.current = null;
|
|
}
|
|
}
|
|
|
|
function _fun103026() { // fn#103026, offset: 0x022547bd, size: 11 bytes, params: 1, frame: 1
|
|
return _fun103027;
|
|
function _fun103027() { // fn#103027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2544, offset: 0x022547c8, size: 56 bytes, params: 1, frame: 13
|
|
if (env1_8.current != null) {
|
|
global.clearTimeout(env1_8.current);
|
|
env1_8.current = null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103028() { // fn#103028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2698, offset: 0x02254800, size: 45 bytes, params: 1, frame: 14
|
|
const env0_0 = AppState.addEventListener('change', _fun103029);
|
|
return _fun103030;
|
|
function _fun103029(a0) { // fn#103029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2738, offset: 0x0217e985, size: 27 bytes, params: 2, frame: 12
|
|
env1_10(a0 === 'active');
|
|
}
|
|
|
|
function _fun103030() { // fn#103030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2768, offset: 0x00cd0cb3, size: 21 bytes, params: 1, frame: 9
|
|
env0_0.remove();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103031() { // fn#103031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13750:2859, offset: 0x0225482d, size: 23 bytes, params: 1, frame: 3
|
|
return {opacity: JsxRuntimeModule.jsxs ? 0 : 1};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103013, 13560, [57, 31, 27, 4502, 7092, 33, 4501, 697, 478, 566, 9495, 3860, 6239, 8011, 5475, 8707,
|
|
4573, 1244, 4578, 4073,
|
|
2]) /* metro module 13560, dependencies: [57, 31, 27, 4502, 7092, 33, 4501, 697, 478, 566, 9495, 3860, 6239, 8011, 5475, 8707, 4573, 1244, 4578, 4073, 2] */;
|