Files
discord-decomp/sources/by-id/module-06463-GridLayoutProvider.js
2026-07-28 01:06:53 +03:00

179 lines
8.1 KiB
JavaScript

/* Metro module 6463; source: unknown; dependencies: [6464, 6461] */
import * as Module06461Module from './module-06461.js'; /* Metro dependency 6461 */
import * as GridLayoutManagerModule from './module-06464-GridLayoutManager.js'; /* Metro dependency 6464 */
function _fun50751(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:6, offset: 0x012207a2, size: 131 bytes, params: 8, frame: 18
const value = this;
const env0_0 = require;
if (value && value.__extends) {
}
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.GridLayoutProvider = undefined;
const LayoutProvider = (Module06461Module).LayoutProvider;
exports.GridLayoutProvider = _fun50757(LayoutProvider);
function extendStatics_50752(a0, a1) { // fn#50752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:77, offset: 0x01220825, 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 _fun50755(a0, a1) { // fn#50755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:292, offset: 0x01220873, size: 177 bytes, params: 3, frame: 15
var r1;
var value;
var prototype;
var ___5075622;
var TypeError;
var value3;
var typeError;
const env0_0 = a0;
const ___507562 = ___50756;
if (typeof a1 === 'function') {
extendStatics_50752(a0, a1);
if (a1 === null) {
r1 = global.Object.create(a1);
} else {
prototype = a1.prototype;
___507562.prototype = prototype;
prototype = ___507562.prototype;
value = Object.create(prototype, {constructor: {value: ___507562}});
___5075622 = new ___507562();
value = ___5075622 instanceof Object ? ___5075622 : 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_50752(a0, a1);
if (a1 === null) {
r1 = global.Object.create(a1);
} else {
prototype = a1.prototype;
___507562.prototype = prototype;
prototype = ___507562.prototype;
value = Object.create(prototype, {constructor: {value: ___507562}});
___5075622 = new ___507562();
value = ___5075622 instanceof Object ? ___5075622 : value;
r1 = value;
}
a0.prototype = r1;
}
function ___50756() { // fn#50756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:426, offset: 0x0121c997, size: 20 bytes, params: 1, frame: 2
this.constructor = env0_0;
}
}
function _fun50757(a0) { // fn#50757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:623, offset: 0x01220924, size: 63 bytes, params: 2, frame: 14
const env0_0 = a0;
const GridLayoutProvider2 = GridLayoutProvider;
env0_3(GridLayoutProvider2, a0);
GridLayoutProvider2.prototype.newLayoutManager = newLayoutManager_50760;
GridLayoutProvider2.prototype.setLayout = setLayout;
return GridLayoutProvider2;
function GridLayoutProvider(a0, a1, a2, a3, a4) { // fn#50758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:635, offset: 0x01220963, size: 95 bytes, params: 6, frame: 17
const value = a4;
const value2 = this;
const r0 = env0_0.call(value2, a1, _fun50759) || value2;
r0._getHeightOrWidth = a3;
r0._getSpan = a2;
r0._maxSpan = a0;
r0._acceptableRelayoutDelta = value ?? 1;
return r0;
function _fun50759(a0, a1, a2) { // fn#50759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:695, offset: 0x012209c2, size: 29 bytes, params: 4, frame: 13
env0_0.setLayout(a1, a2);
}
}
function newLayoutManager_50760(a0, a1, a2) { // fn#50760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:910, offset: 0x012209df, size: 106 bytes, params: 4, frame: 23
this._isHorizontal = a1;
this._renderWindowSize = a0;
let value = environment.__proto__;
const GridLayoutManager = (GridLayoutManagerModule).GridLayoutManager;
const _getSpan = this._getSpan;
const _maxSpan = this._maxSpan;
const _acceptableRelayoutDelta = this._acceptableRelayoutDelta;
const _isHorizontal = this._isHorizontal;
value = Object.create(GridLayoutManager.prototype, {constructor: {value: GridLayoutManager}});
const gridLayoutManager = new GridLayoutManager(this, a0, _getSpan, _maxSpan, _acceptableRelayoutDelta,
_isHorizontal, a2);
return gridLayoutManager instanceof Object ? gridLayoutManager : value;
}
}
}
function setLayout(a0, a1) { // fn#50761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6641:1138, offset: 0x01220a49, size: 216 bytes, params: 3, frame: 16
var Error;
var error;
var _isHorizontal;
var value2;
var value3;
const _maxSpan = this._maxSpan;
let value = this._getSpan(a1);
if (value > _maxSpan) {
Error = global.Error;
value = 'Item span for index ' + a1;
value3 = Object.create(Error.prototype, {constructor: {value: Error}});
value += ' is more than the max span';
error = new Error(value);
value = error instanceof Object ? error : value3;
throw value;
}
if (this._renderWindowSize) {
_isHorizontal = this._isHorizontal;
value2 = this._getHeightOrWidth(a1);
if (_isHorizontal) {
a0.width = value2;
a0.height = this._renderWindowSize.height / _maxSpan * value;
} else {
a0.height = value2;
a0.width = this._renderWindowSize.width / _maxSpan * value;
}
return undefined;
}
Error = global.Error;
throw new Error('setLayout called before layoutmanager was created, cannot be handled');
}
global.__d(_fun50751, 6463, [6464, 6461]) /* metro module 6463, dependencies: [6464, 6461] */;