decord/source/modules/user_affinities/UserAffinitiesV2Store.tsx

206 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 5892
// Function ID: 52311
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 3768, 5893, 566, 686, 2]
2026-07-23 10:11:24 +00:00
2026-07-25 08:10:48 +00:00
// Module 5892 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import result from "result";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { USER_AFFINITY_TTL } from "result";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
2026-07-23 10:11:24 +00:00
let result = !valueOf.call(Reflect.construct(Boolean, [], () => {
2026-07-20 16:05:17 +00:00
}));
function _isNativeReflectConstruct() {
2026-07-23 10:11:24 +00:00
return result;
2026-07-20 16:05:17 +00:00
}
const result = _isNativeReflectConstruct();
}
function recomputeAffinities() {
const userAffinities = obj.userAffinities;
2026-07-23 10:11:24 +00:00
const found = userAffinities.filter((otherUserId) => !outer1_5.isBlockedOrIgnored(otherUserId.otherUserId));
2026-07-20 16:05:17 +00:00
const map = new Map(found.map((otherUserId) => {
const items = [otherUserId.otherUserId, otherUserId];
return items;
}));
}
2026-07-23 10:11:24 +00:00
let map = new Map();
let c8 = false;
2026-07-20 16:05:17 +00:00
const frozen = Object.freeze({ userAffinities: [], lastFetched: 0 });
let obj = {};
2026-07-23 10:11:24 +00:00
let merged = Object.assign(frozen);
let tmp5 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class UserAffinitiesV2Store {
constructor() {
self = this;
tmp = UserAffinitiesV2Store(this, UserAffinitiesV2Store);
2026-07-23 10:11:24 +00:00
obj = outer1_3(UserAffinitiesV2Store);
tmp2 = outer1_2;
if (outer1_11()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_3;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_3(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(UserAffinitiesV2Store, PersistedStore);
let obj = {
key: "initialize",
value(userAffinities) {
const self = this;
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_5);
2026-07-20 16:05:17 +00:00
if (null != userAffinities) {
2026-07-23 10:11:24 +00:00
outer1_10.userAffinities = userAffinities.userAffinities;
outer1_10.lastFetched = userAffinities.lastFetched;
outer1_12();
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const items = [outer1_5];
self.syncWith(items, outer1_12);
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "shouldFetch",
value() {
2026-07-23 10:11:24 +00:00
if (!outer1_8) {
2026-07-20 16:05:17 +00:00
const _Date = Date;
2026-07-23 10:11:24 +00:00
return Date.now() - outer1_10.lastFetched > outer1_6;
2026-07-20 16:05:17 +00:00
}
}
};
items[1] = obj;
obj = {
key: "isFetching",
value() {
2026-07-23 10:11:24 +00:00
return outer1_8;
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "getUserAffinities",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10.userAffinities;
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "getUserAffinitiesMap",
value() {
2026-07-23 10:11:24 +00:00
return outer1_7;
2026-07-20 16:05:17 +00:00
}
};
items[5] = {
key: "compare",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let value = outer1_7.get(arg1);
2026-07-20 16:05:17 +00:00
let prop;
if (null != value) {
prop = value.communicationProbability;
}
let num = 0;
if (null != prop) {
num = prop;
}
2026-07-23 10:11:24 +00:00
value = outer1_7.get(arg0);
2026-07-20 16:05:17 +00:00
let prop1;
if (null != value) {
prop1 = value.communicationProbability;
}
let num2 = 0;
if (null != prop1) {
num2 = prop1;
}
return num - num2;
}
};
items[6] = {
key: "compareByDmProbability",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let value = outer1_7.get(arg1);
2026-07-20 16:05:17 +00:00
let dmProbability;
if (null != value) {
dmProbability = value.dmProbability;
}
let num = 0;
if (null != dmProbability) {
num = dmProbability;
}
2026-07-23 10:11:24 +00:00
value = outer1_7.get(arg0);
2026-07-20 16:05:17 +00:00
let dmProbability1;
if (null != value) {
dmProbability1 = value.dmProbability;
}
let num2 = 0;
if (null != dmProbability1) {
num2 = dmProbability1;
}
return num - num2;
}
};
items[7] = {
key: "getUserAffinity",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_7.get(arg0);
2026-07-20 16:05:17 +00:00
}
};
items[8] = {
key: "getState",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10;
2026-07-20 16:05:17 +00:00
}
};
items[9] = {
key: "isHighlyAffinedVCUser",
value(arg0) {
2026-07-23 10:11:24 +00:00
const value = outer1_7.get(arg0);
2026-07-20 16:05:17 +00:00
let vcProbability;
if (null != value) {
vcProbability = value.vcProbability;
}
let num = 0;
if (null != vcProbability) {
num = vcProbability;
}
return num > 0.5;
}
};
return callback(UserAffinitiesV2Store, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-20 16:05:17 +00:00
tmp5.displayName = "UserAffinitiesV2Store";
tmp5.persistKey = "UserAffinitiesStoreV2";
obj = {
LOAD_USER_AFFINITIES_V2: function handleLoadUserAffinities() {
2026-07-23 10:11:24 +00:00
let c8 = true;
2026-07-20 16:05:17 +00:00
},
LOAD_USER_AFFINITIES_V2_SUCCESS: function handleLoadUserAffinitiesSuccess(affineUsers) {
obj.lastFetched = Date.now();
2026-07-23 10:11:24 +00:00
let c8 = false;
2026-07-20 16:05:17 +00:00
obj.userAffinities = affineUsers.affineUsers;
recomputeAffinities();
},
LOAD_USER_AFFINITIES_V2_FAILURE: function handleLoadUserAffinitiesFailure() {
2026-07-23 10:11:24 +00:00
let c8 = false;
2026-07-20 16:05:17 +00:00
},
LOGOUT: function handleLogout() {
const obj = {};
const merged = Object.assign(frozen);
const map = new Map();
2026-07-23 10:11:24 +00:00
let c8 = false;
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
tmp5 = new tmp5(require("dispatcher"), obj);
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/user_affinities/UserAffinitiesV2Store.tsx");
2026-07-20 16:05:17 +00:00
export default tmp5;