172 lines
8.9 KiB
TypeScript
172 lines
8.9 KiB
TypeScript
/* Metro module 7642; source: modules/premium/native/gifting/PremiumGiftBackgroundAnimation.android.tsx; dependencies: [57, 31, 27, 4502, 33, 4501, 566, 7643, 7644, 6760, 2] */
|
|
function _fun61186(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:6, offset: 0x0171d404, size: 320 bytes, params: 8, frame: 20
|
|
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 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'display': 'flex',
|
|
'alignItems': 'flex-end', 'justifyContent': 'center', 'flexDirection': 'row'}, consistentHeight: {height: 300},
|
|
animation: {'maxWidth': 375, 'width': '100%', 'height': 'auto'}, baseAnimation: {'position': 'absolute',
|
|
'bottom': 0}, lottie: {height: 275}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftBackgroundAnimation.android.tsx');
|
|
exports.default = PremiumGiftBackgroundAnimation;
|
|
}
|
|
|
|
function PremiumGiftBackgroundAnimation({giftStyle, withConsistentHeight}) { // fn#61187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:552, offset: 0x0171d544, size: 987 bytes, params: 2, frame: 38
|
|
const styles = useStyles();
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const binding = env0_4;
|
|
const value2 = binding.useRef(null);
|
|
const value3 = binding.useRef(null);
|
|
const env0_3 = value3;
|
|
let useState = binding.useState;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
const ACTION = AnimationState.ACTION;
|
|
const value4 = Reflect.apply(useState, binding, [ACTION]);
|
|
const binding2 = env0_3;
|
|
const value5 = binding2(value4, 2);
|
|
const property = value5[0];
|
|
const env0_5 = value5[1];
|
|
useState = binding.useState;
|
|
const value8 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
|
|
const property2 = value8[0];
|
|
const env0_7 = value8[1];
|
|
useState = binding.useState;
|
|
const value9 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
|
|
const property3 = value9[0];
|
|
const env0_9 = value9[1];
|
|
useState = binding.useState;
|
|
const value10 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property4 = value10[0];
|
|
const env0_11 = value10[1];
|
|
const value11 = binding.useMemo(_fun61189, [giftStyle]);
|
|
const value12 = binding.useMemo(_fun61190, [giftStyle]);
|
|
const lottieType = (require(7644) /* metro dependency 7644: GiftAnimationData */).getLottieType(giftStyle);
|
|
binding.useMemo(_fun61191, [property3, property2, giftStyle, property]);
|
|
const value14 = binding.useCallback(_fun61192, [property, property4]);
|
|
binding.useEffect(_fun61193, [property]);
|
|
binding.useEffect(_fun61194, [useReducedMotion]);
|
|
const items3 = [styles.container];
|
|
items3[1] = withConsistentHeight && styles.consistentHeight;
|
|
const LottieAnimationView = importDefault(6760) /* metro dependency 6760: LottieAnimationView */;
|
|
const items2 = [styles.baseAnimation];
|
|
items2[1] = styles.animation;
|
|
const LottieType = (require(7644) /* metro dependency 7644: GiftAnimationData */).LottieType;
|
|
let LOTTIE = LottieType.LOTTIE;
|
|
items2[2] = lottieType === LOTTIE && styles.lottie;
|
|
const object = {};
|
|
const value16 = property2 === giftStyle;
|
|
object.opacity = value16 ? property === (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP ? 0 : 1 : 0;
|
|
items2[3] = object;
|
|
LOTTIE = LottieType.LOTTIE;
|
|
const value17 = !useReducedMotion;
|
|
const lottieAnimationView = <LottieAnimationView style={items2} hardwareAccelerationAndroid={lottieType === LOTTIE} ref={value2} source={value11} autoPlay={value17} onAnimationFinish={value14} loop={false} />;
|
|
const defaultImport2 = LottieAnimationView;
|
|
const items4 = [styles.animation];
|
|
LOTTIE = LottieType.LOTTIE;
|
|
items4[1] = lottieType === LOTTIE && styles.lottie;
|
|
const object2 = {};
|
|
object2.opacity = value16 ? property !== (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP ? 0 : 1 : 0;
|
|
items4[2] = object2;
|
|
LOTTIE = LottieType.LOTTIE;
|
|
return (
|
|
<View style={items3}>
|
|
{lottieAnimationView}
|
|
{((Component) => <Component style={items4} hardwareAccelerationAndroid={lottieType === LOTTIE} ref={value3} source={value12} autoPlay={useReducedMotion ? value17 : property === (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState.LOOP} loop />)(defaultImport2)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun61189() { // fn#61189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:941, offset: 0x0171d91f, size: 70 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
value = require(7644) /* metro dependency 7644: GiftAnimationData */;
|
|
const getGiftAnimationData = value.getGiftAnimationData;
|
|
const giftStyleBinding = giftStyle;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
const ACTION = AnimationState.ACTION;
|
|
return Reflect.apply(getGiftAnimationData, value, [giftStyleBinding, ACTION]);
|
|
}
|
|
|
|
function _fun61190() { // fn#61190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1026, offset: 0x0171d965, size: 70 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
value = require(7644) /* metro dependency 7644: GiftAnimationData */;
|
|
const getGiftAnimationData = value.getGiftAnimationData;
|
|
const giftStyleBinding = giftStyle;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
const LOOP = AnimationState.LOOP;
|
|
return Reflect.apply(getGiftAnimationData, value, [giftStyleBinding, LOOP]);
|
|
}
|
|
|
|
function _fun61191() { // fn#61191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1134, offset: 0x0171d9ab, size: 137 bytes, params: 1, frame: 16
|
|
var binding2;
|
|
var value2;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
let binding = env0_6;
|
|
if (binding !== giftStyle) {
|
|
binding = env0_7;
|
|
binding(giftStyle);
|
|
binding = env0_11;
|
|
binding2 = env0_4;
|
|
value2 = environment.__proto__;
|
|
binding(binding2 !== AnimationState.LOOP && env0_8 != null);
|
|
binding = env0_5;
|
|
binding(AnimationState.ACTION);
|
|
}
|
|
}
|
|
|
|
function _fun61192(a0) { // fn#61192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1264, offset: 0x0171da34, size: 157 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var value3;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
if (env0_10) {
|
|
env0_11(false);
|
|
} else {
|
|
binding = env0_4;
|
|
value3 = environment.__proto__;
|
|
if (!(binding === AnimationState.LOOP || a0)) {
|
|
binding = env0_9;
|
|
binding(AnimationState.ACTION);
|
|
binding = env0_5;
|
|
binding(AnimationState.LOOP);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun61193() { // fn#61193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1407, offset: 0x0171dad1, size: 102 bytes, params: 1, frame: 13
|
|
var current;
|
|
const binding = env0_4;
|
|
const AnimationState = (require(7643) /* metro dependency 7643: PremiumGiftingUtils */).AnimationState;
|
|
const LOOP = AnimationState.LOOP;
|
|
if (binding === LOOP) {
|
|
current = env0_2.current;
|
|
if (current != null) {
|
|
current.reset();
|
|
}
|
|
} else {
|
|
current = env0_3.current;
|
|
if (current != null) {
|
|
current.reset();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun61194() { // fn#61194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7820:1534, offset: 0x0171db37, size: 39 bytes, params: 1, frame: 9
|
|
var current;
|
|
if (useReducedMotion) {
|
|
current = env0_2.current;
|
|
if (current != null) {
|
|
current.reset();
|
|
}
|
|
}
|
|
}
|
|
|