Files
discord-decomp/sources/by-id/module-01624.jsx
T
2026-07-27 16:20:00 +03:00

400 lines
19 KiB
React

/* Metro module 1624; source: unknown; dependencies: [57, 6, 7, 100, 1613, 1625, 1626, 1635, 1621, 1614] */
function _fun17787(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:6, offset: 0x00e7684a, size: 288 bytes, params: 8, frame: 20
var requestAnimationFrame;
const mockedRequestAnimationFrame = (require(1625) /* metro dependency 1625 */).mockedRequestAnimationFrame;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const value = importDefault(100) /* metro dependency 100 */;
const value2 = require(1613) /* metro dependency 1613 */;
if (!value2.isJest()) {
requestAnimationFrame = global.globalThis.requestAnimationFrame;
if (requestAnimationFrame) {
requestAnimationFrame = global.globalThis.requestAnimationFrame;
}
}
const env0_6 = value('workletsModule');
const env0_7 = _fun17788();
exports.createJSReanimatedModule = createJSReanimatedModule;
exports.Platform = {WEB_IOS: 'web iOS', WEB_ANDROID: 'web Android', WEB: 'web', UNKNOWN: 'unknown'};
}
function _fun17788() { // fn#17788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:287, offset: 0x00e7696a, size: 517 bytes, params: 1, frame: 15
return env0_4(JSReanimated, [{key: 'scheduleOnUI', value: value_17794}, {key: 'createWorkletRuntime',
value: value_17795}, {key: 'scheduleOnRuntime', value: value_17796}, {key: 'registerEventHandler',
value: value_17797}, {key: 'unregisterEventHandler', value: value_17798}, {key: 'enableLayoutAnimations',
value: value_17799}, {key: 'configureLayoutAnimationBatch', value: function() {
}}, {key: 'setShouldAnimateExitingForTag', value: function() {
}}, {key: 'registerSensor', value: value_17802}, {key: 'unregisterSensor', value: function(a0) {
var value = this.sensors.get(a0);
if (value !== undefined) {
value.stop();
this.sensors.delete(a0);
}
}}, {key: 'subscribeForKeyboardEvents', value: value_17804}, {key: 'unsubscribeFromKeyboardEvents',
value: function(a0) {
}}, {key: 'initializeSensor', value: value_17806}, {key: 'getSensorName', value: value_17807},
{key: 'getSettledUpdates', value: value_17808}, {key: 'detectPlatform', value: value_17809},
{key: 'getViewProp', value: value_17810}, {key: 'configureProps', value: value_17811},
{key: 'executeOnUIRuntimeSync', value: value_17812}, {key: 'markNodeAsRemovable', value: value_17813},
{key: 'unmarkNodeAsRemovable', value: value_17814}]);
}
function JSReanimated() { // fn#17789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:308, offset: 0x00e76b6f, size: 153 bytes, params: 1, frame: 21
var environment;
const value = environment.__proto__;
let binding = env1_3;
binding(this, JSReanimated);
const Object = global.Object;
const defineProperty = Object.defineProperty;
binding = env1_6;
const WorkletsModule = (require(1626) /* metro dependency 1626 */).WorkletsModule;
Reflect.apply(defineProperty, Object, [this, binding, {writable: true, value: WorkletsModule}]);
this.nextSensorId = 0;
const Map = global.Map;
this.sensors = new Map();
this.platform = undefined;
this.getSensorCallback = getSensorCallback;
}
function value_17795(a0, a1) { // fn#17795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:1365, offset: 0x00e76f11, size: 59 bytes, params: 3, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('createWorkletRuntime is not available in JSReanimated.');
}
function value_17796() { // fn#17796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:1526, offset: 0x00e76f4c, size: 59 bytes, params: 1, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('scheduleOnRuntime is not available in JSReanimated.');
}
function value_17797(a0, a1, a2) { // fn#17797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:1681, offset: 0x00e76f87, size: 59 bytes, params: 4, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('registerEventHandler is not available in JSReanimated.');
}
function value_17798(a0) { // fn#17798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:1849, offset: 0x00e76fc2, size: 59 bytes, params: 2, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('unregisterEventHandler is not available in JSReanimated.');
}
function value_17799() { // fn#17799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:2017, offset: 0x00e76ffd, size: 230 bytes, params: 1, frame: 17
var isChromeDebugger2;
const logger = (require(1614) /* metro dependency 1614 */).logger;
var warn;
if ((require(1613) /* metro dependency 1613 */).isWeb()) {
logger.warn('Layout Animations are not supported on web yet.');
} else if ((require(1613) /* metro dependency 1613 */).isJest()) {
logger.warn('Layout Animations are no-ops when using Jest.');
} else {
isChromeDebugger2 = (require(1613) /* metro dependency 1613 */).isChromeDebugger();
warn = logger.warn;
if (isChromeDebugger2) {
Reflect.apply(warn, logger, ['Layout Animations are no-ops when using Chrome Debugger.']);
} else {
Reflect.apply(warn, logger, ['Layout Animations are not supported on this configuration.']);
}
}
}
function value_17802(a0, a1, a2, a3) { // fn#17802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:2617, offset: 0x00e770e3, size: 366 bytes, params: 5, frame: 20
var r7;
var platform;
var logger;
var warn;
var isWeb2;
var value3;
var sensors;
var set;
var nextSensorId;
let value = environment.__proto__;
const moduleValue = require(1613) /* metro dependency 1613 */;
if (moduleValue.isWindowAvailable()) {
platform = this.platform;
if (platform === undefined) {
this.detectPlatform();
}
if (this.getSensorName(a0) in global.window) {
if (this.platform === undefined) {
this.detectPlatform();
}
value = this.initializeSensor(a0, a1);
value.addEventListener('reading', this.getSensorCallback(value, a0, a3));
value.start();
sensors = this.sensors;
set = sensors.set;
nextSensorId = this.nextSensorId;
Reflect.apply(set, sensors, [nextSensorId, value]);
nextSensorId = this.nextSensorId;
value = typeof nextSensorId === 'bigint' ? nextSensorId : +nextSensorId;
this.nextSensorId = typeof value === 'bigint' ? value + 1n : +value + 1;
return value;
}
logger = (require(1614) /* metro dependency 1614 */).logger;
warn = logger.warn;
isWeb2 = moduleValue.isWeb();
value3 = '';
r7 = isWeb2 ? global.location.protocol === 'https:' ? value3 : ' Make sure you use secure origin with `npx expo start --web --https`.' : value3;
platform = this.platform;
Reflect.apply(warn, logger,
['Sensor is not available.' + r7 + (platform !== env1_8.WEB_IOS ? value3 : ' For iOS web, you will also have to also grant permission in the browser: https://dev.to/li/how-to-requestpermission-for-devicemotion-and-deviceorientation-events-in-ios-13-46g2.')]);
}
return -1;
}
function value_17804(a0) { // fn#17804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:3556, offset: 0x00e77289, size: 236 bytes, params: 2, frame: 17
var isChromeDebugger2;
const logger = (require(1614) /* metro dependency 1614 */).logger;
var warn;
if ((require(1613) /* metro dependency 1613 */).isWeb()) {
logger.warn('useAnimatedKeyboard is not available on web yet.');
} else if ((require(1613) /* metro dependency 1613 */).isJest()) {
logger.warn('useAnimatedKeyboard is not available when using Jest.');
} else {
isChromeDebugger2 = (require(1613) /* metro dependency 1613 */).isChromeDebugger();
warn = logger.warn;
if (isChromeDebugger2) {
Reflect.apply(warn, logger, ['useAnimatedKeyboard is not available when using Chrome Debugger.']);
} else {
Reflect.apply(warn, logger, ['useAnimatedKeyboard is not available on this configuration.']);
}
}
return -1;
}
function value_17806(a0, a1) { // fn#17806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:4105, offset: 0x00e77375, size: 436 bytes, params: 3, frame: 15
var AbsoluteOrientationSensor;
var absoluteOrientationSensor;
var Magnetometer;
var magnetometer;
var GravitySensor;
var gravitySensor;
var Gyroscope;
var gyroscope;
var Accelerometer;
var accelerometer;
const r2 = a1 <= 0 ? {referenceFrame: 'device'} : {frequency: 1000 / a1};
let value = environment.__proto__;
const SensorType = (require(1635) /* metro dependency 1635 */).SensorType;
const ACCELEROMETER = SensorType.ACCELEROMETER;
if (ACCELEROMETER === a0) {
Accelerometer = global.window.Accelerometer;
value = Object.create(Accelerometer.prototype, {constructor: {value: Accelerometer}});
accelerometer = new Accelerometer(r2);
return accelerometer instanceof Object ? accelerometer : value;
}
const GYROSCOPE = SensorType.GYROSCOPE;
if (GYROSCOPE === a0) {
Gyroscope = global.window.Gyroscope;
value = Object.create(Gyroscope.prototype, {constructor: {value: Gyroscope}});
gyroscope = new Gyroscope(r2);
return gyroscope instanceof Object ? gyroscope : value;
}
const GRAVITY = SensorType.GRAVITY;
if (GRAVITY === a0) {
GravitySensor = global.window.GravitySensor;
value = Object.create(GravitySensor.prototype, {constructor: {value: GravitySensor}});
gravitySensor = new GravitySensor(r2);
return gravitySensor instanceof Object ? gravitySensor : value;
}
const MAGNETIC_FIELD = SensorType.MAGNETIC_FIELD;
if (MAGNETIC_FIELD === a0) {
Magnetometer = global.window.Magnetometer;
value = Object.create(Magnetometer.prototype, {constructor: {value: Magnetometer}});
magnetometer = new Magnetometer(r2);
return magnetometer instanceof Object ? magnetometer : value;
}
const ROTATION = SensorType.ROTATION;
if (ROTATION === a0) {
AbsoluteOrientationSensor = global.window.AbsoluteOrientationSensor;
value = Object.create(AbsoluteOrientationSensor.prototype, {constructor: {value: AbsoluteOrientationSensor}});
absoluteOrientationSensor = new AbsoluteOrientationSensor(r2);
return absoluteOrientationSensor instanceof Object ? absoluteOrientationSensor : value;
}
}
function value_17807(a0) { // fn#17807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:4589, offset: 0x00e77529, size: 224 bytes, params: 2, frame: 14
const SensorType = (require(1635) /* metro dependency 1635 */).SensorType;
const ACCELEROMETER = SensorType.ACCELEROMETER;
if (ACCELEROMETER === a0) {
return 'Accelerometer';
}
const GRAVITY = SensorType.GRAVITY;
if (GRAVITY === a0) {
return 'GravitySensor';
}
const GYROSCOPE = SensorType.GYROSCOPE;
if (GYROSCOPE === a0) {
return 'Gyroscope';
}
const MAGNETIC_FIELD = SensorType.MAGNETIC_FIELD;
if (MAGNETIC_FIELD === a0) {
return 'Magnetometer';
}
const ROTATION = SensorType.ROTATION;
if (ROTATION === a0) {
return 'AbsoluteOrientationSensor';
}
}
function value_17808() { // fn#17808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:4952, offset: 0x00e77609, size: 59 bytes, params: 1, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('`getSettledUpdates` is not available in JSReanimated.');
}
function value_17809() { // fn#17809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5103, offset: 0x00e77644, size: 181 bytes, params: 1, frame: 14
var value;
var value2;
var binding;
const userAgent = global.navigator.userAgent;
let r5 = userAgent || global.navigator.vendor;
r5 = !r5 ? global.window.opera : r5;
if (r5 === undefined) {
value = environment.__proto__;
this.platform = env1_8.UNKNOWN;
} else {
value = RegExp('iPad|iPhone|iPod', '').test(r5);
value2 = environment.__proto__;
if (value) {
this.platform = env1_8.WEB_IOS;
} else {
value = RegExp('android', 'i').test(r5);
binding = env1_8;
if (value) {
this.platform = binding.WEB_ANDROID;
} else {
this.platform = binding.WEB;
}
}
}
}
function value_17810(a0, a1, a2, a3) { // fn#17810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5367, offset: 0x00e776f9, size: 59 bytes, params: 5, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('getViewProp is not available in JSReanimated.');
}
function value_17811() { // fn#17811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5511, offset: 0x00e77734, size: 59 bytes, params: 1, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('configureProps is not available in JSReanimated.');
}
function value_17812(a0) { // fn#17812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5662, offset: 0x00e7776f, size: 59 bytes, params: 2, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('`executeOnUIRuntimeSync` is not available in JSReanimated.');
}
function value_17813(a0) { // fn#17813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5829, offset: 0x00e777aa, size: 59 bytes, params: 2, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('markNodeAsRemovable is not available in JSReanimated.');
}
function value_17814(a0) { // fn#17814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:5990, offset: 0x00e777e5, size: 59 bytes, params: 2, frame: 11
const value = environment.__proto__;
const ReanimatedError = (require(1621) /* metro dependency 1621 */).ReanimatedError;
throw new ReanimatedError('unmarkNodeAsRemovable is not available in JSReanimated.');
}
function getSensorCallback(a0, a1, a2) { // fn#17790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:522, owner: JSReanimated.getSensorCallback, offset: 0x00e76c08, size: 218 bytes, params: 4, frame: 15
const env0_0 = a0;
const env0_1 = a2;
const SensorType = (require(1635) /* metro dependency 1635 */).SensorType;
const ACCELEROMETER = SensorType.ACCELEROMETER;
if (ACCELEROMETER === a1) {
return _fun17791;
}
const GRAVITY = SensorType.GRAVITY;
if (GRAVITY === a1) {
return _fun17791;
}
const GYROSCOPE = SensorType.GYROSCOPE;
if (GYROSCOPE === a1) {
return _fun17792;
}
const MAGNETIC_FIELD = SensorType.MAGNETIC_FIELD;
if (MAGNETIC_FIELD === a1) {
return _fun17792;
}
const ROTATION = SensorType.ROTATION;
if (ROTATION === a1) {
return _fun17793;
}
}
function _fun17791() { // fn#17791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:625, offset: 0x00e76ce2, size: 142 bytes, params: 1, frame: 17
var r0;
var r3;
var r4;
var items;
var property;
var property2;
const {x, y, z} = env0_0;
const platform = env1_0.platform;
const WEB_ANDROID = env3_8.WEB_ANDROID;
if (platform !== WEB_ANDROID) {
r0 = z;
r3 = y;
r4 = x;
} else {
items = [-x, -y, -z];
property = items[0];
property2 = items[1];
r0 = items[2];
r3 = property2;
r4 = property;
}
importDefault({x: r4, y: r3, z: r0, interfaceOrientation: 0});
}
function _fun17792() { // fn#17792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:848, offset: 0x00e76d70, size: 58 bytes, params: 1, frame: 13
const binding = env0_0;
importDefault({x: binding.x, y: binding.y, z: binding.z, interfaceOrientation: 0});
}
function _fun17793() { // fn#17793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1751:962, offset: 0x00e76daa, size: 340 bytes, params: 1, frame: 23
var r7;
var r8;
var items;
var property5;
let value = environment.__proto__.__proto__.__proto__;
const value3 = env3_2(env0_0.quaternion, 4);
const property = value3[0];
const property2 = value3[1];
const property3 = value3[2];
const property4 = value3[3];
const platform = env1_0.platform;
const WEB_ANDROID = env3_8.WEB_ANDROID;
if (platform !== WEB_ANDROID) {
r7 = property4;
r8 = property3;
} else {
items = [property4, -property3];
property5 = items[0];
r7 = items[1];
r8 = property5;
}
let Math = global.Math;
const atan2 = Math.atan2;
value = r8 * r7;
value = 2 * (value + property * property2);
value = -Reflect.apply(atan2, Math, [value, property * property - property2 * property2 - r8 * r8 + r7 * r7]);
Math = global.Math;
const value9 = Math.sin(-2 * (property2 * r7 - property * r8));
Math = global.Math;
importDefault({qw: property, qx: property2, qy: r8, qz: r7, yaw: value, pitch: value9,
roll: -Math.atan2(2 * (property2 * r8 + property * r7),
property * property + property2 * property2 - r8 * r8 - r7 * r7), interfaceOrientation: 0});
}