406 lines
19 KiB
React
406 lines
19 KiB
React
/* Metro module 1203; source: unknown; dependencies: [6, 7, 15, 17, 18, 31, 27, 1204, 1010, 1205, 826, 1207, 1208, 1141, 1212, 1210, 1213] */
|
|
function _fun13348(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:6, offset: 0x00de8b89, size: 310 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_8 = value2.Animated;
|
|
const env0_9 = value2.Appearance;
|
|
const env0_10 = value2.Dimensions;
|
|
const env0_11 = value2.Easing;
|
|
const env0_12 = value2.Modal;
|
|
const env0_13 = value2.PanResponder;
|
|
value2.Platform;
|
|
const env0_14 = value2.ScrollView;
|
|
const env0_15 = value2.View;
|
|
const env0_16 = (require(1204) /* metro dependency 1204 */).isNativeDriverSupportedForColorAnimations();
|
|
const Component = value.Component;
|
|
exports.FeedbackWidgetProvider = _fun13352(Component);
|
|
}
|
|
|
|
function _isNativeReflectConstruct_13349() { // fn#13349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:286, offset: 0x00de8cbf, size: 94 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_13349_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun13352(a0) { // fn#13352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:565, offset: 0x00de8d1d, size: 137 bytes, params: 2, frame: 16
|
|
const closure = FeedbackWidgetProvider;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'componentDidMount', value: function() {
|
|
var env0_0 = this;
|
|
this._themeListener = Appearance.addChangeListener(_fun13367);
|
|
}}, {key: 'componentWillUnmount', value: function() {
|
|
if (this._themeListener) {
|
|
this._themeListener.remove();
|
|
}
|
|
}}, {key: 'componentDidUpdate', value: value_13369}, {key: 'render', value: value_13371}]);
|
|
}
|
|
|
|
function FeedbackWidgetProvider(a0) { // fn#13353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:577, offset: 0x00de8da6, size: 454 bytes, params: 2, frame: 21
|
|
env1_2(this, FeedbackWidgetProvider);
|
|
let object = [a0];
|
|
const value3 = env1_5(FeedbackWidgetProvider);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_13349() ? global.Reflect.construct(value3, object,
|
|
env1_5(this).constructor) : value3.apply(this, object));
|
|
object = {'isButtonVisible': false, 'isScreenshotButtonVisible': false, 'isVisible': false,
|
|
'backgroundOpacity': null, 'panY': null, 'isScrollAtTop': true};
|
|
let Value = Animated.Value;
|
|
const value7 = Object.create(Value.prototype, {constructor: {value: Value}});
|
|
const value8 = new Value(0);
|
|
object.backgroundOpacity = value8 instanceof Object ? value8 : value7;
|
|
Value = Animated.Value;
|
|
const get = Dimensions.get;
|
|
const height = Reflect.apply(get, Dimensions, ['screen']).height;
|
|
const value10 = Object.create(Value.prototype, {constructor: {value: Value}});
|
|
const value11 = new Value(height);
|
|
object.panY = value11 instanceof Object ? value11 : value10;
|
|
value6.state = object;
|
|
value6._panResponder = PanResponder.create({onStartShouldSetPanResponder: onStartShouldSetPanResponder,
|
|
onMoveShouldSetPanResponder: onMoveShouldSetPanResponder, onPanResponderMove: onPanResponderMove,
|
|
onPanResponderRelease: onPanResponderRelease});
|
|
value6._handleScroll = _handleScroll;
|
|
value6._setVisibilityFunction = _setVisibilityFunction;
|
|
value6._setButtonVisibilityFunction = _setButtonVisibilityFunction;
|
|
value6._setScreenshotButtonVisibilityFunction = _setScreenshotButtonVisibilityFunction;
|
|
value6._handleClose = function() {
|
|
var FeedbackWidgetManager = require(dependencyMap[9]).FeedbackWidgetManager;
|
|
FeedbackWidgetManager.hide();
|
|
};
|
|
const FeedbackButtonManager = (require(1205) /* metro dependency 1205 */).FeedbackButtonManager;
|
|
let initialize = FeedbackButtonManager.initialize;
|
|
var _setButtonVisibilityFunction = value6._setButtonVisibilityFunction;
|
|
Reflect.apply(initialize, FeedbackButtonManager, [_setButtonVisibilityFunction]);
|
|
const ScreenshotButtonManager = (require(1205) /* metro dependency 1205 */).ScreenshotButtonManager;
|
|
initialize = ScreenshotButtonManager.initialize;
|
|
var _setScreenshotButtonVisibilityFunction = value6._setScreenshotButtonVisibilityFunction;
|
|
Reflect.apply(initialize, ScreenshotButtonManager, [_setScreenshotButtonVisibilityFunction]);
|
|
let FeedbackWidgetManager = (require(1205) /* metro dependency 1205 */).FeedbackWidgetManager;
|
|
initialize = FeedbackWidgetManager.initialize;
|
|
var _setVisibilityFunction = value6._setVisibilityFunction;
|
|
Reflect.apply(initialize, FeedbackWidgetManager, [_setVisibilityFunction]);
|
|
return value6;
|
|
}
|
|
|
|
function value_13366() { // fn#13366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2727, offset: 0x00de92d4, size: 42 bytes, params: 1, frame: 12
|
|
this._themeListener = Appearance.addChangeListener(_fun13367);
|
|
}
|
|
|
|
function value_13369(a0, a1) { // fn#13369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2990, offset: 0x00de9333, size: 314 bytes, params: 3, frame: 23
|
|
var environment;
|
|
var state;
|
|
var value;
|
|
var parallel;
|
|
var timing;
|
|
var backgroundOpacity;
|
|
var object;
|
|
var quad;
|
|
var panY;
|
|
var object3;
|
|
if (a1.isVisible) {
|
|
if (a1.isVisible && !this.state.isVisible) {
|
|
this.state.backgroundOpacity.setValue(0);
|
|
}
|
|
} else {
|
|
state = this.state;
|
|
if (state.isVisible) {
|
|
value = environment.__proto__;
|
|
parallel = Animated.parallel;
|
|
timing = Animated.timing;
|
|
state = this.state;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object = {toValue: 1};
|
|
object.duration = (require(1205) /* metro dependency 1205 */).BACKGROUND_ANIMATION_DURATION;
|
|
object.useNativeDriver = env1_16;
|
|
quad = Easing.quad;
|
|
object.easing = Easing.in(quad);
|
|
value = Reflect.apply(timing, Animated, [backgroundOpacity, object]);
|
|
object = [value];
|
|
timing = Animated.timing;
|
|
state = this.state;
|
|
panY = state.panY;
|
|
object3 = {'toValue': 0, 'duration': null, 'useNativeDriver': true};
|
|
object3.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
quad = Easing.quad;
|
|
object3.easing = Easing.in(quad);
|
|
object[1] = Reflect.apply(timing, Animated, [panY, object3]);
|
|
value = Reflect.apply(parallel, Animated, [object]);
|
|
value.start(function() {
|
|
require(dependencyMap[10]).debug.log('FeedbackWidgetProvider componentDidUpdate');
|
|
});
|
|
} else if (a1.isVisible && !this.state.isVisible) {
|
|
this.state.backgroundOpacity.setValue(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_13371() { // fn#13371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:3511, offset: 0x00de949f, size: 875 bytes, params: 1, frame: 43
|
|
var r7;
|
|
var r6;
|
|
var r1;
|
|
var binding;
|
|
var createElement;
|
|
var Fragment;
|
|
var children;
|
|
var theme;
|
|
var state;
|
|
var isButtonVisible;
|
|
var isScreenshotButtonVisible;
|
|
var isVisible;
|
|
var backgroundOpacity;
|
|
var object2;
|
|
var value3;
|
|
var binding2;
|
|
var createElement2;
|
|
var FeedbackButton;
|
|
var Object;
|
|
var assign;
|
|
var binding3;
|
|
var createElement3;
|
|
var ScreenshotButton;
|
|
var binding4;
|
|
var createElement4;
|
|
var View2;
|
|
var items3;
|
|
var createElement5;
|
|
var object5;
|
|
var _handleClose;
|
|
var createElement6;
|
|
var object6;
|
|
var element3;
|
|
var createElement7;
|
|
var View3;
|
|
var items2;
|
|
var value7;
|
|
var createElement8;
|
|
var object7;
|
|
var createElement9;
|
|
var FeedbackWidget;
|
|
var object10;
|
|
let value = environment.__proto__;
|
|
if ((require(1204) /* metro dependency 1204 */).isModalSupported()) {
|
|
theme = (require(1207) /* metro dependency 1207 */).getTheme();
|
|
state = this.state;
|
|
isButtonVisible = state.isButtonVisible;
|
|
isScreenshotButtonVisible = state.isScreenshotButtonVisible;
|
|
isVisible = state.isVisible;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object2 = {inputRange: [0, 1], outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.9)']};
|
|
value3 = backgroundOpacity.interpolate(object2);
|
|
binding = env1_7;
|
|
createElement = binding.createElement;
|
|
Fragment = binding.Fragment;
|
|
children = this.props.children;
|
|
if (isButtonVisible) {
|
|
binding2 = env1_7;
|
|
createElement2 = binding2.createElement;
|
|
FeedbackButton = (require(1208) /* metro dependency 1208 */).FeedbackButton;
|
|
Object = global.Object;
|
|
r7 = Reflect.apply(createElement2, binding2, [FeedbackButton, Object.assign({},
|
|
(require(1141) /* metro dependency 1141 */).getFeedbackButtonOptions())]);
|
|
} else {
|
|
r7 = isButtonVisible;
|
|
}
|
|
if (isScreenshotButtonVisible) {
|
|
binding3 = env1_7;
|
|
createElement3 = binding3.createElement;
|
|
ScreenshotButton = (require(1212) /* metro dependency 1212 */).ScreenshotButton;
|
|
Object = global.Object;
|
|
r6 = Reflect.apply(createElement3, binding3, [ScreenshotButton, Object.assign({},
|
|
(require(1141) /* metro dependency 1141 */).getScreenshotButtonOptions())]);
|
|
} else {
|
|
r6 = isScreenshotButtonVisible;
|
|
}
|
|
if (isVisible) {
|
|
binding4 = env1_7;
|
|
createElement4 = binding4.createElement;
|
|
View2 = Animated.View;
|
|
object2 = {};
|
|
items3 = [(require(1210) /* metro dependency 1210 */).modalWrapper];
|
|
items3[1] = {backgroundColor: value3};
|
|
object2.style = items3;
|
|
createElement5 = binding4.createElement;
|
|
object5 = {'visible': null, 'transparent': true, 'animationType': 'none', 'onRequestClose': null,
|
|
'testID': 'feedback-form-modal'};
|
|
object5.visible = isVisible;
|
|
_handleClose = this._handleClose;
|
|
object5.onRequestClose = _handleClose;
|
|
createElement6 = binding4.createElement;
|
|
object6 = {};
|
|
object6.style = (require(1210) /* metro dependency 1210 */).topSpacer;
|
|
element3 = Reflect.apply(createElement6, binding4, [View, object6]);
|
|
createElement7 = binding4.createElement;
|
|
View3 = Animated.View;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
items2 = [(require(1210) /* metro dependency 1210 */).modalSheetContainer(theme)];
|
|
items2[1] = {transform: [{translateY: this.state.panY}]};
|
|
value7 = Reflect.apply(assign, Object, [{style: items2}, this._panResponder.panHandlers]);
|
|
createElement8 = binding4.createElement;
|
|
object7 = {'bounces': false, 'keyboardShouldPersistTaps': 'handled',
|
|
'automaticallyAdjustKeyboardInsets': false};
|
|
object7.onScroll = this._handleScroll;
|
|
createElement9 = binding4.createElement;
|
|
FeedbackWidget = (require(1213) /* metro dependency 1213 */).FeedbackWidget;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
value = require(1141) /* metro dependency 1141 */;
|
|
value = value.getFeedbackOptions();
|
|
object10 = {};
|
|
_handleClose = this._handleClose;
|
|
object10.onFormClose = _handleClose;
|
|
_handleClose = this._handleClose;
|
|
object10.onFormSubmitted = _handleClose;
|
|
value = Reflect.apply(createElement7, binding4, [View3, value7, Reflect.apply(createElement8, binding4,
|
|
[ScrollView,
|
|
object7, Reflect.apply(createElement9, binding4, [FeedbackWidget, Reflect.apply(assign, Object, [{},
|
|
value,
|
|
object10])])])]);
|
|
value = Reflect.apply(createElement5, binding4, [Modal, object5, element3, value]);
|
|
value = Reflect.apply(createElement4, binding4, [View2, object2, value]);
|
|
r1 = value;
|
|
} else {
|
|
r1 = isVisible;
|
|
}
|
|
return Reflect.apply(createElement, binding, [Fragment, null, children, r7, r6, r1]);
|
|
}
|
|
(require(826) /* metro dependency 826 */).debug.error('FeedbackWidget Modal is not supported in React Native < 0.71 with Fabric renderer.');
|
|
binding = env1_7;
|
|
createElement = binding.createElement;
|
|
Fragment = binding.Fragment;
|
|
return Reflect.apply(createElement, binding, [Fragment, null, this.props.children]);
|
|
}
|
|
|
|
function FeedbackWidgetProviderOnStartShouldSetPanResponder(a0, a1) { // fn#13354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1040, owner: FeedbackWidgetProvider.onStartShouldSetPanResponder, offset: 0x00de8f6c, size: 76 bytes, params: 3, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(1010) /* metro dependency 1010 */;
|
|
value = value.notWeb();
|
|
return value && env0_0.state.isScrollAtTop && a1.dy > 0;
|
|
}
|
|
|
|
function FeedbackWidgetProviderOnPanResponderMove(a0, a1) { // fn#13356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1284, owner: FeedbackWidgetProvider.onPanResponderMove, offset: 0x00de8fb8, size: 54 bytes, params: 3, frame: 11
|
|
var panY;
|
|
if (a1.dy > 0) {
|
|
panY = env0_0.state.panY;
|
|
panY.setValue(a1.dy);
|
|
}
|
|
}
|
|
|
|
function FeedbackWidgetProviderOnPanResponderRelease(a0, {dy}) { // fn#13357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1376, owner: FeedbackWidgetProvider.onPanResponderRelease, offset: 0x00de8fee, size: 220 bytes, params: 3, frame: 19
|
|
var environment;
|
|
var panY;
|
|
var timing;
|
|
var object2;
|
|
const value = environment.__proto__.__proto__;
|
|
const PULL_DOWN_CLOSE_THRESHOLD = (require(1205) /* metro dependency 1205 */).PULL_DOWN_CLOSE_THRESHOLD;
|
|
if (dy > PULL_DOWN_CLOSE_THRESHOLD) {
|
|
timing = Animated.timing;
|
|
panY = env0_0.state.panY;
|
|
object2 = {};
|
|
object2.toValue = Dimensions.get('screen').height;
|
|
object2.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
object2.useNativeDriver = true;
|
|
Reflect.apply(timing, Animated, [panY, object2]).start(_fun13358);
|
|
} else {
|
|
Animated.spring(env0_0.state.panY, {'toValue': 0, 'useNativeDriver': true}).start();
|
|
}
|
|
}
|
|
|
|
function FeedbackWidgetProvider_handleScroll({nativeEvent}) { // fn#13359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1687, owner: FeedbackWidgetProvider._handleScroll, offset: 0x00de90df, size: 55 bytes, params: 2, frame: 13
|
|
env0_0.setState({isScrollAtTop: nativeEvent.contentOffset.y <= 0});
|
|
}
|
|
|
|
function _setVisibilityFunction(a0) { // fn#13360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1786, owner: FeedbackWidgetProvider._setVisibilityFunction, offset: 0x00de9116, size: 288 bytes, params: 2, frame: 25
|
|
var environment;
|
|
var value;
|
|
var parallel;
|
|
var timing;
|
|
var binding;
|
|
var state;
|
|
var panY;
|
|
var object;
|
|
var out;
|
|
var quad;
|
|
var backgroundOpacity;
|
|
var object3;
|
|
if (a0) {
|
|
_setVisibilityFunctionUpdateState();
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
parallel = Animated.parallel;
|
|
timing = Animated.timing;
|
|
binding = a0;
|
|
state = binding.state;
|
|
panY = state.panY;
|
|
object = {};
|
|
object.toValue = Dimensions.get('screen').height;
|
|
object.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
object.useNativeDriver = true;
|
|
out = Easing.out;
|
|
quad = Easing.quad;
|
|
object.easing = Reflect.apply(out, Easing, [quad]);
|
|
object = [Reflect.apply(timing, Animated, [panY, object])];
|
|
timing = Animated.timing;
|
|
state = binding.state;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object3 = {toValue: 0};
|
|
object3.duration = (require(1205) /* metro dependency 1205 */).BACKGROUND_ANIMATION_DURATION;
|
|
object3.useNativeDriver = env2_16;
|
|
out = Easing.out;
|
|
quad = Easing.quad;
|
|
object3.easing = Reflect.apply(out, Easing, [quad]);
|
|
object[1] = Reflect.apply(timing, Animated, [backgroundOpacity, object3]);
|
|
value = Reflect.apply(parallel, Animated, [object]);
|
|
value.start(function() {
|
|
_setVisibilityFunctionUpdateState();
|
|
});
|
|
}
|
|
}
|
|
|
|
function _setButtonVisibilityFunction(a0) { // fn#13363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2203, owner: FeedbackWidgetProvider._setButtonVisibilityFunction, offset: 0x00de9269, size: 32 bytes, params: 2, frame: 12
|
|
env0_0.setState({isButtonVisible: a0});
|
|
}
|
|
|
|
function _setScreenshotButtonVisibilityFunction(a0) { // fn#13364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2289, owner: FeedbackWidgetProvider._setScreenshotButtonVisibilityFunction, offset: 0x00de9289, size: 32 bytes, params: 2, frame: 12
|
|
env0_0.setState({isScreenshotButtonVisible: a0});
|
|
}
|
|
|
|
function _fun13358() { // fn#13358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1575, offset: 0x00de90ca, size: 21 bytes, params: 1, frame: 9
|
|
env1_0._handleClose();
|
|
}
|
|
|
|
function _setVisibilityFunctionUpdateState() { // fn#13361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1804, owner: FeedbackWidgetProvider._setVisibilityFunction.updateState, offset: 0x00de9236, size: 36 bytes, params: 1, frame: 12
|
|
env1_0.setState({isVisible: env0_0});
|
|
}
|
|
|