396 lines
16 KiB
React
396 lines
16 KiB
React
/* Metro module 5388; source: unknown; dependencies: [6, 7, 15, 17, 18, 31, 27, 33, 5326, 5383] */
|
|
function _fun47546(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#47546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:6, offset: 0x011c39ca, size: 303 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 */;
|
|
importAll(31) /* metro dependency 31 */;
|
|
const Component = (require(31) /* metro dependency 31 */).Component;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_7 = value.Animated;
|
|
value.Platform;
|
|
const env0_8 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = _fun47550(Component);
|
|
value.defaultProps = {delayLongPress: 600, extraButtonProps: {'rippleColor': 'transparent', 'exclusive': true}};
|
|
exports.default = value;
|
|
exports.TOUCHABLE_STATE = {'UNDETERMINED': 0, 'BEGAN': 1, 'MOVED_OUTSIDE': 2};
|
|
}
|
|
|
|
function _isNativeReflectConstruct_47547() { // fn#47547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:228, offset: 0x011c3af9, 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_47547_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun47550(a0) { // fn#47550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:496, offset: 0x011c3b57, size: 283 bytes, params: 2, frame: 16
|
|
const closure = GenericTouchable;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'handlePressIn', value: value_47555}, {key: 'handleMoveOutside', value: value_47557},
|
|
{key: 'handleGoToUndetermined', value: value_47559}, {key: 'componentDidMount', value: function() {
|
|
this.reset();
|
|
}}, {key: 'reset', value: function() {
|
|
this.longPressDetected = false;
|
|
this.pointerInside = true;
|
|
global.clearTimeout(this.pressInTimeout);
|
|
global.clearTimeout(this.pressOutTimeout);
|
|
global.clearTimeout(this.longPressTimeout);
|
|
this.pressOutTimeout = null;
|
|
this.longPressTimeout = null;
|
|
this.pressInTimeout = null;
|
|
}}, {key: 'moveToState', value: value_47563}, {key: 'componentWillUnmount', value: function() {
|
|
this.reset();
|
|
}}, {key: 'onMoveIn', value: value_47565}, {key: 'onMoveOut', value: value_47566}, {key: 'render',
|
|
value: value_47567}]);
|
|
}
|
|
|
|
function GenericTouchable() { // fn#47551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:508, offset: 0x011c3c72, size: 261 bytes, params: 1, frame: 21
|
|
var r3;
|
|
var r7;
|
|
var r0;
|
|
var value7;
|
|
var Reflect;
|
|
var construct;
|
|
let binding = env1_2;
|
|
binding(this, GenericTouchable);
|
|
const length = arguments.length;
|
|
const Array = global.Array;
|
|
const array = new Array(length);
|
|
const value6 = 0;
|
|
if (value6 < length) {
|
|
r3 = value6;
|
|
reducibleLoop1: while (true) {
|
|
array[r3] = arguments[r3];
|
|
value7 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
|
|
if (value7 < length) {
|
|
r3 = value7;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
}
|
|
const value8 = [].concat(array);
|
|
const value9 = env1_5(GenericTouchable);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_47547()) {
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
reducibleJoin6: while (true) {
|
|
if (value8) {
|
|
r7 = value8;
|
|
break reducibleJoin6;
|
|
}
|
|
r7 = [];
|
|
break reducibleJoin6;
|
|
}
|
|
r0 = Reflect.apply(construct, Reflect, [value9, r7, env1_5(this).constructor]);
|
|
} else {
|
|
r0 = value9.apply(this, value8);
|
|
}
|
|
const value12 = binding(this, r0);
|
|
value12.longPressDetected = false;
|
|
value12.pointerInside = true;
|
|
const UNDETERMINED = env1_9.UNDETERMINED;
|
|
value12.STATE = UNDETERMINED;
|
|
value12.onGestureEvent = onGestureEvent;
|
|
value12.onHandlerStateChange = onHandlerStateChange;
|
|
value12.onLongPressDetected = onLongPressDetected;
|
|
return value12;
|
|
}
|
|
|
|
function value_47555() { // fn#47555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:1608, offset: 0x011c3f69, size: 169 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var delayLongPress;
|
|
var moveToState;
|
|
var value;
|
|
let props = this.props;
|
|
let delayPressIn = props.delayPressIn;
|
|
if (delayPressIn) {
|
|
this.pressInTimeout = global.setTimeout(_fun47556, this.props.delayPressIn);
|
|
} else {
|
|
moveToState = this.moveToState;
|
|
value = environment.__proto__;
|
|
Reflect.apply(moveToState, this, [env1_9.BEGAN]);
|
|
}
|
|
props = this.props;
|
|
if (props.onLongPress) {
|
|
props = this.props;
|
|
delayPressIn = props.delayPressIn;
|
|
delayPressIn = !delayPressIn ? 0 : delayPressIn;
|
|
props = this.props;
|
|
delayLongPress = props.delayLongPress;
|
|
delayLongPress = !delayLongPress ? 0 : delayLongPress;
|
|
this.longPressTimeout = global.setTimeout(this.onLongPressDetected, delayPressIn + delayLongPress);
|
|
}
|
|
}
|
|
|
|
function value_47557() { // fn#47557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:1997, offset: 0x011c403d, size: 100 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var moveToState;
|
|
var value;
|
|
if (this.props.delayPressOut) {
|
|
this.pressOutTimeout = this.pressOutTimeout || global.setTimeout(_fun47558, this.props.delayPressOut);
|
|
} else {
|
|
moveToState = this.moveToState;
|
|
value = environment.__proto__;
|
|
Reflect.apply(moveToState, this, [env1_9.MOVED_OUTSIDE]);
|
|
}
|
|
}
|
|
|
|
function value_47559() { // fn#47559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:2282, offset: 0x011c40cc, size: 147 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var STATE;
|
|
var value;
|
|
var UNDETERMINED;
|
|
var moveToState;
|
|
global.clearTimeout(this.pressOutTimeout);
|
|
if (this.props.delayPressOut) {
|
|
this.pressOutTimeout = global.setTimeout(_fun47560, this.props.delayPressOut);
|
|
} else {
|
|
STATE = this.STATE;
|
|
value = environment.__proto__;
|
|
UNDETERMINED = env1_9.UNDETERMINED;
|
|
if (STATE === UNDETERMINED) {
|
|
this.moveToState(env1_9.BEGAN);
|
|
}
|
|
moveToState = this.moveToState;
|
|
UNDETERMINED = env1_9.UNDETERMINED;
|
|
Reflect.apply(moveToState, this, [UNDETERMINED]);
|
|
}
|
|
}
|
|
|
|
function value_47563(a0) { // fn#47563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:3022, offset: 0x011c421b, size: 224 bytes, params: 2, frame: 16
|
|
var value;
|
|
var props;
|
|
var onPressOut;
|
|
var onPressIn;
|
|
var onStateChange;
|
|
const STATE = this.STATE;
|
|
if (a0 !== STATE) {
|
|
value = environment.__proto__;
|
|
if (a0 === env1_9.BEGAN) {
|
|
props = this.props;
|
|
onPressIn = props.onPressIn;
|
|
if (onPressIn != null) {
|
|
onPressIn.call(props);
|
|
}
|
|
} else if (a0 === env1_9.MOVED_OUTSIDE) {
|
|
props = this.props;
|
|
onPressOut = props.onPressOut;
|
|
if (onPressOut != null) {
|
|
onPressOut.call(props);
|
|
}
|
|
} else if (a0 === env1_9.UNDETERMINED) {
|
|
this.reset();
|
|
if (this.STATE === env1_9.BEGAN) {
|
|
props = this.props;
|
|
onPressOut = props.onPressOut;
|
|
if (onPressOut != null) {
|
|
onPressOut.call(props);
|
|
}
|
|
}
|
|
}
|
|
props = this.props;
|
|
onStateChange = props.onStateChange;
|
|
if (onStateChange != null) {
|
|
onStateChange.call(props, this.STATE, a0);
|
|
}
|
|
this.STATE = a0;
|
|
}
|
|
}
|
|
|
|
function value_47565() { // fn#47565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:3528, offset: 0x011c42fb, size: 51 bytes, params: 1, frame: 12
|
|
const STATE = this.STATE;
|
|
const MOVED_OUTSIDE = env1_9.MOVED_OUTSIDE;
|
|
if (STATE === MOVED_OUTSIDE) {
|
|
this.moveToState(env1_9.BEGAN);
|
|
}
|
|
}
|
|
|
|
function value_47566() { // fn#47566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:3629, offset: 0x011c432e, size: 69 bytes, params: 1, frame: 12
|
|
global.clearTimeout(this.longPressTimeout);
|
|
this.longPressTimeout = null;
|
|
const STATE = this.STATE;
|
|
const BEGAN = env1_9.BEGAN;
|
|
if (STATE === BEGAN) {
|
|
this.handleMoveOutside();
|
|
}
|
|
}
|
|
|
|
function value_47567() { // fn#47567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:3782, offset: 0x011c4373, size: 578 bytes, params: 1, frame: 26
|
|
var r1;
|
|
var object4;
|
|
let props = this.props;
|
|
let hitSlop = props.hitSlop;
|
|
if (typeof hitSlop === 'number') {
|
|
object4 = {};
|
|
props = this.props;
|
|
hitSlop = props.hitSlop;
|
|
object4.top = hitSlop;
|
|
props = this.props;
|
|
hitSlop = props.hitSlop;
|
|
object4.left = hitSlop;
|
|
props = this.props;
|
|
hitSlop = props.hitSlop;
|
|
object4.bottom = hitSlop;
|
|
props = this.props;
|
|
hitSlop = props.hitSlop;
|
|
object4.right = hitSlop;
|
|
r1 = object4;
|
|
} else {
|
|
r1 = this.props.hitSlop;
|
|
}
|
|
const value = undefined;
|
|
const r4 = r1 ?? value;
|
|
object4 = {accessible: this.props.accessible !== false, accessibilityLabel: this.props.accessibilityLabel};
|
|
const accessibilityHint = this.props.accessibilityHint;
|
|
object4.accessibilityHint = accessibilityHint;
|
|
object4.accessibilityRole = this.props.accessibilityRole;
|
|
object4.accessibilityState = this.props.accessibilityState;
|
|
object4.accessibilityActions = this.props.accessibilityActions;
|
|
object4.onAccessibilityAction = this.props.onAccessibilityAction;
|
|
object4.nativeID = this.props.nativeID;
|
|
object4.onLayout = this.props.onLayout;
|
|
const BaseButton = (require(5383) /* metro dependency 5383 */).BaseButton;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const object5 = {};
|
|
object5.style = this.props.containerStyle;
|
|
object5.onHandlerStateChange = this.props.disabled ? value : this.onHandlerStateChange;
|
|
object5.onGestureEvent = this.onGestureEvent;
|
|
object5.hitSlop = r4;
|
|
const userSelect = this.props.userSelect;
|
|
object5.userSelect = userSelect;
|
|
object5.shouldActivateOnStart = this.props.shouldActivateOnStart;
|
|
object5.disallowInterruption = this.props.disallowInterruption;
|
|
object5.testID = this.props.testID;
|
|
const touchSoundDisabled = this.props.touchSoundDisabled;
|
|
object5.touchSoundDisabled = touchSoundDisabled != null && touchSoundDisabled;
|
|
object5.enabled = !this.props.disabled;
|
|
const extraButtonProps = this.props.extraButtonProps;
|
|
const object6 = {};
|
|
const View = Animated.View;
|
|
const Object2 = global.Object;
|
|
object6.children = <View {...Object2.assign({}, object4, {style: this.props.style,
|
|
children: this.props.children})} />;
|
|
return <BaseButton {...Reflect.apply(assign, Object, [object5, extraButtonProps, object6])} />;
|
|
}
|
|
|
|
function GenericTouchableOnGestureEvent({nativeEvent}) { // fn#47552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:897, owner: GenericTouchable.onGestureEvent, offset: 0x011c3d77, size: 79 bytes, params: 2, frame: 11
|
|
var binding;
|
|
const pointerInside = nativeEvent.pointerInside;
|
|
if (env0_0.pointerInside !== pointerInside) {
|
|
binding = env0_0;
|
|
if (pointerInside) {
|
|
binding.onMoveIn();
|
|
} else {
|
|
binding.onMoveOut();
|
|
}
|
|
}
|
|
env0_0.pointerInside = pointerInside;
|
|
}
|
|
|
|
function GenericTouchableOnHandlerStateChange({nativeEvent}) { // fn#47553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:1037, owner: GenericTouchable.onHandlerStateChange, offset: 0x011c3dc6, size: 360 bytes, params: 2, frame: 15
|
|
var r4;
|
|
var binding;
|
|
const state = nativeEvent.state;
|
|
const value = environment.__proto__.__proto__;
|
|
const State = (require(5326) /* metro dependency 5326 */).State;
|
|
const CANCELLED = State.CANCELLED;
|
|
if (state === CANCELLED) {
|
|
binding = env0_0;
|
|
binding.moveToState(env2_9.UNDETERMINED);
|
|
} else if (state === State.FAILED) {
|
|
binding = env0_0;
|
|
binding.moveToState(env2_9.UNDETERMINED);
|
|
} else if (state !== State.BEGAN) {
|
|
if (state === State.END) {
|
|
r4 = !env0_0.longPressDetected && env0_0.STATE !== env2_9.MOVED_OUTSIDE;
|
|
r4 = r4 && env0_0.pressOutTimeout === null;
|
|
env0_0.handleGoToUndetermined();
|
|
if (r4) {
|
|
if (env0_0.props.onPress != null) {
|
|
env0_0.props.onPress();
|
|
}
|
|
}
|
|
}
|
|
} else if (env0_0.STATE === env2_9.UNDETERMINED) {
|
|
env0_0.handlePressIn();
|
|
} else if (state === State.END) {
|
|
r4 = !env0_0.longPressDetected && env0_0.STATE !== env2_9.MOVED_OUTSIDE;
|
|
r4 = r4 && env0_0.pressOutTimeout === null;
|
|
env0_0.handleGoToUndetermined();
|
|
if (r4) {
|
|
if (env0_0.props.onPress != null) {
|
|
env0_0.props.onPress();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function onLongPressDetected() { // fn#47554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:1446, owner: GenericTouchable.onLongPressDetected, offset: 0x011c3f2e, size: 59 bytes, params: 1, frame: 10
|
|
env0_0.longPressDetected = true;
|
|
if (env0_0.props.onLongPress != null) {
|
|
env0_0.props.onLongPress();
|
|
}
|
|
}
|
|
|
|
function _fun47556() { // fn#47556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:1703, offset: 0x011c4012, size: 43 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
const moveToState = binding.moveToState;
|
|
const BEGAN = env2_9.BEGAN;
|
|
Reflect.apply(moveToState, binding, [BEGAN]);
|
|
binding.pressInTimeout = null;
|
|
}
|
|
|
|
function _fun47558() { // fn#47558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:2117, offset: 0x011c40a1, size: 43 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
const moveToState = binding.moveToState;
|
|
const MOVED_OUTSIDE = env2_9.MOVED_OUTSIDE;
|
|
Reflect.apply(moveToState, binding, [MOVED_OUTSIDE]);
|
|
binding.pressOutTimeout = null;
|
|
}
|
|
|
|
function _fun47560() { // fn#47560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5566:2420, offset: 0x011c415f, size: 92 bytes, params: 1, frame: 13
|
|
var binding;
|
|
const STATE = env0_0.STATE;
|
|
let UNDETERMINED = env2_9.UNDETERMINED;
|
|
if (STATE === UNDETERMINED) {
|
|
binding = env0_0;
|
|
binding.moveToState(env2_9.BEGAN);
|
|
}
|
|
binding = env0_0;
|
|
const moveToState = binding.moveToState;
|
|
UNDETERMINED = env2_9.UNDETERMINED;
|
|
Reflect.apply(moveToState, binding, [UNDETERMINED]);
|
|
binding.pressOutTimeout = null;
|
|
}
|
|
|