122 lines
6.4 KiB
TypeScript
122 lines
6.4 KiB
TypeScript
/* Metro module 9542; source: modules/quests/native/QuestRewardTile.tsx; dependencies: [57, 31, 27, 4502, 33, 4501, 697, 477, 566, 9500, 9495, 9543, 5475, 2] */
|
|
function _fun74440(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:6, offset: 0x01d8d9ce, size: 253 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(31) /* metro dependency 31 */).useMemo;
|
|
const value = require(27) /* metro dependency 27 */;
|
|
const env0_6 = value.AppState;
|
|
const env0_7 = value.View;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const env0_9 = (require(33) /* metro dependency 33 */).jsx;
|
|
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function() {
|
|
var object2 = {'borderRadius': null, 'display': 'flex', 'justifyContent': 'center', 'alignItems': 'center',
|
|
'overflow': 'hidden'};
|
|
object2.borderRadius = importDefault(dependencyMap[6]).radii.sm;
|
|
return {container: object2, video: {'overflow': 'hidden', 'height': '100%', 'width': '100%'},
|
|
image: {'height': '100%', 'width': '100%'}};
|
|
});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestRewardTile.tsx');
|
|
exports.default = QuestRewardTile;
|
|
}
|
|
|
|
function QuestRewardTile({quest, height, width, style, paused, withAnimation, accessibilityLabelPrefix}) { // fn#74442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:517, offset: 0x01d8db31, size: 666 bytes, params: 2, frame: 27
|
|
var r4;
|
|
var r9;
|
|
var value;
|
|
var VideoComponent;
|
|
paused = !(paused === undefined) && paused;
|
|
if (withAnimation !== undefined) {
|
|
r4 = withAnimation;
|
|
} else {
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isIOS();
|
|
r4 = value;
|
|
}
|
|
let env0_4 = undefined;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const value2 = useMemo(_fun74444, [quest]);
|
|
let name = value2.name;
|
|
name = name != null ? value2.name : value2.messages.name;
|
|
const value3 = useMemo(_fun74445, [quest]);
|
|
const env0_3 = value3;
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const useState = binding.useState;
|
|
const value5 = env0_3(Reflect.apply(useState, binding, [AppState.currentState === 'active']), 2);
|
|
const property = value5[0];
|
|
env0_4 = value5[1];
|
|
binding.useEffect(_fun74446, [value3.isAnimated]);
|
|
const value6 = binding.useMemo(_fun74449, [value3, width, height]);
|
|
items3 = [accessibilityLabelPrefix, name];
|
|
const filter = items3.filter;
|
|
const Boolean = global.Boolean;
|
|
const value8 = Reflect.apply(filter, items3, [Boolean]).join(', ');
|
|
const items2 = [styles.container];
|
|
items2[1] = {height: height, width: width};
|
|
items2[2] = style;
|
|
if (value3.isAnimated) {
|
|
if (r4) {
|
|
VideoComponent = (require(9543) /* metro dependency 9543: Video */).VideoComponent;
|
|
value = !property;
|
|
r9 = property ? paused : value;
|
|
r9 = !r9 ? useReducedMotion : r9;
|
|
value = <VideoComponent style={styles.video} source={{uri: value3.url}} disableFocus preventsDisplaySleepDuringVideoPlayback={false} importantForAccessibility="no-hide-descendants" poster={value6} resizeMode="cover" paused={r9} muted />;
|
|
r4 = value;
|
|
} else {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component source={{uri: value6}} style={styles.image} />)(value);
|
|
r4 = value;
|
|
}
|
|
} else {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component source={{uri: value6}} style={styles.image} />)(value);
|
|
r4 = value;
|
|
}
|
|
return (
|
|
<View accessibilityLabel={value8} style={items2}>
|
|
{r4}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun74444() { // fn#74444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:717, offset: 0x01d8ddcb, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(9500) /* metro dependency 9500: QuestRewardUtils */).getQuestPrimaryReward(quest);
|
|
}
|
|
|
|
function _fun74445() { // fn#74445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:811, offset: 0x01d8ddf8, size: 75 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
value = require(9495) /* metro dependency 9495: AssetUtils */;
|
|
const getQuestAsset = value.getQuestAsset;
|
|
const questBinding = quest;
|
|
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
|
|
const REWARD = QuestAssetType.REWARD;
|
|
return Reflect.apply(getQuestAsset, value, [questBinding, REWARD, undefined, true]);
|
|
}
|
|
|
|
function _fun74446() { // fn#74446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:970, offset: 0x01d8de43, size: 65 bytes, params: 1, frame: 14
|
|
var environment;
|
|
if (env0_3.isAnimated) {
|
|
value = environment.__proto__;
|
|
var env0_0 = AppState.addEventListener('change', _fun74447);
|
|
return _fun74448;
|
|
}
|
|
}
|
|
|
|
function _fun74449() { // fn#74449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:1109, offset: 0x01d8de9f, size: 73 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (require(9495) /* metro dependency 9495: AssetUtils */).getScaledImageUrl({assetUrl: env0_3.url,
|
|
width: width, height: height});
|
|
}
|
|
|
|
function _fun74447(a0) { // fn#74447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9728:1027, offset: 0x01d8de84, size: 27 bytes, params: 2, frame: 12
|
|
env1_4(a0 === 'active');
|
|
}
|
|
|