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

454 lines
20 KiB
React

/* Metro module 1137; source: unknown; dependencies: [1010, 826, 1009, 1021, 1138, 1139] */
function _fun12651(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:6, offset: 0x00dd19e6, size: 132 bytes, params: 8, frame: 17
var closure;
let value = this;
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
if (!(value && value.__awaiter)) {
closure = function(a0, a1, a2, a3) {
var r2;
var value = a2;
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = value;
var env0_3 = a3;
r2 = value || global.Promise;
value = Object.create(r2.prototype, {constructor: {value: r2}});
var value2 = new r2(_fun12653);
return value2 instanceof Object ? value2 : value;
};
}
const env0_4 = {'maskAllText': true, 'maskAllImages': true, 'maskAllVectors': true,
'enableExperimentalViewRenderer': false, 'enableViewRendererV2': true, 'enableFastViewRendering': false,
'screenshotStrategy': 'pixelCopy'};
exports.MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';
exports.mobileReplayIntegration = mobileReplayIntegration;
}
function _fun12652(a0, a1, a2, a3) { // fn#12652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:122, offset: 0x00dd1a6a, size: 75 bytes, params: 5, frame: 12
let value = a2;
const env0_0 = a0;
const env0_1 = a1;
const env0_3 = a3;
let r2 = value || global.Promise;
value = Object.create(r2.prototype, {constructor: {value: r2}});
r2 = new r2(_fun12653);
return r2 instanceof Object ? r2 : value;
}
function mobileReplayIntegrationNoop() { // fn#12659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:666, offset: 0x00dd1b9a, size: 35 bytes, params: 1, frame: 3
return {name: env0_3, options: env0_4, getReplayId: function() {
return null;
}};
}
function mobileReplayIntegration() { // fn#12661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:842, offset: 0x00dd1bbd, size: 471 bytes, params: 1, frame: 20
const debug = (require(826) /* metro dependency 826 */).debug;
const updateCachedReplayId = function(a0) {
env0_1 = a0;
};
const r2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : env0_4;
const moduleValue = require(1010) /* metro dependency 1010 */;
if (moduleValue.isExpoGo()) {
debug.warn('[Sentry] ' + env0_3 + ' is not supported in Expo Go. Use EAS Build or `expo prebuild` to enable it.');
}
const moduleValue2 = moduleValue;
if (moduleValue2.notMobileOs()) {
debug.warn('[Sentry] ' + env0_3 + ' is not supported on this platform.');
}
const moduleValue3 = moduleValue;
if (moduleValue3.isExpoGo()) {
return mobileReplayIntegrationNoop();
}
const moduleValue4 = moduleValue;
if (moduleValue4.notMobileOs()) {
return mobileReplayIntegrationNoop();
}
const Object = global.Object;
const assign = Object.assign;
const Object2 = global.Object;
const value2 = Reflect.apply(assign, Object, [Object2.assign({}, env0_4), r2]);
if (r2.enableViewRendererV2 === undefined && r2.enableExperimentalViewRenderer !== undefined) {
value2.enableViewRendererV2 = r2.enableExperimentalViewRenderer;
}
return {name: env0_3, setup: setup_12664, processEvent: processEvent_12667, options: value2,
getReplayId: function() {
return getCachedReplayId();
}};
}
function _fun12653(a0, a1) { // fn#12653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:168, offset: 0x00dd1ab5, size: 98 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const closure = step_12656;
const value2 = importAll.apply(env0_0, require || []);
closure(value2.next());
}
function getCachedReplayId() { // fn#12663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:1489, owner: mobileReplayIntegration.getCachedReplayId, offset: 0x00dd1d94, size: 69 bytes, params: 1, frame: 12
if (env0_1 !== null) {
return env0_1;
}
const NATIVE = (require(1009) /* metro dependency 1009 */).NATIVE;
const currentReplayId = NATIVE.getCurrentReplayId();
if (currentReplayId) {
}
return currentReplayId;
}
function mobileReplayIntegrationSetup(a0) { // fn#12664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:1619, owner: mobileReplayIntegration.setup, offset: 0x00dd1dd9, size: 174 bytes, params: 2, frame: 17
var environment;
let value = environment.__proto__;
const moduleValue = require(1138) /* metro dependency 1138 */;
if (moduleValue.hasHooks(a0)) {
value = (require(1009) /* metro dependency 1009 */).NATIVE.getCurrentReplayId();
a0.on('createDsc', _fun12665);
a0.on('processMetric', _fun12666);
a0.on('beforeAddBreadcrumb', (require(1139) /* metro dependency 1139 */).enrichXhrBreadcrumbsForMobileReplay);
}
}
function mobileReplayIntegrationProcessEvent(a0, a1) { // fn#12667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:2003, owner: mobileReplayIntegration.processEvent, offset: 0x00dd1edf, size: 43 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = a1;
return env1_2(this, undefined, undefined, _fun12669);
}
function step_12656(a0) { // fn#12656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:296, offset: 0x00dd1b17, size: 77 bytes, params: 2, frame: 14
var value;
if (a0.done) {
env0_0(a0.value);
} else {
value = a0.value;
value = step_12656Adopt(value);
value.then(fulfilled_12654, rejected_12655);
}
}
function _fun12665(a0) { // fn#12665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:1715, offset: 0x00dd1e87, size: 38 bytes, params: 2, frame: 10
var value;
if (!a0.replay_id) {
value = environment.__proto__;
value = getCachedReplayId();
if (value) {
a0.replay_id = value;
}
}
}
function _fun12666(a0) { // fn#12666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:1815, offset: 0x00dd1ead, size: 50 bytes, params: 2, frame: 12
var attributes;
let value = environment.__proto__;
value = getCachedReplayId();
if (value) {
attributes = a0.attributes;
a0.attributes = attributes || ({});
attributes = a0.attributes;
attributes.replay_id = value;
}
}
function* _fun12669() { // fn#12669, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:2065, offset: 0x00dd1f13, size: 927 bytes, params: 1, frame: 31
var values;
var r5;
var r3;
var value4;
var beforeErrorSampling;
var binding;
var binding2;
var value5;
var value6;
var value7;
var binding3;
var property;
var value8;
var debug;
var log;
var binding4;
var event_id;
var HermesInternal;
var concat;
var value9;
var error;
var value10;
var error2;
var value11;
var binding5;
var NATIVE;
var captureReplay;
var value12;
var isHardCrash;
var value13;
var value14;
var getCurrentReplayId;
var value15;
var binding6;
var contexts;
var Object;
var assign;
var Object2;
var assign2;
var contexts2;
var replay;
var value16;
var binding7;
var Object3;
var assign3;
var contexts3;
var value17;
if (false) {
return undefined;
}
value = environment.__proto__;
const exception = env1_0.exception;
const value3 = undefined;
reducibleJoin4: while (true) {
if (exception === null) {
values = value3;
break reducibleJoin4;
}
if (value3 === updateCachedReplayId) {
values = value3;
break reducibleJoin4;
}
values = updateCachedReplayId.values;
break reducibleJoin4;
}
if (values) {
reducibleJoin6: while (true) {
if (env1_0.exception.values.length > 0) {
reducibleJoin35: while (true) {
reduciblePort34: while (true) {
exceptionLanding33: while (true) {
value4 = environment.__proto__.__proto__;
beforeErrorSampling = require.beforeErrorSampling;
if (beforeErrorSampling) {
try {
} catch (error) {
break exceptionLanding33;
}
try {
beforeErrorSampling = require.beforeErrorSampling;
} catch (error) {
break exceptionLanding33;
}
try {
binding = env1_0;
} catch (error) {
break exceptionLanding33;
}
try {
binding2 = env1_1;
} catch (error) {
break exceptionLanding33;
}
try {
value5 = Reflect.apply(beforeErrorSampling, require, [binding, binding2]);
} catch (error) {
break exceptionLanding33;
}
try {
value6 = value5 === false;
} catch (error) {
break exceptionLanding33;
}
if (value6) {
value7 = environment.__proto__.__proto__.__proto__;
try {
binding = env3_0;
} catch (error) {
break exceptionLanding33;
}
try {
binding3 = env3_1;
} catch (error) {
break exceptionLanding33;
}
try {
property = binding3[1];
} catch (error) {
break exceptionLanding33;
}
try {
value8 = binding(property);
} catch (error) {
break exceptionLanding33;
}
try {
debug = value8.debug;
} catch (error) {
break exceptionLanding33;
}
try {
log = debug.log;
} catch (error) {
break exceptionLanding33;
}
try {
binding = env3_3;
} catch (error) {
break exceptionLanding33;
}
try {
binding4 = env1_0;
} catch (error) {
break exceptionLanding33;
}
try {
event_id = binding4.event_id;
} catch (error) {
break exceptionLanding33;
}
try {
HermesInternal = global.HermesInternal;
} catch (error) {
break exceptionLanding33;
}
try {
concat = HermesInternal.concat;
} catch (error) {
break exceptionLanding33;
}
try {
value9 = '[Sentry] ' + binding + ' not sent; beforeErrorSampling conditions not met for event ' + event_id + '.';
} catch (error) {
break exceptionLanding33;
}
try {
Reflect.apply(log, debug, [value9]);
} catch (error) {
break exceptionLanding33;
}
return binding4;
}
break reduciblePort34;
}
break reduciblePort34;
}
value10 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
debug = binding(env3_1[1]).debug;
error2 = debug.error;
binding = env3_3;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(error2, debug,
['[Sentry] ' + binding + ' beforeErrorSampling callback threw an error, proceeding with replay capture',
error]);
break reduciblePort34;
}
value11 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
binding5 = env3_1;
NATIVE = binding(binding5[2]).NATIVE;
captureReplay = NATIVE.captureReplay;
value12 = binding(binding5[3]);
isHardCrash = value12.isHardCrash;
yield Reflect.apply(captureReplay, NATIVE, [Reflect.apply(isHardCrash, value12, [env1_0])]);
break reducibleJoin35;
}
value13 = undefined;
value14 = false;
if (value14) {
return value13;
}
if (value13) {
env2_2(value13);
binding = env3_0;
debug = binding(env3_1[1]).debug;
log = debug.log;
binding = env3_3;
binding7 = env1_0;
event_id = binding7.event_id;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(log, debug,
['[Sentry] ' + binding + ' Captured recording replay ' + value13 + ' for event ' + event_id + '.']);
contexts = binding7.contexts;
reducibleJoin44: while (true) {
if (contexts) {
r3 = contexts;
break reducibleJoin44;
}
r3 = {};
break reducibleJoin44;
}
binding7.contexts = r3;
binding = env1_0;
contexts = binding.contexts;
Object = global.Object;
assign = Object.assign;
Object3 = global.Object;
assign3 = Object3.assign;
contexts3 = binding.contexts;
replay = contexts3.replay;
value17 = Reflect.apply(assign3, Object3, [{}, replay]);
contexts.replay = Reflect.apply(assign, Object, [value17, {replay_id: value13}]);
} else {
binding = env3_0;
NATIVE = binding(env3_1[2]).NATIVE;
getCurrentReplayId = NATIVE.getCurrentReplayId;
value15 = Reflect.apply(getCurrentReplayId, NATIVE, []);
binding = env2_2;
if (value15) {
binding(value15);
binding = env3_0;
debug = binding(env3_1[1]).debug;
log = debug.log;
binding = env3_3;
binding6 = env1_0;
event_id = binding6.event_id;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(log, debug,
['[Sentry] ' + binding + ' assign already recording replay ' + value15 + ' for event ' + event_id + '.']);
contexts = binding6.contexts;
reducibleJoin41: while (true) {
if (contexts) {
r5 = contexts;
break reducibleJoin41;
}
r5 = {};
break reducibleJoin41;
}
binding6.contexts = r5;
binding = env1_0;
contexts = binding.contexts;
Object = global.Object;
assign = Object.assign;
Object2 = global.Object;
assign2 = Object2.assign;
contexts2 = binding.contexts;
replay = contexts2.replay;
value16 = Reflect.apply(assign2, Object2, [{}, replay]);
contexts.replay = Reflect.apply(assign, Object, [value16, {replay_id: value15}]);
} else {
binding(null);
binding = env3_0;
debug = binding(env3_1[1]).debug;
log = debug.log;
binding = env3_3;
event_id = env1_0.event_id;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(log, debug, ['[Sentry] ' + binding + ' not sampled for event ' + event_id + '.']);
}
}
return env1_0;
}
break reducibleJoin6;
}
}
return env1_0;
}
function step_12656Adopt(a0) { // fn#12657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1264:331, owner: step_12656.adopt, offset: 0x00dd1b64, size: 54 bytes, params: 2, frame: 12
const value = a0;
return value instanceof env2_2 ? value : new env2_2(_fun12658);
}