619 lines
29 KiB
React
619 lines
29 KiB
React
/* Metro module 6410; source: unknown; dependencies: [6411, 6365, 31, 27, 6412, 6413, 6380, 6414, 6408] */
|
|
function _fun50251(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:6, offset: 0x01215082, size: 180 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6411) /* metro dependency 6411 */;
|
|
const env0_3 = importDefault(6365) /* metro dependency 6365 */;
|
|
const value = require(31) /* metro dependency 31 */;
|
|
const env0_4 = value.useCallback;
|
|
const env0_5 = value.useImperativeHandle;
|
|
const env0_6 = value.useMemo;
|
|
const env0_7 = value.useRef;
|
|
const env0_8 = value.useState;
|
|
const env0_9 = (require(27) /* metro dependency 27 */).I18nManager;
|
|
exports.useRecyclerViewController = useRecyclerViewController;
|
|
}
|
|
|
|
function useRecyclerViewController(a0, a1, a2, a3) { // fn#50252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:252, offset: 0x01215136, size: 424 bytes, params: 5, frame: 24
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
const value2 = (require(6412) /* metro dependency 6412 */).useUnmountFlag();
|
|
const value4 = value2(useState(0), 2);
|
|
value4[0];
|
|
const env0_4 = value4[1];
|
|
const env0_5 = useRef(false);
|
|
const env0_6 = useRef(false);
|
|
const getDataLength = a0.getDataLength;
|
|
const env0_7 = useRef(Reflect.apply(getDataLength, a0, []));
|
|
const moduleValue2 = require(6413) /* metro dependency 6413 */;
|
|
const useUnmountAwareTimeout = moduleValue2.useUnmountAwareTimeout;
|
|
const setTimeout = Reflect.apply(useUnmountAwareTimeout, moduleValue2, []).setTimeout;
|
|
const env0_9 = useRef(undefined);
|
|
const env0_10 = useRef(undefined);
|
|
const env0_11 = useRef([]);
|
|
const value5 = useCallback(_fun50253, [a0]);
|
|
const value6 = useCallback(_fun50255, [a0]);
|
|
const value7 = useCallback(_fun50256, [a0, a3, a2, setTimeout, value5, value6]);
|
|
const value8 = useMemo(_fun50262, [a0, a2, setTimeout, value2, value5]);
|
|
const value9 = useCallback(_fun50295, [value8, a0, setTimeout]);
|
|
useImperativeHandle(a1, _fun50298, [value8, a2, a0]);
|
|
return {applyOffsetCorrection: value7, computeFirstVisibleIndexForOffsetCorrection: value6,
|
|
applyInitialScrollIndex: value9, handlerMethods: value8};
|
|
}
|
|
|
|
function _fun50253(a0, a1) { // fn#50253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:479, offset: 0x012152de, size: 73 bytes, params: 3, frame: 13
|
|
if (env0_0.updateScrollOffset(a0) !== undefined) {
|
|
env0_11.current.push(a1);
|
|
env0_4(function(a0) {
|
|
return a0 + 1;
|
|
});
|
|
} else {
|
|
a1();
|
|
}
|
|
}
|
|
|
|
function _fun50255() { // fn#50255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:591, offset: 0x01215327, size: 207 bytes, params: 1, frame: 16
|
|
var Math;
|
|
var max;
|
|
var value3;
|
|
var binding2;
|
|
var Object;
|
|
let binding = env0_0;
|
|
const getIsFirstLayoutComplete = binding.getIsFirstLayoutComplete;
|
|
if (Reflect.apply(getIsFirstLayoutComplete, binding, [])) {
|
|
binding = env0_0;
|
|
if (binding.hasStableDataKeys()) {
|
|
binding = env0_0;
|
|
if (binding.getDataLength() > 0) {
|
|
binding = env0_0;
|
|
if (binding.shouldMaintainVisibleContentPosition()) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
binding = env0_0;
|
|
value3 = Reflect.apply(max, Math, [0, binding.computeVisibleIndices().startIndex]);
|
|
if (value3 !== undefined && value3 >= 0) {
|
|
binding = env0_9;
|
|
binding2 = env0_0;
|
|
binding.current = binding2.getDataKey(value3);
|
|
binding = env0_10;
|
|
Object = global.Object;
|
|
binding.current = Object.assign({}, binding2.getLayout(value3));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun50256() { // fn#50256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:878, offset: 0x012153f6, size: 643 bytes, params: 1, frame: 23
|
|
var environment;
|
|
var r5;
|
|
var r13;
|
|
var value3;
|
|
var layout;
|
|
var Object;
|
|
var value11;
|
|
var object2;
|
|
var value12;
|
|
var binding4;
|
|
let binding = env0_0;
|
|
const {horizontal, data} = binding.props;
|
|
const binding2 = env0_11;
|
|
let current = binding2.current;
|
|
binding2.current = [];
|
|
current.forEach(function(a0) {
|
|
return a0();
|
|
});
|
|
const dataLength = binding.getDataLength();
|
|
const getIsFirstLayoutComplete = binding.getIsFirstLayoutComplete;
|
|
if (Reflect.apply(getIsFirstLayoutComplete, binding, [])) {
|
|
binding = env0_0;
|
|
if (binding.hasStableDataKeys()) {
|
|
if (dataLength > 0) {
|
|
binding = env0_0;
|
|
if (binding.shouldMaintainVisibleContentPosition()) {
|
|
current = env0_7.current;
|
|
value3 = dataLength !== current;
|
|
current = env0_9.current;
|
|
if (current) {
|
|
binding = env0_0;
|
|
r13 = binding.getEngagedIndices().findValue(_fun50258) ?? (value3 ? data?.findIndex(_fun50259) : undefined);
|
|
if (r13 !== undefined) {
|
|
if (r13 >= 0) {
|
|
binding = env0_0;
|
|
layout = binding.getLayout(r13);
|
|
r5 = horizontal ? layout.x - env0_10.current.x : layout.y - env0_10.current.y;
|
|
binding = env0_10;
|
|
Object = global.Object;
|
|
binding.current = Object.assign({}, env0_0.getLayout(r13));
|
|
if (r5 !== 0) {
|
|
current = env0_5.current;
|
|
if (!current) {
|
|
if (!env0_0.animationOptimizationsEnabled) {
|
|
value11 = environment.__proto__;
|
|
if ((require(6380) /* metro dependency 6380 */).PlatformConfig.supportsOffsetCorrection) {
|
|
current = importAll.current;
|
|
if (current != null) {
|
|
current.scrollBy(r5);
|
|
}
|
|
} else {
|
|
object2 = {};
|
|
binding = env0_0;
|
|
value12 = binding.getAbsoluteLastScrollOffset() + r5;
|
|
if (horizontal) {
|
|
object2.x = value12;
|
|
object2.animated = false;
|
|
} else {
|
|
object2.y = value12;
|
|
object2.animated = false;
|
|
}
|
|
current = importDefault.current;
|
|
if (current != null) {
|
|
current.scrollTo(object2);
|
|
}
|
|
}
|
|
if (value3) {
|
|
binding = env0_12;
|
|
binding4 = env0_0;
|
|
binding(binding4.getAbsoluteLastScrollOffset() + r5, function() {
|
|
});
|
|
binding4.ignoreScrollEvents = true;
|
|
setTimeout(_fun50261, 100);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
env0_13();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
env0_7.current = env0_0.getDataLength();
|
|
}
|
|
|
|
function _fun50262() { // fn#50262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:1953, offset: 0x012156d4, size: 250 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const object2 = {};
|
|
Object.defineProperty(object2, 'props', {get: _fun50263, set: undefined, enumerable: true, configurable: true});
|
|
object2.scrollToOffset = scrollToOffset;
|
|
object2.clearLayoutCacheOnUpdate = clearLayoutCacheOnUpdate;
|
|
object2.flashScrollIndicators = function() {
|
|
importDefault.current.flashScrollIndicators();
|
|
};
|
|
object2.getNativeScrollRef = function() {
|
|
return importDefault.current;
|
|
};
|
|
object2.getScrollResponder = function() {
|
|
return importDefault.current.getScrollResponder();
|
|
};
|
|
object2.getScrollableNode = function() {
|
|
return importDefault.current.getScrollableNode();
|
|
};
|
|
let value = environment.__proto__;
|
|
const env0_0 = env1_2(_fun50271);
|
|
object2.scrollToEnd = scrollToEnd_50273;
|
|
object2.scrollToTop = scrollToTop_50274;
|
|
object2.scrollToIndex = function({index, animated, viewPosition, viewOffset}) {
|
|
var Promise = global.Promise;
|
|
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
var value2 = new Promise(_fun50276);
|
|
return value2 instanceof Object ? value2 : value;
|
|
};
|
|
object2.scrollToItem = scrollToItem_50283;
|
|
object2.getFirstItemOffset = getFirstItemOffset;
|
|
object2.getWindowSize = getWindowSize;
|
|
object2.getLayout = getLayout_50287;
|
|
object2.getAbsoluteLastScrollOffset = getAbsoluteLastScrollOffset;
|
|
object2.getChildContainerDimensions = getChildContainerDimensions;
|
|
object2.recordInteraction = recordInteraction;
|
|
object2.computeVisibleIndices = computeVisibleIndices;
|
|
object2.getFirstVisibleIndex = getFirstVisibleIndex;
|
|
object2.recomputeViewableItems = recomputeViewableItems;
|
|
object2.prepareForLayoutAnimationRender = prepareForLayoutAnimationRender_50294;
|
|
return object2;
|
|
}
|
|
|
|
function _fun50295() { // fn#50295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5880, offset: 0x012160bd, size: 291 bytes, params: 1, frame: 20
|
|
var r5;
|
|
var r7;
|
|
var layout;
|
|
let binding = env0_0;
|
|
const {horizontal, data, initialScrollIndexParams} = binding.props;
|
|
const r8 = binding.getInitialScrollIndex() ?? -1;
|
|
const value4 = undefined;
|
|
const length = data == null ? value4 : data.length;
|
|
const value5 = 0;
|
|
if (r8 >= value5) {
|
|
if (r8 < (length ?? value5)) {
|
|
if (!env0_6.current) {
|
|
binding = env0_0;
|
|
if (binding.getIsFirstLayoutComplete()) {
|
|
setTimeout(_fun50296, 100);
|
|
env0_5.current = true;
|
|
r5 = (initialScrollIndexParams == null ? value4 : initialScrollIndexParams.viewOffset) ?? value5;
|
|
binding = env0_0;
|
|
layout = binding.getLayout(r8);
|
|
r7 = horizontal ? layout.x + r5 : layout.y + r5;
|
|
binding = env0_14;
|
|
binding.scrollToOffset({'offset': null, 'animated': false, 'skipFirstItemOffset': false,
|
|
offset: r7});
|
|
setTimeout(_fun50297, value5);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
function _fun50298() { // fn#50298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:6428, offset: 0x01216230, size: 85 bytes, params: 1, frame: 16
|
|
let Object = global.Object;
|
|
const value = Object.assign({}, importDefault.current, env0_14);
|
|
Object = global.Object;
|
|
Object.defineProperty(value, 'props', {'get': null, 'enumerable': true, 'configurable': true, get: get_50299});
|
|
return value;
|
|
}
|
|
|
|
function _fun50258(a0) { // fn#50258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:1200, offset: 0x01215679, size: 36 bytes, params: 2, frame: 12
|
|
return env1_0.getDataKey(a0) === env1_9.current;
|
|
}
|
|
|
|
function _fun50259(a0, a1) { // fn#50259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:1283, offset: 0x0121569d, size: 36 bytes, params: 3, frame: 12
|
|
return env1_0.getDataKey(a1) === env1_9.current;
|
|
}
|
|
|
|
function _fun50261() { // fn#50261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:1854, offset: 0x012156c1, size: 19 bytes, params: 1, frame: 2
|
|
env1_0.ignoreScrollEvents = false;
|
|
}
|
|
|
|
function _fun50263() { // fn#50263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:1971, offset: 0x012157ce, size: 14 bytes, params: 1, frame: 1
|
|
return env1_0.props;
|
|
}
|
|
|
|
function scrollToOffset({offset, animated, skipFirstItemOffset}) { // fn#50264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:2014, offset: 0x012157dc, size: 284 bytes, params: 2, frame: 22
|
|
var r5;
|
|
var firstItemOffset;
|
|
var value2;
|
|
var moduleValue;
|
|
var adjustOffsetForRTL;
|
|
var binding;
|
|
var value3;
|
|
var value6;
|
|
var value7;
|
|
var object2;
|
|
var scrollTo;
|
|
var Object;
|
|
const r7 = skipFirstItemOffset === undefined || skipFirstItemOffset;
|
|
value = environment.__proto__;
|
|
const horizontal = env1_0.props.horizontal;
|
|
let current = importDefault.current;
|
|
if (current) {
|
|
value2 = environment.__proto__.__proto__;
|
|
if (I18nManager.isRTL && horizontal) {
|
|
moduleValue = require(6414) /* metro dependency 6414 */;
|
|
adjustOffsetForRTL = moduleValue.adjustOffsetForRTL;
|
|
binding = env1_0;
|
|
value3 = Reflect.apply(adjustOffsetForRTL, moduleValue, [offset,
|
|
binding.getChildContainerDimensions().width,
|
|
binding.getWindowSize().width]);
|
|
firstItemOffset = env1_0.firstItemOffset;
|
|
r5 = value3 + (r7 ? firstItemOffset : -firstItemOffset);
|
|
} else {
|
|
r5 = offset;
|
|
}
|
|
value6 = 0;
|
|
firstItemOffset = r7 ? value6 : env1_0.firstItemOffset;
|
|
value7 = r5 + firstItemOffset;
|
|
object2 = {};
|
|
if (horizontal) {
|
|
object2.x = value7;
|
|
object2.y = value6;
|
|
} else {
|
|
object2.x = value6;
|
|
object2.y = value7;
|
|
}
|
|
current = importDefault.current;
|
|
scrollTo = current.scrollTo;
|
|
Object = global.Object;
|
|
Reflect.apply(scrollTo, current, [Object.assign({}, object2, {animated: animated})]);
|
|
}
|
|
}
|
|
|
|
function clearLayoutCacheOnUpdate() { // fn#50265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:2429, offset: 0x012158f8, size: 23 bytes, params: 1, frame: 9
|
|
env1_0.markLayoutManagerDirty();
|
|
}
|
|
|
|
function* _fun50271() { // fn#50271, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:2841, offset: 0x01215962, size: 183 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var value3;
|
|
var engagedIndices;
|
|
var binding;
|
|
if (true) {
|
|
var animated = (arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}).animated;
|
|
value = environment.__proto__.__proto__;
|
|
var data = require.props.data;
|
|
if (data) {
|
|
if (data.length > 0) {
|
|
value3 = data.length - 1;
|
|
engagedIndices = require.getEngagedIndices();
|
|
if (engagedIndices.includes(value3)) {
|
|
useState(_fun50272, 0);
|
|
return undefined;
|
|
}
|
|
binding = env2_14;
|
|
yield binding.scrollToIndex({index: value3, animated: animated});
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
useState(_fun50272, 0);
|
|
return undefined;
|
|
}
|
|
useState(_fun50272, 0);
|
|
} else {
|
|
useState(_fun50272, 0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function scrollToTop_50274() { // fn#50274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3204, offset: 0x01215a48, size: 67 bytes, params: 1, frame: 14
|
|
const animated = (arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}).animated;
|
|
const value = environment.__proto__;
|
|
const binding = env1_14;
|
|
binding.scrollToOffset({offset: 0, animated: animated});
|
|
}
|
|
|
|
function scrollToIndex_50275({index, animated, viewPosition, viewOffset}) { // fn#50275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3357, offset: 0x01215a8b, size: 79 bytes, params: 2, frame: 11
|
|
const Promise = global.Promise;
|
|
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
const promise = new Promise(_fun50276);
|
|
return promise instanceof Object ? promise : value;
|
|
}
|
|
|
|
function scrollToItem_50283({item, animated, viewPosition, viewOffset}) { // fn#50283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4657, offset: 0x01215f2e, size: 126 bytes, params: 2, frame: 15
|
|
var index;
|
|
var binding;
|
|
const data = env1_0.props.data;
|
|
if (importDefault.current) {
|
|
if (data) {
|
|
index = data.findIndex(function(a0) {
|
|
return a0 === item;
|
|
});
|
|
if (index >= 0) {
|
|
binding = env1_14;
|
|
binding.scrollToIndex({index: index, animated: animated, viewPosition: viewPosition,
|
|
viewOffset: viewOffset});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function getFirstItemOffset() { // fn#50285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4912, offset: 0x01215fac, size: 15 bytes, params: 1, frame: 1
|
|
return env1_0.firstItemOffset;
|
|
}
|
|
|
|
function getWindowSize() { // fn#50286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4982, offset: 0x01215fbb, size: 19 bytes, params: 1, frame: 9
|
|
return env1_0.getWindowSize();
|
|
}
|
|
|
|
function getLayout_50287(a0) { // fn#50287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5043, offset: 0x01215fce, size: 23 bytes, params: 2, frame: 11
|
|
return env1_0.tryGetLayout(a0);
|
|
}
|
|
|
|
function getAbsoluteLastScrollOffset() { // fn#50288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5119, offset: 0x01215fe5, size: 19 bytes, params: 1, frame: 9
|
|
return env1_0.getAbsoluteLastScrollOffset();
|
|
}
|
|
|
|
function getChildContainerDimensions() { // fn#50289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5226, offset: 0x01215ff8, size: 19 bytes, params: 1, frame: 9
|
|
return env1_0.getChildContainerDimensions();
|
|
}
|
|
|
|
function recordInteraction() { // fn#50290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5323, offset: 0x0121600b, size: 21 bytes, params: 1, frame: 9
|
|
env1_0.recordInteraction();
|
|
}
|
|
|
|
function computeVisibleIndices() { // fn#50291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5397, offset: 0x01216020, size: 19 bytes, params: 1, frame: 9
|
|
return env1_0.computeVisibleIndices();
|
|
}
|
|
|
|
function getFirstVisibleIndex() { // fn#50292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5485, offset: 0x01216033, size: 25 bytes, params: 1, frame: 9
|
|
const binding = env1_0;
|
|
return binding.computeVisibleIndices().startIndex;
|
|
}
|
|
|
|
function recomputeViewableItems() { // fn#50293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5585, offset: 0x0121604c, size: 21 bytes, params: 1, frame: 9
|
|
env1_0.recomputeViewableItems();
|
|
}
|
|
|
|
function prepareForLayoutAnimationRender_50294() { // fn#50294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:5679, offset: 0x01216061, size: 92 bytes, params: 1, frame: 14
|
|
var console;
|
|
var warn;
|
|
var value2;
|
|
if (!env1_0.props.keyExtractor) {
|
|
console = global.console;
|
|
warn = console.warn;
|
|
value2 = environment.__proto__.__proto__;
|
|
Reflect.apply(warn, console,
|
|
[(require(6408) /* metro dependency 6408 */).WarningMessages.keyExtractorNotDefinedForAnimation]);
|
|
}
|
|
env1_0.animationOptimizationsEnabled = true;
|
|
}
|
|
|
|
function _fun50296() { // fn#50296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:6110, offset: 0x012161e0, size: 31 bytes, params: 1, frame: 3
|
|
env1_6.current = true;
|
|
env1_5.current = false;
|
|
}
|
|
|
|
function _fun50297() { // fn#50297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:6324, offset: 0x012161ff, size: 49 bytes, params: 1, frame: 12
|
|
env1_14.scrollToOffset({'offset': null, 'animated': false, 'skipFirstItemOffset': false, offset: env0_0});
|
|
}
|
|
|
|
function _fun50272() { // fn#50272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3062, offset: 0x01215a19, size: 47 bytes, params: 1, frame: 12
|
|
const current = dependencyMap.current;
|
|
if (current != null) {
|
|
current.scrollToEnd({animated: animated});
|
|
}
|
|
}
|
|
|
|
function _fun50276(a0) { // fn#50276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3462, offset: 0x01215ada, size: 247 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var indexBinding;
|
|
var binding;
|
|
var closure;
|
|
var closure2;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__.__proto__;
|
|
if (importDefault.current) {
|
|
indexBinding = index;
|
|
if (indexBinding >= 0) {
|
|
indexBinding = index;
|
|
binding = env2_0;
|
|
if (indexBinding < binding.getDataLength()) {
|
|
env2_5.current = true;
|
|
binding = env2_0;
|
|
binding.setOffsetProjectionEnabled(false);
|
|
closure = getFinalOffset;
|
|
var env0_3 = binding.getAbsoluteLastScrollOffset();
|
|
binding = env2_0;
|
|
value = binding.getWindowSize();
|
|
var env0_4 = 2 * (env2_0.props.horizontal ? value.width : value.height);
|
|
closure2 = getStartScrollOffset;
|
|
var env0_6 = closure();
|
|
value = closure2();
|
|
closure = performScrollStep;
|
|
closure(0);
|
|
} else {
|
|
a0();
|
|
}
|
|
} else {
|
|
a0();
|
|
}
|
|
} else {
|
|
a0();
|
|
}
|
|
}
|
|
|
|
function getFinalOffset() { // fn#50277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3592, offset: 0x01215bd1, size: 182 bytes, params: 1, frame: 18
|
|
var r3;
|
|
var r1;
|
|
var windowSize;
|
|
const layout = env3_0.getLayout(index);
|
|
const r6 = horizontal ? layout.x : layout.y;
|
|
if (viewPosition !== undefined) {
|
|
horizontalBinding = horizontal;
|
|
windowSize = env3_0.getWindowSize();
|
|
r3 = viewPosition === undefined ? r6 : r6 - ((horizontalBinding ? windowSize.width : windowSize.height) - (horizontal ? layout.width : layout.height)) * viewPosition;
|
|
r1 = viewOffset === undefined ? r3 : r3 + viewOffset;
|
|
} else if (viewOffset === undefined) {
|
|
r1 = r6;
|
|
} else {
|
|
horizontalBinding = horizontal;
|
|
windowSize = env3_0.getWindowSize();
|
|
r3 = viewPosition === undefined ? r6 : r6 - ((horizontalBinding ? windowSize.width : windowSize.height) - (horizontal ? layout.width : layout.height)) * viewPosition;
|
|
r1 = viewOffset === undefined ? r3 : r3 + viewOffset;
|
|
}
|
|
return r1 + env3_0.firstItemOffset;
|
|
}
|
|
|
|
function getStartScrollOffset() { // fn#50278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:3926, offset: 0x01215c87, size: 125 bytes, params: 1, frame: 16
|
|
var r0;
|
|
var value3;
|
|
var value4;
|
|
var value;
|
|
let binding = env0_3;
|
|
const finalOffset = getFinalOffset();
|
|
if (finalOffset > binding) {
|
|
value = global.Math.max(finalOffset - env0_4, binding);
|
|
value4 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding.setScrollDirection('forward');
|
|
r0 = value;
|
|
} else {
|
|
value = global.Math.min(finalOffset + env0_4, binding);
|
|
value3 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding.setScrollDirection('backward');
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function performScrollStep(a0) { // fn#50279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4113, offset: 0x01215d04, size: 159 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var binding;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
if (env3_3.current) {
|
|
env0_0();
|
|
} else if (a0 >= 5) {
|
|
finishScrollToIndex();
|
|
} else {
|
|
binding = env3_12;
|
|
value = environment.__proto__;
|
|
binding(animated ? env0_8 + a0 / 4 * (env0_9 - env0_8) : env0_9 + a0 / 4 * (env0_8 - env0_9), _fun50280);
|
|
}
|
|
}
|
|
|
|
function finishScrollToIndex() { // fn#50281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4341, offset: 0x01215e55, size: 170 bytes, params: 1, frame: 17
|
|
env0_8 = getFinalOffset();
|
|
let binding = env3_0;
|
|
const maxScrollOffset = binding.getMaxScrollOffset();
|
|
env0_8 = env0_8 > maxScrollOffset ? maxScrollOffset : env0_8;
|
|
if (animated) {
|
|
env3_14.scrollToOffset({'offset': null, 'animated': false, 'skipFirstItemOffset': true, offset: env0_9});
|
|
}
|
|
binding = env3_14;
|
|
const scrollToOffset = binding.scrollToOffset;
|
|
animatedBinding = animated;
|
|
Reflect.apply(scrollToOffset, binding, [{offset: env0_8, animated: animatedBinding, skipFirstItemOffset: true}]);
|
|
setTimeout(_fun50282, animatedBinding ? 300 : 200);
|
|
}
|
|
|
|
function _fun50280() { // fn#50280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4195, offset: 0x01215da3, size: 178 bytes, params: 1, frame: 16
|
|
var value4;
|
|
const indexBinding = index;
|
|
const binding = env4_0;
|
|
const getDataLength = binding.getDataLength;
|
|
if (indexBinding >= Reflect.apply(getDataLength, binding, [])) {
|
|
env4_14.scrollToEnd({animated: animated});
|
|
value = environment.__proto__;
|
|
env1_0();
|
|
} else {
|
|
var finalOffset = getFinalOffset();
|
|
if (finalOffset < env1_6) {
|
|
if (finalOffset < env1_7) {
|
|
value4 = getStartScrollOffset();
|
|
performScrollStep(0);
|
|
} else if (finalOffset > env1_6) {
|
|
if (finalOffset > env1_7) {
|
|
value4 = getStartScrollOffset();
|
|
performScrollStep(0);
|
|
} else {
|
|
performScrollStep(env0_0 + 1);
|
|
}
|
|
} else {
|
|
performScrollStep(env0_0 + 1);
|
|
}
|
|
} else if (finalOffset > env1_6) {
|
|
if (finalOffset > env1_7) {
|
|
value4 = getStartScrollOffset();
|
|
performScrollStep(0);
|
|
} else {
|
|
performScrollStep(env0_0 + 1);
|
|
}
|
|
} else {
|
|
performScrollStep(env0_0 + 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun50282() { // fn#50282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6588:4551, offset: 0x01215eff, size: 47 bytes, params: 1, frame: 11
|
|
env4_5.current = false;
|
|
env4_0.setOffsetProjectionEnabled(true);
|
|
env1_0();
|
|
}
|
|
|