Files
discord-decomp/sources/stores/AppliedGuildBoostStore.tsx
T
2026-07-28 01:06:53 +03:00

164 lines
8.6 KiB
TypeScript

/* Metro module 12346; source: stores/AppliedGuildBoostStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun94194(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#94194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:6, offset: 0x020f12ad, size: 422 bytes, params: 8, frame: 19
const closure = function() {
env0_9 = true;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_5 = {};
let env0_7 = [];
const Store = (Flux).Store;
let value = _fun94199(Store);
value.displayName = 'AppliedGuildBoostStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{GUILD_APPLIED_BOOSTS_FETCH_SUCCESS: GUILD_APPLIED_BOOSTS_FETCH_SUCCESS,
USER_APPLIED_BOOSTS_FETCH_SUCCESS: function({appliedGuildBoosts}) {
env0_8 = false;
env0_7 = appliedGuildBoosts;
}, APPLIED_BOOSTS_COOLDOWN_FETCH_SUCCESS: function(a0) {
env0_6 = a0.endsAt;
}, GUILD_UNAPPLY_BOOST_START: closure, GUILD_APPLY_BOOST_START: closure,
GUILD_APPLY_BOOST_SUCCESS: GUILD_APPLY_BOOST_SUCCESS, GUILD_APPLY_BOOST_FAIL: function({error}) {
env0_9 = false;
env0_10 = error;
}, GUILD_UNAPPLY_BOOST_SUCCESS: GUILD_UNAPPLY_BOOST_SUCCESS, GUILD_UNAPPLY_BOOST_FAIL: function({error}) {
env0_9 = false;
env0_11 = error;
}, USER_APPLIED_BOOSTS_FETCH_START: function() {
env0_8 = true;
}});
(FileImportTrackerModule).fileFinishedImporting('stores/AppliedGuildBoostStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_94195() { // fn#94195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:148, offset: 0x020f1453, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_94195_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun94199(a0) { // fn#94199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:441, offset: 0x020f14b5, size: 286 bytes, params: 2, frame: 16
const AppliedGuildBoostStore2 = AppliedGuildBoostStore;
Inherits(AppliedGuildBoostStore2, a0);
return CreateClass(AppliedGuildBoostStore2, [{key: 'getAppliedGuildBoostsForGuild', value: value_94201},
{key: 'getLastFetchedAtForGuild', value: value_94202}, {key: 'getCurrentUserAppliedBoosts', value: value_94203},
{key: 'getAppliedGuildBoost', value: value_94204}, {key: 'isModifyingAppliedBoost', get: get_94206},
{key: 'applyBoostError', get: get_94207}, {key: 'unapplyBoostError', get: get_94208}, {key: 'cooldownEndsAt',
get: get_94209}, {key: 'isFetchingCurrentUserAppliedBoosts', get: get_94210}]);
function AppliedGuildBoostStore() { // fn#94200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:453, offset: 0x0118e5fe, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_0(this, AppliedGuildBoostStore);
const value3 = env1_3(AppliedGuildBoostStore);
return env1_2(this, _isNativeReflectConstruct_94195() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function value_94201(a0) { // fn#94201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:800, offset: 0x020f15d3, size: 39 bytes, params: 2, frame: 4
const value2 = null;
return value2 != env1_5[a0] ? env1_5[a0].subscriptions : value2;
}
function value_94202(a0) { // fn#94202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:894, offset: 0x020f15fa, size: 39 bytes, params: 2, frame: 4
const value2 = null;
return value2 != env1_5[a0] ? env1_5[a0].lastFetchedAt : value2;
}
function value_94203() { // fn#94203, offset: 0x00fbd9cb, size: 9 bytes, params: 1, frame: 1
return env1_7;
}
function value_94204(a0) { // fn#94204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:1047, offset: 0x020f1621, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
return env1_7.find(_fun94205);
function _fun94205({id}) { // fn#94205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:1074, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
return id === env0_0;
}
}
function get_94206() { // fn#94206, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
return env1_9;
}
function get_94207() { // fn#94207, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
return env1_10;
}
function get_94208() { // fn#94208, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
return env1_11;
}
function get_94209() { // fn#94209, offset: 0x00c82288, size: 9 bytes, params: 1, frame: 1
return env1_6;
}
function get_94210() { // fn#94210, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
return env1_8;
}
}
function GUILD_APPLIED_BOOSTS_FETCH_SUCCESS({guildId, appliedBoosts}) { // fn#94211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:1476, offset: 0x020f1645, size: 58 bytes, params: 2, frame: 12
const binding = env0_5;
const object = {subscriptions: appliedBoosts};
const Date = global.Date;
object.lastFetchedAt = Date.now();
binding[guildId] = object;
}
function GUILD_APPLY_BOOST_SUCCESS({appliedGuildBoost}) { // fn#94214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:1957, offset: 0x020f16ad, size: 127 bytes, params: 2, frame: 16
const Set = global.Set;
let set = new Set(appliedGuildBoost.map(function(a0) {
return a0.id;
}));
const items2 = [];
set = arraySpread(items2, appliedGuildBoost, 0, undefined);
const binding = env0_7;
arraySpread(items2, binding.filter(_fun94216), set, binding);
function _fun94216({id}) { // fn#94216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:2066, offset: 0x011289b2, size: 30 bytes, params: 2, frame: 11
return !ClassCallCheck.has(id);
}
}
function GUILD_UNAPPLY_BOOST_SUCCESS({boostId}) { // fn#94218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12532:2200, offset: 0x020f1745, size: 53 bytes, params: 2, frame: 12
env0_7 = env0_7.filter(function({id}) {
return id !== boostId;
});
}
}
global.__d(_fun94194, 12346, [6, 7, 15, 17, 18, 566, 694,
2]) /* metro module 12346, dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */;