195 lines
9.9 KiB
TypeScript
195 lines
9.9 KiB
TypeScript
/* Metro module 5244; source: modules/friend_suggestions/FriendSuggestionStore.tsx; dependencies: [6, 7, 15, 17, 18, 1885, 1878, 22, 5245, 5246, 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 Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import UserRecord from '../../records/UserRecord.tsx'; /* Metro dependency 1885 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun46665(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:6, offset: 0x011acc3e, size: 389 bytes, params: 8, frame: 19
|
|
const transformFriendSuggestions2 = transformFriendSuggestions;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_9 = {};
|
|
const Store = (Flux).Store;
|
|
let value = _fun46673(Store);
|
|
value.displayName = 'FriendSuggestionStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONNECTION_OPEN: CONNECTION_OPEN_46680, FRIEND_SUGGESTION_CREATE: FRIEND_SUGGESTION_CREATE,
|
|
FRIEND_SUGGESTION_DELETE: FRIEND_SUGGESTION_DELETE, LOAD_FRIEND_SUGGESTIONS_SUCCESS: function(a0) {
|
|
env0_11 = false;
|
|
env0_10 = importDefault(dependencyMap[7]).keys(transformFriendSuggestions(a0.suggestions)).length;
|
|
}, LOAD_FRIEND_SUGGESTIONS_FAILURE: function() {
|
|
env0_11 = false;
|
|
env0_9 = {};
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/friend_suggestions/FriendSuggestionStore.tsx');
|
|
exports.default = value;
|
|
exports.transformFriendSuggestions = transformFriendSuggestions2;
|
|
function _isNativeReflectConstruct_46666() { // fn#46666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:168, offset: 0x011acdc3, 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_46666_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function transformSuggestion(a0) { // fn#46669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:384, offset: 0x011ace21, size: 185 bytes, params: 2, frame: 18
|
|
const r1 = a0.contact_names == null ? [] : a0.contact_names.length >= 2 ? a0.contact_names.slice(0, 2) : [];
|
|
const object = {};
|
|
object.key = a0.suggested_user.id;
|
|
const value2 = undefined;
|
|
const defaultImport = Module00022;
|
|
const value3 = defaultImport.first(a0.reasons);
|
|
object.name = value3 == null ? value2 : value3.name;
|
|
const userRecord2 = new UserRecord(a0.suggested_user);
|
|
object.user = userRecord2;
|
|
object.mutualFriendsCount = a0.mutual_friends_count;
|
|
object.contactNames = r1;
|
|
return object;
|
|
}
|
|
|
|
function transformFriendSuggestions(a0) { // fn#46670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:675, offset: 0x011aceda, size: 83 bytes, params: 2, frame: 12
|
|
let value = Module00022;
|
|
value = value.chain(a0);
|
|
value = value.map(function(a0) {
|
|
return transformSuggestion(a0);
|
|
});
|
|
value = value.keyBy(function(a0) {
|
|
return a0.key;
|
|
});
|
|
return value.value();
|
|
}
|
|
|
|
function _fun46673(a0) { // fn#46673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:803, offset: 0x011acf40, size: 139 bytes, params: 2, frame: 16
|
|
const FriendSuggestionStore2 = FriendSuggestionStore;
|
|
Inherits(FriendSuggestionStore2, a0);
|
|
return CreateClass(FriendSuggestionStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(UserStore);
|
|
}}, {key: 'getSuggestionCount', value: value_46676}, {key: 'getSuggestions', value: value_46677},
|
|
{key: 'getSuggestion', value: value_46679}]);
|
|
function FriendSuggestionStore() { // fn#46674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:815, offset: 0x00ea76ec, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, FriendSuggestionStore);
|
|
const value3 = env1_5(FriendSuggestionStore);
|
|
return env1_4(this, _isNativeReflectConstruct_46666() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_46676() { // fn#46676, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
|
|
return env1_10;
|
|
}
|
|
|
|
function value_46677() { // fn#46677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:1249, offset: 0x011acfcb, size: 45 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const Object = global.Object;
|
|
const entries = Object.entries;
|
|
let value = environment.__proto__;
|
|
return Reflect.apply(entries, Object, [env1_9]).map(function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
var iterator = a0[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
if (value2) {
|
|
r0 = value;
|
|
r1 = item2;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = value;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
} else {
|
|
r0 = item;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
}
|
|
}
|
|
if (!r2) {
|
|
r1.return();
|
|
}
|
|
return r0;
|
|
});
|
|
}
|
|
|
|
function value_46679(a0) { // fn#46679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:1332, offset: 0x010197cf, size: 16 bytes, params: 2, frame: 2
|
|
return env1_9[a0];
|
|
}
|
|
|
|
}
|
|
|
|
function CONNECTION_OPEN_46680({friendSuggestionCount}) { // fn#46680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:1453, offset: 0x011acff8, size: 125 bytes, params: 2, frame: 12
|
|
env0_9 = {};
|
|
if (friendSuggestionCount > 0) {
|
|
if (!env0_11 && true) {
|
|
(importDefault(5245) /* metro dependency 5245: FriendSuggestionActionCreators */).fetch();
|
|
}
|
|
} else {
|
|
(importDefault(5246) /* metro dependency 5246: maybeDispatchDevOnlyDummyFriendSuggestions */)();
|
|
}
|
|
}
|
|
|
|
function FRIEND_SUGGESTION_CREATE({suggestion}) { // fn#46681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:1624, offset: 0x011ad075, size: 86 bytes, params: 2, frame: 14
|
|
const value2 = transformSuggestion(suggestion);
|
|
let binding = env0_9;
|
|
if (binding[value2.key] != null) {
|
|
return false;
|
|
}
|
|
binding = env0_10;
|
|
env0_10 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
const object = {};
|
|
copyDataProperties(object, env0_9, value2);
|
|
object[value2.key] = value2;
|
|
}
|
|
|
|
function FRIEND_SUGGESTION_DELETE({suggestedUserId}) { // fn#46682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5422:1781, offset: 0x011ad0cb, size: 60 bytes, params: 2, frame: 14
|
|
const Math = global.Math;
|
|
const max = Math.max;
|
|
const binding = env0_10;
|
|
env0_10 = Reflect.apply(max, Math, [0, typeof binding === 'bigint' ? binding - 1n : +binding - 1]);
|
|
delete env0_9[suggestedUserId];
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun46665, 5244, [6, 7, 15, 17, 18, 1885, 1878, 22, 5245, 5246, 566, 694,
|
|
2]) /* metro module 5244, dependencies: [6, 7, 15, 17, 18, 1885, 1878, 22, 5245, 5246, 566, 694, 2] */;
|