Files
discord-decomp/sources/modules/lurker_mode/LurkerActionCreators.tsx
T
2026-07-27 16:20:00 +03:00

793 lines
31 KiB
TypeScript

/* Metro module 6911; source: modules/lurker_mode/LurkerActionCreators.tsx; dependencies: [5, 4294, 3785, 661, 694, 507, 6912, 1360, 6913, 6929, 2] */
function _fun55006(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:6, offset: 0x0137312f, size: 267 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_55009 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const closure = function() {
return _stopLurkingAll.apply(this, arguments);
};
const closure2 = function() {
return _stopLurkingForGuild.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).Endpoints;
(importDefault(6929) /* metro dependency 6929: LurkerPreviewManager */).initialize();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/lurker_mode/LurkerActionCreators.tsx');
exports.stopLurkingAll = closure;
exports.stopLurkingForGuild = closure2;
exports.stopLurking = function() {
return _stopLurking.apply(this, arguments);
};
}
function _createForOfIteratorHelperLoose_55007(a0, a1) { // fn#55007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:151, offset: 0x0137323a, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun55008;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_55009(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_55009(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_55009(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun55008;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function _stopLurkingAll() { // fn#55011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1132, offset: 0x013733ac, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55013).apply(this, arguments);
}
function _stopLurkingForGuild() { // fn#55021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1869, offset: 0x013735e2, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55023).apply(this, arguments);
}
function _stopLurking() { // fn#55024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:2320, offset: 0x0137372b, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55026).apply(this, arguments);
}
function* _fun55013(a0) { // fn#55013, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1185, offset: 0x013733e5, size: 218 bytes, params: 2, frame: 18
var environment;
if (true) {
var env0_0 = a0;
var env0_1;
value = environment.__proto__.__proto__;
var value4 = env2_5.lurkingGuildIds().filter(_fun55014);
if (value4.length === 0) {
return undefined;
}
var Map = global.Map;
var map = value4.map;
map = new Map(Reflect.apply(map, value4, [_fun55015]));
env2_1(env2_2[4]).dispatch({type: 'GUILD_STOP_LURKING', ignoredGuildIds: a0});
var Promise = global.Promise;
yield Promise.all(value4.map(_fun55016()));
}
}
function* _fun55023(a0) { // fn#55023, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1932, offset: 0x0137361b, size: 272 bytes, params: 2, frame: 20
var binding;
var lurkingGuildIds;
var value3;
var includes;
var getLurkingSourceForGuild;
var value4;
var value5;
var dispatch;
var object3;
var binding2;
var property;
var value6;
var HTTP;
var del;
var GUILD_LEAVE;
var value7;
var object4;
var value8;
var value9;
var value10;
var error;
let value = undefined;
if (false) {
return value;
}
reduciblePort28: while (true) {
exceptionLanding27: while (true) {
value = environment.__proto__.__proto__;
binding = env2_5;
lurkingGuildIds = binding.lurkingGuildIds;
value3 = Reflect.apply(lurkingGuildIds, binding, []);
includes = value3.includes;
if (Reflect.apply(includes, value3, [a0])) {
binding = env2_5;
getLurkingSourceForGuild = binding.getLurkingSourceForGuild;
value4 = Reflect.apply(getLurkingSourceForGuild, binding, [a0]);
binding = env2_1;
value5 = binding(env2_2[4]);
dispatch = value5.dispatch;
Reflect.apply(dispatch, value5, [{type: 'GUILD_STOP_LURKING_FOR_GUILD', lurkingGuildId: a0}]);
try {
binding = env2_0;
} catch (error) {
break exceptionLanding27;
}
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding27;
}
try {
property = binding2[5];
} catch (error) {
break exceptionLanding27;
}
try {
value6 = binding(property);
} catch (error) {
break exceptionLanding27;
}
try {
HTTP = value6.HTTP;
} catch (error) {
break exceptionLanding27;
}
try {
del = HTTP.del;
} catch (error) {
break exceptionLanding27;
}
try {
object3 = {};
} catch (error) {
break exceptionLanding27;
}
try {
binding = env2_6;
} catch (error) {
break exceptionLanding27;
}
try {
GUILD_LEAVE = binding.GUILD_LEAVE;
} catch (error) {
break exceptionLanding27;
}
try {
value7 = Reflect.apply(GUILD_LEAVE, binding, [a0]);
} catch (error) {
break exceptionLanding27;
}
try {
object3.url = value7;
} catch (error) {
break exceptionLanding27;
}
try {
object4 = {};
} catch (error) {
break exceptionLanding27;
}
try {
object4.lurking = true;
} catch (error) {
break exceptionLanding27;
}
try {
object3.body = object4;
} catch (error) {
break exceptionLanding27;
}
try {
object3.oldFormErrors = true;
} catch (error) {
break exceptionLanding27;
}
try {
object3.rejectWithError = true;
} catch (error) {
break exceptionLanding27;
}
try {
value8 = Reflect.apply(del, HTTP, [object3]);
} catch (error) {
break exceptionLanding27;
}
yield value8;
try {
value9 = undefined;
value10 = false;
} catch (error) {
break exceptionLanding27;
}
if (value10) {
return value9;
}
break reduciblePort28;
}
break reduciblePort28;
}
binding = env2_1;
value = binding(env2_2[4]);
dispatch = value.dispatch;
Reflect.apply(dispatch, value, [{type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0,
lurkingSource: value4}]);
break reduciblePort28;
}
}
async function _fun55026() { // fn#55026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:2367, offset: 0x0137376d, size: 631 bytes, params: 1, frame: 29
var r19;
var environment;
var r4;
var r2;
var r5;
var r6;
var r7;
var r8;
var r9;
var r10;
var r11;
var r13;
var r17;
var r18;
var r20;
var r3;
var value7;
var getMobileLurkerServerPreview;
var includes;
var items2;
var getGuildId;
var filter;
var binding2;
var isNotNullish;
var value8;
var value9;
var enabled;
var value10;
var value11;
var generator;
var value12;
var done;
var value13;
var value14;
var value15;
var value16;
var value17;
var Symbol;
var iterator;
var next;
var error;
var value18;
var value19;
var value20;
var value21;
var value22;
let value = a0;
if (false) {
return undefined;
}
const value4 = undefined;
reducibleJoin3: while (true) {
if (value !== value4) {
r4 = value;
break reducibleJoin3;
}
value = null;
r4 = value;
break reducibleJoin3;
}
var env0_0;
await value4;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_5;
const value6 = binding.lurkingGuildIds();
let length = value6.length;
if (length !== 0) {
binding = env2_0;
value7 = binding(env2_2[6]);
getMobileLurkerServerPreview = value7.getMobileLurkerServerPreview;
reducibleJoin35: while (true) {
if (Reflect.apply(getMobileLurkerServerPreview, value7, ['LurkerActionCreators.stopLurking']).stickyLurk) {
break reducibleJoin35;
}
if (r4 != null) {
includes = value6.includes;
reducibleJoin9: while (true) {
if (Reflect.apply(includes, value6, [r4])) {
break reducibleJoin35;
}
break reducibleJoin9;
}
}
items2 = [r4];
binding = env2_4;
getGuildId = binding.getGuildId;
items2[1] = Reflect.apply(getGuildId, binding, []);
filter = items2.filter;
binding = env2_0;
binding2 = env2_2;
isNotNullish = binding(binding2[7]).isNotNullish;
value8 = Reflect.apply(filter, items2, [isNotNullish]);
env0_0 = value8;
value9 = binding(binding2[6]);
getMobileLurkerServerPreview = value9.getMobileLurkerServerPreview;
enabled = Reflect.apply(getMobileLurkerServerPreview, value9, ['LurkerActionCreators.stopLurking']).enabled;
if (enabled) {
filter = value6.filter;
value10 = Reflect.apply(filter, value6, [_fun55027]);
length = value10.length;
reducibleJoin11: while (true) {
if (length > 0) {
generator = loop_55029;
value = env2_7(value10);
value12 = value();
done = value12.done;
value13 = global;
value14 = 'iterator is not an object';
value15 = 'iterator.throw() did not return an object';
value16 = 'throw';
value17 = 'iterator.next() did not return an object';
if (done) {
r2 = value4;
} else {
r2 = value4;
r4 = value12;
r5 = value17;
r6 = value16;
r7 = value15;
r8 = value14;
r9 = value13;
r10 = value;
r11 = generator;
reducibleLoop15: while (true) {
value = r4.value;
value = Reflect.apply(r11, r2, [value]);
Symbol = r9.Symbol;
iterator = Symbol.iterator;
value = value[iterator]();
ensureObject(value, r8, r19);
next = value.next;
r13 = value;
r17 = value4;
r18 = next;
reduciblePort33: while (true) {
exceptionLanding19: while (true) {
reducibleLoop16: while (true) {
value = Reflect.apply(r18, r13, [r17]);
ensureObject(value, r5, r19);
done = value.done;
if (done) {
r3 = value;
break reduciblePort33;
}
try {
generatorSetDelegated(value);
} catch (error) {
break exceptionLanding19;
}
await value;
reducibleLoop22: while (true) {
try {
value = undefined;
value18 = false;
} catch (error) {
break exceptionLanding19;
}
if (value18) {
value19 = getMethod(r13, 'return', r19);
if (value19 === r2) {
return value;
}
value = Reflect.apply(value19, r13, [value]);
ensureObject(value, 'iterator.return() did not return an object',
value19);
done = value.done;
if (done) {
return value.value;
}
value20 = generatorSetDelegated(value);
await value;
r19 = value20;
continue reducibleLoop22;
}
r17 = value;
continue reducibleLoop16;
}
continue reducibleLoop16;
}
break reduciblePort33;
}
exceptionRetry19: while (true) {
value = getMethod(r13, r6, r19);
if (value === r2) {
value = 'return';
value21 = getMethod(r13, value, r19);
reducibleJoin32: while (true) {
if (value21 === r2) {
r20 = value;
break reducibleJoin32;
}
value = Reflect.apply(value21, r13, []);
value22 = 'iterator.return() did not return an object';
ensureObject(value, value22, r19);
r20 = value22;
break reducibleJoin32;
}
throwTypeError('yield* delegate must have a .throw() method', r20);
throw r2;
}
value = Reflect.apply(value, r13, [error]);
ensureObject(value, r7, r19);
done = value.done;
reducibleJoin33: while (true) {
if (done) {
r3 = value;
break reducibleJoin33;
}
generatorSetDelegated(value);
await value;
reducibleLoop22: while (true) {
try {
value = undefined;
value18 = false;
} catch (error) {
continue exceptionRetry19;
}
reducibleJoin24: while (true) {
if (value18) {
break reducibleJoin24;
}
r17 = value;
value = Reflect.apply(r18, r13, [r17]);
ensureObject(value, r5, r19);
done = value.done;
if (done) {
r3 = value;
break reducibleJoin33;
}
try {
generatorSetDelegated(value);
} catch (error) {
continue exceptionRetry19;
}
await value;
continue reducibleLoop22;
}
value19 = getMethod(r13, 'return', r19);
if (value19 === r2) {
return value;
}
value = Reflect.apply(value19, r13, [value]);
ensureObject(value, 'iterator.return() did not return an object',
value19);
done = value.done;
if (done) {
return value.value;
}
value20 = generatorSetDelegated(value);
await value;
r19 = value20;
continue reducibleLoop22;
}
}
break reduciblePort33;
}
}
r3.value;
value = Reflect.apply(r10, r2, []);
done = value.done;
if (done) {
return r2;
}
r4 = value;
continue reducibleLoop15;
}
}
return r2;
}
break reducibleJoin11;
}
}
await env2_9(value8);
value = undefined;
value11 = false;
if (value11) {
return value;
}
break reducibleJoin35;
}
}
return value4;
}
function _fun55015(a0) { // fn#55015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1290, offset: 0x013734bf, size: 35 bytes, params: 2, frame: 12
const binding = env3_5;
const getLurkingSourceForGuild = binding.getLurkingSourceForGuild;
return [a0, Reflect.apply(getLurkingSourceForGuild, binding, [a0])];
}
function _fun55016() { // fn#55016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1418, offset: 0x013734e2, size: 32 bytes, params: 1, frame: 12
const env0_0 = env3_3(_fun55018);
return _fun55019;
}
function* loop_55029(a0) { // fn#55029, original name: ?anon_0__loop, inferred name: loop_55029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:2749, offset: 0x013739ed, size: 71 bytes, params: 2, frame: 16
var environment;
if (true) {
var env0_0 = a0;
value = environment.__proto__.__proto__.__proto__.__proto__;
value = env4_0(env4_2[8]);
value.openLurkerLeavePrompt(a0, {onLeave: onLeave_55030});
}
}
function* _fun55018(a0) { // fn#55018, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:1438, offset: 0x0137350b, size: 215 bytes, params: 2, frame: 18
var binding2;
var property;
var value4;
var HTTP;
var del;
var object3;
var GUILD_LEAVE;
var value5;
var object4;
var value6;
var value7;
var value8;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_1;
value = binding.get(a0);
const value3 = null;
const r2 = value3 != value ? value : value3;
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
try {
binding = env5_0;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
binding2 = env5_2;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
property = binding2[5];
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
value4 = binding(property);
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
HTTP = value4.HTTP;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
del = HTTP.del;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object3 = {};
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
binding = env5_6;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
GUILD_LEAVE = binding.GUILD_LEAVE;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
value5 = Reflect.apply(GUILD_LEAVE, binding, [a0]);
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object3.url = value5;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object4 = {};
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object4.lurking = true;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object3.body = object4;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object3.oldFormErrors = true;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
object3.rejectWithError = true;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
try {
value6 = Reflect.apply(del, HTTP, [object3]);
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env5_1;
value = binding(env5_2[4]);
value.dispatch({type: 'GUILD_STOP_LURKING_FAILURE', lurkingGuildId: a0, lurkingSource: r2});
return undefined;
}
return value8 ? value7 : undefined;
}
function loop_55029OnLeave() { // fn#55030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7089:2804, owner: loop_55029.onLeave, offset: 0x01373a34, size: 23 bytes, params: 1, frame: 11
env5_11(env0_0);
}