468 lines
20 KiB
React
468 lines
20 KiB
React
/* Metro module 6448; source: unknown; dependencies: [31, 27, 6445, 6446, 6449] */
|
|
function _fun50600(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:6, offset: 0x0121da93, size: 214 bytes, params: 8, frame: 20
|
|
var r6;
|
|
const value = this;
|
|
const env0_0 = require;
|
|
if (value && value.__extends) {
|
|
}
|
|
const Object = global.Object;
|
|
let object2 = {value: true};
|
|
Object.defineProperty(exports, '__esModule', object2);
|
|
exports.StickyType = undefined;
|
|
const env0_5 = require(31) /* metro dependency 31 */;
|
|
const env0_6 = require(27) /* metro dependency 27 */;
|
|
const StickyType = exports.StickyType;
|
|
if (StickyType) {
|
|
r6 = StickyType;
|
|
} else {
|
|
object2 = {};
|
|
exports.StickyType = object2;
|
|
r6 = object2;
|
|
}
|
|
r6.HEADER = 0;
|
|
r6[0] = 'HEADER';
|
|
r6.FOOTER = 1;
|
|
r6[1] = 'FOOTER';
|
|
const ComponentCompat = (require(6449) /* metro dependency 6449 */).ComponentCompat;
|
|
exports.default = _fun50606(ComponentCompat);
|
|
}
|
|
|
|
function extendStatics_50601(a0, a1) { // fn#50601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:77, offset: 0x0121db69, size: 78 bytes, params: 3, frame: 13
|
|
var r3;
|
|
var Array;
|
|
var value;
|
|
const Object = global.Object;
|
|
const setPrototypeOf = Object.setPrototypeOf;
|
|
if (setPrototypeOf) {
|
|
r3 = setPrototypeOf;
|
|
} else {
|
|
Array = global.Array;
|
|
value = Object.create([]);
|
|
value = value instanceof Array;
|
|
r3 = value && (function(a0, a1) {
|
|
a0.__proto__ = a1;
|
|
});
|
|
}
|
|
r3 = !r3 ? function(a0, a1) {
|
|
var r3;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var hasOwnProperty;
|
|
for (propertyName in a1) {
|
|
hasOwnProperty = global.Object.prototype.hasOwnProperty;
|
|
if (!hasOwnProperty.call(a1, propertyName)) {
|
|
r3 = propertyName2;
|
|
continue;
|
|
}
|
|
a0[propertyName] = a1[propertyName];
|
|
r3 = propertyName2;
|
|
}
|
|
} : r3;
|
|
return r3(a0, a1);
|
|
}
|
|
|
|
function _fun50604(a0, a1) { // fn#50604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:292, offset: 0x0121dbb7, size: 177 bytes, params: 3, frame: 15
|
|
var r1;
|
|
var value;
|
|
var prototype;
|
|
var closure2;
|
|
var TypeError;
|
|
var value3;
|
|
var typeError;
|
|
const env0_0 = a0;
|
|
const closure = ___50605;
|
|
if (typeof a1 === 'function') {
|
|
extendStatics_50601(a0, a1);
|
|
if (a1 === null) {
|
|
r1 = global.Object.create(a1);
|
|
} else {
|
|
prototype = a1.prototype;
|
|
closure.prototype = prototype;
|
|
prototype = closure.prototype;
|
|
value = Object.create(prototype, {constructor: {value: closure}});
|
|
closure2 = new closure();
|
|
value = closure2 instanceof Object ? closure2 : value;
|
|
r1 = value;
|
|
}
|
|
a0.prototype = r1;
|
|
} else {
|
|
if (a1 !== null) {
|
|
TypeError = global.TypeError;
|
|
value = global.String(a1);
|
|
value = 'Class extends value ' + value;
|
|
value3 = Object.create(TypeError.prototype, {constructor: {value: TypeError}});
|
|
value += ' is not a constructor or null';
|
|
typeError = new TypeError();
|
|
value = typeError instanceof Object ? typeError : value3;
|
|
throw value;
|
|
}
|
|
extendStatics_50601(a0, a1);
|
|
if (a1 === null) {
|
|
r1 = global.Object.create(a1);
|
|
} else {
|
|
prototype = a1.prototype;
|
|
closure.prototype = prototype;
|
|
prototype = closure.prototype;
|
|
value = Object.create(prototype, {constructor: {value: closure}});
|
|
closure2 = new closure();
|
|
value = closure2 instanceof Object ? closure2 : value;
|
|
r1 = value;
|
|
}
|
|
a0.prototype = r1;
|
|
}
|
|
}
|
|
|
|
function _fun50606(a0) { // fn#50606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:738, offset: 0x0121dc68, size: 223 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
const closure = StickyObject;
|
|
env0_3(closure, a0);
|
|
closure.prototype.componentWillReceivePropsCompat = function(a0) {
|
|
this._updateDimensionParams();
|
|
this.calculateVisibleStickyIndex(a0.stickyIndices, this._smallestVisibleIndex, this._largestVisibleIndex,
|
|
this._offsetY, this._windowBound);
|
|
this._computeLayouts(a0.stickyIndices);
|
|
this.stickyViewVisible(this.stickyVisiblity, false);
|
|
};
|
|
closure.prototype.renderCompat = renderCompat_50609;
|
|
closure.prototype.onVisibleIndicesChanged = onVisibleIndicesChanged;
|
|
closure.prototype.onScroll = onScroll_50611;
|
|
closure.prototype.stickyViewVisible = function(a0, a1) {
|
|
var r1;
|
|
var value = a1;
|
|
r1 = !(value !== undefined) || value;
|
|
this.stickyVisiblity = a0;
|
|
if (r1) {
|
|
this.setState({});
|
|
}
|
|
};
|
|
closure.prototype.getWindowCorrection = function(a0) {
|
|
var r0;
|
|
r0 = a0.getWindowCorrection && a0.getWindowCorrection();
|
|
r0 = !r0 ? this._windowCorrection : r0;
|
|
return r0;
|
|
};
|
|
closure.prototype.boundaryProcessing = function(a0, a1) {
|
|
var hasReachedBoundary = this.hasReachedBoundary(a0, a1);
|
|
if (this.bounceScrolling !== hasReachedBoundary) {
|
|
this.bounceScrolling = hasReachedBoundary;
|
|
if (this.bounceScrolling) {
|
|
this.stickyViewVisible(false);
|
|
} else {
|
|
this.onVisibleIndicesChanged(this.visibleIndices);
|
|
}
|
|
}
|
|
};
|
|
closure.prototype._updateDimensionParams = function() {
|
|
var value = this.props.getRLVRenderedSize();
|
|
if (value) {
|
|
this._scrollableHeight = value.height;
|
|
this._scrollableWidth = value.width;
|
|
}
|
|
value = this.props.getContentDimension();
|
|
if (value && this._scrollableHeight) {
|
|
this._windowBound = value.height - this._scrollableHeight;
|
|
}
|
|
};
|
|
closure.prototype._computeLayouts = _computeLayouts;
|
|
closure.prototype._setSmallestAndLargestVisibleIndices = function(a0) {
|
|
this.visibleIndices = a0;
|
|
this._smallestVisibleIndex = a0[0];
|
|
this._largestVisibleIndex = a0[a0.length - 1];
|
|
};
|
|
closure.prototype._renderSticky = _renderSticky;
|
|
closure.prototype._getAdjustedOffsetY = function(a0) {
|
|
return a0 + this.getWindowCorrection(this.props).windowShift;
|
|
};
|
|
return closure;
|
|
}
|
|
|
|
function StickyObject(a0, a1) { // fn#50607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:750, offset: 0x0121dd47, size: 204 bytes, params: 3, frame: 15
|
|
let value = this;
|
|
const r0 = env0_0.call(value, a0, a1) || value;
|
|
value = environment.__proto__;
|
|
const HEADER = env1_4.HEADER;
|
|
r0.stickyType = HEADER;
|
|
r0.stickyTypeMultiplier = 1;
|
|
r0.stickyVisiblity = false;
|
|
r0.currentIndex = 0;
|
|
r0.currentStickyIndex = 0;
|
|
r0.visibleIndices = [];
|
|
r0.bounceScrolling = false;
|
|
const Animated = env1_6.Animated;
|
|
const Value = Animated.Value;
|
|
r0._stickyViewOffset = new Value(0);
|
|
r0._previousStickyIndex = 0;
|
|
r0._nextStickyIndex = 0;
|
|
r0._firstCompute = true;
|
|
r0._smallestVisibleIndex = 0;
|
|
r0._largestVisibleIndex = 0;
|
|
r0._offsetY = 0;
|
|
r0._windowCorrection = {'startCorrection': 0, 'endCorrection': 0, 'windowShift': 0};
|
|
return r0;
|
|
}
|
|
|
|
function renderCompat_50609() { // fn#50609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:1587, offset: 0x0121de77, size: 219 bytes, params: 1, frame: 17
|
|
var extendedState;
|
|
let props = this.props;
|
|
const r2 = !props.renderContainer && [{position: 'absolute', width: this._scrollableWidth}, this.containerPosition];
|
|
value = environment.__proto__;
|
|
const binding = env1_5;
|
|
const createElement = binding.createElement;
|
|
const Animated = env1_6.Animated;
|
|
const View = Animated.View;
|
|
value = Reflect.apply(createElement, binding, [View, {style: [{transform: [{translateY: this._stickyViewOffset}]},
|
|
r2]}, this.stickyVisiblity ? this._renderSticky() : null]);
|
|
if (this.props.renderContainer) {
|
|
props = this.props;
|
|
extendedState = props.getExtendedState();
|
|
props = this.props;
|
|
return props.renderContainer(value, this.currentStickyIndex, extendedState);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function onVisibleIndicesChanged(a0) { // fn#50610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:2039, offset: 0x0121df52, size: 156 bytes, params: 2, frame: 19
|
|
if (this._firstCompute) {
|
|
this.initStickyParams();
|
|
this._offsetY = this._getAdjustedOffsetY(this._offsetY);
|
|
this._firstCompute = false;
|
|
}
|
|
this._updateDimensionParams();
|
|
this._setSmallestAndLargestVisibleIndices(a0);
|
|
this.calculateVisibleStickyIndex(this.props.stickyIndices, this._smallestVisibleIndex, this._largestVisibleIndex,
|
|
this._offsetY, this._windowBound);
|
|
this._computeLayouts();
|
|
this.stickyViewVisible(this.stickyVisiblity);
|
|
}
|
|
|
|
function onScroll_50611(a0) { // fn#50611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:2493, offset: 0x0121dfee, size: 726 bytes, params: 2, frame: 16
|
|
var stickyTypeMultiplier;
|
|
var currentStickyIndex;
|
|
var getScrollY;
|
|
var _scrollableHeight;
|
|
var currentIndex;
|
|
var value5;
|
|
var _nextStickyIndex;
|
|
var value7;
|
|
const property = (require(6445) /* metro dependency 6445 */).default;
|
|
var stickyIndicesArraySortError;
|
|
let value = this._getAdjustedOffsetY(a0);
|
|
this._offsetY = value;
|
|
this._updateDimensionParams();
|
|
this.boundaryProcessing(value, this._windowBound);
|
|
let _previousStickyIndex = this._previousStickyIndex;
|
|
if (_previousStickyIndex === undefined) {
|
|
_nextStickyIndex = this._nextStickyIndex;
|
|
if (_nextStickyIndex === undefined) {
|
|
return undefined;
|
|
}
|
|
_nextStickyIndex = this._nextStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
value7 = _nextStickyIndex * stickyTypeMultiplier;
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
if (value7 <= currentStickyIndex * stickyTypeMultiplier) {
|
|
value = environment.__proto__;
|
|
stickyIndicesArraySortError = (require(6446) /* metro dependency 6446 */).default.stickyIndicesArraySortError;
|
|
throw new property();
|
|
}
|
|
value = this.getScrollY(value, this._scrollableHeight);
|
|
if (this._currentHeight) {
|
|
if (this._nextYd) {
|
|
if (value) {
|
|
if (value + this._currentHeight > this._nextYd) {
|
|
if (value <= this._nextYd) {
|
|
value -= this._nextYd;
|
|
value += this._currentHeight;
|
|
value *= -1 * this.stickyTypeMultiplier;
|
|
this._stickyViewOffset.setValue(value);
|
|
} else if (value > this._nextYd) {
|
|
this.currentIndex = this.currentIndex + this.stickyTypeMultiplier;
|
|
this._stickyViewOffset.setValue(0);
|
|
this._computeLayouts();
|
|
this.stickyViewVisible(true);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
_previousStickyIndex = this._previousStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
var value2 = _previousStickyIndex * stickyTypeMultiplier;
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
if (value2 >= currentStickyIndex * stickyTypeMultiplier) {
|
|
value = environment.__proto__;
|
|
stickyIndicesArraySortError = (require(6446) /* metro dependency 6446 */).default.stickyIndicesArraySortError;
|
|
throw new property();
|
|
}
|
|
getScrollY = this.getScrollY;
|
|
_scrollableHeight = this._scrollableHeight;
|
|
var value3 = Reflect.apply(getScrollY, this, [value, _scrollableHeight]);
|
|
if (this._previousHeight) {
|
|
if (this._currentYd) {
|
|
if (value3) {
|
|
if (value3 < this._currentYd) {
|
|
if (value3 > this._currentYd - this._previousHeight) {
|
|
currentIndex = this.currentIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
this.currentIndex = currentIndex - stickyTypeMultiplier;
|
|
value5 = value3 - this._currentYd + this._previousHeight;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
this._stickyViewOffset.setValue(value5 * (-1 * stickyTypeMultiplier));
|
|
this._computeLayouts();
|
|
this.stickyViewVisible(true);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
_nextStickyIndex = this._nextStickyIndex;
|
|
if (_nextStickyIndex === undefined) {
|
|
return undefined;
|
|
}
|
|
_nextStickyIndex = this._nextStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
value7 = _nextStickyIndex * stickyTypeMultiplier;
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
if (value7 <= currentStickyIndex * stickyTypeMultiplier) {
|
|
value = environment.__proto__;
|
|
stickyIndicesArraySortError = (require(6446) /* metro dependency 6446 */).default.stickyIndicesArraySortError;
|
|
throw new property();
|
|
}
|
|
getScrollY = this.getScrollY;
|
|
_scrollableHeight = this._scrollableHeight;
|
|
value = Reflect.apply(getScrollY, this, [value, _scrollableHeight]);
|
|
if (this._currentHeight) {
|
|
if (this._nextYd) {
|
|
if (value) {
|
|
if (value + this._currentHeight > this._nextYd) {
|
|
if (value <= this._nextYd) {
|
|
value -= this._nextYd;
|
|
value += this._currentHeight;
|
|
value *= -1 * this.stickyTypeMultiplier;
|
|
this._stickyViewOffset.setValue(value);
|
|
} else if (value > this._nextYd) {
|
|
this.currentIndex = this.currentIndex + this.stickyTypeMultiplier;
|
|
this._stickyViewOffset.setValue(0);
|
|
this._computeLayouts();
|
|
this.stickyViewVisible(true);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
} else {
|
|
this._stickyViewOffset.setValue(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _computeLayouts(a0) { // fn#50616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:4718, offset: 0x0121e3c5, size: 464 bytes, params: 2, frame: 15
|
|
var props;
|
|
var currentIndex;
|
|
var stickyTypeMultiplier;
|
|
var currentStickyIndex;
|
|
var _currentLayout;
|
|
var _nextLayout;
|
|
let value = a0;
|
|
const r2 = value || this.props.stickyIndices;
|
|
if (r2) {
|
|
currentIndex = this.currentIndex;
|
|
this.currentStickyIndex = r2[currentIndex];
|
|
currentIndex = this.currentIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
this._previousStickyIndex = r2[currentIndex - stickyTypeMultiplier];
|
|
currentIndex = this.currentIndex;
|
|
stickyTypeMultiplier = this.stickyTypeMultiplier;
|
|
this._nextStickyIndex = r2[currentIndex + stickyTypeMultiplier];
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
value = undefined;
|
|
if (value !== currentStickyIndex) {
|
|
props = this.props;
|
|
this._currentLayout = props.getLayoutForIndex(this.currentStickyIndex);
|
|
_currentLayout = this._currentLayout;
|
|
this._currentY = _currentLayout ? this._currentLayout.y : value;
|
|
_currentLayout = this._currentLayout;
|
|
this._currentHeight = _currentLayout ? this._currentLayout.height : value;
|
|
this._currentYd = this._currentY && this._currentHeight ? this.getCurrentYd(this._currentY,
|
|
this._currentHeight) : value;
|
|
}
|
|
if (value !== this._previousStickyIndex) {
|
|
props = this.props;
|
|
this._previousLayout = props.getLayoutForIndex(this._previousStickyIndex);
|
|
this._previousHeight = this._previousLayout ? this._previousLayout.height : value;
|
|
}
|
|
if (value !== this._nextStickyIndex) {
|
|
props = this.props;
|
|
this._nextLayout = props.getLayoutForIndex(this._nextStickyIndex);
|
|
_nextLayout = this._nextLayout;
|
|
this._nextY = _nextLayout ? this._nextLayout.y : value;
|
|
_nextLayout = this._nextLayout;
|
|
this._nextHeight = _nextLayout ? this._nextLayout.height : value;
|
|
this._nextYd = this._nextY && this._nextHeight ? this.getNextYd(this._nextY, this._nextHeight) : value;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _renderSticky() { // fn#50618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6626:6032, offset: 0x0121e5c7, size: 165 bytes, params: 1, frame: 18
|
|
var r0;
|
|
var props;
|
|
var getDataForIndex;
|
|
var value;
|
|
var getLayoutTypeForIndex;
|
|
var value2;
|
|
var extendedState;
|
|
var rowRenderer;
|
|
let currentStickyIndex = this.currentStickyIndex;
|
|
if (currentStickyIndex !== undefined) {
|
|
props = this.props;
|
|
getDataForIndex = props.getDataForIndex;
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
value = Reflect.apply(getDataForIndex, props, [currentStickyIndex]);
|
|
props = this.props;
|
|
getLayoutTypeForIndex = props.getLayoutTypeForIndex;
|
|
currentStickyIndex = this.currentStickyIndex;
|
|
value2 = Reflect.apply(getLayoutTypeForIndex, props, [currentStickyIndex]);
|
|
props = this.props;
|
|
extendedState = props.getExtendedState();
|
|
props = this.props;
|
|
rowRenderer = props.getRowRenderer();
|
|
props = this.props;
|
|
if (props.overrideRowRenderer) {
|
|
props = this.props;
|
|
value = props.overrideRowRenderer(value2, value, this.currentStickyIndex, extendedState);
|
|
r0 = value;
|
|
} else {
|
|
value = rowRenderer(value2, value, this.currentStickyIndex, extendedState);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
return null;
|
|
}
|
|
|