/* Metro module 14450; source: components_native/common/UnreadBars.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 4502, 661, 33, 4501, 6597, 697, 4000, 4081, 4082, 1305, 1244, 3868, 566, 11206, 2] */ function _fun109356(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:6, offset: 0x02348365, size: 636 bytes, params: 8, frame: 28 var object3; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(6) /* metro dependency 6 */; const env0_4 = importDefault(7) /* metro dependency 7 */; const env0_5 = importDefault(15) /* metro dependency 15 */; const env0_6 = importDefault(17) /* metro dependency 17 */; const env0_7 = importDefault(18) /* metro dependency 18 */; let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const env0_9 = value2.View; const env0_10 = value2.Animated; const env0_11 = value2.TouchableWithoutFeedback; const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */; const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts; const value3 = require(33) /* metro dependency 33 */; const env0_13 = value3.jsx; const env0_14 = value3.jsxs; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles; object3 = {}; const object5 = {}; const textStyles = importDefault(6597) /* metro dependency 6597: TextStyles */; const DISPLAY_SEMIBOLD = Fonts.DISPLAY_SEMIBOLD; const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE; copyDataProperties(object5, textStyles(DISPLAY_SEMIBOLD, WHITE, 12, {uppercase: true}), 12); object3.unreadText = object5; const object6 = {'margin': 8, 'height': 24, 'justifyContent': 'center', 'alignItems': 'center'}; object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md; const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */; let hexWithOpacity = colorUtilsModule.hexWithOpacity; const PRIMARY_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_400; object6.backgroundColor = Reflect.apply(hexWithOpacity, colorUtilsModule, [PRIMARY_400, 0.9]); object3.unread = object6; const value7 = colorUtilsModule; hexWithOpacity = value7.hexWithOpacity; const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400; object3.mention = {backgroundColor: Reflect.apply(hexWithOpacity, value7, [RED_400, 0.9])}; const env0_15 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object3]); const PureComponent = value.PureComponent; value = _fun109360(PureComponent); value.defaultProps = {bottom: false}; const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext; value.contextType = ThemeContext; (require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/common/UnreadBars.tsx'); exports.default = UnreadBars; } function _isNativeReflectConstruct_109357() { // fn#109357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:272, offset: 0x023485e1, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_109357_isNativeReflectConstruct = function() { return !!result; })(); } function _fun109360(a0) { // fn#109360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:886, offset: 0x02348643, size: 199 bytes, params: 2, frame: 16 const closure = UnreadBar; env0_7(closure, a0); return env0_4(closure, [{key: 'componentWillEnter', value: function(a0) { this.show(a0); }}, {key: 'componentWillLeave', value: function(a0) { this.hide(a0); }}, {key: 'show', value: value_109367}, {key: 'hide', value: value_109368}, {key: 'getAnimatedStyle', value: value_109369}, {key: 'render', value: value_109370}]); } function UnreadBars({scrollToLocation, beforeItem, afterItem, compact, contentInset = {'top': 0, 'left': 0, 'right': 0, 'bottom': 0}}) { // fn#109371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:3068, offset: 0x02348bff, size: 306 bytes, params: 2, frame: 27 compact = !(compact === undefined) && compact; const closure = function({section, row}) { scrollToLocation({section: section, item: row, animated: true}); }; const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() { return AccessibilityStore.useReducedMotion; }); const TransitionGroup = (require(11206) /* metro dependency 11206: TransitionGroup */).TransitionGroup; const Fragment = env0_8.Fragment; return ( {beforeItem != null ? ((Component) => )(env0_16) : null} {afterItem != null ? ((Component) => )(env0_16) : null} ); } function UnreadBar(a0) { // fn#109361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:898, offset: 0x0234870a, size: 224 bytes, params: 2, frame: 22 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, UnreadBar); const items = []; arraySpread(items, value, 0, items); value = env1_6(UnreadBar); binding = env1_5; if (_isNativeReflectConstruct_109357()) { Reflect = global.Reflect; value = Reflect.construct(value, items, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, items); r0 = value; } value = binding(this, r0); value.state = {active: false}; const Value = Animated.Value; const value4 = Object.create(Value.prototype, {constructor: {value: Value}}); const value5 = new Value(0); value.animation = value5 instanceof Object ? value5 : value4; value.handlePress = handlePress_109362; value.handlePressIn = handlePressIn; value.handlePressOut = handlePressOut; return value; } function value_109367(a0) { // fn#109367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:1547, offset: 0x02348894, size: 59 bytes, params: 2, frame: 13 const value = environment.__proto__; Animated.spring(this.animation, {'toValue': 1, 'friction': 15, 'tension': 250, 'useNativeDriver': true}).start(a0); } function value_109368(a0) { // fn#109368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:1668, offset: 0x023488cf, size: 59 bytes, params: 2, frame: 13 const value = environment.__proto__; Animated.spring(this.animation, {'toValue': 0, 'friction': 15, 'tension': 250, 'useNativeDriver': true}).start(a0); } function value_109369() { // fn#109369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:1801, offset: 0x0234890a, size: 310 bytes, params: 1, frame: 21 var r11; var r0; var top; var value4; var object3; var animation; var object5; const {bottom, contentInset, useReducedMotion} = this.props; const active = this.state.active; const object6 = {position: 'absolute'}; const left = contentInset.left; const value = 0; let r1 = left ?? value; object6.left = r1; object6.right = contentInset.right ?? value; const r4 = bottom ? 'bottom' : 'top'; if (bottom) { r1 = contentInset.bottom ?? value; } else { top = contentInset.top; value4 = top != null; r1 = value4 ? top : value; r11 = value4; } object6[r4] = r1; if (useReducedMotion) { object5 = {}; copyDataProperties(object5, object6, r11); object5['opacity'] = this.animation; r0 = object5; } else { object3 = {}; copyDataProperties(object3, object6, r11); animation = this.animation; object3['opacity'] = animation; animation = this.animation; object3['transform'] = [{translateY: animation.interpolate({inputRange: [0, 1], outputRange: [bottom ? 72 : -72, active ? 1 : value]})}]; r0 = object3; } return r0; } function value_109370() { // fn#109370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:2240, offset: 0x02348a40, size: 447 bytes, params: 1, frame: 28 const value = environment.__proto__; const binding = env1_15; const context = this.context; const value2 = undefined; const value3 = binding(context); const {compact, item} = this.props; const mention2 = item.mention; const section = item.section; const handlePress = this.handlePress; const handlePressIn = this.handlePressIn; const handlePressOut = this.handlePressOut; const View2 = Animated.View; const view2Props = {style: this.getAnimatedStyle(), nativeID: 'unread-bar-animated-view-' + mention2 + '-' + section}; const items2 = [value3.unread]; items2[1] = mention2 ? value3.mention : value2; const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText; const unreadText = value3.unreadText; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const string = intl.string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; return ( {compact ? Reflect.apply(string, intl, [t.y2b7CA]) : mention2 ? Reflect.apply(string, intl, [t['8zH0LJ']]) : Reflect.apply(string, intl, [t.FCRiT3])} ); } function UnreadBarHandlePress() { // fn#109362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:1172, owner: UnreadBar.handlePress, offset: 0x023487ea, size: 97 bytes, params: 1, frame: 17 const binding = env0_0; const {item, onPress} = binding.props; const hapticUtilsNativeModule = require(4081) /* metro dependency 4081: HapticUtilsNative */; const triggerHapticFeedback = hapticUtilsNativeModule.triggerHapticFeedback; const IMPACT_LIGHT = (importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT; Reflect.apply(triggerHapticFeedback, hapticUtilsNativeModule, [IMPACT_LIGHT]); binding.hide(); onPress(item); } function handlePressIn() { // fn#109363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14647:1297, owner: UnreadBar.handlePressIn, offset: 0x0234884b, size: 31 bytes, params: 1, frame: 12 env0_0.setState({active: true}); }