176 lines
9.8 KiB
TypeScript
176 lines
9.8 KiB
TypeScript
/* Metro module 5221; source: modules/user_affinities/UserAffinitiesV2Store.tsx; dependencies: [6, 7, 15, 17, 18, 3793, 5222, 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 RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as UserAffinitiesConstantsModule from './UserAffinitiesConstants.tsx'; /* Metro dependency 5222 */
|
|
|
|
function _fun46213(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:6, offset: 0x011a2e60, size: 443 bytes, params: 8, frame: 21
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
Object = global.Object;
|
|
copyDataProperties({}, Object.freeze({userAffinities: [], lastFetched: 0}), undefined);
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
map = _fun46220(PersistedStore);
|
|
map.displayName = 'UserAffinitiesV2Store';
|
|
map.persistKey = 'UserAffinitiesStoreV2';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */, {LOAD_USER_AFFINITIES_V2: function() {
|
|
env0_8 = true;
|
|
}, LOAD_USER_AFFINITIES_V2_SUCCESS: LOAD_USER_AFFINITIES_V2_SUCCESS, LOAD_USER_AFFINITIES_V2_FAILURE: function() {
|
|
env0_8 = false;
|
|
}, LOGOUT: LOGOUT_46235});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_affinities/UserAffinitiesV2Store.tsx');
|
|
exports.default = map;
|
|
function _isNativeReflectConstruct_46214() { // fn#46214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:187, offset: 0x011a301b, size: 94 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_46214_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function recomputeAffinities() { // fn#46217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:459, offset: 0x011a3079, size: 81 bytes, params: 1, frame: 14
|
|
const Map = global.Map;
|
|
const userAffinities = env0_10.userAffinities;
|
|
const value2 = userAffinities.filter(function(a0) {
|
|
return !RelationshipStore.isBlockedOrIgnored(a0.otherUserId);
|
|
});
|
|
let map = value2.map;
|
|
map = new Map(Reflect.apply(map, value2, [function(a0) {
|
|
return [a0.otherUserId, a0];
|
|
}]));
|
|
}
|
|
|
|
function _fun46220(a0) { // fn#46220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:602, offset: 0x011a3101, size: 277 bytes, params: 2, frame: 16
|
|
const UserAffinitiesV2Store2 = UserAffinitiesV2Store;
|
|
Inherits(UserAffinitiesV2Store2, a0);
|
|
return CreateClass(UserAffinitiesV2Store2, [{key: 'initialize', value: value_46222}, {key: 'shouldFetch',
|
|
value: value_46223}, {key: 'isFetching', value: value_46224}, {key: 'getUserAffinities', value: value_46225},
|
|
{key: 'getUserAffinitiesMap', value: value_46226}, {key: 'compare', value: value_46227},
|
|
{key: 'compareByDmProbability', value: value_46228}, {key: 'getUserAffinity', value: value_46229},
|
|
{key: 'getState', value: value_46230}, {key: 'isHighlyAffinedVCUser', value: value_46231}]);
|
|
function UserAffinitiesV2Store() { // fn#46221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:614, offset: 0x010a3f4a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_0(this, UserAffinitiesV2Store);
|
|
const value3 = env1_3(UserAffinitiesV2Store);
|
|
return env1_2(this, _isNativeReflectConstruct_46214() ? global.Reflect.construct(value3, arguments,
|
|
env1_3(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_46222(a0) { // fn#46222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:937, offset: 0x011a3216, size: 104 bytes, params: 2, frame: 14
|
|
var binding;
|
|
this.waitFor(RelationshipStore);
|
|
if (a0 != null) {
|
|
binding = env1_10;
|
|
binding.userAffinities = a0.userAffinities;
|
|
binding = env1_10;
|
|
binding.lastFetched = a0.lastFetched;
|
|
recomputeAffinities();
|
|
}
|
|
this.syncWith([RelationshipStore], recomputeAffinities);
|
|
}
|
|
|
|
function value_46223() { // fn#46223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1126, offset: 0x011a327e, size: 55 bytes, params: 1, frame: 10
|
|
if (env1_8) {
|
|
return undefined;
|
|
}
|
|
const Date = global.Date;
|
|
return Date.now() - env1_10.lastFetched > USER_AFFINITY_TTL;
|
|
}
|
|
|
|
function value_46224() { // fn#46224, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_46225() { // fn#46225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1256, offset: 0x011a32b5, size: 15 bytes, params: 1, frame: 1
|
|
return env1_10.userAffinities;
|
|
}
|
|
|
|
function value_46226() { // fn#46226, offset: 0x00fbd9cb, size: 9 bytes, params: 1, frame: 1
|
|
return env1_7;
|
|
}
|
|
|
|
function value_46227(a0, a1) { // fn#46227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1370, offset: 0x011a32c4, size: 99 bytes, params: 3, frame: 15
|
|
let value = environment.__proto__;
|
|
const value2 = env1_7.get(a1);
|
|
const value3 = undefined;
|
|
const communicationProbability = value2 == null ? value3 : value2.communicationProbability;
|
|
const value4 = 0;
|
|
const r0 = communicationProbability ?? value4;
|
|
value = env1_7.get(a0);
|
|
return r0 - ((value == null ? value3 : value.communicationProbability) ?? value4);
|
|
}
|
|
|
|
function value_46228(a0, a1) { // fn#46228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1578, offset: 0x011a3327, size: 99 bytes, params: 3, frame: 15
|
|
let value = environment.__proto__;
|
|
const value2 = env1_7.get(a1);
|
|
const value3 = undefined;
|
|
const dmProbability = value2 == null ? value3 : value2.dmProbability;
|
|
const value4 = 0;
|
|
const r0 = dmProbability ?? value4;
|
|
value = env1_7.get(a0);
|
|
return r0 - ((value == null ? value3 : value.dmProbability) ?? value4);
|
|
}
|
|
|
|
function value_46229(a0) { // fn#46229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1757, offset: 0x011a338a, size: 22 bytes, params: 2, frame: 11
|
|
return env1_7.get(a0);
|
|
}
|
|
|
|
function value_46230() { // fn#46230, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
|
|
return env1_10;
|
|
}
|
|
|
|
function value_46231(a0) { // fn#46231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:1866, offset: 0x011a33a0, size: 65 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
return (env1_7.get(a0)?.vcProbability ?? 0) > 0.5;
|
|
}
|
|
|
|
}
|
|
|
|
function LOAD_USER_AFFINITIES_V2_SUCCESS({affineUsers}) { // fn#46233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:2176, offset: 0x011a33ee, size: 67 bytes, params: 2, frame: 12
|
|
const binding = env0_10;
|
|
const Date = global.Date;
|
|
binding.lastFetched = Date.now();
|
|
env0_10.userAffinities = affineUsers;
|
|
recomputeAffinities();
|
|
}
|
|
|
|
function LOGOUT_46235() { // fn#46235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5399:2394, offset: 0x011a343e, size: 62 bytes, params: 1, frame: 12
|
|
copyDataProperties({}, env0_9, undefined);
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun46213, 5221, [6, 7, 15, 17, 18, 3793, 5222, 566, 694,
|
|
2]) /* metro module 5221, dependencies: [6, 7, 15, 17, 18, 3793, 5222, 566, 694, 2] */;
|